@shopify/hydrogen 2025.4.0 → 2025.4.2
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 +383 -68
- package/dist/development/index.cjs.map +1 -1
- package/dist/development/index.js +382 -72
- package/dist/development/index.js.map +1 -1
- package/dist/production/index.cjs +71 -71
- package/dist/production/index.cjs.map +1 -1
- package/dist/production/index.d.cts +71 -10
- package/dist/production/index.d.ts +71 -10
- package/dist/production/index.js +74 -74
- package/dist/production/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
'use strict';var react=require('react'),react$1=require('@remix-run/react'),jsxRuntime=require('react/jsx-runtime'),hydrogenReact=require('@shopify/hydrogen-react'),cookie=require('worktop/cookie'),Ra=require('content-security-policy-builder');require('url'),require('path'),require('fs/promises');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var Ra__default=/*#__PURE__*/_interopDefault(Ra);var wo=Object.defineProperty;var Oo=(e,t)=>()=>(e&&(t=e(e=0)),t);var Do=(e,t)=>{for(var r in t)wo(e,r,{get:t[r],enumerable:true});};var vo={};Do(vo,{default:()=>So,logSeoTags:()=>Po});function So({headTags:e}){return Po(e),null}function Po(e){console.log(" "),console.log("%cSEO Meta Tags",`${ys}`),console.log(" "),e.forEach(t=>{if(t.tag==="script"){if(console.log("%c\u2022 JSON LD ",zt),t.children)try{console.table(JSON.parse(t.children),["name","content"]);}catch{console.log(t.children);}}else {if(console.log(`%c\u2022 ${t.tag} `,zt),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;fs(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",zt),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 fs(e){let o=await(await(await fetch(e)).blob()).arrayBuffer();return `data:image/png;base64,${ms(o)}`}function ms(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 zt,ys,To=Oo(()=>{zt="text-transform: uppercase;",ys="text-transform: uppercase; font-weight: bold; text-transform: uppercase;font-weight: bold";});function ue(e){let{type:t,data:r={},customData:o}=e,n=react$1.useLocation(),{publish:a,cart:s,prevCart:c,shop:i,customData:u}=G(),p=n.pathname+n.search,l={...r,customData:{...u,...o},cart:s,prevCart:c,shop:i};return react.useEffect(()=>{i?.shopId&&(l={...l,url:window.location.href},a(t,l));},[a,p,i?.shopId]),null}function Zt(e){return jsxRuntime.jsx(ue,{...e,type:"page_viewed"})}function er(e){return jsxRuntime.jsx(ue,{...e,type:"product_viewed"})}function tr(e){return jsxRuntime.jsx(ue,{...e,type:"collection_viewed"})}function rr(e){return jsxRuntime.jsx(ue,{...e,type:"cart_viewed"})}function or(e){return jsxRuntime.jsx(ue,{...e,type:"search_viewed"})}function nr(e){return jsxRuntime.jsx(ue,{...e})}var V={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 Mo="https://cdn.shopify.com/shopifycloud/consent-tracking-api/v0.1/consent-tracking-api.js",Vo="https://cdn.shopify.com/shopifycloud/privacy-banner/storefront-banner.js";function rt(e){console.error(`[h2:error:useCustomerPrivacy] Unable to setup Customer Privacy API: Missing consent.${e} configuration.`);}function ot(e){let{withPrivacyBanner:t=false,onVisitorConsentCollected:r,onReady:o,...n}=e;hydrogenReact.useLoadScript(t?Vo:Mo,{attributes:{id:"customer-privacy-api"}});let{observing:a,setLoaded:s}=$o({withPrivacyBanner:t,onLoaded:o}),c=react.useMemo(()=>{let{checkoutDomain:u,storefrontAccessToken:p}=n;return u||rt("checkoutDomain"),p||rt("storefrontAccessToken"),(p.startsWith("shpat_")||p.length!==32)&&console.error("[h2:error:useCustomerPrivacy] It looks like you passed a private access token, make sure to use the public token"),{checkoutRootDomain:u,storefrontAccessToken:p,storefrontRootDomain:ir(u),country:n.country,locale:n.locale}},[n,ir,rt]);react.useEffect(()=>{let u=p=>{r&&r(p.detail);};return document.addEventListener("visitorConsentCollected",u),()=>{document.removeEventListener("visitorConsentCollected",u);}},[r]),react.useEffect(()=>{if(!t||a.current.privacyBanner)return;a.current.privacyBanner=true;let u=window.privacyBanner||void 0;Object.defineProperty(window,"privacyBanner",{configurable:true,get(){return u},set(l){if(typeof l=="object"&&l!==null&&"showPreferences"in l&&"loadBanner"in l){let m=l;m.loadBanner(c),u=ur({privacyBanner:m,config:c}),s.privacyBanner(),sr();}}});},[t,c,ur,s.privacyBanner]),react.useEffect(()=>{if(a.current.customerPrivacy)return;a.current.customerPrivacy=true;let u=null,p=window.Shopify||void 0;Object.defineProperty(window,"Shopify",{configurable:true,get(){return p},set(l){typeof l=="object"&&l!==null&&Object.keys(l).length===0&&(p=l,Object.defineProperty(window.Shopify,"customerPrivacy",{configurable:true,get(){return u},set(m){if(typeof m=="object"&&m!==null&&"setTrackingConsent"in m){let y=m;u={...y,setTrackingConsent:cr({customerPrivacy:y,config:c})},p={...p,customerPrivacy:u},s.customerPrivacy(),sr();}}}));}});},[c,cr,s.customerPrivacy]);let i={customerPrivacy:de()};return t&&(i.privacyBanner=Le()),i}var ar=false;function sr(){if(ar)return;ar=true;let e=new CustomEvent("shopifyCustomerPrivacyApiLoaded");document.dispatchEvent(e);}function $o({withPrivacyBanner:e,onLoaded:t}){let r=react.useRef({customerPrivacy:false,privacyBanner:false}),[o,n]=react.useState(e?[false,false]:[false]),a=o.every(Boolean),s={customerPrivacy:()=>{n(e?c=>[true,c[1]]:()=>[true]);},privacyBanner:()=>{e&&n(c=>[c[0],true]);}};return react.useEffect(()=>{a&&t&&t();},[a,t]),{observing:r,setLoaded:s}}function ir(e){if(typeof window>"u")return;let t=window.document.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(".")}function cr({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 ur({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 de(){try{return window.Shopify&&window.Shopify.customerPrivacy?window.Shopify?.customerPrivacy:null}catch{return null}}function Le(){try{return window&&window?.privacyBanner?window.privacyBanner:null}catch{return null}}var pr="2025.4.0";function Bo(){let e=de();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 yr({consent:e,onReady:t,domain:r}){let{subscribe:o,register:n,canTrack:a}=G(),[s,c]=react.useState(false),[i,u]=react.useState(false),p=react.useRef(false),{checkoutDomain:l,storefrontAccessToken:m,language:y}=e,{ready:d}=n("Internal_Shopify_Analytics");return ot({...e,locale:y,checkoutDomain:l||"mock.shop",storefrontAccessToken:m||"abcdefghijklmnopqrstuvwxyz123456",onVisitorConsentCollected:()=>u(true),onReady:()=>u(true)}),hydrogenReact.useShopifyCookies({hasUserConsent:i?a():true,domain:r,checkoutDomain:l}),react.useEffect(()=>{p.current||(p.current=true,o(V.PAGE_VIEWED,Wo),o(V.PRODUCT_VIEWED,jo),o(V.COLLECTION_VIEWED,Ko),o(V.SEARCH_VIEWED,zo),o(V.PRODUCT_ADD_TO_CART,Yo),c(true));},[o]),react.useEffect(()=>{s&&i&&(d(),t());},[s,i,t]),null}function ke(e){console.error(`[h2:error:ShopifyAnalytics] Unable to send Shopify analytics: Missing shop.${e} configuration.`);}function Se(e){let t=Bo(),r=t.analyticsProcessingAllowed();if(!e?.shop?.shopId){ke("shopId");return}if(!e?.shop?.acceptedLanguage){ke("acceptedLanguage");return}if(!e?.shop?.currency){ke("currency");return}if(!e?.shop?.hydrogenSubchannelId){ke("hydrogenSubchannelId");return}return {shopifySalesChannel:"hydrogen",assetVersionId:pr,...e.shop,hasUserConsent:r,...hydrogenReact.getClientBrowserParameters(),ccpaEnforced:!t.saleOfDataAllowed(),gdprEnforced:!(t.marketingAllowed()&&t.analyticsProcessingAllowed()),analyticsAllowed:t.analyticsProcessingAllowed(),marketingAllowed:t.marketingAllowed(),saleOfDataAllowed:t.saleOfDataAllowed()}}function Qo(e,t){if(t===null)return;let r=Se(e);return r?{...r,cartId:t.id}:void 0}var Z={};function Wo(e){let t=Se(e);t&&(hydrogenReact.sendShopifyAnalytics({eventName:hydrogenReact.AnalyticsEventName.PAGE_VIEW_2,payload:{...t,...Z}}),Z={});}function jo(e){let t=Se(e);if(t&&fr({type:"product",products:e.products})){let r=nt(e.products);Z={pageType:hydrogenReact.AnalyticsPageType.product,resourceId:r[0].productGid},t={...t,...Z,products:nt(e.products)},hydrogenReact.sendShopifyAnalytics({eventName:hydrogenReact.AnalyticsEventName.PRODUCT_VIEW,payload:t});}}function Ko(e){let t=Se(e);t&&(Z={pageType:hydrogenReact.AnalyticsPageType.collection,resourceId:e.collection.id},t={...t,...Z,collectionHandle:e.collection.handle,collectionId:e.collection.id},hydrogenReact.sendShopifyAnalytics({eventName:hydrogenReact.AnalyticsEventName.COLLECTION_VIEW,payload:t}));}function zo(e){let t=Se(e);t&&(Z={pageType:hydrogenReact.AnalyticsPageType.search},t={...t,...Z,searchString:e.searchTerm},hydrogenReact.sendShopifyAnalytics({eventName:hydrogenReact.AnalyticsEventName.SEARCH_VIEW,payload:t}));}function Yo(e){let{cart:t,currentLine:r}=e,o=Qo(e,t);!o||!r?.id||Jo({matchedLine:r,eventPayload:o});}function Jo({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};fr({type:"cart",products:[r]})&&hydrogenReact.sendShopifyAnalytics({eventName:hydrogenReact.AnalyticsEventName.ADD_TO_CART,payload:{...t,products:nt([r])}});}function ae(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 fr({type:e,products:t}){return !t||t.length===0?(ae(e,"",false,"data.products"),false):(t.forEach(r=>{if(!r.id)return ae(e,"id",false),false;if(!r.title)return ae(e,"title",false),false;if(!r.price)return ae(e,"price.amount",true,"price"),false;if(!r.vendor)return ae(e,"vendor",false),false;if(!r.variantId)return ae(e,"id",true,"variantId"),false;if(!r.variantTitle)return ae(e,"title",true,"variantTitle"),false}),true)}function nt(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 hr(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 Cr({cart:e,setCarts:t}){let{publish:r,shop:o,customData:n,canTrack:a,cart:s,prevCart:c}=G(),i=react.useRef(null);return react.useEffect(()=>{if(e)return Promise.resolve(e).then(u=>{if(u&&u.lines){if(!u.id){hr("id");return}if(!u.updatedAt){hr("updatedAt");return}}t(({cart:p,prevCart:l})=>u?.updatedAt!==p?.updatedAt?{cart:u,prevCart:p}:{cart:p,prevCart:l});}),()=>{}},[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 p={eventTimestamp:Date.now(),cart:s,prevCart:c,shop:o,customData:n};if(s.updatedAt===i.current)return;i.current=s.updatedAt,r("cart_updated",p),localStorage.setItem("cartLastUpdatedAt",JSON.stringify({id:s.id,updatedAt:s.updatedAt}));let l=c?.lines?hydrogenReact.flattenConnection(c?.lines):[],m=s.lines?hydrogenReact.flattenConnection(s.lines):[];l?.forEach(y=>{let d=m.filter(g=>y.id===g.id);if(d?.length===1){let g=d[0];y.quantity<g.quantity?r("product_added_to_cart",{...p,prevLine:y,currentLine:g}):y.quantity>g.quantity&&r("product_removed_from_cart",{...p,prevLine:y,currentLine:g});}else r("product_removed_from_cart",{...p,prevLine:y});}),m?.forEach(y=>{let d=l.filter(g=>y.id===g.id);(!d||d.length===0)&&r("product_added_to_cart",{...p,currentLine:y});});},[s,c,r,o,n,a]),null}var on="https://cdn.shopify.com/shopifycloud/perf-kit/shopify-perf-kit-spa.min.js";function Ar({shop:e}){let t=react.useRef(false),{subscribe:r,register:o}=G(),{ready:n}=o("Internal_Shopify_Perf_Kit"),a=hydrogenReact.useLoadScript(on,{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(V.PAGE_VIEWED,()=>{window.PerfKit?.navigate();}),r(V.PRODUCT_VIEWED,()=>{window.PerfKit?.setPageType("product");}),r(V.COLLECTION_VIEWED,()=>{window.PerfKit?.setPageType("collection");}),r(V.SEARCH_VIEWED,()=>{window.PerfKit?.setPageType("search");}),r(V.CART_VIEWED,()=>{window.PerfKit?.setPageType("cart");}),n());},[r,n,a]),null}var Sr=new Set,B=e=>{Sr.has(e)||(console.warn(e),Sr.add(e));},Pr=new Set,st=e=>{Pr.has(e)||(console.error(new Error(e)),Pr.add(e));};var pn={canTrack:()=>false,cart:null,customData:{},prevCart:null,publish:()=>{},shop:null,subscribe:()=>{},register:()=>({ready:()=>{}}),customerPrivacy:null,privacyBanner:null},br=react.createContext(pn),Ve=new Map,Pe={};function wr(){return Object.values(Pe).every(Boolean)}function vr(e,t){Ve.has(e)||Ve.set(e,new Map),Ve.get(e)?.set(t.toString(),t);}var $e=new Map;function Tr(e,t){if(!wr()){$e.set(e,t);return}Or(e,t);}function Or(e,t){(Ve.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 Ir(e){return Pe.hasOwnProperty(e)||(Pe[e]=false),{ready:()=>{Pe[e]=true,wr()&&$e.size>0&&($e.forEach((t,r)=>{Or(r,t);}),$e.clear());}}}function Rr(){try{return window.Shopify.customerPrivacy.analyticsProcessingAllowed()}catch{}return false}function Er(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 dn({canTrack:e,cart:t,children:r,consent:o,customData:n={},shop:a=null,cookieDomain:s}){let c=react.useRef(false),{shop:i}=ln(a),[u,p]=react.useState(!!e),[l,m]=react.useState({cart:null,prevCart:null}),[y,d]=react.useState(e?()=>e:()=>Rr);if(i)if(/\/68817551382$/.test(i.shopId))B("[h2:error:Analytics.Provider] - Mock shop is used. Analytics will not work properly.");else {if(!o.checkoutDomain){let S=Er("consent.checkoutDomain","PUBLIC_CHECKOUT_DOMAIN");st(S);}if(!o.storefrontAccessToken){let S=Er("consent.storefrontAccessToken","PUBLIC_STOREFRONT_API_TOKEN");st(S);}o?.country||(o.country="US"),o?.language||(o.language="EN"),o.withPrivacyBanner===void 0&&(o.withPrivacyBanner=false);}let g=react.useMemo(()=>({canTrack:y,...l,customData:n,publish:y()?Tr:()=>{},shop:i,subscribe:vr,register:Ir,customerPrivacy:de(),privacyBanner:Le()}),[u,y,l,l.cart?.updatedAt,l.prevCart,Tr,vr,n,i,Ir,JSON.stringify(Pe),de,Le]);return jsxRuntime.jsxs(br.Provider,{value:g,children:[r,!!i&&jsxRuntime.jsx(Zt,{}),!!i&&!!t&&jsxRuntime.jsx(Cr,{cart:t,setCarts:m}),!!i&&o.checkoutDomain&&jsxRuntime.jsx(yr,{consent:o,onReady:()=>{c.current=true,p(true),d(e?()=>e:()=>Rr);},domain:s}),!!i&&jsxRuntime.jsx(Ar,{shop:i})]})}function G(){let e=react.useContext(br);if(!e)throw new Error("[h2:error:useAnalytics] 'useAnalytics()' must be a descendent of <AnalyticsProvider/>");return e}function ln(e){let[t,r]=react.useState(null);return react.useEffect(()=>(Promise.resolve(e).then(r),()=>{}),[r,e]),{shop:t}}async function yn({storefront:e,publicStorefrontId:t="0"}){return e.query(fn,{cache:e.CacheLong()}).then(({shop:r,localization:o})=>({shopId:r.id,acceptedLanguage:o.language.isoCode,currency:o.country.currency.isoCode,hydrogenSubchannelId:t}))}var fn=`#graphql
|
|
1
|
+
'use strict';var react=require('react'),react$1=require('@remix-run/react'),jsxRuntime=require('react/jsx-runtime'),hydrogenReact=require('@shopify/hydrogen-react'),cookie=require('worktop/cookie'),serverRuntime=require('@remix-run/server-runtime'),Ba=require('content-security-policy-builder');require('url'),require('path'),require('fs/promises');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var Ba__default=/*#__PURE__*/_interopDefault(Ba);var Fo=Object.defineProperty;var qo=(e,t)=>()=>(e&&(t=e(e=0)),t);var Go=(e,t)=>{for(var r in t)Fo(e,r,{get:t[r],enumerable:true});};var ko={};Go(ko,{default:()=>Uo,logSeoTags:()=>Lo});function Uo({headTags:e}){return Lo(e),null}function Lo(e){console.log(" "),console.log("%cSEO Meta Tags",`${_s}`),console.log(" "),e.forEach(t=>{if(t.tag==="script"){if(console.log("%c\u2022 JSON LD ",ur),t.children)try{console.table(JSON.parse(t.children),["name","content"]);}catch{console.log(t.children);}}else {if(console.log(`%c\u2022 ${t.tag} `,ur),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;Us(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",ur),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 Us(e){let o=await(await(await fetch(e)).blob()).arrayBuffer();return `data:image/png;base64,${Ls(o)}`}function Ls(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 ur,_s,No=qo(()=>{ur="text-transform: uppercase;",_s="text-transform: uppercase; font-weight: bold; text-transform: uppercase;font-weight: bold";});function le(e){let{type:t,data:r={},customData:o}=e,n=react$1.useLocation(),{publish:a,cart:s,prevCart:c,shop:i,customData:u}=Y(),d=n.pathname+n.search,f={...r,customData:{...u,...o},cart:s,prevCart:c,shop:i};return react.useEffect(()=>{i?.shopId&&(f={...f,url:window.location.href},a(t,f));},[a,d,i?.shopId]),null}function dr(e){return jsxRuntime.jsx(le,{...e,type:"page_viewed"})}function lr(e){return jsxRuntime.jsx(le,{...e,type:"product_viewed"})}function yr(e){return jsxRuntime.jsx(le,{...e,type:"collection_viewed"})}function fr(e){return jsxRuntime.jsx(le,{...e,type:"cart_viewed"})}function mr(e){return jsxRuntime.jsx(le,{...e,type:"search_viewed"})}function gr(e){return jsxRuntime.jsx(le,{...e})}var $={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 Me="Custom-Storefront-Request-Group-ID",He="X-Shopify-Storefront-Access-Token",dt="X-SDK-Variant",lt="X-SDK-Variant-Source",yt="X-SDK-Version",ft="X-Shopify-Client-IP",mt="X-Shopify-Client-IP-Sig",$e="_sfapi_proxy",Fe="_server_tracking";function Wo(e){return Object.entries(e).map(([t,r])=>r?`${t};desc=${r}`:void 0).filter(Boolean).join(", ")}function Pe(e,t){let r=typeof t=="string"?t:Wo(t);r&&e.headers.append("Server-Timing",r);}var jo=["_y","_s","_cmp"];function hr(e){let t={};if(!e)return t;let r=new RegExp(`\\b(${jo.join("|")});desc="?([^",]+)"?`,"g"),o;for(;(o=r.exec(e))!==null;)t[o[1]]=o[2];return t}function Cr(e){if(typeof window>"u")return false;try{return !!window.performance.getEntriesByType("navigation")[0]?.serverTiming?.some(r=>r.name===e)}catch{return false}}function Ar(){return Cr($e)}function Sr(){return Cr(Fe)}var Zo="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 ht(e){console.error(`[h2:error:useCustomerPrivacy] Unable to setup Customer Privacy API: Missing consent.${e} configuration.`);}function Ct(e){let{withPrivacyBanner:t=false,onVisitorConsentCollected:r,onReady:o,checkoutDomain:n,storefrontAccessToken:a,country:s,locale:c,sameDomainForStorefrontApi:i}=e,u=react.useMemo(()=>i??Ar(),[i]),d=react.useMemo(()=>u&&!Sr(),[u]),f=hydrogenReact.useShopifyCookies({fetchTrackingValues:d,storefrontAccessToken:a,ignoreDeprecatedCookies:true}),g=react.useMemo(hydrogenReact.getTrackingValues,[f]),{revalidate:y}=react$1.useRevalidator();hydrogenReact.useLoadScript(t?en:Zo,{attributes:{id:"customer-privacy-api"}});let{observing:p,setLoaded:l,apisLoaded:I}=rn({withPrivacyBanner:t}),m=react.useMemo(()=>{n||ht("checkoutDomain"),a||ht("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 S=on(n);return {checkoutRootDomain:u&&typeof window<"u"?window.location.host:n,storefrontRootDomain:S?"."+S:void 0,storefrontAccessToken:a,country:s,locale:c}},[ht,n,a,s,c]);react.useEffect(()=>{let S=v=>{let h=hydrogenReact.getTrackingValues();if((g.visitToken!==h.visitToken||g.uniqueToken!==h.uniqueToken)&&y(),r){let P=te();if(P?.shouldShowBanner()){let A=P.currentVisitorConsent();if(A){let _="";if(A.marketing===_&&A.analytics===_&&A.preferences===_)return}}r(v.detail);}};return document.addEventListener("visitorConsentCollected",S),()=>{document.removeEventListener("visitorConsentCollected",S);}},[r]),react.useEffect(()=>{if(!t||p.current.privacyBanner)return;p.current.privacyBanner=true;let S=window.privacyBanner||void 0;Object.defineProperty(window,"privacyBanner",{configurable:true,get(){return S},set(h){typeof h=="object"&&h!==null&&"showPreferences"in h&&"loadBanner"in h&&(S=vr({privacyBanner:h,config:m}),l.privacyBanner());}});},[t,m,vr,l.privacyBanner]),react.useEffect(()=>{if(p.current.customerPrivacy)return;p.current.customerPrivacy=true;let S=null,v=window.Shopify||void 0;Object.defineProperty(window,"Shopify",{configurable:true,get(){return v},set(h){typeof h=="object"&&h!==null&&Object.keys(h).length===0&&(v=h,Object.defineProperty(window.Shopify,"customerPrivacy",{configurable:true,get(){return S},set(P){if(typeof P=="object"&&P!==null&&"setTrackingConsent"in P){let A=P;S={...A,setTrackingConsent:Tr({customerPrivacy:A,config:m})},v={...v,customerPrivacy:S},l.customerPrivacy();}}}));}});},[m,Tr,l.customerPrivacy]),react.useEffect(()=>{if(!I||!f)return;let S=te();if(S&&!S.cachedConsent){let v=hydrogenReact.getTrackingValues();v.consent&&(S.cachedConsent=v.consent);}if(t){let v=Te();v&&v.loadBanner(m);}tn(),o?.();},[I,f]);let C={customerPrivacy:te()};return t&&(C.privacyBanner=Te()),C}var Pr=false;function tn(){if(Pr)return;Pr=true;let e=new CustomEvent("shopifyCustomerPrivacyApiLoaded");document.dispatchEvent(e);}function rn({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 on(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 Tr({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 vr({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 te(){try{return window.Shopify&&window.Shopify.customerPrivacy?window.Shopify?.customerPrivacy:null}catch{return null}}function Te(){try{return window&&window?.privacyBanner?window.privacyBanner:null}catch{return null}}var Ir="2025.4.2";function pn(){let e=te();if(!e)throw new Error("Shopify Customer Privacy API not available. Must be used within a useEffect. Make sure to load the Shopify Customer Privacy API with useCustomerPrivacy() or <AnalyticsProvider>.");return e}function Er({consent:e,onReady:t,domain:r}){let{subscribe:o,register:n,canTrack:a}=Y(),[s,c]=react.useState(false),[i,u]=react.useState(false),[d,f]=react.useState(""),g=react.useRef(false),{checkoutDomain:y,storefrontAccessToken:p,language:l}=e,{ready:I}=n("Internal_Shopify_Analytics");Ct({...e,locale:l,checkoutDomain:y||"mock.shop",storefrontAccessToken:p||"abcdefghijklmnopqrstuvwxyz123456",onReady:()=>!e.withPrivacyBanner&&u(true),onVisitorConsentCollected:C=>{try{f(JSON.stringify(C));}catch{}u(true);}});let m=react.useMemo(()=>i?a():true,[i,a,d]);return hydrogenReact.useShopifyCookies({hasUserConsent:m,domain:r,checkoutDomain:y,fetchTrackingValues:false,ignoreDeprecatedCookies:!i}),react.useEffect(()=>{g.current||(g.current=true,o($.PAGE_VIEWED,ln),o($.PRODUCT_VIEWED,yn),o($.COLLECTION_VIEWED,fn),o($.SEARCH_VIEWED,mn),o($.PRODUCT_ADD_TO_CART,gn),c(true));},[o]),react.useEffect(()=>{s&&i&&(I(),t());},[s,i,t]),null}function Be(e){console.error(`[h2:error:ShopifyAnalytics] Unable to send Shopify analytics: Missing shop.${e} configuration.`);}function Re(e){let t=pn(),r=t.analyticsProcessingAllowed();if(!e?.shop?.shopId){Be("shopId");return}if(!e?.shop?.acceptedLanguage){Be("acceptedLanguage");return}if(!e?.shop?.currency){Be("currency");return}if(!e?.shop?.hydrogenSubchannelId){Be("hydrogenSubchannelId");return}return {shopifySalesChannel:"hydrogen",assetVersionId:Ir,...e.shop,hasUserConsent:r,...hydrogenReact.getClientBrowserParameters(),analyticsAllowed:t.analyticsProcessingAllowed(),marketingAllowed:t.marketingAllowed(),saleOfDataAllowed:t.saleOfDataAllowed(),ccpaEnforced:!t.saleOfDataAllowed(),gdprEnforced:!(t.marketingAllowed()&&t.analyticsProcessingAllowed())}}function dn(e,t){if(t===null)return;let r=Re(e);return r?{...r,cartId:t.id}:void 0}var re={};function ln(e){let t=Re(e);t&&(hydrogenReact.sendShopifyAnalytics({eventName:hydrogenReact.AnalyticsEventName.PAGE_VIEW_2,payload:{...t,...re}}),re={});}function yn(e){let t=Re(e);if(t&&br({type:"product",products:e.products})){let r=St(e.products);re={pageType:hydrogenReact.AnalyticsPageType.product,resourceId:r[0].productGid},t={...t,...re,products:St(e.products)},hydrogenReact.sendShopifyAnalytics({eventName:hydrogenReact.AnalyticsEventName.PRODUCT_VIEW,payload:t});}}function fn(e){let t=Re(e);t&&(re={pageType:hydrogenReact.AnalyticsPageType.collection,resourceId:e.collection.id},t={...t,...re,collectionHandle:e.collection.handle,collectionId:e.collection.id},hydrogenReact.sendShopifyAnalytics({eventName:hydrogenReact.AnalyticsEventName.COLLECTION_VIEW,payload:t}));}function mn(e){let t=Re(e);t&&(re={pageType:hydrogenReact.AnalyticsPageType.search},t={...t,...re,searchString:e.searchTerm},hydrogenReact.sendShopifyAnalytics({eventName:hydrogenReact.AnalyticsEventName.SEARCH_VIEW,payload:t}));}function gn(e){let{cart:t,currentLine:r}=e,o=dn(e,t);!o||!r?.id||hn({matchedLine:r,eventPayload:o});}function hn({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};br({type:"cart",products:[r]})&&hydrogenReact.sendShopifyAnalytics({eventName:hydrogenReact.AnalyticsEventName.ADD_TO_CART,payload:{...t,products:St([r])}});}function ie(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 br({type:e,products:t}){return !t||t.length===0?(ie(e,"",false,"data.products"),false):(t.forEach(r=>{if(!r.id)return ie(e,"id",false),false;if(!r.title)return ie(e,"title",false),false;if(!r.price)return ie(e,"price.amount",true,"price"),false;if(!r.vendor)return ie(e,"vendor",false),false;if(!r.variantId)return ie(e,"id",true,"variantId"),false;if(!r.variantTitle)return ie(e,"title",true,"variantTitle"),false}),true)}function St(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 xr(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 Dr({cart:e,setCarts:t}){let{publish:r,shop:o,customData:n,canTrack:a,cart:s,prevCart:c}=Y(),i=react.useRef(null);return react.useEffect(()=>{if(e)return Promise.resolve(e).then(u=>{if(u&&u.lines){if(!u.id){xr("id");return}if(!u.updatedAt){xr("updatedAt");return}}t(({cart:d,prevCart:f})=>u?.updatedAt!==d?.updatedAt?{cart:u,prevCart:d}:{cart:d,prevCart:f});}),()=>{}},[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 f=c?.lines?hydrogenReact.flattenConnection(c?.lines):[],g=s.lines?hydrogenReact.flattenConnection(s.lines):[];f?.forEach(y=>{let p=g.filter(l=>y.id===l.id);if(p?.length===1){let l=p[0];y.quantity<l.quantity?r("product_added_to_cart",{...d,prevLine:y,currentLine:l}):y.quantity>l.quantity&&r("product_removed_from_cart",{...d,prevLine:y,currentLine:l});}else r("product_removed_from_cart",{...d,prevLine:y});}),g?.forEach(y=>{let p=f.filter(l=>y.id===l.id);(!p||p.length===0)&&r("product_added_to_cart",{...d,currentLine:y});});},[s,c,r,o,n,a]),null}var vn="https://cdn.shopify.com/shopifycloud/perf-kit/shopify-perf-kit-spa.min.js";function _r({shop:e}){let t=react.useRef(false),{subscribe:r,register:o}=Y(),{ready:n}=o("Internal_Shopify_Perf_Kit"),a=hydrogenReact.useLoadScript(vn,{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($.PAGE_VIEWED,()=>{window.PerfKit?.navigate();}),r($.PRODUCT_VIEWED,()=>{window.PerfKit?.setPageType("product");}),r($.COLLECTION_VIEWED,()=>{window.PerfKit?.setPageType("collection");}),r($.SEARCH_VIEWED,()=>{window.PerfKit?.setPageType("search");}),r($.CART_VIEWED,()=>{window.PerfKit?.setPageType("cart");}),n());},[r,n,a]),null}var Ur=new Set,B=e=>{Ur.has(e)||(console.warn(e),Ur.add(e));},Lr=new Set,Tt=e=>{Lr.has(e)||(console.error(new Error(e)),Lr.add(e));};var wn={canTrack:()=>false,cart:null,customData:{},prevCart:null,publish:()=>{},shop:null,subscribe:()=>{},register:()=>({ready:()=>{}}),customerPrivacy:null,privacyBanner:null},$r=react.createContext(wn),We=new Map,be={};function Fr(){return Object.values(be).every(Boolean)}function kr(e,t){We.has(e)||We.set(e,new Map),We.get(e)?.set(t.toString(),t);}var je=new Map;function Nr(e,t){if(!Fr()){je.set(e,t);return}qr(e,t);}function qr(e,t){(We.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 Vr(e){return be.hasOwnProperty(e)||(be[e]=false),{ready:()=>{be[e]=true,Fr()&&je.size>0&&(je.forEach((t,r)=>{qr(r,t);}),je.clear());}}}function Mr(){try{return window.Shopify.customerPrivacy.analyticsProcessingAllowed()}catch{}return false}function Hr(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 On({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,f]=react.useState(false),[g,y]=react.useState({cart:null,prevCart:null}),[p,l]=react.useState(e?()=>e:()=>Mr);if(c)if(/\/68817551382$/.test(c.shopId))B("[h2:error:Analytics.Provider] - Mock shop is used. Analytics will not work properly.");else {if(!o.checkoutDomain){let m=Hr("consent.checkoutDomain","PUBLIC_CHECKOUT_DOMAIN");Tt(m);}if(!o.storefrontAccessToken){let m=Hr("consent.storefrontAccessToken","PUBLIC_STOREFRONT_API_TOKEN");Tt(m);}o?.country||(o.country="US"),o?.language||(o.language="EN"),o.withPrivacyBanner===void 0&&(o.withPrivacyBanner=false);}let I=react.useMemo(()=>({canTrack:p,...g,customData:n,publish:p()?Nr:()=>{},shop:c,subscribe:kr,register:Vr,customerPrivacy:te(),privacyBanner:Te()}),[i,p,g,g.cart?.updatedAt,g.prevCart,Nr,kr,n,c,Vr,JSON.stringify(be),te,Te]);return jsxRuntime.jsxs($r.Provider,{value:I,children:[r,!!c&&jsxRuntime.jsx(dr,{}),!!c&&!!t&&jsxRuntime.jsx(Dr,{cart:t,setCarts:y}),!!c&&jsxRuntime.jsx(Er,{consent:o,onReady:()=>{u(true),l(e?()=>e:()=>Mr),f(true);},domain:s}),!!c&&d&&jsxRuntime.jsx(_r,{shop:c})]})}function Y(){let e=react.useContext($r);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 Dn({storefront:e,publicStorefrontId:t="0"}){return e.query(_n,{cache:e.CacheLong()}).then(({shop:r,localization:o})=>({shopId:r.id,acceptedLanguage:o.language.isoCode,currency:o.country.currency.isoCode,hydrogenSubchannelId:t}))}var _n=`#graphql
|
|
2
2
|
query ShopData(
|
|
3
3
|
$country: CountryCode
|
|
4
4
|
$language: LanguageCode
|
|
@@ -17,15 +17,15 @@
|
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
`,
|
|
20
|
+
`,Un={CartView:fr,CollectionView:yr,CustomView:gr,ProductView:lr,Provider:On,SearchView:mr};function Q(e,t){return vt(e.headers,t)}function vt(e,t){let r=e?.get?.(t)??e?.[t];return typeof r=="string"?r:null}function oe(e){return {requestId:e?Q(e,"request-id"):void 0,purpose:e?Q(e,"purpose"):void 0}}var It=/^\/api\/(unstable|2\d{3}-\d{2})\/graphql\.json$/,Rt=e=>{try{return new URL(e,"http://e.c").pathname}catch{return "/"}};function Et(e,t){return t.reduce((r,o)=>{let n=e(o);return n&&r.push([o,n]),r},[])}function fe(e,t={}){let r=new Error,o=(n,a="Error")=>{let s=(r.stack??"").split(`
|
|
21
21
|
`).slice(3+(t.stackOffset??0)).join(`
|
|
22
22
|
`).replace(/ at loader(\d+) \(/,(c,i)=>c.replace(i,""));return `${a}: ${n}
|
|
23
|
-
`+s};return e.then(n=>{if(n?.errors&&Array.isArray(n.errors)){let a=typeof t.logErrors=="function"?t.logErrors:()=>t.logErrors??false;n.errors.forEach(s=>{s&&(s.stack=o(s.message,s.name),a(s)&&console.error(s));});}return n}).catch(n=>{throw n&&(n.stack=o(n.message,n.name)),n})}var
|
|
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 W=void 0;var Ke="public",kn="private",bt="no-store",Gr={maxAge:"max-age",staleWhileRevalidate:"stale-while-revalidate",sMaxAge:"s-maxage",staleIfError:"stale-if-error"};function we(e){let t=[];return Object.keys(e).forEach(r=>{r==="mode"?t.push(e[r]):Gr[r]&&t.push(`${Gr[r]}=${e[r]}`);}),t.join(", ")}function wt(){return {mode:bt}}function Ot(e){if(e?.mode&&e?.mode!==Ke&&e?.mode!==kn)throw Error("'mode' must be either 'public' or 'private'")}function ce(e){return Ot(e),{mode:Ke,maxAge:1,staleWhileRevalidate:9,...e}}function xt(e){return Ot(e),{mode:Ke,maxAge:3600,staleWhileRevalidate:82800,...e}}function me(e){return Ot(e),{mode:Ke,maxAge:1,staleWhileRevalidate:86399,...e}}function Dt(e){return e}function z(e){return String(e).includes("__proto__")?JSON.parse(e,Nn):JSON.parse(e)}function Nn(e,t){if(e!=="__proto__")return t}function Ye(e,t){return e&&t?{...e,...t}:e||me()}function _t(e){return we(Ye(e))}async function Vn(e,t){if(!e)return;let r=await e.match(t);if(!r){return}return r}async function Mn(e,t,r,o){if(!e)return;let n=Ye(o),a=_t(Ye(n,{maxAge:(n.maxAge||0)+(n.staleWhileRevalidate||0)})),s=_t(Ye(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 Hn(e,t){e&&await e.delete(t);}function $n(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 Fn(e,t){let r=t.headers.get("cache-put-date");if(!r)return false;let[o,n]=$n(t,r),a=o>n;return a}var ze={get:Vn,set:Mn,delete:Hn,generateDefaultCacheControlHeader:_t,isStale:Fn};function Oe(e){return `https://shopify.dev/?${e}`}function qn(e){return e||me()}async function Br(e,t){if(!e)return;let r=Oe(t),o=new Request(r),n=await ze.get(e,o);if(!n)return;let a=await n.text();try{return [z(a),n]}catch{return [a,n]}}async function Qr(e,t,r,o){if(!e)return;let n=Oe(t),a=new Request(n),s=new Response(JSON.stringify(r));await ze.set(e,a,s,qn(o));}function Wr(e,t){return ze.isStale(new Request(Oe(e)),t)}function jr(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 Ut=new Set;async function Je(e,t,{strategy:r=ce(),cacheInstance:o,shouldCacheResult:n=()=>true,waitUntil:a,debugInfo:s}){let i=jr([...typeof e=="string"?[e]:e]),f=m=>{({displayName:m.displayName,url:m.response?.url,responseInit:{status:m.response?.status||0,statusText:m.response?.statusText||"",headers:Array.from(m.response?.headers.entries()||[])}});},y=void 0;if(!o||!r||r.mode===bt){let m=await t({addDebugData:f});return m}let p=m=>Qr(o,i,{value:m,debugInfo:void 0},r),l=await Br(o,i);if(l&&typeof l[0]!="string"){let[{value:m,debugInfo:C},S]=l;let v=Wr(i,S)?"STALE":"HIT";if(!Ut.has(i)&&v==="STALE"){Ut.add(i);let h=Promise.resolve().then(async()=>{let P=Date.now();try{let A=await t({addDebugData:f});n(A)&&(await p(A),y?.({result:A,cacheStatus:"PUT",overrideStartTime:P}));}catch(A){A.message&&(A.message="SWR in sub-request failed: "+A.message),console.error(A);}finally{Ut.delete(i);}});a?.(h);}return m}let I=await t({addDebugData:f});if(n(I)){let m=Promise.resolve().then(async()=>{await p(I);});a?.(m);}return I}var Gn=["set-cookie","server-timing"];function Bn(e,t){return [e,{status:t.status,statusText:t.statusText,headers:[...t.headers].filter(([r])=>!Gn.includes(r.toLowerCase()))}]}function Kr([e,t]){return [e,new Response(e,t)]}async function Xe(e,t,{cacheInstance:r,cache:o,cacheKey:n=[e,t],shouldCacheResponse:a,waitUntil:s,debugInfo:c,onRawHeaders:i}){return !o&&(!t.method||t.method==="GET")&&(o=ce()),Je(n,async()=>{let u=await fetch(e,t);if(i?.(u.headers),!u.ok)return u;let d=await u.text().catch(()=>"");try{d&&(d=z(d));}catch{}return Bn(d,u)},{cacheInstance:r,waitUntil:s,strategy:o??null,debugInfo:c,shouldCacheResult:u=>"ok"in u?!1:a(...Kr(u))}).then(u=>"ok"in u?[null,u]:Kr(u))}function Qn(e){let{cache:t,waitUntil:r,request:o}=e;return {run:({cacheKey:n,cacheStrategy:a,shouldCacheResult:s},c)=>Je(n,c,{shouldCacheResult:s,strategy:a,cacheInstance:t,waitUntil:r,debugInfo:{...oe(o),stackInfo:W?.()}}),fetch:(n,a,s)=>Xe(n,a??{},{waitUntil:r,cacheKey:[n,a],cacheInstance:t,debugInfo:{url:n,...oe(o),stackInfo:W?.(),displayName:s?.displayName},cache:s.cacheStrategy,...s}).then(([c,i])=>({data:c,response:i}))}}var Lt=class{#e;constructor(){this.#e=new Map;}add(t){throw new Error("Method not implemented. Use `put` instead.")}addAll(t){throw new Error("Method not implemented. Use `put` instead.")}matchAll(t,r){throw new Error("Method not implemented. Use `match` instead.")}async put(t,r){if(t.method!=="GET")throw new TypeError("Cannot cache response to non-GET request.");if(r.status===206)throw new TypeError("Cannot cache response to a range request (206 Partial Content).");if(r.headers.get("vary")?.includes("*"))throw new TypeError("Cannot cache response with 'Vary: *' header.");this.#e.set(t.url,{body:new Uint8Array(await r.arrayBuffer()),status:r.status,headers:[...r.headers],timestamp:Date.now()});}async match(t){if(t.method!=="GET")return;let r=this.#e.get(t.url);if(!r)return;let{body:o,timestamp:n,...a}=r,s=new Headers(a.headers),c=s.get("cache-control")||s.get("real-cache-control")||"",i=parseInt(c.match(/max-age=(\d+)/)?.[1]||"0",10),u=parseInt(c.match(/stale-while-revalidate=(\d+)/)?.[1]||"0",10),d=(Date.now()-n)/1e3;if(d>i+u){this.#e.delete(t.url);return}let g=d>i;return s.set("cache",g?"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 Yr="cartFormInput";function J({children:e,action:t,inputs:r,route:o,fetcherKey:n}){let a=react$1.useFetcher({key:n});return jsxRuntime.jsxs(a.Form,{action:o||"",method:"post",children:[(t||r)&&jsxRuntime.jsx("input",{type:"hidden",name:Yr,value:JSON.stringify({action:t,inputs:r})}),typeof e=="function"?e(a):e]})}J.INPUT_NAME=Yr;J.ACTIONS={AttributesUpdateInput:"AttributesUpdateInput",BuyerIdentityUpdate:"BuyerIdentityUpdate",Create:"Create",DiscountCodesUpdate:"DiscountCodesUpdate",GiftCardCodesUpdate:"GiftCardCodesUpdate",LinesAdd:"LinesAdd",LinesRemove:"LinesRemove",LinesUpdate:"LinesUpdate",NoteUpdate:"NoteUpdate",SelectedDeliveryOptionsUpdate:"SelectedDeliveryOptionsUpdate",MetafieldsSet:"MetafieldsSet",MetafieldDelete:"MetafieldDelete",DeliveryAddressesAdd:"DeliveryAddressesAdd",DeliveryAddressesUpdate:"DeliveryAddressesUpdate",DeliveryAddressesRemove:"DeliveryAddressesRemove"};function jn(e){let t={};for(let s of e.entries()){let c=s[0],i=e.getAll(c);t[c]=i.length>1?i:s[1],t[c]==="on"?t[c]=true:t[c]==="off"&&(t[c]=false);}let{cartFormInput:r,...o}=t,{action:n,inputs:a}=r?JSON.parse(String(r)):{};return {action:n,inputs:{...a,...o}}}J.getFormInput=jn;var kt=e=>{let t=cookie.parse(vt(e,"Cookie")||"");return ()=>t.cart?`gid://shopify/Cart/${t.cart}`:void 0};var Nt=e=>t=>{let r=new Headers;return r.append("Set-Cookie",cookie.stringify("cart",t.split("/").pop()||"",{path:"/",...e})),r};function Ze(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():`weak-${Math.random().toString(16).substring(2)}`}var xe="2025.4.2";function ge(e){return e.replace(/\s*#.*$/gm,"").replace(/\s+/gm," ").trim()}var Xn=/(^|}\s)query[\s({]/im,Zn=/(^|}\s)mutation[\s({]/im;function et(e,t){if(!Xn.test(e))throw new Error(`[h2:error:${t}] Can only execute queries`)}function tt(e,t){if(!Zn.test(e))throw new Error(`[h2:error:${t}] Can only execute mutations`)}var ue=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
|
|
26
|
+
`),t}toJSON(){return {name:"Error",message:""}}};function De({url:e,response:t,errors:r,type:o,query:n,queryVariables:a,ErrorConstructor:s=Error,client:c="storefront"}){let i=(typeof r=="string"?r:r?.map?.(d=>d.message).join(`
|
|
27
27
|
`))||`URL: ${e}
|
|
28
|
-
API response error: ${t.status}`,u=new
|
|
28
|
+
API response error: ${t.status}`,u=new ue(i,{query:n,queryVariables:a,cause:{errors:r},clientOperation:`${c}.${o}`,requestId:t.headers.get("x-request-id")});throw new s(u.message,{cause:u.cause})}var oa={language:"EN",country:"US"};function eo(e){let {storefrontHeaders:t,cache:r,waitUntil:o,i18n:n,storefrontId:a,logErrors:s=true,...c}=e,{getPublicTokenHeaders:u,getPrivateTokenHeaders:d,getStorefrontApiUrl:f,getShopifyDomain:g}=hydrogenReact.createStorefrontClient(c),p=(c.privateStorefrontToken?d:u)({contentType:"json",buyerIp:t?.buyerIp||""});t?.buyerIp&&(p[ft]=t.buyerIp),t?.buyerIpSig&&(p[mt]=t.buyerIpSig),p[Me]=t?.requestGroupId||Ze(),a&&(p[hydrogenReact.SHOPIFY_STOREFRONT_ID_HEADER]=a),(p["user-agent"]=`Hydrogen ${xe}`);let l=t?.cookie??"";l&&(p.cookie=l);let I,m;if(!/\b_shopify_(analytics|marketing)=/.test(l)){let h=l.match(/\b_shopify_y=([^;]+)/)?.[1],P=l.match(/\b_shopify_s=([^;]+)/)?.[1];h&&(p[hydrogenReact.SHOPIFY_STOREFRONT_Y_HEADER]=h),P&&(p[hydrogenReact.SHOPIFY_STOREFRONT_S_HEADER]=P),I=h??Ze(),m=P??Ze(),p[hydrogenReact.SHOPIFY_UNIQUE_TOKEN_HEADER]=I,p[hydrogenReact.SHOPIFY_VISIT_TOKEN_HEADER]=m;}let C,S=JSON.stringify({"content-type":p["content-type"],"user-agent":p["user-agent"],[dt]:p[dt],[lt]:p[lt],[yt]:p[yt],[He]:p[He]});async function v({query:h,mutation:P,variables:A,cache:_,headers:V=[],storefrontApiVersion:se,displayName:Ne,stackInfo:Ve}){let T=V instanceof Headers?Object.fromEntries(V.entries()):Array.isArray(V)?Object.fromEntries(V):V,E=h??P,x={...A};n&&(!A?.country&&/\$country/.test(E)&&(x.country=n.country),!A?.language&&/\$language/.test(E)&&(x.language=n.language));let D=f({storefrontApiVersion:se}),M=JSON.stringify({query:E,variables:x}),q={method:"POST",headers:{...p,...T},body:M},H=[D,q.method,S,q.body],[j,G]=await Xe(D,q,{cacheInstance:P?void 0:r,cache:_||me(),cacheKey:H,waitUntil:o,shouldCacheResponse:L=>!L?.errors,debugInfo:{requestId:q.headers[Me],displayName:Ne,url:D,stackInfo:Ve,graphql:M,purpose:t?.purpose},onRawHeaders:L=>{C??={setCookie:typeof L.getSetCookie=="function"?L.getSetCookie():[],serverTiming:L.get("server-timing")??""};}}),U={url:D,response:G,type:P?"mutation":"query",query:E,queryVariables:x,errors:void 0};if(!G.ok){let L,ee=j;try{ee??=await G.text(),L=z(ee);}catch{L=[{message:ee??"Could not parse Storefront API response"}];}De({...U,errors:L});}let{data:K,errors:Se}=j,de=Se?.map(({message:L,...ee})=>new ue(L,{...ee,clientOperation:`storefront.${U.type}`,requestId:G.headers.get("x-request-id"),queryVariables:x,query:E}));return R(K,de)}return {storefront:{query(h,P){h=ge(h),et(h,"storefront.query");let A=Zr?.(h);return fe(v({...P,query:h,stackInfo:W?.(A)}),{stackOffset:A,logErrors:s})},mutate(h,P){h=ge(h),tt(h,"storefront.mutate");let A=Zr?.(h);return fe(v({...P,mutation:h,stackInfo:W?.(A)}),{stackOffset:A,logErrors:s})},cache:r,CacheNone:wt,CacheLong:xt,CacheShort:ce,CacheCustom:Dt,generateCacheControlHeader:we,getPublicTokenHeaders:u,getPrivateTokenHeaders:d,getHeaders:()=>({...p}),getShopifyDomain:g,getApiUrl:f,i18n:n??oa,isStorefrontApiUrl(h){return It.test(Rt(h.url??""))},async forward(h,P){let A=new Headers([...Et(se=>h.headers.get(se),["accept","accept-encoding","accept-language","access-control-request-headers","access-control-request-method","content-type","content-length","cookie","origin","referer","user-agent",He,hydrogenReact.SHOPIFY_UNIQUE_TOKEN_HEADER,hydrogenReact.SHOPIFY_VISIT_TOKEN_HEADER]),...Et(se=>p[se],[ft,mt,hydrogenReact.SHOPIFY_STOREFRONT_ID_HEADER,Me])]);t?.buyerIp&&A.set("x-forwarded-for",t.buyerIp);let _=P?.storefrontApiVersion??Rt(h.url).match(It)?.[1],V=await fetch(f({storefrontApiVersion:_}),{method:h.method,body:h.body,headers:A});return new Response(V.body,V)},setCollectedSubrequestHeaders:h=>{if(C)for(let V of C.setCookie)h.headers.append("Set-Cookie",V);let P=hr(C?.serverTiming),A=h.headers.get("content-type")?.startsWith("text/html");Pe(h,{...A?{_y:I,_s:m}:void 0,...P}),A&&C&&C.setCookie.length>1&&P?._y&&P?._s&&P?._cmp&&Pe(h,{[Fe]:"1"});}}}}var Zr=void 0;function R(e,t){return {...e,...t&&{errors:t}}}function Vt({storefront:e,customerAccount:t,getCartId:r,cartFragment:o}){return async n=>{let a=r();if(!a)return null;let[s,{cart:c,errors:i}]=await Promise.all([t?t.isLoggedIn():false,e.query(na(o),{variables:{cartId:a,...n},cache:e.CacheNone()})]);if(s&&c?.checkoutUrl){let u=new URL(c.checkoutUrl);u.searchParams.set("logged_in","true"),c.checkoutUrl=u.toString();}return c||i?R(c,i):null}}var na=(e=aa)=>`#graphql
|
|
29
29
|
query CartQuery(
|
|
30
30
|
$cartId: ID!
|
|
31
31
|
$numCartLines: Int = 100
|
|
@@ -38,7 +38,7 @@ API response error: ${t.status}`,u=new ie(i,{query:n,queryVariables:a,cause:{err
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
${e}
|
|
41
|
-
`,
|
|
41
|
+
`,aa=`#graphql
|
|
42
42
|
fragment CartApiQuery on Cart {
|
|
43
43
|
updatedAt
|
|
44
44
|
id
|
|
@@ -146,25 +146,25 @@ API response error: ${t.status}`,u=new ie(i,{query:n,queryVariables:a,cause:{err
|
|
|
146
146
|
width
|
|
147
147
|
height
|
|
148
148
|
}
|
|
149
|
-
`;var
|
|
149
|
+
`;var b=`#graphql
|
|
150
150
|
fragment CartApiError on CartUserError {
|
|
151
151
|
message
|
|
152
152
|
field
|
|
153
153
|
code
|
|
154
154
|
}
|
|
155
|
-
`,
|
|
155
|
+
`,w=`#graphql
|
|
156
156
|
fragment CartApiMutation on Cart {
|
|
157
157
|
id
|
|
158
158
|
totalQuantity
|
|
159
159
|
checkoutUrl
|
|
160
160
|
}
|
|
161
|
-
`,
|
|
161
|
+
`,O=`#graphql
|
|
162
162
|
fragment CartApiWarning on CartWarning {
|
|
163
163
|
code
|
|
164
164
|
message
|
|
165
165
|
target
|
|
166
166
|
}
|
|
167
|
-
`;function
|
|
167
|
+
`;function Mt(e){return async(t,r)=>{let o=e.customerAccount?await e.customerAccount.getBuyer():void 0,{cartId:n,...a}=r||{},{buyerIdentity:s,...c}=t,{cartCreate:i,errors:u}=await e.storefront.mutate(sa(e.cartFragment),{variables:{input:{...c,buyerIdentity:{...o,...s}},...a}});return R(i,u)}}var sa=(e=w)=>`#graphql
|
|
168
168
|
mutation cartCreate(
|
|
169
169
|
$input: CartInput!
|
|
170
170
|
$country: CountryCode = ZZ
|
|
@@ -184,9 +184,9 @@ API response error: ${t.status}`,u=new ie(i,{query:n,queryVariables:a,cause:{err
|
|
|
184
184
|
}
|
|
185
185
|
}
|
|
186
186
|
${e}
|
|
187
|
-
${
|
|
188
|
-
${
|
|
189
|
-
`;function
|
|
187
|
+
${b}
|
|
188
|
+
${O}
|
|
189
|
+
`;function Ht(e){return async(t,r)=>{let{cartLinesAdd:o,errors:n}=await e.storefront.mutate(ia(e.cartFragment),{variables:{cartId:e.getCartId(),lines:t,...r}});return R(o,n)}}var ia=(e=w)=>`#graphql
|
|
190
190
|
mutation cartLinesAdd(
|
|
191
191
|
$cartId: ID!
|
|
192
192
|
$lines: [CartLineInput!]!
|
|
@@ -206,9 +206,9 @@ API response error: ${t.status}`,u=new ie(i,{query:n,queryVariables:a,cause:{err
|
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
208
|
${e}
|
|
209
|
-
${
|
|
210
|
-
${
|
|
211
|
-
`;var
|
|
209
|
+
${b}
|
|
210
|
+
${O}
|
|
211
|
+
`;var to="__h_pending_";function ro(e){return to+e}function rt(e){return e.startsWith(to)}function ot(e,t){if(t.some(r=>rt(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 $t(e){return async(t,r)=>{ot("updateLines",t);let{cartLinesUpdate:o,errors:n}=await e.storefront.mutate(ca(e.cartFragment),{variables:{cartId:e.getCartId(),lines:t,...r}});return R(o,n)}}var ca=(e=w)=>`#graphql
|
|
212
212
|
mutation cartLinesUpdate(
|
|
213
213
|
$cartId: ID!
|
|
214
214
|
$lines: [CartLineUpdateInput!]!
|
|
@@ -228,9 +228,9 @@ API response error: ${t.status}`,u=new ie(i,{query:n,queryVariables:a,cause:{err
|
|
|
228
228
|
}
|
|
229
229
|
}
|
|
230
230
|
${e}
|
|
231
|
-
${
|
|
232
|
-
${
|
|
233
|
-
`;function
|
|
231
|
+
${b}
|
|
232
|
+
${O}
|
|
233
|
+
`;function Ft(e){return async(t,r)=>{ot("removeLines",t);let{cartLinesRemove:o,errors:n}=await e.storefront.mutate(ua(e.cartFragment),{variables:{cartId:e.getCartId(),lineIds:t,...r}});return R(o,n)}}var ua=(e=w)=>`#graphql
|
|
234
234
|
mutation cartLinesRemove(
|
|
235
235
|
$cartId: ID!
|
|
236
236
|
$lineIds: [ID!]!
|
|
@@ -250,9 +250,9 @@ API response error: ${t.status}`,u=new ie(i,{query:n,queryVariables:a,cause:{err
|
|
|
250
250
|
}
|
|
251
251
|
}
|
|
252
252
|
${e}
|
|
253
|
-
${
|
|
254
|
-
${
|
|
255
|
-
`;function
|
|
253
|
+
${b}
|
|
254
|
+
${O}
|
|
255
|
+
`;function qt(e){return async(t,r)=>{let o=t.filter((s,c,i)=>i.indexOf(s)===c),{cartDiscountCodesUpdate:n,errors:a}=await e.storefront.mutate(pa(e.cartFragment),{variables:{cartId:e.getCartId(),discountCodes:o,...r}});return R(n,a)}}var pa=(e=w)=>`#graphql
|
|
256
256
|
mutation cartDiscountCodesUpdate(
|
|
257
257
|
$cartId: ID!
|
|
258
258
|
$discountCodes: [String!]
|
|
@@ -272,9 +272,9 @@ API response error: ${t.status}`,u=new ie(i,{query:n,queryVariables:a,cause:{err
|
|
|
272
272
|
}
|
|
273
273
|
}
|
|
274
274
|
${e}
|
|
275
|
-
${
|
|
276
|
-
${
|
|
277
|
-
`;function
|
|
275
|
+
${b}
|
|
276
|
+
${O}
|
|
277
|
+
`;function Gt(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,{cartBuyerIdentityUpdate:n,errors:a}=await e.storefront.mutate(da(e.cartFragment),{variables:{cartId:e.getCartId(),buyerIdentity:{...o,...t},...r}});return R(n,a)}}var da=(e=w)=>`#graphql
|
|
278
278
|
mutation cartBuyerIdentityUpdate(
|
|
279
279
|
$cartId: ID!
|
|
280
280
|
$buyerIdentity: CartBuyerIdentityInput!
|
|
@@ -294,9 +294,9 @@ API response error: ${t.status}`,u=new ie(i,{query:n,queryVariables:a,cause:{err
|
|
|
294
294
|
}
|
|
295
295
|
}
|
|
296
296
|
${e}
|
|
297
|
-
${
|
|
298
|
-
${
|
|
299
|
-
`;function
|
|
297
|
+
${b}
|
|
298
|
+
${O}
|
|
299
|
+
`;function Bt(e){return async(t,r)=>{let{cartNoteUpdate:o,errors:n}=await e.storefront.mutate(la(e.cartFragment),{variables:{cartId:e.getCartId(),note:t,...r}});return R(o,n)}}var la=(e=w)=>`#graphql
|
|
300
300
|
mutation cartNoteUpdate(
|
|
301
301
|
$cartId: ID!
|
|
302
302
|
$note: String!
|
|
@@ -316,9 +316,9 @@ API response error: ${t.status}`,u=new ie(i,{query:n,queryVariables:a,cause:{err
|
|
|
316
316
|
}
|
|
317
317
|
}
|
|
318
318
|
${e}
|
|
319
|
-
${
|
|
320
|
-
${
|
|
321
|
-
`;function
|
|
319
|
+
${b}
|
|
320
|
+
${O}
|
|
321
|
+
`;function Qt(e){return async(t,r)=>{let{cartSelectedDeliveryOptionsUpdate:o,errors:n}=await e.storefront.mutate(ya(e.cartFragment),{variables:{cartId:e.getCartId(),selectedDeliveryOptions:t,...r}});return R(o,n)}}var ya=(e=w)=>`#graphql
|
|
322
322
|
mutation cartSelectedDeliveryOptionsUpdate(
|
|
323
323
|
$cartId: ID!
|
|
324
324
|
$selectedDeliveryOptions: [CartSelectedDeliveryOptionInput!]!
|
|
@@ -338,9 +338,9 @@ API response error: ${t.status}`,u=new ie(i,{query:n,queryVariables:a,cause:{err
|
|
|
338
338
|
}
|
|
339
339
|
}
|
|
340
340
|
${e}
|
|
341
|
-
${
|
|
342
|
-
${
|
|
343
|
-
`;function
|
|
341
|
+
${b}
|
|
342
|
+
${O}
|
|
343
|
+
`;function Wt(e){return async(t,r)=>{let{cartAttributesUpdate:o,errors:n}=await e.storefront.mutate(fa(e.cartFragment),{variables:{cartId:r?.cartId||e.getCartId(),attributes:t}});return R(o,n)}}var fa=(e=w)=>`#graphql
|
|
344
344
|
mutation cartAttributesUpdate(
|
|
345
345
|
$cartId: ID!
|
|
346
346
|
$attributes: [AttributeInput!]!
|
|
@@ -358,9 +358,9 @@ API response error: ${t.status}`,u=new ie(i,{query:n,queryVariables:a,cause:{err
|
|
|
358
358
|
}
|
|
359
359
|
}
|
|
360
360
|
${e}
|
|
361
|
-
${
|
|
362
|
-
${
|
|
363
|
-
`;function
|
|
361
|
+
${b}
|
|
362
|
+
${O}
|
|
363
|
+
`;function jt(e){return async(t,r)=>{let o=r?.cartId||e.getCartId(),n=t.map(c=>({...c,ownerId:o})),{cartMetafieldsSet:a,errors:s}=await e.storefront.mutate(ma(),{variables:{metafields:n}});return R({cart:{id:o},...a},s)}}var ma=()=>`#graphql
|
|
364
364
|
mutation cartMetafieldsSet(
|
|
365
365
|
$metafields: [CartMetafieldsSetInput!]!
|
|
366
366
|
$language: LanguageCode
|
|
@@ -375,7 +375,7 @@ API response error: ${t.status}`,u=new ie(i,{query:n,queryVariables:a,cause:{err
|
|
|
375
375
|
}
|
|
376
376
|
}
|
|
377
377
|
}
|
|
378
|
-
`;function
|
|
378
|
+
`;function Kt(e){return async(t,r)=>{let o=r?.cartId||e.getCartId(),{cartMetafieldDelete:n,errors:a}=await e.storefront.mutate(ga(),{variables:{input:{ownerId:o,key:t}}});return R({cart:{id:o},...n},a)}}var ga=()=>`#graphql
|
|
379
379
|
mutation cartMetafieldDelete(
|
|
380
380
|
$input: CartMetafieldDeleteInput!
|
|
381
381
|
) {
|
|
@@ -387,7 +387,7 @@ API response error: ${t.status}`,u=new ie(i,{query:n,queryVariables:a,cause:{err
|
|
|
387
387
|
}
|
|
388
388
|
}
|
|
389
389
|
}
|
|
390
|
-
`;function
|
|
390
|
+
`;function Yt(e){return async(t,r)=>{let o=t.filter((s,c,i)=>i.indexOf(s)===c),{cartGiftCardCodesUpdate:n,errors:a}=await e.storefront.mutate(ha(e.cartFragment),{variables:{cartId:e.getCartId(),giftCardCodes:o,...r}});return R(n,a)}}var ha=(e=w)=>`#graphql
|
|
391
391
|
mutation cartGiftCardCodesUpdate(
|
|
392
392
|
$cartId: ID!
|
|
393
393
|
$giftCardCodes: [String!]!
|
|
@@ -407,9 +407,9 @@ API response error: ${t.status}`,u=new ie(i,{query:n,queryVariables:a,cause:{err
|
|
|
407
407
|
}
|
|
408
408
|
}
|
|
409
409
|
${e}
|
|
410
|
-
${
|
|
411
|
-
${
|
|
412
|
-
`;function
|
|
410
|
+
${b}
|
|
411
|
+
${O}
|
|
412
|
+
`;function oo(e){return async(t,r)=>{let{cartDeliveryAddressesAdd:o,errors:n}=await e.storefront.mutate(Ca(e.cartFragment),{variables:{cartId:e.getCartId(),addresses:t,...r}});return R(o,n)}}var Ca=(e=w)=>`#graphql
|
|
413
413
|
mutation cartDeliveryAddressesAdd(
|
|
414
414
|
$cartId: ID!
|
|
415
415
|
$addresses: [CartSelectableAddressInput!]!,
|
|
@@ -429,9 +429,9 @@ API response error: ${t.status}`,u=new ie(i,{query:n,queryVariables:a,cause:{err
|
|
|
429
429
|
}
|
|
430
430
|
}
|
|
431
431
|
${e}
|
|
432
|
-
${
|
|
433
|
-
${
|
|
434
|
-
`;function
|
|
432
|
+
${b}
|
|
433
|
+
${O}
|
|
434
|
+
`;function no(e){return async(t,r)=>{let{cartDeliveryAddressesRemove:o,errors:n}=await e.storefront.mutate(Aa(e.cartFragment),{variables:{cartId:e.getCartId(),addressIds:t,...r}});return R(o,n)}}var Aa=(e=w)=>`#graphql
|
|
435
435
|
mutation cartDeliveryAddressesRemove(
|
|
436
436
|
$cartId: ID!
|
|
437
437
|
$addressIds: [ID!]!,
|
|
@@ -451,9 +451,9 @@ API response error: ${t.status}`,u=new ie(i,{query:n,queryVariables:a,cause:{err
|
|
|
451
451
|
}
|
|
452
452
|
}
|
|
453
453
|
${e}
|
|
454
|
-
${
|
|
455
|
-
${
|
|
456
|
-
`;function
|
|
454
|
+
${b}
|
|
455
|
+
${O}
|
|
456
|
+
`;function ao(e){return async(t,r)=>{let{cartDeliveryAddressesUpdate:o,errors:n}=await e.storefront.mutate(Sa(e.cartFragment),{variables:{cartId:e.getCartId(),addresses:t,...r}});return R(o,n)}}var Sa=(e=w)=>`#graphql
|
|
457
457
|
mutation cartDeliveryAddressesUpdate(
|
|
458
458
|
$cartId: ID!
|
|
459
459
|
$addresses: [CartSelectableAddressUpdateInput!]!,
|
|
@@ -473,9 +473,9 @@ API response error: ${t.status}`,u=new ie(i,{query:n,queryVariables:a,cause:{err
|
|
|
473
473
|
}
|
|
474
474
|
}
|
|
475
475
|
${e}
|
|
476
|
-
${
|
|
477
|
-
${
|
|
478
|
-
`;function Nt(e){let{getCartId:t,setCartId:r,storefront:o,customerAccount:n,cartQueryFragment:a,cartMutateFragment:s}=e,c=t(),i=()=>c||t(),u={storefront:o,getCartId:i,cartFragment:s,customerAccount:n},p=It(u),l=async function(...y){let d=await p(...y);return c=d?.cart?.id,d},m={get:Tt({storefront:o,customerAccount:n,getCartId:i,cartFragment:a}),getCartId:i,setCartId:r,create:l,addLines:async(y,d)=>{let g=y.map(S=>({attributes:S.attributes,quantity:S.quantity,merchandiseId:S.merchandiseId,sellingPlanId:S.sellingPlanId}));return c||d?.cartId?await Rt(u)(g,d):await l({lines:g},d)},updateLines:Et(u),removeLines:bt(u),updateDiscountCodes:async(y,d)=>c||d?.cartId?await wt(u)(y,d):await l({discountCodes:y},d),updateGiftCardCodes:async(y,d)=>c||d?.cartId?await kt(u)(y,d):await l({giftCardCodes:y},d),updateBuyerIdentity:async(y,d)=>c||d?.cartId?await Ot(u)(y,d):await l({buyerIdentity:y},d),updateNote:async(y,d)=>c||d?.cartId?await Dt(u)(y,d):await l({note:y},d),updateSelectedDeliveryOption:xt(u),updateAttributes:async(y,d)=>c||d?.cartId?await _t(u)(y,d):await l({attributes:y},d),setMetafields:async(y,d)=>c||d?.cartId?await Ut(u)(y,d):await l({metafields:y},d),deleteMetafield:Lt(u),addDeliveryAddresses:Br(u),removeDeliveryAddresses:Qr(u),updateDeliveryAddresses:Wr(u)};return "customMethods"in e?{...m,...e.customMethods??{}}:m}function aa(e){let t=react$1.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=j.getFormInput(a);if(s.action===j.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:Gr(c.selectedVariant.id),merchandise:c.selectedVariant,isOptimistic:true,quantity:c.quantity||1});}else if(s.action===j.ACTIONS.LinesRemove)for(let c of s.inputs.lineIds){let i=o.findIndex(u=>u.id===c);if(i!==-1){if(je(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===j.ACTIONS.LinesUpdate)for(let c of s.inputs.lines){let i=o.findIndex(u=>c.id===u.id);if(i>-1){if(je(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 sa="https://raw.githubusercontent.com/Shopify/hydrogen/main/docs/changelog.json";async function ia({request:e,changelogUrl:t}){new URL(e.url).searchParams;return fetch(t||sa)}var ze="2025-04",me=`Shopify Hydrogen ${Ie}`,jr="30243aa5-17c1-465a-8493-944bcc4e88aa",U="customerAccount",ge="buyer";var $=class extends Response{constructor(t,r,o){super(`Bad request: ${t}`,{status:400,headers:o});}};function be(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 ca({session:e,customerAccountId:t,customerAccountTokenExchangeUrl:r,httpsOrigin:o,debugInfo:n}){let a=new URLSearchParams,s=e.get(U),c=s?.refreshToken,i=s?.idToken;if(!c)throw new $("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":me,Origin:o};new Date().getTime();let l=r,m=await fetch(l,{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:y,expires_in:d,refresh_token:g}=await m.json();if(!y||y.length===0)throw new $("Unauthorized","Invalid access token received.");e.set(U,{accessToken:y,expiresAt:new Date(new Date().getTime()+(d-120)*1e3).getTime()+"",refreshToken:g,idToken:i});}function he(e){e.unset(U),e.unset(ge);}async function Kr({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=ca({session:r,customerAccountId:o,customerAccountTokenExchangeUrl:n,httpsOrigin:a,debugInfo:s})),await e.refresh,delete e.refresh;}catch(c){throw he(r),c&&c.status!==401?c:new $("Unauthorized","Login before querying the Customer Account API.")}}function zr(){let e=ua();return Jr(e)}async function Yr(e){let t=await crypto.subtle.digest({name:"SHA-256"},new TextEncoder().encode(e)),r=pa(t);return Jr(r)}function ua(){let e=new Uint8Array(32);return crypto.getRandomValues(e),String.fromCharCode.apply(null,Array.from(e))}function Jr(e){return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function pa(e){let t=new Uint8Array(e),r=Array.from(t);return String.fromCharCode(...r)}function Xr(){let e=Date.now().toString(),t=Math.random().toString(36).substring(2);return e+t}async function Zr(e,t,r,o,n){let a=t;if(!e)throw new $("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",jr),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":me,Origin:o};new Date().getTime();let u=r,p=await fetch(u,{method:"POST",headers:c,body:s});let l=await p.json();if(l.error)throw new $(l.error_description);return l.access_token}function eo(e){return da(e).payload.nonce}function da(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 Ye(){return ya(la())}function la(){try{return crypto.getRandomValues(new Uint8Array(16))}catch{return new Uint8Array(16).map(()=>Math.random()*255|0)}}function ya(e){return Array.from(e,function(t){return ("0"+(t&255).toString(16)).slice(-2)}).join("")}function Je(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(ro(e,a))return a;console.warn(`Cross-domain redirects are not supported. Tried to redirect from ${o} to ${a}`);}}function ro(e,t){try{return new URL(e).origin===new URL(t,e).origin}catch{return false}}function Mt({requestUrl:e,defaultUrl:t,redirectUrl:r}){let o=e,n=to(e,t),a=r?to(e,r):n;return ro(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 to(e,t){return fa(t)?new URL(t):new URL(t,new URL(e).origin)}function fa(e){try{return new URL(e),!0}catch{return false}}function oo(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 ma(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 be(n)}function Vt({session:e,customerAccountId:t,shopId:r,customerApiVersion:o=ze,request:n,waitUntil:a,authUrl:s,customAuthStatusHandler:c,logErrors:i=true,loginPath:u="/account/login",authorizePath:p="/account/authorize",defaultRedirectPath:l="/account",language:m}){if(o!==ze&&console.warn(`[h2:warn:createCustomerAccountClient] You are using Customer Account API version ${o} when this version of Hydrogen was built for ${ze}.`),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 y=c||(()=>ma(n,u)),d=new URL(n.url),g=d.protocol==="http:"?d.origin.replace("http","https"):d.origin,S=Mt({requestUrl:g,defaultUrl:p,redirectUrl:s}),f=oo(o,r),C=ga(f,t),v=f("GRAPHQL"),b={};async function x({query:h,type:P,variables:D={}}){let w=await q();if(!w)throw y();new Date().getTime();let N=await fetch(v,{method:"POST",headers:{"Content-Type":"application/json","User-Agent":me,Origin:g,Authorization:w},body:JSON.stringify({query:h,variables:D})});let J=await N.text(),X={url:v,response:N,type:P,query:h,queryVariables:D,errors:void 0,client:"customer"};if(!N.ok){if(N.status===401)throw he(e),y();let E;try{E=W(J);}catch{E=[{message:J}];}Re({...X,errors:E});}try{let E=W(J),{errors:M}=E,xe=M?.map(({message:_e,...tt})=>new ie(_e,{...tt,clientOperation:`customerAccount.${X.type}`,requestId:N.headers.get("x-request-id"),queryVariables:D,query:h}));return {...E,...M&&{errors:xe}}}catch{Re({...X,errors:[{message:J}]});}}async function k(){if(!r)return false;let h=e.get(U),P=h?.accessToken,D=h?.expiresAt;if(!P||!D)return false;let w=F?.();try{await Kr({locks:b,expiresAt:D,session:e,customerAccountId:t,customerAccountTokenExchangeUrl:f("TOKEN_EXCHANGE"),httpsOrigin:g,debugInfo:{waitUntil:a,stackInfo:w,...ee(n)}});}catch{return false}return true}async function O(){if(!await k())throw y()}async function q(){if(await k())return e.get(U)?.accessToken}async function De(h,P){return C(),h=fe(h),We(h,"customer.mutate"),le(x({query:h,type:"mutation",...P}),{logErrors:i})}async function oe(h,P){return C(),h=fe(h),Qe(h,"customer.query"),le(x({query:h,type:"query",...P}),{logErrors:i})}function Y(h){e.set(ge,{...e.get(ge),...h});}async function ne(){let h=await q();if(h)return {...e.get(ge),customerAccessToken:h}}return {login:async h=>{C();let P=new URL(f("AUTH")),D=Xr(),w=Ye();P.searchParams.set("client_id",t),P.searchParams.set("scope","openid email"),P.searchParams.append("response_type","code"),P.searchParams.append("redirect_uri",S),P.searchParams.set("scope",f("LOGIN_SCOPE")),P.searchParams.append("state",D),P.searchParams.append("nonce",w);let _=ha({contextLanguage:m??null,uiLocalesOverride:h?.uiLocales??null});_!=null&&P.searchParams.append("ui_locales",_);let H=zr(),N=await Yr(H);return e.set(U,{...e.get(U),codeVerifier:H,state:D,nonce:w,redirectPath:Je(n.url)||Q(n,"Referer")||l}),P.searchParams.append("code_challenge",N),P.searchParams.append("code_challenge_method","S256"),be(P.toString())},logout:async h=>{C();let P=e.get(U)?.idToken,D=Mt({requestUrl:g,defaultUrl:g,redirectUrl:h?.postLogoutRedirectUri}),w=P?new URL(`${f("LOGOUT")}?${new URLSearchParams([["id_token_hint",P],["post_logout_redirect_uri",D]]).toString()}`).toString():D;he(e);let _=h?.headers instanceof Headers?h?.headers:new Headers(h?.headers);return h?.keepSession||(e.destroy?_.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),be(w,{headers:_})},isLoggedIn:k,handleAuthStatus:O,getAccessToken:q,getApiUrl:()=>v,mutate:De,query:oe,authorize:async()=>{C();let h=d.searchParams.get("code"),P=d.searchParams.get("state");if(!h||!P)throw he(e),new $("Unauthorized","No code or state parameter found in the redirect URL.");if(e.get(U)?.state!==P)throw he(e),new $("Unauthorized","The session state does not match the state parameter. Make sure that the session is configured correctly and passed to `createCustomerAccountClient`.");let D=t,w=new URLSearchParams;w.append("grant_type","authorization_code"),w.append("client_id",D),w.append("redirect_uri",S),w.append("code",h);let _=e.get(U)?.codeVerifier;if(!_)throw new $("Unauthorized","No code verifier found in the session. Make sure that the session is configured correctly and passed to `createCustomerAccountClient`.");w.append("code_verifier",_);let H={"content-type":"application/x-www-form-urlencoded","User-Agent":me,Origin:g};new Date().getTime();let X=f("TOKEN_EXCHANGE"),E=await fetch(X,{method:"POST",headers:H,body:w});if(!E.ok)throw new Response(await E.text(),{status:E.status,headers:{"Content-Type":"text/html; charset=utf-8"}});let{access_token:M,expires_in:xe,id_token:_e,refresh_token:tt}=await E.json(),Yt=e.get(U)?.nonce,Jt=await eo(_e);if(Yt!==Jt)throw new $("Unauthorized",`Returned nonce does not match: ${Yt} !== ${Jt}`);let Xt=M;r||(Xt=await Zr(M,t,f("TOKEN_EXCHANGE"),g,{...ee(n)}));let bo=e.get(U)?.redirectPath;return e.set(U,{accessToken:Xt,expiresAt:new Date(new Date().getTime()+(xe-120)*1e3).getTime()+"",refreshToken:tt,idToken:_e}),be(bo||l)},setBuyer:Y,getBuyer:ne,UNSTABLE_setBuyer:h=>{B("[h2:warn:customerAccount] `customerAccount.UNSTABLE_setBuyer` is deprecated. Please use `customerAccount.setBuyer`."),Y(h);},UNSTABLE_getBuyer:()=>(B("[h2:warn:customerAccount] `customerAccount.UNSTABLE_getBuyer` is deprecated. Please use `customerAccount.getBuyer`."),ne())}}function ga(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 ha(e){let t=no(e.contextLanguage??null);return no(e.uiLocalesOverride)??t??null}function no(e){if(e==null)return null;let o=Aa(e).toLowerCase().replaceAll("_","-").split("-"),n=o.at(0)??null,a=o.at(1)??null;return a?`${n}-${a.toUpperCase()}`:n}var Ca={PT:"PT_PT",ZH:"ZH_CN"};function Aa(e){return Ca[e]??e}function Sa(e){let{env:t,request:r,cache:o,waitUntil:n,i18n:a,session:s,logErrors:c,storefront:i={},customerAccount:u,cart:p={}}=e;s||console.warn("[h2:warn:createHydrogenContext] A session object is required to create hydrogen context."),u?.unstableB2b&&B("[h2:warn:createHydrogenContext] `customerAccount.unstableB2b` is now stable. Please remove the `unstableB2b` option.");let{storefront:l}=qr({cache:o,waitUntil:n,i18n:a,logErrors:c,storefrontHeaders:i.headers||Pa(r),storefrontApiVersion:i.apiVersion,storefrontId:t.PUBLIC_STOREFRONT_ID,storeDomain:t.PUBLIC_STORE_DOMAIN,privateStorefrontToken:t.PRIVATE_STOREFRONT_API_TOKEN,publicStorefrontToken:t.PUBLIC_STOREFRONT_API_TOKEN}),m=Vt({session:s,request:r,waitUntil:n,logErrors:c,customerApiVersion:u?.apiVersion,authUrl:u?.authUrl,customAuthStatusHandler:u?.customAuthStatusHandler,language:a?.language,customerAccountId:t.PUBLIC_CUSTOMER_ACCOUNT_API_CLIENT_ID,shopId:t.SHOP_ID}),y=Nt({getCartId:p.getId||gt(r.headers),setCartId:p.setId||ht(),cartQueryFragment:p.queryFragment,cartMutateFragment:p.mutateFragment,customMethods:p.customMethods,storefront:l,customerAccount:m});return {storefront:l,customerAccount:m,cart:y,env:t,waitUntil:n,session:s}}function Pa(e){return {requestGroupId:Q(e,"request-id"),buyerIp:Q(e,"oxygen-buyer-ip"),cookie:Q(e,"cookie"),purpose:Q(e,"purpose")}}var ao=react.createContext(void 0),Ea=ao.Provider,$t=()=>react.useContext(ao);function ba(e){let t=Ye(),r=wa(t,e);return {nonce:t,header:r,NonceProvider:({children:n})=>react.createElement(Ea,{value:t},n)}}function wa(e,t){let{shop:r,...o}=t??{},n=`'nonce-${e}'`,a=["'self'","'unsafe-inline'","https://cdn.shopify.com"],s=["'self'","https://monorail-edge.shopifysvc.com"];r&&r.checkoutDomain&&s.push(`https://${r.checkoutDomain}`),r&&r.storeDomain&&s.push(`https://${r.storeDomain}`);let i={baseUri:["'self'"],defaultSrc:["'self'",n,"https://cdn.shopify.com","https://shopify.com"],frameAncestors:["'none'"],styleSrc:a,connectSrc:s},u=Object.assign({},i,o);for(let p in i){let l=o[p];p&&l&&(u[p]=Oa(l,i[p]));}return u.scriptSrc instanceof Array?u.scriptSrc=[...u.scriptSrc.filter(p=>!p.startsWith("'nonce")),n]:u.defaultSrc instanceof Array&&(u.defaultSrc=[...u.defaultSrc.filter(p=>!p.startsWith("'nonce")),n]),Ra__default.default({directives:u})}function Oa(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 _a=react.forwardRef((e,t)=>{let{waitForHydration:r,src:o,...n}=e,a=$t();return r?jsxRuntime.jsx(Ua,{src:o,options:n}):jsxRuntime.jsx("script",{suppressHydrationWarning:true,...n,src:o,nonce:a,ref:t})});function Ua({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 ka(e){return e}function Ma(e){let t=react$1.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 Va({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 Ga({connection:e,children:t=()=>(console.warn("<Pagination> requires children to work properly"),null),namespace:r=""}){let [o,n]=react.useState(false),a=react$1.useNavigation(),s=react$1.useLocation();react$1.useNavigate();react.useEffect(()=>{a.state==="idle"&&n(false);},[a.state]);let{endCursor:i,hasNextPage:u,hasPreviousPage:p,nextPageUrl:l,nodes:m,previousPageUrl:y,startCursor:d}=Ba(e,r),g=react.useMemo(()=>({...s.state,pagination:{...s.state?.pagination||{},[r]:{pageInfo:{endCursor:i,hasPreviousPage:p,hasNextPage:u,startCursor:d},nodes:m}}}),[i,u,p,d,m,r,s.state]),S=react.useMemo(()=>react.forwardRef(function(v,b){return u?react.createElement(react$1.Link,{preventScrollReset:true,...v,to:l,state:g,replace:true,ref:b,onClick:()=>n(true)}):null}),[u,l,g]),f=react.useMemo(()=>react.forwardRef(function(v,b){return p?react.createElement(react$1.Link,{preventScrollReset:true,...v,to:y,state:g,replace:true,ref:b,onClick:()=>n(true)}):null}),[p,y,g]);return t({state:g,hasNextPage:u,hasPreviousPage:p,isLoading:o,nextPageUrl:l,nodes:m,previousPageUrl:y,NextLink:S,PreviousLink:f})}function Ze(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 Ba(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=react$1.useNavigation(),o=react$1.useNavigate(),{state:n,search:a,pathname:s}=react$1.useLocation(),c=t?`${t}_cursor`:"cursor",i=t?`${t}_direction`:"direction",l=new URLSearchParams(a).get(i)==="previous",m=react.useMemo(()=>!globalThis?.window?.__hydrogenHydrated||!n?.pagination?.[t]?.nodes?hydrogenReact.flattenConnection(e):l?[...hydrogenReact.flattenConnection(e),...n.pagination[t].nodes||[]]:[...n.pagination[t].nodes||[],...hydrogenReact.flattenConnection(e)],[n,e,t]),y=react.useMemo(()=>{let f=globalThis?.window?.__hydrogenHydrated,C=n?.pagination?.[t]?.pageInfo,v=!f||C?.startCursor===void 0?e.pageInfo.startCursor:C.startCursor,b=!f||C?.endCursor===void 0?e.pageInfo.endCursor:C.endCursor,x=!f||C?.hasPreviousPage===void 0?e.pageInfo.hasPreviousPage:C.hasPreviousPage,k=!f||C?.hasNextPage===void 0?e.pageInfo.hasNextPage:C.hasNextPage;return n?.pagination?.[t]?.nodes&&(l?(v=e.pageInfo.startCursor,x=e.pageInfo.hasPreviousPage):(b=e.pageInfo.endCursor,k=e.pageInfo.hasNextPage)),{startCursor:v,endCursor:b,hasPreviousPage:x,hasNextPage:k}},[l,n,t,e.pageInfo.hasNextPage,e.pageInfo.hasPreviousPage,e.pageInfo.startCursor,e.pageInfo.endCursor]),d=react.useRef({params:Ze(a,n),pathname:s});react.useEffect(()=>{window.__hydrogenHydrated=true;},[]),react.useEffect(()=>{let f=Ze(a,n),C=d.current.params;(s!==d.current.pathname||f!==C)&&!(r.state==="idle"&&!r.location)&&(d.current={pathname:s,params:Ze(a,n)},o(`${s}?${Ze(a,n)}`,{replace:true,preventScrollReset:true,state:{nodes:void 0,pageInfo:void 0}}));},[s,a,n]);let g=react.useMemo(()=>{let f=new URLSearchParams(a);return f.set(i,"previous"),y.startCursor&&f.set(c,y.startCursor),`?${f.toString()}`},[a,y.startCursor]),S=react.useMemo(()=>{let f=new URLSearchParams(a);return f.set(i,"next"),y.endCursor&&f.set(c,y.endCursor),`?${f.toString()}`},[a,y.endCursor]);return {...y,previousPageUrl:g,nextPageUrl:S,nodes:m}}function Qa(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 za(e,t){let r=react$1.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 ts({handle:e,options:t=[],variants:r=[],productPath:o="products",waitForNavigation:n=false,selectedVariant:a,children:s}){let c=t;c[0]?.values&&(B("[h2:warn:VariantSelector] product.options.values is deprecated. Use product.options.optionValues instead."),c[0]&&!c[0].optionValues&&(c=t.map(d=>({...d,optionValues:d.values?.map(g=>({name:g}))||[]}))));let i=r instanceof Array?r:hydrogenReact.flattenConnection(r),{searchParams:u,path:p,alreadyOnProductPage:l}=os(e,o,n),m=c.filter(d=>d?.optionValues?.length===1),y=a?a?.selectedOptions?.reduce((d,g)=>(d[g.name]=g.value,d),{}):{};return react.createElement(react.Fragment,null,...react.useMemo(()=>c.map(d=>{let g,S=[];for(let f of d.optionValues){let C=new URLSearchParams(l?u:void 0);C.set(d.name,f.name),m.forEach(O=>{O.optionValues[0].name&&C.set(O.name,O.optionValues[0].name);});let v=i.find(O=>O?.selectedOptions?.every(q=>(C.get(q?.name)||y?.[q?.name])===q?.value)),b=u.get(d.name);!b&&a&&(b=y?.[d.name]||null);let x=b?b===f.name:false;x&&(g=f.name);let k="?"+C.toString();S.push({value:f.name,optionValue:f,isAvailable:v?v.availableForSale:true,to:p+k,search:k,isActive:x,variant:v});}return s({option:{name:d.name,value:g,values:S}})}),[c,i,s]))}var rs=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 os(e,t,r){let{pathname:o,search:n}=react$1.useLocation(),a=react$1.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])}var ss=function(e){return jsxRuntime.jsx(hydrogenReact.RichText,{...e,components:{link:({node:t})=>jsxRuntime.jsx(react$1.Link,{to:t.url,title:t.title,target:t.target,prefetch:"intent",children:t.children}),...e.components}})};var is=async function({request:t,context:r}){let o=r.storefront,n=r.customerAccount,a=new URL(t.url);if(!o)throw new Error("GraphiQL: Hydrogen's storefront client must be injected in the loader context.");let s={};if(o){let u="X-Shopify-Storefront-Access-Token";s.storefront={name:"Storefront API",authHeader:u,accessToken:o.getPublicTokenHeaders()[u],apiUrl:o.getApiUrl(),icon:"SF"};}if(n){let u=await(await fetch(a.origin+"/graphiql/customer-account.schema.json")).json(),p=await n.getAccessToken();u&&(s["customer-account"]={name:"Customer Account API",value:u,authHeader:"Authorization",accessToken:p,apiUrl:n.getApiUrl(),icon:"CA"});}let c="https://avatars.githubusercontent.com/u/12972006?s=48&v=4",i=String.raw;return new Response(i`
|
|
476
|
+
${b}
|
|
477
|
+
${O}
|
|
478
|
+
`;function zt(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},f=Mt(d),g=async function(...p){p[0].buyerIdentity={...c,...p[0].buyerIdentity};let l=await f(...p);return i=l?.cart?.id,l},y={get:Vt({storefront:o,customerAccount:n,getCartId:u,cartFragment:a}),getCartId:u,setCartId:r,create:g,addLines:async(p,l)=>{let I=p.map(m=>({attributes:m.attributes,quantity:m.quantity,merchandiseId:m.merchandiseId,sellingPlanId:m.sellingPlanId}));return i||l?.cartId?await Ht(d)(I,l):await g({lines:I,buyerIdentity:c},l)},updateLines:$t(d),removeLines:Ft(d),updateDiscountCodes:async(p,l)=>i||l?.cartId?await qt(d)(p,l):await g({discountCodes:p},l),updateGiftCardCodes:async(p,l)=>i||l?.cartId?await Yt(d)(p,l):await g({giftCardCodes:p},l),updateBuyerIdentity:async(p,l)=>i||l?.cartId?await Gt(d)(p,l):await g({buyerIdentity:p},l),updateNote:async(p,l)=>i||l?.cartId?await Bt(d)(p,l):await g({note:p},l),updateSelectedDeliveryOption:Qt(d),updateAttributes:async(p,l)=>i||l?.cartId?await Wt(d)(p,l):await g({attributes:p},l),setMetafields:async(p,l)=>i||l?.cartId?await jt(d)(p,l):await g({metafields:p},l),deleteMetafield:Kt(d),addDeliveryAddresses:oo(d),removeDeliveryAddresses:no(d),updateDeliveryAddresses:ao(d)};return "customMethods"in e?{...y,...e.customMethods??{}}:y}function Ta(e){let t=react$1.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=J.getFormInput(a);if(s.action===J.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===J.ACTIONS.LinesRemove)for(let c of s.inputs.lineIds){let i=o.findIndex(u=>u.id===c);if(i!==-1){if(rt(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===J.ACTIONS.LinesUpdate)for(let c of s.inputs.lines){let i=o.findIndex(u=>c.id===u.id);if(i>-1){if(rt(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 va="https://raw.githubusercontent.com/Shopify/hydrogen/main/docs/changelog.json";async function Ia({request:e,changelogUrl:t}){new URL(e.url).searchParams;return fetch(t||va)}var nt="2025-04",he=`Shopify Hydrogen ${xe}`,so="30243aa5-17c1-465a-8493-944bcc4e88aa",k="customerAccount",Ce="buyer";var F=class extends Response{constructor(t,r,o){super(`Bad request: ${t}`,{status:400,headers:o});}};function Ue(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 Ra({session:e,customerAccountId:t,customerAccountTokenExchangeUrl:r,httpsOrigin:o,debugInfo:n}){let a=new URLSearchParams,s=e.get(k),c=s?.refreshToken,i=s?.idToken;if(!c)throw new F("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":he,Origin:o};new Date().getTime();let f=r,g=await fetch(f,{method:"POST",headers:u,body:a});if(!g.ok){let I=await g.text();throw new Response(I,{status:g.status,headers:{"Content-Type":"text/html; charset=utf-8"}})}let{access_token:y,expires_in:p,refresh_token:l}=await g.json();if(!y||y.length===0)throw new F("Unauthorized","Invalid access token received.");e.set(k,{accessToken:y,expiresAt:new Date(new Date().getTime()+(p-120)*1e3).getTime()+"",refreshToken:l,idToken:i});}function Ae(e){e.unset(k),e.unset(Ce);}async function io({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=Ra({session:r,customerAccountId:o,customerAccountTokenExchangeUrl:n,httpsOrigin:a,debugInfo:s})),await e.refresh,delete e.refresh;}catch(c){throw Ae(r),c&&c.status!==401?c:new F("Unauthorized","Login before querying the Customer Account API.")}}function co(){let e=Ea();return po(e)}async function uo(e){let t=await crypto.subtle.digest({name:"SHA-256"},new TextEncoder().encode(e)),r=ba(t);return po(r)}function Ea(){let e=new Uint8Array(32);return crypto.getRandomValues(e),String.fromCharCode.apply(null,Array.from(e))}function po(e){return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function ba(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 yo(e,t,r,o,n){let a=t;if(!e)throw new F("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",so),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":he,Origin:o};new Date().getTime();let u=r,d=await fetch(u,{method:"POST",headers:c,body:s});let f=await d.json();if(f.error)throw new F(f.error_description);return f.access_token}function fo(e){return wa(e).payload.nonce}function wa(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 at(){return xa(Oa())}function Oa(){try{return crypto.getRandomValues(new Uint8Array(16))}catch{return new Uint8Array(16).map(()=>Math.random()*255|0)}}function xa(e){return Array.from(e,function(t){return ("0"+(t&255).toString(16)).slice(-2)}).join("")}function st(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(go(e,a))return a;console.warn(`Cross-domain redirects are not supported. Tried to redirect from ${o} to ${a}`);}}function go(e,t){try{return new URL(e).origin===new URL(t,e).origin}catch{return false}}function Jt({requestUrl:e,defaultUrl:t,redirectUrl:r}){let o=e,n=mo(e,t),a=r?mo(e,r):n;return go(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 mo(e,t){return Da(t)?new URL(t):new URL(t,new URL(e).origin)}function Da(e){try{return new URL(e),!0}catch{return false}}function ho(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 _a(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 Ue(n)}function Xt({session:e,customerAccountId:t,shopId:r,customerApiVersion:o=nt,request:n,waitUntil:a,authUrl:s,customAuthStatusHandler:c,logErrors:i=true,loginPath:u="/account/login",authorizePath:d="/account/authorize",defaultRedirectPath:f="/account",language:g}){if(o!==nt&&console.warn(`[h2:warn:createCustomerAccountClient] You are using Customer Account API version ${o} when this version of Hydrogen was built for ${nt}.`),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 y=c||(()=>_a(n,u)),p=new URL(n.url),l=p.protocol==="http:"?p.origin.replace("http","https"):p.origin,I=Jt({requestUrl:l,defaultUrl:d,redirectUrl:s}),m=ho(o,r),C=Ua(m,t),S=m("GRAPHQL"),v={};async function h({query:T,type:E,variables:x={}}){let D=await _();if(!D)throw y();new Date().getTime();let H=await fetch(S,{method:"POST",headers:{"Content-Type":"application/json","User-Agent":he,Origin:l,Authorization:D},body:JSON.stringify({query:T,variables:x})});let j=await H.text(),G={url:S,response:H,type:E,query:T,queryVariables:x,errors:void 0,client:"customer"};if(!H.ok){if(H.status===401)throw Ae(e),y();let U;try{U=z(j);}catch{U=[{message:j}];}De({...G,errors:U});}try{let U=z(j),{errors:K}=U,Se=K?.map(({message:de,...L})=>new ue(de,{...L,clientOperation:`customerAccount.${G.type}`,requestId:H.headers.get("x-request-id"),queryVariables:x,query:T}));return {...U,...K&&{errors:Se}}}catch{De({...G,errors:[{message:j}]});}}async function P(){if(!r)return false;let T=e.get(k),E=T?.accessToken,x=T?.expiresAt;if(!E||!x)return false;let D=W?.();try{await io({locks:v,expiresAt:x,session:e,customerAccountId:t,customerAccountTokenExchangeUrl:m("TOKEN_EXCHANGE"),httpsOrigin:l,debugInfo:{waitUntil:a,stackInfo:D,...oe(n)}});}catch{return false}return true}async function A(){if(!await P())throw y()}async function _(){if(await P())return e.get(k)?.accessToken}async function V(T,E){return C(),T=ge(T),tt(T,"customer.mutate"),fe(h({query:T,type:"mutation",...E}),{logErrors:i})}async function se(T,E){return C(),T=ge(T),et(T,"customer.query"),fe(h({query:T,type:"query",...E}),{logErrors:i})}function Ne(T){e.set(Ce,{...e.get(Ce),...T});}async function Ve(){let T=await _();if(T)return {...e.get(Ce),customerAccessToken:T}}return {login:async T=>{C();let E=new URL(m("AUTH")),x=lo(),D=at();E.searchParams.set("client_id",t),E.searchParams.set("scope","openid email"),E.searchParams.append("response_type","code"),E.searchParams.append("redirect_uri",I),E.searchParams.set("scope",m("LOGIN_SCOPE")),E.searchParams.append("state",x),E.searchParams.append("nonce",D);let M=La({contextLanguage:g??null,uiLocalesOverride:T?.uiLocales??null});M!=null&&E.searchParams.append("ui_locales",M);let q=co(),H=await uo(q);return e.set(k,{...e.get(k),codeVerifier:q,state:x,nonce:D,redirectPath:st(n.url)||Q(n,"Referer")||f}),E.searchParams.append("code_challenge",H),E.searchParams.append("code_challenge_method","S256"),Ue(E.toString())},logout:async T=>{C();let E=e.get(k)?.idToken,x=Jt({requestUrl:l,defaultUrl:l,redirectUrl:T?.postLogoutRedirectUri}),D=E?new URL(`${m("LOGOUT")}?${new URLSearchParams([["id_token_hint",E],["post_logout_redirect_uri",x]]).toString()}`).toString():x;Ae(e);let M=T?.headers instanceof Headers?T?.headers:new Headers(T?.headers);return T?.keepSession||(e.destroy?M.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),Ue(D,{headers:M})},isLoggedIn:P,handleAuthStatus:A,getAccessToken:_,getApiUrl:()=>S,mutate:V,query:se,authorize:async()=>{C();let T=p.searchParams.get("code"),E=p.searchParams.get("state");if(!T||!E)throw Ae(e),new F("Unauthorized","No code or state parameter found in the redirect URL.");if(e.get(k)?.state!==E)throw Ae(e),new F("Unauthorized","The session state does not match the state parameter. Make sure that the session is configured correctly and passed to `createCustomerAccountClient`.");let x=t,D=new URLSearchParams;D.append("grant_type","authorization_code"),D.append("client_id",x),D.append("redirect_uri",I),D.append("code",T);let M=e.get(k)?.codeVerifier;if(!M)throw new F("Unauthorized","No code verifier found in the session. Make sure that the session is configured correctly and passed to `createCustomerAccountClient`.");D.append("code_verifier",M);let q={"content-type":"application/x-www-form-urlencoded","User-Agent":he,Origin:l};new Date().getTime();let G=m("TOKEN_EXCHANGE"),U=await fetch(G,{method:"POST",headers:q,body:D});if(!U.ok)throw new Response(await U.text(),{status:U.status,headers:{"Content-Type":"text/html; charset=utf-8"}});let{access_token:K,expires_in:Se,id_token:de,refresh_token:L}=await U.json(),ee=e.get(k)?.nonce,pt=await fo(de);if(ee!==pt)throw new F("Unauthorized",`Returned nonce does not match: ${ee} !== ${pt}`);let pr=K;r||(pr=await yo(K,t,m("TOKEN_EXCHANGE"),l,{...oe(n)}));let $o=e.get(k)?.redirectPath;return e.set(k,{accessToken:pr,expiresAt:new Date(new Date().getTime()+(Se-120)*1e3).getTime()+"",refreshToken:L,idToken:de}),Ue($o||f)},setBuyer:Ne,getBuyer:Ve,UNSTABLE_setBuyer:T=>{B("[h2:warn:customerAccount] `customerAccount.UNSTABLE_setBuyer` is deprecated. Please use `customerAccount.setBuyer`."),Ne(T);},UNSTABLE_getBuyer:()=>(B("[h2:warn:customerAccount] `customerAccount.UNSTABLE_getBuyer` is deprecated. Please use `customerAccount.getBuyer`."),Ve())}}function Ua(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 La(e){let t=Co(e.contextLanguage??null);return Co(e.uiLocalesOverride)??t??null}function Co(e){if(e==null)return null;let o=Na(e).toLowerCase().replaceAll("_","-").split("-"),n=o.at(0)??null,a=o.at(1)??null;return a?`${n}-${a.toUpperCase()}`:n}var ka={PT:"PT_PT",ZH:"ZH_CN"};function Na(e){return ka[e]??e}function Va(e){let{env:t,request:r,cache:o,waitUntil:n,i18n:a,session:s,logErrors:c,storefront:i={},customerAccount:u,cart:d={},buyerIdentity:f}=e;s||console.warn("[h2:warn:createHydrogenContext] A session object is required to create hydrogen context."),u?.unstableB2b&&B("[h2:warn:createHydrogenContext] `customerAccount.unstableB2b` is now stable. Please remove the `unstableB2b` option.");let{storefront:g}=eo({cache:o,waitUntil:n,i18n:a,logErrors:c,storefrontHeaders:i.headers||Ma(r),storefrontApiVersion:i.apiVersion,storefrontId:t.PUBLIC_STOREFRONT_ID,storeDomain:t.PUBLIC_STORE_DOMAIN,privateStorefrontToken:t.PRIVATE_STOREFRONT_API_TOKEN,publicStorefrontToken:t.PUBLIC_STOREFRONT_API_TOKEN}),y=Xt({session:s,request:r,waitUntil:n,logErrors:c,customerApiVersion:u?.apiVersion,authUrl:u?.authUrl,customAuthStatusHandler:u?.customAuthStatusHandler,language:a?.language,customerAccountId:t.PUBLIC_CUSTOMER_ACCOUNT_API_CLIENT_ID,shopId:t.SHOP_ID}),p=zt({getCartId:d.getId||kt(r.headers),setCartId:d.setId||Nt(),cartQueryFragment:d.queryFragment,cartMutateFragment:d.mutateFragment,customMethods:d.customMethods,buyerIdentity:f,storefront:g,customerAccount:y});return {storefront:g,customerAccount:y,cart:p,env:t,waitUntil:n,session:s}}function Ma(e){return {requestGroupId:Q(e,"request-id"),buyerIp:Q(e,"oxygen-buyer-ip"),buyerIpSig:Q(e,"X-Shopify-Client-IP-Sig"),cookie:Q(e,"cookie"),purpose:Q(e,"sec-purpose")||Q(e,"purpose")}}function $a({build:e,mode:t,poweredByHeader:r=true,getLoadContext:o,collectTrackingInformation:n=true,proxyStandardRoutes:a=true}){let s=serverRuntime.createRequestHandler(e,t),c=r?i=>i.headers.append("powered-by","Shopify, Hydrogen"):void 0;return async i=>{let u=i.method;if((u==="GET"||u==="HEAD")&&i.body)return new Response(`${u} requests cannot have a body`,{status:400});let d=new URL(i.url);if(d.pathname.includes("//"))return new Response(null,{status:301,headers:{location:d.pathname.replace(/\/+/g,"/")}});let f=o?await o(i):void 0,g=f?.storefront;if(a&&(g||B("[h2:createRequestHandler] Storefront instance is required to proxy standard routes."),g?.isStorefrontApiUrl(i))){let p=await g.forward(i);return c?.(p),p}let y=await s(i,f);if(g&&a){n&&g.setCollectedSubrequestHeaders(y);let p=i.headers.get("sec-fetch-dest");(p&&p==="document"||i.headers.get("accept")?.includes("text/html"))&&Pe(y,{[$e]:"1"});}return c?.(y),y}}var Ao=react.createContext(void 0),Qa=Ao.Provider,Zt=()=>react.useContext(Ao);function Wa(e){let t=at(),r=ja(t,e);return {nonce:t,header:r,NonceProvider:({children:n})=>react.createElement(Qa,{value:t},n)}}function ja(e,t){let{shop:r,...o}=t??{},n=`'nonce-${e}'`,a=["'self'","'unsafe-inline'","https://cdn.shopify.com"],s=["'self'","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 f=o[d];d&&f&&(u[d]=Ka(f,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]),Ba__default.default({directives:u})}function Ka(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 Ja=react.forwardRef((e,t)=>{let{waitForHydration:r,src:o,...n}=e,a=Zt();return r?jsxRuntime.jsx(Xa,{src:o,options:n}):jsxRuntime.jsx("script",{suppressHydrationWarning:true,...n,src:o,nonce:a,ref:t})});function Xa({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 rs(e){let t=react$1.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 os({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 cs({connection:e,children:t=()=>(console.warn("<Pagination> requires children to work properly"),null),namespace:r=""}){let [o,n]=react.useState(false),a=react$1.useNavigation(),s=react$1.useLocation();react$1.useNavigate();react.useEffect(()=>{a.state==="idle"&&n(false);},[a.state]);let{endCursor:i,hasNextPage:u,hasPreviousPage:d,nextPageUrl:f,nodes:g,previousPageUrl:y,startCursor:p}=us(e,r),l=react.useMemo(()=>({...s.state,pagination:{...s.state?.pagination||{},[r]:{pageInfo:{endCursor:i,hasPreviousPage:d,hasNextPage:u,startCursor:p},nodes:g}}}),[i,u,d,p,g,r,s.state]),I=react.useMemo(()=>react.forwardRef(function(S,v){return u?react.createElement(react$1.Link,{preventScrollReset:true,...S,to:f,state:l,replace:true,ref:v,onClick:()=>n(true)}):null}),[u,f,l]),m=react.useMemo(()=>react.forwardRef(function(S,v){return d?react.createElement(react$1.Link,{preventScrollReset:true,...S,to:y,state:l,replace:true,ref:v,onClick:()=>n(true)}):null}),[d,y,l]);return t({state:l,hasNextPage:u,hasPreviousPage:d,isLoading:o,nextPageUrl:f,nodes:g,previousPageUrl:y,NextLink:I,PreviousLink:m})}function ct(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 Le(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 us(e,t=""){e.pageInfo||Le("pageInfo"),typeof e.pageInfo.startCursor>"u"&&Le("pageInfo.startCursor"),typeof e.pageInfo.endCursor>"u"&&Le("pageInfo.endCursor"),typeof e.pageInfo.hasNextPage>"u"&&Le("pageInfo.hasNextPage"),typeof e.pageInfo.hasPreviousPage>"u"&&Le("pageInfo.hasPreviousPage");let r=react$1.useNavigation(),o=react$1.useNavigate(),{state:n,search:a,pathname:s}=react$1.useLocation(),c=t?`${t}_cursor`:"cursor",i=t?`${t}_direction`:"direction",f=new URLSearchParams(a).get(i)==="previous",g=react.useMemo(()=>!globalThis?.window?.__hydrogenHydrated||!n?.pagination?.[t]?.nodes?hydrogenReact.flattenConnection(e):f?[...hydrogenReact.flattenConnection(e),...n.pagination[t].nodes||[]]:[...n.pagination[t].nodes||[],...hydrogenReact.flattenConnection(e)],[n,e,t]),y=react.useMemo(()=>{let m=globalThis?.window?.__hydrogenHydrated,C=n?.pagination?.[t]?.pageInfo,S=!m||C?.startCursor===void 0?e.pageInfo.startCursor:C.startCursor,v=!m||C?.endCursor===void 0?e.pageInfo.endCursor:C.endCursor,h=!m||C?.hasPreviousPage===void 0?e.pageInfo.hasPreviousPage:C.hasPreviousPage,P=!m||C?.hasNextPage===void 0?e.pageInfo.hasNextPage:C.hasNextPage;return n?.pagination?.[t]?.nodes&&(f?(S=e.pageInfo.startCursor,h=e.pageInfo.hasPreviousPage):(v=e.pageInfo.endCursor,P=e.pageInfo.hasNextPage)),{startCursor:S,endCursor:v,hasPreviousPage:h,hasNextPage:P}},[f,n,t,e.pageInfo.hasNextPage,e.pageInfo.hasPreviousPage,e.pageInfo.startCursor,e.pageInfo.endCursor]),p=react.useRef({params:ct(a,n),pathname:s});react.useEffect(()=>{window.__hydrogenHydrated=true;},[]),react.useEffect(()=>{let m=ct(a,n),C=p.current.params;(s!==p.current.pathname||m!==C)&&!(r.state==="idle"&&!r.location)&&(p.current={pathname:s,params:ct(a,n)},o(`${s}?${ct(a,n)}`,{replace:true,preventScrollReset:true,state:{nodes:void 0,pageInfo:void 0}}));},[s,a,n]);let l=react.useMemo(()=>{let m=new URLSearchParams(a);return m.set(i,"previous"),y.startCursor&&m.set(c,y.startCursor),`?${m.toString()}`},[a,y.startCursor]),I=react.useMemo(()=>{let m=new URLSearchParams(a);return m.set(i,"next"),y.endCursor&&m.set(c,y.endCursor),`?${m.toString()}`},[a,y.endCursor]);return {...y,previousPageUrl:l,nextPageUrl:I,nodes:g}}function ps(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 fs(e,t){let r=react$1.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 Ss({handle:e,options:t=[],variants:r=[],productPath:o="products",waitForNavigation:n=false,selectedVariant:a,children:s}){let c=t;c[0]?.values&&(B("[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:f}=Ts(e,o,n),g=c.filter(p=>p?.optionValues?.length===1),y=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,I=[];for(let m of p.optionValues){let C=new URLSearchParams(f?u:void 0);C.set(p.name,m.name),g.forEach(A=>{A.optionValues[0].name&&C.set(A.name,A.optionValues[0].name);});let S=i.find(A=>A?.selectedOptions?.every(_=>(C.get(_?.name)||y?.[_?.name])===_?.value)),v=u.get(p.name);!v&&a&&(v=y?.[p.name]||null);let h=v?v===m.name:false;h&&(l=m.name);let P="?"+C.toString();I.push({value:m.name,optionValue:m,isAvailable:S?S.availableForSale:true,to:d+P,search:P,isActive:h,variant:S});}return s({option:{name:p.name,value:l,values:I}})}),[c,i,s]))}var Ps=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 Ts(e,t,r){let{pathname:o,search:n}=react$1.useLocation(),a=react$1.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])}var Rs=function(e){return jsxRuntime.jsx(hydrogenReact.RichText,{...e,components:{link:({node:t})=>jsxRuntime.jsx(react$1.Link,{to:t.url,title:t.title,target:t.target,prefetch:"intent",children:t.children}),...e.components}})};var Es=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 c="https://avatars.githubusercontent.com/u/12972006?s=48&v=4",i=String.raw;return new Response(i`
|
|
479
479
|
<!DOCTYPE html>
|
|
480
480
|
<html lang="en">
|
|
481
481
|
<head>
|
|
@@ -741,7 +741,7 @@ API response error: ${t.status}`,u=new ie(i,{query:n,queryVariables:a,cause:{err
|
|
|
741
741
|
</script>
|
|
742
742
|
</body>
|
|
743
743
|
</html>
|
|
744
|
-
`,{status:200,headers:{"content-type":"text/html"}})};async function
|
|
744
|
+
`,{status:200,headers:{"content-type":"text/html"}})};async function bs(e){let{storefront:t,request:r,noAdminRedirect:o,matchQueryParams:n,response:a=new Response("Not Found",{status:404})}=e,s=new URL(r.url),{pathname:c,searchParams:i}=s,u=i.has("_data");i.delete("redirect"),i.delete("return_to"),i.delete("_data");let d=(n?s.toString().replace(s.origin,""):c).toLowerCase();if(s.pathname==="/admin"&&!o)return ar(`${t.getShopifyDomain()}/admin`,u,i,n);try{let{urlRedirects:f}=await t.query(ws,{variables:{query:"path:"+d.replace(/\/+$/,"")}}),g=f?.edges?.[0]?.node?.target;if(g)return ar(g,u,i,n);let y=st(r.url);if(y)return ar(y,u,i,n)}catch(f){console.error(`Failed to fetch redirects from Storefront API for route ${d}`,f);}return a}var nr="https://example.com";function ar(e,t,r,o){let n=new URL(e,nr);if(!o)for(let[a,s]of r)n.searchParams.append(a,s);return t?new Response(null,{status:200,headers:{"X-Remix-Redirect":n.toString().replace(nr,""),"X-Remix-Status":"301"}}):new Response(null,{status:301,headers:{location:n.toString().replace(nr,"")}})}var ws=`#graphql
|
|
745
745
|
query redirects($query: String) {
|
|
746
746
|
urlRedirects(first: 1, query: $query) {
|
|
747
747
|
edges {
|
|
@@ -751,24 +751,24 @@ API response error: ${t.status}`,u=new ie(i,{query:n,queryVariables:a,cause:{err
|
|
|
751
751
|
}
|
|
752
752
|
}
|
|
753
753
|
}
|
|
754
|
-
`;var
|
|
754
|
+
`;var Os={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},xs=/[&><\u2028\u2029]/g;function Do(e){return e.replace(xs,t=>Os[t])}var ne="Error in SEO input: ",X={title:{validate:e=>{if(typeof e!="string")throw new Error(ne.concat("`title` should be a string"));if(typeof e=="string"&&e.length>120)throw new Error(ne.concat("`title` should not be longer than 120 characters"));return e}},description:{validate:e=>{if(typeof e!="string")throw new Error(ne.concat("`description` should be a string"));if(typeof e=="string"&&e.length>155)throw new Error(ne.concat("`description` should not be longer than 155 characters"));return e}},url:{validate:e=>{if(typeof e!="string")throw new Error(ne.concat("`url` should be a string"));if(typeof e=="string"&&!e.startsWith("http"))throw new Error(ne.concat("`url` should be a valid URL"));return e}},handle:{validate:e=>{if(typeof e!="string")throw new Error(ne.concat("`handle` should be a string"));if(typeof e=="string"&&!e.startsWith("@"))throw new Error(ne.concat("`handle` should start with `@`"));return e}}};function _o(e){let t=[];for(let r of Object.keys(e))switch(r){case "title":{let o=Z(X.title,e.title),n=ir(e?.titleTemplate,o);if(!n)break;t.push(N("title",{title:n}),N("meta",{property:"og:title",content:n}),N("meta",{name:"twitter:title",content:n}));break}case "description":{let o=Z(X.description,e.description);if(!o)break;t.push(N("meta",{name:"description",content:o}),N("meta",{property:"og:description",content:o}),N("meta",{name:"twitter:description",content:o}));break}case "url":{let o=Z(X.url,e.url);if(!o)break;let a=o.split("?")[0].replace(/\/$/,"");t.push(N("link",{rel:"canonical",href:a}),N("meta",{property:"og:url",content:a}));break}case "handle":{let o=Z(X.handle,e.handle);if(!o)break;t.push(N("meta",{name:"twitter:site",content:o}),N("meta",{name:"twitter:creator",content:o}));break}case "media":{let o,n=ae(e.media);for(let a of n)if(typeof a=="string"&&t.push(N("meta",{name:"og:image",content:a})),a&&typeof a=="object"){let s=a.type||"image",c=a?{url:a?.url,secure_url:a?.url,type:cr(a.url),width:a?.width,height:a?.height,alt:a?.altText}:{};for(let i of Object.keys(c))c[i]&&(o=c[i],t.push(N("meta",{property:`og:${s}:${i}`,content:o},c.url)));}break}case "jsonLd":{let o=ae(e.jsonLd),n=0;for(let a of o){if(typeof a!="object")continue;let s=N("script",{type:"application/ld+json",children:JSON.stringify(a,(c,i)=>typeof i=="string"?Do(i):i)},`json-ld-${a?.["@type"]||a?.name||n++}`);t.push(s);}break}case "alternates":{let o=ae(e.alternates);for(let n of o){if(!n)continue;let{language:a,url:s,default:c}=n,i=a?`${a}${c?"-default":""}`:void 0;t.push(N("link",{rel:"alternate",hrefLang:i,href:s}));}break}case "robots":{if(!e.robots)break;let{maxImagePreview:o,maxSnippet:n,maxVideoPreview:a,noArchive:s,noFollow:c,noImageIndex:i,noIndex:u,noSnippet:d,noTranslate:f,unavailableAfter:g}=e.robots,y=[s&&"noarchive",i&&"noimageindex",d&&"nosnippet",f&&"notranslate",o&&`max-image-preview:${o}`,n&&`max-snippet:${n}`,a&&`max-video-preview:${a}`,g&&`unavailable_after:${g}`],p=(u?"noindex":"index")+","+(c?"nofollow":"follow");for(let l of y)l&&(p+=`,${l}`);t.push(N("meta",{name:"robots",content:p}));break}}return t.flat().sort((r,o)=>r.key.localeCompare(o.key))}function N(e,t,r){let o={tag:e,props:{},key:""};return e==="title"?(o.children=t.title,o.key=sr(o),o):e==="script"?(o.children=typeof t.children=="string"?t.children:"",o.key=sr(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=sr(o,r),o)}function sr(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 ir(e,t){if(t)return e?typeof e=="function"?e(t):e.replace("%s",t??""):t}function cr(e){switch(e&&e.split(".").pop()){case "svg":return "image/svg+xml";case "png":return "image/png";case "gif":return "image/gif";case "swf":return "application/x-shockwave-flash";case "mp3":return "audio/mpeg";case "jpg":case "jpeg":default:return "image/jpeg"}}function ae(e){return Array.isArray(e)?e:[e]}function Z(e,t){try{return e.validate(t)}catch(r){return console.warn(r.message),t}}function Ds(...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:ae(o.jsonLd).concat(a)}:{...o,...n,jsonLd:[a]}:{...o,...n}},{})||{};for(let o of Object.keys(r))switch(o){case "title":{let n=Z(X.title,r.title),a=ir(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=Z(X.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=Z(X.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=Z(X.handle,r.handle);if(!n)break;t.push({property:"twitter:site",content:n},{property:"twitter:creator",content:n});break}case "media":{let n,a=ae(r.media);for(let s of a)if(typeof s=="string"&&t.push({property:"og:image",content:s}),s&&typeof s=="object"){let c=s.type||"image",i=s?{url:s?.url,secure_url:s?.url,type:cr(s.url),width:s?.width,height:s?.height,alt:s?.altText}:{};for(let u of Object.keys(i))i[u]&&(n=i[u],t.push({property:`og:${c}:${u}`,content:n}));}break}case "jsonLd":{let n=ae(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=ae(r.alternates);for(let a of n){if(!a)continue;let{language:s,url:c,default:i}=a,u=s?`${s}${i?"-default":""}`:void 0;t.push({tagName:"link",rel:"alternate",hrefLang:u,href:c});}break}case "robots":{if(!r.robots)break;let{maxImagePreview:n,maxSnippet:a,maxVideoPreview:s,noArchive:c,noFollow:i,noImageIndex:u,noIndex:d,noSnippet:f,noTranslate:g,unavailableAfter:y}=r.robots,p=[c&&"noarchive",u&&"noimageindex",f&&"nosnippet",g&&"notranslate",n&&`max-image-preview:${n}`,a&&`max-snippet:${a}`,s&&`max-video-preview:${s}`,y&&`unavailable_after:${y}`],l=(d?"noindex":"index")+","+(i?"nofollow":"follow");for(let I of p)I&&(l+=`,${I}`);t.push({name:"robots",content:l});break}}return t}var $s=react.lazy(()=>Promise.resolve().then(()=>(No(),ko)));function Fs({debug:e}){let t=react$1.useMatches(),r=react$1.useLocation();console.warn("[h2:warn:Seo] The `<Seo/>` component is deprecated. Use `getSeoMeta` instead.\nSee: https://shopify.dev/docs/api/hydrogen/2025-04/utilities/getseometa");let o=react.useMemo(()=>t.flatMap(s=>{let{handle:c,...i}=s,u={...i,...r},d=c?.seo,f=i?.data?.seo;return !d&&!f?[]:d?ut(d,u):[f]}).reduce((s,c)=>{Object.keys(c).forEach(u=>!c[u]&&delete c[u]);let{jsonLd:i}=c;return i?s?.jsonLd?Array.isArray(i)?{...s,...c,jsonLd:[...s.jsonLd,...i]}:{...s,...c,jsonLd:[...s.jsonLd,i]}:{...s,...c,jsonLd:[i]}:{...s,...c}},{}),[t,r]),{html:n,loggerMarkup:a}=react.useMemo(()=>{let s=_o(o),c=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)),i=react.createElement(react.Suspense,{fallback:null},react.createElement($s,{headTags:s}));return {html:c,loggerMarkup:i}},[o]);return react.createElement(react.Fragment,null,n,e&&a)}function ut(e,...t){if(e instanceof Function)return ut(e(...t),...t);let r={};return Array.isArray(e)?(r=e.reduce((o,n)=>[...o,ut(n)],[]),r):e instanceof Object?(Object.entries(e).forEach(([n,a])=>{r[n]=ut(a,...t);}),r):e}function Gs(e){return jsxRuntime.jsx(hydrogenReact.ShopPayButton,{channel:"hydrogen",...e})}var Qs=`<?xml version="1.0" encoding="UTF-8"?>
|
|
755
755
|
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
756
|
-
`,
|
|
757
|
-
</sitemapindex>`,
|
|
758
|
-
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">`,
|
|
756
|
+
`,Ws=`
|
|
757
|
+
</sitemapindex>`,Mo=`<?xml version="1.0" encoding="UTF-8"?>
|
|
758
|
+
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">`,Ho="</urlset>";async function js(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(ni);if(!a)throw console.warn("[h2:sitemap:warning] Sitemap index is available in API version 2024-10 and later"),new Response("Sitemap index not found.",{status:404});let s=new URL(r.url).origin,c=Qs+o.map(i=>{if(!a[i])throw new Error(`[h2:sitemap:error] No data found for type ${i}. Check types passed to \`getSitemapIndex\``);return Ys(i,a[i].pagesCount.count,s)}).join(`
|
|
759
759
|
`)+n.map(i=>" <sitemap><loc>"+(s+(i.startsWith("/")?i:"/"+i))+"</loc></sitemap>").join(`
|
|
760
|
-
`)+
|
|
761
|
-
`)+
|
|
762
|
-
<url><loc>${
|
|
763
|
-
`+
|
|
764
|
-
`;return o}function
|
|
760
|
+
`)+Ws;return new Response(c,{headers:{"Content-Type":"application/xml","Cache-Control":`max-age=${60*60*24}`}})}async function Ks(e){let{storefront:t,request:r,params:o,getLink:n,locales:a=[],getChangeFreq:s,noItemsFallback:c="/"}=e;if(!o)throw new Error("[h2:sitemap:error] Remix params object is required to generate a sitemap");if(!r||!r.url)throw new Error("A request object is required to generate a sitemap");if(!t||!t.query)throw new Error("A storefront client is required to generate a index");if(!n)throw new Error("A `getLink` function to generate each resource is required to build a sitemap");if(!o.type||!o.page)throw new Response("No data found",{status:404});let i=o.type,u=ai[i];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 f=new URL(r.url).origin,g="";return d?.sitemap?.resources?.items?.length?g=Mo+d.sitemap.resources.items.map(y=>zs({getChangeFreq:s,url:n({type:y.type??i,baseUrl:f,handle:y.handle}),type:i,getLink:n,updatedAt:y.updatedAt,handle:y.handle,metaobjectType:y.type,locales:a,baseUrl:f})).join(`
|
|
761
|
+
`)+Ho:g=Mo+`
|
|
762
|
+
<url><loc>${f+c}</loc></url>
|
|
763
|
+
`+Ho,new Response(g,{headers:{"Content-Type":"application/xml","Cache-Control":`max-age=${60*60*24}`}})}function Ys(e,t,r){let o="";for(let n=1;n<=t;n++)o+=` <sitemap><loc>${r}/sitemap/${e}/${n}.xml</loc></sitemap>
|
|
764
|
+
`;return o}function zs({url:e,updatedAt:t,locales:r,type:o,getLink:n,baseUrl:a,handle:s,getChangeFreq:c,metaobjectType:i}){return `<url>
|
|
765
765
|
<loc>${e}</loc>
|
|
766
766
|
<lastmod>${t}</lastmod>
|
|
767
767
|
<changefreq>${c?c({type:i??o,handle:s}):"weekly"}</changefreq>
|
|
768
|
-
${r.map(u=>
|
|
768
|
+
${r.map(u=>Js(n({type:i??o,baseUrl:a,handle:s,locale:u}),u)).join(`
|
|
769
769
|
`)}
|
|
770
770
|
</url>
|
|
771
|
-
`.trim()}function
|
|
771
|
+
`.trim()}function Js(e,t){return ` <xhtml:link rel="alternate" hreflang="${t}" href="${e}" />`}var Xs=`#graphql
|
|
772
772
|
query SitemapProducts($page: Int!) {
|
|
773
773
|
sitemap(type: PRODUCT) {
|
|
774
774
|
resources(page: $page) {
|
|
@@ -779,7 +779,7 @@ ${r.map(u=>_s(n({type:i??o,baseUrl:a,handle:s,locale:u}),u)).join(`
|
|
|
779
779
|
}
|
|
780
780
|
}
|
|
781
781
|
}
|
|
782
|
-
`,
|
|
782
|
+
`,Zs=`#graphql
|
|
783
783
|
query SitemapCollections($page: Int!) {
|
|
784
784
|
sitemap(type: COLLECTION) {
|
|
785
785
|
resources(page: $page) {
|
|
@@ -790,7 +790,7 @@ ${r.map(u=>_s(n({type:i??o,baseUrl:a,handle:s,locale:u}),u)).join(`
|
|
|
790
790
|
}
|
|
791
791
|
}
|
|
792
792
|
}
|
|
793
|
-
`,
|
|
793
|
+
`,ei=`#graphql
|
|
794
794
|
query SitemapArticles($page: Int!) {
|
|
795
795
|
sitemap(type: ARTICLE) {
|
|
796
796
|
resources(page: $page) {
|
|
@@ -801,7 +801,7 @@ ${r.map(u=>_s(n({type:i??o,baseUrl:a,handle:s,locale:u}),u)).join(`
|
|
|
801
801
|
}
|
|
802
802
|
}
|
|
803
803
|
}
|
|
804
|
-
`,
|
|
804
|
+
`,ti=`#graphql
|
|
805
805
|
query SitemapPages($page: Int!) {
|
|
806
806
|
sitemap(type: PAGE) {
|
|
807
807
|
resources(page: $page) {
|
|
@@ -812,7 +812,7 @@ ${r.map(u=>_s(n({type:i??o,baseUrl:a,handle:s,locale:u}),u)).join(`
|
|
|
812
812
|
}
|
|
813
813
|
}
|
|
814
814
|
}
|
|
815
|
-
`,
|
|
815
|
+
`,ri=`#graphql
|
|
816
816
|
query SitemapBlogs($page: Int!) {
|
|
817
817
|
sitemap(type: BLOG) {
|
|
818
818
|
resources(page: $page) {
|
|
@@ -823,7 +823,7 @@ ${r.map(u=>_s(n({type:i??o,baseUrl:a,handle:s,locale:u}),u)).join(`
|
|
|
823
823
|
}
|
|
824
824
|
}
|
|
825
825
|
}
|
|
826
|
-
`,
|
|
826
|
+
`,oi=`#graphql
|
|
827
827
|
query SitemapMetaobjects($page: Int!) {
|
|
828
828
|
sitemap(type: METAOBJECT) {
|
|
829
829
|
resources(page: $page) {
|
|
@@ -837,7 +837,7 @@ ${r.map(u=>_s(n({type:i??o,baseUrl:a,handle:s,locale:u}),u)).join(`
|
|
|
837
837
|
}
|
|
838
838
|
}
|
|
839
839
|
}
|
|
840
|
-
|
|
840
|
+
`,ni=`#graphql
|
|
841
841
|
query SitemapIndex {
|
|
842
842
|
products: sitemap(type: PRODUCT) {
|
|
843
843
|
pagesCount {
|
|
@@ -870,7 +870,7 @@ query SitemapIndex {
|
|
|
870
870
|
}
|
|
871
871
|
}
|
|
872
872
|
}
|
|
873
|
-
`,
|
|
873
|
+
`,ai={products:Xs,articles:ei,collections:Zs,pages:ti,blogs:ri,metaObjects:oi};//! @see https://shopify.dev/docs/api/storefront/latest/queries/cart
|
|
874
874
|
//! @see: https://shopify.dev/docs/api/storefront/latest/mutations/cartCreate
|
|
875
875
|
//! @see: https://shopify.dev/docs/api/storefront/latest/mutations/cartLinesAdd
|
|
876
876
|
//! @see: https://shopify.dev/docs/api/storefront/latest/mutations/cartLinesUpdate
|
|
@@ -885,5 +885,5 @@ query SitemapIndex {
|
|
|
885
885
|
//! @see: https://shopify.dev/docs/api/storefront/latest/mutations/cartDeliveryAddressesAdd
|
|
886
886
|
//! @see: https://shopify.dev/docs/api/storefront/latest/mutations/cartDeliveryAddressesRemove
|
|
887
887
|
//! @see: https://shopify.dev/docs/api/storefront/latest/mutations/cartDeliveryAddressesUpdate
|
|
888
|
-
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,"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=
|
|
888
|
+
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=Un;exports.AnalyticsEvent=$;exports.CacheCustom=Dt;exports.CacheLong=xt;exports.CacheNone=wt;exports.CacheShort=ce;exports.CartForm=J;exports.InMemoryCache=Lt;exports.OptimisticInput=os;exports.Pagination=cs;exports.RichText=Rs;exports.Script=Ja;exports.Seo=Fs;exports.ShopPayButton=Gs;exports.VariantSelector=Ss;exports.cartAttributesUpdateDefault=Wt;exports.cartBuyerIdentityUpdateDefault=Gt;exports.cartCreateDefault=Mt;exports.cartDiscountCodesUpdateDefault=qt;exports.cartGetDefault=Vt;exports.cartGetIdDefault=kt;exports.cartGiftCardCodesUpdateDefault=Yt;exports.cartLinesAddDefault=Ht;exports.cartLinesRemoveDefault=Ft;exports.cartLinesUpdateDefault=$t;exports.cartMetafieldDeleteDefault=Kt;exports.cartMetafieldsSetDefault=jt;exports.cartNoteUpdateDefault=Bt;exports.cartSelectedDeliveryOptionsUpdateDefault=Qt;exports.cartSetIdDefault=Nt;exports.changelogHandler=Ia;exports.createCartHandler=zt;exports.createContentSecurityPolicy=Wa;exports.createCustomerAccountClient=Xt;exports.createHydrogenContext=Va;exports.createRequestHandler=$a;exports.createStorefrontClient=eo;exports.createWithCache=Qn;exports.formatAPIResult=R;exports.generateCacheControlHeader=we;exports.getPaginationVariables=ps;exports.getSelectedProductOptions=Ps;exports.getSeoMeta=Ds;exports.getShopAnalytics=Dn;exports.getSitemap=Ks;exports.getSitemapIndex=js;exports.graphiqlLoader=Es;exports.hydrogenRoutes=es;exports.storefrontRedirect=bs;exports.useAnalytics=Y;exports.useCustomerPrivacy=Ct;exports.useNonce=Zt;exports.useOptimisticCart=Ta;exports.useOptimisticData=rs;exports.useOptimisticVariant=fs;//# sourceMappingURL=index.cjs.map
|
|
889
889
|
//# sourceMappingURL=index.cjs.map
|