1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[4361,6784],{4361:(t,e,r)=>{r.r(e),r.d(e,{default:()=>m});var o=r(19250),n=r(2779);function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function c(t,e){for(var r=0;r<e.length;r++){var o=e[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,(n=o.key,c=void 0,c=function(t,e){if("object"!==i(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,e||"default");if("object"!==i(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(n,"string"),"symbol"===i(c)?c:String(c)),o)}var n,c}function u(t,e){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},u(t,e)}function s(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,o=a(t);if(e){var n=a(this).constructor;r=Reflect.construct(o,arguments,n)}else r=o.apply(this,arguments);return function(t,e){if(e&&("object"===i(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,r)}}function a(t){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},a(t)}var l=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&u(t,e)}(l,window.PluginBaseClass);var e,r,i,a=s(l);function l(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,l),a.apply(this,arguments)}return e=l,r=[{key:"init",value:function(){this._clearBtn=this.el.querySelector(".btn-clear"),this._printBtn=this.el.querySelector(".btn-printer"),this.registerShowDifferencesBtnEvent(),this.insertStoredContent(),this._registerEvents()}},{key:"registerShowDifferencesBtnEvent",value:function(){var t=document.querySelector(".btn-show-differences");t.addEventListener("change",(function(){t.checked?document.querySelectorAll("tbody#specification tr.property:not(:first-child)").forEach((function(t){var e=Array.from(t.querySelectorAll("td.properties-value")).map((function(t){return t.textContent.trim()}));e.every((function(t){return t===e[0]}))&&(t.style.display="none")})):document.querySelectorAll("tbody#specification tr.property").forEach((function(t){t.style.display="table-row"}))}))}},{key:"insertStoredContent",value:function(){this.fetch()}},{key:"fetch",value:function(t){function e(){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(){var t=this,e={};e.productIds=n.Z.getAddedProductsList(),o.Z.create(this.el),fetch(window.router["frontend.compare.content"],{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}).then((function(t){return t.text()})).then((function(e){o.Z.remove(t.el),t.renderCompareProducts(e),t.$emitter.publish("insertStoredContent",{response:e})}))}))},{key:"renderCompareProducts",value:function(t){this.el.querySelector(".compare-product-content").innerHTML=t,window.PluginManager.initializePlugins()}},{key:"_registerEvents",value:function(){var t=this;document.$emitter.subscribe("removeCompareProduct",(function(e){var r=t.el.querySelector("table"),o=r.rows;if(2===r.querySelectorAll("thead tr td").length)return r.style.display="none",n.Z.clear(),void t.insertStoredContent();for(var i=0;i<o.length;i+=1)try{o[i].deleteCell(e.detail.product.productRow)}catch(t){}})),this._clearBtn.addEventListener("click",(function(){n.Z.clear(),t.fetch()})),this._printBtn.addEventListener("click",(function(){window.print()}))}}],r&&c(e.prototype,r),i&&c(e,i),Object.defineProperty(e,"prototype",{writable:!1}),l}(),f=r(26784);function d(t){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},d(t)}function p(t,e){for(var r=0;r<e.length;r++){var o=e[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,(n=o.key,i=void 0,i=function(t,e){if("object"!==d(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,e||"default");if("object"!==d(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(n,"string"),"symbol"===d(i)?i:String(i)),o)}var n,i}
1function y(t,e){return y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},y(t,e)}function h(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,o=b(t);if(e){var n=b(this).constructor;r=Reflect.construct(o,arguments,n)}else r=o.apply(this,arguments);return function(t,e){if(e&&("object"===d(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,r)}}function b(t){return b=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},b(t)}var m=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&y(t,e)}(i,t);var e,r,o,n=h(i);function i(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),n.apply(this,arguments)}return e=i,(r=[{key:"renderCompareProducts",value:function(t){this.el.querySelector(".compare-product-content").innerHTML=t;try{window.PluginManager.register("AddToCompareButton",f.default,"[data-add-to-compare-button]")}catch(t){}window.PluginManager.initializePlugins()}}])&&p(e.prototype,r),o&&p(e,o),Object.defineProperty(e,"prototype",{writable:!1}),i}(l)},26784:(t,e,r)=>{r.r(e),r.d(e,{default:()=>p});var o=r(2779);function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function i(t,e){for(var r=0;r<e.length;r++){var o=e[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,a(o.key),o)}}function c(t,e){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},c(t,e)}function u(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,o=s(t);if(e){var i=s(this).constructor;r=Reflect.construct(o,arguments,i)}else r=o.apply(this,arguments);return function(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,r)}}
1function s(t){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},s(t)}function a(t){var e=function(t,e){if("object"!==n(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,e||"default");if("object"!==n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===n(e)?e:String(e)}var l,f,d,p=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&c(t,e)}(a,window.PluginBaseClass);var e,r,n,s=u(a);function a(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),s.apply(this,arguments)}return e=a,(r=[{key:"init",value:function(){this.REMOVE_COMPARE_PRODUCT_EVENT="removeCompareProduct",this._checkAddedProduct(),this._registerEvents()}},{key:"_isAddedProduct",value:function(t){return o.Z.getAddedProductsList().indexOf(t)>-1}},{key:"_checkAddedProduct",value:function(){var t=this.options,e=t.productId,r=t.addedText,o=t.isAddedToCompareClass;this._isAddedProduct(e)&&r&&(this._toggleText(this.el,r),this.el.classList.add(o))}},{key:"_toggleText",value:function(t,e){if(!this.options.showIconOnly){var r=t.querySelector(".compare-button-text");r?r.textContent=e:t.textContent=e}}},{key:"_registerCompareButtonSelection",value:function(){var t=this,e=this.el,r=this.options,n=r.isAddedToCompareClass,i=r.productId;e.addEventListener("click",(function(){try{e.classList.contains(n)?(t._handleBeforeRemove(),o.Z.remove(i)):o.Z.add(i)&&t._handleBeforeAdd()}catch(t){o.Z.clear()}}))}},{key:"_handleBeforeRemove",value:function(){var t=this.options,e=t.defaultText,r=t.isAddedToCompareClass,o={productId:t.productId};this.el.closest("td")?o.productRow=this.el.closest("td").cellIndex:this.el.closest(".offcanvas-comparison-item")?this.el.closest(".offcanvas-comparison-item").style.display="none":(this._toggleText(this.el,e),this.el.classList.remove(r)),document.$emitter.publish(this.REMOVE_COMPARE_PRODUCT_EVENT,{product:o})}},{key:"_handleBeforeAdd",value:function(){var t=this.options,e=t.addedText,r=t.isAddedToCompareClass;this._toggleText(this.el,e),this.el.classList.add(r)}},{key:"_registerEvents",value:function(){var t=this;this._registerCompareButtonSelection();var e=this.options,r=e.productId,o=e.isAddedToCompareClass,n=e.defaultText;document.$emitter.subscribe(this.REMOVE_COMPARE_PRODUCT_EVENT,(function(e){e.detail.product.productId===r&&(t._toggleText(t.el,n),t.el.classList.remove(o))}))}}])&&i(e.prototype,r),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),a}();l=p,d={isAddedToCompareClass:"is-added-to-compare"},(f=a(f="options"))in l?Object.defineProperty(l,f,{value:d,enumerable:!0,configurable:!0,writable:!0}):l[f]=d},2779:(t,e,r)=>{r.d(e,{Z:()=>o});const o=class{static key="compare-widget-added-products";static maximumCompareProducts=4;static getAddedProductsList(){let t;try{t=JSON.parse(window.localStorage.getItem(this.key))||[]}catch{this.clear(),t={}}return this._checkCompareProductStorage(t)?t:(this.clear(),{})}static add(t){const e=this.getAddedProductsList(),r=e.length;return document.$emitter.publish("beforeAddProductCompare",{productCount:r}),!(r+1>this.maximumCompareProducts)&&(e.push(t),this.persist(e),!0)}static remove(t){const e=this.getAddedProductsList(),r=e.indexOf(t);return-1!==r&&(e.splice(r,1),this.persist(e),!0)}static persist(t){window.localStorage.setItem(this.key,JSON.stringify(t)),document.$emitter.publish("changedProductCompare",{products:t})}static clear(){window.localStorage.removeItem(this.key)}static _checkCompareProductStorage(t){return t.length<=this.maximumCompareProducts}}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.