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