efficient-storefront-blocks 0.65.0 → 0.66.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +40 -0
- package/README.md +0 -1
- package/dist/chunks/{EditorPreviewCheckout-4KZCYPQT.js → EditorPreviewCheckout-EXU5CRJ2.js} +1 -1
- package/dist/chunks/{SiteEditorProvider-ZYGNRWSB.js → SiteEditorProvider-KOPR3UDU.js} +1 -1
- package/dist/chunks/{chunk-I7BIOONR.js → chunk-S66TL4Z3.js} +1 -1
- package/dist/chunks/{chunk-YAO6XQYA.js → chunk-TAGGXC3A.js} +1 -1
- package/dist/chunks/{chunk-GR7OHU32.js → chunk-VWO54PMT.js} +1 -1
- package/dist/chunks/{chunk-OU2WWXMT.js → chunk-Z7PJKX2P.js} +1 -1
- package/dist/chunks/{fitment-data-IKFCBT6E.js → fitment-data-UQDOQP66.js} +1 -1
- package/dist/consent.js +1 -1
- package/dist/editor/components/CollectionPicker.js +1 -1
- package/dist/editor/components/EditProductLink.js +1 -1
- package/dist/editor/components/FormPicker.js +1 -1
- package/dist/editor/components/GalleryProductBinding.d.ts +1 -1
- package/dist/editor/components/GalleryProductBinding.js +1 -1
- package/dist/editor/components/GalleryShowcaseSource.d.ts +1 -1
- package/dist/editor/components/GalleryShowcaseSource.js +1 -1
- package/dist/editor/components/HeaderSettingsPanel.js +1 -1
- package/dist/editor/components/MenuLinkRangeField.js +1 -1
- package/dist/editor/components/PerViewStepperField.js +1 -1
- package/dist/editor/lib/puck/blocks/service/ContactRouting/fields.js +1 -1
- package/dist/editor/lib/puck/config.d.ts +0 -4
- package/dist/editor/lib/puck/config.js +1 -1
- package/dist/editor/lib/storefront-editor-words.d.ts +2 -4
- package/dist/editor/lib/storefront-editor-words.js +1 -1
- package/dist/index.d.ts +0 -17
- package/dist/index.js +43 -43
- package/dist/render/app/globals.css +18 -4
- package/dist/render/built-with.json +1 -1
- package/dist/render/components/ContactRouting.d.ts +11 -1
- package/dist/render/components/ContactRouting.js +1 -1
- package/dist/render/components/GalleryGrid.js +1 -1
- package/dist/render/components/GalleryItem.d.ts +1 -0
- package/dist/render/components/GalleryItem.js +1 -1
- package/dist/render/components/ProductGallery.js +1 -1
- package/dist/render/components/ProductGridSection.js +1 -1
- package/dist/render/components/fitment/FitmentPickerGrid.js +1 -1
- package/dist/render/components/fitment/PickerField.js +1 -1
- package/dist/render/components/pdp-dynamic/DynamicGalleryGrid.js +1 -1
- package/dist/render/lib/api/types.d.ts +1 -0
- package/dist/render/lib/consent/choice.d.ts +0 -2
- package/dist/render/lib/consent/choice.js +1 -1
- package/dist/render/lib/consent/rules.d.ts +0 -1
- package/dist/render/lib/consent/rules.js +1 -1
- package/dist/render/lib/content/source-values.d.ts +4 -0
- package/dist/render/lib/content/source-values.js +1 -0
- package/dist/render/lib/content/stock-words.d.ts +0 -4
- package/dist/render/lib/content/stock-words.js +1 -1
- package/dist/render/lib/puck/blocks/commerce/GalleryItem/render.js +1 -1
- package/dist/render/lib/puck/blocks/text-part-shapes.json +6 -3
- package/dist/render/lib/sections/fill-row.d.ts +8 -0
- package/dist/render/lib/sections/fill-row.js +1 -1
- package/dist/render/lib/sections/grid-no-hole.d.ts +12 -0
- package/dist/render/lib/sections/grid-no-hole.js +1 -0
- package/dist/render/lib/wheels/catalog-filters-to-listing.d.ts +0 -1
- package/dist/render/lib/wheels/catalog-filters-to-listing.js +1 -1
- package/dist/render/lib/wheels/catalog-filters.d.ts +0 -1
- package/dist/render/lib/wheels/catalog-filters.js +1 -1
- package/dist/words.d.ts +3 -4
- package/dist/words.js +2 -2
- package/package.json +1 -1
- /package/dist/chunks/{chunk-B44XQA2J.js → chunk-IHYVLVY3.js} +0 -0
- /package/dist/chunks/{chunk-YAO6XQYA.js.LEGAL.txt → chunk-TAGGXC3A.js.LEGAL.txt} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as dt,i as me,q as ft,s as pt,t as mt,v as B}from"./chunk-OU2WWXMT.js";import{Aa as pe,Ba as ut,Ea as $e,Fa as ct,Ia as Be,Ja as We}from"./chunk-I7BIOONR.js";import{j as lt,l as ie}from"./chunk-B44XQA2J.js";import{createContext as un,useContext as Ct,useEffect as cn,useMemo as he,useState as yt}from"react";function gt(e,t){return e.map(n=>({partNumber:n.partNumber,quantity:n.wheels*t}))}function ae(e,t){if(e.length===0)return null;let n=0;for(let r of e){let o=r.prices?.[t];if(typeof o!="number"||!Number.isFinite(o)||o<=0)return null;n+=o*r.wheels}return n}var Ge=4,wr=1,_r={unit:"set",spares:0,spareSide:"left"};function ht(e){return e.unit==="single"?1:Ge+e.spares}function Nr(e,t){return[{partNumber:e.partNumber,wheels:ht(t),prices:e.prices}]}function Rr(e,t){let n=ht(t)-Ge;if(n<=0||e.length===0)return e;let r=sn(e),o=r?r[t.spareSide]:0;return e.map((i,a)=>a===o?{...i,wheels:i.wheels+n}:i)}function sn(e){let t,n;for(let r=0;r<e.length;r+=1){let o=e[r].hand;if(o!=="left"&&o!=="right")continue;if((o==="left"?t:n)!==void 0)return null;o==="left"?t=r:n=r}return t!==void 0&&n!==void 0?{left:t,right:n}:null}function ln(e,t){return t.spares>0?`${e} + spare`:e}function Lr(e){return e.unit==="single"?"Single":ln(`Set of ${Ge}`,e)}var Ir="data-add-to-basket",qe=9,Re="en";function ge(e,t,n=0){return new Intl.NumberFormat(Re,{style:"currency",currency:t,minimumFractionDigits:0,maximumFractionDigits:n}).format(e)}function Ar(e,t){return new Intl.NumberFormat(Re,{style:"currency",currency:t}).format(e)}import{jsx as mn}from"react/jsx-runtime";var dn="storefront-country",bt=dn,Ke=un(null);function fn(e){return xt(e,"catalogue")}function pn(e){return xt(e,"money")}function xt(e,t){let n=new Map(e.map(o=>[o.code,o.decimalPlaces])),r=new Map;return(o,i)=>{if(!i)return"";let a=r.get(i);if(!a){let s=n.get(i)??0;a=new Intl.NumberFormat(Re,{style:"currency",currency:i,minimumFractionDigits:t==="money"?s:0,maximumFractionDigits:s}),r.set(i,a)}return a.format(o)}}function Dr({children:e,currencies:t,countries:n,defaultCurrency:r,defaultCountry:o}){let i=he(()=>t??[],[t]),a=he(()=>n??[],[n]),s=he(()=>r||i.find(y=>y.isDefault)?.code||i[0]?.code||"",[r,i]),c=he(()=>o||a.find(y=>y.isDefault)?.code||a[0]?.code||"",[o,a]),[u,f]=yt(c),[d,S]=yt(!1);cn(()=>{let y=ie.getItem(bt);y&&a.some(w=>w.code===y)&&f(y),S(!0)},[a]);function N(y){f(y),ie.setItem(bt,y)}let C=he(()=>{let y=a.find(v=>v.code===u)??null,w=y?.currency,O=w&&i.some(v=>v.code===w)?w:s,M=fn(i),I=pn(i);return{country:u,currency:O,setCountry:N,currencies:i,countries:a,activeCountry:y,formatPrice:(v,x)=>M(v,x??O),formatMoney:(v,x)=>I(v,x??O),ready:d}},[u,i,a,s,d]);return mn(Ke.Provider,{value:C,children:e})}function St(){let e=Ct(Ke);if(!e)throw new Error("useCurrency must be used within a CurrencyProvider");return e}function Fr(){return Ct(Ke)?.country??""}import{createContext as Ln,useCallback as L,useContext as In,useEffect as Q,useMemo as Ot,useRef as se,useState as T}from"react";function Et(e,t){return e.valid?!1:e.reason==="firstOrderOnly"?!0:e.reason==="notEligible"&&!t}var Pt="We'll confirm this discount when you place your order.",Br="Confirmed at checkout";function Wr(e){return e&&(e.valid||e.deferred)?e.code:void 0}var vt="coupon_code: ";function Gr(e){return!(e instanceof me)||e.status!==400||!e.message.startsWith(vt)?null:e.message.slice(vt.length)}function wt(e,t){return e.map(n=>({qty:n.qty,slug:n.slug,name:`${n.name.lead}${n.name.accent}`.trim(),finish:n.finishName,size:n.size,kind:n.kind,sku:n.sku,pack:n.pack,priceLabel:t(n)}))}var Le="Price on request",hn="Request a quote",yn="from ",Xr="From ",Yr="each",_t="Free";function ze(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function Xe(e,t){let n=e?.[t];return ze(n)?n:null}function Vr(e,t,n,r){let o=Xe(e,n),i=Xe(t,n);return o===null&&i===null?0:o===null?1:i===null?-1:r==="asc"?o-i:i-o}function jr(e,t,n,r){if(n==null&&r==null)return!0;let o=Xe(e,t);return!(o===null||n!=null&&o<n||r!=null&&o>r)}var bn={priced:!1,unit:null,was:null,onSale:!1,setTotal:null};function Cn(e,t,n){if(!ze(e))return bn;let r=ze(t)&&t>e?t:null;return{priced:!0,unit:e,was:r,onSale:r!==null,setTotal:n!=null?e*n:null}}function Qr(e,t,n=""){return!e.priced||e.unit==null?Le:`${n}${ge(e.unit,t)}`}function Zr(e,t){return e.was==null?null:ge(e.was,t)}function xn(e,t,n=1){let r=ae(e,t);if(r===null)return{priced:!1,unit:null,isFrom:!1,setTotal:null};let o=e.reduce((a,s)=>a+s.wheels,0),i=Math.min(...e.map(a=>a.prices[t]));return{priced:!0,unit:i,isFrom:i*o!==r,setTotal:r*n}}var Sn={priced:!1,unit:null,isFrom:!1,was:null,onSale:!1,setTotal:null};function Jr(e,t,n,r=1){let o=Cn(e.prices[n],e.msrpPrices?.[n],4),i=o.setTotal==null?null:o.setTotal*r;if(!t)return{priced:o.priced,unit:o.unit,isFrom:!0,was:o.was,onSale:o.onSale,setTotal:null,fromSetTotal:i};let a=xn(t.components,n,r);return a.priced?{priced:!0,unit:a.unit,isFrom:a.isFrom,was:null,onSale:!1,setTotal:a.setTotal,fromSetTotal:i}:{...Sn,fromSetTotal:i}}function vn(e,t){return!e.priced||e.unit==null?Le:`${e.isFrom?yn:""}${ge(e.unit,t)}`}function eo(e,t){return e.was==null?null:ge(e.was,t)}function to(e,t){return!e.priced||e.unit==null?hn:vn(e,t)}var En=/^[^@\s]+@[^@\s]+\.[^@\s]+$/;function Nt(e){return En.test(e.trim())}var Rt="sf:ga-purchases",Pn=20;function It(){return typeof window>"u"||window.parent!==window}function ye(...e){try{if(It()||typeof window.gtag!="function")return;window.gtag(...e)}catch{}}function wn(e,t){let n=e.config.find(r=>r.gold)?.label;return{item_id:`${e.slug}|${e.finishName}|${e.size}`,item_name:`${e.name.lead}${e.name.accent}`.trim(),...n?{item_variant:n}:{},price:ae(e.components,t)??0,quantity:e.qty}}function Ye(e,t){return e.filter(Ie).map(n=>wn(n,t))}function so(e){ye("event","view_item",{currency:e.currency,value:e.pricePerSet,items:[{item_id:e.itemId,item_name:e.itemName,...e.variant?{item_variant:e.variant}:{},price:e.pricePerSet,quantity:1}]})}function At(e,t){let n=Ye([e],t);n.length!==0&&ye("event","add_to_cart",{currency:t,value:n[0].price*n[0].quantity,items:n})}function lo(e){let t=Ye(e.lines,e.currency);t.length!==0&&ye("event","begin_checkout",{currency:e.currency,value:e.value,...e.coupon?{coupon:e.coupon}:{},items:t})}var Lt=new Set;function _n(e){if(Lt.has(e))return!1;Lt.add(e);try{let t=JSON.parse(ie.getItem(Rt)??"[]");if(t.includes(e))return!1;ie.setItem(Rt,JSON.stringify([...t,e].slice(-Pn)))}catch{}return!0}function uo(e){let t=e.confirmation;if(It()||!_n(t.orderNumber))return;let n=t.currency,r=Number(t.grandTotal);ye("event","purchase",{transaction_id:t.orderNumber,currency:n,value:r,shipping:Number(t.freightCharge),...t.couponCode?{coupon:t.couponCode}:{},items:Ye(e.lines,n)}),e.adsSendTo&&ye("event","conversion",{send_to:e.adsSendTo,transaction_id:t.orderNumber,currency:n,value:r})}var Nn="Arranged after review",kt="Calculated at checkout",Rn=kt,po=kt;function Tt({quoted:e,optionCount:t,chosenAmount:n,couponWaivesFreight:r}){return e&&t===0?"arranged":r?"free":n===void 0?"pending":n===0?"free":"charged"}function mo(e){switch(e){case"arranged":return Nn;case"pending":return Rn;case"free":return _t;case"charged":return null}}import{jsx as On}from"react/jsx-runtime";var An=400,kn=400,Tn=1500;function Ie(e){return(e.components?.length??0)>0}function Mt(e,t){return{code:e,valid:t.valid,deferred:Et(t,t.askedAsShopper),message:t.message||void 0,effects:t.effects??void 0}}function Ft(e,t){return ae(e.components,t)}function Ve(e,t){let n=Ft(e,t);return n===null?null:n*e.qty}function Dt(e){return e!=="tyre"}var Ut=Ln(null);function _o({children:e,preview:t=!1}){let{currency:n,country:r,formatMoney:o}=St(),[i,a]=T(t),[s,c]=T([]),[u,f]=T([]),[d,S]=T([]),[N,C]=T(!1),[y,w]=T(!1),[O,M]=T(!1),[I,v]=T(!1),[x,W]=T(null),[A,G]=T(void 0),b=se(r),_=se("");b.current=b.current||r;let[p,q]=T(null),[Z,F]=T(!1),[D,ve]=T(null),z=se(void 0),K=L(()=>a(!0),[]),ue=L(()=>a(!1),[]),J=L(()=>a(l=>!l),[]);Q(()=>{t||typeof window>"u"||new URLSearchParams(window.location.search).get("cart")==="open"&&K()},[K,t]);let Ee=L(l=>{v(!0),Dt(l)&&M(!0)},[]),U=O||s.some(l=>Dt(l.kind)),Pe=I||s.length>0;Q(()=>{if(t||!U||N)return;let l=!0;return B.listWheels().then(m=>{l&&(f(m),C(!0))}),()=>{l=!1}},[t,U,N]),Q(()=>{if(t||!Pe||y)return;let l=!0;return B.listBundles().then(m=>{l&&(S(m),w(!0))}),()=>{l=!1}},[t,Pe,y]);let P=x?.deliveryOptions??[];Q(()=>{P.length!==0&&ve(l=>l&&P.some(m=>m.id===l)?l:P[0]?.id??null)},[x]);let ee=L(()=>s.filter(Ie).flatMap(l=>gt(l.components,l.qty)),[s]),te=L(async(l,m)=>{let h=l.trim().toUpperCase();if(!h)return;let g=ee();if(g.length===0){q({code:h,valid:!1,message:"Add a wheel to the cart first."});return}F(!0),z.current=m;try{let R=await B.validateCoupon({code:h,items:g,currency:n,shippingMethodId:D??void 0,customerEmail:m});q(Mt(h,R))}catch{q({code:h,valid:!1,message:"Could not check that code. Please try again."})}finally{F(!1)}},[ee,n,D]),ce=L(()=>{q(null),z.current=void 0},[]),de=L(l=>{if(!p)return;let{code:m}=p;q(h=>h&&h.code===m?{code:m,valid:!1,refused:!0,message:l}:h)},[p]);Q(()=>{if(!p||p.refused)return;let l=p.code,m=g=>g!==null&&g.code===l&&!g.refused,h=setTimeout(async()=>{let g=ee();if(g.length===0){q(R=>m(R)?{code:l,valid:!1,message:"Add a wheel to the cart first."}:R);return}F(!0);try{let R=await B.validateCoupon({code:l,items:g,currency:n,shippingMethodId:D??void 0,customerEmail:z.current});q(fe=>m(fe)?Mt(l,R):fe)}catch{}finally{F(!1)}},An);return()=>clearTimeout(h)},[s,n,D]);let ne=p&&!p.refused?p.code:void 0;Q(()=>{if(t)return;let l=!0,m=setTimeout(async()=>{let h=ee();if(h.length===0){W(null),G(void 0);return}try{let g=await B.quoteCart({items:h,currency:n,shippingMethodId:D??void 0,couponCode:ne,customerEmail:z.current||void 0,country:b.current||void 0,subdivision:_.current||void 0});if(!l)return;W(g)}catch{if(!l)return}G(ne)},kn);return()=>{l=!1,clearTimeout(m)}},[s,n,D,ne,r]);let V=L(l=>{c(m=>{let h=m.findIndex(g=>g.id===l.id);return h===-1?[...m,l]:m.map((g,R)=>R===h?{...g,qty:Math.min(qe,g.qty+l.qty)}:g)}),At(l,n)},[n]),re=L(l=>{c(m=>m.filter(h=>h.id!==l))},[]),we=L((l,m)=>{let h=Math.max(1,Math.min(qe,m));c(g=>g.map(R=>R.id===l?{...R,qty:h}:R))},[]),_e=L(l=>{c(l)},[]),[E,H]=T(null),j=se(null);j.current=E;let $=se(null),Fe=se(""),nt=L((l,m)=>{let h=l.trim().toLowerCase();Nt(h)&&H(g=>g&&g.email===h&&g.firstName===(m??"")?g:{email:h,firstName:m??""})},[]);Q(()=>{if(t||!E)return;let l=wt(s.filter(Ie),g=>Ve(g,n)===null?Le:o(Ve(g,n),n)),m={email:E.email,firstName:E.firstName,currency:n,items:l},h=JSON.stringify(m);if(h!==Fe.current)return $.current&&clearTimeout($.current),$.current=setTimeout(()=>{$.current=null,Fe.current=h,B.captureCart(m).catch(g=>{})},Tn),()=>{$.current&&(clearTimeout($.current),$.current=null)}},[s,E,n,t]);let rt=L(()=>{$.current&&(clearTimeout($.current),$.current=null);let l=j.current;l&&(Fe.current="",B.captureCart({email:l.email,firstName:l.firstName,currency:n,items:[]}).catch(m=>{}))},[n]),ot=Ot(()=>{let l=s.reduce((k,oe)=>{let Ne=Ve(oe,n);return Ne===null?k:k+Ne},0),m=s.some(k=>Ft(k,n)===null),h=s.reduce((k,oe)=>k+oe.qty,0),g=p?.valid?p.effects:void 0,R=g?Math.min(l,Number(g.discountAmount)):0,fe=x?.bundleDiscount??0,tn=x?.appliedBundles??[],Ue=!!g?.freeShipping,at=P.find(k=>k.id===D),st=Ue?0:x?.shipping??at?.amount??0,nn=Tt({quoted:x!==null,optionCount:P.length,chosenAmount:at?.amount,couponWaivesFreight:Ue}),He={};for(let k of g?.freeUnits??[])He[k.partNumber]=(He[k.partNumber]??0)+k.quantity;let rn=x?.tax??null,on=x?x.grandTotal:l-R-fe+st;return{sets:h,units:s.reduce((k,oe)=>k+(oe.components??[]).reduce((Ne,an)=>Ne+an.wheels*oe.qty,0),0),subtotal:l,hasUnpricedLine:m,discount:R,bundleDiscount:fe,appliedBundles:tn,shipping:st,freeShipping:Ue,shippingStatus:nn,freeUnitsByPartNumber:He,tax:rn,grand:on,repricing:!!p?.refused&&x!==null&&A===p?.code,currency:n}},[s,n,p,P,D,x,A]),it=L(l=>{V(l),K()},[V,K]),en=Ot(()=>({isOpen:i,preview:t,open:K,close:ue,toggle:J,items:s,catalog:u,bundles:d,warmCatalog:Ee,add:V,addAndOpen:it,remove:re,setQty:we,replaceItems:_e,identify:nt,clearCapturedCart:rt,coupon:p,applyCoupon:te,removeCoupon:ce,refuseCoupon:de,couponBusy:Z,deliveryOptions:P,shippingMethodId:D,setShippingMethodId:ve,totals:ot}),[i,t,K,ue,J,s,u,d,Ee,V,it,re,we,_e,nt,rt,p,te,ce,de,Z,P,D,ot]);return On(Ut.Provider,{value:en,children:e})}function Ht(){let e=In(Ut);if(!e)throw new Error("useCart() must be called inside <CartProvider>. Mount the provider in app/layout.tsx.");return e}import{cache as Kn}from"react";function $t(e,t,n,r){for(;e.size>=t;){let o,i;for(let[s,c]of e){if(c.expiresAt<=r){o=s;break}i===void 0&&n(s)&&(i=s)}let a=o??i??e.keys().next().value;if(a===void 0)return;e.delete(a)}}var Mn=6e4,Dn=5e3,Fn=500,Ae=new Map;async function Un(e){let{host:t,matchesRequestHost:n}=await ft();if(!t)return"";let r=await pt();return r?`${e}|slug:${encodeURIComponent(t)}/${encodeURIComponent(r)}`:n?`${e}|host:${t}`:`${e}|xhost:${t}`}var Hn=e=>e.includes("|slug:")||e.includes("|xhost:");async function Bt(e,t){if(await mt()!==null)return t();let n=await Un(e);if(!n)return t();let r=Date.now(),o=Ae.get(n);if(o&&o.expiresAt>r)return o.load;let i=await t(),a=i.outcome.state==="failed",s=a?Dn:Mn,c=Ae.get(n)?.lastGood,u=i.outcome.state==="ok"?i:a?c:void 0,f=a&&u?u:i;return $t(Ae,Fn,Hn,r),Ae.set(n,{load:f,expiresAt:r+s,lastGood:u}),f}var $n=404;function Bn(e){if(e instanceof me&&e.status===$n)return{state:"absent"};let t=e instanceof me?e.status:-1,n=e instanceof Error?e.message:String(e);return{state:"failed",status:t,detail:n}}var Wn="[storefront:chrome-load-failed]";function Gn(e,t){console.error(`${Wn} ${e} status=${t.status} \u2014 serving fallback chrome`,t.detail)}async function Wt(e,t,n,r){try{let o=await t();return r?.(o)?{value:o,outcome:{state:"absent"}}:{value:o,outcome:{state:"ok"}}}catch(o){let i=Bn(o);return i.state==="failed"&&Gn(e,i),{value:n,outcome:i}}}function qn(e){return e==="production"?"silent":"banner"}var Oo=qn("production");function zn(e,t){return e?.trim()||t}function Wo({legalName:e,foundedYear:t,siteName:n},r=new Date().getFullYear()){let o=zn(e,n);return`\xA9 ${t&&t<r?`${t}\u2013${r}`:`${r}`} ${o}`}var Xn={name:pe,legalName:null,foundedYear:null,faviconUrl:null,currencies:[],defaultCurrency:null,countries:[],defaultCountry:null,commerceEnabled:!0,cardPayments:!1,paymentMethods:[],paypalClientId:null,paypalEnvironment:null,squareApplicationId:null,squareLocationId:null,squareEnvironment:null,ga4MeasurementId:null,googleAdsId:null,googleAdsConversionLabel:null,metaPixelId:null,consentEnabled:!1,consentPrivacyPage:null,consentNoticeOptOut:!1,socialLinks:$e},Go=Kn(async()=>Bt("site",()=>Wt("site",async()=>{let e=await B.getSite();return{name:ut(e.name),legalName:e.legalName?.trim()||null,foundedYear:e.foundedYear??null,faviconUrl:e.faviconUrl??null,currencies:e.currencies??[],defaultCurrency:e.defaultCurrency??null,countries:e.countries??[],defaultCountry:e.defaultCountry??null,commerceEnabled:e.commerceEnabled??!0,cardPayments:e.cardPayments??!1,paymentMethods:e.paymentMethods??(e.cardPayments?["card"]:[]),paypalClientId:e.paypalClientId??null,paypalEnvironment:e.paypalEnvironment??null,squareApplicationId:e.squareApplicationId??null,squareLocationId:e.squareLocationId??null,squareEnvironment:e.squareEnvironment??null,ga4MeasurementId:e.ga4MeasurementId??null,googleAdsId:e.googleAdsId??null,googleAdsConversionLabel:(e.googleAdsId?e.googleAdsConversionLabel:null)??null,metaPixelId:e.metaPixelId??null,consentEnabled:e.consentEnabled??!1,consentPrivacyPage:e.consentPrivacyPage??null,consentNoticeOptOut:e.consentNoticeOptOut??!1,socialLinks:ct(e.socialLinks)}},Xn)));var qo={name:pe,legalName:null,foundedYear:null,faviconUrl:null,currencies:[{code:"USD",symbol:"$",decimalPlaces:2,isDefault:!0}],defaultCurrency:"USD",countries:[{code:"US",name:"United States",currency:"USD",url:"",isDefault:!0,chargeTax:!1,taxDisplay:"none",taxName:"",taxRate:null,postalLabel:"Zip Code"}],defaultCountry:"US",commerceEnabled:!0,cardPayments:!0,paymentMethods:["card"],paypalClientId:null,paypalEnvironment:null,squareApplicationId:null,squareLocationId:null,squareEnvironment:null,ga4MeasurementId:null,googleAdsId:null,googleAdsConversionLabel:null,metaPixelId:null,consentEnabled:!1,consentPrivacyPage:null,consentNoticeOptOut:!1,socialLinks:$e};import{jsx as Ce,jsxs as je}from"react/jsx-runtime";import{useEffect as ke,useId as Qn,useRef as qt,useState as Te}from"react";import{efficientClientOpen as Yn}from"efficient-easel/screen/lib/session";var be=new Map,Vn=64;async function jn(e){if(!Yn())return null;try{let t=await fetch(`${lt()}/logo-analysis.json?url=${encodeURIComponent(e)}`);if(!t.ok)return null;let n=await t.json();if(!n||typeof n!="object")return null;let{reversed:r,inkIsDark:o}=n;return typeof r!="string"?null:{reversed:r,inkIsDark:typeof o=="boolean"?o:null}}catch{return null}}function Gt(e){let t=be.get(e);if(t)return t;let n=jn(e);if(be.set(e,n),be.size>Vn){let r=be.keys().next();r.done||be.delete(r.value)}return n}var Zn=202/22,Jn=.88,ii=16,er="invert(1)";function ai({variant:e="header",scrolled:t=!0,src:n,reverse:r=!1,color:o=null,onLightSurface:i,reversedSrc:a,inkIsDark:s,size:c="medium",sizePx:u,wordmark:f,siteName:d=pe,fitToContainer:S=!1,fitWordmarkToContainer:N=!1,fitFloorPx:C}){let y=f&&f.trim()?f.trim():d,[w,O]=Te(!1),M=qt(null),I=E=>{M.current=E};ke(()=>{let E=M.current?.ownerDocument??document,H=()=>{O(E.documentElement.getAttribute("data-theme")==="light")};H();let j=new MutationObserver(H);return j.observe(E.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),()=>j.disconnect()},[]);let v=n&&n.trim()?n.trim():null,x=!!v&&dt(v),W=i??(w&&t),A=o&&o.trim()?o.trim():null,G=r&&!A,b=`logo-color-${Qn().replace(/[^A-Za-z0-9_-]/g,"")}`,_=G&&x&&v&&a!=null?{reversed:a,inkIsDark:s??null}:null,p=_!==null,[q,Z]=Te(null);ke(()=>{if(!G||!v||!x||p){Z(null);return}let E=!1;return Z(null),Gt(v).then(H=>{E||Z(H)}),()=>{E=!0}},[G,v,x,p]);let F=_??q,D=!!F&&F.inkIsDark!==null&&(W?!F.inkIsDark:F.inkIsDark),ve=G&&!!v&&!x&&!W,z=D&&F?F.reversed:v,K=z?[z]:[],[ue,J]=Te(0);ke(()=>{J(0)},[v,D]);let Ee=e==="footer"?We:Be[c],U=u&&u>0?u:Ee,Pe=Math.round(U*Zn),P=ue<K.length?K[ue]:null,[ee,te]=Te(z),ce=P!==null&&P===ee,de=qt(null);ke(()=>{let E=de.current;if(!E||!E.complete)return;if(E.naturalWidth>0||E.naturalHeight>0){te(P);return}let H=!1;return E.decode().then(()=>!H&&te(P),()=>!H&&J(j=>j+1)),()=>{H=!0}},[P]);let ne=S||N,V=`calc(100cqi / ${((y.length+1)*Jn).toFixed(2)})`,re=ne&&C&&C>0?Math.min(C,U):null,we=ne?re===null?`min(${U}px, ${V})`:`clamp(${re}px, ${V}, ${U}px)`:`${U}px`,_e=je("span",{className:`font-display font-bold tracking-[0.18em] ${re===null?"whitespace-nowrap":"whitespace-normal"}`,style:{fontSize:we,lineHeight:1,...A?{color:A}:{}},"aria-label":y,children:[y,Ce("span",{className:"text-accent",style:A?{color:A}:void 0,children:"."})]});return je("span",{ref:I,className:"inline-flex items-center",children:[!ce&&_e,A&&P&&Ce("svg",{"aria-hidden":"true",focusable:"false",width:"0",height:"0",style:{position:"absolute"},children:je("filter",{id:b,colorInterpolationFilters:"sRGB",children:[Ce("feFlood",{style:{floodColor:A}}),Ce("feComposite",{in2:"SourceAlpha",operator:"in"})]})}),P&&Ce("img",{ref:de,src:P,alt:y,width:Pe,height:U,className:"shrink-0 object-contain",style:{...ce?{height:`${U}px`,width:"auto",...S?{maxWidth:"100cqi"}:{}}:{display:"none"},...ve?{filter:er}:{},...A?{filter:`url(#${b})`}:{}},onLoad:()=>te(P),onError:()=>J(E=>E+1)},P)]})}import{jsx as xe,jsxs as nr}from"react/jsx-runtime";function tr({spokes:e,mesh:t=!1,className:n}){let a=c=>Math.round(c*1e3)/1e3,s=[];for(let c=0;c<e;c++){let u=c/e*Math.PI*2-Math.PI/2;if(s.push({x1:a(100+Math.cos(u)*22),y1:a(100+Math.sin(u)*22),x2:a(100+Math.cos(u)*86),y2:a(100+Math.sin(u)*86),main:!0}),t){let f=u+Math.PI/e;s.push({x1:a(100+Math.cos(f)*22*1.4),y1:a(100+Math.sin(f)*22*1.4),x2:a(100+Math.cos(f)*78),y2:a(100+Math.sin(f)*78),main:!1})}}return nr("svg",{viewBox:"0 0 200 200",fill:"none",stroke:"currentColor",className:n??"block h-[70%] w-[70%] transition-transform duration-700 [transition-timing-function:cubic-bezier(.2,.6,.2,1)]",children:[xe("circle",{cx:100,cy:100,r:92,strokeWidth:2}),xe("circle",{cx:100,cy:100,r:84,strokeWidth:1,opacity:.4}),xe("circle",{cx:100,cy:100,r:22,strokeWidth:2}),xe("circle",{cx:100,cy:100,r:6,fill:"currentColor"}),s.map((c,u)=>xe("line",{x1:c.x1,y1:c.y1,x2:c.x2,y2:c.y2,stroke:"currentColor",strokeWidth:c.main?6:3,strokeLinecap:"round",opacity:c.main?1:.5},u))]})}var ci="#c9a461",Kt=[{f:"black",label:"Black",hex:"#171717"},{f:"silver",label:"Silver",hex:"#cccccc"},{f:"bronze",label:"Bronze",hex:"#8a6438"},{f:"graphite",label:"Graphite",hex:"#3a3c3f"},{f:"red",label:"Candy Red",hex:"#7a0f14"}],di={name:"",color:"var(--fg)",family:"silver",src:""};function rr(e,t){let n=r=>{let o=Kt.findIndex(i=>i.f===r);return o===-1?Kt.length:o};return n(e)-n(t)||e.localeCompare(t)}function fi(e){let t=new Set;for(let n of e)for(let r of n.finishes??[])r?.family&&t.add(r.family);return[...t].sort(rr)}import{useState as or}from"react";import{jsx as le,jsxs as Qe}from"react/jsx-runtime";function ir({customerEmail:e}){let{coupon:t,applyCoupon:n,removeCoupon:r,couponBusy:o}=Ht(),[i,a]=or("");async function s(){o||!i.trim()||(await n(i,e),a(""))}return Qe("div",{className:"flex flex-col gap-2",children:[t===null?Qe("div",{className:"flex border border-line",children:[le("input",{type:"text",value:i,onChange:c=>a(c.target.value),onKeyDown:c=>{c.key==="Enter"&&(c.preventDefault(),s())},placeholder:"Coupon code","aria-label":"Coupon code",className:"flex-1 bg-transparent px-4 py-4 font-mono text-[11px] uppercase tracking-[0.18em] text-fg outline-none placeholder:text-fg-dim"}),le("button",{type:"button",onClick:()=>{s()},disabled:o,className:"border-l border-line px-4 font-mono text-[10px] uppercase tracking-[0.26em] text-btn transition-colors hover:bg-btn hover:text-btn-ink disabled:cursor-wait disabled:opacity-60",children:o?"\u2026":"Apply"})]}):Qe("div",{className:["flex items-center justify-between gap-3 border px-4 py-3",t.valid?"border-accent":"border-line"].join(" "),style:t.valid?{background:"color-mix(in oklab, var(--accent) 8%, transparent)"}:void 0,children:[le("span",{className:["font-mono text-[11px] uppercase tracking-[0.22em]",t.valid?"text-accent":t.deferred?"text-fg":"text-fg-dim line-through"].join(" "),children:t.code}),le("button",{type:"button",onClick:r,"aria-label":`Remove coupon ${t.code}`,className:"font-mono text-[12px] text-fg-dim transition-colors hover:text-fg",children:"\u2715"})]}),t?.deferred?le("p",{className:"font-mono text-[10px] uppercase tracking-[0.18em] text-fg-dim",children:Pt}):t&&!t.valid&&t.message&&le("p",{className:"font-mono text-[10px] uppercase tracking-[0.18em] text-alert",children:t.message})]})}var Ze="Ads on. Shopper can opt out.",Oe="Ads and analytics off until Accept",ar={us:{region:"us",name:"United States",model:"opt-out",law:"California CCPA / CPRA, other state laws",beforeChoice:Ze,footerLink:"Do Not Sell or Share My Personal Information",panelEyebrow:"Do not sell or share",adsRowName:"Sale or sharing for ads"},ca:{region:"ca",name:"Canada",model:"opt-in",law:"PIPEDA, Quebec Law 25",beforeChoice:Oe,footerLink:"Privacy choices",panelEyebrow:"Privacy choices",adsRowName:"Advertising"},au:{region:"au",name:"Australia",model:"opt-out",law:"Privacy Act 1988 (APPs)",beforeChoice:Ze,footerLink:"Privacy choices",panelEyebrow:"Privacy choices",adsRowName:"Advertising"},nz:{region:"nz",name:"New Zealand",model:"opt-out",law:"Privacy Act 2020",beforeChoice:Ze,footerLink:"Privacy choices",panelEyebrow:"Privacy choices",adsRowName:"Advertising"},uk:{region:"uk",name:"United Kingdom",model:"opt-in",law:"PECR, UK GDPR",beforeChoice:Oe,footerLink:"Cookie settings",panelEyebrow:"Cookie settings",adsRowName:"Advertising"},eu:{region:"eu",name:"European Union",model:"opt-in",law:"ePrivacy Directive, GDPR",beforeChoice:Oe,footerLink:"Cookie settings",panelEyebrow:"Cookie settings",adsRowName:"Advertising"},other:{region:"other",name:"All other countries",model:"opt-in",law:"Safe default",beforeChoice:Oe,footerLink:"Cookie settings",panelEyebrow:"Cookie settings",adsRowName:"Advertising"}};function sr(e){let t=[...e.googleAds?["Google"]:[],...e.meta?["Facebook","Instagram"]:[]];return t.length<=1?t.join(""):`${t.slice(0,-1).join(", ")} and ${t[t.length-1]}`}function Ci(e,t,n){let r=sr(n),o=r?`We use cookies to count visits and to show you ${t} ads on ${r}.`:"We use cookies to count visits.";return e.model==="opt-in"?{heading:r?"Cookies and ads":"Cookies",before:`${o} Nothing loads until you choose. You can change this at any time with `,link:e.footerLink,after:" at the bottom of every page."}:{heading:r?"Cookies and ads":"Cookies",before:`${o} You can say no at any time: choose Privacy choices, or use `,link:e.footerLink,after:" at the bottom of every page."}}var xi={accept:"Accept all",reject:"Reject all",choose:"Choose",save:"Save",ok:"OK",privacyChoices:"Privacy choices",privacyPolicy:"Privacy Policy",alwaysOn:"Always on"};var lr={asked:!1,region:"other",model:"opt-in",analytics:!0,ads:!0,chosen:!0,gpc:!1};var ur=lr;function Pi(e=ur){if(e.asked)return e.ads?"granted":"denied"}function _i(){let e=typeof crypto<"u"?crypto:void 0;if(typeof e?.randomUUID=="function")return e.randomUUID();let t=new Uint8Array(16);if(typeof e?.getRandomValues=="function")e.getRandomValues(t);else for(let r=0;r<t.length;r++)t[r]=Math.floor(Math.random()*256);t[6]=t[6]&15|64,t[8]=t[8]&63|128;let n=Array.from(t,r=>r.toString(16).padStart(2,"0")).join("");return`${n.slice(0,8)}-${n.slice(8,12)}-${n.slice(12,16)}-${n.slice(16,20)}-${n.slice(20)}`}import{Children as dr,isValidElement as fr,useEffect as Xt,useId as pr,useLayoutEffect as jt,useRef as X,useState as Yt}from"react";var Me=(e,t)=>!!e[t]&&!e[t].disabled;function Je(e,t,n){let r=e.length;for(let o=1;o<=r;o++){let i=((t+n*o)%r+r)%r;if(Me(e,i))return i}return t}function et(e,t){return Je(e,t===1?-1:e.length,t)}function tt(e,t){return Me(e,t)?t:Math.max(et(e,1),0)}function zt(e,t,n){let{open:r,focus:o}=e,i=a=>({...e,...a});if(t.length===1&&/\S/.test(t)){let a=e.typed+t.toLowerCase(),s=n.findIndex((c,u)=>Me(n,u)&&c.label.toLowerCase().startsWith(a));return{state:i({open:!0,typed:a,focus:s>=0?s:o}),handled:!0}}if(!r)return t==="ArrowDown"||t==="ArrowUp"||t==="Enter"||t===" "?{state:i({open:!0,typed:""}),handled:!0}:{state:e,handled:!1};switch(t){case"ArrowDown":return{state:i({focus:Je(n,o,1)}),handled:!0};case"ArrowUp":return{state:i({focus:Je(n,o,-1)}),handled:!0};case"Home":return{state:i({focus:et(n,1)}),handled:!0};case"End":return{state:i({focus:et(n,-1)}),handled:!0};case"Enter":case" ":return Me(n,o)?{state:i({open:!1,typed:""}),commit:o,refocus:!0,handled:!0}:{state:e,handled:!0};case"Escape":return{state:i({open:!1,typed:""}),refocus:!0,handled:!0};case"Tab":return{state:i({open:!1,typed:""}),handled:!1};default:return{state:e,handled:!1}}}import{placeMenu as mr}from"efficient-shell/ui";import{Fragment as xr,jsx as Y,jsxs as Qt}from"react/jsx-runtime";var Vt={body:"text-[length:var(--size-body,14px)]",label:"text-[length:var(--size-label,13px)]"};function gr({items:e,value:t,onPick:n,open:r,onOpen:o,onClose:i}){let[a,s]=Yt(!1),c=r!==void 0,u=c?r:a,[f,d]=Yt(0),S=X({text:"",timer:0}),N=X(null),C=X(null),y=X(null),w=pr(),O=X(null),M=e.findIndex(b=>b.value===t),I=b=>{b!==u&&(c||s(b),b?o?.():i?.())},v=b=>{let _=e[b];!_||_.disabled||(n(_.value),I(!1),C.current?.focus())},x=b=>{let _={open:u,focus:u?f:tt(e,M),typed:S.current.text},p=zt(_,b,e);return!p.handled&&p.state.open===u?!1:(p.state.typed!==_.typed&&(S.current.text=p.state.typed,window.clearTimeout(S.current.timer),S.current.timer=window.setTimeout(()=>{S.current.text=""},500)),d(p.state.focus),p.commit!==void 0?v(p.commit):I(p.state.open),p.refocus&&C.current?.focus(),p.handled)},W=X(x);W.current=x;let A=X(()=>I(!1));A.current=()=>I(!1);let G=b=>{u||(O.current=b.nativeEvent,W.current(b.key)&&b.preventDefault())};return Xt(()=>{if(!u)return;let b=p=>{N.current?.contains(p.target)||A.current()},_=p=>{p!==O.current&&W.current(p.key)&&p.preventDefault()};return document.addEventListener("mousedown",b),document.addEventListener("keydown",_),()=>{document.removeEventListener("mousedown",b),document.removeEventListener("keydown",_)}},[u]),Xt(()=>{u&&(S.current.text||d(tt(e,M)))},[u]),jt(()=>{if(!u||!y.current)return;y.current.children.item(f)?.scrollIntoView({block:"nearest"})},[f,u]),{open:u,toggle:()=>I(!u),close:()=>I(!1),focusIdx:f,setFocusIdx:d,pick:b=>v(e.findIndex(_=>_.value===b)),wrapRef:N,triggerRef:C,listRef:y,listId:w,onTriggerKeyDown:G,activeId:u?`${w}-${f}`:void 0}}var hr={select:{list:"absolute left-0 top-full z-50 mt-1 max-h-[280px] w-max min-w-full overflow-y-auto border-2 border-accent bg-bg shadow-xl",item:(e,t,n)=>["px-3 py-3 font-mono text-[13px] font-semibold uppercase tracking-[0.1em] transition-colors whitespace-nowrap",n?"cursor-not-allowed opacity-40":"cursor-pointer",e&&!n?"bg-accent text-bg":"bg-bg text-fg"].join(" ")},cell:{list:"absolute left-0 top-full z-50 mt-1 max-h-[320px] w-max min-w-full overflow-y-auto border-2 border-accent bg-bg shadow-xl",item:e=>[`cursor-pointer whitespace-nowrap px-6 py-3 font-mono ${Vt.label} font-semibold uppercase tracking-[0.1em] transition-colors`,e?"bg-accent text-bg":"bg-bg text-fg"].join(" "),pickerMarker:!0},hairline:{list:"absolute left-0 top-full z-50 max-h-[320px] w-full overflow-y-auto border border-line bg-bg shadow-[0_6px_20px_rgba(0,0,0,0.10)]",item:(e,t)=>[`flex cursor-pointer items-center justify-between gap-4 border-b border-line px-4 py-3 text-left ${Vt.body} transition-colors last:border-b-0`,t?"border-fg font-medium text-fg":e?"border-fg text-fg":"text-fg-dim"].join(" "),pickerMarker:!0},region:{list:"absolute right-0 top-full z-[200] mt-2 flex min-w-[240px] flex-col border border-line bg-surface text-fg",item:(e,t,n,r)=>["flex w-full cursor-pointer items-center gap-3 px-4 py-3 text-left transition-colors","font-mono text-[13px] uppercase tracking-[0.18em]",e?"bg-surface-2 text-fg":"",r?"":"border-b border-line",t?"text-accent":""].join(" "),itemStyle:e=>e?void 0:{color:"color-mix(in oklab, currentColor 80%, transparent)"}}};function yr(e,t){jt(()=>{let n=e.current,r=n?.ownerDocument.defaultView;if(!n||!r)return;let o=()=>{let i=n.style;i.top=i.bottom=i.marginTop=i.marginBottom=i.maxHeight=i.overflowY=i.translate="";let a=n.offsetParent??n.parentElement;if(!a)return;let s=a.getBoundingClientRect(),c=n.getBoundingClientRect(),u=Math.abs(c.right-s.right)<Math.abs(c.left-s.left)?"end":"start",f=mr({trigger:{left:s.left,right:s.right,top:s.top,bottom:s.bottom},menu:{width:c.width,height:c.height},bounds:{left:0,top:0,right:r.innerWidth,bottom:r.innerHeight},align:u,side:"bottom"});if(f.side==="top"){i.top="auto",i.bottom="100%",i.marginTop="0px";let S=f.top+Math.min(c.height,f.maxHeight);i.marginBottom=`${Math.max(0,s.top-S)}px`}f.maxHeight<c.height&&(i.maxHeight=`${f.maxHeight}px`,i.overflowY="auto");let d=f.left-c.left;d&&(i.translate=`${d}px`)};return o(),r.addEventListener("resize",o),r.addEventListener("scroll",o,!0),()=>{r.removeEventListener("resize",o),r.removeEventListener("scroll",o,!0)}},[e,t])}function br({id:e,tone:t,items:n,value:r,focusIdx:o,onFocus:i,onPick:a,listRef:s,ariaLabel:c}){let u=hr[t],f=X(null);return yr(f,n.length),Y("ul",{ref:d=>{f.current=d,s&&(s.current=d)},id:e,role:"listbox","aria-label":c,...u.pickerMarker?{"data-picker-menu":""}:{},className:u.list,children:n.map((d,S)=>{let N=d.value===r;return Y("li",{id:`${e}-${S}`,role:"option","aria-selected":N,"aria-disabled":d.disabled||void 0,onMouseEnter:()=>!d.disabled&&i(S),onMouseDown:C=>{C.preventDefault(),d.disabled||a(d.value)},className:u.item(S===o,N&&d.value!=="",!!d.disabled,S===n.length-1),style:u.itemStyle?.(N),children:d.meta===void 0?d.label:Qt(xr,{children:[d.lead,Y("span",{className:"flex-1 whitespace-nowrap",children:d.label}),Y("span",{className:"ml-auto text-[12px] opacity-50",children:d.meta})]})},`${d.value}_${S}`)})})}function Cr({value:e,onChange:t,disabled:n,children:r,className:o,style:i,name:a,id:s,"aria-label":c}){let u=dr.toArray(r).flatMap(C=>{if(!fr(C))return[];if(C.type!=="option")return[];let w=C.props,O=w.value!==void 0?String(w.value):"",M=w.children,I=typeof M=="string"||typeof M=="number"?String(M):O;return[{value:O,label:I,disabled:!!w.disabled}]}),f=e??"",d=gr({items:u,value:f,onPick:C=>t?.({target:{value:C}})}),N=u.find(C=>C.value===f)?.label??u[0]?.label??"";return Qt("div",{ref:d.wrapRef,className:"relative",children:[a&&Y("input",{type:"hidden",name:a,value:f}),Y("button",{ref:C=>{d.triggerRef.current=C},type:"button",disabled:n,"aria-haspopup":"listbox","aria-expanded":d.open,"aria-controls":d.open?d.listId:void 0,"aria-activedescendant":d.activeId,"aria-label":c,id:s,onClick:()=>!n&&d.toggle(),onKeyDown:C=>!n&&d.onTriggerKeyDown(C),className:`block w-full ${o??""}`,style:i,children:Y("span",{className:"block w-full truncate text-left",children:N})}),d.open&&Y(br,{id:d.listId,tone:"select",items:u,value:f,focusIdx:d.focusIdx,onFocus:d.setFocusIdx,onPick:d.pick,listRef:d.listRef})]})}import{jsx as Se,jsxs as De}from"react/jsx-runtime";var Sr="font-mono text-[length:var(--size-label,12px)]",vr="font-semibold uppercase tracking-[0.22em] text-fg";function Zt(e){return`${e??Sr} ${vr}`}function Jt(){return Se("span",{className:"text-accent",children:" *"})}function Er({children:e,required:t,labelFace:n}){return De("span",{className:Zt(n),children:[e,t?Se(Jt,{}):null]})}function Pr({label:e,required:t,hint:n,separate:r,htmlFor:o,labelFace:i,className:a,children:s}){let c=a?`flex flex-col gap-2 ${a}`:"flex flex-col gap-2",u=n?Se("span",{className:"font-mono text-[11px] uppercase tracking-[0.22em] text-fg-dim",children:n}):null;return r||n?De("div",{className:c,children:[De("label",{htmlFor:o,className:Zt(i),children:[e,t?Se(Jt,{}):null]}),s,u]}):De("label",{htmlFor:o,className:c,children:[Se(Er,{required:t,labelFace:i,children:e}),s]})}export{Br as a,Wr as b,Gr as c,gt as d,Ge as e,wr as f,_r as g,Nr as h,Rr as i,sn as j,ln as k,Lr as l,Ir as m,qe as n,Re as o,ge as p,Ar as q,Le as r,hn as s,yn as t,Xr as u,Yr as v,_t as w,Xe as x,Vr as y,jr as z,Cn as A,Qr as B,Zr as C,xn as D,Jr as E,vn as F,eo as G,to as H,Nt as I,so as J,lo as K,uo as L,po as M,mo as N,Dr as O,St as P,Fr as Q,Ie as R,Ve as S,_o as T,Ht as U,Wo as V,Xn as W,qo as X,ii as Y,ai as Z,tr as _,ci as $,Kt as aa,di as ba,rr as ca,fi as da,ir as ea,ar as fa,Ci as ga,xi as ha,lr as ia,Pi as ja,_i as ka,gr as la,br as ma,Cr as na,Er as oa,Pr as pa};
|
|
1
|
+
import{f as dt,i as me,q as ft,s as pt,t as mt,v as B}from"./chunk-Z7PJKX2P.js";import{Aa as pe,Ba as ut,Ea as $e,Fa as ct,Ia as Be,Ja as We}from"./chunk-S66TL4Z3.js";import{j as lt,l as ie}from"./chunk-IHYVLVY3.js";import{createContext as un,useContext as Ct,useEffect as cn,useMemo as he,useState as yt}from"react";function gt(e,t){return e.map(n=>({partNumber:n.partNumber,quantity:n.wheels*t}))}function ae(e,t){if(e.length===0)return null;let n=0;for(let r of e){let o=r.prices?.[t];if(typeof o!="number"||!Number.isFinite(o)||o<=0)return null;n+=o*r.wheels}return n}var qe=4,wr=1,_r={unit:"set",spares:0,spareSide:"left"};function ht(e){return e.unit==="single"?1:qe+e.spares}function Rr(e,t){return[{partNumber:e.partNumber,wheels:ht(t),prices:e.prices}]}function Nr(e,t){let n=ht(t)-qe;if(n<=0||e.length===0)return e;let r=sn(e),o=r?r[t.spareSide]:0;return e.map((i,a)=>a===o?{...i,wheels:i.wheels+n}:i)}function sn(e){let t,n;for(let r=0;r<e.length;r+=1){let o=e[r].hand;if(o!=="left"&&o!=="right")continue;if((o==="left"?t:n)!==void 0)return null;o==="left"?t=r:n=r}return t!==void 0&&n!==void 0?{left:t,right:n}:null}function ln(e,t){return t.spares>0?`${e} + spare`:e}function Lr(e){return e.unit==="single"?"Single":ln(`Set of ${qe}`,e)}var Ir="data-add-to-basket",Ge=9,Ne="en";function ge(e,t,n=0){return new Intl.NumberFormat(Ne,{style:"currency",currency:t,minimumFractionDigits:0,maximumFractionDigits:n}).format(e)}function Ar(e,t){return new Intl.NumberFormat(Ne,{style:"currency",currency:t}).format(e)}import{jsx as mn}from"react/jsx-runtime";var dn="storefront-country",bt=dn,Ke=un(null);function fn(e){return xt(e,"catalogue")}function pn(e){return xt(e,"money")}function xt(e,t){let n=new Map(e.map(o=>[o.code,o.decimalPlaces])),r=new Map;return(o,i)=>{if(!i)return"";let a=r.get(i);if(!a){let s=n.get(i)??0;a=new Intl.NumberFormat(Ne,{style:"currency",currency:i,minimumFractionDigits:t==="money"?s:0,maximumFractionDigits:s}),r.set(i,a)}return a.format(o)}}function Dr({children:e,currencies:t,countries:n,defaultCurrency:r,defaultCountry:o}){let i=he(()=>t??[],[t]),a=he(()=>n??[],[n]),s=he(()=>r||i.find(y=>y.isDefault)?.code||i[0]?.code||"",[r,i]),c=he(()=>o||a.find(y=>y.isDefault)?.code||a[0]?.code||"",[o,a]),[u,f]=yt(c),[d,S]=yt(!1);cn(()=>{let y=ie.getItem(bt);y&&a.some(w=>w.code===y)&&f(y),S(!0)},[a]);function R(y){f(y),ie.setItem(bt,y)}let C=he(()=>{let y=a.find(v=>v.code===u)??null,w=y?.currency,O=w&&i.some(v=>v.code===w)?w:s,M=fn(i),I=pn(i);return{country:u,currency:O,setCountry:R,currencies:i,countries:a,activeCountry:y,formatPrice:(v,x)=>M(v,x??O),formatMoney:(v,x)=>I(v,x??O),ready:d}},[u,i,a,s,d]);return mn(Ke.Provider,{value:C,children:e})}function St(){let e=Ct(Ke);if(!e)throw new Error("useCurrency must be used within a CurrencyProvider");return e}function Fr(){return Ct(Ke)?.country??""}import{createContext as Ln,useCallback as L,useContext as In,useEffect as Q,useMemo as Ot,useRef as se,useState as T}from"react";function Et(e,t){return e.valid?!1:e.reason==="firstOrderOnly"?!0:e.reason==="notEligible"&&!t}var Pt="We'll confirm this discount when you place your order.",Br="Confirmed at checkout";function Wr(e){return e&&(e.valid||e.deferred)?e.code:void 0}var vt="coupon_code: ";function qr(e){return!(e instanceof me)||e.status!==400||!e.message.startsWith(vt)?null:e.message.slice(vt.length)}function wt(e,t){return e.map(n=>({qty:n.qty,slug:n.slug,name:`${n.name.lead}${n.name.accent}`.trim(),finish:n.finishName,size:n.size,kind:n.kind,sku:n.sku,pack:n.pack,priceLabel:t(n)}))}var Le="Price on request",hn="Request a quote",yn="from ",Xr="From ",Vr="each",_t="Free";function ze(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function Xe(e,t){let n=e?.[t];return ze(n)?n:null}function Yr(e,t,n,r){let o=Xe(e,n),i=Xe(t,n);return o===null&&i===null?0:o===null?1:i===null?-1:r==="asc"?o-i:i-o}function jr(e,t,n,r){if(n==null&&r==null)return!0;let o=Xe(e,t);return!(o===null||n!=null&&o<n||r!=null&&o>r)}var bn={priced:!1,unit:null,was:null,onSale:!1,setTotal:null};function Cn(e,t,n){if(!ze(e))return bn;let r=ze(t)&&t>e?t:null;return{priced:!0,unit:e,was:r,onSale:r!==null,setTotal:n!=null?e*n:null}}function Qr(e,t,n=""){return!e.priced||e.unit==null?Le:`${n}${ge(e.unit,t)}`}function Zr(e,t){return e.was==null?null:ge(e.was,t)}function xn(e,t,n=1){let r=ae(e,t);if(r===null)return{priced:!1,unit:null,isFrom:!1,setTotal:null};let o=e.reduce((a,s)=>a+s.wheels,0),i=Math.min(...e.map(a=>a.prices[t]));return{priced:!0,unit:i,isFrom:i*o!==r,setTotal:r*n}}var Sn={priced:!1,unit:null,isFrom:!1,was:null,onSale:!1,setTotal:null};function Jr(e,t,n,r=1){let o=Cn(e.prices[n],e.msrpPrices?.[n],4),i=o.setTotal==null?null:o.setTotal*r;if(!t)return{priced:o.priced,unit:o.unit,isFrom:!0,was:o.was,onSale:o.onSale,setTotal:null,fromSetTotal:i};let a=xn(t.components,n,r);return a.priced?{priced:!0,unit:a.unit,isFrom:a.isFrom,was:null,onSale:!1,setTotal:a.setTotal,fromSetTotal:i}:{...Sn,fromSetTotal:i}}function vn(e,t){return!e.priced||e.unit==null?Le:`${e.isFrom?yn:""}${ge(e.unit,t)}`}function eo(e,t){return e.was==null?null:ge(e.was,t)}function to(e,t){return!e.priced||e.unit==null?hn:vn(e,t)}var En=/^[^@\s]+@[^@\s]+\.[^@\s]+$/;function Rt(e){return En.test(e.trim())}var Nt="sf:ga-purchases",Pn=20;function It(){return typeof window>"u"||window.parent!==window}function ye(...e){try{if(It()||typeof window.gtag!="function")return;window.gtag(...e)}catch{}}function wn(e,t){let n=e.config.find(r=>r.gold)?.label;return{item_id:`${e.slug}|${e.finishName}|${e.size}`,item_name:`${e.name.lead}${e.name.accent}`.trim(),...n?{item_variant:n}:{},price:ae(e.components,t)??0,quantity:e.qty}}function Ve(e,t){return e.filter(Ie).map(n=>wn(n,t))}function so(e){ye("event","view_item",{currency:e.currency,value:e.pricePerSet,items:[{item_id:e.itemId,item_name:e.itemName,...e.variant?{item_variant:e.variant}:{},price:e.pricePerSet,quantity:1}]})}function At(e,t){let n=Ve([e],t);n.length!==0&&ye("event","add_to_cart",{currency:t,value:n[0].price*n[0].quantity,items:n})}function lo(e){let t=Ve(e.lines,e.currency);t.length!==0&&ye("event","begin_checkout",{currency:e.currency,value:e.value,...e.coupon?{coupon:e.coupon}:{},items:t})}var Lt=new Set;function _n(e){if(Lt.has(e))return!1;Lt.add(e);try{let t=JSON.parse(ie.getItem(Nt)??"[]");if(t.includes(e))return!1;ie.setItem(Nt,JSON.stringify([...t,e].slice(-Pn)))}catch{}return!0}function uo(e){let t=e.confirmation;if(It()||!_n(t.orderNumber))return;let n=t.currency,r=Number(t.grandTotal);ye("event","purchase",{transaction_id:t.orderNumber,currency:n,value:r,shipping:Number(t.freightCharge),...t.couponCode?{coupon:t.couponCode}:{},items:Ve(e.lines,n)}),e.adsSendTo&&ye("event","conversion",{send_to:e.adsSendTo,transaction_id:t.orderNumber,currency:n,value:r})}var Rn="Arranged after review",kt="Calculated at checkout",Nn=kt,po=kt;function Tt({quoted:e,optionCount:t,chosenAmount:n,couponWaivesFreight:r}){return e&&t===0?"arranged":r?"free":n===void 0?"pending":n===0?"free":"charged"}function mo(e){switch(e){case"arranged":return Rn;case"pending":return Nn;case"free":return _t;case"charged":return null}}import{jsx as On}from"react/jsx-runtime";var An=400,kn=400,Tn=1500;function Ie(e){return(e.components?.length??0)>0}function Mt(e,t){return{code:e,valid:t.valid,deferred:Et(t,t.askedAsShopper),message:t.message||void 0,effects:t.effects??void 0}}function Ft(e,t){return ae(e.components,t)}function Ye(e,t){let n=Ft(e,t);return n===null?null:n*e.qty}function Dt(e){return e!=="tyre"}var Ut=Ln(null);function _o({children:e,preview:t=!1}){let{currency:n,country:r,formatMoney:o}=St(),[i,a]=T(t),[s,c]=T([]),[u,f]=T([]),[d,S]=T([]),[R,C]=T(!1),[y,w]=T(!1),[O,M]=T(!1),[I,v]=T(!1),[x,W]=T(null),[A,q]=T(void 0),b=se(r),_=se("");b.current=b.current||r;let[p,G]=T(null),[Z,F]=T(!1),[D,ve]=T(null),z=se(void 0),K=L(()=>a(!0),[]),ue=L(()=>a(!1),[]),J=L(()=>a(l=>!l),[]);Q(()=>{t||typeof window>"u"||new URLSearchParams(window.location.search).get("cart")==="open"&&K()},[K,t]);let Ee=L(l=>{v(!0),Dt(l)&&M(!0)},[]),U=O||s.some(l=>Dt(l.kind)),Pe=I||s.length>0;Q(()=>{if(t||!U||R)return;let l=!0;return B.listWheels().then(m=>{l&&(f(m),C(!0))}),()=>{l=!1}},[t,U,R]),Q(()=>{if(t||!Pe||y)return;let l=!0;return B.listBundles().then(m=>{l&&(S(m),w(!0))}),()=>{l=!1}},[t,Pe,y]);let P=x?.deliveryOptions??[];Q(()=>{P.length!==0&&ve(l=>l&&P.some(m=>m.id===l)?l:P[0]?.id??null)},[x]);let ee=L(()=>s.filter(Ie).flatMap(l=>gt(l.components,l.qty)),[s]),te=L(async(l,m)=>{let h=l.trim().toUpperCase();if(!h)return;let g=ee();if(g.length===0){G({code:h,valid:!1,message:"Add a wheel to the cart first."});return}F(!0),z.current=m;try{let N=await B.validateCoupon({code:h,items:g,currency:n,shippingMethodId:D??void 0,customerEmail:m});G(Mt(h,N))}catch{G({code:h,valid:!1,message:"Could not check that code. Please try again."})}finally{F(!1)}},[ee,n,D]),ce=L(()=>{G(null),z.current=void 0},[]),de=L(l=>{if(!p)return;let{code:m}=p;G(h=>h&&h.code===m?{code:m,valid:!1,refused:!0,message:l}:h)},[p]);Q(()=>{if(!p||p.refused)return;let l=p.code,m=g=>g!==null&&g.code===l&&!g.refused,h=setTimeout(async()=>{let g=ee();if(g.length===0){G(N=>m(N)?{code:l,valid:!1,message:"Add a wheel to the cart first."}:N);return}F(!0);try{let N=await B.validateCoupon({code:l,items:g,currency:n,shippingMethodId:D??void 0,customerEmail:z.current});G(fe=>m(fe)?Mt(l,N):fe)}catch{}finally{F(!1)}},An);return()=>clearTimeout(h)},[s,n,D]);let ne=p&&!p.refused?p.code:void 0;Q(()=>{if(t)return;let l=!0,m=setTimeout(async()=>{let h=ee();if(h.length===0){W(null),q(void 0);return}try{let g=await B.quoteCart({items:h,currency:n,shippingMethodId:D??void 0,couponCode:ne,customerEmail:z.current||void 0,country:b.current||void 0,subdivision:_.current||void 0});if(!l)return;W(g)}catch{if(!l)return}q(ne)},kn);return()=>{l=!1,clearTimeout(m)}},[s,n,D,ne,r]);let Y=L(l=>{c(m=>{let h=m.findIndex(g=>g.id===l.id);return h===-1?[...m,l]:m.map((g,N)=>N===h?{...g,qty:Math.min(Ge,g.qty+l.qty)}:g)}),At(l,n)},[n]),re=L(l=>{c(m=>m.filter(h=>h.id!==l))},[]),we=L((l,m)=>{let h=Math.max(1,Math.min(Ge,m));c(g=>g.map(N=>N.id===l?{...N,qty:h}:N))},[]),_e=L(l=>{c(l)},[]),[E,H]=T(null),j=se(null);j.current=E;let $=se(null),Fe=se(""),nt=L((l,m)=>{let h=l.trim().toLowerCase();Rt(h)&&H(g=>g&&g.email===h&&g.firstName===(m??"")?g:{email:h,firstName:m??""})},[]);Q(()=>{if(t||!E)return;let l=wt(s.filter(Ie),g=>Ye(g,n)===null?Le:o(Ye(g,n),n)),m={email:E.email,firstName:E.firstName,currency:n,items:l},h=JSON.stringify(m);if(h!==Fe.current)return $.current&&clearTimeout($.current),$.current=setTimeout(()=>{$.current=null,Fe.current=h,B.captureCart(m).catch(g=>{})},Tn),()=>{$.current&&(clearTimeout($.current),$.current=null)}},[s,E,n,t]);let rt=L(()=>{$.current&&(clearTimeout($.current),$.current=null);let l=j.current;l&&(Fe.current="",B.captureCart({email:l.email,firstName:l.firstName,currency:n,items:[]}).catch(m=>{}))},[n]),ot=Ot(()=>{let l=s.reduce((k,oe)=>{let Re=Ye(oe,n);return Re===null?k:k+Re},0),m=s.some(k=>Ft(k,n)===null),h=s.reduce((k,oe)=>k+oe.qty,0),g=p?.valid?p.effects:void 0,N=g?Math.min(l,Number(g.discountAmount)):0,fe=x?.bundleDiscount??0,tn=x?.appliedBundles??[],Ue=!!g?.freeShipping,at=P.find(k=>k.id===D),st=Ue?0:x?.shipping??at?.amount??0,nn=Tt({quoted:x!==null,optionCount:P.length,chosenAmount:at?.amount,couponWaivesFreight:Ue}),He={};for(let k of g?.freeUnits??[])He[k.partNumber]=(He[k.partNumber]??0)+k.quantity;let rn=x?.tax??null,on=x?x.grandTotal:l-N-fe+st;return{sets:h,units:s.reduce((k,oe)=>k+(oe.components??[]).reduce((Re,an)=>Re+an.wheels*oe.qty,0),0),subtotal:l,hasUnpricedLine:m,discount:N,bundleDiscount:fe,appliedBundles:tn,shipping:st,freeShipping:Ue,shippingStatus:nn,freeUnitsByPartNumber:He,tax:rn,grand:on,repricing:!!p?.refused&&x!==null&&A===p?.code,currency:n}},[s,n,p,P,D,x,A]),it=L(l=>{Y(l),K()},[Y,K]),en=Ot(()=>({isOpen:i,preview:t,open:K,close:ue,toggle:J,items:s,catalog:u,bundles:d,warmCatalog:Ee,add:Y,addAndOpen:it,remove:re,setQty:we,replaceItems:_e,identify:nt,clearCapturedCart:rt,coupon:p,applyCoupon:te,removeCoupon:ce,refuseCoupon:de,couponBusy:Z,deliveryOptions:P,shippingMethodId:D,setShippingMethodId:ve,totals:ot}),[i,t,K,ue,J,s,u,d,Ee,Y,it,re,we,_e,nt,rt,p,te,ce,de,Z,P,D,ot]);return On(Ut.Provider,{value:en,children:e})}function Ht(){let e=In(Ut);if(!e)throw new Error("useCart() must be called inside <CartProvider>. Mount the provider in app/layout.tsx.");return e}import{cache as Kn}from"react";function $t(e,t,n,r){for(;e.size>=t;){let o,i;for(let[s,c]of e){if(c.expiresAt<=r){o=s;break}i===void 0&&n(s)&&(i=s)}let a=o??i??e.keys().next().value;if(a===void 0)return;e.delete(a)}}var Mn=6e4,Dn=5e3,Fn=500,Ae=new Map;async function Un(e){let{host:t,matchesRequestHost:n}=await ft();if(!t)return"";let r=await pt();return r?`${e}|slug:${encodeURIComponent(t)}/${encodeURIComponent(r)}`:n?`${e}|host:${t}`:`${e}|xhost:${t}`}var Hn=e=>e.includes("|slug:")||e.includes("|xhost:");async function Bt(e,t){if(await mt()!==null)return t();let n=await Un(e);if(!n)return t();let r=Date.now(),o=Ae.get(n);if(o&&o.expiresAt>r)return o.load;let i=await t(),a=i.outcome.state==="failed",s=a?Dn:Mn,c=Ae.get(n)?.lastGood,u=i.outcome.state==="ok"?i:a?c:void 0,f=a&&u?u:i;return $t(Ae,Fn,Hn,r),Ae.set(n,{load:f,expiresAt:r+s,lastGood:u}),f}var $n=404;function Bn(e){if(e instanceof me&&e.status===$n)return{state:"absent"};let t=e instanceof me?e.status:-1,n=e instanceof Error?e.message:String(e);return{state:"failed",status:t,detail:n}}var Wn="[storefront:chrome-load-failed]";function qn(e,t){console.error(`${Wn} ${e} status=${t.status} \u2014 serving fallback chrome`,t.detail)}async function Wt(e,t,n,r){try{let o=await t();return r?.(o)?{value:o,outcome:{state:"absent"}}:{value:o,outcome:{state:"ok"}}}catch(o){let i=Bn(o);return i.state==="failed"&&qn(e,i),{value:n,outcome:i}}}function Gn(e){return e==="production"?"silent":"banner"}var Oo=Gn("production");function zn(e,t){return e?.trim()||t}function Wo({legalName:e,foundedYear:t,siteName:n},r=new Date().getFullYear()){let o=zn(e,n);return`\xA9 ${t&&t<r?`${t}\u2013${r}`:`${r}`} ${o}`}var Xn={name:pe,legalName:null,foundedYear:null,faviconUrl:null,currencies:[],defaultCurrency:null,countries:[],defaultCountry:null,commerceEnabled:!0,cardPayments:!1,paymentMethods:[],paypalClientId:null,paypalEnvironment:null,squareApplicationId:null,squareLocationId:null,squareEnvironment:null,ga4MeasurementId:null,googleAdsId:null,googleAdsConversionLabel:null,metaPixelId:null,consentEnabled:!1,consentPrivacyPage:null,consentNoticeOptOut:!1,socialLinks:$e},qo=Kn(async()=>Bt("site",()=>Wt("site",async()=>{let e=await B.getSite();return{name:ut(e.name),legalName:e.legalName?.trim()||null,foundedYear:e.foundedYear??null,faviconUrl:e.faviconUrl??null,currencies:e.currencies??[],defaultCurrency:e.defaultCurrency??null,countries:e.countries??[],defaultCountry:e.defaultCountry??null,commerceEnabled:e.commerceEnabled??!0,cardPayments:e.cardPayments??!1,paymentMethods:e.paymentMethods??(e.cardPayments?["card"]:[]),paypalClientId:e.paypalClientId??null,paypalEnvironment:e.paypalEnvironment??null,squareApplicationId:e.squareApplicationId??null,squareLocationId:e.squareLocationId??null,squareEnvironment:e.squareEnvironment??null,ga4MeasurementId:e.ga4MeasurementId??null,googleAdsId:e.googleAdsId??null,googleAdsConversionLabel:(e.googleAdsId?e.googleAdsConversionLabel:null)??null,metaPixelId:e.metaPixelId??null,consentEnabled:e.consentEnabled??!1,consentPrivacyPage:e.consentPrivacyPage??null,consentNoticeOptOut:e.consentNoticeOptOut??!1,socialLinks:ct(e.socialLinks)}},Xn)));var Go={name:pe,legalName:null,foundedYear:null,faviconUrl:null,currencies:[{code:"USD",symbol:"$",decimalPlaces:2,isDefault:!0}],defaultCurrency:"USD",countries:[{code:"US",name:"United States",currency:"USD",url:"",isDefault:!0,chargeTax:!1,taxDisplay:"none",taxName:"",taxRate:null,postalLabel:"Zip Code"}],defaultCountry:"US",commerceEnabled:!0,cardPayments:!0,paymentMethods:["card"],paypalClientId:null,paypalEnvironment:null,squareApplicationId:null,squareLocationId:null,squareEnvironment:null,ga4MeasurementId:null,googleAdsId:null,googleAdsConversionLabel:null,metaPixelId:null,consentEnabled:!1,consentPrivacyPage:null,consentNoticeOptOut:!1,socialLinks:$e};import{jsx as Ce,jsxs as je}from"react/jsx-runtime";import{useEffect as ke,useId as Qn,useRef as Gt,useState as Te}from"react";import{efficientClientOpen as Vn}from"efficient-easel/screen/lib/session";var be=new Map,Yn=64;async function jn(e){if(!Vn())return null;try{let t=await fetch(`${lt()}/logo-analysis.json?url=${encodeURIComponent(e)}`);if(!t.ok)return null;let n=await t.json();if(!n||typeof n!="object")return null;let{reversed:r,inkIsDark:o}=n;return typeof r!="string"?null:{reversed:r,inkIsDark:typeof o=="boolean"?o:null}}catch{return null}}function qt(e){let t=be.get(e);if(t)return t;let n=jn(e);if(be.set(e,n),be.size>Yn){let r=be.keys().next();r.done||be.delete(r.value)}return n}var Zn=202/22,Jn=.88,ii=16,er="invert(1)";function ai({variant:e="header",scrolled:t=!0,src:n,reverse:r=!1,color:o=null,onLightSurface:i,reversedSrc:a,inkIsDark:s,size:c="medium",sizePx:u,wordmark:f,siteName:d=pe,fitToContainer:S=!1,fitWordmarkToContainer:R=!1,fitFloorPx:C}){let y=f&&f.trim()?f.trim():d,[w,O]=Te(!1),M=Gt(null),I=E=>{M.current=E};ke(()=>{let E=M.current?.ownerDocument??document,H=()=>{O(E.documentElement.getAttribute("data-theme")==="light")};H();let j=new MutationObserver(H);return j.observe(E.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),()=>j.disconnect()},[]);let v=n&&n.trim()?n.trim():null,x=!!v&&dt(v),W=i??(w&&t),A=o&&o.trim()?o.trim():null,q=r&&!A,b=`logo-color-${Qn().replace(/[^A-Za-z0-9_-]/g,"")}`,_=q&&x&&v&&a!=null?{reversed:a,inkIsDark:s??null}:null,p=_!==null,[G,Z]=Te(null);ke(()=>{if(!q||!v||!x||p){Z(null);return}let E=!1;return Z(null),qt(v).then(H=>{E||Z(H)}),()=>{E=!0}},[q,v,x,p]);let F=_??G,D=!!F&&F.inkIsDark!==null&&(W?!F.inkIsDark:F.inkIsDark),ve=q&&!!v&&!x&&!W,z=D&&F?F.reversed:v,K=z?[z]:[],[ue,J]=Te(0);ke(()=>{J(0)},[v,D]);let Ee=e==="footer"?We:Be[c],U=u&&u>0?u:Ee,Pe=Math.round(U*Zn),P=ue<K.length?K[ue]:null,[ee,te]=Te(z),ce=P!==null&&P===ee,de=Gt(null);ke(()=>{let E=de.current;if(!E||!E.complete)return;if(E.naturalWidth>0||E.naturalHeight>0){te(P);return}let H=!1;return E.decode().then(()=>!H&&te(P),()=>!H&&J(j=>j+1)),()=>{H=!0}},[P]);let ne=S||R,Y=`calc(100cqi / ${((y.length+1)*Jn).toFixed(2)})`,re=ne&&C&&C>0?Math.min(C,U):null,we=ne?re===null?`min(${U}px, ${Y})`:`clamp(${re}px, ${Y}, ${U}px)`:`${U}px`,_e=je("span",{className:`font-display font-bold tracking-[0.18em] ${re===null?"whitespace-nowrap":"whitespace-normal"}`,style:{fontSize:we,lineHeight:1,...A?{color:A}:{}},"aria-label":y,children:[y,Ce("span",{className:"text-accent",style:A?{color:A}:void 0,children:"."})]});return je("span",{ref:I,className:"inline-flex items-center",children:[!ce&&_e,A&&P&&Ce("svg",{"aria-hidden":"true",focusable:"false",width:"0",height:"0",style:{position:"absolute"},children:je("filter",{id:b,colorInterpolationFilters:"sRGB",children:[Ce("feFlood",{style:{floodColor:A}}),Ce("feComposite",{in2:"SourceAlpha",operator:"in"})]})}),P&&Ce("img",{ref:de,src:P,alt:y,width:Pe,height:U,className:"shrink-0 object-contain",style:{...ce?{height:`${U}px`,width:"auto",...S?{maxWidth:"100cqi"}:{}}:{display:"none"},...ve?{filter:er}:{},...A?{filter:`url(#${b})`}:{}},onLoad:()=>te(P),onError:()=>J(E=>E+1)},P)]})}import{jsx as xe,jsxs as nr}from"react/jsx-runtime";function tr({spokes:e,mesh:t=!1,className:n}){let a=c=>Math.round(c*1e3)/1e3,s=[];for(let c=0;c<e;c++){let u=c/e*Math.PI*2-Math.PI/2;if(s.push({x1:a(100+Math.cos(u)*22),y1:a(100+Math.sin(u)*22),x2:a(100+Math.cos(u)*86),y2:a(100+Math.sin(u)*86),main:!0}),t){let f=u+Math.PI/e;s.push({x1:a(100+Math.cos(f)*22*1.4),y1:a(100+Math.sin(f)*22*1.4),x2:a(100+Math.cos(f)*78),y2:a(100+Math.sin(f)*78),main:!1})}}return nr("svg",{viewBox:"0 0 200 200",fill:"none",stroke:"currentColor",className:n??"block h-[70%] w-[70%] transition-transform duration-700 [transition-timing-function:cubic-bezier(.2,.6,.2,1)]",children:[xe("circle",{cx:100,cy:100,r:92,strokeWidth:2}),xe("circle",{cx:100,cy:100,r:84,strokeWidth:1,opacity:.4}),xe("circle",{cx:100,cy:100,r:22,strokeWidth:2}),xe("circle",{cx:100,cy:100,r:6,fill:"currentColor"}),s.map((c,u)=>xe("line",{x1:c.x1,y1:c.y1,x2:c.x2,y2:c.y2,stroke:"currentColor",strokeWidth:c.main?6:3,strokeLinecap:"round",opacity:c.main?1:.5},u))]})}var ci="#c9a461",Kt=[{f:"black",label:"Black",hex:"#171717"},{f:"silver",label:"Silver",hex:"#cccccc"},{f:"bronze",label:"Bronze",hex:"#8a6438"},{f:"graphite",label:"Graphite",hex:"#3a3c3f"},{f:"red",label:"Candy Red",hex:"#7a0f14"}],di={name:"",color:"var(--fg)",family:"silver",src:""};function rr(e,t){let n=r=>{let o=Kt.findIndex(i=>i.f===r);return o===-1?Kt.length:o};return n(e)-n(t)||e.localeCompare(t)}function fi(e){let t=new Set;for(let n of e)for(let r of n.finishes??[])r?.family&&t.add(r.family);return[...t].sort(rr)}import{useState as or}from"react";import{jsx as le,jsxs as Qe}from"react/jsx-runtime";function ir({customerEmail:e}){let{coupon:t,applyCoupon:n,removeCoupon:r,couponBusy:o}=Ht(),[i,a]=or("");async function s(){o||!i.trim()||(await n(i,e),a(""))}return Qe("div",{className:"flex flex-col gap-2",children:[t===null?Qe("div",{className:"flex border border-line",children:[le("input",{type:"text",value:i,onChange:c=>a(c.target.value),onKeyDown:c=>{c.key==="Enter"&&(c.preventDefault(),s())},placeholder:"Coupon code","aria-label":"Coupon code",className:"flex-1 bg-transparent px-4 py-4 font-mono text-[11px] uppercase tracking-[0.18em] text-fg outline-none placeholder:text-fg-dim"}),le("button",{type:"button",onClick:()=>{s()},disabled:o,className:"border-l border-line px-4 font-mono text-[10px] uppercase tracking-[0.26em] text-btn transition-colors hover:bg-btn hover:text-btn-ink disabled:cursor-wait disabled:opacity-60",children:o?"\u2026":"Apply"})]}):Qe("div",{className:["flex items-center justify-between gap-3 border px-4 py-3",t.valid?"border-accent":"border-line"].join(" "),style:t.valid?{background:"color-mix(in oklab, var(--accent) 8%, transparent)"}:void 0,children:[le("span",{className:["font-mono text-[11px] uppercase tracking-[0.22em]",t.valid?"text-accent":t.deferred?"text-fg":"text-fg-dim line-through"].join(" "),children:t.code}),le("button",{type:"button",onClick:r,"aria-label":`Remove coupon ${t.code}`,className:"font-mono text-[12px] text-fg-dim transition-colors hover:text-fg",children:"\u2715"})]}),t?.deferred?le("p",{className:"font-mono text-[10px] uppercase tracking-[0.18em] text-fg-dim",children:Pt}):t&&!t.valid&&t.message&&le("p",{className:"font-mono text-[10px] uppercase tracking-[0.18em] text-alert",children:t.message})]})}var Ze="Ads on. Shopper can opt out.",Oe="Ads and analytics off until Accept",ar={us:{region:"us",name:"United States",model:"opt-out",law:"California CCPA / CPRA, other state laws",beforeChoice:Ze,footerLink:"Do Not Sell or Share My Personal Information",panelEyebrow:"Do not sell or share",adsRowName:"Sale or sharing for ads"},ca:{region:"ca",name:"Canada",model:"opt-in",law:"PIPEDA, Quebec Law 25",beforeChoice:Oe,footerLink:"Privacy choices",panelEyebrow:"Privacy choices",adsRowName:"Advertising"},au:{region:"au",name:"Australia",model:"opt-out",law:"Privacy Act 1988 (APPs)",beforeChoice:Ze,footerLink:"Privacy choices",panelEyebrow:"Privacy choices",adsRowName:"Advertising"},nz:{region:"nz",name:"New Zealand",model:"opt-out",law:"Privacy Act 2020",beforeChoice:Ze,footerLink:"Privacy choices",panelEyebrow:"Privacy choices",adsRowName:"Advertising"},uk:{region:"uk",name:"United Kingdom",model:"opt-in",law:"PECR, UK GDPR",beforeChoice:Oe,footerLink:"Cookie settings",panelEyebrow:"Cookie settings",adsRowName:"Advertising"},eu:{region:"eu",name:"European Union",model:"opt-in",law:"ePrivacy Directive, GDPR",beforeChoice:Oe,footerLink:"Cookie settings",panelEyebrow:"Cookie settings",adsRowName:"Advertising"},other:{region:"other",name:"All other countries",model:"opt-in",law:"Safe default",beforeChoice:Oe,footerLink:"Cookie settings",panelEyebrow:"Cookie settings",adsRowName:"Advertising"}};function sr(e){let t=[...e.googleAds?["Google"]:[],...e.meta?["Facebook","Instagram"]:[]];return t.length<=1?t.join(""):`${t.slice(0,-1).join(", ")} and ${t[t.length-1]}`}function Ci(e,t,n){let r=sr(n),o=r?`We use cookies to count visits and to show you ${t} ads on ${r}.`:"We use cookies to count visits.";return e.model==="opt-in"?{heading:r?"Cookies and ads":"Cookies",before:`${o} Nothing loads until you choose. You can change this at any time with `,link:e.footerLink,after:" at the bottom of every page."}:{heading:r?"Cookies and ads":"Cookies",before:`${o} You can say no at any time: choose Privacy choices, or use `,link:e.footerLink,after:" at the bottom of every page."}}var xi={accept:"Accept all",reject:"Reject all",choose:"Choose",save:"Save",ok:"OK",privacyChoices:"Privacy choices",privacyPolicy:"Privacy Policy",alwaysOn:"Always on"};var lr={asked:!1,region:"other",model:"opt-in",analytics:!0,ads:!0,chosen:!0,gpc:!1};var ur=lr;function Pi(e=ur){if(e.asked)return e.ads?"granted":"denied"}function _i(){let e=typeof crypto<"u"?crypto:void 0;if(typeof e?.randomUUID=="function")return e.randomUUID();let t=new Uint8Array(16);if(typeof e?.getRandomValues=="function")e.getRandomValues(t);else for(let r=0;r<t.length;r++)t[r]=Math.floor(Math.random()*256);t[6]=t[6]&15|64,t[8]=t[8]&63|128;let n=Array.from(t,r=>r.toString(16).padStart(2,"0")).join("");return`${n.slice(0,8)}-${n.slice(8,12)}-${n.slice(12,16)}-${n.slice(16,20)}-${n.slice(20)}`}import{Children as dr,isValidElement as fr,useEffect as Xt,useId as pr,useLayoutEffect as jt,useRef as X,useState as Vt}from"react";var Me=(e,t)=>!!e[t]&&!e[t].disabled;function Je(e,t,n){let r=e.length;for(let o=1;o<=r;o++){let i=((t+n*o)%r+r)%r;if(Me(e,i))return i}return t}function et(e,t){return Je(e,t===1?-1:e.length,t)}function tt(e,t){return Me(e,t)?t:Math.max(et(e,1),0)}function zt(e,t,n){let{open:r,focus:o}=e,i=a=>({...e,...a});if(t.length===1&&/\S/.test(t)){let a=e.typed+t.toLowerCase(),s=n.findIndex((c,u)=>Me(n,u)&&c.label.toLowerCase().startsWith(a));return{state:i({open:!0,typed:a,focus:s>=0?s:o}),handled:!0}}if(!r)return t==="ArrowDown"||t==="ArrowUp"||t==="Enter"||t===" "?{state:i({open:!0,typed:""}),handled:!0}:{state:e,handled:!1};switch(t){case"ArrowDown":return{state:i({focus:Je(n,o,1)}),handled:!0};case"ArrowUp":return{state:i({focus:Je(n,o,-1)}),handled:!0};case"Home":return{state:i({focus:et(n,1)}),handled:!0};case"End":return{state:i({focus:et(n,-1)}),handled:!0};case"Enter":case" ":return Me(n,o)?{state:i({open:!1,typed:""}),commit:o,refocus:!0,handled:!0}:{state:e,handled:!0};case"Escape":return{state:i({open:!1,typed:""}),refocus:!0,handled:!0};case"Tab":return{state:i({open:!1,typed:""}),handled:!1};default:return{state:e,handled:!1}}}import{placeMenu as mr}from"efficient-shell/ui";import{Fragment as xr,jsx as V,jsxs as Qt}from"react/jsx-runtime";var Yt={body:"text-[length:var(--size-body,14px)]",label:"text-[length:var(--size-label,13px)]"};function gr({items:e,value:t,onPick:n,open:r,onOpen:o,onClose:i}){let[a,s]=Vt(!1),c=r!==void 0,u=c?r:a,[f,d]=Vt(0),S=X({text:"",timer:0}),R=X(null),C=X(null),y=X(null),w=pr(),O=X(null),M=e.findIndex(b=>b.value===t),I=b=>{b!==u&&(c||s(b),b?o?.():i?.())},v=b=>{let _=e[b];!_||_.disabled||(n(_.value),I(!1),C.current?.focus())},x=b=>{let _={open:u,focus:u?f:tt(e,M),typed:S.current.text},p=zt(_,b,e);return!p.handled&&p.state.open===u?!1:(p.state.typed!==_.typed&&(S.current.text=p.state.typed,window.clearTimeout(S.current.timer),S.current.timer=window.setTimeout(()=>{S.current.text=""},500)),d(p.state.focus),p.commit!==void 0?v(p.commit):I(p.state.open),p.refocus&&C.current?.focus(),p.handled)},W=X(x);W.current=x;let A=X(()=>I(!1));A.current=()=>I(!1);let q=b=>{u||(O.current=b.nativeEvent,W.current(b.key)&&b.preventDefault())};return Xt(()=>{if(!u)return;let b=p=>{R.current?.contains(p.target)||A.current()},_=p=>{p!==O.current&&W.current(p.key)&&p.preventDefault()};return document.addEventListener("mousedown",b),document.addEventListener("keydown",_),()=>{document.removeEventListener("mousedown",b),document.removeEventListener("keydown",_)}},[u]),Xt(()=>{u&&(S.current.text||d(tt(e,M)))},[u]),jt(()=>{if(!u||!y.current)return;y.current.children.item(f)?.scrollIntoView({block:"nearest"})},[f,u]),{open:u,toggle:()=>I(!u),close:()=>I(!1),focusIdx:f,setFocusIdx:d,pick:b=>v(e.findIndex(_=>_.value===b)),wrapRef:R,triggerRef:C,listRef:y,listId:w,onTriggerKeyDown:q,activeId:u?`${w}-${f}`:void 0}}var hr={select:{list:"absolute left-0 top-full z-50 mt-1 max-h-[280px] w-max min-w-full overflow-y-auto border-2 border-accent bg-bg shadow-xl",item:(e,t,n)=>["px-3 py-3 font-mono text-[13px] font-semibold uppercase tracking-[0.1em] transition-colors whitespace-nowrap",n?"cursor-not-allowed opacity-40":"cursor-pointer",e&&!n?"bg-accent text-bg":"bg-bg text-fg"].join(" ")},cell:{list:"absolute left-0 top-full z-50 mt-1 max-h-[320px] w-max min-w-full overflow-y-auto border-2 border-accent bg-bg shadow-xl",item:e=>[`cursor-pointer whitespace-nowrap px-6 py-3 font-mono ${Yt.label} font-semibold uppercase tracking-[0.1em] transition-colors`,e?"bg-accent text-bg":"bg-bg text-fg"].join(" "),pickerMarker:!0},hairline:{list:"absolute left-0 top-full z-50 max-h-[320px] w-full overflow-y-auto border border-line bg-bg shadow-[0_6px_20px_rgba(0,0,0,0.10)]",item:(e,t)=>[`flex cursor-pointer items-center justify-between gap-4 border-b border-line px-4 py-3 text-left ${Yt.body} transition-colors last:border-b-0`,t?"border-fg font-medium text-fg":e?"border-fg text-fg":"text-fg-dim"].join(" "),pickerMarker:!0},region:{list:"absolute right-0 top-full z-[200] mt-2 flex min-w-[240px] flex-col border border-line bg-surface text-fg",item:(e,t,n,r)=>["flex w-full cursor-pointer items-center gap-3 px-4 py-3 text-left transition-colors","font-mono text-[13px] uppercase tracking-[0.18em]",e?"bg-surface-2 text-fg":"",r?"":"border-b border-line",t?"text-accent":""].join(" "),itemStyle:e=>e?void 0:{color:"color-mix(in oklab, currentColor 80%, transparent)"}}};function yr(e,t){jt(()=>{let n=e.current,r=n?.ownerDocument.defaultView;if(!n||!r)return;let o=()=>{let i=n.style;i.top=i.bottom=i.marginTop=i.marginBottom=i.maxHeight=i.overflowY=i.translate="";let a=n.offsetParent??n.parentElement;if(!a)return;let s=a.getBoundingClientRect(),c=n.getBoundingClientRect(),u=Math.abs(c.right-s.right)<Math.abs(c.left-s.left)?"end":"start",f=mr({trigger:{left:s.left,right:s.right,top:s.top,bottom:s.bottom},menu:{width:c.width,height:c.height},bounds:{left:0,top:0,right:r.innerWidth,bottom:r.innerHeight},align:u,side:"bottom"});if(f.side==="top"){i.top="auto",i.bottom="100%",i.marginTop="0px";let S=f.top+Math.min(c.height,f.maxHeight);i.marginBottom=`${Math.max(0,s.top-S)}px`}f.maxHeight<c.height&&(i.maxHeight=`${f.maxHeight}px`,i.overflowY="auto");let d=f.left-c.left;d&&(i.translate=`${d}px`)};return o(),r.addEventListener("resize",o),r.addEventListener("scroll",o,!0),()=>{r.removeEventListener("resize",o),r.removeEventListener("scroll",o,!0)}},[e,t])}function br({id:e,tone:t,items:n,value:r,focusIdx:o,onFocus:i,onPick:a,listRef:s,ariaLabel:c}){let u=hr[t],f=X(null);return yr(f,n.length),V("ul",{ref:d=>{f.current=d,s&&(s.current=d)},id:e,role:"listbox","aria-label":c,...u.pickerMarker?{"data-picker-menu":""}:{},className:u.list,children:n.map((d,S)=>{let R=d.value===r;return V("li",{id:`${e}-${S}`,role:"option","aria-selected":R,"aria-disabled":d.disabled||void 0,onMouseEnter:()=>!d.disabled&&i(S),onMouseDown:C=>{C.preventDefault(),d.disabled||a(d.value)},className:u.item(S===o,R&&d.value!=="",!!d.disabled,S===n.length-1),style:u.itemStyle?.(R),children:d.meta===void 0?d.label:Qt(xr,{children:[d.lead,V("span",{className:"flex-1 whitespace-nowrap",children:d.label}),V("span",{className:"ml-auto text-[12px] opacity-50",children:d.meta})]})},`${d.value}_${S}`)})})}function Cr({value:e,onChange:t,disabled:n,children:r,className:o,style:i,name:a,id:s,"aria-label":c}){let u=dr.toArray(r).flatMap(C=>{if(!fr(C))return[];if(C.type!=="option")return[];let w=C.props,O=w.value!==void 0?String(w.value):"",M=w.children,I=typeof M=="string"||typeof M=="number"?String(M):O;return[{value:O,label:I,disabled:!!w.disabled}]}),f=e??"",d=gr({items:u,value:f,onPick:C=>t?.({target:{value:C}})}),R=u.find(C=>C.value===f)?.label??u[0]?.label??"";return Qt("div",{ref:d.wrapRef,className:"relative",children:[a&&V("input",{type:"hidden",name:a,value:f}),V("button",{ref:C=>{d.triggerRef.current=C},type:"button",disabled:n,"aria-haspopup":"listbox","aria-expanded":d.open,"aria-controls":d.open?d.listId:void 0,"aria-activedescendant":d.activeId,"aria-label":c,id:s,onClick:()=>!n&&d.toggle(),onKeyDown:C=>!n&&d.onTriggerKeyDown(C),className:`block w-full ${o??""}`,style:i,children:V("span",{className:"block w-full truncate text-left",children:R})}),d.open&&V(br,{id:d.listId,tone:"select",items:u,value:f,focusIdx:d.focusIdx,onFocus:d.setFocusIdx,onPick:d.pick,listRef:d.listRef})]})}import{jsx as Se,jsxs as De}from"react/jsx-runtime";var Sr="font-mono text-[length:var(--size-label,12px)]",vr="font-semibold uppercase tracking-[0.22em] text-fg";function Zt(e){return`${e??Sr} ${vr}`}function Jt(){return Se("span",{className:"text-accent",children:" *"})}function Er({children:e,required:t,labelFace:n}){return De("span",{className:Zt(n),children:[e,t?Se(Jt,{}):null]})}function Pr({label:e,required:t,hint:n,separate:r,htmlFor:o,labelFace:i,className:a,children:s}){let c=a?`flex flex-col gap-2 ${a}`:"flex flex-col gap-2",u=n?Se("span",{className:"font-mono text-[11px] uppercase tracking-[0.22em] text-fg-dim",children:n}):null;return r||n?De("div",{className:c,children:[De("label",{htmlFor:o,className:Zt(i),children:[e,t?Se(Jt,{}):null]}),s,u]}):De("label",{htmlFor:o,className:c,children:[Se(Er,{required:t,labelFace:i,children:e}),s]})}export{Br as a,Wr as b,qr as c,gt as d,qe as e,wr as f,_r as g,Rr as h,Nr as i,sn as j,ln as k,Lr as l,Ir as m,Ge as n,Ne as o,ge as p,Ar as q,Le as r,hn as s,yn as t,Xr as u,Vr as v,_t as w,Xe as x,Yr as y,jr as z,Cn as A,Qr as B,Zr as C,xn as D,Jr as E,vn as F,eo as G,to as H,Rt as I,so as J,lo as K,uo as L,po as M,mo as N,Dr as O,St as P,Fr as Q,Ie as R,Ye as S,_o as T,Ht as U,Wo as V,Xn as W,Go as X,ii as Y,ai as Z,tr as _,ci as $,Kt as aa,di as ba,rr as ca,fi as da,ir as ea,ar as fa,Ci as ga,xi as ha,lr as ia,Pi as ja,_i as ka,gr as la,br as ma,Cr as na,Er as oa,Pr as pa};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as V,c as C,g as z,i as $,j,l as O}from"./chunk-B44XQA2J.js";var U="".replace(/\/+$/,"");var B="x-forwarded-for";function Z(e){let t=(e??"").split(",").map(n=>n.trim()).filter(Boolean);return t.length>0?t[t.length-1]:null}var Ee="x-forwarded-host";function Q(e,t,n){let r={};return e&&(r[Ee]=e),t&&n==="uncached"&&(r[B]=t),r}function X(e){if(e?.cache==="no-store"||e?.cache==="no-cache")return"uncached";if(e?.cache==="force-cache")return"data-cached";let t=e?.next?.revalidate;return typeof t=="number"&&t>0?"data-cached":"uncached"}var Y="x-storefront-site",ee="x-storefront-host",te="x-storefront-preview";var Fe="shop_access_token",ne="shop_refresh_token",N=null;function L(){O.removeItem(Fe),O.removeItem(ne)}var w={getAccess(){return N},takeLegacyRefresh(){let e=O.getItem(ne);return L(),e},setTokens(e){N=e,L()},clear(){N=null,L()}};import{efficientClientOpen as Ze}from"efficient-easel/screen/lib/session";function Ie(e){return!!e.src}function A(e){let t=e.finishes.filter(Ie);if(t.length===e.finishes.length)return e;let n=e.defaultFinish&&t.some(r=>r.name===e.defaultFinish)?e.defaultFinish:null;return{...e,finishes:t,defaultFinish:n}}function qe(e){return e.listable!==!1}function M(e){return e.map(A).filter(qe)}var oe=["fill","stroke","stop-color","color","flood-color","lighting-color","solid-color"],ae=new Set(["none","transparent","currentcolor","inherit","initial","unset","context-fill","context-stroke"]),v={black:[0,0,0],white:[255,255,255],gray:[128,128,128],grey:[128,128,128],darkgray:[169,169,169],darkgrey:[169,169,169],dimgray:[105,105,105],dimgrey:[105,105,105],lightgray:[211,211,211],lightgrey:[211,211,211],gainsboro:[220,220,220],silver:[192,192,192],whitesmoke:[245,245,245]},ce=12,le=/\burl\(/i,ue=new RegExp(`(?<![-\\w])(${oe.join("|")})(\\s*=\\s*)(["'])([^"']*)\\3`,"gi"),me=new RegExp(`((?:^|[;{\\s"'])(?:${oe.join("|")})\\s*:\\s*)([^;}"'<>]+)`,"gi"),$e=/<svg\b([^>]*)>/i,Ue=/\bfill\s*[=:]/i;function Be(e){let t=e.replace(ue,(n,r,a,l,d)=>{let s=re(d);return s===null?n:`${r}${a}${l}${s}${l}`}).replace(me,(n,r,a)=>{let l=re(a);return l===null?n:`${r}${l}`});return t=t.replace($e,(n,r)=>Ue.test(r)?n:`<svg fill="#ffffff"${r}>`),t}function re(e){let t=/!important/i.test(e),n=e.replace(/!important/gi,"").trim().toLowerCase();if(!n||le.test(n)||ae.has(n))return null;let r=n in v?[...v[n],1]:pe(n);if(!r)return null;let[a,l,d,s]=r;if(Math.max(a,l,d)-Math.min(a,l,d)>ce)return null;let i=Ne(255-a,255-l,255-d,s);return t?`${i} !important`:i}function Ne(e,t,n,r){if(r<1)return`rgba(${e}, ${t}, ${n}, ${r})`;let a=l=>l.toString(16).padStart(2,"0");return`#${a(e)}${a(t)}${a(n)}`}function pe(e){return e.startsWith("#")?Le(e):e.startsWith("rgb")?Me(e):e.startsWith("hsl")?He(e):null}function Le(e){let t=e.slice(1),n=1;if(t.length===3||t.length===4)t.length===4&&(n=parseInt(t[3]+t[3],16)/255),t=t.slice(0,3).split("").map(r=>r+r).join("");else if(t.length===6||t.length===8)t.length===8&&(n=parseInt(t.slice(6,8),16)/255),t=t.slice(0,6);else return null;return/^[0-9a-f]{6}$/.test(t)?[parseInt(t.slice(0,2),16),parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16),n]:null}function Me(e){let t=e.slice(e.indexOf("(")+1,e.lastIndexOf(")")),[n,r]=t.split("/"),a=n.split(/[\s,]+/).filter(Boolean).slice(0,3);if(a.length<3)return null;let l=a.map(s=>s.endsWith("%")?Math.round(parseFloat(s)/100*255):Math.round(parseFloat(s)));if(l.some(s=>Number.isNaN(s)))return null;let d=r?E(r):De(n);return[l[0],l[1],l[2],d]}function De(e){let t=e.split(/[\s,]+/).filter(Boolean);return t.length>=4?E(t[3]):1}function E(e){let t=e.trim().endsWith("%")?parseFloat(e)/100:parseFloat(e);return Number.isNaN(t)?1:t}function He(e){let t=e.slice(e.indexOf("(")+1,e.lastIndexOf(")")),[n,r]=t.split("/"),a=n.split(/[\s,]+/).filter(Boolean);if(a.length<3)return null;let l=parseFloat(a[0]),d=parseFloat(a[1])/100,s=parseFloat(a[2])/100;if([l,d,s].some(P=>Number.isNaN(P)))return null;let i=r?E(r):a.length>=4?E(a[3]):1,[o,u,g]=Je(l,d,s);return[o,u,g,i]}function Je(e,t,n){let r=(1-Math.abs(2*n-1))*t,a=(e%360+360)%360/60,l=r*(1-Math.abs(a%2-1)),d=0,s=0,i=0;a<1?[d,s,i]=[r,l,0]:a<2?[d,s,i]=[l,r,0]:a<3?[d,s,i]=[0,r,l]:a<4?[d,s,i]=[0,l,r]:a<5?[d,s,i]=[l,0,r]:[d,s,i]=[r,0,l];let o=n-r/2;return[Math.round((d+o)*255),Math.round((s+o)*255),Math.round((i+o)*255)]}var se=512*1024;function D(e){return/\.svg(\?|$)/i.test(e)}function We(e){return`data:image/svg+xml,${encodeURIComponent(Be(e))}`}function Ge(e){let t=e.replace(/!important/gi,"").trim().toLowerCase();if(!t||le.test(t)||ae.has(t))return null;let n=t in v?[...v[t],1]:pe(t);if(!n)return null;let[r,a,l]=n;return Math.max(r,a,l)-Math.min(r,a,l)>ce?null:(.2126*r+.7152*a+.0722*l)/255}function Ke(e){let t=[],n=r=>{let a=Ge(r);a!==null&&t.push(a)};for(let r of e.matchAll(ue))n(r[4]);for(let r of e.matchAll(me))n(r[2]);return t.length?t.reduce((r,a)=>r+a,0)/t.length<.5:null}var ie=/^(?:\uFEFF|\s+|<\?xml[^>]*\?>|<!--[\s\S]*?-->|<!DOCTYPE\s+svg[^>[]*>)/i;function Ve(e){let t=e;for(let n=ie.exec(t);n&&n[0].length>0;n=ie.exec(t))t=t.slice(n[0].length);return/^<svg[\s>/]/i.test(t)}async function ze(e,t){if(!D(e))return null;try{let n=await fetch(e,{signal:t,redirect:"manual"});if(!n.ok)return null;let r=Number(n.headers.get("content-length"));if(Number.isFinite(r)&&r>se)return null;let a=await n.text();return a.length>se?null:Ve(a)?a:null}catch{return null}}async function de(e,t){let n=await ze(e,t);return n===null?null:{reversed:We(n),inkIsDark:Ke(n)}}import{currentEaselSession as je,setSessionBridgedSite as Mt,setSessionDocumentSite as Dt}from"efficient-easel/screen/lib/session";function ge(){return je().siteId()}var Qe="",f=class extends Error{constructor(t,n,r){super(n),this.status=t,this.data=r}},W="Unable to reach the server. This could be a problem with your internet connection, or the server may be undergoing maintenance or an upgrade. Please try again shortly.",Xe=new Set([502,503,504]),H=0,Ye="This editor runs on its host's own backend, which does not serve this request.",et=5e3,tt=15e3,nt=()=>typeof window>"u"?et:tt;function Ae(e){let t=(e.method??"GET").toUpperCase();if(!(e.body!=null||t!=="GET"&&t!=="HEAD")&&!(e.audience!=null&&e.audience!=="shop")&&typeof AbortSignal?.timeout=="function")return AbortSignal.timeout(nt())}var he=e=>e instanceof Error&&e.name==="TimeoutError",ye=(e,t)=>Xe.has(e)?W:t,rt=["admin","venue"],Re="admin";function Qt(e){Re=rt.includes(e)?e:"admin"}function st(){return Re}var it=/^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{1,8})*$/,_e=null;function Xt(e){_e=e&&it.test(e)?e:null}function ot(){return _e}function at(e){if(typeof window>"u"||!e.startsWith("/api/v1/"))return e;let t=$();return!t||/[?&]site=/.test(e)?e:q(e,`site=${encodeURIComponent(t)}`)}async function c(e,t={}){let{token:n,baseUrl:r,headers:a,audience:l,...d}=t;if(typeof window<"u"&&!Ze())throw new f(H,Ye,null);if(typeof window>"u"&&r===void 0)throw new Error(`apiFetch(${JSON.stringify(e)}) ran on the server without an explicit baseUrl. The API_URL default it would inherit is browser-only (the prod image bakes NEXT_PUBLIC_API_URL="" for same-origin use, which a Node fetch cannot resolve). Pass a base explicitly: \`await backendOpts()\` (or baseUrl: PRODUCT_FETCH_BASE) for product reads, or the server-only PRODUCT_BACKEND_URL env for other backend surfaces.`);let s=typeof FormData<"u"&&d.body instanceof FormData,i;try{i=await fetch(`${r??Qe}${at(e)}`,{...d,headers:{...s?{}:{"Content-Type":"application/json"},...n?{Authorization:`Bearer ${n}`}:{},...l===null?{}:{"X-Portal-Audience":l??"shop"},...a},signal:d.signal??Ae({...d,audience:l})})}catch(g){throw g instanceof TypeError||he(g)?new f(H,W,null):g}let o;try{o=await i.text()}catch(g){throw he(g)?new f(H,W,null):g}let u=null;if(o)try{u=JSON.parse(o)}catch{throw new f(i.status,i.ok?"Expected JSON but received a non-JSON response":ye(i.status,i.statusText),o)}if(!i.ok){let g=(u&&typeof u=="object"&&"detail"in u&&typeof u.detail=="string"?u.detail:null)??ye(i.status,i.statusText);throw new f(i.status,g,u)}return u}var R=null;async function ke(){return R||(R=ct().finally(()=>{R=null}),R)}async function ct(){let e=w.takeLegacyRefresh(),t=await lt.refresh(e??void 0);return w.setTokens(t.access),t.access}async function xe(){return w.getAccess()??ke()}async function h(e,t={}){let n;try{n=await xe()}catch{throw w.clear(),new f(401,"Not signed in",null)}try{return await c(e,{...t,token:n})}catch(r){if(!(r instanceof f)||r.status!==401)throw r;try{let a=await ke();return await c(e,{...t,token:a})}catch{throw w.clear(),r}}}async function fe(e,t={}){if(w.getAccess())try{return{data:await h(e,t),asShopper:!0}}catch(n){if(!(n instanceof f)||n.status!==401)throw n}return{data:await c(e,t),asShopper:!1}}async function Se(){let e=await h("/api/auth/me/");if(e.portal!=="shop")throw w.clear(),new f(403,"This session is not valid for this shop.",null);return e}var lt={login:(e,t)=>c("/api/auth/login/",{method:"POST",body:JSON.stringify({email:e,password:t,portal:"shop"}),credentials:"include"}),refresh:e=>c("/api/auth/refresh/",{method:"POST",body:JSON.stringify(e?{refresh:e,portal:"shop"}:{portal:"shop"}),credentials:"include"}),logout:async()=>{w.clear();try{await c("/api/auth/logout/",{method:"POST",body:JSON.stringify({portal:"shop"}),credentials:"include"})}catch{}},restoreSession:async()=>{let e=await xe();return await Se(),e},me:Se,updateMe:e=>h("/api/auth/me/",{method:"PATCH",body:JSON.stringify(e)}),changePassword:(e,t)=>h("/api/auth/me/",{method:"PATCH",body:JSON.stringify({password:t,old_password:e})}),changeEmail:(e,t)=>h("/api/shop-portal/change-email/",{method:"POST",body:JSON.stringify({new_email:e,current_password:t})}),myProfile:()=>h("/api/shop-portal/profile/"),updateMyProfile:e=>h("/api/shop-portal/profile/",{method:"PATCH",body:JSON.stringify(e)}),myAddresses:()=>h("/api/shop-portal/delivery-locations/"),createAddress:e=>h("/api/shop-portal/delivery-locations/",{method:"POST",body:JSON.stringify(e)}),updateAddress:(e,t)=>h(`/api/shop-portal/delivery-locations/${e}/`,{method:"PATCH",body:JSON.stringify(t)}),deleteAddress:e=>h(`/api/shop-portal/delivery-locations/${e}/`,{method:"DELETE"}),passwordResetRequest:e=>c("/api/auth/password-reset/",{method:"POST",body:JSON.stringify({email:e})}),passwordResetConfirm:(e,t,n)=>c("/api/auth/password-reset/confirm/",{method:"POST",body:JSON.stringify({uid:e,token:t,new_password:n})}),brands:()=>h("/api/products/brands/"),myOrders:()=>h("/api/shop-portal/orders/").then(e=>e.results),myOrder:e=>h(`/api/shop-portal/orders/${e}/`),cancelOrder:e=>h(`/api/shop-portal/orders/${e}/cancel/`,{method:"POST"}),myReturns:e=>h(`/api/shop-portal/returns/${e?`?order=${encodeURIComponent(e)}`:""}`).then(t=>t.results),createReturn:e=>h("/api/shop-portal/returns/",{method:"POST",body:JSON.stringify(e)}),withdrawReturn:e=>h(`/api/shop-portal/returns/${e}/cancel/`,{method:"POST"}),uploadReturnPhoto:(e,t)=>{let n=new FormData;return n.append("claim_item",e),n.append("file",t),n.append("media_type",t.type.startsWith("video/")?"video":"image"),h("/api/shop-portal/return-media/",{method:"POST",body:n})}};function S(e){if(typeof e=="string")return e.startsWith("/media/")?V(e):e;if(Array.isArray(e))return e.map(S);if(e&&typeof e=="object"){let t={};for(let[n,r]of Object.entries(e))t[n]=n==="captions"&&r&&typeof r=="object"&&!Array.isArray(r)?Object.fromEntries(Object.entries(r).map(([a,l])=>[S(a),l])):S(r);return t}return e}var Te=typeof window>"u"&&U!=="",ut=Te?U:"",mt=j,b=()=>({baseUrl:mt(),audience:null});function m(e,t){let n=t?`?process=${encodeURIComponent(t)}`:"";return`/api/v1${e}${n}`}var pt=100,Pe=50;function Ce(e,t,n){let r=new URLSearchParams;for(let[a,l]of Object.entries(t))l!=null&&l!==""&&r.set(a,String(l));return r.set("pageSize",String(pt)),n&&r.set("cursor",n),`/api/v1${e}?${r.toString()}`}function dt(e,t){return Ce("/wheels",{process:e},t)}function gt(e,t,n){return Ce("/products",{kind:e.join(","),make:t?.make,model:t?.model,year:t?.year,modification:t?.modification},n)}function ht(e){if(!e)return null;try{return new URL(e,"http://cursor.invalid").searchParams.get("cursor")}catch{return null}}async function we(e,t,n=()=>!1){let r=[],a=null;try{for(let l=0;l<Pe;l++){let d=await c(await t(a),await p());if(r.push(...d.results),a=ht(d.next),!a)break}a&&console.warn(`[${e}] stopped at ${Pe} pages (${r.length} rows); catalog may be truncated`)}catch(l){if(n(l))throw l;console.warn(`[${e}] product API unavailable, returning []`,l)}return r}var yt=e=>e instanceof f&&e.status===400;function ft(e){return e.flatMap(t=>t.kind==="alloy-wheel"?M([t]):[t])}async function Oe(){return(await St()).host}async function St(){try{let{headers:e}=await import("./headers-UYHEZDAT.js"),t=await e(),n=l=>l?.split(",")[0]?.split(":")[0]?.trim().toLowerCase()||null,r=n(t.get(ee)??t.get("x-forwarded-host")??t.get("host")),a=n(t.get("host"));return{host:r,matchesRequestHost:r!==null&&r===a}}catch{return{host:null,matchesRequestHost:!1}}}async function Pt(){try{let{headers:e}=await import("./headers-UYHEZDAT.js");return Z((await e()).get(B))}catch{return null}}async function wt(){try{let{headers:e}=await import("./headers-UYHEZDAT.js");return(await e()).get(Y)||null}catch{return null}}async function bt(){let e=await wt();if(e)return`site=${encodeURIComponent(e)}`;let t=await Oe();return t?`host=${encodeURIComponent(t)}`:""}async function y(e){if(typeof window<"u"){let t=$();return t?q(e,`site=${encodeURIComponent(t)}`):e}return q(e,await bt())}function q(e,t){return t?`${e}${e.includes("?")?"&":"?"}${t}`:e}var At="preview";async function Rt(){if(typeof window<"u")return null;try{let{headers:e}=await import("./headers-UYHEZDAT.js");return(await e()).get(te)}catch{return null}}async function _t(){try{let{headers:e}=await import("./headers-UYHEZDAT.js");return(await e()).get("user-agent")}catch{return null}}async function J(e,t){let n=await Rt();if(n===null)return[await y(e),await p(t)];let r=q(await y(e),`${At}=${encodeURIComponent(n)}`),{next:a,cache:l,...d}=t??{},s=await p({...d,cache:"no-store"}),i=await _t();return i&&(s.headers={...s.headers,"user-agent":i}),[r,s]}async function kt(e){if(!Te)return;let[t,n]=await Promise.all([Oe(),Pt()]),r=Q(t,n,e);return Object.keys(r).length>0?r:void 0}async function p(e){let t=await kt(X(e)),n={baseUrl:ut,...e};return t&&(n.headers={...t,...e?.headers}),n}var _=typeof window>"u";function k(e,t){let n=new URLSearchParams;for(let[a,l]of Object.entries(t))l!==void 0&&l!==""&&n.set(a,String(l));let r=n.toString();return`/api/v1/fitment${e}${r?`?${r}`:""}`}var rn={listMakes:async e=>{if(_){let{fitmentData:n}=await import("./fitment-data-IKFCBT6E.js");return n.makes(e)}return(await c(k("/makes",{region:e}),b())).results},listModels:async(e,t)=>{if(_){let{fitmentData:r}=await import("./fitment-data-IKFCBT6E.js");return r.models(e,t)}return(await c(k("/models",{make:e,region:t}),b())).results},listYears:async(e,t,n)=>{if(_){let{fitmentData:a}=await import("./fitment-data-IKFCBT6E.js");return a.years(e,t,n)}return(await c(k("/years",{make:e,model:t,region:n}),b())).results},listModifications:async(e,t,n,r)=>{if(_){let{fitmentData:l}=await import("./fitment-data-IKFCBT6E.js");return l.modifications(e,t,n,r)}return(await c(k("/modifications",{make:e,model:t,year:n,region:r}),b())).results},getStockFitment:async(e,t,n,r,a)=>{if(_){let{fitmentData:l}=await import("./fitment-data-IKFCBT6E.js");return l.stockFitment(e,t,n,r,a)}return c(k("/stock-fitment",{make:e,model:t,year:n,modification:r,region:a}),b())}},sn={listWheels:async e=>{let t=await we("products.listWheels",async n=>await y(dt(e,n)));return M(S(t))},listCatalog:async(e,t)=>{if(e.length===0)throw new Error("products.listCatalog() needs at least one kind. An empty list would omit `kind`, which the contract reads as `alloy-wheel` \u2014 so the call would silently return the wheel catalog instead of nothing.");let n=await we("products.listCatalog",async r=>await y(gt(e,t,r)),yt);return ft(S(n))},getWheel:async e=>A(S(await c(await y(m(`/wheels/${e}`)),await p()))),getTyre:async e=>S(await c(await y(m(`/tyres/${e}`)),await p())),listBundles:async()=>{try{return await c(await y(m("/bundles")),await p())}catch{return[]}},getBundle:async e=>c(await y(m(`/bundles/${e}`)),await p()),listGalleryBuilds:async(e={})=>{let{process:t=null,wheelSlug:n=null}=e;if(typeof window>"u"){let{listGalleryBuilds:r}=await import("./gallery-builds-data-TD3QJK7L.js");return S(r(t,n))}try{let r=new URLSearchParams;t&&r.set("process",t),n&&r.set("wheelSlug",n);let a=r.toString(),l=await c(`/api/v1/gallery-builds${a?`?${a}`:""}`,b());return S(l.results)}catch(r){return console.warn("[products.listGalleryBuilds] product API unavailable, returning []",r),[]}},getSite:async()=>c(await y(m("/site")),await p()),getSiteBySlug:async e=>c(`${m("/site")}?${new URLSearchParams({site:e})}`,typeof window>"u"?await p():void 0),listPages:async()=>S(await c(await y(m("/pages")),await p())),listPopups:async()=>c(await y(m("/popups")),await p()),listProductTemplates:async()=>{try{return await c(await y(m("/product-templates")),await p())}catch(e){return console.warn("[products.listProductTemplates] unavailable, returning []",e),[]}},listDynamicPages:async e=>{let t=e?`?recordType=${encodeURIComponent(e)}`:"";try{return await c(await y(`${m("/dynamic-pages")}${t}`),await p())}catch(n){if(n instanceof f&&n.status===404)return[];throw n}},getRecord:async(e,t)=>{try{return await c(await y(m(`/records/${encodeURIComponent(e)}/${encodeURIComponent(t)}`)),await p())}catch(n){if(n instanceof f&&n.status===404)return null;throw n}},listRecordKeys:async e=>{try{let t=await c(await y(m(`/records/${encodeURIComponent(e)}`)),await p({cache:"no-store"}));return Array.isArray(t?.keys)?t.keys.filter(n=>typeof n=="string"&&n!==""):[]}catch(t){if(t instanceof f&&t.status===404)return[];throw t}},listProductTypeChoices:async()=>{try{return await c(await y(m("/product-type-choices")),await p())}catch(e){return console.warn("[products.listProductTypeChoices] unavailable, returning []",e),[]}},listFieldUsage:async()=>{try{return await c(await y(m("/field-usage")),await p())}catch(e){return console.warn("[products.listFieldUsage] unavailable, returning []",e),[]}},getPage:async(e,t={})=>{let n=t.record?`?record=${encodeURIComponent(t.record)}`:"",[r,a]=await J(m(`/pages/${e}`)+n,t.revalidate!==void 0?{next:{revalidate:t.revalidate}}:void 0);return S(await c(r,a))},listBlogPosts:async(e={})=>{let t=e.category?`?category=${encodeURIComponent(e.category)}`:"";try{return(await c(m("/blog-posts")+t,await p())).map(r=>({...r,coverImage:C(r.coverImage)??""}))}catch(n){return console.warn("[products.listBlogPosts] blog API unavailable, returning []",n),[]}},getBlogPost:async e=>{let t=await c(m(`/blog-posts/${e}`),await p());return{...t,coverImage:C(t.coverImage)??""}},createOrder:async e=>c(m("/orders"),await p({method:"POST",body:JSON.stringify(e)})),createOrderAuthed:async e=>h(m("/orders"),await p({method:"POST",body:JSON.stringify(e)})),lookupOrder:async e=>c(m("/orders/lookup"),await p({method:"POST",body:JSON.stringify(e)})),createPaymentIntent:async e=>c(m("/payments/intent"),await p({method:"POST",body:JSON.stringify(e)})),createPaypalOrder:async e=>c(m("/payments/paypal/order"),await p({method:"POST",body:JSON.stringify(e)})),capturePaypalOrder:async e=>c(m("/payments/paypal/capture"),await p({method:"POST",body:JSON.stringify(e)})),createAfterpayCheckout:async e=>c(m("/payments/afterpay/checkout"),await p({method:"POST",body:JSON.stringify(e)})),captureAfterpayPayment:async e=>c(m("/payments/afterpay/capture"),await p({method:"POST",body:JSON.stringify(e)})),chargeSquare:async e=>c(m("/payments/square/charge"),await p({method:"POST",body:JSON.stringify(e)})),createGocardlessBillingRequest:async e=>c(m("/payments/gocardless/billing-request"),await p({method:"POST",body:JSON.stringify(e)})),completeGocardlessPayment:async e=>c(m("/payments/gocardless/complete"),await p({method:"POST",body:JSON.stringify(e)})),createZipCheckout:async e=>c(m("/payments/zip/checkout"),await p({method:"POST",body:JSON.stringify(e)})),captureZipPayment:async e=>c(m("/payments/zip/capture"),await p({method:"POST",body:JSON.stringify(e)})),createKlarnaCheckout:async e=>c(m("/payments/klarna/checkout"),await p({method:"POST",body:JSON.stringify(e)})),captureKlarnaPayment:async e=>c(m("/payments/klarna/capture"),await p({method:"POST",body:JSON.stringify(e)})),createStockAlert:async e=>c(m("/stock-alerts"),await p({method:"POST",body:JSON.stringify(e)})),createPreOrderIntent:async e=>c(m("/pre-order-intents"),await p({method:"POST",body:JSON.stringify(e)})),createNewsletterSubscription:async e=>c(m("/newsletter-subscriptions"),await p({method:"POST",body:JSON.stringify(e)})),unsubscribeNewsletter:async e=>c(m("/newsletter-unsubscribe"),await p({method:"POST",body:JSON.stringify(e)})),captureCart:async e=>c(m("/carts"),await p({method:"POST",body:JSON.stringify(e)})),restoreCart:async e=>c(m("/carts/restore"),await p({method:"POST",body:JSON.stringify(e)})),unsubscribeCartReminders:async e=>c(m("/carts/unsubscribe"),await p({method:"POST",body:JSON.stringify(e)})),listReviews:async(e={})=>{let t=new URLSearchParams;e.limit&&t.set("limit",String(e.limit)),e.designCode&&t.set("designCode",e.designCode);let n=m("/reviews"),r=t.toString();try{return await c(await y(r?`${n}?${r}`:n),await p())}catch(a){return console.warn("[products.listReviews] product API unavailable, returning []",a),[]}},submitReview:async e=>c(m("/reviews"),await p({method:"POST",body:JSON.stringify(e)})),getForm:async e=>c(m(`/forms/${encodeURIComponent(e)}`),await p()),submitForm:async(e,t)=>c(m(`/forms/${encodeURIComponent(e)}/submissions`),await p({method:"POST",body:JSON.stringify(t)})),listShippingMethods:async()=>{try{return await c(m("/shipping-methods"),await p())}catch(e){return console.warn("[products.listShippingMethods] product API unavailable, returning []",e),[]}},listCountrySubdivisions:async e=>{try{return await c(m(`/countries/${encodeURIComponent(e)}/subdivisions`),await p())}catch(t){return console.warn("[products.listCountrySubdivisions] unavailable, returning []",t),[]}},quoteCart:async e=>{let t=m("/cart/quote"),n=await p({method:"POST",body:JSON.stringify(e)});return e.couponCode?(await fe(t,n)).data:c(t,n)},validateCoupon:async e=>{let{data:t,asShopper:n}=await fe(m("/coupons/validate"),await p({method:"POST",body:JSON.stringify(e)}));return{...t,askedAsShopper:n}},getHeaderSettings:async()=>{let e=Ae({method:"GET"}),t=await c(...await J(m("/header-settings"),{signal:e})),n=C(t.logoUrl),r=null,a=null;if(n&&D(n)){let l=await de(n,e);l&&(r=l.reversed,a=l.inkIsDark)}return{...t,logoUrl:n,logoReversed:r,logoInkIsDark:a}},getThemeSettings:async()=>c(...await J(m("/theme-settings"))),getChatSettings:async()=>c(await y(m("/chat-settings")),await p())},on={listServices:async()=>{try{return await c(m("/bookings/services"),await p())}catch(e){return console.warn("[bookings.listServices] API unavailable, returning []",e),{results:[],currency:"USD"}}},getAvailability:async(e,t)=>c(m(`/bookings/availability?service=${encodeURIComponent(e)}&date=${t}`),await p()),create:async e=>c(m("/bookings"),await p({method:"POST",body:JSON.stringify(e)})),get:async e=>c(m(`/bookings/manage/${encodeURIComponent(e)}`),await p()),cancel:async e=>c(m(`/bookings/manage/${encodeURIComponent(e)}/cancel`),await p({method:"POST"})),createPaymentIntent:async e=>c(m("/bookings/payments/intent"),await p({method:"POST",body:JSON.stringify({manageToken:e})}))},G=class extends Error{constructor(n,r){super(`Slug "${n}" exists on ${r} websites; a site is required to pick one.`);this.slug=n;this.count=r;this.name="AmbiguousPageSlugError"}},F=(e,t,n)=>{let r=new URLSearchParams({...t?{site:t}:{},...n?{draft:"1"}:{}}).toString();return`/api/storefront/${e}/${r?`?${r}`:""}`},x=e=>`/api/storefront/sites/${encodeURIComponent(e)}/`,xt=e=>`${x(e)}currencies/`,Tt="/api/storefront/media/ingest/",K=class extends Error{constructor(){super("This editor is not connected to a website, so an upload has nowhere to go. Open the page from the website the file should belong to, then try again."),this.name="MediaUploadDestinationError"}};function Ct(){let e=ge();if(!e)throw new K;return`${Tt}?${new URLSearchParams({site:e})}`}var I={"X-Puck-Media-Manifest":z.contentHash},an=ve({});function ve(e){return(t,n={})=>{let r=ot(),a=e.headers||r?{...r?{"Accept-Language":r}:{},...e.headers,...n.headers}:void 0;return c(t,{...n,...e.baseUrl!==void 0?{baseUrl:e.baseUrl}:{},...a?{headers:a}:{},audience:e.audience??st()})}}function Ot(e={}){let t=ve(e),n=e.siteDrafts===!0,r=s=>F("header-settings",s,n),a=s=>F("theme-settings",s,n),l=s=>F("chat-settings",s,n),d=s=>F("social-settings",s,n);return{findPageBySlug:async(s,i,o)=>{let u=new URLSearchParams({slug:s});o&&u.set("site",o);let g=await t(`/api/storefront/pages/?${u.toString()}`,{token:i}),P=Array.isArray(g)?g:g.results??[];if(!o&&P.length>1)throw new G(s,P.length);return P[0]??null},getPageById:(s,i)=>t(`/api/storefront/pages/${s}/`,{token:i}),saveLayout:(s,i,o,u,g)=>t(`/api/storefront/pages/${s}/`,{method:"PATCH",body:JSON.stringify({layout:i,expected_updated_at:u,...g?{client_id:g}:{}}),token:o}),duplicatePage:(s,i,o)=>t(`/api/storefront/pages/${s}/duplicate/`,{method:"POST",body:JSON.stringify({title:i.title,slug:i.slug}),token:o}),geocode:(s,i,o)=>t(`/api/storefront/geocode/?${new URLSearchParams(o?{q:s,country:o}:{q:s})}`,{token:i}),listBlockSources:s=>t("/api/storefront/block-sources/",{token:s}),listRecordTypes:s=>t("/api/storefront/record-types/",{token:s}),createPagePreviewLink:(s,i)=>t(`/api/storefront/pages/${s}/preview-link/`,{method:"POST",token:i}),claimPageEditLock:(s,i,o,u=!1)=>t(`/api/storefront/pages/${s}/edit-lock/`,{method:"POST",body:JSON.stringify({client_id:o,takeover:u}),token:i}),releasePageEditLock:(s,i)=>t(`/api/storefront/pages/${s}/edit-lock/`,{method:"DELETE",token:i}),createTemplate:(s,i,o)=>t("/api/storefront/page-templates/",{method:"POST",body:JSON.stringify({name:s,layout:i}),headers:I,token:o}),getTemplate:(s,i)=>t(`/api/storefront/page-templates/${s}/`,{token:i}),saveTemplateLayout:(s,i,o)=>t(`/api/storefront/page-templates/${s}/`,{method:"PATCH",body:JSON.stringify({layout:i}),headers:I,token:o}),listTemplatePages:async(s,i)=>{let o=await t(`/api/storefront/template-pages/?template=${encodeURIComponent(s)}`,{token:i});return Array.isArray(o)?o:o.results??[]},findTemplatePageBySlug:async(s,i,o)=>{let u=await t(`/api/storefront/template-pages/?template=${encodeURIComponent(s)}&slug=${encodeURIComponent(i)}`,{token:o});return(Array.isArray(u)?u:u.results??[])[0]??null},createTemplatePage:(s,i,o)=>t("/api/storefront/template-pages/",{method:"POST",body:JSON.stringify({template:s,...i}),headers:I,token:o}),saveTemplatePageLayout:(s,i,o)=>t(`/api/storefront/template-pages/${s}/`,{method:"PATCH",body:JSON.stringify({layout:i}),headers:I,token:o}),deleteTemplatePage:(s,i,o)=>t(`/api/storefront/template-pages/${s}/`,{method:"DELETE",token:i,...o?.keepalive?{keepalive:!0}:{}}),listPages:async(s,i)=>{let o=new URLSearchParams({no_page:"true"});i&&o.set("site",i);let u=await t(`/api/storefront/pages/?${o.toString()}`,{token:s});return Array.isArray(u)?u:u.results??[]},createPage:(s,i,o,u)=>t("/api/storefront/pages/",{method:"POST",body:JSON.stringify({title:s,slug:i,layout:o}),token:u}),deletePage:(s,i)=>t(`/api/storefront/pages/${s}/`,{method:"DELETE",token:i}),getHeaderSettings:(s,i)=>t(r(i),{token:s}),listMenus:async(s,i)=>{let o=new URLSearchParams({no_page:"true"});i&&o.set("site",i);let u=await t(`/api/storefront/menus/?${o}`,{token:s});return Array.isArray(u)?u:u.results??[]},listBlogPosts:async(s,i={})=>{let o=new URLSearchParams({no_page:"true"});i.visibleOnly&&o.set("is_visible","true"),i.siteId&&o.set("site",i.siteId);let u=await t(`/api/storefront/blog-posts/?${o.toString()}`,{token:s});return Array.isArray(u)?u:u.results??[]},listFieldUsage:async(s,i)=>{let o=await t(`/api/storefront/field-usage/?site=${encodeURIComponent(i)}`,{token:s});return Array.isArray(o?.entries)?o.entries:[]},listCategories:async(s,i={})=>{let o=new URLSearchParams({no_page:"true"});i.visibleOnly&&o.set("is_visible","true"),i.siteId&&o.set("site",i.siteId);let u=await t(`/api/storefront/categories/?${o.toString()}`,{token:s});return[...Array.isArray(u)?u:u.results??[]].sort((P,T)=>P.sort_order-T.sort_order||P.name.localeCompare(T.name))},listForms:async(s,i={})=>{let o=new URLSearchParams({no_page:"true"});i.siteId&&o.set("site",i.siteId);let u=await t(`/api/storefront/forms/?${o.toString()}`,{token:s});return[...Array.isArray(u)?u:u.results??[]].sort((P,T)=>P.title.localeCompare(T.title))},listWheelSummaries:async(s,i={})=>{let o=new URLSearchParams;i.siteId&&o.set("site",i.siteId);let u=o.toString(),g=await t(`/api/storefront/wheel-curations/summaries/${u?`?${u}`:""}`,{token:s});return S(g)},listProducts:async(s,i={})=>{let o=new URLSearchParams;i.kinds?.length&&o.set("kind",i.kinds.join(",")),i.siteId&&o.set("site",i.siteId);let u=o.toString(),g=await t(`/api/storefront/products/${u?`?${u}`:""}`,{token:s});return S(g)},getWheelDetail:async(s,i,o={})=>{let u=new URLSearchParams({slug:i});return o.siteId&&u.set("site",o.siteId),A(S(await t(`/api/storefront/wheel-curations/detail/?${u.toString()}`,{token:s})))},updateHeaderSettings:(s,i,o)=>t(r(o),{method:"PATCH",body:JSON.stringify(s),token:i}),getSite:(s,i)=>t(x(s),{token:i}),listSites:async s=>{let i=await t("/api/storefront/sites/?no_page=true",{token:s});return Array.isArray(i)?i:i.results??[]},listSiteCurrencies:async(s,i)=>{let o=await t(xt(s),{token:i});return Array.isArray(o)?o:[]},publishSite:(s,i)=>t(`${x(s)}publish/`,{method:"POST",token:i}),getSiteLiveState:(s,i)=>t(`${x(s)}live-state/`,{token:i}),updateSite:(s,i,o)=>t(x(s),{method:"PATCH",body:JSON.stringify(i),token:o}),getThemeSettings:(s,i)=>t(a(i),{token:s}),updateThemeSettings:(s,i,o)=>t(a(o),{method:"PATCH",body:JSON.stringify(s),token:i}),getChatSettings:(s,i)=>t(l(i),{token:s}),updateChatSettings:(s,i,o)=>t(l(o),{method:"PATCH",body:JSON.stringify(s),token:i}),getSocialSettings:(s,i)=>t(d(i),{token:s}),updateSocialSettings:(s,i,o)=>t(d(o),{method:"PATCH",body:JSON.stringify(s),token:i}),uploadHeaderLogo:(s,i,o)=>{let u=new FormData;return u.append("logo",s),t(r(o),{method:"PATCH",body:u,token:i})},clearHeaderLogo:(s,i)=>t(r(i),{method:"PATCH",body:JSON.stringify({logo:null}),token:s}),setHeaderLogoFromAsset:(s,i,o)=>t(r(o),{method:"PATCH",body:JSON.stringify({logo_asset_id:s}),token:i}),uploadMedia:async(s,i)=>{let o=new FormData;return o.append("file",s),t(Ct(),{method:"POST",body:o,token:i})},listMedia:async(s,i)=>{let o=new URLSearchParams({no_page:"true"});i&&o.set("kind",i);let u=await t(`/api/storefront/media-assets/?${o.toString()}`,{token:s});return Array.isArray(u)?u:u.results??[]}}}var cn=Ot({siteDrafts:!0});export{U as a,Q as b,X as c,w as d,Ie as e,D as f,ge as g,Qe as h,f as i,W as j,H as k,Qt as l,Xt as m,c as n,lt as o,Oe as p,St as q,Pt as r,wt as s,Rt as t,rn as u,sn as v,on as w,G as x,an as y,cn as z};
|
|
1
|
+
import{a as V,c as C,g as z,i as $,j,l as O}from"./chunk-IHYVLVY3.js";var U="".replace(/\/+$/,"");var B="x-forwarded-for";function Z(e){let t=(e??"").split(",").map(n=>n.trim()).filter(Boolean);return t.length>0?t[t.length-1]:null}var Ee="x-forwarded-host";function Q(e,t,n){let r={};return e&&(r[Ee]=e),t&&n==="uncached"&&(r[B]=t),r}function X(e){if(e?.cache==="no-store"||e?.cache==="no-cache")return"uncached";if(e?.cache==="force-cache")return"data-cached";let t=e?.next?.revalidate;return typeof t=="number"&&t>0?"data-cached":"uncached"}var Y="x-storefront-site",ee="x-storefront-host",te="x-storefront-preview";var Fe="shop_access_token",ne="shop_refresh_token",N=null;function L(){O.removeItem(Fe),O.removeItem(ne)}var w={getAccess(){return N},takeLegacyRefresh(){let e=O.getItem(ne);return L(),e},setTokens(e){N=e,L()},clear(){N=null,L()}};import{efficientClientOpen as Ze}from"efficient-easel/screen/lib/session";function Ie(e){return!!e.src}function A(e){let t=e.finishes.filter(Ie);if(t.length===e.finishes.length)return e;let n=e.defaultFinish&&t.some(r=>r.name===e.defaultFinish)?e.defaultFinish:null;return{...e,finishes:t,defaultFinish:n}}function qe(e){return e.listable!==!1}function M(e){return e.map(A).filter(qe)}var oe=["fill","stroke","stop-color","color","flood-color","lighting-color","solid-color"],ae=new Set(["none","transparent","currentcolor","inherit","initial","unset","context-fill","context-stroke"]),v={black:[0,0,0],white:[255,255,255],gray:[128,128,128],grey:[128,128,128],darkgray:[169,169,169],darkgrey:[169,169,169],dimgray:[105,105,105],dimgrey:[105,105,105],lightgray:[211,211,211],lightgrey:[211,211,211],gainsboro:[220,220,220],silver:[192,192,192],whitesmoke:[245,245,245]},ce=12,le=/\burl\(/i,ue=new RegExp(`(?<![-\\w])(${oe.join("|")})(\\s*=\\s*)(["'])([^"']*)\\3`,"gi"),me=new RegExp(`((?:^|[;{\\s"'])(?:${oe.join("|")})\\s*:\\s*)([^;}"'<>]+)`,"gi"),$e=/<svg\b([^>]*)>/i,Ue=/\bfill\s*[=:]/i;function Be(e){let t=e.replace(ue,(n,r,a,l,d)=>{let s=re(d);return s===null?n:`${r}${a}${l}${s}${l}`}).replace(me,(n,r,a)=>{let l=re(a);return l===null?n:`${r}${l}`});return t=t.replace($e,(n,r)=>Ue.test(r)?n:`<svg fill="#ffffff"${r}>`),t}function re(e){let t=/!important/i.test(e),n=e.replace(/!important/gi,"").trim().toLowerCase();if(!n||le.test(n)||ae.has(n))return null;let r=n in v?[...v[n],1]:pe(n);if(!r)return null;let[a,l,d,s]=r;if(Math.max(a,l,d)-Math.min(a,l,d)>ce)return null;let i=Ne(255-a,255-l,255-d,s);return t?`${i} !important`:i}function Ne(e,t,n,r){if(r<1)return`rgba(${e}, ${t}, ${n}, ${r})`;let a=l=>l.toString(16).padStart(2,"0");return`#${a(e)}${a(t)}${a(n)}`}function pe(e){return e.startsWith("#")?Le(e):e.startsWith("rgb")?Me(e):e.startsWith("hsl")?He(e):null}function Le(e){let t=e.slice(1),n=1;if(t.length===3||t.length===4)t.length===4&&(n=parseInt(t[3]+t[3],16)/255),t=t.slice(0,3).split("").map(r=>r+r).join("");else if(t.length===6||t.length===8)t.length===8&&(n=parseInt(t.slice(6,8),16)/255),t=t.slice(0,6);else return null;return/^[0-9a-f]{6}$/.test(t)?[parseInt(t.slice(0,2),16),parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16),n]:null}function Me(e){let t=e.slice(e.indexOf("(")+1,e.lastIndexOf(")")),[n,r]=t.split("/"),a=n.split(/[\s,]+/).filter(Boolean).slice(0,3);if(a.length<3)return null;let l=a.map(s=>s.endsWith("%")?Math.round(parseFloat(s)/100*255):Math.round(parseFloat(s)));if(l.some(s=>Number.isNaN(s)))return null;let d=r?E(r):De(n);return[l[0],l[1],l[2],d]}function De(e){let t=e.split(/[\s,]+/).filter(Boolean);return t.length>=4?E(t[3]):1}function E(e){let t=e.trim().endsWith("%")?parseFloat(e)/100:parseFloat(e);return Number.isNaN(t)?1:t}function He(e){let t=e.slice(e.indexOf("(")+1,e.lastIndexOf(")")),[n,r]=t.split("/"),a=n.split(/[\s,]+/).filter(Boolean);if(a.length<3)return null;let l=parseFloat(a[0]),d=parseFloat(a[1])/100,s=parseFloat(a[2])/100;if([l,d,s].some(P=>Number.isNaN(P)))return null;let i=r?E(r):a.length>=4?E(a[3]):1,[o,u,g]=Je(l,d,s);return[o,u,g,i]}function Je(e,t,n){let r=(1-Math.abs(2*n-1))*t,a=(e%360+360)%360/60,l=r*(1-Math.abs(a%2-1)),d=0,s=0,i=0;a<1?[d,s,i]=[r,l,0]:a<2?[d,s,i]=[l,r,0]:a<3?[d,s,i]=[0,r,l]:a<4?[d,s,i]=[0,l,r]:a<5?[d,s,i]=[l,0,r]:[d,s,i]=[r,0,l];let o=n-r/2;return[Math.round((d+o)*255),Math.round((s+o)*255),Math.round((i+o)*255)]}var se=512*1024;function D(e){return/\.svg(\?|$)/i.test(e)}function We(e){return`data:image/svg+xml,${encodeURIComponent(Be(e))}`}function Ge(e){let t=e.replace(/!important/gi,"").trim().toLowerCase();if(!t||le.test(t)||ae.has(t))return null;let n=t in v?[...v[t],1]:pe(t);if(!n)return null;let[r,a,l]=n;return Math.max(r,a,l)-Math.min(r,a,l)>ce?null:(.2126*r+.7152*a+.0722*l)/255}function Ke(e){let t=[],n=r=>{let a=Ge(r);a!==null&&t.push(a)};for(let r of e.matchAll(ue))n(r[4]);for(let r of e.matchAll(me))n(r[2]);return t.length?t.reduce((r,a)=>r+a,0)/t.length<.5:null}var ie=/^(?:\uFEFF|\s+|<\?xml[^>]*\?>|<!--[\s\S]*?-->|<!DOCTYPE\s+svg[^>[]*>)/i;function Ve(e){let t=e;for(let n=ie.exec(t);n&&n[0].length>0;n=ie.exec(t))t=t.slice(n[0].length);return/^<svg[\s>/]/i.test(t)}async function ze(e,t){if(!D(e))return null;try{let n=await fetch(e,{signal:t,redirect:"manual"});if(!n.ok)return null;let r=Number(n.headers.get("content-length"));if(Number.isFinite(r)&&r>se)return null;let a=await n.text();return a.length>se?null:Ve(a)?a:null}catch{return null}}async function de(e,t){let n=await ze(e,t);return n===null?null:{reversed:We(n),inkIsDark:Ke(n)}}import{currentEaselSession as je,setSessionBridgedSite as Mt,setSessionDocumentSite as Dt}from"efficient-easel/screen/lib/session";function ge(){return je().siteId()}var Qe="",f=class extends Error{constructor(t,n,r){super(n),this.status=t,this.data=r}},W="Unable to reach the server. This could be a problem with your internet connection, or the server may be undergoing maintenance or an upgrade. Please try again shortly.",Xe=new Set([502,503,504]),H=0,Ye="This editor runs on its host's own backend, which does not serve this request.",et=5e3,tt=15e3,nt=()=>typeof window>"u"?et:tt;function Ae(e){let t=(e.method??"GET").toUpperCase();if(!(e.body!=null||t!=="GET"&&t!=="HEAD")&&!(e.audience!=null&&e.audience!=="shop")&&typeof AbortSignal?.timeout=="function")return AbortSignal.timeout(nt())}var he=e=>e instanceof Error&&e.name==="TimeoutError",ye=(e,t)=>Xe.has(e)?W:t,rt=["admin","venue"],Re="admin";function Qt(e){Re=rt.includes(e)?e:"admin"}function st(){return Re}var it=/^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{1,8})*$/,_e=null;function Xt(e){_e=e&&it.test(e)?e:null}function ot(){return _e}function at(e){if(typeof window>"u"||!e.startsWith("/api/v1/"))return e;let t=$();return!t||/[?&]site=/.test(e)?e:q(e,`site=${encodeURIComponent(t)}`)}async function c(e,t={}){let{token:n,baseUrl:r,headers:a,audience:l,...d}=t;if(typeof window<"u"&&!Ze())throw new f(H,Ye,null);if(typeof window>"u"&&r===void 0)throw new Error(`apiFetch(${JSON.stringify(e)}) ran on the server without an explicit baseUrl. The API_URL default it would inherit is browser-only (the prod image bakes NEXT_PUBLIC_API_URL="" for same-origin use, which a Node fetch cannot resolve). Pass a base explicitly: \`await backendOpts()\` (or baseUrl: PRODUCT_FETCH_BASE) for product reads, or the server-only PRODUCT_BACKEND_URL env for other backend surfaces.`);let s=typeof FormData<"u"&&d.body instanceof FormData,i;try{i=await fetch(`${r??Qe}${at(e)}`,{...d,headers:{...s?{}:{"Content-Type":"application/json"},...n?{Authorization:`Bearer ${n}`}:{},...l===null?{}:{"X-Portal-Audience":l??"shop"},...a},signal:d.signal??Ae({...d,audience:l})})}catch(g){throw g instanceof TypeError||he(g)?new f(H,W,null):g}let o;try{o=await i.text()}catch(g){throw he(g)?new f(H,W,null):g}let u=null;if(o)try{u=JSON.parse(o)}catch{throw new f(i.status,i.ok?"Expected JSON but received a non-JSON response":ye(i.status,i.statusText),o)}if(!i.ok){let g=(u&&typeof u=="object"&&"detail"in u&&typeof u.detail=="string"?u.detail:null)??ye(i.status,i.statusText);throw new f(i.status,g,u)}return u}var R=null;async function ke(){return R||(R=ct().finally(()=>{R=null}),R)}async function ct(){let e=w.takeLegacyRefresh(),t=await lt.refresh(e??void 0);return w.setTokens(t.access),t.access}async function xe(){return w.getAccess()??ke()}async function h(e,t={}){let n;try{n=await xe()}catch{throw w.clear(),new f(401,"Not signed in",null)}try{return await c(e,{...t,token:n})}catch(r){if(!(r instanceof f)||r.status!==401)throw r;try{let a=await ke();return await c(e,{...t,token:a})}catch{throw w.clear(),r}}}async function fe(e,t={}){if(w.getAccess())try{return{data:await h(e,t),asShopper:!0}}catch(n){if(!(n instanceof f)||n.status!==401)throw n}return{data:await c(e,t),asShopper:!1}}async function Se(){let e=await h("/api/auth/me/");if(e.portal!=="shop")throw w.clear(),new f(403,"This session is not valid for this shop.",null);return e}var lt={login:(e,t)=>c("/api/auth/login/",{method:"POST",body:JSON.stringify({email:e,password:t,portal:"shop"}),credentials:"include"}),refresh:e=>c("/api/auth/refresh/",{method:"POST",body:JSON.stringify(e?{refresh:e,portal:"shop"}:{portal:"shop"}),credentials:"include"}),logout:async()=>{w.clear();try{await c("/api/auth/logout/",{method:"POST",body:JSON.stringify({portal:"shop"}),credentials:"include"})}catch{}},restoreSession:async()=>{let e=await xe();return await Se(),e},me:Se,updateMe:e=>h("/api/auth/me/",{method:"PATCH",body:JSON.stringify(e)}),changePassword:(e,t)=>h("/api/auth/me/",{method:"PATCH",body:JSON.stringify({password:t,old_password:e})}),changeEmail:(e,t)=>h("/api/shop-portal/change-email/",{method:"POST",body:JSON.stringify({new_email:e,current_password:t})}),myProfile:()=>h("/api/shop-portal/profile/"),updateMyProfile:e=>h("/api/shop-portal/profile/",{method:"PATCH",body:JSON.stringify(e)}),myAddresses:()=>h("/api/shop-portal/delivery-locations/"),createAddress:e=>h("/api/shop-portal/delivery-locations/",{method:"POST",body:JSON.stringify(e)}),updateAddress:(e,t)=>h(`/api/shop-portal/delivery-locations/${e}/`,{method:"PATCH",body:JSON.stringify(t)}),deleteAddress:e=>h(`/api/shop-portal/delivery-locations/${e}/`,{method:"DELETE"}),passwordResetRequest:e=>c("/api/auth/password-reset/",{method:"POST",body:JSON.stringify({email:e})}),passwordResetConfirm:(e,t,n)=>c("/api/auth/password-reset/confirm/",{method:"POST",body:JSON.stringify({uid:e,token:t,new_password:n})}),brands:()=>h("/api/products/brands/"),myOrders:()=>h("/api/shop-portal/orders/").then(e=>e.results),myOrder:e=>h(`/api/shop-portal/orders/${e}/`),cancelOrder:e=>h(`/api/shop-portal/orders/${e}/cancel/`,{method:"POST"}),myReturns:e=>h(`/api/shop-portal/returns/${e?`?order=${encodeURIComponent(e)}`:""}`).then(t=>t.results),createReturn:e=>h("/api/shop-portal/returns/",{method:"POST",body:JSON.stringify(e)}),withdrawReturn:e=>h(`/api/shop-portal/returns/${e}/cancel/`,{method:"POST"}),uploadReturnPhoto:(e,t)=>{let n=new FormData;return n.append("claim_item",e),n.append("file",t),n.append("media_type",t.type.startsWith("video/")?"video":"image"),h("/api/shop-portal/return-media/",{method:"POST",body:n})}};function S(e){if(typeof e=="string")return e.startsWith("/media/")?V(e):e;if(Array.isArray(e))return e.map(S);if(e&&typeof e=="object"){let t={};for(let[n,r]of Object.entries(e))t[n]=n==="captions"&&r&&typeof r=="object"&&!Array.isArray(r)?Object.fromEntries(Object.entries(r).map(([a,l])=>[S(a),l])):S(r);return t}return e}var Te=typeof window>"u"&&U!=="",ut=Te?U:"",mt=j,b=()=>({baseUrl:mt(),audience:null});function m(e,t){let n=t?`?process=${encodeURIComponent(t)}`:"";return`/api/v1${e}${n}`}var pt=100,Pe=50;function Ce(e,t,n){let r=new URLSearchParams;for(let[a,l]of Object.entries(t))l!=null&&l!==""&&r.set(a,String(l));return r.set("pageSize",String(pt)),n&&r.set("cursor",n),`/api/v1${e}?${r.toString()}`}function dt(e,t){return Ce("/wheels",{process:e},t)}function gt(e,t,n){return Ce("/products",{kind:e.join(","),make:t?.make,model:t?.model,year:t?.year,modification:t?.modification},n)}function ht(e){if(!e)return null;try{return new URL(e,"http://cursor.invalid").searchParams.get("cursor")}catch{return null}}async function we(e,t,n=()=>!1){let r=[],a=null;try{for(let l=0;l<Pe;l++){let d=await c(await t(a),await p());if(r.push(...d.results),a=ht(d.next),!a)break}a&&console.warn(`[${e}] stopped at ${Pe} pages (${r.length} rows); catalog may be truncated`)}catch(l){if(n(l))throw l;console.warn(`[${e}] product API unavailable, returning []`,l)}return r}var yt=e=>e instanceof f&&e.status===400;function ft(e){return e.flatMap(t=>t.kind==="alloy-wheel"?M([t]):[t])}async function Oe(){return(await St()).host}async function St(){try{let{headers:e}=await import("./headers-UYHEZDAT.js"),t=await e(),n=l=>l?.split(",")[0]?.split(":")[0]?.trim().toLowerCase()||null,r=n(t.get(ee)??t.get("x-forwarded-host")??t.get("host")),a=n(t.get("host"));return{host:r,matchesRequestHost:r!==null&&r===a}}catch{return{host:null,matchesRequestHost:!1}}}async function Pt(){try{let{headers:e}=await import("./headers-UYHEZDAT.js");return Z((await e()).get(B))}catch{return null}}async function wt(){try{let{headers:e}=await import("./headers-UYHEZDAT.js");return(await e()).get(Y)||null}catch{return null}}async function bt(){let e=await wt();if(e)return`site=${encodeURIComponent(e)}`;let t=await Oe();return t?`host=${encodeURIComponent(t)}`:""}async function y(e){if(typeof window<"u"){let t=$();return t?q(e,`site=${encodeURIComponent(t)}`):e}return q(e,await bt())}function q(e,t){return t?`${e}${e.includes("?")?"&":"?"}${t}`:e}var At="preview";async function Rt(){if(typeof window<"u")return null;try{let{headers:e}=await import("./headers-UYHEZDAT.js");return(await e()).get(te)}catch{return null}}async function _t(){try{let{headers:e}=await import("./headers-UYHEZDAT.js");return(await e()).get("user-agent")}catch{return null}}async function J(e,t){let n=await Rt();if(n===null)return[await y(e),await p(t)];let r=q(await y(e),`${At}=${encodeURIComponent(n)}`),{next:a,cache:l,...d}=t??{},s=await p({...d,cache:"no-store"}),i=await _t();return i&&(s.headers={...s.headers,"user-agent":i}),[r,s]}async function kt(e){if(!Te)return;let[t,n]=await Promise.all([Oe(),Pt()]),r=Q(t,n,e);return Object.keys(r).length>0?r:void 0}async function p(e){let t=await kt(X(e)),n={baseUrl:ut,...e};return t&&(n.headers={...t,...e?.headers}),n}var _=typeof window>"u";function k(e,t){let n=new URLSearchParams;for(let[a,l]of Object.entries(t))l!==void 0&&l!==""&&n.set(a,String(l));let r=n.toString();return`/api/v1/fitment${e}${r?`?${r}`:""}`}var rn={listMakes:async e=>{if(_){let{fitmentData:n}=await import("./fitment-data-UQDOQP66.js");return n.makes(e)}return(await c(k("/makes",{region:e}),b())).results},listModels:async(e,t)=>{if(_){let{fitmentData:r}=await import("./fitment-data-UQDOQP66.js");return r.models(e,t)}return(await c(k("/models",{make:e,region:t}),b())).results},listYears:async(e,t,n)=>{if(_){let{fitmentData:a}=await import("./fitment-data-UQDOQP66.js");return a.years(e,t,n)}return(await c(k("/years",{make:e,model:t,region:n}),b())).results},listModifications:async(e,t,n,r)=>{if(_){let{fitmentData:l}=await import("./fitment-data-UQDOQP66.js");return l.modifications(e,t,n,r)}return(await c(k("/modifications",{make:e,model:t,year:n,region:r}),b())).results},getStockFitment:async(e,t,n,r,a)=>{if(_){let{fitmentData:l}=await import("./fitment-data-UQDOQP66.js");return l.stockFitment(e,t,n,r,a)}return c(k("/stock-fitment",{make:e,model:t,year:n,modification:r,region:a}),b())}},sn={listWheels:async e=>{let t=await we("products.listWheels",async n=>await y(dt(e,n)));return M(S(t))},listCatalog:async(e,t)=>{if(e.length===0)throw new Error("products.listCatalog() needs at least one kind. An empty list would omit `kind`, which the contract reads as `alloy-wheel` \u2014 so the call would silently return the wheel catalog instead of nothing.");let n=await we("products.listCatalog",async r=>await y(gt(e,t,r)),yt);return ft(S(n))},getWheel:async e=>A(S(await c(await y(m(`/wheels/${e}`)),await p()))),getTyre:async e=>S(await c(await y(m(`/tyres/${e}`)),await p())),listBundles:async()=>{try{return await c(await y(m("/bundles")),await p())}catch{return[]}},getBundle:async e=>c(await y(m(`/bundles/${e}`)),await p()),listGalleryBuilds:async(e={})=>{let{process:t=null,wheelSlug:n=null}=e;if(typeof window>"u"){let{listGalleryBuilds:r}=await import("./gallery-builds-data-TD3QJK7L.js");return S(r(t,n))}try{let r=new URLSearchParams;t&&r.set("process",t),n&&r.set("wheelSlug",n);let a=r.toString(),l=await c(`/api/v1/gallery-builds${a?`?${a}`:""}`,b());return S(l.results)}catch(r){return console.warn("[products.listGalleryBuilds] product API unavailable, returning []",r),[]}},getSite:async()=>c(await y(m("/site")),await p()),getSiteBySlug:async e=>c(`${m("/site")}?${new URLSearchParams({site:e})}`,typeof window>"u"?await p():void 0),listPages:async()=>S(await c(await y(m("/pages")),await p())),listPopups:async()=>c(await y(m("/popups")),await p()),listProductTemplates:async()=>{try{return await c(await y(m("/product-templates")),await p())}catch(e){return console.warn("[products.listProductTemplates] unavailable, returning []",e),[]}},listDynamicPages:async e=>{let t=e?`?recordType=${encodeURIComponent(e)}`:"";try{return await c(await y(`${m("/dynamic-pages")}${t}`),await p())}catch(n){if(n instanceof f&&n.status===404)return[];throw n}},getRecord:async(e,t)=>{try{return await c(await y(m(`/records/${encodeURIComponent(e)}/${encodeURIComponent(t)}`)),await p())}catch(n){if(n instanceof f&&n.status===404)return null;throw n}},listRecordKeys:async e=>{try{let t=await c(await y(m(`/records/${encodeURIComponent(e)}`)),await p({cache:"no-store"}));return Array.isArray(t?.keys)?t.keys.filter(n=>typeof n=="string"&&n!==""):[]}catch(t){if(t instanceof f&&t.status===404)return[];throw t}},listProductTypeChoices:async()=>{try{return await c(await y(m("/product-type-choices")),await p())}catch(e){return console.warn("[products.listProductTypeChoices] unavailable, returning []",e),[]}},listFieldUsage:async()=>{try{return await c(await y(m("/field-usage")),await p())}catch(e){return console.warn("[products.listFieldUsage] unavailable, returning []",e),[]}},getPage:async(e,t={})=>{let n=t.record?`?record=${encodeURIComponent(t.record)}`:"",[r,a]=await J(m(`/pages/${e}`)+n,t.revalidate!==void 0?{next:{revalidate:t.revalidate}}:void 0);return S(await c(r,a))},listBlogPosts:async(e={})=>{let t=e.category?`?category=${encodeURIComponent(e.category)}`:"";try{return(await c(m("/blog-posts")+t,await p())).map(r=>({...r,coverImage:C(r.coverImage)??""}))}catch(n){return console.warn("[products.listBlogPosts] blog API unavailable, returning []",n),[]}},getBlogPost:async e=>{let t=await c(m(`/blog-posts/${e}`),await p());return{...t,coverImage:C(t.coverImage)??""}},createOrder:async e=>c(m("/orders"),await p({method:"POST",body:JSON.stringify(e)})),createOrderAuthed:async e=>h(m("/orders"),await p({method:"POST",body:JSON.stringify(e)})),lookupOrder:async e=>c(m("/orders/lookup"),await p({method:"POST",body:JSON.stringify(e)})),createPaymentIntent:async e=>c(m("/payments/intent"),await p({method:"POST",body:JSON.stringify(e)})),createPaypalOrder:async e=>c(m("/payments/paypal/order"),await p({method:"POST",body:JSON.stringify(e)})),capturePaypalOrder:async e=>c(m("/payments/paypal/capture"),await p({method:"POST",body:JSON.stringify(e)})),createAfterpayCheckout:async e=>c(m("/payments/afterpay/checkout"),await p({method:"POST",body:JSON.stringify(e)})),captureAfterpayPayment:async e=>c(m("/payments/afterpay/capture"),await p({method:"POST",body:JSON.stringify(e)})),chargeSquare:async e=>c(m("/payments/square/charge"),await p({method:"POST",body:JSON.stringify(e)})),createGocardlessBillingRequest:async e=>c(m("/payments/gocardless/billing-request"),await p({method:"POST",body:JSON.stringify(e)})),completeGocardlessPayment:async e=>c(m("/payments/gocardless/complete"),await p({method:"POST",body:JSON.stringify(e)})),createZipCheckout:async e=>c(m("/payments/zip/checkout"),await p({method:"POST",body:JSON.stringify(e)})),captureZipPayment:async e=>c(m("/payments/zip/capture"),await p({method:"POST",body:JSON.stringify(e)})),createKlarnaCheckout:async e=>c(m("/payments/klarna/checkout"),await p({method:"POST",body:JSON.stringify(e)})),captureKlarnaPayment:async e=>c(m("/payments/klarna/capture"),await p({method:"POST",body:JSON.stringify(e)})),createStockAlert:async e=>c(m("/stock-alerts"),await p({method:"POST",body:JSON.stringify(e)})),createPreOrderIntent:async e=>c(m("/pre-order-intents"),await p({method:"POST",body:JSON.stringify(e)})),createNewsletterSubscription:async e=>c(m("/newsletter-subscriptions"),await p({method:"POST",body:JSON.stringify(e)})),unsubscribeNewsletter:async e=>c(m("/newsletter-unsubscribe"),await p({method:"POST",body:JSON.stringify(e)})),captureCart:async e=>c(m("/carts"),await p({method:"POST",body:JSON.stringify(e)})),restoreCart:async e=>c(m("/carts/restore"),await p({method:"POST",body:JSON.stringify(e)})),unsubscribeCartReminders:async e=>c(m("/carts/unsubscribe"),await p({method:"POST",body:JSON.stringify(e)})),listReviews:async(e={})=>{let t=new URLSearchParams;e.limit&&t.set("limit",String(e.limit)),e.designCode&&t.set("designCode",e.designCode);let n=m("/reviews"),r=t.toString();try{return await c(await y(r?`${n}?${r}`:n),await p())}catch(a){return console.warn("[products.listReviews] product API unavailable, returning []",a),[]}},submitReview:async e=>c(m("/reviews"),await p({method:"POST",body:JSON.stringify(e)})),getForm:async e=>c(m(`/forms/${encodeURIComponent(e)}`),await p()),submitForm:async(e,t)=>c(m(`/forms/${encodeURIComponent(e)}/submissions`),await p({method:"POST",body:JSON.stringify(t)})),listShippingMethods:async()=>{try{return await c(m("/shipping-methods"),await p())}catch(e){return console.warn("[products.listShippingMethods] product API unavailable, returning []",e),[]}},listCountrySubdivisions:async e=>{try{return await c(m(`/countries/${encodeURIComponent(e)}/subdivisions`),await p())}catch(t){return console.warn("[products.listCountrySubdivisions] unavailable, returning []",t),[]}},quoteCart:async e=>{let t=m("/cart/quote"),n=await p({method:"POST",body:JSON.stringify(e)});return e.couponCode?(await fe(t,n)).data:c(t,n)},validateCoupon:async e=>{let{data:t,asShopper:n}=await fe(m("/coupons/validate"),await p({method:"POST",body:JSON.stringify(e)}));return{...t,askedAsShopper:n}},getHeaderSettings:async()=>{let e=Ae({method:"GET"}),t=await c(...await J(m("/header-settings"),{signal:e})),n=C(t.logoUrl),r=null,a=null;if(n&&D(n)){let l=await de(n,e);l&&(r=l.reversed,a=l.inkIsDark)}return{...t,logoUrl:n,logoReversed:r,logoInkIsDark:a}},getThemeSettings:async()=>c(...await J(m("/theme-settings"))),getChatSettings:async()=>c(await y(m("/chat-settings")),await p())},on={listServices:async()=>{try{return await c(m("/bookings/services"),await p())}catch(e){return console.warn("[bookings.listServices] API unavailable, returning []",e),{results:[],currency:"USD"}}},getAvailability:async(e,t)=>c(m(`/bookings/availability?service=${encodeURIComponent(e)}&date=${t}`),await p()),create:async e=>c(m("/bookings"),await p({method:"POST",body:JSON.stringify(e)})),get:async e=>c(m(`/bookings/manage/${encodeURIComponent(e)}`),await p()),cancel:async e=>c(m(`/bookings/manage/${encodeURIComponent(e)}/cancel`),await p({method:"POST"})),createPaymentIntent:async e=>c(m("/bookings/payments/intent"),await p({method:"POST",body:JSON.stringify({manageToken:e})}))},G=class extends Error{constructor(n,r){super(`Slug "${n}" exists on ${r} websites; a site is required to pick one.`);this.slug=n;this.count=r;this.name="AmbiguousPageSlugError"}},F=(e,t,n)=>{let r=new URLSearchParams({...t?{site:t}:{},...n?{draft:"1"}:{}}).toString();return`/api/storefront/${e}/${r?`?${r}`:""}`},x=e=>`/api/storefront/sites/${encodeURIComponent(e)}/`,xt=e=>`${x(e)}currencies/`,Tt="/api/storefront/media/ingest/",K=class extends Error{constructor(){super("This editor is not connected to a website, so an upload has nowhere to go. Open the page from the website the file should belong to, then try again."),this.name="MediaUploadDestinationError"}};function Ct(){let e=ge();if(!e)throw new K;return`${Tt}?${new URLSearchParams({site:e})}`}var I={"X-Puck-Media-Manifest":z.contentHash},an=ve({});function ve(e){return(t,n={})=>{let r=ot(),a=e.headers||r?{...r?{"Accept-Language":r}:{},...e.headers,...n.headers}:void 0;return c(t,{...n,...e.baseUrl!==void 0?{baseUrl:e.baseUrl}:{},...a?{headers:a}:{},audience:e.audience??st()})}}function Ot(e={}){let t=ve(e),n=e.siteDrafts===!0,r=s=>F("header-settings",s,n),a=s=>F("theme-settings",s,n),l=s=>F("chat-settings",s,n),d=s=>F("social-settings",s,n);return{findPageBySlug:async(s,i,o)=>{let u=new URLSearchParams({slug:s});o&&u.set("site",o);let g=await t(`/api/storefront/pages/?${u.toString()}`,{token:i}),P=Array.isArray(g)?g:g.results??[];if(!o&&P.length>1)throw new G(s,P.length);return P[0]??null},getPageById:(s,i)=>t(`/api/storefront/pages/${s}/`,{token:i}),saveLayout:(s,i,o,u,g)=>t(`/api/storefront/pages/${s}/`,{method:"PATCH",body:JSON.stringify({layout:i,expected_updated_at:u,...g?{client_id:g}:{}}),token:o}),duplicatePage:(s,i,o)=>t(`/api/storefront/pages/${s}/duplicate/`,{method:"POST",body:JSON.stringify({title:i.title,slug:i.slug}),token:o}),geocode:(s,i,o)=>t(`/api/storefront/geocode/?${new URLSearchParams(o?{q:s,country:o}:{q:s})}`,{token:i}),listBlockSources:s=>t("/api/storefront/block-sources/",{token:s}),listRecordTypes:s=>t("/api/storefront/record-types/",{token:s}),createPagePreviewLink:(s,i)=>t(`/api/storefront/pages/${s}/preview-link/`,{method:"POST",token:i}),claimPageEditLock:(s,i,o,u=!1)=>t(`/api/storefront/pages/${s}/edit-lock/`,{method:"POST",body:JSON.stringify({client_id:o,takeover:u}),token:i}),releasePageEditLock:(s,i)=>t(`/api/storefront/pages/${s}/edit-lock/`,{method:"DELETE",token:i}),createTemplate:(s,i,o)=>t("/api/storefront/page-templates/",{method:"POST",body:JSON.stringify({name:s,layout:i}),headers:I,token:o}),getTemplate:(s,i)=>t(`/api/storefront/page-templates/${s}/`,{token:i}),saveTemplateLayout:(s,i,o)=>t(`/api/storefront/page-templates/${s}/`,{method:"PATCH",body:JSON.stringify({layout:i}),headers:I,token:o}),listTemplatePages:async(s,i)=>{let o=await t(`/api/storefront/template-pages/?template=${encodeURIComponent(s)}`,{token:i});return Array.isArray(o)?o:o.results??[]},findTemplatePageBySlug:async(s,i,o)=>{let u=await t(`/api/storefront/template-pages/?template=${encodeURIComponent(s)}&slug=${encodeURIComponent(i)}`,{token:o});return(Array.isArray(u)?u:u.results??[])[0]??null},createTemplatePage:(s,i,o)=>t("/api/storefront/template-pages/",{method:"POST",body:JSON.stringify({template:s,...i}),headers:I,token:o}),saveTemplatePageLayout:(s,i,o)=>t(`/api/storefront/template-pages/${s}/`,{method:"PATCH",body:JSON.stringify({layout:i}),headers:I,token:o}),deleteTemplatePage:(s,i,o)=>t(`/api/storefront/template-pages/${s}/`,{method:"DELETE",token:i,...o?.keepalive?{keepalive:!0}:{}}),listPages:async(s,i)=>{let o=new URLSearchParams({no_page:"true"});i&&o.set("site",i);let u=await t(`/api/storefront/pages/?${o.toString()}`,{token:s});return Array.isArray(u)?u:u.results??[]},createPage:(s,i,o,u)=>t("/api/storefront/pages/",{method:"POST",body:JSON.stringify({title:s,slug:i,layout:o}),token:u}),deletePage:(s,i)=>t(`/api/storefront/pages/${s}/`,{method:"DELETE",token:i}),getHeaderSettings:(s,i)=>t(r(i),{token:s}),listMenus:async(s,i)=>{let o=new URLSearchParams({no_page:"true"});i&&o.set("site",i);let u=await t(`/api/storefront/menus/?${o}`,{token:s});return Array.isArray(u)?u:u.results??[]},listBlogPosts:async(s,i={})=>{let o=new URLSearchParams({no_page:"true"});i.visibleOnly&&o.set("is_visible","true"),i.siteId&&o.set("site",i.siteId);let u=await t(`/api/storefront/blog-posts/?${o.toString()}`,{token:s});return Array.isArray(u)?u:u.results??[]},listFieldUsage:async(s,i)=>{let o=await t(`/api/storefront/field-usage/?site=${encodeURIComponent(i)}`,{token:s});return Array.isArray(o?.entries)?o.entries:[]},listCategories:async(s,i={})=>{let o=new URLSearchParams({no_page:"true"});i.visibleOnly&&o.set("is_visible","true"),i.siteId&&o.set("site",i.siteId);let u=await t(`/api/storefront/categories/?${o.toString()}`,{token:s});return[...Array.isArray(u)?u:u.results??[]].sort((P,T)=>P.sort_order-T.sort_order||P.name.localeCompare(T.name))},listForms:async(s,i={})=>{let o=new URLSearchParams({no_page:"true"});i.siteId&&o.set("site",i.siteId);let u=await t(`/api/storefront/forms/?${o.toString()}`,{token:s});return[...Array.isArray(u)?u:u.results??[]].sort((P,T)=>P.title.localeCompare(T.title))},listWheelSummaries:async(s,i={})=>{let o=new URLSearchParams;i.siteId&&o.set("site",i.siteId);let u=o.toString(),g=await t(`/api/storefront/wheel-curations/summaries/${u?`?${u}`:""}`,{token:s});return S(g)},listProducts:async(s,i={})=>{let o=new URLSearchParams;i.kinds?.length&&o.set("kind",i.kinds.join(",")),i.siteId&&o.set("site",i.siteId);let u=o.toString(),g=await t(`/api/storefront/products/${u?`?${u}`:""}`,{token:s});return S(g)},getWheelDetail:async(s,i,o={})=>{let u=new URLSearchParams({slug:i});return o.siteId&&u.set("site",o.siteId),A(S(await t(`/api/storefront/wheel-curations/detail/?${u.toString()}`,{token:s})))},updateHeaderSettings:(s,i,o)=>t(r(o),{method:"PATCH",body:JSON.stringify(s),token:i}),getSite:(s,i)=>t(x(s),{token:i}),listSites:async s=>{let i=await t("/api/storefront/sites/?no_page=true",{token:s});return Array.isArray(i)?i:i.results??[]},listSiteCurrencies:async(s,i)=>{let o=await t(xt(s),{token:i});return Array.isArray(o)?o:[]},publishSite:(s,i)=>t(`${x(s)}publish/`,{method:"POST",token:i}),getSiteLiveState:(s,i)=>t(`${x(s)}live-state/`,{token:i}),updateSite:(s,i,o)=>t(x(s),{method:"PATCH",body:JSON.stringify(i),token:o}),getThemeSettings:(s,i)=>t(a(i),{token:s}),updateThemeSettings:(s,i,o)=>t(a(o),{method:"PATCH",body:JSON.stringify(s),token:i}),getChatSettings:(s,i)=>t(l(i),{token:s}),updateChatSettings:(s,i,o)=>t(l(o),{method:"PATCH",body:JSON.stringify(s),token:i}),getSocialSettings:(s,i)=>t(d(i),{token:s}),updateSocialSettings:(s,i,o)=>t(d(o),{method:"PATCH",body:JSON.stringify(s),token:i}),uploadHeaderLogo:(s,i,o)=>{let u=new FormData;return u.append("logo",s),t(r(o),{method:"PATCH",body:u,token:i})},clearHeaderLogo:(s,i)=>t(r(i),{method:"PATCH",body:JSON.stringify({logo:null}),token:s}),setHeaderLogoFromAsset:(s,i,o)=>t(r(o),{method:"PATCH",body:JSON.stringify({logo_asset_id:s}),token:i}),uploadMedia:async(s,i)=>{let o=new FormData;return o.append("file",s),t(Ct(),{method:"POST",body:o,token:i})},listMedia:async(s,i)=>{let o=new URLSearchParams({no_page:"true"});i&&o.set("kind",i);let u=await t(`/api/storefront/media-assets/?${o.toString()}`,{token:s});return Array.isArray(u)?u:u.results??[]}}}var cn=Ot({siteDrafts:!0});export{U as a,Q as b,X as c,w as d,Ie as e,D as f,ge as g,Qe as h,f as i,W as j,H as k,Qt as l,Xt as m,c as n,lt as o,Oe as p,St as q,Pt as r,wt as s,Rt as t,rn as u,sn as v,on as w,G as x,an as y,cn as z};
|