efficient-web-builder 0.8.1 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +80 -1
- package/README.md +24 -5
- package/dist/chunks/{EditorPreviewCheckout-RALICX2M.js → EditorPreviewCheckout-YVSO4HE3.js} +3 -3
- package/dist/chunks/PreviewFooter-34YJU76X.js +1 -0
- package/dist/chunks/SectionEditorShell-CVWJ6DSU.js +1 -0
- package/dist/chunks/{SiteEditorProvider-4NZYBEVE.js → SiteEditorProvider-ECGZVKLG.js} +1 -1
- package/dist/chunks/StorefrontEditorChrome-YKEMJT3Z.js +1 -0
- package/dist/chunks/chunk-2XX3N727.js +153 -0
- package/dist/chunks/chunk-6CP4D6VJ.js +1 -0
- package/dist/chunks/chunk-7QXLVNFD.js +1 -0
- package/dist/chunks/chunk-EKKAVQJX.js +1 -0
- package/dist/chunks/chunk-FU5UZ4UY.js +1 -0
- package/dist/chunks/chunk-J5WPJJCW.js +2 -0
- package/dist/chunks/{chunk-6VNEBJKI.js → chunk-MEIUD5LJ.js} +1 -1
- package/dist/chunks/chunk-N3IM4XBG.js +1 -0
- package/dist/chunks/chunk-RRHBLOH4.js +1 -0
- package/dist/chunks/chunk-TUB4O4RZ.js +15 -0
- package/dist/chunks/chunk-UM3P3PXW.js +230 -0
- package/dist/chunks/chunk-XQGZKQII.js +1 -0
- package/dist/chunks/fitment-data-6NXSKODX.js +1 -0
- package/dist/chunks/render-client-VMLB4BTY.js +1 -0
- package/dist/editor.css +1 -1
- package/dist/index.d.ts +184 -4
- package/dist/index.js +908 -644
- package/dist/links.js +1 -1
- package/package.json +2 -2
- package/dist/chunks/PreviewFooter-SNJQZ6JZ.js +0 -1
- package/dist/chunks/SectionEditorShell-U5FUJW2M.js +0 -1
- package/dist/chunks/StorefrontEditorChrome-6OQOFCL6.js +0 -1
- package/dist/chunks/chunk-4MT74TMP.js +0 -1
- package/dist/chunks/chunk-764WH3TY.js +0 -11
- package/dist/chunks/chunk-CZ46NWN5.js +0 -230
- package/dist/chunks/chunk-DN65SLZM.js +0 -1
- package/dist/chunks/chunk-KZIT3J33.js +0 -1
- package/dist/chunks/chunk-RTCXXI5U.js +0 -143
- package/dist/chunks/chunk-TX7ND7AF.js +0 -1
- package/dist/chunks/chunk-WQ7W4AXL.js +0 -15
- package/dist/chunks/chunk-XMRSKZIR.js +0 -2
- package/dist/chunks/fitment-data-6EHBA26C.js +0 -1
- package/dist/chunks/render-client-ISZ5CGAI.js +0 -1
- /package/dist/chunks/{chunk-RTCXXI5U.js.LEGAL.txt → chunk-2XX3N727.js.LEGAL.txt} +0 -0
- /package/dist/chunks/{chunk-UBYBQ3KR.js → chunk-HVOO2GNE.js} +0 -0
- /package/dist/chunks/{chunk-WQ7W4AXL.js.LEGAL.txt → chunk-TUB4O4RZ.js.LEGAL.txt} +0 -0
package/dist/links.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var O=["width","profile","rim"];var xe=/^\s*(\d{2,3})\s*\/\s*(\d{2,3})\s*[A-Za-z]*\s*(\d{2}(?:\.\d+)?)\s*$/,we={width:[100,500],profile:[20,100],rim:[10,30]};function T(e){let n=xe.exec(e??"");if(!n)return null;let t={width:Number(n[1]),profile:Number(n[2]),rim:Number(n[3])};return O.every(o=>{let[l,u]=we[o];return t[o]>=l&&t[o]<=u})?t:null}function S(e){if(e.width==null)return"";if(e.profile==null)return String(e.width);let n=`${e.width}/${e.profile}`;return e.rim==null?n:`${n} R${e.rim}`}function z(e){return[S({width:e.width}),S({width:e.width,profile:e.profile}),S(e)]}var y=["alloy-wheel","tyre"],D=["alloy-wheel"],b={"alloy-wheel":"Alloy wheels",tyre:"Tyres"};var qe=y.map(e=>({value:e,label:b[e]}));function F(e){return e==null?[...D]:Array.isArray(e)?y.filter(n=>e.includes(n)):[...D]}var d=e=>e;function c(e){return d(e).kind==="tyre"?"tyre":"alloy-wheel"}function L(e){return d(e).brand??""}function U(e){return d(e).prices??void 0}function M(e){return d(e).inStock!==!1}function v(e){let n=d(e),t=c(e)==="tyre"?n.rimDiameters:n.sizes;return Array.isArray(t)?t.filter(r=>typeof r=="number"&&Number.isFinite(r)):[]}function _(e){return c(e)==="tyre"?[]:(d(e).finishes??[]).filter(n=>typeof n?.family=="string").map(n=>({family:n.family,color:n.color??null}))}function B(e){return _(e).map(n=>n.family)}function W(e){if(c(e)==="tyre")return[];let n=d(e),t=n.categories;return t&&t.length>0?t:n.process?[n.process]:[]}function $(e){return c(e)==="tyre"?[]:d(e).spec?.pcds??[]}function Y(e){return c(e)!=="tyre"?[]:d(e).tyreTypes??[]}function G(e){return c(e)!=="tyre"?[]:d(e).speedRatings??[]}function H(e){if(c(e)!=="tyre")return[];let n=d(e).sizes;return Array.isArray(n)?n.map(t=>T(typeof t=="string"?t:null)).filter(t=>t!==null):[]}var q="homepage";function j(e){return(e??"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}var x=[{value:"page",label:"Page"},{value:"anchor",label:"Anchor"},{value:"blog",label:"Blog post",needs:"service"},{value:"product",label:"Product",needs:"commerce"},{value:"custom",label:"Custom URL"}];function V(e){return e.offersCommerce&&e.offersService?x:x.filter(n=>!n.needs||(n.needs==="commerce"?e.offersCommerce:e.offersService))}function P(e){return e===q?"/":`/${e}`}function Z(e){return`/journal/${e}`}function X(e){return`/wheels/${e}`}function Q(e,n){return`${P(e)}#${n}`}function A(e){return j(e)}function Te(e){return typeof e=="string"?e.trim():e&&typeof e=="object"&&typeof e.text=="string"?e.text.trim():""}function J(...e){let n=new Set,t=[];for(let r of e)for(let o of r?.content??[]){let l=Te(o?.props?.anchor);if(!l)continue;let u=A(l);!u||n.has(u)||(n.add(u),t.push({slug:u,name:l}))}return t}var Fe=["http","https","mailto","tel"];function ee(e){let n=e.trim();if(!n||/\s/.test(n))return!1;let t=/^([a-z][a-z0-9+.-]*):/i.exec(n);return!t||Fe.includes(t[1].toLowerCase())}function k(e,n){return e.length===0?e:e.filter(t=>t.kind===void 0||t.kind===n)}function ne(e,n){let t=n==="filter"?"filterOrder":"cardOrder",r=new Map;for(let o of e){let l=o[t];if(typeof l!="number"||!Number.isFinite(l))continue;let u=r.get(o.fieldKey);(u===void 0||l<u)&&r.set(o.fieldKey,l)}return o=>o?r.get(o):void 0}function te(e,n,t,r){let o=new Map;for(let s of t){let i=s[r];typeof i=="number"&&o.set(s.fieldKey,i)}if(o.size===0)return e;let l=[],u=[];e.forEach((s,i)=>{let m=n(s);m&&(l.push(i),u.push({item:s,index:i,order:o.get(m)}))}),u.sort((s,i)=>s.order!==void 0&&i.order!==void 0?s.order-i.order||s.index-i.index:s.order!==void 0?-1:i.order!==void 0?1:s.index-i.index);let p=[...e];return l.forEach((s,i)=>{p[s]=u[i].item}),p.every((s,i)=>s===e[i])?e:p}function re(e){return _e(e,"filter")}var Le="collection";function I(e,n){return{tyreSizes:{},brands:{"alloy-wheel":"brand",tyre:"brand"},finishes:{"alloy-wheel":"wheel_finish_ref"},diameters:{"alloy-wheel":"diameter",tyre:"rim_diameter"},collections:{"alloy-wheel":Le},pcds:{"alloy-wheel":"pcd"},tyreTypes:{tyre:"tire_type"},speedRatings:{tyre:"speed_rating"}}[e]?.[n]}function _e(e,n){let t=new Set(e.filter(r=>r[n]===!1).map(r=>r.fieldKey));return r=>!r||!t.has(r)}function Ae(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function ie(e,n){let t=e?.[n];return Ae(t)?t:null}function oe(e,n,t,r){if(t==null&&r==null)return!0;let o=ie(e,n);return!(o===null||t!=null&&o<t||r!=null&&o>r)}var ke={recommended:"Recommended","price-asc":"Price \xB7 low to high","price-desc":"Price \xB7 high to low",new:"Newest",name:"Name A\u2013Z"},Tn=Object.keys(ke);var se=["tyreSizes","brands","finishes","diameters","collections","pcds","tyreTypes","speedRatings"],Ie={tyreSizes:["tyre"],brands:["alloy-wheel","tyre"],finishes:["alloy-wheel"],diameters:["alloy-wheel","tyre"],collections:["alloy-wheel"],pcds:["alloy-wheel"],tyreTypes:["tyre"],speedRatings:["tyre"]},Ke={diameters:"tyreSizes"};function Re(e){if(e.length===0)return[];let n=se.filter(t=>e.every(r=>Ie[t].includes(r)));return n.filter(t=>{let r=Ke[t];return!r||!n.includes(r)})}function Ee(e){let n=new Set;for(let t of e)n.add(c(t));return[...n]}var le={tyreSizes:[],brands:[],finishes:[],diameters:[],collections:[],pcds:[],tyreTypes:[],speedRatings:[],priceMax:null,inStockOnly:!1,kind:null,sort:"recommended",page:1};function Ce(e,n,t,r=null){if(r!=="kind"&&n.kind&&c(e)!==n.kind)return!1;for(let o of se){if(r===o)continue;let l=n[o];if(l.length===0)continue;let u=l.map(String);if(!ue(e,o).some(p=>u.includes(p)))return!1}return!(r!=="price"&&!oe(U(e),t,null,n.priceMax)||r!=="inStock"&&n.inStockOnly&&!M(e))}var Ne={tyreSizes:"Size",brands:"Brand",finishes:"Colour",diameters:"Size \xB7 diameter",collections:"Collection",pcds:"PCD \xB7 fitment",tyreTypes:"Tyre type",speedRatings:"Speed rating"};function ue(e,n){switch(n){case"tyreSizes":return[...new Set(H(e).flatMap(z))];case"brands":return L(e)?[L(e)]:[];case"finishes":return B(e);case"diameters":return v(e).map(String);case"collections":return W(e);case"pcds":return $(e);case"tyreTypes":return Y(e);case"speedRatings":return G(e)}}function Oe(e){let n=new Map;for(let t of e)for(let r of _(t))r.color&&!n.has(r.family)&&n.set(r.family,r.color);return n}function ae(e,n,t,r=Ee(e),o=[]){let l=i=>De(i,r,o),u=Oe(e),p=Re(r).filter(i=>i!=="tyreSizes").filter(l).map(i=>{let m=n[i].map(String),N=new Set,w=new Map,h=new Map;for(let a of e){let g=ue(a,i);for(let f of g)N.add(f);for(let f of new Set(g))h.set(f,(h.get(f)??0)+1);if(Ce(a,n,t,i))for(let f of new Set(g))w.set(f,(w.get(f)??0)+1)}let be=[...N].map(a=>({value:a,label:i==="diameters"?`${a}\u2033`:a,count:w.get(a)??0,checked:m.includes(a),swatch:i==="finishes"?u.get(a)??null:null})).sort((a,g)=>{if(i==="diameters")return Number(a.value)-Number(g.value);let f=(h.get(g.value)??0)-(h.get(a.value)??0);return f!==0?f:a.value.localeCompare(g.value)});return{key:i,label:Ne[i],options:be}}).filter(i=>i.options.length>ze),s=[];for(let i of p){let m=Ue(i.key,r,o);m!==void 0&&s.push({fieldKey:i.key,filterOrder:m})}return[...te(p,i=>i.key,s,"filterOrder")]}var ze=1;function ce(e){return e.showCollection===!1?["collections"]:[]}function De(e,n,t){return n.length===0||t.length===0?!0:n.some(r=>re(k(t,r))(I(e,r)))}function Ue(e,n,t){if(t.length===0)return;let r;for(let o of n){let l=ne(k(t,o),"filter")(I(e,o));l!==void 0&&(r===void 0||l<r)&&(r=l)}return r}var K={tyreSizes:"tyreSize",brands:"brand",finishes:"colour",diameters:"size",collections:"collection",pcds:"pcd",tyreTypes:"tyreType",speedRatings:"speed"},R="type";var pe="AlloyWheelsListing";var de="/wheels",E="Products";function Me(e,n){return n>1?`${E} \xB7 ${e}`:E}function fe(...e){for(let n of e){let t=(n?.content??[]).find(r=>r?.type===pe);if(t)return t.props??{}}return null}function me(...e){return fe(...e)!==null}function ve(e,n){let t=e.filter(r=>me(...r.docs)).map(r=>P(r.slug));return t.length===0&&n.fallback?[de]:t}var C=[R,...Object.entries(K).filter(([e])=>e!=="tyreSizes").map(([,e])=>e)];function ge(e){let n=e.indexOf("#"),t=n===-1?"":e.slice(n),r=n===-1?e:e.slice(0,n),o=r.indexOf("?");return{path:o===-1?r:r.slice(0,o),query:o===-1?"":r.slice(o+1),hash:t}}function Be(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return e}}function We(e){let n=new URLSearchParams(ge(e).query);for(let t of C){let r=n.get(t);if(r)return{param:t,value:r}}return null}function ye(e,n){let{path:t,query:r,hash:o}=ge(e),l=r.split("&").filter(u=>u&&!C.includes(Be(u.split("=")[0])));return n?.value&&l.push(`${encodeURIComponent(n.param)}=${encodeURIComponent(n.value)}`),`${t}${l.length?`?${l.join("&")}`:""}${o}`}function Pe(e,n){let t=ye(e,null);return n.includes(t)?t:e}function $e(e,n,t=[]){if(!e)return"page";if(e.startsWith("/journal/"))return"blog";if(e.startsWith("/wheels/"))return"product";if(e.includes("#")){let r=e.slice(0,e.indexOf("#"));if(r===""||r==="/"||n.includes(r))return"anchor"}return e==="/"||n.includes(e)||t.includes(Pe(e,t))?"page":"custom"}var he="Product type",Ye="AUD";function Se(e,n){let t=n.listing??{},r=F(t.kinds),o=e.filter(s=>r.includes(c(s))),l=ce(t),u=ae(o,le,Ye,r,n.fieldUsage).filter(s=>!l.includes(s.key)).map(s=>({param:K[s.key],label:s.label,values:s.options.filter(i=>!i.value.includes(",")).map(i=>({value:i.value,label:i.label}))})).filter(s=>s.values.length>0),p=y.filter(s=>r.includes(s)&&o.some(i=>c(i)===s));return p.length>1&&u.unshift({param:R,label:he,values:p.map(s=>({value:s,label:b[s]}))}),u}function Dn(e,n){return Se(e,n)}export{de as BUILT_IN_LISTING_PATH,x as LINK_KINDS,C as LISTING_FILTER_PARAMS,E as LISTING_PAGE_LABEL,he as PRODUCT_TYPE_FILTER_LABEL,Q as anchorPath,$e as inferLinkKind,me as isProductListingPage,ee as isSafeLink,V as linkKindsFor,Dn as listingFilterFields,fe as listingNode,Me as listingPageLabel,Pe as listingTarget,J as pageAnchors,P as pagePath,Z as postPath,ve as productListingPaths,We as readListingFilter,A as slugifyAnchor,X as wheelPath,ye as withListingFilter};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "efficient-web-builder",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "The EFFICIENT website builder — the website editor and its sections — for an app that edits a website inside its own page. Built from the efficient-storefront repository's own source.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"author": "Efficient Pty Ltd",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"LICENSE"
|
|
49
49
|
],
|
|
50
50
|
"peerDependencies": {
|
|
51
|
-
"efficient-easel": "^0.
|
|
51
|
+
"efficient-easel": "^0.100.0",
|
|
52
52
|
"efficient-shell": "^4.131.0",
|
|
53
53
|
"react": ">=19",
|
|
54
54
|
"react-dom": ">=19"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";import{r as m}from"./chunk-RTCXXI5U.js";import{J as g}from"./chunk-XMRSKZIR.js";import"./chunk-6VNEBJKI.js";import{_ as s,ef as a}from"./chunk-WQ7W4AXL.js";import"./chunk-DN65SLZM.js";import{Ac as u,dd as d,id as f,ud as c}from"./chunk-764WH3TY.js";import"./chunk-4MT74TMP.js";import"./chunk-UBYBQ3KR.js";import"./chunk-Y6SLVHK3.js";import{Render as I}from"efficient-easel/render";import{jsx as p}from"react/jsx-runtime";function i({footerBlock:r,rootProps:e,headerSettings:o,siteName:t,legalName:l,foundedYear:n,socialLinks:h}){let v=a({root:{props:{...e??{},kind:s}},content:[r],zones:{}});return p(d.Provider,{value:{logoUrl:o?.logoUrl??null,logoReversed:o?.logoReversed??null,logoInkIsDark:o?.logoInkIsDark??null,siteName:t,legalName:l??null,foundedYear:n??null,socialLinks:h??f},children:p(I,{config:m,data:v})})}import{jsx as k}from"react/jsx-runtime";function P(){let{footerBlock:r,editFooter:e}=g(),{settings:o,websiteName:t}=c();if(!r)return null;let l=o?{logoUrl:o.logoUrl,logoReversed:o.logoReversed??null,logoInkIsDark:o.logoInkIsDark??null}:null;return k("div",{className:"sf-preview-footer-pick",onClick:e?n=>{n.stopPropagation(),e()}:void 0,style:e?{cursor:"pointer"}:void 0,title:e?"Edit the site footer \u2192":void 0,children:k(i,{footerBlock:r,headerSettings:l,siteName:t?.trim()||u})})}export{P as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";import{A as Ae,B as Re,D as Me,E as xe,e as v,f as _,n as Ee,p as Ce,t as he,v as f,w as E,x as Ie}from"./chunk-CZ46NWN5.js";import"./chunk-KZIT3J33.js";import{a as Te}from"./chunk-6VNEBJKI.js";import{Ci as ve,Fj as w,Qa as fe,_e as ge,af as ye,bf as ke,ck as be,ek as Pe,gf as Se,j as ue,mk as we,yi as P}from"./chunk-WQ7W4AXL.js";import{la as ae,pa as de,ra as pe,sa as me}from"./chunk-764WH3TY.js";import"./chunk-4MT74TMP.js";import"./chunk-UBYBQ3KR.js";import"./chunk-Y6SLVHK3.js";import{Fragment as Ne,useCallback as je,useEffect as x,useRef as Le,useState as Oe}from"react";import{SaveState as Ze}from"efficient-easel/chrome";import{parseZoneKey as N,zoneKey as et}from"efficient-easel/data";import{useTreeDrag as tt}from"efficient-easel/drag";import{TrashIcon as $e}from"efficient-easel/icons";import{LayersTree as ot,Subtree as Be,TreeRow as L,TreeRowAction as ze,TreeSeam as nt}from"efficient-easel/tree";import{saveIndicator as rt}from"efficient-easel/autosave";import{useEasel as st}from"efficient-easel/easel";import{Fragment as De,jsx as n,jsxs as k}from"react/jsx-runtime";var O=$=>C=>{C.target.closest(".es-tree-select, button")||$()};function it(){let{saveState:$,readOnly:C}=Se(),i=ue(),{appState:Fe,selectedItem:b,config:B}=st(e=>e),[T,c]=Oe(f),[K,W]=Oe(null),r=Fe.data.content?.[0]??null,g=r?.props.id??null,S=r?.type===pe,He=r?.type===me,U=Le(null),z=Le(null);Me(z);let Y=ge(),h=ke();x(()=>{let e=z.current;if(!h||!e)return;let t=o=>{o.key==="Escape"&&ye()};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)},[h]),x(()=>{if(g&&U.current!==g){if(U.current=g,S){c(E);return}b||i.select({index:0})}},[g,b,i,S]);let{setSelectedHeroId:q,setSelectHandler:V}=Pe(),D=T.kind==="ticker"?T.heroId:null,I=je(e=>{e&&(c(t=>t.kind==="ticker"&&t.heroId===e?t:{kind:"ticker",heroId:e}),v(e))},[]);x(()=>{q(D)},[D,q]),x(()=>{V(I)},[V,I]);let{selectNode:_e}=Re({mode:T,setMode:c,onOpenPart:v}),F=e=>B.components[e]?.label??e,G=e=>fe(e,"section",F(e)),Ke=()=>{if(S){c(E);return}c(f),i.select({index:0})},J=!S&&T.kind==="puck"&&b?.props.id===g,a=r?w(r.type)?.spec??null:null,d=r&&a?`${r.props.id}:${a.slot}`:null,Q=r&&a&&Array.isArray(r.props[a.slot])?r.props[a.slot]:[],H=e=>we(e,F),X=(e,t)=>{!r||!a||!d||(c(f),a.slider?(_(String(r.props.id),e),i.select({index:e,zone:d}),v(String(r.props.id))):(i.select({index:e,zone:d}),v(t)))},j=()=>{if(!r||!a||!d)return;let e=Q.length;i.insertComponent(d,a.childType,e),c(f),a.slider?requestAnimationFrame(()=>{_(String(r.props.id),e),i.select({index:e,zone:d})}):i.select({index:e,zone:d})},We=e=>{d&&(i.removeComponent(d,e),c(f),i.select(null))},Z=e=>ae(B,e),ee=e=>{let{parentId:t,slot:o}=N(e),s=m=>{if(!m)return null;if(String(m.props.id)===t)return m;for(let p of Z(m.type)){let u=Array.isArray(m.props[p])?m.props[p]:[];for(let y of u){let M=s(y);if(M)return M}}return null},l=s(r)?.props[o];return Array.isArray(l)?l.length:0},te=(e,t,o)=>{let s=Math.min(Math.max(o,0),ee(e)),l=t<s?s-1:s;l!==t&&(i.reorderComponent(e,t,l),c(f),i.select({index:l,zone:e}))},A=tt({keyOf:e=>e.id,readOnly:!!C,canDrop:(e,t)=>et(t)===e.zone&&t.index>=0&&t.index<=ee(e.zone),onDrop:(e,t)=>te(e.zone,e.index,t.index),onStep:(e,t)=>te(e.zone,e.index,t<0?e.index-1:e.index+2)}),R=(e,t)=>n(nt,{...C?{}:A.seam({place:{...N(e),index:t}})},`seam:${e}:${t}`),Ue=e=>Z(e.type).flatMap(t=>(Array.isArray(e.props[t])?e.props[t]:[]).map((s,l)=>({child:s,zone:`${e.props.id}:${t}`,index:l}))),oe=e=>{let t=e.props;if(e.type==="FooterMenu"){let o=t.menu;return t.heading||o?.name||"Menu"}if(e.type==="FooterText"){let o=typeof t.text=="string"?t.text.trim():"";return o?o.length>28?`${o.slice(0,28)}\u2026`:o:"Text"}return e.type==="FooterEmailSignup"?t.heading||"Email signup":F(e.type)},ne=(e,t,o)=>{c(f),i.select({index:t,zone:e}),v(o)},re=(e,t,o)=>{i.insertComponent(e,t,o),c(f),i.select({index:o,zone:e}),W(null)},Ye=(e,t)=>{i.removeComponent(e,t),c(f),i.select(null)},qe=(e,t,o)=>n(Te,{choices:o,open:K===e,onToggle:()=>W(K===e?null:e),onPick:s=>re(e,s,t)}),se=(e,t)=>{let o=Ue(e),s=w(e.type),l=s?.choices??null,m=s?.source==="footer"?oe:H;return k(De,{children:[o.map(({child:p,zone:u,index:y})=>{let M=b?.props.id===p.props.id,Je=de(B,p.type,t),ie=m(p),le=String(p.props.id),ce=()=>ne(u,y,le),{rowProps:Qe,...Xe}=A.row({item:{id:le,zone:u,index:y},place:{...N(u),index:y}},{onClick:O(ce)});return k(Ne,{children:[y===0&&R(u,0),n(L,{icon:n(P,{type:p.type,size:13}),name:ie,selected:M,onSelect:ce,...Xe,actions:n(ze,{kind:"delete",label:`Delete ${ie}`,onClick:()=>Ye(u,y),children:n($e,{size:13})}),rowProps:Qe}),Je&&n(Be,{children:se(p,t+1)}),R(u,y+1)]},String(p.props.id??`${u}-${y}`))}),s&&l?qe(`${e.props.id}:${s.slot}`,o.length,l):null]})},Ve=r?.type==="HeroSingle",Ge=!!r&&(!!a||He||S||Ve);return k("div",{ref:z,className:"sf-editor es-editor",style:he(Ce),children:[n("div",{className:"sf-section-bar",children:n(Ze,{...rt($),role:"status"})}),k("div",{className:"sf-body",children:[h&&Y?n("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left",children:n(Ee,{panel:Y,pick:h})}):Ge&&r&&k("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left",children:[n("div",{className:"sf-panel-head",children:n("button",{type:"button",className:`sf-panel-title sf-panel-title--btn ${J?"is-selected":""}`,"aria-pressed":J,title:S?"Header settings":`${G(r.type)} settings`,onClick:Ke,children:G(r.type)})}),n(ot,{className:"sf-tree sf-scroll",rootProps:A.rootProps(),children:n(Be,{children:S?n(L,{icon:n(P,{type:"header",size:13}),name:"Header settings",selected:T.kind==="header",onSelect:()=>c(E),rowProps:{onClick:O(()=>c(E))}}):a?k(De,{children:[Q.map((e,t)=>{let o=b?.props.id===e.props.id,s=H(e),l=String(e.props.id),m=()=>X(t,l),{rowProps:p,...u}=A.row({item:{id:l,zone:d,index:t},place:{...N(d),index:t}},{onClick:O(m)});return k(Ne,{children:[t===0&&R(d,0),n(L,{icon:n(P,{type:e.type,size:13}),name:s,selected:o,onSelect:m,...u,actions:n(ze,{kind:"delete",label:`Delete ${s}`,onClick:()=>We(t),children:n($e,{size:13})}),rowProps:p}),R(d,t+1)]},String(e.props.id??t))}),k("button",{type:"button",className:"sf-add-card",onClick:j,children:[n("span",{className:"sf-plus sf-plus--sm",children:"+"}),a.addLabel]}),r.type==="Hero"&&g&&n(L,{icon:n(P,{type:"ticker",size:13}),name:be,selected:D===g,onSelect:()=>I(g),rowProps:{onClick:O(()=>I(g))}})]}):se(r,1)})})]}),n("div",{className:"sf-center",children:n("div",{className:"sf-preview-host",children:n(xe,{})})}),n(ve,{value:{selectChild:(e,t,o,s)=>w(s)?.source==="section"?X(t,o):ne(e,t,o),addChild:(e,t,o,s,l)=>w(l)?.source==="section"?j():re(`${e}:${t}`,o,s),childRowName:H,blockRowName:oe},children:n(Ae,{mode:T,onOpenWebsiteSettings:()=>c(Ie),onSelectNode:_e,hideNodeActions:!0})})]})]})}export{it as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";import{A as ea,B as ta,C as na,D as oa,E as ia,a as bt,b as Ko,c as _r,d as jr,e as Vt,f as Uo,g as Un,h as Yn,i as Vr,j as Gr,k as Kr,l as Xn,m as Ur,n as Yo,o as Xo,p as vt,q as Zo,r as Jo,s as Qo,t as Yr,u as Xr,v as Le,w as Jn,x as Zr,y as Jr,z as Qr}from"./chunk-CZ46NWN5.js";import{a as Wr,b as qr}from"./chunk-TX7ND7AF.js";import{g as Zn}from"./chunk-KZIT3J33.js";import{A as Tr,B as Ir,C as Pr,D as Rr,F as Nr,G as Lr,H as Dr,J as Hr,K as $r,M as Fr,a as Et,b as jt,c as pr,i as fr,j as gr,l as yr,m as kr,o as Ke,p as wr,t as _o,u as Cr,w as qo,x as jo,y as Vo,z as Go}from"./chunk-XMRSKZIR.js";import{$g as ar,$h as cr,Ai as mr,Aj as xr,Ba as Ws,Bi as Fo,Ca as _s,Ci as hr,Da as un,Dj as Sr,Ea as qs,Eh as Gn,Ei as br,Ej as Wo,Fa as js,Fi as vr,Fj as Pe,H as dn,J as Hs,K as cn,Na as Vs,Qa as Wt,Qf as ir,Rf as sr,Sh as gn,Ta as Gs,Te as Zs,Va as Ks,Vh as dr,Wa as Us,Wh as mn,Ya as Ys,Yh as yn,Z as pn,Zh as Ho,_e as Js,a as qn,af as fn,bf as Qs,cf as er,ck as Er,d as Ls,e as Ds,ek as Ar,ga as Fs,gf as qt,he as Xs,j as Ms,jf as nr,kk as zr,mk as Or,nk as Br,of as or,ok as Mr,pf as Mo,qh as lr,qj as Kn,xi as ur,yi as be,zg as rr,zi as $o}from"./chunk-WQ7W4AXL.js";import{Oc as We,la as jn,ma as Oo,oa as zs,pa as Os,qa as Ft,ra as Fe,sa as oe,ta as P,ud as tr,va as Bo,wa as Bs}from"./chunk-764WH3TY.js";import{C as $s,T as Vn}from"./chunk-4MT74TMP.js";import{b as _t}from"./chunk-UBYBQ3KR.js";import"./chunk-Y6SLVHK3.js";import{Fragment as Ut,useCallback as De,useEffect as $,useLayoutEffect as hc,useMemo as yi,useRef as de,useState as ce}from"react";import{PagesIcon as bc,LayersIcon as Ja,StylesIcon as vc,MediaIcon as Qa,SitemapIcon as xc}from"efficient-easel/rail";import{LayersTree as Sc,Subtree as at,TreeGroupLabel as io,TreeRow as we,TreeRowAction as so,TreeSeam as hi}from"efficient-easel/tree";import{DeviceSwitch as kc,EaselIconButton as el,EaselTopBar as wc,InspectorIconButton as Cc,PanelResizeHandle as tl,SaveState as nl,SaveStateToggle as Tc,TopBarCluster as ol,TopBarDivider as Ic,TopBarRail as Pc}from"efficient-easel/chrome";import{ExternalIcon as Rc,ImageIcon as Ec,RedoIcon as Ac,TextLinesIcon as Nc,TrashIcon as bi,UndoIcon as Lc}from"efficient-easel/icons";import{saveIndicator as Dc}from"efficient-easel/autosave";import{EditNotice as Kl}from"efficient-easel/chrome";import{jsx as Ul}from"react/jsx-runtime";function ei(){let{capabilities:n,access:s,takeOverEditing:a,viewReadOnly:m,saveConflict:u,reloadFromServer:f}=qt();return n.hasEditGuard?Ul(Kl,{access:s,conflict:u,noun:"page",onTakeOver:a,onViewReadOnly:m,onReload:f}):null}import{DesktopIcon as Yl,PhoneIcon as Xl,TabletIcon as Zl}from"efficient-easel/icons";import{jsx as ti}from"react/jsx-runtime";var Jl={desktop:ti(Yl,{}),tablet:ti(Zl,{}),mobile:ti(Xl,{})},sa=ir.map(n=>({id:n,label:sr[n],icon:Jl[n]}));import{useEffect as nd,useMemo as ya,useState as od}from"react";import{useEasel as id}from"efficient-easel/easel";import{AddPanel as sd}from"efficient-easel/drag";import{AddIcon as rd}from"efficient-easel/icons";import{Fragment as ca,jsx as t,jsxs as d}from"react/jsx-runtime";var re={dark:"var(--sf-thumb-bar-dark)",soft:"var(--sf-thumb-bar-light)",accent:"var(--sf-thumb-accent)",tint:"var(--sf-thumb-accent-tint)",block:"var(--sf-thumb-block)",line:"var(--sf-thumb-border)",card:"var(--sf-thumb-card)"},ni="repeating-linear-gradient(135deg,var(--sf-thumb-hatch1) 0,var(--sf-thumb-hatch1) 5px,var(--sf-thumb-hatch2) 5px,var(--sf-thumb-hatch2) 10px)";function S({w:n,h:s,tone:a="dark",r:m=2,style:u}){return t("div",{style:{width:n,height:s,borderRadius:m,background:re[a],flex:"none",...u}})}var Ql={Hero:"hero",HeroSingle:"herosingle",IntroBleed:"intro",Collections:"collections",AlloyWheelsListing:"wheelslisting",CatalogFilterBar:"catalogfilterbar",ProductGrid:"productgrid",BrandStrip:"brandstrip",FitmentFinder:"fitmentfinder",Gallery:"gallery",GalleryB:"gallerygrid",SpecStrip:"specstrip",ProductHero:"producthero",SpecTable:"spectable",ProcessSteps:"processsteps",DetailRows:"detailrows",FitmentTable:"fitmenttable",CompatibleTyres:"compatibletyres",TyreSizes:"tyresizes",TyreFitment:"tyrefitment",EuTyreLabel:"eutyrelabel",RelatedProducts:"productgrid",BundleOffer:"bundleoffer",OrderSummary:"ordersummary",DeliveryOptions:"deliveryoptions",PaymentBadges:"paymentbadges",CheckoutCTA:"checkoutcta",Manifesto:"manifesto",ParagraphsA:"paragraphs",Prose:"prose",StatsParagraph:"statsparagraph",Chart:"chart",Mockup:"mockup",Footprint:"footprint",Timeline:"timeline",TimelineTrack:"timelinetrack",TitleWithButtons:"titlewithbuttons",Split:"split",Cards:"cards",FAQ:"faq",Testimonials:"testimonials",Masthead:"masthead",Breadcrumb:"breadcrumb",CategoryBar:"categorybar",FeaturedCover:"featuredcover",LongRead:"longread",Series:"series",Subscribe:"subscribe",SubscribeBlogs:"subscribe",Events:"events",DocMasthead:"docmasthead",DocTabs:"doctabs",DocBody:"docbody",DocMetaCards:"docmetacards",Banner:"banner",Stats:"stats",KeyFeatures:"keyfeatures",Logos:"logos",Ticker:"ticker",Reviews:"reviews",SubmitBuild:"submitbuild",ReviewForm:"reviewform",Form:"form",AppointmentBooking:"appointmentbooking",ContactRouting:"contact",ContactLocations:"contactlocations",Header:"header",Footer:"footer",SectionHeader:"sectionheader",Grid:"grid",Flex:"blanksection",Spacer:"spacer",Divider:"divider",CustomHTML:"customhtml",Heading:"heading",Text:"text",ImageBlock:"image",ButtonBlock:"button",MenuBlock:"menu",EmailFormBlock:"emailform",SocialLogosBlock:"sociallogos",LegalLineBlock:"legalline",SearchBlock:"search",CartBlock:"cart",CountrySwitchBlock:"countryswitch"},I={position:"absolute",inset:0},i={ink:"var(--sf-thumb-ink)",ink2:"var(--sf-thumb-ink-2)",inkSoft:"var(--sf-thumb-ink-soft)",inkSoft2:"var(--sf-thumb-ink-soft-2)",paper:"var(--sf-thumb-paper)",paper2:"var(--sf-thumb-paper-2)",warm:"var(--sf-thumb-warm)",rust:"var(--sf-thumb-rust)",onInk:"var(--sf-thumb-on-ink)",text:"var(--sf-thumb-scene-text)",muted:"var(--sf-thumb-scene-muted)",rule:"var(--sf-thumb-scene-rule)",mark1:"var(--sf-thumb-mark-1)",mark2:"var(--sf-thumb-mark-2)",card:"var(--sf-thumb-card)",scrim:"var(--sf-thumb-scrim)"},X=(n,s,a=160)=>({background:`linear-gradient(${a}deg,${n},${s})`});function rt({size:n,style:s}){let a=Math.max(2,Math.round(n*.13)),m=(u,f,b)=>({position:"absolute",inset:u,background:f,borderRadius:a,...b?{mixBlendMode:b}:null});return d("span",{style:{position:"absolute",display:"block",width:n,height:n,...s},children:[t("span",{style:m("8% 26% 30% 6%",i.mark1)}),t("span",{style:m("26% 6% 8% 30%",i.mark2,"multiply")})]})}function bn({children:n}){return t("span",{style:{fontSize:"4.64cqw",fontWeight:700,letterSpacing:"0.06em",textTransform:"uppercase",color:i.muted},children:n})}function ra({over:n,overTone:s,head:a,headSize:m=11.5,cta:u,ctaBg:f,ctaFg:b,tone:R}){return d(ca,{children:[n&&t("span",{style:{fontSize:"3.65cqw",letterSpacing:"0.16em",fontWeight:700,color:s},children:n}),t("span",{style:{fontSize:m,lineHeight:1.15,fontWeight:700,maxWidth:"78%",color:R},children:a}),u&&t("span",{style:{alignSelf:"flex-start",fontSize:"3.65cqw",letterSpacing:"0.12em",fontWeight:700,padding:"4px 8px",borderRadius:2,marginTop:2,background:f,color:b},children:u})]})}function oi({name:n,price:s}){return d("div",{style:{display:"flex",flexDirection:"column",gap:2,minWidth:0},children:[t("div",{style:{flex:1,minHeight:0,borderRadius:3,position:"relative",overflow:"hidden",...X(i.paper,i.paper2,150)},children:t(rt,{size:34,style:{left:"50%",top:"50%",transform:"translate(-50%,-50%)"}})}),t("span",{style:{fontSize:"3.65cqw",fontWeight:600,color:i.text},children:n}),t("span",{style:{fontSize:"3.65cqw",color:i.muted},children:s})]})}function st({k:n,v:s,ok:a}){return d("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:6,padding:"3.5px 2px",borderBottom:`1px solid ${i.rule}`,fontSize:"3.98cqw",color:i.muted},children:[t("span",{children:n}),d("span",{style:{display:"flex",gap:6,alignItems:"center"},children:[t("b",{style:{color:i.text,fontWeight:700},children:s}),a&&t("span",{style:{color:i.rust,fontWeight:700},children:"\u2713"})]})]})}function q({title:n,children:s}){return d("div",{style:{...I,background:i.card,padding:"9px 10px",display:"flex",flexDirection:"column",gap:6},children:[t(bn,{children:n}),s]})}function aa({size:n=14}){return t("span",{style:{width:n,height:n,borderRadius:"50%",flex:"none",display:"block",background:`linear-gradient(150deg,${i.mark1},${i.mark2})`}})}function ii({filled:n=5,size:s=6}){return d("span",{style:{fontSize:s,letterSpacing:"0.06em",color:i.rust,lineHeight:1},children:["\u2605".repeat(n),t("span",{style:{color:i.mark1},children:"\u2605".repeat(5-n)})]})}function hn({n,label:s,tone:a=i.text}){return d("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:1,minWidth:0},children:[t("b",{style:{fontSize:"8.16cqw",lineHeight:1,color:a},children:n}),t("span",{style:{fontSize:"3.65cqw",letterSpacing:"0.08em",textTransform:"uppercase",opacity:.62,color:a},children:s})]})}function ge({children:n,w:s}){return t("span",{style:{fontSize:"3.98cqw",lineHeight:1.45,color:i.muted,width:s,display:"block"},children:n})}function Qn({label:n,w:s="100%",filled:a}){return d("div",{style:{width:s,display:"flex",flexDirection:"column",gap:2},children:[t("span",{style:{fontSize:"3.32cqw",letterSpacing:"0.08em",textTransform:"uppercase",color:i.muted},children:n}),t("span",{style:{height:9,borderRadius:3,border:`1px solid ${i.rule}`,background:a?i.paper:i.card}})]})}function la({children:n}){return t("span",{style:{alignSelf:"flex-start",fontSize:"3.65cqw",letterSpacing:"0.12em",fontWeight:700,padding:"5px 9px",borderRadius:2,background:i.text,color:i.onInk},children:n})}var ed={wheelslisting:t(q,{title:"All wheels",children:t("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:4,justifyContent:"center"},children:[["Ridge 19","20\xD79 +12","$365"],["Ridge 29","18\xD79 +20","$410"],["Ridge 39","17\xD78 \u221210","$455"]].map(([n,s,a])=>d("div",{style:{display:"flex",alignItems:"center",gap:6},children:[t("span",{style:{width:20,height:15,borderRadius:3,flex:"none",position:"relative",overflow:"hidden",...X(i.paper,i.paper2,150)},children:t(rt,{size:12,style:{left:"50%",top:"50%",transform:"translate(-50%,-50%)"}})}),t("b",{style:{flex:1,fontSize:"4.31cqw",color:i.text},children:n}),t("span",{style:{fontSize:"3.65cqw",color:i.muted},children:s}),t("b",{style:{fontSize:"4.31cqw",color:i.text,width:26,textAlign:"right"},children:a})]},n))})}),catalogfilterbar:d("div",{style:{...I,background:i.card,display:"flex",flexDirection:"column",justifyContent:"center",gap:7,padding:"0 11px"},children:[d("div",{style:{display:"flex",gap:4,alignItems:"center"},children:[["20 inch","6\xD7139.7","Black"].map(n=>d("span",{style:{fontSize:"3.65cqw",fontWeight:600,padding:"4px 7px",borderRadius:99,background:i.text,color:i.onInk,display:"flex",gap:4,alignItems:"center"},children:[n,t("span",{style:{opacity:.6},children:"\u2715"})]},n)),t("span",{style:{fontSize:"3.65cqw",color:i.rust,fontWeight:700},children:"Clear"})]}),d("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[t("span",{style:{fontSize:"3.65cqw",color:i.muted},children:"128 results"}),t("span",{style:{fontSize:"3.65cqw",color:i.muted,border:`1px solid ${i.rule}`,borderRadius:3,padding:"3px 6px"},children:"Sort: Price \u25BE"})]})]}),fitmentfinder:d("div",{style:{...I,padding:"10px 12px",display:"flex",flexDirection:"column",gap:6,justifyContent:"center",...X(i.ink,i.inkSoft)},children:[t("span",{style:{fontSize:"5.31cqw",fontWeight:700,color:i.onInk},children:"Will it fit your rig?"}),d("div",{style:{display:"flex",gap:4},children:[["2021","Toyota","Hilux"].map(n=>d("span",{style:{flex:1,fontSize:"3.65cqw",color:i.text,background:i.card,borderRadius:3,padding:"5px 6px",display:"flex",justifyContent:"space-between"},children:[n," ",t("span",{style:{color:i.muted},children:"\u25BE"})]},n)),t("span",{style:{fontSize:"3.65cqw",fontWeight:700,letterSpacing:"0.08em",background:i.warm,color:i.ink,borderRadius:3,padding:"5px 7px"},children:"GO"})]})]}),compatibletyres:t(q,{title:"Tyres that suit",children:t("div",{style:{flex:1,display:"grid",gridTemplateColumns:"repeat(3,1fr)",gap:5,minHeight:0},children:[["Ridge Grappler","$489"],["Trail Grappler","$525"],["Terra Grappler","$438"]].map(([n,s])=>d("div",{style:{display:"flex",flexDirection:"column",gap:2,minWidth:0},children:[t("div",{style:{flex:1,minHeight:0,borderRadius:3,position:"relative",overflow:"hidden",background:i.ink},children:t("span",{style:{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%,-50%)",width:26,height:26,borderRadius:"50%",border:`5px solid ${i.mark2}`,boxSizing:"border-box"}})}),t("span",{style:{fontSize:"3.32cqw",fontWeight:600,color:i.text,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:n}),t("span",{style:{fontSize:"3.32cqw",color:i.muted},children:s})]},n))})}),tyresizes:t(q,{title:"Available sizes",children:t("div",{style:{flex:1,display:"flex",flexWrap:"wrap",gap:4,alignContent:"center"},children:["265/65R17","285/70R17","265/60R18","275/55R20"].map((n,s)=>t("span",{style:{fontSize:"3.65cqw",fontWeight:600,padding:"5px 7px",borderRadius:3,border:`1px solid ${s===0?i.rust:i.rule}`,color:s===0?i.rust:i.text,background:s===0?i.paper:i.card},children:n},n))})}),tyrefitment:d(q,{title:"Will it fit your car?",children:[t("div",{style:{display:"flex",gap:3},children:["Make","Model","Year","Trim"].map(n=>d("span",{style:{flex:1,minWidth:0,fontSize:"3.32cqw",color:i.muted,background:i.paper,border:`1px solid ${i.rule}`,borderRadius:3,padding:"4px 5px",display:"flex",justifyContent:"space-between",gap:2,overflow:"hidden",whiteSpace:"nowrap"},children:[n," ",t("span",{style:{color:i.muted},children:"\u25BE"})]},n))}),t("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:2,justifyContent:"center",minHeight:0},children:[["265/65R17","Fits",!0],["285/70R17","Not your size",!1]].map(([n,s,a])=>d("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:6,borderTop:`1px solid ${i.rule}`,paddingTop:3},children:[t("span",{style:{fontSize:"3.32cqw",fontWeight:600,color:i.text},children:n}),t("span",{style:{fontSize:"3.32cqw",fontWeight:a?700:400,letterSpacing:"0.06em",color:a?i.warm:i.muted},children:s})]},n))})]}),eutyrelabel:d("div",{style:{...I,background:i.card,padding:"9px 11px",display:"flex",gap:8,alignItems:"center"},children:[t("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:1.5},children:[["A","42%"],["B","56%"],["C","70%"],["D","84%"]].map(([n,s],a)=>d("div",{style:{display:"flex",alignItems:"center",gap:3},children:[t("span",{style:{width:s,height:6,borderRadius:"0 2px 2px 0",background:a===1?i.rust:i.mark1}}),t("span",{style:{fontSize:"3.32cqw",fontWeight:700,color:a===1?i.rust:i.muted},children:n})]},n))}),d("div",{style:{flex:"none",display:"flex",flexDirection:"column",gap:3,alignItems:"center"},children:[t("b",{style:{fontSize:"6.63cqw",lineHeight:1,color:i.text},children:"72"}),t("span",{style:{fontSize:"3.32cqw",letterSpacing:"0.08em",color:i.muted},children:"dB"})]})]}),bundleoffer:d("div",{style:{...I,background:i.paper,padding:"9px 11px",display:"flex",flexDirection:"column",gap:5,justifyContent:"center"},children:[t(bn,{children:"Buy it with"}),d("div",{style:{display:"flex",alignItems:"center",gap:5},children:[[0,1].map(n=>t("span",{style:{width:26,height:22,borderRadius:3,flex:"none",position:"relative",overflow:"hidden",background:i.card},children:t(rt,{size:17,style:{left:"50%",top:"50%",transform:"translate(-50%,-50%)"}})},n)),t("span",{style:{fontSize:"5.69cqw",fontWeight:700,color:i.muted},children:"+"}),d("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:1},children:[t("span",{style:{fontSize:"3.65cqw",color:i.muted,textDecoration:"line-through"},children:"$1,024"}),t("b",{style:{fontSize:"6.02cqw",color:i.rust,lineHeight:1},children:"$899"})]})]})]}),checkoutcta:d("div",{style:{...I,display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 13px",gap:8,...X(i.ink,i.ink2)},children:[d("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[t("span",{style:{fontSize:"3.65cqw",letterSpacing:"0.12em",color:i.warm,fontWeight:700},children:"READY TO ORDER"}),t("b",{style:{fontSize:"6.63cqw",color:i.onInk,lineHeight:1},children:"$1,956"}),t("span",{style:{fontSize:"3.65cqw",color:i.onInk,opacity:.65},children:"4 items \xB7 fitted free"})]}),t("span",{style:{fontSize:"3.65cqw",letterSpacing:"0.12em",fontWeight:700,padding:"6px 10px",borderRadius:2,background:i.warm,color:i.ink,flex:"none"},children:"CHECKOUT"})]}),contact:t(q,{title:"Who do you need?",children:t("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:4,justifyContent:"center"},children:[["Fitment help","the workshop"],["Order status","the front desk"],["Trade accounts","sales"]].map(([n,s])=>d("div",{style:{display:"flex",alignItems:"center",gap:5},children:[t("b",{style:{flex:1,fontSize:"4.31cqw",color:i.text},children:n}),t("span",{style:{fontSize:"3.65cqw",color:i.muted},children:s}),t("span",{style:{fontSize:"4.64cqw",color:i.rust,lineHeight:1},children:"\u203A"})]},n))})}),contactlocations:t(q,{title:"Find us",children:t("div",{style:{flex:1,display:"grid",gridTemplateColumns:"repeat(2,1fr)",gap:5,minHeight:0},children:[["Brisbane","7 Kerry Rd","Mon\u2013Sat"],["Townsville","12 Enterprise","Mon\u2013Fri"]].map(([n,s,a])=>d("div",{style:{border:`1px solid ${i.rule}`,borderRadius:4,padding:"5px 6px",display:"flex",flexDirection:"column",gap:1},children:[t("b",{style:{fontSize:"4.31cqw",color:i.text},children:n}),t("span",{style:{fontSize:"3.32cqw",color:i.muted},children:s}),t("span",{style:{fontSize:"3.32cqw",color:i.rust,fontWeight:700},children:a})]},n))})}),form:t(q,{title:"Send us a message",children:d("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:4,justifyContent:"center"},children:[d("div",{style:{display:"flex",gap:5},children:[t(Qn,{label:"Name"}),t(Qn,{label:"Email"})]}),t(Qn,{label:"Message",filled:!0}),t(la,{children:"SEND"})]})}),appointmentbooking:t(q,{title:"Book a fitting",children:d("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:4,justifyContent:"center"},children:[t("div",{style:{display:"flex",gap:3},children:["Mon","Tue","Wed","Thu"].map((n,s)=>t("span",{style:{flex:1,textAlign:"center",fontSize:"3.32cqw",fontWeight:s===2?700:500,padding:"4px 0",borderRadius:3,background:s===2?i.text:i.paper,color:s===2?i.onInk:i.muted},children:n},n))}),t("div",{style:{display:"flex",gap:3},children:["8:00","10:30","13:00","15:30"].map((n,s)=>t("span",{style:{flex:1,textAlign:"center",fontSize:"3.32cqw",padding:"4px 0",borderRadius:3,border:`1px solid ${s===1?i.rust:i.rule}`,color:s===1?i.rust:i.muted,background:s===3?i.paper:i.card,textDecoration:s===3?"line-through":"none"},children:n},n))})]})}),reviewform:t(q,{title:"Leave a review",children:d("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:5,justifyContent:"center"},children:[t(ii,{filled:4,size:14}),t(Qn,{label:"Your review",filled:!0}),t(la,{children:"POST"})]})}),submitbuild:t(q,{title:"Show us your build",children:d("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:3,border:`1px dashed ${i.mark1}`,borderRadius:5,background:i.paper},children:[t("span",{style:{fontSize:"6.63cqw",lineHeight:1,color:i.rust,fontWeight:300},children:"+"}),t("span",{style:{fontSize:"3.65cqw",color:i.muted},children:"Drop a photo of your rig"})]})}),masthead:d("div",{style:{...I,background:i.paper,display:"flex",flexDirection:"column",justifyContent:"center",padding:"0 13px",gap:5},children:[t("span",{style:{height:1.5,background:i.text}}),t("span",{style:{fontSize:"7.65cqw",fontWeight:800,letterSpacing:"0.02em",color:i.text,lineHeight:1},children:"THE TRACK"}),d("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"3.65cqw",letterSpacing:"0.1em",textTransform:"uppercase",color:i.muted},children:[t("span",{children:"Issue 14"}),t("span",{children:"Spring 2026"})]}),t("span",{style:{height:1,background:i.rule}})]}),featuredcover:d("div",{style:{...I,overflow:"hidden",...X(i.ink,i.inkSoft2)},children:[t(rt,{size:92,style:{right:-18,top:-14}}),t("div",{style:{position:"absolute",inset:0,background:`linear-gradient(0deg,${i.scrim},transparent 62%)`}}),d("div",{style:{position:"absolute",left:12,right:12,bottom:11,display:"flex",flexDirection:"column",gap:3},children:[t("span",{style:{fontSize:"3.65cqw",letterSpacing:"0.16em",fontWeight:700,color:i.warm},children:"FEATURE"}),t("span",{style:{fontSize:"6.16cqw",lineHeight:1.15,fontWeight:700,color:i.onInk},children:"Four days on the Madigan Line"})]})]}),longread:d("div",{style:{...I,background:i.card,padding:"10px 14px",display:"flex",flexDirection:"column",gap:4,justifyContent:"center"},children:[t("span",{style:{fontSize:"3.65cqw",letterSpacing:"0.14em",fontWeight:700,color:i.rust},children:"12 MIN READ"}),t("span",{style:{fontSize:"6.02cqw",lineHeight:1.15,fontWeight:700,color:i.text},children:"What breaks first, and why"}),t(ge,{children:"Every failure starts in the same place \u2014 not the rim, not"}),t(ge,{w:"62%",children:"the tyre, but the bolt nobody re-torqued."})]}),series:t(q,{title:"Recurring columns",children:t("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:5,justifyContent:"center"},children:[["Shed Notes","Monthly"],["Track Tested","Fortnightly"],["Reader Rigs","Weekly"]].map(([n,s])=>d("div",{style:{display:"flex",alignItems:"center",gap:6},children:[t("span",{style:{width:3,height:12,borderRadius:2,background:i.rust,flex:"none"}}),t("b",{style:{flex:1,fontSize:"4.64cqw",color:i.text},children:n}),t("span",{style:{fontSize:"3.65cqw",letterSpacing:"0.08em",textTransform:"uppercase",color:i.muted},children:s})]},n))})}),events:t(q,{title:"Latest posts",children:t("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:5,justifyContent:"center"},children:[[i.inkSoft,i.inkSoft2,"Madigan Line, four days"],[i.rust,i.warm,"Why offset beats width"]].map(([n,s,a])=>d("div",{style:{display:"flex",gap:6,alignItems:"center"},children:[t("span",{style:{width:24,height:18,borderRadius:3,flex:"none",...X(n,s,150)}}),d("div",{style:{display:"flex",flexDirection:"column",gap:1,minWidth:0},children:[t("b",{style:{fontSize:"4.31cqw",color:i.text},children:a}),t("span",{style:{fontSize:"3.65cqw",color:i.muted},children:"4 Sep \xB7 Shed Notes"})]})]},a))})}),docmasthead:d("div",{style:{...I,background:i.card,padding:"12px 14px",display:"flex",flexDirection:"column",gap:5,justifyContent:"center"},children:[t("span",{style:{fontSize:"3.65cqw",letterSpacing:"0.16em",fontWeight:700,color:i.muted},children:"POLICY"}),t("span",{style:{fontSize:"6.49cqw",fontWeight:700,color:i.text,lineHeight:1.1},children:"Returns & refunds"}),t("span",{style:{fontSize:"3.65cqw",color:i.muted},children:"Version 3 \xB7 Updated 4 Sep 2026"}),t("span",{style:{height:2,width:26,background:i.rust,borderRadius:1}})]}),docbody:t("div",{style:{...I,background:i.card,padding:"9px 13px",display:"flex",flexDirection:"column",gap:3,justifyContent:"center"},children:[["1.","You may return an unfitted wheel within 30 days."],["2.","Fitted wheels are covered by the structural warranty."],["3.","Freight on a change of mind is yours."]].map(([n,s])=>d("div",{style:{display:"flex",gap:5},children:[t("b",{style:{fontSize:"3.98cqw",color:i.rust,flex:"none"},children:n}),t(ge,{children:s})]},n))}),docmetacards:t(q,{title:"At a glance",children:t("div",{style:{flex:1,display:"grid",gridTemplateColumns:"repeat(2,1fr)",gap:5,minHeight:0},children:[["30 days","To return"],["5 years","Structural"],["Free","Fitting"],["48 hrs","Dispatch"]].map(([n,s])=>d("div",{style:{border:`1px solid ${i.rule}`,borderRadius:4,padding:"5px 6px",display:"flex",flexDirection:"column",gap:1},children:[t("b",{style:{fontSize:"5.31cqw",color:i.text,lineHeight:1},children:n}),t("span",{style:{fontSize:"3.32cqw",letterSpacing:"0.08em",textTransform:"uppercase",color:i.muted},children:s})]},s))})}),doctabs:d("div",{style:{...I,background:i.card,display:"flex",flexDirection:"column",justifyContent:"center",gap:0,padding:"0 11px"},children:[t("div",{style:{display:"flex",gap:0},children:["Returns","Warranty","Shipping"].map((n,s)=>t("span",{style:{fontSize:"3.98cqw",fontWeight:s===0?700:500,padding:"5px 8px",color:s===0?i.text:i.muted,background:s===0?i.paper:"transparent",borderRadius:"4px 4px 0 0",border:`1px solid ${s===0?i.rule:"transparent"}`,borderBottom:"none"},children:n},n))}),t("span",{style:{height:1,background:i.rule}}),d("div",{style:{paddingTop:6,display:"flex",flexDirection:"column",gap:2},children:[t(ge,{children:"Unfitted wheels come back within 30 days, no questions."}),t(ge,{w:"58%",children:"Freight on a change of mind is yours."})]})]}),paragraphs:d("div",{style:{...I,background:i.card,padding:"11px 14px",display:"flex",gap:10,alignItems:"center"},children:[t("span",{style:{flex:1,fontSize:"5.86cqw",lineHeight:1.2,fontWeight:700,color:i.text},children:"The right wheel is the boring one."}),d("div",{style:{flex:1,display:"flex",flexDirection:"column"},children:[t(ge,{children:"Forged, correctly offset, rated for what you actually"}),t(ge,{children:"carry. Everything else is a photograph."})]})]}),keyfeatures:t(q,{title:"Key features",children:t("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:4,justifyContent:"center"},children:["Flow-formed barrel","1250 kg per corner","Hub-centric fit"].map(n=>d("div",{style:{display:"flex",gap:6,alignItems:"center"},children:[t("span",{style:{fontSize:"4.64cqw",color:i.rust,fontWeight:700,lineHeight:1},children:"\u2713"}),t("span",{style:{fontSize:"4.31cqw",color:i.text},children:n})]},n))})}),statsparagraph:d("div",{style:{...I,background:i.paper,padding:"10px 12px",display:"flex",gap:10,alignItems:"center"},children:[d("div",{style:{flex:"none",display:"flex",flexDirection:"column",gap:5},children:[t(hn,{n:"27k",label:"Rigs"}),t(hn,{n:"4.9",label:"Rating"})]}),d("div",{style:{flex:1,display:"flex",flexDirection:"column"},children:[t(ge,{children:"Twelve years of fitting the same three questions, and the"}),t(ge,{children:"answer has not moved: load rating, offset, then looks."})]})]}),chart:d(q,{title:"Load vs weight",children:[t("div",{style:{flex:1,display:"flex",alignItems:"flex-end",gap:5,paddingBottom:2},children:[38,62,84,71,96].map((n,s)=>t("span",{style:{flex:1,height:`${n}%`,borderRadius:"2px 2px 0 0",background:s===4?i.rust:i.mark1}},s))}),t("span",{style:{height:1,background:i.rule,marginTop:-4}})]}),mockup:t("div",{style:{...I,overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"center",...X(i.inkSoft,i.ink)},children:d("div",{style:{width:"72%",height:"74%",borderRadius:4,overflow:"hidden",background:i.card,boxShadow:`0 6px 14px ${i.scrim}`},children:[t("div",{style:{height:9,background:i.paper,display:"flex",alignItems:"center",gap:2,padding:"0 4px"},children:[0,1,2].map(n=>t("span",{style:{width:2.5,height:2.5,borderRadius:"50%",background:i.mark1}},n))}),d("div",{style:{padding:5,display:"flex",flexDirection:"column",gap:3},children:[t("span",{style:{height:4,width:"56%",borderRadius:1,background:i.mark2}}),t("span",{style:{height:14,borderRadius:2,...X(i.paper,i.paper2,150)}}),t("span",{style:{height:3,width:"38%",borderRadius:1,background:i.rust}})]})]})}),manifesto:t("div",{style:{...I,overflow:"hidden",display:"flex",alignItems:"center",padding:"0 16px",...X(i.ink,i.ink2)},children:d("span",{style:{fontSize:"6.63cqw",lineHeight:1.2,fontWeight:700,color:i.onInk},children:["We build for the ",t("span",{style:{color:i.warm},children:"last"})," ten percent of the track."]})}),timeline:t(q,{title:"Our story",children:t("div",{style:{flex:1,display:"flex",flexDirection:"column",justifyContent:"center",gap:6,paddingLeft:4},children:[["1998","One shed, one lathe."],["2009","First forged rim."],["2024","27,000 rigs on."]].map(([n,s],a)=>d("div",{style:{display:"flex",gap:7,alignItems:"flex-start",position:"relative"},children:[a<2&&t("span",{style:{position:"absolute",left:3,top:8,bottom:-8,width:1,background:i.rule}}),t("span",{style:{width:7,height:7,borderRadius:"50%",flex:"none",marginTop:1,background:i.rust,zIndex:1}}),d("div",{style:{display:"flex",flexDirection:"column",gap:0,minWidth:0},children:[t("b",{style:{fontSize:"4.64cqw",color:i.text},children:n}),t(ge,{children:s})]})]},n))})}),timelinetrack:d("div",{style:{...I,padding:"0 12px",display:"flex",flexDirection:"column",gap:10,justifyContent:"center",...X(i.ink,i.inkSoft)},children:[t("span",{style:{fontSize:"3.98cqw",fontWeight:700,letterSpacing:"0.14em",textTransform:"uppercase",color:i.warm},children:"Milestones"}),d("div",{style:{position:"relative",display:"flex",justifyContent:"space-between",paddingTop:7},children:[t("span",{style:{position:"absolute",left:0,right:0,top:3,height:1,background:i.mark2,opacity:.55}}),["1998","2009","2016","2024"].map((n,s)=>d("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:3,position:"relative"},children:[t("span",{style:{position:"absolute",top:-7,width:6,height:6,borderRadius:"50%",background:s===3?i.warm:i.mark1}}),t("span",{style:{fontSize:"4.31cqw",fontWeight:700,color:s===3?i.warm:i.onInk,opacity:s===3?1:.75},children:n})]},n))]})]}),footprint:d("div",{style:{...I,overflow:"hidden",...X(i.paper,i.paper2,150)},children:[t("span",{style:{position:"absolute",left:"8%",top:"18%",width:"62%",height:"64%",borderRadius:"48% 52% 40% 60% / 55% 45% 55% 45%",background:i.mark1,opacity:.75}}),t("span",{style:{position:"absolute",left:"52%",top:"52%",width:"34%",height:"34%",borderRadius:"58% 42% 55% 45% / 45% 58% 42% 55%",background:i.mark2,opacity:.55}}),[["26%","38%"],["44%","58%"],["62%","34%"]].map(([n,s])=>t("span",{style:{position:"absolute",left:n,top:s,width:7,height:7,borderRadius:"50% 50% 50% 0",transform:"rotate(-45deg)",background:i.rust}},n)),t("span",{style:{position:"absolute",left:11,bottom:9,fontSize:"4.64cqw",fontWeight:700,color:i.text},children:"3 fitting bays"})]}),banner:d("div",{style:{...I,display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 13px",gap:8,background:i.rust},children:[d("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[t("b",{style:{fontSize:"6.02cqw",color:i.onInk},children:"End of season \xB7 20% off"}),t("span",{style:{fontSize:"3.98cqw",color:i.onInk,opacity:.8},children:"Fitted free, this month only."})]}),t("span",{style:{fontSize:"3.65cqw",letterSpacing:"0.12em",fontWeight:700,padding:"5px 9px",borderRadius:2,background:i.onInk,color:i.text,flex:"none"},children:"SHOP"})]}),titlewithbuttons:d("div",{style:{...I,background:i.paper,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:7,padding:"0 14px",textAlign:"center"},children:[t("span",{style:{fontSize:"6.49cqw",lineHeight:1.15,fontWeight:700,color:i.text},children:"Not sure what fits?"}),d("div",{style:{display:"flex",gap:5},children:[t("span",{style:{fontSize:"3.65cqw",letterSpacing:"0.12em",fontWeight:700,padding:"5px 9px",borderRadius:2,background:i.text,color:i.onInk},children:"FIND MY FIT"}),t("span",{style:{fontSize:"3.65cqw",letterSpacing:"0.12em",fontWeight:700,padding:"5px 9px",borderRadius:2,border:`1px solid ${i.text}`,color:i.text},children:"CALL US"})]})]}),ticker:t("div",{style:{...I,overflow:"hidden",background:i.ink,display:"flex",alignItems:"center"},children:t("span",{style:{whiteSpace:"nowrap",fontSize:"6.29cqw",fontWeight:800,letterSpacing:"0.06em",color:i.warm,marginLeft:-14},children:"FREE FITTING \xB7 48HR DISPATCH \xB7 FREE FITTING \xB7 48HR DISPATCH"})}),breadcrumb:t("div",{style:{...I,background:i.card,display:"flex",alignItems:"center",padding:"0 13px"},children:d("span",{style:{fontSize:"4.64cqw",color:i.muted},children:["Home ",t("span",{style:{opacity:.5},children:"/"})," Wheels ",t("span",{style:{opacity:.5},children:"/"})," ",t("span",{style:{color:i.text,fontWeight:700},children:"20 inch"})]})}),categorybar:d("div",{style:{...I,background:i.card,display:"flex",flexDirection:"column",justifyContent:"center",gap:7,padding:"0 11px"},children:[t("div",{style:{display:"flex",gap:5},children:["All","Wheels","Tyres","Lift"].map((n,s)=>t("span",{style:{fontSize:"3.98cqw",fontWeight:s===0?700:500,padding:"4px 7px",borderRadius:99,background:s===0?i.text:i.paper,color:s===0?i.onInk:i.muted},children:n},n))}),t("span",{style:{height:1,background:i.rule}})]}),intro:d("div",{style:{...I,overflow:"hidden",background:i.card},children:[t("div",{style:{position:"absolute",inset:0,...X(i.ink,i.inkSoft2)}}),t(rt,{size:64,style:{right:8,top:6}}),d("div",{style:{position:"absolute",left:16,right:16,bottom:8,top:"46%",background:i.paper,borderRadius:6,padding:"8px 11px",display:"flex",flexDirection:"column",gap:2,boxShadow:`0 -4px 10px ${i.scrim}`},children:[t("span",{style:{fontSize:"5.69cqw",fontWeight:700,color:i.text},children:"Since 1998"}),t(ge,{children:"One shed, one lathe, one idea."}),t(ge,{w:"66%",children:"It turned out to be right."})]})]}),gallerygrid:t(q,{title:"From our customers",children:t("div",{style:{flex:1,display:"grid",gridTemplateColumns:"repeat(3,1fr)",gridTemplateRows:"repeat(2,1fr)",gap:4,minHeight:0},children:[[i.rust,i.warm],[i.inkSoft,i.ink],[i.paper2,i.mark2],[i.ink,i.inkSoft2],[i.warm,i.paper2],[i.mark2,i.inkSoft]].map(([n,s],a)=>t("div",{style:{borderRadius:3,...X(n,s,140+a*22)}},a))})}),gallery:d(q,{title:"Gallery",children:[t("div",{style:{display:"flex",gap:8,alignItems:"center",marginTop:-2},children:["On the truck","Studio","Close-ups"].map((n,s)=>t("span",{style:{fontSize:"3.98cqw",fontWeight:s===0?700:500,color:s===0?i.text:i.muted,borderBottom:`1.5px solid ${s===0?i.rust:"transparent"}`,paddingBottom:2},children:n},n))}),t("div",{style:{flex:1,display:"grid",gridTemplateColumns:"repeat(3,1fr)",gap:4,minHeight:0},children:[[i.rust,i.warm],[i.ink,i.inkSoft],[i.paper2,i.mark2]].map(([n,s],a)=>t("div",{style:{borderRadius:3,...X(n,s,150+a*20)}},a))})]}),ordersummary:d(q,{title:"Order summary",children:[d("div",{style:{display:"flex",gap:6,alignItems:"center",paddingBottom:4},children:[t("span",{style:{width:26,height:26,borderRadius:4,position:"relative",overflow:"hidden",flex:"none",...X(i.paper,i.paper2,150)},children:t(rt,{size:18,style:{left:"50%",top:"50%",transform:"translate(-50%,-50%)"}})}),d("div",{style:{display:"flex",flexDirection:"column",gap:1,minWidth:0},children:[t("b",{style:{fontSize:"4.31cqw",color:i.text},children:"Ridge Grappler"}),t("span",{style:{fontSize:"3.65cqw",color:i.muted},children:"20\xD79 +12 \xB7 qty 4"})]})]}),d("div",{style:{flex:1,minHeight:0,display:"flex",flexDirection:"column",justifyContent:"center"},children:[t(st,{k:"Subtotal",v:"$1,956"}),t(st,{k:"Fitting",v:"Free"}),d("div",{style:{display:"flex",justifyContent:"space-between",paddingTop:5,fontSize:"4.64cqw"},children:[t("b",{style:{color:i.text},children:"Total"}),t("b",{style:{color:i.text,fontSize:"6.02cqw"},children:"$1,956"})]})]})]}),deliveryoptions:t(q,{title:"Delivery",children:t("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:4,justifyContent:"center"},children:[["Standard","3\u20135 days","Free",!0],["Express","Next day","$19",!1]].map(([n,s,a,m])=>d("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"5px 6px",borderRadius:4,border:`1px solid ${m?i.rust:i.rule}`,background:m?i.paper:i.card},children:[t("span",{style:{width:7,height:7,borderRadius:"50%",flex:"none",border:`1.5px solid ${m?i.rust:i.mark1}`,background:m?i.rust:"transparent"}}),t("span",{style:{flex:1,fontSize:"4.31cqw",fontWeight:600,color:i.text},children:n}),t("span",{style:{fontSize:"3.98cqw",color:i.muted},children:s}),t("b",{style:{fontSize:"4.31cqw",color:i.text},children:a})]},n))})}),paymentbadges:d("div",{style:{...I,background:i.paper,display:"flex",flexDirection:"column",gap:8,justifyContent:"center",padding:"0 12px"},children:[t(bn,{children:"Ways to pay"}),t("div",{style:{display:"flex",gap:5},children:[["VISA",i.ink],["MC",i.rust],["AMEX",i.inkSoft],["PayPal",i.ink2]].map(([n,s])=>t("span",{style:{flex:1,textAlign:"center",fontSize:"3.65cqw",fontWeight:800,letterSpacing:"0.06em",color:i.onInk,borderRadius:3,padding:"6px 0",background:s},children:n},n))})]}),stats:d("div",{style:{...I,padding:"10px 12px",display:"flex",flexDirection:"column",gap:9,justifyContent:"center",...X(i.ink,i.ink2)},children:[t("span",{style:{fontSize:"3.98cqw",fontWeight:700,letterSpacing:"0.14em",textTransform:"uppercase",color:i.warm},children:"By the numbers"}),d("div",{style:{display:"flex",gap:8},children:[t(hn,{n:"27k",label:"Rigs fitted",tone:i.onInk}),t(hn,{n:"12",label:"Years",tone:i.onInk}),t(hn,{n:"4.9",label:"Avg rating",tone:i.warm})]})]}),testimonials:d("div",{style:{...I,overflow:"hidden",background:i.paper,padding:"10px 11px",display:"flex",flexDirection:"column",gap:6,justifyContent:"center"},children:[t("span",{style:{position:"absolute",right:10,top:2,fontSize:"22.4cqw",lineHeight:1,fontWeight:800,color:i.rust,opacity:.16},children:"\u201D"}),t(ii,{filled:5,size:7}),t("span",{style:{position:"relative",fontSize:"5.31cqw",lineHeight:1.35,color:i.text,fontWeight:600},children:"\u201CTook them out to the Simpson and back. Not one chip.\u201D"}),d("div",{style:{display:"flex",alignItems:"center",gap:5},children:[t(aa,{}),t("span",{style:{fontSize:"3.98cqw",color:i.muted},children:"Dave M. \xB7 Hilux N80"})]})]}),reviews:d(q,{title:"Reviews",children:[t("div",{style:{display:"flex",gap:4,height:22},children:[[i.inkSoft,i.inkSoft2],[i.rust,i.warm],[i.ink,i.inkSoft],[i.mark2,i.mark1]].map(([n,s],a)=>t("div",{style:{flex:1,borderRadius:3,...X(n,s,140+a*15)}},a))}),t("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:5,justifyContent:"center"},children:[["Dave M.",5,"Not one chip after the Simpson."],["Sara K.",4,"Fitted in an hour, no fuss."]].map(([n,s,a])=>d("div",{style:{display:"flex",gap:5,alignItems:"flex-start"},children:[t(aa,{size:12}),d("div",{style:{display:"flex",flexDirection:"column",gap:1,minWidth:0},children:[d("div",{style:{display:"flex",gap:4,alignItems:"center"},children:[t("b",{style:{fontSize:"3.98cqw",color:i.text},children:n}),t(ii,{filled:s})]}),t(ge,{children:a})]})]},n))})]}),logos:d("div",{style:{...I,display:"flex",flexDirection:"column",gap:9,justifyContent:"center",padding:"0 12px",...X(i.ink,i.inkSoft)},children:[t("span",{style:{fontSize:"3.98cqw",fontWeight:700,letterSpacing:"0.14em",textTransform:"uppercase",color:i.warm},children:"As fitted by"}),t("div",{style:{display:"grid",gridTemplateColumns:"repeat(4,1fr)",gap:8},children:["ARB","TJM","IRONMAN","OPPOSITE"].map(n=>t("span",{style:{textAlign:"center",fontSize:"4.31cqw",fontWeight:800,letterSpacing:"0.08em",color:i.onInk,opacity:.82},children:n},n))})]}),prose:d("div",{style:{...I,background:i.paper,padding:"11px 14px",display:"flex",flexDirection:"column",gap:4,justifyContent:"center"},children:[t("span",{style:{fontSize:"5.86cqw",fontWeight:700,color:i.text},children:"Why offset matters"}),d("div",{style:{display:"flex",gap:6},children:[t("span",{style:{fontSize:"15.3cqw",lineHeight:.78,fontWeight:800,color:i.rust,marginTop:1},children:"T"}),d("div",{style:{display:"flex",flexDirection:"column"},children:[t(ge,{children:"he number on the back of your wheel decides whether the"}),t(ge,{w:"76%",children:"tyre sits under the guard or an inch outside it."})]})]})]}),cards:t(q,{title:"What you get",children:t("div",{style:{flex:1,display:"grid",gridTemplateColumns:"repeat(3,1fr)",gap:5,minHeight:0},children:[["Fitted free","In store, same day."],["5 yr cover","Structural, no fine print."],["Swap it","30 days, any reason."]].map(([n,s])=>d("div",{style:{border:`1px solid ${i.rule}`,borderRadius:4,padding:6,display:"flex",flexDirection:"column",gap:2},children:[t("span",{style:{width:11,height:11,borderRadius:3,background:i.rust,opacity:.9}}),t("b",{style:{fontSize:"3.98cqw",color:i.text},children:n}),t(ge,{children:s})]},n))})}),faq:t(q,{title:"Questions",children:t("div",{style:{flex:1,display:"flex",flexDirection:"column",justifyContent:"center"},children:[["Will these fit my Hilux?",!0],["Do you fit them for me?",!1],["What if I pick wrong?",!1]].map(([n,s])=>d("div",{style:{borderBottom:`1px solid ${i.rule}`,padding:"4px 2px"},children:[d("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:6},children:[t("b",{style:{fontSize:"4.31cqw",color:i.text},children:n}),t("span",{style:{fontSize:"4.64cqw",color:i.muted,lineHeight:1},children:s?"\u2212":"+"})]}),s&&t(ge,{w:"90%",children:"Use the fitment finder \u2014 it reads your build, not just the model."})]},n))})}),hero:d("div",{style:{...I,overflow:"hidden",...X(i.ink,i.ink2)},children:[t("div",{style:{...I,background:`linear-gradient(90deg,${i.scrim},transparent 70%)`}}),t("div",{style:{position:"relative",height:"100%",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",padding:"12px 14px",gap:5},children:t(ra,{over:"NEW \xB7 SUMMER",overTone:i.warm,head:"Built for the worst road you own",cta:"SHOP ALL",ctaBg:i.warm,ctaFg:i.ink,tone:i.onInk})}),t(rt,{size:104,style:{right:-24,bottom:-30}})]}),herosingle:d("div",{style:{...I,display:"flex",background:i.paper,overflow:"hidden"},children:[t("div",{style:{flex:1,padding:12,display:"flex",flexDirection:"column",gap:5,justifyContent:"center"},children:t(ra,{over:"ALL-TERRAIN",overTone:i.rust,head:"Grip that does not ask",headSize:12,cta:"EXPLORE",ctaBg:i.text,ctaFg:i.onInk,tone:i.text})}),t("div",{style:{flex:1,position:"relative",...X(i.inkSoft,i.inkSoft2)},children:t(rt,{size:74,style:{right:-14,top:16}})})]}),productgrid:t(q,{title:"Best sellers",children:d("div",{style:{flex:1,display:"grid",gridTemplateColumns:"repeat(3,1fr)",gap:5,minHeight:0},children:[t(oi,{name:"Ridge 19",price:"$365"}),t(oi,{name:"Ridge 29",price:"$410"}),t(oi,{name:"Ridge 39",price:"$455"})]})}),collections:t(q,{title:"Shop by category",children:t("div",{style:{flex:1,display:"grid",gridTemplateColumns:"repeat(3,1fr)",gap:5,minHeight:0},children:[["Wheels",i.inkSoft,i.inkSoft2],["Tyres",i.rust,i.warm],["Lift kits",i.ink,i.inkSoft]].map(([n,s,a])=>t("div",{style:{borderRadius:4,display:"flex",alignItems:"flex-end",padding:5,color:i.onInk,...X(s,a)},children:t("span",{style:{fontSize:"3.98cqw",fontWeight:700,letterSpacing:"0.04em"},children:n})},n))})}),producthero:d("div",{style:{...I,display:"flex",background:i.card,overflow:"hidden"},children:[t("div",{style:{flex:1.1,position:"relative",...X(i.paper,i.paper2,150)},children:t(rt,{size:78,style:{left:"50%",top:"50%",transform:"translate(-50%,-50%)"}})}),d("div",{style:{flex:1,padding:"10px 10px 10px 8px",display:"flex",flexDirection:"column",gap:4,justifyContent:"center"},children:[t("span",{style:{fontSize:"3.65cqw",letterSpacing:"0.16em",fontWeight:700,color:i.rust},children:"NITTO"}),t("b",{style:{fontSize:"6.29cqw",color:i.text},children:"Ridge Grappler"}),t("span",{style:{fontSize:"6.63cqw",fontWeight:700,color:i.text},children:"$489"}),t("span",{style:{alignSelf:"flex-start",fontSize:"3.65cqw",letterSpacing:"0.12em",fontWeight:700,padding:"4px 8px",borderRadius:2,background:i.text,color:i.onInk},children:"ADD TO CART"})]})]}),spectable:t(q,{title:"Specifications",children:d("div",{style:{flex:1,display:"flex",flexDirection:"column",justifyContent:"center"},children:[t(st,{k:"Diameter",v:'20"'}),t(st,{k:"Width",v:"9.0J"}),t(st,{k:"Offset",v:"+12"}),t(st,{k:"Load",v:"1250 kg"})]})}),fitmenttable:t(q,{title:"Will it fit?",children:d("div",{style:{flex:1,display:"flex",flexDirection:"column",justifyContent:"center"},children:[t(st,{k:"Hilux N80",v:"20\xD79 +12",ok:!0}),t(st,{k:"Ranger PX3",v:"20\xD79 +12",ok:!0}),t(st,{k:"LC79",v:"17\xD78 \u221210",ok:!0})]})}),brandstrip:d("div",{style:{...I,background:i.paper,display:"flex",flexDirection:"column",gap:8,justifyContent:"center",padding:"0 12px"},children:[t(bn,{children:"Brands we carry"}),t("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:["NITTO","BFG","FUEL","TOYO"].map(n=>t("span",{style:{fontSize:"4.64cqw",fontWeight:800,letterSpacing:"0.1em",color:i.mark2},children:n},n))})]}),processsteps:d("div",{style:{...I,background:i.paper,padding:10,display:"flex",flexDirection:"column",gap:7,justifyContent:"center"},children:[t(bn,{children:"How it works"}),t("div",{style:{display:"flex",gap:6},children:["Pick your rig","Match the fit","We fit it"].map((n,s)=>d("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:2},children:[t("span",{style:{width:11,height:11,borderRadius:"50%",background:i.text,color:i.onInk,fontSize:"3.98cqw",display:"flex",alignItems:"center",justifyContent:"center",fontWeight:700},children:s+1}),t("span",{style:{fontSize:"3.98cqw",color:i.text,fontWeight:600},children:n})]},n))})]}),detailrows:t("div",{style:{...I,background:i.card,display:"flex",flexDirection:"column",overflow:"hidden"},children:[["Forged, not cast","Half the weight, twice the road.",!1],["Fits your load","Rated to 1250 kg a corner.",!0]].map(([n,s,a])=>{let m=t("div",{style:{flex:1,...X(a?i.rust:i.inkSoft,a?i.warm:i.inkSoft2)}},"art"),u=d("div",{style:{flex:1.1,padding:8,display:"flex",flexDirection:"column",gap:2,justifyContent:"center"},children:[t("b",{style:{fontSize:"4.64cqw",color:i.text},children:n}),t("span",{style:{fontSize:"3.98cqw",color:i.muted,lineHeight:1.3},children:s})]},"tx");return t("div",{style:{flex:1,display:"flex",minHeight:0},children:a?[u,m]:[m,u]},n)})}),specstrip:t("div",{style:{...I,background:i.ink,color:i.onInk,display:"flex",alignItems:"center",justifyContent:"space-around",padding:"0 8px"},children:[["5 yr","Warranty"],["Free","Fitting"],["48 hr","Dispatch"]].map(([n,s])=>d("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:1},children:[t("b",{style:{fontSize:"5.69cqw",letterSpacing:"0.02em"},children:n}),t("span",{style:{fontSize:"3.65cqw",color:i.mark2,letterSpacing:"0.1em",textTransform:"uppercase"},children:s})]},s))})},da={subscribe:d("div",{style:{...I,padding:13,display:"flex",flexDirection:"column"},children:[d("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:8},children:[d("div",{style:{display:"flex",alignItems:"center",gap:6},children:[t(S,{w:8,h:8,r:2,tone:"accent"}),t(S,{w:38,h:7,r:3,tone:"dark"}),t(S,{w:16,h:7,r:3,tone:"accent"})]}),t(S,{w:38,h:4,r:2,tone:"soft"})]}),t("div",{style:{height:1,background:re.line,marginBottom:10}}),d("div",{style:{flex:1,display:"flex",gap:10,border:`1px solid ${re.line}`,borderRadius:7,padding:10},children:[d("div",{style:{flex:1.1,display:"flex",flexDirection:"column",justifyContent:"center",gap:5},children:[t(S,{w:"46%",h:3,r:2,tone:"accent"}),t(S,{w:"84%",h:8,r:4,tone:"dark"}),t(S,{w:"56%",h:8,r:4,tone:"accent"}),t(S,{w:"96%",h:3,r:2,tone:"soft",style:{marginTop:2}}),d("div",{style:{display:"flex",gap:5,marginTop:4},children:[t("div",{style:{flex:1,height:13,borderRadius:5,border:`1px solid ${re.line}`,background:re.block}}),t(S,{w:34,h:13,r:5,tone:"accent"})]})]}),d("div",{style:{flex:1,background:re.block,borderRadius:6,padding:8,display:"flex",flexDirection:"column",gap:6},children:[t(S,{w:"52%",h:4,r:2,tone:"accent"}),Array.from({length:3}).map((n,s)=>d("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:6,borderTop:s?`1px solid ${re.line}`:"none",paddingTop:s?4:0},children:[t(S,{w:34,h:4,r:2,tone:"dark"}),t(S,{w:16,h:3,r:2,tone:"soft"})]},s))]})]})]}),split:d("div",{style:{...I,display:"flex"},children:[t("div",{style:{width:"44%",background:ni}}),d("div",{style:{flex:1,padding:15,display:"flex",flexDirection:"column",justifyContent:"center",gap:7},children:[t(S,{w:"44%",h:5,r:3,tone:"accent"}),t(S,{w:"88%",h:8,r:4,tone:"dark"}),t(S,{w:"70%",h:8,r:4,tone:"dark"}),t(S,{w:"94%",h:5,r:2,tone:"soft",style:{marginTop:2}}),t(S,{w:"80%",h:5,r:2,tone:"soft"}),t(S,{w:"40%",h:13,r:6,tone:"accent",style:{marginTop:5}})]})]}),sectionheader:d(ca,{children:[t(S,{w:"18%",h:6,r:3,tone:"accent",style:{position:"absolute",top:15,right:16}}),d("div",{style:{...I,padding:16,display:"flex",flexDirection:"column",justifyContent:"center",gap:10},children:[d("div",{style:{display:"flex",alignItems:"center",gap:9},children:[t(S,{w:16,h:16,r:4,tone:"accent"}),t(S,{w:"20%",h:9,r:4,tone:"dark"})]}),t(S,{w:"62%",h:10,r:5,tone:"dark"}),t(S,{w:"42%",h:6,r:3,tone:"soft"})]})]}),header:t("div",{style:{...I,padding:14,display:"flex",flexDirection:"column",justifyContent:"center"},children:d("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[t(S,{w:"22%",h:12,r:4,tone:"dark"}),d("div",{style:{display:"flex",gap:9,alignItems:"center"},children:[t(S,{w:26,h:6,r:3,tone:"soft"}),t(S,{w:26,h:6,r:3,tone:"soft"}),t(S,{w:26,h:6,r:3,tone:"soft"}),t(S,{w:18,h:14,r:5,tone:"accent"})]})]})}),footer:d("div",{style:{...I,padding:15,display:"flex",flexDirection:"column",justifyContent:"center",gap:12},children:[d("div",{style:{display:"flex",gap:14},children:[d("div",{style:{flex:1.4,display:"flex",flexDirection:"column",gap:6},children:[t(S,{w:"60%",h:9,r:4,tone:"dark"}),t(S,{w:"90%",h:5,r:2,tone:"soft"}),t(S,{w:"70%",h:5,r:2,tone:"soft"})]}),[0,1].map(n=>d("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:6},children:[t(S,{w:"50%",h:6,r:3,tone:"dark"}),t(S,{w:"80%",h:5,r:2,tone:"soft"}),t(S,{w:"66%",h:5,r:2,tone:"soft"})]},n))]}),t("div",{style:{height:1,background:re.line}}),d("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[t(S,{w:"30%",h:5,r:2,tone:"soft"}),t(S,{w:"16%",h:5,r:2,tone:"soft"})]})]}),grid:t("div",{style:{...I,padding:14,display:"grid",gridTemplateColumns:"1fr 1fr",gridTemplateRows:"1fr 1fr",gap:9},children:Array.from({length:4}).map((n,s)=>t("div",{style:{borderRadius:6,background:re.block}},s))}),blanksection:t("div",{style:{...I,padding:14,display:"flex"},children:d("div",{style:{flex:1,border:`1px dashed ${re.line}`,borderRadius:7,display:"flex",alignItems:"center",justifyContent:"center",position:"relative"},children:[t(S,{w:14,h:2,r:1,tone:"tint"}),t(S,{w:2,h:14,r:1,tone:"tint",style:{position:"absolute"}})]})}),spacer:d("div",{style:{...I,padding:14,display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[t(S,{w:"100%",h:6,r:3,tone:"soft"}),t(S,{w:16,h:22,r:3,tone:"block",style:{alignSelf:"center"}}),t(S,{w:"100%",h:6,r:3,tone:"soft"})]}),divider:t("div",{style:{...I,padding:14,display:"flex",alignItems:"center"},children:t(S,{w:"100%",h:3,r:2,tone:"dark"})}),customhtml:d("div",{style:{...I,display:"flex",alignItems:"center",justifyContent:"center",gap:8,background:ni},children:[t(S,{w:5,h:16,r:2,tone:"dark",style:{transform:"skewX(-14deg)"}}),t(S,{w:16,h:10,r:3,tone:"accent"}),t(S,{w:5,h:16,r:2,tone:"dark",style:{transform:"skewX(14deg)"}})]}),heading:t("div",{style:{...I,padding:14,display:"flex",alignItems:"center"},children:t(S,{w:"64%",h:13,r:4,tone:"dark"})}),text:d("div",{style:{...I,padding:16,display:"flex",flexDirection:"column",justifyContent:"center",gap:7},children:[t(S,{w:"100%",h:6,r:3,tone:"soft"}),t(S,{w:"96%",h:6,r:3,tone:"soft"}),t(S,{w:"100%",h:6,r:3,tone:"soft"}),t(S,{w:"58%",h:6,r:3,tone:"soft"})]}),image:t("div",{style:{position:"absolute",inset:14,borderRadius:7,background:ni}}),button:t("div",{style:{...I,display:"flex",alignItems:"center",justifyContent:"center"},children:t(S,{w:"34%",h:16,r:8,tone:"accent"})}),menu:d("div",{style:{...I,padding:"14px 22%",display:"flex",flexDirection:"column",justifyContent:"center",gap:7},children:[t(S,{w:"48%",h:7,r:3,tone:"dark"}),t(S,{w:"82%",h:5,r:2,tone:"soft"}),t(S,{w:"66%",h:5,r:2,tone:"soft"}),t(S,{w:"74%",h:5,r:2,tone:"soft"}),t(S,{w:"58%",h:5,r:2,tone:"soft"})]}),emailform:d("div",{style:{...I,padding:16,display:"flex",flexDirection:"column",justifyContent:"center",gap:9},children:[t(S,{w:"56%",h:8,r:3,tone:"dark"}),d("div",{style:{display:"flex",gap:6},children:[t("div",{style:{flex:1,height:16,borderRadius:5,border:`1px solid ${re.line}`}}),t(S,{w:"30%",h:16,r:5,tone:"accent"})]})]}),sociallogos:t("div",{style:{...I,display:"flex",alignItems:"center",justifyContent:"center",gap:9},children:[0,1,2,3].map(n=>t(S,{w:16,h:16,r:8,tone:"dark"},n))}),search:t("div",{style:{...I,padding:"0 18%",display:"flex",alignItems:"center"},children:d("div",{style:{flex:1,height:22,borderRadius:11,border:`1px solid ${re.line}`,display:"flex",alignItems:"center",gap:7,padding:"0 9px"},children:[t("div",{style:{width:9,height:9,borderRadius:5,border:`2px solid ${re.dark}`}}),t(S,{w:"46%",h:5,r:2,tone:"soft"})]})}),cart:d("div",{style:{...I,display:"flex",alignItems:"center",justifyContent:"center",gap:7},children:[t("div",{style:{width:22,height:18,borderRadius:"3px 3px 6px 6px",border:`2px solid ${re.dark}`}}),t("div",{style:{padding:"2px 6px",borderRadius:6,border:`1.5px solid ${re.dark}`},children:t(S,{w:7,h:7,r:2,tone:"dark"})})]}),countryswitch:d("div",{style:{...I,padding:14,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:5},children:[d("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"4px 8px",border:`1px solid ${re.line}`},children:[t(S,{w:22,h:6,r:2,tone:"dark"}),t(S,{w:6,h:4,r:1,tone:"soft"})]}),d("div",{style:{width:"46%",display:"flex",flexDirection:"column",gap:4,padding:6,border:`1px solid ${re.line}`},children:[t(S,{w:"80%",h:4,r:2,tone:"accent"}),t(S,{w:"64%",h:4,r:2,tone:"soft"}),t(S,{w:"72%",h:4,r:2,tone:"soft"})]})]}),legalline:d("div",{style:{...I,padding:16,display:"flex",flexDirection:"column",justifyContent:"center",gap:9},children:[t("div",{style:{height:1,background:re.line}}),d("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[t(S,{w:"38%",h:5,r:2,tone:"soft"}),d("div",{style:{display:"flex",gap:5},children:[t(S,{w:14,h:5,r:2,tone:"soft"}),t(S,{w:14,h:5,r:2,tone:"soft"}),t(S,{w:14,h:5,r:2,tone:"soft"})]})]})]}),fallback:t("div",{style:{position:"absolute",inset:14,borderRadius:8,background:re.block}})};function eo({type:n}){let s=Ql[n]??"",a=ed[s]??da[s]??da.fallback;return t("div",{className:"sf-thumb","aria-hidden":"true",style:{position:"absolute",inset:0,background:"var(--sf-thumb-thumb-bg)",pointerEvents:"none",containerType:"inline-size"},children:a})}var td={openers:{label:"Hero & intros",icon:"image"},shop:{label:"Shop & galleries",icon:"bag"},product:{label:"Product page",icon:"box"},checkout:{label:"Checkout & ordering",icon:"bag"},about:{label:"About & brand story",icon:"book"},content:{label:"Text & content",icon:"type"},proof:{label:"Stats & social proof",icon:"star"},promo:{label:"Promotions & sign-ups",icon:"sparkles"},blog:{label:"Blog & journal",icon:"newspaper"},navigation:{label:"Navigation & wayfinding",icon:"bookmark"},legal:{label:"Legal & documents",icon:"file"},contact:{label:"Contact, FAQ & forms",icon:"mail"},structure:{label:"Layout, structure & embeds",icon:"grid"}};function pa(n,s={}){let a=n.categories??{},m=n.components,u=[];for(let[f,b]of Object.entries(a))for(let R of b?.components??[]){let C=m[R];if(!C)continue;let M=C.label??R,A=Wt(R,"section",M);u.push({type:R,cat:f,catLabel:si(n,f),name:A,desc:s[R]??"",...A===M?{}:{alias:M}})}return u}function si(n,s){return td[s]?.label??n.categories?.[s]?.title??s}var ua=Vs;function fa(n){return n.find(s=>s.type===ua)??null}function ga(n){return n.filter(s=>s.type!==ua)}import{SettingsSwitch as ad}from"efficient-easel/panel";var ma={Hero:"Full-screen opener with rotating slides.",HeroSingle:"Full-screen image or video with a headline.",IntroBleed:"Full-bleed intro image the next section scrolls over.",Collections:"Product collections in a tidy grid.",AlloyWheelsListing:"A full product-listing page: filter rail, sortable card grid and pagination, from the live catalog. Choose which product types it shows.",CatalogFilterBar:"Filters the collection grids below it \u2014 a sticky row of Pills (the default), or Columns, one per filter you switch on.",ProductGrid:"Hand-picked products in a tidy grid.",FitmentFinder:"A vehicle picker \u2014 make, model, year and trim resolve the OEM stock fitment live.",Gallery:"Two image galleries with tabs and filters.",GalleryB:"Customer photos in a card grid with a click-to-open lightbox.",SpecStrip:"A thin one-line spec strip \u2014 small-caps items spread across the width, as a dark band or a bare hairline row.",ProductHero:"A product hero \u2014 image beside price, bullets and a buy button.",SpecTable:"A spec sheet \u2014 labeled rows of product specifications.",ProcessSteps:"A heading over columns of image, title, blurb and specs.",DetailRows:"Repeating full-width rows \u2014 eyebrow, title and copy beside a numbered close-up image, alternating sides each row.",FitmentTable:"A fitment table \u2014 per-size bolt patterns, offsets and load ratings, filterable by diameter.",CompatibleTyres:"The current product's compatible tyres \u2014 image, size, key specs and price per tyre, with an inquiry link. Display only.",RelatedProducts:"The current product's related items in a tidy row \u2014 the product page's built-in 'Pair with' cross-sell.",OrderSummary:"A display order-summary panel \u2014 items, totals and a note.",DeliveryOptions:"Delivery tiers as cards \u2014 name, window and price, one highlighted.",PaymentBadges:"A payment-methods trust strip with reassurance lines.",CheckoutCTA:"A centered 'ready to order?' headline with the checkout button.",Manifesto:"A bold brand statement beside a full-height image, with a stat strip.",ParagraphsA:"An editorial text panel with a stat strip and founders' note.",StatsParagraph:"An editorial heading and paragraph over a row of theme-color-accented stat cards.",Chart:"A titled chart \u2014 bars, line or donut \u2014 drawn from your own labeled data points.",Mockup:"A headline beside a stylized product-UI mockup card \u2014 spec sheet, fitment, portal, kanban and more.",Prose:"A plain editorial text section \u2014 eyebrow, heading and body copy.",Timeline:"An editorial aside beside a rail-marked timeline of dated entries.",TimelineTrack:"A horizontal year track of milestones \u2014 company history or roadmap.",Footprint:"A world map of your locations with a legend \u2014 designed here, sold worldwide.",TitleWithButtons:"A big headline beside a stack of call-to-action buttons.",Split:"Side-by-side image and text in two columns.",Cards:"A heading over a grid of free-text title-and-blurb cards.",FAQ:"A frequently-asked-questions accordion with a header.",Testimonials:"Customer quotes in a grid \u2014 the quote, a name and a role.",Masthead:"A journal issue header with a lead statement and contents.",Breadcrumb:"A slim trail showing where the reader is (Home / Journal\u2026).",CategoryBar:"A sticky row of category tabs with counts and links.",FeaturedCover:"A featured article \u2014 big cover image beside a headline and dek.",LongRead:"A long-form article spread with a pull-quote and cover image.",Series:"A section heading over a grid of column cards.",Subscribe:"A newsletter signup beside a list of recent issues.",SubscribeBlogs:"A newsletter signup beside your latest blog posts, pulled live.",Events:"Latest journal posts in a three-card row.",DocMasthead:"A document header \u2014 headline, metadata and standfirst.",DocTabs:"A sticky tab bar to switch between documents.",DocBody:"Long-form document body with an 'On this page' contents list.",DocMetaCards:"A three-up meta strip for the foot of a document.",Banner:"Wide promo strip with background image.",Stats:"Highlight key numbers \u2014 years, designs.",KeyFeatures:"A theme-color chip and heading over a grid of short feature labels.",Logos:"A row of partner or brand logos.",Ticker:"A scrolling marquee of short phrases, full width.",Reviews:"Approved customer reviews in a star-rated card grid, pulled live.",SubmitBuild:"A 'Show us yours.' headline with a photo-submission form.",ReviewForm:"A write-a-review form \u2014 submissions wait for your approval before they show.",ContactRouting:"Pick who to reach, then a form that routes the message.",ContactLocations:"Your locations as a city gallery plus address and map cards.",SectionHeader:"A numbered section title with optional link.",Grid:"Multi-column container for blocks.",Flex:"An empty section. Add whatever you want inside.",Spacer:"Vertical breathing room between sections.",Divider:"A thin horizontal rule between sections.",CustomHTML:"Drop in your own sanitized HTML.",Heading:"A single heading line.",Text:"A paragraph of body copy.",ImageBlock:"A standalone image, at the width you set.",ButtonBlock:"A call-to-action button."};import{Fragment as pd,jsx as Ue,jsxs as to}from"react/jsx-runtime";var ld=n=>`section:${n}`,dd=n=>`block:${n}`,cd=n=>`template:${n}`;function ri({blocks:n,blocksOnly:s,at:a,onAdd:m,itemFor:u,session:f,siteWide:b,onClose:R,onHide:C,readOnly:M}){let A=id(E=>E.config),H=Gs(),[te,Ee]=od([]);nd(()=>{let E=!1,J=Sr(H);return qr.list().then(W=>{if(E)return;let F=A.components;Ee(W.filter(Y=>Y.node?.type&&F[Y.node.type]&&(!J||vr(Y.node).every(J.offers))))}).catch(()=>{}),()=>{E=!0}},[A,H]);let ae=ya(()=>pa(A,ma),[A]),ve=E=>Wt(E,"section",A.components[E]?.label??E),ie=E=>({type:ld(E.type),label:E.name,cover:Ue(eo,{type:E.type}),title:E.desc?`${E.name} \u2014 ${E.desc}`:`Add ${E.name}`,keywords:[E.alias??"",E.desc,E.type,E.catLabel].filter(Boolean)}),pe=ya(()=>{let E=[];if(n&&n.choices.length>0&&mr(n.choices).forEach((F,Y)=>{E.push({title:Y===0?`Inside ${n.parentName}${F.group?` \xB7 ${F.group}`:""}`:F.group??"",tiles:F.items.map(ue=>({type:dd(ue.type),label:ue.label,icon:Ue(be,{type:ue.type,size:18}),title:`Add ${ue.label}`}))})}),s)return E;let J=fa(ae);J&&E.push({title:"Start blank",tiles:[ie(J)]}),te.length>0&&E.push({title:"Your templates",tiles:te.map(F=>({type:cd(F.id),label:F.name,cover:Ue(eo,{type:F.node.type}),keywords:[ve(F.node.type),F.node.type]}))});let W=ga(ae);for(let F of Object.keys(A.categories??{})){let Y=W.filter(ue=>ue.cat===F);Y.length!==0&&E.push({title:si(A,F),tiles:Y.map(ie)})}return E},[n,s,te,ae,A]),ze=E=>{let J=E.indexOf(":"),W=E.slice(0,J),F=E.slice(J+1);if(W==="section")return{kind:"section",type:F};if(W==="block")return{kind:"block",type:F};if(W==="template"){let Y=te.find(ue=>ue.id===F);return Y?{kind:"template",template:Y}:null}return null};return to(pd,{children:[Ue(bt,{icon:Ue(rd,{size:15}),title:"Add",context:s?"Blocks for this place":"Sections and blocks",actions:Ue(_r,{label:"Done",description:"Close Add and go back",onClick:R}),onHide:C}),to("div",{className:"sf-addside sf-scroll",children:[Ue(sd,{groups:pe,session:f,itemFor:E=>u(ze(E)??{kind:"section",type:E}),onInsert:E=>{let J=ze(E);J&&m(J)},at:a,hint:s?"Drag into the page, or click to add.":"Drag onto the page, or click to add.",searchLabel:s?"Search blocks":"Search sections",readOnly:M}),b&&!s?to("div",{className:"sf-addside-sitewide",children:[Ue("span",{className:"sf-addside-sitewide-glyph","aria-hidden":"true",children:Ue(be,{type:"chat",size:16})}),to("button",{type:"button",className:"sf-addside-sitewide-name",onClick:b.onOpenChat,children:["Live chat",Ue("span",{className:"sf-addside-sitewide-desc",children:"A chat bubble on every page"})]}),Ue(ad,{checked:b.chatEnabled,onChange:b.onToggleChat,ariaLabel:"Show the chat bubble on the whole site"})]}):null]})]})}import{useCallback as ud,useEffect as ha,useMemo as ba,useState as At}from"react";import{InspectorIconButton as fd}from"efficient-easel/chrome";import{AddIcon as gd}from"efficient-easel/icons";import{PagesIcon as md}from"efficient-easel/rail";import{jsx as D,jsxs as Re}from"react/jsx-runtime";var yd={cart:Re("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.7,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[D("circle",{cx:"9",cy:"20",r:"1.4"}),D("circle",{cx:"18",cy:"20",r:"1.4"}),D("path",{d:"M2 3h2.2l2.1 12.3a1.6 1.6 0 0 0 1.6 1.3h8.6a1.6 1.6 0 0 0 1.6-1.2L21.5 7H5.3"})]}),checkout:Re("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.7,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[D("rect",{x:"2.5",y:"5",width:"19",height:"14",rx:"2"}),D("path",{d:"M2.5 9.5h19"})]})},va="sf-editor-pages-collapsed-groups",hd=n=>n.toLowerCase().trim().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,""),xa=(n,s)=>{let a=hd(n)||"page";if(!s.has(a))return a;let m=2;for(;s.has(`${a}-${m}`);)m+=1;return`${a}-${m}`};function ai({onNavigate:n,onClose:s,activeSurface:a,onPreviewSurface:m}){let u=_t(),{adapter:f,capabilities:b,ready:R,currentSlug:C}=qt(),M=Xn(),[A,H]=At(null),[te,Ee]=At(""),[ae,ve]=At(!1),[ie,pe]=At(null),[ze,E]=At(!1),[J,W]=At(""),F=ud(async()=>{if(R)try{H(await f.listPages())}catch{H([])}},[f,R]);ha(()=>{H(null),F()},[F]);let[Y,ue]=At(()=>{if(typeof window>"u")return new Set;try{let x=window.localStorage.getItem(va);return new Set(x?JSON.parse(x):[])}catch{return new Set}});ha(()=>{try{window.localStorage.setItem(va,JSON.stringify([...Y]))}catch{}},[Y]);let k=x=>ue(ne=>{let w=new Set(ne);return w.has(x)?w.delete(x):w.add(x),w}),j=ba(()=>js(A??[]),[A]),V=te.trim().toLowerCase(),Q=x=>!V||x.toLowerCase().includes(V),_e=x=>V?!0:!Y.has(x),Ce=ba(()=>new Set((A??[]).map(x=>x.slug)),[A]),ye=()=>{if(b.pageCreationInAdminForm){u.send("storefront-editor:new-page");return}W(""),pe(null),E(!0)},fe=async()=>{let x=J.trim();if(!(!x||!R||ae||!f.createPage)){ve(!0),pe(null);try{let ne=await f.createPage({slug:xa(x,Ce),title:x,layout:{}});await F(),E(!1),W(""),n(ne.slug)}catch{pe("Couldn\u2019t add the page \u2014 please retry.")}finally{ve(!1)}}},G=async x=>{if(!(!R||ae||!f.deletePage||(A??[]).length<=1)){ve(!0);try{await f.deletePage(x.id);let ne=(A??[]).filter(w=>w.id!==x.id);H(ne),pe(null),x.slug===C&&ne[0]&&n(ne[0].slug)}catch{pe("Couldn\u2019t delete the page \u2014 please retry.")}finally{ve(!1)}}},Oe=x=>u.send("storefront-editor:open-page",{slug:x}),ee=x=>{if(!Q(x.label))return null;let ne=!a&&x.slug===C,w=b.canDeletePagesInline&&(A??[]).length>1;return Re("div",{className:`sf-row sf-prow ${ne?"is-selected":""}`,onClick:()=>n(x.slug),children:[D("span",{className:"sf-chip",children:D(bd,{})}),D("span",{className:"sf-row-name",children:x.label}),_s(x)&&D("span",{className:"sf-badge-dynamic",children:"Dynamic"}),x.kind==="lightbox"&&D("span",{className:"sf-badge-lightbox",children:"Lightbox"}),x.draft&&D("span",{className:"sf-page-draft",children:"draft"}),b.pageCreationInAdminForm&&D("button",{type:"button",className:"sf-page-edit",title:`Edit \u201C${x.label}\u201D in the admin`,"aria-label":`Edit ${x.label} in the admin`,onClick:Ye=>{Ye.stopPropagation(),Oe(x.slug)},children:D(We,{name:"pencil",size:13,strokeWidth:1.7,rounded:!0})}),w&&D("button",{type:"button",className:"sf-page-edit sf-page-edit--danger",disabled:ae,title:`Delete \u201C${x.label}\u201D`,"aria-label":`Delete ${x.label}`,onClick:Ye=>{Ye.stopPropagation(),G(x)},children:D(We,{name:"trash",size:13,strokeWidth:1.7,rounded:!0})})]},x.id)},lt=(x,ne,w)=>{let Ye=w.filter(Boolean);if(Ye.length===0)return null;let U=_e(x);return Re("div",{className:"sf-pgroup",children:[Re("button",{type:"button",className:"sf-pgroup-head","aria-expanded":U,onClick:()=>k(x),children:[D(We,{name:"chevron-right",size:10,strokeWidth:2.6,rounded:!0,style:{transform:U?"rotate(90deg)":"none",transition:"transform 0.14s"}}),D("span",{className:"sf-pgroup-label",children:ne}),D("span",{className:"sf-pgroup-count",children:Ye.length})]}),U&&D("div",{className:"sf-pgroup-body",children:Ye})]},x)},xe=gr.filter(x=>Q(x.label)).map(x=>{let ne=a===x.key;return Re("div",{className:`sf-row sf-prow sf-prow--shop ${ne?"is-selected":""}`,onClick:()=>m(x.key),title:`Preview the ${x.label} in the canvas`,children:[D("span",{className:"sf-chip",children:yd[x.key]}),D("span",{className:"sf-row-name",children:x.label}),D("span",{className:"sf-badge-preview",children:"Preview"}),D("a",{className:"sf-page-edit",href:x.href,target:"_blank",rel:"noopener noreferrer",title:`Open the ${x.label} in a new tab`,"aria-label":`Open the ${x.label} in a new tab`,onClick:w=>w.stopPropagation(),children:D(We,{name:"external-link",size:13,strokeWidth:1.7,rounded:!0})})]},x.key)}),he=(()=>{if(A===null)return null;let x=[],ne=!1;for(let w of j)b.hasSiteSettings&&!ne&&w.key.startsWith("system:")&&(x.push(lt("shop","Shop",xe)),ne=!0),x.push(lt(w.key,w.label,w.rows.map(ee)));return b.hasSiteSettings&&!ne&&x.push(lt("shop","Shop",xe)),x})();return Re("div",{className:"sf-pages",children:[D(bt,{icon:D(md,{}),title:"Pages",context:M,actions:D(fd,{label:"New page",onClick:ye,children:D(gd,{size:15})}),onHide:s}),Re("div",{className:"sf-pages-search",children:[D(We,{name:"search",size:14,rounded:!0}),D("input",{type:"search",className:"sf-pages-search-input",placeholder:"Search all pages\u2026",value:te,onChange:x=>Ee(x.target.value),"aria-label":"Search all pages"})]}),Re("div",{className:"sf-pages-list sf-scroll",children:[ie&&!ze&&D("div",{className:"sf-note sf-note--error",role:"alert",children:ie}),he===null?D("div",{className:"sf-note",children:"Loading\u2026"}):he.some(Boolean)?he:D("div",{className:"sf-note",children:te.trim()?"No pages match your search":"No pages yet"})]}),Re("button",{type:"button",className:"sf-pages-new",onClick:ye,children:[D("span",{className:"sf-plus",children:"+"}),"New page"]}),ze&&D("div",{className:"fixed inset-0 z-[200] flex items-center justify-center bg-black/30 p-4",role:"dialog","aria-modal":"true","aria-labelledby":"sf-add-page-title",onClick:()=>E(!1),children:Re("div",{className:"w-full max-w-sm rounded-lg bg-white p-5 shadow-xl",onClick:x=>x.stopPropagation(),children:[D("h2",{id:"sf-add-page-title",className:"text-[15px] font-semibold text-zinc-900",children:"Add a page"}),D("p",{className:"mt-1 text-[13px] leading-relaxed text-zinc-600",children:"Give the new template page a name. It starts blank \u2014 add sections once it opens."}),D("input",{autoFocus:!0,value:J,onChange:x=>W(x.target.value),onKeyDown:x=>{x.key==="Enter"&&fe(),x.key==="Escape"&&E(!1)},placeholder:"e.g. About",className:"mt-3 w-full rounded-md border border-zinc-300 px-3 py-2 text-[13px] text-zinc-900 outline-none focus:border-blue-500"}),J.trim()&&Re("p",{className:"mt-1.5 text-[12px] text-zinc-400",children:["URL: /",xa(J,Ce)]}),ie&&D("p",{className:"mt-2 text-[12px] text-red-600",role:"alert",children:ie}),Re("div",{className:"mt-4 flex justify-end gap-2",children:[D("button",{type:"button",onClick:()=>E(!1),className:"rounded-md border border-zinc-300 px-3 py-[7px] text-[13px] font-medium text-zinc-700 transition-colors hover:bg-zinc-100",children:"Cancel"}),D("button",{type:"button",onClick:()=>{fe()},disabled:ae||!J.trim(),className:"rounded-md bg-blue-600 px-3 py-[7px] text-[13px] font-medium text-white transition-colors hover:bg-blue-700 disabled:opacity-60",children:ae?"Adding\u2026":"Add page"})]})]})})]})}function bd(){return Re("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.7,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[D("path",{d:"M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"}),D("path",{d:"M14 3v5h5"})]})}import{StylesIcon as vd}from"efficient-easel/rail";import{jsx as vn,jsxs as xd}from"react/jsx-runtime";function li({tokenRef:n,siteId:s,onClose:a,onNotify:m,tab:u,onTabChange:f}){let b=Xn();return xd("div",{className:"sf-styles",children:[vn(bt,{icon:vn(vd,{}),title:"Site styles",context:vn("span",{title:`${b} \u2014 renamed in the Console: Storefront \u25B8 Sites \u25B8 Settings.`,children:b}),onHide:a}),vn("div",{className:"sf-insp-body sf-scroll",children:vn(Ur,{tokenRef:n,siteId:s,onNotify:m,tab:u,onTabChange:f})})]})}import{useEffect as ka,useMemo as Cd,useRef as wa,useState as Td}from"react";import{useTreeDrag as Id}from"efficient-easel/drag";import{useCallback as Sd,useEffect as kd,useState as wd}from"react";function Sa(n,s,a=!0){let[m,u]=wd(null),f=Sd(async()=>{let b=n.current;if(b)try{u(await Vn.listPages(b,s))}catch{u([])}},[n,s]);return kd(()=>{if(!a||m!==null)return;if(n.current){f();return}let b=setInterval(()=>{n.current&&(clearInterval(b),f())},300);return()=>clearInterval(b)},[a,m,f,n]),{pages:m,reload:f}}import{jsx as Z,jsxs as Qe}from"react/jsx-runtime";var Ca=n=>n===Fe||n===oe;function Pd(n,s){return(n??[]).map((a,m)=>({id:String(a.props?.id??`${a.type}-${m}`),type:a.type,label:s(a.type),hidden:!!a.props?._hidden,pinned:Ca(a.type)}))}function Rd(n,s,a){if(s===a||s<0||s>=n.length)return null;let m=n[0]?.type===Fe?1:0,u=n[n.length-1]?.type===oe?n.length-1:n.length;if(s<m||s>=u)return null;let f=Math.max(m,Math.min(a,u)),b=n.slice(),[R]=b.splice(s,1);return b.splice(f>s?f-1:f,0,R),b.every((C,M)=>C===n[M])?null:b}function di({tokenRef:n,siteId:s,currentSlug:a,liveContent:m,labelForType:u,onOpenPage:f,onClose:b,pages:R}){let C=_t(),{pages:M,reload:A}=Sa(n,s,R===void 0),H=R??M;ka(()=>{let k=j=>{j.key==="Escape"&&b()};return document.addEventListener("keydown",k),()=>document.removeEventListener("keydown",k)},[b]),ka(()=>{let k=document.activeElement;return ae.current?.focus(),()=>k?.focus?.()},[]);let[te,Ee]=Td({}),ae=wa(null),ve=wa({}),ie=Cd(()=>H?qs(H.filter(k=>k.slug!==pn)):[],[H]),pe=k=>{if(k.slug===a)return m;if(te[k.id])return te[k.id];let j=k.layout?.content;return Array.isArray(j)?j:[]},ze=k=>Ee(j=>{let{[k]:V,...Q}=j;return Q}),E=(k,j,V)=>{let Q=n.current;if(!Q)return;let _e=Rd(pe(k),j,V);if(!_e)return;Ee(ye=>({...ye,[k.id]:_e}));let Ce=Zs({...k.layout,content:_e});Vn.saveLayout(k.id,Ce,Q,ve.current[k.id]??k.updated_at??"").then(ye=>(ye?.updated_at&&(ve.current[k.id]=ye.updated_at),A())).then(()=>ze(k.id)).catch(()=>{delete ve.current[k.id],ze(k.id),A()})},J=(k,j)=>{if(k.slug===a)return!1;let V=pe(k)[j]?.type;return V!==void 0&&!Ca(V)},W=Id({keyOf:k=>`${k.pageId}:${k.index}`,canDrop:(k,j)=>j.parentId===k.pageId,onDrop:(k,j)=>{let V=H?.find(Q=>Q.id===k.pageId);V&&E(V,k.index,j.index)},onStep:(k,j)=>{let V=H?.find(Q=>Q.id===k.pageId);V&&E(V,k.index,j<0?k.index-1:k.index+2)}}),F=()=>C.send("storefront-editor:new-page"),Y=k=>C.send("storefront-editor:open-page",{slug:k}),ue=k=>{let j=k.slug===a,V=Pd(pe(k),u);return Qe("div",{className:`sf-sm-card ${j?"is-open":""}`,children:[Qe("div",{className:"sf-sm-card-head",children:[Z("button",{type:"button",className:"sf-sm-card-title",title:`Open \u201C${un(k)}\u201D`,onClick:()=>f(k.slug),children:Z("span",{className:"sf-sm-card-name",children:un(k)})}),!k.is_published&&Z("span",{className:"sf-sm-draft",children:"Draft"}),Z("button",{type:"button",className:"sf-sm-edit",title:`Edit \u201C${un(k)}\u201D in the admin`,"aria-label":`Edit ${un(k)} in the admin`,onClick:()=>Y(k.slug),children:Z(We,{name:"pencil",size:13,strokeWidth:1.7,rounded:!0})})]}),Z("div",{className:"sf-sm-secs",children:V.length===0?Z("div",{className:"sf-sm-empty",children:"No sections yet"}):V.map((Q,_e)=>{let Ce=J(k,_e),ye=W.row({item:{pageId:k.id,index:_e},place:{parentId:k.id,slot:"content",index:_e},canDrag:Ce}),fe=ye.drop==="before"&&!ye.dragging,G=ye.drop==="after"&&!ye.dragging;return Qe("div",{className:`sf-sm-sec ${Q.hidden?"is-hidden":""} ${Q.pinned?"is-pinned":""} ${ye.dragging?"is-dragging":""} ${fe?"is-over-before":""} ${G?"is-over-after":""}`,...Ce?ye.rowProps:{},title:Ce?"Drag to reorder \xB7 \u2325\u2191 \u2325\u2193":Q.pinned?"Pinned":"Open in the editor to reorder",children:[Ce&&Z("button",{type:"button",className:"sf-sm-grip","aria-label":`Reorder ${Q.label} \u2014 drag the row, or press Alt+\u2191 / Alt+\u2193`,"aria-keyshortcuts":"Alt+ArrowUp Alt+ArrowDown",title:"Drag to reorder \xB7 \u2325\u2191 \u2325\u2193",onClick:Oe=>Oe.stopPropagation(),children:"\u22EE\u22EE"}),Z("span",{className:"sf-sm-sec-chip",children:Z(be,{type:Q.type,size:13})}),Z("span",{className:"sf-sm-sec-name",children:Q.label}),Q.hidden&&Z("span",{className:"sf-sm-sec-eye",title:"Hidden",children:Z(We,{name:"eye-off",size:13,rounded:!0})})]},Q.id)})}),j&&Z("div",{className:"sf-sm-editing",children:"Editing here"})]},k.id)};return Qe("div",{className:"sf-sitemap",role:"dialog","aria-modal":"true","aria-label":"Visual sitemap",tabIndex:-1,ref:ae,children:[Qe("div",{className:"sf-sm-head",children:[Z("span",{className:"sf-sm-title",children:"Visual sitemap"}),Qe("div",{className:"sf-sm-head-actions",children:[Qe("button",{type:"button",className:"sf-sm-newpage",onClick:F,children:[Z("span",{className:"sf-plus","aria-hidden":"true",children:"+"})," New page"]}),Z("button",{type:"button",className:"sf-x",title:"Close sitemap","aria-label":"Close sitemap",onClick:b,children:"\u2715"})]})]}),Z("div",{className:"sf-sm-body sf-scroll",children:H===null?Z("div",{className:"sf-note",children:"Loading\u2026"}):ie.length===0?Z("div",{className:"sf-note",children:"No pages yet"}):ie.map(({key:k,group:j,pages:V})=>Qe("section",{className:"sf-sm-group",children:[Z("div",{className:"sf-sm-group-title",children:j??Ws}),Qe("div",{className:"sf-sm-grid",children:[V.map(ue),!j&&Qe("button",{type:"button",className:"sf-sm-addcard",onClick:F,children:[Z("span",{className:"sf-sm-addcard-plus","aria-hidden":"true",children:"+"}),Z("span",{children:"New page"})]})]})]},k))})]})}import{useEasel as Dd}from"efficient-easel/easel";function Ed(n){return n.replace(/<[^>]+>/g," ").replace(/\s+/g," ").trim()}function Ad(n){let s=[],a=/<h([1-6])\b[^>]*>([\s\S]*?)<\/h\1>/gi,m;for(;m=a.exec(n);)s.push({level:Number(m[1]),text:Ed(m[2])||"(empty)"});return s}var Nd=new Set(["SubmitBuild"]),Ld={AlloyWheelsListing:1,DocMasthead:1,AppointmentBooking:2,BookingBox:2,SubmitBox:2,Banner:2,BundleOffer:2,Cards:2,Chart:2,CheckoutCTA:2,CollectionCard:3,Collections:2,CompatibleTyres:2,ContactLocations:2,ContactRouting:2,DeliveryOptions:2,DetailRows:2,DocBody:2,EuTyreLabel:2,Events:2,FAQ:2,FeaturedCover:2,FitmentFinder:2,FitmentTable:2,FooterEmailSignup:4,FooterMenu:4,Footprint:2,Form:2,Gallery:2,GalleryB:2,GalleryItem:2,Integrations:2,IntroBleed:2,KeyFeatures:2,Logos:2,LongRead:2,Manifesto:2,Mockup:2,OrderSummary:2,PostCard:2,ProcessSteps:2,ProductGrid:2,Prose:2,RelatedProducts:2,ReviewForm:2,Reviews:2,SectionHeader:2,Series:2,SpecTable:2,Split:2,StatsParagraph:2,SubmitBuild:2,Subscribe:2,SubscribeBlogs:2,Testimonials:2,Timeline:2,TimelineTrack:2,TitleWithButtons:2,TyreFitment:2,TyreSizes:2};function ci(n,s){let a=[];for(let m of n??[]){let u=m,f=u.props??{};switch(u.type){case"Heading":{let{text:b,hidden:R}=qn(f.text);if(R)break;a.push({level:Number(f.level)||2,text:b||"(empty heading)"})}break;case"Hero":a.push({level:1,text:"Hero (brand headline)"});break;case"CustomHTML":a.push(...Ad(qn(f.html).text));break;default:{let b=Ld[u.type??""],R=qn(f.title??f.heading),C=R.text.trim();if(!b||R.hidden)break;C?a.push({level:b,text:C}):Nd.has(u.type??"")&&a.push({level:b,text:String(u.type)});break}}for(let b of jn(s,u.type??"")){let R=f[b];Array.isArray(R)&&a.push(...ci(R,s))}}return a}import{jsx as Gt,jsxs as no}from"react/jsx-runtime";function pi(){let{appState:n,config:s}=Dd(f=>f),a=n?.data,m=ci(a?.content??[],s),u=m.filter(f=>f.level===1).length;return no("div",{className:"px-4 py-3 text-[13px] text-zinc-600",children:[no("div",{className:"mb-2 flex items-center justify-between text-[11px] font-semibold uppercase tracking-wide text-zinc-500",children:[Gt("span",{children:"Heading outline"}),Gt("span",{children:m.length})]}),u!==1&&Gt("div",{className:"mb-2 rounded bg-amber-50 px-2 py-1 text-[12px] text-amber-700",children:u===0?"No H1 \u2014 add one for SEO.":`${u} H1s \u2014 a page should have exactly one.`}),m.length===0?Gt("p",{className:"text-zinc-400",children:"No headings yet."}):Gt("ul",{className:"space-y-1",children:m.map((f,b)=>no("li",{className:"flex items-baseline gap-2",style:{paddingLeft:`${(f.level-1)*12}px`},children:[no("span",{className:"shrink-0 font-mono text-[11px] text-zinc-400",children:["H",f.level]}),Gt("span",{className:"truncate text-zinc-700",children:f.text})]},b))})]})}var zd=new Set(["BookingBox","SubmitBox"]);function Kt(n){return typeof n=="string"&&zd.has(n)}import{useCallback as Ta,useState as Od}from"react";import{EaselContextMenu as Bd}from"efficient-easel/menu";import{AddIcon as Md,CopyIcon as Ia,LayersIcon as Hd,PasteIcon as Ra,RedoIcon as $d,SettingsIcon as Fd,UndoIcon as Wd}from"efficient-easel/icons";import{ROOT_ID as _d,ROOT_SLOT as qd,zoneKey as Ea}from"efficient-easel/data";import{createNodeClipboard as jd,nodeMenuItems as Vd}from"efficient-easel/node-ops";import{styleMenuItems as Gd}from"efficient-easel/style-clipboard";import{framePointToHost as Kd,useCanvasEvent as ui}from"efficient-easel/canvas";import{jsx as et}from"react/jsx-runtime";function Ud(n,s){let a=[],m=new Set,u={zone:s.zone,index:s.index};for(;u;){let f=n.nodeAt(u.zone,u.index);if(!f||m.has(f.props.id)||(m.add(f.props.id),a.push({zone:u.zone,index:u.index,node:f,parentType:null}),u.zone===P))break;let b=u.zone.lastIndexOf(":");if(b<=0)break;u=n.locate(u.zone.slice(0,b))}for(let f=0;f<a.length-1;f+=1)a[f].parentType=a[f+1].node.type;return a}var Aa=jd();function Na(n,s,a){if(s===P){let{floor:u,cap:f}=n.sectionBand();return{parentId:_d,slot:qd,index:Math.min(Math.max(a,u),f)}}let m=s.lastIndexOf(":");return{parentId:s.slice(0,m),slot:s.slice(m+1),index:a}}function Yd(n,s){let{zone:a,index:m}=s,u=n.nodeAt(a,m);if(!u)return[];let f=u.props.id,b=n.labelOf(u.type,a),R=!!u.props._hidden,C=n.nodeOps,M=n.isPinned(u,a),A=Kt(u.type),H=!M&&!A&&!Hs(n.document,u),te=Ud(n,s),Ee=C.held,ae=Ee&&!M&&Ea(Ee.from)===a?Na(n,a,m+1):null,ve=n.style?Gd({held:n.style.held(),canCopy:n.style.canCopy(u,a),onCopy:()=>n.style?.copy(u,a),onPaste:()=>n.style?.paste(a,m,u)}):[];return Vd({title:b,layer:{group:"pick",items:te.map((ie,pe)=>({label:n.rowNameOf(ie.node,ie.zone),checked:pe===0,onClick:()=>n.selectAt(ie.zone,ie.index,ie.node.props.id,ie.parentType)}))},actions:{addInside:Pe(u.type)?()=>n.openAddInside(a,m):void 0,duplicate:H?()=>C.duplicate(f):void 0,moveUp:C.canStep(f,-1)?()=>C.step(f,-1):void 0,moveDown:C.canStep(f,1)?()=>C.step(f,1):void 0,copy:M?void 0:()=>C.copy(f,b),cut:H?()=>C.cut(f,b):void 0,paste:Ee&&ae?{label:Ee.label,run:()=>C.paste(ae)}:void 0,rename:n.renamePropOf(u,a)?()=>n.beginRename(a,m):void 0,hide:!A&&!M?{hidden:R,run:()=>C.setProps(f,{_hidden:!R})}:void 0,delete:H?()=>C.remove(f):void 0},style:ve,pinnedLine:M?"Pinned \u2014 can\u2019t be moved or deleted":void 0})}function Xd(n){let s=[];n.history.hasPast&&s.push({label:"Undo",icon:et(Wd,{}),shortcut:"\u2318Z",onClick:n.history.back}),n.history.hasFuture&&s.push({label:"Redo",icon:et($d,{}),shortcut:"\u21E7\u2318Z",onClick:n.history.forward});let a=[{label:"Add section",icon:et(Md,{}),onClick:n.openAddSection}],m=n.nodeOps.held;if(m&&Ea(m.from)===P){let R=Na(n,P,n.sectionBand().cap);a.push({label:`Paste ${m.label}`,icon:et(Ra,{}),shortcut:"\u2318V",onClick:()=>n.nodeOps.paste(R)})}let u=[{label:"Page settings",icon:et(Fd,{}),onClick:n.openPageSettings},{label:"Collapse all layers",icon:et(Hd,{}),onClick:n.collapseAll}],f=[s,a,u].filter(R=>R.length>0),b={label:"\u2014",onClick:()=>{}};return f.flatMap((R,C)=>C?[b,...R]:R)}function Zd(n,s){let a=s.selectionStart??0,m=s.selectionEnd??0,u=s.value.slice(a,m),f=A=>{s.focus(),s.setRangeText(A,a,m,"end"),s.dispatchEvent(new Event("input",{bubbles:!0}))},b=[];u&&(b.push({label:"Copy",icon:et(Ia,{}),shortcut:"\u2318C",onClick:()=>navigator.clipboard?.writeText(u)}),b.push({label:"Cut",icon:et(Ia,{}),shortcut:"\u2318X",onClick:()=>{navigator.clipboard?.writeText(u),f("")}})),b.push({label:"Paste",icon:et(Ra,{}),shortcut:"\u2318V",onClick:()=>{navigator.clipboard?.readText().then(A=>{A&&f(A)}).catch(()=>n.onPasteRefused())}});let R=s.value?[{label:"Select all",shortcut:"\u2318A",onClick:()=>{s.focus(),s.select()}}]:[],C=[b,R].filter(A=>A.length>0),M={label:"\u2014",onClick:()=>{}};return C.flatMap((A,H)=>H?[M,...A]:A)}function Jd(n){let s=n?.closest?.("input, textarea");return!s||s instanceof HTMLInputElement&&!["text","search","url","email","tel","number",""].includes(s.type)?null:s}function Pa(n){return n.shiftKey}function La(n,s){let[a,m]=Od(null),u=Ta(()=>m(null),[]),f=Ta(C=>{if(Pa(C))return;let M=C.target,A=Jd(M);if(A){C.preventDefault(),m({kind:"input",x:C.clientX,y:C.clientY,el:A});return}let H=M?.closest?.("[data-node-id]")?.getAttribute("data-node-id"),te=H?n.locate(H):null;C.preventDefault(),m(te?{kind:"node",x:C.clientX,y:C.clientY,...te}:{kind:"empty",x:C.clientX,y:C.clientY})},[n]);ui(s,"contextmenu",C=>{if(Pa(C)||!s)return;let A=(C.target?.closest?.("[data-puck-component]")??null)?.getAttribute("data-puck-component"),H=A?n.locate(A):null;C.preventDefault();let te=Kd(s.frame,C.clientX,C.clientY);m(H?{kind:"node",...te,...H}:{kind:"empty",...te})}),ui(s,"mousedown",u),ui(s,"scroll",u,{on:"window"});let R=a?et(Bd,{x:a.x,y:a.y,items:a.kind==="node"?Yd(n,a):a.kind==="input"?Zd(n,a.el):Xd(n),onClose:u}):null;return{onEditorContextMenu:f,menu:R,closeMenu:u}}function Da(n,s){let a=!1,m={...n.props};for(let u of s){let f=Array.isArray(n.props[u])?n.props[u]:[],b=new Set,R=f.filter(C=>{let M=C?.props?.id;return!M||b.has(M)?!1:(b.add(M),!0)});R.length!==f.length&&(m[u]=R,a=!0)}return a?m:null}var Qd=".es-tree",ec=".es-tree-row.is-selected";function za(n,s,a){return!n||!s?!1:n.index===s.index&&(n.zone??a)===(s.zone??a)}function tc(n,s){if(typeof n.getBoundingClientRect!="function"||typeof s.getBoundingClientRect!="function")return!1;let a=n.getBoundingClientRect(),m=s.getBoundingClientRect();return!a.height||!m.height?!1:m.top>=a.top&&m.bottom<=a.bottom}function Oa(n=typeof document>"u"?void 0:document){let s=n?.querySelector(Qd),a=s?.querySelector(ec);return a?(tc(s,a)||a.scrollIntoView({block:"center",inline:"nearest"}),!0):!1}function Ba(n,s){return n.kind==="part"?n.nodeId??null:n.kind!=="puck"||s==null?null:String(s)}import{useEffect as Ha,useState as $a}from"react";var nc=/^(localhost|(?:[a-z0-9-]+\.)+localhost|127(?:\.\d{1,3}){3}|0\.0\.0\.0|\[::1\]|::1)$/i;function fi(n){return!!n&&nc.test(n)}function Ma(n){let{pageSlug:s,siteSlug:a,hostname:m}=n,u=s===Fs?"/":`/${encodeURIComponent(s)}`;if(!fi(m))return u;let f=a?.trim();return f?`${u}?site=${encodeURIComponent(f)}`:u}function Fa(n){let{pageSlug:s,siteId:a,token:m}=n,[u,f]=$a(null),[b,R]=$a(null),C=$s();Ha(()=>R(C?new URL(C).hostname:window.location.hostname),[C]),Ha(()=>{if(!fi(b)||!a||!m){f(null);return}let A=!1;return Wr(m,a).then(H=>{A||f(H)}),()=>{A=!0}},[b,a,m]);let M=Ma({pageSlug:s,siteSlug:u,hostname:b});return C?`${C}${M}`:M}var Wa="sf-editor-left-view";function _a(){if(typeof window>"u")return"pages";try{let n=window.localStorage.getItem(Wa);return n==="sections"||n==="styles"||n==="media"?n:"pages"}catch{return"pages"}}function qa(n){if(!(typeof window>"u"))try{window.localStorage.setItem(Wa,n)}catch{}}function ja(n,s,a=!1){return n==="styles"&&!s||n==="media"&&!a?"sections":n}function Va(n,s){return n?"sections":s}import{jsx as Ga}from"react/jsx-runtime";var oc="M6 3h12a1 1 0 0 1 1 1v17l-7-4-7 4V4a1 1 0 0 1 1-1z";function gi({size:n=15,className:s,strokeWidth:a=1.7}){return Ga("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round",className:s,"aria-hidden":"true",focusable:"false",children:Ga("path",{d:oc})})}var ic="Save your page changes first";function Ka(n){return n.hasTrustedConsole?n.canCreatePlatformTemplate?!n.capabilities.canPublish||!n.capabilities.hasSiteSettings?{visible:!1,hiddenReason:"not-a-site-page"}:n.siteId?n.hasUnsavedEdits?{visible:!0,enabled:!1,disabledReason:ic}:{visible:!0,enabled:!0}:{visible:!1,hiddenReason:"no-site"}:{visible:!1,hiddenReason:"not-operator"}:{visible:!1,hiddenReason:"no-console"}}var Ua="storefront-editor:save-as-template";import{heldStyle as zc,styleShortcut as Oc}from"efficient-easel/style-clipboard";import{BLOCK_SELECTOR as Bc,useCanvasEvent as Mc,useCanvasFrame as Hc}from"efficient-easel/canvas";import{createNode as $c,DataError as Fc,newId as Wc,parseZoneKey as xt,ROOT_ID as _c,ROOT_SLOT as qc,zoneKey as tt}from"efficient-easel/data";import{CanvasDragLayer as jc,createDragSession as Vc,gapToMoveIndex as Gc,useTreeDrag as vi}from"efficient-easel/drag";import{toItemSelector as Kc,useNodeOps as Uc}from"efficient-easel/node-ops";import{useEasel as Yc,useEaselApi as Xc}from"efficient-easel/easel";import{fieldKind as sc,STYLE_KIND as Ya,copyStyle as rc,heldStyle as ac,pasteMessage as lc,planPaste as dc}from"efficient-easel/style-clipboard";var cc=new Set([Gn.Style,Gn.Layout]),pc=new Set(Object.values(Gn)),uc=new Set(Object.keys(ar())),fc=new Set(["focal","imageFocal"]),gc=[lr,Ls,Ds];function Xa(n){return`site:${n??""}`}function mc(n){if(!n||typeof n!="object")return null;let s=n,a=Mo(n)??n,m=s[Ya]??a[Ya];if(typeof m=="string")return m;let u=s.options??a.options;return Array.isArray(u)?`choice:${u.map(b=>String(b?.value)).sort().join("|")}`:sc(a)}function yc(n){let s=n,a=Mo(n);return gc.some(m=>m in s||a&&m in a)}function oo(n,s){let a=Xr(n,s)??{},m=[],u=!1;for(let[f,b]of Object.entries(a)){if(pc.has(f)){u=cc.has(f);continue}!u||!b||typeof b!="object"||f.startsWith("_")||rr(b)||uc.has(f)||fc.has(f)||yc(b)||b.type!=="slot"&&m.push({path:[f],kind:mc(b),counted:or(b)?.tier!=="mobile"})}return m}function mi(n,s,a,m){rc({scope:s,type:a.type,label:m,rows:oo(n,a),props:a.props})}function Za(n,s,a,m){let u=ac(s);if(!u)return null;let f=dc(u,{type:a.type,rows:oo(n,a),props:a.props});return{...f,message:lc(f,u.sourceLabel,m)}}import{Fragment as me,jsx as c,jsxs as N}from"react/jsx-runtime";function Zc({saveState:n,notSaving:s,onToggle:a,onRetry:m}){if(s)return c(nl,{tone:n.pending?"off-unsaved":"off",label:"Not saving \u2014 see the notice above",role:"status"});let{tone:u,label:f}=Dc(n);return N(me,{children:[c(Tc,{pressed:n.paused,onToggle:a,title:n.paused?"Auto-save is off \u2014 click to turn it back on (saves your held edits)":"Auto-save is on \u2014 click to pause it",children:c(nl,{tone:u,label:f})}),n.failed&&!n.paused&&c("button",{type:"button",className:"es-btn-ghost",onClick:m,children:"Retry now"})]})}function Jc(){return N("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.7,strokeLinecap:"round",strokeLinejoin:"round",children:[c("path",{d:"M12 3a9 9 0 0 0 0 18 2.3 2.3 0 0 0 2.3-2.3c0-.55-.22-1.05-.57-1.42-.34-.37-.56-.87-.56-1.43A2.35 2.35 0 0 1 15.6 13.5H18a3 3 0 0 0 3-3c0-4.14-4-7.5-9-7.5z"}),c("circle",{cx:"7.7",cy:"11.3",r:"1.05",fill:"currentColor",stroke:"none"}),c("circle",{cx:"12",cy:"8",r:"1.05",fill:"currentColor",stroke:"none"}),c("circle",{cx:"16",cy:"11",r:"1.05",fill:"currentColor",stroke:"none"})]})}function Qc({size:n=13}){return N("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.7,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[c("circle",{cx:"12",cy:"12",r:"9"}),c("path",{d:"M3 12h18M12 3c2.6 2.6 2.6 15.4 0 18M12 3c-2.6 2.6-2.6 15.4 0 18"})]})}function ep({size:n=13}){return N("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.7,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[c("path",{d:"M12 21s6-5 6-10a6 6 0 10-12 0c0 5 6 10 6 10z"}),c("circle",{cx:"12",cy:"11",r:"2"})]})}function tp({size:n=13}){return N("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.7,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[c("path",{d:"M9 4 3 6.5v13L9 17l6 3 6-2.5v-13L15 7z"}),c("path",{d:"M9 4v13M15 7v13"})]})}function np({expand:n}){return c("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.9,strokeLinecap:"round",strokeLinejoin:"round",children:n?N(me,{children:[c("path",{d:"M8 9l4-4 4 4"}),c("path",{d:"M8 15l4 4 4-4"})]}):N(me,{children:[c("path",{d:"M8 4l4 4 4-4"}),c("path",{d:"M8 20l4-4 4 4"}),c("path",{d:"M5 12h14"})]})})}var ro=n=>({parentId:`locations-${n}`,slot:"groups"}),xi=(n,s)=>({parentId:`locations-${n}`,slot:`cities:${s}`});function op(n,s){if(n.length!==s.length)return!1;for(let a=0;a<n.length;a++)if(n[a].top!==s[a].top||n[a].index!==s[a].index)return!1;return!0}function ip(){let n=_t(),{adapter:s,capabilities:a,templateId:m,currentSlug:u,siteId:f,tokenRef:b,onPublish:R,saveStatus:C,saveState:M,saveConflict:A,retrySave:H,hasUnsavedEdits:te,bridgeCapabilities:Ee,notifyParent:ae,token:ve,toggleAutoSave:ie,navigate:pe,docId:ze,data:E,footerOriginSlug:J,readOnly:W}=qt(),{canPublish:F,hasSiteSettings:Y,hasSiteTheme:ue,mediaEditing:k,hasEditGuard:j,hasPinnedChrome:V,explainsSiteSettings:Q,hasPreviewLink:_e}=a,Ce=Ka({hasTrustedConsole:!!ve,canCreatePlatformTemplate:Ee.canCreatePlatformTemplate,capabilities:a,siteId:f,hasUnsavedEdits:te}),ye=De(()=>{!f||!u||ae(Ua,{siteId:f,slug:u})},[ae,f,u]),{appState:fe,dispatch:G,history:Oe,selectedItem:ee,getSelectorForId:lt,config:xe}=Yc(e=>e),he=u===pn,x=Ms({readOnly:W}),ne=de(null),w=yi(()=>({...x,select:e=>{ne.current=e,x.select(e)}}),[x]),Ye=fe.ui,U=Ye.leftSideBarVisible,St=Ye.rightSideBarVisible,[kt,il]=ce("desktop"),Yt=Js(),Si=k&&Yt!==null,qe=Qs(),[Nt,xn]=ce(_a),[sl,ki]=ce(Kr[0].id),wt=ja(Nt,ue,Si);$(()=>{qa(Nt)},[Nt]);let[ao,Ct]=ce(!1),[wi,rl]=ce(0),{surface:al,setSurface:Ci}=fr(),lo=de(null),Xt=de(null),nt=Hc(Xt,{readySelector:Bc}),Be=na(Xt);oa(Xt);let[Ae,Zt]=ce(!1),dt=de(!1),ct=de(!1),[K,ot]=ce(null),Sn=K&&K.zone===P?K.index:null,Ti=e=>ot(e===null?null:{zone:P,index:e}),[Ii,Pi]=ce([]),[je,le]=ce(Le),co=je.kind==="puck",po=je.kind==="ticker"?je.heroId:null,Lt=Ba(je,ee?.props.id),pt=de(null),uo=de(null),[Ri,Ei]=ce(null);$(()=>{Ri&&(Oa(),Ei(null))},[Ri]);let Ai=de(lt);Ai.current=lt;let kn=De((e,{scroll:o})=>{xn(p=>Va(e,p)),o&&Ei(e);let r=[],l=e;for(let p=0;p<4;p++){let g=Ai.current(l)?.zone;if(!g||!g.includes(":"))break;let h=g.split(":")[0];r.push(h),l=h}r.length!==0&&Tn(p=>{if(r.every(h=>!p.has(h)))return p;let g=new Set(p);return r.forEach(h=>g.delete(h)),g})},[]);$(()=>{le(ee?.type===Fe?Jn:Le),$r(ee?.type==="BookingBox"&&ee.props.region==="confirm"?Fr(lt(String(ee.props.id))?.zone):null);let e=ee?.type==="ContactLocations"?String(ee.props.id):null;e&&e!==uo.current&&Ke({level:"groups"}),uo.current=e;let o=ee?.props.id;he&&typeof o=="string"&&(pt.current?.(),pt.current=Yn(o));let r=ne.current;if(ne.current=null,!o)return;let l=lt(o);kn(String(o),{scroll:!za(r,l??null,P)})},[ee?.props.id,he,kn]);let{setSelected:Ni,setSelectHandler:Li}=tr(),{chat:ll,setChat:dl,setSelected:Di,setSelectHandler:zi}=ur(),{setSelectedHeroId:Oi,setSelectHandler:Bi}=Ar(),{editFooter:Mi}=Hr(),{selectedLocationPartId:cl,setSelectedLocationPartId:Hi,setSelectHandler:$i}=Nr(),Fi=je.kind==="header";$(()=>{Ni(Fi)},[Fi,Ni]),$(()=>{Li(()=>{le(Jn),G({type:"setUi",ui:{rightSideBarVisible:!0}})})},[Li,G]);let fo=De(()=>{le(e=>e.kind==="chat"?e:Jr),G({type:"setUi",ui:{rightSideBarVisible:!0}})},[G]),Wi=je.kind==="chat";$(()=>{Di(Wi)},[Wi,Di]),$(()=>{zi(fo)},[zi,fo]);let{setOpenHandler:_i}=zr(),qi=De(()=>{le(e=>e.kind==="social"?e:Qr),G({type:"setUi",ui:{rightSideBarVisible:!0}})},[G]);$(()=>{_i(qi)},[_i,qi]);let wn=De(e=>{e&&(le(o=>o.kind==="ticker"&&o.heroId===e?o:{kind:"ticker",heroId:e}),G({type:"setUi",ui:{rightSideBarVisible:!0}}),Vt(e))},[G]);$(()=>{Oi(po)},[po,Oi]),$(()=>{Bi(wn)},[Bi,wn]);let pl=De(e=>{G({type:"setUi",ui:{rightSideBarVisible:!0}}),Vt(e),kn(e,{scroll:!0})},[G,kn]),{selectNode:ul,openPartId:sp}=ta({mode:je,setMode:le,onOpenPart:pl}),[ji,Vi]=ce(null),Gi="sf-editor-collapsed-sections",[Cn,Tn]=ce(()=>{if(typeof window>"u")return new Set;try{let e=window.localStorage.getItem(Gi);return new Set(e?JSON.parse(e):[])}catch{return new Set}});$(()=>{try{window.localStorage.setItem(Gi,JSON.stringify([...Cn]))}catch{}},[Cn]);let[Dt,fl]=ce(()=>{if(typeof window>"u")return{...vt};try{let e=window.localStorage.getItem(Xo);if(!e)return{...vt};let o=JSON.parse(e);return{left:Zo(Number(o.left)||vt.left),right:Zo(Number(o.right)||vt.right)}}catch{return{...vt}}});$(()=>{let e=setTimeout(()=>{try{window.localStorage.setItem(Xo,JSON.stringify(Dt))}catch{}},300);return()=>clearTimeout(e)},[Dt]);let In=De((e,o)=>fl(r=>{let l=typeof o=="function"?o(r[e]):o;return r[e]===l?r:{...r,[e]:l}}),[]),gl=De(e=>In("left",e),[In]),ml=De(e=>In("right",e),[In]),Tt=e=>Cn.has(e),ut=e=>Tn(o=>{let r=new Set(o);return r.has(e)?r.delete(e):r.add(e),r}),Ki=de(!1),go=de(null);$(()=>{if(Ki.current&&!Ae){let e=go.current;((e&&e.isConnected&&!e.closest('[aria-hidden="true"]')?e:null)??Xt.current?.querySelector('button[aria-label="Add"]'))?.focus(),go.current=null}Ki.current=Ae},[Ae]),$(()=>{if(!Ae||!Be)return;let e=o=>{o.key==="Escape"&&On()};return Be.addEventListener("keydown",e),()=>Be.removeEventListener("keydown",e)},[Ae,Be]),$(()=>{U||!Ae||(Zt(!1),ot(null),dt.current=!1)},[U]),$(()=>{if(!qe){ct.current&&G({type:"setUi",ui:{leftSideBarVisible:!1}}),ct.current=!1;return}Ae&&(Zt(!1),ot(null),ct.current=dt.current,dt.current=!1),Ct(!1),U||(ct.current=!0,G({type:"setUi",ui:{leftSideBarVisible:!0}}))},[qe]),$(()=>{U||!qe||(ct.current=!1,fn())},[U]),$(()=>{if(!qe||!Be)return;let e=o=>{o.key==="Escape"&&fn()};return Be.addEventListener("keydown",e),()=>Be.removeEventListener("keydown",e)},[qe,Be]);let[Pn,Ui]=ce(null),[yl,hl]=ce(0),Jt=de(null),It=(e,o="success")=>{Ui({msg:e,tone:o}),hl(r=>r+1),Jt.current&&clearTimeout(Jt.current),Jt.current=setTimeout(()=>Ui(null),o==="error"?3200:1900)};$(()=>()=>{Jt.current&&clearTimeout(Jt.current)},[]);let Qt=de(null),[zt,Yi]=ce(0),[mo,Xi]=ce(0),Me=wr();$(()=>{let e=Qt.current;if(!e)return;let o=()=>{Yi(e.clientWidth),Xi(e.clientHeight)};o();let r=new ResizeObserver(o);return r.observe(e),()=>r.disconnect()},[]),hc(()=>{Qt.current&&(Yi(Qt.current.clientWidth),Xi(Qt.current.clientHeight))},[Dt,U,St]);let Zi={desktop:2e3,tablet:800,mobile:390},yo=kt==="desktop"?zt>0?zt:Zi.desktop:Zi[kt],en=zt>0?Math.min(zt/yo,2):1,Ji=yo*en,bl=zt>0&&Ji>zt+1,vl={width:Ji,height:mo||"100%",flex:"none",position:"relative"},xl={width:yo,height:mo?mo/en:"100%",maxHeight:"none",transform:en!==1?`scale(${en})`:void 0,transformOrigin:"top left"},Sl=Fa({pageSlug:u,siteId:f,token:ve}),kl=s.previewHref?.(u)??Sl,ft=()=>G({type:"setUi",ui:{leftSideBarVisible:!U}}),Qi=()=>G({type:"setUi",ui:{rightSideBarVisible:!St}}),Rn=e=>{if(!(Ae&&(Zt(!1),ot(null),dt.current=!1,U&&Nt===e))&&!(qe&&(ct.current=!1,fn(),U&&Nt===e))){if(U&&Nt===e){ft();return}Ct(!1),xn(e),U||G({type:"setUi",ui:{leftSideBarVisible:!0}})}},wl=()=>{Ct(!1),er(n,{accept:"image/*",title:"Media library"})},es=()=>{le(Le),w.select(null),Un()},ts=()=>{le(Jn),St||G({type:"setUi",ui:{rightSideBarVisible:!0}})},ns=()=>{if(ue){Ct(!1),xn("styles"),U||G({type:"setUi",ui:{leftSideBarVisible:!0}}),Un();return}le(Zr),St||G({type:"setUi",ui:{rightSideBarVisible:!0}}),Un()},z=fe.data.content??[],gt=()=>{let e=z.findIndex(r=>r.type===Fe),o=z.findIndex(r=>r.type===oe);return{floor:e>=0?e+1:0,cap:o>=0?o:z.length}},os=xe,ho=Uc({data:fe.data,config:os,readOnly:!!W,clipboard:Aa,afterRemove:"none",stepBounds:(e,o)=>{if(e.parentId!==_c||e.slot!==qc)return{min:0,max:o-1};let{floor:r,cap:l}=gt();return{min:r,max:l-1}},commit:(e,{select:o})=>{if(o!==void 0){le(Le);let r=o?.kind==="node"?Kc(e,os,o):null;w.select(r&&r.zone===P?{index:r.index}:r)}w.commitDocument(e)}}),Cl=(e,o)=>{let r=se(e)[o]?.props?.id;r!=null&&ho.remove(String(r))},Ve=e=>xe.components[e]?.label??e,Pt=De(e=>xe.components[e]?.defaultProps??{},[xe]),Te=e=>Wt(e,"section",Ve(e)),tn=e=>Mr({type:e.type,props:e.props??{}},Te(e.type)),{nodeAddresses:En,zoneItems:is}=yi(()=>{let e=new Map,o=new Map,r=(l,p,g)=>{o.set(p,l),l.forEach((h,v)=>{let y=String(h.props?.id??"");if(y&&e.set(y,{zone:p,index:v}),g>=zs)return;let L=new Map;for(let{child:O,zone:T}of Oo(xe,h))L.set(T,[...L.get(T)??[],O]);for(let[O,T]of L)r(T,O,g+1)})};return r(z,P,0),{nodeAddresses:e,zoneItems:o}},[z,xe]),se=De(e=>is.get(e)??[],[is]),ss=Xs(),Tl=yi(()=>{let e=new Map;for(let o of ss??[])e.set(o.slug,o.name);return e},[ss]),An=e=>Or(e,Ve,o=>Tl.get(o)),rs=(e,o)=>o===P?null:Br(xe.components[e.type]?.fields),Il=(e,o,r)=>{let l=se(e)[o];if(!l)return;let p=rs(l,e);p&&w.replaceComponent(e,o,{...l,props:{...l.props,[p]:r.trim()}})},Pl=(e,o,r,l)=>{if(!(ji?.zone===e&&ji.index===o))return;let g=(h,v)=>{Vi(null),v&&Il(e,o,h)};return c("input",{className:"es-tree-rename",defaultValue:l,autoFocus:!0,"aria-label":"Rename",onClick:h=>h.stopPropagation(),onBlur:h=>g(h.currentTarget.value,!0),onKeyDown:h=>{h.key==="Enter"?(h.preventDefault(),g(h.currentTarget.value,!0)):h.key==="Escape"&&(h.preventDefault(),g("",!1))}},r)},Rl=()=>Tn(new Set(se(P).map(e=>String(e.props.id)))),Nn=Xa(f),Ln=xe,bo=(e,o)=>o===P?Te(e):Ve(e),as=(e,o,r)=>{let l=Za(Ln,Nn,r,bo(r.type,e));l&&(l.changed&&w.replaceComponent(e,o,{...r,props:{...l.props,id:r.props.id}}),It(l.message))},ls=La({nodesIn:se,nodeAt:(e,o)=>se(e)[o]??null,labelOf:(e,o)=>o===P?Te(e):Ve(e),renamePropOf:rs,beginRename:(e,o)=>Vi({zone:e,index:o}),history:{hasPast:Oe.hasPast,hasFuture:Oe.hasFuture,back:()=>Oe.back(),forward:()=>Oe.forward()},openAddSection:()=>{w.select(null),on(null)},openPageSettings:()=>{w.select(null),le(Le)},collapseAll:Rl,onPasteRefused:()=>It("Your browser won\u2019t let us read the clipboard \u2014 press \u2318V","error"),document:fe.data,nodeOps:ho,isPinned:(e,o)=>o===P&&(e.type===Fe||e.type===oe),sectionBand:gt,openAddInside:(e,o)=>{e===P?mt(o):w.select({zone:e,index:o}),on(null)},locate:e=>En.get(e)??null,rowNameOf:(e,o)=>o===P?tn(e):An(e),selectAt:(e,o,r,l)=>{e===P?mt(o):sn(e,o,r,l??"")},style:{held:()=>zc(Nn),canCopy:e=>oo(Ln,e).some(o=>o.counted!==!1),copy:(e,o)=>mi(Ln,Nn,e,bo(e.type,o)),paste:(e,o,r)=>as(e,o,r)}},nt),ds=de({copy:(e,o)=>{},paste:(e,o,r)=>{},at:()=>null,readOnly:!1});$(()=>{ds.current={copy:(e,o)=>mi(Ln,Nn,e,bo(e.type,o)),paste:as,at:()=>{let e=fe.ui.itemSelector;if(!e)return null;let o=e.zone??P,r=se(o)[e.index];return r?{zone:o,index:e.index,node:r}:null},readOnly:!!W}});let vo=De(e=>{let o=Oc(e);if(!o)return;let r=ds.current,l=r.at();l&&(e.preventDefault(),o==="copy"?r.copy(l.node,l.zone):r.readOnly||r.paste(l.zone,l.index,l.node))},[]);$(()=>{if(!Be)return;let e=o=>vo(o);return Be.addEventListener("keydown",e),()=>Be.removeEventListener("keydown",e)},[vo,Be]),Mc(nt,"keydown",vo);let El=z.map(e=>e.props.id).join("|");$(()=>{let e=nt?.document??null,o=nt?.window??null,r=0,l=[],p=()=>{if(!e){Pi(T=>T.length?[]:T);return}let v=z.findIndex(T=>T.type===oe),y=v>=0?v:z.length,L=T=>{let B=z[T]?.props?.id;if(B==null)return null;let _=e.querySelector(`[data-puck-component="${CSS.escape(String(B))}"]`);return _?_.getBoundingClientRect():null},O=[];for(let T=1;T<=y;T++){let B=L(T),_=L(T-1);!B&&!_||O.push({top:Math.round(B?B.top:_.bottom),index:T})}Pi(T=>op(T,O)?T:O)},g=()=>{cancelAnimationFrame(r),r=requestAnimationFrame(p)};if(!e||!o){p();return}o.addEventListener("scroll",g,{passive:!0});let h=new ResizeObserver(g);return h.observe(e.documentElement),p(),l.push(setTimeout(p,150),setTimeout(p,450)),()=>{cancelAnimationFrame(r),l.forEach(clearTimeout),o.removeEventListener("scroll",g),h.disconnect()}},[nt,El,kt,en,U,St,ee?.props.id]);let Al=()=>{let e=nt?.document;if(!e)return null;let o=4,r=z.findIndex(g=>g.type===oe),l=r>=0?r:z.length,p=null;for(let g=0;g<l;g++){let h=z[g]?.props?.id;if(h==null)continue;let v=e.querySelector(`[data-puck-component="${CSS.escape(String(h))}"]`);if(!v)continue;let y=v.getBoundingClientRect().top;y<=o&&(p===null||y>p.offset)&&(p={id:String(h),offset:y})}if(!p){let g=ee?.props?.id??z[0]?.props?.id;g!=null&&(p={id:String(g),offset:0})}return p},Nl=()=>{lo.current=Al(),rl(e=>e+1)},xo=nt?.document??null,nn=nt?.window??null;$(()=>{let e=lo.current;if(!e||!xo||!nn)return;let o=[],r=()=>{let l=xo.querySelector(`[data-puck-component="${CSS.escape(e.id)}"]`);if(!l)return!1;let p=l.getBoundingClientRect().top-e.offset;return Math.abs(p)>1&&nn.scrollTo({left:nn.scrollX,top:nn.scrollY+p,behavior:"instant"}),!0};return lo.current=null,r()&&o.push(setTimeout(r,150),setTimeout(r,450)),()=>o.forEach(clearTimeout)},[xo,nn]);let So=e=>{if(!he){Vt(e);return}pt.current?.(),pt.current=Yn(e)};$(()=>{if(!he||!J)return;let e=z.find(o=>o.type===oe)?.props?.id;if(e)return pt.current?.(),pt.current=Yn(String(e)),()=>{pt.current?.(),pt.current=null}},[he,J,wi]),$(()=>{if(!(he||!Ks()))return Vr(()=>Us())},[]);let mt=e=>{le(Le),w.select({index:e}),z[e]?.type==="ContactLocations"&&Ke({level:"groups"});let o=z[e]?.props?.id;o&&So(o)},cs=e=>{let{floor:o,cap:r}=gt(),l=g=>Math.min(Math.max(o,g),r);if(typeof e=="number")return l(e);let p=ee&&je.kind!=="header"?z.findIndex(g=>g.props.id===ee.props.id):-1;return l(p>=0?p+1:r)},ps=(e,o)=>{let{floor:r,cap:l}=gt(),p=Math.min(Math.max(o,r),l),g=e<p?p-1:p;return g===e?{moved:!1,dest:e}:(w.reorderComponent(P,e,g),w.select({index:g}),{moved:!0,dest:g})},Ll=(e,o)=>{let r=Te(z[e]?.type??""),l=ps(e,o<0?e-1:e+2);if(!l.moved){It(`\u201C${r}\u201D is already ${o<0?"first":"last"}`);return}let{floor:p,cap:g}=gt();It(`Moved \u201C${r}\u201D to position ${l.dest-p+1} of ${g-p}`)},Dn=(e,o,r)=>{le(Le),w.select({index:e}),Vt(o),It(`Added \u201C${r}\u201D section`)},ko=(e,o)=>{let r=cs(o),l=br(e);if(l){let h=l(Pt,Ft),v=w.insertNode(P,r,h);return Dn(r,v,Te(e)),r}if(pr(e)&&Wo(gn)&&Wo(jt)){let h={type:gn,props:{...Pt(gn),id:Ft(gn),direction:"column",name:`${Te(e)} section`,content:[{type:jt,props:{...Pt(jt),id:Ft(jt),...Et[e]?.headStyle?{headStyle:Et[e].headStyle}:{},...Et[e]?.headRowGap?{rowGap:Et[e].headRowGap}:{},...Et[e]?.headDescriptionSize?{descriptionSize:Et[e].headDescriptionSize}:{},...Kn(e)!==Kn(jt)?{eyebrowLook:Kn(e)}:{}}},{type:e,props:{...Pt(e),id:Ft(e),headPlacement:"own-box"}}]}},v=w.insertNode(P,r,h);return Dn(r,v,Te(e)),r}let g=xr[e]?.fixed===!0?w.insertNode(P,r,{type:e,props:{...Pt(e),id:Ft(e),layout:"boxes"}}):w.insertSection(e,r);return Dn(r,g,Te(e)),r},wo=(e,o,r)=>{let l=cs(r),p=w.insertNode(P,l,o);return Dn(l,p,e),l},on=e=>zn(P,e),zn=(e,o)=>{go.current=document.activeElement??null,qe&&(dt.current=ct.current,ct.current=!1,fn()),ot(o===null?null:{zone:e,index:o}),Zt(!0),U||(dt.current=!0,G({type:"setUi",ui:{leftSideBarVisible:!0}}))},On=()=>{Zt(!1),ot(null),dt.current&&G({type:"setUi",ui:{leftSideBarVisible:!1}}),dt.current=!1},Dl=e=>{if(Sn===null){ko(e);return}let o=ko(e,Sn);Ti(o+1)},zl=(e,o)=>{if(Sn===null){wo(e,o);return}let r=wo(e,o,Sn);Ti(r+1)},us=(e,o,r)=>{if(e.kind==="section")w.insertComponent(o,e.type,r);else if(e.kind==="template")w.insertNode(o,r,Zn(e.template.node));else return;le(Le),w.select({index:r,zone:o})},Ol=e=>{let o=Xe(e.zone);if(o)return`Adding to ${Ve(o.type)}`;if(e.zone===P){let l=z[e.index];return l&&l.type!==oe?`Adding before ${Te(l.type)}`:"Adding at the end of the page"}let r=Mt(e.zone);return r?`Adding to ${r.parentName}`:"Adding here"},Bl=e=>{if(K&&e.kind!=="block"&&Xe(K.zone)){us(e,K.zone,K.index),ot({zone:K.zone,index:K.index+1});return}if(e.kind==="section")return Dl(e.type);if(e.kind==="template")return zl(e.template.name,Zn(e.template.node));if(K&&K.zone!==P){let o=Mt(K.zone);if(!o)return;o.target.spec?Ot(o.parentId,o.target.slot,e.type,K.index,o.parent.type):Po(K.zone,e.type,K.index),ot({zone:K.zone,index:K.index+1});return}Ns?.onPick(e.type)},Se=e=>o=>{o.target.closest(".es-tree-select")||e()},fs=()=>Mi?Mi():pe({kind:"page",slug:pn,siteId:f??void 0}),Bn=(e,o,r)=>c(so,{kind:"delete",label:`Delete ${r}`,onClick:()=>Cl(e,o),children:c(bi,{size:15})}),Mn=(e,o,r,l)=>{let p=!!r.props._hidden;return c(so,{kind:"eye",label:p?`Show ${l}`:`Hide ${l}`,onClick:()=>Ml(e,o,r),children:p?c(We,{name:"eye-off",size:14}):c(We,{name:"eye",size:14})})},gs=e=>{let o=Te(z[e]?.type??""),r=o?`Add section before ${o}`:"Add section here";return Fn(P,e,()=>on(e),r)},Ml=(e,o,r)=>{w.replaceComponent(e,o,{...r,props:{...r.props,_hidden:!r.props._hidden}})},Co=e=>jn(xe,e),yt=e=>Oo(xe,e),To=(e,o,r)=>{let l=Os(xe,e.type,o)&&(r||yt(e).length>0);return{collapsible:l,folded:l&&Tt(String(e.props.id))}},Io=(e,o,r)=>yt(e).flatMap(({child:l})=>To(l,o,r(l.type)).collapsible?[String(l.props.id),...Io(l,o+1,r)]:[]),Hn=e=>yt(e).length>0||!!Pe(e.type),$n=e=>!!Pe(e),sn=(e,o,r,l)=>{if(le(Le),Pe(l)?.spec?.slider){let p=e.split(":")[0];Uo(p,o),w.select({index:o,zone:e}),Vt(p)}else w.select({index:o,zone:e}),So(r)},Ot=(e,o,r,l,p)=>{let g=`${e}:${o}`;w.insertComponent(g,r,l),Pe(p)?.spec?.slider?requestAnimationFrame(()=>{Uo(e,l),w.select({index:l,zone:g})}):w.select({index:l,zone:g})},Po=(e,o,r)=>{w.insertComponent(e,o,r),le(Le),w.select({index:r,zone:e})},ms=de(new Set);$(()=>{z.forEach(e=>{let o=Pe(e.type)?.spec;if(!o)return;let r=e.props.id;if(ms.current.has(r)||(ms.current.add(r),(Array.isArray(e.props[o.slot])?e.props[o.slot]:[]).length>0)||o.skipSeed?.(e.props))return;let p=`${r}:${o.slot}`,g=o.legacy?.(e.props)??[];(g.length?g:o.seeds(Pt)).forEach((v,y)=>w.seedChild(p,y,o.childType,v))})},[z,w,Pt]);let ys=de(new Set);$(()=>{z.forEach((e,o)=>{let r=e.props.id;if(ys.current.has(r))return;let l=Da(e,Co(e.type));ys.current.add(r),l&&w.replaceComponent(P,o,{...e,props:l})})},[z,w]);let hs=Xc().getState,bs=de(null);$(()=>{if(!Ys({docId:ze,saveStatus:C,seededDocId:bs.current})||(bs.current=ze,!V))return;let e=hs().appState.data,o=e.content,r=E?.content??[],l=(v,y)=>v.some(L=>L?.type===y);if(!Y){let v=new Set(Bo(o)),y=v.size?o.filter(O=>!v.has(O.props.id)):o;v.size&&w.setDocument({...e,content:y});let L=Bs(y,r);if(L.includes(oe)){let O=y.length,T=w.insertSection(oe,O);w.replaceComponent(P,O,{type:oe,props:{id:T,blocks:Fo()}})}L.includes(Fe)&&w.insertNode(P,0,$o());return}if(he){let v=cr(o);if(v!==o&&w.setDocument({...e,content:[...v]}),!v.find(L=>L.type===oe)&&!l(r,oe)&&!l(v,mn)&&!l(r,mn)){let L=(T,B)=>$c(xe,T,B),O={type:oe,props:{blocks:Fo()}};w.insertNode(P,v.length,jr(O,L,Wc(mn)))}return}let p=o.filter(v=>v.type!==oe),g=new Set(Bo(p)),h=g.size?p.filter(v=>!g.has(v.props.id)):p;h.length!==o.length&&w.setDocument({...e,content:h}),!l(h,Fe)&&!l(r,Fe)&&w.insertNode(P,0,$o())},[ze,C,E,hs,w,Y,V,he]);let Bt=z.findIndex(e=>e.type===oe),He=Bt>=0?z[Bt]:null,vs=z.find(e=>e.type===dr)??null,xs=z.find(e=>e.type===mn)??null,Ss=Bt>=0?Bt:z.length,it=[];z.forEach(e=>{e.type!==oe&&(Hn(e)&&it.push(String(e.props.id)),it.push(...Io(e,1,$n)))}),He&&(it.push(String(He.props.id)),it.push(...Io(He,1,$n)));let Ro=it.length>0&&it.every(e=>Cn.has(e)),Hl=()=>Tn(e=>{let o=new Set(it);return Ro?new Set([...e].filter(r=>!o.has(r))):new Set([...e,...it])}),ks=e=>{let o=e.props;if(e.type==="FooterMenu"){let r=o.menu;return o.heading||r?.name||"Menu"}if(e.type==="FooterText"){let r=typeof o.text=="string"?o.text.trim():"";return r?r.length>28?`${r.slice(0,28)}\u2026`:r:"Text"}return e.type==="FooterEmailSignup"?o.heading||"Email signup":Ve(e.type)},ws=(e,o,r,l)=>{let p=se(e)[r];if(!p)return;let g={...xt(e),index:r},h={...xt(o),index:Math.min(Math.max(l,0),se(o).length)},v=Gc(g,h);if(!(e===o&&v===r))try{ho.move(String(p.props.id),{...h,index:v})}catch(y){if(!(y instanceof Fc))throw y}},$l=(e,o,r)=>{if(e===o)return!0;let l=se(e)[r];if(!l)return!1;let p=o.split(":")[0],g=En.get(p),h=g?se(g.zone)[g.index]:void 0;if(!h||Fl(l).has(o))return!1;let v=Pe(h.type,h.type===dn?cn(fe?.data,p):0);return!(!v||!(v.choices?v.choices.some(L=>L.type===l.type):v.spec?.childType===l.type)||v.spec?.addBlocked?.(se(o),l))},Fl=e=>{let o=new Set,r=l=>{for(let{child:p,zone:g}of yt(l))o.add(g),r(p)};for(let l of Co(e.type))o.add(`${e.props.id}:${l}`);return r(e),o},Cs=e=>{let o=e.slice(0,e.indexOf(":"));for(let r=0;r<64;r++){let l=En.get(o);if(!l)return null;if(l.zone===P)return o;o=l.zone.slice(0,l.zone.indexOf(":"))}return null},Xe=e=>{let o=e.slice(0,e.indexOf(":")),r=z.find(l=>yn(l.type)&&String(l.props.id)===o);return r&&Ho(o)===e?r:null},Eo=(e,o)=>{if(e.add)return Wl(e.add,o);let r=tt(o);if(yn(e.type))return!1;let l=Xe(r),p=Xe(e.zone);if(l||p)return!l||!p?!1:o.index>=0&&o.index<=se(r).length;if(e.zone===P||r===P){if(e.zone!==r)return!1;let{floor:h,cap:v}=gt();return o.index>=h&&o.index<=v}if(o.index<0||o.index>se(r).length)return!1;if(e.zone===r)return!0;let g=He?String(He.props.id):null;return g&&(Cs(e.zone)===g||Cs(r)===g)?!1:$l(e.zone,r,e.index)},Mt=e=>{let o=e.slice(0,e.indexOf(":")),r=En.get(o),l=r?se(r.zone)[r.index]:void 0;if(!r||!l)return null;let p=Pe(l.type,l.type===dn?cn(fe?.data,o):0);if(!p||`${o}:${p.slot}`!==e||p.source==="footer")return null;let g=p.choices??(p.spec?[{type:p.spec.childType,label:Ve(p.spec.childType)}]:[]);return{parent:l,parentId:o,target:p,choices:g,parentName:r.zone===P?Te(l.type):Ve(l.type)}},Wl=(e,o)=>{let r=tt(o);if(e.kind!=="block"){if(Xe(r))return o.index>=0&&o.index<=se(r).length;if(r!==P)return!1;let{floor:p,cap:g}=gt();return o.index>=p&&o.index<=g}if(r===P)return!1;let l=Mt(r);return!l||!l.choices.some(p=>p.type===e.type)?!1:!l.target.spec?.addBlocked?.(se(r))},_l=(e,o)=>{if(e.kind!=="block"&&Xe(tt(o))){us(e,tt(o),o.index);return}if(e.kind==="section"){ko(e.type,o.index);return}if(e.kind==="template"){wo(e.template.name,Zn(e.template.node),o.index);return}let r=tt(o),l=Mt(r);l&&(l.target.spec?Ot(l.parentId,l.target.slot,e.type,o.index,l.parent.type):Po(r,e.type,o.index))},Ts=(e,o)=>{if(e.add){_l(e.add,o);return}e.zone===P?ps(e.index,o.index):ws(e.zone,tt(o),e.index,o.index)},[Ao]=ce(()=>Vc()),Ht=vi({keyOf:e=>e.id,readOnly:!!W,session:Ao,canDrop:Eo,onDrop:Ts,onStep:(e,o)=>{e.zone===P?Ll(e.index,o):ws(e.zone,e.zone,e.index,o<0?e.index-1:e.index+2)}}),ql=De(e=>{let{floor:o,cap:r}=gt(),l=[];for(let g of e.nodes){let h=tt(g.place),v=se(h)[g.place.index];if(!v||String(v.props.id)!==g.id||v.type===Fe||v.type===oe||Kt(v.type)||yn(v.type))continue;let y=!!Xe(h),L=h===P||y;h===P&&r-o<2||l.push({key:g.id,item:{id:g.id,zone:h,index:g.place.index,type:v.type},box:g.box,label:L?Te(v.type):An(v),from:g.place})}let p=e.zones.filter(g=>g.children.length>0||!!Mt(tt(g.list))?.choices.length||!!Xe(tt(g.list)));return{sources:l,zones:p}},[fe.data]),jl=e=>{le(Le),w.select(e.zone===P?{index:e.index}:{index:e.index,zone:e.zone})},Fn=(e,o,r,l)=>c(hi,{...W?{}:Ht.seam({place:{...xt(e),index:o}}),onAdd:W?void 0:r,label:l},`seam:${e}:${o}`),ht=(e,o)=>{let r=z[e];r&&w.replaceComponent(P,e,{type:r.type,props:{...r.props,locations:o}})},rn=e=>{let o=z[e]?.props?.locations;return Array.isArray(o)?o:[]},Is=vi({keyOf:e=>`group:${e.si}:${e.index}`,readOnly:!!W,canDrop:(e,o)=>o.parentId===ro(e.si).parentId&&o.slot==="groups",onDrop:(e,o)=>{ht(e.si,Vo(rn(e.si),e.index,o.index)),Me.level==="city"&&Ke({level:"groups"})},onStep:(e,o)=>{ht(e.si,Vo(rn(e.si),e.index,o<0?e.index-1:e.index+2)),Me.level==="city"&&Ke({level:"groups"})}}),No=vi({keyOf:e=>`city:${e.si}:${e.group}:${e.index}`,readOnly:!!W,canDrop:(e,o)=>o.parentId===ro(e.si).parentId&&o.slot.startsWith("cities:"),onDrop:(e,o)=>{let r=o.slot.slice(7);ht(e.si,Go(rn(e.si),e.group,e.index,r,o.index)),Ke({level:"group",key:r})},onStep:(e,o)=>{ht(e.si,Go(rn(e.si),e.group,e.index,e.group,o<0?e.index-1:e.index+2)),Me.level==="city"&&Ke({level:"group",key:e.group})}}),Ps=de(z);Ps.current=z;let Rs=de(()=>{});$(()=>{$i(e=>{let o=Dr(e);if(!o)return;let r=Ps.current.findIndex(l=>l.props?.id===o.nodeId);r<0||Rs.current(r,{level:o.part,index:o.index})})},[$i]);let $e=(e,o)=>{le(Le),uo.current=z[e]?.props?.id??null,w.select({index:e}),Ke(o),St||G({type:"setUi",ui:{rightSideBarVisible:!0}});let r=z[e]?.props?.id;typeof r=="string"&&(o.level==="image"||o.level==="map")?Hi(Lr(r,o.index,o.level)):Hi(null),typeof r=="string"&&So(r)};Rs.current=$e;let Vl=(e,o)=>{let r=rn(o),l=qo(r),p=String(e.props.id),g=co&&ee?.props.id===p,h=y=>c(hi,{...W?{}:Is.seam({place:{...ro(o),index:y}})},`seam:${p}:groups:${y}`),v=(y,L)=>c(hi,{...W?{}:No.seam({place:{...xi(o,y),index:L}})},`seam:${p}:cities:${y}:${L}`);return N(me,{children:[c(we,{icon:c(Nc,{size:13}),name:"Texts",onSelect:()=>$e(o,{level:"texts"}),selected:g&&Me.level==="texts",rowProps:{onClick:Se(()=>$e(o,{level:"texts"}))}}),l.map((y,L)=>{let O=`${p}::grp::${y.key}`,T=Tt(O),B=g&&Me.level==="group"&&Me.key===y.key,_=Cr(y.key,y.name),Ze={...xi(o,y.key),index:y.cards.length},Ge=No.row({item:{si:o,group:y.key,index:-1},place:Ze,into:Ze,canDrag:!1},{onClick:Se(()=>$e(o,{level:"group",key:y.key}))}),ke=Is.row({item:{si:o,index:L},place:{...ro(o),index:L}},Ge.rowProps);return N(Ut,{children:[L===0&&h(0),c(we,{icon:c(Qc,{size:13}),name:_,onSelect:()=>$e(o,{level:"group",key:y.key}),selected:B,draggable:ke.draggable,dragging:ke.dragging,drop:ke.drop??Ge.drop,fold:{open:!T,label:"group",onToggle:()=>ut(O)},actions:c(so,{kind:"delete",label:`Delete ${_} group (${y.cards.length} ${y.cards.length===1?"city":"cities"})`,onClick:()=>{ht(o,Pr(r,y.key)),Ke({level:"groups"})},children:c(bi,{size:15})}),rowProps:ke.rowProps,children:c("span",{className:"es-group-count",children:y.cards.length})}),!T&&N(at,{children:[y.cards.map((Je,Ne)=>{let Ie=jo(r,y.key,Ne),an=g&&Me.level==="city"&&Me.index===Ie,Rt=String(Je?.name??"")||"City",ln=`${p}::city::${_o(Je)}`,Wn=Tt(ln),{rowProps:_n,...zo}=No.row({item:{si:o,group:y.key,index:Ne},place:{...xi(o,y.key),index:Ne}},{onClick:Se(()=>$e(o,{level:"city",index:Ie}))});return N(Ut,{children:[Ne===0&&v(y.key,0),c(we,{icon:c(ep,{size:13}),name:Rt,onSelect:()=>$e(o,{level:"city",index:Ie}),selected:an,...zo,fold:{open:!Wn,label:Rt,onToggle:()=>ut(ln)},actions:c(so,{kind:"delete",label:`Delete ${Rt}`,onClick:()=>{ht(o,Rr(r,y.key,Ne)),Ke({level:"group",key:y.key})},children:c(bi,{size:15})}),rowProps:_n}),!Wn&&N(at,{children:[c(we,{icon:c(Ec,{size:13}),name:"Image",onSelect:()=>$e(o,{level:"image",index:Ie}),selected:g&&Me.level==="image"&&Me.index===Ie,rowProps:{onClick:Se(()=>$e(o,{level:"image",index:Ie}))}}),c(we,{icon:c(tp,{size:13}),name:"Map",onSelect:()=>$e(o,{level:"map",index:Ie}),selected:g&&Me.level==="map"&&Me.index===Ie,rowProps:{onClick:Se(()=>$e(o,{level:"map",index:Ie}))}})]}),v(y.key,Ne+1)]},_o(Je))}),N("button",{type:"button",className:"sf-add-card",onClick:()=>{let Je=Tr(r,y.key);ht(o,Je);let Ne=qo(Je).find(Ie=>Ie.key===y.key);Ke(Ne&&Ne.cards.length?{level:"city",index:jo(Je,y.key,Ne.cards.length-1)}:{level:"group",key:y.key})},children:[c("span",{className:"sf-plus sf-plus--sm",children:"+"}),"Add city"]})]}),h(L+1)]},O)}),N("button",{type:"button",className:"sf-add-card",onClick:()=>{let{cards:y,key:L}=Ir(r);ht(o,y),$e(o,{level:"group",key:L})},children:[c("span",{className:"sf-plus sf-plus--sm",children:"+"}),"Add group"]})]})},Es=e=>{let o=String(e.props.id),r=z.findIndex(y=>String(y.props.id)===o),l=Ho(o),p=se(l),g=Tt(o),h=Ve(e.type),v=y=>Fn(l,y,()=>zn(l,y),"Add section here");return N(me,{children:[c(we,{icon:c(be,{type:e.type,size:13}),name:h,onSelect:()=>mt(r),selected:Lt===o,rowProps:{"data-node-id":o,onClick:Se(()=>mt(r))},fold:{open:!g,label:"section",onToggle:()=>ut(o)}}),!g&&N(at,{children:[p.map((y,L)=>{let O=String(y.props.id),T=tn(y),B=Hn(y),_=B&&Tt(O),Ze=()=>sn(l,L,O,e.type),{rowProps:Ge,...ke}=Ht.row({item:{id:O,zone:l,index:L,type:y.type},place:{...xt(l),index:L}},{"data-node-id":O,onClick:Se(Ze)});return N(Ut,{children:[v(L),c(we,{icon:c(be,{type:y.type,size:13}),name:T,onSelect:Ze,selected:Lt===O,hidden:!!y.props._hidden,...ke,fold:B?{open:!_,label:"section",onToggle:()=>ut(O)}:void 0,actions:N(me,{children:[Bn(l,L,T),Mn(l,L,y,T)]}),rowProps:Ge}),B&&!_&&c(at,{children:Lo(y,2)})]},O)}),v(p.length)]})]})},As=(e,o)=>{let r=yt(e),l=(h,v)=>Fn(h,v),p=Pe(e.type),g=p?`${e.props.id}:${p.slot}`:null;return N(me,{children:[r.map(({child:h,zone:v,index:y})=>{let L=Lt===String(h.props.id),{collapsible:O,folded:T}=To(h,o,$n(h.type)),B=String(h.props.id),_=ks(h),Ze=()=>sn(v,y,B,e.type),{rowProps:Ge,...ke}=Ht.row({item:{id:B,zone:v,index:y,type:h.type},place:{...xt(v),index:y}},{"data-node-id":B,onClick:Se(Ze)});return N(Ut,{children:[y===0&&l(v,0),c(we,{icon:c(be,{type:h.type,size:13}),name:_,onSelect:Ze,selected:L,hidden:!!h.props._hidden,...ke,fold:O?{open:!T,label:"group",onToggle:()=>ut(B)}:void 0,actions:N(me,{children:[Bn(v,y,_),Mn(v,y,h,_)]}),rowProps:Ge}),O&&!T&&c(at,{children:As(h,o+1)}),l(v,y+1)]},String(h.props.id??`${v}-${y}`))}),g&&!r.some(h=>h.zone===g)?l(g,0):null]})},Lo=(e,o)=>{let r=yt(e),l=Pe(e.type,e.type===dn?cn(fe?.data,String(e.props.id)):0),p=l?.spec??null,g=p&&Array.isArray(e.props[p.slot])?e.props[p.slot]:[],h=l&&l.choices?{slot:l.slot,choices:l.choices}:null,v=String(e.props.id),y=p&&!p.fixed?`${v}:${p.slot}`:null,L=h?`${v}:${h.slot}`:null,O=(T,B)=>{let _=T===y&&p&&!p.addBlocked?.(g)?()=>Ot(e.props.id,p.slot,p.childType,B,e.type):T===L?()=>zn(T,B):void 0;return Fn(T,B,_,T===y&&p?p.addLabel:"Add block here")};return N(me,{children:[r.map(({child:T,zone:B,index:_})=>{let Ze=Lt===String(T.props.id),Ge=An(T),ke=String(T.props.id),{collapsible:Je,folded:Ne}=To(T,o,$n(T.type)),Ie=Co(T.type),an=Ie.length===1?`${ke}:${Ie[0]}`:null,Rt=an?{...xt(an),index:se(an).length}:void 0,ln=Ht.dragging,Wn=Rt&&ln&&Eo(ln,Rt)?Rt:void 0,_n=()=>sn(B,_,ke,e.type),{rowProps:zo,...Gl}=Ht.row({item:{id:ke,zone:B,index:_,type:T.type},place:{...xt(B),index:_},into:Wn,canDrag:!Kt(T.type)},{"data-node-id":ke,onClick:Se(_n)});return N(Ut,{children:[_===0&&O(B,0),c(we,{icon:c(be,{type:T.type,size:13}),name:Ge,onSelect:_n,nameSlot:Pl(B,_,ke,Ge),selected:Ze,hidden:!!T.props._hidden,...Gl,fold:Je?{open:!Ne,label:"group",onToggle:()=>ut(ke)}:void 0,actions:Kt(T.type)?void 0:N(me,{children:[Bn(B,_,Ge),Mn(B,_,T,Ge)]}),rowProps:zo}),Je&&!Ne&&c(at,{children:Lo(T,o+1)}),O(B,_+1)]},String(T.props.id??`${B}-${_}`))}),p&&!p.fixed&&c(yr,{small:!0,label:p.addLabel,blocked:p.addBlocked?.(g)??null,onAdd:()=>Ot(e.props.id,p.slot,p.childType,g.length,e.type)}),L&&!r.some(T=>T.zone===L)?O(L,0):null]})},Ns=(()=>{if(!ee||!co)return null;let e=String(ee.type),o=String(ee.props.id),r=Pe(e,e===dn?cn(fe?.data,o):0);if(!r||r.source==="footer")return null;let l=z.some(h=>String(h.props?.id)===o),p=Array.isArray(ee.props[r.slot])?ee.props[r.slot]:[];if(r.spec?.addBlocked?.(p))return null;let g=r.choices??(r.spec?[{type:r.spec.childType,label:Ve(r.spec.childType)}]:[]);return g.length===0?null:{parentName:l?Te(e):Ve(e),choices:g,onPick:h=>{r.spec?Ot(o,r.slot,h,p.length,e):Po(`${o}:${r.slot}`,h,p.length)}}})(),Do=Ae||qe!==null,$t=[{id:"add",label:"Add",icon:c("span",{className:"sf-rail-plus","aria-hidden":"true",children:"+"}),active:Ae,onSelect:()=>Ae?On():on(null)},{id:"pages",label:"Pages",icon:c(bc,{}),active:U&&!Do&&wt==="pages",onSelect:()=>Rn("pages")},{id:"sections",label:"Layers",icon:c(Ja,{}),active:U&&!Do&&wt==="sections",onSelect:()=>Rn("sections")}];return!ue&&Q&&$t.push({id:"appearance",label:"Appearance",icon:c(Jc,{}),active:je.kind==="website",onSelect:ns}),Y&&$t.push({id:"sitemap",label:"Visual sitemap",icon:c(xc,{}),active:ao,onSelect:()=>{let e=!ao;Ct(e),e&&U&&G({type:"setUi",ui:{leftSideBarVisible:!1}})}}),ue&&$t.push({id:"styles",label:"Site styles",icon:c(vc,{}),active:U&&!Do&&wt==="styles",onSelect:()=>Rn("styles")}),Si?$t.push({id:"media",label:"Media library",icon:c(Qa,{}),active:U&&!Ae&&(qe!==null||wt==="media"),onSelect:()=>Rn("media")}):k&&$t.push({id:"media",label:"Media library",icon:c(Qa,{}),onSelect:wl}),c(kr.Provider,{value:!0,children:c(nr.Provider,{value:kt,children:N("div",{ref:Xt,className:"sf-editor es-editor",style:Yr(Dt),onContextMenu:ls.onEditorContextMenu,children:[Y&&ao&&c(di,{tokenRef:b,siteId:f??void 0,currentSlug:u,liveContent:z,labelForType:Te,onOpenPage:e=>{pe({kind:"page",slug:e,siteId:f??void 0}),Ct(!1)},onClose:()=>Ct(!1)}),N(wc,{children:[c(Pc,{items:$t,ariaLabel:"Left panel views"}),N(ol,{children:[c(el,{label:"Undo",disabled:!Oe.hasPast,onClick:()=>Oe.back(),children:c(Lc,{})}),c(el,{label:"Redo",disabled:!Oe.hasFuture,onClick:()=>Oe.forward(),children:c(Ac,{})}),c(Ic,{}),c(kc,{devices:sa,value:kt,onChange:il})]}),N(ol,{kind:"right",style:{minWidth:300},children:[c(Zc,{saveState:M,notSaving:!!W||A!=null,onToggle:ie,onRetry:H}),Ce.visible&&N("button",{type:"button",className:"es-btn-ghost",disabled:!Ce.enabled,title:Ce.enabled?"Save this website as a platform template":Ce.disabledReason,onClick:ye,children:["Save as Template",c(gi,{})]}),c("button",{type:"button",className:"es-btn-ghost",title:"Refresh the preview (reloads the canvas, keeps your place)",onClick:Nl,children:"Refresh"}),_e&&u&&N("a",{className:"es-btn-ghost",href:kl,target:"_blank",rel:"noopener noreferrer",title:"Preview the live site (opens in a new tab)","aria-label":"Preview the live site in a new tab",children:["Preview",c(Rc,{size:15})]}),c("button",{type:"button",className:"es-btn-primary",onClick:()=>{R(fe.data)},children:F?"Publish":"Save"})]})]}),c(ei,{}),N("div",{className:"sf-body",children:[U?N(me,{children:[c("div",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left",children:Ae?c(ri,{blocks:K&&K.zone!==P&&!Xe(K.zone)?Mt(K.zone):Ns,blocksOnly:!!(K&&K.zone!==P&&!Xe(K.zone)),at:K?{label:Ol(K),onClear:()=>ot(null)}:void 0,onAdd:Bl,itemFor:e=>({id:`new:${e.kind}:${e.kind==="template"?e.template.id:e.type}`,zone:"",index:-1,type:e.kind==="template"?e.template.node.type:e.type,add:e}),session:Ao,siteWide:Y?{chatEnabled:ll.enabled,onToggleChat:e=>dl({enabled:e}),onOpenChat:()=>{On(),fo()}}:void 0,onClose:On,onHide:ft,readOnly:!!W}):qe&&Yt?c(Yo,{panel:Yt,pick:qe,onHide:ft}):wt==="pages"?c(ai,{activeSurface:al,onPreviewSurface:Ci,onNavigate:e=>{Ci(null),pe(m?{kind:"template",id:m,pageSlug:e}:{kind:"page",slug:e,siteId:f??void 0})},onClose:ft}):wt==="styles"?c(li,{tokenRef:b,siteId:f??void 0,onClose:ft,onNotify:It,tab:sl,onTabChange:ki}):wt==="media"&&Yt?c(Yo,{panel:Yt,pick:null,onHide:ft}):N(me,{children:[c(bt,{icon:c(Ja,{}),title:"Layers",context:`/${u}`,actions:it.length>0?c(Cc,{label:Ro?"Expand all sections":"Collapse all sections",onClick:Hl,children:c(np,{expand:Ro})}):void 0,onHide:ft}),N(Sc,{className:"sf-tree sf-scroll",children:[c(we,{icon:c(be,{type:"page",size:13}),name:"Page settings",onSelect:es,selected:!ee&&co,rowProps:{onClick:Se(es)}}),vs&&N(me,{children:[c(io,{children:"Header"}),Es(vs)]}),!he&&V&&N(me,{children:[c(io,{children:"Header"}),c(we,{icon:c(be,{type:"header",size:13}),name:"Header",onSelect:ts,selected:je.kind==="header",rowProps:{onClick:Se(ts)}})]}),!he&&N(io,{children:["Template \xB7 ",j?"Home page":"Template"]}),z.map((e,o)=>{if(e.type===Fe||e.type===oe||yn(e.type))return null;let r=Lt===String(e.props.id),l=!!e.props._hidden,p=yt(e),g=String(e.props.id),h=e.type==="ContactLocations",v=Hn(e)||h,y=v&&Tt(g),{rowProps:L,...O}=Ht.row({item:{id:g,zone:P,index:o,type:e.type},place:{...xt(P),index:o}},{"data-node-id":g,onClick:Se(()=>mt(o))});return N(Ut,{children:[o>0&&gs(o),c(we,{icon:c(be,{type:e.type,size:13}),name:tn(e),onSelect:()=>mt(o),selected:r,hidden:l,...O,fold:v?{open:!y,label:"section",onToggle:()=>ut(g)}:void 0,actions:N(me,{children:[Bn(P,o,tn(e)),Mn(P,o,e,tn(e))]}),rowProps:L}),Hn(e)&&!y&&N(at,{children:[Lo(e,1),e.type==="Hero"&&c(we,{icon:c(be,{type:"ticker",size:13}),name:Er,onSelect:()=>wn(g),selected:po===g,rowProps:{onClick:Se(()=>wn(g))}})]}),h&&!y&&c(at,{children:Vl(e,o)})]},String(e.props.id??o))}),!he&&Ss>0&&gs(Ss),V&&c(io,{children:"Footer"}),He&&(()=>{let e=String(He.props.id),o=yt(He).length>0||!!Pe(He.type),r=o&&Tt(e);return N(me,{children:[c(we,{icon:c(be,{type:"footer",size:13}),name:"Footer",onSelect:()=>mt(Bt),selected:Lt===String(He.props.id),fold:o?{open:!r,label:"section",onToggle:()=>ut(e)}:void 0,rowProps:{onClick:Se(()=>mt(Bt))}}),o&&!r&&c(at,{children:As(He,1)})]})})(),!he&&!He&&V&&c(we,{icon:c(be,{type:"footer",size:13}),name:"Footer",onSelect:fs,rowProps:{onClick:Se(fs),title:"Edit the site footer"}}),xs&&Es(xs),c("div",{className:"sf-tree-tool",children:c(pi,{})})]})]})}),c(tl,{side:"left",width:Dt.left,min:Qo,max:Jo,defaultWidth:vt.left,label:"Resize Sections panel",onResize:gl})]}):c(Ko,{side:"left",onShow:ft}),c("div",{ref:Qt,className:"sf-center sf-scroll",style:{overflowX:bl?"auto":"hidden",overflowY:"hidden"},children:c("div",{className:"sf-frame-scaler",style:vl,children:c("div",{className:`sf-frame ${kt==="desktop"?"":`sf-frame--${kt}`}`,style:xl,children:N("div",{className:"sf-preview-host",children:[c(ia,{},wi),c(jc,{canvas:nt,session:Ao,model:ql,canDrop:Eo,onDrop:Ts,onPick:jl,onZoneAdd:e=>zn(tt(e),0),readOnly:!!W,revision:fe.data}),Ii.length>0&&c("div",{className:"sf-preview-gaps","aria-hidden":"true",children:Ii.map(e=>N("button",{type:"button",tabIndex:-1,className:"sf-preview-gap",style:{top:e.top},title:"Add section here",onClick:()=>on(e.index),children:[c("span",{className:"sf-preview-gap-line"}),N("span",{className:"sf-preview-gap-pill",children:[c("span",{className:"sf-preview-gap-plus",children:"+"}),c("span",{className:"sf-preview-gap-label",children:"Add section"})]})]},e.index))})]})})})}),St?N(me,{children:[c(hr,{value:{selectChild:sn,addChild:Ot,childRowName:An,blockRowName:ks},children:c(ea,{mode:je,onOpenWebsiteSettings:ns,onOpenSiteStyles:()=>{ki(Gr),xn("styles")},onSelectNode:ul,onNotify:It,onHidePanel:Qi})}),c(tl,{side:"right",width:Dt.right,min:Qo,max:Jo,defaultWidth:vt.right,label:"Resize settings panel",onResize:ml})]}):c(Ko,{side:"right",onShow:Qi})]}),Pn&&N("div",{className:`sf-toast ${Pn.tone==="error"?"sf-toast--error":""}`,role:"status",children:[c("span",{className:"sf-toast-check","aria-hidden":"true",children:Pn.tone==="error"?"!":"\u2713"}),Pn.msg]},yl),ls.menu]})})})}export{ip as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var L="x-forwarded-for";function X(e){let t=(e??"").split(",").map(n=>n.trim()).filter(Boolean);return t.length>0?t[t.length-1]:null}var Ue="x-forwarded-host";function ee(e,t,n){let r={};return e&&(r[Ue]=e),t&&n==="uncached"&&(r[L]=t),r}function te(e){if(e?.cache==="no-store"||e?.cache==="no-cache")return"uncached";if(e?.cache==="force-cache")return"data-cached";let t=e?.next?.revalidate;return typeof t=="number"&&t>0?"data-cached":"uncached"}var Me=Symbol.for("efficient-web.efficient-backend");function He(e){return!!e&&e[Me]===!0}function ne(e){return e?.trim()||null}function De(e={}){let t=e.backend??null,n=new Map,r={token:null,brandId:null},s={documentId:null,bridgedId:null};return{hostBackend:t,usesBridgedToken:t===null||He(t),blocks:e.blocks??null,auth:r,site:s,siteId:()=>s.documentId??s.bridgedId,cache(i,u){return n.has(i)||n.set(i,u()),n.get(i)},forget(i){i===void 0?n.clear():n.delete(i)}}}function We(e,t){e.site.documentId=ne(t)}function Je(e,t){e.site.bridgedId=ne(t)}var Ge=De(),O=null,N=new Set;function _(){return O??Ge}function Dt(e){N.delete(e),O=e}function Wt(e){N.add(e),queueMicrotask(()=>{N.delete(e)&&O===e&&(O=null)})}function re(){return _().usesBridgedToken}var Ve={siteSlug:null,shopOrigin:""},$=Ve;function Gt(e){$={siteSlug:e.siteSlug?.trim()||null,shopOrigin:(e.shopOrigin??"").trim().replace(/\/+$/,"")}}function U(){return $.siteSlug}function se(){return $.shopOrigin}var ie="x-storefront-site",oe="x-storefront-host";var ae={contentHash:"db2b679aad5380c6",schema:1,mediaFields:{ImageBlock:["src"],LogoBlock:["src"],Flex:["bgImage"],FeaturedCover:["image"],LongRead:["image"],Banner:["imageSrc"],Timeline:["imageSrc"],Logos:["items[].src"],ContactLocations:["locations[].photo"],HeroSingle:["imageFocal","mediaImage","mediaVideo","poster"],HeroSlide:["mediaImage","mediaVideo","poster"],PostCard:["image"],Gallery:["othersCards[].image","othersCards[].photos[].src","vehicleCards[].image","vehicleCards[].photos[].src","wheelCards[].image","wheelCards[].photos[].src"],GalleryItem:["image","photos[].src"],Manifesto:["imageSrc"],SectionHeader:["logoSrc"],IntroBleed:["imageSrc","imageSrcMobile"],Split:["imageSrc","textBgSrc"],ProcessSteps:["steps[].image"],DetailRows:["rows[].image"],PaymentBadges:["badges[].src"]},mediaKeyNames:["bgImage","image","imageFocal","imageSrc","imageSrcMobile","logoSrc","mediaImage","mediaVideo","photo","poster","src","textBgSrc"],snapshotObjects:{ProductGrid:{source:{keep:["slug"]}},GalleryItem:{product:{keep:["code","finish"]}},FeaturedCover:{source:{keep:["slug"]}},LongRead:{source:{keep:["slug"]}}},hydratedLists:{Events:["posts"],SubscribeBlogs:["posts"]},technicalStateKeys:["imageFocal"]};function M(e){return{getItem(t){try{return e()?.getItem(t)??null}catch{return null}},setItem(t,n){try{e()?.setItem(t,n)}catch{}},removeItem(t){try{e()?.removeItem(t)}catch{}}}}var A="__storefront_probe__";function jt(e){try{e.setItem(A,A);let t=e.getItem(A)===A;return e.removeItem(A),t}catch{return!1}}var v=M(()=>typeof window>"u"?null:window.localStorage),Zt=M(()=>typeof window>"u"?null:window.sessionStorage);function Qt(e){return M(()=>e.defaultView?.localStorage??null)}var ze="shop_access_token",le="shop_refresh_token",H=null;function D(){v.removeItem(ze),v.removeItem(le)}var b={getAccess(){return H},takeLegacyRefresh(){let e=v.getItem(le);return D(),e},setTokens(e){H=e,D()},clear(){H=null,D()}};function je(e){return!!e.src}function R(e){let t=e.finishes.filter(je);if(t.length===e.finishes.length)return e;let n=e.defaultFinish&&t.some(r=>r.name===e.defaultFinish)?e.defaultFinish:null;return{...e,finishes:t,defaultFinish:n}}function Ze(e){return e.listable!==!1}function W(e){return e.map(R).filter(Ze)}var I="https://cdn.inovit.com"?.replace(/\/+$/,"");function J(e,t){let n=_().hostBackend?.media.resolve;if(!(!n||n===Ye))return n(e,t)??e}function Qe(e){return/^(?:https?:)?\/\//i.test(e)||/^(?:data|blob):/i.test(e)}function G(e){return J(e)??ce(e)}function ce(e){return!I||Qe(e)?e:I+e.replace(/^\/media/,"")}var Ye=e=>ce(e),Xe="";function E(e){if(!e)return null;let t=J(e);return t!==void 0?t:e.startsWith("/")?`${Xe}${e}`:e}function on(e){return/^https?:\/\//i.test(e)&&!(I&&e.startsWith(I+"/"))}function an(e){if(!e)return;let t=J(e);return t!==void 0?t:e.startsWith("/media/")?G(e):e}function ln(e){let t=e.split("?")[0],n=t.substring(t.lastIndexOf("/")+1);try{return decodeURIComponent(n.replace(/^[0-9a-f]{32}_/i,""))||n}catch{return n}}var et="/videos/products/";function cn(e){return!!e&&e.includes(et)}var pe=["fill","stroke","stop-color","color","flood-color","lighting-color","solid-color"],ge=new Set(["none","transparent","currentcolor","inherit","initial","unset","context-fill","context-stroke"]),F={black:[0,0,0],white:[255,255,255],gray:[128,128,128],grey:[128,128,128],darkgray:[169,169,169],darkgrey:[169,169,169],dimgray:[105,105,105],dimgrey:[105,105,105],lightgray:[211,211,211],lightgrey:[211,211,211],gainsboro:[220,220,220],silver:[192,192,192],whitesmoke:[245,245,245]},he=12,ye=/\burl\(/i,fe=new RegExp(`(?<![-\\w])(${pe.join("|")})(\\s*=\\s*)(["'])([^"']*)\\3`,"gi"),Se=new RegExp(`((?:^|[;{\\s"'])(?:${pe.join("|")})\\s*:\\s*)([^;}"'<>]+)`,"gi"),tt=/<svg\b([^>]*)>/i,nt=/\bfill\s*[=:]/i;function rt(e){let t=e.replace(fe,(n,r,s,i,u)=>{let m=ue(u);return m===null?n:`${r}${s}${i}${m}${i}`}).replace(Se,(n,r,s)=>{let i=ue(s);return i===null?n:`${r}${i}`});return t=t.replace(tt,(n,r)=>nt.test(r)?n:`<svg fill="#ffffff"${r}>`),t}function ue(e){let t=/!important/i.test(e),r=e.replace(/!important/gi,"").trim().toLowerCase();if(!r||ye.test(r)||ge.has(r))return null;let s=r in F?[...F[r],1]:Pe(r);if(!s)return null;let[i,u,m,d]=s;if(Math.max(i,u,m)-Math.min(i,u,m)>he)return null;let y=st(255-i,255-u,255-m,d);return t?`${y} !important`:y}function st(e,t,n,r){if(r<1)return`rgba(${e}, ${t}, ${n}, ${r})`;let s=i=>i.toString(16).padStart(2,"0");return`#${s(e)}${s(t)}${s(n)}`}function Pe(e){return e.startsWith("#")?it(e):e.startsWith("rgb")?ot(e):e.startsWith("hsl")?lt(e):null}function it(e){let t=e.slice(1),n=1;if(t.length===3||t.length===4)t.length===4&&(n=parseInt(t[3]+t[3],16)/255),t=t.slice(0,3).split("").map(r=>r+r).join("");else if(t.length===6||t.length===8)t.length===8&&(n=parseInt(t.slice(6,8),16)/255),t=t.slice(0,6);else return null;return/^[0-9a-f]{6}$/.test(t)?[parseInt(t.slice(0,2),16),parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16),n]:null}function ot(e){let t=e.slice(e.indexOf("(")+1,e.lastIndexOf(")")),[n,r]=t.split("/"),s=n.split(/[\s,]+/).filter(Boolean).slice(0,3);if(s.length<3)return null;let i=s.map(m=>m.endsWith("%")?Math.round(parseFloat(m)/100*255):Math.round(parseFloat(m)));if(i.some(m=>Number.isNaN(m)))return null;let u=r?B(r):at(n);return[i[0],i[1],i[2],u]}function at(e){let t=e.split(/[\s,]+/).filter(Boolean);return t.length>=4?B(t[3]):1}function B(e){let t=e.trim().endsWith("%")?parseFloat(e)/100:parseFloat(e);return Number.isNaN(t)?1:t}function lt(e){let t=e.slice(e.indexOf("(")+1,e.lastIndexOf(")")),[n,r]=t.split("/"),s=n.split(/[\s,]+/).filter(Boolean);if(s.length<3)return null;let i=parseFloat(s[0]),u=parseFloat(s[1])/100,m=parseFloat(s[2])/100;if([i,u,m].some($e=>Number.isNaN($e)))return null;let d=r?B(r):s.length>=4?B(s[3]):1,[y,S,P]=ct(i,u,m);return[y,S,P,d]}function ct(e,t,n){let r=(1-Math.abs(2*n-1))*t,s=(e%360+360)%360/60,i=r*(1-Math.abs(s%2-1)),u=0,m=0,d=0;s<1?[u,m,d]=[r,i,0]:s<2?[u,m,d]=[i,r,0]:s<3?[u,m,d]=[0,r,i]:s<4?[u,m,d]=[0,i,r]:s<5?[u,m,d]=[i,0,r]:[u,m,d]=[r,0,i];let y=n-r/2;return[Math.round((u+y)*255),Math.round((m+y)*255),Math.round((d+y)*255)]}var me=512*1024;function V(e){return/\.svg(\?|$)/i.test(e)}function ut(e){return`data:image/svg+xml,${encodeURIComponent(rt(e))}`}function mt(e){let t=e.replace(/!important/gi,"").trim().toLowerCase();if(!t||ye.test(t)||ge.has(t))return null;let n=t in F?[...F[t],1]:Pe(t);if(!n)return null;let[r,s,i]=n;return Math.max(r,s,i)-Math.min(r,s,i)>he?null:(.2126*r+.7152*s+.0722*i)/255}function dt(e){let t=[],n=r=>{let s=mt(r);s!==null&&t.push(s)};for(let r of e.matchAll(fe))n(r[4]);for(let r of e.matchAll(Se))n(r[2]);return t.length?t.reduce((r,s)=>r+s,0)/t.length<.5:null}var de=/^(?:\uFEFF|\s+|<\?xml[^>]*\?>|<!--[\s\S]*?-->|<!DOCTYPE\s+svg[^>[]*>)/i;function pt(e){let t=e;for(let n=de.exec(t);n&&n[0].length>0;n=de.exec(t))t=t.slice(n[0].length);return/^<svg[\s>/]/i.test(t)}async function gt(e,t){if(!V(e))return null;try{let n=await fetch(e,{signal:t,redirect:"manual"});if(!n.ok)return null;let r=Number(n.headers.get("content-length"));if(Number.isFinite(r)&&r>me)return null;let s=await n.text();return s.length>me?null:pt(s)?s:null}catch{return null}}async function be(e,t){let n=await gt(e,t);return n===null?null:{reversed:ut(n),inkIsDark:dt(n)}}function we(){return _().siteId()}var ht="",f=class extends Error{constructor(t,n,r){super(n),this.status=t,this.data=r}},z="Unable to reach the server. This could be a problem with your internet connection, or the server may be undergoing maintenance or an upgrade. Please try again shortly.",yt=new Set([502,503,504]),K=0,ft="This editor runs on its host's own backend, which does not serve this request.",St=5e3,Pt=15e3,bt=()=>typeof window>"u"?St:Pt;function Ie(e){let t=(e.method??"GET").toUpperCase();if(!(e.body!=null||t!=="GET"&&t!=="HEAD")&&e.audience!=="admin"&&typeof AbortSignal?.timeout=="function")return AbortSignal.timeout(bt())}var _e=e=>e instanceof Error&&e.name==="TimeoutError",Ae=(e,t)=>yt.has(e)?z:t;function wt(e){if(typeof window>"u"||!e.startsWith("/api/v1/"))return e;let t=U();return!t||/[?&]site=/.test(e)?e:j(e,`site=${encodeURIComponent(t)}`)}async function o(e,t={}){let{token:n,baseUrl:r,headers:s,audience:i,...u}=t;if(typeof window<"u"&&!re())throw new f(K,ft,null);if(typeof window>"u"&&r===void 0)throw new Error(`apiFetch(${JSON.stringify(e)}) ran on the server without an explicit baseUrl. The API_URL default it would inherit is browser-only (the prod image bakes NEXT_PUBLIC_API_URL="" for same-origin use, which a Node fetch cannot resolve). Pass a base explicitly: \`await backendOpts()\` (or baseUrl: PRODUCT_FETCH_BASE) for product reads, or the server-only PRODUCT_BACKEND_URL env for other backend surfaces.`);let m=typeof FormData<"u"&&u.body instanceof FormData,d;try{d=await fetch(`${r??ht}${wt(e)}`,{...u,headers:{...m?{}:{"Content-Type":"application/json"},...n?{Authorization:`Bearer ${n}`}:{},...i===null?{}:{"X-Portal-Audience":i??"shop"},...s},signal:u.signal??Ie({...u,audience:i})})}catch(P){throw P instanceof TypeError||_e(P)?new f(K,z,null):P}let y;try{y=await d.text()}catch(P){throw _e(P)?new f(K,z,null):P}let S=null;if(y)try{S=JSON.parse(y)}catch{throw new f(d.status,d.ok?"Expected JSON but received a non-JSON response":Ae(d.status,d.statusText),y)}if(!d.ok){let P=(S&&typeof S=="object"&&"detail"in S&&typeof S.detail=="string"?S.detail:null)??Ae(d.status,d.statusText);throw new f(d.status,P,S)}return S}var x=null;async function Ee(){return x||(x=_t().finally(()=>{x=null}),x)}async function _t(){let e=b.takeLegacyRefresh(),t=await At.refresh(e??void 0);return b.setTokens(t.access),t.access}async function Fe(){return b.getAccess()??Ee()}async function p(e,t={}){let n;try{n=await Fe()}catch{throw b.clear(),new f(401,"Not signed in",null)}try{return await o(e,{...t,token:n})}catch(r){if(!(r instanceof f)||r.status!==401)throw r;try{let s=await Ee();return await o(e,{...t,token:s})}catch{throw b.clear(),r}}}async function Re(e,t={}){if(b.getAccess())try{return{data:await p(e,t),asShopper:!0}}catch(n){if(!(n instanceof f)||n.status!==401)throw n}return{data:await o(e,t),asShopper:!1}}async function xe(){let e=await p("/api/auth/me/");if(e.portal!=="shop")throw b.clear(),new f(403,"This session is not valid for this shop.",null);return e}var At={login:(e,t)=>o("/api/auth/login/",{method:"POST",body:JSON.stringify({email:e,password:t,portal:"shop"}),credentials:"include"}),refresh:e=>o("/api/auth/refresh/",{method:"POST",body:JSON.stringify(e?{refresh:e,portal:"shop"}:{portal:"shop"}),credentials:"include"}),logout:async()=>{b.clear();try{await o("/api/auth/logout/",{method:"POST",body:JSON.stringify({portal:"shop"}),credentials:"include"})}catch{}},restoreSession:async()=>{let e=await Fe();return await xe(),e},me:xe,updateMe:e=>p("/api/auth/me/",{method:"PATCH",body:JSON.stringify(e)}),changePassword:(e,t)=>p("/api/auth/me/",{method:"PATCH",body:JSON.stringify({password:t,old_password:e})}),changeEmail:(e,t)=>p("/api/shop-portal/change-email/",{method:"POST",body:JSON.stringify({new_email:e,current_password:t})}),myProfile:()=>p("/api/shop-portal/profile/"),updateMyProfile:e=>p("/api/shop-portal/profile/",{method:"PATCH",body:JSON.stringify(e)}),myAddresses:()=>p("/api/shop-portal/delivery-locations/"),createAddress:e=>p("/api/shop-portal/delivery-locations/",{method:"POST",body:JSON.stringify(e)}),updateAddress:(e,t)=>p(`/api/shop-portal/delivery-locations/${e}/`,{method:"PATCH",body:JSON.stringify(t)}),deleteAddress:e=>p(`/api/shop-portal/delivery-locations/${e}/`,{method:"DELETE"}),passwordResetRequest:e=>o("/api/auth/password-reset/",{method:"POST",body:JSON.stringify({email:e})}),passwordResetConfirm:(e,t,n)=>o("/api/auth/password-reset/confirm/",{method:"POST",body:JSON.stringify({uid:e,token:t,new_password:n})}),brands:()=>p("/api/products/brands/"),myOrders:()=>p("/api/shop-portal/orders/").then(e=>e.results),myOrder:e=>p(`/api/shop-portal/orders/${e}/`),cancelOrder:e=>p(`/api/shop-portal/orders/${e}/cancel/`,{method:"POST"}),myReturns:e=>p(`/api/shop-portal/returns/${e?`?order=${encodeURIComponent(e)}`:""}`).then(t=>t.results),createReturn:e=>p("/api/shop-portal/returns/",{method:"POST",body:JSON.stringify(e)}),withdrawReturn:e=>p(`/api/shop-portal/returns/${e}/cancel/`,{method:"POST"}),uploadReturnPhoto:(e,t)=>{let n=new FormData;return n.append("claim_item",e),n.append("file",t),n.append("media_type",t.type.startsWith("video/")?"video":"image"),p("/api/shop-portal/return-media/",{method:"POST",body:n})}};function h(e){if(typeof e=="string")return e.startsWith("/media/")?G(e):e;if(Array.isArray(e))return e.map(h);if(e&&typeof e=="object"){let t={};for(let[n,r]of Object.entries(e))t[n]=n==="captions"&&r&&typeof r=="object"&&!Array.isArray(r)?Object.fromEntries(Object.entries(r).map(([s,i])=>[h(s),i])):h(r);return t}return e}var Rt="",Be="".replace(/\/+$/,""),qe=typeof window>"u"&&Be!=="",xt=qe?Be:Rt,kt=se,w=()=>({baseUrl:kt(),audience:null});function l(e,t){let n=t?`?process=${encodeURIComponent(t)}`:"";return`/api/v1${e}${n}`}var Tt=100,ke=50;function Le(e,t,n){let r=new URLSearchParams;for(let[s,i]of Object.entries(t))i!=null&&i!==""&&r.set(s,String(i));return r.set("pageSize",String(Tt)),n&&r.set("cursor",n),`/api/v1${e}?${r.toString()}`}function Ct(e,t){return Le("/wheels",{process:e},t)}function Ot(e,t,n){return Le("/products",{kind:e.join(","),make:t?.make,model:t?.model,year:t?.year,modification:t?.modification},n)}function vt(e){if(!e)return null;try{return new URL(e,"http://cursor.invalid").searchParams.get("cursor")}catch{return null}}async function Te(e,t,n=()=>!1){let r=[],s=null;try{for(let i=0;i<ke;i++){let u=await o(await t(s),await a());if(r.push(...u.results),s=vt(u.next),!s)break}s&&console.warn(`[${e}] stopped at ${ke} pages (${r.length} rows); catalog may be truncated`)}catch(i){if(n(i))throw i;console.warn(`[${e}] product API unavailable, returning []`,i)}return r}var It=e=>e instanceof f&&e.status===400;function Et(e){return e.flatMap(t=>t.kind==="alloy-wheel"?W([t]):[t])}async function Ne(){return(await Ft()).host}async function Ft(){try{let{headers:e}=await import("./headers-3CAQXQEY.js"),t=await e(),n=i=>i?.split(",")[0]?.split(":")[0]?.trim().toLowerCase()||null,r=n(t.get(oe)??t.get("x-forwarded-host")??t.get("host")),s=n(t.get("host"));return{host:r,matchesRequestHost:r!==null&&r===s}}catch{return{host:null,matchesRequestHost:!1}}}async function Bt(){try{let{headers:e}=await import("./headers-3CAQXQEY.js");return X((await e()).get(L))}catch{return null}}async function qt(){try{let{headers:e}=await import("./headers-3CAQXQEY.js");return(await e()).get(ie)||null}catch{return null}}async function Lt(){let e=await qt();if(e)return`site=${encodeURIComponent(e)}`;let t=await Ne();return t?`host=${encodeURIComponent(t)}`:""}async function g(e){if(typeof window<"u"){let t=U();return t?j(e,`site=${encodeURIComponent(t)}`):e}return j(e,await Lt())}function j(e,t){return t?`${e}${e.includes("?")?"&":"?"}${t}`:e}async function Nt(e){if(!qe)return;let[t,n]=await Promise.all([Ne(),Bt()]),r=ee(t,n,e);return Object.keys(r).length>0?r:void 0}async function a(e){let t=await Nt(te(e)),n={baseUrl:xt,...e};return t&&(n.headers={...t,...e?.headers}),n}var k=typeof window>"u";function T(e,t){let n=new URLSearchParams;for(let[s,i]of Object.entries(t))i!==void 0&&i!==""&&n.set(s,String(i));let r=n.toString();return`/api/v1/fitment${e}${r?`?${r}`:""}`}var xn={listMakes:async e=>{if(k){let{fitmentData:n}=await import("./fitment-data-6EHBA26C.js");return n.makes(e)}return(await o(T("/makes",{region:e}),w())).results},listModels:async(e,t)=>{if(k){let{fitmentData:r}=await import("./fitment-data-6EHBA26C.js");return r.models(e,t)}return(await o(T("/models",{make:e,region:t}),w())).results},listYears:async(e,t,n)=>{if(k){let{fitmentData:s}=await import("./fitment-data-6EHBA26C.js");return s.years(e,t,n)}return(await o(T("/years",{make:e,model:t,region:n}),w())).results},listModifications:async(e,t,n,r)=>{if(k){let{fitmentData:i}=await import("./fitment-data-6EHBA26C.js");return i.modifications(e,t,n,r)}return(await o(T("/modifications",{make:e,model:t,year:n,region:r}),w())).results},getStockFitment:async(e,t,n,r,s)=>{if(k){let{fitmentData:i}=await import("./fitment-data-6EHBA26C.js");return i.stockFitment(e,t,n,r,s)}return o(T("/stock-fitment",{make:e,model:t,year:n,modification:r,region:s}),w())}},kn={listWheels:async e=>{let t=await Te("products.listWheels",async n=>await g(Ct(e,n)));return W(h(t))},listCatalog:async(e,t)=>{if(e.length===0)throw new Error("products.listCatalog() needs at least one kind. An empty list would omit `kind`, which the contract reads as `alloy-wheel` \u2014 so the call would silently return the wheel catalog instead of nothing.");let n=await Te("products.listCatalog",async r=>await g(Ot(e,t,r)),It);return Et(h(n))},getWheel:async e=>R(h(await o(await g(l(`/wheels/${e}`)),await a()))),getTyre:async e=>h(await o(await g(l(`/tyres/${e}`)),await a())),listBundles:async()=>{try{return await o(await g(l("/bundles")),await a())}catch{return[]}},getBundle:async e=>o(await g(l(`/bundles/${e}`)),await a()),listGalleryBuilds:async(e={})=>{let{process:t=null,wheelSlug:n=null}=e;if(typeof window>"u"){let{listGalleryBuilds:r}=await import("./gallery-builds-data-SWA6XKFF.js");return h(r(t,n))}try{let r=new URLSearchParams;t&&r.set("process",t),n&&r.set("wheelSlug",n);let s=r.toString(),i=await o(`/api/v1/gallery-builds${s?`?${s}`:""}`,w());return h(i.results)}catch(r){return console.warn("[products.listGalleryBuilds] product API unavailable, returning []",r),[]}},getSite:async()=>o(await g(l("/site")),await a()),getSiteBySlug:async e=>o(`${l("/site")}?${new URLSearchParams({site:e})}`,typeof window>"u"?await a():void 0),listBrands:async()=>{try{return(await o(await g(l("/brands")),await a())).results??[]}catch(e){return console.warn("[products.listBrands] product API unavailable, returning []",e),[]}},listBrandsForSite:async e=>(await o(`${l("/brands")}?${new URLSearchParams({site:e})}`,typeof window>"u"?await a():void 0)).results??[],listPages:async()=>h(await o(await g(l("/pages")),await a())),listProductTemplates:async()=>{try{return await o(await g(l("/product-templates")),await a())}catch(e){return console.warn("[products.listProductTemplates] unavailable, returning []",e),[]}},listProductTypeChoices:async()=>{try{return await o(await g(l("/product-type-choices")),await a())}catch(e){return console.warn("[products.listProductTypeChoices] unavailable, returning []",e),[]}},listFieldUsage:async()=>{try{return await o(await g(l("/field-usage")),await a())}catch(e){return console.warn("[products.listFieldUsage] unavailable, returning []",e),[]}},getPage:async(e,t={})=>h(await o(await g(l(`/pages/${e}`)),await a(t.revalidate!==void 0?{next:{revalidate:t.revalidate}}:void 0))),listBlogPosts:async()=>{try{return(await o(l("/blog-posts"),await a())).map(t=>({...t,coverImage:E(t.coverImage)??""}))}catch(e){return console.warn("[products.listBlogPosts] blog API unavailable, returning []",e),[]}},getBlogPost:async e=>{let t=await o(l(`/blog-posts/${e}`),await a());return{...t,coverImage:E(t.coverImage)??""}},createOrder:async e=>o(l("/orders"),await a({method:"POST",body:JSON.stringify(e)})),createOrderAuthed:async e=>p(l("/orders"),await a({method:"POST",body:JSON.stringify(e)})),lookupOrder:async e=>o(l("/orders/lookup"),await a({method:"POST",body:JSON.stringify(e)})),createPaymentIntent:async e=>o(l("/payments/intent"),await a({method:"POST",body:JSON.stringify(e)})),createPaypalOrder:async e=>o(l("/payments/paypal/order"),await a({method:"POST",body:JSON.stringify(e)})),capturePaypalOrder:async e=>o(l("/payments/paypal/capture"),await a({method:"POST",body:JSON.stringify(e)})),createAfterpayCheckout:async e=>o(l("/payments/afterpay/checkout"),await a({method:"POST",body:JSON.stringify(e)})),captureAfterpayPayment:async e=>o(l("/payments/afterpay/capture"),await a({method:"POST",body:JSON.stringify(e)})),chargeSquare:async e=>o(l("/payments/square/charge"),await a({method:"POST",body:JSON.stringify(e)})),createGocardlessBillingRequest:async e=>o(l("/payments/gocardless/billing-request"),await a({method:"POST",body:JSON.stringify(e)})),completeGocardlessPayment:async e=>o(l("/payments/gocardless/complete"),await a({method:"POST",body:JSON.stringify(e)})),createZipCheckout:async e=>o(l("/payments/zip/checkout"),await a({method:"POST",body:JSON.stringify(e)})),captureZipPayment:async e=>o(l("/payments/zip/capture"),await a({method:"POST",body:JSON.stringify(e)})),createKlarnaCheckout:async e=>o(l("/payments/klarna/checkout"),await a({method:"POST",body:JSON.stringify(e)})),captureKlarnaPayment:async e=>o(l("/payments/klarna/capture"),await a({method:"POST",body:JSON.stringify(e)})),createStockAlert:async e=>o(l("/stock-alerts"),await a({method:"POST",body:JSON.stringify(e)})),createPreOrderIntent:async e=>o(l("/pre-order-intents"),await a({method:"POST",body:JSON.stringify(e)})),createNewsletterSubscription:async e=>o(l("/newsletter-subscriptions"),await a({method:"POST",body:JSON.stringify(e)})),unsubscribeNewsletter:async e=>o(l("/newsletter-unsubscribe"),await a({method:"POST",body:JSON.stringify(e)})),captureCart:async e=>o(l("/carts"),await a({method:"POST",body:JSON.stringify(e)})),restoreCart:async e=>o(l("/carts/restore"),await a({method:"POST",body:JSON.stringify(e)})),unsubscribeCartReminders:async e=>o(l("/carts/unsubscribe"),await a({method:"POST",body:JSON.stringify(e)})),listReviews:async(e={})=>{let t=new URLSearchParams;e.limit&&t.set("limit",String(e.limit)),e.designCode&&t.set("designCode",e.designCode);let n=l("/reviews"),r=t.toString();try{return await o(await g(r?`${n}?${r}`:n),await a())}catch(s){return console.warn("[products.listReviews] product API unavailable, returning []",s),[]}},submitReview:async e=>o(l("/reviews"),await a({method:"POST",body:JSON.stringify(e)})),getForm:async e=>o(l(`/forms/${encodeURIComponent(e)}`),await a()),submitForm:async(e,t)=>o(l(`/forms/${encodeURIComponent(e)}/submissions`),await a({method:"POST",body:JSON.stringify(t)})),listShippingMethods:async()=>{try{return await o(l("/shipping-methods"),await a())}catch(e){return console.warn("[products.listShippingMethods] product API unavailable, returning []",e),[]}},listCountrySubdivisions:async e=>{try{return await o(l(`/countries/${encodeURIComponent(e)}/subdivisions`),await a())}catch(t){return console.warn("[products.listCountrySubdivisions] unavailable, returning []",t),[]}},quoteCart:async e=>{let t=l("/cart/quote"),n=await a({method:"POST",body:JSON.stringify(e)});return e.couponCode?(await Re(t,n)).data:o(t,n)},validateCoupon:async e=>{let{data:t,asShopper:n}=await Re(l("/coupons/validate"),await a({method:"POST",body:JSON.stringify(e)}));return{...t,askedAsShopper:n}},getHeaderSettings:async()=>{let e=Ie({method:"GET"}),t=await o(await g(l("/header-settings")),await a({signal:e})),n=E(t.logoUrl),r=null,s=null;if(n&&V(n)){let i=await be(n,e);i&&(r=i.reversed,s=i.inkIsDark)}return{...t,logoUrl:n,logoReversed:r,logoInkIsDark:s}},getThemeSettings:async()=>o(await g(l("/theme-settings")),await a()),getChatSettings:async()=>o(await g(l("/chat-settings")),await a())},Tn={listServices:async()=>{try{return await o(l("/bookings/services"),await a())}catch(e){return console.warn("[bookings.listServices] API unavailable, returning []",e),{results:[],currency:"USD"}}},getAvailability:async(e,t)=>o(l(`/bookings/availability?service=${encodeURIComponent(e)}&date=${t}`),await a()),create:async e=>o(l("/bookings"),await a({method:"POST",body:JSON.stringify(e)})),get:async e=>o(l(`/bookings/manage/${encodeURIComponent(e)}`),await a()),cancel:async e=>o(l(`/bookings/manage/${encodeURIComponent(e)}/cancel`),await a({method:"POST"})),createPaymentIntent:async e=>o(l("/bookings/payments/intent"),await a({method:"POST",body:JSON.stringify({manageToken:e})}))},Z=class extends Error{constructor(n,r){super(`Slug "${n}" exists on ${r} websites; a site is required to pick one.`);this.slug=n;this.count=r;this.name="AmbiguousPageSlugError"}},C=e=>e?`/api/storefront/header-settings/?${new URLSearchParams({site:e})}`:"/api/storefront/header-settings/",Ce=e=>e?`/api/storefront/theme-settings/?${new URLSearchParams({site:e})}`:"/api/storefront/theme-settings/",Oe=e=>e?`/api/storefront/chat-settings/?${new URLSearchParams({site:e})}`:"/api/storefront/chat-settings/",ve=e=>`/api/storefront/social-settings/?${new URLSearchParams({site:e})}`,Q=e=>`/api/storefront/sites/${encodeURIComponent(e)}/`,$t=e=>`${Q(e)}currencies/`,Ut="/api/storefront/media/ingest/",Y=class extends Error{constructor(){super("This editor is not connected to a website, so an upload has nowhere to go. Open the page from the website the file should belong to, then try again."),this.name="MediaUploadDestinationError"}};function Mt(){let e=we();if(!e)throw new Y;return`${Ut}?${new URLSearchParams({site:e})}`}var q={"X-Puck-Media-Manifest":ae.contentHash},c=(e,t={})=>o(e,{...t,audience:"admin"}),Cn={findPageBySlug:async(e,t,n)=>{let r=new URLSearchParams({slug:e});n&&r.set("site",n);let s=await c(`/api/storefront/pages/?${r.toString()}`,{token:t}),i=Array.isArray(s)?s:s.results??[];if(!n&&i.length>1)throw new Z(e,i.length);return i[0]??null},getPageById:(e,t)=>c(`/api/storefront/pages/${e}/`,{token:t}),saveLayout:(e,t,n,r,s)=>c(`/api/storefront/pages/${e}/`,{method:"PATCH",body:JSON.stringify({layout:t,expected_updated_at:r,...s?{client_id:s}:{}}),token:n}),publishPage:(e,t,n)=>c(`/api/storefront/pages/${e}/publish/`,{method:"POST",body:n?JSON.stringify({expected_updated_at:n}):void 0,token:t}),claimPageEditLock:(e,t,n,r=!1)=>c(`/api/storefront/pages/${e}/edit-lock/`,{method:"POST",body:JSON.stringify({client_id:n,takeover:r}),token:t}),releasePageEditLock:(e,t)=>c(`/api/storefront/pages/${e}/edit-lock/`,{method:"DELETE",token:t}),createTemplate:(e,t,n)=>c("/api/storefront/page-templates/",{method:"POST",body:JSON.stringify({name:e,layout:t}),headers:q,token:n}),getTemplate:(e,t)=>c(`/api/storefront/page-templates/${e}/`,{token:t}),saveTemplateLayout:(e,t,n)=>c(`/api/storefront/page-templates/${e}/`,{method:"PATCH",body:JSON.stringify({layout:t}),headers:q,token:n}),listTemplatePages:async(e,t)=>{let n=await c(`/api/storefront/template-pages/?template=${encodeURIComponent(e)}`,{token:t});return Array.isArray(n)?n:n.results??[]},findTemplatePageBySlug:async(e,t,n)=>{let r=await c(`/api/storefront/template-pages/?template=${encodeURIComponent(e)}&slug=${encodeURIComponent(t)}`,{token:n});return(Array.isArray(r)?r:r.results??[])[0]??null},createTemplatePage:(e,t,n)=>c("/api/storefront/template-pages/",{method:"POST",body:JSON.stringify({template:e,...t}),headers:q,token:n}),saveTemplatePageLayout:(e,t,n)=>c(`/api/storefront/template-pages/${e}/`,{method:"PATCH",body:JSON.stringify({layout:t}),headers:q,token:n}),deleteTemplatePage:(e,t)=>c(`/api/storefront/template-pages/${e}/`,{method:"DELETE",token:t}),listPages:async(e,t)=>{let n=new URLSearchParams({no_page:"true"});t&&n.set("site",t);let r=await c(`/api/storefront/pages/?${n.toString()}`,{token:e});return Array.isArray(r)?r:r.results??[]},createPage:(e,t,n,r)=>c("/api/storefront/pages/",{method:"POST",body:JSON.stringify({title:e,slug:t,layout:n}),token:r}),deletePage:(e,t)=>c(`/api/storefront/pages/${e}/`,{method:"DELETE",token:t}),getHeaderSettings:(e,t)=>c(C(t),{token:e}),listMenus:async(e,t)=>{let n=new URLSearchParams({no_page:"true"});t&&n.set("site",t);let r=await c(`/api/storefront/menus/?${n}`,{token:e});return Array.isArray(r)?r:r.results??[]},listBlogPosts:async(e,t={})=>{let n=new URLSearchParams({no_page:"true"});t.visibleOnly&&n.set("is_visible","true"),t.siteId&&n.set("site",t.siteId);let r=await c(`/api/storefront/blog-posts/?${n.toString()}`,{token:e});return Array.isArray(r)?r:r.results??[]},listCategories:async(e,t={})=>{let n=new URLSearchParams({no_page:"true"});t.visibleOnly&&n.set("is_visible","true"),t.siteId&&n.set("site",t.siteId);let r=await c(`/api/storefront/categories/?${n.toString()}`,{token:e});return[...Array.isArray(r)?r:r.results??[]].sort((i,u)=>i.sort_order-u.sort_order||i.name.localeCompare(u.name))},listForms:async(e,t={})=>{let n=new URLSearchParams({no_page:"true"});t.siteId&&n.set("site",t.siteId);let r=await c(`/api/storefront/forms/?${n.toString()}`,{token:e});return[...Array.isArray(r)?r:r.results??[]].sort((i,u)=>i.title.localeCompare(u.title))},listWheelSummaries:async(e,t={})=>{let n=new URLSearchParams;t.siteId&&n.set("site",t.siteId);let r=n.toString(),s=await c(`/api/storefront/wheel-curations/summaries/${r?`?${r}`:""}`,{token:e});return h(s)},listProducts:async(e,t={})=>{let n=new URLSearchParams;t.kinds?.length&&n.set("kind",t.kinds.join(",")),t.siteId&&n.set("site",t.siteId);let r=n.toString(),s=await c(`/api/storefront/products/${r?`?${r}`:""}`,{token:e});return h(s)},getWheelDetail:async(e,t,n={})=>{let r=new URLSearchParams({slug:t});return n.siteId&&r.set("site",n.siteId),R(h(await c(`/api/storefront/wheel-curations/detail/?${r.toString()}`,{token:e})))},updateHeaderSettings:(e,t,n)=>c(C(n),{method:"PATCH",body:JSON.stringify(e),token:t}),getSite:(e,t)=>c(Q(e),{token:t}),listSiteCurrencies:async(e,t)=>{let n=await c($t(e),{token:t});return Array.isArray(n)?n:[]},updateSite:(e,t,n)=>c(Q(e),{method:"PATCH",body:JSON.stringify(t),token:n}),getThemeSettings:(e,t)=>c(Ce(t),{token:e}),updateThemeSettings:(e,t,n)=>c(Ce(n),{method:"PATCH",body:JSON.stringify(e),token:t}),getChatSettings:(e,t)=>c(Oe(t),{token:e}),updateChatSettings:(e,t,n)=>c(Oe(n),{method:"PATCH",body:JSON.stringify(e),token:t}),getSocialSettings:(e,t)=>c(ve(t),{token:e}),updateSocialSettings:(e,t,n)=>c(ve(n),{method:"PATCH",body:JSON.stringify(e),token:t}),uploadHeaderLogo:(e,t,n)=>{let r=new FormData;return r.append("logo",e),c(C(n),{method:"PATCH",body:r,token:t})},clearHeaderLogo:(e,t)=>c(C(t),{method:"PATCH",body:JSON.stringify({logo:null}),token:e}),setHeaderLogoFromAsset:(e,t,n)=>c(C(n),{method:"PATCH",body:JSON.stringify({logo_asset_id:e}),token:t}),uploadMedia:async(e,t)=>{let n=new FormData;return n.append("file",e),c(Mt(),{method:"POST",body:n,token:t})},listMedia:async(e,t)=>{let n=new URLSearchParams({no_page:"true"});t&&n.set("kind",t);let r=await c(`/api/storefront/media-assets/?${n.toString()}`,{token:e});return Array.isArray(r)?r:r.results??[]}};export{ee as a,te as b,ae as c,jt as d,v as e,Zt as f,Qt as g,b as h,Me as i,He as j,De as k,We as l,Je as m,_ as n,Dt as o,Wt as p,re as q,je as r,G as s,Ye as t,E as u,on as v,an as w,ln as x,cn as y,V as z,we as A,Gt as B,se as C,ht as D,f as E,z as F,K as G,o as H,At as I,Rt as J,Ne as K,Ft as L,Bt as M,qt as N,xn as O,kn as P,Tn as Q,Z as R,c as S,Cn as T};
|