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AKiG,aAAarE,iBACd,QACA,WACI5B,KAAKqI,YACT,EAAE9E,KAAKvD,QAIXA,KAAKgG,iBAAkCwB,IAApBxH,KAAKgG,YACxBhG,KAAKgG,WAAWpE,iBACZ,QACA,WACI5B,KAAKqI,YACT,EAAE9E,KAAKvD,MAGnB,EACA6I,kBAAiB,WACC7I,KAAK2F,WAAWmD,iBAAiB,eAEzC7H,SAAQ,SAAA8H,GACVA,EAAKnH,iBAAiB,SAAS,SAAAoH,GAC3B,GAAoC,MAAhCA,EAAMlH,cAAcmH,QAAiB,CACrC,IAAIC,EAAkBF,EAAMlH,cAAcrB,QAAQsI,KAClDL,EAAAA,EAAAA,YAAgBQ,GAAiBP,UAAU,UAC/C,CACJ,GACJ,GACJ,EACAzH,KAAI,WACAlB,KAAKoI,uBACLpI,KAAK4I,gBACL5I,KAAK6I,mBACT,E","sources":["webpack:///./html/wp-content/themes/ls/src/js/main/components/alertBanner/alertPopup.js","webpack:///./html/wp-content/themes/ls/src/js/main/components/regionAlert/regionAlert.js"],"sourcesContent":["import { CookieMonster } from 'root/utils/cookies/cookieMonster';\nimport { regionAlertSpecs } from 'root/main/components/regionAlert/regionAlert';\n\nfunction AlertPopupController(el) {\n this.el = el;\n this.showCSSClass = 'js-alert-popup-show';\n this.hideCSSClass = 'js-alert-popup-hide';\n this.nullCSSClass = 'js-alert-popup-null';\n this.titleElement = el.querySelector('[data-alert-popup-text=title]');\n this.cm = new CookieMonster();\n this.cookieParamId = this.el.dataset.alertPopup;\n this.hasAlertPopupTakenOver = false;\n this.regionAlertCookieName = regionAlertSpecs().getCookieName();\n}\n\nAlertPopupController.prototype = {\n postInsertActions() {\n this.setCookie();\n this.el.classList.remove(this.nullCSSClass);\n this.el.classList.add(this.showCSSClass);\n this.takeOverRegionAlert();\n },\n\n postClosedActions() {\n this.el.classList.remove(this.showCSSClass);\n this.el.classList.add(this.hideCSSClass);\n this.el.addEventListener('animationend', e => {\n e.currentTarget.classList.add(this.nullCSSClass);\n });\n this.restoreSettingRegionAlert();\n },\n\n takeOverRegionAlert() {\n // if region alert should be shown\n if (this.isHomepage() && !this.isRegionAlertCookieSet()) {\n this.hasAlertPopupTakenOver = true;\n // set the cookie so it will not be shown\n this.setRegionAlertCookie();\n }\n },\n\n restoreSettingRegionAlert() {\n if (\n this.isHomepage() &&\n this.isRegionAlertCookieSet() &&\n this.hasAlertPopupTakenOver\n ) {\n // remove the region alert cookie only if it has been set by the popup\n this.removeRegionAlertCookie();\n }\n },\n\n /**\n * Check if current page is homepage\n * @returns {boolean}\n */\n isHomepage() {\n return window.location.pathname === '/';\n },\n\n isRegionAlertCookieSet() {\n return this.cm.getCookie(this.regionAlertCookieName);\n },\n\n setRegionAlertCookie() {\n this.cm.setCookie(\n this.regionAlertCookieName,\n regionAlertSpecs().getCookieValue(),\n regionAlertSpecs().getCookieExpirationDate()\n );\n },\n\n removeRegionAlertCookie() {\n this.cm.unsetCookie(this.regionAlertCookieName);\n },\n\n closeHandler(e) {\n if (e.target === this.el || e.target.hasAttribute('data-alert-popup-button'))\n e.preventDefault();\n // hide the banner after the close button is clicked\n this.postClosedActions();\n },\n\n /**\n * @param cookieName\n * @returns {boolean}\n */\n hasCookie(cookieName) {\n return cookieName && this.cm.getCookie(cookieName) === 1;\n },\n\n /**\n * @returns {string}\n */\n getCookieName() {\n return this.cookieParamId && `_ls-alert-popup-${this.cookieParamId}`;\n },\n\n setCookie() {\n window.registerCookieComplianceCallback({\n callback: () => this.cm.setCookie(this.getCookieName(), 1, 90),\n isCallOptanonWrapper: true,\n });\n },\n\n addEventListenerToElement() {\n this.el.addEventListener('click', this.closeHandler.bind(this));\n },\n\n init() {\n if (!this.hasCookie(this.getCookieName())) {\n this.addEventListenerToElement();\n this.postInsertActions();\n }\n },\n};\n\nexport default function AlertPopup(els) {\n els.forEach(el => {\n if (el) {\n const alertPopup = new AlertPopupController(el);\n alertPopup.init();\n }\n });\n}\n","/*\nXXX_JSREFACTOR_XXX\ntodo @JSREFACTOR\n create e2e test for:\n - if the region alert is visible and there is no cookie set\n - if the region alert is NOT visible when there is ?rac=true in the url\n - if the cookie is set when the modal is closed\n*/\nimport { CookieMonster } from 'root/utils/cookies/cookieMonster';\nimport { CORS } from 'root/utils/cors/cors';\nimport { getParamValueFromUrl } from 'root/utils/URLParams/URLParams';\nimport { gtm } from 'root/utils/tracking/googleTagManagerDeprecated';\nimport { LoggingHandler } from 'root/utils/errorReporting/LoggingHandler';\nimport { debounce } from 'lodash';\n\nfunction regionAlertSpecs() {\n function getCookieName() {\n return '_ls_regionAlert';\n }\n function getCookieValue() {\n return true;\n }\n function getCookieExpirationDate() {\n return 182;\n }\n return {\n getCookieName,\n getCookieValue,\n getCookieExpirationDate,\n };\n}\n\nfunction createRegionAlert() {\n actionBasedOnCookie().setCookieOnRegionSelection();\n actionBasedOnCookie().createRegionAlertBasedOnCookie();\n}\n\nfunction actionBasedOnCookie() {\n const cm = new CookieMonster();\n const cookieName = regionAlertSpecs().getCookieName();\n const cookieValue = cm.getCookie(cookieName);\n const isCookieSet = cookieValue === true;\n const setCookie = () => {\n window.registerCookieComplianceCallback({\n callback: () => {\n return (\n !isCookieSet &&\n cm.setCookie(\n cookieName,\n regionAlertSpecs().getCookieValue(),\n regionAlertSpecs().getCookieExpirationDate()\n )\n );\n },\n isCallOptanonWrapper: true,\n });\n };\n const homepagePaths = ['/', '/ch/', '/ch-de/'];\n const isHome = homepagePaths.includes(window.location.pathname);\n const allowedLoginSlugVariationArray = [\n 'login',\n 'connexion',\n 'ch/login',\n 'ch-de/login',\n ];\n const insertSlugSlashes = slug => slug.replace(slug, `/${slug}/`);\n\n const isLogin = allowedLoginSlugVariationArray.some(\n slug => insertSlugSlashes(slug) === window.location.pathname\n );\n\n const isAllowedURL = isHome || isLogin;\n\n const setCookieOnRegionSelection = () => {\n if (getParamValueFromUrl('rac')) setCookie();\n };\n const createRegionAlertBasedOnCookie = () =>\n !isAllowedURL || isCookieSet\n ? null\n : CORS.xdr(\n '/rest/info/region-alert',\n 'POST',\n '',\n successCallback,\n errorCallback\n );\n\n return {\n setCookieOnRegionSelection,\n createRegionAlertBasedOnCookie,\n setCookie,\n };\n}\nfunction successCallback(data) {\n if (typeof data !== 'string' && data.length === 0) {\n return null;\n }\n createAlertMarkup(data);\n const regionAlert = document.querySelector('.js--regionalert');\n if (regionAlert) {\n const regionAlertModal = new RegionAlert(\n regionAlert,\n actionBasedOnCookie,\n window.location.href\n );\n regionAlertModal.init();\n }\n}\nfunction errorCallback(err) {\n LoggingHandler().logError(err, {\n searchTerm: 'region-alert-post-request-error',\n fileName: 'regionAlert.js',\n });\n}\nfunction createAlertMarkup(data) {\n const d = document.createElement('div');\n d.innerHTML = data;\n document.body.insertBefore(d, document.body.firstChild);\n}\nfunction RegionAlert(alertModal, cookie, location) {\n this.alertModal = alertModal;\n this.cookie = cookie;\n this.cookieName = regionAlertSpecs().getCookieName();\n this.location = location;\n this.openRegionClass = 'js--open-regions';\n this.modalFlipText = alertModal.querySelector('.js--regionAlert-flipText');\n this.modalFlipLink = alertModal.querySelector('.js--regionAlert-flipLink');\n this.modalClose = alertModal.querySelector('.js--regionAlert-close');\n this.modalOverlay = alertModal.querySelector('.modal-region__overlay');\n this.boxInitialHeight = alertModal.querySelector('.modal-region__box').clientHeight;\n this.boxContainer = alertModal.querySelector('.modal-region__box-container');\n this.boxContainerInitialHeight = this.boxContainer.clientHeight;\n this.boxRegions = alertModal.querySelector('.modal-region__box-regions');\n this.boxRecommend = alertModal.querySelector('.modal-region__box-recommend');\n this.boxRecommendInitialHeight = this.boxRecommend.clientHeight;\n this.originalHeight = this.boxInitialHeight - this.boxContainerInitialHeight;\n this.containerDifference =\n this.boxContainerInitialHeight - this.boxRecommendInitialHeight;\n this.body = document.body;\n}\nRegionAlert.prototype = {\n isScrolledToBottom(el) {\n return el.offsetHeight + el.scrollTop >= el.scrollHeight;\n },\n\n getBoxHeightBasedOnScreenSize(el) {\n el.style.top = `${this.boxContainer.scrollTop}px`; //in case the container has been scrolled and the user went back to the boxRecommend screen\n if (el.scrollHeight + this.originalHeight > window.innerHeight) {\n this.boxContainer.classList.add('js-scrollOn');\n return {\n height: '50vh',\n overflowY: 'scroll',\n };\n }\n return {\n height: `${el.clientHeight + this.containerDifference}px`,\n overflowY: 'inherit',\n };\n },\n\n setHeightContainer(elHeight = {}) {\n return Object.assign(this.boxContainer.style, elHeight);\n },\n\n setScrollOnGraphic(e) {\n if (this.isScrolledToBottom(e.target)) {\n e.target.classList.remove('js-scrollOn');\n } else {\n if (!e.target.classList.contains('js-scrollOn')) {\n e.target.classList.add('js-scrollOn');\n }\n }\n },\n\n unblockBody() {\n if (this.body.style.position === 'fixed') this.body.style.position = 'relative';\n },\n\n otherRegionsOpen() {\n this.alertModal.classList.add(this.openRegionClass);\n this.setHeightContainer(this.getBoxHeightBasedOnScreenSize(this.boxRegions));\n this.boxContainer.addEventListener(\n 'scroll',\n debounce(this.setScrollOnGraphic.bind(this), 5)\n );\n this.boxContainer.addEventListener('touchmove', () => {\n if (this.body.style.position !== 'fixed') this.body.style.position = 'fixed';\n }); // hack for iphone to block body scrolling while scrolling the boxContainer\n this.modalFlipText.innerHTML = 'Go';\n this.modalFlipLink.innerHTML = 'back';\n this.boxRegions.style.visibility = 'visible';\n },\n\n otherRegionsClose() {\n this.alertModal.classList.remove(this.openRegionClass);\n this.setHeightContainer(this.getBoxHeightBasedOnScreenSize(this.boxRecommend));\n this.unblockBody();\n this.modalFlipText.innerHTML = 'Not your region? Please take a look at our';\n this.modalFlipLink.innerHTML = 'other regions';\n this.boxRegions.style.visibility = 'hidden';\n },\n\n otherRegionsToggle() {\n if (this.alertModal.classList.contains(this.openRegionClass)) {\n this.otherRegionsClose();\n } else {\n this.otherRegionsOpen();\n }\n },\n\n otherRegionsListener() {\n if (this.modalFlipText && this.modalFlipLink !== undefined) {\n this.modalFlipLink.addEventListener(\n 'click',\n function () {\n this.otherRegionsToggle();\n }.bind(this)\n );\n }\n },\n\n closeModal() {\n const modal = this.alertModal;\n modal.classList.add('modal-region--close');\n this.unblockBody();\n this.cookie().setCookie();\n setTimeout(function () {\n if (modal.parentNode) {\n modal.parentNode.removeChild(modal);\n }\n }, 360);\n gtm.regionAlert('').sendEvent('exit');\n },\n\n closeListener() {\n if (this.modalOverlay && this.modalOverlay !== undefined) {\n gtm.regionAlert('').sendEvent('shown');\n this.modalOverlay.addEventListener(\n 'click',\n function () {\n this.closeModal();\n }.bind(this)\n );\n }\n\n if (this.modalClose && this.modalClose !== undefined) {\n this.modalClose.addEventListener(\n 'click',\n function () {\n this.closeModal();\n }.bind(this)\n );\n }\n },\n flagClickListener() {\n const flags = this.alertModal.querySelectorAll('[data-flag]');\n\n flags.forEach(flag => {\n flag.addEventListener('click', event => {\n if (event.currentTarget.tagName === 'A') {\n let flagEventAction = event.currentTarget.dataset.flag;\n gtm.regionAlert(flagEventAction).sendEvent('changed');\n }\n });\n });\n },\n init() {\n this.otherRegionsListener();\n this.closeListener();\n this.flagClickListener();\n },\n};\n\nexport { createRegionAlert as default, regionAlertSpecs };\n"],"names":["AlertPopupController","el","this","showCSSClass","hideCSSClass","nullCSSClass","titleElement","querySelector","cm","CookieMonster","cookieParamId","dataset","alertPopup","hasAlertPopupTakenOver","regionAlertCookieName","regionAlertSpecs","getCookieName","AlertPopup","els","forEach","init","prototype","postInsertActions","setCookie","classList","remove","add","takeOverRegionAlert","postClosedActions","_this","addEventListener","e","currentTarget","restoreSettingRegionAlert","isHomepage","isRegionAlertCookieSet","setRegionAlertCookie","removeRegionAlertCookie","window","location","pathname","getCookie","getCookieValue","getCookieExpirationDate","unsetCookie","closeHandler","target","hasAttribute","preventDefault","hasCookie","cookieName","concat","_this2","registerCookieComplianceCallback","callback","isCallOptanonWrapper","addEventListenerToElement","bind","createRegionAlert","actionBasedOnCookie","setCookieOnRegionSelection","createRegionAlertBasedOnCookie","isCookieSet","isHome","includes","isLogin","some","slug","replace","insertSlugSlashes","isAllowedURL","getParamValueFromUrl","CORS","successCallback","errorCallback","data","length","d","document","createElement","innerHTML","body","insertBefore","firstChild","createAlertMarkup","regionAlert","RegionAlert","href","err","LoggingHandler","logError","searchTerm","fileName","alertModal","cookie","openRegionClass","modalFlipText","modalFlipLink","modalClose","modalOverlay","boxInitialHeight","clientHeight","boxContainer","boxContainerInitialHeight","boxRegions","boxRecommend","boxRecommendInitialHeight","originalHeight","containerDifference","isScrolledToBottom","offsetHeight","scrollTop","scrollHeight","getBoxHeightBasedOnScreenSize","style","top","innerHeight","height","overflowY","setHeightContainer","elHeight","arguments","undefined","Object","assign","setScrollOnGraphic","contains","unblockBody","position","otherRegionsOpen","debounce","visibility","otherRegionsClose","otherRegionsToggle","otherRegionsListener","closeModal","modal","setTimeout","parentNode","removeChild","gtm","sendEvent","closeListener","flagClickListener","querySelectorAll","flag","event","tagName","flagEventAction"],"sourceRoot":""}