{"version":3,"sources":["webpack:///./app/components/o/product-comparison/index.js"],"names":["$","ProductComparison","element","options","__e","__o","__s","extend","loglevel","minProductsToCompare","maxProductsToCompare","fps","labels","AddProduct","AddAnotherProduct","CompareProducts","ComparisonNotPossible","urlParamName","comparisonURL","sameCcatComparisionIds","__c","idle","idleChanged","products","productsChanged","displayListChanged","displayListUpdating","activeCategory","activeCategoryChanged","modal","modalType","modalChanged","modalProducts","modalProductsChanged","modalCommitBtn","modalElements","dragSrcElement","pending_product_id","deleteModal","brandName","productcategory","TYPE_ADD_PRODUCTS","TYPE_CHANGE_ORDER","reloadPage","params","getProductList","redirectTo","__buildQueryString","__info","window","location","href","isEnoughToCompare","numProductSelected","toggleProduct","product_id","arguments","length","undefined","__debug","isProductSelected","removeProduct","addProduct","selected","indexOf","RESULT","n","Object","fromEntries","Map","find","toArray","map","checkBox","index","array","$checkBox","value","attr","name","hasOwnProperty","join","moveSelectedProduct","after_product_id","invalidate","__warning","currIdx","afterIdx","console","log","__invalidateDisplayList","push","setActiveCategory","__getProductCategory","i","splice","rejectProducts","JSON","parse","stringify","ccat_id","__commitModalProducts","event","data","eventtype","selectedfilteroptions","brandname","track","setTimeout","createCompareLink","delim","encodeURIComponent","__areModalProductsDifferent","__handleLabelClick","a","link","split","product1","product2","product3","product4","product5","product6","productamount","__initCollection","search","each","decodeURIComponent","checkbox","ccatHolder","closest","parseInt","__handleDragEvent","type","originalEvent","dataTransfer","effectAllowed","setData","html","innerHTML","addClass","classList","add","preventDefault","dropEffect","removeClass","stopPropagation","dragData","getData","item","__getQueryString","key","res","itm","qs","substring","pattern","exec","override","entries","url","protocol","host","pathname","urlVars","encodeURI","__toggleProductHandler","currentTarget","val","__updateDisplayList","css","on","off","allowAdd","otherCategory","checked","disabled","prop","differ","cards","overviewItems","tableItems","card","label","text","overviewItem","is","fadeOut","tableItem","checkboxes","__tick","__log","Array","prototype","slice","call","__error","p","info","apply","warn","error","__construct","toString","productOverviewContainer","hasClass","setInterval","fn","productComparison","e","config","document","jQuery","initializeTags","card_id","$card","row_id","$row","isHeadline","filterByTags","showTag","parent","id","active","visible","trigger"],"mappings":";;;;;;;;;;;AAAA;AAAA;AAAA;AACA;AACA;AACA;AAC8D;AAE9D,CAAC,UAAUA,CAAC,EAAE;EACZ;AACF;AACA;AACA;AACA;AACA;EACE,MAAMC,iBAAiB,GAAG,SAAAA,CAAUC,OAAO,EAAEC,OAAO,EAAE;IACpD;AACJ;AACA;IACI,MAAMC,GAAG,GAAGJ,CAAC,CAACE,OAAO,CAAC;;IAEtB;AACJ;AACA;IACI,MAAMG,GAAG,GAAG,IAAI;;IAEhB;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IACI,MAAMC,GAAG,GAAGN,CAAC,CAACO,MAAM,CAClB;MACEC,QAAQ,EAAE,CAAC;MACXC,oBAAoB,EAAE,CAAC;MACvBC,oBAAoB,EAAE,CAAC;MACvBC,GAAG,EAAE,EAAE;MACPC,MAAM,EAAE;QACNC,UAAU,EAAE,aAAa;QACzBC,iBAAiB,EAAE,mCAAmC;QACtDC,eAAe,EAAE,0BAA0B;QAC3CC,qBAAqB,EAAE;MACzB,CAAC;MACDC,YAAY,EAAE,SAAS;MACvBC,aAAa,EAAE,6BAA6B;MAC5CC,sBAAsB,EAAE;IAC1B,CAAC,EACDhB,OAAO,IAAI,CAAC,CAAC,CACd;;IAED;AACJ;AACA;AACA;IACI,MAAMiB,GAAG,GAAG;MACVC,IAAI,EAAE,KAAK;MACXC,WAAW,EAAE,KAAK;MAClBC,QAAQ,EAAE,EAAE;MACZC,eAAe,EAAE,IAAI;MACrBC,kBAAkB,EAAE,KAAK;MACzBC,mBAAmB,EAAE,KAAK;MAE1BC,cAAc,EAAE,IAAI;MACpBC,qBAAqB,EAAE,KAAK;MAE5BC,KAAK,EAAE,IAAI;MACXC,SAAS,EAAE,IAAI;MAAE;MACjBC,YAAY,EAAE,KAAK;MACnBC,aAAa,EAAE,EAAE;MAAE;MACnBC,oBA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rN,CAAC,CAAC,cAAc,CAAC,CAAC2N,YAAY,EAAE,CAACrJ,IAAI,CAAC,0BAA0B,CAAC,CAAC2J,OAAO,CAAC,OAAO,CAAC,C","file":"product-comparison.chunk.js","sourcesContent":["/*!\r\n * @link https://www.kittelberger.de/\r\n * @copyright Copyright (c) 2020 Kittelberger media solutions GmbH\r\n */\r\nimport { track } from '../../../core/js/libs/TrackingService';\r\n\r\n(function ($) {\r\n /**\r\n * The [ProductComparison] class manages the functionality for product comparison.\r\n * @class\r\n * @param {HTMLElement} element The HTML element to which the class is applied.\r\n * @param {object} options The properties for this class instance.\r\n */\r\n const ProductComparison = function (element, options) {\r\n /**\r\n * @property {array} __e - jQuery Selector of the selected HTML element.\r\n */\r\n const __e = $(element);\r\n\r\n /**\r\n * @property {ProductComparison} __o - Instance of this class.\r\n */\r\n const __o = this;\r\n\r\n /**\r\n * @private\r\n * @property {ProductComparison} __s - Class settings which can be overwritten by [o] in the class constructor.\r\n * @property {int} __s.loglevel - Log level of the class, a value between 0 and 3. The smaller the value, the more talkative the class is.\r\n * @property {int} __s.minProductsToCompare - The minimum number of products required for a product comparison.\r\n * @property {int} __s.maxProductsToCompare - The maximum number of products allowed for product comparison.\r\n * @property {int} __s.fps - Immitating frames per second; the interval to update the views. See [__updateDisplayList].\r\n * @property {string[]} __s.labels - All translatable texts\r\n * @property {string} __s.urlParamName - Name of the URL-Parameter to pass the collected products\r\n * @property {array} __s.sameCcatComparisionIds - The ID's of the categories whose products can be compared only within the same category\r\n */\r\n const __s = $.extend(\r\n {\r\n loglevel: 1,\r\n minProductsToCompare: 2,\r\n maxProductsToCompare: 2,\r\n fps: 24,\r\n labels: {\r\n AddProduct: 'Vergleichen',\r\n AddAnotherProduct: 'Mindestens {n} Produkte auswählen',\r\n CompareProducts: 'Produktvergleich starten',\r\n ComparisonNotPossible: 'Kein Vergleich möglich',\r\n },\r\n urlParamName: 'compare',\r\n comparisonURL: './T-Product-Comparison.html',\r\n sameCcatComparisionIds: [],\r\n },\r\n options || {}\r\n );\r\n\r\n /**\r\n * @private\r\n * Internal namespace for private class properties.\r\n */\r\n const __c = {\r\n idle: false,\r\n idleChanged: false,\r\n products: [],\r\n productsChanged: true,\r\n displayListChanged: false,\r\n displayListUpdating: false,\r\n\r\n activeCategory: null,\r\n activeCategoryChanged: false,\r\n\r\n modal: null,\r\n modalType: null, // either __c.TYPE_ADD_PRODUCTS or __c.CHANGE_ORDER\r\n modalChanged: false,\r\n modalProducts: [], // temporary collection for the products in the modal view (addProduct, changeOrder)\r\n modalProductsChanged: false,\r\n modalCommitBtn: null,\r\n modalElements: [],\r\n dragSrcElement: null,\r\n pending_product_id: null,\r\n deleteModal: null,\r\n\r\n brandName: null,\r\n productcategory: null,\r\n\r\n TYPE_ADD_PRODUCTS: 'ADD_PRODUCTS',\r\n TYPE_CHANGE_ORDER: 'CHANGE_ORDER',\r\n };\r\n\r\n /**\r\n * Reload the page\r\n * @public\r\n */\r\n this.reloadPage = function () {\r\n const params = {};\r\n params[__s.urlParamName] = __o.getProductList();\r\n const redirectTo = __buildQueryString(params);\r\n __info('Page will redirect to \"' + redirectTo + '\"...');\r\n window.location.href = redirectTo;\r\n };\r\n\r\n /**\r\n * Checks if enough products were collected to display a product comparison.\r\n * @public\r\n * @return {bool} Whether enough products were collected to display a product comparison.\r\n */\r\n this.isEnoughToCompare = function () {\r\n return __o.numProductSelected() >= __s.minProductsToCompare;\r\n };\r\n\r\n /**\r\n * Adds a product to the collection or removes it from the list if it is already in the list\r\n * @public\r\n * @param {string} product_id - The ID of the product\r\n * @param {bool} modal - When true, use the collection of the modal products, otherwise global products (default)\r\n * @return {ProductComparison} The instance of the ProductComparison class for method chaining.\r\n */\r\n this.toggleProduct = function (product_id, modal = false) {\r\n __debug('ProductComparison->toggleProduct()', {\r\n product_id: product_id,\r\n modal: modal,\r\n });\r\n if (__o.isProductSelected(product_id, modal)) {\r\n __o.removeProduct(product_id, modal, true);\r\n } else {\r\n __o.addProduct(product_id, modal, true);\r\n }\r\n __info(__o.numProductSelected(modal) + ' Products selected.');\r\n return this;\r\n };\r\n\r\n /**\r\n * Checks whether the product has already been collected.\r\n * @public\r\n * @param {string} product_id - The ID of the product\r\n * @param {bool} modal - When true, use the collection of the modal products, otherwise global products (default)\r\n * @return {bool} Whether the product has already been collected.\r\n */\r\n this.isProductSelected = function (product_id, modal = false) {\r\n const products = modal ? __c.modalProducts : __c.products;\r\n const selected = products.indexOf(product_id) > -1;\r\n __debug('ProductComparison->isProductSelected()', {\r\n product_id: product_id,\r\n modal: modal,\r\n RESULT: selected,\r\n });\r\n return selected;\r\n };\r\n\r\n /**\r\n * Returns the number of collected products.\r\n * @public\r\n * @param {bool} modal - When true, use the collection of the modal products, otherwise global products (default)\r\n * @return {int} The number of collected products.\r\n */\r\n this.numProductSelected = function (modal = false) {\r\n const products = modal ? __c.modalProducts : __c.products;\r\n const n = products.length;\r\n __debug('ProductComparison->numProductSelected()', {\r\n modal: modal,\r\n RESULT: n,\r\n });\r\n return n;\r\n };\r\n\r\n /**\r\n * Returns the product_id´s of collected products as comma-separated list.\r\n * @public\r\n * @param {bool} modal - When true, use the collection of the modal products, otherwise global products (default)\r\n * @param {bool} labels - When true, returns the names of the products instead of the product ids (e.g. for tracking)\r\n * @return {int} The product_id´s or product names of collected products as comma-separated list.\r\n */\r\n this.getProductList = function (modal, labels = false) {\r\n let products = modal ? __c.modalProducts : __c.products;\r\n if (labels) {\r\n // labels = key-value pairs of all checkboxes where the key is the id of the product\r\n // and the value is the data-productname or id\r\n const labels = Object.fromEntries(\r\n new Map(\r\n __e\r\n .find('input:checkbox[name=product_compare]')\r\n .toArray()\r\n .map(function (checkBox, index, array) {\r\n const $checkBox = $(checkBox);\r\n const value = $checkBox.attr('value');\r\n const name = $checkBox.attr('data-productname');\r\n return [value, name || value];\r\n })\r\n )\r\n );\r\n products = products.map((product_id) => {\r\n return labels.hasOwnProperty(product_id) ? labels[product_id] : product_id;\r\n });\r\n }\r\n return products.join(',');\r\n };\r\n\r\n /**\r\n * Adds a product to the collection, if it is not already collected.\r\n * @public\r\n * @param {string} product_id - The ID of the product\r\n * @param {bool} modal - When true, use the collection of the modal products, otherwise global products (default)\r\n * @param {boolean} invalidate - Either to force an view update (default) or not\r\n * @return {ProductComparison} The instance of the ProductComparison class for method chaining.\r\n */\r\n this.moveSelectedProduct = function (product_id, after_product_id, modal = false, invalidate = true) {\r\n if (typeof product_id !== 'string' || product_id == '') {\r\n return;\r\n }\r\n __debug('ProductComparison->moveSelectedProduct()', {\r\n product_id: product_id,\r\n after_product_id: after_product_id,\r\n modal: modal,\r\n invalidate: invalidate,\r\n });\r\n if (!__o.isProductSelected(product_id, modal) || !__o.isProductSelected(after_product_id, modal)) {\r\n __warning('None or not all given products are selected at the moment.');\r\n return this;\r\n }\r\n if (modal) {\r\n const currIdx = __c.modalProducts.indexOf(product_id);\r\n const afterIdx = __c.modalProducts.indexOf(after_product_id);\r\n\r\n console.log({\r\n modal: modal,\r\n currIdx: currIdx,\r\n afterIdx: afterIdx,\r\n });\r\n } else {\r\n const currIdx = __c.products.indexOf(product_id);\r\n const afterIdx = __c.products.indexOf(after_product_id);\r\n console.log({\r\n modal: modal,\r\n currIdx: currIdx,\r\n afterIdx: afterIdx,\r\n });\r\n }\r\n };\r\n\r\n /**\r\n * Adds a product to the collection, if it is not already collected.\r\n * @public\r\n * @param {string} product_id - The ID of the product\r\n * @param {bool} modal - When true, use the collection of the modal products, otherwise global products (default)\r\n * @param {boolean} invalidate - Either to force an view update (default) or not\r\n * @return {ProductComparison} The instance of the ProductComparison class for method chaining.\r\n */\r\n this.addProduct = function (product_id, modal = false, invalidate = true) {\r\n if (typeof product_id !== 'string' || product_id == '') {\r\n return;\r\n }\r\n __debug(\r\n 'ProductComparison->addProduct()',\r\n product_id,\r\n modal ? 'MODAL_COLLECTION' : 'GENERAL_COLLECTION',\r\n invalidate ? 'INVALIDATE' : 'NO_INVALIDATE'\r\n );\r\n if (__o.isProductSelected(product_id, modal)) {\r\n return this;\r\n }\r\n if (__o.numProductSelected(modal) >= __s.maxProductsToCompare) {\r\n __warning(\r\n `A maximum of ${\r\n __s.maxProductsToCompare\r\n } products can be compared! You have already collected ${__o.numProductSelected()} products.`\r\n );\r\n // have to invalidate html, but not to save/load\r\n __c.productsChanged = true;\r\n __invalidateDisplayList();\r\n return this;\r\n }\r\n if (modal) {\r\n __c.modalProducts.push(product_id);\r\n } else {\r\n __c.products.push(product_id);\r\n }\r\n\r\n if (invalidate) {\r\n if (modal) {\r\n __c.modalProductsChanged = true;\r\n } else {\r\n __c.productsChanged = true;\r\n }\r\n __invalidateDisplayList();\r\n }\r\n __o.setActiveCategory(__getProductCategory(product_id));\r\n return this;\r\n };\r\n\r\n /**\r\n * Removes a product from the collection.\r\n * @public\r\n * @param {string} product_id - The ID of the product\r\n * @param {bool} modal - When true, use the collection of the modal products, otherwise global products (default)\r\n * @param {boolean} invalidate - Either to force an view update (default) or not\r\n * @return {ProductComparison} The instance of the ProductComparison class for method chaining.\r\n */\r\n this.removeProduct = function (product_id, modal = false, invalidate = true) {\r\n __debug('ProductComparison->removeProduct()', {\r\n product_id: product_id,\r\n modal: modal,\r\n invalidate: invalidate,\r\n });\r\n if (modal) {\r\n const i = __c.modalProducts.indexOf(product_id);\r\n if (i > -1) {\r\n __c.modalProducts.splice(i, 1);\r\n if (invalidate) {\r\n __c.modalProductsChanged = true;\r\n __invalidateDisplayList();\r\n }\r\n }\r\n } else {\r\n const i = __c.products.indexOf(product_id);\r\n if (i > -1) {\r\n __c.products.splice(i, 1);\r\n if (invalidate) {\r\n __c.productsChanged = true;\r\n __invalidateDisplayList();\r\n }\r\n }\r\n }\r\n\r\n if (__o.numProductSelected(modal) == 0) {\r\n __o.setActiveCategory(null);\r\n }\r\n return this;\r\n };\r\n\r\n /**\r\n * Resets the list of collected products. For the general list, this means that the list will be emptied completely.\r\n * For the list of products in the modal window, it means that the list is set to the entries of the general products.\r\n * @public\r\n * @param {bool} modal - When true, use the collection of the modal products, otherwise global products (default)\r\n * @param {boolean} invalidate - Either to force an view update (default) or not\r\n * @return {ProductComparison} The instance of the ProductComparison class for method chaining.\r\n */\r\n this.rejectProducts = function (modal = false, invalidate = true) {\r\n __debug('ProductComparison->rejectProducts()', {\r\n modal: modal,\r\n invalidate: invalidate,\r\n });\r\n\r\n if (modal) {\r\n __c.modalProducts = JSON.parse(JSON.stringify(__c.products));\r\n if (invalidate) {\r\n __c.modalProductsChanged = true;\r\n __invalidateDisplayList();\r\n }\r\n } else {\r\n __c.products = [];\r\n if (invalidate) {\r\n __c.productsChanged = true;\r\n __invalidateDisplayList();\r\n }\r\n }\r\n\r\n return this;\r\n };\r\n\r\n this.setActiveCategory = function (ccat_id) {\r\n if (__c.activeCategory === ccat_id) {\r\n return;\r\n }\r\n __c.activeCategory = ccat_id;\r\n __c.activeCategoryChanged = true;\r\n if (__c.activeCategory === null) {\r\n __info('The current category has been reset.');\r\n } else {\r\n __info('The current category has been changed to \"' + ccat_id + '\".');\r\n }\r\n __invalidateDisplayList();\r\n };\r\n\r\n /**\r\n * @private\r\n * Applies the changes of the modified modal product collection to the general product selection\r\n */\r\n const __commitModalProducts = function (event) {\r\n __info('The changes to the product list from the modal are now applied. The page must be updated afterwards.');\r\n __c.products = JSON.parse(JSON.stringify(__c.modalProducts));\r\n __c.productsChanged = true;\r\n __c.modalProductsChanged = true;\r\n __invalidateDisplayList();\r\n\r\n __debug('ProductComparison->__commitModalProducts()', {\r\n event: event,\r\n products: __c.products,\r\n modalProducts: __c.modalProducts,\r\n });\r\n\r\n const products = __o.getProductList(true, true);\r\n const data = {\r\n eventtype: 'confirmproductselectionbuttonclick',\r\n selectedfilteroptions: products,\r\n brandname: __c.brandName,\r\n };\r\n __info('tracking', JSON.stringify(data));\r\n\r\n track(data);\r\n\r\n setTimeout(() => {\r\n __o.reloadPage();\r\n }, 250);\r\n };\r\n\r\n this.createCompareLink = function () {\r\n const delim = __s.comparisonURL.indexOf('?') > -1 ? '&' : '?';\r\n return [__s.comparisonURL, delim, __s.urlParamName, '=', encodeURIComponent(__o.getProductList())].join('');\r\n };\r\n\r\n /**\r\n * @private\r\n * Checks if the selection of products in the modal is different from the global product selection.\r\n * @return {boolean} if the selection of products in the modal is different from the global product selection.\r\n */\r\n const __areModalProductsDifferent = function () {\r\n return JSON.stringify(__c.products) !== JSON.stringify(__c.modalProducts);\r\n };\r\n\r\n /**\r\n * @private\r\n */\r\n const __handleLabelClick = function (a) {\r\n __debug('__handleLabelClick');\r\n const link = a.attr('href');\r\n if (link) {\r\n const products = __o.getProductList(false, true).split(',');\r\n const data = {\r\n eventtype: 'productcomparisonbuttonclick',\r\n product1: products.length > 0 ? products[0] : '',\r\n product2: products.length > 1 ? products[1] : '',\r\n product3: products.length > 2 ? products[2] : '',\r\n product4: products.length > 3 ? products[3] : '',\r\n product5: products.length > 4 ? products[4] : '',\r\n product6: products.length > 5 ? products[5] : '',\r\n productamount: products.length,\r\n brandname: __c.brandName,\r\n productcategory: __c.productcategory ? 'c-' + __c.productcategory : '',\r\n };\r\n __info('tracking', JSON.stringify(data));\r\n track(data);\r\n window.location.href = link;\r\n }\r\n };\r\n\r\n /**\r\n * @private\r\n * Initializes the product collection.\r\n * The method first checks the parameters passed in the URL. After that it checks all checkboxes and merges both values.\r\n * The checkboxes are always evaluated more than the URL parameters.\r\n * This method should be called at the first position in the constructor if possible!\r\n * @param {boolean} invalidate - Either to force an view update (default) or not\r\n */\r\n const __initCollection = function (invalidate = true) {\r\n // reset list\r\n __o.rejectProducts(false, false);\r\n // check url for passed product collection\r\n const products = (location.search.split(__s.urlParamName + '=')[1] || '').split('&')[0];\r\n $.each(products ? decodeURIComponent(products).split(',') : [], function (index, product_id) {\r\n __o.addProduct(product_id, false, false);\r\n });\r\n // second: check checkboxes\r\n __e.find('input:checkbox:checked[name=product_compare]').each(function () {\r\n const product_id = $(this).attr('value');\r\n __o.addProduct(product_id, false, false);\r\n });\r\n if (invalidate) {\r\n __c.productsChanged = true;\r\n __invalidateDisplayList();\r\n }\r\n __debug('ProductComparison->__initCollection()', __c.products);\r\n };\r\n\r\n /**\r\n * @private\r\n * Finds the ID of the category of the specified product.\r\n * @param {string} product_id - ID of the product whose category is being searched\r\n * @return {string} the ID of the category of the specified product or null.\r\n */\r\n const __getProductCategory = function (product_id) {\r\n const checkbox = __e.find('input:checkbox[name=product_compare][value=' + product_id + ']');\r\n const ccatHolder = checkbox ? checkbox.closest('*[data-ccatid]') : null;\r\n const ccat_id = ccatHolder ? parseInt(ccatHolder.attr('data-ccatid')) : null;\r\n // If a ccat_id was found, it must be in the list __s.sameCcatComparisionIds, otherwise the\r\n // products of the category can also be compared with products from other categories.\r\n if (ccat_id && __s.sameCcatComparisionIds.indexOf(ccat_id) > -1) {\r\n return ccat_id;\r\n }\r\n return 'UNRESTRICTED';\r\n };\r\n\r\n /**\r\n * @private\r\n * ...\r\n * @param {object} event - The drag event\r\n */\r\n const __handleDragEvent = function (event) {\r\n __debug('ProductComparison->__handleDragEvent()', { type: event.type });\r\n if (event.type === 'dragstart') {\r\n __c.dragSrcElement = this;\r\n event.originalEvent.dataTransfer.effectAllowed = 'move';\r\n event.originalEvent.dataTransfer.setData(\r\n 'text/plain',\r\n JSON.stringify({\r\n product_id: $(this).attr('data-product-id'),\r\n html: this.innerHTML,\r\n })\r\n );\r\n } else if (event.type === 'dragenter') {\r\n $(__c.dragSrcElement).addClass('over');\r\n this.classList.add('over');\r\n } else if (event.type === 'dragover') {\r\n if (event.preventDefault) {\r\n event.preventDefault();\r\n }\r\n event.originalEvent.dataTransfer.dropEffect = 'move';\r\n return false;\r\n } else if (event.type === 'dragleave') {\r\n $(__c.dragSrcElement).removeClass('over');\r\n } else if (event.type === 'drop') {\r\n if (event.stopPropagation) {\r\n event.stopPropagation();\r\n }\r\n if (__c.dragSrcElement != this) {\r\n const dragData = JSON.parse(event.originalEvent.dataTransfer.getData('text/plain'));\r\n $(__c.dragSrcElement).attr('data-product-id', $(this).attr('data-product-id')).html($(this).html());\r\n $(this).attr('data-product-id', dragData.product_id).html(dragData.html);\r\n }\r\n return false;\r\n } else if (event.type === 'dragend') {\r\n __c.modalProducts = [];\r\n __c.modalElements = __c.modal.find('.changeOrder__drag-elements__item[data-product-id]');\r\n __c.modalElements.each(function (index, item) {\r\n $(this).removeClass('over');\r\n __o.addProduct($(this).attr('data-product-id'), true, false);\r\n });\r\n __c.modalProductsChanged = true;\r\n __invalidateDisplayList();\r\n }\r\n };\r\n\r\n /**\r\n * @private\r\n * Get all or an specific url parameter.\r\n * @param {string} key - The name of a specific url parameter\r\n * @return {object}\r\n */\r\n const __getQueryString = function (key = null) {\r\n const res = {};\r\n let itm = null;\r\n const qs = location.search.substring(1);\r\n const pattern = /([^&=]+)=([^&]*)/g;\r\n while ((itm = pattern.exec(qs))) {\r\n if (key !== null && decodeURIComponent(itm[1]) === key) return decodeURIComponent(itm[2]);\r\n else if (key === null) res[decodeURIComponent(itm[1])] = decodeURIComponent(itm[2]);\r\n }\r\n return key === null ? res : null;\r\n };\r\n\r\n /**\r\n * @private\r\n * Creates an url with an key-value object of url parameters to override or add\r\n * @param {object|null} override - Optional. A key-value object of url parameters to override or add\r\n * @return {string} the new url\r\n */\r\n const __buildQueryString = function (override = null) {\r\n const params = __getQueryString();\r\n if (override) {\r\n for (const [key, value] of Object.entries(override)) {\r\n params[key] = value;\r\n }\r\n }\r\n const url = location.protocol + '//' + location.host + location.pathname;\r\n const urlVars = [];\r\n if (params) {\r\n for (const [key, value] of Object.entries(params)) {\r\n urlVars.push(key + '=' + encodeURI(value));\r\n }\r\n }\r\n const delim = urlVars.length ? '?' : '';\r\n return url + delim + urlVars.join('&');\r\n };\r\n\r\n const __toggleProductHandler = function (event) {\r\n const product_id = $(event.currentTarget).val();\r\n const modal = __c.modal !== null && __c.modalType !== null;\r\n __o.toggleProduct(product_id, modal);\r\n };\r\n\r\n /**\r\n * @private\r\n * Sets a flag to activate the update process [__updateDisplayList].\r\n */\r\n const __invalidateDisplayList = function () {\r\n __c.displayListChanged = true;\r\n __debug('ProductComparison->__invalidateDisplayList()');\r\n };\r\n\r\n /**\r\n * @private\r\n * Updates HTML markup, CSS etc. for all changed properties.\r\n */\r\n const __updateDisplayList = function () {\r\n if (!__c.displayListChanged || __c.displayListUpdating) {\r\n return;\r\n }\r\n __c.displayListUpdating = true;\r\n __c.displayListChanged = false;\r\n __debug('ProductComparison->__updateDisplayList()');\r\n\r\n if (__c.idleChanged) {\r\n if (__c.idle) {\r\n __e.css('cursor', 'wait');\r\n } else {\r\n __e.css('cursor', 'pointer');\r\n }\r\n }\r\n\r\n if (__c.modalChanged) {\r\n if (__c.modal !== null && __c.modalType !== null) {\r\n __info('Modal #\"' + __c.modalType + '\" opens...');\r\n\r\n __o.rejectProducts(true, true);\r\n\r\n if (__c.modalType === __c.TYPE_ADD_PRODUCTS) {\r\n __c.modalElements = __c.modal.find('input:checkbox[name=product_compare]');\r\n __c.modalElements.on('change', __toggleProductHandler);\r\n } else if (__c.modalType === __c.TYPE_CHANGE_ORDER) {\r\n __c.modalElements = __c.modal.find('.changeOrder__drag-elements__item[data-product-id]');\r\n __c.modalElements\r\n .on('dragstart', __handleDragEvent)\r\n .on('dragenter', __handleDragEvent)\r\n .on('dragover', __handleDragEvent)\r\n .on('dragleave', __handleDragEvent)\r\n .on('drop', __handleDragEvent)\r\n .on('dragend', __handleDragEvent);\r\n }\r\n } else if (__c.modal === null && __c.modalType !== null) {\r\n __info('Modal #\"' + __c.modalType + '\" closes...');\r\n __o.rejectProducts(true, true);\r\n __c.modalCommitBtn = null;\r\n if (__c.modalType === __c.TYPE_ADD_PRODUCTS) {\r\n __c.modalElements.off('change', __toggleProductHandler);\r\n } else if (__c.modalType === __c.TYPE_CHANGE_ORDER) {\r\n __c.modalElements\r\n .off('dragstart', __handleDragEvent)\r\n .off('dragenter', __handleDragEvent)\r\n .off('dragover', __handleDragEvent)\r\n .off('dragleave', __handleDragEvent)\r\n .off('drop', __handleDragEvent)\r\n .off('dragend', __handleDragEvent);\r\n }\r\n __c.modalElements = [];\r\n }\r\n __c.modalChanged = false;\r\n }\r\n\r\n if (__c.modalProductsChanged) {\r\n if (__c.modalType === __c.TYPE_ADD_PRODUCTS) {\r\n __debug({\r\n modalProducts: __c.modalProducts,\r\n minProductsToCompare: __s.minProductsToCompare,\r\n maxProductsToCompare: __s.maxProductsToCompare,\r\n });\r\n if (__c.modalElements && __c.modalElements.length) {\r\n const allowAdd = __o.numProductSelected(true) < __s.maxProductsToCompare; // if maximum reached, set to false!\r\n const numProductSelected = __o.numProductSelected(true);\r\n __c.modalElements.each(function (index) {\r\n const checkbox = $(this);\r\n const product_id = checkbox.attr('value');\r\n const ccat_id = __getProductCategory(product_id);\r\n const otherCategory = __c.activeCategory && ccat_id !== __c.activeCategory;\r\n const isProductSelected = __o.isProductSelected(product_id, true);\r\n const checked = !otherCategory && isProductSelected ? true : false;\r\n const disabled = (!checked && !allowAdd) || otherCategory ? true : false;\r\n checkbox.attr('checked', checked);\r\n checkbox.prop('disabled', disabled);\r\n });\r\n }\r\n } else if (__c.modalType === __c.TYPE_CHANGE_ORDER) {\r\n //\r\n }\r\n if (__c.modalCommitBtn) {\r\n const differ = __areModalProductsDifferent();\r\n __debug('Commit-Button is ' + (differ ? 'active' : 'disabled'));\r\n __c.modalCommitBtn.prop('disabled', !differ);\r\n }\r\n __c.modalProductsChanged = false;\r\n }\r\n\r\n if (__c.productsChanged || __c.activeCategoryChanged) {\r\n // Products-Tile-View\r\n const cards = __e.find('.product-tile__card');\r\n // T-Product-Comparison: Overview\r\n const overviewItems = __e.find('.product-overview__item');\r\n // M-024-Table-Single-B-Products-Left\r\n const tableItems = __e.find('.table-left');\r\n\r\n // @var bool allowAdd Defines whether or not additional products can be added to the product comparison\r\n const allowAdd = __o.numProductSelected() < __s.maxProductsToCompare; // if maximum reached, set to false!\r\n\r\n if (cards && cards.length) {\r\n cards.each(function (index) {\r\n const card = $(this);\r\n const checkbox = card.find('.product-tile__card__control input:checkbox[name=product_compare]');\r\n const label = card.find('.product-tile__card__control label');\r\n if (checkbox && checkbox.length) {\r\n const product_id = checkbox.attr('value');\r\n const ccat_id = __getProductCategory(product_id);\r\n const otherCategory = __c.activeCategory && ccat_id !== __c.activeCategory;\r\n const isProductSelected = __o.isProductSelected(product_id, false);\r\n const checked = !otherCategory && isProductSelected ? true : false;\r\n const disabled = (!checked && !allowAdd) || otherCategory ? true : false;\r\n let text = __s.labels.AddProduct;\r\n if (disabled) {\r\n text = __s.labels.ComparisonNotPossible;\r\n } else if (checked && __o.isEnoughToCompare()) {\r\n text = `<a href=\"${__o.createCompareLink()}\">${__s.labels.CompareProducts}</a>`;\r\n } else if (checked && !__o.isEnoughToCompare()) {\r\n text = __s.labels.AddAnotherProduct.split('{n}').join(__s.minProductsToCompare);\r\n } else {\r\n text = __s.labels.AddProduct;\r\n }\r\n checkbox.prop('checked', checked);\r\n checkbox.prop('disabled', disabled);\r\n label.html(text);\r\n label.css('cursor', disabled ? 'not-allowed' : 'pointer');\r\n }\r\n });\r\n } else if (overviewItems && overviewItems.length) {\r\n overviewItems.each(function (index) {\r\n const overviewItem = $(this);\r\n const product_id = overviewItem.attr('data-product-id');\r\n const ccat_id = __getProductCategory(product_id);\r\n const otherCategory = __c.activeCategory && ccat_id !== __c.activeCategory;\r\n const checked = !otherCategory && __o.isProductSelected(product_id, false) ? true : false;\r\n if (!checked && overviewItem.is(':visible')) {\r\n overviewItem.fadeOut();\r\n } else if (checked && !overviewItem.is(':visible')) {\r\n overviewItem.fadeOut();\r\n }\r\n });\r\n } else if (tableItems && tableItems.length) {\r\n tableItems.each(function (index) {\r\n const tableItem = $(this);\r\n const checkboxes = tableItem.find('input:checkbox[name=product_compare]');\r\n checkboxes.each(function (index) {\r\n const checkbox = $(this);\r\n const label = tableItem.find('label[for=' + checkbox.attr('id') + ']');\r\n const product_id = checkbox.attr('value');\r\n const ccat_id = __getProductCategory(product_id);\r\n const otherCategory = __c.activeCategory && ccat_id !== __c.activeCategory;\r\n const isProductSelected = __o.isProductSelected(product_id, false);\r\n const checked = !otherCategory && isProductSelected ? true : false;\r\n const disabled = (!checked && !allowAdd) || otherCategory ? true : false;\r\n let text = __s.labels.AddProduct;\r\n if (disabled) {\r\n text = __s.labels.ComparisonNotPossible;\r\n } else if (checked && __o.isEnoughToCompare()) {\r\n text = `<a href=\"${__o.createCompareLink()}\">${__s.labels.CompareProducts}</a>`;\r\n } else if (checked && !__o.isEnoughToCompare()) {\r\n text = __s.labels.AddAnotherProduct.split('{n}').join(__s.minProductsToCompare);\r\n } else {\r\n text = __s.labels.AddProduct;\r\n }\r\n checkbox.prop('checked', checked);\r\n checkbox.prop('disabled', disabled);\r\n label.html(text);\r\n label.css('cursor', disabled ? 'not-allowed' : 'pointer');\r\n });\r\n });\r\n }\r\n\r\n __c.productsChanged = false;\r\n __c.activeCategoryChanged = false;\r\n }\r\n __c.displayListUpdating = false;\r\n };\r\n\r\n /**\r\n * @private\r\n * Interval function which is called at intervals of [__s.fps].\r\n */\r\n const __tick = function () {\r\n __updateDisplayList();\r\n };\r\n\r\n /**\r\n * @private\r\n * Console logging for messages from [__s.loglevel] 0.\r\n */\r\n const __debug = function () {\r\n __log(0, Array.prototype.slice.call(arguments));\r\n };\r\n\r\n /**\r\n * @private\r\n * Console logging for messages from [__s.loglevel] 1.\r\n */\r\n const __info = function () {\r\n __log(1, Array.prototype.slice.call(arguments));\r\n };\r\n\r\n /**\r\n * @private\r\n * Console logging for messages from [__s.loglevel] 2.\r\n */\r\n const __warning = function () {\r\n __log(2, Array.prototype.slice.call(arguments));\r\n };\r\n\r\n /**\r\n * @private\r\n * Console logging for messages from [__s.loglevel] 3.\r\n */\r\n const __error = function () {\r\n __log(3, Array.prototype.slice.call(arguments));\r\n };\r\n\r\n /**\r\n * @private\r\n * Console logging for all messages. The priority of the message must be equal or higher\r\n * than [__s.loglevel] to pass the function.\r\n * @param {int} type - The log level\r\n * @param {any} p - All arguments to be logged in the console.\r\n */\r\n const __log = function (type, p) {\r\n if (/*@cc_on!@*/ false)\r\n // ie exit here\r\n return;\r\n\r\n if (window.console && type >= __s.loglevel) {\r\n switch (type) {\r\n case 1:\r\n if (window.console.info) window.console.info.apply(null, p);\r\n break;\r\n case 2:\r\n if (window.console.warn) window.console.warn.apply(null, p);\r\n break;\r\n case 3:\r\n if (window.console.error) window.console.error.apply(null, p);\r\n break;\r\n default:\r\n if (window.console.log) window.console.log.apply(null, p);\r\n break;\r\n }\r\n }\r\n };\r\n\r\n /** @constructs */\r\n const __construct = function () {\r\n __info('Product comparison initialized');\r\n __initCollection();\r\n\r\n if (Object.prototype.toString.call(__s.sameCcatComparisionIds) !== '[object Array]') {\r\n __warning('The configuration parameter \"sameCcatComparisionIds\" must be an array!');\r\n __s.sameCcatComparisionIds = [];\r\n }\r\n\r\n __c.brandName = $('body').data('track_brandname');\r\n __c.productcategory = $('body').data('track_productcategory');\r\n\r\n __e.on(\r\n 'click',\r\n '.product-tile__card__control label a, .table-left__product-comparison label a',\r\n function (event) {\r\n event.preventDefault();\r\n event.stopPropagation();\r\n __handleLabelClick($(event.currentTarget));\r\n return false;\r\n }\r\n );\r\n\r\n // Page: Product-Cards\r\n __e.on('change', '.product-tile__card__control input:checkbox[name=product_compare]', function (event) {\r\n event.preventDefault();\r\n event.stopPropagation();\r\n __o.toggleProduct($(event.currentTarget).val());\r\n });\r\n\r\n // Page: M-024-Table-Single-B-Products-Left\r\n __e.on('change', '.table-left input:checkbox[name=product_compare]', function (event) {\r\n event.preventDefault();\r\n event.stopPropagation();\r\n __o.toggleProduct($(event.currentTarget).val());\r\n });\r\n\r\n // Page: Product-Comparison\r\n __c.productOverviewContainer = __e.find('.product-overview');\r\n __e.on('click', '.product-overview__item[data-product-id] .product-overview__icon', function (event) {\r\n event.preventDefault();\r\n event.stopPropagation();\r\n\r\n const product_id = $(this).closest('.product-overview__item[data-product-id]').attr('data-product-id');\r\n if (product_id && __c.deleteModal) {\r\n __c.pending_product_id = product_id;\r\n __c.deleteModal.modal('show');\r\n } else {\r\n __warning('Missing or empty data-product-id!');\r\n }\r\n });\r\n\r\n __c.deleteModal = __e.find('#deleteProduct:first');\r\n __e.on('click', '#deleteProduct:first .btn.btn-primary', function (event) {\r\n event.preventDefault();\r\n event.stopPropagation();\r\n __o.removeProduct(__c.pending_product_id);\r\n __c.pending_product_id = null;\r\n __o.reloadPage();\r\n });\r\n\r\n __e\r\n .find('.modal')\r\n .on('show.bs.modal', function (event) {\r\n const modal = $(this);\r\n let modalType = null;\r\n if (modal.hasClass('addProducts')) {\r\n modalType = __c.TYPE_ADD_PRODUCTS;\r\n } else if (modal.hasClass('changeOrder')) {\r\n modalType = __c.TYPE_CHANGE_ORDER;\r\n }\r\n if (modalType) {\r\n __c.modal = modal;\r\n __c.modalType = modalType;\r\n __c.modalChanged = true;\r\n __c.modalCommitBtn = modal.find('.btn.btn-primary');\r\n if (__c.modalCommitBtn) {\r\n __c.modalCommitBtn.on('click', __commitModalProducts);\r\n }\r\n __invalidateDisplayList();\r\n }\r\n })\r\n .on('hide.bs.modal hidePrevented.bs.modal', function (event) {\r\n const modal = $(this);\r\n let modalType = null;\r\n if (modal.hasClass('addProducts')) {\r\n modalType = __c.TYPE_ADD_PRODUCTS;\r\n } else if (modal.hasClass('changeOrder')) {\r\n modalType = __c.TYPE_CHANGE_ORDER;\r\n }\r\n if (modalType) {\r\n __c.modal = null;\r\n __c.modalChanged = true;\r\n if (__c.modalCommitBtn) {\r\n __c.modalCommitBtn.off('click', __commitModalProducts);\r\n }\r\n __c.modalCommitBtn = null;\r\n __invalidateDisplayList();\r\n }\r\n });\r\n\r\n setInterval(function () {\r\n __tick();\r\n }, 1000 / __s.fps);\r\n\r\n __invalidateDisplayList();\r\n };\r\n\r\n __construct();\r\n };\r\n\r\n /**\r\n * jQuery function that applies the ProductComparison class to the selected elements.\r\n * @param {object} options - Settings for each new class instance. The settings overwrite the properties of the class [ProductComparison] defined in Scope [__s].\r\n */\r\n $.fn.productComparison = function (options) {\r\n return this.each(function () {\r\n const e = $(this);\r\n if (e.data('productComparison')) return;\r\n const productComparison = new ProductComparison(this, options);\r\n e.data('productComparison', productComparison);\r\n });\r\n };\r\n\r\n let config = {};\r\n if (typeof document.productComparison !== 'undefined') {\r\n config = document.productComparison;\r\n } else if (window.console) {\r\n window.console.error(\r\n 'Missing Configuration Object \"document.productComparison\" for ProductComparison/ProductComparisonSelection Plugin! Make sure to define document.productComparison = {...} before Plugin is initialized.'\r\n );\r\n }\r\n $('body').productComparison(config);\r\n})(jQuery);\r\n\r\n$.fn.initializeTags = function () {\r\n return this.each(function () {\r\n let card_id = 0;\r\n $(this)\r\n .find('.card')\r\n .each(function () {\r\n const $card = $(this);\r\n let row_id = 0;\r\n $card.find('.stickytable__row.table-body').each(function () {\r\n const $row = $(this);\r\n const isHeadline = $row.find('.stickytable__headline--info').length > 0;\r\n if (isHeadline) {\r\n row_id++;\r\n // $row.attr('data-parent-of', 'row-' + card_id + '-' + row_id);\r\n $row.find('a.tag').attr('data-parent-of', 'row-' + card_id + '-' + row_id);\r\n } else {\r\n $row.attr('data-belongs-to', 'row-' + card_id + '-' + row_id);\r\n }\r\n });\r\n card_id++;\r\n });\r\n });\r\n};\r\n\r\n$.fn.filterByTags = function () {\r\n return this.each(function () {\r\n this.showTag = function (parent, id) {\r\n $(this)\r\n .find('.tagcontainer .tag[data-parent-of=\"' + parent + '\"]')\r\n .each(function () {\r\n const active = $(this).text() == id;\r\n if (active) {\r\n $(this).addClass('active');\r\n $(this).removeClass('disabled');\r\n } else {\r\n $(this).addClass('disabled');\r\n $(this).removeClass('active');\r\n }\r\n });\r\n $(this)\r\n .find('div[data-belongs-to=\"' + parent + '\"][data-tag]')\r\n .each(function () {\r\n const visible = $(this).attr('data-tag') == id;\r\n if (visible) {\r\n $(this).removeClass('d-none');\r\n } else {\r\n $(this).addClass('d-none');\r\n }\r\n });\r\n };\r\n $(this)\r\n .on('filter.activate', function (event) {\r\n event.preventDefault();\r\n event.stopPropagation();\r\n this.showTag(event.parent, event.id);\r\n })\r\n .on('click', '.tagcontainer .tag', function (event) {\r\n event.preventDefault();\r\n event.stopPropagation();\r\n $(this).trigger({\r\n type: 'filter.activate',\r\n parent: $(this).attr('data-parent-of'),\r\n id: $(this).text(),\r\n });\r\n });\r\n });\r\n};\r\n\r\n// put data-parent-of and data-belongs-to to corresponding elements. this is because otherwise\r\n// the elements do not correspond to each other\r\n$(document).initializeTags();\r\n$('.filter-tags').filterByTags().find('.tagcontainer .tag:first').trigger('click');\r\n"],"sourceRoot":""}