@shopify/hydrogen 2023.7.3 → 2023.7.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.
@@ -4,7 +4,7 @@ import { ExecutionArgs } from 'graphql';
4
4
  import { LanguageCode, CountryCode, Maybe, PageInfo, CartMetafieldsSetInput, Cart, CartUserError, MetafieldsSetUserError, MetafieldDeleteUserError, Scalars, AttributeInput, CartBuyerIdentityInput, CartInput, CartLineInput, CartLineUpdateInput, CartSelectedDeliveryOptionInput, ProductOption, ProductVariantConnection, ProductVariant, SelectedOptionInput } from '@shopify/hydrogen-react/storefront-api-types';
5
5
  import { LoaderArgs, LoaderFunction, SerializeFrom, AppData } from '@remix-run/server-runtime';
6
6
  import * as react from 'react';
7
- import react__default, { ReactNode } from 'react';
7
+ import react__default, { ReactNode, ComponentType } from 'react';
8
8
  import { Params, Location, LinkProps, FetcherWithComponents } from '@remix-run/react';
9
9
  import { Thing, WithContext } from 'schema-dts';
10
10
  import { PartialDeep } from 'type-fest';
@@ -923,14 +923,33 @@ type VariantSelectorProps = {
923
923
  options: Array<PartialDeep<ProductOption>> | undefined;
924
924
  /** Product variants from the [Storefront API](/docs/api/storefront/2023-07/objects/ProductVariant). You only need to pass this prop if you want to show product availability. If a product option combination is not found within `variants`, it is assumed to be available. Make sure to include `availableForSale` and `selectedOptions.name` and `selectedOptions.value`. */
925
925
  variants?: PartialDeep<ProductVariantConnection> | Array<PartialDeep<ProductVariant>>;
926
+ /** By default all products are under /products. Use this prop to provide a custom path. */
927
+ productPath?: string;
926
928
  children: ({ option }: {
927
929
  option: VariantOption;
928
930
  }) => ReactNode;
929
931
  };
