!function(){"use strict";var t,e,n=function(){var t=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart(e||100)-1)return n||o;if(n=n?o+">"+n:o,r.id)break;t=r.parentNode}}catch(t){}return n},a=-1,s=function(){return a},c=function(t){addEventListener("pageshow",(function(e){e.persisted&&(a=e.timeStamp,t(e))}),!0)},u=function(){var t=n();return t&&t.activationStart||0},d=function(t,e){var r=n(),i="navigate";return s()>=0?i="back-forward-cache":r&&(document.prerendering||u()>0?i="prerender":document.wasDiscarded?i="restore":r.type&&(i=r.type.replace(/_/g,"-"))),{name:t,value:void 0===e?-1:e,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},f=function(t,e,n){try{if(PerformanceObserver.supportedEntryTypes.includes(t)){var r=new PerformanceObserver((function(t){Promise.resolve().then((function(){e(t.getEntries())}))}));return r.observe(Object.assign({type:t,buffered:!0},n||{})),r}}catch(t){}},l=function(t,e,n,r){var i,o;return function(a){e.value>=0&&(a||r)&&((o=e.value-(i||0))||void 0===i)&&(i=e.value,e.delta=o,e.rating=function(t,e){return t>e[1]?"poor":t>e[0]?"needs-improvement":"good"}(e.value,n),t(e))}},p=function(t){requestAnimationFrame((function(){return requestAnimationFrame((function(){return t()}))}))},m=function(t){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&t()}))},g=function(t){var e=!1;return function(){e||(t(),e=!0)}},h=-1,v=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},S=function(t){"hidden"===document.visibilityState&&h>-1&&(h="visibilitychange"===t.type?t.timeStamp:0,T())},_=function(){addEventListener("visibilitychange",S,!0),addEventListener("prerenderingchange",S,!0)},T=function(){removeEventListener("visibilitychange",S,!0),removeEventListener("prerenderingchange",S,!0)},y=function(){return h<0&&(h=v(),_(),c((function(){setTimeout((function(){h=v(),_()}),0)}))),{get firstHiddenTime(){return h}}},E=function(t){document.prerendering?addEventListener("prerenderingchange",(function(){return t()}),!0):t()},C=[1800,3e3],w=function(t,e){e=e||{},E((function(){var n,r=y(),i=d("FCP"),o=f("paint",(function(t){t.forEach((function(t){"first-contentful-paint"===t.name&&(o.disconnect(),t.startTimee.latency){if(n)t.duration>n.latency?(n.entries=[t],n.latency=t.duration):t.duration===n.latency&&t.startTime===n.entries[0].startTime&&n.entries.push(t);else{var r={id:t.interactionId,latency:t.duration,entries:[t]};N.set(r.id,r),k.push(r)}k.sort((function(t,e){return e.latency-t.latency})),k.length>10&&k.splice(10).forEach((function(t){return N.delete(t.id)}))}}},B=function(t){var e=self.requestIdleCallback||self.setTimeout,n=-1;return t=g(t),"hidden"===document.visibilityState?t():(n=e(t),m(t)),n},F=[200,500],z=function(t,e){"PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&(e=e||{},E((function(){var n;R();var r,i=d("INP"),o=function(t){B((function(){t.forEach(O);var e=function(){var t=Math.min(k.length-1,Math.floor((x()-D)/50));return k[t]}();e&&e.latency!==i.value&&(i.value=e.latency,i.entries=e.entries,r())}))},a=f("event",o,{durationThreshold:null!==(n=e.durationThreshold)&&void 0!==n?n:40});r=l(t,i,F,e.reportAllChanges),a&&(a.observe({type:"first-input",buffered:!0}),m((function(){o(a.takeRecords()),r(!0)})),c((function(){D=x(),k.length=0,N.clear(),i=d("INP"),r=l(t,i,F,e.reportAllChanges)})))})))},q=[],j=[],H=0,U=new WeakMap,K=new Map,J=-1,Y=function(t){q=q.concat(t),G()},G=function(){J<0&&(J=B(V))},V=function(){K.size>10&&K.forEach((function(t,e){N.has(e)||K.delete(e)}));var t=k.map((function(t){return U.get(t.entries[0])})),e=j.length-50;j=j.filter((function(n,r){return r>=e||t.includes(n)}));for(var n=new Set,r=0;rH&&e>o||n.has(t)})),J=-1};P.push((function(t){t.interactionId&&t.target&&!K.has(t.interactionId)&&K.set(t.interactionId,t.target)}),(function(t){var e,n=t.startTime+t.duration;H=Math.max(H,t.processingEnd);for(var r=j.length-1;r>=0;r--){var i=j[r];if(Math.abs(n-i.renderTime)<=8){(e=i).startTime=Math.min(t.startTime,e.startTime),e.processingStart=Math.min(t.processingStart,e.processingStart),e.processingEnd=Math.max(t.processingEnd,e.processingEnd),e.entries.push(t);break}}e||(e={startTime:t.startTime,processingStart:t.processingStart,processingEnd:t.processingEnd,renderTime:n,entries:[t]},j.push(e)),(t.interactionId||"first-input"===t.entryType)&&U.set(t,e),G()}));var $=function(t,e){for(var n,r=[],i=0;n=q[i];i++)if(!(n.startTime+n.duratione)break;r.push(n)}return r},W=[2500,4e3],X={},Z=[800,1800],Q=function t(e){document.prerendering?E((function(){return t(e)})):"complete"!==document.readyState?addEventListener("load",(function(){return t(e)}),!0):setTimeout(e,0)},tt=function(t,e){e=e||{};var r=d("TTFB"),i=l(t,r,Z,e.reportAllChanges);Q((function(){var o=n();o&&(r.value=Math.max(o.responseStart-u(),0),r.entries=[o],i(!0),c((function(){r=d("TTFB",0),(i=l(t,r,Z,e.reportAllChanges))(!0)})))}))};const et="2.1",nt="3",rt={NO_VALUE:"",ACCEPTED:"1",DECLINED:"0"},it={PREFERENCES:"p",ANALYTICS:"a",MARKETING:"m",SALE_OF_DATA:"t"},ot={MARKETING:"m",ANALYTICS:"a",PREFERENCES:"p",SALE_OF_DATA:"s"};function at(t,e=!1){const n=document.cookie?document.cookie.split("; "):[];for(let e=0;et.charCodeAt(0).toString(16).padStart(2,"0"))).join("");c=[8,13,18,23].reduce(((t,e)=>t.slice(0,e)+"-"+t.slice(e)),t)}function u(t){const e=n.split(".")[0];return e.includes(t.toLowerCase())?rt.DECLINED:e.includes(t.toUpperCase())?rt.ACCEPTED:rt.NO_VALUE}function d(t){return n.includes(t.replace("t","s").toUpperCase())}return{v:nt,con:{CMP:{[ot.ANALYTICS]:u(ot.ANALYTICS),[ot.PREFERENCES]:u(ot.PREFERENCES),[ot.MARKETING]:u(ot.MARKETING),[ot.SALE_OF_DATA]:u(ot.SALE_OF_DATA)}},region:r||"",cus:s,purposes:{[it.ANALYTICS]:d(it.ANALYTICS),[it.PREFERENCES]:d(it.PREFERENCES),[it.MARKETING]:d(it.MARKETING),[it.SALE_OF_DATA]:d(it.SALE_OF_DATA)},sale_of_data_region:"t"==o,display_banner:"t"==i,consent_id:c}}(t);return}(t)}function ut(){return function(t){const e=ct();if(!e||!e.purposes)return!0;const n=e.purposes[t];return"boolean"!=typeof n||n}(it.ANALYTICS)}function dt(){return ut()}const ft=10;const lt=Object.freeze({shop_domain:`${window.location.origin}/.well-known/shopify/monorail/v1/produce`,global:"https://monorail-edge.shopifysvc.com/v1/produce",canada:"https://monorail-edge-ca.shopifycloud.com/v1/produce",staging:"https://monorail-edge-staging.shopifycloud.com/v1/produce"}),pt=new RegExp(`^${window.location.origin}/((?:(?:[a-z]{2,3}|zh-hans|zh-hant)(?:-[a-zA-Z0-9]+)/)?cart/(add|change|update|clear))`);var mt;function gt({monorailRegion:t,schema:e,rawData:n}){const r=Date.now(),i={schema_id:e,payload:e===mt.OnUnload?ht(n):vt(n),metadata:{event_created_at_ms:r,event_sent_at_ms:r}};try{const e=lt[t||""];if(!e)return void console.debug("📡 Monorail: ",JSON.stringify(i,null,2));if("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_")}()){const t=new XMLHttpRequest;t.open("POST",e),t.setRequestHeader("Content-type","text/plain"),t.send(JSON.stringify(i))}else{const t=new window.Blob([JSON.stringify(i)],{type:"text/plain"});window.navigator.sendBeacon(e,t)}}catch(t){}}function ht(t){const e=St(t,["domInteractive","domContentLoadedEventStart","domContentLoadedEventEnd","domComplete","firstPaint","visuallyReady","initiatorType","redirectCount","cartAjaxResourceTimings"]);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,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,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,other_metrics:JSON.stringify(e)}}function vt(t){const e=St(t,["longAnimationFrame"]);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,other_interaction_metrics:JSON.stringify(e)}}function St(t,e){return e.reduce(((e,n)=>{var r;return t[n]&&(e[(r=n,r.replace(/[A-Z]/g,(t=>`_${t.toLowerCase()}`)))]=t[n]||null),e}),{})}!function(t){t.OnInteraction="perf_kit_on_interaction/3.1",t.OnUnload="perf_kit_on_unload/3.2"}(mt||(mt={}));const _t="xxxx-4xxx-xxxx-xxxxxxxxxxxx";function Tt(){let t="";try{const e=window.crypto,n=new Uint16Array(31);e.getRandomValues(n);let r=0;t=_t.replace(/[x]/g,(t=>{const e=n[r]%16;return r++,("x"===t?e:3&e|8).toString(16)})).toUpperCase()}catch(e){t=_t.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}`}let yt=!0,Et=!1,Ct=null,wt=!1;class It{info;config;performanceMetrics;constructor(t){const e=/_shopify_s=([^;]*)/.exec(document.cookie),n=e?e[1]:void 0,r=/_shopify_y=([^;]*)/.exec(document.cookie),i=r?r[1]:void 0;this.config=t,this.info={perfKitInit:Date.now(),perfKitVersion:"1.4.0",url:window.location.href,referrer:document.referrer||void 0,microSessionId:Tt(),microSessionCount:0,sessionToken:n,uniqueToken:i},performance.setResourceTimingBufferSize(1e3),this.performanceMetrics=function(t){const e=performance.getEntriesByType("navigation");if(0===e.length)return{};const n=e[0];let r=!1;return(n.requestStart&&n.startTime&&n.requestStartt+864e5)&&(r=!0),{encodedBodySize:n.encodedBodySize,decodedBodySize:n.decodedBodySize,navigationStart:Math.round(n.startTime),navigationType:n.type,navigationBad:r,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:Math.round(n.domInteractive),domComplete:Math.round(n.domComplete),domContentLoadedEventStart:Math.round(n.domContentLoadedEventStart),domContentLoadedEventEnd:Math.round(n.domContentLoadedEventEnd),redirectCount:n.redirectCount,initiatorType:n.initiatorType,transferSize:n.transferSize}}(this.info.perfKitInit)}}const Mt=new Set;function bt(){if(null!==Ct){if(Lt()&&Mt.size>0){let t={};for(const e of Mt)t={...t,...e};Mt.clear(),Ct.info.microSessionCount+=1;const e=function(t){if(!(100*Math.random()>(t||ft)))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))}))}(Ct.config.resourceTimingSamplingRate),n=performance.getEntriesByType("resource").filter((t=>pt.test(t.name)));gt({monorailRegion:Ct.config.monorailRegion,schema:mt.OnUnload,rawData:{...Ct.info,...Ct.config.storefrontData,...Ct.performanceMetrics,...t,resourceTiming:e,cartAjaxResourceTimings:n,paintTimingHidden:wt}})}}else console.debug("⛔️ Shopify/perf-kit is not initialized")}function Lt(){return dt()}!function(t,e){!function(t,e){e=e||{},w(g((function(){var n,r=d("CLS",0),i=0,o=[],a=function(t){t.forEach((function(t){if(!t.hadRecentInput){var e=o[0],n=o[o.length-1];i&&t.startTime-n.startTime<1e3&&t.startTime-e.startTime<5e3?(i+=t.value,o.push(t)):(i=t.value,o=[t])}})),i>r.value&&(r.value=i,r.entries=o,n())},s=f("layout-shift",a);s&&(n=l(t,r,I,e.reportAllChanges),m((function(){a(s.takeRecords()),n(!0)})),c((function(){i=0,r=d("CLS",0),n=l(t,r,I,e.reportAllChanges),p((function(){return n()}))})),setTimeout(n,0))})))}((function(e){var n=function(t){var e,n={};if(t.entries.length){var i=t.entries.reduce((function(t,e){return t&&t.value>e.value?t:e}));if(i&&i.sources&&i.sources.length){var a=(e=i.sources).find((function(t){return t.node&&1===t.node.nodeType}))||e[0];a&&(n={largestShiftTarget:o(a.node),largestShiftTime:i.startTime,largestShiftValue:i.value,largestShiftSource:a,largestShiftEntry:i,loadState:r(i.startTime)})}}return Object.assign(t,{attribution:n})}(e);t(n)}),e)}((function(t){const{attribution:e,value:n}=t;Mt.add({cumulativeLayoutShift:n,cumulativeLayoutShiftTarget:e.largestShiftTarget})})),function(t,e){!function(t,e){e=e||{},E((function(){var n,r=y(),i=d("LCP"),o=function(t){e.reportAllChanges||(t=t.slice(-1)),t.forEach((function(t){t.startTime{(!u||t.duration>u.duration)&&(u=t)})),gt({monorailRegion:Ct.config.monorailRegion,schema:mt.OnInteraction,rawData:{...Ct.info,...Ct.config.storefrontData,...Ct.performanceMetrics,interactionToNextPaint:Math.round(n),interactionToNextPaintTarget:s,longAnimationFrame:{input_delay:Math.round(r),processing_duration:Math.round(i),presentation_delay:Math.round(o),...u?{slowest_script:u.sourceURL,slowest_script_duration:Math.round(u.duration)}:{}}}})}),{reportAllChanges:!0}),function(t,e){tt((function(e){var n=function(t){var e={waitingDuration:0,cacheDuration:0,dnsDuration:0,connectionDuration:0,requestDuration:0};if(t.entries.length){var 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)}),e)}((function(t){const{value:e}=t;Mt.add({timeToFirstByte:Math.round(e)})})),addEventListener("DOMContentLoaded",(()=>{wt="hidden"===document.visibilityState})),addEventListener("visibilitychange",(()=>{"hidden"===document.visibilityState&&bt()})),function(){const{dataset:t}=document.currentScript;try{e=function(t){if(!t.application)throw new Error("Application is missing");if(!["storefront-renderer","hydrogen"].includes(t.application.toLowerCase()))throw new Error("Invalid application type");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","humannessScore","themeInstanceId","storefrontId"])if(t[e]&&isNaN(Number(t[e])))throw new Error(`Invalid ${e}`);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)100))throw new Error("Invalid resource timing sampling rate");return{storefrontData:{application:t.application.toLowerCase(),shopId:Number(t.shopId),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},monorailRegion:t.monorailRegion,resourceTimingSamplingRate:Number(t.resourceTimingSamplingRate)||void 0,spaMode:"true"===t.spaMode}}(t),Ct=new It(e),e.spaMode&&(window.PerfKit={navigate:()=>{yt?yt=!1:Et||(bt(),Ct=new It(e),Et=!0)},setPageType:t=>{e.storefrontData.pageType=t}})}catch(t){console.error("🚫 Error initializing PerfKit:",t.message)}var e}()}();