1(()=>{"use strict";var e={156(e){var t=function(e){var t;return!!e&&"object"==typeof e&&"[object RegExp]"!==(t=Object.prototype.toString.call(e))&&"[object Date]"!==t&&e.$$typeof!==s},s="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function i(e,t){return!1!==t.clone&&t.isMergeableObject(e)?a(Array.isArray(e)?[]:{},e,t):e}function n(e,t,s){return e.concat(t).map(function(e){return i(e,s)})}function o(e){return Object.keys(e).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[])}function r(e,t){try{return t in e}catch(e){return!1}}function a(e,s,l){(l=l||{}).arrayMerge=l.arrayMerge||n,l.isMergeableObject=l.isMergeableObject||t,l.cloneUnlessOtherwiseSpecified=i;var c,u,h=Array.isArray(s);return h!==Array.isArray(e)?i(s,l):h?l.arrayMerge(e,s,l):(u={},(c=l).isMergeableObject(e)&&o(e).forEach(function(t){u[t]=i(e[t],c)}),o(s).forEach(function(t){(!r(e,t)||Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))&&(r(e,t)&&c.isMergeableObject(s[t])?u[t]=(function(e,t){if(!t.customMerge)return a;var s=t.customMerge(e);return"function"==typeof s?s:a})(t,c)(e[t],s[t],c):u[t]=i(s[t],c))}),u)}a.all=function(e,t){if(!Array.isArray(e))throw Error("first argument should be an array");return e.reduce(function(e,s){return a(e,s,t)},{})},e.exports=a}},t={};function s(i){var n=t[i];if(void 0!==n)return n.exports;var o=t[i]={exports:{}};return e[i](o,o.exports,s),o.exports}s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{for(var i in t)s.o(t,i)&&!s.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);class i{static isSupported(){return"undefined"!==document.cookie}static setItem(e,t,s){if(null==e)throw Error("You must specify a key to set a cookie");let i=new Date;i.setTime(i.getTime()+864e5*s);let n="";"https:"===location.protocol&&(n="secure"),document.cookie=`${e}=${t};expires=${i.toUTCString()};path=/;sameSite=lax;${n}`}static getItem(e){if(!e)return!1;let t=e+"=",s=document.cookie.split(";");for(let e=0;e<s.length;e++){let i=s[e];for(;" "===i.charAt(0);)i=i.substring(1);if(0===i.indexOf(t))return i.substring(t.length,i.length)}return!1}static removeItem(e){document.cookie=`${e}= ; expires = Thu, 01 Jan 1970 00:00:00 GMT;path=/`}static key(){return""}static clear(){}}class n{constructor(e=document){this._el=e,e.$emitter=this,this._listeners=[]}publish(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=new CustomEvent(e,{detail:t,cancelable:s});return this.el.dispatchEvent(i),i}subscribe(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this,n=e.split("."),o=s.scope?t.bind(s.scope):t;if(s.once&&!0===s.once){let t=o;o=function(s){i.unsubscribe(e),t(s)}}return this.el.addEventListener(n[0],o),this.listeners.push({splitEventName:n,opts:s,cb:o}),!0}unsubscribe(e){let t=e.split(".");return this.listeners=this.listeners.reduce((e,s)=>([...s.splitEventName].sort().toString()===t.sort().toString()?this.el.removeEventListener(s.splitEventName[0],s.cb):e.push(s),e),[]),!0}reset(){return this.listeners.forEach(e=>{this.el.removeEventListener(e.splitEventName[0],e.cb)}),this.listeners=[],!0}get el(){return this._el}set el(e){this._el=e}get listeners(){return this._listeners}set listeners(e){this._listeners=e}}let o="js-offcanvas-singleton";class r{constructor(){this.$emitter=new n}open(e,t,s,i,n,o,r){this._removeExistingOffCanvas();let a=this._createOffCanvas(s,o,r,i);this.setContent(e,n),this._openOffcanvas(a,t)}setContent(e,t){let s=this.getOffCanvas();s[0]&&(s[0].innerHTML=e,this._registerEvents(t),this._setAriaAttrs())}setAdditionalClassName(e){this.getOffCanvas()[0].classList.add(e)}getOffCanvas(){return document.querySelectorAll(`.${o}`)}close(e){let t=this.getOffCanvas();t.forEach(e=>{bootstrap.Offcanvas.getInstance(e).hide()}),setTimeout(()=>{this.$emitter.publish("onCloseOffcanvas",{offCanvasContent:t})},e)}goBackInHistory(){window.history.back()}exists(){return this.getOffCanvas().length>0}_openOffcanvas(e,t){window.focusHandler.saveFocusState("offcanvas"),r.bsOffcanvas.show(),window.history.pushState("offcanvas-open",""),"function"==typeof t&&t()}_registerEvents(e){let t=this.getOffCanvas();t.forEach(s=>{let i=()=>{setTimeout(()=>{s.remove(),window.focusHandler.resumeFocusState("offcanvas"),this.$emitter.publish("onCloseOffcanvas",{offCanvasContent:t})},e),s.removeEventListener("hide.bs.offcanvas",i)};s.addEventListener("hide.bs.offcanvas",i)}),window.addEventListener("popstate",this.close.bind(this,e),{once:!0}),document.querySelectorAll(".js-offcanvas-close").forEach(t=>{t.addEventListener("click",this.close.bind(this,e))})}_setAriaAttrs(){let e=this.getOffCanvas()[0],t="off-canvas-headline",s=e.querySelector(`[data-id="${t}"]`);s&&!e.hasAttribute("aria-labelledby")&&(s.setAttribute("id",t),e.setAttribute("aria-labelledby",t))}
1_removeExistingOffCanvas(){this.getOffCanvas().forEach(e=>{let t=bootstrap.Offcanvas.getInstance(e);t&&"function"==typeof t.dispose&&t.dispose(),e.remove()}),r.bsOffcanvas=null}_getPositionClass(e){return"left"===e?"offcanvas-start":"right"===e?"offcanvas-end":`offcanvas-${e}`}_createOffCanvas(e,t,s,i){let n=document.createElement("div");if(n.classList.add("offcanvas",o),n.classList.add(this._getPositionClass(e)),n.setAttribute("tabindex","-1"),!0===t&&n.classList.add("is-fullwidth"),s){let e=typeof s;if("string"===e)n.classList.add(s);else if(Array.isArray(s))s.forEach(e=>{n.classList.add(e)});else throw Error(`The type "${e}" is not supported. Please pass an array or a string.`)}return document.body.appendChild(n),r.bsOffcanvas=new bootstrap.Offcanvas(n,{backdrop:!1!==i||"static"}),n}}let a=Object.freeze(new r);class l{static open(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"left",i=!(arguments.length>3)||void 0===arguments[3]||arguments[3],n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:350,o=arguments.length>5&&void 0!==arguments[5]&&arguments[5],r=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"";a.open(e,t,s,i,n,o,r)}static setContent(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:350;a.setContent(e,t,s)}static setAdditionalClassName(e){a.setAdditionalClassName(e)}static close(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:350;a.close(e)}static exists(){return a.exists()}static getOffCanvas(){return a.getOffCanvas()}static REMOVE_OFF_CANVAS_DELAY(){return 350}}let c="loader",u={BEFORE:"before",INNER:"inner"};class h{constructor(e,t=u.BEFORE){this.parent=e instanceof Element?e:document.body.querySelector(e),this.position=t}create(){if(!this.exists()){if(this.position===u.INNER){this._previousHTML=this.parent.innerHTML,this.parent.innerHTML=h.getTemplate();return}this.parent.insertAdjacentHTML(this._getPosition(),h.getTemplate())}}remove(){if(this.position===u.INNER){this.parent.innerHTML=this._previousHTML;return}this.parent.querySelectorAll(`.${c}`).forEach(e=>e.remove())}exists(){return this.parent.querySelectorAll(`.${c}`).length>0}_getPosition(){return this.position===u.BEFORE?"afterbegin":"beforeend"}static getTemplate(){return`<div class="${c}" role="status"> 2 <span class="visually-hidden">Loading...</span> 3 </div>`}static SELECTOR_CLASS(){return c}}class d extends l{static open(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"left",n=!(arguments.length>4)||void 0===arguments[4]||arguments[4],o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:l.REMOVE_OFF_CANVAS_DELAY(),r=arguments.length>6&&void 0!==arguments[6]&&arguments[6],c=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"";if(!e)throw Error("A url must be given!");a._removeExistingOffCanvas();let u=a._createOffCanvas(i,r,c,n);this.setContent(e,t,s,n,o),a._openOffcanvas(u)}static setContent(e,t,s,i,n){super.setContent(`<div class="offcanvas-body">${h.getTemplate()}</div>`,n);let o=e=>{super.setContent(e,n),"function"==typeof s&&s(e)};t?fetch(e,{method:"POST",body:t instanceof FormData?t:JSON.stringify(t),headers:{"X-Requested-With":"XMLHttpRequest"}}).then(e=>e.text()).then(e=>d.executeCallback(o,e)):fetch(e,{headers:{"X-Requested-With":"XMLHttpRequest"}}).then(e=>e.text()).then(e=>d.executeCallback(o,e))}static executeCallback(e,t){"function"==typeof e&&e(t);let s=l.getOffCanvas();s.length>0&&window.PluginManager.initializePluginsInParentElement(s[0])}}var f=s(156),p=s.n(f);class g{static ucFirst(e){return e.charAt(0).toUpperCase()+e.slice(1)}static lcFirst(e){return e.charAt(0).toLowerCase()+e.slice(1)}static toDashCase(e){return e.replace(/([A-Z])/g,"-$1").replace(/^-/,"").toLowerCase()}static toLowerCamelCase(e,t){let s=g.toUpperCamelCase(e,t);return g.lcFirst(s)}static toUpperCamelCase(e,t){return t?e.split(t).map(e=>g.ucFirst(e.toLowerCase())).join(""):g.ucFirst(e.toLowerCase())}static parsePrimitive(e){try{return/^\d+(.|,)\d+$/.test(e)&&(e=e.replace(",",".")),JSON.parse(e)}catch(t){return e.toString()}}}class v{constructor(e,t={},s=!1){if(!(e instanceof Node)){console.warn(`There is no valid element given while trying to create a plugin instance for "${s}".`);return}this.el=e,this.$emitter=new n(this.el),this._pluginName=this._getPluginName(s),this.options=this._mergeOptions(t),this._initialized=!1,this._registerInstance(),this._init()}init(){console.warn(`The "init" method for the plugin "${this._pluginName}" is not defined. The plugin will not be initialized.`)}update(){}
3_init(){this._initialized||(this.init(),this._initialized=!0)}_update(){this._initialized&&this.update()}_mergeOptions(e){let t=[this.constructor.options,this.options,e];return t.push(this._getConfigFromDataAttribute()),t.push(this._getOptionsFromDataAttribute()),p().all(t.filter(e=>e instanceof Object&&!(e instanceof Array)).map(e=>e||{}))}_getConfigFromDataAttribute(){let e={};if("function"!=typeof this.el.getAttribute)return e;let t=g.toDashCase(this._pluginName),s=this.el.getAttribute(`data-${t}-config`);return s?window.PluginConfigManager.get(this._pluginName,s):e}_getOptionsFromDataAttribute(){let e={};if("function"!=typeof this.el.getAttribute)return e;let t=g.toDashCase(this._pluginName),s=this.el.getAttribute(`data-${t}-options`);if(s)try{return JSON.parse(s)}catch(e){console.error(`The data attribute "data-${t}-options" could not be parsed to json: ${e.message}`)}return e}_registerInstance(){window.PluginManager.getPluginInstancesFromElement(this.el).set(this._pluginName,this),window.PluginManager.getPlugin(this._pluginName,!1).get("instances").push(this)}_getPluginName(e){return e||(e=this.constructor.name),e}}class _{constructor(){this._request=null,this._errorHandlingInternal=!1}get(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"application/json",i=this._createPreparedRequest("GET",e,s);return this._sendRequest(i,null,t)}post(e,t,s){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";i=this._getContentType(t,i);let n=this._createPreparedRequest("POST",e,i);return this._sendRequest(n,t,s)}delete(e,t,s){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";i=this._getContentType(t,i);let n=this._createPreparedRequest("DELETE",e,i);return this._sendRequest(n,t,s)}patch(e,t,s){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";i=this._getContentType(t,i);let n=this._createPreparedRequest("PATCH",e,i);return this._sendRequest(n,t,s)}abort(){if(this._request)return this._request.abort()}setErrorHandlingInternal(e){this._errorHandlingInternal=e}_registerOnLoaded(e,t){t&&(!0===this._errorHandlingInternal?(e.addEventListener("load",()=>{t(e.responseText,e)}),e.addEventListener("abort",()=>{console.warn(`the request to ${e.responseURL} was aborted`)}),e.addEventListener("error",()=>{console.warn(`the request to ${e.responseURL} failed with status ${e.status}`)}),e.addEventListener("timeout",()=>{console.warn(`the request to ${e.responseURL} timed out`)})):e.addEventListener("loadend",()=>{t(e.responseText,e)}))}_sendRequest(e,t,s){return this._registerOnLoaded(e,s),e.send(t),e}_getContentType(e,t){return e instanceof FormData&&(t=!1),t}_createPreparedRequest(e,t,s){return this._request=new XMLHttpRequest,this._request.open(e,t),this._request.setRequestHeader("X-Requested-With","XMLHttpRequest"),s&&this._request.setRequestHeader("Content-type",s),this._request}}let m="CookieConfiguration_Update",C="CookieConfiguration_CloseOffCanvas";class k extends v{static #e=this.lastTriggerElement=null;static #t=this.options={defaultCookieExpiration:30,offCanvasPosition:"left",submitEvent:"click",cookiePreference:"cookie-preference",cookieConfigHash:"cookie-config-hash",cookieSelector:"[data-cookie]",buttonOpenSelector:".js-cookie-configuration-button button",buttonSubmitSelector:".js-offcanvas-cookie-submit",buttonPermissionSelector:".js-cookie-permission-button",buttonAcceptAllSelector:".js-offcanvas-cookie-accept-all",globalButtonAcceptAllSelector:".js-cookie-accept-all-button",globalButtonPermissionSelector:".js-cookie-permission-button",parentInputSelector:".offcanvas-cookie-parent-input",customLinkSelector:`[href="${window.router["frontend.cookie.offcanvas"]}"]`,entriesActiveClass:"offcanvas-cookie-entries--active",entriesClass:"offcanvas-cookie-entries",groupClass:"offcanvas-cookie-group",parentInputClass:"offcanvas-cookie-parent-input",consentAcceptButtonSelector:".js-wishlist-cookie-accept",consentLoginButtonSelector:".js-wishlist-login",consentCancelButtonSelector:".js-wishlist-cookie-offcanvas-cancel",consentPreferencesButtonSelector:".js-wishlist-cookie-preferences"};init(){this.lastState={active:[],inactive:[]},this._cleanupTasks=[],this._httpClient=new _,this._registerEvents(),this._checkCookieConfigurationHash(),document.$emitter.subscribe("CookieConfiguration/requestConsent",e=>{e instanceof CustomEvent&&(e=e.detail),this.openRequestConsentOffCanvas(e.route,e.cookieName)}),this._registerCleanup(()=>{document.$emitter.unsubscribe("CookieConfiguration/requestConsent")})}destroy(){if(this._cleanupTasks&&this._cleanupTasks.length>0){let e=this._cleanupTasks.slice();this._cleanupTasks=[];for(let t=0;t<e.length;t++)try{e[t]()}catch(e){}}}_getDefaultCookieExpiration(){let{defaultCookieExpiration:e}=this.options,t=Number(e);return Number.isInteger(t)&&t>0?t:30}_registerEvents(){if(this._delegatedEventHandler)return;let{submitEvent:e,buttonOpenSelector:t,customLinkSelector:s,buttonPermissionSelector:i,globalButtonAcceptAllSelector:n}=this.options;this._delegatedEventHandler=e=>{let o=e.target;if(o.closest(s)){this._handleCustomLink(e);return}if(o.closest(t)){this.openOffCanvas();return}if(o.closest(i)){this._handlePermission(e);return}if(o.closest(n)){this._acceptAllCookiesFromCookieBar(e);return}},document.addEventListener(e,this._delegatedEventHandler,!0),this._registerCleanup(()=>{document.removeEventListener(e,this._delegatedEventHandler,!0),this._delegatedEventHandler=null})}_registerOffCanvasEvents(){let e=this._getOffCanvas();e&&!e.hasAttribute("data-offcanvas-events-registered")&&(this._offCanvasDelegatedHandler||(this._offCanvasDelegatedHandler=this._handleOffCanvasClick.bind(this)),e.setAttribute("data-offcanvas-events-registered","true"),e.addEventListener("click",this._offCanvasDelegatedHandler,!0),this._registerCleanup(()=>{e.removeEventListener("click",this._offCanvasDelegatedHandler,!0),e.removeAttribute("data-offcanvas-events-registered"),this._offCanvasDelegatedHandler=null}))}_handleOffCanvasClick(e){let{buttonSubmitSelector:t,buttonAcceptAllSelector:s}=this.options,i=e.target;if(i.closest(t)){e.preventDefault(),this._handleSubmit(e);return}if(i.closest(s)){e.preventDefault(),this._acceptAllCookiesFromOffCanvas(e);return}if("checkbox"===i.type){this._handleCheckbox(e);return}}_handleCustomLink(e){0!==e.button||e.ctrlKey||e.metaKey||e.shiftKey||e.defaultPrevented||(e.preventDefault(),this.openOffCanvas())}async _fetchCookieGroups(){try{let e=window.router["frontend.cookie.groups"],t=await fetch(e,{method:"GET",headers:{"X-Requested-With":"XMLHttpRequest"}});return await t.json()}catch(e){return console.error("Failed to fetch cookie groups:",e),null}}async _checkCookieConfigurationHash(){let{cookiePreference:e,cookieConfigHash:t}=this.options,s=i.getItem(e),n=i.getItem(t);if(!s&&!n)return;let o=await this._fetchCookieGroups();if(!o)return;let r=o.hash,a=o.languageId,l=this._getStoredHashForLanguage(n,a);if(l&&l!==r||s&&!l){await this._resetCookieConfiguration(o);return}l&&this._storeHashForLanguage(a,r,n)}_parseStoredHashes(e){if(!e)return{};try{let t=JSON.parse(e);if("object"==typeof t&&null!==t)return t}catch(e){}return{}}_getStoredHashForLanguage(e,t){return this._parseStoredHashes(e)[t]||null}_storeHashForLanguage(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,{cookieConfigHash:n}=this.options,o=s??i.getItem(n),r=this._parseStoredHashes(o);r[e]=t,i.setItem(n,JSON.stringify(r),this._getDefaultCookieExpiration())}async _resetCookieConfiguration(e){let t=e.elements||[],{activeCookieNames:s,inactiveCookieNames:n}=this._applyCookieConfiguration(t,"required",[],e.languageId);i.removeItem(this.options.cookiePreference);let o=s.filter(e=>e!==this.options.cookiePreference);this._handleUpdateListener(o,n),this._checkAndShowCookieBarIfNeeded()}_getTechnicallyRequiredCookieNames(){return["session-","timezone"]}async _handlePermission(e){e.preventDefault();let t=await this._fetchCookieGroups();if(!t)return;let s=t.elements,{activeCookieNames:i,inactiveCookieNames:n}=this._applyCookieConfiguration(s,"required",[],t.languageId);this._handleUpdateListener(i,n),this._hideCookieBar(),this.closeOffCanvas()}_applyCookieConfiguration(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"all",s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=this._getTechnicallyRequiredCookieNames(),r=this._extractAllCookiesFromGroups(e),a=[],l=[];for(let e=0;e<r.length;e++){let i=r[e];("required"===t?i.isRequired:"selected"!==t||i.isRequired||s.includes(i.cookie))?a.push(i):l.push(i.cookie)}for(let e=0;e<l.length;e++)i.getItem(l[e])&&i.removeItem(l[e]);let c=[...o];for(let e=0;e<a.length;e++){let t=a[e],s=o.some(e=>t.cookie===e),r=t.cookie===this.options.cookieConfigHash;s||c.push(t.cookie),!t.value||s||(r&&n?this._storeHashForLanguage(n,t.value):r||i.setItem(t.cookie,t.value,t.expiration||this._getDefaultCookieExpiration()))}return{activeCookieNames:c,inactiveCookieNames:l}}_extractAllCookiesFromGroups(e){let t=[];for(let s=0;s<e.length;s++){let i=e[s],n=i.isRequired||!1;if(i.entries)for(let e=0;e<i.entries.length;e++){let s=i.entries[e];s.cookie&&t.push({cookie:s.cookie,value:s.value,expiration:s.expiration,isRequired:n})}i.cookie&&t.push({cookie:i.cookie,value:i.value,expiration:i.expiration,isRequired:n})}return t}
3_handleUpdateListener(e,t){let s=this._getUpdatedCookies(e,t);"function"==typeof window.registerGoogleReCaptchaPlugins&&(window.registerGoogleReCaptchaPlugins(),PluginManager.initializePlugins()),document.$emitter.publish(m,s)}_getUpdatedCookies(e,t){let{lastState:s}=this,i={};return e.forEach(e=>{s.inactive.includes(e)&&(i[e]=!0)}),t.forEach(e=>{s.active.includes(e)&&(i[e]=!1)}),i}openOffCanvas(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,{offCanvasPosition:t}=this.options,s=window.router["frontend.cookie.offcanvas"];this._hideCookieBar(),d.open(s,!1,this._onOffCanvasOpened.bind(this,e),t)}closeOffCanvas(e){d.close(),"function"==typeof e&&e()}_checkAndShowCookieBarIfNeeded(){let{cookiePreference:e}=this.options;if(!i.getItem(e)){let e=new CustomEvent("showCookieBar");document.dispatchEvent(e)}}_onOffCanvasOpened(e){this._registerOffCanvasEvents(),this._setInitialState(),this._setInitialOffcanvasState(),this._registerOffCanvasCloseListener(),PluginManager.initializePlugins(),"function"==typeof e&&e()}_registerOffCanvasCloseListener(){this._onOffCanvasOnceHandler=()=>{this._checkAndShowCookieBarIfNeeded()},a.$emitter.subscribe("onCloseOffcanvas",this._onOffCanvasOnceHandler,{once:!0}),this._registerCleanup(()=>{a.$emitter.unsubscribe("onCloseOffcanvas"),this._onOffCanvasOnceHandler=null})}_registerCleanup(e){this._cleanupTasks||(this._cleanupTasks=[]),this._cleanupTasks.push(e)}_hideCookieBar(){let e=new CustomEvent("hideCookieBar");document.dispatchEvent(e)}openRequestConsentOffCanvas(e,t){e&&t&&(k.lastTriggerElement=document.activeElement,d.open(e,!1,()=>{window.PluginManager.initializePlugins();let e=document.querySelector(".offcanvas");e&&this._registerConsentOffcanvasEvents(e,t)},"left"))}_registerConsentOffcanvasEvents(e,t){let{consentAcceptButtonSelector:s,consentLoginButtonSelector:i,consentCancelButtonSelector:n,consentPreferencesButtonSelector:o}=this.options,r=e.querySelector(s);r&&r.addEventListener("click",this._onAccept.bind(this,t));let a=e.querySelector(i);a&&a.addEventListener("click",this._onLogin.bind(this));let l=e.querySelector(n);l&&l.addEventListener("click",this._onCancel.bind(this));let c=e.querySelector(o);c&&c.addEventListener("click",this._onPreferences.bind(this))}_setInitialState(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=e||this._getCookies("all"),s=[],n=[];t.forEach(e=>{let{cookie:t,required:o}=e;i.getItem(t)||o?s.push(t):n.push(t)}),this.lastState={active:s,inactive:n}}_setInitialOffcanvasState(){let e=this.lastState.active,t=this._getOffCanvas();e.forEach(e=>{let s=t.querySelector(`[data-cookie="${e}"]`);s.checked=!0,this._childCheckboxEvent(s)})}_handleCheckbox(e){let{parentInputClass:t}=this.options,{target:s}=e;(s.classList.contains(t)?this._parentCheckboxEvent:this._childCheckboxEvent).call(this,s)}_findParentEl(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;for(;e&&!e.classList.contains(s);){if(e.classList.contains(t))return e;e=e.parentElement}return null}_isChecked(e){return!!e.checked}_parentCheckboxEvent(e){let{groupClass:t}=this.options,s=this._isChecked(e),i=this._findParentEl(e,t);this._toggleWholeGroup(s,i)}_childCheckboxEvent(e){let{groupClass:t}=this.options,s=this._isChecked(e),i=this._findParentEl(e,t);this._toggleParentCheckbox(s,i)}_toggleWholeGroup(e,t){Array.from(t.querySelectorAll("input")).forEach(t=>{t.checked=e})}_toggleParentCheckbox(e,t){let{parentInputSelector:s}=this.options,i=Array.from(t.querySelectorAll(`input:not(${s})`)),n=Array.from(t.querySelectorAll(`input:not(${s}):checked`));if(i.length>0){let e=t.querySelector(s);if(e){let t=n.length>0,s=t&&n.length!==i.length;e.checked=t,e.indeterminate=s}}}async _handleSubmit(){let e=this._getCookies("active").filter(e=>{let{required:t}=e;return!t}).map(e=>{let{cookie:t}=e;return t}),t=await this._fetchCookieGroups();if(!t)return;let s=t.elements,{activeCookieNames:i,inactiveCookieNames:n}=this._applyCookieConfiguration(s,"selected",e,t.languageId);this._handleUpdateListener(i,n),this.closeOffCanvas(document.$emitter.publish(C))}async acceptAllCookies(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];let e=await this._fetchCookieGroups();if(!e)return;let t=e.elements,{activeCookieNames:s,inactiveCookieNames:i}=this._applyCookieConfiguration(t,"all",[],e.languageId);this._handleUpdateListener(s,i),this._hideCookieBar(),this.closeOffCanvas()}async _acceptAllCookiesFromCookieBar(){let e=await this._fetchCookieGroups();if(!e)return;let t=e.elements,{activeCookieNames:s,inactiveCookieNames:i}=this._applyCookieConfiguration(t,"all",[],e.languageId);this._handleUpdateListener(s,i),this._hideCookieBar()}async _acceptAllCookiesFromOffCanvas(){let e=await this._fetchCookieGroups();if(!e)return;let t=e.elements,{activeCookieNames:s,inactiveCookieNames:i}=this._applyCookieConfiguration(t,"all",[],e.languageId);this._handleUpdateListener(s,i),this.closeOffCanvas(document.$emitter.publish(C))}_getCookies(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,{cookieSelector:s}=this.options;return t||(t=this._getOffCanvas()),Array.from(t.querySelectorAll(s)).filter(t=>{switch(e){case"all":return!0;case"active":return this._isChecked(t);case"inactive":return!this._isChecked(t);default:return!1}}).map(e=>
3{let{cookie:t,cookieValue:s,cookieExpiration:i,cookieRequired:n}=e.dataset;return{cookie:t,value:s,expiration:i,required:n}})}_getOffCanvas(){let e=l?l.getOffCanvas():[];return!!e&&e.length>0&&e[0]}_onAccept(e){i.setItem(e,"1",this._getDefaultCookieExpiration()),d.close()}_onLogin(){d.close(),window.location.href=window.router["frontend.account.login.page"]}_onCancel(){d.close()}_onPreferences(e){e.preventDefault(),d.close(),this.openOffCanvas(()=>{let e=document.querySelector(".offcanvas");e&&e.addEventListener("hidden.bs.offcanvas",this._restoreFocus.bind(this),{once:!0})})}_restoreFocus(){let e=k.lastTriggerElement;e?.focus?.()}}class b extends window.PluginBaseClass{static #e=this.options={prefix:"",street:"",zip:"",city:"",country:"",highlightColor:"",validateMultiple:!1,excluded:"",useCookieConsent:!1,msgAcceptCookie:"",msgOtherCountry:"",msgWrongNumber:"",msgUnknown:"",msgCheck:"",countries:[]};static #t=this.netzpAddressValidatorReset=!1;static #s=this.dontCheckAgain=!1;getAddress(e){let t=[];return e.forEach(function(e){e.types.includes("country")?t[e.types[0]]=e.short_name:t[e.types[0]]=e.long_name}),t}validate(){let e=this,t=e.options.prefix,s=t+e.options.street,i=t+e.options.zip,n=t+e.options.city,o=t+e.options.country,r=e.getValueForId(s).trim(),a=e.getValueForId(i).trim(),l=e.getValueForId(n).trim(),c=e.getTextForSelector("#"+o+" option:checked").trim(),u=e.getValueForId(o),h=e.options.countries[u],d="",f=""!==e.options.excluded?e.options.excluded.split(","):[];if(this.setTextAndDisplay("netzp-addressvalidator--msg_"+t,"","none"),!e.dontCheckAgain){if(!(!e.options.useCookieConsent||e.options.useCookieConsent&&-1!=document.cookie.indexOf("netzp_address_validator"))){this.setTextAndDisplay("netzp-addressvalidator--msg_"+t,e.options.msgAcceptCookie,"inline-block");return}if(!1==("object"==typeof google&&"object"==typeof google.maps)){this.setTextAndDisplay("netzp-addressvalidator--msg_"+t,"Google Maps Geocoding Api not loaded. Please check your plugin settings.","inline-block");return}if(""!==r&&""!==a&&""!==l&&null!=h){if(f.some(function(e){return r.toLowerCase().indexOf(e.toLowerCase().trim())>=0}))return;d=r+" "+a+" "+l+" "+c,new google.maps.Geocoder().geocode({address:d},function(o,r){if(r===google.maps.GeocoderStatus.INVALID_REQUEST||r===google.maps.GeocoderStatus.REQUEST_DENIED||r===google.maps.GeocoderStatus.UNKNOWN_ERROR||r===google.maps.GeocoderStatus.ERROR)e.setTextAndDisplay("netzp-addressvalidator--msg_"+t,"Answer from Google: REQUEST_DENIED - please open the JavaScript console and look there for further information.","inline-block");else if(r===google.maps.GeocoderStatus.OK&&o.length>0){let r=e.getAddress(o[0].address_components);if(h!==r.country)e.setTextAndDisplay("netzp-addressvalidator--msg_"+t,e.options.msgOtherCountry,"inline-block"),e.focus(i,!0);else if(null==r.street_number)e.setTextAndDisplay("netzp-addressvalidator--msg_"+t,e.options.msgWrongNumber,"inline-block"),e.focus(s);else if(a.substring(0,1)!==r.postal_code.substring(0,1))e.setTextAndDisplay("netzp-addressvalidator--msg_"+t,e.options.msgUnknown,"inline-block"),e.focus(s,!0);else{let t="";t="FR"===r.country||"US"===r.country||"GB"===r.country?r.street_number+(void 0!==r.subpremise?"/"+r.subpremise:"")+("FR"===r.country?", ":" ")+r.route:r.route+(void 0!==r.street_number?" "+r.street_number:"")+(void 0!==r.subpremise?"/"+r.subpremise:""),e.setField(s,t),r.postal_code&&e.setField(i,r.postal_code),r.locality&&e.setField(n,r.locality),r.postal_town&&e.setField(n,r.postal_town),e.dontCheckAgain=!e.options.validateMultiple,e.focus(s)}}else e.setTextAndDisplay("netzp-addressvalidator--msg_"+t,e.options.msgCheck,"inline-block"),e.netzpAddressValidatorReset=!0,e.focus(s,!0)})}}}createMessageElement(){let e=this.options.prefix,t=document.createElement("div");t.setAttribute("id","netzp-addressvalidator--msg_"+e),t.style.width="100%",t.style.backgroundColor=""!==this.options.highlightColor?this.options.highlightColor:"yellow",t.style.padding="3px 5px 3px 5px",t.style.marginBottom=".5rem",t.style.fontWeight="bold",t.style.display="none";let s=document.querySelector("#"+e+this.options.street)?.closest(".row");void 0!==s&&s.insertBefore(t,s.firstChild)}init(){let e=this,t=e.options.prefix;e.createMessageElement(),e.bind(t+e.options.street,"change",function(){e.validate()}),e.bind(t+e.options.zip,"change",function(){e.validate()}),e.bind(t+e.options.city,"change",function(){e.validate()}),e.bind(t+e.options.country,"change",function(){e.validate()}),e.bind(t+e.options.street,"keypress",function(){e.netzpAddressValidatorReset&&(e.netzpAddressValidatorReset=!1,e.setValueForId(zip,""),e.setValueForId(city,""))}),document.$emitter.subscribe(m,e.onCookieConfigurationUpdated)}bind(e,t,s){let i=document.getElementById(e);i?.addEventListener(t,s)}getTextForSelector(e){return document.querySelector(e).innerText}getValueForId(e){return document.getElementById(e).value}setValueForId(e,t){document.getElementById(e).value=t}highlight(e){let t=document.getElementById(e);t.style.backgroundColor=""!==this.options.highlightColor?this.options.highlightColor:"yellow",setTimeout(function(){t.classList.add("fadeBackgroun
3d"),setTimeout(function(){t.classList.remove("fadeBackground"),t.style.backgroundColor="unset"},1e3)},100)}setField(e,t){(null==t||this.getValueForId(e)!==t)&&(this.setValueForId(e,t),this.highlight(e))}setTextAndDisplay(e,t,s){let i=document.getElementById(e);i.innerHTML=t,i.style.display=s}focus(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],s=document.getElementById(e);s.focus(),t&&s.select()}onCookieConfigurationUpdated(e){location.reload()}}window.PluginManager.register("Netzp6Adressvalidator",b,"[data-netzp6-adressvalidator]")})();
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.