efficient-storefront-blocks 0.81.0 → 0.82.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +1 -1
  3. package/dist/chunks/{EditorPreviewCheckout-OIN6G67Y.js → EditorPreviewCheckout-XM22X3CX.js} +1 -1
  4. package/dist/chunks/{SiteEditorProvider-PXXYEDUI.js → SiteEditorProvider-5YHSOW4Y.js} +1 -1
  5. package/dist/chunks/{chunk-EEBM2KUO.js → chunk-47L7KHRW.js} +1 -1
  6. package/dist/chunks/{chunk-K3VUREAB.js → chunk-NSBGNY7R.js} +1 -1
  7. package/dist/chunks/{chunk-SXRBNRRO.js → chunk-VIPMT34C.js} +1 -1
  8. package/dist/chunks/{fitment-data-WHDQR3A2.js → fitment-data-SZWTO4WT.js} +1 -1
  9. package/dist/editor/components/CategoryProductFields.d.ts +4 -1
  10. package/dist/editor/components/CategoryProductFields.js +1 -1
  11. package/dist/editor/components/EditReviewsLink.d.ts +4 -0
  12. package/dist/editor/components/EditReviewsLink.js +1 -0
  13. package/dist/editor/components/GalleryShowcaseSource.js +1 -1
  14. package/dist/editor/components/ProductHeroSource.js +1 -1
  15. package/dist/editor/components/ProductPicker.js +1 -1
  16. package/dist/editor/components/ReviewsProductSource.d.ts +26 -0
  17. package/dist/editor/components/ReviewsProductSource.js +1 -0
  18. package/dist/editor/components/SpecTableSource.js +1 -1
  19. package/dist/editor/lib/document/blocks/service/ReviewForm/fields.js +1 -1
  20. package/dist/editor/lib/document/blocks/service/Reviews/fields.js +1 -1
  21. package/dist/editor/lib/storefront-editor-words.d.ts +4 -1
  22. package/dist/editor/lib/storefront-editor-words.js +1 -1
  23. package/dist/index.js +36 -28
  24. package/dist/render/app/globals.css +52 -3
  25. package/dist/render/components/ChatContext.js +1 -1
  26. package/dist/render/lib/document/blocks/text-part-shapes.json +0 -14
  27. package/dist/render/lib/sections/reviews.d.ts +7 -0
  28. package/dist/render/lib/sections/reviews.js +1 -1
  29. package/dist/words.d.ts +4 -1
  30. package/dist/words.js +1 -1
  31. package/package.json +3 -3
  32. package/dist/editor/lib/document/blocks/service/placeholders.d.ts +0 -1
  33. package/dist/editor/lib/document/blocks/service/placeholders.js +0 -1
  34. /package/dist/chunks/{chunk-5O3W5AUB.js → chunk-T2R5CZ2F.js} +0 -0
  35. /package/dist/chunks/{chunk-SXRBNRRO.js.LEGAL.txt → chunk-VIPMT34C.js.LEGAL.txt} +0 -0
  36. /package/dist/chunks/{chunk-PBQWSV3B.js → chunk-VVWX2P2N.js} +0 -0
