efficient-storefront-blocks 0.135.2 → 0.136.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.
Files changed (25) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/chunks/{CustomHtmlCodeWindow-FKPYCXCD.js → CustomHtmlCodeWindow-I3KVLIVV.js} +1 -1
  3. package/dist/chunks/{EditorPreviewCheckout-FVJV7XRD.js → EditorPreviewCheckout-F34WZNJI.js} +1 -1
  4. package/dist/chunks/SiteEditorProvider-FYEVPZKT.js +1 -0
  5. package/dist/chunks/{chunk-RDWFRHEV.js → chunk-6AODAOZ5.js} +2 -2
  6. package/dist/chunks/{chunk-VLFGNHX5.js → chunk-HRFAKD3V.js} +1 -1
  7. package/dist/chunks/{chunk-XMX3KEE4.js → chunk-IONUM72D.js} +1 -1
  8. package/dist/chunks/{chunk-ESXERZQ3.js → chunk-NMX2Y4EJ.js} +1 -1
  9. package/dist/chunks/{chunk-75GXE5JB.js → chunk-P34EYTSF.js} +1 -1
  10. package/dist/chunks/{chunk-VBCLGIPA.js → chunk-R4EFOLOT.js} +1 -1
  11. package/dist/chunks/{chunk-S63MCVEE.js → chunk-WWLYHXN4.js} +1 -1
  12. package/dist/chunks/{chunk-Y3CRPIPD.js → chunk-Y7YKT7VT.js} +1 -1
  13. package/dist/chunks/{fitment-data-UPS55DR5.js → fitment-data-VXH4D2UD.js} +1 -1
  14. package/dist/chunks/{section-css-style-VSIE7KKW.js → section-css-style-GUVXWUWX.js} +1 -1
  15. package/dist/index.js +23 -23
  16. package/dist/render/built-with.json +1 -1
  17. package/dist/routine-index.json +1 -1
  18. package/dist/value-index.json +1 -1
  19. package/package.json +2 -2
  20. package/dist/chunks/SiteEditorProvider-QDGGCHUC.js +0 -1
  21. /package/dist/chunks/{chunk-RDWFRHEV.js.LEGAL.txt → chunk-6AODAOZ5.js.LEGAL.txt} +0 -0
  22. /package/dist/chunks/{chunk-GAND7LXQ.js → chunk-BA5HNYFW.js} +0 -0
  23. /package/dist/chunks/{chunk-RNSKQVLG.js → chunk-ERLKLMUX.js} +0 -0
  24. /package/dist/chunks/{chunk-62AOYUOH.js → chunk-PPCAEV32.js} +0 -0
  25. /package/dist/chunks/{chunk-S63MCVEE.js.LEGAL.txt → chunk-WWLYHXN4.js.LEGAL.txt} +0 -0
