!function(){"use strict";class t{t;o=0;i=[];u(t){if(t.hadRecentInput)return;const e=this.i[0],n=this.i.at(-1);this.o&&e&&n&&t.startTime-n.startTime<1e3&&t.startTime-e.startTime<5e3?(this.o+=t.value,this.i.push(t)):(this.o=t.value,this.i=[t]),this.t?.(t)}}const e=()=>{const t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart{if("loading"===document.readyState)return"loading";{const n=e();if(n){if(t{const e=t.nodeName;return 1===t.nodeType?e.toLowerCase():e.toUpperCase().replace(/^#/,"")},i=t=>{let e="";try{for(;9!==t?.nodeType;){const n=t,i=n.id?"#"+n.id:[r(n),...Array.from(n.classList).sort()].join(".");if(e.length+i.length>99)return e||i;if(e=e?i+">"+e:i,n.id)break;t=n.parentNode}}catch{}return e},o=new WeakMap;function a(t,e){return o.get(t)||o.set(t,new e),o.get(t)}let s=-1;const c=()=>s,u=t=>{addEventListener("pageshow",e=>{e.persisted&&(s=e.timeStamp,t(e))},!0)},l=(t,e,n,r)=>{let i,o;return a=>{e.value>=0&&(a||r)&&(o=e.value-(i??0),(o||void 0===i)&&(i=e.value,e.delta=o,e.rating=((t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good")(e.value,n),t(e)))}},d=t=>{requestAnimationFrame(()=>requestAnimationFrame(()=>t()))},f=()=>{const t=e();return t?.activationStart??0},h=(t,n=-1)=>{const r=e();let i="navigate";return c()>=0?i="back-forward-cache":r&&(document.prerendering||f()>0?i="prerender":document.wasDiscarded?i="restore":r.type&&(i=r.type.replace(/_/g,"-"))),{name:t,value:n,rating:"good",delta:0,entries:[],id:`v5-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:i}},p=(t,e,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(t)){const r=new PerformanceObserver(t=>{Promise.resolve().then(()=>{e(t.getEntries())})});return r.observe({type:t,buffered:!0,...n}),r}}catch{}},m=t=>{let e=!1;return()=>{e||(t(),e=!0)}};let g=-1;const v=new Set,y=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,w=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(const t of v)t();isFinite(g)||(g="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",w,!0))}},S=()=>{if(g<0){const t=f(),e=document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter(e=>"hidden"===e.name&&e.startTime>t)[0]?.startTime;g=e??y(),addEventListener("visibilitychange",w,!0),addEventListener("prerenderingchange",w,!0),u(()=>{setTimeout(()=>{g=y()})})}return{get firstHiddenTime(){return g},onHidden(t){v.add(t)}}},b=t=>{document.prerendering?addEventListener("prerenderingchange",()=>t(),!0):t()},C=[1800,3e3],T=(t,e={})=>{b(()=>{const n=S();let r,i=h("FCP");const o=p("paint",t=>{for(const e of t)"first-contentful-paint"===e.name&&(o.disconnect(),e.startTime{i=h("FCP"),r=l(t,i,C,e.reportAllChanges),d(()=>{i.value=performance.now()-n.timeStamp,r(!0)})}))})},_=[.1,.25],L=t=>t.find(t=>1===t.node?.nodeType)||t[0];let x=0,M=1/0,D=0;const z=t=>{for(const e of t)e.interactionId&&(M=Math.min(M,e.interactionId),D=Math.max(D,e.interactionId),x=D?(D-M)/7+1:0)};let B;const A=()=>B?x:performance.interactionCount??0;let P=0;class N{l=[];h=new Map;m;p;v(){P=A(),this.l.length=0,this.h.clear()}M(){const t=Math.min(this.l.length-1,Math.floor((A()-P)/50));return this.l[t]}u(t){if(this.m?.(t),!t.interactionId&&"first-input"!==t.entryType)return;const e=this.l.at(-1);let n=this.h.get(t.interactionId);if(n||this.l.length<10||t.duration>e.T){if(n?t.duration>n.T?(n.entries=[t],n.T=t.duration):t.duration===n.T&&t.startTime===n.entries[0].startTime&&n.entries.push(t):(n={id:t.interactionId,entries:[t],T:t.duration},this.h.set(n.id,n),this.l.push(n)),this.l.sort((t,e)=>e.T-t.T),this.l.length>10){const t=this.l.splice(10);for(const e of t)this.h.delete(e.id)}this.p?.(n)}}}const I=t=>{const e=globalThis.requestIdleCallback||setTimeout;"hidden"===document.visibilityState?t():(t=m(t),addEventListener("visibilitychange",t,{once:!0,capture:!0}),e(()=>{t(),removeEventListener("visibilitychange",t,{capture:!0})}))},E=[200,500];class k{m;u(t){this.m?.(t)}}const q=[2500,4e3],U=[800,1800],R=t=>{document.prerendering?b(()=>R(t)):"complete"!==document.readyState?addEventListener("load",()=>R(t),!0):setTimeout(t)},j="",O="1",H="0",K="p",F="a",W="m",V="t",J="m",Z="a",X="p",Y="s",G=()=>"undefined"==typeof window;function $(t,...e){if(0===e.length)return t;const n=e[0];return t[n]||(t[n]={}),$(t[n],...e.slice(1))}function Q(t){try{return decodeURIComponent(t)}catch(t){return""}}function tt(){if(!G())return window}const et=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12}$/;function nt(t,e){if("string"!=typeof t)return;if(!function(t){return!!t&&et.test(t.trim().toLowerCase())}(t))return;const n=t.trim();if("00000000-0000-0000-0000-000000000000"===n)return;if("00000000-0000-0000-5000-000000000000"===n)return;return Number.isFinite(NaN)&&Date.now()>NaN?void 0:n}const rt="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx";function it(t){return rt.replace(/[xy]/g,e=>{const n=t();return("x"===e?n:3&n|8).toString(16)})}function ot(){const t="undefined"!=typeof crypto?crypto:void 0;if("function"==typeof(null==t?void 0:t.randomUUID))return t.randomUUID();if("function"==typeof(null==t?void 0:t.getRandomValues)){const e=t.getRandomValues(new Uint8Array(36));let n=0;return it(()=>e[n++]%16)}return it(()=>16*Math.random()|0)}function at(t){const e=function(){try{return document.cookie}catch{return!1}}()?document.cookie.split("; "):[];for(let n=0;nfunction(t=ct){var e,n;const r=null===(e=performance)||void 0===e||null===(n=e.getEntriesByType)||void 0===n?void 0:n.call(e,"navigation");if(!r)return;const i=r.map(e=>function(t,e=ct){var n,r;if(!t)return;return null===(n=t.serverTiming)||void 0===n||null===(r=n.find(t=>t.name==e))||void 0===r?void 0:r.description}(e,t)),o=i.find(t=>t);o&&t===ct&&function(t){if(!G()){try{t=decodeURIComponent(t)}catch{}try{sessionStorage.setItem(ut,t)}catch{}}}(o);return o}(t)),!e){if(t!==ct)return;let e;try{e=sessionStorage.getItem(ut)}catch{}return e||void 0}try{e=decodeURIComponent(e)}catch{}return e}function dt(){if(!G()){var t,e;const n=(null===(t=window.Shopify)||void 0===t||null===(e=t.customerPrivacy)||void 0===e?void 0:e.injectedConsent)||st().injectedConsent;return n?Q(n):void 0}}function ft(){var t;return null===(t=function(){var t;if(!G())return null===(t=window.Shopify)||void 0===t?void 0:t.customerPrivacy}())||void 0===t?void 0:t.consentStatus}function ht(){let t;if(t=G()?dt():function(){var t,e;const n=null===(t=window.Shopify)||void 0===t||null===(e=t.customerPrivacy)||void 0===e?void 0:e.cachedConsent;return n?Q(n):void 0}()||dt()||new URLSearchParams(window.location.search).get("_cs")||void 0||at("_shopify_cmp")||lt(),void 0!==t)return function(t){if("%"==t.slice(0,1))try{t=decodeURIComponent(t)}catch{}const e=t.slice(0,1);if("{"==e)return function(t){var e;let n;try{n=JSON.parse(t)}catch{return}if("2.1"!==n.v)return;if(null===(e=n.con)||void 0===e||!e.CMP)return;return n}(t);if("3"==e)return function(t){const{base:e}=function(t){const e=t.replace(/#+$/,""),n=e.lastIndexOf("#");if(n<0)return{base:e};const r=e.slice(0,n),i=e.slice(n+1);return i.includes("}")?{base:e}:{base:r,comment:i}}(t);t=e;const n=t.slice(1).split("_"),[r,i,o,a,s]=n;let c,u;try{c=n[5]?JSON.parse(n.slice(5).join("_")):void 0}catch{}if(s){const t=s.replace(/\*/g,"/").replace(/-/g,"+"),e=atob(t);let n="";for(let t=0;tt.slice(0,e)+"-"+t.slice(e),n)}function l(t){const e=r.split(".")[0];return e.includes(t.toLowerCase())?H:e.includes(t.toUpperCase())?O:j}function d(t){return r.includes(t.replace("t","s").toUpperCase())}return{v:"3",con:{CMP:{[Z]:l(Z),[X]:l(X),[J]:l(J),[Y]:l(Y)}},region:i||"",cus:c,purposes:{[F]:d(F),[K]:d(K),[W]:d(W),[V]:d(V)},sale_of_data_region:"t"==a,display_banner:"t"==o,consent_id:u}}(t);return}(t)}function pt(t){const e=function(){try{let t=ht();if(!t)return;return t}catch{return}}();if(!e||!e.purposes)return!0;const n=e.purposes[t];return"boolean"!=typeof n||n}function mt(){return pt(F)}function gt(){return pt(W)}function vt(t,e){const n=tt();if(!n)return;const r=$(n,"Shopify","customerPrivacy","cachedToken");if(e){const n="_shopify_s"===t?18e5:31536e6;r[t]=e,r[t+"_expires_at"]=Date.now()+n}else delete r[t],delete r[t+"_expires_at"]}let yt,wt=class t{constructor(){if(this.endpoint="https://otlp-http-production.shopifysvc.com/v1/metrics",this.serviceName="consent-tracking-api",this.scopeName="consent-tracking-api-opentelemetry",t.instance)return t.instance;t.instance=this}increment(t,e={},n=.01){if(!G()&&t)try{if(!Number.isFinite(n)||n<=0||n>1)return;if(!mt())return;if(Math.random()>=n)return;const r=this.buildMetricBody(t,e);if(window.location.host.endsWith("spin.dev"))return void console.log("OpenTelemetry metric from consent API:",r);if("function"!=typeof fetch)return;return fetch(this.endpoint,{headers:{accept:"*/*","content-type":"application/json; charset=utf-8"},body:JSON.stringify(r),method:"POST",mode:"cors",credentials:"omit"}).catch(()=>{})}catch(t){}}buildMetricBody(t,e){const n=1e6*Date.now();return{resourceMetrics:[{resource:{attributes:[{key:"service.name",value:{stringValue:this.serviceName}}]},scopeMetrics:[{scope:{name:this.scopeName,version:"1.1.1",attributes:[]},metrics:[{name:t,unit:"1",sum:{aggregationTemporality:1,isMonotonic:!0,dataPoints:[{asDouble:1,startTimeUnixNano:n,timeUnixNano:n,attributes:St(e)}]}}]}]}]}}};function St(t){return Object.keys(t).reduce((e,n)=>{const r=t[n];return null==r||e.push({key:n,value:bt(r)}),e},[])}function bt(t){return"string"==typeof t?{stringValue:t}:"boolean"==typeof t?{boolValue:t}:isFinite(t)?Math.floor(t)===t?{intValue:t}:{doubleValue:t}:{stringValue:String(t)}}function Ct(){var t;return null!==(t=yt)&&void 0!==t?t:yt=new wt}function Tt(){return pt(K)}function _t(){return pt(V)}wt.instance=void 0;function Lt(t){if(!G())try{var e,n;return null===(e=document.querySelector(`meta[name="${t}"]`))||void 0===e||null===(n=e.getAttribute("content"))||void 0===n?void 0:n.trim()}catch{return}}function xt(t){const e=Lt(t);if(e)try{const t=JSON.parse(e);return"string"==typeof t?t.trim():void 0}catch{return}}function Mt(t){return void 0!==t&&Date.now()>t}function Dt(t,e){const n=nt(xt(e));if(n&&!Mt(function(t){const e=xt(`${t}Expiration`);if(!e)return;const n=Number(e);return Number.isFinite(n)?n:void 0}(e)))return n;const r=nt(Lt(t));return r&&!Mt(function(t){if(!G())try{var e,n;const r=null===(e=document.querySelector(`meta[name="${t}"]`))||void 0===e||null===(n=e.getAttribute("data-expiration"))||void 0===n?void 0:n.trim();if(!r)return;const i=Number(r);return Number.isFinite(i)?i:void 0}catch{return}}(t))?r:void 0}function zt(t){return"_shopify_y"===t?Dt("shopify-y","serialized-shopifyY"):"_shopify_s"===t?Dt("shopify-s","serialized-shopifyS"):void 0}function Bt(t,e){try{Ct().increment("consent_tracking_api_tracking_token_read",{token:t,source:e})}catch{}}function At(t){try{var e,n,r,i;return null===(e=performance)||void 0===e||null===(n=e.getEntriesByType("navigation")[0])||void 0===n||null===(r=n.serverTiming)||void 0===r||null===(i=r.find(e=>e.name==t))||void 0===i?void 0:i.description}catch{return}}function Pt(){const t=document.querySelector('[data-serialized-id="app-base-path"]');if(!G()&&Boolean(null===(n=tt())||void 0===n?void 0:n.__CUSTOMER_ACCOUNT__)||t){var e;const n=document.querySelector('[data-serialized-id="preview-mode-data"]');if("/"!==JSON.parse((null==t?void 0:t.textContent)||"null")||!1!==(null===(e=JSON.parse((null==n?void 0:n.textContent)||"null"))||void 0===e?void 0:e.inPreviewMode))return;return new URL("/customer/api/unstable/graphql",window.location.origin).href}var n;const{protocol:r,host:i}=function(){const t=st().consentDomain||window.location.host;return{protocol:/^(localhost|127\.0\.0\.1)(:|$)/.test(t)?"http:":"https:",host:t}}();return`${r}//${i}/api/unstable/graphql.json`}async function Nt(t){try{var e;if(Math.random()>.01)return;let n=null;if(t)try{const e=await t.json();n=Array.isArray(null==e?void 0:e.errors)&&e.errors.length>0}catch{}Ct().increment("consent_tracking_api_persist",{ok:String(!(null==t||!t.ok)),status:String(null!==(e=null==t?void 0:t.status)&&void 0!==e?e:"none"),graphql_errors:String(n)},1)}catch{}}function It(t,e,n){if(!0===st().asyncConsent&&"loaded"!==ft())return;Ct().increment("consent_tracking_api_tracking_token_missing");const r=e?void 0:ot(),i=n?void 0:ot();return r&&vt("_shopify_y",r),i&&vt("_shopify_s",i),function(t,e){if(!G())try{const n=nt(t),r=nt(e);if(!n&&!r)return;const i=Pt();if(!i)return;const o=new URLSearchParams,a={"content-type":"application/json"};n&&(o.set("_y",n),a["X-Shopify-UniqueToken"]=n),r&&(o.set("_s",r),a["X-Shopify-VisitToken"]=r);const s=`${i}?${o.toString()}`;let c;try{c=fetch(s,{headers:a,body:JSON.stringify({query:"query { consentManagement { cookies(visitorConsent:{}) { cookieDomain } } }",variables:{}}),method:"POST",mode:"cors",credentials:"include"})}catch(t){c=Promise.reject(t)}c.then(t=>Nt(t),()=>Nt(void 0))}catch{}}(r,i),"_shopify_y"===t?r:i}function Et(t){if(!mt()&&!gt())return;const e=function(t){var e,n,r,i,o,a;const s=tt();if(!s)return;const c=null===(e=s.Shopify)||void 0===e||null===(n=e.customerPrivacy)||void 0===n||null===(r=n.cachedToken)||void 0===r?void 0:r[t],u=null===(i=s.Shopify)||void 0===i||null===(o=i.customerPrivacy)||void 0===o||null===(a=o.cachedToken)||void 0===a?void 0:a[t+"_expires_at"];return!c||!u||u<(new Date).getTime()?void 0:nt(c)}(t);if(e)return Bt(t,"window_cache"),e;if(function(){const t=tt();if(null==t||!t.ShopPay)return!1;try{const e=Object(t.ShopPay);return Reflect.has(e,"trackingUnique")||Reflect.has(e,"trackingVisit")}catch{return!1}}()){const e=function(t){const e=tt();if(!e||!e.ShopPay)return;const n={_shopify_y:"trackingUnique",_shopify_s:"trackingVisit"}[t];if(!n)return;return nt(e.ShopPay[n])}(t);return Bt(t,"shop_pay"),e}const n=zt(t);if(n)return Bt(t,"meta"),n;const r=function(t){const e=t.replace("_shopify",""),n=At(e),r=Number(At(`${e}e`));if(!r||Date.now()/1e3e.trim().startsWith(`${t}=`)))||void 0===r||null===(i=r.split("=")[1])||void 0===i?void 0:i.trim();return nt(o)}catch{return}}(t);if(i)return Bt(t,"cookie"),i;Bt(t,"missing")}function kt(){return Et("_shopify_y")}function qt(){return Et("_shopify_s")}function Ut(t){if(G())throw new Error("Token generateFallback is not supported in Node.js environments, just browsers.");const e=Et(t);if(e)return e;if((mt()||gt())&&!function(){const t=tt();return!(!t||!Reflect.has(t,"ShopPay"))}())try{return It(t,kt(),qt())}catch{return}}function Rt(){return mt()}function jt(t,e){if(!{}.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}var Ot=0;function Ht(t){return"__private_"+Ot+++"_"+t}function Kt(t){return Object.entries(t).map(([t,e])=>({key:t,value:{stringValue:String(e)}}))}function Ft(t){if(Array.isArray(t))return{arrayValue:{values:t.map(t=>Ft(t))}};switch(typeof t){case"boolean":return{boolValue:Boolean(t)};case"number":return{doubleValue:Number(t)};default:return{stringValue:String(t)}}}const Wt=function(t,e,n){const r=[0];for(let i=0;i{t.attributes={...jt(this,Jt)[Jt],...t.attributes}});const t=jt(this,Zt)[Zt];jt(this,Zt)[Zt]=[],await this.exportByKeepalive(t,(t,e)=>jt(this,Vt)[Vt].exportMetrics(this.aggregateMetrics(t),e))}async exportLogs(){const t=jt(this,Xt)[Xt];jt(this,Xt)[Xt]=[],await this.exportByKeepalive(t,(t,e)=>jt(this,Vt)[Vt].exportLogs(this.formatLogs(t),e))}aggregateMetrics(t){const e={};return t.forEach(t=>{switch(t.type){case"histogram":!function(t,e){var n;const{name:r,value:i,unit:o,timeUnixNano:a,attributes:s}=e,c=null!==(n=e.bounds)&&void 0!==n?n:Wt,u=new Array(c.length+1).fill(0);t[r]||={name:r,unit:o||"1",histogram:{aggregationTemporality:1,dataPoints:[]}};for(let t=0;t0?d:0,bucketCounts:r>0?[1]:[]};t[n].exponentialHistogram.dataPoints.push({attributes:Kt(null!=a?a:{}),startTimeUnixNano:o,timeUnixNano:o,count:1,sum:c,scale:u,zeroCount:f,positive:p,negative:h,min:c,max:c,zeroThreshold:0})}(e,t);break;case"counter":!function(t,e){const{name:n,value:r,unit:i,timeUnixNano:o,attributes:a}=e;t[n]||={name:n,unit:i||"1",sum:{aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}},t[n].sum.dataPoints.push({startTimeUnixNano:o,timeUnixNano:o,asDouble:r,attributes:Kt(null!=a?a:{})})}(e,t);break;case"gauge":!function(t,e){const{name:n,value:r,unit:i,timeUnixNano:o,attributes:a}=e;t[n]||={name:n,unit:i||"1",gauge:{dataPoints:[]}},t[n].gauge.dataPoints.push({startTimeUnixNano:o,timeUnixNano:o,asDouble:r,attributes:Kt(null!=a?a:{})})}(e,t)}}),Object.values(e)}async exportByKeepalive(t,e){if(0===t.length)return;const n=[],r=[];t.forEach(t=>{var e;null===(e=t.requiresKeepalive)||void 0===e||e?n.push(t):r.push(t)});const i=[n.length>0?e(n,{keepalive:!0}):void 0,r.length>0?e(r,{keepalive:!1}):void 0].filter(t=>void 0!==t);await Promise.all(i)}formatLogs(t){return t.map(t=>{const e={timeUnixNano:t.timeUnixNano,observedTimeUnixNano:t.timeUnixNano,attributes:(n={...jt(this,Jt)[Jt],...t.attributes},Object.entries(n).map(([t,e])=>({key:t,value:Ft(e)})))};var n;return t.body&&(e.body={stringValue:t.body}),e})}}var Gt=Ht("url"),$t=Ht("serviceName"),Qt=Ht("logger"),te=Ht("fetchFn"),ee=Ht("maxPayloadSizeBytes");class ne{constructor(t,e,n){var r;Object.defineProperty(this,Gt,{writable:!0,value:void 0}),Object.defineProperty(this,$t,{writable:!0,value:void 0}),Object.defineProperty(this,Qt,{writable:!0,value:void 0}),Object.defineProperty(this,te,{writable:!0,value:void 0}),Object.defineProperty(this,ee,{writable:!0,value:void 0}),jt(this,Gt)[Gt]=t.replace(/\/v1\/(logs|metrics|traces)\/?$/,""),jt(this,$t)[$t]=e,jt(this,Qt)[Qt]=null==n?void 0:n.logger,jt(this,te)[te]=null==n?void 0:n.fetchFn,jt(this,ee)[ee]=null!==(r=null==n?void 0:n.maxPayloadSizeBytes)&&void 0!==r?r:51200}async exportMetrics(t,e){var n;const r=null===(n=null==e?void 0:e.keepalive)||void 0===n||n;await this.exportBatches("/v1/metrics",[...t],t=>({resourceMetrics:[{resource:{attributes:[{key:"service.name",value:{stringValue:jt(this,$t)[$t]}}]},scopeMetrics:[{scope:{name:"open-telemetry-mini-client",version:"1.1.0",attributes:[]},metrics:t}]}]}),r)}async exportLogs(t,e){var n;const r=null===(n=null==e?void 0:e.keepalive)||void 0===n||n;await this.exportBatches("/v1/logs",[...t],t=>({resourceLogs:[{resource:{attributes:[{key:"service.name",value:{stringValue:jt(this,$t)[$t]}}]},scopeLogs:[{scope:{name:"open-telemetry-mini-client",version:"1.1.0",attributes:[]},logRecords:t}]}]}),r)}async exportTo(t,e,n){var r;const i=JSON.stringify(t),o=(new TextEncoder).encode(i).length;if(o>jt(this,ee)[ee])throw new ie(`Payload size ${o} exceeds ${jt(this,ee)[ee]} bytes`);const a=await this.exporterFetch()(`${jt(this,Gt)[Gt]}${e}`,{method:"POST",keepalive:n,headers:{"Content-Type":"application/json"},body:i});if(null===(r=jt(this,Qt)[Qt])||void 0===r||r.log({status:a.status}),!a.ok){if(400===a.status){const t=await a.text();throw new re(`Invalid OpenTelemetry Data: ${t}`)}if(429===a.status||503===a.status){const e=await a.text(),n=a.headers.get("Retry-After"),r=n?{seconds:Number(n)}:void 0;throw new re("Server did not accept data",{errorData:e,retryAfter:r,body:t})}if(401===a.status||403===a.status){const e=await a.text();throw new oe(`Authentication failed: ${a.status} ${401===a.status?"Unauthorized":"Forbidden"}`,{errorData:e,body:t})}throw new re(`Server responded with ${a.status}`)}}exporterFetch(){return jt(this,te)[te]||fetch}async exportBatches(t,e,n,r){let i=e.length;for(;e.length>0;)try{const o=e.slice(0,i);await this.exportTo(n(o),t,r),e.splice(0,i)}catch(t){if(!(t instanceof ie&&i>1))throw t;i=Math.ceil(i/2)}}}class re extends Error{constructor(t,e){super(t),this.metadata=void 0,this.name="OpenTelemetryClientError",this.metadata=e}}class ie extends Error{constructor(...t){super(...t),this.name="PayloadTooLargeError"}}class oe extends Error{constructor(t,e){super(t),this.name="AuthenticationFailedError",this.metadata=void 0,this.name="AuthenticationFailedError",this.metadata=e}}const ae="",se="1",ce="0",ue="p",le="a",de="m",fe="t",he="m",pe="a",me="p",ge="s",ve=()=>"undefined"==typeof window;function ye(t){try{return decodeURIComponent(t)}catch(t){return""}}function we(){if(!ve())return window}const Se=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12}$/;function be(t,e){if("string"!=typeof t)return;if(!function(t){return!!t&&Se.test(t.trim().toLowerCase())}(t))return;const n=t.trim();if("00000000-0000-0000-0000-000000000000"===n)return;if("00000000-0000-0000-5000-000000000000"===n)return;return Number.isFinite(NaN)&&Date.now()>NaN?void 0:n}function Ce(t){const e=function(){try{return document.cookie}catch{return!1}}()?document.cookie.split("; "):[];for(let n=0;nfunction(t=Te){var e,n;const r=null===(e=performance)||void 0===e||null===(n=e.getEntriesByType)||void 0===n?void 0:n.call(e,"navigation");if(!r)return;const i=r.map(e=>function(t,e=Te){var n,r;if(!t)return;return null===(n=t.serverTiming)||void 0===n||null===(r=n.find(t=>t.name==e))||void 0===r?void 0:r.description}(e,t)),o=i.find(t=>t);o&&t===Te&&function(t){if(!ve()){try{t=decodeURIComponent(t)}catch{}try{sessionStorage.setItem(_e,t)}catch{}}}(o);return o}(t)),!e){if(t!==Te)return;let e;try{e=sessionStorage.getItem(_e)}catch{}return e||void 0}try{e=decodeURIComponent(e)}catch{}return e}function xe(){var t,e;if(!ve()){var n,r;const i=(null===(n=window.Shopify)||void 0===n||null===(r=n.customerPrivacy)||void 0===r?void 0:r.injectedConsent)||(ve()?{}:(null===(t=window.Shopify)||void 0===t||null===(e=t.customerPrivacy)||void 0===e?void 0:e.config)||{}).injectedConsent;return i?ye(i):void 0}}function Me(){let t;if(t=ve()?xe():function(){var t,e;const n=null===(t=window.Shopify)||void 0===t||null===(e=t.customerPrivacy)||void 0===e?void 0:e.cachedConsent;return n?ye(n):void 0}()||xe()||new URLSearchParams(window.location.search).get("_cs")||void 0||Ce("_shopify_cmp")||Le(),void 0!==t)return function(t){if("%"==t.slice(0,1))try{t=decodeURIComponent(t)}catch{}const e=t.slice(0,1);if("{"==e)return function(t){var e;let n;try{n=JSON.parse(t)}catch{return}if("2.1"!==n.v)return;if(null===(e=n.con)||void 0===e||!e.CMP)return;return n}(t);if("3"==e)return function(t){const{base:e}=function(t){const e=t.replace(/#+$/,""),n=e.lastIndexOf("#");if(n<0)return{base:e};const r=e.slice(0,n),i=e.slice(n+1);return i.includes("}")?{base:e}:{base:r,comment:i}}(t);t=e;const n=t.slice(1).split("_"),[r,i,o,a,s]=n;let c,u;try{c=n[5]?JSON.parse(n.slice(5).join("_")):void 0}catch{}if(s){const t=s.replace(/\*/g,"/").replace(/-/g,"+"),e=atob(t);let n="";for(let t=0;tt.slice(0,e)+"-"+t.slice(e),n)}function l(t){const e=r.split(".")[0];return e.includes(t.toLowerCase())?ce:e.includes(t.toUpperCase())?se:ae}function d(t){return r.includes(t.replace("t","s").toUpperCase())}return{v:"3",con:{CMP:{[pe]:l(pe),[me]:l(me),[he]:l(he),[ge]:l(ge)}},region:i||"",cus:c,purposes:{[le]:d(le),[ue]:d(ue),[de]:d(de),[fe]:d(fe)},sale_of_data_region:"t"==a,display_banner:"t"==o,consent_id:u}}(t);return}(t)}function De(t){const e=function(){try{let t=Me();if(!t)return;return t}catch{return}}();if(!e||!e.purposes)return!0;const n=e.purposes[t];return"boolean"!=typeof n||n}function ze(){return De(le)}class Be{constructor(){if(this.endpoint="https://otlp-http-production.shopifysvc.com/v1/metrics",this.serviceName="consent-tracking-api",this.scopeName="consent-tracking-api-opentelemetry",Be.instance)return Be.instance;Be.instance=this}increment(t,e={},n=.01){if(!ve()&&t)try{if(!Number.isFinite(n)||n<=0||n>1)return;if(!ze())return;if(Math.random()>=n)return;const r=this.buildMetricBody(t,e);if(window.location.host.endsWith("spin.dev"))return void console.log("OpenTelemetry metric from consent API:",r);if("function"!=typeof fetch)return;return fetch(this.endpoint,{headers:{accept:"*/*","content-type":"application/json; charset=utf-8"},body:JSON.stringify(r),method:"POST",mode:"cors",credentials:"omit"}).catch(()=>{})}catch(t){}}buildMetricBody(t,e){const n=1e6*Date.now();return{resourceMetrics:[{resource:{attributes:[{key:"service.name",value:{stringValue:this.serviceName}}]},scopeMetrics:[{scope:{name:this.scopeName,version:"1.1.1",attributes:[]},metrics:[{name:t,unit:"1",sum:{aggregationTemporality:1,isMonotonic:!0,dataPoints:[{asDouble:1,startTimeUnixNano:n,timeUnixNano:n,attributes:Ae(e)}]}}]}]}]}}}function Ae(t){return Object.keys(t).reduce((e,n)=>{const r=t[n];return null==r||e.push({key:n,value:Pe(r)}),e},[])}function Pe(t){return"string"==typeof t?{stringValue:t}:"boolean"==typeof t?{boolValue:t}:isFinite(t)?Math.floor(t)===t?{intValue:t}:{doubleValue:t}:{stringValue:String(t)}}let Ne;Be.instance=void 0;function Ie(t){if(!ve())try{var e,n;return null===(e=document.querySelector(`meta[name="${t}"]`))||void 0===e||null===(n=e.getAttribute("content"))||void 0===n?void 0:n.trim()}catch{return}}function Ee(t){const e=Ie(t);if(e)try{const t=JSON.parse(e);return"string"==typeof t?t.trim():void 0}catch{return}}function ke(t){return void 0!==t&&Date.now()>t}function qe(t,e){const n=be(Ee(e));if(n&&!ke(function(t){const e=Ee(`${t}Expiration`);if(!e)return;const n=Number(e);return Number.isFinite(n)?n:void 0}(e)))return n;const r=be(Ie(t));return r&&!ke(function(t){if(!ve())try{var e,n;const r=null===(e=document.querySelector(`meta[name="${t}"]`))||void 0===e||null===(n=e.getAttribute("data-expiration"))||void 0===n?void 0:n.trim();if(!r)return;const i=Number(r);return Number.isFinite(i)?i:void 0}catch{return}}(t))?r:void 0}function Ue(t){return"_shopify_y"===t?qe("shopify-y","serialized-shopifyY"):"_shopify_s"===t?qe("shopify-s","serialized-shopifyS"):void 0}function Re(t,e){try{(null!==(n=Ne)&&void 0!==n?n:Ne=new Be).increment("consent_tracking_api_tracking_token_read",{token:t,source:e})}catch{}var n}function je(t){try{var e,n,r,i;return null===(e=performance)||void 0===e||null===(n=e.getEntriesByType("navigation")[0])||void 0===n||null===(r=n.serverTiming)||void 0===r||null===(i=r.find(e=>e.name==t))||void 0===i?void 0:i.description}catch{return}}function Oe(t){if(!ze()&&!De(de))return;const e=function(t){var e,n,r,i,o,a;const s=we();if(!s)return;const c=null===(e=s.Shopify)||void 0===e||null===(n=e.customerPrivacy)||void 0===n||null===(r=n.cachedToken)||void 0===r?void 0:r[t],u=null===(i=s.Shopify)||void 0===i||null===(o=i.customerPrivacy)||void 0===o||null===(a=o.cachedToken)||void 0===a?void 0:a[t+"_expires_at"];return!c||!u||u<(new Date).getTime()?void 0:be(c)}(t);if(e)return Re(t,"window_cache"),e;if(function(){const t=we();if(null==t||!t.ShopPay)return!1;try{const e=Object(t.ShopPay);return Reflect.has(e,"trackingUnique")||Reflect.has(e,"trackingVisit")}catch{return!1}}()){const e=function(t){const e=we();if(!e||!e.ShopPay)return;const n={_shopify_y:"trackingUnique",_shopify_s:"trackingVisit"}[t];if(!n)return;return be(e.ShopPay[n])}(t);return Re(t,"shop_pay"),e}const n=Ue(t);if(n)return Re(t,"meta"),n;const r=function(t){const e=t.replace("_shopify",""),n=je(e),r=Number(je(`${e}e`));if(!r||Date.now()/1e3e.trim().startsWith(`${t}=`)))||void 0===r||null===(i=r.split("=")[1])||void 0===i?void 0:i.trim();return be(o)}catch{return}}(t);if(i)return Re(t,"cookie"),i;Re(t,"missing")}var He="2.8.0";function Ke(t,e){var n=Fe();return Ke=function(e,r){var i=n[e-=364];if(void 0===Ke.VpMlog){Ke.GVJvbv=function(t){for(var e,n,r="",i="",o=0,a=0;n=t.charAt(a++);~n&&(e=o%4?64*e+n:n,o++%4)?r+=String.fromCharCode(255&e>>(-2*o&6)):0)n="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=".indexOf(n);for(var s=0,c=r.length;s>(-2*i&6)):0)r="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=".indexOf(r);for(let t=0,r=e.length;t0&&n++,(t[Ve(185)][Ve(184)]&&t[Ve(185)][Ve(184)][Ve(171)]>0||typeof e===Ve(174)&&e[Ve(187)](Ve(157)))&&n++,function(t){const e=t[Ve(168)][Ve(172)]||t[Ve(189)][Ve(154)][Ve(188)],n=t[Ve(168)][Ve(165)]||t[Ve(189)][Ve(154)][Ve(167)];if(!e||!n||e<=2||n<=2)return!1;const r=e/n;return r>=.2&&r<=5}(t)&&n++,typeof t[Ve(168)][Ve(191)]!==Ve(186)&&n++;try{const t=(new Date)[Ve(149)]();t>-840&&t<840&&n++}catch{return n>=3?1:0}return n>=3?1:0}catch{return 0}}function Ze(){const t=["mZz3wvjrtM0","mtu0nJa0mhn6tKjbEG","ntaYmJyWsNrbALHS","y2fUDMfZ","y3jLyxrLtgLUzwfYr3jHzgLLBNq","zMLSBfjLy3q","nNPVEfLACa","CgX1z2LUCW","BMf2AwDHDg9Y","Dw5KzwzPBMvK","Aw5JBhvKzxm","y2XPzw50v2LKDgG","zg9JDw1LBNq","CMvK","zgv2AwnLugL4zwXsyxrPBW","Dg9eyxrHvvjm","zM9UDa","mZK1otK2sfLZrhrs","mZiXnZC2ngDIwMzLBq","yMX1zq","z2v0vgLTzxPVBMvpzMzZzxq","u2HVCgLMEsbtDg9YzwzYB250","mteWmJqXEwnOzgzu","DgvZDa","i2zMzG","zg9JDw1LBNrfBgvTzw50","ywrKq29SB3jtDg9W","AgvPz2H0","tw9IAwXL","D2vIzhjPDMvY","DxnLCKfNzw50","nen2u2vMyW","BgfUz3vHz2vZ","y3jLyxrLrwXLBwvUDa","D2LKDgG","z2v0q29UDgv4Da","Aw5UzxjizwLNAhq","mJmYndKXz1neuKvV","y2XPzw50sgvPz2H0","D2LUzg93","zMLSBfn0EwXL","zMLSBfrLEhq","BgvUz3rO","Aw5UzxjxAwr0Aa","mtzWEcbbCMLHBa","C3rYAw5N","mtyZoffrqKXYyG","nJy2nhLxr3rbsG"];return(Ze=function(){return t})()}function Xe(t){const e=function(t){try{return t[Ve(185)][Ve(158)]?1:0}catch{return 0}}(t),[n,r]=function(t){try{const e=t[Ve(185)][Ve(159)];try{return[e,String(e)]}catch{return[e,void 0]}}catch{return[void 0,void 0]}}(t),i=function(t){return void 0!==t&&/bot|crawler|spider|scraper/i[Ve(152)](t)?0:1}(r),o=function(t){try{const e=t[Ve(189)][Ve(162)](Ve(180));e[Ve(163)]=200,e[Ve(156)]=50;const n=e[Ve(164)]("2d");if(null===n)return 0;const r=n[Ve(181)](0,0,200,0);r[Ve(155)](0,Ve(190)),r[Ve(155)](1,Ve(148)),n[Ve(169)]=r,n[Ve(182)](0,0,200,50),n[Ve(169)]=Ve(153),n[Ve(145)]=Ve(173),n[Ve(170)](Ve(150),33,30);const i=e[Ve(144)]();return i&&i[Ve(171)]>50?1:0}catch{return 0}}(t);return{wd:e,ua:i,cv:o,br:Je(t,n)}}function Ye(t,e){var n=Ge();return Ye=function(e,r){var i=n[e-=143];if(void 0===Ye.dqVxHH){Ye.adzmlr=function(t){for(var e,n,r="",i="",o=0,a=0;n=t.charAt(a++);~n&&(e=o%4?64*e+n:n,o++%4)?r+=String.fromCharCode(255&e>>(-2*o&6)):0)n="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=".indexOf(n);for(var s=0,c=r.length;s>(-2*i&6)):0)r="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=".indexOf(r);for(let t=0,r=e.length;t=this[$e(450)]))try{await this[$e(449)][$e(446)]()}catch(t){this[$e(440)]&&console[$e(441)]($e(448)+t)}}[$e(428)](){this[$e(442)]&&clearTimeout(this[$e(442)]),this[$e(442)]=window[$e(431)](()=>{this[$e(429)]()[$e(447)](()=>{})},this[$e(426)])}}function tn(){const t=["Bg9N","zxjYB3jgBhvZAfrPBwvVDxrjza","Bg9NrxjYB3i","mZmXndC5Bg9fzevx","ndeWt1LSAMP3","zxHWB3j0tg9NCW","y2f0y2G","w1niu10Gt3rLBcbLEhbVCNqGBg9NCYbMywLSDxjLoIa","B3rLBenSAwvUDa","C2fTCgXLuMf0zq","mZeXnJq5mKjJve1kzG","ndm5nwf2vgnevW","C2fTCgXLs2v5","mti4nJe1rM5cy3Dd","zxjYB3jgBhvZAerLBgf5","ndG0mZG0mgz3uLLbta","C2nOzwr1BgvfCNjVCKzSDxnO","zMX1C2HpDgvStg9NCW","zxjYB3i","C2v0vgLTzw91Da","C3rHy2S","otK4DKPrAMnq","w1niuYbfCNjVCL0G","nMnduMvxua","ndu4mJy1nu5nEK1jta","mJKWnte3mgLrsNjVwG","BwvZC2fNzq","w0vYCM9Yxsa","C3rKB3v0"];return(tn=function(){return t})()}function en(){const t=["BgvUz3rO","owP0sLjbtG","mZi2uKDoBfLn","mty2otiYnwDUz2XTDW","ndKWmZq1nNf2tezSzW","nJq5mdrVuwDJqvq","ntq0mtG5meT5rLfywq","ywjZ","ndK2u1zKwMPO","ndC1nZGZrMjlugTv","ouHOvMjova","y2HHCKnVzgvbDa","nJK0otuWq2DbsuPq"];return(en=function(){return t})()}function nn(t,e){const n=en();return nn=function(e,r){let i=n[e-=172];if(void 0===nn.viRqHn){nn.QwhfGs=function(t){let e="",n="";for(let n,r,i=0,o=0;r=t.charAt(o++);~r&&(n=i%4?64*n+r:r,i++%4)?e+=String.fromCharCode(255&n>>(-2*i&6)):0)r="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=".indexOf(r);for(let t=0,r=e.length;t>(-2*i&6)):0)r="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=".indexOf(r);for(let t=0,r=e.length;tt+e.s,0)/t[rn(566)],n=t[rn(420)]((t,n)=>t+(n.s-e)**2,0)/(t[rn(566)]-1),r=Math[rn(436)](n);return{speed:e,jitter:r}}function pn(t,e,n,r,i,o,a,s,c,u,l,d,f){const h=Math[rn(577)](1e3,t),p=Math[rn(577)](1e3,n),m=Math[rn(577)](1e3,o),g=Math[rn(577)](1e3,s),v=Math[rn(577)](1e3,a),y=Math[rn(577)](1e3,c),w=[];if(e[rn(566)]>=3)for(let t=1;t5e-4){e=!0;break}n=r.s}else n=r.s;return e}(w),b=function(t){if(t[rn(566)]<3)return 0;let e=0,n=0;for(let r=1;r2*Math.PI-Math.PI/12)&&e++,n++}return n>0?e/n:0}(e),{speed:C,jitter:T}=hn(w);let _=0,L=0;if(r[rn(566)]>1){const t=new Set(r[rn(449)](t=>Math[rn(493)](t.x/20)+","+Math[rn(493)](t.y/20)))[rn(522)];_=t>1?1:0,L=r[rn(420)]((t,e)=>t+e[rn(538)],0)/r[rn(566)]}const x=i[rn(420)]((t,e)=>(null===e[rn(585)]||t[rn(588)](e[rn(585)]),t),[]),{rhythmConsistency:M,jitter:D}=function(t){if(t[rn(566)]<2)return{rhythmConsistency:0,jitter:0};const e=t[rn(420)]((t,e)=>t+e,0)/t[rn(566)],n=t[rn(420)]((t,n)=>(t??0)+((n??0)-e)**2,0)/t[rn(566)],r=Math[rn(436)](n);return{rhythmConsistency:0===r?1:Math[rn(528)](0,1-r/e),jitter:r/e}}(x),z=x[rn(566)]>0?x[rn(420)]((t,e)=>t+e,0)/x[rn(566)]:0,B=[];if(u[rn(566)]>=3)for(let t=1;tu[t-1].p?rn(417):"up";B[rn(588)]({s:r,dir:i,t:u[t].t})}const{speed:A,jitter:P}=hn(B),N=function(t){if(t[rn(566)]<2)return 0;let e=0;for(let n=1;n=500&&t[r].t-n>=500&&(e++,n=t[r].t);return e}(B)),{speed:E,jitter:k}=hn(l),q=function(t){if(t[rn(566)]<2)return 0;let e=0;for(let n=1;n=500&&e++;return e}(l)),R=Math[rn(493)]((f-d)/1e3);return{ma:h,ca:p,ka:m,sa:g,ta:y,kba:v,t:Math[rn(577)](3600,R),nm:S?1:0,ms:gn(b),mj:gn(T),msp:gn(C),vc:_,cp:gn(L),rc:gn(M),kj:gn(D),ki:gn(z),ss:gn(A),sj:gn(P),ssm:gn(N),sp:I,ts:gn(E),tj:gn(k),tp:U,tsm:gn(q)}}function mn(t,e){let n=0;return(...r)=>{const i=typeof performance!==rn(488)?performance[rn(595)]():Date[rn(595)]();i-n>=e&&(n=i,t(...r))}}function gn(t){return Math[rn(480)](100*t)/100}function vn(t,e,n,r){const i={webdriver_detected:1===t?.wd||!1,bot_user_agent:0===t?.ua||!1,browser_environment_normal:1===t?.br||!1,canvas_fingerprint_normal:1===t?.cv||!1,natural_mouse_activity:!1,natural_click_patterns:!1,keyboard_activity:!1,scroll_activity:!1,touch_activity:!1,significant_page_time:!1,multiple_pages_visited:!1,session_duration_reasonable:!1};if(e.ma>0&&1===e.nm&&(i[rn(598)]=!0),e.ca>0&&1===e.vc&&(i[rn(532)]=!0),e.ka>0&&(i[rn(426)]=!0),e.sa>0&&(i[rn(519)]=!0),e.ta>0&&(i[rn(526)]=!0),e.t>30&&(i[rn(599)]=!0),n&&(n[rn(429)]>1&&(i[rn(527)]=!0),n[rn(435)]>60&&(i[rn(555)]=!0)),r){const t=Object[rn(618)](i);for(const e of t)i[e]=i[e]||r[e]}return i}function yn(t){return{wd:t[rn(470)],ua:t[rn(592)],cf:t[rn(495)],be:t[rn(553)],nm:t[rn(598)],nc:t[rn(532)],ka:t[rn(426)],sa:t[rn(519)],ta:t[rn(526)],pt:t[rn(599)],mp:t[rn(527)],sd:t[rn(555)]}}class wn{[rn(606)]=0;[rn(404)];[rn(617)];[rn(388)];[rn(586)];[rn(443)];constructor(t,e,n=fn()){const r={shopId:0,updateInterval:5e3,debug:!1,beaconEndpoint:dn(n),beaconRetryLimit:3,maxSilenceMs:18e5,exportWithFetch:!1,beaconTextPlain:!1,logsSampleRate:1,candidateSignalsEnabled:!1,candidateActivePageFlushEnabled:!0,candidateUpdateInterval:5e3,candidateSampleRate:100};this[rn(404)]={...r,...e},this[rn(388)]=n,this[rn(586)]=t,this[rn(617)]={...this[rn(561)](),lastUpdateTime:null,environmentChecked:!1,sessionData:null};const i=this[rn(407)]();this[rn(617)][rn(564)]={lastSignals:i,lastProcessTime:0,lastSuccessfulSendTime:0,retryCount:0},this[rn(443)]=(this[rn(404)][rn(384)],this[rn(404)][rn(425)],this[rn(388)][rn(544)],this[rn(388)][rn(546)],this[rn(404)][rn(530)],this[rn(404)][rn(414)],this[rn(404)][rn(400)],this[rn(404)][rn(400)],null)}[rn(515)](){this[rn(481)]||(async()=>{const t=this[rn(484)]();if(this[rn(397)](t),await Promise[rn(567)](),await this[rn(381)](0===this[rn(606)],!0),this[rn(481)])return;this[rn(404)][rn(619)]&&this[rn(443)]?.[rn(392)](),this[rn(617)][rn(389)]=this[rn(388)][rn(546)][rn(465)](()=>{this[rn(481)]||this[rn(568)]()},100);const e=()=>{if(this[rn(481)])return;const t=Date[rn(595)](),n=t-(this[rn(617)][rn(419)]||t),r=Math[rn(528)](0,this[rn(404)][rn(486)]-n),i=()=>{this[rn(481)]||(this[rn(388)][rn(546)][rn(466)]?this[rn(617)][rn(478)]=this[rn(388)][rn(546)][rn(466)](()=>{this[rn(481)]||this[rn(381)]()[rn(539)](()=>this[rn(586)][rn(580)]())[rn(539)](()=>{e()})},{timeout:2e3}):this[rn(381)]()[rn(539)](()=>this[rn(586)][rn(580)]())[rn(539)](()=>{e()}))};r>0?this[rn(617)][rn(611)]=this[rn(388)][rn(546)][rn(465)](i,r):i()};e()})()[rn(408)](t=>{this[rn(586)][rn(472)](t,rn(515))})}get[rn(481)](){return void 0===this[rn(617)][rn(564)]}[rn(542)](){const t=this[rn(617)][rn(564)];if(t){this[rn(617)][rn(564)]=void 0;try{this[rn(443)]?.[rn(542)]()}catch(t){this[rn(586)][rn(472)](t,rn(574))}void 0!==this[rn(617)][rn(389)]&&this[rn(388)][rn(546)][rn(533)](this[rn(617)][rn(389)]),void 0!==this[rn(617)][rn(611)]&&this[rn(388)][rn(546)][rn(533)](this[rn(617)][rn(611)]),void 0!==this[rn(617)][rn(478)]&&this[rn(388)][rn(546)][rn(520)]&&this[rn(388)][rn(546)][rn(520)](this[rn(617)][rn(478)]),this[rn(617)][rn(501)]&&(this[rn(388)][rn(544)][rn(579)](rn(506),this[rn(617)][rn(501)][rn(506)]),this[rn(388)][rn(544)][rn(579)](rn(512),this[rn(617)][rn(501)][rn(512)]),this[rn(388)][rn(544)][rn(579)](rn(413),this[rn(617)][rn(501)][rn(413)]),this[rn(388)][rn(544)][rn(579)](rn(437),this[rn(617)][rn(501)][rn(437)]),rn(523)in window&&this[rn(617)][rn(501)][rn(521)]&&this[rn(617)][rn(501)][rn(589)]&&this[rn(617)][rn(501)][rn(467)]&&(this[rn(388)][rn(544)][rn(579)](rn(521),this[rn(617)][rn(501)][rn(521)]),this[rn(388)][rn(544)][rn(579)](rn(589),this[rn(617)][rn(501)][rn(589)]),this[rn(388)][rn(544)][rn(579)](rn(467),this[rn(617)][rn(501)][rn(467)]))),void 0!==t[rn(479)]&&this[rn(388)][rn(546)][rn(533)](t[rn(479)])}}[rn(569)](){return this[rn(617)][rn(564)]?.[rn(549)]?yn(this[rn(617)][rn(564)][rn(549)]):null}[rn(590)](){if(this[rn(481)]||!this[rn(617)][rn(453)])return null;const{signals:t}=this[rn(500)](this[rn(617)],Date[rn(595)]());return We(0,yn(t),rn(590),this[rn(374)]())}[rn(471)](){if(this[rn(481)])return;const t=this[rn(381)]();this[rn(430)](),t[rn(539)](()=>this[rn(586)][rn(580)]())[rn(408)](t=>this[rn(586)][rn(472)](t,rn(471)))}[rn(487)](){return this[rn(443)]?.[rn(569)]()??null}[rn(380)](){return this[rn(443)]?.[rn(509)]()??null}[rn(484)](){const t={v1:Xe(this[rn(388)])};return this[rn(617)][rn(552)]=t.v1,this[rn(617)][rn(453)]=!0,t[rn(524)]}[rn(517)](t,e){return n=>{try{t(n)}catch(t){this[rn(586)][rn(472)](t,rn(454)+e)}}}[rn(568)](){const t=mn(this[rn(517)](t=>{this[rn(617)][rn(485)]++,this[rn(617)][rn(379)][rn(566)]>=10&&this[rn(617)][rn(379)][rn(477)](),this[rn(617)][rn(379)][rn(588)]({x:t[rn(513)],y:t[rn(418)],t:t[rn(422)]})},rn(506)),100),e=this[rn(517)](t=>{this[rn(617)][rn(529)]++,requestAnimationFrame(()=>setTimeout(()=>{this[rn(617)][rn(573)][rn(566)]>=5&&this[rn(617)][rn(573)][rn(477)](),this[rn(617)][rn(573)][rn(588)]({x:t[rn(513)],y:t[rn(418)],t:t[rn(422)],pre:this[rn(416)](t)})},0))},rn(512)),n=this[rn(517)](t=>{this[rn(617)][rn(431)]++;const e=t[rn(558)];if([rn(535),rn(394),rn(560),rn(483)][rn(455)](e))return;const n=this[rn(617)][rn(498)][this[rn(617)][rn(498)][rn(566)]-1],r=t[rn(422)],i=n?r-n.t:null;this[rn(617)][rn(498)][rn(566)]>=10&&this[rn(617)][rn(498)][rn(477)](),this[rn(617)][rn(498)][rn(588)]({_0x492f10:e,t:r,int:i}),null!==i&&i<100?(this[rn(617)][rn(375)][rn(588)](i),this[rn(617)][rn(375)][rn(566)]>=5&&(this[rn(617)][rn(442)]++,this[rn(617)][rn(375)]=[])):this[rn(617)][rn(375)]=[]},rn(413)),r=mn(this[rn(517)](t=>{this[rn(617)][rn(508)]++;const e=t[rn(422)],n=window[rn(460)];this[rn(617)][rn(605)][rn(566)]>=10&&this[rn(617)][rn(605)][rn(477)](),this[rn(617)][rn(605)][rn(588)]({p:n,t:e})},rn(437)),200),i=this[rn(517)](t=>{t[rn(402)]&&0!==t[rn(402)][rn(566)]&&(this[rn(617)][rn(563)]++,this[rn(617)][rn(491)][rn(566)]>=10&&this[rn(617)][rn(491)][rn(477)](),this[rn(617)][rn(518)]={x:t[rn(402)][0][rn(513)],y:t[rn(402)][0][rn(418)],t:t[rn(422)],typ:rn(391),s:0,d:0})},rn(521)),o=mn(this[rn(517)](t=>{if(!t[rn(402)]||0===t[rn(402)][rn(566)])return;const e={x:t[rn(402)][0][rn(513)],y:t[rn(402)][0][rn(418)]};if(this[rn(617)][rn(518)]){const n=this[rn(461)](this[rn(617)][rn(518)],e);this[rn(617)][rn(491)][rn(566)]>=10&&this[rn(617)][rn(491)][rn(477)]();const r={x:t[rn(402)][0][rn(513)],y:t[rn(402)][0][rn(418)],t:t[rn(422)],typ:rn(447),d:n,s:n/(t[rn(422)]-this[rn(617)][rn(518)].t)};this[rn(617)][rn(491)][rn(588)](r),this[rn(617)][rn(518)]=r}else{const e={x:t[rn(402)][0][rn(513)],y:t[rn(402)][0][rn(418)],t:t[rn(422)],typ:rn(447),s:0,d:0};this[rn(617)][rn(518)]=e}},rn(589)),200),a=this[rn(517)](t=>{this[rn(617)][rn(518)]=null},rn(467));this[rn(388)][rn(544)][rn(446)](rn(506),t,{passive:!0}),this[rn(388)][rn(544)][rn(446)](rn(512),e,{passive:!0}),this[rn(388)][rn(544)][rn(446)](rn(413),n,{passive:!0}),this[rn(388)][rn(544)][rn(446)](rn(437),r,{passive:!0}),rn(523)in window&&(this[rn(388)][rn(544)][rn(446)](rn(521),i,{passive:!0}),this[rn(388)][rn(544)][rn(446)](rn(589),o,{passive:!0}),this[rn(388)][rn(544)][rn(446)](rn(467),a,{passive:!0})),this[rn(617)][rn(501)]={mousemove:t,click:e,keydown:n,scroll:r,touchstart:i,touchmove:o,touchend:a}}async[rn(381)](t=!1,e=t){if(this[rn(481)])return;const n=this[rn(606)],r={...this[rn(617)]},i=Date[rn(595)]();this[rn(617)][rn(433)]=this[rn(571)](Date[rn(595)](),t),await this[rn(468)]({includeCandidateSignals:!e},r,i),this[rn(606)]===n&&(this[rn(617)][rn(419)]=Date[rn(595)]())}[rn(571)](t,e=!1){const n=this[rn(617)][rn(433)];if(!n)return{pageCount:1,sessionStart:this[rn(617)][rn(614)],duration:0};const r=this[rn(617)][rn(419)]??this[rn(617)][rn(614)];return{...n,pageCount:n[rn(429)]+(e?1:0),duration:n[rn(435)]+Math[rn(493)]((t-r)/1e3)}}[rn(430)](){this[rn(606)]++;const t=this[rn(561)]();Object[rn(594)](this[rn(617)],t),this[rn(617)][rn(433)]={pageCount:1,sessionStart:t[rn(614)],duration:0},this[rn(617)][rn(419)]=t[rn(614)]}[rn(561)](t=Date[rn(595)]()){return{startTime:t,mouseActivity:0,clickActivity:0,keyActivity:0,scrollActivity:0,touchActivity:0,keyboardBurstActivity:0,mousePositions:[],clickPositions:[],keyEvents:[],scrollEvents:[],keyboardBursts:[],touchEvents:[],lastTouchEvent:null}}[rn(448)](t,e=!1){this[rn(586)][rn(450)](rn(565)+t,e)}[rn(407)](){try{if(this[rn(388)][rn(546)][rn(405)]){const e=this[rn(388)][rn(546)][rn(405)][rn(378)](cn);if(e){const n=JSON[rn(616)](e);let r;return rn(470)in n?r=n:r={webdriver_detected:(t=n).wd,bot_user_agent:t.ua,canvas_fingerprint_normal:t.cf,browser_environment_normal:t.be,natural_mouse_activity:t.nm,natural_click_patterns:t.nc,keyboard_activity:t.ka,scroll_activity:t.sa,touch_activity:t.ta,significant_page_time:t.pt,multiple_pages_visited:t.mp,session_duration_reasonable:t.sd},r}}}catch(t){}var t;return null}[rn(612)](t){try{this[rn(388)][rn(546)][rn(405)]&&this[rn(388)][rn(546)][rn(405)][rn(537)](cn,JSON[rn(452)](yn(t)))}catch(t){}}[rn(416)](t){const e=t[rn(615)];if(!(e&&e instanceof Element&&e[rn(525)]))return 0;const n=e[rn(525)]();if(!n[rn(607)]||!n[rn(548)])return 0;const r=n[rn(584)]+n[rn(607)]/2,i=n[rn(596)]+n[rn(548)]/2,o=this[rn(461)]({x:t[rn(513)],y:t[rn(418)]},{x:r,y:i}),a=Math[rn(436)](n[rn(607)]**2+n[rn(548)]**2)/2;return a>0?Math[rn(528)](0,1-o/a):0}[rn(461)](t,e){return Math[rn(436)]((e.x-t.x)**2+(e.y-t.y)**2)}[rn(602)](t){if(t[rn(587)](rn(583))||t[rn(587)](rn(581)))return t;return""+(this[rn(388)][rn(546)][rn(423)][rn(403)]||this[rn(388)][rn(546)][rn(423)][rn(395)]+"//"+this[rn(388)][rn(546)][rn(423)][rn(469)])+t}[rn(397)](t){try{this[rn(443)]?.[rn(391)](t)}catch(t){this[rn(586)][rn(472)](t,rn(456))}}[rn(374)](){try{return this[rn(380)]()??void 0}catch(t){return void this[rn(586)][rn(472)](t,rn(591))}}[rn(399)](t){const e=this[rn(617)][rn(564)]?.[rn(549)];return!!e&&(null!==this[rn(404)][rn(400)]&&(this[rn(373)](e,rn(505),{candidateSignals:t,updateSilenceClock:!1,allowRetry:!1,transport:rn(421),candidateQueueTracking:rn(570)})[rn(408)](t=>{this[rn(586)][rn(472)](t,rn(393))}),!0))}[rn(547)](t){return!(!this[rn(617)][rn(564)]||null===this[rn(404)][rn(400)])&&(this[rn(468)]({lifecycleCandidateSignals:t})[rn(408)](t=>{this[rn(586)][rn(472)](t,rn(554))}),!0)}async[rn(373)](t,e,n={}){if(!this[rn(617)][rn(564)])return;const r=n[rn(502)]??!0,i=n[rn(534)]??!0,o=n[rn(576)]??rn(432);if(null===this[rn(404)][rn(400)])return void(r&&(this[rn(617)][rn(564)][rn(536)]=Date[rn(595)]()));let a;!1!==n[rn(608)]&&(void 0===n[rn(597)]?a=this[rn(374)]():this[rn(443)]&&(a=n[rn(597)]));const s=We(0,yn(t),e,a),c=JSON[rn(452)](s),u=this[rn(602)](this[rn(404)][rn(400)]);void 0!==a&&o===rn(432)&&this[rn(443)]?.[rn(482)](a);const l=n[rn(434)]??rn(409);if(l!==rn(421)&&this[rn(388)][rn(516)][rn(373)]&&(l===rn(582)||!this[rn(404)][rn(451)]))try{const t=this[rn(404)][rn(551)]?c:new Blob([c],{type:rn(386)});if(this[rn(388)][rn(516)][rn(373)](u,t))return i&&(this[rn(617)][rn(564)][rn(401)]=0),void(r&&(this[rn(617)][rn(564)][rn(536)]=Date[rn(595)]()))}catch(t){}try{const t=await fetch(u,{method:rn(440),headers:{"Content-Type":this[rn(404)][rn(551)]?rn(610):rn(386)},...this[rn(404)][rn(551)]&&{mode:rn(424)},body:c,credentials:rn(540),keepalive:!0});if(!this[rn(617)][rn(564)])return;const e=this[rn(404)][rn(551)]&&t[rn(489)]===rn(396);if(!t.ok&&!e)throw new Error(rn(444)+t[rn(383)]);void 0!==a&&o===rn(570)&&t.ok&&this[rn(443)]?.[rn(482)](a),i&&(this[rn(617)][rn(564)][rn(401)]=0),r&&(this[rn(617)][rn(564)][rn(536)]=Date[rn(595)]())}catch(n){if(!this[rn(617)][rn(564)])return;i?this[rn(543)](t,e,a):void 0!==a&&o===rn(432)&&this[rn(443)]?.[rn(510)](a)}}[rn(543)](t,e,n){if(!this[rn(617)][rn(564)]||this[rn(617)][rn(564)][rn(401)]>=this[rn(404)][rn(441)])return void(void 0!==n&&this[rn(443)]?.[rn(510)](n));const r=Math[rn(577)](1e3*2**this[rn(617)][rn(564)][rn(401)],3e4);this[rn(617)][rn(564)][rn(401)]++,this[rn(617)][rn(564)][rn(479)]=this[rn(388)][rn(546)][rn(465)](()=>{this[rn(617)][rn(564)]&&this[rn(373)](t,e)},r)}async[rn(468)](t={},e=this[rn(617)],n=Date[rn(595)]()){if(!this[rn(617)][rn(564)])return;const{behaviorData:r,signals:i}=this[rn(500)](e,n,this[rn(617)][rn(433)]),o=function(t,e){if(!e)return!0;const n=Object[rn(618)](t);for(const r of n)if(t[r]!==e[r])return!0;return!1}(i,this[rn(617)][rn(564)][rn(549)]),a=Date[rn(595)]()-this[rn(617)][rn(564)][rn(536)],s=a>=this[rn(404)][rn(514)],c=void 0!==t[rn(390)];if(o||s||c){const e=Date[rn(595)]()-this[rn(617)][rn(564)][rn(504)];if(!c&&e<100)return void this[rn(448)](rn(494),!0);if(s&&!o&&this[rn(448)](rn(415)+Math[rn(480)](a/1e3)+rn(499),!0),o&&this[rn(404)][rn(376)]){if(this[rn(617)][rn(564)][rn(549)]){Object[rn(618)](i)[rn(496)](t=>{this[rn(617)][rn(564)][rn(549)][t],i[t]})}else this[rn(448)](rn(464));this[rn(617)][rn(433)]}if(this[rn(617)][rn(564)][rn(549)]=(u=i,{...u}),this[rn(617)][rn(564)][rn(504)]=Date[rn(595)](),this[rn(612)](i),this[rn(404)][rn(439)]&&o)try{this[rn(404)][rn(439)](yn(i))}catch(t){this[rn(586)][rn(472)](t,rn(562))}let n=rn(524);o?n=rn(603):s&&(n=rn(604));const r=!o&&!s;await this[rn(373)](i,n,{candidateSignals:t[rn(390)],includeCandidateSignals:t[rn(608)],updateSilenceClock:!r,allowRetry:!r,transport:rn(r?582:409)})}else this[rn(404)][rn(376)];var u}[rn(500)](t,e,n=this[rn(571)](e)){const r=pn(t[rn(485)],t[rn(379)],t[rn(529)],t[rn(573)],t[rn(498)],t[rn(431)],t[rn(442)],t[rn(508)],t[rn(563)],t[rn(605)],t[rn(491)],t[rn(614)],e);return{behaviorData:r,signals:vn(this[rn(617)][rn(552)],r,n,this[rn(617)][rn(564)]?.[rn(549)])}}}const Sn=(t,e,n)=>({libVersion:He,shopId:e||"",hostname:t[rn(546)]?.[rn(423)]?.[rn(545)]||"",url:t[rn(546)]?.[rn(423)]?.[rn(475)]||"",referrer:t[rn(544)]?.[rn(613)]||"",baseURI:t[rn(544)]?.[rn(541)]||"",sessionToken:n||"",uniqueToken:Oe("_shopify_y")||""});function bn(t,e){return e>=100||!(e<=0)&&function(t){try{const e=t[rn(546)][rn(405)]?.[rn(378)](un);if(null!==e&&/^\d{1,2}$/[rn(385)](e)){const t=Number(e);if(t<100)return t}}catch{}const e=Math[rn(493)](100*Math[rn(387)]());try{t[rn(546)][rn(405)]?.[rn(537)](un,String(e))}catch{}return e}(t){const r=(s=t?.[rn(511)],typeof s===rn(473)&&Number[rn(377)](s)?s:1),i=r>0,o=i?Oe("_shopify_s"):void 0,a=(t?.[rn(384)]??!1)&&bn(e,t?.[rn(438)]??100);var s;let c;o?c=function(t){let e=0;for(let n=0,r=t[nn(176)];nf[rn(515)]()):f[rn(515)](),f};class Tn{quietWindowStartCandidates=[];longAnimationFrameObserver=null;longAnimationFrames=[];constructor(){this.initializeLongAnimationFrameObserver()}getQuietWindowStartCandidates(){return[...this.quietWindowStartCandidates].sort((t,e)=>t.startTime-e.startTime)}getLongAnimationFrames(){if(!Mn()){const t=function(){const{getLongAnimationFrames:t}=window.ShopifyAnalytics?.performance||{};if(!t)return[];return t(!0)}();this.longAnimationFrames=[];for(const e of t)this.handleAnimationFrame(e.startTime,e.endTime)}return[...this.longAnimationFrames].sort((t,e)=>t.startTime-e.startTime)}destroy(){this.cleanup(),this.quietWindowStartCandidates=[],this.longAnimationFrames=[]}initializeLongAnimationFrameObserver(){if(Mn())try{this.longAnimationFrameObserver=new PerformanceObserver(t=>{const e=t.getEntries();for(const t of e)this.handleAnimationFrame(t.startTime,t.startTime+t.duration)}),this.longAnimationFrameObserver.observe({type:"long-animation-frame",buffered:!0})}catch(t){}}handleAnimationFrame(t,e){if(this.longAnimationFrames.push({startTime:t,endTime:e}),this.quietWindowStartCandidates.length>0){t-this.quietWindowStartCandidates[this.quietWindowStartCandidates.length-1].startTime<250&&this.quietWindowStartCandidates.pop()}this.quietWindowStartCandidates.push({startTime:e})}cleanup(){this.longAnimationFrameObserver&&(this.longAnimationFrameObserver.disconnect(),this.longAnimationFrameObserver=null)}}let _n=null;function Ln(){_n||(_n=new Tn)}function xn(t,e=0){if(null===t||!Mn()&&!Boolean(window.ShopifyAnalytics?.performance?.getLongAnimationFrames))return Dn(),null;const n=(_n?_n.getLongAnimationFrames():[]).map(t=>({startTime:t.startTime-e,endTime:t.endTime-e}));let r=null;for(const e of n){if(e.startTime<=t&&e.endTime>t){r=e;break}if(e.startTime>=t){r=e;break}}if(!r||r.startTime-t>=250)return Dn(),t;const i=(_n?_n.getQuietWindowStartCandidates():[]).map(t=>({startTime:t.startTime-e}));let o=t;if(i.length>0)for(const e of i)if(e.startTime>=t){o=e.startTime;break}return Dn(),o}function Mn(){return PerformanceObserver.supportedEntryTypes.includes("long-animation-frame")}function Dn(){_n&&(_n.destroy(),_n=null)}function zn(){return PerformanceObserver.supportedEntryTypes.includes("long-animation-frame")}function Bn(t){return performance.getEntriesByType("long-animation-frame").filter(e=>e.startTime+e.duration>t)}let An=null,Pn=!1;function Nn(){An=null,Pn=!1}const In=Object.freeze({shop_domain:`${window.location.origin}/.well-known/shopify/monorail`,global:"https://monorail-edge.shopifysvc.com",canada:"https://monorail-edge-ca.shopifycloud.com",staging:"https://monorail-edge-staging.shopifycloud.com"}),En=new RegExp(`^${window.location.origin}/((?:(?:[a-z]{2,3}|zh-hans|zh-hant)(?:-[a-zA-Z0-9]+)/)?cart/(add|change|update|clear))`),kn=new RegExp("cart-performance:|add:|change:|clear:|note_update:");var qn;function Un({monorailRegion:t,schema:e,rawData:n}){const r=Date.now(),i={schema_id:e,payload:e===qn.OnUnload?jn(n):On(n),metadata:{event_created_at_ms:r,event_sent_at_ms:r}},o=In[t||""],a=JSON.stringify(i);if(!o)return void console.debug("📡 Monorail: ",JSON.stringify(i,null,2));const s=e===qn.OnUnload;s&&Pn||function(t,e,n){const r=An?.result.activated?null:An,i=r?.interactions??[];return r?.controller.abort(),An=Rn(t,e?i:[...i,n],e?n:r?.onUnload??null),null!==An||(An=r&&Rn(t,r.interactions,r.onUnload),!1)}(o,s,a)||s&&An?.onUnload||(!function(t,e){try{const n=new window.Blob([e],{type:"text/plain"});if(Hn()&&window.navigator.sendBeacon(t,n))return}catch(t){}const n=new XMLHttpRequest;n.open("POST",t),n.setRequestHeader("Content-type","text/plain"),n.send(e)}(`${o}/v1/produce`,a),s&&(Pn=!0))}function Rn(t,e,n){if("function"!=typeof window.fetchLater)return null;const r=null===n?e:[...e,n];try{const i=new AbortController;return{controller:i,result:window.fetchLater(`${t}/unstable/produce_batch`,{method:"POST",body:`{"events":[${r.join(",")}]}`,headers:{"Content-Type":"text/plain"},credentials:"include",signal:i.signal}),interactions:e,onUnload:n}}catch(t){return null}}function jn(t){const e=Kn(t,["domInteractive","domContentLoadedEventStart","domContentLoadedEventEnd","domComplete","activationStart","firstPaint","visuallyReady","initiatorType","redirectCount","cartAjaxResourceTimings","cartPerformanceMetrics","totalStylingDuration","totalStyleDuration","totalForcedStyleDuration","totalLayoutDuration","totalForcedLayoutDuration","speculations","originalMicroSessionId","rolloutsTagRead","rolloutsTagMismatch","rolloutsTagUnusable","deviceMemory"]);return{perf_kit_init:t.perfKitInit,perf_kit_version:t.perfKitVersion,url:t.url,page_type:t.pageType,shop_id:t.shopId,application:t.application,storefront_id:t.storefrontId,theme_instance_id:t.themeInstanceId,theme_name:t.themeName,theme_version:t.themeVersion,session_token:t.sessionToken,unique_token:t.uniqueToken,micro_session_id:t.microSessionId,micro_session_count:t.microSessionCount,cumulative_layout_shift:t.cumulativeLayoutShift,cumulative_layout_shift_target:t.cumulativeLayoutShiftTarget,first_contentful_paint:t.firstContentfulPaint,largest_contentful_paint:t.largestContentfulPaint,largest_contentful_paint_target:t.largestContentfulPaintTarget,time_to_first_byte:t.timeToFirstByte,quiet_window_start:t.quietWindowStart,seo_bot:t.seoBot,humanness_score:t.humannessScore,ja3_fingerprint:t.ja3Fingerprint,navigation_start:t.navigationStart,navigation_type:t.navigationType,navigation_bad:t.navigationBad,encoded_body_size:t.encodedBodySize,decoded_body_size:t.decodedBodySize,transfer_size:t.transferSize,first_interim_response_start:t.firstInterimResponseStart,final_response_headers_start:t.finalResponseHeadersStart,response_start:t.responseStart,response_end:t.responseEnd,worker_start:t.workerStart,connect_start:t.connectStart,connect_end:t.connectEnd,domain_lookup_start:t.domainLookupStart,domain_lookup_end:t.domainLookupEnd,fetch_start:t.fetchStart,redirect_start:t.redirectStart,redirect_end:t.redirectEnd,request_start:t.requestStart,secure_connection_start:t.secureConnectionStart,next_hop_protocol:t.nextHopProtocol,server_timing:t.serverTiming,paint_timing_hidden:t.paintTimingHidden,referrer:t.referrer,render_region:t.renderRegion,resource_timing:t.resourceTiming,treatment_ids:t.treatmentIds,other_metrics:JSON.stringify(e)}}function On(t){const e=Kn(t,["longAnimationFrame","deviceMemory"]);return{url:t.url,page_type:t.pageType,shop_id:t.shopId,application:t.application,storefront_id:t.storefrontId,theme_instance_id:t.themeInstanceId,session_token:t.sessionToken,unique_token:t.uniqueToken,micro_session_id:t.microSessionId,micro_session_count:t.microSessionCount,interaction_to_next_paint:t.interactionToNextPaint,interaction_to_next_paint_target:t.interactionToNextPaintTarget,seo_bot:t.seoBot,humanness_score:t.humannessScore,ja3_fingerprint:t.ja3Fingerprint,referrer:t.referrer,worker_start:t.workerStart,next_hop_protocol:t.nextHopProtocol,navigation_bad:t.navigationBad,treatment_ids:t.treatmentIds,other_interaction_metrics:JSON.stringify(e)}}function Hn(){return"function"==typeof window.navigator.sendBeacon&&"function"==typeof window.Blob&&!function(){const{userAgent:t}=window.navigator;return-1!==t.lastIndexOf("iPhone; CPU iPhone OS 12_")||-1!==t.lastIndexOf("iPad; CPU OS 12_")}()}function Kn(t,e){return e.reduce((e,n)=>{var r;return null!=t[n]&&(e[(r=n,r.replace(/[A-Z]/g,t=>`_${t.toLowerCase()}`))]=t[n]),e},{})}function Fn(t,e){return t?Math.max(0,Math.round(t-e)):0}!function(t){t.OnInteraction="perf_kit_on_interaction/3.2",t.OnUnload="perf_kit_on_unload/3.5"}(qn||(qn={}));const Wn=Object.freeze({"storefront-renderer":0,hydrogen:0,"shop-web":0,headless:0});function Vn(t){if(!t.application)throw new Error("Application is missing");if(!["storefront-renderer","hydrogen","shop-web","headless"].includes(t.application.toLowerCase()))throw new Error("Invalid application type");if("headless"===t.application.toLowerCase()){if(!t.shopId)throw new Error("shopId is missing");if(isNaN(Number(t.shopId)))throw new Error("Invalid shopId")}else if("shop-web"!==t.application.toLowerCase()){if(!t.shopId)throw new Error("shopId is missing");if(!t.themeInstanceId&&!t.storefrontId)throw new Error("Either `themeInstanceId` or `storefrontId` must be defined");for(const e of["shopId","themeInstanceId","storefrontId"])if(t[e]&&isNaN(Number(t[e])))throw new Error(`Invalid ${e}`)}if(t.humannessScore&&isNaN(Number(t.humannessScore)))throw new Error("Invalid humannessScore");if(t.monorailRegion&&!["shop_domain","global","staging","canada"].includes(t.monorailRegion.toLowerCase()))throw new Error("Invalid monorail region");if(t.resourceTimingSamplingRate&&(isNaN(Number(t.resourceTimingSamplingRate))||Number(t.resourceTimingSamplingRate)<10||Number(t.resourceTimingSamplingRate)>100))throw new Error("Invalid resource timing sampling rate");let e,n,r,i=function(t){if(!t)return;const e=[];for(const n of t.split(",")){const t=Number(n);isNaN(t)||e.push(t)}return e.length>0?e:void 0}(t.treatmentIds);if("storefront-renderer"===t.application.toLowerCase()&&"true"===t.rolloutsExposureIdsEnabled){const o=function(){const t=document.querySelector('script#shopify-rollouts[type="application/json"]');if(!t)return;try{const e=JSON.parse(t.textContent||"");return e&&Array.isArray(e.rolloutIds)&&e.rolloutIds.every(Number.isFinite)&&Array.isArray(e.rolloutTreatmentIds)&&e.rolloutTreatmentIds.every(Number.isFinite)?e:void 0}catch{return}}();if(o){if(e=1,void 0!==t.treatmentIds){const t=new Set(o.rolloutTreatmentIds);(new Set(i).size!==t.size||i?.some(e=>!t.has(e)))&&(n=1)}i=o.rolloutTreatmentIds.length?o.rolloutTreatmentIds:void 0}else r=1}return{storefrontData:{application:t.application.toLowerCase(),shopId:Number(t.shopId)||0,renderRegion:t.renderRegion,pageType:t.pageType,seoBot:"true"===t.seoBot,humannessScore:Number(t.humannessScore)||void 0,ja3Fingerprint:t.ja3Fingerprint,themeInstanceId:Number(t.themeInstanceId)||void 0,storefrontId:Number(t.storefrontId)||void 0,themeName:t.themeName||void 0,themeVersion:t.themeVersion||void 0,treatmentIds:i,rolloutsTagRead:e,rolloutsTagMismatch:n,rolloutsTagUnusable:r},monorailRegion:t.monorailRegion,resourceTimingSamplingRate:Number(t.resourceTimingSamplingRate)||void 0,eventRefinerySampleRate:Jn(t.eventRefinerySampleRate),spaMode:"true"===t.spaMode,shs:"true"===t.shs,shsBeaconEndpoint:t.shsBeaconEndpoint||void 0,shsExportWithFetch:void 0===t.shsExportWithFetch?void 0:"true"===t.shsExportWithFetch,shsTextPlain:"true"===t.shsTextPlain,shsLogsSampleRate:Zn(t.shsLogsSampleRate),shsCandidateSampleRate:Xn(Number(t.shsCandidateSampleRate)),shsCandidateMask:t.shsCandidateMask,shsCandidateActivePageFlush:void 0===t.shsCandidateActivePageFlush?void 0:"false"!==t.shsCandidateActivePageFlush}}function Jn(t){if(void 0===t||""===t.trim())return;const e=Number(t);return Number.isFinite(e)&&e>=0&&e<=100?e:void 0}function Zn(t){if(void 0===t||""===t.trim())return;const e=Number(t);return Number.isFinite(e)?e:void 0}function Xn(t){return!Number.isFinite(t)||t<=0?0:Math.min(100,Math.floor(t))}const Yn="xxxx-4xxx-xxxx-xxxxxxxxxxxx";function Gn(){let t="";try{const e=window.crypto,n=new Uint16Array(31);e.getRandomValues(n);let r=0;t=Yn.replace(/[x]/g,t=>{const e=n[r]%16;return r++,("x"===t?e:3&e|8).toString(16)}).toUpperCase()}catch(e){t=Yn.replace(/[x]/g,t=>{const e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}).toUpperCase()}return`${function(){let t=0,e=0;t=(new Date).getTime()>>>0;try{e=performance.now()>>>0}catch(t){e=0}return Math.abs(t+e).toString(16).toLowerCase().padStart(8,"0")}()}-${t}`}const $n="type.googleapis.com/shopify.buyer_activity.WebPerformanceOnUnloadEvent",Qn="type.googleapis.com/shopify.buyer_activity.WebPerformanceOnInteractionEvent",tr=Object.freeze({shop_domain:`${window.location.origin}/.well-known/shopify/fec/produce`,global:"https://frontend-event-collector.shopifysvc.com/produce",staging:"https://frontend-event-collector-staging.shopifysvc.com/produce"}),er=Object.freeze({"storefront-renderer":["EVENT_APP_LIQUID_STOREFRONT","DATA_ORIGINATOR_MERCHANT"],hydrogen:["EVENT_APP_HYDROGEN","DATA_ORIGINATOR_MERCHANT"],"shop-web":["EVENT_APP_SHOP_WEB","DATA_ORIGINATOR_SHOPIFY"]}),nr=Object.freeze({navigate:"NAVIGATION_TYPE_NAVIGATE",reload:"NAVIGATION_TYPE_RELOAD",back_forward:"NAVIGATION_TYPE_BACK_FORWARD",prerender:"NAVIGATION_TYPE_PRERENDER",back_forward_cache:"NAVIGATION_TYPE_BACK_FORWARD_CACHE"}),rr=/(\/(?:account\/(?:reset|activate)|gift_cards)\/[^/]+\/)[^/]+/,ir=new Set(["_y","_s","_cmp"]),or=/(?:^|;\s*)perf_kit_event_refinery=(production|test)(?:;|$)/,ar=["navigationStart","encodedBodySize","decodedBodySize","transferSize","responseStart","responseEnd","connectStart","connectEnd","domainLookupStart","domainLookupEnd","fetchStart","redirectStart","redirectEnd","requestStart","secureConnectionStart","firstInterimResponseStart","finalResponseHeadersStart","domInteractive","domContentLoadedEventStart","domContentLoadedEventEnd","domComplete","activationStart","redirectCount"],sr=["totalStylingDuration","totalStyleDuration","totalForcedStyleDuration","totalLayoutDuration","totalForcedLayoutDuration"],cr=["name","entryType","navigationId","initiatorType","deliveryType","nextHopProtocol","renderBlockingStatus","contentType","contentEncoding","workerMatchedSourceType","workerFinalSourceType"],ur=["startTime","duration","workerStart","workerRouterEvaluationStart","workerCacheLookupStart","redirectStart","redirectEnd","fetchStart","domainLookupStart","domainLookupEnd","connectStart","secureConnectionStart","connectEnd","requestStart","responseStart","firstInterimResponseStart","finalResponseHeadersStart","responseEnd"],lr=["transferSize","encodedBodySize","decodedBodySize"],dr=[[function(){return gt()},"USER_CONSENT_TYPE_MARKETING"],[function(){return Tt()},"USER_CONSENT_TYPE_PREFERENCES"],[function(){return _t()},"USER_CONSENT_TYPE_SALE_OF_DATA"]],fr=Object.freeze({interactions:[],pageLoad:null});let hr=null,pr=new AbortController,mr=!1;function gr(t){var e;"string"==typeof(e=t)&&rr.test(e)&&(mr=!0)}function vr(t,e){const n=hr;n&&Tr(()=>Sr(n));try{t()}finally{Tr(e),n&&Tr(()=>function(t){if(t.request||_r(t.batch))return;if(br(t,t.batch))return;const{batch:e}=t;t.batch=fr,Cr(t,e)}(n))}}function yr(t){hr=null,Tr(()=>{gr(window.location.href),gr(document.referrer)});try{const e=er[t.application];if(!e)return null;const n=function(){try{return or.exec(document.cookie)?.[1]}catch{return}}(),r=t.sampleRate??Wn[t.application];if(!(n||100*Math.random()Br(Or(t))),cartAjaxResourceTimings:Rr(t.cartAjaxResourceTimings,Br),cartPerformanceMetrics:Rr(t.cartPerformanceMetrics,Ar)}}(t));e&&wr(o,JSON.stringify(e),!0)}catch{}}}}(e,o,"test"===n)}catch{return null}}function wr(t,e,n){Sr(t);const{batch:r}=t,i=n?{interactions:r.interactions,pageLoad:e}:{interactions:[...r.interactions,e],pageLoad:r.pageLoad};if(!br(t,i))if(_r(r)||br(t,r)){if(n&&null!==r.pageLoad)return;Cr(t,n?{interactions:[],pageLoad:e}:{interactions:[e],pageLoad:null})}else t.batch=fr,Cr(t,i)}function Sr(t){const{request:e}=t;e&&(t.request=null,e.result.activated?t.batch=fr:e.controller.abort())}function br(t,e){if(!t.endpoint||"function"!=typeof window.fetchLater)return!1;try{const n=new AbortController,r=window.fetchLater(t.endpoint,{method:"POST",body:Ir(Lr(e)),headers:xr(t.test),credentials:"include",signal:AbortSignal.any([n.signal,pr.signal])});return t.request={controller:n,result:r},t.batch=e,!0}catch{return!1}}function Cr(t,e){for(const n of function(t){const e=[];let n=[],r=0;for(const i of t)n.length>0&&r+i.length>6e4&&(e.push(Ir(n)),n=[],r=0),n.push(i),r+=i.length+1;n.length>0&&e.push(Ir(n));return e}(Lr(e)))Er(t.endpoint,n,t.test);null!==e.pageLoad&&(t.pageLoadSent=!0)}function Tr(t){try{t()}catch{}}function _r(t){return 0===t.interactions.length&&null===t.pageLoad}function Lr(t){return null===t.pageLoad?t.interactions:[...t.interactions,t.pageLoad]}function xr(t){return t?{"Content-Type":"text/plain","X-Event-Destination":"test"}:{"Content-Type":"text/plain"}}function Mr(t){return{deviceMemory:Fr(t.deviceMemory)}}function Dr(t){return{workerStart:Hr(t.workerStart),nextHopProtocol:Wr(t.nextHopProtocol),navigationBad:Xr(t.navigationBad)}}function zr(t){if(jr(t))return{usedPreloads:Hr(t.used_preloads),unusedPreloads:Hr(t.unused_preloads),unusedPreloadDetails:Rr(t.unused_preload_details,t=>jr(t)?{url:Wr(t.url),as:Wr(t.as),crossorigin:Wr(t.crossorigin),earlyHint:Xr(t.early_hint)}:void 0),earlyHintPreloads:Hr(t.early_hint_preloads),usedNavigations:Hr(t.used_navigations),unusedNavigations:Hr(t.unused_navigations),navigationBreakdown:Rr(t.navigation_breakdown,t=>jr(t)?{type:Wr(t.type),eagerness:Wr(t.eagerness),tags:Rr(t.tags,Wr),used:Hr(t.used),unused:Hr(t.unused)}:void 0),sameOriginNavigation:Xr(t.same_origin_navigation)}}function Br(t){var e;if(jr(t))return{...Ur(t,cr,Wr),name:Vr(t.name),navigationId:Jr(t.navigationId),...Ur(t,ur,Fr),...Ur(t,lr,Kr),responseStatus:(e=t.responseStatus,"number"==typeof e&&e>=0&&e<=4294967295?Math.round(e):void 0),serverTiming:Pr(t.serverTiming)}}function Ar(t){if(jr(t))return{name:Wr(t.name),entryType:Wr(t.entryType),startTime:Fr(t.startTime),duration:Fr(t.duration),navigationId:Jr(t.navigationId)}}function Pr(t){return Rr(t,t=>jr(t)&&!ir.has(t.name)?{name:Wr(t.name),duration:Fr(t.duration),description:Wr(t.description)}:void 0)}function Nr(){const t=[{consentType:"USER_CONSENT_TYPE_ANALYTICS"}];for(const[e,n]of dr)try{e()&&t.push({consentType:n})}catch{}return t}function Ir(t){return`{"events":[${t.join(",")}]}`}function Er(t,e,n){try{if(!t)return void console.debug("📡 Event Refinery: ",e);if(n&&new Blob([e]).size<=65536)return void fetch(t,{method:"POST",body:e,keepalive:!0,headers:xr(!0)}).catch(()=>{});try{if(!n&&Hn()&&window.navigator.sendBeacon(t,e))return}catch{}const r=new XMLHttpRequest;r.open("POST",t);for(const[t,e]of Object.entries(xr(n)))r.setRequestHeader(t,e);r.send(e)}catch{}}function kr(){const t=Gn().replace(/-/g,"").slice(-32);return{highid:qr(t.slice(0,16)),lowid:qr(t.slice(16))}}function qr(t){const e=[0];for(const n of t){let t=parseInt(n,16);for(let n=0;n0;)e.push(t%10),t=Math.floor(t/10)}return e.reverse().join("")}function Ur(t,e,n){const r={};for(const i of e)r[i]=n(t[i]);return r}function Rr(t,e){if(!Array.isArray(t))return;const n=[];for(const r of t){const t=e(r);void 0!==t&&n.push(t)}return n}function jr(t){return"object"==typeof t&&null!==t}function Or(t){if("string"==typeof t)try{return JSON.parse(t)}catch{return}}function Hr(t){return"number"==typeof t&&Math.abs(t)<=Number.MAX_SAFE_INTEGER?String(Math.round(t)||0):void 0}function Kr(t){return"number"==typeof t&&t>=0&&t<=Number.MAX_SAFE_INTEGER?String(Math.round(t)):void 0}function Fr(t){return"number"==typeof t&&isFinite(t)?t:void 0}function Wr(t){return"string"==typeof t?t:void 0}function Vr(t){const e=Zr(t);if(!e)return;let n;try{n=new URL(e)}catch{return}return rr.test(n.pathname)?(n.pathname=n.pathname.replace(rr,"$1[redacted]"),n.toString()):e}function Jr(t){return"number"==typeof t&&Number.isFinite(t)?String(t):Wr(t)}function Zr(t){return"string"==typeof t&&""!==t?t:void 0}function Xr(t){return"boolean"==typeof t?t:void 0}function Yr(t){return 1===t||0!==t&&Xr(t)}function Gr(t){const e=Kr(t);return e&&"0"!==e?{lowid:e}:void 0}function $r(t){return"number"==typeof t&&Math.abs(t)<=864e13?new Date(t).toISOString():void 0}let Qr=null,ti=!1,ei=null,ni=null,ri=null,ii=null;let oi=!1;class ai{info;config;sampled;onUnloadCounted;cachedQuietWindowStart;isBackForwardCacheRestore;lifecycleStart;originalMicroSessionId;eventRefinery;constructor(t,e={}){this.config=t,this.isBackForwardCacheRestore=e.isBackForwardCacheRestore??!1,this.lifecycleStart=e.startTime??0,this.originalMicroSessionId=e.originalMicroSessionId;const n="storefront-renderer"===(r=t.storefrontData.application)||"hydrogen"===r;var r;this.info={perfKitInit:Date.now(),perfKitVersion:"3.16.1",url:window.location.href,referrer:document.referrer||void 0,microSessionId:Gn(),microSessionCount:0,get sessionToken(){return n?Ut("_shopify_s"):qt()},get uniqueToken(){return n?Ut("_shopify_y"):kt()},deviceMemory:navigator.deviceMemory},this.sampled=100*Math.random()<=(t.resourceTimingSamplingRate??10),this.onUnloadCounted=!1,this.cachedQuietWindowStart=void 0,this.eventRefinery=yr({application:t.storefrontData.application,monorailRegion:t.monorailRegion,sampleRate:t.eventRefinerySampleRate}),performance.setResourceTimingBufferSize(1e3)}get performanceMetrics(){return this.isBackForwardCacheRestore?{}:function(t){const e=performance.getEntriesByType("navigation");if(0===e.length)return{};const n=e[0],r=n.activationStart||0,i=function(t,e){return!e&&(t.requestStart>0&&t.startTime>0&&t.requestStart0&&t.startTime>0&&t.responseStart0&&t.fetchStart>0&&t.responseStart0&&t.fetchStart0&&t.responseEnd>e+864e5}(n,t);return{encodedBodySize:n.encodedBodySize,decodedBodySize:n.decodedBodySize,navigationStart:Math.round(n.startTime),navigationType:n.type,navigationBad:i,firstInterimResponseStart:Math.round(n.firstInterimResponseStart),finalResponseHeadersStart:Math.round(n.finalResponseHeadersStart),responseStart:Math.round(n.responseStart),responseEnd:Math.round(n.responseEnd),workerStart:Math.round(n.workerStart),connectStart:Math.round(n.connectStart),connectEnd:Math.round(n.connectEnd),domainLookupStart:Math.round(n.domainLookupStart),domainLookupEnd:Math.round(n.domainLookupEnd),fetchStart:Math.round(n.fetchStart),redirectStart:Math.round(n.redirectStart),redirectEnd:Math.round(n.redirectEnd),requestStart:Math.round(n.requestStart),secureConnectionStart:Math.round(n.secureConnectionStart),nextHopProtocol:n.nextHopProtocol,serverTiming:JSON.stringify(n.serverTiming),domInteractive:Fn(n.domInteractive,r),domComplete:Fn(n.domComplete,r),domContentLoadedEventStart:Fn(n.domContentLoadedEventStart,r),domContentLoadedEventEnd:Fn(n.domContentLoadedEventEnd,r),activationStart:Math.round(r),redirectCount:n.redirectCount,initiatorType:n.initiatorType,transferSize:n.transferSize}}(this.info.perfKitInit)}get bfCacheMetadata(){if(!this.isBackForwardCacheRestore)return{};const t=performance.getEntriesByType("navigation");return{navigationType:"back_forward_cache",originalMicroSessionId:this.originalMicroSessionId,nextHopProtocol:t.length>0?t[0].nextHopProtocol:void 0}}}const si=new Set;function ci(){if(null!==ni){if(!di()){if(!ui())return Tr(()=>pr.abort()),pr=new AbortController,void(hr&&(hr.request=null,hr.batch=fr));if(si.size>0){let t={};for(const e of si)t={...t,...e};const e=t.firstContentfulPaint??null;if(null!==e&&void 0===ni.cachedQuietWindowStart){const t=performance.getEntriesByType("navigation")[0]?.activationStart||0,n=ni.isBackForwardCacheRestore?ni.lifecycleStart:t;ni.cachedQuietWindowStart=xn(e,n)}void 0!==ni.cachedQuietWindowStart&&null!==ni.cachedQuietWindowStart&&(t.quietWindowStart=Math.round(ni.cachedQuietWindowStart));const n=function(t=0){if(!zn())return null;const e=Bn(t);let n=0;for(const t of e){n+=t.styleAndLayoutStart?t.startTime+t.duration-t.styleAndLayoutStart:0;for(const e of t.scripts)n+=e.forcedStyleAndLayoutDuration}return n}(ni.lifecycleStart);null!==n&&(t.totalStylingDuration=Math.round(n));const r=function(t=0){if(!zn())return null;const e=Bn(t);if(0===e.length)return null;if("number"!=typeof e[0].styleDuration)return null;let n=0,r=0,i=0,o=0;for(const t of e){const e=t;n+=e.styleDuration??0,i+=e.layoutDuration??0;for(const e of t.scripts){const t=e;r+=t.forcedStyleDuration??0,o+=t.forcedLayoutDuration??0}}return{totalStyleDuration:n,totalForcedStyleDuration:r,totalLayoutDuration:i,totalForcedLayoutDuration:o}}(ni.lifecycleStart);null!==r&&(t.totalStyleDuration=Math.round(r.totalStyleDuration),t.totalForcedStyleDuration=Math.round(r.totalForcedStyleDuration),t.totalLayoutDuration=Math.round(r.totalLayoutDuration),t.totalForcedLayoutDuration=Math.round(r.totalForcedLayoutDuration)),ni.onUnloadCounted||(ni.info.microSessionCount+=1,ni.onUnloadCounted=!0);const i=ni.isBackForwardCacheRestore?void 0:function(t){if(t)return performance.getEntriesByType("resource").map(t=>{const e=Object.entries(t.toJSON()).map(([t,e])=>"number"==typeof e?[t,Math.round(e)]:[t,e]);return JSON.stringify(Object.fromEntries(e))})}(ni.sampled),o=ni.isBackForwardCacheRestore?void 0:function(t){if("function"!=typeof performance.getSpeculations)return;const e=performance.getSpeculations(),n=e.preloads??[];let r=0,i=0,o=0;const a=[];for(const e of n){const n=Boolean(e.earlyhint??e.earlyHints);n&&(o+=1),null==e.used?(i+=1,t&&a.push({url:e.url.slice(-20),as:e.as,crossorigin:e.crossorigin??null,early_hint:n})):r+=1}const s=e.navigations??[],c=e.navigationDestinationURL??null;let u=0;const l=new Map;for(const t of s){const e=t.url===c;e&&(u+=1);const n=t.eagerness??null,r=(t.tags??[]).map(t=>t.slice(0,64)).sort(),i=JSON.stringify([t.type,n,r]);let o=l.get(i);!o&&l.size<10&&(o={type:t.type,eagerness:n,tags:r,used:0,unused:0},l.set(i,o)),o&&(o[e?"used":"unused"]+=1)}return{used_preloads:r,unused_preloads:i,unused_preload_details:a,early_hint_preloads:o,used_navigations:u,unused_navigations:s.length-u,navigation_breakdown:Array.from(l.values()),same_origin_navigation:null!==c}}(ni.sampled),a=function(t=0){return performance.getEntriesByType("resource").filter(e=>(e.startTime||0)>=t&&En.test(e.name))}(ni.lifecycleStart),s=function(t=0){return performance.getEntriesByType("measure").filter(e=>(e.startTime||0)>=t&&kn.test(e.name)).map(t=>{const e=t.toJSON();return e.name.startsWith("cart-performance:")||(e.name=`cart-performance:${e.name}`),e})}(ni.lifecycleStart),c={...ni.info,...ni.config.storefrontData,...ni.performanceMetrics,...ni.bfCacheMetadata,...t,resourceTiming:i,cartAjaxResourceTimings:a,cartPerformanceMetrics:s,paintTimingHidden:oi,speculations:o},{config:u,eventRefinery:l}=ni;vr(()=>Un({monorailRegion:u.monorailRegion,schema:qn.OnUnload,rawData:c}),()=>l?.reportPageLoad(c))}}}else console.debug("⛔️ Shopify/perf-kit is not initialized")}function ui(){return null!==ri?ri:"headless"!==Qr?.storefrontData.application&&Rt()}addEventListener("pageshow",t=>{if(!t.persisted||null===Qr||null===ni)return;si.clear(),Nn(),Dn();const e=new ai(Qr,{isBackForwardCacheRestore:!0,startTime:t.timeStamp,originalMicroSessionId:ni.originalMicroSessionId??ni.info.microSessionId});ni=e,ti=!1,ei=window.location.pathname,oi=!1,setTimeout(()=>{ni===e&&(oi="hidden"===document.visibilityState)}),Ln()},{capture:!0}),((e,r={})=>{const o=a(r=Object.assign({},r),t),s=new WeakMap;o.t=t=>{if(t?.sources?.length){const e=L(t.sources),n=e?.node;if(n){const t=r.generateTarget?.(n)??i(n);s.set(e,t)}}},((e,n={})=>{const r=S();T(m(()=>{let i,o=h("CLS",0);const s=a(n,t),c=t=>{for(const e of t)s.u(e);s.o>o.value&&(o.value=s.o,o.entries=s.i,i())},f=p("layout-shift",c);f&&(i=l(e,o,_,n.reportAllChanges),r.onHidden(()=>{c(f.takeRecords()),i(!0)}),u(()=>{s.o=0,o=h("CLS",0),i=l(e,o,_,n.reportAllChanges),d(()=>i())}),setTimeout(i))}))})(t=>{const r=(t=>{let e={};if(t.entries.length){const r=t.entries.reduce((t,e)=>t.value>e.value?t:e);if(r?.sources?.length){const t=L(r.sources);t&&(e={largestShiftTarget:s.get(t),largestShiftTime:r.startTime,largestShiftValue:r.value,largestShiftSource:t,largestShiftEntry:r,loadState:n(r.startTime)})}}return Object.assign(t,{attribution:e})})(t);e(r)},r)})(function(t){const{attribution:e,value:n}=t;si.add({cumulativeLayoutShift:n,cumulativeLayoutShiftTarget:e.largestShiftTarget})},{reportAllChanges:!0}),((t,n={})=>{const r=a(n=Object.assign({},n),k),o=new WeakMap;r.m=t=>{const e=t.element;if(e){const r=n.generateTarget?.(e)??i(e);o.set(t,r)}},((t,e={})=>{b(()=>{const n=S();let r,i=h("LCP");const o=a(e,k),s=t=>{e.reportAllChanges||(t=t.slice(-1));for(const e of t)o.u(e),e.startTime{s(c.takeRecords()),c.disconnect(),r(!0)}),o=t=>{t.isTrusted&&(I(n),removeEventListener(t.type,o,{capture:!0}))};for(const t of["keydown","click","visibilitychange"])addEventListener(t,o,{capture:!0});u(n=>{i=h("LCP"),r=l(t,i,q,e.reportAllChanges),d(()=>{i.value=performance.now()-n.timeStamp,r(!0)})})}})})(n=>{const r=(t=>{let n={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:t.value};if(t.entries.length){const r=e();if(r){const e=r.activationStart||0,i=t.entries.at(-1),a=i.url&&performance.getEntriesByType("resource").filter(t=>t.name===i.url)[0],s=Math.max(0,r.responseStart-e),c=Math.max(s,a?(a.requestStart||a.startTime)-e:0),u=Math.min(t.value,Math.max(c,a?a.responseEnd-e:0));n={target:o.get(i),timeToFirstByte:s,resourceLoadDelay:c-s,resourceLoadDuration:u-c,elementRenderDelay:t.value-u,navigationEntry:r,lcpEntry:i},i.url&&(n.url=i.url),a&&(n.lcpResourceEntry=a)}}return Object.assign(t,{attribution:n})})(n);t(r)},n)})(function(t){const{attribution:e,value:n}=t;si.add({largestContentfulPaint:Math.round(n),largestContentfulPaintTarget:e.target})},{reportAllChanges:!0}),((t,r={})=>{T(r=>{const i=(t=>{let r={timeToFirstByte:0,firstByteToFCP:t.value,loadState:n(c())};if(t.entries.length){const i=e(),o=t.entries.at(-1);if(i){const e=i.activationStart||0,a=Math.max(0,i.responseStart-e);r={timeToFirstByte:a,firstByteToFCP:t.value-a,loadState:n(t.entries[0].startTime),navigationEntry:i,fcpEntry:o}}}return Object.assign(t,{attribution:r})})(r);t(i)},r)})(function(t){const{value:e}=t;si.add({firstContentfulPaint:Math.round(e)})}),((t,e={})=>{const r=a(e=Object.assign({},e),N);let o=[],s=[],c=0;const d=new WeakMap,f=new WeakMap;let m=!1;const g=()=>{m||(I(v),m=!0)},v=()=>{const t=r.l.map(t=>d.get(t.entries[0])),e=s.length-50;s=s.filter((n,r)=>r>=e||t.includes(n));const n=new Set;for(const t of s){const e=y(t.startTime,t.processingEnd);for(const t of e)n.add(t)}const i=o.length-1-50;o=o.filter((t,e)=>t.startTime>c&&e>i||n.has(t)),m=!1};r.m=t=>{const e=t.startTime+t.duration;let n;c=Math.max(c,t.processingEnd);for(let r=s.length-1;r>=0;r--){const i=s[r];if(Math.abs(e-i.renderTime)<=8){n=i,n.startTime=Math.min(t.startTime,n.startTime),n.processingStart=Math.min(t.processingStart,n.processingStart),n.processingEnd=Math.max(t.processingEnd,n.processingEnd),n.entries.push(t);break}}n||(n={startTime:t.startTime,processingStart:t.processingStart,processingEnd:t.processingEnd,renderTime:e,entries:[t]},s.push(n)),(t.interactionId||"first-input"===t.entryType)&&d.set(t,n),g()},r.p=t=>{if(!f.get(t)){const n=t.entries[0].target;if(n){const r=e.generateTarget?.(n)??i(n);f.set(t,r)}}};const y=(t,e)=>{const n=[];for(const r of o)if(!(r.startTime+r.duratione)break;n.push(r)}return n},w=t=>{const e=t.entries[0],i=d.get(e),o=e.processingStart,a=Math.max(e.startTime+e.duration,o),s=Math.min(i.processingEnd,a),c=i.entries.sort((t,e)=>t.processingStart-e.processingStart),u=y(e.startTime,s),l=r.h.get(e.interactionId),h={interactionTarget:f.get(l),interactionType:e.name.startsWith("key")?"keyboard":"pointer",interactionTime:e.startTime,nextPaintTime:a,processedEventEntries:c,longAnimationFrameEntries:u,inputDelay:o-e.startTime,processingDuration:s-o,presentationDelay:a-s,loadState:n(e.startTime),longestScript:void 0,totalScriptDuration:void 0,totalStyleAndLayoutDuration:void 0,totalPaintDuration:void 0,totalUnattributedDuration:void 0};return(t=>{if(!t.longAnimationFrameEntries?.length)return;const e=t.interactionTime,n=t.inputDelay,r=t.processingDuration;let i,o,a=0,s=0,c=0,u=0;for(const c of t.longAnimationFrameEntries){s=s+c.startTime+c.duration-c.styleAndLayoutStart;for(const t of c.scripts){const c=t.startTime+t.duration;if(cu&&(o=t.startTime=e+n+r?"presentation-delay":"processing-duration",i=t,u=l)}}const l=t.longAnimationFrameEntries.at(-1),d=l?l.startTime+l.duration:0;d>=e+n+r&&(c=t.nextPaintTime-d),i&&o&&(t.longestScript={entry:i,subpart:o,intersectingDuration:u}),t.totalScriptDuration=a,t.totalStyleAndLayoutDuration=s,t.totalPaintDuration=c,t.totalUnattributedDuration=t.nextPaintTime-e-a-s-c})(h),Object.assign(t,{attribution:h})};p("long-animation-frame",t=>{o=o.concat(t),g()}),((t,e={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=S();b(()=>{"interactionCount"in performance||B||(B=p("event",z,{type:"event",buffered:!0,durationThreshold:0}));let r,i=h("INP");const o=a(e,N),s=t=>{I(()=>{for(const e of t)o.u(e);const e=o.M();e&&e.T!==i.value&&(i.value=e.T,i.entries=e.entries,r())})},c=p("event",s,{durationThreshold:e.durationThreshold??40});r=l(t,i,E,e.reportAllChanges),c&&(c.observe({type:"first-input",buffered:!0}),n.onHidden(()=>{s(c.takeRecords()),r(!0)}),u(()=>{o.v(),i=h("INP"),r=l(t,i,E,e.reportAllChanges)}))})})(e=>{const n=w(e);t(n)},e)})(function(t){const{attribution:e,value:n}=t;if(null===ni)return void console.debug("⛔️ Shopify/perf-kit is not initialized");if(function(){const t=navigator.userAgent;if(!t.includes("Safari")||t.includes("Chrome"))return!1;const e=/Version\/(\d+)(?:\.(\d+))?/.exec(t);if(null===e)return!0;const n=Number(e[1]),r=Number(e[2]||0);return n<26||26===n&&r<4}())return;if(di())return;if(!ui())return;ni.info.microSessionCount+=1;const{inputDelay:r,processingDuration:i,presentationDelay:o,longestScript:a,interactionTarget:s}=e,c=a?.entry?{slowest_script:a.entry.sourceURL,slowest_script_duration:Math.round(a.entry.duration)}:{},u={...ni.info,...ni.config.storefrontData,...ni.performanceMetrics,...ni.bfCacheMetadata,interactionToNextPaint:Math.round(n),interactionToNextPaintTarget:s,longAnimationFrame:{input_delay:Math.round(r),processing_duration:Math.round(i),presentation_delay:Math.round(o),...c}},{config:l,eventRefinery:d}=ni;vr(()=>Un({monorailRegion:l.monorailRegion,schema:qn.OnInteraction,rawData:u}),()=>d?.reportInteraction(u))},{reportAllChanges:!0}),((t,n={})=>{((t,n={})=>{let r=h("TTFB"),i=l(t,r,U,n.reportAllChanges);R(()=>{const o=e();o&&(r.value=Math.max(o.responseStart-f(),0),r.entries=[o],i(!0),u(()=>{r=h("TTFB",0),i=l(t,r,U,n.reportAllChanges),i(!0)}))})})(e=>{const n=(t=>{let e={waitingDuration:0,cacheDuration:0,dnsDuration:0,connectionDuration:0,requestDuration:0};if(t.entries.length){const n=t.entries[0],r=n.activationStart||0,i=Math.max((n.workerStart||n.fetchStart)-r,0),o=Math.max(n.domainLookupStart-r,0),a=Math.max(n.connectStart-r,0),s=Math.max(n.connectEnd-r,0);e={waitingDuration:i,cacheDuration:o-i,dnsDuration:a-o,connectionDuration:s-a,requestDuration:t.value-s,navigationEntry:n}}return Object.assign(t,{attribution:e})})(e);t(n)},n)})(function(t){if(ni?.isBackForwardCacheRestore)return;const{value:e}=t;si.add({timeToFirstByte:Math.round(e)})}),addEventListener("DOMContentLoaded",()=>{oi="hidden"===document.visibilityState}),addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&ci()}),addEventListener("pagehide",()=>{ci()});const li=/bot|crawl|headless|curl|wget|python|spider|libwww-pearl|newrelic|datadog|sitebulb|site24x7/i;function di(){return!!li.test(navigator.userAgent)||!!(navigator.webdriver||document.__webdriver_evaluate||document.__selenium_evaluate||document.__webdriver_script_fn||document.__webdriver_script_func||document.__webdriver_script_function||document.$cdc_asdjflasutopfhvcZLmcfl_||document.$wdc_||window._Selenium_IDE_Recorder||window._phantom||window.__nightmare||window.callPhantom||window._phantom||window.__playwright__binding__||window.__pwInitScripts)}!function(){const{dataset:t}=document.currentScript;try{!function(t){if(ii?.destroy(),ii=null,Qr=t,ni=new ai(t),ri=null,ti=!1,ei=window.location.pathname,si.clear(),Nn(),Ln(),t.spaMode&&void 0===window.PerfKit&&(window.PerfKit={navigate:()=>{if(!Qr?.spaMode||!ni)return;const t=window.location.href;gr(t);const e=window.location.pathname;ei!==e?(ei=e,ii?.recordPageView(),ti?ni.info.url=t:(ci(),ni=new ai(Qr),si.clear(),Nn(),ti=!0)):ni.info.url=t},setPageType:t=>{Qr?.spaMode&&(Qr.storefrontData.pageType=t)},setConsent:t=>{ri=t}},document.addEventListener("shopify:page:view",t=>{window.PerfKit.navigate(),t.page?.url&&ni&&(ni.info.url=t.page.url),t.page?.template&&window.PerfKit.setPageType(t.page.template)},!0)),"headless"===t.storefrontData.application&&void 0===window.PerfKit&&(window.PerfKit={navigate:()=>{},setPageType:()=>{},setConsent:t=>{ri=t}}),t.shs){const e=t.shsCandidateSampleRate??0;ii=Cn({debug:!1,shopId:t.storefrontData.shopId,exportWithFetch:t.shsExportWithFetch??!0,beaconTextPlain:t.shsTextPlain??!1,logsSampleRate:t.shsLogsSampleRate,candidateSignalsEnabled:e>0,candidateSampleRate:e,...!1===t.shsCandidateActivePageFlush&&{candidateActivePageFlushEnabled:!1},...e>0&&void 0!==t.shsCandidateMask&&{candidateMask:t.shsCandidateMask},...t.shsBeaconEndpoint&&{beaconEndpoint:t.shsBeaconEndpoint}})}}(Vn(t))}catch(t){console.error("🚫 Error initializing PerfKit:",t.message)}}()}();