@occluze/tether 0.9.7 → 0.9.8

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.
Files changed (56) hide show
  1. package/README.md +1 -1
  2. package/dist/esm/astro.js +1 -1
  3. package/dist/esm/chunks/account-QFGF5FKX.js +1 -0
  4. package/dist/esm/chunks/{account-pages-LKNIXA6Q.js → account-pages-LMGIPFB7.js} +1 -1
  5. package/dist/esm/chunks/{analytics-TEU7HS7C.js → analytics-YSTR6H2W.js} +1 -1
  6. package/dist/esm/chunks/{chunk-YZC4KFT3.js → chunk-4BZ4X2Z6.js} +1 -1
  7. package/dist/esm/chunks/{chunk-47OLTPHV.js → chunk-ADA2ZGPO.js} +1 -1
  8. package/dist/esm/chunks/{chunk-BRI56DD5.js → chunk-B7SC7UOJ.js} +1 -1
  9. package/dist/esm/chunks/{chunk-SVJWBCRY.js → chunk-BGUUUMJO.js} +1 -1
  10. package/dist/esm/chunks/{chunk-KJLA4CVH.js → chunk-GOGPMJ2U.js} +1 -1
  11. package/dist/esm/chunks/{chunk-JJRRVUDP.js → chunk-HGNFQHEU.js} +1 -1
  12. package/dist/esm/chunks/{chunk-HRRJ7KUG.js → chunk-I54NQEVK.js} +1 -1
  13. package/dist/esm/chunks/{chunk-QPSIX4DK.js → chunk-IBOX3YGQ.js} +1 -1
  14. package/dist/esm/chunks/chunk-KF76466X.js +1 -0
  15. package/dist/esm/chunks/chunk-KH7NEM4B.js +1 -0
  16. package/dist/esm/chunks/{chunk-74HC6MR2.js → chunk-PHTINCRN.js} +1 -1
  17. package/dist/esm/chunks/chunk-QUBBZNJ7.js +1 -0
  18. package/dist/esm/chunks/chunk-R3UWDQL5.js +1 -0
  19. package/dist/esm/chunks/{chunk-Y5LISDPZ.js → chunk-SA5G3AUJ.js} +1 -1
  20. package/dist/esm/chunks/{chunk-O6Z6O5NW.js → chunk-UJH5ZECZ.js} +1 -1
  21. package/dist/esm/chunks/chunk-XQCBGVU2.js +1 -0
  22. package/dist/esm/chunks/{diagnose-YNVDJDSH.js → diagnose-IOC3BCP5.js} +1 -1
  23. package/dist/esm/chunks/{extras-BUH3OWBN.js → extras-5E72QFSJ.js} +1 -1
  24. package/dist/esm/chunks/{lists-6KQIGAO6.js → lists-35SUHUOX.js} +1 -1
  25. package/dist/esm/chunks/markets-ui-B3ILTPN7.js +1 -0
  26. package/dist/esm/chunks/{search-NPGWPFMA.js → search-QN457Q2G.js} +1 -1
  27. package/dist/esm/index.js +1 -1
  28. package/dist/esm/server.js +2 -2
  29. package/dist/tether.account.js +12 -11
  30. package/dist/tether.account.min.js +1 -1
  31. package/dist/tether.js +119 -113
  32. package/dist/tether.lists.js +13 -11
  33. package/dist/tether.lists.min.js +1 -1
  34. package/dist/tether.markets.js +12 -0
  35. package/dist/tether.markets.min.js +1 -1
  36. package/dist/tether.min.js +1 -1
  37. package/dist/tether.min.js.map +4 -4
  38. package/dist/types/server/src/shared/serial.d.ts +2 -6
  39. package/dist/types/src/cart/checkout.d.ts +2 -1
  40. package/dist/types/src/cart/drawer.d.ts +5 -1
  41. package/dist/types/src/cart/mutations.d.ts +13 -13
  42. package/dist/types/src/cart/store.d.ts +4 -0
  43. package/dist/types/src/cart.d.ts +7 -2
  44. package/dist/types/src/config.d.ts +3 -1
  45. package/dist/types/src/fragments.d.ts +0 -2
  46. package/dist/types/src/part-use.d.ts +3 -0
  47. package/dist/types/src/shopify-fields.d.ts +8 -0
  48. package/dist/types/src/version.d.ts +1 -1
  49. package/package.json +5 -2
  50. package/dist/esm/chunks/account-53WAVEJF.js +0 -1
  51. package/dist/esm/chunks/chunk-EIPYBAVZ.js +0 -1
  52. package/dist/esm/chunks/chunk-FYGRVUVB.js +0 -1
  53. package/dist/esm/chunks/chunk-IG23NTJK.js +0 -1
  54. package/dist/esm/chunks/chunk-NXDME6AM.js +0 -1
  55. package/dist/esm/chunks/chunk-X2HBGPFB.js +0 -1
  56. package/dist/esm/chunks/markets-ui-YAEXVFRK.js +0 -1
