PageSourceSearch

https://www.treningspartner.no/theme/1e7f8cc01bd1665106be699b87906645/js/klavi-overd/klavi-overd.js?1790164608

js treningspartner.no collected 2026-09-26 08:47:23 UTC 39,795 bytes, 10 lines download raw bytes

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!==i},i="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function s(e,t){return!1!==t.clone&&t.isMergeableObject(e)?a(Array.isArray(e)?[]:{},e,t):e}function o(e,t,i){return e.concat(t).map(function(e){return s(e,i)})}function n(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,i,l){(l=l||{}).arrayMerge=l.arrayMerge||o,l.isMergeableObject=l.isMergeableObject||t,l.cloneUnlessOtherwiseSpecified=s;var c,h,u=Array.isArray(i);return u!==Array.isArray(e)?s(i,l):u?l.arrayMerge(e,i,l):(h={},(c=l).isMergeableObject(e)&&n(e).forEach(function(t){h[t]=s(e[t],c)}),n(i).forEach(function(t){(!r(e,t)||Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))&&(r(e,t)&&c.isMergeableObject(i[t])?h[t]=(function(e,t){if(!t.customMerge)return a;var i=t.customMerge(e);return"function"==typeof i?i:a})(t,c)(e[t],i[t],c):h[t]=s(i[t],c))}),h)}a.all=function(e,t){if(!Array.isArray(e))throw Error("first argument should be an array");return e.reduce(function(e,i){return a(e,i,t)},{})},e.exports=a}},t={};function i(s){var o=t[s];if(void 0!==o)return o.exports;var n=t[s]={exports:{}};return e[s](n,n.exports,i),n.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var s in t)i.o(t,s)&&!i.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var s=i(156),o=i.n(s);class n{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 i=n.toUpperCamelCase(e,t);return n.lcFirst(i)}static toUpperCamelCase(e,t){return t?e.split(t).map(e=>n.ucFirst(e.toLowerCase())).join(""):n.ucFirst(e.toLowerCase())}static parsePrimitive(e){try{return/^\d+(.|,)\d+$/.test(e)&&(e=e.replace(",",".")),JSON.parse(e)}catch(t){return e.toString()}}}
1class r{constructor(e=document){this._el=e,e.$emitter=this,this._listeners=[]}publish(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=new CustomEvent(e,{detail:t,cancelable:i});return this.el.dispatchEvent(s),s}subscribe(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=this,o=e.split("."),n=i.scope?t.bind(i.scope):t;if(i.once&&!0===i.once){let t=n;n=function(i){s.unsubscribe(e),t(i)}}return this.el.addEventListener(o[0],n),this.listeners.push({splitEventName:o,opts:i,cb:n}),!0}unsubscribe(e){let t=e.split(".");return this.listeners=this.listeners.reduce((e,i)=>([...i.splitEventName].sort().toString()===t.sort().toString()?this.el.removeEventListener(i.splitEventName[0],i.cb):e.push(i),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}}class a{constructor(e,t={},i=!1){if(!(e instanceof Node)){console.warn(`There is no valid element given while trying to create a plugin instance for "${i}".`);return}this.el=e,this.$emitter=new r(this.el),this._pluginName=this._getPluginName(i),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(){}_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()),o().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=n.toDashCase(this._pluginName),i=this.el.getAttribute(`data-${t}-config`);return i?window.PluginConfigManager.get(this._pluginName,i):e}_getOptionsFromDataAttribute(){let e={};if("function"!=typeof this.el.getAttribute)return e;let t=n.toDashCase(this._pluginName),i=this.el.getAttribute(`data-${t}-options`);if(i)try{return JSON.parse(i)}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 l extends a{static #e=this.options={customerIdentityInfo:null};init(){window._learnq=window._learnq||[],this.options.customerIdentityInfo&&window._learnq.push(["identify",{$email:this.options.customerIdentityInfo.email,$first_name:this.options.customerIdentityInfo.firstName,$last_name:this.options.customerIdentityInfo.lastName,$phone_number:this.options.customerIdentityInfo.phoneNumber,$city:this.options.customerIdentityInfo.city,$region:this.options.customerIdentityInfo.region,$country:this.options.customerIdentityInfo.country,$zip:this.options.customerIdentityInfo.zip,birthday:this.options.customerIdentityInfo.birthday,language:this.options.customerIdentityInfo.language,salesChannelId:this.options.customerIdentityInfo.salesChannelId,salesChannelName:this.options.customerIdentityInfo.salesChannelName,customerGroup:this.options.customerIdentityInfo.customerGroup}])}}class c{static push(){this.isKlaviyoPersonIdentified()?window._learnq.push(...arguments):(window._odKlaviyoBuffer=window._odKlaviyoBuffer||[],window._odKlaviyoBuffer.push(...arguments),this.ensureBufferWatcher())}static ensureBufferWatcher(){void 0===window._odKlaviyoBufferWatcher&&(window._odKlaviyoBufferWatcher=setInterval(()=>{this.isKlaviyoPersonIdentified()&&(window._learnq.push(...window._odKlaviyoBuffer),window._odKlaviyoBuffer=[],clearInterval(window._odKlaviyoBufferWatcher))},500))}static isKlaviyoPersonIdentified(){return"function"==typeof window._learnq.isIdentified&&!0===window._learnq.isIdentified()}}class h extends a{static #e=this.options={productInfo:null};init(){if(!this.options.productInfo&&console){console.error("[Klaviyo] Product info configuration was not set.");return}
1c.push(["track","Viewed Product",this.options.productInfo]),c.push(["trackViewedItem",{Title:this.options.productInfo.ProductName,ItemId:this.options.productInfo.ProductID,Categories:this.options.productInfo.Categories,ImageUrl:this.options.productInfo.ImageURL,Url:this.options.productInfo.URL,Metadata:{Brand:this.options.productInfo.Brand,Price:this.options.productInfo.Price,CompareAtPrice:this.options.productInfo.CompareAtPrice}}])}}class u{static isSupported(){return"undefined"!==document.cookie}static setItem(e,t,i){if(null==e)throw Error("You must specify a key to set a cookie");let s=new Date;s.setTime(s.getTime()+864e5*i);let o="";"https:"===location.protocol&&(o="secure"),document.cookie=`${e}=${t};expires=${s.toUTCString()};path=/;sameSite=lax;${o}`}static getItem(e){if(!e)return!1;let t=e+"=",i=document.cookie.split(";");for(let e=0;e<i.length;e++){let s=i[e];for(;" "===s.charAt(0);)s=s.substring(1);if(0===s.indexOf(t))return s.substring(t.length,s.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 d{constructor(){this._storage={}}setItem(e,t){return this._storage[e]=t}getItem(e){return Object.prototype.hasOwnProperty.call(this._storage,e)?this._storage[e]:null}removeItem(e){return delete this._storage[e]}key(e){return Object.values(this._storage)[e]||null}clear(){return this._storage={}}}class p{constructor(){this._storage=null,this._chooseStorage(),this._validateStorage()}_chooseStorage(){return p._isSupported("localStorage")?this._storage=window.localStorage:p._isSupported("sessionStorage")?this._storage=window.sessionStorage:u.isSupported()?this._storage=u:this._storage=new d}static _isSupported(e){try{let t="__storage_test";return window[e].setItem(t,"1"),window[e].removeItem(t),!0}catch(e){return!1}}_validateStorage(){if("function"!=typeof this._storage.setItem)throw Error('The storage must have a "setItem" function');if("function"!=typeof this._storage.getItem)throw Error('The storage must have a "getItem" function');if("function"!=typeof this._storage.removeItem)throw Error('The storage must have a "removeItem" function');if("function"!=typeof this._storage.key)throw Error('The storage must have a "key" function');if("function"!=typeof this._storage.clear)throw Error('The storage must have a "clear" function')}getStorage(){return this._storage}}let f=Object.freeze(new p).getStorage();class g{static setCookie(e,t,i){var s="";if(i){var o=new Date;o.setTime(o.getTime()+864e5*i),s="; expires="+o.toUTCString()}document.cookie=e+"="+(t||"")+s+"; path=/"}static getCookie(e){for(var t=e+"=",i=document.cookie.split(";"),s=0;s<i.length;s++){for(var o=i[s];" "==o.charAt(0);)o=o.substring(1,o.length);if(0==o.indexOf(t))return o.substring(t.length,o.length)}return null}}class v extends a{static #e=this.STORAGE_VALUE="1";static #t=this.options={storageKey:"interacted_with_page",scriptInitialized:!1,afterInteraction:!1,publicApiKey:"",cookieConsent:""};init(){this.storage=f,this.canInitializeKlaviyoScript()&&this.initKlaviyoScript(),this.registerEvents()}registerEvents(){this.isPageInteractionRequired()&&window.addEventListener("scroll",(function(){this.markAsInteracted(),!this.options.scriptInitialized&&this.isAllowToTrack()&&this.initKlaviyoScript()}).bind(this),{once:!0})}cookiebotOnDecline(){this.unsetKlaviyoCookie(),this.options.scriptInitialized=!1,this.storage.removeItem(this.options.storageKey);let e=document.querySelectorAll("script[type='text/javascript']");for(let t=0;t<e.length;t++)"string"==typeof e[t].src&&e[t].src.includes("klaviyo.com")&&e[t].parentNode.removeChild(e[t]);g.setCookie("__kla_id",null,-1)}onKlaviyoCookieConsentAllowed(){this.setKlaviyoCookie(),this.options.afterInteraction&&this.markAsInteracted(),this.canInitializeKlaviyoScript()&&this.initKlaviyoScript()}isAllowToTrack(){switch(this.options.cookieConsent){case"nothing":return!0;case"shopware":case"consentmanager":case"usercentrics":case"cookiebot":return g.getCookie("od-klaviyo-track-allow");default:return!1}}isPageInteractionRequired(){return!!this.options.afterInteraction&&!this.options.scriptInitialized&&!this.hasPageInteraction()}canInitializeKlaviyoScript(){return this.isPageInteractionRequired()?this.hasPageInteraction():!this.options.scriptInitialized&&this.isAllowToTrack()}initKlaviyoScript(){(function(){let e=document.createElement("script");e.type="text/javascript",e.setAttribute("async",!0),e.src="https://static.klaviyo.com/onsite/js/klaviyo.js?company_id="+this.options.publicApiKey,document.body.appendChild(e),this.options.scriptInitialized=!0}).bind(this)()}setKlaviyoCookie(){g.setCookie("od-klaviyo-track-allow","true",30)}unsetKlaviyoCookie(){g.setCookie("od-klaviyo-track-allow","",-1)}markAsInteracted(){this.storage.setItem(this.options.storageKey,v.STORAGE_VALUE)}hasPageInteraction(){return this.storage.getItem(this.options.storageKey)===v.STORAGE_VALUE}}class _{static isNode(e){return"object"==typeof e&&null!==e&&(e===document||e===window||e instanceof Node)}static hasAttribute(e,t){if(!_.isNode(e))throw Error("The element must be a valid HTML Node!");return"function"==typeof e.hasAttribute&&e.hasAttribute(t)}static getAttribute(e,t){let i=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(i&&!1===_.hasAttribute(e,t))throw Error(`The required property "${t}" does not exist!`);
1if("function"!=typeof e.getAttribute){if(i)throw Error("This node doesn't support the getAttribute function!");return}return e.getAttribute(t)}static getDataAttribute(e,t){let i=!(arguments.length>2)||void 0===arguments[2]||arguments[2],s=t.replace(/^data(|-)/,""),o=n.toLowerCamelCase(s,"-");if(!_.isNode(e)){if(i)throw Error("The passed node is not a valid HTML Node!");return}if(void 0===e.dataset){if(i)throw Error("This node doesn't support the dataset attribute!");return}let r=e.dataset[o];if(void 0===r){if(i)throw Error(`The required data attribute "${t}" does not exist on ${e}!`);return r}return n.parsePrimitive(r)}static querySelector(e,t){let i=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(i&&!_.isNode(e))throw Error("The parent node is not a valid HTML Node!");let s=e.querySelector(t)||!1;if(i&&!1===s)throw Error(`The required element "${t}" does not exist in parent node!`);return s}static querySelectorAll(e,t){let i=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(i&&!_.isNode(e))throw Error("The parent node is not a valid HTML Node!");let s=e.querySelectorAll(t);if(0===s.length&&(s=!1),i&&!1===s)throw Error(`At least one item of "${t}" must exist in parent node!`);return s}static getFocusableElements(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.body,t=`
2            input:not([tabindex^="-"]):not([disabled]):not([type="hidden"]),
3            select:not([tabindex^="-"]):not([disabled]),
4            textarea:not([tabindex^="-"]):not([disabled]),
5            button:not([tabindex^="-"]):not([disabled]),
6            a[href]:not([tabindex^="-"]):not([disabled]),
7            [tabindex]:not([tabindex^="-"]):not([disabled])
8        `;return e.querySelectorAll(t)}static getFirstFocusableElement(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.body;return this.getFocusableElements(e)[0]}static getLastFocusableElement(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,t=this.getFocusableElements(e);return t[t.length-1]}}class m{constructor(){this._request=null,this._errorHandlingInternal=!1}get(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"application/json",s=this._createPreparedRequest("GET",e,i);return this._sendRequest(s,null,t)}post(e,t,i){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";s=this._getContentType(t,s);let o=this._createPreparedRequest("POST",e,s);return this._sendRequest(o,t,i)}delete(e,t,i){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";s=this._getContentType(t,s);let o=this._createPreparedRequest("DELETE",e,s);return this._sendRequest(o,t,i)}patch(e,t,i){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";s=this._getContentType(t,s);let o=this._createPreparedRequest("PATCH",e,s);return this._sendRequest(o,t,i)}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,i){return this._registerOnLoaded(e,i),e.send(t),e}_getContentType(e,t){return e instanceof FormData&&(t=!1),t}_createPreparedRequest(e,t,i){return this._request=new XMLHttpRequest,this._request.open(e,t),this._request.setRequestHeader("X-Requested-With","XMLHttpRequest"),i&&this._request.setRequestHeader("Content-type",i),this._request}}class C extends a{static #e=this.options={errorCls:"has-error",validCls:"is-valid",emailFieldSelector:"#email",subscribeToNewsletterSelector:"#subscribeToNewsletter",apiURL:"https://a.klaviyo.com/client/back-in-stock-subscriptions",contentType:"application/json",revision:"2024-10-15",hiddenCls:"d-none",successMessageSelector:".klaviyo-success",errorMessageSelector:".klaviyo-error",errorVariantMessageSelector:".klaviyo-error-variant",notValidEmailMessageSelector:".klaviyo-email-not-valid",fetchHeaderAccept:"application/json",composerPluginVersion:null,dbPluginVersion:null,shopwareVersion:null};init(){this._client=new m,this._getFormDataElements(),this.registerEvents()}_getFormDataElements(){this._email=_.querySelector(this.el,this.options.emailFieldSelector),this._subscribeToNewsletter=_.querySelector(this.el,this.options.subscribeToNewsletterSelector),this._successMessage=_.querySelector(this.el,this.options.successMessageSelector),this._errorMessage=_.querySelector(this.el,this.options.errorMessageSelector),this._emailN
8otValid=_.querySelector(this.el,this.options.notValidEmailMessageSelector),this._errorVariantMessage=_.querySelector(this.el,this.options.errorVariantMessageSelector);let e=document.querySelector("[data-klaviyo-plugin-version]"),t=document.querySelector("[data-klaviyo-plugin-version-db]"),i=document.querySelector("[data-klaviyo-shopware-version]");this.options.composerPluginVersion=e?e.getAttribute("data-klaviyo-plugin-version"):"unknown",this.options.dbPluginVersion=t?t.getAttribute("data-klaviyo-plugin-version-db"):"unknown",this.options.shopwareVersion=i?i.getAttribute("data-klaviyo-shopware-version"):"unknown"}registerEvents(){this.el.addEventListener("submit",this.onSubmit.bind(this))}onSubmit(e){return(e.preventDefault(),this._validateEmail(this._email.value))?this._proceedSubscription():this._showEmailValidationErrorMessage()}async _proceedSubscription(){let e=this._createFormData(),t=e.get("email"),i=JSON.stringify({data:{type:"back-in-stock-subscription",attributes:{channels:["EMAIL"],profile:{data:{type:"profile",attributes:{email:t}}}},relationships:{variant:{data:{type:"catalog-variant",id:"$custom:::$default:::"+(e.get("variant")?e.get("variant"):e.get("product"))}}}}});await fetch(this.options.apiURL+"/?company_id="+this.options.publicApiKey,{headers:{accept:this.options.fetchHeaderAccept,"content-type":this.options.contentType,revision:this.options.revision,"x-sw-plugin-version":this.options.composerPluginVersion,"x-sw-plugin-version-db":this.options.dbPluginVersion,"x-sw-version":this.options.shopwareVersion},body:i,method:"POST"}).then(i=>{"true"===e.get("subscribe_for_newsletter")&&this._proceedNewsletterSubscribe(t),this._handleResponse(i)}).catch(e=>{console.error(e)})}_handleResponse(e){return e.ok?this._showSuccessMessage():e.ok||404!==e.status?this._showErrorMessage():this._showErrorVariantMessage()}_proceedNewsletterSubscribe(e){this._subscribeToNewsletter&&this._client.post("/form/newsletter",JSON.stringify({email:e,option:"subscribe"}))}_showSuccessMessage(){this._email.value="",this._errorMessage.classList.add(this.options.hiddenCls),this._emailNotValid.classList.add(this.options.hiddenCls),this._successMessage.classList.remove(this.options.hiddenCls)}_showErrorMessage(){this._errorMessage.classList.remove(this.options.hiddenCls),this._emailNotValid.classList.add(this.options.hiddenCls),this._successMessage.classList.add(this.options.hiddenCls)}_showErrorVariantMessage(){this._errorVariantMessage.classList.remove(this.options.hiddenCls),this._errorMessage.classList.add(this.options.hiddenCls),this._emailNotValid.classList.add(this.options.hiddenCls),this._successMessage.classList.add(this.options.hiddenCls)}_showEmailValidationErrorMessage(){this._errorMessage.classList.add(this.options.hiddenCls),this._emailNotValid.classList.remove(this.options.hiddenCls),this._successMessage.classList.add(this.options.hiddenCls)}_createFormData(){let e=new URLSearchParams;return this.options.variantId!==this.options.productID&&(this.options.productID=this.options.variantId),e.append("a",this.options.publicApiKey),e.append("email",this._email.value),e.append("platform","api"),e.append("variant",this.options.variantId),e.append("product",this.options.productID),e.append("subscribe_for_newsletter",this._subscribeToNewsletter.checked),e}_validateEmail(e){return/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)}}let y="js-offcanvas-singleton";class b{constructor(){this.$emitter=new r}open(e,t,i,s,o,n,r){this._removeExistingOffCanvas();let a=this._createOffCanvas(i,n,r,s);this.setContent(e,o),this._openOffcanvas(a,t)}setContent(e,t){let i=this.getOffCanvas();i[0]&&(i[0].innerHTML=e,this._registerEvents(t),this._setAriaAttrs())}setAdditionalClassName(e){this.getOffCanvas()[0].classList.add(e)}getOffCanvas(){return document.querySelectorAll(`.${y}`)}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"),b.bsOffcanvas.show(),window.history.pushState("offcanvas-open",""),"function"==typeof t&&t()}_registerEvents(e){let t=this.getOffCanvas();t.forEach(i=>
8{let s=()=>{setTimeout(()=>{i.remove(),window.focusHandler.resumeFocusState("offcanvas"),this.$emitter.publish("onCloseOffcanvas",{offCanvasContent:t})},e),i.removeEventListener("hide.bs.offcanvas",s)};i.addEventListener("hide.bs.offcanvas",s)}),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",i=e.querySelector(`[data-id="${t}"]`);i&&!e.hasAttribute("aria-labelledby")&&(i.setAttribute("id",t),e.setAttribute("aria-labelledby",t))}_removeExistingOffCanvas(){this.getOffCanvas().forEach(e=>{let t=bootstrap.Offcanvas.getInstance(e);t&&"function"==typeof t.dispose&&t.dispose(),e.remove()}),b.bsOffcanvas=null}_getPositionClass(e){return"left"===e?"offcanvas-start":"right"===e?"offcanvas-end":`offcanvas-${e}`}_createOffCanvas(e,t,i,s){let o=document.createElement("div");if(o.classList.add("offcanvas",y),o.classList.add(this._getPositionClass(e)),o.setAttribute("tabindex","-1"),!0===t&&o.classList.add("is-fullwidth"),i){let e=typeof i;if("string"===e)o.classList.add(i);else if(Array.isArray(i))i.forEach(e=>{o.classList.add(e)});else throw Error(`The type "${e}" is not supported. Please pass an array or a string.`)}return document.body.appendChild(o),b.bsOffcanvas=new bootstrap.Offcanvas(o,{backdrop:!1!==s||"static"}),o}}let k=Object.freeze(new b);class w{static open(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"left",s=!(arguments.length>3)||void 0===arguments[3]||arguments[3],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:350,n=arguments.length>5&&void 0!==arguments[5]&&arguments[5],r=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"";k.open(e,t,i,s,o,n,r)}static setContent(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:350;k.setContent(e,t,i)}static setAdditionalClassName(e){k.setAdditionalClassName(e)}static close(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:350;k.close(e)}static exists(){return k.exists()}static getOffCanvas(){return k.getOffCanvas()}static REMOVE_OFF_CANVAS_DELAY(){return 350}}let E="loader",I={BEFORE:"before",INNER:"inner"};class S{constructor(e,t=I.BEFORE){this.parent=e instanceof Element?e:document.body.querySelector(e),this.position=t}create(){if(!this.exists()){if(this.position===I.INNER){this._previousHTML=this.parent.innerHTML,this.parent.innerHTML=S.getTemplate();return}this.parent.insertAdjacentHTML(this._getPosition(),S.getTemplate())}}remove(){if(this.position===I.INNER){this.parent.innerHTML=this._previousHTML;return}this.parent.querySelectorAll(`.${E}`).forEach(e=>e.remove())}exists(){return this.parent.querySelectorAll(`.${E}`).length>0}_getPosition(){return this.position===I.BEFORE?"afterbegin":"beforeend"}static getTemplate(){return`<div class="${E}" role="status">
9                    <span class="visually-hidden">Loading...</span>
10                </div>`}static SELECTOR_CLASS(){return E}}class O extends w{static open(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"left",o=!(arguments.length>4)||void 0===arguments[4]||arguments[4],n=arguments.length>5&&void 0!==arguments[5]?arguments[5]:w.REMOVE_OFF_CANVAS_DELAY(),r=arguments.length>6&&void 0!==arguments[6]&&arguments[6],a=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"";if(!e)throw Error("A url must be given!");k._removeExistingOffCanvas();let l=k._createOffCanvas(s,r,a,o);this.setContent(e,t,i,o,n),k._openOffcanvas(l)}static setContent(e,t,i,s,o){super.setContent(`<div class="offcanvas-body">${S.getTemplate()}</div>`,o);let n=e=>{super.setContent(e,o),"function"==typeof i&&i(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=>O.executeCallback(n,e)):fetch(e,{headers:{"X-Requested-With":"XMLHttpRequest"}}).then(e=>e.text()).then(e=>O.executeCallback(n,e))}static executeCallback(e,t){"function"==typeof e&&e(t);let i=w.getOffCanvas();i.length>0&&window.PluginManager.initializePluginsInParentElement(i[0])}}let A="CookieConfiguration_Update",L="CookieConfiguration_CloseOffCanvas";class T extends a{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 m,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:i,buttonPermissionSelector:s,globalButtonAcceptAllSelector:o}=this.options;this._delegatedEventHandler=e=>{let n=e.target;if(n.closest(i)){this._handleCustomLink(e);return}if(n.closest(t)){this.openOffCanvas();return}if(n.closest(s)){this._handlePermission(e);return}if(n.closest(o)){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:i}=this.options,s=e.target;if(s.closest(t)){e.preventDefault(),this._handleSubmit(e);return}if(s.closest(i)){e.preventDefault(),this._acceptAllCookiesFromOffCanvas(e);return}if("checkbox"===s.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,i=u.getItem(e),s=u.getItem(t);if(!i&&!s)return;let o=await this._fetchCookieGroups();if(!o)return;let n=o.hash,r=o.languageId,a=this._getStoredHashForLanguage(s,r);if(a&&a!==n||i&&!a){await this._resetCookieConfiguration(o);return}a&&this._storeHashForLanguage(r,n,s)}_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 i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,{cookieConfigHash:s}=this.options,o=i??u.getItem(s),n=this._parseStoredHashes(o);n[e]=t,u.setItem(s,JSON.stringify(n),this._getDefaultCookieExpiration())}async _resetCookieConfiguration(e){let t=e.elements||[],{activeCookieNames:i,inactiveCookieNames:s}=this._applyCookieConfiguration(t,"required",[],e.languageId);u.removeItem(this.options.cookiePreference);let o=i.filter(e=>e!==this.options.cookiePreference);this._handleUpdateListener(o,s),this._checkAndShowCookieBarIfNeeded()}_getTechnicallyRequiredCookieNames(){return["session-","timezone"]}async _handlePermission(e){e.preventDefault();let t=await this._fetchCookieGroups();if(!t)return;let i=t.elements,{activeCookieNames:s,inactiveCookieNames:o}=this._applyCookieConfiguration(i,"required",[],t.languageId);this._handleUpdateListener(s,o),this._hideCookieBar(),this.closeOffCanvas()}_applyCookieConfiguration(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"all",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=this._getTechnicallyRequiredCookieNames(),n=this._extractAllCookiesFromGroups(e),r=[],a=[];for(let e=0;e<n.length;e++){let s=n[e];("required"===t?s.isRequired:"selected"!==t||s.isRequired||i.includes(s.cookie))?r.push(s):a.push(s.cookie)}for(let e=0;e<a.length;e++)u.getItem(a[e])&&u.removeItem(a[e]);let l=[...o];for(let e=0;e<r.length;e++){let t=r[e],i=o.some(e=>t.cookie===e),n=t.cookie===this.options.cookieConfigHash;i||l.push(t.cookie),!t.value||i||(n&&s?this._storeHashForLanguage(s,t.value):n||u.setItem(t.cookie,t.value,t.expiration||this._getDefaultCookieExpiration()))}return{activeCookieNames:l,inactiveCookieNames:a}}_extractAllCookiesFromGroups(e){let t=[];for(let i=0;i<e.length;i++){let s=e[i],o=s.isRequired||!1;if(s.entries)for(let e=0;e<s.entries.length;e++){let i=s.entries[e];i.cookie&&t.push({cookie:i.cookie,value:i.value,expiration:i.expiration,isRequired:o})}s.cookie&&t.push({cookie:s.cookie,value:s.value,expiration:s.expiration,isRequired:o})}return t}
10_handleUpdateListener(e,t){let i=this._getUpdatedCookies(e,t);"function"==typeof window.registerGoogleReCaptchaPlugins&&(window.registerGoogleReCaptchaPlugins(),PluginManager.initializePlugins()),document.$emitter.publish(A,i)}_getUpdatedCookies(e,t){let{lastState:i}=this,s={};return e.forEach(e=>{i.inactive.includes(e)&&(s[e]=!0)}),t.forEach(e=>{i.active.includes(e)&&(s[e]=!1)}),s}openOffCanvas(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,{offCanvasPosition:t}=this.options,i=window.router["frontend.cookie.offcanvas"];this._hideCookieBar(),O.open(i,!1,this._onOffCanvasOpened.bind(this,e),t)}closeOffCanvas(e){O.close(),"function"==typeof e&&e()}_checkAndShowCookieBarIfNeeded(){let{cookiePreference:e}=this.options;if(!u.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()},k.$emitter.subscribe("onCloseOffcanvas",this._onOffCanvasOnceHandler,{once:!0}),this._registerCleanup(()=>{k.$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&&(T.lastTriggerElement=document.activeElement,O.open(e,!1,()=>{window.PluginManager.initializePlugins();let e=document.querySelector(".offcanvas");e&&this._registerConsentOffcanvasEvents(e,t)},"left"))}_registerConsentOffcanvasEvents(e,t){let{consentAcceptButtonSelector:i,consentLoginButtonSelector:s,consentCancelButtonSelector:o,consentPreferencesButtonSelector:n}=this.options,r=e.querySelector(i);r&&r.addEventListener("click",this._onAccept.bind(this,t));let a=e.querySelector(s);a&&a.addEventListener("click",this._onLogin.bind(this));let l=e.querySelector(o);l&&l.addEventListener("click",this._onCancel.bind(this));let c=e.querySelector(n);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"),i=[],s=[];t.forEach(e=>{let{cookie:t,required:o}=e;u.getItem(t)||o?i.push(t):s.push(t)}),this.lastState={active:i,inactive:s}}_setInitialOffcanvasState(){let e=this.lastState.active,t=this._getOffCanvas();e.forEach(e=>{let i=t.querySelector(`[data-cookie="${e}"]`);i.checked=!0,this._childCheckboxEvent(i)})}_handleCheckbox(e){let{parentInputClass:t}=this.options,{target:i}=e;(i.classList.contains(t)?this._parentCheckboxEvent:this._childCheckboxEvent).call(this,i)}_findParentEl(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;for(;e&&!e.classList.contains(i);){if(e.classList.contains(t))return e;e=e.parentElement}return null}_isChecked(e){return!!e.checked}_parentCheckboxEvent(e){let{groupClass:t}=this.options,i=this._isChecked(e),s=this._findParentEl(e,t);this._toggleWholeGroup(i,s)}_childCheckboxEvent(e){let{groupClass:t}=this.options,i=this._isChecked(e),s=this._findParentEl(e,t);this._toggleParentCheckbox(i,s)}_toggleWholeGroup(e,t){Array.from(t.querySelectorAll("input")).forEach(t=>{t.checked=e})}_toggleParentCheckbox(e,t){let{parentInputSelector:i}=this.options,s=Array.from(t.querySelectorAll(`input:not(${i})`)),o=Array.from(t.querySelectorAll(`input:not(${i}):checked`));if(s.length>0){let e=t.querySelector(i);if(e){let t=o.length>0,i=t&&o.length!==s.length;e.checked=t,e.indeterminate=i}}}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 i=t.elements,{activeCookieNames:s,inactiveCookieNames:o}=this._applyCookieConfiguration(i,"selected",e,t.languageId);this._handleUpdateListener(s,o),this.closeOffCanvas(document.$emitter.publish(L))}async acceptAllCookies(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];let e=await this._fetchCookieGroups();if(!e)return;let t=e.elements,{activeCookieNames:i,inactiveCookieNames:s}=this._applyCookieConfiguration(t,"all",[],e.languageId);this._handleUpdateListener(i,s),this._hideCookieBar(),this.closeOffCanvas()}async _acceptAllCookiesFromCookieBar(){let e=await this._fetchCookieGroups();if(!e)return;let t=e.elements,{activeCookieNames:i,inactiveCookieNames:s}=this._applyCookieConfiguration(t,"all",[],e.languageId);this._handleUpdateListener(i,s),this._hideCookieBar()}async _acceptAllCookiesFromOffCanvas(){let e=await this._fetchCookieGroups();if(!e)return;let t=e.elements,{activeCookieNames:i,inactiveCookieNames:s}=this._applyCookieConfiguration(t,"all",[],e.languageId);this._handleUpdateListener(i,s),this.closeOffCanvas(document.$emitter.publish(L))}_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:i}=this.options;return t||(t=this._getOffCanvas()),Array.from(t.querySelectorAll(i)).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=>{let{cookie:t,cookieValue:i,cookieExpiration:s,cookieRequired:o}=e.dataset;return{cookie:t,value:i,expiration:s,required:o}})}_getOffCanvas(){let e=w?w.getOffCanvas():[];return!!e&&e.length>0&&e[0]}_onAccept(e){u.setItem(e,"1",this._getDefaultCookieExpiration()),O.close()}_navigateTo(e){window.location.href=e}_onLogin(){O.close(),this._navigateTo(window.router["frontend.account.login.page"])}_onCancel(){O.close()}_onPreferences(e){e.preventDefault(),O.close(),this.openOffCanvas(()=>{let e=document.querySelector(".offcanvas");e&&e.addEventListener("hidden.bs.offcanvas",this._restoreFocus.bind(this),{once:!0})})}_restoreFocus(){let e=T.lastTriggerElement;e?.focus?.()}}class q{static iterate(e,t){if(e instanceof Map||Array.isArray(e))return e.forEach(t);if(e instanceof FormData){for(var i of e.entries())t(i[1],i[0]);return}if(e instanceof NodeList)return e.forEach(t);if(e instanceof HTMLCollection)return Array.from(e).forEach(t);if(e instanceof Object)return Object.keys(e).forEach(i=>
10{t(e[i],i)});throw Error(`The element type ${typeof e} is not iterable!`)}}function P(){q.iterate(PluginManager.getPluginInstances("KlaviyoTracking"),e=>{e.onKlaviyoCookieConsentAllowed()})}function x(){q.iterate(PluginManager.getPluginInstances("KlaviyoTracking"),e=>{e.cookiebotOnDecline()})}document.$emitter.subscribe(A,function(e){e&&e.detail["od-klaviyo-track-allow"]&&P()}),window.addEventListener("CookiebotOnAccept",P),window.addEventListener("CookiebotOnDecline",x),window.addEventListener("UC_CONSENT",e=>{let t=e.detail?.consent||{},i=Object.values(t.services||{}).find(e=>e?.name?.toLowerCase()==="klaviyo");if(i){i.consent?.given?P():x();return}"ALL_ACCEPTED"===t.status?P():x()}),window.cmp_id&&(__cmp("addEventListener",["consentrejected",x,!1],null),__cmp("addEventListener",["consentapproved",P,!1],null));let N=window.PluginManager;N.register("KlaviyoIdentityTrackingComponent",l,"[data-klaviyo-identity-tracking-component]"),N.register("KlaviyoProductViewedEventTrackingComponent",h,"[data-klaviyo-product-viewed-event-tracking-component]"),N.register("KlaviyoTracking",v,"[data-klaviyo-tracking]"),N.register("KlaviyoBackInStockNotification",C,"[data-klaviyo-back-in-stock-notification]")})();

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.