@@ -1,4 +1,4 @@
1
- import{$ as jI,B as NI,C as MI,D as HI,Da as ie,F as zI,G as hf,Ha as og,I as WI,Ia as tg,J as To,K as dr,Ka as Sl,L as GI,La as rg,M as rt,Ma as ag,N as yl,Q as UI,R as xf,Ra as ng,U as $I,V as If,X as gf,a as Dt,b as ff,fa as fr,h as FI,ha as KI,i as uf,j as pf,ja as qI,k as ao,l as AI,la as VI,m as LI,ma as Mo,n as fa,na as ma,o as tt,oa as YI,p as ua,pa as mt,q as pa,qa as bf,ra as ha,s as BI,v as bn,va as yn,x as DI,xa as XI,y as mf,za as ZI}from"./chunk-5O3W5AUB.js";import{d as JI,e as Nt,f as QI,g as eg,j as xa,n as yf}from"./chunk-PBQWSV3B.js";var he=e=>typeof e=="string"&&e?e:void 0;var lg="en",wl=null,ig=lg,cg=null;function EZ(e,o,t){wl=e??null,ig=o||lg,cg=t??null}function ee(){return cg}function Sf(){return ig}function dg(){return wl}function sg(e,o){return o?e.replace(/\{([A-Za-z][A-Za-z0-9_]*)\}/g,(t,r)=>Object.prototype.hasOwnProperty.call(o,r)?String(o[r]):t):e}function i(e,o){let t=wl?wl[e]:void 0;if(typeof t=="function"){try{let r=he(t(o??{}));if(r)return r}catch{}return sg(e,o)}return sg(he(t)??e,o)}function fo(e,o,t,r){return i(t===1?e:o,{...r,n:t})}import{jsx as wf,Fragment as OF,jsxs as _F}from"react/jsx-runtime";import{createContext as RF,useContext as FF}from"react";var AF={mirrorHostStyles:!0,css:null,fontHrefs:[]},fg=RF(AF);function FZ({value:e,children:o}){return wf(fg.Provider,{value:e,children:o})}function Cf(){return FF(fg)}function ug(){let{css:e,fontHrefs:o}=Cf();return _F(OF,{children:[o.map(t=>wf("link",{rel:"stylesheet",href:t},t)),e?wf("style",{"data-sf-canvas-css":"",children:e}):null]})}import{jsx as LF}from"react/jsx-runtime";import{createContext as BF,useContext as DF}from"react";var pg=BF(void 0);function DZ({metadata:e,children:o}){return LF(pg.Provider,{value:e,children:o})}var mg=()=>DF(pg);import{jsx as to,Fragment as cF,jsxs as xl}from"react/jsx-runtime";import{useCallback as Il,useEffect as pt,useRef as oZ,useState as nF}from"react";import{SettingsSwitch as tZ}from"efficient-easel/panel";import{PagesIcon as rZ,StylesIcon as aZ}from"efficient-easel/rail";import{PaletteIcon as nZ}from"efficient-shell/icons/efficient";import{Subtree as sZ,TreeRow as dF}from"efficient-easel/tree";import{useEasel as fF}from"efficient-easel/easel";import{useEaselStrings as uF}from"efficient-easel/strings";import{createContext as NF,useContext as MF}from"react";var vf=NF(!1),HZ=()=>MF(vf);import{jsx as be,Fragment as wv,jsxs as Qn}from"react/jsx-runtime";import{Fragment as gz,useEffect as bz,useId as yz,useMemo as Cv,useRef as Sz,useState as Xt}from"react";import{useScreenDocument as Rv}from"efficient-easel/screen/components/ScreenDocumentContext";import{UiIcon as Im}from"efficient-easel/draw/client";import wz from"efficient-easel/screen/components/SidePanelHead";import{jsx as te,Fragment as Hr,jsxs as Mr}from"react/jsx-runtime";import{useEasel as pv,useRootFields as y6}from"efficient-easel/easel";import{Inspector as S6}from"efficient-easel/fields";import{SettingsGroup as w6}from"efficient-easel/panel";import{useEffect as C6,useRef as v6,useState as fc}from"react";import{jsx as pr,Fragment as gA,jsxs as bA}from"react/jsx-runtime";import{useState as Pg}from"react";import{SettingsDefaultReset as yA,SettingsField as SA}from"efficient-easel/panel";import{useEaselStrings as wA}from"efficient-easel/strings";import{AddIcon as CA}from"efficient-easel/icons";import{Button as vA}from"efficient-shell/ui";import{iconOf as kA,noGlyph as PA}from"efficient-easel/screen/lib/document/box-fields";import{jsx as oe,jsxs as Ht,Fragment as oA}from"react/jsx-runtime";import{parseHexColor as tA}from"efficient-shell/format";import{Button as Tf,IconButton as rA,Tooltip as aA}from"efficient-shell/ui";import{jsx as Mt,jsxs as qF}from"react/jsx-runtime";import{AccentIcon as VF}from"efficient-easel/icons";import{Button as YF,Tooltip as XF}from"efficient-shell/ui";import{jsx as ur,jsxs as Ig}from"react/jsx-runtime";import{ColorPicker as zF,HexInput as WF}from"efficient-shell/ui";import{SettingsDefaultReset as GF,SettingsField as UF}from"efficient-easel/panel";import{typedHex as kf}from"efficient-easel/pick";import{typedHex as HF}from"efficient-easel/pick";function hg(e){let o=new Set,t=[];return ao(e).themes.forEach((r,a)=>{let n=[[i("Theme {n} main color",{n:a+1}),r.accent],[i("Theme {n} text color",{n:a+1}),r.text],[i("Theme {n} background",{n:a+1}),r.background]];for(let[s,l]of n){let c=l?HF(l):null;!c||o.has(c)||(o.add(c),t.push({name:s,value:c}))}}),t}var xg="Not set";function $F({value:e,onChange:o,label:t,id:r,caption:a,inherited:n,ariaLabel:s}){return ur(KF,{value:e,onChange:o,label:i(s??t),id:r,caption:a,inherited:n})}function jF(){let{theme:e}=ie();return hg(e).map(o=>({value:o.value,label:o.name}))}function KF({value:e,onChange:o,label:t,id:r,caption:a,inherited:n}){let s=jF(),l=e?null:kf(n??""),c=a!==void 0&&(!e||kf(a)!==kf(e))?a:null,d=u=>{u!==e&&o(u)};return Ig("div",{className:"sf-colour",children:[ur(zF,{id:r,value:e,onChange:d,label:t,presets:s,fallback:l??void 0,size:"md",align:"start"}),c!==null?ur("span",{className:"sf-colour-caption",children:c}):ur("span",{className:"sf-colour-hexwrap",children:ur(WF,{value:e||l||"",onChange:d,label:i("{label} hex code",{label:t}),placeholder:e||l?void 0:i(xg),className:l?"sf-colour-hex is-inherited":"sf-colour-hex",size:"md"})})]})}function Eo({label:e,icon:o,changed:t,hint:r,onReset:a,resetTo:n,children:s,...l}){return Ig(UF,{label:e,icon:o,htmlFor:l.id,changed:t,hint:r,action:a?ur(GF,{words:ee()?.panel,label:e,changed:!!t,detail:n,onReset:a}):void 0,children:[$F({...l,label:e}),s]})}function Cl({label:e,icon:o,value:t,inherited:r,resetTo:a,onChange:n,onReset:s,hint:l}){let c=!!t;return ur(Eo,{label:e,icon:o,value:t,inherited:c?void 0:r,onChange:n,changed:c,onReset:s,resetTo:a,hint:l})}function Pf(e){return tt(e).background}function ZF(e){let o=Dt(e.accent,Pf(e));return o===null?null:{ratio:o,grade:pa(o)}}function JF(e){let o=Pf(e),t=Dt(e.accent,o);return t===null?[]:BI(e.accent).filter(r=>{let a=Dt(r,o);return a!==null&&a>t&&pa(a)==="good"})}var QF={good:"Easy to read","large-only":ua["large-only"],hard:ua.hard};function gg({value:e,onChange:o}){let t=ZF(e),r=t?.grade,a=t&&t.grade!=="good"?JF(e):[];return Mt(Eo,{label:i("Main color"),icon:Mt(VF,{}),hint:t?i(QF[t.grade]):void 0,value:e.accent,onChange:n=>o({...e,accent:n}),children:a.length>0?Mt("div",{className:"w-full min-w-0",children:qF("div",{className:"sf-readability",children:[Mt("p",{className:"sf-readability-advice",children:eA(r,!0)}),Mt("div",{className:"sf-readability-suggestions",children:a.map(n=>{let s=Dt(n,Pf(e));return Mt(XF,{content:i("Use {colour}",{colour:n.toUpperCase()}),children:Mt(YF,{variant:"secondary",className:"sf-readability-suggestion",leftIcon:Mt("span",{className:"sf-readability-chip",style:{background:n},"aria-hidden":!0}),onClick:()=>o({...e,accent:n}),children:s?`${s.toFixed(1)}:1`:n.toUpperCase()})},n)})})]})}):null})}function eA(e,o){return e?e==="good"?i("This color reads clearly on your pages."):o?i("This color is hard to read on this theme's page. The buttons below are the same hue, darkened."):i("This color is hard to read on your page background. Pick one further from it \u2014 lighter if your pages are dark, deeper if they are light."):i("Pick a color to see how it reads.")}import{ButtonIcon as nA,ChevronDownIcon as yg,ChevronUpIcon as sA,GroundIcon as lA,LayoutIcon as iA,SquareIcon as cA,TextSmallIcon as dA,TypeIcon as bg}from"efficient-easel/icons";var Sn=e=>i("Theme {n}",{n:e+1});function Sg({colors:e}){let o=tt(e),t=bn(e)??o.accent;return Ht("span",{className:"sf-theme-page",style:{background:o.background,color:o.text},"aria-hidden":!0,children:[oe("span",{className:"sf-theme-eyebrow",style:{color:o.muted},children:i("label")}),Ht("span",{className:"sf-theme-headline",children:[i("Heading")," ",oe("span",{style:{color:o.accent},children:i("accent")})]}),oe("span",{className:"sf-theme-body",children:i("body text")}),Ht("span",{className:"sf-theme-row",children:[oe("span",{className:"sf-theme-btn",style:{background:t,color:mf(e,o.accent)},children:i("button")}),oe("span",{className:"sf-theme-mini",style:{background:o.surface,borderColor:o.line},children:i("card")})]})]})}var Ef={"Text color":oe(bg,{}),"Label color":oe(dA,{}),Background:oe(lA,{}),"Panels & cards":oe(iA,{}),Borders:oe(cA,{}),"Button color":oe(nA,{}),"Button text color":oe(bg,{})};function fA({label:e,colorKey:o,value:t,onChange:r,idPrefix:a="sf-theme-ink"}){let n=`${a}-${o}`;return oe(Eo,{label:i(e),icon:Ef[e],id:n,value:t,onChange:s=>r(o,s)})}function uA({value:e,accent:o,onChange:t,idPrefix:r="sf-theme-ink"}){let a=`${r}-button`,n=e!==void 0&&tA(e)===e.toLowerCase(),s=n?e:o;return oe(Eo,{label:i("Button color"),icon:Ef["Button color"],id:a,value:s,caption:n?s:i("Main"),onChange:t})}function pA({colors:e,accent:o,onChange:t,idPrefix:r="sf-theme-ink"}){let a=`${r}-button-ink`,n=DI(e),s=mf(e,o),l=bn(e)??o,c=pa(Dt(s,l)??0);return oe(Eo,{label:i("Button text color"),icon:Ef["Button text color"],hint:n&&c!=="good"?i("{grade} on the button",{grade:i(ua[c])}):void 0,id:a,value:s,caption:n?s:i("Auto"),onChange:t})}var mA=[{colour:!0},{label:"Text color",key:"text"},{label:"Label color",key:"muted"},{button:!0},{buttonInk:!0},{moduleBreak:!0},{label:"Background",key:"background"},{label:"Panels & cards",key:"surface"},{label:"Borders",key:"line"}];function Of({colors:e,onChange:o,idPrefix:t}){let r=tt(e);return oe(oA,{children:mA.map(a=>"colour"in a?oe(gg,{value:e,onChange:o},"colour"):"moduleBreak"in a?oe("div",{className:"sf-theme-module-break","aria-hidden":"true"},"module-break"):"button"in a?oe(uA,{value:e.button,accent:r.accent,onChange:n=>o({...e,button:n}),idPrefix:t},"button"):"buttonInk"in a?oe(pA,{colors:e,accent:r.accent,onChange:n=>o({...e,buttonInk:n}),idPrefix:t},"buttonInk"):oe(fA,{label:a.label,colorKey:a.key,value:r[a.key],onChange:(n,s)=>o({...e,[n]:s}),idPrefix:t},a.key))})}function vl({index:e,colors:o,selected:t,role:r="radio",open:a,editable:n=!0,onPick:s,onEdit:l,onChangeColors:c}){let d=tt(o),u=Sn(e),h=e<pf.length&&!o.brandInk?pf[e]:null,p=pa(Dt(d.text,d.background)??0),x=h?JSON.stringify(o)!==JSON.stringify(h):!1,g=a!==void 0;return Ht("div",{className:`sf-theme-card${t?" is-selected":""}`,children:[oe("button",{type:"button",role:r,"aria-checked":r==="radio"?t:void 0,"aria-selected":r==="option"?t:void 0,"aria-label":u,className:"sf-theme-pick",onClick:s,children:oe(Sg,{colors:o})}),Ht("div",{className:"sf-theme-foot",children:[oe("span",{className:"sf-theme-name",children:u}),p!=="good"&&oe("span",{className:"sf-theme-warn",children:i(ua[p])}),n&&l&&g&&oe("span",{className:"sf-theme-edit",children:oe(aA,{content:a?i("Collapse"):i("Edit colors"),children:oe(rA,{size:"sm","aria-expanded":a,"aria-controls":`sf-theme-colours-${e}`,"aria-label":a?i("Collapse {name}",{name:u}):i("Edit colors for {name}",{name:u}),onClick:l,children:a?oe(sA,{size:14}):oe(yg,{size:14})})})}),n&&l&&!g&&oe(Tf,{variant:"secondary",size:"sm",className:"sf-theme-edit","aria-label":i("Edit {name}",{name:u}),onClick:l,children:i("Edit")})]}),a&&Ht("div",{id:`sf-theme-colours-${e}`,className:"sf-theme-colours",children:[oe(Of,{colors:o,onChange:y=>c?.(y)}),h&&oe(Tf,{variant:"link",size:"sm",className:"sf-theme-reset",disabled:!x,onClick:()=>c?.({...h}),children:x?i("Reset {name} to the preset",{name:u}):i("Not changed")})]})]})}function wg({colors:e,name:o,nameId:t,open:r,menuId:a,labelId:n,buttonRef:s,onClick:l,onKeyDown:c,onEdit:d}){return Ht("div",{className:"sf-secttheme-btn",children:[oe("button",{ref:s,type:"button",className:"sf-theme-pick","aria-expanded":r,"aria-controls":a,"aria-labelledby":`${n} ${t}`,onClick:l,onKeyDown:c,children:e?oe(Sg,{colors:e}):oe("span",{className:"sf-secttheme-nopreview","aria-hidden":"true"})}),Ht("div",{className:"sf-theme-foot",children:[oe("span",{id:t,className:"sf-theme-name",children:o}),d&&oe(Tf,{variant:"secondary",size:"sm",className:"sf-theme-edit","aria-label":i("Edit {name}",{name:o}),onClick:d,children:i("Edit")}),oe("button",{type:"button",className:"sf-secttheme-caret","aria-hidden":"true",tabIndex:-1,onClick:l,children:oe(yg,{size:12,className:"sf-multi-caret","aria-hidden":"true"})})]})]})}import{jsx as kl,Fragment as hA,jsxs as Cg}from"react/jsx-runtime";import{Button as vg,Dialog as xA}from"efficient-shell/ui";function IA(e){return fo("This site has {n} color theme of its own. Clearing takes them away and puts back the four the shop supplies.","This site has {n} color themes of its own. Clearing takes them away and puts back the four the shop supplies.",e)}function kg({count:e,onCancel:o,onConfirm:t}){return Cg(xA,{open:!0,onClose:o,role:"alertdialog",size:"sm",title:i("Clear this site\u2019s colors?"),footer:Cg(hA,{children:[kl(vg,{variant:"secondary",onClick:o,children:i("Cancel")}),kl(vg,{variant:"danger",onClick:t,children:i("Clear colors")})]}),children:[kl("p",{children:IA(e)}),kl("p",{className:"mt-2 font-medium",children:i("This cannot be undone.")})]})}var TA=PA("the row's whole content is an action; the gutter names a subject and this row has none \u2014 the button's label is the name GG, 2026-09-23"),EA="Reset color",OA={selected:0,themes:[]};function _A(e){e(OA)}function Tg({value:e,onChange:o}){let t=e?.themes??[],r=t.length===0,a=ao(e),[n,s]=Pg(!1),l=wA(),[c,d]=Pg(null),u=(_,w)=>{o({...a,themes:a.themes.map((I,v)=>v===_?w:I)})},h=fa(a).accent,p=new Set(a.themes.map(_=>_.brandInk).filter(Boolean)),x=AI.filter(_=>!p.has(_)).map(_=>LI(h,_)),g=[...a.themes,...x],y=_=>{if(_<a.themes.length)return o({...a,selected:_});let w=[...a.themes,g[_]];o({...a,themes:w,selected:w.length-1})},E=()=>{let _=[...a.themes,{...tt(a.themes[a.selected])}];o({...a,themes:_,selected:_.length-1}),d(_.length-1)};return bA(gA,{children:[r?null:pr(SA,{label:i(EA),icon:kA(TA),labelId:"sf-theme-reset",action:pr(yA,{label:i("all theme colors"),words:l.panel,changed:!0,onReset:()=>s(!0)})}),n&&pr(kg,{count:t.length,onCancel:()=>s(!1),onConfirm:()=>{s(!1),_A(o)}}),pr("div",{className:"sf-theme-list",role:"radiogroup","aria-label":i("Theme"),children:g.map((_,w)=>pr(vl,{index:w,colors:_,selected:w===a.selected,open:c===w&&w<a.themes.length,editable:w<a.themes.length,onPick:()=>y(w),onEdit:()=>d(I=>I===w?null:w),onChangeColors:I=>u(w,I)},w))}),pr(vA,{variant:"secondary",leftIcon:pr(CA,{}),onClick:E,className:"sf-theme-add",children:i("Add new theme")})]})}import{jsx as Ni}from"react/jsx-runtime";import{SettingsDefaultReset as k5,SettingsField as P5}from"efficient-easel/panel";import{SquareIcon as T5}from"efficient-easel/icons";import{jsx as S,jsxs as Fa,Fragment as qt}from"react/jsx-runtime";import{cloneElement as tw,createContext as hM,useContext as xM,useEffect as IM,useId as rw,useRef as vi,useState as Nn}from"react";import{useEasel as tp,useSelectedHost as Ti}from"efficient-easel/easel";import{toDateKey as Vne,fromDateKey as Yne}from"efficient-shell/format";function RA(e){return!!e&&typeof e=="object"&&!Array.isArray(e)&&typeof e.src=="string"}function zt(e){return typeof e=="string"?e:RA(e)?e.src:""}function AJ(e,o,t){return _f(e,o.split("."),t)}function _f(e,o,t){if(o.length===0)return t(e);let[r,...a]=o,n=r.endsWith("[]"),s=n?r.slice(0,-2):r;if(!e||typeof e!="object"||Array.isArray(e))return e;let l=e;if(!(s in l))return e;let c=l[s];if(n){if(!Array.isArray(c))return e;let u=!1,h=c.map(p=>{let x=_f(p,a,t);return x!==p&&(u=!0),x});return u?{...l,[s]:h}:e}let d=_f(c,a,t);return d===c?e:{...l,[s]:d}}var FA=["upload","youtube"],AA="upload",DJ={upload:"Upload",youtube:"YouTube"},LA=["background","click"],BA="background",NJ={background:"Background",click:"Click to play"};function Og(e){return FA.includes(e)?e:AA}function _g(e){return LA.includes(e)?e:BA}var Eg=/^[A-Za-z0-9_-]{11}$/,DA=/^(?:www\.|m\.|music\.)?(?:youtube\.com|youtube-nocookie\.com|youtu\.be)$/;function Rg(e){let o=typeof e=="string"?e.trim():"";if(!o)return null;if(Eg.test(o))return o;let t;try{t=new URL(/^[a-z]+:\/\//i.test(o)?o:`https://${o}`)}catch{return null}if(t.protocol!=="https:"&&t.protocol!=="http:"||!DA.test(t.hostname))return null;let r=t.pathname.split("/").filter(Boolean),a=t.hostname.endsWith("youtu.be")?r[0]:r[0]==="watch"?t.searchParams.get("v"):r[0]==="embed"||r[0]==="shorts"||r[0]==="live"||r[0]==="v"?r[1]:null;return a&&Eg.test(a)?a:null}function Rf(e,o){let t=o==="click"?"autoplay=1&playsinline=1&rel=0":`autoplay=1&mute=1&loop=1&playlist=${e}&controls=0&playsinline=1&rel=0&disablekb=1`;return`https://www.youtube-nocookie.com/embed/${e}?${t}`}function Fg(e){return`https://i.ytimg.com/vi/${e}/maxresdefault.jpg`}function Ag(e){return`https://i.ytimg.com/vi/${e}/hqdefault.jpg`}var Ff="Play video";var Af={frame:"Video frame",image:"Image"},MJ={any:[{field:"loadingShows",is:"image"},{all:[{not:{field:"loadingShows",set:!0}},{field:"poster",set:!0}]}]};function Lf(e){let o=e.loadingShows;return o==="image"?"image":o!=null&&o!==""?"frame":zt(e.poster)?"image":"frame"}function HJ(e){return zt(Lf(e)==="image"?e.poster:e.videoFrame)||void 0}import{readHidable as Vt,hidableText as gM}from"efficient-easel/draw";import{FOLD_FIELD_MARKER as aw,LINK_FIELD_MARKER as bM,MEDIA_FIELD_MARKER as yM,SCAFFOLD_FIELD_MARKER as SM,TEXT_FIELD_MARKER as bt,foldMetaOf as yt,textFieldIdentifier as ose}from"efficient-easel/draw";import{jsx as zg}from"react/jsx-runtime";import{useCallback as zA}from"react";import{useEasel as WA}from"efficient-easel/easel";import{SettingsAction as GA}from"efficient-easel/panel";import{CORNER_SIDES as Pl,hasCornerSubset as wn,normalizeCornerSides as at}from"efficient-easel/screen/lib/content/style-keys";function Bf(e){return typeof e=="number"&&Number.isFinite(e)}function UJ(e,o){if(!Bf(e))return;let t=yl(rt(e));if(Object.keys(t).length===0)return;let r=t[Df];if(typeof r!="string")return t;let a=wn(o)?mr(r,at(o)??[]):r;return{...t,[NA]:a}}var NA="--sf-section-radius",Df="--sf-card-radius";function mr(e,o){return Pl.map(t=>o.includes(t)?e:"0").join(" ")}var Lg=[{value:"tl",label:"Top left"},{value:"tr",label:"Top right"},{value:"bl",label:"Bottom left"},{value:"br",label:"Bottom right"}];var MA="--sf-card-box-radius";function Nf(e){return typeof e=="number"&&Number.isFinite(e)}function qJ(e,o){if(!Nf(e))return;let t=yl(rt(e))[Df];if(typeof t!="string")return;let r=wn(o)?mr(t,at(o)??[]):t;return{[MA]:r}}function Bg(e,o){let t=e.find(n=>n?.props?.id===o);if(!t)return[...e];let r=t.props?.cardCorners,a=t.props?.cardCornerSides;return e.map(n=>n?.props?.id===o?n:{...n,props:{...n.props,cardCorners:r,cardCornerSides:a}})}import{locateNode as HA}from"efficient-easel/draw";function Cn(e){if(!e)return null;let o=e.lastIndexOf(":");return o>0?{ownerId:e.slice(0,o),slot:e.slice(o+1)}:null}function Tl(e,o,t){let r=Cn(t?.zone),a=r?HA(e,o,r.ownerId):null;return a&&r?{...a,slot:r.slot}:null}function Dg(e,o,t){let r=Tl(e,o,t),a=r?.slot??"",n=r&&Array.isArray(r.item.props[a])?r.item.props[a]:[],s=t?.index??-1,l=s>=0?n[s]:void 0,c=l?.props?.id?String(l.props.id):"",d=Math.max(n.length-1,0);return!r||!c?{can:!1,reason:"unreachable",others:0}:n.length<=1?{can:!1,reason:"alone",others:d}:Nf(l?.props?.cardCorners)?{can:!0,others:d,zone:r.zone,index:r.index,data:{...r.item,props:{...r.item.props,[a]:Bg(n,c)}}}:{can:!1,reason:"unset",others:d}}function Ng(e){return e.can?fo("Gives the other card this card's Corners.","Gives the other {n} cards this card's Corners.",e.others):e.reason==="alone"?i("This is the only card in the section."):e.reason==="unset"?i("Set this card's corners first."):i("This card is not in a section that can share corners.")}function Mg(e){return fo("Applied to {n} card","Applied to {n} cards",e)}function Hg(e,o){e.can&&o(e.zone,e.index,e.data)}import{useSectionOps as UA}from"efficient-easel/screen/lib/document/use-section-ops";var $A="apply-corners-to-siblings",jA="Apply to all cards";function KA({plan:e,onPress:o}){return zg(GA,{id:$A,label:i(jA),note:Ng(e),disabled:!e.can,doneLabel:Mg(e.others),onPress:o})}function Wg(){let{appState:e,config:o}=WA(n=>n),t=UA(),r=Dg(o,e.data.content??[],e.ui.itemSelector),a=zA(()=>{Hg(r,t.replaceComponent)},[r,t]);return zg(KA,{plan:r,onPress:a})}import{isShown as lL,lazyShowWhenContext as iL}from"efficient-shell/format";var hr="product",El="recordType",qA={key:hr,label:"Product",fields:[]},VA=/^[a-z][a-z0-9]*(-[a-z0-9]+)*$/,YA=/^[a-z][A-Za-z0-9]*$/,XA=["text","date"],Gg=new Map,Ug=0;function ZA(e){if(typeof e.key!="string"||!VA.test(e.key))throw new Error(`A record type key is lower-case words joined by hyphens, not ${JSON.stringify(e.key)}.`);if(e.key===hr)throw new Error("The product record type is the builder's own and is not declared by a host.");if(typeof e.label!="string"||!e.label.trim())throw new Error(`The record type ${e.key} has no label.`);let o=new Set;for(let t of e.fields){if(typeof t.key!="string"||!YA.test(t.key)||o.has(t.key))throw new Error(`The record type ${e.key} has a field key it cannot use: ${JSON.stringify(t.key)}.`);if(!XA.includes(t.kind))throw new Error(`The field ${t.key} of ${e.key} has no kind ${JSON.stringify(t.kind)}.`);o.add(t.key)}return{key:e.key,label:e.label.trim(),fields:e.fields.map(t=>({...t}))}}function cQ(e){let o=e.map(ZA);for(let t of o)Gg.set(t.key,t);o.length&&(Ug+=1)}function Mf(){return[qA,...Gg.values()]}function Hf(){return Ug}function zf(e){let o=e?.[El];return typeof o!="string"?hr:o.trim()||hr}function Wf(e){return zf(e)===hr}var Gf="product",JA="tyre";var QA="productType",eL={[Gf]:"alloy-wheel",[JA]:"tyre"},oL=["alloy-wheel","tyre"];function $g(e,o){return Wf(o)?tL(o)??eL[e]??null:null}function tL(e){if(!Wf(e))return null;let o=e?.[QA];return typeof o=="string"&&oL.includes(o)?o:null}var Ol=null,jg=null;function rL(e,o){Ol=e,jg=o}function mQ(e){rL(e,null)}function hQ(){return Ol}function _l(){return jg==="dynamic"||Ol===Gf}function xQ(e){return $g(Ol??"",e)??"alloy-wheel"}import{addShowWhenFacts as aL}from"efficient-shell/format";import{showWhenOf as Uf,shownForOption as nL,truthy as sL,withRowRules as $f,withRowsShownWhen as jf,withShowWhen as uo}from"efficient-shell/format";var yQ=aL;function Kf(e,o,t){let r=!1,a={};for(let[n,s]of Object.entries(e))lL(Uf(s),o??{},t)?a[n]=s:r=!0;return r?a:e}function qg(e,o,t,r){let a=Tl(o,t,r);return{device:e,parentType:a?.item.type,parent:a?.item.props}}function Kg(e,o){if(!e||typeof e!="object")return!1;let t=e;if(typeof t.context=="string"&&(t.context===o||t.context.startsWith(`${o}.`)))return!0;if("not"in t)return Kg(t.not,o);for(let r of[t.all,t.any])if(Array.isArray(r)&&r.some(a=>Kg(a,o)))return!0;return!1}function TQ(e,o={}){return iL({parentType:()=>e.parent?.type??void 0,parent:()=>e.parent?.props??void 0,dynamicPage:()=>_l(),root:()=>e.appState?.data?.root?.props,...o})}var Vg=1;function cL(e){return rt(e)}function _Q(e){let o=cL(e);return o===null?{}:{"--sf-card-image-radius":`${o}px`}}var Yg=1,Xg="Corners";function dL(e){return rt(e)}function LQ(e,o){let t=dL(e);if(t===null)return null;let r=`${t}px`;return{borderRadius:wn(o)?mr(r,at(o)??[]):r}}var ht={twoAcross:{label:"Two across",across:2,acrossPhone:2,desktop:[[6,1],[6,1]],phone:[[3,1],[3,1]]},zigzag:{label:"Zigzag",across:2,acrossPhone:2,desktop:[[8,1],[4,1],[4,1],[8,1]],phone:[[4,1],[2,1],[2,1],[4,1]]},brick:{label:"Brick",across:2,acrossPhone:2,desktop:[[5,1],[7,1],[7,1],[5,1]],phone:[[2,1],[4,1],[4,1],[2,1]]},twoTall:{label:"Two tall",across:2,acrossPhone:2,desktop:[[6,2],[6,2]],phone:[[3,2],[3,2]]},offsetTall:{label:"Offset tall",across:2,acrossPhone:2,desktop:[[5,2],[7,1],[3,1],[4,1]],phone:[[3,2],[3,1],[3,1]]},ladder:{label:"Ladder",across:2,acrossPhone:2,desktop:[[3,2],[9,1],[5,1],[4,1]],phone:[[2,2],[4,1],[2,1],[2,1]]},threeAcross:{label:"Three across",across:3,acrossPhone:3,desktop:[[4,1],[4,1],[4,1]],phone:[[2,1],[2,1],[2,1]]},bigLeft:{label:"Big left",across:3,acrossPhone:3,desktop:[[6,1],[3,1],[3,1]],phone:[[4,1],[1,1],[1,1]]},bigRight:{label:"Big right",across:3,acrossPhone:3,desktop:[[3,1],[3,1],[6,1]],phone:[[1,1],[1,1],[4,1]]},threeStagger:{label:"Three stagger",across:3,acrossPhone:3,desktop:[[5,1],[4,1],[3,1],[3,1],[4,1],[5,1]],phone:[[3,1],[2,1],[1,1],[1,1],[2,1],[3,1]]},threeLadder:{label:"Three ladder",across:3,acrossPhone:3,desktop:[[3,1],[4,1],[5,1],[5,1],[4,1],[3,1]],phone:[[1,1],[2,1],[3,1],[3,1],[2,1],[1,1]]},tallMiddle:{label:"Tall middle",across:3,acrossPhone:3,desktop:[[4,1],[4,2],[4,1],[4,1],[4,1]],phone:[[2,1],[2,2],[2,1],[2,1],[2,1]]},fourAcross:{label:"Four across",across:4,acrossPhone:2,desktop:[[3,1],[3,1],[3,1],[3,1]],phone:[[3,1],[3,1]]},bigFirst:{label:"Big first",across:4,acrossPhone:2,desktop:[[6,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1]],phone:[[6,1],[3,1],[3,1]]},fourStagger:{label:"Four stagger",across:4,acrossPhone:2,desktop:[[4,1],[3,1],[2,1],[3,1],[2,1],[3,1],[4,1],[3,1]],phone:[[4,1],[2,1],[2,1],[4,1]]},tallFirst:{label:"Tall first",across:4,acrossPhone:2,desktop:[[3,2],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1]],phone:[[3,2],[3,1],[3,1]]},oneThenFour:{label:"One then four",across:4,acrossPhone:2,desktop:[[12,1],[3,1],[3,1],[3,1],[3,1]],phone:[[6,1],[3,1],[3,1]]},sixAcross:{label:"Six across",across:6,acrossPhone:3,desktop:[[2,1],[2,1],[2,1],[2,1],[2,1],[2,1]],phone:[[2,1],[2,1],[2,1]]},sixStagger:{label:"Six stagger",across:6,acrossPhone:6,desktop:[[3,1],[2,1],[1,1],[2,1],[1,1],[3,1],[1,1],[3,1],[2,1],[2,1],[1,1],[3,1]],phone:[[1,1],[1,1],[1,1],[1,1],[1,1],[1,1]]},twoThenThrees:{label:"Two, then threes",across:3,acrossPhone:3,lead:[[6,1],[6,1]],desktop:[[4,1],[4,1],[4,1]],leadPhone:[[3,1],[3,1]],phone:[[2,1],[2,1],[2,1]]}},qf=Object.keys(ht),Jg=[2,3,4,6];function Vf(e,o){return qf.filter(t=>t===o||e===null||ht[t].across===e)}function Qg(e){return typeof e!="string"||e===""?null:ht[e]??null}function Zg(e,o){return o?6/e.acrossPhone:12/e.across}function eb(e){return[...e.lead??[],...e.desktop]}var fL="sf-wall--";function uL(e){return`${fL}${e}`}function DQ(e){let o=ht[e],t=`.${uL(e)}`,r=[],a=(n,s,l=[])=>{let c=[],d=n.length,u=l.length;l.forEach(([h,p],x)=>{c.push(`${t} > :nth-child(${x+1}){grid-column:span ${h};grid-row:span ${p}}`)}),n.forEach(([h,p],x)=>{c.push(`${t} > :nth-child(${d}n+${u+x+1}){grid-column:span ${h};grid-row:span ${p}}`)});for(let h=1;h<d;h+=1)c.push(`${t}:has(> :nth-child(${d}n+${u+h}):last-child) > :nth-last-child(-n+${h}){grid-column:span ${s};grid-row:span 1}`);return c};return r.push(`${t}{grid-template-columns:repeat(12,minmax(0,1fr))}`),r.push(...a(o.desktop,Zg(o,!1),o.lead)),r.push("@media (max-width:800px){"),r.push(`${t}{grid-template-columns:repeat(6,minmax(0,1fr))}`),r.push(...a(o.phone,Zg(o,!0),o.leadPhone)),r.push("}"),r.join("")}var Rl=12,ob=1,pL=3;var mL=3;function Yf(e,o,t){let r=typeof e=="number"?e:Number.parseInt(String(e??""),10);return Number.isFinite(r)?Math.min(t,Math.max(o,Math.trunc(r))):null}function hL(e){return Yf(e,1,Rl)??mL}function HQ(e,o){return Yf(e,ob,pL)??(hL(o)===4?2:ob)}function zQ(e){return e==null||e===""?null:Yf(e,1,Rl)}var WQ="data-sf-span";function GQ(e){if(!e)return!1;if(e.type==="Grid")return!0;if(e.type==="GalleryB"){if(Qg(e.props?.layout))return!1;let o=e.props?.columns;return o!=null&&o!==""}return!1}import{jsx as xL}from"react/jsx-runtime";import*as IL from"efficient-easel/icons";function Fl(e){let o=e.replace(/(^|-)([a-z])/g,(r,a,n)=>n.toUpperCase()),t=IL[`${o}Icon`];return t?xL(t,{size:16}):null}import{isNodeList as gL}from"efficient-easel/data";var Ia=["top-left","top-center","top-right","left","center","right","bottom-left","bottom-center","bottom-right"],rb="bottom-left",ga=4,bL=ga+1,tb=40,yL=30,SL=100,wL=60,qQ=100;var Xf={"top-left":"Top left","top-center":"Top center","top-right":"Top right",left:"Left",center:"Center",right:"Right","bottom-left":"Bottom left","bottom-center":"Bottom center","bottom-right":"Bottom right"};function CL(e){let o=Ia.indexOf(vn(e));return{band:Math.floor(o/3),column:["start","center","end"][o%3]}}function vL(e){return 1+CL(e).band*(bL+1)}function VQ(e){return vL(e)+1}function vn(e){return Ia.includes(e)?e:rb}function YQ(e){let o=typeof e=="number"&&Number.isFinite(e)?e:0;return Math.max(-tb,Math.min(tb,Math.round(o)))}function XQ(e,o=wL){let t=typeof e=="number"&&Number.isFinite(e)?e:o;return Math.max(yL,Math.min(SL,Math.round(t)))}function Zf(e,o){let t=vn(o);return e.filter(r=>vn(r?.props?.placement)===t).length}function ab(e){return`${Xf[vn(e)]} already holds ${ga} boxes. Move one somewhere else first.`}function nb(e,o){let t=e.filter(r=>r?.props?.id!==o);return Ia.map(r=>{let a=Zf(t,r)>=ga,n=Xf[r];return a?{value:r,label:n,disabled:!0,title:ab(r)}:{value:r,label:n}})}function Al(e,o){let t=o===void 0?rb:vn(o?.props?.placement);return Zf(e,t)>=ga?ab(t):null}var Ll="HeroGroup";function kL(e){return Ia.map(o=>{let t=Zf(e,o);return{anchor:o,total:t,hidden:t-ga}}).filter(o=>o.hidden>0)}function Jf(e){let o=kL(e);return o.length===0?null:o.map(({anchor:t,total:r,hidden:a})=>{let n=Xf[t],s=a===1?"1 is not shown":`${a} are not shown`;return`${n} holds ${r} boxes. The published page draws the first ${ga}, so ${s}. ${a===1?"Move it":"Move them"} somewhere else.`}).join(" ")}function sb(e,o){let t=o;if(t?.type!==Ll)return null;let r=t.props?.id===void 0?"":String(t.props.id);return r?Al(Qf(e,r),t):null}function Qf(e,o){let t=ib(e,o);return t&&t.ownerType===TL?t.siblings:[]}function lb(e,o){let t=ib(e,o);return t?t.ancestorTypes.filter(r=>r===Ll).length:PL}var PL=1,TL="HeroSlide";function ib(e,o){let t=(r,a,n)=>{if(a>12||!r||typeof r!="object")return null;if(gL(r)){if(r.some(s=>s?.props?.id===o))return{siblings:r,ownerType:n.at(-1)??null,ancestorTypes:n};for(let s of r){let l=s.type,c=t(s,a+1,[...n,String(l)]);if(c)return c}return null}for(let s of Object.values(r)){let l=t(s,a+1,n);if(l)return l}return null};return t(e,0,[])}import{jsx as EL}from"react/jsx-runtime";var eu="sf-hint-keep";function cb({children:e}){return EL("span",{className:eu,children:e})}import{jsx as Wt,Fragment as RL,jsxs as gb}from"react/jsx-runtime";import{useContext as FL,useEffect as AL,useId as LL,useState as bb}from"react";import{SettingsField as BL,SettingsSwitch as DL}from"efficient-easel/panel";import{AnchorIcon as NL}from"efficient-easel/icons";import{ScreenDocumentContext as ML}from"efficient-easel/screen/components/ScreenDocumentContext";import{Snippet as HL}from"efficient-shell/ui";import{slugify as zL}from"efficient-shell/format";import{slugify as OL}from"efficient-shell/format";function kn(e){return typeof e=="string"?e.trim():e&&typeof e=="object"&&typeof e.text=="string"?e.text.trim():""}var db=e=>OL(kn(e));var Bl="homepage";import{slugify as _L}from"efficient-shell/format";var fb=[{value:"page",label:"Page"},{value:"anchor",label:"Anchor"},{value:"blog",label:"Blog post",needs:"service"},{value:"product",label:"Product",needs:"commerce"},{value:"popup",label:"Popup"},{value:"custom",label:"Custom URL"}];function ub(e){return e.offersCommerce&&e.offersService?fb:fb.filter(o=>!o.needs||(o.needs==="commerce"?e.offersCommerce:e.offersService))}var ou="#popup:";function pb(e){return`${ou}${e}`}function mb(e){return e.startsWith(ou)&&e.slice(ou.length).trim()||null}function Pn(e){return e===Bl?"/":`/${e}`}function hb(e){return`/journal/${e}`}function see(e){return`/wheels/${e}`}function Dl(e,o){return`${Pn(e)}#${o}`}function xb(...e){let o=new Set,t=[];for(let r of e)for(let a of r?.content??[]){let n=kn(a?.props?.anchor);if(!n)continue;let s=_L(n);!s||o.has(s)||(o.add(s),t.push({slug:s,name:n}))}return t}function lee(e){let o=e.indexOf("#"),t=o===-1?e:e.slice(0,o),r=t.indexOf("?");return r===-1?t:t.slice(0,r)}function Ib(e){return/^\/wheels\/[^/?#]+(?:[?#].*)?$/.test(e)}import{readHidable as WL}from"efficient-easel/draw";function yb({value:e,onChange:o,nameBox:t}){let r=WL(e).text,[a,n]=bb(!1),s=a||r.trim()!=="",l=LL();return gb(RL,{children:[Wt(BL,{label:i("Add an anchor"),labelId:l,icon:Wt(NL,{}),action:Wt(DL,{checked:s,ariaLabelledBy:l,onChange:c=>{n(c),!c&&r!==""&&o("")}})}),s&&t(e,o),s&&Wt(GL,{name:r})]})}function GL({name:e}){let o=FL(ML),t=o?.templateId?"":o?.currentSlug??"",[r,a]=bb("");AL(()=>a(xa()||window.location.origin),[]);let n=zL(e);if(!n||!t)return null;let s=`${r}${Dl(t,n)}`,l=s.replace(/^https?:\/\//,""),c=l.lastIndexOf("#");return Wt("div",{className:"sf-anchor-link",children:Wt(HL,{value:s,label:i("link"),size:"sm",children:gb("span",{className:"sf-anchor-link-text",children:[Wt("span",{className:"sf-anchor-link-path",children:l.slice(0,c)}),Wt("span",{className:"sf-anchor-link-hash",children:l.slice(c)})]})})})}import{AdjustIcon as wM,EyeIcon as CM,AnimationIcon as vM,BackgroundIcon as kM,BorderAllIcon as PM,BlockSectionIcon as TM,ColumnWidthsIcon as nw,ColumnsIcon as sw,CornerIcon as EM,DirectionDownIcon as OM,DirectionLeftIcon as _M,DirectionRightIcon as RM,DirectionUpIcon as FM,EditIcon as AM,GapIcon as LM,GridIcon as BM,GroundIcon as lw,HashIcon as iw,HeightIcon as DM,ImageIcon as NM,ListIcon as MM,LocationIcon as qS,PaddingBottomIcon as cw,PaddingLeftIcon as dw,PaddingRightIcon as fw,PaddingTopIcon as uw,PageIcon as HM,StickyIcon as zM,SearchIcon as WM,SquareIcon as GM,TypeIcon as UM,WidthIcon as $M}from"efficient-easel/icons";import{jsx as Ne,Fragment as xr,jsxs as Ir}from"react/jsx-runtime";import{CaptionIcon as UL,DateIcon as $L,FlagIcon as jL,TitleIcon as KL,ButtonIcon as qL,DollarIcon as VL,HashIcon as YL,LinkIcon as XL,NoteIcon as ZL,TagIcon as JL,TextLinesIcon as QL}from"efficient-easel/icons";var Sb={body:QL,button:qL,link:XL,label:JL,number:YL,price:VL,note:ZL,name:jL,date:$L,caption:UL,title:KL},wb={eyebrow:Ir(xr,{children:[Ne("path",{d:"M5 6.5h5"}),Ne("path",{d:"M5 12.5h14"}),Ne("path",{d:"M5 18h11"})]}),heading:Ir(xr,{children:[Ne("path",{d:"M6.5 5v14"}),Ne("path",{d:"M17.5 5v14"}),Ne("path",{d:"M6.5 12h11"})]}),intro:Ir(xr,{children:[Ne("path",{d:"M4 5.5v13"}),Ne("path",{d:"M8 7.5h12"}),Ne("path",{d:"M8 12h12"}),Ne("path",{d:"M8 16.5h8"})]}),value:Ir(xr,{children:[Ne("rect",{x:"2.5",y:"7",width:"19",height:"10",rx:"2"}),Ne("path",{d:"M6.5 12h7"})]}),quote:Ir(xr,{children:[Ne("path",{d:"M9.5 5.5C7 7.2 5.5 9.7 5.5 12.8h4v5.7h-5v-5.7"}),Ne("path",{d:"M19.5 5.5c-2.5 1.7-4 4.2-4 7.3h4v5.7h-5v-5.7"})]}),tag:Ir(xr,{children:[Ne("rect",{x:"3",y:"5.5",width:"18",height:"13",rx:"2.5"}),Ne("path",{d:"M8 9.5h8"}),Ne("path",{d:"M12 9.5v5"})]}),meta:Ir(xr,{children:[Ne("path",{d:"M4 7h16"}),Ne("path",{d:"M4 14h3.5"}),Ne("path",{d:"M10.5 14h3"}),Ne("path",{d:"M17 14h3"})]})};function tu({noun:e,size:o=14,strokeWidth:t=1.8,className:r,style:a}){let n=Sb[e];return n?Ne("span",{className:r,style:{display:"inline-flex",...a},"aria-hidden":"true",children:Ne(n,{size:o})}):Ne("svg",{className:r,style:a,width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:t,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:wb[e]})}var Cee=Object.keys(Sb);var vee=Object.keys(wb);import{parseHexColor as eB}from"efficient-shell/format";var oB="#ffffff";function ru(e){return tB(e)?e:oB}function tB(e){return typeof e=="string"&&eB(e)===e.toLowerCase()}function Tee(e){return{"--bg":ru(e)}}function Cb(e,o){let t=e?.content;if(!Array.isArray(t))return null;for(let r of t){if(!r||typeof r!="object")continue;let{type:a,props:n}=r;if(n?.id===o)return null;if(au(r,o,0))return{type:typeof a=="string"?a:"",props:n??{}}}return null}function au(e,o,t){if(t>12||!e||typeof e!="object")return!1;if(Array.isArray(e))return e.some(a=>au(a,o,t+1));let r=e.props;return r&&typeof r=="object"&&r.id===o?!0:Object.values(e).some(a=>au(a,o,t+1))}function vb(e,o){let t=e?.content;return Array.isArray(t)?Nl(t,o,0)??[]:[]}function Nl(e,o,t){if(t>12||!e||typeof e!="object")return null;if(Array.isArray(e)){for(let a of e){let n=Nl(a,o,t+1);if(n)return n}return null}let r=e.props;if(r&&typeof r=="object"){if(r.id===o)return[];for(let a of Object.values(r)){let n=Nl(a,o,t+1);if(n)return[r,...n]}return null}for(let a of Object.values(e)){let n=Nl(a,o,t+1);if(n)return n}return null}import{SettingsDefaultReset as po,SettingsDrill as jM,SettingsField as Ye,SettingsGroup as KM,SettingsGroupSub as gse,SettingsSegmented as qM,SettingsBorder as VM,SettingsSidesEach as YM,SettingsSwitch as rp,borderSides as XM,borderStartEach as ZM}from"efficient-easel/panel";import{ListField as JM}from"efficient-easel/fields";import{DisplayChips as QM}from"efficient-shell/ui";function ba(e){if(!e||typeof e!="object"||Array.isArray(e))return{};let o={};for(let[t,r]of Object.entries(e))typeof r=="boolean"&&(o[t]=r);return o}function Ml(e,o){return ba(e)[o]!==!1}function nu(e,o,t){let r=ba(o)[t];return typeof r=="boolean"?r:Ml(e,t)}function kb(e){return Object.values(ba(e)).some(o=>o===!1)}function Pb(e){return Object.keys(ba(e)).length>0}function Tb(e,o,t){let r={...ba(e)};return t?delete r[o]:r[o]=!1,Object.keys(r).length?r:void 0}function Eb(e,o,t){return{...ba(e),[o]:t}}function _ee(e,o,t){let r=Ml(e,t),a=nu(e,o,t);return r&&a?"":!r&&!a?"hidden":r?"max-view-tablet:hidden":"view-tablet:hidden"}import{AlignmentGrid as eH,Checkbox as Cse,ColorSwatch as oH,CornersInput as tH,DatePicker as vse,DateTimePicker as rH,FOCAL_DEFAULT as kse,PictureTiles as aH,IconPicker as nH,IconButton as pw,InputNumber as VS,Slider as sH,Tooltip as ki}from"efficient-shell/ui";import{backendOf as rB}from"efficient-easel/screen/lib/session";var ze=rB,Hl=e=>e.blocks;async function Ob(e){let o=e.trim();if(!o)return null;let t=ze().geocode;if(!t)throw new Error("geocode_unavailable");return t.locate(o)}var su="Lookup busy \u2014 try again in a moment.",zl=e=>typeof e=="number"&&Number.isFinite(e);function Nee(e){return e.some(o=>{let t=o?.geocode;return t?t.pending||t.manual&&t.lat===void 0&&t.lng===void 0?!0:zl(t.lat)&&t.lat!==o.lat||zl(t.lng)&&t.lng!==o.lng:!1})}async function Mee(e,o,{geocode:t=Ob,courtesyGapMs:r=1100}={}){let a=s=>new Promise(l=>setTimeout(l,s)),n=e.slice();if(e.some(s=>s?.geocode?.pending)){let s=[],l=!1;for(let c of e){if(!c?.geocode?.pending){s.push(c);continue}l&&r>0&&await a(r),l=!0;try{let d=await t(o(c));s.push(d?{...c,lat:d.lat,lng:d.lng,geocode:{...c.geocode,pending:!1,ok:!0,status:`Found \u2014 ${d.label.split(",").slice(0,3).join(",").trim()}`,lat:d.lat,lng:d.lng}}:{...c,geocode:{...c.geocode,pending:!1,ok:!1,status:"No match \u2014 check the address and try again."}})}catch{s.push({...c,geocode:{...c.geocode,pending:!1,ok:!1,status:su}})}}n=s}return n.map(s=>{let l=s?.geocode;if(!l)return s;if(l.manual&&l.lat===void 0&&l.lng===void 0)return{...s,geocode:{...l,lat:s.lat,lng:s.lng}};let c=zl(l.lat)&&l.lat!==s.lat?l.lat:s.lat,d=zl(l.lng)&&l.lng!==s.lng?l.lng:s.lng;return c!==s.lat||d!==s.lng?{...s,lat:c,lng:d}:s})}import{keptByRow as lH}from"efficient-easel/screen/lib/document/style-fields";import{jsx as PB}from"react/jsx-runtime";import{useEffect as TB,useState as EB}from"react";import{clearRangeOf as OB,markSelection as _B,useCaretEdit as RB}from"efficient-easel/copy";import{TextToolbar as FB}from"efficient-shell/ui";import{applyMark as jee,markupTools as Kee,MARKUP_TOOLS as qee,COPY_FIELD_TOOLS as Vee,STOREFRONT_MARKUP as Yee,tokenizeInline as Xee,stripInline as Zee,isSafeLinkHref as Nb}from"efficient-shell/markup";import{applyMark as hB,clearStyle as xB,markedAt as IB,markupTools as gB,MARKUP_TOOLS as bB,parseMarkup as yB,RETIRED_MARKS as SB,STOREFRONT_MARKUP as wB,tokenizeInline as Qee}from"efficient-shell/markup";var gr=["highlight","strong","quiet"],br={highlight:"Highlight",strong:"Bold",quiet:"Quiet"},nt={highlight:{kind:"wordHighlight",delimiter:"@@"},strong:{kind:"wordStrong",delimiter:"++"},quiet:{kind:"wordQuiet",delimiter:"^^"}},Ab=Object.fromEntries(gr.map(e=>[nt[e].kind,e])),Lb="data-sf-ws",Wl=["accent","text","labels"],Bb={accent:"Accent",text:"Text",labels:"Labels"},xt={accent:"var(--accent)",text:"var(--fg)",labels:"var(--fg-dim)"},aB=80,nB=120,sB=100,lB=900,iB=.5,cB=3,dB=-.1,fB=.5,uB=3,lu={font:null,size:null,weight:null,bold:null,italic:null,lineGap:null,textGap:null,colour:null},pB={highlight:{...lu},strong:{...lu},quiet:{...lu}};function _b(e,o,t){return typeof e!="number"||!Number.isFinite(e)?null:Math.round(Math.min(Math.max(e,o),t))}function Rb(e,o,t){if(typeof e!="number"||!Number.isFinite(e))return null;let r=10**uB;return Math.round(Math.min(Math.max(e,o),t)*r)/r}function Fb(e){return typeof e=="boolean"?e:null}function mB(e){let o=typeof e?.font=="string"&&Mo.some(r=>r.key===e.font)?e.font:null,t=typeof e?.colour=="string"&&Wl.includes(e.colour)?e.colour:null;return{font:o,size:_b(e?.size,aB,nB),weight:_b(e?.weight,sB,lB),bold:Fb(e?.bold),italic:Fb(e?.italic),lineGap:Rb(e?.lineGap,iB,cB),textGap:Rb(e?.textGap,dB,fB),colour:t}}function Db(e){let o={};for(let t of gr)o[t]=e&&t in e&&e[t]?mB(e[t]):{...pB[t]};return o}function Wee(e){let o=Db(e),t={};for(let r of gr){let a=o[r],n=`--sf-ws-${r}`;if(a.font){let s=Mo.find(l=>l.key===a.font);s&&(t[`${n}-font`]=`var(${s.cssVar})`)}a.size!==null&&(t[`${n}-size`]=`${a.size/100}em`),a.weight!==null&&(t[`${n}-weight`]=String(a.weight)),a.bold!==null&&(t[`${n}-weight-bold`]=a.bold?"700":"400"),a.italic!==null&&(t[`${n}-style`]=a.italic?"italic":"normal"),a.lineGap!==null&&(t[`${n}-line`]=String(a.lineGap)),a.textGap!==null&&(t[`${n}-track`]=`${a.textGap}em`),a.colour!==null&&(t[`${n}-color`]=xt[a.colour])}return t}function Gee(e){let o=e?.word_styles??void 0,t={};for(let r of gr)o&&r in o&&(t[r]=o[r]??null);return Db(t)}var CB=new Set(["strong"]),Mb=gr.map(e=>({open:nt[e].delimiter,close:nt[e].delimiter,kind:nt[e].kind,...CB.has(e)?{wordStart:!0}:{}})),ooe=[{style:nt.highlight.kind,label:br.highlight,title:`${br.highlight} word style`},{style:nt.strong.kind,label:br.strong,title:`${br.strong} word style`},{style:nt.quiet.kind,label:br.quiet,title:`${br.quiet} word style`}],vB=new Set(Mb.map(e=>e.open)),yr=[...wB.filter(e=>!vB.has(e.open)),...Mb];function iu(e){return e.bullet?"- ":e.number!=null?`${e.number}. `:""}function Tn(e){return yB(typeof e=="string"?e:"",yr)}var kB=bB.map(e=>e.style).filter(e=>!SB.includes(e)).filter(e=>yr.some(o=>o.kind===e));function Hb(){return gB(kB)}var zb=Object.fromEntries(gr.map(e=>[nt[e].kind,nt[e].delimiter]));function Wb(e,o,t,r){let a=zb[r];if(!a)return hB(e,o,t,r);let n=e.slice(o,t),s=e.slice(Math.max(0,o-a.length),o),l=e.slice(t,t+a.length);if(s===a&&l===a)return{text:e.slice(0,o-a.length)+n+e.slice(t+a.length),selectionStart:o-a.length,selectionEnd:o-a.length+n.length};let c=n||"styled text";return{text:e.slice(0,o)+a+c+a+e.slice(t),selectionStart:o+a.length,selectionEnd:o+a.length+c.length}}function Gb(e,o,t,r){let a=zb[r];return a?o>=a.length&&e.slice(o-a.length,o)===a&&e.slice(t,t+a.length)===a:IB(e,o,t,r)}function Sr(e){return Tn(e).map(o=>iu(o)+$b(o.children)).join(`
1
+ import{$ as jI,B as NI,C as MI,D as HI,Da as ie,F as zI,G as hf,Ha as og,I as WI,Ia as tg,J as To,K as dr,Ka as Sl,L as GI,La as rg,M as rt,Ma as ag,N as yl,Q as UI,R as xf,Ra as ng,U as $I,V as If,X as gf,a as Dt,b as ff,fa as fr,h as FI,ha as KI,i as uf,j as pf,ja as qI,k as ao,l as AI,la as VI,m as LI,ma as Mo,n as fa,na as ma,o as tt,oa as YI,p as ua,pa as mt,q as pa,qa as bf,ra as ha,s as BI,v as bn,va as yn,x as DI,xa as XI,y as mf,za as ZI}from"./chunk-T2R5CZ2F.js";import{d as JI,e as Nt,f as QI,g as eg,j as xa,n as yf}from"./chunk-VVWX2P2N.js";var he=e=>typeof e=="string"&&e?e:void 0;var lg="en",wl=null,ig=lg,cg=null;function EZ(e,o,t){wl=e??null,ig=o||lg,cg=t??null}function ee(){return cg}function Sf(){return ig}function dg(){return wl}function sg(e,o){return o?e.replace(/\{([A-Za-z][A-Za-z0-9_]*)\}/g,(t,r)=>Object.prototype.hasOwnProperty.call(o,r)?String(o[r]):t):e}function i(e,o){let t=wl?wl[e]:void 0;if(typeof t=="function"){try{let r=he(t(o??{}));if(r)return r}catch{}return sg(e,o)}return sg(he(t)??e,o)}function fo(e,o,t,r){return i(t===1?e:o,{...r,n:t})}import{jsx as wf,Fragment as OF,jsxs as _F}from"react/jsx-runtime";import{createContext as RF,useContext as FF}from"react";var AF={mirrorHostStyles:!0,css:null,fontHrefs:[]},fg=RF(AF);function FZ({value:e,children:o}){return wf(fg.Provider,{value:e,children:o})}function Cf(){return FF(fg)}function ug(){let{css:e,fontHrefs:o}=Cf();return _F(OF,{children:[o.map(t=>wf("link",{rel:"stylesheet",href:t},t)),e?wf("style",{"data-sf-canvas-css":"",children:e}):null]})}import{jsx as LF}from"react/jsx-runtime";import{createContext as BF,useContext as DF}from"react";var pg=BF(void 0);function DZ({metadata:e,children:o}){return LF(pg.Provider,{value:e,children:o})}var mg=()=>DF(pg);import{jsx as to,Fragment as cF,jsxs as xl}from"react/jsx-runtime";import{useCallback as Il,useEffect as pt,useRef as oZ,useState as nF}from"react";import{SettingsSwitch as tZ}from"efficient-easel/panel";import{PagesIcon as rZ,StylesIcon as aZ}from"efficient-easel/rail";import{PaletteIcon as nZ}from"efficient-shell/icons/efficient";import{Subtree as sZ,TreeRow as dF}from"efficient-easel/tree";import{useEasel as fF}from"efficient-easel/easel";import{useEaselStrings as uF}from"efficient-easel/strings";import{createContext as NF,useContext as MF}from"react";var vf=NF(!1),HZ=()=>MF(vf);import{jsx as be,Fragment as wv,jsxs as Qn}from"react/jsx-runtime";import{Fragment as gz,useEffect as bz,useId as yz,useMemo as Cv,useRef as Sz,useState as Xt}from"react";import{useScreenDocument as Rv}from"efficient-easel/screen/components/ScreenDocumentContext";import{UiIcon as Im}from"efficient-easel/draw/client";import wz from"efficient-easel/screen/components/SidePanelHead";import{jsx as te,Fragment as Hr,jsxs as Mr}from"react/jsx-runtime";import{useEasel as pv,useRootFields as y6}from"efficient-easel/easel";import{Inspector as S6}from"efficient-easel/fields";import{SettingsGroup as w6}from"efficient-easel/panel";import{useEffect as C6,useRef as v6,useState as fc}from"react";import{jsx as pr,Fragment as gA,jsxs as bA}from"react/jsx-runtime";import{useState as Pg}from"react";import{SettingsDefaultReset as yA,SettingsField as SA}from"efficient-easel/panel";import{useEaselStrings as wA}from"efficient-easel/strings";import{AddIcon as CA}from"efficient-easel/icons";import{Button as vA}from"efficient-shell/ui";import{iconOf as kA,noGlyph as PA}from"efficient-easel/screen/lib/document/box-fields";import{jsx as oe,jsxs as Ht,Fragment as oA}from"react/jsx-runtime";import{parseHexColor as tA}from"efficient-shell/format";import{Button as Tf,IconButton as rA,Tooltip as aA}from"efficient-shell/ui";import{jsx as Mt,jsxs as qF}from"react/jsx-runtime";import{AccentIcon as VF}from"efficient-easel/icons";import{Button as YF,Tooltip as XF}from"efficient-shell/ui";import{jsx as ur,jsxs as Ig}from"react/jsx-runtime";import{ColorPicker as zF,HexInput as WF}from"efficient-shell/ui";import{SettingsDefaultReset as GF,SettingsField as UF}from"efficient-easel/panel";import{typedHex as kf}from"efficient-easel/pick";import{typedHex as HF}from"efficient-easel/pick";function hg(e){let o=new Set,t=[];return ao(e).themes.forEach((r,a)=>{let n=[[i("Theme {n} main color",{n:a+1}),r.accent],[i("Theme {n} text color",{n:a+1}),r.text],[i("Theme {n} background",{n:a+1}),r.background]];for(let[s,l]of n){let c=l?HF(l):null;!c||o.has(c)||(o.add(c),t.push({name:s,value:c}))}}),t}var xg="Not set";function $F({value:e,onChange:o,label:t,id:r,caption:a,inherited:n,ariaLabel:s}){return ur(KF,{value:e,onChange:o,label:i(s??t),id:r,caption:a,inherited:n})}function jF(){let{theme:e}=ie();return hg(e).map(o=>({value:o.value,label:o.name}))}function KF({value:e,onChange:o,label:t,id:r,caption:a,inherited:n}){let s=jF(),l=e?null:kf(n??""),c=a!==void 0&&(!e||kf(a)!==kf(e))?a:null,d=u=>{u!==e&&o(u)};return Ig("div",{className:"sf-colour",children:[ur(zF,{id:r,value:e,onChange:d,label:t,presets:s,fallback:l??void 0,size:"md",align:"start"}),c!==null?ur("span",{className:"sf-colour-caption",children:c}):ur("span",{className:"sf-colour-hexwrap",children:ur(WF,{value:e||l||"",onChange:d,label:i("{label} hex code",{label:t}),placeholder:e||l?void 0:i(xg),className:l?"sf-colour-hex is-inherited":"sf-colour-hex",size:"md"})})]})}function Eo({label:e,icon:o,changed:t,hint:r,onReset:a,resetTo:n,children:s,...l}){return Ig(UF,{label:e,icon:o,htmlFor:l.id,changed:t,hint:r,action:a?ur(GF,{words:ee()?.panel,label:e,changed:!!t,detail:n,onReset:a}):void 0,children:[$F({...l,label:e}),s]})}function Cl({label:e,icon:o,value:t,inherited:r,resetTo:a,onChange:n,onReset:s,hint:l}){let c=!!t;return ur(Eo,{label:e,icon:o,value:t,inherited:c?void 0:r,onChange:n,changed:c,onReset:s,resetTo:a,hint:l})}function Pf(e){return tt(e).background}function ZF(e){let o=Dt(e.accent,Pf(e));return o===null?null:{ratio:o,grade:pa(o)}}function JF(e){let o=Pf(e),t=Dt(e.accent,o);return t===null?[]:BI(e.accent).filter(r=>{let a=Dt(r,o);return a!==null&&a>t&&pa(a)==="good"})}var QF={good:"Easy to read","large-only":ua["large-only"],hard:ua.hard};function gg({value:e,onChange:o}){let t=ZF(e),r=t?.grade,a=t&&t.grade!=="good"?JF(e):[];return Mt(Eo,{label:i("Main color"),icon:Mt(VF,{}),hint:t?i(QF[t.grade]):void 0,value:e.accent,onChange:n=>o({...e,accent:n}),children:a.length>0?Mt("div",{className:"w-full min-w-0",children:qF("div",{className:"sf-readability",children:[Mt("p",{className:"sf-readability-advice",children:eA(r,!0)}),Mt("div",{className:"sf-readability-suggestions",children:a.map(n=>{let s=Dt(n,Pf(e));return Mt(XF,{content:i("Use {colour}",{colour:n.toUpperCase()}),children:Mt(YF,{variant:"secondary",className:"sf-readability-suggestion",leftIcon:Mt("span",{className:"sf-readability-chip",style:{background:n},"aria-hidden":!0}),onClick:()=>o({...e,accent:n}),children:s?`${s.toFixed(1)}:1`:n.toUpperCase()})},n)})})]})}):null})}function eA(e,o){return e?e==="good"?i("This color reads clearly on your pages."):o?i("This color is hard to read on this theme's page. The buttons below are the same hue, darkened."):i("This color is hard to read on your page background. Pick one further from it \u2014 lighter if your pages are dark, deeper if they are light."):i("Pick a color to see how it reads.")}import{ButtonIcon as nA,ChevronDownIcon as yg,ChevronUpIcon as sA,GroundIcon as lA,LayoutIcon as iA,SquareIcon as cA,TextSmallIcon as dA,TypeIcon as bg}from"efficient-easel/icons";var Sn=e=>i("Theme {n}",{n:e+1});function Sg({colors:e}){let o=tt(e),t=bn(e)??o.accent;return Ht("span",{className:"sf-theme-page",style:{background:o.background,color:o.text},"aria-hidden":!0,children:[oe("span",{className:"sf-theme-eyebrow",style:{color:o.muted},children:i("label")}),Ht("span",{className:"sf-theme-headline",children:[i("Heading")," ",oe("span",{style:{color:o.accent},children:i("accent")})]}),oe("span",{className:"sf-theme-body",children:i("body text")}),Ht("span",{className:"sf-theme-row",children:[oe("span",{className:"sf-theme-btn",style:{background:t,color:mf(e,o.accent)},children:i("button")}),oe("span",{className:"sf-theme-mini",style:{background:o.surface,borderColor:o.line},children:i("card")})]})]})}var Ef={"Text color":oe(bg,{}),"Label color":oe(dA,{}),Background:oe(lA,{}),"Panels & cards":oe(iA,{}),Borders:oe(cA,{}),"Button color":oe(nA,{}),"Button text color":oe(bg,{})};function fA({label:e,colorKey:o,value:t,onChange:r,idPrefix:a="sf-theme-ink"}){let n=`${a}-${o}`;return oe(Eo,{label:i(e),icon:Ef[e],id:n,value:t,onChange:s=>r(o,s)})}function uA({value:e,accent:o,onChange:t,idPrefix:r="sf-theme-ink"}){let a=`${r}-button`,n=e!==void 0&&tA(e)===e.toLowerCase(),s=n?e:o;return oe(Eo,{label:i("Button color"),icon:Ef["Button color"],id:a,value:s,caption:n?s:i("Main"),onChange:t})}function pA({colors:e,accent:o,onChange:t,idPrefix:r="sf-theme-ink"}){let a=`${r}-button-ink`,n=DI(e),s=mf(e,o),l=bn(e)??o,c=pa(Dt(s,l)??0);return oe(Eo,{label:i("Button text color"),icon:Ef["Button text color"],hint:n&&c!=="good"?i("{grade} on the button",{grade:i(ua[c])}):void 0,id:a,value:s,caption:n?s:i("Auto"),onChange:t})}var mA=[{colour:!0},{label:"Text color",key:"text"},{label:"Label color",key:"muted"},{button:!0},{buttonInk:!0},{moduleBreak:!0},{label:"Background",key:"background"},{label:"Panels & cards",key:"surface"},{label:"Borders",key:"line"}];function Of({colors:e,onChange:o,idPrefix:t}){let r=tt(e);return oe(oA,{children:mA.map(a=>"colour"in a?oe(gg,{value:e,onChange:o},"colour"):"moduleBreak"in a?oe("div",{className:"sf-theme-module-break","aria-hidden":"true"},"module-break"):"button"in a?oe(uA,{value:e.button,accent:r.accent,onChange:n=>o({...e,button:n}),idPrefix:t},"button"):"buttonInk"in a?oe(pA,{colors:e,accent:r.accent,onChange:n=>o({...e,buttonInk:n}),idPrefix:t},"buttonInk"):oe(fA,{label:a.label,colorKey:a.key,value:r[a.key],onChange:(n,s)=>o({...e,[n]:s}),idPrefix:t},a.key))})}function vl({index:e,colors:o,selected:t,role:r="radio",open:a,editable:n=!0,onPick:s,onEdit:l,onChangeColors:c}){let d=tt(o),u=Sn(e),h=e<pf.length&&!o.brandInk?pf[e]:null,p=pa(Dt(d.text,d.background)??0),x=h?JSON.stringify(o)!==JSON.stringify(h):!1,g=a!==void 0;return Ht("div",{className:`sf-theme-card${t?" is-selected":""}`,children:[oe("button",{type:"button",role:r,"aria-checked":r==="radio"?t:void 0,"aria-selected":r==="option"?t:void 0,"aria-label":u,className:"sf-theme-pick",onClick:s,children:oe(Sg,{colors:o})}),Ht("div",{className:"sf-theme-foot",children:[oe("span",{className:"sf-theme-name",children:u}),p!=="good"&&oe("span",{className:"sf-theme-warn",children:i(ua[p])}),n&&l&&g&&oe("span",{className:"sf-theme-edit",children:oe(aA,{content:a?i("Collapse"):i("Edit colors"),children:oe(rA,{size:"sm","aria-expanded":a,"aria-controls":`sf-theme-colours-${e}`,"aria-label":a?i("Collapse {name}",{name:u}):i("Edit colors for {name}",{name:u}),onClick:l,children:a?oe(sA,{size:14}):oe(yg,{size:14})})})}),n&&l&&!g&&oe(Tf,{variant:"secondary",size:"sm",className:"sf-theme-edit","aria-label":i("Edit {name}",{name:u}),onClick:l,children:i("Edit")})]}),a&&Ht("div",{id:`sf-theme-colours-${e}`,className:"sf-theme-colours",children:[oe(Of,{colors:o,onChange:y=>c?.(y)}),h&&oe(Tf,{variant:"link",size:"sm",className:"sf-theme-reset",disabled:!x,onClick:()=>c?.({...h}),children:x?i("Reset {name} to the preset",{name:u}):i("Not changed")})]})]})}function wg({colors:e,name:o,nameId:t,open:r,menuId:a,labelId:n,buttonRef:s,onClick:l,onKeyDown:c,onEdit:d}){return Ht("div",{className:"sf-secttheme-btn",children:[oe("button",{ref:s,type:"button",className:"sf-theme-pick","aria-expanded":r,"aria-controls":a,"aria-labelledby":`${n} ${t}`,onClick:l,onKeyDown:c,children:e?oe(Sg,{colors:e}):oe("span",{className:"sf-secttheme-nopreview","aria-hidden":"true"})}),Ht("div",{className:"sf-theme-foot",children:[oe("span",{id:t,className:"sf-theme-name",children:o}),d&&oe(Tf,{variant:"secondary",size:"sm",className:"sf-theme-edit","aria-label":i("Edit {name}",{name:o}),onClick:d,children:i("Edit")}),oe("button",{type:"button",className:"sf-secttheme-caret","aria-hidden":"true",tabIndex:-1,onClick:l,children:oe(yg,{size:12,className:"sf-multi-caret","aria-hidden":"true"})})]})]})}import{jsx as kl,Fragment as hA,jsxs as Cg}from"react/jsx-runtime";import{Button as vg,Dialog as xA}from"efficient-shell/ui";function IA(e){return fo("This site has {n} color theme of its own. Clearing takes them away and puts back the four the shop supplies.","This site has {n} color themes of its own. Clearing takes them away and puts back the four the shop supplies.",e)}function kg({count:e,onCancel:o,onConfirm:t}){return Cg(xA,{open:!0,onClose:o,role:"alertdialog",size:"sm",title:i("Clear this site\u2019s colors?"),footer:Cg(hA,{children:[kl(vg,{variant:"secondary",onClick:o,children:i("Cancel")}),kl(vg,{variant:"danger",onClick:t,children:i("Clear colors")})]}),children:[kl("p",{children:IA(e)}),kl("p",{className:"mt-2 font-medium",children:i("This cannot be undone.")})]})}var TA=PA("the row's whole content is an action; the gutter names a subject and this row has none \u2014 the button's label is the name GG, 2026-09-23"),EA="Reset color",OA={selected:0,themes:[]};function _A(e){e(OA)}function Tg({value:e,onChange:o}){let t=e?.themes??[],r=t.length===0,a=ao(e),[n,s]=Pg(!1),l=wA(),[c,d]=Pg(null),u=(_,w)=>{o({...a,themes:a.themes.map((I,v)=>v===_?w:I)})},h=fa(a).accent,p=new Set(a.themes.map(_=>_.brandInk).filter(Boolean)),x=AI.filter(_=>!p.has(_)).map(_=>LI(h,_)),g=[...a.themes,...x],y=_=>{if(_<a.themes.length)return o({...a,selected:_});let w=[...a.themes,g[_]];o({...a,themes:w,selected:w.length-1})},E=()=>{let _=[...a.themes,{...tt(a.themes[a.selected])}];o({...a,themes:_,selected:_.length-1}),d(_.length-1)};return bA(gA,{children:[r?null:pr(SA,{label:i(EA),icon:kA(TA),labelId:"sf-theme-reset",action:pr(yA,{label:i("all theme colors"),words:l.panel,changed:!0,onReset:()=>s(!0)})}),n&&pr(kg,{count:t.length,onCancel:()=>s(!1),onConfirm:()=>{s(!1),_A(o)}}),pr("div",{className:"sf-theme-list",role:"radiogroup","aria-label":i("Theme"),children:g.map((_,w)=>pr(vl,{index:w,colors:_,selected:w===a.selected,open:c===w&&w<a.themes.length,editable:w<a.themes.length,onPick:()=>y(w),onEdit:()=>d(I=>I===w?null:w),onChangeColors:I=>u(w,I)},w))}),pr(vA,{variant:"secondary",leftIcon:pr(CA,{}),onClick:E,className:"sf-theme-add",children:i("Add new theme")})]})}import{jsx as Ni}from"react/jsx-runtime";import{SettingsDefaultReset as k5,SettingsField as P5}from"efficient-easel/panel";import{SquareIcon as T5}from"efficient-easel/icons";import{jsx as S,jsxs as Fa,Fragment as qt}from"react/jsx-runtime";import{cloneElement as tw,createContext as hM,useContext as xM,useEffect as IM,useId as rw,useRef as vi,useState as Nn}from"react";import{useEasel as tp,useSelectedHost as Ti}from"efficient-easel/easel";import{toDateKey as Vne,fromDateKey as Yne}from"efficient-shell/format";function RA(e){return!!e&&typeof e=="object"&&!Array.isArray(e)&&typeof e.src=="string"}function zt(e){return typeof e=="string"?e:RA(e)?e.src:""}function AJ(e,o,t){return _f(e,o.split("."),t)}function _f(e,o,t){if(o.length===0)return t(e);let[r,...a]=o,n=r.endsWith("[]"),s=n?r.slice(0,-2):r;if(!e||typeof e!="object"||Array.isArray(e))return e;let l=e;if(!(s in l))return e;let c=l[s];if(n){if(!Array.isArray(c))return e;let u=!1,h=c.map(p=>{let x=_f(p,a,t);return x!==p&&(u=!0),x});return u?{...l,[s]:h}:e}let d=_f(c,a,t);return d===c?e:{...l,[s]:d}}var FA=["upload","youtube"],AA="upload",DJ={upload:"Upload",youtube:"YouTube"},LA=["background","click"],BA="background",NJ={background:"Background",click:"Click to play"};function Og(e){return FA.includes(e)?e:AA}function _g(e){return LA.includes(e)?e:BA}var Eg=/^[A-Za-z0-9_-]{11}$/,DA=/^(?:www\.|m\.|music\.)?(?:youtube\.com|youtube-nocookie\.com|youtu\.be)$/;function Rg(e){let o=typeof e=="string"?e.trim():"";if(!o)return null;if(Eg.test(o))return o;let t;try{t=new URL(/^[a-z]+:\/\//i.test(o)?o:`https://${o}`)}catch{return null}if(t.protocol!=="https:"&&t.protocol!=="http:"||!DA.test(t.hostname))return null;let r=t.pathname.split("/").filter(Boolean),a=t.hostname.endsWith("youtu.be")?r[0]:r[0]==="watch"?t.searchParams.get("v"):r[0]==="embed"||r[0]==="shorts"||r[0]==="live"||r[0]==="v"?r[1]:null;return a&&Eg.test(a)?a:null}function Rf(e,o){let t=o==="click"?"autoplay=1&playsinline=1&rel=0":`autoplay=1&mute=1&loop=1&playlist=${e}&controls=0&playsinline=1&rel=0&disablekb=1`;return`https://www.youtube-nocookie.com/embed/${e}?${t}`}function Fg(e){return`https://i.ytimg.com/vi/${e}/maxresdefault.jpg`}function Ag(e){return`https://i.ytimg.com/vi/${e}/hqdefault.jpg`}var Ff="Play video";var Af={frame:"Video frame",image:"Image"},MJ={any:[{field:"loadingShows",is:"image"},{all:[{not:{field:"loadingShows",set:!0}},{field:"poster",set:!0}]}]};function Lf(e){let o=e.loadingShows;return o==="image"?"image":o!=null&&o!==""?"frame":zt(e.poster)?"image":"frame"}function HJ(e){return zt(Lf(e)==="image"?e.poster:e.videoFrame)||void 0}import{readHidable as Vt,hidableText as gM}from"efficient-easel/draw";import{FOLD_FIELD_MARKER as aw,LINK_FIELD_MARKER as bM,MEDIA_FIELD_MARKER as yM,SCAFFOLD_FIELD_MARKER as SM,TEXT_FIELD_MARKER as bt,foldMetaOf as yt,textFieldIdentifier as ose}from"efficient-easel/draw";import{jsx as zg}from"react/jsx-runtime";import{useCallback as zA}from"react";import{useEasel as WA}from"efficient-easel/easel";import{SettingsAction as GA}from"efficient-easel/panel";import{CORNER_SIDES as Pl,hasCornerSubset as wn,normalizeCornerSides as at}from"efficient-easel/screen/lib/content/style-keys";function Bf(e){return typeof e=="number"&&Number.isFinite(e)}function UJ(e,o){if(!Bf(e))return;let t=yl(rt(e));if(Object.keys(t).length===0)return;let r=t[Df];if(typeof r!="string")return t;let a=wn(o)?mr(r,at(o)??[]):r;return{...t,[NA]:a}}var NA="--sf-section-radius",Df="--sf-card-radius";function mr(e,o){return Pl.map(t=>o.includes(t)?e:"0").join(" ")}var Lg=[{value:"tl",label:"Top left"},{value:"tr",label:"Top right"},{value:"bl",label:"Bottom left"},{value:"br",label:"Bottom right"}];var MA="--sf-card-box-radius";function Nf(e){return typeof e=="number"&&Number.isFinite(e)}function qJ(e,o){if(!Nf(e))return;let t=yl(rt(e))[Df];if(typeof t!="string")return;let r=wn(o)?mr(t,at(o)??[]):t;return{[MA]:r}}function Bg(e,o){let t=e.find(n=>n?.props?.id===o);if(!t)return[...e];let r=t.props?.cardCorners,a=t.props?.cardCornerSides;return e.map(n=>n?.props?.id===o?n:{...n,props:{...n.props,cardCorners:r,cardCornerSides:a}})}import{locateNode as HA}from"efficient-easel/draw";function Cn(e){if(!e)return null;let o=e.lastIndexOf(":");return o>0?{ownerId:e.slice(0,o),slot:e.slice(o+1)}:null}function Tl(e,o,t){let r=Cn(t?.zone),a=r?HA(e,o,r.ownerId):null;return a&&r?{...a,slot:r.slot}:null}function Dg(e,o,t){let r=Tl(e,o,t),a=r?.slot??"",n=r&&Array.isArray(r.item.props[a])?r.item.props[a]:[],s=t?.index??-1,l=s>=0?n[s]:void 0,c=l?.props?.id?String(l.props.id):"",d=Math.max(n.length-1,0);return!r||!c?{can:!1,reason:"unreachable",others:0}:n.length<=1?{can:!1,reason:"alone",others:d}:Nf(l?.props?.cardCorners)?{can:!0,others:d,zone:r.zone,index:r.index,data:{...r.item,props:{...r.item.props,[a]:Bg(n,c)}}}:{can:!1,reason:"unset",others:d}}function Ng(e){return e.can?fo("Gives the other card this card's Corners.","Gives the other {n} cards this card's Corners.",e.others):e.reason==="alone"?i("This is the only card in the section."):e.reason==="unset"?i("Set this card's corners first."):i("This card is not in a section that can share corners.")}function Mg(e){return fo("Applied to {n} card","Applied to {n} cards",e)}function Hg(e,o){e.can&&o(e.zone,e.index,e.data)}import{useSectionOps as UA}from"efficient-easel/screen/lib/document/use-section-ops";var $A="apply-corners-to-siblings",jA="Apply to all cards";function KA({plan:e,onPress:o}){return zg(GA,{id:$A,label:i(jA),note:Ng(e),disabled:!e.can,doneLabel:Mg(e.others),onPress:o})}function Wg(){let{appState:e,config:o}=WA(n=>n),t=UA(),r=Dg(o,e.data.content??[],e.ui.itemSelector),a=zA(()=>{Hg(r,t.replaceComponent)},[r,t]);return zg(KA,{plan:r,onPress:a})}import{isShown as lL,lazyShowWhenContext as iL}from"efficient-shell/format";var hr="product",El="recordType",qA={key:hr,label:"Product",fields:[]},VA=/^[a-z][a-z0-9]*(-[a-z0-9]+)*$/,YA=/^[a-z][A-Za-z0-9]*$/,XA=["text","date"],Gg=new Map,Ug=0;function ZA(e){if(typeof e.key!="string"||!VA.test(e.key))throw new Error(`A record type key is lower-case words joined by hyphens, not ${JSON.stringify(e.key)}.`);if(e.key===hr)throw new Error("The product record type is the builder's own and is not declared by a host.");if(typeof e.label!="string"||!e.label.trim())throw new Error(`The record type ${e.key} has no label.`);let o=new Set;for(let t of e.fields){if(typeof t.key!="string"||!YA.test(t.key)||o.has(t.key))throw new Error(`The record type ${e.key} has a field key it cannot use: ${JSON.stringify(t.key)}.`);if(!XA.includes(t.kind))throw new Error(`The field ${t.key} of ${e.key} has no kind ${JSON.stringify(t.kind)}.`);o.add(t.key)}return{key:e.key,label:e.label.trim(),fields:e.fields.map(t=>({...t}))}}function cQ(e){let o=e.map(ZA);for(let t of o)Gg.set(t.key,t);o.length&&(Ug+=1)}function Mf(){return[qA,...Gg.values()]}function Hf(){return Ug}function zf(e){let o=e?.[El];return typeof o!="string"?hr:o.trim()||hr}function Wf(e){return zf(e)===hr}var Gf="product",JA="tyre";var QA="productType",eL={[Gf]:"alloy-wheel",[JA]:"tyre"},oL=["alloy-wheel","tyre"];function $g(e,o){return Wf(o)?tL(o)??eL[e]??null:null}function tL(e){if(!Wf(e))return null;let o=e?.[QA];return typeof o=="string"&&oL.includes(o)?o:null}var Ol=null,jg=null;function rL(e,o){Ol=e,jg=o}function mQ(e){rL(e,null)}function hQ(){return Ol}function _l(){return jg==="dynamic"||Ol===Gf}function xQ(e){return $g(Ol??"",e)??"alloy-wheel"}import{addShowWhenFacts as aL}from"efficient-shell/format";import{showWhenOf as Uf,shownForOption as nL,truthy as sL,withRowRules as $f,withRowsShownWhen as jf,withShowWhen as uo}from"efficient-shell/format";var yQ=aL;function Kf(e,o,t){let r=!1,a={};for(let[n,s]of Object.entries(e))lL(Uf(s),o??{},t)?a[n]=s:r=!0;return r?a:e}function qg(e,o,t,r){let a=Tl(o,t,r);return{device:e,parentType:a?.item.type,parent:a?.item.props}}function Kg(e,o){if(!e||typeof e!="object")return!1;let t=e;if(typeof t.context=="string"&&(t.context===o||t.context.startsWith(`${o}.`)))return!0;if("not"in t)return Kg(t.not,o);for(let r of[t.all,t.any])if(Array.isArray(r)&&r.some(a=>Kg(a,o)))return!0;return!1}function TQ(e,o={}){return iL({parentType:()=>e.parent?.type??void 0,parent:()=>e.parent?.props??void 0,dynamicPage:()=>_l(),root:()=>e.appState?.data?.root?.props,...o})}var Vg=1;function cL(e){return rt(e)}function _Q(e){let o=cL(e);return o===null?{}:{"--sf-card-image-radius":`${o}px`}}var Yg=1,Xg="Corners";function dL(e){return rt(e)}function LQ(e,o){let t=dL(e);if(t===null)return null;let r=`${t}px`;return{borderRadius:wn(o)?mr(r,at(o)??[]):r}}var ht={twoAcross:{label:"Two across",across:2,acrossPhone:2,desktop:[[6,1],[6,1]],phone:[[3,1],[3,1]]},zigzag:{label:"Zigzag",across:2,acrossPhone:2,desktop:[[8,1],[4,1],[4,1],[8,1]],phone:[[4,1],[2,1],[2,1],[4,1]]},brick:{label:"Brick",across:2,acrossPhone:2,desktop:[[5,1],[7,1],[7,1],[5,1]],phone:[[2,1],[4,1],[4,1],[2,1]]},twoTall:{label:"Two tall",across:2,acrossPhone:2,desktop:[[6,2],[6,2]],phone:[[3,2],[3,2]]},offsetTall:{label:"Offset tall",across:2,acrossPhone:2,desktop:[[5,2],[7,1],[3,1],[4,1]],phone:[[3,2],[3,1],[3,1]]},ladder:{label:"Ladder",across:2,acrossPhone:2,desktop:[[3,2],[9,1],[5,1],[4,1]],phone:[[2,2],[4,1],[2,1],[2,1]]},threeAcross:{label:"Three across",across:3,acrossPhone:3,desktop:[[4,1],[4,1],[4,1]],phone:[[2,1],[2,1],[2,1]]},bigLeft:{label:"Big left",across:3,acrossPhone:3,desktop:[[6,1],[3,1],[3,1]],phone:[[4,1],[1,1],[1,1]]},bigRight:{label:"Big right",across:3,acrossPhone:3,desktop:[[3,1],[3,1],[6,1]],phone:[[1,1],[1,1],[4,1]]},threeStagger:{label:"Three stagger",across:3,acrossPhone:3,desktop:[[5,1],[4,1],[3,1],[3,1],[4,1],[5,1]],phone:[[3,1],[2,1],[1,1],[1,1],[2,1],[3,1]]},threeLadder:{label:"Three ladder",across:3,acrossPhone:3,desktop:[[3,1],[4,1],[5,1],[5,1],[4,1],[3,1]],phone:[[1,1],[2,1],[3,1],[3,1],[2,1],[1,1]]},tallMiddle:{label:"Tall middle",across:3,acrossPhone:3,desktop:[[4,1],[4,2],[4,1],[4,1],[4,1]],phone:[[2,1],[2,2],[2,1],[2,1],[2,1]]},fourAcross:{label:"Four across",across:4,acrossPhone:2,desktop:[[3,1],[3,1],[3,1],[3,1]],phone:[[3,1],[3,1]]},bigFirst:{label:"Big first",across:4,acrossPhone:2,desktop:[[6,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1]],phone:[[6,1],[3,1],[3,1]]},fourStagger:{label:"Four stagger",across:4,acrossPhone:2,desktop:[[4,1],[3,1],[2,1],[3,1],[2,1],[3,1],[4,1],[3,1]],phone:[[4,1],[2,1],[2,1],[4,1]]},tallFirst:{label:"Tall first",across:4,acrossPhone:2,desktop:[[3,2],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1]],phone:[[3,2],[3,1],[3,1]]},oneThenFour:{label:"One then four",across:4,acrossPhone:2,desktop:[[12,1],[3,1],[3,1],[3,1],[3,1]],phone:[[6,1],[3,1],[3,1]]},sixAcross:{label:"Six across",across:6,acrossPhone:3,desktop:[[2,1],[2,1],[2,1],[2,1],[2,1],[2,1]],phone:[[2,1],[2,1],[2,1]]},sixStagger:{label:"Six stagger",across:6,acrossPhone:6,desktop:[[3,1],[2,1],[1,1],[2,1],[1,1],[3,1],[1,1],[3,1],[2,1],[2,1],[1,1],[3,1]],phone:[[1,1],[1,1],[1,1],[1,1],[1,1],[1,1]]},twoThenThrees:{label:"Two, then threes",across:3,acrossPhone:3,lead:[[6,1],[6,1]],desktop:[[4,1],[4,1],[4,1]],leadPhone:[[3,1],[3,1]],phone:[[2,1],[2,1],[2,1]]}},qf=Object.keys(ht),Jg=[2,3,4,6];function Vf(e,o){return qf.filter(t=>t===o||e===null||ht[t].across===e)}function Qg(e){return typeof e!="string"||e===""?null:ht[e]??null}function Zg(e,o){return o?6/e.acrossPhone:12/e.across}function eb(e){return[...e.lead??[],...e.desktop]}var fL="sf-wall--";function uL(e){return`${fL}${e}`}function DQ(e){let o=ht[e],t=`.${uL(e)}`,r=[],a=(n,s,l=[])=>{let c=[],d=n.length,u=l.length;l.forEach(([h,p],x)=>{c.push(`${t} > :nth-child(${x+1}){grid-column:span ${h};grid-row:span ${p}}`)}),n.forEach(([h,p],x)=>{c.push(`${t} > :nth-child(${d}n+${u+x+1}){grid-column:span ${h};grid-row:span ${p}}`)});for(let h=1;h<d;h+=1)c.push(`${t}:has(> :nth-child(${d}n+${u+h}):last-child) > :nth-last-child(-n+${h}){grid-column:span ${s};grid-row:span 1}`);return c};return r.push(`${t}{grid-template-columns:repeat(12,minmax(0,1fr))}`),r.push(...a(o.desktop,Zg(o,!1),o.lead)),r.push("@media (max-width:800px){"),r.push(`${t}{grid-template-columns:repeat(6,minmax(0,1fr))}`),r.push(...a(o.phone,Zg(o,!0),o.leadPhone)),r.push("}"),r.join("")}var Rl=12,ob=1,pL=3;var mL=3;function Yf(e,o,t){let r=typeof e=="number"?e:Number.parseInt(String(e??""),10);return Number.isFinite(r)?Math.min(t,Math.max(o,Math.trunc(r))):null}function hL(e){return Yf(e,1,Rl)??mL}function HQ(e,o){return Yf(e,ob,pL)??(hL(o)===4?2:ob)}function zQ(e){return e==null||e===""?null:Yf(e,1,Rl)}var WQ="data-sf-span";function GQ(e){if(!e)return!1;if(e.type==="Grid")return!0;if(e.type==="GalleryB"){if(Qg(e.props?.layout))return!1;let o=e.props?.columns;return o!=null&&o!==""}return!1}import{jsx as xL}from"react/jsx-runtime";import*as IL from"efficient-easel/icons";function Fl(e){let o=e.replace(/(^|-)([a-z])/g,(r,a,n)=>n.toUpperCase()),t=IL[`${o}Icon`];return t?xL(t,{size:16}):null}import{isNodeList as gL}from"efficient-easel/data";var Ia=["top-left","top-center","top-right","left","center","right","bottom-left","bottom-center","bottom-right"],rb="bottom-left",ga=4,bL=ga+1,tb=40,yL=30,SL=100,wL=60,qQ=100;var Xf={"top-left":"Top left","top-center":"Top center","top-right":"Top right",left:"Left",center:"Center",right:"Right","bottom-left":"Bottom left","bottom-center":"Bottom center","bottom-right":"Bottom right"};function CL(e){let o=Ia.indexOf(vn(e));return{band:Math.floor(o/3),column:["start","center","end"][o%3]}}function vL(e){return 1+CL(e).band*(bL+1)}function VQ(e){return vL(e)+1}function vn(e){return Ia.includes(e)?e:rb}function YQ(e){let o=typeof e=="number"&&Number.isFinite(e)?e:0;return Math.max(-tb,Math.min(tb,Math.round(o)))}function XQ(e,o=wL){let t=typeof e=="number"&&Number.isFinite(e)?e:o;return Math.max(yL,Math.min(SL,Math.round(t)))}function Zf(e,o){let t=vn(o);return e.filter(r=>vn(r?.props?.placement)===t).length}function ab(e){return`${Xf[vn(e)]} already holds ${ga} boxes. Move one somewhere else first.`}function nb(e,o){let t=e.filter(r=>r?.props?.id!==o);return Ia.map(r=>{let a=Zf(t,r)>=ga,n=Xf[r];return a?{value:r,label:n,disabled:!0,title:ab(r)}:{value:r,label:n}})}function Al(e,o){let t=o===void 0?rb:vn(o?.props?.placement);return Zf(e,t)>=ga?ab(t):null}var Ll="HeroGroup";function kL(e){return Ia.map(o=>{let t=Zf(e,o);return{anchor:o,total:t,hidden:t-ga}}).filter(o=>o.hidden>0)}function Jf(e){let o=kL(e);return o.length===0?null:o.map(({anchor:t,total:r,hidden:a})=>{let n=Xf[t],s=a===1?"1 is not shown":`${a} are not shown`;return`${n} holds ${r} boxes. The published page draws the first ${ga}, so ${s}. ${a===1?"Move it":"Move them"} somewhere else.`}).join(" ")}function sb(e,o){let t=o;if(t?.type!==Ll)return null;let r=t.props?.id===void 0?"":String(t.props.id);return r?Al(Qf(e,r),t):null}function Qf(e,o){let t=ib(e,o);return t&&t.ownerType===TL?t.siblings:[]}function lb(e,o){let t=ib(e,o);return t?t.ancestorTypes.filter(r=>r===Ll).length:PL}var PL=1,TL="HeroSlide";function ib(e,o){let t=(r,a,n)=>{if(a>12||!r||typeof r!="object")return null;if(gL(r)){if(r.some(s=>s?.props?.id===o))return{siblings:r,ownerType:n.at(-1)??null,ancestorTypes:n};for(let s of r){let l=s.type,c=t(s,a+1,[...n,String(l)]);if(c)return c}return null}for(let s of Object.values(r)){let l=t(s,a+1,n);if(l)return l}return null};return t(e,0,[])}import{jsx as EL}from"react/jsx-runtime";var eu="sf-hint-keep";function cb({children:e}){return EL("span",{className:eu,children:e})}import{jsx as Wt,Fragment as RL,jsxs as gb}from"react/jsx-runtime";import{useContext as FL,useEffect as AL,useId as LL,useState as bb}from"react";import{SettingsField as BL,SettingsSwitch as DL}from"efficient-easel/panel";import{AnchorIcon as NL}from"efficient-easel/icons";import{ScreenDocumentContext as ML}from"efficient-easel/screen/components/ScreenDocumentContext";import{Snippet as HL}from"efficient-shell/ui";import{slugify as zL}from"efficient-shell/format";import{slugify as OL}from"efficient-shell/format";function kn(e){return typeof e=="string"?e.trim():e&&typeof e=="object"&&typeof e.text=="string"?e.text.trim():""}var db=e=>OL(kn(e));var Bl="homepage";import{slugify as _L}from"efficient-shell/format";var fb=[{value:"page",label:"Page"},{value:"anchor",label:"Anchor"},{value:"blog",label:"Blog post",needs:"service"},{value:"product",label:"Product",needs:"commerce"},{value:"popup",label:"Popup"},{value:"custom",label:"Custom URL"}];function ub(e){return e.offersCommerce&&e.offersService?fb:fb.filter(o=>!o.needs||(o.needs==="commerce"?e.offersCommerce:e.offersService))}var ou="#popup:";function pb(e){return`${ou}${e}`}function mb(e){return e.startsWith(ou)&&e.slice(ou.length).trim()||null}function Pn(e){return e===Bl?"/":`/${e}`}function hb(e){return`/journal/${e}`}function see(e){return`/wheels/${e}`}function Dl(e,o){return`${Pn(e)}#${o}`}function xb(...e){let o=new Set,t=[];for(let r of e)for(let a of r?.content??[]){let n=kn(a?.props?.anchor);if(!n)continue;let s=_L(n);!s||o.has(s)||(o.add(s),t.push({slug:s,name:n}))}return t}function lee(e){let o=e.indexOf("#"),t=o===-1?e:e.slice(0,o),r=t.indexOf("?");return r===-1?t:t.slice(0,r)}function Ib(e){return/^\/wheels\/[^/?#]+(?:[?#].*)?$/.test(e)}import{readHidable as WL}from"efficient-easel/draw";function yb({value:e,onChange:o,nameBox:t}){let r=WL(e).text,[a,n]=bb(!1),s=a||r.trim()!=="",l=LL();return gb(RL,{children:[Wt(BL,{label:i("Add an anchor"),labelId:l,icon:Wt(NL,{}),action:Wt(DL,{checked:s,ariaLabelledBy:l,onChange:c=>{n(c),!c&&r!==""&&o("")}})}),s&&t(e,o),s&&Wt(GL,{name:r})]})}function GL({name:e}){let o=FL(ML),t=o?.templateId?"":o?.currentSlug??"",[r,a]=bb("");AL(()=>a(xa()||window.location.origin),[]);let n=zL(e);if(!n||!t)return null;let s=`${r}${Dl(t,n)}`,l=s.replace(/^https?:\/\//,""),c=l.lastIndexOf("#");return Wt("div",{className:"sf-anchor-link",children:Wt(HL,{value:s,label:i("link"),size:"sm",children:gb("span",{className:"sf-anchor-link-text",children:[Wt("span",{className:"sf-anchor-link-path",children:l.slice(0,c)}),Wt("span",{className:"sf-anchor-link-hash",children:l.slice(c)})]})})})}import{AdjustIcon as wM,EyeIcon as CM,AnimationIcon as vM,BackgroundIcon as kM,BorderAllIcon as PM,BlockSectionIcon as TM,ColumnWidthsIcon as nw,ColumnsIcon as sw,CornerIcon as EM,DirectionDownIcon as OM,DirectionLeftIcon as _M,DirectionRightIcon as RM,DirectionUpIcon as FM,EditIcon as AM,GapIcon as LM,GridIcon as BM,GroundIcon as lw,HashIcon as iw,HeightIcon as DM,ImageIcon as NM,ListIcon as MM,LocationIcon as qS,PaddingBottomIcon as cw,PaddingLeftIcon as dw,PaddingRightIcon as fw,PaddingTopIcon as uw,PageIcon as HM,StickyIcon as zM,SearchIcon as WM,SquareIcon as GM,TypeIcon as UM,WidthIcon as $M}from"efficient-easel/icons";import{jsx as Ne,Fragment as xr,jsxs as Ir}from"react/jsx-runtime";import{CaptionIcon as UL,DateIcon as $L,FlagIcon as jL,TitleIcon as KL,ButtonIcon as qL,DollarIcon as VL,HashIcon as YL,LinkIcon as XL,NoteIcon as ZL,TagIcon as JL,TextLinesIcon as QL}from"efficient-easel/icons";var Sb={body:QL,button:qL,link:XL,label:JL,number:YL,price:VL,note:ZL,name:jL,date:$L,caption:UL,title:KL},wb={eyebrow:Ir(xr,{children:[Ne("path",{d:"M5 6.5h5"}),Ne("path",{d:"M5 12.5h14"}),Ne("path",{d:"M5 18h11"})]}),heading:Ir(xr,{children:[Ne("path",{d:"M6.5 5v14"}),Ne("path",{d:"M17.5 5v14"}),Ne("path",{d:"M6.5 12h11"})]}),intro:Ir(xr,{children:[Ne("path",{d:"M4 5.5v13"}),Ne("path",{d:"M8 7.5h12"}),Ne("path",{d:"M8 12h12"}),Ne("path",{d:"M8 16.5h8"})]}),value:Ir(xr,{children:[Ne("rect",{x:"2.5",y:"7",width:"19",height:"10",rx:"2"}),Ne("path",{d:"M6.5 12h7"})]}),quote:Ir(xr,{children:[Ne("path",{d:"M9.5 5.5C7 7.2 5.5 9.7 5.5 12.8h4v5.7h-5v-5.7"}),Ne("path",{d:"M19.5 5.5c-2.5 1.7-4 4.2-4 7.3h4v5.7h-5v-5.7"})]}),tag:Ir(xr,{children:[Ne("rect",{x:"3",y:"5.5",width:"18",height:"13",rx:"2.5"}),Ne("path",{d:"M8 9.5h8"}),Ne("path",{d:"M12 9.5v5"})]}),meta:Ir(xr,{children:[Ne("path",{d:"M4 7h16"}),Ne("path",{d:"M4 14h3.5"}),Ne("path",{d:"M10.5 14h3"}),Ne("path",{d:"M17 14h3"})]})};function tu({noun:e,size:o=14,strokeWidth:t=1.8,className:r,style:a}){let n=Sb[e];return n?Ne("span",{className:r,style:{display:"inline-flex",...a},"aria-hidden":"true",children:Ne(n,{size:o})}):Ne("svg",{className:r,style:a,width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:t,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:wb[e]})}var Cee=Object.keys(Sb);var vee=Object.keys(wb);import{parseHexColor as eB}from"efficient-shell/format";var oB="#ffffff";function ru(e){return tB(e)?e:oB}function tB(e){return typeof e=="string"&&eB(e)===e.toLowerCase()}function Tee(e){return{"--bg":ru(e)}}function Cb(e,o){let t=e?.content;if(!Array.isArray(t))return null;for(let r of t){if(!r||typeof r!="object")continue;let{type:a,props:n}=r;if(n?.id===o)return null;if(au(r,o,0))return{type:typeof a=="string"?a:"",props:n??{}}}return null}function au(e,o,t){if(t>12||!e||typeof e!="object")return!1;if(Array.isArray(e))return e.some(a=>au(a,o,t+1));let r=e.props;return r&&typeof r=="object"&&r.id===o?!0:Object.values(e).some(a=>au(a,o,t+1))}function vb(e,o){let t=e?.content;return Array.isArray(t)?Nl(t,o,0)??[]:[]}function Nl(e,o,t){if(t>12||!e||typeof e!="object")return null;if(Array.isArray(e)){for(let a of e){let n=Nl(a,o,t+1);if(n)return n}return null}let r=e.props;if(r&&typeof r=="object"){if(r.id===o)return[];for(let a of Object.values(r)){let n=Nl(a,o,t+1);if(n)return[r,...n]}return null}for(let a of Object.values(e)){let n=Nl(a,o,t+1);if(n)return n}return null}import{SettingsDefaultReset as po,SettingsDrill as jM,SettingsField as Ye,SettingsGroup as KM,SettingsGroupSub as gse,SettingsSegmented as qM,SettingsBorder as VM,SettingsSidesEach as YM,SettingsSwitch as rp,borderSides as XM,borderStartEach as ZM}from"efficient-easel/panel";import{ListField as JM}from"efficient-easel/fields";import{DisplayChips as QM}from"efficient-shell/ui";function ba(e){if(!e||typeof e!="object"||Array.isArray(e))return{};let o={};for(let[t,r]of Object.entries(e))typeof r=="boolean"&&(o[t]=r);return o}function Ml(e,o){return ba(e)[o]!==!1}function nu(e,o,t){let r=ba(o)[t];return typeof r=="boolean"?r:Ml(e,t)}function kb(e){return Object.values(ba(e)).some(o=>o===!1)}function Pb(e){return Object.keys(ba(e)).length>0}function Tb(e,o,t){let r={...ba(e)};return t?delete r[o]:r[o]=!1,Object.keys(r).length?r:void 0}function Eb(e,o,t){return{...ba(e),[o]:t}}function _ee(e,o,t){let r=Ml(e,t),a=nu(e,o,t);return r&&a?"":!r&&!a?"hidden":r?"max-view-tablet:hidden":"view-tablet:hidden"}import{AlignmentGrid as eH,Checkbox as Cse,ColorSwatch as oH,CornersInput as tH,DatePicker as vse,DateTimePicker as rH,FOCAL_DEFAULT as kse,PictureTiles as aH,IconPicker as nH,IconButton as pw,InputNumber as VS,Slider as sH,Tooltip as ki}from"efficient-shell/ui";import{backendOf as rB}from"efficient-easel/screen/lib/session";var ze=rB,Hl=e=>e.blocks;async function Ob(e){let o=e.trim();if(!o)return null;let t=ze().geocode;if(!t)throw new Error("geocode_unavailable");return t.locate(o)}var su="Lookup busy \u2014 try again in a moment.",zl=e=>typeof e=="number"&&Number.isFinite(e);function Nee(e){return e.some(o=>{let t=o?.geocode;return t?t.pending||t.manual&&t.lat===void 0&&t.lng===void 0?!0:zl(t.lat)&&t.lat!==o.lat||zl(t.lng)&&t.lng!==o.lng:!1})}async function Mee(e,o,{geocode:t=Ob,courtesyGapMs:r=1100}={}){let a=s=>new Promise(l=>setTimeout(l,s)),n=e.slice();if(e.some(s=>s?.geocode?.pending)){let s=[],l=!1;for(let c of e){if(!c?.geocode?.pending){s.push(c);continue}l&&r>0&&await a(r),l=!0;try{let d=await t(o(c));s.push(d?{...c,lat:d.lat,lng:d.lng,geocode:{...c.geocode,pending:!1,ok:!0,status:`Found \u2014 ${d.label.split(",").slice(0,3).join(",").trim()}`,lat:d.lat,lng:d.lng}}:{...c,geocode:{...c.geocode,pending:!1,ok:!1,status:"No match \u2014 check the address and try again."}})}catch{s.push({...c,geocode:{...c.geocode,pending:!1,ok:!1,status:su}})}}n=s}return n.map(s=>{let l=s?.geocode;if(!l)return s;if(l.manual&&l.lat===void 0&&l.lng===void 0)return{...s,geocode:{...l,lat:s.lat,lng:s.lng}};let c=zl(l.lat)&&l.lat!==s.lat?l.lat:s.lat,d=zl(l.lng)&&l.lng!==s.lng?l.lng:s.lng;return c!==s.lat||d!==s.lng?{...s,lat:c,lng:d}:s})}import{keptByRow as lH}from"efficient-easel/screen/lib/document/style-fields";import{jsx as PB}from"react/jsx-runtime";import{useEffect as TB,useState as EB}from"react";import{clearRangeOf as OB,markSelection as _B,useCaretEdit as RB}from"efficient-easel/copy";import{TextToolbar as FB}from"efficient-shell/ui";import{applyMark as jee,markupTools as Kee,MARKUP_TOOLS as qee,COPY_FIELD_TOOLS as Vee,STOREFRONT_MARKUP as Yee,tokenizeInline as Xee,stripInline as Zee,isSafeLinkHref as Nb}from"efficient-shell/markup";import{applyMark as hB,clearStyle as xB,markedAt as IB,markupTools as gB,MARKUP_TOOLS as bB,parseMarkup as yB,RETIRED_MARKS as SB,STOREFRONT_MARKUP as wB,tokenizeInline as Qee}from"efficient-shell/markup";var gr=["highlight","strong","quiet"],br={highlight:"Highlight",strong:"Bold",quiet:"Quiet"},nt={highlight:{kind:"wordHighlight",delimiter:"@@"},strong:{kind:"wordStrong",delimiter:"++"},quiet:{kind:"wordQuiet",delimiter:"^^"}},Ab=Object.fromEntries(gr.map(e=>[nt[e].kind,e])),Lb="data-sf-ws",Wl=["accent","text","labels"],Bb={accent:"Accent",text:"Text",labels:"Labels"},xt={accent:"var(--accent)",text:"var(--fg)",labels:"var(--fg-dim)"},aB=80,nB=120,sB=100,lB=900,iB=.5,cB=3,dB=-.1,fB=.5,uB=3,lu={font:null,size:null,weight:null,bold:null,italic:null,lineGap:null,textGap:null,colour:null},pB={highlight:{...lu},strong:{...lu},quiet:{...lu}};function _b(e,o,t){return typeof e!="number"||!Number.isFinite(e)?null:Math.round(Math.min(Math.max(e,o),t))}function Rb(e,o,t){if(typeof e!="number"||!Number.isFinite(e))return null;let r=10**uB;return Math.round(Math.min(Math.max(e,o),t)*r)/r}function Fb(e){return typeof e=="boolean"?e:null}function mB(e){let o=typeof e?.font=="string"&&Mo.some(r=>r.key===e.font)?e.font:null,t=typeof e?.colour=="string"&&Wl.includes(e.colour)?e.colour:null;return{font:o,size:_b(e?.size,aB,nB),weight:_b(e?.weight,sB,lB),bold:Fb(e?.bold),italic:Fb(e?.italic),lineGap:Rb(e?.lineGap,iB,cB),textGap:Rb(e?.textGap,dB,fB),colour:t}}function Db(e){let o={};for(let t of gr)o[t]=e&&t in e&&e[t]?mB(e[t]):{...pB[t]};return o}function Wee(e){let o=Db(e),t={};for(let r of gr){let a=o[r],n=`--sf-ws-${r}`;if(a.font){let s=Mo.find(l=>l.key===a.font);s&&(t[`${n}-font`]=`var(${s.cssVar})`)}a.size!==null&&(t[`${n}-size`]=`${a.size/100}em`),a.weight!==null&&(t[`${n}-weight`]=String(a.weight)),a.bold!==null&&(t[`${n}-weight-bold`]=a.bold?"700":"400"),a.italic!==null&&(t[`${n}-style`]=a.italic?"italic":"normal"),a.lineGap!==null&&(t[`${n}-line`]=String(a.lineGap)),a.textGap!==null&&(t[`${n}-track`]=`${a.textGap}em`),a.colour!==null&&(t[`${n}-color`]=xt[a.colour])}return t}function Gee(e){let o=e?.word_styles??void 0,t={};for(let r of gr)o&&r in o&&(t[r]=o[r]??null);return Db(t)}var CB=new Set(["strong"]),Mb=gr.map(e=>({open:nt[e].delimiter,close:nt[e].delimiter,kind:nt[e].kind,...CB.has(e)?{wordStart:!0}:{}})),ooe=[{style:nt.highlight.kind,label:br.highlight,title:`${br.highlight} word style`},{style:nt.strong.kind,label:br.strong,title:`${br.strong} word style`},{style:nt.quiet.kind,label:br.quiet,title:`${br.quiet} word style`}],vB=new Set(Mb.map(e=>e.open)),yr=[...wB.filter(e=>!vB.has(e.open)),...Mb];function iu(e){return e.bullet?"- ":e.number!=null?`${e.number}. `:""}function Tn(e){return yB(typeof e=="string"?e:"",yr)}var kB=bB.map(e=>e.style).filter(e=>!SB.includes(e)).filter(e=>yr.some(o=>o.kind===e));function Hb(){return gB(kB)}var zb=Object.fromEntries(gr.map(e=>[nt[e].kind,nt[e].delimiter]));function Wb(e,o,t,r){let a=zb[r];if(!a)return hB(e,o,t,r);let n=e.slice(o,t),s=e.slice(Math.max(0,o-a.length),o),l=e.slice(t,t+a.length);if(s===a&&l===a)return{text:e.slice(0,o-a.length)+n+e.slice(t+a.length),selectionStart:o-a.length,selectionEnd:o-a.length+n.length};let c=n||"styled text";return{text:e.slice(0,o)+a+c+a+e.slice(t),selectionStart:o+a.length,selectionEnd:o+a.length+c.length}}function Gb(e,o,t,r){let a=zb[r];return a?o>=a.length&&e.slice(o-a.length,o)===a&&e.slice(t,t+a.length)===a:IB(e,o,t,r)}function Sr(e){return Tn(e).map(o=>iu(o)+$b(o.children)).join(`
2
2
  `)}function Ub(e,o,t){return xB(e,o,t,yr)}function $b(e){return e.map(o=>o.kind==="text"?o.text:$b(o.children)).join("")}function AB(e,o,t){return _B(e,o,t,Wb)}function jb(e,o){let t=OB(o,e.length),r=Ub(e,t.start,t.end);return r.text===e?null:r}function LB(e){let[o,t]=EB(null);return TB(()=>{let r=e.current?.ownerDocument??(typeof document>"u"?null:document);if(!r)return;let a=()=>{let n=e.current;if(!n||r.activeElement!==n)return;let s=n.selectionStart??n.value.length,l=n.selectionEnd??s;t(c=>c&&c.start===s&&c.end===l?c:{start:s,end:l})};return r.addEventListener("selectionchange",a),()=>r.removeEventListener("selectionchange",a)},[e]),[o,t]}function BB({target:e,value:o,onChange:t,disabled:r=!1,label:a="Formatting"}){let n=RB({target:e,onChange:t}),[s,l]=LB(e),c=p=>n(x=>{let g=AB(o,p,x);return l({start:g.selectionStart,end:g.selectionEnd}),g}),d=Hb(),u={};if(s)for(let p of d)u[p.style]=Gb(o,s.start,s.end,p.style);let h=r?null:jb(o,s);return PB(FB,{offered:new Set(d.map(p=>p.style)),onMark:p=>c(p),pressed:u,disabled:r,"aria-label":i(a),className:"sf-markup-bar",clear:h?{onClear:()=>n(()=>{let p=e.current,x=p&&p.ownerDocument.activeElement===p?{start:p.selectionStart??0,end:p.selectionEnd??0}:null,g=jb(o,x)??{text:o,selectionStart:x?.start??0,selectionEnd:x?.end??0};return l({start:g.selectionStart,end:g.selectionEnd}),g})}:void 0})}var cu=BB;import{deviceField as Ve}from"efficient-easel/screen/lib/document/device-fields";import{NO_CONTROL_FIELD as iH,NoControlMark as cH,noControlField as mw}from"efficient-easel/screen/lib/document/panel-no-control-mark";var du="__ownBox";function Kb(e){return!!e&&typeof e=="object"&&e[du]===!0}function Gl(e,o,t){return typeof e=="number"?e:typeof o=="number"?o:t}var Ul=void 0;import{phoneKey as Ra,tabletKey as dH}from"efficient-easel/draw";import{jsx as uu,Fragment as MB}from"react/jsx-runtime";import{createContext as HB,useContext as zB}from"react";var $l={ProductGrid:{source:{keep:["slug"]}},GalleryItem:{product:{keep:["code","finish"]}},FeaturedCover:{source:{keep:["slug"]}},LongRead:{source:{keep:["slug"]}}},jl={Events:["posts"],SubscribeBlogs:["posts"]};var DB=["anchor"],NB=/^href$|Href$|^url$|Url$|^link$|^mailto$|^tel$/;function En(e){return DB.includes(e)||NB.test(e)}var fu={Gallery:{source:{verb:"snapshot",keep:[]}},ProductHero:{source:{verb:"snapshot",keep:[]}},SpecTable:{source:{verb:"snapshot",keep:[]},wheel:{verb:"reference"},finish:{verb:"reference"},size:{verb:"reference"}},CollectionCard:{collection:{verb:"snapshot",keep:[]}},FooterMenu:{menu:{verb:"snapshot",keep:[]}},MenuBlock:{menu:{verb:"snapshot",keep:[]}},ProductGrid:{design_codes:{verb:"reference"}},ProductRef:{code:{verb:"reference"},finish:{verb:"reference"}},FitmentTable:{wheel:{verb:"reference"}},GalleryItem:{fromProduct:{verb:"reference"}},Footprint:{"offices[].group":{verb:"groupKey"},"offices[].lat":{verb:"pii"},"offices[].lng":{verb:"pii"},"offices[].geocode":{verb:"pii"}}};fu.ContactLocations={"locations[].lat":{verb:"pii"},"locations[].lng":{verb:"pii"},"locations[].mapsUrl":{verb:"pii"},"locations[].geocode":{verb:"pii"}};var moe=Object.fromEntries(Object.entries($l).map(([e,o])=>[e,Object.keys(o)])),hoe=Object.fromEntries(Object.entries(jl).map(([e,o])=>[e,[...o]]));import{NoControlMark as WB}from"efficient-easel/screen/lib/document/panel-no-control-mark";var qb=HB(!1);function Vb({children:e}){return uu(qb.Provider,{value:!0,children:e})}function GB(){return zB(qb)}function Yb({name:e,children:o}){return!GB()||!e||!UB(e)||En(e)?uu(MB,{children:o}):uu(WB,{})}function UB(e){return/^[A-Za-z0-9_$]+$/u.test(e)}function eo(e,o,t){return e.some(r=>(typeof r=="object"?r.value:r)===t)?t:o}var pu="off",mu="none",hu=[{label:"None",value:"off"},{label:"1, 2, 3",value:"plain"},{label:"01, 02, 03",value:"padded"},{label:"N\xB001, N\xB002",value:"numero"}],xu=[{label:"None",value:"none"},{label:"Hairline",value:"hairline"}];function voe(e){return eo(hu,pu,e)}function koe(e){return eo(xu,mu,e)}var Xb="sf-card-index",On="sf-card-index",Poe="pointer-events-none absolute left-[18px] top-[18px] z-10 border border-line bg-bg/70 px-2 py-1 font-mono text-[length:var(--size-label,10px)] uppercase tracking-[0.16em] text-fg-dim",$B={plain:`counter(${On})`,padded:`counter(${On}, decimal-leading-zero)`,numero:`"N\xB0" counter(${On}, decimal-leading-zero)`};function Toe(e,o){return o==="off"?"":`.${e}{counter-reset:${On}}.${e} .${Xb}{counter-increment:${On}}.${e} .${Xb}::before{content:${$B[o]}}`}function Eoe(e){return e==="hairline"?"border border-line hover:border-accent":""}var Zb=[{value:"1",label:"1st rendering"},{value:"2",label:"2nd rendering"},{value:"3",label:"3rd rendering"},{value:"4",label:"4th rendering"},{value:"5",label:"5th rendering"}];import{SCALAR_TEXT_CONTROLS as fH}from"efficient-easel/draw";import{jsx as st}from"react/jsx-runtime";import{SettingsDefaultReset as jB,SettingsField as Jb}from"efficient-easel/panel";import{useSelectedHost as KB}from"efficient-easel/easel";import{FOCAL_DEFAULT as qB}from"efficient-shell/format";import{ImageIcon as Qb,PlayIcon as ey}from"efficient-easel/icons";import{MediaUploadField as VB}from"efficient-shell/ui";import{useContext as YB}from"react";import{ScreenDocumentContext as XB}from"efficient-easel/screen/components/ScreenDocumentContext";import{phoneKey as ZB}from"efficient-easel/draw";import{usePreviewDevice as JB}from"efficient-easel/draw/client";import{shownTier as oy}from"efficient-easel/screen/lib/document/device-fields";import{requestMediaPick as QB}from"efficient-easel/screen/lib/media-picker";import{useEaselHost as eD}from"efficient-easel/screen/lib/host";import{useEaselSession as oD}from"efficient-easel/screen/lib/session-context";function tD(e,o,t){if(oy(t)==="tablet")return null;let r=oy(t)==="mobile",a=typeof e[o]=="string"&&e[o]?String(e[o]):qB,n=ZB(o),s=typeof e[n]=="string"&&e[n]?String(e[n]):void 0;return{phone:r,desktop:a,own:s,focus:r?s??a:a,key:r?n:o,twin:n}}function rD(e,o){let t=KB(),r=JB();if(!e||!t)return null;let a=t.values??{};if(o&&!o(a))return null;let n=tD(a,e,r);if(!n)return null;let s=t.onChange;return{phone:n.phone,desktop:n.desktop,own:n.own,focus:n.focus,set:l=>s(n.key,l),clear:()=>s(n.twin,Ul)}}function ty({value:e,onChange:o,label:t,accept:r,placeholder:a,focusKey:n,focusWhen:s,frameKey:l,fieldKey:c}){let d=eD(),u=oD(),h=i(t),p=r.startsWith("video"),x=rD(p?void 0:n,s),g=YB(XB),y=Iu(),E=l&&c?{video:c,frame:l}:null,_=k=>QB(d,{accept:r,title:h,...k?{file:k}:{}}).then(C=>!C||!E?C?.url??null:(y({[E.video]:C.url,[E.frame]:C.posterUrl??""}),null)),w=E?k=>k?o(k):y({[E.video]:"",[E.frame]:""}):o;if(g&&!g.capabilities.mediaEditing)return st(Jb,{label:h,icon:p?st(ey,{}):st(Qb,{}),children:st("div",{className:"sf-image-slot-inert",children:p?i("Templates don\u2019t store videos \u2014 this slot stays a placeholder. Each website picks its own after it\u2019s created."):i("Templates don\u2019t store images \u2014 this slot stays a placeholder. Each website picks its own after it\u2019s created.")})});let I=zt(e),v=x?.phone&&I?st(jB,{words:ee()?.panel,label:i("Image focus"),changed:!!x.own,detail:i("{value} on desktop",{value:x.desktop}),onReset:x.clear}):void 0;return st(Jb,{label:h,icon:p?st(ey,{}):st(Qb,{}),action:v,children:st("div",{style:{flex:"1 1 auto",minWidth:0},children:st(VB,{value:I,onChange:w,onPick:_,accept:p?"video/*":"image/*",kind:p?"video":"image",placeholder:a===void 0?void 0:i(a),maxSizeBytes:ze(u).media.maxUploadBytes,...x?{focus:x.focus,onFocusChange:x.set}:{}})})})}import{jsx as ry}from"react/jsx-runtime";import{useId as aD}from"react";import{FieldSelect as nD}from"efficient-easel/fields";import{SettingsField as sD}from"efficient-easel/panel";function lD(e){return e.map(({value:o,label:t,note:r})=>({value:o,label:t,...r?{meta:r}:{}}))}function ay({label:e,options:o,value:t,onChange:r,emptyLabel:a,icon:n,hint:s}){let l=aD(),c=`${l}-label`,d=`${l}-button`,u=Array.isArray(t)?t:[];return ry(sD,{label:i(e),labelId:c,icon:n,hint:s,children:ry(nD,{id:d,multiple:!0,value:u,options:lD(o),onChange:r,placeholder:a===void 0?i("None"):i(a),ariaLabelledBy:`${c} ${d}`,inline:!0})})}import{jsx as Ze,jsxs as Cr,Fragment as bD}from"react/jsx-runtime";import{useCallback as hy,useContext as yD,useId as gy,useRef as xy,useState as Iy}from"react";import{ThemeIcon as SD}from"efficient-easel/icons";import{Button as wD,useClickOutside as CD}from"efficient-shell/ui";import{SettingsField as vD}from"efficient-easel/panel";import{ScreenDocumentContext as kD}from"efficient-easel/screen/components/ScreenDocumentContext";import{useCallback as Cu,useEffect as cy,useRef as Yl}from"react";import{currentEaselSession as dD}from"efficient-easel/screen/lib/session";import{useEaselSession as fD}from"efficient-easel/screen/lib/session-context";import{useSyncExternalStore as iD}from"react";var sy,gu=null,wr=null,Kl=0,bu=new Set;function yu(e){sy=e;for(let o of bu)o()}function Su(e){gu=e,Kl+=1,wr&&clearTimeout(wr),wr=null,yu(void 0)}function ql(e){Kl+=1,yu(e)}function It(e=250){gu&&(wr&&clearTimeout(wr),wr=setTimeout(()=>{wr=null;let o=gu;if(!o)return;let t=++Kl;o().then(r=>{t===Kl&&yu(r)}).catch(()=>{})},e))}function ny(){return sy}function cD(e){return bu.add(e),()=>{bu.delete(e)}}function Vl(){return iD(cD,ny,ny)}var wu=new Set;function ly(e){return wu.add(e),()=>{wu.delete(e)}}async function iy(){let e=(await Promise.allSettled([...wu].map(async o=>o()))).find(o=>o.status==="rejected");if(e)throw e.reason}import{WebsiteBackendError as uD}from"efficient-easel/screen/lib/backend-error";function dy(e=dD()){return(o,t,r)=>{let a=ze(e).theme;return a?a.update(o,r?{siteId:r}:void 0):Promise.reject(new uD("invalid","This backend stores no site theme."))}}function fy(e){return e.themeFromDocument?{status:"skipped",reason:"template"}:e.token?null:{status:"skipped",reason:"no-token"}}async function pD(e,o=dy()){let{themeFromDocument:t,token:r,siteId:a,patch:n}=e,s=fy({themeFromDocument:t,token:r});if(s)return s;if(Object.keys(n).length===0)return{status:"skipped",reason:"empty"};try{return await o(n,r,a??void 0),{status:"saved"}}catch(l){return{status:"failed",error:l}}}function ya({themeFromDocument:e,tokenRef:o,siteId:t,onResult:r}){let a=Yl(null),n=Yl({}),s=fD(),l=Yl(r);l.current=r;let c=Yl(null),d=Cu(p=>{if(p.status==="skipped"){let x=`skipped:${p.reason}`;if(c.current===x)return;c.current=x}else c.current=null;l.current?.(p)},[]),u=Cu(async()=>{a.current&&(clearTimeout(a.current),a.current=null);let p=n.current;n.current={};let x=await pD({themeFromDocument:e,token:o?.current,siteId:t,patch:p},dy(s));return d(x),x.status==="saved"&&It(),x.status==="failed"&&(n.current={...p,...n.current}),x},[e,o,t,d,s]),h=Cu((p,x=!1)=>{let g=fy({themeFromDocument:e,token:o?.current});if(g){d(g);return}n.current={...n.current,...p},a.current&&clearTimeout(a.current),x?u():a.current=setTimeout(()=>{u()},500)},[e,o,u,d]);return cy(()=>()=>{u()},[u]),cy(()=>ly(async()=>{if(!a.current&&Object.keys(n.current).length===0)return;let p=await u();if(p.status==="failed")throw p.error}),[u]),{persist:h,flush:u}}var vu=[{role:"bg",token:"--bg",ink:!1},{role:"fg",token:"--fg",ink:!0},{role:"surface",token:"--site-surface",ink:!1},{role:"surface-2",token:"--site-surface-2",ink:!1},{role:"line",token:"--site-line",ink:!0},{role:"muted",token:"--fg-dim",ink:!0}],mD=vu.filter(e=>e.ink);function hD(e){let o={color:e.fg};for(let{role:t,token:r}of mD)o[r]=e[t];return o}var xD={fg:"var(--overlay-fg)",line:"color-mix(in srgb, var(--overlay-fg) 24%, transparent)",muted:"color-mix(in srgb, var(--overlay-fg) 76%, transparent)"},uy=Object.freeze(hD(xD));var Sa=-1,ID="sf-section-accent",py="Color",my=new Set(["CategoryBar","DocTabs"]),xte=new Set(["Flex"]),ku=0;function Ho(e){return e===Sa?null:typeof e=="number"&&Number.isInteger(e)&&e>=0?e:ku}function Pu(e){return e??Sa}function gD(e){let o=`--theme-preset-${e}`,t={"--sf-sec-accent":`var(${o}-accent)`,"--sf-sec-accent-2":`var(${o}-accent-2)`,"--sf-sec-accent-ink":`var(${o}-accent-ink)`};for(let{role:r}of vu)t[`--sf-sec-${r}`]=`var(${o}-${r}, var(--theme-${r}))`;return t}function Ite(e){let o=Ho(e.sectionAccent);return o===null?null:{className:ID,style:gD(o)}}var PD="Follow the page",Rte="Follow the slideshow",TD=e=>i("Editing {name} changes it everywhere.",{name:e});function ED({colors:e}){if(!e)return Ze("span",{className:"sf-secttheme-chip sf-secttheme-chip--none","aria-hidden":"true"});let o=tt(e);return Cr("span",{className:"sf-secttheme-chip","aria-hidden":"true",children:[Ze("i",{style:{background:o.background}}),Ze("i",{className:"sf-secttheme-chip-accent",style:{background:o.accent}})]})}function OD({themes:e,value:o,onPick:t,onEdit:r,menuId:a,followLabel:n}){return Cr("div",{className:"sf-multi-menu sf-secttheme-menu",id:a,role:"listbox",children:[n!==void 0&&Cr(bD,{children:[Cr("button",{type:"button",role:"option","aria-selected":o===null,className:`sf-secttheme-item${o===null?" is-active":""}`,onClick:()=>t(Sa),children:[Ze(ED,{}),Ze("span",{className:"sf-secttheme-name",children:i(n)})]}),Ze("div",{className:"sf-secttheme-sep",role:"presentation"})]}),o!==null&&e[o]&&Ze("p",{className:"sf-secttheme-oncard",role:"presentation",children:i("{name} is on this section",{name:Sn(o)})}),e.map((s,l)=>l===o?null:Ze(vl,{role:"option",index:l,colors:s,selected:!1,onPick:()=>t(l),onEdit:()=>r(l)},l))]})}function _D({index:e,colors:o,onChange:t,onDone:r}){let a=Sn(e),n=gy();return Cr("div",{className:"sf-secttheme-sheet",children:[Cr("div",{className:"sf-secttheme-sheet-head",children:[Ze("span",{children:a}),Ze(wD,{variant:"secondary",className:"sf-secttheme-done",onClick:r,children:i("Done")})]}),Ze("div",{className:"sf-secttheme-rows",children:Ze(Of,{colors:o,onChange:t,idPrefix:n})}),Ze("p",{className:"sf-secttheme-warn",children:TD(a)})]})}function by({value:e,onChange:o,followLabel:t,hint:r}){let{theme:a,setTheme:n}=ie(),s=ao(a),l=yD(kD),c=l?.tokenRef,d=l?.siteId??null,u=!l?.capabilities?.hasSiteTheme,{persist:h,flush:p}=ya({themeFromDocument:u,tokenRef:c,siteId:d}),x=ao(s),g=x.themes,y=Ho(e),E=y!==null?g[y]:void 0,_=E??(g.length?fa(x):void 0),[w,I]=Iy(!1),[v,k]=Iy(null),C=xy(null),F=xy(null),D=gy(),T=hy(()=>{I(!1),k(null)},[]),R=hy(()=>{!w&&v===null||(p(),T())},[w,v,T,p]);CD(C,R);let N=O=>{o(O),T()},b=O=>{if(v===null)return;let A=g.map((G,X)=>X===v?O:G),H={...x,themes:A};n(H),h({selected_preset:H.selected,theme_presets:H.themes})};return Cr("div",{className:"sf-secttheme",ref:C,children:[Ze(vD,{label:i("Theme"),icon:Ze(SD,{}),labelId:`${D}-label`,hint:r,children:Ze(wg,{colors:_,onEdit:y!==null?()=>{k(y),I(!1)}:void 0,name:E?Sn(y):i(t??PD),nameId:`${D}-value`,labelId:`${D}-label`,open:w,menuId:D,buttonRef:F,onClick:()=>{k(null),I(O=>!O)},onKeyDown:O=>{O.key==="Escape"&&(w||v!==null)&&(O.preventDefault(),T())}})}),w&&v===null&&Ze("div",{onKeyDown:O=>{O.key==="Escape"&&(O.preventDefault(),T(),F.current?.focus())},children:Ze(OD,{themes:g,value:y,onPick:N,onEdit:O=>{k(O),I(!1)},menuId:D,followLabel:t})}),v!==null&&g[v]&&Ze(_D,{index:v,colors:g[v],onChange:b,onDone:()=>{p(),T(),F.current?.focus()}})]})}import{jsx as yy}from"react/jsx-runtime";import{useId as RD}from"react";import{FieldSelect as FD}from"efficient-easel/fields";import{SettingsField as AD}from"efficient-easel/panel";function LD(e){return e.map(({value:o,label:t,group:r,thumb:a,meta:n})=>({value:o,label:t,...r!==void 0?{group:r}:{},...a!==void 0?{thumb:a}:{},...n!==void 0?{meta:n}:{}}))}function Mte({label:e,options:o,fallback:t,value:r,onChange:a,placeholder:n,bare:s=!1,icon:l}){let c=RD(),d=`${c}-label`,u=`${c}-button`,h=r??"",p=o.some(E=>E.value===h)?h:t,x=i(e),g=n===void 0?void 0:i(n),y=yy(FD,{id:u,value:p,options:LD(o),onChange:a,placeholder:g,searchPlaceholder:g,...s?{ariaLabel:x}:{ariaLabelledBy:`${d} ${u}`},searchable:!0,groupCount:!0,inline:!0});return s?y:yy(AD,{label:x,labelId:d,icon:l,children:y})}import{jsx as kr,jsxs as fN}from"react/jsx-runtime";import{SettingsField as jy}from"efficient-easel/panel";import{LinkIcon as uN}from"efficient-easel/icons";import{LinkPicker as pN,TextLinkField as mN}from"efficient-shell/ui";import{useEffect as $y,useMemo as Ql,useRef as hN,useState as Jl}from"react";import{currentEaselSession as BD}from"efficient-easel/screen/lib/session";function Sy(){return BD().auth.token}import{currentEaselSession as xN}from"efficient-easel/screen/lib/session";import{useScreenDocument as IN}from"efficient-easel/screen/components/ScreenDocumentContext";var DD=()=>({choosePage:i("Choose a page"),chooseSection:i("Choose a section"),noSections:i("No section anchors yet"),sectionHint:i("Jumps to a section on that page."),choosePost:i("Choose a post"),chooseProduct:i("Choose a product"),choosePopup:i("Choose a popup")});function wy(e,o,t){if(!e)return"page";if(mb(e))return"popup";if(e.startsWith("/journal/"))return"blog";if(Ib(e))return"product";if(e.includes("#")){let r=e.slice(0,e.indexOf("#"));if(r===""||r==="/"||o.includes(r))return"anchor"}return e==="/"||o.includes(e)||t&&t.listingPaths.includes(t.targetOf(e))?"page":"custom"}function Tu(e,o){let t=DD(),r=e.pages.map(u=>({value:Pn(u.slug),label:u.title})),a=o?.pageOptions?o.pageOptions(r):r,n=a.map(u=>u.value),s=e.pages.map(u=>({label:u.title,options:xb(...u.docs).map(h=>({value:Dl(u.slug,h.slug),label:h.name}))})).filter(u=>u.options.length>0),l=u=>{switch(u){case"page":return{type:"select",options:a,placeholder:t.choosePage};case"anchor":return{type:"groups",groups:s,placeholder:s.length?t.chooseSection:t.noSections};case"blog":return{type:"select",options:e.posts.map(h=>({value:hb(h.slug),label:h.title||h.slug})),placeholder:t.choosePost};case"product":return{type:"select",options:e.products.map(h=>({value:h.href,label:h.name||h.href})),placeholder:t.chooseProduct};case"popup":return{type:"select",options:(e.popups??[]).map(h=>({value:pb(h.slug),label:h.title||h.slug})),placeholder:t.choosePopup};case"custom":return{type:"text"}}},c=ub(e.offers).map(u=>({value:u.value,label:i(u.label),target:l(u.value),...u.value==="anchor"?{hint:t.sectionHint}:{},...u.value==="blog"||u.value==="product"||u.value==="popup"?{hideWhenEmpty:!0}:{}}));if(!o)return{kinds:c,rules:{kindOf:u=>wy(u,n),targetOf:u=>u,readFilter:()=>null,withFilter:u=>u}};let d=u=>{let h=o.withFilter(u,null);return o.listingPaths.includes(h)?h:u};return{kinds:c,rules:{kindOf:u=>wy(u,n,{listingPaths:o.listingPaths,targetOf:d}),targetOf:d,readFilter:o.readFilter,withFilter:o.withFilter},filtersFor:u=>o.listingPaths.includes(u)?o.filtersFor(u):null}}import{useEaselSession as gN}from"efficient-easel/screen/lib/session-context";var $=e=>typeof e=="number"&&Number.isFinite(e)?e:void 0;function no(e,o){if(typeof e=="string")return e||o;if(e&&typeof e=="object"&&"text"in e){let t=e.text;return he(t)??o}return o}function Cy(e,o){return $(e)??o}function Gt(e,o){return typeof e=="boolean"?e:o}function Xl(e,o){if(!Array.isArray(e))return o;let t=e.map(r=>typeof r=="string"?r:no(r?.text,"")).map(r=>r.trim()).filter(Boolean);return t.length?t:o}var ky=["delay","scroll","exit"],Py=["all","chosen","except"],Ty=["visit","days","never","once"],ND=["all","desktop","phone"],MD=["stop","continue"],Ey={min:0,max:60},Oy={min:10,max:90},_y={min:1,max:90},Wo={autoOpen:!1,trigger:"delay",autoOpenDelaySec:15,scrollPercent:50,showOn:"all",showOnPages:[],devices:"all",hideAfter:"days",hideDays:7,afterSubmit:"stop",startDate:null,endDate:null};function zo(e,o,t){return typeof o=="string"&&e.includes(o)?o:t}function wa(e,o,t){let r=Cy(e,t);return Math.min(o.max,Math.max(o.min,Math.round(r)))}function HD(e){return typeof e.hideAfter=="string"?zo(Ty,e.hideAfter,Wo.hideAfter):e.oncePerSession===!0?"visit":e.oncePerSession===!1?"never":Wo.hideAfter}function zD(e){return Array.isArray(e)?e.map(o=>typeof o=="string"?o.trim():"").filter(Boolean).map(o=>o.startsWith("/")?o:`/${o}`):[]}function vy(e){if(typeof e!="string")return null;let o=e.trim();return/^\d{4}-\d{2}-\d{2}$/.test(o)?o:null}function Ry(e){let o=e??{},t=Wo;return{autoOpen:Gt(o.autoOpen,t.autoOpen),trigger:zo(ky,o.trigger,t.trigger),autoOpenDelaySec:wa(o.autoOpenDelaySec,Ey,t.autoOpenDelaySec),scrollPercent:wa(o.scrollPercent,Oy,t.scrollPercent),showOn:zo(Py,o.showOn,t.showOn),showOnPages:zD(o.showOnPages),devices:zo(ND,o.devices,t.devices),hideAfter:HD(o),hideDays:wa(o.hideDays,_y,t.hideDays),afterSubmit:zo(MD,o.afterSubmit,t.afterSubmit),startDate:vy(o.startDate),endDate:vy(o.endDate)}}import{parseHexColor as WD}from"efficient-shell/format";var Oo="#000000";var Eu="popup",GD=Ia,UD=["auto","full"],$D=["inside","outside","none"],jD={min:240,max:1440},KD={min:0,max:100},_n={placement:"center",fullWidth:!1,width:720,height:"auto",tintColor:Oo,tintOpacity:60,outsideClick:!0,closeButton:"inside"};function qD(e,o){let t=typeof e=="string"?e.trim():"";return t&&WD(t)===t.toLowerCase()?t:o}function Fy(e,o=_n){let t=e??{},r=o;return{placement:zo(GD,t.placement,r.placement),fullWidth:Gt(t.fullWidth,r.fullWidth),width:wa(t.width,jD,r.width),height:zo(UD,t.height,r.height),tintColor:qD(t.tintColor,r.tintColor),tintOpacity:wa(t.tintOpacity,KD,r.tintOpacity),outsideClick:Gt(t.outsideClick,r.outsideClick),closeButton:zo($D,t.closeButton,r.closeButton)}}var Ay="cart-drawer",sre="cart-drawer",VD={kickerBadge:"",kickerText:"Your order",titleLead:"Your",titleAccent:"cart.",subtitleEmpty:"Empty for now.",subtitleOne:"One set in your cart.",subtitleMany:"{count} sets in your cart.",leadTimeValue:"",shipsToFallback:"",promises:[],emptyKicker:"No wheels yet",emptyBody:"Your cart is empty. Pick a wheel to get started."};function lre(e,o){return o===0?e.subtitleEmpty:o===1?e.subtitleOne:e.subtitleMany.replace("{count}",String(o))}function ire(e){let o=e??{},t=VD;return{kickerBadge:no(o.kickerBadge,t.kickerBadge),kickerText:no(o.kickerText,t.kickerText),titleLead:no(o.titleLead,t.titleLead),titleAccent:no(o.titleAccent,t.titleAccent),subtitleEmpty:no(o.subtitleEmpty,t.subtitleEmpty),subtitleOne:no(o.subtitleOne,t.subtitleOne),subtitleMany:no(o.subtitleMany,t.subtitleMany),leadTimeValue:no(o.leadTimeValue,t.leadTimeValue),shipsToFallback:no(o.shipsToFallback,t.shipsToFallback),promises:Xl(o.promises,t.promises),emptyKicker:no(o.emptyKicker,t.emptyKicker),emptyBody:no(o.emptyBody,t.emptyBody)}}var cre={..._n,width:520,tintOpacity:68};var By="consent-banner",pre="consent-banner";var YD=[{value:"bar",label:"Bar"},{value:"card",label:"Card"}],mre="Layout",Ly={layout:"bar"},XD=e=>YD.some(o=>o.value===e);function hre(e){let o=no((e??{}).layout,Ly.layout);return{layout:XD(o)?o:Ly.layout}}var xre={..._n,placement:"bottom-center",fullWidth:!0,width:440,tintOpacity:0,outsideClick:!1,closeButton:"none"};var ZD="consentWords",JD=["eyebrow","notice","accept","reject","choose"];function Ou(e){let o=(e??{})[ZD];return typeof o=="string"&&JD.includes(o)?o:null}function _u(e){let o=e?.props;return o?Ou(o)!==null?!0:Object.values(o).some(t=>Array.isArray(t)&&t.some(r=>r&&typeof r=="object"&&"props"in r&&_u(r))):!1}var QD=["meta","eyebrow","heading","body","statName","statValue","formEyebrow","formHeading","formIntro","fieldLabel","option","finePrint","dismiss","doneHeading","doneBody"],bre={meta:"Meta line",eyebrow:"Eyebrow",heading:"Heading",body:"Body",statName:"Stat name",statValue:"Stat value",formEyebrow:"Form eyebrow",formHeading:"Form heading",formIntro:"Form intro",fieldLabel:"Field label",option:"Option",finePrint:"Fine print",dismiss:"Dismiss link",doneHeading:"Success heading",doneBody:"Success message"},eN={meta:"styleMeta",eyebrow:"styleEyebrow",heading:"styleHeading",body:"styleBody",statName:"styleStatName",statValue:"styleStatValue",formEyebrow:"styleFormEyebrow",formHeading:"styleFormHeading",formIntro:"styleFormIntro",fieldLabel:"styleFieldLabel",option:"styleOption",finePrint:"styleFinePrint",dismiss:"styleDismiss",doneHeading:"styleDoneHeading",doneBody:"styleDoneBody"},yre={meta:{font:"--pp-meta-font",size:"--pp-meta-size"},eyebrow:{font:"--pp-eyebrow-font",size:"--pp-eyebrow-size"},heading:{font:"--pp-heading-font",size:"--pp-heading-size"},body:{font:"--pp-body-font",size:"--pp-body-size"},statName:{font:"--pp-statname-font",size:"--pp-statname-size"},statValue:{font:"--pp-statvalue-font",size:"--pp-statvalue-size"},formEyebrow:{font:"--pp-formeyebrow-font",size:"--pp-formeyebrow-size"},formHeading:{font:"--pp-formheading-font",size:"--pp-formheading-size"},formIntro:{font:"--pp-formintro-font",size:"--pp-formintro-size"},fieldLabel:{font:"--pp-fieldlabel-font",size:"--pp-fieldlabel-size"},option:{font:"--pp-option-font",size:"--pp-option-size"},finePrint:{font:"--pp-fineprint-font",size:"--pp-fineprint-size"},dismiss:{font:"--pp-dismiss-font",size:"--pp-dismiss-size"},doneHeading:{font:"--pp-doneheading-font",size:"--pp-doneheading-size"},doneBody:{font:"--pp-donebody-font",size:"--pp-donebody-size"}};function Dy(e){let o={};for(let t of QD){let r=mt(e[eN[t]]);r&&(o[t]=r)}return o}var Ny={heading:"Join our email list",placeholder:"Email address",buttonLabel:"Subscribe"},oN={lead:"We accept"},My={...oN,methods:[],size:"sm",align:"start",dataSource:"shop-payment-methods"},Go="site-footer";var wre=Go,Cre={desktop:!0,tablet:!0,mobile:!0},vre={desktop:!1,tablet:!1,mobile:!1},Ru=1,Hy=6,kre=Array.from({length:Hy-Ru+1},(e,o)=>Ru+o),Zl={desktop:6,tablet:3,mobile:2},tN={2:{desktop:2,tablet:2,mobile:1},3:{desktop:3,tablet:3,mobile:1},4:{desktop:4,tablet:2,mobile:2},5:{desktop:5,tablet:3,mobile:2},6:{desktop:6,tablet:3,mobile:2}},vr=e=>Math.min(Math.max(Math.round(e),Ru),Hy);function Pre(e){if(typeof e=="number")return tN[vr(e)]??{desktop:vr(e),tablet:vr(e),mobile:vr(e)};if(e&&typeof e=="object"){let o=e;return{desktop:vr(o.desktop??Zl.desktop),tablet:vr(o.tablet??Zl.tablet),mobile:vr(o.mobile??Zl.mobile)}}return{...Zl}}var Fu="subscribe-popup",Lre="subscribe-popup",rN=[Fu,Go,Ay,By];function Wy(e){return rN.includes(e)}var aN=["right","left"],nN={metaLabel:"Meta label",issueLabel:"Label",issueNumber:"00",kicker:"Kicker",heading:`Main heading
3
3
  *Highlight line*`,deck:"Add a sentence or two of supporting copy.",stats:[{label:"Label",value:"Value"},{label:"Label",value:"Value"},{label:"Label",value:"Value"},{label:"Label",value:"Value"}],formLabel:"Section label",formHeading:"Main heading *highlight*",formIntro:"Add a sentence or two of supporting copy.",firstNameLabel:"Field label",firstNamePlaceholder:"Placeholder",emailLabel:"Field label",emailPlaceholder:"Placeholder",interestsLabel:"Field label",interests:["Option one","Option two","Option three"],frequencyLabel:"Field label",frequencies:["Option one","Option two","Option three"],submitText:"Button label",finePrint:"Fine print",dismissText:"Dismiss link",emailInvalidText:"Enter a valid email address.",submitErrorText:"Could not subscribe right now. Please try again.",successHeading:"Main heading *highlight*",successBody:"Add a sentence or two of supporting copy \u2014 the {email} and {issue} tokens are substituted here.",keepBrowsingText:"Button label",autoOpen:Wo.autoOpen,autoOpenDelaySec:Wo.autoOpenDelaySec,formSlug:"",trigger:Wo.trigger,scrollPercent:Wo.scrollPercent,showOn:Wo.showOn,showOnPages:[],hideAfter:Wo.hideAfter,hideDays:Wo.hideDays,formSide:"right",valuePanelOnPhone:!1,sectionAccent:void 0,sectionCorners:void 0,sectionCornerSides:void 0,textStyles:{}},We=no,sN=Gt,Gy=Xl;function zy(e,o){if(e==null)return o;let t=r=>r.trim()?r:"";if(typeof e=="string")return t(e);if(typeof e=="object"&&"text"in e){let r=e.text;return typeof r=="string"?t(r):""}return o}function lN(e,o){return Array.isArray(e)?Gy(e,[]):o}function iN(e,o){return Array.isArray(e)?e.map(t=>{let r=t??{};return{label:We(r.label,""),value:We(r.value,"")}}).filter(t=>t.label||t.value):o}function Dre(e){let o=e??{},t=nN,r=Ry(o);return{metaLabel:We(o.metaLabel,t.metaLabel),issueLabel:zy(o.issueLabel,t.issueLabel),issueNumber:zy(o.issueNumber,t.issueNumber),kicker:We(o.kicker,t.kicker),heading:We(o.heading,t.heading),deck:We(o.deck,t.deck),stats:iN(o.stats,t.stats),formLabel:We(o.formLabel,t.formLabel),formHeading:We(o.formHeading,t.formHeading),formIntro:We(o.formIntro,t.formIntro),firstNameLabel:We(o.firstNameLabel,t.firstNameLabel),firstNamePlaceholder:We(o.firstNamePlaceholder,t.firstNamePlaceholder),emailLabel:We(o.emailLabel,t.emailLabel),emailPlaceholder:We(o.emailPlaceholder,t.emailPlaceholder),interestsLabel:We(o.interestsLabel,t.interestsLabel),interests:Gy(o.interests,t.interests),frequencyLabel:We(o.frequencyLabel,t.frequencyLabel),frequencies:lN(o.frequencies,t.frequencies),submitText:We(o.submitText,t.submitText),finePrint:We(o.finePrint,t.finePrint),dismissText:We(o.dismissText,t.dismissText),emailInvalidText:We(o.emailInvalidText,t.emailInvalidText),submitErrorText:We(o.submitErrorText,t.submitErrorText),successHeading:We(o.successHeading,t.successHeading),successBody:We(o.successBody,t.successBody),keepBrowsingText:We(o.keepBrowsingText,t.keepBrowsingText),formSlug:typeof o.formSlug=="string"?o.formSlug.trim():t.formSlug,autoOpen:r.autoOpen,autoOpenDelaySec:r.autoOpenDelaySec,trigger:r.trigger,scrollPercent:r.scrollPercent,showOn:r.showOn,showOnPages:r.showOnPages,hideAfter:r.hideAfter,hideDays:r.hideDays,formSide:zo(aN,o.formSide,t.formSide),valuePanelOnPhone:sN(o.valuePanelOnPhone,t.valuePanelOnPhone),sectionAccent:o.sectionAccent,sectionCorners:o.sectionCorners,sectionCornerSides:o.sectionCornerSides,textStyles:Dy(o)}}function cN(e,o=Math.random){for(;;){let t=`popup-${Math.floor(o()*2176782336).toString(36).padStart(6,"0")}`;if(!e.has(t))return t}}function dN(e){return{root:{props:{title:e,kind:Eu}},content:[],zones:{}}}function Uy(e,o,t){return{slug:cN(o,t),title:e,kind:"lightbox",layout:dN(e)}}function Rn(e){return e?.root?.props?.kind===Eu}function Ky(e){let o=new Map;return(t="")=>{let r=Sy(),a=o.get(t);if(!a||a.token===null&&r!==null){let n=r||!xN().usesBridgedToken?e(r??"",t).catch(()=>[]):Promise.resolve([]);return o.set(t,{promise:n,token:r}),n}return a.promise}}var bN=Ky(async(e,o)=>{let t=o?{siteId:o}:void 0,{pages:r}=ze();return r.linkTargets?r.linkTargets(t):(await r.list(t)).map(a=>({id:a.id,slug:a.slug,label:a.label,layout:null}))}),yN=Ky(async(e,o)=>await ze().blog?.posts(o?{siteId:o}:void 0)??[]);function SN({value:e,onChange:o,label:t="Link",data:r,filters:a}){let n=Ql(()=>Tu(r,a),[r,a]),s=i(t);return kr(jy,{label:s,icon:kr(uN,{}),children:kr(pN,{value:e,onChange:l=>o(l),kinds:n.kinds,rules:n.rules,filtersFor:n.filtersFor,label:s})})}function qy(){let{siteId:e,capabilities:o}=IN(),{offersCommerce:t,hasBlog:r}=o,[a,n]=Jl([]),[s,l]=Jl([]),[c,d]=Jl([]),[u,h]=Jl(null),p=gN().chrome,x=p?.products?.list,g=p?.linkFilters,y=g?void 0:p?.linkRow,E=hN(!0);$y(()=>(E.current=!0,()=>{E.current=!1}),[]),$y(()=>{let I=!0;return bN(e??void 0).then(v=>I&&E.current&&n(v)),r&&yN(e??void 0).then(v=>I&&E.current&&l(v)),t&&x?.().then(v=>I&&E.current&&d(v)),t&&g?g.load(e).catch(()=>null).then(v=>I&&E.current&&h(()=>v)):h(null),()=>{I=!1}},[e,t,r,x,g]);let _=Ql(()=>({pages:a.filter(I=>!Wy(I.slug)&&!Rn(I.layout)).map(I=>({slug:I.slug,title:I.label,docs:[I.layout]})),popups:a.filter(I=>I.slug===Fu||Rn(I.layout)).map(I=>({slug:I.slug,title:I.label})),posts:r?s.map(I=>({slug:I.slug,title:I.title})):[],products:t?c.map(I=>({href:I.href,name:I.name})):[],offers:{offersCommerce:t,offersService:r}}),[a,s,c,t,r]),w=Ql(()=>u?u(_.pages):null,[u,_]);return{data:_,filters:w,pages:a,offersCommerce:t,HostLinkRow:y}}function oae({label:e,icon:o,text:t,onTextChange:r,link:a,onLinkChange:n}){let{data:s,filters:l}=qy(),c=Ql(()=>Tu(s,l),[s,l]),d=i(e);return kr(jy,{label:d,icon:o,children:kr(mN,{label:d,text:t,onTextChange:r,link:a,onLinkChange:u=>n(u),kinds:c.kinds,rules:c.rules,filtersFor:c.filtersFor})})}function Vy({value:e,onChange:o,label:t="Link"}){let r=typeof e=="string"?e:"",{data:a,filters:n,pages:s,offersCommerce:l,HostLinkRow:c}=qy(),d=a.pages.map(h=>Pn(h.slug)),u=l&&c&&(r==="/"||d.includes(r))?c:void 0;return fN("div",{children:[kr(SN,{value:r,onChange:o,label:t,data:a,filters:n}),u&&kr(u,{value:r,onChange:o,pages:s})]})}import{UiIcon as YS}from"efficient-easel/draw/client";import{phoneKey as ON,tabletKey as _N}from"efficient-easel/draw";import{AUTO_RULES as vN,FOLLOW_RULES as kN,VIEW_DESKTOP_MIN as PN,VIEW_TABLET_MIN as Zy,isAuto as TN,resolveViewValue as EN}from"efficient-easel/draw";import{VIEW_DESKTOP_MIN as wN,VIEW_TABLET_MIN as Xy}from"efficient-easel/screen/lib/content/view-tiers";var Au="v1",CN=e=>e==="v2"?Xy:800,Yy={"view-tablet":Xy,"view-desktop":wN,"view-wide":CN(Au)};function aae(e){let o=e.startsWith("max-"),t=o?e.slice(4):e;if(t in Yy)return{px:Yy[t],max:o};let r=/^(max|min)-\[(\d+)px\]$/.exec(e);return r?{px:Number(r[2]),max:r[1]==="max"}:void 0}function ei(){return Au==="v2"?vN:kN}var Jy=.02,Qy=`(min-width: ${Zy}px) and (max-width: ${PN-Jy}px)`,Ca=`(max-width: ${Zy-Jy}px)`;function Ut(e,o,t,r,a=ei()){let n=EN(e,o,t,r,a),s={},l=(c,d)=>!TN(c)||d!=null&&d!==o;return l(t,n.tablet)&&(s.tablet=n.tablet),l(r,n.phone)&&(s.phone=n.phone),s}var Uo={min:10,max:200,step:10};function RN(e,o){let t=$(e),r=$(o);if(!(t===void 0&&r===void 0))return{paddingTop:t,paddingBottom:r}}var FN="sf-pad-top-phone",AN="sf-pad-bottom-phone",LN="--sf-pad-t-phone",BN="--sf-pad-b-phone",DN="sf-pad-left-phone",NN="sf-pad-right-phone",MN="--sf-pad-l-phone",HN="--sf-pad-r-phone",zN="sf-pad-top-tablet",WN="sf-pad-bottom-tablet",GN="sf-pad-left-tablet",UN="sf-pad-right-tablet",$N="--sf-pad-t-tablet",jN="--sf-pad-b-tablet",KN="--sf-pad-l-tablet",qN="--sf-pad-r-tablet";function oi(e){let o=RN(e.top,e.bottom),t=Lu({left:e.left,right:e.right},{top:e.topPhone,bottom:e.bottomPhone,left:e.leftPhone,right:e.rightPhone},{top:e.topTablet,bottom:e.bottomTablet,left:e.leftTablet,right:e.rightTablet},{top:e.top,bottom:e.bottom,left:e.left,right:e.right});return o===void 0&&!t.classes.length&&!Object.keys(t.style).length?null:{className:["sf-section-pad",...t.classes].join(" "),style:{...o,...t.style}}}var VN=[["top","paddingTop",[zN,$N],[FN,LN]],["bottom","paddingBottom",[WN,jN],[AN,BN]],["left","paddingLeft",[GN,KN],[DN,MN]],["right","paddingRight",[UN,qN],[NN,HN]]];function Lu(e,o,t={},r=e){let a={},n={},s=[];for(let[l,c,...d]of VN){let u=$(e[l]);u!==void 0&&(a[c]=u);let h=Ut("spacing",$(r[l]),$(t[l]),$(o[l]));for(let[p,[x,g]]of[["tablet",d[0]],["phone",d[1]]]){let y=h[p];typeof y=="number"&&(s.push(x),n[g]=`${y}px`)}}return{classes:s,style:{...a,...n}}}function eS(e,o,t){let r=$(e)??t,a=$(o);return r===void 0?a:a===void 0?r:r+a}function ti(e,o={}){return{top:eS(e.padTop,e.sectionPaddingTop,o.top),bottom:eS(e.padBottom,e.sectionPaddingBottom,o.bottom)}}var Bu={top:"sectionPaddingTop",bottom:"sectionPaddingBottom",left:"sectionPaddingLeft",right:"sectionPaddingRight"};function oS(e,o=Bu,t=!0){let r={};for(let a of t?["top","bottom","left","right"]:["top","bottom"])r[a]=e[o[a]],r[`${a}Tablet`]=e[_N(o[a])],r[`${a}Phone`]=e[ON(o[a])];return r}function uae(e){return oi(e)}function pae(e,o){let t=r=>typeof r=="number"?r+o:void 0;return oi({...e,top:t(e.top),bottom:t(e.bottom),topTablet:t(e.topTablet),bottomTablet:t(e.bottomTablet),topPhone:t(e.topPhone),bottomPhone:t(e.bottomPhone)})}import{BUTTON_PAD_KEYS as ri,buttonBorderOf as YN,buttonFillOpacityOf as XN,buttonPadSidesOf as ZN}from"efficient-easel/draw";var JN="px-6 py-4",QN=4,ai=e=>{let o=new RegExp(`\\bp${e}-(?:\\[(\\d+)px\\]|(\\d+))`).exec(JN);if(!o)throw new Error(`BUTTON_PAD_CLASSES has no p${e}`);return o[1]!==void 0?Number(o[1]):Number(o[2])*QN},yae={top:ai("y"),right:ai("x"),bottom:ai("y"),left:ai("x")},rS="var(--btn)";function e2(e){let o=e.variant==="ghost",t=XN(e.buttonFillOpacity),r=YN(e.buttonBorder),a=he(e.buttonColor);return{fillOpacity:t??(o?0:100),border:{width:r?.width??1,color:r?.color??a??(o?"currentColor":rS)},changed:t!==void 0||r!==void 0}}function Sae(e){let o=e2(e);if(!o.changed)return null;let t=he(e.buttonColor)??rS;return{background:o.fillOpacity===0?"transparent":o.fillOpacity===100?t:`color-mix(in srgb, ${t} ${o.fillOpacity}%, transparent)`,borderWidth:o.border.width,borderStyle:"solid",borderColor:o.border.color}}var o2="var(--sf-button-radius, 0)";function wae(e){let o=$(e.buttonCorners),t=at(e.buttonCornerSides);if(o===void 0&&t===null)return null;let r=o===void 0?o2:`${Math.max(0,o)}px`;return{borderRadius:t===null?r:mr(r,t)}}function Cae(e){let o=a=>ZN({top:e[`${ri.top}${a}`],right:e[`${ri.right}${a}`],bottom:e[`${ri.bottom}${a}`],left:e[`${ri.left}${a}`]})??{},{classes:t,style:r}=Lu(o(""),o("Phone"),o("Tablet"));return Object.keys(r).length?{className:t.join(" "),style:r}:null}var tS="upper";function aS(e,o,t){let r=e&&typeof e=="object"?e:{},a=he(r.textStyle),n=a?he(o?.find(u=>u?.id===a)?.name):void 0,s=a?/^(heading|body)-(\d+)$/.exec(a):null,l=a?n||(s?t.styleName({kind:s[1],n:Number(s[2])}):a):t.noStyle,{cases:c}=t,d=he(r.case)??tS;return`${l} \xB7 ${c[d]??c[tS]}`}import{usePreviewParts as uH}from"efficient-easel/draw/client";import{encodePartId as pH}from"efficient-easel/draw";import{DEFAULT_EASEL_STRINGS as mH,useEaselStrings as hH}from"efficient-easel/strings";var t2=["auto","fixed","screen"],r2=["px","%"];var a2="var(--sf-header-h, 88px)",Du={min:40,max:2e3,step:10,fallback:600},Nu={min:10,max:200,step:5,fallback:100},n2="sf-section-minh",Mu="grid-cols-[minmax(0,1fr)]",nS={base:"--sf-section-minh",small:"--sf-section-minh-s"},lS=e=>typeof e=="string"&&t2.includes(e),s2=e=>typeof e=="string"&&r2.includes(e);function ni(e){let o=lS(e.sectionHeightMode)?e.sectionHeightMode:"auto",t=o==="screen"?"%":s2(e.sectionHeightUnit)?e.sectionHeightUnit:"px",r=o==="screen"?Nu.fallback:Du.fallback,a=typeof e.sectionHeightValue=="number"?e.sectionHeightValue:r;return{mode:o,value:a,unit:t}}function iS(e){let{mode:o,value:t,unit:r}=ni(e);if(o==="auto")return;if(o==="fixed"&&r==="px")return[`${t}px`,null];let a=t/100,n=s=>o==="screen"?`(100${s} - ${a2})`:`100${s}`;return[`calc(${n("vh")} * ${a})`,`calc(${n("svh")} * ${a})`]}function cS(e){let o=iS(e);if(!o)return;let[t,r]=o;return{display:"grid",[nS.base]:t,...r?{[nS.small]:r}:{}}}var kae=new Set(["Hero","HeroSingle","IntroBleed","CategoryBar","DocTabs"]),va="Height",l2="sf-section-minh-phone",sS={base:"--sf-section-minh-p",small:"--sf-section-minh-ps"};function Hu(e){return lS(e.sectionHeightModePhone)}function Pae(e){return ni({sectionHeightMode:e.sectionHeightModePhone,sectionHeightValue:e.sectionHeightValuePhone,sectionHeightUnit:e.sectionHeightUnitPhone})}function i2(e){let o=cS(e),t=Hu(e)?iS({sectionHeightMode:e.sectionHeightModePhone,sectionHeightValue:e.sectionHeightValuePhone,sectionHeightUnit:e.sectionHeightUnitPhone})??(o?["auto",null]:void 0):void 0;if(!o&&!t)return null;let r=[n2,Mu],a={...o??{}};return t&&(r.push(l2),a[sS.base]=t[0],t[1]&&(a[sS.small]=t[1])),{className:r.join(" "),style:a}}function c2(e){return i2(e)!==null}var d2=`grid ${Mu}`,dS="h-full",f2=`max-view-tablet:grid ${Mu}`;function fS(e){return c2(e)?cS(e)?d2:f2:""}var si="Stick to top",$t={min:0,max:200,step:4,fallback:0},u2="sf-section-stick",Oae="sf-scroll-over",p2="sf-section-stick-phone-on",m2="sf-section-stick-phone-off",uS={desktop:"--sf-stick-distance",phone:"--sf-stick-distance-phone"},_ae=new Set(["CategoryBar","DocTabs","IntroBleed","Contents"]);function pS(e){let o=$(e)??$t.fallback;return Math.min($t.max,Math.max($t.min,Math.round(o)))}function zu(e){return typeof e.stickTopPhone=="boolean"}function Wu(e){let o=e.stickTop===!0,t=pS(e.stickTopDistance),r=zu(e),a=r?e.stickTopPhone===!0:o,n=r?pS(e.stickTopDistancePhone):t;return{desktop:o,desktopDistance:t,phone:a,phoneDistance:n,ownPhone:r}}function Rae(e){let o=Wu(e);if(!o.desktop&&!o.phone)return null;let t=[u2],r={};return o.desktop&&(r[uS.desktop]=`${o.desktopDistance}px`),(o.ownPhone||o.phone!==o.desktop)&&(t.push(o.phone?p2:m2),o.phone&&(r[uS.phone]=`${o.phoneDistance}px`)),o.desktop||t.push("sf-section-stick-desktop-off"),{className:t.join(" "),style:r}}var h2=["column","row","tabs"];var x2={column:"Stacked",row:"One row",tabs:"Tabs"},mS={Flex:h2,HeroGroup:["column","row"]},I2={Flex:"row",HeroGroup:"column"},g2={column:"flex-col",row:"flex-row",tabs:"flex-col"};function li(e,o){return mS[e].includes(o)?o:I2[e]}function Aae(e,o){return g2[li(e,o)]}function hS(e){return mS[e].map(o=>({label:x2[o],value:o}))}var Gu="small",Uu="dot",b2=[{label:"Small",value:"small"},{label:"Display",value:"display"}],$u=[{label:"Dot \u25CF",value:"dot"},{label:"Cross \u2715",value:"cross"},{label:"Slash /",value:"slash"},{label:"Triangle \u25BC",value:"triangle"},{label:"None",value:"none"}],ii={dot:"\u25CF",cross:"\u2715",slash:"/",triangle:"\u25BC",none:""},y2={small:"font-mono text-[length:var(--size-label,14px)] uppercase tracking-[0.25em] max-view-wide:text-[length:var(--size-label,12px)]",display:"font-display font-medium text-[length:var(--size-headingMedium,44px)] uppercase leading-none tracking-[0.005em] max-view-wide:text-[length:var(--size-headingMedium,28px)]"},S2={small:{dot:"",cross:"text-[0.77em]",slash:"text-[0.77em]",triangle:"",none:""},display:{dot:"text-[0.3em]",cross:"text-[0.64em]",slash:"text-[0.64em]",triangle:"text-[0.3em]",none:""}};function Dae(e){return eo(b2,Gu,e)}function Fn(e){return eo($u,Uu,e)}function Nae(e){return y2[e]}function xS(e,o){return S2[e][o]}var zae=[{value:"none"},{value:"dot"},{value:"cross"},{value:"slash"},{value:"triangle"}];function IS(e){return $u.some(o=>o.value===e)?Fn(e):void 0}var w2="overflow-x-clip [&>*]:shrink-0 [&>*]:max-view-wide:basis-[content] [&>*_:is(p,h1,h2,h3,h4,h5,h6)]:max-w-none [&>*_:is(.sf-button-block>div)]:font-mono [&>*_:is(.sf-button-block>div)]:text-[length:var(--size-label,14px)] [&>*_:is(.sf-button-block>div)]:tracking-[0.2em] [&>*+*_:is(:is(p,h1,h2,h3,h4,h5,h6):first-child,.sf-button-block>div)]:before:inline-flex [&>*+*_:is(:is(p,h1,h2,h3,h4,h5,h6):first-child,.sf-button-block>div)]:before:items-center [&>*+*_:is(:is(p,h1,h2,h3,h4,h5,h6):first-child,.sf-button-block>div)]:before:align-top [&>*+*_:is(:is(p,h1,h2,h3,h4,h5,h6):first-child,.sf-button-block>div)]:before:h-[calc(1lh/var(--sf-sep-k,1))] [&>*+*_:is(:is(p,h1,h2,h3,h4,h5,h6):first-child,.sf-button-block>div)]:before:mr-[var(--sf-gap-len,0px)] [&>*+*_:is(:is(p,h1,h2,h3,h4,h5,h6):first-child,.sf-button-block>div)]:max-view-wide:before:mr-[var(--sf-gap-len-phone,calc(var(--sf-gap-len,0px)/2))] [&>*+*_:is(:is(p,h1,h2,h3,h4,h5,h6):first-child,.sf-button-block>div)]:before:text-accent [&>*+*_:is(:is(p,h1,h2,h3,h4,h5,h6):first-child,.sf-button-block>div)]:before:text-[length:calc(var(--sf-sep-k,1)*1em)] [&>*+*_:is(:is(p,h1,h2,h3,h4,h5,h6):first-child,.sf-button-block>div)]:before:content-[var(--sf-sep-mark)]";function ka(e,o){return e==="row"&&IS(o)!==void 0}function Wae(e,o){return ka(e,o)?w2:""}var C2="[&>*:last-child_:is(:is(p,h1,h2,h3,h4,h5,h6):first-child,.sf-button-block>div)]:after:inline-flex [&>*:last-child_:is(:is(p,h1,h2,h3,h4,h5,h6):first-child,.sf-button-block>div)]:after:items-center [&>*:last-child_:is(:is(p,h1,h2,h3,h4,h5,h6):first-child,.sf-button-block>div)]:after:align-top [&>*:last-child_:is(:is(p,h1,h2,h3,h4,h5,h6):first-child,.sf-button-block>div)]:after:h-[calc(1lh/var(--sf-sep-k,1))] [&>*:last-child_:is(:is(p,h1,h2,h3,h4,h5,h6):first-child,.sf-button-block>div)]:after:ml-[var(--sf-gap-len,0px)] [&>*:last-child_:is(:is(p,h1,h2,h3,h4,h5,h6):first-child,.sf-button-block>div)]:max-view-wide:after:ml-[var(--sf-gap-len-phone,calc(var(--sf-gap-len,0px)/2))] [&>*:last-child_:is(:is(p,h1,h2,h3,h4,h5,h6):first-child,.sf-button-block>div)]:after:text-accent [&>*:last-child_:is(:is(p,h1,h2,h3,h4,h5,h6):first-child,.sf-button-block>div)]:after:text-[length:calc(var(--sf-sep-k,1)*1em)] [&>*:last-child_:is(:is(p,h1,h2,h3,h4,h5,h6):first-child,.sf-button-block>div)]:after:content-[var(--sf-sep-mark)]";function Gae(e,o){return ka(e,o)?C2:""}function Uae(e,o){if(!ka(e,o))return{};let t=IS(o),r=/^text-\[([\d.]+)em\]$/.exec(xS("small",t))?.[1],a=ii[t];return{"--sf-sep-mark":a===""?"none":JSON.stringify(a),...r?{"--sf-sep-k":r}:{}}}var An={sectionPaddingTop:0,sectionPaddingBottom:0},gS={start:"justify-start",center:"justify-center",between:"justify-between",end:"justify-end"},bS={start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch"};function Kae(e,o){let t=typeof e=="string"&&e in gS?gS[e]:"",r=typeof o=="string"&&o in bS?bS[o]:"";return[t,r].filter(Boolean).join(" ")}function qae(e){return e===!0||e==="wrap"?"flex-wrap":""}var ci="Block widths",ju=[{label:"Fit content",value:"content",weights:null},{label:"Equal",value:"equal",weights:[1,1]},{label:"Big left",value:"bigLeft",weights:[2,1]},{label:"Big right",value:"bigRight",weights:[1,2]},{label:"Bigger left",value:"biggerLeft",weights:[3,1]},{label:"Bigger right",value:"biggerRight",weights:[1,3]},{label:"2 : 3",value:"twoThree",weights:[2,3]}],Pa="[&>*]:min-w-0 [&>*]:flex-1 [&>*]:basis-0",v2={equal:Pa,bigLeft:`${Pa} [&>*:first-child]:view-wide:grow-[2]`,bigRight:`${Pa} [&>*:last-child]:view-wide:grow-[2]`,biggerLeft:`${Pa} [&>*:first-child]:view-wide:grow-[3]`,biggerRight:`${Pa} [&>*:last-child]:view-wide:grow-[3]`,twoThree:`${Pa} [&>*:first-child]:view-wide:grow-[2] [&>*:last-child]:view-wide:grow-[3]`};function k2(e){return typeof e=="string"?v2[e]??"":""}var P2="[&>*]:view-wide:basis-[content]";function Vae(e){return k2(e)===""?P2:""}var Ku="Columns",di=1,yS=3,SS={2:"max-view-wide:flex-wrap [&>*]:max-view-wide:min-w-0 [&>*]:max-view-wide:basis-[calc((100%_-_var(--sf-gap-len-phone,var(--sf-gap-len,0px)))/2)]",3:"max-view-wide:flex-wrap [&>*]:max-view-wide:min-w-0 [&>*]:max-view-wide:basis-[calc((100%_-_var(--sf-gap-len-phone,var(--sf-gap-len,0px))_*_2)/3)]"},wS=ju.filter(e=>e.value==="content"||e.value==="equal"),CS="equal",qu=1,vS=6,Ta="view-wide:flex-wrap [&>*]:view-wide:min-w-0 [&>*]:view-wide:grow-0!",T2={1:`${Ta} [&>*]:view-wide:basis-[calc(100%/1)]!`,2:`${Ta} [&>*]:view-wide:basis-[calc((100%_-_var(--sf-gap-len,0px))/2)]!`,3:`${Ta} [&>*]:view-wide:basis-[calc((100%_-_var(--sf-gap-len,0px)_*_2)/3)]!`,4:`${Ta} [&>*]:view-wide:basis-[calc((100%_-_var(--sf-gap-len,0px)_*_3)/4)]!`,5:`${Ta} [&>*]:view-wide:basis-[calc((100%_-_var(--sf-gap-len,0px)_*_4)/5)]!`,6:`${Ta} [&>*]:view-wide:basis-[calc((100%_-_var(--sf-gap-len,0px)_*_5)/6)]!`};function E2(e){return typeof e=="number"?T2[e]??"":""}var O2={1:"view-tablet:max-view-desktop:flex-row! view-tablet:max-view-desktop:flex-wrap! [&>*:nth-child(n)]:view-tablet:max-view-desktop:min-w-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:grow-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:basis-[calc(100%/1)]!",2:"view-tablet:max-view-desktop:flex-row! view-tablet:max-view-desktop:flex-wrap! [&>*:nth-child(n)]:view-tablet:max-view-desktop:min-w-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:grow-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:basis-[calc((100%_-_var(--sf-gap-len-tablet,var(--sf-gap-len,0px)))/2)]!",3:"view-tablet:max-view-desktop:flex-row! view-tablet:max-view-desktop:flex-wrap! [&>*:nth-child(n)]:view-tablet:max-view-desktop:min-w-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:grow-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:basis-[calc((100%_-_var(--sf-gap-len-tablet,var(--sf-gap-len,0px))_*_2)/3)]!",4:"view-tablet:max-view-desktop:flex-row! view-tablet:max-view-desktop:flex-wrap! [&>*:nth-child(n)]:view-tablet:max-view-desktop:min-w-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:grow-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:basis-[calc((100%_-_var(--sf-gap-len-tablet,var(--sf-gap-len,0px))_*_3)/4)]!",5:"view-tablet:max-view-desktop:flex-row! view-tablet:max-view-desktop:flex-wrap! [&>*:nth-child(n)]:view-tablet:max-view-desktop:min-w-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:grow-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:basis-[calc((100%_-_var(--sf-gap-len-tablet,var(--sf-gap-len,0px))_*_4)/5)]!",6:"view-tablet:max-view-desktop:flex-row! view-tablet:max-view-desktop:flex-wrap! [&>*:nth-child(n)]:view-tablet:max-view-desktop:min-w-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:grow-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:basis-[calc((100%_-_var(--sf-gap-len-tablet,var(--sf-gap-len,0px))_*_5)/6)]!"};function _2(e){return typeof e=="number"?O2[e]??"":""}function Yae(e){return e.direction!=="row"||ka(e.direction,e.separator)||e.loop==="scroll"||e.line===!0?"":_2(e.columnsTablet)}function Xae(e){return e.direction!=="row"||ka(e.direction,e.separator)||e.loop==="scroll"||e.line===!0?"":E2(e.columns)}var R2="max-view-wide:flex-wrap [&>*]:max-view-wide:min-w-0 [&>*]:max-view-wide:grow-0 [&>*]:max-view-wide:basis-[content]",F2={2:"max-view-wide:flex-nowrap [&>*]:max-view-wide:min-w-0 [&>*]:max-view-wide:basis-[calc((100%_-_var(--sf-gap-len-phone,var(--sf-gap-len,0px)))/2)]",3:"max-view-wide:flex-nowrap [&>*]:max-view-wide:min-w-0 [&>*]:max-view-wide:basis-[calc((100%_-_var(--sf-gap-len-phone,var(--sf-gap-len,0px))_*_2)/3)]"},A2="max-view-wide:flex-nowrap [&>*]:max-view-wide:grow-0 [&>*]:max-view-wide:basis-[content]";function L2(e){return e===!1||e==="nowrap"}function Zae(e,o,t){let r=SS[Number(e)];if(!r)return"max-view-wide:flex-col";let a=L2(t);return B2(e,o)?a?A2:R2:a?F2[Number(e)]:r}function B2(e,o){return Number(e)in SS&&o==="content"}var kS="Block spacing",Vu=[{label:"Each block",value:"each"},{label:"Gap only",value:"gap"}],D2="sf-box-gap-only";function Jae(e){return e==="gap"?D2:""}var N2=["solid","dashed","dotted"],M2=["top","right","bottom","left"],ene="sf-section-border",one="sf-section-border-self",H2=/^#(?:[0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,PS=e=>typeof e=="number"&&Number.isFinite(e)?`${Math.min(20,Math.max(0,Math.round(e)))}px`:void 0;function TS(e,{phone:o=!1}={}){if(!e||typeof e!="object")return;let t=o?"-phone":"",r={};for(let a of M2){let n=PS(e[a])??PS(e.width);n!==void 0&&(r[`--sf-border-${a}-width${t}`]=n)}return typeof e.style=="string"&&N2.includes(e.style)&&(r[`--sf-border-style${t}`]=e.style),typeof e.color=="string"&&H2.test(e.color)&&(r[`--sf-border-color${t}`]=e.color.toLowerCase()),Object.keys(r).length?r:void 0}function tne(e,o){let t=TS(e),r=TS(o,{phone:!0});return t||r?{...t,...r}:void 0}var fi="sf.gapContainer",gt={min:-32,max:64,step:2},RS={Grid:{sm:12,md:24,lg:40},Flex:{sm:12,md:24,lg:40},FooterGroup:{sm:8,md:16,lg:32},HeroGroup:null,Events:null,GalleryB:null,ProductGrid:null},Ea={Grid:24,Flex:24,FooterGroup:16,HeroGroup:0,Events:24,GalleryB:8,ProductGrid:2},z2=new Set(["Events","GalleryB"]);function Tr(e,o,t){if(typeof o=="number"&&Number.isFinite(o)&&o>=gt.min)return o;if(typeof o=="string"){let r=RS[e]?.[o];if(typeof r=="number")return r}return typeof t=="number"&&Number.isFinite(t)?t:Ea[e]}var W2="sf-gap-overlap",G2="--sf-gap-overlap",FS="--sf-block-gap",U2="--sf-block-gap-rem",Pr={min:0,max:gt.max,step:gt.step};function Ln(e){if(typeof e!="number"||!Number.isFinite(e))return null;let o=Math.min(Math.max(Math.round(e),Pr.min),Pr.max);return o-o%Pr.step}function ane(e){let o=Ln(e);return o===null?{}:{[FS]:`${o}px`,[U2]:`${o/16}rem`}}var $2="--sf-block-gap-phone",j2="--sf-block-gap-phone-rem",K2="--sf-block-gap-on-phone",q2="max-view-tablet:[--sf-block-gap-on-phone:var(--sf-block-gap-phone)]";function nne(e){let o=Ln(e);return o===null?{}:{[$2]:`${o}px`,[j2]:`${o/16}rem`}}function sne(e){return Ln(e)===null?"":q2}var ES="sf-gap-zone",OS="--sf-gap-len";function ui(e,o){return typeof o=="number"&&Number.isFinite(o)&&o>=gt.min?!0:typeof o=="string"&&typeof RS[e]?.[o]=="number"}var _S="--sf-gap-len-phone",V2="--sf-gap-len-tablet",Bn={min:0,max:gt.max,step:gt.step};function jt(e){return typeof e=="number"&&Number.isFinite(e)&&e>=Bn.min}function Yu(e){return e/2}function Xu(e,o,t){return jt(t)&&!ui(e,o)}function Zu(e,o,t,r,a){return jt(o)?o:Xu(e,t,a)?a:Yu(Tr(e,t,r))}var Y2={block:"sf-gap-overlap-block",inline:"sf-gap-overlap-inline",both:"sf-gap-overlap-both"};function lne(e,o,t,r,a){let n={...jt(r)?{[_S]:`${r}px`}:null,...jt(a)?{[V2]:`${a}px`}:null};if(!ui(e,o)){let l=`${Ea[e]}px`,c=z2.has(e)?`var(--sf-card-gap, ${l})`:l;return{className:` ${ES}`,style:{[OS]:`var(${FS}, ${c})`,[_S]:`var(${K2})`,...n}}}let s=Tr(e,o);return s>=0?{className:` ${ES}`,style:{[OS]:`${s}px`,...n}}:{className:` ${W2} ${Y2[t]}`,style:{gap:"0px",[G2]:`${-s/2}px`}}}var AS=["transparent","var(--section-bg)","var(--surface)","var(--surface-2)"],LS={transparent:"No fill","var(--section-bg)":"Section band","var(--surface)":"Panels and cards","var(--surface-2)":"Second surface"},$o="var(--section-bg)",pi="inherit";function mi(e,o){return e===pi?$o:e===void 0?o:hi(e)}var X2=/var\(\s*--(surface-2|surface|line)\s*(?=[,)])/g;function hi(e){return e.replace(X2,"var(--site-$1")}function BS(e,o){return e===pi?!0:e===void 0&&o===$o}var DS=["transparent","var(--wheel-stage)","var(--surface)","var(--surface-2)"],NS={transparent:"No fill","var(--wheel-stage)":"Image stage","var(--surface)":"Panels and cards","var(--surface-2)":"Second surface"},Oa="var(--wheel-stage)",xi="transparent",Dn="inherit";function fne(e,o){return hi(Ju(e,o))}function Ju(e,o){return e===Dn?Oa:e==null?o:e===!0?Oa:e===!1?xi:e}function une(e){return typeof e=="string"&&e!==Dn?hi(e):Oa}function pne(e){return e!==xi&&e!=="none"&&e!==""}function MS(e,o){return e===Dn||e===!0?!0:e==null?o===Oa:!1}var HS="inherit",Ii="fixed",zS=e=>typeof e!="number"&&e!==Ii,Z2="var(--sf-heading-max, 9999px)";function hne(e,o,t,r){if(typeof e=="number")return`${e}px`;if(e===Ii)return o;let a=r?`var(--size-${r}, ${o})`:o;return t==="heading"?`min(${a}, ${Z2})`:a}var J2=["page","full"],WS=["full","page"],Er={full:"Full width",page:"Content width"},Qu="inherit",Q2=e=>typeof e=="string"&&J2.includes(e),eM=e=>e===Qu;function oM(e,o){return eM(e.widthMode)?{mode:"full",inherited:!0}:Q2(e.widthMode)?{mode:e.widthMode,inherited:!1}:{mode:o,inherited:o==="full"}}function Ine(e){return oM(e,"page").mode==="full"}var tM={Hero:"hero",HeroSingle:"hero",IntroBleed:"scrollOver",SpecStrip:"background",Timeline:"background",Footprint:"background",Prose:"background",ParagraphsA:"background",Cards:"background",KeyFeatures:"background",Chart:"background",Mockup:"background",Testimonials:"background",TitleWithButtons:"background",Countdown:"background",DocMasthead:"background",DocBody:"background",DocMetaCards:"background",Gallery:"background",GalleryB:"background",Reviews:"background",ReviewForm:"background",Form:"background",AppointmentBooking:"background",FAQ:"background",Events:"background",Split:"both",Breadcrumb:"both",Collections:"both",CatalogFilterBar:"both",AlloyWheelsListing:"both",Banner:"contained",Stats:"contained",Logos:"contained",Divider:"contained",OrderSummary:"contained",DeliveryOptions:"contained",PaymentBadges:"contained",CheckoutCTA:"contained",Flex:"contained",Grid:"contained",ContactCards:"contained",MessagingCards:"contained",OpeningHours:"contained",RateTable:"contained",Manifesto:"contentColumn",SectionHeader:"contentFull",ProductHero:"contentFull",ProductGrid:"productGrid",TimelineTrack:"capped",DetailRows:"capped",FitmentTable:"capped",TyreSizes:"capped",TyreFitment:"capped",EuTyreLabel:"capped",BundleOffer:"capped",CompatibleTyres:"capped",RelatedProducts:"capped",ProcessSteps:"capped",StatsParagraph:"capped",Masthead:"capped",FeaturedCover:"capped",LongRead:"capped",Series:"capped",ContactLocations:"capped",FitmentFinder:"capped",SpecTable:"capped",Subscribe:"capped",SubscribeBlogs:"capped",ContactRouting:"capped",SubmitBuild:"capped"};function gne(e){return Object.prototype.hasOwnProperty.call(tM,e)}var GS="siteWidths",rM=e=>e==="full"||e==="content";function gi(e){return rM(e)?e:null}function US(e,o){return{[GS]:{background:gi(e),content:gi(o)}}}function bne(e){let o=e.editor?.metadata?.[GS];return{background:gi(o?.background),content:gi(o?.content)}}import{jsx as aM}from"react/jsx-runtime";import{createContext as nM,useContext as Cne}from"react";var sM=2,vne=sM+1,lM=nM(2);function $S({tier:e,children:o}){return aM(lM.Provider,{value:e,children:o})}import{useEaselSession as xH}from"efficient-easel/screen/lib/session-context";import{BOX_GAP as IH,describedAs as Kt,group as Ko,iconOf as Mn,sharedStyleKinds as Hn}from"efficient-easel/screen/lib/document/box-fields";import{VIEW_KEY_ACCESS as gH,phoneTwinFields as XS}from"efficient-easel/screen/lib/document/box-fields";import{createElement as jS}from"react";import{SettingsField as iM}from"efficient-easel/panel";import{boxFieldBuilders as cM,describedAs as dM,iconOf as fM}from"efficient-easel/screen/lib/document/box-fields";import{IconPicker as uM}from"efficient-shell/ui";var pM=e=>i(e),so=cM(pM),_o=so.slider,jo=so.select,bi=so.Segmented,_a=so.segmented,Rne=so.alignmentField,Fne=so.alignmentFields,Ane=so.blockAlignmentField,Lne=so.blockAlignmentFields,Bne=so.boxJustifyField,Dne=so.boxAlignField,Nne=so.boxWrapField,KS=so.directionField,yi=so.gapField,Mne=so.placementField,Hne=so.PlacementGridView,zne=so.positionFields,Si=so.sidesPaddingFields;function Wne(e,o,t,r,a={}){let n=s=>t.some(l=>l.value===s);return{type:"custom",...dM({},{type:"radio",label:e,options:t.map(s=>s.label===void 0?{value:s.value}:{value:s.value,label:s.label})}),render:({value:s,onChange:l,field:c})=>{let d=t.map(p=>({value:p.value,...p.label===void 0?{}:{label:i(p.label)},icon:p.picture})),u=c?.currentValue,h=a.resolve?a.resolve(s)??r:n(s)?s:n(u)?u:r;return jS(iM,{label:i(e),icon:fM(o)},jS(uM,{label:i(e),value:h,options:d,onChange:l,emptyValue:a.emptyValue}))}}}import{TEXT_CONTROL_KINDS as Sle,SCALAR_TEXT_CONTROLS as wle}from"efficient-easel/draw";function _r(e,o){return i("{value} from {from}",{value:e,from:o})}function bH(){let{blockGap:e}=ie();return e===null?i("this container's own spacing"):_r(`${e}px`,i("Styles"))}function yH({inherited:e,onReset:o,label:t}){return S(po,{words:ee()?.panel,label:i(t),changed:!e,detail:bH(),onReset:o})}function SH(e){return yi({...IH,builtIn:Ea[e],resolve:(o,t)=>Tr(e,o,t?.siteGap),action:(o,t)=>S(yH,{inherited:!ui(e,o),onReset:()=>t(void 0),label:"Gap"}),mark:{[fi]:e}})}function wH(e){return uo(Ve("mobile",{[fi]:e,type:"custom",render:o=>S(kH,{container:e,...o})}),hw)}function CH(e){return uo(Ve("tablet",{[fi]:e,type:"custom",render:o=>S(vH,{container:e,...o})}),hw)}var hw={not:{field:"gap",in:Array.from({length:-gt.min},(e,o)=>gt.min+o)}};function ple(e){return{gap:Ve("desktop",SH(e)),[dH("gap")]:CH(e),[Ra("gap")]:wH(e)}}function vH({container:e,...o}){let[t]=Or("gap"),{siteGap:r}=o.field??{},a=Math.max(Bn.min,Tr(e,t,r));return yi({...Bn,builtIn:a,resolve:n=>jt(n)?n:a,action:(n,s)=>S(po,{words:ee()?.panel,label:i("Gap"),changed:jt(n),detail:_r(`${a}px`,i("Desktop")),onReset:()=>s(void 0)})}).render(o)}function kH({container:e,...o}){let[t]=Or("gap"),{siteGap:r,siteGapPhone:a}=o.field??{},n=Zu(e,void 0,t,r,a);return yi({...Bn,builtIn:n,resolve:s=>Zu(e,s,t,r,a),action:(s,l)=>S(po,{words:ee()?.panel,label:i("Gap"),changed:jt(s),detail:_r(`${n}px`,Xu(e,t,a)?i("Styles"):i("Desktop")),onReset:()=>l(void 0)})}).render(o)}function mle(e){return KS({offered:hS(e),fallback:li(e,void 0),resolve:o=>li(e,o)})}function hle(e,o){return nb(o?Qf(e,o):[],o)}function PH({inherited:e,onReset:o,label:t}){return S(po,{words:ee()?.panel,label:i(t),changed:!e,detail:_r(i("Full"),i("the page")),onReset:o})}function Rr({value:e,onChange:o,label:t,placeholder:r,hint:a,multiline:n,hideable:s=!0,markup:l=!0}){let{text:c,hidden:d}=Vt(e),u=vi(null),h=vi(null),p=w=>o(s?{text:w,hidden:d}:w),x=()=>o({text:c,hidden:!d}),g=s&&d,y=rw(),E=a?RH(a)?S("span",{className:"sf-hint-keep sf-hint-while-typing",children:i(a)}):S(cb,{children:i(a)}):void 0,_=d?i("Show {label} on the slide",{label:i(t)}):i("Hide {label} on the slide",{label:i(t)});return S(Ye,{label:i(t),icon:S(UM,{}),htmlFor:y,className:g?"is-hidden":void 0,hint:E,action:s?S(ki,{content:_,children:S(pw,{"aria-pressed":d,"aria-label":_,onClick:x,children:d?S(YS,{name:"eye-off",size:14}):S(YS,{name:"eye",size:14})})}):void 0,children:Fa("div",{className:"sf-copybox",children:[l&&S(cu,{target:n?h:u,value:c,onChange:p}),n?S("textarea",{id:y,ref:h,value:c,placeholder:r===void 0?void 0:i(r),onChange:w=>p(w.target.value)}):S("input",{id:y,ref:u,type:"text",value:c,placeholder:r===void 0?void 0:i(r),onChange:w=>p(w.target.value)})]})})}function xle(e,o){return{...e,[SM]:o}}function Ile(e){let o=e[bt];if(!o)throw new Error("withOffPage: the field holds no authored text");return{...e,[bt]:{...o,offPage:!0}}}function Ei(e){return!e||typeof e!="object"?!1:e[bt]?.offPage===!0}var xw="sfPanelOnly";function gle(e){if(!e[bt])throw new Error("withPanelOnly: the field holds no authored text");return{...e,[xw]:!0}}function Iw(e){return!!e&&typeof e=="object"&&e[xw]===!0}function ble(e){let o=e[bt];if(!o)throw new Error("withIdentifier: the field holds no authored text");return{...e,[bt]:{...o,identifier:!0}}}function Cle(e,o){if(!e[bt])throw new Error("inOwnBox: the field holds no authored text");let{[iH]:t,...r}=e;return{...r,[du]:!0,render:o}}var TH=new Set(fH),Pi={type:"radio",options:[{value:!0},{value:!1}]},gw={text:{type:"object",objectFields:{text:{type:"text"},hidden:Pi}},textarea:{type:"object",objectFields:{text:{type:"textarea"},hidden:Pi}},plainText:{type:"text"},copyText:{type:"text"},plainTextarea:{type:"textarea"},textList:{type:"array",arrayFields:{text:{type:"text"}}}},Fr=(e,o)=>{let t=Kt({...o,[bt]:e},{...gw[e.control],label:e.label});if(!TH.has(e.control))return t;let r=o.render;return{...mw(t,"authored-copy"),render:a=>S(Yb,{name:a.name,children:r(a)})}},vle="Everything else on this block comes from the linked post. Unlink it to edit by hand.",EH={field:"source.slug",set:!0},kle={not:EH},OH="Select a word, then press the highlighter.",_H=new Set([OH]),RH=e=>_H.has(e);function Ple(e,o,t){return Fr({control:"text",label:e,placeholder:o,hint:t},{type:"custom",render:({value:r,onChange:a})=>S(Rr,{value:r,onChange:a,label:e,placeholder:o,hint:t})})}function Tle(e,o,t){return Fr({control:"textarea",label:e,placeholder:o,hint:t},{type:"custom",render:({value:r,onChange:a})=>S(Rr,{value:r,onChange:a,label:e,placeholder:o,hint:t,multiline:!0})})}function Ele(e,o,t){return Fr({control:"plainText",label:e,placeholder:o,hint:t},{type:"custom",render:({value:r,onChange:a})=>S(Rr,{value:r,onChange:a,label:e,placeholder:o,hint:t,hideable:!1,markup:!1})})}function Ole(e,o,t){return Fr({control:"copyText",label:e,placeholder:o,hint:t},{type:"custom",render:({value:r,onChange:a})=>S(Rr,{value:r,onChange:a,label:e,placeholder:o,hint:t,hideable:!1})})}function _le(e){return{type:"custom",[bM]:{label:e},...Kt({},{type:"text",label:e}),render:({value:o,onChange:t})=>S(Vy,{value:gM(o),onChange:t,label:e})}}function Rle(e,o,t){return Fr({control:"plainTextarea",label:e,placeholder:o,hint:t},{type:"custom",render:({value:r,onChange:a})=>S(Rr,{value:r,onChange:a,label:e,placeholder:o,hint:t,multiline:!0,hideable:!1})})}var bw={Design:wM,Animation:vM};function Fle(e){return{type:"custom",render:()=>S(FH,{text:e})}}function FH({text:e}){return S("p",{className:"sf-note",children:i(e)})}function Ale(e){return yt(e)!==null&&e?.tabs!==void 0}var ZS=new Map;function Oi(e,o){let t=`${e}\0${o?o.join(""):""}`,r=ZS.get(t)??{type:"custom",tabs:o,[aw]:{label:e,level:1},bucket:e,marker:!0,render:()=>S(qt,{})};return ZS.set(t,r),r}var JS=new Map;function ap(e){let o=JS.get(e)??{type:"custom",[aw]:{label:e,level:1},designGroup:e,marker:!0,...e==="Content"?{}:{fold:e},render:()=>S(qt,{})};return JS.set(e,o),o}function AH(e){let o=e;return o?.marker===!0&&typeof o.fold=="string"?o.fold:null}function yw(e,o){return AH(e)===o?e:{...e,marker:!0,fold:o,render:()=>S(qt,{})}}function Sw(e){let o=e;if(o.marker===!0&&o.fold===void 0)return e;let{fold:t,...r}=e;return{...r,marker:!0,render:()=>S(qt,{})}}function np({title:e,children:o}){let[t,r]=Nn(()=>!ep.has(e));return S(KM,{title:e,open:t,onToggle:a=>{r(a),a?ep.delete(e):ep.add(e)},children:o})}var ep=new Set;function ww({swatches:e,current:o,onPick:t,names:r}){let a=e.find(l=>l.toLowerCase()===o.toLowerCase()),n=a?r?.[a]:void 0,s=n?i(n):o;return Fa("div",{className:"sf-swatches",children:[e.map(l=>{let c=r?.[l]?i(r[l]):l;return S(ki,{content:c,children:S(oH,{color:l,selected:o.toLowerCase()===l.toLowerCase(),onClick:()=>t(l),"aria-label":c})},l)}),S("span",{className:"sf-swatch-hex",children:s})]})}function Lle(e,o){return{type:"custom",render:({value:t,onChange:r})=>{let a=BS(t,o);return S(Ye,{label:i(e),icon:S(kM,{}),changed:!a,action:S(po,{words:ee()?.panel,label:i(e),changed:!a,detail:i("the theme's section background"),onReset:()=>r(pi)}),children:ww({swatches:AS,current:a?$o:t??o??"",onPick:r,names:LS})})}}}function LH(e,o){return{type:"custom",render:({value:t,onChange:r})=>{let a=t,n=MS(a,o);return S(Ye,{label:i(e),icon:S(lw,{}),changed:!n,action:S(po,{words:ee()?.panel,label:i(e),changed:!n,detail:i("the theme's image stage"),onReset:()=>r(Dn)}),children:ww({swatches:DS,current:n?Oa:Ju(a,o),onPick:r,names:NS})})}}}function _i(e=t=>t,o){return Hn({_gSectionTheme:Ko(py),sectionAccent:{type:"custom",render:({value:t,onChange:r})=>S(by,{value:e(t),onChange:r,followLabel:o})}})}function Co({min:e,max:o,step:t,value:r,onChange:a,suffix:n="",readout:s=!0,notch:l,ariaLabel:c,disabled:d=!1}){let u=l!==void 0&&Number.isFinite(l)&&l>=e&&l<=o;return S("div",{className:u?"sf-slider has-notch":"sf-slider",style:u?{"--sf-notch":(l-e)/(o-e)}:void 0,children:S(sH,{min:e,max:o,step:t,value:r,suffix:n||void 0,showInput:s,label:c===void 0?void 0:i(c),disabled:d,size:"sm",boxSize:"md",className:"sf-slider-track",onChange:h=>{h!==null&&h!==r&&a(h)}})})}function Cw(e,o){let{min:t,max:r,step:a=1,unsetLabel:n,hint:s,restTrack:l,unsetMark:c,icon:d,unit:u="px"}=o;return{type:"custom",render:({value:h,onChange:p})=>{let x=typeof h=="number"?h:null,g=x===null;return S(Ye,{label:i(e),icon:d?Mn(d):void 0,value:g?c||n===void 0?void 0:i(n):`${x}${u}`,changed:!g,action:c?tw(c,{changed:!g,onReset:()=>p(null)}):S(po,{words:ee()?.panel,label:i(e),changed:!g,onReset:()=>p(null)}),hint:typeof s=="string"?i(s):s,children:l?l({min:t,max:r,step:a,px:x,label:e,onChange:p}):Co({min:t,max:r,step:a,value:x??t,readout:!1,ariaLabel:e,onChange:p})})}}}var Ri="Corners";function sp(e){return{type:"custom",render:({value:o,onChange:t})=>{let r=typeof o=="number"&&Number.isFinite(o)?o:null,a=r!==null;return S(Ye,{label:i(Ri),icon:S(EM,{}),changed:a,action:tw(e.mark,{changed:a,onReset:()=>t(null)}),hint:e.hint,children:S(BH,{tier:e,px:r,onRadius:t})})}}}function Or(e){let o=Ti();return[o?.values?.[e],t=>o?.onChange(e,t)]}function vw(){return mw({type:"custom",render:()=>S(cH,{})},"always")}function Iu(){let e=Ti();return o=>e?.onChangeMany(o)}function BH({tier:e,px:o,onRadius:t}){let r=e.useFollowed(),[a,n]=Or(e.sidesKey),s=at(a)??[...Pl];return S(tH,{label:i(Ri),value:s,corners:Lg,onChange:l=>{let c=at(l)??[];n(c.length===Pl.length?null:c)},radius:o,onRadiusChange:t,radiusMin:To,radiusMax:dr,radiusStep:e.step??1,radiusPlaceholder:String(r)})}function kw(){return vw()}function DH({label:e,changed:o=!1,onReset:t=()=>{}}){let{cornerRadiusPx:r}=ie(),a=typeof r=="number"?`${r}px`:i("not set");return S(po,{words:ee()?.panel,label:i(e),changed:o,detail:r==null?i("the built-in corners"):_r(a,i("Styles")),onReset:t})}function NH(){let{cornerRadiusPx:e}=ie();return typeof e=="number"?e:To}function MH(){return sp({sidesKey:"sectionCornerSides",useFollowed:NH,mark:S(DH,{label:Ri}),hint:HH})}var HH="Follows Styles \u25B8 Basics \u25B8 Corners until you set a number here.";function Fi(){return Hn({_gShape:Ko("Shape"),sectionCorners:MH(),sectionCornerSides:kw(),sectionBorder:QS("desktop"),sectionBorderPhone:QS("mobile")})}var zH=()=>({width:i("Border width"),sides:{top:i("Border top"),right:i("Border right"),bottom:i("Border bottom"),left:i("Border left")},style:i("Border style"),styles:{solid:i("Solid"),dashed:i("Dashed"),dotted:i("Dotted")},color:i("Border color"),unit:"px"});function WH(e){let o=Object.fromEntries(Object.entries(e).filter(([,t])=>t!=null&&t!==""));return Object.keys(o).length?o:void 0}function GH(){let e;try{let o=ao(ie().theme);e=o.themes[o.selected]?.line}catch{e=void 0}return e||uf.line}function UH({value:e,onChange:o,placeholder:t,presets:r,sides:a=!0,styles:n=!0,above:s={}}){let l=e&&typeof e=="object"?e:{},[c,d]=Nn(()=>a?ZM(l,s):!1),u=zH(),h=p=>WH(a&&n?p:{width:p.width,color:p.color,...n?{style:p.style}:{}});return S(Ye,{label:i("Border"),icon:S(PM,{}),action:a?S(YM,{each:c,label:i("Each side"),onChange:d}):void 0,children:S(VM,{label:i("Border"),value:l,each:c,onChange:p=>o(h(p)),placeholder:t,presets:r,words:u,styles:n,max:20})})}function $H({value:e,onChange:o,tier:t}){let[r]=Or("sectionBorder"),a=GH(),n=t==="mobile"?r&&typeof r=="object"?r:{}:{};return S(UH,{value:e,onChange:o,placeholder:{sides:XM(n),style:n.style??"solid",color:n.color||a},presets:[a],above:n})}function QS(e){return Ve(e,{type:"custom",render:({value:o,onChange:t})=>S($H,{value:o,onChange:t,tier:e})})}function Ble(e){return{type:"custom",render:()=>S(jH,{partKey:e})}}function jH({partKey:e}){let[o]=Or("id"),[t]=Or("_partStyles"),{textStyles:r}=ie(),a=hH(),n=null;try{n=uH().select}catch{n=null}let s=t&&typeof t=="object"?t[e]:void 0,l=Array.isArray(r)?r:null;return S(jM,{name:i("Text"),preview:aS(s,l,{noStyle:i("No style"),styleName:a.textStyles.styleName,cases:(a.copy.panel??mH.copy.panel).cases}),onOpen:()=>{n&&typeof o=="string"&&n(pH(o,e))}})}function Pw(e){let{cornerRadiusPx:o}=ie(),t=typeof o=="number"?o:e,r=null;try{let{appState:n,selectedItem:s}=tp(c=>c),l=s?.props?.id?String(s.props.id):void 0;r=l?Cb(n?.data,l)?.props??null:null}catch{r=null}if(!r)return t;let a=r.sectionCorners;return Bf(a)?a:t}function KH({label:e,changed:o=!1,onReset:t=()=>{}}){let r=Pw(To);return S(po,{words:ee()?.panel,label:i(e),changed:o,detail:_r(`${r}px`,i("the section")),onReset:t})}function qH(){return S(qt,{children:i("Follows the section's Corners until you set a number here.")})}function VH(){return sp({sidesKey:"cardCornerSides",useFollowed:()=>Pw(To),mark:S(KH,{label:Ri}),hint:S(qH,{})})}function YH(){return{type:"custom",render:()=>S(Wg,{})}}function Dle(){return{_gShape:Ko("Shape"),cardCorners:VH(),cardCornerSides:kw(),cardCornersApplyAll:YH()}}function XH(e=ju,o=e[0].value){return Kt({type:"custom",render:({value:t,onChange:r})=>{let a=e.find(n=>n.value===t)??e.find(n=>n.value===o)??e[0];return S(Ye,{label:i(ci),icon:S(nw,{}),value:i(a.label),children:S(aH,{className:"sf-gallery-layouts",label:i(ci),value:a.value,onChange:r,options:e.map(n=>({value:n.value,label:i(n.label),picture:S("span",{className:"sf-gallery-pic",children:ZH(n.weights).map((s,l)=>S("i",{style:{gridColumn:`span ${s}`}},l))})}))})})}},{type:"select",label:ci,options:e.map(t=>({value:t.value,label:t.label}))})}function ZH(e){if(!e)return[3,4];let o=e.reduce((t,r)=>t+r,0);return e.map(t=>Math.round(t/o*12))}function Nle(){return jo(kS,S(LM,{}),Vu,Vu[0].value)}function Mle(){return Ve("mobile",XH(wS,CS))}function JH(){return Ve("mobile",_o(Ku,S(sw,{}),di,yS,1,di,"",{clear:{phoneFollows:!1,hint:di}}))}var ew={read:e=>e.phoneRow,write:(e,o,t)=>({phoneRow:t}),fieldKey:()=>"phoneRow",ownField:!0};function Hle(){let e=_o(Ku,S(sw,{}),qu,vS,1,qu,"",{clear:{emptyLabel:"Auto"}}),o=XS("columns",e,{...ew,tablet:gH.tablet}),t=XS("columns",e,ew,{phoneRow:JH()});return{...o,phoneRow:t.phoneRow}}function zle(e,o,t,r,a,n){return{type:"custom",render:({value:s,onChange:l})=>S(Ye,{label:i(e),icon:S(tu,{noun:n}),action:S(po,{words:ee()?.panel,label:i(e),changed:!zS(s),detail:i("the Text style in Styles"),onReset:()=>l(HS),defaultAction:{onPress:()=>l(Ii),title:i("Keep this section's own built-in size"),icon:S(TM,{})}}),children:Co({min:o,max:t,step:r,value:typeof s=="number"?s:a,suffix:"px",ariaLabel:e,onChange:l})})}}function Wle(){return{_gCellWidth:Ko("Cell width"),gridSpan:jo("Positions",S(nw,{}),[{label:"Auto",value:""},...Array.from({length:Rl},(e,o)=>({label:o===0?"1 position":`${o+1} positions`,value:String(o+1)}))],"")}}function St(){let e=null,o=null;try{e=xM(lp),o=tp(t=>t).selectedItem}catch{o=null}return e??o?.props??{}}var lp=hM(null);function QH({min:e,max:o,step:t,px:r,label:a,onChange:n,desktopKey:s,fallback:l}){let c=St()[s],d=Gl(void 0,c,l);return S(qt,{children:Co({min:e,max:o,step:t,value:Gl(r,c,l),readout:!1,ariaLabel:a,notch:d,onChange:n})})}function e5({label:e,desktopKey:o,fallback:t,unit:r="px",changed:a=!1,onReset:n=()=>{}}){let s=St()[o],l=Gl(void 0,s,t);return S(po,{words:ee()?.panel,label:i(e),changed:a,detail:i("{value} on desktop",{value:`${l}${r}`}),onReset:n})}function Ai(e){return Cw(e.label,{icon:e.icon,min:e.min,max:e.max,step:e.step,unit:e.unit,unsetLabel:"Follows Desktop",unsetMark:S(e5,{label:e.label,desktopKey:e.desktopKey,fallback:e.fallback,unit:e.unit}),restTrack:o=>S(QH,{...o,desktopKey:e.desktopKey,fallback:e.fallback})})}var o5={Top:"Padding top",Bottom:"Padding bottom",Left:"Padding left",Right:"Padding right"},t5={Top:uw,Bottom:cw,Left:dw,Right:fw},r5=e=>{let o=t5[e];return S(o,{})};function Gle(e={}){let o=e.keys?.top??"sectionPaddingTop",t=e.keys?.bottom??"sectionPaddingBottom",r=e.group!==!1,a=E=>o5[E],n=E=>_o(a("Top"),S(uw,{}),Uo.min,Uo.max,Uo.step,E,"px"),s=(E,_,w,I=Uo)=>Ve("mobile",Ai({label:a(E),icon:r5(E),desktopKey:_,min:I.min,max:I.max,step:I.step,fallback:w})),l=e.top??Uo.min,c=e.bottom??Uo.min,d="sectionPaddingLeft",u="sectionPaddingRight",h=e.sideBounds??Uo,p=e.side??h.min,x=e.sidePhone??p,g=e.phone===!0,y=E=>g?Ve("desktop",E):E;return Hn({...r?{_gSpacing:Ko("Padding")}:{},[o]:y(n(l)),...g?{[Ra(o)]:s("Top",o,l)}:{},...e.only==="top"?{}:{[t]:y(_o(a("Bottom"),S(cw,{}),Uo.min,Uo.max,Uo.step,c,"px")),...g?{[Ra(t)]:s("Bottom",t,c)}:{}},...e.sides?{[d]:y(_o(a("Left"),S(dw,{}),h.min,h.max,h.step,p,"px")),...g?{[Ra(d)]:s("Left",d,x,h)}:{},[u]:y(_o(a("Right"),S(fw,{}),h.min,h.max,h.step,p,"px")),...g?{[Ra(u)]:s("Right",u,x,h)}:{}}:{}})}function Ule(e,o){let t=Object.fromEntries(Object.entries(o).map(([n,s])=>[n,n in e&&yt(s)?e[n]:s])),r={},a=!1;for(let[n,s]of Object.entries(e)){if(n in o){a||Object.assign(r,t),a=!0;continue}r[n]=s}return a||Object.assign(r,t),r}var wi="Width";function Li(e,o=WS,t=!0){let r=o.map(a=>({label:Er[a],value:a}));return Hn({...t?{_gWidth:Ko(wi)}:{},widthMode:{type:"custom",render:({onChange:a,field:n})=>S(Ye,{label:i(wi),icon:S($M,{}),action:t?S(PH,{inherited:n?.inherited??!1,onReset:()=>a(Qu),label:wi}):void 0,children:bi({options:r,value:n?.currentValue||e,onChange:a,ariaLabel:wi})})}})}function Bi(){let e=r=>({type:"custom",render:({value:a,onChange:n})=>S(Ye,{label:va,icon:Mn(S(DM,{})),action:r?r(n):void 0,children:bi({options:[{label:"Auto",value:"auto"},{label:"Fixed",value:"fixed"},{label:"Screen",value:"screen"}],value:["auto","fixed","screen"].includes(a)?a:"auto",onChange:n,ariaLabel:va})})}),o=()=>({type:"custom",render:({value:r,onChange:a,field:n})=>{let s=n?.unit==="%"?"%":"px",l=s==="%"?Nu:Du;return S("div",{className:"sf-field",children:Co({min:l.min,max:l.max,step:l.step,value:typeof r=="number"?r:l.fallback,suffix:s,ariaLabel:va,onChange:a})})}}),t=()=>_a("Unit",S(iw,{}),[{label:"px",value:"px"},{label:"%",value:"%"}],"px");return Hn({_gHeight:Ko(va),sectionHeightMode:Ve("desktop",e()),sectionHeightValue:Ve("desktop",o()),sectionHeightUnit:Ve("desktop",t()),sectionHeightModePhone:Ve("mobile",e(r=>S(a5,{onClear:()=>r(void 0)}))),sectionHeightValuePhone:Ve("mobile",o()),sectionHeightUnitPhone:Ve("mobile",t())})}function a5({onClear:e}){let o=St(),t=Hu(o),r=ni(o),a=i("{value} on desktop",{value:r.mode==="auto"?i("Auto"):`${r.value}${r.unit}`});return S(po,{words:ee()?.panel,label:i(va),changed:t,detail:a,onReset:e})}function ip(){let e=t=>({type:"custom",render:({value:r,onChange:a,id:n,name:s})=>S(n5,{value:r,onChange:a,labelId:`${n??s??"stickTop"}-label`,phone:t})}),o=()=>({type:"custom",render:({value:t,onChange:r})=>S("div",{className:"sf-field",children:Co({min:$t.min,max:$t.max,step:$t.step,value:typeof t=="number"?t:$t.fallback,suffix:"px",ariaLabel:i("Distance from top"),onChange:r})})});return{_gStick:Ko(si),stickTop:Ve("desktop",e(!1)),stickTopDistance:Ve("desktop",o()),stickTopPhone:Ve("mobile",e(!0)),stickTopDistancePhone:Ve("mobile",o())}}function n5({value:e,onChange:o,labelId:t,phone:r}){let a=St(),n=Wu(a),s=r?n.phone:e===!0;return S(Ye,{label:i(si),labelId:t,icon:Mn(S(zM,{})),action:Fa(qt,{children:[r?S(po,{words:ee()?.panel,label:i(si),changed:zu(a),detail:i("{value} on desktop",{value:n.desktop?`${n.desktopDistance}px`:i("Off")}),onReset:()=>o(void 0)}):null,S(rp,{checked:s,onChange:o,ariaLabelledBy:t})]})})}var ow="e.g. about";function Di(){return{_gAnchor:Ko("Anchor"),anchor:Fr({control:"plainText",label:"Name",placeholder:ow},{type:"custom",render:({value:e,onChange:o})=>S(yb,{value:e,onChange:o,nameBox:(t,r)=>S(Rr,{value:t,onChange:r,label:"Name",placeholder:ow,hideable:!1,markup:!1})})})}}function $le(e,o,t){return{type:"custom",render:({value:r,onChange:a,id:n,name:s})=>{let l=`${n??s??e}-datetime`,c=Date.parse(typeof r=="string"?r:"");return S(Ye,{label:i(e),icon:o,htmlFor:l,hint:t===void 0?void 0:i(t),children:S(rH,{id:l,value:Number.isFinite(c)?new Date(c):null,onChange:d=>a(d?d.toISOString():"")})})}}}function s5(e,o,t,r){return{type:"custom",...Kt({},{...Pi,label:e}),render:({value:a,onChange:n,id:s,name:l})=>{let c=typeof a=="boolean"?a:o,d=`${s??l??e}-label`;return S(Ye,{label:i(e),labelId:d,icon:t,hint:r===void 0?void 0:i(r),action:S(rp,{checked:c,onChange:n,ariaLabelledBy:d})})}}}function Tw(){return{type:"custom",render:({value:e,onChange:o,id:t,name:r})=>{let a=`${String(t??r??"pageBackground")}-colour`;return S(Eo,{label:i("Background"),icon:S(HM,{}),id:a,value:ru(e),onChange:o})}}}function jle(e,o,t){return{type:"custom",render:({value:r,onChange:a})=>S(Eo,{label:i(e),icon:t,value:r||o,onChange:a})}}function Kle(){return{type:"custom",render:({value:e,onChange:o})=>S(l5,{value:typeof e=="string"?e:"",onChange:o})}}function l5({value:e,onChange:o}){let{hex:t,n:r}=c5();return S(Cl,{label:i("Fill"),icon:S(lw,{}),value:e,inherited:t,resetTo:_r(t.toUpperCase(),i("Theme {n} background",{n:r})),onChange:o,onReset:()=>o("")})}function i5(e,o,t){if((e?.content??[]).some(n=>n?.props?.id===o))return Ho(t);let r=vb(e,o);if(r.length===0)return null;let a=Ho(Pu(t));if(a!==null)return a;for(let n=r.length-1;n>0;n-=1){let s=Ho(Pu(r[n].sectionAccent));if(s!==null)return s}return Ho(r[0].sectionAccent)}function c5(){let e=ao(ie().theme),[o]=Or("sectionAccent"),t=null;try{let{appState:a,selectedItem:n}=tp(l=>l),s=n?.props?.id?String(n.props.id):void 0;t=s?i5(a?.data,s,o):null}catch{t=null}let r=t!==null&&e.themes[t]?t:e.selected;return{hex:e.themes[r].background??uf.background,n:r+1}}var d5=[{value:"0% 0%",label:"Top left"},{value:"50% 0%",label:"Top"},{value:"100% 0%",label:"Top right"},{value:"0% 50%",label:"Left"},{value:"50% 50%",label:"Center"},{value:"100% 50%",label:"Right"},{value:"0% 100%",label:"Bottom left"},{value:"50% 100%",label:"Bottom"},{value:"100% 100%",label:"Bottom right"}];function f5({label:e,value:o,onChange:t,points:r=d5}){let a=r.map(n=>({...n,label:i(n.label),...n.title?{title:i(n.title)}:null}));return S(eH,{label:i(e),value:o,points:a,onChange:t})}function qle(){return vw()}var Ew={top:S(FM,{}),right:S(RM,{}),bottom:S(OM,{}),left:S(_M,{})};function Ow(e,o,t,r,a,n,s){let l=h=>o.find(p=>p.value===h),c=h=>({value:h,label:"",disabled:!0,title:r}),d=h=>{let p=o.find(g=>g.cell===h);if(!p)return c(`missing-${h}`);let x=n?.[h];return x?{value:p.value,label:p.label,icon:x}:{value:p.value,label:p.label}},u=[c("corner-top-left"),d("top"),c("corner-top-right"),d("left"),c("centre"),d("right"),c("corner-bottom-left"),d("bottom"),c("corner-bottom-right")];return{type:"custom",render:({value:h,onChange:p})=>{let x=o.some(g=>g.value===h)?h:t;return S(Ye,{label:i(e),icon:a,value:l(x)?.label?i(l(x).label):s?i(s):"",children:f5({label:e,value:x,onChange:p,points:u})})}}}function Vle(e,o,t){return{type:"custom",options:o,render:({value:r,onChange:a,field:n})=>S(ay,{label:e,options:(n.options??o).map(s=>({...s,label:i(s.label)})),value:Array.isArray(r)?r:[],onChange:a,...t?{emptyLabel:i(t)}:{}})}}function Yle(e,o={}){return{type:"custom",render:({value:t,onChange:r})=>{let a={value:t,onChange:r,...o};return S(e,{...a})}}}var Xle=[{label:"Image",value:"image"},{label:"Video",value:"video"}];function Zle(e,o,t){let r=Object.keys(Af).map(a=>({label:Af[a],value:a,picture:t[a]}));return{type:"custom",...Kt({},{type:"radio",label:e,options:r.map(a=>({value:a.value,label:a.label}))}),render:({onChange:a})=>S(u5,{label:e,icon:o,options:r,onChange:a})}}function u5({label:e,icon:o,options:t,onChange:r}){let a=Ti()?.values??{},n=Lf(a),s=n==="frame"&&!!zt(a.mediaVideo)&&!zt(a.videoFrame);return S(Ye,{label:i(e),icon:Mn(o),hint:s?i("This video has no frame yet. The slide shows its background colour until one is made."):void 0,children:bi({options:t,value:n,onChange:r,ariaLabel:e})})}function Jle(e,o,t,r={}){return{type:"custom",[yM]:!0,render:({value:a,onChange:n,name:s})=>S(ty,{value:a||"",onChange:n,fieldKey:s,label:e,accept:o,placeholder:t,focusKey:r.focus,focusWhen:r.focusWhen,frameKey:r.frame})}}function p5(e){let o=i(e.status??"");return e.ok&&typeof e.lat=="number"&&typeof e.lng=="number"?`${o} \xB7 ${e.lat.toFixed(4)}, ${e.lng.toFixed(4)}`:o}function Qle({value:e,onChange:o,label:t}){let r=e||{},a=Ti(),n=a?a.values!==a.node.props:!0,s=!!r.pending&&n,l=!!r.pending&&!n,c=s?"var(--ink-faint)":r.ok&&!l?"var(--status-success-soft-ink)":"var(--status-danger-soft-ink)",d=!!ze(xH()).geocode,u=rw(),h=(p,x)=>o({...r,[p]:x??void 0});return Fa(qt,{children:[S(Ye,{label:i(t),icon:S(qS,{}),action:d?S(ki,{content:i("Find from the address (OpenStreetMap)"),children:S(pw,{"aria-label":i("Find from the address"),"aria-busy":s||void 0,disabled:s,onClick:()=>o({...r,pending:!0,ok:!1,status:"Finding\u2026"}),children:S(WM,{})})}):void 0,children:d&&r.status?S(ki,{content:p5(r),className:"sf-name-tip",children:S("div",{className:`es-field-hint ${eu}`,style:{margin:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",minWidth:0,color:c},children:s?i("Finding\u2026"):l?i(su):i(r.status)})}):null}),S(Ye,{label:i("Enter by hand"),labelId:u,icon:S(AM,{}),action:S(rp,{checked:!!r.manual,onChange:p=>o({...r,manual:p}),ariaLabelledBy:u})}),r.manual&&S(Ye,{label:i("Latitude, longitude"),icon:S(qS,{}),children:Fa("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8,width:"100%",minWidth:0},children:[S(VS,{value:typeof r.lat=="number"?r.lat:null,onChange:p=>h("lat",p),min:-90,max:90,step:1e-4,placeholder:i("Latitude")}),S(VS,{value:typeof r.lng=="number"?r.lng:null,onChange:p=>h("lng",p),min:-180,max:180,step:1e-4,placeholder:i("Longitude")})]})})]})}function m5(e,o){return o===null||o<0||o>=e.length?"":e[o]?.text??""}function h5(e,o,t){let r=e.map(a=>({text:a?.text??""}));return o===null||o<0||o>=e.length?r:r.map((a,n)=>n===o?{text:t}:a)}function x5(e,o,t){if(t===null||t>=o.length)return null;for(let r=0;r<t;r+=1)if(e[r]!==o[r])return null;return e[t]!==o[t]&&o.includes(e[t])||e[t]!==o[t]&&o.length!==e.length?null:t}var cp={label:"Ticker items",icon:S(MM,{})};function eie(e,o,t,r){return{type:"custom",[bt]:{control:"textList",label:e,placeholder:t,itemKey:"text",rendering:r},...Kt({},{...gw.textList,label:e}),render:({value:a,onChange:n})=>S(dp,{label:e,icon:Mn(o),items:Array.isArray(a)?a:[],placeholder:t,onChange:n,markup:r==="markup"})}}function dp({label:e,icon:o,items:t,placeholder:r,onChange:a,markup:n=!1}){let s=vi(null),[l,c]=Nn(null),d=h=>h.map(p=>({text:p?.text??""})),u=h=>{let p=x5(t,h,l);p===null&&(s.current=null),c(p),a(d(h))};return S(JM,{label:i(e),icon:o,noun:i("item"),items:t,onChange:u,newItem:()=>({text:""}),open:null,onOpen:()=>{},renderItem:()=>null,above:n?S(cu,{target:s,value:m5(t,l),onChange:h=>a(h5(t,l??-1,h)),disabled:l===null,label:l===null?i("Formatting \u2014 click a row first"):i("Formatting \u2014 row {n}",{n:l+1})}):void 0,renderRow:(h,p,x)=>S("input",{type:"text",className:n&&l===p?"sf-list-marking":void 0,value:h?.text??"",placeholder:i(r),"aria-label":i("{label} {n}",{label:i(e),n:p+1}),onChange:g=>x({text:g.target.value}),onFocus:g=>{s.current=g.currentTarget,c(p)}})})}function _w(e,o){let t=`${e.label} \u2014 row ${o+1}`;return Fr({control:"plainText",label:t,placeholder:e.placeholder,offPage:e.offPage},{type:"custom",render:({value:r,onChange:a})=>S(Rr,{value:r,onChange:a,label:i("{label} \u2014 row {n}",{label:i(e.label),n:o+1}),placeholder:e.placeholder,hideable:!1,markup:e.rendering==="markup"})})}function Rw(e){return{_gCards:Ko("Cards"),coverIndex:jo("Cover image",S(NM,{}),Zb,String(1),e?.coverHint??"A card's opening picture \u2014 a card pinned to a finish keeps its own."),imageBackground:LH("Image background",xi),cardImage:b5()}}function Fw(){return{outline:jo("Card outline",S(GM,{}),xu,mu),indexBadge:jo("Card number",S(iw,{}),hu,pu),showBadge:s5("Product badge",!0,S(tu,{noun:"tag"}))}}function Aw(e){let o=e?.defaults??{showCardSizes:!0,showCardBuy:!0,showCardPage:!0},t=a=>({...Pi,label:Ci.find(n=>n.id===a).label}),r=a=>Kt(lH(op),t(a));return{_gShowOnCard:Ko("Show on a card"),[op]:Kt({type:"custom",render:()=>S(I5,{rest:{showCardPrice:!0,showCardFinishes:!0,...o}})},t(op)),showCardFinishes:r("showCardFinishes"),showCardSizes:r("showCardSizes"),showCardBuy:r("showCardBuy"),showCardPage:r("showCardPage")}}var op="showCardPrice",Ci=[{id:"showCardPrice",label:"Price"},{id:"showCardFinishes",label:"Finish swatches"},{id:"showCardSizes",label:"Sizes"},{id:"showCardBuy",label:"Buy button"},{id:"showCardPage",label:"Page button"}];function I5({rest:e}){let o=St(),t=Iu(),r=s=>typeof o[s]=="boolean"?o[s]:void 0,a=s=>r(s)??e[s],n=Ci.some(({id:s})=>r(s)!==void 0&&r(s)!==e[s]);return S(fp,{parts:Ci,changed:n,shown:a,onPress:(s,l)=>t({[s]:l}),onReset:()=>t(Object.fromEntries(Ci.map(({id:s})=>[s,void 0])))})}function oie(e,o="display"){let t=Ra(o);return{[o]:Ve("desktop",{type:"custom",render:({value:r,onChange:a})=>S(fp,{parts:e,changed:kb(r),shown:n=>Ml(r,n),onPress:(n,s)=>a(Tb(r,n,s)),onReset:()=>a(void 0)})}),[t]:Ve("mobile",{type:"custom",render:({value:r,onChange:a})=>S(g5,{parts:e,desktopKey:o,value:r,onChange:a})})}}function fp({parts:e,changed:o,shown:t,onPress:r,onReset:a,detail:n,disabledReason:s}){let l=i("Display");return S(Ye,{label:l,icon:S(CM,{}),changed:o,action:S(po,{words:ee()?.panel,label:l,changed:o,detail:n,onReset:a}),children:S(QM,{label:l,items:e.map(c=>({id:c.id,label:i(c.label),shown:t(c.id),...s?{disabled:!0,disabledReason:i(s)}:{}})),onChange:r})})}function g5({parts:e,desktopKey:o,value:t,onChange:r}){let a=St()[o];return S(fp,{parts:e,changed:Pb(t),shown:n=>nu(a,t,n),onPress:(n,s)=>r(Eb(t,n,s)),onReset:()=>r(Ul),detail:i("the same as Desktop")})}function b5(){return Cw("Card image",{min:To,max:dr,step:Vg,hint:"Rounds the picture. The card's own corner is in Styles."})}function tie(){return sp({sidesKey:"cornerSides",step:Yg,useFollowed:()=>To,mark:S(y5,{label:Xg}),hint:i("Rounds the picture. Left alone it stays square.")})}function y5({label:e,changed:o=!1,onReset:t=()=>{}}){return S(po,{words:ee()?.panel,label:i(e),changed:o,onReset:t})}function rie(){return{type:"custom",render:({value:e,onChange:o})=>S(v5,{value:typeof e=="string"?e:"",onChange:o})}}function S5({layout:e,width:o}){return S("span",{"aria-hidden":"true",style:{display:"grid",width:o,gridTemplateColumns:"repeat(12, minmax(0, 1fr))",gridAutoRows:6,gridAutoFlow:"row dense",gap:2},children:eb(e).map(([t,r],a)=>S("i",{className:"block rounded-xs bg-current opacity-60",style:{gridColumn:`span ${t}`,gridRow:`span ${r}`}},a))})}var w5={width:"3.5rem",height:"2.5rem"},C5=200;function v5({value:e,onChange:o}){let[t,r]=Nn(null),[a,n]=Nn(4),s=vi(null);IM(()=>{let p=s.current;if(!p||typeof ResizeObserver!="function")return;let x=()=>n(p.getBoundingClientRect().width>=C5?4:3);x();let g=new ResizeObserver(x);return g.observe(p),()=>g.disconnect()},[]);let l=e&&e in ht?e:"",c=Vf(t,l),d=Vf(t,"").length,u=Fl("no-symbol"),h=[{value:"",label:i("Not chosen"),icon:u},...c.map(p=>({value:p,label:i(ht[p].label),icon:S(S5,{layout:ht[p],width:40})}))];return S(Ye,{label:i("Layout"),icon:S(BM,{}),value:l?i(ht[l].label):void 0,children:S("div",{ref:s,style:{flex:"1 1 auto",minWidth:0},children:S(nH,{label:i("Layout"),value:l,emptyValue:"",options:h,onChange:o,columns:a,cell:w5,header:Fa("div",{className:"mb-2 flex flex-col gap-1",style:{minWidth:"11rem"},children:[S("span",{className:"text-2xs text-ink-faint",children:i("Photos in a row")}),S(qM,{options:[{id:"all",label:i("All")},...Jg.map(p=>({id:String(p),label:String(p)}))],value:t===null?"all":String(t),ariaLabel:i("Photos in a row"),onChange:p=>r(p==="all"?null:Number(p))}),S("span",{className:"text-2xs text-ink-faint",children:i("{n} of {total} layouts",{n:d,total:qf.length})})]})})})})}var E5="Applies to panels, cards, inputs and buttons. Round things \u2014 color swatches, switches, status dots \u2014 stay round.",up="Corners";function Lw({value:e,onChange:o,showHint:t=!0}){let r=e===null;return Ni(P5,{label:i(up),icon:Ni(T5,{}),value:r?i("Default"):`${e}px`,changed:!r,action:Ni(k5,{words:ee()?.panel,label:i(up),changed:!r,detail:i("the built-in corners"),onReset:()=>o(null)}),hint:t?i(E5):void 0,children:Ni(Co,{min:To,max:dr,step:1,value:e??To,readout:!1,ariaLabel:i(up),onChange:o})})}import{jsx as zn}from"react/jsx-runtime";import{SettingsDefaultReset as O5,SettingsField as _5}from"efficient-easel/panel";import{IconPicker as R5}from"efficient-shell/ui";import{ShadowIcon as F5}from"efficient-easel/icons";var pp={none:"None",soft:"Soft",lifted:"Lifted"},A5="Applies to cards \u2014 products, brands, journal entries and filter cells. Round things like swatches and status dots are never shadowed.",L5={none:"none",soft:"0 1px 1px rgba(20, 20, 22, 0.10), 0 2px 4px -1px rgba(20, 20, 22, 0.14)",lifted:"0 1px 2px rgba(20, 20, 22, 0.10), 0 4px 7px -2px rgba(20, 20, 22, 0.30)"};function Bw({value:e,onChange:o,showHint:t=!0}){let r=e===null,a=e??xf;return zn(_5,{label:i("Card shadow"),icon:zn(F5,{}),value:i(pp[a]),changed:!r,action:zn(O5,{words:ee()?.panel,label:i("Card shadow"),changed:!r,detail:i(pp[xf]),onReset:()=>o(null)}),hint:t?i(A5):void 0,children:zn(R5,{label:i("Card shadow"),value:a,options:UI.map(n=>({value:n,label:i(pp[n]),icon:zn("span",{className:"sf-shadow-chip border border-line bg-surface",style:{boxShadow:L5[n]}})})),onChange:o})})}import{jsx as Dw}from"react/jsx-runtime";import{ShadowIcon as B5}from"efficient-easel/icons";var D5="Most useful on a dark theme, where a black shadow cannot be seen. Also used by the Lift hover, even with the card shadow off.";function Nw({value:e,onChange:o,showHint:t=!0}){let r=e===null;return Dw(Cl,{label:i("Shadow color"),icon:Dw(B5,{}),value:e??"",inherited:gf,resetTo:gf,onChange:o,onReset:()=>o(null),hint:t?i(D5):void 0})}import{jsx as Hi}from"react/jsx-runtime";import{SettingsDefaultReset as N5,SettingsField as M5}from"efficient-easel/panel";import{AlignSeparateIcon as H5}from"efficient-easel/icons";function Mi(e,o){return e==="tablet"?null:e==="mobile"?o.phone:o.desktop}var z5="The space between the blocks inside a row, a grid or a box. Default means each one keeps the spacing it already has.",W5="The space between the blocks inside a row, a grid or a box, on a phone. Until you set it, a phone uses half the desktop gap.",mp="Block gap",Mw=Ea.Grid;function Hw(e,o){return Mi(e,{desktop:{key:"block_gap",value:o.gap,followsPx:null},phone:{key:"block_gap_phone",value:o.phone,followsPx:o.gap===null?null:Yu(o.gap)}})}function zw({value:e,onChange:o,showHint:t=!0,followsPx:r=null}){let a=e===null,n=r===null?null:`${r}px`;return Hi(M5,{label:i(mp),labelId:"sf-block-gap",icon:Hi(H5,{}),value:a?n??i("Default"):`${e}px`,changed:!a,action:Hi(N5,{words:ee()?.panel,label:i(mp),changed:!a,detail:n??i("each block's own spacing"),onReset:()=>o(null)}),hint:t?i(n===null?z5:W5):void 0,children:Hi(Co,{min:Pr.min,max:Pr.max,step:Pr.step,value:e??(r===null?Mw:Ln(r)??Mw),readout:!1,ariaLabel:i(mp),onChange:o})})}import{jsx as Wi}from"react/jsx-runtime";import{SettingsDefaultReset as $5,SettingsField as j5,SettingsSegmented as K5}from"efficient-easel/panel";import{HoverIcon as q5}from"efficient-easel/icons";import{HOVER_MOTION as G5,motionSeconds as Ww}from"efficient-shell/format";var Ar="hover",U5=["none","nextImage","rotate","zoom","lift"],Gn={none:"None",nextImage:"Show next image",rotate:"Rotate",zoom:"Zoom",lift:"Lift"};function Gw(e){return U5.filter(o=>e.includes(o))}var hp=Gw(["none","lift"]);function Uw(e){let o=e[Ar];return hp.includes(o)?o:"none"}var zi=Gw(["none","rotate"]),qo={kind:Ar,angle:"hoverAngle",duration:"hoverDuration",delay:"hoverDelay"},Wn="spinOnHover",Aa={min:0,max:360,step:1},$w={ProductGrid:"rotate",RelatedProducts:"rotate",AlloyWheelsListing:"none"},Die=Object.keys($w);function xp(e){return $w[e]??"none"}var Ip=G5.rotateFallbackDeg;function gp(e,o){let t=e[qo.kind];if(zi.includes(t))return t;let r=e[Wn];return typeof r=="boolean"?r?"rotate":"none":o}function bp(e){let o=$(e);return o===void 0?Ip:Math.min(Aa.max,Math.max(Aa.min,o))}function Nie(e,o){let t=xp(o),r=gp(e,t);return{kind:r,angle:r==="rotate"?bp(e[qo.angle]):null,duration:Ww("hover","duration",r==="rotate"?e[qo.duration]:void 0),delay:Ww("hover","delay",r==="rotate"?e[qo.delay]:void 0)}}function jw(e){let o={field:qo.kind,in:[...zi]};return{any:[{field:qo.kind,is:"rotate"},{all:[{not:o},e==="rotate"?{not:{field:Wn,is:!1}}:{field:Wn,is:!0}]}]}}var yp={none:Gn.none,lift:Gn.lift,highlight:"Highlight"},V5="What a card does when a shopper points at it \u2014 or taps it, on a phone. Highlight is the effect your cards already use.";function Kw({value:e,onChange:o,showHint:t=!0}){let r=e===null,a=e??If;return Wi(j5,{label:i("Hover effect"),icon:Wi(q5,{}),value:i(yp[a]),changed:!r,action:Wi($5,{words:ee()?.panel,label:i("Hover effect"),changed:!r,detail:i(yp[If]),onReset:()=>o(null)}),hint:t?i(V5):void 0,children:Wi(K5,{options:$I.map(n=>({id:n,label:i(yp[n])})),value:a,ariaLabel:i("Hover effect"),onChange:o})})}import{jsx as Gi}from"react/jsx-runtime";import{SettingsDefaultReset as Y5,SettingsField as X5,SettingsSegmented as Z5}from"efficient-easel/panel";import{DropIcon as J5}from"efficient-easel/icons";var Sp="Photography",qw={shot:"As shot",mono:"Black and white"},wp=[{grayscale:!1,label:qw.shot},{grayscale:!0,label:qw.mono}],Q5="Black and white photographs return to color on hover. Wheels and tyres keep their real finish either way.";function Vw({value:e,onChange:o,showHint:t=!0}){let r=e===null,a=e??!1;return Gi(X5,{label:i(Sp),icon:Gi(J5,{}),value:i(wp.find(n=>n.grayscale===a).label),changed:!r,action:Gi(Y5,{words:ee()?.panel,label:i(Sp),changed:!r,detail:i(wp.find(n=>!n.grayscale).label),onReset:()=>o(null)}),hint:t?i(Q5):void 0,children:Gi(Z5,{options:wp.map(n=>({id:n.grayscale,label:i(n.label)})),value:a,ariaLabel:i(Sp),onChange:o})})}import{jsx as Cp}from"react/jsx-runtime";import{useId as e4}from"react";import{SettingsField as o4,SettingsSwitch as t4}from"efficient-easel/panel";import{ShareIcon as r4}from"efficient-easel/icons";var a4="Share button",n4="On every blog post.";function Yw({value:e,onChange:o,showHint:t=!0}){let r=e4();return Cp(o4,{label:i(a4),labelId:r,icon:Cp(r4,{}),action:Cp(t4,{checked:e===!0,onChange:o,ariaLabelledBy:r}),hint:t?i(n4):void 0})}import{usePreviewDevice as fm}from"efficient-easel/draw/client";import{jsx as Ki}from"react/jsx-runtime";import{SettingsDefaultReset as g4,SettingsField as b4}from"efficient-easel/panel";import{PaddingXIcon as y4}from"efficient-easel/icons";var lo={min:1e3,max:2e3,step:50,default:1600};function s4(e){return{maxWidth:e,marginInline:"auto",width:"100%"}}var Xw="--sf-site-width",vp=`var(${Xw},${lo.default}px)`,rce=`max-w-[${vp}]`,ace=`max-w-[${lo.default}px]`;function l4(e){return typeof e!="number"||!Number.isFinite(e)?lo.default:Math.round(Math.min(Math.max(e,lo.min),lo.max))}function nce(e){let o=l4(e);return o===lo.default?{}:{[Xw]:`${o}px`}}var wt={min:0,max:80,step:4,default:40},Zw="--sf-site-gutter",Un={min:0,max:24,step:4},i4="--sf-site-gutter-phone",c4="max-view-tablet:[--sf-site-gutter:var(--sf-site-gutter-phone)]!",Vo=`var(${Zw},${wt.default}px)`,d4=`px-[${Vo}]`;var Yt={md:`min(24px,${Vo})`,sm:`min(20px,${Vo})`,frame:`min(24px,${Vo})`,tabs:`min(16px,${Vo})`},sce=[[`max-view-desktop:px-[${Yt.md}]`,"max-view-desktop:px-6"],[`max-view-desktop:px-[${Yt.tabs}]`,"max-view-desktop:px-4"],[`max-[960px]:px-[${Yt.frame}]`,"max-[960px]:px-6"],[`max-[900px]:px-[${Yt.md}]`,"max-[900px]:px-6"],[`max-view-wide:px-[${Yt.md}]`,"max-view-wide:px-6"],[`max-view-tablet:px-[${Yt.sm}]`,"max-view-tablet:px-5"],[`max-view-wide:px-[${Yt.sm}]`,"max-view-wide:px-5"],[`max-[640px]:px-[${Yt.sm}]`,"max-[640px]:px-5"],[`view-wide:px-[${Vo}]`,"view-wide:px-10"],[`max-view-tablet:px-[min(24px,${Vo})]`,"max-view-tablet:px-6"],[`max-view-wide:-mx-[min(20px,${Vo})]`,"max-view-wide:-mx-5"],[`max-view-tablet:-mx-[min(20px,${Vo})]`,"max-view-tablet:-mx-5"],[`-mx-[${Vo}]`,"-mx-10"],[d4,"px-10"]];var lce="mx-auto max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)] max-view-wide:px-[min(20px,var(--sf-site-gutter,40px))]",ice="mx-auto max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)] max-view-desktop:px-[min(24px,var(--sf-site-gutter,40px))]";function Ui(e){return typeof e!="number"||!Number.isFinite(e)?wt.default:Math.round(Math.min(Math.max(e,wt.min),wt.max))}function cce(e){let o=Ui(e);return o===wt.default?{}:{[Zw]:`${o}px`}}function $i(e){return typeof e!="number"||!Number.isFinite(e)?null:Math.round(Math.min(Math.max(e,Un.min),Un.max))}function dce(e){let o=$i(e);return o===null?{}:{[i4]:`${o}px`}}function fce(e){return $i(e)===null?"":c4}function ji(e){return Math.min(Un.max,Ui(e))}var Jw=vp,uce=`max-w-[${Jw}]`,pce=`max-w-[min(var(--sf-page-cap,${lo.default}px),${lo.default}px)]`,Qw="--sf-hero-cap",f4=`var(${Qw},none)`,mce=`max-w-[${f4}]`,u4="--sf-hero-bleed-m",p4="--sf-hero-bleed-w",m4="--sf-hero-chrome-x",h4="--sf-hero-chrome-cap";function hce(e){return e===!0?{[Qw]:Jw,[u4]:"auto",[p4]:"100%",[m4]:"24px",[h4]:"none"}:{}}var kp=`calc(${vp} - ${Vo}*2)`,xce=`max-w-[${kp.replace(/ /g,"_")}]`;var x4="--sf-chrome-cap",I4=`var(${x4},${kp})`,Ice="data-page-width";function gce(e){return e==="full"?"full":null}function bce(e){return e==="full"?null:s4(e==="content"?kp:I4)}function yce(e){if(e==="full")return"full";if(e==="content")return"content"}var Pp="Side space",eC=wt.default,S4="The room left at the left and right edge of every page.";function oC(e,o){return Mi(e,{desktop:{key:"site_gutter",value:o.gutter,unsetPx:eC,bounds:wt},phone:{key:"site_gutter_phone",value:o.phone,unsetPx:ji(o.gutter),bounds:Un}})}function tC({value:e,onChange:o,showHint:t=!0,unsetPx:r=eC,bounds:a=wt}){let n=e===null;return Ki(b4,{label:i(Pp),labelId:"sf-side-space",icon:Ki(y4,{}),value:`${e??r}px`,changed:!n,action:Ki(g4,{words:ee()?.panel,label:i(Pp),changed:!n,detail:`${r}px`,onReset:()=>o(null)}),hint:t?i(S4):void 0,children:Ki(Co,{min:a.min,max:a.max,step:a.step,value:e??r,readout:!1,ariaLabel:i(Pp),onChange:o})})}import{jsx as Tp}from"react/jsx-runtime";import{BACKGROUND_WIDTHS as Fce,SettingsBackgroundWidth as w4,SettingsContentWidth as C4}from"efficient-easel/panel";var v4="Background width",k4="Content width";var qi=e=>i(Er[e==="content"?"page":"full"]),rC="The width of every section's background.",aC="The width of every section's content.";function nC({value:e,changed:o,detail:t,onChange:r,onReset:a,hint:n,labelId:s}){return Tp(w4,{value:e,changed:o,detail:t,onChange:r,onReset:a,hint:n?i(n):void 0,labelId:s,words:{label:i(v4),full:qi("full"),content:qi("content")},resetWords:ee()?.panel})}function sC({mode:e,px:o,max:t=lo.max,min:r=lo.min,changed:a,detail:n,onMode:s,onPx:l,onReset:c,hint:d,labelId:u}){let h=i(k4),p=e!=="full"?Tp(Co,{min:r,max:t,step:lo.step,value:Math.min(Math.max(o,r),t),onChange:l,suffix:"px",ariaLabel:h}):null;return Tp(C4,{mode:e,onMode:s,number:p,changed:a,detail:n,onReset:c,hint:d?i(d):void 0,labelId:u,words:{label:h,full:qi("full"),content:qi("content")},resetWords:ee()?.panel})}import{jsx as rv}from"react/jsx-runtime";import{TextStyleItem as X3,TextStylesGroup as Z3}from"efficient-easel/text-styles";import{jsx as U3}from"react/jsx-runtime";import{useState as $3}from"react";import{TextStylesList as j3}from"efficient-easel/text-styles";import{usePreviewDevice as K3}from"efficient-easel/draw/client";import{defaultTextStyles as UC,textStyleCaseCss as F3,textStyleViewKey as A3}from"efficient-easel/text-styles/model";import{phoneKey as L3,resolveViewValue as $C,tabletKey as B3}from"efficient-easel/draw";import{parseHexColor as D3}from"efficient-shell/format";import{textStyleCaseCss as N4,textStyleCaseOfCss as M4}from"efficient-easel/draw";import{parseHexColor as H4}from"efficient-shell/format";function Ep(e,o){return o?`${e}[${o.index}].${o.rowKey}`:e}function Yo(e){let o=/^([A-Za-z0-9_$]+)\[(\d+)\]\.([A-Za-z0-9_$]+)$/u.exec(e);return o?{key:o[1],row:{index:Number(o[2]),rowKey:o[3]}}:{key:e,row:null}}import{decodePartId as Fp,encodePartId as Ji}from"efficient-easel/draw";import{LINK_FIELD_MARKER as xC,SCAFFOLD_FIELD_MARKER as mC,TEXT_FIELD_MARKER as Qi}from"efficient-easel/draw";import{readHidable as IC}from"efficient-easel/draw";import{SCALAR_TEXT_CONTROLS as F4}from"efficient-easel/draw";import{TEXT_FIELD_MARKER as R4}from"efficient-easel/draw";import{TEXT_FIELD_MARKER as lC}from"efficient-easel/draw";import{readHidable as iC}from"efficient-easel/draw";import{SCALAR_TEXT_CONTROLS as P4}from"efficient-easel/draw";var T4=P4,E4=["text","textarea"],O4=["textarea","plainTextarea"];function _4(e){return!e||typeof e!="object"?null:e[lC]?.control??null}function La(e){let o=_4(e);return o&&T4.includes(o)?o:null}function Vi(e){return O4.includes(e)}function cC(e){return!e||typeof e!="object"?void 0:e[lC]?.placeholder}function Yi(e){return iC(e).text}function Op(e,o,t){return E4.includes(e)?{text:t,hidden:iC(o).hidden}:t}function dC(e,o,t,r){return Yi(e[o])===r?null:{...e,[o]:Op(t,e[o],r)}}function Xi(e){if(!(!e||typeof e!="object"))return e[R4]}function _p(e){if(!e||typeof e!="object")return null;let o=e.arrayFields;return o&&typeof o=="object"?o:null}function fC(e,o){if(!Array.isArray(o))return[];let t=Xi(e),r=[];if(t?.control==="textList"){let n=t.itemKey??"text";return o.forEach((s,l)=>{let c=he(s?.[n]);c&&r.push({row:{index:l,rowKey:n},text:c})}),r}let a=_p(e);return a?(o.forEach((n,s)=>{for(let[l,c]of Object.entries(a)){if(!La(c))continue;let d=Yi(n?.[l])||Xi(c)?.placeholder||"";d&&r.push({row:{index:s,rowKey:l},text:d})}}),r):[]}function $n(e,o){if(Array.isArray(e))return e[o.index]?.[o.rowKey]}function Rp(e,o,t,r){let a=e[o];return!Array.isArray(a)||t.index<0||t.index>=a.length?null:{...e,[o]:a.map((n,s)=>s===t.index?{...n,[t.rowKey]:r}:n)}}function uC(e,o,t,r,a){let n=$n(e[o],t);return Yi(n)===a?null:Rp(e,o,t,Op(r,n,a))}function pC(e,o){return o?`${e} \xB7 row ${o.index+1}`:e}var Xo="data-sf-part",rde="data-sf-region-part",ade="data-sf-part-row";function nde(e,o){return`${e}[${o}]`}var sde="data-sf-part-kind",A4="data-sf-part-style-owner",L4="data-sf-part-style-kind";function lde(e){for(let o=e;o;o=o.parentElement){let t=o.getAttribute(A4),r=o.getAttribute(L4);if(t&&r)return{owner:t,kind:r};if(o.getAttribute("data-easel-block"))return null}return null}var hC=2;function Ba(e){return Sr(e).replace(/\s+/gu,"")}function Zi(e,o,t){let r=e[Qi];if(r){if(r.control==="textList"){let n=r.itemKey??"text";if(!Array.isArray(o))return;for(let s of o){let l=s?.[n];typeof l=="string"&&t.push(l)}return}let{text:a}=IC(o);a?t.push(a):r.placeholder&&t.push(r.placeholder);return}if(!e[xC]){if(e.type==="text"||e.type==="textarea"){let a=he(o);a&&t.push(a);return}if(e.arrayFields&&Array.isArray(o)){for(let a of o)for(let[n,s]of Object.entries(e.arrayFields))Zi(s,a?.[n],t);return}if(e.objectFields&&o&&typeof o=="object")for(let[a,n]of Object.entries(e.objectFields))Zi(n,o[a],t)}}function gC(e){if(!e||typeof e!="object")return!1;let o=e;return o[xC]?!1:!!o[Qi]||o.type==="text"||o.type==="textarea"}function ec(e,o){let t=e[Qi];return t?.label?t.label:typeof e.label=="string"?e.label:o}function Ap(e){let o=e.indexOf(" (");return(o>0?e.slice(0,o):e).trim()}function ide(e,o){if(!e)return[];let t=[];for(let[r,a]of Object.entries(e)){if(!a||typeof a!="object"||En(r))continue;let n=a,s=[];Zi(n,o?.[r],s),!s.length&&n[mC]!==void 0&&Zi(n,n[mC],s);let l=ec(n,r),c=new Set;for(let{row:h,text:p}of fC(n,o?.[r])){let x=Ba(p);x.length<hC||(c.add(x),t.push({key:r,label:l,texts:[x],row:h}))}let d=new Set(c),u=[];for(let h of s){let p=Ba(h);p.length<hC||d.has(p)||(d.add(p),u.push(p))}u.length&&t.push({key:r,label:l,texts:u})}return t}function Lp(e){return!e.offPage&&!e.hidden}var B4=F4;function bC(e,o){if(!o||typeof o!="object"||En(e)||Kb(o))return null;let t=o[Qi];return!t||!B4.includes(t.control)?null:t}function cde(e,o){let t=bC(e,o);return t!==null&&t.identifier!==!0}function yC(e,o){if(!e)return[];let t=[];for(let[r,a]of Object.entries(e)){let n=bC(r,a);if(!n)continue;let{text:s,hidden:l}=IC(o?.[r]);if(Lp({offPage:n.offPage===!0,hidden:!!l}))continue;let c=s||n.placeholder||"",d=Sr(c).replace(/\s+/gu," ").trim();t.push({key:r,label:Ap(ec(a,r)),preview:d,offPage:n.offPage===!0,identifier:n.identifier===!0,hidden:!!l})}return t}var oc="data-sf-spec-region";function SC(e){return e.writable===!0&&e.sized===!0}function tc(e,o,t){if(!e)return;let r=t[e];if(r)return{fontFamily:`var(--font-role-${e})`,fontSize:`var(--size-${r}, ${o.builtIn})`}}function Da(e){let o=/var\(--size-[A-Za-z]+, ?([0-9.]+px)\)/.exec(e);if(!o)throw new Error(`builtInOf: no --size-* fallback in ${e}`);return o[1]}function Bp(e){return`@${e}`}function Dp(e,o){if(!o.startsWith("@"))return null;let t=o.slice(1);return t in e?t:null}function D4(e,o){return o&&o in e?o:null}function Na(e){return!e||typeof e!="object"||Array.isArray(e)?null:e}function Ma(e,o){return Na(e?.[o])??{}}function rc(e,o,t){let r=Ma(e,o);return Object.hasOwn(r,t)?Na(r[t])??{}:{}}function ac(e,o,t,r){let{[t]:a,...n}=Ma(e,o),s=r?{...n,[t]:r}:n,{[o]:l,...c}=e;return Object.keys(s).length?{...c,[o]:s}:c}var Hp="_partStyles",zp="data-sf-part-styled",Ha="data-sf-text-style",z4=/^(heading|body)-[1-7]$/;function Br(e){return typeof e=="string"&&z4.test(e)}var sc={heading:"heading-1",heading2:"heading-2",heading3:"heading-3",body:"body-1",label:"body-5"};function W4(e){if(!e)return null;for(let[o,t]of Object.entries(sc))if(t===e)return o;return null}function Wp(e){if(Br(e.textStyle))return e.textStyle;let o=mt(e.role);return o?sc[o]:void 0}var G4=[400,500,600,700],nc=["left","center","right","justify"],wC=5,CC=1e3,U4=-5,$4=10,Gp=0,Up=64,$p=2,vC={size:{min:wC,max:CC,step:1},sizePhone:{min:wC,max:CC,step:1},padding:{min:Gp,max:Up,step:$p}},j4=.05,K4=.01,q4=["line","letter"],V4=.5,Y4=2.5,X4=-1,Z4=1,J4=0,Q4=400,e3=[...new Set(Object.values(ha))];function _C(e){return[`${e} { transition: translate var(--page-motion-hover-duration) var(--page-ease-media) var(--page-motion-hover-delay) }`,`${e}:hover, ${e}:active { translate: 0 calc(-1 * var(--page-hover-lift)) }`]}function wde(e){return Ma(e,Hp)}function Kn(e,o){return rc(e,Hp,o)}function RC(e,o,t){return ac(e,Hp,o,o3(t).length?t:null)}function o3(e){return Object.entries(e).filter(([,o])=>o!==void 0)}function t3(e){return q4.includes(e)}var jn=(e,o,t)=>Math.min(t,Math.max(o,e));function r3(e,o){if(t3(e)){let t=Math.round(Number(o));return!Number.isFinite(t)||t===0?null:jn(t,U4,$4)}if(e==="lineHeight"){let t=Number(o);return Number.isFinite(t)?za(jn(t,V4,Y4),3):null}if(e==="letterSpacing"){let t=Number(o);return Number.isFinite(t)?za(jn(t,X4,Z4),4):null}if(e==="paragraphSpacing"){let t=Math.round(Number(o));return!Number.isFinite(t)||t<=0?null:jn(t,J4,Q4)}if(Object.hasOwn(vC,e)){let{min:t,max:r}=vC[e],a=Math.round(Number(o));return Number.isFinite(a)?jn(a,t,r):null}return e==="italic"?typeof o=="boolean"?o:null:e==="role"||e==="fontRole"?mt(o)?o:null:e==="sizeToken"?Kp(o)?o:null:e==="textStyle"?Br(o)?o:null:e==="alignPhone"?nc.includes(o)?o:null:o}var a3=["weight","size","sizePhone","line","letter","lineHeight","letterSpacing","paragraphSpacing","padding"];function jp(e){let o=null,t=r=>{o??={...e},delete o[r]};for(let r of a3){let a=e[r];a!==void 0&&!(typeof a=="number"&&Number.isFinite(a))&&t(r)}return e.align!==void 0&&!nc.includes(e.align)&&t("align"),e.alignPhone!==void 0&&!nc.includes(e.alignPhone)&&t("alignPhone"),e.textStyle!==void 0&&!Br(e.textStyle)&&t("textStyle"),e.sizeToken!==void 0&&!Kp(e.sizeToken)&&t("sizeToken"),e.fontRole!==void 0&&!mt(e.fontRole)&&t("fontRole"),o??e}function Kp(e){if(!e||typeof e!="object")return!1;let{step:o,px:t,stepPhone:r,pxPhone:a,fluid:n}=e,s=c=>typeof c=="number"&&Number.isFinite(c)&&c>0,l=c=>typeof c=="string"&&e3.includes(c);return l(o)&&s(t)&&(r===void 0||l(r))&&(a===void 0||s(a))&&(n===void 0||n3(n,t))}function n3(e,o){if(!e||typeof e!="object"||Array.isArray(e))return!1;let{minPx:t,vw:r,...a}=e;return Object.keys(a).length===0&&typeof t=="number"&&Number.isFinite(t)&&t>0&&t<o&&typeof r=="number"&&Number.isFinite(r)&&r>0&&r<=100}function FC(e){return e?.pxPhone&&Kp(e)?{step:e.stepPhone??e.step,px:e.pxPhone}:null}function AC({step:e,px:o,fluid:t}){let r=t?`clamp(${t.minPx}px, ${t.vw}vw, ${o}px)`:`${o}px`,a=`var(--size-${e}, ${r})`;return e.startsWith("heading")?`min(${a}, var(--sf-heading-max,9999px))`:a}var s3=[["font","role"],["font","fontRole"],["role","textStyle"],["line","lineHeight"],["letter","letterSpacing"]];function l3(e){let o=[];for(let[t,r]of s3)t===e?o.push(r):r===e&&o.push(t);return o}function Dr(e,o,t,r){let a={...Kn(e,o)},n=r==null?null:r3(t,r);if(n===null)delete a[t];else{a[t]=n;for(let s of l3(t))delete a[s]}return RC(e,o,a)}function LC(e,o){return RC(e,o,{})}function i3(e){return M4(e)??"none"}function c3(e){return N4(e)??""}var kC={heading:"--font-role-heading",heading2:"--font-role-heading2",heading3:"--font-role-heading3",body:"--font-role-body",accent:"--font-role-accent",label:"--font-role-label"};function d3(e,o){return mt(e.role)||(o?.blockDrawsStyle?null:W4(e.textStyle))}function BC(e,o){return e==="Text"&&o==="text"}var f3={headingLarge:"min(clamp(64px,9vw,144px), var(--sf-heading-max,9999px))",headingMedium:"min(32px, var(--sf-heading-max,9999px))",headingSmall:"min(24px, var(--sf-heading-max,9999px))",accent:"32px",body:"14px",label:"12px"};function u3(e){let o=ha[e],t=f3[o];return t?`var(--size-${o}, ${t})`:`var(--size-${o})`}function qn(e){let o={};return typeof e.lineHeight=="number"?o.lineHeight=e.lineHeight:e.line&&(o.lineHeight=za(p3+e.line*j4,3)),typeof e.letterSpacing=="number"?o.letterSpacingEm=e.letterSpacing:e.letter&&(o.letterSpacingEm=za(e.letter*K4,4)),o}var p3=1,Lr="--sf-part-para";function m3(e){e=jp(e);let o={};if(typeof e.sizePhone=="number"&&e.sizePhone>0)o.fontSize=`${e.sizePhone}px`;else{let t=FC(e.sizeToken);t&&(o.fontSize=AC(t))}return e.alignPhone&&(o.textAlign=e.alignPhone),o}function h3(e,o){if(!o)return e;let t=jp(e),r=e;if(typeof t.sizePhone=="number"&&t.sizePhone>0)r={...r,size:t.sizePhone};else{let a=FC(t.sizeToken);a&&(r={...r,size:void 0,sizeToken:a})}return t.alignPhone&&(r={...r,align:t.alignPhone}),r}function qp(e,o,t){return Vp(h3(e,o),lc,t)}function DC(e,o){let t=o?"sizePhone":"size";if(!Object.hasOwn(e,t))return e;let r={...e};return delete r[t],r}function Cde(e,o,t){let r=qp(DC(e,o),o,t);return{fontFamily:r.fontFamily,fontSize:r.fontSize}}function Vp(e,o,t){e=jp(e);let r=d3(e,t),a=qn(e),n=e.size?`${e.size}px`:e.sizeToken?AC(e.sizeToken):r?u3(r):"";return{fontFamily:e.font?b3(e.font):e.fontRole?`var(${kC[e.fontRole]})`:r?`var(${kC[r]})`:"",fontWeight:e.weight?String(e.weight):"",fontSize:n,minWidth:n?"0":"",overflowWrap:n?"break-word":"",lineHeight:a.lineHeight!==void 0?String(a.lineHeight):"",letterSpacing:a.letterSpacingEm!==void 0?`${a.letterSpacingEm}em`:"",[Lr]:e.paragraphSpacing?`${e.paragraphSpacing}px`:"",textTransform:c3(e.case),textAlign:e.align??"",paddingTop:PC(e.padding),paddingBottom:PC(e.padding),color:x3(e.color),fontStyle:e.italic===!0?"italic":e.italic===!1?"normal":""}}var x3=e=>e===void 0||e===""?"":Object.hasOwn(xt,e)?xt[e]:H4(e)===e.toLowerCase()?e:"",PC=e=>e===void 0?"":`${e}px`,za=(e,o)=>Number(e.toFixed(o));function vde(e,o){let t=Number.parseFloat(e.fontSize)||16,r=Number.parseFloat(e.lineHeight),a=Number.parseFloat(e.letterSpacing),n=Number.parseFloat(e.paddingTop);return{fontKey:o,sizePx:t,weight:I3(Number.parseInt(e.fontWeight,10)),lineRatio:Number.isFinite(r)?za(r/t,3):1.2,letterEm:Number.isFinite(a)?za(a/t,4):0,align:g3(e.textAlign),case:i3(e.textTransform),paddingPx:Number.isFinite(n)?Math.round(n):0}}function I3(e){return Number.isFinite(e)?G4.reduce((o,t)=>Math.abs(t-e)<Math.abs(o-e)?t:o):400}function g3(e){for(let o of nc)if(o===e)return o;return e==="end"?"right":"left"}function kde(e,o){let t=TC(e);if(!t)return"";for(let r of Mo)if(TC(o(r.cssVar))===t)return r.key;return""}var TC=e=>(e.split(",")[0]??"").replace(/["']/g,"").replace(/\s+/g," ").trim().toLowerCase();function b3(e){let o=ma(e);return o?`var(${o.cssVar})`:""}function Pde(e,o,t,r){return!o||Fp(o)?.nodeId!==e?null:t.find(a=>r(a.getAttribute("class")))??t[0]??null}function y3(e,o){return Object.hasOwn(e,o)?Na(e[o])??{}:{}}function Tde(e,o,t=()=>lc,r=l=>l,a=C3,n=!1,s=()=>!1){let l=0;for(let{element:c,partId:d}of e){let u=Fp(d)?.propKey;if(!u)continue;let h=y3(o,r(u)),p=qp(h,n,{blockDrawsStyle:s(u)});Br(h.textStyle)?c.setAttribute?.(Ha,h.textStyle):c.removeAttribute?.(Ha);let x=Np.some(y=>c.style[y]),g=!1;for(let[y,E]of Object.entries(p))P3(c,y,E),E&&(g=!0);if(x||Np.some(y=>p[y]))for(let y of S3(c,a))for(let E of Np)y.style[E]=p[E]??"";g&&(l+=1)}return l}function S3(e,o){let t=Ba(e.textContent??""),r=[],a=e;for(let n=0;n<w3&&o(a);n+=1){let s=a.parentElement;if(!s||Ba(s.textContent??"")!==t)break;r.push(s),a=s}return r}var w3=8;function C3(e){let o=e;return typeof window>"u"||!o?.ownerDocument?!1:window.getComputedStyle(o).display==="inline"}var lc={fontKey:"",sizePx:16,weight:400,lineRatio:1,letterEm:0,align:"left",case:"none",paddingPx:0};function v3(e){if(!e||typeof e!="object")return null;let o={};return Br(e.textStyle)&&(o.textStyle=e.textStyle),typeof e.size=="number"&&e.size>0&&(o.size=e.size),typeof e.sizePhone=="number"&&e.sizePhone>0&&(o.sizePhone=e.sizePhone),Object.keys(o).length?o:null}function k3(e,o){let t=v3(e);if(!t)return{};let r=qp(t,o);return{...r.fontFamily?{fontFamily:r.fontFamily}:{},...r.fontSize?{fontSize:r.fontSize}:{}}}function NC(e){return Br(e?.textStyle)||!!e?.role||typeof e?.size=="number"&&e.size>0}function Ede(e,o,t){if(!e||typeof e!="object")return{};let r=tc(e.role,o,ha)??{},a=o.sized?k3(DC(e,t),t):{};return{...r,...a}}function Ode(e,o,t){t.fontFamily&&e.fontFamily===t.fontFamily&&(e.fontFamily=o.fontFamily),t.fontSize&&e.fontSize===t.fontSize&&(e.fontSize=o.fontSize)}function P3(e,o,t){if(!o.startsWith("--")){e.style[o]=t;return}let r=e.style;typeof r.setProperty=="function"?t?r.setProperty(o,t):r.removeProperty?.(o):r[o]=t;let a=e;o===Lr&&(t?a.setAttribute?.(EC,""):a.removeAttribute?.(EC))}var EC="data-sf-part-para",T3=Object.keys(Vp({},lc)),Mp=new Set(["color","overflowWrap",Lr,"fontStyle"]),Np=T3.filter(e=>!Mp.has(e));function MC(e,o,t,r=l=>l,a=()=>!1,n=()=>null,s=[]){let l=new Map;for(let u of e){let h=Ep(u.key,u.row);for(let p of u.texts){let x=l.get(p);x?(x.keys.add(u.key),x.partKeys.add(h)):l.set(p,{keys:new Set([u.key]),partKeys:new Set([h])})}}let c=new Map;for(let u of new Set([...Object.keys(o),...s])){if(!E3(u))continue;let h=OC(t,u,Na(o[u])??{},!1,n(u));h&&c.set(u,h)}let d=new Map;for(let[u,{keys:h,partKeys:p}]of l){let x=p.size===1?[...p][0]:h.size===1?[...h][0]:null;if(!x)continue;let g=r(x),y=n(g);if(!Object.hasOwn(o,g)&&!y)continue;let E=Na(o[g])??{},_=OC(t,x,E,a(x),y);_&&d.set(u,_)}return d.size||c.size?{rules:d,kindRules:c,drawn:new Set(l.keys())}:null}function OC(e,o,t,r,a){let n=Vp(t,lc,{blockDrawsStyle:r}),s=m3(t),l=Br(t.textStyle)?t.textStyle:void 0;return!Object.values(n).some(Boolean)&&!Object.keys(s).length&&!l&&!a?null:{stamp:O3(e,o),declarations:n,...Object.keys(s).length?{phone:s}:{},...l?{textStyle:l}:{},...a?{motion:a}:{}}}function E3(e){return e.startsWith("@")}function Yp(e,o){return e?.kindRules.get(o)??null}function O3(e,o){let t=r=>r.replace(/[^A-Za-z0-9_-]+/g,"-");return`${t(e)}~${t(o)}`}function HC(e){let o=[],t=new Set,r=a=>{let{stamp:n,declarations:s}=a;if(t.has(n))return;t.add(n);let l=Object.entries(s).filter(([,x])=>x!==""),c=x=>x.map(([g,y])=>`${_3(g)}: ${y}`).join("; "),d=`[${zp}="${n}"]`,u=l.filter(([x])=>!Mp.has(x)),h=l.filter(([x])=>Mp.has(x));u.length&&o.push(`${d}, *:has(> ${d}) { ${c(u)} }`),h.length&&o.push(`${d} { ${c(h)} }`),s[Lr]&&(o.push(`*:has(> ${d}) { ${Lr}: ${s[Lr]} }`),o.push(...ic(d,`*:has(> ${d})`)));let p=Object.entries(a.phone??{}).filter(([,x])=>x!=="");p.length&&o.push(`@media ${Ca} { ${d}, *:has(> ${d}) { ${c(p)} } }`)};for(let a of e.rules.values())r(a);for(let a of e.kindRules.values())r(a);return o.join(`
4
4
  `)}function ic(e,o){let t=`var(${Lr})`,r=":is([data-sf-bullet], [data-sf-number])";return[`${e} br:not(br + br) { display: block; content: ""; margin-top: ${t} }`,`${e} ${r}:not(:first-child) { margin-top: ${t} }`,`${e} ${r}:not(:last-child) { margin-bottom: ${t} }`,`:is(${o}) + :is(${o}) { margin-top: ${t} }`]}var _3=e=>e.replace(/[A-Z]/g,o=>`-${o.toLowerCase()}`);function zC(e,o){if(!e)return null;let t=Ba(o),r=e.rules.get(t);if(r)return r;if(t.length<R3||e.drawn.has(t))return null;let a=null;for(let[n,s]of e.rules)if(n.includes(t)){if(a&&a.stamp!==s.stamp)return null;a=s}return a}var R3=8;function WC(e){switch(e.id){case"heading-1":return"font-display";case"heading-2":return"font-heading2";case"heading-3":return"font-heading3";case"body-1":return"font-body";case"body-5":return"font-mono";default:return`font-${e.id}`}}var Xp=e=>e==="sentence"?"none":void 0,jC=["font","color","size","sizeTablet","sizePhone","weight","italic","lineHeight","lineHeightTablet","lineHeightPhone","letterSpacing","letterSpacingTablet","letterSpacingPhone","paragraphSpacing","paragraphSpacingTablet","paragraphSpacingPhone","letterCase","largestSize","largestSizeTablet","largestSizePhone"],Wa=["desktop","tablet","phone"],Vn=(e,o)=>o==="desktop"?e:o==="tablet"?B3(e):L3(e),Nr=(e,o)=>o==="desktop"?e:A3(e,o);function Qp(e,o,t,r=ei()){return $C("textSize",o,e.sizeTablet,e.sizePhone,r)[t]}var N3=[["lineSpacing","lineHeight","line"],["letterSpacing","letterSpacing","letter"]];function Zp(e){for(let[o,t,r]of N3)for(let a of Wa)if(e===Nr(o,a))return{key:Vn(t,a),view:a,spacing:r};return{key:e,view:"desktop",spacing:null}}function lt(e){let o={};for(let t of jC)e[t]!==void 0&&(o[t]=e[t]);return o}function em(e,o){let{auto:t,...r}=e,a=new Set(o??[]),n=jC.filter(s=>a.has(s)&&e.values[s]===void 0);return n.length?{...r,auto:n}:r}function KC(e){let o=e.fonts,t=e.sizes,r=e.typography,a=KI(e.compression),n={"heading-1":{font:he(o.heading),size:$(t.headingLarge),weight:$(r.weight),lineHeight:a.lineHeight,letterSpacing:a.letterSpacing,letterCase:Xp(r.case),largestSize:$(r.maxPx)},"heading-2":{font:he(o.heading2),size:$(t.headingMedium),weight:$(r.weight2),lineHeight:a.lineHeight,letterSpacing:a.letterSpacing,letterCase:Xp(r.case2)},"heading-3":{font:he(o.heading3),size:$(t.headingSmall),weight:$(r.weight3),lineHeight:a.lineHeight,letterSpacing:a.letterSpacing,letterCase:Xp(r.case3)},"body-1":{font:he(o.body),size:$(t.body)},"body-5":{font:he(o.label),size:$(t.label)}};return UC().map(({id:s,kind:l,name:c})=>({id:s,kind:l,name:c,values:lt(n[s]??{})}))}function om(e){return Array.isArray(e)&&e.every(o=>o&&typeof o=="object"&&typeof o.id=="string"&&(o.kind==="heading"||o.kind==="body")&&typeof o.name=="string")?e.map(o=>em({...o,values:lt(o.values??{})},Array.isArray(o.auto)?o.auto:void 0)):null}function Gde(e){return om(e)??[]}function qC(e){return om(e)??UC().map(({id:o,kind:t,name:r})=>({id:o,kind:t,name:r,values:{}}))}function Ct(e,o){let t=KC(o),r=om(e);return r?r.map(a=>{let n={...Jp(t,a.id)};for(let s of a.auto??[])delete n[s];return{...a,values:lt({...n,...a.values})}}):t}var Jp=(e,o)=>e.find(t=>t.id===o)?.values??{},GC=["heading-1","heading-2","heading-3"];function VC({saved:e,old:o,cur:t,next:r,sizeOf:a,panelView:n="desktop"}){let s=KC(o),l=qC(e),c=Ct(l,o),d=[],u=r.map(p=>{let x=t.find(k=>k.id===p.id),g=l.find(k=>k.id===p.id);if(!x||!g)return M3([p],a,n)[0];let y={...g.values},E=new Set(g.auto??[]),_=p.values,w=x.values,I=[...new Set([...Object.keys(_),...Object.keys(w)])].filter(k=>JSON.stringify(_[k])!==JSON.stringify(w[k])),v=k=>Zp(k).spacing==="letter";I.sort((k,C)=>Number(v(k))-Number(v(C)));for(let k of I){let{key:C,view:F,spacing:D}=Zp(k),T=C,R=_[k];if(R===void 0){delete y[T],Jp(s,p.id)[T]!==void 0&&(d.push([p.id,T]),E.add(T));continue}if(E.delete(T),D==="line")y[T]=Ga(R/100,3);else if(D==="letter"){let N={...c.find(A=>A.id===p.id)?.values??{}};for(let A of I)_[A]===void 0&&delete N[Zp(A).key];let b=lt({...N,...y}),O=Qp(b,a({...p,values:b}),F);y[T]=O?Ga(R/O,4):0}else y[T]=R}return em({id:p.id,kind:p.kind,name:p.name,values:lt(y)},E)}),h=o.compression;if(d.some(([p,x])=>(x==="lineHeight"||x==="letterSpacing")&&GC.includes(p))&&fr(h)!=="normal"){for(let p of GC){let x=u.find(y=>y.id===p);if(!x)continue;let g={...x.values};for(let y of["lineHeight","letterSpacing"])d.some(([E,_])=>E===p&&_===y)||g[y]===void 0&&!(x.auto??[]).includes(y)&&(g[y]=Jp(s,p)[y]);x.values=lt(g)}h="normal"}return{saved:u,old:{...o,compression:h}}}function YC(e,o){let t={text_styles:e.saved};return e.old.compression!==o.compression&&(t.heading_compression=fr(e.old.compression)),t}var Ga=(e,o)=>Number(e.toFixed(o)),XC=(e,o)=>Wa.indexOf(e)<Wa.indexOf(o)?o:e;function ZC(e,o,t="desktop"){return e.map(r=>{let a={...r.values},n=o(r);for(let s of Wa){let l=Vn("lineHeight",s),c=r.values[l],d=r.values[Vn("letterSpacing",s)];delete a[l],c!==void 0&&(a[Nr("lineSpacing",s)]=Ga(c*100,1));let u=XC(s,t);d!==void 0&&(a[Nr("letterSpacing",s)]=Ga(d*Qp(r.values,n,u),u===s?2:4))}return{id:r.id,kind:r.kind,name:r.name,values:a}})}function M3(e,o,t="desktop"){return e.map(r=>{let a=r.values,n={...a};for(let d of Wa)delete n[Nr("lineSpacing",d)],delete n[Nr("letterSpacing",d)];let s={id:r.id,kind:r.kind,name:r.name,values:lt(n)},l={...s.values},c=o({...s,values:{...s.values}});for(let d of Wa){let u=a[Nr("lineSpacing",d)],h=a[Nr("letterSpacing",d)];if(typeof u=="number"&&(l[Vn("lineHeight",d)]=Ga(u/100,3)),typeof h=="number"){let p=Qp(s.values,c,XC(d,t));l[Vn("letterSpacing",d)]=p?Ga(h/p,4):0}}return{...s,values:lt(l)}})}function Ude(e){let o={fonts:yn({heading:e.heading_font??void 0,heading2:e.heading_2_font??void 0,heading3:e.heading_3_font??void 0,body:e.body_font??void 0,accent:e.accent_font??void 0,label:e.label_font??void 0}),sizes:hf({headingLarge:e.heading_size_large_px,headingMedium:e.heading_size_medium_px,headingSmall:e.heading_size_small_px,accent:e.accent_size_px,body:e.body_size_px,label:e.label_size_px}),compression:fr(e.heading_compression),typography:VI(e)},t=e.text_styles??null,r=Array.isArray(t)?tm(Ct(t,o),o):o;return{fonts:yn(r.fonts),sizes:hf(r.sizes),compression:fr(r.compression),typography:r.typography,textStyles:t}}function tm(e,o){let t=p=>e.find(x=>x.id===p)?.values??{},r=t("heading-1"),a=t("heading-2"),n=t("heading-3"),s=t("body-1"),l=t("body-5"),c=o.fonts,d=o.sizes,u=o.typography,h=p=>p==="none"?"sentence":"authored";return{fonts:{...c,heading:r.font??c.heading,heading2:a.font??r.font??c.heading2,heading3:n.font??r.font??c.heading3,body:s.font??c.body,label:l.font??c.label},sizes:{...d,headingLarge:r.size??null,headingMedium:a.size??null,headingSmall:n.size??null,body:s.size??null,label:l.size??null},compression:o.compression,typography:{...u,case:h(r.letterCase),weight:r.weight??null,maxPx:r.largestSize??null,weight2:a.weight??null,weight3:n.weight??null,case2:h(a.letterCase),case3:h(n.letterCase)}}}function H3(e){return e==="accent"?"var(--accent)":e==="text"?"var(--fg)":e==="labels"?"var(--fg-dim)":D3(e)===e.toLowerCase()?e:null}function $de(e){let o=[];for(let t of e){let r=t.values,a=`.${WC(t)}`,n=`[${Ha}="${t.id}"]`,s=`${a}, ${n}`,l=[],c=r.font!==void 0?Mo.find(p=>p.key===r.font)?.cssVar:void 0;if(c&&l.push(`font-family: var(${c})`),r.size!==void 0){let p=r.largestSize!==void 0?Math.min(r.size,r.largestSize):r.size;l.push(`font-size: ${p}px`)}let d=r.color!==void 0?H3(r.color):null;d&&l.push(`color: ${d}`),r.italic===!0&&l.push("font-style: italic"),r.weight!==void 0&&l.push(`font-weight: ${r.weight}`);let u=[];r.lineHeight!==void 0&&u.push(`line-height: ${r.lineHeight}`),r.letterSpacing!==void 0&&u.push(`letter-spacing: ${r.letterSpacing}em`),t.kind==="body"&&l.push(...u);let h=F3(r.letterCase);h&&t.kind==="body"&&l.push(`text-transform: ${h}`),r.paragraphSpacing&&l.push(`--sf-part-para: ${r.paragraphSpacing}px`),l.length&&o.push(`${s} { ${l.join("; ")} }`),t.kind==="heading"&&u.length&&o.push(`${s}, ${a}:is(h1, h2, h3, h4), ${n}:is(h1, h2, h3, h4) { ${u.join("; ")} }`),t.kind==="heading"&&h&&o.push(`${n}, ${a}:is(h1, h2, h3, h4) { text-transform: ${h} }`),r.paragraphSpacing&&(o.push(`*:has(> ${n}) { --sf-part-para: ${r.paragraphSpacing}px }`),o.push(...ic(`:is(${s})`,`*:has(> ${n})`))),o.push(...z3(t,s,a,n))}return o.join(`