@shopify/hydrogen 2026.1.4 → 2026.4.0

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,4 +1,4 @@
1
- import {createContext,forwardRef,lazy,useContext,useMemo,useEffect,useRef,useState,createElement,Fragment as Fragment$1,Suspense}from'react';import {createContext as createContext$1,useRevalidator,useFetcher,useFetchers,RouterContextProvider,createRequestHandler,useNavigation,useLocation,useNavigate,Link,useMatches}from'react-router';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {useLoadScript,useShopifyCookies,getTrackingValues,createStorefrontClient,SHOPIFY_STOREFRONT_ID_HEADER,SHOPIFY_STOREFRONT_Y_HEADER,SHOPIFY_STOREFRONT_S_HEADER,SHOPIFY_UNIQUE_TOKEN_HEADER,SHOPIFY_VISIT_TOKEN_HEADER,flattenConnection,RichText,ShopPayButton,parseGid,sendShopifyAnalytics,AnalyticsEventName,AnalyticsPageType,getClientBrowserParameters}from'@shopify/hydrogen-react';export{AnalyticsEventName,AnalyticsPageType,ExternalVideo,IMAGE_FRAGMENT,Image,MediaFile,ModelViewer,Money,ShopifySalesChannel,Video,customerAccountApiCustomScalars,decodeEncodedVariant,flattenConnection,getAdjacentAndFirstAvailableVariants,getClientBrowserParameters,getProductOptions,getShopifyCookies,getTrackingValues,isOptionValueCombinationInEncodedVariant,mapSelectedProductOptionToObject,parseGid,parseMetafield,sendShopifyAnalytics,storefrontApiCustomScalars,useLoadScript,useMoney,useSelectedOptionInUrlParam,useShopifyCookies}from'@shopify/hydrogen-react';import {useLoadScript as useLoadScript$1}from'@shopify/hydrogen-react/load-script';import {createGraphQLClient}from'@shopify/graphql-client';import {parse,stringify}from'worktop/cookie';import Ja from'content-security-policy-builder';function le(e){let{type:t,data:r={},customData:o}=e,n=useLocation(),{publish:a,cart:s,prevCart:c,shop:i,customData:u}=z(),p=n.pathname+n.search,y={...r,customData:{...u,...o},cart:s,prevCart:c,shop:i};return useEffect(()=>{i?.shopId&&(y={...y,url:window.location.href},a(t,y));},[a,p,i?.shopId]),null}function Pr(e){return jsx(le,{...e,type:"page_viewed"})}function Sr(e){return jsx(le,{...e,type:"product_viewed"})}function vr(e){return jsx(le,{...e,type:"collection_viewed"})}function Rr(e){return jsx(le,{...e,type:"cart_viewed"})}function Ir(e){return jsx(le,{...e,type:"search_viewed"})}function Tr(e){return jsx(le,{...e})}var F={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 Re="Custom-Storefront-Request-Group-ID",Ie="X-Shopify-Storefront-Access-Token",Ct="X-SDK-Variant",ht="X-SDK-Variant-Source",At="X-SDK-Version",Ge="X-Shopify-Client-IP",fe="X-Shopify-Client-IP-Sig",Be="_sfapi_proxy",Qe="_server_tracking";function Jo(e){return Object.entries(e).map(([t,r])=>r?`${t};desc=${r}`:void 0).filter(Boolean).join(", ")}function Te(e,t){let r=typeof t=="string"?t:Jo(t);r&&e.headers.append("Server-Timing",r);}var zo=["_y","_s","_cmp"];function Er(e){let t={};if(!e)return t;let r=new RegExp(`\\b(${zo.join("|")});desc="?([^",]+)"?`,"g"),o;for(;(o=r.exec(e))!==null;)t[o[1]]=o[2];return t}function br(e){if(typeof window>"u")return false;try{return !!window.performance.getEntriesByType("navigation")[0]?.serverTiming?.some(r=>r.name===e)}catch{return false}}function wr(){return br(Be)}function Dr(){return br(Qe)}var on="https://cdn.shopify.com/shopifycloud/consent-tracking-api/v0.2/consent-tracking-api.js",nn="https://cdn.shopify.com/shopifycloud/privacy-banner/storefront-banner.js";function St(e){console.error(`[h2:error:useCustomerPrivacy] Unable to setup Customer Privacy API: Missing consent.${e} configuration.`);}function vt(e){let{withPrivacyBanner:t=false,onVisitorConsentCollected:r,onReady:o,checkoutDomain:n,storefrontAccessToken:a,country:s,locale:c,sameDomainForStorefrontApi:i}=e,u=useMemo(()=>i??wr(),[i]),p=useMemo(()=>u&&!Dr(),[u]),y=useShopifyCookies({fetchTrackingValues:p,storefrontAccessToken:a,ignoreDeprecatedCookies:true}),m=useMemo(getTrackingValues,[y]),{revalidate:g}=useRevalidator();useLoadScript$1(t?nn:on,{attributes:{id:"customer-privacy-api"}});let{observing:d,setLoaded:l,apisLoaded:S}=sn({withPrivacyBanner:t}),f=useMemo(()=>{n||St("checkoutDomain"),a||St("storefrontAccessToken"),(a.startsWith("shpat_")||a.length!==32)&&console.error("[h2:error:useCustomerPrivacy] It looks like you passed a private access token, make sure to use the public token");let h=cn(n);return {checkoutRootDomain:u&&typeof window<"u"?window.location.host:n,storefrontRootDomain:h?"."+h:void 0,storefrontAccessToken:a,country:s,locale:c}},[St,n,a,s,c]);useEffect(()=>{let h=P=>{let C=getTrackingValues();if((m.visitToken!==C.visitToken||m.uniqueToken!==C.uniqueToken)&&g().catch(()=>{console.warn("[h2:warn:useCustomerPrivacy] Revalidation failed after consent change.");}),r){let R=oe();if(R?.shouldShowBanner()){let I=R.currentVisitorConsent();if(I&&I.marketing===""&&I.analytics===""&&I.preferences==="")return}r(P.detail);}};return document.addEventListener("visitorConsentCollected",h),()=>{document.removeEventListener("visitorConsentCollected",h);}},[r]),useEffect(()=>{if(!t||d.current.privacyBanner)return;d.current.privacyBanner=true;let h=window.privacyBanner||void 0;Object.defineProperty(window,"privacyBanner",{configurable:true,get(){return h},set(C){typeof C=="object"&&C!==null&&"showPreferences"in C&&"loadBanner"in C&&(h=_r({privacyBanner:C,config:f}),l.privacyBanner());}});},[t,f,_r,l.privacyBanner]),useEffect(()=>{if(d.current.customerPrivacy)return;d.current.customerPrivacy=true;let h=null,P=window.Shopify||void 0;Object.defineProperty(window,"Shopify",{configurable:true,get(){return P},set(C){typeof C=="object"&&C!==null&&Object.keys(C).length===0&&(P=C,Object.defineProperty(window.Shopify,"customerPrivacy",{configurable:true,get(){return h},set(R){if(typeof R=="object"&&R!==null&&"setTrackingConsent"in R){let I=R;h={...I,setTrackingConsent:xr({customerPrivacy:I,config:f})},P={...P,customerPrivacy:h},l.customerPrivacy();}}}));}});},[f,xr,l.customerPrivacy]),useEffect(()=>{if(!S||!y)return;let h=oe();if(h&&!h.cachedConsent){let P=getTrackingValues();P.consent&&(h.cachedConsent=P.consent);}if(t){let P=Ee();P&&P.loadBanner(f);}an(),o?.();},[S,y]);let v={customerPrivacy:oe()};return t&&(v.privacyBanner=Ee()),v}var Or=false;function an(){if(Or)return;Or=true;let e=new CustomEvent("shopifyCustomerPrivacyApiLoaded");document.dispatchEvent(e);}function sn({withPrivacyBanner:e}){let t=useRef({customerPrivacy:false,privacyBanner:false}),[r,o]=useState(e?[false,false]:[false]),n=r.every(Boolean);return {observing:t,setLoaded:{customerPrivacy:()=>{o(e?s=>[true,s[1]]:()=>[true]);},privacyBanner:()=>{e&&o(s=>[s[0],true]);}},apisLoaded:n}}function cn(e){if(typeof window>"u")return;let t=window.location.host,r=e.split(".").reverse(),o=t.split(".").reverse(),n=[];return r.forEach((a,s)=>{a===o[s]&&n.push(a);}),n.reverse().join(".")||void 0}function xr({customerPrivacy:e,config:t}){let r=e.setTrackingConsent,{locale:o,country:n,...a}=t;function s(c,i){r({...a,headlessStorefront:true,...c},i);}return s}function _r({privacyBanner:e,config:t}){let r=e.loadBanner,o=e.showPreferences;function n(s){if(typeof s=="object"){r({...t,...s});return}r(t);}function a(s){if(typeof s=="object"){o({...t,...s});return}o(t);}return {loadBanner:n,showPreferences:a}}function oe(){try{return window.Shopify&&window.Shopify.customerPrivacy?window.Shopify?.customerPrivacy:null}catch{return null}}function Ee(){try{return window&&window?.privacyBanner?window.privacyBanner:null}catch{return null}}var Lr="2026.1.4";function fn(){let e=oe();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 kr({consent:e,onReady:t,domain:r}){let{subscribe:o,register:n,canTrack:a}=z(),[s,c]=useState(false),[i,u]=useState(false),[p,y]=useState(""),m=useRef(false),{checkoutDomain:g,storefrontAccessToken:d,language:l}=e,{ready:S}=n("Internal_Shopify_Analytics");vt({...e,locale:l,checkoutDomain:g||"mock.shop",storefrontAccessToken:d||"abcdefghijklmnopqrstuvwxyz123456",onReady:()=>!e.withPrivacyBanner&&u(true),onVisitorConsentCollected:v=>{try{y(JSON.stringify(v));}catch{}u(true);}});let f=useMemo(()=>i?a():true,[i,a,p]);return useShopifyCookies({hasUserConsent:f,domain:r,checkoutDomain:g,fetchTrackingValues:false,ignoreDeprecatedCookies:!i}),useEffect(()=>{m.current||(m.current=true,o(F.PAGE_VIEWED,gn),o(F.PRODUCT_VIEWED,Cn),o(F.COLLECTION_VIEWED,hn),o(F.SEARCH_VIEWED,An),o(F.PRODUCT_ADD_TO_CART,Pn),c(true));},[o]),useEffect(()=>{s&&i&&(S(),t());},[s,i,t]),null}function Ke(e){console.error(`[h2:error:ShopifyAnalytics] Unable to send Shopify analytics: Missing shop.${e} configuration.`);}function De(e){let t=fn(),r=t.analyticsProcessingAllowed();if(!e?.shop?.shopId){Ke("shopId");return}if(!e?.shop?.acceptedLanguage){Ke("acceptedLanguage");return}if(!e?.shop?.currency){Ke("currency");return}if(!e?.shop?.hydrogenSubchannelId){Ke("hydrogenSubchannelId");return}return {shopifySalesChannel:"hydrogen",assetVersionId:Lr,...e.shop,hasUserConsent:r,...getClientBrowserParameters(),analyticsAllowed:t.analyticsProcessingAllowed(),marketingAllowed:t.marketingAllowed(),saleOfDataAllowed:t.saleOfDataAllowed(),ccpaEnforced:!t.saleOfDataAllowed(),gdprEnforced:!(t.marketingAllowed()&&t.analyticsProcessingAllowed())}}function mn(e,t){if(t===null)return;let r=De(e);return r?{...r,cartId:t.id}:void 0}var ne={};function gn(e){let t=De(e);t&&(sendShopifyAnalytics({eventName:AnalyticsEventName.PAGE_VIEW_2,payload:{...t,...ne}}),ne={});}function Cn(e){let t=De(e);if(t&&Nr({type:"product",products:e.products})){let r=It(e.products);ne={pageType:AnalyticsPageType.product,resourceId:r[0].productGid},t={...t,...ne,products:It(e.products)},sendShopifyAnalytics({eventName:AnalyticsEventName.PRODUCT_VIEW,payload:t});}}function hn(e){let t=De(e);t&&(ne={pageType:AnalyticsPageType.collection,resourceId:e.collection.id},t={...t,...ne,collectionHandle:e.collection.handle,collectionId:e.collection.id},sendShopifyAnalytics({eventName:AnalyticsEventName.COLLECTION_VIEW,payload:t}));}function An(e){let t=De(e);t&&(ne={pageType:AnalyticsPageType.search},t={...t,...ne,searchString:e.searchTerm},sendShopifyAnalytics({eventName:AnalyticsEventName.SEARCH_VIEW,payload:t}));}function Pn(e){let{cart:t,currentLine:r}=e,o=mn(e,t);!o||!r?.id||Sn({matchedLine:r,eventPayload:o});}function Sn({matchedLine:e,eventPayload:t}){let r={id:e.merchandise.product.id,variantId:e.merchandise.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};Nr({type:"cart",products:[r]})&&sendShopifyAnalytics({eventName:AnalyticsEventName.ADD_TO_CART,payload:{...t,products:It([r])}});}function ce(e,t,r,o){if(e==="cart"){let n=`${r?"merchandise":"merchandise.product"}.${t}`;console.error(`[h2:error:ShopifyAnalytics] Can't set up cart analytics events because the \`cart.lines[].${n}\` value is missing from your GraphQL cart query. In your project, search for where \`fragment CartLine on CartLine\` is defined and make sure \`${n}\` is part of your cart query. Check the Hydrogen Skeleton template for reference: https://github.com/Shopify/hydrogen/blob/main/templates/skeleton/app/lib/fragments.ts#L25-L56.`);}else {let n=`${o||t}`;console.error(`[h2:error:ShopifyAnalytics] Can't set up product view analytics events because the \`${n}\` is missing from your \`<Analytics.ProductView>\`. Make sure \`${n}\` is part of your products data prop. Check the Hydrogen Skeleton template for reference: https://github.com/Shopify/hydrogen/blob/main/templates/skeleton/app/routes/products.%24handle.tsx#L159-L165.`);}}function Nr({type:e,products:t}){return !t||t.length===0?(ce(e,"",false,"data.products"),false):(t.forEach(r=>{if(!r.id)return ce(e,"id",false),false;if(!r.title)return ce(e,"title",false),false;if(!r.price)return ce(e,"price.amount",true,"price"),false;if(!r.vendor)return ce(e,"vendor",false),false;if(!r.variantId)return ce(e,"id",true,"variantId"),false;if(!r.variantTitle)return ce(e,"title",true,"variantTitle"),false}),true)}function It(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 $r(e){console.error(`[h2:error:CartAnalytics] Can't set up cart analytics events because the \`cart.${e}\` value is missing from your GraphQL cart query. In your project, search for where \`fragment CartApiQuery on Cart\` is defined and make sure \`${e}\` is part of your cart query. Check the Hydrogen Skeleton template for reference: https://github.com/Shopify/hydrogen/blob/main/templates/skeleton/app/lib/fragments.ts#L59.`);}function Fr({cart:e,setCarts:t}){let{publish:r,shop:o,customData:n,canTrack:a,cart:s,prevCart:c}=z(),i=useRef(null);return useEffect(()=>{if(e)return Promise.resolve(e).then(u=>{if(u&&u.lines){if(!u.id){$r("id");return}if(!u.updatedAt){$r("updatedAt");return}}t(({cart:p,prevCart:y})=>u?.updatedAt!==p?.updatedAt?{cart:u,prevCart:p}:{cart:p,prevCart:y});}),()=>{}},[t,e]),useEffect(()=>{if(!s||!s?.updatedAt||s?.updatedAt===c?.updatedAt)return;let u;try{u=JSON.parse(localStorage.getItem("cartLastUpdatedAt")||"");}catch{u=null;}if(s.id===u?.id&&s.updatedAt===u?.updatedAt)return;let p={eventTimestamp:Date.now(),cart:s,prevCart:c,shop:o,customData:n};if(s.updatedAt===i.current)return;i.current=s.updatedAt,r("cart_updated",p),localStorage.setItem("cartLastUpdatedAt",JSON.stringify({id:s.id,updatedAt:s.updatedAt}));let y=c?.lines?flattenConnection(c?.lines):[],m=s.lines?flattenConnection(s.lines):[];y?.forEach(g=>{let d=m.filter(l=>g.id===l.id);if(d?.length===1){let l=d[0];g.quantity<l.quantity?r("product_added_to_cart",{...p,prevLine:g,currentLine:l}):g.quantity>l.quantity&&r("product_removed_from_cart",{...p,prevLine:g,currentLine:l});}else r("product_removed_from_cart",{...p,prevLine:g});}),m?.forEach(g=>{let d=y.filter(l=>g.id===l.id);(!d||d.length===0)&&r("product_added_to_cart",{...p,currentLine:g});});},[s,c,r,o,n,a]),null}var bn="https://cdn.shopify.com/shopifycloud/perf-kit/shopify-perf-kit-spa.min.js";function Hr({shop:e}){let t=useRef(false),{subscribe:r,register:o}=z(),{ready:n}=o("Internal_Shopify_Perf_Kit"),a=useLoadScript(bn,{attributes:{id:"perfkit","data-application":"hydrogen","data-shop-id":parseGid(e.shopId).id.toString(),"data-storefront-id":e.hydrogenSubchannelId,"data-monorail-region":"global","data-spa-mode":"true","data-resource-timing-sampling-rate":"100"}});return useEffect(()=>{a!=="done"||t.current||(t.current=true,r(F.PAGE_VIEWED,()=>{window.PerfKit?.navigate();}),r(F.PRODUCT_VIEWED,()=>{window.PerfKit?.setPageType("product");}),r(F.COLLECTION_VIEWED,()=>{window.PerfKit?.setPageType("collection");}),r(F.SEARCH_VIEWED,()=>{window.PerfKit?.setPageType("search");}),r(F.CART_VIEWED,()=>{window.PerfKit?.setPageType("cart");}),n());},[r,n,a]),null}var qr=new Set,Q=e=>{qr.has(e)||(console.warn(e),qr.add(e));},Gr=new Set,Et=e=>{Gr.has(e)||(console.error(new Error(e)),Gr.add(e));};var _n={canTrack:()=>false,cart:null,customData:{},prevCart:null,publish:()=>{},shop:null,subscribe:()=>{},register:()=>({ready:()=>{}}),customerPrivacy:null,privacyBanner:null},Yr=createContext(_n),Je=new Map,xe={};function Jr(){return Object.values(xe).every(Boolean)}function Br(e,t){Je.has(e)||Je.set(e,new Map),Je.get(e)?.set(t.toString(),t);}var ze=new Map;function Qr(e,t){if(!Jr()){ze.set(e,t);return}zr(e,t);}function zr(e,t){(Je.get(e)??new Map).forEach((r,o)=>{try{r(t);}catch(n){typeof n=="object"&&n instanceof Error?console.error("Analytics publish error",n.message,o,n.stack):console.error("Analytics publish error",n,o);}});}function Wr(e){return xe.hasOwnProperty(e)||(xe[e]=false),{ready:()=>{xe[e]=true,Jr()&&ze.size>0&&(ze.forEach((t,r)=>{zr(r,t);}),ze.clear());}}}function jr(){try{return window.Shopify.customerPrivacy.analyticsProcessingAllowed()}catch{}return false}function Kr(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 Ln({canTrack:e,cart:t,children:r,consent:o,customData:n={},shop:a=null,cookieDomain:s}){let{shop:c}=Un(a),[i,u]=useState(!!e),[p,y]=useState(false),[m,g]=useState({cart:null,prevCart:null}),[d,l]=useState(e?()=>e:()=>jr);if(c)if(/\/68817551382$/.test(c.shopId))Q("[h2:error:Analytics.Provider] - Mock shop is used. Analytics will not work properly.");else {if(!o.checkoutDomain){let f=Kr("consent.checkoutDomain","PUBLIC_CHECKOUT_DOMAIN");Et(f);}if(!o.storefrontAccessToken){let f=Kr("consent.storefrontAccessToken","PUBLIC_STOREFRONT_API_TOKEN");Et(f);}o?.country||(o.country="US"),o?.language||(o.language="EN"),o.withPrivacyBanner===void 0&&(o.withPrivacyBanner=false);}let S=useMemo(()=>({canTrack:d,...m,customData:n,publish:d()?Qr:()=>{},shop:c,subscribe:Br,register:Wr,customerPrivacy:oe(),privacyBanner:Ee()}),[i,d,m,m.cart?.updatedAt,m.prevCart,Qr,Br,n,c,Wr,JSON.stringify(xe),oe,Ee]);return jsxs(Yr.Provider,{value:S,children:[r,!!c&&jsx(Pr,{}),!!c&&!!t&&jsx(Fr,{cart:t,setCarts:g}),!!c&&jsx(kr,{consent:o,onReady:()=>{u(true),l(e?()=>e:()=>jr),y(true);},domain:s}),!!c&&p&&jsx(Hr,{shop:c})]})}function z(){let e=useContext(Yr);if(!e)throw new Error("[h2:error:useAnalytics] 'useAnalytics()' must be a descendent of <AnalyticsProvider/>");return e}function Un(e){let[t,r]=useState(null);return useEffect(()=>(Promise.resolve(e).then(r),()=>{}),[r,e]),{shop:t}}async function kn({storefront:e,publicStorefrontId:t="0"}){return e.query(Nn,{cache:e.CacheLong()}).then(({shop:r,localization:o})=>({shopId:r.id,acceptedLanguage:o.language.isoCode,currency:o.country.currency.isoCode,hydrogenSubchannelId:t}))}var Nn=`#graphql
1
+ import {createContext,forwardRef,lazy,useContext,useMemo,useEffect,useRef,useState,createElement,Fragment as Fragment$1,Suspense}from'react';import {createContext as createContext$1,useRevalidator,useFetcher,useFetchers,RouterContextProvider,createRequestHandler,useNavigation,useLocation,useNavigate,Link,useMatches}from'react-router';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {useLoadScript,useShopifyCookies,getTrackingValues,createStorefrontClient,SHOPIFY_STOREFRONT_ID_HEADER,SHOPIFY_STOREFRONT_Y_HEADER,SHOPIFY_STOREFRONT_S_HEADER,SHOPIFY_UNIQUE_TOKEN_HEADER,SHOPIFY_VISIT_TOKEN_HEADER,flattenConnection,RichText,ShopPayButton,parseGid,sendShopifyAnalytics,AnalyticsEventName,AnalyticsPageType,getClientBrowserParameters}from'@shopify/hydrogen-react';export{AnalyticsEventName,AnalyticsPageType,ExternalVideo,IMAGE_FRAGMENT,Image,MediaFile,ModelViewer,Money,ShopifySalesChannel,Video,customerAccountApiCustomScalars,decodeEncodedVariant,flattenConnection,getAdjacentAndFirstAvailableVariants,getClientBrowserParameters,getProductOptions,getShopifyCookies,getTrackingValues,isOptionValueCombinationInEncodedVariant,mapSelectedProductOptionToObject,parseGid,parseMetafield,sendShopifyAnalytics,storefrontApiCustomScalars,useLoadScript,useMoney,useSelectedOptionInUrlParam,useShopifyCookies}from'@shopify/hydrogen-react';import {useLoadScript as useLoadScript$1}from'@shopify/hydrogen-react/load-script';import {createGraphQLClient}from'@shopify/graphql-client';import {parse,stringify}from'worktop/cookie';import Ja from'content-security-policy-builder';function le(e){let{type:t,data:r={},customData:o}=e,n=useLocation(),{publish:a,cart:s,prevCart:i,shop:c,customData:u}=J(),p=n.pathname+n.search,y={...r,customData:{...u,...o},cart:s,prevCart:i,shop:c};return useEffect(()=>{c?.shopId&&(y={...y,url:window.location.href},a(t,y));},[a,p,c?.shopId]),null}function Pr(e){return jsx(le,{...e,type:"page_viewed"})}function Sr(e){return jsx(le,{...e,type:"product_viewed"})}function vr(e){return jsx(le,{...e,type:"collection_viewed"})}function Rr(e){return jsx(le,{...e,type:"cart_viewed"})}function Ir(e){return jsx(le,{...e,type:"search_viewed"})}function Tr(e){return jsx(le,{...e})}var F={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 Re="Custom-Storefront-Request-Group-ID",Ie="X-Shopify-Storefront-Access-Token",Ct="X-SDK-Variant",ht="X-SDK-Variant-Source",At="X-SDK-Version",Ge="X-Shopify-Client-IP",fe="X-Shopify-Client-IP-Sig",Be="_sfapi_proxy",Qe="_server_tracking";function Jo(e){return Object.entries(e).map(([t,r])=>r?`${t};desc=${r}`:void 0).filter(Boolean).join(", ")}function Te(e,t){let r=typeof t=="string"?t:Jo(t);r&&e.headers.append("Server-Timing",r);}var zo=["_y","_s","_cmp"];function Er(e){let t={};if(!e)return t;let r=new RegExp(`\\b(${zo.join("|")});desc="?([^",]+)"?`,"g"),o;for(;(o=r.exec(e))!==null;)t[o[1]]=o[2];return t}function br(e){if(typeof window>"u")return false;try{return !!window.performance.getEntriesByType("navigation")[0]?.serverTiming?.some(r=>r.name===e)}catch{return false}}function wr(){return br(Be)}function Dr(){return br(Qe)}var on="https://cdn.shopify.com/shopifycloud/consent-tracking-api/v0.2/consent-tracking-api.js",nn="https://cdn.shopify.com/shopifycloud/privacy-banner/storefront-banner.js";function St(e){console.error(`[h2:error:useCustomerPrivacy] Unable to setup Customer Privacy API: Missing consent.${e} configuration.`);}function vt(e){let{withPrivacyBanner:t=false,onVisitorConsentCollected:r,onReady:o,checkoutDomain:n,storefrontAccessToken:a,country:s,locale:i,sameDomainForStorefrontApi:c}=e,u=useMemo(()=>c??wr(),[c]),p=useMemo(()=>u&&!Dr(),[u]),y=useShopifyCookies({fetchTrackingValues:p,storefrontAccessToken:a,ignoreDeprecatedCookies:true}),m=useMemo(getTrackingValues,[y]),{revalidate:g}=useRevalidator();useLoadScript$1(t?nn:on,{attributes:{id:"customer-privacy-api"}});let{observing:d,setLoaded:l,apisLoaded:S}=sn({withPrivacyBanner:t}),f=useMemo(()=>{n||St("checkoutDomain"),a||St("storefrontAccessToken"),(a.startsWith("shpat_")||a.length!==32)&&console.error("[h2:error:useCustomerPrivacy] It looks like you passed a private access token, make sure to use the public token");let h=cn(n);return {checkoutRootDomain:u&&typeof window<"u"?window.location.host:n,storefrontRootDomain:h?"."+h:void 0,storefrontAccessToken:a,country:s,locale:i}},[St,n,a,s,i]);useEffect(()=>{let h=P=>{let C=getTrackingValues();if((m.visitToken!==C.visitToken||m.uniqueToken!==C.uniqueToken)&&g().catch(()=>{console.warn("[h2:warn:useCustomerPrivacy] Revalidation failed after consent change.");}),r){let I=oe();if(I?.shouldShowBanner()){let v=I.currentVisitorConsent();if(v&&v.marketing===""&&v.analytics===""&&v.preferences==="")return}r(P.detail);}};return document.addEventListener("visitorConsentCollected",h),()=>{document.removeEventListener("visitorConsentCollected",h);}},[r]),useEffect(()=>{if(!t||d.current.privacyBanner)return;d.current.privacyBanner=true;let h=window.privacyBanner||void 0;Object.defineProperty(window,"privacyBanner",{configurable:true,get(){return h},set(C){typeof C=="object"&&C!==null&&"showPreferences"in C&&"loadBanner"in C&&(h=_r({privacyBanner:C,config:f}),l.privacyBanner());}});},[t,f,_r,l.privacyBanner]),useEffect(()=>{if(d.current.customerPrivacy)return;d.current.customerPrivacy=true;let h=null,P=null,C=window.Shopify||void 0;Object.defineProperty(window,"Shopify",{configurable:true,get(){return C},set(I){typeof I=="object"&&I!==null&&Object.keys(I).length===0&&(C=I,h={backendConsentEnabled:true},Object.defineProperty(window.Shopify,"customerPrivacy",{configurable:true,get(){return P??h},set(v){if(typeof v=="object"&&v!==null&&"setTrackingConsent"in v){let x=v;P={...x,setTrackingConsent:Or({customerPrivacy:x,config:f})},C={...C,customerPrivacy:P},l.customerPrivacy();}}}));}});},[f,Or,l.customerPrivacy]),useEffect(()=>{if(!S||!y)return;let h=oe();if(h&&!h.cachedConsent){let P=getTrackingValues();P.consent&&(h.cachedConsent=P.consent);}if(t){let P=Ee();P&&P.loadBanner(f);}an(),o?.();},[S,y]);let R={customerPrivacy:oe()};return t&&(R.privacyBanner=Ee()),R}var xr=false;function an(){if(xr)return;xr=true;let e=new CustomEvent("shopifyCustomerPrivacyApiLoaded");document.dispatchEvent(e);}function sn({withPrivacyBanner:e}){let t=useRef({customerPrivacy:false,privacyBanner:false}),[r,o]=useState(e?[false,false]:[false]),n=r.every(Boolean);return {observing:t,setLoaded:{customerPrivacy:()=>{o(e?s=>[true,s[1]]:()=>[true]);},privacyBanner:()=>{e&&o(s=>[s[0],true]);}},apisLoaded:n}}function cn(e){if(typeof window>"u")return;let t=window.location.host,r=e.split(".").reverse(),o=t.split(".").reverse(),n=[];return r.forEach((a,s)=>{a===o[s]&&n.push(a);}),n.reverse().join(".")||void 0}function Or({customerPrivacy:e,config:t}){let r=e.setTrackingConsent,{locale:o,country:n,...a}=t;function s(i,c){r({...a,headlessStorefront:true,...i},c);}return s}function _r({privacyBanner:e,config:t}){let r=e.loadBanner,o=e.showPreferences;function n(s){if(typeof s=="object"){r({...t,...s});return}r(t);}function a(s){if(typeof s=="object"){o({...t,...s});return}o(t);}return {loadBanner:n,showPreferences:a}}function oe(){try{let e=window.Shopify?.customerPrivacy;return e&&"setTrackingConsent"in e?e:null}catch{return null}}function Ee(){try{return window&&window?.privacyBanner?window.privacyBanner:null}catch{return null}}var Lr="2026.4.0";function fn(){let e=oe();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 kr({consent:e,onReady:t,domain:r}){let{subscribe:o,register:n,canTrack:a}=J(),[s,i]=useState(false),[c,u]=useState(false),[p,y]=useState(""),m=useRef(false),{checkoutDomain:g,storefrontAccessToken:d,language:l}=e,{ready:S}=n("Internal_Shopify_Analytics");vt({...e,locale:l,checkoutDomain:g||"mock.shop",storefrontAccessToken:d||"abcdefghijklmnopqrstuvwxyz123456",onReady:()=>!e.withPrivacyBanner&&u(true),onVisitorConsentCollected:R=>{try{y(JSON.stringify(R));}catch{}u(true);}});let f=useMemo(()=>c?a():true,[c,a,p]);return useShopifyCookies({hasUserConsent:f,domain:r,checkoutDomain:g,fetchTrackingValues:false,ignoreDeprecatedCookies:!c}),useEffect(()=>{m.current||(m.current=true,o(F.PAGE_VIEWED,gn),o(F.PRODUCT_VIEWED,Cn),o(F.COLLECTION_VIEWED,hn),o(F.SEARCH_VIEWED,An),o(F.PRODUCT_ADD_TO_CART,Pn),i(true));},[o]),useEffect(()=>{s&&c&&(S(),t());},[s,c,t]),null}function Ke(e){console.error(`[h2:error:ShopifyAnalytics] Unable to send Shopify analytics: Missing shop.${e} configuration.`);}function De(e){let t=fn(),r=t.analyticsProcessingAllowed();if(!e?.shop?.shopId){Ke("shopId");return}if(!e?.shop?.acceptedLanguage){Ke("acceptedLanguage");return}if(!e?.shop?.currency){Ke("currency");return}if(!e?.shop?.hydrogenSubchannelId){Ke("hydrogenSubchannelId");return}return {shopifySalesChannel:"hydrogen",assetVersionId:Lr,...e.shop,hasUserConsent:r,...getClientBrowserParameters(),analyticsAllowed:t.analyticsProcessingAllowed(),marketingAllowed:t.marketingAllowed(),saleOfDataAllowed:t.saleOfDataAllowed(),ccpaEnforced:!t.saleOfDataAllowed(),gdprEnforced:!(t.marketingAllowed()&&t.analyticsProcessingAllowed())}}function mn(e,t){if(t===null)return;let r=De(e);return r?{...r,cartId:t.id}:void 0}var ne={};function gn(e){let t=De(e);t&&(sendShopifyAnalytics({eventName:AnalyticsEventName.PAGE_VIEW_2,payload:{...t,...ne}}),ne={});}function Cn(e){let t=De(e);if(t&&Nr({type:"product",products:e.products})){let r=It(e.products);ne={pageType:AnalyticsPageType.product,resourceId:r[0].productGid},t={...t,...ne,products:It(e.products)},sendShopifyAnalytics({eventName:AnalyticsEventName.PRODUCT_VIEW,payload:t});}}function hn(e){let t=De(e);t&&(ne={pageType:AnalyticsPageType.collection,resourceId:e.collection.id},t={...t,...ne,collectionHandle:e.collection.handle,collectionId:e.collection.id},sendShopifyAnalytics({eventName:AnalyticsEventName.COLLECTION_VIEW,payload:t}));}function An(e){let t=De(e);t&&(ne={pageType:AnalyticsPageType.search},t={...t,...ne,searchString:e.searchTerm},sendShopifyAnalytics({eventName:AnalyticsEventName.SEARCH_VIEW,payload:t}));}function Pn(e){let{cart:t,currentLine:r}=e,o=mn(e,t);!o||!r?.id||Sn({matchedLine:r,eventPayload:o});}function Sn({matchedLine:e,eventPayload:t}){let r={id:e.merchandise.product.id,variantId:e.merchandise.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};Nr({type:"cart",products:[r]})&&sendShopifyAnalytics({eventName:AnalyticsEventName.ADD_TO_CART,payload:{...t,products:It([r])}});}function ce(e,t,r,o){if(e==="cart"){let n=`${r?"merchandise":"merchandise.product"}.${t}`;console.error(`[h2:error:ShopifyAnalytics] Can't set up cart analytics events because the \`cart.lines[].${n}\` value is missing from your GraphQL cart query. In your project, search for where \`fragment CartLine on CartLine\` is defined and make sure \`${n}\` is part of your cart query. Check the Hydrogen Skeleton template for reference: https://github.com/Shopify/hydrogen/blob/main/templates/skeleton/app/lib/fragments.ts#L25-L56.`);}else {let n=`${o||t}`;console.error(`[h2:error:ShopifyAnalytics] Can't set up product view analytics events because the \`${n}\` is missing from your \`<Analytics.ProductView>\`. Make sure \`${n}\` is part of your products data prop. Check the Hydrogen Skeleton template for reference: https://github.com/Shopify/hydrogen/blob/main/templates/skeleton/app/routes/products.%24handle.tsx#L159-L165.`);}}function Nr({type:e,products:t}){return !t||t.length===0?(ce(e,"",false,"data.products"),false):(t.forEach(r=>{if(!r.id)return ce(e,"id",false),false;if(!r.title)return ce(e,"title",false),false;if(!r.price)return ce(e,"price.amount",true,"price"),false;if(!r.vendor)return ce(e,"vendor",false),false;if(!r.variantId)return ce(e,"id",true,"variantId"),false;if(!r.variantTitle)return ce(e,"title",true,"variantTitle"),false}),true)}function It(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 $r(e){console.error(`[h2:error:CartAnalytics] Can't set up cart analytics events because the \`cart.${e}\` value is missing from your GraphQL cart query. In your project, search for where \`fragment CartApiQuery on Cart\` is defined and make sure \`${e}\` is part of your cart query. Check the Hydrogen Skeleton template for reference: https://github.com/Shopify/hydrogen/blob/main/templates/skeleton/app/lib/fragments.ts#L59.`);}function Fr({cart:e,setCarts:t}){let{publish:r,shop:o,customData:n,canTrack:a,cart:s,prevCart:i}=J(),c=useRef(null);return useEffect(()=>{if(e)return Promise.resolve(e).then(u=>{if(u&&u.lines){if(!u.id){$r("id");return}if(!u.updatedAt){$r("updatedAt");return}}t(({cart:p,prevCart:y})=>u?.updatedAt!==p?.updatedAt?{cart:u,prevCart:p}:{cart:p,prevCart:y});}),()=>{}},[t,e]),useEffect(()=>{if(!s||!s?.updatedAt||s?.updatedAt===i?.updatedAt)return;let u;try{u=JSON.parse(localStorage.getItem("cartLastUpdatedAt")||"");}catch{u=null;}if(s.id===u?.id&&s.updatedAt===u?.updatedAt)return;let p={eventTimestamp:Date.now(),cart:s,prevCart:i,shop:o,customData:n};if(s.updatedAt===c.current)return;c.current=s.updatedAt,r("cart_updated",p),localStorage.setItem("cartLastUpdatedAt",JSON.stringify({id:s.id,updatedAt:s.updatedAt}));let y=i?.lines?flattenConnection(i?.lines):[],m=s.lines?flattenConnection(s.lines):[];y?.forEach(g=>{let d=m.filter(l=>g.id===l.id);if(d?.length===1){let l=d[0];g.quantity<l.quantity?r("product_added_to_cart",{...p,prevLine:g,currentLine:l}):g.quantity>l.quantity&&r("product_removed_from_cart",{...p,prevLine:g,currentLine:l});}else r("product_removed_from_cart",{...p,prevLine:g});}),m?.forEach(g=>{let d=y.filter(l=>g.id===l.id);(!d||d.length===0)&&r("product_added_to_cart",{...p,currentLine:g});});},[s,i,r,o,n,a]),null}var bn="https://cdn.shopify.com/shopifycloud/perf-kit/shopify-perf-kit-spa.min.js";function Hr({shop:e}){let t=useRef(false),{subscribe:r,register:o}=J(),{ready:n}=o("Internal_Shopify_Perf_Kit"),a=useLoadScript(bn,{attributes:{id:"perfkit","data-application":"hydrogen","data-shop-id":parseGid(e.shopId).id.toString(),"data-storefront-id":e.hydrogenSubchannelId,"data-monorail-region":"global","data-spa-mode":"true","data-resource-timing-sampling-rate":"100"}});return useEffect(()=>{a!=="done"||t.current||(t.current=true,r(F.PAGE_VIEWED,()=>{window.PerfKit?.navigate();}),r(F.PRODUCT_VIEWED,()=>{window.PerfKit?.setPageType("product");}),r(F.COLLECTION_VIEWED,()=>{window.PerfKit?.setPageType("collection");}),r(F.SEARCH_VIEWED,()=>{window.PerfKit?.setPageType("search");}),r(F.CART_VIEWED,()=>{window.PerfKit?.setPageType("cart");}),n());},[r,n,a]),null}var qr=new Set,z=e=>{qr.has(e)||(console.warn(e),qr.add(e));},Gr=new Set,Et=e=>{Gr.has(e)||(console.error(new Error(e)),Gr.add(e));};var _n={canTrack:()=>false,cart:null,customData:{},prevCart:null,publish:()=>{},shop:null,subscribe:()=>{},register:()=>({ready:()=>{}}),customerPrivacy:null,privacyBanner:null},Yr=createContext(_n),Je=new Map,Oe={};function Jr(){return Object.values(Oe).every(Boolean)}function Br(e,t){Je.has(e)||Je.set(e,new Map),Je.get(e)?.set(t.toString(),t);}var ze=new Map;function Qr(e,t){if(!Jr()){ze.set(e,t);return}zr(e,t);}function zr(e,t){(Je.get(e)??new Map).forEach((r,o)=>{try{r(t);}catch(n){typeof n=="object"&&n instanceof Error?console.error("Analytics publish error",n.message,o,n.stack):console.error("Analytics publish error",n,o);}});}function Wr(e){return Oe.hasOwnProperty(e)||(Oe[e]=false),{ready:()=>{Oe[e]=true,Jr()&&ze.size>0&&(ze.forEach((t,r)=>{zr(r,t);}),ze.clear());}}}function jr(){try{return window.Shopify.customerPrivacy?.analyticsProcessingAllowed?.()??!1}catch{}return false}function Kr(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 Ln({canTrack:e,cart:t,children:r,consent:o,customData:n={},shop:a=null,cookieDomain:s}){let{shop:i}=Un(a),[c,u]=useState(!!e),[p,y]=useState(false),[m,g]=useState({cart:null,prevCart:null}),[d,l]=useState(e?()=>e:()=>jr);if(i)if(/\/68817551382$/.test(i.shopId))z("[h2:error:Analytics.Provider] - Mock shop is used. Analytics will not work properly.");else {if(!o.checkoutDomain){let f=Kr("consent.checkoutDomain","PUBLIC_CHECKOUT_DOMAIN");Et(f);}if(!o.storefrontAccessToken){let f=Kr("consent.storefrontAccessToken","PUBLIC_STOREFRONT_API_TOKEN");Et(f);}o?.country||(o.country="US"),o?.language||(o.language="EN"),o.withPrivacyBanner===void 0&&(o.withPrivacyBanner=false);}let S=useMemo(()=>({canTrack:d,...m,customData:n,publish:d()?Qr:()=>{},shop:i,subscribe:Br,register:Wr,customerPrivacy:oe(),privacyBanner:Ee()}),[c,d,m,m.cart?.updatedAt,m.prevCart,Qr,Br,n,i,Wr,JSON.stringify(Oe),oe,Ee]);return jsxs(Yr.Provider,{value:S,children:[r,!!i&&jsx(Pr,{}),!!i&&!!t&&jsx(Fr,{cart:t,setCarts:g}),!!i&&jsx(kr,{consent:o,onReady:()=>{u(true),l(e?()=>e:()=>jr),y(true);},domain:s}),!!i&&p&&jsx(Hr,{shop:i})]})}function J(){let e=useContext(Yr);if(!e)throw new Error("[h2:error:useAnalytics] 'useAnalytics()' must be a descendent of <AnalyticsProvider/>");return e}function Un(e){let[t,r]=useState(null);return useEffect(()=>(Promise.resolve(e).then(r),()=>{}),[r,e]),{shop:t}}async function kn({storefront:e,publicStorefrontId:t="0"}){return e.query(Nn,{cache:e.CacheLong()}).then(({shop:r,localization:o})=>({shopId:r.id,acceptedLanguage:o.language.isoCode,currency:o.country.currency.isoCode,hydrogenSubchannelId:t}))}var Nn=`#graphql
2
2
  query ShopData(
3
3
  $country: CountryCode
4
4
  $language: LanguageCode
@@ -17,15 +17,15 @@ import {createContext,forwardRef,lazy,useContext,useMemo,useEffect,useRef,useSta
17
17
  }
18
18
  }
19
19
  }
20
- `,Mn={CartView:Rr,CollectionView:vr,CustomView:Tr,ProductView:Sr,Provider:Ln,SearchView:Ir};function j(e,t){return bt(e.headers,t)}function bt(e,t){let r=e?.get?.(t)??e?.[t];return typeof r=="string"?r:null}function ae(e){return {requestId:e?j(e,"request-id"):void 0,purpose:e?j(e,"purpose"):void 0}}function Xr(e){return {requestGroupId:j(e,"request-id"),buyerIp:j(e,"oxygen-buyer-ip"),buyerIpSig:j(e,fe),cookie:j(e,"cookie"),purpose:j(e,"sec-purpose")||j(e,"purpose")}}var wt=/^\/api\/(unstable|2\d{3}-\d{2})\/graphql\.json$/,Zr=/^\/api\/mcp$/,Xe=e=>{try{return new URL(e,"http://e.c").pathname}catch{return "/"}};function _e(e,t){return t.reduce((r,o)=>{let n=e(o);return n&&r.push([o,n]),r},[])}function me(e,t={}){let r=new Error,o=(n,a="Error")=>{let s=(r.stack??"").split(`
20
+ `,Mn={CartView:Rr,CollectionView:vr,CustomView:Tr,ProductView:Sr,Provider:Ln,SearchView:Ir};function W(e,t){return bt(e.headers,t)}function bt(e,t){let r=e?.get?.(t)??e?.[t];return typeof r=="string"?r:null}function ae(e){return {requestId:e?W(e,"request-id"):void 0,purpose:e?W(e,"purpose"):void 0}}function Xr(e){return {requestGroupId:W(e,"request-id"),buyerIp:W(e,"oxygen-buyer-ip"),buyerIpSig:W(e,fe),cookie:W(e,"cookie"),purpose:W(e,"sec-purpose")||W(e,"purpose")}}var wt=/^\/api\/(unstable|2\d{3}-\d{2})\/graphql\.json$/,Zr=/^\/api\/mcp$/,Xe=e=>{try{return new URL(e,"http://e.c").pathname}catch{return "/"}};function _e(e,t){return t.reduce((r,o)=>{let n=e(o);return n&&r.push([o,n]),r},[])}function me(e,t={}){let r=new Error,o=(n,a="Error")=>{let s=(r.stack??"").split(`
21
21
  `).slice(3+(t.stackOffset??0)).join(`
22
- `).replace(/ at loader(\d+) \(/,(c,i)=>c.replace(i,""));return `${a}: ${n}
23
- `+s};return e.then(n=>{if(n?.errors&&Array.isArray(n.errors)){let a=typeof t.logErrors=="function"?t.logErrors:()=>t.logErrors??false;n.errors.forEach(s=>{s&&(s.stack=o(s.message,s.name),a(s)&&console.error(s));});}return n}).catch(n=>{throw n&&(n.stack=o(n.message,n.name)),n})}var K=void 0;var Ze="public",$n="private",Dt="no-store",eo={maxAge:"max-age",staleWhileRevalidate:"stale-while-revalidate",sMaxAge:"s-maxage",staleIfError:"stale-if-error"};function Le(e){let t=[];return Object.keys(e).forEach(r=>{r==="mode"?t.push(e[r]):eo[r]&&t.push(`${eo[r]}=${e[r]}`);}),t.join(", ")}function Ot(){return {mode:Dt}}function xt(e){if(e?.mode&&e?.mode!==Ze&&e?.mode!==$n)throw Error("'mode' must be either 'public' or 'private'")}function ue(e){return xt(e),{mode:Ze,maxAge:1,staleWhileRevalidate:9,...e}}function _t(e){return xt(e),{mode:Ze,maxAge:3600,staleWhileRevalidate:82800,...e}}function ge(e){return xt(e),{mode:Ze,maxAge:1,staleWhileRevalidate:86399,...e}}function Lt(e){return e}function X(e){return String(e).includes("__proto__")?JSON.parse(e,Fn):JSON.parse(e)}function Fn(e,t){if(e!=="__proto__")return t}function et(e,t){return e&&t?{...e,...t}:e||ge()}function Ut(e){return Le(et(e))}async function Hn(e,t){if(!e)return;let r=await e.match(t);if(!r){return}return r}async function qn(e,t,r,o){if(!e)return;let n=et(o),a=Ut(et(n,{maxAge:(n.maxAge||0)+(n.staleWhileRevalidate||0)})),s=Ut(et(n));r.headers.set("cache-control",a),r.headers.set("real-cache-control",s),r.headers.set("cache-put-date",String(Date.now())),await e.put(t,r);}async function Gn(e,t){e&&await e.delete(t);}function Bn(e,t){let r=e.headers.get("real-cache-control"),o=0;if(r){let a=r.match(/max-age=(\d*)/);a&&a.length>1&&(o=parseFloat(a[1]));}return [(Date.now()-Number(t))/1e3,o]}function Qn(e,t){let r=t.headers.get("cache-put-date");if(!r)return false;let[o,n]=Bn(t,r),a=o>n;return a}var tt={get:Hn,set:qn,delete:Gn,generateDefaultCacheControlHeader:Ut,isStale:Qn};function Ue(e){return `https://shopify.dev/?${e}`}function Wn(e){return e||ge()}async function to(e,t){if(!e)return;let r=Ue(t),o=new Request(r),n=await tt.get(e,o);if(!n)return;let a=await n.text();try{return [X(a),n]}catch{return [a,n]}}async function ro(e,t,r,o){if(!e)return;let n=Ue(t),a=new Request(n),s=new Response(JSON.stringify(r));await tt.set(e,a,s,Wn(o));}function oo(e,t){return tt.isStale(new Request(Ue(e)),t)}function no(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 kt=new Set;async function rt(e,t,{strategy:r=ue(),cacheInstance:o,shouldCacheResult:n=()=>true,waitUntil:a,debugInfo:s}){let i=no([...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()||[])}});},g=void 0;if(!o||!r||r.mode===Dt){let f=await t({addDebugData:y});return f}let d=f=>ro(o,i,{value:f,debugInfo:void 0},r),l=await to(o,i);if(l&&typeof l[0]!="string"){let[{value:f,debugInfo:v},h]=l;let P=oo(i,h)?"STALE":"HIT";if(!kt.has(i)&&P==="STALE"){kt.add(i);let C=Promise.resolve().then(async()=>{let R=Date.now();try{let I=await t({addDebugData:y});n(I)&&(await d(I),g?.({result:I,cacheStatus:"PUT",overrideStartTime:R}));}catch(I){I.message&&(I.message="SWR in sub-request failed: "+I.message),console.error(I);}finally{kt.delete(i);}});a?.(C);}return f}let S=await t({addDebugData:y});if(n(S)){let f=Promise.resolve().then(async()=>{await d(S);});a?.(f);}return S}var Kn=["set-cookie","server-timing"];function ao(e,t){return [e,{status:t.status,statusText:t.statusText,headers:[...t.headers].filter(([r])=>!Kn.includes(r.toLowerCase()))}]}function so([e,t]){return [e,new Response(e,t)]}async function ot(e,t,{cacheInstance:r,cache:o,cacheKey:n=[e,t],shouldCacheResponse:a,waitUntil:s,debugInfo:c,streamConfig:i,onRawHeaders:u}){return !o&&(!t.method||t.method==="GET")&&(o=ue()),rt(n,async()=>{if(i){let m=null,d=await createGraphQLClient({url:e,customFetchApi:async(f,v)=>(m=await fetch(f,v),u?.(m.headers),m),headers:t.headers}).requestStream(i.query,{variables:i.variables}),l,S;for await(let f of d){let{data:v,errors:h}=f;l=v,S=h?.graphQLErrors??h;}return m?.ok?ao({data:l,errors:S},m):m}let p=await fetch(e,t);if(u?.(p.headers),!p.ok)return p;let y=await p.text().catch(()=>"");try{y&&(y=X(y));}catch{}return ao(y,p)},{cacheInstance:r,waitUntil:s,strategy:o??null,debugInfo:c,shouldCacheResult:p=>"ok"in p?!1:a(...so(p))}).then(p=>"ok"in p?[null,p]:so(p))}function Yn(e){let{cache:t,waitUntil:r,request:o}=e;return {run:({cacheKey:n,cacheStrategy:a,shouldCacheResult:s},c)=>rt(n,c,{shouldCacheResult:s,strategy:a,cacheInstance:t,waitUntil:r,debugInfo:{...ae(o),stackInfo:K?.()}}),fetch:(n,a,s)=>ot(n,a??{},{waitUntil:r,cacheKey:[n,a],cacheInstance:t,debugInfo:{url:n,...ae(o),stackInfo:K?.(),displayName:s?.displayName},cache:s.cacheStrategy,...s}).then(([c,i])=>({data:c,response:i}))}}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:o,timestamp:n,...a}=r,s=new Headers(a.headers),c=s.get("cache-control")||s.get("real-cache-control")||"",i=parseInt(c.match(/max-age=(\d+)/)?.[1]||"0",10),u=parseInt(c.match(/stale-while-revalidate=(\d+)/)?.[1]||"0",10),p=(Date.now()-n)/1e3;if(p>i+u){this.#e.delete(t.url);return}let m=p>i;return s.set("cache",m?"STALE":"HIT"),s.set("date",new Date(n).toUTCString()),new Response(o,{status:a.status??200,headers:s})}async delete(t){return this.#e.has(t.url)?(this.#e.delete(t.url),true):false}keys(t){let r=[];for(let o of this.#e.keys())(!t||t.url===o)&&r.push(new Request(o));return Promise.resolve(r)}};var io="cartFormInput";function Z({children:e,action:t,inputs:r,route:o,fetcherKey:n}){let a=useFetcher({key:n});return jsxs(a.Form,{action:o||"",method:"post",children:[(t||r)&&jsx("input",{type:"hidden",name:io,value:JSON.stringify({action:t,inputs:r})}),typeof e=="function"?e(a):e]})}Z.INPUT_NAME=io;Z.ACTIONS={AttributesUpdateInput:"AttributesUpdateInput",BuyerIdentityUpdate:"BuyerIdentityUpdate",Create:"Create",DiscountCodesUpdate:"DiscountCodesUpdate",GiftCardCodesUpdate:"GiftCardCodesUpdate",GiftCardCodesAdd:"GiftCardCodesAdd",GiftCardCodesRemove:"GiftCardCodesRemove",LinesAdd:"LinesAdd",LinesRemove:"LinesRemove",LinesUpdate:"LinesUpdate",NoteUpdate:"NoteUpdate",SelectedDeliveryOptionsUpdate:"SelectedDeliveryOptionsUpdate",MetafieldsSet:"MetafieldsSet",MetafieldDelete:"MetafieldDelete",DeliveryAddressesAdd:"DeliveryAddressesAdd",DeliveryAddressesUpdate:"DeliveryAddressesUpdate",DeliveryAddressesRemove:"DeliveryAddressesRemove",DeliveryAddressesReplace:"DeliveryAddressesReplace"};function zn(e){let t={};for(let s of e.entries()){let c=s[0],i=e.getAll(c);t[c]=i.length>1?i:s[1],t[c]==="on"?t[c]=true:t[c]==="off"&&(t[c]=false);}let{cartFormInput:r,...o}=t,{action:n,inputs:a}=r?JSON.parse(String(r)):{};return {action:n,inputs:{...a,...o}}}Z.getFormInput=zn;var Mt=e=>{let t=parse(bt(e,"Cookie")||"");return ()=>t.cart?`gid://shopify/Cart/${t.cart}`:void 0};var Vt=e=>t=>{let r=new Headers;return r.append("Set-Cookie",stringify("cart",t.split("/").pop()||"",{path:"/",...e})),r};function nt(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():`weak-${Math.random().toString(16).substring(2)}`}var ke="2026.1.4";function Ce(e){return e.replace(/\s*#.*$/gm,"").replace(/\s+/gm," ").trim()}var ra=/(^|}\s)query[\s({]/im,oa=/(^|}\s)mutation[\s({]/im;function at(e,t){if(!ra.test(e))throw new Error(`[h2:error:${t}] Can only execute queries`)}function st(e,t){if(!oa.test(e))throw new Error(`[h2:error:${t}] Can only execute mutations`)}var de=class extends Error{locations;path;extensions;constructor(t,r={}){let n=(r.clientOperation?`[h2:error:${r.clientOperation}] `:"")+t+(r.requestId?` - Request ID: ${r.requestId}`:"");super(n),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+=`
22
+ `).replace(/ at loader(\d+) \(/,(i,c)=>i.replace(c,""));return `${a}: ${n}
23
+ `+s};return e.then(n=>{if(n?.errors&&Array.isArray(n.errors)){let a=typeof t.logErrors=="function"?t.logErrors:()=>t.logErrors??false;n.errors.forEach(s=>{s&&(s.stack=o(s.message,s.name),a(s)&&console.error(s));});}return n}).catch(n=>{throw n&&(n.stack=o(n.message,n.name)),n})}var j=void 0;var Ze="public",$n="private",Dt="no-store",eo={maxAge:"max-age",staleWhileRevalidate:"stale-while-revalidate",sMaxAge:"s-maxage",staleIfError:"stale-if-error"};function Le(e){let t=[];return Object.keys(e).forEach(r=>{r==="mode"?t.push(e[r]):eo[r]&&t.push(`${eo[r]}=${e[r]}`);}),t.join(", ")}function xt(){return {mode:Dt}}function Ot(e){if(e?.mode&&e?.mode!==Ze&&e?.mode!==$n)throw Error("'mode' must be either 'public' or 'private'")}function ue(e){return Ot(e),{mode:Ze,maxAge:1,staleWhileRevalidate:9,...e}}function _t(e){return Ot(e),{mode:Ze,maxAge:3600,staleWhileRevalidate:82800,...e}}function ge(e){return Ot(e),{mode:Ze,maxAge:1,staleWhileRevalidate:86399,...e}}function Lt(e){return e}function X(e){return String(e).includes("__proto__")?JSON.parse(e,Fn):JSON.parse(e)}function Fn(e,t){if(e!=="__proto__")return t}function et(e,t){return e&&t?{...e,...t}:e||ge()}function Ut(e){return Le(et(e))}async function Hn(e,t){if(!e)return;let r=await e.match(t);if(!r){return}return r}async function qn(e,t,r,o){if(!e)return;let n=et(o),a=Ut(et(n,{maxAge:(n.maxAge||0)+(n.staleWhileRevalidate||0)})),s=Ut(et(n));r.headers.set("cache-control",a),r.headers.set("real-cache-control",s),r.headers.set("cache-put-date",String(Date.now())),await e.put(t,r);}async function Gn(e,t){e&&await e.delete(t);}function Bn(e,t){let r=e.headers.get("real-cache-control"),o=0;if(r){let a=r.match(/max-age=(\d*)/);a&&a.length>1&&(o=parseFloat(a[1]));}return [(Date.now()-Number(t))/1e3,o]}function Qn(e,t){let r=t.headers.get("cache-put-date");if(!r)return false;let[o,n]=Bn(t,r),a=o>n;return a}var tt={get:Hn,set:qn,delete:Gn,generateDefaultCacheControlHeader:Ut,isStale:Qn};function Ue(e){return `https://shopify.dev/?${e}`}function Wn(e){return e||ge()}async function to(e,t){if(!e)return;let r=Ue(t),o=new Request(r),n=await tt.get(e,o);if(!n)return;let a=await n.text();try{return [X(a),n]}catch{return [a,n]}}async function ro(e,t,r,o){if(!e)return;let n=Ue(t),a=new Request(n),s=new Response(JSON.stringify(r));await tt.set(e,a,s,Wn(o));}function oo(e,t){return tt.isStale(new Request(Ue(e)),t)}function no(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 kt=new Set;async function rt(e,t,{strategy:r=ue(),cacheInstance:o,shouldCacheResult:n=()=>true,waitUntil:a,debugInfo:s}){let c=no([...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()||[])}});},g=void 0;if(!o||!r||r.mode===Dt){let f=await t({addDebugData:y});return f}let d=f=>ro(o,c,{value:f,debugInfo:void 0},r),l=await to(o,c);if(l&&typeof l[0]!="string"){let[{value:f,debugInfo:R},h]=l;let P=oo(c,h)?"STALE":"HIT";if(!kt.has(c)&&P==="STALE"){kt.add(c);let C=Promise.resolve().then(async()=>{let I=Date.now();try{let v=await t({addDebugData:y});n(v)&&(await d(v),g?.({result:v,cacheStatus:"PUT",overrideStartTime:I}));}catch(v){v.message&&(v.message="SWR in sub-request failed: "+v.message),console.error(v);}finally{kt.delete(c);}});a?.(C);}return f}let S=await t({addDebugData:y});if(n(S)){let f=Promise.resolve().then(async()=>{await d(S);});a?.(f);}return S}var Kn=["set-cookie","server-timing"];function ao(e,t){return [e,{status:t.status,statusText:t.statusText,headers:[...t.headers].filter(([r])=>!Kn.includes(r.toLowerCase()))}]}function so([e,t]){return [e,new Response(e,t)]}async function ot(e,t,{cacheInstance:r,cache:o,cacheKey:n=[e,t],shouldCacheResponse:a,waitUntil:s,debugInfo:i,streamConfig:c,onRawHeaders:u}){return !o&&(!t.method||t.method==="GET")&&(o=ue()),rt(n,async()=>{if(c){let m=null,d=await createGraphQLClient({url:e,customFetchApi:async(f,R)=>(m=await fetch(f,R),u?.(m.headers),m),headers:t.headers}).requestStream(c.query,{variables:c.variables}),l,S;for await(let f of d){let{data:R,errors:h}=f;l=R,S=h?.graphQLErrors??h;}return m?.ok?ao({data:l,errors:S},m):m}let p=await fetch(e,t);if(u?.(p.headers),!p.ok)return p;let y=await p.text().catch(()=>"");try{y&&(y=X(y));}catch{}return ao(y,p)},{cacheInstance:r,waitUntil:s,strategy:o??null,debugInfo:i,shouldCacheResult:p=>"ok"in p?!1:a(...so(p))}).then(p=>"ok"in p?[null,p]:so(p))}function Yn(e){let{cache:t,waitUntil:r,request:o}=e;return {run:({cacheKey:n,cacheStrategy:a,shouldCacheResult:s},i)=>rt(n,i,{shouldCacheResult:s,strategy:a,cacheInstance:t,waitUntil:r,debugInfo:{...ae(o),stackInfo:j?.()}}),fetch:(n,a,s)=>ot(n,a??{},{waitUntil:r,cacheKey:[n,a],cacheInstance:t,debugInfo:{url:n,...ae(o),stackInfo:j?.(),displayName:s?.displayName},cache:s.cacheStrategy,...s}).then(([i,c])=>({data:i,response:c}))}}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:o,timestamp:n,...a}=r,s=new Headers(a.headers),i=s.get("cache-control")||s.get("real-cache-control")||"",c=parseInt(i.match(/max-age=(\d+)/)?.[1]||"0",10),u=parseInt(i.match(/stale-while-revalidate=(\d+)/)?.[1]||"0",10),p=(Date.now()-n)/1e3;if(p>c+u){this.#e.delete(t.url);return}let m=p>c;return s.set("cache",m?"STALE":"HIT"),s.set("date",new Date(n).toUTCString()),new Response(o,{status:a.status??200,headers:s})}async delete(t){return this.#e.has(t.url)?(this.#e.delete(t.url),true):false}keys(t){let r=[];for(let o of this.#e.keys())(!t||t.url===o)&&r.push(new Request(o));return Promise.resolve(r)}};var io="cartFormInput";function Z({children:e,action:t,inputs:r,route:o,fetcherKey:n}){let a=useFetcher({key:n});return jsxs(a.Form,{action:o||"",method:"post",children:[(t||r)&&jsx("input",{type:"hidden",name:io,value:JSON.stringify({action:t,inputs:r})}),typeof e=="function"?e(a):e]})}Z.INPUT_NAME=io;Z.ACTIONS={AttributesUpdateInput:"AttributesUpdateInput",BuyerIdentityUpdate:"BuyerIdentityUpdate",Create:"Create",DiscountCodesUpdate:"DiscountCodesUpdate",GiftCardCodesUpdate:"GiftCardCodesUpdate",GiftCardCodesAdd:"GiftCardCodesAdd",GiftCardCodesRemove:"GiftCardCodesRemove",LinesAdd:"LinesAdd",LinesRemove:"LinesRemove",LinesUpdate:"LinesUpdate",NoteUpdate:"NoteUpdate",SelectedDeliveryOptionsUpdate:"SelectedDeliveryOptionsUpdate",MetafieldsSet:"MetafieldsSet",MetafieldDelete:"MetafieldDelete",DeliveryAddressesAdd:"DeliveryAddressesAdd",DeliveryAddressesUpdate:"DeliveryAddressesUpdate",DeliveryAddressesRemove:"DeliveryAddressesRemove",DeliveryAddressesReplace:"DeliveryAddressesReplace"};function zn(e){let t={};for(let s of e.entries()){let i=s[0],c=e.getAll(i);t[i]=c.length>1?c:s[1],t[i]==="on"?t[i]=true:t[i]==="off"&&(t[i]=false);}let{cartFormInput:r,...o}=t,{action:n,inputs:a}=r?JSON.parse(String(r)):{};return {action:n,inputs:{...a,...o}}}Z.getFormInput=zn;var Mt=e=>{let t=parse(bt(e,"Cookie")||"");return ()=>t.cart?`gid://shopify/Cart/${t.cart}`:void 0};var Vt=e=>t=>{let r=new Headers;return r.append("Set-Cookie",stringify("cart",t.split("/").pop()||"",{path:"/",...e})),r};function nt(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():`weak-${Math.random().toString(16).substring(2)}`}var ke="2026.4.0";function Ce(e){return e.replace(/\s*#.*$/gm,"").replace(/\s+/gm," ").trim()}var ra=/(^|}\s)query[\s({]/im,oa=/(^|}\s)mutation[\s({]/im;function at(e,t){if(!ra.test(e))throw new Error(`[h2:error:${t}] Can only execute queries`)}function st(e,t){if(!oa.test(e))throw new Error(`[h2:error:${t}] Can only execute mutations`)}var de=class extends Error{locations;path;extensions;constructor(t,r={}){let n=(r.clientOperation?`[h2:error:${r.clientOperation}] `:"")+t+(r.requestId?` - Request ID: ${r.requestId}`:"");super(n),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+=`
24
24
  `,this.stack&&(t+=`${this.stack.slice(this.stack.indexOf(`
25
25
  `)+1)}
26
- `),t}toJSON(){return {name:"Error",message:""}}};function Ne({url:e,response:t,errors:r,type:o,query:n,queryVariables:a,ErrorConstructor:s=Error,client:c="storefront"}){let i=(typeof r=="string"?r:r?.map?.(p=>p.message).join(`
26
+ `),t}toJSON(){return {name:"Error",message:""}}};function Ne({url:e,response:t,errors:r,type:o,query:n,queryVariables:a,ErrorConstructor:s=Error,client:i="storefront"}){let c=(typeof r=="string"?r:r?.map?.(p=>p.message).join(`
27
27
  `))||`URL: ${e}
28
- API response error: ${t.status}`,u=new de(i,{query:n,queryVariables:a,cause:{errors:r},clientOperation:`${c}.${o}`,requestId:t.headers.get("x-request-id")});throw new s(u.message,{cause:u.cause})}var ia={language:"EN",country:"US"};function lo(e){let {storefrontHeaders:t,cache:r,waitUntil:o,i18n:n,storefrontId:a,logErrors:s=true,...c}=e,{getPublicTokenHeaders:u,getPrivateTokenHeaders:p,getStorefrontApiUrl:y,getShopifyDomain:m}=createStorefrontClient(c),d=(c.privateStorefrontToken?p:u)({contentType:"json",buyerIp:t?.buyerIp||""});t?.buyerIp&&(d[Ge]=t.buyerIp),t?.buyerIpSig&&(d[fe]=t.buyerIpSig),d[Re]=t?.requestGroupId||nt(),a&&(d[SHOPIFY_STOREFRONT_ID_HEADER]=a),(d["user-agent"]=`Hydrogen ${ke}`);let l=t?.cookie??"";l&&(d.cookie=l);let S,f;if(!/\b_shopify_(analytics|marketing)=/.test(l)){let C=l.match(/\b_shopify_y=([^;]+)/)?.[1],R=l.match(/\b_shopify_s=([^;]+)/)?.[1];C&&(d[SHOPIFY_STOREFRONT_Y_HEADER]=C),R&&(d[SHOPIFY_STOREFRONT_S_HEADER]=R),S=C??nt(),f=R??nt(),d[SHOPIFY_UNIQUE_TOKEN_HEADER]=S,d[SHOPIFY_VISIT_TOKEN_HEADER]=f;}let v,h=JSON.stringify({"content-type":d["content-type"],"user-agent":d["user-agent"],[Ct]:d[Ct],[ht]:d[ht],[At]:d[At],[Ie]:d[Ie]});async function P({query:C,mutation:R,variables:I,cache:O,headers:L=[],storefrontApiVersion:G,displayName:ft,stackInfo:mt}){let qe=L instanceof Headers?Object.fromEntries(L.entries()):Array.isArray(L)?Object.fromEntries(L):L,W=C??R,A={...I};n&&(!I?.country&&/\$country/.test(W)&&(A.country=n.country),!I?.language&&/\$language/.test(W)&&(A.language=n.language));let E=y({storefrontApiVersion:G}),_=JSON.stringify({query:W,variables:A}),x={method:"POST",headers:{...d,...qe},body:_},q=[E,x.method,h,x.body],re=W.includes("@defer")?{query:W,variables:A}:void 0,[V,B]=await ot(E,x,{cacheInstance:R?void 0:r,cache:O||ge(),cacheKey:q,waitUntil:o,shouldCacheResponse:k=>!k?.errors,debugInfo:{requestId:x.headers[Re],displayName:ft,url:E,stackInfo:mt,graphql:_,purpose:t?.purpose},streamConfig:re,onRawHeaders:k=>{v??={setCookie:k.getSetCookie(),serverTiming:k.get("server-timing")??""};}}),Y={url:E,response:B,type:R?"mutation":"query",query:W,queryVariables:A,errors:void 0};if(!B.ok){let k,J=V;try{J??=await B.text(),k=X(J);}catch{k=[{message:J??"Could not parse Storefront API response"}];}Ne({...Y,errors:k});}let{data:U,errors:$}=V;$=$?Array.isArray($)?$:[$]:void 0;let ve=$?.map(({message:k,...J})=>new de(k,{...J,clientOperation:`storefront.${Y.type}`,requestId:B.headers.get("x-request-id"),queryVariables:A,query:W}));return T(U,ve)}return {storefront:{query(C,R){C=Ce(C),at(C,"storefront.query");let I=po?.(C);return me(P({...R,query:C,stackInfo:K?.(I)}),{stackOffset:I,logErrors:s})},mutate(C,R){C=Ce(C),st(C,"storefront.mutate");let I=po?.(C);return me(P({...R,mutation:C,stackInfo:K?.(I)}),{stackOffset:I,logErrors:s})},cache:r,CacheNone:Ot,CacheLong:_t,CacheShort:ue,CacheCustom:Lt,generateCacheControlHeader:Le,getPublicTokenHeaders:u,getPrivateTokenHeaders:p,getHeaders:()=>({...d}),getShopifyDomain:m,getApiUrl:y,i18n:n??ia,isStorefrontApiUrl(C){return wt.test(Xe(C.url??""))},async forward(C,R){let I=new Headers([..._e(G=>C.headers.get(G),["accept","accept-encoding","accept-language","access-control-request-headers","access-control-request-method","content-type","content-length","cookie","origin","referer","user-agent",Ie,SHOPIFY_UNIQUE_TOKEN_HEADER,SHOPIFY_VISIT_TOKEN_HEADER]),..._e(G=>d[G],[Ge,fe,SHOPIFY_STOREFRONT_ID_HEADER,Re])]);t?.buyerIp&&I.set("x-forwarded-for",t.buyerIp);let O=R?.storefrontApiVersion??Xe(C.url).match(wt)?.[1],L=await fetch(y({storefrontApiVersion:O}),{method:C.method,body:C.body,headers:I});return new Response(L.body,L)},isMcpUrl(C){return Zr.test(Xe(C.url??""))},async forwardMcp(C){let R=new Headers([..._e(O=>C.headers.get(O),["accept","accept-encoding","accept-language","content-type","cookie","origin","referer","user-agent"]),..._e(O=>d[O],[Ge,fe,Ie,Re,SHOPIFY_STOREFRONT_ID_HEADER])]);t?.buyerIp&&R.set("x-forwarded-for",t.buyerIp);let I=`${m()}/api/mcp`;try{let O=await fetch(I,{method:C.method,body:C.body,headers:R});return new Response(O.body,O)}catch(O){let G=O instanceof Error?O.message:"Internal proxy error";return new Response(JSON.stringify({jsonrpc:"2.0",error:{code:-32603,message:G},id:null}),{status:502,headers:{"content-type":"application/json"}})}},setCollectedSubrequestHeaders:C=>{if(v)for(let L of v.setCookie)C.headers.append("Set-Cookie",L);let R=Er(v?.serverTiming),I=C.headers.get("content-type")?.startsWith("text/html");Te(C,{...I?{_y:S,_s:f}:void 0,...R}),I&&v&&v.setCookie.length>1&&R?._y&&R?._s&&R?._cmp&&Te(C,{[Qe]:"1"});}}}}var po=void 0;function T(e,t){return {...e,...t&&{errors:t}}}function Ft({storefront:e,customerAccount:t,getCartId:r,cartFragment:o}){return async n=>{let a=r();if(!a)return null;let[s,{cart:c,errors:i}]=await Promise.all([t?t.isLoggedIn():false,e.query(ca(o),{variables:{cartId:a,...n},cache:e.CacheNone()})]);if(s&&c?.checkoutUrl){let u=new URL(c.checkoutUrl);u.searchParams.set("logged_in","true"),c.checkoutUrl=u.toString();}return c||i?T(c,i):null}}var ca=(e=ua)=>`#graphql
28
+ API response error: ${t.status}`,u=new de(c,{query:n,queryVariables:a,cause:{errors:r},clientOperation:`${i}.${o}`,requestId:t.headers.get("x-request-id")});throw new s(u.message,{cause:u.cause})}var ia={language:"EN",country:"US"};function lo(e){let {storefrontHeaders:t,cache:r,waitUntil:o,i18n:n,storefrontId:a,logErrors:s=true,...i}=e,{getPublicTokenHeaders:u,getPrivateTokenHeaders:p,getStorefrontApiUrl:y,getShopifyDomain:m}=createStorefrontClient(i),d=(i.privateStorefrontToken?p:u)({contentType:"json",buyerIp:t?.buyerIp||""});t?.buyerIp&&(d[Ge]=t.buyerIp),t?.buyerIpSig&&(d[fe]=t.buyerIpSig),d[Re]=t?.requestGroupId||nt(),a&&(d[SHOPIFY_STOREFRONT_ID_HEADER]=a),(d["user-agent"]=`Hydrogen ${ke}`);let l=t?.cookie??"";l&&(d.cookie=l);let S,f;if(!/\b_shopify_(analytics|marketing)=/.test(l)){let C=l.match(/\b_shopify_y=([^;]+)/)?.[1],I=l.match(/\b_shopify_s=([^;]+)/)?.[1];C&&(d[SHOPIFY_STOREFRONT_Y_HEADER]=C),I&&(d[SHOPIFY_STOREFRONT_S_HEADER]=I),S=C??nt(),f=I??nt(),d[SHOPIFY_UNIQUE_TOKEN_HEADER]=S,d[SHOPIFY_VISIT_TOKEN_HEADER]=f;}let R,h=JSON.stringify({"content-type":d["content-type"],"user-agent":d["user-agent"],[Ct]:d[Ct],[ht]:d[ht],[At]:d[At],[Ie]:d[Ie]});async function P({query:C,mutation:I,variables:v,cache:x,headers:L=[],storefrontApiVersion:G,displayName:ft,stackInfo:mt}){let qe=L instanceof Headers?Object.fromEntries(L.entries()):Array.isArray(L)?Object.fromEntries(L):L,Q=C??I,A={...v};n&&(!v?.country&&/\$country/.test(Q)&&(A.country=n.country),!v?.language&&/\$language/.test(Q)&&(A.language=n.language));let E=y({storefrontApiVersion:G}),_=JSON.stringify({query:Q,variables:A}),O={method:"POST",headers:{...d,...qe},body:_},q=[E,O.method,h,O.body],re=Q.includes("@defer")?{query:Q,variables:A}:void 0,[V,B]=await ot(E,O,{cacheInstance:I?void 0:r,cache:x||ge(),cacheKey:q,waitUntil:o,shouldCacheResponse:k=>!k?.errors,debugInfo:{requestId:O.headers[Re],displayName:ft,url:E,stackInfo:mt,graphql:_,purpose:t?.purpose},streamConfig:re,onRawHeaders:k=>{R??={setCookie:k.getSetCookie(),serverTiming:k.get("server-timing")??""};}}),K={url:E,response:B,type:I?"mutation":"query",query:Q,queryVariables:A,errors:void 0};if(!B.ok){let k,Y=V;try{Y??=await B.text(),k=X(Y);}catch{k=[{message:Y??"Could not parse Storefront API response"}];}Ne({...K,errors:k});}let{data:U,errors:$}=V;$=$?Array.isArray($)?$:[$]:void 0;let ve=$?.map(({message:k,...Y})=>new de(k,{...Y,clientOperation:`storefront.${K.type}`,requestId:B.headers.get("x-request-id"),queryVariables:A,query:Q}));return T(U,ve)}return {storefront:{query(C,I){C=Ce(C),at(C,"storefront.query");let v=po?.(C);return me(P({...I,query:C,stackInfo:j?.(v)}),{stackOffset:v,logErrors:s})},mutate(C,I){C=Ce(C),st(C,"storefront.mutate");let v=po?.(C);return me(P({...I,mutation:C,stackInfo:j?.(v)}),{stackOffset:v,logErrors:s})},cache:r,CacheNone:xt,CacheLong:_t,CacheShort:ue,CacheCustom:Lt,generateCacheControlHeader:Le,getPublicTokenHeaders:u,getPrivateTokenHeaders:p,getHeaders:()=>({...d}),getShopifyDomain:m,getApiUrl:y,i18n:n??ia,isStorefrontApiUrl(C){return wt.test(Xe(C.url??""))},async forward(C,I){let v=new Headers([..._e(G=>C.headers.get(G),["accept","accept-encoding","accept-language","access-control-request-headers","access-control-request-method","content-type","content-length","cookie","origin","referer","user-agent",Ie,SHOPIFY_UNIQUE_TOKEN_HEADER,SHOPIFY_VISIT_TOKEN_HEADER]),..._e(G=>d[G],[Ge,fe,SHOPIFY_STOREFRONT_ID_HEADER,Re])]);t?.buyerIp&&v.set("x-forwarded-for",t.buyerIp);let x=I?.storefrontApiVersion??Xe(C.url).match(wt)?.[1],L=await fetch(y({storefrontApiVersion:x}),{method:C.method,body:C.body,headers:v});return new Response(L.body,L)},isMcpUrl(C){return Zr.test(Xe(C.url??""))},async forwardMcp(C){let I=new Headers([..._e(x=>C.headers.get(x),["accept","accept-encoding","accept-language","content-type","cookie","origin","referer","user-agent"]),..._e(x=>d[x],[Ge,fe,Ie,Re,SHOPIFY_STOREFRONT_ID_HEADER])]);t?.buyerIp&&I.set("x-forwarded-for",t.buyerIp);let v=`${m()}/api/mcp`;try{let x=await fetch(v,{method:C.method,body:C.body,headers:I});return new Response(x.body,x)}catch(x){let G=x instanceof Error?x.message:"Internal proxy error";return new Response(JSON.stringify({jsonrpc:"2.0",error:{code:-32603,message:G},id:null}),{status:502,headers:{"content-type":"application/json"}})}},setCollectedSubrequestHeaders:C=>{if(R)for(let L of R.setCookie)C.headers.append("Set-Cookie",L);let I=Er(R?.serverTiming),v=C.headers.get("content-type")?.startsWith("text/html");Te(C,{...v?{_y:S,_s:f}:void 0,...I}),v&&R&&R.setCookie.length>1&&I?._y&&I?._s&&I?._cmp&&Te(C,{[Qe]:"1"});}}}}var po=void 0;function T(e,t){return {...e,...t&&{errors:t}}}function Ft({storefront:e,customerAccount:t,getCartId:r,cartFragment:o}){return async n=>{let a=r();if(!a)return null;let[s,{cart:i,errors:c}]=await Promise.all([t?t.isLoggedIn():false,e.query(ca(o),{variables:{cartId:a,...n},cache:e.CacheNone()})]);if(s&&i?.checkoutUrl){let u=new URL(i.checkoutUrl);u.searchParams.set("logged_in","true"),i.checkoutUrl=u.toString();}return i||c?T(i,c):null}}var ca=(e=ua)=>`#graphql
29
29
  query CartQuery(
30
30
  $cartId: ID!
31
31
  $numCartLines: Int = 100
@@ -172,7 +172,7 @@ API response error: ${t.status}`,u=new de(i,{query:n,queryVariables:a,cause:{err
172
172
  message
173
173
  target
174
174
  }
175
- `;function Ht(e){return async(t,r)=>{let o=e.customerAccount?await e.customerAccount.getBuyer():void 0,{cartId:n,...a}=r||{},{buyerIdentity:s,...c}=t,{cartCreate:i,errors:u}=await e.storefront.mutate(da(e.cartFragment),{variables:{input:{...c,buyerIdentity:{...o,...s}},...a}});return T(i,u)}}var da=(e=w)=>`#graphql
175
+ `;function Ht(e){return async(t,r)=>{let o=e.customerAccount?await e.customerAccount.getBuyer():void 0,{cartId:n,...a}=r||{},{buyerIdentity:s,...i}=t,{cartCreate:c,errors:u}=await e.storefront.mutate(da(e.cartFragment),{variables:{input:{...i,buyerIdentity:{...o,...s}},...a}});return T(c,u)}}var da=(e=w)=>`#graphql
176
176
  mutation cartCreate(
177
177
  $input: CartInput!
178
178
  $country: CountryCode = ZZ
@@ -264,7 +264,7 @@ API response error: ${t.status}`,u=new de(i,{query:n,queryVariables:a,cause:{err
264
264
  ${e}
265
265
  ${b}
266
266
  ${D}
267
- `;function Qt(e){return async(t,r)=>{let o=t.filter((s,c,i)=>i.indexOf(s)===c),{cartDiscountCodesUpdate:n,errors:a}=await e.storefront.mutate(fa(e.cartFragment),{variables:{cartId:e.getCartId(),discountCodes:o,...r}});return T(n,a)}}var fa=(e=w)=>`#graphql
267
+ `;function Qt(e){return async(t,r)=>{let o=t.filter((s,i,c)=>c.indexOf(s)===i),{cartDiscountCodesUpdate:n,errors:a}=await e.storefront.mutate(fa(e.cartFragment),{variables:{cartId:e.getCartId(),discountCodes:o,...r}});return T(n,a)}}var fa=(e=w)=>`#graphql
268
268
  mutation cartDiscountCodesUpdate(
269
269
  $cartId: ID!
270
270
  $discountCodes: [String!]!
@@ -381,7 +381,7 @@ API response error: ${t.status}`,u=new de(i,{query:n,queryVariables:a,cause:{err
381
381
  ${e}
382
382
  ${b}
383
383
  ${D}
384
- `;function Jt(e){return async(t,r)=>{let o=r?.cartId||e.getCartId(),n=t.map(c=>({...c,ownerId:o})),{cartMetafieldsSet:a,errors:s}=await e.storefront.mutate(Aa(),{variables:{metafields:n,...r}});return T({cart:{id:o},...a},s)}}var Aa=()=>`#graphql
384
+ `;function Jt(e){return async(t,r)=>{let o=r?.cartId||e.getCartId(),n=t.map(i=>({...i,ownerId:o})),{cartMetafieldsSet:a,errors:s}=await e.storefront.mutate(Aa(),{variables:{metafields:n,...r}});return T({cart:{id:o},...a},s)}}var Aa=()=>`#graphql
385
385
  mutation cartMetafieldsSet(
386
386
  $metafields: [CartMetafieldsSetInput!]!
387
387
  $language: LanguageCode
@@ -571,7 +571,7 @@ API response error: ${t.status}`,u=new de(i,{query:n,queryVariables:a,cause:{err
571
571
  ${e}
572
572
  ${b}
573
573
  ${D}
574
- `;function tr(e){let{getCartId:t,setCartId:r,storefront:o,customerAccount:n,cartQueryFragment:a,cartMutateFragment:s,buyerIdentity:c}=e,i=t(),u=()=>i||t(),p={storefront:o,getCartId:u,cartFragment:s,customerAccount:n},y=Ht(p),m=async function(...d){d[0].buyerIdentity={...c,...d[0].buyerIdentity};let l=await y(...d);return i=l?.cart?.id,l},g={get:Ft({storefront:o,customerAccount:n,getCartId:u,cartFragment:a}),getCartId:u,setCartId:r,create:m,addLines:async(d,l)=>{let S=d.map(f=>({attributes:f.attributes,quantity:f.quantity,merchandiseId:f.merchandiseId,sellingPlanId:f.sellingPlanId,parent:f.parent}));return i||l?.cartId?await qt(p)(S,l):await m({lines:S,buyerIdentity:c},l)},updateLines:Gt(p),removeLines:Bt(p),updateDiscountCodes:async(d,l)=>i||l?.cartId?await Qt(p)(d,l):await m({discountCodes:d},l),updateGiftCardCodes:async(d,l)=>i||l?.cartId?await Xt(p)(d,l):await m({giftCardCodes:d},l),addGiftCardCodes:Zt(p),removeGiftCardCodes:er(p),updateBuyerIdentity:async(d,l)=>i||l?.cartId?await Wt(p)(d,l):await m({buyerIdentity:d},l),updateNote:async(d,l)=>i||l?.cartId?await jt(p)(d,l):await m({note:d},l),updateSelectedDeliveryOption:Kt(p),updateAttributes:async(d,l)=>i||l?.cartId?await Yt(p)(d,l):await m({attributes:d},l),setMetafields:async(d,l)=>i||l?.cartId?await Jt(p)(d,l):await m({metafields:d},l),deleteMetafield:zt(p),addDeliveryAddresses:mo(p),removeDeliveryAddresses:go(p),updateDeliveryAddresses:Co(p),replaceDeliveryAddresses:ho(p)};return "customMethods"in e?{...g,...e.customMethods??{}}:g}function Da(e){let t=useFetchers();if(!t||!t.length)return e;let r=e?.lines?structuredClone(e):{lines:{nodes:[]}},o=r.lines.nodes,n=false;for(let{formData:a}of t){if(!a)continue;let s=Z.getFormInput(a);if(s.action===Z.ACTIONS.LinesAdd)for(let c of s.inputs.lines){if(!c.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 i=o.find(u=>u.merchandise.id===c.selectedVariant?.id);n=true,i?(i.quantity=(i.quantity||1)+(c.quantity||1),i.isOptimistic=true):o.unshift({id:fo(c.selectedVariant.id),merchandise:c.selectedVariant,isOptimistic:true,quantity:c.quantity||1});}else if(s.action===Z.ACTIONS.LinesRemove)for(let c of s.inputs.lineIds){let i=o.findIndex(u=>u.id===c);if(i!==-1){if(it(o[i].id)){console.error("[h2:error:useOptimisticCart] Tried to remove an optimistic line that has not been added to the cart yet");continue}o.splice(i,1),n=true;}else console.warn(`[h2:warn:useOptimisticCart] Tried to remove line '${c}' but it doesn't exist in the cart`);}else if(s.action===Z.ACTIONS.LinesUpdate)for(let c of s.inputs.lines){let i=o.findIndex(u=>c.id===u.id);if(i>-1){if(it(o[i].id)){console.error("[h2:error:useOptimisticCart] Tried to update an optimistic line that has not been added to the cart yet");continue}o[i].quantity=c.quantity,o[i].quantity===0&&o.splice(i,1),n=true;}else console.warn(`[h2:warn:useOptimisticCart] Tried to update line '${c.id}' but it doesn't exist in the cart`);}}return n&&(r.isOptimistic=n),r.totalQuantity=o.reduce((a,s)=>a+s.quantity,0),r}var Oa="https://raw.githubusercontent.com/Shopify/hydrogen/main/docs/changelog.json";async function xa({request:e,changelogUrl:t}){new URL(e.url).searchParams;return fetch(t||Oa)}var Me=createContext$1(),rr=createContext$1(),or=createContext$1(),nr=createContext$1(),ar=createContext$1(),sr=createContext$1(),_a={storefront:Me,cart:rr,customerAccount:or,env:nr,session:ar,waitUntil:sr};var ut="2026-01",Ae=`Shopify Hydrogen ${ke}`,Ao="30243aa5-17c1-465a-8493-944bcc4e88aa",N="customerAccount",Pe="buyer";var H=class extends Response{constructor(t,r,o){super(`Bad request: ${t}`,{status:400,headers:o});}};function $e(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 La({session:e,customerAccountId:t,customerAccountTokenExchangeUrl:r,httpsOrigin:o,debugInfo:n}){let a=new URLSearchParams,s=e.get(N),c=s?.refreshToken,i=s?.idToken;if(!c)throw new H("Unauthorized","No refreshToken found in the session. Make sure your session is configured correctly and passed to `createCustomerAccountClient`.");a.append("grant_type","refresh_token"),a.append("refresh_token",c),a.append("client_id",t);let u={"content-type":"application/x-www-form-urlencoded","User-Agent":Ae,Origin:o};new Date().getTime();let y=r,m=await fetch(y,{method:"POST",headers:u,body:a});if(!m.ok){let S=await m.text();throw new Response(S,{status:m.status,headers:{"Content-Type":"text/html; charset=utf-8"}})}let{access_token:g,expires_in:d,refresh_token:l}=await m.json();if(!g||g.length===0)throw new H("Unauthorized","Invalid access token received.");e.set(N,{accessToken:g,expiresAt:new Date(new Date().getTime()+(d-120)*1e3).getTime()+"",refreshToken:l,idToken:i});}function Se(e){e.unset(N),e.unset(Pe);}async function Po({locks:e,expiresAt:t,session:r,customerAccountId:o,customerAccountTokenExchangeUrl:n,httpsOrigin:a,debugInfo:s}){if(parseInt(t,10)-1e3<new Date().getTime())try{e.refresh||(e.refresh=La({session:r,customerAccountId:o,customerAccountTokenExchangeUrl:n,httpsOrigin:a,debugInfo:s})),await e.refresh,delete e.refresh;}catch(c){throw Se(r),c&&c.status!==401?c:new H("Unauthorized","Login before querying the Customer Account API.")}}function So(){let e=Ua();return Ro(e)}async function vo(e){let t=await crypto.subtle.digest({name:"SHA-256"},new TextEncoder().encode(e)),r=ka(t);return Ro(r)}function Ua(){let e=new Uint8Array(32);return crypto.getRandomValues(e),String.fromCharCode.apply(null,Array.from(e))}function Ro(e){return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function ka(e){let t=new Uint8Array(e),r=Array.from(t);return String.fromCharCode(...r)}function Io(){let e=Date.now().toString(),t=Math.random().toString(36).substring(2);return e+t}async function To(e,t,r,o,n){let a=t;if(!e)throw new H("Unauthorized","oAuth access token was not provided during token exchange.");let s=new URLSearchParams;s.append("grant_type","urn:ietf:params:oauth:grant-type:token-exchange"),s.append("client_id",a),s.append("audience",Ao),s.append("subject_token",e),s.append("subject_token_type","urn:ietf:params:oauth:token-type:access_token"),s.append("scopes","https://api.customers.com/auth/customer.graphql");let c={"content-type":"application/x-www-form-urlencoded","User-Agent":Ae,Origin:o};new Date().getTime();let u=r,p=await fetch(u,{method:"POST",headers:c,body:s});let y=await p.json();if(y.error)throw new H(y.error_description);return y.access_token}function Eo(e){return Na(e).payload.nonce}function Na(e){let[t,r,o]=e.split("."),n=JSON.parse(atob(t)),a=JSON.parse(atob(r));return {header:n,payload:a,signature:o}}function dt(){return Va(Ma())}function Ma(){try{return crypto.getRandomValues(new Uint8Array(16))}catch{return new Uint8Array(16).map(()=>Math.random()*255|0)}}function Va(e){return Array.from(e,function(t){return ("0"+(t&255).toString(16)).slice(-2)}).join("")}function pt(e){if(!e)return;let{pathname:t,search:r}=new URL(e),o=t+r,n=new URLSearchParams(r),a=n.get("return_to")||n.get("redirect");if(a){if(wo(e,a))return a;console.warn(`Cross-domain redirects are not supported. Tried to redirect from ${o} to ${a}`);}}function wo(e,t){try{return new URL(e).origin===new URL(t,e).origin}catch{return false}}function ir({requestUrl:e,defaultUrl:t,redirectUrl:r}){let o=e,n=bo(e,t),a=r?bo(e,r):n;return wo(e,a.toString())?a.toString():(console.warn(`Cross-domain redirects are not supported. Tried to redirect from ${o} to ${a}. Default url ${n} is used instead.`),n.toString())}function bo(e,t){return $a(t)?new URL(t):new URL(t,new URL(e).origin)}function $a(e){try{return new URL(e),!0}catch{return false}}function Do(e,t){let r=`https://shopify.com/${t}`,o=`https://shopify.com/authentication/${t}`;return function(a){switch(a){case "CA_BASE_URL":return r;case "CA_BASE_AUTH_URL":return o;case "GRAPHQL":return `${r}/account/customer/api/${e}/graphql`;case "AUTH":return `${o}/oauth/authorize`;case "LOGIN_SCOPE":return t?"openid email customer-account-api:full":"openid email https://api.customers.com/auth/customer.graphql";case "TOKEN_EXCHANGE":return `${o}/oauth/token`;case "LOGOUT":return `${o}/logout`}}}function Fa(e,t){if(!e.url)return t;let{pathname:r}=new URL(e.url),o=r.replace(/\.data$/,"").replace(/\/_root$/,"/").replace(/(.+)\/$/,"$1"),n=t+`?${new URLSearchParams({return_to:o}).toString()}`;return $e(n)}function ur({session:e,customerAccountId:t,shopId:r,customerApiVersion:o=ut,request:n,waitUntil:a,authUrl:s,customAuthStatusHandler:c,logErrors:i=true,loginPath:u="/account/login",authorizePath:p="/account/authorize",defaultRedirectPath:y="/account",language:m,useCustomAuthDomain:g}){if(o!==ut&&console.warn(`[h2:warn:createCustomerAccountClient] You are using Customer Account API version ${o} when this version of Hydrogen was built for ${ut}.`),e||console.warn("[h2:warn:createCustomerAccountClient] session is required to use Customer Account API. Ensure the session object passed in exist."),!n?.url)throw new Error("[h2:error:createCustomerAccountClient] The request object does not contain a URL.");let d=new URL(n.url),l=d.protocol==="http:"?d.origin.replace("http","https"):d.origin,S=ir({requestUrl:l,defaultUrl:p,redirectUrl:s}),f=A=>void 0,v=c||(()=>(f(d.hostname),Fa(n,u))),h=Do(o,r),P=Ha(h,t),C=h("GRAPHQL"),R={};async function I({query:A,type:E,variables:_={}}){let x=await G();if(!x)throw v();new Date().getTime();let V=await fetch(C,{method:"POST",headers:{"Content-Type":"application/json","User-Agent":Ae,Origin:l,Authorization:x},body:JSON.stringify({query:A,variables:_})});let B=await V.text(),Y={url:C,response:V,type:E,query:A,queryVariables:_,errors:void 0,client:"customer"};if(!V.ok){if(V.status===401)throw Se(e),v();let U;try{U=X(B);}catch{U=[{message:B}];}Ne({...Y,errors:U});}try{let U=X(B),{errors:$}=U,ve=$?.map(({message:k,...J})=>new de(k,{...J,clientOperation:`customerAccount.${Y.type}`,requestId:V.headers.get("x-request-id"),queryVariables:_,query:A}));return {...U,...$&&{errors:ve}}}catch{Ne({...Y,errors:[{message:B}]});}}async function O(){if(!r)return false;let A=e.get(N),E=A?.accessToken,_=A?.expiresAt;if(!E||!_)return false;let x=K?.();try{await Po({locks:R,expiresAt:_,session:e,customerAccountId:t,customerAccountTokenExchangeUrl:h("TOKEN_EXCHANGE"),httpsOrigin:l,debugInfo:{waitUntil:a,stackInfo:x,...ae(n)}});}catch{return false}return true}async function L(){if(!await O())throw v()}async function G(){if(await O())return e.get(N)?.accessToken}async function ft(A,E){return f(d.hostname),P(),A=Ce(A),st(A,"customer.mutate"),me(I({query:A,type:"mutation",...E}),{logErrors:i})}async function mt(A,E){return f(d.hostname),P(),A=Ce(A),at(A,"customer.query"),me(I({query:A,type:"query",...E}),{logErrors:i})}function qe(A){e.set(Pe,{...e.get(Pe),...A});}async function W(){let A=await G();if(A)return {...e.get(Pe),customerAccessToken:A}}return {i18n:{language:m??"EN"},login:async A=>{f(d.hostname),P();let E=new URL(h("AUTH")),_=Io(),x=dt();E.searchParams.set("client_id",t),E.searchParams.set("scope","openid email"),E.searchParams.append("response_type","code"),E.searchParams.append("redirect_uri",S),E.searchParams.set("scope",h("LOGIN_SCOPE")),E.searchParams.append("state",_),E.searchParams.append("nonce",x);let q=qa({contextLanguage:m??null,localeOverride:A?.locale??null,uiLocalesOverride:A?.uiLocales??null});q!=null&&E.searchParams.append("locale",q),A?.countryCode&&E.searchParams.append("region_country",A.countryCode),A?.acrValues&&E.searchParams.append("acr_values",A.acrValues),A?.loginHint&&(E.searchParams.append("login_hint",A.loginHint),A?.loginHintMode&&E.searchParams.append("login_hint_mode",A.loginHintMode));let re=So(),V=await vo(re);return e.set(N,{...e.get(N),codeVerifier:re,state:_,nonce:x,redirectPath:pt(n.url)||j(n,"Referer")||y}),E.searchParams.append("code_challenge",V),E.searchParams.append("code_challenge_method","S256"),$e(E.toString())},logout:async A=>{f(d.hostname),P();let E=e.get(N)?.idToken,_=ir({requestUrl:l,defaultUrl:l,redirectUrl:A?.postLogoutRedirectUri}),x=E?new URL(`${h("LOGOUT")}?${new URLSearchParams([["id_token_hint",E],["post_logout_redirect_uri",_]]).toString()}`).toString():_;Se(e);let q=A?.headers instanceof Headers?A?.headers:new Headers(A?.headers);return A?.keepSession||(e.destroy?q.set("Set-Cookie",await e.destroy()):console.warn("[h2:warn:customerAccount] session.destroy is not available on your session implementation. All session data might not be cleared on logout."),e.isPending=false),$e(x,{headers:q})},isLoggedIn:O,handleAuthStatus:L,getAccessToken:G,getApiUrl:()=>C,mutate:ft,query:mt,authorize:async()=>{f(d.hostname),P();let A=d.searchParams.get("code"),E=d.searchParams.get("state");if(!A||!E)throw Se(e),new H("Unauthorized","No code or state parameter found in the redirect URL.");if(e.get(N)?.state!==E)throw Se(e),new H("Unauthorized","The session state does not match the state parameter. Make sure that the session is configured correctly and passed to `createCustomerAccountClient`.");let _=t,x=new URLSearchParams;x.append("grant_type","authorization_code"),x.append("client_id",_),x.append("redirect_uri",S),x.append("code",A);let q=e.get(N)?.codeVerifier;if(!q)throw new H("Unauthorized","No code verifier found in the session. Make sure that the session is configured correctly and passed to `createCustomerAccountClient`.");x.append("code_verifier",q);let re={"content-type":"application/x-www-form-urlencoded","User-Agent":Ae,Origin:l};new Date().getTime();let Y=h("TOKEN_EXCHANGE"),U=await fetch(Y,{method:"POST",headers:re,body:x});if(!U.ok)throw new Response(await U.text(),{status:U.status,headers:{"Content-Type":"text/html; charset=utf-8"}});let{access_token:$,expires_in:ve,id_token:k,refresh_token:J}=await U.json(),gt=e.get(N)?.nonce,hr=await Eo(k);if(gt!==hr)throw new H("Unauthorized",`Returned nonce does not match: ${gt} !== ${hr}`);let Ar=$;r||(Ar=await To($,t,h("TOKEN_EXCHANGE"),l,{...ae(n)}));let jo=e.get(N)?.redirectPath;return e.set(N,{accessToken:Ar,expiresAt:new Date(new Date().getTime()+(ve-120)*1e3).getTime()+"",refreshToken:J,idToken:k}),$e(jo||y)},setBuyer:qe,getBuyer:W,UNSTABLE_setBuyer:A=>{Q("[h2:warn:customerAccount] `customerAccount.UNSTABLE_setBuyer` is deprecated. Please use `customerAccount.setBuyer`."),qe(A);},UNSTABLE_getBuyer:()=>(Q("[h2:warn:customerAccount] `customerAccount.UNSTABLE_getBuyer` is deprecated. Please use `customerAccount.getBuyer`."),W())}}function Ha(e,t){return function(){try{if(!t)throw Error();new URL(e("CA_BASE_URL")),new URL(e("CA_BASE_AUTH_URL"));}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 o="Internal Server Error";throw new Response(o,{status:500})}}}function qa(e){return e.localeOverride!=null?cr(e.localeOverride):e.uiLocalesOverride!=null?cr(e.uiLocalesOverride):e.contextLanguage!=null?cr(e.contextLanguage):null}function cr(e){let r=e.toLowerCase().replaceAll("_","-").split("-"),o=r[0],n=r[1];return n?`${o}-${n.toUpperCase()}`:o}function Ba(e,t){let{env:r,request:o,cache:n,waitUntil:a,i18n:s,session:c,logErrors:i,storefront:u={},customerAccount:p,cart:y={},buyerIdentity:m}=e;c||console.warn("[h2:warn:createHydrogenContext] A session object is required to create hydrogen context."),p?.unstableB2b&&Q("[h2:warn:createHydrogenContext] `customerAccount.unstableB2b` is now stable. Please remove the `unstableB2b` option.");let{storefront:g}=lo({cache:n,waitUntil:a,i18n:s,logErrors:i,storefrontHeaders:u.headers||Xr(o),storefrontApiVersion:u.apiVersion,storefrontId:r.PUBLIC_STOREFRONT_ID,storeDomain:r.PUBLIC_STORE_DOMAIN,privateStorefrontToken:r.PRIVATE_STOREFRONT_API_TOKEN,publicStorefrontToken:r.PUBLIC_STOREFRONT_API_TOKEN}),d=ur({session:c,request:o,waitUntil:a,logErrors:i,customerApiVersion:p?.apiVersion,authUrl:p?.authUrl,customAuthStatusHandler:p?.customAuthStatusHandler,useCustomAuthDomain:p?.useCustomAuthDomain,language:s?.language,customerAccountId:r.PUBLIC_CUSTOMER_ACCOUNT_API_CLIENT_ID,shopId:r.SHOP_ID}),l=tr({getCartId:y.getId||Mt(o.headers),setCartId:y.setId||Vt(),cartQueryFragment:y.queryFragment,cartMutateFragment:y.mutateFragment,customMethods:y.customMethods,buyerIdentity:m,storefront:g,customerAccount:d}),S=new RouterContextProvider;S.set(Me,g),S.set(rr,l),S.set(or,d),S.set(nr,r),S.set(ar,c),a&&S.set(sr,a);let f={storefront:g,cart:l,customerAccount:d,env:r,session:c,waitUntil:a,...t||{}};return new Proxy(S,{get(h,P,C){if(P in h){let R=h[P];return typeof R=="function"?R.bind(h):R}return P in f?f[P]:Reflect.get(h,P,C)},has(h,P){return P in h||P in f},ownKeys(h){return [...Reflect.ownKeys(h),...Object.keys(f)]},getOwnPropertyDescriptor(h,P){if(P in h)return Reflect.getOwnPropertyDescriptor(h,P);if(P in f)return {enumerable:true,configurable:true,writable:false,value:f[P]}}})}function Wa({build:e,mode:t,poweredByHeader:r=true,getLoadContext:o,collectTrackingInformation:n=true,proxyStandardRoutes:a=true}){let s=createRequestHandler(e,t),c=r?i=>i.headers.append("powered-by","Shopify, Hydrogen"):void 0;return async i=>{let u=i.method;if((u==="GET"||u==="HEAD")&&i.body)return new Response(`${u} requests cannot have a body`,{status:400});let p=new URL(i.url);if(p.pathname.includes("//"))return new Response(null,{status:301,headers:{location:p.pathname.replace(/\/+/g,"/")}});let y=await o?.(i),m=y?.storefront||y?.get?.(Me);if(a){if(m||Q("[h2:createRequestHandler] Storefront instance is required to proxy standard routes."),m?.isStorefrontApiUrl(i)){let d=await m.forward(i);return c?.(d),d}if(m?.isMcpUrl(i)){let d=await m.forwardMcp(i);return c?.(d),d}}let g=await s(i,y);if(m&&a){n&&m.setCollectedSubrequestHeaders(g);let d=i.headers.get("sec-fetch-dest");(d&&d==="document"||i.headers.get("accept")?.includes("text/html"))&&Te(g,{[Be]:"1"});}return c?.(g),g}}var Oo=createContext(void 0),xo=Oo.Provider,dr=()=>useContext(Oo);function za(e){let t=dt(),r=Xa(t,e);return {nonce:t,header:r,NonceProvider:({children:n})=>createElement(xo,{value:t},n)}}function Xa(e,t){let{shop:r,...o}=t??{},n=`'nonce-${e}'`,a=["'self'","'unsafe-inline'","https://cdn.shopify.com"],s=["'self'","https://cdn.shopify.com/","https://monorail-edge.shopifysvc.com"];r&&r.checkoutDomain&&s.push(`https://${r.checkoutDomain}`),r&&r.storeDomain&&s.push(`https://${r.storeDomain}`);let i={baseUri:["'self'"],defaultSrc:["'self'",n,"https://cdn.shopify.com","https://shopify.com"],frameAncestors:["'none'"],styleSrc:a,connectSrc:s},u=Object.assign({},i,o);for(let p in i){let y=o[p];p&&y&&(u[p]=Za(y,i[p]));}return u.scriptSrc instanceof Array?u.scriptSrc=[...u.scriptSrc.filter(p=>!p.startsWith("'nonce")),n]:u.defaultSrc instanceof Array&&(u.defaultSrc=[...u.defaultSrc.filter(p=>!p.startsWith("'nonce")),n]),Ja({directives:u})}function Za(e,t){let r=typeof t=="string"?[t]:t,o=Array.isArray(e)?e:[String(e)];return Array.isArray(r)?r.every(a=>a==="'none'")?o:[...o,...r]:r}var rs=forwardRef((e,t)=>{let{waitForHydration:r,src:o,...n}=e,a=dr();return r?jsx(os,{src:o,options:n}):jsx("script",{suppressHydrationWarning:true,...n,src:o,nonce:a,ref:t})});function os({src:e,options:t}){if(!e)throw new Error("`waitForHydration` with the Script component requires a `src` prop");return useLoadScript(e,{attributes:t}),null}async function ns(e){return e;}function ss(e){let t=useFetchers(),r={};for(let{formData:o}of t)if(o?.get("optimistic-identifier")===e)try{if(o.has("optimistic-data")){let n=JSON.parse(String(o.get("optimistic-data")));Object.assign(r,n);}}catch{}return r}function is({id:e,data:t}){return jsxs(Fragment,{children:[jsx("input",{type:"hidden",name:"optimistic-identifier",value:e}),jsx("input",{type:"hidden",name:"optimistic-data",value:JSON.stringify(t)})]})}function ls({connection:e,children:t=()=>(console.warn("<Pagination> requires children to work properly"),null),namespace:r=""}){let [o,n]=useState(false),a=useNavigation(),s=useLocation();useNavigate();useEffect(()=>{a.state==="idle"&&n(false);},[a.state]);let{endCursor:i,hasNextPage:u,hasPreviousPage:p,nextPageUrl:y,nodes:m,previousPageUrl:g,startCursor:d}=ys(e,r),l=useMemo(()=>({...s.state,pagination:{...s.state?.pagination||{},[r]:{pageInfo:{endCursor:i,hasPreviousPage:p,hasNextPage:u,startCursor:d},nodes:m}}}),[i,u,p,d,m,r,s.state]),S=useMemo(()=>forwardRef(function(h,P){return u?createElement(Link,{preventScrollReset:true,...h,to:y,state:l,replace:true,ref:P,onClick:()=>n(true)}):null}),[u,y,l]),f=useMemo(()=>forwardRef(function(h,P){return p?createElement(Link,{preventScrollReset:true,...h,to:g,state:l,replace:true,ref:P,onClick:()=>n(true)}):null}),[p,g,l]);return t({state:l,hasNextPage:u,hasPreviousPage:p,isLoading:o,nextPageUrl:y,nodes:m,previousPageUrl:g,NextLink:S,PreviousLink:f})}function lt(e,t){let r=new URLSearchParams(e);return Object.keys(t?.pagination||{}).forEach(n=>{let a=n===""?"":`${n}_`,s=`${a}cursor`,c=`${a}direction`;r.delete(s),r.delete(c);}),r.toString()}function Fe(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 ys(e,t=""){e.pageInfo||Fe("pageInfo"),typeof e.pageInfo.startCursor>"u"&&Fe("pageInfo.startCursor"),typeof e.pageInfo.endCursor>"u"&&Fe("pageInfo.endCursor"),typeof e.pageInfo.hasNextPage>"u"&&Fe("pageInfo.hasNextPage"),typeof e.pageInfo.hasPreviousPage>"u"&&Fe("pageInfo.hasPreviousPage");let r=useNavigation(),o=useNavigate(),{state:n,search:a,pathname:s}=useLocation(),c=t?`${t}_cursor`:"cursor",i=t?`${t}_direction`:"direction",y=new URLSearchParams(a).get(i)==="previous",m=useMemo(()=>!globalThis?.window?.__hydrogenHydrated||!n?.pagination?.[t]?.nodes?flattenConnection(e):y?[...flattenConnection(e),...n.pagination[t].nodes||[]]:[...n.pagination[t].nodes||[],...flattenConnection(e)],[n,e,t]),g=useMemo(()=>{let f=globalThis?.window?.__hydrogenHydrated,v=n?.pagination?.[t]?.pageInfo,h=!f||v?.startCursor===void 0?e.pageInfo.startCursor:v.startCursor,P=!f||v?.endCursor===void 0?e.pageInfo.endCursor:v.endCursor,C=!f||v?.hasPreviousPage===void 0?e.pageInfo.hasPreviousPage:v.hasPreviousPage,R=!f||v?.hasNextPage===void 0?e.pageInfo.hasNextPage:v.hasNextPage;return n?.pagination?.[t]?.nodes&&(y?(h=e.pageInfo.startCursor,C=e.pageInfo.hasPreviousPage):(P=e.pageInfo.endCursor,R=e.pageInfo.hasNextPage)),{startCursor:h,endCursor:P,hasPreviousPage:C,hasNextPage:R}},[y,n,t,e.pageInfo.hasNextPage,e.pageInfo.hasPreviousPage,e.pageInfo.startCursor,e.pageInfo.endCursor]),d=useRef({params:lt(a,n),pathname:s});useEffect(()=>{window.__hydrogenHydrated=true;},[]),useEffect(()=>{let f=lt(a,n),v=d.current.params;(s!==d.current.pathname||f!==v)&&!(r.state==="idle"&&!r.location)&&(d.current={pathname:s,params:lt(a,n)},o(`${s}?${lt(a,n)}`,{replace:true,preventScrollReset:true,state:{nodes:void 0,pageInfo:void 0}}));},[s,a,n]);let l=useMemo(()=>{let f=new URLSearchParams(a);return f.set(i,"previous"),g.startCursor&&f.set(c,g.startCursor),`?${f.toString()}`},[a,g.startCursor]),S=useMemo(()=>{let f=new URLSearchParams(a);return f.set(i,"next"),g.endCursor&&f.set(c,g.endCursor),`?${f.toString()}`},[a,g.endCursor]);return {...g,previousPageUrl:l,nextPageUrl:S,nodes:m}}function fs(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,namespace:o=""}=t,n=new URLSearchParams(new URL(e.url).search),a=o?`${o}_cursor`:"cursor",s=o?`${o}_direction`:"direction",c=n.get(a)??void 0;return (n.get(s)==="previous"?"previous":"next")==="previous"?{last:r,startCursor:c??null}:{first:r,endCursor:c??null}}function hs(e,t){let r=useNavigation(),[o,n]=useState([]);if(useEffect(()=>{Promise.resolve(t).then(a=>{a&&n(a instanceof Array?a:a.product?.variants?.nodes||[]);}).catch(a=>{reportError(new Error("[h2:error:useOptimisticVariant] An error occurred while resolving the variants for the optimistic product hook.",{cause:a}));});},[JSON.stringify(t)]),r.state==="loading"){let a=new URLSearchParams(r.location.search),s=false,c=o.find(i=>i.selectedOptions?i.selectedOptions.every(u=>a.get(u.name)===u.value):(s||(s=true,reportError(new Error("[h2:error:useOptimisticVariant] The optimistic product hook requires your product query to include variants with the selectedOptions field."))),false));if(c)return {...c,isOptimistic:true}}return e}function Is({handle:e,options:t=[],variants:r=[],productPath:o="products",waitForNavigation:n=false,selectedVariant:a,children:s}){let c=t;c[0]?.values&&(Q("[h2:warn:VariantSelector] product.options.values is deprecated. Use product.options.optionValues instead."),c[0]&&!c[0].optionValues&&(c=t.map(d=>({...d,optionValues:d.values?.map(l=>({name:l}))||[]}))));let i=r instanceof Array?r:flattenConnection(r),{searchParams:u,path:p,alreadyOnProductPage:y}=Es(e,o,n),m=c.filter(d=>d?.optionValues?.length===1),g=a?a?.selectedOptions?.reduce((d,l)=>(d[l.name]=l.value,d),{}):{};return createElement(Fragment$1,null,...useMemo(()=>c.map(d=>{let l,S=[];for(let f of d.optionValues){let v=new URLSearchParams(y?u:void 0);v.set(d.name,f.name),m.forEach(I=>{I.optionValues[0].name&&v.set(I.name,I.optionValues[0].name);});let h=i.find(I=>I?.selectedOptions?.every(O=>(v.get(O?.name)||g?.[O?.name])===O?.value)),P=u.get(d.name);!P&&a&&(P=g?.[d.name]||null);let C=P?P===f.name:false;C&&(l=f.name);let R="?"+v.toString();S.push({value:f.name,optionValue:f,isAvailable:h?h.availableForSale:true,to:p+R,search:R,isActive:C,variant:h});}return s({option:{name:d.name,value:l,values:S}})}),[c,i,s]))}var Ts=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,n)=>{r.push({name:n,value:o});}),r};function Es(e,t,r){let{pathname:o,search:n}=useLocation(),a=useNavigation();return useMemo(()=>{let s=/(\/[a-zA-Z]{2}-[a-zA-Z]{2}\/)/g.exec(o),c=s&&s.length>0;t=t.startsWith("/")?t.substring(1):t;let i=c?`${s[0]}${t}/${e}`:`/${t}/${e}`;return {searchParams:new URLSearchParams(r||a.state!=="loading"?n:a.location.search),alreadyOnProductPage:i===o,path:i}},[o,n,r,e,t,a])}function bs(){return {name:"hydrogen-2025.7.0",reactRouterConfig:()=>({appDirectory:"app",buildDirectory:"dist",ssr:true,future:{v8_middleware:true,v8_splitRouteModules:true,v8_viteEnvironmentApi:false,unstable_optimizeDeps:true,unstable_subResourceIntegrity:false}}),reactRouterConfigResolved:({reactRouterConfig:e})=>{if(e.basename&&e.basename!=="/")throw new Error(`[Hydrogen Preset] basename is not supported in Hydrogen 2025.7.0.
574
+ `;function tr(e){let{getCartId:t,setCartId:r,storefront:o,customerAccount:n,cartQueryFragment:a,cartMutateFragment:s,buyerIdentity:i}=e,c=t(),u=()=>c||t(),p={storefront:o,getCartId:u,cartFragment:s,customerAccount:n},y=Ht(p),m=async function(...d){d[0].buyerIdentity={...i,...d[0].buyerIdentity};let l=await y(...d);return c=l?.cart?.id,l},g={get:Ft({storefront:o,customerAccount:n,getCartId:u,cartFragment:a}),getCartId:u,setCartId:r,create:m,addLines:async(d,l)=>{let S=d.map(f=>({attributes:f.attributes,quantity:f.quantity,merchandiseId:f.merchandiseId,sellingPlanId:f.sellingPlanId,parent:f.parent}));return c||l?.cartId?await qt(p)(S,l):await m({lines:S,buyerIdentity:i},l)},updateLines:Gt(p),removeLines:Bt(p),updateDiscountCodes:async(d,l)=>c||l?.cartId?await Qt(p)(d,l):await m({discountCodes:d},l),updateGiftCardCodes:async(d,l)=>c||l?.cartId?await Xt(p)(d,l):await m({giftCardCodes:d},l),addGiftCardCodes:Zt(p),removeGiftCardCodes:er(p),updateBuyerIdentity:async(d,l)=>c||l?.cartId?await Wt(p)(d,l):await m({buyerIdentity:d},l),updateNote:async(d,l)=>c||l?.cartId?await jt(p)(d,l):await m({note:d},l),updateSelectedDeliveryOption:Kt(p),updateAttributes:async(d,l)=>c||l?.cartId?await Yt(p)(d,l):await m({attributes:d},l),setMetafields:async(d,l)=>c||l?.cartId?await Jt(p)(d,l):await m({metafields:d},l),deleteMetafield:zt(p),addDeliveryAddresses:mo(p),removeDeliveryAddresses:go(p),updateDeliveryAddresses:Co(p),replaceDeliveryAddresses:ho(p)};return "customMethods"in e?{...g,...e.customMethods??{}}:g}function Da(e){let t=useFetchers();if(!t||!t.length)return e;let r=e?.lines?structuredClone(e):{lines:{nodes:[]}},o=r.lines.nodes,n=false;for(let{formData:a}of t){if(!a)continue;let s=Z.getFormInput(a);if(s.action===Z.ACTIONS.LinesAdd)for(let i of s.inputs.lines){if(!i.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=o.find(u=>u.merchandise.id===i.selectedVariant?.id);n=true,c?(c.quantity=(c.quantity||1)+(i.quantity||1),c.isOptimistic=true):o.unshift({id:fo(i.selectedVariant.id),merchandise:i.selectedVariant,isOptimistic:true,quantity:i.quantity||1});}else if(s.action===Z.ACTIONS.LinesRemove)for(let i of s.inputs.lineIds){let c=o.findIndex(u=>u.id===i);if(c!==-1){if(it(o[c].id)){console.error("[h2:error:useOptimisticCart] Tried to remove an optimistic line that has not been added to the cart yet");continue}o.splice(c,1),n=true;}else console.warn(`[h2:warn:useOptimisticCart] Tried to remove line '${i}' but it doesn't exist in the cart`);}else if(s.action===Z.ACTIONS.LinesUpdate)for(let i of s.inputs.lines){let c=o.findIndex(u=>i.id===u.id);if(c>-1){if(it(o[c].id)){console.error("[h2:error:useOptimisticCart] Tried to update an optimistic line that has not been added to the cart yet");continue}o[c].quantity=i.quantity,o[c].quantity===0&&o.splice(c,1),n=true;}else console.warn(`[h2:warn:useOptimisticCart] Tried to update line '${i.id}' but it doesn't exist in the cart`);}}return n&&(r.isOptimistic=n),r.totalQuantity=o.reduce((a,s)=>a+s.quantity,0),r}var xa="https://raw.githubusercontent.com/Shopify/hydrogen/main/docs/changelog.json";async function Oa({request:e,changelogUrl:t}){new URL(e.url).searchParams;return fetch(t||xa)}var Me=createContext$1(),rr=createContext$1(),or=createContext$1(),nr=createContext$1(),ar=createContext$1(),sr=createContext$1(),_a={storefront:Me,cart:rr,customerAccount:or,env:nr,session:ar,waitUntil:sr};var ut="2026-04",Ae=`Shopify Hydrogen ${ke}`,Ao="30243aa5-17c1-465a-8493-944bcc4e88aa",N="customerAccount",Pe="buyer";var H=class extends Response{constructor(t,r,o){super(`Bad request: ${t}`,{status:400,headers:o});}};function $e(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 La({session:e,customerAccountId:t,customerAccountTokenExchangeUrl:r,httpsOrigin:o,debugInfo:n}){let a=new URLSearchParams,s=e.get(N),i=s?.refreshToken,c=s?.idToken;if(!i)throw new H("Unauthorized","No refreshToken found in the session. Make sure your session is configured correctly and passed to `createCustomerAccountClient`.");a.append("grant_type","refresh_token"),a.append("refresh_token",i),a.append("client_id",t);let u={"content-type":"application/x-www-form-urlencoded","User-Agent":Ae,Origin:o};new Date().getTime();let y=r,m=await fetch(y,{method:"POST",headers:u,body:a});if(!m.ok){let S=await m.text();throw new Response(S,{status:m.status,headers:{"Content-Type":"text/html; charset=utf-8"}})}let{access_token:g,expires_in:d,refresh_token:l}=await m.json();if(!g||g.length===0)throw new H("Unauthorized","Invalid access token received.");e.set(N,{accessToken:g,expiresAt:new Date(new Date().getTime()+(d-120)*1e3).getTime()+"",refreshToken:l,idToken:c});}function Se(e){e.unset(N),e.unset(Pe);}async function Po({locks:e,expiresAt:t,session:r,customerAccountId:o,customerAccountTokenExchangeUrl:n,httpsOrigin:a,debugInfo:s}){if(parseInt(t,10)-1e3<new Date().getTime())try{e.refresh||(e.refresh=La({session:r,customerAccountId:o,customerAccountTokenExchangeUrl:n,httpsOrigin:a,debugInfo:s})),await e.refresh,delete e.refresh;}catch(i){throw Se(r),i&&i.status!==401?i:new H("Unauthorized","Login before querying the Customer Account API.")}}function So(){let e=Ua();return Ro(e)}async function vo(e){let t=await crypto.subtle.digest({name:"SHA-256"},new TextEncoder().encode(e)),r=ka(t);return Ro(r)}function Ua(){let e=new Uint8Array(32);return crypto.getRandomValues(e),String.fromCharCode.apply(null,Array.from(e))}function Ro(e){return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function ka(e){let t=new Uint8Array(e),r=Array.from(t);return String.fromCharCode(...r)}function Io(){let e=Date.now().toString(),t=Math.random().toString(36).substring(2);return e+t}async function To(e,t,r,o,n){let a=t;if(!e)throw new H("Unauthorized","oAuth access token was not provided during token exchange.");let s=new URLSearchParams;s.append("grant_type","urn:ietf:params:oauth:grant-type:token-exchange"),s.append("client_id",a),s.append("audience",Ao),s.append("subject_token",e),s.append("subject_token_type","urn:ietf:params:oauth:token-type:access_token"),s.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 u=r,p=await fetch(u,{method:"POST",headers:i,body:s});let y=await p.json();if(y.error)throw new H(y.error_description);return y.access_token}function Eo(e){return Na(e).payload.nonce}function Na(e){let[t,r,o]=e.split("."),n=JSON.parse(atob(t)),a=JSON.parse(atob(r));return {header:n,payload:a,signature:o}}function dt(){return Va(Ma())}function Ma(){try{return crypto.getRandomValues(new Uint8Array(16))}catch{return new Uint8Array(16).map(()=>Math.random()*255|0)}}function Va(e){return Array.from(e,function(t){return ("0"+(t&255).toString(16)).slice(-2)}).join("")}function pt(e){if(!e)return;let{pathname:t,search:r}=new URL(e),o=t+r,n=new URLSearchParams(r),a=n.get("return_to")||n.get("redirect");if(a){if(wo(e,a))return a;console.warn(`Cross-domain redirects are not supported. Tried to redirect from ${o} to ${a}`);}}function wo(e,t){try{return new URL(e).origin===new URL(t,e).origin}catch{return false}}function ir({requestUrl:e,defaultUrl:t,redirectUrl:r}){let o=e,n=bo(e,t),a=r?bo(e,r):n;return wo(e,a.toString())?a.toString():(console.warn(`Cross-domain redirects are not supported. Tried to redirect from ${o} to ${a}. Default url ${n} is used instead.`),n.toString())}function bo(e,t){return $a(t)?new URL(t):new URL(t,new URL(e).origin)}function $a(e){try{return new URL(e),!0}catch{return false}}function Do(e,t){let r=`https://shopify.com/${t}`,o=`https://shopify.com/authentication/${t}`;return function(a){switch(a){case "CA_BASE_URL":return r;case "CA_BASE_AUTH_URL":return o;case "GRAPHQL":return `${r}/account/customer/api/${e}/graphql`;case "AUTH":return `${o}/oauth/authorize`;case "LOGIN_SCOPE":return t?"openid email customer-account-api:full":"openid email https://api.customers.com/auth/customer.graphql";case "TOKEN_EXCHANGE":return `${o}/oauth/token`;case "LOGOUT":return `${o}/logout`}}}function Fa(e,t){if(!e.url)return t;let{pathname:r}=new URL(e.url),o=r.replace(/\.data$/,"").replace(/\/_root$/,"/").replace(/(.+)\/$/,"$1"),n=t+`?${new URLSearchParams({return_to:o}).toString()}`;return $e(n)}function ur({session:e,customerAccountId:t,shopId:r,customerApiVersion:o=ut,request:n,waitUntil:a,authUrl:s,customAuthStatusHandler:i,logErrors:c=true,loginPath:u="/account/login",authorizePath:p="/account/authorize",defaultRedirectPath:y="/account",language:m,useCustomAuthDomain:g}){if(o!==ut&&console.warn(`[h2:warn:createCustomerAccountClient] You are using Customer Account API version ${o} when this version of Hydrogen was built for ${ut}.`),e||console.warn("[h2:warn:createCustomerAccountClient] session is required to use Customer Account API. Ensure the session object passed in exist."),!n?.url)throw new Error("[h2:error:createCustomerAccountClient] The request object does not contain a URL.");let d=new URL(n.url),l=d.protocol==="http:"?d.origin.replace("http","https"):d.origin,S=ir({requestUrl:l,defaultUrl:p,redirectUrl:s}),f=A=>void 0,R=i||(()=>(f(d.hostname),Fa(n,u))),h=Do(o,r),P=Ha(h,t),C=h("GRAPHQL"),I={};async function v({query:A,type:E,variables:_={}}){let O=await G();if(!O)throw R();new Date().getTime();let V=await fetch(C,{method:"POST",headers:{"Content-Type":"application/json","User-Agent":Ae,Origin:l,Authorization:O},body:JSON.stringify({query:A,variables:_})});let B=await V.text(),K={url:C,response:V,type:E,query:A,queryVariables:_,errors:void 0,client:"customer"};if(!V.ok){if(V.status===401)throw Se(e),R();let U;try{U=X(B);}catch{U=[{message:B}];}Ne({...K,errors:U});}try{let U=X(B),{errors:$}=U,ve=$?.map(({message:k,...Y})=>new de(k,{...Y,clientOperation:`customerAccount.${K.type}`,requestId:V.headers.get("x-request-id"),queryVariables:_,query:A}));return {...U,...$&&{errors:ve}}}catch{Ne({...K,errors:[{message:B}]});}}async function x(){if(!r)return false;let A=e.get(N),E=A?.accessToken,_=A?.expiresAt;if(!E||!_)return false;let O=j?.();try{await Po({locks:I,expiresAt:_,session:e,customerAccountId:t,customerAccountTokenExchangeUrl:h("TOKEN_EXCHANGE"),httpsOrigin:l,debugInfo:{waitUntil:a,stackInfo:O,...ae(n)}});}catch{return false}return true}async function L(){if(!await x())throw R()}async function G(){if(await x())return e.get(N)?.accessToken}async function ft(A,E){return f(d.hostname),P(),A=Ce(A),st(A,"customer.mutate"),me(v({query:A,type:"mutation",...E}),{logErrors:c})}async function mt(A,E){return f(d.hostname),P(),A=Ce(A),at(A,"customer.query"),me(v({query:A,type:"query",...E}),{logErrors:c})}function qe(A){e.set(Pe,{...e.get(Pe),...A});}async function Q(){let A=await G();if(A)return {...e.get(Pe),customerAccessToken:A}}return {i18n:{language:m??"EN"},login:async A=>{f(d.hostname),P();let E=new URL(h("AUTH")),_=Io(),O=dt();E.searchParams.set("client_id",t),E.searchParams.set("scope","openid email"),E.searchParams.append("response_type","code"),E.searchParams.append("redirect_uri",S),E.searchParams.set("scope",h("LOGIN_SCOPE")),E.searchParams.append("state",_),E.searchParams.append("nonce",O);let q=qa({contextLanguage:m??null,localeOverride:A?.locale??null,uiLocalesOverride:A?.uiLocales??null});q!=null&&E.searchParams.append("locale",q),A?.countryCode&&E.searchParams.append("region_country",A.countryCode),A?.acrValues&&E.searchParams.append("acr_values",A.acrValues),A?.loginHint&&(E.searchParams.append("login_hint",A.loginHint),A?.loginHintMode&&E.searchParams.append("login_hint_mode",A.loginHintMode));let re=So(),V=await vo(re);return e.set(N,{...e.get(N),codeVerifier:re,state:_,nonce:O,redirectPath:pt(n.url)||W(n,"Referer")||y}),E.searchParams.append("code_challenge",V),E.searchParams.append("code_challenge_method","S256"),$e(E.toString())},logout:async A=>{f(d.hostname),P();let E=e.get(N)?.idToken,_=ir({requestUrl:l,defaultUrl:l,redirectUrl:A?.postLogoutRedirectUri}),O=E?new URL(`${h("LOGOUT")}?${new URLSearchParams([["id_token_hint",E],["post_logout_redirect_uri",_]]).toString()}`).toString():_;Se(e);let q=A?.headers instanceof Headers?A?.headers:new Headers(A?.headers);return A?.keepSession||(e.destroy?q.set("Set-Cookie",await e.destroy()):console.warn("[h2:warn:customerAccount] session.destroy is not available on your session implementation. All session data might not be cleared on logout."),e.isPending=false),$e(O,{headers:q})},isLoggedIn:x,handleAuthStatus:L,getAccessToken:G,getApiUrl:()=>C,mutate:ft,query:mt,authorize:async()=>{f(d.hostname),P();let A=d.searchParams.get("code"),E=d.searchParams.get("state");if(!A||!E)throw Se(e),new H("Unauthorized","No code or state parameter found in the redirect URL.");if(e.get(N)?.state!==E)throw Se(e),new H("Unauthorized","The session state does not match the state parameter. Make sure that the session is configured correctly and passed to `createCustomerAccountClient`.");let _=t,O=new URLSearchParams;O.append("grant_type","authorization_code"),O.append("client_id",_),O.append("redirect_uri",S),O.append("code",A);let q=e.get(N)?.codeVerifier;if(!q)throw new H("Unauthorized","No code verifier found in the session. Make sure that the session is configured correctly and passed to `createCustomerAccountClient`.");O.append("code_verifier",q);let re={"content-type":"application/x-www-form-urlencoded","User-Agent":Ae,Origin:l};new Date().getTime();let K=h("TOKEN_EXCHANGE"),U=await fetch(K,{method:"POST",headers:re,body:O});if(!U.ok)throw new Response(await U.text(),{status:U.status,headers:{"Content-Type":"text/html; charset=utf-8"}});let{access_token:$,expires_in:ve,id_token:k,refresh_token:Y}=await U.json(),gt=e.get(N)?.nonce,hr=await Eo(k);if(gt!==hr)throw new H("Unauthorized",`Returned nonce does not match: ${gt} !== ${hr}`);let Ar=$;r||(Ar=await To($,t,h("TOKEN_EXCHANGE"),l,{...ae(n)}));let jo=e.get(N)?.redirectPath;return e.set(N,{accessToken:Ar,expiresAt:new Date(new Date().getTime()+(ve-120)*1e3).getTime()+"",refreshToken:Y,idToken:k}),$e(jo||y)},setBuyer:qe,getBuyer:Q,UNSTABLE_setBuyer:A=>{z("[h2:warn:customerAccount] `customerAccount.UNSTABLE_setBuyer` is deprecated. Please use `customerAccount.setBuyer`."),qe(A);},UNSTABLE_getBuyer:()=>(z("[h2:warn:customerAccount] `customerAccount.UNSTABLE_getBuyer` is deprecated. Please use `customerAccount.getBuyer`."),Q())}}function Ha(e,t){return function(){try{if(!t)throw Error();new URL(e("CA_BASE_URL")),new URL(e("CA_BASE_AUTH_URL"));}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 o="Internal Server Error";throw new Response(o,{status:500})}}}function qa(e){return e.localeOverride!=null?cr(e.localeOverride):e.uiLocalesOverride!=null?cr(e.uiLocalesOverride):e.contextLanguage!=null?cr(e.contextLanguage):null}function cr(e){let r=e.toLowerCase().replaceAll("_","-").split("-"),o=r[0],n=r[1];return n?`${o}-${n.toUpperCase()}`:o}function Ba(e,t){let{env:r,request:o,cache:n,waitUntil:a,i18n:s,session:i,logErrors:c,storefront:u={},customerAccount:p,cart:y={},buyerIdentity:m}=e;i||console.warn("[h2:warn:createHydrogenContext] A session object is required to create hydrogen context."),p?.unstableB2b&&z("[h2:warn:createHydrogenContext] `customerAccount.unstableB2b` is now stable. Please remove the `unstableB2b` option.");let{storefront:g}=lo({cache:n,waitUntil:a,i18n:s,logErrors:c,storefrontHeaders:u.headers||Xr(o),storefrontApiVersion:u.apiVersion,storefrontId:r.PUBLIC_STOREFRONT_ID,storeDomain:r.PUBLIC_STORE_DOMAIN,privateStorefrontToken:r.PRIVATE_STOREFRONT_API_TOKEN,publicStorefrontToken:r.PUBLIC_STOREFRONT_API_TOKEN}),d=ur({session:i,request:o,waitUntil:a,logErrors:c,customerApiVersion:p?.apiVersion,authUrl:p?.authUrl,customAuthStatusHandler:p?.customAuthStatusHandler,useCustomAuthDomain:p?.useCustomAuthDomain,language:s?.language,customerAccountId:r.PUBLIC_CUSTOMER_ACCOUNT_API_CLIENT_ID,shopId:r.SHOP_ID}),l=tr({getCartId:y.getId||Mt(o.headers),setCartId:y.setId||Vt(),cartQueryFragment:y.queryFragment,cartMutateFragment:y.mutateFragment,customMethods:y.customMethods,buyerIdentity:m,storefront:g,customerAccount:d}),S=new RouterContextProvider;S.set(Me,g),S.set(rr,l),S.set(or,d),S.set(nr,r),S.set(ar,i),a&&S.set(sr,a);let f={storefront:g,cart:l,customerAccount:d,env:r,session:i,waitUntil:a,...t||{}};return new Proxy(S,{get(h,P,C){if(P in h){let I=h[P];return typeof I=="function"?I.bind(h):I}return P in f?f[P]:Reflect.get(h,P,C)},has(h,P){return P in h||P in f},ownKeys(h){return [...Reflect.ownKeys(h),...Object.keys(f)]},getOwnPropertyDescriptor(h,P){if(P in h)return Reflect.getOwnPropertyDescriptor(h,P);if(P in f)return {enumerable:true,configurable:true,writable:false,value:f[P]}}})}function Wa({build:e,mode:t,poweredByHeader:r=true,getLoadContext:o,collectTrackingInformation:n=true}){let a=createRequestHandler(e,t),s=r?i=>i.headers.append("powered-by","Shopify, Hydrogen"):void 0;return async i=>{let c=i.method;if((c==="GET"||c==="HEAD")&&i.body)return new Response(`${c} requests cannot have a body`,{status:400});let u=new URL(i.url);if(u.pathname.includes("//"))return new Response(null,{status:301,headers:{location:u.pathname.replace(/\/+/g,"/")}});let p=await o?.(i),y=p?.storefront||p?.get?.(Me);if(!y)throw new Error("[h2:createRequestHandler] Storefront instance is required in the load context. Make sure to use createHydrogenContext() or provide a storefront instance via getLoadContext.");if(y.isStorefrontApiUrl(i)){let d=await y.forward(i);return s?.(d),d}if(y.isMcpUrl(i)){let d=await y.forwardMcp(i);return s?.(d),d}let m=await a(i,p);n&&y.setCollectedSubrequestHeaders(m);let g=i.headers.get("sec-fetch-dest");return (g&&g==="document"||i.headers.get("accept")?.includes("text/html"))&&Te(m,{[Be]:"1"}),s?.(m),m}}var xo=createContext(void 0),Oo=xo.Provider,dr=()=>useContext(xo);function za(e){let t=dt(),r=Xa(t,e);return {nonce:t,header:r,NonceProvider:({children:n})=>createElement(Oo,{value:t},n)}}function Xa(e,t){let{shop:r,...o}=t??{},n=`'nonce-${e}'`,a=["'self'","'unsafe-inline'","https://cdn.shopify.com"],s=["'self'","https://cdn.shopify.com/","https://monorail-edge.shopifysvc.com"];r&&r.checkoutDomain&&s.push(`https://${r.checkoutDomain}`),r&&r.storeDomain&&s.push(`https://${r.storeDomain}`);let c={baseUri:["'self'"],defaultSrc:["'self'",n,"https://cdn.shopify.com","https://shopify.com"],frameAncestors:["'none'"],styleSrc:a,connectSrc:s},u=Object.assign({},c,o);for(let p in c){let y=o[p];p&&y&&(u[p]=Za(y,c[p]));}return u.scriptSrc instanceof Array?u.scriptSrc=[...u.scriptSrc.filter(p=>!p.startsWith("'nonce")),n]:u.defaultSrc instanceof Array&&(u.defaultSrc=[...u.defaultSrc.filter(p=>!p.startsWith("'nonce")),n]),Ja({directives:u})}function Za(e,t){let r=typeof t=="string"?[t]:t,o=Array.isArray(e)?e:[String(e)];return Array.isArray(r)?r.every(a=>a==="'none'")?o:[...o,...r]:r}var rs=forwardRef((e,t)=>{let{waitForHydration:r,src:o,...n}=e,a=dr();return r?jsx(os,{src:o,options:n}):jsx("script",{suppressHydrationWarning:true,...n,src:o,nonce:a,ref:t})});function os({src:e,options:t}){if(!e)throw new Error("`waitForHydration` with the Script component requires a `src` prop");return useLoadScript(e,{attributes:t}),null}async function ns(e){return e;}function ss(e){let t=useFetchers(),r={};for(let{formData:o}of t)if(o?.get("optimistic-identifier")===e)try{if(o.has("optimistic-data")){let n=JSON.parse(String(o.get("optimistic-data")));Object.assign(r,n);}}catch{}return r}function is({id:e,data:t}){return jsxs(Fragment,{children:[jsx("input",{type:"hidden",name:"optimistic-identifier",value:e}),jsx("input",{type:"hidden",name:"optimistic-data",value:JSON.stringify(t)})]})}function ls({connection:e,children:t=()=>(console.warn("<Pagination> requires children to work properly"),null),namespace:r=""}){let [o,n]=useState(false),a=useNavigation(),s=useLocation();useNavigate();useEffect(()=>{a.state==="idle"&&n(false);},[a.state]);let{endCursor:c,hasNextPage:u,hasPreviousPage:p,nextPageUrl:y,nodes:m,previousPageUrl:g,startCursor:d}=ys(e,r),l=useMemo(()=>({...s.state,pagination:{...s.state?.pagination||{},[r]:{pageInfo:{endCursor:c,hasPreviousPage:p,hasNextPage:u,startCursor:d},nodes:m}}}),[c,u,p,d,m,r,s.state]),S=useMemo(()=>forwardRef(function(h,P){return u?createElement(Link,{preventScrollReset:true,...h,to:y,state:l,replace:true,ref:P,onClick:()=>n(true)}):null}),[u,y,l]),f=useMemo(()=>forwardRef(function(h,P){return p?createElement(Link,{preventScrollReset:true,...h,to:g,state:l,replace:true,ref:P,onClick:()=>n(true)}):null}),[p,g,l]);return t({state:l,hasNextPage:u,hasPreviousPage:p,isLoading:o,nextPageUrl:y,nodes:m,previousPageUrl:g,NextLink:S,PreviousLink:f})}function lt(e,t){let r=new URLSearchParams(e);return Object.keys(t?.pagination||{}).forEach(n=>{let a=n===""?"":`${n}_`,s=`${a}cursor`,i=`${a}direction`;r.delete(s),r.delete(i);}),r.toString()}function Fe(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 ys(e,t=""){e.pageInfo||Fe("pageInfo"),typeof e.pageInfo.startCursor>"u"&&Fe("pageInfo.startCursor"),typeof e.pageInfo.endCursor>"u"&&Fe("pageInfo.endCursor"),typeof e.pageInfo.hasNextPage>"u"&&Fe("pageInfo.hasNextPage"),typeof e.pageInfo.hasPreviousPage>"u"&&Fe("pageInfo.hasPreviousPage");let r=useNavigation(),o=useNavigate(),{state:n,search:a,pathname:s}=useLocation(),i=t?`${t}_cursor`:"cursor",c=t?`${t}_direction`:"direction",y=new URLSearchParams(a).get(c)==="previous",m=useMemo(()=>!globalThis?.window?.__hydrogenHydrated||!n?.pagination?.[t]?.nodes?flattenConnection(e):y?[...flattenConnection(e),...n.pagination[t].nodes||[]]:[...n.pagination[t].nodes||[],...flattenConnection(e)],[n,e,t]),g=useMemo(()=>{let f=globalThis?.window?.__hydrogenHydrated,R=n?.pagination?.[t]?.pageInfo,h=!f||R?.startCursor===void 0?e.pageInfo.startCursor:R.startCursor,P=!f||R?.endCursor===void 0?e.pageInfo.endCursor:R.endCursor,C=!f||R?.hasPreviousPage===void 0?e.pageInfo.hasPreviousPage:R.hasPreviousPage,I=!f||R?.hasNextPage===void 0?e.pageInfo.hasNextPage:R.hasNextPage;return n?.pagination?.[t]?.nodes&&(y?(h=e.pageInfo.startCursor,C=e.pageInfo.hasPreviousPage):(P=e.pageInfo.endCursor,I=e.pageInfo.hasNextPage)),{startCursor:h,endCursor:P,hasPreviousPage:C,hasNextPage:I}},[y,n,t,e.pageInfo.hasNextPage,e.pageInfo.hasPreviousPage,e.pageInfo.startCursor,e.pageInfo.endCursor]),d=useRef({params:lt(a,n),pathname:s});useEffect(()=>{window.__hydrogenHydrated=true;},[]),useEffect(()=>{let f=lt(a,n),R=d.current.params;(s!==d.current.pathname||f!==R)&&!(r.state==="idle"&&!r.location)&&(d.current={pathname:s,params:lt(a,n)},o(`${s}?${lt(a,n)}`,{replace:true,preventScrollReset:true,state:{nodes:void 0,pageInfo:void 0}}));},[s,a,n]);let l=useMemo(()=>{let f=new URLSearchParams(a);return f.set(c,"previous"),g.startCursor&&f.set(i,g.startCursor),`?${f.toString()}`},[a,g.startCursor]),S=useMemo(()=>{let f=new URLSearchParams(a);return f.set(c,"next"),g.endCursor&&f.set(i,g.endCursor),`?${f.toString()}`},[a,g.endCursor]);return {...g,previousPageUrl:l,nextPageUrl:S,nodes:m}}function fs(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,namespace:o=""}=t,n=new URLSearchParams(new URL(e.url).search),a=o?`${o}_cursor`:"cursor",s=o?`${o}_direction`:"direction",i=n.get(a)??void 0;return (n.get(s)==="previous"?"previous":"next")==="previous"?{last:r,startCursor:i??null}:{first:r,endCursor:i??null}}function hs(e,t){let r=useNavigation(),[o,n]=useState([]);if(useEffect(()=>{Promise.resolve(t).then(a=>{a&&n(a instanceof Array?a:a.product?.variants?.nodes||[]);}).catch(a=>{reportError(new Error("[h2:error:useOptimisticVariant] An error occurred while resolving the variants for the optimistic product hook.",{cause:a}));});},[JSON.stringify(t)]),r.state==="loading"){let a=new URLSearchParams(r.location.search),s=false,i=o.find(c=>c.selectedOptions?c.selectedOptions.every(u=>a.get(u.name)===u.value):(s||(s=true,reportError(new Error("[h2:error:useOptimisticVariant] The optimistic product hook requires your product query to include variants with the selectedOptions field."))),false));if(i)return {...i,isOptimistic:true}}return e}function Is({handle:e,options:t=[],variants:r=[],productPath:o="products",waitForNavigation:n=false,selectedVariant:a,children:s}){let i=t;i[0]?.values&&(z("[h2:warn:VariantSelector] product.options.values is deprecated. Use product.options.optionValues instead."),i[0]&&!i[0].optionValues&&(i=t.map(d=>({...d,optionValues:d.values?.map(l=>({name:l}))||[]}))));let c=r instanceof Array?r:flattenConnection(r),{searchParams:u,path:p,alreadyOnProductPage:y}=Es(e,o,n),m=i.filter(d=>d?.optionValues?.length===1),g=a?a?.selectedOptions?.reduce((d,l)=>(d[l.name]=l.value,d),{}):{};return createElement(Fragment$1,null,...useMemo(()=>i.map(d=>{let l,S=[];for(let f of d.optionValues){let R=new URLSearchParams(y?u:void 0);R.set(d.name,f.name),m.forEach(v=>{v.optionValues[0].name&&R.set(v.name,v.optionValues[0].name);});let h=c.find(v=>v?.selectedOptions?.every(x=>(R.get(x?.name)||g?.[x?.name])===x?.value)),P=u.get(d.name);!P&&a&&(P=g?.[d.name]||null);let C=P?P===f.name:false;C&&(l=f.name);let I="?"+R.toString();S.push({value:f.name,optionValue:f,isAvailable:h?h.availableForSale:true,to:p+I,search:I,isActive:C,variant:h});}return s({option:{name:d.name,value:l,values:S}})}),[i,c,s]))}var Ts=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,n)=>{r.push({name:n,value:o});}),r};function Es(e,t,r){let{pathname:o,search:n}=useLocation(),a=useNavigation();return useMemo(()=>{let s=/(\/[a-zA-Z]{2}-[a-zA-Z]{2}\/)/g.exec(o),i=s&&s.length>0;t=t.startsWith("/")?t.substring(1):t;let c=i?`${s[0]}${t}/${e}`:`/${t}/${e}`;return {searchParams:new URLSearchParams(r||a.state!=="loading"?n:a.location.search),alreadyOnProductPage:c===o,path:c}},[o,n,r,e,t,a])}function bs(){return {name:"hydrogen-2025.7.0",reactRouterConfig:()=>({appDirectory:"app",buildDirectory:"dist",ssr:true,future:{v8_middleware:true,v8_splitRouteModules:true,v8_viteEnvironmentApi:false,unstable_optimizeDeps:true,unstable_subResourceIntegrity:false}}),reactRouterConfigResolved:({reactRouterConfig:e})=>{if(e.basename&&e.basename!=="/")throw new Error(`[Hydrogen Preset] basename is not supported in Hydrogen 2025.7.0.
575
575
  Reason: Requires major CLI infrastructure modernization.
576
576
  Workaround: Use reverse proxy or CDN path rewriting for subdirectory hosting.`);if(e.prerender)throw new Error(`[Hydrogen Preset] prerender is not supported in Hydrogen 2025.7.0.
577
577
  Reason: React Router plugin incompatibility with Hydrogen CLI build pipeline.
@@ -581,12 +581,12 @@ Alternative: Route-level code splitting via v8_splitRouteModules is enabled.`);i
581
581
  Reason: Hydrogen CLI bypasses React Router buildEnd hook execution.
582
582
  Workaround: Use external build scripts or package.json post-build hooks.`);if(e.future?.unstable_subResourceIntegrity===true)throw new Error(`[Hydrogen Preset] unstable_subResourceIntegrity cannot be enabled.
583
583
  Reason: Conflicts with Hydrogen CSP nonce-based authentication.
584
- Impact: Would break Content Security Policy and cause script execution failures.`)}}}var Os=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}})};var xs=async function({request:t,context:r}){let o=r.storefront,n=r.customerAccount,a=new URL(t.url);if(!o)throw new Error("GraphiQL: Hydrogen's storefront client must be injected in the loader context.");let s={};if(o){let u="X-Shopify-Storefront-Access-Token";s.storefront={name:"Storefront API",authHeader:u,accessToken:o.getPublicTokenHeaders()[u],apiUrl:o.getApiUrl(),icon:"SF"};}if(n){let u=await(await fetch(a.origin+"/graphiql/customer-account.schema.json")).json(),p=await n.getAccessToken();u&&(s["customer-account"]={name:"Customer Account API",value:u,authHeader:"Authorization",accessToken:p,apiUrl:n.getApiUrl(),icon:"CA"});}let c="https://avatars.githubusercontent.com/u/12972006?s=48&v=4",i=String.raw;return new Response(i`
584
+ Impact: Would break Content Security Policy and cause script execution failures.`)}}}var xs=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}})};var Os=async function({request:t,context:r}){let o=r.storefront,n=r.customerAccount,a=new URL(t.url);if(!o)throw new Error("GraphiQL: Hydrogen's storefront client must be injected in the loader context.");let s={};if(o){let u="X-Shopify-Storefront-Access-Token";s.storefront={name:"Storefront API",authHeader:u,accessToken:o.getPublicTokenHeaders()[u],apiUrl:o.getApiUrl(),icon:"SF"};}if(n){let u=await(await fetch(a.origin+"/graphiql/customer-account.schema.json")).json(),p=await n.getAccessToken();u&&(s["customer-account"]={name:"Customer Account API",value:u,authHeader:"Authorization",accessToken:p,apiUrl:n.getApiUrl(),icon:"CA"});}let i="https://avatars.githubusercontent.com/u/12972006?s=48&v=4",c=String.raw;return new Response(c`
585
585
  <!DOCTYPE html>
586
586
  <html lang="en">
587
587
  <head>
588
588
  <title>GraphiQL</title>
589
- <link rel="icon" type="image/x-icon" href="${c}" />
589
+ <link rel="icon" type="image/x-icon" href="${i}" />
590
590
  <meta charset="utf-8" />
591
591
  <style>
592
592
  body {
@@ -900,7 +900,7 @@ Impact: Would break Content Security Policy and cause script execution failures.
900
900
  </div>
901
901
  </body>
902
902
  </html>
903
- `,{status:200,headers:{"content-type":"text/html"}})};async function _s(e){let{storefront:t,request:r,noAdminRedirect:o,matchQueryParams:n,response:a=new Response("Not Found",{status:404})}=e,s=new URL(r.url),{pathname:c,searchParams:i}=s,u=i.has("_data");i.delete("redirect"),i.delete("return_to"),i.delete("_data");let p=(n?s.toString().replace(s.origin,""):c).toLowerCase();if(s.pathname==="/admin"&&!o)return fr(`${t.getShopifyDomain()}/admin`,u,i,n);try{let{urlRedirects:y}=await t.query(Ls,{variables:{query:"path:"+p.replace(/\/+$/,"")}}),m=y?.edges?.[0]?.node?.target;if(m)return fr(m,u,i,n);let g=pt(r.url);if(g)return fr(g,u,i,n)}catch(y){console.error(`Failed to fetch redirects from Storefront API for route ${p}`,y);}return a}var yr="https://example.com";function fr(e,t,r,o){let n=new URL(e,yr);if(!o)for(let[a,s]of r)n.searchParams.append(a,s);return t?new Response(null,{status:200,headers:{"X-Remix-Redirect":n.toString().replace(yr,""),"X-Remix-Status":"301"}}):new Response(null,{status:301,headers:{location:n.toString().replace(yr,"")}})}var Ls=`#graphql
903
+ `,{status:200,headers:{"content-type":"text/html"}})};async function _s(e){let{storefront:t,request:r,noAdminRedirect:o,matchQueryParams:n,response:a=new Response("Not Found",{status:404})}=e,s=new URL(r.url),{pathname:i,searchParams:c}=s,u=c.has("_data");c.delete("redirect"),c.delete("return_to"),c.delete("_data");let p=(n?s.toString().replace(s.origin,""):i).toLowerCase();if(s.pathname==="/admin"&&!o)return fr(`${t.getShopifyDomain()}/admin`,u,c,n);try{let{urlRedirects:y}=await t.query(Ls,{variables:{query:"path:"+p.replace(/\/+$/,"")}}),m=y?.edges?.[0]?.node?.target;if(m)return fr(m,u,c,n);let g=pt(r.url);if(g)return fr(g,u,c,n)}catch(y){console.error(`Failed to fetch redirects from Storefront API for route ${p}`,y);}return a}var yr="https://example.com";function fr(e,t,r,o){let n=new URL(e,yr);if(!o)for(let[a,s]of r)n.searchParams.append(a,s);return t?new Response(null,{status:200,headers:{"X-Remix-Redirect":n.toString().replace(yr,""),"X-Remix-Status":"301"}}):new Response(null,{status:301,headers:{location:n.toString().replace(yr,"")}})}var Ls=`#graphql
904
904
  query redirects($query: String) {
905
905
  urlRedirects(first: 1, query: $query) {
906
906
  edges {
@@ -910,21 +910,21 @@ Impact: Would break Content Security Policy and cause script execution failures.
910
910
  }
911
911
  }
912
912
  }
913
- `;var Us={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},ks=/[&><\u2028\u2029]/g;function qo(e){return e.replace(ks,t=>Us[t])}var se="Error in SEO input: ",ee={title:{validate:e=>{if(typeof e!="string")throw new Error(se.concat("`title` should be a string"));if(typeof e=="string"&&e.length>70)throw new Error(se.concat("`title` should not be longer than 70 characters"));return e}},description:{validate:e=>{if(typeof e!="string")throw new Error(se.concat("`description` should be a string"));if(typeof e=="string"&&e.length>155)throw new Error(se.concat("`description` should not be longer than 160 characters"));return e}},url:{validate:e=>{if(typeof e!="string")throw new Error(se.concat("`url` should be a string"));if(typeof e=="string"&&!e.startsWith("http"))throw new Error(se.concat("`url` should be a valid URL"));return e}},handle:{validate:e=>{if(typeof e!="string")throw new Error(se.concat("`handle` should be a string"));if(typeof e=="string"&&!e.startsWith("@"))throw new Error(se.concat("`handle` should start with `@`"));return e}}};function Go(e){let t=[];for(let r of Object.keys(e))switch(r){case "title":{let o=te(ee.title,e.title),n=gr(e?.titleTemplate,o);if(!n)break;t.push(M("title",{title:n}),M("meta",{property:"og:title",content:n}),M("meta",{name:"twitter:title",content:n}));break}case "description":{let o=te(ee.description,e.description);if(!o)break;t.push(M("meta",{name:"description",content:o}),M("meta",{property:"og:description",content:o}),M("meta",{name:"twitter:description",content:o}));break}case "url":{let o=te(ee.url,e.url);if(!o)break;let a=o.split("?")[0].replace(/\/$/,"");t.push(M("link",{rel:"canonical",href:a}),M("meta",{property:"og:url",content:a}));break}case "handle":{let o=te(ee.handle,e.handle);if(!o)break;t.push(M("meta",{name:"twitter:site",content:o}),M("meta",{name:"twitter:creator",content:o}));break}case "media":{let o,n=ie(e.media);for(let a of n)if(typeof a=="string"&&t.push(M("meta",{name:"og:image",content:a})),a&&typeof a=="object"){let s=a.type||"image",c=a?{url:a?.url,secure_url:a?.url,type:Cr(a.url),width:a?.width,height:a?.height,alt:a?.altText}:{};for(let i of Object.keys(c))c[i]&&(o=c[i],t.push(M("meta",{property:`og:${s}:${i}`,content:o},c.url)));}break}case "jsonLd":{let o=ie(e.jsonLd),n=0;for(let a of o){if(typeof a!="object")continue;let s=M("script",{type:"application/ld+json",children:JSON.stringify(a,(c,i)=>typeof i=="string"?qo(i):i)},`json-ld-${a?.["@type"]||a?.name||n++}`);t.push(s);}break}case "alternates":{let o=ie(e.alternates);for(let n of o){if(!n)continue;let{language:a,url:s,default:c}=n,i=a?`${a}${c?"-default":""}`:void 0;t.push(M("link",{rel:"alternate",hrefLang:i,href:s}));}break}case "robots":{if(!e.robots)break;let{maxImagePreview:o,maxSnippet:n,maxVideoPreview:a,noArchive:s,noFollow:c,noImageIndex:i,noIndex:u,noSnippet:p,noTranslate:y,unavailableAfter:m}=e.robots,g=[s&&"noarchive",i&&"noimageindex",p&&"nosnippet",y&&"notranslate",o&&`max-image-preview:${o}`,n&&`max-snippet:${n}`,a&&`max-video-preview:${a}`,m&&`unavailable_after:${m}`],d=(u?"noindex":"index")+","+(c?"nofollow":"follow");for(let l of g)l&&(d+=`,${l}`);t.push(M("meta",{name:"robots",content:d}));break}}return t.flat().sort((r,o)=>r.key.localeCompare(o.key))}function M(e,t,r){let o={tag:e,props:{},key:""};return e==="title"?(o.children=t.title,o.key=mr(o),o):e==="script"?(o.children=typeof t.children=="string"?t.children:"",o.key=mr(o,r),delete t.children,o.props=t,o):(o.props=t,Object.keys(o.props).forEach(n=>!o.props[n]&&delete o.props[n]),o.key=mr(o,r),o)}function mr(e,t){let{tag:r,props:o}=e;if(r==="title")return "0-title";if(r==="meta"){let n=o.content===t&&typeof o.property=="string"&&!o.property.endsWith("secure_url")&&"0";return [r,...[t,n],o.property||o.name].filter(s=>s).join("-")}return r==="link"?[r,o.rel,o.hrefLang||o.media].filter(a=>a).join("-").replace(/\s+/g,"-"):r==="script"?`${r}-${t}`:`${r}-${o.type}`}function gr(e,t){if(t)return e?typeof e=="function"?e(t):e.replace("%s",t??""):t}function Cr(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";default:return "image/jpeg"}}function ie(e){return Array.isArray(e)?e:[e]}function te(e,t){try{return e.validate(t)}catch(r){return console.warn(r.message),t}}function Ns(...e){let t=[],r=e.reduce((o,n)=>{if(!n)return o;Object.keys(n).forEach(s=>!n[s]&&delete n[s]);let{jsonLd:a}=n;return a?o?.jsonLd?{...o,...n,jsonLd:ie(o.jsonLd).concat(a)}:{...o,...n,jsonLd:[a]}:{...o,...n}},{})||{};for(let o of Object.keys(r))switch(o){case "title":{let n=te(ee.title,r.title),a=gr(r?.titleTemplate,n);if(!a)break;t.push({title:a},{property:"og:title",content:a},{property:"twitter:title",content:a});break}case "description":{let n=te(ee.description,r.description);if(!n)break;t.push({name:"description",content:n},{property:"og:description",content:n},{property:"twitter:description",content:n});break}case "url":{let n=te(ee.url,r.url);if(!n)break;let s=n.split("?")[0].replace(/\/$/,"");t.push({tagName:"link",rel:"canonical",href:s},{property:"og:url",content:s});break}case "handle":{let n=te(ee.handle,r.handle);if(!n)break;t.push({property:"twitter:site",content:n},{property:"twitter:creator",content:n});break}case "media":{let n,a=ie(r.media);for(let s of a)if(typeof s=="string"&&t.push({property:"og:image",content:s}),s&&typeof s=="object"){let c=s.type||"image",i=s?{url:s?.url,secure_url:s?.url,type:Cr(s.url),width:s?.width,height:s?.height,alt:s?.altText}:{};for(let u of Object.keys(i))i[u]&&(n=i[u],t.push({property:`og:${c}:${u}`,content:n}));}break}case "jsonLd":{let n=ie(r.jsonLd);for(let s of n)typeof s!="object"||Object.keys(s).length===0||t.push({"script:ld+json":s});break}case "alternates":{let n=ie(r.alternates);for(let a of n){if(!a)continue;let{language:s,url:c,default:i}=a,u=s?`${s}${i?"-default":""}`:void 0;t.push({tagName:"link",rel:"alternate",hrefLang:u,href:c});}break}case "robots":{if(!r.robots)break;let{maxImagePreview:n,maxSnippet:a,maxVideoPreview:s,noArchive:c,noFollow:i,noImageIndex:u,noIndex:p,noSnippet:y,noTranslate:m,unavailableAfter:g}=r.robots,d=[c&&"noarchive",u&&"noimageindex",y&&"nosnippet",m&&"notranslate",n&&`max-image-preview:${n}`,a&&`max-snippet:${a}`,s&&`max-video-preview:${s}`,g&&`unavailable_after:${g}`],l=(p?"noindex":"index")+","+(i?"nofollow":"follow");for(let S of d)S&&(l+=`,${S}`);t.push({name:"robots",content:l});break}}return t}var qs=lazy(()=>import('./log-seo-tags-TY72EQWZ.js'));function Gs({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/utilities/getseometa");let o=useMemo(()=>t.flatMap(s=>{let{handle:c,...i}=s,u={...i,...r},p=c?.seo,y=i?.data?.seo;return !p&&!y?[]:p?yt(p,u):[y]}).reduce((s,c)=>{Object.keys(c).forEach(u=>!c[u]&&delete c[u]);let{jsonLd:i}=c;return i?s?.jsonLd?Array.isArray(i)?{...s,...c,jsonLd:[...s.jsonLd,...i]}:{...s,...c,jsonLd:[...s.jsonLd,i]}:{...s,...c,jsonLd:[i]}:{...s,...c}},{}),[t,r]),{html:n,loggerMarkup:a}=useMemo(()=>{let s=Go(o),c=s.map(u=>u.tag==="script"?createElement(u.tag,{...u.props,key:u.key,dangerouslySetInnerHTML:{__html:u.children}}):createElement(u.tag,{...u.props,key:u.key},u.children)),i=createElement(Suspense,{fallback:null},createElement(qs,{headTags:s}));return {html:c,loggerMarkup:i}},[o]);return createElement(Fragment$1,null,n,e&&a)}function yt(e,...t){if(e instanceof Function)return yt(e(...t),...t);let r={};return Array.isArray(e)?(r=e.reduce((o,n)=>[...o,yt(n)],[]),r):e instanceof Object?(Object.entries(e).forEach(([n,a])=>{r[n]=yt(a,...t);}),r):e}function Qs(e){return jsx(ShopPayButton,{channel:"hydrogen",...e})}var js=`<?xml version="1.0" encoding="UTF-8"?>
913
+ `;var Us={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},ks=/[&><\u2028\u2029]/g;function qo(e){return e.replace(ks,t=>Us[t])}var se="Error in SEO input: ",ee={title:{validate:e=>{if(typeof e!="string")throw new Error(se.concat("`title` should be a string"));if(typeof e=="string"&&e.length>70)throw new Error(se.concat("`title` should not be longer than 70 characters"));return e}},description:{validate:e=>{if(typeof e!="string")throw new Error(se.concat("`description` should be a string"));if(typeof e=="string"&&e.length>155)throw new Error(se.concat("`description` should not be longer than 160 characters"));return e}},url:{validate:e=>{if(typeof e!="string")throw new Error(se.concat("`url` should be a string"));if(typeof e=="string"&&!e.startsWith("http"))throw new Error(se.concat("`url` should be a valid URL"));return e}},handle:{validate:e=>{if(typeof e!="string")throw new Error(se.concat("`handle` should be a string"));if(typeof e=="string"&&!e.startsWith("@"))throw new Error(se.concat("`handle` should start with `@`"));return e}}};function Go(e){let t=[];for(let r of Object.keys(e))switch(r){case "title":{let o=te(ee.title,e.title),n=gr(e?.titleTemplate,o);if(!n)break;t.push(M("title",{title:n}),M("meta",{property:"og:title",content:n}),M("meta",{name:"twitter:title",content:n}));break}case "description":{let o=te(ee.description,e.description);if(!o)break;t.push(M("meta",{name:"description",content:o}),M("meta",{property:"og:description",content:o}),M("meta",{name:"twitter:description",content:o}));break}case "url":{let o=te(ee.url,e.url);if(!o)break;let a=o.split("?")[0].replace(/\/$/,"");t.push(M("link",{rel:"canonical",href:a}),M("meta",{property:"og:url",content:a}));break}case "handle":{let o=te(ee.handle,e.handle);if(!o)break;t.push(M("meta",{name:"twitter:site",content:o}),M("meta",{name:"twitter:creator",content:o}));break}case "media":{let o,n=ie(e.media);for(let a of n)if(typeof a=="string"&&t.push(M("meta",{name:"og:image",content:a})),a&&typeof a=="object"){let s=a.type||"image",i=a?{url:a?.url,secure_url:a?.url,type:Cr(a.url),width:a?.width,height:a?.height,alt:a?.altText}:{};for(let c of Object.keys(i))i[c]&&(o=i[c],t.push(M("meta",{property:`og:${s}:${c}`,content:o},i.url)));}break}case "jsonLd":{let o=ie(e.jsonLd),n=0;for(let a of o){if(typeof a!="object")continue;let s=M("script",{type:"application/ld+json",children:JSON.stringify(a,(i,c)=>typeof c=="string"?qo(c):c)},`json-ld-${a?.["@type"]||a?.name||n++}`);t.push(s);}break}case "alternates":{let o=ie(e.alternates);for(let n of o){if(!n)continue;let{language:a,url:s,default:i}=n,c=a?`${a}${i?"-default":""}`:void 0;t.push(M("link",{rel:"alternate",hrefLang:c,href:s}));}break}case "robots":{if(!e.robots)break;let{maxImagePreview:o,maxSnippet:n,maxVideoPreview:a,noArchive:s,noFollow:i,noImageIndex:c,noIndex:u,noSnippet:p,noTranslate:y,unavailableAfter:m}=e.robots,g=[s&&"noarchive",c&&"noimageindex",p&&"nosnippet",y&&"notranslate",o&&`max-image-preview:${o}`,n&&`max-snippet:${n}`,a&&`max-video-preview:${a}`,m&&`unavailable_after:${m}`],d=(u?"noindex":"index")+","+(i?"nofollow":"follow");for(let l of g)l&&(d+=`,${l}`);t.push(M("meta",{name:"robots",content:d}));break}}return t.flat().sort((r,o)=>r.key.localeCompare(o.key))}function M(e,t,r){let o={tag:e,props:{},key:""};return e==="title"?(o.children=t.title,o.key=mr(o),o):e==="script"?(o.children=typeof t.children=="string"?t.children:"",o.key=mr(o,r),delete t.children,o.props=t,o):(o.props=t,Object.keys(o.props).forEach(n=>!o.props[n]&&delete o.props[n]),o.key=mr(o,r),o)}function mr(e,t){let{tag:r,props:o}=e;if(r==="title")return "0-title";if(r==="meta"){let n=o.content===t&&typeof o.property=="string"&&!o.property.endsWith("secure_url")&&"0";return [r,...[t,n],o.property||o.name].filter(s=>s).join("-")}return r==="link"?[r,o.rel,o.hrefLang||o.media].filter(a=>a).join("-").replace(/\s+/g,"-"):r==="script"?`${r}-${t}`:`${r}-${o.type}`}function gr(e,t){if(t)return e?typeof e=="function"?e(t):e.replace("%s",t??""):t}function Cr(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";default:return "image/jpeg"}}function ie(e){return Array.isArray(e)?e:[e]}function te(e,t){try{return e.validate(t)}catch(r){return console.warn(r.message),t}}function Ns(...e){let t=[],r=e.reduce((o,n)=>{if(!n)return o;Object.keys(n).forEach(s=>!n[s]&&delete n[s]);let{jsonLd:a}=n;return a?o?.jsonLd?{...o,...n,jsonLd:ie(o.jsonLd).concat(a)}:{...o,...n,jsonLd:[a]}:{...o,...n}},{})||{};for(let o of Object.keys(r))switch(o){case "title":{let n=te(ee.title,r.title),a=gr(r?.titleTemplate,n);if(!a)break;t.push({title:a},{property:"og:title",content:a},{property:"twitter:title",content:a});break}case "description":{let n=te(ee.description,r.description);if(!n)break;t.push({name:"description",content:n},{property:"og:description",content:n},{property:"twitter:description",content:n});break}case "url":{let n=te(ee.url,r.url);if(!n)break;let s=n.split("?")[0].replace(/\/$/,"");t.push({tagName:"link",rel:"canonical",href:s},{property:"og:url",content:s});break}case "handle":{let n=te(ee.handle,r.handle);if(!n)break;t.push({property:"twitter:site",content:n},{property:"twitter:creator",content:n});break}case "media":{let n,a=ie(r.media);for(let s of a)if(typeof s=="string"&&t.push({property:"og:image",content:s}),s&&typeof s=="object"){let i=s.type||"image",c=s?{url:s?.url,secure_url:s?.url,type:Cr(s.url),width:s?.width,height:s?.height,alt:s?.altText}:{};for(let u of Object.keys(c))c[u]&&(n=c[u],t.push({property:`og:${i}:${u}`,content:n}));}break}case "jsonLd":{let n=ie(r.jsonLd);for(let s of n)typeof s!="object"||Object.keys(s).length===0||t.push({"script:ld+json":s});break}case "alternates":{let n=ie(r.alternates);for(let a of n){if(!a)continue;let{language:s,url:i,default:c}=a,u=s?`${s}${c?"-default":""}`:void 0;t.push({tagName:"link",rel:"alternate",hrefLang:u,href:i});}break}case "robots":{if(!r.robots)break;let{maxImagePreview:n,maxSnippet:a,maxVideoPreview:s,noArchive:i,noFollow:c,noImageIndex:u,noIndex:p,noSnippet:y,noTranslate:m,unavailableAfter:g}=r.robots,d=[i&&"noarchive",u&&"noimageindex",y&&"nosnippet",m&&"notranslate",n&&`max-image-preview:${n}`,a&&`max-snippet:${a}`,s&&`max-video-preview:${s}`,g&&`unavailable_after:${g}`],l=(p?"noindex":"index")+","+(c?"nofollow":"follow");for(let S of d)S&&(l+=`,${S}`);t.push({name:"robots",content:l});break}}return t}var qs=lazy(()=>import('./log-seo-tags-TY72EQWZ.js'));function Gs({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/utilities/getseometa");let o=useMemo(()=>t.flatMap(s=>{let{handle:i,...c}=s,u={...c,...r},p=i?.seo,y=c?.data?.seo;return !p&&!y?[]:p?yt(p,u):[y]}).reduce((s,i)=>{Object.keys(i).forEach(u=>!i[u]&&delete i[u]);let{jsonLd:c}=i;return c?s?.jsonLd?Array.isArray(c)?{...s,...i,jsonLd:[...s.jsonLd,...c]}:{...s,...i,jsonLd:[...s.jsonLd,c]}:{...s,...i,jsonLd:[c]}:{...s,...i}},{}),[t,r]),{html:n,loggerMarkup:a}=useMemo(()=>{let s=Go(o),i=s.map(u=>u.tag==="script"?createElement(u.tag,{...u.props,key:u.key,dangerouslySetInnerHTML:{__html:u.children}}):createElement(u.tag,{...u.props,key:u.key},u.children)),c=createElement(Suspense,{fallback:null},createElement(qs,{headTags:s}));return {html:i,loggerMarkup:c}},[o]);return createElement(Fragment$1,null,n,e&&a)}function yt(e,...t){if(e instanceof Function)return yt(e(...t),...t);let r={};return Array.isArray(e)?(r=e.reduce((o,n)=>[...o,yt(n)],[]),r):e instanceof Object?(Object.entries(e).forEach(([n,a])=>{r[n]=yt(a,...t);}),r):e}function Qs(e){return jsx(ShopPayButton,{channel:"hydrogen",...e})}var js=`<?xml version="1.0" encoding="UTF-8"?>
914
914
  <sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
915
915
  `,Ks=`
916
916
  </sitemapindex>`,Qo=`<?xml version="1.0" encoding="UTF-8"?>
917
- <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">`,Wo="</urlset>";async function Ys(e){let{storefront:t,request:r,types:o=["products","pages","collections","metaObjects","articles","blogs"],customChildSitemaps:n=[]}=e;if(!r||!r.url)throw new Error("A request object is required to generate a sitemap index");if(!t||!t.query)throw new Error("A storefront client is required to generate a sitemap index");let a=await t.query(si);if(!a)throw console.warn("[h2:sitemap:warning] Sitemap index is available in API version 2024-10 and later"),new Response("Sitemap index not found.",{status:404});let s=new URL(r.url).origin,c=js+o.map(i=>{if(!a[i])throw new Error(`[h2:sitemap:error] No data found for type ${i}. Check types passed to \`getSitemapIndex\``);return zs(i,a[i].pagesCount.count,s)}).join(`
918
- `)+n.map(i=>" <sitemap><loc>"+(s+(i.startsWith("/")?i:"/"+i))+"</loc></sitemap>").join(`
919
- `)+Ks;return new Response(c,{headers:{"Content-Type":"application/xml","Cache-Control":`max-age=${3600*24}`}})}async function Js(e){let{storefront:t,request:r,params:o,getLink:n,locales:a=[],getChangeFreq:s,noItemsFallback:c="/"}=e;if(!o)throw new Error("[h2:sitemap:error] Remix params object is required to generate a sitemap");if(!r||!r.url)throw new Error("A request object is required to generate a sitemap");if(!t||!t.query)throw new Error("A storefront client is required to generate a index");if(!n)throw new Error("A `getLink` function to generate each resource is required to build a sitemap");if(!o.type||!o.page)throw new Response("No data found",{status:404});let i=o.type,u=ii[i];if(!u)throw new Response("Not found",{status:404});let p=await t.query(u,{variables:{page:parseInt(o.page,10)}});if(!p)throw console.warn("[h2:sitemap:warning] Sitemap is available in API version 2024-10 and later"),new Response("Sitemap not found.",{status:404});let y=new URL(r.url).origin,m="";return p?.sitemap?.resources?.items?.length?m=Qo+p.sitemap.resources.items.map(g=>Xs({getChangeFreq:s,url:n({type:g.type??i,baseUrl:y,handle:g.handle}),type:i,getLink:n,updatedAt:g.updatedAt,handle:g.handle,metaobjectType:g.type,locales:a,baseUrl:y})).join(`
917
+ <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">`,Wo="</urlset>";async function Ys(e){let{storefront:t,request:r,types:o=["products","pages","collections","metaObjects","articles","blogs"],customChildSitemaps:n=[]}=e;if(!r||!r.url)throw new Error("A request object is required to generate a sitemap index");if(!t||!t.query)throw new Error("A storefront client is required to generate a sitemap index");let a=await t.query(si);if(!a)throw console.warn("[h2:sitemap:warning] Sitemap index is available in API version 2024-10 and later"),new Response("Sitemap index not found.",{status:404});let s=new URL(r.url).origin,i=js+o.map(c=>{if(!a[c])throw new Error(`[h2:sitemap:error] No data found for type ${c}. Check types passed to \`getSitemapIndex\``);return zs(c,a[c].pagesCount.count,s)}).join(`
918
+ `)+n.map(c=>" <sitemap><loc>"+(s+(c.startsWith("/")?c:"/"+c))+"</loc></sitemap>").join(`
919
+ `)+Ks;return new Response(i,{headers:{"Content-Type":"application/xml","Cache-Control":`max-age=${3600*24}`}})}async function Js(e){let{storefront:t,request:r,params:o,getLink:n,locales:a=[],getChangeFreq:s,noItemsFallback:i="/"}=e;if(!o)throw new Error("[h2:sitemap:error] Remix params object is required to generate a sitemap");if(!r||!r.url)throw new Error("A request object is required to generate a sitemap");if(!t||!t.query)throw new Error("A storefront client is required to generate a index");if(!n)throw new Error("A `getLink` function to generate each resource is required to build a sitemap");if(!o.type||!o.page)throw new Response("No data found",{status:404});let c=o.type,u=ii[c];if(!u)throw new Response("Not found",{status:404});let p=await t.query(u,{variables:{page:parseInt(o.page,10)}});if(!p)throw console.warn("[h2:sitemap:warning] Sitemap is available in API version 2024-10 and later"),new Response("Sitemap not found.",{status:404});let y=new URL(r.url).origin,m="";return p?.sitemap?.resources?.items?.length?m=Qo+p.sitemap.resources.items.map(g=>Xs({getChangeFreq:s,url:n({type:g.type??c,baseUrl:y,handle:g.handle}),type:c,getLink:n,updatedAt:g.updatedAt,handle:g.handle,metaobjectType:g.type,locales:a,baseUrl:y})).join(`
920
920
  `)+Wo:m=Qo+`
921
- <url><loc>${y+c}</loc></url>
921
+ <url><loc>${y+i}</loc></url>
922
922
  `+Wo,new Response(m,{headers:{"Content-Type":"application/xml","Cache-Control":`max-age=${3600*24}`}})}function zs(e,t,r){let o="";for(let n=1;n<=t;n++)o+=` <sitemap><loc>${r}/sitemap/${e}/${n}.xml</loc></sitemap>
923
- `;return o}function Xs({url:e,updatedAt:t,locales:r,type:o,getLink:n,baseUrl:a,handle:s,getChangeFreq:c,metaobjectType:i}){return `<url>
923
+ `;return o}function Xs({url:e,updatedAt:t,locales:r,type:o,getLink:n,baseUrl:a,handle:s,getChangeFreq:i,metaobjectType:c}){return `<url>
924
924
  <loc>${e}</loc>
925
925
  <lastmod>${t}</lastmod>
926
- <changefreq>${c?c({type:i??o,handle:s}):"weekly"}</changefreq>
927
- ${r.map(u=>Zs(n({type:i??o,baseUrl:a,handle:s,locale:u}),u)).join(`
926
+ <changefreq>${i?i({type:c??o,handle:s}):"weekly"}</changefreq>
927
+ ${r.map(u=>Zs(n({type:c??o,baseUrl:a,handle:s,locale:u}),u)).join(`
928
928
  `)}
929
929
  </url>
930
930
  `.trim()}function Zs(e,t){return ` <xhtml:link rel="alternate" hreflang="${t}" href="${e}" />`}var ei=`#graphql
@@ -1039,13 +1039,13 @@ query SitemapIndex {
1039
1039
  //! @see https://shopify.dev/docs/api/storefront/latest/mutations/cartNoteUpdate
1040
1040
  //! @see https://shopify.dev/docs/api/storefront/latest/mutations/cartSelectedDeliveryOptionsUpdate
1041
1041
  //! @see https://shopify.dev/docs/api/storefront/latest/mutations/cartMetafieldsSet
1042
- //! @see https://shopify.dev/docs/api/storefront/2026-01/mutations/cartMetafieldDelete
1042
+ //! @see https://shopify.dev/docs/api/storefront/2026-04/mutations/cartMetafieldDelete
1043
1043
  //! @see https://shopify.dev/docs/api/storefront/latest/mutations/cartGiftCardCodesUpdate
1044
1044
  //! @see https://shopify.dev/docs/api/storefront/latest/mutations/cartGiftCardCodesAdd
1045
1045
  //! @see https://shopify.dev/docs/api/storefront/latest/mutations/cartGiftCardCodesRemove
1046
1046
  //! @see: https://shopify.dev/docs/api/storefront/latest/mutations/cartDeliveryAddressesAdd
1047
1047
  //! @see: https://shopify.dev/docs/api/storefront/latest/mutations/cartDeliveryAddressesRemove
1048
1048
  //! @see: https://shopify.dev/docs/api/storefront/latest/mutations/cartDeliveryAddressesUpdate
1049
- //! @see: https://shopify.dev/docs/api/storefront/2026-01/mutations/cartDeliveryAddressesReplace
1050
- export{Mn as Analytics,F as AnalyticsEvent,Lt as CacheCustom,_t as CacheLong,Ot as CacheNone,ue as CacheShort,Z as CartForm,Nt as InMemoryCache,xo as NonceProvider,is as OptimisticInput,ls as Pagination,Os as RichText,rs as Script,Gs as Seo,Qs as ShopPayButton,Is as VariantSelector,Yt as cartAttributesUpdateDefault,Wt as cartBuyerIdentityUpdateDefault,Ht as cartCreateDefault,Qt as cartDiscountCodesUpdateDefault,Ft as cartGetDefault,Mt as cartGetIdDefault,Zt as cartGiftCardCodesAddDefault,er as cartGiftCardCodesRemoveDefault,Xt as cartGiftCardCodesUpdateDefault,qt as cartLinesAddDefault,Bt as cartLinesRemoveDefault,Gt as cartLinesUpdateDefault,zt as cartMetafieldDeleteDefault,Jt as cartMetafieldsSetDefault,jt as cartNoteUpdateDefault,Kt as cartSelectedDeliveryOptionsUpdateDefault,Vt as cartSetIdDefault,xa as changelogHandler,tr as createCartHandler,za as createContentSecurityPolicy,ur as createCustomerAccountClient,Ba as createHydrogenContext,Wa as createRequestHandler,lo as createStorefrontClient,Yn as createWithCache,T as formatAPIResult,Le as generateCacheControlHeader,fs as getPaginationVariables,Ts as getSelectedProductOptions,Ns as getSeoMeta,kn as getShopAnalytics,Js as getSitemap,Ys as getSitemapIndex,xs as graphiqlLoader,_a as hydrogenContext,bs as hydrogenPreset,ns as hydrogenRoutes,_s as storefrontRedirect,z as useAnalytics,vt as useCustomerPrivacy,dr as useNonce,Da as useOptimisticCart,ss as useOptimisticData,hs as useOptimisticVariant};//# sourceMappingURL=index.js.map
1049
+ //! @see: https://shopify.dev/docs/api/storefront/2026-04/mutations/cartDeliveryAddressesReplace
1050
+ export{Mn as Analytics,F as AnalyticsEvent,Lt as CacheCustom,_t as CacheLong,xt as CacheNone,ue as CacheShort,Z as CartForm,Nt as InMemoryCache,Oo as NonceProvider,is as OptimisticInput,ls as Pagination,xs as RichText,rs as Script,Gs as Seo,Qs as ShopPayButton,Is as VariantSelector,Yt as cartAttributesUpdateDefault,Wt as cartBuyerIdentityUpdateDefault,Ht as cartCreateDefault,Qt as cartDiscountCodesUpdateDefault,Ft as cartGetDefault,Mt as cartGetIdDefault,Zt as cartGiftCardCodesAddDefault,er as cartGiftCardCodesRemoveDefault,Xt as cartGiftCardCodesUpdateDefault,qt as cartLinesAddDefault,Bt as cartLinesRemoveDefault,Gt as cartLinesUpdateDefault,zt as cartMetafieldDeleteDefault,Jt as cartMetafieldsSetDefault,jt as cartNoteUpdateDefault,Kt as cartSelectedDeliveryOptionsUpdateDefault,Vt as cartSetIdDefault,Oa as changelogHandler,tr as createCartHandler,za as createContentSecurityPolicy,ur as createCustomerAccountClient,Ba as createHydrogenContext,Wa as createRequestHandler,lo as createStorefrontClient,Yn as createWithCache,T as formatAPIResult,Le as generateCacheControlHeader,fs as getPaginationVariables,Ts as getSelectedProductOptions,Ns as getSeoMeta,kn as getShopAnalytics,Js as getSitemap,Ys as getSitemapIndex,Os as graphiqlLoader,_a as hydrogenContext,bs as hydrogenPreset,ns as hydrogenRoutes,_s as storefrontRedirect,J as useAnalytics,vt as useCustomerPrivacy,dr as useNonce,Da as useOptimisticCart,ss as useOptimisticData,hs as useOptimisticVariant};//# sourceMappingURL=index.js.map
1051
1051
  //# sourceMappingURL=index.js.map