@occluze/tether 0.9.2 → 0.9.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/README.md +1 -1
  2. package/dist/esm/astro.js +2 -2
  3. package/dist/esm/chunks/account-2467DHLU.js +1 -0
  4. package/dist/esm/chunks/{account-pages-FIXSWJH7.js → account-pages-X7U3E7D7.js} +1 -1
  5. package/dist/esm/chunks/{analytics-MO2ZWBOD.js → analytics-TF7M4KI2.js} +1 -1
  6. package/dist/esm/chunks/{chunk-7CRTJV25.js → chunk-4QINHHE4.js} +1 -1
  7. package/dist/esm/chunks/chunk-5TS6IBBB.js +1 -0
  8. package/dist/esm/chunks/{chunk-BVO7KK2M.js → chunk-646NGAEM.js} +1 -1
  9. package/dist/esm/chunks/chunk-67MCLHFS.js +1 -0
  10. package/dist/esm/chunks/{chunk-FWMPL6PR.js → chunk-6FWNC7QH.js} +1 -1
  11. package/dist/esm/chunks/{chunk-IJAMRI33.js → chunk-AHYDU7Z6.js} +1 -1
  12. package/dist/esm/chunks/{chunk-SZRDO62E.js → chunk-B2X6ZOKA.js} +1 -1
  13. package/dist/esm/chunks/chunk-C2GKO34C.js +1 -0
  14. package/dist/esm/chunks/chunk-EYVBEFKK.js +1 -0
  15. package/dist/esm/chunks/{chunk-DM5LEAWM.js → chunk-F3OXGENC.js} +1 -1
  16. package/dist/esm/chunks/{chunk-OENVX4NY.js → chunk-HEK66LYK.js} +1 -1
  17. package/dist/esm/chunks/chunk-I7XE7GQR.js +1 -0
  18. package/dist/esm/chunks/chunk-KIZBET7N.js +1 -0
  19. package/dist/esm/chunks/chunk-UJYL5G7T.js +1 -0
  20. package/dist/esm/chunks/{chunk-CRKJ2VEX.js → chunk-UM37ZVSP.js} +1 -1
  21. package/dist/esm/chunks/chunk-YW3ZIFWB.js +1 -0
  22. package/dist/esm/chunks/{diagnose-XSZPWEG7.js → diagnose-AOSBLXOJ.js} +1 -1
  23. package/dist/esm/chunks/{extras-DZIOTZ3H.js → extras-THTXX76O.js} +1 -1
  24. package/dist/esm/chunks/lists-UJMD7BCQ.js +1 -0
  25. package/dist/esm/chunks/{markets-ui-DEEYV4KT.js → markets-ui-PTAY3FHU.js} +1 -1
  26. package/dist/esm/chunks/search-G2SRQXDG.js +1 -0
  27. package/dist/esm/index.js +1 -1
  28. package/dist/esm/server.js +2 -2
  29. package/dist/tether.account-pages.js +3 -3
  30. package/dist/tether.account-pages.min.js +1 -1
  31. package/dist/tether.account.js +20 -20
  32. package/dist/tether.account.min.js +1 -1
  33. package/dist/tether.analytics.js +2 -2
  34. package/dist/tether.analytics.min.js +1 -1
  35. package/dist/tether.diagnose.js +2 -2
  36. package/dist/tether.diagnose.min.js +1 -1
  37. package/dist/tether.extras.js +1 -1
  38. package/dist/tether.extras.min.js +1 -1
  39. package/dist/tether.js +248 -129
  40. package/dist/tether.lists.js +12 -8
  41. package/dist/tether.lists.min.js +1 -1
  42. package/dist/tether.markets.js +2 -2
  43. package/dist/tether.markets.min.js +1 -1
  44. package/dist/tether.min.js +1 -1
  45. package/dist/tether.min.js.map +4 -4
  46. package/dist/tether.search.js +60 -23
  47. package/dist/tether.search.min.js +1 -1
  48. package/dist/types/server/src/shared/metafield-ref.d.ts +15 -0
  49. package/dist/types/src/account/server-client.d.ts +2 -1
  50. package/dist/types/src/analytics-queue.d.ts +9 -0
  51. package/dist/types/src/cart/checkout.d.ts +2 -2
  52. package/dist/types/src/cart/drawer.d.ts +9 -4
  53. package/dist/types/src/cart/store.d.ts +2 -0
  54. package/dist/types/src/cart.d.ts +1 -1
  55. package/dist/types/src/client.d.ts +6 -0
  56. package/dist/types/src/dom.d.ts +25 -1
  57. package/dist/types/src/index.d.ts +1 -1
  58. package/dist/types/src/search.d.ts +1 -1
  59. package/dist/types/src/shopify-values.d.ts +2 -0
  60. package/dist/types/src/version.d.ts +1 -1
  61. package/package.json +1 -1
  62. package/dist/esm/chunks/account-XBGNTM7V.js +0 -1
  63. package/dist/esm/chunks/chunk-2J3MTS3E.js +0 -1
  64. package/dist/esm/chunks/chunk-4FR3CUO2.js +0 -1
  65. package/dist/esm/chunks/chunk-7ZXEVDOS.js +0 -1
  66. package/dist/esm/chunks/chunk-FI4NIWAD.js +0 -1
  67. package/dist/esm/chunks/chunk-H6IORH7O.js +0 -1
  68. package/dist/esm/chunks/chunk-OATTAXPO.js +0 -1
  69. package/dist/esm/chunks/chunk-OJAV2I3C.js +0 -1
  70. package/dist/esm/chunks/chunk-Y3NKKN2O.js +0 -1
  71. package/dist/esm/chunks/lists-OJGSVQMM.js +0 -1
  72. package/dist/esm/chunks/search-A6HF5PMJ.js +0 -1
