@occluze/tether 0.8.1 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/dist/esm/astro.js +1 -1
- package/dist/esm/chunks/account-FKLGF264.js +1 -0
- package/dist/esm/chunks/{account-pages-XR6QZ3DX.js → account-pages-PNORWX72.js} +1 -1
- package/dist/esm/chunks/analytics-V24XX2J7.js +1 -0
- package/dist/esm/chunks/{chunk-FPJGQ7Z5.js → chunk-2IHA3PVC.js} +1 -1
- package/dist/esm/chunks/chunk-2LYWZ72A.js +1 -0
- package/dist/esm/chunks/{chunk-A2PCQK2F.js → chunk-2NV5PSJ2.js} +1 -1
- package/dist/esm/chunks/chunk-2X5U24IC.js +1 -0
- package/dist/esm/chunks/chunk-5B36ISJF.js +1 -0
- package/dist/esm/chunks/chunk-6WE7XCHH.js +1 -0
- package/dist/esm/chunks/chunk-6ZIOAYKF.js +1 -0
- package/dist/esm/chunks/{chunk-FM7ZLLVP.js → chunk-CR5IGHCO.js} +1 -1
- package/dist/esm/chunks/{chunk-X2JZPXLF.js → chunk-E3JL6WS3.js} +1 -1
- package/dist/esm/chunks/{chunk-COQ6ATC6.js → chunk-F5CLIGSC.js} +1 -1
- package/dist/esm/chunks/{chunk-HXZSNZOV.js → chunk-GOKJQGLG.js} +1 -1
- package/dist/esm/chunks/chunk-RW23CJDZ.js +1 -0
- package/dist/esm/chunks/chunk-TW34GYSL.js +1 -0
- package/dist/esm/chunks/chunk-VKKKH75V.js +1 -0
- package/dist/esm/chunks/{chunk-A3GXCQJ4.js → chunk-YWQWLKFW.js} +1 -1
- package/dist/esm/chunks/chunk-YYNBHXQF.js +1 -0
- package/dist/esm/chunks/{diagnose-IFRNCEYG.js → diagnose-3RTKEBNW.js} +1 -1
- package/dist/esm/chunks/extras-O54VUXK6.js +1 -0
- package/dist/esm/chunks/lists-MRTI5RXY.js +1 -0
- package/dist/esm/chunks/markets-ui-P7G33T6Y.js +1 -0
- package/dist/esm/chunks/search-YSRDFVD7.js +1 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/server.js +2 -2
- package/dist/tether.account-pages.js +2 -2
- package/dist/tether.account-pages.min.js +1 -1
- package/dist/tether.account.js +2 -2
- package/dist/tether.account.min.js +1 -1
- package/dist/tether.analytics.js +2 -2
- package/dist/tether.analytics.min.js +1 -1
- package/dist/tether.diagnose.js +4 -4
- package/dist/tether.diagnose.min.js +2 -2
- package/dist/tether.extras.js +1 -1
- package/dist/tether.extras.min.js +1 -1
- package/dist/tether.js +75 -200
- package/dist/tether.lists.js +268 -0
- package/dist/tether.lists.min.js +1 -0
- package/dist/tether.markets.js +3 -3
- package/dist/tether.markets.min.js +1 -1
- package/dist/tether.min.js +1 -1
- package/dist/tether.min.js.map +4 -4
- package/dist/tether.search.js +2 -2
- package/dist/tether.search.min.js +1 -1
- package/dist/types/src/client.d.ts +6 -6
- package/dist/types/src/collection.d.ts +7 -23
- package/dist/types/src/config-sections.d.ts +7 -0
- package/dist/types/src/config.d.ts +6 -0
- package/dist/types/src/index.d.ts +4 -3
- package/dist/types/src/lazy.d.ts +1 -0
- package/dist/types/src/lists.d.ts +20 -0
- package/dist/types/src/loader.d.ts +7 -27
- package/dist/types/src/mounting.d.ts +1 -6
- package/dist/types/src/product-shape.d.ts +13 -36
- package/dist/types/src/server.d.ts +5 -4
- package/dist/types/src/shopify-values.d.ts +6 -0
- package/dist/types/src/storefront/catalog.d.ts +2 -4
- package/dist/types/src/version.d.ts +1 -1
- package/package.json +5 -5
- package/dist/esm/chunks/account-BS5MCC2R.js +0 -1
- package/dist/esm/chunks/analytics-BYN3QHBA.js +0 -1
- package/dist/esm/chunks/chunk-2IVIZDT5.js +0 -1
- package/dist/esm/chunks/chunk-EGIDFV3T.js +0 -1
- package/dist/esm/chunks/chunk-EW3GKRT4.js +0 -1
- package/dist/esm/chunks/chunk-GXCCTPDF.js +0 -1
- package/dist/esm/chunks/chunk-MJFKAMFM.js +0 -1
- package/dist/esm/chunks/chunk-TE5PNI76.js +0 -1
- package/dist/esm/chunks/extras-3477M6Y7.js +0 -1
- package/dist/esm/chunks/markets-ui-3L2UZ7PK.js +0 -1
- package/dist/esm/chunks/search-YR73GIWY.js +0 -1
package/dist/tether.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(()=>{var Gn=Object.defineProperty;var xi=(t,e,n)=>e in t?Gn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Li=(t,e)=>{for(var n in e)Gn(t,n,{get:e[n],enumerable:!0})};var T=(t,e,n)=>xi(t,typeof e!="symbol"?e+"":e,n);var Kn="2026-07";var Ii=/^(\d{4})-(01|04|07|10)$/;function Oi(t){let e=Ii.exec(typeof t=="string"?t:"");return e?{year:Number(e[1]),month:Number(e[2])}:null}var Qn=t=>Oi(t)!==null;function C(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function tt(t,e){return C(t)?t[e]:void 0}var Mi=/^[A-Za-z0-9_.-]+$/,Ri=/^(\$app(:[A-Za-z0-9_-]+)?|[A-Za-z0-9_.-]+)$/,Ni=/^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i,$i=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,_i=/^[A-Za-z_$][\w$]*$/,Wn="https://site.invalid",Ui=new Set(["localhost","127.0.0.1","[::1]"]),Kt=["saved","server","webflow"],Fi=["no-banner","default-banner","custom-banner"],Qt=t=>typeof t=="string"&&t!=="",Di=t=>typeof t=="function";function Yn(t,e){if(typeof t!="string"||!t)return"";let n=t.replace(/^https?:\/\//,"").replace(/\/.*$/,"");return qi(n)?n:(e("domain",t),"")}function zn(t){if(!Qt(t))return!1;try{let e=new URL(t,`${Wn}/`);return e.origin===Wn?!0:e.protocol==="https:"||e.protocol==="http:"&&Ui.has(e.hostname)}catch{return!1}}function Jn(t,e){return t==null||t===""?null:typeof t=="string"&&(zn(t)||Vi(t))?t:(e("partsUrl",t),null)}function Vi(t){if(typeof location>"u")return!1;try{return new URL(t).origin===location.origin}catch{return!1}}function Hi(t){if(typeof t!="string")return null;try{let e=new URL(t);return e.protocol==="https:"&&e.href===new URL(e.origin).href?e.origin:null}catch{return null}}function Xn(t,e){if(!Array.isArray(t))return e("embedOrigins",t),[];let n=[],r=t;for(let o of r){let i=Hi(o);i?n.push(i):e("embedOrigin",o)}return n}function Be(t){let e,n;if(typeof t=="string"){let r=t.indexOf(".");e=r>0?t.slice(0,r):"",n=t.slice(r+1)}else typeof t=="object"&&t!==null&&(e=Reflect.get(t,"namespace"),n=Reflect.get(t,"key"));return typeof e!="string"||typeof n!="string"?null:Ri.test(e)&&Mi.test(n)?{namespace:e,key:n}:null}function Zn(t,e){if(!Array.isArray(t))return e("metafields",t),[];let n=[],r=t;for(let o of r){let i=Be(o);i?n.push(typeof o=="string"?o:i):e("metafield",o)}return n}var It=t=>e=>t(e)?e:void 0,qi=t=>Qt(t)&&Ni.test(t),ji=t=>Qt(t)&&$i.test(t),Gi=t=>typeof t=="boolean"||Qt(t)&&_i.test(t),Gt=It(zn),de=It(Qt),Bn=It(t=>typeof t=="boolean"),tr=It(Di);function Wt(t,e,n,r){if(e==null)return null;if(!C(e))return r(t,e),null;let o={};for(let i in n){let s=e[i];if(s===void 0)continue;let u=n[i](s);u===void 0?r(`${t}.${i}`,s):o[i]=u}return o}var Ki={server:Gt,orderUrl:Gt,subscriptionsUrl:Gt,paymentUrl:Gt,logoutUrl:Gt,locale:de,navigate:tr},Qi="customer accounts need the Worker since 0.7.0: set account.server",Wi={country:de,language:de,locale:de},Bi={detect:t=>{if(typeof t=="boolean")return t;let e=Array.isArray(t)?t:[t];return typeof t=="string"||Array.isArray(t)?Kt.filter(n=>e.includes(n)):void 0},locales:t=>{if(!C(t))return;let e={};for(let[n,r]of Object.entries(t)){let o=Wt(`markets.locales.${n}`,r,Wi,()=>{});o&&(e[n]=o)}return e},cookie:It(ji),remember:Bn,strict:Bn},Yi={consent:t=>Fi.find(e=>e===t),proxy:t=>t!==void 0&&!!t},zi={dataLayer:It(Gi),shopify:t=>typeof t=="boolean"?t:Wt("analytics.shopify",t,Yi,()=>{})??void 0,onEvent:tr};function er(t,e,n){let r=Wt("account",t,Ki,e);if(r===null)return null;let{server:o}=r;return o===void 0?(n(Qi),null):{...r,server:o}}var Ye=(t,e)=>Wt("markets",t,Bi,e),nr=(t,e)=>Wt("analytics",t,zi,e);var Ji=/^[A-Z]{2}$/,Xi=new Set(["XX","T1"]),Zi=new Set(["PT_BR","PT_PT","ZH_CN","ZH_TW"]),ts=/^[A-Z]{2,3}$/;function U(t){let e=(typeof t=="string"?t:"").trim().toUpperCase();return!Ji.test(e)||Xi.has(e)?null:e}function F(t){let e=(typeof t=="string"?t:"").trim().replace("-","_").toUpperCase();if(Zi.has(e))return e;let n=e.split("_")[0]??"";return ts.test(n)?n:null}var at={domain:"",token:"",apiVersion:Kn,country:void 0,language:void 0,locale:void 0,markets:null,prefix:"tether",productPath:"/product",collectionPath:"/collection",metafields:[],embedOrigins:[],imagesFirst:25,variantsFirst:100,sellingPlanGroupsFirst:10,sellingPlansFirst:25,collectionFirst:24,retries:2,revalidate:!0,storageKey:"",cartDrawerOpenClass:"is-open",openCartOnAdd:!0,cartFocus:!0,checkoutTarget:"_self",defaultPurchase:"one-time",variantUrl:!1,maxAge:60,lowStock:5,searchDelay:150,autoMount:!0,observe:!1,astro:!0,partsUrl:null,analytics:null,account:null,warningText:null,formatMoney:null,onLayoutChange:null,onCartOpen:null,onCartClose:null,onLineEnter:null,onLineLeave:null,onValueChange:null,onError:null,debug:!1},a={...at};function ir(t){let e=n=>(v(`Tether.config is read-only (${String(n)}): pass options to Tether.init() instead`),!1);return new Proxy(t,{get(n,r){let o=Reflect.get(n,r);return typeof o=="object"&&o!==null?ir(o):o},set:(n,r)=>e(r),deleteProperty:(n,r)=>e(r),defineProperty:(n,r)=>e(r)})}var sr=ir(a),es=/^[a-z][a-z0-9-]*$/,ns=["revalidate","openCartOnAdd","cartFocus","variantUrl","autoMount","observe","astro","debug"],rs=["token","productPath","collectionPath","cartDrawerOpenClass"],os=["imagesFirst","variantsFirst","sellingPlanGroupsFirst","sellingPlansFirst","collectionFirst","retries","maxAge","lowStock","searchDelay"],is=["warningText","formatMoney","onLayoutChange","onCartOpen","onCartClose","onLineEnter","onLineLeave","onValueChange","onError"];function Ot(t,e,n){return e!==void 0&&v(`invalid ${t} ${JSON.stringify(e)}: using ${JSON.stringify(n)}`),n}function K(t,e){v(`invalid ${t} ${JSON.stringify(e)}: ignored`)}function ss(t){for(let e of Object.keys(t))e in at||v(`unknown option ${JSON.stringify(e)}: ignored`)}function as(t,e,n){typeof n=="function"?t[e]=n:n!=null&&K(e,n)}function us(t,e){return typeof e=="number"&&Number.isInteger(e)&&e>=0?e:Ot(t,e,at[t])}function cs(t,e){return typeof e=="boolean"?e:Ot(t,e,at[t])}function ls(t,e){return typeof e=="string"?e:Ot(t,e,at[t])}function ds(t){if(!(t==null||t==="")){try{if(typeof t=="string"&&Intl.getCanonicalLocales(t).length)return t}catch{}K("locale",t)}}function rr(t,e,n){return n.find(r=>r===e)??Ot(t,e,n[0])}function ps(t){return t==="unstable"?(v('apiVersion "unstable" changes without notice. Pin a dated version (e.g. 2026-07).'),t):Qn(t)?t:Ot("apiVersion",t,at.apiVersion)}function or(t,e,n){if(e==null||e==="")return;let r=n(e);if(r!==null)return r;K(t,e)}function fs(t){ss(t);let e=Yn(t.domain,K),n=typeof t.prefix=="string"&&es.test(t.prefix)?t.prefix:Ot("prefix",t.prefix,at.prefix),r={...at,domain:e,apiVersion:ps(t.apiVersion),country:or("country",t.country,U),locale:ds(t.locale),partsUrl:Jn(t.partsUrl,K),language:or("language",t.language,F),markets:Ye(t.markets,K),analytics:nr(t.analytics,K),account:er(t.account,K,v),prefix:n,storageKey:typeof t.storageKey=="string"&&t.storageKey?t.storageKey:`${n}:cart:${e}`,metafields:Zn(t.metafields??[],K),embedOrigins:Xn(t.embedOrigins??[],K),checkoutTarget:rr("checkoutTarget",t.checkoutTarget,["_self","_blank"]),defaultPurchase:rr("defaultPurchase",t.defaultPurchase,["one-time","subscription"])};for(let o of os)r[o]=us(o,t[o]);for(let o of ns)r[o]=cs(o,t[o]);for(let o of rs)r[o]=ls(o,t[o]);for(let o of is)as(r,o,t[o]);return r}var ze=t=>Ye(t,K);function ar(t={}){let e=fs(t);for(let n of Object.keys(a))n in e||Reflect.deleteProperty(a,n);return Object.assign(a,e)}var Mt=()=>!!(a.domain&&a.token);function L(...t){a.debug&&console.log(`[${a.prefix}]`,...t)}function v(...t){console.warn(`[${a.prefix}]`,...t)}function f(t,e){if(v(e,t instanceof Error&&t.message?t.message:t),!!a.onError)try{a.onError(t,e)}catch(n){v("onError threw",n)}}function ur(t){return t instanceof Error?t.message:String(t)}var b=class extends Error{constructor(n,{status:r,errors:o,userErrors:i,code:s}={}){super(n);T(this,"name","TetherError");T(this,"code");T(this,"status");T(this,"errors");T(this,"userErrors");this.code=s??(r?`HTTP_${r}`:"ERROR"),this.status=r,this.errors=o,this.userErrors=i}};function et(t,e){return typeof e=="function"?e(t):typeof e=="string"?e==="object"?C(t):typeof t===e:ms(e)?Array.isArray(t)&&t.every(n=>et(n,e[0])):C(t)&&Object.entries(e).every(([n,r])=>r===void 0||et(t[n],r))}var ms=t=>Array.isArray(t),D=t=>e=>e===null||et(e,t),z=t=>e=>et(e,t);function Ze(t=a){return`https://${t.domain}/api/${t.apiVersion}/graphql.json`}var fr=/"(?:\\.|[^"\\\n])*"|#[^\n]*/g,gs=/^\s*(?:query|mutation)(?:\s+\w+)?\s*(?:\([^)]*\))?/;function hs(t){return/\bmutation\b/.test(t.replace(fr,""))?"mutation":"query"}function mr(t,{country:e,language:n}){let r=[];if(e&&r.push(`country: ${e}`),n&&r.push(`language: ${n}`),!r.length)return t;let o=`@inContext(${r.join(", ")})`,i=t.replace(fr,d=>" ".repeat(d.length)),s=i.indexOf("{");if(i.slice(0,s).includes("@inContext"))return t;if(i.trimStart().startsWith("{"))return`query ${o} ${t.slice(s)}`;let u=gs.exec(i);if(!u)return t;let l=u[0].length;return`${t.slice(0,l).trimEnd()} ${o} ${t.slice(l).trimStart()}`}function gr(t,e=a){let n=U(e.country)??void 0,r=F(e.language)??void 0;return mr(t,{country:n,language:r})}var tn=300,ys=500,cr=430,bs=1e3,Xe="quantityAvailable",lr=new Set,Ps=t=>`${t.domain} ${t.apiVersion} ${t.token}`;function Es(t,e,n,{context:r,operation:o}){let i=typeof e=="string"?e:e(n),s=r?mr(i,t):i;return t.maxAge<=0||o==="mutation"?s:`${s} #${Math.floor(Date.now()/(t.maxAge*bs))}`}var ws=t=>new Promise(e=>setTimeout(e,t));function en(t,e){if(t===401||t===403){let n=e.token.startsWith("shpat_")?", not an Admin API token (shpat_\u2026)":"";return`Shopify rejected the Storefront token for ${e.domain} (${t}): use the public Storefront API token (Headless channel)${n}`}return t===404?`Store or API version not found (404): check domain ${e.domain} and apiVersion ${e.apiVersion}`:`HTTP ${t} from ${e.domain}`}function Ss(t){let e=tt(t,"message"),n=tt(tt(t,"extensions"),"code"),r=typeof e=="string"?e:"";return typeof n=="string"?{message:r,extensions:{code:n}}:{message:r}}function Cs(t){if(!C(t))return null;let{data:e,errors:n}=t;return n==null?{data:e}:Array.isArray(n)?{data:e,errors:n.map(Ss)}:null}function Je(t,e){return t.ok?new b(`Invalid response (${t.status})`,{code:"INVALID_RESPONSE",status:t.status}):new b(en(t.status,e),{status:t.status})}function dr(t,e,n,r){let o=e.map(s=>s.message).filter(Boolean).join(" | "),i=o||"Storefront API error";return t.ok||(i=t.status===401||t.status===403||!o?en(t.status,n):o),new b(i,{status:t.status,errors:e,code:r})}function pr(t,e){if(e==="any")return{kind:"retry",backoffMs:tn};throw new b(`Network error: ${ur(t)}`,{code:"NETWORK"})}function ks(t,e,n,r,o,i,s){if(n.includes(Xe)&&r.some(g=>g.message.includes(Xe)))return{kind:"inventory-refused",error:dr(t,r,e)};let u=r.map(g=>g.extensions?.code);if(i!=="none"&&u.includes("THROTTLED"))return{kind:"retry",backoffMs:ys};let l=u.includes("INTERNAL_SERVER_ERROR");if(i==="any"&&l)return{kind:"retry",backoffMs:tn};let d=t.ok&&(l||s==="mutation"&&o==null);throw dr(t,r,e,d?"SERVER_ERROR":void 0)}async function Ts(t,e,n,r,o,i){let s;try{s=await(t.fetch??fetch)(Ze(t),{method:"POST",headers:{"Content-Type":"application/json","X-Shopify-Storefront-Access-Token":t.token},body:JSON.stringify({query:e,variables:n})})}catch(k){return pr(k,o)}if(s.status===cr)throw new b("Shopify security rejection (430)",{status:cr});if(o!=="none"&&s.status===429||o==="any"&&s.status>=500)return{kind:"retry",backoffMs:tn};let u;try{u=await s.json()}catch(k){if(k instanceof SyntaxError)throw Je(s,t);return pr(k,o)}let l=Cs(u);if(!l)throw Je(s,t);let{data:d,errors:g=[]}=l;if(g.length)return ks(s,t,e,g,d,o,i);if(!s.ok)throw new b(en(s.status,t),{status:s.status});if(!r(d))throw Je(s,t);return{kind:"data",data:d}}async function hr(t,e,n,r,{context:o=!0,operation:i="query"}={}){if(!t.domain||!t.token)throw new b("Tether is not configured: domain and token are required",{code:"NOT_CONFIGURED"});let s=Ps(t),u=i==="mutation"?"not-run":"any",l=0;for(;;){let d={inventory:!lr.has(s)},g=Es(t,e,d,{context:o,operation:i}),k=l<t.retries?u:"none",N=await Ts(t,g,n,r,k,i);switch(N.kind){case"data":return N.data;case"inventory-refused":if(typeof e=="string"||!d.inventory)throw N.error;L(`the token can't read inventory: ${Xe} is left out from now on`),lr.add(s);break;case"retry":l+=1,L("retry",l),await ws(N.backoffMs*2**l);break}}}function Q(t,e,n,r){return hr(a,t,e,n,r)}var vs=t=>typeof t=="object"&&t!==null;function As(t,e,n={},r){return hr(t,e,n,vs,{...r,operation:hs(e)})}function yr(t,e,n){return As(a,t,e,n)}function br(t,e){if(!t)throw new b(`${e}: empty response`);let n=t.userErrors??[];if(n.length)throw new b(n.map(r=>r.message).join(" | "),{userErrors:n});return t}var m=t=>`${a.prefix}-${t}`,c=(t,e)=>e===void 0?`[${m(t)}]`:`[${m(t)}="${e}"]`,p=(t,e)=>t.getAttribute(m(e)),V=(t,e)=>t.hasAttribute(m(e));function y(t,e){return t?[...t.querySelectorAll(e)]:[]}var ut=(t,e,n)=>y(t,e).filter(r=>r.closest(n)===t),Bt=["product-ready","list-ready","cart-updated","cart-toggled","checkout","search"],Pr=new WeakMap;function Er(t,e){let n=new CustomEvent(`${a.prefix}:${t}`,{detail:e,bubbles:!0});return Pr.set(n,t),n}function ct(t,e){return Pr.get(t)===e}function h(t,e,n=document){n.dispatchEvent(Er(t,e))}var xs="http://www.w3.org/1999/xhtml",Ls=new Set(["h1","h2","h3","h4","h5","h6","p","span","div","br","hr","blockquote","code","pre","strong","em","b","i","u","s","small","sub","sup","ul","ol","li","dl","dt","dd","table","caption","colgroup","col","thead","tbody","tfoot","tr","th","td","a","img","picture","source","video","figure","figcaption","iframe"]),Is=new Set(["script","style","template","noscript","textarea","select","title"]),Os=new Set(["style","title","lang","dir","role","align","width","height"]),Ms=new Map([["a",new Set(["href","target","rel","hreflang"])],["img",new Set(["src","srcset","sizes","alt","loading","decoding"])],["source",new Set(["src","srcset","sizes","type","media"])],["video",new Set(["src","poster","controls","autoplay","muted","loop","playsinline","preload"])],["iframe",new Set(["src","allow","allowfullscreen","frameborder","loading"])],["blockquote",new Set(["cite"])],["ol",new Set(["start","type","reversed"])],["li",new Set(["value"])],["table",new Set(["border","cellpadding","cellspacing","summary"])],["col",new Set(["span"])],["colgroup",new Set(["span"])],["th",new Set(["colspan","rowspan","headers","scope","valign"])],["td",new Set(["colspan","rowspan","headers","valign"])]]),Rs=new Set(["href","src","poster","cite"]),Ns=/^(javascript|vbscript|data):/i,$s=/^data:image\/(png|gif|jpeg|webp|avif);/i,_s=new Set(["position","top","right","bottom","left","z-index","-webkit-box-reflect"]),Us=["inset","transform","translate","rotate","scale","offset"],Fs=/\d(?:[sld]?v|cq)(?:w|h|i|b|min|max)\b/i,Ds=/^(?:outline|box-shadow|text-shadow|filter|text-decoration|text-underline-offset|text-stroke)|^(?:border-image|mask-border|mask-box-image)(?:-outset)?$/,wr=40,Vs=new Map([["letter-spacing",{px:4,em:.25}],["word-spacing",{px:4,em:.25}],["text-indent",{px:wr}]]),Sr=/(?<![\w#.-])[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?(%|[a-z]+)?/gi,Hs=/(?<![\w-])(?!drop-shadow\(|blur\()[\w-]+\([^()]*\)/g,Cr=/(?:var|calc|min|max|clamp|env|attr)\(/i,qs=/url\(|expression\(|@import/i,js=/[\u0000- ]/g,Gs="allow-scripts allow-same-origin allow-popups allow-presentation",Ks=new Set(["autoplay","encrypted-media","picture-in-picture","fullscreen","clipboard-write","accelerometer","gyroscope","web-share"]),Qs="strict-origin-when-cross-origin",Ws=["https://www.youtube.com","https://www.youtube-nocookie.com","https://player.vimeo.com","https://www.loom.com","https://fast.wistia.net"];function Bs(t,e){return Os.has(e)||e.startsWith("aria-")||(Ms.get(t)?.has(e)??!1)}function Ys(t,e,n){let r=n.replace(js,"");return Ns.test(r)?t==="img"&&e==="src"&&$s.test(r):!0}function kr(t,e){try{return new URL(t,e)}catch{return null}}function zs(t,e,n){let r=t.baseURI,o=kr(r)?.origin??"null";return{origin:o==="null"?null:o,baseUrl:r,styleParser:e,embedOrigins:new Set([...Ws,...n])}}function Js(t,e){let n=kr(t.trim(),e.baseUrl);return n!==null&&n.origin!==e.origin&&e.embedOrigins.has(n.origin)}function Xs(t){let e=t.split(";").map(n=>n.trim().split(/\s+/)[0]?.toLowerCase()??"");return[...new Set(e.filter(n=>Ks.has(n)))].join("; ")}function Zs(t,e){if(_s.has(t)||Us.some(r=>t.startsWith(r))||Fs.test(e))return!0;let n=Vs.get(t);return n?Cr.test(e)||ta(e,n):t.startsWith("margin")&&e.includes("-")}function ta(t,e){return[...t.matchAll(Sr)].some(([n="",r=""])=>{let o=parseFloat(n);if(o>=0)return!1;let i=e[r.toLowerCase()];return i===void 0||-o>i})}function ea(t,e){return Ds.test(t.replace(/^-webkit-/,""))?Cr.test(e)?!0:[...e.replace(Hs,"").matchAll(Sr)].some(([n="",r=""])=>{let o=Math.abs(parseFloat(n));return o!==0&&(r.toLowerCase()!=="px"||o>wr)}):!1}function na(t,e){let n=e.style;n.cssText=t;let r=Array.from({length:n.length},(i,s)=>n.item(s));for(let i of r){let s=n.getPropertyValue(i);(Zs(i,s)||ea(i,s)||qs.test(s))&&n.removeProperty(i)}let o=n.cssText;return e.removeAttribute("style"),o}function ra(t,e){let n=t.localName;for(let i of[...t.attributes]){let s=i.name.toLowerCase(),u=Rs.has(s);Bs(n,s)&&(!u||Ys(n,s,i.value))||t.removeAttribute(i.name)}let r=t.getAttribute("style");if(r===null)return;let o=na(r,e.styleParser);o===""?t.removeAttribute("style"):t.setAttribute("style",o)}function oa(t){if(t.localName==="iframe"){let n=Xs(t.getAttribute("allow")??"");n===""?t.removeAttribute("allow"):t.setAttribute("allow",n),t.setAttribute("sandbox",Gs),t.setAttribute("referrerpolicy",Qs);return}if(t.localName!=="a"||t.getAttribute("target")?.toLowerCase()!=="_blank")return;let e=new Set((t.getAttribute("rel")??"").split(/\s+/).filter(Boolean));e.add("noopener"),e.add("noreferrer"),t.setAttribute("rel",[...e].join(" "))}function ia(t,e){let n=t.localName,r=t.namespaceURI===xs;if(r&&Is.has(n)){t.remove();return}if(!r||!Ls.has(n)){t.replaceWith(...t.childNodes);return}if(n==="iframe"&&!Js(t.getAttribute("src")??"",e)){t.remove();return}ra(t,e),oa(t)}function Tr(t,e=globalThis.document,n=[]){let r=e.createElement("template");r.innerHTML=t??"";let o=zs(e,r,n);for(let i of[...r.content.querySelectorAll("*")])ia(i,o);return r.content}function pe(t){if(typeof t!="string")return!1;try{return new URL(t).protocol==="https:"}catch{return!1}}function vr(t,e){if(!t)return"";let n=parseFloat(t.amount);if(Number.isNaN(n))return"";try{return new Intl.NumberFormat(e||void 0,{style:"currency",currency:t.currencyCode}).format(n)}catch{return`${t.currencyCode} ${n.toFixed(2)}`}}function Ar(t,e,n){if(!/\{(handle|id)\}/.test(t))return e?`${t.replace(/\/$/,"")}/${encodeURIComponent(e)}`:null;let r=n?n.split("/").at(-1)??"":"";return t.includes("{handle}")&&!e||t.includes("{id}")&&!r?null:t.replace(/\{handle\}/g,encodeURIComponent(e??"")).replace(/\{id\}/g,encodeURIComponent(r))}function xr(t){let e=String(t??"").trim();return e?e.startsWith("gid://")?e:/^\d+$/.test(e)?`gid://shopify/Product/${e}`:/\/products\/([^/?#]+)/.exec(e)?.[1]??e:null}function fe(t,{width:e,height:n,crop:r}={}){if(!t)return t;let o;try{o=new URL(t)}catch(i){if(i instanceof TypeError)return t;throw i}return e&&o.searchParams.set("width",String(e)),n&&o.searchParams.set("height",String(n)),r&&o.searchParams.set("crop",r),o.toString()}function nn(t,e){return t.getAttribute(e)??t.getAttribute(m(e))??t.getAttribute(`data-${e}`)}function Ir(t,e){if(!t||!e)return t;let n=nn(e,"max-width"),r=nn(e,"max-height");return fe(t,{width:n,height:r,crop:n||r?nn(e,"crop"):null})}var Lr=t=>t.replace(/\?.*$/,"");function me(t,e){return!t||!e?!1:Lr(t)===Lr(e)}function sa(t){return/^\s*[a-z][a-z0-9+.-]*:/i.test(t)&&!/^\s*(https?:|data:image\/)/i.test(t)?"none":`url("${t.replace(/["\\\n\r\f]/g,r=>`\\${r.charCodeAt(0).toString(16)} `)}")`}function O(t,e,n){if(!e)return;let r=Ir(e,t);if(t.tagName!=="IMG"){t.style.backgroundImage=sa(r);return}if(me(t.getAttribute("src"),r)){n!=null&&!t.getAttribute("alt")&&t.setAttribute("alt",n);return}t.removeAttribute("srcset"),t.removeAttribute("sizes"),t.setAttribute("src",r),n!=null&&t.setAttribute("alt",n),t.getAttribute("loading")||t.setAttribute("loading","lazy")}var rn=new WeakMap,Yt=t=>!!rn.get(t),on=t=>t.cloneNode(!0);function Or(t){let e=rn.get(t);if(e!==void 0)return e;let n=t.firstElementChild,r=n?on(n):null;return rn.set(t,r),t.replaceChildren(),r}function H(t,e,n){let r=Or(t);if(!r){e.length&&v("repeater without a template child",t);return}t.replaceChildren(),e.forEach((o,i)=>{let s=on(r);n(s,o,i),t.appendChild(s)})}function aa(t,e){let n=()=>{t.remove()};if(!e){n();return}try{e(t,n)}catch(r){f(r,"repeater onLeave"),n()}}function ua(t,e,n,r){e.forEach((o,i)=>{if(!n.has(o))return;let s=e[i-1];if(s?.parentNode===t?s.after(o):t.prepend(o),!!r)try{r(o)}catch(u){f(u,"repeater onEnter")}})}function sn(t,e,n,r,{onEnter:o,onLeave:i}={}){let s=Or(t);if(!s){v("repeater without a template child",t);return}let u=`data-${a.prefix}-key`,l=`data-${a.prefix}-leaving`,d=()=>[...t.children].filter(S=>S.hasAttribute(u)&&!S.hasAttribute(l)),g=new Map(d().map(S=>[S.getAttribute(u),S])),k=[],N=new Set;e.forEach((S,le)=>{let We=String(n(S,le)),Et=g.get(We);Et?g.delete(We):(Et=on(s),Et.setAttribute(u,We),N.add(Et)),r(Et,S,le,N.has(Et)),k.push(Et)});let G=k.filter(S=>!N.has(S)),jn=d().filter(S=>G.includes(S));if(!(jn.length===G.length&&jn.every((S,le)=>S===G[le]))){g.forEach(S=>{S.remove()}),k.forEach(S=>t.appendChild(S));return}ua(t,k,N,o),g.forEach(S=>{S.setAttribute(l,""),S.removeAttribute(u),S.style.pointerEvents="none",S.inert=!0,aa(S,i)})}var Mr="data-tether-seen",un="data-tether-shown",ge="data-tether-prev-display",ca=120;function Rt(t,e){return Ar(a.productPath||"/product",t,e)}function _r(t,e){try{return t()}catch(n){if(n instanceof RangeError)return e;throw n}}function Ur(t,e=a.locale){return t?_r(()=>new Intl.NumberFormat(e||void 0,{style:"percent",maximumFractionDigits:0}).format(t/100),`${t}%`):""}function M(t){return t?a.formatMoney?a.formatMoney(t,a.locale):vr(t,a.locale):""}function he(t){return t?_r(()=>new Date(t).toLocaleDateString(a.locale||void 0),""):""}function ye(t,e){t.replaceChildren(Tr(e,t.ownerDocument,a.embedOrigins))}var Fr=t=>t.tagName==="INPUT"||t.tagName==="TEXTAREA",Rr=t=>t.tagName==="INPUT";function w(t,e){let n=e==null?"":String(e);Fr(t)?t.value=n:t.textContent=n}var Nr=t=>Fr(t)?t.value:t.textContent;function lt(t,e){let n=Nr(t);if(w(t,e),n!==Nr(t)&&t.hasAttribute(Mr)&&a.onValueChange)try{a.onValueChange(t,n)}catch(r){f(r,"onValueChange")}t.setAttribute(Mr,"1")}function la(t){if(t.hasAttribute(un))return;t.setAttribute(un,""),t.removeAttribute("hidden");let e=t.getAttribute(ge);e!==null?(t.style.display=e,t.removeAttribute(ge)):t.style.display==="none"&&(t.style.display=""),typeof getComputedStyle=="function"&&getComputedStyle(t).display==="none"&&(t.style.display=t.getAttribute(m("display"))||"block")}function I(t,e){if(e){la(t);return}t.removeAttribute(un),!t.hasAttribute(ge)&&t.style.display!=="none"&&t.setAttribute(ge,t.style.display),t.style.display="none"}function be(t,e){t.classList.toggle("is-selected",e),t.setAttribute("aria-pressed",e?"true":"false"),Rr(t)&&(t.type==="radio"||t.type==="checkbox")&&(t.checked=e);let n=t.querySelector('input[type="radio"],input[type="checkbox"]');n&&Rr(n)&&(n.checked=e)}var $r,zt=t=>Reflect.get(window,t);function da(){let t=zt("ScrollTrigger");if(typeof t!="function")return;let e=Reflect.get(t,"refresh");typeof e=="function"&&Reflect.apply(e,t,[])}function dt(t){clearTimeout($r),$r=setTimeout(()=>{try{a.onLayoutChange?a.onLayoutChange(t):da()}catch(e){f(e,"layout-changed")}h("layout-changed",{reason:t})},ca)}function Dr(t,e){let n=[...t.querySelectorAll("img")].filter(i=>!i.complete),r=n.length,o=()=>{r-=1,r===0&&dt(`${e}:images`)};n.forEach(i=>{i.addEventListener("load",o,{once:!0}),i.addEventListener("error",o,{once:!0})})}function W(t,e){return t.getAttribute("aria-busy")==="true"?Promise.resolve(void 0):(t.setAttribute("aria-busy","true"),Promise.resolve().then(e).finally(()=>{t.removeAttribute("aria-busy")}))}function Pe(t,e){let n=t?p(t,e):null;if(!n)return null;try{return JSON.parse(n)}catch{return v(`invalid JSON in ${m(e)}`,t),null}}function an(t){return t==null?"":typeof t=="string"?t:typeof t=="number"||typeof t=="boolean"?String(t):JSON.stringify(t)}function Ee(t){return Array.isArray(t)?t.filter(C).map(n=>({key:an(n.key),value:an(n.value)})):C(t)?Object.entries(t).map(([e,n])=>({key:e,value:an(n)})):[]}function Jt(t){return t?Array.isArray(t)?t.map(e=>({key:String(e.key),value:String(e.value??"")})):Object.entries(t).map(([e,n])=>({key:e,value:String(n??"")})):[]}var E="amount currencyCode",Vr={inventory:!0},Hr=t=>t.inventory?"quantityAvailable":"",pt="url altText width height";function pa(t){let e=[];for(let r of t){let o=Be(r);o&&e.push(o)}return e.length?`metafields(identifiers:[${e.map(({namespace:r,key:o})=>`{namespace: ${JSON.stringify(r)}, key: ${JSON.stringify(o)}}`).join(", ")}]){namespace key type value reference{... on MediaImage{image{${pt}}}}}`:""}var fa=` id name description recurringDeliveries options{name value}priceAdjustments{orderCount adjustmentValue{__typename ... on SellingPlanPercentagePriceAdjustment{adjustmentPercentage}... on SellingPlanFixedAmountPriceAdjustment{adjustmentAmount{${E}}}... on SellingPlanFixedPriceAdjustment{price{${E}}}}}`,ma=` sellingPlan{id}checkoutChargeAmount{${E}}remainingBalanceChargeAmount{${E}}priceAdjustments{price{${E}}compareAtPrice{${E}}perDeliveryPrice{${E}}unitPrice{${E}}}`;function qr(t=a,e=Vr){return` fragment TetherProduct on Product{id handle title description descriptionHtml productType vendor tags availableForSale publishedAt onlineStoreUrl requiresSellingPlan seo{title description}featuredImage{${pt}}images(first:${t.imagesFirst}){nodes{${pt}}}options{name optionValues{name swatch{color image{previewImage{${pt}}}}}}priceRange{minVariantPrice{${E}}maxVariantPrice{${E}}}compareAtPriceRange{minVariantPrice{${E}}maxVariantPrice{${E}}}${pa(t.metafields)} sellingPlanGroups(first:${t.sellingPlanGroupsFirst}){nodes{name appName options{name values}sellingPlans(first:${t.sellingPlansFirst}){nodes{${fa}}}}}variants(first:${t.variantsFirst}){nodes{id title availableForSale currentlyNotInStock ${Hr(e)} sku barcode selectedOptions{name value}image{${pt}}price{${E}}compareAtPrice{${E}}unitPrice{${E}}sellingPlanAllocations(first:${t.sellingPlansFirst}){nodes{${ma}}}}}}`}function cn(t=Vr){return` fragment TetherCart on Cart{id checkoutUrl totalQuantity note createdAt updatedAt attributes{key value}buyerIdentity{countryCode email}discountCodes{code applicable}cost{subtotalAmount{${E}}totalAmount{${E}}checkoutChargeAmount{${E}}}lines(first:100){nodes{id quantity attributes{key value}cost{totalAmount{${E}}subtotalAmount{${E}}amountPerQuantity{${E}}compareAtAmountPerQuantity{${E}}}discountAllocations{discountedAmount{${E}}}sellingPlanAllocation{sellingPlan{id name description recurringDeliveries options{name value}}checkoutChargeAmount{${E}}priceAdjustments{price{${E}}compareAtPrice{${E}}perDeliveryPrice{${E}}}}merchandise{... on ProductVariant{id title sku availableForSale requiresShipping ${Hr(t)} image{${pt}}price{${E}}compareAtPrice{${E}}selectedOptions{name value}product{id title handle vendor featuredImage{${pt}}}}}... on ComponentizableCartLine{lineComponents{id quantity merchandise{... on ProductVariant{id title product{title handle}}}}}}}}`}function jr(){return` id handle title description descriptionHtml image{${pt}}seo{title description}`}var pn={};Li(pn,{GID:()=>B,allPlans:()=>$,allocationFor:()=>_,findPlan:()=>$t,hasPlans:()=>ya,planAdjustment:()=>dn,planCheckoutCharge:()=>ln,planPrice:()=>Nt,planSavings:()=>Zt,plansForVariant:()=>ba,toGid:()=>we});var ga=/^(-?)(\d+)(?:\.(\d+))?$/;function Gr(t,e){let n=ga.exec(t.trim());if(!n)return null;let[,r="",o="0",i=""]=n,s=BigInt(`${o}${i.padEnd(e,"0")}`);return r==="-"?-s:s}var Kr=t=>t.split(".")[1]?.length??0;function Br(t,e){if(t==null||e==null)return!1;let n=Math.max(Kr(t.trim()),Kr(e.trim())),r=Gr(t,n),o=Gr(e,n);return r===null||o===null?!1:r>o}var Qr=2,Wr=new Map;function Yr(t){let e=Wr.get(t);if(e!==void 0)return e;let n=Qr;try{n=new Intl.NumberFormat("en",{style:"currency",currency:t}).resolvedOptions().maximumFractionDigits??Qr}catch{}return Wr.set(t,n),n}function wt(t){return Math.round(parseFloat(t.amount)*10**Yr(t.currencyCode))}function Xt(t,e){let n=Yr(e);return{amount:(t/10**n).toFixed(n),currencyCode:e}}var ha=100;function we(t,e){let n=typeof t=="string"||typeof t=="number"?String(t).trim():"";return n?n.startsWith("gid://")?n:/^\d+$/.test(n)?`gid://shopify/${e}/${n}`:n:null}var B={product:t=>we(t,"Product"),variant:t=>we(t,"ProductVariant"),sellingPlan:t=>we(t,"SellingPlan")};function $(t){return(t?.sellingPlanGroups?.nodes??[]).flatMap(n=>n.sellingPlans.nodes.map(r=>({...r,group:n})))}function ya(t){return $(t).length>0}function _(t,e){return!t||!e?null:(t.sellingPlanAllocations?.nodes??[]).find(r=>r.sellingPlan.id===e)??null}function ba(t,e){return $(t).filter(n=>_(e,n.id))}function Nt(t,e){let n=_(t,e)?.priceAdjustments[0];return n?.perDeliveryPrice??n?.price??t?.price??null}function ln(t,e){let n=_(t,e);return n?.checkoutChargeAmount??n?.priceAdjustments[0]?.price??t?.price??null}function Zt(t,e){let n=Nt(t,e);if(!t||!n)return{amount:null,percentage:0};let r=parseFloat(t.price.amount),o=parseFloat(n.amount);if(!Number.isFinite(r)||!Number.isFinite(o)||r<=0||o>=r)return{amount:null,percentage:0};let i=wt(t.price)-wt(n);return{amount:Xt(i,t.price.currencyCode),percentage:Math.round((1-o/r)*ha)}}function dn(t){let e=t?.priceAdjustments[0]?.adjustmentValue;if(!e)return null;switch(e.__typename){case"SellingPlanPercentagePriceAdjustment":return{type:"percentage",value:e.adjustmentPercentage};case"SellingPlanFixedAmountPriceAdjustment":return{type:"amount",value:e.adjustmentAmount};case"SellingPlanFixedPriceAdjustment":return{type:"price",value:e.price};default:return null}}function $t(t,e){if(!e)return null;let n=$(t),r=B.sellingPlan(e),o=e.trim().toLowerCase();return n.find(i=>i.id===r)??n.find(i=>i.name.toLowerCase()===o)??n.find(i=>i.options.some(s=>s.value.toLowerCase()===o))??null}var nt={amount:"string",currencyCode:"string"},_t={id:"string",handle:"string",title:"string",options:["object"],images:{nodes:["object"]},priceRange:{minVariantPrice:nt,maxVariantPrice:nt},variants:{nodes:[{id:"string",price:nt,selectedOptions:["object"]}]}},fn={nodes:[_t],pageInfo:{hasNextPage:"boolean"}},zr=t=>tt(t,"id")!==""&&tt(t,"handle")!==""&&et(t,_t),Jr=t=>C(t)&&(t.id===void 0||et(t,_t));var Pa={id:"string",quantity:"number",attributes:["object"],cost:{totalAmount:nt,subtotalAmount:nt,amountPerQuantity:nt},merchandise:{id:"string",selectedOptions:["object"],product:"object"}},mn={id:"string",checkoutUrl:"string",totalQuantity:"number",attributes:["object"],discountCodes:["object"],cost:{totalAmount:nt,subtotalAmount:nt},lines:{nodes:[Pa]}};var Ea='a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])',wa=60,gn=!1,Se=null,Sa=t=>t!==null&&"focus"in t,Xr=t=>y(t,Ea).filter(e=>e.offsetParent!==null||e===document.activeElement),St=()=>y(document,c("cart-drawer")),hn=t=>t.classList.contains(a.cartDrawerOpenClass);function J(){let t=St();return t.length?t.some(hn):gn}function Ce(t){y(document,c("cart-open")).forEach(e=>{e.setAttribute("aria-expanded",String(t))}),St().forEach(e=>{e.hasAttribute("role")||e.setAttribute("role","dialog"),!e.hasAttribute("aria-label")&&!e.hasAttribute("aria-labelledby")&&e.setAttribute("aria-label",p(e,"cart-label")||"Cart"),e.setAttribute("aria-modal",String(t)),!hn(e)&&(e.setAttribute("aria-hidden","true"),a.cartFocus&&(e.inert=!0))})}function Ca(t){let e=Xr(t)[0]??t;e===t&&!t.hasAttribute("tabindex")&&(t.tabIndex=-1),e.focus({preventScroll:!0})}function ke(){if(J())return;gn=!0;let t=St().filter(n=>p(n,"cart-drawer")!=="manual");t.forEach(n=>{n.inert=!1,n.classList.add(a.cartDrawerOpenClass),n.setAttribute("aria-hidden","false")}),Ce(!0);let[e]=t;a.cartFocus&&e&&(Se=Sa(document.activeElement)?document.activeElement:null,setTimeout(()=>{Ca(e)},wa)),a.onCartOpen?.(t),h("cart-toggled",{open:!0})}function yn(){if(!J())return;gn=!1;let t=St(),e=t.some(n=>n.contains(document.activeElement));t.forEach(n=>{n.classList.remove(a.cartDrawerOpenClass),n.setAttribute("aria-hidden","true"),a.cartFocus&&(n.inert=!0)}),Ce(!1),e&&Se?.isConnected&&Se.focus({preventScroll:!0}),Se=null,a.onCartClose?.(t),h("cart-toggled",{open:!1})}function Zr(){J()?yn():ke()}function bn(t){if(t.key!=="Tab"||!a.cartFocus||!J())return;let e=St().find(hn);if(!e)return;let n=Xr(e),r=n[0],o=n.at(-1);if(!r||!o)return;let i=document.activeElement,s=t.shiftKey?i===r:i===o;e.contains(i)&&!s||(t.preventDefault(),(t.shiftKey?o:r).focus())}var ka=1e4,Ta=6e4,q=new Map,Pn=new Map,Ct=new Set,Te=new Map,no=[],En=!1,te=0,to=t=>t.startsWith("gid://"),Ut=xr;function kt(t){if(!t)return;let e=Promise.resolve(t);q.set(t.handle,e),q.set(t.id,e)}function rt(t){let e=Ut(t);if(!e)return Promise.reject(new b("empty product key",{code:"NOT_FOUND"}));let n=q.get(e);if(n)return n;let r=new Promise((o,i)=>{Pn.set(e,{resolve:o,reject:i}),no.push(e),En||(En=!0,setTimeout(()=>void La(),0))});return q.set(e,r),r}var ve=t=>e=>`${t}${qr(a,e)}`;function va(t){let e=t.filter(to),n=t.filter(u=>!to(u)),r=[],o=[],i={};return e.length&&(r.push("$ids: [ID!]!"),i.ids=e,o.push("byId:nodes(ids:$ids){... on Product{...TetherProduct}}")),n.forEach((u,l)=>{r.push(`$h${l}: String!`),i[`h${l}`]=u,o.push(`h${l}:product(handle:$h${l}){...TetherProduct}`)}),{query:ve(`query TetherProducts(${r.join(",")}){${o.join(" ")}}`),variables:i,handles:n}}function eo(t,e){let n=Pn.get(t);Pn.delete(t),n&&e(n)}function Aa(t,e){if(e!==te)return;let n=q.get(t);setTimeout(()=>{q.get(t)===n&&q.delete(t)},ka)}function xa(t){if(!C(t))return!1;let{byId:e=[],...n}=t;return et(e,[D(Jr)])&&Object.values(n).every(D(_t))}async function La(){En=!1;let t=te,e=no.splice(0);if(!e.length)return;let{query:n,variables:r,handles:o}=va(e);L("fetch products",e);let i;try{i=await Q(n,r,xa)}catch(l){e.forEach(d=>{eo(d,g=>{t===te&&q.delete(d),g.reject(l)})});return}let s=new Map;for(let l of i.byId??[])l?.id&&s.set(l.id,l);o.forEach((l,d)=>{let g=i[`h${d}`];g&&s.set(l,g)});let u=Date.now();e.forEach(l=>{eo(l,d=>{let g=s.get(l);if(!g){Aa(l,t),d.reject(new b(`Product not found: ${l}`,{code:"NOT_FOUND"}));return}t===te&&(kt(g),Te.set(g.handle,u),Te.set(g.id,u)),d.resolve(g)})})}function Ae(){q.clear(),te+=1,Ct.clear(),Te.clear()}function ro(t){for(let e of t??[])!e.id||!e.handle||Date.now()-(Te.get(e.handle)??0)<Ta&&q.has(e.handle)||(kt(e),Ct.add(e.handle),Ct.add(e.id))}function oo(t){let e=Ut(t);return!e||!Ct.has(e)?!1:(Ct.delete(e),q.get(e)?.then(n=>{Ct.delete(n.handle),Ct.delete(n.id)},Ia),!0)}function Ia(){}function io(t){let e=Ut(t);return e&&q.delete(e),rt(t)}var Oa=z({collection:D({handle:"string",products:fn})}),Ma=z({products:fn}),Ra=z({productRecommendations:D([_t])}),Na=`query TetherCollection($handle:String!,$first:Int!,$after:String,$sortKey:ProductCollectionSortKeys,$reverse:Boolean,$filters:[ProductFilter!]){collection(handle:$handle){${jr()} products(first:$first,after:$after,sortKey:$sortKey,reverse:$reverse,filters:$filters){nodes{...TetherProduct}pageInfo{hasNextPage endCursor}}}}`,$a="query TetherSearch($first:Int!,$after:String,$query:String,$sortKey:ProductSortKeys,$reverse:Boolean){products(first:$first,after:$after,query:$query,sortKey:$sortKey,reverse:$reverse){nodes{...TetherProduct}pageInfo{hasNextPage endCursor}}}";async function xe({collection:t,query:e,first:n=a.collectionFirst,after:r=null,sortKey:o,reverse:i=!1,filters:s}={}){if(t){let l=await Q(ve(Na),{handle:t,first:n,after:r,sortKey:o||void 0,reverse:i,filters:s??void 0},Oa);if(!l.collection)throw new b(`Collection not found: ${t}`,{code:"NOT_FOUND"});let{products:d,...g}=l.collection;return d.nodes.forEach(kt),{collection:g,products:d.nodes,pageInfo:d.pageInfo}}let u=await Q(ve($a),{first:n,after:r,query:e||void 0,sortKey:o||void 0,reverse:i},Ma);return u.products.nodes.forEach(kt),{collection:null,products:u.products.nodes,pageInfo:u.products.pageInfo}}async function Le(t,e="RELATED"){let n=Ut(typeof t=="object"?t?.id:t),r=n?.startsWith("gid://")??!1,i=(await Q(ve(`query TetherRecs(${r?"$id: ID!":"$handle: String!"},$intent:ProductRecommendationIntent){productRecommendations(${r?"productId: $id":"productHandle: $handle"},intent:$intent){...TetherProduct}}`),r?{id:n,intent:e}:{handle:n,intent:e},Ra)).productRecommendations??[];return i.forEach(kt),i}var _a=/^image:(\d+)$/,so="metafield:",Ua=/^(rich_text|multi_line_text)_field$/,Fa=["","true","all","*"],ee=t=>t.tagName==="SELECT",Tt=(t,e)=>t.$(`select${e}`).filter(ee);function Da(t,e){let n=e.images.nodes,r=[...t.children].map(i=>i.tagName==="IMG"?i:i.querySelector("img"));!Yt(t)&&r.length===n.length&&r.every((i,s)=>me(i?.getAttribute("src"),n[s]?.url))||H(t,n,(i,s)=>{let u=i.matches(`img,${c("bind","image")}`)?i:y(i,"img")[0]??i;O(u,s.url,s.altText||e.title)})}function Va(t,e,n){let r=n.indexOf("."),o=n.slice(0,r),i=n.slice(r+1),s=(e.metafields??[]).find(l=>l?.namespace===o&&l.key===i);if(!s){w(t,"");return}let u=s.reference?.image;if(u){O(t,u.url,u.altText);return}Ua.test(s.type)&&(t.style.whiteSpace="pre-line"),w(t,s.value)}var Ha=new Map(Object.entries({title:t=>t.title,"description-text":t=>t.description,vendor:t=>t.vendor,type:t=>t.productType,handle:t=>t.handle,"published-at":t=>he(t.publishedAt),"min-price":t=>M(t.priceRange.minVariantPrice),"max-price":t=>M(t.priceRange.maxVariantPrice)}));function qa(t,e){let n=(t.getAttribute("exclude")??"").split(",").map(o=>o.trim()).filter(Boolean),r=e.tags.filter(o=>!n.includes(o));H(t,r,(o,i)=>{w(o,i)})}function ja(t,e,n){let r=Ha.get(e);if(r){w(t,r(n));return}switch(e){case"description":ye(t,n.descriptionHtml);break;case"featured-image":O(t,n.featuredImage?.url,n.featuredImage?.altText||n.title);break;case"url":case"link":{let o=Rt(n.handle,n.id);o&&t.setAttribute("href",o),e==="url"&&!t.firstElementChild&&!t.textContent.trim()&&w(t,n.title);break}case"images":Da(t,n);break;case"tags":qa(t,n);break;default:Ga(t,e,n)}}function Ga(t,e,n){let r=_a.exec(e);if(r){let o=n.images.nodes[Number(r[1])-1]??n.featuredImage;O(t,o?.url,o?.altText||n.title)}else e.startsWith(so)&&Va(t,n,e.slice(so.length))}function Ka(t){let{product:e}=t;t.$(c("option-list")).forEach(n=>{let r=t.optName(p(n,"option-list")),o=e.options.find(i=>i.name===r);if(!o||o.optionValues.length<=1&&V(n,"hide-single")){I(n,!1);return}H(n,o.optionValues,(i,s)=>{i.setAttribute(m("option-value"),s.name);let u=y(i,c("bind","option-value"))[0];u?w(u,s.name):i.firstElementChild||w(i,s.name);let l=y(i,c("bind","swatch"))[0],{swatch:d}=s;!l||!d||(d.color&&(l.style.backgroundColor=d.color),d.image?.previewImage&&O(l,d.image.previewImage.url,s.name))})})}function Qa(t){let{product:e}=t;Tt(t,c("option")).forEach(n=>{let r=e.options.find(o=>o.name===t.optName(p(n,"option")));if(!r){I(n,!1);return}n.replaceChildren(...r.optionValues.map(o=>new Option(o.name,o.name)))}),Tt(t,c("variant-select")).forEach(n=>{n.replaceChildren(...e.variants.nodes.map(r=>new Option(r.title,r.id)))}),Tt(t,c("plan")).forEach(n=>{let r=t.plans.map(s=>new Option(s.name,s.id)),o=!e.requiresSellingPlan&&p(n,"plan")!=="subscription-only",i=n.getAttribute(m("one-time-label"))||"One-time purchase";n.replaceChildren(...o?[new Option(i,"")]:[],...r)})}function Wa(t){t.$(c("plan-list")).forEach(e=>{let n=(p(e,"plan-list")??"").trim(),r=Fa.includes(n.toLowerCase())?null:n,o=t.plans.filter(i=>!r||i.group.name===r);H(e,o,(i,s)=>{i.setAttribute(m("plan-value"),s.id),!i.firstElementChild&&!i.querySelector(c("plan-bind"))&&w(i,s.name)})})}function ao(t){t.$(c("bind")).forEach(e=>{ja(e,p(e,"bind")??"",t.product)}),Ka(t),Qa(t),Wa(t)}var uo="Default Title",wn=(t,e)=>e.get(t.id)?.quantity??t.quantity,co=t=>t.split("/").pop()??t;function Ba(t){let e=t.merchandise,n=Rt(e.product.handle,e.product.id);if(!n)return null;let r=new URLSearchParams;r.set("variant",co(e.id));let o=t.sellingPlanAllocation?.sellingPlan.id;return o&&r.set("selling_plan",co(o)),`${n}${n.includes("?")?"&":"?"}${r.toString()}`}var lo=t=>t.merchandise.product.title,po={title:lo,"product-title":lo,"variant-title":t=>t.merchandise.title===uo?"":t.merchandise.title,options:t=>t.merchandise.selectedOptions.filter(e=>e.value!==uo).map(e=>`${e.name}: ${e.value}`).join(", "),vendor:t=>t.merchandise.product.vendor,sku:t=>t.merchandise.sku??"",price:t=>M(t.cost.amountPerQuantity),"compare-at-price":t=>M(t.cost.compareAtAmountPerQuantity??t.merchandise.compareAtPrice),"line-total":t=>M(t.cost.totalAmount),"line-subtotal":t=>M(t.cost.subtotalAmount),quantity:(t,e)=>wn(t,e.pending),plan:t=>t.sellingPlanAllocation?.sellingPlan.name??"","plan-description":t=>t.sellingPlanAllocation?.sellingPlan.description??"",components:t=>(t.lineComponents??[]).map(e=>`${e.quantity} \xD7 ${e.merchandise.product.title}`).join(", ")},fo="attribute:";function Ya(t,e,n){if(Object.hasOwn(po,e))return po[e]?.(t,n);if(!e.startsWith(fo))return;let r=e.slice(fo.length);return t.attributes.find(o=>o.key===r)?.value??""}function za(t,e,n){let r=$(n),o=!n.requiresSellingPlan&&p(t,"line-plan")!=="subscription-only",i={value:"",label:t.getAttribute(m("one-time-label"))||"One-time purchase"},s=[...o?[i]:[],...r.map(l=>({value:l.id,label:l.name}))],u=s.map(l=>l.value).join("|");t.dataset.tetherSig!==u&&(t.replaceChildren(...s.map(l=>{let d=document.createElement("option");return d.value=l.value,d.textContent=l.label,d})),t.dataset.tetherSig=u),t.value=e.sellingPlanAllocation?.sellingPlan.id??"",I(t,r.length>0)}function Ja(t,e,n){let r=!!e.sellingPlanAllocation;t.classList.toggle("is-subscription",r);let o=n.warnings.find(u=>u.target===e.id);t.classList.toggle("is-warning",!!o);let i=n.pending.has(e.id);t.classList.toggle("is-busy",i),i?t.setAttribute("aria-busy","true"):t.removeAttribute("aria-busy"),y(t,c("line","warning")).forEach(u=>{lt(u,o?.message??"")});let s=new Map([["subscription",r],["one-time",!r],["on-sale",Br(e.cost.compareAtAmountPerQuantity?.amount,e.cost.amountPerQuantity.amount)],["has-components",(e.lineComponents??[]).length>0],["warning",!!o]]);y(t,c("line-show")).forEach(u=>{let l=p(u,"line-show"),d=l===null?void 0:s.get(l);d!==void 0&&I(u,d)})}function Xa(t,e,n){let r=e.merchandise;t.setAttribute(m("line-id"),e.id),y(t,c("line")).forEach(i=>{let s=p(i,"line")??"";if(s==="image"){O(i,r.image?.url??r.product.featuredImage?.url,r.product.title);return}if(s==="url"){let l=Ba(e);l&&i.setAttribute("href",l);return}let u=Ya(e,s,n);u!==void 0&<(i,u)}),Ja(t,e,n),y(t,c("line-plan")).filter(ee).forEach(i=>{rt(r.product.handle).then(s=>{za(i,e,s)}).catch(s=>{f(s,"line plan options")})})}function Za(t,e){let n=t?.totalQuantity??0,r=(t?.lines.nodes??[]).some(i=>i.sellingPlanAllocation),o=new Map([["cart-empty",n===0],["cart-filled",n>0],["cart-has-subscription",r],["cart-no-subscription",!r],["cart-has-discount",(t?.discountCodes??[]).some(i=>i.applicable)],["cart-error",e.failed],["cart-warning",e.warnings.length>0]]);y(document,c("show")).forEach(i=>{let s=p(i,"show"),u=s===null?void 0:o.get(s);u===void 0||i.closest(c("product"))||I(i,u)}),y(document,c("checkout")).forEach(i=>{i.classList.toggle("is-disabled",!n),i.setAttribute("aria-disabled",String(!n))})}function tu(t){y(document,`textarea${c("cart-note")},input${c("cart-note")}`).forEach(e=>{document.activeElement!==e&&w(e,t?.note??"")}),y(document,c("cart-discounts")).forEach(e=>{H(e,t?.discountCodes??[],(n,r)=>{n.setAttribute(m("discount-code"),r.code);let o=n.querySelector(c("discount","code"))??(n.firstElementChild?null:n);o&&w(o,r.code),n.classList.toggle("is-inapplicable",!r.applicable)})})}function mo(t){let{cart:e}=t,n=r=>e?M(e.cost[r]):"";Ce(J()),y(document,c("cart-count")).forEach(r=>{lt(r,e?.totalQuantity??0)}),y(document,c("cart-subtotal")).forEach(r=>{lt(r,n("subtotalAmount"))}),y(document,c("cart-total")).forEach(r=>{lt(r,n("totalAmount"))}),y(document,c("cart-checkout-charge")).forEach(r=>{lt(r,n("checkoutChargeAmount"))}),Za(e,t),y(document,c("cart-warning")).forEach(r=>{lt(r,[...new Set(t.warnings.map(o=>o.message))].join(" "))}),tu(e),y(document,c("cart-lines")).forEach(r=>{sn(r,e?.lines.nodes??[],o=>o.id,(o,i)=>{Xa(o,i,t)},{onEnter:a.onLineEnter,onLeave:a.onLineLeave})}),e&&dt("cart")}function go(t){y(document,c("cart-count")).forEach(e=>{/^\s*0?\s*$/.test(e.textContent)&&(e.textContent=String(t))})}function vt(t,e="localStorage"){try{return window[e].getItem(t)}catch{return null}}function Ie(t,e,n="localStorage"){try{window[n].setItem(t,e)}catch{}}function ne(t,e="localStorage"){try{window[e].removeItem(t)}catch{}}var ho=/^gid:\/\/shopify\/Cart\/[\w-]+(\?key=[\w-]+)?$/;var j={kind:"unknown"},Ft=[],At=new Map,Oe=()=>j;function A(){switch(j.kind){case"ready":case"error":return j.cart;case"unknown":case"empty":return null}}var bo=()=>Ft,Sn=t=>t?{kind:"ready",cart:t}:{kind:"empty"},Po=()=>`${a.storageKey}:seen`;function ft(){let t=vt(a.storageKey);return t?ho.test(t)?t:(mt(),null):null}function mt(){ne(a.storageKey)}function Cn(t){j=Sn(t),t&&Ie(a.storageKey,t.id)}function re(){mo({cart:A(),warnings:Ft,pending:At,failed:j.kind==="error"})}function oe(t){re(),h("cart-updated",{cart:A(),reason:t})}function Y(t,e){return Cn(t),Ie(Po(),`${Date.now()}|${t?.totalQuantity??0}`),oe(e),t}function ie(t){j=t.kind==="loaded"?Sn(t.cart):{kind:"error",error:t.error,cart:null},oe("load")}function eu(){let t=vt(Po())?.split("|")[1]??"",e=Number(t);return/^\d+$/.test(t)&&Number.isSafeInteger(e)?e:null}function Eo(){if(j.kind!=="unknown")return;let t=eu();t!==null&&go(t)}function wo(t){Ft=t.filter((e,n)=>t.findIndex(r=>r.message===e.message)===n).map(e=>({...e,message:a.warningText?.(e)||e.message})),Ft.length&&h("cart-warning",{warnings:Ft})}var yo=()=>{};function nu(){let t=Promise.resolve();return e=>{let n=t.then(e);return t=n.then(yo,yo),n}}var ru=nu();function So(t){return ru(t).then(e=>(j.kind==="error"&&(j=Sn(j.cart),re()),e),e=>{throw j={kind:"error",error:e,cart:A()},re(),h("cart-error",{error:e}),e})}var kn=t=>wn(t,At),ou=()=>({open:J(),count:A()?.totalQuantity??0,loaded:j.kind!=="unknown",warnings:[...Ft]});function Co(t){let e=["cart-updated","cart-toggled"].map(r=>`${a.prefix}:${r}`),n=()=>{t(A(),ou())};return e.forEach(r=>{document.addEventListener(r,n)}),n(),()=>{e.forEach(r=>{document.removeEventListener(r,n)})}}var iu=/does not exist|not found|invalid id/i,su=t=>z({[t]:D({cart:D(mn)})});function Me(t){return t instanceof b?t.userErrors?.some(e=>e.field?.[0]==="cartId")?!0:(t.errors??[]).some(e=>iu.test(e.message)):!1}function To(t){if(!(t instanceof b))return!1;let{code:e,status:n=0}=t;return e==="NETWORK"||e==="INVALID_RESPONSE"||e==="SERVER_ERROR"||n>=500}function vo(t,e=1,n={}){let r=typeof t=="object"&&t!==null?t:{...n,quantity:e,...t==null?{}:{variantId:t}},o=B.variant(r.merchandiseId||r.variantId||r.id);if(!o)throw new b("add(): variantId is required");let i=parseInt(String(r.quantity??1),10),s={merchandiseId:o,quantity:Math.max(1,i||1)},u=B.sellingPlan(r.sellingPlanId||r.sellingPlan);u&&(s.sellingPlanId=u);let l=Jt(r.attributes);return l.length&&(s.attributes=l),s}function au(t,e,n){return r=>`mutation Tether_${t}(${e}){${t}(${n}){cart{...TetherCart}userErrors{field message}warnings{code message target}}}${cn(r)}`}async function Ao(t,e,n,r){let o=await Q(au(t,e,n),r,su(t),{operation:"mutation"}),i=br(o[t],t);return wo(i.warnings??[]),i.cart}function ko(t){let e=a.country?{buyerIdentity:{countryCode:a.country},...t}:t;return Ao("cartCreate","$input: CartInput!","input: $input",{input:e})}async function gt({name:t,args:e,inner:n,variables:r,createInput:o}){let i=ft();if(!i)return o?ko(o):null;try{return await Ao(t,`$cartId: ID!, ${e}`,`cartId: $cartId, ${n}`,{...r,cartId:i})}catch(s){if(!Me(s)||(mt(),!o))throw s;return L("cart expired, creating a new one"),ko(o)}}async function Tn(t){return(await Q(n=>`query TetherCart($id:ID!){cart(id:$id){...TetherCart}}${cn(n)}`,{id:t},z({cart:D(mn)}))).cart}async function xo(t){return(await Q("query TetherCheckout($id:ID!){cart(id:$id){checkoutUrl}}",{id:t},z({cart:D({checkoutUrl:"string"})}))).cart?.checkoutUrl??null}function Lo(t,e){let n=typeof e=="number"?{quantity:e}:e,r={id:t};n.quantity!==void 0&&(r.quantity=n.quantity),"sellingPlanId"in n&&(r.sellingPlanId=n.sellingPlanId?B.sellingPlan(n.sellingPlanId):null),n.attributes&&(r.attributes=Jt(n.attributes));let o=n.merchandiseId||n.variantId;return o&&(r.merchandiseId=B.variant(o)),r}var vn=t=>gt({name:"cartLinesUpdate",args:"$lines: [CartLineUpdateInput!]!",inner:"lines: $lines",variables:{lines:t},createInput:null}),Re=t=>gt({name:"cartLinesRemove",args:"$lineIds: [ID!]!",inner:"lineIds: $lineIds",variables:{lineIds:t},createInput:null}),Io=(t,e)=>e>0?vn([{id:t,quantity:e}]):Re([t]);var An=null;function Oo(t){An=t}var uu=t=>xo(t).then(e=>({kind:"url",url:e}),e=>({kind:"failed",error:e}));async function cu(){if(!An)return null;try{let t=await An();return t&&`${t}${t.includes("?")?"&":"?"}logged_in=true`}catch(t){return f(t,"account checkout"),null}}async function lu(t){let e=uu(t),n=await cu();if(n)return n;let r=await e;if(r.kind==="failed")throw r.error;if(!r.url)throw new b("No checkoutUrl (cart empty or expired)");return r.url}function du(t){try{t.opener=null}catch{}}async function Mo(t=a.checkoutTarget){let e=ft(),n=A();if(!e||n&&!n.totalQuantity)return null;let r=t==="_blank"?window.open("","_blank"):null;r&&du(r);try{let o=await lu(e);if(!pe(o))throw new b("The checkout URL is not https: not opened");return h("checkout",{url:o,cart:A()}),r&&!r.closed?r.location.href=o:window.location.href=o,o}catch(o){return r?.close(),f(o,"checkout failed"),null}}var Ne=()=>A()?.lines.nodes??[];async function pu(){let t=ft();if(t)try{let e=await Tn(t);e||mt(),Y(e,"load")}catch(e){f(e,"cart reload after a failed change")}}function ot(t){return So(()=>t().catch(async e=>{throw To(e)&&await pu(),e}))}function fu(t,e){let n=Ne().find(u=>u.id===t);if(!n)return Promise.resolve(A());let r=Math.max(0,kn(n)+e),o={quantity:r};At.set(t,o),oe("pending");let i=()=>At.get(t)===o;return ot(async()=>{if(!i())return A();if(Ne().find(d=>d.id===t)?.quantity===r)return A();let l=await Io(t,r);return i()?Y(l,r>0?"update":"remove"):(Cn(l),l)}).finally(()=>{i()&&(At.delete(t),oe("settled"))})}function mu(t){let e=(A()?.discountCodes??[]).map(r=>r.code),n=typeof t=="function"?t(e):t;return(Array.isArray(n)?n:[n]).map(r=>r.trim()).filter(Boolean)}function gu(t){let e=new Map((A()?.attributes??[]).map(n=>[n.key,n.value]));return Jt(t).forEach(n=>e.set(n.key,n.value)),[...e].filter(([,n])=>n!=="").map(([n,r])=>({key:n,value:r}))}async function hu(){let t=ft();if(!t)return ie({kind:"loaded",cart:null}),null;Eo();try{let e=await Tn(t);e||mt(),ie({kind:"loaded",cart:e})}catch(e){f(e,"cart load failed"),Me(e)&&mt(),ie({kind:"failed",error:e})}return A()}var P={init:hu,id:ft,get status(){return Oe()},get state(){return A()},get lines(){return[...Ne()]},get count(){return A()?.totalQuantity??0},get loaded(){return Oe().kind!=="unknown"},get lastError(){let t=Oe();return t.kind!=="error"?null:t.error instanceof Error?t.error:new Error(String(t.error))},get warnings(){return[...bo()]},get pendingQty(){return At},setCheckoutResolver:Oo,forgetSaved(){mt(),ie({kind:"loaded",cart:null})},render:re,subscribe:Co,add(t,e=1,n={}){let r=(Array.isArray(t)?t:[t]).map(o=>vo(o,e,n));return ot(async()=>{let o=await gt({name:"cartLinesAdd",args:"$lines: [CartLineInput!]!",inner:"lines: $lines",variables:{lines:r},createInput:{lines:r}});if(!o)throw new b("Shopify answered the add without a cart");return Y(o,"add"),h("added",{cart:o,lines:r}),a.openCartOnAdd&&ke(),o})},updateLine(t,e){let n=typeof e=="number"?e:e.quantity;if(n!==void 0&&n<=0)return P.removeLine(t);let r=Lo(t,e);return ot(async()=>Y(await vn([r]),"update"))},changeQuantity:fu,quantityOf:kn,removeLine(t){let e=Array.isArray(t)?t:[t];return ot(async()=>Y(await Re(e),"remove"))},clear(){return ot(async()=>{let t=Ne().map(e=>e.id);return t.length?Y(await Re(t),"remove"):A()})},setNote(t){let e={note:t??""};return ot(async()=>Y(await gt({name:"cartNoteUpdate",args:"$note: String!",inner:"note: $note",variables:e,createInput:e}),"note"))},setAttributes(t){return ot(async()=>{let e={attributes:gu(t)},n=await gt({name:"cartAttributesUpdate",args:"$attributes: [AttributeInput!]!",inner:"attributes: $attributes",variables:e,createInput:e});return Y(n,"attributes")})},setDiscountCodes(t){return ot(async()=>{let e={discountCodes:mu(t)},n=await gt({name:"cartDiscountCodesUpdate",args:"$discountCodes: [String!]!",inner:"discountCodes: $discountCodes",variables:e,createInput:e});return Y(n,"discount")})},async applyDiscount(t){let e=await P.setDiscountCodes(o=>[...new Set([...o,t])]),n=t.toLowerCase();if((e?.discountCodes??[]).find(o=>o.code.toLowerCase()===n)?.applicable)return e;try{await P.removeDiscount(t)}catch(o){f(o,"removing a discount code Shopify refused")}throw new b(`Discount code not valid: ${t}`,{code:"INVALID_DISCOUNT"})},removeDiscount(t){let e=t.toLowerCase();return P.setDiscountCodes(n=>n.filter(r=>r.toLowerCase()!==e))},setBuyerIdentity(t,{create:e=!0}={}){return ot(async()=>{let n=await gt({name:"cartBuyerIdentityUpdate",args:"$buyerIdentity: CartBuyerIdentityInput!",inner:"buyerIdentity: $buyerIdentity",variables:{buyerIdentity:t},createInput:e?{buyerIdentity:t}:null}).catch(r=>{if(e||!Me(r))throw r;return null});return Y(n,"buyer-identity")})},checkout:Mo,drawers:St,isOpen:J,open:ke,close:yn,toggle:Zr};var yu=100,bu=(t,e)=>Xt(wt(t)*e,t.currencyCode),Vt=t=>Object.fromEntries(t.selectedOptions.map(e=>[e.name,e.value]));function Pu(t,e){return t.variants.nodes.find(n=>n.selectedOptions.every(r=>e[r.name]===r.value))??null}function Ro(t,e,n,r){return t.variants.nodes.some(o=>o.availableForSale&&o.selectedOptions.every(i=>i.name===n?i.value===r:e[i.name]===i.value))}var Dt=t=>t.kind==="subscription"?t.planId:t.offeredPlanId;function $e(t,e){return t.kind==="subscription"&&_(e,t.planId)?t:{kind:"one-time"}}function _e(t,e,n,r){let o=$(t),i=o.find(u=>u.id===r)??o[0];if(!i)return{kind:"one-time",offeredPlanId:null};let s=_(e,i.id)?i:o.find(u=>_(e,u.id))??i;return t.requiresSellingPlan||n==="subscription"?{kind:"subscription",planId:s.id}:{kind:"one-time",offeredPlanId:s.id}}function No(t,{variant:e,sellingPlan:n,defaultPlan:r,defaultPurchase:o}){let i=t.variants.nodes,s=B.variant(e),u=i.find(k=>k.id===s)??i.find(k=>k.availableForSale)??i[0]??null,l=$t(t,n),d=l??$t(t,r),g=l||o==="subscription"?"subscription":"one-time";return{selected:u?Vt(u):{},purchase:_e(t,u,g,d?.id??null)}}function Eu(t,e,n,r,o){let i=t.quantityAvailable,s=i!=null&&i>0&&i<=e,u=r.compareAtPrice!==null,l=r.line.kind==="subscription";return{"in-stock":t.availableForSale,"out-of-stock":!t.availableForSale,backorder:t.availableForSale&&t.currentlyNotInStock,"on-sale":u,"not-on-sale":!u,"has-variants":n>1,"single-variant":n===1,"low-stock":s,"plenty-in-stock":t.availableForSale&&!s,"subscription-available":r.subscriptionAvailable,"subscription-unavailable":!r.subscriptionAvailable,"subscription-only":o,"one-time-available":!o,"subscription-selected":l,"one-time-selected":!l,"has-savings":l?r.savings.percentage>0:u}}function $o(t,e,n){let r=Pu(t,e.selected),o=r??t.variants.nodes[0];if(!o)return null;let i=_e(t,o,e.purchase.kind,Dt(e.purchase)),s=Dt(i),u=$(t),l=$e(i,o),d=l.kind==="subscription"?_(o,l.planId):null,g=d?Nt(o,s)??o.price:o.price,k=d?.priceAdjustments[0]?.compareAtPrice??o.compareAtPrice,N={line:l,subscriptionAvailable:u.some(G=>_(o,G.id)),compareAtPrice:k&&parseFloat(k.amount)>parseFloat(g.amount)?k:null,savings:Zt(o,s)};return{...N,variant:o,selected:r?e.selected:Vt(o),purchase:i,plan:u.find(G=>G.id===s)??null,quantity:e.quantity,price:g,show:Eu(o,n,t.variants.nodes.length,N,t.requiresSellingPlan)}}function _o(t,e){let{variant:n,plan:r,price:o,compareAtPrice:i,quantity:s}=t,u=Dt(t.purchase),l=G=>bu(G,Math.max(1,s)),N={price:()=>e.money(o),"total-price":()=>e.money(l(o)),"one-time-price":()=>e.money(n.price),"subscription-price":()=>e.money(u?Nt(n,u):null),"subscription-savings":()=>e.percent(t.savings.percentage),"subscription-savings-amount":()=>e.money(t.savings.amount),"checkout-charge":()=>{let G=t.line.kind==="subscription"?ln(n,u)??o:o;return e.money(l(G))},"plan-name":()=>r?.name,"plan-description":()=>r?.description,"plan-group":()=>r?.group.name,"compare-at-price":()=>e.money(i),"unit-price":()=>e.money(n.unitPrice),"discount-percentage":()=>i?`${Math.round((1-parseFloat(o.amount)/parseFloat(i.amount))*yu)}%`:"0%","discount-amount":()=>i?e.money(Xt(wt(i)-wt(o),o.currencyCode)):"","variant-title":()=>n.title,"variant-id":()=>n.id,sku:()=>n.sku,barcode:()=>n.barcode,stock:()=>n.quantityAvailable,quantity:()=>s};return new Map(Object.entries(N))}function Uo(t,e,n,r){let i={name:()=>n?.name,option:()=>(n?.options??[]).map(s=>s.value).join(", "),description:()=>n?.description,price:()=>r.money(Nt(t,e)),savings:()=>r.percent(Zt(t,e).percentage),"savings-amount":()=>r.money(Zt(t,e).amount),adjustment:()=>{let s=dn(n);return s?s.type==="percentage"?`${s.value}%`:r.money(s.value):""}};return new Map(Object.entries(i))}function xn(t){try{return decodeURIComponent(t)}catch(e){if(e instanceof URIError)return t;throw e}}var Fo="url:";function X(t,e=window.location,n="product"){let r=(p(t,n)??"").trim();if(!r.toLowerCase().startsWith(Fo))return{key:r||null,fromUrl:!1,raw:r};let o=r.slice(Fo.length).trim(),i;if(o.toLowerCase()==="path"){let s=e.pathname.split("/").filter(Boolean),u=s[s.length-1];i=u===void 0?null:xn(u)}else i=new URLSearchParams(e.search).get(o||"handle");return{key:i?.trim()||null,fromUrl:!0,raw:r}}var Ue=["loading","ready","error","not-found"],wu=t=>Ue.some(e=>e===t),Do=t=>typeof t=="object"&&t!==null&&"code"in t?t.code:void 0,ae=t=>Do(t)==="NOT_FOUND",se=()=>["product","collection","products","recommendations"].map(t=>c(t)).join(","),Vo=(t,e)=>t===e||t.parentElement?.closest(se())===e;function Su(t){let e=Do(t);return typeof e=="string"&&e?e:"error"}function ht(t,e,n){let r=e==="not-found",o=e==="error"||r;t.setAttribute(m("state"),r?"error":e),o?t.setAttribute(m("error"),r?"not-found":Su(n)):t.removeAttribute(m("error")),ut(t,c("show"),se()).forEach(i=>{let s=p(i,"show");wu(s)&&I(i,s===e)}),o&&ut(t,c("add-to-cart"),se()).forEach(i=>{i.classList.add("is-disabled"),i.setAttribute("aria-disabled","true"),"disabled"in i&&(i.disabled=!0)})}var Ho={money:M,percent:Ur},Cu=t=>t.tagName==="INPUT";function Ln(t){let e=y(t,c("add-label"))[0]??t,n=e.dataset.tetherLabel??(Cu(e)?e.value:e.textContent);return e.dataset.tetherLabel=n,{label:e,original:n}}function ku(t,e){let{product:n}=t,r=o=>e.selected[t.optName(o)]??"";t.$(c("option-selected")).forEach(o=>{w(o,r(p(o,"option-selected")))}),t.$(c("option-list")).forEach(o=>{let i=t.optName(p(o,"option-list"));y(o,c("option-value")).forEach(s=>{let u=p(s,"option-value")??"";be(s,e.selected[i]===u);let l=!Ro(n,e.selected,i,u);s.classList.toggle("is-unavailable",l),s.setAttribute("data-unavailable",l?"true":"false")})}),Tt(t,c("option")).forEach(o=>{o.value=r(p(o,"option"))}),Tt(t,c("variant-select")).forEach(o=>{o.value=e.variant.id})}function Tu(t,e){let{variant:n,purchase:r,line:o}=e;t.$(c("purchase")).forEach(i=>{if(ee(i)){i.value=r.kind;return}let s=p(i,"purchase");be(i,s===r.kind);let u=s==="subscription"?!e.subscriptionAvailable:t.product.requiresSellingPlan;i.classList.toggle("is-unavailable",u)}),t.$(c("plan-value")).forEach(i=>{let s=p(i,"plan-value")??"";be(i,o.kind==="subscription"&&s===o.planId),i.classList.toggle("is-unavailable",!_(n,s));let u=t.plans.find(d=>d.id===s),l=Uo(n,s,u,Ho);y(i,c("plan-bind")).forEach(d=>{let g=l.get(p(d,"plan-bind")??"");g&&w(d,g())})}),Tt(t,c("plan")).forEach(i=>{i.value=o.kind==="subscription"?o.planId:""})}function vu(t,e){let n=new Map(Object.entries(e.show));Ue.forEach(r=>n.set(r,r==="ready")),t.$(c("show")).forEach(r=>{let o=p(r,"show")??"",i=n.get(o);i!==void 0&&(Ue.some(s=>s===o)&&!Vo(r,t.root)||I(r,i))})}function Au(t,e){let n=!e.variant.availableForSale;t.$(c("add-to-cart")).forEach(r=>{r.classList.toggle("is-disabled",n),r.setAttribute("aria-disabled",String(n)),"disabled"in r&&(r.disabled=n);let o=p(r,"soldout-text"),i=p(r,"subscribe-text");if(!o&&!i)return;let{label:s,original:u}=Ln(r),l=u;e.line.kind==="subscription"&&i&&(l=i),n&&o&&(l=o),r.getAttribute("aria-busy")!=="true"&&w(s,l)})}function qo(t,e){let{variant:n}=e,{product:r}=t,o=_o(e,Ho);t.$(c("bind")).forEach(i=>{let s=p(i,"bind")??"";if(s==="variant-image"){O(i,n.image?.url||r.featuredImage?.url,n.image?.altText||r.title);return}let u=o.get(s);u&&w(i,u())}),ku(t,e),Tu(t,e),vu(t,e),t.root.classList.toggle("is-subscription",e.line.kind==="subscription"),t.root.setAttribute(m("purchase-mode"),e.line.kind),Au(t,e)}var Go=()=>c("product"),xu=t=>t.tagName==="INPUT"||t.tagName==="SELECT"||t.tagName==="TEXTAREA",jo=t=>t instanceof window.Element;function Ht(t,e,n){let r=e.closest(n);return r?.closest(Go())===t.root?r:null}function Lu(t,e){let{label:n,original:r}=Ln(e),o=p(e,"adding-text");W(e,async()=>{o&&w(n,o);try{await t.addToCart()}catch(i){f(i,"add to cart failed"),h("error",{error:i,context:"add-to-cart"},t.root)}finally{o&&w(n,r)}}).then(()=>{t.renderVariant()}).catch(i=>{f(i,"add to cart render")})}function Iu(t,e,n){let r=Ht(t,n,c("option-value")),o=r?.closest(c("option-list"));if(r&&o){e.preventDefault(),t.select(t.optName(p(o,"option-list")),p(r,"option-value")??"");return}let i=Ht(t,n,c("plan-value"));if(i){e.preventDefault(),t.selectPlan(p(i,"plan-value"));return}let s=Ht(t,n,`${c("purchase")}:not(select)`);if(s){s.tagName!=="INPUT"&&e.preventDefault(),t.setPurchase(Ko(p(s,"purchase")));return}let u=Ht(t,n,c("qty-plus")),l=u?null:Ht(t,n,c("qty-minus"));if(u||l){e.preventDefault(),t.setQuantity(t.quantity+(u?1:-1));return}let d=Ht(t,n,c("add-to-cart"));d&&(e.preventDefault(),Lu(t,d))}var Ko=t=>t==="subscription"?"subscription":"one-time";function Ou(t,e){let n=xu(e)?e.value:"";e.matches(`select${c("option")}`)?t.select(t.optName(p(e,"option")),n):e.matches(`select${c("variant-select")}`)?t.selectVariant(n):e.matches(`select${c("plan")}`)?n?t.selectPlan(n):t.setPurchase("one-time"):e.matches(`select${c("purchase")}`)?t.setPurchase(Ko(n)):e.matches(c("qty"))&&t.setQuantity(n)}function Qo(t){t.root.addEventListener("click",e=>{jo(e.target)&&Iu(t,e,e.target)}),t.root.addEventListener("change",e=>{let{target:n}=e;jo(n)&&n.closest(Go())===t.root&&Ou(t,n)})}var it=new WeakMap,Mu=()=>c("product"),Fe=new Map;function In(t){t.forEach(e=>{Fe.has(e.handle)||Fe.set(e.handle,e.options.map(n=>n.name))})}var Wo=t=>t.tagName==="INPUT",Ru=t=>t.tagName==="INPUT"||t.tagName==="SELECT"||t.tagName==="TEXTAREA";function Nu(t){return Wo(t)&&t.type==="checkbox"?t.checked?t.value&&t.value!=="on"?t.value:"Yes":null:Wo(t)&&t.type==="radio"?t.checked?t.value:null:Ru(t)&&t.value||null}var De=class{constructor(e,n){T(this,"root");T(this,"product");T(this,"plans");T(this,"selected");T(this,"purchase");T(this,"variant");T(this,"quantity");this.root=e,this.product=n,this.plans=$(n);let r=new URLSearchParams(window.location.search),o=No(n,{variant:r.get("variant")||p(e,"variant"),sellingPlan:r.get("selling_plan"),defaultPlan:p(e,"default-plan"),defaultPurchase:p(e,"default-purchase")||a.defaultPurchase});this.selected=o.selected,this.purchase=o.purchase,this.variant=null,this.quantity=V(e,"quantity")?Math.max(0,parseInt(p(e,"quantity")??"",10)||0):1,it.set(e,this),e.setAttribute(m("state"),"ready"),e.removeAttribute(m("error")),this.renderProduct(),Qo(this),this.renderVariant(),Dr(e,"product"),dt("product"),h("product-ready",{product:n,scope:this},e)}update(e){let n=this.variant?.id;this.product=e,this.plans=$(e);let r=e.variants.nodes.find(o=>o.id===n);r&&(this.selected=Vt(r)),this.root.setAttribute(m("state"),"ready"),this.root.removeAttribute(m("error")),this.renderProduct(),this.renderVariant(),dt("product"),h("product-updated",{product:e,scope:this},this.root)}$(e){let n=ut(this.root,e,Mu());return this.root.matches(e)?[this.root,...n]:n}optName(e){if(!e)return"";let{options:n}=this.product;if(n.some(o=>o.name===e))return e;let r=(Fe.get(this.product.handle)??[]).indexOf(e);return n[r]?.name??e}get plan(){let e=Dt(this.purchase);return this.plans.find(n=>n.id===e)??null}get subscriptionAvailable(){return this.plans.some(e=>_(this.variant,e.id))}get isSubscription(){return $e(this.purchase,this.variant).kind==="subscription"}getLine(){if(!this.variant)return null;let e={merchandiseId:this.variant.id,quantity:this.quantity},n=$e(this.purchase,this.variant);n.kind==="subscription"&&(e.sellingPlanId=n.planId);let r=this.collectAttributes();return r.length&&(e.attributes=r),e}collectAttributes(){let e=Ee(Pe(this.root,"line-attributes")),n=this.$(c("line-attribute")).flatMap(r=>{let o=Nu(r);return o===null?[]:[{key:p(r,"line-attribute")??"",value:o}]});return[...e,...n]}select(e,n){if(this.selected[e]===n)return;let r=this.product.variants.nodes.filter(s=>s.selectedOptions.some(u=>u.name===e&&u.value===n)),[o]=r;if(!o)return;let i={...this.selected,[e]:n};if(!r.some(s=>s.selectedOptions.every(u=>i[u.name]===u.value))){let s=l=>l.selectedOptions.filter(g=>g.name!==e&&this.selected[g.name]===g.value).length*2+(l.availableForSale?1:0),u=r.reduce((l,d)=>s(d)>s(l)?d:l,o);Object.assign(i,Vt(u))}this.selected=i,this.renderVariant()}selectVariant(e){let n=this.product.variants.nodes.find(r=>r.id===B.variant(e));n&&(this.selected=Vt(n),this.renderVariant())}setPurchase(e){let n=_e(this.product,this.variant,e,Dt(this.purchase));n.kind!==this.purchase.kind&&(this.purchase=n,this.renderVariant())}selectPlan(e){let n=$t(this.product,e);n&&(this.purchase={kind:"subscription",planId:n.id},this.renderVariant())}setQuantity(e){let n=V(this.root,"quantity")?0:1;this.quantity=Math.max(n,parseInt(String(e),10)||0),this.$(c("qty")).forEach(r=>{w(r,this.quantity)}),this.renderVariant()}async addToCart(){if(!this.variant?.availableForSale)return null;let e=this.getLine();if(!e||e.quantity<1)return null;let n=await P.add(e);return h("product-added",{product:this.product,variant:this.variant,line:e},this.root),n}renderProduct(){let{product:e}=this;Fe.has(e.handle)||this.$(`${c("option-list")},select${c("option")}`).map(r=>p(r,"option-list")||p(r,"option")).some(r=>e.options.some(o=>o.name===r))&&In([e]),ao(this)}renderVariant(){let e=$o(this.product,{selected:this.selected,purchase:this.purchase,quantity:this.quantity},a.lowStock);if(!e){this.variant=null;return}this.variant=e.variant,this.selected=e.selected,this.purchase=e.purchase,qo(this,e),h("variant-changed",{product:this.product,variant:e.variant,selected:{...e.selected},purchase:e.purchase.kind,sellingPlanId:e.line.kind==="subscription"?e.line.planId:null},this.root)}};var Bo="url:",yt=()=>`${c("collection")},${c("products")},${c("recommendations")}`,$u=t=>t instanceof window.Element,Yo=t=>parseInt(t??"",10)||void 0,_u=t=>t==="COMPLEMENTARY"?"COMPLEMENTARY":"RELATED",Ve=class{constructor(e){T(this,"root");T(this,"products",[]);T(this,"pageInfo",null);T(this,"collection",null);T(this,"loadToken",0);this.root=e,ht(e,"loading"),e.addEventListener("click",n=>{if(!$u(n.target))return;let r=n.target.closest(c("load-more"));r?.closest(yt())===e&&(n.preventDefault(),W(r,()=>this.load(!0)))})}$(e){return ut(this.root,e,yt())}options(){let{root:e}=this,n={reverse:p(e,"reverse")==="true"},r=Yo(p(e,"limit"));r&&(n.first=r);let o=p(e,"sort");if(o&&(n.sortKey=o),V(e,"collection"))return n.collection=p(e,"collection")??"",n;let i=p(e,"products")??"";return n.query=i.startsWith(Bo)?new URL(window.location.href).searchParams.get(i.slice(Bo.length))||"":i,n}async loadRecommendations(){let{key:e}=X(this.root,window.location,"recommendations"),n=this.root.closest(c("product"));if(!e&&n&&({key:e}=X(n)),!e)throw new b("No product for recommendations",{code:"NOT_FOUND"});return Le(e,_u(p(this.root,"intent")))}async load(e=!1){this.loadToken+=1;let n=this.loadToken,r=()=>n!==this.loadToken;try{if(V(this.root,"recommendations")){let o=await this.loadRecommendations();if(r())return;let i=Yo(p(this.root,"limit"));this.products=i?o.slice(0,i):o}else{let o=await xe({...this.options(),after:e?this.pageInfo?.endCursor??null:null});if(r())return;this.collection=o.collection,this.pageInfo=o.pageInfo,this.products=e?[...this.products,...o.products]:o.products}this.render(),ht(this.root,"ready"),h("list-ready",{products:this.products,collection:this.collection},this.root)}catch(o){if(r())return;e||ht(this.root,ae(o)?"not-found":"error",o),ae(o)&&V(this.root,"recommendations")||f(o,"list load failed"),h("error",{error:o,context:"list"},this.root)}}render(){let{collection:e}=this;this.$(c("collection-bind")).forEach(r=>{switch(p(r,"collection-bind")??""){case"title":w(r,e?.title??"");break;case"description":ye(r,e?.descriptionHtml);break;case"image":O(r,e?.image?.url,e?.image?.altText||e?.title);break;case"count":w(r,this.products.length);break}}),this.$(c("list")).forEach(r=>{H(r,this.products,(o,i)=>{o.setAttribute(m("product"),i.handle),o.removeAttribute(m("state"))}),h("list-rendered",{container:r},this.root)});let n=this.products.length===0;this.$(c("show")).forEach(r=>{let o=p(r,"show");o==="list-empty"&&I(r,n),o==="list-filled"&&I(r,!n)}),this.$(c("load-more")).forEach(r=>{I(r,!!this.pageInfo?.hasNextPage)}),dt("list")}};var Uu='script[type="application/json"][data-tether-hydrate]',qt=new WeakSet,On=new WeakSet,xt=new Set,bt=new Set,zo=new WeakMap;function jt(){xt.forEach(t=>{t.isConnected||xt.delete(t)}),bt.forEach(t=>{t.root.isConnected||bt.delete(t)})}function Z(t,e){return[...t.matches?.(e)?[t]:[],...y(t,e)]}function Fu(t,e){let n=p(t,"page-title");!n||typeof document>"u"||(document.title=n.replace(/\{title\}/g,e.title).replace(/\{vendor\}/g,e.vendor||"").replace(/\{type\}/g,e.productType||""))}function Du(t,{fromUrl:e,raw:n}){e?(qt.add(t),ht(t,"not-found"),h("product-not-found",{key:null,source:n},t)):t.closest(yt())||v(`[${m("product")}] without a value. Bind it to the Shopify handle field, or use "url:handle".`,t)}function Vu(t,e,{fromUrl:n,raw:r},o){let i=ae(o);if(ht(t,i?"not-found":"error",o),!i){f(o,`product ${e}`),h("error",{error:o,context:"product",key:e},t);return}h("product-not-found",{key:e,source:r},t),n?L(`product not found: ${e}`):f(o,`product ${e}`)}function ue(t){if(qt.has(t))return!1;let{key:e,...n}=X(t);if(!e)return Du(t,n),!1;qt.add(t),xt.add(t);let r={};zo.set(t,r);let o=()=>zo.get(t)===r;return it.get(t)?t.setAttribute(m("state"),"updating"):ht(t,"loading"),Mn(rt(e)).then(s=>{if(!o())return;let u=it.get(t);u?u.update(s):new De(t,s),Fu(t,s),a.revalidate&&oo(e)&&Hu(e)}).catch(s=>{o()&&Vu(t,e,n,s)}),!0}function Xo(){jt(),xt.forEach(t=>{t.getAttribute(m("state"))!=="error"||t.getAttribute(m("error"))==="not-found"||(qt.delete(t),ue(t))})}var He=new Set;function Hu(t){He.size||setTimeout(ju,0),He.add(t)}function qu(t,e){xt.forEach(n=>{let r=it.get(n);if(!r||!n.isConnected)return;let o=X(n).key;o!==t&&o!==e.handle&&o!==e.id||JSON.stringify(r.product)!==JSON.stringify(e)&&r.update(e)})}function ju(){let t=[...He];He=new Set,t.forEach(e=>{io(e).then(n=>{qu(e,n)}).catch(n=>{f(n,`refresh ${e}`)})})}var st=null,Mn=t=>(st?.add(t),t);function qe(){if(!st)return;let t=[...st];Promise.allSettled(t).then(()=>{if(!(!st||t.some(e=>!st?.has(e)))){if(t.length!==st.size){qe();return}st=null,document.documentElement.classList.remove(`${a.prefix}-market-pending`)}})}function Gu(t){if(!C(t))return{country:void 0,language:void 0,products:[]};let{products:e}=t,n=Array.isArray(e)?e:[];return{country:U(t.country)??void 0,language:F(t.language)??void 0,products:n.filter(zr)}}var Jo=new WeakSet;function Rn(t=document){Z(t,Uu).forEach(e=>{if(Jo.has(e))return;Jo.add(e);let n;try{n=JSON.parse(e.textContent)}catch(s){v("bad data-tether-hydrate",s);return}let{country:r,language:o,products:i}=Gu(n);if(In(i),r===a.country&&o===a.language){ro(i);return}L("hydration skipped: other market"),st||(st=new Set,document.documentElement.classList.add(`${a.prefix}-market-pending`))})}var Ku=()=>`${a.prefix}:market:${a.domain}`,Qu={getItem:t=>vt(t)};function Wu(t){try{return JSON.parse(t)}catch(e){if(e instanceof SyntaxError)return null;throw e}}function Bu(t){if(typeof t!="object"||t===null)return null;let e=U(Reflect.get(t,"country"));if(!e)return null;let n=Reflect.get(t,"locale");return{country:e,language:F(Reflect.get(t,"language"))??void 0,locale:typeof n=="string"&&n?n:void 0}}var Yu=t=>Bu(Wu(t));function Nn(t=Qu){let e=t.getItem(Ku());return e?Yu(e):null}var ti={country:void 0,language:void 0,locale:void 0},$n=!1;function ei(){let t=n=>document.querySelector(`meta[name="${a.prefix}-page-${n}"]`)?.getAttribute("content")||void 0,e=U(t("country"));return e?{country:e,language:F(t("language"))??void 0,locale:t("locale")}:null}async function zu(){let t=a.markets??{};if(t.detect===!1)return null;if(!t.detect)return t.remember===!1?null:Nn();try{return(await x("markets")).detectMarket(t)}catch(e){return f(e,"markets"),null}}async function ni(t){ti={country:a.country,language:a.language,locale:a.locale};let e=ei();if($n=e!==null,e){a.country=e.country,a.language=e.language,e.locale&&(a.locale=e.locale);return}let n=await zu();n&&(n.country&&(a.country=n.country),n.language&&(a.language=n.language),n.locale&&!t.locale&&(a.locale=n.locale),L("market",n))}var Zo=(t,e)=>(t??"").toUpperCase()===(e??"").toUpperCase();function ri(){let t=ei(),e=t===null&&$n;$n=t!==null;let n=t??(e?Nn()??ti:null);return!n?.country||Zo(n.country,a.country)&&Zo(n.language,a.language)?null:{country:n.country,language:n.language,locale:n.locale}}function Lt(t,e){return x("markets").then(n=>n.setCountry(t,e))}var oi={"tether.diagnose.min.js":"sha384-GoSabxXrpEUWCpbWmyCt6Eby/SRGcvuJ1c8lQFVaLprF1MbfyZwlfundN9SJzHlS","tether.markets.min.js":"sha384-ZCR9y6ze/DzdKq13UxtHqcuWrujwCRgkMkock5VjQXA6svPWzCbim2/jseMyhsji","tether.search.min.js":"sha384-LdRf9V4s9Z9Jq0JASRj5LoGHLRYj98SnSKldeLxslwGFEuYTFVMYviMDVYORA9sN","tether.extras.min.js":"sha384-xKG8mQaRI9O7rOHGPtEMFCjCa5GJt8v1Pg+aUi1DnKMMCcRhbtXeB66FkiIBValW","tether.account.min.js":"sha384-bsEg4NX+L08ZQv6v4gRa9tvI5FBWjVBUPfgb7MAB9P0htKO+vWs0AetLGfVcHPWU","tether.account-pages.min.js":"sha384-PmV835ZgO/6emk4R8FSrpmAbAL4l9uacnyY6qc4RPauLLwB3GCQzxIKjbhlvKhak","tether.analytics.min.js":"sha384-PCfUr7l9kFJGvf6kowF32Q4j+PYp6VbtG+RAiqU7A1rXqHlSE3mf+NlhiOInGIC6"};function _n(t){return C(t)&&C(t.__core)&&C(t.__parts)}var ce="0.8.1";var si={get"config.ts"(){return[a,Mt,L,Kt,ze,f,v]},get"client.ts"(){return[Ze,Q,D,z,b]},get"dom.ts"(){return[Bt,m,Ee,h,he,M,p,V,Yt,ct,Pe,Rt,y,H,c,O,w,I]},get"loader.ts"(){return[Ae,rt]},get"selling-plans.ts"(){return[$]},get"status.ts"(){return[se,X]},get"cart.ts"(){return[P]},get"product.ts"(){return[it]},get"collection.ts"(){return[yt]},get"mounting.ts"(){return[bt,xt,qt,ue,jt,Z]},get"market-codes.ts"(){return[U,F]},get"page-market.ts"(){return[Lt]},get"shopify-values.ts"(){return[pe]},get"lazy.ts"(){return[x]}},Ju=/\.min\.js(\?|$)/,ii=typeof document>"u"?"":document.currentScript?.getAttribute("src")??"",je=ii?new URL(ii,document.baseURI).href:"",Xu=/^(https:\/\/cdn\.jsdelivr\.net\/(gh|npm)\/@?[^/@]+\/[^/@]+)(@(latest|\d+(\.\d+)?))?\//;function Zu(t){return t.replace(Xu,(e,n,r)=>`${n}@${r==="gh"?"v":""}${ce}/`)}var Ge=new Map;function tc(){return a.partsUrl?new URL(a.partsUrl,document.baseURI).href:je?Zu(je.replace(/[^/]*$/,"")):null}function ec(t,e){t.integrity=e,new URL(t.src).origin!==window.location.origin&&(t.crossOrigin="anonymous")}function nc(t,e,n,r){return new Promise((o,i)=>{let s=`${e.replace(/\/?$/,"/")}${n}`,u=document.createElement("script");u.src=s,u.async=!0,ec(u,r),u.onload=()=>{let l=Reflect.get(window,"Tether"),d=_n(l)?l.__parts[t]:void 0;if(d){o(d);return}Ge.delete(t);let g=_n(l)?"did not register":"can't register: window.Tether is no longer this Tether script's";i(new Error(`${s} ${g}`))},u.onerror=()=>{Ge.delete(t),i(new Error(`Could not load ${s}, or it is not the file built with this Tether script`))},document.head.appendChild(u)})}function x(t){let e=Ge.get(t);if(!e){let n=tc();if(n===null)return Promise.reject(new Error(`The Tether script's own location is unknown, so its ${t} part can't be found: set partsUrl.`));let r=Ju.test(je)||!je?".min":"",o=`tether.${t}${r}.js`,i=oi[o];if(i===void 0)return Promise.reject(new Error(`This Tether script was built without ${o}, so it can't load that part.`));e=nc(t,n,o,i),Ge.set(t,e)}return e}var ui=()=>`${a.prefix}:account-hint:${a.domain}`;function ai(t){ne(t,"sessionStorage"),ne(t,"localStorage")}function ci(){ai(`${a.prefix}:account:${a.domain}`),ai(`${a.prefix}:account-login:${a.domain}`)}var li=t=>t==="in"||t==="expired"||t==="error";var rc=["account-login","account-bind","account-link","orders","order","addresses","subscriptions","profile-form","address-form"],oc=()=>[...rc.map(t=>`[${m(t)}]`),`[${m("show")}^="logged-"]`].join(",");function ic(){return!!vt(ui())}function di(t){!a.account||!(Z(t,oc()).length>0||li(new URLSearchParams(window.location.search).get("account"))||ic())||x("account").then(n=>n.mountAccount(t)).catch(n=>{f(n,"account")})}function R(t){return(...e)=>x("account").then(n=>{let r=n[t];return r(...e)})}var pi={login:R("login"),logout:R("logout"),isLoggedIn:R("isLoggedIn"),customer:R("customer"),orders:R("orders"),order:R("order"),updateProfile:R("updateProfile"),addresses:R("addresses"),saveAddress:R("saveAddress"),deleteAddress:R("deleteAddress"),subscriptions:R("subscriptions"),subscriptionAction:R("subscriptionAction"),requestReturn:R("requestReturn"),render:R("render"),mountAccount:R("mountAccount")};var fi=()=>`data-${a.prefix}-key`,gi=t=>t instanceof window.Element;function hi(t){let e=t.closest(`[${fi()}]`),n=e?.getAttribute(fi());return e&&n?{line:e,id:n}:null}function Ke(t,e){t.catch(n=>{f(n,e)})}function sc(t,e){let n=hi(e);if(!n?.line.closest(c("cart-lines")))return;let{line:r,id:o}=n;if(e.closest(c("line-remove"))){t.preventDefault(),r.classList.add("is-busy"),Ke(P.removeLine(o),"cart line");return}let i=ac(e);!i||!P.lines.some(s=>s.id===o)||(t.preventDefault(),Ke(P.changeQuantity(o,i),"cart line"))}function ac(t){return t.closest(c("line-plus"))?1:t.closest(c("line-minus"))?-1:0}function uc(t){let{target:e}=t;if(!gi(e))return;if(e.closest(c("cart-open"))){t.preventDefault(),P.toggle();return}if(e.closest(c("cart-close"))){t.preventDefault(),P.close();return}let n=e.closest(c("cart-clear"));if(n){t.preventDefault(),W(n,()=>P.clear().catch(o=>{f(o,"cart clear")}));return}let r=e.closest(c("checkout"));if(r){t.preventDefault(),W(r,()=>P.checkout());return}sc(t,e)}function mi(t,e,n){t.classList.add("is-busy"),t.setAttribute("aria-busy","true"),Ke(e,n)}function cc(t){let{target:e}=t;if(!gi(e))return;let n=hi(e);n&&e instanceof window.HTMLInputElement&&e.matches(c("line","quantity"))?mi(n.line,P.updateLine(n.id,parseInt(e.value,10)||0),"cart line"):n&&e instanceof window.HTMLSelectElement&&e.matches(c("line-plan"))?mi(n.line,P.updateLine(n.id,{sellingPlanId:e.value||null}),"cart line plan"):lc(e)&&e.matches(c("cart-note"))&&Ke(P.setNote(e.value),"cart note")}var lc=t=>t instanceof window.HTMLInputElement||t instanceof window.HTMLTextAreaElement||t instanceof window.HTMLSelectElement;function dc(t){if(P.isOpen()){if(t.key==="Escape"){P.close();return}bn(t)}}function yi(){document.addEventListener("click",uc),document.addEventListener("change",cc),document.addEventListener("keydown",dc)}var Un=t=>t instanceof window.Element;function pc(t){let e=t.querySelector(c("discount-input"))??t.querySelector("input");return e instanceof window.HTMLInputElement?e:null}function bi(t,e,n){t.classList.toggle("is-invalid",n),n?e?.setAttribute("aria-invalid","true"):e?.removeAttribute("aria-invalid")}async function fc(t,e,n){try{await P.applyDiscount(n),bi(t,e,!1),h("discount-applied",{code:n},t),e&&(e.value="")}catch(r){bi(t,e,!0),r instanceof b&&r.code==="INVALID_DISCOUNT"?h("discount-invalid",{code:n},t):f(r,"discount")}}function mc(t){let{target:e}=t,n=Un(e)?e.closest(c("discount-form")):null;if(!n)return;t.preventDefault();let r=pc(n),o=r?.value.trim();o&&W(n,()=>fc(n,r,o))}function gc(t){let{target:e}=t;if(!Un(e))return;let n=e.closest(c("discount-form"));n&&(n.classList.remove("is-invalid"),e.removeAttribute("aria-invalid"))}function hc(t){let{target:e}=t,n=Un(e)?e.closest(c("discount-remove")):null;if(!n)return;t.preventDefault();let r=n.closest(c("discount-code"))?.getAttribute(m("discount-code"));r&&P.removeDiscount(r).catch(o=>{f(o,"discount")})}function Pi(){document.addEventListener("submit",mc,!0),document.addEventListener("input",gc),document.addEventListener("click",hc)}var Fn=t=>x("extras").then(e=>e.addGroup(t)),Dn=t=>{f(t,"extras")};function yc(t){let{target:e}=t,n=e instanceof window.Element?e.closest(c("group-add")):null;n&&(t.preventDefault(),W(n,()=>Fn(n)).catch(Dn))}function bc(t){!a.domain||!t.key?.startsWith(`${a.prefix}:`)||x("extras").then(e=>{e.onStorage(t)}).catch(Dn)}function Pc(t){if(!ct(t,"variant-changed"))return;let{target:e}=t;e instanceof window.Element&&(!a.variantUrl&&!e.hasAttribute(m("variant-url"))||x("extras").then(n=>{n.writeVariantUrl(e,t.detail)}).catch(Dn))}function Ei(){document.addEventListener("click",yc),window.addEventListener("storage",bc),document.addEventListener(`${a.prefix}:variant-changed`,Pc)}var Vn=null;function wi(){Vn=document.body}async function Ec(t){await t.ready();let e=ri();if(!e){Vn!==document.body&&t.mount(document);return}try{await Lt(e.country,{language:e.language??null,locale:e.locale,remember:!1})}catch(n){f(n,"country")}t.mount(document)}function wc(t){document.addEventListener("astro:page-load",()=>{Ec(t).catch(e=>{f(e,"page mount")})}),document.addEventListener("astro:before-swap",()=>{Vn=null,t.unmount()})}function Sc(t){let{target:e}=t;!(e instanceof window.HTMLSelectElement)||!e.matches(c("country-select"))||e.value&&Lt(e.value).catch(n=>{f(n,"country")})}function Cc(){Xo(),bt.forEach(t=>{t.root.getAttribute(m("state"))==="error"&&t.load()})}function Si(t){a.astro&&wc(t),document.addEventListener("change",Sc),window.addEventListener("online",Cc)}var kc=50;function Tc(){let t=zt("TETHER_CONFIG");return typeof t=="object"&&t!==null?Object.fromEntries(Object.entries(t)):{}}var Pt=null,Hn=null,ki=null,Ci=!1;function vc(t){let e=0;return Z(t,yt()).forEach(n=>{if(On.has(n))return;On.add(n),e++;let r=new Ve(n);bt.add(r),n.addEventListener(`${a.prefix}:list-rendered`,o=>{ct(o,"list-rendered")&&Qe(o.detail.container)}),Mn(r.load())}),e}function Ac(t){Z(t,`${c("country-select")},${c("country-bind")}`).length&&x("markets").then(e=>e.renderCountrySelects(t)).catch(e=>{f(e,"markets")}),di(t),Z(t,c("search")).length&&x("search").then(e=>{e.mountSearch(t)}).catch(e=>{f(e,"search")})}function Ti(t){let e=vc(t);return Z(t,c("product")).forEach(n=>{ue(n)&&e++}),Ac(t),e}function Qe(t=document){if(!Mt())return 0;t===document&&wi(),jt(),Rn(t.ownerDocument??document);let e=Ti(t);return qe(),P.render(),L(`mounted ${e} scope(s)`,t),e}function xc(t){let e=t.filter(r=>r.isConnected&&!t.some(o=>o!==r&&o.contains(r)));if(!e.length||!Mt())return;jt(),e.forEach(r=>{Rn(r)});let n=e.reduce((r,o)=>r+Ti(o),0);qe(),P.render(),L(`mounted ${n} scope(s) in ${e.length} added element(s)`)}function vi(){P.close()}function Lc(t){let e=t?.closest(c("product"));return e?it.get(e)??null:null}function Ic(){Ci||(Ci=!0,yi(),Pi(),Ei(),Si({ready:()=>Pt??Promise.resolve(null),mount:Qe,unmount:vi}))}function Oc(){let t=[];ki=t,Bt.forEach(e=>{document.addEventListener(`${a.prefix}:${e}`,n=>t.push(n))}),document.addEventListener("astro:page-load",e=>t.push(e)),x("analytics").then(e=>e.startAnalytics(t)).catch(e=>{f(e,"analytics")})}async function Mc(t){let e=a.country,n=t?.buyerIdentity.countryCode;if(!t||!e||!n||n===e)return t;try{return await P.setBuyerIdentity({countryCode:e},{create:!1})}catch(r){return f(r,"cart country"),t}}function Ai(t={}){return Pt&&!Object.keys(t).length?Pt:(ar({...Tc(),...t}),Mt()?(ci(),Ic(),a.observe&&Rc(),a.analytics&&!ki&&Oc(),Pt=ni(t).then(()=>P.init()).then(Mc).then(e=>(h("ready",{cart:e}),qn)),Pt):(v("TETHER_CONFIG is missing domain or token. Tether is idle."),Pt=Promise.resolve(null),Pt))}function Rc(){if(Hn||typeof MutationObserver>"u")return;let t,e=new Set;Hn=new MutationObserver(n=>{n.forEach(r=>{r.addedNodes.forEach(o=>{o instanceof window.Element&&e.add(o)})}),clearTimeout(t),t=setTimeout(()=>{let r=[...e];e.clear(),xc(r)},kc)}),Hn.observe(document.body,{childList:!0,subtree:!0})}var Nc=t=>x("markets").then(e=>e.detectMarket(t??a.markets)),$c=()=>x("markets").then(t=>t.getLocalization()),_c=t=>x("diagnose").then(e=>e.diagnose({...t,version:ce}));function Uc(t,e){let n=`${a.prefix}:${t}`,r=o=>{ct(o,t)&&e(o.detail,o)};return document.addEventListener(n,r),()=>{document.removeEventListener(n,r)}}var Fc={VERSION:ce,init:Ai,mount:Qe,unmount:vi,get config(){return sr},get ready(){return Pt??Promise.resolve(null)},query:yr,withContext:gr,cart:P,getProduct:rt,getProducts:xe,getRecommendations:Le,getScope:Lc,addGroup:Fn,account:pi,primeProduct:kt,normalizeProductKey:Ut,clearProductCache:Ae,formatMoney:M,imageUrl:fe,plans:pn,TetherError:b,resolveProductKey:X,setCountry:Lt,detectMarket:Nc,getLocalization:$c,diagnose:_c,on:Uc},Dc={__core:si,__parts:{}},qn=Object.assign(Fc,Dc),zf=qn;function Vc(){Reflect.set(window,"Tether",qn);let t=zt("TETHER_CONFIG");if(!t||tt(t,"autoMount")===!1||zt("TETHER_INTEGRATION"))return;let e=()=>{Ai().then(()=>Qe(document)).catch(n=>{f(n,"init")})};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",e,{once:!0}):e()}typeof window<"u"&&typeof document<"u"&&Vc();})();
|
|
1
|
+
(()=>{var Hn=Object.defineProperty;var Ti=(t,e,n)=>e in t?Hn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var ki=(t,e)=>{for(var n in e)Hn(t,n,{get:e[n],enumerable:!0})};var M=(t,e,n)=>Ti(t,typeof e!="symbol"?e+"":e,n);var Vn="2026-07";var vi=/^(\d{4})-(01|04|07|10)$/;function Ai(t){let e=vi.exec(typeof t=="string"?t:"");return e?{year:Number(e[1]),month:Number(e[2])}:null}var qn=t=>Ai(t)!==null;function T(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function X(t,e){return T(t)?t[e]:void 0}var xi=/^[A-Za-z0-9_.-]+$/,Li=/^(\$app(:[A-Za-z0-9_-]+)?|[A-Za-z0-9_.-]+)$/,Oi=/^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i,Ii=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,Mi=/^[A-Za-z_$][\w$]*$/,jn="https://site.invalid",Ri=new Set(["localhost","127.0.0.1","[::1]"]),Kt=["saved","server","webflow"],Ni=["no-banner","default-banner","custom-banner"],Qt=t=>typeof t=="string"&&t!=="",$i=t=>typeof t=="function";function Kn(t,e){if(typeof t!="string"||!t)return"";let n=t.replace(/^https?:\/\//,"").replace(/\/.*$/,"");return Fi(n)?n:(e("domain",t),"")}function Qn(t){if(!Qt(t))return!1;try{let e=new URL(t,`${jn}/`);return e.origin===jn?!0:e.protocol==="https:"||e.protocol==="http:"&&Ri.has(e.hostname)}catch{return!1}}function Wn(t,e){return t==null||t===""?null:typeof t=="string"&&(Qn(t)||_i(t))?t:(e("partsUrl",t),null)}function _i(t){if(typeof location>"u")return!1;try{return new URL(t).origin===location.origin}catch{return!1}}function Ui(t){if(typeof t!="string")return null;try{let e=new URL(t);return e.protocol==="https:"&&e.href===new URL(e.origin).href?e.origin:null}catch{return null}}function Bn(t,e){if(!Array.isArray(t))return e("embedOrigins",t),[];let n=[],r=t;for(let o of r){let i=Ui(o);i?n.push(i):e("embedOrigin",o)}return n}function Ge(t){let e,n;if(typeof t=="string"){let r=t.indexOf(".");e=r>0?t.slice(0,r):"",n=t.slice(r+1)}else typeof t=="object"&&t!==null&&(e=Reflect.get(t,"namespace"),n=Reflect.get(t,"key"));return typeof e!="string"||typeof n!="string"?null:Li.test(e)&&xi.test(n)?{namespace:e,key:n}:null}function Yn(t,e){if(!Array.isArray(t))return e("metafields",t),[];let n=[],r=t;for(let o of r){let i=Ge(o);i?n.push(typeof o=="string"?o:i):e("metafield",o)}return n}var Lt=t=>e=>t(e)?e:void 0,Fi=t=>Qt(t)&&Oi.test(t),Di=t=>Qt(t)&&Ii.test(t),Hi=t=>typeof t=="boolean"||Qt(t)&&Mi.test(t),Gt=Lt(Qn),le=Lt(Qt),Gn=Lt(t=>typeof t=="boolean"),zn=Lt($i);function Wt(t,e,n,r){if(e==null)return null;if(!T(e))return r(t,e),null;let o={};for(let i in n){let a=e[i];if(a===void 0)continue;let s=n[i](a);s===void 0?r(`${t}.${i}`,a):o[i]=s}return o}var Vi={server:Gt,orderUrl:Gt,subscriptionsUrl:Gt,paymentUrl:Gt,logoutUrl:Gt,locale:le,navigate:zn},qi="customer accounts need the Worker since 0.7.0: set account.server",ji={country:le,language:le,locale:le},Gi={detect:t=>{if(typeof t=="boolean")return t;let e=Array.isArray(t)?t:[t];return typeof t=="string"||Array.isArray(t)?Kt.filter(n=>e.includes(n)):void 0},locales:t=>{if(!T(t))return;let e={};for(let[n,r]of Object.entries(t)){let o=Wt(`markets.locales.${n}`,r,ji,()=>{});o&&(e[n]=o)}return e},cookie:Lt(Di),remember:Gn,strict:Gn},Ki={consent:t=>Ni.find(e=>e===t),proxy:t=>t!==void 0&&!!t},Qi={dataLayer:Lt(Hi),shopify:t=>typeof t=="boolean"?t:Wt("analytics.shopify",t,Ki,()=>{})??void 0,onEvent:zn};function Jn(t,e,n){let r=Wt("account",t,Vi,e);if(r===null)return null;let{server:o}=r;return o===void 0?(n(qi),null):{...r,server:o}}var Ke=(t,e)=>Wt("markets",t,Gi,e),Xn=(t,e)=>Wt("analytics",t,Qi,e);var Wi=/^[A-Z]{2}$/,Bi=new Set(["XX","T1"]),Yi=new Set(["PT_BR","PT_PT","ZH_CN","ZH_TW"]),zi=/^[A-Z]{2,3}$/;function _(t){let e=(typeof t=="string"?t:"").trim().toUpperCase();return!Wi.test(e)||Bi.has(e)?null:e}function U(t){let e=(typeof t=="string"?t:"").trim().replace("-","_").toUpperCase();if(Yi.has(e))return e;let n=e.split("_")[0]??"";return zi.test(n)?n:null}var it={domain:"",token:"",apiVersion:Vn,country:void 0,language:void 0,locale:void 0,markets:null,prefix:"tether",productPath:"/product",collectionPath:"/collection",metafields:[],embedOrigins:[],imagesFirst:25,variantsFirst:100,sellingPlanGroupsFirst:10,sellingPlansFirst:25,collectionFirst:24,retries:2,requestTimeout:15e3,revalidate:!0,storageKey:"",cartDrawerOpenClass:"is-open",openCartOnAdd:!0,cartFocus:!0,checkoutTarget:"_self",defaultPurchase:"one-time",variantUrl:!1,maxAge:60,lowStock:5,searchDelay:150,autoMount:!0,observe:!1,astro:!0,partsUrl:null,analytics:null,account:null,warningText:null,formatMoney:null,onLayoutChange:null,onCartOpen:null,onCartClose:null,onLineEnter:null,onLineLeave:null,onValueChange:null,onError:null,debug:!1},u={...it};function er(t){let e=n=>(k(`Tether.config is read-only (${String(n)}): pass options to Tether.init() instead`),!1);return new Proxy(t,{get(n,r){let o=Reflect.get(n,r);return typeof o=="object"&&o!==null?er(o):o},set:(n,r)=>e(r),deleteProperty:(n,r)=>e(r),defineProperty:(n,r)=>e(r)})}var nr=er(u),Ji=/^[a-z][a-z0-9-]*$/,Xi=["revalidate","openCartOnAdd","cartFocus","variantUrl","autoMount","observe","astro","debug"],Zi=["token","productPath","collectionPath","cartDrawerOpenClass"],ta=["imagesFirst","variantsFirst","sellingPlanGroupsFirst","sellingPlansFirst","collectionFirst","retries","requestTimeout","maxAge","lowStock","searchDelay"],ea=["warningText","formatMoney","onLayoutChange","onCartOpen","onCartClose","onLineEnter","onLineLeave","onValueChange","onError"];function Ot(t,e,n){return e!==void 0&&k(`invalid ${t} ${JSON.stringify(e)}: using ${JSON.stringify(n)}`),n}function j(t,e){k(`invalid ${t} ${JSON.stringify(e)}: ignored`)}function na(t){for(let e of Object.keys(t))e in it||k(`unknown option ${JSON.stringify(e)}: ignored`)}function ra(t,e,n){typeof n=="function"?t[e]=n:n!=null&&j(e,n)}var oa=new Set(["requestTimeout","searchDelay"]),ia=2147483647;function aa(t,e){let n=oa.has(t)?ia:Number.POSITIVE_INFINITY;return typeof e=="number"&&Number.isInteger(e)&&e>=0&&e<=n?e:Ot(t,e,it[t])}function sa(t,e){return typeof e=="boolean"?e:Ot(t,e,it[t])}function ua(t,e){return typeof e=="string"?e:Ot(t,e,it[t])}function ca(t){if(!(t==null||t==="")){try{if(typeof t=="string"&&Intl.getCanonicalLocales(t).length)return t}catch{}j("locale",t)}}function Zn(t,e,n){return n.find(r=>r===e)??Ot(t,e,n[0])}function la(t){return t==="unstable"?(k('apiVersion "unstable" changes without notice. Pin a dated version (e.g. 2026-07).'),t):qn(t)?t:Ot("apiVersion",t,it.apiVersion)}function tr(t,e,n){if(e==null||e==="")return;let r=n(e);if(r!==null)return r;j(t,e)}function da(t){na(t);let e=Kn(t.domain,j),n=typeof t.prefix=="string"&&Ji.test(t.prefix)?t.prefix:Ot("prefix",t.prefix,it.prefix),r={...it,domain:e,apiVersion:la(t.apiVersion),country:tr("country",t.country,_),locale:ca(t.locale),partsUrl:Wn(t.partsUrl,j),language:tr("language",t.language,U),markets:Ke(t.markets,j),analytics:Xn(t.analytics,j),account:Jn(t.account,j,k),prefix:n,storageKey:typeof t.storageKey=="string"&&t.storageKey?t.storageKey:`${n}:cart:${e}`,metafields:Yn(t.metafields??[],j),embedOrigins:Bn(t.embedOrigins??[],j),checkoutTarget:Zn("checkoutTarget",t.checkoutTarget,["_self","_blank"]),defaultPurchase:Zn("defaultPurchase",t.defaultPurchase,["one-time","subscription"])};for(let o of ta)r[o]=aa(o,t[o]);for(let o of Xi)r[o]=sa(o,t[o]);for(let o of Zi)r[o]=ua(o,t[o]);for(let o of ea)ra(r,o,t[o]);return r}var Qe=t=>Ke(t,j);function rr(t={}){let e=da(t);for(let n of Object.keys(u))n in e||Reflect.deleteProperty(u,n);return Object.assign(u,e)}var It=()=>!!(u.domain&&u.token);function L(...t){u.debug&&console.log(`[${u.prefix}]`,...t)}function k(...t){console.warn(`[${u.prefix}]`,...t)}function f(t,e){if(k(e,t instanceof Error&&t.message?t.message:t),!!u.onError)try{u.onError(t,e)}catch(n){k("onError threw",n)}}function or(t){return t instanceof Error?t.message:String(t)}var P=class extends Error{constructor(n,{status:r,errors:o,userErrors:i,code:a}={}){super(n);M(this,"name","TetherError");M(this,"code");M(this,"status");M(this,"errors");M(this,"userErrors");this.code=a??(r?`HTTP_${r}`:"ERROR"),this.status=r,this.errors=o,this.userErrors=i}};function G(t,e){return typeof e=="function"?e(t):typeof e=="string"?e==="object"?T(t):typeof t===e:pa(e)?Array.isArray(t)&&t.every(n=>G(n,e[0])):T(t)&&Object.entries(e).every(([n,r])=>r===void 0||G(t[n],r))}var pa=t=>Array.isArray(t),F=t=>e=>e===null||G(e,t),B=t=>e=>G(e,t);function Ye(t=u){return`https://${t.domain}/api/${t.apiVersion}/graphql.json`}var cr=/"(?:\\.|[^"\\\n])*"|#[^\n]*/g,fa=/^\s*(?:query|mutation)(?:\s+\w+)?\s*(?:\([^)]*\))?/;function ma(t){return/\bmutation\b/.test(t.replace(cr,""))?"mutation":"query"}function lr(t,{country:e,language:n}){let r=[];if(e&&r.push(`country: ${e}`),n&&r.push(`language: ${n}`),!r.length)return t;let o=`@inContext(${r.join(", ")})`,i=t.replace(cr,d=>" ".repeat(d.length)),a=i.indexOf("{");if(i.slice(0,a).includes("@inContext"))return t;if(i.trimStart().startsWith("{"))return`query ${o} ${t.slice(a)}`;let s=fa.exec(i);if(!s)return t;let l=s[0].length;return`${t.slice(0,l).trimEnd()} ${o} ${t.slice(l).trimStart()}`}function dr(t,e=u){let n=_(e.country)??void 0,r=U(e.language)??void 0;return lr(t,{country:n,language:r})}var ze=300,ga=500,ir=430,ha=1e3,Be="quantityAvailable",ar=new Set,ya=t=>`${t.domain} ${t.apiVersion} ${t.token}`;function ba(t,e,n,{context:r,operation:o}){let i=typeof e=="string"?e:e(n),a=r?lr(i,t):i;return t.maxAge<=0||o==="mutation"?a:`${a} #${Math.floor(Date.now()/(t.maxAge*ha))}`}var Pa=t=>new Promise(e=>setTimeout(e,t));function Je(t,e){if(t===401||t===403){let n=e.token.startsWith("shpat_")?", not an Admin API token (shpat_\u2026)":"";return`Shopify rejected the Storefront token for ${e.domain} (${t}): use the public Storefront API token (Headless channel)${n}`}return t===404?`Store or API version not found (404): check domain ${e.domain} and apiVersion ${e.apiVersion}`:`HTTP ${t} from ${e.domain}`}function Ea(t){let e=X(t,"message"),n=X(X(t,"extensions"),"code"),r=typeof e=="string"?e:"";return typeof n=="string"?{message:r,extensions:{code:n}}:{message:r}}function Sa(t){if(!T(t))return null;let{data:e,errors:n}=t;return n==null?{data:e}:Array.isArray(n)?{data:e,errors:n.map(Ea)}:null}function We(t,e){return t.ok?new P(`Invalid response (${t.status})`,{code:"INVALID_RESPONSE",status:t.status}):new P(Je(t.status,e),{status:t.status})}function sr(t,e,n,r){let o=e.map(a=>a.message).filter(Boolean).join(" | "),i=o||"Storefront API error";return t.ok||(i=t.status===401||t.status===403||!o?Je(t.status,n):o),new P(i,{status:t.status,errors:e,code:r})}function ur(t,e){if(e==="any")return{kind:"retry",backoffMs:ze};throw new P(`Network error: ${or(t)}`,{code:"NETWORK"})}function wa(t,e,n,r,o,i,a){if(n.includes(Be)&&r.some(g=>g.message.includes(Be)))return{kind:"inventory-refused",error:sr(t,r,e)};let s=r.map(g=>g.extensions?.code);if(i!=="none"&&s.includes("THROTTLED"))return{kind:"retry",backoffMs:ga};let l=s.includes("INTERNAL_SERVER_ERROR");if(i==="any"&&l)return{kind:"retry",backoffMs:ze};let d=t.ok&&(l||a==="mutation"&&o==null);throw sr(t,r,e,d?"SERVER_ERROR":void 0)}async function Ca(t,e){if(!t)return e(null);let n=new AbortController,r=setTimeout(()=>{n.abort(new DOMException("signal timed out","TimeoutError"))},t);try{return await e(n.signal)}finally{clearTimeout(r)}}async function Ta(t,e,n,r,o,i,a){let s;try{s=await(t.fetch??fetch)(Ye(t),{method:"POST",headers:{"Content-Type":"application/json","X-Shopify-Storefront-Access-Token":t.token},body:JSON.stringify({query:e,variables:n}),signal:a})}catch(v){return ur(v,o)}if(s.status===ir)throw new P("Shopify security rejection (430)",{status:ir});if(o!=="none"&&s.status===429||o==="any"&&s.status>=500)return{kind:"retry",backoffMs:ze};let l;try{l=await s.json()}catch(v){if(v instanceof SyntaxError)throw We(s,t);return ur(v,o)}let d=Sa(l);if(!d)throw We(s,t);let{data:g,errors:x=[]}=d;if(x.length)return wa(s,t,e,x,g,o,i);if(!s.ok)throw new P(Je(s.status,t),{status:s.status});if(!r(g))throw We(s,t);return{kind:"data",data:g}}async function pr(t,e,n,r,{context:o=!0,operation:i="query"}={}){if(!t.domain||!t.token)throw new P("Tether is not configured: domain and token are required",{code:"NOT_CONFIGURED"});let a=ya(t),s=i==="mutation"?"not-run":"any",l=0;for(;;){let d={inventory:!ar.has(a)},g=ba(t,e,d,{context:o,operation:i}),x=l<t.retries?s:"none",v=await Ca(t.requestTimeout,$=>Ta(t,g,n,r,x,i,$));switch(v.kind){case"data":return v.data;case"inventory-refused":if(typeof e=="string"||!d.inventory)throw v.error;L(`the token can't read inventory: ${Be} is left out from now on`),ar.add(a);break;case"retry":await Pa(v.backoffMs*2**l),l+=1,L("retry",l);break}}}function at(t,e,n,r){return pr(u,t,e,n,r)}var ka=t=>typeof t=="object"&&t!==null;function va(t,e,n={},r){return pr(t,e,n,ka,{...r,operation:ma(e)})}function fr(t,e,n){return va(u,t,e,n)}function mr(t,e){if(!t)throw new P(`${e}: empty response`);let n=t.userErrors??[];if(n.length)throw new P(n.map(r=>r.message).join(" | "),{userErrors:n});return t}var m=t=>`${u.prefix}-${t}`,c=(t,e)=>e===void 0?`[${m(t)}]`:`[${m(t)}="${e}"]`,p=(t,e)=>t.getAttribute(m(e)),st=(t,e)=>t.hasAttribute(m(e));function h(t,e){return t?[...t.querySelectorAll(e)]:[]}var ut=(t,e,n)=>h(t,e).filter(r=>r.closest(n)===t),Bt=["product-ready","list-ready","cart-updated","cart-toggled","checkout","search"],gr=new WeakMap;function hr(t,e){let n=new CustomEvent(`${u.prefix}:${t}`,{detail:e,bubbles:!0});return gr.set(n,t),n}function ct(t,e){return gr.get(t)===e}function y(t,e,n=document){n.dispatchEvent(hr(t,e))}var Aa="http://www.w3.org/1999/xhtml",xa=new Set(["h1","h2","h3","h4","h5","h6","p","span","div","br","hr","blockquote","code","pre","strong","em","b","i","u","s","small","sub","sup","ul","ol","li","dl","dt","dd","table","caption","colgroup","col","thead","tbody","tfoot","tr","th","td","a","img","picture","source","video","figure","figcaption","iframe"]),La=new Set(["script","style","template","noscript","textarea","select","title"]),Oa=new Set(["style","title","lang","dir","role","align","width","height"]),Ia=new Map([["a",new Set(["href","target","rel","hreflang"])],["img",new Set(["src","srcset","sizes","alt","loading","decoding"])],["source",new Set(["src","srcset","sizes","type","media"])],["video",new Set(["src","poster","controls","autoplay","muted","loop","playsinline","preload"])],["iframe",new Set(["src","allow","allowfullscreen","frameborder","loading"])],["blockquote",new Set(["cite"])],["ol",new Set(["start","type","reversed"])],["li",new Set(["value"])],["table",new Set(["border","cellpadding","cellspacing","summary"])],["col",new Set(["span"])],["colgroup",new Set(["span"])],["th",new Set(["colspan","rowspan","headers","scope","valign"])],["td",new Set(["colspan","rowspan","headers","valign"])]]),Ma=new Set(["href","src","poster","cite"]),Ra=/^(javascript|vbscript|data):/i,Na=/^data:image\/(png|gif|jpeg|webp|avif);/i,$a=new Set(["position","top","right","bottom","left","z-index","-webkit-box-reflect"]),_a=["inset","transform","translate","rotate","scale","offset"],Ua=/\d(?:[sld]?v|cq)(?:w|h|i|b|min|max)\b/i,Fa=/^(?:outline|box-shadow|text-shadow|filter|text-decoration|text-underline-offset|text-stroke)|^(?:border-image|mask-border|mask-box-image)(?:-outset)?$/,yr=40,Da=new Map([["letter-spacing",{px:4,em:.25}],["word-spacing",{px:4,em:.25}],["text-indent",{px:yr}]]),br=/(?<![\w#.-])[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?(%|[a-z]+)?/gi,Ha=/(?<![\w-])(?!drop-shadow\(|blur\()[\w-]+\([^()]*\)/g,Pr=/(?:var|calc|min|max|clamp|env|attr)\(/i,Va=/url\(|expression\(|@import/i,qa=/[\u0000- ]/g,ja="allow-scripts allow-same-origin allow-popups allow-presentation",Ga=new Set(["autoplay","encrypted-media","picture-in-picture","fullscreen","clipboard-write","accelerometer","gyroscope","web-share"]),Ka="strict-origin-when-cross-origin",Qa=["https://www.youtube.com","https://www.youtube-nocookie.com","https://player.vimeo.com","https://www.loom.com","https://fast.wistia.net"];function Wa(t,e){return Oa.has(e)||e.startsWith("aria-")||(Ia.get(t)?.has(e)??!1)}function Ba(t,e,n){let r=n.replace(qa,"");return Ra.test(r)?t==="img"&&e==="src"&&Na.test(r):!0}function Er(t,e){try{return new URL(t,e)}catch{return null}}function Ya(t,e,n){let r=t.baseURI,o=Er(r)?.origin??"null";return{origin:o==="null"?null:o,baseUrl:r,styleParser:e,embedOrigins:new Set([...Qa,...n])}}function za(t,e){let n=Er(t.trim(),e.baseUrl);return n!==null&&n.origin!==e.origin&&e.embedOrigins.has(n.origin)}function Ja(t){let e=t.split(";").map(n=>n.trim().split(/\s+/)[0]?.toLowerCase()??"");return[...new Set(e.filter(n=>Ga.has(n)))].join("; ")}function Xa(t,e){if($a.has(t)||_a.some(r=>t.startsWith(r))||Ua.test(e))return!0;let n=Da.get(t);return n?Pr.test(e)||Za(e,n):t.startsWith("margin")&&e.includes("-")}function Za(t,e){return[...t.matchAll(br)].some(([n="",r=""])=>{let o=parseFloat(n);if(o>=0)return!1;let i=e[r.toLowerCase()];return i===void 0||-o>i})}function ts(t,e){return Fa.test(t.replace(/^-webkit-/,""))?Pr.test(e)?!0:[...e.replace(Ha,"").matchAll(br)].some(([n="",r=""])=>{let o=Math.abs(parseFloat(n));return o!==0&&(r.toLowerCase()!=="px"||o>yr)}):!1}function es(t,e){let n=e.style;n.cssText=t;let r=Array.from({length:n.length},(i,a)=>n.item(a));for(let i of r){let a=n.getPropertyValue(i);(Xa(i,a)||ts(i,a)||Va.test(a))&&n.removeProperty(i)}let o=n.cssText;return e.removeAttribute("style"),o}function ns(t,e){let n=t.localName;for(let i of[...t.attributes]){let a=i.name.toLowerCase(),s=Ma.has(a);Wa(n,a)&&(!s||Ba(n,a,i.value))||t.removeAttribute(i.name)}let r=t.getAttribute("style");if(r===null)return;let o=es(r,e.styleParser);o===""?t.removeAttribute("style"):t.setAttribute("style",o)}function rs(t){if(t.localName==="iframe"){let n=Ja(t.getAttribute("allow")??"");n===""?t.removeAttribute("allow"):t.setAttribute("allow",n),t.setAttribute("sandbox",ja),t.setAttribute("referrerpolicy",Ka);return}if(t.localName!=="a"||t.getAttribute("target")?.toLowerCase()!=="_blank")return;let e=new Set((t.getAttribute("rel")??"").split(/\s+/).filter(Boolean));e.add("noopener"),e.add("noreferrer"),t.setAttribute("rel",[...e].join(" "))}function os(t,e){let n=t.localName,r=t.namespaceURI===Aa;if(r&&La.has(n)){t.remove();return}if(!r||!xa.has(n)){t.replaceWith(...t.childNodes);return}if(n==="iframe"&&!za(t.getAttribute("src")??"",e)){t.remove();return}ns(t,e),rs(t)}function Sr(t,e=globalThis.document,n=[]){let r=e.createElement("template");r.innerHTML=t??"";let o=Ya(e,r,n);for(let i of[...r.content.querySelectorAll("*")])os(i,o);return r.content}function de(t){if(typeof t!="string")return!1;try{return new URL(t).protocol==="https:"}catch{return!1}}function wr(t,e){if(!t)return"";let n=parseFloat(t.amount);if(Number.isNaN(n))return"";try{return new Intl.NumberFormat(e||void 0,{style:"currency",currency:t.currencyCode}).format(n)}catch{return`${t.currencyCode} ${n.toFixed(2)}`}}function Cr(t,e,n){if(!/\{(handle|id)\}/.test(t))return e?`${t.replace(/\/$/,"")}/${encodeURIComponent(e)}`:null;let r=n?n.split("/").at(-1)??"":"";return t.includes("{handle}")&&!e||t.includes("{id}")&&!r?null:t.replace(/\{handle\}/g,encodeURIComponent(e??"")).replace(/\{id\}/g,encodeURIComponent(r))}function Tr(t){let e=String(t??"").trim();return e?e.startsWith("gid://")?e:/^\d+$/.test(e)?`gid://shopify/Product/${e}`:/\/products\/([^/?#]+)/.exec(e)?.[1]??e:null}function pe(t,{width:e,height:n,crop:r}={}){if(!t)return t;let o;try{o=new URL(t)}catch(i){if(i instanceof TypeError)return t;throw i}return e&&o.searchParams.set("width",String(e)),n&&o.searchParams.set("height",String(n)),r&&o.searchParams.set("crop",r),o.toString()}function Xe(t,e){return t.getAttribute(e)??t.getAttribute(m(e))??t.getAttribute(`data-${e}`)}function vr(t,e){if(!t||!e)return t;let n=Xe(e,"max-width"),r=Xe(e,"max-height");return pe(t,{width:n,height:r,crop:n||r?Xe(e,"crop"):null})}var kr=t=>t.replace(/\?.*$/,"");function fe(t,e){return!t||!e?!1:kr(t)===kr(e)}function is(t){return/^\s*[a-z][a-z0-9+.-]*:/i.test(t)&&!/^\s*(https?:|data:image\/)/i.test(t)?"none":`url("${t.replace(/["\\\n\r\f]/g,r=>`\\${r.charCodeAt(0).toString(16)} `)}")`}function D(t,e,n){if(!e)return;let r=vr(e,t);if(t.tagName!=="IMG"){t.style.backgroundImage=is(r);return}if(fe(t.getAttribute("src"),r)){n!=null&&!t.getAttribute("alt")&&t.setAttribute("alt",n);return}t.removeAttribute("srcset"),t.removeAttribute("sizes"),t.setAttribute("src",r),n!=null&&t.setAttribute("alt",n),t.getAttribute("loading")||t.setAttribute("loading","lazy")}var Ze=new WeakMap,Yt=t=>!!Ze.get(t),tn=t=>t.cloneNode(!0);function Ar(t){let e=Ze.get(t);if(e!==void 0)return e;let n=t.firstElementChild,r=n?tn(n):null;return Ze.set(t,r),t.replaceChildren(),r}function Y(t,e,n){let r=Ar(t);if(!r){e.length&&k("repeater without a template child",t);return}t.replaceChildren(),e.forEach((o,i)=>{let a=tn(r);n(a,o,i),t.appendChild(a)})}function as(t,e){let n=()=>{t.remove()};if(!e){n();return}try{e(t,n)}catch(r){f(r,"repeater onLeave"),n()}}function ss(t,e,n,r){e.forEach((o,i)=>{if(!n.has(o))return;let a=e[i-1];if(a?.parentNode===t?a.after(o):t.prepend(o),!!r)try{r(o)}catch(s){f(s,"repeater onEnter")}})}function en(t,e,n,r,{onEnter:o,onLeave:i}={}){let a=Ar(t);if(!a){k("repeater without a template child",t);return}let s=`data-${u.prefix}-key`,l=`data-${u.prefix}-leaving`,d=()=>[...t.children].filter(w=>w.hasAttribute(s)&&!w.hasAttribute(l)),g=new Map(d().map(w=>[w.getAttribute(s),w])),x=[],v=new Set;e.forEach((w,ce)=>{let je=String(n(w,ce)),bt=g.get(je);bt?g.delete(je):(bt=tn(a),bt.setAttribute(s,je),v.add(bt)),r(bt,w,ce,v.has(bt)),x.push(bt)});let $=x.filter(w=>!v.has(w)),Dn=d().filter(w=>$.includes(w));if(!(Dn.length===$.length&&Dn.every((w,ce)=>w===$[ce]))){g.forEach(w=>{w.remove()}),x.forEach(w=>t.appendChild(w));return}ss(t,x,v,o),g.forEach(w=>{w.setAttribute(l,""),w.removeAttribute(s),w.style.pointerEvents="none",w.inert=!0,as(w,i)})}var xr="data-tether-seen",rn="data-tether-shown",me="data-tether-prev-display",us=120;function Mt(t,e){return Cr(u.productPath||"/product",t,e)}function Mr(t,e){try{return t()}catch(n){if(n instanceof RangeError)return e;throw n}}function Rr(t,e=u.locale){return t?Mr(()=>new Intl.NumberFormat(e||void 0,{style:"percent",maximumFractionDigits:0}).format(t/100),`${t}%`):""}function O(t){return t?u.formatMoney?u.formatMoney(t,u.locale):wr(t,u.locale):""}function ge(t){return t?Mr(()=>new Date(t).toLocaleDateString(u.locale||void 0),""):""}function he(t,e){t.replaceChildren(Sr(e,t.ownerDocument,u.embedOrigins))}var Nr=t=>t.tagName==="INPUT"||t.tagName==="TEXTAREA",Lr=t=>t.tagName==="INPUT";function S(t,e){let n=e==null?"":String(e);Nr(t)?t.value=n:t.textContent=n}var Or=t=>Nr(t)?t.value:t.textContent;function lt(t,e){let n=Or(t);if(S(t,e),n!==Or(t)&&t.hasAttribute(xr)&&u.onValueChange)try{u.onValueChange(t,n)}catch(r){f(r,"onValueChange")}t.setAttribute(xr,"1")}function cs(t){if(t.hasAttribute(rn))return;t.setAttribute(rn,""),t.removeAttribute("hidden");let e=t.getAttribute(me);e!==null?(t.style.display=e,t.removeAttribute(me)):t.style.display==="none"&&(t.style.display=""),typeof getComputedStyle=="function"&&getComputedStyle(t).display==="none"&&(t.style.display=t.getAttribute(m("display"))||"block")}function H(t,e){if(e){cs(t);return}t.removeAttribute(rn),!t.hasAttribute(me)&&t.style.display!=="none"&&t.setAttribute(me,t.style.display),t.style.display="none"}function ye(t,e){t.classList.toggle("is-selected",e),t.setAttribute("aria-pressed",e?"true":"false"),Lr(t)&&(t.type==="radio"||t.type==="checkbox")&&(t.checked=e);let n=t.querySelector('input[type="radio"],input[type="checkbox"]');n&&Lr(n)&&(n.checked=e)}var Ir,zt=t=>Reflect.get(window,t);function ls(){let t=zt("ScrollTrigger");if(typeof t!="function")return;let e=Reflect.get(t,"refresh");typeof e=="function"&&Reflect.apply(e,t,[])}function dt(t){clearTimeout(Ir),Ir=setTimeout(()=>{try{u.onLayoutChange?u.onLayoutChange(t):ls()}catch(e){f(e,"layout-changed")}y("layout-changed",{reason:t})},us)}function $r(t,e){let n=[...t.querySelectorAll("img")].filter(i=>!i.complete),r=n.length,o=()=>{r-=1,r===0&&dt(`${e}:images`)};n.forEach(i=>{i.addEventListener("load",o,{once:!0}),i.addEventListener("error",o,{once:!0})})}function K(t,e){return t.getAttribute("aria-busy")==="true"?Promise.resolve(void 0):(t.setAttribute("aria-busy","true"),Promise.resolve().then(e).finally(()=>{t.removeAttribute("aria-busy")}))}function be(t,e){let n=t?p(t,e):null;if(!n)return null;try{return JSON.parse(n)}catch{return k(`invalid JSON in ${m(e)}`,t),null}}function nn(t){return t==null?"":typeof t=="string"?t:typeof t=="number"||typeof t=="boolean"?String(t):JSON.stringify(t)}function Pe(t){return Array.isArray(t)?t.filter(T).map(n=>({key:nn(n.key),value:nn(n.value)})):T(t)?Object.entries(t).map(([e,n])=>({key:e,value:nn(n)})):[]}function Jt(t){return t?Array.isArray(t)?t.map(e=>({key:String(e.key),value:String(e.value??"")})):Object.entries(t).map(([e,n])=>({key:e,value:String(n??"")})):[]}var E="amount currencyCode",_r={inventory:!0},Ur=t=>t.inventory?"quantityAvailable":"",pt="url altText width height";function ds(t){let e=[];for(let r of t){let o=Ge(r);o&&e.push(o)}return e.length?`metafields(identifiers:[${e.map(({namespace:r,key:o})=>`{namespace: ${JSON.stringify(r)}, key: ${JSON.stringify(o)}}`).join(", ")}]){namespace key type value reference{... on MediaImage{image{${pt}}}}}`:""}var ps=` id name description recurringDeliveries options{name value}priceAdjustments{orderCount adjustmentValue{__typename ... on SellingPlanPercentagePriceAdjustment{adjustmentPercentage}... on SellingPlanFixedAmountPriceAdjustment{adjustmentAmount{${E}}}... on SellingPlanFixedPriceAdjustment{price{${E}}}}}`,fs=` sellingPlan{id}checkoutChargeAmount{${E}}remainingBalanceChargeAmount{${E}}priceAdjustments{price{${E}}compareAtPrice{${E}}perDeliveryPrice{${E}}unitPrice{${E}}}`;function Fr(t=u,e=_r){return` fragment TetherProduct on Product{id handle title description descriptionHtml productType vendor tags availableForSale publishedAt onlineStoreUrl requiresSellingPlan seo{title description}featuredImage{${pt}}images(first:${t.imagesFirst}){nodes{${pt}}}options{name optionValues{name swatch{color image{previewImage{${pt}}}}}}priceRange{minVariantPrice{${E}}maxVariantPrice{${E}}}compareAtPriceRange{minVariantPrice{${E}}maxVariantPrice{${E}}}${ds(t.metafields)} sellingPlanGroups(first:${t.sellingPlanGroupsFirst}){nodes{name appName options{name values}sellingPlans(first:${t.sellingPlansFirst}){nodes{${ps}}}}}variants(first:${t.variantsFirst}){nodes{id title availableForSale currentlyNotInStock ${Ur(e)} sku barcode selectedOptions{name value}image{${pt}}price{${E}}compareAtPrice{${E}}unitPrice{${E}}sellingPlanAllocations(first:${t.sellingPlansFirst}){nodes{${fs}}}}}}`}function on(t=_r){return` fragment TetherCart on Cart{id checkoutUrl totalQuantity note createdAt updatedAt attributes{key value}buyerIdentity{countryCode email}discountCodes{code applicable}cost{subtotalAmount{${E}}totalAmount{${E}}checkoutChargeAmount{${E}}}lines(first:100){nodes{id quantity attributes{key value}cost{totalAmount{${E}}subtotalAmount{${E}}amountPerQuantity{${E}}compareAtAmountPerQuantity{${E}}}discountAllocations{discountedAmount{${E}}}sellingPlanAllocation{sellingPlan{id name description recurringDeliveries options{name value}}checkoutChargeAmount{${E}}priceAdjustments{price{${E}}compareAtPrice{${E}}perDeliveryPrice{${E}}}}merchandise{... on ProductVariant{id title sku availableForSale requiresShipping ${Ur(t)} image{${pt}}price{${E}}compareAtPrice{${E}}selectedOptions{name value}product{id title handle vendor featuredImage{${pt}}}}}... on ComponentizableCartLine{lineComponents{id quantity merchandise{... on ProductVariant{id title product{title handle}}}}}}}}`}function Dr(){return` id handle title description descriptionHtml image{${pt}}seo{title description}`}var un={};ki(un,{GID:()=>Q,allPlans:()=>R,allocationFor:()=>N,findPlan:()=>Nt,hasPlans:()=>hs,planAdjustment:()=>sn,planCheckoutCharge:()=>an,planPrice:()=>Rt,planSavings:()=>Zt,plansForVariant:()=>ys,toGid:()=>Ee});var ms=/^(-?)(\d+)(?:\.(\d+))?$/;function Hr(t,e){let n=ms.exec(t.trim());if(!n)return null;let[,r="",o="0",i=""]=n,a=BigInt(`${o}${i.padEnd(e,"0")}`);return r==="-"?-a:a}var Vr=t=>t.split(".")[1]?.length??0;function Gr(t,e){if(t==null||e==null)return!1;let n=Math.max(Vr(t.trim()),Vr(e.trim())),r=Hr(t,n),o=Hr(e,n);return r===null||o===null?!1:r>o}var qr=2,jr=new Map;function Kr(t){let e=jr.get(t);if(e!==void 0)return e;let n=qr;try{n=new Intl.NumberFormat("en",{style:"currency",currency:t}).resolvedOptions().maximumFractionDigits??qr}catch{}return jr.set(t,n),n}function Pt(t){return Math.round(parseFloat(t.amount)*10**Kr(t.currencyCode))}function Xt(t,e){let n=Kr(e);return{amount:(t/10**n).toFixed(n),currencyCode:e}}var gs=100;function Ee(t,e){let n=typeof t=="string"||typeof t=="number"?String(t).trim():"";return n?n.startsWith("gid://")?n:/^\d+$/.test(n)?`gid://shopify/${e}/${n}`:n:null}var Q={product:t=>Ee(t,"Product"),variant:t=>Ee(t,"ProductVariant"),sellingPlan:t=>Ee(t,"SellingPlan")};function R(t){return(t?.sellingPlanGroups?.nodes??[]).flatMap(n=>n.sellingPlans.nodes.map(r=>({...r,group:n})))}function hs(t){return R(t).length>0}function N(t,e){return!t||!e?null:(t.sellingPlanAllocations?.nodes??[]).find(r=>r.sellingPlan.id===e)??null}function ys(t,e){return R(t).filter(n=>N(e,n.id))}function Rt(t,e){let n=N(t,e)?.priceAdjustments[0];return n?.perDeliveryPrice??n?.price??t?.price??null}function an(t,e){let n=N(t,e);return n?.checkoutChargeAmount??n?.priceAdjustments[0]?.price??t?.price??null}function Zt(t,e){let n=Rt(t,e);if(!t||!n)return{amount:null,percentage:0};let r=parseFloat(t.price.amount),o=parseFloat(n.amount);if(!Number.isFinite(r)||!Number.isFinite(o)||r<=0||o>=r)return{amount:null,percentage:0};let i=Pt(t.price)-Pt(n);return{amount:Xt(i,t.price.currencyCode),percentage:Math.round((1-o/r)*gs)}}function sn(t){let e=t?.priceAdjustments[0]?.adjustmentValue;if(!e)return null;switch(e.__typename){case"SellingPlanPercentagePriceAdjustment":return{type:"percentage",value:e.adjustmentPercentage};case"SellingPlanFixedAmountPriceAdjustment":return{type:"amount",value:e.adjustmentAmount};case"SellingPlanFixedPriceAdjustment":return{type:"price",value:e.price};default:return null}}function Nt(t,e){if(!e)return null;let n=R(t),r=Q.sellingPlan(e),o=e.trim().toLowerCase();return n.find(i=>i.id===r)??n.find(i=>i.name.toLowerCase()===o)??n.find(i=>i.options.some(a=>a.value.toLowerCase()===o))??null}var Z={amount:"string",currencyCode:"string"},$t={id:"string",handle:"string",title:"string",options:["object"],images:{nodes:["object"]},priceRange:{minVariantPrice:Z,maxVariantPrice:Z},variants:{nodes:[{id:"string",price:Z,selectedOptions:["object"]}]}},Qr={nodes:[$t],pageInfo:{hasNextPage:"boolean"}},Wr=t=>X(t,"id")!==""&&X(t,"handle")!==""&&G(t,$t),Br=t=>T(t)&&(t.id===void 0||G(t,$t)),xl=B({collection:F({handle:"string",products:Qr})}),Ll=B({products:Qr}),Ol=B({productRecommendations:F([$t])});var bs={id:"string",quantity:"number",attributes:["object"],cost:{totalAmount:Z,subtotalAmount:Z,amountPerQuantity:Z},merchandise:{id:"string",selectedOptions:["object"],product:"object"}},cn={id:"string",checkoutUrl:"string",totalQuantity:"number",attributes:["object"],discountCodes:["object"],cost:{totalAmount:Z,subtotalAmount:Z},lines:{nodes:[bs]}};var Ps='a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])',Es=60,ln=!1,Se=null,Ss=t=>t!==null&&"focus"in t,Yr=t=>h(t,Ps).filter(e=>e.offsetParent!==null||e===document.activeElement),Et=()=>h(document,c("cart-drawer")),dn=t=>t.classList.contains(u.cartDrawerOpenClass);function z(){let t=Et();return t.length?t.some(dn):ln}function we(t){h(document,c("cart-open")).forEach(e=>{e.setAttribute("aria-expanded",String(t))}),Et().forEach(e=>{e.hasAttribute("role")||e.setAttribute("role","dialog"),!e.hasAttribute("aria-label")&&!e.hasAttribute("aria-labelledby")&&e.setAttribute("aria-label",p(e,"cart-label")||"Cart"),e.setAttribute("aria-modal",String(t)),!dn(e)&&(e.setAttribute("aria-hidden","true"),u.cartFocus&&(e.inert=!0))})}function ws(t){let e=Yr(t)[0]??t;e===t&&!t.hasAttribute("tabindex")&&(t.tabIndex=-1),e.focus({preventScroll:!0})}function Ce(){if(z())return;ln=!0;let t=Et().filter(n=>p(n,"cart-drawer")!=="manual");t.forEach(n=>{n.inert=!1,n.classList.add(u.cartDrawerOpenClass),n.setAttribute("aria-hidden","false")}),we(!0);let[e]=t;u.cartFocus&&e&&(Se=Ss(document.activeElement)?document.activeElement:null,setTimeout(()=>{ws(e)},Es)),u.onCartOpen?.(t),y("cart-toggled",{open:!0})}function pn(){if(!z())return;ln=!1;let t=Et(),e=t.some(n=>n.contains(document.activeElement));t.forEach(n=>{n.classList.remove(u.cartDrawerOpenClass),n.setAttribute("aria-hidden","true"),u.cartFocus&&(n.inert=!0)}),we(!1),e&&Se?.isConnected&&Se.focus({preventScroll:!0}),Se=null,u.onCartClose?.(t),y("cart-toggled",{open:!1})}function zr(){z()?pn():Ce()}function fn(t){if(t.key!=="Tab"||!u.cartFocus||!z())return;let e=Et().find(dn);if(!e)return;let n=Yr(e),r=n[0],o=n.at(-1);if(!r||!o)return;let i=document.activeElement,a=t.shiftKey?i===r:i===o;e.contains(i)&&!a||(t.preventDefault(),(t.shiftKey?o:r).focus())}var Cs=1e4,Ts=6e4,V=new Map,mn=new Map,St=new Set,Te=new Map,Zr=[],gn=!1,te=0,Jr=t=>t.startsWith("gid://"),wt=Tr;function _t(t){if(!t)return;let e=Promise.resolve(t);V.set(t.handle,e),V.set(t.id,e)}function tt(t){let e=wt(t);if(!e)return Promise.reject(new P("empty product key",{code:"NOT_FOUND"}));let n=V.get(e);if(n)return n;let r=new Promise((o,i)=>{mn.set(e,{resolve:o,reject:i}),Zr.push(e),gn||(gn=!0,setTimeout(()=>void xs(),0))});return V.set(e,r),r}var hn=t=>e=>`${t}${Fr(u,e)}`;function ks(t){let e=t.filter(Jr),n=t.filter(s=>!Jr(s)),r=[],o=[],i={};return e.length&&(r.push("$ids: [ID!]!"),i.ids=e,o.push("byId:nodes(ids:$ids){... on Product{...TetherProduct}}")),n.forEach((s,l)=>{r.push(`$h${l}: String!`),i[`h${l}`]=s,o.push(`h${l}:product(handle:$h${l}){...TetherProduct}`)}),{query:hn(`query TetherProducts(${r.join(",")}){${o.join(" ")}}`),variables:i,handles:n}}function Xr(t,e){let n=mn.get(t);mn.delete(t),n&&e(n)}function vs(t,e){if(e!==te)return;let n=V.get(t);setTimeout(()=>{V.get(t)===n&&V.delete(t)},Cs)}function As(t){if(!T(t))return!1;let{byId:e=[],...n}=t;return G(e,[F(Br)])&&Object.values(n).every(F($t))}async function xs(){gn=!1;let t=te,e=Zr.splice(0);if(!e.length)return;let{query:n,variables:r,handles:o}=ks(e);L("fetch products",e);let i;try{i=await at(n,r,As)}catch(l){e.forEach(d=>{Xr(d,g=>{t===te&&V.delete(d),g.reject(l)})});return}let a=new Map;for(let l of i.byId??[])l?.id&&a.set(l.id,l);o.forEach((l,d)=>{let g=i[`h${d}`];g&&a.set(l,g)});let s=Date.now();e.forEach(l=>{Xr(l,d=>{let g=a.get(l);if(!g){vs(l,t),d.reject(new P(`Product not found: ${l}`,{code:"NOT_FOUND"}));return}t===te&&(_t(g),Te.set(g.handle,s),Te.set(g.id,s)),d.resolve(g)})})}function ke(){V.clear(),te+=1,St.clear(),Te.clear()}function to(t){for(let e of t??[])!e.id||!e.handle||Date.now()-(Te.get(e.handle)??0)<Ts&&V.has(e.handle)||(_t(e),St.add(e.handle),St.add(e.id))}function eo(t){let e=wt(t);return!e||!St.has(e)?!1:(St.delete(e),V.get(e)?.then(n=>{St.delete(n.handle),St.delete(n.id)},Ls),!0)}function Ls(){}function no(t){let e=wt(t);return e&&V.delete(e),tt(t)}var Os=/^image:(\d+)$/,ro="metafield:",Is=/^(rich_text|multi_line_text)_field$/,Ms=["","true","all","*"],ee=t=>t.tagName==="SELECT",Ct=(t,e)=>t.$(`select${e}`).filter(ee);function Rs(t,e){let n=e.images.nodes,r=[...t.children].map(i=>i.tagName==="IMG"?i:i.querySelector("img"));!Yt(t)&&r.length===n.length&&r.every((i,a)=>fe(i?.getAttribute("src"),n[a]?.url))||Y(t,n,(i,a)=>{let s=i.matches(`img,${c("bind","image")}`)?i:h(i,"img")[0]??i;D(s,a.url,a.altText||e.title)})}function Ns(t,e,n){let r=n.indexOf("."),o=n.slice(0,r),i=n.slice(r+1),a=(e.metafields??[]).find(l=>l?.namespace===o&&l.key===i);if(!a){S(t,"");return}let s=a.reference?.image;if(s){D(t,s.url,s.altText);return}Is.test(a.type)&&(t.style.whiteSpace="pre-line"),S(t,a.value)}var $s=new Map(Object.entries({title:t=>t.title,"description-text":t=>t.description,vendor:t=>t.vendor,type:t=>t.productType,handle:t=>t.handle,"published-at":t=>ge(t.publishedAt),"min-price":t=>O(t.priceRange.minVariantPrice),"max-price":t=>O(t.priceRange.maxVariantPrice)}));function _s(t,e){let n=(t.getAttribute("exclude")??"").split(",").map(o=>o.trim()).filter(Boolean),r=e.tags.filter(o=>!n.includes(o));Y(t,r,(o,i)=>{S(o,i)})}function Us(t,e,n){let r=$s.get(e);if(r){S(t,r(n));return}switch(e){case"description":he(t,n.descriptionHtml);break;case"featured-image":D(t,n.featuredImage?.url,n.featuredImage?.altText||n.title);break;case"url":case"link":{let o=Mt(n.handle,n.id);o&&t.setAttribute("href",o),e==="url"&&!t.firstElementChild&&!t.textContent.trim()&&S(t,n.title);break}case"images":Rs(t,n);break;case"tags":_s(t,n);break;default:Fs(t,e,n)}}function Fs(t,e,n){let r=Os.exec(e);if(r){let o=n.images.nodes[Number(r[1])-1]??n.featuredImage;D(t,o?.url,o?.altText||n.title)}else e.startsWith(ro)&&Ns(t,n,e.slice(ro.length))}function Ds(t){let{product:e}=t;t.$(c("option-list")).forEach(n=>{let r=t.optName(p(n,"option-list")),o=e.options.find(i=>i.name===r);if(!o||o.optionValues.length<=1&&st(n,"hide-single")){H(n,!1);return}Y(n,o.optionValues,(i,a)=>{i.setAttribute(m("option-value"),a.name);let s=h(i,c("bind","option-value"))[0];s?S(s,a.name):i.firstElementChild||S(i,a.name);let l=h(i,c("bind","swatch"))[0],{swatch:d}=a;!l||!d||(d.color&&(l.style.backgroundColor=d.color),d.image?.previewImage&&D(l,d.image.previewImage.url,a.name))})})}function Hs(t){let{product:e}=t;Ct(t,c("option")).forEach(n=>{let r=e.options.find(o=>o.name===t.optName(p(n,"option")));if(!r){H(n,!1);return}n.replaceChildren(...r.optionValues.map(o=>new Option(o.name,o.name)))}),Ct(t,c("variant-select")).forEach(n=>{n.replaceChildren(...e.variants.nodes.map(r=>new Option(r.title,r.id)))}),Ct(t,c("plan")).forEach(n=>{let r=t.plans.map(a=>new Option(a.name,a.id)),o=!e.requiresSellingPlan&&p(n,"plan")!=="subscription-only",i=n.getAttribute(m("one-time-label"))||"One-time purchase";n.replaceChildren(...o?[new Option(i,"")]:[],...r)})}function Vs(t){t.$(c("plan-list")).forEach(e=>{let n=(p(e,"plan-list")??"").trim(),r=Ms.includes(n.toLowerCase())?null:n,o=t.plans.filter(i=>!r||i.group.name===r);Y(e,o,(i,a)=>{i.setAttribute(m("plan-value"),a.id),!i.firstElementChild&&!i.querySelector(c("plan-bind"))&&S(i,a.name)})})}function oo(t){t.$(c("bind")).forEach(e=>{Us(e,p(e,"bind")??"",t.product)}),Ds(t),Hs(t),Vs(t)}var io="Default Title",yn=(t,e)=>e.get(t.id)?.quantity??t.quantity,ao=t=>t.split("/").pop()??t;function qs(t){let e=t.merchandise,n=Mt(e.product.handle,e.product.id);if(!n)return null;let r=new URLSearchParams;r.set("variant",ao(e.id));let o=t.sellingPlanAllocation?.sellingPlan.id;return o&&r.set("selling_plan",ao(o)),`${n}${n.includes("?")?"&":"?"}${r.toString()}`}var so=t=>t.merchandise.product.title,uo={title:so,"product-title":so,"variant-title":t=>t.merchandise.title===io?"":t.merchandise.title,options:t=>t.merchandise.selectedOptions.filter(e=>e.value!==io).map(e=>`${e.name}: ${e.value}`).join(", "),vendor:t=>t.merchandise.product.vendor,sku:t=>t.merchandise.sku??"",price:t=>O(t.cost.amountPerQuantity),"compare-at-price":t=>O(t.cost.compareAtAmountPerQuantity??t.merchandise.compareAtPrice),"line-total":t=>O(t.cost.totalAmount),"line-subtotal":t=>O(t.cost.subtotalAmount),quantity:(t,e)=>yn(t,e.pending),plan:t=>t.sellingPlanAllocation?.sellingPlan.name??"","plan-description":t=>t.sellingPlanAllocation?.sellingPlan.description??"",components:t=>(t.lineComponents??[]).map(e=>`${e.quantity} \xD7 ${e.merchandise.product.title}`).join(", ")},co="attribute:";function js(t,e,n){if(Object.hasOwn(uo,e))return uo[e]?.(t,n);if(!e.startsWith(co))return;let r=e.slice(co.length);return t.attributes.find(o=>o.key===r)?.value??""}function Gs(t,e,n){let r=R(n),o=!n.requiresSellingPlan&&p(t,"line-plan")!=="subscription-only",i={value:"",label:t.getAttribute(m("one-time-label"))||"One-time purchase"},a=[...o?[i]:[],...r.map(l=>({value:l.id,label:l.name}))],s=a.map(l=>l.value).join("|");t.dataset.tetherSig!==s&&(t.replaceChildren(...a.map(l=>{let d=document.createElement("option");return d.value=l.value,d.textContent=l.label,d})),t.dataset.tetherSig=s),t.value=e.sellingPlanAllocation?.sellingPlan.id??"",H(t,r.length>0)}function Ks(t,e,n){let r=!!e.sellingPlanAllocation;t.classList.toggle("is-subscription",r);let o=n.warnings.find(s=>s.target===e.id);t.classList.toggle("is-warning",!!o);let i=n.pending.has(e.id);t.classList.toggle("is-busy",i),i?t.setAttribute("aria-busy","true"):t.removeAttribute("aria-busy"),h(t,c("line","warning")).forEach(s=>{lt(s,o?.message??"")});let a=new Map([["subscription",r],["one-time",!r],["on-sale",Gr(e.cost.compareAtAmountPerQuantity?.amount,e.cost.amountPerQuantity.amount)],["has-components",(e.lineComponents??[]).length>0],["warning",!!o]]);h(t,c("line-show")).forEach(s=>{let l=p(s,"line-show"),d=l===null?void 0:a.get(l);d!==void 0&&H(s,d)})}function Qs(t,e,n){let r=e.merchandise;t.setAttribute(m("line-id"),e.id),h(t,c("line")).forEach(i=>{let a=p(i,"line")??"";if(a==="image"){D(i,r.image?.url??r.product.featuredImage?.url,r.product.title);return}if(a==="url"){let l=qs(e);l&&i.setAttribute("href",l);return}let s=js(e,a,n);s!==void 0&<(i,s)}),Ks(t,e,n),h(t,c("line-plan")).filter(ee).forEach(i=>{tt(r.product.handle).then(a=>{Gs(i,e,a)}).catch(a=>{f(a,"line plan options")})})}function Ws(t,e){let n=t?.totalQuantity??0,r=(t?.lines.nodes??[]).some(i=>i.sellingPlanAllocation),o=new Map([["cart-empty",n===0],["cart-filled",n>0],["cart-has-subscription",r],["cart-no-subscription",!r],["cart-has-discount",(t?.discountCodes??[]).some(i=>i.applicable)],["cart-error",e.failed],["cart-warning",e.warnings.length>0]]);h(document,c("show")).forEach(i=>{let a=p(i,"show"),s=a===null?void 0:o.get(a);s===void 0||i.closest(c("product"))||H(i,s)}),h(document,c("checkout")).forEach(i=>{i.classList.toggle("is-disabled",!n),i.setAttribute("aria-disabled",String(!n))})}function Bs(t){h(document,`textarea${c("cart-note")},input${c("cart-note")}`).forEach(e=>{document.activeElement!==e&&S(e,t?.note??"")}),h(document,c("cart-discounts")).forEach(e=>{Y(e,t?.discountCodes??[],(n,r)=>{n.setAttribute(m("discount-code"),r.code);let o=n.querySelector(c("discount","code"))??(n.firstElementChild?null:n);o&&S(o,r.code),n.classList.toggle("is-inapplicable",!r.applicable)})})}function lo(t){let{cart:e}=t,n=r=>e?O(e.cost[r]):"";we(z()),h(document,c("cart-count")).forEach(r=>{lt(r,e?.totalQuantity??0)}),h(document,c("cart-subtotal")).forEach(r=>{lt(r,n("subtotalAmount"))}),h(document,c("cart-total")).forEach(r=>{lt(r,n("totalAmount"))}),h(document,c("cart-checkout-charge")).forEach(r=>{lt(r,n("checkoutChargeAmount"))}),Ws(e,t),h(document,c("cart-warning")).forEach(r=>{lt(r,[...new Set(t.warnings.map(o=>o.message))].join(" "))}),Bs(e),h(document,c("cart-lines")).forEach(r=>{en(r,e?.lines.nodes??[],o=>o.id,(o,i)=>{Qs(o,i,t)},{onEnter:u.onLineEnter,onLeave:u.onLineLeave})}),e&&dt("cart")}function po(t){h(document,c("cart-count")).forEach(e=>{/^\s*0?\s*$/.test(e.textContent)&&(e.textContent=String(t))})}function Tt(t,e="localStorage"){try{return window[e].getItem(t)}catch{return null}}function ve(t,e,n="localStorage"){try{window[n].setItem(t,e)}catch{}}function ne(t,e="localStorage"){try{window[e].removeItem(t)}catch{}}var fo=/^gid:\/\/shopify\/Cart\/[\w-]+(\?key=[\w-]+)?$/;var q={kind:"unknown"},Ut=[],kt=new Map,Ae=()=>q;function A(){switch(q.kind){case"ready":case"error":return q.cart;case"unknown":case"empty":return null}}var go=()=>Ut,bn=t=>t?{kind:"ready",cart:t}:{kind:"empty"},ho=()=>`${u.storageKey}:seen`;function ft(){let t=Tt(u.storageKey);return t?fo.test(t)?t:(mt(),null):null}function mt(){ne(u.storageKey)}function Pn(t){q=bn(t),t&&ve(u.storageKey,t.id)}function re(){lo({cart:A(),warnings:Ut,pending:kt,failed:q.kind==="error"})}function oe(t){re(),y("cart-updated",{cart:A(),reason:t})}function W(t,e){return Pn(t),ve(ho(),`${Date.now()}|${t?.totalQuantity??0}`),oe(e),t}function ie(t){q=t.kind==="loaded"?bn(t.cart):{kind:"error",error:t.error,cart:null},oe("load")}function Ys(){let t=Tt(ho())?.split("|")[1]??"",e=Number(t);return/^\d+$/.test(t)&&Number.isSafeInteger(e)?e:null}function yo(){if(q.kind!=="unknown")return;let t=Ys();t!==null&&po(t)}function bo(t){Ut=t.filter((e,n)=>t.findIndex(r=>r.message===e.message)===n).map(e=>({...e,message:u.warningText?.(e)||e.message})),Ut.length&&y("cart-warning",{warnings:Ut})}var mo=()=>{};function zs(){let t=Promise.resolve();return e=>{let n=t.then(e);return t=n.then(mo,mo),n}}var Js=zs();function Po(t){return Js(t).then(e=>(q.kind==="error"&&(q=bn(q.cart),re()),e),e=>{throw q={kind:"error",error:e,cart:A()},re(),y("cart-error",{error:e}),e})}var En=t=>yn(t,kt),Xs=()=>({open:z(),count:A()?.totalQuantity??0,loaded:q.kind!=="unknown",warnings:[...Ut]});function Eo(t){let e=["cart-updated","cart-toggled"].map(r=>`${u.prefix}:${r}`),n=()=>{t(A(),Xs())};return e.forEach(r=>{document.addEventListener(r,n)}),n(),()=>{e.forEach(r=>{document.removeEventListener(r,n)})}}var Zs=/does not exist|not found|invalid id/i,tu=t=>B({[t]:F({cart:F(cn)})});function xe(t){return t instanceof P?t.userErrors?.some(e=>e.field?.[0]==="cartId")?!0:(t.errors??[]).some(e=>Zs.test(e.message)):!1}function wo(t){if(!(t instanceof P))return!1;let{code:e,status:n=0}=t;return e==="NETWORK"||e==="INVALID_RESPONSE"||e==="SERVER_ERROR"||n>=500}function Co(t,e=1,n={}){let r=typeof t=="object"&&t!==null?t:{...n,quantity:e,...t==null?{}:{variantId:t}},o=Q.variant(r.merchandiseId||r.variantId||r.id);if(!o)throw new P("add(): variantId is required");let i=parseInt(String(r.quantity??1),10),a={merchandiseId:o,quantity:Math.max(1,i||1)},s=Q.sellingPlan(r.sellingPlanId||r.sellingPlan);s&&(a.sellingPlanId=s);let l=Jt(r.attributes);return l.length&&(a.attributes=l),a}function eu(t,e,n){return r=>`mutation Tether_${t}(${e}){${t}(${n}){cart{...TetherCart}userErrors{field message}warnings{code message target}}}${on(r)}`}async function To(t,e,n,r){let o=await at(eu(t,e,n),r,tu(t),{operation:"mutation"}),i=mr(o[t],t);return bo(i.warnings??[]),i.cart}function So(t){let e=u.country?{buyerIdentity:{countryCode:u.country},...t}:t;return To("cartCreate","$input: CartInput!","input: $input",{input:e})}async function gt({name:t,args:e,inner:n,variables:r,createInput:o}){let i=ft();if(!i)return o?So(o):null;try{return await To(t,`$cartId: ID!, ${e}`,`cartId: $cartId, ${n}`,{...r,cartId:i})}catch(a){if(!xe(a)||(mt(),!o))throw a;return L("cart expired, creating a new one"),So(o)}}async function Sn(t){return(await at(n=>`query TetherCart($id:ID!){cart(id:$id){...TetherCart}}${on(n)}`,{id:t},B({cart:F(cn)}))).cart}async function ko(t){return(await at("query TetherCheckout($id:ID!){cart(id:$id){checkoutUrl}}",{id:t},B({cart:F({checkoutUrl:"string"})}))).cart?.checkoutUrl??null}function vo(t,e){let n=typeof e=="number"?{quantity:e}:e,r={id:t};n.quantity!==void 0&&(r.quantity=n.quantity),"sellingPlanId"in n&&(r.sellingPlanId=n.sellingPlanId?Q.sellingPlan(n.sellingPlanId):null),n.attributes&&(r.attributes=Jt(n.attributes));let o=n.merchandiseId||n.variantId;return o&&(r.merchandiseId=Q.variant(o)),r}var wn=t=>gt({name:"cartLinesUpdate",args:"$lines: [CartLineUpdateInput!]!",inner:"lines: $lines",variables:{lines:t},createInput:null}),Le=t=>gt({name:"cartLinesRemove",args:"$lineIds: [ID!]!",inner:"lineIds: $lineIds",variables:{lineIds:t},createInput:null}),Ao=(t,e)=>e>0?wn([{id:t,quantity:e}]):Le([t]);var Cn=null;function xo(t){Cn=t}var nu=t=>ko(t).then(e=>({kind:"url",url:e}),e=>({kind:"failed",error:e}));async function ru(){if(!Cn)return null;try{let t=await Cn();return t&&`${t}${t.includes("?")?"&":"?"}logged_in=true`}catch(t){return f(t,"account checkout"),null}}async function ou(t){let e=nu(t),n=await ru();if(n)return n;let r=await e;if(r.kind==="failed")throw r.error;if(!r.url)throw new P("No checkoutUrl (cart empty or expired)");return r.url}function iu(t){try{t.opener=null}catch{}}async function Lo(t=u.checkoutTarget){let e=ft(),n=A();if(!e||n&&!n.totalQuantity)return null;let r=t==="_blank"?window.open("","_blank"):null;r&&iu(r);try{let o=await ou(e);if(!de(o))throw new P("The checkout URL is not https: not opened");return y("checkout",{url:o,cart:A()}),r&&!r.closed?r.location.href=o:window.location.href=o,o}catch(o){return r?.close(),f(o,"checkout failed"),null}}var Oe=()=>A()?.lines.nodes??[];async function au(){let t=ft();if(t)try{let e=await Sn(t);e||mt(),W(e,"load")}catch(e){f(e,"cart reload after a failed change")}}function et(t){return Po(()=>t().catch(async e=>{throw wo(e)&&await au(),e}))}function su(t,e){let n=Oe().find(s=>s.id===t);if(!n)return Promise.resolve(A());let r=Math.max(0,En(n)+e),o={quantity:r};kt.set(t,o),oe("pending");let i=()=>kt.get(t)===o;return et(async()=>{if(!i())return A();if(Oe().find(d=>d.id===t)?.quantity===r)return A();let l=await Ao(t,r);return i()?W(l,r>0?"update":"remove"):(Pn(l),l)}).finally(()=>{i()&&(kt.delete(t),oe("settled"))})}function uu(t){let e=(A()?.discountCodes??[]).map(r=>r.code),n=typeof t=="function"?t(e):t;return(Array.isArray(n)?n:[n]).map(r=>r.trim()).filter(Boolean)}function cu(t){let e=new Map((A()?.attributes??[]).map(n=>[n.key,n.value]));return Jt(t).forEach(n=>e.set(n.key,n.value)),[...e].filter(([,n])=>n!=="").map(([n,r])=>({key:n,value:r}))}async function lu(){let t=ft();if(!t)return ie({kind:"loaded",cart:null}),null;yo();try{let e=await Sn(t);e||mt(),ie({kind:"loaded",cart:e})}catch(e){f(e,"cart load failed"),xe(e)&&mt(),ie({kind:"failed",error:e})}return A()}var b={init:lu,id:ft,get status(){return Ae()},get state(){return A()},get lines(){return[...Oe()]},get count(){return A()?.totalQuantity??0},get loaded(){return Ae().kind!=="unknown"},get lastError(){let t=Ae();return t.kind!=="error"?null:t.error instanceof Error?t.error:new Error(String(t.error))},get warnings(){return[...go()]},get pendingQty(){return kt},setCheckoutResolver:xo,forgetSaved(){mt(),ie({kind:"loaded",cart:null})},render:re,subscribe:Eo,add(t,e=1,n={}){let r=(Array.isArray(t)?t:[t]).map(o=>Co(o,e,n));return et(async()=>{let o=await gt({name:"cartLinesAdd",args:"$lines: [CartLineInput!]!",inner:"lines: $lines",variables:{lines:r},createInput:{lines:r}});if(!o)throw new P("Shopify answered the add without a cart");return W(o,"add"),y("added",{cart:o,lines:r}),u.openCartOnAdd&&Ce(),o})},updateLine(t,e){let n=typeof e=="number"?e:e.quantity;if(n!==void 0&&n<=0)return b.removeLine(t);let r=vo(t,e);return et(async()=>W(await wn([r]),"update"))},changeQuantity:su,quantityOf:En,removeLine(t){let e=Array.isArray(t)?t:[t];return et(async()=>W(await Le(e),"remove"))},clear(){return et(async()=>{let t=Oe().map(e=>e.id);return t.length?W(await Le(t),"remove"):A()})},setNote(t){let e={note:t??""};return et(async()=>W(await gt({name:"cartNoteUpdate",args:"$note: String!",inner:"note: $note",variables:e,createInput:e}),"note"))},setAttributes(t){return et(async()=>{let e={attributes:cu(t)},n=await gt({name:"cartAttributesUpdate",args:"$attributes: [AttributeInput!]!",inner:"attributes: $attributes",variables:e,createInput:e});return W(n,"attributes")})},setDiscountCodes(t){return et(async()=>{let e={discountCodes:uu(t)},n=await gt({name:"cartDiscountCodesUpdate",args:"$discountCodes: [String!]!",inner:"discountCodes: $discountCodes",variables:e,createInput:e});return W(n,"discount")})},async applyDiscount(t){let e=await b.setDiscountCodes(o=>[...new Set([...o,t])]),n=t.toLowerCase();if((e?.discountCodes??[]).find(o=>o.code.toLowerCase()===n)?.applicable)return e;try{await b.removeDiscount(t)}catch(o){f(o,"removing a discount code Shopify refused")}throw new P(`Discount code not valid: ${t}`,{code:"INVALID_DISCOUNT"})},removeDiscount(t){let e=t.toLowerCase();return b.setDiscountCodes(n=>n.filter(r=>r.toLowerCase()!==e))},setBuyerIdentity(t,{create:e=!0}={}){return et(async()=>{let n=await gt({name:"cartBuyerIdentityUpdate",args:"$buyerIdentity: CartBuyerIdentityInput!",inner:"buyerIdentity: $buyerIdentity",variables:{buyerIdentity:t},createInput:e?{buyerIdentity:t}:null}).catch(r=>{if(e||!xe(r))throw r;return null});return W(n,"buyer-identity")})},checkout:Lo,drawers:Et,isOpen:z,open:Ce,close:pn,toggle:zr};var du=100,pu=(t,e)=>Xt(Pt(t)*e,t.currencyCode),Dt=t=>Object.fromEntries(t.selectedOptions.map(e=>[e.name,e.value]));function fu(t,e){return t.variants.nodes.find(n=>n.selectedOptions.every(r=>e[r.name]===r.value))??null}function Oo(t,e,n,r){return t.variants.nodes.some(o=>o.availableForSale&&o.selectedOptions.every(i=>i.name===n?i.value===r:e[i.name]===i.value))}var Ft=t=>t.kind==="subscription"?t.planId:t.offeredPlanId;function Ie(t,e){return t.kind==="subscription"&&N(e,t.planId)?t:{kind:"one-time"}}function Me(t,e,n,r){let o=R(t),i=o.find(s=>s.id===r)??o[0];if(!i)return{kind:"one-time",offeredPlanId:null};let a=N(e,i.id)?i:o.find(s=>N(e,s.id))??i;return t.requiresSellingPlan||n==="subscription"?{kind:"subscription",planId:a.id}:{kind:"one-time",offeredPlanId:a.id}}function Io(t,{variant:e,sellingPlan:n,defaultPlan:r,defaultPurchase:o}){let i=t.variants.nodes,a=Q.variant(e),s=i.find(x=>x.id===a)??i.find(x=>x.availableForSale)??i[0]??null,l=Nt(t,n),d=l??Nt(t,r),g=l||o==="subscription"?"subscription":"one-time";return{selected:s?Dt(s):{},purchase:Me(t,s,g,d?.id??null)}}function mu(t,e,n,r,o){let i=t.quantityAvailable,a=i!=null&&i>0&&i<=e,s=r.compareAtPrice!==null,l=r.line.kind==="subscription";return{"in-stock":t.availableForSale,"out-of-stock":!t.availableForSale,backorder:t.availableForSale&&t.currentlyNotInStock,"on-sale":s,"not-on-sale":!s,"has-variants":n>1,"single-variant":n===1,"low-stock":a,"plenty-in-stock":t.availableForSale&&!a,"subscription-available":r.subscriptionAvailable,"subscription-unavailable":!r.subscriptionAvailable,"subscription-only":o,"one-time-available":!o,"subscription-selected":l,"one-time-selected":!l,"has-savings":l?r.savings.percentage>0:s}}function Mo(t,e,n){let r=fu(t,e.selected),o=r??t.variants.nodes[0];if(!o)return null;let i=Me(t,o,e.purchase.kind,Ft(e.purchase)),a=Ft(i),s=R(t),l=Ie(i,o),d=l.kind==="subscription"?N(o,l.planId):null,g=d?Rt(o,a)??o.price:o.price,x=d?.priceAdjustments[0]?.compareAtPrice??o.compareAtPrice,v={line:l,subscriptionAvailable:s.some($=>N(o,$.id)),compareAtPrice:x&&parseFloat(x.amount)>parseFloat(g.amount)?x:null,savings:Zt(o,a)};return{...v,variant:o,selected:r?e.selected:Dt(o),purchase:i,plan:s.find($=>$.id===a)??null,quantity:e.quantity,price:g,show:mu(o,n,t.variants.nodes.length,v,t.requiresSellingPlan)}}function Ro(t,e){let{variant:n,plan:r,price:o,compareAtPrice:i,quantity:a}=t,s=Ft(t.purchase),l=$=>pu($,Math.max(1,a)),v={price:()=>e.money(o),"total-price":()=>e.money(l(o)),"one-time-price":()=>e.money(n.price),"subscription-price":()=>e.money(s?Rt(n,s):null),"subscription-savings":()=>e.percent(t.savings.percentage),"subscription-savings-amount":()=>e.money(t.savings.amount),"checkout-charge":()=>{let $=t.line.kind==="subscription"?an(n,s)??o:o;return e.money(l($))},"plan-name":()=>r?.name,"plan-description":()=>r?.description,"plan-group":()=>r?.group.name,"compare-at-price":()=>e.money(i),"unit-price":()=>e.money(n.unitPrice),"discount-percentage":()=>i?`${Math.round((1-parseFloat(o.amount)/parseFloat(i.amount))*du)}%`:"0%","discount-amount":()=>i?e.money(Xt(Pt(i)-Pt(o),o.currencyCode)):"","variant-title":()=>n.title,"variant-id":()=>n.id,sku:()=>n.sku,barcode:()=>n.barcode,stock:()=>n.quantityAvailable,quantity:()=>a};return new Map(Object.entries(v))}function No(t,e,n,r){let i={name:()=>n?.name,option:()=>(n?.options??[]).map(a=>a.value).join(", "),description:()=>n?.description,price:()=>r.money(Rt(t,e)),savings:()=>r.percent(Zt(t,e).percentage),"savings-amount":()=>r.money(Zt(t,e).amount),adjustment:()=>{let a=sn(n);return a?a.type==="percentage"?`${a.value}%`:r.money(a.value):""}};return new Map(Object.entries(i))}function Tn(t){try{return decodeURIComponent(t)}catch(e){if(e instanceof URIError)return t;throw e}}var $o="url:";function vt(t,e=window.location,n="product"){let r=(p(t,n)??"").trim();if(!r.toLowerCase().startsWith($o))return{key:r||null,fromUrl:!1,raw:r};let o=r.slice($o.length).trim(),i;if(o.toLowerCase()==="path"){let a=e.pathname.split("/").filter(Boolean),s=a[a.length-1];i=s===void 0?null:Tn(s)}else i=new URLSearchParams(e.search).get(o||"handle");return{key:i?.trim()||null,fromUrl:!0,raw:r}}var Re=["loading","ready","error","not-found"],gu=t=>Re.some(e=>e===t),_o=t=>typeof t=="object"&&t!==null&&"code"in t?t.code:void 0,Ne=t=>_o(t)==="NOT_FOUND",ae=()=>["product","collection","products","recommendations"].map(t=>c(t)).join(","),Uo=(t,e)=>t===e||t.parentElement?.closest(ae())===e;function hu(t){let e=_o(t);return typeof e=="string"&&e?e:"error"}function nt(t,e,n){let r=e==="not-found",o=e==="error"||r;t.setAttribute(m("state"),r?"error":e),o?t.setAttribute(m("error"),r?"not-found":hu(n)):t.removeAttribute(m("error")),ut(t,c("show"),ae()).forEach(i=>{let a=p(i,"show");gu(a)&&H(i,a===e)}),o&&ut(t,c("add-to-cart"),ae()).forEach(i=>{i.classList.add("is-disabled"),i.setAttribute("aria-disabled","true"),"disabled"in i&&(i.disabled=!0)})}var Fo={money:O,percent:Rr},yu=t=>t.tagName==="INPUT";function kn(t){let e=h(t,c("add-label"))[0]??t,n=e.dataset.tetherLabel??(yu(e)?e.value:e.textContent);return e.dataset.tetherLabel=n,{label:e,original:n}}function bu(t,e){let{product:n}=t,r=o=>e.selected[t.optName(o)]??"";t.$(c("option-selected")).forEach(o=>{S(o,r(p(o,"option-selected")))}),t.$(c("option-list")).forEach(o=>{let i=t.optName(p(o,"option-list"));h(o,c("option-value")).forEach(a=>{let s=p(a,"option-value")??"";ye(a,e.selected[i]===s);let l=!Oo(n,e.selected,i,s);a.classList.toggle("is-unavailable",l),a.setAttribute("data-unavailable",l?"true":"false")})}),Ct(t,c("option")).forEach(o=>{o.value=r(p(o,"option"))}),Ct(t,c("variant-select")).forEach(o=>{o.value=e.variant.id})}function Pu(t,e){let{variant:n,purchase:r,line:o}=e;t.$(c("purchase")).forEach(i=>{if(ee(i)){i.value=r.kind;return}let a=p(i,"purchase");ye(i,a===r.kind);let s=a==="subscription"?!e.subscriptionAvailable:t.product.requiresSellingPlan;i.classList.toggle("is-unavailable",s)}),t.$(c("plan-value")).forEach(i=>{let a=p(i,"plan-value")??"";ye(i,o.kind==="subscription"&&a===o.planId),i.classList.toggle("is-unavailable",!N(n,a));let s=t.plans.find(d=>d.id===a),l=No(n,a,s,Fo);h(i,c("plan-bind")).forEach(d=>{let g=l.get(p(d,"plan-bind")??"");g&&S(d,g())})}),Ct(t,c("plan")).forEach(i=>{i.value=o.kind==="subscription"?o.planId:""})}function Eu(t,e){let n=new Map(Object.entries(e.show));Re.forEach(r=>n.set(r,r==="ready")),t.$(c("show")).forEach(r=>{let o=p(r,"show")??"",i=n.get(o);i!==void 0&&(Re.some(a=>a===o)&&!Uo(r,t.root)||H(r,i))})}function Su(t,e){let n=!e.variant.availableForSale;t.$(c("add-to-cart")).forEach(r=>{r.classList.toggle("is-disabled",n),r.setAttribute("aria-disabled",String(n)),"disabled"in r&&(r.disabled=n);let o=p(r,"soldout-text"),i=p(r,"subscribe-text");if(!o&&!i)return;let{label:a,original:s}=kn(r),l=s;e.line.kind==="subscription"&&i&&(l=i),n&&o&&(l=o),r.getAttribute("aria-busy")!=="true"&&S(a,l)})}function Do(t,e){let{variant:n}=e,{product:r}=t,o=Ro(e,Fo);t.$(c("bind")).forEach(i=>{let a=p(i,"bind")??"";if(a==="variant-image"){D(i,n.image?.url||r.featuredImage?.url,n.image?.altText||r.title);return}let s=o.get(a);s&&S(i,s())}),bu(t,e),Pu(t,e),Eu(t,e),t.root.classList.toggle("is-subscription",e.line.kind==="subscription"),t.root.setAttribute(m("purchase-mode"),e.line.kind),Su(t,e)}var Vo=()=>c("product"),wu=t=>t.tagName==="INPUT"||t.tagName==="SELECT"||t.tagName==="TEXTAREA",Ho=t=>t instanceof window.Element;function Ht(t,e,n){let r=e.closest(n);return r?.closest(Vo())===t.root?r:null}function Cu(t,e){let{label:n,original:r}=kn(e),o=p(e,"adding-text");K(e,async()=>{o&&S(n,o);try{await t.addToCart()}catch(i){f(i,"add to cart failed"),y("error",{error:i,context:"add-to-cart"},t.root)}finally{o&&S(n,r)}}).then(()=>{t.renderVariant()}).catch(i=>{f(i,"add to cart render")})}function Tu(t,e,n){let r=Ht(t,n,c("option-value")),o=r?.closest(c("option-list"));if(r&&o){e.preventDefault(),t.select(t.optName(p(o,"option-list")),p(r,"option-value")??"");return}let i=Ht(t,n,c("plan-value"));if(i){e.preventDefault(),t.selectPlan(p(i,"plan-value"));return}let a=Ht(t,n,`${c("purchase")}:not(select)`);if(a){a.tagName!=="INPUT"&&e.preventDefault(),t.setPurchase(qo(p(a,"purchase")));return}let s=Ht(t,n,c("qty-plus")),l=s?null:Ht(t,n,c("qty-minus"));if(s||l){e.preventDefault(),t.setQuantity(t.quantity+(s?1:-1));return}let d=Ht(t,n,c("add-to-cart"));d&&(e.preventDefault(),Cu(t,d))}var qo=t=>t==="subscription"?"subscription":"one-time";function ku(t,e){let n=wu(e)?e.value:"";e.matches(`select${c("option")}`)?t.select(t.optName(p(e,"option")),n):e.matches(`select${c("variant-select")}`)?t.selectVariant(n):e.matches(`select${c("plan")}`)?n?t.selectPlan(n):t.setPurchase("one-time"):e.matches(`select${c("purchase")}`)?t.setPurchase(qo(n)):e.matches(c("qty"))&&t.setQuantity(n)}function jo(t){t.root.addEventListener("click",e=>{Ho(e.target)&&Tu(t,e,e.target)}),t.root.addEventListener("change",e=>{let{target:n}=e;Ho(n)&&n.closest(Vo())===t.root&&ku(t,n)})}var rt=new WeakMap,vu=()=>c("product"),$e=new Map;function vn(t){t.forEach(e=>{$e.has(e.handle)||$e.set(e.handle,e.options.map(n=>n.name))})}var Go=t=>t.tagName==="INPUT",Au=t=>t.tagName==="INPUT"||t.tagName==="SELECT"||t.tagName==="TEXTAREA";function xu(t){return Go(t)&&t.type==="checkbox"?t.checked?t.value&&t.value!=="on"?t.value:"Yes":null:Go(t)&&t.type==="radio"?t.checked?t.value:null:Au(t)&&t.value||null}var _e=class{constructor(e,n){M(this,"root");M(this,"product");M(this,"plans");M(this,"selected");M(this,"purchase");M(this,"variant");M(this,"quantity");this.root=e,this.product=n,this.plans=R(n);let r=new URLSearchParams(window.location.search),o=Io(n,{variant:r.get("variant")||p(e,"variant"),sellingPlan:r.get("selling_plan"),defaultPlan:p(e,"default-plan"),defaultPurchase:p(e,"default-purchase")||u.defaultPurchase});this.selected=o.selected,this.purchase=o.purchase,this.variant=null,this.quantity=st(e,"quantity")?Math.max(0,parseInt(p(e,"quantity")??"",10)||0):1,rt.set(e,this),e.setAttribute(m("state"),"ready"),e.removeAttribute(m("error")),this.renderProduct(),jo(this),this.renderVariant(),$r(e,"product"),dt("product"),y("product-ready",{product:n,scope:this},e)}update(e){let n=this.variant?.id;this.product=e,this.plans=R(e);let r=e.variants.nodes.find(o=>o.id===n);r&&(this.selected=Dt(r)),this.root.setAttribute(m("state"),"ready"),this.root.removeAttribute(m("error")),this.renderProduct(),this.renderVariant(),dt("product"),y("product-updated",{product:e,scope:this},this.root)}$(e){let n=ut(this.root,e,vu());return this.root.matches(e)?[this.root,...n]:n}optName(e){if(!e)return"";let{options:n}=this.product;if(n.some(o=>o.name===e))return e;let r=($e.get(this.product.handle)??[]).indexOf(e);return n[r]?.name??e}get plan(){let e=Ft(this.purchase);return this.plans.find(n=>n.id===e)??null}get subscriptionAvailable(){return this.plans.some(e=>N(this.variant,e.id))}get isSubscription(){return Ie(this.purchase,this.variant).kind==="subscription"}getLine(){if(!this.variant)return null;let e={merchandiseId:this.variant.id,quantity:this.quantity},n=Ie(this.purchase,this.variant);n.kind==="subscription"&&(e.sellingPlanId=n.planId);let r=this.collectAttributes();return r.length&&(e.attributes=r),e}collectAttributes(){let e=Pe(be(this.root,"line-attributes")),n=this.$(c("line-attribute")).flatMap(r=>{let o=xu(r);return o===null?[]:[{key:p(r,"line-attribute")??"",value:o}]});return[...e,...n]}select(e,n){if(this.selected[e]===n)return;let r=this.product.variants.nodes.filter(a=>a.selectedOptions.some(s=>s.name===e&&s.value===n)),[o]=r;if(!o)return;let i={...this.selected,[e]:n};if(!r.some(a=>a.selectedOptions.every(s=>i[s.name]===s.value))){let a=l=>l.selectedOptions.filter(g=>g.name!==e&&this.selected[g.name]===g.value).length*2+(l.availableForSale?1:0),s=r.reduce((l,d)=>a(d)>a(l)?d:l,o);Object.assign(i,Dt(s))}this.selected=i,this.renderVariant()}selectVariant(e){let n=this.product.variants.nodes.find(r=>r.id===Q.variant(e));n&&(this.selected=Dt(n),this.renderVariant())}setPurchase(e){let n=Me(this.product,this.variant,e,Ft(this.purchase));n.kind!==this.purchase.kind&&(this.purchase=n,this.renderVariant())}selectPlan(e){let n=Nt(this.product,e);n&&(this.purchase={kind:"subscription",planId:n.id},this.renderVariant())}setQuantity(e){let n=st(this.root,"quantity")?0:1;this.quantity=Math.max(n,parseInt(String(e),10)||0),this.$(c("qty")).forEach(r=>{S(r,this.quantity)}),this.renderVariant()}async addToCart(){if(!this.variant?.availableForSale)return null;let e=this.getLine();if(!e||e.quantity<1)return null;let n=await b.add(e);return y("product-added",{product:this.product,variant:this.variant,line:e},this.root),n}renderProduct(){let{product:e}=this;$e.has(e.handle)||this.$(`${c("option-list")},select${c("option")}`).map(r=>p(r,"option-list")||p(r,"option")).some(r=>e.options.some(o=>o.name===r))&&vn([e]),oo(this)}renderVariant(){let e=Mo(this.product,{selected:this.selected,purchase:this.purchase,quantity:this.quantity},u.lowStock);if(!e){this.variant=null;return}this.variant=e.variant,this.selected=e.selected,this.purchase=e.purchase,Do(this,e),y("variant-changed",{product:this.product,variant:e.variant,selected:{...e.selected},purchase:e.purchase.kind,sellingPlanId:e.line.kind==="subscription"?e.line.planId:null},this.root)}};var Lu='script[type="application/json"][data-tether-hydrate]',Vt=new WeakSet,An=new WeakSet,At=new Set,ht=new Set,Ko=new WeakMap;function qt(){At.forEach(t=>{t.isConnected||At.delete(t)}),ht.forEach(t=>{t.root.isConnected||ht.delete(t)})}function J(t,e){return[...t.matches?.(e)?[t]:[],...h(t,e)]}function Ou(t,e){let n=p(t,"page-title");!n||typeof document>"u"||(document.title=n.replace(/\{title\}/g,e.title).replace(/\{vendor\}/g,e.vendor||"").replace(/\{type\}/g,e.productType||""))}function Iu(t,{fromUrl:e,raw:n}){e?(Vt.add(t),nt(t,"not-found"),y("product-not-found",{key:null,source:n},t)):t.closest(jt())||k(`[${m("product")}] without a value. Bind it to the Shopify handle field, or use "url:handle".`,t)}function Mu(t,e,{fromUrl:n,raw:r},o){let i=Ne(o);if(nt(t,i?"not-found":"error",o),!i){f(o,`product ${e}`),y("error",{error:o,context:"product",key:e},t);return}y("product-not-found",{key:e,source:r},t),n?L(`product not found: ${e}`):f(o,`product ${e}`)}function se(t){if(Vt.has(t))return!1;let{key:e,...n}=vt(t);if(!e)return Iu(t,n),!1;Vt.add(t),At.add(t);let r={};Ko.set(t,r);let o=()=>Ko.get(t)===r;return rt.get(t)?t.setAttribute(m("state"),"updating"):nt(t,"loading"),xn(tt(e)).then(a=>{if(!o())return;let s=rt.get(t);s?s.update(a):new _e(t,a),Ou(t,a),u.revalidate&&eo(e)&&Ru(e)}).catch(a=>{o()&&Mu(t,e,n,a)}),!0}function Wo(){qt(),At.forEach(t=>{t.getAttribute(m("state"))!=="error"||t.getAttribute(m("error"))==="not-found"||(Vt.delete(t),se(t))})}var Ue=new Set;function Ru(t){Ue.size||setTimeout($u,0),Ue.add(t)}function Nu(t,e){At.forEach(n=>{let r=rt.get(n);if(!r||!n.isConnected)return;let o=vt(n).key;o!==t&&o!==e.handle&&o!==e.id||JSON.stringify(r.product)!==JSON.stringify(e)&&r.update(e)})}function $u(){let t=[...Ue];Ue=new Set,t.forEach(e=>{no(e).then(n=>{Nu(e,n)}).catch(n=>{f(n,`refresh ${e}`)})})}var ot=null,xn=t=>(ot?.add(t),t);function Fe(){if(!ot)return;let t=[...ot];Promise.allSettled(t).then(()=>{if(!(!ot||t.some(e=>!ot?.has(e)))){if(t.length!==ot.size){Fe();return}ot=null,document.documentElement.classList.remove(`${u.prefix}-market-pending`)}})}function _u(t){if(!T(t))return{country:void 0,language:void 0,products:[]};let{products:e}=t,n=Array.isArray(e)?e:[];return{country:_(t.country)??void 0,language:U(t.language)??void 0,products:n.filter(Wr)}}var Qo=new WeakSet;function Ln(t=document){J(t,Lu).forEach(e=>{if(Qo.has(e))return;Qo.add(e);let n;try{n=JSON.parse(e.textContent)}catch(a){k("bad data-tether-hydrate",a);return}let{country:r,language:o,products:i}=_u(n);if(vn(i),r===u.country&&o===u.language){to(i);return}L("hydration skipped: other market"),ot||(ot=new Set,document.documentElement.classList.add(`${u.prefix}-market-pending`))})}var Uu=()=>`${u.prefix}:market:${u.domain}`,Fu={getItem:t=>Tt(t)};function Du(t){try{return JSON.parse(t)}catch(e){if(e instanceof SyntaxError)return null;throw e}}function Hu(t){if(typeof t!="object"||t===null)return null;let e=_(Reflect.get(t,"country"));if(!e)return null;let n=Reflect.get(t,"locale");return{country:e,language:U(Reflect.get(t,"language"))??void 0,locale:typeof n=="string"&&n?n:void 0}}var Vu=t=>Hu(Du(t));function On(t=Fu){let e=t.getItem(Uu());return e?Vu(e):null}var Yo={country:void 0,language:void 0,locale:void 0},In=!1;function zo(){let t=n=>document.querySelector(`meta[name="${u.prefix}-page-${n}"]`)?.getAttribute("content")||void 0,e=_(t("country"));return e?{country:e,language:U(t("language"))??void 0,locale:t("locale")}:null}async function qu(){let t=u.markets??{};if(t.detect===!1)return null;if(!t.detect)return t.remember===!1?null:On();try{return(await C("markets")).detectMarket(t)}catch(e){return f(e,"markets"),null}}async function Jo(t){Yo={country:u.country,language:u.language,locale:u.locale};let e=zo();if(In=e!==null,e){u.country=e.country,u.language=e.language,e.locale&&(u.locale=e.locale);return}let n=await qu();n&&(n.country&&(u.country=n.country),n.language&&(u.language=n.language),n.locale&&!t.locale&&(u.locale=n.locale),L("market",n))}var Bo=(t,e)=>(t??"").toUpperCase()===(e??"").toUpperCase();function Xo(){let t=zo(),e=t===null&&In;In=t!==null;let n=t??(e?On()??Yo:null);return!n?.country||Bo(n.country,u.country)&&Bo(n.language,u.language)?null:{country:n.country,language:n.language,locale:n.locale}}function xt(t,e){return C("markets").then(n=>n.setCountry(t,e))}var Zo={"tether.diagnose.min.js":"sha384-SmQnYWKzChmDvgTQ9WfdbVSZcY4fgackYVKEs070XnR9RYm5GAEMh/B2Thx9oC4f","tether.markets.min.js":"sha384-vTrvitQietX9BVIbXirxWy7Rfx7AwP0GxK+/EG8jN15yo0HO8reDWHGMJQn9yDep","tether.search.min.js":"sha384-Er3Elns3ZwrjcL404/doasLPtP1pfi5UAWmKgXWnqujQzy2AURY6nFNdmZUULe6F","tether.lists.min.js":"sha384-zrjHJrJFDiOLbhPuyfhueRFikCweKGQZ2OND1mSNThy4cJz0078cBiIcedeKonjA","tether.extras.min.js":"sha384-a8m0Jh1Q8zH0kqaNb2qhBt60OweAPOF3bKZpt2GXIA+L/dFHki/2vR6ZYQAPb28F","tether.account.min.js":"sha384-cN+gls3UC7/KPn/BazM+FzMpMqh4eWnC3m816wxPPMl03xnu/aP+4HADWPkL7rDk","tether.account-pages.min.js":"sha384-cx2Hxf/pCdzQ3V2kDrtwGReBtwpWPTxCl2VaMs63uPORnXx1XtEMT0pclKWecb97","tether.analytics.min.js":"sha384-K0BHBS1RgivsOFXziRB2Pt5D5/Y3lp4puHhFqRSHFpjO1A2ZYJ7OuBs0LtE5sQdl"};function Mn(t){return T(t)&&T(t.__core)&&T(t.__parts)}var ue="0.9.0";var ei={get"config.ts"(){return[u,It,L,Kt,Qe,f,k]},get"client.ts"(){return[Ye,at,G,F,B,P]},get"dom.ts"(){return[Bt,m,Pe,K,y,ge,O,p,st,Yt,ct,dt,be,Mt,h,Y,ut,c,D,he,S,H]},get"loader.ts"(){return[ke,tt,wt,_t,hn]},get"fragments.ts"(){return[Dr]},get"selling-plans.ts"(){return[R]},get"status.ts"(){return[ae,Ne,vt,nt]},get"cart.ts"(){return[b]},get"product.ts"(){return[rt]},get"collection.ts"(){return[jt]},get"mounting.ts"(){return[ht,At,Vt,se,qt,J]},get"market-codes.ts"(){return[_,U]},get"page-market.ts"(){return[xt]},get"shopify-values.ts"(){return[de]},get"lazy.ts"(){return[C]}},ju=/\.min\.js(\?|$)/,ti=typeof document>"u"?"":document.currentScript?.getAttribute("src")??"",De=ti?new URL(ti,document.baseURI).href:"",Gu=/^(https:\/\/cdn\.jsdelivr\.net\/(gh|npm)\/@?[^/@]+\/[^/@]+)(@(latest|\d+(\.\d+)?))?\//;function Ku(t){return t.replace(Gu,(e,n,r)=>`${n}@${r==="gh"?"v":""}${ue}/`)}var He=new Map;function Qu(){return u.partsUrl?new URL(u.partsUrl,document.baseURI).href:De?Ku(De.replace(/[^/]*$/,"")):null}function Wu(t,e){t.integrity=e,new URL(t.src).origin!==window.location.origin&&(t.crossOrigin="anonymous")}function Bu(t,e,n,r){return new Promise((o,i)=>{let a=`${e.replace(/\/?$/,"/")}${n}`,s=document.createElement("script");s.src=a,s.async=!0,Wu(s,r),s.onload=()=>{let l=Reflect.get(window,"Tether"),d=Mn(l)?l.__parts[t]:void 0;if(d){o(d);return}He.delete(t);let g=Mn(l)?"did not register":"can't register: window.Tether is no longer this Tether script's, another script replaced it";i(new Error(`${a} ${g}`))},s.onerror=()=>{He.delete(t),i(new Error(`Could not load ${a}, or it is not the file built with this Tether script. Host the same release's files next to the Tether script or at partsUrl.`))},document.head.appendChild(s)})}function C(t){let e=He.get(t);if(!e){let n=Qu();if(n===null)return Promise.reject(new Error(`The Tether script's own location is unknown, so its ${t} part can't be found: set partsUrl.`));let r=ju.test(De)||!De?".min":"",o=`tether.${t}${r}.js`,i=Zo[o];if(i===void 0)return Promise.reject(new Error(`This Tether script was built without ${o}, so it can't load that part.`));e=Bu(t,n,o,i),He.set(t,e)}return e}var jt=()=>`${c("collection")},${c("products")},${c("recommendations")}`;function ni(t){return nt(t,"loading"),{root:t,load:()=>C("lists").then(e=>e.loadList(t)).catch(e=>{nt(t,"error",e),f(e,"lists")})}}var oi=()=>`${u.prefix}:account-hint:${u.domain}`;function ri(t){ne(t,"sessionStorage"),ne(t,"localStorage")}function ii(){ri(`${u.prefix}:account:${u.domain}`),ri(`${u.prefix}:account-login:${u.domain}`)}var ai=t=>t==="in"||t==="expired"||t==="error";var Yu=["account-login","account-bind","account-link","orders","order","addresses","subscriptions","profile-form","address-form"],zu=()=>[...Yu.map(t=>`[${m(t)}]`),`[${m("show")}^="logged-"]`].join(",");function Ju(){return!!Tt(oi())}function si(t){!u.account||!(J(t,zu()).length>0||ai(new URLSearchParams(window.location.search).get("account"))||Ju())||C("account").then(n=>n.mountAccount(t)).catch(n=>{f(n,"account")})}function I(t){return(...e)=>C("account").then(n=>{let r=n[t];return r(...e)})}var ui={login:I("login"),logout:I("logout"),isLoggedIn:I("isLoggedIn"),customer:I("customer"),orders:I("orders"),order:I("order"),updateProfile:I("updateProfile"),addresses:I("addresses"),saveAddress:I("saveAddress"),deleteAddress:I("deleteAddress"),subscriptions:I("subscriptions"),subscriptionAction:I("subscriptionAction"),requestReturn:I("requestReturn"),render:I("render"),mountAccount:I("mountAccount")};var ci=()=>`data-${u.prefix}-key`,di=t=>t instanceof window.Element;function pi(t){let e=t.closest(`[${ci()}]`),n=e?.getAttribute(ci());return e&&n?{line:e,id:n}:null}function Ve(t,e){t.catch(n=>{f(n,e)})}function Xu(t,e){let n=pi(e);if(!n?.line.closest(c("cart-lines")))return;let{line:r,id:o}=n;if(e.closest(c("line-remove"))){t.preventDefault(),r.classList.add("is-busy"),Ve(b.removeLine(o),"cart line");return}let i=Zu(e);!i||!b.lines.some(a=>a.id===o)||(t.preventDefault(),Ve(b.changeQuantity(o,i),"cart line"))}function Zu(t){return t.closest(c("line-plus"))?1:t.closest(c("line-minus"))?-1:0}function tc(t){let{target:e}=t;if(!di(e))return;if(e.closest(c("cart-open"))){t.preventDefault(),b.toggle();return}if(e.closest(c("cart-close"))){t.preventDefault(),b.close();return}let n=e.closest(c("cart-clear"));if(n){t.preventDefault(),K(n,()=>b.clear().catch(o=>{f(o,"cart clear")}));return}let r=e.closest(c("checkout"));if(r){t.preventDefault(),K(r,()=>b.checkout());return}Xu(t,e)}function li(t,e,n){t.classList.add("is-busy"),t.setAttribute("aria-busy","true"),Ve(e,n)}function ec(t){let{target:e}=t;if(!di(e))return;let n=pi(e);n&&e instanceof window.HTMLInputElement&&e.matches(c("line","quantity"))?li(n.line,b.updateLine(n.id,parseInt(e.value,10)||0),"cart line"):n&&e instanceof window.HTMLSelectElement&&e.matches(c("line-plan"))?li(n.line,b.updateLine(n.id,{sellingPlanId:e.value||null}),"cart line plan"):nc(e)&&e.matches(c("cart-note"))&&Ve(b.setNote(e.value),"cart note")}var nc=t=>t instanceof window.HTMLInputElement||t instanceof window.HTMLTextAreaElement||t instanceof window.HTMLSelectElement;function rc(t){if(b.isOpen()){if(t.key==="Escape"){b.close();return}fn(t)}}function fi(){document.addEventListener("click",tc),document.addEventListener("change",ec),document.addEventListener("keydown",rc)}var Rn=t=>t instanceof window.Element;function oc(t){let e=t.querySelector(c("discount-input"))??t.querySelector("input");return e instanceof window.HTMLInputElement?e:null}function mi(t,e,n){t.classList.toggle("is-invalid",n),n?e?.setAttribute("aria-invalid","true"):e?.removeAttribute("aria-invalid")}async function ic(t,e,n){try{await b.applyDiscount(n),mi(t,e,!1),y("discount-applied",{code:n},t),e&&(e.value="")}catch(r){mi(t,e,!0),r instanceof P&&r.code==="INVALID_DISCOUNT"?y("discount-invalid",{code:n},t):f(r,"discount")}}function ac(t){let{target:e}=t,n=Rn(e)?e.closest(c("discount-form")):null;if(!n)return;t.preventDefault();let r=oc(n),o=r?.value.trim();o&&K(n,()=>ic(n,r,o))}function sc(t){let{target:e}=t;if(!Rn(e))return;let n=e.closest(c("discount-form"));n&&(n.classList.remove("is-invalid"),e.removeAttribute("aria-invalid"))}function uc(t){let{target:e}=t,n=Rn(e)?e.closest(c("discount-remove")):null;if(!n)return;t.preventDefault();let r=n.closest(c("discount-code"))?.getAttribute(m("discount-code"));r&&b.removeDiscount(r).catch(o=>{f(o,"discount")})}function gi(){document.addEventListener("submit",ac,!0),document.addEventListener("input",sc),document.addEventListener("click",uc)}var Nn=t=>C("extras").then(e=>e.addGroup(t)),$n=t=>{f(t,"extras")};function cc(t){let{target:e}=t,n=e instanceof window.Element?e.closest(c("group-add")):null;n&&(t.preventDefault(),K(n,()=>Nn(n)).catch($n))}function lc(t){!u.domain||!t.key?.startsWith(`${u.prefix}:`)||C("extras").then(e=>{e.onStorage(t)}).catch($n)}function dc(t){if(!ct(t,"variant-changed"))return;let{target:e}=t;e instanceof window.Element&&(!u.variantUrl&&!e.hasAttribute(m("variant-url"))||C("extras").then(n=>{n.writeVariantUrl(e,t.detail)}).catch($n))}function hi(){document.addEventListener("click",cc),window.addEventListener("storage",lc),document.addEventListener(`${u.prefix}:variant-changed`,dc)}var _n=null;function yi(){_n=document.body}async function pc(t){await t.ready();let e=Xo();if(!e){_n!==document.body&&t.mount(document);return}try{await xt(e.country,{language:e.language??null,locale:e.locale,remember:!1})}catch(n){f(n,"country")}t.mount(document)}function fc(t){document.addEventListener("astro:page-load",()=>{pc(t).catch(e=>{f(e,"page mount")})}),document.addEventListener("astro:before-swap",()=>{_n=null,t.unmount()})}function mc(t){let{target:e}=t;!(e instanceof window.HTMLSelectElement)||!e.matches(c("country-select"))||e.value&&xt(e.value).catch(n=>{f(n,"country")})}function gc(){Wo(),ht.forEach(t=>{t.root.getAttribute(m("state"))==="error"&&t.load()})}function bi(t){u.astro&&fc(t),document.addEventListener("change",mc),window.addEventListener("online",gc)}var hc=50;function yc(){let t=zt("TETHER_CONFIG");return typeof t=="object"&&t!==null?Object.fromEntries(Object.entries(t)):{}}var yt=null,Un=null,Ei=null,Pi=!1;function bc(t){let e=0;return J(t,jt()).forEach(n=>{if(An.has(n))return;An.add(n),e++;let r=ni(n);ht.add(r),n.addEventListener(`${u.prefix}:list-rendered`,o=>{ct(o,"list-rendered")&&qe(o.detail.container)}),xn(r.load())}),e}function Pc(t){J(t,`${c("country-select")},${c("country-bind")}`).length&&C("markets").then(e=>e.renderCountrySelects(t)).catch(e=>{f(e,"markets")}),si(t),J(t,c("search")).length&&C("search").then(e=>{e.mountSearch(t)}).catch(e=>{f(e,"search")})}function Si(t){let e=bc(t);return J(t,c("product")).forEach(n=>{se(n)&&e++}),Pc(t),e}function qe(t=document){if(!It())return 0;t===document&&yi(),qt(),Ln(t.ownerDocument??document);let e=Si(t);return Fe(),b.render(),L(`mounted ${e} scope(s)`,t),e}function Ec(t){let e=t.filter(r=>r.isConnected&&!t.some(o=>o!==r&&o.contains(r)));if(!e.length||!It())return;qt(),e.forEach(r=>{Ln(r)});let n=e.reduce((r,o)=>r+Si(o),0);Fe(),b.render(),L(`mounted ${n} scope(s) in ${e.length} added element(s)`)}function wi(){b.close()}function Sc(t){let e=t?.closest(c("product"));return e?rt.get(e)??null:null}function wc(){Pi||(Pi=!0,fi(),gi(),hi(),bi({ready:()=>yt??Promise.resolve(null),mount:qe,unmount:wi}))}function Cc(){let t=[];Ei=t,Bt.forEach(e=>{document.addEventListener(`${u.prefix}:${e}`,n=>t.push(n))}),document.addEventListener("astro:page-load",e=>t.push(e)),C("analytics").then(e=>e.startAnalytics(t)).catch(e=>{f(e,"analytics")})}async function Tc(t){let e=u.country,n=t?.buyerIdentity.countryCode;if(!t||!e||!n||n===e)return t;try{return await b.setBuyerIdentity({countryCode:e},{create:!1})}catch(r){return f(r,"cart country"),t}}function Ci(t={}){return yt&&!Object.keys(t).length?yt:(rr({...yc(),...t}),It()?(ii(),wc(),u.observe&&kc(),u.analytics&&!Ei&&Cc(),yt=Jo(t).then(()=>b.init()).then(Tc).then(e=>(y("ready",{cart:e}),Fn)),yt):(k("TETHER_CONFIG is missing domain or token. Tether is idle."),yt=Promise.resolve(null),yt))}function kc(){if(Un||typeof MutationObserver>"u")return;let t,e=new Set;Un=new MutationObserver(n=>{n.forEach(r=>{r.addedNodes.forEach(o=>{o instanceof window.Element&&e.add(o)})}),clearTimeout(t),t=setTimeout(()=>{let r=[...e];e.clear(),Ec(r)},hc)}),Un.observe(document.body,{childList:!0,subtree:!0})}var vc=t=>C("markets").then(e=>e.detectMarket(t??u.markets)),Ac=t=>C("lists").then(e=>e.getProducts(t)),xc=(t,e)=>C("lists").then(n=>n.getRecommendations(t,e)),Lc=()=>C("markets").then(t=>t.getLocalization()),Oc=t=>C("diagnose").then(e=>e.diagnose({...t,version:ue}));function Ic(t,e){let n=`${u.prefix}:${t}`,r=o=>{ct(o,t)&&e(o.detail,o)};return document.addEventListener(n,r),()=>{document.removeEventListener(n,r)}}var Mc={VERSION:ue,init:Ci,mount:qe,unmount:wi,get config(){return nr},get ready(){return yt??Promise.resolve(null)},query:fr,withContext:dr,cart:b,getProduct:tt,getProducts:Ac,getRecommendations:xc,getScope:Sc,addGroup:Nn,account:ui,primeProduct:_t,normalizeProductKey:wt,clearProductCache:ke,formatMoney:O,imageUrl:pe,plans:un,TetherError:P,resolveProductKey:vt,setCountry:xt,detectMarket:vc,getLocalization:Lc,diagnose:Oc,on:Ic},Rc={__core:ei,__parts:{}},Fn=Object.assign(Mc,Rc),Qf=Fn;function Nc(){Reflect.set(window,"Tether",Fn);let t=zt("TETHER_CONFIG");if(!t||X(t,"autoMount")===!1||zt("TETHER_INTEGRATION"))return;let e=()=>{Ci().then(()=>qe(document)).catch(n=>{f(n,"init")})};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",e,{once:!0}):e()}typeof window<"u"&&typeof document<"u"&&Nc();})();
|
|
2
2
|
//# sourceMappingURL=tether.min.js.map
|