930
- declare function VariantSelector({ handle, options, variants: _variants, children, }: VariantSelectorProps): react.FunctionComponentElement<{
932
+ declare function VariantSelector({ handle, options, variants: _variants, productPath, children, }: VariantSelectorProps): react.FunctionComponentElement<{
931
933
  children?: ReactNode;
932
934
  }>;
933
935
  type GetSelectedProductOptions = (request: Request) => SelectedOptionInput[];
934
936
  declare const getSelectedProductOptions: GetSelectedProductOptions;
935
937
 
936
- export { CacheCustom, CacheLong, CacheNone, CacheShort, CartActionInput, CartForm, CartQueryData, CartQueryOptions, CartQueryReturn, CookieOptions, CreateStorefrontClientOptions, HydrogenCart, HydrogenCartCustom, I18nBase, InMemoryCache, MetafieldWithoutOwnerId, Pagination, Seo, SeoConfig, SeoHandleFunction, Storefront, StorefrontClient, StorefrontMutations, StorefrontQueries, VariantOption, VariantOptionValue, VariantSelector, WithCache, cartAttributesUpdateDefault, cartBuyerIdentityUpdateDefault, cartCreateDefault, cartDiscountCodesUpdateDefault, cartGetDefault, cartGetIdDefault, cartLinesAddDefault, cartLinesRemoveDefault, cartLinesUpdateDefault, cartMetafieldDeleteDefault, cartMetafieldsSetDefault, cartNoteUpdateDefault, cartSelectedDeliveryOptionsUpdateDefault, cartSetIdDefault, createCartHandler, createStorefrontClient, createWithCache, generateCacheControlHeader, getPaginationVariables, getSelectedProductOptions, graphiqlLoader, isStorefrontApiError, storefrontRedirect };
938
+ declare const useNonce: () => string | undefined;
939
+ type ContentSecurityPolicy = {
940
+ /** A randomly generated nonce string that should be passed to any custom `script` element */
941
+ nonce: string;
942
+ /** The content security policy header */
943
+ header: string;
944
+ NonceProvider: ComponentType<{
945
+ children: ReactNode;
946
+ }>;
947
+ };
948
+ /**
949
+ * @param directives - Pass custom [content security policy directives](https://content-security-policy.com/). This is important if you load content in your app from third-party domains.
950
+ */
951
+ declare function createContentSecurityPolicy(directives?: Record<string, string[] | string | boolean>): ContentSecurityPolicy;
952
+
953
+ declare const Script: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProps<react.ScriptHTMLAttributes<HTMLScriptElement>, HTMLScriptElement>, "ref"> & react.RefAttributes<HTMLScriptElement>>;
954
+
955
+ export { CacheCustom, CacheLong, CacheNone, CacheShort, CartActionInput, CartForm, CartQueryData, CartQueryOptions, CartQueryReturn, CookieOptions, CreateStorefrontClientOptions, HydrogenCart, HydrogenCartCustom, I18nBase, InMemoryCache, MetafieldWithoutOwnerId, Pagination, Script, Seo, SeoConfig, SeoHandleFunction, Storefront, StorefrontClient, StorefrontMutations, StorefrontQueries, VariantOption, VariantOptionValue, VariantSelector, WithCache, cartAttributesUpdateDefault, cartBuyerIdentityUpdateDefault, cartCreateDefault, cartDiscountCodesUpdateDefault, cartGetDefault, cartGetIdDefault, cartLinesAddDefault, cartLinesRemoveDefault, cartLinesUpdateDefault, cartMetafieldDeleteDefault, cartMetafieldsSetDefault, cartNoteUpdateDefault, cartSelectedDeliveryOptionsUpdateDefault, cartSetIdDefault, createCartHandler, createContentSecurityPolicy, createStorefrontClient, createWithCache, generateCacheControlHeader, getPaginationVariables, getSelectedProductOptions, graphiqlLoader, isStorefrontApiError, storefrontRedirect, useNonce };
@@ -4,7 +4,7 @@ import { ExecutionArgs } from 'graphql';
4
4
  import { LanguageCode, CountryCode, Maybe, PageInfo, CartMetafieldsSetInput, Cart, CartUserError, MetafieldsSetUserError, MetafieldDeleteUserError, Scalars, AttributeInput, CartBuyerIdentityInput, CartInput, CartLineInput, CartLineUpdateInput, CartSelectedDeliveryOptionInput, ProductOption, ProductVariantConnection, ProductVariant, SelectedOptionInput } from '@shopify/hydrogen-react/storefront-api-types';
5
5
  import { LoaderArgs, LoaderFunction, SerializeFrom, AppData } from '@remix-run/server-runtime';
6
6
  import * as react from 'react';
7
- import react__default, { ReactNode } from 'react';
7
+ import react__default, { ReactNode, ComponentType } from 'react';
8
8
  import { Params, Location, LinkProps, FetcherWithComponents } from '@remix-run/react';
9
9
  import { Thing, WithContext } from 'schema-dts';
10
10
  import { PartialDeep } from 'type-fest';
@@ -923,14 +923,33 @@ type VariantSelectorProps = {
923
923
  options: Array<PartialDeep<ProductOption>> | undefined;
924
924
  /** Product variants from the [Storefront API](/docs/api/storefront/2023-07/objects/ProductVariant). You only need to pass this prop if you want to show product availability. If a product option combination is not found within `variants`, it is assumed to be available. Make sure to include `availableForSale` and `selectedOptions.name` and `selectedOptions.value`. */
925
925
  variants?: PartialDeep<ProductVariantConnection> | Array<PartialDeep<ProductVariant>>;
926
+ /** By default all products are under /products. Use this prop to provide a custom path. */
927
+ productPath?: string;
926
928
  children: ({ option }: {
927
929
  option: VariantOption;
928
930
  }) => ReactNode;
929
931
  };
930
- declare function VariantSelector({ handle, options, variants: _variants, children, }: VariantSelectorProps): react.FunctionComponentElement<{
932
+ declare function VariantSelector({ handle, options, variants: _variants, productPath, children, }: VariantSelectorProps): react.FunctionComponentElement<{
931
933
  children?: ReactNode;
932
934
  }>;
933
935
  type GetSelectedProductOptions = (request: Request) => SelectedOptionInput[];
934
936
  declare const getSelectedProductOptions: GetSelectedProductOptions;
935
937
 
936
- export { CacheCustom, CacheLong, CacheNone, CacheShort, CartActionInput, CartForm, CartQueryData, CartQueryOptions, CartQueryReturn, CookieOptions, CreateStorefrontClientOptions, HydrogenCart, HydrogenCartCustom, I18nBase, InMemoryCache, MetafieldWithoutOwnerId, Pagination, Seo, SeoConfig, SeoHandleFunction, Storefront, StorefrontClient, StorefrontMutations, StorefrontQueries, VariantOption, VariantOptionValue, VariantSelector, WithCache, cartAttributesUpdateDefault, cartBuyerIdentityUpdateDefault, cartCreateDefault, cartDiscountCodesUpdateDefault, cartGetDefault, cartGetIdDefault, cartLinesAddDefault, cartLinesRemoveDefault, cartLinesUpdateDefault, cartMetafieldDeleteDefault, cartMetafieldsSetDefault, cartNoteUpdateDefault, cartSelectedDeliveryOptionsUpdateDefault, cartSetIdDefault, createCartHandler, createStorefrontClient, createWithCache, generateCacheControlHeader, getPaginationVariables, getSelectedProductOptions, graphiqlLoader, isStorefrontApiError, storefrontRedirect };
938
+ declare const useNonce: () => string | undefined;
939
+ type ContentSecurityPolicy = {
940
+ /** A randomly generated nonce string that should be passed to any custom `script` element */
941
+ nonce: string;
942
+ /** The content security policy header */
943
+ header: string;
944
+ NonceProvider: ComponentType<{
945
+ children: ReactNode;
946
+ }>;
947
+ };
948
+ /**
949
+ * @param directives - Pass custom [content security policy directives](https://content-security-policy.com/). This is important if you load content in your app from third-party domains.
950
+ */
951
+ declare function createContentSecurityPolicy(directives?: Record<string, string[] | string | boolean>): ContentSecurityPolicy;
952
+
953
+ declare const Script: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProps<react.ScriptHTMLAttributes<HTMLScriptElement>, HTMLScriptElement>, "ref"> & react.RefAttributes<HTMLScriptElement>>;
954
+
955
+ export { CacheCustom, CacheLong, CacheNone, CacheShort, CartActionInput, CartForm, CartQueryData, CartQueryOptions, CartQueryReturn, CookieOptions, CreateStorefrontClientOptions, HydrogenCart, HydrogenCartCustom, I18nBase, InMemoryCache, MetafieldWithoutOwnerId, Pagination, Script, Seo, SeoConfig, SeoHandleFunction, Storefront, StorefrontClient, StorefrontMutations, StorefrontQueries, VariantOption, VariantOptionValue, VariantSelector, WithCache, cartAttributesUpdateDefault, cartBuyerIdentityUpdateDefault, cartCreateDefault, cartDiscountCodesUpdateDefault, cartGetDefault, cartGetIdDefault, cartLinesAddDefault, cartLinesRemoveDefault, cartLinesUpdateDefault, cartMetafieldDeleteDefault, cartMetafieldsSetDefault, cartNoteUpdateDefault, cartSelectedDeliveryOptionsUpdateDefault, cartSetIdDefault, createCartHandler, createContentSecurityPolicy, createStorefrontClient, createWithCache, generateCacheControlHeader, getPaginationVariables, getSelectedProductOptions, graphiqlLoader, isStorefrontApiError, storefrontRedirect, useNonce };
@@ -1,12 +1,13 @@
1
1
  import { createStorefrontClient, SHOPIFY_STOREFRONT_ID_HEADER, getShopifyCookies, SHOPIFY_Y, SHOPIFY_STOREFRONT_Y_HEADER, SHOPIFY_S, SHOPIFY_STOREFRONT_S_HEADER, flattenConnection } from '@shopify/hydrogen-react';
2
2
  export { AnalyticsEventName, AnalyticsPageType, ExternalVideo, IMAGE_FRAGMENT, Image, MediaFile, ModelViewer, Money, ShopPayButton, ShopifySalesChannel, Video, flattenConnection, getClientBrowserParameters, getShopifyCookies, parseGid, parseMetafield, sendShopifyAnalytics, storefrontApiCustomScalars, useLoadScript, useMoney, useShopifyCookies } from '@shopify/hydrogen-react';
3
3
  import { redirect } from '@remix-run/server-runtime';
4
- import { lazy, useMemo, createElement, Suspense, Fragment } from 'react';
4
+ import { lazy, createContext, forwardRef, useMemo, createElement, Suspense, Fragment, useState, useEffect, useContext } from 'react';
5
5
  import { useMatches, useLocation, useNavigation, Link, useFetcher } from '@remix-run/react';
6
- import { jsxs, jsx } from 'react/jsx-runtime';
6
+ import { jsx, jsxs } from 'react/jsx-runtime';
7
+ import dr from 'content-security-policy-builder';
7
8
 
8
- function ge(e){let t=Array.isArray(e)?e:[e],a="";for(let r of t)r!=null&&(typeof r=="object"?r.body&&typeof r.body=="string"?a+=r.body:a+=JSON.stringify(r):a+=r);return encodeURIComponent(a)}var k="public",Be="private",_="no-store",me={maxAge:"max-age",staleWhileRevalidate:"stale-while-revalidate",sMaxAge:"s-maxage",staleIfError:"stale-if-error"};function b(e){let t=[];return Object.keys(e).forEach(a=>{a==="mode"?t.push(e[a]):me[a]&&t.push(`${me[a]}=${e[a]}`);}),t.join(", ")}function Q(){return {mode:_}}function Ce(e){if(e?.mode&&e?.mode!==k&&e?.mode!==Be)throw Error("'mode' must be either 'public' or 'private'")}function I(e){return Ce(e),{mode:k,maxAge:1,staleWhileRevalidate:9,...e}}function H(e){return Ce(e),{mode:k,maxAge:3600,staleWhileRevalidate:82800,...e}}function G(e){return e}function U(e){return String(e).includes("__proto__")?JSON.parse(e,We):JSON.parse(e)}function We(e,t){if(e!=="__proto__")return t}function w(e,t){return e&&t?{...e,...t}:e||I()}function V(e){return b(w(e))}async function je(e,t){if(!e)return;let a=await e.match(t);if(!a){return}return a}async function Je(e,t,a,r){if(!e)return;let i=w(r),n=V(w(i,{maxAge:(i.maxAge||0)+(i.staleWhileRevalidate||0)})),o=V(w(i));a.headers.set("cache-control",n),a.headers.set("real-cache-control",o),a.headers.set("cache-put-date",new Date().toUTCString()),await e.put(t,a);}async function Ke(e,t){e&&await e.delete(t);}function Ye(e,t){let a=e.headers.get("real-cache-control"),r=0;if(a){let n=a.match(/max-age=(\d*)/);n&&n.length>1&&(r=parseFloat(n[1]));}return [(new Date().valueOf()-new Date(t).valueOf())/1e3,r]}function ze(e,t){let a=t.headers.get("cache-put-date");if(!a)return !1;let[r,i]=Ye(t,a),n=r>i;return n}var E={get:je,set:Je,delete:Ke,generateDefaultCacheControlHeader:V,isStale:ze};function B(e){return `https://shopify.dev/?${e}`}function Xe(e){return e||I()}async function he(e,t){if(!e)return;let a=B(t),r=new Request(a),i=await E.get(e,r);if(!i)return;let n=await i.text();try{return [U(n),i]}catch{return [n,i]}}async function W(e,t,a,r){if(!e)return;let i=B(t),n=new Request(i),o=new Response(JSON.stringify(a));await E.set(e,n,o,Xe(r));}function Se(e,t){return E.isStale(new Request(B(e)),t)}function Ze(e,t){return [e,{status:t.status,statusText:t.statusText,headers:Array.from(t.headers.entries())}]}function Ie([e,t]){return [e,new Response(e,t)]}var Re=e=>!e?.errors,j=new Set;async function J(e,t,{strategy:a=I(),cacheInstance:r,shouldCacheResult:i=()=>!0,waitUntil:n}){if(!r||!a||a.mode===_)return t();let o=ge([...typeof e=="string"?[e]:e]),s=await he(r,o);if(s){let[c,p]=s;if(!j.has(o)&&Se(o,p)){j.add(o);let d=Promise.resolve().then(async()=>{try{let l=await t();i(l)&&await W(r,o,l,a);}catch(l){l.message&&(l.message="SWR in sub-request failed: "+l.message),console.error(l);}finally{j.delete(o);}});n?.(d);}return c}let u=await t();if(i(u)){let c=W(r,o,u,a);n?.(c);}return u}async function Te(e,t,{cacheInstance:a,cache:r,cacheKey:i=[e,t],shouldCacheResponse:n=()=>!0,waitUntil:o,returnType:s="json"}={}){return !r&&(!t.method||t.method==="GET")&&(r=I()),J(i,async()=>{let u=await fetch(e,t),c;try{c=await u[s]();}catch{try{c=await u.text();}catch{throw new Error(`Storefront API response code: ${u.status} (Request Id: ${u.headers.get("x-request-id")})`)}}return Ze(c,u)},{cacheInstance:a,waitUntil:o,strategy:r??null,shouldCacheResult:u=>n(...Ie(u))}).then(Ie)}var xe="Custom-Storefront-Request-Group-ID";function Ae(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():`weak-${Math.random().toString(16).substring(2)}`}var K="2023.7.3";var Me=class extends Error{},ot=e=>e instanceof Me,it=/(^|}\s)query[\s({]/im,st=/(^|}\s)mutation[\s({]/im;function be(e){return e.replace(/\s*#.*$/gm,"").replace(/\s+/gm," ").trim()}var ut={language:"EN",country:"US"};function Pr(e){let {storefrontHeaders:t,cache:a,waitUntil:r,buyerIp:i,i18n:n,requestGroupId:o,storefrontId:s,...u}=e,{getPublicTokenHeaders:p,getPrivateTokenHeaders:d,getStorefrontApiUrl:l,getShopifyDomain:h}=createStorefrontClient(u),m=(u.privateStorefrontToken?d:p)({contentType:"json",buyerIp:t?.buyerIp||i});if(m[xe]=t?.requestGroupId||o||Ae(),s&&(m[SHOPIFY_STOREFRONT_ID_HEADER]=s),(m["user-agent"]=`Hydrogen ${K}`),t&&t.cookie){let y=getShopifyCookies(t.cookie??"");y[SHOPIFY_Y]&&(m[SHOPIFY_STOREFRONT_Y_HEADER]=y[SHOPIFY_Y]),y[SHOPIFY_S]&&(m[SHOPIFY_STOREFRONT_S_HEADER]=y[SHOPIFY_S]);}async function O({query:y,mutation:S,variables:A,cache:ke,headers:P=[],storefrontApiVersion:_e}){let Qe=P instanceof Headers?Object.fromEntries(P.entries()):Array.isArray(P)?Object.fromEntries(P):P;y=y??S;let M={...A};n&&(!A?.country&&/\$country/.test(y)&&(M.country=n.country),!A?.language&&/\$language/.test(y)&&(M.language=n.language));let He=l({storefrontApiVersion:_e}),Ge={method:"POST",headers:{...m,...Qe},body:JSON.stringify({query:y,variables:M})},[$,le]=await Te(He,Ge,{cacheInstance:S?void 0:a,cache:ke||I(),shouldCacheResponse:Re,waitUntil:r}),ye={response:le,type:S?"mutation":"query",query:y,queryVariables:M,errors:void 0};if(!le.ok){let q;try{q=U($);}catch{q=[{message:$}];}De({...ye,errors:q});}let{data:Ve,errors:fe}=$;return fe?.length&&De({...ye,errors:fe,ErrorConstructor:Me}),Ve}return {storefront:{query:(y,S)=>{if(y=be(y),st.test(y))throw new Error("[h2:error:storefront.query] Cannot execute mutations");return O({...S,query:y})},mutate:(y,S)=>{if(y=be(y),it.test(y))throw new Error("[h2:error:storefront.mutate] Cannot execute queries");return O({...S,mutation:y})},cache:a,CacheNone:Q,CacheLong:H,CacheShort:I,CacheCustom:G,generateCacheControlHeader:b,getPublicTokenHeaders:p,getPrivateTokenHeaders:d,getShopifyDomain:h,getApiUrl:l,isApiError:ot,i18n:n??ut}}}function De({response:e,errors:t,type:a,query:r,queryVariables:i,ErrorConstructor:n=Error}){let o=e.headers.get("x-request-id"),s=(typeof t=="string"?t:t?.map?.(u=>u.message).join(`
9
- `))||`API response error: ${e.status}`;throw new n(`[h2:error:storefront.${a}] `+s+(o?` - Request ID: ${o}`:""),{cause:{errors:t,requestId:o}})}function Ur(e){let{cache:t,waitUntil:a}=e;return function(i,n,o){return J(i,o,{strategy:n,cacheInstance:t,waitUntil:a})}}var Y=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,a){throw new Error("Method not implemented. Use `match` instead.")}async put(t,a){if(t.method!=="GET")throw new TypeError("Cannot cache response to non-GET request.");if(a.status===206)throw new TypeError("Cannot cache response to a range request (206 Partial Content).");if(a.headers.get("vary")?.includes("*"))throw new TypeError("Cannot cache response with 'Vary: *' header.");this.#e.set(t.url,{body:new Uint8Array(await a.arrayBuffer()),status:a.status,headers:[...a.headers],timestamp:Date.now()});}async match(t){if(t.method!=="GET")return;let a=this.#e.get(t.url);if(!a)return;let{body:r,timestamp:i,...n}=a,o=new Headers(n.headers),s=o.get("cache-control")||o.get("real-cache-control")||"",u=parseInt(s.match(/max-age=(\d+)/)?.[1]||"0",10),c=parseInt(s.match(/stale-while-revalidate=(\d+)/)?.[1]||"0",10),p=(Date.now()-i)/1e3;if(p>u+c){this.#e.delete(t.url);return}let l=p>u;return o.set("cache",l?"STALE":"HIT"),o.set("date",new Date(i).toUTCString()),new Response(r,{status:n.status??200,headers:o})}async delete(t){return this.#e.has(t.url)?(this.#e.delete(t.url),!0):!1}keys(t){let a=[];for(let r of this.#e.keys())(!t||t.url===r)&&a.push(new Request(r));return Promise.resolve(a)}};async function pt(e){let{storefront:t,request:a,noAdminRedirect:r,response:i=new Response("Not Found",{status:404})}=e,{pathname:n,search:o}=new URL(a.url),s=n+o;if(n==="/admin"&&!r)return redirect(`${t.getShopifyDomain()}/admin`);try{let{urlRedirects:u}=await t.query(dt,{variables:{query:"path:"+s}}),c=u?.edges?.[0]?.node?.target;if(c)return new Response(null,{status:301,headers:{location:c}});let p=new URLSearchParams(o),d=p.get("return_to")||p.get("redirect");if(d){if(ct(d))return redirect(d);console.warn(`Cross-domain redirects are not supported. Tried to redirect from ${s} to ${d}`);}}catch(u){console.error(`Failed to fetch redirects from Storefront API for route ${s}`,u);}return i}function ct(e){try{new URL(e);}catch{return !0}return !1}var dt=`#graphql
9
+ function Ce(e){let t=Array.isArray(e)?e:[e],r="";for(let a of t)a!=null&&(typeof a=="object"?a.body&&typeof a.body=="string"?r+=a.body:r+=JSON.stringify(a):r+=a);return encodeURIComponent(r)}var _="public",Ke="private",Q="no-store",he={maxAge:"max-age",staleWhileRevalidate:"stale-while-revalidate",sMaxAge:"s-maxage",staleIfError:"stale-if-error"};function P(e){let t=[];return Object.keys(e).forEach(r=>{r==="mode"?t.push(e[r]):he[r]&&t.push(`${he[r]}=${e[r]}`);}),t.join(", ")}function H(){return {mode:Q}}function Se(e){if(e?.mode&&e?.mode!==_&&e?.mode!==Ke)throw Error("'mode' must be either 'public' or 'private'")}function I(e){return Se(e),{mode:_,maxAge:1,staleWhileRevalidate:9,...e}}function G(e){return Se(e),{mode:_,maxAge:3600,staleWhileRevalidate:82800,...e}}function V(e){return e}function w(e){return String(e).includes("__proto__")?JSON.parse(e,Ye):JSON.parse(e)}function Ye(e,t){if(e!=="__proto__")return t}function E(e,t){return e&&t?{...e,...t}:e||I()}function B(e){return P(E(e))}async function ze(e,t){if(!e)return;let r=await e.match(t);if(!r){return}return r}async function Xe(e,t,r,a){if(!e)return;let n=E(a),i=B(E(n,{maxAge:(n.maxAge||0)+(n.staleWhileRevalidate||0)})),o=B(E(n));r.headers.set("cache-control",i),r.headers.set("real-cache-control",o),r.headers.set("cache-put-date",new Date().toUTCString()),await e.put(t,r);}async function Ze(e,t){e&&await e.delete(t);}function et(e,t){let r=e.headers.get("real-cache-control"),a=0;if(r){let i=r.match(/max-age=(\d*)/);i&&i.length>1&&(a=parseFloat(i[1]));}return [(new Date().valueOf()-new Date(t).valueOf())/1e3,a]}function tt(e,t){let r=t.headers.get("cache-put-date");if(!r)return !1;let[a,n]=et(t,r),i=a>n;return i}var v={get:ze,set:Xe,delete:Ze,generateDefaultCacheControlHeader:B,isStale:tt};function W(e){return `https://shopify.dev/?${e}`}function rt(e){return e||I()}async function Ie(e,t){if(!e)return;let r=W(t),a=new Request(r),n=await v.get(e,a);if(!n)return;let i=await n.text();try{return [w(i),n]}catch{return [i,n]}}async function j(e,t,r,a){if(!e)return;let n=W(t),i=new Request(n),o=new Response(JSON.stringify(r));await v.set(e,i,o,rt(a));}function Re(e,t){return v.isStale(new Request(W(e)),t)}function at(e,t){return [e,{status:t.status,statusText:t.statusText,headers:Array.from(t.headers.entries())}]}function Te([e,t]){return [e,new Response(e,t)]}var xe=e=>!e?.errors,J=new Set;async function K(e,t,{strategy:r=I(),cacheInstance:a,shouldCacheResult:n=()=>!0,waitUntil:i}){if(!a||!r||r.mode===Q)return t();let o=Ce([...typeof e=="string"?[e]:e]),s=await Ie(a,o);if(s){let[d,u]=s;if(!J.has(o)&&Re(o,u)){J.add(o);let c=Promise.resolve().then(async()=>{try{let l=await t();n(l)&&await j(a,o,l,r);}catch(l){l.message&&(l.message="SWR in sub-request failed: "+l.message),console.error(l);}finally{J.delete(o);}});i?.(c);}return d}let p=await t();if(n(p)){let d=j(a,o,p,r);i?.(d);}return p}async function Ae(e,t,{cacheInstance:r,cache:a,cacheKey:n=[e,t],shouldCacheResponse:i=()=>!0,waitUntil:o,returnType:s="json"}={}){return !a&&(!t.method||t.method==="GET")&&(a=I()),K(n,async()=>{let p=await fetch(e,t),d;try{d=await p[s]();}catch{try{d=await p.text();}catch{throw new Error(`Storefront API response code: ${p.status} (Request Id: ${p.headers.get("x-request-id")})`)}}return at(d,p)},{cacheInstance:r,waitUntil:o,strategy:a??null,shouldCacheResult:p=>i(...Te(p))}).then(Te)}var Oe="Custom-Storefront-Request-Group-ID";function Pe(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():`weak-${Math.random().toString(16).substring(2)}`}var Y="2023.7.4";var we=class extends Error{},ct=e=>e instanceof we,ut=/(^|}\s)query[\s({]/im,dt=/(^|}\s)mutation[\s({]/im;function Me(e){return e.replace(/\s*#.*$/gm,"").replace(/\s+/gm," ").trim()}var lt={language:"EN",country:"US"};function Gr(e){let {storefrontHeaders:t,cache:r,waitUntil:a,buyerIp:n,i18n:i,requestGroupId:o,storefrontId:s,...p}=e,{getPublicTokenHeaders:u,getPrivateTokenHeaders:c,getStorefrontApiUrl:l,getShopifyDomain:h}=createStorefrontClient(p),f=(p.privateStorefrontToken?c:u)({contentType:"json",buyerIp:t?.buyerIp||n});if(f[Oe]=t?.requestGroupId||o||Pe(),s&&(f[SHOPIFY_STOREFRONT_ID_HEADER]=s),(f["user-agent"]=`Hydrogen ${Y}`),t&&t.cookie){let y=getShopifyCookies(t.cookie??"");y[SHOPIFY_Y]&&(f[SHOPIFY_STOREFRONT_Y_HEADER]=y[SHOPIFY_Y]),y[SHOPIFY_S]&&(f[SHOPIFY_STOREFRONT_S_HEADER]=y[SHOPIFY_S]);}async function A({query:y,mutation:R,variables:T,cache:M,headers:O=[],storefrontApiVersion:Ve}){let Be=O instanceof Headers?Object.fromEntries(O.entries()):Array.isArray(O)?Object.fromEntries(O):O;y=y??R;let U={...T};i&&(!T?.country&&/\$country/.test(y)&&(U.country=i.country),!T?.language&&/\$language/.test(y)&&(U.language=i.language));let We=l({storefrontApiVersion:Ve}),je={method:"POST",headers:{...f,...Be},body:JSON.stringify({query:y,variables:U})},[q,fe]=await Ae(We,je,{cacheInstance:R?void 0:r,cache:M||I(),shouldCacheResponse:xe,waitUntil:a}),ge={response:fe,type:R?"mutation":"query",query:y,queryVariables:U,errors:void 0};if(!fe.ok){let k;try{k=w(q);}catch{k=[{message:q}];}Ue({...ge,errors:k});}let{data:Je,errors:me}=q;return me?.length&&Ue({...ge,errors:me,ErrorConstructor:we}),Je}return {storefront:{query:(y,R)=>{if(y=Me(y),dt.test(y))throw new Error("[h2:error:storefront.query] Cannot execute mutations");return A({...R,query:y})},mutate:(y,R)=>{if(y=Me(y),ut.test(y))throw new Error("[h2:error:storefront.mutate] Cannot execute queries");return A({...R,mutation:y})},cache:r,CacheNone:H,CacheLong:G,CacheShort:I,CacheCustom:V,generateCacheControlHeader:P,getPublicTokenHeaders:u,getPrivateTokenHeaders:c,getShopifyDomain:h,getApiUrl:l,isApiError:ct,i18n:i??lt}}}function Ue({response:e,errors:t,type:r,query:a,queryVariables:n,ErrorConstructor:i=Error}){let o=e.headers.get("x-request-id"),s=(typeof t=="string"?t:t?.map?.(p=>p.message).join(`
10
+ `))||`API response error: ${e.status}`;throw new i(`[h2:error:storefront.${r}] `+s+(o?` - Request ID: ${o}`:""),{cause:{errors:t,requestId:o}})}function jr(e){let{cache:t,waitUntil:r}=e;return function(n,i,o){return K(n,o,{strategy:i,cacheInstance:t,waitUntil:r})}}var z=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:n,...i}=r,o=new Headers(i.headers),s=o.get("cache-control")||o.get("real-cache-control")||"",p=parseInt(s.match(/max-age=(\d+)/)?.[1]||"0",10),d=parseInt(s.match(/stale-while-revalidate=(\d+)/)?.[1]||"0",10),u=(Date.now()-n)/1e3;if(u>p+d){this.#e.delete(t.url);return}let l=u>p;return o.set("cache",l?"STALE":"HIT"),o.set("date",new Date(n).toUTCString()),new Response(a,{status:i.status??200,headers:o})}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)}};async function yt(e){let{storefront:t,request:r,noAdminRedirect:a,response:n=new Response("Not Found",{status:404})}=e,{pathname:i,search:o}=new URL(r.url),s=i+o;if(i==="/admin"&&!a)return redirect(`${t.getShopifyDomain()}/admin`);try{let{urlRedirects:p}=await t.query(gt,{variables:{query:"path:"+s}}),d=p?.edges?.[0]?.node?.target;if(d)return new Response(null,{status:301,headers:{location:d}});let u=new URLSearchParams(o),c=u.get("return_to")||u.get("redirect");if(c){if(ft(c))return redirect(c);console.warn(`Cross-domain redirects are not supported. Tried to redirect from ${s} to ${c}`);}}catch(p){console.error(`Failed to fetch redirects from Storefront API for route ${s}`,p);}return n}function ft(e){try{new URL(e);}catch{return !0}return !1}var gt=`#graphql
10
11
  query redirects($query: String) {
11
12
  urlRedirects(first: 1, query: $query) {
12
13
  edges {
@@ -16,12 +17,12 @@ function ge(e){let t=Array.isArray(e)?e:[e],a="";for(let r of t)r!=null&&(typeof
16
17
  }
17
18
  }
18
19
  }
19
- `;var lt=async function({context:t}){let a=t?.storefront;if(!a)throw new Error("GraphiQL: Hydrogen's storefront client must be injected in the loader context.");let r=a.getApiUrl(),i=a.getPublicTokenHeaders()["X-Shopify-Storefront-Access-Token"],n="https://avatars.githubusercontent.com/u/12972006?s=48&v=4";return new Response(`
20
+ `;var mt=async function({context:t}){let r=t?.storefront;if(!r)throw new Error("GraphiQL: Hydrogen's storefront client must be injected in the loader context.");let a=r.getApiUrl(),n=r.getPublicTokenHeaders()["X-Shopify-Storefront-Access-Token"],i="https://avatars.githubusercontent.com/u/12972006?s=48&v=4";return new Response(`
20
21
  <!DOCTYPE html>
21
22
  <html lang="en">
22
23
  <head>
23
24
  <title>GraphiQL</title>
24
- <link rel="icon" type="image/x-icon" href="${n}">
25
+ <link rel="icon" type="image/x-icon" href="${i}">
25
26
  <style>
26
27
  body {
27
28
  height: 100%;
@@ -73,8 +74,8 @@ function ge(e){let t=Array.isArray(e)?e:[e],a="";for(let r of t)r!=null&&(typeof
73
74
  root.render(
74
75
  React.createElement(GraphiQL, {
75
76
  fetcher: GraphiQL.createFetcher({
76
- url: '${r}',
77
- headers: {'X-Shopify-Storefront-Access-Token': '${i}'}
77
+ url: '${a}',
78
+ headers: {'X-Shopify-Storefront-Access-Token': '${n}'}
78
79
  }),
79
80
  defaultEditorToolsVisibility: true,
80
81
  query,
@@ -84,18 +85,18 @@ function ge(e){let t=Array.isArray(e)?e:[e],a="";for(let r of t)r!=null&&(typeof
84
85
  </script>
85
86
  </body>
86
87
  </html>
87
- `,{status:200,headers:{"content-type":"text/html"}})};var T="Error in SEO input: ",L={title:{validate:e=>{if(typeof e!="string")throw new Error(T.concat("`title` should be a string"));if(typeof e=="string"&&e.length>120)throw new Error(T.concat("`title` should not be longer than 120 characters"));return e}},description:{validate:e=>{if(typeof e!="string")throw new Error(T.concat("`description` should be a string"));if(typeof e=="string"&&e.length>155)throw new Error(T.concat("`description` should not be longer than 155 characters"));return e}},url:{validate:e=>{if(typeof e!="string")throw new Error(T.concat("`url` should be a string"));if(typeof e=="string"&&!e.startsWith("http"))throw new Error(T.concat("`url` should be a valid URL"));return e}},handle:{validate:e=>{if(typeof e!="string")throw new Error(T.concat("`handle` should be a string"));if(typeof e=="string"&&!e.startsWith("@"))throw new Error(T.concat("`handle` should start with `@`"));return e}}};function we(e){let t=[];for(let a of Object.keys(e))switch(a){case"title":{let r=v(L.title,e.title),i=yt(e?.titleTemplate,r);if(!i)break;t.push(C("title",{title:i}),C("meta",{property:"og:title",content:i}),C("meta",{name:"twitter:title",content:i}));break}case"description":{let r=v(L.description,e.description);if(!r)break;t.push(C("meta",{name:"description",content:r}),C("meta",{property:"og:description",content:r}),C("meta",{name:"twitter:description",content:r}));break}case"url":{let r=v(L.url,e.url);if(!r)break;t.push(C("link",{rel:"canonical",href:r}),C("meta",{property:"og:url",content:r}));break}case"handle":{let r=v(L.handle,e.handle);if(!r)break;t.push(C("meta",{name:"twitter:site",content:r}),C("meta",{name:"twitter:creator",content:r}));break}case"media":{let r,i=X(e.media);for(let n of i)if(typeof n=="string"&&t.push(C("meta",{name:"og:image",content:n})),n&&typeof n=="object"){let o=n.type||"image",s=n?{url:n?.url,secure_url:n?.url,type:ft(n.url),width:n?.width,height:n?.height,alt:n?.altText}:{};for(let u of Object.keys(s))s[u]&&(r=s[u],t.push(C("meta",{property:`og:${o}:${u}`,content:r},s.url)));}break}case"jsonLd":{let r=X(e.jsonLd),i=0;for(let n of r){if(typeof n!="object")continue;let o=C("script",{type:"application/ld+json",children:JSON.stringify(n)},`json-ld-${n?.["@type"]||n?.name||i++}`);t.push(o);}break}case"alternates":{let r=X(e.alternates);for(let i of r){if(!i)continue;let{language:n,url:o,default:s}=i,u=n?`${n}${s?"-default":""}`:void 0;t.push(C("link",{rel:"alternate",hrefLang:u,href:o}));}break}case"robots":{if(!e.robots)break;let{maxImagePreview:r,maxSnippet:i,maxVideoPreview:n,noArchive:o,noFollow:s,noImageIndex:u,noIndex:c,noSnippet:p,noTranslate:d,unavailableAfter:l}=e.robots,h=[o&&"noarchive",u&&"noimageindex",p&&"nosnippet",d&&"notranslate",r&&`max-image-preview:${r}`,i&&`max-snippet:${i}`,n&&`max-video-preview:${n}`,l&&`unavailable_after:${l}`],R=(c?"noindex":"index")+","+(s?"nofollow":"follow");for(let m of h)m&&(R+=`,${m}`);t.push(C("meta",{name:"robots",content:R}));break}}return t.flat().sort((a,r)=>a.key.localeCompare(r.key))}function C(e,t,a){let r={tag:e,props:{},key:""};return e==="title"?(r.children=t.title,r.key=z(r),r):e==="script"?(r.children=typeof t.children=="string"?t.children:"",r.key=z(r,a),delete t.children,r.props=t,r):(r.props=t,Object.keys(r.props).forEach(i=>!r.props[i]&&delete r.props[i]),r.key=z(r,a),r)}function z(e,t){let{tag:a,props:r}=e;if(a==="title")return "0-title";if(a==="meta"){let i=r.content===t&&typeof r.property=="string"&&!r.property.endsWith("secure_url")&&"0";return [a,...[t,i],r.property||r.name].filter(o=>o).join("-")}return a==="link"?[a,r.rel,r.hrefLang||r.media].filter(n=>n).join("-").replace(/\s+/g,"-"):a==="script"?`${a}-${t}`:`${a}-${r.type}`}function yt(e,t){if(t)return e?typeof e=="function"?e(t):e.replace("%s",t??""):t}function ft(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 X(e){return Array.isArray(e)?e:[e]}function v(e,t){try{return e.validate(t)}catch(a){return console.warn(a.message),t}}var It=lazy(()=>import('./log-seo-tags-TY72EQWZ.js'));function Rt({debug:e}){let t=useMatches(),a=useLocation(),r=useMemo(()=>t.flatMap(o=>{let{handle:s,...u}=o,c={...u,...a},p=s?.seo,d=u?.data?.seo;return !p&&!d?[]:p?N(s.seo,c):[d]}).reduce((o,s)=>{Object.keys(s).forEach(c=>!s[c]&&delete s[c]);let{jsonLd:u}=s;return u?o?.jsonLd?Array.isArray(u)?{...o,...s,jsonLd:[...o.jsonLd,...u]}:{...o,...s,jsonLd:[...o.jsonLd,u]}:{...o,...s,jsonLd:[u]}:{...o,...s}},{}),[t,a]),{html:i,loggerMarkup:n}=useMemo(()=>{let o=we(r),s=o.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(It,{headTags:o}));return {html:s,loggerMarkup:u}},[r]);return createElement(Fragment,null,i,e&&n)}function N(e,...t){if(e instanceof Function)return N(e(...t),...t);let a={};return Array.isArray(e)?(a=e.reduce((r,i)=>[...r,N(i)],[]),a):e instanceof Object?(Object.entries(e).forEach(([i,n])=>{a[i]=N(n,...t);}),a):e}function At({connection:e,children:t=()=>(console.warn("<Pagination> requires children to work properly"),null)}){let r=useNavigation().state==="loading",{endCursor:i,hasNextPage:n,hasPreviousPage:o,nextPageUrl:s,nodes:u,previousPageUrl:c,startCursor:p}=Ot(e),d=useMemo(()=>({pageInfo:{endCursor:i,hasPreviousPage:o,startCursor:p},nodes:u}),[i,o,p,u]),l=useMemo(()=>function(m){return n?createElement(Link,{preventScrollReset:!0,...m,to:s,state:d,replace:!0}):null},[n,s]),h=useMemo(()=>function(m){return o?createElement(Link,{preventScrollReset:!0,...m,to:c,state:d,replace:!0}):null},[o,c]);return t({state:d,hasNextPage:n,hasPreviousPage:o,isLoading:r,nextPageUrl:s,nodes:u,previousPageUrl:c,NextLink:l,PreviousLink:h})}function Ot(e){let{state:t,search:a}=useLocation(),n=new URLSearchParams(a).get("direction")==="previous",o=useMemo(()=>!t||!t?.nodes?flattenConnection(e):n?[...flattenConnection(e),...t.nodes]:[...t.nodes,...flattenConnection(e)],[t,e]),s=useMemo(()=>{let p=t?.pageInfo?.startCursor===void 0?e.pageInfo.startCursor:t.pageInfo.startCursor,d=t?.pageInfo?.endCursor===void 0?e.pageInfo.endCursor:t.pageInfo.endCursor;t?.nodes&&(n?p=e.pageInfo.startCursor:d=e.pageInfo.endCursor);let l=t?.pageInfo?.hasPreviousPage===void 0?e.pageInfo.hasPreviousPage:t.pageInfo.hasPreviousPage,h=t?.pageInfo?.hasNextPage===void 0?e.pageInfo.hasNextPage:t.pageInfo.hasNextPage;return {startCursor:p,endCursor:d,hasPreviousPage:l,hasNextPage:h}},[n,t,e.pageInfo.hasNextPage,e.pageInfo.hasPreviousPage,e.pageInfo.startCursor,e.pageInfo.endCursor]),u=useMemo(()=>{let p=new URLSearchParams(a);return p.set("direction","previous"),s.startCursor&&p.set("cursor",s.startCursor),`?${p.toString()}`},[a,s.startCursor]),c=useMemo(()=>{let p=new URLSearchParams(a);return p.set("direction","next"),s.endCursor&&p.set("cursor",s.endCursor),`?${p.toString()}`},[a,s.endCursor]);return {...s,previousPageUrl:u,nextPageUrl:c,nodes:o}}function Pt(e,t={pageBy:20}){if(!(e instanceof Request))throw new Error("getPaginationVariables must be called with the Request object passed to your loader function");let{pageBy:a}=t,r=new URLSearchParams(new URL(e.url).search),i=r.get("cursor")??void 0;return (r.get("direction")==="previous"?"previous":"next")==="previous"?{last:a,startCursor:i??null}:{first:a,endCursor:i??null}}var Ne="cartFormInput";function F({children:e,action:t,inputs:a,route:r}){let i=useFetcher();return jsxs(i.Form,{action:r||"",method:"post",children:[(t||a)&&jsx("input",{type:"hidden",name:Ne,value:JSON.stringify({action:t,inputs:a})}),typeof e=="function"?e(i):e]})}F.INPUT_NAME=Ne;F.ACTIONS={AttributesUpdateInput:"AttributesUpdateInput",BuyerIdentityUpdate:"BuyerIdentityUpdate",Create:"Create",DiscountCodesUpdate:"DiscountCodesUpdate",LinesAdd:"LinesAdd",LinesRemove:"LinesRemove",LinesUpdate:"LinesUpdate",NoteUpdate:"NoteUpdate",SelectedDeliveryOptionsUpdate:"SelectedDeliveryOptionsUpdate",MetafieldsSet:"MetafieldsSet",MetafieldDelete:"MetafieldDelete"};function Dt(e){let t={};for(let o of e.entries()){let s=o[0],u=e.getAll(s);t[s]=u.length>1?u:o[1];}let{cartFormInput:a,...r}=t,{action:i,inputs:n}=a?JSON.parse(String(a)):{};return {action:i,inputs:{...n,...r}}}F.getFormInput=Dt;var f=`#graphql
88
+ `,{status:200,headers:{"content-type":"text/html"}})};var x="Error in SEO input: ",L={title:{validate:e=>{if(typeof e!="string")throw new Error(x.concat("`title` should be a string"));if(typeof e=="string"&&e.length>120)throw new Error(x.concat("`title` should not be longer than 120 characters"));return e}},description:{validate:e=>{if(typeof e!="string")throw new Error(x.concat("`description` should be a string"));if(typeof e=="string"&&e.length>155)throw new Error(x.concat("`description` should not be longer than 155 characters"));return e}},url:{validate:e=>{if(typeof e!="string")throw new Error(x.concat("`url` should be a string"));if(typeof e=="string"&&!e.startsWith("http"))throw new Error(x.concat("`url` should be a valid URL"));return e}},handle:{validate:e=>{if(typeof e!="string")throw new Error(x.concat("`handle` should be a string"));if(typeof e=="string"&&!e.startsWith("@"))throw new Error(x.concat("`handle` should start with `@`"));return e}}};function ve(e){let t=[];for(let r of Object.keys(e))switch(r){case"title":{let a=N(L.title,e.title),n=Ct(e?.titleTemplate,a);if(!n)break;t.push(C("title",{title:n}),C("meta",{property:"og:title",content:n}),C("meta",{name:"twitter:title",content:n}));break}case"description":{let a=N(L.description,e.description);if(!a)break;t.push(C("meta",{name:"description",content:a}),C("meta",{property:"og:description",content:a}),C("meta",{name:"twitter:description",content:a}));break}case"url":{let a=N(L.url,e.url);if(!a)break;t.push(C("link",{rel:"canonical",href:a}),C("meta",{property:"og:url",content:a}));break}case"handle":{let a=N(L.handle,e.handle);if(!a)break;t.push(C("meta",{name:"twitter:site",content:a}),C("meta",{name:"twitter:creator",content:a}));break}case"media":{let a,n=Z(e.media);for(let i of n)if(typeof i=="string"&&t.push(C("meta",{name:"og:image",content:i})),i&&typeof i=="object"){let o=i.type||"image",s=i?{url:i?.url,secure_url:i?.url,type:ht(i.url),width:i?.width,height:i?.height,alt:i?.altText}:{};for(let p of Object.keys(s))s[p]&&(a=s[p],t.push(C("meta",{property:`og:${o}:${p}`,content:a},s.url)));}break}case"jsonLd":{let a=Z(e.jsonLd),n=0;for(let i of a){if(typeof i!="object")continue;let o=C("script",{type:"application/ld+json",children:JSON.stringify(i)},`json-ld-${i?.["@type"]||i?.name||n++}`);t.push(o);}break}case"alternates":{let a=Z(e.alternates);for(let n of a){if(!n)continue;let{language:i,url:o,default:s}=n,p=i?`${i}${s?"-default":""}`:void 0;t.push(C("link",{rel:"alternate",hrefLang:p,href:o}));}break}case"robots":{if(!e.robots)break;let{maxImagePreview:a,maxSnippet:n,maxVideoPreview:i,noArchive:o,noFollow:s,noImageIndex:p,noIndex:d,noSnippet:u,noTranslate:c,unavailableAfter:l}=e.robots,h=[o&&"noarchive",p&&"noimageindex",u&&"nosnippet",c&&"notranslate",a&&`max-image-preview:${a}`,n&&`max-snippet:${n}`,i&&`max-video-preview:${i}`,l&&`unavailable_after:${l}`],S=(d?"noindex":"index")+","+(s?"nofollow":"follow");for(let f of h)f&&(S+=`,${f}`);t.push(C("meta",{name:"robots",content:S}));break}}return t.flat().sort((r,a)=>r.key.localeCompare(a.key))}function C(e,t,r){let a={tag:e,props:{},key:""};return e==="title"?(a.children=t.title,a.key=X(a),a):e==="script"?(a.children=typeof t.children=="string"?t.children:"",a.key=X(a,r),delete t.children,a.props=t,a):(a.props=t,Object.keys(a.props).forEach(n=>!a.props[n]&&delete a.props[n]),a.key=X(a,r),a)}function X(e,t){let{tag:r,props:a}=e;if(r==="title")return "0-title";if(r==="meta"){let n=a.content===t&&typeof a.property=="string"&&!a.property.endsWith("secure_url")&&"0";return [r,...[t,n],a.property||a.name].filter(o=>o).join("-")}return r==="link"?[r,a.rel,a.hrefLang||a.media].filter(i=>i).join("-").replace(/\s+/g,"-"):r==="script"?`${r}-${t}`:`${r}-${a.type}`}function Ct(e,t){if(t)return e?typeof e=="function"?e(t):e.replace("%s",t??""):t}function ht(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 Z(e){return Array.isArray(e)?e:[e]}function N(e,t){try{return e.validate(t)}catch(r){return console.warn(r.message),t}}var At=lazy(()=>import('./log-seo-tags-TY72EQWZ.js'));function Ot({debug:e}){let t=useMatches(),r=useLocation(),a=useMemo(()=>t.flatMap(o=>{let{handle:s,...p}=o,d={...p,...r},u=s?.seo,c=p?.data?.seo;return !u&&!c?[]:u?F(s.seo,d):[c]}).reduce((o,s)=>{Object.keys(s).forEach(d=>!s[d]&&delete s[d]);let{jsonLd:p}=s;return p?o?.jsonLd?Array.isArray(p)?{...o,...s,jsonLd:[...o.jsonLd,...p]}:{...o,...s,jsonLd:[...o.jsonLd,p]}:{...o,...s,jsonLd:[p]}:{...o,...s}},{}),[t,r]),{html:n,loggerMarkup:i}=useMemo(()=>{let o=ve(a),s=o.map(d=>d.tag==="script"?createElement(d.tag,{...d.props,key:d.key,dangerouslySetInnerHTML:{__html:d.children}}):createElement(d.tag,{...d.props,key:d.key},d.children)),p=createElement(Suspense,{fallback:null},createElement(At,{headTags:o}));return {html:s,loggerMarkup:p}},[a]);return createElement(Fragment,null,n,e&&i)}function F(e,...t){if(e instanceof Function)return F(e(...t),...t);let r={};return Array.isArray(e)?(r=e.reduce((a,n)=>[...a,F(n)],[]),r):e instanceof Object?(Object.entries(e).forEach(([n,i])=>{r[n]=F(i,...t);}),r):e}function Mt({connection:e,children:t=()=>(console.warn("<Pagination> requires children to work properly"),null)}){let a=useNavigation().state==="loading",{endCursor:n,hasNextPage:i,hasPreviousPage:o,nextPageUrl:s,nodes:p,previousPageUrl:d,startCursor:u}=Ut(e),c=useMemo(()=>({pageInfo:{endCursor:n,hasPreviousPage:o,startCursor:u},nodes:p}),[n,o,u,p]),l=useMemo(()=>function(f){return i?createElement(Link,{preventScrollReset:!0,...f,to:s,state:c,replace:!0}):null},[i,s,c]),h=useMemo(()=>function(f){return o?createElement(Link,{preventScrollReset:!0,...f,to:d,state:c,replace:!0}):null},[o,d,c]);return t({state:c,hasNextPage:i,hasPreviousPage:o,isLoading:a,nextPageUrl:s,nodes:p,previousPageUrl:d,NextLink:l,PreviousLink:h})}function Ut(e){let{state:t,search:r}=useLocation(),i=new URLSearchParams(r).get("direction")==="previous",[o,s]=useState(flattenConnection(e)),[p,d]=useState({startCursor:e.pageInfo.startCursor,endCursor:e.pageInfo.endCursor,hasPreviousPage:e.pageInfo.hasPreviousPage,hasNextPage:e.pageInfo.hasNextPage});useEffect(()=>{if(t?.nodes&&s(i?[...flattenConnection(e),...t.nodes]:[...t.nodes,...flattenConnection(e)]),t?.pageInfo){let l=t?.pageInfo?.startCursor===void 0?e.pageInfo.startCursor:t.pageInfo.startCursor,h=t?.pageInfo?.endCursor===void 0?e.pageInfo.endCursor:t.pageInfo.endCursor,S=t?.pageInfo?.hasPreviousPage===void 0?e.pageInfo.hasPreviousPage:t.pageInfo.hasPreviousPage,f=t?.pageInfo?.hasNextPage===void 0?e.pageInfo.hasNextPage:t.pageInfo.hasNextPage;t?.nodes&&(i?(l=e.pageInfo.startCursor,S=e.pageInfo.hasPreviousPage):(h=e.pageInfo.endCursor,f=e.pageInfo.hasNextPage)),d({startCursor:l,endCursor:h,hasPreviousPage:S,hasNextPage:f});}},[t,e]);let u=useMemo(()=>{let l=new URLSearchParams(r);return l.set("direction","previous"),p.startCursor&&l.set("cursor",p.startCursor),`?${l.toString()}`},[r,p.startCursor]),c=useMemo(()=>{let l=new URLSearchParams(r);return l.set("direction","next"),p.endCursor&&l.set("cursor",p.endCursor),`?${l.toString()}`},[r,p.endCursor]);return {...p,previousPageUrl:u,nextPageUrl:c,nodes:o}}function wt(e,t={pageBy:20}){if(!(e instanceof Request))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),n=a.get("cursor")??void 0;return (a.get("direction")==="previous"?"previous":"next")==="previous"?{last:r,startCursor:n??null}:{first:r,endCursor:n??null}}var qe="cartFormInput";function $({children:e,action:t,inputs:r,route:a}){let n=useFetcher();return jsxs(n.Form,{action:a||"",method:"post",children:[(t||r)&&jsx("input",{type:"hidden",name:qe,value:JSON.stringify({action:t,inputs:r})}),typeof e=="function"?e(n):e]})}$.INPUT_NAME=qe;$.ACTIONS={AttributesUpdateInput:"AttributesUpdateInput",BuyerIdentityUpdate:"BuyerIdentityUpdate",Create:"Create",DiscountCodesUpdate:"DiscountCodesUpdate",LinesAdd:"LinesAdd",LinesRemove:"LinesRemove",LinesUpdate:"LinesUpdate",NoteUpdate:"NoteUpdate",SelectedDeliveryOptionsUpdate:"SelectedDeliveryOptionsUpdate",MetafieldsSet:"MetafieldsSet",MetafieldDelete:"MetafieldDelete"};function vt(e){let t={};for(let o of e.entries()){let s=o[0],p=e.getAll(s);t[s]=p.length>1?p:o[1];}let{cartFormInput:r,...a}=t,{action:n,inputs:i}=r?JSON.parse(String(r)):{};return {action:n,inputs:{...i,...a}}}$.getFormInput=vt;var g=`#graphql
88
89
  fragment CartApiError on CartUserError {
89
90
  message
90
91
  field
91
92
  code
92
93
  }
93
- `,g=`#graphql
94
+ `,m=`#graphql
94
95
  fragment CartApiMutation on Cart {
95
96
  id
96
97
  totalQuantity
97
98
  }
98
- `;function ee(e){return async(t,a)=>{let{cartId:r,...i}=a||{},{cartCreate:n}=await e.storefront.mutate(wt(e.cartFragment),{variables:{input:t,...i}});return n}}var wt=(e=g)=>`#graphql
99
+ `;function te(e){return async(t,r)=>{let{cartId:a,...n}=r||{},{cartCreate:i}=await e.storefront.mutate(Ft(e.cartFragment),{variables:{input:t,...n}});return i}}var Ft=(e=m)=>`#graphql
99
100
  mutation cartCreate(
100
101
  $input: CartInput!
101
102
  $country: CountryCode = ZZ
@@ -112,8 +113,8 @@ function ge(e){let t=Array.isArray(e)?e:[e],a="";for(let r of t)r!=null&&(typeof
112
113
  }
113
114
  }
114
115
  ${e}
115
- ${f}
116
- `;function te(e){return async t=>{let a=e.getCartId();if(!a)return null;let{cart:r}=await e.storefront.query(Et(e.cartFragment),{variables:{cartId:a,...t},cache:e.storefront.CacheNone()});return r}}var Et=(e=Lt)=>`#graphql
116
+ ${g}
117
+ `;function re(e){return async t=>{let r=e.getCartId();if(!r)return null;let{cart:a}=await e.storefront.query($t(e.cartFragment),{variables:{cartId:r,...t},cache:e.storefront.CacheNone()});return a}}var $t=(e=qt)=>`#graphql
117
118
  query CartQuery(
118
119
  $cartId: ID!
119
120
  $numCartLines: Int = 100
@@ -126,7 +127,7 @@ function ge(e){let t=Array.isArray(e)?e:[e],a="";for(let r of t)r!=null&&(typeof
126
127
  }
127
128
 
128
129
  ${e}
129
- `,Lt=`#graphql
130
+ `,qt=`#graphql
130
131
  fragment CartApiQuery on Cart {
131
132
  id
132
133
  checkoutUrl
@@ -232,7 +233,7 @@ function ge(e){let t=Array.isArray(e)?e:[e],a="";for(let r of t)r!=null&&(typeof
232
233
  width
233
234
  height
234
235
  }
235
- `;function re(e){return async(t,a)=>{let{cartLinesAdd:r}=await e.storefront.mutate(vt(e.cartFragment),{variables:{cartId:e.getCartId(),lines:t,...a}});return r}}var vt=(e=g)=>`#graphql
236
+ `;function ae(e){return async(t,r)=>{let{cartLinesAdd:a}=await e.storefront.mutate(kt(e.cartFragment),{variables:{cartId:e.getCartId(),lines:t,...r}});return a}}var kt=(e=m)=>`#graphql
236
237
  mutation cartLinesAdd(
237
238
  $cartId: ID!
238
239
  $lines: [CartLineInput!]!
@@ -250,8 +251,8 @@ function ge(e){let t=Array.isArray(e)?e:[e],a="";for(let r of t)r!=null&&(typeof
250
251
  }
251
252
 
252
253
  ${e}
253
- ${f}
254
- `;function ae(e){return async(t,a)=>{let{cartLinesUpdate:r}=await e.storefront.mutate(Nt(e.cartFragment),{variables:{cartId:e.getCartId(),lines:t,...a}});return r}}var Nt=(e=g)=>`#graphql
254
+ ${g}
255
+ `;function ne(e){return async(t,r)=>{let{cartLinesUpdate:a}=await e.storefront.mutate(_t(e.cartFragment),{variables:{cartId:e.getCartId(),lines:t,...r}});return a}}var _t=(e=m)=>`#graphql
255
256
  mutation cartLinesUpdate(
256
257
  $cartId: ID!
257
258
  $lines: [CartLineUpdateInput!]!
@@ -269,8 +270,8 @@ function ge(e){let t=Array.isArray(e)?e:[e],a="";for(let r of t)r!=null&&(typeof
269
270
  }
270
271
 
271
272
  ${e}
272
- ${f}
273
- `;function ne(e){return async(t,a)=>{let{cartLinesRemove:r}=await e.storefront.mutate(Ft(e.cartFragment),{variables:{cartId:e.getCartId(),lineIds:t,...a}});return r}}var Ft=(e=g)=>`#graphql
273
+ ${g}
274
+ `;function oe(e){return async(t,r)=>{let{cartLinesRemove:a}=await e.storefront.mutate(Qt(e.cartFragment),{variables:{cartId:e.getCartId(),lineIds:t,...r}});return a}}var Qt=(e=m)=>`#graphql
274
275
  mutation cartLinesRemove(
275
276
  $cartId: ID!
276
277
  $lineIds: [ID!]!
@@ -288,8 +289,8 @@ function ge(e){let t=Array.isArray(e)?e:[e],a="";for(let r of t)r!=null&&(typeof
288
289
  }
289
290
 
290
291
  ${e}
291
- ${f}
292
- `;function oe(e){return async(t,a)=>{let r=t.filter((n,o,s)=>s.indexOf(n)===o),{cartDiscountCodesUpdate:i}=await e.storefront.mutate($t(e.cartFragment),{variables:{cartId:e.getCartId(),discountCodes:r,...a}});return i}}var $t=(e=g)=>`#graphql
292
+ ${g}
293
+ `;function ie(e){return async(t,r)=>{let a=t.filter((i,o,s)=>s.indexOf(i)===o),{cartDiscountCodesUpdate:n}=await e.storefront.mutate(Ht(e.cartFragment),{variables:{cartId:e.getCartId(),discountCodes:a,...r}});return n}}var Ht=(e=m)=>`#graphql
293
294
  mutation cartDiscountCodesUpdate(
294
295
  $cartId: ID!
295
296
  $discountCodes: [String!]
@@ -306,8 +307,8 @@ function ge(e){let t=Array.isArray(e)?e:[e],a="";for(let r of t)r!=null&&(typeof
306
307
  }
307
308
  }
308
309
  ${e}
309
- ${f}
310
- `;function ie(e){return async(t,a)=>{let{cartBuyerIdentityUpdate:r}=await e.storefront.mutate(qt(e.cartFragment),{variables:{cartId:e.getCartId(),buyerIdentity:t,...a}});return r}}var qt=(e=g)=>`#graphql
310
+ ${g}
311
+ `;function se(e){return async(t,r)=>{let{cartBuyerIdentityUpdate:a}=await e.storefront.mutate(Gt(e.cartFragment),{variables:{cartId:e.getCartId(),buyerIdentity:t,...r}});return a}}var Gt=(e=m)=>`#graphql
311
312
  mutation cartBuyerIdentityUpdate(
312
313
  $cartId: ID!
313
314
  $buyerIdentity: CartBuyerIdentityInput!
@@ -324,8 +325,8 @@ function ge(e){let t=Array.isArray(e)?e:[e],a="";for(let r of t)r!=null&&(typeof
324
325
  }
325
326
  }
326
327
  ${e}
327
- ${f}
328
- `;function se(e){return async(t,a)=>{let{cartNoteUpdate:r}=await e.storefront.mutate(kt(e.cartFragment),{variables:{cartId:e.getCartId(),note:t,...a}});return r}}var kt=(e=g)=>`#graphql
328
+ ${g}
329
+ `;function pe(e){return async(t,r)=>{let{cartNoteUpdate:a}=await e.storefront.mutate(Vt(e.cartFragment),{variables:{cartId:e.getCartId(),note:t,...r}});return a}}var Vt=(e=m)=>`#graphql
329
330
  mutation cartNoteUpdate(
330
331
  $cartId: ID!
331
332
  $note: String
@@ -342,8 +343,8 @@ function ge(e){let t=Array.isArray(e)?e:[e],a="";for(let r of t)r!=null&&(typeof
342
343
  }
343
344
  }
344
345
  ${e}
345
- ${f}
346
- `;function ue(e){return async(t,a)=>{let{cartSelectedDeliveryOptionsUpdate:r}=await e.storefront.mutate(_t(e.cartFragment),{variables:{cartId:e.getCartId(),selectedDeliveryOptions:t,...a}});return r}}var _t=(e=g)=>`#graphql
346
+ ${g}
347
+ `;function ce(e){return async(t,r)=>{let{cartSelectedDeliveryOptionsUpdate:a}=await e.storefront.mutate(Bt(e.cartFragment),{variables:{cartId:e.getCartId(),selectedDeliveryOptions:t,...r}});return a}}var Bt=(e=m)=>`#graphql
347
348
  mutation cartSelectedDeliveryOptionsUpdate(
348
349
  $cartId: ID!
349
350
  $selectedDeliveryOptions: [CartSelectedDeliveryOptionInput!]!
@@ -360,8 +361,8 @@ function ge(e){let t=Array.isArray(e)?e:[e],a="";for(let r of t)r!=null&&(typeof
360
361
  }
361
362
  }
362
363
  ${e}
363
- ${f}
364
- `;function pe(e){return async(t,a)=>{let{cartAttributesUpdate:r}=await e.storefront.mutate(Qt(e.cartFragment),{variables:{cartId:a?.cartId||e.getCartId(),attributes:t}});return r}}var Qt=(e=g)=>`#graphql
364
+ ${g}
365
+ `;function ue(e){return async(t,r)=>{let{cartAttributesUpdate:a}=await e.storefront.mutate(Wt(e.cartFragment),{variables:{cartId:r?.cartId||e.getCartId(),attributes:t}});return a}}var Wt=(e=m)=>`#graphql
365
366
  mutation cartAttributesUpdate(
366
367
  $cartId: ID!
367
368
  $attributes: [AttributeInput!]!
@@ -376,8 +377,8 @@ function ge(e){let t=Array.isArray(e)?e:[e],a="";for(let r of t)r!=null&&(typeof
376
377
  }
377
378
  }
378
379
  ${e}
379
- ${f}
380
- `;function ce(e){return async(t,a)=>{let r=a?.cartId||e.getCartId(),i=t.map(o=>({...o,ownerId:r})),{cartMetafieldsSet:n}=await e.storefront.mutate(Ht(),{variables:{metafields:i}});return {cart:{id:r},errors:n.errors}}}var Ht=()=>`#graphql
380
+ ${g}
381
+ `;function de(e){return async(t,r)=>{let a=r?.cartId||e.getCartId(),n=t.map(o=>({...o,ownerId:a})),{cartMetafieldsSet:i}=await e.storefront.mutate(jt(),{variables:{metafields:n}});return {cart:{id:a},errors:i.errors}}}var jt=()=>`#graphql
381
382
  mutation cartMetafieldsSet(
382
383
  $metafields: [CartMetafieldsSetInput!]!
383
384
  $language: LanguageCode
@@ -392,7 +393,7 @@ function ge(e){let t=Array.isArray(e)?e:[e],a="";for(let r of t)r!=null&&(typeof
392
393
  }
393
394
  }
394
395
  }
395
- `;function de(e){return async(t,a)=>{let r=a?.cartId||e.getCartId(),{cartMetafieldDelete:i}=await e.storefront.mutate(Gt(),{variables:{input:{ownerId:r,key:t}}});return {cart:{id:r},errors:i.errors}}}var Gt=()=>`#graphql
396
+ `;function le(e){return async(t,r)=>{let a=r?.cartId||e.getCartId(),{cartMetafieldDelete:n}=await e.storefront.mutate(Jt(),{variables:{input:{ownerId:a,key:t}}});return {cart:{id:a},errors:n.errors}}}var Jt=()=>`#graphql
396
397
  mutation cartMetafieldDelete(
397
398
  $input: CartMetafieldDeleteInput!
398
399
  ) {
@@ -404,7 +405,7 @@ function ge(e){let t=Array.isArray(e)?e:[e],a="";for(let r of t)r!=null&&(typeof
404
405
  }
405
406
  }
406
407
  }
407
- `;var Vt=new Set(["domain","path","max-age","expires","samesite","secure","httponly"]);function Fe(e){let t={},a,r,i=0,n=e.split(/;\s*/g),o,s;for(;i<n.length;i++)if(r=n[i],a=r.indexOf("="),~a){if(o=r.substring(0,a++).trim(),s=r.substring(a).trim(),s[0]==='"'&&(s=s.substring(1,s.length-1)),~s.indexOf("%"))try{s=decodeURIComponent(s);}catch{}Vt.has(r=o.toLowerCase())?r==="expires"?t.expires=new Date(s):r==="max-age"?t.maxage=+s:t[r]=s:t[o]=s;}else (o=r.trim().toLowerCase())&&(o==="httponly"||o==="secure")&&(t[o]=!0);return t}function $e(e,t,a={}){let r=e+"="+encodeURIComponent(t);return a.expires&&(r+="; Expires="+new Date(a.expires).toUTCString()),a.maxage!=null&&a.maxage>=0&&(r+="; Max-Age="+(a.maxage|0)),a.domain&&(r+="; Domain="+a.domain),a.path&&(r+="; Path="+a.path),a.samesite&&(r+="; SameSite="+a.samesite),(a.secure||a.samesite==="None")&&(r+="; Secure"),a.httponly&&(r+="; HttpOnly"),r}var Bt=e=>{let t=Fe(e.get("Cookie")||"");return ()=>t.cart?`gid://shopify/Cart/${t.cart}`:void 0};var Wt=e=>t=>{let a=new Headers;return a.append("Set-Cookie",$e("cart",t.split("/").pop()||"",{path:"/",...e})),a};function jt(e){let{getCartId:t,setCartId:a,storefront:r,cartQueryFragment:i,cartMutateFragment:n}=e,o={storefront:r,getCartId:t,cartFragment:n},s=t(),u=ee(o),c={get:te({storefront:r,getCartId:t,cartFragment:i}),getCartId:t,setCartId:a,create:u,addLines:async(p,d)=>s||d?.cartId?await re(o)(p,d):await u({lines:p},d),updateLines:ae(o),removeLines:ne(o),updateDiscountCodes:async(p,d)=>s||d?.cartId?await oe(o)(p,d):await u({discountCodes:p},d),updateBuyerIdentity:async(p,d)=>s||d?.cartId?await ie(o)(p,d):await u({buyerIdentity:p},d),updateNote:async(p,d)=>s||d?.cartId?await se(o)(p,d):await u({note:p},d),updateSelectedDeliveryOption:ue(o),updateAttributes:async(p,d)=>s||d?.cartId?await pe(o)(p,d):await u({attributes:p},d),setMetafields:async(p,d)=>s||d?.cartId?await ce(o)(p,d):await u({metafields:p},d),deleteMetafield:de(o)};return "customMethods__unstable"in e?{...c,...e.customMethods__unstable??{}}:c}function Xt({handle:e,options:t=[],variants:a=[],children:r}){let i=a instanceof Array?a:flattenConnection(a),{searchParams:n,path:o,alreadyOnProductPage:s}=er(e),u=t.filter(c=>c?.values?.length===1);return createElement(Fragment,null,...useMemo(()=>t.filter(c=>c?.values?.length>1).map(c=>{let p,d=[];for(let l of c.values){let h=new URLSearchParams(s?n:void 0);h.set(c.name,l),u.forEach(S=>{h.set(S.name,S.values[0]);});let R=i.find(S=>S?.selectedOptions?.every(A=>h.get(A?.name)===A?.value)),m=n.get(c.name),O=m?m===l:!1;O&&(p=l);let y="?"+h.toString();d.push({value:l,isAvailable:R?R.availableForSale:!0,to:o+y,search:y,isActive:O});}return r({option:{name:c.name,value:p,values:d}})}),[t,i,r]))}var Zt=e=>{if(!(e instanceof Request))throw new TypeError(`Expected a Request instance, got ${typeof e}`);let t=new URL(e.url).searchParams,a=[];return t.forEach((r,i)=>{a.push({name:i,value:r});}),a};function er(e){let{pathname:t,search:a}=useLocation();return useMemo(()=>{let r=/(\/[a-zA-Z]{2}-[a-zA-Z]{2}\/)/g.exec(t),n=r&&r.length>0?`${r[0]}products/${e}`:`/products/${e}`;return {searchParams:new URLSearchParams(a),alreadyOnProductPage:n===t,path:n}},[t,a,e])}//! @see: https://shopify.dev/docs/api/storefront/latest/mutations/cartCreate
408
+ `;var Kt=new Set(["domain","path","max-age","expires","samesite","secure","httponly"]);function ke(e){let t={},r,a,n=0,i=e.split(/;\s*/g),o,s;for(;n<i.length;n++)if(a=i[n],r=a.indexOf("="),~r){if(o=a.substring(0,r++).trim(),s=a.substring(r).trim(),s[0]==='"'&&(s=s.substring(1,s.length-1)),~s.indexOf("%"))try{s=decodeURIComponent(s);}catch{}Kt.has(a=o.toLowerCase())?a==="expires"?t.expires=new Date(s):a==="max-age"?t.maxage=+s:t[a]=s:t[o]=s;}else (o=a.trim().toLowerCase())&&(o==="httponly"||o==="secure")&&(t[o]=!0);return t}function _e(e,t,r={}){let a=e+"="+encodeURIComponent(t);return r.expires&&(a+="; Expires="+new Date(r.expires).toUTCString()),r.maxage!=null&&r.maxage>=0&&(a+="; Max-Age="+(r.maxage|0)),r.domain&&(a+="; Domain="+r.domain),r.path&&(a+="; Path="+r.path),r.samesite&&(a+="; SameSite="+r.samesite),(r.secure||r.samesite==="None")&&(a+="; Secure"),r.httponly&&(a+="; HttpOnly"),a}var Yt=e=>{let t=ke(e.get("Cookie")||"");return ()=>t.cart?`gid://shopify/Cart/${t.cart}`:void 0};var zt=e=>t=>{let r=new Headers;return r.append("Set-Cookie",_e("cart",t.split("/").pop()||"",{path:"/",...e})),r};function Xt(e){let{getCartId:t,setCartId:r,storefront:a,cartQueryFragment:n,cartMutateFragment:i}=e,o={storefront:a,getCartId:t,cartFragment:i},s=t(),p=te(o),d={get:re({storefront:a,getCartId:t,cartFragment:n}),getCartId:t,setCartId:r,create:p,addLines:async(u,c)=>s||c?.cartId?await ae(o)(u,c):await p({lines:u},c),updateLines:ne(o),removeLines:oe(o),updateDiscountCodes:async(u,c)=>s||c?.cartId?await ie(o)(u,c):await p({discountCodes:u},c),updateBuyerIdentity:async(u,c)=>s||c?.cartId?await se(o)(u,c):await p({buyerIdentity:u},c),updateNote:async(u,c)=>s||c?.cartId?await pe(o)(u,c):await p({note:u},c),updateSelectedDeliveryOption:ce(o),updateAttributes:async(u,c)=>s||c?.cartId?await ue(o)(u,c):await p({attributes:u},c),setMetafields:async(u,c)=>s||c?.cartId?await de(o)(u,c):await p({metafields:u},c),deleteMetafield:le(o)};return "customMethods__unstable"in e?{...d,...e.customMethods__unstable??{}}:d}function ar({handle:e,options:t=[],variants:r=[],productPath:a="products",children:n}){let i=r instanceof Array?r:flattenConnection(r),{searchParams:o,path:s,alreadyOnProductPage:p}=or(e,a),d=t.filter(u=>u?.values?.length===1);return createElement(Fragment,null,...useMemo(()=>t.filter(u=>u?.values?.length>1).map(u=>{let c,l=[];for(let h of u.values){let S=new URLSearchParams(p?o:void 0);S.set(u.name,h),d.forEach(T=>{S.set(T.name,T.values[0]);});let f=i.find(T=>T?.selectedOptions?.every(M=>S.get(M?.name)===M?.value)),A=o.get(u.name),y=A?A===h:!1;y&&(c=h);let R="?"+S.toString();l.push({value:h,isAvailable:f?f.availableForSale:!0,to:s+R,search:R,isActive:y});}return n({option:{name:u.name,value:c,values:l}})}),[t,i,n]))}var nr=e=>{if(!(e instanceof Request))throw new TypeError(`Expected a Request instance, got ${typeof e}`);let t=new URL(e.url).searchParams,r=[];return t.forEach((a,n)=>{r.push({name:n,value:a});}),r};function or(e,t){let{pathname:r,search:a}=useLocation();return useMemo(()=>{let n=/(\/[a-zA-Z]{2}-[a-zA-Z]{2}\/)/g.exec(r),i=n&&n.length>0;t=t.startsWith("/")?t.substring(1):t;let o=i?`${n[0]}${t}/${e}`:`/${t}/${e}`;return {searchParams:new URLSearchParams(a),alreadyOnProductPage:o===r,path:o}},[r,a,e,t])}function He(){return sr(ir())}function ir(){try{return crypto.getRandomValues(new Uint8Array(16))}catch{return new Uint8Array(16).map(()=>Math.random()*255|0)}}function sr(e){return Array.from(e,function(t){return ("0"+(t&255).toString(16)).slice(-2)}).join("")}var Ge=createContext(void 0),lr=Ge.Provider,ye=()=>useContext(Ge);function yr(e={}){let t=He(),r=fr(t,e);return {nonce:t,header:r,NonceProvider:({children:n})=>createElement(lr,{value:t},n)}}function fr(e,t={}){let r=`'nonce-${e}'`,n=Object.assign({},{baseUri:["'self'"],defaultSrc:["'self'",r,"https://cdn.shopify.com","https://shopify.com"],frameAncestors:["none"],styleSrc:["'self'","'unsafe-inline'","https://cdn.shopify.com"],connectSrc:["'self'","https://monorail-edge.shopifysvc.com"]},t);return n.scriptSrc instanceof Array&&!n.scriptSrc.includes(r)?n.scriptSrc.push(r):n.defaultSrc instanceof Array&&!n.defaultSrc.includes(r)&&n.defaultSrc.push(r),dr({directives:n})}var mr=forwardRef((e,t)=>{let r=ye();return jsx("script",{...e,nonce:r,ref:t})});//! @see: https://shopify.dev/docs/api/storefront/latest/mutations/cartCreate
408
409
  //! @see https://shopify.dev/docs/api/storefront/latest/queries/cart
409
410
  //! @see: https://shopify.dev/docs/api/storefront/latest/mutations/cartLinesAdd
410
411
  //! @see: https://shopify.dev/docs/api/storefront/latest/mutations/cartLinesUpdate
@@ -416,6 +417,6 @@ function ge(e){let t=Array.isArray(e)?e:[e],a="";for(let r of t)r!=null&&(typeof
416
417
  //! @see https://shopify.dev/docs/api/storefront/latest/mutations/cartMetafieldsSet
417
418
  //! @see https://shopify.dev/docs/api/storefront/2023-07/mutations/cartMetafieldDelete
418
419
 
419
- export { G as CacheCustom, H as CacheLong, Q as CacheNone, I as CacheShort, F as CartForm, Y as InMemoryCache, At as Pagination, Rt as Seo, Xt as VariantSelector, pe as cartAttributesUpdateDefault, ie as cartBuyerIdentityUpdateDefault, ee as cartCreateDefault, oe as cartDiscountCodesUpdateDefault, te as cartGetDefault, Bt as cartGetIdDefault, re as cartLinesAddDefault, ne as cartLinesRemoveDefault, ae as cartLinesUpdateDefault, de as cartMetafieldDeleteDefault, ce as cartMetafieldsSetDefault, se as cartNoteUpdateDefault, ue as cartSelectedDeliveryOptionsUpdateDefault, Wt as cartSetIdDefault, jt as createCartHandler, Pr as createStorefrontClient, Ur as createWithCache, b as generateCacheControlHeader, Pt as getPaginationVariables, Zt as getSelectedProductOptions, lt as graphiqlLoader, ot as isStorefrontApiError, pt as storefrontRedirect };
420
+ export { V as CacheCustom, G as CacheLong, H as CacheNone, I as CacheShort, $ as CartForm, z as InMemoryCache, Mt as Pagination, mr as Script, Ot as Seo, ar as VariantSelector, ue as cartAttributesUpdateDefault, se as cartBuyerIdentityUpdateDefault, te as cartCreateDefault, ie as cartDiscountCodesUpdateDefault, re as cartGetDefault, Yt as cartGetIdDefault, ae as cartLinesAddDefault, oe as cartLinesRemoveDefault, ne as cartLinesUpdateDefault, le as cartMetafieldDeleteDefault, de as cartMetafieldsSetDefault, pe as cartNoteUpdateDefault, ce as cartSelectedDeliveryOptionsUpdateDefault, zt as cartSetIdDefault, Xt as createCartHandler, yr as createContentSecurityPolicy, Gr as createStorefrontClient, jr as createWithCache, P as generateCacheControlHeader, wt as getPaginationVariables, nr as getSelectedProductOptions, mt as graphiqlLoader, ct as isStorefrontApiError, yt as storefrontRedirect, ye as useNonce };
420
421
  //# sourceMappingURL=out.js.map
421
422
  //# sourceMappingURL=index.js.map