@@ -1,2 +1,2 @@
1
- (()=>{var Zn=Object.defineProperty;var Bi=(t,e,n)=>e in t?Zn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var zi=(t,e)=>{for(var n in e)Zn(t,n,{get:e[n],enumerable:!0})};var M=(t,e,n)=>Bi(t,typeof e!="symbol"?e+"":e,n);var tr="2026-07";var Yi=/^(\d{4})-(01|04|07|10)$/;function Xi(t){let e=Yi.exec(typeof t=="string"?t:"");return e?{year:Number(e[1]),month:Number(e[2])}:null}var er=t=>Xi(t)!==null;function k(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function Z(t,e){return k(t)?t[e]:void 0}var Ji=/^[A-Za-z0-9_.-]+$/,Zi=/^(\$app(:[A-Za-z0-9_-]+)?|[A-Za-z0-9_.-]+)$/,Je=(t,e)=>Zi.test(t)&&Ji.test(e);function nr(t){let e=t.indexOf(".");if(e<=0)return null;let n=t.slice(0,e),r=t.slice(e+1);return Je(n,r)?{namespace:n,key:r}:null}var ts=/^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i,es=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,ns=/^[A-Za-z_$][\w$]*$/,rr="https://site.invalid",rs=new Set(["localhost","127.0.0.1","[::1]"]),Qt=["saved","server","webflow"],os=["no-banner","default-banner","custom-banner"],Bt=t=>typeof t=="string"&&t!=="",is=t=>typeof t=="function";function ir(t,e){if(typeof t!="string"||!t)return"";let n=t.replace(/^https?:\/\//,"").replace(/\/.*$/,"");return us(n)?n:(e("domain",t),"")}function sr(t){if(!Bt(t))return!1;try{let e=new URL(t,`${rr}/`);return e.origin===rr?!0:e.protocol==="https:"||e.protocol==="http:"&&rs.has(e.hostname)}catch{return!1}}function ar(t,e){return t==null||t===""?null:typeof t=="string"&&(sr(t)||ss(t))?t:(e("partsUrl",t),null)}function ss(t){if(typeof location>"u")return!1;try{return new URL(t).origin===location.origin}catch{return!1}}function as(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 ur(t,e){if(!Array.isArray(t))return e("embedOrigins",t),[];let n=[],r=t;for(let o of r){let i=as(o);i?n.push(i):e("embedOrigin",o)}return n}function Ze(t){if(typeof t=="string")return nr(t);if(typeof t!="object"||t===null)return null;let e=Reflect.get(t,"namespace"),n=Reflect.get(t,"key");return typeof e!="string"||typeof n!="string"?null:Je(e,n)?{namespace:e,key:n}:null}function cr(t,e){if(!Array.isArray(t))return e("metafields",t),[];let n=[],r=t;for(let o of r){let i=Ze(o);i?n.push(typeof o=="string"?o:i):e("metafield",o)}return n}var It=t=>e=>t(e)?e:void 0,us=t=>Bt(t)&&ts.test(t),cs=t=>Bt(t)&&es.test(t),ls=t=>typeof t=="boolean"||Bt(t)&&ns.test(t),Wt=It(sr),me=It(Bt),or=It(t=>typeof t=="boolean"),lr=It(is);function zt(t,e,n,r){if(e==null)return null;if(!k(e))return r(t,e),null;let o={};for(let i in n){let s=e[i];if(s===void 0)continue;let a=n[i](s);a===void 0?r(`${t}.${i}`,s):o[i]=a}return o}var ds={server:Wt,orderUrl:Wt,subscriptionsUrl:Wt,paymentUrl:Wt,logoutUrl:Wt,locale:me,navigate:lr},ps="customer accounts need the Worker since 0.7.0: set account.server",fs={country:me,language:me,locale:me},ms={detect:t=>{if(typeof t=="boolean")return t;let e=Array.isArray(t)?t:[t];return typeof t=="string"||Array.isArray(t)?Qt.filter(n=>e.includes(n)):void 0},locales:t=>{if(!k(t))return;let e={};for(let[n,r]of Object.entries(t)){let o=zt(`markets.locales.${n}`,r,fs,()=>{});o&&(e[n]=o)}return e},cookie:It(cs),remember:or,strict:or},gs={consent:t=>os.find(e=>e===t),proxy:t=>t!==void 0&&!!t},hs={dataLayer:It(ls),shopify:t=>typeof t=="boolean"?t:zt("analytics.shopify",t,gs,()=>{})??void 0,onEvent:lr};function dr(t,e,n){let r=zt("account",t,ds,e);if(r===null)return null;let{server:o}=r;return o===void 0?(n(ps),null):{...r,server:o}}var tn=(t,e)=>zt("markets",t,ms,e),pr=(t,e)=>zt("analytics",t,hs,e);var ys=/^[A-Z]{2}$/,bs=new Set(["XX","T1"]),Ps=new Set(["PT_BR","PT_PT","ZH_CN","ZH_TW"]),Es=/^[A-Z]{2,3}$/;function _(t){let e=(typeof t=="string"?t:"").trim().toUpperCase();return!ys.test(e)||bs.has(e)?null:e}function U(t){let e=(typeof t=="string"?t:"").trim().replace("-","_").toUpperCase();if(Ps.has(e))return e;let n=e.split("_")[0]??"";return Es.test(n)?n:null}function ge(t){if(typeof t!="string")return!1;try{return new URL(t).protocol==="https:"}catch{return!1}}function fr(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 mr(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 gr(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}var tt={domain:"",token:"",apiVersion:tr,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={...tt};function en(t){return T(`Tether.config is read-only (${String(t)}): pass options to Tether.init() instead`),!1}var hr=new WeakMap,wr={get:(t,e)=>yr(Reflect.get(t,e)),getOwnPropertyDescriptor(t,e){let n=Reflect.getOwnPropertyDescriptor(t,e);return n&&(n.value=yr(n.value)),n},set:(t,e)=>en(e),deleteProperty:(t,e)=>en(e),defineProperty:(t,e)=>en(e)};function yr(t){return typeof t=="object"&&t!==null?ws(t):t}function ws(t){let e=hr.get(t);return e||(e=new Proxy(t,wr),hr.set(t,e)),e}var Sr=new Proxy(u,wr),Ss=/^[a-z][a-z0-9-]*$/,Cs=["revalidate","openCartOnAdd","cartFocus","variantUrl","autoMount","observe","astro","debug"],Ts=["token","productPath","collectionPath"],ks=["imagesFirst","variantsFirst","sellingPlanGroupsFirst","sellingPlansFirst","collectionFirst","retries","requestTimeout","maxAge","lowStock","searchDelay"],As=["warningText","formatMoney","onLayoutChange","onCartOpen","onCartClose","onLineEnter","onLineLeave","onValueChange","onError"];function wt(t,e,n){return e!==void 0&&T(`invalid ${t} ${JSON.stringify(e)}: using ${JSON.stringify(n)}`),n}function G(t,e){T(`invalid ${t} ${JSON.stringify(e)}: ignored`)}function xs(t){for(let e of Object.keys(t))Object.hasOwn(tt,e)||T(`unknown option ${JSON.stringify(e)}: ignored`)}function vs(t,e,n){typeof n=="function"?t[e]=n:n!=null&&G(e,n)}var br=2147483647,Ls=10,Yt={min:1,max:250},Os={imagesFirst:Yt,variantsFirst:Yt,sellingPlanGroupsFirst:Yt,sellingPlansFirst:Yt,collectionFirst:Yt,requestTimeout:{max:br},searchDelay:{max:br},retries:{max:Ls}};function Is(t,e){let{min:n=0,max:r}=Os[t]??{};return typeof e!="number"||!Number.isInteger(e)||e<n?wt(t,e,tt[t]):r===void 0||e<=r?e:(T(`${t} ${String(e)} is more than its maximum: using ${String(r)}`),r)}function Ms(t,e){return typeof e=="boolean"?e:wt(t,e,tt[t])}function Rs(t,e){return typeof e=="string"?e:wt(t,e,tt[t])}var Ns=/^\S+$/;function $s(t,e){return typeof e=="string"&&Ns.test(e)?e:wt(t,e,tt[t])}function _s(t){if(!(t==null||t==="")){try{if(typeof t=="string"&&Intl.getCanonicalLocales(t).length)return t}catch{}G("locale",t)}}function Pr(t,e,n){return n.find(r=>r===e)??wt(t,e,n[0])}function Us(t){return t==="unstable"?(T('apiVersion "unstable" changes without notice. Pin a dated version (e.g. 2026-07).'),t):er(t)?t:wt("apiVersion",t,tt.apiVersion)}function Er(t,e,n){if(e==null||e==="")return;let r=n(e);if(r!==null)return r;G(t,e)}function Fs(t){xs(t);let e=ir(t.domain,G),n=typeof t.prefix=="string"&&Ss.test(t.prefix)?t.prefix:wt("prefix",t.prefix,tt.prefix),r={...tt,domain:e,apiVersion:Us(t.apiVersion),country:Er("country",t.country,_),locale:_s(t.locale),partsUrl:ar(t.partsUrl,G),language:Er("language",t.language,U),markets:tn(t.markets,G),analytics:pr(t.analytics,G),account:dr(t.account,G,T),prefix:n,storageKey:typeof t.storageKey=="string"&&t.storageKey?t.storageKey:`${n}:cart:${e}`,metafields:cr(t.metafields??[],G),embedOrigins:ur(t.embedOrigins??[],G),checkoutTarget:Pr("checkoutTarget",t.checkoutTarget,["_self","_blank"]),defaultPurchase:Pr("defaultPurchase",t.defaultPurchase,["one-time","subscription"]),cartDrawerOpenClass:$s("cartDrawerOpenClass",t.cartDrawerOpenClass)};for(let o of ks)r[o]=Is(o,t[o]);for(let o of Cs)r[o]=Ms(o,t[o]);for(let o of Ts)r[o]=Rs(o,t[o]);for(let o of As)vs(r,o,t[o]);return r}var rn=t=>tn(t,G);function Cr(t={}){let e=Fs(t);for(let n of Object.keys(u))n in e||Reflect.deleteProperty(u,n);return Object.assign(u,e)}var Mt=()=>!!(u.domain&&u.token);function L(...t){u.debug&&console.log(`[${u.prefix}]`,...t)}function T(...t){console.warn(`[${u.prefix}]`,...t)}function m(t,e){if(T(e,t instanceof Error&&t.message?t.message:t),!!u.onError)try{u.onError(t,e)}catch(n){T("onError threw",n)}}function V(t,e,n){try{return e()}catch(r){return m(r,t),n?.()}}function Tr(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);M(this,"name","TetherError");M(this,"code");M(this,"status");M(this,"errors");M(this,"userErrors");this.code=s??(r?`HTTP_${r}`:"ERROR"),this.status=r,this.errors=o,this.userErrors=i}};function K(t,e){return typeof e=="function"?e(t):typeof e=="string"?e==="object"?k(t):typeof t===e:Ds(e)?Array.isArray(t)&&t.every(n=>K(n,e[0])):k(t)&&Object.entries(e).every(([n,r])=>r===void 0||K(t[n],r))}var Ds=t=>Array.isArray(t),F=t=>e=>e===null||K(e,t),z=t=>e=>K(e,t);function an(t=u){return`https://${t.domain}/api/${t.apiVersion}/graphql.json`}var Lr=/"(?:\\.|[^"\\\n])*"|#[^\n]*/g,Hs=/^\s*(?:query|mutation)(?:\s+\w+)?\s*(?:\([^)]*\))?/;function Vs(t){return/\bmutation\b/.test(t.replace(Lr,""))?"mutation":"query"}function Or(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(Lr,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 a=Hs.exec(i);if(!a)return t;let l=a[0].length;return`${t.slice(0,l).trimEnd()} ${o} ${t.slice(l).trimStart()}`}function Ir(t,e=u){let n=_(e.country)??void 0,r=U(e.language)??void 0;return Or(t,{country:n,language:r})}var un=300,qs=500,js=3e4,kr=430,Gs=1e3,sn="quantityAvailable",Ar=new Set,Ks=t=>`${t.domain} ${t.apiVersion} ${t.token}`;function Ws(t,e,n,{context:r,operation:o}){let i=typeof e=="string"?e:e(n),s=r?Or(i,t):i;return t.maxAge<=0||o==="mutation"?s:`${s} #${Math.floor(Date.now()/(t.maxAge*Gs))}`}var Qs=t=>new Promise(e=>setTimeout(e,t));function cn(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 Bs(t){let e=Z(t,"message"),n=Z(Z(t,"extensions"),"code"),r=typeof e=="string"?e:"";return typeof n=="string"?{message:r,extensions:{code:n}}:{message:r}}function zs(t){if(!k(t))return null;let{data:e,errors:n}=t;return n==null?{data:e}:Array.isArray(n)?{data:e,errors:n.map(Bs)}:null}function on(t,e){return t.ok?new b(`Invalid response (${t.status})`,{code:"INVALID_RESPONSE",status:t.status}):new b(cn(t.status,e),{status:t.status})}function xr(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?cn(t.status,n):o),new b(i,{status:t.status,errors:e,code:r})}function vr(t,e){if(e==="any")return{kind:"retry",backoffMs:un};throw new b(`Network error: ${Tr(t)}`,{code:"NETWORK"})}function Ys(t,e,n,r,o,i,s){if(n.includes(sn)&&r.some(g=>g.message.includes(sn)))return{kind:"inventory-refused",error:xr(t,r,e)};let a=r.map(g=>g.extensions?.code);if(i!=="none"&&a.includes("THROTTLED"))return{kind:"retry",backoffMs:qs};let l=a.includes("INTERNAL_SERVER_ERROR");if(i==="any"&&l)return{kind:"retry",backoffMs:un};let d=t.ok&&(l||s==="mutation"&&o==null);throw xr(t,r,e,d?"SERVER_ERROR":void 0)}async function ln(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 Xs(t,e,n,r,o,i,s){let a;try{a=await(t.fetch??fetch)(an(t),{method:"POST",headers:{"Content-Type":"application/json","X-Shopify-Storefront-Access-Token":t.token},body:JSON.stringify({query:e,variables:n}),signal:s})}catch(A){return vr(A,o)}if(a.status===kr)throw new b("Shopify security rejection (430)",{status:kr});if(o!=="none"&&a.status===429||o==="any"&&a.status>=500)return{kind:"retry",backoffMs:un};let l;try{l=await a.json()}catch(A){if(A instanceof SyntaxError)throw on(a,t);return vr(A,o)}let d=zs(l);if(!d)throw on(a,t);let{data:g,errors:v=[]}=d;if(v.length)return Ys(a,t,e,v,g,o,i);if(!a.ok)throw new b(cn(a.status,t),{status:a.status});if(!r(g))throw on(a,t);return{kind:"data",data:g}}async function Mr(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=Ks(t),a=i==="mutation"?"not-run":"any",l=0;for(;;){let d={inventory:!Ar.has(s)},g=Ws(t,e,d,{context:o,operation:i}),v=l<t.retries?a:"none",A=await ln(t.requestTimeout,$=>Xs(t,g,n,r,v,i,$));switch(A.kind){case"data":return A.data;case"inventory-refused":if(typeof e=="string"||!d.inventory)throw A.error;L(`the token can't read inventory: ${sn} is left out from now on`),Ar.add(s);break;case"retry":await Qs(Math.min(A.backoffMs*2**l,js)),l+=1,L("retry",l);break}}}function at(t,e,n,r){return Mr(u,t,e,n,r)}var Js=t=>typeof t=="object"&&t!==null;function Zs(t,e,n={},r){return Mr(t,e,n,Js,{...r,operation:Vs(e)})}function Rr(t,e,n){return Zs(u,t,e,n)}function Nr(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 f=t=>`${u.prefix}-${t}`,c=(t,e)=>e===void 0?`[${f(t)}]`:`[${f(t)}="${e}"]`,p=(t,e)=>t.getAttribute(f(e)),ut=(t,e)=>t.hasAttribute(f(e));function h(t,e){return t?[...t.querySelectorAll(e)]:[]}var ct=(t,e,n)=>h(t,e).filter(r=>r.closest(n)===t),Xt=["product-ready","list-ready","cart-updated","cart-toggled","checkout","search"],$r=new WeakMap;function _r(t,e){let n=new CustomEvent(`${u.prefix}:${t}`,{detail:e,bubbles:!0});return $r.set(n,t),n}function lt(t,e){return $r.get(t)===e}function P(t,e,n=document){n.dispatchEvent(_r(t,e))}var ta="http://www.w3.org/1999/xhtml",ea=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"]),na=new Set(["script","style","template","noscript","textarea","select","title"]),ra=new Set(["style","title","lang","dir","role","align","width","height"]),oa=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"])]]),ia=new Set(["href","src","poster","cite"]),sa=/^(javascript|vbscript|data):/i,aa=/^data:image\/(png|gif|jpeg|webp|avif);/i,ua=new Set(["position","top","right","bottom","left","z-index","-webkit-box-reflect"]),ca=["inset","transform","translate","rotate","scale","offset"],la=/\d(?:[sld]?v|cq)(?:w|h|i|b|min|max)\b/i,da=/^(?:outline|box-shadow|text-shadow|filter|text-decoration|text-underline-offset|text-stroke)|^(?:border-image|mask-border|mask-box-image)(?:-outset)?$/,Ur=40,pa=new Map([["letter-spacing",{px:4,em:.25}],["word-spacing",{px:4,em:.25}],["text-indent",{px:Ur}]]),Fr=/(?<![\w#.-])[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?(%|[a-z]+)?/gi,fa=/(?<![\w-])(?!drop-shadow\(|blur\()[\w-]+\([^()]*\)/g,Dr=/(?:var|calc|min|max|clamp|env|attr)\(/i,ma=/url\(|expression\(|@import/i,ga=/[\u0000- ]/g,ha="allow-scripts allow-same-origin allow-popups allow-presentation",ya=new Set(["autoplay","encrypted-media","picture-in-picture","fullscreen","clipboard-write","accelerometer","gyroscope","web-share"]),ba="strict-origin-when-cross-origin",Pa=["https://www.youtube.com","https://www.youtube-nocookie.com","https://player.vimeo.com","https://www.loom.com","https://fast.wistia.net"];function Ea(t,e){return ra.has(e)||e.startsWith("aria-")||(oa.get(t)?.has(e)??!1)}function wa(t,e,n){let r=n.replace(ga,"");return sa.test(r)?t==="img"&&e==="src"&&aa.test(r):!0}function Hr(t,e){try{return new URL(t,e)}catch{return null}}function Sa(t,e,n){let r=t.baseURI,o=Hr(r)?.origin??"null";return{origin:o==="null"?null:o,baseUrl:r,styleParser:e,embedOrigins:new Set([...Pa,...n])}}function Ca(t,e){let n=Hr(t.trim(),e.baseUrl);return n!==null&&n.origin!==e.origin&&e.embedOrigins.has(n.origin)}function Ta(t){let e=t.split(";").map(n=>n.trim().split(/\s+/)[0]?.toLowerCase()??"");return[...new Set(e.filter(n=>ya.has(n)))].join("; ")}function ka(t,e){if(ua.has(t)||ca.some(r=>t.startsWith(r))||la.test(e))return!0;let n=pa.get(t);return n?Dr.test(e)||Aa(e,n):t.startsWith("margin")&&e.includes("-")}function Aa(t,e){return[...t.matchAll(Fr)].some(([n="",r=""])=>{let o=parseFloat(n);if(o>=0)return!1;let i=e[r.toLowerCase()];return i===void 0||-o>i})}function xa(t,e){return da.test(t.replace(/^-webkit-/,""))?Dr.test(e)?!0:[...e.replace(fa,"").matchAll(Fr)].some(([n="",r=""])=>{let o=Math.abs(parseFloat(n));return o!==0&&(r.toLowerCase()!=="px"||o>Ur)}):!1}function va(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);(ka(i,s)||xa(i,s)||ma.test(s))&&n.removeProperty(i)}let o=n.cssText;return e.removeAttribute("style"),o}function La(t,e){let n=t.localName;for(let i of[...t.attributes]){let s=i.name.toLowerCase(),a=ia.has(s);Ea(n,s)&&(!a||wa(n,s,i.value))||t.removeAttribute(i.name)}let r=t.getAttribute("style");if(r===null)return;let o=va(r,e.styleParser);o===""?t.removeAttribute("style"):t.setAttribute("style",o)}var Oa=new Set(["","_self","_parent","_top"]);function Ia(t){if(t.localName==="iframe"){let r=Ta(t.getAttribute("allow")??"");r===""?t.removeAttribute("allow"):t.setAttribute("allow",r),t.setAttribute("sandbox",ha),t.setAttribute("referrerpolicy",ba);return}if(t.localName!=="a")return;let e=t.getAttribute("target");if(e===null||Oa.has(e.toLowerCase()))return;let n=new Set((t.getAttribute("rel")??"").split(/\s+/).filter(Boolean));n.add("noopener"),n.add("noreferrer"),t.setAttribute("rel",[...n].join(" "))}function Ma(t,e){let n=t.localName,r=t.namespaceURI===ta;if(r&&na.has(n)){t.remove();return}if(!r||!ea.has(n)){t.replaceWith(...t.childNodes);return}if(n==="iframe"&&!Ca(t.getAttribute("src")??"",e)){t.remove();return}La(t,e),Ia(t)}function Vr(t,e=globalThis.document,n=[]){let r=e.createElement("template");r.innerHTML=t??"";let o=Sa(e,r,n);for(let i of[...r.content.querySelectorAll("*")])Ma(i,o);return r.content}function he(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 dn(t,e){return t.getAttribute(e)??t.getAttribute(f(e))??t.getAttribute(`data-${e}`)}function jr(t,e){if(!t||!e)return t;let n=dn(e,"max-width"),r=dn(e,"max-height");return he(t,{width:n,height:r,crop:n||r?dn(e,"crop"):null})}var qr=t=>t.replace(/\?.*$/,"");function ye(t,e){return!t||!e?!1:qr(t)===qr(e)}function Ra(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=jr(e,t);if(t.tagName!=="IMG"){t.style.backgroundImage=Ra(r);return}if(ye(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 pn=new WeakMap,Jt=t=>!!pn.get(t),fn=t=>t.cloneNode(!0);function Gr(t){let e=pn.get(t);if(e!==void 0)return e;let n=t.firstElementChild,r=n?fn(n):null;return pn.set(t,r),t.replaceChildren(),r}function Y(t,e,n){let r=Gr(t);if(!r){e.length&&T("repeater without a template child",t);return}t.replaceChildren(),e.forEach((o,i)=>{let s=fn(r);n(s,o,i),t.appendChild(s)})}function Na(t,e){let n=()=>{t.remove()};if(!e){n();return}V("repeater onLeave",()=>{e(t,n)},n)}function $a(t,e,n,r){e.forEach((o,i)=>{if(!n.has(o))return;let s=e[i-1];s?.parentNode===t?s.after(o):t.prepend(o),r&&V("repeater onEnter",()=>{r(o)})})}function mn(t,e,n,r,{onEnter:o,onLeave:i}={}){let s=Gr(t);if(!s){T("repeater without a template child",t);return}let a=`data-${u.prefix}-key`,l=`data-${u.prefix}-leaving`,d=()=>[...t.children].filter(S=>S.hasAttribute(a)&&!S.hasAttribute(l)),g=new Map(d().map(S=>[S.getAttribute(a),S])),v=[],A=new Set;e.forEach((S,fe)=>{let Xe=String(n(S,fe)),Et=g.get(Xe);Et?g.delete(Xe):(Et=fn(s),Et.setAttribute(a,Xe),A.add(Et)),r(Et,S,fe,A.has(Et)),v.push(Et)});let $=v.filter(S=>!A.has(S)),Jn=d().filter(S=>$.includes(S));if(!(Jn.length===$.length&&Jn.every((S,fe)=>S===$[fe]))){g.forEach(S=>{S.remove()}),v.forEach(S=>t.appendChild(S));return}$a(t,v,A,o),g.forEach(S=>{S.setAttribute(l,""),S.removeAttribute(a),S.style.pointerEvents="none",S.inert=!0,Na(S,i)})}var Kr="data-tether-seen",hn="data-tether-shown",Pe="data-tether-prev-display",_a=120;function Rt(t,e){return mr(u.productPath||"/product",t,e)}function Yr(t,e){try{return t()}catch(n){if(n instanceof RangeError)return e;throw n}}function Xr(t,e=u.locale){return t?Yr(()=>new Intl.NumberFormat(e||void 0,{style:"percent",maximumFractionDigits:0}).format(t/100),`${t}%`):""}function O(t){if(!t)return"";let{formatMoney:e,locale:n}=u,r=()=>fr(t,n);return e?V("formatMoney",()=>e(t,n),r):r()}function we(t){return t?Yr(()=>new Date(t).toLocaleDateString(u.locale||void 0),""):""}function Se(t,e){t.replaceChildren(Vr(e,t.ownerDocument,u.embedOrigins))}var Jr=t=>t.tagName==="INPUT"||t.tagName==="TEXTAREA",Zt=t=>t.tagName==="INPUT";function w(t,e){let n=e==null?"":String(e);Jr(t)?t.value=n:t.textContent=n}var Wr=t=>Jr(t)?t.value:t.textContent;function dt(t,e){let n=Wr(t);w(t,e),n!==Wr(t)&&t.hasAttribute(Kr)&&V("onValueChange",()=>u.onValueChange?.(t,n)),t.setAttribute(Kr,"1")}function Ua(t){if(t.hasAttribute(hn))return;t.setAttribute(hn,""),t.removeAttribute("hidden");let e=t.getAttribute(Pe);e!==null?(t.style.display=e,t.removeAttribute(Pe)):t.style.display==="none"&&(t.style.display=""),typeof getComputedStyle=="function"&&getComputedStyle(t).display==="none"&&(t.style.display=t.getAttribute(f("display"))||"block")}function H(t,e){if(e){Ua(t);return}t.removeAttribute(hn),!t.hasAttribute(Pe)&&t.style.display!=="none"&&t.setAttribute(Pe,t.style.display),t.style.display="none"}var Ee='input[type="radio"],input[type="checkbox"]',Fa=["radio","checkbox","switch","menuitemradio","menuitemcheckbox"],Da=["button","submit","reset"];function Zr(t){let e=t.getAttribute("role");return e==="button"?"aria-pressed":e&&Fa.includes(e)?"aria-checked":e==="option"||e==="tab"?"aria-selected":e?null:Zt(t)?Da.includes(t.type)?"aria-pressed":null:t.querySelector(Ee)?null:"aria-pressed"}function Ce(t,e){t.classList.toggle("is-selected",e);let n=Zr(t);n==="aria-pressed"&&t.tagName!=="BUTTON"&&!Zt(t)&&(t.setAttribute("role","button"),t.hasAttribute("tabindex")||t.setAttribute("tabindex","0")),n&&t.setAttribute(n,String(e)),Zt(t)&&t.matches(Ee)&&(t.checked=e);let r=t.querySelector(Ee);r&&Zt(r)&&(r.checked=e)}var be="tether-unavailable";function Ha(t,e){if(e&&!document.getElementById(be)){let r=document.createElement("span");r.id=be,r.hidden=!0,r.textContent="Unavailable",document.body.append(r)}let n=(t.getAttribute("aria-describedby")??"").split(" ").filter(r=>r&&r!==be);e&&n.push(be),n.length?t.setAttribute("aria-describedby",n.join(" ")):t.removeAttribute("aria-describedby")}function Te(t,e,n){t.classList.toggle("is-unavailable",e);let o=Zr(t)!==null||Zt(t)?t:t.querySelector(Ee);o&&(n==="picks-closest"?Ha(o,e):o.setAttribute("aria-disabled",String(e)))}var Qr,te=t=>Reflect.get(window,t);function Va(){let t=te("ScrollTrigger");if(typeof t!="function")return;let e=Reflect.get(t,"refresh");typeof e=="function"&&Reflect.apply(e,t,[])}function pt(t){clearTimeout(Qr),Qr=setTimeout(()=>{V("layout-changed",()=>{u.onLayoutChange?u.onLayoutChange(t):Va()}),P("layout-changed",{reason:t})},_a)}function to(t,e){let n=[...t.querySelectorAll("img")].filter(i=>!i.complete),r=n.length,o=()=>{r-=1,r===0&&pt(`${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 ke(t,e){let n=t?p(t,e):null;if(!n)return null;try{return JSON.parse(n)}catch{return T(`invalid JSON in ${f(e)}`,t),null}}var yn=/^-?\d+$/,Br=new WeakMap;function zr(t,e,n){let r=Br.get(t)??new Set;Br.set(t,r),!r.has(e)&&(r.add(e),T(`${f(e)} ${n}`,t))}function eo(t,e,{min:n,max:r,fallback:o}){let i=p(t,e)?.trim();if(!i)return o;let s=yn.test(i)?Number(i):Number.NaN;return Number.isNaN(s)||s<n?(zr(t,e,`${JSON.stringify(i)} is not a whole number from ${String(n)}: using ${String(o)}`),o):r===void 0||s<=r?s:(zr(t,e,`${i} is more than its maximum: using ${String(r)}`),r)}function gn(t){return t==null?"":typeof t=="string"?t:typeof t=="number"||typeof t=="boolean"?String(t):JSON.stringify(t)}function Ae(t){return Array.isArray(t)?t.filter(k).map(n=>({key:gn(n.key),value:gn(n.value)})):k(t)?Object.entries(t).map(([e,n])=>({key:e,value:gn(n)})):[]}function ee(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",no={inventory:!0},ro=t=>t.inventory?"quantityAvailable":"",ft="url altText width height";function qa(t){let e=[];for(let r of t){let o=Ze(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{${ft}}}}}`:""}var ja=` id name description recurringDeliveries options{name value}priceAdjustments{orderCount adjustmentValue{__typename ... on SellingPlanPercentagePriceAdjustment{adjustmentPercentage}... on SellingPlanFixedAmountPriceAdjustment{adjustmentAmount{${E}}}... on SellingPlanFixedPriceAdjustment{price{${E}}}}}`,Ga=` sellingPlan{id}checkoutChargeAmount{${E}}remainingBalanceChargeAmount{${E}}priceAdjustments{price{${E}}compareAtPrice{${E}}perDeliveryPrice{${E}}unitPrice{${E}}}`;function oo(t=u,e=no){return` fragment TetherProduct on Product{id handle title description descriptionHtml productType vendor tags availableForSale publishedAt onlineStoreUrl requiresSellingPlan seo{title description}featuredImage{${ft}}images(first:${t.imagesFirst}){nodes{${ft}}}options{name optionValues{name swatch{color image{previewImage{${ft}}}}}}priceRange{minVariantPrice{${E}}maxVariantPrice{${E}}}compareAtPriceRange{minVariantPrice{${E}}maxVariantPrice{${E}}}${qa(t.metafields)} sellingPlanGroups(first:${t.sellingPlanGroupsFirst}){nodes{name appName options{name values}sellingPlans(first:${t.sellingPlansFirst}){nodes{${ja}}}}}variants(first:${t.variantsFirst}){nodes{id title availableForSale currentlyNotInStock ${ro(e)} sku barcode selectedOptions{name value}image{${ft}}price{${E}}compareAtPrice{${E}}unitPrice{${E}}sellingPlanAllocations(first:${t.sellingPlansFirst}){nodes{${Ga}}}}}}`}function bn(t=no){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 ${ro(t)} image{${ft}}price{${E}}compareAtPrice{${E}}selectedOptions{name value}product{id title handle vendor featuredImage{${ft}}}}}... on ComponentizableCartLine{lineComponents{id quantity merchandise{... on ProductVariant{id title product{title handle}}}}}}}}`}function io(){return` id handle title description descriptionHtml image{${ft}}seo{title description}`}var wn={};zi(wn,{GID:()=>Q,allPlans:()=>R,allocationFor:()=>N,findPlan:()=>$t,hasPlans:()=>Qa,planAdjustment:()=>En,planCheckoutCharge:()=>Pn,planPrice:()=>Nt,planSavings:()=>re,plansForVariant:()=>Ba,toGid:()=>xe});var Ka=/^(-?)(\d+)(?:\.(\d+))?$/;function so(t,e){let n=Ka.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 ao=t=>t.split(".")[1]?.length??0;function lo(t,e){if(t==null||e==null)return!1;let n=Math.max(ao(t.trim()),ao(e.trim())),r=so(t,n),o=so(e,n);return r===null||o===null?!1:r>o}var uo=2,co=new Map;function po(t){let e=co.get(t);if(e!==void 0)return e;let n=uo;try{n=new Intl.NumberFormat("en",{style:"currency",currency:t}).resolvedOptions().maximumFractionDigits??uo}catch{}return co.set(t,n),n}function St(t){return Math.round(parseFloat(t.amount)*10**po(t.currencyCode))}function ne(t,e){let n=po(e);return{amount:(t/10**n).toFixed(n),currencyCode:e}}var Wa=100;function xe(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=>xe(t,"Product"),variant:t=>xe(t,"ProductVariant"),sellingPlan:t=>xe(t,"SellingPlan")};function R(t){return(t?.sellingPlanGroups?.nodes??[]).flatMap(n=>n.sellingPlans.nodes.map(r=>({...r,group:n})))}function Qa(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 Ba(t,e){return R(t).filter(n=>N(e,n.id))}function Nt(t,e){let n=N(t,e)?.priceAdjustments[0];return n?.perDeliveryPrice??n?.price??t?.price??null}function Pn(t,e){let n=N(t,e);return n?.checkoutChargeAmount??n?.priceAdjustments[0]?.price??t?.price??null}function re(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=St(t.price)-St(n);return{amount:ne(i,t.price.currencyCode),percentage:Math.round((1-o/r)*Wa)}}function En(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=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(s=>s.value.toLowerCase()===o))??null}var et={amount:"string",currencyCode:"string"},_t={id:"string",handle:"string",title:"string",options:["object"],images:{nodes:["object"]},priceRange:{minVariantPrice:et,maxVariantPrice:et},variants:{nodes:[{id:"string",price:et,selectedOptions:["object"]}]}},fo={nodes:[_t],pageInfo:{hasNextPage:"boolean"}},mo=t=>Z(t,"id")!==""&&Z(t,"handle")!==""&&K(t,_t),go=t=>k(t)&&(t.id===void 0||K(t,_t)),cd=z({collection:F({handle:"string",products:fo})}),ld=z({products:fo}),dd=z({productRecommendations:F([_t])});var za={id:"string",quantity:"number",attributes:["object"],cost:{totalAmount:et,subtotalAmount:et,amountPerQuantity:et},merchandise:{id:"string",selectedOptions:["object"],product:"object"}},Sn={id:"string",checkoutUrl:"string",totalQuantity:"number",attributes:["object"],discountCodes:["object"],cost:{totalAmount:et,subtotalAmount:et},lines:{nodes:[za]}};var Ya='a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])',Xa=60,Cn=!1,Tn=!1,ve=null,ho=null,Ja=t=>t!==null&&"focus"in t,yo=t=>h(t,Ya).filter(e=>e.offsetParent!==null||e===document.activeElement),mt=()=>h(document,c("cart-drawer")),Le=t=>t.classList.contains(u.cartDrawerOpenClass),bo=t=>t.some(e=>e.contains(document.activeElement)),Za=t=>p(t,"cart-drawer")==="manual";function X(){let t=mt();return t.length?t.some(Le):Cn}function tu(t){ho??(ho=new MutationObserver(()=>{let e=X();if(e===Tn)return;let n=mt();e?Po(n.filter(Le)):Eo(n,bo(n))})),ho.observe(t,{attributes:!0,attributeFilter:["class"]})}function Oe(){h(document,c("cart-open")).forEach(t=>{t.setAttribute("aria-expanded",String(X()))}),mt().forEach(t=>{t.hasAttribute("role")||t.setAttribute("role","dialog"),!t.hasAttribute("aria-label")&&!t.hasAttribute("aria-labelledby")&&t.setAttribute("aria-label",p(t,"cart-label")||"Cart");let e=Le(t);t.setAttribute("aria-modal",String(e)),t.setAttribute("aria-hidden",String(!e)),t.inert=!e,tu(t)})}function eu(t){let e=yo(t)[0]??t;e===t&&!t.hasAttribute("tabindex")&&(t.tabIndex=-1),e.focus({preventScroll:!0})}function Po(t){Tn=!0,Oe();let[e]=t;u.cartFocus&&e&&(ve=Ja(document.activeElement)?document.activeElement:null,setTimeout(()=>{eu(e)},Xa)),V("onCartOpen",()=>u.onCartOpen?.(t)),P("cart-toggled",{open:!0})}function Eo(t,e){Tn=!1,Oe(),e&&ve?.isConnected&&ve.focus({preventScroll:!0}),ve=null,V("onCartClose",()=>u.onCartClose?.(t)),P("cart-toggled",{open:!1})}function Ie(){if(X())return;let t=mt(),e=t.filter(n=>!Za(n));t.length&&!e.length||(Cn=!t.length,e.forEach(n=>{n.classList.add(u.cartDrawerOpenClass)}),Po(e))}function kn(){if(!X())return;Cn=!1;let t=mt(),e=bo(t);t.forEach(n=>{n.classList.remove(u.cartDrawerOpenClass)}),Eo(t,e)}function wo(){X()?kn():Ie()}function An(t){if(t.key!=="Tab"||!u.cartFocus||!X())return;let e=mt().find(Le);if(!e)return;let n=yo(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 nu=1e4,ru=6e4,q=new Map,xn=new Map,Ct=new Set,Me=new Map,To=[],vn=!1,oe=0,So=t=>t.startsWith("gid://"),Tt=gr;function Ut(t){if(!t)return;let e=Promise.resolve(t);q.set(t.handle,e),q.set(t.id,e)}function nt(t){let e=Tt(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)=>{xn.set(e,{resolve:o,reject:i}),To.push(e),vn||(vn=!0,setTimeout(()=>void au(),0))});return q.set(e,r),r}var Ln=t=>e=>`${t}${oo(u,e)}`;function ou(t){let e=t.filter(So),n=t.filter(a=>!So(a)),r=[],o=[],i={};return e.length&&(r.push("$ids: [ID!]!"),i.ids=e,o.push("byId:nodes(ids:$ids){... on Product{...TetherProduct}}")),n.forEach((a,l)=>{r.push(`$h${l}: String!`),i[`h${l}`]=a,o.push(`h${l}:product(handle:$h${l}){...TetherProduct}`)}),{query:Ln(`query TetherProducts(${r.join(",")}){${o.join(" ")}}`),variables:i,handles:n}}function Co(t,e){let n=xn.get(t);xn.delete(t),n&&e(n)}function iu(t,e){if(e!==oe)return;let n=q.get(t);setTimeout(()=>{q.get(t)===n&&q.delete(t)},nu)}function su(t){if(!k(t))return!1;let{byId:e=[],...n}=t;return K(e,[F(go)])&&Object.values(n).every(F(_t))}async function au(){vn=!1;let t=oe,e=To.splice(0);if(!e.length)return;let{query:n,variables:r,handles:o}=ou(e);L("fetch products",e);let i;try{i=await at(n,r,su)}catch(l){e.forEach(d=>{Co(d,g=>{t===oe&&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 a=Date.now();e.forEach(l=>{Co(l,d=>{let g=s.get(l);if(!g){iu(l,t),d.reject(new b(`Product not found: ${l}`,{code:"NOT_FOUND"}));return}t===oe&&(Ut(g),Me.set(g.handle,a),Me.set(g.id,a)),d.resolve(g)})})}function Re(){q.clear(),oe+=1,Ct.clear(),Me.clear()}function ko(t){for(let e of t??[])!e.id||!e.handle||Date.now()-(Me.get(e.handle)??0)<ru&&q.has(e.handle)||(Ut(e),Ct.add(e.handle),Ct.add(e.id))}function Ao(t){let e=Tt(t);return!e||!Ct.has(e)?!1:(Ct.delete(e),q.get(e)?.then(n=>{Ct.delete(n.handle),Ct.delete(n.id)},uu),!0)}function uu(){}function xo(t){let e=Tt(t);return e&&q.delete(e),nt(t)}var cu=/^image:(\d+)$/,vo="metafield:",lu=/^(rich_text|multi_line_text)_field$/,du=["","true","all","*"],ie=t=>t.tagName==="SELECT",kt=(t,e)=>t.$(`select${e}`).filter(ie);function pu(t,e){let n=e.images.nodes,r=[...t.children].map(i=>i.tagName==="IMG"?i:i.querySelector("img"));!Jt(t)&&r.length===n.length&&r.every((i,s)=>ye(i?.getAttribute("src"),n[s]?.url))||Y(t,n,(i,s)=>{let a=i.matches(`img,${c("bind","image")}`)?i:h(i,"img")[0]??i;D(a,s.url,s.altText||e.title)})}function fu(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 a=s.reference?.image;if(a){D(t,a.url,a.altText);return}lu.test(s.type)&&(t.style.whiteSpace="pre-line"),w(t,s.value)}var mu=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=>we(t.publishedAt),"min-price":t=>O(t.priceRange.minVariantPrice),"max-price":t=>O(t.priceRange.maxVariantPrice)}));function gu(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)=>{w(o,i)})}function hu(t,e,n){let r=mu.get(e);if(r){w(t,r(n));return}switch(e){case"description":Se(t,n.descriptionHtml);break;case"featured-image":D(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":pu(t,n);break;case"tags":gu(t,n);break;default:yu(t,e,n)}}function yu(t,e,n){let r=cu.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(vo)&&fu(t,n,e.slice(vo.length))}function bu(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&&ut(n,"hide-single")){H(n,!1);return}Y(n,o.optionValues,(i,s)=>{i.setAttribute(f("option-value"),s.name);let a=h(i,c("bind","option-value"))[0];a?w(a,s.name):i.firstElementChild||w(i,s.name);let l=h(i,c("bind","swatch"))[0],{swatch:d}=s;!l||!d||(d.color&&(l.style.backgroundColor=d.color),d.image?.previewImage&&D(l,d.image.previewImage.url,s.name))})})}function Pu(t){let{product:e}=t;kt(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)))}),kt(t,c("variant-select")).forEach(n=>{n.replaceChildren(...e.variants.nodes.map(r=>new Option(r.title,r.id)))}),kt(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(f("one-time-label"))||"One-time purchase";n.replaceChildren(...o?[new Option(i,"")]:[],...r)})}function Eu(t){t.$(c("plan-list")).forEach(e=>{let n=(p(e,"plan-list")??"").trim(),r=du.includes(n.toLowerCase())?null:n,o=t.plans.filter(i=>!r||i.group.name===r);Y(e,o,(i,s)=>{i.setAttribute(f("plan-value"),s.id),!i.firstElementChild&&!i.querySelector(c("plan-bind"))&&w(i,s.name)})})}function Lo(t){t.$(c("bind")).forEach(e=>{hu(e,p(e,"bind")??"",t.product)}),bu(t),Pu(t),Eu(t)}var Oo="Default Title",On=(t,e)=>e.get(t.id)?.quantity??t.quantity,Io=t=>t.split("/").pop()??t;function wu(t){let e=t.merchandise,n=Rt(e.product.handle,e.product.id);if(!n)return null;let r=new URLSearchParams;r.set("variant",Io(e.id));let o=t.sellingPlanAllocation?.sellingPlan.id;return o&&r.set("selling_plan",Io(o)),`${n}${n.includes("?")?"&":"?"}${r.toString()}`}var Mo=t=>t.merchandise.product.title,Ro={title:Mo,"product-title":Mo,"variant-title":t=>t.merchandise.title===Oo?"":t.merchandise.title,options:t=>t.merchandise.selectedOptions.filter(e=>e.value!==Oo).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)=>On(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(", ")},No="attribute:";function Su(t,e,n){if(Object.hasOwn(Ro,e))return Ro[e]?.(t,n);if(!e.startsWith(No))return;let r=e.slice(No.length);return t.attributes.find(o=>o.key===r)?.value??""}function Cu(t,e,n){let r=R(n),o=!n.requiresSellingPlan&&p(t,"line-plan")!=="subscription-only",i={value:"",label:t.getAttribute(f("one-time-label"))||"One-time purchase"},s=[...o?[i]:[],...r.map(l=>({value:l.id,label:l.name}))],a=s.map(l=>l.value).join("|");t.dataset.tetherSig!==a&&(t.replaceChildren(...s.map(l=>{let d=document.createElement("option");return d.value=l.value,d.textContent=l.label,d})),t.dataset.tetherSig=a),t.value=e.sellingPlanAllocation?.sellingPlan.id??"",H(t,r.length>0)}function Tu(t,e,n){let r=!!e.sellingPlanAllocation;t.classList.toggle("is-subscription",r);let o=n.warnings.find(a=>a.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(a=>{dt(a,o?.message??"")});let s=new Map([["subscription",r],["one-time",!r],["on-sale",lo(e.cost.compareAtAmountPerQuantity?.amount,e.cost.amountPerQuantity.amount)],["has-components",(e.lineComponents??[]).length>0],["warning",!!o]]);h(t,c("line-show")).forEach(a=>{let l=p(a,"line-show"),d=l===null?void 0:s.get(l);d!==void 0&&H(a,d)})}function ku(t,e,n){let r=e.merchandise;t.setAttribute(f("line-id"),e.id),h(t,c("line")).forEach(i=>{let s=p(i,"line")??"";if(s==="image"){D(i,r.image?.url??r.product.featuredImage?.url,r.product.title);return}if(s==="url"){let l=wu(e);l&&i.setAttribute("href",l);return}let a=Su(e,s,n);a!==void 0&&dt(i,a)}),Tu(t,e,n),h(t,c("line-plan")).filter(ie).forEach(i=>{nt(r.product.handle).then(s=>{Cu(i,e,s)}).catch(s=>{m(s,"line plan options")})})}function Au(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 s=p(i,"show"),a=s===null?void 0:o.get(s);a===void 0||i.closest(c("product"))||H(i,a)}),h(document,c("checkout")).forEach(i=>{i.classList.toggle("is-disabled",!n),i.setAttribute("aria-disabled",String(!n))})}function xu(t){h(document,`textarea${c("cart-note")},input${c("cart-note")}`).forEach(e=>{document.activeElement!==e&&w(e,t?.note??"")}),h(document,c("cart-discounts")).forEach(e=>{Y(e,t?.discountCodes??[],(n,r)=>{n.setAttribute(f("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 $o(t){let{cart:e}=t,n=r=>e?O(e.cost[r]):"";Oe(),h(document,c("cart-count")).forEach(r=>{dt(r,e?.totalQuantity??0)}),h(document,c("cart-subtotal")).forEach(r=>{dt(r,n("subtotalAmount"))}),h(document,c("cart-total")).forEach(r=>{dt(r,n("totalAmount"))}),h(document,c("cart-checkout-charge")).forEach(r=>{dt(r,n("checkoutChargeAmount"))}),Au(e,t),h(document,c("cart-warning")).forEach(r=>{dt(r,[...new Set(t.warnings.map(o=>o.message))].join(" "))}),xu(e),h(document,c("cart-lines")).forEach(r=>{mn(r,e?.lines.nodes??[],o=>o.id,(o,i)=>{ku(o,i,t)},{onEnter:u.onLineEnter,onLeave:u.onLineLeave})}),e&&pt("cart")}function _o(t){h(document,c("cart-count")).forEach(e=>{/^\s*0?\s*$/.test(e.textContent)&&(e.textContent=String(t))})}function At(t,e="localStorage"){try{return window[e].getItem(t)}catch{return null}}function Ne(t,e,n="localStorage"){try{window[n].setItem(t,e)}catch{}}function se(t,e="localStorage"){try{window[e].removeItem(t)}catch{}}var Uo=/^gid:\/\/shopify\/Cart\/[\w-]+(\?key=[\w-]+)?$/;function Fo(){let t=Promise.resolve(),e=0,n=()=>{e--};return Object.assign(o=>{e++;let i=t.then(o);return t=i.then(n,n),i},{idle:()=>!e})}var j={kind:"unknown"},Ft=[],xt=new Map,$e=()=>j;function x(){switch(j.kind){case"ready":case"error":return j.cart;case"unknown":case"empty":return null}}var Do=()=>Ft,In=t=>t?{kind:"ready",cart:t}:{kind:"empty"},Ho=()=>`${u.storageKey}:seen`;function gt(){let t=At(u.storageKey);return t?Uo.test(t)?t:(ht(),null):null}function ht(){se(u.storageKey)}function Mn(t){j=In(t),t&&Ne(u.storageKey,t.id)}function ae(){$o({cart:x(),warnings:Ft,pending:xt,failed:j.kind==="error"})}function ue(t){ae(),P("cart-updated",{cart:x(),reason:t})}function B(t,e){return Mn(t),Ne(Ho(),`${Date.now()}|${t?.totalQuantity??0}`),ue(e),t}function ce(t){j=t.kind==="loaded"?In(t.cart):{kind:"error",error:t.error,cart:null},ue("load")}function vu(){let t=At(Ho())?.split("|")[1]??"",e=Number(t);return/^\d+$/.test(t)&&Number.isSafeInteger(e)?e:null}function Vo(){if(j.kind!=="unknown")return;let t=vu();t!==null&&_o(t)}function qo(t){let e=n=>V("warningText",()=>u.warningText?.(n),()=>null);Ft=t.filter((n,r)=>t.findIndex(o=>o.message===n.message)===r).map(n=>({...n,message:e(n)||n.message})),Ft.length&&P("cart-warning",{warnings:Ft})}var Dt=Fo();function jo(t){return Dt(t).then(e=>(j.kind==="error"&&(j=In(j.cart),ae()),e),e=>{throw j={kind:"error",error:e,cart:x()},ae(),P("cart-error",{error:e}),e})}var Rn=t=>On(t,xt),Lu=()=>({open:X(),count:x()?.totalQuantity??0,loaded:j.kind!=="unknown",warnings:[...Ft]});function Go(t){let e=["cart-updated","cart-toggled"].map(r=>`${u.prefix}:${r}`),n=()=>{t(x(),Lu())};return e.forEach(r=>{document.addEventListener(r,n)}),n(),()=>{e.forEach(r=>{document.removeEventListener(r,n)})}}var Ou=/does not exist|not found|invalid id/i,Iu=t=>z({[t]:F({cart:F(Sn)})});function _e(t){return t instanceof b?t.userErrors?.some(e=>e.field?.[0]==="cartId")?!0:(t.errors??[]).some(e=>Ou.test(e.message)):!1}function Wo(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 Qo(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 b("add(): variantId is required");let i=parseInt(String(r.quantity??1),10),s={merchandiseId:o,quantity:Math.max(1,i||1)},a=Q.sellingPlan(r.sellingPlanId||r.sellingPlan);a&&(s.sellingPlanId=a);let l=ee(r.attributes);return l.length&&(s.attributes=l),s}function Mu(t,e,n){return r=>`mutation Tether_${t}(${e}){${t}(${n}){cart{...TetherCart}userErrors{field message}warnings{code message target}}}${bn(r)}`}async function Bo(t,e,n,r){let o=await at(Mu(t,e,n),r,Iu(t),{operation:"mutation"}),i=Nr(o[t],t);return qo(i.warnings??[]),i.cart}function Ko(t){let e=u.country?{buyerIdentity:{countryCode:u.country},...t}:t;return Bo("cartCreate","$input: CartInput!","input: $input",{input:e})}async function yt({name:t,args:e,inner:n,variables:r,createInput:o}){let i=gt();if(!i)return o?Ko(o):null;try{return await Bo(t,`$cartId: ID!, ${e}`,`cartId: $cartId, ${n}`,{...r,cartId:i})}catch(s){if(!_e(s)||(ht(),!o))throw s;return L("cart expired, creating a new one"),Ko(o)}}async function Nn(t){return(await at(n=>`query TetherCart($id:ID!){cart(id:$id){...TetherCart}}${bn(n)}`,{id:t},z({cart:F(Sn)}))).cart}async function zo(t){return(await at("query TetherCheckout($id:ID!){cart(id:$id){checkoutUrl}}",{id:t},z({cart:F({checkoutUrl:"string"})}))).cart?.checkoutUrl??null}function Yo(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=ee(n.attributes));let o=n.merchandiseId||n.variantId;return o&&(r.merchandiseId=Q.variant(o)),r}var $n=t=>yt({name:"cartLinesUpdate",args:"$lines: [CartLineUpdateInput!]!",inner:"lines: $lines",variables:{lines:t},createInput:null}),Ue=t=>yt({name:"cartLinesRemove",args:"$lineIds: [ID!]!",inner:"lineIds: $lineIds",variables:{lineIds:t},createInput:null}),Xo=(t,e)=>e>0?$n([{id:t,quantity:e}]):Ue([t]);var _n=null;function Zo(t){_n=t}var Ru=t=>zo(t).then(e=>({kind:"url",url:e}),e=>({kind:"failed",error:e}));async function Nu(){if(!_n)return null;try{let t=await _n();return t&&`${t}${t.includes("?")?"&":"?"}logged_in=true`}catch(t){return m(t,"account checkout"),null}}async function $u(t){let e=Ru(t),n=await Nu();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 _u(t){try{t.opener=null}catch{}}function Jo(){let t=x();return t&&!t.totalQuantity?null:gt()}async function ti(t=u.checkoutTarget){if(Dt.idle()&&!Jo())return null;let e=t==="_blank"?window.open("","_blank"):null;e&&_u(e);try{await Dt(()=>Promise.resolve());let n=Jo(),r=n&&await $u(n);if(!r)return e?.close(),null;if(!ge(r))throw new b("The checkout URL is not https: not opened");return P("checkout",{url:r,cart:x()}),e&&!e.closed?e.location.href=r:window.location.href=r,r}catch(n){return e?.close(),m(n,"checkout failed"),null}}var Fe=()=>x()?.lines.nodes??[];async function Uu(){let t=gt();if(t)try{let e=await Nn(t);e||ht(),B(e,"load")}catch(e){m(e,"cart reload after a failed change")}}function rt(t){return jo(()=>t().catch(async e=>{throw Wo(e)&&await Uu(),e}))}function Fu(t,e){let n=Fe().find(a=>a.id===t);if(!n)return Promise.resolve(x());let r=Math.max(0,Rn(n)+e),o={quantity:r};xt.set(t,o),ue("pending");let i=()=>xt.get(t)===o;return rt(async()=>{if(!i())return x();if(Fe().find(d=>d.id===t)?.quantity===r)return x();let l=await Xo(t,r);return i()?B(l,r>0?"update":"remove"):(Mn(l),l)}).finally(()=>{i()&&(xt.delete(t),ue("settled"))})}function Du(t){let e=(x()?.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 Hu(t){let e=new Map((x()?.attributes??[]).map(n=>[n.key,n.value]));return ee(t).forEach(n=>e.set(n.key,n.value)),[...e].filter(([,n])=>n!=="").map(([n,r])=>({key:n,value:r}))}async function Vu(){let t=gt();if(!t)return ce({kind:"loaded",cart:null}),null;Vo();try{let e=await Nn(t);e||ht(),ce({kind:"loaded",cart:e})}catch(e){m(e,"cart load failed"),_e(e)&&ht(),ce({kind:"failed",error:e})}return x()}var y={init:()=>Dt(Vu),id:gt,get status(){return $e()},get state(){return x()},get lines(){return[...Fe()]},get count(){return x()?.totalQuantity??0},get loaded(){return $e().kind!=="unknown"},get lastError(){let t=$e();return t.kind!=="error"?null:t.error instanceof Error?t.error:new Error(String(t.error))},get warnings(){return[...Do()]},get pendingQty(){return xt},setCheckoutResolver:Zo,forgetSaved(){ht(),ce({kind:"loaded",cart:null})},render:ae,subscribe:Go,add(t,e=1,n={}){let r=(Array.isArray(t)?t:[t]).map(o=>Qo(o,e,n));return rt(async()=>{let o=await yt({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 B(o,"add"),P("added",{cart:o,lines:r}),u.openCartOnAdd&&Ie(),o})},updateLine(t,e){let n=typeof e=="number"?e:e.quantity;if(n!==void 0&&n<=0)return y.removeLine(t);let r=Yo(t,e);return rt(async()=>B(await $n([r]),"update"))},changeQuantity:Fu,quantityOf:Rn,removeLine(t){let e=Array.isArray(t)?t:[t];return rt(async()=>B(await Ue(e),"remove"))},clear(){return rt(async()=>{let t=Fe().map(e=>e.id);return t.length?B(await Ue(t),"remove"):x()})},setNote(t){let e={note:t??""};return rt(async()=>B(await yt({name:"cartNoteUpdate",args:"$note: String!",inner:"note: $note",variables:e,createInput:e}),"note"))},setAttributes(t){return rt(async()=>{let e={attributes:Hu(t)},n=await yt({name:"cartAttributesUpdate",args:"$attributes: [AttributeInput!]!",inner:"attributes: $attributes",variables:e,createInput:e});return B(n,"attributes")})},setDiscountCodes(t){return rt(async()=>{let e={discountCodes:Du(t)},n=await yt({name:"cartDiscountCodesUpdate",args:"$discountCodes: [String!]!",inner:"discountCodes: $discountCodes",variables:e,createInput:e});return B(n,"discount")})},async applyDiscount(t){let e=t.trim();if(!e)throw new b("No discount code",{code:"INVALID_DISCOUNT"});let n=await y.setDiscountCodes(i=>[...new Set([...i,e])]),r=e.toLowerCase();if((n?.discountCodes??[]).find(i=>i.code.toLowerCase()===r)?.applicable)return n;try{await y.removeDiscount(e)}catch(i){m(i,"removing a discount code Shopify refused")}throw new b(`Discount code not valid: ${e}`,{code:"INVALID_DISCOUNT"})},removeDiscount(t){let e=t.trim().toLowerCase();return y.setDiscountCodes(n=>n.filter(r=>r.toLowerCase()!==e))},setBuyerIdentity(t,{create:e=!0}={}){return rt(async()=>{let n=await yt({name:"cartBuyerIdentityUpdate",args:"$buyerIdentity: CartBuyerIdentityInput!",inner:"buyerIdentity: $buyerIdentity",variables:{buyerIdentity:t},createInput:e?{buyerIdentity:t}:null}).catch(r=>{if(e||!_e(r))throw r;return null});return B(n,"buyer-identity")})},checkout:ti,drawers:mt,isOpen:X,open:Ie,close:kn,toggle:wo};var qu=100,ju=(t,e)=>ne(St(t)*e,t.currencyCode),Vt=t=>Object.fromEntries(t.selectedOptions.map(e=>[e.name,e.value]));function Gu(t,e){return t.variants.nodes.find(n=>n.selectedOptions.every(r=>e[r.name]===r.value))??null}function ei(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 Ht=t=>t.kind==="subscription"?t.planId:t.offeredPlanId;function De(t,e){return t.kind==="subscription"&&N(e,t.planId)?t:{kind:"one-time"}}function He(t,e,n,r){let o=R(t),i=o.find(a=>a.id===r)??o[0];if(!i)return{kind:"one-time",offeredPlanId:null};let s=N(e,i.id)?i:o.find(a=>N(e,a.id))??i;return t.requiresSellingPlan||n==="subscription"?{kind:"subscription",planId:s.id}:{kind:"one-time",offeredPlanId:s.id}}function ni(t,{variant:e,sellingPlan:n,defaultPlan:r,defaultPurchase:o}){let i=t.variants.nodes,s=Q.variant(e),a=i.find(v=>v.id===s)??i.find(v=>v.availableForSale)??i[0]??null,l=$t(t,n),d=l??$t(t,r),g=l||o==="subscription"?"subscription":"one-time";return{selected:a?Vt(a):{},purchase:He(t,a,g,d?.id??null)}}function Ku(t,e,n,r,o){let i=t.quantityAvailable,s=i!=null&&i>0&&i<=e,a=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":a,"not-on-sale":!a,"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:a}}function ri(t,e,n){let r=Gu(t,e.selected),o=r??t.variants.nodes[0];if(!o)return null;let i=He(t,o,e.purchase.kind,Ht(e.purchase)),s=Ht(i),a=R(t),l=De(i,o),d=l.kind==="subscription"?N(o,l.planId):null,g=d?Nt(o,s)??o.price:o.price,v=d?.priceAdjustments[0]?.compareAtPrice??o.compareAtPrice,A={line:l,subscriptionAvailable:a.some($=>N(o,$.id)),compareAtPrice:v&&parseFloat(v.amount)>parseFloat(g.amount)?v:null,savings:re(o,s)};return{...A,variant:o,selected:r?e.selected:Vt(o),purchase:i,plan:a.find($=>$.id===s)??null,quantity:e.quantity,price:g,show:Ku(o,n,t.variants.nodes.length,A,t.requiresSellingPlan)}}function oi(t,e){let{variant:n,plan:r,price:o,compareAtPrice:i,quantity:s}=t,a=Ht(t.purchase),l=$=>ju($,Math.max(1,s)),A={price:()=>e.money(o),"total-price":()=>e.money(l(o)),"one-time-price":()=>e.money(n.price),"subscription-price":()=>e.money(a?Nt(n,a):null),"subscription-savings":()=>e.percent(t.savings.percentage),"subscription-savings-amount":()=>e.money(t.savings.amount),"checkout-charge":()=>{let $=t.line.kind==="subscription"?Pn(n,a)??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))*qu)}%`:"0%","discount-amount":()=>i?e.money(ne(St(i)-St(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(A))}function ii(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(re(t,e).percentage),"savings-amount":()=>r.money(re(t,e).amount),adjustment:()=>{let s=En(n);return s?s.type==="percentage"?`${s.value}%`:r.money(s.value):""}};return new Map(Object.entries(i))}function Un(t){try{return decodeURIComponent(t)}catch(e){if(e instanceof URIError)return t;throw e}}var si="url:";function vt(t,e=window.location,n="product"){let r=(p(t,n)??"").trim();if(!r.toLowerCase().startsWith(si))return{key:r||null,fromUrl:!1,raw:r};let o=r.slice(si.length).trim(),i;if(o.toLowerCase()==="path"){let s=e.pathname.split("/").filter(Boolean),a=s[s.length-1];i=a===void 0?null:Un(a)}else i=new URLSearchParams(e.search).get(o||"handle");return{key:i?.trim()||null,fromUrl:!0,raw:r}}var Ve=["loading","ready","error","not-found"],Wu=t=>Ve.some(e=>e===t),ai=t=>typeof t=="object"&&t!==null&&"code"in t?t.code:void 0,qe=t=>ai(t)==="NOT_FOUND",le=()=>["product","collection","products","recommendations"].map(t=>c(t)).join(","),ui=(t,e)=>t===e||t.parentElement?.closest(le())===e;function Qu(t){let e=ai(t);return typeof e=="string"&&e?e:"error"}function ot(t,e,n){let r=e==="not-found",o=e==="error"||r;t.setAttribute(f("state"),r?"error":e),o?t.setAttribute(f("error"),r?"not-found":Qu(n)):t.removeAttribute(f("error")),ct(t,c("show"),le()).forEach(i=>{let s=p(i,"show");Wu(s)&&H(i,s===e)}),o&&ct(t,c("add-to-cart"),le()).forEach(i=>{i.classList.add("is-disabled"),i.setAttribute("aria-disabled","true"),"disabled"in i&&(i.disabled=!0)})}var ci={money:O,percent:Xr},Bu=t=>t.tagName==="INPUT";function Fn(t){let e=h(t,c("add-label"))[0]??t,n=e.dataset.tetherLabel??(Bu(e)?e.value:e.textContent);return e.dataset.tetherLabel=n,{label:e,original:n}}function zu(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"));h(o,c("option-value")).forEach(s=>{let a=p(s,"option-value")??"";Ce(s,e.selected[i]===a);let l=!ei(n,e.selected,i,a);Te(s,l,"picks-closest"),s.setAttribute("data-unavailable",l?"true":"false")})}),kt(t,c("option")).forEach(o=>{o.value=r(p(o,"option"))}),kt(t,c("variant-select")).forEach(o=>{o.value=e.variant.id})}function Yu(t,e){let{variant:n,purchase:r,line:o}=e;t.$(c("purchase")).forEach(i=>{if(ie(i)){i.value=r.kind;return}let s=p(i,"purchase");Ce(i,s===r.kind),Te(i,s==="subscription"?!e.subscriptionAvailable:t.product.requiresSellingPlan,"does-nothing")}),t.$(c("plan-value")).forEach(i=>{let s=p(i,"plan-value")??"";Ce(i,o.kind==="subscription"&&s===o.planId),Te(i,!N(n,s),"does-nothing");let a=t.plans.find(d=>d.id===s),l=ii(n,s,a,ci);h(i,c("plan-bind")).forEach(d=>{let g=l.get(p(d,"plan-bind")??"");g&&w(d,g())})}),kt(t,c("plan")).forEach(i=>{i.value=o.kind==="subscription"?o.planId:""})}function Xu(t,e){let n=new Map(Object.entries(e.show));Ve.forEach(r=>n.set(r,r==="ready")),t.$(c("show")).forEach(r=>{let o=p(r,"show")??"",i=n.get(o);i!==void 0&&(Ve.some(s=>s===o)&&!ui(r,t.root)||H(r,i))})}function Ju(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:a}=Fn(r),l=a;e.line.kind==="subscription"&&i&&(l=i),n&&o&&(l=o),r.getAttribute("aria-busy")!=="true"&&w(s,l)})}function li(t,e){let{variant:n}=e,{product:r}=t,o=oi(e,ci);t.$(c("bind")).forEach(i=>{let s=p(i,"bind")??"";if(s==="variant-image"){D(i,n.image?.url||r.featuredImage?.url,n.image?.altText||r.title);return}let a=o.get(s);a&&w(i,a())}),zu(t,e),Yu(t,e),Xu(t,e),t.root.classList.toggle("is-subscription",e.line.kind==="subscription"),t.root.setAttribute(f("purchase-mode"),e.line.kind),Ju(t,e)}var pi=()=>c("product"),Zu=t=>t.tagName==="INPUT"||t.tagName==="SELECT"||t.tagName==="TEXTAREA",di=t=>t instanceof window.Element;function qt(t,e,n){let r=e.closest(n);return r?.closest(pi())===t.root?r:null}function tc(t,e){let{label:n,original:r}=Fn(e),o=p(e,"adding-text");W(e,async()=>{o&&w(n,o);try{await t.addToCart()}catch(i){m(i,"add to cart failed"),P("error",{error:i,context:"add-to-cart"},t.root)}finally{o&&w(n,r)}}).then(()=>{t.renderVariant()}).catch(i=>{m(i,"add to cart render")})}function ec(t,e,n){let r=qt(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=qt(t,n,c("plan-value"));if(i){e.preventDefault(),t.selectPlan(p(i,"plan-value"));return}let s=qt(t,n,`${c("purchase")}:not(select)`);if(s){s.tagName!=="INPUT"&&e.preventDefault(),t.setPurchase(fi(p(s,"purchase")));return}let a=qt(t,n,c("qty-plus")),l=a?null:qt(t,n,c("qty-minus"));if(a||l){e.preventDefault(),t.setQuantity(t.quantity+(a?1:-1));return}let d=qt(t,n,c("add-to-cart"));d&&(e.preventDefault(),tc(t,d))}function nc(t,e){let{key:n}=t,r=n===" "||n==="Enter"&&!e.matches("a[href]"),o=`:is(${c("option-value")},${c("plan-value")},${c("purchase")})[role=button]:not(button,input)`;!r||t.defaultPrevented||!e.matches(o)||(t.preventDefault(),e.click())}var fi=t=>t==="subscription"?"subscription":"one-time";function rc(t,e){let n=Zu(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(fi(n)):e.matches(c("qty"))&&t.setQuantity(n)}function mi(t){t.root.addEventListener("click",e=>{di(e.target)&&ec(t,e,e.target)}),t.root.addEventListener("keydown",e=>{e.target instanceof window.HTMLElement&&nc(e,e.target)}),t.root.addEventListener("change",e=>{let{target:n}=e;di(n)&&n.closest(pi())===t.root&&rc(t,n)})}var it=new WeakMap,oc=()=>c("product"),je=new Map;function Dn(t){t.forEach(e=>{je.has(e.handle)||je.set(e.handle,e.options.map(n=>n.name))})}var gi=t=>t.tagName==="INPUT",ic=t=>t.tagName==="INPUT"||t.tagName==="SELECT"||t.tagName==="TEXTAREA";function sc(t){return gi(t)&&t.type==="checkbox"?t.checked?t.value&&t.value!=="on"?t.value:"Yes":null:gi(t)&&t.type==="radio"?t.checked?t.value:null:ic(t)&&t.value||null}var Ge=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=ni(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=ut(e,"quantity")?Math.max(0,parseInt(p(e,"quantity")??"",10)||0):1,it.set(e,this),e.setAttribute(f("state"),"ready"),e.removeAttribute(f("error")),this.renderProduct(),mi(this),this.renderVariant(),to(e,"product"),pt("product"),P("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=Vt(r)),this.root.setAttribute(f("state"),"ready"),this.root.removeAttribute(f("error")),this.renderProduct(),this.renderVariant(),pt("product"),P("product-updated",{product:e,scope:this},this.root)}$(e){let n=ct(this.root,e,oc());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=(je.get(this.product.handle)??[]).indexOf(e);return n[r]?.name??e}get plan(){let e=Ht(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 De(this.purchase,this.variant).kind==="subscription"}getLine(){if(!this.variant)return null;let e={merchandiseId:this.variant.id,quantity:this.quantity},n=De(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=Ae(ke(this.root,"line-attributes")),n=this.$(c("line-attribute")).flatMap(r=>{let o=sc(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(a=>a.name===e&&a.value===n)),[o]=r;if(!o)return;let i={...this.selected,[e]:n};if(!r.some(s=>s.selectedOptions.every(a=>i[a.name]===a.value))){let s=l=>l.selectedOptions.filter(g=>g.name!==e&&this.selected[g.name]===g.value).length*2+(l.availableForSale?1:0),a=r.reduce((l,d)=>s(d)>s(l)?d:l,o);Object.assign(i,Vt(a))}this.selected=i,this.renderVariant()}selectVariant(e){let n=this.product.variants.nodes.find(r=>r.id===Q.variant(e));n&&(this.selected=Vt(n),this.renderVariant())}setPurchase(e){let n=He(this.product,this.variant,e,Ht(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=ut(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 y.add(e);return P("product-added",{product:this.product,variant:this.variant,line:e},this.root),n}renderProduct(){let{product:e}=this;je.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))&&Dn([e]),Lo(this)}renderVariant(){let e=ri(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,li(this,e),P("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 ac='script[type="application/json"][data-tether-hydrate]',jt=new WeakSet,Hn=new WeakSet,Lt=new Set,bt=new Set,hi=new WeakMap;function Gt(){Lt.forEach(t=>{t.isConnected||Lt.delete(t)}),bt.forEach(t=>{t.root.isConnected||bt.delete(t)})}function J(t,e){return[...t.matches?.(e)?[t]:[],...h(t,e)]}function uc(t,e){let n=p(t,"page-title");if(!n||typeof document>"u")return;let r=new Map([["title",e.title],["vendor",e.vendor||""],["type",e.productType||""]]);document.title=n.replace(/\{(\w+)\}/g,(o,i)=>r.get(i)??o)}function cc(t,{fromUrl:e,raw:n}){e?(jt.add(t),ot(t,"not-found"),P("product-not-found",{key:null,source:n},t)):t.closest(Kt())||T(`[${f("product")}] without a value. Bind it to the Shopify handle field, or use "url:handle".`,t)}function lc(t,e,{fromUrl:n,raw:r},o){let i=qe(o);if(ot(t,i?"not-found":"error",o),!i){m(o,`product ${e}`),P("error",{error:o,context:"product",key:e},t);return}P("product-not-found",{key:e,source:r},t),n?L(`product not found: ${e}`):m(o,`product ${e}`)}function de(t){if(jt.has(t))return!1;let{key:e,...n}=vt(t);if(!e)return cc(t,n),!1;jt.add(t),Lt.add(t);let r={};hi.set(t,r);let o=()=>hi.get(t)===r;return it.get(t)?t.setAttribute(f("state"),"updating"):ot(t,"loading"),Vn(nt(e)).then(s=>{if(!o())return;let a=it.get(t);a?a.update(s):new Ge(t,s),uc(t,s),u.revalidate&&Ao(e)&&dc(e)}).catch(s=>{o()&&lc(t,e,n,s)}),!0}function bi(){Gt(),Lt.forEach(t=>{t.getAttribute(f("state"))!=="error"||t.getAttribute(f("error"))==="not-found"||(jt.delete(t),de(t))})}var Ke=new Set;function dc(t){Ke.size||setTimeout(fc,0),Ke.add(t)}function pc(t,e){Lt.forEach(n=>{let r=it.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 fc(){let t=[...Ke];Ke=new Set,t.forEach(e=>{xo(e).then(n=>{pc(e,n)}).catch(n=>{m(n,`refresh ${e}`)})})}var st=null,Vn=t=>(st?.add(t),t);function We(){if(!st)return;let t=[...st];Promise.allSettled(t).then(()=>{if(!(!st||t.some(e=>!st?.has(e)))){if(t.length!==st.size){We();return}st=null,document.documentElement.classList.remove(`${u.prefix}-market-pending`)}})}function mc(t){if(!k(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(mo)}}var yi=new WeakSet;function qn(t=document){J(t,ac).forEach(e=>{if(yi.has(e))return;yi.add(e);let n;try{n=JSON.parse(e.textContent)}catch(s){T("bad data-tether-hydrate",s);return}let{country:r,language:o,products:i}=mc(n);if(Dn(i),r===u.country&&o===u.language){ko(i);return}L("hydration skipped: other market"),st||(st=new Set,document.documentElement.classList.add(`${u.prefix}-market-pending`))})}var gc=()=>`${u.prefix}:market:${u.domain}`,hc={getItem:t=>At(t)};function yc(t){try{return JSON.parse(t)}catch(e){if(e instanceof SyntaxError)return null;throw e}}function bc(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 Pc=t=>bc(yc(t));function jn(t=hc){let e=t.getItem(gc());return e?Pc(e):null}var Ei={country:void 0,language:void 0,locale:void 0},Gn=!1;function wi(){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 Ec(){let t=u.markets??{};if(t.detect===!1)return null;if(!t.detect)return t.remember===!1?null:jn();try{return(await C("markets")).detectMarket(t)}catch(e){return m(e,"markets"),null}}async function Si(t){Ei={country:u.country,language:u.language,locale:u.locale};let e=wi();if(Gn=e!==null,e){u.country=e.country,u.language=e.language,e.locale&&(u.locale=e.locale);return}let n=await Ec();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 Pi=(t,e)=>(t??"").toUpperCase()===(e??"").toUpperCase();function Ci(){let t=wi(),e=t===null&&Gn;Gn=t!==null;let n=t??(e?jn()??Ei:null);return!n?.country||Pi(n.country,u.country)&&Pi(n.language,u.language)?null:{country:n.country,language:n.language,locale:n.locale}}function Ot(t,e){return C("markets").then(n=>n.setCountry(t,e))}var Ti={"tether.diagnose.min.js":"sha384-NTaboAC3orz3nF1fX9PLgau1nipQuIBo6TQ7gwmIRUV+44+DGcAgUXOCH5zuLw4/","tether.markets.min.js":"sha384-ha4pc8hbwUXHGB4U1e/ijx20T1+40KEhJpxE/Gq5Zp13bmO0AnFXl2Xyrnb4gO20","tether.search.min.js":"sha384-aMFrDjTbk2EsLCiZXWnFvmH+O6PQQFr3tOuFmBtpZb5NzF78tgKpn2K/Wbtexc37","tether.lists.min.js":"sha384-FzANKhM0QPWsfi74b41PSPBkyKwF+zm6AtCIOvgf80VLctSNwbo6ftLHAjSg0aqF","tether.extras.min.js":"sha384-DLw/z5KrjutfIZibKrrMSWZH3WRs1jVAB1hFz6QVhq7lCB/ICRqK1K/g7JtBuGVo","tether.account.min.js":"sha384-8Vyrl7RW1NWUUoactMCOF0pWWlC6R2o2u2edq7GKN2VCURXpmI5AoMNRB4U9cZ7T","tether.account-pages.min.js":"sha384-i/wZIkBZTdL0Nr5nVEc6y4fXrDDrIsweph6sDChClClnE+EnjJDgu4Zq+7riAJN5","tether.analytics.min.js":"sha384-O81h7sraAGtdmS986HkBmoGlC8O+aN0F4oozOm7tFGdgr+l9SlFgDWf+MKEW1gMz"};function Kn(t){return k(t)&&k(t.__core)&&k(t.__parts)}var pe="0.9.7";var Ai={get"config.ts"(){return[u,Mt,L,Qt,rn,m,T]},get"client.ts"(){return[an,at,K,F,z,b,ln]},get"dom.ts"(){return[Xt,f,Ae,W,P,we,O,p,ut,Jt,eo,lt,pt,ke,Rt,h,Y,ct,c,D,Se,w,H]},get"loader.ts"(){return[Re,nt,Tt,Ut,Ln]},get"fragments.ts"(){return[io]},get"selling-plans.ts"(){return[R]},get"status.ts"(){return[le,qe,vt,ot]},get"cart.ts"(){return[y]},get"product.ts"(){return[it]},get"collection.ts"(){return[Kt]},get"mounting.ts"(){return[bt,Lt,jt,de,Gt,J]},get"market-codes.ts"(){return[_,U]},get"page-market.ts"(){return[Ot]},get"shopify-values.ts"(){return[ge,250]},get"lazy.ts"(){return[C]}},wc=/\.min\.js(\?|$)/,ki=typeof document>"u"?"":document.currentScript?.getAttribute("src")??"",Qe=ki?new URL(ki,document.baseURI).href:"",Sc=/^(https:\/\/cdn\.jsdelivr\.net\/(gh|npm)\/@?[^/@]+\/[^/@]+)(@(latest|\d+(\.\d+)?))?\//;function Cc(t){return t.replace(Sc,(e,n,r)=>`${n}@${r==="gh"?"v":""}${pe}/`)}var Be=new Map;function Tc(){return u.partsUrl?new URL(u.partsUrl,document.baseURI).href:Qe?Cc(Qe.replace(/[^/]*$/,"")):null}function kc(t,e){t.integrity=e,new URL(t.src).origin!==window.location.origin&&(t.crossOrigin="anonymous")}function Ac(t,e,n,r){return new Promise((o,i)=>{let s=`${e.replace(/\/?$/,"/")}${n}`,a=document.createElement("script");a.src=s,a.async=!0,kc(a,r),a.onload=()=>{let l=Reflect.get(window,"Tether"),d=Kn(l)?l.__parts[t]:void 0;if(d){o(d);return}Be.delete(t);let g=Kn(l)?"did not register":"can't register: window.Tether is no longer this Tether script's, another script replaced it";i(new Error(`${s} ${g}`))},a.onerror=()=>{Be.delete(t),i(new Error(`Could not load ${s}, 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(a)})}function C(t){let e=Be.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=wc.test(Qe)||!Qe?".min":"",o=`tether.${t}${r}.js`,i=Ti[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=Ac(t,n,o,i),Be.set(t,e)}return e}var Kt=()=>`${c("collection")},${c("products")},${c("recommendations")}`;function xi(t){return ot(t,"loading"),{root:t,load:()=>C("lists").then(e=>e.loadList(t)).catch(e=>{ot(t,"error",e),m(e,"lists")})}}function vi(t){let e=[],n=new window.AbortController,r={signal:n.signal};return Xt.forEach(o=>{document.addEventListener(`${u.prefix}:${o}`,i=>e.push(i),r)}),document.addEventListener("astro:page-load",o=>e.push(o),r),t().then(o=>o.startAnalytics(e)).catch(o=>{n.abort(),e.length=0,m(o,"analytics")}),e}var Oi=()=>`${u.prefix}:account-hint:${u.domain}`;function Li(t){se(t,"sessionStorage"),se(t,"localStorage")}function Ii(){Li(`${u.prefix}:account:${u.domain}`),Li(`${u.prefix}:account-login:${u.domain}`)}var Mi=t=>t==="in"||t==="expired"||t==="error";var xc=["account-login","account-bind","account-link","orders","order","addresses","subscriptions","profile-form","address-form"],vc=()=>[...xc.map(t=>`[${f(t)}]`),`[${f("show")}^="logged-"]`].join(",");function Lc(){return!!At(Oi())}function Ri(t){!u.account||!(J(t,vc()).length>0||Mi(new URLSearchParams(window.location.search).get("account"))||Lc())||C("account").then(n=>n.mountAccount(t)).catch(n=>{m(n,"account")})}function I(t){return(...e)=>C("account").then(n=>{let r=n[t];return r(...e)})}var Ni={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 $i=()=>`data-${u.prefix}-key`,_i=t=>t instanceof window.Element;function Ui(t){let e=t.closest(`[${$i()}]`),n=e?.getAttribute($i());return e&&n?{line:e,id:n}:null}function ze(t,e){t.catch(n=>{m(n,e)})}function Oc(t,e){let n=Ui(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"),ze(y.removeLine(o),"cart line");return}let i=Ic(e);!i||!y.lines.some(s=>s.id===o)||(t.preventDefault(),ze(y.changeQuantity(o,i),"cart line"))}function Ic(t){return t.closest(c("line-plus"))?1:t.closest(c("line-minus"))?-1:0}function Mc(t){let{target:e}=t;if(!_i(e))return;if(e.closest(c("cart-open"))){t.preventDefault(),y.toggle();return}if(e.closest(c("cart-close"))){t.preventDefault(),y.close();return}let n=e.closest(c("cart-clear"));if(n){t.preventDefault(),W(n,()=>y.clear().catch(o=>{m(o,"cart clear")}));return}let r=e.closest(c("checkout"));if(r){t.preventDefault(),W(r,()=>y.checkout());return}Oc(t,e)}function Fi(t,e,n){t.classList.add("is-busy"),t.setAttribute("aria-busy","true"),ze(e,n)}function Rc(t,{line:e,id:n}){let r=t.value.trim();if(yn.test(r)){Fi(e,y.updateLine(n,Number(r)),"cart line");return}let o=y.lines.find(i=>i.id===n);o&&(t.value=String(y.quantityOf(o)))}function Nc(t){let{target:e}=t;if(!_i(e))return;let n=Ui(e);n&&e instanceof window.HTMLInputElement&&e.matches(c("line","quantity"))?Rc(e,n):n&&e instanceof window.HTMLSelectElement&&e.matches(c("line-plan"))?Fi(n.line,y.updateLine(n.id,{sellingPlanId:e.value||null}),"cart line plan"):$c(e)&&e.matches(c("cart-note"))&&ze(y.setNote(e.value),"cart note")}var $c=t=>t instanceof window.HTMLInputElement||t instanceof window.HTMLTextAreaElement||t instanceof window.HTMLSelectElement;function _c(t){if(y.isOpen()){if(t.key==="Escape"){y.close();return}An(t)}}function Di(){document.addEventListener("click",Mc),document.addEventListener("change",Nc),document.addEventListener("keydown",_c)}var Wn=t=>t instanceof window.Element;function Uc(t){let e=t.querySelector(c("discount-input"))??t.querySelector("input");return e instanceof window.HTMLInputElement?e:null}function Fc(t){let{target:e}=t,n=Wn(e)?e.closest(c("discount-form")):null;if(!n)return;t.preventDefault();let r=Uc(n),o=r?.value.trim();o&&W(n,()=>C("extras").then(i=>i.applyDiscountCode(n,r,o))).catch(i=>{m(i,"discount")})}function Dc(t){let{target:e}=t;if(!Wn(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=Wn(e)?e.closest(c("discount-remove")):null;if(!n)return;t.preventDefault();let r=n.closest(c("discount-code"))?.getAttribute(f("discount-code"));r&&y.removeDiscount(r).catch(o=>{m(o,"discount")})}function Hi(){document.addEventListener("submit",Fc,!0),document.addEventListener("input",Dc),document.addEventListener("click",Hc)}var Qn=t=>C("extras").then(e=>e.addGroup(t)),Bn=t=>{m(t,"extras")};function Vc(t){let{target:e}=t,n=e instanceof window.Element?e.closest(c("group-add")):null;n&&(t.preventDefault(),W(n,()=>Qn(n)).catch(Bn))}function qc(t){!u.domain||!t.key?.startsWith(`${u.prefix}:`)||C("extras").then(e=>{e.onStorage(t)}).catch(Bn)}function jc(t){if(!lt(t,"variant-changed"))return;let{target:e}=t;e instanceof window.Element&&(!u.variantUrl&&!e.hasAttribute(f("variant-url"))||C("extras").then(n=>{n.writeVariantUrl(e,t.detail)}).catch(Bn))}function Vi(){document.addEventListener("click",Vc),window.addEventListener("storage",qc),document.addEventListener(`${u.prefix}:variant-changed`,jc)}var zn=null;function qi(){zn=document.body}async function Gc(t){await t.ready();let e=Ci();if(!e){zn!==document.body&&t.mount(document);return}try{await Ot(e.country,{language:e.language??null,locale:e.locale,remember:!1})}catch(n){m(n,"country")}t.mount(document)}function Kc(t){document.addEventListener("astro:page-load",()=>{Gc(t).catch(e=>{m(e,"page mount")})}),document.addEventListener("astro:before-swap",()=>{zn=null,t.unmount()})}function Wc(t){let{target:e}=t;!(e instanceof window.HTMLSelectElement)||!e.matches(c("country-select"))||e.value&&Ot(e.value).catch(n=>{m(n,"country")})}function Qc(){bi(),bt.forEach(t=>{t.root.getAttribute(f("state"))==="error"&&t.load()})}function ji(t){u.astro&&Kc(t),document.addEventListener("change",Wc),window.addEventListener("online",Qc)}var Bc=50;function zc(){let t=te("TETHER_CONFIG");return typeof t=="object"&&t!==null?Object.fromEntries(Object.entries(t)):{}}var Pt=null,Yn=null,Yc=null,Gi=!1;function Xc(t){let e=0;return J(t,Kt()).forEach(n=>{if(Hn.has(n))return;Hn.add(n),e++;let r=xi(n);bt.add(r),n.addEventListener(`${u.prefix}:list-rendered`,o=>{lt(o,"list-rendered")&&Ye(o.detail.container)}),Vn(r.load())}),e}function Jc(t){J(t,`${c("country-select")},${c("country-bind")}`).length&&C("markets").then(e=>e.renderCountrySelects(t)).catch(e=>{m(e,"markets")}),Ri(t),J(t,c("search")).length&&C("search").then(e=>{e.mountSearch(t)}).catch(e=>{m(e,"search")})}function Ki(t){let e=Xc(t);return J(t,c("product")).forEach(n=>{de(n)&&e++}),Jc(t),e}function Ye(t=document){if(!Mt())return 0;t===document&&qi(),Gt(),qn(t.ownerDocument??document);let e=Ki(t);return We(),y.render(),L(`mounted ${e} scope(s)`,t),e}function Zc(t){let e=t.filter(r=>r.isConnected&&!t.some(o=>o!==r&&o.contains(r)));if(!e.length||!Mt())return;Gt(),e.forEach(r=>{qn(r)});let n=e.reduce((r,o)=>r+Ki(o),0);We(),y.render(),L(`mounted ${n} scope(s) in ${e.length} added element(s)`)}function Wi(){y.close()}function tl(t){let e=t?.closest(c("product"));return e?it.get(e)??null:null}function el(){Gi||(Gi=!0,Di(),Hi(),Vi(),ji({ready:()=>Pt??Promise.resolve(null),mount:Ye,unmount:Wi}))}async function nl(t){let e=u.country,n=t?.buyerIdentity.countryCode;if(!t||!e||!n||n===e)return t;try{return await y.setBuyerIdentity({countryCode:e},{create:!1})}catch(r){return m(r,"cart country"),t}}function Qi(t={}){return Pt&&!Object.keys(t).length?Pt:(Cr({...zc(),...t}),Mt()?(Ii(),el(),u.observe&&rl(),u.analytics&&(Yc??(Yc=vi(()=>C("analytics")))),Pt=Si(t).then(()=>y.init()).then(nl).then(e=>(P("ready",{cart:e}),Xn)),Pt):(T("TETHER_CONFIG is missing domain or token. Tether is idle."),Pt=Promise.resolve(null),Pt))}function rl(){if(Yn||typeof MutationObserver>"u")return;let t,e=new Set;Yn=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(),Zc(r)},Bc)}),Yn.observe(document.body,{childList:!0,subtree:!0})}var ol=t=>C("markets").then(e=>e.detectMarket(t??u.markets)),il=t=>C("lists").then(e=>e.getProducts(t)),sl=(t,e)=>C("lists").then(n=>n.getRecommendations(t,e)),al=()=>C("markets").then(t=>t.getLocalization()),ul=t=>C("diagnose").then(e=>e.diagnose({...t,version:pe}));function cl(t,e){let n=`${u.prefix}:${t}`,r=o=>{lt(o,t)&&e(o.detail,o)};return document.addEventListener(n,r),()=>{document.removeEventListener(n,r)}}var ll={VERSION:pe,init:Qi,mount:Ye,unmount:Wi,get config(){return Sr},get ready(){return Pt??Promise.resolve(null)},query:Rr,withContext:Ir,cart:y,getProduct:nt,getProducts:il,getRecommendations:sl,getScope:tl,addGroup:Qn,account:Ni,primeProduct:Ut,normalizeProductKey:Tt,clearProductCache:Re,formatMoney:O,imageUrl:he,plans:wn,TetherError:b,resolveProductKey:vt,setCountry:Ot,detectMarket:ol,getLocalization:al,diagnose:ul,on:cl},dl={__core:Ai,__parts:{}},Xn=Object.assign(ll,dl),Rm=Xn;function pl(){Reflect.set(window,"Tether",Xn);let t=te("TETHER_CONFIG");if(!t||Z(t,"autoMount")===!1||te("TETHER_INTEGRATION"))return;let e=()=>{Qi().then(()=>Ye(document)).catch(n=>{m(n,"init")})};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",e,{once:!0}):e()}typeof window<"u"&&typeof document<"u"&&pl();})();
1
+ (()=>{var rr=Object.defineProperty;var Zi=(t,e,n)=>e in t?rr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var ta=(t,e)=>{for(var n in e)rr(t,n,{get:e[n],enumerable:!0})};var M=(t,e,n)=>Zi(t,typeof e!="symbol"?e+"":e,n);var or="2026-07";var ea=/^(\d{4})-(01|04|07|10)$/;function na(t){let e=ea.exec(typeof t=="string"?t:"");return e?{year:Number(e[1]),month:Number(e[2])}:null}var ir=t=>na(t)!==null;function T(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function Z(t,e){return T(t)?t[e]:void 0}var ra=/^[A-Za-z0-9_.-]+$/,oa=/^(\$app(:[A-Za-z0-9_-]+)?|[A-Za-z0-9_.-]+)$/,Ze=(t,e)=>oa.test(t)&&ra.test(e);function ar(t){let e=t.indexOf(".");if(e<=0)return null;let n=t.slice(0,e),r=t.slice(e+1);return Ze(n,r)?{namespace:n,key:r}:null}var ia=/^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i,aa=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,sa=/^[A-Za-z_$][\w$]*$/,sr="https://site.invalid",ua=new Set(["localhost","127.0.0.1","[::1]"]),Wt=["saved","server","webflow"],ca=["no-banner","default-banner","custom-banner"],Bt=t=>typeof t=="string"&&t!=="",la=t=>typeof t=="function";function cr(t,e){if(typeof t!="string"||!t)return"";let n=t.replace(/^https?:\/\//,"").replace(/\/.*$/,"");return fa(n)?n:(e("domain",t),"")}function lr(t){if(!Bt(t))return!1;try{let e=new URL(t,`${sr}/`);return e.origin===sr?!0:e.protocol==="https:"||e.protocol==="http:"&&ua.has(e.hostname)}catch{return!1}}function dr(t,e){return t==null||t===""?null:typeof t=="string"&&(lr(t)||da(t))?t:(e("partsUrl",t),null)}function da(t){if(typeof location>"u")return!1;try{return new URL(t).origin===location.origin}catch{return!1}}function pa(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 pr(t,e){if(!Array.isArray(t))return e("embedOrigins",t),[];let n=[],r=t;for(let o of r){let i=pa(o);i?n.push(i):e("embedOrigin",o)}return n}function tn(t){if(typeof t=="string")return ar(t);if(typeof t!="object"||t===null)return null;let e=Reflect.get(t,"namespace"),n=Reflect.get(t,"key");return typeof e!="string"||typeof n!="string"?null:Ze(e,n)?{namespace:e,key:n}:null}function fr(t,e){if(!Array.isArray(t))return e("metafields",t),[];let n=[],r=t;for(let o of r){let i=tn(o);i?n.push(typeof o=="string"?o:i):e("metafield",o)}return n}var It=t=>e=>t(e)?e:void 0,fa=t=>Bt(t)&&ia.test(t),ma=t=>Bt(t)&&aa.test(t),ga=t=>typeof t=="boolean"||Bt(t)&&sa.test(t),Qt=It(lr),ge=It(Bt),ur=It(t=>typeof t=="boolean"),mr=It(la);function zt(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 ha={server:Qt,orderUrl:Qt,subscriptionsUrl:Qt,paymentUrl:Qt,logoutUrl:Qt,locale:ge,navigate:mr},ya="customer accounts need the Worker since 0.7.0: set account.server",ba={country:ge,language:ge,locale:ge},Pa={detect:t=>{if(typeof t=="boolean")return t;let e=Array.isArray(t)?t:[t];return typeof t=="string"||Array.isArray(t)?Wt.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=zt(`markets.locales.${n}`,r,ba,()=>{});o&&(e[n]=o)}return e},cookie:It(ma),remember:ur,strict:ur},Ea={consent:t=>ca.find(e=>e===t),proxy:t=>t!==void 0&&!!t},wa={dataLayer:It(ga),shopify:t=>typeof t=="boolean"?t:zt("analytics.shopify",t,Ea,()=>{})??void 0,onEvent:mr};function gr(t,e,n){let r=zt("account",t,ha,e);if(r===null)return null;let{server:o}=r;return o===void 0?(n(ya),null):{...r,server:o}}var en=(t,e)=>zt("markets",t,Pa,e),hr=(t,e)=>zt("analytics",t,wa,e);var Sa=/^[A-Z]{2}$/,Ca=new Set(["XX","T1"]),Ta=new Set(["PT_BR","PT_PT","ZH_CN","ZH_TW"]),ka=/^[A-Z]{2,3}$/;function _(t){let e=(typeof t=="string"?t:"").trim().toUpperCase();return!Sa.test(e)||Ca.has(e)?null:e}function U(t){let e=(typeof t=="string"?t:"").trim().replace("-","_").toUpperCase();if(Ta.has(e))return e;let n=e.split("_")[0]??"";return ka.test(n)?n:null}function he(t){if(typeof t!="string")return!1;try{return new URL(t).protocol==="https:"}catch{return!1}}function yr(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 br(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 Pr(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}var tt={domain:"",token:"",apiVersion:or,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={...tt};function nn(t){return C(`Tether.config is read-only (${String(t)}): pass options to Tether.init() instead`),!1}var Er=new WeakMap,Ar={get:(t,e)=>wr(Reflect.get(t,e)),getOwnPropertyDescriptor(t,e){let n=Reflect.getOwnPropertyDescriptor(t,e);return n&&(n.value=wr(n.value)),n},set:(t,e)=>nn(e),deleteProperty:(t,e)=>nn(e),defineProperty:(t,e)=>nn(e)};function wr(t){return typeof t=="object"&&t!==null?Aa(t):t}function Aa(t){let e=Er.get(t);return e||(e=new Proxy(t,Ar),Er.set(t,e)),e}var xr=new Proxy(u,Ar),xa=/^[a-z][a-z0-9-]*$/,va=["revalidate","openCartOnAdd","cartFocus","variantUrl","autoMount","observe","astro","debug"],La=["token","productPath","collectionPath"],Oa=["imagesFirst","variantsFirst","sellingPlanGroupsFirst","sellingPlansFirst","collectionFirst","retries","requestTimeout","maxAge","lowStock","searchDelay"],Ia=["warningText","formatMoney","onLayoutChange","onCartOpen","onCartClose","onLineEnter","onLineLeave","onValueChange","onError"];function St(t,e,n){return e!==void 0&&C(`invalid ${t} ${JSON.stringify(e)}: using ${JSON.stringify(n)}`),n}function G(t,e){C(`invalid ${t} ${JSON.stringify(e)}: ignored`)}function Ma(t){for(let e of Object.keys(t))Object.hasOwn(tt,e)||C(`unknown option ${JSON.stringify(e)}: ignored`)}function Ra(t,e,n){typeof n=="function"?t[e]=n:n!=null&&G(e,n)}var Sr=2147483647,Na=10,Yt={min:1,max:250},$a={imagesFirst:Yt,variantsFirst:Yt,sellingPlanGroupsFirst:Yt,sellingPlansFirst:Yt,collectionFirst:Yt,requestTimeout:{max:Sr},searchDelay:{max:Sr},retries:{max:Na}};function _a(t,e){let{min:n=0,max:r}=$a[t]??{};return typeof e!="number"||!Number.isInteger(e)||e<n?St(t,e,tt[t]):r===void 0||e<=r?e:(C(`${t} ${String(e)} is more than its maximum: using ${String(r)}`),r)}function Ua(t,e){return typeof e=="boolean"?e:St(t,e,tt[t])}function Fa(t,e){return typeof e=="string"?e:St(t,e,tt[t])}var Da=/^\S+$/;function Ha(t,e){return typeof e=="string"&&Da.test(e)?e:St(t,e,tt[t])}function Va(t){if(!(t==null||t==="")){try{if(typeof t=="string"&&Intl.getCanonicalLocales(t).length)return t}catch{}G("locale",t)}}function Cr(t,e,n){return n.find(r=>r===e)??St(t,e,n[0])}function qa(t){return t==="unstable"?(C('apiVersion "unstable" changes without notice. Pin a dated version (e.g. 2026-07).'),t):ir(t)?t:St("apiVersion",t,tt.apiVersion)}function Tr(t,e,n){if(e==null||e==="")return;let r=n(e);if(r!==null)return r;G(t,e)}function ja(t){Ma(t);let e=cr(t.domain,G),n=typeof t.prefix=="string"&&xa.test(t.prefix)?t.prefix:St("prefix",t.prefix,tt.prefix),r={...tt,domain:e,apiVersion:qa(t.apiVersion),country:Tr("country",t.country,_),locale:Va(t.locale),partsUrl:dr(t.partsUrl,G),language:Tr("language",t.language,U),markets:en(t.markets,G),analytics:hr(t.analytics,G),account:gr(t.account,G,C),prefix:n,storageKey:typeof t.storageKey=="string"&&t.storageKey?t.storageKey:`${n}:cart:${e}`,metafields:fr(t.metafields??[],G),embedOrigins:pr(t.embedOrigins??[],G),checkoutTarget:Cr("checkoutTarget",t.checkoutTarget,["_self","_blank"]),defaultPurchase:Cr("defaultPurchase",t.defaultPurchase,["one-time","subscription"]),cartDrawerOpenClass:Ha("cartDrawerOpenClass",t.cartDrawerOpenClass)};for(let o of Oa)r[o]=_a(o,t[o]);for(let o of va)r[o]=Ua(o,t[o]);for(let o of La)r[o]=Fa(o,t[o]);for(let o of Ia)Ra(r,o,t[o]);return r}var on=t=>en(t,G);function vr(t={}){let e=ja(t);for(let n of Object.keys(u))n in e||Reflect.deleteProperty(u,n);return Object.assign(u,e)}var Mt=()=>!!(u.domain&&u.token);function L(...t){u.debug&&console.log(`[${u.prefix}]`,...t)}function C(...t){console.warn(`[${u.prefix}]`,...t)}function m(t,e){if(C(e,t instanceof Error&&t.message?t.message:t),!!u.onError)try{u.onError(t,e)}catch(n){C("onError threw",n)}}var kr=new Set;function V(t,e,n){try{return e()}catch(r){let o=r instanceof Error&&`${t}: ${r.message}`;return(!o||!kr.has(o))&&(o&&kr.add(o),m(r,t)),n?.()}}function Lr(t){return t instanceof Error?t.message:String(t)}var b=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 K(t,e){return typeof e=="function"?e(t):typeof e=="string"?e==="object"?T(t):typeof t===e:Ga(e)?Array.isArray(t)&&t.every(n=>K(n,e[0])):T(t)&&Object.entries(e).every(([n,r])=>r===void 0||K(t[n],r))}var Ga=t=>Array.isArray(t),F=t=>e=>e===null||K(e,t),z=t=>e=>K(e,t);function un(t=u){return`https://${t.domain}/api/${t.apiVersion}/graphql.json`}var Nr=/"(?:\\.|[^"\\\n])*"|#[^\n]*/g,Ka=/^\s*(?:query|mutation)(?:\s+\w+)?\s*(?:\([^)]*\))?/;function Qa(t){return/\bmutation\b/.test(t.replace(Nr,""))?"mutation":"query"}function $r(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(Nr,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=Ka.exec(i);if(!s)return t;let l=s[0].length;return`${t.slice(0,l).trimEnd()} ${o} ${t.slice(l).trimStart()}`}function _r(t,e=u){let n=_(e.country)??void 0,r=U(e.language)??void 0;return $r(t,{country:n,language:r})}var cn=300,Wa=500,Ba=3e4,Or=430,za=1e3,sn="quantityAvailable",Ir=new Set,Ya=t=>`${t.domain} ${t.apiVersion} ${t.token}`;function Ja(t,e,n,{context:r,operation:o}){let i=typeof e=="string"?e:e(n),a=r?$r(i,t):i;return t.maxAge<=0||o==="mutation"?a:`${a} #${Math.floor(Date.now()/(t.maxAge*za))}`}var Xa=t=>new Promise(e=>setTimeout(e,t));function ln(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 Za(t){let e=Z(t,"message"),n=Z(Z(t,"extensions"),"code"),r=typeof e=="string"?e:"";return typeof n=="string"?{message:r,extensions:{code:n}}:{message:r}}function ts(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(Za)}:null}function an(t,e){return t.ok?new b(`Invalid response (${t.status})`,{code:"INVALID_RESPONSE",status:t.status}):new b(ln(t.status,e),{status:t.status})}function Mr(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?ln(t.status,n):o),new b(i,{status:t.status,errors:e,code:r})}function Rr(t,e){if(e==="any")return{kind:"retry",backoffMs:cn};throw new b(`Network error: ${Lr(t)}`,{code:"NETWORK"})}function es(t,e,n,r,o,i,a){if(n.includes(sn)&&r.some(g=>g.message.includes(sn)))return{kind:"inventory-refused",error:Mr(t,r,e)};let s=r.map(g=>g.extensions?.code);if(i!=="none"&&s.includes("THROTTLED"))return{kind:"retry",backoffMs:Wa};let l=s.includes("INTERNAL_SERVER_ERROR");if(i==="any"&&l)return{kind:"retry",backoffMs:cn};let d=t.ok&&(l||a==="mutation"&&o==null);throw Mr(t,r,e,d?"SERVER_ERROR":void 0)}async function dn(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 ns(t,e,n,r,o,i,a){let s;try{s=await(t.fetch??fetch)(un(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(A){return Rr(A,o)}if(s.status===Or)throw new b("Shopify security rejection (430)",{status:Or});if(o!=="none"&&s.status===429||o==="any"&&s.status>=500)return{kind:"retry",backoffMs:cn};let l;try{l=await s.json()}catch(A){if(A instanceof SyntaxError)throw an(s,t);return Rr(A,o)}let d=ts(l);if(!d)throw an(s,t);let{data:g,errors:v=[]}=d;if(v.length)return es(s,t,e,v,g,o,i);if(!s.ok)throw new b(ln(s.status,t),{status:s.status});if(!r(g))throw an(s,t);return{kind:"data",data:g}}async function Ur(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 a=Ya(t),s=i==="mutation"?"not-run":"any",l=0;for(;;){let d={inventory:!Ir.has(a)},g=Ja(t,e,d,{context:o,operation:i}),v=l<t.retries?s:"none",A=await dn(t.requestTimeout,$=>ns(t,g,n,r,v,i,$));switch(A.kind){case"data":return A.data;case"inventory-refused":if(typeof e=="string"||!d.inventory)throw A.error;L(`the token can't read inventory: ${sn} is left out from now on`),Ir.add(a);break;case"retry":await Xa(Math.min(A.backoffMs*2**l,Ba)),l+=1,L("retry",l);break}}}function st(t,e,n,r){return Ur(u,t,e,n,r)}var rs=t=>typeof t=="object"&&t!==null;function os(t,e,n={},r){return Ur(t,e,n,rs,{...r,operation:Qa(e)})}function Fr(t,e,n){return os(u,t,e,n)}function Dr(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 f=t=>`${u.prefix}-${t}`,c=(t,e)=>e===void 0?`[${f(t)}]`:`[${f(t)}="${e}"]`,p=(t,e)=>t.getAttribute(f(e)),ut=(t,e)=>t.hasAttribute(f(e));function h(t,e){return t?[...t.querySelectorAll(e)]:[]}var ct=(t,e,n)=>h(t,e).filter(r=>r.closest(n)===t),Jt=["product-ready","list-ready","cart-updated","cart-toggled","checkout","search"],Hr=new WeakMap;function Vr(t,e){let n=new CustomEvent(`${u.prefix}:${t}`,{detail:e,bubbles:!0});return Hr.set(n,t),n}function lt(t,e){return Hr.get(t)===e}function P(t,e,n=document){n.dispatchEvent(Vr(t,e))}var is="http://www.w3.org/1999/xhtml",as=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"]),ss=new Set(["script","style","template","noscript","textarea","select","title"]),us=new Set(["style","title","lang","dir","role","align","width","height"]),cs=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"])]]),ls=new Set(["href","src","poster","cite"]),ds=/^(javascript|vbscript|data):/i,ps=/^data:image\/(png|gif|jpeg|webp|avif);/i,fs=new Set(["position","top","right","bottom","left","z-index","-webkit-box-reflect"]),ms=["inset","transform","translate","rotate","scale","offset"],gs=/\d(?:[sld]?v|cq)(?:w|h|i|b|min|max)\b/i,hs=/^(?:outline|box-shadow|text-shadow|filter|text-decoration|text-underline-offset|text-stroke)|^(?:border-image|mask-border|mask-box-image)(?:-outset)?$/,qr=40,ys=new Map([["letter-spacing",{px:4,em:.25}],["word-spacing",{px:4,em:.25}],["text-indent",{px:qr}]]),jr=/(?<![\w#.-])[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?(%|[a-z]+)?/gi,bs=/(?<![\w-])(?!drop-shadow\(|blur\()[\w-]+\([^()]*\)/g,Gr=/(?:var|calc|min|max|clamp|env|attr)\(/i,Ps=/url\(|expression\(|@import/i,Es=/[\u0000- ]/g,ws="allow-scripts allow-same-origin allow-popups allow-presentation",Ss=new Set(["autoplay","encrypted-media","picture-in-picture","fullscreen","clipboard-write","accelerometer","gyroscope","web-share"]),Cs="strict-origin-when-cross-origin",Ts=["https://www.youtube.com","https://www.youtube-nocookie.com","https://player.vimeo.com","https://www.loom.com","https://fast.wistia.net"];function ks(t,e){return us.has(e)||e.startsWith("aria-")||(cs.get(t)?.has(e)??!1)}function As(t,e,n){let r=n.replace(Es,"");return ds.test(r)?t==="img"&&e==="src"&&ps.test(r):!0}function Kr(t,e){try{return new URL(t,e)}catch{return null}}function xs(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([...Ts,...n])}}function vs(t,e){let n=Kr(t.trim(),e.baseUrl);return n!==null&&n.origin!==e.origin&&e.embedOrigins.has(n.origin)}function Ls(t){let e=t.split(";").map(n=>n.trim().split(/\s+/)[0]?.toLowerCase()??"");return[...new Set(e.filter(n=>Ss.has(n)))].join("; ")}function Os(t,e){if(fs.has(t)||ms.some(r=>t.startsWith(r))||gs.test(e))return!0;let n=ys.get(t);return n?Gr.test(e)||Is(e,n):t.startsWith("margin")&&e.includes("-")}function Is(t,e){return[...t.matchAll(jr)].some(([n="",r=""])=>{let o=parseFloat(n);if(o>=0)return!1;let i=e[r.toLowerCase()];return i===void 0||-o>i})}function Ms(t,e){return hs.test(t.replace(/^-webkit-/,""))?Gr.test(e)?!0:[...e.replace(bs,"").matchAll(jr)].some(([n="",r=""])=>{let o=Math.abs(parseFloat(n));return o!==0&&(r.toLowerCase()!=="px"||o>qr)}):!1}function Rs(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);(Os(i,a)||Ms(i,a)||Ps.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=ls.has(a);ks(n,a)&&(!s||As(n,a,i.value))||t.removeAttribute(i.name)}let r=t.getAttribute("style");if(r===null)return;let o=Rs(r,e.styleParser);o===""?t.removeAttribute("style"):t.setAttribute("style",o)}var $s=new Set(["","_self","_parent","_top"]);function _s(t){if(t.localName==="iframe"){let r=Ls(t.getAttribute("allow")??"");r===""?t.removeAttribute("allow"):t.setAttribute("allow",r),t.setAttribute("sandbox",ws),t.setAttribute("referrerpolicy",Cs);return}if(t.localName!=="a")return;let e=t.getAttribute("target");if(e===null||$s.has(e.toLowerCase()))return;let n=new Set((t.getAttribute("rel")??"").split(/\s+/).filter(Boolean));n.add("noopener"),n.add("noreferrer"),t.setAttribute("rel",[...n].join(" "))}function Us(t,e){let n=t.localName,r=t.namespaceURI===is;if(r&&ss.has(n)){t.remove();return}if(!r||!as.has(n)){t.replaceWith(...t.childNodes);return}if(n==="iframe"&&!vs(t.getAttribute("src")??"",e)){t.remove();return}Ns(t,e),_s(t)}function Qr(t,e=globalThis.document,n=[]){let r=e.createElement("template");r.innerHTML=t??"";let o=xs(e,r,n);for(let i of[...r.content.querySelectorAll("*")])Us(i,o);return r.content}function ye(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 pn(t,e){return t.getAttribute(e)??t.getAttribute(f(e))??t.getAttribute(`data-${e}`)}function Br(t,e){if(!t||!e)return t;let n=pn(e,"max-width"),r=pn(e,"max-height");return ye(t,{width:n,height:r,crop:n||r?pn(e,"crop"):null})}var Wr=t=>t.replace(/\?.*$/,"");function be(t,e){return!t||!e?!1:Wr(t)===Wr(e)}function Fs(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=Br(e,t);if(t.tagName!=="IMG"){t.style.backgroundImage=Fs(r);return}if(be(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 fn=new WeakMap,Xt=t=>!!fn.get(t),mn=t=>t.cloneNode(!0);function zr(t){let e=fn.get(t);if(e!==void 0)return e;let n=t.firstElementChild,r=n?mn(n):null;return fn.set(t,r),t.replaceChildren(),r}function Y(t,e,n){let r=zr(t);if(!r){e.length&&C("repeater without a template child",t);return}t.replaceChildren(),e.forEach((o,i)=>{let a=mn(r);n(a,o,i),t.appendChild(a)})}function Ds(t,e){let n=()=>{t.remove()};if(!e){n();return}V("repeater onLeave",()=>{e(t,n)},n)}function Hs(t,e,n,r){e.forEach((o,i)=>{if(!n.has(o))return;let a=e[i-1];a?.parentNode===t?a.after(o):t.prepend(o),r&&V("repeater onEnter",()=>{r(o)})})}function gn(t,e,n,r,{onEnter:o,onLeave:i}={}){let a=zr(t);if(!a){C("repeater without a template child",t);return}let s=`data-${u.prefix}-key`,l=`data-${u.prefix}-leaving`,d=()=>[...t.children].filter(S=>S.hasAttribute(s)&&!S.hasAttribute(l)),g=new Map(d().map(S=>[S.getAttribute(s),S])),v=[],A=new Set;e.forEach((S,me)=>{let Xe=String(n(S,me)),wt=g.get(Xe);wt?g.delete(Xe):(wt=mn(a),wt.setAttribute(s,Xe),A.add(wt)),r(wt,S,me,A.has(wt)),v.push(wt)});let $=v.filter(S=>!A.has(S)),nr=d().filter(S=>$.includes(S));if(!(nr.length===$.length&&nr.every((S,me)=>S===$[me]))){g.forEach(S=>{S.remove()}),v.forEach(S=>t.appendChild(S));return}Hs(t,v,A,o),g.forEach(S=>{S.setAttribute(l,""),S.removeAttribute(s),S.style.pointerEvents="none",S.inert=!0,Ds(S,i)})}var Yr="data-tether-seen",yn="data-tether-shown",Ee="data-tether-prev-display",Vs=120;function Rt(t,e){return br(u.productPath||"/product",t,e)}function eo(t,e){try{return t()}catch(n){if(n instanceof RangeError)return e;throw n}}function no(t,e=u.locale){return t?eo(()=>new Intl.NumberFormat(e||void 0,{style:"percent",maximumFractionDigits:0}).format(t/100),`${t}%`):""}function O(t){if(!t)return"";let{formatMoney:e,locale:n}=u,r=()=>yr(t,n);return e?V("formatMoney",()=>e(t,n),r):r()}function Se(t){return t?eo(()=>new Date(t).toLocaleDateString(u.locale||void 0),""):""}function Ce(t,e){t.replaceChildren(Qr(e,t.ownerDocument,u.embedOrigins))}var ro=t=>t.tagName==="INPUT"||t.tagName==="TEXTAREA",Zt=t=>t.tagName==="INPUT";function w(t,e){let n=e==null?"":String(e);ro(t)?t.value=n:t.textContent=n}var Jr=t=>ro(t)?t.value:t.textContent;function dt(t,e){let n=Jr(t);w(t,e),n!==Jr(t)&&t.hasAttribute(Yr)&&V("onValueChange",()=>u.onValueChange?.(t,n)),t.setAttribute(Yr,"1")}function qs(t){if(t.hasAttribute(yn))return;t.setAttribute(yn,""),t.removeAttribute("hidden");let e=t.getAttribute(Ee);e!==null?(t.style.display=e,t.removeAttribute(Ee)):t.style.display==="none"&&(t.style.display=""),typeof getComputedStyle=="function"&&getComputedStyle(t).display==="none"&&(t.style.display=t.getAttribute(f("display"))||"block")}function H(t,e){if(e){qs(t);return}t.removeAttribute(yn),!t.hasAttribute(Ee)&&t.style.display!=="none"&&t.setAttribute(Ee,t.style.display),t.style.display="none"}var we='input[type="radio"],input[type="checkbox"]',js=["radio","checkbox","switch","menuitemradio","menuitemcheckbox"],Gs=["button","submit","reset"];function oo(t){let e=t.getAttribute("role");return e==="button"?"aria-pressed":e&&js.includes(e)?"aria-checked":e==="option"||e==="tab"?"aria-selected":e?null:Zt(t)?Gs.includes(t.type)?"aria-pressed":null:t.querySelector(we)?null:"aria-pressed"}function Te(t,e){t.classList.toggle("is-selected",e);let n=oo(t);n==="aria-pressed"&&t.tagName!=="BUTTON"&&!Zt(t)&&(t.setAttribute("role","button"),t.hasAttribute("tabindex")||t.setAttribute("tabindex","0")),n&&t.setAttribute(n,String(e)),Zt(t)&&t.matches(we)&&(t.checked=e);let r=t.querySelector(we);r&&Zt(r)&&(r.checked=e)}var Pe="tether-unavailable";function Ks(t,e){if(e&&!document.getElementById(Pe)){let r=document.createElement("span");r.id=Pe,r.hidden=!0,r.textContent="Unavailable",document.body.append(r)}let n=(t.getAttribute("aria-describedby")??"").split(" ").filter(r=>r&&r!==Pe);e&&n.push(Pe),n.length?t.setAttribute("aria-describedby",n.join(" ")):t.removeAttribute("aria-describedby")}function ke(t,e,n){t.classList.toggle("is-unavailable",e);let o=oo(t)!==null||Zt(t)?t:t.querySelector(we);o&&(n==="picks-closest"?Ks(o,e):o.setAttribute("aria-disabled",String(e)))}var Xr,te=t=>Reflect.get(window,t);function Qs(){let t=te("ScrollTrigger");if(typeof t!="function")return;let e=Reflect.get(t,"refresh");typeof e=="function"&&Reflect.apply(e,t,[])}function pt(t){clearTimeout(Xr),Xr=setTimeout(()=>{V("layout-changed",()=>{u.onLayoutChange?u.onLayoutChange(t):Qs()}),P("layout-changed",{reason:t})},Vs)}function io(t,e){let n=[...t.querySelectorAll("img")].filter(i=>!i.complete),r=n.length,o=()=>{r-=1,r===0&&pt(`${e}:images`)};n.forEach(i=>{i.addEventListener("load",o,{once:!0}),i.addEventListener("error",o,{once:!0})})}function Q(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 Ae(t,e){let n=t?p(t,e):null;if(!n)return null;try{return JSON.parse(n)}catch{return C(`invalid JSON in ${f(e)}`,t),null}}var bn=/^-?\d+$/,Zr=new WeakMap;function to(t,e,n){let r=Zr.get(t)??new Set;Zr.set(t,r),!r.has(e)&&(r.add(e),C(`${f(e)} ${n}`,t))}function ao(t,e,{min:n,max:r,fallback:o}){let i=p(t,e)?.trim();if(!i)return o;let a=bn.test(i)?Number(i):Number.NaN;return Number.isNaN(a)||a<n?(to(t,e,`${JSON.stringify(i)} is not a whole number from ${String(n)}: using ${String(o)}`),o):r===void 0||a<=r?a:(to(t,e,`${i} is more than its maximum: using ${String(r)}`),r)}function hn(t){return t==null?"":typeof t=="string"?t:typeof t=="number"||typeof t=="boolean"?String(t):JSON.stringify(t)}function xe(t){return Array.isArray(t)?t.filter(T).map(n=>({key:hn(n.key),value:hn(n.value)})):T(t)?Object.entries(t).map(([e,n])=>({key:e,value:hn(n)})):[]}function ee(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 ft="url altText width height";var E="amount currencyCode",so={inventory:!0},uo=t=>t.inventory?"quantityAvailable":"";function Ws(t){let e=[];for(let r of t){let o=tn(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{${ft}}}}}`:""}var Bs=` id name description recurringDeliveries options{name value}priceAdjustments{orderCount adjustmentValue{__typename ... on SellingPlanPercentagePriceAdjustment{adjustmentPercentage}... on SellingPlanFixedAmountPriceAdjustment{adjustmentAmount{${E}}}... on SellingPlanFixedPriceAdjustment{price{${E}}}}}`,zs=` sellingPlan{id}checkoutChargeAmount{${E}}remainingBalanceChargeAmount{${E}}priceAdjustments{price{${E}}compareAtPrice{${E}}perDeliveryPrice{${E}}unitPrice{${E}}}`;function co(t=u,e=so){return` fragment TetherProduct on Product{id handle title description descriptionHtml productType vendor tags availableForSale publishedAt onlineStoreUrl requiresSellingPlan seo{title description}featuredImage{${ft}}images(first:${t.imagesFirst}){nodes{${ft}}}options{name optionValues{name swatch{color image{previewImage{${ft}}}}}}priceRange{minVariantPrice{${E}}maxVariantPrice{${E}}}compareAtPriceRange{minVariantPrice{${E}}maxVariantPrice{${E}}}${Ws(t.metafields)} sellingPlanGroups(first:${t.sellingPlanGroupsFirst}){nodes{name appName options{name values}sellingPlans(first:${t.sellingPlansFirst}){nodes{${Bs}}}}}variants(first:${t.variantsFirst}){nodes{id title availableForSale currentlyNotInStock ${uo(e)} sku barcode selectedOptions{name value}image{${ft}}price{${E}}compareAtPrice{${E}}unitPrice{${E}}sellingPlanAllocations(first:${t.sellingPlansFirst}){nodes{${zs}}}}}}`}function Pn(t=so){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 ${uo(t)} image{${ft}}price{${E}}compareAtPrice{${E}}selectedOptions{name value}product{id title handle vendor featuredImage{${ft}}}}}... on ComponentizableCartLine{lineComponents{id quantity merchandise{... on ProductVariant{id title product{title handle}}}}}}}}`}var Sn={};ta(Sn,{GID:()=>W,allPlans:()=>R,allocationFor:()=>N,findPlan:()=>$t,hasPlans:()=>Xs,planAdjustment:()=>wn,planCheckoutCharge:()=>En,planPrice:()=>Nt,planSavings:()=>re,plansForVariant:()=>Zs,toGid:()=>ve});var Ys=/^(-?)(\d+)(?:\.(\d+))?$/;function lo(t,e){let n=Ys.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 po=t=>t.split(".")[1]?.length??0;function go(t,e){if(t==null||e==null)return!1;let n=Math.max(po(t.trim()),po(e.trim())),r=lo(t,n),o=lo(e,n);return r===null||o===null?!1:r>o}var fo=2,mo=new Map;function ho(t){let e=mo.get(t);if(e!==void 0)return e;let n=fo;try{n=new Intl.NumberFormat("en",{style:"currency",currency:t}).resolvedOptions().maximumFractionDigits??fo}catch{}return mo.set(t,n),n}function Ct(t){return Math.round(parseFloat(t.amount)*10**ho(t.currencyCode))}function ne(t,e){let n=ho(e);return{amount:(t/10**n).toFixed(n),currencyCode:e}}var Js=100;function ve(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 W={product:t=>ve(t,"Product"),variant:t=>ve(t,"ProductVariant"),sellingPlan:t=>ve(t,"SellingPlan")};function R(t){return(t?.sellingPlanGroups?.nodes??[]).flatMap(n=>n.sellingPlans.nodes.map(r=>({...r,group:n})))}function Xs(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 Zs(t,e){return R(t).filter(n=>N(e,n.id))}function Nt(t,e){let n=N(t,e)?.priceAdjustments[0];return n?.perDeliveryPrice??n?.price??t?.price??null}function En(t,e){let n=N(t,e);return n?.checkoutChargeAmount??n?.priceAdjustments[0]?.price??t?.price??null}function re(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=Ct(t.price)-Ct(n);return{amount:ne(i,t.price.currencyCode),percentage:Math.round((1-o/r)*Js)}}function wn(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=R(t),r=W.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 et={amount:"string",currencyCode:"string"},_t={id:"string",handle:"string",title:"string",options:["object"],images:{nodes:["object"]},priceRange:{minVariantPrice:et,maxVariantPrice:et},variants:{nodes:[{id:"string",price:et,selectedOptions:["object"]}]}},yo={nodes:[_t],pageInfo:{hasNextPage:"boolean"}},bo=t=>Z(t,"id")!==""&&Z(t,"handle")!==""&&K(t,_t),Po=t=>T(t)&&(t.id===void 0||K(t,_t)),hd=z({collection:F({handle:"string",products:yo})}),yd=z({products:yo}),bd=z({productRecommendations:F([_t])});var tu={id:"string",quantity:"number",attributes:["object"],cost:{totalAmount:et,subtotalAmount:et,amountPerQuantity:et},merchandise:{id:"string",selectedOptions:["object"],product:"object"}},Cn={id:"string",checkoutUrl:"string",totalQuantity:"number",attributes:["object"],discountCodes:["object"],cost:{totalAmount:et,subtotalAmount:et},lines:{nodes:[tu]}};var eu='a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])',nu=60,kn=!1,An=!1,Le=null,Tn=null,ru=t=>t!==null&&"focus"in t,Eo=t=>h(t,eu).filter(e=>e.offsetParent!==null||e===document.activeElement),mt=()=>h(document,c("cart-drawer")),xn=t=>t.classList.contains(u.cartDrawerOpenClass),wo=t=>t.some(e=>e.contains(document.activeElement)),ou=t=>p(t,"cart-drawer")==="manual";function J(){return[...document.getElementsByClassName(u.cartDrawerOpenClass)].some(e=>e.matches(c("cart-drawer")))||kn&&!mt().length}function iu(){let t=J();if(t===An)return;let e=mt();t?So(e.filter(xn)):Co(e,wo(e))}function Oe(){h(document,c("cart-open")).forEach(t=>{t.setAttribute("aria-expanded",String(J()))}),mt().forEach(t=>{t.hasAttribute("role")||t.setAttribute("role","dialog"),!t.hasAttribute("aria-label")&&!t.hasAttribute("aria-labelledby")&&t.setAttribute("aria-label",p(t,"cart-label")||"Cart");let e=xn(t);t.setAttribute("aria-modal",String(e)),t.setAttribute("aria-hidden",String(!e)),t.inert=!e}),!Tn&&(Tn=new MutationObserver(iu),Tn.observe(document.documentElement,{attributes:!0,attributeFilter:["class"],childList:!0,subtree:!0}))}function au(t){let e=Eo(t)[0]??t;e===t&&!t.hasAttribute("tabindex")&&(t.tabIndex=-1),e.focus({preventScroll:!0})}function So(t){An=!0,Oe();let[e]=t;u.cartFocus&&e&&(Le=ru(document.activeElement)?document.activeElement:null,setTimeout(()=>{au(e)},nu)),V("onCartOpen",()=>u.onCartOpen?.(t)),P("cart-toggled",{open:!0})}function Co(t,e){An=!1,kn=!1,Oe(),e&&Le?.isConnected&&Le.focus({preventScroll:!0}),Le=null,V("onCartClose",()=>u.onCartClose?.(t)),P("cart-toggled",{open:!1})}function Ie(){if(J())return;let t=mt(),e=t.filter(n=>!ou(n));t.length&&!e.length||(kn=!t.length,e.forEach(n=>{n.classList.add(u.cartDrawerOpenClass)}),So(e))}function vn(){if(!J())return;let t=mt(),e=wo(t);t.forEach(n=>{n.classList.remove(u.cartDrawerOpenClass)}),Co(t,e)}function To(){J()?vn():Ie()}function Ln(t){if(t.key!=="Tab"||!u.cartFocus||!J())return;let e=mt().find(xn);if(!e)return;let n=Eo(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 su=1e4,uu=6e4,q=new Map,On=new Map,Tt=new Set,Me=new Map,xo=[],In=!1,oe=0,ko=t=>t.startsWith("gid://"),kt=Pr;function Ut(t){if(!t)return;let e=Promise.resolve(t);q.set(t.handle,e),q.set(t.id,e)}function nt(t){let e=kt(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)=>{On.set(e,{resolve:o,reject:i}),xo.push(e),In||(In=!0,setTimeout(()=>void pu(),0))});return q.set(e,r),r}var Mn=t=>e=>`${t}${co(u,e)}`;function cu(t){let e=t.filter(ko),n=t.filter(s=>!ko(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:Mn(`query TetherProducts(${r.join(",")}){${o.join(" ")}}`),variables:i,handles:n}}function Ao(t,e){let n=On.get(t);On.delete(t),n&&e(n)}function lu(t,e){if(e!==oe)return;let n=q.get(t);setTimeout(()=>{q.get(t)===n&&q.delete(t)},su)}function du(t){if(!T(t))return!1;let{byId:e=[],...n}=t;return K(e,[F(Po)])&&Object.values(n).every(F(_t))}async function pu(){In=!1;let t=oe,e=xo.splice(0);if(!e.length)return;let{query:n,variables:r,handles:o}=cu(e);L("fetch products",e);let i;try{i=await st(n,r,du)}catch(l){e.forEach(d=>{Ao(d,g=>{t===oe&&q.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=>{Ao(l,d=>{let g=a.get(l);if(!g){lu(l,t),d.reject(new b(`Product not found: ${l}`,{code:"NOT_FOUND"}));return}t===oe&&(Ut(g),Me.set(g.handle,s),Me.set(g.id,s)),d.resolve(g)})})}function Re(){q.clear(),oe+=1,Tt.clear(),Me.clear()}function vo(t){for(let e of t??[])!e.id||!e.handle||Date.now()-(Me.get(e.handle)??0)<uu&&q.has(e.handle)||(Ut(e),Tt.add(e.handle),Tt.add(e.id))}function Lo(t){let e=kt(t);return!e||!Tt.has(e)?!1:(Tt.delete(e),q.get(e)?.then(n=>{Tt.delete(n.handle),Tt.delete(n.id)},fu),!0)}function fu(){}function Oo(t){let e=kt(t);return e&&q.delete(e),nt(t)}var mu=/^image:(\d+)$/,Io="metafield:",gu=/^(rich_text|multi_line_text)_field$/,hu=["","true","all","*"],ie=t=>t.tagName==="SELECT",At=(t,e)=>t.$(`select${e}`).filter(ie);function yu(t,e){let n=e.images.nodes,r=[...t.children].map(i=>i.tagName==="IMG"?i:i.querySelector("img"));!Xt(t)&&r.length===n.length&&r.every((i,a)=>be(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 bu(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){w(t,"");return}let s=a.reference?.image;if(s){D(t,s.url,s.altText);return}gu.test(a.type)&&(t.style.whiteSpace="pre-line"),w(t,a.value)}var Pu=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=>Se(t.publishedAt),"min-price":t=>O(t.priceRange.minVariantPrice),"max-price":t=>O(t.priceRange.maxVariantPrice)}));function Eu(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)=>{w(o,i)})}function wu(t,e,n){let r=Pu.get(e);if(r){w(t,r(n));return}switch(e){case"description":Ce(t,n.descriptionHtml);break;case"featured-image":D(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":yu(t,n);break;case"tags":Eu(t,n);break;default:Su(t,e,n)}}function Su(t,e,n){let r=mu.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(Io)&&bu(t,n,e.slice(Io.length))}function Cu(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&&ut(n,"hide-single")){H(n,!1);return}Y(n,o.optionValues,(i,a)=>{i.setAttribute(f("option-value"),a.name);let s=h(i,c("bind","option-value"))[0];s?w(s,a.name):i.firstElementChild||w(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 Tu(t){let{product:e}=t;At(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)))}),At(t,c("variant-select")).forEach(n=>{n.replaceChildren(...e.variants.nodes.map(r=>new Option(r.title,r.id)))}),At(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(f("one-time-label"))||"One-time purchase";n.replaceChildren(...o?[new Option(i,"")]:[],...r)})}function ku(t){t.$(c("plan-list")).forEach(e=>{let n=(p(e,"plan-list")??"").trim(),r=hu.includes(n.toLowerCase())?null:n,o=t.plans.filter(i=>!r||i.group.name===r);Y(e,o,(i,a)=>{i.setAttribute(f("plan-value"),a.id),!i.firstElementChild&&!i.querySelector(c("plan-bind"))&&w(i,a.name)})})}function Mo(t){t.$(c("bind")).forEach(e=>{wu(e,p(e,"bind")??"",t.product)}),Cu(t),Tu(t),ku(t)}var Ro="Default Title",Rn=(t,e)=>e.get(t.id)?.quantity??t.quantity,No=t=>t.split("/").pop()??t;function Au(t){let e=t.merchandise,n=Rt(e.product.handle,e.product.id);if(!n)return null;let r=new URLSearchParams;r.set("variant",No(e.id));let o=t.sellingPlanAllocation?.sellingPlan.id;return o&&r.set("selling_plan",No(o)),`${n}${n.includes("?")?"&":"?"}${r.toString()}`}var $o=t=>t.merchandise.product.title,_o={title:$o,"product-title":$o,"variant-title":t=>t.merchandise.title===Ro?"":t.merchandise.title,options:t=>t.merchandise.selectedOptions.filter(e=>e.value!==Ro).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)=>Rn(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(", ")},Uo="attribute:";function xu(t,e,n){if(Object.hasOwn(_o,e))return _o[e]?.(t,n);if(!e.startsWith(Uo))return;let r=e.slice(Uo.length);return t.attributes.find(o=>o.key===r)?.value??""}function vu(t,e,n){let r=R(n),o=!n.requiresSellingPlan&&p(t,"line-plan")!=="subscription-only",i={value:"",label:t.getAttribute(f("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 Lu(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=>{dt(s,o?.message??"")});let a=new Map([["subscription",r],["one-time",!r],["on-sale",go(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 Ou(t,e,n){let r=e.merchandise;t.setAttribute(f("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=Au(e);l&&i.setAttribute("href",l);return}let s=xu(e,a,n);s!==void 0&&dt(i,s)}),Lu(t,e,n),h(t,c("line-plan")).filter(ie).forEach(i=>{nt(r.product.handle).then(a=>{vu(i,e,a)}).catch(a=>{m(a,"line plan options")})})}function Iu(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 Mu(t){h(document,`textarea${c("cart-note")},input${c("cart-note")}`).forEach(e=>{document.activeElement!==e&&w(e,t?.note??"")}),h(document,c("cart-discounts")).forEach(e=>{Y(e,t?.discountCodes??[],(n,r)=>{n.setAttribute(f("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 Fo(t){let{cart:e}=t,n=r=>e?O(e.cost[r]):"";Oe(),h(document,c("cart-count")).forEach(r=>{dt(r,e?.totalQuantity??0)}),h(document,c("cart-subtotal")).forEach(r=>{dt(r,n("subtotalAmount"))}),h(document,c("cart-total")).forEach(r=>{dt(r,n("totalAmount"))}),h(document,c("cart-checkout-charge")).forEach(r=>{dt(r,n("checkoutChargeAmount"))}),Iu(e,t),h(document,c("cart-warning")).forEach(r=>{dt(r,[...new Set(t.warnings.map(o=>o.message))].join(" "))}),Mu(e),h(document,c("cart-lines")).forEach(r=>{gn(r,e?.lines.nodes??[],o=>o.id,(o,i)=>{Ou(o,i,t)},{onEnter:u.onLineEnter,onLeave:u.onLineLeave})}),e&&pt("cart")}function Do(t){h(document,c("cart-count")).forEach(e=>{/^\s*0?\s*$/.test(e.textContent)&&(e.textContent=String(t))})}function xt(t,e="localStorage"){try{return window[e].getItem(t)}catch{return null}}function Ne(t,e,n="localStorage"){try{window[n].setItem(t,e)}catch{}}function ae(t,e="localStorage"){try{window[e].removeItem(t)}catch{}}var Ho=/^gid:\/\/shopify\/Cart\/[\w-]+(\?key=[\w-]+)?$/;var Vo=()=>{};function qo(){let t=Promise.resolve();return e=>{let n=t.then(e);return t=n.then(Vo,Vo),n}}var j={kind:"unknown"},Ft=[],vt=new Map,$e=()=>j;function x(){switch(j.kind){case"ready":case"error":return j.cart;case"unknown":case"empty":return null}}var jo=()=>Ft,$n=t=>t?{kind:"ready",cart:t}:{kind:"empty"},Go=()=>`${u.storageKey}:seen`;function gt(){let t=xt(u.storageKey);return t?Ho.test(t)?t:(ht(),null):null}function ht(){ae(u.storageKey)}function _n(t){j=$n(t),t&&Ne(u.storageKey,t.id)}function se(){Fo({cart:x(),warnings:Ft,pending:vt,failed:j.kind==="error"})}function ue(t){se(),P("cart-updated",{cart:x(),reason:t})}function B(t,e){return _n(t),Ne(Go(),`${Date.now()}|${t?.totalQuantity??0}`),ue(e),t}function ce(t){j=t.kind==="loaded"?$n(t.cart):{kind:"error",error:t.error,cart:null},ue("load")}function Ru(){let t=xt(Go())?.split("|")[1]??"",e=Number(t);return/^\d+$/.test(t)&&Number.isSafeInteger(e)?e:null}function Ko(){if(j.kind!=="unknown")return;let t=Ru();t!==null&&Do(t)}function Qo(t){let e=n=>V("warningText",()=>u.warningText?.(n),()=>null);Ft=t.filter((n,r)=>t.findIndex(o=>o.message===n.message)===r).map(n=>({...n,message:e(n)||n.message})),Ft.length&&P("cart-warning",{warnings:Ft})}var le=qo(),Nn=0;function Un(t){return Nn++,t().finally(()=>{Nn--})}var Wo=()=>Nn>0;function Bo(t){return le(t).then(e=>(j.kind==="error"&&(j=$n(j.cart),se()),e),e=>{throw j={kind:"error",error:e,cart:x()},se(),P("cart-error",{error:e}),e})}var Fn=t=>Rn(t,vt),Nu=()=>({open:J(),count:x()?.totalQuantity??0,loaded:j.kind!=="unknown",warnings:[...Ft]});function zo(t){let e=["cart-updated","cart-toggled"].map(r=>`${u.prefix}:${r}`),n=()=>{t(x(),Nu())};return e.forEach(r=>{document.addEventListener(r,n)}),n(),()=>{e.forEach(r=>{document.removeEventListener(r,n)})}}var $u=/does not exist|not found|invalid id/i,_u=t=>z({[t]:F({cart:F(Cn)})});function _e(t){return t instanceof b?t.userErrors?.some(e=>e.field?.[0]==="cartId")?!0:(t.errors??[]).some(e=>$u.test(e.message)):!1}function Jo(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 Xo(t,e=1,n={}){let r=typeof t=="object"&&t!==null?t:{...n,quantity:e,...t==null?{}:{variantId:t}},o=W.variant(r.merchandiseId||r.variantId||r.id);if(!o)throw new b("add(): variantId is required");let i=parseInt(String(r.quantity??1),10),a={merchandiseId:o,quantity:Math.max(1,i||1)},s=W.sellingPlan(r.sellingPlanId||r.sellingPlan);s&&(a.sellingPlanId=s);let l=ee(r.attributes);return l.length&&(a.attributes=l),a}function Uu(t,e,n){return r=>`mutation Tether_${t}(${e}){${t}(${n}){cart{...TetherCart}userErrors{field message}warnings{code message target}}}${Pn(r)}`}async function Zo(t,e,n,r){let o=await st(Uu(t,e,n),r,_u(t),{operation:"mutation"}),i=Dr(o[t],t);return Qo(i.warnings??[]),i.cart}function Yo(t){let e=u.country?{buyerIdentity:{countryCode:u.country},...t}:t;return Zo("cartCreate","$input: CartInput!","input: $input",{input:e})}async function yt({name:t,variable:e,type:n,value:r,create:o}){let i=o?{[e]:r}:null,a=gt();if(!a)return i?Yo(i):null;try{return await Zo(t,`$cartId: ID!, $${e}: ${n}`,`cartId: $cartId, ${e}: $${e}`,{[e]:r,cartId:a})}catch(s){if(!_e(s)||(ht(),!i))throw s;return L("cart expired, creating a new one"),Yo(i)}}async function Dn(t){return(await st(n=>`query TetherCart($id:ID!){cart(id:$id){...TetherCart}}${Pn(n)}`,{id:t},z({cart:F(Cn)}))).cart}async function ti(t){return(await st("query TetherCheckout($id:ID!){cart(id:$id){checkoutUrl}}",{id:t},z({cart:F({checkoutUrl:"string"})}))).cart?.checkoutUrl??null}function ei(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?W.sellingPlan(n.sellingPlanId):null),n.attributes&&(r.attributes=ee(n.attributes));let o=n.merchandiseId||n.variantId;return o&&(r.merchandiseId=W.variant(o)),r}var Hn=t=>yt({name:"cartLinesUpdate",variable:"lines",type:"[CartLineUpdateInput!]!",value:t,create:!1}),Ue=t=>yt({name:"cartLinesRemove",variable:"lineIds",type:"[ID!]!",value:t,create:!1}),ni=(t,e)=>e>0?Hn([{id:t,quantity:e}]):Ue([t]);var Vn=null;function oi(t){Vn=t}var Fu=t=>ti(t).then(e=>({kind:"url",url:e}),e=>({kind:"failed",error:e}));async function Du(){if(!Vn)return null;try{let t=await Vn();return t&&`${t}${t.includes("?")?"&":"?"}logged_in=true`}catch(t){return m(t,"account checkout"),null}}async function Hu(t){let e=Fu(t),n=await Du();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 Vu(t){try{t.opener=null}catch{}}function ri(){let t=x();return t&&!t.totalQuantity?null:gt()}async function ii(t=u.checkoutTarget){if(!ri()&&!Wo())return null;let e=t==="_blank"?window.open("","_blank"):null;e&&Vu(e);try{await le(()=>Promise.resolve());let n=ri(),r=n&&await Hu(n);if(!r)return e?.close(),null;if(!he(r))throw new b("The checkout URL is not https: not opened");return P("checkout",{url:r,cart:x()}),e&&!e.closed?e.location.href=r:window.location.href=r,r}catch(n){return e?.close(),m(n,"checkout failed"),null}}var De=()=>x()?.lines.nodes??[];async function qu(){let t=gt();if(t)try{let e=await Dn(t);e||ht(),B(e,"load")}catch(e){m(e,"cart reload after a failed change")}}var Fe=null;function rt(t){return Fe=null,Bo(()=>t().catch(async e=>{throw Jo(e)&&await qu(),e}))}function ju(t,e){let n=De().find(s=>s.id===t);if(!n)return Promise.resolve(x());let r=Math.max(0,Fn(n)+e),o={quantity:r};vt.set(t,o),ue("pending");let i=()=>vt.get(t)===o;return rt(async()=>{if(!i())return x();if(De().find(d=>d.id===t)?.quantity===r)return x();let l=await ni(t,r);return i()?B(l,r>0?"update":"remove"):(_n(l),l)}).finally(()=>{i()&&(vt.delete(t),ue("settled"))})}function Gu(t){let e=(x()?.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 Ku(t){let e=new Map((x()?.attributes??[]).map(n=>[n.key,n.value]));return ee(t).forEach(n=>e.set(n.key,n.value)),[...e].filter(([,n])=>n!=="").map(([n,r])=>({key:n,value:r}))}async function Qu(){let t=gt();if(!t)return ce({kind:"loaded",cart:null}),null;Ko();try{let e=await Dn(t);e||ht(),ce({kind:"loaded",cart:e})}catch(e){m(e,"cart load failed"),_e(e)&&ht(),ce({kind:"failed",error:e})}return x()}function Wu(){return Fe??(Fe=Un(()=>le(()=>(Fe=null,Qu())))),Fe}var y={init:Wu,id:gt,get status(){return $e()},get state(){return x()},get lines(){return[...De()]},get count(){return x()?.totalQuantity??0},get loaded(){return $e().kind!=="unknown"},get lastError(){let t=$e();return t.kind!=="error"?null:t.error instanceof Error?t.error:new Error(String(t.error))},get warnings(){return[...jo()]},get pendingQty(){return vt},setCheckoutResolver:oi,forgetSaved(){ht(),ce({kind:"loaded",cart:null})},render:se,subscribe:zo,add(t,e=1,n={}){let r=(Array.isArray(t)?t:[t]).map(o=>Xo(o,e,n));return Un(()=>rt(async()=>{let o=await yt({name:"cartLinesAdd",variable:"lines",type:"[CartLineInput!]!",value:r,create:!0});if(!o)throw new b("Shopify answered the add without a cart");return B(o,"add"),P("added",{cart:o,lines:r}),u.openCartOnAdd&&Ie(),o}))},updateLine(t,e){let n=typeof e=="number"?e:e.quantity;if(n!==void 0&&n<=0)return y.removeLine(t);let r=ei(t,e);return rt(async()=>B(await Hn([r]),"update"))},changeQuantity:ju,quantityOf:Fn,removeLine(t){let e=Array.isArray(t)?t:[t];return rt(async()=>B(await Ue(e),"remove"))},clear(){return rt(async()=>{let t=De().map(e=>e.id);return t.length?B(await Ue(t),"remove"):x()})},setNote(t){return rt(async()=>B(await yt({name:"cartNoteUpdate",variable:"note",type:"String!",value:t??"",create:!0}),"note"))},setAttributes(t){return rt(async()=>{let e=await yt({name:"cartAttributesUpdate",variable:"attributes",type:"[AttributeInput!]!",value:Ku(t),create:!0});return B(e,"attributes")})},setDiscountCodes(t){return rt(async()=>{let e=await yt({name:"cartDiscountCodesUpdate",variable:"discountCodes",type:"[String!]!",value:Gu(t),create:!0});return B(e,"discount")})},async applyDiscount(t){let e=t.trim();if(!e)throw new b("No discount code",{code:"INVALID_DISCOUNT"});let n=await y.setDiscountCodes(i=>[...new Set([...i,e])]),r=e.toLowerCase();if((n?.discountCodes??[]).find(i=>i.code.toLowerCase()===r)?.applicable)return n;try{await y.removeDiscount(e)}catch(i){m(i,"removing a discount code Shopify refused")}throw new b(`Discount code not valid: ${e}`,{code:"INVALID_DISCOUNT"})},removeDiscount(t){let e=t.trim().toLowerCase();return y.setDiscountCodes(n=>n.filter(r=>r.toLowerCase()!==e))},setBuyerIdentity(t,{create:e=!0}={}){return rt(async()=>{let n=await yt({name:"cartBuyerIdentityUpdate",variable:"buyerIdentity",type:"CartBuyerIdentityInput!",value:t,create:e}).catch(r=>{if(e||!_e(r))throw r;return null});return B(n,"buyer-identity")})},checkout:ii,drawers:mt,isOpen:J,open:Ie,close:vn,toggle:To};var Bu=100,zu=(t,e)=>ne(Ct(t)*e,t.currencyCode),Ht=t=>Object.fromEntries(t.selectedOptions.map(e=>[e.name,e.value]));function Yu(t,e){return t.variants.nodes.find(n=>n.selectedOptions.every(r=>e[r.name]===r.value))??null}function ai(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 He(t,e){return t.kind==="subscription"&&N(e,t.planId)?t:{kind:"one-time"}}function Ve(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 si(t,{variant:e,sellingPlan:n,defaultPlan:r,defaultPurchase:o}){let i=t.variants.nodes,a=W.variant(e),s=i.find(v=>v.id===a)??i.find(v=>v.availableForSale)??i[0]??null,l=$t(t,n),d=l??$t(t,r),g=l||o==="subscription"?"subscription":"one-time";return{selected:s?Ht(s):{},purchase:Ve(t,s,g,d?.id??null)}}function Ju(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 ui(t,e,n){let r=Yu(t,e.selected),o=r??t.variants.nodes[0];if(!o)return null;let i=Ve(t,o,e.purchase.kind,Dt(e.purchase)),a=Dt(i),s=R(t),l=He(i,o),d=l.kind==="subscription"?N(o,l.planId):null,g=d?Nt(o,a)??o.price:o.price,v=d?.priceAdjustments[0]?.compareAtPrice??o.compareAtPrice,A={line:l,subscriptionAvailable:s.some($=>N(o,$.id)),compareAtPrice:v&&parseFloat(v.amount)>parseFloat(g.amount)?v:null,savings:re(o,a)};return{...A,variant:o,selected:r?e.selected:Ht(o),purchase:i,plan:s.find($=>$.id===a)??null,quantity:e.quantity,price:g,show:Ju(o,n,t.variants.nodes.length,A,t.requiresSellingPlan)}}function ci(t,e){let{variant:n,plan:r,price:o,compareAtPrice:i,quantity:a}=t,s=Dt(t.purchase),l=$=>zu($,Math.max(1,a)),A={price:()=>e.money(o),"total-price":()=>e.money(l(o)),"one-time-price":()=>e.money(n.price),"subscription-price":()=>e.money(s?Nt(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"?En(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))*Bu)}%`:"0%","discount-amount":()=>i?e.money(ne(Ct(i)-Ct(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(A))}function li(t,e,n,r){let i={name:()=>n?.name,option:()=>(n?.options??[]).map(a=>a.value).join(", "),description:()=>n?.description,price:()=>r.money(Nt(t,e)),savings:()=>r.percent(re(t,e).percentage),"savings-amount":()=>r.money(re(t,e).amount),adjustment:()=>{let a=wn(n);return a?a.type==="percentage"?`${a.value}%`:r.money(a.value):""}};return new Map(Object.entries(i))}function qn(t){try{return decodeURIComponent(t)}catch(e){if(e instanceof URIError)return t;throw e}}var di="url:";function Lt(t,e=window.location,n="product"){let r=(p(t,n)??"").trim();if(!r.toLowerCase().startsWith(di))return{key:r||null,fromUrl:!1,raw:r};let o=r.slice(di.length).trim(),i;if(o.toLowerCase()==="path"){let a=e.pathname.split("/").filter(Boolean),s=a[a.length-1];i=s===void 0?null:qn(s)}else i=new URLSearchParams(e.search).get(o||"handle");return{key:i?.trim()||null,fromUrl:!0,raw:r}}var qe=["loading","ready","error","not-found"],Xu=t=>qe.some(e=>e===t),pi=t=>typeof t=="object"&&t!==null&&"code"in t?t.code:void 0,je=t=>pi(t)==="NOT_FOUND",de=()=>["product","collection","products","recommendations"].map(t=>c(t)).join(","),fi=(t,e)=>t===e||t.parentElement?.closest(de())===e;function Zu(t){let e=pi(t);return typeof e=="string"&&e?e:"error"}function ot(t,e,n){let r=e==="not-found",o=e==="error"||r;t.setAttribute(f("state"),r?"error":e),o?t.setAttribute(f("error"),r?"not-found":Zu(n)):t.removeAttribute(f("error")),ct(t,c("show"),de()).forEach(i=>{let a=p(i,"show");Xu(a)&&H(i,a===e)}),o&&ct(t,c("add-to-cart"),de()).forEach(i=>{i.classList.add("is-disabled"),i.setAttribute("aria-disabled","true"),"disabled"in i&&(i.disabled=!0)})}var mi={money:O,percent:no},tc=t=>t.tagName==="INPUT";function jn(t){let e=h(t,c("add-label"))[0]??t,n=e.dataset.tetherLabel??(tc(e)?e.value:e.textContent);return e.dataset.tetherLabel=n,{label:e,original:n}}function ec(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"));h(o,c("option-value")).forEach(a=>{let s=p(a,"option-value")??"";Te(a,e.selected[i]===s);let l=!ai(n,e.selected,i,s);ke(a,l,"picks-closest"),a.setAttribute("data-unavailable",l?"true":"false")})}),At(t,c("option")).forEach(o=>{o.value=r(p(o,"option"))}),At(t,c("variant-select")).forEach(o=>{o.value=e.variant.id})}function nc(t,e){let{variant:n,purchase:r,line:o}=e;t.$(c("purchase")).forEach(i=>{if(ie(i)){i.value=r.kind;return}let a=p(i,"purchase");Te(i,a===r.kind),ke(i,a==="subscription"?!e.subscriptionAvailable:t.product.requiresSellingPlan,"does-nothing")}),t.$(c("plan-value")).forEach(i=>{let a=p(i,"plan-value")??"";Te(i,o.kind==="subscription"&&a===o.planId),ke(i,!N(n,a),"does-nothing");let s=t.plans.find(d=>d.id===a),l=li(n,a,s,mi);h(i,c("plan-bind")).forEach(d=>{let g=l.get(p(d,"plan-bind")??"");g&&w(d,g())})}),At(t,c("plan")).forEach(i=>{i.value=o.kind==="subscription"?o.planId:""})}function rc(t,e){let n=new Map(Object.entries(e.show));qe.forEach(r=>n.set(r,r==="ready")),t.$(c("show")).forEach(r=>{let o=p(r,"show")??"",i=n.get(o);i!==void 0&&(qe.some(a=>a===o)&&!fi(r,t.root)||H(r,i))})}function oc(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}=jn(r),l=s;e.line.kind==="subscription"&&i&&(l=i),n&&o&&(l=o),r.getAttribute("aria-busy")!=="true"&&w(a,l)})}function gi(t,e){let{variant:n}=e,{product:r}=t,o=ci(e,mi);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&&w(i,s())}),ec(t,e),nc(t,e),rc(t,e),t.root.classList.toggle("is-subscription",e.line.kind==="subscription"),t.root.setAttribute(f("purchase-mode"),e.line.kind),oc(t,e)}var yi=()=>c("product"),ic=t=>t.tagName==="INPUT"||t.tagName==="SELECT"||t.tagName==="TEXTAREA",hi=t=>t instanceof window.Element;function Vt(t,e,n){let r=e.closest(n);return r?.closest(yi())===t.root?r:null}function ac(t,e){let{label:n,original:r}=jn(e),o=p(e,"adding-text");Q(e,async()=>{o&&w(n,o);try{await t.addToCart()}catch(i){m(i,"add to cart failed"),P("error",{error:i,context:"add-to-cart"},t.root)}finally{o&&w(n,r)}}).then(()=>{t.renderVariant()}).catch(i=>{m(i,"add to cart render")})}function sc(t,e,n){let r=Vt(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=Vt(t,n,c("plan-value"));if(i){e.preventDefault(),t.selectPlan(p(i,"plan-value"));return}let a=Vt(t,n,`${c("purchase")}:not(select)`);if(a){a.tagName!=="INPUT"&&e.preventDefault(),t.setPurchase(bi(p(a,"purchase")));return}let s=Vt(t,n,c("qty-plus")),l=s?null:Vt(t,n,c("qty-minus"));if(s||l){e.preventDefault(),t.setQuantity(t.quantity+(s?1:-1));return}let d=Vt(t,n,c("add-to-cart"));d&&(e.preventDefault(),ac(t,d))}function uc(t,e){let{key:n}=t,r=n===" "||n==="Enter"&&!e.matches("a[href]"),o=`:is(${c("option-value")},${c("plan-value")},${c("purchase")})[role=button]:not(button,input)`;!r||t.defaultPrevented||!e.matches(o)||(t.preventDefault(),e.click())}var bi=t=>t==="subscription"?"subscription":"one-time";function cc(t,e){let n=ic(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(bi(n)):e.matches(c("qty"))&&t.setQuantity(n)}function Pi(t){t.root.addEventListener("click",e=>{hi(e.target)&&sc(t,e,e.target)}),t.root.addEventListener("keydown",e=>{e.target instanceof window.HTMLElement&&uc(e,e.target)}),t.root.addEventListener("change",e=>{let{target:n}=e;hi(n)&&n.closest(yi())===t.root&&cc(t,n)})}var it=new WeakMap,lc=()=>c("product"),Ge=new Map;function Gn(t){t.forEach(e=>{Ge.has(e.handle)||Ge.set(e.handle,e.options.map(n=>n.name))})}var Ei=t=>t.tagName==="INPUT",dc=t=>t.tagName==="INPUT"||t.tagName==="SELECT"||t.tagName==="TEXTAREA";function pc(t){return Ei(t)&&t.type==="checkbox"?t.checked?t.value&&t.value!=="on"?t.value:"Yes":null:Ei(t)&&t.type==="radio"?t.checked?t.value:null:dc(t)&&t.value||null}var Ke=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=si(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=ut(e,"quantity")?Math.max(0,parseInt(p(e,"quantity")??"",10)||0):1,it.set(e,this),e.setAttribute(f("state"),"ready"),e.removeAttribute(f("error")),this.renderProduct(),Pi(this),this.renderVariant(),io(e,"product"),pt("product"),P("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=Ht(r)),this.root.setAttribute(f("state"),"ready"),this.root.removeAttribute(f("error")),this.renderProduct(),this.renderVariant(),pt("product"),P("product-updated",{product:e,scope:this},this.root)}$(e){let n=ct(this.root,e,lc());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=(Ge.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=>N(this.variant,e.id))}get isSubscription(){return He(this.purchase,this.variant).kind==="subscription"}getLine(){if(!this.variant)return null;let e={merchandiseId:this.variant.id,quantity:this.quantity},n=He(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=xe(Ae(this.root,"line-attributes")),n=this.$(c("line-attribute")).flatMap(r=>{let o=pc(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,Ht(s))}this.selected=i,this.renderVariant()}selectVariant(e){let n=this.product.variants.nodes.find(r=>r.id===W.variant(e));n&&(this.selected=Ht(n),this.renderVariant())}setPurchase(e){let n=Ve(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=ut(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 y.add(e);return P("product-added",{product:this.product,variant:this.variant,line:e},this.root),n}renderProduct(){let{product:e}=this;Ge.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))&&Gn([e]),Mo(this)}renderVariant(){let e=ui(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,gi(this,e),P("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 fc='script[type="application/json"][data-tether-hydrate]',qt=new WeakSet,Kn=new WeakSet,Ot=new Set,bt=new Set,wi=new WeakMap;function jt(){Ot.forEach(t=>{t.isConnected||Ot.delete(t)}),bt.forEach(t=>{t.root.isConnected||bt.delete(t)})}function X(t,e){return[...t.matches?.(e)?[t]:[],...h(t,e)]}function mc(t,e){let n=p(t,"page-title");if(!n||typeof document>"u")return;let r=new Map([["title",e.title],["vendor",e.vendor||""],["type",e.productType||""]]);document.title=n.replace(/\{(\w+)\}/g,(o,i)=>r.get(i)??o)}function gc(t,{fromUrl:e,raw:n}){e?(qt.add(t),ot(t,"not-found"),P("product-not-found",{key:null,source:n},t)):t.closest(Gt())||C(`[${f("product")}] without a value. Bind it to the Shopify handle field, or use "url:handle".`,t)}function hc(t,e,{fromUrl:n,raw:r},o){let i=je(o);if(ot(t,i?"not-found":"error",o),!i){m(o,`product ${e}`),P("error",{error:o,context:"product",key:e},t);return}P("product-not-found",{key:e,source:r},t),n?L(`product not found: ${e}`):m(o,`product ${e}`)}function pe(t){if(qt.has(t))return!1;let{key:e,...n}=Lt(t);if(!e)return gc(t,n),!1;qt.add(t),Ot.add(t);let r={};wi.set(t,r);let o=()=>wi.get(t)===r;return it.get(t)?t.setAttribute(f("state"),"updating"):ot(t,"loading"),Qn(nt(e)).then(a=>{if(!o())return;let s=it.get(t);s?s.update(a):new Ke(t,a),mc(t,a),u.revalidate&&Lo(e)&&yc(e)}).catch(a=>{o()&&hc(t,e,n,a)}),!0}function Ci(){jt(),Ot.forEach(t=>{t.getAttribute(f("state"))!=="error"||t.getAttribute(f("error"))==="not-found"||(qt.delete(t),pe(t))})}var Qe=new Set;function yc(t){Qe.size||setTimeout(Pc,0),Qe.add(t)}function bc(t,e){Ot.forEach(n=>{let r=it.get(n);if(!r||!n.isConnected)return;let o=Lt(n).key;o!==t&&o!==e.handle&&o!==e.id||JSON.stringify(r.product)!==JSON.stringify(e)&&r.update(e)})}function Pc(){let t=[...Qe];Qe=new Set,t.forEach(e=>{Oo(e).then(n=>{bc(e,n)}).catch(n=>{m(n,`refresh ${e}`)})})}var at=null,Qn=t=>(at?.add(t),t);function We(){if(!at)return;let t=[...at];Promise.allSettled(t).then(()=>{if(!(!at||t.some(e=>!at?.has(e)))){if(t.length!==at.size){We();return}at=null,document.documentElement.classList.remove(`${u.prefix}-market-pending`)}})}function Ec(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(bo)}}var Si=new WeakSet;function Wn(t=document){X(t,fc).forEach(e=>{if(Si.has(e))return;Si.add(e);let n;try{n=JSON.parse(e.textContent)}catch(a){C("bad data-tether-hydrate",a);return}let{country:r,language:o,products:i}=Ec(n);if(Gn(i),r===u.country&&o===u.language){vo(i);return}L("hydration skipped: other market"),at||(at=new Set,document.documentElement.classList.add(`${u.prefix}-market-pending`))})}var wc=()=>`${u.prefix}:market:${u.domain}`,Sc={getItem:t=>xt(t)};function Cc(t){try{return JSON.parse(t)}catch(e){if(e instanceof SyntaxError)return null;throw e}}function Tc(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 kc=t=>Tc(Cc(t));function Bn(t=Sc){let e=t.getItem(wc());return e?kc(e):null}var ki={country:void 0,language:void 0,locale:void 0},zn=!1;function Ai(){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 Ac(){let t=u.markets??{};if(t.detect===!1)return null;if(!t.detect)return t.remember===!1?null:Bn();try{return(await k("markets")).detectMarket(t)}catch(e){return m(e,"markets"),null}}async function xi(t){ki={country:u.country,language:u.language,locale:u.locale};let e=Ai();if(zn=e!==null,e){u.country=e.country,u.language=e.language,e.locale&&(u.locale=e.locale);return}let n=await Ac();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 Ti=(t,e)=>(t??"").toUpperCase()===(e??"").toUpperCase();function vi(){let t=Ai(),e=t===null&&zn;zn=t!==null;let n=t??(e?Bn()??ki:null);return!n?.country||Ti(n.country,u.country)&&Ti(n.language,u.language)?null:{country:n.country,language:n.language,locale:n.locale}}function Kt(t,e){return k("markets").then(n=>n.setCountry(t,e))}var Li={"tether.diagnose.min.js":"sha384-NTaboAC3orz3nF1fX9PLgau1nipQuIBo6TQ7gwmIRUV+44+DGcAgUXOCH5zuLw4/","tether.markets.min.js":"sha384-DvUshOFHxWsN9u2iBSSOC8g5C/hAj0mWzd+Dhb48seCDZFzdRgqduAw6PPeYVaNf","tether.search.min.js":"sha384-aMFrDjTbk2EsLCiZXWnFvmH+O6PQQFr3tOuFmBtpZb5NzF78tgKpn2K/Wbtexc37","tether.lists.min.js":"sha384-QhV9dLgUp/tctUqz8RDdCJQ1sLLq50UG5+4reZkmxtoTOBPPbz2h2TOT7kjpY8wr","tether.extras.min.js":"sha384-DLw/z5KrjutfIZibKrrMSWZH3WRs1jVAB1hFz6QVhq7lCB/ICRqK1K/g7JtBuGVo","tether.account.min.js":"sha384-lWOAncnjcV8nxPQY3dlgZnAQHPpC8/AQkoDdFmcwHTea1kQyle3kefPBVaXXPzfy","tether.account-pages.min.js":"sha384-i/wZIkBZTdL0Nr5nVEc6y4fXrDDrIsweph6sDChClClnE+EnjJDgu4Zq+7riAJN5","tether.analytics.min.js":"sha384-O81h7sraAGtdmS986HkBmoGlC8O+aN0F4oozOm7tFGdgr+l9SlFgDWf+MKEW1gMz"};function Yn(t){return T(t)&&T(t.__core)&&T(t.__parts)}var fe="0.9.8";var Ii={get"config.ts"(){return[u,Mt,L,Wt,on,m,C]},get"client.ts"(){return[un,st,K,F,z,b,dn]},get"dom.ts"(){return[Jt,f,xe,Q,P,Se,O,p,ut,Xt,ao,lt,pt,Ae,Rt,h,Y,ct,c,D,Ce,w,H]},get"loader.ts"(){return[Re,nt,kt,Ut,Mn]},get"selling-plans.ts"(){return[R]},get"status.ts"(){return[de,je,Lt,ot]},get"cart.ts"(){return[y]},get"product.ts"(){return[it]},get"collection.ts"(){return[Gt]},get"mounting.ts"(){return[bt,Ot,qt,pe,jt,X]},get"market-codes.ts"(){return[_,U]},get"page-market.ts"(){return[Kt]},get"shopify-values.ts"(){return[he,250]},get"lazy.ts"(){return[k]}},xc=/\.min\.js(\?|$)/,Oi=typeof document>"u"?"":document.currentScript?.getAttribute("src")??"",Be=Oi?new URL(Oi,document.baseURI).href:"",vc=/^(https:\/\/cdn\.jsdelivr\.net\/(gh|npm)\/@?[^/@]+\/[^/@]+)(@(latest|\d+(\.\d+)?))?\//;function Lc(t){return t.replace(vc,(e,n,r)=>`${n}@${r==="gh"?"v":""}${fe}/`)}var ze=new Map;function Oc(){return u.partsUrl?new URL(u.partsUrl,document.baseURI).href:Be?Lc(Be.replace(/[^/]*$/,"")):null}function Ic(t,e){t.integrity=e,new URL(t.src).origin!==window.location.origin&&(t.crossOrigin="anonymous")}function Mc(t,e,n,r){return new Promise((o,i)=>{let a=`${e.replace(/\/?$/,"/")}${n}`,s=document.createElement("script");s.src=a,s.async=!0,Ic(s,r),s.onload=()=>{let l=Reflect.get(window,"Tether"),d=Yn(l)?l.__parts[t]:void 0;if(d){o(d);return}ze.delete(t);let g=Yn(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=()=>{ze.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 k(t){let e=ze.get(t);if(!e){let n=Oc();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=xc.test(Be)||!Be?".min":"",o=`tether.${t}${r}.js`,i=Li[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=Mc(t,n,o,i),ze.set(t,e)}return e}var Gt=()=>`${c("collection")},${c("products")},${c("recommendations")}`;function Mi(t){return ot(t,"loading"),{root:t,load:()=>k("lists").then(e=>e.loadList(t)).catch(e=>{ot(t,"error",e),m(e,"lists")})}}function Ri(t){let e=[],n=new window.AbortController,r={signal:n.signal};return Jt.forEach(o=>{document.addEventListener(`${u.prefix}:${o}`,i=>e.push(i),r)}),document.addEventListener("astro:page-load",o=>e.push(o),r),t().then(o=>o.startAnalytics(e)).catch(o=>{n.abort(),e.length=0,m(o,"analytics")}),e}var $i=()=>`${u.prefix}:account-hint:${u.domain}`;function Ni(t){ae(t,"sessionStorage"),ae(t,"localStorage")}function _i(){Ni(`${u.prefix}:account:${u.domain}`),Ni(`${u.prefix}:account-login:${u.domain}`)}var Ui=t=>t==="in"||t==="expired"||t==="error";function Pt(t,e){k(t).then(e).catch(n=>{m(n,t)})}var Rc=["account-login","account-bind","account-link","orders","order","addresses","subscriptions","profile-form","address-form"],Nc=()=>[...Rc.map(t=>`[${f(t)}]`),`[${f("show")}^="logged-"]`].join(",");function $c(){return!!xt($i())}function Fi(t){!u.account||!(X(t,Nc()).length>0||Ui(new URLSearchParams(window.location.search).get("account"))||$c())||Pt("account",n=>n.mountAccount(t))}function I(t){return(...e)=>k("account").then(n=>{let r=n[t];return r(...e)})}var Di={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 Hi=()=>`data-${u.prefix}-key`,Vi=t=>t instanceof window.Element;function qi(t){let e=t.closest(`[${Hi()}]`),n=e?.getAttribute(Hi());return e&&n?{line:e,id:n}:null}function Ye(t,e){t.catch(n=>{m(n,e)})}function _c(t,e){let n=qi(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"),Ye(y.removeLine(o),"cart line");return}let i=Uc(e);!i||!y.lines.some(a=>a.id===o)||(t.preventDefault(),Ye(y.changeQuantity(o,i),"cart line"))}function Uc(t){return t.closest(c("line-plus"))?1:t.closest(c("line-minus"))?-1:0}function Fc(t){let{target:e}=t;if(!Vi(e))return;if(e.closest(c("cart-open"))){t.preventDefault(),y.toggle();return}if(e.closest(c("cart-close"))){t.preventDefault(),y.close();return}let n=e.closest(c("cart-clear"));if(n){t.preventDefault(),Q(n,()=>y.clear().catch(o=>{m(o,"cart clear")}));return}let r=e.closest(c("checkout"));if(r){t.preventDefault(),Q(r,()=>y.checkout());return}_c(t,e)}function ji(t,e,n){t.classList.add("is-busy"),t.setAttribute("aria-busy","true"),Ye(e,n)}function Dc(t,{line:e,id:n}){let r=t.value.trim();if(bn.test(r)){ji(e,y.updateLine(n,Number(r)),"cart line");return}let o=y.lines.find(i=>i.id===n);o&&(t.value=String(y.quantityOf(o)))}function Hc(t){let{target:e}=t;if(!Vi(e))return;let n=qi(e);n&&e instanceof window.HTMLInputElement&&e.matches(c("line","quantity"))?Dc(e,n):n&&e instanceof window.HTMLSelectElement&&e.matches(c("line-plan"))?ji(n.line,y.updateLine(n.id,{sellingPlanId:e.value||null}),"cart line plan"):Vc(e)&&e.matches(c("cart-note"))&&Ye(y.setNote(e.value),"cart note")}var Vc=t=>t instanceof window.HTMLInputElement||t instanceof window.HTMLTextAreaElement||t instanceof window.HTMLSelectElement;function qc(t){if(y.isOpen()){if(t.key==="Escape"){y.close();return}Ln(t)}}function Gi(){document.addEventListener("click",Fc),document.addEventListener("change",Hc),document.addEventListener("keydown",qc)}var Jn=t=>t instanceof window.Element;function jc(t){let e=t.querySelector(c("discount-input"))??t.querySelector("input");return e instanceof window.HTMLInputElement?e:null}function Gc(t){let{target:e}=t,n=Jn(e)?e.closest(c("discount-form")):null;if(!n)return;t.preventDefault();let r=jc(n),o=r?.value.trim();o&&Q(n,()=>k("extras").then(i=>i.applyDiscountCode(n,r,o))).catch(i=>{m(i,"discount")})}function Kc(t){let{target:e}=t;if(!Jn(e))return;let n=e.closest(c("discount-form"));n&&(n.classList.remove("is-invalid"),e.removeAttribute("aria-invalid"))}function Qc(t){let{target:e}=t,n=Jn(e)?e.closest(c("discount-remove")):null;if(!n)return;t.preventDefault();let r=n.closest(c("discount-code"))?.getAttribute(f("discount-code"));r&&y.removeDiscount(r).catch(o=>{m(o,"discount")})}function Ki(){document.addEventListener("submit",Gc,!0),document.addEventListener("input",Kc),document.addEventListener("click",Qc)}var Xn=t=>k("extras").then(e=>e.addGroup(t));function Wc(t){let{target:e}=t,n=e instanceof window.Element?e.closest(c("group-add")):null;n&&(t.preventDefault(),Q(n,()=>Xn(n)).catch(r=>{m(r,"extras")}))}function Bc(t){!u.domain||!t.key?.startsWith(`${u.prefix}:`)||Pt("extras",e=>{e.onStorage(t)})}function zc(t){if(!lt(t,"variant-changed"))return;let{target:e}=t;e instanceof window.Element&&(!u.variantUrl&&!e.hasAttribute(f("variant-url"))||Pt("extras",n=>{n.writeVariantUrl(e,t.detail)}))}function Qi(){document.addEventListener("click",Wc),window.addEventListener("storage",Bc),document.addEventListener(`${u.prefix}:variant-changed`,zc)}var Zn=null;function Wi(){Zn=document.body}async function Yc(t){await t.ready();let e=vi();if(!e){Zn!==document.body&&t.mount(document);return}try{await Kt(e.country,{language:e.language??null,locale:e.locale,remember:!1})}catch(n){m(n,"country")}t.mount(document)}function Jc(t){document.addEventListener("astro:page-load",()=>{Yc(t).catch(e=>{m(e,"page mount")})}),document.addEventListener("astro:before-swap",()=>{Zn=null,t.unmount()})}function Xc(){Ci(),bt.forEach(t=>{t.root.getAttribute(f("state"))==="error"&&t.load()})}function Bi(t){u.astro&&Jc(t),window.addEventListener("online",Xc)}var Zc=50;function tl(){let t=te("TETHER_CONFIG");return typeof t=="object"&&t!==null?Object.fromEntries(Object.entries(t)):{}}var Et=null,tr=null,el=null,zi=!1;function nl(t){let e=0;return X(t,Gt()).forEach(n=>{if(Kn.has(n))return;Kn.add(n),e++;let r=Mi(n);bt.add(r),n.addEventListener(`${u.prefix}:list-rendered`,o=>{lt(o,"list-rendered")&&Je(o.detail.container)}),Qn(r.load())}),e}function rl(t){X(t,`${c("country-select")},${c("country-bind")}`).length&&Pt("markets",e=>e.renderCountrySelects(t)),Fi(t),X(t,c("search")).length&&Pt("search",e=>{e.mountSearch(t)})}function Yi(t){let e=nl(t);return X(t,c("product")).forEach(n=>{pe(n)&&e++}),rl(t),e}function Je(t=document){if(!Mt())return 0;t===document&&Wi(),jt(),Wn(t.ownerDocument??document);let e=Yi(t);return We(),y.render(),L(`mounted ${e} scope(s)`,t),e}function ol(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=>{Wn(r)});let n=e.reduce((r,o)=>r+Yi(o),0);We(),y.render(),L(`mounted ${n} scope(s) in ${e.length} added element(s)`)}function Ji(){y.close()}function il(t){let e=t?.closest(c("product"));return e?it.get(e)??null:null}function al(){zi||(zi=!0,Gi(),Ki(),Qi(),Bi({ready:()=>Et??Promise.resolve(null),mount:Je,unmount:Ji}))}async function sl(t){let e=u.country,n=t?.buyerIdentity.countryCode;if(!e||!n||n===e)return t;try{return await y.setBuyerIdentity({countryCode:e},{create:!1})}catch(r){return m(r,"cart country"),t}}function Xi(t={}){return Et&&!Object.keys(t).length?Et:(vr({...tl(),...t}),Mt()?(_i(),al(),u.observe&&ul(),u.analytics&&(el??(el=Ri(()=>k("analytics")))),Et=xi(t).then(()=>y.init()).then(sl).then(e=>(P("ready",{cart:e}),er)),Et):(C("TETHER_CONFIG is missing domain or token. Tether is idle."),Et=Promise.resolve(null),Et))}function ul(){if(tr||typeof MutationObserver>"u")return;let t,e=new Set;tr=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(),ol(r)},Zc)}),tr.observe(document.body,{childList:!0,subtree:!0})}var cl=t=>k("markets").then(e=>e.detectMarket(t??u.markets)),ll=t=>k("lists").then(e=>e.getProducts(t)),dl=(t,e)=>k("lists").then(n=>n.getRecommendations(t,e)),pl=()=>k("markets").then(t=>t.getLocalization()),fl=t=>k("diagnose").then(e=>e.diagnose({...t,version:fe}));function ml(t,e){let n=`${u.prefix}:${t}`,r=o=>{lt(o,t)&&e(o.detail,o)};return document.addEventListener(n,r),()=>{document.removeEventListener(n,r)}}var gl={VERSION:fe,init:Xi,mount:Je,unmount:Ji,get config(){return xr},get ready(){return Et??Promise.resolve(null)},query:Fr,withContext:_r,cart:y,getProduct:nt,getProducts:ll,getRecommendations:dl,getScope:il,addGroup:Xn,account:Di,primeProduct:Ut,normalizeProductKey:kt,clearProductCache:Re,formatMoney:O,imageUrl:ye,plans:Sn,TetherError:b,resolveProductKey:Lt,setCountry:Kt,detectMarket:cl,getLocalization:pl,diagnose:fl,on:ml},hl={__core:Ii,__parts:{}},er=Object.assign(gl,hl),Km=er;function yl(){Reflect.set(window,"Tether",er);let t=te("TETHER_CONFIG");if(!t||Z(t,"autoMount")===!1||te("TETHER_INTEGRATION"))return;let e=()=>{Xi().then(()=>Je(document)).catch(n=>{m(n,"init")})};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",e,{once:!0}):e()}typeof window<"u"&&typeof document<"u"&&yl();})();
2
2
  //# sourceMappingURL=tether.min.js.map