efficient-storefront-blocks 0.128.0 → 0.128.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/dist/chunks/{CustomHtmlCodeWindow-KYIRVDW4.js → CustomHtmlCodeWindow-MSEPX5HA.js} +1 -1
- package/dist/chunks/{EditorPreviewCheckout-ZKCDEXJB.js → EditorPreviewCheckout-GQZSREXK.js} +1 -1
- package/dist/chunks/SiteEditorProvider-U4Y5HLNK.js +1 -0
- package/dist/chunks/{chunk-LFKRQYYH.js → chunk-4HYAKN2G.js} +1 -1
- package/dist/chunks/{chunk-KNFNQXH3.js → chunk-4TGKSUNO.js} +1 -1
- package/dist/chunks/{chunk-5LNWW4W3.js → chunk-AJHYWZA6.js} +1 -1
- package/dist/chunks/{chunk-WFSVFVZX.js → chunk-AZNXYX4W.js} +1 -1
- package/dist/chunks/{chunk-FP652PBZ.js → chunk-B22AOLEU.js} +1 -1
- package/dist/chunks/{chunk-INU4IUCT.js → chunk-EHNNMX2W.js} +2 -2
- package/dist/chunks/{chunk-IEGDV4YL.js → chunk-UJNY3ZUO.js} +1 -1
- package/dist/chunks/chunk-YZZMDZT2.js +9 -0
- package/dist/chunks/{fitment-data-GPEMPASJ.js → fitment-data-JRGRP6YG.js} +1 -1
- package/dist/chunks/{section-css-style-UICZZ7D5.js → section-css-style-GHS565I6.js} +1 -1
- package/dist/editor.css +1 -1
- package/dist/index.js +31 -29
- package/dist/render/built-with.json +1 -1
- package/dist/routine-index.json +1 -1
- package/dist/value-index.json +1 -1
- package/dist/words.d.ts +5 -0
- package/dist/words.js +3 -3
- package/package.json +2 -2
- package/dist/chunks/SiteEditorProvider-WQG3BNYV.js +0 -1
- package/dist/chunks/chunk-N64MDCTX.js +0 -9
- /package/dist/chunks/{chunk-VRXNUWWF.js → chunk-AUQKCN7Q.js} +0 -0
- /package/dist/chunks/{chunk-FP652PBZ.js.LEGAL.txt → chunk-B22AOLEU.js.LEGAL.txt} +0 -0
- /package/dist/chunks/{chunk-INU4IUCT.js.LEGAL.txt → chunk-EHNNMX2W.js.LEGAL.txt} +0 -0
- /package/dist/chunks/{chunk-XSDGCHJH.js → chunk-PN7RMJTO.js} +0 -0
- /package/dist/chunks/{chunk-DIX2FLX7.js → chunk-POFTB7WN.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{$ as af,D as Ok,E as Ek,F as Qd,G as _k,H as Nk,I as Cr,J as Mk,K as Hk,L as Wk,M as at,N as ef,O as Co,P as de,R as of,S as kr,T as tf,X as $k,Y as rf,Z as vr,_ as zk,a as qo,b as Vs,ba as Qv,c as zd,d as yn,e as Ys,f as nk,fa as fP,g as Sn,h as Ud,ha as cP,ia as Rf,ja as MT,ka as HT,r as ol,t as Tk}from"./chunk-5LNWW4W3.js";import{a as hP,d as gf,e as nt,f as yf,g as Sf,h as kf,l as Ux}from"./chunk-XSDGCHJH.js";import{$ as In,$a as pk,$c as wv,$e as yP,$j as An,A as wC,Aa as YC,Ab as Ht,Ac as sv,Ad as Hv,Ah as cT,Aj as bT,Ak as Hx,Al as Nf,B as CC,Ba as XC,Bb as wn,Bc as lv,Bd as Wv,Be as Ct,Bh as pT,Bj as Rx,C as ot,Ca as ZC,Cb as el,Cc as $t,Cd as $v,Cf as _P,Cg as VP,D as kC,Da as JC,Dc as Ue,Dd as zv,De as je,Df as Tx,Dg as YP,Dj as En,E as vC,Ea as QC,Ec as Pr,Ed as bx,Ee as kt,Ef as AP,Eg as XP,Ej as wT,F as PC,Fa as ek,Fb as mx,Fc as Ix,Fd as Uv,Fe as Te,Ff as FP,Fg as ZP,G as TC,Ga as Sr,Gb as aa,Gc as iv,Gd as wx,Ge as mP,Gf as BP,Gg as JP,Gk as Bf,H as OC,Ha as ok,Hb as Jd,Hc as dv,Hd as jv,Hf as LP,Hg as _x,Hj as Dx,Hk as Lf,I as EC,Ib as kk,Ic as fv,Id as Gv,Ig as QP,Ij as dl,Ik as Wx,J as _C,Ja as tk,Jb as vk,Jc as pf,Jd as Kv,Jf as RP,Jg as Ax,Jk as LT,Ka as jd,Kb as Pk,Kc as rl,Kd as zt,Ke as Cx,Kg as rr,Kk as pa,L as AC,La as Xs,Lb as nf,Lc as cv,Ld as qv,Lg as Fx,Lj as _n,Lk as RT,M as FC,Ma as Gd,Mb as Gk,Mc as pv,Md as ia,Mg as Pf,Mk as DT,N as BC,Na as sk,Nb as sf,Nc as uv,Nd as Vv,Ne as ll,Ng as eT,Nj as CT,Nk as NT,O as Dd,Ob as hx,Oc as uf,Od as Pn,Og as oT,P as LC,Pb as lf,Pc as mv,Pg as tT,Pk as WT,Q as RC,Qc as xv,Qd as or,Qf as DP,Qg as rT,Qk as $x,Ra as lk,Rc as gx,Rd as Yv,Re as xP,Rf as NP,Rg as aT,Sa as ik,Sc as hv,Sd as sl,Se as kx,Sf as MP,Sk as $T,Ta as Zs,Tc as vn,Td as Xv,Te as IP,Tf as Ox,Tk as zT,Ub as Cn,Ud as da,Uf as HP,Ug as nT,Uk as UT,V as ax,Va as bn,Vc as Iv,Vd as Zv,Vf as WP,Vg as sT,Vj as kT,Vk as jT,Wa as dk,Wc as gv,Wf as Ex,Wj as Nx,Wk as GT,X as Gs,Xa as Kd,Xb as Kk,Xc as yv,Xd as mf,Xj as vT,Xk as KT,Y as Nd,Ya as fk,Yb as qk,Yc as Sv,Yd as Or,Yi as ca,Yj as PT,Z as Fo,Za as Js,Zb as Vk,Zc as bv,Zd as Jv,_ as nx,_a as ck,_b as tl,_c as na,_e as gP,_f as tr,_i as ar,_j as Ff,a as Ao,aa as DC,ab as cx,ad as yx,af as bf,ag as Tn,ai as uT,ak as Fn,b as mn,ba as NC,bb as uk,bd as Cv,bf as SP,bh as Tf,bi as mT,bk as fl,ca as MC,cb as qd,cd as kv,cf as vx,cg as $P,ck as Bn,d as aC,da as HC,db as mk,dd as vv,df as bP,dg as zP,dk as TT,e as ex,ea as WC,eb as px,ed as Pv,ef as wP,eg as vf,f as nC,fa as sx,fd as Tv,fe as eP,ff as CP,fg as Er,fj as _f,g as c,gb as xk,gd as Tr,gf as kP,gg as UP,h as Mt,ha as $C,hb as hk,hd as al,hf as wf,hh as lT,hj as IT,i as hn,ia as Md,id as sa,ie as oP,ig as On,j as Us,jb as Vd,jc as kn,jd as Ov,je as tP,jf as vP,jh as iT,k as Mo,kb as Ik,kc as Wt,ke as rP,kk as OT,l as js,lb as gk,lc as Yk,ld as la,li as xT,lk as ET,mb as yk,mc as Xk,md as nl,mf as Px,mi as hT,ml as zx,n as uC,nb as Sk,nc as Zk,nd as Ev,o as mC,ob as Yd,oc as Jk,od as _v,p as xC,pb as bk,pc as Qk,pe as Ho,q as hC,qc as df,qd as Av,qe as Je,r as IC,rc as ff,rd as Fv,rf as PP,rg as _r,s as gC,sb as wk,sc as ev,sd as Bv,se as xf,sf as TP,sg as jP,sk as Mx,t as yC,tb as br,te as aP,tf as Cf,tg as GP,th as Bx,tj as gT,u as Rd,ub as Xd,uc as ov,ud as Lv,ue as nP,uf as OP,ug as KP,uh as Of,uk as _T,ul as qT,v as yr,va as GC,vb as Zd,vc as tv,vd as Rv,ve as sP,vf as EP,vh as fa,vk as AT,vl as VT,wa as KC,wb as Ck,wc as rv,wd as Dv,we as lP,wh as Ef,wj as yT,wk as FT,wl as Df,x as rx,xa as qC,xb as po,xc as cf,xd as Nv,xe as hf,xj as Af,xl as YT,y as SC,ya as VC,yb as ux,yc as av,yd as Sx,ye as iP,yg as qP,yh as dT,yj as Lx,yk as BT,z as bC,za as dx,zb as Qs,zc as nv,zd as Mv,ze as dP,zh as fT,zj as ST,zl as Ln}from"./chunk-N64MDCTX.js";import{a as cC,b as Ld,c as pC,g as Uk,h as xx,i as jk}from"./chunk-LFKRQYYH.js";import{$ as xb,$a as Db,$c as wo,$d as hw,$e as Xm,$g as tx,A as ro,Ae as qm,Af as Jm,B as tn,Bb as Ms,Bd as Gm,Be as Sw,Ca as Ie,Cb as Zb,D as Rs,Dd as cw,De as Vm,E as sd,Ed as yd,F as Lt,Fg as Xw,G as rn,Ga as Qo,Gb as hd,Gd as et,Gg as Zw,H as ze,Ha as St,Hc as rw,Hd as No,He as wd,Hf as Lw,Hg as Jw,I as qe,Ia as Pm,Id as Ze,Ie as Cd,Ig as Qw,J as an,Ja as Tm,Jc as Wm,Jd as Dt,Je as bw,Jh as fx,K as ld,Kd as Qt,Ke as kd,Kf as er,Kh as gn,L as ib,La as Om,Lb as Jb,Ld as wt,Le as vd,Lg as eC,Lh as rk,M as db,Ma as Em,Md as fn,Me as ww,Mh as tt,Nd as pw,Ne as Cw,Nh as rt,O as fb,Od as cn,Oe as Pd,Og as oC,Oh as $d,P as id,Pd as uw,Pe as Td,Pg as tC,Ph as ak,Q as cb,Qa as _m,Qb as Id,Qc as aw,Qe as ra,Qf as Rw,Qh as qs,R as Qr,Ra as Ob,Re as kw,Rg as rC,S as pb,Sa as Eb,T as ub,Ta as Ge,Tb as Qb,Td as ta,Tg as sC,Th as Ak,U as Ds,Ua as _b,Ub as ew,Ud as mw,Ug as lC,V as km,Va as ud,Vd as xw,Ve as vw,W as we,Wa as Ab,Wb as ow,Wd as pn,Wf as Dw,Wg as gr,X as K,Xa as Fb,Xc as U,Xd as Ws,Xf as Nw,Xh as Fk,Y as mb,Ya as Bb,Yb as Nm,Yc as re,Yd as $s,Ye as Nt,Yf as Mw,Yg as iC,Za as Lb,Zc as $m,Zd as Km,Ze as zs,Zf as Hw,Zg as ox,_ as dd,_a as Rb,_c as L,_e as Ym,_g as dC,a as on,ab as Nb,ad as Zt,ae as Iw,af as Pw,ah as Bd,b as fo,ba as hb,bb as Mb,bd as nw,be as gw,bf as Tw,bg as Ww,c as to,ca as fd,cb as md,cd as W,cf as Od,cg as $w,ch as fC,ci as Bk,d as Yt,da as Ib,db as xd,dd as gd,de as yw,df as Ow,di as wr,ea as gb,eb as Hb,ed as Do,eg as zw,f as Ko,fa as vm,fb as Wb,fc as Mm,fd as sw,fe as Sd,fg as Uw,fi as Lk,g as Ls,ga as yb,gd as bt,gf as Ew,gg as Ad,gi as Rk,h as eb,ha as Sb,hb as $b,hd as Rt,he as bd,hf as Ed,hg as jw,hi as Dk,i as ob,ia as bb,ib as zb,id as zm,if as _w,ig as Fd,j as tb,jb as Am,jd as hr,jf as Zm,jg as Qm,k as rb,kb as Ub,kd as Jt,kf as Aw,la as wb,lb as jb,ld as lw,lf as Fw,li as ko,ma as Cb,mb as Fm,mf as _d,mg as Gw,na as kb,nb as sn,nd as Fe,nf as un,ng as Kw,o as ab,ob as ea,od as oa,of as xn,pa as vb,pb as Bm,pd as Hs,pf as Ir,pi as il,qb as Lm,qd as ln,qg as qw,qh as lx,ra as Pb,rb as Rm,rd as iw,rg as Vw,rh as Hd,s as nb,sa as cd,sb as Gb,sd as Um,sh as zC,ta as Tb,tb as Kb,td as dn,tf as Bw,th as ix,u as Ne,ua as pd,ub as qb,uc as Hm,ud as jm,ug as Yw,uh as UC,v as sb,vb as Dm,w as nd,wb as Vb,wc as tw,wh as Wd,x as lb,xb as Xt,xh as jC,ya as Ns,yb as Yb,yd as dw,yh as Ks,z as Pe,za as nn,zb as Xb,zd as fw}from"./chunk-KNFNQXH3.js";import{a as z,b as co}from"./chunk-VRXNUWWF.js";import{c as pP,d as uP,e as If}from"./chunk-DIX2FLX7.js";import{jsx as jx,Fragment as Y4,jsxs as X4}from"react/jsx-runtime";import{createContext as Z4,useContext as J4}from"react";var Q4={mirrorHostStyles:!0,css:null,fontHrefs:[]},XT=Z4(Q4);function hne({value:e,children:o}){return jx(XT.Provider,{value:e,children:o})}function cl(){return J4(XT)}function ZT(){let{css:e,fontHrefs:o}=cl();return X4(Y4,{children:[o.map(t=>jx("link",{rel:"stylesheet",href:t},t)),e?jx("style",{"data-sf-canvas-css":"",children:e}):null]})}import{jsx as e6}from"react/jsx-runtime";import{createContext as o6,useContext as t6}from"react";var JT=o6(void 0);function Sne({metadata:e,children:o}){return e6(JT.Provider,{value:e,children:o})}var QT=()=>t6(JT);import{jsx as lo,Fragment as R4,jsxs as Qi}from"react/jsx-runtime";import{useCallback as _s,useEffect as qt,useRef as zae,useState as A4}from"react";import{SettingsSwitch as Uae}from"efficient-easel/panel";import{PagesIcon as jae,StylesIcon as Gae}from"efficient-easel/rail";import{PaletteIcon as Kae}from"efficient-shell/icons/efficient";import{Subtree as qae,TreeRow as D4}from"efficient-easel/tree";import{useEasel as N4}from"efficient-easel/easel";import{toItemSelector as Vae}from"efficient-easel/node-ops";import{useEaselStrings as M4}from"efficient-easel/strings";import{createContext as r6,useContext as a6}from"react";var Gx=r6(!1),Cne=()=>a6(Gx);import{useMemo as n6,useRef as s6}from"react";import{useEaselApi as l6}from"efficient-easel/easel";import{useSectionOps as i6}from"efficient-easel/screen/lib/document/use-section-ops";function Mf(){let e=l6(),o=i6(),t=s6(o);return t.current=o,n6(()=>({getItemById:r=>e.getState().getItemById(r),getSelectorForId:r=>e.getState().getSelectorForId(r),get components(){return e.getState().config.components},replace:(r,a,n)=>t.current.replaceComponent(r,a,n)}),[e])}import{encodePartId as E6}from"efficient-easel/draw";import{insertAt as _6,moveTo as A6,removeAt as F6}from"efficient-easel/fields";import{useSyncExternalStore as w6}from"react";import{isNodeList as e0}from"efficient-easel/data";var o0="Flex";function Rn(e,o){return Nt(e)?typeof e?.[Ko]=="string"?Kx(o?.[Ko]):"":Kx(e?.[Ko])}var Kx=e=>typeof e=="string"?e.trim():"",d6=e=>e.type===ro&&Array.isArray(e.props?.[Vm])&&e.props[Vm].some(o=>Kx(o?.[Ko])!==""),f6=new Intl.NumberFormat("en-US");function c6(e){return/^\d+$/.test(e)?f6.format(Number(e)):e}function Bne(e,o){let t=o?o.find(r=>r.key===e)?.value:nb(Ls).find(r=>r.key===e)?.value;return t===void 0?null:c6(t)}var p6={[Ko]:"any"};function qx(e,o=!1){let t=e.props;if(!t)return{node:e,names:!1};let r=e.type==="Text"&&(Rn(t)!==""||o&&Rn(t,p6)!==""),a=o||d6(e),n=qe(e,l=>ze(l,i=>{let d=qx(i,a);return d.names&&(r=!0),d.node})).props;if(e.type!==o0)return{node:n===t?e:{...e,props:n},names:r};let s=Ne(n);if(r&&!s&&(n={...n,[to]:Ls}),!r&&s===Ls){let{[to]:l,...i}=n;n=i}return{node:n===t?e:{...e,props:n},names:!1}}function t0(e,o,t){for(let r of e){if(r?.props?.id===o)return t;for(let a of rn(r??{})){let n=t0(a,o,r.type===o0?r:t);if(n!==void 0)return n}}}function Lne(e,o){if(!e0(e))return!0;let t=t0(e,o,null);if(t===void 0)return!0;if(t===null)return!1;let r=Ne(t.props);return!r||r===Ls}function r0(e){let o=e?.content;if(!e0(o))return e;let t=o.map(r=>qx(r));return t.every((r,a)=>r.node===o[a])?e:{...e,content:t.map(r=>r.node)}}function a0(e){return qx(e).node}import{decodePartId as C6}from"efficient-easel/draw";function Dn(e,o){let t=tv(e);return t?.control==="textList"?o.rowKey===(t.itemKey??"text")?AT(t,o.index):null:rv(e)?.[o.rowKey]??null}function Hf(e,o,t){let r=e.node.props,{key:a,row:n}=Wt(e.propKey),s=n?nv(r,a,n,e.kind,o):ov(r,a,e.kind,o);return s?(t(e.zone,e.index,{...e.node,props:s}),!0):!1}import{readHidable as l0}from"efficient-easel/draw";import{parseOption as u6}from"efficient-shell/format";var Vx=e=>String(e+1).padStart(2,"0"),m6=[{label:"01 \xB7",value:"two-digit"},{label:"1.",value:"plain"}],Yx="two-digit",n0=e=>u6(m6,Yx,e),Wf=(e,o)=>e==="plain"?`${o+1}.`:Vx(o);var Jx="Contents",Xx="Flex",s0="Text",x6="numberForm",h6="_contentsEntries",I6="_kickerNumber",i0="data-sf-kicker-number",g6=e=>l0(e).text.trim(),d0=e=>da(e?.anchor),Zx=e=>String(e.props?.id??""),y6=e=>!l0(e.props?.text).hidden&&!Rn(e.props)&&!Nt(e.props),pl=e=>rn(e);function f0(e){for(let o of pl(e))for(let t of o){if(or(t.props??{}))continue;if(t.type===s0&&y6(t))return t;if(t.type===s0)continue;let r=f0(t);if(r)return r}}function c0(e){return pl(e).some(o=>o.some(t=>t&&!or(t.props??{})&&(t.type===Jx||c0(t))))}var p0=e=>e.type===Xx&&Tn(Xx,e.props?.direction)==="row";function u0(e){return pl(e).some(o=>o.some(t=>t&&!or(t.props??{})&&(t.type===Jx||!p0(t)&&u0(t))))}function S6(e){let o=[],t=(r,a)=>{for(let n of r){if(!n||or(n.props??{}))continue;if(n.type===Jx){a.open={contents:n,sections:a.waiting??[]},a.waiting=null,o.push(a.open);continue}if(p0(n)&&u0(n)){let l={inRow:!0,open:null,waiting:[]};for(let i of pl(n))t(i,l);a.inRow||(a.open=null);continue}let s=a.open?.sections??a.waiting;if(n.type===Xx&&d0(n.props)&&s&&!c0(n)){s.push({box:n,kicker:f0(n)});continue}for(let l of pl(n))t(l,a)}};return t(e,{inRow:!1,open:null,waiting:null}),o}function b6(e){return e.map(o=>({label:o.kicker?nn(g6(o.kicker.props?.text)):"",anchor:d0(o.box.props)}))}function Qx(e){let o=e?.length?S6(e):[];if(!o.length)return null;let t=new Map,r=new Map;for(let a of o){let n=Zx(a.contents);n&&t.set(n,b6(a.sections));let s=n0(a.contents.props?.[x6]);a.sections.forEach((l,i)=>{let d=l.kicker?Zx(l.kicker):"";d&&r.set(d,Wf(s,i))})}return{entries:t,numbers:r}}var Qne=e=>e.endsWith(".")?`${e} `:`${e} \xB7 `;function m0(e){let o=e;if(!o?.content?.length)return e;let t=Qx(o.content);if(!t)return e;let{entries:r,numbers:a}=t,n=s=>{let l=qe(s,h=>ze(h,n)),i=l.props??{},d=l!==s,f=Zx(s),x=f?r.get(f):void 0;x&&(i={...i,[h6]:x},d=!0);let u=f?a.get(f):void 0;return u&&(i={...i,[I6]:u},d=!0),d?{...s,props:i}:s};return{...o,content:o.content.map(n)}}var k6=`[${i0}]`,v6=["bold","italic","underline","strike","link","sup","sub"],P6=["bullet","number"];function th(e,o){return e?[...v6,...o?P6:[]]:[]}function x0(e,o){let t=C6(e);if(!t?.propKey)return null;let{nodeId:r,propKey:a}=t,n=o.getItemById(r),s=o.getSelectorForId(r);if(!n||!s)return null;let{key:l,row:i}=Wt(a),d=o.components[n.type]?.fields?.[l],f=i?Dn(d,i):d,x=df(f);if(!x)return null;let u=n.props??{};if(uT(u)!==null||!i&&Od(n.type,u,l)||n.type==="Text"&&l==="text"&&Rn(u)||i&&!(Array.isArray(u[l])&&i.index<u[l].length))return null;let h=i?cf(u[l],i):u[l];return{node:n,selector:s,propKey:a,kind:x,stored:h,offPage:_f(f),panelOnly:Qk(f)}}function $f(e,o){let t=x0(e,o);if(!t)return null;let{text:r,hidden:a}=ca(t.stored);if(!xv({offPage:t.offPage,hidden:!!a,panelOnly:t.panelOnly}))return null;let n=ff(t.kind);return{partId:e,value:r,rules:cd,multiline:n,skip:k6,offered:th(t.kind!=="plainText",n),write:s=>{let l=x0(e,o);l&&Hf({node:l.node,propKey:l.propKey,kind:l.kind,zone:l.selector.zone,index:l.selector.index},s,o.replace)}}}function rh(e,o,t){return e?.isConnected&&e.getAttribute(Ue)===t?e:o?.querySelector(`[${Ue}="${zf(t)}"]`)??null}function zf(e){return e.replace(/["\\]/g,"\\$&")}function h0(e){let o=e.activeElement;return o?o.tagName==="IFRAME"||!!o.closest(".es-canvas"):!1}var eh=null,oh=new Set;function T6(){return eh}function ah(e){if(e!==eh){eh=e;for(let o of oh)o()}}function O6(e){return oh.add(e),()=>{oh.delete(e)}}function I0(){return w6(O6,T6,()=>null)}function g0(e,o){if(e.outer)return null;let t=o.getItemById(e.ownerId);if(!t)return null;let r=ww(t.type);return!r||Ne(t.props)?null:{node:t,rows:r}}function B6(e,o){let t=g0(e,o),r=o.getItemById(e.nodeId);if(!t||!r)return null;let a=Ow(r.type,r.props,e.key);if(!a)return null;let n=t.node.props[t.rows];return!Array.isArray(n)||e.index<0||e.index>=n.length?null:E6(e.ownerId,kn(t.rows,{index:e.index,rowKey:a}))}function Uf(e,o){let t=B6(e,o);return t?$f(t,o):null}function y0(e,o){return Uf(e,o)?.value}function S0(e,o){let t=Uf(e,o);return t?(t.write(e.text),!0):!1}function b0(e,o){let t=g0(e,o),r=t&&o.getSelectorForId(e.ownerId);if(!t||!r)return!1;let a=t.node.props,n=a[t.rows],s=e.index;if(!Array.isArray(n)||s<0||s>=n.length)return!1;let l;switch(e.action){case"addAfter":{let i=o.components[t.node.type]?.fields?.[t.rows];l=_6(n,s+1,{...i?.defaultItemProps??{}});break}case"moveEarlier":case"moveLater":{let i=e.action==="moveEarlier"?s-1:s+1;if(i<0||i>=n.length)return!1;l=A6(n,s,i);break}case"delete":l=F6(n,s);break;default:return!1}return o.replace(r.zone,r.index,{...t.node,props:{...a,[t.rows]:l}}),!0}import{jsx as ke,Fragment as tJ,jsxs as Mu}from"react/jsx-runtime";import{Fragment as rJ,useEffect as eH,useMemo as oH,useRef as aJ,useState as $a}from"react";import{useScreenDocument as sH}from"efficient-easel/screen/components/ScreenDocumentContext";import{UiIcon as Ny}from"efficient-easel/draw/client";import nJ from"efficient-easel/screen/components/SidePanelHead";import{InspectorIconButton as sJ}from"efficient-easel/chrome";import{Input as lJ,LoadingSpinner as iJ,PopupMenu as dJ,PopupMenuItem as tH,toast as rH}from"efficient-shell/ui";import{LayersTree as fJ,TreeGroupLabel as cJ,TreeRow as aH,TreeRowAction as Hu}from"efficient-easel/tree";import{AddIcon as pJ,DuplicateIcon as uJ,PageIcon as mJ,SettingsIcon as xJ}from"efficient-easel/icons";import{PagesIcon as hJ}from"efficient-easel/rail";import{useEaselHost as IJ}from"efficient-easel/screen/lib/host";import{useEaselSession as My}from"efficient-easel/screen/lib/session-context";import{useCallback as jf,useEffect as L6,useSyncExternalStore as R6}from"react";import{useScreenDocument as v0}from"efficient-easel/screen/components/ScreenDocumentContext";var w0=new WeakMap;function ul(e){let o=w0.get(e);return o||(o={rows:null,loading:null,listeners:new Set},w0.set(e,o)),o}function nh(e,o){e.rows=o;for(let t of e.listeners)t()}var Gf=new Set;function Kf(e,o){o?Gf.add(e):Gf.delete(e)}function C0(e){let o=ul(e),t=e.listPages().then(r=>nh(o,Gf.size?r.filter(a=>!Gf.has(a.id)):r),()=>nh(o,[])).finally(()=>{o.loading===t&&(o.loading=null)});return o.loading=t,t}var k0=()=>null,D6=()=>()=>{};function ml(){let{adapter:e,ready:o}=v0(),t=jf(l=>{let{listeners:i}=ul(e);return i.add(l),()=>i.delete(l)},[e]),r=jf(()=>ul(e).rows,[e]),a=R6(o?t:D6,o?r:k0,k0);L6(()=>{if(!o)return;let l=ul(e);l.rows===null&&!l.loading&&C0(e)},[e,o]);let n=jf(()=>o?C0(e):Promise.resolve(),[e,o]),s=jf(l=>nh(ul(e),l),[e]);return{rows:a,reload:n,setRows:s,getRows:r}}function N6(e,o){return e?.find(t=>t.slug===o)?.label?.trim()||`/${o}`}function P0(){let{currentSlug:e}=v0(),{rows:o}=ml();return N6(o,e)}import{canDuplicatePage as gJ,DuplicatePageDialog as yJ}from"efficient-easel/page-copy";import{jsx as To,jsxs as KM}from"react/jsx-runtime";import{useEffect as HZ,useId as WZ,useMemo as $Z,useRef as zZ,useState as Ly}from"react";import{useScreenDocument as UZ}from"efficient-easel/screen/components/ScreenDocumentContext";import{useEaselSession as jZ}from"efficient-easel/screen/lib/session-context";import{uniqueSlug as qM}from"efficient-easel/page-copy";import{AddIcon as GZ}from"efficient-easel/icons";import{Button as KZ,Dialog as qZ,EmptyState as VZ,LoadingSpinner as YZ,Paragraph as XZ,SidebarLayout as ZZ,SidebarNavItem as Ry,Title as JZ,toast as VM}from"efficient-shell/ui";import{jsx as Tt,jsxs as cR}from"react/jsx-runtime";import{useEffect as U7,useState as Og}from"react";import{CanvasFrame as j7}from"efficient-easel/easel";import{Button as G7,Card as K7,FitFrame as q7,Text as V7}from"efficient-shell/ui";import{jsx as A0,Fragment as Y6,jsxs as X6}from"react/jsx-runtime";import{useEffect as F0,useLayoutEffect as Z6}from"react";var qf="data-theme",T0="light";function M6(e){return e.getAttribute(qf)===T0?"light":"dark"}function H6(e,o){return M6(e)===o?!1:(o==="light"?e.setAttribute(qf,T0):e.removeAttribute(qf),!0)}function W6(e){return Ux(e).getItem(Jm)}function Ose(e,o){Ux(e).setItem(Jm,o)}function $6(e,o,t=new Date().getHours()){return Lw({mode:o.mode,override:W6(e),switchShown:o.switchShown,hour:t})}function O0(e,o){let t=e.documentElement;if(!t)return()=>{};let r=()=>H6(t,$6(e,o));r();let a=e.defaultView?.MutationObserver;if(!a)return()=>{};let n=new a(r);return n.observe(t,{attributes:!0,attributeFilter:[qf]}),()=>n.disconnect()}var z6="style";function U6(e,o){let t=Fd(o),r=!1;for(let a of jw){let n=t[a]??"";e.style.getPropertyValue(a)!==n&&(n?e.style.setProperty(a,n):e.style.removeProperty(a),r=!0)}return r}function E0(e,o){let t=e.body;if(!t)return()=>{};let r=()=>U6(t,o);r();let a=e.defaultView?.MutationObserver;if(!a)return()=>{};let n=new a(r);return n.observe(t,{attributes:!0,attributeFilter:[z6]}),()=>n.disconnect()}import{VIEW_DESKTOP_MIN as j6,VIEW_TABLET_MIN as G6}from"efficient-easel/screen/lib/content/view-tiers";var nr={fit:"data-fit",fitTablet:"data-fit-tablet",fitPhone:"data-fit-phone",min:"data-fit-min",minTablet:"data-fit-min-tablet",minPhone:"data-fit-min-phone",edge:"data-fit-edge"},Vo=nr,K6=e=>e.flatMap(o=>[`[${o}] p`,`[${o}] li`]).join(","),q6=String.raw`(function (doc) {
|
|
1
|
+
import{$ as af,D as Ok,E as Ek,F as Qd,G as _k,H as Nk,I as Cr,J as Mk,K as Hk,L as Wk,M as at,N as ef,O as Co,P as de,R as of,S as kr,T as tf,X as $k,Y as rf,Z as vr,_ as zk,a as qo,b as Vs,ba as Qv,c as zd,d as yn,e as Ys,f as nk,fa as fP,g as Sn,h as Ud,ha as cP,ia as Rf,ja as MT,ka as HT,r as ol,t as Tk}from"./chunk-AJHYWZA6.js";import{a as hP,d as gf,e as nt,f as yf,g as Sf,h as kf,l as Ux}from"./chunk-PN7RMJTO.js";import{$ as In,$a as pk,$c as wv,$e as yP,$i as ar,$j as Ff,A as wC,Aa as YC,Ab as Ht,Ac as sv,Ad as Hv,Ah as fT,Aj as ST,Al as Ln,B as CC,Ba as XC,Bb as wn,Bc as lv,Bd as Wv,Be as Ct,Bh as cT,Bj as bT,Bk as Hx,Bl as Nf,C as ot,Ca as ZC,Cb as el,Cc as $t,Cd as $v,Cf as _P,Ch as pT,Cj as Rx,D as kC,Da as JC,Dc as Ue,Dd as zv,De as je,Df as Tx,Dg as VP,E as vC,Ea as QC,Ec as Pr,Ed as bx,Ee as kt,Ef as AP,Eg as YP,Ej as En,F as PC,Fa as ek,Fb as mx,Fc as Ix,Fd as Uv,Fe as Te,Ff as FP,Fg as XP,Fj as wT,G as TC,Ga as Sr,Gb as aa,Gc as iv,Gd as wx,Ge as mP,Gf as BP,Gg as ZP,H as OC,Ha as ok,Hb as Jd,Hc as dv,Hd as jv,Hf as LP,Hg as JP,Hk as Bf,I as EC,Ib as kk,Ic as fv,Id as Gv,Ig as _x,Ij as Dx,Ik as Lf,J as _C,Ja as tk,Jb as vk,Jc as pf,Jd as Kv,Jf as RP,Jg as QP,Jj as dl,Jk as Wx,Ka as jd,Kb as Pk,Kc as rl,Kd as zt,Ke as Cx,Kg as Ax,Kk as LT,L as AC,La as Xs,Lb as nf,Lc as cv,Ld as qv,Lg as rr,Lk as pa,M as FC,Ma as Gd,Mb as Gk,Mc as pv,Md as ia,Mg as Fx,Mj as _n,Mk as RT,N as BC,Na as sk,Nb as sf,Nc as uv,Nd as Vv,Ne as ll,Ng as Pf,Nk as DT,O as Dd,Ob as hx,Oc as uf,Od as Pn,Og as eT,Oj as CT,Ok as NT,P as LC,Pb as lf,Pc as mv,Pg as oT,Q as RC,Qc as xv,Qd as or,Qf as DP,Qg as tT,Qk as WT,Ra as lk,Rc as gx,Rd as Yv,Re as xP,Rf as NP,Rg as rT,Rk as $x,Sa as ik,Sc as hv,Sd as sl,Se as kx,Sf as MP,Sg as aT,Ta as Zs,Tc as vn,Td as Xv,Te as IP,Tf as Ox,Tk as $T,Ub as Cn,Ud as da,Uf as HP,Uk as zT,V as ax,Va as bn,Vc as Iv,Vd as Zv,Vf as WP,Vg as nT,Vk as UT,Wa as dk,Wc as gv,Wf as Ex,Wg as sT,Wj as kT,Wk as jT,X as Gs,Xa as Kd,Xb as Kk,Xc as yv,Xd as mf,Xj as Nx,Xk as GT,Y as Nd,Ya as fk,Yb as qk,Yc as Sv,Yd as Or,Yj as vT,Yk as KT,Z as Fo,Za as Js,Zb as Vk,Zc as bv,Zd as Jv,Zi as ca,Zj as PT,_ as nx,_a as ck,_b as tl,_c as na,_e as gP,_f as tr,a as Ao,aa as DC,ab as cx,ad as yx,af as bf,ag as Tn,ak as An,b as mn,ba as NC,bb as uk,bd as Cv,bf as SP,bi as uT,bk as Fn,ca as MC,cb as qd,cd as kv,cf as vx,cg as $P,ch as Tf,ci as mT,ck as fl,d as aC,da as HC,db as mk,dd as vv,df as bP,dg as zP,dk as Bn,e as ex,ea as WC,eb as px,ed as Pv,ef as wP,eg as vf,ek as TT,f as nC,fa as sx,fd as Tv,fe as eP,ff as CP,fg as Er,g as c,gb as xk,gd as Tr,gf as kP,gg as UP,gj as _f,h as Mt,ha as $C,hb as hk,hd as al,hf as wf,i as hn,ia as Md,id as sa,ie as oP,ig as On,ih as lT,ij as IT,j as Us,jb as Vd,jc as kn,jd as Ov,je as tP,jf as vP,k as Mo,kb as Ik,kc as Wt,ke as rP,kh as iT,l as js,lb as gk,lc as Yk,ld as la,lk as OT,mb as yk,mc as Xk,md as nl,mf as Px,mi as xT,mk as ET,n as uC,nb as Sk,nc as Zk,nd as Ev,ni as hT,nl as zx,o as mC,ob as Yd,oc as Jk,od as _v,p as xC,pb as bk,pc as Qk,pe as Ho,q as hC,qc as df,qd as Av,qe as Je,r as IC,rc as ff,rd as Fv,rf as PP,rg as _r,s as gC,sb as wk,sc as ev,sd as Bv,se as xf,sf as TP,sg as jP,t as yC,tb as br,te as aP,tf as Cf,tg as GP,tk as Mx,u as Rd,ub as Xd,uc as ov,ud as Lv,ue as nP,uf as OP,ug as KP,uh as Bx,uj as gT,v as yr,va as GC,vb as Zd,vc as tv,vd as Rv,ve as sP,vf as EP,vh as Of,vk as _T,vl as qT,wa as KC,wb as Ck,wc as rv,wd as Dv,we as lP,wh as fa,wk as AT,wl as VT,x as rx,xa as qC,xb as po,xc as cf,xd as Nv,xe as hf,xh as Ef,xj as yT,xk as FT,xl as Df,y as SC,ya as VC,yb as ux,yc as av,yd as Sx,ye as iP,yj as Af,yl as YT,z as bC,za as dx,zb as Qs,zc as nv,zd as Mv,ze as dP,zg as qP,zh as dT,zj as Lx,zk as BT}from"./chunk-YZZMDZT2.js";import{a as cC,b as Ld,c as pC,g as Uk,h as xx,i as jk}from"./chunk-4HYAKN2G.js";import{$ as xb,$a as Db,$c as wo,$d as hw,$e as Xm,$g as tx,A as ro,Ae as qm,Af as Jm,B as tn,Bb as Ms,Bd as Gm,Be as Sw,Ca as Ie,Cb as Zb,D as Rs,Dd as cw,De as Vm,E as sd,Ed as yd,F as Lt,Fg as Xw,G as rn,Ga as Qo,Gb as hd,Gd as et,Gg as Zw,H as ze,Ha as St,Hc as rw,Hd as No,He as wd,Hf as Lw,Hg as Jw,I as qe,Ia as Pm,Id as Ze,Ie as Cd,Ig as Qw,J as an,Ja as Tm,Jc as Wm,Jd as Dt,Je as bw,Jh as fx,K as ld,Kd as Qt,Ke as kd,Kf as er,Kh as gn,L as ib,La as Om,Lb as Jb,Ld as wt,Le as vd,Lg as eC,Lh as rk,M as db,Ma as Em,Md as fn,Me as ww,Mh as tt,Nd as pw,Ne as Cw,Nh as rt,O as fb,Od as cn,Oe as Pd,Og as oC,Oh as $d,P as id,Pd as uw,Pe as Td,Pg as tC,Ph as ak,Q as cb,Qa as _m,Qb as Id,Qc as aw,Qe as ra,Qf as Rw,Qh as qs,R as Qr,Ra as Ob,Re as kw,Rg as rC,S as pb,Sa as Eb,T as ub,Ta as Ge,Tb as Qb,Td as ta,Tg as sC,Th as Ak,U as Ds,Ua as _b,Ub as ew,Ud as mw,Ug as lC,V as km,Va as ud,Vd as xw,Ve as vw,W as we,Wa as Ab,Wb as ow,Wd as pn,Wf as Dw,Wg as gr,X as K,Xa as Fb,Xc as U,Xd as Ws,Xf as Nw,Xh as Fk,Y as mb,Ya as Bb,Yb as Nm,Yc as re,Yd as $s,Ye as Nt,Yf as Mw,Yg as iC,Za as Lb,Zc as $m,Zd as Km,Ze as zs,Zf as Hw,Zg as ox,_ as dd,_a as Rb,_c as L,_e as Ym,_g as dC,a as on,ab as Nb,ad as Zt,ae as Iw,af as Pw,ah as Bd,b as fo,ba as hb,bb as Mb,bd as nw,be as gw,bf as Tw,bg as Ww,c as to,ca as fd,cb as md,cd as W,cf as Od,cg as $w,ch as fC,ci as Bk,d as Yt,da as Ib,db as xd,dd as gd,de as yw,df as Ow,di as wr,ea as gb,eb as Hb,ed as Do,eg as zw,f as Ko,fa as vm,fb as Wb,fc as Mm,fd as sw,fe as Sd,fg as Uw,fi as Lk,g as Ls,ga as yb,gd as bt,gf as Ew,gg as Ad,gi as Rk,h as eb,ha as Sb,hb as $b,hd as Rt,he as bd,hf as Ed,hg as jw,hi as Dk,i as ob,ia as bb,ib as zb,id as zm,if as _w,ig as Fd,j as tb,jb as Am,jd as hr,jf as Zm,jg as Qm,k as rb,kb as Ub,kd as Jt,kf as Aw,la as wb,lb as jb,ld as lw,lf as Fw,li as ko,ma as Cb,mb as Fm,mf as _d,mg as Gw,na as kb,nb as sn,nd as Fe,nf as un,ng as Kw,o as ab,ob as ea,od as oa,of as xn,pa as vb,pb as Bm,pd as Hs,pf as Ir,pi as il,qb as Lm,qd as ln,qg as qw,qh as lx,ra as Pb,rb as Rm,rd as iw,rg as Vw,rh as Hd,s as nb,sa as cd,sb as Gb,sd as Um,sh as zC,ta as Tb,tb as Kb,td as dn,tf as Bw,th as ix,u as Ne,ua as pd,ub as qb,uc as Hm,ud as jm,ug as Yw,uh as UC,v as sb,vb as Dm,w as nd,wb as Vb,wc as tw,wh as Wd,x as lb,xb as Xt,xh as jC,ya as Ns,yb as Yb,yd as dw,yh as Ks,z as Pe,za as nn,zb as Xb,zd as fw}from"./chunk-4TGKSUNO.js";import{a as z,b as co}from"./chunk-AUQKCN7Q.js";import{c as pP,d as uP,e as If}from"./chunk-POFTB7WN.js";import{jsx as jx,Fragment as Y4,jsxs as X4}from"react/jsx-runtime";import{createContext as Z4,useContext as J4}from"react";var Q4={mirrorHostStyles:!0,css:null,fontHrefs:[]},XT=Z4(Q4);function hne({value:e,children:o}){return jx(XT.Provider,{value:e,children:o})}function cl(){return J4(XT)}function ZT(){let{css:e,fontHrefs:o}=cl();return X4(Y4,{children:[o.map(t=>jx("link",{rel:"stylesheet",href:t},t)),e?jx("style",{"data-sf-canvas-css":"",children:e}):null]})}import{jsx as e6}from"react/jsx-runtime";import{createContext as o6,useContext as t6}from"react";var JT=o6(void 0);function Sne({metadata:e,children:o}){return e6(JT.Provider,{value:e,children:o})}var QT=()=>t6(JT);import{jsx as lo,Fragment as R4,jsxs as Qi}from"react/jsx-runtime";import{useCallback as _s,useEffect as qt,useRef as zae,useState as A4}from"react";import{SettingsSwitch as Uae}from"efficient-easel/panel";import{PagesIcon as jae,StylesIcon as Gae}from"efficient-easel/rail";import{PaletteIcon as Kae}from"efficient-shell/icons/efficient";import{Subtree as qae,TreeRow as D4}from"efficient-easel/tree";import{useEasel as N4}from"efficient-easel/easel";import{toItemSelector as Vae}from"efficient-easel/node-ops";import{useEaselStrings as M4}from"efficient-easel/strings";import{createContext as r6,useContext as a6}from"react";var Gx=r6(!1),Cne=()=>a6(Gx);import{useMemo as n6,useRef as s6}from"react";import{useEaselApi as l6}from"efficient-easel/easel";import{useSectionOps as i6}from"efficient-easel/screen/lib/document/use-section-ops";function Mf(){let e=l6(),o=i6(),t=s6(o);return t.current=o,n6(()=>({getItemById:r=>e.getState().getItemById(r),getSelectorForId:r=>e.getState().getSelectorForId(r),get components(){return e.getState().config.components},replace:(r,a,n)=>t.current.replaceComponent(r,a,n)}),[e])}import{encodePartId as E6}from"efficient-easel/draw";import{insertAt as _6,moveTo as A6,removeAt as F6}from"efficient-easel/fields";import{useSyncExternalStore as w6}from"react";import{isNodeList as e0}from"efficient-easel/data";var o0="Flex";function Rn(e,o){return Nt(e)?typeof e?.[Ko]=="string"?Kx(o?.[Ko]):"":Kx(e?.[Ko])}var Kx=e=>typeof e=="string"?e.trim():"",d6=e=>e.type===ro&&Array.isArray(e.props?.[Vm])&&e.props[Vm].some(o=>Kx(o?.[Ko])!==""),f6=new Intl.NumberFormat("en-US");function c6(e){return/^\d+$/.test(e)?f6.format(Number(e)):e}function Bne(e,o){let t=o?o.find(r=>r.key===e)?.value:nb(Ls).find(r=>r.key===e)?.value;return t===void 0?null:c6(t)}var p6={[Ko]:"any"};function qx(e,o=!1){let t=e.props;if(!t)return{node:e,names:!1};let r=e.type==="Text"&&(Rn(t)!==""||o&&Rn(t,p6)!==""),a=o||d6(e),n=qe(e,l=>ze(l,i=>{let d=qx(i,a);return d.names&&(r=!0),d.node})).props;if(e.type!==o0)return{node:n===t?e:{...e,props:n},names:r};let s=Ne(n);if(r&&!s&&(n={...n,[to]:Ls}),!r&&s===Ls){let{[to]:l,...i}=n;n=i}return{node:n===t?e:{...e,props:n},names:!1}}function t0(e,o,t){for(let r of e){if(r?.props?.id===o)return t;for(let a of rn(r??{})){let n=t0(a,o,r.type===o0?r:t);if(n!==void 0)return n}}}function Lne(e,o){if(!e0(e))return!0;let t=t0(e,o,null);if(t===void 0)return!0;if(t===null)return!1;let r=Ne(t.props);return!r||r===Ls}function r0(e){let o=e?.content;if(!e0(o))return e;let t=o.map(r=>qx(r));return t.every((r,a)=>r.node===o[a])?e:{...e,content:t.map(r=>r.node)}}function a0(e){return qx(e).node}import{decodePartId as C6}from"efficient-easel/draw";function Dn(e,o){let t=tv(e);return t?.control==="textList"?o.rowKey===(t.itemKey??"text")?AT(t,o.index):null:rv(e)?.[o.rowKey]??null}function Hf(e,o,t){let r=e.node.props,{key:a,row:n}=Wt(e.propKey),s=n?nv(r,a,n,e.kind,o):ov(r,a,e.kind,o);return s?(t(e.zone,e.index,{...e.node,props:s}),!0):!1}import{readHidable as l0}from"efficient-easel/draw";import{parseOption as u6}from"efficient-shell/format";var Vx=e=>String(e+1).padStart(2,"0"),m6=[{label:"01 \xB7",value:"two-digit"},{label:"1.",value:"plain"}],Yx="two-digit",n0=e=>u6(m6,Yx,e),Wf=(e,o)=>e==="plain"?`${o+1}.`:Vx(o);var Jx="Contents",Xx="Flex",s0="Text",x6="numberForm",h6="_contentsEntries",I6="_kickerNumber",i0="data-sf-kicker-number",g6=e=>l0(e).text.trim(),d0=e=>da(e?.anchor),Zx=e=>String(e.props?.id??""),y6=e=>!l0(e.props?.text).hidden&&!Rn(e.props)&&!Nt(e.props),pl=e=>rn(e);function f0(e){for(let o of pl(e))for(let t of o){if(or(t.props??{}))continue;if(t.type===s0&&y6(t))return t;if(t.type===s0)continue;let r=f0(t);if(r)return r}}function c0(e){return pl(e).some(o=>o.some(t=>t&&!or(t.props??{})&&(t.type===Jx||c0(t))))}var p0=e=>e.type===Xx&&Tn(Xx,e.props?.direction)==="row";function u0(e){return pl(e).some(o=>o.some(t=>t&&!or(t.props??{})&&(t.type===Jx||!p0(t)&&u0(t))))}function S6(e){let o=[],t=(r,a)=>{for(let n of r){if(!n||or(n.props??{}))continue;if(n.type===Jx){a.open={contents:n,sections:a.waiting??[]},a.waiting=null,o.push(a.open);continue}if(p0(n)&&u0(n)){let l={inRow:!0,open:null,waiting:[]};for(let i of pl(n))t(i,l);a.inRow||(a.open=null);continue}let s=a.open?.sections??a.waiting;if(n.type===Xx&&d0(n.props)&&s&&!c0(n)){s.push({box:n,kicker:f0(n)});continue}for(let l of pl(n))t(l,a)}};return t(e,{inRow:!1,open:null,waiting:null}),o}function b6(e){return e.map(o=>({label:o.kicker?nn(g6(o.kicker.props?.text)):"",anchor:d0(o.box.props)}))}function Qx(e){let o=e?.length?S6(e):[];if(!o.length)return null;let t=new Map,r=new Map;for(let a of o){let n=Zx(a.contents);n&&t.set(n,b6(a.sections));let s=n0(a.contents.props?.[x6]);a.sections.forEach((l,i)=>{let d=l.kicker?Zx(l.kicker):"";d&&r.set(d,Wf(s,i))})}return{entries:t,numbers:r}}var Qne=e=>e.endsWith(".")?`${e} `:`${e} \xB7 `;function m0(e){let o=e;if(!o?.content?.length)return e;let t=Qx(o.content);if(!t)return e;let{entries:r,numbers:a}=t,n=s=>{let l=qe(s,h=>ze(h,n)),i=l.props??{},d=l!==s,f=Zx(s),x=f?r.get(f):void 0;x&&(i={...i,[h6]:x},d=!0);let u=f?a.get(f):void 0;return u&&(i={...i,[I6]:u},d=!0),d?{...s,props:i}:s};return{...o,content:o.content.map(n)}}var k6=`[${i0}]`,v6=["bold","italic","underline","strike","link","sup","sub"],P6=["bullet","number"];function th(e,o){return e?[...v6,...o?P6:[]]:[]}function x0(e,o){let t=C6(e);if(!t?.propKey)return null;let{nodeId:r,propKey:a}=t,n=o.getItemById(r),s=o.getSelectorForId(r);if(!n||!s)return null;let{key:l,row:i}=Wt(a),d=o.components[n.type]?.fields?.[l],f=i?Dn(d,i):d,x=df(f);if(!x)return null;let u=n.props??{};if(uT(u)!==null||!i&&Od(n.type,u,l)||n.type==="Text"&&l==="text"&&Rn(u)||i&&!(Array.isArray(u[l])&&i.index<u[l].length))return null;let h=i?cf(u[l],i):u[l];return{node:n,selector:s,propKey:a,kind:x,stored:h,offPage:_f(f),panelOnly:Qk(f)}}function $f(e,o){let t=x0(e,o);if(!t)return null;let{text:r,hidden:a}=ca(t.stored);if(!xv({offPage:t.offPage,hidden:!!a,panelOnly:t.panelOnly}))return null;let n=ff(t.kind);return{partId:e,value:r,rules:cd,multiline:n,skip:k6,offered:th(t.kind!=="plainText",n),write:s=>{let l=x0(e,o);l&&Hf({node:l.node,propKey:l.propKey,kind:l.kind,zone:l.selector.zone,index:l.selector.index},s,o.replace)}}}function rh(e,o,t){return e?.isConnected&&e.getAttribute(Ue)===t?e:o?.querySelector(`[${Ue}="${zf(t)}"]`)??null}function zf(e){return e.replace(/["\\]/g,"\\$&")}function h0(e){let o=e.activeElement;return o?o.tagName==="IFRAME"||!!o.closest(".es-canvas"):!1}var eh=null,oh=new Set;function T6(){return eh}function ah(e){if(e!==eh){eh=e;for(let o of oh)o()}}function O6(e){return oh.add(e),()=>{oh.delete(e)}}function I0(){return w6(O6,T6,()=>null)}function g0(e,o){if(e.outer)return null;let t=o.getItemById(e.ownerId);if(!t)return null;let r=ww(t.type);return!r||Ne(t.props)?null:{node:t,rows:r}}function B6(e,o){let t=g0(e,o),r=o.getItemById(e.nodeId);if(!t||!r)return null;let a=Ow(r.type,r.props,e.key);if(!a)return null;let n=t.node.props[t.rows];return!Array.isArray(n)||e.index<0||e.index>=n.length?null:E6(e.ownerId,kn(t.rows,{index:e.index,rowKey:a}))}function Uf(e,o){let t=B6(e,o);return t?$f(t,o):null}function y0(e,o){return Uf(e,o)?.value}function S0(e,o){let t=Uf(e,o);return t?(t.write(e.text),!0):!1}function b0(e,o){let t=g0(e,o),r=t&&o.getSelectorForId(e.ownerId);if(!t||!r)return!1;let a=t.node.props,n=a[t.rows],s=e.index;if(!Array.isArray(n)||s<0||s>=n.length)return!1;let l;switch(e.action){case"addAfter":{let i=o.components[t.node.type]?.fields?.[t.rows];l=_6(n,s+1,{...i?.defaultItemProps??{}});break}case"moveEarlier":case"moveLater":{let i=e.action==="moveEarlier"?s-1:s+1;if(i<0||i>=n.length)return!1;l=A6(n,s,i);break}case"delete":l=F6(n,s);break;default:return!1}return o.replace(r.zone,r.index,{...t.node,props:{...a,[t.rows]:l}}),!0}import{jsx as ke,Fragment as tJ,jsxs as Mu}from"react/jsx-runtime";import{Fragment as rJ,useEffect as eH,useMemo as oH,useRef as aJ,useState as $a}from"react";import{useScreenDocument as sH}from"efficient-easel/screen/components/ScreenDocumentContext";import{UiIcon as Ny}from"efficient-easel/draw/client";import nJ from"efficient-easel/screen/components/SidePanelHead";import{InspectorIconButton as sJ}from"efficient-easel/chrome";import{Input as lJ,LoadingSpinner as iJ,PopupMenu as dJ,PopupMenuItem as tH,toast as rH}from"efficient-shell/ui";import{LayersTree as fJ,TreeGroupLabel as cJ,TreeRow as aH,TreeRowAction as Hu}from"efficient-easel/tree";import{AddIcon as pJ,DuplicateIcon as uJ,PageIcon as mJ,SettingsIcon as xJ}from"efficient-easel/icons";import{PagesIcon as hJ}from"efficient-easel/rail";import{useEaselHost as IJ}from"efficient-easel/screen/lib/host";import{useEaselSession as My}from"efficient-easel/screen/lib/session-context";import{useCallback as jf,useEffect as L6,useSyncExternalStore as R6}from"react";import{useScreenDocument as v0}from"efficient-easel/screen/components/ScreenDocumentContext";var w0=new WeakMap;function ul(e){let o=w0.get(e);return o||(o={rows:null,loading:null,listeners:new Set},w0.set(e,o)),o}function nh(e,o){e.rows=o;for(let t of e.listeners)t()}var Gf=new Set;function Kf(e,o){o?Gf.add(e):Gf.delete(e)}function C0(e){let o=ul(e),t=e.listPages().then(r=>nh(o,Gf.size?r.filter(a=>!Gf.has(a.id)):r),()=>nh(o,[])).finally(()=>{o.loading===t&&(o.loading=null)});return o.loading=t,t}var k0=()=>null,D6=()=>()=>{};function ml(){let{adapter:e,ready:o}=v0(),t=jf(l=>{let{listeners:i}=ul(e);return i.add(l),()=>i.delete(l)},[e]),r=jf(()=>ul(e).rows,[e]),a=R6(o?t:D6,o?r:k0,k0);L6(()=>{if(!o)return;let l=ul(e);l.rows===null&&!l.loading&&C0(e)},[e,o]);let n=jf(()=>o?C0(e):Promise.resolve(),[e,o]),s=jf(l=>nh(ul(e),l),[e]);return{rows:a,reload:n,setRows:s,getRows:r}}function N6(e,o){return e?.find(t=>t.slug===o)?.label?.trim()||`/${o}`}function P0(){let{currentSlug:e}=v0(),{rows:o}=ml();return N6(o,e)}import{canDuplicatePage as gJ,DuplicatePageDialog as yJ}from"efficient-easel/page-copy";import{jsx as To,jsxs as KM}from"react/jsx-runtime";import{useEffect as HZ,useId as WZ,useMemo as $Z,useRef as zZ,useState as Ly}from"react";import{useScreenDocument as UZ}from"efficient-easel/screen/components/ScreenDocumentContext";import{useEaselSession as jZ}from"efficient-easel/screen/lib/session-context";import{uniqueSlug as qM}from"efficient-easel/page-copy";import{AddIcon as GZ}from"efficient-easel/icons";import{Button as KZ,Dialog as qZ,EmptyState as VZ,LoadingSpinner as YZ,Paragraph as XZ,SidebarLayout as ZZ,SidebarNavItem as Ry,Title as JZ,toast as VM}from"efficient-shell/ui";import{jsx as Tt,jsxs as cR}from"react/jsx-runtime";import{useEffect as U7,useState as Og}from"react";import{CanvasFrame as j7}from"efficient-easel/easel";import{Button as G7,Card as K7,FitFrame as q7,Text as V7}from"efficient-shell/ui";import{jsx as A0,Fragment as Y6,jsxs as X6}from"react/jsx-runtime";import{useEffect as F0,useLayoutEffect as Z6}from"react";var qf="data-theme",T0="light";function M6(e){return e.getAttribute(qf)===T0?"light":"dark"}function H6(e,o){return M6(e)===o?!1:(o==="light"?e.setAttribute(qf,T0):e.removeAttribute(qf),!0)}function W6(e){return Ux(e).getItem(Jm)}function Ose(e,o){Ux(e).setItem(Jm,o)}function $6(e,o,t=new Date().getHours()){return Lw({mode:o.mode,override:W6(e),switchShown:o.switchShown,hour:t})}function O0(e,o){let t=e.documentElement;if(!t)return()=>{};let r=()=>H6(t,$6(e,o));r();let a=e.defaultView?.MutationObserver;if(!a)return()=>{};let n=new a(r);return n.observe(t,{attributes:!0,attributeFilter:[qf]}),()=>n.disconnect()}var z6="style";function U6(e,o){let t=Fd(o),r=!1;for(let a of jw){let n=t[a]??"";e.style.getPropertyValue(a)!==n&&(n?e.style.setProperty(a,n):e.style.removeProperty(a),r=!0)}return r}function E0(e,o){let t=e.body;if(!t)return()=>{};let r=()=>U6(t,o);r();let a=e.defaultView?.MutationObserver;if(!a)return()=>{};let n=new a(r);return n.observe(t,{attributes:!0,attributeFilter:[z6]}),()=>n.disconnect()}import{VIEW_DESKTOP_MIN as j6,VIEW_TABLET_MIN as G6}from"efficient-easel/screen/lib/content/view-tiers";var nr={fit:"data-fit",fitTablet:"data-fit-tablet",fitPhone:"data-fit-phone",min:"data-fit-min",minTablet:"data-fit-min-tablet",minPhone:"data-fit-min-phone",edge:"data-fit-edge"},Vo=nr,K6=e=>e.flatMap(o=>[`[${o}] p`,`[${o}] li`]).join(","),q6=String.raw`(function (doc) {
|
|
2
2
|
if (doc.__sfFitWords) return;
|
|
3
3
|
var win = doc.defaultView;
|
|
4
4
|
var SELECTOR = "h1,h2,h3,h4,h5,h6,[class*='font-heading'],[class*='font-display']";
|
|
@@ -301,7 +301,7 @@ import{$ as af,D as Ok,E as Ek,F as Qd,G as _k,H as Nk,I as Cr,J as Mk,K as Hk,L
|
|
|
301
301
|
doc.__sfFitWords.floorOf = floorOf;
|
|
302
302
|
})(document);`,V6="storefront-fit-words";function _0(e){let o=e.createElement("script");return o.id=V6,o.textContent=q6,(e.head??e.documentElement).appendChild(o),()=>{e.__sfFitWords?.(),o.remove()}}var J6=`
|
|
303
303
|
[${Ue}][${Ue}] { cursor: text; }
|
|
304
|
-
`;function Vf({children:e,document:o}){let{theme:t,themeMode:r,themeSwitchShown:a}=ko(),n=er(t);return F0(()=>{if(o)return O0(o,{mode:r,switchShown:a})},[o,r,a]),F0(()=>{if(o)return E0(o,n)},[o,n]),Z6(()=>{if(o)return _0(o)},[o]),X6(Y6,{children:[A0(ZT,{}),A0("style",{children:J6}),e]})}import{jsx as dL}from"react/jsx-runtime";import{memo as PK}from"react";import{Render as TK}from"efficient-easel/render";import{jsx as Nn}from"react/jsx-runtime";import{createContext as Q6,useContext as eW,useMemo as oW}from"react";var sh=Q6(null);function tW({children:e}){return Nn(sh.Provider,{value:"first",children:e})}function Xf({children:e}){return Nn(sh.Provider,{value:"below",children:e})}function xl(){return eW(sh)}function lh(){return xl()==="below"?{loading:"lazy"}:{}}function Zf(e){let o=lh();return Nn("img",{...e,...o})}var B0="laterSlideIds",rW=new Set(["Breadcrumb","CategoryBar","Divider","Spacer","Ticker"]);function L0(e){return bf(e?.filter(o=>!o?.type||!rW.has(o.type)))}function Yf(e,o=[]){if(Array.isArray(e))for(let t of e)Yf(t,o);else if(e&&typeof e=="object"){let{slides:t}=e;if(Array.isArray(t))for(let r of t.slice(1))typeof r?.props?.id=="string"&&o.push(r.props.id);for(let r of Object.values(e))Yf(r,o)}return o}function R0(e,o){let t=o?.type,r=o?.props?.id;return oW(()=>{let a=t?e.components[t]:void 0;if(!t||!a)return e;let n=a.render,s=l=>l.id===r?Nn(tW,{children:Nn(n,{...l})}):Nn(n,{...l});return{...e,components:{...e.components,[t]:{...a,render:s}}}},[e,t,r])}function D0(e){return e.props?qe(e,o=>{let t=ze(o,D0),r=e.type===jC&&t.every(a=>a.type===Hd)?zC(t):t;return r.length!==o.length||r.some((a,n)=>a!==o[n])?r:o}):e}function N0(e){return ld(e,o=>ze(o,D0))}var aW="Flex",M0="ListSearch",H0=["FAQ"],nW="listKey";function W0(e,o){let t={search:e.type===M0,list:H0.includes(String(e.type))};return qe(e,r=>{for(let a of r){let n=W0(a,o);t.search||=n.search,t.list||=n.list}return r}),e.type===aW&&t.search&&t.list&&String(e.props?.id??"")?(o.add(e),{search:!1,list:!1}):t}function $0(e,o,t){let r=o.has(e)?String(e.props?.id):t,a=qe(e,n=>ze(n,s=>$0(s,o,r)));return r&&(e.type===M0||H0.includes(String(e.type)))?{...a,props:{...a.props,[nW]:r}}:a}function z0(e){return an(e,o=>{let t=new Set;for(let r of o)W0(r,t);return t.size?ze(o,r=>$0(r,t,"")):o})}import{isNode as u$,isNodeList as HE}from"efficient-easel/data";import{jsx as Ee,Fragment as o$,jsxs as dr}from"react/jsx-runtime";import{jsx as xh}from"react/jsx-runtime";import{Fragment as cW,jsx as pW}from"react/jsx-runtime";import{jsx as ih}from"react/jsx-runtime";import{createContext as iW,Fragment as dW,useContext as fW}from"react";import{jsx as U0,jsxs as sW}from"react/jsx-runtime";import{lazy as lW}from"react";var j0=lW(()=>import("./section-css-style-UICZZ7D5.js"));function G0({css:e,id:o,attr:t}){return U0(j0,{css:e,id:o,attr:t})}var K0={name:"sectionCustomCss",applies:(e,o,t)=>o.isSection(e)&&!!t&&typeof t.render=="function",panel(e,o,t){e.fields={...e.fields,...t.customCssFields()}},draw(e){e.defaultProps={...e.defaultProps,[Ld]:""};let o=e.render;e.render=t=>{let r=pC(t),a=typeof t.id=="string"?t.id:"";return!r||!a?o(t):sW(vr,{className:"sf-section-css",attrs:{[cC]:a},children:[U0(j0,{css:r,id:a}),o(t)]})}}};var q0=iW(null);function V0({rootProps:e,children:o}){let t=e&&typeof e=="object"?e:null,r=vk(t),a=ih(dW,{children:o},"page");return ih(q0.Provider,{value:t,children:r?[ih(G0,{css:r,id:kk,attr:Jd},"css"),a]:a})}function Y0(){return fW(q0)}function vt(){return Rd(Y0())===yC}function Jf({className:e,children:o}){let t=vt();return pW(cW,{children:o(ot(e,t))})}import{SITE_SIDE as uW}from"efficient-easel/screen/lib/content/length-units";var X0="sideSpace",hl=uW,dh="none",ple=[{value:"box",label:"Box"},{value:hl,label:"Site"},{value:dh,label:"None"}],ule="box",mle="Box: on small screens the Box keeps its own side space, up to 24 px. Site: it uses the site's Side space, as the site's own sections do. None: from 800 px up the Box runs to the screen's edges; on small screens it keeps the site's Side space, up to 20 px.";function Z0(e){return e===hl||e===dh?e:"box"}function xle(e){return e===hl||e===dh?e:void 0}import{parseOption as ph}from"efficient-shell/format";var Qf="standard",oO=[{label:"Standard",value:"standard"},{label:"Editorial",value:"editorial"},{label:"Simple",value:"simple"},{label:"Statement",value:"statement"},{label:"Natural",value:"natural"},{label:"Essay",value:"essay"}],ch=["numStyle","logoSrc","logoAlt","linkText","linkHref","_gLogo"],fh=[...ch,"description"],J0={standard:["eyebrowLook"],editorial:[...ch,"eyebrowLook"],simple:fh,statement:fh,natural:ch,essay:fh},Q0=["gap-5","gap-3"],eO=["text-[length:var(--size-body,16px)]","text-[15px]"];function yle(e){return ph(Q0,Q0[0],e)}function Sle(e){return ph(eO,eO[0],e)}function tO(e){return ph(oO,Qf,e)}function ble(e){let o=oO.map(r=>r.value),t=[...new Set(Object.values(J0).flat())];return et(e,t.map(r=>[[r],yd("headStyle",o,Qf,o.filter(a=>!J0[a].includes(r)))]))}import{readHidable as mW,VIEW_TIERS as xW,viewKeyAt as hW}from"efficient-easel/draw";var ua={direction:"row",share:"content",align:"center"},ma={top:14,bottom:14,topPhone:12,bottomPhone:12},ec={wrap:"nowrap",loop:"scroll",sectionAccent:dC,gap:60,gapPhone:32,separator:"dot",sectionBorder:{top:1,bottom:1}},rO={gap:120,gapPhone:64},oc={...Do,sizeToken:{step:"label",px:14,pxPhone:12},letterSpacing:.25,lineHeight:1.5},aO={textStyle:"heading-3",letterSpacing:.005,case:"upper",lineHeight:1},Il={top:24,bottom:24,topPhone:16,bottomPhone:16},xa={top:16,bottom:16,topPhone:12,bottomPhone:12},gl={justify:"between",wrap:"wrap",gap:32,separator:"none"},yl={...Do,letterSpacing:.1,lineHeight:1.5};var tc={top:24,bottom:24,topPhone:24,bottomPhone:24},rc={top:72,bottom:72,topPhone:72,bottomPhone:72},Mn={top:100,bottom:100,topPhone:60,bottomPhone:60},ac={top:120,bottom:120,topPhone:70,bottomPhone:70},IW={top:24,bottom:24,topPhone:24,bottomPhone:24},gW=40,nc={top:120,bottom:120,topTablet:80,bottomTablet:80,topPhone:80,bottomPhone:80},yW={top:24,bottom:24,topPhone:24,bottomPhone:24},sc={top:24,bottom:24,topPhone:24,bottomPhone:24},SW={top:84,bottom:84,topPhone:84,bottomPhone:84},lc={top:48,bottom:48,topPhone:48,bottomPhone:48},ic={top:80,bottom:80,topPhone:60,bottomPhone:60},dc={top:100,bottom:60,topPhone:60,bottomPhone:40},fc={top:60,bottom:60,topPhone:40,bottomPhone:40},cc={top:80,bottom:80,topTablet:60,bottomTablet:60,topPhone:60,bottomPhone:60},pc={top:76,bottom:76,topPhone:76,bottomPhone:76},uc={top:76,bottom:76,topPhone:76,bottomPhone:76},bl={top:80,bottom:40,topPhone:60,bottomPhone:32},wl={top:76,bottom:76,topPhone:76,bottomPhone:76},mc={top:72,bottom:72,topPhone:72,bottomPhone:72},xc={top:40,bottom:64,topPhone:24,bottomPhone:36},hc={top:120,bottom:120,topPhone:80,bottomPhone:80,topTablet:80,bottomTablet:80},Ic={top:48,bottom:48,topPhone:48,bottomPhone:48},Cl=e=>{let o=Ie(e.bandPadding)??gW;return{top:o,bottom:o,topPhone:o,bottomPhone:o}},nO=(e,o,t)=>({desktop:e,tablet:o,mobile:t}),uh=e=>cn(e.headPlacement)==="own-box",Be=(e,o)=>({top:nO(e.top,o?.top??e.topTablet??e.top,e.topPhone),bottom:nO(e.bottom,o?.bottom??e.bottomTablet??e.bottom,e.bottomPhone)}),sO=e=>({top:e.topPhone,bottom:e.bottomPhone}),Sl=e=>o=>uh(o)?{top:0,bottom:e.bottom}:e,bW=(e,o)=>{let t=mW(e[o]);return t.hidden?!1:!!t.text||e.editor?.isEditing===!0},gc={Banner:{frame:()=>Be(tc)},Cards:{frame:Sl(Be(rc))},Chart:{frame:()=>Be(wl)},ContactLocations:{frame:()=>Be(Mn,sO(Mn))},Countdown:{frame:()=>Be(lc)},DocBody:{frame:()=>Be(ic)},DocMasthead:{frame:()=>Be(dc)},DocMetaCards:{frame:()=>Be(fc)},FAQ:{frame:e=>{let o=uh(e)||!["num","title","linkText"].some(r=>bW(e,r)),t=Be(ac);return o?{top:0,bottom:t.bottom}:t},edge:!0},FeaturedCover:{frame:()=>Be(cc)},Grid:{frame:()=>Be(IW)},Integrations:{frame:()=>Be(pc)},KeyFeatures:{frame:()=>Be(uc)},Logos:{frame:e=>uh(e)?0:Be(Cl(e))},LongRead:{frame:Sl(Be(nc))},Masthead:{frame:()=>Be(bl,sO(bl))},Mockup:{frame:()=>Be(wl)},OrderSummary:{frame:()=>Be(yW)},PaymentBadges:{frame:()=>Be(sc)},Prose:{frame:Sl(Be(mc))},SectionHeader:{frame:e=>{let o=Be(xc);return tO(e.headStyle)==="standard"?o:{top:o.top,bottom:0}},edge:!0},Series:{frame:Sl(Be(hc))},Stats:{frame:()=>Be(Ic)},Testimonials:{frame:Sl(Be(SW))},Ticker:{frame:()=>Be(ma),edge:!0}};function Ble(e,o,t){let r=z(gc,e)??t;return r?aa({values:Qs(o,po,!0),frame:r.frame(o),drawsFrame:!0,edge:r.edge},!0).root:null}var lO=(e,o)=>typeof e=="object"&&"top"in e?e[o]:e;function wW(e,o){let t={...e};for(let r of xW)delete t[hW(o,r)];return t}function Lle(e,o,t,r){let a=z(gc,e)??t;if(!a)return{first:null,last:null};let n=a.frame(o),s=Qs(o,po,!0),l=(i,d)=>aa({values:wW(s,i),frame:d,drawsFrame:!0,edge:a.edge},!0).root;return{first:l("bottom",{top:lO(n,"top"),bottom:r.firstBottom}),last:l("top",{top:r.lastTop,bottom:lO(n,"bottom")})}}var CW=/^(?:[^\s]*:)?p[ytb]-/;function iO(e,o,t){if(!o)return t?{className:e,style:t}:{className:e};let r=e.split(/\s+/).filter(n=>n&&!CW.test(n)),a={...t,...o.style};return{className:[...r,o.className].filter(Boolean).join(" "),...Object.keys(a).length?{style:a}:{},...o.attrs}}import{isNodeList as kW}from"efficient-easel/data";var mh=new Set(["FAQ"]);function Yo(e,o){if(!mh.has(e))return!1;let t=o.template;return typeof t=="function"?(t.blockCount??0)>0:kW(t)}var cO={ParagraphsA:{top:60,bottom:80},StatsParagraph:{top:120,bottom:120},Timeline:{top:120,bottom:120},Footprint:{top:120,bottom:120},TimelineTrack:{top:120,bottom:120},TitleWithButtons:{top:140,bottom:140},ProcessSteps:{top:120,bottom:120}},pO=new Set(Object.keys(cO));function hh(e,o){return o?.innerPadding??z(cO,e)}var Hn=e=>hh(e)??{};var yc=new Set(["Flex","Text","Heading","ImageBlock","ButtonBlock"]),vW=new Set(["Divider"]),PW=new Set(["Hero","HeroSingle","IntroBleed","CategoryBar","DocTabs"]),dO=new Set(["ProductGrid"]);function Ih(e,o,t=!1,r){let a=e.render;e.render=n=>{if(o?.(n))return a(n);let s={...Qs(n,po,t),sideSpace:Z0(n.sideSpace)},l=r?aa({values:s,frame:r(n)},!0).outer:bk(s),i=a(n);if(!l)return i;let d=u=>xh(Jf,{className:u?`${l.className} ${u}`:l.className,children:h=>xh(de,{className:h,style:l.style,children:i})}),f=wr(n,{atSectionLine:!0}),x=wr(n);return f===x?d(f):xh(of,{line:"by-box",draw:u=>d(u?x:f)})}}var uO={name:"sectionPadding",applies:(e,o,t)=>o.isSection(e)&&!PW.has(e)&&!!t&&typeof t.render=="function",panel(e,o,t){let r=hh(o,e);if(r){e.fields={...e.fields,...t.sidesPaddingFields({keys:br,unitKey:Xd,fallback:r,tablet:!0,siteSide:!0})};return}if(dO.has(o))return;let a=[br.top,br.bottom].filter(s=>e.fields!=null&&s in e.fields);if(a.length)throw new Error(`section-padding: ${o} declares its own ${a.join(" / ")} row; declare \`innerPadding: { top, bottom }\` in its meta and the one Padding row draws on its band`);let n=fO(o,e);if(n){xO(e,o,t,n);return}e.fields={...e.fields,...t.sidesPaddingFields({tablet:!0,siteSide:!0})}},draw(e,o){if(!hh(o,e)){if(dO.has(o)){Ih(e);return}yc.has(o)||vW.has(o)||Ih(e,o==="Flex"?t=>Kk(t.bgImage):mh.has(o)?t=>Yo(o,t):void 0,!0,fO(o,e))}}},TW=["Heading","Text","ImageBlock","ButtonBlock"],OW=["LogoBlock"],mO={Text:e=>Tr(e,"text").textStyle?.startsWith("heading-")?el.heading:el.text,Heading:()=>el.heading,ButtonBlock:()=>el.text,Breadcrumb:()=>mx(Il),SpecStrip:()=>mx(xa),...Object.fromEntries(Object.entries(gc).map(([e,o])=>[e,o.frame]))};function fO(e,o){return z(mO,e)??o?.ownPad?.frame}var EW={ButtonBlock:"Outer padding"};function _W(e,o){let t=e[Ht],r=Array.isArray(t)?t.filter(i=>typeof i=="string"):[],a=wn().filter(i=>o?.[i]);if(!a.length)return e;let n=[...r.filter(i=>!a.includes(i)),...a.filter(i=>typeof e[i]=="number")];if(n.length===r.length&&n.every((i,d)=>i===r[d]))return e;let{[Ht]:s,...l}=e;return n.length?{...l,[Ht]:n}:l}function AW(e,o,t){if(o<=0)return null;let r=Array.isArray(e[Ht])?e[Ht]:[];return(t?wn().filter(a=>a.startsWith(po[t])):wn()).some(a=>typeof e[a]=="number"&&!r.includes(a))?c("plus {n} px (older setting)",{n:o}):null}function xO(e,o,t,r){e.fields={...e.fields,...t.ownPaddingFields?.(r,AW,z(EW,o))??t.sidesPaddingFields({tablet:!0,siteSide:!0})};let a=e.resolveData;e.resolveData=(n,s)=>{let l=n.props??{},i=s?.trigger==="replace"?_W(l,s.changed):l,d=i===l?n:{...n,props:i};return a?a(d,s):d}}var hO={name:"blockPadding",applies:(e,o,t)=>(TW.includes(e)||OW.includes(e))&&!!t&&typeof t.render=="function",panel(e,o,t){let r=z(mO,o);if(!r){e.fields={...e.fields,...t.sidesPaddingFields({tablet:!0,siteSide:!0})};return}xO(e,o,t,r)},draw(e,o){yc.has(o)||Ih(e,void 0,!0)}};import{createContext as gh,useContext as Sc}from"react";var IO=gh(null);function eie(){return Sc(IO)===!0}function oie(){return Sc(IO)!==null}var FW=gh(!1);function tie(){return Sc(FW)}function rie(e,o,t){let r=e.boxes;if(!r)return t;let a=r.indexOf(o);return a>=0?a:(r.push(o),r.length-1)}var bc=gh(null);function aie(){return Sc(bc)}import{jsx as ha}from"react/jsx-runtime";import{Component as WW,createContext as $W,lazy as Sie,Suspense as bie,useContext as zW,useSyncExternalStore as UW}from"react";function BW(e,o){let t=e.trim();if(!wc(t))return!1;if(!o)return!0;let r;try{r=new URL(t,"https://x.invalid").host}catch{return!1}let a=n=>n.toLowerCase().replace(/^www\./,"");return a(r)!==a(o)}function lie(e){return e.startsWith("/")||wc(e)}function wc(e){return/^(?:https?:)?\/\//i.test(e.trim())}var kl=Object.freeze({target:"_blank",rel:"noopener noreferrer"});function gO(e,o){return BW(e,o)?{...kl}:{}}function iie(e){return typeof e=="string"?e.trim():""}var die="data-sf-box-link",yO="absolute inset-0 -z-[1] outline-none focus-visible:z-[2] focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accent",yh="relative isolate pointer-events-none [&_a]:pointer-events-auto [&_button]:pointer-events-auto [&_input]:pointer-events-auto [&_select]:pointer-events-auto [&_textarea]:pointer-events-auto [&_label]:pointer-events-auto [&_summary]:pointer-events-auto [&_iframe]:pointer-events-auto [&_video]:pointer-events-auto [&_audio]:pointer-events-auto [&_[role=button]]:pointer-events-auto [&_[tabindex]:not([tabindex='-1'])]:pointer-events-auto",LW="data-sf-box-jump";function RW(e){return`sf-box-jump-${e}`}function fie(e,o){return e===!0?da(o):""}function DW({box:e,lit:o,first:t}){let r=s=>s.join(`,
|
|
304
|
+
`;function Vf({children:e,document:o}){let{theme:t,themeMode:r,themeSwitchShown:a}=ko(),n=er(t);return F0(()=>{if(o)return O0(o,{mode:r,switchShown:a})},[o,r,a]),F0(()=>{if(o)return E0(o,n)},[o,n]),Z6(()=>{if(o)return _0(o)},[o]),X6(Y6,{children:[A0(ZT,{}),A0("style",{children:J6}),e]})}import{jsx as dL}from"react/jsx-runtime";import{memo as PK}from"react";import{Render as TK}from"efficient-easel/render";import{jsx as Nn}from"react/jsx-runtime";import{createContext as Q6,useContext as eW,useMemo as oW}from"react";var sh=Q6(null);function tW({children:e}){return Nn(sh.Provider,{value:"first",children:e})}function Xf({children:e}){return Nn(sh.Provider,{value:"below",children:e})}function xl(){return eW(sh)}function lh(){return xl()==="below"?{loading:"lazy"}:{}}function Zf(e){let o=lh();return Nn("img",{...e,...o})}var B0="laterSlideIds",rW=new Set(["Breadcrumb","CategoryBar","Divider","Spacer","Ticker"]);function L0(e){return bf(e?.filter(o=>!o?.type||!rW.has(o.type)))}function Yf(e,o=[]){if(Array.isArray(e))for(let t of e)Yf(t,o);else if(e&&typeof e=="object"){let{slides:t}=e;if(Array.isArray(t))for(let r of t.slice(1))typeof r?.props?.id=="string"&&o.push(r.props.id);for(let r of Object.values(e))Yf(r,o)}return o}function R0(e,o){let t=o?.type,r=o?.props?.id;return oW(()=>{let a=t?e.components[t]:void 0;if(!t||!a)return e;let n=a.render,s=l=>l.id===r?Nn(tW,{children:Nn(n,{...l})}):Nn(n,{...l});return{...e,components:{...e.components,[t]:{...a,render:s}}}},[e,t,r])}function D0(e){return e.props?qe(e,o=>{let t=ze(o,D0),r=e.type===jC&&t.every(a=>a.type===Hd)?zC(t):t;return r.length!==o.length||r.some((a,n)=>a!==o[n])?r:o}):e}function N0(e){return ld(e,o=>ze(o,D0))}var aW="Flex",M0="ListSearch",H0=["FAQ"],nW="listKey";function W0(e,o){let t={search:e.type===M0,list:H0.includes(String(e.type))};return qe(e,r=>{for(let a of r){let n=W0(a,o);t.search||=n.search,t.list||=n.list}return r}),e.type===aW&&t.search&&t.list&&String(e.props?.id??"")?(o.add(e),{search:!1,list:!1}):t}function $0(e,o,t){let r=o.has(e)?String(e.props?.id):t,a=qe(e,n=>ze(n,s=>$0(s,o,r)));return r&&(e.type===M0||H0.includes(String(e.type)))?{...a,props:{...a.props,[nW]:r}}:a}function z0(e){return an(e,o=>{let t=new Set;for(let r of o)W0(r,t);return t.size?ze(o,r=>$0(r,t,"")):o})}import{isNode as u$,isNodeList as HE}from"efficient-easel/data";import{jsx as Ee,Fragment as o$,jsxs as dr}from"react/jsx-runtime";import{jsx as xh}from"react/jsx-runtime";import{Fragment as cW,jsx as pW}from"react/jsx-runtime";import{jsx as ih}from"react/jsx-runtime";import{createContext as iW,Fragment as dW,useContext as fW}from"react";import{jsx as U0,jsxs as sW}from"react/jsx-runtime";import{lazy as lW}from"react";var j0=lW(()=>import("./section-css-style-GHS565I6.js"));function G0({css:e,id:o,attr:t}){return U0(j0,{css:e,id:o,attr:t})}var K0={name:"sectionCustomCss",applies:(e,o,t)=>o.isSection(e)&&!!t&&typeof t.render=="function",panel(e,o,t){e.fields={...e.fields,...t.customCssFields()}},draw(e){e.defaultProps={...e.defaultProps,[Ld]:""};let o=e.render;e.render=t=>{let r=pC(t),a=typeof t.id=="string"?t.id:"";return!r||!a?o(t):sW(vr,{className:"sf-section-css",attrs:{[cC]:a},children:[U0(j0,{css:r,id:a}),o(t)]})}}};var q0=iW(null);function V0({rootProps:e,children:o}){let t=e&&typeof e=="object"?e:null,r=vk(t),a=ih(dW,{children:o},"page");return ih(q0.Provider,{value:t,children:r?[ih(G0,{css:r,id:kk,attr:Jd},"css"),a]:a})}function Y0(){return fW(q0)}function vt(){return Rd(Y0())===yC}function Jf({className:e,children:o}){let t=vt();return pW(cW,{children:o(ot(e,t))})}import{SITE_SIDE as uW}from"efficient-easel/screen/lib/content/length-units";var X0="sideSpace",hl=uW,dh="none",ple=[{value:"box",label:"Box"},{value:hl,label:"Site"},{value:dh,label:"None"}],ule="box",mle="Box: on small screens the Box keeps its own side space, up to 24 px. Site: it uses the site's Side space, as the site's own sections do. None: from 800 px up the Box runs to the screen's edges; on small screens it keeps the site's Side space, up to 20 px.";function Z0(e){return e===hl||e===dh?e:"box"}function xle(e){return e===hl||e===dh?e:void 0}import{parseOption as ph}from"efficient-shell/format";var Qf="standard",oO=[{label:"Standard",value:"standard"},{label:"Editorial",value:"editorial"},{label:"Simple",value:"simple"},{label:"Statement",value:"statement"},{label:"Natural",value:"natural"},{label:"Essay",value:"essay"}],ch=["numStyle","logoSrc","logoAlt","linkText","linkHref","_gLogo"],fh=[...ch,"description"],J0={standard:["eyebrowLook"],editorial:[...ch,"eyebrowLook"],simple:fh,statement:fh,natural:ch,essay:fh},Q0=["gap-5","gap-3"],eO=["text-[length:var(--size-body,16px)]","text-[15px]"];function yle(e){return ph(Q0,Q0[0],e)}function Sle(e){return ph(eO,eO[0],e)}function tO(e){return ph(oO,Qf,e)}function ble(e){let o=oO.map(r=>r.value),t=[...new Set(Object.values(J0).flat())];return et(e,t.map(r=>[[r],yd("headStyle",o,Qf,o.filter(a=>!J0[a].includes(r)))]))}import{readHidable as mW,VIEW_TIERS as xW,viewKeyAt as hW}from"efficient-easel/draw";var ua={direction:"row",share:"content",align:"center"},ma={top:14,bottom:14,topPhone:12,bottomPhone:12},ec={wrap:"nowrap",loop:"scroll",sectionAccent:dC,gap:60,gapPhone:32,separator:"dot",sectionBorder:{top:1,bottom:1}},rO={gap:120,gapPhone:64},oc={...Do,sizeToken:{step:"label",px:14,pxPhone:12},letterSpacing:.25,lineHeight:1.5},aO={textStyle:"heading-3",letterSpacing:.005,case:"upper",lineHeight:1},Il={top:24,bottom:24,topPhone:16,bottomPhone:16},xa={top:16,bottom:16,topPhone:12,bottomPhone:12},gl={justify:"between",wrap:"wrap",gap:32,separator:"none"},yl={...Do,letterSpacing:.1,lineHeight:1.5};var tc={top:24,bottom:24,topPhone:24,bottomPhone:24},rc={top:72,bottom:72,topPhone:72,bottomPhone:72},Mn={top:100,bottom:100,topPhone:60,bottomPhone:60},ac={top:120,bottom:120,topPhone:70,bottomPhone:70},IW={top:24,bottom:24,topPhone:24,bottomPhone:24},gW=40,nc={top:120,bottom:120,topTablet:80,bottomTablet:80,topPhone:80,bottomPhone:80},yW={top:24,bottom:24,topPhone:24,bottomPhone:24},sc={top:24,bottom:24,topPhone:24,bottomPhone:24},SW={top:84,bottom:84,topPhone:84,bottomPhone:84},lc={top:48,bottom:48,topPhone:48,bottomPhone:48},ic={top:80,bottom:80,topPhone:60,bottomPhone:60},dc={top:100,bottom:60,topPhone:60,bottomPhone:40},fc={top:60,bottom:60,topPhone:40,bottomPhone:40},cc={top:80,bottom:80,topTablet:60,bottomTablet:60,topPhone:60,bottomPhone:60},pc={top:76,bottom:76,topPhone:76,bottomPhone:76},uc={top:76,bottom:76,topPhone:76,bottomPhone:76},bl={top:80,bottom:40,topPhone:60,bottomPhone:32},wl={top:76,bottom:76,topPhone:76,bottomPhone:76},mc={top:72,bottom:72,topPhone:72,bottomPhone:72},xc={top:40,bottom:64,topPhone:24,bottomPhone:36},hc={top:120,bottom:120,topPhone:80,bottomPhone:80,topTablet:80,bottomTablet:80},Ic={top:48,bottom:48,topPhone:48,bottomPhone:48},Cl=e=>{let o=Ie(e.bandPadding)??gW;return{top:o,bottom:o,topPhone:o,bottomPhone:o}},nO=(e,o,t)=>({desktop:e,tablet:o,mobile:t}),uh=e=>cn(e.headPlacement)==="own-box",Be=(e,o)=>({top:nO(e.top,o?.top??e.topTablet??e.top,e.topPhone),bottom:nO(e.bottom,o?.bottom??e.bottomTablet??e.bottom,e.bottomPhone)}),sO=e=>({top:e.topPhone,bottom:e.bottomPhone}),Sl=e=>o=>uh(o)?{top:0,bottom:e.bottom}:e,bW=(e,o)=>{let t=mW(e[o]);return t.hidden?!1:!!t.text||e.editor?.isEditing===!0},gc={Banner:{frame:()=>Be(tc)},Cards:{frame:Sl(Be(rc))},Chart:{frame:()=>Be(wl)},ContactLocations:{frame:()=>Be(Mn,sO(Mn))},Countdown:{frame:()=>Be(lc)},DocBody:{frame:()=>Be(ic)},DocMasthead:{frame:()=>Be(dc)},DocMetaCards:{frame:()=>Be(fc)},FAQ:{frame:e=>{let o=uh(e)||!["num","title","linkText"].some(r=>bW(e,r)),t=Be(ac);return o?{top:0,bottom:t.bottom}:t},edge:!0},FeaturedCover:{frame:()=>Be(cc)},Grid:{frame:()=>Be(IW)},Integrations:{frame:()=>Be(pc)},KeyFeatures:{frame:()=>Be(uc)},Logos:{frame:e=>uh(e)?0:Be(Cl(e))},LongRead:{frame:Sl(Be(nc))},Masthead:{frame:()=>Be(bl,sO(bl))},Mockup:{frame:()=>Be(wl)},OrderSummary:{frame:()=>Be(yW)},PaymentBadges:{frame:()=>Be(sc)},Prose:{frame:Sl(Be(mc))},SectionHeader:{frame:e=>{let o=Be(xc);return tO(e.headStyle)==="standard"?o:{top:o.top,bottom:0}},edge:!0},Series:{frame:Sl(Be(hc))},Stats:{frame:()=>Be(Ic)},Testimonials:{frame:Sl(Be(SW))},Ticker:{frame:()=>Be(ma),edge:!0}};function Ble(e,o,t){let r=z(gc,e)??t;return r?aa({values:Qs(o,po,!0),frame:r.frame(o),drawsFrame:!0,edge:r.edge},!0).root:null}var lO=(e,o)=>typeof e=="object"&&"top"in e?e[o]:e;function wW(e,o){let t={...e};for(let r of xW)delete t[hW(o,r)];return t}function Lle(e,o,t,r){let a=z(gc,e)??t;if(!a)return{first:null,last:null};let n=a.frame(o),s=Qs(o,po,!0),l=(i,d)=>aa({values:wW(s,i),frame:d,drawsFrame:!0,edge:a.edge},!0).root;return{first:l("bottom",{top:lO(n,"top"),bottom:r.firstBottom}),last:l("top",{top:r.lastTop,bottom:lO(n,"bottom")})}}var CW=/^(?:[^\s]*:)?p[ytb]-/;function iO(e,o,t){if(!o)return t?{className:e,style:t}:{className:e};let r=e.split(/\s+/).filter(n=>n&&!CW.test(n)),a={...t,...o.style};return{className:[...r,o.className].filter(Boolean).join(" "),...Object.keys(a).length?{style:a}:{},...o.attrs}}import{isNodeList as kW}from"efficient-easel/data";var mh=new Set(["FAQ"]);function Yo(e,o){if(!mh.has(e))return!1;let t=o.template;return typeof t=="function"?(t.blockCount??0)>0:kW(t)}var cO={ParagraphsA:{top:60,bottom:80},StatsParagraph:{top:120,bottom:120},Timeline:{top:120,bottom:120},Footprint:{top:120,bottom:120},TimelineTrack:{top:120,bottom:120},TitleWithButtons:{top:140,bottom:140},ProcessSteps:{top:120,bottom:120}},pO=new Set(Object.keys(cO));function hh(e,o){return o?.innerPadding??z(cO,e)}var Hn=e=>hh(e)??{};var yc=new Set(["Flex","Text","Heading","ImageBlock","ButtonBlock"]),vW=new Set(["Divider"]),PW=new Set(["Hero","HeroSingle","IntroBleed","CategoryBar","DocTabs"]),dO=new Set(["ProductGrid"]);function Ih(e,o,t=!1,r){let a=e.render;e.render=n=>{if(o?.(n))return a(n);let s={...Qs(n,po,t),sideSpace:Z0(n.sideSpace)},l=r?aa({values:s,frame:r(n)},!0).outer:bk(s),i=a(n);if(!l)return i;let d=u=>xh(Jf,{className:u?`${l.className} ${u}`:l.className,children:h=>xh(de,{className:h,style:l.style,children:i})}),f=wr(n,{atSectionLine:!0}),x=wr(n);return f===x?d(f):xh(of,{line:"by-box",draw:u=>d(u?x:f)})}}var uO={name:"sectionPadding",applies:(e,o,t)=>o.isSection(e)&&!PW.has(e)&&!!t&&typeof t.render=="function",panel(e,o,t){let r=hh(o,e);if(r){e.fields={...e.fields,...t.sidesPaddingFields({keys:br,unitKey:Xd,fallback:r,tablet:!0,siteSide:!0})};return}if(dO.has(o))return;let a=[br.top,br.bottom].filter(s=>e.fields!=null&&s in e.fields);if(a.length)throw new Error(`section-padding: ${o} declares its own ${a.join(" / ")} row; declare \`innerPadding: { top, bottom }\` in its meta and the one Padding row draws on its band`);let n=fO(o,e);if(n){xO(e,o,t,n);return}e.fields={...e.fields,...t.sidesPaddingFields({tablet:!0,siteSide:!0})}},draw(e,o){if(!hh(o,e)){if(dO.has(o)){Ih(e);return}yc.has(o)||vW.has(o)||Ih(e,o==="Flex"?t=>Kk(t.bgImage):mh.has(o)?t=>Yo(o,t):void 0,!0,fO(o,e))}}},TW=["Heading","Text","ImageBlock","ButtonBlock"],OW=["LogoBlock"],mO={Text:e=>Tr(e,"text").textStyle?.startsWith("heading-")?el.heading:el.text,Heading:()=>el.heading,ButtonBlock:()=>el.text,Breadcrumb:()=>mx(Il),SpecStrip:()=>mx(xa),...Object.fromEntries(Object.entries(gc).map(([e,o])=>[e,o.frame]))};function fO(e,o){return z(mO,e)??o?.ownPad?.frame}var EW={ButtonBlock:"Outer padding"};function _W(e,o){let t=e[Ht],r=Array.isArray(t)?t.filter(i=>typeof i=="string"):[],a=wn().filter(i=>o?.[i]);if(!a.length)return e;let n=[...r.filter(i=>!a.includes(i)),...a.filter(i=>typeof e[i]=="number")];if(n.length===r.length&&n.every((i,d)=>i===r[d]))return e;let{[Ht]:s,...l}=e;return n.length?{...l,[Ht]:n}:l}function AW(e,o,t){if(o<=0)return null;let r=Array.isArray(e[Ht])?e[Ht]:[];return(t?wn().filter(a=>a.startsWith(po[t])):wn()).some(a=>typeof e[a]=="number"&&!r.includes(a))?c("plus {n} px (older setting)",{n:o}):null}function xO(e,o,t,r){e.fields={...e.fields,...t.ownPaddingFields?.(r,AW,z(EW,o))??t.sidesPaddingFields({tablet:!0,siteSide:!0})};let a=e.resolveData;e.resolveData=(n,s)=>{let l=n.props??{},i=s?.trigger==="replace"?_W(l,s.changed):l,d=i===l?n:{...n,props:i};return a?a(d,s):d}}var hO={name:"blockPadding",applies:(e,o,t)=>(TW.includes(e)||OW.includes(e))&&!!t&&typeof t.render=="function",panel(e,o,t){let r=z(mO,o);if(!r){e.fields={...e.fields,...t.sidesPaddingFields({tablet:!0,siteSide:!0})};return}xO(e,o,t,r)},draw(e,o){yc.has(o)||Ih(e,void 0,!0)}};import{createContext as gh,useContext as Sc}from"react";var IO=gh(null);function eie(){return Sc(IO)===!0}function oie(){return Sc(IO)!==null}var FW=gh(!1);function tie(){return Sc(FW)}function rie(e,o,t){let r=e.boxes;if(!r)return t;let a=r.indexOf(o);return a>=0?a:(r.push(o),r.length-1)}var bc=gh(null);function aie(){return Sc(bc)}import{jsx as ha}from"react/jsx-runtime";import{Component as WW,createContext as $W,lazy as Sie,Suspense as bie,useContext as zW,useSyncExternalStore as UW}from"react";function BW(e,o){let t=e.trim();if(!wc(t))return!1;if(!o)return!0;let r;try{r=new URL(t,"https://x.invalid").host}catch{return!1}let a=n=>n.toLowerCase().replace(/^www\./,"");return a(r)!==a(o)}function lie(e){return e.startsWith("/")||wc(e)}function wc(e){return/^(?:https?:)?\/\//i.test(e.trim())}var kl=Object.freeze({target:"_blank",rel:"noopener noreferrer"});function gO(e,o){return BW(e,o)?{...kl}:{}}function iie(e){return typeof e=="string"?e.trim():""}var die="data-sf-box-link",yO="absolute inset-0 -z-[1] outline-none focus-visible:z-[2] focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accent",yh="relative isolate pointer-events-none [&_a]:pointer-events-auto [&_button]:pointer-events-auto [&_input]:pointer-events-auto [&_select]:pointer-events-auto [&_textarea]:pointer-events-auto [&_label]:pointer-events-auto [&_summary]:pointer-events-auto [&_iframe]:pointer-events-auto [&_video]:pointer-events-auto [&_audio]:pointer-events-auto [&_[role=button]]:pointer-events-auto [&_[tabindex]:not([tabindex='-1'])]:pointer-events-auto",LW="data-sf-box-jump";function RW(e){return`sf-box-jump-${e}`}function fie(e,o){return e===!0?da(o):""}function DW({box:e,lit:o,first:t}){let r=s=>s.join(`,
|
|
305
305
|
`),a=t(e),n=o.flatMap(t);return`
|
|
306
306
|
${e} {
|
|
307
307
|
outline: 2px solid transparent;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{S as X,X as Bt,_ as Ht,aa as zt,ba as qt,da as $,g as Wt}from"./chunk-WFSVFVZX.js";import{O as Ft,aa as Je,ba as et,da as Dt,ka as tt,la as $t}from"./chunk-5LNWW4W3.js";import{j as q}from"./chunk-XSDGCHJH.js";import{qi as ve,ri as Ut,uf as Ot}from"./chunk-KNFNQXH3.js";import{c as Mt}from"./chunk-DIX2FLX7.js";import{createContext as tr,useContext as Jt,useEffect as nr,useMemo as Ee,useState as jt}from"react";function Kt(e,t){return e.map(n=>({partNumber:n.partNumber,quantity:n.wheels*t}))}function ge(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 nt=4,Oo=1,Fo={unit:"set",spares:0,spareSide:"left"};function Vt(e){return e.unit==="single"?1:nt+e.spares}function Yt(e,t){return[{partNumber:e.partNumber,wheels:Vt(t),prices:e.prices}]}function Qt(e,t){let n=Vt(t)-nt;if(n<=0||e.length===0)return e;let r=Jn(e),o=r?r[t.spareSide]:0;return e.map((i,s)=>s===o?{...i,wheels:i.wheels+n}:i)}function Jn(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 rt(e){let t=typeof e.spares=="number"?e.spares:e.spare?1:0;return{unit:e.unit,spares:t,spareSide:e.spareSide??"left"}}function ot(e,t){return t.spares>0?`${e} + spare`:e}function Xt(e){return e.unit==="single"?"Single":ot(`Set of ${nt}`,e)}var Do="data-add-to-basket",it=9,er="en",Gt=new Map;function $e(e,t,n){let r=`${e}|${t??""}|${n??""}`,o=Gt.get(r);return o||(o=new Intl.NumberFormat(er,{style:"currency",currency:e,...t===void 0?{}:{minimumFractionDigits:t},...n===void 0?{}:{maximumFractionDigits:n}}),Gt.set(r,o)),o}function ee(e,t,n=0){return $e(t,0,n).format(e)}function Mo(e,t){return $e(t).format(e)}function Uo(e,t){let n=e.savings[t];if(n===void 0)return null;let r=ee(n,t);return e.savingIsFrom?`Save from ${r}`:`Save ${r}`}import{jsx as sr}from"react/jsx-runtime";var rr="storefront-country",Zt=rr,st=tr(null);function or(e){return en(e,"catalogue")}function ir(e){return en(e,"money")}function en(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 $e(o,t==="money"?i:0,i).format(r)}}function zo({children:e,currencies:t,countries:n,defaultCurrency:r,defaultCountry:o}){let i=Ee(()=>t??[],[t]),s=Ee(()=>n??[],[n]),a=Ee(()=>r||i.find(g=>g.isDefault)?.code||i[0]?.code||"",[r,i]),c=Ee(()=>o||s.find(g=>g.isDefault)?.code||s[0]?.code||"",[o,s]),[u,m]=jt(c),[C,p]=jt(!1);nr(()=>{let g=q.getItem(Zt);g&&s.some(N=>N.code===g)&&m(g),p(!0)},[s]);function R(g){m(g),q.setItem(Zt,g)}let L=Ee(()=>{let g=s.find(b=>b.code===u)??null,N=g?.currency,_=N&&i.some(b=>b.code===N)?N:a,F=or(i),v=ir(i);return{country:u,currency:_,setCountry:R,currencies:i,countries:s,activeCountry:g,formatPrice:(b,D)=>F(b,D??_),formatMoney:(b,D)=>v(b,D??_),ready:C}},[u,i,s,a,C]);return sr(st.Provider,{value:L,children:e})}function tn(e){let t=Jt(st);if(!t&&!e?.optional)throw new Error("useCurrency must be used within a CurrencyProvider");return t}function qo(){return Jt(st)?.country??""}import{createContext as Or,useCallback as w,useContext as Fr,useEffect as W,useMemo as vn,useRef as j,useState as E}from"react";function nn(){return"/edit"}function on(e,t){return e.valid?!1:e.reason==="firstOrderOnly"?!0:e.reason==="notEligible"&&!t}var sn="We'll confirm this discount when you place your order.",Qo="Confirmed at checkout";function Xo(e){return e&&(e.valid||e.deferred)?e.code:void 0}var rn="coupon_code: ";function jo(e){return!(e instanceof X)||e.status!==400||!e.message.startsWith(rn)?null:e.message.slice(rn.length)}function at(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 ar=["width","profile","rim"],ei={width:"Width",profile:"Profile",rim:"Rim"},lr=/^\s*(\d{2,3})\s*\/\s*(\d{2,3})\s*[A-Za-z]*\s*(\d{2}(?:\.\d+)?)\s*$/,ur={width:[100,500],profile:[20,100],rim:[10,30]};function lt(e){let t=lr.exec(e??"");if(!t)return null;let n={width:Number(t[1]),profile:Number(t[2]),rim:Number(t[3])};return ar.every(o=>{let[i,s]=ur[o];return n[o]>=i&&n[o]<=s})?n:null}function ye(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 ti(e){return[ye({width:e.width}),ye({width:e.width,profile:e.profile}),ye(e)]}function ii(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 dr(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 Pe(e,t=""){return{vehicle:{...e,region:t},status:"unknown",oemSizes:[],variants:[]}}function fr(e,t){if(typeof t!="object"||t===null)return Pe(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 Pe(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?Pe(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 si(e,t){try{let n=await Bt(dr(e,t),{baseUrl:""});return fr(t,n)}catch(n){return n instanceof X&&n.status>=400&&n.status<500?Pe(t):{...Pe(t),failed:!0}}}function ai(e){if(!e)return[];let t=[];for(let n of[...e.frontTyres,...e.rearTyres]){let r=lt(n);if(!r)continue;let o=ye(r);t.includes(o)||t.push(o)}return t}function li(e,t){if(t.length===0)return null;for(let n of e){let r=lt(n);if(!r)continue;let o=ye(r);if(t.includes(o))return o}return null}function pr(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 mr="/tyres";function an(e){return e?`${mr}/${e}`:null}function We(e){let t=e.lastIndexOf(" ");return t===-1?{lead:"",accent:e}:{lead:e.slice(0,t+1),accent:e.slice(t+1)}}function gr(e,t){return Yt({partNumber:e.sku,prices:e.prices},t)}var yr="Tyre";function ln(e,t,n,r){return{id:`${e.slug}|${t.sku}|${n.unit}|${n.spares>0?"spare":"no-spare"}`,slug:e.slug,name:We(e.name),process:e.brand||yr,positionNo:"01",config:[{label:t.size},{label:Xt(n)}],finishName:"",size:t.size,components:gr(t,n),qty:r,href:an(e.slug)??void 0,kind:"tyre",sku:t.sku,pack:n}}function yi(e){return e.kind==="tyre"}function hi(e,t){let n=e.prices?.[t];return typeof n!="number"||!Number.isFinite(n)||n<=0?!1:e.inStock}var hr="dually";function ct(e){let t=e.components.reduce((o,i)=>o+i.wheels,0)||4,n=e.kind,r=[n==="staggered"?"Staggered":n===hr?"Dually":""].filter(Boolean);return r.length?`${r.join(" ")} set of ${t}`:`Set of ${t}`}function br(e,t){return[...new Set(e.filter(n=>!t||n.finishName===t).map(n=>n.size))]}function un(e,t,n){if(!(!t||!n))return e.find(r=>r.finishName===t&&r.size===n)}function Cr(e){return e!=null&&e.inStock===!1}function xi(e,t){return t?e.filter(n=>n.finishName===t&&Cr(n)):[]}function Si(e,t,n){return t.findIndex((r,o)=>n[o]!==!1&&br(e,r).length>0)}function vi(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 dn="alloy-wheel",xr="tyre";function Be(e){return e.name||e.slug||"An item from your cart"}async function fn(e,t){let n=[],r=new Map;for(let s of e){if(!s.slug){n.push(Be(s));continue}let a=s.kind??dn,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=>Sr(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 cn(e){if(e instanceof X&&e.status===404)return null;throw e}async function Sr(e,t){let n=e.snaps.map(r=>({ok:!1,name:Be(r)}));if(e.kind===dn){let r=await t.getWheel(e.slug).catch(cn);return r?e.snaps.map(o=>vr(e.slug,r,o)):n}if(e.kind===xr){let r=await t.getTyre(e.slug).catch(cn);return r?e.snaps.map(o=>Er(r,o)):n}return n}function vr(e,t,n){let r=un(t.variants,n.finish,n.size);if(!r)return{ok:!1,name:Be(n)};let o=n.pack?rt(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:We(t.name),process:t.process,positionNo:"01",config:[{label:r.size},{label:r.finishName,gold:!0},{label:o?ot(ct(r),o):ct(r)}],finishName:r.finishName,size:r.size,components:o&&i?Qt(r.components,o):r.components,qty:n.qty,...i?{pack:o}:{}}}}function Er(e,t){let n={ok:!1,name:Be(t)};if(!t.pack||!t.sku)return n;let r=rt(t.pack),o=e.variants.find(i=>i.sku===t.sku);return o?{ok:!0,line:ln(e,o,r,t.qty)}:n}var He="Price on request",Ni="Request a quote",pn="from ",Ai="From ",Ii="each",mn="Free",Oi="Updating";function dt(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function ft(e,t){let n=e?.[t];return dt(n)?n:null}function Fi(e,t,n,r){let o=ft(e,n),i=ft(t,n);return o===null&&i===null?0:o===null?1:i===null?-1:r==="asc"?o-i:i-o}function Di(e,t,n,r){if(n==null&&r==null)return!0;let o=ft(e,t);return!(o===null||n!=null&&o<n||r!=null&&o>r)}var Pr={priced:!1,unit:null,was:null,onSale:!1,setTotal:null};function kr(e,t,n){if(!dt(e))return Pr;let r=dt(t)&&t>e?t:null;return{priced:!0,unit:e,was:r,onSale:r!==null,setTotal:n!=null?e*n:null}}function Mi(e,t,n=""){return!e.priced||e.unit==null?He:`${n}${ee(e.unit,t)}`}function Ui(e,t){return e.was==null?null:ee(e.was,t)}function wr(e,t,n=1){let r=ge(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 Rr={priced:!1,unit:null,isFrom:!1,was:null,onSale:!1,setTotal:null};function $i(e,t,n,r=1){let o=kr(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=wr(t.components,n,r);return s.priced?{priced:!0,unit:s.unit,isFrom:s.isFrom,was:null,onSale:!1,setTotal:s.setTotal,fromSetTotal:i}:{...Rr,fromSetTotal:i}}function Wi(e,t){return!e.priced||e.unit==null?He:`${e.isFrom?pn:""}${ee(e.unit,t)}`}function Bi(e,t){return e.was==null?null:ee(e.was,t)}function Hi(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=ee(r-n,t);return{was:ee(r,t),amount:e.savingIsFrom?`${pn}${o}`:o}}var Tr=/^[^@\s]+@[^@\s]+\.[^@\s]+$/;function gn(e){return Tr.test(e.trim())}var yn="sf:ga-purchases",Lr=20;function bn(){return typeof window>"u"||window.parent!==window}function ke(...e){try{if(bn()||typeof window.gtag!="function")return;window.gtag(...e)}catch{}}function _r(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:ge(e.components,t)??0,quantity:e.qty}}function pt(e,t){return e.filter(we).map(n=>_r(n,t))}function Yi(e){ke("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 Cn(e,t){let n=pt([e],t);n.length!==0&&ke("event","add_to_cart",{currency:t,value:n[0].price*n[0].quantity,items:n})}function Qi(e){let t=pt(e.lines,e.currency);t.length!==0&&ke("event","begin_checkout",{currency:e.currency,value:e.value,...e.coupon?{coupon:e.coupon}:{},items:t})}var hn=new Set;function Nr(e){if(hn.has(e))return!1;hn.add(e);try{let t=JSON.parse(q.getItem(yn)??"[]");if(t.includes(e))return!1;q.setItem(yn,JSON.stringify([...t,e].slice(-Lr)))}catch{}return!0}function Xi(e){let t=e.confirmation;if(bn()||!Nr(t.orderNumber))return;let n=t.currency,r=Number(t.grandTotal);ke("event","purchase",{transaction_id:t.orderNumber,currency:n,value:r,shipping:Number(t.freightCharge),...t.couponCode?{coupon:t.couponCode}:{},items:pt(e.lines,n)}),e.adsSendTo&&ke("event","conversion",{send_to:e.adsSendTo,transaction_id:t.orderNumber,currency:n,value:r})}var Ar="Arranged after review",xn="Calculated at checkout",Ir=xn,Ji=xn;function Sn({quoted:e,optionCount:t,chosenAmount:n,couponWaivesFreight:r}){return e&&t===0?"arranged":r?"free":n===void 0?"pending":n===0?"free":"charged"}function es(e){switch(e){case"arranged":return Ar;case"pending":return Ir;case"free":return mn;case"charged":return null}}import{jsx as $r}from"react/jsx-runtime";var Dr=400,Mr=400,Ur=1500,mt="storefront-cart";function we(e){return(e.components?.length??0)>0}function En(e,t){return{code:e,valid:t.valid,deferred:on(t,t.askedAsShopper),message:t.message||void 0,effects:t.effects??void 0}}function kn(e,t){return ge(e.components,t)}function gt(e,t){let n=kn(e,t);return n===null?null:n*e.qty}function Pn(e){return e!=="tyre"}var wn=Or(null);function gs({children:e,preview:t=!1}){let{currency:n,country:r,formatMoney:o}=tn(),[i,s]=E(t),[a,c]=E([]),[u,m]=E([]),[C,p]=E([]),[R,L]=E(!1),g=j(new Set),[N,_]=E([]),[F,v]=E(!1),[b,D]=E(null),[G,re]=E(null),[de,h]=E(null),[P,x]=E(0),M=w(()=>x(l=>l+1),[]),[oe,he]=E(void 0),[K,Ne]=E(null),[k,U]=E(null),[V,ie]=E(!1),[O,fe]=E(null),se=j(void 0),Y=w(()=>s(!0),[]),Z=w(()=>s(!1),[]),Ae=w(()=>s(l=>!l),[]);W(()=>{t||typeof window>"u"||new URLSearchParams(window.location.search).get("cart")==="open"&&Y()},[Y,t]);let B=nn(),Q=j(B);W(()=>{Q.current!==B&&(Q.current=B,t||Z())},[B,t,Z]);let Ie=w(l=>{Ne(f=>f?.country===l?.country&&f?.subdivision===l?.subdivision&&f?.postcode===l?.postcode?f:l)},[]),I=w((l,f)=>{v(!0),!(!f||!Pn(l))&&_(d=>d.includes(f)?d:[...d,f])},[]),Oe=F||a.length>0,ae=j(!0);W(()=>(ae.current=!0,()=>{ae.current=!1}),[]),W(()=>{if(t)return;let l=[...N,...a.filter(d=>Pn(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);$.listWheelsBySlug(f).then(d=>{if(!ae.current||d.length===0)return;let y=new Set(d.map(S=>S.slug));m(S=>[...S.filter(ue=>!y.has(ue.slug)),...d])})}},[t,N,a]),W(()=>{if(t||!Oe||R)return;let l=!0;return $.listBundles().then(f=>{l&&(p(f),L(!0))}),()=>{l=!1}},[t,Oe,R]);let H=b?.deliveryOptions??[],be=b?.courier??null;W(()=>{b&&fe(l=>l&&H.some(f=>f.id===l)?l:H[0]?.id??null)},[b]);let le=w(()=>a.filter(we).flatMap(l=>Kt(l.components,l.qty)),[a]),Ce=w(async(l,f)=>{let d=l.trim().toUpperCase();if(!d)return;let y=le();if(y.length===0){U({code:d,valid:!1,message:"Add a wheel to the cart first."});return}ie(!0),se.current=f;try{let S=await $.validateCoupon({code:d,items:y,currency:n,shippingMethodId:O??void 0,customerEmail:f});U(En(d,S))}catch{U({code:d,valid:!1,unchecked:!0,message:"Could not check that code. Please try again."})}finally{ie(!1)}},[le,n,O]),pe=w(()=>{U(null),se.current=void 0},[]),Fe=w(l=>{if(!k)return;let{code:f}=k;U(d=>d&&d.code===f?{code:f,valid:!1,refused:!0,message:l}:d)},[k]);W(()=>{if(!k||k.refused)return;let l=k.code,f=y=>y!==null&&y.code===l&&!y.refused,d=setTimeout(async()=>{let y=le();if(y.length===0){U(S=>f(S)?{code:l,valid:!1,message:"Add a wheel to the cart first."}:S);return}ie(!0);try{let S=await $.validateCoupon({code:l,items:y,currency:n,shippingMethodId:O??void 0,customerEmail:se.current});U(ue=>f(ue)?En(l,S):ue)}catch{}finally{ie(!1)}},Dr);return()=>clearTimeout(d)},[a,n,O]);let xe=k&&!k.refused?k.code:void 0;W(()=>{if(t)return;let l=!0,f=a,d=setTimeout(async()=>{let y=le();if(y.length===0){D(null),re(null),he(void 0);return}try{let S=await $.quoteCart({items:y,currency:n,shippingMethodId:O??void 0,couponCode:xe,customerEmail:se.current||void 0,country:K?.country||r||void 0,subdivision:K?.country&&K.subdivision||void 0,postcode:K?.country&&K.postcode||void 0});if(!l)return;D(S),re(f),h(null)}catch{if(!l)return;h(f)}he(xe)},Mr);return()=>{l=!1,clearTimeout(d)}},[a,n,O,xe,r,K,P]);let T=w(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(it,y.qty+l.qty)}:y)}),Cn(l,n)},[n]),J=w(l=>{c(f=>f.filter(d=>d.id!==l))},[]),De=w((l,f)=>{let d=Math.max(1,Math.min(it,f));c(y=>y.map(S=>S.id===l?{...S,qty:d}:S))},[]),Me=w(l=>{c(l)},[]),[vt,Qe]=E(!1),[Et,Gn]=E([]),Pt=j(a);Pt.current=a,W(()=>{if(t)return;let l=[];try{let d=JSON.parse(q.getItem(mt)??"[]");Array.isArray(d)&&(l=d)}catch{}if(l.length===0){Qe(!0);return}let f=!0;return fn(l,$).then(({lines:d,dropped:y})=>{f&&(Pt.current.length===0&&(Me(d),Gn(y)),Qe(!0))},d=>{f&&Qe(!0)}),()=>{f=!1}},[t,Me]),W(()=>{if(t||!vt)return;let l=a.filter(we);if(l.length===0){q.removeItem(mt);return}q.setItem(mt,JSON.stringify(at(l,()=>"")))},[a,t,vt]);let[Se,Kn]=E(null),kt=j(null);kt.current=Se;let z=j(null),Xe=j(""),wt=w((l,f)=>{let d=l.trim().toLowerCase();gn(d)&&Kn(y=>y&&y.email===d&&y.firstName===(f??"")?y:{email:d,firstName:f??""})},[]);W(()=>{if(t||!Se)return;let l=at(a.filter(we),y=>gt(y,n)===null?He:o(gt(y,n),n)),f={email:Se.email,firstName:Se.firstName,currency:n,items:l},d=JSON.stringify(f);if(d!==Xe.current)return z.current&&clearTimeout(z.current),z.current=setTimeout(()=>{z.current=null,Xe.current=d,$.captureCart(f).catch(y=>{})},Ur),()=>{z.current&&(clearTimeout(z.current),z.current=null)}},[a,Se,n,t]);let Rt=w(()=>{z.current&&(clearTimeout(z.current),z.current=null);let l=kt.current;l&&(Xe.current="",$.captureCart({email:l.email,firstName:l.firstName,currency:n,items:[]}).catch(f=>{}))},[n]),Tt=vn(()=>{let l=a.reduce((A,me)=>{let Ue=gt(me,n);return Ue===null?A:A+Ue},0),f=a.some(A=>kn(A,n)===null),d=a.reduce((A,me)=>A+me.qty,0),y=k?.valid?k.effects:void 0,S=y?Math.min(l,Number(y.discountAmount)):0,ue=b?.bundleDiscount??0,Yn=b?.appliedBundles??[],je=!!y?.freeShipping,At=H.find(A=>A.id===O),It=je?0:b?.shipping??At?.amount??0,Qn=Sn({quoted:b!==null,optionCount:H.length,chosenAmount:At?.amount,couponWaivesFreight:je}),Ze={};for(let A of y?.freeUnits??[])Ze[A.partNumber]=(Ze[A.partNumber]??0)+A.quantity;let Xn=b?.tax??null,jn=b?b.grandTotal:l-S-ue+It;return{sets:d,units:a.reduce((A,me)=>A+(me.components??[]).reduce((Ue,Zn)=>Ue+Zn.wheels*me.qty,0),0),subtotal:l,hasUnpricedLine:f,discount:S,bundleDiscount:ue,appliedBundles:Yn,shipping:It,freeShipping:je,shippingStatus:Qn,freeUnitsByPartNumber:Ze,tax:Xn,grand:jn,repricing:!!k?.refused&&b!==null&&oe===k?.code,quoted:b!==null&&G===a,serverSubtotal:b?.subtotal??null,quoteFailed:de===a,currency:n}},[a,n,k,H,O,b,oe,G,de]),Lt=j(!0),_t=w(l=>{Lt.current=l},[]),Nt=w(l=>{T(l),Lt.current&&Y()},[T,Y]),Vn=vn(()=>({isOpen:i,preview:t,open:Y,close:Z,toggle:Ae,items:a,catalog:u,bundles:C,warmCatalog:I,add:T,addAndOpen:Nt,setAutoOpen:_t,remove:J,setQty:De,replaceItems:Me,restoreDropped:Et,identify:wt,clearCapturedCart:Rt,coupon:k,applyCoupon:Ce,removeCoupon:pe,refuseCoupon:Fe,couponBusy:V,deliveryOptions:H,setQuoteDestination:Ie,courier:be,requote:M,shippingMethodId:O,setShippingMethodId:fe,totals:Tt}),[i,t,Y,Z,Ae,a,u,C,I,T,Nt,_t,J,De,Me,Et,wt,Rt,k,Ce,pe,Fe,V,H,Ie,be,M,O,Tt]);return $r(wn.Provider,{value:Vn,children:e})}function Rn(){let e=Fr(wn);if(!e)throw new Error("useCart() must be called inside <CartProvider>. Mount the provider in app/layout.tsx.");return e}import{cache as Qr}from"react";function Tn(e){return/(?:^|\|)(?:slug|xhost):/.test(e)}function Ln(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 Wr=6e4,Br=5e3,Hr=500,ze=new Map;async function zr(e){let{host:t,matchesRequestHost:n}=await Ht();if(!t)return"";let r=await zt();return r?`${e}|slug:${encodeURIComponent(t)}/${encodeURIComponent(r)}`:n?`${e}|host:${t}`:`${e}|xhost:${t}`}async function _n(e,t){if(await qt()!==null)return t();let n=await zr(e);if(!n)return t();let r=Date.now(),o=ze.get(n);if(o&&o.expiresAt>r)return o.load;let i=await t(),s=i.outcome.state==="failed",a=s?Br:Wr,c=ze.get(n)?.lastGood,u=i.outcome.state==="ok"?i:s?c:void 0,m=s&&u?u:i;return Ln(ze,Hr,Tn,r),ze.set(n,{load:m,expiresAt:r+a,lastGood:u}),m}var qr=404;function Gr(e){if(e instanceof X&&e.status===qr)return{state:"absent"};let t=e instanceof X?e.status:-1,n=e instanceof Error?e.message:String(e);return{state:"failed",status:t,detail:n}}var Kr="[storefront:chrome-load-failed]";function Vr(e,t){console.error(`${Kr} ${e} status=${t.status} \u2014 serving fallback chrome`,t.detail)}async function Nn(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=Gr(o);return i.state==="failed"&&Vr(e,i),{value:n,outcome:i}}}function Yr(e){return e==="production"?"silent":"banner"}var Es=Yr("production");function Xr(e,t){return e?.trim()||t}function Ns({legalName:e,foundedYear:t,siteName:n},r=new Date().getFullYear()){let o=Xr(e,n);return`\xA9 ${t&&t<r?`${t}\u2013${r}`:`${r}`} ${o}`}var jr={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:tt},As=Qr(async()=>_n("site",()=>Nn("site",async()=>{let e=await $.getSite();return{name:Ut(e.name),legalName:e.legalName?.trim()||null,foundedYear:e.foundedYear??null,faviconUrl:e.faviconUrl??null,currencies:e.currencies??[],defaultCurrency:e.defaultCurrency??null,countries:e.countries??[],defaultCountry:e.defaultCountry??null,commerceEnabled:e.commerceEnabled??!0,cardPayments:e.cardPayments??!1,paymentMethods:e.paymentMethods??(e.cardPayments?["card"]:[]),paypalClientId:e.paypalClientId??null,paypalEnvironment:e.paypalEnvironment??null,squareApplicationId:e.squareApplicationId??null,squareLocationId:e.squareLocationId??null,squareEnvironment:e.squareEnvironment??null,ga4MeasurementId:e.ga4MeasurementId??null,googleAdsId:e.googleAdsId??null,googleAdsConversionLabel:(e.googleAdsId?e.googleAdsConversionLabel:null)??null,metaPixelId:e.metaPixelId??null,consentEnabled:e.consentEnabled??!1,consentPrivacyPage:e.consentPrivacyPage??null,consentNoticeOptOut:e.consentNoticeOptOut??!1,privacyPage:e.privacyPage??null,termsPage:e.termsPage??null,footerCookieSettings:e.footerCookieSettings??!0,footerSitemap:e.footerSitemap??!0,socialLinks:$t(e.socialLinks)}},jr)));var Is={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:tt};import{jsx as Zr}from"react/jsx-runtime";function Fs({tone:e="bad",role:t,children:n}){return Zr("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 Te,jsxs as yt}from"react/jsx-runtime";import{useEffect as qe,useId as no,useRef as In,useState as Ge}from"react";import{useRootIsDark as ro}from"efficient-shell/theme";import{efficientClientOpen as Jr}from"efficient-easel/screen/lib/session";var Re=new Map,eo=64;async function to(e){if(!Jr())return null;try{let t=await fetch(`${Mt()}/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 An(e){let t=Re.get(e);if(t)return t;let n=to(e);if(Re.set(e,n),Re.size>eo){let r=Re.keys().next();r.done||Re.delete(r.value)}return n}var oo=202/22,io=.88,ea=16,so="invert(1)";function ta({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:L=!1,fitFloorPx:g,hideClass:N,hideAttrs:_,part:F}){let v=C&&C.trim()?C.trim():p,[b,D]=Ge(null),G=In(null),re=T=>{G.current=T};qe(()=>{D(G.current?.ownerDocument??null)},[]);let de=!ro({doc:b,whenUnset:!0}),h=n&&n.trim()?n.trim():null,P=!!h&&Wt(h),x=i??(de&&t),M=o&&o.trim()?o.trim():null,oe=r&&!M,he=`logo-color-${no().replace(/[^A-Za-z0-9_-]/g,"")}`,K=oe&&P&&h&&s!=null?{reversed:s,inkIsDark:a??null}:null,Ne=K!==null,[k,U]=Ge(null);qe(()=>{if(!oe||!h||!P||Ne){U(null);return}let T=!1;return U(null),An(h).then(J=>{T||U(J)}),()=>{T=!0}},[oe,h,P,Ne]);let V=K??k,ie=!!V&&V.inkIsDark!==null&&(x?!V.inkIsDark:V.inkIsDark),O=oe&&!!h&&!P&&!x,fe=ie&&V?V.reversed:h,se=fe?[fe]:[],[Y,Z]=Ge(0);qe(()=>{Z(0)},[h,ie]);let Ae=e==="footer"?et:Je[c],B=u&&u>0?u:Ae,Q=(u&&u>0?Ot(u,m,"size",Dt):null)??`${B}px`,Ie=Math.round(B*oo),I=Y<se.length?se[Y]:null,[Oe,ae]=Ge(fe),H=I!==null&&I===Oe,be=In(null);qe(()=>{let T=be.current;if(!T||!T.complete)return;if(T.naturalWidth>0||T.naturalHeight>0){ae(I);return}let J=!1;return T.decode().then(()=>!J&&ae(I),()=>!J&&Z(De=>De+1)),()=>{J=!0}},[I]);let le=R||L,Ce=`calc(100cqi / ${((v.length+1)*io).toFixed(2)})`,pe=le&&g&&g>0?Q===`${B}px`?`${Math.min(g,B)}px`:`min(${g}px, ${Q})`:null,Fe=le?pe===null?`min(${Q}, ${Ce})`:`clamp(${pe}, ${Ce}, ${Q})`:Q,xe=yt("span",{className:`font-display font-bold tracking-[0.18em] ${pe===null?"whitespace-nowrap":"whitespace-normal"}`,style:{fontSize:Fe,lineHeight:1,...M?{color:M}:{}},"aria-label":v,children:[v,Te("span",{className:"text-accent",style:M?{color:M}:void 0,children:"."})]});return yt("span",{ref:re,className:Ft("inline-flex items-center",N??""),..._,...F,children:[!H&&xe,M&&I&&Te("svg",{"aria-hidden":"true",focusable:"false",width:"0",height:"0",style:{position:"absolute"},children:yt("filter",{id:he,colorInterpolationFilters:"sRGB",children:[Te("feFlood",{style:{floodColor:M}}),Te("feComposite",{in2:"SourceAlpha",operator:"in"})]})}),I&&Te("img",{ref:be,src:I,alt:v,width:Ie,height:B,className:"shrink-0 object-contain",style:{...H?{height:Q,width:"auto",...R?{maxWidth:"100cqi"}:{}}:{display:"none"},...O?{filter:so}:{},...M?{filter:`url(#${he})`}:{}},onLoad:()=>ae(I),onError:()=>Z(T=>T+1)},I)]})}var ra="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",On="w-0 min-w-0 flex-1",oa="w-0 min-w-[7rem] flex-1";import{jsx as Le,jsxs as lo}from"react/jsx-runtime";function ao({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 lo("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:[Le("circle",{cx:100,cy:100,r:92,strokeWidth:2}),Le("circle",{cx:100,cy:100,r:84,strokeWidth:1,opacity:.4}),Le("circle",{cx:100,cy:100,r:22,strokeWidth:2}),Le("circle",{cx:100,cy:100,r:6,fill:"currentColor"}),a.map((c,u)=>Le("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 la="#c9a461",Fn=[{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"}],ua={name:"",color:"var(--fg)",family:"silver",src:""};function uo(e,t){let n=r=>{let o=Fn.findIndex(i=>i.f===r);return o===-1?Fn.length:o};return n(e)-n(t)||e.localeCompare(t)}function ca(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(uo)}import{useEffect as co,useRef as Dn,useState as fo}from"react";import{jsx as ce,jsxs as ht}from"react/jsx-runtime";function po({customerEmail:e,disabled:t=!1}){let{coupon:n,applyCoupon:r,removeCoupon:o,couponBusy:i}=Rn(),[s,a]=fo(""),c=Dn(!1),u=Dn(null);co(()=>{!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 ht("div",{className:"flex flex-col gap-2",children:[n===null?ht("div",{className:"flex border border-line",children:[ce("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:`${On} bg-transparent px-4 py-4 font-mono text-[11px] uppercase tracking-[0.18em] text-fg outline-none placeholder:text-fg-dim`}),ce("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"})]}):ht("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:[ce("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&&ce("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&&ce("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?ce("p",{className:"font-mono text-[10px] uppercase tracking-[0.18em] text-fg-dim",children:sn}):n&&!n.valid&&n.message&&ce("p",{role:"alert",className:"font-mono text-[10px] uppercase tracking-[0.18em] text-alert",children:n.message})]})}var bt="Ads on. Shopper can opt out.",Ke="Ads and analytics off until Accept",mo={us:{region:"us",name:"United States",model:"opt-out",law:"California CCPA / CPRA, other state laws",beforeChoice:bt,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:Ke,footerLink:"Privacy choices",panelEyebrow:"Privacy choices",adsRowName:"Advertising"},au:{region:"au",name:"Australia",model:"opt-out",law:"Privacy Act 1988 (APPs)",beforeChoice:bt,footerLink:"Privacy choices",panelEyebrow:"Privacy choices",adsRowName:"Advertising"},nz:{region:"nz",name:"New Zealand",model:"opt-out",law:"Privacy Act 2020",beforeChoice:bt,footerLink:"Privacy choices",panelEyebrow:"Privacy choices",adsRowName:"Advertising"},uk:{region:"uk",name:"United Kingdom",model:"opt-in",law:"PECR, UK GDPR",beforeChoice:Ke,footerLink:"Cookie settings",panelEyebrow:"Cookie settings",adsRowName:"Advertising"},eu:{region:"eu",name:"European Union",model:"opt-in",law:"ePrivacy Directive, GDPR",beforeChoice:Ke,footerLink:"Cookie settings",panelEyebrow:"Cookie settings",adsRowName:"Advertising"},other:{region:"other",name:"All other countries",model:"opt-in",law:"Safe default",beforeChoice:Ke,footerLink:"Cookie settings",panelEyebrow:"Cookie settings",adsRowName:"Advertising"}};function go(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 ba(e,t,n){let r=go(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 Ca={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 yo={asked:!1,region:"other",model:"opt-in",analytics:!0,ads:!0,chosen:!0,gpc:!1};var ho=yo;function Ea(e=ho){if(e.asked)return e.ads?"granted":"denied"}function ka(){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 Co,isValidElement as xo,useEffect as Un,useId as So,useLayoutEffect as Bn,useRef as te,useState as $n}from"react";var Ve=(e,t)=>!!e[t]&&!e[t].disabled;function Ct(e,t,n){let r=e.length;for(let o=1;o<=r;o++){let i=((t+n*o)%r+r)%r;if(Ve(e,i))return i}return t}function xt(e,t){return Ct(e,t===1?-1:e.length,t)}function St(e,t){return Ve(e,t)?t:Math.max(xt(e,1),0)}function Mn(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)=>Ve(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:Ct(n,o,1)}),handled:!0};case"ArrowUp":return{state:i({focus:Ct(n,o,-1)}),handled:!0};case"Home":return{state:i({focus:xt(n,1)}),handled:!0};case"End":return{state:i({focus:xt(n,-1)}),handled:!0};case"Enter":case" ":return Ve(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 vo}from"efficient-shell/ui";import{Fragment as Lo,jsx as ne,jsxs as Hn}from"react/jsx-runtime";var Wn={body:"text-[length:var(--size-body,14px)]",label:"text-[length:var(--size-label,13px)]"};function Eo({items:e,value:t,onPick:n,open:r,onOpen:o,onClose:i}){let[s,a]=$n(!1),c=r!==void 0,u=c?r:s,[m,C]=$n(0),p=te({text:"",timer:0}),R=te(null),L=te(null),g=te(null),N=So(),_=te(null),F=e.findIndex(h=>h.value===t),v=h=>{h!==u&&(c||a(h),h?o?.():i?.())},b=h=>{let P=e[h];!P||P.disabled||(n(P.value),v(!1),L.current?.focus())},D=h=>{let P={open:u,focus:u?m:St(e,F),typed:p.current.text},x=Mn(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):v(x.state.open),x.refocus&&L.current?.focus(),x.handled)},G=te(D);G.current=D;let re=te(()=>v(!1));re.current=()=>v(!1);let de=h=>{u||(_.current=h.nativeEvent,G.current(h.key)&&h.preventDefault())};return Un(()=>{if(!u)return;let h=x=>{R.current?.contains(x.target)||re.current()},P=x=>{x!==_.current&&G.current(x.key)&&x.preventDefault()};return document.addEventListener("mousedown",h),document.addEventListener("keydown",P),()=>{document.removeEventListener("mousedown",h),document.removeEventListener("keydown",P)}},[u]),Un(()=>{u&&(p.current.text||C(St(e,F)))},[u]),Bn(()=>{if(!u||!g.current)return;g.current.children.item(m)?.scrollIntoView({block:"nearest"})},[m,u]),{open:u,toggle:()=>v(!u),close:()=>v(!1),focusIdx:m,setFocusIdx:C,pick:h=>b(e.findIndex(P=>P.value===h)),wrapRef:R,triggerRef:L,listRef:g,listId:N,onTriggerKeyDown:de,activeId:u?`${N}-${m}`:void 0}}var Po={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 ${Wn.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 ${Wn.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 ko(e,t){Bn(()=>{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=vo({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 wo(e){return e.split(" ").map(t=>t==="left-0"?"right-0":t).join(" ")}function Ro({id:e,tone:t,items:n,value:r,focusIdx:o,onFocus:i,onPick:s,listRef:a,ariaLabel:c,align:u="start"}){let m=Po[t],C=te(null);return ko(C,n.length),ne("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"?wo(m.list):m.list,children:n.map((p,R)=>{let L=p.value===r;return ne("li",{id:`${e}-${R}`,role:"option","aria-selected":L,"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,L&&p.value!=="",!!p.disabled,R===n.length-1),style:m.itemStyle?.(L),children:p.meta===void 0?p.label:Hn(Lo,{children:[p.lead,ne("span",{className:"flex-1 whitespace-nowrap",children:p.label}),ne("span",{className:"ml-auto text-[12px] opacity-50",children:p.meta})]})},`${p.value}_${R}`)})})}function To({value:e,onChange:t,disabled:n,children:r,className:o,style:i,name:s,id:a,"aria-label":c,align:u}){let m=Co.toArray(r).flatMap(g=>{if(!xo(g))return[];if(g.type!=="option")return[];let _=g.props,F=_.value!==void 0?String(_.value):"",v=_.children,b=typeof v=="string"||typeof v=="number"?String(v):F;return[{value:F,label:b,disabled:!!_.disabled}]}),C=e??"",p=Eo({items:m,value:C,onPick:g=>t?.({target:{value:g}})}),L=m.find(g=>g.value===C)?.label??m[0]?.label??"";return Hn("div",{ref:p.wrapRef,className:"relative",children:[s&&ne("input",{type:"hidden",name:s,value:C}),ne("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:ne("span",{className:"block w-full truncate text-left",children:L})}),p.open&&ne(Ro,{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 _e,jsxs as Ye}from"react/jsx-runtime";var _o="font-mono text-[length:var(--size-label,12px)]",No="font-semibold uppercase tracking-[0.22em] text-fg";function zn(e){return`${e??_o} ${No}`}function qn(){return _e("span",{className:"text-accent",children:" *"})}function Ao({children:e,required:t,labelFace:n}){return Ye("span",{className:zn(n),children:[e,t?_e(qn,{}):null]})}function Io({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?_e("span",{className:"font-mono text-[11px] uppercase tracking-[0.22em] text-fg-dim",children:n}):null;return r||n?Ye("div",{className:c,children:[Ye("label",{htmlFor:o,className:zn(i),children:[e,t?_e(qn,{}):null]}),a,u]}):Ye("label",{htmlFor:o,className:c,children:[_e(Ao,{required:t,labelFace:i,children:e}),a]})}export{nn as a,Qo as b,Xo as c,jo as d,Kt as e,nt as f,Oo as g,Fo as h,Qt as i,Jn as j,ot as k,Xt as l,Do as m,it as n,$e as o,ee as p,Mo as q,Uo as r,ar as s,ei as t,lt as u,ye as v,ti as w,ii as x,Pe as y,si as z,ai as A,li as B,pr as C,an as D,We as E,gr as F,ln as G,yi as H,hi as I,ct as J,un as K,Cr as L,xi as M,Si as N,vi as O,He as P,Ni as Q,pn as R,Ai as S,Ii as T,mn as U,Oi as V,ft as W,Fi as X,Di as Y,kr as Z,Mi as _,Ui as $,wr as aa,$i as ba,Wi as ca,Bi as da,Hi as ea,gn as fa,Yi as ga,Qi as ha,Xi as ia,Ji as ja,es as ka,zo as la,tn as ma,qo as na,we as oa,gt as pa,gs as qa,Rn as ra,Ns as sa,jr as ta,Is as ua,ra as va,On as wa,oa as xa,ao as ya,la as za,Fn as Aa,ua as Ba,uo as Ca,ca as Da,po as Ea,Fs as Fa,ea as Ga,ta as Ha,mo as Ia,ba as Ja,Ca as Ka,yo as La,Ea as Ma,ka as Na,Eo as Oa,Ro as Pa,To as Qa,Ao as Ra,Io as Sa};
|
|
1
|
+
import{S as X,X as Bt,_ as Ht,aa as zt,ba as qt,da as $,g as Wt}from"./chunk-AZNXYX4W.js";import{O as Ft,aa as Je,ba as et,da as Dt,ka as tt,la as $t}from"./chunk-AJHYWZA6.js";import{j as q}from"./chunk-PN7RMJTO.js";import{qi as ve,ri as Ut,uf as Ot}from"./chunk-4TGKSUNO.js";import{c as Mt}from"./chunk-POFTB7WN.js";import{createContext as tr,useContext as Jt,useEffect as nr,useMemo as Ee,useState as jt}from"react";function Kt(e,t){return e.map(n=>({partNumber:n.partNumber,quantity:n.wheels*t}))}function ge(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 nt=4,Oo=1,Fo={unit:"set",spares:0,spareSide:"left"};function Vt(e){return e.unit==="single"?1:nt+e.spares}function Yt(e,t){return[{partNumber:e.partNumber,wheels:Vt(t),prices:e.prices}]}function Qt(e,t){let n=Vt(t)-nt;if(n<=0||e.length===0)return e;let r=Jn(e),o=r?r[t.spareSide]:0;return e.map((i,s)=>s===o?{...i,wheels:i.wheels+n}:i)}function Jn(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 rt(e){let t=typeof e.spares=="number"?e.spares:e.spare?1:0;return{unit:e.unit,spares:t,spareSide:e.spareSide??"left"}}function ot(e,t){return t.spares>0?`${e} + spare`:e}function Xt(e){return e.unit==="single"?"Single":ot(`Set of ${nt}`,e)}var Do="data-add-to-basket",it=9,er="en",Gt=new Map;function $e(e,t,n){let r=`${e}|${t??""}|${n??""}`,o=Gt.get(r);return o||(o=new Intl.NumberFormat(er,{style:"currency",currency:e,...t===void 0?{}:{minimumFractionDigits:t},...n===void 0?{}:{maximumFractionDigits:n}}),Gt.set(r,o)),o}function ee(e,t,n=0){return $e(t,0,n).format(e)}function Mo(e,t){return $e(t).format(e)}function Uo(e,t){let n=e.savings[t];if(n===void 0)return null;let r=ee(n,t);return e.savingIsFrom?`Save from ${r}`:`Save ${r}`}import{jsx as sr}from"react/jsx-runtime";var rr="storefront-country",Zt=rr,st=tr(null);function or(e){return en(e,"catalogue")}function ir(e){return en(e,"money")}function en(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 $e(o,t==="money"?i:0,i).format(r)}}function zo({children:e,currencies:t,countries:n,defaultCurrency:r,defaultCountry:o}){let i=Ee(()=>t??[],[t]),s=Ee(()=>n??[],[n]),a=Ee(()=>r||i.find(g=>g.isDefault)?.code||i[0]?.code||"",[r,i]),c=Ee(()=>o||s.find(g=>g.isDefault)?.code||s[0]?.code||"",[o,s]),[u,m]=jt(c),[C,p]=jt(!1);nr(()=>{let g=q.getItem(Zt);g&&s.some(N=>N.code===g)&&m(g),p(!0)},[s]);function R(g){m(g),q.setItem(Zt,g)}let L=Ee(()=>{let g=s.find(b=>b.code===u)??null,N=g?.currency,_=N&&i.some(b=>b.code===N)?N:a,F=or(i),v=ir(i);return{country:u,currency:_,setCountry:R,currencies:i,countries:s,activeCountry:g,formatPrice:(b,D)=>F(b,D??_),formatMoney:(b,D)=>v(b,D??_),ready:C}},[u,i,s,a,C]);return sr(st.Provider,{value:L,children:e})}function tn(e){let t=Jt(st);if(!t&&!e?.optional)throw new Error("useCurrency must be used within a CurrencyProvider");return t}function qo(){return Jt(st)?.country??""}import{createContext as Or,useCallback as w,useContext as Fr,useEffect as W,useMemo as vn,useRef as j,useState as E}from"react";function nn(){return"/edit"}function on(e,t){return e.valid?!1:e.reason==="firstOrderOnly"?!0:e.reason==="notEligible"&&!t}var sn="We'll confirm this discount when you place your order.",Qo="Confirmed at checkout";function Xo(e){return e&&(e.valid||e.deferred)?e.code:void 0}var rn="coupon_code: ";function jo(e){return!(e instanceof X)||e.status!==400||!e.message.startsWith(rn)?null:e.message.slice(rn.length)}function at(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 ar=["width","profile","rim"],ei={width:"Width",profile:"Profile",rim:"Rim"},lr=/^\s*(\d{2,3})\s*\/\s*(\d{2,3})\s*[A-Za-z]*\s*(\d{2}(?:\.\d+)?)\s*$/,ur={width:[100,500],profile:[20,100],rim:[10,30]};function lt(e){let t=lr.exec(e??"");if(!t)return null;let n={width:Number(t[1]),profile:Number(t[2]),rim:Number(t[3])};return ar.every(o=>{let[i,s]=ur[o];return n[o]>=i&&n[o]<=s})?n:null}function ye(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 ti(e){return[ye({width:e.width}),ye({width:e.width,profile:e.profile}),ye(e)]}function ii(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 dr(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 Pe(e,t=""){return{vehicle:{...e,region:t},status:"unknown",oemSizes:[],variants:[]}}function fr(e,t){if(typeof t!="object"||t===null)return Pe(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 Pe(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?Pe(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 si(e,t){try{let n=await Bt(dr(e,t),{baseUrl:""});return fr(t,n)}catch(n){return n instanceof X&&n.status>=400&&n.status<500?Pe(t):{...Pe(t),failed:!0}}}function ai(e){if(!e)return[];let t=[];for(let n of[...e.frontTyres,...e.rearTyres]){let r=lt(n);if(!r)continue;let o=ye(r);t.includes(o)||t.push(o)}return t}function li(e,t){if(t.length===0)return null;for(let n of e){let r=lt(n);if(!r)continue;let o=ye(r);if(t.includes(o))return o}return null}function pr(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 mr="/tyres";function an(e){return e?`${mr}/${e}`:null}function We(e){let t=e.lastIndexOf(" ");return t===-1?{lead:"",accent:e}:{lead:e.slice(0,t+1),accent:e.slice(t+1)}}function gr(e,t){return Yt({partNumber:e.sku,prices:e.prices},t)}var yr="Tyre";function ln(e,t,n,r){return{id:`${e.slug}|${t.sku}|${n.unit}|${n.spares>0?"spare":"no-spare"}`,slug:e.slug,name:We(e.name),process:e.brand||yr,positionNo:"01",config:[{label:t.size},{label:Xt(n)}],finishName:"",size:t.size,components:gr(t,n),qty:r,href:an(e.slug)??void 0,kind:"tyre",sku:t.sku,pack:n}}function yi(e){return e.kind==="tyre"}function hi(e,t){let n=e.prices?.[t];return typeof n!="number"||!Number.isFinite(n)||n<=0?!1:e.inStock}var hr="dually";function ct(e){let t=e.components.reduce((o,i)=>o+i.wheels,0)||4,n=e.kind,r=[n==="staggered"?"Staggered":n===hr?"Dually":""].filter(Boolean);return r.length?`${r.join(" ")} set of ${t}`:`Set of ${t}`}function br(e,t){return[...new Set(e.filter(n=>!t||n.finishName===t).map(n=>n.size))]}function un(e,t,n){if(!(!t||!n))return e.find(r=>r.finishName===t&&r.size===n)}function Cr(e){return e!=null&&e.inStock===!1}function xi(e,t){return t?e.filter(n=>n.finishName===t&&Cr(n)):[]}function Si(e,t,n){return t.findIndex((r,o)=>n[o]!==!1&&br(e,r).length>0)}function vi(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 dn="alloy-wheel",xr="tyre";function Be(e){return e.name||e.slug||"An item from your cart"}async function fn(e,t){let n=[],r=new Map;for(let s of e){if(!s.slug){n.push(Be(s));continue}let a=s.kind??dn,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=>Sr(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 cn(e){if(e instanceof X&&e.status===404)return null;throw e}async function Sr(e,t){let n=e.snaps.map(r=>({ok:!1,name:Be(r)}));if(e.kind===dn){let r=await t.getWheel(e.slug).catch(cn);return r?e.snaps.map(o=>vr(e.slug,r,o)):n}if(e.kind===xr){let r=await t.getTyre(e.slug).catch(cn);return r?e.snaps.map(o=>Er(r,o)):n}return n}function vr(e,t,n){let r=un(t.variants,n.finish,n.size);if(!r)return{ok:!1,name:Be(n)};let o=n.pack?rt(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:We(t.name),process:t.process,positionNo:"01",config:[{label:r.size},{label:r.finishName,gold:!0},{label:o?ot(ct(r),o):ct(r)}],finishName:r.finishName,size:r.size,components:o&&i?Qt(r.components,o):r.components,qty:n.qty,...i?{pack:o}:{}}}}function Er(e,t){let n={ok:!1,name:Be(t)};if(!t.pack||!t.sku)return n;let r=rt(t.pack),o=e.variants.find(i=>i.sku===t.sku);return o?{ok:!0,line:ln(e,o,r,t.qty)}:n}var He="Price on request",Ni="Request a quote",pn="from ",Ai="From ",Ii="each",mn="Free",Oi="Updating";function dt(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function ft(e,t){let n=e?.[t];return dt(n)?n:null}function Fi(e,t,n,r){let o=ft(e,n),i=ft(t,n);return o===null&&i===null?0:o===null?1:i===null?-1:r==="asc"?o-i:i-o}function Di(e,t,n,r){if(n==null&&r==null)return!0;let o=ft(e,t);return!(o===null||n!=null&&o<n||r!=null&&o>r)}var Pr={priced:!1,unit:null,was:null,onSale:!1,setTotal:null};function kr(e,t,n){if(!dt(e))return Pr;let r=dt(t)&&t>e?t:null;return{priced:!0,unit:e,was:r,onSale:r!==null,setTotal:n!=null?e*n:null}}function Mi(e,t,n=""){return!e.priced||e.unit==null?He:`${n}${ee(e.unit,t)}`}function Ui(e,t){return e.was==null?null:ee(e.was,t)}function wr(e,t,n=1){let r=ge(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 Rr={priced:!1,unit:null,isFrom:!1,was:null,onSale:!1,setTotal:null};function $i(e,t,n,r=1){let o=kr(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=wr(t.components,n,r);return s.priced?{priced:!0,unit:s.unit,isFrom:s.isFrom,was:null,onSale:!1,setTotal:s.setTotal,fromSetTotal:i}:{...Rr,fromSetTotal:i}}function Wi(e,t){return!e.priced||e.unit==null?He:`${e.isFrom?pn:""}${ee(e.unit,t)}`}function Bi(e,t){return e.was==null?null:ee(e.was,t)}function Hi(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=ee(r-n,t);return{was:ee(r,t),amount:e.savingIsFrom?`${pn}${o}`:o}}var Tr=/^[^@\s]+@[^@\s]+\.[^@\s]+$/;function gn(e){return Tr.test(e.trim())}var yn="sf:ga-purchases",Lr=20;function bn(){return typeof window>"u"||window.parent!==window}function ke(...e){try{if(bn()||typeof window.gtag!="function")return;window.gtag(...e)}catch{}}function _r(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:ge(e.components,t)??0,quantity:e.qty}}function pt(e,t){return e.filter(we).map(n=>_r(n,t))}function Yi(e){ke("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 Cn(e,t){let n=pt([e],t);n.length!==0&&ke("event","add_to_cart",{currency:t,value:n[0].price*n[0].quantity,items:n})}function Qi(e){let t=pt(e.lines,e.currency);t.length!==0&&ke("event","begin_checkout",{currency:e.currency,value:e.value,...e.coupon?{coupon:e.coupon}:{},items:t})}var hn=new Set;function Nr(e){if(hn.has(e))return!1;hn.add(e);try{let t=JSON.parse(q.getItem(yn)??"[]");if(t.includes(e))return!1;q.setItem(yn,JSON.stringify([...t,e].slice(-Lr)))}catch{}return!0}function Xi(e){let t=e.confirmation;if(bn()||!Nr(t.orderNumber))return;let n=t.currency,r=Number(t.grandTotal);ke("event","purchase",{transaction_id:t.orderNumber,currency:n,value:r,shipping:Number(t.freightCharge),...t.couponCode?{coupon:t.couponCode}:{},items:pt(e.lines,n)}),e.adsSendTo&&ke("event","conversion",{send_to:e.adsSendTo,transaction_id:t.orderNumber,currency:n,value:r})}var Ar="Arranged after review",xn="Calculated at checkout",Ir=xn,Ji=xn;function Sn({quoted:e,optionCount:t,chosenAmount:n,couponWaivesFreight:r}){return e&&t===0?"arranged":r?"free":n===void 0?"pending":n===0?"free":"charged"}function es(e){switch(e){case"arranged":return Ar;case"pending":return Ir;case"free":return mn;case"charged":return null}}import{jsx as $r}from"react/jsx-runtime";var Dr=400,Mr=400,Ur=1500,mt="storefront-cart";function we(e){return(e.components?.length??0)>0}function En(e,t){return{code:e,valid:t.valid,deferred:on(t,t.askedAsShopper),message:t.message||void 0,effects:t.effects??void 0}}function kn(e,t){return ge(e.components,t)}function gt(e,t){let n=kn(e,t);return n===null?null:n*e.qty}function Pn(e){return e!=="tyre"}var wn=Or(null);function gs({children:e,preview:t=!1}){let{currency:n,country:r,formatMoney:o}=tn(),[i,s]=E(t),[a,c]=E([]),[u,m]=E([]),[C,p]=E([]),[R,L]=E(!1),g=j(new Set),[N,_]=E([]),[F,v]=E(!1),[b,D]=E(null),[G,re]=E(null),[de,h]=E(null),[P,x]=E(0),M=w(()=>x(l=>l+1),[]),[oe,he]=E(void 0),[K,Ne]=E(null),[k,U]=E(null),[V,ie]=E(!1),[O,fe]=E(null),se=j(void 0),Y=w(()=>s(!0),[]),Z=w(()=>s(!1),[]),Ae=w(()=>s(l=>!l),[]);W(()=>{t||typeof window>"u"||new URLSearchParams(window.location.search).get("cart")==="open"&&Y()},[Y,t]);let B=nn(),Q=j(B);W(()=>{Q.current!==B&&(Q.current=B,t||Z())},[B,t,Z]);let Ie=w(l=>{Ne(f=>f?.country===l?.country&&f?.subdivision===l?.subdivision&&f?.postcode===l?.postcode?f:l)},[]),I=w((l,f)=>{v(!0),!(!f||!Pn(l))&&_(d=>d.includes(f)?d:[...d,f])},[]),Oe=F||a.length>0,ae=j(!0);W(()=>(ae.current=!0,()=>{ae.current=!1}),[]),W(()=>{if(t)return;let l=[...N,...a.filter(d=>Pn(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);$.listWheelsBySlug(f).then(d=>{if(!ae.current||d.length===0)return;let y=new Set(d.map(S=>S.slug));m(S=>[...S.filter(ue=>!y.has(ue.slug)),...d])})}},[t,N,a]),W(()=>{if(t||!Oe||R)return;let l=!0;return $.listBundles().then(f=>{l&&(p(f),L(!0))}),()=>{l=!1}},[t,Oe,R]);let H=b?.deliveryOptions??[],be=b?.courier??null;W(()=>{b&&fe(l=>l&&H.some(f=>f.id===l)?l:H[0]?.id??null)},[b]);let le=w(()=>a.filter(we).flatMap(l=>Kt(l.components,l.qty)),[a]),Ce=w(async(l,f)=>{let d=l.trim().toUpperCase();if(!d)return;let y=le();if(y.length===0){U({code:d,valid:!1,message:"Add a wheel to the cart first."});return}ie(!0),se.current=f;try{let S=await $.validateCoupon({code:d,items:y,currency:n,shippingMethodId:O??void 0,customerEmail:f});U(En(d,S))}catch{U({code:d,valid:!1,unchecked:!0,message:"Could not check that code. Please try again."})}finally{ie(!1)}},[le,n,O]),pe=w(()=>{U(null),se.current=void 0},[]),Fe=w(l=>{if(!k)return;let{code:f}=k;U(d=>d&&d.code===f?{code:f,valid:!1,refused:!0,message:l}:d)},[k]);W(()=>{if(!k||k.refused)return;let l=k.code,f=y=>y!==null&&y.code===l&&!y.refused,d=setTimeout(async()=>{let y=le();if(y.length===0){U(S=>f(S)?{code:l,valid:!1,message:"Add a wheel to the cart first."}:S);return}ie(!0);try{let S=await $.validateCoupon({code:l,items:y,currency:n,shippingMethodId:O??void 0,customerEmail:se.current});U(ue=>f(ue)?En(l,S):ue)}catch{}finally{ie(!1)}},Dr);return()=>clearTimeout(d)},[a,n,O]);let xe=k&&!k.refused?k.code:void 0;W(()=>{if(t)return;let l=!0,f=a,d=setTimeout(async()=>{let y=le();if(y.length===0){D(null),re(null),he(void 0);return}try{let S=await $.quoteCart({items:y,currency:n,shippingMethodId:O??void 0,couponCode:xe,customerEmail:se.current||void 0,country:K?.country||r||void 0,subdivision:K?.country&&K.subdivision||void 0,postcode:K?.country&&K.postcode||void 0});if(!l)return;D(S),re(f),h(null)}catch{if(!l)return;h(f)}he(xe)},Mr);return()=>{l=!1,clearTimeout(d)}},[a,n,O,xe,r,K,P]);let T=w(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(it,y.qty+l.qty)}:y)}),Cn(l,n)},[n]),J=w(l=>{c(f=>f.filter(d=>d.id!==l))},[]),De=w((l,f)=>{let d=Math.max(1,Math.min(it,f));c(y=>y.map(S=>S.id===l?{...S,qty:d}:S))},[]),Me=w(l=>{c(l)},[]),[vt,Qe]=E(!1),[Et,Gn]=E([]),Pt=j(a);Pt.current=a,W(()=>{if(t)return;let l=[];try{let d=JSON.parse(q.getItem(mt)??"[]");Array.isArray(d)&&(l=d)}catch{}if(l.length===0){Qe(!0);return}let f=!0;return fn(l,$).then(({lines:d,dropped:y})=>{f&&(Pt.current.length===0&&(Me(d),Gn(y)),Qe(!0))},d=>{f&&Qe(!0)}),()=>{f=!1}},[t,Me]),W(()=>{if(t||!vt)return;let l=a.filter(we);if(l.length===0){q.removeItem(mt);return}q.setItem(mt,JSON.stringify(at(l,()=>"")))},[a,t,vt]);let[Se,Kn]=E(null),kt=j(null);kt.current=Se;let z=j(null),Xe=j(""),wt=w((l,f)=>{let d=l.trim().toLowerCase();gn(d)&&Kn(y=>y&&y.email===d&&y.firstName===(f??"")?y:{email:d,firstName:f??""})},[]);W(()=>{if(t||!Se)return;let l=at(a.filter(we),y=>gt(y,n)===null?He:o(gt(y,n),n)),f={email:Se.email,firstName:Se.firstName,currency:n,items:l},d=JSON.stringify(f);if(d!==Xe.current)return z.current&&clearTimeout(z.current),z.current=setTimeout(()=>{z.current=null,Xe.current=d,$.captureCart(f).catch(y=>{})},Ur),()=>{z.current&&(clearTimeout(z.current),z.current=null)}},[a,Se,n,t]);let Rt=w(()=>{z.current&&(clearTimeout(z.current),z.current=null);let l=kt.current;l&&(Xe.current="",$.captureCart({email:l.email,firstName:l.firstName,currency:n,items:[]}).catch(f=>{}))},[n]),Tt=vn(()=>{let l=a.reduce((A,me)=>{let Ue=gt(me,n);return Ue===null?A:A+Ue},0),f=a.some(A=>kn(A,n)===null),d=a.reduce((A,me)=>A+me.qty,0),y=k?.valid?k.effects:void 0,S=y?Math.min(l,Number(y.discountAmount)):0,ue=b?.bundleDiscount??0,Yn=b?.appliedBundles??[],je=!!y?.freeShipping,At=H.find(A=>A.id===O),It=je?0:b?.shipping??At?.amount??0,Qn=Sn({quoted:b!==null,optionCount:H.length,chosenAmount:At?.amount,couponWaivesFreight:je}),Ze={};for(let A of y?.freeUnits??[])Ze[A.partNumber]=(Ze[A.partNumber]??0)+A.quantity;let Xn=b?.tax??null,jn=b?b.grandTotal:l-S-ue+It;return{sets:d,units:a.reduce((A,me)=>A+(me.components??[]).reduce((Ue,Zn)=>Ue+Zn.wheels*me.qty,0),0),subtotal:l,hasUnpricedLine:f,discount:S,bundleDiscount:ue,appliedBundles:Yn,shipping:It,freeShipping:je,shippingStatus:Qn,freeUnitsByPartNumber:Ze,tax:Xn,grand:jn,repricing:!!k?.refused&&b!==null&&oe===k?.code,quoted:b!==null&&G===a,serverSubtotal:b?.subtotal??null,quoteFailed:de===a,currency:n}},[a,n,k,H,O,b,oe,G,de]),Lt=j(!0),_t=w(l=>{Lt.current=l},[]),Nt=w(l=>{T(l),Lt.current&&Y()},[T,Y]),Vn=vn(()=>({isOpen:i,preview:t,open:Y,close:Z,toggle:Ae,items:a,catalog:u,bundles:C,warmCatalog:I,add:T,addAndOpen:Nt,setAutoOpen:_t,remove:J,setQty:De,replaceItems:Me,restoreDropped:Et,identify:wt,clearCapturedCart:Rt,coupon:k,applyCoupon:Ce,removeCoupon:pe,refuseCoupon:Fe,couponBusy:V,deliveryOptions:H,setQuoteDestination:Ie,courier:be,requote:M,shippingMethodId:O,setShippingMethodId:fe,totals:Tt}),[i,t,Y,Z,Ae,a,u,C,I,T,Nt,_t,J,De,Me,Et,wt,Rt,k,Ce,pe,Fe,V,H,Ie,be,M,O,Tt]);return $r(wn.Provider,{value:Vn,children:e})}function Rn(){let e=Fr(wn);if(!e)throw new Error("useCart() must be called inside <CartProvider>. Mount the provider in app/layout.tsx.");return e}import{cache as Qr}from"react";function Tn(e){return/(?:^|\|)(?:slug|xhost):/.test(e)}function Ln(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 Wr=6e4,Br=5e3,Hr=500,ze=new Map;async function zr(e){let{host:t,matchesRequestHost:n}=await Ht();if(!t)return"";let r=await zt();return r?`${e}|slug:${encodeURIComponent(t)}/${encodeURIComponent(r)}`:n?`${e}|host:${t}`:`${e}|xhost:${t}`}async function _n(e,t){if(await qt()!==null)return t();let n=await zr(e);if(!n)return t();let r=Date.now(),o=ze.get(n);if(o&&o.expiresAt>r)return o.load;let i=await t(),s=i.outcome.state==="failed",a=s?Br:Wr,c=ze.get(n)?.lastGood,u=i.outcome.state==="ok"?i:s?c:void 0,m=s&&u?u:i;return Ln(ze,Hr,Tn,r),ze.set(n,{load:m,expiresAt:r+a,lastGood:u}),m}var qr=404;function Gr(e){if(e instanceof X&&e.status===qr)return{state:"absent"};let t=e instanceof X?e.status:-1,n=e instanceof Error?e.message:String(e);return{state:"failed",status:t,detail:n}}var Kr="[storefront:chrome-load-failed]";function Vr(e,t){console.error(`${Kr} ${e} status=${t.status} \u2014 serving fallback chrome`,t.detail)}async function Nn(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=Gr(o);return i.state==="failed"&&Vr(e,i),{value:n,outcome:i}}}function Yr(e){return e==="production"?"silent":"banner"}var Es=Yr("production");function Xr(e,t){return e?.trim()||t}function Ns({legalName:e,foundedYear:t,siteName:n},r=new Date().getFullYear()){let o=Xr(e,n);return`\xA9 ${t&&t<r?`${t}\u2013${r}`:`${r}`} ${o}`}var jr={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:tt},As=Qr(async()=>_n("site",()=>Nn("site",async()=>{let e=await $.getSite();return{name:Ut(e.name),legalName:e.legalName?.trim()||null,foundedYear:e.foundedYear??null,faviconUrl:e.faviconUrl??null,currencies:e.currencies??[],defaultCurrency:e.defaultCurrency??null,countries:e.countries??[],defaultCountry:e.defaultCountry??null,commerceEnabled:e.commerceEnabled??!0,cardPayments:e.cardPayments??!1,paymentMethods:e.paymentMethods??(e.cardPayments?["card"]:[]),paypalClientId:e.paypalClientId??null,paypalEnvironment:e.paypalEnvironment??null,squareApplicationId:e.squareApplicationId??null,squareLocationId:e.squareLocationId??null,squareEnvironment:e.squareEnvironment??null,ga4MeasurementId:e.ga4MeasurementId??null,googleAdsId:e.googleAdsId??null,googleAdsConversionLabel:(e.googleAdsId?e.googleAdsConversionLabel:null)??null,metaPixelId:e.metaPixelId??null,consentEnabled:e.consentEnabled??!1,consentPrivacyPage:e.consentPrivacyPage??null,consentNoticeOptOut:e.consentNoticeOptOut??!1,privacyPage:e.privacyPage??null,termsPage:e.termsPage??null,footerCookieSettings:e.footerCookieSettings??!0,footerSitemap:e.footerSitemap??!0,socialLinks:$t(e.socialLinks)}},jr)));var Is={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:tt};import{jsx as Zr}from"react/jsx-runtime";function Fs({tone:e="bad",role:t,children:n}){return Zr("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 Te,jsxs as yt}from"react/jsx-runtime";import{useEffect as qe,useId as no,useRef as In,useState as Ge}from"react";import{useRootIsDark as ro}from"efficient-shell/theme";import{efficientClientOpen as Jr}from"efficient-easel/screen/lib/session";var Re=new Map,eo=64;async function to(e){if(!Jr())return null;try{let t=await fetch(`${Mt()}/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 An(e){let t=Re.get(e);if(t)return t;let n=to(e);if(Re.set(e,n),Re.size>eo){let r=Re.keys().next();r.done||Re.delete(r.value)}return n}var oo=202/22,io=.88,ea=16,so="invert(1)";function ta({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:L=!1,fitFloorPx:g,hideClass:N,hideAttrs:_,part:F}){let v=C&&C.trim()?C.trim():p,[b,D]=Ge(null),G=In(null),re=T=>{G.current=T};qe(()=>{D(G.current?.ownerDocument??null)},[]);let de=!ro({doc:b,whenUnset:!0}),h=n&&n.trim()?n.trim():null,P=!!h&&Wt(h),x=i??(de&&t),M=o&&o.trim()?o.trim():null,oe=r&&!M,he=`logo-color-${no().replace(/[^A-Za-z0-9_-]/g,"")}`,K=oe&&P&&h&&s!=null?{reversed:s,inkIsDark:a??null}:null,Ne=K!==null,[k,U]=Ge(null);qe(()=>{if(!oe||!h||!P||Ne){U(null);return}let T=!1;return U(null),An(h).then(J=>{T||U(J)}),()=>{T=!0}},[oe,h,P,Ne]);let V=K??k,ie=!!V&&V.inkIsDark!==null&&(x?!V.inkIsDark:V.inkIsDark),O=oe&&!!h&&!P&&!x,fe=ie&&V?V.reversed:h,se=fe?[fe]:[],[Y,Z]=Ge(0);qe(()=>{Z(0)},[h,ie]);let Ae=e==="footer"?et:Je[c],B=u&&u>0?u:Ae,Q=(u&&u>0?Ot(u,m,"size",Dt):null)??`${B}px`,Ie=Math.round(B*oo),I=Y<se.length?se[Y]:null,[Oe,ae]=Ge(fe),H=I!==null&&I===Oe,be=In(null);qe(()=>{let T=be.current;if(!T||!T.complete)return;if(T.naturalWidth>0||T.naturalHeight>0){ae(I);return}let J=!1;return T.decode().then(()=>!J&&ae(I),()=>!J&&Z(De=>De+1)),()=>{J=!0}},[I]);let le=R||L,Ce=`calc(100cqi / ${((v.length+1)*io).toFixed(2)})`,pe=le&&g&&g>0?Q===`${B}px`?`${Math.min(g,B)}px`:`min(${g}px, ${Q})`:null,Fe=le?pe===null?`min(${Q}, ${Ce})`:`clamp(${pe}, ${Ce}, ${Q})`:Q,xe=yt("span",{className:`font-display font-bold tracking-[0.18em] ${pe===null?"whitespace-nowrap":"whitespace-normal"}`,style:{fontSize:Fe,lineHeight:1,...M?{color:M}:{}},"aria-label":v,children:[v,Te("span",{className:"text-accent",style:M?{color:M}:void 0,children:"."})]});return yt("span",{ref:re,className:Ft("inline-flex items-center",N??""),..._,...F,children:[!H&&xe,M&&I&&Te("svg",{"aria-hidden":"true",focusable:"false",width:"0",height:"0",style:{position:"absolute"},children:yt("filter",{id:he,colorInterpolationFilters:"sRGB",children:[Te("feFlood",{style:{floodColor:M}}),Te("feComposite",{in2:"SourceAlpha",operator:"in"})]})}),I&&Te("img",{ref:be,src:I,alt:v,width:Ie,height:B,className:"shrink-0 object-contain",style:{...H?{height:Q,width:"auto",...R?{maxWidth:"100cqi"}:{}}:{display:"none"},...O?{filter:so}:{},...M?{filter:`url(#${he})`}:{}},onLoad:()=>ae(I),onError:()=>Z(T=>T+1)},I)]})}var ra="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",On="w-0 min-w-0 flex-1",oa="w-0 min-w-[7rem] flex-1";import{jsx as Le,jsxs as lo}from"react/jsx-runtime";function ao({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 lo("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:[Le("circle",{cx:100,cy:100,r:92,strokeWidth:2}),Le("circle",{cx:100,cy:100,r:84,strokeWidth:1,opacity:.4}),Le("circle",{cx:100,cy:100,r:22,strokeWidth:2}),Le("circle",{cx:100,cy:100,r:6,fill:"currentColor"}),a.map((c,u)=>Le("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 la="#c9a461",Fn=[{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"}],ua={name:"",color:"var(--fg)",family:"silver",src:""};function uo(e,t){let n=r=>{let o=Fn.findIndex(i=>i.f===r);return o===-1?Fn.length:o};return n(e)-n(t)||e.localeCompare(t)}function ca(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(uo)}import{useEffect as co,useRef as Dn,useState as fo}from"react";import{jsx as ce,jsxs as ht}from"react/jsx-runtime";function po({customerEmail:e,disabled:t=!1}){let{coupon:n,applyCoupon:r,removeCoupon:o,couponBusy:i}=Rn(),[s,a]=fo(""),c=Dn(!1),u=Dn(null);co(()=>{!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 ht("div",{className:"flex flex-col gap-2",children:[n===null?ht("div",{className:"flex border border-line",children:[ce("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:`${On} bg-transparent px-4 py-4 font-mono text-[11px] uppercase tracking-[0.18em] text-fg outline-none placeholder:text-fg-dim`}),ce("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"})]}):ht("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:[ce("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&&ce("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&&ce("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?ce("p",{className:"font-mono text-[10px] uppercase tracking-[0.18em] text-fg-dim",children:sn}):n&&!n.valid&&n.message&&ce("p",{role:"alert",className:"font-mono text-[10px] uppercase tracking-[0.18em] text-alert",children:n.message})]})}var bt="Ads on. Shopper can opt out.",Ke="Ads and analytics off until Accept",mo={us:{region:"us",name:"United States",model:"opt-out",law:"California CCPA / CPRA, other state laws",beforeChoice:bt,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:Ke,footerLink:"Privacy choices",panelEyebrow:"Privacy choices",adsRowName:"Advertising"},au:{region:"au",name:"Australia",model:"opt-out",law:"Privacy Act 1988 (APPs)",beforeChoice:bt,footerLink:"Privacy choices",panelEyebrow:"Privacy choices",adsRowName:"Advertising"},nz:{region:"nz",name:"New Zealand",model:"opt-out",law:"Privacy Act 2020",beforeChoice:bt,footerLink:"Privacy choices",panelEyebrow:"Privacy choices",adsRowName:"Advertising"},uk:{region:"uk",name:"United Kingdom",model:"opt-in",law:"PECR, UK GDPR",beforeChoice:Ke,footerLink:"Cookie settings",panelEyebrow:"Cookie settings",adsRowName:"Advertising"},eu:{region:"eu",name:"European Union",model:"opt-in",law:"ePrivacy Directive, GDPR",beforeChoice:Ke,footerLink:"Cookie settings",panelEyebrow:"Cookie settings",adsRowName:"Advertising"},other:{region:"other",name:"All other countries",model:"opt-in",law:"Safe default",beforeChoice:Ke,footerLink:"Cookie settings",panelEyebrow:"Cookie settings",adsRowName:"Advertising"}};function go(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 ba(e,t,n){let r=go(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 Ca={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 yo={asked:!1,region:"other",model:"opt-in",analytics:!0,ads:!0,chosen:!0,gpc:!1};var ho=yo;function Ea(e=ho){if(e.asked)return e.ads?"granted":"denied"}function ka(){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 Co,isValidElement as xo,useEffect as Un,useId as So,useLayoutEffect as Bn,useRef as te,useState as $n}from"react";var Ve=(e,t)=>!!e[t]&&!e[t].disabled;function Ct(e,t,n){let r=e.length;for(let o=1;o<=r;o++){let i=((t+n*o)%r+r)%r;if(Ve(e,i))return i}return t}function xt(e,t){return Ct(e,t===1?-1:e.length,t)}function St(e,t){return Ve(e,t)?t:Math.max(xt(e,1),0)}function Mn(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)=>Ve(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:Ct(n,o,1)}),handled:!0};case"ArrowUp":return{state:i({focus:Ct(n,o,-1)}),handled:!0};case"Home":return{state:i({focus:xt(n,1)}),handled:!0};case"End":return{state:i({focus:xt(n,-1)}),handled:!0};case"Enter":case" ":return Ve(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 vo}from"efficient-shell/ui";import{Fragment as Lo,jsx as ne,jsxs as Hn}from"react/jsx-runtime";var Wn={body:"text-[length:var(--size-body,14px)]",label:"text-[length:var(--size-label,13px)]"};function Eo({items:e,value:t,onPick:n,open:r,onOpen:o,onClose:i}){let[s,a]=$n(!1),c=r!==void 0,u=c?r:s,[m,C]=$n(0),p=te({text:"",timer:0}),R=te(null),L=te(null),g=te(null),N=So(),_=te(null),F=e.findIndex(h=>h.value===t),v=h=>{h!==u&&(c||a(h),h?o?.():i?.())},b=h=>{let P=e[h];!P||P.disabled||(n(P.value),v(!1),L.current?.focus())},D=h=>{let P={open:u,focus:u?m:St(e,F),typed:p.current.text},x=Mn(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):v(x.state.open),x.refocus&&L.current?.focus(),x.handled)},G=te(D);G.current=D;let re=te(()=>v(!1));re.current=()=>v(!1);let de=h=>{u||(_.current=h.nativeEvent,G.current(h.key)&&h.preventDefault())};return Un(()=>{if(!u)return;let h=x=>{R.current?.contains(x.target)||re.current()},P=x=>{x!==_.current&&G.current(x.key)&&x.preventDefault()};return document.addEventListener("mousedown",h),document.addEventListener("keydown",P),()=>{document.removeEventListener("mousedown",h),document.removeEventListener("keydown",P)}},[u]),Un(()=>{u&&(p.current.text||C(St(e,F)))},[u]),Bn(()=>{if(!u||!g.current)return;g.current.children.item(m)?.scrollIntoView({block:"nearest"})},[m,u]),{open:u,toggle:()=>v(!u),close:()=>v(!1),focusIdx:m,setFocusIdx:C,pick:h=>b(e.findIndex(P=>P.value===h)),wrapRef:R,triggerRef:L,listRef:g,listId:N,onTriggerKeyDown:de,activeId:u?`${N}-${m}`:void 0}}var Po={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 ${Wn.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 ${Wn.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 ko(e,t){Bn(()=>{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=vo({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 wo(e){return e.split(" ").map(t=>t==="left-0"?"right-0":t).join(" ")}function Ro({id:e,tone:t,items:n,value:r,focusIdx:o,onFocus:i,onPick:s,listRef:a,ariaLabel:c,align:u="start"}){let m=Po[t],C=te(null);return ko(C,n.length),ne("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"?wo(m.list):m.list,children:n.map((p,R)=>{let L=p.value===r;return ne("li",{id:`${e}-${R}`,role:"option","aria-selected":L,"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,L&&p.value!=="",!!p.disabled,R===n.length-1),style:m.itemStyle?.(L),children:p.meta===void 0?p.label:Hn(Lo,{children:[p.lead,ne("span",{className:"flex-1 whitespace-nowrap",children:p.label}),ne("span",{className:"ml-auto text-[12px] opacity-50",children:p.meta})]})},`${p.value}_${R}`)})})}function To({value:e,onChange:t,disabled:n,children:r,className:o,style:i,name:s,id:a,"aria-label":c,align:u}){let m=Co.toArray(r).flatMap(g=>{if(!xo(g))return[];if(g.type!=="option")return[];let _=g.props,F=_.value!==void 0?String(_.value):"",v=_.children,b=typeof v=="string"||typeof v=="number"?String(v):F;return[{value:F,label:b,disabled:!!_.disabled}]}),C=e??"",p=Eo({items:m,value:C,onPick:g=>t?.({target:{value:g}})}),L=m.find(g=>g.value===C)?.label??m[0]?.label??"";return Hn("div",{ref:p.wrapRef,className:"relative",children:[s&&ne("input",{type:"hidden",name:s,value:C}),ne("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:ne("span",{className:"block w-full truncate text-left",children:L})}),p.open&&ne(Ro,{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 _e,jsxs as Ye}from"react/jsx-runtime";var _o="font-mono text-[length:var(--size-label,12px)]",No="font-semibold uppercase tracking-[0.22em] text-fg";function zn(e){return`${e??_o} ${No}`}function qn(){return _e("span",{className:"text-accent",children:" *"})}function Ao({children:e,required:t,labelFace:n}){return Ye("span",{className:zn(n),children:[e,t?_e(qn,{}):null]})}function Io({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?_e("span",{className:"font-mono text-[11px] uppercase tracking-[0.22em] text-fg-dim",children:n}):null;return r||n?Ye("div",{className:c,children:[Ye("label",{htmlFor:o,className:zn(i),children:[e,t?_e(qn,{}):null]}),a,u]}):Ye("label",{htmlFor:o,className:c,children:[_e(Ao,{required:t,labelFace:i,children:e}),a]})}export{nn as a,Qo as b,Xo as c,jo as d,Kt as e,nt as f,Oo as g,Fo as h,Qt as i,Jn as j,ot as k,Xt as l,Do as m,it as n,$e as o,ee as p,Mo as q,Uo as r,ar as s,ei as t,lt as u,ye as v,ti as w,ii as x,Pe as y,si as z,ai as A,li as B,pr as C,an as D,We as E,gr as F,ln as G,yi as H,hi as I,ct as J,un as K,Cr as L,xi as M,Si as N,vi as O,He as P,Ni as Q,pn as R,Ai as S,Ii as T,mn as U,Oi as V,ft as W,Fi as X,Di as Y,kr as Z,Mi as _,Ui as $,wr as aa,$i as ba,Wi as ca,Bi as da,Hi as ea,gn as fa,Yi as ga,Qi as ha,Xi as ia,Ji as ja,es as ka,zo as la,tn as ma,qo as na,we as oa,gt as pa,gs as qa,Rn as ra,Ns as sa,jr as ta,Is as ua,ra as va,On as wa,oa as xa,ao as ya,la as za,Fn as Aa,ua as Ba,uo as Ca,ca as Da,po as Ea,Fs as Fa,ea as Ga,ta as Ha,mo as Ia,ba as Ja,Ca as Ka,yo as La,Ea as Ma,ka as Na,Eo as Oa,Ro as Pa,To as Qa,Ao as Ra,Io as Sa};
|