@shopify/hydrogen 2024.4.2 → 2024.4.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.
@@ -1,20 +1,20 @@
1
- import { createStorefrontClient, SHOPIFY_STOREFRONT_ID_HEADER, getShopifyCookies, SHOPIFY_Y, SHOPIFY_STOREFRONT_Y_HEADER, SHOPIFY_S, SHOPIFY_STOREFRONT_S_HEADER, flattenConnection, ShopPayButton, useLoadScript, useShopifyCookies, sendShopifyAnalytics, AnalyticsEventName, AnalyticsPageType, getClientBrowserParameters } from '@shopify/hydrogen-react';
1
+ import { createStorefrontClient, SHOPIFY_STOREFRONT_ID_HEADER, getShopifyCookies, SHOPIFY_Y, SHOPIFY_STOREFRONT_Y_HEADER, SHOPIFY_S, SHOPIFY_STOREFRONT_S_HEADER, flattenConnection, ShopPayButton, useLoadScript, RichText, useShopifyCookies, sendShopifyAnalytics, AnalyticsEventName, AnalyticsPageType, getClientBrowserParameters } from '@shopify/hydrogen-react';
2
2
  export { AnalyticsEventName, AnalyticsPageType, ExternalVideo, IMAGE_FRAGMENT, Image, MediaFile, ModelViewer, Money, ShopifySalesChannel, Video, customerAccountApiCustomScalars, flattenConnection, getClientBrowserParameters, getShopifyCookies, parseGid, parseMetafield, sendShopifyAnalytics, storefrontApiCustomScalars, useLoadScript, useMoney, useShopifyCookies } from '@shopify/hydrogen-react';
3
3
  import { lazy, createContext, forwardRef, useMemo, createElement, Suspense, Fragment, useRef, useEffect, useContext, useState } from 'react';
4
4
  import { useMatches, useLocation, useNavigation, Link, useNavigate, useFetcher, useFetchers } from '@remix-run/react';
5
5
  import { jsx, jsxs, Fragment as Fragment$1 } from 'react/jsx-runtime';
6
- import da from 'content-security-policy-builder';
7
- import br from 'tiny-invariant';
6
+ import { parse, stringify } from 'worktop/cookie';
7
+ import Aa from 'content-security-policy-builder';
8
8
 
