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_custom_hawkers_frontend/./cartridge/client/default/js/partials/general-utils.js","webpack://app_custom_hawkers_frontend/webpack/bootstrap","webpack://app_custom_hawkers_frontend/webpack/runtime/define property getters","webpack://app_custom_hawkers_frontend/webpack/runtime/hasOwnProperty shorthand","webpack://app_custom_hawkers_frontend/./cartridge/client/default/js/components/product-composable-options-modal.js"],"sourcesContent":["'use strict';\n\n// Classes\nconst classes = {\n hidden: 'tw-hidden',\n is: {\n loading: 'is-loading',\n preferred: 'is-preferred',\n calculating: 'is-calculating',\n visible: 'is-visible',\n selected: 'is-selected',\n open: 'is-open',\n active: 'is-active',\n invalid: 'is-invalid',\n current: 'is-current',\n full: 'is-full',\n loaded: 'is-loaded',\n disabled: 'is-disabled',\n fullscreen: 'is-fullscreen',\n alone: 'is-alone',\n sticky: 'is-sticky',\n zoomed: 'is-zoomed',\n enabled: 'is-enabled',\n filtered: 'is-filtered',\n scrollable: 'is-scrollable',\n fixed: 'is-fixed',\n animated: 'is-animated',\n animatedOut: 'is-animated-out',\n animatedIn: 'is-animated-in',\n locked: 'is-locked',\n empty: 'is-empty',\n available: 'is-available',\n cached: 'is-cached'\n },\n has: {\n error: 'has-error',\n success: 'has-success',\n filtersVisible: 'has-filters-visible',\n subscription: 'has-subscription',\n gross: 'has-gross'\n },\n show: {\n password: 'show-password',\n resumeOrder: 'show-resume-order'\n },\n color: {\n state: {\n success: 'tw-text-state-success',\n error: 'tw-text-state-error'\n }\n },\n gtm: {\n avoidViewed: 'gtm-avoid-viewed'\n },\n not: {\n results: 'not-results'\n },\n text: {\n uppercase: 'tw-uppercase'\n }\n};\n\n// Variables\nconst RECURSIVE_SEARCH_LIMIT = 5;\n\n// Functions\n\n// Add class to element\nconst addClassToElement = ($element, ...newClasses) => {\n if ($element) {\n $element.classList.add(...newClasses);\n }\n};\n\n// Remove class from element\nconst removeClassToElement = ($element, ...newClasses) => {\n if ($element) {\n $element.classList.remove(...newClasses);\n }\n};\n\n// Toggle class to element\nconst toggleClassToElement = ($element, ...newClasses) => {\n if ($element) {\n $element.classList.toggle(...newClasses);\n }\n};\n\n// Check if element has class\nconst hasClassElement = ($element, classname) => {\n if ($element && $element.classList) {\n return $element.classList.contains(classname);\n }\n // Element does not exist or is invalid\n return null;\n};\n\n// Find element by class or parent element until RECURSIVE_SEARCH_LIMIT\nconst findParentFromClass = ($elem, classToSearch, deep = 0) => {\n if (hasClassElement($elem, classToSearch)) {\n return $elem;\n }\n\n if ($elem && deep < RECURSIVE_SEARCH_LIMIT) {\n return findParentFromClass($elem.parentNode, classToSearch, deep + 1);\n }\n\n return null;\n};\n\n// Export\nexport {\n classes,\n addClassToElement,\n removeClassToElement,\n toggleClassToElement,\n hasClassElement,\n findParentFromClass\n};\n","'use strict';\n\nimport {\n addClassToElement,\n removeClassToElement\n} from '@jspartials/class-list-utils';\n\n// Elements\nconst html = document.querySelector('html');\nconst body = document.querySelector('body');\n\n// Custom events\nconst customEvent = {\n listenProductTiles: 'listenProductTiles',\n reloadVtoButtons: 'reloadVtoButtons',\n listenAddonTiles: 'listenAddonTiles',\n loginAndSignupLoaded: 'loginAndSignupLoaded',\n qrGeneratorLoaded: 'qrGeneratorLoaded',\n initProductTilesAnimation: 'initProductTilesAnimation',\n adyen: {\n displayPaymentMethods: 'adyen::displayPaymentMethods',\n paymentMethodsUpdated: 'adyen::paymentMethodsUpdated'\n },\n klarna: {\n checkVisibilityOfPaymentMethod: 'checkVisibilityOfKlarnaPaymentMethod'\n },\n closeSearcherFromMenu: 'closeSearcherFromMenu',\n closeMenuFromSearcher: 'closeMenuFromSearcher',\n sidebar: {\n init: 'sidebar::init',\n close: 'sidebar::close',\n open: 'sidebar::open'\n },\n updatePickUpStoreSelectedForShipping: 'updatePickUpStoreSelectedForShipping',\n cart: {\n itemRemoved: 'cart::itemRemoved'\n },\n checkout: {\n selectShippingMethod: 'checkout::selectShippingMethod'\n }\n};\n\n// Media query strings\nconst mediaQuery = {\n tablet: '(min-width: 768px)'\n};\n\nconst selectors = {\n fixedClass: 'tw-fixed',\n overflowHiddenClass: 'tw-overflow-hidden',\n fullWidthClass: 'tw-w-full'\n};\n\nvar htmlElementScroll = 0;\n\n/**\n * Get the current top location\n */\nconst currentYPosition = () => {\n // Firefox, Chrome, Opera, Safari\n if (self.pageYOffset) return self.pageYOffset;\n // Internet Explorer 6 - standards mode\n if (document.documentElement && document.documentElement.scrollTop)\n return document.documentElement.scrollTop;\n // Internet Explorer 6, 7 and 8\n if (document.body.scrollTop) return document.body.scrollTop;\n return 0;\n};\n\n/**\n * Get the position of element\n * @param {string} id of the element\n */\nconst elmYPosition = (id) => {\n const elm = document.querySelector(id);\n let y = elm.offsetTop;\n let node = elm;\n while (node.offsetParent && node.offsetParent !== document.body) {\n node = node.offsetParent;\n y += node.offsetTop;\n }\n return y;\n};\n\n/**\n * Get value from url parameter\n * @param {string} name of url parameter\n */\nconst getUrlParameter = (name) => {\n return (\n decodeURIComponent(\n (new RegExp(`[?|&]${name}=` + `([^&;]+?)(&|#|;|$)`).exec(\n location.search\n ) || [, ''])[1].replace(/\\+/g, '%20')\n ) || null\n );\n};\n\n/**\n * Get value from session storage variable\n * @param {string} key of variable\n */\nconst getSessionStorage = (key = '') => {\n return sessionStorage.getItem(key);\n};\n\n/**\n * Set value for session storage variable\n * @param {string} key of variable\n * @param {string} value of variable\n */\nconst saveSessionStorage = (key = '', value = '') => {\n sessionStorage.setItem(key, value);\n};\n\n/**\n * Set HTML unscrollable\n */\nconst setHtmlUnscrollable = () => {\n htmlElementScroll = document.documentElement.scrollTop;\n addClassToElement(body, selectors.fixedClass);\n addClassToElement(body, selectors.overflowHiddenClass);\n addClassToElement(body, selectors.fullWidthClass);\n body.style.height = `calc(100% + ${htmlElementScroll}px)`;\n body.style.top = `-${htmlElementScroll}px`;\n};\n\n/**\n * Set HTML scrollable\n */\nconst setHtmlScrollable = () => {\n removeClassToElement(body, selectors.fixedClass);\n removeClassToElement(body, selectors.overflowHiddenClass);\n removeClassToElement(body, selectors.fullWidthClass);\n body.style.height = '';\n body.style.top = '';\n window.scrollTo({ top: htmlElementScroll, behavior: 'instant' });\n\n htmlElementScroll = 0;\n};\n\nconst smoothScrollToAnchor = () => {\n const elementsWithHash = document.querySelectorAll('a[href*=\"#\"]') || [];\n\n elementsWithHash.forEach((element) => {\n element.addEventListener('click', (event) => {\n event.preventDefault();\n const targetHref = element.getAttribute('href');\n let elementPosition = 0;\n if (targetHref != '#') {\n elementPosition = elmYPosition(targetHref);\n }\n window.scrollTo({ top: elementPosition, behavior: 'smooth' });\n });\n });\n};\n\nconst randomNumber = (min, max) => {\n return Math.floor(Math.random() * (max - min)) + min;\n};\n\nconst debounce = (callback, wait) => {\n let timeoutId = null;\n return (...args) => {\n window.clearTimeout(timeoutId);\n timeoutId = window.setTimeout(() => {\n callback.apply(null, args);\n }, wait);\n };\n};\n\nconst throttle = (func, wait) => {\n let waiting = false;\n return function () {\n if (waiting) {\n return;\n }\n\n waiting = true;\n setTimeout(() => {\n func.apply(this, arguments);\n waiting = false;\n }, wait);\n };\n};\n\nconst getMediaQuery = (mediaQuery) => {\n return window.matchMedia(mediaQuery);\n};\n\n/**\n * Sleep for a certain amount of time\n * @param {number} ms - The amount of time to sleep in milliseconds\n * @returns {Promise} - The promise that resolves after the sleep\n */\nconst sleep = (ms) =>\n new Promise((resolve) => {\n setTimeout(resolve, ms);\n });\n\n/**\n * Try to execute a function with retries and delay\n * @param {Function} func - The function to execute\n * @param {number} retries - The number of retries\n * @param {number} delay - The delay between retries in milliseconds\n * @param {Array} params - The parameters to pass to the function\n * @returns {Promise} - The promise that resolves after the function is executed\n */\nconst tryExecute = async (func, retries, delay, ...params) => {\n let attempts = 0;\n\n while (attempts < retries) {\n try {\n const response = await func(...params);\n\n if (response.status === 200) {\n return response.data;\n }\n } catch (error) {\n const status = error.response?.status;\n const retryAfter = parseInt(\n error.response?.headers['retry-after'] || delay / 1000,\n 10\n ); // in seconds\n\n if (status === 429) {\n // Too many requests\n await sleep(retryAfter * 1000);\n } else {\n if (attempts >= retries - 1) {\n throw error;\n }\n }\n }\n attempts++;\n }\n};\n\nconst isPointingDevice = () => {\n return window.matchMedia('(pointer:fine) and (hover: hover)').matches;\n};\n\nexport {\n html,\n body,\n getUrlParameter,\n getSessionStorage,\n saveSessionStorage,\n currentYPosition,\n elmYPosition,\n setHtmlUnscrollable,\n setHtmlScrollable,\n smoothScrollToAnchor,\n randomNumber,\n debounce,\n throttle,\n customEvent,\n mediaQuery,\n getMediaQuery,\n tryExecute,\n isPointingDevice\n};\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","'use strict';\n\nimport {\n setHtmlScrollable,\n setHtmlUnscrollable\n} from '@jspartials/general-utils';\nimport {\n addClassToElement,\n removeClassToElement\n} from '@jspartials/class-list-utils';\n\nconst mobileBreakpoint = window.matchMedia('(min-width: 768px)');\n\n// Selectors\nconst selector = {\n modal: {\n id: '#productComposableOptionsModal',\n body: '.options-modal-body',\n container: '.options-container',\n header: '.options-header',\n imagesContainer: '.js-images-container',\n imagesModal: '.js-modal-images',\n dataOptionID: '[data-option-id]',\n partImages: '.js-modal-images [data-option-id]',\n titleProduct: '.js-options-title-product',\n stepsContainerOptionId: '.options-steps-container [data-option-id]',\n stepsContainerProducts: '.js-options-steps-copntainer-products',\n close: '#productComposableOptionsModal .close'\n },\n options: {\n optionsValueContainer:\n '#productComposableOptionsModal .option-value-container',\n selectedOption: '.js-selected-option',\n selectedRectOption: '.js-option-rect-selected',\n selectedNameOption: '.js-option-name-selected',\n selectedChevronIcon: '.js-option-chevron-icon',\n tabOptions: '.js-tab-options',\n optionValuesWrapper: '.js-option-values-wrapper',\n optionvalues: '.js-option-values',\n optionValueContainer: '.option-value-container',\n optionTitle: '.js-option-title',\n optionImages: '.js-composable-product-options-image',\n optionName: '.js-option-name',\n optionInput: '.js-option-input',\n polarized: '#polarized'\n },\n summary: {\n optionValuesSummary: '.js-option-values-summary',\n optionValueSummaryWrapper: '.js-option-value-summary-wrapper',\n optionPrice: '.js-option-price',\n priceElement: '.js-option-summary-price-sum',\n cartPriceElement: '[data-step-id=\"complete\"] .cart-and-ipay .price .sales'\n },\n goNext: {\n optionValueError: '.option-value-error',\n optionValueGoNext: '.option-value-go-next'\n },\n extra: {\n selected: 'selected',\n show: 'show',\n error: 'error',\n enabled: 'enabled'\n }\n};\n\n// Elements\nconst element = {\n modal: {\n id: document.querySelector(selector.modal.id) || null,\n body: document.querySelector(selector.modal.body) || null,\n container: document.querySelector(selector.modal.container) || null,\n header: document.querySelector(selector.modal.header) || null,\n imagesContainer:\n document.querySelector(selector.modal.imagesContainer) || null,\n imagesModal: document.querySelector(selector.modal.imagesModal) || null,\n dataOptionID:\n document.querySelectorAll(selector.modal.dataOptionID) || null,\n partImages: document.querySelectorAll(selector.modal.partImages) || null,\n titleProduct: document.querySelector(selector.modal.titleProduct) || null,\n stepsContainerOptionId:\n document.querySelectorAll(selector.modal.stepsContainerOptionId) || null,\n stepsContainerProducts:\n document.querySelector(selector.modal.stepsContainerProducts) || null,\n close: document.querySelector(selector.modal.close) || null\n },\n options: {\n optionsValueContainer:\n document.querySelectorAll(selector.options.optionsValueContainer) || null,\n selectedOption:\n document.querySelector(selector.options.selectedOption) || null,\n selectedRectOption:\n document.querySelector(selector.options.selectedRectOption) || null,\n selectedNameOption:\n document.querySelector(selector.options.selectedNameOption) || null,\n selectedChevronIcon:\n document.querySelector(selector.options.selectedChevronIcon) || null,\n tabOptions: document.querySelector(selector.options.tabOptions) || null,\n optionValuesWrapper:\n document.querySelector(selector.options.optionValuesWrapper) || null,\n optionvalues: document.querySelector(selector.options.optionvalues) || null,\n optionValueContainer:\n document.querySelector(selector.options.optionValueContainer) || null,\n optionTitle: document.querySelector(selector.options.optionTitle) || null,\n optionImages: document.querySelector(selector.options.optionImages) || null,\n optionName: document.querySelector(selector.options.optionName) || null,\n optionInput:\n document.querySelectorAll(selector.options.optionInput) || null,\n polarized: document.querySelector(selector.options.polarized) || null\n },\n summary: {\n optionValuesSummary:\n document.querySelector(selector.summary.optionValuesSummary) || null,\n optionValueSummaryWrapper:\n document.querySelector(selector.summary.optionValueSummaryWrapper) ||\n null,\n optionPrice: document.querySelector(selector.summary.optionPrice) || null,\n priceElement: document.querySelector(selector.summary.priceElement) || null,\n cartPriceElement:\n document.querySelector(selector.summary.cartPriceElement) || null\n },\n goNext: {\n optionValueError:\n document.querySelector(selector.goNext.optionValueError) || null,\n optionValueGoNext:\n document.querySelector(selector.goNext.optionValueGoNext) || null\n }\n};\n\n//Functions\nfunction autoSelection() {\n element.options.optionInput.forEach(function (item) {\n var selected = element.modal.stepsContainerProducts.querySelector(\n '[data-option-id=\"' + item.id + '\"]'\n );\n\n if (selected) {\n var first = selected.querySelector(selector.options.optionTitle);\n first.click();\n }\n });\n}\n\nfunction closeModal() {\n setHtmlScrollable();\n removeClassToElement(element.modal.id, selector.extra.show);\n element.modal.body.setAttribute('data-current-step', 1);\n setTimeout(function () {\n element.modal.id.style.display = 'none';\n }, 200);\n}\n\nfunction openModal() {\n setHtmlUnscrollable();\n element.modal.id.style.display = 'block';\n setTimeout(function () {\n addClassToElement(element.modal.id, selector.extra.show);\n }, 50);\n}\n\nfunction setImage(selectedElement) {\n var currentPartId = selectedElement.dataset.optionId;\n var currentPartImage = selectedElement.dataset.optionImageUrl;\n\n element.modal.partImages.forEach(function () {\n var targetImage = Array.from(element.modal.partImages).find(\n (img) => img.dataset.optionId === currentPartId\n );\n if (targetImage) {\n targetImage.setAttribute('src', currentPartImage);\n }\n });\n}\n\nfunction updateSummary(selectedElement, partPrice) {\n var currentPartId = selectedElement.dataset.optionId;\n var currentPartVal = selectedElement.dataset.valueId;\n var currentPartTitle = selectedElement.dataset.title;\n var currentPartMainImage = selectedElement.dataset.optionImageUrl;\n var currentPartDisplayValue = selectedElement.dataset.valueTitle;\n var currentPartColorImage = selectedElement\n .querySelector(selector.options.optionImages)\n .getAttribute('src');\n var summaryElement = element.modal.id.querySelector(\n '.options-step[data-step-id=\"complete\"] [data-option-id=\"' +\n currentPartId +\n '\"]'\n );\n\n summaryElement\n .closest(selector.summary.optionValueSummaryWrapper)\n .querySelector('[name=\"' + currentPartId + '\"]').value = currentPartVal;\n summaryElement\n .closest(selector.summary.optionValueSummaryWrapper)\n .querySelector('[name=\"' + currentPartId + '\"]')\n .setAttribute('data-image', currentPartMainImage);\n summaryElement\n .closest(selector.summary.optionValueSummaryWrapper)\n .querySelector('[name=\"' + currentPartId + '\"]')\n .setAttribute('data-title', currentPartTitle);\n summaryElement\n .closest(selector.summary.optionValueSummaryWrapper)\n .querySelector('[name=\"' + currentPartId + '\"]')\n .setAttribute('data-displayvalue', currentPartDisplayValue);\n summaryElement.querySelector(selector.options.optionTitle).textContent =\n currentPartTitle;\n summaryElement\n .querySelector('.option-image img')\n .setAttribute('src', currentPartColorImage);\n\n if (partPrice !== 0) {\n summaryElement.querySelector(selector.summary.optionPrice).textContent =\n '+ ' + partPrice;\n } else {\n summaryElement.querySelector(selector.summary.optionPrice).textContent = '';\n }\n}\n\nfunction updatePriceElements(finalPrice) {\n updatePriceElement(element.summary.priceElement, finalPrice);\n}\n\nfunction updatePriceElement(priceElem, finalPrice) {\n var finalPriceArray = finalPrice.toFixed(2).toString().split('.');\n var currentPriceElement = priceElem.querySelector('.hw-product-price__sales');\n var sessionCurrency = currentPriceElement.getAttribute('data-currency');\n\n var finalPriceInt;\n var finalPriceDec;\n\n if (finalPriceArray.length > 0) {\n if (currentPriceElement.textContent.indexOf(sessionCurrency) == 0) {\n finalPriceInt = sessionCurrency + finalPriceArray[0];\n finalPriceDec =\n '.' +\n finalPriceArray[1] +\n '';\n } else {\n finalPriceInt = finalPriceArray[0];\n finalPriceDec =\n '.' +\n finalPriceArray[1] +\n sessionCurrency +\n '';\n }\n\n currentPriceElement.innerHTML = finalPriceInt + finalPriceDec;\n }\n}\n\nfunction selectOption(selectedElement) {\n Array.from(\n selectedElement.closest(selector.options.optionvalues).children\n ).forEach(function (element) {\n removeClassToElement(element, selector.extra.selected);\n });\n\n addClassToElement(selectedElement, selector.extra.selected);\n selectedElement\n .closest(selector.options.optionvalues)\n .querySelectorAll(selector.goNext.optionValueError)\n .forEach(function (element) {\n removeClassToElement(element, selector.extra.show);\n });\n removeClassToElement(\n selectedElement\n .closest(selector.options.optionvalues)\n .querySelector(selector.goNext.optionValueGoNext),\n selector.extra.error\n );\n addClassToElement(\n selectedElement\n .closest(selector.options.optionvalues)\n .querySelector(selector.goNext.optionValueGoNext),\n selector.extra.enabled\n );\n\n const imageSrc = selectedElement\n .querySelector(selector.options.optionImages)\n .getAttribute('src');\n\n const tabOptions = selectedElement.closest('.js-tab-options');\n\n tabOptions.previousElementSibling\n .querySelector(selector.options.selectedRectOption)\n .setAttribute('src', imageSrc);\n\n var partPrice = 0;\n if (\n Object.hasOwnProperty.call(\n window.optionModalConfig,\n selectedElement.dataset.optionId\n )\n ) {\n window.optionModalConfig[selectedElement.dataset.optionId].every(function (\n k\n ) {\n if (k.id === selectedElement.dataset.valueId && k.price.sales.value) {\n partPrice = k.price.sales.formatted;\n return false;\n }\n return true;\n });\n\n const title = selectedElement.querySelector(\n selector.options.optionName\n ).textContent;\n const titleWithPrice = partPrice !== 0 ? `${title} (+${partPrice})` : title;\n\n tabOptions.previousElementSibling.querySelector(\n selector.options.selectedNameOption\n ).textContent = titleWithPrice;\n\n tabOptions.querySelector(selector.options.selectedNameOption).textContent =\n titleWithPrice;\n }\n\n setImage(selectedElement);\n updateSummary(selectedElement, partPrice);\n\n document.body.dispatchEvent(new Event('composable::refreshPrice'));\n}\n\nfunction setGeneralListenersCreative() {\n element.modal.close.addEventListener('click', function (e) {\n e.preventDefault();\n closeModal();\n });\n\n element.options.optionsValueContainer.forEach(function (item) {\n item.addEventListener('click', function (e) {\n e.preventDefault();\n var selectedElement = this;\n if (selectedElement) {\n selectOption(selectedElement);\n } else {\n addClassToElement(selectedElement, selector.extra.error);\n addClassToElement(\n selectedElement\n .closest(element.options.optionvalues)\n .querySelector(selector.goNext.optionValueError),\n selector.extra.show\n );\n }\n });\n });\n}\n\nfunction showPolarizedCheckbox() {\n var polarizedLenses = [];\n var nonPolarizedLenses = [];\n window.optionModalConfig['hk_creative_lenses_option'].forEach(function (\n item\n ) {\n if (!item.polarized) {\n nonPolarizedLenses.push(item);\n } else {\n polarizedLenses.push(item);\n }\n });\n\n if (nonPolarizedLenses.length === 0 || polarizedLenses.length === 0) {\n element.options.polarized.closest('.option-polarized').style.display =\n 'none';\n }\n}\n\nif (element.options.polarized) {\n element.options.polarized.addEventListener('change', function (check) {\n const selectedcategory = check.target.dataset.id;\n\n if (check.target.checked) {\n window.optionModalConfig[selectedcategory].forEach(function (item) {\n if (!item.polarized) {\n element.modal.id.querySelector(\n '[data-value-id=\"' + item.id + '\"]'\n ).style.display = 'none';\n }\n });\n } else {\n window.optionModalConfig[selectedcategory].forEach(function (item) {\n if (\n element.modal.id.querySelector('[data-value-id=\"' + item.id + '\"]')\n .style.display === 'none'\n ) {\n element.modal.id.querySelector(\n '[data-value-id=\"' + item.id + '\"]'\n ).style.display = 'flex';\n }\n });\n }\n });\n}\n\ndocument.body.addEventListener('composable::refreshPrice', function (e) {\n e.preventDefault();\n\n let finalPrice = parseFloat(window.optionModalConfig.basePrice);\n const optionValueContainers = document.querySelectorAll(\n '.option-value-container.selected'\n );\n\n optionValueContainers.forEach((v) => {\n const currentProductPartType = v.getAttribute('data-option-id');\n const currentProductID = v.getAttribute('data-value-id');\n\n if (currentProductID && currentProductPartType) {\n if (window.optionModalConfig.hasOwnProperty(currentProductPartType)) {\n window.optionModalConfig[currentProductPartType].every((k) => {\n if (k.id === currentProductID && k.price.sales.value) {\n finalPrice =\n parseFloat(finalPrice) + parseFloat(k.price.sales.decimalPrice);\n return false;\n }\n return true;\n });\n }\n }\n });\n\n updatePriceElements(finalPrice);\n});\n\ndocument.body.addEventListener('product:afterAddToCart', function (e) {\n var addToCartButton = document.querySelector(\n '.js-button-options-add-to-cart'\n );\n\n var data = e.detail.data;\n if (typeof data.pliUUID !== 'undefined') {\n $('#productOptionsModal .prescription-form input[name=\"pliUUID\"]').val(\n data.pliUUID\n );\n }\n\n if (!window.optionModalConfig.prescriptionStep) {\n location.href = addToCartButton.dataset.cart;\n }\n});\n\nfunction init() {\n window.optionModalConfig = JSON.parse(optionsModalJson);\n window.optionModalConfig.basePrice = productBasePrice;\n window.optionModalConfig.activeExceptionId = null;\n window.optionModalConfig.activeException = null;\n\n setGeneralListenersCreative();\n autoSelection();\n showPolarizedCheckbox();\n\n const queryString = window.location.search;\n const urlParams = new URLSearchParams(queryString);\n\n const showproductOptionsModalUrlParameter = urlParams.get(\n 'showproductOptionsModal'\n );\n\n if (showproductOptionsModalUrlParameter === 'true') {\n openModal();\n setHtmlUnscrollableetContainerSizeCreative();\n }\n handleOptionCheckboxesBehaviour();\n}\n\nfunction handleOptionCheckboxesBehaviour() {\n if (!mobileBreakpoint.matches) {\n const optionCheckboxes = element.options.optionInput;\n\n optionCheckboxes.forEach((checkbox) => {\n checkbox.addEventListener('change', optionCheckboxesMobileBehaviour);\n });\n }\n\n mobileBreakpoint.addEventListener('change', (event) => {\n if (!mobileBreakpoint.matches) {\n const optionCheckboxes = element.options.optionInput;\n resetCheckboxes(true);\n optionCheckboxes.forEach((checkbox) => {\n checkbox.addEventListener('change', optionCheckboxesMobileBehaviour);\n });\n } else {\n const optionCheckboxes = element.options.optionInput;\n\n optionCheckboxes.forEach((checkbox) => {\n checkbox.removeEventListener('change', optionCheckboxesMobileBehaviour);\n });\n }\n });\n}\n\nfunction optionCheckboxesMobileBehaviour(e) {\n e.preventDefault();\n let checkbox = e.target;\n\n if (!checkbox.checked) {\n checkbox.checked = true;\n return;\n }\n\n resetCheckboxes(false);\n checkbox.checked = true;\n}\n\nfunction resetCheckboxes(markFirst) {\n const optionCheckboxes = element.options.optionInput;\n\n optionCheckboxes.forEach((checkbox) => {\n checkbox.checked = false;\n });\n\n if (markFirst) {\n optionCheckboxes[0].checked = true;\n }\n}\n\n$('body').on('product:selectOptionsModal', function () {\n if (element.modal.id) {\n openModal();\n }\n});\n\ndocument.addEventListener('product:updateOptionsModal', function () {\n if (element.modal.id) {\n window.optionModalConfig = JSON.parse(optionsModalJson);\n window.optionModalConfig.basePrice = productBasePrice;\n window.optionModalConfig.activeExceptionId = null;\n window.optionModalConfig.activeException = null;\n }\n});\n\ndocument.addEventListener('DOMContentLoaded', function () {\n if (element.modal.id) {\n init();\n }\n});\n"],"names":["addClassToElement","$element","_len","arguments","length","newClasses","Array","_key","classList","add","removeClassToElement","_len2","_key2","remove","document","querySelector","body","selectors","htmlElementScroll","setHtmlUnscrollable","documentElement","scrollTop","style","height","top","setHtmlScrollable","window","scrollTo","behavior","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","module","__webpack_modules__","d","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","mobileBreakpoint","matchMedia","selector","modal","id","container","header","imagesContainer","imagesModal","dataOptionID","partImages","titleProduct","stepsContainerOptionId","stepsContainerProducts","close","options","optionsValueContainer","selectedOption","selectedRectOption","selectedNameOption","selectedChevronIcon","tabOptions","optionValuesWrapper","optionvalues","optionValueContainer","optionTitle","optionImages","optionName","optionInput","polarized","summary","optionValuesSummary","optionValueSummaryWrapper","optionPrice","priceElement","cartPriceElement","goNext","optionValueError","optionValueGoNext","extra","selected","show","error","enabled","element","querySelectorAll","openModal","display","setTimeout","setGeneralListenersCreative","addEventListener","e","preventDefault","setAttribute","forEach","item","selectedElement","this","from","closest","children","imageSrc","getAttribute","previousElementSibling","partPrice","optionModalConfig","dataset","optionId","every","k","valueId","price","sales","value","formatted","title","textContent","titleWithPrice","currentPartId","currentPartImage","optionImageUrl","targetImage","find","img","setImage","currentPartVal","currentPartTitle","currentPartMainImage","currentPartDisplayValue","valueTitle","currentPartColorImage","summaryElement","updateSummary","dispatchEvent","Event","selectOption","optionCheckboxesMobileBehaviour","checkbox","target","checked","resetCheckboxes","markFirst","optionCheckboxes","check","selectedcategory","finalPrice","parseFloat","basePrice","v","currentProductPartType","currentProductID","decimalPrice","priceElem","finalPriceInt","finalPriceDec","finalPriceArray","toFixed","toString","split","currentPriceElement","sessionCurrency","indexOf","innerHTML","updatePriceElement","updatePriceElements","addToCartButton","data","detail","pliUUID","$","val","prescriptionStep","location","href","cart","on","JSON","parse","optionsModalJson","productBasePrice","activeExceptionId","activeException","polarizedLenses","nonPolarizedLenses","click","push","queryString","search","URLSearchParams","setHtmlUnscrollableetContainerSizeCreative","matches","event","removeEventListener","init"],"sourceRoot":""}