1var P=Object.defineProperty;var A=(e,t,s)=>t in e?P(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var k=(e,t,s)=>(A(e,typeof t!="symbol"?t+"":t,s),s);import{C as I}from"./__vite-custom-html-element.bdb17794.js";import{g as D,s as U,a as V,b as R}from"./__vite-impressions.0aa7bee3.js";import{g as F,a as j,b as Q,c as $,d as C,i as E,e as q}from"./__vite-trackingHelpers.25ef7f04.js";import{D as L}from"./__vite-event.b6545f60.js";import{s as x}from"./__vite-products.9c26dcf5.js";import{s as M,P as _}from"./__vite-user.f69ca4cb.js";import{s as T,T as u}from"./__vite-cookies.6663c18a.js";import{s as N}from"./__vite-collection.7b19f9a5.js";import{g as J}from"./__vite-get-parent-target.5bbe01eb.js";import{d as B}from"./__vite-debouncers.710db348.js";import{a as G}from"./__vite-location.e499bba4.js";import"./__vite-utils.9fac69fd.js";import"./__vite-section-loader.cfabd402.js";const S={index:"position",id:"id",name:"title",quantity:"quantity",variant:"public_title",category:"item_category",sku:"sku",barcode:"barcode",brand:"vendor",item_list_name:({list:e})=>F(e),price:j,discount:Q,in_stock:"available",custom:$},h=2,d=3;var g;const b=(g=class extends I{constructor(e){super(e),this.previousState={},this.previousFilters={},this.bodyDelegate=this.bodyDelegate||new L(document.body),this.killDelegate=()=>{this.bodyDelegate.destroy()},this.currency=this.getAttribute("currency")||"EUR",this.pageType=this.getAttribute("page-type")||"",this.tag_id=this.getAttribute("tag-id")||"";const t=this.getAttribute("page-title")||"",s=document.createElement("span");s.innerHTML=t,this.pageTitle=s.textContent,this.pagePath=this.getAttribute("page-path")||"";const i=this.getAttribute("script-url")||"";window.localStorage.setItem("contentsquare_script_url",i),T("contentsquare_script_url",i),window.localStorage.setItem("contentsquare_tag_id",this.tag_id),T("contentsquare_tag_id",this.tag_id)}init(){var a,p,v,f,w,y;this.send_event("setCustomVariable",11,"page_type",this.pageType,d),this.send_event("setCustomVariable",12,"env_language",(p=(a=window==null?void 0:window.themeVariables)==null?void 0:a.data)==null?void 0:p.lang,d),this.send_event("setCustomVariable",13,"env_country",(f=(v=window==null?void 0:window.themeVariables)==null?void 0:v.settings)==null?void 0:f.currentLocalization,d),this.send_event("setCustomVariable",14,"env_currency",(y=(w=window==null?void 0:window.themeVariables)==null?void 0:w.settings)==null?void 0:y.cartCurrency,d);const e=D()||[];if(e.length){const m=e.map(O=>O.name).join(" / ");this.send_event("setCustomVariable",15,"page_breadcrumb",m,d)}const[t,s]=b.promisify(),[i,n]=b.promisify(),[l,o]=b.promisify();this.resolveConsent=s,this.resolveProduct=o,this.resolveUser=n,Promise.all([t,i,l]).then(()=>{this.launchScript()});const r=window.localStorage.getItem("consentMode");r&&this.waitForConsent(r),this.bodyDelegate.on("google-consent","body",m=>{this.waitForConsent(m.detail)}),this.pageType!=="product"&&this.resolveProduct()}launch_trackings(){this.getImpressions=B(this.launchImpressions.bind(this),2e3),this._unsubscribeImpressions=U(this.getImpressions,!0),this._unsubscribeNavigation=V(),this._unsubscribeAddToCart=R(this.send_add_to_cart.bind(this)),window.sessionStorage&&(this.previousCart=JSON.parse(sessionStorage.getItem("gtm-cart")||"{}")),this.launchEventTracking(),this.runSimpleTrackings(),this.variantSubscribtionPool=[]}async connectedCallback(){switch(this.init(),this.launch_trackings(),this.pageType){case"collection":this.unsubscribeFacets=N(this.pushNewPage.bind(this)),this.rootDelegate.on("pagination:page-changed",this.pushNewPage.bind(this));break;case"search":this.unsubscribeFacets=N(this.facetTracking.bind(this))}this._unsubscribeUser=M(this.send_user_id.bind(this),!0)}disconnectedCallback(){super.disconnectedCallback(),this.killDelegate&&this.killDelegate(),this._unsubscribeUser&&this._unsubscribeUser(),this._unsubscribeImpressions(),this._unsubscribeAddToCart(),this.variantSubscribtionPool.forEach(e=>e()),this.variantSubscribtionPool.length=0,this.unsubscribeFacets&&this.unsubscribeFacets()}getDataLayer(e=!1){return window._uxa=window._uxa||[],window._uxa}launchScript(){const e=this.getDataLayer();if(typeof CS_CONF>"u"){e.push(["setPath",window.location.pathname+window.location.hash.replace("#","?__")]);const t=document.createElement("script");t.type="text/javascript",t.async=!0,t.src=`//t.contentsquare.net/uxa/${this.tag_id}.js`,document.getElementsByTagName("head")[0].appendChild(t)}else e.push(["trackPageview",window.location.pathname+window.location.hash.replace("#","?__")])}send_event(...e){this.getDataLayer().push([...e])}launchEventTracking(){const e=["a","button","input","[gtm-event]","copy-clipboard"],t=o=>{let c=J(o.target,e);if(!c)return;const r=u._getClickers("CONTENTSQUARE",c);r&&r.forEach(({callback:a,async:p})=>{a(c,this.send_generic_event.bind(this))})},s=()=>{e.forEach(o=>this.bodyDelegate.on("click",o,t,!1))},i=()=>
1{const o=G();Object.entries(o).forEach(([c,r])=>{const a=u._getQueries("CONTENTSQUARE",c);a&&a.forEach(({callback:p})=>p(r,this.send_generic_event.bind(this)))})},n=o=>{const{source:c,...r}=o.detail;if(!c)return;const a=u._getEvents("CONTENTSQUARE",c);a&&a.forEach(({callback:p})=>p(r,this.send_generic_event.bind(this)))},l=()=>{s(),i(),this.bodyDelegate.on("gtm-event","body",n.bind(this),!1),window.removeEventListener("DOMContentLoaded",l)};window.addEventListener("DOMContentLoaded",l)}send_view_items(e){if(!e)return;C(e,S).forEach(({item_list_id:s,item_list_name:i,items:n})=>{if(n.length&&E(s)){const l=parseFloat((n[0]?n[0].price-n[0].discount:0).toFixed(2)),{name:o,in_stock:c,id:r}=n[0];this.resolveProduct(),this.send_event("setCustomVariable",7,"product_name",o,d),this.send_event("setCustomVariable",8,"product_price",l.toString(),d),this.send_event("setCustomVariable",9,"product_in_stock",c.toString(),d),this.send_event("setCustomVariable",10,"product_id",r.toString(),d)}})}launchImpressions(e){let t;Object.keys(this.previousState).length===0?t=e:t=q(e,this.previousState),this.send_view_items(t),this.resolveProduct(),Object.entries(t).forEach(([s,i])=>{if(E(s)){const{handle:n}=i.impressions[0];this.variantSubscribtionPool.push(x(n,l=>{this.send_event("trackPageview",`/product/${n}?variant=${l.id}`)},!1))}}),this.previousState=Object.assign(this.previousState,t)}pushNewPage(){const e=["page","sort_by"];let t=document.location.search.replace("?","");t=t.split("&").map(s=>s.split("=")).filter(([s,i])=>!!i&&(e.includes(s)||/^filter/.test(s))).map(([s,i])=>{let n=s.split(/\./).pop();return n==="lte"&&(n="price_lte"),n==="gte"&&(n="price_gte"),/^filter/.test(s)&&!/^filter/.test(n)&&(n=`filter_${n}`),[n,i]}).map(([s,i])=>`${s}=${i}`).join("&"),this.send_event("trackPageview",`${document.location.pathname}?${t}`)}facetTracking(e){const{filters:t,sort_by:s}=JSON.parse(JSON.stringify(e)),i=Object.fromEntries(Object.keys(this.previousFilters).map(r=>[r,null])),n=Object.keys(t).map(r=>r.replace(/\.(?:lte|gte)$/g,"")),o=[...new Set(n)].map((r,a)=>[`filter${a?a+1:""}`,r]);o.push(["sort_by",s]),Object.assign(i,Object.fromEntries(o)),this.previousFilters=JSON.parse(JSON.stringify(i));const c=Object.entries(i).map(([r,a])=>{const p=a.split(/\./).pop();return`${r}=${p}`}).join("&");this.send_event("trackPageview",`${document.location.pathname}?${c}`)}runSimpleTrackings(){new u("CONTENTSQUARE","news_subscribe","click",".newsletter__form button, .footer__newsletter-form button",(e,t)=>{_.setItem("news_subscribe",!0)},!0),new u("CONTENTSQUARE","news_subscribe_confirm","query","customer_posted",(e,t)=>{_.getItem("news_subscribe")&&t("trackPageEvent","subscribe_from_footer"),_.deleteItem("news_subscribe")}),new u("CONTENTSQUARE","popup_subscription","event","theme_popup",(e,t)=>{e.open||t("trackPageEvent","popin_subscribtion_closed")}),new u("CONTENTSQUARE","popin_subscribe","click",".newsletter-modal__form button",(e,t)=>{_.setItem("popin_subscribe",!0)},!0),new u("CONTENTSQUARE","popin_subscribe_confirm","query","customer_posted",(e,t)=>{_.getItem("popin_subscribe")&&t("trackPageEvent","subscribe_from_popin"),_.deleteItem("popin_subscribe")}),new u("CONTENTSQUARE","announcement_bar_read","click",".announcement-bar button[data-action='open-content']",(e,t)=>{t("trackPageEvent","announcement_bar_read")}),new u("CONTENTSQUARE","announcement_bar_promo_code","click",".announcement-bar .nl-promocode__btn",(e,t)=>{t("trackPageEvent","announcement_bar_promo_code")}),new u("CONTENTSQUARE","announcement_bar_navigate","click",".announcement-bar a.button button--primary",(e,t)=>{t("trackPageEvent","announcement_bar_navigate")},!0),new u("CONTENTSQUARE","share_button_click","click",".product-meta__share-button-item, .social-media__item li",(e,t)=>{const s=/product-meta__share-button-item--([^\s"]+)/.exec(e.className)||/social-media__item--([^\s"]+)/.exec(e.className);s&&t("trackDynamicVariable",{key:"share_button_click",value:s[1]})},!1),new u("CONTENTSQUARE","aki_discount_coupon_valid","event","aki-discount:coupon:valid",(e,t)=>{t("trackDynamicVariable",{key:"aki_discount_coupon_valid",coupon:e.coupon})}),new u("CONTENTSQUARE","aki_discount_coupon_error","event","aki-discount:coupon:error",(e,t)=>{t("trackDynamicVariable",{key:"aki_discount_coupon_error",coupon:e.coupon})})}send_user_id({id:e,action:t,user_data:s}){var i;switch(t){case"logout":case"login":case"sign_up":this.send_event("setCustomVariable",2,"user_logEvent",t,d);break}e&&this.send_event("setCustomVariable",1,"user_logged",(!!e).toString(),h),s&&(this.send_event("setCustomVariable",3,"user_newCustomer",(i=s.new_customer)==null?void 0:i.toString(),h),this.send_event("setCustomVariable",4,"user_lastOrder",s.last_order,h),this.send_event("setCustomVariable",5,"user_numberOfOrders",s.orders_count.toString(),h)),this.resolveUser()}send_generic_event(e={}){this.send_event(e)}send_add_to_cart(e,t){if(Object.keys(e).length===0)return;const s=C(e,S);
1this.pageType,s.forEach(({items:i,item_list_id:n})=>{const{sku:l,id:o,barcode:c}=i[0];this.send_event("ec:cart:add",{sku:l,id:o}),this.send_event("trackPageEvent","addToCart"),this.send_event("trackPageview",`add-to-cart?source=${n}&id=${o}`)})}waitForConsent(e){try{(typeof e=="string"?JSON.parse(e):e).ad_user_data==="granted"?this.resolveConsent():console.log("Contensquare not thrown because of consent")}catch{console.log("WARNING : consent mode not properly set for contentsquare"),this.resolveConsent()}}static getFormattedImpression(e,t){return{[e]:{list:e,impressions:t}}}},k(g,"promisify",()=>{let e;return[new Promise(s=>e=s),e]}),g);window.customElements.define("contentsquare-catcher",b);
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.