9
- function Dt(e){let t=Array.isArray(e)?e:[e],r="";for(let o of t)o!=null&&(typeof o=="object"?r+=JSON.stringify(o):r+=o.toString());return encodeURIComponent(r)}var be="public",Vr="private",Qe="no-store",Ot={maxAge:"max-age",staleWhileRevalidate:"stale-while-revalidate",sMaxAge:"s-maxage",staleIfError:"stale-if-error"};function ye(e){let t=[];return Object.keys(e).forEach(r=>{r==="mode"?t.push(e[r]):Ot[r]&&t.push(`${Ot[r]}=${e[r]}`);}),t.join(", ")}function Ge(){return {mode:Qe}}function Be(e){if(e?.mode&&e?.mode!==be&&e?.mode!==Vr)throw Error("'mode' must be either 'public' or 'private'")}function re(e){return Be(e),{mode:be,maxAge:1,staleWhileRevalidate:9,...e}}function We(e){return Be(e),{mode:be,maxAge:3600,staleWhileRevalidate:82800,...e}}function oe(e){return Be(e),{mode:be,maxAge:1,staleWhileRevalidate:86399,...e}}function je(e){return e}function j(e){return String(e).includes("__proto__")?JSON.parse(e,Fr):JSON.parse(e)}function Fr(e,t){if(e!=="__proto__")return t}function Ee(e,t){return e&&t?{...e,...t}:e||oe()}function Ke(e){return ye(Ee(e))}async function $r(e,t){if(!e)return;let r=await e.match(t);if(!r){return}return r}async function qr(e,t,r,o){if(!e)return;let a=Ee(o),s=Ke(Ee(a,{maxAge:(a.maxAge||0)+(a.staleWhileRevalidate||0)})),n=Ke(Ee(a));r.headers.set("cache-control",s),r.headers.set("real-cache-control",n),r.headers.set("cache-put-date",new Date().toUTCString()),await e.put(t,r);}async function Hr(e,t){e&&await e.delete(t);}function Qr(e,t){let r=e.headers.get("real-cache-control"),o=0;if(r){let s=r.match(/max-age=(\d*)/);s&&s.length>1&&(o=parseFloat(s[1]));}return [(new Date().valueOf()-new Date(t).valueOf())/1e3,o]}function Gr(e,t){let r=t.headers.get("cache-put-date");if(!r)return !1;let[o,a]=Qr(t,r),s=o>a;return s}var xe={get:$r,set:qr,delete:Hr,generateDefaultCacheControlHeader:Ke,isStale:Gr};function fe(e){return `https://shopify.dev/?${e}`}function Br(e){return e||oe()}async function Ut(e,t){if(!e)return;let r=fe(t),o=new Request(r),a=await xe.get(e,o);if(!a)return;let s=await a.text();try{return [j(s),a]}catch{return [s,a]}}async function _t(e,t,r,o){if(!e)return;let a=fe(t),s=new Request(a),n=new Response(JSON.stringify(r));await xe.set(e,s,n,Br(o));}function kt(e,t){return xe.isStale(new Request(fe(e)),t)}function Lt(e,t){return [e,{status:t.status,statusText:t.statusText,headers:Array.from(t.headers.entries())}]}function Nt([e,t]){return [e,new Response(e,t)]}var Mt=(e,t)=>!e?.errors&&t.status<400,ze=new Set;async function Je(e,t,{strategy:r=re(),cacheInstance:o,shouldCacheResult:a=()=>!0,waitUntil:s,debugInfo:n}){let u=Dt([...typeof e=="string"?[e]:e]),y=f=>{({displayName:f.displayName,url:f.response?.url,responseInit:{status:f.response?.status||0,statusText:f.response?.statusText||"",headers:Array.from(f.response?.headers.entries()||[])}});},p=void 0;if(!o||!r||r.mode===Qe){let f=await t({addDebugData:y});return f}let l=f=>_t(o,u,{value:f,debugInfo:void 0},r),g=await Ut(o,u);if(g&&typeof g[0]!="string"){let[{value:f,debugInfo:R},v]=g;let N=kt(u,v)?"STALE":"HIT";if(!ze.has(u)&&N==="STALE"){ze.add(u);let F=Promise.resolve().then(async()=>{let ee=Date.now();try{let _=await t({addDebugData:y});a(_)&&(await l(_),p?.({result:_,cacheStatus:"PUT",overrideStartTime:ee}));}catch(_){_.message&&(_.message="SWR in sub-request failed: "+_.message),console.error(_);}finally{ze.delete(u);}});s?.(F);}return f}let S=await t({addDebugData:y});if(a(S)){let f=Promise.resolve().then(async()=>{await l(S);});s?.(f);}return S}async function Vt(e,t,{cacheInstance:r,cache:o,cacheKey:a=[e,t],shouldCacheResponse:s=()=>!0,waitUntil:n,returnType:i="json",debugInfo:u}={}){return !o&&(!t.method||t.method==="GET")&&(o=re()),Je(a,async()=>{let c=await fetch(e,t),d;try{d=await c[i]();}catch{try{d=await c.text();}catch{return Lt("",c)}}return Lt(d,c)},{cacheInstance:r,waitUntil:n,strategy:o??null,debugInfo:u,shouldCacheResult:c=>s(...Nt(c))}).then(Nt)}var me="2024.4.2";var Ye="Custom-Storefront-Request-Group-ID",Xe="X-Shopify-Storefront-Access-Token",Ze="X-SDK-Variant",et="X-SDK-Variant-Source",tt="X-SDK-Version",De="2024-04",ae=`Shopify Hydrogen ${me}`,Ft="30243aa5-17c1-465a-8493-944bcc4e88aa",E="customerAccount",ne="buyer";function $t(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():`weak-${Math.random().toString(16).substring(2)}`}function se(e){return e.replace(/\s*#.*$/gm,"").replace(/\s+/gm," ").trim()}var Wr=/(^|}\s)query[\s({]/im,jr=/(^|}\s)mutation[\s({]/im;function Oe(e,t){if(!Wr.test(e))throw new Error(`[h2:error:${t}] Can only execute queries`)}function Ue(e,t){if(!jr.test(e))throw new Error(`[h2:error:${t}] Can only execute mutations`)}var K=class extends Error{locations;path;extensions;constructor(t,r={}){let a=(r.clientOperation?`[h2:error:${r.clientOperation}] `:"")+t+(r.requestId?` - Request ID: ${r.requestId}`:"");super(a),this.name="GraphQLError",this.extensions=r.extensions,this.locations=r.locations,this.path=r.path,this.stack=r.stack||void 0;try{this.cause=JSON.stringify({...typeof r.cause=="object"?r.cause:{},requestId:r.requestId});}catch{r.cause&&(this.cause=r.cause);}}get[Symbol.toStringTag](){return this.name}toString(){let t=`${this.name}: ${this.message}`;if(this.path)try{t+=` | path: ${JSON.stringify(this.path)}`;}catch{}if(this.extensions)try{t+=` | extensions: ${JSON.stringify(this.extensions)}`;}catch{}return t+=`
9
+ function Lt(e){let t=Array.isArray(e)?e:[e],r="";for(let a of t)a!=null&&(typeof a=="object"?r+=JSON.stringify(a):r+=a.toString());return encodeURIComponent(r)}var Ee="public",Br="private",Be="no-store",_t={maxAge:"max-age",staleWhileRevalidate:"stale-while-revalidate",sMaxAge:"s-maxage",staleIfError:"stale-if-error"};function fe(e){let t=[];return Object.keys(e).forEach(r=>{r==="mode"?t.push(e[r]):_t[r]&&t.push(`${_t[r]}=${e[r]}`);}),t.join(", ")}function We(){return {mode:Be}}function je(e){if(e?.mode&&e?.mode!==Ee&&e?.mode!==Br)throw Error("'mode' must be either 'public' or 'private'")}function oe(e){return je(e),{mode:Ee,maxAge:1,staleWhileRevalidate:9,...e}}function Ke(e){return je(e),{mode:Ee,maxAge:3600,staleWhileRevalidate:82800,...e}}function ae(e){return je(e),{mode:Ee,maxAge:1,staleWhileRevalidate:86399,...e}}function ze(e){return e}function K(e){return String(e).includes("__proto__")?JSON.parse(e,Wr):JSON.parse(e)}function Wr(e,t){if(e!=="__proto__")return t}function De(e,t){return e&&t?{...e,...t}:e||ae()}function Je(e){return fe(De(e))}async function jr(e,t){if(!e)return;let r=await e.match(t);if(!r){return}return r}async function Kr(e,t,r,a){if(!e)return;let o=De(a),n=Je(De(o,{maxAge:(o.maxAge||0)+(o.staleWhileRevalidate||0)})),i=Je(De(o));r.headers.set("cache-control",n),r.headers.set("real-cache-control",i),r.headers.set("cache-put-date",new Date().toUTCString()),await e.put(t,r);}async function zr(e,t){e&&await e.delete(t);}function Jr(e,t){let r=e.headers.get("real-cache-control"),a=0;if(r){let n=r.match(/max-age=(\d*)/);n&&n.length>1&&(a=parseFloat(n[1]));}return [(new Date().valueOf()-new Date(t).valueOf())/1e3,a]}function Yr(e,t){let r=t.headers.get("cache-put-date");if(!r)return !1;let[a,o]=Jr(t,r),n=a>o;return n}var xe={get:jr,set:Kr,delete:zr,generateDefaultCacheControlHeader:Je,isStale:Yr};function me(e){return `https://shopify.dev/?${e}`}function Xr(e){return e||ae()}async function Ut(e,t){if(!e)return;let r=me(t),a=new Request(r),o=await xe.get(e,a);if(!o)return;let n=await o.text();try{return [K(n),o]}catch{return [n,o]}}async function Nt(e,t,r,a){if(!e)return;let o=me(t),n=new Request(o),i=new Response(JSON.stringify(r));await xe.set(e,n,i,Xr(a));}function Vt(e,t){return xe.isStale(new Request(me(e)),t)}function Mt(e,t){return [e,{status:t.status,statusText:t.statusText,headers:Array.from(t.headers.entries())}]}function Ft([e,t]){return [e,new Response(e,t)]}var $t=(e,t)=>!e?.errors&&t.status<400,Ye=new Set;async function Xe(e,t,{strategy:r=oe(),cacheInstance:a,shouldCacheResult:o=()=>!0,waitUntil:n,debugInfo:i}){let c=Lt([...typeof e=="string"?[e]:e]),y=f=>{({displayName:f.displayName,url:f.response?.url,responseInit:{status:f.response?.status||0,statusText:f.response?.statusText||"",headers:Array.from(f.response?.headers.entries()||[])}});},l=void 0;if(!a||!r||r.mode===Be){let f=await t({addDebugData:y});return f}let d=f=>Nt(a,c,{value:f,debugInfo:void 0},r),g=await Ut(a,c);if(g&&typeof g[0]!="string"){let[{value:f,debugInfo:I},v]=g;let N=Vt(c,v)?"STALE":"HIT";if(!Ye.has(c)&&N==="STALE"){Ye.add(c);let F=Promise.resolve().then(async()=>{let te=Date.now();try{let L=await t({addDebugData:y});o(L)&&(await d(L),l?.({result:L,cacheStatus:"PUT",overrideStartTime:te}));}catch(L){L.message&&(L.message="SWR in sub-request failed: "+L.message),console.error(L);}finally{Ye.delete(c);}});n?.(F);}return f}let h=await t({addDebugData:y});if(o(h)){let f=Promise.resolve().then(async()=>{await d(h);});n?.(f);}return h}async function qt(e,t,{cacheInstance:r,cache:a,cacheKey:o=[e,t],shouldCacheResponse:n=()=>!0,waitUntil:i,returnType:u="json",debugInfo:c}={}){return !a&&(!t.method||t.method==="GET")&&(a=oe()),Xe(o,async()=>{let s=await fetch(e,t),p;try{p=await s[u]();}catch{try{p=await s.text();}catch{return Mt("",s)}}return Mt(p,s)},{cacheInstance:r,waitUntil:i,strategy:a??null,debugInfo:c,shouldCacheResult:s=>n(...Ft(s))}).then(Ft)}var ge="2024.4.4";var Ze="Custom-Storefront-Request-Group-ID",et="X-Shopify-Storefront-Access-Token",tt="X-SDK-Variant",rt="X-SDK-Variant-Source",ot="X-SDK-Version",Oe="2024-04",ne=`Shopify Hydrogen ${ge}`,Ht="30243aa5-17c1-465a-8493-944bcc4e88aa",E="customerAccount",ie="buyer";function Qt(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():`weak-${Math.random().toString(16).substring(2)}`}var Gt=new Set,Wt=e=>{Gt.has(e)||(console.warn(e),Gt.add(e));},Bt=new Set,at=e=>{Bt.has(e)||(console.error(new Error(e)),Bt.add(e));};function se(e){return e.replace(/\s*#.*$/gm,"").replace(/\s+/gm," ").trim()}var Zr=/(^|}\s)query[\s({]/im,eo=/(^|}\s)mutation[\s({]/im;function ke(e,t){if(!Zr.test(e))throw new Error(`[h2:error:${t}] Can only execute queries`)}function Le(e,t){if(!eo.test(e))throw new Error(`[h2:error:${t}] Can only execute mutations`)}var z=class extends Error{locations;path;extensions;constructor(t,r={}){let o=(r.clientOperation?`[h2:error:${r.clientOperation}] `:"")+t+(r.requestId?` - Request ID: ${r.requestId}`:"");super(o),this.name="GraphQLError",this.extensions=r.extensions,this.locations=r.locations,this.path=r.path,this.stack=r.stack||void 0;try{this.cause=JSON.stringify({...typeof r.cause=="object"?r.cause:{},requestId:r.requestId});}catch{r.cause&&(this.cause=r.cause);}}get[Symbol.toStringTag](){return this.name}toString(){let t=`${this.name}: ${this.message}`;if(this.path)try{t+=` | path: ${JSON.stringify(this.path)}`;}catch{}if(this.extensions)try{t+=` | extensions: ${JSON.stringify(this.extensions)}`;}catch{}return t+=`
10
10
  `,this.stack&&(t+=`${this.stack.slice(this.stack.indexOf(`
11
11
  `)+1)}
12
- `),t}toJSON(){return {name:"Error",message:""}}};function ge({url:e,response:t,errors:r,type:o,query:a,queryVariables:s,ErrorConstructor:n=Error,client:i="storefront"}){let u=(typeof r=="string"?r:r?.map?.(d=>d.message).join(`
12
+ `),t}toJSON(){return {name:"Error",message:""}}};function he({url:e,response:t,errors:r,type:a,query:o,queryVariables:n,ErrorConstructor:i=Error,client:u="storefront"}){let c=(typeof r=="string"?r:r?.map?.(p=>p.message).join(`
13
13
  `))||`URL: ${e}
14
- API response error: ${t.status}`,c=new K(u,{query:a,queryVariables:s,cause:{errors:r},clientOperation:`${i}.${o}`,requestId:t.headers.get("x-request-id")});throw new n(c.message,{cause:c.cause})}function ie(e,t={}){let r=new Error,o=(a,s="Error")=>{let n=(r.stack??"").split(`
14
+ API response error: ${t.status}`,s=new z(c,{query:o,queryVariables:n,cause:{errors:r},clientOperation:`${u}.${a}`,requestId:t.headers.get("x-request-id")});throw new i(s.message,{cause:s.cause})}function ce(e,t={}){let r=new Error,a=(o,n="Error")=>{let i=(r.stack??"").split(`
15
15
  `).slice(3+(t.stackOffset??0)).join(`
16
- `).replace(/ at loader(\d+) \(/,(i,u)=>i.replace(u,""));return `${s}: ${a}
17
- `+n};return e.then(a=>{if(a?.errors&&Array.isArray(a.errors)){let s=typeof t.logErrors=="function"?t.logErrors:()=>t.logErrors??!1;a.errors.forEach(n=>{n&&(n.stack=o(n.message,n.name),s(n)&&console.error(n));});}return a}).catch(a=>{throw a&&(a.stack=o(a.message,a.name)),a})}var q=void 0;var Zr={language:"EN",country:"US"};function Nn(e){let {storefrontHeaders:t,cache:r,waitUntil:o,i18n:a,storefrontId:s,logErrors:n=!0,...i}=e,{getPublicTokenHeaders:c,getPrivateTokenHeaders:d,getStorefrontApiUrl:y,getShopifyDomain:m}=createStorefrontClient(i),l=(i.privateStorefrontToken?d:c)({contentType:"json",buyerIp:t?.buyerIp||""});if(l[Ye]=t?.requestGroupId||$t(),s&&(l[SHOPIFY_STOREFRONT_ID_HEADER]=s),(l["user-agent"]=`Hydrogen ${me}`),t&&t.cookie){let f=getShopifyCookies(t.cookie??"");f[SHOPIFY_Y]&&(l[SHOPIFY_STOREFRONT_Y_HEADER]=f[SHOPIFY_Y]),f[SHOPIFY_S]&&(l[SHOPIFY_STOREFRONT_S_HEADER]=f[SHOPIFY_S]);}let g=JSON.stringify({"content-type":l["content-type"],"user-agent":l["user-agent"],[Ze]:l[Ze],[et]:l[et],[tt]:l[tt],[Xe]:l[Xe]});async function S({query:f,mutation:R,variables:v,cache:N,headers:F=[],storefrontApiVersion:ee,displayName:_,stackInfo:we}){let h=F instanceof Headers?Object.fromEntries(F.entries()):Array.isArray(F)?Object.fromEntries(F):F,C=f??R,A={...v};a&&(!v?.country&&/\$country/.test(C)&&(A.country=a.country),!v?.language&&/\$language/.test(C)&&(A.language=a.language));let T=y({storefrontApiVersion:ee}),M=JSON.stringify({query:C,variables:A}),V={method:"POST",headers:{...l,...h},body:M},D=[T,V.method,g,V.body],[O,U]=await Vt(T,V,{cacheInstance:R?void 0:r,cache:N||oe(),cacheKey:D,shouldCacheResponse:Mt,waitUntil:o,debugInfo:{requestId:V.headers[Ye],displayName:_,url:T,stackInfo:we,graphql:M,purpose:t?.purpose}}),b={url:T,response:U,type:R?"mutation":"query",query:C,queryVariables:A,errors:void 0};if(!U.ok){let $;try{$=j(O);}catch{$=[{message:O}];}ge({...b,errors:$});}let{data:L,errors:de}=O,te=de?.map(({message:$,...le})=>new K($,{...le,clientOperation:`storefront.${b.type}`,requestId:U.headers.get("x-request-id"),queryVariables:A,query:C}));return P(L,te)}return {storefront:{query(f,R){f=se(f),Oe(f,"storefront.query");let v=Qt?.(f);return ie(S({...R,query:f,stackInfo:q?.(v)}),{stackOffset:v,logErrors:n})},mutate(f,R){f=se(f),Ue(f,"storefront.mutate");let v=Qt?.(f);return ie(S({...R,mutation:f,stackInfo:q?.(v)}),{stackOffset:v,logErrors:n})},cache:r,CacheNone:Ge,CacheLong:We,CacheShort:re,CacheCustom:je,generateCacheControlHeader:ye,getPublicTokenHeaders:c,getPrivateTokenHeaders:d,getShopifyDomain:m,getApiUrl:y,i18n:a??Zr}}}var Qt=void 0;function P(e,t){return {...e,...t&&{errors:t}}}function _e(e,t){let r=e.headers?.get?.(t)??e.headers?.[t];return typeof r=="string"?r:null}function z(e){return {requestId:e?_e(e,"request-id"):void 0,purpose:e?_e(e,"purpose"):void 0}}function Hn({cache:e,waitUntil:t,request:r}){return function(a,s,n){return Je(a,n,{strategy:s,cacheInstance:e,waitUntil:t,debugInfo:{...z(r),stackInfo:q?.()}})}}var rt=class{#e;constructor(){this.#e=new Map;}add(t){throw new Error("Method not implemented. Use `put` instead.")}addAll(t){throw new Error("Method not implemented. Use `put` instead.")}matchAll(t,r){throw new Error("Method not implemented. Use `match` instead.")}async put(t,r){if(t.method!=="GET")throw new TypeError("Cannot cache response to non-GET request.");if(r.status===206)throw new TypeError("Cannot cache response to a range request (206 Partial Content).");if(r.headers.get("vary")?.includes("*"))throw new TypeError("Cannot cache response with 'Vary: *' header.");this.#e.set(t.url,{body:new Uint8Array(await r.arrayBuffer()),status:r.status,headers:[...r.headers],timestamp:Date.now()});}async match(t){if(t.method!=="GET")return;let r=this.#e.get(t.url);if(!r)return;let{body:o,timestamp:a,...s}=r,n=new Headers(s.headers),i=n.get("cache-control")||n.get("real-cache-control")||"",u=parseInt(i.match(/max-age=(\d+)/)?.[1]||"0",10),c=parseInt(i.match(/stale-while-revalidate=(\d+)/)?.[1]||"0",10),d=(Date.now()-a)/1e3;if(d>u+c){this.#e.delete(t.url);return}let m=d>u;return n.set("cache",m?"STALE":"HIT"),n.set("date",new Date(a).toUTCString()),new Response(o,{status:s.status??200,headers:n})}async delete(t){return this.#e.has(t.url)?(this.#e.delete(t.url),!0):!1}keys(t){let r=[];for(let o of this.#e.keys())(!t||t.url===o)&&r.push(new Request(o));return Promise.resolve(r)}};function ke(e){if(!e)return;let{pathname:t,search:r}=new URL(e),o=t+r,a=new URLSearchParams(r),s=a.get("return_to")||a.get("redirect");if(s){if(Bt(e,s))return s;console.warn(`Cross-domain redirects are not supported. Tried to redirect from ${o} to ${s}`);}}function Bt(e,t){try{return new URL(e).origin===new URL(t,e).origin}catch{return !1}}function ot({requestUrl:e,defaultUrl:t,redirectUrl:r}){let o=e,a=Gt(e,t),s=r?Gt(e,r):a;return Bt(e,s.toString())?s.toString():(console.warn(`Cross-domain redirects are not supported. Tried to redirect from ${o} to ${s}. Default url ${a} is used instead.`),a.toString())}function Gt(e,t){return eo(t)?new URL(t):new URL(t,new URL(e).origin)}function eo(e){try{return new URL(e),!0}catch{return !1}}async function to(e){let{storefront:t,request:r,noAdminRedirect:o,matchQueryParams:a,response:s=new Response("Not Found",{status:404})}=e,n=new URL(r.url),{pathname:i,searchParams:u}=n,c=u.has("_data");u.delete("redirect"),u.delete("return_to"),u.delete("_data");let d=(a?n.toString().replace(n.origin,""):i).toLowerCase();if(n.pathname==="/admin"&&!o)return nt(`${t.getShopifyDomain()}/admin`,c,u,a);try{let{urlRedirects:y}=await t.query(ro,{variables:{query:"path:"+d}}),m=y?.edges?.[0]?.node?.target;if(m)return nt(m,c,u,a);let p=ke(r.url);if(p)return nt(p,c,u,a)}catch(y){console.error(`Failed to fetch redirects from Storefront API for route ${d}`,y);}return s}var at="https://example.com";function nt(e,t,r,o){let a=new URL(e,at);if(!o)for(let[s,n]of r)a.searchParams.append(s,n);return t?new Response(null,{status:200,headers:{"X-Remix-Redirect":a.toString().replace(at,""),"X-Remix-Status":"301"}}):new Response(null,{status:301,headers:{location:a.toString().replace(at,"")}})}var ro=`#graphql
16
+ `).replace(/ at loader(\d+) \(/,(u,c)=>u.replace(c,""));return `${n}: ${o}
17
+ `+i};return e.then(o=>{if(o?.errors&&Array.isArray(o.errors)){let n=typeof t.logErrors=="function"?t.logErrors:()=>t.logErrors??!1;o.errors.forEach(i=>{i&&(i.stack=a(i.message,i.name),n(i)&&console.error(i));});}return o}).catch(o=>{throw o&&(o.stack=a(o.message,o.name)),o})}var q=void 0;var io={language:"EN",country:"US"};function Jn(e){let {storefrontHeaders:t,cache:r,waitUntil:a,i18n:o,storefrontId:n,logErrors:i=!0,...u}=e,{getPublicTokenHeaders:s,getPrivateTokenHeaders:p,getStorefrontApiUrl:y,getShopifyDomain:m}=createStorefrontClient(u),d=(u.privateStorefrontToken?p:s)({contentType:"json",buyerIp:t?.buyerIp||""});if(d[Ze]=t?.requestGroupId||Qt(),n&&(d[SHOPIFY_STOREFRONT_ID_HEADER]=n),(d["user-agent"]=`Hydrogen ${ge}`),t&&t.cookie){let f=getShopifyCookies(t.cookie??"");f[SHOPIFY_Y]&&(d[SHOPIFY_STOREFRONT_Y_HEADER]=f[SHOPIFY_Y]),f[SHOPIFY_S]&&(d[SHOPIFY_STOREFRONT_S_HEADER]=f[SHOPIFY_S]);}let g=JSON.stringify({"content-type":d["content-type"],"user-agent":d["user-agent"],[tt]:d[tt],[rt]:d[rt],[ot]:d[ot],[et]:d[et]});async function h({query:f,mutation:I,variables:v,cache:N,headers:F=[],storefrontApiVersion:te,displayName:L,stackInfo:be}){let C=F instanceof Headers?Object.fromEntries(F.entries()):Array.isArray(F)?Object.fromEntries(F):F,S=f??I,A={...v};o&&(!v?.country&&/\$country/.test(S)&&(A.country=o.country),!v?.language&&/\$language/.test(S)&&(A.language=o.language));let T=y({storefrontApiVersion:te}),V=JSON.stringify({query:S,variables:A}),M={method:"POST",headers:{...d,...C},body:V},x=[T,M.method,g,M.body],[O,k]=await qt(T,M,{cacheInstance:I?void 0:r,cache:N||ae(),cacheKey:x,shouldCacheResponse:$t,waitUntil:a,debugInfo:{requestId:M.headers[Ze],displayName:L,url:T,stackInfo:be,graphql:V,purpose:t?.purpose}}),b={url:T,response:k,type:I?"mutation":"query",query:S,queryVariables:A,errors:void 0};if(!k.ok){let $;try{$=K(O);}catch{$=[{message:O}];}he({...b,errors:$});}let{data:U,errors:le}=O,re=le?.map(({message:$,...ye})=>new z($,{...ye,clientOperation:`storefront.${b.type}`,requestId:k.headers.get("x-request-id"),queryVariables:A,query:S}));return P(U,re)}return {storefront:{query(f,I){f=se(f),ke(f,"storefront.query");let v=zt?.(f);return ce(h({...I,query:f,stackInfo:q?.(v)}),{stackOffset:v,logErrors:i})},mutate(f,I){f=se(f),Le(f,"storefront.mutate");let v=zt?.(f);return ce(h({...I,mutation:f,stackInfo:q?.(v)}),{stackOffset:v,logErrors:i})},cache:r,CacheNone:We,CacheLong:Ke,CacheShort:oe,CacheCustom:ze,generateCacheControlHeader:fe,getPublicTokenHeaders:s,getPrivateTokenHeaders:p,getShopifyDomain:m,getApiUrl:y,i18n:o??io}}}var zt=void 0;function P(e,t){return {...e,...t&&{errors:t}}}function _e(e,t){let r=e.headers?.get?.(t)??e.headers?.[t];return typeof r=="string"?r:null}function J(e){return {requestId:e?_e(e,"request-id"):void 0,purpose:e?_e(e,"purpose"):void 0}}function ri({cache:e,waitUntil:t,request:r}){return function(o,n,i){return Xe(o,i,{strategy:n,cacheInstance:e,waitUntil:t,debugInfo:{...J(r),stackInfo:q?.()}})}}var nt=class{#e;constructor(){this.#e=new Map;}add(t){throw new Error("Method not implemented. Use `put` instead.")}addAll(t){throw new Error("Method not implemented. Use `put` instead.")}matchAll(t,r){throw new Error("Method not implemented. Use `match` instead.")}async put(t,r){if(t.method!=="GET")throw new TypeError("Cannot cache response to non-GET request.");if(r.status===206)throw new TypeError("Cannot cache response to a range request (206 Partial Content).");if(r.headers.get("vary")?.includes("*"))throw new TypeError("Cannot cache response with 'Vary: *' header.");this.#e.set(t.url,{body:new Uint8Array(await r.arrayBuffer()),status:r.status,headers:[...r.headers],timestamp:Date.now()});}async match(t){if(t.method!=="GET")return;let r=this.#e.get(t.url);if(!r)return;let{body:a,timestamp:o,...n}=r,i=new Headers(n.headers),u=i.get("cache-control")||i.get("real-cache-control")||"",c=parseInt(u.match(/max-age=(\d+)/)?.[1]||"0",10),s=parseInt(u.match(/stale-while-revalidate=(\d+)/)?.[1]||"0",10),p=(Date.now()-o)/1e3;if(p>c+s){this.#e.delete(t.url);return}let m=p>c;return i.set("cache",m?"STALE":"HIT"),i.set("date",new Date(o).toUTCString()),new Response(a,{status:n.status??200,headers:i})}async delete(t){return this.#e.has(t.url)?(this.#e.delete(t.url),!0):!1}keys(t){let r=[];for(let a of this.#e.keys())(!t||t.url===a)&&r.push(new Request(a));return Promise.resolve(r)}};function Ue(e){if(!e)return;let{pathname:t,search:r}=new URL(e),a=t+r,o=new URLSearchParams(r),n=o.get("return_to")||o.get("redirect");if(n){if(Yt(e,n))return n;console.warn(`Cross-domain redirects are not supported. Tried to redirect from ${a} to ${n}`);}}function Yt(e,t){try{return new URL(e).origin===new URL(t,e).origin}catch{return !1}}function it({requestUrl:e,defaultUrl:t,redirectUrl:r}){let a=e,o=Jt(e,t),n=r?Jt(e,r):o;return Yt(e,n.toString())?n.toString():(console.warn(`Cross-domain redirects are not supported. Tried to redirect from ${a} to ${n}. Default url ${o} is used instead.`),o.toString())}function Jt(e,t){return so(t)?new URL(t):new URL(t,new URL(e).origin)}function so(e){try{return new URL(e),!0}catch{return !1}}async function co(e){let{storefront:t,request:r,noAdminRedirect:a,matchQueryParams:o,response:n=new Response("Not Found",{status:404})}=e,i=new URL(r.url),{pathname:u,searchParams:c}=i,s=c.has("_data");c.delete("redirect"),c.delete("return_to"),c.delete("_data");let p=(o?i.toString().replace(i.origin,""):u).toLowerCase();if(i.pathname==="/admin"&&!a)return ct(`${t.getShopifyDomain()}/admin`,s,c,o);try{let{urlRedirects:y}=await t.query(uo,{variables:{query:"path:"+p.replace(/\/+$/,"")}}),m=y?.edges?.[0]?.node?.target;if(m)return ct(m,s,c,o);let l=Ue(r.url);if(l)return ct(l,s,c,o)}catch(y){console.error(`Failed to fetch redirects from Storefront API for route ${p}`,y);}return n}var st="https://example.com";function ct(e,t,r,a){let o=new URL(e,st);if(!a)for(let[n,i]of r)o.searchParams.append(n,i);return t?new Response(null,{status:200,headers:{"X-Remix-Redirect":o.toString().replace(st,""),"X-Remix-Status":"301"}}):new Response(null,{status:301,headers:{location:o.toString().replace(st,"")}})}var uo=`#graphql
18
18
  query redirects($query: String) {
19
19
  urlRedirects(first: 1, query: $query) {
20
20
  edges {
@@ -24,12 +24,12 @@ API response error: ${t.status}`,c=new K(u,{query:a,queryVariables:s,cause:{erro
24
24
  }
25
25
  }
26
26
  }
27
- `;var oo=async function({request:t,context:r}){let o=r.storefront,a=r.customerAccount,s=new URL(t.url);if(!o)throw new Error("GraphiQL: Hydrogen's storefront client must be injected in the loader context.");let n={};if(o){let c="X-Shopify-Storefront-Access-Token";n.storefront={name:"Storefront API",authHeader:c,accessToken:o.getPublicTokenHeaders()[c],apiUrl:o.getApiUrl(),icon:"SF"};}if(a){let c=await(await fetch(s.origin+"/graphiql/customer-account.schema.json")).json(),d=await a.getAccessToken();c&&(n["customer-account"]={name:"Customer Account API",value:c,authHeader:"Authorization",accessToken:d,apiUrl:a.getApiUrl(),icon:"CA"});}let i="https://avatars.githubusercontent.com/u/12972006?s=48&v=4",u=String.raw;return new Response(u`
27
+ `;var po=async function({request:t,context:r}){let a=r.storefront,o=r.customerAccount,n=new URL(t.url);if(!a)throw new Error("GraphiQL: Hydrogen's storefront client must be injected in the loader context.");let i={};if(a){let s="X-Shopify-Storefront-Access-Token";i.storefront={name:"Storefront API",authHeader:s,accessToken:a.getPublicTokenHeaders()[s],apiUrl:a.getApiUrl(),icon:"SF"};}if(o){let s=await(await fetch(n.origin+"/graphiql/customer-account.schema.json")).json(),p=await o.getAccessToken();s&&(i["customer-account"]={name:"Customer Account API",value:s,authHeader:"Authorization",accessToken:p,apiUrl:o.getApiUrl(),icon:"CA"});}let u="https://avatars.githubusercontent.com/u/12972006?s=48&v=4",c=String.raw;return new Response(c`
28
28
  <!DOCTYPE html>
29
29
  <html lang="en">
30
30
  <head>
31
31
  <title>GraphiQL</title>
32
- <link rel="icon" type="image/x-icon" href="${i}" />
32
+ <link rel="icon" type="image/x-icon" href="${u}" />
33
33
  <style>
34
34
  body {
35
35
  height: 100%;
@@ -119,7 +119,7 @@ API response error: ${t.status}`,c=new K(u,{query:a,queryVariables:s,cause:{erro
119
119
  variables = JSON.stringify(JSON.parse(variables), null, 2);
120
120
  }
121
121
 
122
- const schemas = ${JSON.stringify(n)};
122
+ const schemas = ${JSON.stringify(i)};
123
123
  let lastActiveTabIndex = -1;
124
124
  let lastTabAmount = -1;
125
125
 
@@ -290,13 +290,13 @@ API response error: ${t.status}`,c=new K(u,{query:a,queryVariables:s,cause:{erro
290
290
  </script>
291
291
  </body>
292
292
  </html>
293
- `,{status:200,headers:{"content-type":"text/html"}})};var ao={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},no=/[&><\u2028\u2029]/g;function Wt(e){return e.replace(no,t=>ao[t])}var G="Error in SEO input: ",H={title:{validate:e=>{if(typeof e!="string")throw new Error(G.concat("`title` should be a string"));if(typeof e=="string"&&e.length>120)throw new Error(G.concat("`title` should not be longer than 120 characters"));return e}},description:{validate:e=>{if(typeof e!="string")throw new Error(G.concat("`description` should be a string"));if(typeof e=="string"&&e.length>155)throw new Error(G.concat("`description` should not be longer than 155 characters"));return e}},url:{validate:e=>{if(typeof e!="string")throw new Error(G.concat("`url` should be a string"));if(typeof e=="string"&&!e.startsWith("http"))throw new Error(G.concat("`url` should be a valid URL"));return e}},handle:{validate:e=>{if(typeof e!="string")throw new Error(G.concat("`handle` should be a string"));if(typeof e=="string"&&!e.startsWith("@"))throw new Error(G.concat("`handle` should start with `@`"));return e}}};function jt(e){let t=[];for(let r of Object.keys(e))switch(r){case"title":{let o=Q(H.title,e.title),a=it(e?.titleTemplate,o);if(!a)break;t.push(x("title",{title:a}),x("meta",{property:"og:title",content:a}),x("meta",{name:"twitter:title",content:a}));break}case"description":{let o=Q(H.description,e.description);if(!o)break;t.push(x("meta",{name:"description",content:o}),x("meta",{property:"og:description",content:o}),x("meta",{name:"twitter:description",content:o}));break}case"url":{let o=Q(H.url,e.url);if(!o)break;let s=o.split("?")[0].replace(/\/$/,"");t.push(x("link",{rel:"canonical",href:s}),x("meta",{property:"og:url",content:s}));break}case"handle":{let o=Q(H.handle,e.handle);if(!o)break;t.push(x("meta",{name:"twitter:site",content:o}),x("meta",{name:"twitter:creator",content:o}));break}case"media":{let o,a=B(e.media);for(let s of a)if(typeof s=="string"&&t.push(x("meta",{name:"og:image",content:s})),s&&typeof s=="object"){let n=s.type||"image",i=s?{url:s?.url,secure_url:s?.url,type:ct(s.url),width:s?.width,height:s?.height,alt:s?.altText}:{};for(let u of Object.keys(i))i[u]&&(o=i[u],t.push(x("meta",{property:`og:${n}:${u}`,content:o},i.url)));}break}case"jsonLd":{let o=B(e.jsonLd),a=0;for(let s of o){if(typeof s!="object")continue;let n=x("script",{type:"application/ld+json",children:JSON.stringify(s,(i,u)=>typeof u=="string"?Wt(u):u)},`json-ld-${s?.["@type"]||s?.name||a++}`);t.push(n);}break}case"alternates":{let o=B(e.alternates);for(let a of o){if(!a)continue;let{language:s,url:n,default:i}=a,u=s?`${s}${i?"-default":""}`:void 0;t.push(x("link",{rel:"alternate",hrefLang:u,href:n}));}break}case"robots":{if(!e.robots)break;let{maxImagePreview:o,maxSnippet:a,maxVideoPreview:s,noArchive:n,noFollow:i,noImageIndex:u,noIndex:c,noSnippet:d,noTranslate:y,unavailableAfter:m}=e.robots,p=[n&&"noarchive",u&&"noimageindex",d&&"nosnippet",y&&"notranslate",o&&`max-image-preview:${o}`,a&&`max-snippet:${a}`,s&&`max-video-preview:${s}`,m&&`unavailable_after:${m}`],l=(c?"noindex":"index")+","+(i?"nofollow":"follow");for(let g of p)g&&(l+=`,${g}`);t.push(x("meta",{name:"robots",content:l}));break}}return t.flat().sort((r,o)=>r.key.localeCompare(o.key))}function x(e,t,r){let o={tag:e,props:{},key:""};return e==="title"?(o.children=t.title,o.key=st(o),o):e==="script"?(o.children=typeof t.children=="string"?t.children:"",o.key=st(o,r),delete t.children,o.props=t,o):(o.props=t,Object.keys(o.props).forEach(a=>!o.props[a]&&delete o.props[a]),o.key=st(o,r),o)}function st(e,t){let{tag:r,props:o}=e;if(r==="title")return "0-title";if(r==="meta"){let a=o.content===t&&typeof o.property=="string"&&!o.property.endsWith("secure_url")&&"0";return [r,...[t,a],o.property||o.name].filter(n=>n).join("-")}return r==="link"?[r,o.rel,o.hrefLang||o.media].filter(s=>s).join("-").replace(/\s+/g,"-"):r==="script"?`${r}-${t}`:`${r}-${o.type}`}function it(e,t){if(t)return e?typeof e=="function"?e(t):e.replace("%s",t??""):t}function ct(e){switch(e&&e.split(".").pop()){case"svg":return "image/svg+xml";case"png":return "image/png";case"gif":return "image/gif";case"swf":return "application/x-shockwave-flash";case"mp3":return "audio/mpeg";case"jpg":case"jpeg":default:return "image/jpeg"}}function B(e){return Array.isArray(e)?e:[e]}function Q(e,t){try{return e.validate(t)}catch(r){return console.warn(r.message),t}}var lo=lazy(()=>import('./log-seo-tags-TY72EQWZ.js'));function yo({debug:e}){let t=useMatches(),r=useLocation();console.warn("[h2:warn:Seo] The `<Seo/>` component is deprecated. Use `getSeoMeta` instead.\nSee: https://shopify.dev/docs/api/hydrogen/2024-01/utilities/getseometa");let o=useMemo(()=>t.flatMap(n=>{let{handle:i,...u}=n,c={...u,...r},d=i?.seo,y=u?.data?.seo;return !d&&!y?[]:d?Le(d,c):[y]}).reduce((n,i)=>{Object.keys(i).forEach(c=>!i[c]&&delete i[c]);let{jsonLd:u}=i;return u?n?.jsonLd?Array.isArray(u)?{...n,...i,jsonLd:[...n.jsonLd,...u]}:{...n,...i,jsonLd:[...n.jsonLd,u]}:{...n,...i,jsonLd:[u]}:{...n,...i}},{}),[t,r]),{html:a,loggerMarkup:s}=useMemo(()=>{let n=jt(o),i=n.map(c=>c.tag==="script"?createElement(c.tag,{...c.props,key:c.key,dangerouslySetInnerHTML:{__html:c.children}}):createElement(c.tag,{...c.props,key:c.key},c.children)),u=createElement(Suspense,{fallback:null},createElement(lo,{headTags:n}));return {html:i,loggerMarkup:u}},[o]);return createElement(Fragment,null,a,e&&s)}function Le(e,...t){if(e instanceof Function)return Le(e(...t),...t);let r={};return Array.isArray(e)?(r=e.reduce((o,a)=>[...o,Le(a)],[]),r):e instanceof Object?(Object.entries(e).forEach(([a,s])=>{r[a]=Le(s,...t);}),r):e}function fo(...e){let t=[],r=e.reduce((o,a)=>{if(!a)return o;Object.keys(a).forEach(n=>!a[n]&&delete a[n]);let{jsonLd:s}=a;return s?o?.jsonLd?{...o,...a,jsonLd:B(o.jsonLd).concat(s)}:{...o,...a,jsonLd:[s]}:{...o,...a}},{})||{};for(let o of Object.keys(r))switch(o){case"title":{let a=Q(H.title,r.title),s=it(r?.titleTemplate,a);if(!s)break;t.push({title:s},{property:"og:title",content:s},{property:"twitter:title",content:s});break}case"description":{let a=Q(H.description,r.description);if(!a)break;t.push({name:"description",content:a},{property:"og:description",content:a},{property:"twitter:description",content:a});break}case"url":{let a=Q(H.url,r.url);if(!a)break;let n=a.split("?")[0].replace(/\/$/,"");t.push({tagName:"link",rel:"canonical",href:n},{property:"og:url",content:n});break}case"handle":{let a=Q(H.handle,r.handle);if(!a)break;t.push({property:"twitter:site",content:a},{property:"twitter:creator",content:a});break}case"media":{let a,s=B(r.media);for(let n of s)if(typeof n=="string"&&t.push({property:"og:image",content:n}),n&&typeof n=="object"){let i=n.type||"image",u=n?{url:n?.url,secure_url:n?.url,type:ct(n.url),width:n?.width,height:n?.height,alt:n?.altText}:{};for(let c of Object.keys(u))u[c]&&(a=u[c],t.push({property:`og:${i}:${c}`,content:a}));}break}case"jsonLd":{let a=B(r.jsonLd);for(let n of a)typeof n!="object"||Object.keys(n).length===0||t.push({"script:ld+json":n});break}case"alternates":{let a=B(r.alternates);for(let s of a){if(!s)continue;let{language:n,url:i,default:u}=s,c=n?`${n}${u?"-default":""}`:void 0;t.push({tagName:"link",rel:"alternate",hrefLang:c,href:i});}break}case"robots":{if(!r.robots)break;let{maxImagePreview:a,maxSnippet:s,maxVideoPreview:n,noArchive:i,noFollow:u,noImageIndex:c,noIndex:d,noSnippet:y,noTranslate:m,unavailableAfter:p}=r.robots,l=[i&&"noarchive",c&&"noimageindex",y&&"nosnippet",m&&"notranslate",a&&`max-image-preview:${a}`,s&&`max-snippet:${s}`,n&&`max-video-preview:${n}`,p&&`unavailable_after:${p}`],g=(d?"noindex":"index")+","+(u?"nofollow":"follow");for(let S of l)S&&(g+=`,${S}`);t.push({name:"robots",content:g});break}}return t}function So({connection:e,children:t=()=>(console.warn("<Pagination> requires children to work properly"),null)}){let o=useNavigation().state==="loading",{endCursor:a,hasNextPage:s,hasPreviousPage:n,nextPageUrl:i,nodes:u,previousPageUrl:c,startCursor:d}=Po(e),y=useMemo(()=>({pageInfo:{endCursor:a,hasPreviousPage:n,hasNextPage:s,startCursor:d},nodes:u}),[a,s,n,d,u]),m=useMemo(()=>forwardRef(function(g,S){return s?createElement(Link,{preventScrollReset:!0,...g,to:i,state:y,replace:!0,ref:S}):null}),[s,i,y]),p=useMemo(()=>forwardRef(function(g,S){return n?createElement(Link,{preventScrollReset:!0,...g,to:c,state:y,replace:!0,ref:S}):null}),[n,c,y]);return t({state:y,hasNextPage:s,hasPreviousPage:n,isLoading:o,nextPageUrl:i,nodes:u,previousPageUrl:c,NextLink:m,PreviousLink:p})}function Ne(e){let t=new URLSearchParams(e);return t.delete("cursor"),t.delete("direction"),t.toString()}function Ce(e){throw new Error(`The Pagination component requires ${"`"+e+"`"} to be a part of your query. See the guide on how to setup your query to include ${"`"+e+"`"}: https://shopify.dev/docs/custom-storefronts/hydrogen/data-fetching/pagination#setup-the-paginated-query`)}function Po(e){e.pageInfo||Ce("pageInfo"),typeof e.pageInfo.startCursor>"u"&&Ce("pageInfo.startCursor"),typeof e.pageInfo.endCursor>"u"&&Ce("pageInfo.endCursor"),typeof e.pageInfo.hasNextPage>"u"&&Ce("pageInfo.hasNextPage"),typeof e.pageInfo.hasPreviousPage>"u"&&Ce("pageInfo.hasPreviousPage");let t=useNavigate(),{state:r,search:o,pathname:a}=useLocation(),i=new URLSearchParams(o).get("direction")==="previous",u=useMemo(()=>!globalThis?.window?.__hydrogenHydrated||!r||!r?.nodes?flattenConnection(e):i?[...flattenConnection(e),...r.nodes]:[...r.nodes,...flattenConnection(e)],[r,e]),c=useMemo(()=>{let p=globalThis?.window?.__hydrogenHydrated,l=!p||r?.pageInfo?.startCursor===void 0?e.pageInfo.startCursor:r.pageInfo.startCursor,g=!p||r?.pageInfo?.endCursor===void 0?e.pageInfo.endCursor:r.pageInfo.endCursor,S=!p||r?.pageInfo?.hasPreviousPage===void 0?e.pageInfo.hasPreviousPage:r.pageInfo.hasPreviousPage,f=!p||r?.pageInfo?.hasNextPage===void 0?e.pageInfo.hasNextPage:r.pageInfo.hasNextPage;return r?.nodes&&(i?(l=e.pageInfo.startCursor,S=e.pageInfo.hasPreviousPage):(g=e.pageInfo.endCursor,f=e.pageInfo.hasNextPage)),{startCursor:l,endCursor:g,hasPreviousPage:S,hasNextPage:f}},[i,r,e.pageInfo.hasNextPage,e.pageInfo.hasPreviousPage,e.pageInfo.startCursor,e.pageInfo.endCursor]),d=useRef({params:Ne(o),pathname:a});useEffect(()=>{window.__hydrogenHydrated=!0;},[]),useEffect(()=>{(Ne(o)!==d.current.params||a!==d.current.pathname)&&(d.current={pathname:a,params:Ne(o)},t(`${a}?${Ne(o)}`,{replace:!0,preventScrollReset:!0,state:{nodes:void 0,pageInfo:void 0}}));},[a,o]);let y=useMemo(()=>{let p=new URLSearchParams(o);return p.set("direction","previous"),c.startCursor&&p.set("cursor",c.startCursor),`?${p.toString()}`},[o,c.startCursor]),m=useMemo(()=>{let p=new URLSearchParams(o);return p.set("direction","next"),c.endCursor&&p.set("cursor",c.endCursor),`?${p.toString()}`},[o,c.endCursor]);return {...c,previousPageUrl:y,nextPageUrl:m,nodes:u}}function Ao(e,t={pageBy:20}){if(typeof e?.url>"u")throw new Error("getPaginationVariables must be called with the Request object passed to your loader function");let{pageBy:r}=t,o=new URLSearchParams(new URL(e.url).search),a=o.get("cursor")??void 0;return (o.get("direction")==="previous"?"previous":"next")==="previous"?{last:r,startCursor:a??null}:{first:r,endCursor:a??null}}var k=class extends Response{constructor(t,r,o){super(`Bad request: ${t}`,{status:400,headers:o});}};function Pe(e,t={}){let r=t.headers?new Headers(t.headers):new Headers({});return r.set("location",e),new Response(null,{status:t.status||302,headers:r})}async function To({session:e,customerAccountId:t,customerAccountUrl:r,httpsOrigin:o,debugInfo:a,exchangeForStorefrontCustomerAccessToken:s}){let n=new URLSearchParams,u=e.get(E)?.refreshToken;if(!u)throw new k("Unauthorized","No refreshToken found in the session. Make sure your session is configured correctly and passed to `createCustomerAccountClient`.");n.append("grant_type","refresh_token"),n.append("refresh_token",u),n.append("client_id",t);let c={"content-type":"application/x-www-form-urlencoded","User-Agent":ae,Origin:o};new Date().getTime();let y=`${r}/auth/oauth/token`,m=await fetch(y,{method:"POST",headers:c,body:n});if(!m.ok){let R=await m.text();throw new Response(R,{status:m.status,headers:{"Content-Type":"text/html; charset=utf-8"}})}let{access_token:p,expires_in:l,id_token:g,refresh_token:S}=await m.json(),f=await pt(p,t,r,o);e.set(E,{accessToken:f,expiresAt:new Date(new Date().getTime()+(l-120)*1e3).getTime()+"",refreshToken:S,idToken:g}),await s();}function ce(e){e.unset(E),e.unset(ne);}async function Zt({locks:e,expiresAt:t,session:r,customerAccountId:o,customerAccountUrl:a,httpsOrigin:s,debugInfo:n,exchangeForStorefrontCustomerAccessToken:i}){if(parseInt(t,10)-1e3<new Date().getTime())try{e.refresh||(e.refresh=To({session:r,customerAccountId:o,customerAccountUrl:a,httpsOrigin:s,debugInfo:n,exchangeForStorefrontCustomerAccessToken:i})),await e.refresh,delete e.refresh;}catch(u){throw ce(r),u&&u.status!==401?u:new k("Unauthorized","Login before querying the Customer Account API.",{"Set-Cookie":await r.commit()})}}function er(){let e=vo();return rr(e)}async function tr(e){let t=await crypto.subtle.digest({name:"SHA-256"},new TextEncoder().encode(e)),r=Ro(t);return rr(r)}function vo(){let e=new Uint8Array(32);return crypto.getRandomValues(e),String.fromCharCode.apply(null,Array.from(e))}function rr(e){return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Ro(e){let t=new Uint8Array(e),r=Array.from(t);return String.fromCharCode(...r)}function or(){let e=Date.now().toString(),t=Math.random().toString(36).substring(2);return e+t}async function pt(e,t,r,o,a){let s=t;if(!e)throw new k("Unauthorized","oAuth access token was not provided during token exchange.");let n=new URLSearchParams;n.append("grant_type","urn:ietf:params:oauth:grant-type:token-exchange"),n.append("client_id",s),n.append("audience",Ft),n.append("subject_token",e),n.append("subject_token_type","urn:ietf:params:oauth:token-type:access_token"),n.append("scopes","https://api.customers.com/auth/customer.graphql");let i={"content-type":"application/x-www-form-urlencoded","User-Agent":ae,Origin:o};new Date().getTime();let c=`${r}/auth/oauth/token`,d=await fetch(c,{method:"POST",headers:i,body:n});let y=await d.json();if(y.error)throw new k(y.error_description);return y.access_token}function ar(e){return Io(e).payload.nonce}function Io(e){let[t,r,o]=e.split("."),a=JSON.parse(atob(t)),s=JSON.parse(atob(r));return {header:a,payload:s,signature:o}}function Me(){return bo(wo())}function wo(){try{return crypto.getRandomValues(new Uint8Array(16))}catch{return new Uint8Array(16).map(()=>Math.random()*255|0)}}function bo(e){return Array.from(e,function(t){return ("0"+(t&255).toString(16)).slice(-2)}).join("")}var nr="/account/login",Eo="/account/authorize",sr="/account";function xo(e){if(!e.url)return nr;let{pathname:t}=new URL(e.url),r=nr+`?${new URLSearchParams({return_to:t}).toString()}`;return Pe(r)}function Do({session:e,customerAccountId:t,customerAccountUrl:r,customerApiVersion:o=De,request:a,waitUntil:s,authUrl:n,customAuthStatusHandler:i,logErrors:u=!0,unstableB2b:c=!1}){if(o!==De&&console.warn(`[h2:warn:createCustomerAccountClient] You are using Customer Account API version ${o} when this version of Hydrogen was built for ${De}.`),!a?.url)throw new Error("[h2:error:createCustomerAccountClient] The request object does not contain a URL.");let d=i||(()=>xo(a)),y=new URL(a.url),m=y.protocol==="http:"?y.origin.replace("http","https"):y.origin,p=ot({requestUrl:m,defaultUrl:Eo,redirectUrl:n}),l=`${r}/account/customer/api/${o}/graphql`,g={};async function S({query:h,type:C,variables:A={}}){let T=await v();if(!T)throw d();new Date().getTime();let D=await fetch(l,{method:"POST",headers:{"Content-Type":"application/json","User-Agent":ae,Origin:m,Authorization:T},body:JSON.stringify({query:h,variables:A})});let O=await D.text(),U={url:l,response:D,type:C,query:h,queryVariables:A,errors:void 0,client:"customer"};if(!D.ok){if(D.status===401){ce(e);let L=d();throw L instanceof Response&&L.headers.set("Set-Cookie",await e.commit()),L}let b;try{b=j(O);}catch{b=[{message:O}];}ge({...U,errors:b});}try{let b=j(O),{errors:L}=b,de=L?.map(({message:te,...$})=>new K(te,{...$,clientOperation:`customerAccount.${U.type}`,requestId:D.headers.get("x-request-id"),queryVariables:A,query:h}));return {...b,...L&&{errors:de}}}catch{ge({...U,errors:[{message:O}]});}}async function f(){if(!r||!t)return !1;let h=e.get(E),C=h?.accessToken,A=h?.expiresAt;if(!C||!A)return !1;let T=q?.();try{await Zt({locks:g,expiresAt:A,session:e,customerAccountId:t,customerAccountUrl:r,httpsOrigin:m,debugInfo:{waitUntil:s,stackInfo:T,...z(a)},exchangeForStorefrontCustomerAccessToken:we});}catch{return !1}return !0}async function R(){if(!await f())throw d()}async function v(){if(await f())return e.get(E)?.accessToken}async function N(h,C){return Ae(r,t),h=se(h),Ue(h,"customer.mutate"),ie(S({query:h,type:"mutation",...C}),{logErrors:u})}async function F(h,C){return Ae(r,t),h=se(h),Oe(h,"customer.query"),ie(S({query:h,type:"query",...C}),{logErrors:u})}function ee(h){e.set(ne,{...e.get(ne),...h});}async function _(){if(await f())return e.get(ne)}async function we(){if(!c)return;let h=`#graphql
293
+ `,{status:200,headers:{"content-type":"text/html"}})};var lo={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},yo=/[&><\u2028\u2029]/g;function Xt(e){return e.replace(yo,t=>lo[t])}var B="Error in SEO input: ",H={title:{validate:e=>{if(typeof e!="string")throw new Error(B.concat("`title` should be a string"));if(typeof e=="string"&&e.length>120)throw new Error(B.concat("`title` should not be longer than 120 characters"));return e}},description:{validate:e=>{if(typeof e!="string")throw new Error(B.concat("`description` should be a string"));if(typeof e=="string"&&e.length>155)throw new Error(B.concat("`description` should not be longer than 155 characters"));return e}},url:{validate:e=>{if(typeof e!="string")throw new Error(B.concat("`url` should be a string"));if(typeof e=="string"&&!e.startsWith("http"))throw new Error(B.concat("`url` should be a valid URL"));return e}},handle:{validate:e=>{if(typeof e!="string")throw new Error(B.concat("`handle` should be a string"));if(typeof e=="string"&&!e.startsWith("@"))throw new Error(B.concat("`handle` should start with `@`"));return e}}};function Zt(e){let t=[];for(let r of Object.keys(e))switch(r){case"title":{let a=Q(H.title,e.title),o=pt(e?.titleTemplate,a);if(!o)break;t.push(D("title",{title:o}),D("meta",{property:"og:title",content:o}),D("meta",{name:"twitter:title",content:o}));break}case"description":{let a=Q(H.description,e.description);if(!a)break;t.push(D("meta",{name:"description",content:a}),D("meta",{property:"og:description",content:a}),D("meta",{name:"twitter:description",content:a}));break}case"url":{let a=Q(H.url,e.url);if(!a)break;let n=a.split("?")[0].replace(/\/$/,"");t.push(D("link",{rel:"canonical",href:n}),D("meta",{property:"og:url",content:n}));break}case"handle":{let a=Q(H.handle,e.handle);if(!a)break;t.push(D("meta",{name:"twitter:site",content:a}),D("meta",{name:"twitter:creator",content:a}));break}case"media":{let a,o=W(e.media);for(let n of o)if(typeof n=="string"&&t.push(D("meta",{name:"og:image",content:n})),n&&typeof n=="object"){let i=n.type||"image",u=n?{url:n?.url,secure_url:n?.url,type:dt(n.url),width:n?.width,height:n?.height,alt:n?.altText}:{};for(let c of Object.keys(u))u[c]&&(a=u[c],t.push(D("meta",{property:`og:${i}:${c}`,content:a},u.url)));}break}case"jsonLd":{let a=W(e.jsonLd),o=0;for(let n of a){if(typeof n!="object")continue;let i=D("script",{type:"application/ld+json",children:JSON.stringify(n,(u,c)=>typeof c=="string"?Xt(c):c)},`json-ld-${n?.["@type"]||n?.name||o++}`);t.push(i);}break}case"alternates":{let a=W(e.alternates);for(let o of a){if(!o)continue;let{language:n,url:i,default:u}=o,c=n?`${n}${u?"-default":""}`:void 0;t.push(D("link",{rel:"alternate",hrefLang:c,href:i}));}break}case"robots":{if(!e.robots)break;let{maxImagePreview:a,maxSnippet:o,maxVideoPreview:n,noArchive:i,noFollow:u,noImageIndex:c,noIndex:s,noSnippet:p,noTranslate:y,unavailableAfter:m}=e.robots,l=[i&&"noarchive",c&&"noimageindex",p&&"nosnippet",y&&"notranslate",a&&`max-image-preview:${a}`,o&&`max-snippet:${o}`,n&&`max-video-preview:${n}`,m&&`unavailable_after:${m}`],d=(s?"noindex":"index")+","+(u?"nofollow":"follow");for(let g of l)g&&(d+=`,${g}`);t.push(D("meta",{name:"robots",content:d}));break}}return t.flat().sort((r,a)=>r.key.localeCompare(a.key))}function D(e,t,r){let a={tag:e,props:{},key:""};return e==="title"?(a.children=t.title,a.key=ut(a),a):e==="script"?(a.children=typeof t.children=="string"?t.children:"",a.key=ut(a,r),delete t.children,a.props=t,a):(a.props=t,Object.keys(a.props).forEach(o=>!a.props[o]&&delete a.props[o]),a.key=ut(a,r),a)}function ut(e,t){let{tag:r,props:a}=e;if(r==="title")return "0-title";if(r==="meta"){let o=a.content===t&&typeof a.property=="string"&&!a.property.endsWith("secure_url")&&"0";return [r,...[t,o],a.property||a.name].filter(i=>i).join("-")}return r==="link"?[r,a.rel,a.hrefLang||a.media].filter(n=>n).join("-").replace(/\s+/g,"-"):r==="script"?`${r}-${t}`:`${r}-${a.type}`}function pt(e,t){if(t)return e?typeof e=="function"?e(t):e.replace("%s",t??""):t}function dt(e){switch(e&&e.split(".").pop()){case"svg":return "image/svg+xml";case"png":return "image/png";case"gif":return "image/gif";case"swf":return "application/x-shockwave-flash";case"mp3":return "audio/mpeg";case"jpg":case"jpeg":default:return "image/jpeg"}}function W(e){return Array.isArray(e)?e:[e]}function Q(e,t){try{return e.validate(t)}catch(r){return console.warn(r.message),t}}var So=lazy(()=>import('./log-seo-tags-TY72EQWZ.js'));function Po({debug:e}){let t=useMatches(),r=useLocation();console.warn("[h2:warn:Seo] The `<Seo/>` component is deprecated. Use `getSeoMeta` instead.\nSee: https://shopify.dev/docs/api/hydrogen/2024-01/utilities/getseometa");let a=useMemo(()=>t.flatMap(i=>{let{handle:u,...c}=i,s={...c,...r},p=u?.seo,y=c?.data?.seo;return !p&&!y?[]:p?Ne(p,s):[y]}).reduce((i,u)=>{Object.keys(u).forEach(s=>!u[s]&&delete u[s]);let{jsonLd:c}=u;return c?i?.jsonLd?Array.isArray(c)?{...i,...u,jsonLd:[...i.jsonLd,...c]}:{...i,...u,jsonLd:[...i.jsonLd,c]}:{...i,...u,jsonLd:[c]}:{...i,...u}},{}),[t,r]),{html:o,loggerMarkup:n}=useMemo(()=>{let i=Zt(a),u=i.map(s=>s.tag==="script"?createElement(s.tag,{...s.props,key:s.key,dangerouslySetInnerHTML:{__html:s.children}}):createElement(s.tag,{...s.props,key:s.key},s.children)),c=createElement(Suspense,{fallback:null},createElement(So,{headTags:i}));return {html:u,loggerMarkup:c}},[a]);return createElement(Fragment,null,o,e&&n)}function Ne(e,...t){if(e instanceof Function)return Ne(e(...t),...t);let r={};return Array.isArray(e)?(r=e.reduce((a,o)=>[...a,Ne(o)],[]),r):e instanceof Object?(Object.entries(e).forEach(([o,n])=>{r[o]=Ne(n,...t);}),r):e}function Ao(...e){let t=[],r=e.reduce((a,o)=>{if(!o)return a;Object.keys(o).forEach(i=>!o[i]&&delete o[i]);let{jsonLd:n}=o;return n?a?.jsonLd?{...a,...o,jsonLd:W(a.jsonLd).concat(n)}:{...a,...o,jsonLd:[n]}:{...a,...o}},{})||{};for(let a of Object.keys(r))switch(a){case"title":{let o=Q(H.title,r.title),n=pt(r?.titleTemplate,o);if(!n)break;t.push({title:n},{property:"og:title",content:n},{property:"twitter:title",content:n});break}case"description":{let o=Q(H.description,r.description);if(!o)break;t.push({name:"description",content:o},{property:"og:description",content:o},{property:"twitter:description",content:o});break}case"url":{let o=Q(H.url,r.url);if(!o)break;let i=o.split("?")[0].replace(/\/$/,"");t.push({tagName:"link",rel:"canonical",href:i},{property:"og:url",content:i});break}case"handle":{let o=Q(H.handle,r.handle);if(!o)break;t.push({property:"twitter:site",content:o},{property:"twitter:creator",content:o});break}case"media":{let o,n=W(r.media);for(let i of n)if(typeof i=="string"&&t.push({property:"og:image",content:i}),i&&typeof i=="object"){let u=i.type||"image",c=i?{url:i?.url,secure_url:i?.url,type:dt(i.url),width:i?.width,height:i?.height,alt:i?.altText}:{};for(let s of Object.keys(c))c[s]&&(o=c[s],t.push({property:`og:${u}:${s}`,content:o}));}break}case"jsonLd":{let o=W(r.jsonLd);for(let i of o)typeof i!="object"||Object.keys(i).length===0||t.push({"script:ld+json":i});break}case"alternates":{let o=W(r.alternates);for(let n of o){if(!n)continue;let{language:i,url:u,default:c}=n,s=i?`${i}${c?"-default":""}`:void 0;t.push({tagName:"link",rel:"alternate",hrefLang:s,href:u});}break}case"robots":{if(!r.robots)break;let{maxImagePreview:o,maxSnippet:n,maxVideoPreview:i,noArchive:u,noFollow:c,noImageIndex:s,noIndex:p,noSnippet:y,noTranslate:m,unavailableAfter:l}=r.robots,d=[u&&"noarchive",s&&"noimageindex",y&&"nosnippet",m&&"notranslate",o&&`max-image-preview:${o}`,n&&`max-snippet:${n}`,i&&`max-video-preview:${i}`,l&&`unavailable_after:${l}`],g=(p?"noindex":"index")+","+(c?"nofollow":"follow");for(let h of d)h&&(g+=`,${h}`);t.push({name:"robots",content:g});break}}return t}function wo({connection:e,children:t=()=>(console.warn("<Pagination> requires children to work properly"),null)}){let a=useNavigation().state==="loading",{endCursor:o,hasNextPage:n,hasPreviousPage:i,nextPageUrl:u,nodes:c,previousPageUrl:s,startCursor:p}=bo(e),y=useMemo(()=>({pageInfo:{endCursor:o,hasPreviousPage:i,hasNextPage:n,startCursor:p},nodes:c}),[o,n,i,p,c]),m=useMemo(()=>forwardRef(function(g,h){return n?createElement(Link,{preventScrollReset:!0,...g,to:u,state:y,replace:!0,ref:h}):null}),[n,u,y]),l=useMemo(()=>forwardRef(function(g,h){return i?createElement(Link,{preventScrollReset:!0,...g,to:s,state:y,replace:!0,ref:h}):null}),[i,s,y]);return t({state:y,hasNextPage:n,hasPreviousPage:i,isLoading:a,nextPageUrl:u,nodes:c,previousPageUrl:s,NextLink:m,PreviousLink:l})}function Ve(e){let t=new URLSearchParams(e);return t.delete("cursor"),t.delete("direction"),t.toString()}function Se(e){throw new Error(`The Pagination component requires ${"`"+e+"`"} to be a part of your query. See the guide on how to setup your query to include ${"`"+e+"`"}: https://shopify.dev/docs/custom-storefronts/hydrogen/data-fetching/pagination#setup-the-paginated-query`)}function bo(e){e.pageInfo||Se("pageInfo"),typeof e.pageInfo.startCursor>"u"&&Se("pageInfo.startCursor"),typeof e.pageInfo.endCursor>"u"&&Se("pageInfo.endCursor"),typeof e.pageInfo.hasNextPage>"u"&&Se("pageInfo.hasNextPage"),typeof e.pageInfo.hasPreviousPage>"u"&&Se("pageInfo.hasPreviousPage");let t=useNavigate(),{state:r,search:a,pathname:o}=useLocation(),u=new URLSearchParams(a).get("direction")==="previous",c=useMemo(()=>!globalThis?.window?.__hydrogenHydrated||!r||!r?.nodes?flattenConnection(e):u?[...flattenConnection(e),...r.nodes]:[...r.nodes,...flattenConnection(e)],[r,e]),s=useMemo(()=>{let l=globalThis?.window?.__hydrogenHydrated,d=!l||r?.pageInfo?.startCursor===void 0?e.pageInfo.startCursor:r.pageInfo.startCursor,g=!l||r?.pageInfo?.endCursor===void 0?e.pageInfo.endCursor:r.pageInfo.endCursor,h=!l||r?.pageInfo?.hasPreviousPage===void 0?e.pageInfo.hasPreviousPage:r.pageInfo.hasPreviousPage,f=!l||r?.pageInfo?.hasNextPage===void 0?e.pageInfo.hasNextPage:r.pageInfo.hasNextPage;return r?.nodes&&(u?(d=e.pageInfo.startCursor,h=e.pageInfo.hasPreviousPage):(g=e.pageInfo.endCursor,f=e.pageInfo.hasNextPage)),{startCursor:d,endCursor:g,hasPreviousPage:h,hasNextPage:f}},[u,r,e.pageInfo.hasNextPage,e.pageInfo.hasPreviousPage,e.pageInfo.startCursor,e.pageInfo.endCursor]),p=useRef({params:Ve(a),pathname:o});useEffect(()=>{window.__hydrogenHydrated=!0;},[]),useEffect(()=>{(Ve(a)!==p.current.params||o!==p.current.pathname)&&(p.current={pathname:o,params:Ve(a)},t(`${o}?${Ve(a)}`,{replace:!0,preventScrollReset:!0,state:{nodes:void 0,pageInfo:void 0}}));},[o,a]);let y=useMemo(()=>{let l=new URLSearchParams(a);return l.set("direction","previous"),s.startCursor&&l.set("cursor",s.startCursor),`?${l.toString()}`},[a,s.startCursor]),m=useMemo(()=>{let l=new URLSearchParams(a);return l.set("direction","next"),s.endCursor&&l.set("cursor",s.endCursor),`?${l.toString()}`},[a,s.endCursor]);return {...s,previousPageUrl:y,nextPageUrl:m,nodes:c}}function Eo(e,t={pageBy:20}){if(typeof e?.url>"u")throw new Error("getPaginationVariables must be called with the Request object passed to your loader function");let{pageBy:r}=t,a=new URLSearchParams(new URL(e.url).search),o=a.get("cursor")??void 0;return (a.get("direction")==="previous"?"previous":"next")==="previous"?{last:r,startCursor:o??null}:{first:r,endCursor:o??null}}var _=class extends Response{constructor(t,r,a){super(`Bad request: ${t}`,{status:400,headers:a});}};function Ae(e,t={}){let r=t.headers?new Headers(t.headers):new Headers({});return r.set("location",e),new Response(null,{status:t.status||302,headers:r})}async function Do({session:e,customerAccountId:t,customerAccountUrl:r,httpsOrigin:a,debugInfo:o,exchangeForStorefrontCustomerAccessToken:n}){let i=new URLSearchParams,u=e.get(E),c=u?.refreshToken,s=u?.idToken;if(!c)throw new _("Unauthorized","No refreshToken found in the session. Make sure your session is configured correctly and passed to `createCustomerAccountClient`.");i.append("grant_type","refresh_token"),i.append("refresh_token",c),i.append("client_id",t);let p={"content-type":"application/x-www-form-urlencoded","User-Agent":ne,Origin:a};new Date().getTime();let m=`${r}/auth/oauth/token`,l=await fetch(m,{method:"POST",headers:p,body:i});if(!l.ok){let I=await l.text();throw new Response(I,{status:l.status,headers:{"Content-Type":"text/html; charset=utf-8"}})}let{access_token:d,expires_in:g,refresh_token:h}=await l.json(),f=await yt(d,t,r,a);e.set(E,{accessToken:f,expiresAt:new Date(new Date().getTime()+(g-120)*1e3).getTime()+"",refreshToken:h,idToken:s}),await n();}function ue(e){e.unset(E),e.unset(ie);}async function nr({locks:e,expiresAt:t,session:r,customerAccountId:a,customerAccountUrl:o,httpsOrigin:n,debugInfo:i,exchangeForStorefrontCustomerAccessToken:u}){if(parseInt(t,10)-1e3<new Date().getTime())try{e.refresh||(e.refresh=Do({session:r,customerAccountId:a,customerAccountUrl:o,httpsOrigin:n,debugInfo:i,exchangeForStorefrontCustomerAccessToken:u})),await e.refresh,delete e.refresh;}catch(c){throw ue(r),c&&c.status!==401?c:new _("Unauthorized","Login before querying the Customer Account API.",{"Set-Cookie":await r.commit()})}}function ir(){let e=xo();return cr(e)}async function sr(e){let t=await crypto.subtle.digest({name:"SHA-256"},new TextEncoder().encode(e)),r=Oo(t);return cr(r)}function xo(){let e=new Uint8Array(32);return crypto.getRandomValues(e),String.fromCharCode.apply(null,Array.from(e))}function cr(e){return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Oo(e){let t=new Uint8Array(e),r=Array.from(t);return String.fromCharCode(...r)}function ur(){let e=Date.now().toString(),t=Math.random().toString(36).substring(2);return e+t}async function yt(e,t,r,a,o){let n=t;if(!e)throw new _("Unauthorized","oAuth access token was not provided during token exchange.");let i=new URLSearchParams;i.append("grant_type","urn:ietf:params:oauth:grant-type:token-exchange"),i.append("client_id",n),i.append("audience",Ht),i.append("subject_token",e),i.append("subject_token_type","urn:ietf:params:oauth:token-type:access_token"),i.append("scopes","https://api.customers.com/auth/customer.graphql");let u={"content-type":"application/x-www-form-urlencoded","User-Agent":ne,Origin:a};new Date().getTime();let s=`${r}/auth/oauth/token`,p=await fetch(s,{method:"POST",headers:u,body:i});let y=await p.json();if(y.error)throw new _(y.error_description);return y.access_token}function pr(e){return ko(e).payload.nonce}function ko(e){let[t,r,a]=e.split("."),o=JSON.parse(atob(t)),n=JSON.parse(atob(r));return {header:o,payload:n,signature:a}}function Me(){return _o(Lo())}function Lo(){try{return crypto.getRandomValues(new Uint8Array(16))}catch{return new Uint8Array(16).map(()=>Math.random()*255|0)}}function _o(e){return Array.from(e,function(t){return ("0"+(t&255).toString(16)).slice(-2)}).join("")}var dr="/account/login",Uo="/account/authorize",lr="/account";function No(e){if(!e.url)return dr;let{pathname:t}=new URL(e.url),r=dr+`?${new URLSearchParams({return_to:t}).toString()}`;return Ae(r)}function Vo({session:e,customerAccountId:t,customerAccountUrl:r,customerApiVersion:a=Oe,request:o,waitUntil:n,authUrl:i,customAuthStatusHandler:u,logErrors:c=!0,unstableB2b:s=!1}){if(a!==Oe&&console.warn(`[h2:warn:createCustomerAccountClient] You are using Customer Account API version ${a} when this version of Hydrogen was built for ${Oe}.`),!o?.url)throw new Error("[h2:error:createCustomerAccountClient] The request object does not contain a URL.");let p=u||(()=>No(o)),y=new URL(o.url),m=y.protocol==="http:"?y.origin.replace("http","https"):y.origin,l=it({requestUrl:m,defaultUrl:Uo,redirectUrl:i}),d=`${r}/account/customer/api/${a}/graphql`,g={};async function h({query:C,type:S,variables:A={}}){let T=await v();if(!T)throw p();new Date().getTime();let x=await fetch(d,{method:"POST",headers:{"Content-Type":"application/json","User-Agent":ne,Origin:m,Authorization:T},body:JSON.stringify({query:C,variables:A})});let O=await x.text(),k={url:d,response:x,type:S,query:C,queryVariables:A,errors:void 0,client:"customer"};if(!x.ok){if(x.status===401){ue(e);let U=p();throw U instanceof Response&&U.headers.set("Set-Cookie",await e.commit()),U}let b;try{b=K(O);}catch{b=[{message:O}];}he({...k,errors:b});}try{let b=K(O),{errors:U}=b,le=U?.map(({message:re,...$})=>new z(re,{...$,clientOperation:`customerAccount.${k.type}`,requestId:x.headers.get("x-request-id"),queryVariables:A,query:C}));return {...b,...U&&{errors:le}}}catch{he({...k,errors:[{message:O}]});}}async function f(){if(!r||!t)return !1;let C=e.get(E),S=C?.accessToken,A=C?.expiresAt;if(!S||!A)return !1;let T=q?.();try{await nr({locks:g,expiresAt:A,session:e,customerAccountId:t,customerAccountUrl:r,httpsOrigin:m,debugInfo:{waitUntil:n,stackInfo:T,...J(o)},exchangeForStorefrontCustomerAccessToken:be});}catch{return !1}return !0}async function I(){if(!await f())throw p()}async function v(){if(await f())return e.get(E)?.accessToken}async function N(C,S){return Te(r,t),C=se(C),Le(C,"customer.mutate"),ce(h({query:C,type:"mutation",...S}),{logErrors:c})}async function F(C,S){return Te(r,t),C=se(C),ke(C,"customer.query"),ce(h({query:C,type:"query",...S}),{logErrors:c})}function te(C){e.set(ie,{...e.get(ie),...C});}async function L(){if(await f())return e.get(ie)}async function be(){if(!s)return;let C=`#graphql
294
294
  mutation storefrontCustomerAccessTokenCreate {
295
295
  storefrontCustomerAccessTokenCreate {
296
296
  customerAccessToken
297
297
  }
298
298
  }
299
- `,{data:C}=await N(h),A=C?.storefrontCustomerAccessTokenCreate?.customerAccessToken;A&&ee({customerAccessToken:A});}return {login:async h=>{Ae(r,t);let C=new URL(`${r}/auth/oauth/authorize`),A=or(),T=Me();if(C.searchParams.set("client_id",t),C.searchParams.set("scope","openid email"),C.searchParams.append("response_type","code"),C.searchParams.append("redirect_uri",p),C.searchParams.set("scope","openid email https://api.customers.com/auth/customer.graphql"),C.searchParams.append("state",A),C.searchParams.append("nonce",T),h?.uiLocales){let[D,O]=h.uiLocales.split("-"),U=D.toLowerCase();O&&(U+=`-${O.toUpperCase()}`),C.searchParams.append("ui_locales",U);}let M=er(),V=await tr(M);return e.set(E,{...e.get(E),codeVerifier:M,state:A,nonce:T,redirectPath:ke(a.url)||_e(a,"Referer")||sr}),C.searchParams.append("code_challenge",V),C.searchParams.append("code_challenge_method","S256"),Pe(C.toString(),{headers:{"Set-Cookie":await e.commit()}})},logout:async h=>{Ae(r,t);let C=e.get(E)?.idToken,A=ot({requestUrl:m,defaultUrl:m,redirectUrl:h?.postLogoutRedirectUri}),T=C?new URL(`${r}/auth/logout?${new URLSearchParams([["id_token_hint",C],["post_logout_redirect_uri",A]]).toString()}`).toString():A;return ce(e),Pe(T,{status:302,headers:{"Set-Cookie":await e.commit()}})},isLoggedIn:f,handleAuthStatus:R,getAccessToken:v,getApiUrl:()=>l,mutate:N,query:F,authorize:async()=>{Ae(r,t);let h=y.searchParams.get("code"),C=y.searchParams.get("state");if(!h||!C)throw ce(e),new k("Unauthorized","No code or state parameter found in the redirect URL.",{"Set-Cookie":await e.commit()});if(e.get(E)?.state!==C)throw ce(e),new k("Unauthorized","The session state does not match the state parameter. Make sure that the session is configured correctly and passed to `createCustomerAccountClient`.",{"Set-Cookie":await e.commit()});let A=t,T=new URLSearchParams;T.append("grant_type","authorization_code"),T.append("client_id",A),T.append("redirect_uri",p),T.append("code",h);let M=e.get(E)?.codeVerifier;if(!M)throw new k("Unauthorized","No code verifier found in the session. Make sure that the session is configured correctly and passed to `createCustomerAccountClient`.");T.append("code_verifier",M);let V={"content-type":"application/x-www-form-urlencoded","User-Agent":ae,Origin:m},D=q?.();new Date().getTime();let U=`${r}/auth/oauth/token`,b=await fetch(U,{method:"POST",headers:V,body:T});if(!b.ok)throw new Response(await b.text(),{status:b.status,headers:{"Content-Type":"text/html; charset=utf-8"}});let{access_token:L,expires_in:de,id_token:te,refresh_token:$}=await b.json(),le=e.get(E)?.nonce,xt=await ar(te);if(le!==xt)throw new k("Unauthorized",`Returned nonce does not match: ${le} !== ${xt}`);let Nr=await pt(L,t,r,m,{waitUntil:s,stackInfo:D,...z(a)}),Mr=e.get(E)?.redirectPath;return e.set(E,{accessToken:Nr,expiresAt:new Date(new Date().getTime()+(de-120)*1e3).getTime()+"",refreshToken:$,idToken:te}),await we(),Pe(Mr||sr,{headers:{"Set-Cookie":await e.commit()}})},UNSTABLE_setBuyer:ee,UNSTABLE_getBuyer:_}}function Ae(e,t){try{if(!e||!t)throw Error();new URL(e);}catch{console.error(new Error("[h2:error:customerAccount] You do not have the valid credential to use Customer Account API.\nRun `h2 env pull` to link your store credentials."));let r="Internal Server Error";throw new Response(r,{status:500})}}var Oo="https://raw.githubusercontent.com/Shopify/hydrogen/main/docs/changelog.json";async function Uo({request:e,changelogUrl:t}){new URL(e.url).searchParams;return fetch(t||Oo)}var ir="cartFormInput";function Ve({children:e,action:t,inputs:r,route:o,fetcherKey:a}){let s=useFetcher({key:a});return jsxs(s.Form,{action:o||"",method:"post",children:[(t||r)&&jsx("input",{type:"hidden",name:ir,value:JSON.stringify({action:t,inputs:r})}),typeof e=="function"?e(s):e]})}Ve.INPUT_NAME=ir;Ve.ACTIONS={AttributesUpdateInput:"AttributesUpdateInput",BuyerIdentityUpdate:"BuyerIdentityUpdate",Create:"Create",DiscountCodesUpdate:"DiscountCodesUpdate",LinesAdd:"LinesAdd",LinesRemove:"LinesRemove",LinesUpdate:"LinesUpdate",NoteUpdate:"NoteUpdate",SelectedDeliveryOptionsUpdate:"SelectedDeliveryOptionsUpdate",MetafieldsSet:"MetafieldsSet",MetafieldDelete:"MetafieldDelete"};function ko(e){let t={};for(let n of e.entries()){let i=n[0],u=e.getAll(i);t[i]=u.length>1?u:n[1];}let{cartFormInput:r,...o}=t,{action:a,inputs:s}=r?JSON.parse(String(r)):{};return {action:a,inputs:{...s,...o}}}Ve.getFormInput=ko;var I=`#graphql
299
+ `,{data:S}=await N(C),A=S?.storefrontCustomerAccessTokenCreate?.customerAccessToken;A&&te({customerAccessToken:A});}return {login:async C=>{Te(r,t);let S=new URL(`${r}/auth/oauth/authorize`),A=ur(),T=Me();if(S.searchParams.set("client_id",t),S.searchParams.set("scope","openid email"),S.searchParams.append("response_type","code"),S.searchParams.append("redirect_uri",l),S.searchParams.set("scope","openid email https://api.customers.com/auth/customer.graphql"),S.searchParams.append("state",A),S.searchParams.append("nonce",T),C?.uiLocales){let[x,O]=C.uiLocales.split("-"),k=x.toLowerCase();O&&(k+=`-${O.toUpperCase()}`),S.searchParams.append("ui_locales",k);}let V=ir(),M=await sr(V);return e.set(E,{...e.get(E),codeVerifier:V,state:A,nonce:T,redirectPath:Ue(o.url)||_e(o,"Referer")||lr}),S.searchParams.append("code_challenge",M),S.searchParams.append("code_challenge_method","S256"),Ae(S.toString(),{headers:{"Set-Cookie":await e.commit()}})},logout:async C=>{Te(r,t);let S=e.get(E)?.idToken,A=it({requestUrl:m,defaultUrl:m,redirectUrl:C?.postLogoutRedirectUri}),T=S?new URL(`${r}/auth/logout?${new URLSearchParams([["id_token_hint",S],["post_logout_redirect_uri",A]]).toString()}`).toString():A;return ue(e),Ae(T,{headers:{"Set-Cookie":await e.commit()}})},isLoggedIn:f,handleAuthStatus:I,getAccessToken:v,getApiUrl:()=>d,mutate:N,query:F,authorize:async()=>{Te(r,t);let C=y.searchParams.get("code"),S=y.searchParams.get("state");if(!C||!S)throw ue(e),new _("Unauthorized","No code or state parameter found in the redirect URL.",{"Set-Cookie":await e.commit()});if(e.get(E)?.state!==S)throw ue(e),new _("Unauthorized","The session state does not match the state parameter. Make sure that the session is configured correctly and passed to `createCustomerAccountClient`.",{"Set-Cookie":await e.commit()});let A=t,T=new URLSearchParams;T.append("grant_type","authorization_code"),T.append("client_id",A),T.append("redirect_uri",l),T.append("code",C);let V=e.get(E)?.codeVerifier;if(!V)throw new _("Unauthorized","No code verifier found in the session. Make sure that the session is configured correctly and passed to `createCustomerAccountClient`.");T.append("code_verifier",V);let M={"content-type":"application/x-www-form-urlencoded","User-Agent":ne,Origin:m},x=q?.();new Date().getTime();let k=`${r}/auth/oauth/token`,b=await fetch(k,{method:"POST",headers:M,body:T});if(!b.ok)throw new Response(await b.text(),{status:b.status,headers:{"Content-Type":"text/html; charset=utf-8"}});let{access_token:U,expires_in:le,id_token:re,refresh_token:$}=await b.json(),ye=e.get(E)?.nonce,kt=await pr(re);if(ye!==kt)throw new _("Unauthorized",`Returned nonce does not match: ${ye} !== ${kt}`);let Qr=await yt(U,t,r,m,{waitUntil:n,stackInfo:x,...J(o)}),Gr=e.get(E)?.redirectPath;return e.set(E,{accessToken:Qr,expiresAt:new Date(new Date().getTime()+(le-120)*1e3).getTime()+"",refreshToken:$,idToken:re}),await be(),Ae(Gr||lr,{headers:{"Set-Cookie":await e.commit()}})},UNSTABLE_setBuyer:te,UNSTABLE_getBuyer:L}}function Te(e,t){try{if(!e||!t)throw Error();new URL(e);}catch{console.error(new Error("[h2:error:customerAccount] You do not have the valid credential to use Customer Account API.\nRun `h2 env pull` to link your store credentials."));let r="Internal Server Error";throw new Response(r,{status:500})}}var Mo="https://raw.githubusercontent.com/Shopify/hydrogen/main/docs/changelog.json";async function Fo({request:e,changelogUrl:t}){new URL(e.url).searchParams;return fetch(t||Mo)}var yr="cartFormInput";function G({children:e,action:t,inputs:r,route:a,fetcherKey:o}){let n=useFetcher({key:o});return jsxs(n.Form,{action:a||"",method:"post",children:[(t||r)&&jsx("input",{type:"hidden",name:yr,value:JSON.stringify({action:t,inputs:r})}),typeof e=="function"?e(n):e]})}G.INPUT_NAME=yr;G.ACTIONS={AttributesUpdateInput:"AttributesUpdateInput",BuyerIdentityUpdate:"BuyerIdentityUpdate",Create:"Create",DiscountCodesUpdate:"DiscountCodesUpdate",LinesAdd:"LinesAdd",LinesRemove:"LinesRemove",LinesUpdate:"LinesUpdate",NoteUpdate:"NoteUpdate",SelectedDeliveryOptionsUpdate:"SelectedDeliveryOptionsUpdate",MetafieldsSet:"MetafieldsSet",MetafieldDelete:"MetafieldDelete"};function qo(e){let t={};for(let i of e.entries()){let u=i[0],c=e.getAll(u);t[u]=c.length>1?c:i[1];}let{cartFormInput:r,...a}=t,{action:o,inputs:n}=r?JSON.parse(String(r)):{};return {action:o,inputs:{...n,...a}}}G.getFormInput=qo;var R=`#graphql
300
300
  fragment CartApiError on CartUserError {
301
301
  message
302
302
  field
@@ -307,7 +307,7 @@ API response error: ${t.status}`,c=new K(u,{query:a,queryVariables:s,cause:{erro
307
307
  id
308
308
  totalQuantity
309
309
  }
310
- `;function dt(e){return async(t,r)=>{let o=e.customerAccount?await e.customerAccount.UNSTABLE_getBuyer():void 0,{cartId:a,...s}=r||{},{buyerIdentity:n,...i}=t,{cartCreate:u,errors:c}=await e.storefront.mutate(Mo(e.cartFragment),{variables:{input:{...i,buyerIdentity:{...o,...n}},...s}});return P(u,c)}}var Mo=(e=w)=>`#graphql
310
+ `;function ft(e){return async(t,r)=>{let a=e.customerAccount?await e.customerAccount.UNSTABLE_getBuyer():void 0,{cartId:o,...n}=r||{},{buyerIdentity:i,...u}=t,{cartCreate:c,errors:s}=await e.storefront.mutate(Go(e.cartFragment),{variables:{input:{...u,buyerIdentity:{...a,...i}},...n}});return P(c,s)}}var Go=(e=w)=>`#graphql
311
311
  mutation cartCreate(
312
312
  $input: CartInput!
313
313
  $country: CountryCode = ZZ
@@ -324,8 +324,8 @@ API response error: ${t.status}`,c=new K(u,{query:a,queryVariables:s,cause:{erro
324
324
  }
325
325
  }
326
326
  ${e}
327
- ${I}
328
- `;function lt({storefront:e,customerAccount:t,getCartId:r,cartFragment:o}){return async a=>{let s=r();if(!s)return null;let[n,{cart:i,errors:u}]=await Promise.all([t?t.isLoggedIn():!1,e.query(Fo(o),{variables:{cartId:s,...a},cache:e.CacheNone()})]);return P(Vo(n,i),u)}}function Vo(e,t){if(e&&t&&t.checkoutUrl){let r=new URL(t.checkoutUrl);r.searchParams.set("logged_in","true"),t.checkoutUrl=r.toString();}return t}var Fo=(e=$o)=>`#graphql
327
+ ${R}
328
+ `;function mt({storefront:e,customerAccount:t,getCartId:r,cartFragment:a}){return async o=>{let n=r();if(!n)return null;let[i,{cart:u,errors:c}]=await Promise.all([t?t.isLoggedIn():!1,e.query(Wo(a),{variables:{cartId:n,...o},cache:e.CacheNone()})]);return P(Bo(i,u),c)}}function Bo(e,t){if(e&&t&&t.checkoutUrl){let r=new URL(t.checkoutUrl);r.searchParams.set("logged_in","true"),t.checkoutUrl=r.toString();}return t}var Wo=(e=jo)=>`#graphql
329
329
  query CartQuery(
330
330
  $cartId: ID!
331
331
  $numCartLines: Int = 100
@@ -338,7 +338,7 @@ API response error: ${t.status}`,c=new K(u,{query:a,queryVariables:s,cause:{erro
338
338
  }
339
339
 
340
340
  ${e}
341
- `,$o=`#graphql
341
+ `,jo=`#graphql
342
342
  fragment CartApiQuery on Cart {
343
343
  updatedAt
344
344
  id
@@ -446,7 +446,7 @@ API response error: ${t.status}`,c=new K(u,{query:a,queryVariables:s,cause:{erro
446
446
  width
447
447
  height
448
448
  }
449
- `;function yt(e){return async(t,r)=>{let{cartLinesAdd:o,errors:a}=await e.storefront.mutate(qo(e.cartFragment),{variables:{cartId:e.getCartId(),lines:t,...r}});return P(o,a)}}var qo=(e=w)=>`#graphql
449
+ `;function gt(e){return async(t,r)=>{let{cartLinesAdd:a,errors:o}=await e.storefront.mutate(Ko(e.cartFragment),{variables:{cartId:e.getCartId(),lines:t,...r}});return P(a,o)}}var Ko=(e=w)=>`#graphql
450
450
  mutation cartLinesAdd(
451
451
  $cartId: ID!
452
452
  $lines: [CartLineInput!]!
@@ -464,8 +464,8 @@ API response error: ${t.status}`,c=new K(u,{query:a,queryVariables:s,cause:{erro
464
464
  }
465
465
 
466
466
  ${e}
467
- ${I}
468
- `;function ft(e){return async(t,r)=>{let{cartLinesUpdate:o,errors:a}=await e.storefront.mutate(Ho(e.cartFragment),{variables:{cartId:e.getCartId(),lines:t,...r}});return P(o,a)}}var Ho=(e=w)=>`#graphql
467
+ ${R}
468
+ `;var fr="__h_pending_";function mr(e){return fr+e}function Fe(e){return e.startsWith(fr)}function $e(e,t){if(t.some(r=>Fe(typeof r=="string"?r:r.id)))throw new Error(`Tried to perform an action on an optimistic line. Make sure to disable your "${e}" CartForm action when the line is optimistic.`)}function ht(e){return async(t,r)=>{$e("updateLines",t);let{cartLinesUpdate:a,errors:o}=await e.storefront.mutate(zo(e.cartFragment),{variables:{cartId:e.getCartId(),lines:t,...r}});return P(a,o)}}var zo=(e=w)=>`#graphql
469
469
  mutation cartLinesUpdate(
470
470
  $cartId: ID!
471
471
  $lines: [CartLineUpdateInput!]!
@@ -483,8 +483,8 @@ API response error: ${t.status}`,c=new K(u,{query:a,queryVariables:s,cause:{erro
483
483
  }
484
484
 
485
485
  ${e}
486
- ${I}
487
- `;function mt(e){return async(t,r)=>{let{cartLinesRemove:o,errors:a}=await e.storefront.mutate(Qo(e.cartFragment),{variables:{cartId:e.getCartId(),lineIds:t,...r}});return P(o,a)}}var Qo=(e=w)=>`#graphql
486
+ ${R}
487
+ `;function Ct(e){return async(t,r)=>{$e("removeLines",t);let{cartLinesRemove:a,errors:o}=await e.storefront.mutate(Jo(e.cartFragment),{variables:{cartId:e.getCartId(),lineIds:t,...r}});return P(a,o)}}var Jo=(e=w)=>`#graphql
488
488
  mutation cartLinesRemove(
489
489
  $cartId: ID!
490
490
  $lineIds: [ID!]!
@@ -502,8 +502,8 @@ API response error: ${t.status}`,c=new K(u,{query:a,queryVariables:s,cause:{erro
502
502
  }
503
503
 
504
504
  ${e}
505
- ${I}
506
- `;function gt(e){return async(t,r)=>{let o=t.filter((n,i,u)=>u.indexOf(n)===i),{cartDiscountCodesUpdate:a,errors:s}=await e.storefront.mutate(Go(e.cartFragment),{variables:{cartId:e.getCartId(),discountCodes:o,...r}});return P(a,s)}}var Go=(e=w)=>`#graphql
505
+ ${R}
506
+ `;function St(e){return async(t,r)=>{let a=t.filter((i,u,c)=>c.indexOf(i)===u),{cartDiscountCodesUpdate:o,errors:n}=await e.storefront.mutate(Yo(e.cartFragment),{variables:{cartId:e.getCartId(),discountCodes:a,...r}});return P(o,n)}}var Yo=(e=w)=>`#graphql
507
507
  mutation cartDiscountCodesUpdate(
508
508
  $cartId: ID!
509
509
  $discountCodes: [String!]
@@ -520,8 +520,8 @@ API response error: ${t.status}`,c=new K(u,{query:a,queryVariables:s,cause:{erro
520
520
  }
521
521
  }
522
522
  ${e}
523
- ${I}
524
- `;function ht(e){return async(t,r)=>{t.companyLocationId&&e.customerAccount&&e.customerAccount.UNSTABLE_setBuyer({companyLocationId:t.companyLocationId});let o=e.customerAccount?await e.customerAccount.UNSTABLE_getBuyer():void 0,{cartBuyerIdentityUpdate:a,errors:s}=await e.storefront.mutate(Bo(e.cartFragment),{variables:{cartId:e.getCartId(),buyerIdentity:{...o,...t},...r}});return P(a,s)}}var Bo=(e=w)=>`#graphql
523
+ ${R}
524
+ `;function Pt(e){return async(t,r)=>{t.companyLocationId&&e.customerAccount&&e.customerAccount.UNSTABLE_setBuyer({companyLocationId:t.companyLocationId});let a=e.customerAccount?await e.customerAccount.UNSTABLE_getBuyer():void 0,{cartBuyerIdentityUpdate:o,errors:n}=await e.storefront.mutate(Xo(e.cartFragment),{variables:{cartId:e.getCartId(),buyerIdentity:{...a,...t},...r}});return P(o,n)}}var Xo=(e=w)=>`#graphql
525
525
  mutation cartBuyerIdentityUpdate(
526
526
  $cartId: ID!
527
527
  $buyerIdentity: CartBuyerIdentityInput!
@@ -538,8 +538,8 @@ API response error: ${t.status}`,c=new K(u,{query:a,queryVariables:s,cause:{erro
538
538
  }
539
539
  }
540
540
  ${e}
541
- ${I}
542
- `;function Ct(e){return async(t,r)=>{let{cartNoteUpdate:o,errors:a}=await e.storefront.mutate(Wo(e.cartFragment),{variables:{cartId:e.getCartId(),note:t,...r}});return P(o,a)}}var Wo=(e=w)=>`#graphql
541
+ ${R}
542
+ `;function At(e){return async(t,r)=>{let{cartNoteUpdate:a,errors:o}=await e.storefront.mutate(Zo(e.cartFragment),{variables:{cartId:e.getCartId(),note:t,...r}});return P(a,o)}}var Zo=(e=w)=>`#graphql
543
543
  mutation cartNoteUpdate(
544
544
  $cartId: ID!
545
545
  $note: String!
@@ -556,8 +556,8 @@ API response error: ${t.status}`,c=new K(u,{query:a,queryVariables:s,cause:{erro
556
556
  }
557
557
  }
558
558
  ${e}
559
- ${I}
560
- `;function St(e){return async(t,r)=>{let{cartSelectedDeliveryOptionsUpdate:o,errors:a}=await e.storefront.mutate(jo(e.cartFragment),{variables:{cartId:e.getCartId(),selectedDeliveryOptions:t,...r}});return P(o,a)}}var jo=(e=w)=>`#graphql
559
+ ${R}
560
+ `;function Tt(e){return async(t,r)=>{let{cartSelectedDeliveryOptionsUpdate:a,errors:o}=await e.storefront.mutate(ea(e.cartFragment),{variables:{cartId:e.getCartId(),selectedDeliveryOptions:t,...r}});return P(a,o)}}var ea=(e=w)=>`#graphql
561
561
  mutation cartSelectedDeliveryOptionsUpdate(
562
562
  $cartId: ID!
563
563
  $selectedDeliveryOptions: [CartSelectedDeliveryOptionInput!]!
@@ -574,8 +574,8 @@ API response error: ${t.status}`,c=new K(u,{query:a,queryVariables:s,cause:{erro
574
574
  }
575
575
  }
576
576
  ${e}
577
- ${I}
578
- `;function Pt(e){return async(t,r)=>{let{cartAttributesUpdate:o,errors:a}=await e.storefront.mutate(Ko(e.cartFragment),{variables:{cartId:r?.cartId||e.getCartId(),attributes:t}});return P(o,a)}}var Ko=(e=w)=>`#graphql
577
+ ${R}
578
+ `;function vt(e){return async(t,r)=>{let{cartAttributesUpdate:a,errors:o}=await e.storefront.mutate(ta(e.cartFragment),{variables:{cartId:r?.cartId||e.getCartId(),attributes:t}});return P(a,o)}}var ta=(e=w)=>`#graphql
579
579
  mutation cartAttributesUpdate(
580
580
  $cartId: ID!
581
581
  $attributes: [AttributeInput!]!
@@ -590,8 +590,8 @@ API response error: ${t.status}`,c=new K(u,{query:a,queryVariables:s,cause:{erro
590
590
  }
591
591
  }
592
592
  ${e}
593
- ${I}
594
- `;function At(e){return async(t,r)=>{let o=r?.cartId||e.getCartId(),a=t.map(i=>({...i,ownerId:o})),{cartMetafieldsSet:s,errors:n}=await e.storefront.mutate(zo(),{variables:{metafields:a}});return P({cart:{id:o},...s},n)}}var zo=()=>`#graphql
593
+ ${R}
594
+ `;function It(e){return async(t,r)=>{let a=r?.cartId||e.getCartId(),o=t.map(u=>({...u,ownerId:a})),{cartMetafieldsSet:n,errors:i}=await e.storefront.mutate(ra(),{variables:{metafields:o}});return P({cart:{id:a},...n},i)}}var ra=()=>`#graphql
595
595
  mutation cartMetafieldsSet(
596
596
  $metafields: [CartMetafieldsSetInput!]!
597
597
  $language: LanguageCode
@@ -606,7 +606,7 @@ API response error: ${t.status}`,c=new K(u,{query:a,queryVariables:s,cause:{erro
606
606
  }
607
607
  }
608
608
  }
609
- `;function Tt(e){return async(t,r)=>{let o=r?.cartId||e.getCartId(),{cartMetafieldDelete:a,errors:s}=await e.storefront.mutate(Jo(),{variables:{input:{ownerId:o,key:t}}});return P({cart:{id:o},...a},s)}}var Jo=()=>`#graphql
609
+ `;function Rt(e){return async(t,r)=>{let a=r?.cartId||e.getCartId(),{cartMetafieldDelete:o,errors:n}=await e.storefront.mutate(oa(),{variables:{input:{ownerId:a,key:t}}});return P({cart:{id:a},...o},n)}}var oa=()=>`#graphql
610
610
  mutation cartMetafieldDelete(
611
611
  $input: CartMetafieldDeleteInput!
612
612
  ) {
@@ -618,7 +618,7 @@ API response error: ${t.status}`,c=new K(u,{query:a,queryVariables:s,cause:{erro
618
618
  }
619
619
  }
620
620
  }
621
- `;var Yo=new Set(["domain","path","max-age","expires","samesite","secure","httponly"]);function cr(e){let t={},r,o,a=0,s=e.split(/;\s*/g),n,i;for(;a<s.length;a++)if(o=s[a],r=o.indexOf("="),~r){if(n=o.substring(0,r++).trim(),i=o.substring(r).trim(),i[0]==='"'&&(i=i.substring(1,i.length-1)),~i.indexOf("%"))try{i=decodeURIComponent(i);}catch{}Yo.has(o=n.toLowerCase())?o==="expires"?t.expires=new Date(i):o==="max-age"?t.maxage=+i:t[o]=i:t[n]=i;}else (n=o.trim().toLowerCase())&&(n==="httponly"||n==="secure")&&(t[n]=!0);return t}function ur(e,t,r={}){let o=e+"="+encodeURIComponent(t);return r.expires&&(o+="; Expires="+new Date(r.expires).toUTCString()),r.maxage!=null&&r.maxage>=0&&(o+="; Max-Age="+(r.maxage|0)),r.domain&&(o+="; Domain="+r.domain),r.path&&(o+="; Path="+r.path),r.samesite&&(o+="; SameSite="+r.samesite),(r.secure||r.samesite==="None")&&(o+="; Secure"),r.httponly&&(o+="; HttpOnly"),o}var Xo=e=>{let t=cr(e.get("Cookie")||"");return ()=>t.cart?`gid://shopify/Cart/${t.cart}`:void 0};var Zo=e=>t=>{let r=new Headers;return r.append("Set-Cookie",ur("cart",t.split("/").pop()||"",{path:"/",...e})),r};function ea(e){let{getCartId:t,setCartId:r,storefront:o,customerAccount:a,cartQueryFragment:s,cartMutateFragment:n}=e,i=t(),u=()=>i||t(),c={storefront:o,getCartId:u,cartFragment:n,customerAccount:a},d=dt(c),y=async function(...p){let l=await d(...p);return i=l?.cart?.id,l},m={get:lt({storefront:o,customerAccount:a,getCartId:u,cartFragment:s}),getCartId:u,setCartId:r,create:y,addLines:async(p,l)=>i||l?.cartId?await yt(c)(p,l):await y({lines:p},l),updateLines:ft(c),removeLines:mt(c),updateDiscountCodes:async(p,l)=>i||l?.cartId?await gt(c)(p,l):await y({discountCodes:p},l),updateBuyerIdentity:async(p,l)=>i||l?.cartId?await ht(c)(p,l):await y({buyerIdentity:p},l),updateNote:async(p,l)=>i||l?.cartId?await Ct(c)(p,l):await y({note:p},l),updateSelectedDeliveryOption:St(c),updateAttributes:async(p,l)=>i||l?.cartId?await Pt(c)(p,l):await y({attributes:p},l),setMetafields:async(p,l)=>i||l?.cartId?await At(c)(p,l):await y({metafields:p},l),deleteMetafield:Tt(c)};return "customMethods"in e?{...m,...e.customMethods??{}}:m}function na({handle:e,options:t=[],variants:r=[],productPath:o="products",children:a}){let s=r instanceof Array?r:flattenConnection(r),{searchParams:n,path:i,alreadyOnProductPage:u}=ia(e,o),c=t.filter(d=>d?.values?.length===1);return createElement(Fragment,null,...useMemo(()=>t.filter(d=>d?.values?.length>1).map(d=>{let y,m=[];for(let p of d.values){let l=new URLSearchParams(u?n:void 0);l.set(d.name,p),c.forEach(v=>{l.set(v.name,v.values[0]);});let g=s.find(v=>v?.selectedOptions?.every(N=>l.get(N?.name)===N?.value)),S=n.get(d.name),f=S?S===p:!1;f&&(y=p);let R="?"+l.toString();m.push({value:p,isAvailable:g?g.availableForSale:!0,to:i+R,search:R,isActive:f});}return a({option:{name:d.name,value:y,values:m}})}),[t,s,a]))}var sa=e=>{if(typeof e?.url>"u")throw new TypeError(`Expected a Request instance, got ${typeof e}`);let t=new URL(e.url).searchParams,r=[];return t.forEach((o,a)=>{r.push({name:a,value:o});}),r};function ia(e,t){let{pathname:r,search:o}=useLocation();return useMemo(()=>{let a=/(\/[a-zA-Z]{2}-[a-zA-Z]{2}\/)/g.exec(r),s=a&&a.length>0;t=t.startsWith("/")?t.substring(1):t;let n=s?`${a[0]}${t}/${e}`:`/${t}/${e}`;return {searchParams:new URLSearchParams(o),alreadyOnProductPage:n===r,path:n}},[r,o,e,t])}var dr=createContext(void 0),la=dr.Provider,vt=()=>useContext(dr);function ya(e){let t=Me(),r=fa(t,e);return {nonce:t,header:r,NonceProvider:({children:a})=>createElement(la,{value:t},a)}}function fa(e,t){let{shop:r,...o}=t??{},a=`'nonce-${e}'`,s=["'self'","'unsafe-inline'","https://cdn.shopify.com"],n=["'self'","https://monorail-edge.shopifysvc.com"];r&&r.checkoutDomain&&n.push(`https://${r.checkoutDomain}`),r&&r.storeDomain&&n.push(`https://${r.storeDomain}`);let u={baseUri:["'self'"],defaultSrc:["'self'",a,"https://cdn.shopify.com","https://shopify.com"],frameAncestors:["'none'"],styleSrc:s,connectSrc:n},c=Object.assign({},u,o);for(let d in u){let y=o[d];d&&y&&(c[d]=ma(y,u[d]));}return c.scriptSrc instanceof Array&&!c.scriptSrc.includes(a)?c.scriptSrc.push(a):c.defaultSrc instanceof Array&&!c.defaultSrc.includes(a)&&c.defaultSrc.push(a),da({directives:c})}function ma(e,t){let r=typeof t=="string"?[t]:t,o=Array.isArray(e)?e:[String(e)];return Array.isArray(r)?r.every(s=>s==="'none'")?o:[...o,...r]:r}var ha=forwardRef((e,t)=>{let r=vt();return jsx("script",{suppressHydrationWarning:!0,...e,nonce:r,ref:t})});function Pa(e){let t=useFetchers(),r={};for(let{formData:o}of t)if(o?.get("optimistic-identifier")===e)try{if(o.has("optimistic-data")){let a=JSON.parse(String(o.get("optimistic-data")));Object.assign(r,a);}}catch{}return r}function Aa({id:e,data:t}){return jsxs(Fragment$1,{children:[jsx("input",{type:"hidden",name:"optimistic-identifier",value:e}),jsx("input",{type:"hidden",name:"optimistic-data",value:JSON.stringify(t)})]})}function Ia(e){return jsx(ShopPayButton,{channel:"hydrogen",...e})}function ue(e){let{type:t,data:r={},customData:o}=e,a=useLocation(),{publish:s,cart:n,prevCart:i,shop:u}=Y(),c=a.pathname+a.search;return useEffect(()=>{if(!u)return;let d={...r,customData:o,url:window.location.href,cart:n,prevCart:i,shop:u};s(t,d);},[s,c,n,i,u]),null}function yr(e){return jsx(ue,{...e,type:"page_viewed"})}function fr(e){return jsx(ue,{...e,type:"product_viewed"})}function mr(e){return jsx(ue,{...e,type:"collection_viewed"})}function gr(e){return jsx(ue,{...e,type:"cart_viewed"})}function hr(e){return jsx(ue,{...e,type:"search_viewed"})}function Cr(e){return jsx(ue,{...e})}var X={PAGE_VIEWED:"page_viewed",PRODUCT_VIEWED:"product_viewed",COLLECTION_VIEWED:"collection_viewed",CART_VIEWED:"cart_viewed",SEARCH_VIEWED:"search_viewed",CART_UPDATED:"cart_updated",PRODUCT_ADD_TO_CART:"product_added_to_cart",PRODUCT_REMOVED_FROM_CART:"product_removed_from_cart",CUSTOM_EVENT:"custom_"};var Oa="https://cdn.shopify.com/shopifycloud/consent-tracking-api/v0.1/consent-tracking-api.js",Ua="https://cdn.shopify.com/shopifycloud/privacy-banner/storefront-banner.js";function Pr(e){console.error(`[h2:error:useCustomerPrivacy] Unable to setup Customer Privacy API: Missing consent.${e} consent configuration.`);}function Rt(e){let{withPrivacyBanner:t=!0,onVisitorConsentCollected:r,onReady:o,...a}=e,s=useRef(!1),n=useLoadScript(t?Ua:Oa,{attributes:{id:"customer-privacy-api"}});a.checkoutDomain||Pr("checkoutDomain"),a.storefrontAccessToken||Pr("storefrontAccessToken"),useEffect(()=>{let i=u=>{r&&r(u.detail);};return document.addEventListener("visitorConsentCollected",i),()=>{document.removeEventListener("visitorConsentCollected",i);}},[r]),useEffect(()=>{if(!(n!=="done"||s.current)){if(s.current=!0,t&&window?.privacyBanner&&window?.privacyBanner?.loadBanner({checkoutRootDomain:a.checkoutDomain,storefrontAccessToken:a.storefrontAccessToken}),window.Shopify?.customerPrivacy){let i=window.Shopify.customerPrivacy.setTrackingConsent;window.Shopify.customerPrivacy.setTrackingConsent=(u,c)=>{i({...u,headlessStorefront:!0,checkoutRootDomain:a.checkoutDomain,storefrontAccessToken:a.storefrontAccessToken},c);};}o&&!t&&o();}},[n,t,a]);}function It(){try{return window.Shopify&&window.Shopify.customerPrivacy?window.Shopify?.customerPrivacy:null}catch{return null}}function Na(){let e=It();if(!e)throw new Error("Shopify Customer Privacy API not available. Must be used within a useEffect. Make sure to load the Shopify Customer Privacy API with useCustomerPrivacy() or <AnalyticsProvider>.");return e}function Ar({consent:e,onReady:t}){let{subscribe:r,register:o,canTrack:a}=Y(),{ready:s}=o("Internal_Shopify_Analytics"),{ready:n}=o("Internal_Shopify_CustomerPrivacy"),i=()=>{n(),t();};return Rt({...e,onVisitorConsentCollected:i,onReady:()=>{e.withPrivacyBanner||i();}}),useShopifyCookies({hasUserConsent:a()}),useEffect(()=>{r(X.PAGE_VIEWED,Va),r(X.PRODUCT_VIEWED,Fa),r(X.COLLECTION_VIEWED,$a),r(X.SEARCH_VIEWED,qa),r(X.PRODUCT_ADD_TO_CART,Ha),s();},[r,s]),null}function Fe(e){console.error(`[h2:error:ShopifyAnalytics] Unable to send Shopify analytics: Missing shop.${e} configuration.`);}function Re(e){let t=Na(),r=t.analyticsProcessingAllowed();if(!e?.shop?.shopId){Fe("shopId");return}if(!e?.shop?.acceptedLanguage){Fe("acceptedLanguage");return}if(!e?.shop?.currency){Fe("currency");return}if(!e?.shop?.hydrogenSubchannelId){Fe("hydrogenSubchannelId");return}return {shopifySalesChannel:"hydrogen",...e.shop,hasUserConsent:r,...getClientBrowserParameters(),ccpaEnforced:!t.saleOfDataAllowed(),gdprEnforced:!(t.marketingAllowed()&&t.analyticsProcessingAllowed())}}function Ma(e,t){if(t===null)return;let r=Re(e);return r?{...r,cartId:t.id}:void 0}var W={};function Va(e){let t=Re(e);t&&(sendShopifyAnalytics({eventName:AnalyticsEventName.PAGE_VIEW_2,payload:{...t,...W}}),W={});}function Fa(e){let t=Re(e);if(t&&Tr({eventName:Ga,productField:"products",variantField:"product.<displayed_variant>",fromSource:"product_viewed products array",products:e.products})){let r=wt(e.products);W={pageType:AnalyticsPageType.product,resourceId:r[0].productGid},t={...t,...W,products:wt(e.products)},sendShopifyAnalytics({eventName:AnalyticsEventName.PRODUCT_VIEW,payload:t});}}function $a(e){let t=Re(e);t&&(W={pageType:AnalyticsPageType.collection,resourceId:e.collection.id},t={...t,...W,collectionHandle:e.collection.handle},sendShopifyAnalytics({eventName:AnalyticsEventName.COLLECTION_VIEW,payload:t}));}function qa(e){let t=Re(e);t&&(W={pageType:AnalyticsPageType.search},t={...t,...W,searchString:e.searchTerm},sendShopifyAnalytics({eventName:AnalyticsEventName.SEARCH_VIEW,payload:t}));}function Ha(e){let{cart:t,currentLine:r}=e,o=Ma(e,t);!o||!r?.id||Qa({matchedLine:r,eventPayload:o});}function Qa({matchedLine:e,eventPayload:t}){let r={id:e.merchandise.product.id,variantId:e.id,title:e.merchandise.product.title,variantTitle:e.merchandise.title,vendor:e.merchandise.product.vendor,price:e.merchandise.price.amount,quantity:e.quantity,productType:e.merchandise.product.productType,sku:e.merchandise.sku};Tr({eventName:Ba,productField:"merchandise.product",variantField:"merchandise",fromSource:"cart query",products:[r]})&&sendShopifyAnalytics({eventName:AnalyticsEventName.ADD_TO_CART,payload:{...t,products:wt([r])}});}var Ga="Product viewed",Ba="Add to cart";function Z(e,t,r){console.error(`[h2:error:ShopifyAnalytics] ${e}: ${t} is required from the ${r}.`);}function Tr({eventName:e,productField:t,variantField:r,products:o,fromSource:a}){return !o||o.length===0?(Z(e,`${t}`,a),!1):(o.forEach(s=>{if(!s.id)return Z(e,`${t}.id`,a),!1;if(!s.title)return Z(e,`${t}.title`,a),!1;if(!s.price)return Z(e,`${r}.price.amount`,a),!1;if(!s.vendor)return Z(e,`${t}.vendor`,a),!1;if(!s.variantId)return Z(e,`${r}.id`,a),!1;if(!s.variantTitle)return Z(e,`${r}.title`,a),!1}),!0)}function wt(e){return e.map(t=>{let r={productGid:t.id,variantGid:t.variantId,name:t.title,variantName:t.variantTitle,brand:t.vendor,price:t.price,quantity:t.quantity||1,category:t.productType};return t.sku&&(r.sku=t.sku),t.productType&&(r.category=t.productType),r})}function Ir(e){console.error(`[h2:error:CartAnalytics] Unable to set up cart analytics events: ${e} is missing.`);}function wr({cart:e,setCarts:t}){let{publish:r,shop:o,customData:a,canTrack:s,cart:n,prevCart:i}=Y(),u=useRef(null);return useEffect(()=>{if(e)return Promise.resolve(e).then(c=>{if(c&&c.lines){if(!c.id){Ir("cart.id");return}if(!c.updatedAt){Ir("cart.updatedAt");return}}t(({cart:d,prevCart:y})=>c?.updatedAt!==d?.updatedAt?{cart:c,prevCart:d}:{cart:d,prevCart:y});}),()=>{}},[t,e]),useEffect(()=>{if(!n||!n?.updatedAt||n?.updatedAt===i?.updatedAt)return;let c;try{c=JSON.parse(localStorage.getItem("cartLastUpdatedAt")||"");}catch{c=null;}if(n.id===c?.id&&n.updatedAt===c?.updatedAt)return;let d={eventTimestamp:Date.now(),cart:n,prevCart:i,shop:o,customData:a};if(n.updatedAt===u.current)return;u.current=n.updatedAt,r("cart_updated",d),localStorage.setItem("cartLastUpdatedAt",JSON.stringify({id:n.id,updatedAt:n.updatedAt}));let y=i?.lines?flattenConnection(i?.lines):[],m=n.lines?flattenConnection(n.lines):[];y?.forEach(p=>{let l=m.filter(g=>p.id===g.id);if(l?.length===1){let g=l[0];p.quantity<g.quantity?r("product_added_to_cart",{...d,prevLine:p,currentLine:g}):p.quantity>g.quantity&&r("product_removed_from_cart",{...d,prevLine:p,currentLine:g});}else r("product_removed_from_cart",{...d,prevLine:p});}),m?.forEach(p=>{let l=y.filter(g=>p.id===g.id);(!l||l.length===0)&&r("product_added_to_cart",{...d,currentLine:p});});},[n,i,r,o,a,s]),null}var Xa={canTrack:()=>!1,cart:null,customData:{},prevCart:null,publish:()=>{},shop:null,subscribe:()=>{},register:()=>({ready:()=>{}})},_r=createContext(Xa),qe=new Map,Ie={};function kr(){return Object.values(Ie).every(Boolean)}function Er(e,t){qe.has(e)||qe.set(e,new Map),qe.get(e)?.set(t.toString(),t);}var He=new Map;function xr(e,t){if(!kr()){He.set(e,t);return}Lr(e,t);}function Lr(e,t){(qe.get(e)??new Map).forEach((r,o)=>{try{r(t);}catch(a){typeof a=="object"&&a instanceof Error?console.error("Analytics publish error",a.message,o,a.stack):console.error("Analytics publish error",a,o);}});}function Dr(e){return Ie.hasOwnProperty(e)||(Ie[e]=!1),{ready:()=>{Ie[e]=!0,kr()&&He.size>0&&(He.forEach((t,r)=>{Lr(r,t);}),He.clear());}}}function Or(){try{return window.Shopify.customerPrivacy.analyticsProcessingAllowed()}catch{}return !1}function Ur(e){return `[h2:error:Analytics.Provider] - ${e} is required`}function Za({canTrack:e,cart:t,children:r,consent:o,customData:a={},shop:s=null,disableThrowOnError:n=!1}){if(!o.checkoutDomain){let S=Ur("consent.checkoutDomain");n?console.error(S):br(!1,S);}if(!o.storefrontAccessToken){let S=Ur("consent.storefrontAccessToken");n?console.error(S):br(!1,S);}let i=useRef(!1),{shop:u}=en(s),[c,d]=useState(!!e),[y,m]=useState({cart:null,prevCart:null}),[p,l]=useState(e?()=>e:()=>Or),g=useMemo(()=>({canTrack:p,...y,customData:a,publish:p()?xr:()=>{},shop:u,subscribe:Er,register:Dr}),[c,p(),p,JSON.stringify(p),y,y.cart?.updatedAt,y.prevCart,xr,Er,a,u,Dr,JSON.stringify(Ie)]);return jsxs(_r.Provider,{value:g,children:[r,!!u&&jsx(yr,{}),!!u&&!!t&&jsx(wr,{cart:t,setCarts:m}),!!u&&jsx(Ar,{consent:o,onReady:()=>{i.current=!0,d(!0),l(()=>Or);}})]})}function Y(){let e=useContext(_r);if(!e)throw new Error("[h2:error:useAnalytics] 'useAnalytics()' must be a descendent of <AnalyticsProvider/>");return e}function en(e){let[t,r]=useState(null);return useEffect(()=>(Promise.resolve(e).then(r),()=>{}),[r,e]),{shop:t}}async function tn({storefront:e,publicStorefrontId:t="0"}){return e.query(rn,{cache:e.CacheLong()}).then(({shop:r,localization:o})=>({shopId:r.id,acceptedLanguage:o.language.isoCode,currency:o.country.currency.isoCode,hydrogenSubchannelId:t}))}var rn=`#graphql
621
+ `;var na=e=>{let t=parse(e.get("Cookie")||"");return ()=>t.cart?`gid://shopify/Cart/${t.cart}`:void 0};var sa=e=>t=>{let r=new Headers;return r.append("Set-Cookie",stringify("cart",t.split("/").pop()||"",{path:"/",...e})),r};function ca(e){let{getCartId:t,setCartId:r,storefront:a,customerAccount:o,cartQueryFragment:n,cartMutateFragment:i}=e,u=t(),c=()=>u||t(),s={storefront:a,getCartId:c,cartFragment:i,customerAccount:o},p=ft(s),y=async function(...l){let d=await p(...l);return u=d?.cart?.id,d},m={get:mt({storefront:a,customerAccount:o,getCartId:c,cartFragment:n}),getCartId:c,setCartId:r,create:y,addLines:async(l,d)=>{let g=l.map(h=>({attributes:h.attributes,quantity:h.quantity,merchandiseId:h.merchandiseId,sellingPlanId:h.sellingPlanId}));return u||d?.cartId?await gt(s)(g,d):await y({lines:g},d)},updateLines:ht(s),removeLines:Ct(s),updateDiscountCodes:async(l,d)=>u||d?.cartId?await St(s)(l,d):await y({discountCodes:l},d),updateBuyerIdentity:async(l,d)=>u||d?.cartId?await Pt(s)(l,d):await y({buyerIdentity:l},d),updateNote:async(l,d)=>u||d?.cartId?await At(s)(l,d):await y({note:l},d),updateSelectedDeliveryOption:Tt(s),updateAttributes:async(l,d)=>u||d?.cartId?await vt(s)(l,d):await y({attributes:l},d),setMetafields:async(l,d)=>u||d?.cartId?await It(s)(l,d):await y({metafields:l},d),deleteMetafield:Rt(s)};return "customMethods"in e?{...m,...e.customMethods??{}}:m}function pa(e){let t=useFetchers();if(!t||!t.length)return e;let r=e?.lines?structuredClone(e):{lines:{nodes:[]}},a=r.lines.nodes,o=!1;for(let{formData:n}of t){if(!n)continue;let i=G.getFormInput(n);if(i.action===G.ACTIONS.LinesAdd)for(let u of i.inputs.lines){if(!u.selectedVariant){console.error("[h2:error:useOptimisticCart] No selected variant was passed in the cart action. Make sure to pass the selected variant if you want to use an optimistic cart");continue}let c=a.find(s=>s.merchandise.id===u.selectedVariant?.id);o=!0,c?(c.quantity=(c.quantity||1)+(u.quantity||1),c.isOptimistic=!0):a.unshift({id:mr(u.selectedVariant.id),merchandise:u.selectedVariant,isOptimistic:!0,quantity:u.quantity||1});}else if(i.action===G.ACTIONS.LinesRemove)for(let u of i.inputs.lineIds){let c=a.findIndex(s=>s.id===u);if(c!==-1){if(Fe(a[c].id)){console.error("[h2:error:useOptimisticCart] Tried to remove an optimistic line that has not been added to the cart yet");continue}a.splice(c,1),o=!0;}else console.warn(`[h2:warn:useOptimisticCart] Tried to remove line '${u}' but it doesn't exist in the cart`);}else if(i.action===G.ACTIONS.LinesUpdate)for(let u of i.inputs.lines){let c=a.findIndex(s=>u.id===s.id);if(c>-1){if(Fe(a[c].id)){console.error("[h2:error:useOptimisticCart] Tried to update an optimistic line that has not been added to the cart yet");continue}a[c].quantity=u.quantity,a[c].quantity===0&&a.splice(c,1),o=!0;}else console.warn(`[h2:warn:useOptimisticCart] Tried to update line '${u.id}' but it doesn't exist in the cart`);}}return o&&(r.isOptimistic=o),r}function ma({handle:e,options:t=[],variants:r=[],productPath:a="products",children:o}){let n=r instanceof Array?r:flattenConnection(r),{searchParams:i,path:u,alreadyOnProductPage:c}=ha(e,a),s=t.filter(p=>p?.values?.length===1);return createElement(Fragment,null,...useMemo(()=>t.filter(p=>p?.values?.length>1).map(p=>{let y,m=[];for(let l of p.values){let d=new URLSearchParams(c?i:void 0);d.set(p.name,l),s.forEach(v=>{d.set(v.name,v.values[0]);});let g=n.find(v=>v?.selectedOptions?.every(N=>d.get(N?.name)===N?.value)),h=i.get(p.name),f=h?h===l:!1;f&&(y=l);let I="?"+d.toString();m.push({value:l,isAvailable:g?g.availableForSale:!0,to:u+I,search:I,isActive:f,variant:g});}return o({option:{name:p.name,value:y,values:m}})}),[t,n,o]))}var ga=e=>{if(typeof e?.url>"u")throw new TypeError(`Expected a Request instance, got ${typeof e}`);let t=new URL(e.url).searchParams,r=[];return t.forEach((a,o)=>{r.push({name:o,value:a});}),r};function ha(e,t){let{pathname:r,search:a}=useLocation();return useMemo(()=>{let o=/(\/[a-zA-Z]{2}-[a-zA-Z]{2}\/)/g.exec(r),n=o&&o.length>0;t=t.startsWith("/")?t.substring(1):t;let i=n?`${o[0]}${t}/${e}`:`/${t}/${e}`;return {searchParams:new URLSearchParams(a),alreadyOnProductPage:i===r,path:i}},[r,a,e,t])}var hr=createContext(void 0),Ta=hr.Provider,wt=()=>useContext(hr);function va(e){let t=Me(),r=Ia(t,e);return {nonce:t,header:r,NonceProvider:({children:o})=>createElement(Ta,{value:t},o)}}function Ia(e,t){let{shop:r,...a}=t??{},o=`'nonce-${e}'`,n=["'self'","'unsafe-inline'","https://cdn.shopify.com"],i=["'self'","https://monorail-edge.shopifysvc.com"];r&&r.checkoutDomain&&i.push(`https://${r.checkoutDomain}`),r&&r.storeDomain&&i.push(`https://${r.storeDomain}`);let c={baseUri:["'self'"],defaultSrc:["'self'",o,"https://cdn.shopify.com","https://shopify.com"],frameAncestors:["'none'"],styleSrc:n,connectSrc:i},s=Object.assign({},c,a);for(let p in c){let y=a[p];p&&y&&(s[p]=Ra(y,c[p]));}return s.scriptSrc instanceof Array&&!s.scriptSrc.includes(o)?s.scriptSrc.push(o):s.defaultSrc instanceof Array&&!s.defaultSrc.includes(o)&&s.defaultSrc.push(o),Aa({directives:s})}function Ra(e,t){let r=typeof t=="string"?[t]:t,a=Array.isArray(e)?e:[String(e)];return Array.isArray(r)?r.every(n=>n==="'none'")?a:[...a,...r]:r}var ba=forwardRef((e,t)=>{let r=wt();return jsx("script",{suppressHydrationWarning:!0,...e,nonce:r,ref:t})});function xa(e){let t=useFetchers(),r={};for(let{formData:a}of t)if(a?.get("optimistic-identifier")===e)try{if(a.has("optimistic-data")){let o=JSON.parse(String(a.get("optimistic-data")));Object.assign(r,o);}}catch{}return r}function Oa({id:e,data:t}){return jsxs(Fragment$1,{children:[jsx("input",{type:"hidden",name:"optimistic-identifier",value:e}),jsx("input",{type:"hidden",name:"optimistic-data",value:JSON.stringify(t)})]})}function Ua(e){return jsx(ShopPayButton,{channel:"hydrogen",...e})}function pe(e){let{type:t,data:r={},customData:a}=e,o=useLocation(),{publish:n,cart:i,prevCart:u,shop:c,customData:s}=X(),p=o.pathname+o.search,y={...r,customData:{...s,...a},cart:i,prevCart:u,shop:c};return useEffect(()=>{c?.shopId&&(y={...y,url:window.location.href},n(t,y));},[n,p,c?.shopId]),null}function Sr(e){return jsx(pe,{...e,type:"page_viewed"})}function Pr(e){return jsx(pe,{...e,type:"product_viewed"})}function Ar(e){return jsx(pe,{...e,type:"collection_viewed"})}function Tr(e){return jsx(pe,{...e,type:"cart_viewed"})}function vr(e){return jsx(pe,{...e,type:"search_viewed"})}function Ir(e){return jsx(pe,{...e})}var Z={PAGE_VIEWED:"page_viewed",PRODUCT_VIEWED:"product_viewed",COLLECTION_VIEWED:"collection_viewed",CART_VIEWED:"cart_viewed",SEARCH_VIEWED:"search_viewed",CART_UPDATED:"cart_updated",PRODUCT_ADD_TO_CART:"product_added_to_cart",PRODUCT_REMOVED_FROM_CART:"product_removed_from_cart",CUSTOM_EVENT:"custom_"};var qa="https://cdn.shopify.com/shopifycloud/consent-tracking-api/v0.1/consent-tracking-api.js",Ha="https://cdn.shopify.com/shopifycloud/privacy-banner/storefront-banner.js";function wr(e){console.error(`[h2:error:useCustomerPrivacy] Unable to setup Customer Privacy API: Missing consent.${e} configuration.`);}function bt(e){let{withPrivacyBanner:t=!0,onVisitorConsentCollected:r,onReady:a,...o}=e,n=useRef(!1),i=useLoadScript(t?Ha:qa,{attributes:{id:"customer-privacy-api"}});useEffect(()=>{let u=c=>{r&&r(c.detail);};return document.addEventListener("visitorConsentCollected",u),()=>{document.removeEventListener("visitorConsentCollected",u);}},[r]),useEffect(()=>{if(i!=="done"||n.current||(n.current=!0,o.checkoutDomain||wr("checkoutDomain"),o.storefrontAccessToken||wr("storefrontAccessToken"),(o.storefrontAccessToken.startsWith("shpat_")||o.storefrontAccessToken.length!==32)&&console.error("[h2:error:useCustomerPrivacy] It looks like you passed a private access token, make sure to use the public token"),t&&window?.privacyBanner&&window?.privacyBanner?.loadBanner({checkoutRootDomain:o.checkoutDomain,storefrontAccessToken:o.storefrontAccessToken}),!window.Shopify?.customerPrivacy))return;let u=window.Shopify.customerPrivacy.setTrackingConsent;function c(s,p){u({...s,headlessStorefront:!0,checkoutRootDomain:o.checkoutDomain,storefrontAccessToken:o.storefrontAccessToken},p);}window.Shopify.customerPrivacy.setTrackingConsent=c,a&&a();},[i,t,o]);}function Et(){try{return window.Shopify&&window.Shopify.customerPrivacy?window.Shopify?.customerPrivacy:null}catch{return null}}function Wa(){let e=Et();if(!e)throw new Error("Shopify Customer Privacy API not available. Must be used within a useEffect. Make sure to load the Shopify Customer Privacy API with useCustomerPrivacy() or <AnalyticsProvider>.");return e}function Er({consent:e,onReady:t,domain:r}){let{subscribe:a,register:o,canTrack:n}=X(),[i,u]=useState(!1),[c,s]=useState(!1),{ready:p}=o("Internal_Shopify_Analytics"),{ready:y}=o("Internal_Shopify_CustomerPrivacy"),m=()=>{i&&c&&t();},l=()=>{s(!0),y(),m();},{checkoutDomain:d,storefrontAccessToken:g,withPrivacyBanner:h}=e;return bt({checkoutDomain:d||"mock.shop",storefrontAccessToken:g||"abcdefghijklmnopqrstuvwxyz123456",withPrivacyBanner:h,onVisitorConsentCollected:l,onReady:()=>{setTimeout(l,3e3);}}),useShopifyCookies({hasUserConsent:n(),domain:r}),useEffect(()=>{a(Z.PAGE_VIEWED,Ka),a(Z.PRODUCT_VIEWED,za),a(Z.COLLECTION_VIEWED,Ja),a(Z.SEARCH_VIEWED,Ya),a(Z.PRODUCT_ADD_TO_CART,Xa),p(),u(!0),m();},[a,p]),null}function qe(e){console.error(`[h2:error:ShopifyAnalytics] Unable to send Shopify analytics: Missing shop.${e} configuration.`);}function Re(e){let t=Wa(),r=t.analyticsProcessingAllowed();if(!e?.shop?.shopId){qe("shopId");return}if(!e?.shop?.acceptedLanguage){qe("acceptedLanguage");return}if(!e?.shop?.currency){qe("currency");return}if(!e?.shop?.hydrogenSubchannelId){qe("hydrogenSubchannelId");return}return {shopifySalesChannel:"hydrogen",...e.shop,hasUserConsent:r,...getClientBrowserParameters(),ccpaEnforced:!t.saleOfDataAllowed(),gdprEnforced:!(t.marketingAllowed()&&t.analyticsProcessingAllowed())}}function ja(e,t){if(t===null)return;let r=Re(e);return r?{...r,cartId:t.id}:void 0}var j={};function Ka(e){let t=Re(e);t&&(sendShopifyAnalytics({eventName:AnalyticsEventName.PAGE_VIEW_2,payload:{...t,...j}}),j={});}function za(e){let t=Re(e);if(t&&Dr({eventName:en,productField:"products",variantField:"product.<displayed_variant>",fromSource:"product_viewed products array",products:e.products})){let r=Dt(e.products);j={pageType:AnalyticsPageType.product,resourceId:r[0].productGid},t={...t,...j,products:Dt(e.products)},sendShopifyAnalytics({eventName:AnalyticsEventName.PRODUCT_VIEW,payload:t});}}function Ja(e){let t=Re(e);t&&(j={pageType:AnalyticsPageType.collection,resourceId:e.collection.id},t={...t,...j,collectionHandle:e.collection.handle},sendShopifyAnalytics({eventName:AnalyticsEventName.COLLECTION_VIEW,payload:t}));}function Ya(e){let t=Re(e);t&&(j={pageType:AnalyticsPageType.search},t={...t,...j,searchString:e.searchTerm},sendShopifyAnalytics({eventName:AnalyticsEventName.SEARCH_VIEW,payload:t}));}function Xa(e){let{cart:t,currentLine:r}=e,a=ja(e,t);!a||!r?.id||Za({matchedLine:r,eventPayload:a});}function Za({matchedLine:e,eventPayload:t}){let r={id:e.merchandise.product.id,variantId:e.id,title:e.merchandise.product.title,variantTitle:e.merchandise.title,vendor:e.merchandise.product.vendor,price:e.merchandise.price.amount,quantity:e.quantity,productType:e.merchandise.product.productType,sku:e.merchandise.sku};Dr({eventName:tn,productField:"merchandise.product",variantField:"merchandise",fromSource:"cart query",products:[r]})&&sendShopifyAnalytics({eventName:AnalyticsEventName.ADD_TO_CART,payload:{...t,products:Dt([r])}});}var en="Product viewed",tn="Add to cart";function ee(e,t,r){console.error(`[h2:error:ShopifyAnalytics] ${e}: ${t} is required from the ${r}.`);}function Dr({eventName:e,productField:t,variantField:r,products:a,fromSource:o}){return !a||a.length===0?(ee(e,`${t}`,o),!1):(a.forEach(n=>{if(!n.id)return ee(e,`${t}.id`,o),!1;if(!n.title)return ee(e,`${t}.title`,o),!1;if(!n.price)return ee(e,`${r}.price.amount`,o),!1;if(!n.vendor)return ee(e,`${t}.vendor`,o),!1;if(!n.variantId)return ee(e,`${r}.id`,o),!1;if(!n.variantTitle)return ee(e,`${r}.title`,o),!1}),!0)}function Dt(e){return e.map(t=>{let r={productGid:t.id,variantGid:t.variantId,name:t.title,variantName:t.variantTitle,brand:t.vendor,price:t.price,quantity:t.quantity||1,category:t.productType};return t.sku&&(r.sku=t.sku),t.productType&&(r.category=t.productType),r})}function kr(e){console.error(`[h2:error:CartAnalytics] Unable to set up cart analytics events: ${e} is missing.`);}function Lr({cart:e,setCarts:t}){let{publish:r,shop:a,customData:o,canTrack:n,cart:i,prevCart:u}=X(),c=useRef(null);return useEffect(()=>{if(e)return Promise.resolve(e).then(s=>{if(s&&s.lines){if(!s.id){kr("cart.id");return}if(!s.updatedAt){kr("cart.updatedAt");return}}t(({cart:p,prevCart:y})=>s?.updatedAt!==p?.updatedAt?{cart:s,prevCart:p}:{cart:p,prevCart:y});}),()=>{}},[t,e]),useEffect(()=>{if(!i||!i?.updatedAt||i?.updatedAt===u?.updatedAt)return;let s;try{s=JSON.parse(localStorage.getItem("cartLastUpdatedAt")||"");}catch{s=null;}if(i.id===s?.id&&i.updatedAt===s?.updatedAt)return;let p={eventTimestamp:Date.now(),cart:i,prevCart:u,shop:a,customData:o};if(i.updatedAt===c.current)return;c.current=i.updatedAt,r("cart_updated",p),localStorage.setItem("cartLastUpdatedAt",JSON.stringify({id:i.id,updatedAt:i.updatedAt}));let y=u?.lines?flattenConnection(u?.lines):[],m=i.lines?flattenConnection(i.lines):[];y?.forEach(l=>{let d=m.filter(g=>l.id===g.id);if(d?.length===1){let g=d[0];l.quantity<g.quantity?r("product_added_to_cart",{...p,prevLine:l,currentLine:g}):l.quantity>g.quantity&&r("product_removed_from_cart",{...p,prevLine:l,currentLine:g});}else r("product_removed_from_cart",{...p,prevLine:l});}),m?.forEach(l=>{let d=y.filter(g=>l.id===g.id);(!d||d.length===0)&&r("product_added_to_cart",{...p,currentLine:l});});},[i,u,r,a,o,n]),null}var un={canTrack:()=>!1,cart:null,customData:{},prevCart:null,publish:()=>{},shop:null,subscribe:()=>{},register:()=>({ready:()=>{}})},Fr=createContext(un),Qe=new Map,we={};function $r(){return Object.values(we).every(Boolean)}function _r(e,t){Qe.has(e)||Qe.set(e,new Map),Qe.get(e)?.set(t.toString(),t);}var Ge=new Map;function Ur(e,t){if(!$r()){Ge.set(e,t);return}qr(e,t);}function qr(e,t){(Qe.get(e)??new Map).forEach((r,a)=>{try{r(t);}catch(o){typeof o=="object"&&o instanceof Error?console.error("Analytics publish error",o.message,a,o.stack):console.error("Analytics publish error",o,a);}});}function Nr(e){return we.hasOwnProperty(e)||(we[e]=!1),{ready:()=>{we[e]=!0,$r()&&Ge.size>0&&(Ge.forEach((t,r)=>{qr(r,t);}),Ge.clear());}}}function Vr(){try{return window.Shopify.customerPrivacy.analyticsProcessingAllowed()}catch{}return !1}function Mr(e,t){return `[h2:error:Analytics.Provider] - ${e} is required. Make sure ${t} is defined in your environment variables. See https://h2o.fyi/analytics/consent to learn how to setup environment variables in the Shopify admin.`}function pn({canTrack:e,cart:t,children:r,consent:a,customData:o={},shop:n=null,disableThrowOnError:i=!1,cookieDomain:u}){let c=useRef(!1),{shop:s}=dn(n),[p,y]=useState(!!e),[m,l]=useState({cart:null,prevCart:null}),[d,g]=useState(e?()=>e:()=>Vr);if(s)if(/\/68817551382$/.test(s.shopId))Wt("[h2:error:Analytics.Provider] - Mock shop is used. Analytics will not work properly.");else {if(!a.checkoutDomain){let f=Mr("consent.checkoutDomain","PUBLIC_CHECKOUT_DOMAIN");at(f);}if(!a.storefrontAccessToken){let f=Mr("consent.storefrontAccessToken","PUBLIC_STOREFRONT_API_TOKEN");at(f);}}let h=useMemo(()=>({canTrack:d,...m,customData:o,publish:d()?Ur:()=>{},shop:s,subscribe:_r,register:Nr}),[p,d(),d,JSON.stringify(d),m,m.cart?.updatedAt,m.prevCart,Ur,_r,o,s,Nr,JSON.stringify(we)]);return jsxs(Fr.Provider,{value:h,children:[r,!!s&&jsx(Sr,{}),!!s&&!!t&&jsx(Lr,{cart:t,setCarts:l}),!!s&&a.checkoutDomain&&jsx(Er,{consent:a,onReady:()=>{c.current=!0,y(!0),g(()=>Vr);},domain:u})]})}function X(){let e=useContext(Fr);if(!e)throw new Error("[h2:error:useAnalytics] 'useAnalytics()' must be a descendent of <AnalyticsProvider/>");return e}function dn(e){let[t,r]=useState(null);return useEffect(()=>(Promise.resolve(e).then(r),()=>{}),[r,e]),{shop:t}}async function ln({storefront:e,publicStorefrontId:t="0"}){return e.query(yn,{cache:e.CacheLong()}).then(({shop:r,localization:a})=>({shopId:r.id,acceptedLanguage:a.language.isoCode,currency:a.country.currency.isoCode,hydrogenSubchannelId:t}))}var yn=`#graphql
622
622
  query ShopData(
623
623
  $country: CountryCode
624
624
  $language: LanguageCode
@@ -637,7 +637,7 @@ API response error: ${t.status}`,c=new K(u,{query:a,queryVariables:s,cause:{erro
637
637
  }
638
638
  }
639
639
  }
640
- `,on={CartView:gr,CollectionView:mr,CustomView:Cr,ProductView:fr,Provider:Za,SearchView:hr};//! @see: https://shopify.dev/docs/api/storefront/latest/mutations/cartCreate
640
+ `,fn={CartView:Tr,CollectionView:Ar,CustomView:Ir,ProductView:Pr,Provider:pn,SearchView:vr};var Cn=function(e){return jsx(RichText,{...e,components:{link:({node:t})=>jsx(Link,{to:t.url,title:t.title,target:t.target,prefetch:"intent",children:t.children}),...e.components}})};//! @see: https://shopify.dev/docs/api/storefront/latest/mutations/cartCreate
641
641
  //! @see https://shopify.dev/docs/api/storefront/latest/queries/cart
642
642
  //! @see: https://shopify.dev/docs/api/storefront/latest/mutations/cartLinesAdd
643
643
  //! @see: https://shopify.dev/docs/api/storefront/latest/mutations/cartLinesUpdate
@@ -649,6 +649,6 @@ API response error: ${t.status}`,c=new K(u,{query:a,queryVariables:s,cause:{erro
649
649
  //! @see https://shopify.dev/docs/api/storefront/latest/mutations/cartMetafieldsSet
650
650
  //! @see https://shopify.dev/docs/api/storefront/2024-04/mutations/cartMetafieldDelete
651
651
 
652
- export { X as AnalyticsEvent, je as CacheCustom, We as CacheLong, Ge as CacheNone, re as CacheShort, Ve as CartForm, rt as InMemoryCache, Aa as OptimisticInput, So as Pagination, ha as Script, yo as Seo, Ia as ShopPayButton, on as UNSTABLE_Analytics, na as VariantSelector, Pt as cartAttributesUpdateDefault, ht as cartBuyerIdentityUpdateDefault, dt as cartCreateDefault, gt as cartDiscountCodesUpdateDefault, lt as cartGetDefault, Xo as cartGetIdDefault, yt as cartLinesAddDefault, mt as cartLinesRemoveDefault, ft as cartLinesUpdateDefault, Tt as cartMetafieldDeleteDefault, At as cartMetafieldsSetDefault, Ct as cartNoteUpdateDefault, St as cartSelectedDeliveryOptionsUpdateDefault, Zo as cartSetIdDefault, Uo as changelogHandler, ea as createCartHandler, ya as createContentSecurityPolicy, Do as createCustomerAccountClient, Nn as createStorefrontClient, Hn as createWithCache, P as formatAPIResult, ye as generateCacheControlHeader, It as getCustomerPrivacy, Ao as getPaginationVariables, sa as getSelectedProductOptions, fo as getSeoMeta, tn as getShopAnalytics, oo as graphiqlLoader, to as storefrontRedirect, Y as unstable_useAnalytics, Rt as useCustomerPrivacy, vt as useNonce, Pa as useOptimisticData };
652
+ export { fn as Analytics, Z as AnalyticsEvent, ze as CacheCustom, Ke as CacheLong, We as CacheNone, oe as CacheShort, G as CartForm, nt as InMemoryCache, Oa as OptimisticInput, wo as Pagination, Cn as RichText, ba as Script, Po as Seo, Ua as ShopPayButton, ma as VariantSelector, vt as cartAttributesUpdateDefault, Pt as cartBuyerIdentityUpdateDefault, ft as cartCreateDefault, St as cartDiscountCodesUpdateDefault, mt as cartGetDefault, na as cartGetIdDefault, gt as cartLinesAddDefault, Ct as cartLinesRemoveDefault, ht as cartLinesUpdateDefault, Rt as cartMetafieldDeleteDefault, It as cartMetafieldsSetDefault, At as cartNoteUpdateDefault, Tt as cartSelectedDeliveryOptionsUpdateDefault, sa as cartSetIdDefault, Fo as changelogHandler, ca as createCartHandler, va as createContentSecurityPolicy, Vo as createCustomerAccountClient, Jn as createStorefrontClient, ri as createWithCache, P as formatAPIResult, fe as generateCacheControlHeader, Et as getCustomerPrivacy, Eo as getPaginationVariables, ga as getSelectedProductOptions, Ao as getSeoMeta, ln as getShopAnalytics, po as graphiqlLoader, co as storefrontRedirect, X as useAnalytics, bt as useCustomerPrivacy, wt as useNonce, pa as useOptimisticCart, xa as useOptimisticData };
653
653
  //# sourceMappingURL=out.js.map
654
654
  //# sourceMappingURL=index.js.map