@@ -1 +1 @@
1
- import{a as E,c as P,d as k,e as T,f as p,g as A}from"./chunk-Y3NKKN2O.js";import{a as I}from"./chunk-4FR3CUO2.js";import{d as F,e as x}from"./chunk-OENVX4NY.js";import"./chunk-FI4NIWAD.js";import{h as u}from"./chunk-7ZXEVDOS.js";import"./chunk-DM5LEAWM.js";import"./chunk-BVO7KK2M.js";import"./chunk-2J3MTS3E.js";import"./chunk-CRKJ2VEX.js";import{e as w}from"./chunk-H6IORH7O.js";import"./chunk-FWMPL6PR.js";import{a as L,d as h,h as b,l as s,m as C,n as v,t as z}from"./chunk-OATTAXPO.js";import{o as f,p as g,r as a,z as y}from"./chunk-OJAV2I3C.js";var _="{name} ({currency})",j="name",d=null;function B(){d=null}var D="query TetherLocalization{localization{country{isoCode name currency{isoCode symbol}}language{isoCode name}availableCountries{isoCode name currency{isoCode symbol}availableLanguages{isoCode name}}}}",O={isoCode:"string",name:"string",currency:"object"},H=h({localization:{country:O,availableCountries:[O]}});function R(){return d??(d=b(D,{},H).then(e=>e.localization,e=>{throw d=null,e})),d}function U(e,n){switch(n){case"name":return e.name;case"code":return e.isoCode;case"currency":return e.currency.isoCode;case"symbol":return e.currency.symbol;default:return""}}var Y=(e,n)=>e.replace(/\{(name|code|currency|symbol)\}/g,(o,i)=>U(n,i));function q(e,n,o){let i=e.getAttribute(s("country-label"))||_,r=(e.getAttribute(s("countries"))||"").toUpperCase().split(/[\s,]+/).filter(Boolean),c=r.length?r.map(t=>n.find(l=>l.isoCode===t)).filter(t=>t!==void 0):n;e.replaceChildren(...c.map(t=>new Option(Y(i,t),t.isoCode))),e.value=o,e.value!==o&&(e.selectedIndex=-1),e.disabled=c.length<2&&!e.hasAttribute(s("always-enabled"))}function $(e,n,o){let i=(a.country||o.country.isoCode).toUpperCase(),r=[...o.availableCountries].sort((t,l)=>t.name.localeCompare(l.name,a.locale||void 0)),c=r.find(t=>t.isoCode===i)??o.country;e.forEach(t=>{q(t,r,i)}),n.forEach(t=>{t.textContent=U(c,v(t,"country-bind")||j)})}function S(e=document){let n=p(e,`select${C("country-select")}`),o=p(e,C("country-bind"));return!n.length&&!o.length?Promise.resolve():R().then(i=>{$(n,o,i)}).catch(i=>{y(i,"country select")})}var Q=e=>Object.values(a.markets?.locales??{}).find(n=>f(n.country)===e);function V(e,n){return e!==void 0?g(e):n?n.language?g(n.language):void 0:a.language}function Z(e){w();let n=[];return u.id()&&n.push(u.setBuyerIdentity({countryCode:e},{create:!1}).catch(o=>{y(o,"cart country")})),T(),k.forEach(o=>n.push(o.load())),P.forEach(o=>{o.closest(I())||(E.delete(o),A(o))}),n}async function re(e,{language:n,locale:o,remember:i=!0}={}){let r=f(e);if(!r)throw new L(`Not a country code: ${e}`,{code:"INVALID_COUNTRY"});let c=Q(r),t=o||c?.locale,l=t||a.locale,m=V(n,c),M=r!==a.country||m!==a.language||l!==a.locale;if(a.country=r,a.language=m||void 0,a.locale=l,i&&x({country:r,language:m,locale:t}),!M)return S(),u.state;n!==void 0&&B();let N=Z(r);return S(),z("country-changed",{country:r,language:a.language}),await Promise.all(N),u.state}export{F as detectMarket,R as getLocalization,S as renderCountrySelects,re as setCountry};
1
+ import{a as E,c as P,d as k,e as T,f as p,g as A}from"./chunk-EYVBEFKK.js";import{a as I}from"./chunk-C2GKO34C.js";import{d as F,e as x}from"./chunk-HEK66LYK.js";import"./chunk-5TS6IBBB.js";import{h as u}from"./chunk-KIZBET7N.js";import"./chunk-F3OXGENC.js";import"./chunk-646NGAEM.js";import"./chunk-UJYL5G7T.js";import"./chunk-UM37ZVSP.js";import{e as w}from"./chunk-I7XE7GQR.js";import"./chunk-6FWNC7QH.js";import{a as L,d as h,i as b,m as s,n as C,o as v,u as z}from"./chunk-67MCLHFS.js";import{F as y,o as f,p as g,x as a}from"./chunk-YW3ZIFWB.js";var _="{name} ({currency})",j="name",d=null;function B(){d=null}var D="query TetherLocalization{localization{country{isoCode name currency{isoCode symbol}}language{isoCode name}availableCountries{isoCode name currency{isoCode symbol}availableLanguages{isoCode name}}}}",O={isoCode:"string",name:"string",currency:"object"},H=h({localization:{country:O,availableCountries:[O]}});function R(){return d??(d=b(D,{},H).then(e=>e.localization,e=>{throw d=null,e})),d}function U(e,n){switch(n){case"name":return e.name;case"code":return e.isoCode;case"currency":return e.currency.isoCode;case"symbol":return e.currency.symbol;default:return""}}var Y=(e,n)=>e.replace(/\{(name|code|currency|symbol)\}/g,(o,i)=>U(n,i));function q(e,n,o){let i=e.getAttribute(s("country-label"))||_,r=(e.getAttribute(s("countries"))||"").toUpperCase().split(/[\s,]+/).filter(Boolean),c=r.length?r.map(t=>n.find(l=>l.isoCode===t)).filter(t=>t!==void 0):n;e.replaceChildren(...c.map(t=>new Option(Y(i,t),t.isoCode))),e.value=o,e.value!==o&&(e.selectedIndex=-1),e.disabled=c.length<2&&!e.hasAttribute(s("always-enabled"))}function $(e,n,o){let i=(a.country||o.country.isoCode).toUpperCase(),r=[...o.availableCountries].sort((t,l)=>t.name.localeCompare(l.name,a.locale||void 0)),c=r.find(t=>t.isoCode===i)??o.country;e.forEach(t=>{q(t,r,i)}),n.forEach(t=>{t.textContent=U(c,v(t,"country-bind")||j)})}function S(e=document){let n=p(e,`select${C("country-select")}`),o=p(e,C("country-bind"));return!n.length&&!o.length?Promise.resolve():R().then(i=>{$(n,o,i)}).catch(i=>{y(i,"country select")})}var Q=e=>Object.values(a.markets?.locales??{}).find(n=>f(n.country)===e);function V(e,n){return e!==void 0?g(e):n?n.language?g(n.language):void 0:a.language}function Z(e){w();let n=[];return u.id()&&n.push(u.setBuyerIdentity({countryCode:e},{create:!1}).catch(o=>{y(o,"cart country")})),T(),k.forEach(o=>n.push(o.load())),P.forEach(o=>{o.closest(I())||(E.delete(o),A(o))}),n}async function re(e,{language:n,locale:o,remember:i=!0}={}){let r=f(e);if(!r)throw new L(`Not a country code: ${e}`,{code:"INVALID_COUNTRY"});let c=Q(r),t=o||c?.locale,l=t||a.locale,m=V(n,c),M=r!==a.country||m!==a.language||l!==a.locale;if(a.country=r,a.language=m||void 0,a.locale=l,i&&x({country:r,language:m,locale:t}),!M)return S(),u.state;n!==void 0&&B();let N=Z(r);return S(),z("country-changed",{country:r,language:a.language}),await Promise.all(N),u.state}export{F as detectMarket,R as getLocalization,S as renderCountrySelects,re as setCountry};
@@ -0,0 +1 @@
1
+ import{f as k}from"./chunk-EYVBEFKK.js";import"./chunk-C2GKO34C.js";import"./chunk-5TS6IBBB.js";import"./chunk-KIZBET7N.js";import"./chunk-F3OXGENC.js";import"./chunk-646NGAEM.js";import"./chunk-UJYL5G7T.js";import"./chunk-UM37ZVSP.js";import"./chunk-I7XE7GQR.js";import"./chunk-6FWNC7QH.js";import{B as q,D as v,G as R,I as d,R as p,c as T,d as I,i as L,m as w,n as o,o as m,q as h,u as x,x as C,z as M}from"./chunk-67MCLHFS.js";import{D as E,F as A,b as s,x as u}from"./chunk-YW3ZIFWB.js";var U=I({predictiveSearch:T({products:[{priceRange:"object"}],collections:["object"],queries:[{text:"string"}]})}),D="query TetherPredictive($q:String!,$limit:Int!){predictiveSearch(query:$q,limit:$limit,limitScope:EACH,types:[PRODUCT,COLLECTION,QUERY]){products{id handle title availableForSale featuredImage{url altText}priceRange{minVariantPrice{amount currencyCode}}}collections{handle title image{url altText}}queries{text}}}",V=6,F=10,O=2,_="/search",g=new WeakSet,$=0,b=new Set,P=a=>a.tagName==="A"?a:a.querySelector("a");function f(a,t){h(a,o("search-bind")).forEach(e=>{let i=m(e,"search-bind");i==="image"?C(e,t.image?.url,t.image?.altText||t.title):(i==="title"||i==="price"||i==="text")&&t[i]!=null&&R(e,t[i])})}function H(a,t){let e=P(a);e&&(t&&e.setAttribute("href",t),e.setAttribute("role","option"))}var y=class{constructor(t,e,i){s(this,"root");s(this,"input");s(this,"results");s(this,"limit");s(this,"minCharacters");s(this,"resultsId");s(this,"searchNumber",0);s(this,"timer");s(this,"lastTerm","");s(this,"cache",new Map);s(this,"listening",new window.AbortController);this.root=t,this.input=e,this.results=i,this.limit=p(t,"search-limit",{min:1,max:F,fallback:V}),this.minCharacters=p(t,"search-min",{min:1,fallback:O}),i.id||($+=1,i.id=`${u.prefix}-search-${$}`),this.resultsId=i.id,this.setUpAria(),this.listen(),b.add(this)}stop(){this.listening.abort(),clearTimeout(this.timer),b.delete(this),g.delete(this.root)}setUpAria(){this.input.setAttribute("role","combobox"),this.input.setAttribute("aria-autocomplete","list"),this.input.setAttribute("aria-controls",this.resultsId),this.input.setAttribute("aria-expanded","false"),this.input.setAttribute("autocomplete","off"),this.results.hasAttribute("role")||this.results.setAttribute("role","listbox"),this.results.hidden=!0}listen(){let{signal:t}=this.listening;this.input.addEventListener("input",()=>{let e=this.input.value.trim();e!==this.lastTerm&&(this.lastTerm=e,clearTimeout(this.timer),this.timer=setTimeout(()=>void this.search(e),u.searchDelay))},{signal:t}),this.input.addEventListener("focus",()=>{this.input.value.trim().length>=this.minCharacters&&this.options().length&&this.open(!0)},{signal:t}),this.input.addEventListener("keydown",e=>{this.onKeydown(e)},{signal:t}),document.addEventListener("click",e=>{if(!this.root.isConnected){this.stop();return}this.root.contains(e.target)||this.open(!1)},{signal:t})}setState(t){this.root.setAttribute(w("search-state"),t)}open(t){this.root.classList.toggle("is-open",t),this.results.hidden=!t,this.input.setAttribute("aria-expanded",String(t)),t||this.input.removeAttribute("aria-activedescendant")}options(){return h(this.results,'[role="option"]')}async fetchResults(t){let e=this.cache.get(t);if(e)return e;let i=await L(D,{q:t,limit:this.limit},U);return this.cache.set(t,i.predictiveSearch),i.predictiveSearch}async search(t){this.searchNumber+=1;let e=this.searchNumber;if(t.length<this.minCharacters){this.open(!1),this.setState("idle");return}this.setState("loading");try{let i=await this.fetchResults(t);e===this.searchNumber&&this.render(i,t)}catch(i){if(e!==this.searchNumber){E("a superseded search failed",i);return}this.setState("error"),A(i,"search")}}fillList(t,e,i){h(this.results,o(t)).forEach(l=>{M(l,e,i),d(l,e.length>0)})}queryUrl(t){let e=this.root.getAttribute("action")||_,i=e.includes("?")?"&":"?";return`${e}${i}${this.input.name||"q"}=${encodeURIComponent(t)}`}render(t,e){let i=t?.products??[],l=t?.collections??[],c=(t?.queries??[]).filter(n=>n.text.toLowerCase()!==e.toLowerCase());this.fillList("search-products",i,(n,r)=>{let N=v(r.priceRange.minVariantPrice);f(n,{title:r.title,price:N,image:r.featuredImage}),H(n,q(r.handle,r.id)),n.classList.toggle("is-sold-out",!r.availableForSale)}),this.fillList("search-collections",l,(n,r)=>{f(n,{title:r.title,image:r.image}),H(n,`${(u.collectionPath||"/collection").replace(/\/$/,"")}/${r.handle}`)}),this.fillList("search-queries",c,(n,r)=>{f(n,{text:r.text}),P(n)?.setAttribute("href",this.queryUrl(r.text))});let S=i.length+l.length+c.length;this.showCount(S),this.setState(S?"ready":"empty"),this.open(!0),x("search",{term:e,products:i,collections:l,queries:c},this.root)}showCount(t){h(this.root,o("show")).forEach(e=>{let i=m(e,"show");i==="search-empty"&&d(e,t===0),i==="search-results"&&d(e,t>0)}),this.options().forEach((e,i)=>{e.id||(e.id=`${this.resultsId}-${i}`),e.setAttribute("aria-selected","false")}),this.input.removeAttribute("aria-activedescendant")}highlight(t,e){t.forEach((l,c)=>{l.setAttribute("aria-selected",String(c===e))});let i=t[e];i&&(this.input.setAttribute("aria-activedescendant",i.id),i.scrollIntoView?.({block:"nearest"}))}onKeydown(t){let e=this.options(),i=e.findIndex(l=>l.getAttribute("aria-selected")==="true");t.key==="ArrowDown"&&e.length?(t.preventDefault(),this.open(!0),this.highlight(e,(i+1)%e.length)):t.key==="ArrowUp"&&e.length?(t.preventDefault(),this.highlight(e,i<=0?e.length-1:i-1)):t.key==="Enter"&&i>=0?(t.preventDefault(),e[i]?.click()):t.key==="Escape"&&this.open(!1)}};function Y(a=document){b.forEach(t=>{t.root.isConnected||t.stop()});for(let t of k(a,o("search"))){if(g.has(t))continue;g.add(t);let e=t.querySelector(o("search-input"))??t.querySelector("input"),i=t.querySelector(o("search-results"));e&&i&&new y(t,e,i)}}export{Y as mountSearch};
package/dist/esm/index.js CHANGED
@@ -1 +1 @@
1
- import{a as st,b as at,c as ct}from"./chunks/chunk-IJAMRI33.js";import{b as C,d as w,e as T,f as p,g as et,h as nt,i as ot,j as k,k as S}from"./chunks/chunk-Y3NKKN2O.js";import{a as lt,b as dt}from"./chunks/chunk-4FR3CUO2.js";import{a as rt,b as it,c as h}from"./chunks/chunk-SZRDO62E.js";import"./chunks/chunk-OENVX4NY.js";import{a as tt}from"./chunks/chunk-FI4NIWAD.js";import{a as z,e as X,h as s}from"./chunks/chunk-7ZXEVDOS.js";import"./chunks/chunk-DM5LEAWM.js";import{l as Q}from"./chunks/chunk-BVO7KK2M.js";import{a as u,b as ut}from"./chunks/chunk-2J3MTS3E.js";import{b as Z}from"./chunks/chunk-CRKJ2VEX.js";import{a as K,b as W,c as Y,e as J}from"./chunks/chunk-H6IORH7O.js";import"./chunks/chunk-FWMPL6PR.js";import{C as q,J as P,M as f,a as v,f as G,j as U,l as d,m as r,r as B,s as g,t as y,u as j}from"./chunks/chunk-OATTAXPO.js";import{e as $,r as c,s as V,v as F,w as E,x as L,y as _,z as a}from"./chunks/chunk-OJAV2I3C.js";var x="0.9.2";var Mt=["account-login","account-bind","account-link","orders","order","addresses","subscriptions","profile-form","address-form"],It=()=>[...Mt.map(t=>`[${d(t)}]`),`[${d("show")}^="logged-"]`].join(",");function Nt(){return!!X(st())}function mt(t){!c.account||!(p(t,It()).length>0||ct(new URLSearchParams(window.location.search).get("account"))||Nt())||u("account").then(n=>n.mountAccount(t)).catch(n=>{a(n,"account")})}function l(t){return(...e)=>u("account").then(n=>{let o=n[t];return o(...e)})}var ft={login:l("login"),logout:l("logout"),isLoggedIn:l("isLoggedIn"),customer:l("customer"),orders:l("orders"),order:l("order"),updateProfile:l("updateProfile"),addresses:l("addresses"),saveAddress:l("saveAddress"),deleteAddress:l("deleteAddress"),subscriptions:l("subscriptions"),subscriptionAction:l("subscriptionAction"),requestReturn:l("requestReturn"),render:l("render"),mountAccount:l("mountAccount")};var pt=()=>`data-${c.prefix}-key`,yt=t=>t instanceof window.Element;function ht(t){let e=t.closest(`[${pt()}]`),n=e?.getAttribute(pt());return e&&n?{line:e,id:n}:null}function A(t,e){t.catch(n=>{a(n,e)})}function Ot(t,e){let n=ht(e);if(!n?.line.closest(r("cart-lines")))return;let{line:o,id:i}=n;if(e.closest(r("line-remove"))){t.preventDefault(),o.classList.add("is-busy"),A(s.removeLine(i),"cart line");return}let H=Dt(e);!H||!s.lines.some(xt=>xt.id===i)||(t.preventDefault(),A(s.changeQuantity(i,H),"cart line"))}function Dt(t){return t.closest(r("line-plus"))?1:t.closest(r("line-minus"))?-1:0}function Rt(t){let{target:e}=t;if(!yt(e))return;if(e.closest(r("cart-open"))){t.preventDefault(),s.toggle();return}if(e.closest(r("cart-close"))){t.preventDefault(),s.close();return}let n=e.closest(r("cart-clear"));if(n){t.preventDefault(),f(n,()=>s.clear().catch(i=>{a(i,"cart clear")}));return}let o=e.closest(r("checkout"));if(o){t.preventDefault(),f(o,()=>s.checkout());return}Ot(t,e)}function gt(t,e,n){t.classList.add("is-busy"),t.setAttribute("aria-busy","true"),A(e,n)}function Ht(t){let{target:e}=t;if(!yt(e))return;let n=ht(e);n&&e instanceof window.HTMLInputElement&&e.matches(r("line","quantity"))?gt(n.line,s.updateLine(n.id,parseInt(e.value,10)||0),"cart line"):n&&e instanceof window.HTMLSelectElement&&e.matches(r("line-plan"))?gt(n.line,s.updateLine(n.id,{sellingPlanId:e.value||null}),"cart line plan"):$t(e)&&e.matches(r("cart-note"))&&A(s.setNote(e.value),"cart note")}var $t=t=>t instanceof window.HTMLInputElement||t instanceof window.HTMLTextAreaElement||t instanceof window.HTMLSelectElement;function Vt(t){if(s.isOpen()){if(t.key==="Escape"){s.close();return}z(t)}}function Et(){document.addEventListener("click",Rt),document.addEventListener("change",Ht),document.addEventListener("keydown",Vt)}var M=t=>t instanceof window.Element;function Ft(t){let e=t.querySelector(r("discount-input"))??t.querySelector("input");return e instanceof window.HTMLInputElement?e:null}function vt(t,e,n){t.classList.toggle("is-invalid",n),n?e?.setAttribute("aria-invalid","true"):e?.removeAttribute("aria-invalid")}async function _t(t,e,n){try{await s.applyDiscount(n),vt(t,e,!1),y("discount-applied",{code:n},t),e&&(e.value="")}catch(o){vt(t,e,!0),o instanceof v&&o.code==="INVALID_DISCOUNT"?y("discount-invalid",{code:n},t):a(o,"discount")}}function Gt(t){let{target:e}=t,n=M(e)?e.closest(r("discount-form")):null;if(!n)return;t.preventDefault();let o=Ft(n),i=o?.value.trim();i&&f(n,()=>_t(n,o,i))}function Ut(t){let{target:e}=t;if(!M(e))return;let n=e.closest(r("discount-form"));n&&(n.classList.remove("is-invalid"),e.removeAttribute("aria-invalid"))}function Bt(t){let{target:e}=t,n=M(e)?e.closest(r("discount-remove")):null;if(!n)return;t.preventDefault();let o=n.closest(r("discount-code"))?.getAttribute(d("discount-code"));o&&s.removeDiscount(o).catch(i=>{a(i,"discount")})}function Pt(){document.addEventListener("submit",Gt,!0),document.addEventListener("input",Ut),document.addEventListener("click",Bt)}var I=t=>u("extras").then(e=>e.addGroup(t)),N=t=>{a(t,"extras")};function jt(t){let{target:e}=t,n=e instanceof window.Element?e.closest(r("group-add")):null;n&&(t.preventDefault(),f(n,()=>I(n)).catch(N))}function qt(t){!c.domain||!t.key?.startsWith(`${c.prefix}:`)||u("extras").then(e=>{e.onStorage(t)}).catch(N)}function Qt(t){if(!g(t,"variant-changed"))return;let{target:e}=t;e instanceof window.Element&&(!c.variantUrl&&!e.hasAttribute(d("variant-url"))||u("extras").then(n=>{n.writeVariantUrl(e,t.detail)}).catch(N))}function wt(){document.addEventListener("click",jt),window.addEventListener("storage",qt),document.addEventListener(`${c.prefix}:variant-changed`,Qt)}var O=null;function At(){O=document.body}async function zt(t){await t.ready();let e=it();if(!e){O!==document.body&&t.mount(document);return}try{await h(e.country,{language:e.language??null,locale:e.locale,remember:!1})}catch(n){a(n,"country")}t.mount(document)}function Kt(t){document.addEventListener("astro:page-load",()=>{zt(t).catch(e=>{a(e,"page mount")})}),document.addEventListener("astro:before-swap",()=>{O=null,t.unmount()})}function Wt(t){let{target:e}=t;!(e instanceof window.HTMLSelectElement)||!e.matches(r("country-select"))||e.value&&h(e.value).catch(n=>{a(n,"country")})}function Yt(){nt(),w.forEach(t=>{t.root.getAttribute(d("state"))==="error"&&t.load()})}function bt(t){c.astro&&Kt(t),document.addEventListener("change",Wt),window.addEventListener("online",Yt)}var Jt=50;function Xt(){let t=P("TETHER_CONFIG");return typeof t=="object"&&t!==null?Object.fromEntries(Object.entries(t)):{}}var m=null,D=null,Ct=null,Lt=!1;function Zt(t){let e=0;return p(t,lt()).forEach(n=>{if(C.has(n))return;C.add(n),e++;let o=dt(n);w.add(o),n.addEventListener(`${c.prefix}:list-rendered`,i=>{g(i,"list-rendered")&&b(i.detail.container)}),ot(o.load())}),e}function te(t){p(t,`${r("country-select")},${r("country-bind")}`).length&&u("markets").then(e=>e.renderCountrySelects(t)).catch(e=>{a(e,"markets")}),mt(t),p(t,r("search")).length&&u("search").then(e=>{e.mountSearch(t)}).catch(e=>{a(e,"search")})}function Tt(t){let e=Zt(t);return p(t,r("product")).forEach(n=>{et(n)&&e++}),te(t),e}function b(t=document){if(!E())return 0;t===document&&At(),T(),S(t.ownerDocument??document);let e=Tt(t);return k(),s.render(),L(`mounted ${e} scope(s)`,t),e}function ee(t){let e=t.filter(o=>o.isConnected&&!t.some(i=>i!==o&&i.contains(o)));if(!e.length||!E())return;T(),e.forEach(o=>{S(o)});let n=e.reduce((o,i)=>o+Tt(i),0);k(),s.render(),L(`mounted ${n} scope(s) in ${e.length} added element(s)`)}function kt(){s.close()}function ne(t){let e=t?.closest(r("product"));return e?tt.get(e)??null:null}function oe(){Lt||(Lt=!0,Et(),Pt(),wt(),bt({ready:()=>m??Promise.resolve(null),mount:b,unmount:kt}))}function re(){let t=[];Ct=t,B.forEach(e=>{document.addEventListener(`${c.prefix}:${e}`,n=>t.push(n))}),document.addEventListener("astro:page-load",e=>t.push(e)),u("analytics").then(e=>e.startAnalytics(t)).catch(e=>{a(e,"analytics")})}async function ie(t){let e=c.country,n=t?.buyerIdentity.countryCode;if(!t||!e||!n||n===e)return t;try{return await s.setBuyerIdentity({countryCode:e},{create:!1})}catch(o){return a(o,"cart country"),t}}function St(t={}){return m&&!Object.keys(t).length?m:(F({...Xt(),...t}),E()?(at(),oe(),c.observe&&se(),c.analytics&&!Ct&&re(),m=rt(t).then(()=>s.init()).then(ie).then(e=>(y("ready",{cart:e}),R)),m):(_("TETHER_CONFIG is missing domain or token. Tether is idle."),m=Promise.resolve(null),m))}function se(){if(D||typeof MutationObserver>"u")return;let t,e=new Set;D=new MutationObserver(n=>{n.forEach(o=>{o.addedNodes.forEach(i=>{i instanceof window.Element&&e.add(i)})}),clearTimeout(t),t=setTimeout(()=>{let o=[...e];e.clear(),ee(o)},Jt)}),D.observe(document.body,{childList:!0,subtree:!0})}var ae=t=>u("markets").then(e=>e.detectMarket(t??c.markets)),ce=t=>u("lists").then(e=>e.getProducts(t)),ue=(t,e)=>u("lists").then(n=>n.getRecommendations(t,e)),le=()=>u("markets").then(t=>t.getLocalization()),de=t=>u("diagnose").then(e=>e.diagnose({...t,version:x}));function me(t,e){let n=`${c.prefix}:${t}`,o=i=>{g(i,t)&&e(i.detail,i)};return document.addEventListener(n,o),()=>{document.removeEventListener(n,o)}}var fe={VERSION:x,init:St,mount:b,unmount:kt,get config(){return V},get ready(){return m??Promise.resolve(null)},query:U,withContext:G,cart:s,getProduct:Y,getProducts:ce,getRecommendations:ue,getScope:ne,addGroup:I,account:ft,primeProduct:W,normalizeProductKey:K,clearProductCache:J,formatMoney:q,imageUrl:j,plans:Q,TetherError:v,resolveProductKey:Z,setCountry:h,detectMarket:ae,getLocalization:le,diagnose:de,on:me},pe={__core:ut,__parts:{}},R=Object.assign(fe,pe),cn=R;function ge(){Reflect.set(window,"Tether",R);let t=P("TETHER_CONFIG");if(!t||$(t,"autoMount")===!1||P("TETHER_INTEGRATION"))return;let e=()=>{St().then(()=>b(document)).catch(n=>{a(n,"init")})};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",e,{once:!0}):e()}typeof window<"u"&&typeof document<"u"&&ge();export{x as VERSION,I as addGroup,R as api,cn as default,ne as getScope,St as init,b as mount,h as setCountry,kt as unmount};
1
+ import{a as at,b as ct,c as ut}from"./chunks/chunk-AHYDU7Z6.js";import{b as C,d as A,e as k,f as p,g as nt,h as ot,i as rt,j as S,k as x}from"./chunks/chunk-EYVBEFKK.js";import{a as dt,b as mt}from"./chunks/chunk-C2GKO34C.js";import{a as it,b as st,c as h}from"./chunks/chunk-B2X6ZOKA.js";import"./chunks/chunk-HEK66LYK.js";import{a as et}from"./chunks/chunk-5TS6IBBB.js";import{a as K,e as Z,h as s}from"./chunks/chunk-KIZBET7N.js";import"./chunks/chunk-F3OXGENC.js";import{l as Q}from"./chunks/chunk-646NGAEM.js";import{a as u,b as lt}from"./chunks/chunk-UJYL5G7T.js";import{b as tt}from"./chunks/chunk-UM37ZVSP.js";import{a as W,b as X,c as Y,e as J}from"./chunks/chunk-I7XE7GQR.js";import"./chunks/chunk-6FWNC7QH.js";import{D as j,L as w,O as f,Q as z,a as P,f as G,k as U,m as d,n as i,s as q,t as y,u as E,v as B}from"./chunks/chunk-67MCLHFS.js";import{B as _,C as v,D as L,E as F,F as a,e as $,x as c,y as V}from"./chunks/chunk-YW3ZIFWB.js";function ft(t){let e=[],n=new window.AbortController,o={signal:n.signal};return q.forEach(r=>{document.addEventListener(`${c.prefix}:${r}`,g=>e.push(g),o)}),document.addEventListener("astro:page-load",r=>e.push(r),o),t().then(r=>r.startAnalytics(e)).catch(r=>{n.abort(),e.length=0,a(r,"analytics")}),e}var M="0.9.4";var It=["account-login","account-bind","account-link","orders","order","addresses","subscriptions","profile-form","address-form"],Nt=()=>[...It.map(t=>`[${d(t)}]`),`[${d("show")}^="logged-"]`].join(",");function Ot(){return!!Z(at())}function pt(t){!c.account||!(p(t,Nt()).length>0||ut(new URLSearchParams(window.location.search).get("account"))||Ot())||u("account").then(n=>n.mountAccount(t)).catch(n=>{a(n,"account")})}function l(t){return(...e)=>u("account").then(n=>{let o=n[t];return o(...e)})}var gt={login:l("login"),logout:l("logout"),isLoggedIn:l("isLoggedIn"),customer:l("customer"),orders:l("orders"),order:l("order"),updateProfile:l("updateProfile"),addresses:l("addresses"),saveAddress:l("saveAddress"),deleteAddress:l("deleteAddress"),subscriptions:l("subscriptions"),subscriptionAction:l("subscriptionAction"),requestReturn:l("requestReturn"),render:l("render"),mountAccount:l("mountAccount")};var yt=()=>`data-${c.prefix}-key`,Et=t=>t instanceof window.Element;function ht(t){let e=t.closest(`[${yt()}]`),n=e?.getAttribute(yt());return e&&n?{line:e,id:n}:null}function b(t,e){t.catch(n=>{a(n,e)})}function Dt(t,e){let n=ht(e);if(!n?.line.closest(i("cart-lines")))return;let{line:o,id:r}=n;if(e.closest(i("line-remove"))){t.preventDefault(),o.classList.add("is-busy"),b(s.removeLine(r),"cart line");return}let g=Rt(e);!g||!s.lines.some(Mt=>Mt.id===r)||(t.preventDefault(),b(s.changeQuantity(r,g),"cart line"))}function Rt(t){return t.closest(i("line-plus"))?1:t.closest(i("line-minus"))?-1:0}function Ht(t){let{target:e}=t;if(!Et(e))return;if(e.closest(i("cart-open"))){t.preventDefault(),s.toggle();return}if(e.closest(i("cart-close"))){t.preventDefault(),s.close();return}let n=e.closest(i("cart-clear"));if(n){t.preventDefault(),f(n,()=>s.clear().catch(r=>{a(r,"cart clear")}));return}let o=e.closest(i("checkout"));if(o){t.preventDefault(),f(o,()=>s.checkout());return}Dt(t,e)}function vt(t,e,n){t.classList.add("is-busy"),t.setAttribute("aria-busy","true"),b(e,n)}function $t(t,{line:e,id:n}){let o=t.value.trim();if(z.test(o)){vt(e,s.updateLine(n,Number(o)),"cart line");return}let r=s.lines.find(g=>g.id===n);r&&(t.value=String(s.quantityOf(r)))}function Vt(t){let{target:e}=t;if(!Et(e))return;let n=ht(e);n&&e instanceof window.HTMLInputElement&&e.matches(i("line","quantity"))?$t(e,n):n&&e instanceof window.HTMLSelectElement&&e.matches(i("line-plan"))?vt(n.line,s.updateLine(n.id,{sellingPlanId:e.value||null}),"cart line plan"):_t(e)&&e.matches(i("cart-note"))&&b(s.setNote(e.value),"cart note")}var _t=t=>t instanceof window.HTMLInputElement||t instanceof window.HTMLTextAreaElement||t instanceof window.HTMLSelectElement;function Ft(t){if(s.isOpen()){if(t.key==="Escape"){s.close();return}K(t)}}function Pt(){document.addEventListener("click",Ht),document.addEventListener("change",Vt),document.addEventListener("keydown",Ft)}var I=t=>t instanceof window.Element;function Gt(t){let e=t.querySelector(i("discount-input"))??t.querySelector("input");return e instanceof window.HTMLInputElement?e:null}function wt(t,e,n){t.classList.toggle("is-invalid",n),n?e?.setAttribute("aria-invalid","true"):e?.removeAttribute("aria-invalid")}async function Ut(t,e,n){try{await s.applyDiscount(n),wt(t,e,!1),E("discount-applied",{code:n},t),e&&(e.value="")}catch(o){wt(t,e,!0),o instanceof P&&o.code==="INVALID_DISCOUNT"?E("discount-invalid",{code:n},t):a(o,"discount")}}function qt(t){let{target:e}=t,n=I(e)?e.closest(i("discount-form")):null;if(!n)return;t.preventDefault();let o=Gt(n),r=o?.value.trim();r&&f(n,()=>Ut(n,o,r))}function Bt(t){let{target:e}=t;if(!I(e))return;let n=e.closest(i("discount-form"));n&&(n.classList.remove("is-invalid"),e.removeAttribute("aria-invalid"))}function jt(t){let{target:e}=t,n=I(e)?e.closest(i("discount-remove")):null;if(!n)return;t.preventDefault();let o=n.closest(i("discount-code"))?.getAttribute(d("discount-code"));o&&s.removeDiscount(o).catch(r=>{a(r,"discount")})}function At(){document.addEventListener("submit",qt,!0),document.addEventListener("input",Bt),document.addEventListener("click",jt)}var N=t=>u("extras").then(e=>e.addGroup(t)),O=t=>{a(t,"extras")};function zt(t){let{target:e}=t,n=e instanceof window.Element?e.closest(i("group-add")):null;n&&(t.preventDefault(),f(n,()=>N(n)).catch(O))}function Qt(t){!c.domain||!t.key?.startsWith(`${c.prefix}:`)||u("extras").then(e=>{e.onStorage(t)}).catch(O)}function Kt(t){if(!y(t,"variant-changed"))return;let{target:e}=t;e instanceof window.Element&&(!c.variantUrl&&!e.hasAttribute(d("variant-url"))||u("extras").then(n=>{n.writeVariantUrl(e,t.detail)}).catch(O))}function bt(){document.addEventListener("click",zt),window.addEventListener("storage",Qt),document.addEventListener(`${c.prefix}:variant-changed`,Kt)}var D=null;function Tt(){D=document.body}async function Wt(t){await t.ready();let e=st();if(!e){D!==document.body&&t.mount(document);return}try{await h(e.country,{language:e.language??null,locale:e.locale,remember:!1})}catch(n){a(n,"country")}t.mount(document)}function Xt(t){document.addEventListener("astro:page-load",()=>{Wt(t).catch(e=>{a(e,"page mount")})}),document.addEventListener("astro:before-swap",()=>{D=null,t.unmount()})}function Yt(t){let{target:e}=t;!(e instanceof window.HTMLSelectElement)||!e.matches(i("country-select"))||e.value&&h(e.value).catch(n=>{a(n,"country")})}function Jt(){ot(),A.forEach(t=>{t.root.getAttribute(d("state"))==="error"&&t.load()})}function Lt(t){c.astro&&Xt(t),document.addEventListener("change",Yt),window.addEventListener("online",Jt)}var Zt=50;function te(){let t=w("TETHER_CONFIG");return typeof t=="object"&&t!==null?Object.fromEntries(Object.entries(t)):{}}var m=null,R=null,ee=null,Ct=!1;function ne(t){let e=0;return p(t,dt()).forEach(n=>{if(C.has(n))return;C.add(n),e++;let o=mt(n);A.add(o),n.addEventListener(`${c.prefix}:list-rendered`,r=>{y(r,"list-rendered")&&T(r.detail.container)}),rt(o.load())}),e}function oe(t){p(t,`${i("country-select")},${i("country-bind")}`).length&&u("markets").then(e=>e.renderCountrySelects(t)).catch(e=>{a(e,"markets")}),pt(t),p(t,i("search")).length&&u("search").then(e=>{e.mountSearch(t)}).catch(e=>{a(e,"search")})}function kt(t){let e=ne(t);return p(t,i("product")).forEach(n=>{nt(n)&&e++}),oe(t),e}function T(t=document){if(!v())return 0;t===document&&Tt(),k(),x(t.ownerDocument??document);let e=kt(t);return S(),s.render(),L(`mounted ${e} scope(s)`,t),e}function re(t){let e=t.filter(o=>o.isConnected&&!t.some(r=>r!==o&&r.contains(o)));if(!e.length||!v())return;k(),e.forEach(o=>{x(o)});let n=e.reduce((o,r)=>o+kt(r),0);S(),s.render(),L(`mounted ${n} scope(s) in ${e.length} added element(s)`)}function St(){s.close()}function ie(t){let e=t?.closest(i("product"));return e?et.get(e)??null:null}function se(){Ct||(Ct=!0,Pt(),At(),bt(),Lt({ready:()=>m??Promise.resolve(null),mount:T,unmount:St}))}async function ae(t){let e=c.country,n=t?.buyerIdentity.countryCode;if(!t||!e||!n||n===e)return t;try{return await s.setBuyerIdentity({countryCode:e},{create:!1})}catch(o){return a(o,"cart country"),t}}function xt(t={}){return m&&!Object.keys(t).length?m:(_({...te(),...t}),v()?(ct(),se(),c.observe&&ce(),c.analytics&&(ee??(ee=ft(()=>u("analytics")))),m=it(t).then(()=>s.init()).then(ae).then(e=>(E("ready",{cart:e}),H)),m):(F("TETHER_CONFIG is missing domain or token. Tether is idle."),m=Promise.resolve(null),m))}function ce(){if(R||typeof MutationObserver>"u")return;let t,e=new Set;R=new MutationObserver(n=>{n.forEach(o=>{o.addedNodes.forEach(r=>{r instanceof window.Element&&e.add(r)})}),clearTimeout(t),t=setTimeout(()=>{let o=[...e];e.clear(),re(o)},Zt)}),R.observe(document.body,{childList:!0,subtree:!0})}var ue=t=>u("markets").then(e=>e.detectMarket(t??c.markets)),le=t=>u("lists").then(e=>e.getProducts(t)),de=(t,e)=>u("lists").then(n=>n.getRecommendations(t,e)),me=()=>u("markets").then(t=>t.getLocalization()),fe=t=>u("diagnose").then(e=>e.diagnose({...t,version:M}));function pe(t,e){let n=`${c.prefix}:${t}`,o=r=>{y(r,t)&&e(r.detail,r)};return document.addEventListener(n,o),()=>{document.removeEventListener(n,o)}}var ge={VERSION:M,init:xt,mount:T,unmount:St,get config(){return V},get ready(){return m??Promise.resolve(null)},query:U,withContext:G,cart:s,getProduct:Y,getProducts:le,getRecommendations:de,getScope:ie,addGroup:N,account:gt,primeProduct:X,normalizeProductKey:W,clearProductCache:J,formatMoney:j,imageUrl:B,plans:Q,TetherError:P,resolveProductKey:tt,setCountry:h,detectMarket:ue,getLocalization:me,diagnose:fe,on:pe},ye={__core:lt,__parts:{}},H=Object.assign(ge,ye),pn=H;function Ee(){Reflect.set(window,"Tether",H);let t=w("TETHER_CONFIG");if(!t||$(t,"autoMount")===!1||w("TETHER_INTEGRATION"))return;let e=()=>{xt().then(()=>T(document)).catch(n=>{a(n,"init")})};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",e,{once:!0}):e()}typeof window<"u"&&typeof document<"u"&&Ee();export{M as VERSION,N as addGroup,H as api,pn as default,ie as getScope,xt as init,T as mount,h as setCountry,St as unmount};
@@ -1,2 +1,2 @@
1
- import{b as G,f as Q,g as H}from"./chunks/chunk-DM5LEAWM.js";import{e as O,f as v,g as w,i as F,l as q}from"./chunks/chunk-BVO7KK2M.js";import{a as M,c as R,e as V,g as J,h as B,i as K,j}from"./chunks/chunk-FWMPL6PR.js";import{B as D,a as y,c as b,d as S,f as ot,g as k,i as U,u as L}from"./chunks/chunk-OATTAXPO.js";import{B as E,E as _,F as C,G as I,q as g,t as N,y as A}from"./chunks/chunk-OJAV2I3C.js";function z(t,e={}){if(!t)return null;let{variant:r,sellingPlan:a,defaultPurchase:c=g.defaultPurchase,lowStock:u=g.lowStock}=e,d=Q(t,{variant:r,sellingPlan:a,defaultPurchase:c}),n=H(t,{...d,quantity:1},u);if(!n)throw new y(`Product ${t.handle} has no variants`);let{selected:l,line:p}=n,i=(o,s)=>!G(t,l,o,s);return{variant:n.variant,selected:l,purchase:n.purchase.kind,plan:p.kind==="subscription"?n.plan:null,plans:O(t).map(o=>({id:o.id,name:o.name,price:w(n.variant,o.id),savings:F(n.variant,o.id).percentage,selected:p.kind==="subscription"&&o.id===p.planId,available:!!v(n.variant,o.id)})),savings:n.savings.percentage,price:n.price,compareAtPrice:n.compareAtPrice,available:n.variant.availableForSale,show:n.show,unavailable:Object.fromEntries(t.options.map(o=>[o.name,o.optionValues.map(s=>s.name).filter(s=>i(o.name,s))])),isUnavailable:i}}var it=500,at=100,st=100,lt="query TetherServerProductById($id:ID!){node(id:$id){... on Product{...TetherProduct}}}",ct="query TetherServerProduct($handle:String!){product(handle:$handle){...TetherProduct}}",ut=()=>`query TetherServerCollection($handle:String!,$first:Int!,$after:String,$sortKey:ProductCollectionSortKeys,$reverse:Boolean,$filters:[ProductFilter!]){collection(handle:$handle){${R()} products(first:$first,after:$after,sortKey:$sortKey,reverse:$reverse,filters:$filters){nodes{...TetherProduct}pageInfo{hasNextPage endCursor}}}}`,dt="query TetherServerProducts($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}}}",ft=()=>`query TetherServerCollections($first:Int!,$after:String){collections(first:$first,after:$after){nodes{${R()}}pageInfo{hasNextPage endCursor}}}`,pt=t=>`query TetherServerRecs(${t?"$id: ID!":"$handle: String!"},$intent:ProductRecommendationIntent){productRecommendations(${t?"productId: $id":"productHandle: $handle"},intent:$intent){...TetherProduct}}`,mt=S({product:b(V)}),gt=S({node:b(J)}),yt=S({collections:{nodes:[{handle:"string"}],pageInfo:{hasNextPage:"boolean"}}});async function Pt(t){let e=[],r=null;for(let a=0;a<st;a++){let c=await k(t,ft(),{first:at,after:r},yt);if(e.push(...c.collections.nodes),!c.collections.pageInfo.hasNextPage)break;r=c.collections.pageInfo.endCursor}return e}function Y(t,e){let r=(i,o,s)=>k(t,f=>`${i}
2
- ${M(t,f)}`,o,s);async function a(i){let o=I(i);if(!o)return null;if(o.startsWith("gid://")){let{node:f}=await r(lt,{id:o},gt);return f?.id?f:null}return(await r(ct,{handle:o},mt)).product}async function c(i,{first:o=e,after:s=null,sortKey:f,reverse:m=!1,filters:$}){let h=await r(ut(),{handle:i,first:o,after:s,sortKey:f||void 0,reverse:m,filters:$??void 0},B);if(!h.collection)return{collection:null,products:[],pageInfo:{hasNextPage:!1,endCursor:null}};let{products:P,...rt}=h.collection;return{collection:rt,products:P.nodes,pageInfo:P.pageInfo}}async function u(i={}){let{collection:o,query:s,first:f=e,after:m=null,sortKey:$,reverse:h=!1}=i;if(o)return c(o,i);let P=await r(dt,{first:f,after:m,query:s||void 0,sortKey:$||void 0,reverse:h},K);return{collection:null,products:P.products.nodes,pageInfo:P.products.pageInfo}}async function d(i={}){let o=[],s=null;for(let f=0;f<it;f++){let m=await u({...i,first:e,after:s});if(o.push(...m.products),!m.pageInfo.hasNextPage)break;s=m.pageInfo.endCursor}return o}async function n(i,o={}){let s=await u({...o,collection:i});return s.collection?{...s.collection,products:s.products,pageInfo:s.pageInfo}:null}async function l(i,o="RELATED"){let s=I(typeof i=="object"?i?.id:i);if(!s)throw new y("No product for recommendations",{code:"NOT_FOUND"});let f=s.startsWith("gid://");return(await r(pt(f),f?{id:s,intent:o}:{handle:s,intent:o},j)).productRecommendations??[]}return{getProduct:a,getProducts:u,allProducts:d,getCollection:n,allCollections:()=>Pt(t),getRecommendations:l}}var X={size:"https://schema.org/size",color:"https://schema.org/color",colour:"https://schema.org/color",material:"https://schema.org/material"},T=t=>JSON.stringify(t).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029");function W(t){return JSON.parse(JSON.stringify(t))}var Z=t=>t.split("/").pop()??t;function ht(t){return t.availableForSale?t.currentlyNotInStock?"https://schema.org/BackOrder":"https://schema.org/InStock":"https://schema.org/OutOfStock"}function St(t,e){if(!t.requiresSellingPlan)return e.price;let r=O(t).find(a=>v(e,a.id));return(r&&w(e,r.id))??e.price}function tt(t,e,r){let a=St(t,e),c=r?.includes("?")?"&":"?";return{"@type":"Offer",price:a.amount,priceCurrency:a.currencyCode,availability:ht(e),url:r?`${r}${c}variant=${Z(e.id)}`:void 0}}function Ct(t,e,r,a){let c=e.selectedOptions.flatMap(u=>{let d=X[u.name.toLowerCase()];return d?[[d.split("/").pop()??d,u.value]]:[]});return{"@type":"Product",name:`${t.title} - ${e.title}`,sku:e.sku||void 0,image:e.image?.url||a[0],...Object.fromEntries(c),offers:tt(t,e,r)}}function It(t,{url:e},r){if(e)return e;let a=C(r.productPath,t.handle,t.id);if(!(!r.siteUrl||!a))return new URL(a,r.siteUrl).toString()}function x(t,e,r){if(!t)return null;let a=It(t,e,r),c=t.images.nodes.map(i=>i.url).filter(Boolean),u=e.brand||t.vendor,d=u?{"@type":"Brand",name:u}:void 0,n=t.description.trim()||void 0,l=t.variants.nodes;if(l.length<=1){let[i]=l;return W({"@context":"https://schema.org","@type":"Product",name:t.title,description:n,url:a,image:c,sku:i?.sku||void 0,brand:d,offers:i?tt(t,i,a):void 0})}let p=t.options.map(i=>X[i.name.toLowerCase()]).filter(Boolean);return W({"@context":"https://schema.org","@type":"ProductGroup",name:t.title,description:n,url:a,productGroupID:Z(t.id),image:c,brand:d,variesBy:[...new Set(p)],hasVariant:l.map(i=>Ct(t,i,a,c))})}var et=25,Ot=250,vt=2,wt=1;function $t(t,{productPath:e=g.productPath,id:r}={}){return C(e,t,r)}function nt(t,e){for(let r of e){let a=t[r];if(typeof a=="string"&&a)return a}return""}function bt(t){let e={};for(let[u,d]of Object.entries(t))u in g&&(e[u]=d);let r=typeof t.domain=="string"&&t.domain?t.domain:"",a=typeof t.token=="string"&&t.token?t.token:"",c={...N({...e,domain:r||nt(t,E.domain),token:a||nt(t,E.token)}),pageSize:kt(t.pageSize)};return t.fetch&&(c.fetch=t.fetch),t.siteUrl!==void 0&&(c.siteUrl=t.siteUrl),c}function kt(t){return typeof t=="number"&&Number.isInteger(t)&&t>=1&&t<=Ot?t:(t!==void 0&&A(`invalid pageSize ${JSON.stringify(t)}: using ${String(et)}`),et)}function Et(t,e){return{...t,description:"",descriptionHtml:"",images:{nodes:t.images.nodes.slice(0,Math.max(1,e))},variants:{nodes:t.variants.nodes.map(r=>({...r,image:null}))}}}function zt(t={}){let e=bt(t);if(!e.domain||!e.token)throw new y("createStorefront needs domain and token: pass them, or import.meta.env with PUBLIC_SHOPIFY_DOMAIN and PUBLIC_SHOPIFY_STOREFRONT_TOKEN",{code:"NOT_CONFIGURED"});let r=Y(e,e.pageSize),a={productPath:e.productPath,siteUrl:e.siteUrl};function c(n,{card:l=!1,images:p=vt}={}){let i=(Array.isArray(n)?n:[n]).filter(s=>s!=null),o={v:wt,at:new Date().toISOString(),country:e.country||null,language:e.language||null,products:l?i.map(s=>Et(s,p)):i};return`<script type="application/json" data-tether-hydrate>${T(o)}<\/script>`}function u(n,l={}){return n?`<script type="application/ld+json">${T(x(n,l,a))}<\/script>`:""}function d(n,l={}){return z(n,{defaultPurchase:e.defaultPurchase,lowStock:e.lowStock,...l})}return{config:e,query:(n,l,p)=>U(e,n,l,p),...r,hydrate:c,formatMoney:(n,l=e.locale)=>_(n,l),formatPercent:(n,l=e.locale)=>D(n,l),imageUrl:L,jsonLd:u,jsonLdData:(n,l={})=>x(n,l,a),initialState:d,productUrl:(n,l={})=>$t(n,{productPath:e.productPath,...l}),plans:q}}export{y as TetherError,zt as createStorefront,_ as formatMoney,D as formatPercent,L as imageUrl,z as initialState,q as plans,I as productKey,$t as productUrl,ot as withContext};
1
+ import{b as Q,f as G,g as H}from"./chunks/chunk-F3OXGENC.js";import{e as O,f as v,g as w,i as F,l as q}from"./chunks/chunk-646NGAEM.js";import{a as M,c as T,e as V,g as J,h as B,i as K,j}from"./chunks/chunk-6FWNC7QH.js";import{C as D,a as y,c as k,d as I,f as ot,h as E,j as _,v as L}from"./chunks/chunk-67MCLHFS.js";import{E as U,q as $,t as x,u as S,v as C,w as g,z as A}from"./chunks/chunk-YW3ZIFWB.js";function z(t,e={}){if(!t)return null;let{variant:r,sellingPlan:a,defaultPurchase:c=g.defaultPurchase,lowStock:u=g.lowStock}=e,d=G(t,{variant:r,sellingPlan:a,defaultPurchase:c}),n=H(t,{...d,quantity:1},u);if(!n)throw new y(`Product ${t.handle} has no variants`);let{selected:l,line:p}=n,i=(o,s)=>!Q(t,l,o,s);return{variant:n.variant,selected:l,purchase:n.purchase.kind,plan:p.kind==="subscription"?n.plan:null,plans:O(t).map(o=>({id:o.id,name:o.name,price:w(n.variant,o.id),savings:F(n.variant,o.id).percentage,selected:p.kind==="subscription"&&o.id===p.planId,available:!!v(n.variant,o.id)})),savings:n.savings.percentage,price:n.price,compareAtPrice:n.compareAtPrice,available:n.variant.availableForSale,show:n.show,unavailable:Object.fromEntries(t.options.map(o=>[o.name,o.optionValues.map(s=>s.name).filter(s=>i(o.name,s))])),isUnavailable:i}}var it=500,at=100,st=100,lt="query TetherServerProductById($id:ID!){node(id:$id){... on Product{...TetherProduct}}}",ct="query TetherServerProduct($handle:String!){product(handle:$handle){...TetherProduct}}",ut=()=>`query TetherServerCollection($handle:String!,$first:Int!,$after:String,$sortKey:ProductCollectionSortKeys,$reverse:Boolean,$filters:[ProductFilter!]){collection(handle:$handle){${T()} products(first:$first,after:$after,sortKey:$sortKey,reverse:$reverse,filters:$filters){nodes{...TetherProduct}pageInfo{hasNextPage endCursor}}}}`,dt="query TetherServerProducts($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}}}",ft=()=>`query TetherServerCollections($first:Int!,$after:String){collections(first:$first,after:$after){nodes{${T()}}pageInfo{hasNextPage endCursor}}}`,pt=t=>`query TetherServerRecs(${t?"$id: ID!":"$handle: String!"},$intent:ProductRecommendationIntent){productRecommendations(${t?"productId: $id":"productHandle: $handle"},intent:$intent){...TetherProduct}}`,mt=I({product:k(V)}),gt=I({node:k(J)}),yt=I({collections:{nodes:[{handle:"string"}],pageInfo:{hasNextPage:"boolean"}}});async function Pt(t){let e=[],r=null;for(let a=0;a<st;a++){let c=await E(t,ft(),{first:at,after:r},yt);if(e.push(...c.collections.nodes),!c.collections.pageInfo.hasNextPage)break;r=c.collections.pageInfo.endCursor}return e}function Y(t,e){let r=(i,o,s)=>E(t,f=>`${i}
2
+ ${M(t,f)}`,o,s);async function a(i){let o=C(i);if(!o)return null;if(o.startsWith("gid://")){let{node:f}=await r(lt,{id:o},gt);return f?.id?f:null}return(await r(ct,{handle:o},mt)).product}async function c(i,{first:o=e,after:s=null,sortKey:f,reverse:m=!1,filters:b}){let h=await r(ut(),{handle:i,first:o,after:s,sortKey:f||void 0,reverse:m,filters:b??void 0},B);if(!h.collection)return{collection:null,products:[],pageInfo:{hasNextPage:!1,endCursor:null}};let{products:P,...rt}=h.collection;return{collection:rt,products:P.nodes,pageInfo:P.pageInfo}}async function u(i={}){let{collection:o,query:s,first:f=e,after:m=null,sortKey:b,reverse:h=!1}=i;if(o)return c(o,i);let P=await r(dt,{first:f,after:m,query:s||void 0,sortKey:b||void 0,reverse:h},K);return{collection:null,products:P.products.nodes,pageInfo:P.products.pageInfo}}async function d(i={}){let o=[],s=null;for(let f=0;f<it;f++){let m=await u({...i,first:e,after:s});if(o.push(...m.products),!m.pageInfo.hasNextPage)break;s=m.pageInfo.endCursor}return o}async function n(i,o={}){let s=await u({...o,collection:i});return s.collection?{...s.collection,products:s.products,pageInfo:s.pageInfo}:null}async function l(i,o="RELATED"){let s=C(typeof i=="object"?i?.id:i);if(!s)throw new y("No product for recommendations",{code:"NOT_FOUND"});let f=s.startsWith("gid://");return(await r(pt(f),f?{id:s,intent:o}:{handle:s,intent:o},j)).productRecommendations??[]}return{getProduct:a,getProducts:u,allProducts:d,getCollection:n,allCollections:()=>Pt(t),getRecommendations:l}}var X={size:"https://schema.org/size",color:"https://schema.org/color",colour:"https://schema.org/color",material:"https://schema.org/material"},R=t=>JSON.stringify(t).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029");function W(t){return JSON.parse(JSON.stringify(t))}var Z=t=>t.split("/").pop()??t;function ht(t){return t.availableForSale?t.currentlyNotInStock?"https://schema.org/BackOrder":"https://schema.org/InStock":"https://schema.org/OutOfStock"}function St(t,e){if(!t.requiresSellingPlan)return e.price;let r=O(t).find(a=>v(e,a.id));return(r&&w(e,r.id))??e.price}function tt(t,e,r){let a=St(t,e),c=r?.includes("?")?"&":"?";return{"@type":"Offer",price:a.amount,priceCurrency:a.currencyCode,availability:ht(e),url:r?`${r}${c}variant=${Z(e.id)}`:void 0}}function Ct(t,e,r,a){let c=e.selectedOptions.flatMap(u=>{let d=X[u.name.toLowerCase()];return d?[[d.split("/").pop()??d,u.value]]:[]});return{"@type":"Product",name:`${t.title} - ${e.title}`,sku:e.sku||void 0,image:e.image?.url||a[0],...Object.fromEntries(c),offers:tt(t,e,r)}}function It(t,{url:e},r){if(e)return e;let a=S(r.productPath,t.handle,t.id);if(!(!r.siteUrl||!a))return new URL(a,r.siteUrl).toString()}function N(t,e,r){if(!t)return null;let a=It(t,e,r),c=t.images.nodes.map(i=>i.url).filter(Boolean),u=e.brand||t.vendor,d=u?{"@type":"Brand",name:u}:void 0,n=t.description.trim()||void 0,l=t.variants.nodes;if(l.length<=1){let[i]=l;return W({"@context":"https://schema.org","@type":"Product",name:t.title,description:n,url:a,image:c,sku:i?.sku||void 0,brand:d,offers:i?tt(t,i,a):void 0})}let p=t.options.map(i=>X[i.name.toLowerCase()]).filter(Boolean);return W({"@context":"https://schema.org","@type":"ProductGroup",name:t.title,description:n,url:a,productGroupID:Z(t.id),image:c,brand:d,variesBy:[...new Set(p)],hasVariant:l.map(i=>Ct(t,i,a,c))})}var et=25,vt=2,wt=1;function bt(t,{productPath:e=g.productPath,id:r}={}){return S(e,t,r)}function nt(t,e){for(let r of e){let a=t[r];if(typeof a=="string"&&a)return a}return""}function $t(t){let e={};for(let[u,d]of Object.entries(t))Object.hasOwn(g,u)&&(e[u]=d);let r=typeof t.domain=="string"&&t.domain?t.domain:"",a=typeof t.token=="string"&&t.token?t.token:"",c={...A({...e,domain:r||nt(t,$.domain),token:a||nt(t,$.token)}),pageSize:kt(t.pageSize)};return t.fetch&&(c.fetch=t.fetch),t.siteUrl!==void 0&&(c.siteUrl=t.siteUrl),c}function kt(t){return typeof t=="number"&&Number.isInteger(t)&&t>=1&&t<=250?t:(t!==void 0&&U(`invalid pageSize ${JSON.stringify(t)}: using ${String(et)}`),et)}function Et(t,e){return{...t,description:"",descriptionHtml:"",images:{nodes:t.images.nodes.slice(0,Math.max(1,e))},variants:{nodes:t.variants.nodes.map(r=>({...r,image:null}))}}}function zt(t={}){let e=$t(t);if(!e.domain||!e.token)throw new y("createStorefront needs domain and token: pass them, or import.meta.env with PUBLIC_SHOPIFY_DOMAIN and PUBLIC_SHOPIFY_STOREFRONT_TOKEN",{code:"NOT_CONFIGURED"});let r=Y(e,e.pageSize),a={productPath:e.productPath,siteUrl:e.siteUrl};function c(n,{card:l=!1,images:p=vt}={}){let i=(Array.isArray(n)?n:[n]).filter(s=>s!=null),o={v:wt,at:new Date().toISOString(),country:e.country||null,language:e.language||null,products:l?i.map(s=>Et(s,p)):i};return`<script type="application/json" data-tether-hydrate>${R(o)}<\/script>`}function u(n,l={}){return n?`<script type="application/ld+json">${R(N(n,l,a))}<\/script>`:""}function d(n,l={}){return z(n,{defaultPurchase:e.defaultPurchase,lowStock:e.lowStock,...l})}return{config:e,query:(n,l,p)=>_(e,n,l,p),...r,hydrate:c,formatMoney:(n,l=e.locale)=>x(n,l),formatPercent:(n,l=e.locale)=>D(n,l),imageUrl:L,jsonLd:u,jsonLdData:(n,l={})=>N(n,l,a),initialState:d,productUrl:(n,l={})=>bt(n,{productPath:e.productPath,...l}),plans:q}}export{y as TetherError,zt as createStorefront,x as formatMoney,D as formatPercent,L as imageUrl,z as initialState,q as plans,C as productKey,bt as productUrl,ot as withContext};
@@ -27,11 +27,11 @@
27
27
 
28
28
  // tether-core:dom.ts
29
29
  var m2 = window.Tether.__core["dom.ts"];
30
- var [ANALYTICS_EVENTS, attr, attributesFromJson, busy, emit, formatDate, formatMoney, get, has, hasTemplate, isOwnEvent, notifyLayoutChanged, parseJSONAttr, productUrl, qsa, repeat, scoped, sel, setImage, setStoreHtml, setText, show] = m2;
30
+ var [ANALYTICS_EVENTS, attr, attributesFromJson, busy, emit, formatDate, formatMoney, get, has, hasTemplate, integerAttribute, isOwnEvent, notifyLayoutChanged, parseJSONAttr, productUrl, qsa, repeat, scoped, sel, setImage, setStoreHtml, setText, show] = m2;
31
31
 
32
32
  // tether-core:client.ts
33
33
  var m3 = window.Tether.__core["client.ts"];
34
- var [endpoint, gql, matches, orNull, shaped, TetherError] = m3;
34
+ var [endpoint, gql, matches, orNull, shaped, TetherError, withTimeout] = m3;
35
35
 
36
36
  // server/src/shared/account-routes.ts
37
37
  var OPERATION_ROUTES = {
@@ -318,7 +318,7 @@
318
318
 
319
319
  // tether-core:shopify-values.ts
320
320
  var m4 = window.Tether.__core["shopify-values.ts"];
321
- var [isHttpsUrl] = m4;
321
+ var [isHttpsUrl, MAX_CONNECTION_SIZE] = m4;
322
322
 
323
323
  // src/account/markup.ts
324
324
  function showIn(root, name, conditions) {
@@ -1 +1 @@
1
- (()=>{var De=Object.defineProperty;var Me=(e,t)=>{for(var n in t)De(e,n,{get:t[n],enumerable:!0})};var oe={};Me(oe,{addresses:()=>G,deleteAddress:()=>V,order:()=>j,renderPages:()=>bt,requestReturn:()=>K,saveAddress:()=>H,setup:()=>Te,showUnavailable:()=>wt,subscriptionAction:()=>J,subscriptions:()=>Z,updateProfile:()=>z});var qe=window.Tether.__core["config.ts"],[Tt,Ot,Et,St,Lt,T,Pt]=qe;var ve=window.Tether.__core["dom.ts"],[It,h,Rt,Ct,ue,P,b,p,Nt,Dt,Mt,qt,vt,Ht,l,A,Ft,u,_,Ut,y,B]=ve;var He=window.Tether.__core["client.ts"],[Bt,$t,jt,zt,Gt,C]=He;var de={order:{name:"order",method:"GET",path:"/order",fields:{id:!0}},addresses:{name:"addresses",method:"GET",path:"/addresses",fields:{}},subscriptions:{name:"subscriptions",method:"GET",path:"/subscriptions",fields:{}},profile:{name:"profile",method:"POST",path:"/profile",fields:{firstName:!0,lastName:!0}},saveAddress:{name:"saveAddress",method:"POST",path:"/address",fields:{id:!0,address:!0,isDefault:!0}},deleteAddress:{name:"deleteAddress",method:"POST",path:"/address/delete",fields:{id:!0}},subscription:{name:"subscription",method:"POST",path:"/subscription",fields:{id:!0,action:!0}},requestReturn:{name:"requestReturn",method:"POST",path:"/return",fields:{orderId:!0,lines:!0}}},Zt=new Map(Object.values(de).map(e=>[`${e.method} ${e.path}`,{...e,fields:Object.keys(e.fields)}]));function le(e,t){let n=de[e];if(n.method==="POST")return{method:"POST",path:n.path};let r=t,s=new URLSearchParams;for(let d of Object.keys(n.fields)){let c=r[d];(typeof c=="string"||typeof c=="number")&&s.set(d,String(c))}let o=s.toString();return{method:"GET",path:o?`${n.path}?${o}`:n.path}}function g(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function i(e,t){return g(e)?e[t]:void 0}function ce(e){return Array.isArray(e)?e:[]}function a(e){return typeof e=="string"&&e!==""?e:null}var $=e=>typeof e=="number"&&Number.isFinite(e)?e:null,N=e=>$(e)??0,k=(e,t)=>ce(e).map(n=>t(n)),x=(e,t)=>({nodes:k(i(e,"nodes"),t)}),W=e=>k(e,a).filter(t=>t!==null);function I(e){let t=a(i(e,"amount")),n=a(i(e,"currencyCode"));return t===null||n===null?null:{amount:t,currencyCode:n}}function X(e){let t=a(i(e,"url"));return t===null?null:{url:t,altText:a(i(e,"altText"))}}var me=e=>({title:a(i(e,"title")),variantTitle:a(i(e,"variantTitle")),quantity:N(i(e,"quantity")),image:X(i(e,"image"))});var ee=e=>new C(`Customer accounts: the answer has no ${e}`);function O(e,t){let n=a(e);if(!n)throw ee(t);return n}function fe(e){let t=n=>a(i(e,n));return{id:t("id"),firstName:t("firstName"),lastName:t("lastName"),company:t("company"),address1:t("address1"),address2:t("address2"),city:t("city"),province:t("province"),zoneCode:t("zoneCode"),zip:t("zip"),country:t("country"),countryCode:t("countryCode"),phoneNumber:t("phoneNumber"),formatted:W(i(e,"formatted"))}}var pe=e=>g(e)?fe(e):null,te=e=>({...fe(e),id:O(i(e,"id"),"address id")}),ge=e=>k(e,t=>({...te(t),isDefault:i(t,"isDefault")===!0})),Fe=e=>({...me(e),id:O(i(e,"id"),"line item id"),name:a(i(e,"name")),sku:a(i(e,"sku")),price:I(i(e,"price")),totalPrice:I(i(e,"totalPrice")),suggestedReturnReasonDefinitions:x(i(e,"suggestedReturnReasonDefinitions"),t=>({id:O(i(t,"id"),"return reason id"),name:a(i(t,"name")),handle:a(i(t,"handle"))}))}),Ue=e=>({id:a(i(e,"id")),status:a(i(e,"status")),createdAt:a(i(e,"createdAt")),estimatedDeliveryAt:a(i(e,"estimatedDeliveryAt")),latestShipmentStatus:a(i(e,"latestShipmentStatus")),trackingInformation:k(i(e,"trackingInformation"),t=>({company:a(i(t,"company")),number:a(i(t,"number")),url:a(i(t,"url"))}))});function _e(e){let t=a(i(i(e,"lineItem"),"id"));return{quantity:N(i(e,"quantity")),lineItem:t===null?null:{id:t}}}function Be(e){return g(e)?{returnableLineItems:x(e.returnableLineItems,_e)}:null}function ye(e){if(!g(e))return null;let t=s=>a(e[s]),n=s=>I(e[s]),r=e.requiresShipping;return{id:O(e.id,"order id"),name:t("name"),number:$(e.number),processedAt:t("processedAt"),cancelledAt:t("cancelledAt"),financialStatus:t("financialStatus"),fulfillmentStatus:t("fulfillmentStatus"),statusPageUrl:t("statusPageUrl"),requiresShipping:typeof r=="boolean"?r:null,totalPrice:n("totalPrice"),subtotal:n("subtotal"),totalShipping:n("totalShipping"),totalTax:n("totalTax"),shippingAddress:pe(e.shippingAddress),billingAddress:pe(e.billingAddress),lineItems:x(e.lineItems,Fe),fulfillments:x(e.fulfillments,Ue),returnInformation:Be(e.returnInformation),returns:x(e.returns,ne)}}var $e=e=>({id:a(i(e,"id")),name:a(i(e,"name")),title:a(i(e,"title")),variantTitle:a(i(e,"variantTitle")),quantity:N(i(e,"quantity")),sku:a(i(e,"sku")),currentPrice:I(i(e,"currentPrice")),lineDiscountedPrice:I(i(e,"lineDiscountedPrice")),image:X(i(e,"image"))}),he=e=>({cycleIndex:$(i(e,"cycleIndex")),skipped:i(e,"skipped")===!0,billingAttemptExpectedDate:a(i(e,"billingAttemptExpectedDate"))});function je(e){if(!g(e))return null;let t=e.intervalCount;return{interval:a(e.interval),intervalCount:g(t)?{count:N(t.count)}:null}}var ze=e=>({id:O(i(e,"id"),"subscription id"),status:a(i(e,"status")),nextBillingDate:a(i(e,"nextBillingDate")),currencyCode:a(i(e,"currencyCode")),deliveryPrice:I(i(e,"deliveryPrice")),deliveryPolicy:je(i(e,"deliveryPolicy")),lines:x(i(e,"lines"),$e),upcomingBillingCycles:x(i(e,"upcomingBillingCycles"),he)}),be=e=>k(e,ze);function we(e){let{contract:t,billingCycle:n}=e;if(g(t))return{contract:{id:a(t.id),status:a(t.status)}};if(g(n)){let{cycleIndex:r,skipped:s}=he(n);return{billingCycle:{cycleIndex:r,skipped:s}}}throw ee("changed subscription")}function ne(e){return{id:O(i(e,"id"),"return id"),status:a(i(e,"status"))}}var Ae=e=>O(e,"deleted address id"),xe=e=>({firstName:a(i(e,"firstName")),lastName:a(i(e,"lastName"))});var re=null;function Te(e){re=e}function D(){if(!re)throw new Error("account-pages: loaded without the account part");return re}async function E(e,t){let{serverFetch:n}=D(),{method:r,path:s}=le(e,t),o=await n(s,r==="POST"?{method:r,body:t}:{});if(o.kind==="logged-out")throw new C("Not logged in",{code:"NOT_LOGGED_IN",status:401});return o.data}function v(e){D().reset(),ue("account-updated",{what:e})}async function j(e){let t=await E("order",{id:e});return ye(t.order)}async function z({firstName:e,lastName:t}={}){let n=await E("profile",{firstName:e,lastName:t});return v("profile"),xe(n.customer)}async function G(){let e=await E("addresses",{});return ge(e.addresses)}async function H(e,{id:t,isDefault:n}={}){let r=await E("saveAddress",{id:t,address:e,isDefault:n});return v("addresses"),te(r.address)}async function V(e){let t=await E("deleteAddress",{id:e});return v("addresses"),Ae(t.deleted)}async function Z(){let e=await E("subscriptions",{});return be(e.subscriptions)}async function J(e,t){let n=await E("subscription",{id:e,action:t});return v("subscriptions"),we(n)}async function K(e,t){let n=await E("requestReturn",{orderId:e,lines:t});return v("orders"),ne(n.return)}var Ge=window.Tether.__core["shopify-values.ts"],[se]=Ge;function m(e,t,n){l(e,u(t)).forEach(r=>{let s=p(r,t)??"";Object.hasOwn(n,s)&&B(r,n[s]===!0)})}var S=(e,t)=>l(e,u(t)).concat(e.matches(u(t))?[e]:[]),L=e=>e?e.toLowerCase().replace(/_/g," "):"",F=e=>(e?.formatted??[]).join(", "),w=(e,t)=>Object.hasOwn(e,t)?e[t]:void 0;var Ve=(e,t)=>({title:e.title||e.name||"","variant-title":e.variantTitle||"",quantity:String(e.quantity),price:b(e.price),total:b(e.totalPrice),sku:e.sku||"",returnable:t===null?void 0:String(t)}),Ze=e=>e.tagName==="INPUT";function Je(e,t,n){m(e,"order-line-show",{returnable:n>0}),l(e,u("return-quantity")).forEach(r=>{Ze(r)&&(r.max=String(n),r.min="0",r.value||(r.value="0"),r.disabled=n<1)}),l(e,`select${u("return-reason")}`).forEach(r=>{r.dataset.tetherFilled!==t.id&&(r.dataset.tetherFilled=t.id,(t.suggestedReturnReasonDefinitions?.nodes??[]).forEach(s=>{r.appendChild(new Option(s.name??"",s.id))}))})}function Oe(e,t,n){A(e,t,(r,s)=>{let o=s.id,d=n&&o?n.get(o)??0:null;o&&(r.dataset.tetherLine=o);let c=Ve(s,d);S(r,"order-line").forEach(f=>{let R=p(f,"order-line")??"";if(R==="image"){s.image&&_(f,s.image.url,s.image.altText||s.title||"");return}let ae=w(c,R);ae!==void 0&&y(f,ae)}),o&&d!==null&&Je(r,{...s,id:o},d)})}function Ke(e){let t=p(e,"order")||"";return t.startsWith("url:")?new URL(window.location.href).searchParams.get(t.slice(4)||"id"):t}function U(e,t){e.setAttribute(h("order-state"),t),m(e,"order-show",{loading:t==="loading",ready:!1,"not-found":t==="not-found",error:t==="error"})}var Ye=e=>({name:e.name??"",date:P(e.processedAt),total:b(e.totalPrice),subtotal:b(e.subtotal),shipping:b(e.totalShipping),tax:b(e.totalTax),status:L(e.financialStatus),fulfillment:L(e.fulfillmentStatus),"shipping-address":F(e.shippingAddress),"billing-address":F(e.billingAddress),items:e.lineItems.nodes.map(t=>`${String(t.quantity)}\xD7 ${t.title||t.name||""}`).join(", "),cancelled:P(e.cancelledAt)});function Qe(e,t){let n=t.trackingInformation[0],r={status:L(t.latestShipmentStatus||t.status),date:P(t.createdAt),eta:P(t.estimatedDeliveryAt),company:n?.company||"",number:n?.number||""};S(e,"fulfillment-bind").forEach(s=>{let o=p(s,"fulfillment-bind")??"";if(o==="url"){let c=n?.url??null,f=c!==null&&se(c);f&&s.setAttribute("href",c),B(s,f);return}let d=w(r,o);d!==void 0&&y(s,d)})}function We(e,t){let n=new Map((t.returnInformation?.returnableLineItems.nodes??[]).map(d=>[d.lineItem?.id??"",d.quantity])),r=t.fulfillments.nodes,s=Ye(t);l(e,u("order-bind")).forEach(d=>{let c=p(d,"order-bind")??"";if(c==="url"){let R=t.statusPageUrl;R!==null&&se(R)&&d.setAttribute("href",R);return}let f=w(s,c);f!==void 0&&y(d,f)}),l(e,u("order-lines")).forEach(d=>{Oe(d,t.lineItems.nodes,n)}),l(e,u("order-fulfillments")).forEach(d=>{A(d,r,Qe)});let o=e.dataset.tetherReturned==="1";m(e,"order-show",{loading:!1,ready:!0,error:!1,"not-found":!1,cancelled:!!t.cancelledAt,shipped:r.length>0,returnable:[...n.values()].some(d=>d>0),"has-returns":!o&&t.returns.nodes.length>0,"return-requested":o}),e.setAttribute(h("order-state"),"ready")}async function Y(e){let t=Ke(e);if(!t){e.setAttribute(h("order-state"),"not-found"),m(e,"order-show",{"not-found":!0});return}U(e,"loading");let n;try{n=await j(t)}catch(r){T(r,"order"),U(e,"error");return}if(!n){U(e,"not-found");return}e.dataset.tetherOrderId=n.id,We(e,n)}var Ee=[],Se=e=>Ee.find(t=>t.id===e),Xe=e=>({formatted:F(e),name:[e.firstName,e.lastName].filter(Boolean).join(" "),company:e.company||"",address1:e.address1||"",address2:e.address2||"",city:e.city||"",zip:e.zip||"",province:e.province||"",country:e.country||"",phone:e.phoneNumber||""});function et(e,t){e.dataset.tetherAddress=t.id;let n=Xe(t);S(e,"address-bind").forEach(r=>{let s=w(n,p(r,"address-bind")??"");s!==void 0&&y(r,s)}),m(e,"address-show",{default:t.isDefault,"not-default":!t.isDefault})}async function M(e){let t=l(e,u("addresses"));if(!t.length)return;m(e,"show",{"addresses-loading":!0,"addresses-empty":!1});let n;try{n=await G()}catch(r){T(r,"addresses"),m(e,"show",{"addresses-loading":!1,"addresses-error":!0});return}Ee=n,m(e,"show",{"addresses-loading":!1,"addresses-empty":n.length===0,"addresses-error":!1}),t.forEach(r=>{A(r,n,et)})}function tt(e){let t=e.upcomingBillingCycles.nodes[0],n=e.status,r=n==="ACTIVE";return{active:r,paused:n==="PAUSED",cancelled:n==="CANCELLED",expired:n==="EXPIRED",failed:n==="FAILED",skipped:!!t?.skipped,"can-pause":r,"can-resume":n==="PAUSED"||n==="FAILED","can-skip":r&&t!==void 0&&!t.skipped,"can-unskip":r&&!!t?.skipped,"can-cancel":r||n==="PAUSED"||n==="FAILED"}}function nt(e){let t=L(e.deliveryPolicy?.interval);if(!t)return"";let n=e.deliveryPolicy?.intervalCount?.count??1;return n<=1?t:`${String(n)} ${t}s`}function rt(e){let t=e.lines.nodes,n=t.reduce((r,s)=>r+Number.parseFloat(s.lineDiscountedPrice?.amount??"0"),0);return{status:L(e.status),next:P(e.nextBillingDate),interval:nt(e),products:t.map(r=>`${String(r.quantity)}\xD7 ${r.title??""}`).join(", "),total:b(t.length&&e.currencyCode?{amount:String(n),currencyCode:e.currencyCode}:null),delivery:b(e.deliveryPrice)}}function st(e,t){let n={title:t.title??"","variant-title":t.variantTitle||"",quantity:String(t.quantity),price:b(t.currentPrice)};S(e,"subscription-line").forEach(r=>{let s=p(r,"subscription-line")??"";if(s==="image"){t.image&&_(r,t.image.url,t.image.altText||t.title||"");return}let o=w(n,s);o!==void 0&&y(r,o)})}function it(e,t){e.dataset.tetherSubscription=t.id,e.setAttribute(h("subscription-status"),L(t.status));let n=rt(t);l(e,u("subscription-bind")).forEach(s=>{let o=w(n,p(s,"subscription-bind")??"");o!==void 0&&y(s,o)}),l(e,u("subscription-lines")).forEach(s=>{A(s,t.lines.nodes,st)});let r=tt(t);m(e,"subscription-show",r),l(e,u("subscription-action")).forEach(s=>{let o=w(r,`can-${p(s,"subscription-action")??""}`)===!0;"disabled"in s&&(s.disabled=!o),s.classList.toggle("is-disabled",!o)})}async function Q(e){let t=l(e,u("subscriptions"));if(!t.length)return;m(e,"show",{"subscriptions-loading":!0,"subscriptions-empty":!1});let n;try{n=await Z()}catch(r){T(r,"subscriptions"),m(e,"show",{"subscriptions-loading":!1,"subscriptions-error":!0});return}m(e,"show",{"subscriptions-loading":!1,"subscriptions-empty":n.length===0,"subscriptions-error":!1}),t.forEach(r=>{A(r,n,it)})}var ot=["pause","resume","skip","unskip","cancel"],at=e=>ot.some(t=>t===e),Pe=e=>e instanceof window.HTMLInputElement||e instanceof window.HTMLSelectElement||e instanceof window.HTMLTextAreaElement,ke=e=>e instanceof window.HTMLFormElement;function Le(e){let t={};for(let n of e.elements)Pe(n)&&(!n.name||n.type==="submit"||n.type==="button"||n.type==="checkbox"||(t[n.name]=n.value));return t}function ut(e){let n=(e instanceof C?e.userErrors??[]:[]).map(s=>s.message).join(" ");return n||(e instanceof Error&&e.message?e.message:"Something went wrong").replace(/^Customer accounts: /,"")}async function q(e,t){if(e.getAttribute("aria-busy")==="true")return"busy";e.classList.add("is-busy"),e.setAttribute("aria-busy","true"),e.setAttribute(h("form-state"),"pending");let n=l(e,u("form-error"));n.forEach(r=>{y(r,"")});try{return await t(),e.setAttribute(h("form-state"),"saved"),"saved"}catch(r){return e.setAttribute(h("form-state"),"error"),n.forEach(s=>{y(s,ut(r))}),"error"}finally{e.classList.remove("is-busy"),e.removeAttribute("aria-busy")}}var ie=e=>{let t=p(e,"confirm");return!t||window.confirm(t)},Ie=e=>{e.reset(),delete e.dataset.tetherAddressId};function dt(e){let t=e.target;if(t instanceof window.HTMLFormElement){if(t.matches(u("profile-form")))e.preventDefault(),q(t,async()=>{await z(Le(t)),await D().bindCustomer(document)});else if(t.matches(u("address-form"))){e.preventDefault();let n=t.dataset.tetherAddressId,r=t.elements.namedItem("isDefault"),s=r instanceof window.HTMLInputElement&&r.checked;q(t,async()=>{await H(Le(t),{id:n,isDefault:s}),Ie(t),await M(document)})}}}function lt(e){let t=Se(e),n=document.querySelector(u("address-form"));if(!t||!n||!ke(n))return;n.dataset.tetherAddressId=t.id;let r={...t};for(let s of n.elements)if(Pe(s)){if(s.name==="isDefault")s instanceof window.HTMLInputElement&&(s.checked=t.isDefault);else if(s.name&&Object.hasOwn(r,s.name)){let o=r[s.name];s.value=typeof o=="string"?o:""}}n.scrollIntoView({block:"nearest"})}function ct(e,t){let n=t.closest("[data-tether-address]"),r=n instanceof window.HTMLElement?n.dataset.tetherAddress:void 0;if(t.closest(u("address-new"))){let o=document.querySelector(u("address-form"));return o&&ke(o)&&Ie(o),!0}if(!(n instanceof window.HTMLElement)||!r)return!1;let s=t.closest(u("address-delete"));if(s){if(e.preventDefault(),!ie(s))return!0;q(n,async()=>{await V(r),await M(document)})}else if(t.closest(u("address-default")))e.preventDefault(),q(n,async()=>{await H(null,{id:r,isDefault:!0}),await M(document)});else if(t.closest(u("address-edit")))e.preventDefault(),lt(r);else return!1;return!0}function mt(e){let t=e.closest("[data-tether-subscription]"),n=p(e,"subscription-action"),r="disabled"in e&&e.disabled===!0||e.classList.contains("is-disabled");if(!(t instanceof window.HTMLElement)||!at(n)||r||!ie(e))return;let s=t.dataset.tetherSubscription??"";t.setAttribute(h("subscription-state"),"pending"),q(t,async()=>{await J(s,n),await Q(document)}).then(o=>{let d=o==="error"?"error":"done";l(document,"[data-tether-subscription]").filter(c=>c===t||c.dataset.tetherSubscription===s).forEach(c=>{c.setAttribute(h("subscription-state"),d)})})}function pt(e){let t=e.querySelector(u("return-quantity")),n=e.querySelector(u("return-reason")),r=e.querySelector(u("return-note")),s=f=>f&&"value"in f&&typeof f.value=="string"?f.value:"",o={lineItemId:e.dataset.tetherLine??"",quantity:Number.parseInt(s(t)||"0",10)},d=s(n);d&&(o.reasonId=d);let c=s(r);return c&&(o.note=c),o}function ft(e){let t=e.closest(u("order"));if(!(t instanceof window.HTMLElement))return;let n=t.dataset.tetherOrderId;if(!n)return;let r=l(t,"[data-tether-line]").map(pt).filter(s=>s.quantity>0);!r.length||!ie(e)||q(t,async()=>{await K(n,r),t.dataset.tetherReturned="1",await Y(t)})}function gt(e){let t=e.target;if(!(t instanceof window.Element)||ct(e,t))return;let n=t.closest(u("subscription-action"));if(n instanceof window.HTMLElement){e.preventDefault(),mt(n);return}let r=t.closest(u("order-return"));r instanceof window.HTMLElement&&(e.preventDefault(),ft(r))}function Re(){document.addEventListener("submit",dt,!0),document.addEventListener("input",e=>{let t=e.target;t instanceof window.HTMLElement&&t.closest(u("profile-form"))&&(t.dataset.tetherTouched="1")}),document.addEventListener("click",gt)}var yt=["firstName","lastName"];async function ht(e){if(!(e instanceof window.HTMLFormElement))return;let t;try{t=await D().customer()}catch(r){T(r,"account");return}if(!t)return;let n=e.elements;yt.forEach(r=>{let s=n.namedItem(r);(s instanceof window.HTMLInputElement||s instanceof window.HTMLTextAreaElement)&&!s.dataset.tetherTouched&&(s.value=t[r]??"")})}var Ce=!1;async function bt(e=document){Ce||(Ce=!0,Re()),await Promise.all([...l(e,u("order")).map(t=>Y(t)),...l(e,u("profile-form")).map(t=>ht(t)),M(e),Q(e)])}function wt(e){l(e,u("order")).forEach(t=>{U(t,"error")}),m(e,"show",{"addresses-loading":!1,"addresses-error":!0,"subscriptions-loading":!1,"subscriptions-error":!0})}function At(e){return g(e)&&g(e.__core)&&g(e.__parts)}function Ne(e,t){let n=Reflect.get(window,"Tether");if(!At(n))throw new Error(`tether.${e}.js runs after the Tether script, which loads it, and needs its window.Tether`);n.__parts[e]=t}Ne("account-pages",oe);})();
1
+ (()=>{var De=Object.defineProperty;var Me=(e,t)=>{for(var n in t)De(e,n,{get:t[n],enumerable:!0})};var oe={};Me(oe,{addresses:()=>G,deleteAddress:()=>V,order:()=>j,renderPages:()=>bt,requestReturn:()=>K,saveAddress:()=>H,setup:()=>Te,showUnavailable:()=>wt,subscriptionAction:()=>J,subscriptions:()=>Z,updateProfile:()=>z});var qe=window.Tether.__core["config.ts"],[Tt,Ot,Et,St,Lt,T,Pt]=qe;var ve=window.Tether.__core["dom.ts"],[It,h,Ct,Rt,ue,P,b,p,Nt,Dt,Mt,qt,vt,Ht,Ft,l,A,Ut,u,_,_t,y,B]=ve;var He=window.Tether.__core["client.ts"],[$t,jt,zt,Gt,Vt,R,Zt]=He;var de={order:{name:"order",method:"GET",path:"/order",fields:{id:!0}},addresses:{name:"addresses",method:"GET",path:"/addresses",fields:{}},subscriptions:{name:"subscriptions",method:"GET",path:"/subscriptions",fields:{}},profile:{name:"profile",method:"POST",path:"/profile",fields:{firstName:!0,lastName:!0}},saveAddress:{name:"saveAddress",method:"POST",path:"/address",fields:{id:!0,address:!0,isDefault:!0}},deleteAddress:{name:"deleteAddress",method:"POST",path:"/address/delete",fields:{id:!0}},subscription:{name:"subscription",method:"POST",path:"/subscription",fields:{id:!0,action:!0}},requestReturn:{name:"requestReturn",method:"POST",path:"/return",fields:{orderId:!0,lines:!0}}},Kt=new Map(Object.values(de).map(e=>[`${e.method} ${e.path}`,{...e,fields:Object.keys(e.fields)}]));function le(e,t){let n=de[e];if(n.method==="POST")return{method:"POST",path:n.path};let r=t,s=new URLSearchParams;for(let d of Object.keys(n.fields)){let c=r[d];(typeof c=="string"||typeof c=="number")&&s.set(d,String(c))}let o=s.toString();return{method:"GET",path:o?`${n.path}?${o}`:n.path}}function g(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function i(e,t){return g(e)?e[t]:void 0}function ce(e){return Array.isArray(e)?e:[]}function a(e){return typeof e=="string"&&e!==""?e:null}var $=e=>typeof e=="number"&&Number.isFinite(e)?e:null,N=e=>$(e)??0,k=(e,t)=>ce(e).map(n=>t(n)),x=(e,t)=>({nodes:k(i(e,"nodes"),t)}),Q=e=>k(e,a).filter(t=>t!==null);function I(e){let t=a(i(e,"amount")),n=a(i(e,"currencyCode"));return t===null||n===null?null:{amount:t,currencyCode:n}}function W(e){let t=a(i(e,"url"));return t===null?null:{url:t,altText:a(i(e,"altText"))}}var me=e=>({title:a(i(e,"title")),variantTitle:a(i(e,"variantTitle")),quantity:N(i(e,"quantity")),image:W(i(e,"image"))});var ee=e=>new R(`Customer accounts: the answer has no ${e}`);function O(e,t){let n=a(e);if(!n)throw ee(t);return n}function fe(e){let t=n=>a(i(e,n));return{id:t("id"),firstName:t("firstName"),lastName:t("lastName"),company:t("company"),address1:t("address1"),address2:t("address2"),city:t("city"),province:t("province"),zoneCode:t("zoneCode"),zip:t("zip"),country:t("country"),countryCode:t("countryCode"),phoneNumber:t("phoneNumber"),formatted:Q(i(e,"formatted"))}}var pe=e=>g(e)?fe(e):null,te=e=>({...fe(e),id:O(i(e,"id"),"address id")}),ge=e=>k(e,t=>({...te(t),isDefault:i(t,"isDefault")===!0})),Fe=e=>({...me(e),id:O(i(e,"id"),"line item id"),name:a(i(e,"name")),sku:a(i(e,"sku")),price:I(i(e,"price")),totalPrice:I(i(e,"totalPrice")),suggestedReturnReasonDefinitions:x(i(e,"suggestedReturnReasonDefinitions"),t=>({id:O(i(t,"id"),"return reason id"),name:a(i(t,"name")),handle:a(i(t,"handle"))}))}),Ue=e=>({id:a(i(e,"id")),status:a(i(e,"status")),createdAt:a(i(e,"createdAt")),estimatedDeliveryAt:a(i(e,"estimatedDeliveryAt")),latestShipmentStatus:a(i(e,"latestShipmentStatus")),trackingInformation:k(i(e,"trackingInformation"),t=>({company:a(i(t,"company")),number:a(i(t,"number")),url:a(i(t,"url"))}))});function _e(e){let t=a(i(i(e,"lineItem"),"id"));return{quantity:N(i(e,"quantity")),lineItem:t===null?null:{id:t}}}function Be(e){return g(e)?{returnableLineItems:x(e.returnableLineItems,_e)}:null}function ye(e){if(!g(e))return null;let t=s=>a(e[s]),n=s=>I(e[s]),r=e.requiresShipping;return{id:O(e.id,"order id"),name:t("name"),number:$(e.number),processedAt:t("processedAt"),cancelledAt:t("cancelledAt"),financialStatus:t("financialStatus"),fulfillmentStatus:t("fulfillmentStatus"),statusPageUrl:t("statusPageUrl"),requiresShipping:typeof r=="boolean"?r:null,totalPrice:n("totalPrice"),subtotal:n("subtotal"),totalShipping:n("totalShipping"),totalTax:n("totalTax"),shippingAddress:pe(e.shippingAddress),billingAddress:pe(e.billingAddress),lineItems:x(e.lineItems,Fe),fulfillments:x(e.fulfillments,Ue),returnInformation:Be(e.returnInformation),returns:x(e.returns,ne)}}var $e=e=>({id:a(i(e,"id")),name:a(i(e,"name")),title:a(i(e,"title")),variantTitle:a(i(e,"variantTitle")),quantity:N(i(e,"quantity")),sku:a(i(e,"sku")),currentPrice:I(i(e,"currentPrice")),lineDiscountedPrice:I(i(e,"lineDiscountedPrice")),image:W(i(e,"image"))}),he=e=>({cycleIndex:$(i(e,"cycleIndex")),skipped:i(e,"skipped")===!0,billingAttemptExpectedDate:a(i(e,"billingAttemptExpectedDate"))});function je(e){if(!g(e))return null;let t=e.intervalCount;return{interval:a(e.interval),intervalCount:g(t)?{count:N(t.count)}:null}}var ze=e=>({id:O(i(e,"id"),"subscription id"),status:a(i(e,"status")),nextBillingDate:a(i(e,"nextBillingDate")),currencyCode:a(i(e,"currencyCode")),deliveryPrice:I(i(e,"deliveryPrice")),deliveryPolicy:je(i(e,"deliveryPolicy")),lines:x(i(e,"lines"),$e),upcomingBillingCycles:x(i(e,"upcomingBillingCycles"),he)}),be=e=>k(e,ze);function we(e){let{contract:t,billingCycle:n}=e;if(g(t))return{contract:{id:a(t.id),status:a(t.status)}};if(g(n)){let{cycleIndex:r,skipped:s}=he(n);return{billingCycle:{cycleIndex:r,skipped:s}}}throw ee("changed subscription")}function ne(e){return{id:O(i(e,"id"),"return id"),status:a(i(e,"status"))}}var Ae=e=>O(e,"deleted address id"),xe=e=>({firstName:a(i(e,"firstName")),lastName:a(i(e,"lastName"))});var re=null;function Te(e){re=e}function D(){if(!re)throw new Error("account-pages: loaded without the account part");return re}async function E(e,t){let{serverFetch:n}=D(),{method:r,path:s}=le(e,t),o=await n(s,r==="POST"?{method:r,body:t}:{});if(o.kind==="logged-out")throw new R("Not logged in",{code:"NOT_LOGGED_IN",status:401});return o.data}function v(e){D().reset(),ue("account-updated",{what:e})}async function j(e){let t=await E("order",{id:e});return ye(t.order)}async function z({firstName:e,lastName:t}={}){let n=await E("profile",{firstName:e,lastName:t});return v("profile"),xe(n.customer)}async function G(){let e=await E("addresses",{});return ge(e.addresses)}async function H(e,{id:t,isDefault:n}={}){let r=await E("saveAddress",{id:t,address:e,isDefault:n});return v("addresses"),te(r.address)}async function V(e){let t=await E("deleteAddress",{id:e});return v("addresses"),Ae(t.deleted)}async function Z(){let e=await E("subscriptions",{});return be(e.subscriptions)}async function J(e,t){let n=await E("subscription",{id:e,action:t});return v("subscriptions"),we(n)}async function K(e,t){let n=await E("requestReturn",{orderId:e,lines:t});return v("orders"),ne(n.return)}var Ge=window.Tether.__core["shopify-values.ts"],[se,gn]=Ge;function m(e,t,n){l(e,u(t)).forEach(r=>{let s=p(r,t)??"";Object.hasOwn(n,s)&&B(r,n[s]===!0)})}var S=(e,t)=>l(e,u(t)).concat(e.matches(u(t))?[e]:[]),L=e=>e?e.toLowerCase().replace(/_/g," "):"",F=e=>(e?.formatted??[]).join(", "),w=(e,t)=>Object.hasOwn(e,t)?e[t]:void 0;var Ve=(e,t)=>({title:e.title||e.name||"","variant-title":e.variantTitle||"",quantity:String(e.quantity),price:b(e.price),total:b(e.totalPrice),sku:e.sku||"",returnable:t===null?void 0:String(t)}),Ze=e=>e.tagName==="INPUT";function Je(e,t,n){m(e,"order-line-show",{returnable:n>0}),l(e,u("return-quantity")).forEach(r=>{Ze(r)&&(r.max=String(n),r.min="0",r.value||(r.value="0"),r.disabled=n<1)}),l(e,`select${u("return-reason")}`).forEach(r=>{r.dataset.tetherFilled!==t.id&&(r.dataset.tetherFilled=t.id,(t.suggestedReturnReasonDefinitions?.nodes??[]).forEach(s=>{r.appendChild(new Option(s.name??"",s.id))}))})}function Oe(e,t,n){A(e,t,(r,s)=>{let o=s.id,d=n&&o?n.get(o)??0:null;o&&(r.dataset.tetherLine=o);let c=Ve(s,d);S(r,"order-line").forEach(f=>{let C=p(f,"order-line")??"";if(C==="image"){s.image&&_(f,s.image.url,s.image.altText||s.title||"");return}let ae=w(c,C);ae!==void 0&&y(f,ae)}),o&&d!==null&&Je(r,{...s,id:o},d)})}function Ke(e){let t=p(e,"order")||"";return t.startsWith("url:")?new URL(window.location.href).searchParams.get(t.slice(4)||"id"):t}function U(e,t){e.setAttribute(h("order-state"),t),m(e,"order-show",{loading:t==="loading",ready:!1,"not-found":t==="not-found",error:t==="error"})}var Xe=e=>({name:e.name??"",date:P(e.processedAt),total:b(e.totalPrice),subtotal:b(e.subtotal),shipping:b(e.totalShipping),tax:b(e.totalTax),status:L(e.financialStatus),fulfillment:L(e.fulfillmentStatus),"shipping-address":F(e.shippingAddress),"billing-address":F(e.billingAddress),items:e.lineItems.nodes.map(t=>`${String(t.quantity)}\xD7 ${t.title||t.name||""}`).join(", "),cancelled:P(e.cancelledAt)});function Ye(e,t){let n=t.trackingInformation[0],r={status:L(t.latestShipmentStatus||t.status),date:P(t.createdAt),eta:P(t.estimatedDeliveryAt),company:n?.company||"",number:n?.number||""};S(e,"fulfillment-bind").forEach(s=>{let o=p(s,"fulfillment-bind")??"";if(o==="url"){let c=n?.url??null,f=c!==null&&se(c);f&&s.setAttribute("href",c),B(s,f);return}let d=w(r,o);d!==void 0&&y(s,d)})}function Qe(e,t){let n=new Map((t.returnInformation?.returnableLineItems.nodes??[]).map(d=>[d.lineItem?.id??"",d.quantity])),r=t.fulfillments.nodes,s=Xe(t);l(e,u("order-bind")).forEach(d=>{let c=p(d,"order-bind")??"";if(c==="url"){let C=t.statusPageUrl;C!==null&&se(C)&&d.setAttribute("href",C);return}let f=w(s,c);f!==void 0&&y(d,f)}),l(e,u("order-lines")).forEach(d=>{Oe(d,t.lineItems.nodes,n)}),l(e,u("order-fulfillments")).forEach(d=>{A(d,r,Ye)});let o=e.dataset.tetherReturned==="1";m(e,"order-show",{loading:!1,ready:!0,error:!1,"not-found":!1,cancelled:!!t.cancelledAt,shipped:r.length>0,returnable:[...n.values()].some(d=>d>0),"has-returns":!o&&t.returns.nodes.length>0,"return-requested":o}),e.setAttribute(h("order-state"),"ready")}async function X(e){let t=Ke(e);if(!t){e.setAttribute(h("order-state"),"not-found"),m(e,"order-show",{"not-found":!0});return}U(e,"loading");let n;try{n=await j(t)}catch(r){T(r,"order"),U(e,"error");return}if(!n){U(e,"not-found");return}e.dataset.tetherOrderId=n.id,Qe(e,n)}var Ee=[],Se=e=>Ee.find(t=>t.id===e),We=e=>({formatted:F(e),name:[e.firstName,e.lastName].filter(Boolean).join(" "),company:e.company||"",address1:e.address1||"",address2:e.address2||"",city:e.city||"",zip:e.zip||"",province:e.province||"",country:e.country||"",phone:e.phoneNumber||""});function et(e,t){e.dataset.tetherAddress=t.id;let n=We(t);S(e,"address-bind").forEach(r=>{let s=w(n,p(r,"address-bind")??"");s!==void 0&&y(r,s)}),m(e,"address-show",{default:t.isDefault,"not-default":!t.isDefault})}async function M(e){let t=l(e,u("addresses"));if(!t.length)return;m(e,"show",{"addresses-loading":!0,"addresses-empty":!1});let n;try{n=await G()}catch(r){T(r,"addresses"),m(e,"show",{"addresses-loading":!1,"addresses-error":!0});return}Ee=n,m(e,"show",{"addresses-loading":!1,"addresses-empty":n.length===0,"addresses-error":!1}),t.forEach(r=>{A(r,n,et)})}function tt(e){let t=e.upcomingBillingCycles.nodes[0],n=e.status,r=n==="ACTIVE";return{active:r,paused:n==="PAUSED",cancelled:n==="CANCELLED",expired:n==="EXPIRED",failed:n==="FAILED",skipped:!!t?.skipped,"can-pause":r,"can-resume":n==="PAUSED"||n==="FAILED","can-skip":r&&t!==void 0&&!t.skipped,"can-unskip":r&&!!t?.skipped,"can-cancel":r||n==="PAUSED"||n==="FAILED"}}function nt(e){let t=L(e.deliveryPolicy?.interval);if(!t)return"";let n=e.deliveryPolicy?.intervalCount?.count??1;return n<=1?t:`${String(n)} ${t}s`}function rt(e){let t=e.lines.nodes,n=t.reduce((r,s)=>r+Number.parseFloat(s.lineDiscountedPrice?.amount??"0"),0);return{status:L(e.status),next:P(e.nextBillingDate),interval:nt(e),products:t.map(r=>`${String(r.quantity)}\xD7 ${r.title??""}`).join(", "),total:b(t.length&&e.currencyCode?{amount:String(n),currencyCode:e.currencyCode}:null),delivery:b(e.deliveryPrice)}}function st(e,t){let n={title:t.title??"","variant-title":t.variantTitle||"",quantity:String(t.quantity),price:b(t.currentPrice)};S(e,"subscription-line").forEach(r=>{let s=p(r,"subscription-line")??"";if(s==="image"){t.image&&_(r,t.image.url,t.image.altText||t.title||"");return}let o=w(n,s);o!==void 0&&y(r,o)})}function it(e,t){e.dataset.tetherSubscription=t.id,e.setAttribute(h("subscription-status"),L(t.status));let n=rt(t);l(e,u("subscription-bind")).forEach(s=>{let o=w(n,p(s,"subscription-bind")??"");o!==void 0&&y(s,o)}),l(e,u("subscription-lines")).forEach(s=>{A(s,t.lines.nodes,st)});let r=tt(t);m(e,"subscription-show",r),l(e,u("subscription-action")).forEach(s=>{let o=w(r,`can-${p(s,"subscription-action")??""}`)===!0;"disabled"in s&&(s.disabled=!o),s.classList.toggle("is-disabled",!o)})}async function Y(e){let t=l(e,u("subscriptions"));if(!t.length)return;m(e,"show",{"subscriptions-loading":!0,"subscriptions-empty":!1});let n;try{n=await Z()}catch(r){T(r,"subscriptions"),m(e,"show",{"subscriptions-loading":!1,"subscriptions-error":!0});return}m(e,"show",{"subscriptions-loading":!1,"subscriptions-empty":n.length===0,"subscriptions-error":!1}),t.forEach(r=>{A(r,n,it)})}var ot=["pause","resume","skip","unskip","cancel"],at=e=>ot.some(t=>t===e),Pe=e=>e instanceof window.HTMLInputElement||e instanceof window.HTMLSelectElement||e instanceof window.HTMLTextAreaElement,ke=e=>e instanceof window.HTMLFormElement;function Le(e){let t={};for(let n of e.elements)Pe(n)&&(!n.name||n.type==="submit"||n.type==="button"||n.type==="checkbox"||(t[n.name]=n.value));return t}function ut(e){let n=(e instanceof R?e.userErrors??[]:[]).map(s=>s.message).join(" ");return n||(e instanceof Error&&e.message?e.message:"Something went wrong").replace(/^Customer accounts: /,"")}async function q(e,t){if(e.getAttribute("aria-busy")==="true")return"busy";e.classList.add("is-busy"),e.setAttribute("aria-busy","true"),e.setAttribute(h("form-state"),"pending");let n=l(e,u("form-error"));n.forEach(r=>{y(r,"")});try{return await t(),e.setAttribute(h("form-state"),"saved"),"saved"}catch(r){return e.setAttribute(h("form-state"),"error"),n.forEach(s=>{y(s,ut(r))}),"error"}finally{e.classList.remove("is-busy"),e.removeAttribute("aria-busy")}}var ie=e=>{let t=p(e,"confirm");return!t||window.confirm(t)},Ie=e=>{e.reset(),delete e.dataset.tetherAddressId};function dt(e){let t=e.target;if(t instanceof window.HTMLFormElement){if(t.matches(u("profile-form")))e.preventDefault(),q(t,async()=>{await z(Le(t)),await D().bindCustomer(document)});else if(t.matches(u("address-form"))){e.preventDefault();let n=t.dataset.tetherAddressId,r=t.elements.namedItem("isDefault"),s=r instanceof window.HTMLInputElement&&r.checked;q(t,async()=>{await H(Le(t),{id:n,isDefault:s}),Ie(t),await M(document)})}}}function lt(e){let t=Se(e),n=document.querySelector(u("address-form"));if(!t||!n||!ke(n))return;n.dataset.tetherAddressId=t.id;let r={...t};for(let s of n.elements)if(Pe(s)){if(s.name==="isDefault")s instanceof window.HTMLInputElement&&(s.checked=t.isDefault);else if(s.name&&Object.hasOwn(r,s.name)){let o=r[s.name];s.value=typeof o=="string"?o:""}}n.scrollIntoView({block:"nearest"})}function ct(e,t){let n=t.closest("[data-tether-address]"),r=n instanceof window.HTMLElement?n.dataset.tetherAddress:void 0;if(t.closest(u("address-new"))){let o=document.querySelector(u("address-form"));return o&&ke(o)&&Ie(o),!0}if(!(n instanceof window.HTMLElement)||!r)return!1;let s=t.closest(u("address-delete"));if(s){if(e.preventDefault(),!ie(s))return!0;q(n,async()=>{await V(r),await M(document)})}else if(t.closest(u("address-default")))e.preventDefault(),q(n,async()=>{await H(null,{id:r,isDefault:!0}),await M(document)});else if(t.closest(u("address-edit")))e.preventDefault(),lt(r);else return!1;return!0}function mt(e){let t=e.closest("[data-tether-subscription]"),n=p(e,"subscription-action"),r="disabled"in e&&e.disabled===!0||e.classList.contains("is-disabled");if(!(t instanceof window.HTMLElement)||!at(n)||r||!ie(e))return;let s=t.dataset.tetherSubscription??"";t.setAttribute(h("subscription-state"),"pending"),q(t,async()=>{await J(s,n),await Y(document)}).then(o=>{let d=o==="error"?"error":"done";l(document,"[data-tether-subscription]").filter(c=>c===t||c.dataset.tetherSubscription===s).forEach(c=>{c.setAttribute(h("subscription-state"),d)})})}function pt(e){let t=e.querySelector(u("return-quantity")),n=e.querySelector(u("return-reason")),r=e.querySelector(u("return-note")),s=f=>f&&"value"in f&&typeof f.value=="string"?f.value:"",o={lineItemId:e.dataset.tetherLine??"",quantity:Number.parseInt(s(t)||"0",10)},d=s(n);d&&(o.reasonId=d);let c=s(r);return c&&(o.note=c),o}function ft(e){let t=e.closest(u("order"));if(!(t instanceof window.HTMLElement))return;let n=t.dataset.tetherOrderId;if(!n)return;let r=l(t,"[data-tether-line]").map(pt).filter(s=>s.quantity>0);!r.length||!ie(e)||q(t,async()=>{await K(n,r),t.dataset.tetherReturned="1",await X(t)})}function gt(e){let t=e.target;if(!(t instanceof window.Element)||ct(e,t))return;let n=t.closest(u("subscription-action"));if(n instanceof window.HTMLElement){e.preventDefault(),mt(n);return}let r=t.closest(u("order-return"));r instanceof window.HTMLElement&&(e.preventDefault(),ft(r))}function Ce(){document.addEventListener("submit",dt,!0),document.addEventListener("input",e=>{let t=e.target;t instanceof window.HTMLElement&&t.closest(u("profile-form"))&&(t.dataset.tetherTouched="1")}),document.addEventListener("click",gt)}var yt=["firstName","lastName"];async function ht(e){if(!(e instanceof window.HTMLFormElement))return;let t;try{t=await D().customer()}catch(r){T(r,"account");return}if(!t)return;let n=e.elements;yt.forEach(r=>{let s=n.namedItem(r);(s instanceof window.HTMLInputElement||s instanceof window.HTMLTextAreaElement)&&!s.dataset.tetherTouched&&(s.value=t[r]??"")})}var Re=!1;async function bt(e=document){Re||(Re=!0,Ce()),await Promise.all([...l(e,u("order")).map(t=>X(t)),...l(e,u("profile-form")).map(t=>ht(t)),M(e),Y(e)])}function wt(e){l(e,u("order")).forEach(t=>{U(t,"error")}),m(e,"show",{"addresses-loading":!1,"addresses-error":!0,"subscriptions-loading":!1,"subscriptions-error":!0})}function At(e){return g(e)&&g(e.__core)&&g(e.__parts)}function Ne(e,t){let n=Reflect.get(window,"Tether");if(!At(n))throw new Error(`tether.${e}.js runs after the Tether script, which loads it, and needs its window.Tether`);n.__parts[e]=t}Ne("account-pages",oe);})();
@@ -31,11 +31,11 @@
31
31
 
32
32
  // tether-core:client.ts
33
33
  var m2 = window.Tether.__core["client.ts"];
34
- var [endpoint, gql, matches, orNull, shaped, TetherError] = m2;
34
+ var [endpoint, gql, matches, orNull, shaped, TetherError, withTimeout] = m2;
35
35
 
36
36
  // tether-core:dom.ts
37
37
  var m3 = window.Tether.__core["dom.ts"];
38
- var [ANALYTICS_EVENTS, attr, attributesFromJson, busy, emit, formatDate, formatMoney, get, has, hasTemplate, isOwnEvent, notifyLayoutChanged, parseJSONAttr, productUrl, qsa, repeat, scoped, sel, setImage, setStoreHtml, setText, show] = m3;
38
+ var [ANALYTICS_EVENTS, attr, attributesFromJson, busy, emit, formatDate, formatMoney, get, has, hasTemplate, integerAttribute, isOwnEvent, notifyLayoutChanged, parseJSONAttr, productUrl, qsa, repeat, scoped, sel, setImage, setStoreHtml, setText, show] = m3;
39
39
 
40
40
  // tether-core:cart.ts
41
41
  var m4 = window.Tether.__core["cart.ts"];
@@ -171,31 +171,34 @@
171
171
  if (loggedIn) setStored(hintKey(), "1");
172
172
  else removeStored(hintKey());
173
173
  }
174
+ async function readJsonObjectOrEmpty(response) {
175
+ let json;
176
+ try {
177
+ json = await response.json();
178
+ } catch (error) {
179
+ if (error instanceof SyntaxError) return {};
180
+ throw error;
181
+ }
182
+ return isRecord(json) ? json : {};
183
+ }
174
184
  async function fetchFromWorker(url, init) {
175
185
  try {
176
- return await fetch(url, init);
186
+ return await withTimeout(cfg.requestTimeout, async (signal) => {
187
+ const response = await fetch(url, { ...init, signal });
188
+ return { response, data: await readJsonObjectOrEmpty(response) };
189
+ });
177
190
  } catch (error) {
178
191
  throw new TetherError(`Network error: ${messageOf(error)}`, {
179
192
  code: "NETWORK"
180
193
  });
181
194
  }
182
195
  }
183
- async function readJsonObjectOrEmpty(response) {
184
- let json;
185
- try {
186
- json = await response.json();
187
- } catch {
188
- return {};
189
- }
190
- return isRecord(json) ? json : {};
191
- }
192
196
  async function serverFetch(path, { method = "GET", body } = {}) {
193
197
  const init = { method, credentials: "include" };
194
198
  if (method === "POST") init.headers = { "Content-Type": "application/json", "X-Tether-Account": "1" };
195
199
  if (body) init.body = JSON.stringify(body);
196
- const response = await fetchFromWorker(`${serverBase()}${path}`, init);
200
+ const { response, data } = await fetchFromWorker(`${serverBase()}${path}`, init);
197
201
  if (response.status === 401) return { kind: "logged-out" };
198
- const data = await readJsonObjectOrEmpty(response);
199
202
  if (!response.ok) {
200
203
  const reason = textOrNull(data["error"]) ?? String(response.status);
201
204
  const userErrors = toUserErrors(data["userErrors"]);
@@ -254,7 +257,7 @@
254
257
 
255
258
  // tether-core:shopify-values.ts
256
259
  var m6 = window.Tether.__core["shopify-values.ts"];
257
- var [isHttpsUrl] = m6;
260
+ var [isHttpsUrl, MAX_CONNECTION_SIZE] = m6;
258
261
 
259
262
  // src/account/markup.ts
260
263
  function showIn(root, name, conditions) {
@@ -317,10 +320,7 @@
317
320
  var DEFAULT_ORDER_COUNT = 10;
318
321
  var MAX_ORDER_COUNT = 50;
319
322
  var isOrderCount = (value) => typeof value === "number" && Number.isInteger(value) && value >= 1 && value <= MAX_ORDER_COUNT;
320
- function listLimit(limit) {
321
- const asked = Number.parseInt(limit || String(DEFAULT_ORDER_COUNT), 10) || DEFAULT_ORDER_COUNT;
322
- return Math.min(Math.max(asked, 1), MAX_ORDER_COUNT);
323
- }
323
+ var listLimit = (list) => integerAttribute(list, "limit", { min: 1, max: MAX_ORDER_COUNT, fallback: DEFAULT_ORDER_COUNT });
324
324
  var numericId = (gid) => gid.replace(/\?.*$/, "").replace(/^.*\//, "");
325
325
  function orderUrl(order2) {
326
326
  const template = cfg.account?.orderUrl;
@@ -364,7 +364,7 @@
364
364
  const first = lists[0];
365
365
  if (!first) return;
366
366
  showIn(root, "show", { "orders-loading": true, "orders-empty": false });
367
- const limit = listLimit(get(first, "limit"));
367
+ const limit = listLimit(first);
368
368
  let orders2;
369
369
  try {
370
370
  orders2 = await loadOrders(limit);
@@ -1 +1 @@
1
- (()=>{var Pt=Object.defineProperty;var Tt=(t,e)=>{for(var r in e)Pt(t,r,{get:e[r],enumerable:!0})};var j={};Tt(j,{addresses:()=>ee,customer:()=>F,deleteAddress:()=>ne,isLoggedIn:()=>ht,login:()=>yt,logout:()=>At,mountAccount:()=>ue,order:()=>Qt,orders:()=>xt,render:()=>_,requestReturn:()=>ie,saveAddress:()=>re,subscriptionAction:()=>se,subscriptions:()=>oe,updateProfile:()=>te});var St=window.Tether.__core["config.ts"],[u,me,V,fe,ge,y,pe]=St;var Lt=window.Tether.__core["client.ts"],[he,ye,xe,Ae,Oe,p]=Lt;var bt=window.Tether.__core["dom.ts"],[Pe,Te,Se,Le,P,B,T,m,be,Re,Ee,Ie,Ne,Ce,d,E,ve,c,I,Ue,A,S]=bt;var Rt=window.Tether.__core["cart.ts"],[L]=Rt;var Et=window.Tether.__core["lazy.ts"],[G]=Et;function g(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function a(t,e){return g(t)?t[e]:void 0}function M(t){return Array.isArray(t)?t:[]}function i(t){return typeof t=="string"&&t!==""?t:null}var It=t=>typeof t=="number"&&Number.isFinite(t)?t:null,J=t=>It(t)??0,N=(t,e)=>M(t).map(r=>e(r)),K=(t,e)=>({nodes:N(a(t,"nodes"),e)}),$=t=>N(t,i).filter(e=>e!==null);function z(t){return t instanceof Error?t.message:String(t)}function W(t,e,r="localStorage"){try{window[r].setItem(t,e)}catch{}}function D(t,e="localStorage"){try{window[e].removeItem(t)}catch{}}var q=()=>`${u.prefix}:account-hint:${u.domain}`;var X=t=>t==="in"||t==="expired"||t==="error";function Nt(t){let e=i(a(t,"amount")),r=i(a(t,"currencyCode"));return e===null||r===null?null:{amount:e,currencyCode:r}}function Ct(t){let e=i(a(t,"url"));return e===null?null:{url:e,altText:i(a(t,"altText"))}}var vt=t=>({title:i(a(t,"title")),variantTitle:i(a(t,"variantTitle")),quantity:J(a(t,"quantity")),image:Ct(a(t,"image"))}),Ut=(t,e)=>({id:e,name:i(a(t,"name")),processedAt:i(a(t,"processedAt")),financialStatus:i(a(t,"financialStatus")),fulfillmentStatus:i(a(t,"fulfillmentStatus")),statusPageUrl:i(a(t,"statusPageUrl")),totalPrice:Nt(a(t,"totalPrice")),lineItems:K(a(t,"lineItems"),vt)});function Z(t){let e=[];for(let r of M(t)){let n=i(a(r,"id"));if(n===null)return{kind:"missing-id"};e.push(Ut(r,n))}return{kind:"read",orders:e}}var _t=t=>new p(`Customer accounts: the answer has no ${t}`);function Y(t){let e=g(t)?t:{},r=i(e.id),n=i(e.email),o=e.address;return{...r===null?{}:{id:r},firstName:i(e.firstName),lastName:i(e.lastName),displayName:i(e.displayName),emailAddress:n===null?null:{emailAddress:n},defaultAddress:Array.isArray(o)?{formatted:$(o)}:null}}function Q(t){let e=Z(t);if(e.kind==="missing-id")throw _t("order id");return e.orders}function Mt(t){let e=i(a(t,"message"));if(e===null)return null;let r=a(t,"field");return{message:e,field:Array.isArray(r)?$(r):null,code:i(a(t,"code"))}}var tt=t=>N(t,Mt).filter(e=>e!==null);var x=null;function et(){let t=u.account?.server;if(!t)throw new p("Customer accounts need the Worker: set account.server",{code:"NOT_CONFIGURED"});return new URL(t,window.location.href).href.replace(/\/$/,"")}function rt(t){t?W(q(),"1"):D(q())}async function $t(t,e){try{return await fetch(t,e)}catch(r){throw new p(`Network error: ${z(r)}`,{code:"NETWORK"})}}async function Dt(t){let e;try{e=await t.json()}catch{return{}}return g(e)?e:{}}async function O(t,{method:e="GET",body:r}={}){let n={method:e,credentials:"include"};e==="POST"&&(n.headers={"Content-Type":"application/json","X-Tether-Account":"1"}),r&&(n.body=JSON.stringify(r));let o=await $t(`${et()}${t}`,n);if(o.status===401)return{kind:"logged-out"};let s=await Dt(o);if(!o.ok){let l=i(s.error)??String(o.status),w=tt(s.userErrors);throw new p(`Customer accounts: ${l}`,{status:o.status,...w.length>0&&{userErrors:w},...s.code==="INVALID"&&{code:"INVALID"}})}return{kind:"answer",data:s}}async function C(){if(!x){let t=await O("/me");x=t.kind==="answer"&&t.data.loggedIn===!0?{loggedIn:!0,customer:Y(t.data.customer)}:{loggedIn:!1}}return rt(x.loggedIn),x}var nt=()=>x?.loggedIn===!0;function ot(){x=null}function st(t){let e=u.account?.navigate;e?e(t):window.location.assign(t)}var qt=t=>t||u.account?.locale||(u.locale||"").split("-")[0]||"";function it({returnTo:t,locale:e}){let r=new URL(`${et()}/login`);r.searchParams.set("returnTo",t);let n=qt(e);n&&r.searchParams.set("locale",n),u.country&&r.searchParams.set("country",u.country.toUpperCase()),st(r.toString())}async function at(){let t=L.id();if(!(await C()).loggedIn||!t)return null;let e=await O("/cart",{method:"POST",body:{cartId:t}});return e.kind==="logged-out"?null:i(e.data.checkoutUrl)}async function ct(t){let e=await O("/logout",{method:"POST",body:{returnTo:t,cartId:L.id()}});x=null,rt(!1),P("account-logout",{});let r=e.kind==="answer"?i(e.data.logoutUrl):null;return r?(st(r),"redirected"):"stayed"}var Ft=window.Tether.__core["shopify-values.ts"],[ut]=Ft;function b(t,e,r){d(t,c(e)).forEach(n=>{let o=m(n,e)??"";Object.hasOwn(r,o)&&S(n,r[o]===!0)})}var dt=(t,e)=>d(t,c(e)).concat(t.matches(c(e))?[t]:[]);var k=(t,e)=>Object.hasOwn(t,e)?t[e]:void 0;var jt=(t,e)=>({title:t.title||t.name||"","variant-title":t.variantTitle||"",quantity:String(t.quantity),price:T(t.price),total:T(t.totalPrice),sku:t.sku||"",returnable:e===null?void 0:String(e)}),Ht=t=>t.tagName==="INPUT";function Vt(t,e,r){b(t,"order-line-show",{returnable:r>0}),d(t,c("return-quantity")).forEach(n=>{Ht(n)&&(n.max=String(r),n.min="0",n.value||(n.value="0"),n.disabled=r<1)}),d(t,`select${c("return-reason")}`).forEach(n=>{n.dataset.tetherFilled!==e.id&&(n.dataset.tetherFilled=e.id,(e.suggestedReturnReasonDefinitions?.nodes??[]).forEach(o=>{n.appendChild(new Option(o.name??"",o.id))}))})}function lt(t,e,r){E(t,e,(n,o)=>{let s=o.id,l=r&&s?r.get(s)??0:null;s&&(n.dataset.tetherLine=s);let w=jt(o,l);dt(n,"order-line").forEach(h=>{let R=m(h,"order-line")??"";if(R==="image"){o.image&&I(h,o.image.url,o.image.altText||o.title||"");return}let H=k(w,R);H!==void 0&&A(h,H)}),s&&l!==null&&Vt(n,{...o,id:s},l)})}var v=10,U=50,mt=t=>typeof t=="number"&&Number.isInteger(t)&&t>=1&&t<=U;function Bt(t){let e=Number.parseInt(t||String(v),10)||v;return Math.min(Math.max(e,1),U)}var Gt=t=>t.replace(/\?.*$/,"").replace(/^.*\//,"");function Jt(t){let e=u.account?.orderUrl;if(e)return e.replaceAll("{id}",encodeURIComponent(Gt(t.id)));let r=t.statusPageUrl;return r!==null&&ut(r)?r:null}var Kt=t=>({name:t.name??"",date:B(t.processedAt),total:T(t.totalPrice),status:t.financialStatus?.toLowerCase(),fulfillment:t.fulfillmentStatus?.toLowerCase(),items:t.lineItems.nodes.map(e=>`${String(e.quantity)}\xD7 ${e.title??""}`).join(", ")});function zt(t,e){let r=e.lineItems.nodes,n=Jt(e),o=Kt(e);d(t,c("order-bind")).forEach(s=>{let l=m(s,"order-bind")??"";if(l==="url"){n&&s.setAttribute("href",n);return}if(l==="image"){let h=r.find(R=>R.image)?.image;h&&I(s,h.url,h.altText||r[0]?.title||"");return}let w=k(o,l);w!==void 0&&A(s,w)}),d(t,c("order-lines")).forEach(s=>{lt(s,r,null)}),m(t,"order-bind")==="url"&&n&&t.setAttribute("href",n)}async function ft(t,e){let r=d(t,c("orders")),n=r[0];if(!n)return;b(t,"show",{"orders-loading":!0,"orders-empty":!1});let o=Bt(m(n,"limit")),s;try{s=await e(o)}catch(l){y(l,"orders"),s=null}b(t,"show",{"orders-loading":!1,"orders-empty":s?.length===0}),r.forEach(l=>{E(l,s??[],zt)})}var Wt=["order","addresses","subscriptions","profile-form","address-form"],ht=nt;function yt({returnTo:t=window.location.href,locale:e}={}){return new Promise(r=>{it({returnTo:t,locale:e}),r()})}async function F(){let t=await C();return t.loggedIn?t.customer:null}async function xt({first:t=v}={}){if(!mt(t))throw new p(`Customer accounts: orders() takes first from 1 to ${String(U)}`,{code:"INVALID"});let e=await O(`/orders?${new URLSearchParams({first:String(t)}).toString()}`);return e.kind==="logged-out"?[]:Q(e.data.orders)}async function At({returnTo:t=u.account?.logoutUrl||`${window.location.origin}/`}={}){await ct(t)==="stayed"&&await _(document)}async function Xt(){try{return(await C()).loggedIn?{kind:"logged-in"}:{kind:"logged-out"}}catch(t){return{kind:"unknown",error:t}}}var gt=t=>Wt.some(e=>d(t,c(e)).length>0);function Zt(t){d(t,c("account-link")).forEach(e=>{e.setAttribute("href",Yt(m(e,"account-link")))})}function Yt(t){let e=u.account,r=`https://${u.domain}/account`;return t==="payment"?e?.paymentUrl||e?.subscriptionsUrl||r:t==="subscriptions"&&e?.subscriptionsUrl||r}async function _(t=document){let e=await Xt();e.kind==="unknown"&&y(e.error,"account");let r=e.kind==="logged-in";if(d(t,c("show")).forEach(n=>{let o=m(n,"show");o==="logged-in"&&S(n,r),o==="logged-out"&&S(n,!r)}),Zt(t),e.kind==="unknown"&&gt(t)){(await f()).showUnavailable(t);return}r&&(await Ot(t),await Promise.all([ft(t,n=>xt({first:n})),gt(t)?f().then(n=>n.renderPages(t)):null]))}async function Ot(t){let e=d(t,c("account-bind"));if(!e.length)return;let r;try{r=await F()}catch(o){y(o,"account");return}if(!r)return;let n={"first-name":r.firstName,"last-name":r.lastName,name:r.displayName,email:r.emailAddress?.emailAddress,address:r.defaultAddress?.formatted.join(", ")};e.forEach(o=>{let s=k(n,m(o,"account-bind")??"");s!=null&&A(o,s)})}var pt=null;function f(){return pt??(pt=G("account-pages").then(t=>(t.setup({serverFetch:O,customer:F,bindCustomer:Ot,reset:ot}),t))),pt}var Qt=t=>f().then(e=>e.order(t)),te=t=>f().then(e=>e.updateProfile(t)),ee=()=>f().then(t=>t.addresses()),re=(t,e)=>f().then(r=>r.saveAddress(t,e)),ne=t=>f().then(e=>e.deleteAddress(t)),oe=()=>f().then(t=>t.subscriptions()),se=(t,e)=>f().then(r=>r.subscriptionAction(t,e)),ie=(t,e)=>f().then(r=>r.requestReturn(t,e));function ae(t){let e=t.target;e instanceof window.Element&&(e.closest(c("account-login"))?(t.preventDefault(),yt().catch(r=>{y(r,"login")})):e.closest(c("account-logout"))&&(t.preventDefault(),At().catch(r=>{y(r,"logout")})))}function ce(){let t=new URL(window.location.href),e=t.searchParams.get("account");if(X(e))switch(t.searchParams.delete("account"),window.history.replaceState(window.history.state,"",t),e){case"in":P("account-login",{});break;case"expired":case"error":P("account-error",{error:e});break}}var wt=!1;async function ue(t=document){if(wt){await _(t);return}wt=!0,document.addEventListener("click",ae),ce(),L.setCheckoutResolver(at),await _(t),V("account",ht()?"logged in":"logged out")}function de(t){return g(t)&&g(t.__core)&&g(t.__parts)}function kt(t,e){let r=Reflect.get(window,"Tether");if(!de(r))throw new Error(`tether.${t}.js runs after the Tether script, which loads it, and needs its window.Tether`);r.__parts[t]=e}kt("account",j);})();
1
+ (()=>{var St=Object.defineProperty;var Lt=(t,e)=>{for(var r in e)St(t,r,{get:e[r],enumerable:!0})};var j={};Lt(j,{addresses:()=>ne,customer:()=>F,deleteAddress:()=>se,isLoggedIn:()=>xt,login:()=>At,logout:()=>kt,mountAccount:()=>le,order:()=>ee,orders:()=>Ot,render:()=>U,requestReturn:()=>ce,saveAddress:()=>oe,subscriptionAction:()=>ae,subscriptions:()=>ie,updateProfile:()=>re});var bt=window.Tether.__core["config.ts"],[u,ge,V,pe,we,y,he]=bt;var Et=window.Tether.__core["client.ts"],[xe,Ae,Oe,ke,Te,p,B]=Et;var Rt=window.Tether.__core["dom.ts"],[Se,Le,be,Ee,T,G,P,m,Re,Ie,J,Ne,Ce,ve,Ue,d,R,_e,c,I,$e,A,S]=Rt;var It=window.Tether.__core["cart.ts"],[L]=It;var Nt=window.Tether.__core["lazy.ts"],[K]=Nt;function g(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function a(t,e){return g(t)?t[e]:void 0}function _(t){return Array.isArray(t)?t:[]}function i(t){return typeof t=="string"&&t!==""?t:null}var Ct=t=>typeof t=="number"&&Number.isFinite(t)?t:null,X=t=>Ct(t)??0,N=(t,e)=>_(t).map(r=>e(r)),z=(t,e)=>({nodes:N(a(t,"nodes"),e)}),$=t=>N(t,i).filter(e=>e!==null);function W(t){return t instanceof Error?t.message:String(t)}function Z(t,e,r="localStorage"){try{window[r].setItem(t,e)}catch{}}function q(t,e="localStorage"){try{window[e].removeItem(t)}catch{}}var D=()=>`${u.prefix}:account-hint:${u.domain}`;var Y=t=>t==="in"||t==="expired"||t==="error";function vt(t){let e=i(a(t,"amount")),r=i(a(t,"currencyCode"));return e===null||r===null?null:{amount:e,currencyCode:r}}function Ut(t){let e=i(a(t,"url"));return e===null?null:{url:e,altText:i(a(t,"altText"))}}var _t=t=>({title:i(a(t,"title")),variantTitle:i(a(t,"variantTitle")),quantity:X(a(t,"quantity")),image:Ut(a(t,"image"))}),$t=(t,e)=>({id:e,name:i(a(t,"name")),processedAt:i(a(t,"processedAt")),financialStatus:i(a(t,"financialStatus")),fulfillmentStatus:i(a(t,"fulfillmentStatus")),statusPageUrl:i(a(t,"statusPageUrl")),totalPrice:vt(a(t,"totalPrice")),lineItems:z(a(t,"lineItems"),_t)});function Q(t){let e=[];for(let r of _(t)){let n=i(a(r,"id"));if(n===null)return{kind:"missing-id"};e.push($t(r,n))}return{kind:"read",orders:e}}var qt=t=>new p(`Customer accounts: the answer has no ${t}`);function tt(t){let e=g(t)?t:{},r=i(e.id),n=i(e.email),o=e.address;return{...r===null?{}:{id:r},firstName:i(e.firstName),lastName:i(e.lastName),displayName:i(e.displayName),emailAddress:n===null?null:{emailAddress:n},defaultAddress:Array.isArray(o)?{formatted:$(o)}:null}}function et(t){let e=Q(t);if(e.kind==="missing-id")throw qt("order id");return e.orders}function Dt(t){let e=i(a(t,"message"));if(e===null)return null;let r=a(t,"field");return{message:e,field:Array.isArray(r)?$(r):null,code:i(a(t,"code"))}}var rt=t=>N(t,Dt).filter(e=>e!==null);var x=null;function nt(){let t=u.account?.server;if(!t)throw new p("Customer accounts need the Worker: set account.server",{code:"NOT_CONFIGURED"});return new URL(t,window.location.href).href.replace(/\/$/,"")}function ot(t){t?Z(D(),"1"):q(D())}async function Mt(t){let e;try{e=await t.json()}catch(r){if(r instanceof SyntaxError)return{};throw r}return g(e)?e:{}}async function Ft(t,e){try{return await B(u.requestTimeout,async r=>{let n=await fetch(t,{...e,signal:r});return{response:n,data:await Mt(n)}})}catch(r){throw new p(`Network error: ${W(r)}`,{code:"NETWORK"})}}async function O(t,{method:e="GET",body:r}={}){let n={method:e,credentials:"include"};e==="POST"&&(n.headers={"Content-Type":"application/json","X-Tether-Account":"1"}),r&&(n.body=JSON.stringify(r));let{response:o,data:s}=await Ft(`${nt()}${t}`,n);if(o.status===401)return{kind:"logged-out"};if(!o.ok){let l=i(s.error)??String(o.status),w=rt(s.userErrors);throw new p(`Customer accounts: ${l}`,{status:o.status,...w.length>0&&{userErrors:w},...s.code==="INVALID"&&{code:"INVALID"}})}return{kind:"answer",data:s}}async function C(){if(!x){let t=await O("/me");x=t.kind==="answer"&&t.data.loggedIn===!0?{loggedIn:!0,customer:tt(t.data.customer)}:{loggedIn:!1}}return ot(x.loggedIn),x}var st=()=>x?.loggedIn===!0;function it(){x=null}function at(t){let e=u.account?.navigate;e?e(t):window.location.assign(t)}var jt=t=>t||u.account?.locale||(u.locale||"").split("-")[0]||"";function ct({returnTo:t,locale:e}){let r=new URL(`${nt()}/login`);r.searchParams.set("returnTo",t);let n=jt(e);n&&r.searchParams.set("locale",n),u.country&&r.searchParams.set("country",u.country.toUpperCase()),at(r.toString())}async function ut(){let t=L.id();if(!(await C()).loggedIn||!t)return null;let e=await O("/cart",{method:"POST",body:{cartId:t}});return e.kind==="logged-out"?null:i(e.data.checkoutUrl)}async function dt(t){let e=await O("/logout",{method:"POST",body:{returnTo:t,cartId:L.id()}});x=null,ot(!1),T("account-logout",{});let r=e.kind==="answer"?i(e.data.logoutUrl):null;return r?(at(r),"redirected"):"stayed"}var Ht=window.Tether.__core["shopify-values.ts"],[lt,cr]=Ht;function b(t,e,r){d(t,c(e)).forEach(n=>{let o=m(n,e)??"";Object.hasOwn(r,o)&&S(n,r[o]===!0)})}var mt=(t,e)=>d(t,c(e)).concat(t.matches(c(e))?[t]:[]);var k=(t,e)=>Object.hasOwn(t,e)?t[e]:void 0;var Vt=(t,e)=>({title:t.title||t.name||"","variant-title":t.variantTitle||"",quantity:String(t.quantity),price:P(t.price),total:P(t.totalPrice),sku:t.sku||"",returnable:e===null?void 0:String(e)}),Bt=t=>t.tagName==="INPUT";function Gt(t,e,r){b(t,"order-line-show",{returnable:r>0}),d(t,c("return-quantity")).forEach(n=>{Bt(n)&&(n.max=String(r),n.min="0",n.value||(n.value="0"),n.disabled=r<1)}),d(t,`select${c("return-reason")}`).forEach(n=>{n.dataset.tetherFilled!==e.id&&(n.dataset.tetherFilled=e.id,(e.suggestedReturnReasonDefinitions?.nodes??[]).forEach(o=>{n.appendChild(new Option(o.name??"",o.id))}))})}function ft(t,e,r){R(t,e,(n,o)=>{let s=o.id,l=r&&s?r.get(s)??0:null;s&&(n.dataset.tetherLine=s);let w=Vt(o,l);mt(n,"order-line").forEach(h=>{let E=m(h,"order-line")??"";if(E==="image"){o.image&&I(h,o.image.url,o.image.altText||o.title||"");return}let H=k(w,E);H!==void 0&&A(h,H)}),s&&l!==null&&Gt(n,{...o,id:s},l)})}var M=10,v=50,gt=t=>typeof t=="number"&&Number.isInteger(t)&&t>=1&&t<=v,Jt=t=>J(t,"limit",{min:1,max:v,fallback:M}),Kt=t=>t.replace(/\?.*$/,"").replace(/^.*\//,"");function Xt(t){let e=u.account?.orderUrl;if(e)return e.replaceAll("{id}",encodeURIComponent(Kt(t.id)));let r=t.statusPageUrl;return r!==null&&lt(r)?r:null}var zt=t=>({name:t.name??"",date:G(t.processedAt),total:P(t.totalPrice),status:t.financialStatus?.toLowerCase(),fulfillment:t.fulfillmentStatus?.toLowerCase(),items:t.lineItems.nodes.map(e=>`${String(e.quantity)}\xD7 ${e.title??""}`).join(", ")});function Wt(t,e){let r=e.lineItems.nodes,n=Xt(e),o=zt(e);d(t,c("order-bind")).forEach(s=>{let l=m(s,"order-bind")??"";if(l==="url"){n&&s.setAttribute("href",n);return}if(l==="image"){let h=r.find(E=>E.image)?.image;h&&I(s,h.url,h.altText||r[0]?.title||"");return}let w=k(o,l);w!==void 0&&A(s,w)}),d(t,c("order-lines")).forEach(s=>{ft(s,r,null)}),m(t,"order-bind")==="url"&&n&&t.setAttribute("href",n)}async function pt(t,e){let r=d(t,c("orders")),n=r[0];if(!n)return;b(t,"show",{"orders-loading":!0,"orders-empty":!1});let o=Jt(n),s;try{s=await e(o)}catch(l){y(l,"orders"),s=null}b(t,"show",{"orders-loading":!1,"orders-empty":s?.length===0}),r.forEach(l=>{R(l,s??[],Wt)})}var Zt=["order","addresses","subscriptions","profile-form","address-form"],xt=st;function At({returnTo:t=window.location.href,locale:e}={}){return new Promise(r=>{ct({returnTo:t,locale:e}),r()})}async function F(){let t=await C();return t.loggedIn?t.customer:null}async function Ot({first:t=M}={}){if(!gt(t))throw new p(`Customer accounts: orders() takes first from 1 to ${String(v)}`,{code:"INVALID"});let e=await O(`/orders?${new URLSearchParams({first:String(t)}).toString()}`);return e.kind==="logged-out"?[]:et(e.data.orders)}async function kt({returnTo:t=u.account?.logoutUrl||`${window.location.origin}/`}={}){await dt(t)==="stayed"&&await U(document)}async function Yt(){try{return(await C()).loggedIn?{kind:"logged-in"}:{kind:"logged-out"}}catch(t){return{kind:"unknown",error:t}}}var wt=t=>Zt.some(e=>d(t,c(e)).length>0);function Qt(t){d(t,c("account-link")).forEach(e=>{e.setAttribute("href",te(m(e,"account-link")))})}function te(t){let e=u.account,r=`https://${u.domain}/account`;return t==="payment"?e?.paymentUrl||e?.subscriptionsUrl||r:t==="subscriptions"&&e?.subscriptionsUrl||r}async function U(t=document){let e=await Yt();e.kind==="unknown"&&y(e.error,"account");let r=e.kind==="logged-in";if(d(t,c("show")).forEach(n=>{let o=m(n,"show");o==="logged-in"&&S(n,r),o==="logged-out"&&S(n,!r)}),Qt(t),e.kind==="unknown"&&wt(t)){(await f()).showUnavailable(t);return}r&&(await Tt(t),await Promise.all([pt(t,n=>Ot({first:n})),wt(t)?f().then(n=>n.renderPages(t)):null]))}async function Tt(t){let e=d(t,c("account-bind"));if(!e.length)return;let r;try{r=await F()}catch(o){y(o,"account");return}if(!r)return;let n={"first-name":r.firstName,"last-name":r.lastName,name:r.displayName,email:r.emailAddress?.emailAddress,address:r.defaultAddress?.formatted.join(", ")};e.forEach(o=>{let s=k(n,m(o,"account-bind")??"");s!=null&&A(o,s)})}var ht=null;function f(){return ht??(ht=K("account-pages").then(t=>(t.setup({serverFetch:O,customer:F,bindCustomer:Tt,reset:it}),t))),ht}var ee=t=>f().then(e=>e.order(t)),re=t=>f().then(e=>e.updateProfile(t)),ne=()=>f().then(t=>t.addresses()),oe=(t,e)=>f().then(r=>r.saveAddress(t,e)),se=t=>f().then(e=>e.deleteAddress(t)),ie=()=>f().then(t=>t.subscriptions()),ae=(t,e)=>f().then(r=>r.subscriptionAction(t,e)),ce=(t,e)=>f().then(r=>r.requestReturn(t,e));function ue(t){let e=t.target;e instanceof window.Element&&(e.closest(c("account-login"))?(t.preventDefault(),At().catch(r=>{y(r,"login")})):e.closest(c("account-logout"))&&(t.preventDefault(),kt().catch(r=>{y(r,"logout")})))}function de(){let t=new URL(window.location.href),e=t.searchParams.get("account");if(Y(e))switch(t.searchParams.delete("account"),window.history.replaceState(window.history.state,"",t),e){case"in":T("account-login",{});break;case"expired":case"error":T("account-error",{error:e});break}}var yt=!1;async function le(t=document){if(yt){await U(t);return}yt=!0,document.addEventListener("click",ue),de(),L.setCheckoutResolver(ut),await U(t),V("account",xt()?"logged in":"logged out")}function me(t){return g(t)&&g(t.__core)&&g(t.__parts)}function Pt(t,e){let r=Reflect.get(window,"Tether");if(!me(r))throw new Error(`tether.${t}.js runs after the Tether script, which loads it, and needs its window.Tether`);r.__parts[t]=e}Pt("account",j);})();
@@ -17,7 +17,7 @@
17
17
 
18
18
  // tether-core:dom.ts
19
19
  var m2 = window.Tether.__core["dom.ts"];
20
- var [ANALYTICS_EVENTS, attr, attributesFromJson, busy, emit, formatDate, formatMoney, get, has, hasTemplate, isOwnEvent, notifyLayoutChanged, parseJSONAttr, productUrl, qsa, repeat, scoped, sel, setImage, setStoreHtml, setText, show] = m2;
20
+ var [ANALYTICS_EVENTS, attr, attributesFromJson, busy, emit, formatDate, formatMoney, get, has, hasTemplate, integerAttribute, isOwnEvent, notifyLayoutChanged, parseJSONAttr, productUrl, qsa, repeat, scoped, sel, setImage, setStoreHtml, setText, show] = m2;
21
21
 
22
22
  // tether-core:cart.ts
23
23
  var m3 = window.Tether.__core["cart.ts"];
@@ -29,7 +29,7 @@
29
29
 
30
30
  // tether-core:client.ts
31
31
  var m5 = window.Tether.__core["client.ts"];
32
- var [endpoint, gql, matches, orNull, shaped, TetherError] = m5;
32
+ var [endpoint, gql, matches, orNull, shaped, TetherError, withTimeout] = m5;
33
33
 
34
34
  // src/analytics-shopify.ts
35
35
  var BUFFER_SIZE = 500;
@@ -1 +1 @@
1
- (()=>{var U=Object.defineProperty;var $=(t,n)=>{for(var e in n)U(t,e,{get:n[e],enumerable:!0})};var k={};$(k,{startAnalytics:()=>yt});var G=window.Tether.__core["config.ts"],[a,bt,_,vt,wt,l,Tt]=G;var H=window.Tether.__core["dom.ts"],[C,_t,Ct,Et,xt,At,St,Pt,Lt,Nt,E,It,Rt,Vt,Dt,Mt,qt,p,Bt,Ot,Ft,jt]=H;var W=window.Tether.__core["cart.ts"],[b]=W;var Y=window.Tether.__core["product.ts"],[x]=Y;var J=window.Tether.__core["client.ts"],[Ht,A,Wt,Yt,S,Jt]=J;var Z=500,P={"default-banner":"https://cdn.shopify.com/shopifycloud/privacy-banner/storefront-banner.js",other:"https://cdn.shopify.com/shopifycloud/consent-tracking-api/v0.2/consent-tracking-api.js"},z="https://cdn.shopify.com/storefront/analytics/shopify.js",N=()=>window,y=()=>N().Shopify;function I(){let t=a.analytics?.shopify;return typeof t=="object"?t:{}}function R(){try{let t=y()?.customerPrivacy;return t?.consentStatus==="loaded"&&t.currentVisitorConsent?.()?.analytics!=="no"&&!!t.analyticsProcessingAllowed?.()}catch{return!1}}function K(t){let n=`hydrogen:${t}`;return{getTrackingValues:()=>{let e=R()?y()?.customerPrivacy?.__internal:void 0;return{uniqueToken:e?.uniqueToken?.({generateFallback:!0,tag:n})??"",visitToken:e?.visitToken?.({generateFallback:!0,tag:n})??""}}}}var X=t=>(n,e)=>{let o=t.subscribers.get(n)??new Set;return t.subscribers.set(n,o),o.add(e),()=>t.subscribers.get(n)?.delete(e)};function Q(t){let n=[],e=[],o={shop:{shopId:t,channel:"headless"},consent:{mode:I().consent||"no-banner"}},r=()=>{if(R())for(let i of n)for(;i.next<e.length;i.next+=1){let s=e[i.next];s&&tt(i,s)}},c={getConfig:()=>o,publish(i,s={}){if(e.push({event:i,payload:{shop:o.shop,url:window.location.href,...s}}),e.length>Z){e.shift();for(let u of n)u.next=Math.max(0,u.next-1)}r()},addDestination(i){let s={name:i.name,next:0,subscribers:new Map,context:K(i.name)};return Promise.resolve(i.setup?.({subscribe:X(s),getConfig:c.getConfig})).then(()=>{n.push(s),r()}).catch(u=>{l(u,`analytics ${i.name}`)}),()=>{let u=n.indexOf(s);u>=0&&n.splice(u,1)}}};return document.addEventListener("consentTrackingApiLoaded",r),document.addEventListener("visitorConsentCollected",r),c}function tt(t,{event:n,payload:e}){t.subscribers.get(n)?.forEach(o=>{try{o(e,t.context)}catch(r){l(r,`analytics ${t.name}`)}})}function L(t){let n=document.createElement("script");n.src=t,n.async=!0,document.head.appendChild(n)}async function V(t){let n=y();if(n?.analytics)return n.analytics;let e=await A("query TetherShopId { shop { id } }",{},S({shop:{id:"string"}}),{context:!1}),o=y()??{};N().Shopify=o,o.country=a.country??"US";let[r="en"]=(a.locale||"en").split("-");o.locale=r.toLowerCase(),o.shop=a.domain,o.routes={root:"/",match:()=>({pageTemplateName:t()?"product":"page"}),...o.routes};let{proxy:c,consent:i}=I();o.customerPrivacy={...o.customerPrivacy,config:c?{isHeadless:!0,asyncConsent:!0,asyncVisitorState:!0,consentDomain:window.location.host}:{isHeadless:!0,storefrontAccessToken:a.token,checkoutRootDomain:a.domain}};let s=Q(e.shop.id);return o.analytics=s,L(i==="default-banner"?P["default-banner"]:P.other),L(z),_("shopify analytics ready",e.shop.id),s}var nt="Default Title",D=100,et=200,ot=t=>t?parseFloat(t.amount):0,M=t=>(t??"").split("/").pop()??"";function T(t,n,e=1,o){let r={item_id:n?.sku||M(n?.id)||M(t.id),item_name:t.title,item_variant:n?.title===nt?void 0:n?.title,item_brand:t.vendor||void 0,item_category:t.productType||void 0,price:ot(n?.price??t.priceRange?.minVariantPrice),quantity:e};return o!=null&&(r.index=o),r}var h=(t,n=t.quantity)=>T(t.merchandise.product,t.merchandise,n);function f(t){let n=t.reduce((e,o)=>e+o.price*(o.quantity||1),0);return Math.round(n*D)/D}var rt=(t,n,e=1)=>({id:t.id,title:t.title,price:n.price,vendor:t.vendor||"",variantId:n.id,variantTitle:n.title,quantity:e,sku:n.sku||void 0,productType:t.productType||void 0}),q=t=>({id:t.id,quantity:t.quantity,merchandise:{id:t.merchandise.id,title:t.merchandise.title,price:t.merchandise.price,sku:t.merchandise.sku,product:{id:t.merchandise.product.id,title:t.merchandise.product.title,vendor:t.merchandise.product.vendor||"",handle:t.merchandise.product.handle}}});function it(){let{dataLayer:t}=a.analytics??{},n=typeof t=="string"?t:"dataLayer",e=Reflect.get(window,n);if(Array.isArray(e))return e;let o=[];return Reflect.set(window,n,o),o}function st(t,n){let e=it();if(!n){e.push({event:t});return}e.push({ecommerce:null}),e.push({event:t,ecommerce:n})}var m=null,v=null,O=null,w=new WeakSet;function d(t,n,e,o){a.analytics?.dataLayer&&st(t,n),m&&e&&m.publish(e,o);try{a.analytics?.onEvent?.(t,n)}catch(r){l(r,"analytics onEvent")}}function F(){let t=document.querySelector(p("product"));return!t||t.closest(`${p("collection")},${p("products")},${p("recommendations")}`)?null:x.get(t)??null}function at({product:t,scope:n}){if(w.has(n.root)||F()!==n)return;w.add(n.root);let e=n.variant??t.variants.nodes[0],o=[T(t,e)],r=e?[rt(t,e)]:[];d("view_item",{currency:e?.price.currencyCode,value:f(o),items:o},"product_viewed",{products:r})}function ct({products:t,collection:n}){let e=t.slice(0,et).map((r,c)=>T(r,r.variants.nodes[0],1,c)),o={item_list_id:n?.handle||"products",item_list_name:n?.title||"Products"};if(!n){d("view_item_list",{...o,items:e});return}d("view_item_list",{...o,items:e},"collection_viewed",{collection:{id:n.id,handle:n.handle}})}function ut(t,n,e){let o=t?.cost.totalAmount.currencyCode;n.forEach((r,c)=>{let i=e.get(c),s=r.quantity-(i?.quantity??0);if(s<=0)return;let u=[h(r,s)];d("add_to_cart",{currency:o,value:f(u),items:u},"product_added_to_cart",{cart:t,prevCart:O,currentLine:q(r),prevLine:i?q(i):void 0})}),e.forEach((r,c)=>{let i=r.quantity-(n.get(c)?.quantity??0);if(i<=0)return;let s=[h(r,i)];d("remove_from_cart",{currency:o,value:f(s),items:s})})}function dt({cart:t,reason:n}){let e=new Map((t?.lines.nodes??[]).map(o=>[o.merchandise.id,o]));v&&n!=="load"&&n!=="pending"&&ut(t,e,v),v=e,O=t}function lt(){let t=b.lines.map(n=>h(n));d("view_cart",{currency:b.state?.cost.totalAmount.currencyCode,value:f(t),items:t})}function pt({cart:t}){if(!t)return;let n=t.lines.nodes.map(o=>h(o)),e=t.discountCodes.filter(o=>o.applicable).map(o=>o.code);d("begin_checkout",{currency:t.cost.totalAmount.currencyCode,value:f(n),coupon:e.join(",")||void 0,items:n})}var ft={"product-ready":at,"list-ready":ct,"cart-updated":dt,"cart-toggled":({open:t})=>{t&&lt()},checkout:pt,search:({term:t})=>{t&&d("search",{search_term:t},"search_viewed",{searchTerm:t})}};function mt(t,n){ft[n](t.detail)}function B(t){if(t.type==="astro:page-load"){w=new WeakSet,m?.publish("page_viewed",{});return}C.forEach(n=>{E(t,n)&&mt(t,n)})}async function yt(t){a.analytics?.shopify&&(m=await V(()=>F()!=null).catch(n=>(l(n,"shopify analytics"),null))),m?.publish("page_viewed",{}),t.splice(0).forEach(B),t.push=(...n)=>(n.forEach(B),t.length)}function g(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function ht(t){return g(t)&&g(t.__core)&&g(t.__parts)}function j(t,n){let e=Reflect.get(window,"Tether");if(!ht(e))throw new Error(`tether.${t}.js runs after the Tether script, which loads it, and needs its window.Tether`);e.__parts[t]=n}j("analytics",k);})();
1
+ (()=>{var U=Object.defineProperty;var $=(t,n)=>{for(var e in n)U(t,e,{get:n[e],enumerable:!0})};var k={};$(k,{startAnalytics:()=>yt});var G=window.Tether.__core["config.ts"],[a,bt,_,vt,wt,l,Tt]=G;var H=window.Tether.__core["dom.ts"],[C,_t,Ct,Et,xt,At,St,Pt,Lt,Nt,It,E,Rt,Vt,Dt,Mt,qt,Bt,p,Ot,Ft,jt,Ut]=H;var W=window.Tether.__core["cart.ts"],[b]=W;var Y=window.Tether.__core["product.ts"],[x]=Y;var J=window.Tether.__core["client.ts"],[Wt,A,Yt,Jt,S,Zt,zt]=J;var Z=500,P={"default-banner":"https://cdn.shopify.com/shopifycloud/privacy-banner/storefront-banner.js",other:"https://cdn.shopify.com/shopifycloud/consent-tracking-api/v0.2/consent-tracking-api.js"},z="https://cdn.shopify.com/storefront/analytics/shopify.js",N=()=>window,y=()=>N().Shopify;function I(){let t=a.analytics?.shopify;return typeof t=="object"?t:{}}function R(){try{let t=y()?.customerPrivacy;return t?.consentStatus==="loaded"&&t.currentVisitorConsent?.()?.analytics!=="no"&&!!t.analyticsProcessingAllowed?.()}catch{return!1}}function K(t){let n=`hydrogen:${t}`;return{getTrackingValues:()=>{let e=R()?y()?.customerPrivacy?.__internal:void 0;return{uniqueToken:e?.uniqueToken?.({generateFallback:!0,tag:n})??"",visitToken:e?.visitToken?.({generateFallback:!0,tag:n})??""}}}}var X=t=>(n,e)=>{let o=t.subscribers.get(n)??new Set;return t.subscribers.set(n,o),o.add(e),()=>t.subscribers.get(n)?.delete(e)};function Q(t){let n=[],e=[],o={shop:{shopId:t,channel:"headless"},consent:{mode:I().consent||"no-banner"}},r=()=>{if(R())for(let i of n)for(;i.next<e.length;i.next+=1){let s=e[i.next];s&&tt(i,s)}},c={getConfig:()=>o,publish(i,s={}){if(e.push({event:i,payload:{shop:o.shop,url:window.location.href,...s}}),e.length>Z){e.shift();for(let u of n)u.next=Math.max(0,u.next-1)}r()},addDestination(i){let s={name:i.name,next:0,subscribers:new Map,context:K(i.name)};return Promise.resolve(i.setup?.({subscribe:X(s),getConfig:c.getConfig})).then(()=>{n.push(s),r()}).catch(u=>{l(u,`analytics ${i.name}`)}),()=>{let u=n.indexOf(s);u>=0&&n.splice(u,1)}}};return document.addEventListener("consentTrackingApiLoaded",r),document.addEventListener("visitorConsentCollected",r),c}function tt(t,{event:n,payload:e}){t.subscribers.get(n)?.forEach(o=>{try{o(e,t.context)}catch(r){l(r,`analytics ${t.name}`)}})}function L(t){let n=document.createElement("script");n.src=t,n.async=!0,document.head.appendChild(n)}async function V(t){let n=y();if(n?.analytics)return n.analytics;let e=await A("query TetherShopId { shop { id } }",{},S({shop:{id:"string"}}),{context:!1}),o=y()??{};N().Shopify=o,o.country=a.country??"US";let[r="en"]=(a.locale||"en").split("-");o.locale=r.toLowerCase(),o.shop=a.domain,o.routes={root:"/",match:()=>({pageTemplateName:t()?"product":"page"}),...o.routes};let{proxy:c,consent:i}=I();o.customerPrivacy={...o.customerPrivacy,config:c?{isHeadless:!0,asyncConsent:!0,asyncVisitorState:!0,consentDomain:window.location.host}:{isHeadless:!0,storefrontAccessToken:a.token,checkoutRootDomain:a.domain}};let s=Q(e.shop.id);return o.analytics=s,L(i==="default-banner"?P["default-banner"]:P.other),L(z),_("shopify analytics ready",e.shop.id),s}var nt="Default Title",D=100,et=200,ot=t=>t?parseFloat(t.amount):0,M=t=>(t??"").split("/").pop()??"";function T(t,n,e=1,o){let r={item_id:n?.sku||M(n?.id)||M(t.id),item_name:t.title,item_variant:n?.title===nt?void 0:n?.title,item_brand:t.vendor||void 0,item_category:t.productType||void 0,price:ot(n?.price??t.priceRange?.minVariantPrice),quantity:e};return o!=null&&(r.index=o),r}var h=(t,n=t.quantity)=>T(t.merchandise.product,t.merchandise,n);function f(t){let n=t.reduce((e,o)=>e+o.price*(o.quantity||1),0);return Math.round(n*D)/D}var rt=(t,n,e=1)=>({id:t.id,title:t.title,price:n.price,vendor:t.vendor||"",variantId:n.id,variantTitle:n.title,quantity:e,sku:n.sku||void 0,productType:t.productType||void 0}),q=t=>({id:t.id,quantity:t.quantity,merchandise:{id:t.merchandise.id,title:t.merchandise.title,price:t.merchandise.price,sku:t.merchandise.sku,product:{id:t.merchandise.product.id,title:t.merchandise.product.title,vendor:t.merchandise.product.vendor||"",handle:t.merchandise.product.handle}}});function it(){let{dataLayer:t}=a.analytics??{},n=typeof t=="string"?t:"dataLayer",e=Reflect.get(window,n);if(Array.isArray(e))return e;let o=[];return Reflect.set(window,n,o),o}function st(t,n){let e=it();if(!n){e.push({event:t});return}e.push({ecommerce:null}),e.push({event:t,ecommerce:n})}var m=null,v=null,O=null,w=new WeakSet;function d(t,n,e,o){a.analytics?.dataLayer&&st(t,n),m&&e&&m.publish(e,o);try{a.analytics?.onEvent?.(t,n)}catch(r){l(r,"analytics onEvent")}}function F(){let t=document.querySelector(p("product"));return!t||t.closest(`${p("collection")},${p("products")},${p("recommendations")}`)?null:x.get(t)??null}function at({product:t,scope:n}){if(w.has(n.root)||F()!==n)return;w.add(n.root);let e=n.variant??t.variants.nodes[0],o=[T(t,e)],r=e?[rt(t,e)]:[];d("view_item",{currency:e?.price.currencyCode,value:f(o),items:o},"product_viewed",{products:r})}function ct({products:t,collection:n}){let e=t.slice(0,et).map((r,c)=>T(r,r.variants.nodes[0],1,c)),o={item_list_id:n?.handle||"products",item_list_name:n?.title||"Products"};if(!n){d("view_item_list",{...o,items:e});return}d("view_item_list",{...o,items:e},"collection_viewed",{collection:{id:n.id,handle:n.handle}})}function ut(t,n,e){let o=t?.cost.totalAmount.currencyCode;n.forEach((r,c)=>{let i=e.get(c),s=r.quantity-(i?.quantity??0);if(s<=0)return;let u=[h(r,s)];d("add_to_cart",{currency:o,value:f(u),items:u},"product_added_to_cart",{cart:t,prevCart:O,currentLine:q(r),prevLine:i?q(i):void 0})}),e.forEach((r,c)=>{let i=r.quantity-(n.get(c)?.quantity??0);if(i<=0)return;let s=[h(r,i)];d("remove_from_cart",{currency:o,value:f(s),items:s})})}function dt({cart:t,reason:n}){let e=new Map((t?.lines.nodes??[]).map(o=>[o.merchandise.id,o]));v&&n!=="load"&&n!=="pending"&&ut(t,e,v),v=e,O=t}function lt(){let t=b.lines.map(n=>h(n));d("view_cart",{currency:b.state?.cost.totalAmount.currencyCode,value:f(t),items:t})}function pt({cart:t}){if(!t)return;let n=t.lines.nodes.map(o=>h(o)),e=t.discountCodes.filter(o=>o.applicable).map(o=>o.code);d("begin_checkout",{currency:t.cost.totalAmount.currencyCode,value:f(n),coupon:e.join(",")||void 0,items:n})}var ft={"product-ready":at,"list-ready":ct,"cart-updated":dt,"cart-toggled":({open:t})=>{t&&lt()},checkout:pt,search:({term:t})=>{t&&d("search",{search_term:t},"search_viewed",{searchTerm:t})}};function mt(t,n){ft[n](t.detail)}function B(t){if(t.type==="astro:page-load"){w=new WeakSet,m?.publish("page_viewed",{});return}C.forEach(n=>{E(t,n)&&mt(t,n)})}async function yt(t){a.analytics?.shopify&&(m=await V(()=>F()!=null).catch(n=>(l(n,"shopify analytics"),null))),m?.publish("page_viewed",{}),t.splice(0).forEach(B),t.push=(...n)=>(n.forEach(B),t.length)}function g(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function ht(t){return g(t)&&g(t.__core)&&g(t.__parts)}function j(t,n){let e=Reflect.get(window,"Tether");if(!ht(e))throw new Error(`tether.${t}.js runs after the Tether script, which loads it, and needs its window.Tether`);e.__parts[t]=n}j("analytics",k);})();
@@ -20,11 +20,11 @@
20
20
 
21
21
  // tether-core:client.ts
22
22
  var m2 = window.Tether.__core["client.ts"];
23
- var [endpoint, gql, matches, orNull, shaped, TetherError] = m2;
23
+ var [endpoint, gql, matches, orNull, shaped, TetherError, withTimeout] = m2;
24
24
 
25
25
  // tether-core:dom.ts
26
26
  var m3 = window.Tether.__core["dom.ts"];
27
- var [ANALYTICS_EVENTS, attr, attributesFromJson, busy, emit, formatDate, formatMoney, get, has, hasTemplate, isOwnEvent, notifyLayoutChanged, parseJSONAttr, productUrl, qsa, repeat, scoped, sel, setImage, setStoreHtml, setText, show] = m3;
27
+ var [ANALYTICS_EVENTS, attr, attributesFromJson, busy, emit, formatDate, formatMoney, get, has, hasTemplate, integerAttribute, isOwnEvent, notifyLayoutChanged, parseJSONAttr, productUrl, qsa, repeat, scoped, sel, setImage, setStoreHtml, setText, show] = m3;
28
28
 
29
29
  // tether-core:loader.ts
30
30
  var m4 = window.Tether.__core["loader.ts"];
@@ -1,4 +1,4 @@
1
- (()=>{var L=Object.defineProperty;var Y=(e,n)=>{for(var t in n)L(e,t,{get:n[t],enumerable:!0})};var P={};Y(P,{apiVersionStatus:()=>y,checkMarkup:()=>k,diagnose:()=>ke,didYouMean:()=>f});var G=window.Tether.__core["config.ts"],[a,E,$e,Re,Te,Ae,_e]=G;var B=window.Tether.__core["client.ts"],[$,R,Ne,xe,T,Me]=B;var K=window.Tether.__core["dom.ts"],[Oe,p,Ve,Ue,Ce,Ie,qe,m,He,A,Le,Ye,Ge,Be,d,Ke,Qe,l,je,We,Fe,ze]=K;var Q=window.Tether.__core["loader.ts"],[Xe,_,Ze,et,tt]=Q;var j=window.Tether.__core["selling-plans.ts"],[v]=j;var W=window.Tether.__core["status.ts"],[N,ot,h,st]=W;var F=/^(\d{4})-(01|04|07|10)$/;function M(e){let n=F.exec(typeof e=="string"?e:"");return n?{year:Number(n[1]),month:Number(n[2])}:null}var z=(e,n)=>`${e}-${String(n).padStart(2,"0")}`;function x(e,n=1){let t=M(e);if(!t)throw new Error(`not a quarterly Shopify API version: ${e}`);let r=t.year*4+(t.month-1)/3+n;return z(Math.floor(r/4),r%4*3+1)}function y(e,n=new Date){if(e==="unstable")return{version:e,ok:!1,note:'"unstable" changes without notice: pin a dated version such as 2026-07'};let t=M(e);if(!t)return{version:e,ok:!1,note:"not a quarterly version (YYYY-01, -04, -07 or -10)"};let r=new Date(Date.UTC(t.year,t.month-1,1)),s=new Date(Date.UTC(t.year,t.month-1+12,1)),o=(s.getTime()-n.getTime())/2630016e3,i=r<=n,c=`supported until about ${s.toISOString().slice(0,7)}`;return i?o<=0?c="no longer supported: Shopify falls back to the oldest supported version. Upgrade (see docs/reference.md)":o<3&&(c=`${c}: plan the upgrade to ${x(e)} or later (see docs/reference.md)`):c="not released yet (release candidate at best)",{version:e,ok:i&&o>0,monthsLeft:Math.round(o),next:x(e),note:c}}var J=window.Tether.__core["lazy.ts"],[D]=J;var O=new Set(["in-stock","out-of-stock","backorder","low-stock","plenty-in-stock","on-sale","not-on-sale","has-variants","single-variant","subscription-available","subscription-unavailable","subscription-only","one-time-available","subscription-selected","one-time-selected","has-savings","loading","ready","error","not-found","cart-empty","cart-filled","cart-has-subscription","cart-no-subscription","cart-has-discount","cart-error","cart-warning","list-empty","list-filled","search-empty","search-results","logged-in","logged-out","orders-empty","orders-loading","addresses-loading","addresses-empty","addresses-error","subscriptions-loading","subscriptions-empty","subscriptions-error"]),V=new Set(["title","description","description-text","vendor","type","handle","published-at","price","total-price","compare-at-price","unit-price","min-price","max-price","discount-percentage","discount-amount","variant-title","variant-id","sku","barcode","stock","quantity","featured-image","variant-image","images","tags","link","url","one-time-price","subscription-price","subscription-savings","subscription-savings-amount","checkout-charge","plan-name","plan-description","plan-group","option-value","swatch","image"]),U=new Set(`account account-bind account-link account-login account-logout add-label add-to-cart adding-text
1
+ (()=>{var L=Object.defineProperty;var Y=(e,n)=>{for(var t in n)L(e,t,{get:n[t],enumerable:!0})};var P={};Y(P,{apiVersionStatus:()=>y,checkMarkup:()=>k,diagnose:()=>ke,didYouMean:()=>f});var G=window.Tether.__core["config.ts"],[a,E,$e,Re,Te,Ae,_e]=G;var B=window.Tether.__core["client.ts"],[$,R,Ne,xe,T,Me,De]=B;var K=window.Tether.__core["dom.ts"],[Ve,p,Ue,Ce,Ie,qe,He,m,Le,A,Ye,Ge,Be,Ke,Qe,d,je,We,l,Fe,ze,Je,Xe]=K;var Q=window.Tether.__core["loader.ts"],[et,_,tt,nt,rt]=Q;var j=window.Tether.__core["selling-plans.ts"],[v]=j;var W=window.Tether.__core["status.ts"],[N,it,h,at]=W;var F=/^(\d{4})-(01|04|07|10)$/;function M(e){let n=F.exec(typeof e=="string"?e:"");return n?{year:Number(n[1]),month:Number(n[2])}:null}var z=(e,n)=>`${e}-${String(n).padStart(2,"0")}`;function x(e,n=1){let t=M(e);if(!t)throw new Error(`not a quarterly Shopify API version: ${e}`);let r=t.year*4+(t.month-1)/3+n;return z(Math.floor(r/4),r%4*3+1)}function y(e,n=new Date){if(e==="unstable")return{version:e,ok:!1,note:'"unstable" changes without notice: pin a dated version such as 2026-07'};let t=M(e);if(!t)return{version:e,ok:!1,note:"not a quarterly version (YYYY-01, -04, -07 or -10)"};let r=new Date(Date.UTC(t.year,t.month-1,1)),s=new Date(Date.UTC(t.year,t.month-1+12,1)),o=(s.getTime()-n.getTime())/2630016e3,i=r<=n,c=`supported until about ${s.toISOString().slice(0,7)}`;return i?o<=0?c="no longer supported: Shopify falls back to the oldest supported version. Upgrade (see docs/reference.md)":o<3&&(c=`${c}: plan the upgrade to ${x(e)} or later (see docs/reference.md)`):c="not released yet (release candidate at best)",{version:e,ok:i&&o>0,monthsLeft:Math.round(o),next:x(e),note:c}}var J=window.Tether.__core["lazy.ts"],[D]=J;var O=new Set(["in-stock","out-of-stock","backorder","low-stock","plenty-in-stock","on-sale","not-on-sale","has-variants","single-variant","subscription-available","subscription-unavailable","subscription-only","one-time-available","subscription-selected","one-time-selected","has-savings","loading","ready","error","not-found","cart-empty","cart-filled","cart-has-subscription","cart-no-subscription","cart-has-discount","cart-error","cart-warning","list-empty","list-filled","search-empty","search-results","logged-in","logged-out","orders-empty","orders-loading","addresses-loading","addresses-empty","addresses-error","subscriptions-loading","subscriptions-empty","subscriptions-error"]),V=new Set(["title","description","description-text","vendor","type","handle","published-at","price","total-price","compare-at-price","unit-price","min-price","max-price","discount-percentage","discount-amount","variant-title","variant-id","sku","barcode","stock","quantity","featured-image","variant-image","images","tags","link","url","one-time-price","subscription-price","subscription-savings","subscription-savings-amount","checkout-charge","plan-name","plan-description","plan-group","option-value","swatch","image"]),U=new Set(`account account-bind account-link account-login account-logout add-label add-to-cart adding-text
2
2
  always-enabled bind cart-checkout-charge cart-clear cart-close cart-count cart-discounts cart-drawer cart-label cart-lines
3
3
  cart-note cart-open cart-subtotal cart-total cart-warning checkout code collection collection-bind countries country
4
4
  country-bind country-label country-select default-plan default-purchase discount discount-code discount-form discount-input
@@ -19,7 +19,7 @@
19
19
 
20
20
  // tether-core:dom.ts
21
21
  var m2 = window.Tether.__core["dom.ts"];
22
- var [ANALYTICS_EVENTS, attr, attributesFromJson, busy, emit, formatDate, formatMoney, get, has, hasTemplate, isOwnEvent, notifyLayoutChanged, parseJSONAttr, productUrl, qsa, repeat, scoped, sel, setImage, setStoreHtml, setText, show] = m2;
22
+ var [ANALYTICS_EVENTS, attr, attributesFromJson, busy, emit, formatDate, formatMoney, get, has, hasTemplate, integerAttribute, isOwnEvent, notifyLayoutChanged, parseJSONAttr, productUrl, qsa, repeat, scoped, sel, setImage, setStoreHtml, setText, show] = m2;
23
23
 
24
24
  // tether-core:product.ts
25
25
  var m3 = window.Tether.__core["product.ts"];
@@ -1 +1 @@
1
- (()=>{var N=Object.defineProperty;var R=(e,t)=>{for(var n in t)N(e,n,{get:t[n],enumerable:!0})};var f={};R(f,{addGroup:()=>q,onStorage:()=>j,writeVariantUrl:()=>V});var O=window.Tether.__core["config.ts"],[c,Y,Z,P,I,i,p]=O;var v=window.Tether.__core["dom.ts"],[Q,X,m,ee,y,te,ne,k,w,re,oe,ae,h,ce,S,ue,ie,s,se,le,ge,de]=v;var U=window.Tether.__core["product.ts"],[C]=U;var K=window.Tether.__core["cart.ts"],[d]=K;var H=window.Tether.__core["page-market.ts"],[M]=H;var F=window.Tether.__core["market-codes.ts"],[x,b]=F;var E=()=>`${c.prefix}:market:${c.domain}`;function $(e){try{return JSON.parse(e)}catch(t){if(t instanceof SyntaxError)return null;throw t}}function D(e){if(typeof e!="object"||e===null)return null;let t=x(Reflect.get(e,"country"));if(!t)return null;let n=Reflect.get(e,"locale");return{country:t,language:b(Reflect.get(e,"language"))??void 0,locale:typeof n=="string"&&n?n:void 0}}var T=e=>D($(e));function J(e,t){let n=m(h(e,"line-attributes"));return t?[{key:"_group",value:t},...n]:n}async function q(e){let t=e.closest(s("group"));if(!t)return null;let n=k(t,"group"),r=J(t,n),u=S(t,s("product")).flatMap(a=>{let o=C.get(a);if(!o?.variant?.availableForSale||o.quantity<=0)return[];let g=o.getLine();return g?[{...g,attributes:[...g.attributes??[],...r]}]:[]});if(!u.length)return p("group-add: nothing selected"),null;try{let a=await d.add(u);return y("group-added",{group:n,lines:u},t),a}catch(a){return i(a,"group add"),null}}function j(e){if(e.key===c.storageKey||e.key===`${c.storageKey}:seen`){d.init().catch(r=>{i(r,"cart from another tab")});return}if(e.key!==E()||!e.newValue)return;let t=T(e.newValue);if(!t)return;let n={language:t.language??null,locale:t.locale,remember:!1};M(t.country,n).catch(r=>{i(r,"market from another tab")})}var _=new WeakMap,L=e=>e.split("/").pop()??e;function z(e){try{window.history.replaceState(window.history.state,"",e)}catch{}}function V(e,{variant:t,sellingPlanId:n}){let r=`${t.id}|${n??""}`,u=_.get(e);if(_.set(e,r),!u||u===r)return;let a=c.variantUrl&&document.querySelector(s("product"))===e;if(!w(e,"variant-url")&&!a)return;let o=new URL(window.location.href);o.searchParams.set("variant",L(t.id)),n?o.searchParams.set("selling_plan",L(n)):o.searchParams.delete("selling_plan"),z(o)}function l(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function W(e){return l(e)&&l(e.__core)&&l(e.__parts)}function A(e,t){let n=Reflect.get(window,"Tether");if(!W(n))throw new Error(`tether.${e}.js runs after the Tether script, which loads it, and needs its window.Tether`);n.__parts[e]=t}A("extras",f);})();
1
+ (()=>{var N=Object.defineProperty;var R=(e,t)=>{for(var n in t)N(e,n,{get:t[n],enumerable:!0})};var f={};R(f,{addGroup:()=>q,onStorage:()=>j,writeVariantUrl:()=>V});var O=window.Tether.__core["config.ts"],[u,Y,Z,P,I,i,p]=O;var v=window.Tether.__core["dom.ts"],[Q,X,m,ee,y,te,ne,k,w,re,oe,ae,ue,h,ce,S,ie,se,s,le,ge,de,fe]=v;var U=window.Tether.__core["product.ts"],[C]=U;var K=window.Tether.__core["cart.ts"],[d]=K;var H=window.Tether.__core["page-market.ts"],[M]=H;var F=window.Tether.__core["market-codes.ts"],[x,b]=F;var E=()=>`${u.prefix}:market:${u.domain}`;function $(e){try{return JSON.parse(e)}catch(t){if(t instanceof SyntaxError)return null;throw t}}function D(e){if(typeof e!="object"||e===null)return null;let t=x(Reflect.get(e,"country"));if(!t)return null;let n=Reflect.get(e,"locale");return{country:t,language:b(Reflect.get(e,"language"))??void 0,locale:typeof n=="string"&&n?n:void 0}}var T=e=>D($(e));function J(e,t){let n=m(h(e,"line-attributes"));return t?[{key:"_group",value:t},...n]:n}async function q(e){let t=e.closest(s("group"));if(!t)return null;let n=k(t,"group"),r=J(t,n),c=S(t,s("product")).flatMap(a=>{let o=C.get(a);if(!o?.variant?.availableForSale||o.quantity<=0)return[];let g=o.getLine();return g?[{...g,attributes:[...g.attributes??[],...r]}]:[]});if(!c.length)return p("group-add: nothing selected"),null;try{let a=await d.add(c);return y("group-added",{group:n,lines:c},t),a}catch(a){return i(a,"group add"),null}}function j(e){if(e.key===u.storageKey||e.key===`${u.storageKey}:seen`){d.init().catch(r=>{i(r,"cart from another tab")});return}if(e.key!==E()||!e.newValue)return;let t=T(e.newValue);if(!t)return;let n={language:t.language??null,locale:t.locale,remember:!1};M(t.country,n).catch(r=>{i(r,"market from another tab")})}var _=new WeakMap,L=e=>e.split("/").pop()??e;function z(e){try{window.history.replaceState(window.history.state,"",e)}catch{}}function V(e,{variant:t,sellingPlanId:n}){let r=`${t.id}|${n??""}`,c=_.get(e);if(_.set(e,r),!c||c===r)return;let a=u.variantUrl&&document.querySelector(s("product"))===e;if(!w(e,"variant-url")&&!a)return;let o=new URL(window.location.href);o.searchParams.set("variant",L(t.id)),n?o.searchParams.set("selling_plan",L(n)):o.searchParams.delete("selling_plan"),z(o)}function l(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function W(e){return l(e)&&l(e.__core)&&l(e.__parts)}function A(e,t){let n=Reflect.get(window,"Tether");if(!W(n))throw new Error(`tether.${e}.js runs after the Tether script, which loads it, and needs its window.Tether`);n.__parts[e]=t}A("extras",f);})();