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