(function(){"use strict";function p(a){if(!a)return{};let t={};try{t=window.structuredClone?.(a)||JSON.parse(JSON.stringify(a))}catch(e){e instanceof DOMException&&(t=JSON.parse(JSON.stringify(a)))}return t}const l={pra_name:"pra_name",pra_no:"pra_no",pa_name:"pa_name",pa_no:"pa_no",hfb_name:"hfb_name",hfb_no:"hfb_no",id:"product_ids",name:"product_names",item_name:"product_item_names",price:"price",series:"product_series",type:"product_type",variant:"product_variant",vat:"product_vats",category:"category",category_local:"category_local"},g=["price","product_prices","product_vats","tax"];class m{constructor(t){this.data=p(t)}getData(t){return this.data[t]===void 0||this.data[t]===""?null:Array.isArray(this.data[t])?this._clean(t,this.data[t][0]):this._clean(t,this.data[t])}_clean(t,e){return g.includes(t)&&Number(e)||e}getPipData(t=null){let e={};for(let n in l)(!t||t.includes(l[n]))&&this.getData(l[n])&&(e[n]=this.getData(l[n]));return e}getPageName(){return this.data.page_name&&this.data.page_name!=="no_page_name"?this.data.page_name:window.location.href.split("/").slice(5,-1).join(">")}}function h(a){let t=new m(a),e={pathname:()=>window.location.pathname,country:()=>window.location.pathname.split("/")[1],language:()=>window.location.pathname.split("/")[2],site_level_1:()=>window.location.pathname.split("/")[3],site_level_2:()=>window.location.pathname.split("/")[4],page_name:()=>t.getPageName(),Checkout:()=>!!document.location.href.match("/order/confirmation/|/shoppingcart/"),checkout:()=>!!document.location.href.match("/order/confirmation/|/shoppingcart/"),getPipData:()=>t.getPipData.bind(t),pip_data:()=>t.getPipData(),search_params:()=>new URLSearchParams(document.location.search)};return new Proxy(t,{get(n,i,u){if(i in e)return e[i]();if(i==="all"){let _={};return Object.keys(e).forEach(d=>{_[d]=e[d]()}),Object.keys(t.data).forEach(d=>{_[d]=t.getData(d)}),_}return t.getData(i)},set(n,i,u){return n.data[i]=u,!0}})}class w{constructor(t,e="mtDataLayer",n=window.utag_data){this.b=new h(n),this.dataLayerName=e,this.ids=t,window[this.dataLayerName]=window[this.dataLayerName]||[],this.gtag("consent","default",{ad_storage:"granted",ad_user_data:"granted",ad_personalization:"granted",analytics_storage:"granted",allow_google_signals:!0,allow_ad_personalization_signals:!0}),this.gtag("js",new Date),this.loadIn(t[0],this.dataLayerName),t.forEach(i=>{this.gtag("config",i)})}gtag(){window[this.dataLayerName].push(arguments)}loadIn(t,e){let n=document.createElement("script");n.async=!0,n.src=`https://www.googletagmanager.com/gtag/js?id=${t}&l=${e}`,document.head.appendChild(n)}send({id:t,eventName:e="conversion",convLabel:n="",convDetails:i={}}){let u=t.startsWith("DC-")?!1:void 0;this.gtag("event",e,{allow_custom_scripts:u,send_to:`${t}${n}`,...i})}}const r={dc:"DC-10564948",aw:"AW-645217116"},c=new w(Object.values(r)),o=c.b,s={trackHomePage:function(){c.send({id:r.dc,convLabel:"/ikeam0/flt_c0+standard"})},trackViewItem:function(){window.addEventListener("view_item",({detail:{name:a,event_label:t}})=>{if(a!=="view_item"&&!window.location.pathname.includes("/p/"))return;const e={u1:o.hfb_name,u2:o.pra_name,u3:o.product_names,u4:t,u5:o.product_prices,u6:window.location.origin+window.location.pathname};c.send({id:r.dc,convLabel:"/ikeam0/flt_c00+standard",convDetails:e})})},trackCartView:function(){window.addEventListener("checkout_progress",({detail:{name:a,event_label:t}})=>{a==="checkout_progress"&&t==="cart_view"&&c.send({id:r.dc,convLabel:"/ikeam0/flt_c000+standard"})},{once:!0})},trackBeginCheckout:function(){window.addEventListener("ecommerce",({detail:{event_action:a,event_label:t}})=>{a==="checkout_progress"&&t==="checkout_step_1"&&c.send({id:r.dc,convLabel:"/ikeam0/flt_c001+standard"})})},trackPaymentOption:function(){window.addEventListener("ecommerce",({detail:{event_action:a,event_label:t}})=>{a==="checkout_progress"&&t==="checkout_step_3"&&c.send({id:r.dc,convLabel:"/ikeam0/flt_c002+standard"})})},trackPurchase:function(){window.addEventListener("purchase",({detail:a,params:{currency:t,value:e,transaction_id:n}={}})=>{if(a==="success"){const i={value:e,transaction_id:n};c.send({id:r.aw,convLabel:"/cDn8CMTm5egBENz21LMC",convDetails:{...i,currency:t}}),c.send({id:r.dc,eventName:"purchase",convLabel:"/ikeam00/flt_v0+transactions",convDetails:i})}})}};o.page_name==="home page"?s.trackHomePage():o.site_level_1==="p"?s.trackViewItem():o.site_level_1==="cart"?s.trackCartView():o.site_level_1==="checkout"&&(s.trackBeginCheckout(),s.trackPaymentOption(),s.trackPurchase())})();