@shopify/hydrogen 2026.4.2 → 2026.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/development/index.cjs +54 -19
- package/dist/development/index.cjs.map +1 -1
- package/dist/development/index.js +54 -19
- package/dist/development/index.js.map +1 -1
- package/dist/development/react-router-preset.d.ts +3 -3
- package/dist/development/react-router-preset.js +5 -5
- package/dist/development/react-router-preset.js.map +1 -1
- package/dist/oxygen/index.d.ts +24 -0
- package/dist/production/index.cjs +86 -86
- package/dist/production/index.cjs.map +1 -1
- package/dist/production/index.d.cts +89 -173
- package/dist/production/index.d.ts +89 -173
- package/dist/production/index.js +70 -70
- package/dist/production/index.js.map +1 -1
- package/dist/production/react-router-preset.d.ts +3 -3
- package/dist/production/react-router-preset.js +2 -2
- package/dist/react-router.d.ts +12 -2
- package/dist/vite/request-events.d.ts +24 -0
- package/package.json +7 -7
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
'use strict';var react=require('react'),reactRouter=require('react-router'),jsxRuntime=require('react/jsx-runtime'),hydrogenReact=require('@shopify/hydrogen-react'),loadScript=require('@shopify/hydrogen-react/load-script'),graphqlClient=require('@shopify/graphql-client'),cookie=require('worktop/cookie'),fs=require('content-security-policy-builder');var _documentCurrentScript=typeof document!=='undefined'?document.currentScript:null;function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var fs__default=/*#__PURE__*/_interopDefault(fs);var ln=Object.defineProperty;var br=(e,t)=>()=>(e&&(t=e(e=0)),t);var wr=(e,t)=>{for(var r in t)ln(e,r,{get:t[r],enumerable:true});};var Bo={};wr(Bo,{VIRTUAL_ROUTES_DIR:()=>Be,VIRTUAL_ROUTES_DIR_PARTS:()=>qo,VIRTUAL_ROUTES_ROUTES_DIR_PARTS:()=>Qe,createVirtualRoutesPath:()=>Go,getVirtualRoutesV3:()=>vs});function Go(e,t,r){let o=new URL("../",e),n=t.reduce((s,c)=>new URL(`${c}/`,s),o),a=new URL(r,n).pathname.replace(/^\/[a-zA-Z]:\//,"/");return decodeURIComponent(a)}function Ge(e,t){return Go((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)),e,t)}async function vs(){return {routes:[{id:`${Be}/graphiql`,path:"graphiql",file:Ge(Qe,"graphiql.jsx"),index:false},{id:`${Be}/subrequest-profiler`,path:"subrequest-profiler",file:Ge(Qe,"subrequest-profiler.jsx"),index:false},{id:`${Be}/[.]well-known.appspecific.com[.]chrome[.]devtools[.]json`,path:".well-known/appspecific/com.chrome.devtools.json",file:Ge(Qe,"[.]well-known.appspecific.com[.]chrome[.]devtools[.]json.jsx"),index:false},{id:`${Be}/index`,path:"",file:Ge(Qe,"index.jsx"),index:true}],layout:{file:Ge(qo,"layout.jsx")}}}var Be,Qe,qo;var an={};wr(an,{default:()=>on,logSeoTags:()=>nn});function on({headTags:e}){return nn(e),null}function nn(e){console.log(" "),console.log("%cSEO Meta Tags",`${ri}`),console.log(" "),e.forEach(t=>{if(t.tag==="script"){if(console.log("%c\u2022 JSON LD ",Ir),t.children)try{console.table(JSON.parse(t.children),["name","content"]);}catch{console.log(t.children);}}else {if(console.log(`%c\u2022 ${t.tag} `,Ir),t.children)if(typeof t.children=="string")console.log(`\u21B3 ${t.children}`);else try{Object.entries(JSON.parse(t.children)).map(([r,o])=>console.log(`\u21B3 ${o}`));}catch{console.log(t.children);}if(t.props.property==="og:image:url"){let r=t.props.content;oi(r).then(o=>{let n=`font-size: 400px; padding: 10px; background: white url(${o}) no-repeat center; background-size: contain;`;console.log("%c\u2022 Share image preview",Ir),console.log("%c ",n),console.log(`\u21B3 ${r}`);}).catch(o=>{console.error(o);});}Object.entries(t.props).map(([r,o])=>{console.log(`\u21B3 ${r} \u2192 ${o}`);});}console.log(" ");});}async function oi(e){let o=await(await(await fetch(e)).blob()).arrayBuffer();return `data:image/png;base64,${ni(o)}`}function ni(e){let t="",r=new Uint8Array(e),o=r.byteLength;for(let n=0;n<o;n++)t+=String.fromCharCode(r[n]);return btoa(t)}var Ir,ri,sn=br(()=>{Ir="text-transform: uppercase;",ri="text-transform: uppercase; font-weight: bold; text-transform: uppercase;font-weight: bold";});function me(e){let{type:t,data:r={},customData:o}=e,n=reactRouter.useLocation(),{publish:a,cart:s,prevCart:c,shop:i,customData:u}=Z(),d=n.pathname+n.search,y={...r,customData:{...u,...o},cart:s,prevCart:c,shop:i};return react.useEffect(()=>{i?.shopId&&(y={...y,url:window.location.href},a(t,y));},[a,d,i?.shopId]),null}function Dr(e){return jsxRuntime.jsx(me,{...e,type:"page_viewed"})}function xr(e){return jsxRuntime.jsx(me,{...e,type:"product_viewed"})}function Or(e){return jsxRuntime.jsx(me,{...e,type:"collection_viewed"})}function _r(e){return jsxRuntime.jsx(me,{...e,type:"cart_viewed"})}function Ur(e){return jsxRuntime.jsx(me,{...e,type:"search_viewed"})}function Lr(e){return jsxRuntime.jsx(me,{...e})}var G={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 Ee="Custom-Storefront-Request-Group-ID",be="X-Shopify-Storefront-Access-Token",Rt="X-SDK-Variant",It="X-SDK-Variant-Source",Tt="X-SDK-Version",Ye="X-Shopify-Client-IP",Ce="X-Shopify-Client-IP-Sig",Je="_sfapi_proxy",ze="_server_tracking";function mn(e){return Object.entries(e).map(([t,r])=>r?`${t};desc=${r}`:void 0).filter(Boolean).join(", ")}function we(e,t){let r=typeof t=="string"?t:mn(t);r&&e.headers.append("Server-Timing",r);}var gn=["_y","_s","_cmp"];function kr(e){let t={};if(!e)return t;let r=new RegExp(`\\b(${gn.join("|")});desc="?([^",]+)"?`,"g"),o;for(;(o=r.exec(e))!==null;)t[o[1]]=o[2];return t}function Vr(e){if(typeof window>"u")return false;try{return !!window.performance.getEntriesByType("navigation")[0]?.serverTiming?.some(r=>r.name===e)}catch{return false}}function Nr(){return Vr(Je)}function Mr(){return Vr(ze)}var vn="https://cdn.shopify.com/shopifycloud/consent-tracking-api/v0.2/consent-tracking-api.js",Rn="https://cdn.shopify.com/shopifycloud/privacy-banner/storefront-banner.js";function bt(e){console.error(`[h2:error:useCustomerPrivacy] Unable to setup Customer Privacy API: Missing consent.${e} configuration.`);}function wt(e){let{withPrivacyBanner:t=false,onVisitorConsentCollected:r,onReady:o,checkoutDomain:n,storefrontAccessToken:a,country:s,locale:c,sameDomainForStorefrontApi:i}=e,u=react.useMemo(()=>i??Nr(),[i]),d=react.useMemo(()=>u&&!Mr(),[u]),y=hydrogenReact.useShopifyCookies({fetchTrackingValues:d,storefrontAccessToken:a,ignoreDeprecatedCookies:true}),m=react.useMemo(hydrogenReact.getTrackingValues,[y]),{revalidate:g}=reactRouter.useRevalidator();loadScript.useLoadScript(t?Rn:vn,{attributes:{id:"customer-privacy-api"}});let{observing:p,setLoaded:l,apisLoaded:P}=Tn({withPrivacyBanner:t}),f=react.useMemo(()=>{n||bt("checkoutDomain"),a||bt("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=En(n);return {checkoutRootDomain:u&&typeof window<"u"?window.location.host:n,storefrontRootDomain:h?"."+h:void 0,storefrontAccessToken:a,country:s,locale:c}},[bt,n,a,s,c]);react.useEffect(()=>{let h=S=>{let C=hydrogenReact.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=se();if(I?.shouldShowBanner()){let v=I.currentVisitorConsent();if(v&&v.marketing===""&&v.analytics===""&&v.preferences==="")return}r(S.detail);}};return document.addEventListener("visitorConsentCollected",h),()=>{document.removeEventListener("visitorConsentCollected",h);}},[r]),react.useEffect(()=>{if(!t||p.current.privacyBanner)return;p.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]),react.useEffect(()=>{if(p.current.customerPrivacy)return;p.current.customerPrivacy=true;let h=null,S=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 S??h},set(v){if(typeof v=="object"&&v!==null&&"setTrackingConsent"in v){let U=v;S={...U,setTrackingConsent:Hr({customerPrivacy:U,config:f})},C={...C,customerPrivacy:S},l.customerPrivacy();}}}));}});},[f,Hr,l.customerPrivacy]),react.useEffect(()=>{if(!P||!y)return;let h=se();if(h&&!h.cachedConsent){let S=hydrogenReact.getTrackingValues();S.consent&&(h.cachedConsent=S.consent);}if(t){let S=De();S&&S.loadBanner(f);}In(),o?.();},[P,y]);let R={customerPrivacy:se()};return t&&(R.privacyBanner=De()),R}var Fr=false;function In(){if(Fr)return;Fr=true;let e=new CustomEvent("shopifyCustomerPrivacyApiLoaded");document.dispatchEvent(e);}function Tn({withPrivacyBanner:e}){let t=react.useRef({customerPrivacy:false,privacyBanner:false}),[r,o]=react.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 En(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 Hr({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 se(){try{let e=window.Shopify?.customerPrivacy;return e&&"setTrackingConsent"in e?e:null}catch{return null}}function De(){try{return window&&window?.privacyBanner?window.privacyBanner:null}catch{return null}}var qr="2026.4.2";function _n(){let e=se();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 Br({consent:e,onReady:t,domain:r}){let{subscribe:o,register:n,canTrack:a}=Z(),[s,c]=react.useState(false),[i,u]=react.useState(false),[d,y]=react.useState(""),m=react.useRef(false),{checkoutDomain:g,storefrontAccessToken:p,language:l}=e,{ready:P}=n("Internal_Shopify_Analytics");wt({...e,locale:l,checkoutDomain:g||"mock.shop",storefrontAccessToken:p||"abcdefghijklmnopqrstuvwxyz123456",onReady:()=>!e.withPrivacyBanner&&u(true),onVisitorConsentCollected:R=>{try{y(JSON.stringify(R));}catch{}u(true);}});let f=react.useMemo(()=>i?a():true,[i,a,d]);return hydrogenReact.useShopifyCookies({hasUserConsent:f,domain:r,checkoutDomain:g,fetchTrackingValues:false,ignoreDeprecatedCookies:!i}),react.useEffect(()=>{m.current||(m.current=true,o(G.PAGE_VIEWED,Ln),o(G.PRODUCT_VIEWED,kn),o(G.COLLECTION_VIEWED,Vn),o(G.SEARCH_VIEWED,Nn),o(G.PRODUCT_ADD_TO_CART,Mn),c(true));},[o]),react.useEffect(()=>{s&&i&&(P(),t());},[s,i,t]),null}function et(e){console.error(`[h2:error:ShopifyAnalytics] Unable to send Shopify analytics: Missing shop.${e} configuration.`);}function _e(e){let t=_n(),r=t.analyticsProcessingAllowed();if(!e?.shop?.shopId){et("shopId");return}if(!e?.shop?.acceptedLanguage){et("acceptedLanguage");return}if(!e?.shop?.currency){et("currency");return}if(!e?.shop?.hydrogenSubchannelId){et("hydrogenSubchannelId");return}return {shopifySalesChannel:"hydrogen",assetVersionId:qr,...e.shop,hasUserConsent:r,...hydrogenReact.getClientBrowserParameters(),analyticsAllowed:t.analyticsProcessingAllowed(),marketingAllowed:t.marketingAllowed(),saleOfDataAllowed:t.saleOfDataAllowed(),ccpaEnforced:!t.saleOfDataAllowed(),gdprEnforced:!(t.marketingAllowed()&&t.analyticsProcessingAllowed())}}function Un(e,t){if(t===null)return;let r=_e(e);return r?{...r,cartId:t.id}:void 0}var ie={};function Ln(e){let t=_e(e);t&&(hydrogenReact.sendShopifyAnalytics({eventName:hydrogenReact.AnalyticsEventName.PAGE_VIEW_2,payload:{...t,...ie}}),ie={});}function kn(e){let t=_e(e);if(t&&Qr({type:"product",products:e.products})){let r=xt(e.products);ie={pageType:hydrogenReact.AnalyticsPageType.product,resourceId:r[0].productGid},t={...t,...ie,products:xt(e.products)},hydrogenReact.sendShopifyAnalytics({eventName:hydrogenReact.AnalyticsEventName.PRODUCT_VIEW,payload:t});}}function Vn(e){let t=_e(e);t&&(ie={pageType:hydrogenReact.AnalyticsPageType.collection,resourceId:e.collection.id},t={...t,...ie,collectionHandle:e.collection.handle,collectionId:e.collection.id},hydrogenReact.sendShopifyAnalytics({eventName:hydrogenReact.AnalyticsEventName.COLLECTION_VIEW,payload:t}));}function Nn(e){let t=_e(e);t&&(ie={pageType:hydrogenReact.AnalyticsPageType.search},t={...t,...ie,searchString:e.searchTerm},hydrogenReact.sendShopifyAnalytics({eventName:hydrogenReact.AnalyticsEventName.SEARCH_VIEW,payload:t}));}function Mn(e){let{cart:t,currentLine:r}=e,o=Un(e,t);!o||!r?.id||Fn({matchedLine:r,eventPayload:o});}function Fn({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};Qr({type:"cart",products:[r]})&&hydrogenReact.sendShopifyAnalytics({eventName:hydrogenReact.AnalyticsEventName.ADD_TO_CART,payload:{...t,products:xt([r])}});}function pe(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 Qr({type:e,products:t}){return !t||t.length===0?(pe(e,"",false,"data.products"),false):(t.forEach(r=>{if(!r.id)return pe(e,"id",false),false;if(!r.title)return pe(e,"title",false),false;if(!r.price)return pe(e,"price.amount",true,"price"),false;if(!r.vendor)return pe(e,"vendor",false),false;if(!r.variantId)return pe(e,"id",true,"variantId"),false;if(!r.variantTitle)return pe(e,"title",true,"variantTitle"),false}),true)}function xt(e){return e.map(t=>{let r={productGid:t.id,variantGid:t.variantId,name:t.title,variantName:t.variantTitle,brand:t.vendor,price:t.price,quantity:t.quantity||1,category:t.productType};return t.sku&&(r.sku=t.sku),t.productType&&(r.category=t.productType),r})}function Kr(e){console.error(`[h2:error:CartAnalytics] 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 Yr({cart:e,setCarts:t}){let{publish:r,shop:o,customData:n,canTrack:a,cart:s,prevCart:c}=Z(),i=react.useRef(null);return react.useEffect(()=>{if(e)return Promise.resolve(e).then(u=>{if(u&&u.lines){if(!u.id){Kr("id");return}if(!u.updatedAt){Kr("updatedAt");return}}t(({cart:d,prevCart:y})=>u?.updatedAt!==d?.updatedAt?{cart:u,prevCart:d}:{cart:d,prevCart:y});}),()=>{}},[t,e]),react.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 d={eventTimestamp:Date.now(),cart:s,prevCart:c,shop:o,customData:n};if(s.updatedAt===i.current)return;i.current=s.updatedAt,r("cart_updated",d),localStorage.setItem("cartLastUpdatedAt",JSON.stringify({id:s.id,updatedAt:s.updatedAt}));let y=c?.lines?hydrogenReact.flattenConnection(c?.lines):[],m=s.lines?hydrogenReact.flattenConnection(s.lines):[];y?.forEach(g=>{let p=m.filter(l=>g.id===l.id);if(p?.length===1){let l=p[0];g.quantity<l.quantity?r("product_added_to_cart",{...d,prevLine:g,currentLine:l}):g.quantity>l.quantity&&r("product_removed_from_cart",{...d,prevLine:g,currentLine:l});}else r("product_removed_from_cart",{...d,prevLine:g});}),m?.forEach(g=>{let p=y.filter(l=>g.id===l.id);(!p||p.length===0)&&r("product_added_to_cart",{...d,currentLine:g});});},[s,c,r,o,n,a]),null}var Qn="https://cdn.shopify.com/shopifycloud/perf-kit/shopify-perf-kit-spa.min.js";function Jr({shop:e}){let t=react.useRef(false),{subscribe:r,register:o}=Z(),{ready:n}=o("Internal_Shopify_Perf_Kit"),a=hydrogenReact.useLoadScript(Qn,{attributes:{id:"perfkit","data-application":"hydrogen","data-shop-id":hydrogenReact.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 react.useEffect(()=>{a!=="done"||t.current||(t.current=true,r(G.PAGE_VIEWED,()=>{window.PerfKit?.navigate();}),r(G.PRODUCT_VIEWED,()=>{window.PerfKit?.setPageType("product");}),r(G.COLLECTION_VIEWED,()=>{window.PerfKit?.setPageType("collection");}),r(G.SEARCH_VIEWED,()=>{window.PerfKit?.setPageType("search");}),r(G.CART_VIEWED,()=>{window.PerfKit?.setPageType("cart");}),n());},[r,n,a]),null}var zr=new Set,ee=e=>{zr.has(e)||(console.warn(e),zr.add(e));},Xr=new Set,_t=e=>{Xr.has(e)||(console.error(new Error(e)),Xr.add(e));};var Jn={canTrack:()=>false,cart:null,customData:{},prevCart:null,publish:()=>{},shop:null,subscribe:()=>{},register:()=>({ready:()=>{}}),customerPrivacy:null,privacyBanner:null},no=react.createContext(Jn),rt=new Map,Le={};function ao(){return Object.values(Le).every(Boolean)}function Zr(e,t){rt.has(e)||rt.set(e,new Map),rt.get(e)?.set(t.toString(),t);}var ot=new Map;function eo(e,t){if(!ao()){ot.set(e,t);return}so(e,t);}function so(e,t){(rt.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 to(e){return Le.hasOwnProperty(e)||(Le[e]=false),{ready:()=>{Le[e]=true,ao()&&ot.size>0&&(ot.forEach((t,r)=>{so(r,t);}),ot.clear());}}}function ro(){try{return window.Shopify.customerPrivacy?.analyticsProcessingAllowed?.()??!1}catch{}return false}function oo(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 zn({canTrack:e,cart:t,children:r,consent:o,customData:n={},shop:a=null,cookieDomain:s}){let{shop:c}=Xn(a),[i,u]=react.useState(!!e),[d,y]=react.useState(false),[m,g]=react.useState({cart:null,prevCart:null}),[p,l]=react.useState(e?()=>e:()=>ro);if(c)if(/\/68817551382$/.test(c.shopId))ee("[h2:error:Analytics.Provider] - Mock shop is used. Analytics will not work properly.");else {if(!o.checkoutDomain){let f=oo("consent.checkoutDomain","PUBLIC_CHECKOUT_DOMAIN");_t(f);}if(!o.storefrontAccessToken){let f=oo("consent.storefrontAccessToken","PUBLIC_STOREFRONT_API_TOKEN");_t(f);}o?.country||(o.country="US"),o?.language||(o.language="EN"),o.withPrivacyBanner===void 0&&(o.withPrivacyBanner=false);}let P=react.useMemo(()=>({canTrack:p,...m,customData:n,publish:p()?eo:()=>{},shop:c,subscribe:Zr,register:to,customerPrivacy:se(),privacyBanner:De()}),[i,p,m,m.cart?.updatedAt,m.prevCart,eo,Zr,n,c,to,JSON.stringify(Le),se,De]);return jsxRuntime.jsxs(no.Provider,{value:P,children:[r,!!c&&jsxRuntime.jsx(Dr,{}),!!c&&!!t&&jsxRuntime.jsx(Yr,{cart:t,setCarts:g}),!!c&&jsxRuntime.jsx(Br,{consent:o,onReady:()=>{u(true),l(e?()=>e:()=>ro),y(true);},domain:s}),!!c&&d&&jsxRuntime.jsx(Jr,{shop:c})]})}function Z(){let e=react.useContext(no);if(!e)throw new Error("[h2:error:useAnalytics] 'useAnalytics()' must be a descendent of <AnalyticsProvider/>");return e}function Xn(e){let[t,r]=react.useState(null);return react.useEffect(()=>(Promise.resolve(e).then(r),()=>{}),[r,e]),{shop:t}}async function Zn({storefront:e,publicStorefrontId:t="0"}){return e.query(ea,{cache:e.CacheLong()}).then(({shop:r,localization:o})=>({shopId:r.id,acceptedLanguage:o.language.isoCode,currency:o.country.currency.isoCode,hydrogenSubchannelId:t}))}var ea=`#graphql
|
|
1
|
+
'use strict';var react=require('react'),reactRouter=require('react-router'),jsxRuntime=require('react/jsx-runtime'),hydrogenReact=require('@shopify/hydrogen-react'),loadScript=require('@shopify/hydrogen-react/load-script'),graphqlClient=require('@shopify/graphql-client'),cookie=require('worktop/cookie'),gs=require('content-security-policy-builder');var _documentCurrentScript=typeof document!=='undefined'?document.currentScript:null;function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var gs__default=/*#__PURE__*/_interopDefault(gs);var mn=Object.defineProperty;var wr=(e,t)=>()=>(e&&(t=e(e=0)),t);var xr=(e,t)=>{for(var r in t)mn(e,r,{get:t[r],enumerable:true});};var Qo={};xr(Qo,{VIRTUAL_ROUTES_DIR:()=>Be,VIRTUAL_ROUTES_DIR_PARTS:()=>Go,VIRTUAL_ROUTES_ROUTES_DIR_PARTS:()=>Qe,createVirtualRoutesPath:()=>Bo,getVirtualRoutesV3:()=>Is});function Bo(e,t,r){let o=new URL("../",e),n=t.reduce((s,i)=>new URL(`${i}/`,s),o),a=new URL(r,n).pathname.replace(/^\/[a-zA-Z]:\//,"/");return decodeURIComponent(a)}function Ge(e,t){return Bo((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)),e,t)}async function Is(){return {routes:[{id:`${Be}/graphiql`,path:"graphiql",file:Ge(Qe,"graphiql.jsx"),index:false},{id:`${Be}/subrequest-profiler`,path:"subrequest-profiler",file:Ge(Qe,"subrequest-profiler.jsx"),index:false},{id:`${Be}/[.]well-known.appspecific.com[.]chrome[.]devtools[.]json`,path:".well-known/appspecific/com.chrome.devtools.json",file:Ge(Qe,"[.]well-known.appspecific.com[.]chrome[.]devtools[.]json.jsx"),index:false},{id:`${Be}/index`,path:"",file:Ge(Qe,"index.jsx"),index:true}],layout:{file:Ge(Go,"layout.jsx")}}}var Be,Qe,Go;var un={};xr(un,{default:()=>sn,logSeoTags:()=>cn});function sn({headTags:e}){return cn(e),null}function cn(e){console.log(" "),console.log("%cSEO Meta Tags",`${si}`),console.log(" "),e.forEach(t=>{if(t.tag==="script"){if(console.log("%c\u2022 JSON LD ",Ir),t.children)try{console.table(JSON.parse(t.children),["name","content"]);}catch{console.log(t.children);}}else {if(console.log(`%c\u2022 ${t.tag} `,Ir),t.children)if(typeof t.children=="string")console.log(`\u21B3 ${t.children}`);else try{Object.entries(JSON.parse(t.children)).map(([r,o])=>console.log(`\u21B3 ${o}`));}catch{console.log(t.children);}if(t.props.property==="og:image:url"){let r=t.props.content;ii(r).then(o=>{let n=`font-size: 400px; padding: 10px; background: white url(${o}) no-repeat center; background-size: contain;`;console.log("%c\u2022 Share image preview",Ir),console.log("%c ",n),console.log(`\u21B3 ${r}`);}).catch(o=>{console.error(o);});}Object.entries(t.props).map(([r,o])=>{console.log(`\u21B3 ${r} \u2192 ${o}`);});}console.log(" ");});}async function ii(e){let o=await(await(await fetch(e)).blob()).arrayBuffer();return `data:image/png;base64,${ci(o)}`}function ci(e){let t="",r=new Uint8Array(e),o=r.byteLength;for(let n=0;n<o;n++)t+=String.fromCharCode(r[n]);return btoa(t)}var Ir,si,dn=wr(()=>{Ir="text-transform: uppercase;",si="text-transform: uppercase; font-weight: bold; text-transform: uppercase;font-weight: bold";});function me(e){let{type:t,data:r={},customData:o}=e,n=reactRouter.useLocation(),{publish:a,cart:s,prevCart:i,shop:c,customData:u}=Z(),d=n.pathname+n.search,y={...r,customData:{...u,...o},cart:s,prevCart:i,shop:c};return react.useEffect(()=>{c?.shopId&&(y={...y,url:window.location.href},a(t,y));},[a,d,c?.shopId]),null}function Dr(e){return jsxRuntime.jsx(me,{...e,type:"page_viewed"})}function Or(e){return jsxRuntime.jsx(me,{...e,type:"product_viewed"})}function _r(e){return jsxRuntime.jsx(me,{...e,type:"collection_viewed"})}function Ur(e){return jsxRuntime.jsx(me,{...e,type:"cart_viewed"})}function Lr(e){return jsxRuntime.jsx(me,{...e,type:"search_viewed"})}function kr(e){return jsxRuntime.jsx(me,{...e})}var G={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 Ee="Custom-Storefront-Request-Group-ID",be="X-Shopify-Storefront-Access-Token",Pt="X-SDK-Variant",vt="X-SDK-Variant-Source",It="X-SDK-Version",Ye="X-Shopify-Client-IP",ge="X-Shopify-Client-IP-Sig",Je="_sfapi_proxy",ze="_server_tracking";function hn(e){return Object.entries(e).map(([t,r])=>r?`${t};desc=${r}`:void 0).filter(Boolean).join(", ")}function we(e,t){let r=typeof t=="string"?t:hn(t);r&&e.headers.append("Server-Timing",r);}var An=["_y","_s","_cmp"];function Vr(e){let t={};if(!e)return t;let r=new RegExp(`\\b(${An.join("|")});desc="?([^",]+)"?`,"g"),o;for(;(o=r.exec(e))!==null;)t[o[1]]=o[2];return t}function Nr(e){if(typeof window>"u")return false;try{return !!window.performance.getEntriesByType("navigation")[0]?.serverTiming?.some(r=>r.name===e)}catch{return false}}function Mr(){return Nr(Je)}function Fr(){return Nr(ze)}var In="https://cdn.shopify.com/shopifycloud/consent-tracking-api/v0.2/consent-tracking-api.js",En="https://cdn.shopify.com/shopifycloud/privacy-banner/storefront-banner.js";function bt(e){console.error(`[h2:error:useCustomerPrivacy] Unable to setup Customer Privacy API: Missing consent.${e} configuration.`);}function wt(e){let{withPrivacyBanner:t=false,onVisitorConsentCollected:r,onReady:o,checkoutDomain:n,storefrontAccessToken:a,country:s,locale:i,sameDomainForStorefrontApi:c}=e,u=react.useMemo(()=>c??Mr(),[c]),d=react.useMemo(()=>u&&!Fr(),[u]),y=hydrogenReact.useShopifyCookies({fetchTrackingValues:d,storefrontAccessToken:a,ignoreDeprecatedCookies:true}),m=react.useMemo(hydrogenReact.getTrackingValues,[y]),{revalidate:C}=reactRouter.useRevalidator();loadScript.useLoadScript(t?En:In,{attributes:{id:"customer-privacy-api"}});let{observing:p,setLoaded:l,apisLoaded:S}=wn({withPrivacyBanner:t}),f=react.useMemo(()=>{n||bt("checkoutDomain"),a||bt("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=xn(n);return {checkoutRootDomain:u&&typeof window<"u"?window.location.host:n,storefrontRootDomain:h?"."+h:void 0,storefrontAccessToken:a,country:s,locale:i}},[bt,n,a,s,i]);react.useEffect(()=>{let h=T=>{let g=hydrogenReact.getTrackingValues();if((m.visitToken!==g.visitToken||m.uniqueToken!==g.uniqueToken)&&C().catch(()=>{console.warn("[h2:warn:useCustomerPrivacy] Revalidation failed after consent change.");}),r){let v=se();if(v?.shouldShowBanner()){let R=v.currentVisitorConsent();if(R&&R.marketing===""&&R.analytics===""&&R.preferences==="")return}r(T.detail);}};return document.addEventListener("visitorConsentCollected",h),()=>{document.removeEventListener("visitorConsentCollected",h);}},[r]),react.useEffect(()=>{if(!t||p.current.privacyBanner)return;p.current.privacyBanner=true;let h=window.privacyBanner||void 0;Object.defineProperty(window,"privacyBanner",{configurable:true,get(){return h},set(g){typeof g=="object"&&g!==null&&"showPreferences"in g&&"loadBanner"in g&&(h=qr({privacyBanner:g,config:f}),l.privacyBanner());}});},[t,f,qr,l.privacyBanner]),react.useEffect(()=>{if(p.current.customerPrivacy)return;p.current.customerPrivacy=true;let h=null,T=null,g=window.Shopify||void 0;Object.defineProperty(window,"Shopify",{configurable:true,get(){return g},set(v){typeof v=="object"&&v!==null&&Object.keys(v).length===0&&(g=v,h={backendConsentEnabled:true},Object.defineProperty(window.Shopify,"customerPrivacy",{configurable:true,get(){return T??h},set(R){if(typeof R=="object"&&R!==null&&"setTrackingConsent"in R){let U=R;T={...U,setTrackingConsent:$r({customerPrivacy:U,config:f})},g={...g,customerPrivacy:T},l.customerPrivacy();}}}));}});},[f,$r,l.customerPrivacy]),react.useEffect(()=>{if(!S||!y)return;let h=se();if(h&&!h.cachedConsent){let T=hydrogenReact.getTrackingValues();T.consent&&(h.cachedConsent=T.consent);}if(t){let T=xe();T&&T.loadBanner(f);}bn(),o?.();},[S,y]);let P={customerPrivacy:se()};return t&&(P.privacyBanner=xe()),P}var Hr=false;function bn(){if(Hr)return;Hr=true;let e=new CustomEvent("shopifyCustomerPrivacyApiLoaded");document.dispatchEvent(e);}function wn({withPrivacyBanner:e}){let t=react.useRef({customerPrivacy:false,privacyBanner:false}),[r,o]=react.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 xn(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 $r({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 qr({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 se(){try{let e=window.Shopify?.customerPrivacy;return e&&"setTrackingConsent"in e?e:null}catch{return null}}function xe(){try{return window&&window?.privacyBanner?window.privacyBanner:null}catch{return null}}var Gr="2026.4.3";function kn(){let e=se();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 Qr({consent:e,onReady:t,domain:r}){let{subscribe:o,register:n,canTrack:a}=Z(),[s,i]=react.useState(false),[c,u]=react.useState(false),[d,y]=react.useState(""),m=react.useRef(false),{checkoutDomain:C,storefrontAccessToken:p,language:l}=e,{ready:S}=n("Internal_Shopify_Analytics");wt({...e,locale:l,checkoutDomain:C||"mock.shop",storefrontAccessToken:p||"abcdefghijklmnopqrstuvwxyz123456",onReady:()=>!e.withPrivacyBanner&&u(true),onVisitorConsentCollected:P=>{try{y(JSON.stringify(P));}catch{}u(true);}});let f=react.useMemo(()=>c?a():true,[c,a,d]);return hydrogenReact.useShopifyCookies({hasUserConsent:f,domain:r,checkoutDomain:C,fetchTrackingValues:false,ignoreDeprecatedCookies:!c}),react.useEffect(()=>{m.current||(m.current=true,o(G.PAGE_VIEWED,Nn),o(G.PRODUCT_VIEWED,Mn),o(G.COLLECTION_VIEWED,Fn),o(G.SEARCH_VIEWED,Hn),o(G.PRODUCT_ADD_TO_CART,$n),i(true));},[o]),react.useEffect(()=>{s&&c&&(S(),t());},[s,c,t]),null}function et(e){console.error(`[h2:error:ShopifyAnalytics] Unable to send Shopify analytics: Missing shop.${e} configuration.`);}function _e(e){let t=kn(),r=t.analyticsProcessingAllowed();if(!e?.shop?.shopId){et("shopId");return}if(!e?.shop?.acceptedLanguage){et("acceptedLanguage");return}if(!e?.shop?.currency){et("currency");return}if(!e?.shop?.hydrogenSubchannelId){et("hydrogenSubchannelId");return}return {shopifySalesChannel:"hydrogen",assetVersionId:Gr,...e.shop,hasUserConsent:r,...hydrogenReact.getClientBrowserParameters(),analyticsAllowed:t.analyticsProcessingAllowed(),marketingAllowed:t.marketingAllowed(),saleOfDataAllowed:t.saleOfDataAllowed(),ccpaEnforced:!t.saleOfDataAllowed(),gdprEnforced:!(t.marketingAllowed()&&t.analyticsProcessingAllowed())}}function Vn(e,t){if(t===null)return;let r=_e(e);return r?{...r,cartId:t.id}:void 0}var ie={};function Nn(e){let t=_e(e);t&&(hydrogenReact.sendShopifyAnalytics({eventName:hydrogenReact.AnalyticsEventName.PAGE_VIEW_2,payload:{...t,...ie}}),ie={});}function Mn(e){let t=_e(e);if(t&&Wr({type:"product",products:e.products})){let r=Dt(e.products);ie={pageType:hydrogenReact.AnalyticsPageType.product,resourceId:r[0].productGid},t={...t,...ie,products:Dt(e.products)},hydrogenReact.sendShopifyAnalytics({eventName:hydrogenReact.AnalyticsEventName.PRODUCT_VIEW,payload:t});}}function Fn(e){let t=_e(e);t&&(ie={pageType:hydrogenReact.AnalyticsPageType.collection,resourceId:e.collection.id},t={...t,...ie,collectionHandle:e.collection.handle,collectionId:e.collection.id},hydrogenReact.sendShopifyAnalytics({eventName:hydrogenReact.AnalyticsEventName.COLLECTION_VIEW,payload:t}));}function Hn(e){let t=_e(e);t&&(ie={pageType:hydrogenReact.AnalyticsPageType.search},t={...t,...ie,searchString:e.searchTerm},hydrogenReact.sendShopifyAnalytics({eventName:hydrogenReact.AnalyticsEventName.SEARCH_VIEW,payload:t}));}function $n(e){let{cart:t,currentLine:r}=e,o=Vn(e,t);!o||!r?.id||qn({matchedLine:r,eventPayload:o});}function qn({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};Wr({type:"cart",products:[r]})&&hydrogenReact.sendShopifyAnalytics({eventName:hydrogenReact.AnalyticsEventName.ADD_TO_CART,payload:{...t,products:Dt([r])}});}function pe(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 Wr({type:e,products:t}){return !t||t.length===0?(pe(e,"",false,"data.products"),false):(t.forEach(r=>{if(!r.id)return pe(e,"id",false),false;if(!r.title)return pe(e,"title",false),false;if(!r.price)return pe(e,"price.amount",true,"price"),false;if(!r.vendor)return pe(e,"vendor",false),false;if(!r.variantId)return pe(e,"id",true,"variantId"),false;if(!r.variantTitle)return pe(e,"title",true,"variantTitle"),false}),true)}function Dt(e){return e.map(t=>{let r={productGid:t.id,variantGid:t.variantId,name:t.title,variantName:t.variantTitle,brand:t.vendor,price:t.price,quantity:t.quantity||1,category:t.productType};return t.sku&&(r.sku=t.sku),t.productType&&(r.category=t.productType),r})}function Yr(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 Jr({cart:e,setCarts:t}){let{publish:r,shop:o,customData:n,canTrack:a,cart:s,prevCart:i}=Z(),c=react.useRef(null);return react.useEffect(()=>{if(e)return Promise.resolve(e).then(u=>{if(u&&u.lines){if(!u.id){Yr("id");return}if(!u.updatedAt){Yr("updatedAt");return}}t(({cart:d,prevCart:y})=>u?.updatedAt!==d?.updatedAt?{cart:u,prevCart:d}:{cart:d,prevCart:y});}),()=>{}},[t,e]),react.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 d={eventTimestamp:Date.now(),cart:s,prevCart:i,shop:o,customData:n};if(s.updatedAt===c.current)return;c.current=s.updatedAt,r("cart_updated",d),localStorage.setItem("cartLastUpdatedAt",JSON.stringify({id:s.id,updatedAt:s.updatedAt}));let y=i?.lines?hydrogenReact.flattenConnection(i?.lines):[],m=s.lines?hydrogenReact.flattenConnection(s.lines):[];y?.forEach(C=>{let p=m.filter(l=>C.id===l.id);if(p?.length===1){let l=p[0];C.quantity<l.quantity?r("product_added_to_cart",{...d,prevLine:C,currentLine:l}):C.quantity>l.quantity&&r("product_removed_from_cart",{...d,prevLine:C,currentLine:l});}else r("product_removed_from_cart",{...d,prevLine:C});}),m?.forEach(C=>{let p=y.filter(l=>C.id===l.id);(!p||p.length===0)&&r("product_added_to_cart",{...d,currentLine:C});});},[s,i,r,o,n,a]),null}var Kn="https://cdn.shopify.com/shopifycloud/perf-kit/shopify-perf-kit-spa.min.js";function zr({shop:e}){let t=react.useRef(false),{subscribe:r,register:o}=Z(),{ready:n}=o("Internal_Shopify_Perf_Kit"),a=hydrogenReact.useLoadScript(Kn,{attributes:{id:"perfkit","data-application":"hydrogen","data-shop-id":hydrogenReact.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 react.useEffect(()=>{a!=="done"||t.current||(t.current=true,r(G.PAGE_VIEWED,()=>{window.PerfKit?.navigate();}),r(G.PRODUCT_VIEWED,()=>{window.PerfKit?.setPageType("product");}),r(G.COLLECTION_VIEWED,()=>{window.PerfKit?.setPageType("collection");}),r(G.SEARCH_VIEWED,()=>{window.PerfKit?.setPageType("search");}),r(G.CART_VIEWED,()=>{window.PerfKit?.setPageType("cart");}),n());},[r,n,a]),null}var Xr=new Set,ee=e=>{Xr.has(e)||(console.warn(e),Xr.add(e));},Zr=new Set,_t=e=>{Zr.has(e)||(console.error(new Error(e)),Zr.add(e));};var Zn={canTrack:()=>false,cart:null,customData:{},prevCart:null,publish:()=>{},shop:null,subscribe:()=>{},register:()=>({ready:()=>{}}),customerPrivacy:null,privacyBanner:null},ao=react.createContext(Zn),rt=new Map,Le={};function so(){return Object.values(Le).every(Boolean)}function eo(e,t){rt.has(e)||rt.set(e,new Map),rt.get(e)?.set(t.toString(),t);}var ot=new Map;function to(e,t){if(!so()){ot.set(e,t);return}io(e,t);}function io(e,t){(rt.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 ro(e){return Le.hasOwnProperty(e)||(Le[e]=false),{ready:()=>{Le[e]=true,so()&&ot.size>0&&(ot.forEach((t,r)=>{io(r,t);}),ot.clear());}}}function oo(){try{return window.Shopify.customerPrivacy?.analyticsProcessingAllowed?.()??!1}catch{}return false}function no(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 ea({canTrack:e,cart:t,children:r,consent:o,customData:n={},shop:a=null,cookieDomain:s}){let{shop:i}=ta(a),[c,u]=react.useState(!!e),[d,y]=react.useState(false),[m,C]=react.useState({cart:null,prevCart:null}),[p,l]=react.useState(e?()=>e:()=>oo);if(i)if(/\/68817551382$/.test(i.shopId))ee("[h2:error:Analytics.Provider] - Mock shop is used. Analytics will not work properly.");else {if(!o.checkoutDomain){let f=no("consent.checkoutDomain","PUBLIC_CHECKOUT_DOMAIN");_t(f);}if(!o.storefrontAccessToken){let f=no("consent.storefrontAccessToken","PUBLIC_STOREFRONT_API_TOKEN");_t(f);}o?.country||(o.country="US"),o?.language||(o.language="EN"),o.withPrivacyBanner===void 0&&(o.withPrivacyBanner=false);}let S=react.useMemo(()=>({canTrack:p,...m,customData:n,publish:p()?to:()=>{},shop:i,subscribe:eo,register:ro,customerPrivacy:se(),privacyBanner:xe()}),[c,p,m,m.cart?.updatedAt,m.prevCart,to,eo,n,i,ro,JSON.stringify(Le),se,xe]);return jsxRuntime.jsxs(ao.Provider,{value:S,children:[r,!!i&&jsxRuntime.jsx(Dr,{}),!!i&&!!t&&jsxRuntime.jsx(Jr,{cart:t,setCarts:C}),!!i&&jsxRuntime.jsx(Qr,{consent:o,onReady:()=>{u(true),l(e?()=>e:()=>oo),y(true);},domain:s}),!!i&&d&&jsxRuntime.jsx(zr,{shop:i})]})}function Z(){let e=react.useContext(ao);if(!e)throw new Error("[h2:error:useAnalytics] 'useAnalytics()' must be a descendent of <AnalyticsProvider/>");return e}function ta(e){let[t,r]=react.useState(null);return react.useEffect(()=>(Promise.resolve(e).then(r),()=>{}),[r,e]),{shop:t}}async function ra({storefront:e,publicStorefrontId:t="0"}){return e.query(oa,{cache:e.CacheLong()}).then(({shop:r,localization:o})=>({shopId:r.id,acceptedLanguage:o.language.isoCode,currency:o.country.currency.isoCode,hydrogenSubchannelId:t}))}var oa=`#graphql
|
|
2
2
|
query ShopData(
|
|
3
3
|
$country: CountryCode
|
|
4
4
|
$language: LanguageCode
|
|
@@ -17,29 +17,29 @@
|
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
`,
|
|
20
|
+
`,na={CartView:Ur,CollectionView:_r,CustomView:kr,ProductView:Or,Provider:ea,SearchView:Lr};function Y(e,t){return Ut(e.headers,t)}function Ut(e,t){let r=e?.get?.(t)??e?.[t];return typeof r=="string"?r:null}function ce(e){return {requestId:e?Y(e,"request-id"):void 0,purpose:e?Y(e,"purpose"):void 0}}function co(e){return {requestGroupId:Y(e,"request-id"),buyerIp:Y(e,"oxygen-buyer-ip"),buyerIpSig:Y(e,ge),cookie:Y(e,"cookie"),purpose:Y(e,"sec-purpose")||Y(e,"purpose")}}var Lt=/^\/api\/(unstable|2\d{3}-\d{2})\/graphql\.json$/,uo=/^\/api\/mcp$/,nt=e=>{try{return new URL(e,"http://e.c").pathname}catch{return "/"}};function ke(e,t){return t.reduce((r,o)=>{let n=e(o);return n&&r.push([o,n]),r},[])}function he(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
|
|
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 at="public",
|
|
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 at="public",sa="private",kt="no-store",po={maxAge:"max-age",staleWhileRevalidate:"stale-while-revalidate",sMaxAge:"s-maxage",staleIfError:"stale-if-error"};function Ve(e){let t=[];return Object.keys(e).forEach(r=>{r==="mode"?t.push(e[r]):po[r]&&t.push(`${po[r]}=${e[r]}`);}),t.join(", ")}function Vt(){return {mode:kt}}function Nt(e){if(e?.mode&&e?.mode!==at&&e?.mode!==sa)throw Error("'mode' must be either 'public' or 'private'")}function le(e){return Nt(e),{mode:at,maxAge:1,staleWhileRevalidate:9,...e}}function Mt(e){return Nt(e),{mode:at,maxAge:3600,staleWhileRevalidate:82800,...e}}function Ae(e){return Nt(e),{mode:at,maxAge:1,staleWhileRevalidate:86399,...e}}function Ft(e){return e}function te(e){return String(e).includes("__proto__")?JSON.parse(e,ia):JSON.parse(e)}function ia(e,t){if(e!=="__proto__")return t}function st(e,t){return e&&t?{...e,...t}:e||Ae()}function Ht(e){return Ve(st(e))}async function ca(e,t){if(!e)return;let r=await e.match(t);if(!r){return}return r}async function ua(e,t,r,o){if(!e)return;let n=st(o),a=Ht(st(n,{maxAge:(n.maxAge||0)+(n.staleWhileRevalidate||0)})),s=Ht(st(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 da(e,t){e&&await e.delete(t);}function pa(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 la(e,t){let r=t.headers.get("cache-put-date");if(!r)return false;let[o,n]=pa(t,r),a=o>n;return a}var it={get:ca,set:ua,delete:da,generateDefaultCacheControlHeader:Ht,isStale:la};function Ne(e){return `https://shopify.dev/?${e}`}function ya(e){return e||Ae()}async function lo(e,t){if(!e)return;let r=Ne(t),o=new Request(r),n=await it.get(e,o);if(!n)return;let a=await n.text();try{return [te(a),n]}catch{return [a,n]}}async function yo(e,t,r,o){if(!e)return;let n=Ne(t),a=new Request(n),s=new Response(JSON.stringify(r));await it.set(e,a,s,ya(o));}function fo(e,t){return it.isStale(new Request(Ne(e)),t)}function mo(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 $t=new Set;async function ct(e,t,{strategy:r=le(),cacheInstance:o,shouldCacheResult:n=()=>true,waitUntil:a,debugInfo:s}){let c=mo([...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()||[])}});},C=void 0;if(!o||!r||r.mode===kt){let f=await t({addDebugData:y});return f}let p=f=>yo(o,c,{value:f,debugInfo:void 0},r),l=await lo(o,c);if(l&&typeof l[0]!="string"){let[{value:f,debugInfo:P},h]=l;let T=fo(c,h)?"STALE":"HIT";if(!$t.has(c)&&T==="STALE"){$t.add(c);let g=Promise.resolve().then(async()=>{let v=Date.now();try{let R=await t({addDebugData:y});n(R)&&(await p(R),C?.({result:R,cacheStatus:"PUT",overrideStartTime:v}));}catch(R){R.message&&(R.message="SWR in sub-request failed: "+R.message),console.error(R);}finally{$t.delete(c);}});a?.(g);}return f}let S=await t({addDebugData:y});if(n(S)){let f=Promise.resolve().then(async()=>{await p(S);});a?.(f);}return S}var ma=["set-cookie","server-timing"];function Co(e,t){return [e,{status:t.status,statusText:t.statusText,headers:[...t.headers].filter(([r])=>!ma.includes(r.toLowerCase()))}]}function go([e,t]){return [e,new Response(e,t)]}async function ut(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=le()),ct(n,async()=>{if(c){let m=null,p=await graphqlClient.createGraphQLClient({url:e,customFetchApi:async(f,P)=>(m=await fetch(f,P),u?.(m.headers),m),headers:t.headers}).requestStream(c.query,{variables:c.variables}),l,S;for await(let f of p){let{data:P,errors:h}=f;l=P,S=h?.graphQLErrors??h;}return m?.ok?Co({data:l,errors:S},m):m}let d=await fetch(e,t);if(u?.(d.headers),!d.ok)return d;let y=await d.text().catch(()=>"");try{y&&(y=te(y));}catch{}return Co(y,d)},{cacheInstance:r,waitUntil:s,strategy:o??null,debugInfo:i,shouldCacheResult:d=>"ok"in d?!1:a(...go(d))}).then(d=>"ok"in d?[null,d]:go(d))}function Ca(e){let{cache:t,waitUntil:r,request:o}=e;return {run:({cacheKey:n,cacheStrategy:a,shouldCacheResult:s},i)=>ct(n,i,{shouldCacheResult:s,strategy:a,cacheInstance:t,waitUntil:r,debugInfo:{...ce(o),stackInfo:J?.()}}),fetch:(n,a,s)=>ut(n,a??{},{waitUntil:r,cacheKey:[n,a],cacheInstance:t,debugInfo:{url:n,...ce(o),stackInfo:J?.(),displayName:s?.displayName},cache:s.cacheStrategy,...s}).then(([i,c])=>({data:i,response:c}))}}var qt=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),d=(Date.now()-n)/1e3;if(d>c+u){this.#e.delete(t.url);return}let m=d>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 ho="cartFormInput";function re({children:e,action:t,inputs:r,route:o,fetcherKey:n}){let a=reactRouter.useFetcher({key:n});return jsxRuntime.jsxs(a.Form,{action:o||"",method:"post",children:[(t||r)&&jsxRuntime.jsx("input",{type:"hidden",name:ho,value:JSON.stringify({action:t,inputs:r})}),typeof e=="function"?e(a):e]})}re.INPUT_NAME=ho;re.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 ha(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}}}re.getFormInput=ha;var Gt=e=>{let t=cookie.parse(Ut(e,"Cookie")||"");return ()=>t.cart?`gid://shopify/Cart/${t.cart}`:void 0};var Bt=e=>t=>{let r=new Headers;return r.append("Set-Cookie",cookie.stringify("cart",t.split("/").pop()||"",{path:"/",...e})),r};function dt(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():`weak-${Math.random().toString(16).substring(2)}`}var Me="2026.4.3";function Te(e){return e.replace(/\s*#.*$/gm,"").replace(/\s+/gm," ").trim()}var Pa=/(^|}\s)query[\s({]/im,va=/(^|}\s)mutation[\s({]/im;function pt(e,t){if(!Pa.test(e))throw new Error(`[h2:error:${t}] Can only execute queries`)}function lt(e,t){if(!va.test(e))throw new Error(`[h2:error:${t}] Can only execute mutations`)}var ye=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 Fe({url:e,response:t,errors:r,type:o,query:n,queryVariables:a,ErrorConstructor:s=Error,client:
|
|
26
|
+
`),t}toJSON(){return {name:"Error",message:""}}};function Fe({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?.(d=>d.message).join(`
|
|
27
27
|
`))||`URL: ${e}
|
|
28
|
-
API response error: ${t.status}`,u=new ye(
|
|
28
|
+
API response error: ${t.status}`,u=new ye(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 wa={language:"EN",country:"US"};function Ro(e){let {storefrontHeaders:t,cache:r,waitUntil:o,i18n:n,storefrontId:a,logErrors:s=true,...i}=e,{getPublicTokenHeaders:u,getPrivateTokenHeaders:d,getStorefrontApiUrl:y,getShopifyDomain:m}=hydrogenReact.createStorefrontClient(i),p=(i.privateStorefrontToken?d:u)({contentType:"json",buyerIp:t?.buyerIp||""});t?.buyerIp&&(p[Ye]=t.buyerIp),t?.buyerIpSig&&(p[ge]=t.buyerIpSig),p[Ee]=t?.requestGroupId||dt(),a&&(p[hydrogenReact.SHOPIFY_STOREFRONT_ID_HEADER]=a),(p["user-agent"]=`Hydrogen ${Me}`);let l=t?.cookie??"";l&&(p.cookie=l);let S,f;if(!/\b_shopify_(analytics|marketing)=/.test(l)){let g=l.match(/\b_shopify_y=([^;]+)/)?.[1],v=l.match(/\b_shopify_s=([^;]+)/)?.[1];g&&(p[hydrogenReact.SHOPIFY_STOREFRONT_Y_HEADER]=g),v&&(p[hydrogenReact.SHOPIFY_STOREFRONT_S_HEADER]=v),S=g??dt(),f=v??dt(),p[hydrogenReact.SHOPIFY_UNIQUE_TOKEN_HEADER]=S,p[hydrogenReact.SHOPIFY_VISIT_TOKEN_HEADER]=f;}let P,h=JSON.stringify({"content-type":p["content-type"],"user-agent":p["user-agent"],[Pt]:p[Pt],[vt]:p[vt],[It]:p[It],[be]:p[be]});async function T({query:g,mutation:v,variables:R,cache:U,headers:V=[],storefrontApiVersion:W,displayName:Tt,stackInfo:St}){let Ke=V instanceof Headers?Object.fromEntries(V.entries()):Array.isArray(V)?Object.fromEntries(V):V,K=g??v,A={...R};n&&(!R?.country&&/\$country/.test(K)&&(A.country=n.country),!R?.language&&/\$language/.test(K)&&(A.language=n.language));let E=y({storefrontApiVersion:W}),k=JSON.stringify({query:K,variables:A}),L={method:"POST",headers:{...p,...Ke},body:k},Q=[E,L.method,h,L.body],ae=K.includes("@defer")?{query:K,variables:A}:void 0,[$,j]=await ut(E,L,{cacheInstance:v?void 0:r,cache:U||Ae(),cacheKey:Q,waitUntil:o,shouldCacheResponse:M=>!M?.errors,debugInfo:{requestId:L.headers[Ee],displayName:Tt,url:E,stackInfo:St,graphql:k,purpose:t?.purpose},streamConfig:ae,onRawHeaders:M=>{P??={setCookie:M.getSetCookie(),serverTiming:M.get("server-timing")??""};}}),z={url:E,response:j,type:v?"mutation":"query",query:K,queryVariables:A,errors:void 0};if(!j.ok){let M,X=$;try{X??=await j.text(),M=te(X);}catch{M=[{message:X??"Could not parse Storefront API response"}];}Fe({...z,errors:M});}let{data:N,errors:q}=$;q=q?Array.isArray(q)?q:[q]:void 0;let Ie=q?.map(({message:M,...X})=>new ye(M,{...X,clientOperation:`storefront.${z.type}`,requestId:j.headers.get("x-request-id"),queryVariables:A,query:K}));return I(N,Ie)}return {storefront:{query(g,v){g=Te(g),pt(g,"storefront.query");let R=So?.(g);return he(T({...v,query:g,stackInfo:J?.(R)}),{stackOffset:R,logErrors:s})},mutate(g,v){g=Te(g),lt(g,"storefront.mutate");let R=So?.(g);return he(T({...v,mutation:g,stackInfo:J?.(R)}),{stackOffset:R,logErrors:s})},cache:r,CacheNone:Vt,CacheLong:Mt,CacheShort:le,CacheCustom:Ft,generateCacheControlHeader:Ve,getPublicTokenHeaders:u,getPrivateTokenHeaders:d,getHeaders:()=>({...p}),getShopifyDomain:m,getApiUrl:y,i18n:n??wa,isStorefrontApiUrl(g){return Lt.test(nt(g.url??""))},async forward(g,v){let R=new Headers([...ke(W=>g.headers.get(W),["accept","accept-encoding","accept-language","access-control-request-headers","access-control-request-method","content-type","content-length","cookie","origin","referer","user-agent",be,hydrogenReact.SHOPIFY_UNIQUE_TOKEN_HEADER,hydrogenReact.SHOPIFY_VISIT_TOKEN_HEADER]),...ke(W=>p[W],[Ye,ge,hydrogenReact.SHOPIFY_STOREFRONT_ID_HEADER,Ee])]);t?.buyerIp&&R.set("x-forwarded-for",t.buyerIp);let U=v?.storefrontApiVersion??nt(g.url).match(Lt)?.[1],V=await fetch(y({storefrontApiVersion:U}),{method:g.method,body:g.body,headers:R});return new Response(V.body,V)},isMcpUrl(g){return uo.test(nt(g.url??""))},async forwardMcp(g){let v=new Headers([...ke(U=>g.headers.get(U),["accept","accept-encoding","accept-language","content-type","cookie","origin","referer","user-agent"]),...ke(U=>p[U],[Ye,ge,be,Ee,hydrogenReact.SHOPIFY_STOREFRONT_ID_HEADER])]);t?.buyerIp&&v.set("x-forwarded-for",t.buyerIp);let R=`${m()}/api/mcp`;try{let U=await fetch(R,{method:g.method,body:g.body,headers:v});return new Response(U.body,U)}catch(U){let W=U instanceof Error?U.message:"Internal proxy error";return new Response(JSON.stringify({jsonrpc:"2.0",error:{code:-32603,message:W},id:null}),{status:502,headers:{"content-type":"application/json"}})}},setCollectedSubrequestHeaders:g=>{if(P)for(let V of P.setCookie)g.headers.append("Set-Cookie",V);let v=Vr(P?.serverTiming),R=g.headers.get("content-type")?.startsWith("text/html");we(g,{...R?{_y:S,_s:f}:void 0,...v}),R&&P&&P.setCookie.length>1&&v?._y&&v?._s&&v?._cmp&&we(g,{[ze]:"1"});}}}}var So=void 0;function I(e,t){return {...e,...t&&{errors:t}}}function b(e){return e?.visitorConsent!==void 0}function w(e=false){let t=`$country: CountryCode = ZZ
|
|
29
29
|
$language: LanguageCode`;return e?`${t}
|
|
30
|
-
$visitorConsent: VisitorConsent`:t}function
|
|
30
|
+
$visitorConsent: VisitorConsent`:t}function x(e=false){return e?"@inContext(country: $country, language: $language, visitorConsent: $visitorConsent)":"@inContext(country: $country, language: $language)"}function Wt({storefront:e,customerAccount:t,getCartId:r,cartFragment:o}){return async n=>{let a=n?.cartId??r();if(!a)return null;let s=b(n),[i,{cart:c,errors:u}]=await Promise.all([t?t.isLoggedIn():false,e.query(xa(o,{includeVisitorConsent:s}),{variables:{cartId:a,...n},cache:e.CacheNone()})]);if(i&&c&&typeof c=="object"&&"checkoutUrl"in c&&typeof c.checkoutUrl=="string"){let d=new URL(c.checkoutUrl);d.searchParams.set("logged_in","true"),Object.assign(c,{checkoutUrl:d.toString()});}return c||u?I(c,u):null}}var xa=(e=Da,t={})=>`#graphql
|
|
31
31
|
query CartQuery(
|
|
32
32
|
$cartId: ID!
|
|
33
33
|
$numCartLines: Int = 100
|
|
34
34
|
${w(t.includeVisitorConsent)}
|
|
35
|
-
) ${
|
|
35
|
+
) ${x(t.includeVisitorConsent)} {
|
|
36
36
|
cart(id: $cartId) {
|
|
37
37
|
...CartApiQuery
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
${e}
|
|
42
|
-
`,
|
|
42
|
+
`,Da=`#graphql
|
|
43
43
|
fragment CartApiQuery on Cart {
|
|
44
44
|
updatedAt
|
|
45
45
|
id
|
|
@@ -154,7 +154,7 @@ API response error: ${t.status}`,u=new ye(i,{query:n,queryVariables:a,cause:{err
|
|
|
154
154
|
width
|
|
155
155
|
height
|
|
156
156
|
}
|
|
157
|
-
`;var
|
|
157
|
+
`;var D=`#graphql
|
|
158
158
|
fragment CartApiError on CartUserError {
|
|
159
159
|
message
|
|
160
160
|
field
|
|
@@ -172,11 +172,11 @@ API response error: ${t.status}`,u=new ye(i,{query:n,queryVariables:a,cause:{err
|
|
|
172
172
|
message
|
|
173
173
|
target
|
|
174
174
|
}
|
|
175
|
-
`;function jt(e){return async(t,r)=>{let o=e.customerAccount?await e.customerAccount.getBuyer():void 0,{cartId:n,...a}=r||{},{buyerIdentity:s,...
|
|
175
|
+
`;function jt(e){return async(t,r)=>{let o=e.customerAccount?await e.customerAccount.getBuyer():void 0,{cartId:n,...a}=r||{},{buyerIdentity:s,...i}=t,c=b(r),{cartCreate:u,errors:d}=await e.storefront.mutate(Oa(e.cartFragment,{includeVisitorConsent:c}),{variables:{input:{...i,buyerIdentity:{...o,...s}},...a}});return I(u,d)}}var Oa=(e=O,t={})=>`#graphql
|
|
176
176
|
mutation cartCreate(
|
|
177
177
|
$input: CartInput!
|
|
178
178
|
${w(t.includeVisitorConsent)}
|
|
179
|
-
) ${
|
|
179
|
+
) ${x(t.includeVisitorConsent)} {
|
|
180
180
|
cartCreate(input: $input) {
|
|
181
181
|
cart {
|
|
182
182
|
...CartApiMutation
|
|
@@ -191,14 +191,14 @@ API response error: ${t.status}`,u=new ye(i,{query:n,queryVariables:a,cause:{err
|
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
193
|
${e}
|
|
194
|
-
${
|
|
194
|
+
${D}
|
|
195
195
|
${_}
|
|
196
|
-
`;function Kt(e){return async(t,r)=>{let o=b(r),{cartLinesAdd:n,errors:a}=await e.storefront.mutate(
|
|
196
|
+
`;function Kt(e){return async(t,r)=>{let o=b(r),{cartLinesAdd:n,errors:a}=await e.storefront.mutate(_a(e.cartFragment,{includeVisitorConsent:o}),{variables:{cartId:e.getCartId(),lines:t,...r}});return I(n,a)}}var _a=(e=O,t={})=>`#graphql
|
|
197
197
|
mutation cartLinesAdd(
|
|
198
198
|
$cartId: ID!
|
|
199
199
|
$lines: [CartLineInput!]!
|
|
200
200
|
${w(t.includeVisitorConsent)}
|
|
201
|
-
) ${
|
|
201
|
+
) ${x(t.includeVisitorConsent)} {
|
|
202
202
|
cartLinesAdd(cartId: $cartId, lines: $lines) {
|
|
203
203
|
cart {
|
|
204
204
|
...CartApiMutation
|
|
@@ -212,14 +212,14 @@ API response error: ${t.status}`,u=new ye(i,{query:n,queryVariables:a,cause:{err
|
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
214
|
${e}
|
|
215
|
-
${
|
|
215
|
+
${D}
|
|
216
216
|
${_}
|
|
217
|
-
`;var
|
|
217
|
+
`;var Po="__h_pending_";function vo(e){return Po+e}function yt(e){return e.startsWith(Po)}function ft(e,t){if(t.some(r=>yt(typeof r=="string"?r:r.id)))throw new Error(`Tried to perform an action on an optimistic line. Make sure to disable your "${e}" CartForm action when the line is optimistic.`)}function Yt(e){return async(t,r)=>{ft("updateLines",t);let o=b(r),{cartLinesUpdate:n,errors:a}=await e.storefront.mutate(Ua(e.cartFragment,{includeVisitorConsent:o}),{variables:{cartId:e.getCartId(),lines:t,...r}});return I(n,a)}}var Ua=(e=O,t={})=>`#graphql
|
|
218
218
|
mutation cartLinesUpdate(
|
|
219
219
|
$cartId: ID!
|
|
220
220
|
$lines: [CartLineUpdateInput!]!
|
|
221
221
|
${w(t.includeVisitorConsent)}
|
|
222
|
-
) ${
|
|
222
|
+
) ${x(t.includeVisitorConsent)} {
|
|
223
223
|
cartLinesUpdate(cartId: $cartId, lines: $lines) {
|
|
224
224
|
cart {
|
|
225
225
|
...CartApiMutation
|
|
@@ -233,14 +233,14 @@ API response error: ${t.status}`,u=new ye(i,{query:n,queryVariables:a,cause:{err
|
|
|
233
233
|
}
|
|
234
234
|
}
|
|
235
235
|
${e}
|
|
236
|
-
${
|
|
236
|
+
${D}
|
|
237
237
|
${_}
|
|
238
|
-
`;function Jt(e){return async(t,r)=>{ft("removeLines",t);let o=b(r),{cartLinesRemove:n,errors:a}=await e.storefront.mutate(
|
|
238
|
+
`;function Jt(e){return async(t,r)=>{ft("removeLines",t);let o=b(r),{cartLinesRemove:n,errors:a}=await e.storefront.mutate(La(e.cartFragment,{includeVisitorConsent:o}),{variables:{cartId:e.getCartId(),lineIds:t,...r}});return I(n,a)}}var La=(e=O,t={})=>`#graphql
|
|
239
239
|
mutation cartLinesRemove(
|
|
240
240
|
$cartId: ID!
|
|
241
241
|
$lineIds: [ID!]!
|
|
242
242
|
${w(t.includeVisitorConsent)}
|
|
243
|
-
) ${
|
|
243
|
+
) ${x(t.includeVisitorConsent)} {
|
|
244
244
|
cartLinesRemove(cartId: $cartId, lineIds: $lineIds) {
|
|
245
245
|
cart {
|
|
246
246
|
...CartApiMutation
|
|
@@ -254,14 +254,14 @@ API response error: ${t.status}`,u=new ye(i,{query:n,queryVariables:a,cause:{err
|
|
|
254
254
|
}
|
|
255
255
|
}
|
|
256
256
|
${e}
|
|
257
|
-
${
|
|
257
|
+
${D}
|
|
258
258
|
${_}
|
|
259
|
-
`;function zt(e){return async(t,r)=>{let o=t.filter((c,
|
|
259
|
+
`;function zt(e){return async(t,r)=>{let o=t.filter((i,c,u)=>u.indexOf(i)===c),n=b(r),{cartDiscountCodesUpdate:a,errors:s}=await e.storefront.mutate(ka(e.cartFragment,{includeVisitorConsent:n}),{variables:{cartId:e.getCartId(),discountCodes:o,...r}});return I(a,s)}}var ka=(e=O,t={})=>`#graphql
|
|
260
260
|
mutation cartDiscountCodesUpdate(
|
|
261
261
|
$cartId: ID!
|
|
262
262
|
$discountCodes: [String!]!
|
|
263
263
|
${w(t.includeVisitorConsent)}
|
|
264
|
-
) ${
|
|
264
|
+
) ${x(t.includeVisitorConsent)} {
|
|
265
265
|
cartDiscountCodesUpdate(cartId: $cartId, discountCodes: $discountCodes) {
|
|
266
266
|
... @defer {
|
|
267
267
|
cart {
|
|
@@ -277,14 +277,14 @@ API response error: ${t.status}`,u=new ye(i,{query:n,queryVariables:a,cause:{err
|
|
|
277
277
|
}
|
|
278
278
|
}
|
|
279
279
|
${e}
|
|
280
|
-
${
|
|
280
|
+
${D}
|
|
281
281
|
${_}
|
|
282
|
-
`;function Xt(e){return async(t,r)=>{t.companyLocationId&&e.customerAccount&&e.customerAccount.setBuyer({companyLocationId:t.companyLocationId});let o=e.customerAccount?await e.customerAccount.getBuyer():void 0,n=b(r),{cartBuyerIdentityUpdate:a,errors:s}=await e.storefront.mutate(
|
|
282
|
+
`;function Xt(e){return async(t,r)=>{t.companyLocationId&&e.customerAccount&&e.customerAccount.setBuyer({companyLocationId:t.companyLocationId});let o=e.customerAccount?await e.customerAccount.getBuyer():void 0,n=b(r),{cartBuyerIdentityUpdate:a,errors:s}=await e.storefront.mutate(Va(e.cartFragment,{includeVisitorConsent:n}),{variables:{cartId:e.getCartId(),buyerIdentity:{...o,...t},...r}});return I(a,s)}}var Va=(e=O,t={})=>`#graphql
|
|
283
283
|
mutation cartBuyerIdentityUpdate(
|
|
284
284
|
$cartId: ID!
|
|
285
285
|
$buyerIdentity: CartBuyerIdentityInput!
|
|
286
286
|
${w(t.includeVisitorConsent)}
|
|
287
|
-
) ${
|
|
287
|
+
) ${x(t.includeVisitorConsent)} {
|
|
288
288
|
cartBuyerIdentityUpdate(cartId: $cartId, buyerIdentity: $buyerIdentity) {
|
|
289
289
|
cart {
|
|
290
290
|
...CartApiMutation
|
|
@@ -298,14 +298,14 @@ API response error: ${t.status}`,u=new ye(i,{query:n,queryVariables:a,cause:{err
|
|
|
298
298
|
}
|
|
299
299
|
}
|
|
300
300
|
${e}
|
|
301
|
-
${
|
|
301
|
+
${D}
|
|
302
302
|
${_}
|
|
303
|
-
`;function Zt(e){return async(t,r)=>{let o=b(r),{cartNoteUpdate:n,errors:a}=await e.storefront.mutate(
|
|
303
|
+
`;function Zt(e){return async(t,r)=>{let o=b(r),{cartNoteUpdate:n,errors:a}=await e.storefront.mutate(Na(e.cartFragment,{includeVisitorConsent:o}),{variables:{cartId:e.getCartId(),note:t,...r}});return I(n,a)}}var Na=(e=O,t={})=>`#graphql
|
|
304
304
|
mutation cartNoteUpdate(
|
|
305
305
|
$cartId: ID!
|
|
306
306
|
$note: String!
|
|
307
307
|
${w(t.includeVisitorConsent)}
|
|
308
|
-
) ${
|
|
308
|
+
) ${x(t.includeVisitorConsent)} {
|
|
309
309
|
cartNoteUpdate(cartId: $cartId, note: $note) {
|
|
310
310
|
cart {
|
|
311
311
|
...CartApiMutation
|
|
@@ -319,14 +319,14 @@ API response error: ${t.status}`,u=new ye(i,{query:n,queryVariables:a,cause:{err
|
|
|
319
319
|
}
|
|
320
320
|
}
|
|
321
321
|
${e}
|
|
322
|
-
${
|
|
322
|
+
${D}
|
|
323
323
|
${_}
|
|
324
|
-
`;function er(e){return async(t,r)=>{let o=b(r),{cartSelectedDeliveryOptionsUpdate:n,errors:a}=await e.storefront.mutate(
|
|
324
|
+
`;function er(e){return async(t,r)=>{let o=b(r),{cartSelectedDeliveryOptionsUpdate:n,errors:a}=await e.storefront.mutate(Ma(e.cartFragment,{includeVisitorConsent:o}),{variables:{cartId:e.getCartId(),selectedDeliveryOptions:t,...r}});return I(n,a)}}var Ma=(e=O,t={})=>`#graphql
|
|
325
325
|
mutation cartSelectedDeliveryOptionsUpdate(
|
|
326
326
|
$cartId: ID!
|
|
327
327
|
$selectedDeliveryOptions: [CartSelectedDeliveryOptionInput!]!
|
|
328
328
|
${w(t.includeVisitorConsent)}
|
|
329
|
-
) ${
|
|
329
|
+
) ${x(t.includeVisitorConsent)} {
|
|
330
330
|
cartSelectedDeliveryOptionsUpdate(cartId: $cartId, selectedDeliveryOptions: $selectedDeliveryOptions) {
|
|
331
331
|
cart {
|
|
332
332
|
...CartApiMutation
|
|
@@ -340,14 +340,14 @@ API response error: ${t.status}`,u=new ye(i,{query:n,queryVariables:a,cause:{err
|
|
|
340
340
|
}
|
|
341
341
|
}
|
|
342
342
|
${e}
|
|
343
|
-
${
|
|
343
|
+
${D}
|
|
344
344
|
${_}
|
|
345
|
-
`;function tr(e){return async(t,r)=>{let o=b(r),{cartAttributesUpdate:n,errors:a}=await e.storefront.mutate(
|
|
345
|
+
`;function tr(e){return async(t,r)=>{let o=b(r),{cartAttributesUpdate:n,errors:a}=await e.storefront.mutate(Fa(e.cartFragment,{includeVisitorConsent:o}),{variables:{cartId:r?.cartId||e.getCartId(),attributes:t,...r}});return I(n,a)}}var Fa=(e=O,t={})=>`#graphql
|
|
346
346
|
mutation cartAttributesUpdate(
|
|
347
347
|
$cartId: ID!
|
|
348
348
|
$attributes: [AttributeInput!]!
|
|
349
349
|
${w(t.includeVisitorConsent)}
|
|
350
|
-
) ${
|
|
350
|
+
) ${x(t.includeVisitorConsent)} {
|
|
351
351
|
cartAttributesUpdate(cartId: $cartId, attributes: $attributes) {
|
|
352
352
|
cart {
|
|
353
353
|
...CartApiMutation
|
|
@@ -361,13 +361,13 @@ API response error: ${t.status}`,u=new ye(i,{query:n,queryVariables:a,cause:{err
|
|
|
361
361
|
}
|
|
362
362
|
}
|
|
363
363
|
${e}
|
|
364
|
-
${
|
|
364
|
+
${D}
|
|
365
365
|
${_}
|
|
366
|
-
`;function rr(e){return async(t,r)=>{let o=r?.cartId||e.getCartId(),n=t.map(
|
|
366
|
+
`;function rr(e){return async(t,r)=>{let o=r?.cartId||e.getCartId(),n=t.map(c=>({...c,ownerId:o})),a=b(r),{cartMetafieldsSet:s,errors:i}=await e.storefront.mutate(Ha({includeVisitorConsent:a}),{variables:{metafields:n,...r}});return I({cart:{id:o},...s},i)}}var Ha=(e={})=>`#graphql
|
|
367
367
|
mutation cartMetafieldsSet(
|
|
368
368
|
$metafields: [CartMetafieldsSetInput!]!
|
|
369
369
|
${w(e.includeVisitorConsent)}
|
|
370
|
-
) ${
|
|
370
|
+
) ${x(e.includeVisitorConsent)} {
|
|
371
371
|
cartMetafieldsSet(metafields: $metafields) {
|
|
372
372
|
userErrors {
|
|
373
373
|
code
|
|
@@ -377,11 +377,11 @@ API response error: ${t.status}`,u=new ye(i,{query:n,queryVariables:a,cause:{err
|
|
|
377
377
|
}
|
|
378
378
|
}
|
|
379
379
|
}
|
|
380
|
-
`;function or(e){return async(t,r)=>{let o=r?.cartId||e.getCartId(),n=b(r),{cartMetafieldDelete:a,errors:s}=await e.storefront.mutate(
|
|
380
|
+
`;function or(e){return async(t,r)=>{let o=r?.cartId||e.getCartId(),n=b(r),{cartMetafieldDelete:a,errors:s}=await e.storefront.mutate($a({includeVisitorConsent:n}),{variables:{input:{ownerId:o,key:t},...r}});return I({cart:{id:o},...a},s)}}var $a=(e={})=>`#graphql
|
|
381
381
|
mutation cartMetafieldDelete(
|
|
382
382
|
$input: CartMetafieldDeleteInput!
|
|
383
383
|
${w(e.includeVisitorConsent)}
|
|
384
|
-
) ${
|
|
384
|
+
) ${x(e.includeVisitorConsent)} {
|
|
385
385
|
cartMetafieldDelete(input: $input) {
|
|
386
386
|
userErrors {
|
|
387
387
|
code
|
|
@@ -390,12 +390,12 @@ API response error: ${t.status}`,u=new ye(i,{query:n,queryVariables:a,cause:{err
|
|
|
390
390
|
}
|
|
391
391
|
}
|
|
392
392
|
}
|
|
393
|
-
`;function nr(e){return async(t,r)=>{let o=b(r),{cartGiftCardCodesUpdate:n,errors:a}=await e.storefront.mutate(
|
|
393
|
+
`;function nr(e){return async(t,r)=>{let o=b(r),{cartGiftCardCodesUpdate:n,errors:a}=await e.storefront.mutate(qa(e.cartFragment,{includeVisitorConsent:o}),{variables:{cartId:e.getCartId(),giftCardCodes:t,...r}});return I(n,a)}}var qa=(e=O,t={})=>`#graphql
|
|
394
394
|
mutation cartGiftCardCodesUpdate(
|
|
395
395
|
$cartId: ID!
|
|
396
396
|
$giftCardCodes: [String!]!
|
|
397
397
|
${w(t.includeVisitorConsent)}
|
|
398
|
-
) ${
|
|
398
|
+
) ${x(t.includeVisitorConsent)} {
|
|
399
399
|
cartGiftCardCodesUpdate(cartId: $cartId, giftCardCodes: $giftCardCodes) {
|
|
400
400
|
cart {
|
|
401
401
|
...CartApiMutation
|
|
@@ -409,9 +409,9 @@ API response error: ${t.status}`,u=new ye(i,{query:n,queryVariables:a,cause:{err
|
|
|
409
409
|
}
|
|
410
410
|
}
|
|
411
411
|
${e}
|
|
412
|
-
${
|
|
412
|
+
${D}
|
|
413
413
|
${_}
|
|
414
|
-
`;function ar(e){return async(t,r)=>{let{cartGiftCardCodesAdd:o,errors:n}=await e.storefront.mutate(
|
|
414
|
+
`;function ar(e){return async(t,r)=>{let{cartGiftCardCodesAdd:o,errors:n}=await e.storefront.mutate(Ga(e.cartFragment),{variables:{cartId:e.getCartId(),giftCardCodes:t,...r}});return I(o,n)}}var Ga=(e=O)=>`#graphql
|
|
415
415
|
mutation cartGiftCardCodesAdd(
|
|
416
416
|
$cartId: ID!
|
|
417
417
|
$giftCardCodes: [String!]!
|
|
@@ -431,14 +431,14 @@ API response error: ${t.status}`,u=new ye(i,{query:n,queryVariables:a,cause:{err
|
|
|
431
431
|
}
|
|
432
432
|
}
|
|
433
433
|
${e}
|
|
434
|
-
${
|
|
434
|
+
${D}
|
|
435
435
|
${_}
|
|
436
|
-
`;function sr(e){return async(t,r)=>{let o=b(r),{cartGiftCardCodesRemove:n,errors:a}=await e.storefront.mutate(
|
|
436
|
+
`;function sr(e){return async(t,r)=>{let o=b(r),{cartGiftCardCodesRemove:n,errors:a}=await e.storefront.mutate(Ba(e.cartFragment,{includeVisitorConsent:o}),{variables:{cartId:e.getCartId(),appliedGiftCardIds:t,...r}});return I(n,a)}}var Ba=(e=O,t={})=>`#graphql
|
|
437
437
|
mutation cartGiftCardCodesRemove(
|
|
438
438
|
$cartId: ID!
|
|
439
439
|
$appliedGiftCardIds: [ID!]!
|
|
440
440
|
${w(t.includeVisitorConsent)}
|
|
441
|
-
) ${
|
|
441
|
+
) ${x(t.includeVisitorConsent)} {
|
|
442
442
|
cartGiftCardCodesRemove(cartId: $cartId, appliedGiftCardIds: $appliedGiftCardIds) {
|
|
443
443
|
cart {
|
|
444
444
|
...CartApiMutation
|
|
@@ -452,14 +452,14 @@ API response error: ${t.status}`,u=new ye(i,{query:n,queryVariables:a,cause:{err
|
|
|
452
452
|
}
|
|
453
453
|
}
|
|
454
454
|
${e}
|
|
455
|
-
${
|
|
455
|
+
${D}
|
|
456
456
|
${_}
|
|
457
|
-
`;function Io(e){return async(t,r)=>{let o=b(r),{cartDeliveryAddressesAdd:n,errors:a}=await e.storefront.mutate(
|
|
457
|
+
`;function Io(e){return async(t,r)=>{let o=b(r),{cartDeliveryAddressesAdd:n,errors:a}=await e.storefront.mutate(Qa(e.cartFragment,{includeVisitorConsent:o}),{variables:{cartId:e.getCartId(),addresses:t,...r}});return I(n,a)}}var Qa=(e=O,t={})=>`#graphql
|
|
458
458
|
mutation cartDeliveryAddressesAdd(
|
|
459
459
|
$cartId: ID!
|
|
460
460
|
$addresses: [CartSelectableAddressInput!]!,
|
|
461
461
|
${w(t.includeVisitorConsent)}
|
|
462
|
-
) ${
|
|
462
|
+
) ${x(t.includeVisitorConsent)} {
|
|
463
463
|
cartDeliveryAddressesAdd(addresses: $addresses, cartId: $cartId) {
|
|
464
464
|
cart {
|
|
465
465
|
...CartApiMutation
|
|
@@ -473,14 +473,14 @@ API response error: ${t.status}`,u=new ye(i,{query:n,queryVariables:a,cause:{err
|
|
|
473
473
|
}
|
|
474
474
|
}
|
|
475
475
|
${e}
|
|
476
|
-
${
|
|
476
|
+
${D}
|
|
477
477
|
${_}
|
|
478
|
-
`;function
|
|
478
|
+
`;function Eo(e){return async(t,r)=>{let o=b(r),{cartDeliveryAddressesRemove:n,errors:a}=await e.storefront.mutate(Wa(e.cartFragment,{includeVisitorConsent:o}),{variables:{cartId:e.getCartId(),addressIds:t,...r}});return I(n,a)}}var Wa=(e=O,t={})=>`#graphql
|
|
479
479
|
mutation cartDeliveryAddressesRemove(
|
|
480
480
|
$cartId: ID!
|
|
481
481
|
$addressIds: [ID!]!,
|
|
482
482
|
${w(t.includeVisitorConsent)}
|
|
483
|
-
) ${
|
|
483
|
+
) ${x(t.includeVisitorConsent)} {
|
|
484
484
|
cartDeliveryAddressesRemove(addressIds: $addressIds, cartId: $cartId) {
|
|
485
485
|
cart {
|
|
486
486
|
...CartApiMutation
|
|
@@ -494,14 +494,14 @@ API response error: ${t.status}`,u=new ye(i,{query:n,queryVariables:a,cause:{err
|
|
|
494
494
|
}
|
|
495
495
|
}
|
|
496
496
|
${e}
|
|
497
|
-
${
|
|
497
|
+
${D}
|
|
498
498
|
${_}
|
|
499
|
-
`;function
|
|
499
|
+
`;function bo(e){return async(t,r)=>{let o=b(r),{cartDeliveryAddressesUpdate:n,errors:a}=await e.storefront.mutate(ja(e.cartFragment,{includeVisitorConsent:o}),{variables:{cartId:e.getCartId(),addresses:t,...r}});return I(n,a)}}var ja=(e=O,t={})=>`#graphql
|
|
500
500
|
mutation cartDeliveryAddressesUpdate(
|
|
501
501
|
$cartId: ID!
|
|
502
502
|
$addresses: [CartSelectableAddressUpdateInput!]!,
|
|
503
503
|
${w(t.includeVisitorConsent)}
|
|
504
|
-
) ${
|
|
504
|
+
) ${x(t.includeVisitorConsent)} {
|
|
505
505
|
cartDeliveryAddressesUpdate(addresses: $addresses, cartId: $cartId) {
|
|
506
506
|
cart {
|
|
507
507
|
...CartApiMutation
|
|
@@ -515,9 +515,9 @@ API response error: ${t.status}`,u=new ye(i,{query:n,queryVariables:a,cause:{err
|
|
|
515
515
|
}
|
|
516
516
|
}
|
|
517
517
|
${e}
|
|
518
|
-
${
|
|
518
|
+
${D}
|
|
519
519
|
${_}
|
|
520
|
-
`;function
|
|
520
|
+
`;function wo(e){return async(t,r)=>{let{cartDeliveryAddressesReplace:o,errors:n}=await e.storefront.mutate(Ka(e.cartFragment),{variables:{cartId:e.getCartId(),addresses:t,...r}});return I(o,n)}}var Ka=(e=O)=>`#graphql
|
|
521
521
|
mutation cartDeliveryAddressesReplace(
|
|
522
522
|
$cartId: ID!
|
|
523
523
|
$addresses: [CartSelectableAddressInput!]!,
|
|
@@ -537,9 +537,9 @@ API response error: ${t.status}`,u=new ye(i,{query:n,queryVariables:a,cause:{err
|
|
|
537
537
|
}
|
|
538
538
|
}
|
|
539
539
|
${e}
|
|
540
|
-
${
|
|
540
|
+
${D}
|
|
541
541
|
${_}
|
|
542
|
-
`;function ir(e){let{getCartId:t,setCartId:r,storefront:o,customerAccount:n,cartQueryFragment:a,cartMutateFragment:s,buyerIdentity:c}=e,i=t(),u=()=>i||t(),d={storefront:o,getCartId:u,cartFragment:s,customerAccount:n},y=jt(d),m=async function(...p){p[0].buyerIdentity={...c,...p[0].buyerIdentity};let l=await y(...p);return i=l?.cart?.id,l},g={get:Wt({storefront:o,customerAccount:n,getCartId:u,cartFragment:a}),getCartId:u,setCartId:r,create:m,addLines:async(p,l)=>{let P=p.map(f=>({attributes:f.attributes,quantity:f.quantity,merchandiseId:f.merchandiseId,sellingPlanId:f.sellingPlanId,parent:f.parent}));return i||l?.cartId?await Kt(d)(P,l):await m({lines:P,buyerIdentity:c},l)},updateLines:Yt(d),removeLines:Jt(d),updateDiscountCodes:async(p,l)=>i||l?.cartId?await zt(d)(p,l):await m({discountCodes:p},l),updateGiftCardCodes:async(p,l)=>i||l?.cartId?await nr(d)(p,l):await m({giftCardCodes:p},l),addGiftCardCodes:ar(d),removeGiftCardCodes:sr(d),updateBuyerIdentity:async(p,l)=>i||l?.cartId?await Xt(d)(p,l):await m({buyerIdentity:p},l),updateNote:async(p,l)=>i||l?.cartId?await Zt(d)(p,l):await m({note:p},l),updateSelectedDeliveryOption:er(d),updateAttributes:async(p,l)=>i||l?.cartId?await tr(d)(p,l):await m({attributes:p},l),setMetafields:async(p,l)=>i||l?.cartId?await rr(d)(p,l):await m({metafields:p},l),deleteMetafield:or(d),addDeliveryAddresses:Io(d),removeDeliveryAddresses:To(d),updateDeliveryAddresses:Eo(d),replaceDeliveryAddresses:bo(d)};return "customMethods"in e?{...g,...e.customMethods??{}}:g}function ja(e){let t=reactRouter.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=re.getFormInput(a);if(s.action===re.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:Ro(c.selectedVariant.id),merchandise:c.selectedVariant,isOptimistic:true,quantity:c.quantity||1});}else if(s.action===re.ACTIONS.LinesRemove)for(let c of s.inputs.lineIds){let i=o.findIndex(u=>u.id===c);if(i!==-1){if(yt(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===re.ACTIONS.LinesUpdate)for(let c of s.inputs.lines){let i=o.findIndex(u=>c.id===u.id);if(i>-1){if(yt(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 Ka="https://raw.githubusercontent.com/Shopify/hydrogen/main/docs/changelog.json";async function Ya({request:e,changelogUrl:t}){new URL(e.url).searchParams;return fetch(t||Ka)}var He=reactRouter.createContext(),cr=reactRouter.createContext(),ur=reactRouter.createContext(),dr=reactRouter.createContext(),pr=reactRouter.createContext(),lr=reactRouter.createContext(),Ja={storefront:He,cart:cr,customerAccount:ur,env:dr,session:pr,waitUntil:lr};var mt="2026-04",ve=`Shopify Hydrogen ${Me}`,wo="30243aa5-17c1-465a-8493-944bcc4e88aa",F="customerAccount",Re="buyer";var B=class extends Response{constructor(t,r,o){super(`Bad request: ${t}`,{status:400,headers:o});}};function qe(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 za({session:e,customerAccountId:t,customerAccountTokenExchangeUrl:r,httpsOrigin:o,debugInfo:n}){let a=new URLSearchParams,s=e.get(F),c=s?.refreshToken,i=s?.idToken;if(!c)throw new B("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":ve,Origin:o};new Date().getTime();let y=r,m=await fetch(y,{method:"POST",headers:u,body:a});if(!m.ok){let P=await m.text();throw new Response(P,{status:m.status,headers:{"Content-Type":"text/html; charset=utf-8"}})}let{access_token:g,expires_in:p,refresh_token:l}=await m.json();if(!g||g.length===0)throw new B("Unauthorized","Invalid access token received.");e.set(F,{accessToken:g,expiresAt:new Date(new Date().getTime()+(p-120)*1e3).getTime()+"",refreshToken:l,idToken:i});}function Ie(e){e.unset(F),e.unset(Re);}async function Do({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=za({session:r,customerAccountId:o,customerAccountTokenExchangeUrl:n,httpsOrigin:a,debugInfo:s})),await e.refresh,delete e.refresh;}catch(c){throw Ie(r),c&&c.status!==401?c:new B("Unauthorized","Login before querying the Customer Account API.")}}function xo(){let e=Xa();return _o(e)}async function Oo(e){let t=await crypto.subtle.digest({name:"SHA-256"},new TextEncoder().encode(e)),r=Za(t);return _o(r)}function Xa(){let e=new Uint8Array(32);return crypto.getRandomValues(e),String.fromCharCode.apply(null,Array.from(e))}function _o(e){return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Za(e){let t=new Uint8Array(e),r=Array.from(t);return String.fromCharCode(...r)}function Uo(){let e=Date.now().toString(),t=Math.random().toString(36).substring(2);return e+t}async function Lo(e,t,r,o,n){let a=t;if(!e)throw new B("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",wo),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":ve,Origin:o};new Date().getTime();let u=r,d=await fetch(u,{method:"POST",headers:c,body:s});let y=await d.json();if(y.error)throw new B(y.error_description);return y.access_token}function ko(e){return es(e).payload.nonce}function es(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 gt(){return rs(ts())}function ts(){try{return crypto.getRandomValues(new Uint8Array(16))}catch{return new Uint8Array(16).map(()=>Math.random()*255|0)}}function rs(e){return Array.from(e,function(t){return ("0"+(t&255).toString(16)).slice(-2)}).join("")}function Ct(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(No(e,a))return a;console.warn(`Cross-domain redirects are not supported. Tried to redirect from ${o} to ${a}`);}}function No(e,t){try{return new URL(e).origin===new URL(t,e).origin}catch{return false}}function yr({requestUrl:e,defaultUrl:t,redirectUrl:r}){let o=e,n=Vo(e,t),a=r?Vo(e,r):n;return No(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 Vo(e,t){return os(t)?new URL(t):new URL(t,new URL(e).origin)}function os(e){try{return new URL(e),!0}catch{return false}}function Mo(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 ns(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 qe(n)}function mr({session:e,customerAccountId:t,shopId:r,customerApiVersion:o=mt,request:n,waitUntil:a,authUrl:s,customAuthStatusHandler:c,logErrors:i=true,loginPath:u="/account/login",authorizePath:d="/account/authorize",defaultRedirectPath:y="/account",language:m,useCustomAuthDomain:g}){if(o!==mt&&console.warn(`[h2:warn:createCustomerAccountClient] You are using Customer Account API version ${o} when this version of Hydrogen was built for ${mt}.`),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 p=new URL(n.url),l=p.protocol==="http:"?p.origin.replace("http","https"):p.origin,P=yr({requestUrl:l,defaultUrl:d,redirectUrl:s}),f=A=>void 0,R=c||(()=>(f(p.hostname),ns(n,u))),h=Mo(o,r),S=as(h,t),C=h("GRAPHQL"),I={};async function v({query:A,type:E,variables:k={}}){let L=await W();if(!L)throw R();new Date().getTime();let $=await fetch(C,{method:"POST",headers:{"Content-Type":"application/json","User-Agent":ve,Origin:l,Authorization:L},body:JSON.stringify({query:A,variables:k})});let j=await $.text(),z={url:C,response:$,type:E,query:A,queryVariables:k,errors:void 0,client:"customer"};if(!$.ok){if($.status===401)throw Ie(e),R();let N;try{N=te(j);}catch{N=[{message:j}];}Fe({...z,errors:N});}try{let N=te(j),{errors:q}=N,Te=q?.map(({message:M,...X})=>new ye(M,{...X,clientOperation:`customerAccount.${z.type}`,requestId:$.headers.get("x-request-id"),queryVariables:k,query:A}));return {...N,...q&&{errors:Te}}}catch{Fe({...z,errors:[{message:j}]});}}async function U(){if(!r)return false;let A=e.get(F),E=A?.accessToken,k=A?.expiresAt;if(!E||!k)return false;let L=J?.();try{await Do({locks:I,expiresAt:k,session:e,customerAccountId:t,customerAccountTokenExchangeUrl:h("TOKEN_EXCHANGE"),httpsOrigin:l,debugInfo:{waitUntil:a,stackInfo:L,...ce(n)}});}catch{return false}return true}async function V(){if(!await U())throw R()}async function W(){if(await U())return e.get(F)?.accessToken}async function St(A,E){return f(p.hostname),S(),A=Se(A),lt(A,"customer.mutate"),he(v({query:A,type:"mutation",...E}),{logErrors:i})}async function Pt(A,E){return f(p.hostname),S(),A=Se(A),pt(A,"customer.query"),he(v({query:A,type:"query",...E}),{logErrors:i})}function Ke(A){e.set(Re,{...e.get(Re),...A});}async function K(){let A=await W();if(A)return {...e.get(Re),customerAccessToken:A}}return {i18n:{language:m??"EN"},login:async A=>{f(p.hostname),S();let E=new URL(h("AUTH")),k=Uo(),L=gt();E.searchParams.set("client_id",t),E.searchParams.set("scope","openid email"),E.searchParams.append("response_type","code"),E.searchParams.append("redirect_uri",P),E.searchParams.set("scope",h("LOGIN_SCOPE")),E.searchParams.append("state",k),E.searchParams.append("nonce",L);let Q=ss({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 ae=xo(),$=await Oo(ae);return e.set(F,{...e.get(F),codeVerifier:ae,state:k,nonce:L,redirectPath:Ct(n.url)||Y(n,"Referer")||y}),E.searchParams.append("code_challenge",$),E.searchParams.append("code_challenge_method","S256"),qe(E.toString())},logout:async A=>{f(p.hostname),S();let E=e.get(F)?.idToken,k=yr({requestUrl:l,defaultUrl:l,redirectUrl:A?.postLogoutRedirectUri}),L=E?new URL(`${h("LOGOUT")}?${new URLSearchParams([["id_token_hint",E],["post_logout_redirect_uri",k]]).toString()}`).toString():k;Ie(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),qe(L,{headers:Q})},isLoggedIn:U,handleAuthStatus:V,getAccessToken:W,getApiUrl:()=>C,mutate:St,query:Pt,authorize:async()=>{f(p.hostname),S();let A=p.searchParams.get("code"),E=p.searchParams.get("state");if(!A||!E)throw Ie(e),new B("Unauthorized","No code or state parameter found in the redirect URL.");if(e.get(F)?.state!==E)throw Ie(e),new B("Unauthorized","The session state does not match the state parameter. Make sure that the session is configured correctly and passed to `createCustomerAccountClient`.");let k=t,L=new URLSearchParams;L.append("grant_type","authorization_code"),L.append("client_id",k),L.append("redirect_uri",P),L.append("code",A);let Q=e.get(F)?.codeVerifier;if(!Q)throw new B("Unauthorized","No code verifier found in the session. Make sure that the session is configured correctly and passed to `createCustomerAccountClient`.");L.append("code_verifier",Q);let ae={"content-type":"application/x-www-form-urlencoded","User-Agent":ve,Origin:l};new Date().getTime();let z=h("TOKEN_EXCHANGE"),N=await fetch(z,{method:"POST",headers:ae,body:L});if(!N.ok)throw new Response(await N.text(),{status:N.status,headers:{"Content-Type":"text/html; charset=utf-8"}});let{access_token:q,expires_in:Te,id_token:M,refresh_token:X}=await N.json(),vt=e.get(F)?.nonce,Tr=await ko(M);if(vt!==Tr)throw new B("Unauthorized",`Returned nonce does not match: ${vt} !== ${Tr}`);let Er=q;r||(Er=await Lo(q,t,h("TOKEN_EXCHANGE"),l,{...ce(n)}));let pn=e.get(F)?.redirectPath;return e.set(F,{accessToken:Er,expiresAt:new Date(new Date().getTime()+(Te-120)*1e3).getTime()+"",refreshToken:X,idToken:M}),qe(pn||y)},setBuyer:Ke,getBuyer:K,UNSTABLE_setBuyer:A=>{ee("[h2:warn:customerAccount] `customerAccount.UNSTABLE_setBuyer` is deprecated. Please use `customerAccount.setBuyer`."),Ke(A);},UNSTABLE_getBuyer:()=>(ee("[h2:warn:customerAccount] `customerAccount.UNSTABLE_getBuyer` is deprecated. Please use `customerAccount.getBuyer`."),K())}}function as(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 ss(e){return e.localeOverride!=null?fr(e.localeOverride):e.uiLocalesOverride!=null?fr(e.uiLocalesOverride):e.contextLanguage!=null?fr(e.contextLanguage):null}function fr(e){let r=e.toLowerCase().replaceAll("_","-").split("-"),o=r[0],n=r[1];return n?`${o}-${n.toUpperCase()}`:o}function cs(e,t){let{env:r,request:o,cache:n,waitUntil:a,i18n:s,session:c,logErrors:i,storefront:u={},customerAccount:d,cart:y={},buyerIdentity:m}=e;c||console.warn("[h2:warn:createHydrogenContext] A session object is required to create hydrogen context."),d?.unstableB2b&&ee("[h2:warn:createHydrogenContext] `customerAccount.unstableB2b` is now stable. Please remove the `unstableB2b` option.");let{storefront:g}=Po({cache:n,waitUntil:a,i18n:s,logErrors:i,storefrontHeaders:u.headers||io(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}),p=mr({session:c,request:o,waitUntil:a,logErrors:i,customerApiVersion:d?.apiVersion,authUrl:d?.authUrl,customAuthStatusHandler:d?.customAuthStatusHandler,useCustomAuthDomain:d?.useCustomAuthDomain,language:s?.language,customerAccountId:r.PUBLIC_CUSTOMER_ACCOUNT_API_CLIENT_ID,shopId:r.SHOP_ID}),l=ir({getCartId:y.getId||Gt(o.headers),setCartId:y.setId||Bt(),cartQueryFragment:y.queryFragment,cartMutateFragment:y.mutateFragment,customMethods:y.customMethods,buyerIdentity:m,storefront:g,customerAccount:p}),P=new reactRouter.RouterContextProvider;P.set(He,g),P.set(cr,l),P.set(ur,p),P.set(dr,r),P.set(pr,c),a&&P.set(lr,a);let f={storefront:g,cart:l,customerAccount:p,env:r,session:c,waitUntil:a,...t||{}};return new Proxy(P,{get(h,S,C){if(S in h){let I=h[S];return typeof I=="function"?I.bind(h):I}return S in f?f[S]:Reflect.get(h,S,C)},has(h,S){return S in h||S in f},ownKeys(h){return [...Reflect.ownKeys(h),...Object.keys(f)]},getOwnPropertyDescriptor(h,S){if(S in h)return Reflect.getOwnPropertyDescriptor(h,S);if(S in f)return {enumerable:true,configurable:true,writable:false,value:f[S]}}})}function ds({build:e,mode:t,poweredByHeader:r=true,getLoadContext:o,collectTrackingInformation:n=true}){let a=reactRouter.createRequestHandler(e,t),s=r?c=>c.headers.append("powered-by","Shopify, Hydrogen"):void 0;return async c=>{let i=c.method;if((i==="GET"||i==="HEAD")&&c.body)return new Response(`${i} requests cannot have a body`,{status:400});let u=new URL(c.url);if(u.pathname.includes("//"))return new Response(null,{status:301,headers:{location:u.pathname.replace(/\/+/g,"/")}});let d=await o?.(c),y=d?.storefront||d?.get?.(He);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(c)){let p=await y.forward(c);return s?.(p),p}if(y.isMcpUrl(c)){let p=await y.forwardMcp(c);return s?.(p),p}let m=await a(c,d);n&&y.setCollectedSubrequestHeaders(m);let g=c.headers.get("sec-fetch-dest");return (g&&g==="document"||c.headers.get("accept")?.includes("text/html"))&&we(m,{[Je]:"1"}),s?.(m),m}}var Fo=react.createContext(void 0),Ho=Fo.Provider,gr=()=>react.useContext(Fo);function ms(e){let t=gt(),r=gs(t,e);return {nonce:t,header:r,NonceProvider:({children:n})=>react.createElement(Ho,{value:t},n)}}function gs(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 d in i){let y=o[d];d&&y&&(u[d]=Cs(y,i[d]));}return u.scriptSrc instanceof Array?u.scriptSrc=[...u.scriptSrc.filter(d=>!d.startsWith("'nonce")),n]:u.defaultSrc instanceof Array&&(u.defaultSrc=[...u.defaultSrc.filter(d=>!d.startsWith("'nonce")),n]),fs__default.default({directives:u})}function Cs(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 Ss=react.forwardRef((e,t)=>{let{waitForHydration:r,src:o,...n}=e,a=gr();return r?jsxRuntime.jsx(Ps,{src:o,options:n}):jsxRuntime.jsx("script",{suppressHydrationWarning:true,...n,src:o,nonce:a,ref:t})});function Ps({src:e,options:t}){if(!e)throw new Error("`waitForHydration` with the Script component requires a `src` prop");return hydrogenReact.useLoadScript(e,{attributes:t}),null}async function Rs(e){return e;}function Ts(e){let t=reactRouter.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 Es({id:e,data:t}){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("input",{type:"hidden",name:"optimistic-identifier",value:e}),jsxRuntime.jsx("input",{type:"hidden",name:"optimistic-data",value:JSON.stringify(t)})]})}function Os({connection:e,children:t=()=>(console.warn("<Pagination> requires children to work properly"),null),namespace:r=""}){let [o,n]=react.useState(false),a=reactRouter.useNavigation(),s=reactRouter.useLocation();reactRouter.useNavigate();react.useEffect(()=>{a.state==="idle"&&n(false);},[a.state]);let{endCursor:i,hasNextPage:u,hasPreviousPage:d,nextPageUrl:y,nodes:m,previousPageUrl:g,startCursor:p}=_s(e,r),l=react.useMemo(()=>({...s.state,pagination:{...s.state?.pagination||{},[r]:{pageInfo:{endCursor:i,hasPreviousPage:d,hasNextPage:u,startCursor:p},nodes:m}}}),[i,u,d,p,m,r,s.state]),P=react.useMemo(()=>react.forwardRef(function(h,S){return u?react.createElement(reactRouter.Link,{preventScrollReset:true,...h,to:y,state:l,replace:true,ref:S,onClick:()=>n(true)}):null}),[u,y,l]),f=react.useMemo(()=>react.forwardRef(function(h,S){return d?react.createElement(reactRouter.Link,{preventScrollReset:true,...h,to:g,state:l,replace:true,ref:S,onClick:()=>n(true)}):null}),[d,g,l]);return t({state:l,hasNextPage:u,hasPreviousPage:d,isLoading:o,nextPageUrl:y,nodes:m,previousPageUrl:g,NextLink:P,PreviousLink:f})}function ht(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 We(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 _s(e,t=""){e.pageInfo||We("pageInfo"),typeof e.pageInfo.startCursor>"u"&&We("pageInfo.startCursor"),typeof e.pageInfo.endCursor>"u"&&We("pageInfo.endCursor"),typeof e.pageInfo.hasNextPage>"u"&&We("pageInfo.hasNextPage"),typeof e.pageInfo.hasPreviousPage>"u"&&We("pageInfo.hasPreviousPage");let r=reactRouter.useNavigation(),o=reactRouter.useNavigate(),{state:n,search:a,pathname:s}=reactRouter.useLocation(),c=t?`${t}_cursor`:"cursor",i=t?`${t}_direction`:"direction",y=new URLSearchParams(a).get(i)==="previous",m=react.useMemo(()=>!globalThis?.window?.__hydrogenHydrated||!n?.pagination?.[t]?.nodes?hydrogenReact.flattenConnection(e):y?[...hydrogenReact.flattenConnection(e),...n.pagination[t].nodes||[]]:[...n.pagination[t].nodes||[],...hydrogenReact.flattenConnection(e)],[n,e,t]),g=react.useMemo(()=>{let f=globalThis?.window?.__hydrogenHydrated,R=n?.pagination?.[t]?.pageInfo,h=!f||R?.startCursor===void 0?e.pageInfo.startCursor:R.startCursor,S=!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):(S=e.pageInfo.endCursor,I=e.pageInfo.hasNextPage)),{startCursor:h,endCursor:S,hasPreviousPage:C,hasNextPage:I}},[y,n,t,e.pageInfo.hasNextPage,e.pageInfo.hasPreviousPage,e.pageInfo.startCursor,e.pageInfo.endCursor]),p=react.useRef({params:ht(a,n),pathname:s});react.useEffect(()=>{window.__hydrogenHydrated=true;},[]),react.useEffect(()=>{let f=ht(a,n),R=p.current.params;(s!==p.current.pathname||f!==R)&&!(r.state==="idle"&&!r.location)&&(p.current={pathname:s,params:ht(a,n)},o(`${s}?${ht(a,n)}`,{replace:true,preventScrollReset:true,state:{nodes:void 0,pageInfo:void 0}}));},[s,a,n]);let l=react.useMemo(()=>{let f=new URLSearchParams(a);return f.set(i,"previous"),g.startCursor&&f.set(c,g.startCursor),`?${f.toString()}`},[a,g.startCursor]),P=react.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:P,nodes:m}}function Us(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 Ns(e,t){let r=reactRouter.useNavigation(),[o,n]=react.useState([]);if(react.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 Gs({handle:e,options:t=[],variants:r=[],productPath:o="products",waitForNavigation:n=false,selectedVariant:a,children:s}){let c=t;c[0]?.values&&(ee("[h2:warn:VariantSelector] product.options.values is deprecated. Use product.options.optionValues instead."),c[0]&&!c[0].optionValues&&(c=t.map(p=>({...p,optionValues:p.values?.map(l=>({name:l}))||[]}))));let i=r instanceof Array?r:hydrogenReact.flattenConnection(r),{searchParams:u,path:d,alreadyOnProductPage:y}=Qs(e,o,n),m=c.filter(p=>p?.optionValues?.length===1),g=a?a?.selectedOptions?.reduce((p,l)=>(p[l.name]=l.value,p),{}):{};return react.createElement(react.Fragment,null,...react.useMemo(()=>c.map(p=>{let l,P=[];for(let f of p.optionValues){let R=new URLSearchParams(y?u:void 0);R.set(p.name,f.name),m.forEach(v=>{v.optionValues[0].name&&R.set(v.name,v.optionValues[0].name);});let h=i.find(v=>v?.selectedOptions?.every(U=>(R.get(U?.name)||g?.[U?.name])===U?.value)),S=u.get(p.name);!S&&a&&(S=g?.[p.name]||null);let C=S?S===f.name:false;C&&(l=f.name);let I="?"+R.toString();P.push({value:f.name,optionValue:f,isAvailable:h?h.availableForSale:true,to:d+I,search:I,isActive:C,variant:h});}return s({option:{name:p.name,value:l,values:P}})}),[c,i,s]))}var Bs=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 Qs(e,t,r){let{pathname:o,search:n}=reactRouter.useLocation(),a=reactRouter.useNavigation();return react.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 Ws(){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.
|
|
542
|
+
`;function ir(e){let{getCartId:t,setCartId:r,storefront:o,customerAccount:n,cartQueryFragment:a,cartMutateFragment:s,buyerIdentity:i}=e,c=t(),u=()=>c||t(),d={storefront:o,getCartId:u,cartFragment:s,customerAccount:n},y=jt(d),m=async function(...p){p[0].buyerIdentity={...i,...p[0].buyerIdentity};let l=await y(...p);if(l?.cart&&(typeof l.cart!="object"||!("id"in l.cart)||typeof l.cart.id!="string"))throw new Error("[h2:error:createCartHandler] Cart created but response is missing a valid `id` field. Ensure your cart query fragment includes the `id` field.");return c=l?.cart&&typeof l.cart=="object"&&"id"in l.cart&&typeof l.cart.id=="string"?l.cart.id:void 0,l},C={get:Wt({storefront:o,customerAccount:n,getCartId:u,cartFragment:a}),getCartId:u,setCartId:r,create:m,addLines:async(p,l)=>{let S=p.map(f=>({attributes:f.attributes,quantity:f.quantity,merchandiseId:f.merchandiseId,sellingPlanId:f.sellingPlanId,parent:f.parent}));return c||l?.cartId?await Kt(d)(S,l):await m({lines:S,buyerIdentity:i},l)},updateLines:Yt(d),removeLines:Jt(d),updateDiscountCodes:async(p,l)=>c||l?.cartId?await zt(d)(p,l):await m({discountCodes:p},l),updateGiftCardCodes:async(p,l)=>c||l?.cartId?await nr(d)(p,l):await m({giftCardCodes:p},l),addGiftCardCodes:ar(d),removeGiftCardCodes:sr(d),updateBuyerIdentity:async(p,l)=>c||l?.cartId?await Xt(d)(p,l):await m({buyerIdentity:p},l),updateNote:async(p,l)=>c||l?.cartId?await Zt(d)(p,l):await m({note:p},l),updateSelectedDeliveryOption:er(d),updateAttributes:async(p,l)=>c||l?.cartId?await tr(d)(p,l):await m({attributes:p},l),setMetafields:async(p,l)=>c||l?.cartId?await rr(d)(p,l):await m({metafields:p},l),deleteMetafield:or(d),addDeliveryAddresses:Io(d),removeDeliveryAddresses:Eo(d),updateDeliveryAddresses:bo(d),replaceDeliveryAddresses:wo(d)};return "customMethods"in e?{...C,...e.customMethods??{}}:C}function Ja(e){let t=reactRouter.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=re.getFormInput(a);if(s.action===re.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:vo(i.selectedVariant.id),merchandise:i.selectedVariant,isOptimistic:true,quantity:i.quantity||1});}else if(s.action===re.ACTIONS.LinesRemove)for(let i of s.inputs.lineIds){let c=o.findIndex(u=>u.id===i);if(c!==-1){if(yt(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===re.ACTIONS.LinesUpdate)for(let i of s.inputs.lines){let c=o.findIndex(u=>i.id===u.id);if(c>-1){if(yt(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 za="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||za)}var He=reactRouter.createContext(),cr=reactRouter.createContext(),ur=reactRouter.createContext(),dr=reactRouter.createContext(),pr=reactRouter.createContext(),lr=reactRouter.createContext(),Za={storefront:He,cart:cr,customerAccount:ur,env:dr,session:pr,waitUntil:lr};var mt="2026-04",Re=`Shopify Hydrogen ${Me}`,xo="30243aa5-17c1-465a-8493-944bcc4e88aa",F="customerAccount",Pe="buyer";var B=class extends Response{constructor(t,r,o){super(`Bad request: ${t}`,{status:400,headers:o});}};function qe(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 es({session:e,customerAccountId:t,customerAccountTokenExchangeUrl:r,httpsOrigin:o,debugInfo:n}){let a=new URLSearchParams,s=e.get(F),i=s?.refreshToken,c=s?.idToken;if(!i)throw new B("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":Re,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:C,expires_in:p,refresh_token:l}=await m.json();if(!C||C.length===0)throw new B("Unauthorized","Invalid access token received.");e.set(F,{accessToken:C,expiresAt:new Date(new Date().getTime()+(p-120)*1e3).getTime()+"",refreshToken:l,idToken:c});}function ve(e){e.unset(F),e.unset(Pe);}async function Do({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=es({session:r,customerAccountId:o,customerAccountTokenExchangeUrl:n,httpsOrigin:a,debugInfo:s})),await e.refresh,delete e.refresh;}catch(i){throw ve(r),i&&i.status!==401?i:new B("Unauthorized","Login before querying the Customer Account API.")}}function Oo(){let e=ts();return Uo(e)}async function _o(e){let t=await crypto.subtle.digest({name:"SHA-256"},new TextEncoder().encode(e)),r=rs(t);return Uo(r)}function ts(){let e=new Uint8Array(32);return crypto.getRandomValues(e),String.fromCharCode.apply(null,Array.from(e))}function Uo(e){return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function rs(e){let t=new Uint8Array(e),r=Array.from(t);return String.fromCharCode(...r)}function Lo(){let e=Date.now().toString(),t=Math.random().toString(36).substring(2);return e+t}async function ko(e,t,r,o,n){let a=t;if(!e)throw new B("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",xo),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":Re,Origin:o};new Date().getTime();let u=r,d=await fetch(u,{method:"POST",headers:i,body:s});let y=await d.json();if(y.error)throw new B(y.error_description);return y.access_token}function Vo(e){return os(e).payload.nonce}function os(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 Ct(){return as(ns())}function ns(){try{return crypto.getRandomValues(new Uint8Array(16))}catch{return new Uint8Array(16).map(()=>Math.random()*255|0)}}function as(e){return Array.from(e,function(t){return ("0"+(t&255).toString(16)).slice(-2)}).join("")}function gt(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(Mo(e,a))return a;console.warn(`Cross-domain redirects are not supported. Tried to redirect from ${o} to ${a}`);}}function Mo(e,t){try{return new URL(e).origin===new URL(t,e).origin}catch{return false}}function yr({requestUrl:e,defaultUrl:t,redirectUrl:r}){let o=e,n=No(e,t),a=r?No(e,r):n;return Mo(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 No(e,t){return ss(t)?new URL(t):new URL(t,new URL(e).origin)}function ss(e){try{return new URL(e),!0}catch{return false}}function Fo(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 is(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 qe(n)}function mr({session:e,customerAccountId:t,shopId:r,customerApiVersion:o=mt,request:n,waitUntil:a,authUrl:s,customAuthStatusHandler:i,logErrors:c=true,loginPath:u="/account/login",authorizePath:d="/account/authorize",defaultRedirectPath:y="/account",language:m,useCustomAuthDomain:C}){if(o!==mt&&console.warn(`[h2:warn:createCustomerAccountClient] You are using Customer Account API version ${o} when this version of Hydrogen was built for ${mt}.`),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 p=new URL(n.url),l=p.protocol==="http:"?p.origin.replace("http","https"):p.origin,S=yr({requestUrl:l,defaultUrl:d,redirectUrl:s}),f=A=>void 0,P=i||(()=>(f(p.hostname),is(n,u))),h=Fo(o,r),T=cs(h,t),g=h("GRAPHQL"),v={};async function R({query:A,type:E,variables:k={}}){let L=await W();if(!L)throw P();new Date().getTime();let $=await fetch(g,{method:"POST",headers:{"Content-Type":"application/json","User-Agent":Re,Origin:l,Authorization:L},body:JSON.stringify({query:A,variables:k})});let j=await $.text(),z={url:g,response:$,type:E,query:A,queryVariables:k,errors:void 0,client:"customer"};if(!$.ok){if($.status===401)throw ve(e),P();let N;try{N=te(j);}catch{N=[{message:j}];}Fe({...z,errors:N});}try{let N=te(j),{errors:q}=N,Ie=q?.map(({message:M,...X})=>new ye(M,{...X,clientOperation:`customerAccount.${z.type}`,requestId:$.headers.get("x-request-id"),queryVariables:k,query:A}));return {...N,...q&&{errors:Ie}}}catch{Fe({...z,errors:[{message:j}]});}}async function U(){if(!r)return false;let A=e.get(F),E=A?.accessToken,k=A?.expiresAt;if(!E||!k)return false;let L=J?.();try{await Do({locks:v,expiresAt:k,session:e,customerAccountId:t,customerAccountTokenExchangeUrl:h("TOKEN_EXCHANGE"),httpsOrigin:l,debugInfo:{waitUntil:a,stackInfo:L,...ce(n)}});}catch{return false}return true}async function V(){if(!await U())throw P()}async function W(){if(await U())return e.get(F)?.accessToken}async function Tt(A,E){return f(p.hostname),T(),A=Te(A),lt(A,"customer.mutate"),he(R({query:A,type:"mutation",...E}),{logErrors:c})}async function St(A,E){return f(p.hostname),T(),A=Te(A),pt(A,"customer.query"),he(R({query:A,type:"query",...E}),{logErrors:c})}function Ke(A){e.set(Pe,{...e.get(Pe),...A});}async function K(){let A=await W();if(A)return {...e.get(Pe),customerAccessToken:A}}return {i18n:{language:m??"EN"},login:async A=>{f(p.hostname),T();let E=new URL(h("AUTH")),k=Lo(),L=Ct();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",k),E.searchParams.append("nonce",L);let Q=us({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 ae=Oo(),$=await _o(ae);return e.set(F,{...e.get(F),codeVerifier:ae,state:k,nonce:L,redirectPath:gt(n.url)||Y(n,"Referer")||y}),E.searchParams.append("code_challenge",$),E.searchParams.append("code_challenge_method","S256"),qe(E.toString())},logout:async A=>{f(p.hostname),T();let E=e.get(F)?.idToken,k=yr({requestUrl:l,defaultUrl:l,redirectUrl:A?.postLogoutRedirectUri}),L=E?new URL(`${h("LOGOUT")}?${new URLSearchParams([["id_token_hint",E],["post_logout_redirect_uri",k]]).toString()}`).toString():k;ve(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),qe(L,{headers:Q})},isLoggedIn:U,handleAuthStatus:V,getAccessToken:W,getApiUrl:()=>g,mutate:Tt,query:St,authorize:async()=>{f(p.hostname),T();let A=p.searchParams.get("code"),E=p.searchParams.get("state");if(!A||!E)throw ve(e),new B("Unauthorized","No code or state parameter found in the redirect URL.");if(e.get(F)?.state!==E)throw ve(e),new B("Unauthorized","The session state does not match the state parameter. Make sure that the session is configured correctly and passed to `createCustomerAccountClient`.");let k=t,L=new URLSearchParams;L.append("grant_type","authorization_code"),L.append("client_id",k),L.append("redirect_uri",S),L.append("code",A);let Q=e.get(F)?.codeVerifier;if(!Q)throw new B("Unauthorized","No code verifier found in the session. Make sure that the session is configured correctly and passed to `createCustomerAccountClient`.");L.append("code_verifier",Q);let ae={"content-type":"application/x-www-form-urlencoded","User-Agent":Re,Origin:l};new Date().getTime();let z=h("TOKEN_EXCHANGE"),N=await fetch(z,{method:"POST",headers:ae,body:L});if(!N.ok)throw new Response(await N.text(),{status:N.status,headers:{"Content-Type":"text/html; charset=utf-8"}});let{access_token:q,expires_in:Ie,id_token:M,refresh_token:X}=await N.json(),Rt=e.get(F)?.nonce,Er=await Vo(M);if(Rt!==Er)throw new B("Unauthorized",`Returned nonce does not match: ${Rt} !== ${Er}`);let br=q;r||(br=await ko(q,t,h("TOKEN_EXCHANGE"),l,{...ce(n)}));let fn=e.get(F)?.redirectPath;return e.set(F,{accessToken:br,expiresAt:new Date(new Date().getTime()+(Ie-120)*1e3).getTime()+"",refreshToken:X,idToken:M}),qe(fn||y)},setBuyer:Ke,getBuyer:K,UNSTABLE_setBuyer:A=>{ee("[h2:warn:customerAccount] `customerAccount.UNSTABLE_setBuyer` is deprecated. Please use `customerAccount.setBuyer`."),Ke(A);},UNSTABLE_getBuyer:()=>(ee("[h2:warn:customerAccount] `customerAccount.UNSTABLE_getBuyer` is deprecated. Please use `customerAccount.getBuyer`."),K())}}function cs(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 us(e){return e.localeOverride!=null?fr(e.localeOverride):e.uiLocalesOverride!=null?fr(e.uiLocalesOverride):e.contextLanguage!=null?fr(e.contextLanguage):null}function fr(e){let r=e.toLowerCase().replaceAll("_","-").split("-"),o=r[0],n=r[1];return n?`${o}-${n.toUpperCase()}`:o}function ps(e,t){let{env:r,request:o,cache:n,waitUntil:a,i18n:s,session:i,logErrors:c,storefront:u={},customerAccount:d,cart:y={},buyerIdentity:m}=e;i||console.warn("[h2:warn:createHydrogenContext] A session object is required to create hydrogen context."),d?.unstableB2b&&ee("[h2:warn:createHydrogenContext] `customerAccount.unstableB2b` is now stable. Please remove the `unstableB2b` option.");let{storefront:C}=Ro({cache:n,waitUntil:a,i18n:s,logErrors:c,storefrontHeaders:u.headers||co(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}),p=mr({session:i,request:o,waitUntil:a,logErrors:c,customerApiVersion:d?.apiVersion,authUrl:d?.authUrl,customAuthStatusHandler:d?.customAuthStatusHandler,useCustomAuthDomain:d?.useCustomAuthDomain,language:s?.language,customerAccountId:r.PUBLIC_CUSTOMER_ACCOUNT_API_CLIENT_ID,shopId:r.SHOP_ID}),l=ir({getCartId:y.getId||Gt(o.headers),setCartId:y.setId||Bt(),cartQueryFragment:y.queryFragment,cartMutateFragment:y.mutateFragment,...y.customMethods&&{customMethods:y.customMethods},buyerIdentity:m,storefront:C,customerAccount:p}),S=new reactRouter.RouterContextProvider;S.set(He,C),S.set(cr,l),S.set(ur,p),S.set(dr,r),S.set(pr,i),a&&S.set(lr,a);let f={storefront:C,cart:l,customerAccount:p,env:r,session:i,waitUntil:a,...t||{}};return new Proxy(S,{get(h,T,g){if(T in h){let v=h[T];return typeof v=="function"?v.bind(h):v}return T in f?f[T]:Reflect.get(h,T,g)},has(h,T){return T in h||T in f},ownKeys(h){return [...Reflect.ownKeys(h),...Object.keys(f)]},getOwnPropertyDescriptor(h,T){if(T in h)return Reflect.getOwnPropertyDescriptor(h,T);if(T in f)return {enumerable:true,configurable:true,writable:false,value:f[T]}}})}function ys({build:e,mode:t,poweredByHeader:r=true,getLoadContext:o,collectTrackingInformation:n=true}){let a=reactRouter.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 d=await o?.(i),y=d?.storefront||d?.get?.(He);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 p=await y.forward(i);return s?.(p),p}if(y.isMcpUrl(i)){let p=await y.forwardMcp(i);return s?.(p),p}let m=await a(i,d);n&&y.setCollectedSubrequestHeaders(m);let C=i.headers.get("sec-fetch-dest");return (C&&C==="document"||i.headers.get("accept")?.includes("text/html"))&&we(m,{[Je]:"1"}),s?.(m),m}}var Ho=react.createContext(void 0),$o=Ho.Provider,Cr=()=>react.useContext(Ho);function hs(e){let t=Ct(),r=As(t,e);return {nonce:t,header:r,NonceProvider:({children:n})=>react.createElement($o,{value:t},n)}}function As(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 d in c){let y=o[d];d&&y&&(u[d]=Ts(y,c[d]));}return u.scriptSrc instanceof Array?u.scriptSrc=[...u.scriptSrc.filter(d=>!d.startsWith("'nonce")),n]:u.defaultSrc instanceof Array&&(u.defaultSrc=[...u.defaultSrc.filter(d=>!d.startsWith("'nonce")),n]),gs__default.default({directives:u})}function Ts(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 Ps=react.forwardRef((e,t)=>{let{waitForHydration:r,src:o,...n}=e,a=Cr();return r?jsxRuntime.jsx(vs,{src:o,options:n}):jsxRuntime.jsx("script",{suppressHydrationWarning:true,...n,src:o,nonce:a,ref:t})});function vs({src:e,options:t}){if(!e)throw new Error("`waitForHydration` with the Script component requires a `src` prop");return hydrogenReact.useLoadScript(e,{attributes:t}),null}async function Es(e){return e;}function ws(e){let t=reactRouter.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 xs({id:e,data:t}){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("input",{type:"hidden",name:"optimistic-identifier",value:e}),jsxRuntime.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]=react.useState(false),a=reactRouter.useNavigation(),s=reactRouter.useLocation();reactRouter.useNavigate();react.useEffect(()=>{a.state==="idle"&&n(false);},[a.state]);let{endCursor:c,hasNextPage:u,hasPreviousPage:d,nextPageUrl:y,nodes:m,previousPageUrl:C,startCursor:p}=ks(e,r),l=react.useMemo(()=>({...s.state,pagination:{...s.state?.pagination||{},[r]:{pageInfo:{endCursor:c,hasPreviousPage:d,hasNextPage:u,startCursor:p},nodes:m}}}),[c,u,d,p,m,r,s.state]),S=react.useMemo(()=>react.forwardRef(function(h,T){return u?react.createElement(reactRouter.Link,{preventScrollReset:true,...h,to:y,state:l,replace:true,ref:T,onClick:()=>n(true)}):null}),[u,y,l]),f=react.useMemo(()=>react.forwardRef(function(h,T){return d?react.createElement(reactRouter.Link,{preventScrollReset:true,...h,to:C,state:l,replace:true,ref:T,onClick:()=>n(true)}):null}),[d,C,l]);return t({state:l,hasNextPage:u,hasPreviousPage:d,isLoading:o,nextPageUrl:y,nodes:m,previousPageUrl:C,NextLink:S,PreviousLink:f})}function ht(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 We(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 ks(e,t=""){e.pageInfo||We("pageInfo"),typeof e.pageInfo.startCursor>"u"&&We("pageInfo.startCursor"),typeof e.pageInfo.endCursor>"u"&&We("pageInfo.endCursor"),typeof e.pageInfo.hasNextPage>"u"&&We("pageInfo.hasNextPage"),typeof e.pageInfo.hasPreviousPage>"u"&&We("pageInfo.hasPreviousPage");let r=reactRouter.useNavigation(),o=reactRouter.useNavigate(),{state:n,search:a,pathname:s}=reactRouter.useLocation(),i=t?`${t}_cursor`:"cursor",c=t?`${t}_direction`:"direction",y=new URLSearchParams(a).get(c)==="previous",m=react.useMemo(()=>!globalThis?.window?.__hydrogenHydrated||!n?.pagination?.[t]?.nodes?hydrogenReact.flattenConnection(e):y?[...hydrogenReact.flattenConnection(e),...n.pagination[t].nodes||[]]:[...n.pagination[t].nodes||[],...hydrogenReact.flattenConnection(e)],[n,e,t]),C=react.useMemo(()=>{let f=globalThis?.window?.__hydrogenHydrated,P=n?.pagination?.[t]?.pageInfo,h=!f||P?.startCursor===void 0?e.pageInfo.startCursor:P.startCursor,T=!f||P?.endCursor===void 0?e.pageInfo.endCursor:P.endCursor,g=!f||P?.hasPreviousPage===void 0?e.pageInfo.hasPreviousPage:P.hasPreviousPage,v=!f||P?.hasNextPage===void 0?e.pageInfo.hasNextPage:P.hasNextPage;return n?.pagination?.[t]?.nodes&&(y?(h=e.pageInfo.startCursor,g=e.pageInfo.hasPreviousPage):(T=e.pageInfo.endCursor,v=e.pageInfo.hasNextPage)),{startCursor:h,endCursor:T,hasPreviousPage:g,hasNextPage:v}},[y,n,t,e.pageInfo.hasNextPage,e.pageInfo.hasPreviousPage,e.pageInfo.startCursor,e.pageInfo.endCursor]),p=react.useRef({params:ht(a,n),pathname:s});react.useEffect(()=>{window.__hydrogenHydrated=true;},[]),react.useEffect(()=>{let f=ht(a,n),P=p.current.params;(s!==p.current.pathname||f!==P)&&!(r.state==="idle"&&!r.location)&&(p.current={pathname:s,params:ht(a,n)},o(`${s}?${ht(a,n)}`,{replace:true,preventScrollReset:true,state:{nodes:void 0,pageInfo:void 0}}));},[s,a,n]);let l=react.useMemo(()=>{let f=new URLSearchParams(a);return f.set(c,"previous"),C.startCursor&&f.set(i,C.startCursor),`?${f.toString()}`},[a,C.startCursor]),S=react.useMemo(()=>{let f=new URLSearchParams(a);return f.set(c,"next"),C.endCursor&&f.set(i,C.endCursor),`?${f.toString()}`},[a,C.endCursor]);return {...C,previousPageUrl:l,nextPageUrl:S,nodes:m}}function Vs(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=reactRouter.useNavigation(),[o,n]=react.useState([]);if(react.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 Ws({handle:e,options:t=[],variants:r=[],productPath:o="products",waitForNavigation:n=false,selectedVariant:a,children:s}){let i=t;i[0]?.values&&(ee("[h2:warn:VariantSelector] product.options.values is deprecated. Use product.options.optionValues instead."),i[0]&&!i[0].optionValues&&(i=t.map(p=>({...p,optionValues:p.values?.map(l=>({name:l}))||[]}))));let c=r instanceof Array?r:hydrogenReact.flattenConnection(r),{searchParams:u,path:d,alreadyOnProductPage:y}=Ks(e,o,n),m=i.filter(p=>p?.optionValues?.length===1),C=a?a?.selectedOptions?.reduce((p,l)=>(p[l.name]=l.value,p),{}):{};return react.createElement(react.Fragment,null,...react.useMemo(()=>i.map(p=>{let l,S=[];for(let f of p.optionValues){let P=new URLSearchParams(y?u:void 0);P.set(p.name,f.name),m.forEach(R=>{R.optionValues[0].name&&P.set(R.name,R.optionValues[0].name);});let h=c.find(R=>R?.selectedOptions?.every(U=>(P.get(U?.name)||C?.[U?.name])===U?.value)),T=u.get(p.name);!T&&a&&(T=C?.[p.name]||null);let g=T?T===f.name:false;g&&(l=f.name);let v="?"+P.toString();S.push({value:f.name,optionValue:f,isAvailable:h?h.availableForSale:true,to:d+v,search:v,isActive:g,variant:h});}return s({option:{name:p.name,value:l,values:S}})}),[i,c,s]))}var js=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 Ks(e,t,r){let{pathname:o,search:n}=reactRouter.useLocation(),a=reactRouter.useNavigation();return react.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 Ys(){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},subResourceIntegrity:false}),reactRouterConfigResolved:({reactRouterConfig:e})=>{if(e.basename&&e.basename!=="/")throw new Error(`[Hydrogen Preset] basename is not supported in Hydrogen 2025.7.0.
|
|
543
543
|
Reason: Requires major CLI infrastructure modernization.
|
|
544
544
|
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.
|
|
545
545
|
Reason: React Router plugin incompatibility with Hydrogen CLI build pipeline.
|
|
@@ -547,14 +547,14 @@ Workaround: Use external static generation tools or server-side caching.`);if(e.
|
|
|
547
547
|
Reason: React Router plugin manifest incompatibility with Hydrogen CLI.
|
|
548
548
|
Alternative: Route-level code splitting via v8_splitRouteModules is enabled.`);if(e.buildEnd)throw new Error(`[Hydrogen Preset] buildEnd is not supported in Hydrogen 2025.7.0.
|
|
549
549
|
Reason: Hydrogen CLI bypasses React Router buildEnd hook execution.
|
|
550
|
-
Workaround: Use external build scripts or package.json post-build hooks.`);if(e.
|
|
550
|
+
Workaround: Use external build scripts or package.json post-build hooks.`);if(e.subResourceIntegrity===true)throw new Error(`[Hydrogen Preset] subResourceIntegrity cannot be enabled.
|
|
551
551
|
Reason: Conflicts with Hydrogen CSP nonce-based authentication.
|
|
552
|
-
Impact: Would break Content Security Policy and cause script execution failures.`)}}}var
|
|
552
|
+
Impact: Would break Content Security Policy and cause script execution failures.`)}}}var Xs=function(e){return jsxRuntime.jsx(hydrogenReact.RichText,{...e,components:{link:({node:t})=>jsxRuntime.jsx(reactRouter.Link,{to:t.url,title:t.title,target:t.target,prefetch:"intent",children:t.children}),...e.components}})};var Zs=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(),d=await n.getAccessToken();u&&(s["customer-account"]={name:"Customer Account API",value:u,authHeader:"Authorization",accessToken:d,apiUrl:n.getApiUrl(),icon:"CA"});}let i="https://avatars.githubusercontent.com/u/12972006?s=48&v=4",c=String.raw;return new Response(c`
|
|
553
553
|
<!DOCTYPE html>
|
|
554
554
|
<html lang="en">
|
|
555
555
|
<head>
|
|
556
556
|
<title>GraphiQL</title>
|
|
557
|
-
<link rel="icon" type="image/x-icon" href="${
|
|
557
|
+
<link rel="icon" type="image/x-icon" href="${i}" />
|
|
558
558
|
<meta charset="utf-8" />
|
|
559
559
|
<style>
|
|
560
560
|
body {
|
|
@@ -868,7 +868,7 @@ Impact: Would break Content Security Policy and cause script execution failures.
|
|
|
868
868
|
</div>
|
|
869
869
|
</body>
|
|
870
870
|
</html>
|
|
871
|
-
`,{status:200,headers:{"content-type":"text/html"}})};async function
|
|
871
|
+
`,{status:200,headers:{"content-type":"text/html"}})};var rn=".data",Ar="_root.data",on="_.data";async function ei(e){let{storefront:t,request:r,noAdminRedirect:o,matchQueryParams:n,response:a=new Response("Not Found",{status:404})}=e,s=new URL(r.url),{searchParams:i}=s,{pathname:c,isSoftNavigation:u}=ti(s.pathname);i.delete("redirect"),i.delete("return_to"),i.delete("_routes");let d=(n?`${c}${s.search}`:c).toLowerCase();if(c==="/admin"&&!o)return Sr(`${t.getShopifyDomain()}/admin`,u,i,n);try{let{urlRedirects:y}=await t.query(ri,{variables:{query:"path:"+d.replace(/\/+$/,"")}}),m=y?.edges?.[0]?.node?.target;if(m)return Sr(m,u,i,n);let C=gt(r.url);if(C)return Sr(C,u,i,n)}catch(y){console.error(`Failed to fetch redirects from Storefront API for route ${d}`,y);}return a}var Tr="https://example.com";function Sr(e,t,r,o){let n=new URL(e,Tr);if(!o)for(let[a,s]of r)n.searchParams.append(a,s);return t?new Response(null,{status:204,headers:{"X-Remix-Redirect":n.toString().replace(Tr,""),"X-Remix-Status":"301"}}):new Response(null,{status:301,headers:{location:n.toString().replace(Tr,"")}})}function ti(e){return e.endsWith(rn)?e.endsWith("/"+on)?{pathname:e.slice(0,-on.length),isSoftNavigation:true}:e==="/"+Ar||e.endsWith("/"+Ar)?{pathname:e.slice(0,-Ar.length)||"/",isSoftNavigation:true}:{pathname:e.slice(0,-rn.length),isSoftNavigation:true}:{pathname:e,isSoftNavigation:false}}var ri=`#graphql
|
|
872
872
|
query redirects($query: String) {
|
|
873
873
|
urlRedirects(first: 1, query: $query) {
|
|
874
874
|
edges {
|
|
@@ -878,24 +878,24 @@ Impact: Would break Content Security Policy and cause script execution failures.
|
|
|
878
878
|
}
|
|
879
879
|
}
|
|
880
880
|
}
|
|
881
|
-
`;var
|
|
881
|
+
`;var oi={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},ni=/[&><\u2028\u2029]/g;function nn(e){return e.replace(ni,t=>oi[t])}var ue="Error in SEO input: ",oe={title:{validate:e=>{if(typeof e!="string")throw new Error(ue.concat("`title` should be a string"));if(typeof e=="string"&&e.length>70)throw new Error(ue.concat("`title` should not be longer than 70 characters"));return e}},description:{validate:e=>{if(typeof e!="string")throw new Error(ue.concat("`description` should be a string"));if(typeof e=="string"&&e.length>155)throw new Error(ue.concat("`description` should not be longer than 160 characters"));return e}},url:{validate:e=>{if(typeof e!="string")throw new Error(ue.concat("`url` should be a string"));if(typeof e=="string"&&!e.startsWith("http"))throw new Error(ue.concat("`url` should be a valid URL"));return e}},handle:{validate:e=>{if(typeof e!="string")throw new Error(ue.concat("`handle` should be a string"));if(typeof e=="string"&&!e.startsWith("@"))throw new Error(ue.concat("`handle` should start with `@`"));return e}}};function an(e){let t=[];for(let r of Object.keys(e))switch(r){case "title":{let o=ne(oe.title,e.title),n=Pr(e?.titleTemplate,o);if(!n)break;t.push(H("title",{title:n}),H("meta",{property:"og:title",content:n}),H("meta",{name:"twitter:title",content:n}));break}case "description":{let o=ne(oe.description,e.description);if(!o)break;t.push(H("meta",{name:"description",content:o}),H("meta",{property:"og:description",content:o}),H("meta",{name:"twitter:description",content:o}));break}case "url":{let o=ne(oe.url,e.url);if(!o)break;let a=o.split("?")[0].replace(/\/$/,"");t.push(H("link",{rel:"canonical",href:a}),H("meta",{property:"og:url",content:a}));break}case "handle":{let o=ne(oe.handle,e.handle);if(!o)break;t.push(H("meta",{name:"twitter:site",content:o}),H("meta",{name:"twitter:creator",content:o}));break}case "media":{let o,n=de(e.media);for(let a of n)if(typeof a=="string"&&t.push(H("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:vr(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(H("meta",{property:`og:${s}:${c}`,content:o},i.url)));}break}case "jsonLd":{let o=de(e.jsonLd),n=0;for(let a of o){if(typeof a!="object")continue;let s=H("script",{type:"application/ld+json",children:JSON.stringify(a,(i,c)=>typeof c=="string"?nn(c):c)},`json-ld-${a?.["@type"]||a?.name||n++}`);t.push(s);}break}case "alternates":{let o=de(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(H("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:d,noTranslate:y,unavailableAfter:m}=e.robots,C=[s&&"noarchive",c&&"noimageindex",d&&"nosnippet",y&&"notranslate",o&&`max-image-preview:${o}`,n&&`max-snippet:${n}`,a&&`max-video-preview:${a}`,m&&`unavailable_after:${m}`],p=(u?"noindex":"index")+","+(i?"nofollow":"follow");for(let l of C)l&&(p+=`,${l}`);t.push(H("meta",{name:"robots",content:p}));break}}return t.flat().sort((r,o)=>r.key.localeCompare(o.key))}function H(e,t,r){let o={tag:e,props:{},key:""};return e==="title"?(o.children=t.title,o.key=Rr(o),o):e==="script"?(o.children=typeof t.children=="string"?t.children:"",o.key=Rr(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=Rr(o,r),o)}function Rr(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 Pr(e,t){if(t)return e?typeof e=="function"?e(t):e.replace("%s",t??""):t}function vr(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 de(e){return Array.isArray(e)?e:[e]}function ne(e,t){try{return e.validate(t)}catch(r){return console.warn(r.message),t}}function ai(...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:de(o.jsonLd).concat(a)}:{...o,...n,jsonLd:[a]}:{...o,...n}},{})||{};for(let o of Object.keys(r))switch(o){case "title":{let n=ne(oe.title,r.title),a=Pr(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=ne(oe.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=ne(oe.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=ne(oe.handle,r.handle);if(!n)break;t.push({property:"twitter:site",content:n},{property:"twitter:creator",content:n});break}case "media":{let n,a=de(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:vr(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=de(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=de(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:d,noSnippet:y,noTranslate:m,unavailableAfter:C}=r.robots,p=[i&&"noarchive",u&&"noimageindex",y&&"nosnippet",m&&"notranslate",n&&`max-image-preview:${n}`,a&&`max-snippet:${a}`,s&&`max-video-preview:${s}`,C&&`unavailable_after:${C}`],l=(d?"noindex":"index")+","+(c?"nofollow":"follow");for(let S of p)S&&(l+=`,${S}`);t.push({name:"robots",content:l});break}}return t}var fi=react.lazy(()=>Promise.resolve().then(()=>(dn(),un)));function mi({debug:e}){let t=reactRouter.useMatches(),r=reactRouter.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=react.useMemo(()=>t.flatMap(s=>{let{handle:i,...c}=s,u={...c,...r},d=i?.seo,y=c?.data?.seo;return !d&&!y?[]:d?At(d,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}=react.useMemo(()=>{let s=an(o),i=s.map(u=>u.tag==="script"?react.createElement(u.tag,{...u.props,key:u.key,dangerouslySetInnerHTML:{__html:u.children}}):react.createElement(u.tag,{...u.props,key:u.key},u.children)),c=react.createElement(react.Suspense,{fallback:null},react.createElement(fi,{headTags:s}));return {html:i,loggerMarkup:c}},[o]);return react.createElement(react.Fragment,null,n,e&&a)}function At(e,...t){if(e instanceof Function)return At(e(...t),...t);let r={};return Array.isArray(e)?(r=e.reduce((o,n)=>[...o,At(n)],[]),r):e instanceof Object?(Object.entries(e).forEach(([n,a])=>{r[n]=At(a,...t);}),r):e}function gi(e){return jsxRuntime.jsx(hydrogenReact.ShopPayButton,{channel:"hydrogen",...e})}var Ai=`<?xml version="1.0" encoding="UTF-8"?>
|
|
882
882
|
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
883
|
-
`,
|
|
884
|
-
</sitemapindex>`,
|
|
885
|
-
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">`,
|
|
886
|
-
`)+n.map(
|
|
887
|
-
`)+
|
|
888
|
-
`)+
|
|
889
|
-
<url><loc>${y+
|
|
890
|
-
`+
|
|
891
|
-
`;return o}function
|
|
883
|
+
`,Ti=`
|
|
884
|
+
</sitemapindex>`,ln=`<?xml version="1.0" encoding="UTF-8"?>
|
|
885
|
+
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">`,yn="</urlset>";async function Si(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(_i);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=Ai+o.map(c=>{if(!a[c])throw new Error(`[h2:sitemap:error] No data found for type ${c}. Check types passed to \`getSitemapIndex\``);return Pi(c,a[c].pagesCount.count,s)}).join(`
|
|
886
|
+
`)+n.map(c=>" <sitemap><loc>"+(s+(c.startsWith("/")?c:"/"+c))+"</loc></sitemap>").join(`
|
|
887
|
+
`)+Ti;return new Response(i,{headers:{"Content-Type":"application/xml","Cache-Control":`max-age=${3600*24}`}})}async function Ri(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=Ui[c];if(!u)throw new Response("Not found",{status:404});let d=await t.query(u,{variables:{page:parseInt(o.page,10)}});if(!d)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 d?.sitemap?.resources?.items?.length?m=ln+d.sitemap.resources.items.map(C=>vi({getChangeFreq:s,url:n({type:C.type??c,baseUrl:y,handle:C.handle}),type:c,getLink:n,updatedAt:C.updatedAt,handle:C.handle,metaobjectType:C.type,locales:a,baseUrl:y})).join(`
|
|
888
|
+
`)+yn:m=ln+`
|
|
889
|
+
<url><loc>${y+i}</loc></url>
|
|
890
|
+
`+yn,new Response(m,{headers:{"Content-Type":"application/xml","Cache-Control":`max-age=${3600*24}`}})}function Pi(e,t,r){let o="";for(let n=1;n<=t;n++)o+=` <sitemap><loc>${r}/sitemap/${e}/${n}.xml</loc></sitemap>
|
|
891
|
+
`;return o}function vi({url:e,updatedAt:t,locales:r,type:o,getLink:n,baseUrl:a,handle:s,getChangeFreq:i,metaobjectType:c}){return `<url>
|
|
892
892
|
<loc>${e}</loc>
|
|
893
893
|
<lastmod>${t}</lastmod>
|
|
894
|
-
<changefreq>${
|
|
895
|
-
${r.map(u=>
|
|
894
|
+
<changefreq>${i?i({type:c??o,handle:s}):"weekly"}</changefreq>
|
|
895
|
+
${r.map(u=>Ii(n({type:c??o,baseUrl:a,handle:s,locale:u}),u)).join(`
|
|
896
896
|
`)}
|
|
897
897
|
</url>
|
|
898
|
-
`.trim()}function
|
|
898
|
+
`.trim()}function Ii(e,t){return ` <xhtml:link rel="alternate" hreflang="${t}" href="${e}" />`}var Ei=`#graphql
|
|
899
899
|
query SitemapProducts($page: Int!) {
|
|
900
900
|
sitemap(type: PRODUCT) {
|
|
901
901
|
resources(page: $page) {
|
|
@@ -906,7 +906,7 @@ ${r.map(u=>Pi(n({type:i??o,baseUrl:a,handle:s,locale:u}),u)).join(`
|
|
|
906
906
|
}
|
|
907
907
|
}
|
|
908
908
|
}
|
|
909
|
-
`,
|
|
909
|
+
`,bi=`#graphql
|
|
910
910
|
query SitemapCollections($page: Int!) {
|
|
911
911
|
sitemap(type: COLLECTION) {
|
|
912
912
|
resources(page: $page) {
|
|
@@ -917,7 +917,7 @@ ${r.map(u=>Pi(n({type:i??o,baseUrl:a,handle:s,locale:u}),u)).join(`
|
|
|
917
917
|
}
|
|
918
918
|
}
|
|
919
919
|
}
|
|
920
|
-
`,
|
|
920
|
+
`,wi=`#graphql
|
|
921
921
|
query SitemapArticles($page: Int!) {
|
|
922
922
|
sitemap(type: ARTICLE) {
|
|
923
923
|
resources(page: $page) {
|
|
@@ -928,7 +928,7 @@ ${r.map(u=>Pi(n({type:i??o,baseUrl:a,handle:s,locale:u}),u)).join(`
|
|
|
928
928
|
}
|
|
929
929
|
}
|
|
930
930
|
}
|
|
931
|
-
`,
|
|
931
|
+
`,xi=`#graphql
|
|
932
932
|
query SitemapPages($page: Int!) {
|
|
933
933
|
sitemap(type: PAGE) {
|
|
934
934
|
resources(page: $page) {
|
|
@@ -939,7 +939,7 @@ ${r.map(u=>Pi(n({type:i??o,baseUrl:a,handle:s,locale:u}),u)).join(`
|
|
|
939
939
|
}
|
|
940
940
|
}
|
|
941
941
|
}
|
|
942
|
-
`,
|
|
942
|
+
`,Di=`#graphql
|
|
943
943
|
query SitemapBlogs($page: Int!) {
|
|
944
944
|
sitemap(type: BLOG) {
|
|
945
945
|
resources(page: $page) {
|
|
@@ -950,7 +950,7 @@ ${r.map(u=>Pi(n({type:i??o,baseUrl:a,handle:s,locale:u}),u)).join(`
|
|
|
950
950
|
}
|
|
951
951
|
}
|
|
952
952
|
}
|
|
953
|
-
`,
|
|
953
|
+
`,Oi=`#graphql
|
|
954
954
|
query SitemapMetaobjects($page: Int!) {
|
|
955
955
|
sitemap(type: METAOBJECT) {
|
|
956
956
|
resources(page: $page) {
|
|
@@ -964,7 +964,7 @@ ${r.map(u=>Pi(n({type:i??o,baseUrl:a,handle:s,locale:u}),u)).join(`
|
|
|
964
964
|
}
|
|
965
965
|
}
|
|
966
966
|
}
|
|
967
|
-
`,
|
|
967
|
+
`,_i=`#graphql
|
|
968
968
|
query SitemapIndex {
|
|
969
969
|
products: sitemap(type: PRODUCT) {
|
|
970
970
|
pagesCount {
|
|
@@ -997,7 +997,7 @@ query SitemapIndex {
|
|
|
997
997
|
}
|
|
998
998
|
}
|
|
999
999
|
}
|
|
1000
|
-
`,
|
|
1000
|
+
`,Ui={products:Ei,articles:wi,collections:bi,pages:xi,blogs:Di,metaObjects:Oi};//! @see https://shopify.dev/docs/api/storefront/latest/queries/cart
|
|
1001
1001
|
//! @see: https://shopify.dev/docs/api/storefront/latest/mutations/cartCreate
|
|
1002
1002
|
//! @see: https://shopify.dev/docs/api/storefront/latest/mutations/cartLinesAdd
|
|
1003
1003
|
//! @see: https://shopify.dev/docs/api/storefront/latest/mutations/cartLinesUpdate
|
|
@@ -1015,5 +1015,5 @@ query SitemapIndex {
|
|
|
1015
1015
|
//! @see: https://shopify.dev/docs/api/storefront/latest/mutations/cartDeliveryAddressesRemove
|
|
1016
1016
|
//! @see: https://shopify.dev/docs/api/storefront/latest/mutations/cartDeliveryAddressesUpdate
|
|
1017
1017
|
//! @see: https://shopify.dev/docs/api/storefront/2026-04/mutations/cartDeliveryAddressesReplace
|
|
1018
|
-
Object.defineProperty(exports,"AnalyticsEventName",{enumerable:true,get:function(){return hydrogenReact.AnalyticsEventName}});Object.defineProperty(exports,"AnalyticsPageType",{enumerable:true,get:function(){return hydrogenReact.AnalyticsPageType}});Object.defineProperty(exports,"ExternalVideo",{enumerable:true,get:function(){return hydrogenReact.ExternalVideo}});Object.defineProperty(exports,"IMAGE_FRAGMENT",{enumerable:true,get:function(){return hydrogenReact.IMAGE_FRAGMENT}});Object.defineProperty(exports,"Image",{enumerable:true,get:function(){return hydrogenReact.Image}});Object.defineProperty(exports,"MediaFile",{enumerable:true,get:function(){return hydrogenReact.MediaFile}});Object.defineProperty(exports,"ModelViewer",{enumerable:true,get:function(){return hydrogenReact.ModelViewer}});Object.defineProperty(exports,"Money",{enumerable:true,get:function(){return hydrogenReact.Money}});Object.defineProperty(exports,"ShopifySalesChannel",{enumerable:true,get:function(){return hydrogenReact.ShopifySalesChannel}});Object.defineProperty(exports,"Video",{enumerable:true,get:function(){return hydrogenReact.Video}});Object.defineProperty(exports,"customerAccountApiCustomScalars",{enumerable:true,get:function(){return hydrogenReact.customerAccountApiCustomScalars}});Object.defineProperty(exports,"decodeEncodedVariant",{enumerable:true,get:function(){return hydrogenReact.decodeEncodedVariant}});Object.defineProperty(exports,"flattenConnection",{enumerable:true,get:function(){return hydrogenReact.flattenConnection}});Object.defineProperty(exports,"getAdjacentAndFirstAvailableVariants",{enumerable:true,get:function(){return hydrogenReact.getAdjacentAndFirstAvailableVariants}});Object.defineProperty(exports,"getClientBrowserParameters",{enumerable:true,get:function(){return hydrogenReact.getClientBrowserParameters}});Object.defineProperty(exports,"getProductOptions",{enumerable:true,get:function(){return hydrogenReact.getProductOptions}});Object.defineProperty(exports,"getShopifyCookies",{enumerable:true,get:function(){return hydrogenReact.getShopifyCookies}});Object.defineProperty(exports,"getTrackingValues",{enumerable:true,get:function(){return hydrogenReact.getTrackingValues}});Object.defineProperty(exports,"isOptionValueCombinationInEncodedVariant",{enumerable:true,get:function(){return hydrogenReact.isOptionValueCombinationInEncodedVariant}});Object.defineProperty(exports,"mapSelectedProductOptionToObject",{enumerable:true,get:function(){return hydrogenReact.mapSelectedProductOptionToObject}});Object.defineProperty(exports,"parseGid",{enumerable:true,get:function(){return hydrogenReact.parseGid}});Object.defineProperty(exports,"parseMetafield",{enumerable:true,get:function(){return hydrogenReact.parseMetafield}});Object.defineProperty(exports,"sendShopifyAnalytics",{enumerable:true,get:function(){return hydrogenReact.sendShopifyAnalytics}});Object.defineProperty(exports,"storefrontApiCustomScalars",{enumerable:true,get:function(){return hydrogenReact.storefrontApiCustomScalars}});Object.defineProperty(exports,"useLoadScript",{enumerable:true,get:function(){return hydrogenReact.useLoadScript}});Object.defineProperty(exports,"useMoney",{enumerable:true,get:function(){return hydrogenReact.useMoney}});Object.defineProperty(exports,"useSelectedOptionInUrlParam",{enumerable:true,get:function(){return hydrogenReact.useSelectedOptionInUrlParam}});Object.defineProperty(exports,"useShopifyCookies",{enumerable:true,get:function(){return hydrogenReact.useShopifyCookies}});exports.Analytics=
|
|
1018
|
+
Object.defineProperty(exports,"AnalyticsEventName",{enumerable:true,get:function(){return hydrogenReact.AnalyticsEventName}});Object.defineProperty(exports,"AnalyticsPageType",{enumerable:true,get:function(){return hydrogenReact.AnalyticsPageType}});Object.defineProperty(exports,"ExternalVideo",{enumerable:true,get:function(){return hydrogenReact.ExternalVideo}});Object.defineProperty(exports,"IMAGE_FRAGMENT",{enumerable:true,get:function(){return hydrogenReact.IMAGE_FRAGMENT}});Object.defineProperty(exports,"Image",{enumerable:true,get:function(){return hydrogenReact.Image}});Object.defineProperty(exports,"MediaFile",{enumerable:true,get:function(){return hydrogenReact.MediaFile}});Object.defineProperty(exports,"ModelViewer",{enumerable:true,get:function(){return hydrogenReact.ModelViewer}});Object.defineProperty(exports,"Money",{enumerable:true,get:function(){return hydrogenReact.Money}});Object.defineProperty(exports,"ShopifySalesChannel",{enumerable:true,get:function(){return hydrogenReact.ShopifySalesChannel}});Object.defineProperty(exports,"Video",{enumerable:true,get:function(){return hydrogenReact.Video}});Object.defineProperty(exports,"customerAccountApiCustomScalars",{enumerable:true,get:function(){return hydrogenReact.customerAccountApiCustomScalars}});Object.defineProperty(exports,"decodeEncodedVariant",{enumerable:true,get:function(){return hydrogenReact.decodeEncodedVariant}});Object.defineProperty(exports,"flattenConnection",{enumerable:true,get:function(){return hydrogenReact.flattenConnection}});Object.defineProperty(exports,"getAdjacentAndFirstAvailableVariants",{enumerable:true,get:function(){return hydrogenReact.getAdjacentAndFirstAvailableVariants}});Object.defineProperty(exports,"getClientBrowserParameters",{enumerable:true,get:function(){return hydrogenReact.getClientBrowserParameters}});Object.defineProperty(exports,"getProductOptions",{enumerable:true,get:function(){return hydrogenReact.getProductOptions}});Object.defineProperty(exports,"getShopifyCookies",{enumerable:true,get:function(){return hydrogenReact.getShopifyCookies}});Object.defineProperty(exports,"getTrackingValues",{enumerable:true,get:function(){return hydrogenReact.getTrackingValues}});Object.defineProperty(exports,"isOptionValueCombinationInEncodedVariant",{enumerable:true,get:function(){return hydrogenReact.isOptionValueCombinationInEncodedVariant}});Object.defineProperty(exports,"mapSelectedProductOptionToObject",{enumerable:true,get:function(){return hydrogenReact.mapSelectedProductOptionToObject}});Object.defineProperty(exports,"parseGid",{enumerable:true,get:function(){return hydrogenReact.parseGid}});Object.defineProperty(exports,"parseMetafield",{enumerable:true,get:function(){return hydrogenReact.parseMetafield}});Object.defineProperty(exports,"sendShopifyAnalytics",{enumerable:true,get:function(){return hydrogenReact.sendShopifyAnalytics}});Object.defineProperty(exports,"storefrontApiCustomScalars",{enumerable:true,get:function(){return hydrogenReact.storefrontApiCustomScalars}});Object.defineProperty(exports,"useLoadScript",{enumerable:true,get:function(){return hydrogenReact.useLoadScript}});Object.defineProperty(exports,"useMoney",{enumerable:true,get:function(){return hydrogenReact.useMoney}});Object.defineProperty(exports,"useSelectedOptionInUrlParam",{enumerable:true,get:function(){return hydrogenReact.useSelectedOptionInUrlParam}});Object.defineProperty(exports,"useShopifyCookies",{enumerable:true,get:function(){return hydrogenReact.useShopifyCookies}});exports.Analytics=na;exports.AnalyticsEvent=G;exports.CacheCustom=Ft;exports.CacheLong=Mt;exports.CacheNone=Vt;exports.CacheShort=le;exports.CartForm=re;exports.InMemoryCache=qt;exports.NonceProvider=$o;exports.OptimisticInput=xs;exports.Pagination=Ls;exports.RichText=Xs;exports.Script=Ps;exports.Seo=mi;exports.ShopPayButton=gi;exports.VariantSelector=Ws;exports.cartAttributesUpdateDefault=tr;exports.cartBuyerIdentityUpdateDefault=Xt;exports.cartCreateDefault=jt;exports.cartDiscountCodesUpdateDefault=zt;exports.cartGetDefault=Wt;exports.cartGetIdDefault=Gt;exports.cartGiftCardCodesAddDefault=ar;exports.cartGiftCardCodesRemoveDefault=sr;exports.cartGiftCardCodesUpdateDefault=nr;exports.cartLinesAddDefault=Kt;exports.cartLinesRemoveDefault=Jt;exports.cartLinesUpdateDefault=Yt;exports.cartMetafieldDeleteDefault=or;exports.cartMetafieldsSetDefault=rr;exports.cartNoteUpdateDefault=Zt;exports.cartSelectedDeliveryOptionsUpdateDefault=er;exports.cartSetIdDefault=Bt;exports.changelogHandler=Xa;exports.createCartHandler=ir;exports.createContentSecurityPolicy=hs;exports.createCustomerAccountClient=mr;exports.createHydrogenContext=ps;exports.createRequestHandler=ys;exports.createStorefrontClient=Ro;exports.createWithCache=Ca;exports.formatAPIResult=I;exports.generateCacheControlHeader=Ve;exports.getPaginationVariables=Vs;exports.getSelectedProductOptions=js;exports.getSeoMeta=ai;exports.getShopAnalytics=ra;exports.getSitemap=Ri;exports.getSitemapIndex=Si;exports.graphiqlLoader=Zs;exports.hydrogenContext=Za;exports.hydrogenPreset=Ys;exports.hydrogenRoutes=Es;exports.storefrontRedirect=ei;exports.useAnalytics=Z;exports.useCustomerPrivacy=wt;exports.useNonce=Cr;exports.useOptimisticCart=Ja;exports.useOptimisticData=ws;exports.useOptimisticVariant=Hs;//# sourceMappingURL=index.cjs.map
|
|
1019
1019
|
//# sourceMappingURL=index.cjs.map
|