@@ -1 +1 @@
1
- import{S as Q,X as Yt,_ as Xt,aa as Qt,ba as jt,da as U,g as Vt}from"./chunk-VBCLGIPA.js";import{O as Wt,aa as at,ba as lt,da as Bt,ka as ct,la as Gt}from"./chunk-75GXE5JB.js";import{j as q}from"./chunk-62AOYUOH.js";import{Hi as ve,Ii as Kt,ji as ze,pi as qt,vf as $t,wi as ut}from"./chunk-Y3CRPIPD.js";import{c as zt}from"./chunk-RNSKQVLG.js";import{createContext as pr,useContext as an,useEffect as mr,useMemo as Pe,useState as on}from"react";function Jt(e,t){return e.map(n=>({partNumber:n.partNumber,quantity:n.wheels*t}))}function he(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 dt=4,si=1;function ur(e){return e.spareAxle??"front"}var ai={unit:"set",spares:0,spareSide:"left"};function en(e){return e.unit==="single"?1:dt+e.spares}function tn(e,t){return[{partNumber:e.partNumber,wheels:en(t),prices:e.prices}]}function nn(e,t){let n=en(t)-dt;if(n<=0||e.length===0)return e;let r=cr(e),o=r?null:dr(e),i=r?r[t.spareSide]:o?o[t.spareSide][ur(t)]:0;return e.map((s,a)=>a===i?{...s,wheels:s.wheels+n}:s)}function cr(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 dr(e){let t={};for(let s=0;s<e.length;s+=1){let{hand:a,axle:c}=e[s];if(a!=="left"&&a!=="right"||c!=="front"&&c!=="rear")return null;let u=`${a}-${c}`;if(t[u]!==void 0)return null;t[u]=s}let{"left-front":n,"left-rear":r,"right-front":o,"right-rear":i}=t;return n!==void 0&&r!==void 0&&o!==void 0&&i!==void 0?{left:{front:n,rear:r},right:{front:o,rear:i}}:null}function ft(e){let t=typeof e.spares=="number"?e.spares:e.spare?1:0;return{unit:e.unit,spares:t,spareSide:e.spareSide??"left",...e.spareAxle?{spareAxle:e.spareAxle}:{}}}function pt(e,t){return t.spares>0?`${e} + spare`:e}function rn(e){return e.unit==="single"?"Single":pt(`Set of ${dt}`,e)}var li="data-add-to-basket",mt=9,fr="en",Zt=new Map;function qe(e,t,n){let r=`${e}|${t??""}|${n??""}`,o=Zt.get(r);return o||(o=new Intl.NumberFormat(fr,{style:"currency",currency:e,...t===void 0?{}:{minimumFractionDigits:t},...n===void 0?{}:{maximumFractionDigits:n}}),Zt.set(r,o)),o}function te(e,t,n=0){return qe(t,0,n).format(e)}function ui(e,t){return qe(t).format(e)}function ci(e,t){let n=e.savings[t];if(n===void 0)return null;let r=te(n,t);return e.savingIsFrom?`Save from ${r}`:`Save ${r}`}import{jsx as br}from"react/jsx-runtime";var gr="storefront-country",sn=gr,gt=pr(null);function yr(e){return ln(e,"catalogue")}function hr(e){return ln(e,"money")}function ln(e,t){let n=new Map(e.map(r=>[r.code,r.decimalPlaces]));return(r,o)=>{if(!o)return"";let i=n.get(o)??0;return qe(o,t==="money"?i:0,i).format(r)}}function gi({children:e,currencies:t,countries:n,defaultCurrency:r,defaultCountry:o}){let i=Pe(()=>t??[],[t]),s=Pe(()=>n??[],[n]),a=Pe(()=>r||i.find(g=>g.isDefault)?.code||i[0]?.code||"",[r,i]),c=Pe(()=>o||s.find(g=>g.isDefault)?.code||s[0]?.code||"",[o,s]),[u,m]=on(c),[C,p]=on(!1);mr(()=>{let g=q.getItem(sn);g&&s.some(L=>L.code===g)&&m(g),p(!0)},[s]);function R(g){m(g),q.setItem(sn,g)}let k=Pe(()=>{let g=s.find(b=>b.code===u)??null,L=g?.currency,w=L&&i.some(b=>b.code===L)?L:a,D=yr(i),E=hr(i);return{country:u,currency:w,setCountry:R,currencies:i,countries:s,activeCountry:g,formatPrice:(b,F)=>D(b,F??w),formatMoney:(b,F)=>E(b,F??w),ready:C}},[u,i,s,a,C]);return br(gt.Provider,{value:k,children:e})}function un(e){let t=an(gt);if(!t&&!e?.optional)throw new Error("useCurrency must be used within a CurrencyProvider");return t}function yi(){return an(gt)?.country??""}import{createContext as Gr,useCallback as _,useContext as Vr,useEffect as $,useMemo as Ln,useRef as j,useState as v}from"react";function cn(){return"/edit"}function fn(e,t){return e.valid?!1:e.reason==="firstOrderOnly"?!0:e.reason==="notEligible"&&!t}var pn="We'll confirm this discount when you place your order.",Si="Confirmed at checkout";function Ei(e){return e&&(e.valid||e.deferred)?e.code:void 0}var dn="coupon_code: ";function vi(e){return!(e instanceof Q)||e.status!==400||!e.message.startsWith(dn)?null:e.message.slice(dn.length)}function yt(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 Cr=["width","profile","rim"],_i={width:"Width",profile:"Profile",rim:"Rim"},xr=/^\s*(\d{2,3})\s*\/\s*(\d{2,3})\s*[A-Za-z]*\s*(\d{2}(?:\.\d+)?)\s*$/,Sr={width:[100,500],profile:[20,100],rim:[10,30]};function ht(e){let t=xr.exec(e??"");if(!t)return null;let n={width:Number(t[1]),profile:Number(t[2]),rim:Number(t[3])};return Cr.every(o=>{let[i,s]=Sr[o];return n[o]>=i&&n[o]<=s})?n:null}function be(e){if(e.width==null)return"";if(e.profile==null)return String(e.width);let t=`${e.width}/${e.profile}`;return e.rim==null?t:`${t} R${e.rim}`}function Ri(e){return[be({width:e.width}),be({width:e.width,profile:e.profile}),be(e)]}function Li(e){if(!e||e.year===null)return null;let{make:t,model:n,year:r,modification:o}=e;return!t||!n||!o?null:{make:t,model:n,year:r,modification:o}}function vr(e,t){let n=new URLSearchParams({make:t.make,model:t.model,year:String(t.year),modification:t.modification});return`/api/v1/tyres/${encodeURIComponent(e)}/fitment?${n.toString()}`}function Te(e,t=""){return{vehicle:{...e,region:t},status:"unknown",oemSizes:[],variants:[]}}function Pr(e,t){if(typeof t!="object"||t===null)return Te(e);let n=t,r=typeof n.vehicle=="object"&&n.vehicle!==null?n.vehicle:{},o=typeof r.region=="string"?r.region:"",i=n.status;if(i!=="fits"&&i!=="doesNotFit")return Te(e,o);let s=Array.isArray(n.variants)?n.variants.filter(a=>typeof a=="object"&&a!==null&&typeof a.sku=="string"&&typeof a.fits=="boolean"):[];return s.length===0?Te(e,o):{vehicle:{make:typeof r.make=="string"?r.make:e.make,model:typeof r.model=="string"?r.model:e.model,year:typeof r.year=="number"?r.year:e.year,modification:typeof r.modification=="string"?r.modification:e.modification,region:o},status:i,oemSizes:Array.isArray(n.oemSizes)?n.oemSizes.filter(a=>typeof a=="string"):[],variants:s.map(a=>({sku:a.sku,size:typeof a.size=="string"?a.size:"",fits:a.fits}))}}async function Ni(e,t){try{let n=await Yt(vr(e,t),{baseUrl:""});return Pr(t,n)}catch(n){return n instanceof Q&&n.status>=400&&n.status<500?Te(t):{...Te(t),failed:!0}}}function Ii(e){if(!e)return[];let t=[];for(let n of[...e.frontTyres,...e.rearTyres]){let r=ht(n);if(!r)continue;let o=be(r);t.includes(o)||t.push(o)}return t}function Oi(e,t){if(t.length===0)return null;for(let n of e){let r=ht(n);if(!r)continue;let o=be(r);if(t.includes(o))return o}return null}function Tr(e,t){if(!e||e.status==="unknown")return"unknown";let n=e.variants.find(r=>r.sku===t);return n?n.fits?"fits":"doesNotFit":"unknown"}var _r="/tyres";function mn(e){return e?`${_r}/${e}`:null}function Ke(e){let t=e.lastIndexOf(" ");return t===-1?{lead:"",accent:e}:{lead:e.slice(0,t+1),accent:e.slice(t+1)}}function Rr(e,t){return tn({partNumber:e.sku,prices:e.prices},t)}var Ar="Tyre";function gn(e,t,n,r){return{id:`${e.slug}|${t.sku}|${n.unit}|${n.spares>0?"spare":"no-spare"}`,slug:e.slug,name:Ke(e.name),process:e.brand||Ar,positionNo:"01",config:[{label:t.size},{label:rn(n)}],finishName:"",size:t.size,components:Rr(t,n),qty:r,href:mn(e.slug)??void 0,kind:"tyre",sku:t.sku,pack:n}}function Bi(e){return e.kind==="tyre"}function zi(e,t){let n=e.prices?.[t];return typeof n!="number"||!Number.isFinite(n)||n<=0?!1:e.inStock}var kr="dually";function Ct(e){let t=e.components.reduce((o,i)=>o+i.wheels,0)||4,n=e.kind,r=[n==="staggered"?"Staggered":n===kr?"Dually":""].filter(Boolean);return r.length?`${r.join(" ")} set of ${t}`:`Set of ${t}`}function wr(e,t){return[...new Set(e.filter(n=>!t||n.finishName===t).map(n=>n.size))]}function yn(e,t,n){if(!(!t||!n))return e.find(r=>r.finishName===t&&r.size===n)}function Lr(e){return e!=null&&e.inStock===!1}function Gi(e,t){return t?e.filter(n=>n.finishName===t&&Lr(n)):[]}function Vi(e,t,n){return t.findIndex((r,o)=>n[o]!==!1&&wr(e,r).length>0)}function Yi(e){let t=new Set((e.sizePairs??[]).map(o=>`${o.diameter}x${o.width}`)),n=e.spec?.pcds??[],r=e.spec?.etRange??[];return t.size===1&&n.length<=1&&(r.length===0||r[0]===r[r.length-1])}var bn="alloy-wheel",Nr="tyre";function Ge(e){return e.name||e.slug||"An item from your cart"}async function Cn(e,t){let n=[],r=new Map;for(let s of e){if(!s.slug){n.push(Ge(s));continue}let a=s.kind??bn,c=`${a}\0${s.slug}`,u=r.get(c);u?u.snaps.push(s):r.set(c,{kind:a,slug:s.slug,snaps:[s]})}let o=await Promise.all([...r.values()].map(s=>Ir(s,t))),i=[];for(let s of o)for(let a of s)a.ok?i.push(a.line):n.push(a.name);return{lines:i,dropped:n}}function hn(e){if(e instanceof Q&&e.status===404)return null;throw e}async function Ir(e,t){let n=e.snaps.map(r=>({ok:!1,name:Ge(r)}));if(e.kind===bn){let r=await t.getWheel(e.slug).catch(hn);return r?e.snaps.map(o=>Or(e.slug,r,o)):n}if(e.kind===Nr){let r=await t.getTyre(e.slug).catch(hn);return r?e.snaps.map(o=>Dr(r,o)):n}return n}function Or(e,t,n){let r=yn(t.variants,n.finish,n.size);if(!r)return{ok:!1,name:Ge(n)};let o=n.pack?ft(n.pack):void 0,i=(o?.spares??0)>0;return{ok:!0,line:{id:`${e}|${r.finishName}|${r.size}${i?"|spare":""}|restored`,slug:e,name:Ke(t.name),process:t.process,positionNo:"01",config:[{label:r.size},{label:r.finishName,gold:!0},{label:o?pt(Ct(r),o):Ct(r)}],finishName:r.finishName,size:r.size,components:o&&i?nn(r.components,o):r.components,qty:n.qty,...i?{pack:o}:{}}}}function Dr(e,t){let n={ok:!1,name:Ge(t)};if(!t.pack||!t.sku)return n;let r=ft(t.pack),o=e.variants.find(i=>i.sku===t.sku);return o?{ok:!0,line:gn(e,o,r,t.qty)}:n}var Ve="Price on request",rs="Request a quote",xn="from ",os="From ",is="each",Sn="Free",ss="Updating";function xt(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function St(e,t){let n=e?.[t];return xt(n)?n:null}function as(e,t,n,r){let o=St(e,n),i=St(t,n);return o===null&&i===null?0:o===null?1:i===null?-1:r==="asc"?o-i:i-o}function ls(e,t,n,r){if(n==null&&r==null)return!0;let o=St(e,t);return!(o===null||n!=null&&o<n||r!=null&&o>r)}var Fr={priced:!1,unit:null,was:null,onSale:!1,setTotal:null};function Mr(e,t,n){if(!xt(e))return Fr;let r=xt(t)&&t>e?t:null;return{priced:!0,unit:e,was:r,onSale:r!==null,setTotal:n!=null?e*n:null}}function us(e,t,n=""){return!e.priced||e.unit==null?Ve:`${n}${te(e.unit,t)}`}function cs(e,t){return e.was==null?null:te(e.was,t)}function En(e,t,n=1){let r=he(e,t);if(r===null)return{priced:!1,unit:null,isFrom:!1,setTotal:null};let o=e.reduce((s,a)=>s+a.wheels,0),i=Math.min(...e.map(s=>s.prices[t]));return{priced:!0,unit:i,isFrom:i*o!==r,setTotal:r*n}}var Hr={priced:!1,unit:null,isFrom:!1,was:null,onSale:!1,setTotal:null};function ds(e,t,n,r=1){let o=Mr(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 s=En(t.components,n,r);return s.priced?{priced:!0,unit:s.unit,isFrom:s.isFrom,was:null,onSale:!1,setTotal:s.setTotal,fromSetTotal:i}:{...Hr,fromSetTotal:i}}function fs(e,t,n=1){let r=e.map(s=>En(s,t,n)),o=r[0];return!o||o.unit==null||o.setTotal==null?null:r.every(s=>s.priced&&!s.isFrom&&s.unit===o.unit&&s.setTotal===o.setTotal)?{unit:o.unit,setTotal:o.setTotal}:null}function ps(e,t){let n=e.setTotal==null?e.openSettled:null;return`+${Ur(n?{...e,unit:n.unit,isFrom:!1}:e,t)}`}function Ur(e,t){return!e.priced||e.unit==null?Ve:`${e.isFrom?xn:""}${te(e.unit,t)}`}function ms(e,t){return e.was==null?null:te(e.was,t)}function gs(e,t){let n=e.savings[t];if(n===void 0||e.components.length===0)return null;let r=0;for(let i of e.components){let s=i.prices?.[t];if(typeof s!="number")return null;r+=s*i.quantity}let o=te(r-n,t);return{was:te(r,t),amount:e.savingIsFrom?`${xn}${o}`:o}}var $r=/^[^@\s]+@[^@\s]+\.[^@\s]+$/;function vn(e){return $r.test(e.trim())}var Pn="sf:ga-purchases",Wr=20;function _n(){return typeof window>"u"||window.parent!==window}function _e(...e){try{if(_n()||typeof window.gtag!="function")return;window.gtag(...e)}catch{}}function Br(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:he(e.components,t)??0,quantity:e.qty}}function Et(e,t){return e.filter(Re).map(n=>Br(n,t))}function Ss(e){_e("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 Rn(e,t){let n=Et([e],t);n.length!==0&&_e("event","add_to_cart",{currency:t,value:n[0].price*n[0].quantity,items:n})}function Es(e){let t=Et(e.lines,e.currency);t.length!==0&&_e("event","begin_checkout",{currency:e.currency,value:e.value,...e.coupon?{coupon:e.coupon}:{},items:t})}var Tn=new Set;function zr(e){if(Tn.has(e))return!1;Tn.add(e);try{let t=JSON.parse(q.getItem(Pn)??"[]");if(t.includes(e))return!1;q.setItem(Pn,JSON.stringify([...t,e].slice(-Wr)))}catch{}return!0}function vs(e){let t=e.confirmation;if(_n()||!zr(t.orderNumber))return;let n=t.currency,r=Number(t.grandTotal);_e("event","purchase",{transaction_id:t.orderNumber,currency:n,value:r,shipping:Number(t.freightCharge),...t.couponCode?{coupon:t.couponCode}:{},items:Et(e.lines,n)}),e.adsSendTo&&_e("event","conversion",{send_to:e.adsSendTo,transaction_id:t.orderNumber,currency:n,value:r})}var qr="Arranged after review",An="Calculated at checkout",Kr=An,_s=An;function kn({quoted:e,optionCount:t,chosenAmount:n,couponWaivesFreight:r}){return e&&t===0?"arranged":r?"free":n===void 0?"pending":n===0?"free":"charged"}function wn(e,t){return e*(100-t)/100}function Rs({discount:e,deliverySaving:t},n){return[e>0?`\u2212 ${n(e)}`:null,t>0?`${n(t)} off delivery`:null].filter(Boolean).join(" \xB7 ")}function As(e){switch(e){case"arranged":return qr;case"pending":return Kr;case"free":return Sn;case"charged":return null}}import{jsx as jr}from"react/jsx-runtime";var Yr=400,Xr=400,Qr=1500,vt="storefront-cart";function Re(e){return(e.components?.length??0)>0}function Nn(e,t){return{code:e,valid:t.valid,deferred:fn(t,t.askedAsShopper),message:t.message||void 0,effects:t.effects??void 0}}function On(e,t){return he(e.components,t)}function Pt(e,t){let n=On(e,t);return n===null?null:n*e.qty}function In(e){return e!=="tyre"}var Dn=Gr(null);function zs({children:e,preview:t=!1}){let{currency:n,country:r,formatMoney:o}=un(),[i,s]=v(t),[a,c]=v([]),[u,m]=v([]),[C,p]=v([]),[R,k]=v(!1),g=j(new Set),[L,w]=v([]),[D,E]=v(!1),[b,F]=v(null),[K,oe]=v(null),[fe,h]=v(null),[P,x]=v(0),M=_(()=>x(l=>l+1),[]),[Z,Ce]=v(void 0),[G,Ne]=v(null),[T,H]=v(null),[V,ie]=v(!1),[O,pe]=v(null),se=j(void 0),Y=_(()=>s(!0),[]),J=_(()=>s(!1),[]),Ie=_(()=>s(l=>!l),[]);$(()=>{t||typeof window>"u"||new URLSearchParams(window.location.search).get("cart")==="open"&&Y()},[Y,t]);let W=cn(),X=j(W);$(()=>{X.current!==W&&(X.current=W,t||J())},[W,t,J]);let Oe=_(l=>{Ne(f=>f?.country===l?.country&&f?.subdivision===l?.subdivision&&f?.postcode===l?.postcode?f:l)},[]),I=_((l,f)=>{E(!0),!(!f||!In(l))&&w(d=>d.includes(f)?d:[...d,f])},[]),De=D||a.length>0,ae=j(!0);$(()=>(ae.current=!0,()=>{ae.current=!1}),[]),$(()=>{if(t)return;let l=[...L,...a.filter(d=>In(d.kind)).map(d=>d.slug)],f=[...new Set(l)].filter(d=>d&&!g.current.has(d));if(f.length!==0){for(let d of f)g.current.add(d);U.listWheelsBySlug(f).then(d=>{if(!ae.current||d.length===0)return;let y=new Set(d.map(S=>S.slug));m(S=>[...S.filter(ce=>!y.has(ce.slug)),...d])})}},[t,L,a]),$(()=>{if(t||!De||R)return;let l=!0;return U.listBundles().then(f=>{l&&(p(f),k(!0))}),()=>{l=!1}},[t,De,R]);let B=b?.deliveryOptions??[],xe=b?.courier??null;$(()=>{b&&pe(l=>l&&B.some(f=>f.id===l)?l:B[0]?.id??null)},[b]);let le=_(()=>a.filter(Re).flatMap(l=>Jt(l.components,l.qty)),[a]),Se=_(async(l,f)=>{let d=l.trim().toUpperCase();if(!d)return;let y=le();if(y.length===0){H({code:d,valid:!1,message:"Add a wheel to the cart first."});return}ie(!0),se.current=f;try{let S=await U.validateCoupon({code:d,items:y,currency:n,shippingMethodId:O??void 0,customerEmail:f});H(Nn(d,S))}catch{H({code:d,valid:!1,unchecked:!0,message:"Could not check that code. Please try again."})}finally{ie(!1)}},[le,n,O]),me=_(()=>{H(null),se.current=void 0},[]),Fe=_(l=>{if(!T)return;let{code:f}=T;H(d=>d&&d.code===f?{code:f,valid:!1,refused:!0,message:l}:d)},[T]);$(()=>{if(!T||T.refused)return;let l=T.code,f=y=>y!==null&&y.code===l&&!y.refused,d=setTimeout(async()=>{let y=le();if(y.length===0){H(S=>f(S)?{code:l,valid:!1,message:"Add a wheel to the cart first."}:S);return}ie(!0);try{let S=await U.validateCoupon({code:l,items:y,currency:n,shippingMethodId:O??void 0,customerEmail:se.current});H(ce=>f(ce)?Nn(l,S):ce)}catch{}finally{ie(!1)}},Yr);return()=>clearTimeout(d)},[a,n,O]);let ue=T&&!T.refused?T.code:void 0;$(()=>{if(t)return;let l=!0,f=a,d=setTimeout(async()=>{let y=le();if(y.length===0){F(null),oe(null),Ce(void 0);return}try{let S=await U.quoteCart({items:y,currency:n,shippingMethodId:O??void 0,couponCode:ue,customerEmail:se.current||void 0,country:G?.country||r||void 0,subdivision:G?.country&&G.subdivision||void 0,postcode:G?.country&&G.postcode||void 0});if(!l)return;F(S),oe(f),h(null)}catch{if(!l)return;h(f)}Ce(ue)},Xr);return()=>{l=!1,clearTimeout(d)}},[a,n,O,ue,r,G,P]);let A=_(l=>{c(f=>{let d=f.findIndex(y=>y.id===l.id);return d===-1?[...f,l]:f.map((y,S)=>S===d?{...y,qty:Math.min(mt,y.qty+l.qty)}:y)}),Rn(l,n)},[n]),ee=_(l=>{c(f=>f.filter(d=>d.id!==l))},[]),Me=_((l,f)=>{let d=Math.max(1,Math.min(mt,f));c(y=>y.map(S=>S.id===l?{...S,qty:d}:S))},[]),He=_(l=>{c(l)},[]),[Ue,tt]=v(!1),[Lt,er]=v([]),Nt=j(a);Nt.current=a,$(()=>{if(t)return;let l=[];try{let d=JSON.parse(q.getItem(vt)??"[]");Array.isArray(d)&&(l=d)}catch{}if(l.length===0){tt(!0);return}let f=!0;return Cn(l,U).then(({lines:d,dropped:y})=>{f&&(Nt.current.length===0&&(He(d),er(y)),tt(!0))},d=>{f&&tt(!0)}),()=>{f=!1}},[t,He]),$(()=>{if(t||!Ue)return;let l=a.filter(Re);if(l.length===0){q.removeItem(vt);return}q.setItem(vt,JSON.stringify(yt(l,()=>"")))},[a,t,Ue]);let[Ee,tr]=v(null),It=j(null);It.current=Ee;let z=j(null),nt=j(""),Ot=_((l,f)=>{let d=l.trim().toLowerCase();vn(d)&&tr(y=>y&&y.email===d&&y.firstName===(f??"")?y:{email:d,firstName:f??""})},[]);$(()=>{if(t||!Ee)return;let l=yt(a.filter(Re),y=>Pt(y,n)===null?Ve:o(Pt(y,n),n)),f={email:Ee.email,firstName:Ee.firstName,currency:n,items:l},d=JSON.stringify(f);if(d!==nt.current)return z.current&&clearTimeout(z.current),z.current=setTimeout(()=>{z.current=null,nt.current=d,U.captureCart(f).catch(y=>{})},Qr),()=>{z.current&&(clearTimeout(z.current),z.current=null)}},[a,Ee,n,t]);let Dt=_(()=>{z.current&&(clearTimeout(z.current),z.current=null);let l=It.current;l&&(nt.current="",U.captureCart({email:l.email,firstName:l.firstName,currency:n,items:[]}).catch(f=>{}))},[n]),Ft=Ln(()=>{let l=a.reduce((N,ye)=>{let Be=Pt(ye,n);return Be===null?N:N+Be},0),f=a.some(N=>On(N,n)===null),d=a.reduce((N,ye)=>N+ye.qty,0),y=T?.valid?T.effects:void 0,S=y?Math.min(l,Number(y.discountAmount)):0,ce=b?.bundleDiscount??0,rr=b?.appliedBundles??[],$e=!!y?.freeShipping,ge=B.find(N=>N.id===O),rt=Number(y?.deliveryDiscountPercent??0),We=!$e&&rt>0&&rt<100?rt:0,ot=We>0&&ge?wn(ge.amount,We):void 0,it=$e?0:ot!==void 0&&Z!==ue?ot:b?.shipping??ot??ge?.amount??0,or=We>0&&ge?Math.max(0,ge.amount-it):0,ir=kn({quoted:b!==null,optionCount:B.length,chosenAmount:ge?.amount,couponWaivesFreight:$e}),st={};for(let N of y?.freeUnits??[])st[N.partNumber]=(st[N.partNumber]??0)+N.quantity;let sr=b?.tax??null,ar=b?b.grandTotal:l-S-ce+it;return{sets:d,units:a.reduce((N,ye)=>N+(ye.components??[]).reduce((Be,lr)=>Be+lr.wheels*ye.qty,0),0),subtotal:l,hasUnpricedLine:f,discount:S,bundleDiscount:ce,appliedBundles:rr,shipping:it,freeShipping:$e,deliveryDiscountPercent:We,deliverySaving:or,shippingStatus:ir,freeUnitsByPartNumber:st,tax:sr,grand:ar,repricing:!!T?.refused&&b!==null&&Z===T?.code,quoted:b!==null&&K===a,serverSubtotal:b?.subtotal??null,quoteFailed:fe===a,currency:n}},[a,n,T,ue,B,O,b,Z,K,fe]),Mt=j(!0),Ht=_(l=>{Mt.current=l},[]),Ut=_(l=>{A(l),Mt.current&&Y()},[A,Y]),nr=Ln(()=>({isOpen:i,preview:t,open:Y,close:J,toggle:Ie,items:a,basketRead:t||Ue,catalog:u,bundles:C,warmCatalog:I,add:A,addAndOpen:Ut,setAutoOpen:Ht,remove:ee,setQty:Me,replaceItems:He,restoreDropped:Lt,identify:Ot,clearCapturedCart:Dt,coupon:T,applyCoupon:Se,removeCoupon:me,refuseCoupon:Fe,couponBusy:V,deliveryOptions:B,setQuoteDestination:Oe,courier:xe,requote:M,shippingMethodId:O,setShippingMethodId:pe,totals:Ft}),[i,t,Y,J,Ie,a,Ue,u,C,I,A,Ut,Ht,ee,Me,He,Lt,Ot,Dt,T,Se,me,Fe,V,B,Oe,xe,M,O,Ft]);return jr(Dn.Provider,{value:nr,children:e})}function Fn(){let e=Vr(Dn);if(!e)throw new Error("useCart() must be called inside <CartProvider>. Mount the provider in app/layout.tsx.");return e}import{cache as ao}from"react";function Mn(e){return/(?:^|\|)(?:slug|xhost):/.test(e)}function Hn(e,t,n,r){for(;e.size>=t;){let o,i;for(let[a,c]of e){if(c.expiresAt<=r){o=a;break}i===void 0&&n(a)&&(i=a)}let s=o??i??e.keys().next().value;if(s===void 0)return;e.delete(s)}}var Zr=6e4,Jr=5e3,eo=500,Ye=new Map;async function to(e){let{host:t,matchesRequestHost:n}=await Xt();if(!t)return"";let r=await Qt();return r?`${e}|slug:${encodeURIComponent(t)}/${encodeURIComponent(r)}`:n?`${e}|host:${t}`:`${e}|xhost:${t}`}async function Un(e,t){if(await jt()!==null)return t();let n=await to(e);if(!n)return t();let r=Date.now(),o=Ye.get(n);if(o&&o.expiresAt>r)return o.load;let i=await t(),s=i.outcome.state==="failed",a=s?Jr:Zr,c=Ye.get(n)?.lastGood,u=i.outcome.state==="ok"?i:s?c:void 0,m=s&&u?u:i;return Hn(Ye,eo,Mn,r),Ye.set(n,{load:m,expiresAt:r+a,lastGood:u}),m}var no=404;function ro(e){if(e instanceof Q&&e.status===no)return{state:"absent"};let t=e instanceof Q?e.status:-1,n=e instanceof Error?e.message:String(e);return{state:"failed",status:t,detail:n}}var oo="[storefront:chrome-load-failed]";function io(e,t){console.error(`${oo} ${e} status=${t.status} \u2014 serving fallback chrome`,t.detail)}async function $n(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=ro(o);return i.state==="failed"&&io(e,i),{value:n,outcome:i}}}function so(e){return e==="production"?"silent":"banner"}var js=so("production");function lo(e,t){return e?.trim()||t}function ia({legalName:e,foundedYear:t,siteName:n},r=new Date().getFullYear()){let o=lo(e,n);return`\xA9 ${t&&t<r?`${t}\u2013${r}`:`${r}`} ${o}`}var uo={name:ve,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,privacyPage:null,termsPage:null,footerCookieSettings:!0,footerSitemap:!0,socialLinks:ct},sa=ao(async()=>Un("site",()=>$n("site",async()=>{let e=await U.getSite();return{name:Kt(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,privacyPage:e.privacyPage??null,termsPage:e.termsPage??null,footerCookieSettings:e.footerCookieSettings??!0,footerSitemap:e.footerSitemap??!0,socialLinks:Gt(e.socialLinks)}},uo)));var aa={name:ve,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,privacyPage:null,termsPage:null,footerCookieSettings:!0,footerSitemap:!0,socialLinks:ct};import{jsx as co}from"react/jsx-runtime";function ua({tone:e="bad",role:t,children:n}){return co("div",{role:t,className:["border bg-surface px-4 py-3 text-[14px] leading-relaxed text-fg",e==="good"?"border-accent":e==="bad"?"border-alert":"border-line"].join(" "),children:n})}import{jsx as ke,jsxs as Tt}from"react/jsx-runtime";import{useEffect as Xe,useId as go,useRef as Bn,useState as Qe}from"react";import{useRootIsDark as yo}from"efficient-shell/theme";import{efficientClientOpen as fo}from"efficient-easel/screen/lib/session";var Ae=new Map,po=64;async function mo(e){if(!fo())return null;try{let t=await fetch(`${zt()}/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 Wn(e){let t=Ae.get(e);if(t)return t;let n=mo(e);if(Ae.set(e,n),Ae.size>po){let r=Ae.keys().next();r.done||Ae.delete(r.value)}return n}var ho=202/22,bo=.88,Aa=16,Co="invert(1)";function ka({variant:e="header",scrolled:t=!0,src:n,reverse:r=!1,color:o=null,onLightSurface:i,reversedSrc:s,inkIsDark:a,size:c="medium",sizePx:u,sizeUnit:m,wordmark:C,siteName:p=ve,fitToContainer:R=!1,fitWordmarkToContainer:k=!1,fitFloorPx:g,hideClass:L,hideAttrs:w,part:D}){let E=C&&C.trim()?C.trim():p,[b,F]=Qe(null),K=Bn(null),oe=A=>{K.current=A};Xe(()=>{F(K.current?.ownerDocument??null)},[]);let fe=!yo({doc:b,whenUnset:!0}),h=n&&n.trim()?n.trim():null,P=!!h&&Vt(h),x=i??(fe&&t),M=o&&o.trim()?o.trim():null,Z=r&&!M,Ce=`logo-color-${go().replace(/[^A-Za-z0-9_-]/g,"")}`,G=Z&&P&&h&&s!=null?{reversed:s,inkIsDark:a??null}:null,Ne=G!==null,[T,H]=Qe(null);Xe(()=>{if(!Z||!h||!P||Ne){H(null);return}let A=!1;return H(null),Wn(h).then(ee=>{A||H(ee)}),()=>{A=!0}},[Z,h,P,Ne]);let V=G??T,ie=!!V&&V.inkIsDark!==null&&(x?!V.inkIsDark:V.inkIsDark),O=Z&&!!h&&!P&&!x,pe=ie&&V?V.reversed:h,se=pe?[pe]:[],[Y,J]=Qe(0);Xe(()=>{J(0)},[h,ie]);let Ie=e==="footer"?lt:at[c],W=u&&u>0?u:Ie,X=(u&&u>0?$t(u,m,"size",Bt):null)??`${W}px`,Oe=Math.round(W*ho),I=Y<se.length?se[Y]:null,[De,ae]=Qe(pe),B=I!==null&&I===De,xe=Bn(null);Xe(()=>{let A=xe.current;if(!A||!A.complete)return;if(A.naturalWidth>0||A.naturalHeight>0){ae(I);return}let ee=!1;return A.decode().then(()=>!ee&&ae(I),()=>!ee&&J(Me=>Me+1)),()=>{ee=!0}},[I]);let le=R||k,Se=`calc(100cqi / ${((E.length+1)*bo).toFixed(2)})`,me=le&&g&&g>0?X===`${W}px`?`${Math.min(g,W)}px`:`min(${g}px, ${X})`:null,Fe=le?me===null?`min(${X}, ${Se})`:`clamp(${me}, ${Se}, ${X})`:X,ue=Tt("span",{className:`font-display font-bold tracking-[0.18em] ${me===null?"whitespace-nowrap":"whitespace-normal"}`,style:{fontSize:Fe,lineHeight:1,...M?{color:M}:{}},"aria-label":E,children:[E,ke("span",{className:"text-accent",style:M?{color:M}:void 0,children:"."})]});return Tt("span",{ref:oe,className:Wt("inline-flex items-center",L??""),...w,...D,children:[!B&&ue,M&&I&&ke("svg",{"aria-hidden":"true",focusable:"false",width:"0",height:"0",style:{position:"absolute"},children:Tt("filter",{id:Ce,colorInterpolationFilters:"sRGB",children:[ke("feFlood",{style:{floodColor:M}}),ke("feComposite",{in2:"SourceAlpha",operator:"in"})]})}),I&&ke("img",{ref:xe,src:I,alt:E,width:Oe,height:W,className:"shrink-0 object-contain",style:{...B?{height:X,width:"auto",...R?{maxWidth:"100cqi"}:{}}:{display:"none"},...O?{filter:Co}:{},...M?{filter:`url(#${Ce})`}:{}},onLoad:()=>ae(I),onError:()=>J(A=>A+1)},I)]})}import{parseOption as je}from"efficient-shell/format";function Ia(e){return typeof e=="number"&&Number.isInteger(e)&&e>=ze.min&&e<=ze.max?e:ze.default}var Oa="fixed inset-x-0 bottom-0 top-[var(--sf-header-h,88px)]",Da=e=>!!e&&e.startsWith("/wheels/")&&e!=="/wheels",xo="data-site-main",So="shared";function Fa(e){if(!e)return!1;if(e.querySelector(`.${qt}, [${ut}="own"]`))return!0;let t=e.querySelector(`main[${xo}]`);return t!=null&&t.querySelector(`[${ut}="${So}"]`)==null}var Ma=(e,t)=>!e&&t?"var(--section-bg)":"var(--bg)",Eo=[{label:"Uppercase",value:"uppercase"},{label:"Capitalised",value:"capitalised"}],vo="uppercase",Ha=e=>je(Eo,vo,e),Po=[{label:"Icon",value:"icon"},{label:"Text",value:"text"}],To="icon",Ua=e=>je(Po,To,e),$a=[{label:"Own row",value:"top"},{label:"Same row",value:"inline"}],Wa="top",Ba=e=>e==="inline"?"inline":e==="top"||e==="bottom"?"top":null,_o="custom";function za(e,t){return e!==_o||typeof t!="string"?null:t.trim()||null}var qa=80,Ro=0,Ao=100,Ka="data-header-link-opacity",Ga="--sf-header-link-opacity";function Va(e){if(!(typeof e!="number"||!Number.isFinite(e)))return Math.min(Ao,Math.max(Ro,Math.round(e)))}var ko=[{label:"Medium",value:"medium"},{label:"Large",value:"large"}],wo="medium",Lo={medium:{size:18,stroke:1.6},large:{size:20,stroke:1.4}},No=[{label:"Cart",value:"cart"},{label:"Bag",value:"bag"}],Io="cart",Ya=e=>({cart:je(No,Io,e.cartIcon),glyph:Lo[je(ko,wo,e.iconSize)]});var Qa="w-full border-2 border-line bg-bg px-4 py-4 font-display text-[17px] tracking-[-0.005em] text-fg outline-none transition-colors placeholder:text-fg-dim hover:border-fg-dim focus:border-accent",zn="w-0 min-w-0 flex-1",ja="w-0 min-w-[7rem] flex-1";import{jsx as we,jsxs as Do}from"react/jsx-runtime";function Oo({spokes:e,mesh:t=!1,className:n}){let s=c=>Math.round(c*1e3)/1e3,a=[];for(let c=0;c<e;c++){let u=c/e*Math.PI*2-Math.PI/2;if(a.push({x1:s(100+Math.cos(u)*22),y1:s(100+Math.sin(u)*22),x2:s(100+Math.cos(u)*86),y2:s(100+Math.sin(u)*86),main:!0}),t){let m=u+Math.PI/e;a.push({x1:s(100+Math.cos(m)*22*1.4),y1:s(100+Math.sin(m)*22*1.4),x2:s(100+Math.cos(m)*78),y2:s(100+Math.sin(m)*78),main:!1})}}return Do("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:[we("circle",{cx:100,cy:100,r:92,strokeWidth:2}),we("circle",{cx:100,cy:100,r:84,strokeWidth:1,opacity:.4}),we("circle",{cx:100,cy:100,r:22,strokeWidth:2}),we("circle",{cx:100,cy:100,r:6,fill:"currentColor"}),a.map((c,u)=>we("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 tl="#c9a461",qn=[{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"}],nl={name:"",color:"var(--fg)",family:"silver",src:""};function Fo(e,t){let n=r=>{let o=qn.findIndex(i=>i.f===r);return o===-1?qn.length:o};return n(e)-n(t)||e.localeCompare(t)}function rl(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(Fo)}import{useEffect as Mo,useRef as Kn,useState as Ho}from"react";import{jsx as de,jsxs as _t}from"react/jsx-runtime";function Uo({customerEmail:e,disabled:t=!1}){let{coupon:n,applyCoupon:r,removeCoupon:o,couponBusy:i}=Fn(),[s,a]=Ho(""),c=Kn(!1),u=Kn(null);Mo(()=>{!c.current||n===null||(c.current=!1,u.current?.focus())},[n]);async function m(){t||i||!s.trim()||(c.current=!0,await r(s,e),a(""))}return _t("div",{className:"flex flex-col gap-2",children:[n===null?_t("div",{className:"flex border border-line",children:[de("input",{type:"text",value:s,onChange:C=>a(C.target.value),onKeyDown:C=>{C.key==="Enter"&&(C.preventDefault(),m())},placeholder:"Coupon code","aria-label":"Coupon code",disabled:t,className:`${zn} bg-transparent px-4 py-4 font-mono text-[11px] uppercase tracking-[0.18em] text-fg outline-none placeholder:text-fg-dim`}),de("button",{type:"button",onClick:()=>{m()},disabled:i||t,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:i?"\u2026":"Apply"})]}):_t("div",{className:["flex items-center justify-between gap-3 border px-4 py-3",n.valid?"border-accent":"border-line"].join(" "),style:n.valid?{background:"color-mix(in oklab, var(--accent) 8%, transparent)"}:void 0,children:[de("span",{className:["font-mono text-[11px] uppercase tracking-[0.22em]",n.valid?"text-accent":n.deferred||n.unchecked?"text-fg":"text-fg-dim line-through"].join(" "),children:n.code}),n.unchecked&&de("button",{type:"button",onClick:()=>{r(n.code,e)},disabled:i||t,className:"ml-auto font-mono text-[10px] uppercase tracking-[0.26em] text-btn transition-colors hover:text-fg disabled:cursor-wait disabled:opacity-60",children:i?"\u2026":"Try again"}),!t&&de("button",{ref:u,type:"button",onClick:o,"aria-label":`Remove coupon ${n.code}`,className:"font-mono text-[12px] text-fg-dim transition-colors hover:text-fg",children:"\u2715"})]}),n?.deferred?de("p",{className:"font-mono text-[10px] uppercase tracking-[0.18em] text-fg-dim",children:pn}):n&&!n.valid&&n.message&&de("p",{role:"alert",className:"font-mono text-[10px] uppercase tracking-[0.18em] text-alert",children:n.message})]})}var Rt="Ads on. Shopper can opt out.",Ze="Ads and analytics off until Accept",$o={us:{region:"us",name:"United States",model:"opt-out",law:"California CCPA / CPRA, other state laws",beforeChoice:Rt,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:Ze,footerLink:"Privacy choices",panelEyebrow:"Privacy choices",adsRowName:"Advertising"},au:{region:"au",name:"Australia",model:"opt-out",law:"Privacy Act 1988 (APPs)",beforeChoice:Rt,footerLink:"Privacy choices",panelEyebrow:"Privacy choices",adsRowName:"Advertising"},nz:{region:"nz",name:"New Zealand",model:"opt-out",law:"Privacy Act 2020",beforeChoice:Rt,footerLink:"Privacy choices",panelEyebrow:"Privacy choices",adsRowName:"Advertising"},uk:{region:"uk",name:"United Kingdom",model:"opt-in",law:"PECR, UK GDPR",beforeChoice:Ze,footerLink:"Cookie settings",panelEyebrow:"Cookie settings",adsRowName:"Advertising"},eu:{region:"eu",name:"European Union",model:"opt-in",law:"ePrivacy Directive, GDPR",beforeChoice:Ze,footerLink:"Cookie settings",panelEyebrow:"Cookie settings",adsRowName:"Advertising"},other:{region:"other",name:"All other countries",model:"opt-in",law:"Safe default",beforeChoice:Ze,footerLink:"Cookie settings",panelEyebrow:"Cookie settings",adsRowName:"Advertising"}};function Wo(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 dl(e,t,n){let r=Wo(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 fl={accept:"Accept all",reject:"Reject all",choose:"Choose",save:"Save",ok:"OK",privacyChoices:"Privacy choices",privacyPolicy:"Privacy Policy",alwaysOn:"Always on",close:"Close",cookieSettings:"Cookie settings"};var Bo={asked:!1,region:"other",model:"opt-in",analytics:!0,ads:!0,chosen:!0,gpc:!1};var zo=Bo;function yl(e=zo){if(e.asked)return e.ads?"granted":"denied"}function bl(){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 Ko,isValidElement as Go,useEffect as Vn,useId as Vo,useLayoutEffect as Qn,useRef as ne,useState as Yn}from"react";var Je=(e,t)=>!!e[t]&&!e[t].disabled;function At(e,t,n){let r=e.length;for(let o=1;o<=r;o++){let i=((t+n*o)%r+r)%r;if(Je(e,i))return i}return t}function kt(e,t){return At(e,t===1?-1:e.length,t)}function wt(e,t){return Je(e,t)?t:Math.max(kt(e,1),0)}function Gn(e,t,n){let{open:r,focus:o}=e,i=s=>({...e,...s});if(t.length===1&&/\S/.test(t)){let s=e.typed+t.toLowerCase(),a=n.findIndex((c,u)=>Je(n,u)&&c.label.toLowerCase().startsWith(s));return{state:i({open:!0,typed:s,focus:a>=0?a: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:At(n,o,1)}),handled:!0};case"ArrowUp":return{state:i({focus:At(n,o,-1)}),handled:!0};case"Home":return{state:i({focus:kt(n,1)}),handled:!0};case"End":return{state:i({focus:kt(n,-1)}),handled:!0};case"Enter":case" ":return Je(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 Yo}from"efficient-shell/ui";import{Fragment as ti,jsx as re,jsxs as jn}from"react/jsx-runtime";var Xn={body:"text-[length:var(--size-body,14px)]",label:"text-[length:var(--size-label,13px)]"};function Xo({items:e,value:t,onPick:n,open:r,onOpen:o,onClose:i}){let[s,a]=Yn(!1),c=r!==void 0,u=c?r:s,[m,C]=Yn(0),p=ne({text:"",timer:0}),R=ne(null),k=ne(null),g=ne(null),L=Vo(),w=ne(null),D=e.findIndex(h=>h.value===t),E=h=>{h!==u&&(c||a(h),h?o?.():i?.())},b=h=>{let P=e[h];!P||P.disabled||(n(P.value),E(!1),k.current?.focus())},F=h=>{let P={open:u,focus:u?m:wt(e,D),typed:p.current.text},x=Gn(P,h,e);return!x.handled&&x.state.open===u?!1:(x.state.typed!==P.typed&&(p.current.text=x.state.typed,window.clearTimeout(p.current.timer),p.current.timer=window.setTimeout(()=>{p.current.text=""},500)),C(x.state.focus),x.commit!==void 0?b(x.commit):E(x.state.open),x.refocus&&k.current?.focus(),x.handled)},K=ne(F);K.current=F;let oe=ne(()=>E(!1));oe.current=()=>E(!1);let fe=h=>{u||(w.current=h.nativeEvent,K.current(h.key)&&h.preventDefault())};return Vn(()=>{if(!u)return;let h=x=>{R.current?.contains(x.target)||oe.current()},P=x=>{x!==w.current&&K.current(x.key)&&x.preventDefault()};return document.addEventListener("mousedown",h),document.addEventListener("keydown",P),()=>{document.removeEventListener("mousedown",h),document.removeEventListener("keydown",P)}},[u]),Vn(()=>{u&&(p.current.text||C(wt(e,D)))},[u]),Qn(()=>{if(!u||!g.current)return;g.current.children.item(m)?.scrollIntoView({block:"nearest"})},[m,u]),{open:u,toggle:()=>E(!u),close:()=>E(!1),focusIdx:m,setFocusIdx:C,pick:h=>b(e.findIndex(P=>P.value===h)),wrapRef:R,triggerRef:k,listRef:g,listId:L,onTriggerKeyDown:fe,activeId:u?`${L}-${m}`:void 0}}var Qo={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 ${Xn.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 ${Xn.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 jo(e,t){Qn(()=>{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 s=n.offsetParent??n.parentElement;if(!s)return;let a=s.getBoundingClientRect(),c=n.getBoundingClientRect(),u=Math.abs(c.right-a.right)<Math.abs(c.left-a.left)?"end":"start",m=Yo({trigger:{left:a.left,right:a.right,top:a.top,bottom:a.bottom},menu:{width:c.width,height:c.height},bounds:{left:0,top:0,right:r.innerWidth,bottom:r.innerHeight},align:u,side:"bottom"});if(m.side==="top"){i.top="auto",i.bottom="100%",i.marginTop="0px";let p=m.top+Math.min(c.height,m.maxHeight);i.marginBottom=`${Math.max(0,a.top-p)}px`}m.maxHeight<c.height&&(i.maxHeight=`${m.maxHeight}px`,i.overflowY="auto");let C=m.left-c.left;C&&(i.translate=`${C}px`)};return o(),r.addEventListener("resize",o),r.addEventListener("scroll",o,!0),()=>{r.removeEventListener("resize",o),r.removeEventListener("scroll",o,!0)}},[e,t])}function Zo(e){return e.split(" ").map(t=>t==="left-0"?"right-0":t).join(" ")}function Jo({id:e,tone:t,items:n,value:r,focusIdx:o,onFocus:i,onPick:s,listRef:a,ariaLabel:c,align:u="start"}){let m=Qo[t],C=ne(null);return jo(C,n.length),re("ul",{ref:p=>{C.current=p,a&&(a.current=p)},id:e,role:"listbox","aria-label":c,...m.pickerMarker?{"data-picker-menu":""}:{},className:u==="end"?Zo(m.list):m.list,children:n.map((p,R)=>{let k=p.value===r;return re("li",{id:`${e}-${R}`,role:"option","aria-selected":k,"aria-disabled":p.disabled||void 0,onMouseEnter:()=>!p.disabled&&i(R),onMouseDown:g=>{g.preventDefault(),p.disabled||s(p.value)},className:m.item(R===o,k&&p.value!=="",!!p.disabled,R===n.length-1),style:m.itemStyle?.(k),children:p.meta===void 0?p.label:jn(ti,{children:[p.lead,re("span",{className:"flex-1 whitespace-nowrap",children:p.label}),re("span",{className:"ml-auto text-[12px] opacity-50",children:p.meta})]})},`${p.value}_${R}`)})})}function ei({value:e,onChange:t,disabled:n,children:r,className:o,style:i,name:s,id:a,"aria-label":c,align:u}){let m=Ko.toArray(r).flatMap(g=>{if(!Go(g))return[];if(g.type!=="option")return[];let w=g.props,D=w.value!==void 0?String(w.value):"",E=w.children,b=typeof E=="string"||typeof E=="number"?String(E):D;return[{value:D,label:b,disabled:!!w.disabled}]}),C=e??"",p=Xo({items:m,value:C,onPick:g=>t?.({target:{value:g}})}),k=m.find(g=>g.value===C)?.label??m[0]?.label??"";return jn("div",{ref:p.wrapRef,className:"relative",children:[s&&re("input",{type:"hidden",name:s,value:C}),re("button",{ref:g=>{p.triggerRef.current=g},type:"button",disabled:n,"aria-haspopup":"listbox","aria-expanded":p.open,"aria-controls":p.open?p.listId:void 0,"aria-activedescendant":p.activeId,"aria-label":c,id:a,onClick:()=>!n&&p.toggle(),onKeyDown:g=>!n&&p.onTriggerKeyDown(g),className:`block w-full ${o??""}`,style:i,children:re("span",{className:"block w-full truncate text-left",children:k})}),p.open&&re(Jo,{id:p.listId,tone:"select",items:m,value:C,focusIdx:p.focusIdx,onFocus:p.setFocusIdx,onPick:p.pick,listRef:p.listRef,align:u})]})}import{jsx as Le,jsxs as et}from"react/jsx-runtime";var ni="font-mono text-[length:var(--size-label,12px)]",ri="font-semibold uppercase tracking-[0.22em] text-fg";function Zn(e){return`${e??ni} ${ri}`}function Jn(){return Le("span",{className:"text-accent",children:" *"})}function oi({children:e,required:t,labelFace:n}){return et("span",{className:Zn(n),children:[e,t?Le(Jn,{}):null]})}function ii({label:e,required:t,hint:n,separate:r,htmlFor:o,labelFace:i,className:s,children:a}){let c=s?`flex flex-col gap-2 ${s}`:"flex flex-col gap-2",u=n?Le("span",{className:"font-mono text-[11px] uppercase tracking-[0.22em] text-fg-dim",children:n}):null;return r||n?et("div",{className:c,children:[et("label",{htmlFor:o,className:Zn(i),children:[e,t?Le(Jn,{}):null]}),a,u]}):et("label",{htmlFor:o,className:c,children:[Le(oi,{required:t,labelFace:i,children:e}),a]})}export{cn as a,Si as b,Ei as c,vi as d,Jt as e,dt as f,si as g,ur as h,ai as i,nn as j,cr as k,dr as l,pt as m,rn as n,li as o,mt as p,qe as q,te as r,ui as s,ci as t,Cr as u,_i as v,ht as w,be as x,Ri as y,Li as z,Te as A,Ni as B,Ii as C,Oi as D,Tr as E,mn as F,Ke as G,Rr as H,gn as I,Bi as J,zi as K,Ct as L,yn as M,Lr as N,Gi as O,Vi as P,Yi as Q,Ve as R,rs as S,xn as T,os as U,is as V,Sn as W,ss as X,St as Y,as as Z,ls as _,Mr as $,us as aa,cs as ba,En as ca,ds as da,fs as ea,ps as fa,Ur as ga,ms as ha,gs as ia,vn as ja,Ss as ka,Es as la,vs as ma,_s as na,wn as oa,Rs as pa,As as qa,gi as ra,un as sa,yi as ta,Re as ua,Pt as va,zs as wa,Fn as xa,ia as ya,uo as za,aa as Aa,Ia as Ba,Oa as Ca,Da,Fa as Ea,Ma as Fa,Eo as Ga,vo as Ha,Ha as Ia,Po as Ja,Ua as Ka,$a as La,Wa as Ma,Ba as Na,_o as Oa,za as Pa,qa as Qa,Ro as Ra,Ao as Sa,Ka as Ta,Ga as Ua,Va,ko as Wa,wo as Xa,No as Ya,Io as Za,Ya as _a,Qa as $a,zn as ab,ja as bb,Oo as cb,tl as db,qn as eb,nl as fb,Fo as gb,rl as hb,Uo as ib,ua as jb,Aa as kb,ka as lb,$o as mb,dl as nb,fl as ob,Bo as pb,yl as qb,bl as rb,Xo as sb,Jo as tb,ei as ub,oi as vb,ii as wb};
1
+ import{S as Q,X as Yt,_ as Xt,aa as Qt,ba as jt,da as U,g as Vt}from"./chunk-R4EFOLOT.js";import{O as Wt,aa as at,ba as lt,da as Bt,ka as ct,la as Gt}from"./chunk-P34EYTSF.js";import{j as q}from"./chunk-PPCAEV32.js";import{Hi as ve,Ii as Kt,ji as ze,pi as qt,vf as $t,wi as ut}from"./chunk-Y7YKT7VT.js";import{c as zt}from"./chunk-ERLKLMUX.js";import{createContext as pr,useContext as an,useEffect as mr,useMemo as Pe,useState as on}from"react";function Jt(e,t){return e.map(n=>({partNumber:n.partNumber,quantity:n.wheels*t}))}function he(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 dt=4,si=1;function ur(e){return e.spareAxle??"front"}var ai={unit:"set",spares:0,spareSide:"left"};function en(e){return e.unit==="single"?1:dt+e.spares}function tn(e,t){return[{partNumber:e.partNumber,wheels:en(t),prices:e.prices}]}function nn(e,t){let n=en(t)-dt;if(n<=0||e.length===0)return e;let r=cr(e),o=r?null:dr(e),i=r?r[t.spareSide]:o?o[t.spareSide][ur(t)]:0;return e.map((s,a)=>a===i?{...s,wheels:s.wheels+n}:s)}function cr(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 dr(e){let t={};for(let s=0;s<e.length;s+=1){let{hand:a,axle:c}=e[s];if(a!=="left"&&a!=="right"||c!=="front"&&c!=="rear")return null;let u=`${a}-${c}`;if(t[u]!==void 0)return null;t[u]=s}let{"left-front":n,"left-rear":r,"right-front":o,"right-rear":i}=t;return n!==void 0&&r!==void 0&&o!==void 0&&i!==void 0?{left:{front:n,rear:r},right:{front:o,rear:i}}:null}function ft(e){let t=typeof e.spares=="number"?e.spares:e.spare?1:0;return{unit:e.unit,spares:t,spareSide:e.spareSide??"left",...e.spareAxle?{spareAxle:e.spareAxle}:{}}}function pt(e,t){return t.spares>0?`${e} + spare`:e}function rn(e){return e.unit==="single"?"Single":pt(`Set of ${dt}`,e)}var li="data-add-to-basket",mt=9,fr="en",Zt=new Map;function qe(e,t,n){let r=`${e}|${t??""}|${n??""}`,o=Zt.get(r);return o||(o=new Intl.NumberFormat(fr,{style:"currency",currency:e,...t===void 0?{}:{minimumFractionDigits:t},...n===void 0?{}:{maximumFractionDigits:n}}),Zt.set(r,o)),o}function te(e,t,n=0){return qe(t,0,n).format(e)}function ui(e,t){return qe(t).format(e)}function ci(e,t){let n=e.savings[t];if(n===void 0)return null;let r=te(n,t);return e.savingIsFrom?`Save from ${r}`:`Save ${r}`}import{jsx as br}from"react/jsx-runtime";var gr="storefront-country",sn=gr,gt=pr(null);function yr(e){return ln(e,"catalogue")}function hr(e){return ln(e,"money")}function ln(e,t){let n=new Map(e.map(r=>[r.code,r.decimalPlaces]));return(r,o)=>{if(!o)return"";let i=n.get(o)??0;return qe(o,t==="money"?i:0,i).format(r)}}function gi({children:e,currencies:t,countries:n,defaultCurrency:r,defaultCountry:o}){let i=Pe(()=>t??[],[t]),s=Pe(()=>n??[],[n]),a=Pe(()=>r||i.find(g=>g.isDefault)?.code||i[0]?.code||"",[r,i]),c=Pe(()=>o||s.find(g=>g.isDefault)?.code||s[0]?.code||"",[o,s]),[u,m]=on(c),[C,p]=on(!1);mr(()=>{let g=q.getItem(sn);g&&s.some(L=>L.code===g)&&m(g),p(!0)},[s]);function R(g){m(g),q.setItem(sn,g)}let k=Pe(()=>{let g=s.find(b=>b.code===u)??null,L=g?.currency,w=L&&i.some(b=>b.code===L)?L:a,D=yr(i),E=hr(i);return{country:u,currency:w,setCountry:R,currencies:i,countries:s,activeCountry:g,formatPrice:(b,F)=>D(b,F??w),formatMoney:(b,F)=>E(b,F??w),ready:C}},[u,i,s,a,C]);return br(gt.Provider,{value:k,children:e})}function un(e){let t=an(gt);if(!t&&!e?.optional)throw new Error("useCurrency must be used within a CurrencyProvider");return t}function yi(){return an(gt)?.country??""}import{createContext as Gr,useCallback as _,useContext as Vr,useEffect as $,useMemo as Ln,useRef as j,useState as v}from"react";function cn(){return"/edit"}function fn(e,t){return e.valid?!1:e.reason==="firstOrderOnly"?!0:e.reason==="notEligible"&&!t}var pn="We'll confirm this discount when you place your order.",Si="Confirmed at checkout";function Ei(e){return e&&(e.valid||e.deferred)?e.code:void 0}var dn="coupon_code: ";function vi(e){return!(e instanceof Q)||e.status!==400||!e.message.startsWith(dn)?null:e.message.slice(dn.length)}function yt(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 Cr=["width","profile","rim"],_i={width:"Width",profile:"Profile",rim:"Rim"},xr=/^\s*(\d{2,3})\s*\/\s*(\d{2,3})\s*[A-Za-z]*\s*(\d{2}(?:\.\d+)?)\s*$/,Sr={width:[100,500],profile:[20,100],rim:[10,30]};function ht(e){let t=xr.exec(e??"");if(!t)return null;let n={width:Number(t[1]),profile:Number(t[2]),rim:Number(t[3])};return Cr.every(o=>{let[i,s]=Sr[o];return n[o]>=i&&n[o]<=s})?n:null}function be(e){if(e.width==null)return"";if(e.profile==null)return String(e.width);let t=`${e.width}/${e.profile}`;return e.rim==null?t:`${t} R${e.rim}`}function Ri(e){return[be({width:e.width}),be({width:e.width,profile:e.profile}),be(e)]}function Li(e){if(!e||e.year===null)return null;let{make:t,model:n,year:r,modification:o}=e;return!t||!n||!o?null:{make:t,model:n,year:r,modification:o}}function vr(e,t){let n=new URLSearchParams({make:t.make,model:t.model,year:String(t.year),modification:t.modification});return`/api/v1/tyres/${encodeURIComponent(e)}/fitment?${n.toString()}`}function Te(e,t=""){return{vehicle:{...e,region:t},status:"unknown",oemSizes:[],variants:[]}}function Pr(e,t){if(typeof t!="object"||t===null)return Te(e);let n=t,r=typeof n.vehicle=="object"&&n.vehicle!==null?n.vehicle:{},o=typeof r.region=="string"?r.region:"",i=n.status;if(i!=="fits"&&i!=="doesNotFit")return Te(e,o);let s=Array.isArray(n.variants)?n.variants.filter(a=>typeof a=="object"&&a!==null&&typeof a.sku=="string"&&typeof a.fits=="boolean"):[];return s.length===0?Te(e,o):{vehicle:{make:typeof r.make=="string"?r.make:e.make,model:typeof r.model=="string"?r.model:e.model,year:typeof r.year=="number"?r.year:e.year,modification:typeof r.modification=="string"?r.modification:e.modification,region:o},status:i,oemSizes:Array.isArray(n.oemSizes)?n.oemSizes.filter(a=>typeof a=="string"):[],variants:s.map(a=>({sku:a.sku,size:typeof a.size=="string"?a.size:"",fits:a.fits}))}}async function Ni(e,t){try{let n=await Yt(vr(e,t),{baseUrl:""});return Pr(t,n)}catch(n){return n instanceof Q&&n.status>=400&&n.status<500?Te(t):{...Te(t),failed:!0}}}function Ii(e){if(!e)return[];let t=[];for(let n of[...e.frontTyres,...e.rearTyres]){let r=ht(n);if(!r)continue;let o=be(r);t.includes(o)||t.push(o)}return t}function Oi(e,t){if(t.length===0)return null;for(let n of e){let r=ht(n);if(!r)continue;let o=be(r);if(t.includes(o))return o}return null}function Tr(e,t){if(!e||e.status==="unknown")return"unknown";let n=e.variants.find(r=>r.sku===t);return n?n.fits?"fits":"doesNotFit":"unknown"}var _r="/tyres";function mn(e){return e?`${_r}/${e}`:null}function Ke(e){let t=e.lastIndexOf(" ");return t===-1?{lead:"",accent:e}:{lead:e.slice(0,t+1),accent:e.slice(t+1)}}function Rr(e,t){return tn({partNumber:e.sku,prices:e.prices},t)}var Ar="Tyre";function gn(e,t,n,r){return{id:`${e.slug}|${t.sku}|${n.unit}|${n.spares>0?"spare":"no-spare"}`,slug:e.slug,name:Ke(e.name),process:e.brand||Ar,positionNo:"01",config:[{label:t.size},{label:rn(n)}],finishName:"",size:t.size,components:Rr(t,n),qty:r,href:mn(e.slug)??void 0,kind:"tyre",sku:t.sku,pack:n}}function Bi(e){return e.kind==="tyre"}function zi(e,t){let n=e.prices?.[t];return typeof n!="number"||!Number.isFinite(n)||n<=0?!1:e.inStock}var kr="dually";function Ct(e){let t=e.components.reduce((o,i)=>o+i.wheels,0)||4,n=e.kind,r=[n==="staggered"?"Staggered":n===kr?"Dually":""].filter(Boolean);return r.length?`${r.join(" ")} set of ${t}`:`Set of ${t}`}function wr(e,t){return[...new Set(e.filter(n=>!t||n.finishName===t).map(n=>n.size))]}function yn(e,t,n){if(!(!t||!n))return e.find(r=>r.finishName===t&&r.size===n)}function Lr(e){return e!=null&&e.inStock===!1}function Gi(e,t){return t?e.filter(n=>n.finishName===t&&Lr(n)):[]}function Vi(e,t,n){return t.findIndex((r,o)=>n[o]!==!1&&wr(e,r).length>0)}function Yi(e){let t=new Set((e.sizePairs??[]).map(o=>`${o.diameter}x${o.width}`)),n=e.spec?.pcds??[],r=e.spec?.etRange??[];return t.size===1&&n.length<=1&&(r.length===0||r[0]===r[r.length-1])}var bn="alloy-wheel",Nr="tyre";function Ge(e){return e.name||e.slug||"An item from your cart"}async function Cn(e,t){let n=[],r=new Map;for(let s of e){if(!s.slug){n.push(Ge(s));continue}let a=s.kind??bn,c=`${a}\0${s.slug}`,u=r.get(c);u?u.snaps.push(s):r.set(c,{kind:a,slug:s.slug,snaps:[s]})}let o=await Promise.all([...r.values()].map(s=>Ir(s,t))),i=[];for(let s of o)for(let a of s)a.ok?i.push(a.line):n.push(a.name);return{lines:i,dropped:n}}function hn(e){if(e instanceof Q&&e.status===404)return null;throw e}async function Ir(e,t){let n=e.snaps.map(r=>({ok:!1,name:Ge(r)}));if(e.kind===bn){let r=await t.getWheel(e.slug).catch(hn);return r?e.snaps.map(o=>Or(e.slug,r,o)):n}if(e.kind===Nr){let r=await t.getTyre(e.slug).catch(hn);return r?e.snaps.map(o=>Dr(r,o)):n}return n}function Or(e,t,n){let r=yn(t.variants,n.finish,n.size);if(!r)return{ok:!1,name:Ge(n)};let o=n.pack?ft(n.pack):void 0,i=(o?.spares??0)>0;return{ok:!0,line:{id:`${e}|${r.finishName}|${r.size}${i?"|spare":""}|restored`,slug:e,name:Ke(t.name),process:t.process,positionNo:"01",config:[{label:r.size},{label:r.finishName,gold:!0},{label:o?pt(Ct(r),o):Ct(r)}],finishName:r.finishName,size:r.size,components:o&&i?nn(r.components,o):r.components,qty:n.qty,...i?{pack:o}:{}}}}function Dr(e,t){let n={ok:!1,name:Ge(t)};if(!t.pack||!t.sku)return n;let r=ft(t.pack),o=e.variants.find(i=>i.sku===t.sku);return o?{ok:!0,line:gn(e,o,r,t.qty)}:n}var Ve="Price on request",rs="Request a quote",xn="from ",os="From ",is="each",Sn="Free",ss="Updating";function xt(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function St(e,t){let n=e?.[t];return xt(n)?n:null}function as(e,t,n,r){let o=St(e,n),i=St(t,n);return o===null&&i===null?0:o===null?1:i===null?-1:r==="asc"?o-i:i-o}function ls(e,t,n,r){if(n==null&&r==null)return!0;let o=St(e,t);return!(o===null||n!=null&&o<n||r!=null&&o>r)}var Fr={priced:!1,unit:null,was:null,onSale:!1,setTotal:null};function Mr(e,t,n){if(!xt(e))return Fr;let r=xt(t)&&t>e?t:null;return{priced:!0,unit:e,was:r,onSale:r!==null,setTotal:n!=null?e*n:null}}function us(e,t,n=""){return!e.priced||e.unit==null?Ve:`${n}${te(e.unit,t)}`}function cs(e,t){return e.was==null?null:te(e.was,t)}function En(e,t,n=1){let r=he(e,t);if(r===null)return{priced:!1,unit:null,isFrom:!1,setTotal:null};let o=e.reduce((s,a)=>s+a.wheels,0),i=Math.min(...e.map(s=>s.prices[t]));return{priced:!0,unit:i,isFrom:i*o!==r,setTotal:r*n}}var Hr={priced:!1,unit:null,isFrom:!1,was:null,onSale:!1,setTotal:null};function ds(e,t,n,r=1){let o=Mr(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 s=En(t.components,n,r);return s.priced?{priced:!0,unit:s.unit,isFrom:s.isFrom,was:null,onSale:!1,setTotal:s.setTotal,fromSetTotal:i}:{...Hr,fromSetTotal:i}}function fs(e,t,n=1){let r=e.map(s=>En(s,t,n)),o=r[0];return!o||o.unit==null||o.setTotal==null?null:r.every(s=>s.priced&&!s.isFrom&&s.unit===o.unit&&s.setTotal===o.setTotal)?{unit:o.unit,setTotal:o.setTotal}:null}function ps(e,t){let n=e.setTotal==null?e.openSettled:null;return`+${Ur(n?{...e,unit:n.unit,isFrom:!1}:e,t)}`}function Ur(e,t){return!e.priced||e.unit==null?Ve:`${e.isFrom?xn:""}${te(e.unit,t)}`}function ms(e,t){return e.was==null?null:te(e.was,t)}function gs(e,t){let n=e.savings[t];if(n===void 0||e.components.length===0)return null;let r=0;for(let i of e.components){let s=i.prices?.[t];if(typeof s!="number")return null;r+=s*i.quantity}let o=te(r-n,t);return{was:te(r,t),amount:e.savingIsFrom?`${xn}${o}`:o}}var $r=/^[^@\s]+@[^@\s]+\.[^@\s]+$/;function vn(e){return $r.test(e.trim())}var Pn="sf:ga-purchases",Wr=20;function _n(){return typeof window>"u"||window.parent!==window}function _e(...e){try{if(_n()||typeof window.gtag!="function")return;window.gtag(...e)}catch{}}function Br(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:he(e.components,t)??0,quantity:e.qty}}function Et(e,t){return e.filter(Re).map(n=>Br(n,t))}function Ss(e){_e("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 Rn(e,t){let n=Et([e],t);n.length!==0&&_e("event","add_to_cart",{currency:t,value:n[0].price*n[0].quantity,items:n})}function Es(e){let t=Et(e.lines,e.currency);t.length!==0&&_e("event","begin_checkout",{currency:e.currency,value:e.value,...e.coupon?{coupon:e.coupon}:{},items:t})}var Tn=new Set;function zr(e){if(Tn.has(e))return!1;Tn.add(e);try{let t=JSON.parse(q.getItem(Pn)??"[]");if(t.includes(e))return!1;q.setItem(Pn,JSON.stringify([...t,e].slice(-Wr)))}catch{}return!0}function vs(e){let t=e.confirmation;if(_n()||!zr(t.orderNumber))return;let n=t.currency,r=Number(t.grandTotal);_e("event","purchase",{transaction_id:t.orderNumber,currency:n,value:r,shipping:Number(t.freightCharge),...t.couponCode?{coupon:t.couponCode}:{},items:Et(e.lines,n)}),e.adsSendTo&&_e("event","conversion",{send_to:e.adsSendTo,transaction_id:t.orderNumber,currency:n,value:r})}var qr="Arranged after review",An="Calculated at checkout",Kr=An,_s=An;function kn({quoted:e,optionCount:t,chosenAmount:n,couponWaivesFreight:r}){return e&&t===0?"arranged":r?"free":n===void 0?"pending":n===0?"free":"charged"}function wn(e,t){return e*(100-t)/100}function Rs({discount:e,deliverySaving:t},n){return[e>0?`\u2212 ${n(e)}`:null,t>0?`${n(t)} off delivery`:null].filter(Boolean).join(" \xB7 ")}function As(e){switch(e){case"arranged":return qr;case"pending":return Kr;case"free":return Sn;case"charged":return null}}import{jsx as jr}from"react/jsx-runtime";var Yr=400,Xr=400,Qr=1500,vt="storefront-cart";function Re(e){return(e.components?.length??0)>0}function Nn(e,t){return{code:e,valid:t.valid,deferred:fn(t,t.askedAsShopper),message:t.message||void 0,effects:t.effects??void 0}}function On(e,t){return he(e.components,t)}function Pt(e,t){let n=On(e,t);return n===null?null:n*e.qty}function In(e){return e!=="tyre"}var Dn=Gr(null);function zs({children:e,preview:t=!1}){let{currency:n,country:r,formatMoney:o}=un(),[i,s]=v(t),[a,c]=v([]),[u,m]=v([]),[C,p]=v([]),[R,k]=v(!1),g=j(new Set),[L,w]=v([]),[D,E]=v(!1),[b,F]=v(null),[K,oe]=v(null),[fe,h]=v(null),[P,x]=v(0),M=_(()=>x(l=>l+1),[]),[Z,Ce]=v(void 0),[G,Ne]=v(null),[T,H]=v(null),[V,ie]=v(!1),[O,pe]=v(null),se=j(void 0),Y=_(()=>s(!0),[]),J=_(()=>s(!1),[]),Ie=_(()=>s(l=>!l),[]);$(()=>{t||typeof window>"u"||new URLSearchParams(window.location.search).get("cart")==="open"&&Y()},[Y,t]);let W=cn(),X=j(W);$(()=>{X.current!==W&&(X.current=W,t||J())},[W,t,J]);let Oe=_(l=>{Ne(f=>f?.country===l?.country&&f?.subdivision===l?.subdivision&&f?.postcode===l?.postcode?f:l)},[]),I=_((l,f)=>{E(!0),!(!f||!In(l))&&w(d=>d.includes(f)?d:[...d,f])},[]),De=D||a.length>0,ae=j(!0);$(()=>(ae.current=!0,()=>{ae.current=!1}),[]),$(()=>{if(t)return;let l=[...L,...a.filter(d=>In(d.kind)).map(d=>d.slug)],f=[...new Set(l)].filter(d=>d&&!g.current.has(d));if(f.length!==0){for(let d of f)g.current.add(d);U.listWheelsBySlug(f).then(d=>{if(!ae.current||d.length===0)return;let y=new Set(d.map(S=>S.slug));m(S=>[...S.filter(ce=>!y.has(ce.slug)),...d])})}},[t,L,a]),$(()=>{if(t||!De||R)return;let l=!0;return U.listBundles().then(f=>{l&&(p(f),k(!0))}),()=>{l=!1}},[t,De,R]);let B=b?.deliveryOptions??[],xe=b?.courier??null;$(()=>{b&&pe(l=>l&&B.some(f=>f.id===l)?l:B[0]?.id??null)},[b]);let le=_(()=>a.filter(Re).flatMap(l=>Jt(l.components,l.qty)),[a]),Se=_(async(l,f)=>{let d=l.trim().toUpperCase();if(!d)return;let y=le();if(y.length===0){H({code:d,valid:!1,message:"Add a wheel to the cart first."});return}ie(!0),se.current=f;try{let S=await U.validateCoupon({code:d,items:y,currency:n,shippingMethodId:O??void 0,customerEmail:f});H(Nn(d,S))}catch{H({code:d,valid:!1,unchecked:!0,message:"Could not check that code. Please try again."})}finally{ie(!1)}},[le,n,O]),me=_(()=>{H(null),se.current=void 0},[]),Fe=_(l=>{if(!T)return;let{code:f}=T;H(d=>d&&d.code===f?{code:f,valid:!1,refused:!0,message:l}:d)},[T]);$(()=>{if(!T||T.refused)return;let l=T.code,f=y=>y!==null&&y.code===l&&!y.refused,d=setTimeout(async()=>{let y=le();if(y.length===0){H(S=>f(S)?{code:l,valid:!1,message:"Add a wheel to the cart first."}:S);return}ie(!0);try{let S=await U.validateCoupon({code:l,items:y,currency:n,shippingMethodId:O??void 0,customerEmail:se.current});H(ce=>f(ce)?Nn(l,S):ce)}catch{}finally{ie(!1)}},Yr);return()=>clearTimeout(d)},[a,n,O]);let ue=T&&!T.refused?T.code:void 0;$(()=>{if(t)return;let l=!0,f=a,d=setTimeout(async()=>{let y=le();if(y.length===0){F(null),oe(null),Ce(void 0);return}try{let S=await U.quoteCart({items:y,currency:n,shippingMethodId:O??void 0,couponCode:ue,customerEmail:se.current||void 0,country:G?.country||r||void 0,subdivision:G?.country&&G.subdivision||void 0,postcode:G?.country&&G.postcode||void 0});if(!l)return;F(S),oe(f),h(null)}catch{if(!l)return;h(f)}Ce(ue)},Xr);return()=>{l=!1,clearTimeout(d)}},[a,n,O,ue,r,G,P]);let A=_(l=>{c(f=>{let d=f.findIndex(y=>y.id===l.id);return d===-1?[...f,l]:f.map((y,S)=>S===d?{...y,qty:Math.min(mt,y.qty+l.qty)}:y)}),Rn(l,n)},[n]),ee=_(l=>{c(f=>f.filter(d=>d.id!==l))},[]),Me=_((l,f)=>{let d=Math.max(1,Math.min(mt,f));c(y=>y.map(S=>S.id===l?{...S,qty:d}:S))},[]),He=_(l=>{c(l)},[]),[Ue,tt]=v(!1),[Lt,er]=v([]),Nt=j(a);Nt.current=a,$(()=>{if(t)return;let l=[];try{let d=JSON.parse(q.getItem(vt)??"[]");Array.isArray(d)&&(l=d)}catch{}if(l.length===0){tt(!0);return}let f=!0;return Cn(l,U).then(({lines:d,dropped:y})=>{f&&(Nt.current.length===0&&(He(d),er(y)),tt(!0))},d=>{f&&tt(!0)}),()=>{f=!1}},[t,He]),$(()=>{if(t||!Ue)return;let l=a.filter(Re);if(l.length===0){q.removeItem(vt);return}q.setItem(vt,JSON.stringify(yt(l,()=>"")))},[a,t,Ue]);let[Ee,tr]=v(null),It=j(null);It.current=Ee;let z=j(null),nt=j(""),Ot=_((l,f)=>{let d=l.trim().toLowerCase();vn(d)&&tr(y=>y&&y.email===d&&y.firstName===(f??"")?y:{email:d,firstName:f??""})},[]);$(()=>{if(t||!Ee)return;let l=yt(a.filter(Re),y=>Pt(y,n)===null?Ve:o(Pt(y,n),n)),f={email:Ee.email,firstName:Ee.firstName,currency:n,items:l},d=JSON.stringify(f);if(d!==nt.current)return z.current&&clearTimeout(z.current),z.current=setTimeout(()=>{z.current=null,nt.current=d,U.captureCart(f).catch(y=>{})},Qr),()=>{z.current&&(clearTimeout(z.current),z.current=null)}},[a,Ee,n,t]);let Dt=_(()=>{z.current&&(clearTimeout(z.current),z.current=null);let l=It.current;l&&(nt.current="",U.captureCart({email:l.email,firstName:l.firstName,currency:n,items:[]}).catch(f=>{}))},[n]),Ft=Ln(()=>{let l=a.reduce((N,ye)=>{let Be=Pt(ye,n);return Be===null?N:N+Be},0),f=a.some(N=>On(N,n)===null),d=a.reduce((N,ye)=>N+ye.qty,0),y=T?.valid?T.effects:void 0,S=y?Math.min(l,Number(y.discountAmount)):0,ce=b?.bundleDiscount??0,rr=b?.appliedBundles??[],$e=!!y?.freeShipping,ge=B.find(N=>N.id===O),rt=Number(y?.deliveryDiscountPercent??0),We=!$e&&rt>0&&rt<100?rt:0,ot=We>0&&ge?wn(ge.amount,We):void 0,it=$e?0:ot!==void 0&&Z!==ue?ot:b?.shipping??ot??ge?.amount??0,or=We>0&&ge?Math.max(0,ge.amount-it):0,ir=kn({quoted:b!==null,optionCount:B.length,chosenAmount:ge?.amount,couponWaivesFreight:$e}),st={};for(let N of y?.freeUnits??[])st[N.partNumber]=(st[N.partNumber]??0)+N.quantity;let sr=b?.tax??null,ar=b?b.grandTotal:l-S-ce+it;return{sets:d,units:a.reduce((N,ye)=>N+(ye.components??[]).reduce((Be,lr)=>Be+lr.wheels*ye.qty,0),0),subtotal:l,hasUnpricedLine:f,discount:S,bundleDiscount:ce,appliedBundles:rr,shipping:it,freeShipping:$e,deliveryDiscountPercent:We,deliverySaving:or,shippingStatus:ir,freeUnitsByPartNumber:st,tax:sr,grand:ar,repricing:!!T?.refused&&b!==null&&Z===T?.code,quoted:b!==null&&K===a,serverSubtotal:b?.subtotal??null,quoteFailed:fe===a,currency:n}},[a,n,T,ue,B,O,b,Z,K,fe]),Mt=j(!0),Ht=_(l=>{Mt.current=l},[]),Ut=_(l=>{A(l),Mt.current&&Y()},[A,Y]),nr=Ln(()=>({isOpen:i,preview:t,open:Y,close:J,toggle:Ie,items:a,basketRead:t||Ue,catalog:u,bundles:C,warmCatalog:I,add:A,addAndOpen:Ut,setAutoOpen:Ht,remove:ee,setQty:Me,replaceItems:He,restoreDropped:Lt,identify:Ot,clearCapturedCart:Dt,coupon:T,applyCoupon:Se,removeCoupon:me,refuseCoupon:Fe,couponBusy:V,deliveryOptions:B,setQuoteDestination:Oe,courier:xe,requote:M,shippingMethodId:O,setShippingMethodId:pe,totals:Ft}),[i,t,Y,J,Ie,a,Ue,u,C,I,A,Ut,Ht,ee,Me,He,Lt,Ot,Dt,T,Se,me,Fe,V,B,Oe,xe,M,O,Ft]);return jr(Dn.Provider,{value:nr,children:e})}function Fn(){let e=Vr(Dn);if(!e)throw new Error("useCart() must be called inside <CartProvider>. Mount the provider in app/layout.tsx.");return e}import{cache as ao}from"react";function Mn(e){return/(?:^|\|)(?:slug|xhost):/.test(e)}function Hn(e,t,n,r){for(;e.size>=t;){let o,i;for(let[a,c]of e){if(c.expiresAt<=r){o=a;break}i===void 0&&n(a)&&(i=a)}let s=o??i??e.keys().next().value;if(s===void 0)return;e.delete(s)}}var Zr=6e4,Jr=5e3,eo=500,Ye=new Map;async function to(e){let{host:t,matchesRequestHost:n}=await Xt();if(!t)return"";let r=await Qt();return r?`${e}|slug:${encodeURIComponent(t)}/${encodeURIComponent(r)}`:n?`${e}|host:${t}`:`${e}|xhost:${t}`}async function Un(e,t){if(await jt()!==null)return t();let n=await to(e);if(!n)return t();let r=Date.now(),o=Ye.get(n);if(o&&o.expiresAt>r)return o.load;let i=await t(),s=i.outcome.state==="failed",a=s?Jr:Zr,c=Ye.get(n)?.lastGood,u=i.outcome.state==="ok"?i:s?c:void 0,m=s&&u?u:i;return Hn(Ye,eo,Mn,r),Ye.set(n,{load:m,expiresAt:r+a,lastGood:u}),m}var no=404;function ro(e){if(e instanceof Q&&e.status===no)return{state:"absent"};let t=e instanceof Q?e.status:-1,n=e instanceof Error?e.message:String(e);return{state:"failed",status:t,detail:n}}var oo="[storefront:chrome-load-failed]";function io(e,t){console.error(`${oo} ${e} status=${t.status} \u2014 serving fallback chrome`,t.detail)}async function $n(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=ro(o);return i.state==="failed"&&io(e,i),{value:n,outcome:i}}}function so(e){return e==="production"?"silent":"banner"}var js=so("production");function lo(e,t){return e?.trim()||t}function ia({legalName:e,foundedYear:t,siteName:n},r=new Date().getFullYear()){let o=lo(e,n);return`\xA9 ${t&&t<r?`${t}\u2013${r}`:`${r}`} ${o}`}var uo={name:ve,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,privacyPage:null,termsPage:null,footerCookieSettings:!0,footerSitemap:!0,socialLinks:ct},sa=ao(async()=>Un("site",()=>$n("site",async()=>{let e=await U.getSite();return{name:Kt(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,privacyPage:e.privacyPage??null,termsPage:e.termsPage??null,footerCookieSettings:e.footerCookieSettings??!0,footerSitemap:e.footerSitemap??!0,socialLinks:Gt(e.socialLinks)}},uo)));var aa={name:ve,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,privacyPage:null,termsPage:null,footerCookieSettings:!0,footerSitemap:!0,socialLinks:ct};import{jsx as co}from"react/jsx-runtime";function ua({tone:e="bad",role:t,children:n}){return co("div",{role:t,className:["border bg-surface px-4 py-3 text-[14px] leading-relaxed text-fg",e==="good"?"border-accent":e==="bad"?"border-alert":"border-line"].join(" "),children:n})}import{jsx as ke,jsxs as Tt}from"react/jsx-runtime";import{useEffect as Xe,useId as go,useRef as Bn,useState as Qe}from"react";import{useRootIsDark as yo}from"efficient-shell/theme";import{efficientClientOpen as fo}from"efficient-easel/screen/lib/session";var Ae=new Map,po=64;async function mo(e){if(!fo())return null;try{let t=await fetch(`${zt()}/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 Wn(e){let t=Ae.get(e);if(t)return t;let n=mo(e);if(Ae.set(e,n),Ae.size>po){let r=Ae.keys().next();r.done||Ae.delete(r.value)}return n}var ho=202/22,bo=.88,Aa=16,Co="invert(1)";function ka({variant:e="header",scrolled:t=!0,src:n,reverse:r=!1,color:o=null,onLightSurface:i,reversedSrc:s,inkIsDark:a,size:c="medium",sizePx:u,sizeUnit:m,wordmark:C,siteName:p=ve,fitToContainer:R=!1,fitWordmarkToContainer:k=!1,fitFloorPx:g,hideClass:L,hideAttrs:w,part:D}){let E=C&&C.trim()?C.trim():p,[b,F]=Qe(null),K=Bn(null),oe=A=>{K.current=A};Xe(()=>{F(K.current?.ownerDocument??null)},[]);let fe=!yo({doc:b,whenUnset:!0}),h=n&&n.trim()?n.trim():null,P=!!h&&Vt(h),x=i??(fe&&t),M=o&&o.trim()?o.trim():null,Z=r&&!M,Ce=`logo-color-${go().replace(/[^A-Za-z0-9_-]/g,"")}`,G=Z&&P&&h&&s!=null?{reversed:s,inkIsDark:a??null}:null,Ne=G!==null,[T,H]=Qe(null);Xe(()=>{if(!Z||!h||!P||Ne){H(null);return}let A=!1;return H(null),Wn(h).then(ee=>{A||H(ee)}),()=>{A=!0}},[Z,h,P,Ne]);let V=G??T,ie=!!V&&V.inkIsDark!==null&&(x?!V.inkIsDark:V.inkIsDark),O=Z&&!!h&&!P&&!x,pe=ie&&V?V.reversed:h,se=pe?[pe]:[],[Y,J]=Qe(0);Xe(()=>{J(0)},[h,ie]);let Ie=e==="footer"?lt:at[c],W=u&&u>0?u:Ie,X=(u&&u>0?$t(u,m,"size",Bt):null)??`${W}px`,Oe=Math.round(W*ho),I=Y<se.length?se[Y]:null,[De,ae]=Qe(pe),B=I!==null&&I===De,xe=Bn(null);Xe(()=>{let A=xe.current;if(!A||!A.complete)return;if(A.naturalWidth>0||A.naturalHeight>0){ae(I);return}let ee=!1;return A.decode().then(()=>!ee&&ae(I),()=>!ee&&J(Me=>Me+1)),()=>{ee=!0}},[I]);let le=R||k,Se=`calc(100cqi / ${((E.length+1)*bo).toFixed(2)})`,me=le&&g&&g>0?X===`${W}px`?`${Math.min(g,W)}px`:`min(${g}px, ${X})`:null,Fe=le?me===null?`min(${X}, ${Se})`:`clamp(${me}, ${Se}, ${X})`:X,ue=Tt("span",{className:`font-display font-bold tracking-[0.18em] ${me===null?"whitespace-nowrap":"whitespace-normal"}`,style:{fontSize:Fe,lineHeight:1,...M?{color:M}:{}},"aria-label":E,children:[E,ke("span",{className:"text-accent",style:M?{color:M}:void 0,children:"."})]});return Tt("span",{ref:oe,className:Wt("inline-flex items-center",L??""),...w,...D,children:[!B&&ue,M&&I&&ke("svg",{"aria-hidden":"true",focusable:"false",width:"0",height:"0",style:{position:"absolute"},children:Tt("filter",{id:Ce,colorInterpolationFilters:"sRGB",children:[ke("feFlood",{style:{floodColor:M}}),ke("feComposite",{in2:"SourceAlpha",operator:"in"})]})}),I&&ke("img",{ref:xe,src:I,alt:E,width:Oe,height:W,className:"shrink-0 object-contain",style:{...B?{height:X,width:"auto",...R?{maxWidth:"100cqi"}:{}}:{display:"none"},...O?{filter:Co}:{},...M?{filter:`url(#${Ce})`}:{}},onLoad:()=>ae(I),onError:()=>J(A=>A+1)},I)]})}import{parseOption as je}from"efficient-shell/format";function Ia(e){return typeof e=="number"&&Number.isInteger(e)&&e>=ze.min&&e<=ze.max?e:ze.default}var Oa="fixed inset-x-0 bottom-0 top-[var(--sf-header-h,88px)]",Da=e=>!!e&&e.startsWith("/wheels/")&&e!=="/wheels",xo="data-site-main",So="shared";function Fa(e){if(!e)return!1;if(e.querySelector(`.${qt}, [${ut}="own"]`))return!0;let t=e.querySelector(`main[${xo}]`);return t!=null&&t.querySelector(`[${ut}="${So}"]`)==null}var Ma=(e,t)=>!e&&t?"var(--section-bg)":"var(--bg)",Eo=[{label:"Uppercase",value:"uppercase"},{label:"Capitalised",value:"capitalised"}],vo="uppercase",Ha=e=>je(Eo,vo,e),Po=[{label:"Icon",value:"icon"},{label:"Text",value:"text"}],To="icon",Ua=e=>je(Po,To,e),$a=[{label:"Own row",value:"top"},{label:"Same row",value:"inline"}],Wa="top",Ba=e=>e==="inline"?"inline":e==="top"||e==="bottom"?"top":null,_o="custom";function za(e,t){return e!==_o||typeof t!="string"?null:t.trim()||null}var qa=80,Ro=0,Ao=100,Ka="data-header-link-opacity",Ga="--sf-header-link-opacity";function Va(e){if(!(typeof e!="number"||!Number.isFinite(e)))return Math.min(Ao,Math.max(Ro,Math.round(e)))}var ko=[{label:"Medium",value:"medium"},{label:"Large",value:"large"}],wo="medium",Lo={medium:{size:18,stroke:1.6},large:{size:20,stroke:1.4}},No=[{label:"Cart",value:"cart"},{label:"Bag",value:"bag"}],Io="cart",Ya=e=>({cart:je(No,Io,e.cartIcon),glyph:Lo[je(ko,wo,e.iconSize)]});var Qa="w-full border-2 border-line bg-bg px-4 py-4 font-display text-[17px] tracking-[-0.005em] text-fg outline-none transition-colors placeholder:text-fg-dim hover:border-fg-dim focus:border-accent",zn="w-0 min-w-0 flex-1",ja="w-0 min-w-[7rem] flex-1";import{jsx as we,jsxs as Do}from"react/jsx-runtime";function Oo({spokes:e,mesh:t=!1,className:n}){let s=c=>Math.round(c*1e3)/1e3,a=[];for(let c=0;c<e;c++){let u=c/e*Math.PI*2-Math.PI/2;if(a.push({x1:s(100+Math.cos(u)*22),y1:s(100+Math.sin(u)*22),x2:s(100+Math.cos(u)*86),y2:s(100+Math.sin(u)*86),main:!0}),t){let m=u+Math.PI/e;a.push({x1:s(100+Math.cos(m)*22*1.4),y1:s(100+Math.sin(m)*22*1.4),x2:s(100+Math.cos(m)*78),y2:s(100+Math.sin(m)*78),main:!1})}}return Do("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:[we("circle",{cx:100,cy:100,r:92,strokeWidth:2}),we("circle",{cx:100,cy:100,r:84,strokeWidth:1,opacity:.4}),we("circle",{cx:100,cy:100,r:22,strokeWidth:2}),we("circle",{cx:100,cy:100,r:6,fill:"currentColor"}),a.map((c,u)=>we("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 tl="#c9a461",qn=[{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"}],nl={name:"",color:"var(--fg)",family:"silver",src:""};function Fo(e,t){let n=r=>{let o=qn.findIndex(i=>i.f===r);return o===-1?qn.length:o};return n(e)-n(t)||e.localeCompare(t)}function rl(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(Fo)}import{useEffect as Mo,useRef as Kn,useState as Ho}from"react";import{jsx as de,jsxs as _t}from"react/jsx-runtime";function Uo({customerEmail:e,disabled:t=!1}){let{coupon:n,applyCoupon:r,removeCoupon:o,couponBusy:i}=Fn(),[s,a]=Ho(""),c=Kn(!1),u=Kn(null);Mo(()=>{!c.current||n===null||(c.current=!1,u.current?.focus())},[n]);async function m(){t||i||!s.trim()||(c.current=!0,await r(s,e),a(""))}return _t("div",{className:"flex flex-col gap-2",children:[n===null?_t("div",{className:"flex border border-line",children:[de("input",{type:"text",value:s,onChange:C=>a(C.target.value),onKeyDown:C=>{C.key==="Enter"&&(C.preventDefault(),m())},placeholder:"Coupon code","aria-label":"Coupon code",disabled:t,className:`${zn} bg-transparent px-4 py-4 font-mono text-[11px] uppercase tracking-[0.18em] text-fg outline-none placeholder:text-fg-dim`}),de("button",{type:"button",onClick:()=>{m()},disabled:i||t,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:i?"\u2026":"Apply"})]}):_t("div",{className:["flex items-center justify-between gap-3 border px-4 py-3",n.valid?"border-accent":"border-line"].join(" "),style:n.valid?{background:"color-mix(in oklab, var(--accent) 8%, transparent)"}:void 0,children:[de("span",{className:["font-mono text-[11px] uppercase tracking-[0.22em]",n.valid?"text-accent":n.deferred||n.unchecked?"text-fg":"text-fg-dim line-through"].join(" "),children:n.code}),n.unchecked&&de("button",{type:"button",onClick:()=>{r(n.code,e)},disabled:i||t,className:"ml-auto font-mono text-[10px] uppercase tracking-[0.26em] text-btn transition-colors hover:text-fg disabled:cursor-wait disabled:opacity-60",children:i?"\u2026":"Try again"}),!t&&de("button",{ref:u,type:"button",onClick:o,"aria-label":`Remove coupon ${n.code}`,className:"font-mono text-[12px] text-fg-dim transition-colors hover:text-fg",children:"\u2715"})]}),n?.deferred?de("p",{className:"font-mono text-[10px] uppercase tracking-[0.18em] text-fg-dim",children:pn}):n&&!n.valid&&n.message&&de("p",{role:"alert",className:"font-mono text-[10px] uppercase tracking-[0.18em] text-alert",children:n.message})]})}var Rt="Ads on. Shopper can opt out.",Ze="Ads and analytics off until Accept",$o={us:{region:"us",name:"United States",model:"opt-out",law:"California CCPA / CPRA, other state laws",beforeChoice:Rt,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:Ze,footerLink:"Privacy choices",panelEyebrow:"Privacy choices",adsRowName:"Advertising"},au:{region:"au",name:"Australia",model:"opt-out",law:"Privacy Act 1988 (APPs)",beforeChoice:Rt,footerLink:"Privacy choices",panelEyebrow:"Privacy choices",adsRowName:"Advertising"},nz:{region:"nz",name:"New Zealand",model:"opt-out",law:"Privacy Act 2020",beforeChoice:Rt,footerLink:"Privacy choices",panelEyebrow:"Privacy choices",adsRowName:"Advertising"},uk:{region:"uk",name:"United Kingdom",model:"opt-in",law:"PECR, UK GDPR",beforeChoice:Ze,footerLink:"Cookie settings",panelEyebrow:"Cookie settings",adsRowName:"Advertising"},eu:{region:"eu",name:"European Union",model:"opt-in",law:"ePrivacy Directive, GDPR",beforeChoice:Ze,footerLink:"Cookie settings",panelEyebrow:"Cookie settings",adsRowName:"Advertising"},other:{region:"other",name:"All other countries",model:"opt-in",law:"Safe default",beforeChoice:Ze,footerLink:"Cookie settings",panelEyebrow:"Cookie settings",adsRowName:"Advertising"}};function Wo(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 dl(e,t,n){let r=Wo(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 fl={accept:"Accept all",reject:"Reject all",choose:"Choose",save:"Save",ok:"OK",privacyChoices:"Privacy choices",privacyPolicy:"Privacy Policy",alwaysOn:"Always on",close:"Close",cookieSettings:"Cookie settings"};var Bo={asked:!1,region:"other",model:"opt-in",analytics:!0,ads:!0,chosen:!0,gpc:!1};var zo=Bo;function yl(e=zo){if(e.asked)return e.ads?"granted":"denied"}function bl(){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 Ko,isValidElement as Go,useEffect as Vn,useId as Vo,useLayoutEffect as Qn,useRef as ne,useState as Yn}from"react";var Je=(e,t)=>!!e[t]&&!e[t].disabled;function At(e,t,n){let r=e.length;for(let o=1;o<=r;o++){let i=((t+n*o)%r+r)%r;if(Je(e,i))return i}return t}function kt(e,t){return At(e,t===1?-1:e.length,t)}function wt(e,t){return Je(e,t)?t:Math.max(kt(e,1),0)}function Gn(e,t,n){let{open:r,focus:o}=e,i=s=>({...e,...s});if(t.length===1&&/\S/.test(t)){let s=e.typed+t.toLowerCase(),a=n.findIndex((c,u)=>Je(n,u)&&c.label.toLowerCase().startsWith(s));return{state:i({open:!0,typed:s,focus:a>=0?a: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:At(n,o,1)}),handled:!0};case"ArrowUp":return{state:i({focus:At(n,o,-1)}),handled:!0};case"Home":return{state:i({focus:kt(n,1)}),handled:!0};case"End":return{state:i({focus:kt(n,-1)}),handled:!0};case"Enter":case" ":return Je(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 Yo}from"efficient-shell/ui";import{Fragment as ti,jsx as re,jsxs as jn}from"react/jsx-runtime";var Xn={body:"text-[length:var(--size-body,14px)]",label:"text-[length:var(--size-label,13px)]"};function Xo({items:e,value:t,onPick:n,open:r,onOpen:o,onClose:i}){let[s,a]=Yn(!1),c=r!==void 0,u=c?r:s,[m,C]=Yn(0),p=ne({text:"",timer:0}),R=ne(null),k=ne(null),g=ne(null),L=Vo(),w=ne(null),D=e.findIndex(h=>h.value===t),E=h=>{h!==u&&(c||a(h),h?o?.():i?.())},b=h=>{let P=e[h];!P||P.disabled||(n(P.value),E(!1),k.current?.focus())},F=h=>{let P={open:u,focus:u?m:wt(e,D),typed:p.current.text},x=Gn(P,h,e);return!x.handled&&x.state.open===u?!1:(x.state.typed!==P.typed&&(p.current.text=x.state.typed,window.clearTimeout(p.current.timer),p.current.timer=window.setTimeout(()=>{p.current.text=""},500)),C(x.state.focus),x.commit!==void 0?b(x.commit):E(x.state.open),x.refocus&&k.current?.focus(),x.handled)},K=ne(F);K.current=F;let oe=ne(()=>E(!1));oe.current=()=>E(!1);let fe=h=>{u||(w.current=h.nativeEvent,K.current(h.key)&&h.preventDefault())};return Vn(()=>{if(!u)return;let h=x=>{R.current?.contains(x.target)||oe.current()},P=x=>{x!==w.current&&K.current(x.key)&&x.preventDefault()};return document.addEventListener("mousedown",h),document.addEventListener("keydown",P),()=>{document.removeEventListener("mousedown",h),document.removeEventListener("keydown",P)}},[u]),Vn(()=>{u&&(p.current.text||C(wt(e,D)))},[u]),Qn(()=>{if(!u||!g.current)return;g.current.children.item(m)?.scrollIntoView({block:"nearest"})},[m,u]),{open:u,toggle:()=>E(!u),close:()=>E(!1),focusIdx:m,setFocusIdx:C,pick:h=>b(e.findIndex(P=>P.value===h)),wrapRef:R,triggerRef:k,listRef:g,listId:L,onTriggerKeyDown:fe,activeId:u?`${L}-${m}`:void 0}}var Qo={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 ${Xn.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 ${Xn.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 jo(e,t){Qn(()=>{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 s=n.offsetParent??n.parentElement;if(!s)return;let a=s.getBoundingClientRect(),c=n.getBoundingClientRect(),u=Math.abs(c.right-a.right)<Math.abs(c.left-a.left)?"end":"start",m=Yo({trigger:{left:a.left,right:a.right,top:a.top,bottom:a.bottom},menu:{width:c.width,height:c.height},bounds:{left:0,top:0,right:r.innerWidth,bottom:r.innerHeight},align:u,side:"bottom"});if(m.side==="top"){i.top="auto",i.bottom="100%",i.marginTop="0px";let p=m.top+Math.min(c.height,m.maxHeight);i.marginBottom=`${Math.max(0,a.top-p)}px`}m.maxHeight<c.height&&(i.maxHeight=`${m.maxHeight}px`,i.overflowY="auto");let C=m.left-c.left;C&&(i.translate=`${C}px`)};return o(),r.addEventListener("resize",o),r.addEventListener("scroll",o,!0),()=>{r.removeEventListener("resize",o),r.removeEventListener("scroll",o,!0)}},[e,t])}function Zo(e){return e.split(" ").map(t=>t==="left-0"?"right-0":t).join(" ")}function Jo({id:e,tone:t,items:n,value:r,focusIdx:o,onFocus:i,onPick:s,listRef:a,ariaLabel:c,align:u="start"}){let m=Qo[t],C=ne(null);return jo(C,n.length),re("ul",{ref:p=>{C.current=p,a&&(a.current=p)},id:e,role:"listbox","aria-label":c,...m.pickerMarker?{"data-picker-menu":""}:{},className:u==="end"?Zo(m.list):m.list,children:n.map((p,R)=>{let k=p.value===r;return re("li",{id:`${e}-${R}`,role:"option","aria-selected":k,"aria-disabled":p.disabled||void 0,onMouseEnter:()=>!p.disabled&&i(R),onMouseDown:g=>{g.preventDefault(),p.disabled||s(p.value)},className:m.item(R===o,k&&p.value!=="",!!p.disabled,R===n.length-1),style:m.itemStyle?.(k),children:p.meta===void 0?p.label:jn(ti,{children:[p.lead,re("span",{className:"flex-1 whitespace-nowrap",children:p.label}),re("span",{className:"ml-auto text-[12px] opacity-50",children:p.meta})]})},`${p.value}_${R}`)})})}function ei({value:e,onChange:t,disabled:n,children:r,className:o,style:i,name:s,id:a,"aria-label":c,align:u}){let m=Ko.toArray(r).flatMap(g=>{if(!Go(g))return[];if(g.type!=="option")return[];let w=g.props,D=w.value!==void 0?String(w.value):"",E=w.children,b=typeof E=="string"||typeof E=="number"?String(E):D;return[{value:D,label:b,disabled:!!w.disabled}]}),C=e??"",p=Xo({items:m,value:C,onPick:g=>t?.({target:{value:g}})}),k=m.find(g=>g.value===C)?.label??m[0]?.label??"";return jn("div",{ref:p.wrapRef,className:"relative",children:[s&&re("input",{type:"hidden",name:s,value:C}),re("button",{ref:g=>{p.triggerRef.current=g},type:"button",disabled:n,"aria-haspopup":"listbox","aria-expanded":p.open,"aria-controls":p.open?p.listId:void 0,"aria-activedescendant":p.activeId,"aria-label":c,id:a,onClick:()=>!n&&p.toggle(),onKeyDown:g=>!n&&p.onTriggerKeyDown(g),className:`block w-full ${o??""}`,style:i,children:re("span",{className:"block w-full truncate text-left",children:k})}),p.open&&re(Jo,{id:p.listId,tone:"select",items:m,value:C,focusIdx:p.focusIdx,onFocus:p.setFocusIdx,onPick:p.pick,listRef:p.listRef,align:u})]})}import{jsx as Le,jsxs as et}from"react/jsx-runtime";var ni="font-mono text-[length:var(--size-label,12px)]",ri="font-semibold uppercase tracking-[0.22em] text-fg";function Zn(e){return`${e??ni} ${ri}`}function Jn(){return Le("span",{className:"text-accent",children:" *"})}function oi({children:e,required:t,labelFace:n}){return et("span",{className:Zn(n),children:[e,t?Le(Jn,{}):null]})}function ii({label:e,required:t,hint:n,separate:r,htmlFor:o,labelFace:i,className:s,children:a}){let c=s?`flex flex-col gap-2 ${s}`:"flex flex-col gap-2",u=n?Le("span",{className:"font-mono text-[11px] uppercase tracking-[0.22em] text-fg-dim",children:n}):null;return r||n?et("div",{className:c,children:[et("label",{htmlFor:o,className:Zn(i),children:[e,t?Le(Jn,{}):null]}),a,u]}):et("label",{htmlFor:o,className:c,children:[Le(oi,{required:t,labelFace:i,children:e}),a]})}export{cn as a,Si as b,Ei as c,vi as d,Jt as e,dt as f,si as g,ur as h,ai as i,nn as j,cr as k,dr as l,pt as m,rn as n,li as o,mt as p,qe as q,te as r,ui as s,ci as t,Cr as u,_i as v,ht as w,be as x,Ri as y,Li as z,Te as A,Ni as B,Ii as C,Oi as D,Tr as E,mn as F,Ke as G,Rr as H,gn as I,Bi as J,zi as K,Ct as L,yn as M,Lr as N,Gi as O,Vi as P,Yi as Q,Ve as R,rs as S,xn as T,os as U,is as V,Sn as W,ss as X,St as Y,as as Z,ls as _,Mr as $,us as aa,cs as ba,En as ca,ds as da,fs as ea,ps as fa,Ur as ga,ms as ha,gs as ia,vn as ja,Ss as ka,Es as la,vs as ma,_s as na,wn as oa,Rs as pa,As as qa,gi as ra,un as sa,yi as ta,Re as ua,Pt as va,zs as wa,Fn as xa,ia as ya,uo as za,aa as Aa,Ia as Ba,Oa as Ca,Da,Fa as Ea,Ma as Fa,Eo as Ga,vo as Ha,Ha as Ia,Po as Ja,Ua as Ka,$a as La,Wa as Ma,Ba as Na,_o as Oa,za as Pa,qa as Qa,Ro as Ra,Ao as Sa,Ka as Ta,Ga as Ua,Va,ko as Wa,wo as Xa,No as Ya,Io as Za,Ya as _a,Qa as $a,zn as ab,ja as bb,Oo as cb,tl as db,qn as eb,nl as fb,Fo as gb,rl as hb,Uo as ib,ua as jb,Aa as kb,ka as lb,$o as mb,dl as nb,fl as ob,Bo as pb,yl as qb,bl as rb,Xo as sb,Jo as tb,ei as ub,oi as vb,ii as wb};
@@ -1,2 +1,2 @@
1
- import{a as l}from"./chunk-GAND7LXQ.js";var x="data-sf-section-css",g="customCss";function m(t,e=g){let n=t?.[e];return typeof n=="string"&&n.trim()!==""?n:""}function u(t){switch(t.id){case"heading-1":return"font-display";case"heading-2":return"font-heading2";case"heading-3":return"font-heading3";case"body-1":return"font-body";case"body-5":return"font-mono";default:return`font-${t.id}`}}var o="var(--sf-heading-weight, 500)",p={"heading-1":{step:"headingLarge",fallbackPx:76,weight:o},"heading-2":{step:"headingMedium",fallbackPx:44,weight:`var(--sf-heading-2-weight, ${o})`},"heading-3":{step:"headingSmall",fallbackPx:30,weight:`var(--sf-heading-3-weight, ${o})`},"body-1":{step:"body",fallbackPx:16},"body-5":{step:"label",fallbackPx:12}};function C(t,e){let n=new Set;for(let a of e.matchAll(/\bclass="([^"]*)"/g))for(let s of a[1].split(/\s+/))s&&n.add(s);let i=[];for(let[a,{step:s,fallbackPx:d,weight:r}]of Object.entries(p)){let c=u({id:a});if(!n.has(c))continue;let f=`var(--size-${s}, ${d}px)`,h=r?[`font-size: min(${f}, var(--sf-heading-max, 9999px))`,`font-weight: ${r}`]:[`font-size: ${f}`];i.push(`:where(${t} .${c}) { ${h.join("; ")} }`)}return i.join(`
1
+ import{a as l}from"./chunk-BA5HNYFW.js";var x="data-sf-section-css",g="customCss";function m(t,e=g){let n=t?.[e];return typeof n=="string"&&n.trim()!==""?n:""}function u(t){switch(t.id){case"heading-1":return"font-display";case"heading-2":return"font-heading2";case"heading-3":return"font-heading3";case"body-1":return"font-body";case"body-5":return"font-mono";default:return`font-${t.id}`}}var o="var(--sf-heading-weight, 500)",p={"heading-1":{step:"headingLarge",fallbackPx:76,weight:o},"heading-2":{step:"headingMedium",fallbackPx:44,weight:`var(--sf-heading-2-weight, ${o})`},"heading-3":{step:"headingSmall",fallbackPx:30,weight:`var(--sf-heading-3-weight, ${o})`},"body-1":{step:"body",fallbackPx:16},"body-5":{step:"label",fallbackPx:12}};function C(t,e){let n=new Set;for(let a of e.matchAll(/\bclass="([^"]*)"/g))for(let s of a[1].split(/\s+/))s&&n.add(s);let i=[];for(let[a,{step:s,fallbackPx:d,weight:r}]of Object.entries(p)){let c=u({id:a});if(!n.has(c))continue;let f=`var(--size-${s}, ${d}px)`,h=r?[`font-size: min(${f}, var(--sf-heading-max, 9999px))`,`font-weight: ${r}`]:[`font-size: ${f}`];i.push(`:where(${t} .${c}) { ${h.join("; ")} }`)}return i.join(`
2
2
  `)}function $(t){return t.replace(/<(?=\/)/g,"\\3c ")}var b={"\\":"\\\\",'"':'\\"',"\n":"\\a ","\r":"\\d ","\f":"\\c "};function E(t){return t.replace(/[\\"\n\r\f]/g,e=>l(b,e)??e)}function P(t){let e=2166136261;for(let n=0;n<t.length;n+=1)e^=t.charCodeAt(n),e=Math.imul(e,16777619);return(e>>>0).toString(36)}export{x as a,g as b,m as c,u as d,p as e,C as f,$ as g,E as h,P as i};
@@ -1,4 +1,4 @@
1
- import{b as hu,c as gu,d as ku,e as Iu,g as Ks,h as Au,i as Ru}from"./chunk-XMX3KEE4.js";import{$ as be,$f as eu,$h as wo,Aa as Ac,Ac as Ps,Af as Ze,Ag as lu,Bc as _o,Bg as Gs,Bh as _u,Ca as O,Cc as Dc,Ci as B,Da as bo,Db as Nc,Dc as Fc,De as jc,E as vc,Ec as Bc,Ed as As,Fb as Ut,Fc as ks,Gb as Me,Gc as Mc,Hi as Du,Ia as ws,Jd as le,Jf as qc,Ka as Rc,Kf as Bs,Lf as ke,Lg as ht,Lh as Ws,Md as $c,Mf as Zc,Mh as vo,Nf as Jc,Ng as cu,Nh as Tu,Of as Wt,Oh as $,Pb as yo,Pf as ce,Pg as uu,Rg as du,Sc as Hc,Sf as Kt,Sh as Eu,Tc as Is,Td as Uc,Tf as jt,Tg as pu,Th as xu,Uh as vu,Vh as wu,Wd as Gc,Wf as Qc,Xg as fu,Xh as Cu,Yg as mu,Ze as Eo,Zf as Ms,Zh as Yt,_h as Ou,aa as wc,ag as Hs,ah as gt,ai as Pu,b as W,ba as Cc,bh as zs,c as Xe,ca as Oc,dg as tu,ea as dt,eg as nu,eh as bu,fe as Rs,ff as Ds,ga as go,i as bc,ic as Lc,ka as _n,l as mo,lg as ou,m as yc,me as To,mg as $s,n as Sc,oa as pt,oe as Gt,og as au,p as _c,pc as ft,pe as mt,pf as H,pg as ae,q as Tc,qf as F,qg as su,qh as yu,r as Ec,rc as Cs,rf as Vc,rg as ru,sc as Os,se as zc,sf as zt,sg as Ie,t as ho,te as Ns,tf as Yc,tg as Vt,u as xc,uc as So,ue as Wc,uf as Fs,va as Pc,vf as En,vi as Lu,wa as kc,wf as Xc,wg as iu,wh as Su,xa as Ic,xe as Kc,xg as Us,yb as Tn,ye as Ls,za as vs,zf as qe,zh as xo}from"./chunk-Y3CRPIPD.js";import{a as j,b as ge}from"./chunk-GAND7LXQ.js";import{d as Nu}from"./chunk-RNSKQVLG.js";var Bu="en",Co=null,Mu=Bu,Hu=null;function ZR(e,t,n){Co=e??null,Mu=t||Bu,Hu=n??null}function P(){return Hu}function JR(){return Mu}function QR(){return Co}function Fu(e,t){return t?e.replace(/\{([A-Za-z][A-Za-z0-9_]*)\}/g,(n,o)=>ge(t,o)?String(j(t,o)):n):e}function c(e,t){let n=Co?j(Co,e):void 0;if(typeof n=="function"){try{let o=W(n(t??{}));if(o)return o}catch{}return Fu(e,t)}return Fu(W(n)??e,t)}function xn(e,t,n,o){return c(n===1?e:t,{...o,n})}import{parseHexColor as Wu}from"efficient-shell/format";import{COLOR_SLOTS as Ku,FILL_COLOR_SLOTS as ty,colorRole as ny,fillColorRole as ju}from"efficient-shell/markup";import{parseHexColor as $u}from"efficient-shell/format";import{FILL_COLOR_SLOTS as Zb}from"efficient-shell/markup";var Oo=e=>{let t=pu.find(n=>n.role===e);return t?`var(${t.token})`:""},Jb=e=>Oo(e)?`var(--theme-${e})`:"",Qb={main:{ink:pt.accent,page:pt.accent,key:"accent",label:()=>c("Main"),words:e=>c("Theme {n} main color",{n:e})},text:{ink:pt.text,page:pt.text,key:"text",label:()=>c("Text"),words:e=>c("Theme {n} text color",{n:e})},background:{ink:Oo("bg"),page:Jb("bg"),key:"background",label:()=>c("Background"),words:e=>c("Theme {n} background",{n:e})},muted:{ink:pt.labels,page:pt.labels,key:"muted",label:()=>c("Muted"),words:e=>c("Theme {n} muted color",{n:e})},surface:{ink:Oo("surface"),page:Oo("surface"),key:"surface",label:()=>c("Surface"),words:e=>c("Theme {n} surface color",{n:e})}};function Je(e){return j(Qb,e)}var js="#9ca3af";function Xt(e,t,n){let o=Je(e);return o?{hex:$u(t[o.key]??"")??"",words:o.words(n)}:null}function Uu(e,t){return Zb.flatMap(n=>{let o=Xt(n,e,t);return o&&Je(n)?.ink?[{name:n,label:o.words,value:o.hex||js}]:[]})}var ey=["main","text","background"];function Gu(e){let t=new Set,n=[];return ke(e).themes.forEach((o,a)=>{for(let s of ey){let r=Je(s),i=r?o[r.key]:void 0,l=typeof i=="string"&&i?$u(i):null;!r||!l||t.has(l)||(t.add(l),n.push({value:l,label:r.words(a+1)}))}}),n}function He(e){return Je(e)?.ink??""}function Ae(e){if(typeof e!="string")return null;let t=ju(e.trim());return t?.kind==="slot"&&He(t.slot)?t.slot:null}var oy={accent:"main",labels:"muted"};function $e(e){return j(oy,e)??e}function Po(e){if(!e)return"";if(e.startsWith("#"))return Wu(e)===e.toLowerCase()?e:"";let t=ny($e(e));return t?.kind==="slot"?He(t.slot):""}function Vu(e,t=Ku){return t.flatMap(n=>{let o=Je(n);return o?.ink?[{name:n,label:o.label(),value:e?.[n]||js}]:[]})}function Yu(e){let t=ju($e(e));return t?.kind==="slot"?He(t.slot):""}function f0(e){let t=e?.trim();return t?ty.find(n=>He(n)===t)??null:null}function m0(e){let t={},n=e.ownerDocument,o=n?.defaultView;if(!n||!o)return t;let a=o.getComputedStyle(e),s=n.createElement("canvas").getContext("2d");for(let r of Ku){let i=He(r);if(!i)continue;let l=i.replace(/^var\((--[\w-]+)\)$/,"$1"),u=a.getPropertyValue(l).trim();if(!u)continue;let d=zu(u);!d&&s&&(s.fillStyle="#000000",s.fillStyle=u,d=zu(String(s.fillStyle))),d&&(t[r]=d)}return t}function zu(e){let t=e.trim().toLowerCase();if(t.startsWith("#"))return Wu(t);let n=t.match(/^rgba?\(\s*(\d+)[\s,]+(\d+)[\s,]+(\d+)/);return n?`#${n.slice(1,4).map(o=>Math.min(255,Number(o)).toString(16).padStart(2,"0")).join("")}`:null}var ko="sf.gapContainer",Ue={min:-32,max:64,step:2},td={Grid:{sm:12,md:24,lg:40},Flex:{sm:12,md:24,lg:40},FooterGroup:{sm:8,md:16,lg:32},HeroGroup:null,Events:null,GalleryB:null,ProductGrid:null},qt={Grid:24,Flex:24,FooterGroup:16,HeroGroup:0,Events:24,GalleryB:8,ProductGrid:2},ay=new Set(["Events","GalleryB"]);function vn(e,t,n){if(typeof t=="number"&&Number.isFinite(t)&&t>=Ue.min)return t;if(typeof t=="string"){let o=td[e]?.[t];if(typeof o=="number")return o}return typeof n=="number"&&Number.isFinite(n)?n:qt[e]}var sy="sf-gap-overlap",ry="--sf-gap-overlap",Vs="--sf-block-gap",Xu="--sf-block-gap-rem",ye={min:0,max:Ue.max,step:Ue.step};function wn(e){if(typeof e!="number"||!Number.isFinite(e))return null;let t=Math.min(Math.max(Math.round(e),ye.min),ye.max);return t-t%ye.step}function b0(e,t){let n=En(e,t,"gap",ye);if(n!==null)return{[Vs]:n,[Xu]:n};let o=wn(e);return o===null?{}:{[Vs]:`${o}px`,[Xu]:`${o/16}rem`}}var qu="--sf-block-gap-phone",Zu="--sf-block-gap-phone-rem",iy="--sf-block-gap-on-phone",ly="max-view-tablet:[--sf-block-gap-on-phone:var(--sf-block-gap-phone)]",cy="max-view-wide:[&_[data-sf-line~=edge]:not([data-sf-line~=edge]_*)]:[--sf-block-gap-on-phone:var(--sf-block-gap-phone)]";function y0(e,t){let n=En(e,t,"gap",ye);if(n!==null)return{[qu]:n,[Zu]:n};let o=wn(e);return o===null?{}:{[qu]:`${o}px`,[Zu]:`${o/16}rem`}}function S0(e){return wn(e)===null?"":`${ly} ${cy}`}var Ju="sf-gap-zone",Qu="--sf-gap-len";function Io(e,t){return typeof t=="number"&&Number.isFinite(t)&&t>=Ue.min?!0:typeof t=="string"&&typeof td[e]?.[t]=="number"}var ed="--sf-gap-len-phone",uy="--sf-gap-len-tablet",Cn={min:0,max:Ue.max,step:Ue.step};function Qe(e){return typeof e=="number"&&Number.isFinite(e)&&e>=Cn.min}function Ys(e){return e/2}function Xs(e,t,n){return Qe(n)&&!Io(e,t)}function qs(e,t,n,o,a){return Qe(t)?t:Xs(e,n,a)?a:Ys(vn(e,n,o))}var dy={block:"sf-gap-overlap-block",inline:"sf-gap-overlap-inline",both:"sf-gap-overlap-both"};function _0(e,t,n,o,a){let s={...Qe(o)?{[ed]:`${o}px`}:null,...Qe(a)?{[uy]:`${a}px`}:null};if(!Io(e,t)){let i=`${qt[e]}px`,l=ay.has(e)?`var(--sf-card-gap, ${i})`:i;return{className:` ${Ju}`,style:{[Qu]:`var(${Vs}, ${l})`,[ed]:`var(${iy})`,...s}}}let r=vn(e,t);return r>=0?{className:` ${Ju}`,style:{[Qu]:`${r}px`,...s}}:{className:` ${sy} ${dy[n]}`,style:{gap:"0px",[ry]:`${-r/2}px`}}}import{jsx as Js,Fragment as Sy,jsxs as _y}from"react/jsx-runtime";import{createContext as Ty,useContext as Ey,useMemo as xy}from"react";var py=4,fy={sans:"Arial",condensed:"Arial Narrow",serif:"Times New Roman",mono:"Courier New"},my={sans:"sans-serif",serif:"serif",mono:"monospace"},hy="latin",gy=/^\/(?![\/\\])[^\s"'()\\<>:]+$/,by=/^U\+[0-9A-Fa-f?]{1,6}(?:-[0-9A-Fa-f]{1,6})?(?:\s*,\s*U\+[0-9A-Fa-f?]{1,6}(?:-[0-9A-Fa-f]{1,6})?)*$/,Zs=e=>`"${Au(e)}"`,nd=e=>`${e} Fallback`;function yy(e){return typeof e?.url=="string"&&gy.test(e.url)&&typeof e.unicodeRange=="string"&&by.test(e.unicodeRange.trim())&&Number.isInteger(e.weight)&&e.weight>=1&&e.weight<=1e3&&(e.style==="normal"||e.style==="italic")}var Ao=e=>`${e}%`,Ro=e=>typeof e=="number"&&Number.isFinite(e);function od(e,t){let n={css:"",vars:{},preload:[]};if(e.siteFonts.size===0)return n;let o=[],a=[];for(let s of new Set(t)){let r=e.siteFonts.get(s),i=e.byKey.get(s);if(!r||!i)continue;let l=Zs(r.family);for(let p of r.files??[])yy(p)&&(o.push(`@font-face { font-family: ${l}; src: url("${p.url}") format("woff2"); font-weight: ${p.weight}; font-style: ${p.style}; unicode-range: ${p.unicodeRange.trim()}; font-display: swap; }`),p.subset===hy&&a.push(p));let u=r.fallbackMetrics,d=!!u&&Ro(u.ascent)&&Ro(u.descent)&&Ro(u.lineGap)&&Ro(u.sizeAdjust);if(d){let p=fy[r.condensed?"condensed":i.category];o.push(`@font-face { font-family: ${Zs(nd(r.family))}; src: local("${p}"); ascent-override: ${Ao(u.ascent)}; descent-override: ${Ao(u.descent)}; line-gap-override: ${Ao(u.lineGap)}; size-adjust: ${Ao(u.sizeAdjust)}; }`)}n.vars[i.cssVar]=Ks([l,...d?[Zs(nd(r.family))]:[],my[i.category]].join(", "))}return n.css=Ks(o.join(`
1
+ import{b as hu,c as gu,d as ku,e as Iu,g as Ks,h as Au,i as Ru}from"./chunk-IONUM72D.js";import{$ as be,$f as eu,$h as wo,Aa as Ac,Ac as Ps,Af as Ze,Ag as lu,Bc as _o,Bg as Gs,Bh as _u,Ca as O,Cc as Dc,Ci as B,Da as bo,Db as Nc,Dc as Fc,De as jc,E as vc,Ec as Bc,Ed as As,Fb as Ut,Fc as ks,Gb as Me,Gc as Mc,Hi as Du,Ia as ws,Jd as le,Jf as qc,Ka as Rc,Kf as Bs,Lf as ke,Lg as ht,Lh as Ws,Md as $c,Mf as Zc,Mh as vo,Nf as Jc,Ng as cu,Nh as Tu,Of as Wt,Oh as $,Pb as yo,Pf as ce,Pg as uu,Rg as du,Sc as Hc,Sf as Kt,Sh as Eu,Tc as Is,Td as Uc,Tf as jt,Tg as pu,Th as xu,Uh as vu,Vh as wu,Wd as Gc,Wf as Qc,Xg as fu,Xh as Cu,Yg as mu,Ze as Eo,Zf as Ms,Zh as Yt,_h as Ou,aa as wc,ag as Hs,ah as gt,ai as Pu,b as W,ba as Cc,bh as zs,c as Xe,ca as Oc,dg as tu,ea as dt,eg as nu,eh as bu,fe as Rs,ff as Ds,ga as go,i as bc,ic as Lc,ka as _n,l as mo,lg as ou,m as yc,me as To,mg as $s,n as Sc,oa as pt,oe as Gt,og as au,p as _c,pc as ft,pe as mt,pf as H,pg as ae,q as Tc,qf as F,qg as su,qh as yu,r as Ec,rc as Cs,rf as Vc,rg as ru,sc as Os,se as zc,sf as zt,sg as Ie,t as ho,te as Ns,tf as Yc,tg as Vt,u as xc,uc as So,ue as Wc,uf as Fs,va as Pc,vf as En,vi as Lu,wa as kc,wf as Xc,wg as iu,wh as Su,xa as Ic,xe as Kc,xg as Us,yb as Tn,ye as Ls,za as vs,zf as qe,zh as xo}from"./chunk-Y7YKT7VT.js";import{a as j,b as ge}from"./chunk-BA5HNYFW.js";import{d as Nu}from"./chunk-ERLKLMUX.js";var Bu="en",Co=null,Mu=Bu,Hu=null;function ZR(e,t,n){Co=e??null,Mu=t||Bu,Hu=n??null}function P(){return Hu}function JR(){return Mu}function QR(){return Co}function Fu(e,t){return t?e.replace(/\{([A-Za-z][A-Za-z0-9_]*)\}/g,(n,o)=>ge(t,o)?String(j(t,o)):n):e}function c(e,t){let n=Co?j(Co,e):void 0;if(typeof n=="function"){try{let o=W(n(t??{}));if(o)return o}catch{}return Fu(e,t)}return Fu(W(n)??e,t)}function xn(e,t,n,o){return c(n===1?e:t,{...o,n})}import{parseHexColor as Wu}from"efficient-shell/format";import{COLOR_SLOTS as Ku,FILL_COLOR_SLOTS as ty,colorRole as ny,fillColorRole as ju}from"efficient-shell/markup";import{parseHexColor as $u}from"efficient-shell/format";import{FILL_COLOR_SLOTS as Zb}from"efficient-shell/markup";var Oo=e=>{let t=pu.find(n=>n.role===e);return t?`var(${t.token})`:""},Jb=e=>Oo(e)?`var(--theme-${e})`:"",Qb={main:{ink:pt.accent,page:pt.accent,key:"accent",label:()=>c("Main"),words:e=>c("Theme {n} main color",{n:e})},text:{ink:pt.text,page:pt.text,key:"text",label:()=>c("Text"),words:e=>c("Theme {n} text color",{n:e})},background:{ink:Oo("bg"),page:Jb("bg"),key:"background",label:()=>c("Background"),words:e=>c("Theme {n} background",{n:e})},muted:{ink:pt.labels,page:pt.labels,key:"muted",label:()=>c("Muted"),words:e=>c("Theme {n} muted color",{n:e})},surface:{ink:Oo("surface"),page:Oo("surface"),key:"surface",label:()=>c("Surface"),words:e=>c("Theme {n} surface color",{n:e})}};function Je(e){return j(Qb,e)}var js="#9ca3af";function Xt(e,t,n){let o=Je(e);return o?{hex:$u(t[o.key]??"")??"",words:o.words(n)}:null}function Uu(e,t){return Zb.flatMap(n=>{let o=Xt(n,e,t);return o&&Je(n)?.ink?[{name:n,label:o.words,value:o.hex||js}]:[]})}var ey=["main","text","background"];function Gu(e){let t=new Set,n=[];return ke(e).themes.forEach((o,a)=>{for(let s of ey){let r=Je(s),i=r?o[r.key]:void 0,l=typeof i=="string"&&i?$u(i):null;!r||!l||t.has(l)||(t.add(l),n.push({value:l,label:r.words(a+1)}))}}),n}function He(e){return Je(e)?.ink??""}function Ae(e){if(typeof e!="string")return null;let t=ju(e.trim());return t?.kind==="slot"&&He(t.slot)?t.slot:null}var oy={accent:"main",labels:"muted"};function $e(e){return j(oy,e)??e}function Po(e){if(!e)return"";if(e.startsWith("#"))return Wu(e)===e.toLowerCase()?e:"";let t=ny($e(e));return t?.kind==="slot"?He(t.slot):""}function Vu(e,t=Ku){return t.flatMap(n=>{let o=Je(n);return o?.ink?[{name:n,label:o.label(),value:e?.[n]||js}]:[]})}function Yu(e){let t=ju($e(e));return t?.kind==="slot"?He(t.slot):""}function f0(e){let t=e?.trim();return t?ty.find(n=>He(n)===t)??null:null}function m0(e){let t={},n=e.ownerDocument,o=n?.defaultView;if(!n||!o)return t;let a=o.getComputedStyle(e),s=n.createElement("canvas").getContext("2d");for(let r of Ku){let i=He(r);if(!i)continue;let l=i.replace(/^var\((--[\w-]+)\)$/,"$1"),u=a.getPropertyValue(l).trim();if(!u)continue;let d=zu(u);!d&&s&&(s.fillStyle="#000000",s.fillStyle=u,d=zu(String(s.fillStyle))),d&&(t[r]=d)}return t}function zu(e){let t=e.trim().toLowerCase();if(t.startsWith("#"))return Wu(t);let n=t.match(/^rgba?\(\s*(\d+)[\s,]+(\d+)[\s,]+(\d+)/);return n?`#${n.slice(1,4).map(o=>Math.min(255,Number(o)).toString(16).padStart(2,"0")).join("")}`:null}var ko="sf.gapContainer",Ue={min:-32,max:64,step:2},td={Grid:{sm:12,md:24,lg:40},Flex:{sm:12,md:24,lg:40},FooterGroup:{sm:8,md:16,lg:32},HeroGroup:null,Events:null,GalleryB:null,ProductGrid:null},qt={Grid:24,Flex:24,FooterGroup:16,HeroGroup:0,Events:24,GalleryB:8,ProductGrid:2},ay=new Set(["Events","GalleryB"]);function vn(e,t,n){if(typeof t=="number"&&Number.isFinite(t)&&t>=Ue.min)return t;if(typeof t=="string"){let o=td[e]?.[t];if(typeof o=="number")return o}return typeof n=="number"&&Number.isFinite(n)?n:qt[e]}var sy="sf-gap-overlap",ry="--sf-gap-overlap",Vs="--sf-block-gap",Xu="--sf-block-gap-rem",ye={min:0,max:Ue.max,step:Ue.step};function wn(e){if(typeof e!="number"||!Number.isFinite(e))return null;let t=Math.min(Math.max(Math.round(e),ye.min),ye.max);return t-t%ye.step}function b0(e,t){let n=En(e,t,"gap",ye);if(n!==null)return{[Vs]:n,[Xu]:n};let o=wn(e);return o===null?{}:{[Vs]:`${o}px`,[Xu]:`${o/16}rem`}}var qu="--sf-block-gap-phone",Zu="--sf-block-gap-phone-rem",iy="--sf-block-gap-on-phone",ly="max-view-tablet:[--sf-block-gap-on-phone:var(--sf-block-gap-phone)]",cy="max-view-wide:[&_[data-sf-line~=edge]:not([data-sf-line~=edge]_*)]:[--sf-block-gap-on-phone:var(--sf-block-gap-phone)]";function y0(e,t){let n=En(e,t,"gap",ye);if(n!==null)return{[qu]:n,[Zu]:n};let o=wn(e);return o===null?{}:{[qu]:`${o}px`,[Zu]:`${o/16}rem`}}function S0(e){return wn(e)===null?"":`${ly} ${cy}`}var Ju="sf-gap-zone",Qu="--sf-gap-len";function Io(e,t){return typeof t=="number"&&Number.isFinite(t)&&t>=Ue.min?!0:typeof t=="string"&&typeof td[e]?.[t]=="number"}var ed="--sf-gap-len-phone",uy="--sf-gap-len-tablet",Cn={min:0,max:Ue.max,step:Ue.step};function Qe(e){return typeof e=="number"&&Number.isFinite(e)&&e>=Cn.min}function Ys(e){return e/2}function Xs(e,t,n){return Qe(n)&&!Io(e,t)}function qs(e,t,n,o,a){return Qe(t)?t:Xs(e,n,a)?a:Ys(vn(e,n,o))}var dy={block:"sf-gap-overlap-block",inline:"sf-gap-overlap-inline",both:"sf-gap-overlap-both"};function _0(e,t,n,o,a){let s={...Qe(o)?{[ed]:`${o}px`}:null,...Qe(a)?{[uy]:`${a}px`}:null};if(!Io(e,t)){let i=`${qt[e]}px`,l=ay.has(e)?`var(--sf-card-gap, ${i})`:i;return{className:` ${Ju}`,style:{[Qu]:`var(${Vs}, ${l})`,[ed]:`var(${iy})`,...s}}}let r=vn(e,t);return r>=0?{className:` ${Ju}`,style:{[Qu]:`${r}px`,...s}}:{className:` ${sy} ${dy[n]}`,style:{gap:"0px",[ry]:`${-r/2}px`}}}import{jsx as Js,Fragment as Sy,jsxs as _y}from"react/jsx-runtime";import{createContext as Ty,useContext as Ey,useMemo as xy}from"react";var py=4,fy={sans:"Arial",condensed:"Arial Narrow",serif:"Times New Roman",mono:"Courier New"},my={sans:"sans-serif",serif:"serif",mono:"monospace"},hy="latin",gy=/^\/(?![\/\\])[^\s"'()\\<>:]+$/,by=/^U\+[0-9A-Fa-f?]{1,6}(?:-[0-9A-Fa-f]{1,6})?(?:\s*,\s*U\+[0-9A-Fa-f?]{1,6}(?:-[0-9A-Fa-f]{1,6})?)*$/,Zs=e=>`"${Au(e)}"`,nd=e=>`${e} Fallback`;function yy(e){return typeof e?.url=="string"&&gy.test(e.url)&&typeof e.unicodeRange=="string"&&by.test(e.unicodeRange.trim())&&Number.isInteger(e.weight)&&e.weight>=1&&e.weight<=1e3&&(e.style==="normal"||e.style==="italic")}var Ao=e=>`${e}%`,Ro=e=>typeof e=="number"&&Number.isFinite(e);function od(e,t){let n={css:"",vars:{},preload:[]};if(e.siteFonts.size===0)return n;let o=[],a=[];for(let s of new Set(t)){let r=e.siteFonts.get(s),i=e.byKey.get(s);if(!r||!i)continue;let l=Zs(r.family);for(let p of r.files??[])yy(p)&&(o.push(`@font-face { font-family: ${l}; src: url("${p.url}") format("woff2"); font-weight: ${p.weight}; font-style: ${p.style}; unicode-range: ${p.unicodeRange.trim()}; font-display: swap; }`),p.subset===hy&&a.push(p));let u=r.fallbackMetrics,d=!!u&&Ro(u.ascent)&&Ro(u.descent)&&Ro(u.lineGap)&&Ro(u.sizeAdjust);if(d){let p=fy[r.condensed?"condensed":i.category];o.push(`@font-face { font-family: ${Zs(nd(r.family))}; src: local("${p}"); ascent-override: ${Ao(u.ascent)}; descent-override: ${Ao(u.descent)}; line-gap-override: ${Ao(u.lineGap)}; size-adjust: ${Ao(u.sizeAdjust)}; }`)}n.vars[i.cssVar]=Ks([l,...d?[Zs(nd(r.family))]:[],my[i.category]].join(", "))}return n.css=Ks(o.join(`
2
2
  `)),n.preload=[...a.filter(s=>s.style==="normal"),...a.filter(s=>s.style!=="normal")].slice(0,py),n}var sd=Ty(be);function k0({siteFonts:e,children:t}){let n=xy(()=>wc(e),[e]);return Js(sd.Provider,{value:n,children:t})}function On(){return Ey(sd)}var ad="sf-site-fonts";function I0({usedKeys:e,preload:t=!0}){let n=On(),o=od(n,e),a=Object.entries(o.vars),s=[o.css,a.length?`:root { ${a.map(([r,i])=>`${r}: ${i}`).join("; ")} }`:""].filter(Boolean).join(`
3
3
  `);return s?_y(Sy,{children:[(t?o.preload:[]).map(r=>Js("link",{rel:"preload",as:"font",type:"font/woff2",href:r.url,crossOrigin:""},r.id)),Js("style",{href:`${ad}-${Ru(s)}`,precedence:ad,dangerouslySetInnerHTML:{__html:s}})]}):null}import{jsx as Y,jsxs as yt,Fragment as mS}from"react/jsx-runtime";import{useCallback as _d,useContext as hS,useId as xd,useRef as Td,useState as Ed}from"react";import{ThemeIcon as gS}from"efficient-easel/icons";import{Button as bS,useClickOutside as yS}from"efficient-shell/ui";import{SettingsField as SS}from"efficient-easel/panel";import{ScreenDocumentContext as _S}from"efficient-easel/screen/components/ScreenDocumentContext";import{jsx as k,jsxs as tt,Fragment as Vy}from"react/jsx-runtime";import{parseHexColor as Yy}from"efficient-shell/format";import{Button as nr,IconButton as Xy,Tooltip as qy}from"efficient-shell/ui";import{jsx as et,jsxs as Hy}from"react/jsx-runtime";import{AccentIcon as $y}from"efficient-easel/icons";import{Button as Uy,Tooltip as Gy}from"efficient-shell/ui";import{jsx as se,jsxs as er}from"react/jsx-runtime";import{useRef as vy}from"react";import{ColorPicker as wy,ColorPickerPanel as Cy,ColorSwatch as Oy,HexInput as Py,Popover as ky,Tooltip as Iy,colorFill as Ay,colorSwatchClasses as Ry,useShellStrings as Ny}from"efficient-shell/ui";import{SettingsDefaultReset as Ly,SettingsField as Dy}from"efficient-easel/panel";import{typedHex as Qs}from"efficient-easel/pick";var rd="Not set";function id({value:e,onChange:t,label:n,id:o,caption:a,inherited:s,ariaLabel:r,choices:i}){return se(By,{value:e,onChange:t,label:c(r??n),id:o,caption:a,inherited:s,choices:i})}function Fy(){let{theme:e}=B();return Gu(e)}function By({value:e,onChange:t,label:n,id:o,caption:a,inherited:s,choices:r}){let i=Fy(),l=e?null:Qs(s??""),u=a!==void 0&&(!e||Qs(a)!==Qs(e))?a:null,d=p=>{p!==e&&t(p)};return er("div",{className:"sf-colour",children:[r?se(My,{id:o,value:e,onChange:t,label:n,presets:i,follows:l,choices:r}):se(wy,{id:o,value:e,onChange:d,label:n,presets:i,fallback:l??void 0,size:"md",align:"start"}),u!==null?se("span",{className:"sf-colour-caption",children:u}):se("span",{className:"sf-colour-hexwrap",children:se(Py,{value:e||l||"",onChange:d,label:c("{label} hex code",{label:n}),placeholder:e||l?void 0:c(rd),className:l?"sf-colour-hex is-inherited":"sf-colour-hex",size:"md"})})]})}function My({value:e,onChange:t,label:n,id:o,presets:a,follows:s,choices:r}){let i=Ny().color,l=e||s||"",u=r.findIndex(f=>f.selected),d=u>=0,p=vy(u);return d&&(p.current=u),se(ky,{id:o,trigger:se("span",{"aria-hidden":"true",className:"absolute inset-0",style:Ay(l)}),triggerLabel:i.swatch(n,l.toUpperCase()||i.none),triggerClassName:Ry({size:"md"}),"aria-label":i.panel(n),align:"start",children:er("div",{className:"sf-colour-window",children:[se("div",{role:"group","aria-label":n,className:"sf-colour-choices",children:r.map(f=>se(Iy,{content:f.label,children:se(Oy,{color:f.color,"aria-label":f.label,selected:f.selected,onClick:()=>{f.selected||f.onPick()}})},f.label))}),se(Cy,{value:d?"":e,onChange:t,label:n,presets:a,fallback:(d?l:s)??void 0},p.current)]})})}function Se({label:e,icon:t,changed:n,hint:o,onReset:a,resetTo:s,children:r,...i}){return se(Dy,{label:e,icon:t,htmlFor:i.id,changed:n,hint:o,action:a?se(Ly,{words:P()?.panel,label:e,changed:!!n,detail:s,onReset:a}):void 0,children:r?er("div",{className:"es-width-stack",children:[id({...i,label:e}),r]}):id({...i,label:e})})}function Pn({label:e,icon:t,value:n,inherited:o,resetTo:a,onChange:s,onReset:r,hint:i,choices:l,children:u}){let d=!!n;return se(Se,{label:e,icon:t,value:n,inherited:d?void 0:o,onChange:s,changed:d,onReset:r,resetTo:a,hint:i,choices:l,children:u})}function tr(e){return ce(e).background}function zy(e){let t=qe(e.accent,tr(e));return t===null?null:{ratio:t,grade:jt(t)}}function Wy(e){let t=tr(e),n=qe(e.accent,t);return n===null?[]:Qc(e.accent).filter(o=>{let a=qe(o,t);return a!==null&&a>n&&jt(a)==="good"})}var Ky={good:"Easy to read","large-only":Kt["large-only"],hard:Kt.hard};function ld({value:e,onChange:t}){let n=zy(e),o=n?.grade,a=n&&n.grade!=="good"?Wy(e):[];return et(Se,{label:c("Main color"),icon:et($y,{}),hint:n?c(Ky[n.grade]):void 0,value:e.accent,onChange:s=>t({...e,accent:s}),children:a.length>0?et("div",{className:"w-full min-w-0",children:Hy("div",{className:"sf-readability",children:[et("p",{className:"sf-readability-advice",children:jy(o,!0)}),et("div",{className:"sf-readability-suggestions",children:a.map(s=>{let r=qe(s,tr(e));return et(Gy,{content:c("Use {colour}",{colour:s.toUpperCase()}),children:et(Uy,{variant:"secondary",className:"sf-readability-suggestion",leftIcon:et("span",{className:"sf-readability-chip",style:{background:s},"aria-hidden":!0}),onClick:()=>t({...e,accent:s}),children:r?`${r.toFixed(1)}:1`:s.toUpperCase()})},s)})})]})}):null})}function jy(e,t){return e?e==="good"?c("This color reads clearly on your pages."):t?c("This color is hard to read on this theme's page. The buttons below are the same hue, darkened."):c("This color is hard to read on your page background. Pick one further from it \u2014 lighter if your pages are dark, deeper if they are light."):c("Pick a color to see how it reads.")}import{ButtonIcon as Zy,ChevronDownIcon as ud,ChevronUpIcon as Jy,GroundIcon as Qy,LayoutIcon as eS,SquareIcon as tS,TextSmallIcon as nS,TypeIcon as cd}from"efficient-easel/icons";var kn=e=>c("Theme {n}",{n:e+1});function dd({colors:e}){let t=ce(e),n=Ms(e)??t.accent;return tt("span",{className:"sf-theme-page",style:{background:t.background,color:t.text},"aria-hidden":!0,children:[k("span",{className:"sf-theme-eyebrow",style:{color:t.muted},children:c("label")}),tt("span",{className:"sf-theme-headline",children:[c("Heading")," ",k("span",{style:{color:t.accent},children:c("main")})]}),k("span",{className:"sf-theme-body",children:c("body text")}),tt("span",{className:"sf-theme-row",children:[k("span",{className:"sf-theme-btn",style:{background:n,color:Hs(e,t.accent)},children:c("button")}),k("span",{className:"sf-theme-mini",style:{background:t.surface,borderColor:t.line},children:c("card")})]})]})}var or={"Text color":k(cd,{}),"Label color":k(nS,{}),Background:k(Qy,{}),"Panels & cards":k(eS,{}),Borders:k(tS,{}),"Button color":k(Zy,{}),"Button text color":k(cd,{})};function oS({label:e,colorKey:t,value:n,onChange:o,idPrefix:a="sf-theme-ink"}){let s=`${a}-${t}`;return k(Se,{label:c(e),icon:or[e],id:s,value:n,onChange:r=>o(t,r)})}function aS({value:e,accent:t,onChange:n,idPrefix:o="sf-theme-ink"}){let a=`${o}-button`,s=e!==void 0&&Yy(e)===e.toLowerCase(),r=s?e:t;return k(Se,{label:c("Button color"),icon:or["Button color"],id:a,value:r,caption:s?r:c("Main"),onChange:n})}function sS({colors:e,accent:t,onChange:n,idPrefix:o="sf-theme-ink"}){let a=`${o}-button-ink`,s=eu(e),r=Hs(e,t),i=Ms(e)??t,l=jt(qe(r,i)??0);return k(Se,{label:c("Button text color"),icon:or["Button text color"],hint:s&&l!=="good"?c("{grade} on the button",{grade:c(Kt[l])}):void 0,id:a,value:r,caption:s?r:c("Auto"),onChange:n})}var rS=[{colour:!0},{label:"Text color",key:"text"},{label:"Label color",key:"muted"},{button:!0},{buttonInk:!0},{moduleBreak:!0},{label:"Background",key:"background"},{label:"Panels & cards",key:"surface"},{label:"Borders",key:"line"}];function ar({colors:e,onChange:t,idPrefix:n}){let o=ce(e);return k(Vy,{children:rS.map(a=>"colour"in a?k(ld,{value:e,onChange:t},"colour"):"moduleBreak"in a?k("div",{className:"sf-theme-module-break","aria-hidden":"true"},"module-break"):"button"in a?k(aS,{value:e.button,accent:o.accent,onChange:s=>t({...e,button:s}),idPrefix:n},"button"):"buttonInk"in a?k(sS,{colors:e,accent:o.accent,onChange:s=>t({...e,buttonInk:s}),idPrefix:n},"buttonInk"):k(oS,{label:a.label,colorKey:a.key,value:o[a.key],onChange:(s,r)=>t({...e,[s]:r}),idPrefix:n},a.key))})}function No({index:e,colors:t,selected:n,role:o="radio",open:a,editable:s=!0,onPick:r,onEdit:i,onChangeColors:l}){let u=ce(t),d=kn(e),p=e<Bs.length&&!t.brandInk?Bs[e]:null,f=jt(qe(u.text,u.background)??0),m=p?JSON.stringify(t)!==JSON.stringify(p):!1,b=a!==void 0;return tt("div",{className:`sf-theme-card${n?" is-selected":""}`,children:[k("button",{type:"button",role:o,"aria-checked":o==="radio"?n:void 0,"aria-selected":o==="option"?n:void 0,"aria-label":d,className:"sf-theme-pick",onClick:r,children:k(dd,{colors:t})}),tt("div",{className:"sf-theme-foot",children:[k("span",{className:"sf-theme-name",children:d}),f!=="good"&&k("span",{className:"sf-theme-warn",children:c(Kt[f])}),s&&i&&b&&k("span",{className:"sf-theme-edit",children:k(qy,{content:a?c("Collapse"):c("Edit colors"),children:k(Xy,{size:"sm","aria-expanded":a,"aria-controls":`sf-theme-colours-${e}`,"aria-label":a?c("Collapse {name}",{name:d}):c("Edit colors for {name}",{name:d}),onClick:i,children:a?k(Jy,{size:14}):k(ud,{size:14})})})}),s&&i&&!b&&k(nr,{variant:"secondary",size:"sm",className:"sf-theme-edit","aria-label":c("Edit {name}",{name:d}),onClick:i,children:c("Edit")})]}),a&&tt("div",{id:`sf-theme-colours-${e}`,className:"sf-theme-colours",children:[k(ar,{colors:t,onChange:y=>l?.(y)}),p&&k(nr,{variant:"link",size:"sm",className:"sf-theme-reset",disabled:!m,onClick:()=>l?.({...p}),children:m?c("Reset {name} to the preset",{name:d}):c("Not changed")})]})]})}function pd({colors:e,name:t,nameId:n,open:o,menuId:a,labelId:s,buttonRef:r,onClick:i,onKeyDown:l,onEdit:u}){return tt("div",{className:"sf-secttheme-btn",children:[k("button",{ref:r,type:"button",className:"sf-theme-pick","aria-expanded":o,"aria-controls":a,"aria-labelledby":`${s} ${n}`,onClick:i,onKeyDown:l,children:e?k(dd,{colors:e}):k("span",{className:"sf-secttheme-nopreview","aria-hidden":"true"})}),tt("div",{className:"sf-theme-foot",children:[k("span",{id:n,className:"sf-theme-name",children:t}),u&&k(nr,{variant:"secondary",size:"sm",className:"sf-theme-edit","aria-label":c("Edit {name}",{name:t}),onClick:u,children:c("Edit")}),k("button",{type:"button",className:"sf-secttheme-caret","aria-hidden":"true",tabIndex:-1,onClick:i,children:k(ud,{size:12,className:"sf-multi-caret","aria-hidden":"true"})})]})]})}import{useCallback as cr,useEffect as bd,useRef as Do}from"react";import{currentEaselSession as uS}from"efficient-easel/screen/lib/session";import{backendOf as iS}from"efficient-easel/screen/lib/session";var xe=iS,rN=e=>e.blocks;import{useEaselSession as dS}from"efficient-easel/screen/lib/session-context";import{useSyncExternalStore as lS}from"react";var md,sr=null,bt=null,Lo=0,rr=new Set;function ir(e){md=e;for(let t of rr)t()}function cN(e){sr=e,Lo+=1,bt&&clearTimeout(bt),bt=null,ir(void 0)}function uN(e){Lo+=1,ir(e)}function hd(e=250){sr&&(bt&&clearTimeout(bt),bt=setTimeout(()=>{bt=null;let t=sr;if(!t)return;let n=++Lo;t().then(o=>{n===Lo&&ir(o)}).catch(()=>{})},e))}function fd(){return md}function cS(e){return rr.add(e),()=>{rr.delete(e)}}function dN(){return lS(cS,fd,fd)}var lr=new Set;function gd(e){return lr.add(e),()=>{lr.delete(e)}}async function fN(){let e=(await Promise.allSettled([...lr].map(async t=>t()))).find(t=>t.status==="rejected");if(e)throw e.reason}import{WebsiteBackendError as pS}from"efficient-easel/screen/lib/backend-error";function yd(e=uS()){return(t,n,o)=>{let a=xe(e).theme;return a?a.update(t,o?{siteId:o}:void 0):Promise.reject(new pS("invalid","This backend stores no site theme."))}}function Sd(e){return e.themeFromDocument?{status:"skipped",reason:"template"}:e.token?null:{status:"skipped",reason:"no-token"}}async function fS(e,t=yd()){let{themeFromDocument:n,token:o,siteId:a,patch:s}=e,r=Sd({themeFromDocument:n,token:o});if(r)return r;if(Object.keys(s).length===0)return{status:"skipped",reason:"empty"};try{return await t(s,o,a??void 0),{status:"saved"}}catch(i){return{status:"failed",error:i}}}function Fo({themeFromDocument:e,tokenRef:t,siteId:n,onResult:o}){let a=Do(null),s=Do({}),r=dS(),i=Do(o);i.current=o;let l=Do(null),u=cr(f=>{if(f.status==="skipped"){let m=`skipped:${f.reason}`;if(l.current===m)return;l.current=m}else l.current=null;i.current?.(f)},[]),d=cr(async()=>{a.current&&(clearTimeout(a.current),a.current=null);let f=s.current;s.current={};let m=await fS({themeFromDocument:e,token:t?.current,siteId:n,patch:f},yd(r));return u(m),m.status==="saved"&&hd(),m.status==="failed"&&(s.current={...f,...s.current}),m},[e,t,n,u,r]),p=cr((f,m=!1)=>{let b=Sd({themeFromDocument:e,token:t?.current});if(b){u(b);return}s.current={...s.current,...f},a.current&&clearTimeout(a.current),m?d():a.current=setTimeout(()=>{d()},500)},[e,t,d,u]);return bd(()=>()=>{d()},[d]),bd(()=>gd(async()=>{if(!a.current&&Object.keys(s.current).length===0)return;let f=await d();if(f.status==="failed")throw f.error}),[d]),{persist:p,flush:d}}var TS="Follow the page",DN="Follow the slideshow",ES=e=>c("Editing {name} changes it everywhere.",{name:e});function xS({colors:e}){if(!e)return Y("span",{className:"sf-secttheme-chip sf-secttheme-chip--none","aria-hidden":"true"});let t=ce(e);return yt("span",{className:"sf-secttheme-chip","aria-hidden":"true",children:[Y("i",{style:{background:t.background}}),Y("i",{className:"sf-secttheme-chip-accent",style:{background:t.accent}})]})}function vS({themes:e,value:t,onPick:n,onEdit:o,menuId:a,followLabel:s}){return yt("div",{className:"sf-multi-menu sf-secttheme-menu",id:a,role:"listbox",children:[s!==void 0&&yt(mS,{children:[yt("button",{type:"button",role:"option","aria-selected":t===null,className:`sf-secttheme-item${t===null?" is-active":""}`,onClick:()=>n(fu),children:[Y(xS,{}),Y("span",{className:"sf-secttheme-name",children:c(s)})]}),Y("div",{className:"sf-secttheme-sep",role:"presentation"})]}),t!==null&&e[t]&&Y("p",{className:"sf-secttheme-oncard",role:"presentation",children:c("{name} is on this section",{name:kn(t)})}),e.map((r,i)=>i===t?null:Y(No,{role:"option",index:i,colors:r,selected:!1,onPick:()=>n(i),onEdit:o?()=>o(i):void 0},i))]})}function wS({index:e,colors:t,onChange:n,onDone:o}){let a=kn(e),s=xd();return yt("div",{className:"sf-secttheme-sheet",children:[yt("div",{className:"sf-secttheme-sheet-head",children:[Y("span",{children:a}),Y(bS,{variant:"secondary",className:"sf-secttheme-done",onClick:o,children:c("Done")})]}),Y("div",{className:"sf-secttheme-rows",children:Y(ar,{colors:t,onChange:n,idPrefix:s})}),Y("p",{className:"sf-secttheme-warn",children:ES(a)})]})}function vd({value:e,onChange:t,followLabel:n,hint:o,canEdit:a=!0}){let{theme:s,setTheme:r}=B(),i=ke(s),l=hS(_S),u=l?.tokenRef,d=l?.siteId??null,p=!l?.capabilities?.hasSiteTheme,{persist:f,flush:m}=Fo({themeFromDocument:p,tokenRef:u,siteId:d}),b=ke(i),y=b.themes,_=gt(e),S=_!==null?y[_]:void 0,E=S??(y.length?Wt(b):void 0),[x,v]=Ed(!1),[w,R]=Ed(null),C=Td(null),D=Td(null),z=xd(),Ee=_d(()=>{v(!1),R(null)},[]),uo=_d(()=>{!x&&w===null||(m(),Ee())},[x,w,Ee,m]);yS(C,uo);let po=X=>{t(X),Ee()},fo=X=>{if(w===null)return;let Yb=y.map((Xb,qb)=>qb===w?X:Xb),xs={...b,themes:Yb};r(xs),f({selected_preset:xs.selected,theme_presets:xs.themes})};return yt("div",{className:"sf-secttheme",ref:C,children:[Y(SS,{label:c("Theme"),icon:Y(gS,{}),labelId:`${z}-label`,hint:o,children:Y(pd,{colors:E,onEdit:a&&_!==null?()=>{R(_),v(!1)}:void 0,name:S?kn(_):c(n??TS),nameId:`${z}-value`,labelId:`${z}-label`,open:x,menuId:z,buttonRef:D,onClick:()=>{R(null),v(X=>!X)},onKeyDown:X=>{X.key==="Escape"&&(x||w!==null)&&(X.preventDefault(),Ee())}})}),x&&w===null&&Y("div",{onKeyDown:X=>{X.key==="Escape"&&(X.preventDefault(),Ee(),D.current?.focus())},children:Y(vS,{themes:y,value:_,onPick:po,onEdit:a?X=>{R(X),v(!1)}:void 0,menuId:z,followLabel:n})}),a&&w!==null&&y[w]&&Y(wS,{index:w,colors:y[w],onChange:fo,onDone:()=>{m(),Ee(),D.current?.focus()}})]})}import{defaultTextStyles as op,textStyleCaseCss as q_}from"efficient-easel/text-styles/model";import{resolveViewValue as ap}from"efficient-easel/draw";import{VIEW_DESKTOP_MIN as wd,VIEW_TABLET_MIN as Cd}from"efficient-easel/draw";var Bo=.02,Od=`(min-width: ${Tn}px) and (max-width: ${wd-Bo}px)`,Pd=`(max-width: ${Tn-Bo}px)`,Mo=`(min-width: ${Cd}px) and (max-width: ${wd-Bo}px)`,Ho=`(max-width: ${Cd-Bo}px)`;import{textStyleCaseCss as jS,textStyleCaseOfCss as VS,viewKeyAt as Zd}from"efficient-easel/draw";function $o(e,t){return t?`${e}[${t.index}].${t.rowKey}`:e}function CS(e){let t=/^([A-Za-z0-9_$]+)\[(\d+)\]\.([A-Za-z0-9_$]+)$/u.exec(e);return t?{key:t[1],row:{index:Number(t[2]),rowKey:t[3]}}:{key:e,row:null}}import{decodePartId as fr,encodePartId as d1}from"efficient-easel/draw";import{LINK_FIELD_MARKER as Hd,SCAFFOLD_FIELD_MARKER as Bd,TEXT_FIELD_MARKER as Wo}from"efficient-easel/draw";import{readHidable as $d}from"efficient-easel/draw";import{SCALAR_TEXT_CONTROLS as HS}from"efficient-easel/draw";var kd={ProductGrid:{source:{keep:["slug"]}},GalleryItem:{product:{keep:["code","finish"]}},FeaturedCover:{source:{keep:["slug"]}},LongRead:{source:{keep:["slug"]}}},Id={Events:["posts"],SubscribeBlogs:["posts"]};var OS=["anchor"],PS=/^href$|Href$|^url$|Url$|^link$|^mailto$|^tel$/;function In(e){return OS.includes(e)||PS.test(e)}var kS={Gallery:{source:{verb:"snapshot",keep:[]}},ProductHero:{source:{verb:"snapshot",keep:[]}},SpecTable:{source:{verb:"snapshot",keep:[]},wheel:{verb:"reference"},finish:{verb:"reference"},size:{verb:"reference"}},CollectionCard:{collection:{verb:"snapshot",keep:[]}},FooterMenu:{menu:{verb:"snapshot",keep:[]}},MenuBlock:{menu:{verb:"snapshot",keep:[]}},ProductGrid:{design_codes:{verb:"reference"}},ProductRef:{code:{verb:"reference"},finish:{verb:"reference"}},FitmentTable:{wheel:{verb:"reference"}},GalleryItem:{fromProduct:{verb:"reference"}},Footprint:{"offices[].group":{verb:"groupKey"},"offices[].lat":{verb:"pii"},"offices[].lng":{verb:"pii"},"offices[].geocode":{verb:"pii"}}};kS.ContactLocations={"locations[].lat":{verb:"pii"},"locations[].lng":{verb:"pii"},"locations[].mapsUrl":{verb:"pii"},"locations[].geocode":{verb:"pii"}};var KN=Object.fromEntries(Object.entries(kd).map(([e,t])=>[e,Object.keys(t)])),jN=Object.fromEntries(Object.entries(Id).map(([e,t])=>[e,[...t]]));var ur="__ownBox";function Ad(e){return!!e&&typeof e=="object"&&e[ur]===!0}var dr="sfPanelOnly";function Uo(e){return!!e&&typeof e=="object"&&e[dr]===!0}import{TEXT_FIELD_MARKER as DS}from"efficient-easel/draw";import{TEXT_FIELD_MARKER as Rd}from"efficient-easel/draw";import{readHidable as Nd}from"efficient-easel/draw";import{SCALAR_TEXT_CONTROLS as IS}from"efficient-easel/draw";var AS=IS,RS=["text","textarea"],NS=["textarea","plainTextarea"];function LS(e){return!e||typeof e!="object"?null:e[Rd]?.control??null}function Ld(e){let t=LS(e);return t&&AS.includes(t)?t:null}function QN(e){return NS.includes(e)}function e1(e){return!e||typeof e!="object"?void 0:e[Rd]?.placeholder}function Go(e){return Nd(e).text}function pr(e,t,n){return RS.includes(e)?{text:n,hidden:Nd(t).hidden}:n}function t1(e,t,n,o){return Go(e[t])===o?null:{...e,[t]:pr(n,e[t],o)}}function Dd(e){if(!(!e||typeof e!="object"))return e[DS]}function FS(e){if(!e||typeof e!="object")return null;let t=e.arrayFields;return t&&typeof t=="object"?t:null}function Fd(e,t){if(!Array.isArray(t))return[];let n=Dd(e),o=[];if(n?.control==="textList"){let s=n.itemKey??"text";return t.forEach((r,i)=>{let l=W(r?.[s]);l&&o.push({row:{index:i,rowKey:s},text:l})}),o}let a=FS(e);return a?(t.forEach((s,r)=>{for(let[i,l]of Object.entries(a)){if(!Ld(l))continue;let u=Go(s?.[i])||Dd(l)?.placeholder||"";u&&o.push({row:{index:r,rowKey:i},text:u})}}),o):[]}function BS(e,t){if(Array.isArray(e))return e[t.index]?.[t.rowKey]}function MS(e,t,n,o){let a=e[t];return!Array.isArray(a)||n.index<0||n.index>=a.length?null:{...e,[t]:a.map((s,r)=>r===n.index?{...s,[n.rowKey]:o}:s)}}function i1(e,t,n,o,a){let s=BS(e[t],n);return Go(s)===a?null:MS(e,t,n,pr(o,s,a))}function l1(e,t){return t?`${e} \xB7 row ${t.index+1}`:e}var T1="data-sf-part",E1="data-sf-region-part",x1="data-sf-part-row";function v1(e,t){return`${e}[${t}]`}var w1="data-sf-part-kind",$S="data-sf-part-style-owner",US="data-sf-part-style-kind";function C1(e){for(let t=e;t;t=t.parentElement){let n=t.getAttribute($S),o=t.getAttribute(US);if(n&&o)return{owner:n,kind:o};if(t.getAttribute("data-easel-block"))return null}return null}var Md=2;function Zt(e){return vs(e).replace(/\s+/gu,"")}function zo(e,t,n){let o=e[Wo];if(o){if(o.control==="textList"){let s=o.itemKey??"text";if(!Array.isArray(t))return;for(let r of t){let i=r?.[s];typeof i=="string"&&n.push(i)}return}let{text:a}=$d(t);a?n.push(a):o.placeholder&&n.push(o.placeholder);return}if(!e[Hd]){if(e.type==="text"||e.type==="textarea"){let a=W(t);a&&n.push(a);return}if(e.arrayFields&&Array.isArray(t)){for(let a of t)for(let[s,r]of Object.entries(e.arrayFields))zo(r,a?.[s],n);return}if(e.objectFields&&t&&typeof t=="object")for(let[a,s]of Object.entries(e.objectFields))zo(s,t[a],n)}}function GS(e){if(!e||typeof e!="object")return!1;let t=e;return t[Hd]?!1:!!t[Wo]||t.type==="text"||t.type==="textarea"}function Ud(e,t){let n=e[Wo];return n?.label?n.label:typeof e.label=="string"?e.label:t}function zS(e){let t=e.indexOf(" (");return(t>0?e.slice(0,t):e).trim()}function O1(e,t,n){if(!e)return[];let o=[];for(let[a,s]of Object.entries(e)){if(!s||typeof s!="object"||In(a))continue;let r=s,i=[];zo(r,t?.[a],i),!i.length&&r[Bd]!==void 0&&zo(r,r[Bd],i);let l=Ud(r,a);if(n?.(a)&&GS(r)){i.length&&o.push({key:a,label:l,texts:[],keyed:!0});continue}let u=new Set;for(let{row:f,text:m}of Fd(r,t?.[a])){let b=Zt(m);b.length<Md||(u.add(b),o.push({key:a,label:l,texts:[b],row:f}))}let d=new Set(u),p=[];for(let f of i){let m=Zt(f);m.length<Md||d.has(m)||(d.add(m),p.push(m))}p.length&&o.push({key:a,label:l,texts:p})}return o}function WS(e){return!e.offPage&&!e.hidden&&e.panelOnly!==!0}var KS=HS;function Gd(e,t){if(!t||typeof t!="object"||In(e)||Ad(t))return null;let n=t[Wo];return!n||!KS.includes(n.control)?null:n}function P1(e,t){let n=Gd(e,t);return n!==null&&n.identifier!==!0}function k1(e,t){if(!e)return[];let n=[];for(let[o,a]of Object.entries(e)){let s=Gd(o,a);if(!s)continue;let{text:r,hidden:i}=$d(t?.[o]);if(WS({offPage:s.offPage===!0,hidden:!!i,panelOnly:Uo(a)}))continue;let l=r||s.placeholder||"",u=vs(l).replace(/\s+/gu," ").trim();n.push({key:o,label:zS(Ud(a,o)),preview:u,offPage:s.offPage===!0,identifier:s.identifier===!0,hidden:!!i})}return n}function Jt(e){return!e||typeof e!="object"||Array.isArray(e)?null:e}function Ko(e,t){return Jt(e?.[t])??{}}function zd(e,t,n){let o=Ko(e,t);return Jt(j(o,n))??{}}function Wd(e,t,n,o){let{[n]:a,...s}=Ko(e,t),r=o?{...s,[n]:o}:s,{[t]:i,...l}=e;return Object.keys(r).length?{...l,[t]:r}:l}import{isLengthUnit as Sr}from"efficient-easel/screen/lib/content/length-units";var _r="_partStyles",YS="data-sf-part-styled",jo="data-sf-text-style",XS=/^(heading|body)-[1-7]$/;function Et(e){return typeof e=="string"&&XS.test(e)}var Vo={heading:"heading-1",heading2:"heading-2",heading3:"heading-3",body:"body-1",label:"body-5"};function qS(e){if(!e)return null;for(let[t,n]of Object.entries(Vo))if(n===e)return t;return null}function W1(e){if(Et(e.textStyle))return e.textStyle;let t=dt(e.role);return t?Vo[t]:void 0}var ZS=[400,500,600,700],Rn=["left","center","right","justify"],mr=5,hr=1e3,JS=-5,QS=10,e_=0,t_=64,n_=2,Kd={size:{min:mr,max:hr,step:1},sizeTablet:{min:mr,max:hr,step:1},sizePhone:{min:mr,max:hr,step:1},padding:{min:e_,max:t_,step:n_}},o_=.05,a_=.01,s_=["line","letter"],r_=.5,i_=2.5,l_=-1,c_=1,u_=0,d_=400,p_=[...new Set(Object.values(go))];function K1(e){return[`${e} { transition: translate var(--page-motion-hover-duration) var(--page-ease-media) var(--page-motion-hover-delay) }`,`${e}:hover, ${e}:active { translate: 0 calc(-1 * var(--page-hover-lift)) }`]}function j1(e){return Ko(e,_r)}function f_(e,t){return zd(e,_r,t)}function Jd(e,t,n){return Wd(e,_r,t,m_(n).length?n:null)}function m_(e){return Object.entries(e).filter(([,t])=>t!==void 0)}function h_(e){return s_.includes(e)}var An=(e,t,n)=>Math.min(n,Math.max(t,e)),g_=["sizeUnit","sizeUnitTablet","sizeUnitPhone"];function gr(e){let t=Zd("sizeUnit",e),n=g_.find(o=>o===t);if(!n)throw new Error(`a part stores no unit key ${t}`);return n}var St={size:gr("desktop"),sizeTablet:gr("tablet"),sizePhone:gr("mobile"),paragraphSpacing:"paragraphSpacingUnit",padding:"paddingUnit"},Qd=Object.values(St);function Re(e,t){return F(e[St[t]])}function b_(e,t,n={}){if(Qd.includes(e))return Sr(t)&&t!=="px"?t:null;if(ge(St,e)&&Re(n,e)!=="px"){let o=Tt(Number(t),2);return!Number.isFinite(o)||o<0||o===0&&e!=="padding"?null:o}if(h_(e)){let o=Math.round(Number(t));return!Number.isFinite(o)||o===0?null:An(o,JS,QS)}if(e==="lineHeight"){let o=Number(t);return Number.isFinite(o)?Tt(An(o,r_,i_),3):null}if(e==="letterSpacing"){let o=Number(t);return Number.isFinite(o)?Tt(An(o,l_,c_),4):null}if(e==="paragraphSpacing"){let o=Math.round(Number(t));return!Number.isFinite(o)||o<=0?null:An(o,u_,d_)}if(ge(Kd,e)){let{min:o,max:a}=Kd[e],s=Math.round(Number(t));return Number.isFinite(s)?An(s,o,a):null}return e==="italic"?typeof t=="boolean"?t:null:e==="role"||e==="fontRole"?dt(t)?t:null:e==="sizeToken"?Tr(t)?t:null:e==="textStyle"?Et(t)?t:null:e==="alignPhone"||e==="alignTablet"?Rn.includes(t)?t:null:t}var y_=["weight","size","sizeTablet","sizePhone","line","letter","lineHeight","letterSpacing","paragraphSpacing","padding"];function Qt(e){let t=null,n=o=>{t??={...e},delete t[o]};for(let o of y_){let a=e[o];a!==void 0&&!(typeof a=="number"&&Number.isFinite(a))&&n(o)}e.align!==void 0&&!Rn.includes(e.align)&&n("align"),e.alignTablet!==void 0&&!Rn.includes(e.alignTablet)&&n("alignTablet"),e.alignPhone!==void 0&&!Rn.includes(e.alignPhone)&&n("alignPhone"),e.textStyle!==void 0&&!Et(e.textStyle)&&n("textStyle"),e.sizeToken!==void 0&&!Tr(e.sizeToken)&&n("sizeToken"),e.fontRole!==void 0&&!dt(e.fontRole)&&n("fontRole");for(let o of Qd)e[o]!==void 0&&!Sr(e[o])&&n(o);return t??e}function Tr(e){if(!e||typeof e!="object")return!1;let{step:t,px:n,stepPhone:o,pxPhone:a,fluid:s}=e,r=l=>typeof l=="number"&&Number.isFinite(l)&&l>0,i=l=>typeof l=="string"&&p_.includes(l);return i(t)&&r(n)&&(o===void 0||i(o))&&(a===void 0||r(a))&&(s===void 0||S_(s,n))}function S_(e,t){if(!e||typeof e!="object"||Array.isArray(e))return!1;let{minPx:n,vw:o,...a}=e;return Object.keys(a).length===0&&typeof n=="number"&&Number.isFinite(n)&&n>0&&n<t&&typeof o=="number"&&Number.isFinite(o)&&o>0&&o<=100}function Er(e){return e?.pxPhone&&Tr(e)?{step:e.stepPhone??e.step,px:e.pxPhone}:null}function ep({step:e,px:t,fluid:n}){let o=n?`clamp(${n.minPx}px, ${n.vw}vw, ${t}px)`:`${t}px`,a=`var(--size-${e}, ${o})`;return e.startsWith("heading")?`min(${a}, var(--sf-heading-max,9999px))`:a}var __=[["font","role"],["font","fontRole"],["role","textStyle"],["line","lineHeight"],["letter","letterSpacing"]];function T_(e){let t=[];for(let[n,o]of __)n===e?t.push(o):o===e&&t.push(n);return t}function V1(e,t,n,o){let a={...f_(e,t)},s=o==null?null:b_(n,o,a);if(s===null)delete a[n];else{a[n]=s;for(let r of T_(n))delete a[r]}return Jd(e,t,a)}function Y1(e,t){return Jd(e,t,{})}function E_(e){return VS(e)??"none"}function x_(e){return jS(e)??""}var jd={heading:"--font-role-heading",heading2:"--font-role-heading2",heading3:"--font-role-heading3",body:"--font-role-body",accent:"--font-role-accent",label:"--font-role-label"};function v_(e,t){return dt(e.role)||(t?.blockDrawsStyle?null:qS(e.textStyle))}var w_="--sf-part-size-cap";function xr(e,t){return e&&t?.sizeCap?`min(${e}, var(${w_}, ${e}))`:e}function X1(e,t){return e?.[t]===!0}function q1(e,t){return e==="Text"&&t==="text"}var C_={headingLarge:"min(clamp(64px,9vw,144px), var(--sf-heading-max,9999px))",headingMedium:"min(32px, var(--sf-heading-max,9999px))",headingSmall:"min(24px, var(--sf-heading-max,9999px))",accent:"32px",body:"14px",label:"12px"};function O_(e){let t=go[e],n=j(C_,t);return n?`var(--size-${t}, ${n})`:`var(--size-${t})`}function vr(e){let t={};return typeof e.lineHeight=="number"?t.lineHeight=e.lineHeight:e.line&&(t.lineHeight=Tt(P_+e.line*o_,3)),typeof e.letterSpacing=="number"?t.letterSpacingEm=e.letterSpacing:e.letter&&(t.letterSpacingEm=Tt(e.letter*a_,4)),t}var P_=1,_t="--sf-part-para";function k_(e,t){e=Qt(e);let n={};if(typeof e.sizePhone=="number"&&e.sizePhone>0)n.fontSize=H(e.sizePhone,Re(e,"sizePhone"));else{let a=Er(e.sizeToken);if(a)n.fontSize=ep(a);else{let s=Xo(e);s!==void 0&&(n.fontSize=H(s,Re(e,"sizeTablet")))}}n.fontSize&&(n.fontSize=xr(n.fontSize,t));let o=e.alignPhone??Yo(e);return o&&(n.textAlign=o),n}function Yo(e){return e.alignTablet&&e.alignTablet!==e.align?e.alignTablet:void 0}function Xo(e){let t=e.sizeTablet!==void 0&&Re(e,"sizeTablet")!==Re(e,"size")?e.sizeTablet:Me("textSize",e.size,e.sizeTablet,void 0).tablet;return t&&t>0?t:void 0}function I_(e,t){let n=Qt(e),o={},a=Xo(n);a!==void 0&&(o.fontSize=xr(H(a,Re(n,"sizeTablet")),t));let s=Yo(n);return s&&(o.textAlign=s),o}function Z1(e,t){if(t==="desktop")return;let n=Qt(e);return(t==="mobile"?Yo(n):void 0)??n.align}function A_(e,t){if(t==="desktop")return e;let n=Qt(e),o=Xo(n),a=Yo(n);if(t==="tablet"){let i=e;return o!==void 0&&(i={...i,size:o,sizeUnit:n[St.sizeTablet]}),a&&(i={...i,align:a}),i}let s=e;if(typeof n.sizePhone=="number"&&n.sizePhone>0)s={...s,size:n.sizePhone,sizeUnit:n[St.sizePhone]};else{let i=Er(n.sizeToken);i?s={...s,size:void 0,sizeToken:i}:o!==void 0&&(s={...s,size:o,sizeUnit:n[St.sizeTablet]})}let r=n.alignPhone??a;return r&&(s={...s,align:r}),s}function wr(e,t,n){return Cr(A_(e,t),qo,n)}function R_(e){return Zd("size",e)}function J1(e,t){if(t==="desktop")return null;let n=Qt(e);if(t==="mobile"){if(Er(n.sizeToken))return null;let o=Xo(n);if(o!==void 0)return{px:o,view:"tablet"}}return typeof n.size=="number"&&n.size>0?{px:n.size,view:"desktop"}:null}function tp(e,t){let n=R_(t);if(!ge(e,n))return e;let o={...e};return delete o[n],o}function Q1(e,t,n){let o=wr(tp(e,t),t,n);return{fontFamily:o.fontFamily,fontSize:o.fontSize}}function Cr(e,t,n){e=Qt(e);let o=v_(e,n),a=vr(e),s=xr(e.size?H(e.size,Re(e,"size")):e.sizeToken?ep(e.sizeToken):o?O_(o):"",n);return{fontFamily:e.font?F_(e.font,n?.fonts):e.fontRole?`var(${jd[e.fontRole]})`:o?`var(${jd[o]})`:"",fontWeight:e.weight?String(e.weight):"",fontSize:s,minWidth:s?"0":"",overflowWrap:s?"break-word":"",lineHeight:a.lineHeight!==void 0?String(a.lineHeight):"",letterSpacing:a.letterSpacingEm!==void 0?`${a.letterSpacingEm}em`:"",[_t]:e.paragraphSpacing?H(e.paragraphSpacing,Re(e,"paragraphSpacing")):"",textTransform:x_(e.case),textAlign:e.align??"",paddingTop:Vd(e.padding,Re(e,"padding")),paddingBottom:Vd(e.padding,Re(e,"padding")),color:N_(e.color),fontStyle:e.italic===!0?"italic":e.italic===!1?"normal":""}}var N_=e=>Po(e),Vd=(e,t)=>e===void 0?"":H(e,t),Tt=(e,t)=>Number(e.toFixed(t));function eL(e,t){let n=Number.parseFloat(e.fontSize)||16,o=Number.parseFloat(e.lineHeight),a=Number.parseFloat(e.letterSpacing),s=Number.parseFloat(e.paddingTop);return{fontKey:t,sizePx:n,weight:L_(Number.parseInt(e.fontWeight,10)),lineRatio:Number.isFinite(o)?Tt(o/n,3):1.2,letterEm:Number.isFinite(a)?Tt(a/n,4):0,align:D_(e.textAlign),case:E_(e.textTransform),paddingPx:Number.isFinite(s)?Math.round(s):0}}function L_(e){return Number.isFinite(e)?ZS.reduce((t,n)=>Math.abs(n-e)<Math.abs(t-e)?n:t):400}function D_(e){for(let t of Rn)if(t===e)return t;return e==="end"?"right":"left"}function tL(e,t,n=be){let o=Yd(e);if(!o)return"";for(let a of n.options)if(Yd(t(a.cssVar))===o)return a.key;return""}var Yd=e=>(e.split(",")[0]??"").replace(/["']/g,"").replace(/\s+/g," ").trim().toLowerCase();function F_(e,t=be){let n=Oc(e,t);return n?`var(${n.cssVar})`:""}function nL(e,t,n,o){return!t||fr(t)?.nodeId!==e?null:n.find(a=>o(a.getAttribute("class")))??n[0]??null}function B_(e,t){return Jt(j(e,t))??{}}function oL(e,t,n=()=>qo,o=u=>u,a=$_,s="desktop",r=()=>!1,i=()=>!1,l=be){let u=0;for(let{element:d,partId:p}of e){let f=fr(p)?.propKey;if(!f)continue;let m=B_(t,o(f)),b=wr(m,s,{blockDrawsStyle:r(f),sizeCap:i(f),fonts:l});Et(m.textStyle)?d.setAttribute?.(jo,m.textStyle):d.removeAttribute?.(jo);let y=br.some(S=>d.style[S]),_=!1;for(let[S,E]of Object.entries(b))z_(d,S,E),E&&(_=!0);if(y||br.some(S=>b[S]))for(let S of M_(d,a))for(let E of br)S.style[E]=b[E]??"";_&&(u+=1)}return u}function M_(e,t){let n=Zt(e.textContent??""),o=[],a=e;for(let s=0;s<H_&&t(a);s+=1){let r=a.parentElement;if(!r||Zt(r.textContent??"")!==n)break;o.push(r),a=r}return o}var H_=8;function $_(e){let t=e;return typeof window>"u"||!t?.ownerDocument?!1:window.getComputedStyle(t).display==="inline"}var qo={fontKey:"",sizePx:16,weight:400,lineRatio:1,letterEm:0,align:"left",case:"none",paddingPx:0};function U_(e){if(!e||typeof e!="object")return null;let t={};Et(e.textStyle)&&(t.textStyle=e.textStyle),typeof e.size=="number"&&e.size>0&&(t.size=e.size),typeof e.sizeTablet=="number"&&e.sizeTablet>0&&(t.sizeTablet=e.sizeTablet),typeof e.sizePhone=="number"&&e.sizePhone>0&&(t.sizePhone=e.sizePhone);for(let n of["size","sizeTablet","sizePhone"]){let o=St[n];t[n]!==void 0&&Sr(e[o])&&(t[o]=e[o])}return Object.keys(t).length?t:null}function G_(e,t,n){let o=U_(e);if(!o)return{};let a=wr(o,t,{...n?.sizeCap?{sizeCap:!0}:{},...n?.fonts?{fonts:n.fonts}:{}});return{...a.fontFamily?{fontFamily:a.fontFamily}:{},...a.fontSize?{fontSize:a.fontSize}:{}}}function aL(e){return Et(e?.textStyle)||!!e?.role||typeof e?.size=="number"&&e.size>0}function sL(e,t,n,o){if(!e||typeof e!="object")return{};let a=Gc(e.role,t,go)??{},s=t.sized?G_(tp(e,n),n,o?{fonts:o}:void 0):{};return{...a,...s}}function rL(e,t,n){n.fontFamily&&e.fontFamily===n.fontFamily&&(e.fontFamily=t.fontFamily),n.fontSize&&e.fontSize===n.fontSize&&(e.fontSize=t.fontSize)}function z_(e,t,n){if(!t.startsWith("--")){e.style[t]=n;return}let o=e.style;typeof o.setProperty=="function"?n?o.setProperty(t,n):o.removeProperty?.(t):o[t]=n;let a=e;t===_t&&(n?a.setAttribute?.(Xd,""):a.removeAttribute?.(Xd))}var Xd="data-sf-part-para",W_=Object.keys(Cr({},qo)),yr=new Set(["color","overflowWrap",_t,"fontStyle"]),br=W_.filter(e=>!yr.has(e));function iL(e,t,n,o=u=>u,a=()=>!1,s=()=>null,r=[],i=()=>!1,l=be){let u=new Map;for(let m of e){let b=$o(m.key,m.row);for(let y of m.texts){let _=u.get(y);_?(_.keys.add(m.key),_.partKeys.add(b)):u.set(y,{keys:new Set([m.key]),partKeys:new Set([b])})}}let d=new Map;for(let m of new Set([...Object.keys(t),...r])){if(!K_(m))continue;let b=qd(n,m,Jt(t[m])??{},{blockDrawsStyle:!1,sizeCap:i(m),fonts:l},s(m));b&&d.set(m,b)}let p=m=>{let b=o(m),y=s(b);if(!ge(t,b)&&!y)return null;let _=Jt(t[b])??{};return qd(n,m,_,{blockDrawsStyle:a(m),sizeCap:i(m),fonts:l},y)},f=new Map;for(let[m,{keys:b,partKeys:y}]of u){let _=y.size===1?[...y][0]:b.size===1?[...b][0]:null;if(!_)continue;let S=p(_);S&&f.set(m,S)}for(let m of e){if(!m.keyed)continue;let b=p($o(m.key,m.row));b&&d.set(m.key,b)}return f.size||d.size?{rules:f,kindRules:d,drawn:new Set(u.keys())}:null}function qd(e,t,n,o,a){let s=Cr(n,qo,o),r=I_(n,o),i=k_(n,o),l=Et(n.textStyle)?n.textStyle:void 0;return!Object.values(s).some(Boolean)&&!Object.keys(r).length&&!Object.keys(i).length&&!l&&!a?null:{stamp:j_(e,t),declarations:s,...Object.keys(r).length?{tablet:r}:{},...Object.keys(i).length?{phone:i}:{},...l?{textStyle:l}:{},...a?{motion:a}:{}}}function K_(e){return e.startsWith("@")}function lL(e,t){return e?.kindRules.get(t)??null}function j_(e,t){let n=o=>o.replace(/[^A-Za-z0-9_-]+/g,"-");return`${n(e)}~${n(t)}`}function V_(e){return e?{tablet:Od,phone:Pd}:{tablet:Mo,phone:Ho}}function cL(e,{inBox:t=!1}={}){let{tablet:n,phone:o}=V_(t),a=[],s=new Set,r=i=>{let{stamp:l,declarations:u}=i;if(s.has(l))return;s.add(l);let d=Object.entries(u).filter(([,S])=>S!==""),p=S=>S.map(([E,x])=>`${Y_(E)}: ${x}`).join("; "),f=`[${YS}="${l}"]`,m=d.filter(([S])=>!yr.has(S)),b=d.filter(([S])=>yr.has(S));m.length&&a.push(`${f}, *:has(> ${f}) { ${p(m)} }`),b.length&&a.push(`${f} { ${p(b)} }`),u[_t]&&(a.push(`*:has(> ${f}) { ${_t}: ${u[_t]} }`),a.push(...Zo(f,`*:has(> ${f})`)));let y=Object.entries(i.tablet??{}).filter(([,S])=>S!=="");y.length&&a.push(`@media ${n} { ${f}, *:has(> ${f}) { ${p(y)} } }`);let _=Object.entries(i.phone??{}).filter(([,S])=>S!=="");_.length&&a.push(`@media ${o} { ${f}, *:has(> ${f}) { ${p(_)} } }`)};for(let i of e.rules.values())r(i);for(let i of e.kindRules.values())r(i);return a.join(`
4
4
  `)}function Zo(e,t){let n=`var(${_t})`,o=":is([data-sf-bullet], [data-sf-number])";return[`${e} br:not(br + br) { display: block; content: ""; margin-top: ${n} }`,`${e} ${o}:not(:first-child) { margin-top: ${n} }`,`${e} ${o}:not(:last-child) { margin-bottom: ${n} }`,`:is(${t}) + :is(${t}) { margin-top: ${n} }`]}var Y_=e=>e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`);function uL(e,t){if(!e)return null;let n=Zt(t),o=e.rules.get(n);if(o)return o;if(n.length<X_||e.drawn.has(n))return null;let a=null;for(let[s,r]of e.rules)if(s.includes(n)){if(a&&a.stamp!==r.stamp)return null;a=r}return a}var X_=8;var Or=e=>e==="sentence"?"none":void 0,sp=["font","color","size","sizeTablet","sizePhone","weight","italic","lineHeight","lineHeightTablet","lineHeightPhone","letterSpacing","letterSpacingTablet","letterSpacingPhone","paragraphSpacing","paragraphSpacingTablet","paragraphSpacingPhone","letterCase","largestSize","largestSizeTablet","largestSizePhone"],en=["desktop","tablet","phone"],xt=(e,t)=>$(e,t);function Ir(e,t,n,o=Ut()){return ap("textSize",t,e.sizeTablet,e.sizePhone,o)[n]}var Z_=[["lineSpacing","lineHeight","line"],["letterSpacing","letterSpacing","letter"]];function Pr(e){for(let[t,n,o]of Z_)for(let a of en)if(e===xt(t,a))return{key:$(n,a),view:a,spacing:o};return{key:e,view:"desktop",spacing:null}}function Ne(e){let t={};for(let n of sp)e[n]!==void 0&&(t[n]=e[n]);return t}function Ar(e,t){let{auto:n,...o}=e,a=new Set(t??[]),s=sp.filter(r=>a.has(r)&&e.values[r]===void 0);return s.length?{...o,auto:s}:o}function rp(e){let t=e.fonts,n=e.sizes,o=e.typography,a=cu(e.compression),s={"heading-1":{font:W(t.heading),size:O(n.headingLarge),weight:O(o.weight),lineHeight:a.lineHeight,letterSpacing:a.letterSpacing,letterCase:Or(o.case),largestSize:O(o.maxPx)},"heading-2":{font:W(t.heading2),size:O(n.headingMedium),weight:O(o.weight2),lineHeight:a.lineHeight,letterSpacing:a.letterSpacing,letterCase:Or(o.case2)},"heading-3":{font:W(t.heading3),size:O(n.headingSmall),weight:O(o.weight3),lineHeight:a.lineHeight,letterSpacing:a.letterSpacing,letterCase:Or(o.case3)},"body-1":{font:W(t.body),size:O(n.body)},"body-5":{font:W(t.label),size:O(n.label)}};return op().map(({id:r,kind:i,name:l})=>({id:r,kind:i,name:l,values:Ne(s[r]??{})}))}function Rr(e){return Array.isArray(e)&&e.every(t=>t&&typeof t=="object"&&typeof t.id=="string"&&(t.kind==="heading"||t.kind==="body")&&typeof t.name=="string")?e.map(t=>Ar({...t,values:Ne(t.values??{})},Array.isArray(t.auto)?t.auto:void 0)):null}function xL(e){return Rr(e)??[]}function ip(e){return Rr(e)??op().map(({id:t,kind:n,name:o})=>({id:t,kind:n,name:o,values:{}}))}function nn(e,t){let n=rp(t),o=Rr(e);return o?o.map(a=>{let s={...kr(n,a.id)};for(let r of a.auto??[])delete s[r];return{...a,values:Ne({...s,...a.values})}}):n}var kr=(e,t)=>e.find(n=>n.id===t)?.values??{},np=["heading-1","heading-2","heading-3"];function lp({saved:e,old:t,cur:n,next:o,sizeOf:a,panelView:s="desktop"}){let r=rp(t),i=ip(e),l=nn(i,t),u=[],d=o.map(f=>{let m=n.find(w=>w.id===f.id),b=i.find(w=>w.id===f.id);if(!m||!b){let w=J_([f],a,s)[0],R=w.values.color;return R===void 0?w:{...w,values:{...w.values,color:$e(R)}}}let y={...b.values},_=new Set(b.auto??[]),S=f.values,E=m.values,x=[...new Set([...Object.keys(S),...Object.keys(E)])].filter(w=>JSON.stringify(S[w])!==JSON.stringify(E[w])),v=w=>Pr(w).spacing==="letter";x.sort((w,R)=>Number(v(w))-Number(v(R)));for(let w of x){let{key:R,view:C,spacing:D}=Pr(w),z=R,Ee=S[w];if(Ee===void 0){delete y[z],kr(r,f.id)[z]!==void 0&&(u.push([f.id,z]),_.add(z));continue}if(_.delete(z),D==="line")y[z]=tn(Ee/100,3);else if(D==="letter"){let uo={...l.find(X=>X.id===f.id)?.values??{}};for(let X of x)S[X]===void 0&&delete uo[Pr(X).key];let po=Ne({...uo,...y}),fo=Ir(po,a({...f,values:po}),C);y[z]=fo?tn(Ee/fo,4):0}else y[z]=Ee}return Ar({id:f.id,kind:f.kind,name:f.name,values:Ne(y)},_)}),p=t.compression;if(u.some(([f,m])=>(m==="lineHeight"||m==="letterSpacing")&&np.includes(f))&&ht(p)!=="normal"){for(let f of np){let m=d.find(y=>y.id===f);if(!m)continue;let b={...m.values};for(let y of["lineHeight","letterSpacing"])u.some(([_,S])=>_===f&&S===y)||b[y]===void 0&&!(m.auto??[]).includes(y)&&(b[y]=kr(r,f)[y]);m.values=Ne(b)}p="normal"}return{saved:d,old:{...t,compression:p}}}function cp(e,t){let n={text_styles:e.saved};return e.old.compression!==t.compression&&(n.heading_compression=ht(e.old.compression)),n}var tn=(e,t)=>Number(e.toFixed(t)),up=(e,t)=>en.indexOf(e)<en.indexOf(t)?t:e;function dp(e,t,n="desktop"){return e.map(o=>{let a={...o.values},s=t(o);for(let r of en){let i=$("lineHeight",r),l=o.values[i],u=o.values[$("letterSpacing",r)];delete a[i],l!==void 0&&(a[xt("lineSpacing",r)]=tn(l*100,1));let d=up(r,n);u!==void 0&&(a[xt("letterSpacing",r)]=tn(u*Ir(o.values,s,d),d===r?2:4))}return{id:o.id,kind:o.kind,name:o.name,values:a}})}function J_(e,t,n="desktop"){return e.map(o=>{let a=o.values,s={...a};for(let u of en)delete s[xt("lineSpacing",u)],delete s[xt("letterSpacing",u)];let r={id:o.id,kind:o.kind,name:o.name,values:Ne(s)},i={...r.values},l=t({...r,values:{...r.values}});for(let u of en){let d=a[xt("lineSpacing",u)],p=a[xt("letterSpacing",u)];if(typeof d=="number"&&(i[$("lineHeight",u)]=tn(d/100,3)),typeof p=="number"){let f=Ir(r.values,l,up(u,n));i[$("letterSpacing",u)]=f?tn(p/f,4):0}}return{...r,values:Ne(i)}})}function vL(e,t=be){let n={fonts:_n({heading:e.heading_font??void 0,heading2:e.heading_2_font??void 0,heading3:e.heading_3_font??void 0,body:e.body_font??void 0,accent:e.accent_font??void 0,label:e.label_font??void 0},t),sizes:$s({headingLarge:e.heading_size_large_px,headingMedium:e.heading_size_medium_px,headingSmall:e.heading_size_small_px,accent:e.accent_size_px,body:e.body_size_px,label:e.label_size_px}),compression:ht(e.heading_compression),typography:du(e)},o=e.text_styles??null,a=Array.isArray(o)?Nr(nn(o,n),n):n;return{fonts:_n(a.fonts,t),sizes:$s(a.sizes),compression:ht(a.compression),typography:a.typography,textStyles:o}}function Nr(e,t){let n=f=>e.find(m=>m.id===f)?.values??{},o=n("heading-1"),a=n("heading-2"),s=n("heading-3"),r=n("body-1"),i=n("body-5"),l=t.fonts,u=t.sizes,d=t.typography,p=f=>f==="none"?"sentence":"authored";return{fonts:{...l,heading:o.font??l.heading,heading2:a.font??o.font??l.heading2,heading3:s.font??o.font??l.heading3,body:r.font??l.body,label:i.font??l.label},sizes:{...u,headingLarge:o.size??null,headingMedium:a.size??null,headingSmall:s.size??null,body:r.size??null,label:i.size??null},compression:t.compression,typography:{...d,case:p(o.letterCase),weight:o.weight??null,maxPx:o.largestSize??null,weight2:a.weight??null,weight3:s.weight??null,case2:p(a.letterCase),case3:p(s.letterCase)}}}function wL(e,t=be){let n=[];for(let o of e){let a=o.values,s=`.${ku(o)}`,r=`[${jo}="${o.id}"]`,i=`${s}, ${r}`,l=[],u=a.font!==void 0?t.byKey.get(a.font)?.cssVar:void 0;if(u&&l.push(`font-family: var(${u})`),a.size!==void 0){let m=a.largestSize!==void 0?Math.min(a.size,a.largestSize):a.size;l.push(`font-size: ${m}px`)}let d=Po(a.color);d&&l.push(`color: ${d}`),a.italic===!0&&l.push("font-style: italic"),a.weight!==void 0&&l.push(`font-weight: ${a.weight}`);let p=[];a.lineHeight!==void 0&&p.push(`line-height: ${a.lineHeight}`),a.letterSpacing!==void 0&&p.push(`letter-spacing: ${a.letterSpacing}em`),o.kind==="body"&&l.push(...p);let f=q_(a.letterCase);f&&o.kind==="body"&&l.push(`text-transform: ${f}`),a.paragraphSpacing&&l.push(`--sf-part-para: ${a.paragraphSpacing}px`),l.length&&n.push(`${i} { ${l.join("; ")} }`),o.kind==="heading"&&p.length&&n.push(`${i}, ${s}:is(h1, h2, h3, h4), ${r}:is(h1, h2, h3, h4) { ${p.join("; ")} }`),o.kind==="heading"&&f&&n.push(`${r}, ${s}:is(h1, h2, h3, h4) { text-transform: ${f} }`),a.paragraphSpacing&&(n.push(`*:has(> ${r}) { --sf-part-para: ${a.paragraphSpacing}px }`),n.push(...Zo(`:is(${i})`,`*:has(> ${r})`))),n.push(...Q_(o,i,s,r))}return n.join(`
@@ -1 +1 @@
1
- import{Bh as P,Ch as I,Dh as X,Eb as b,Eh as S,Gh as j,Hh as z,Nh as U,Ph as Z,Rh as J,Zg as V,di as Q,fi as ee,of as q,wc as K}from"./chunk-Y3CRPIPD.js";import{forwardRef as Pe}from"react";import{jsx as He}from"react/jsx-runtime";function Ie(e){if(typeof e=="string")return e;let t=e.query?`?${new URLSearchParams(e.query).toString()}`:"",s=e.hash?e.hash.startsWith("#")?e.hash:`#${e.hash}`:"";return`${e.pathname??""}${t}${s}`}var Oe=Pe(function({href:t,prefetch:s,replace:a,scroll:n,shallow:r,legacyBehavior:i,passHref:o,locale:l,onClick:h,children:w,...u},_){let g=C=>{h?.(C),!(C.defaultPrevented||u.target==="_blank")&&C.preventDefault()};return He("a",{ref:_,href:Ie(t),onClick:g,...u,children:w})}),_t=Oe;var te=["instagram","facebook","tiktok","youtube","x","linkedin","pinterest","whatsapp","telegram","line","wechat"],Fe={instagram:"Instagram",facebook:"Facebook",tiktok:"TikTok",youtube:"YouTube",x:"X",linkedin:"LinkedIn",pinterest:"Pinterest",whatsapp:"WhatsApp",telegram:"Telegram",line:"LINE",wechat:"WeChat"},Me={};function At(e){if(!e||typeof e!="object")return Me;let t={};for(let s of te){let a=e[s];if(typeof a!="string")continue;let n=a.trim();!n||!/^https?:\/\//i.test(n)||(t[s]=n)}return t}function xt(e){return te.flatMap(t=>{let s=e[t];return s?[{platform:t,href:s,label:Fe[t]}]:[]})}var Nt=e=>`${e}_url`;import{createContext as _e,createElement as x,useContext as N}from"react";import{Fragment as it,jsx as m}from"react/jsx-runtime";import{createContext as W,useContext as d}from"react";import{jsx as E,Fragment as pe}from"react/jsx-runtime";import{createContext as et,useContext as fe,useEffect as tt,useRef as st,useState as at}from"react";import{SCROLL_ZOOM_VAR as me}from"efficient-shell/format";import{readEntrance as $e}from"efficient-shell/format";var A={kind:"entrance",from:"entranceFrom",duration:"entranceDuration",delay:"entranceDelay"},O="sectionAnimation",De=Z(Object.values(A));var se="sf-entrance",Ge=e=>e!=null&&e!=="";function Ye(e,t){let s=e[A[t]];return t==="kind"&&!Ge(s)?e[O]:s}var y=(e,t,s)=>J(e,A[t],s,Ye(e,t));function H(e,t){return $e(y(e,"kind",t),y(e,"from",t),y(e,"duration",t),y(e,"delay",t))}var Be=e=>({desktop:H(e,"desktop"),tablet:H(e,"tablet"),phone:H(e,"phone")});function Ht(e){let t=Be(e);return U.every(s=>t[s].kind==="none")?null:t}var We={...Object.fromEntries([...V].map(e=>[e,"a root position: sticky bar; an outer box becomes its sticky containing block and the pin collapses (the same fact every wrapper pass excludes it for, lib/content/section-surface)"])),HeroSlide:"a slide is a direct child of the Hero's transform track ([&>*]:basis-full); a wrapper would take its width, and the Hero already moves one slide in at a time",HeroGroup:"a slide box is placed by grid-item properties on its own root (--sf-hg-row, justify-self); a wrapper becomes the grid item and the box loses its anchor (lib/document/blocks/general/HeroGroup/meta)",[q]:"a host part draws its data block's answer with no element of its own (lib/content/card-template HOST_PART_TYPE); a wrapper would be one, and the host's content is not the merchant's to animate"},Ft=new Set(Object.keys(We));function ae(e,t,s,a){return t<=0?1/0:a?2*(e-4)/(t+s):2*(e-s/2-4)/t}function ne(e,t,s){let a=o=>o.width>0&&o.height>0;if(!a(e)||t.some(o=>o.mark&&!a(o.rect)))return 1;let n=e.left+e.width/2,r=e.top+e.height/2,i=s;for(let{rect:o,mark:l}of t){let h=Math.abs(o.left+o.width/2-n),w=Math.abs(o.top+o.height/2-r),u=Math.max(ae(h,e.width,o.width,l),ae(w,e.height,o.height,l));i=Math.min(i,Math.max(1,u))}return i}import{parseOption as Ke}from"efficient-shell/format";var re=["cover","contain"],qe={cover:"Cover",contain:"Contain"},Gt="Image fit";function F(e,t){return Ke(re,t,e)}function Yt(){return re.map(e=>({label:qe[e],value:e}))}function Bt(e){return e==="contain"?"object-contain":"object-cover"}function M(e,t){return e!=="auto"&&t==="cover"}var Ve=P.map(e=>e.image).filter(e=>e!==I),R=e=>S(e)?I:e,p="fill",Xt={label:"Fill row",value:p,showWhen:K},D="4/3",ie={frame:"view-wide:h-full view-wide:min-h-[240px]",img:"view-wide:absolute view-wide:inset-0",figure:"view-wide:h-full"},le={all:{frame:"h-full min-h-[240px]",img:"absolute inset-0",figure:"h-full"},wide:ie,tablet:ie,desktop:{frame:"view-desktop:h-full view-desktop:min-h-[240px] max-view-desktop:aspect-[4/3]",img:"view-desktop:absolute view-desktop:inset-0",figure:"view-desktop:h-full"}};function jt(e,t,s){return t&&!v(s)?"all":e??"wide"}function oe(e){return le[e]}var zt=le.all;function ce(e){return e?`${e.img} h-full w-full`:"relative h-full w-full"}var Xe={auto:"","3/4":"aspect-[3/4]","2/1":"aspect-[2/1]","21/9":"aspect-[21/9]","16/9":"aspect-[16/9]","4/3":"aspect-[4/3]","16/10":"aspect-[16/10]","1/1":"aspect-square","9/16":"aspect-[9/16]","2/3":"aspect-[2/3]","4/5":"aspect-[4/5]",custom:"aspect-[var(--shape-ratio)]"},je={auto:"","3/4":"view-wide:aspect-[3/4]","2/1":"view-wide:aspect-[2/1]","21/9":"view-wide:aspect-[21/9]","16/9":"view-wide:aspect-[16/9]","4/3":"view-wide:aspect-[4/3]","16/10":"view-wide:aspect-[16/10]","1/1":"view-wide:aspect-square","9/16":"view-wide:aspect-[9/16]","2/3":"view-wide:aspect-[2/3]","4/5":"view-wide:aspect-[4/5]",custom:"view-wide:aspect-[var(--shape-ratio)]"},ze={auto:"","3/4":"max-view-wide:aspect-[3/4]","2/1":"max-view-wide:aspect-[2/1]","21/9":"max-view-wide:aspect-[21/9]","16/9":"max-view-wide:aspect-[16/9]","4/3":"max-view-wide:aspect-[4/3]","16/10":"max-view-wide:aspect-[16/10]","1/1":"max-view-wide:aspect-square","9/16":"max-view-wide:aspect-[9/16]","2/3":"max-view-wide:aspect-[2/3]","4/5":"max-view-wide:aspect-[4/5]",custom:"max-view-wide:aspect-[var(--shape-ratio-phone)]"},Ue={auto:"max-view-wide:aspect-auto!","3/4":"max-view-wide:aspect-[3/4]!","2/1":"max-view-wide:aspect-[2/1]!","21/9":"max-view-wide:aspect-[21/9]!","16/9":"max-view-wide:aspect-[16/9]!","4/3":"","16/10":"max-view-wide:aspect-[16/10]!","1/1":"max-view-wide:aspect-square!","9/16":"max-view-wide:aspect-[9/16]!","2/3":"max-view-wide:aspect-[2/3]!","4/5":"max-view-wide:aspect-[4/5]!",custom:"max-view-wide:aspect-[var(--shape-ratio-phone)]!"},$=e=>Ve.includes(e)||S(e),v=$;function Ut(e){let t=$(e)?S(e)?X(e):P.find(s=>s.image===e)?.ratio:null;return t?j(t):null}function Zt(e,t){return z({desktop:e,phone:t})}function Jt(e,t,s){return s==="contain"?!0:[e,t??e].every(a=>a!==p&&(!$(a)||a==="auto"))}function Qt(e,t){return e===p&&!t?D:e}function es(e){return e===p?D:v(e)?e:void 0}function ue(e,t){return v(t)?t===e?null:t:e===p?D:null}function Ze(e,t){let s=ue(e,t);return M(e,"cover")||s!==null&&M(s,"cover")}function Je(e,t,s){return F(e,"cover")==="cover"&&Ze(t,s)}function ts(e,t,s,a){return e==="desktop"?Je(t,s,a):F(t,"cover")!=="cover"?!1:Qe(e==="tablet"?s:ue(s,a)??s)}var Qe=e=>e===p||v(e)&&e!=="auto";function ss(e,t,s="wide"){return e===p&&s==="all"?oe("all").frame:t===null?v(e)?Xe[R(e)]:"":[e===p?oe(s).frame:v(e)?je[R(e)]:"",e===p&&s==="desktop"?Ue[R(t)]:ze[R(t)]].filter(Boolean).join(" ")}var T=et(null);function us({attrs:e,style:t,children:s}){return E(T.Provider,{value:{attrs:e,style:t},children:s})}function he({children:e}){return E(T.Provider,{value:null,children:e})}function ms({fill:e=null,children:t}){let s=fe(T);return s?E("div",{className:ce(e),...s.attrs,style:s.style,children:t}):E(pe,{children:t})}var L="data-sf-mark";function de(e){let t=e.getBoundingClientRect(),s=e.firstElementChild,a=s&&typeof s.offsetWidth=="number"?s:e,n=Math.max(a.offsetWidth,e.offsetWidth),r=Math.max(a.offsetHeight,e.offsetHeight);return{left:t.left+t.width/2-n/2,top:t.top+t.height/2-r/2,width:n,height:r}}function nt(e){return e.closest(`[${L}]`)||e.closest("style, script")?!1:[...e.childNodes].some(t=>t.nodeType===3&&(t.textContent??"").trim()!=="")}var we=e=>e.closest(`.${se}`)??e.ownerDocument.body;function rt(e,t){let s=we(e),a=[];for(let n of s.querySelectorAll(`[${L}]`))n!==e&&a.push({rect:de(n),mark:!0});for(let n of s.querySelectorAll("*")){if(n.contains(e)||!nt(n))continue;let r=n.getBoundingClientRect();r.width===0||r.height===0||a.push({rect:{left:r.left,top:r.top,width:r.width,height:r.height},mark:!1})}return ne(de(e),a,t)}function ds({inCell:e=!1,children:t}){let s=fe(T),a=st(null),[n,r]=at(null),i=s?Number.parseFloat(String(s.style[me])):Number.NaN;if(tt(()=>{let l=a.current;if(!l||!Number.isFinite(i))return;let h=()=>r(rt(l,i));h();let w=l.ownerDocument.defaultView?.ResizeObserver;if(!w)return;let u=new w(h),_=we(l);u.observe(l),u.observe(_);for(let g of _.querySelectorAll(`[${L}]`))g!==l&&u.observe(g);return()=>u.disconnect()},[i]),!s)return E(pe,{children:t});let o=Number.isFinite(i)?{...s.style,[me]:String(n??1)}:s.style;return E("span",{ref:a,className:e?"inline-flex min-w-0 max-w-full items-center justify-center":"inline-flex items-center justify-center",[L]:"",...s.attrs,style:o,children:t})}var ge={stretchedRow:!1,fillingColumn:!1},c=W(null),ve=()=>d(c)!==null;function _s({line:e,draw:t}){return m(it,{children:t(b(e,ve()))})}var Cs=(e="by-box")=>b(e,ve()),bs=()=>d(c),As=()=>d(c)?.id??null,f=W(!1);function ot(){let e=d(c)?.stretchedRow===!0,t=d(f);return e&&!t}var lt=()=>d(f);function ct(){let e=d(c),t=ot(),s=lt();return{fill:s?` ${Q}`:"",inner:a=>{let n=t||s?m(f.Provider,{value:!0,children:a}):a;return e?.columnsRow?m(c.Provider,{value:{...e,columnsRow:!1},children:n}):n}}}function xs({className:e,style:t,attrs:s,children:a}){let{fill:n,inner:r}=ct(),i=Y();return i.scope(m("div",{className:B(`${e}${n}`,i.className),...t?{style:t}:{},...s,...i.attrs,children:r(a)}))}var G=W(!1);function Ns({children:e}){return m(G.Provider,{value:!0,children:m(f.Provider,{value:!0,children:e})})}function Ss({children:e,ownPictures:t=!1}){let s=d(c),a=d(G),n=d(f),r=a&&n,i=s===null?null:s.id===void 0?ge:{...ge,id:s.id};return m(c.Provider,{value:i,children:m(G.Provider,{value:!1,children:m(f.Provider,{value:r,children:t?e:m(he,{children:e})})})})}var k=_e(null),Ee="data-sf-view-hide",Ce=e=>x(k.Provider,{value:null},e),be={className:"",attrs:{},scope:Ce},ut=be,Ae=_e(null),Ps=(e,t)=>e?{className:e,views:t}:null,mt=e=>x(k.Provider,{value:null},x(Ae.Provider,{value:null},x(f.Provider,{value:!0},e))),Is=(e,t,s={})=>e?{className:e,words:t,...s}:null,xe=(e,t)=>e.sectionClassName===void 0?{className:e.className,words:e.words}:b(e.line??"by-box",t)?{className:e.className,words:`${e.words} edge`}:{className:e.sectionClassName,words:e.words};function Y(){let e=N(k),t=N(Ae),s=N(c)!==null;if(e===null&&t===null)return ut;let a=e===null?null:xe(e,s);return t===null?{className:a.className,attrs:{[Ee]:a.words},scope:Ce}:{className:a?`${a.className} ${t.className}`:t.className,attrs:{...a?{[Ee]:a.words}:{},[ee]:t.views},scope:mt}}function Os(){let e=N(k),t=N(c)!==null;return e===null?"":xe(e,t).className}var B=(e,t)=>t?e?`${e} ${t}`:t:e;function Hs(e){let t=Y(),s=e.takes===!1?be:t,a={},n=!1;for(let[r,i]of Object.entries(e))r==="as"||r==="takes"||r==="children"||(r==="className"?(a.className=B(i,s.className),n=!0):a[r]=i);return!n&&s.className&&(a.className=s.className),s.scope(x(e.as??"div",{...a,...s.attrs},e.children))}var Ms={small:54,medium:66,large:84},dt=44,pt=16,ft=140,Ds={min:pt,max:ft,step:1},$s=dt*4;import{forwardRef as ht}from"react";import{imageCopyUrl as Ne,imageSrcSet as Se}from"efficient-shell/image-copies";import{jsx as vt}from"react/jsx-runtime";var wt={position:"absolute",height:"100%",width:"100%",left:0,top:0,right:0,bottom:0,color:"transparent"};function ye(e,t,s){if(s){let a=Se(e);return a?{src:Ne(e,1280),srcSet:a,sizes:s}:{src:e,sizes:s}}if(t&&t>0){let a=Se(e,{maxWidth:t*3});return a?{src:Ne(e,t*2),srcSet:a,sizes:`${t}px`}:{src:e}}return{src:e}}var gt=ht(function({src:t,width:s,height:a,fill:n,priority:r,loading:i,style:o,quality:l,placeholder:h,blurDataURL:w,unoptimized:u,loader:_,overrideSrc:g,sizes:C,...Re},Le){let Te=g??(typeof t=="string"?t:t.src),ke=ye(Te,n?void 0:Number(s)||void 0,C??(n?"100vw":void 0));return vt("img",{ref:Le,...ke,width:n?void 0:s,height:n?void 0:a,loading:r?"eager":i??"lazy",fetchPriority:r?"high":void 0,decoding:"async",style:n?{...wt,...o}:{color:"transparent",...o},...Re})}),Ws=gt;function Ks(e){let t=e.overrideSrc??(typeof e.src=="string"?e.src:e.src.src),s=e.fill?void 0:Number(e.width)||void 0;return{props:ye(t,s,e.sizes??(e.fill?"100vw":void 0))}}export{A as a,O as b,De as c,se as d,H as e,Be as f,Ht as g,Ft as h,qe as i,Gt as j,F as k,Yt as l,Bt as m,p as n,Xt as o,jt as p,oe as q,zt as r,ce as s,Ut as t,Zt as u,Jt as v,Qt as w,es as x,ue as y,Ze as z,Je as A,ts as B,ss as C,us as D,he as E,ms as F,ds as G,k as H,be as I,Ae as J,Ps as K,Is as L,Y as M,Os as N,B as O,Hs as P,c as Q,_s as R,Cs as S,bs as T,As as U,f as V,ot as W,lt as X,ct as Y,xs as Z,Ns as _,Ss as $,Ms as aa,dt as ba,pt as ca,Ds as da,$s as ea,Ws as fa,Ks as ga,_t as ha,te as ia,Fe as ja,Me as ka,At as la,xt as ma,Nt as na};
1
+ import{Bh as P,Ch as I,Dh as X,Eb as b,Eh as S,Gh as j,Hh as z,Nh as U,Ph as Z,Rh as J,Zg as V,di as Q,fi as ee,of as q,wc as K}from"./chunk-Y7YKT7VT.js";import{forwardRef as Pe}from"react";import{jsx as He}from"react/jsx-runtime";function Ie(e){if(typeof e=="string")return e;let t=e.query?`?${new URLSearchParams(e.query).toString()}`:"",s=e.hash?e.hash.startsWith("#")?e.hash:`#${e.hash}`:"";return`${e.pathname??""}${t}${s}`}var Oe=Pe(function({href:t,prefetch:s,replace:a,scroll:n,shallow:r,legacyBehavior:i,passHref:o,locale:l,onClick:h,children:w,...u},_){let g=C=>{h?.(C),!(C.defaultPrevented||u.target==="_blank")&&C.preventDefault()};return He("a",{ref:_,href:Ie(t),onClick:g,...u,children:w})}),_t=Oe;var te=["instagram","facebook","tiktok","youtube","x","linkedin","pinterest","whatsapp","telegram","line","wechat"],Fe={instagram:"Instagram",facebook:"Facebook",tiktok:"TikTok",youtube:"YouTube",x:"X",linkedin:"LinkedIn",pinterest:"Pinterest",whatsapp:"WhatsApp",telegram:"Telegram",line:"LINE",wechat:"WeChat"},Me={};function At(e){if(!e||typeof e!="object")return Me;let t={};for(let s of te){let a=e[s];if(typeof a!="string")continue;let n=a.trim();!n||!/^https?:\/\//i.test(n)||(t[s]=n)}return t}function xt(e){return te.flatMap(t=>{let s=e[t];return s?[{platform:t,href:s,label:Fe[t]}]:[]})}var Nt=e=>`${e}_url`;import{createContext as _e,createElement as x,useContext as N}from"react";import{Fragment as it,jsx as m}from"react/jsx-runtime";import{createContext as W,useContext as d}from"react";import{jsx as E,Fragment as pe}from"react/jsx-runtime";import{createContext as et,useContext as fe,useEffect as tt,useRef as st,useState as at}from"react";import{SCROLL_ZOOM_VAR as me}from"efficient-shell/format";import{readEntrance as $e}from"efficient-shell/format";var A={kind:"entrance",from:"entranceFrom",duration:"entranceDuration",delay:"entranceDelay"},O="sectionAnimation",De=Z(Object.values(A));var se="sf-entrance",Ge=e=>e!=null&&e!=="";function Ye(e,t){let s=e[A[t]];return t==="kind"&&!Ge(s)?e[O]:s}var y=(e,t,s)=>J(e,A[t],s,Ye(e,t));function H(e,t){return $e(y(e,"kind",t),y(e,"from",t),y(e,"duration",t),y(e,"delay",t))}var Be=e=>({desktop:H(e,"desktop"),tablet:H(e,"tablet"),phone:H(e,"phone")});function Ht(e){let t=Be(e);return U.every(s=>t[s].kind==="none")?null:t}var We={...Object.fromEntries([...V].map(e=>[e,"a root position: sticky bar; an outer box becomes its sticky containing block and the pin collapses (the same fact every wrapper pass excludes it for, lib/content/section-surface)"])),HeroSlide:"a slide is a direct child of the Hero's transform track ([&>*]:basis-full); a wrapper would take its width, and the Hero already moves one slide in at a time",HeroGroup:"a slide box is placed by grid-item properties on its own root (--sf-hg-row, justify-self); a wrapper becomes the grid item and the box loses its anchor (lib/document/blocks/general/HeroGroup/meta)",[q]:"a host part draws its data block's answer with no element of its own (lib/content/card-template HOST_PART_TYPE); a wrapper would be one, and the host's content is not the merchant's to animate"},Ft=new Set(Object.keys(We));function ae(e,t,s,a){return t<=0?1/0:a?2*(e-4)/(t+s):2*(e-s/2-4)/t}function ne(e,t,s){let a=o=>o.width>0&&o.height>0;if(!a(e)||t.some(o=>o.mark&&!a(o.rect)))return 1;let n=e.left+e.width/2,r=e.top+e.height/2,i=s;for(let{rect:o,mark:l}of t){let h=Math.abs(o.left+o.width/2-n),w=Math.abs(o.top+o.height/2-r),u=Math.max(ae(h,e.width,o.width,l),ae(w,e.height,o.height,l));i=Math.min(i,Math.max(1,u))}return i}import{parseOption as Ke}from"efficient-shell/format";var re=["cover","contain"],qe={cover:"Cover",contain:"Contain"},Gt="Image fit";function F(e,t){return Ke(re,t,e)}function Yt(){return re.map(e=>({label:qe[e],value:e}))}function Bt(e){return e==="contain"?"object-contain":"object-cover"}function M(e,t){return e!=="auto"&&t==="cover"}var Ve=P.map(e=>e.image).filter(e=>e!==I),R=e=>S(e)?I:e,p="fill",Xt={label:"Fill row",value:p,showWhen:K},D="4/3",ie={frame:"view-wide:h-full view-wide:min-h-[240px]",img:"view-wide:absolute view-wide:inset-0",figure:"view-wide:h-full"},le={all:{frame:"h-full min-h-[240px]",img:"absolute inset-0",figure:"h-full"},wide:ie,tablet:ie,desktop:{frame:"view-desktop:h-full view-desktop:min-h-[240px] max-view-desktop:aspect-[4/3]",img:"view-desktop:absolute view-desktop:inset-0",figure:"view-desktop:h-full"}};function jt(e,t,s){return t&&!v(s)?"all":e??"wide"}function oe(e){return le[e]}var zt=le.all;function ce(e){return e?`${e.img} h-full w-full`:"relative h-full w-full"}var Xe={auto:"","3/4":"aspect-[3/4]","2/1":"aspect-[2/1]","21/9":"aspect-[21/9]","16/9":"aspect-[16/9]","4/3":"aspect-[4/3]","16/10":"aspect-[16/10]","1/1":"aspect-square","9/16":"aspect-[9/16]","2/3":"aspect-[2/3]","4/5":"aspect-[4/5]",custom:"aspect-[var(--shape-ratio)]"},je={auto:"","3/4":"view-wide:aspect-[3/4]","2/1":"view-wide:aspect-[2/1]","21/9":"view-wide:aspect-[21/9]","16/9":"view-wide:aspect-[16/9]","4/3":"view-wide:aspect-[4/3]","16/10":"view-wide:aspect-[16/10]","1/1":"view-wide:aspect-square","9/16":"view-wide:aspect-[9/16]","2/3":"view-wide:aspect-[2/3]","4/5":"view-wide:aspect-[4/5]",custom:"view-wide:aspect-[var(--shape-ratio)]"},ze={auto:"","3/4":"max-view-wide:aspect-[3/4]","2/1":"max-view-wide:aspect-[2/1]","21/9":"max-view-wide:aspect-[21/9]","16/9":"max-view-wide:aspect-[16/9]","4/3":"max-view-wide:aspect-[4/3]","16/10":"max-view-wide:aspect-[16/10]","1/1":"max-view-wide:aspect-square","9/16":"max-view-wide:aspect-[9/16]","2/3":"max-view-wide:aspect-[2/3]","4/5":"max-view-wide:aspect-[4/5]",custom:"max-view-wide:aspect-[var(--shape-ratio-phone)]"},Ue={auto:"max-view-wide:aspect-auto!","3/4":"max-view-wide:aspect-[3/4]!","2/1":"max-view-wide:aspect-[2/1]!","21/9":"max-view-wide:aspect-[21/9]!","16/9":"max-view-wide:aspect-[16/9]!","4/3":"","16/10":"max-view-wide:aspect-[16/10]!","1/1":"max-view-wide:aspect-square!","9/16":"max-view-wide:aspect-[9/16]!","2/3":"max-view-wide:aspect-[2/3]!","4/5":"max-view-wide:aspect-[4/5]!",custom:"max-view-wide:aspect-[var(--shape-ratio-phone)]!"},$=e=>Ve.includes(e)||S(e),v=$;function Ut(e){let t=$(e)?S(e)?X(e):P.find(s=>s.image===e)?.ratio:null;return t?j(t):null}function Zt(e,t){return z({desktop:e,phone:t})}function Jt(e,t,s){return s==="contain"?!0:[e,t??e].every(a=>a!==p&&(!$(a)||a==="auto"))}function Qt(e,t){return e===p&&!t?D:e}function es(e){return e===p?D:v(e)?e:void 0}function ue(e,t){return v(t)?t===e?null:t:e===p?D:null}function Ze(e,t){let s=ue(e,t);return M(e,"cover")||s!==null&&M(s,"cover")}function Je(e,t,s){return F(e,"cover")==="cover"&&Ze(t,s)}function ts(e,t,s,a){return e==="desktop"?Je(t,s,a):F(t,"cover")!=="cover"?!1:Qe(e==="tablet"?s:ue(s,a)??s)}var Qe=e=>e===p||v(e)&&e!=="auto";function ss(e,t,s="wide"){return e===p&&s==="all"?oe("all").frame:t===null?v(e)?Xe[R(e)]:"":[e===p?oe(s).frame:v(e)?je[R(e)]:"",e===p&&s==="desktop"?Ue[R(t)]:ze[R(t)]].filter(Boolean).join(" ")}var T=et(null);function us({attrs:e,style:t,children:s}){return E(T.Provider,{value:{attrs:e,style:t},children:s})}function he({children:e}){return E(T.Provider,{value:null,children:e})}function ms({fill:e=null,children:t}){let s=fe(T);return s?E("div",{className:ce(e),...s.attrs,style:s.style,children:t}):E(pe,{children:t})}var L="data-sf-mark";function de(e){let t=e.getBoundingClientRect(),s=e.firstElementChild,a=s&&typeof s.offsetWidth=="number"?s:e,n=Math.max(a.offsetWidth,e.offsetWidth),r=Math.max(a.offsetHeight,e.offsetHeight);return{left:t.left+t.width/2-n/2,top:t.top+t.height/2-r/2,width:n,height:r}}function nt(e){return e.closest(`[${L}]`)||e.closest("style, script")?!1:[...e.childNodes].some(t=>t.nodeType===3&&(t.textContent??"").trim()!=="")}var we=e=>e.closest(`.${se}`)??e.ownerDocument.body;function rt(e,t){let s=we(e),a=[];for(let n of s.querySelectorAll(`[${L}]`))n!==e&&a.push({rect:de(n),mark:!0});for(let n of s.querySelectorAll("*")){if(n.contains(e)||!nt(n))continue;let r=n.getBoundingClientRect();r.width===0||r.height===0||a.push({rect:{left:r.left,top:r.top,width:r.width,height:r.height},mark:!1})}return ne(de(e),a,t)}function ds({inCell:e=!1,children:t}){let s=fe(T),a=st(null),[n,r]=at(null),i=s?Number.parseFloat(String(s.style[me])):Number.NaN;if(tt(()=>{let l=a.current;if(!l||!Number.isFinite(i))return;let h=()=>r(rt(l,i));h();let w=l.ownerDocument.defaultView?.ResizeObserver;if(!w)return;let u=new w(h),_=we(l);u.observe(l),u.observe(_);for(let g of _.querySelectorAll(`[${L}]`))g!==l&&u.observe(g);return()=>u.disconnect()},[i]),!s)return E(pe,{children:t});let o=Number.isFinite(i)?{...s.style,[me]:String(n??1)}:s.style;return E("span",{ref:a,className:e?"inline-flex min-w-0 max-w-full items-center justify-center":"inline-flex items-center justify-center",[L]:"",...s.attrs,style:o,children:t})}var ge={stretchedRow:!1,fillingColumn:!1},c=W(null),ve=()=>d(c)!==null;function _s({line:e,draw:t}){return m(it,{children:t(b(e,ve()))})}var Cs=(e="by-box")=>b(e,ve()),bs=()=>d(c),As=()=>d(c)?.id??null,f=W(!1);function ot(){let e=d(c)?.stretchedRow===!0,t=d(f);return e&&!t}var lt=()=>d(f);function ct(){let e=d(c),t=ot(),s=lt();return{fill:s?` ${Q}`:"",inner:a=>{let n=t||s?m(f.Provider,{value:!0,children:a}):a;return e?.columnsRow?m(c.Provider,{value:{...e,columnsRow:!1},children:n}):n}}}function xs({className:e,style:t,attrs:s,children:a}){let{fill:n,inner:r}=ct(),i=Y();return i.scope(m("div",{className:B(`${e}${n}`,i.className),...t?{style:t}:{},...s,...i.attrs,children:r(a)}))}var G=W(!1);function Ns({children:e}){return m(G.Provider,{value:!0,children:m(f.Provider,{value:!0,children:e})})}function Ss({children:e,ownPictures:t=!1}){let s=d(c),a=d(G),n=d(f),r=a&&n,i=s===null?null:s.id===void 0?ge:{...ge,id:s.id};return m(c.Provider,{value:i,children:m(G.Provider,{value:!1,children:m(f.Provider,{value:r,children:t?e:m(he,{children:e})})})})}var k=_e(null),Ee="data-sf-view-hide",Ce=e=>x(k.Provider,{value:null},e),be={className:"",attrs:{},scope:Ce},ut=be,Ae=_e(null),Ps=(e,t)=>e?{className:e,views:t}:null,mt=e=>x(k.Provider,{value:null},x(Ae.Provider,{value:null},x(f.Provider,{value:!0},e))),Is=(e,t,s={})=>e?{className:e,words:t,...s}:null,xe=(e,t)=>e.sectionClassName===void 0?{className:e.className,words:e.words}:b(e.line??"by-box",t)?{className:e.className,words:`${e.words} edge`}:{className:e.sectionClassName,words:e.words};function Y(){let e=N(k),t=N(Ae),s=N(c)!==null;if(e===null&&t===null)return ut;let a=e===null?null:xe(e,s);return t===null?{className:a.className,attrs:{[Ee]:a.words},scope:Ce}:{className:a?`${a.className} ${t.className}`:t.className,attrs:{...a?{[Ee]:a.words}:{},[ee]:t.views},scope:mt}}function Os(){let e=N(k),t=N(c)!==null;return e===null?"":xe(e,t).className}var B=(e,t)=>t?e?`${e} ${t}`:t:e;function Hs(e){let t=Y(),s=e.takes===!1?be:t,a={},n=!1;for(let[r,i]of Object.entries(e))r==="as"||r==="takes"||r==="children"||(r==="className"?(a.className=B(i,s.className),n=!0):a[r]=i);return!n&&s.className&&(a.className=s.className),s.scope(x(e.as??"div",{...a,...s.attrs},e.children))}var Ms={small:54,medium:66,large:84},dt=44,pt=16,ft=140,Ds={min:pt,max:ft,step:1},$s=dt*4;import{forwardRef as ht}from"react";import{imageCopyUrl as Ne,imageSrcSet as Se}from"efficient-shell/image-copies";import{jsx as vt}from"react/jsx-runtime";var wt={position:"absolute",height:"100%",width:"100%",left:0,top:0,right:0,bottom:0,color:"transparent"};function ye(e,t,s){if(s){let a=Se(e);return a?{src:Ne(e,1280),srcSet:a,sizes:s}:{src:e,sizes:s}}if(t&&t>0){let a=Se(e,{maxWidth:t*3});return a?{src:Ne(e,t*2),srcSet:a,sizes:`${t}px`}:{src:e}}return{src:e}}var gt=ht(function({src:t,width:s,height:a,fill:n,priority:r,loading:i,style:o,quality:l,placeholder:h,blurDataURL:w,unoptimized:u,loader:_,overrideSrc:g,sizes:C,...Re},Le){let Te=g??(typeof t=="string"?t:t.src),ke=ye(Te,n?void 0:Number(s)||void 0,C??(n?"100vw":void 0));return vt("img",{ref:Le,...ke,width:n?void 0:s,height:n?void 0:a,loading:r?"eager":i??"lazy",fetchPriority:r?"high":void 0,decoding:"async",style:n?{...wt,...o}:{color:"transparent",...o},...Re})}),Ws=gt;function Ks(e){let t=e.overrideSrc??(typeof e.src=="string"?e.src:e.src.src),s=e.fill?void 0:Number(e.width)||void 0;return{props:ye(t,s,e.sizes??(e.fill?"100vw":void 0))}}export{A as a,O as b,De as c,se as d,H as e,Be as f,Ht as g,Ft as h,qe as i,Gt as j,F as k,Yt as l,Bt as m,p as n,Xt as o,jt as p,oe as q,zt as r,ce as s,Ut as t,Zt as u,Jt as v,Qt as w,es as x,ue as y,Ze as z,Je as A,ts as B,ss as C,us as D,he as E,ms as F,ds as G,k as H,be as I,Ae as J,Ps as K,Is as L,Y as M,Os as N,B as O,Hs as P,c as Q,_s as R,Cs as S,bs as T,As as U,f as V,ot as W,lt as X,ct as Y,xs as Z,Ns as _,Ss as $,Ms as aa,dt as ba,pt as ca,Ds as da,$s as ea,Ws as fa,Ks as ga,_t as ha,te as ia,Fe as ja,Me as ka,At as la,xt as ma,Nt as na};