let Preflect={endpoint:"https://iqig4lu2xazogeu3qt22h6k6rq0agrku.lambda-url.us-east-1.on.aws/?_id=",getCookie:function(e){for(var t=e+"=",r=document.cookie.split(";"),n=0;n<r.length;n++){for(var o=r[n];" "==o.charAt(0);)o=o.substring(1,o.length);if(0==o.indexOf(t))return o.substring(t.length,o.length)}return null},makeID:function(){for(var e="",t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=t.length,n=0;n<6;n++)e+=t.charAt(Math.floor(Math.random()*r));return e},boot:function(){if(Preflect.cookieData=Preflect.getCookie("_Preflect"),Preflect.cookieData)try{Preflect.cookieData=JSON.parse(decodeURIComponent(Preflect.cookieData)),Preflect.attributionData=Preflect.cookieData.attributionData,Preflect.uuid=Preflect.cookieData.uuid}catch(e){}Preflect.uuid||(Preflect.attributionData={referrer:document.refrerer,landingPage:window.location.host+window.location.pathname,search:window.location.search},Preflect.isNewSession=!0,Preflect.uuid=Preflect.makeID(),document.cookie=`_Preflect=${encodeURIComponent(JSON.stringify({attributionData:Preflect.attributionData,uuid:Preflect.uuid}))};Max-Age=31536000;SameSite=strict;path=/`)},send:async function(e=!1){let t;try{if((t=await Preflect.attempt(()=>Preflect.getShopifyCartData()))&&Preflect.lastCart&&JSON.stringify(t.items)===JSON.stringify(Preflect.lastCart.items))return;Preflect.lastCart=t}catch(e){}let r;try{window.Shopify.checkout.order_id&&(r=window.Shopify.checkout.order_id)}catch(e){}try{Preflect.ipv4=Preflect.ipv4||await Promise.race([fetch("https://api.ipify.org?format=json").then(e=>e.json()).then(e=>e.ip),new Promise(e=>setTimeout(e,2e3))])}catch(e){}Preflect.postData={attribution:Preflect.attributionData,entropy:{fp:{colorDepth:Preflect.attempt(()=>Preflect.parseInt(window.screen.colorDepth)),dimensions:Preflect.attempt(()=>Preflect.getDimensions()),platform:window.navigator.platform,vendor:window.navigator.vendor,userAgentJS:window.navigator.userAgent,webGL:Preflect.attempt(()=>Preflect.getVideoCard()),concurrency:Preflect.attempt(()=>Preflect.replaceNaN(Preflect.toInt(window.navigator.hardwareConcurrency),null))},integrations:{klaviyo:Preflect.readKlaviyo()},ipv4:Preflect.ipv4,uuid:Preflect.uuid,cart:t},isNewSession:Preflect.isNewSession,addedToCart:e,page:window.location.host+window.location.pathname,orderID:r},fetch(Preflect.endpoint+"&data="+encodeURIComponent(JSON.stringify(Preflect.postData))).catch(console.log)},parseInt:function(e){return Preflect.replaceNaN(Preflect.toInt(e),null)},attempt:function(e){try{return e()}catch(e){return null}},getDimensions:function(){var e=[Preflect.parseInt(window.screen.width),Preflect.parseInt(window.screen.height)];return e.sort().reverse(),e.join("x")},toInt:function(e){return"number"==typeof e?e:Preflect.parseInt(e)},replaceNaN:function(e,t){return"number"==typeof e&&isNaN(e)?t:e},getVideoCard:function(){const e=document.createElement("canvas").getContext("webgl");if(e){var t=e.getExtension("WEBGL_debug_renderer_info");if(t)return{vendor:e.getParameter(t.UNMASKED_VENDOR_WEBGL),renderer:e.getParameter(t.UNMASKED_RENDERER_WEBGL)}}},getShopifyCartData:async function(){let e=await fetch(window.Shopify.routes.root+"cart.js");return{id:(e=await e.json()).token,items:e.items.map(e=>e.variant_id)}},readParam:(e,t=window.location.href)=>{e=e.replace(/[[]]/g,"\$&");let r=new RegExp("[?&]"+e+"(=([^&#]*)|&|#|$)"),n=r.exec(t);return n&&n[2]?decodeURIComponent(n[2].replace(/\+/g," ")):null},readKlaviyo:()=>Preflect.attempt(()=>Preflect.readParam("_kx")||JSON.parse(atob(Preflect.getCookie("__kla_id"))).$exchange_id)||null,debounce:(t,r)=>{let n;return(...e)=>{window.clearTimeout(n),n=window.setTimeout(()=>{t.apply(null,e)},r)}}};Preflect.debouncedSend=Preflect.debounce(Preflect.send,250),Preflect.boot(),Preflect.send();try{!function(e,t){e.fetch=function(){let e=t.apply(this,arguments);return e.then(e=>{[window.location.origin+"/cart/add.js",window.location.origin+"/cart/update.js",window.location.origin+"/cart/add",window.location.origin+"/cart/update"].includes(e.url)&&Preflect.debouncedSend(!0)}),e}}(window,window.fetch),Preflect.addToCartCTAs=document.querySelectorAll('[action="/cart/add"]');for(var x=0;x<Preflect.addToCartCTAs.length;x++)Preflect.addToCartCTAs[x].addEventListener("submit",()=>{Preflect.debouncedSend(!0)})}catch(e){}