efficient-web-builder 0.7.0 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/CHANGELOG.md +56 -0
  2. package/dist/chunks/EditorPreviewCheckout-NMJHO2WR.js +4 -0
  3. package/dist/chunks/{PreviewFooter-3TQMFRPZ.js → PreviewFooter-E3AVT663.js} +1 -1
  4. package/dist/chunks/SectionEditorShell-CNJJULHO.js +1 -0
  5. package/dist/chunks/SiteEditorProvider-4NZYBEVE.js +1 -0
  6. package/dist/chunks/StorefrontEditorChrome-OF6DKLWG.js +1 -0
  7. package/dist/chunks/{chunk-KR3FTVDW.js → chunk-6C5FL63W.js} +1 -1
  8. package/dist/chunks/chunk-A2QNXDQ6.js +11 -0
  9. package/dist/chunks/{chunk-K3Y6UBLO.js → chunk-G3X5WFSD.js} +1 -1
  10. package/dist/chunks/chunk-INA2LIFW.js +230 -0
  11. package/dist/chunks/chunk-JSOIOPWC.js +1 -0
  12. package/dist/chunks/{chunk-4G3T6ZD2.js → chunk-NTGUUW2T.js} +1 -1
  13. package/dist/chunks/chunk-PAXN7G3Y.js +1 -0
  14. package/dist/chunks/chunk-QVG6K5WY.js +15 -0
  15. package/dist/chunks/{chunk-N35EG6RF.js → chunk-V2G3QFLM.js} +28 -28
  16. package/dist/chunks/{chunk-IVOJJ6LW.js → chunk-YMLSAFSM.js} +1 -1
  17. package/dist/chunks/{fitment-data-ZLYB5QPR.js → fitment-data-6OYGRNMJ.js} +1 -1
  18. package/dist/chunks/{render-client-A75K43T5.js → render-client-O7623TWA.js} +1 -1
  19. package/dist/editor.css +1 -1
  20. package/dist/index.js +297 -134
  21. package/package.json +2 -2
  22. package/dist/chunks/EditorPreviewCheckout-UMTU2FL4.js +0 -4
  23. package/dist/chunks/SectionEditorShell-FZIT2REV.js +0 -1
  24. package/dist/chunks/SiteEditorProvider-FHKVGA4K.js +0 -1
  25. package/dist/chunks/StorefrontEditorChrome-MYOIHQ5J.js +0 -1
  26. package/dist/chunks/chunk-4KLEZTLW.js +0 -11
  27. package/dist/chunks/chunk-RF5DTRJ5.js +0 -1
  28. package/dist/chunks/chunk-UTFM4DGR.js +0 -15
  29. package/dist/chunks/chunk-WMFQNAWF.js +0 -11
  30. package/dist/chunks/chunk-X6KEAC34.js +0 -1
  31. /package/dist/chunks/{chunk-UTFM4DGR.js.LEGAL.txt → chunk-QVG6K5WY.js.LEGAL.txt} +0 -0
  32. /package/dist/chunks/{chunk-N35EG6RF.js.LEGAL.txt → chunk-V2G3QFLM.js.LEGAL.txt} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efficient-web-builder",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
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",
@@ -41,7 +41,7 @@
41
41
  "LICENSE"
42
42
  ],
43
43
  "peerDependencies": {
44
- "efficient-easel": "^0.96.0",
44
+ "efficient-easel": "^0.99.2",
45
45
  "efficient-shell": "^4.131.0",
46
46
  "react": ">=19",
47
47
  "react-dom": ">=19"
@@ -1,4 +0,0 @@
1
- "use client";import{a as Kt,b as Qe,c as $t}from"./chunk-X6KEAC34.js";import{Ob as Ot,Pb as se,Sb as Lt,Tb as Tt,Ub as Ce,Vb as jt,Wb as qt,Xb as Xe,Yb as _t,a as te,b as Rt,gd as Ft,id as Ze,nb as At,nd as Mt,pd as Ut,yc as Dt}from"./chunk-4KLEZTLW.js";import{E as qe,I as de,P as L,t as It,u as ke,v as Y}from"./chunk-RF5DTRJ5.js";import{a as Je,b as tr}from"./chunk-Y6SLVHK3.js";var Yt=Je((Jr,Wt)=>{"use strict";var nr="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";Wt.exports=nr});var Vt=Je((Xr,Ht)=>{"use strict";var rr=Yt();function zt(){}function Bt(){}Bt.resetWarningCache=zt;Ht.exports=function(){function t(a,o,s,l,p,d){if(d!==rr){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}t.isRequired=t;function e(){return t}var n={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:Bt,resetWarningCache:zt};return n.PropTypes=n,n}});var Jt=Je((ea,Gt)=>{"use strict";Gt.exports=Vt()();var Zr,Qr});import{useEffect as $,useMemo as Ye,useRef as ce,useState as g}from"react";var S=tr(Jt(),1);import k from"react";function Xt(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,a=Array(e);n<e;n++)a[n]=t[n];return a}function ar(t){if(Array.isArray(t))return t}function nn(t,e,n){return(e=ur(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function or(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var a,o,s,l,p=[],d=!0,u=!1;try{if(s=(n=n.call(t)).next,e!==0)for(;!(d=(a=s.call(n)).done)&&(p.push(a.value),p.length!==e);d=!0);}catch(b){u=!0,o=b}finally{try{if(!d&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(u)throw o}}return p}}function ir(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Zt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,a)}return n}function Qt(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Zt(Object(n),!0).forEach(function(a){nn(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Zt(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function sr(t,e){if(t==null)return{};var n,a,o=cr(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(a=0;a<s.length;a++)n=s[a],e.indexOf(n)===-1&&{}.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function cr(t,e){if(t==null)return{};var n={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;n[a]=t[a]}return n}function rn(t,e){return ar(t)||or(t,e)||pr(t,e)||ir()}function lr(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var a=n.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ur(t){var e=lr(t,"string");return typeof e=="symbol"?e:e+""}function et(t){"@babel/helpers - typeof";return et=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},et(t)}function pr(t,e){if(t){if(typeof t=="string")return Xt(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Xt(t,e):void 0}}var T=function(e,n,a){var o=!!a,s=k.useRef(a);k.useEffect(function(){s.current=a},[a]),k.useEffect(function(){if(!o||!e)return function(){};var l=function(){if(s.current)return s.current.apply(s,arguments)};return e.on(n,l),function(){e.off(n,l)}},[o,n,e,s])},tt=function(e){var n=k.useRef(e);return k.useEffect(function(){n.current=e},[e]),n.current},me=function(e){return e!==null&&et(e)==="object"},dr=function(e){return me(e)&&typeof e.then=="function"},mr=function(e){return me(e)&&typeof e.elements=="function"&&typeof e.createToken=="function"&&typeof e.createPaymentMethod=="function"&&typeof e.confirmCardPayment=="function"},en="[object Object]",fr=function t(e,n){if(!me(e)||!me(n))return e===n;var a=Array.isArray(e),o=Array.isArray(n);if(a!==o)return!1;var s=Object.prototype.toString.call(e)===en,l=Object.prototype.toString.call(n)===en;if(s!==l)return!1;if(!s&&!a)return e===n;var p=Object.keys(e),d=Object.keys(n);if(p.length!==d.length)return!1;for(var u={},b=0;b<p.length;b+=1)u[p[b]]=!0;for(var m=0;m<d.length;m+=1)u[d[m]]=!0;var C=Object.keys(u);if(C.length!==p.length)return!1;var y=e,A=n,x=function(G){return t(y[G],A[G])};return C.every(x)},an=function(e,n,a){return me(e)?Object.keys(e).reduce(function(o,s){var l=!me(n)||!fr(e[s],n[s]);return a.includes(s)?(l&&console.warn("Unsupported prop change: options.".concat(s," is not a mutable property.")),o):l?Qt(Qt({},o||{}),{},nn({},s,e[s])):o},null):null},on="Invalid prop `stripe` supplied to `Elements`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.",tn=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:on;if(e===null||mr(e))return e;throw new Error(n)},gr=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:on;if(dr(e))return{tag:"async",stripePromise:Promise.resolve(e).then(function(o){return tn(o,n)})};var a=tn(e,n);return a===null?{tag:"empty"}:{tag:"sync",stripe:a}},yr=function(e){!e||!e._registerWrapper||!e.registerAppInfo||(e._registerWrapper({name:"react-stripe-js",version:"6.7.0"}),e.registerAppInfo({name:"react-stripe-js",version:"6.7.0",url:"https://stripe.com/docs/stripe-js/react"}))},_e=k.createContext(null);_e.displayName="ElementsContext";var sn=function(e,n){if(!e)throw new Error("Could not find Elements context; You need to wrap the part of your app that ".concat(n," in an <Elements> provider."));return e},rt=function(e){var n=e.stripe,a=e.options,o=e.children,s=k.useMemo(function(){return gr(n)},[n]),l=k.useState(function(){return{stripe:s.tag==="sync"?s.stripe:null,elements:s.tag==="sync"?s.stripe.elements(a):null}}),p=rn(l,2),d=p[0],u=p[1];k.useEffect(function(){var C=!0,y=function(x){u(function(h){return h.stripe?h:{stripe:x,elements:x.elements(a)}})};return s.tag==="async"&&!d.stripe?s.stripePromise.then(function(A){A&&C&&y(A)}):s.tag==="sync"&&!d.stripe&&y(s.stripe),function(){C=!1}},[s,d,a]);var b=tt(n);k.useEffect(function(){b!==null&&b!==n&&console.warn("Unsupported prop change on Elements: You cannot change the `stripe` prop after setting it.")},[b,n]);var m=tt(a);return k.useEffect(function(){if(d.elements){var C=an(a,m,["clientSecret","fonts"]);C&&d.elements.update(C)}},[a,m,d.elements]),k.useEffect(function(){yr(d.stripe)},[d.stripe]),k.createElement(_e.Provider,{value:d},o)};rt.propTypes={stripe:S.default.any,options:S.default.object};var cn=function(e){var n=k.useContext(_e);return sn(n,e)},ln=function(){var e=cn("calls useElements()"),n=e.elements;return n},hr=function(e){var n=e.children,a=cn("mounts <ElementsConsumer>");return n(a)};hr.propTypes={children:S.default.func.isRequired};var un=k.createContext(null);un.displayName="CheckoutContext";var nt=function(e){var n=k.useContext(un),a=k.useContext(_e);if(n){if(a)throw new Error("You cannot wrap the part of your app that ".concat(e," in both a checkout provider and <Elements> provider."));return n}else return sn(a,e)},vr=["mode"],br=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},E=function(e,n,a){var o="".concat(br(e),"Element"),s=function(u){var b=u.id,m=u.className,C=u.options,y=C===void 0?{}:C,A=u.onBlur,x=u.onFocus,h=u.onReady,G=u.onChange,D=u.onEscape,O=u.onClick,J=u.onLoadError,ne=u.onLoaderStart,re=u.onNetworksChange,Pe=u.onConfirm,ae=u.onCancel,Ne=u.onShippingAddressChange,oe=u.onShippingRateChange,Ee=u.onSavedPaymentMethodRemove,ge=u.onSavedPaymentMethodUpdate,Re=u.onAvailablePaymentMethodsChange,Q=nt("mounts <".concat(o,">")),ee="elements"in Q?Q.elements:null,W="checkoutState"in Q?Q.checkoutState:null,B=W?.type==="success"||W?.type==="loading"?W.sdk:null,ye=k.useState(null),le=rn(ye,2),N=le[0],he=le[1],j=k.useRef(null),ie=k.useRef(null);T(N,"blur",A),T(N,"focus",x),T(N,"escape",D),T(N,"click",O),T(N,"loaderror",J),T(N,"loaderstart",ne),T(N,"networkschange",re),T(N,"confirm",Pe),T(N,"cancel",ae),T(N,"shippingaddresschange",Ne),T(N,"shippingratechange",oe),T(N,"savedpaymentmethodremove",Ee),T(N,"savedpaymentmethodupdate",ge),T(N,"availablepaymentmethodschange",Re),T(N,"change",G);var F;h&&(e==="expressCheckout"?F=h:F=function(){h(N)}),T(N,"ready",F),k.useLayoutEffect(function(){if(j.current===null&&ie.current!==null&&(ee||B)){var w=null;if(B){var H=B,ve=B;switch(e){case"paymentForm":w=ve.createForm(y);break;case"payment":w=H.createPaymentElement(y);break;case"address":if("mode"in y){var be=y.mode,Be=sr(y,vr);if(be==="shipping")w=H.createShippingAddressElement(Be);else if(be==="billing")w=H.createBillingAddressElement(Be);else throw new Error("Invalid options.mode. mode must be 'billing' or 'shipping'.")}else throw new Error("You must supply options.mode. mode must be 'billing' or 'shipping'.");break;case"expressCheckout":w=H.createExpressCheckoutElement(y);break;case"currencySelector":w=B.createCurrencySelectorElement();break;case"taxId":w=H.createTaxIdElement(y);break;case"contactDetails":w=H.createContactDetailsElement();break;default:throw new Error("<".concat(o,"> is not supported inside a checkout provider. Use an <Elements> provider instead."))}}else ee&&(w=ee.create(e,y));j.current=w,he(w),w&&w.mount(ie.current)}},[ee,B,y]);var ue=tt(y);return k.useEffect(function(){if(j.current){var w=an(y,ue,["paymentRequest"]);w&&"update"in j.current&&j.current.update(w)}},[y,ue]),k.useLayoutEffect(function(){return function(){if(j.current&&typeof j.current.destroy=="function")try{j.current.destroy(),j.current=null}catch{}}},[]),k.createElement("div",{id:b,className:m,ref:ie})},l=function(u){nt("mounts <".concat(o,">"));var b=u.id,m=u.className;return k.createElement("div",{id:b,className:m})},p=n?l:s;return p.propTypes={id:S.default.string,className:S.default.string,onChange:S.default.func,onBlur:S.default.func,onFocus:S.default.func,onReady:S.default.func,onEscape:S.default.func,onClick:S.default.func,onLoadError:S.default.func,onLoaderStart:S.default.func,onNetworksChange:S.default.func,onConfirm:S.default.func,onCancel:S.default.func,onShippingAddressChange:S.default.func,onShippingRateChange:S.default.func,onSavedPaymentMethodRemove:S.default.func,onSavedPaymentMethodUpdate:S.default.func,onAvailablePaymentMethodsChange:S.default.func,options:S.default.object},p.displayName=o,p.__elementType=e,p},R=typeof window>"u",xr=k.createContext(null);xr.displayName="EmbeddedCheckoutProviderContext";var pn=function(){var e=nt("calls useStripe()"),n=e.stripe;return n},na=E("auBankAccount",R),ra=E("card",R),aa=E("cardNumber",R),oa=E("cardExpiry",R),ia=E("cardCvc",R),sa=E("currencySelector",R),ca=E("iban",R),dn=E("payment",R),la=E("expressCheckout",R),ua=E("paymentRequestButton",R),pa=E("linkAuthentication",R),da=E("contactDetails",R),ma=E("address",R),fa=E("shippingAddress",R),ga=E("paymentMethodMessaging",R),ya=E("taxId",R),ha=E("issuingCardNumberDisplay",R),va=E("issuingCardCvcDisplay",R),ba=E("issuingCardExpiryDisplay",R),xa=E("issuingCardPinDisplay",R),ka=E("issuingCardCopyButton",R);function Me(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Me=function(e){return typeof e}:Me=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Me(t)}var gn="dahlia",kr=function(e){return e===3?"v3":e},yn="https://js.stripe.com",Cr="".concat(yn,"/").concat(gn,"/stripe.js"),Sr=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,wr=/^https:\/\/js\.stripe\.com\/(v3|[a-z]+)\/stripe\.js(\?.*)?$/,mn="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",Pr=function(e){return Sr.test(e)||wr.test(e)},Nr=function(){for(var e=document.querySelectorAll('script[src^="'.concat(yn,'"]')),n=0;n<e.length;n++){var a=e[n];if(Pr(a.src))return a}return null},fn=function(e){var n=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",a=document.createElement("script");a.src="".concat(Cr).concat(n);var o=document.head||document.body;if(!o)throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return o.appendChild(a),a},Er=function(e,n){!e||!e._registerWrapper||e._registerWrapper({name:"stripe-js",version:"9.9.0",startTime:n})},Se=null,De=null,Fe=null,Rr=function(e){return function(n){e(new Error("Failed to load Stripe.js",{cause:n}))}},Ir=function(e,n){return function(){window.Stripe?e(window.Stripe):n(new Error("Stripe.js not available"))}},Ar=function(e){return Se!==null?Se:(Se=new Promise(function(n,a){if(typeof window>"u"||typeof document>"u"){n(null);return}if(window.Stripe&&e&&console.warn(mn),window.Stripe){n(window.Stripe);return}try{var o=Nr();if(o&&e)console.warn(mn);else if(!o)o=fn(e);else if(o&&Fe!==null&&De!==null){var s;o.removeEventListener("load",Fe),o.removeEventListener("error",De),(s=o.parentNode)===null||s===void 0||s.removeChild(o),o=fn(e)}Fe=Ir(n,a),De=Rr(a),o.addEventListener("load",Fe),o.addEventListener("error",De)}catch(l){a(l);return}}),Se.catch(function(n){return Se=null,Promise.reject(n)}))},Or=function(e,n,a){if(e===null)return null;var o=n[0];if(typeof o!="string")throw new Error("Expected publishable key to be of type string, got type ".concat(Me(o)," instead."));var s=o.match(/^pk_test/),l=kr(e.version),p=gn;s&&l!==p&&console.warn("Stripe.js@".concat(l," was loaded on the page, but @stripe/stripe-js@").concat("9.9.0"," expected Stripe.js@").concat(p,". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));var d=e.apply(void 0,n);return Er(d,a),d},we,hn=!1,vn=function(){return we||(we=Ar(null).catch(function(e){return we=null,Promise.reject(e)}),we)};Promise.resolve().then(function(){return vn()}).catch(function(t){hn||console.warn(t)});var bn=function(){for(var e=arguments.length,n=new Array(e),a=0;a<e;a++)n[a]=arguments[a];hn=!0;var o=Date.now();return vn().then(function(s){return Or(s,n,o)})};var Lr="sf:gclid",Tr="sf:fbclid",jr=2160*60*60*1e3;function Cn(){return typeof window<"u"}function xn(t){let e=ke.getItem(t);if(!e)return"";try{let{v:n,t:a}=JSON.parse(e);return!n||typeof a!="number"||Date.now()-a>jr?"":n}catch{return""}}function kn(t){if(!Cn())return"";let e=t.replace(/([.$?*|{}()[\]\\/+^])/g,"\\$1"),n=document.cookie.match(new RegExp(`(?:^|; )${e}=([^;]*)`));return n?decodeURIComponent(n[1]):""}function Sn(){if(!Cn())return{};let t=xn(Lr),e=xn(Tr),n=kn("_fbp"),a=kn("_fbc");!a&&e&&(a=`fb.1.${Date.now()}.${e}`);let o={};return t&&(o.gclid=t),e&&(o.fbclid=e),n&&(o.fbp=n),a&&(o.fbc=a),o}var wn="sf:meta-purchases",qr=20;function Nn(){return typeof window>"u"||window.parent!==window}function _r(...t){try{if(Nn()||typeof window.fbq!="function")return;window.fbq(...t)}catch{}}var Pn=new Set;function Dr(t){if(Pn.has(t))return!1;Pn.add(t);try{let e=JSON.parse(ke.getItem(wn)??"[]");if(e.includes(t))return!1;ke.setItem(wn,JSON.stringify([...e,t].slice(-qr)))}catch{}return!0}function Fr(t){return[...new Set(t.filter(Ce).flatMap(e=>e.components.map(n=>n.partNumber)))]}function En(t){let e=t.confirmation;Nn()||!Dr(e.orderNumber)||_r("track","Purchase",{value:Number(e.grandTotal),currency:e.currency,content_type:"product",content_ids:Fr(t.lines)},{eventID:e.orderNumber})}var at="checkout-afterpay-context",Ue="checkout-gocardless-context",ot="checkout-zip-context",Ke="checkout-klarna-context";function Mr({evidence:t,parked:e}){return t?{action:"capture",evidence:t,parked:e}:e?{action:"settle",parked:e}:{action:"ignore"}}function Ur(t,e){let n=t.getItem(e);if(t.removeItem(e),!n)return null;try{return JSON.parse(n)}catch{return null}}var Rn={name:"Afterpay",legParam:"afterpay",legValues:["confirm","cancel"],storageKey:at,evidenceFrom(t,e){return e==="cancel"||(t.get("status")??"").toUpperCase()==="CANCELLED"?null:t.get("orderToken")},requestFrom:t=>({token:t})},In={name:"Zip",legParam:"zip",legValues:["return"],storageKey:ot,evidenceFrom(t){let e=(t.get("result")??"").toLowerCase();return e==="cancelled"||e==="declined"?null:t.get("checkoutId")},requestFrom:t=>({checkoutId:t})};async function it(t,e){let n=new URLSearchParams(e.search),a=n.get(t.legParam);if(!a||!t.legValues.includes(a))return;let o=Ur(e.storage,t.storageKey),s=t.evidenceFrom(n,a);e.scrubQuery();let l=Mr({evidence:s,parked:o});if(l.action!=="ignore"){if(e.page.clearCart(),l.action==="settle"){e.page.note(`The ${t.name} payment was not completed \u2014 our team will follow up on payment.`),e.page.land(l.parked.confirmation);return}e.page.setConfirming(!0);try{let p=await e.capture(t.requestFrom(l.evidence));p.status==="paid"?e.page.markPaid():e.page.note(`${t.name} declined the payment \u2014 our team will follow up on payment.`),e.page.land(l.parked?.confirmation??p)}catch{l.parked?(e.page.note(`We could not confirm the ${t.name} payment \u2014 our team will follow up on payment.`),e.page.land(l.parked.confirmation)):e.page.fail(`We could not confirm your ${t.name} payment. Please contact us before trying again \u2014 your payment may already have been taken.`)}finally{e.page.setConfirming(!1)}}}import{Fragment as _,jsx as r,jsxs as c}from"react/jsx-runtime";function An(t){let e=t.indexOf(`
3
- `);return e===-1?[t,""]:[t.slice(0,e),t.slice(e+1)]}function On(t,{canParkContext:e}={canParkContext:!0}){let n=t.paymentMethods,a=[];return n.includes("card")&&a.push({key:"card",title:"Card",body:null,price:r("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"VISA \xB7 MC \xB7 AMEX"})}),n.includes("paypal")&&t.paypalClientId&&a.push({key:"paypal",title:"PayPal",body:null,price:r("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"PAYPAL \xB7 CARDS"})}),n.includes("afterpay")&&a.push({key:"afterpay",title:"Afterpay",body:null,price:r("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"4 \xD7 INTEREST-FREE"})}),n.includes("square")&&t.squareApplicationId&&t.squareLocationId&&a.push({key:"square",title:"Card (Square)",body:null,price:r("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"VISA \xB7 MC \xB7 AMEX"})}),n.includes("gocardless")&&e&&a.push({key:"gocardless",title:"Bank Direct Debit",body:null,price:r("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"PAY BY BANK"})}),n.includes("zip")&&a.push({key:"zip",title:"Zip",body:null,price:r("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"PAY IN 4"})}),n.includes("klarna")&&e&&a.push({key:"klarna",title:"Klarna",body:null,price:r("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"PAY LATER"})}),a.push({key:"bank",title:"Bank transfer",body:null,price:r("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Invoiced"})}),a}function lt({site:t,logo:e,preview:n=!1}){let{items:a,totals:o,coupon:s,deliveryOptions:l,shippingMethodId:p,setShippingMethodId:d,identify:u,clearCapturedCart:b}=Xe(),m=l.find(i=>i.id===p)?.pickupLocation??null,{country:C,countries:y,activeCountry:A,formatMoney:x}=se(),[h,G]=g(()=>On(t)[0].key),[D,O]=g(!0);$(()=>{O(It(Y))},[]);let[J,ne]=g(!0),[re,Pe]=g(!1),[ae,Ne]=g(""),[oe,Ee]=g(""),[ge,Re]=g(""),[Q,ee]=g(""),[W,B]=g(""),[ye,le]=g(""),[N,he]=g(""),[j,ie]=g(""),[F,ue]=g(()=>C||y[0]?.code||""),[w,H]=g(""),[ve,be]=g([]),Dn=Ye(()=>y.find(i=>i.code===F)??A,[y,F,A])?.postalLabel||"Postal Code",Fn=ve[0]?.divisionType||"State / Province";$(()=>{if(!F){be([]);return}let i=!1;return L.listCountrySubdivisions(F).then(f=>{i||(be(f),H(""))}),()=>{i=!0}},[F]);let[X,ut]=g(null),[pt,dt]=g([]),[Ie,Ae]=g("new"),[He,mt]=g(!1),[ft,Mn]=g("Home"),[gt,yt]=g(null),[M]=g(()=>Ut()),[Oe,U]=g(null),[ht,Le]=g(null),[vt,Un]=g(null),[Kn,$n]=g(!1),[Wn,Yn]=g(!1),[V,Ve]=g(null),[bt,pe]=g(!1),[xt,Z]=g(null),[zn,Bn]=g(!1),[Hn,kt]=g(!1),[Vn,Gn]=g(!1),[Jn,Ct]=g(!1),St=ce(!1);$(()=>{n||St.current||!a.some(Ce)||(St.current=!0,Lt({lines:a,currency:o.currency,value:o.subtotal-o.discount,coupon:s?.valid?s.code:void 0}))},[a,o,s,n]),$(()=>{u(ae,oe.trim()||void 0)},[ae,oe,u]);let wt=ce(null),[Te,Xn]=g(null);$(()=>{let i=wt.current;if(!Te||!i)return;let f=()=>i.style.setProperty("--sf-checkout-header-h",`${Te.offsetHeight}px`);f();let v=new ResizeObserver(f);return v.observe(Te),()=>v.disconnect()},[Te]),$(()=>{let i=v=>({setConfirming:v,land:U,markPaid:()=>pe(!0),note:Z,fail:Le,clearCart:b}),f={search:window.location.search,storage:Y,scrubQuery:()=>window.history.replaceState(null,"",window.location.pathname)};it(Rn,{...f,capture:L.captureAfterpayPayment,page:i(Bn)}),it(In,{...f,capture:L.captureZipPayment,page:i(Gn)})},[]),$(()=>{let f=new URLSearchParams(window.location.search).get("gocardless");if(f!=="confirm"&&f!=="cancel")return;let v=Y.getItem(Ue);if(Y.removeItem(Ue),window.history.replaceState(null,"",window.location.pathname),!v)return;let P;try{P=JSON.parse(v)}catch{return}if(b(),f==="cancel"){Z("The direct debit was not set up \u2014 our team will follow up on payment."),U(P.confirmation);return}kt(!0),L.completeGocardlessPayment({idempotencyKey:P.idempotencyKey}).then(I=>{I.status==="paid"?pe(!0):I.status==="declined"?Z("The direct debit was declined \u2014 our team will follow up on payment."):Z("Your direct debit is set up \u2014 the payment is collecting and will clear in a few days.")}).catch(()=>{Z("We could not confirm the direct debit \u2014 our team will follow up on payment.")}).finally(()=>{U(P.confirmation),kt(!1)})},[]),$(()=>{let i=new URLSearchParams(window.location.search),f=i.get("klarna");if(f!=="confirm"&&f!=="cancel")return;let v=Y.getItem(Ke);Y.removeItem(Ke);let P=i.get("authorization_token");if(window.history.replaceState(null,"",window.location.pathname),!v)return;let I;try{I=JSON.parse(v)}catch{return}if(b(),f==="cancel"||!P){Z("The Klarna payment was not completed \u2014 our team will follow up on payment."),U(I.confirmation);return}Ct(!0),L.captureKlarnaPayment({idempotencyKey:I.idempotencyKey,authorizationToken:P}).then(q=>{q.status==="paid"?pe(!0):q.status==="declined"?Z("Klarna declined the payment \u2014 our team will follow up on payment."):Z("Your Klarna payment is being reviewed \u2014 we'll confirm the outcome shortly.")}).catch(()=>{Z("We could not confirm the Klarna payment \u2014 our team will follow up on payment.")}).finally(()=>{U(I.confirmation),Ct(!1)})},[]);function Pt(i){let[f,v]=An(i.address);ee(f),B(v),le(i.city),he(i.zip_code),i.country&&ue(i.country),i.phone&&ie(i.phone)}$(()=>{let i=!1;return(async()=>{try{let[f,v,P]=await Promise.all([de.me(),de.myProfile().catch(()=>null),de.myAddresses().catch(()=>[])]);if(i)return;ut(f);let I=P.filter(xe=>xe.is_active);dt(I),Ne(f.email);let q=(v?.contact_name??"").split(/\s+/);Ee(f.first_name||q[0]||""),Re(f.last_name||q.slice(1).join(" "));let Et=f.phone||v?.phone;Et&&ie(Et);let Ge=I.find(xe=>xe.id===f.default_delivery_location)??I[0];if(Ge)Ae(Ge.id),Pt(Ge);else if(v){let[xe,er]=An(v.address??"");ee(xe),B(er),le(v.city??""),he(v.zip_code??""),v.country&&ue(v.country)}}catch{}})(),()=>{i=!0}},[]);function Zn(){de.logout(),ut(null),dt([]),Ae("new"),mt(!1)}let je=Ye(()=>On(t,{canParkContext:D}),[t,D]);$(()=>{je.some(i=>i.key===h)||G(je[0].key)},[je,h]);let Nt=W.trim()?`${Q}
4
- ${W.trim()}`:Q;async function Qn(){if(n||re||a.length===0)return;let i=a.filter(Ce).flatMap(f=>At(f.components,f.qty));if(i.length===0){Le("Pick a size on each wheel's product page before checking out.");return}Pe(!0),Le(null);try{let v=await(X?L.createOrderAuthed:L.createOrder)({customer:{email:ae,name:`${oe} ${ge}`.trim(),phone:j.trim()||void 0,address:Nt,city:ye,state:w||void 0,zipCode:N,country:F},items:i,currency:o.currency,idempotencyKey:M,shippingMethodId:p??void 0,couponCode:s?.valid?s.code:void 0,...Sn()});if(Tt({confirmation:v,lines:a,adsSendTo:t.googleAdsId&&t.googleAdsConversionLabel?`${t.googleAdsId}/${t.googleAdsConversionLabel}`:null}),En({confirmation:v,lines:a}),b(),X&&He&&Ie==="new")try{await de.createAddress({label:ft.trim()||"Home",contact_name:`${oe} ${ge}`.trim(),phone:j.trim(),address:Nt,city:ye,zip_code:N,country:F}),yt("Address saved to your account.")}catch{yt("We couldn't save the address to your account \u2014 you can add it under Account \u2192 Addresses.")}if(h==="card"&&t.paymentMethods.includes("card")){let P=await L.createPaymentIntent({idempotencyKey:M});Ve(v),Un(P)}else if(h==="paypal"&&t.paymentMethods.includes("paypal"))Ve(v),$n(!0);else if(h==="afterpay"&&t.paymentMethods.includes("afterpay")){let P=window.location.origin,I=await L.createAfterpayCheckout({idempotencyKey:M,confirmUrl:`${P}/checkout?afterpay=confirm`,cancelUrl:`${P}/checkout?afterpay=cancel`}),q={idempotencyKey:M,confirmation:v};Y.setItem(at,JSON.stringify(q)),window.location.assign(I.redirectCheckoutUrl);return}else if(h==="square"&&t.paymentMethods.includes("square"))Ve(v),Yn(!0);else if(h==="gocardless"&&t.paymentMethods.includes("gocardless")){let P=window.location.origin,I=await L.createGocardlessBillingRequest({idempotencyKey:M,confirmUrl:`${P}/checkout?gocardless=confirm`,cancelUrl:`${P}/checkout?gocardless=cancel`}),q={idempotencyKey:M,confirmation:v};Y.setItem(Ue,JSON.stringify(q)),window.location.assign(I.authorisationUrl);return}else if(h==="zip"&&t.paymentMethods.includes("zip")){let P=window.location.origin,I=await L.createZipCheckout({idempotencyKey:M,redirectUrl:`${P}/checkout?zip=return`}),q={idempotencyKey:M,confirmation:v};Y.setItem(ot,JSON.stringify(q)),window.location.assign(I.redirectUrl);return}else if(h==="klarna"&&t.paymentMethods.includes("klarna")){let P=window.location.origin,I=await L.createKlarnaCheckout({idempotencyKey:M,confirmUrl:`${P}/checkout?klarna=confirm`,cancelUrl:`${P}/checkout?klarna=cancel`}),q={idempotencyKey:M,confirmation:v};Y.setItem(Ke,JSON.stringify(q)),window.location.assign(I.redirectUrl);return}else U(v)}catch(f){Le(f instanceof qe?f.message:"Could not place the order. Please try again."),Pe(!1)}}return Oe?c("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[r("h1",{className:"font-display text-3xl",children:bt?"Payment received":"Order received"}),c("p",{className:"text-fg-dim",children:[bt?c(_,{children:["Thank you \u2014 your payment for order"," ",r("span",{className:"font-mono text-fg",children:Oe.orderNumber})," has gone through."," "]}):c(_,{children:["Thank you \u2014 your order ",r("span",{className:"font-mono text-fg",children:Oe.orderNumber})," is being reviewed by our team."," "]}),X?c(_,{children:["Track it under"," ",r(te,{href:"/account/orders",className:"text-accent underline",children:"your orders"}),"."]}):r(_,{children:"We\u2019ve emailed you a link to set a password and track it."})]}),xt&&r("p",{className:"text-sm text-fg-dim",children:xt}),gt&&r("p",{className:"text-sm text-fg-dim",children:gt}),!X&&c("p",{className:"text-sm text-fg-dim",children:["You can also"," ",r(te,{href:`/track?order=${encodeURIComponent(Oe.orderNumber)}`,className:"text-accent underline",children:"track this order"})," ","anytime with just your order number and email \u2014 no password needed."]}),r(te,{href:"/wheels",className:"mt-2 border-2 border-line px-6 py-3 font-mono text-[12px] uppercase tracking-[0.24em] hover:border-accent",children:"Continue browsing"})]}):zn?c("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[r("h1",{className:"font-display text-3xl",children:"Confirming your payment\u2026"}),r("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Checking with Afterpay \u2014 one moment."})]}):Hn?c("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[r("h1",{className:"font-display text-3xl",children:"Setting up your direct debit\u2026"}),r("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Confirming with GoCardless \u2014 one moment."})]}):Vn?c("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[r("h1",{className:"font-display text-3xl",children:"Confirming your payment\u2026"}),r("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Checking with Zip \u2014 one moment."})]}):Jn?c("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[r("h1",{className:"font-display text-3xl",children:"Confirming your payment\u2026"}),r("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Checking with Klarna \u2014 one moment."})]}):vt?r(Kr,{payment:vt,onPaid:()=>{pe(!0),U(V)},onSkip:()=>U(V)}):Kn&&V?r(Yr,{confirmation:V,clientId:t.paypalClientId??"",idemKey:M,onPaid:()=>{pe(!0),U(V)},onSkip:()=>U(V)}):Wn&&V?r(Br,{confirmation:V,applicationId:t.squareApplicationId??"",locationId:t.squareLocationId??"",environment:t.squareEnvironment??"production",idemKey:M,onPaid:()=>{pe(!0),U(V)},onSkip:()=>U(V)}):c("div",{ref:wt,className:"bg-bg text-fg",children:[c("header",{ref:Xn,className:"sticky top-0 z-30 grid grid-cols-[1fr_auto_1fr] items-center gap-8 border-b border-line px-[var(--sf-site-gutter,40px)] py-[22px] backdrop-blur-md max-[640px]:px-[min(20px,var(--sf-site-gutter,40px))] max-[640px]:py-4",style:{background:"color-mix(in oklab, var(--bg) 92%, transparent)"},children:[c(te,{href:"/",className:"inline-flex items-center gap-2.5 font-mono text-[13px] uppercase tracking-[0.26em] text-fg-dim transition-colors hover:text-accent",children:["\u2190",r("span",{className:"max-[640px]:hidden",children:"Back to shop"})]}),r(te,{href:"/","aria-label":`${t.name} home`,className:"inline-flex items-center justify-center",children:r(Dt,{variant:"header",scrolled:!0,src:e?.url??null,reverse:e?.reverse??!1,reversedSrc:e?.reversed??null,inkIsDark:e?.inkIsDark??null,size:e?.size??"medium",sizePx:e?.sizePx??null,siteName:t.name})}),t.cardPayments?c("span",{className:"flex items-center justify-end gap-2.5 font-mono text-[12px] uppercase tracking-[0.26em] text-fg-dim",children:[r("span",{className:"text-green",children:"\u25CF"}),r("span",{className:"max-[640px]:hidden",children:"Encrypted \xB7"})," Stripe"]}):r("span",{})]}),c("section",{className:"mx-auto flex max-w-[var(--sf-site-width,1600px)] flex-wrap items-center justify-between gap-x-8 gap-y-3 border-b border-line bg-surface px-[var(--sf-site-gutter,40px)] py-4 font-mono text-[13px] font-medium uppercase tracking-[0.24em] text-fg max-[1100px]:px-[min(24px,var(--sf-site-gutter,40px))]",children:[r("span",{className:"inline-flex items-center bg-accent px-2.5 py-1 font-bold text-bg",children:"Checkout"}),r("nav",{"aria-label":"Checkout steps",className:"flex flex-wrap items-center gap-5",children:[{n:"01",label:"Cart",state:"done"},{n:"02",label:"Ship & pay",state:"active"},{n:"03",label:"Review",state:"pending"},{n:"04",label:"Confirmed",state:"pending"}].map(i=>c("span",{className:["relative flex items-center gap-2 transition-colors",i.state==="pending"?"text-fg-dim":"text-fg",i.state==="active"?"font-bold after:absolute after:inset-x-0 after:-bottom-1 after:h-[2px] after:bg-accent":""].join(" "),children:[r("span",{className:i.state==="done"?"text-accent font-bold":"",children:i.n}),r("span",{children:i.label})]},i.n))})]}),c("main",{className:"mx-auto grid max-w-[var(--sf-site-width,1600px)] grid-cols-[1fr_420px] items-start gap-16 px-[var(--sf-site-gutter,40px)] pt-9 pb-[100px] max-[1100px]:grid-cols-1 max-[1100px]:gap-10 max-[1100px]:px-[min(24px,var(--sf-site-gutter,40px))] max-[1100px]:pt-8 max-[1100px]:pb-20",children:[c("div",{children:[c($e,{num:"N\xB0 01",title:"Contact",children:[r(z,{label:"Email",hint:X?c(_,{children:["Signed in \xB7"," ",r("button",{type:"button",onClick:Zn,className:"underline transition-colors hover:text-accent",children:"Not you? Sign out"})]}):void 0,children:r("input",{type:"email",value:ae,onChange:i=>Ne(i.target.value),placeholder:"you@example.com",readOnly:X!==null,className:K+(X?" opacity-70":"")})}),c(Tn,{children:[r(z,{label:"First name",children:r("input",{type:"text",value:oe,onChange:i=>Ee(i.target.value),className:K})}),r(z,{label:"Last name",children:r("input",{type:"text",value:ge,onChange:i=>Re(i.target.value),className:K})})]})]}),c($e,{num:"N\xB0 02",title:m?"Collection":"Shipping address",children:[m?c("div",{className:"grid gap-1.5 text-[14px] leading-[1.6]",children:[r("span",{className:"font-medium",children:m.name}),[m.address,m.city,m.state,m.zipCode,m.country].filter(Boolean).length>0&&r("span",{className:"opacity-80",children:[m.address,m.city,m.state,m.zipCode,m.country].filter(Boolean).join(", ")}),m.openingHours&&r("span",{className:"opacity-80",children:m.openingHours}),m.instructions&&r("span",{className:"opacity-80",children:m.instructions}),r("span",{className:"mt-1 font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"No delivery address needed"})]}):c(_,{children:[X!==null&&pt.length>0&&c("div",{className:"grid gap-2.5",children:[pt.map(i=>r(We,{active:Ie===i.id,onClick:()=>{Ae(i.id),Pt(i)},title:i.label,body:i.formatted_address,price:null},i.id)),r(We,{active:Ie==="new",onClick:()=>Ae("new"),title:"New address",body:null,price:null})]}),r(z,{label:"Address line 1",children:r("input",{type:"text",value:Q,onChange:i=>ee(i.target.value),className:K})}),r(z,{label:"Address line 2",children:r("input",{type:"text",value:W,onChange:i=>B(i.target.value),placeholder:"Apartment, unit, garage bay\u2026",className:K})}),c(Tn,{cols:"three",children:[r(z,{label:"City",children:r("input",{type:"text",value:ye,onChange:i=>le(i.target.value),className:K})}),r(z,{label:Dn,children:r("input",{type:"text",value:N,onChange:i=>he(i.target.value),className:K})}),r(z,{label:"Country",children:r(Qe,{value:F,onChange:i=>ue(i.target.value),className:K+" pr-10",style:Ln,children:y.map(i=>r("option",{value:i.code,children:i.name},i.code))})})]}),r(z,{label:Fn,children:ve.length>0?c(Qe,{value:w,onChange:i=>H(i.target.value),className:K+" pr-10",style:Ln,children:[r("option",{value:"",children:"Select\u2026"}),ve.map(i=>r("option",{value:i.code||i.name,children:i.name},i.code||i.name))]}):r("input",{type:"text",value:w,onChange:i=>H(i.target.value),className:K})})]}),r(z,{label:"Phone",children:r("input",{type:"tel",value:j,onChange:i=>ie(i.target.value),placeholder:"+44 7700 900000",className:K})}),!m&&X!==null&&Ie==="new"&&c(_,{children:[r(_n,{checked:He,onChange:mt,label:"Save this address to my account"}),He&&r(z,{label:"Address label",children:r("input",{type:"text",value:ft,onChange:i=>Mn(i.target.value),placeholder:"Home",className:K})})]}),!m&&r(_n,{checked:J,onChange:ne,label:"Billing address is the same as shipping"})]}),r($e,{num:"N\xB0 03",title:"Shipping",children:c("div",{className:"grid gap-2.5",children:[l.map(i=>{let f=i.pickupLocation,v=f?[f.address,f.city,f.state,f.zipCode].filter(Boolean).join(", "):null;return r(We,{active:p===i.id,onClick:()=>d(i.id),title:f?`${i.name} \u2014 ${f.name}`:i.name,body:f?[v,f.openingHours,f.instructions,i.description].filter(Boolean).join(" \xB7 "):i.description||null,price:o.freeShipping||i.amount===0?"Free":x(i.amount,o.currency),tag:i.tag||void 0},i.id)}),l.length===0&&r("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"Shipping is arranged after your order is reviewed."})]})}),c($e,{num:"N\xB0 04",title:"Payment",children:[r("div",{className:"grid gap-2.5",children:je.map(i=>r(We,{active:h===i.key,onClick:()=>G(i.key),title:i.title,body:i.body,price:i.price,tag:i.tag},i.key))}),h==="card"?r("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You\u2019ll enter card details on the secure payment step after placing the order."}):h==="paypal"?r("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You\u2019ll approve the payment with PayPal on the payment step after placing the order."}):h==="afterpay"?r("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You\u2019ll be taken to Afterpay to approve four interest-free payments, then brought straight back."}):h==="square"?r("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You\u2019ll enter card details on the secure payment step after placing the order."}):h==="gocardless"?r("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You\u2019ll set up a bank direct debit with GoCardless, then be brought straight back. Direct debits clear in a few days."}):h==="zip"?r("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You\u2019ll be taken to Zip to approve four instalments, then brought straight back."}):h==="klarna"?r("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You\u2019ll be taken to Klarna to choose how to pay, then brought straight back."}):r("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"Our team emails you the invoice and bank details after review."})]})]}),c("aside",{className:"sticky top-[var(--sf-checkout-header-h,88px)] border border-line max-[1100px]:static",style:{background:"linear-gradient(180deg, color-mix(in oklab, var(--surface) 70%, var(--bg)) 0%, var(--bg) 100%)"},children:[c("header",{className:"flex items-center justify-between border-b border-accent bg-accent px-6 py-3.5 font-mono text-[13px] font-bold uppercase tracking-[0.28em] text-bg",children:[r("span",{children:"Your order"}),r(te,{href:"/wheels",className:"text-bg/80 transition-colors hover:text-bg",children:"Edit \u2197"})]}),r("div",{className:"flex flex-col px-6 py-2",children:a.length===0?c("div",{className:"py-8 text-center font-serif text-[16px] italic leading-[1.5] text-fg-dim",children:["Your cart is empty. ",r(te,{href:"/wheels",className:"text-accent underline-offset-4 hover:underline",children:"Browse the catalog \u2192"})]}):a.map(i=>r(Hr,{slug:i.slug,name:i.name,qty:i.qty,config:i.config,configSummary:Vr(i.config),price:jt(i,o.currency)??0,currency:o.currency},i.id))}),r("div",{className:"border-t border-line px-6 pt-5",children:r($t,{customerEmail:ae})}),c("div",{className:"flex flex-col gap-2 border-t border-line mt-5 px-6 pt-5",children:[r(fe,{label:"Subtotal",value:x(o.subtotal,o.currency)}),o.discount>0&&s?.valid&&r(fe,{label:`Coupon \xB7 ${s.code}`,value:c("span",{className:"font-semibold text-green",children:["\u2212 ",x(o.discount,o.currency)]})}),s?.valid&&s.effects?.gift&&r(fe,{label:`Free gift \xB7 ${s.effects.gift.partNumber}${s.effects.gift.quantity>1?` \xD7${s.effects.gift.quantity}`:""}`,value:r("span",{className:"font-semibold text-green",children:"Free"})}),r(fe,{label:"Shipping",value:o.freeShipping||o.shipping===0?r("span",{className:"font-semibold text-green",children:"Free"}):x(o.shipping,o.currency)}),o.tax&&(o.tax.charged?r(fe,{label:o.tax.inclusive?`${o.tax.name} included \xB7 ${o.tax.rate}%`:o.tax.name,value:x(o.tax.amount,o.currency)}):o.tax.name?r(fe,{label:o.tax.name,value:"Calculated at checkout"}):null)]}),c("div",{className:"mt-4 flex items-end justify-between border-y-2 border-accent px-6 py-4",style:{background:"color-mix(in oklab, var(--accent) 10%, var(--bg))"},children:[r("span",{className:"font-display text-[20px] font-bold uppercase tracking-[0.04em] text-fg",children:"Total"}),r("span",{className:"text-right font-display text-[34px] font-bold leading-none tracking-[-0.025em] text-fg",children:x(o.grand,o.currency)})]}),c("div",{className:"flex flex-col gap-2.5 px-6 pt-[18px] pb-6",children:[ht&&r("p",{className:"border border-red-300 bg-red-50 px-3 py-2 text-[13px] text-red-700",children:ht}),o.hasUnpricedLine&&c("p",{className:"border border-amber-300 bg-amber-50 px-3 py-2 text-[13px] text-amber-800",children:["One or more items have no price in ",o.currency,". Remove them, or switch region, to continue."]}),r("button",{type:"button",onClick:Qn,disabled:re||a.length===0||o.hasUnpricedLine,className:["group flex items-center justify-between border px-5 py-5 font-mono text-[14px] font-medium uppercase tracking-[0.3em] transition-all",a.length===0||re||o.hasUnpricedLine?"cursor-not-allowed border-line bg-surface text-fg-dim":"border-btn bg-btn text-btn-ink hover:border-fg hover:bg-fg"].join(" "),children:re?c(_,{children:["Building order\u2026 ",r("span",{children:"\xB7"})]}):c(_,{children:[h==="bank"?"Place order":"Continue to payment"," \xB7"," ",x(o.grand,o.currency),r("span",{className:"transition-transform group-hover:translate-x-1",children:"\u2192"})]})})]})]})]}),r("footer",{className:"flex flex-wrap items-center justify-between gap-4 border-t border-line px-[var(--sf-site-gutter,40px)] py-6 font-mono text-[12px] uppercase tracking-[0.22em] text-fg-dim max-[640px]:px-[min(20px,var(--sf-site-gutter,40px))]",children:r("span",{children:Ft({legalName:t.legalName,foundedYear:t.foundedYear,siteName:t.name})})})]})}var K="w-full border-2 border-line bg-bg px-4 py-3.5 font-display text-[17px] tracking-[-0.005em] text-fg outline-none transition-colors placeholder:text-fg-dim hover:border-fg-dim focus:border-accent",Ln={backgroundImage:"linear-gradient(45deg, transparent 50%, var(--accent) 50%), linear-gradient(135deg, var(--accent) 50%, transparent 50%)",backgroundPosition:"calc(100% - 18px) 50%, calc(100% - 12px) 50%",backgroundSize:"6px 6px",backgroundRepeat:"no-repeat"};function $e({num:t,title:e,children:n}){return c("section",{className:"mb-6 border border-line bg-bg",children:[c("header",{className:"flex items-center gap-4 border-b border-line bg-surface px-6 py-3.5",children:[r("span",{className:"inline-flex items-center justify-center bg-accent px-2.5 py-1 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-bg",children:t}),r("h2",{className:"font-display text-[26px] font-medium uppercase leading-none tracking-[-0.02em] text-fg",children:e})]}),r("div",{className:"flex flex-col gap-4 px-6 py-6",children:n})]})}function Tn({cols:t="two",children:e}){return r("div",{className:["grid gap-3 max-[640px]:grid-cols-1",t==="two"?"grid-cols-2":"grid-cols-[1.2fr_1fr_1fr]"].join(" "),children:e})}function z({label:t,hint:e,children:n}){return c("div",{className:"relative flex flex-col gap-2",children:[r("label",{className:"font-mono text-[12px] font-semibold uppercase tracking-[0.22em] text-fg",children:t}),n,e&&r("span",{className:"font-mono text-[11px] uppercase tracking-[0.22em] text-fg-dim",children:e})]})}function We({active:t,onClick:e,title:n,body:a,price:o,tag:s}){return c("button",{type:"button",onClick:e,"aria-pressed":t,className:["relative grid grid-cols-[auto_1fr_auto] items-center gap-[18px] border bg-bg px-[22px] py-[18px] text-left transition-colors",t?"border-accent outline outline-1 outline-accent -outline-offset-1":"border-line hover:border-[color-mix(in_oklab,var(--accent)_50%,var(--line))]"].join(" "),style:t?{background:"color-mix(in oklab, var(--accent) 14%, var(--bg))"}:void 0,children:[t&&r("span",{"aria-hidden":!0,className:"absolute inset-y-0 left-0 w-[3px] bg-accent"}),r("span",{className:["flex h-[18px] w-[18px] items-center justify-center rounded-full border-2",t?"border-accent":"border-fg-dim"].join(" "),children:t&&r("span",{className:"block h-2.5 w-2.5 rounded-full bg-accent"})}),c("span",{className:"flex min-w-0 flex-col gap-1",children:[c("span",{className:"flex flex-wrap items-baseline gap-2.5 font-display text-[18px] font-medium tracking-[-0.01em] text-fg",children:[n,s&&r("span",{className:"border px-1.5 py-0.5 font-mono text-[11px] font-normal uppercase tracking-[0.24em] text-accent",style:{background:"color-mix(in oklab, var(--accent) 14%, transparent)",borderColor:"color-mix(in oklab, var(--accent) 45%, var(--line))"},children:s})]}),a&&r("span",{className:"font-mono text-[12px] uppercase tracking-[0.22em] text-fg-dim",children:a})]}),r("span",{className:"whitespace-nowrap font-display text-[18px] font-medium tracking-[-0.01em] text-fg",children:o})]})}function Kr({payment:t,onPaid:e,onSkip:n}){let{formatMoney:a}=se(),o=Ye(()=>bn(t.publishableKey),[t.publishableKey]),s=Ye(()=>{if(typeof document>"u")return;let l=getComputedStyle(document.documentElement),p=(u,b)=>l.getPropertyValue(u).trim()||b,d=document.documentElement.getAttribute("data-theme")!=="light";return{theme:d?"night":"stripe",variables:{colorPrimary:p("--accent",d?"#c9a461":"#8a6a2a"),colorBackground:p("--surface",d?"#131313":"#ffffff"),colorText:p("--fg",d?"#f5f1e8":"#0a0a0a"),borderRadius:"0px"}}},[]);return r("div",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-bg px-6 py-16 text-fg",children:c("div",{className:"w-full max-w-xl border border-line bg-bg",children:[c("header",{className:"flex items-center justify-between gap-4 border-b border-line bg-surface px-6 py-3.5",children:[r("span",{className:"inline-flex items-center justify-center bg-accent px-2.5 py-1 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-bg",children:t.orderNumber}),r("h1",{className:"font-display text-[26px] font-medium uppercase leading-none tracking-[-0.02em] text-fg",children:"Payment"})]}),c("div",{className:"flex flex-col gap-4 px-6 py-6",children:[c("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:["Your order is placed. Pay"," ",r("span",{className:"text-fg",children:a(Number(t.amount),t.currency)})," ","by card to confirm it now."]}),r(rt,{stripe:o,options:{clientSecret:t.clientSecret,appearance:s},children:r($r,{payment:t,onPaid:e,onSkip:n})})]})]})})}function $r({payment:t,onPaid:e,onSkip:n}){let{formatMoney:a}=se(),o=pn(),s=ln(),[l,p]=g(!1),[d,u]=g(null);async function b(){if(!o||!s||l)return;p(!0),u(null);let m=await o.confirmPayment({elements:s,redirect:"if_required"});if(m.error){u(m.error.message??"Payment failed. Please try again."),p(!1);return}let C=m.paymentIntent?.status;if(C==="succeeded"||C==="processing"){e();return}u("Payment did not complete. Please try again."),p(!1)}return c("div",{className:"flex flex-col gap-4",children:[r(dn,{}),d&&r("p",{className:"border border-red-300 bg-red-50 px-3 py-2 text-[13px] text-red-700",children:d}),r("button",{type:"button",onClick:b,disabled:!o||!s||l,className:["group flex items-center justify-between border px-5 py-5 font-mono text-[14px] font-medium uppercase tracking-[0.3em] transition-all",!o||!s||l?"cursor-not-allowed border-line bg-surface text-fg-dim":"border-btn bg-btn text-btn-ink hover:border-fg hover:bg-fg"].join(" "),children:l?c(_,{children:["Processing\u2026 ",r("span",{children:"\xB7"})]}):c(_,{children:["Pay ",a(Number(t.amount),t.currency),r("span",{className:"transition-transform group-hover:translate-x-1",children:"\u2192"})]})}),r("button",{type:"button",onClick:n,disabled:l,className:"self-center font-mono text-[11px] uppercase tracking-[0.24em] text-fg-dim underline-offset-4 transition-colors hover:text-accent hover:underline",children:"Pay later \u2014 our team will be in touch"})]})}var jn="paypal-sdk-js",st=null;function Wr(t,e){let n=`${t}|${e}`;if(st?.key===n)return st.promise;let a=new Promise((o,s)=>{document.getElementById(jn)?.remove();let l=document.createElement("script");l.id=jn;let p=new URLSearchParams({"client-id":t,currency:e,intent:"capture"});l.src=`https://www.paypal.com/sdk/js?${p}`,l.onload=()=>{let d=window.paypal;d?o(d):s(new Error("PayPal SDK loaded without its namespace"))},l.onerror=()=>s(new Error("PayPal SDK failed to load")),document.head.appendChild(l)});return st={key:n,promise:a},a}function Yr({confirmation:t,clientId:e,idemKey:n,onPaid:a,onSkip:o}){let{formatMoney:s}=se(),l=ce(null),[p,d]=g(!1),[u,b]=g(null),m=ce(a);return m.current=a,$(()=>{let C=!1,y=null;return Wr(e,t.currency).then(A=>{if(!(C||!l.current))return y=A.Buttons({style:{layout:"vertical",color:"gold",shape:"rect",label:"paypal"},createOrder:async()=>(await L.createPaypalOrder({idempotencyKey:n})).paypalOrderId,onApprove:async x=>{try{if((await L.capturePaypalOrder({idempotencyKey:n,paypalOrderId:x.orderID})).status==="paid"){m.current();return}b("PayPal did not complete the payment. Please try again.")}catch(h){b(h instanceof qe?h.message:"PayPal payment failed. Please try again.")}},onError:()=>{b("PayPal could not process the payment. Please try again.")}}),y.render(l.current).then(()=>{C||d(!0)})}).catch(()=>{C||b("PayPal could not be loaded. You can pay later \u2014 your order stands either way.")}),()=>{C=!0,y?.close?.()}},[e,t.currency,n]),r("div",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-bg px-6 py-16 text-fg",children:c("div",{className:"w-full max-w-xl border border-line bg-bg",children:[c("header",{className:"flex items-center justify-between gap-4 border-b border-line bg-surface px-6 py-3.5",children:[r("span",{className:"inline-flex items-center justify-center bg-accent px-2.5 py-1 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-bg",children:t.orderNumber}),r("h1",{className:"font-display text-[26px] font-medium uppercase leading-none tracking-[-0.02em] text-fg",children:"PayPal"})]}),c("div",{className:"flex flex-col gap-4 px-6 py-6",children:[c("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:["Your order is placed. Pay"," ",r("span",{className:"text-fg",children:s(Number(t.grandTotal),t.currency)})," ","with PayPal to confirm it now."]}),!p&&!u&&r("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"Loading PayPal\u2026"}),r("div",{ref:l}),u&&r("p",{className:"border border-red-300 bg-red-50 px-3 py-2 text-[13px] text-red-700",children:u}),r("button",{type:"button",onClick:o,className:"self-center font-mono text-[11px] uppercase tracking-[0.24em] text-fg-dim underline-offset-4 transition-colors hover:text-accent hover:underline",children:"Pay later \u2014 our team will be in touch"})]})]})})}var qn="square-web-sdk",ct=null;function zr(t){let e=t==="sandbox"?"sandbox":"production";if(ct?.key===e)return ct.promise;let n=new Promise((a,o)=>{document.getElementById(qn)?.remove();let s=document.createElement("script");s.id=qn,s.src=e==="sandbox"?"https://sandbox.web.squarecdn.com/v1/square.js":"https://web.squarecdn.com/v1/square.js",s.onload=()=>{let l=window.Square;l?a(l):o(new Error("Square SDK loaded without its namespace"))},s.onerror=()=>o(new Error("Square SDK failed to load")),document.head.appendChild(s)});return ct={key:e,promise:n},n}function Br({confirmation:t,applicationId:e,locationId:n,environment:a,idemKey:o,onPaid:s,onSkip:l}){let{formatMoney:p}=se(),d=ce(null),u=ce(null),b=ce(null),[m,C]=g(!1),[y,A]=g(!1),[x,h]=g(null);$(()=>{let D=!1,O=null;return zr(a).then(async J=>{if(D||!d.current)return;let ne=J.payments(e,n);b.current=ne,O=await ne.card(),await O.attach(d.current),u.current=O,D||C(!0)}).catch(()=>{D||h("Square could not be loaded. You can pay later \u2014 your order stands either way.")}),()=>{D=!0,O?.destroy?.()}},[e,n,a]);async function G(){let D=u.current;if(!(!D||y)){A(!0),h(null);try{let O=await D.tokenize();if(O.status!=="OK"||!O.token){h(O.errors?.[0]?.message??"Please check the card details and try again."),A(!1);return}let J;try{J=(await b.current?.verifyBuyer?.(O.token,{amount:String(t.grandTotal),currencyCode:t.currency,intent:"CHARGE"}))?.token}catch{}if((await L.chargeSquare({idempotencyKey:o,sourceId:O.token,...J?{verificationToken:J}:{}})).status==="paid"){s();return}h("Square did not complete the payment. Please try again.")}catch(O){h(O instanceof qe?O.message:"Square payment failed. Please try again.")}A(!1)}}return r("div",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-bg px-6 py-16 text-fg",children:c("div",{className:"w-full max-w-xl border border-line bg-bg",children:[c("header",{className:"flex items-center justify-between gap-4 border-b border-line bg-surface px-6 py-3.5",children:[r("span",{className:"inline-flex items-center justify-center bg-accent px-2.5 py-1 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-bg",children:t.orderNumber}),r("h1",{className:"font-display text-[26px] font-medium uppercase leading-none tracking-[-0.02em] text-fg",children:"Card"})]}),c("div",{className:"flex flex-col gap-4 px-6 py-6",children:[c("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:["Your order is placed. Pay"," ",r("span",{className:"text-fg",children:p(Number(t.grandTotal),t.currency)})," ","by card to confirm it now."]}),!m&&!x&&r("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"Loading card form\u2026"}),r("div",{ref:d}),x&&r("p",{className:"border border-red-300 bg-red-50 px-3 py-2 text-[13px] text-red-700",children:x}),r("button",{type:"button",onClick:G,disabled:!m||y,className:["group flex items-center justify-between border px-5 py-5 font-mono text-[14px] font-medium uppercase tracking-[0.3em] transition-all",!m||y?"cursor-not-allowed border-line bg-surface text-fg-dim":"border-btn bg-btn text-btn-ink hover:border-fg hover:bg-fg"].join(" "),children:y?c(_,{children:["Processing\u2026 ",r("span",{children:"\xB7"})]}):c(_,{children:["Pay ",p(Number(t.grandTotal),t.currency),r("span",{className:"transition-transform group-hover:translate-x-1",children:"\u2192"})]})}),r("button",{type:"button",onClick:l,disabled:y,className:"self-center font-mono text-[11px] uppercase tracking-[0.24em] text-fg-dim underline-offset-4 transition-colors hover:text-accent hover:underline",children:"Pay later \u2014 our team will be in touch"})]})]})})}function _n({checked:t,onChange:e,label:n,sub:a}){return c("div",{className:"flex items-start gap-3 border-t border-line py-3.5 first:border-t-0 first:pt-0",children:[r("button",{type:"button",onClick:()=>e(!t),"aria-pressed":t,"aria-label":n,className:["mt-px flex h-5 w-5 flex-shrink-0 items-center justify-center border transition-colors",t?"border-accent":"border-line"].join(" "),style:t?{background:"color-mix(in oklab, var(--accent) 18%, transparent)"}:void 0,children:t&&r("span",{className:"text-[13px] text-accent",children:"\u2713"})}),c("span",{className:"flex-1 font-display text-[16px] leading-[1.5] text-fg",children:[n,a&&r("small",{className:"mt-1 block font-mono text-[12px] uppercase tracking-[0.18em] text-fg-dim",children:a})]})]})}function Hr({slug:t,name:e,qty:n,config:a,configSummary:o,price:s,currency:l}){let{catalog:p}=Xe(),{formatMoney:d}=se(),u=p.find(x=>x.slug===t),b=u?.spokes??5,m=u?.mesh??!1,C=a.find(x=>x.gold)?.label,y=u?.finishes.find(x=>x.name===C&&x.src)??u?.finishes.find(x=>x.src),A=u?.finishes[0]?.color??_t;return c("div",{className:"grid grid-cols-[60px_1fr_auto] items-center gap-3.5 border-b border-line py-4 last:border-b-0",children:[c("div",{className:"relative flex aspect-square items-center justify-center overflow-hidden border border-line bg-surface",children:[r("span",{className:"absolute -right-1.5 -top-1.5 z-[2] flex h-[18px] w-[18px] items-center justify-center rounded-full bg-accent font-mono text-[11px] font-bold text-bg",children:n}),y?.src?r(Rt,{src:y.src,alt:`${e.lead}${e.accent} \u2014 ${y.name}`,width:120,height:120,sizes:"60px",className:"relative block h-full w-full object-contain p-1.5"}):r("div",{className:"block w-[78%]",style:{color:A},children:r(Kt,{spokes:b,mesh:m,className:"block w-full"})})]}),c("div",{className:"flex min-w-0 flex-col gap-0.5",children:[c("span",{className:"font-display text-[17px] font-bold uppercase leading-none tracking-[-0.005em] text-fg",children:[e.lead,r("em",{className:"font-serif font-normal italic text-accent tracking-[-0.005em] normal-case",children:e.accent})]}),r("span",{className:"font-mono text-[12px] uppercase leading-[1.5] tracking-[0.18em] text-fg-dim",children:o})]}),r("span",{className:"text-right font-display text-[17px] font-bold tracking-[-0.005em] text-fg",children:d(s,l)})]})}function fe({label:t,value:e}){return c("div",{className:"flex items-center justify-between font-mono text-[13px] font-medium uppercase tracking-[0.18em] text-fg",children:[r("span",{children:t}),r("strong",{className:"font-display text-[16px] font-medium tracking-[-0.005em] normal-case text-fg",children:e})]})}function Vr(t){return t.map(e=>e.label).join(" \xB7 ")}import{jsx as ze}from"react/jsx-runtime";function Gr(){let{settings:t,websiteName:e}=Mt(),n=e?{...Ze,name:e}:Ze,a=t?{url:t.logoUrl,reversed:t.logoReversed??null,inkIsDark:t.logoInkIsDark??null,reverse:t.reverseLogo,size:t.logoSize,sizePx:t.logoSizePx}:null;return ze("div",{style:{position:"fixed",inset:0,zIndex:2147482e3,overflowY:"auto",background:"var(--bg)",color:"var(--fg)"},children:ze(Ot,{children:ze(qt,{preview:!0,children:ze(lt,{site:n,logo:a,preview:!0})})})})}export{Gr 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-WMFQNAWF.js";import"./chunk-4G3T6ZD2.js";import{a as ve}from"./chunk-K3Y6UBLO.js";import{Aj as be,La as ue,Oh as Te,Sj as w,if as ge,kf as ye,lf as ke,mc as fe,mk as Pe,ok as we,qf as Se,wj as P}from"./chunk-UTFM4DGR.js";import{Ea as ae,Ia as de,Ka as pe,La as me}from"./chunk-4KLEZTLW.js";import"./chunk-RF5DTRJ5.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{useEditor as st}from"efficient-easel/editor";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}=we(),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=>Te(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(ve,{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:Pe,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(be,{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{b as d}from"./chunk-UBYBQ3KR.js";import"./chunk-Y6SLVHK3.js";import{useEffect as i,useState as c}from"react";import{createEditor as p,EditorProvider as m}from"efficient-easel/editor";import{jsx as l}from"react/jsx-runtime";function E({config:o,data:s,onChange:r,permissions:e,children:f}){let[t]=c(()=>p({config:o,data:s,permissions:e}));i(()=>{t.setConfig(o)},[t,o]),i(()=>{if(!r)return;let n=t.getState().appState.data;return t.subscribe(()=>{let a=t.getState().appState.data;a!==n&&(n=a,r(a))})},[t,r]),i(()=>{e&&t.setPermissions(e)},[t,e]);let u=d();return l(m,{editor:t,hotkeys:u.ownsDocument,children:f})}export{E as default};
@@ -1 +0,0 @@
1
- "use client";import{A as ta,B as na,C as oa,D as ia,E as ra,a as bt,b as Ko,c as qs,d as Vs,e as Vt,f as Uo,g as Un,h as Yn,i as Gs,j as Ks,k as Us,l as Xn,m as Ys,n as Yo,o as Xo,p as vt,q as Zo,r as Jo,s as Qo,t as Xs,u as Zs,v as Le,w as Jn,x as Js,y as Qs,z as ea}from"./chunk-WMFQNAWF.js";import{a as _s,b as js}from"./chunk-IVOJJ6LW.js";import{g as Zn}from"./chunk-4G3T6ZD2.js";import{B as qo,C as jo,D as Vo,E as Go,F as Ds,G as zs,H as Os,I as Bs,K as $s,L as Fs,M as Ws,a as Et,b as jt,c as ms,h as ys,j as hs,l as vs,n as Ss,o as ks,q as Cs,r as As,t as Ke,u as Ns,y as _o,z as Ls}from"./chunk-KR3FTVDW.js";import{$b as un,Ah as ds,Aj as Ts,Cj as Is,Dj as Ps,Eb as Wr,Ig as ss,La as $r,Nj as Rs,Oh as cs,Ph as ps,Qh as us,Qj as Es,Rj as Wo,Sh as Gn,Sj as Pe,Zb as _r,Zf as is,_b as qr,_f as rs,ac as jr,bc as Vr,cj as bs,df as Zr,ei as gn,hb as dn,hi as fs,if as Jr,ih as as,ii as mn,jb as Fr,jc as Gr,jh as ls,kb as cn,kf as fn,ki as yn,lf as Qr,li as Ho,mc as _t,mf as es,mk as Ms,ni as gs,ok as Hs,pc as Kr,pj as xs,q as Lr,qf as qt,r as Dr,rc as Ur,s as qn,sc as Yr,tf as ns,uc as Xr,va as Or,vb as pn,wj as be,xj as $o,yf as os,yj as ws,zf as Mo,zi as Kn,zj as Fo}from"./chunk-UTFM4DGR.js";import{Ea as Vn,Fa as Oo,Ha as Br,Hc as We,Ia as Mr,Ja as Wt,Ka as Fe,La as oe,Ma as P,Oa as Bo,Pa as Hr,nd as ts}from"./chunk-4KLEZTLW.js";import{C as zr,T as jn}from"./chunk-RF5DTRJ5.js";import{b as Ft}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 Qa,StylesIcon as vc,MediaIcon as el,SitemapIcon as xc}from"efficient-easel/rail";import{LayersTree as Sc,Subtree as at,TreeGroupLabel as io,TreeRow as we,TreeRowAction as ro,TreeSeam as hi}from"efficient-easel/tree";import{DeviceSwitch as kc,EditorIconButton as tl,EditorTopBar as wc,InspectorIconButton as Cc,PanelResizeHandle as nl,SaveState as ol,SaveStateToggle as Tc,TopBarCluster as il,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 Ul}from"efficient-easel/chrome";import{jsx as Yl}from"react/jsx-runtime";function ei(){let{capabilities:n,access:r,takeOverEditing:a,viewReadOnly:m,saveConflict:u,reloadFromServer:f}=qt();return n.hasEditGuard?Yl(Ul,{access:r,conflict:u,noun:"page",onTakeOver:a,onViewReadOnly:m,onReload:f}):null}import{DesktopIcon as Xl,PhoneIcon as Zl,TabletIcon as Jl}from"efficient-easel/icons";import{jsx as ti}from"react/jsx-runtime";var Ql={desktop:ti(Xl,{}),tablet:ti(Jl,{}),mobile:ti(Zl,{})},sa=is.map(n=>({id:n,label:rs[n],icon:Ql[n]}));import{useEffect as od,useMemo as ha,useState as id}from"react";import{useEditor as rd}from"efficient-easel/editor";import{AddPanel as sd}from"efficient-easel/drag";import{AddIcon as ad}from"efficient-easel/icons";import{Fragment as pa,jsx as t,jsxs as d}from"react/jsx-runtime";var se={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:r,tone:a="dark",r:m=2,style:u}){return t("div",{style:{width:n,height:r,borderRadius:m,background:se[a],flex:"none",...u}})}var ed={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,r,a=160)=>({background:`linear-gradient(${a}deg,${n},${r})`});function st({size:n,style:r}){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,...r},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 aa({over:n,overTone:r,head:a,headSize:m=11.5,cta:u,ctaBg:f,ctaFg:b,tone:R}){return d(pa,{children:[n&&t("span",{style:{fontSize:"3.65cqw",letterSpacing:"0.16em",fontWeight:700,color:r},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:r}){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(st,{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:r})]})}function rt({k:n,v:r,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:r}),a&&t("span",{style:{color:i.rust,fontWeight:700},children:"\u2713"})]})]})}function q({title:n,children:r}){return d("div",{style:{...I,background:i.card,padding:"9px 10px",display:"flex",flexDirection:"column",gap:6},children:[t(bn,{children:n}),r]})}function la({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:r=6}){return d("span",{style:{fontSize:r,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:r,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:r})]})}function ge({children:n,w:r}){return t("span",{style:{fontSize:"3.98cqw",lineHeight:1.45,color:i.muted,width:r,display:"block"},children:n})}function Qn({label:n,w:r="100%",filled:a}){return d("div",{style:{width:r,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 da({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 td={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,r,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(st,{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:r}),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,r])=>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:r})]},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,r)=>t("span",{style:{fontSize:"3.65cqw",fontWeight:600,padding:"5px 7px",borderRadius:3,border:`1px solid ${r===0?i.rust:i.rule}`,color:r===0?i.rust:i.text,background:r===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,r,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:r})]},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,r],a)=>d("div",{style:{display:"flex",alignItems:"center",gap:3},children:[t("span",{style:{width:r,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(st,{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,r])=>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:r}),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,r,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:r}),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(da,{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,r)=>t("span",{style:{flex:1,textAlign:"center",fontSize:"3.32cqw",fontWeight:r===2?700:500,padding:"4px 0",borderRadius:3,background:r===2?i.text:i.paper,color:r===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,r)=>t("span",{style:{flex:1,textAlign:"center",fontSize:"3.32cqw",padding:"4px 0",borderRadius:3,border:`1px solid ${r===1?i.rust:i.rule}`,color:r===1?i.rust:i.muted,background:r===3?i.paper:i.card,textDecoration:r===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(da,{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(st,{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,r])=>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:r})]},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,r,a])=>d("div",{style:{display:"flex",gap:6,alignItems:"center"},children:[t("span",{style:{width:24,height:18,borderRadius:3,flex:"none",...X(n,r,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,r])=>d("div",{style:{display:"flex",gap:5},children:[t("b",{style:{fontSize:"3.98cqw",color:i.rust,flex:"none"},children:n}),t(ge,{children:r})]},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,r])=>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:r})]},r))})}),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,r)=>t("span",{style:{fontSize:"3.98cqw",fontWeight:r===0?700:500,padding:"5px 8px",color:r===0?i.text:i.muted,background:r===0?i.paper:"transparent",borderRadius:"4px 4px 0 0",border:`1px solid ${r===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,r)=>t("span",{style:{flex:1,height:`${n}%`,borderRadius:"2px 2px 0 0",background:r===4?i.rust:i.mark1}},r))}),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,r],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:r})]})]},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,r)=>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:r===3?i.warm:i.mark1}}),t("span",{style:{fontSize:"4.31cqw",fontWeight:700,color:r===3?i.warm:i.onInk,opacity:r===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,r])=>t("span",{style:{position:"absolute",left:n,top:r,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,r)=>t("span",{style:{fontSize:"3.98cqw",fontWeight:r===0?700:500,padding:"4px 7px",borderRadius:99,background:r===0?i.text:i.paper,color:r===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(st,{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,r],a)=>t("div",{style:{borderRadius:3,...X(n,r,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,r)=>t("span",{style:{fontSize:"3.98cqw",fontWeight:r===0?700:500,color:r===0?i.text:i.muted,borderBottom:`1.5px solid ${r===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,r],a)=>t("div",{style:{borderRadius:3,...X(n,r,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(st,{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(rt,{k:"Subtotal",v:"$1,956"}),t(rt,{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,r,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:r}),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,r])=>t("span",{style:{flex:1,textAlign:"center",fontSize:"3.65cqw",fontWeight:800,letterSpacing:"0.06em",color:i.onInk,borderRadius:3,padding:"6px 0",background:r},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(la,{}),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,r],a)=>t("div",{style:{flex:1,borderRadius:3,...X(n,r,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,r,a])=>d("div",{style:{display:"flex",gap:5,alignItems:"flex-start"},children:[t(la,{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:r})]}),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,r])=>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:r})]},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,r])=>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:r?"\u2212":"+"})]}),r&&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(aa,{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(st,{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(aa,{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(st,{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,r,a])=>t("div",{style:{borderRadius:4,display:"flex",alignItems:"flex-end",padding:5,color:i.onInk,...X(r,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(st,{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(rt,{k:"Diameter",v:'20"'}),t(rt,{k:"Width",v:"9.0J"}),t(rt,{k:"Offset",v:"+12"}),t(rt,{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(rt,{k:"Hilux N80",v:"20\xD79 +12",ok:!0}),t(rt,{k:"Ranger PX3",v:"20\xD79 +12",ok:!0}),t(rt,{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,r)=>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:r+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,r,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:r})]},"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,r])=>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:r})]},r))})},ca={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:se.line,marginBottom:10}}),d("div",{style:{flex:1,display:"flex",gap:10,border:`1px solid ${se.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 ${se.line}`,background:se.block}}),t(S,{w:34,h:13,r:5,tone:"accent"})]})]}),d("div",{style:{flex:1,background:se.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,r)=>d("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:6,borderTop:r?`1px solid ${se.line}`:"none",paddingTop:r?4:0},children:[t(S,{w:34,h:4,r:2,tone:"dark"}),t(S,{w:16,h:3,r:2,tone:"soft"})]},r))]})]})]}),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(pa,{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:se.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,r)=>t("div",{style:{borderRadius:6,background:se.block}},r))}),blanksection:t("div",{style:{...I,padding:14,display:"flex"},children:d("div",{style:{flex:1,border:`1px dashed ${se.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 ${se.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 ${se.line}`,display:"flex",alignItems:"center",gap:7,padding:"0 9px"},children:[t("div",{style:{width:9,height:9,borderRadius:5,border:`2px solid ${se.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 ${se.dark}`}}),t("div",{style:{padding:"2px 6px",borderRadius:6,border:`1.5px solid ${se.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 ${se.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 ${se.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:se.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:se.block}})};function eo({type:n}){let r=ed[n]??"",a=td[r]??ca[r]??ca.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 nd={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 ua(n,r={}){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=_t(R,"section",M);u.push({type:R,cat:f,catLabel:ri(n,f),name:A,desc:r[R]??"",...A===M?{}:{alias:M}})}return u}function ri(n,r){return nd[r]?.label??n.categories?.[r]?.title??r}var fa=Gr;function ga(n){return n.find(r=>r.type===fa)??null}function ma(n){return n.filter(r=>r.type!==fa)}var ya={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 si({blocks:n,blocksOnly:r,at:a,onAdd:m,itemFor:u,session:f,siteWide:b,onClose:R,onHide:C,readOnly:M}){let A=rd(E=>E.config),H=Kr(),[te,Ee]=id([]);od(()=>{let E=!1,J=Es(H);return js.list().then(W=>{if(E)return;let F=A.components;Ee(W.filter(Y=>Y.node?.type&&F[Y.node.type]&&(!J||Ps(Y.node).every(J.offers))))}).catch(()=>{}),()=>{E=!0}},[A,H]);let ae=ha(()=>ua(A,ya),[A]),ve=E=>_t(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=ha(()=>{let E=[];if(n&&n.choices.length>0&&ws(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}`}))})}),r)return E;let J=ga(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=ma(ae);for(let F of Object.keys(A.categories??{})){let Y=W.filter(ue=>ue.cat===F);Y.length!==0&&E.push({title:ri(A,F),tiles:Y.map(ie)})}return E},[n,r,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(ad,{size:15}),title:"Add",context:r?"Blocks for this place":"Sections and blocks",actions:Ue(qs,{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:r?"Drag into the page, or click to add.":"Drag onto the page, or click to add.",searchLabel:r?"Search blocks":"Search sections",readOnly:M}),b&&!r?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(ls,{value:b.chatEnabled,onChange:b.onToggleChat,label:"Show the chat bubble on the whole site"})]}):null]})]})}import{useCallback as ud,useEffect as ba,useMemo as va,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"})]})},xa="sf-editor-pages-collapsed-groups",hd=n=>n.toLowerCase().trim().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,""),Sa=(n,r)=>{let a=hd(n)||"page";if(!r.has(a))return a;let m=2;for(;r.has(`${a}-${m}`);)m+=1;return`${a}-${m}`};function ai({onNavigate:n,onClose:r,activeSurface:a,onPreviewSurface:m}){let u=Ft(),{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]);ba(()=>{H(null),F()},[F]);let[Y,ue]=At(()=>{if(typeof window>"u")return new Set;try{let x=window.localStorage.getItem(xa);return new Set(x?JSON.parse(x):[])}catch{return new Set}});ba(()=>{try{window.localStorage.setItem(xa,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=va(()=>Vr(A??[]),[A]),V=te.trim().toLowerCase(),Q=x=>!V||x.toLowerCase().includes(V),_e=x=>V?!0:!Y.has(x),Ce=va(()=>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:Sa(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}),qr(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=ks.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:r}),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: /",Sa(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:r,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(Ys,{tokenRef:n,siteId:r,onNotify:m,tab:u,onTabChange:f})})]})}import{useEffect as wa,useMemo as Cd,useRef as Ca,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 ka(n,r,a=!0){let[m,u]=wd(null),f=Sd(async()=>{let b=n.current;if(b)try{u(await jn.listPages(b,r))}catch{u([])}},[n,r]);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 Ta=n=>n===Fe||n===oe;function Pd(n,r){return(n??[]).map((a,m)=>({id:String(a.props?.id??`${a.type}-${m}`),type:a.type,label:r(a.type),hidden:!!a.props?._hidden,pinned:Ta(a.type)}))}function Rd(n,r,a){if(r===a||r<0||r>=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(r<m||r>=u)return null;let f=Math.max(m,Math.min(a,u)),b=n.slice(),[R]=b.splice(r,1);return b.splice(f>r?f-1:f,0,R),b.every((C,M)=>C===n[M])?null:b}function di({tokenRef:n,siteId:r,currentSlug:a,liveContent:m,labelForType:u,onOpenPage:f,onClose:b,pages:R}){let C=Ft(),{pages:M,reload:A}=ka(n,r,R===void 0),H=R??M;wa(()=>{let k=j=>{j.key==="Escape"&&b()};return document.addEventListener("keydown",k),()=>document.removeEventListener("keydown",k)},[b]),wa(()=>{let k=document.activeElement;return ae.current?.focus(),()=>k?.focus?.()},[]);let[te,Ee]=Td({}),ae=Ca(null),ve=Ca({}),ie=Cd(()=>H?jr(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=Zr({...k.layout,content:_e});jn.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&&!Ta(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??_r}),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{useEditor as Dd}from"efficient-easel/editor";function Ed(n){return n.replace(/<[^>]+>/g," ").replace(/\s+/g," ").trim()}function Ad(n){let r=[],a=/<h([1-6])\b[^>]*>([\s\S]*?)<\/h\1>/gi,m;for(;m=a.exec(n);)r.push({level:Number(m[1]),text:Ed(m[2])||"(empty)"});return r}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,r){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 Vn(r,u.type??"")){let R=f[b];Array.isArray(R)&&a.push(...ci(R,r))}}return a}import{jsx as Gt,jsxs as no}from"react/jsx-runtime";function pi(){let{appState:n,config:r}=Dd(f=>f),a=n?.data,m=ci(a?.content??[],r),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 Ia,useState as Od}from"react";import{EditorContextMenu as Bd}from"efficient-easel/menu";import{AddIcon as Md,CopyIcon as Pa,LayersIcon as Hd,PasteIcon as Ea,RedoIcon as $d,SettingsIcon as Fd,UndoIcon as Wd}from"efficient-easel/icons";import{ROOT_ID as _d,ROOT_SLOT as qd,zoneKey as Aa}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,r){let a=[],m=new Set,u={zone:r.zone,index:r.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 Na=jd();function La(n,r,a){if(r===P){let{floor:u,cap:f}=n.sectionBand();return{parentId:_d,slot:qd,index:Math.min(Math.max(a,u),f)}}let m=r.lastIndexOf(":");return{parentId:r.slice(0,m),slot:r.slice(m+1),index:a}}function Yd(n,r){let{zone:a,index:m}=r,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&&!Fr(n.document,u),te=Ud(n,r),Ee=C.held,ae=Ee&&!M&&Aa(Ee.from)===a?La(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 r=[];n.history.hasPast&&r.push({label:"Undo",icon:et(Wd,{}),shortcut:"\u2318Z",onClick:n.history.back}),n.history.hasFuture&&r.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&&Aa(m.from)===P){let R=La(n,P,n.sectionBand().cap);a.push({label:`Paste ${m.label}`,icon:et(Ea,{}),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=[r,a,u].filter(R=>R.length>0),b={label:"\u2014",onClick:()=>{}};return f.flatMap((R,C)=>C?[b,...R]:R)}function Zd(n,r){let a=r.selectionStart??0,m=r.selectionEnd??0,u=r.value.slice(a,m),f=A=>{r.focus(),r.setRangeText(A,a,m,"end"),r.dispatchEvent(new Event("input",{bubbles:!0}))},b=[];u&&(b.push({label:"Copy",icon:et(Pa,{}),shortcut:"\u2318C",onClick:()=>navigator.clipboard?.writeText(u)}),b.push({label:"Cut",icon:et(Pa,{}),shortcut:"\u2318X",onClick:()=>{navigator.clipboard?.writeText(u),f("")}})),b.push({label:"Paste",icon:et(Ea,{}),shortcut:"\u2318V",onClick:()=>{navigator.clipboard?.readText().then(A=>{A&&f(A)}).catch(()=>n.onPasteRefused())}});let R=r.value?[{label:"Select all",shortcut:"\u2318A",onClick:()=>{r.focus(),r.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 r=n?.closest?.("input, textarea");return!r||r instanceof HTMLInputElement&&!["text","search","url","email","tel","number",""].includes(r.type)?null:r}function Ra(n){return n.shiftKey}function Da(n,r){let[a,m]=Od(null),u=Ia(()=>m(null),[]),f=Ia(C=>{if(Ra(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(r,"contextmenu",C=>{if(Ra(C)||!r)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(r.frame,C.clientX,C.clientY);m(H?{kind:"node",...te,...H}:{kind:"empty",...te})}),ui(r,"mousedown",u),ui(r,"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 za(n,r){let a=!1,m={...n.props};for(let u of r){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 Oa(n,r,a){return!n||!r?!1:n.index===r.index&&(n.zone??a)===(r.zone??a)}function tc(n,r){if(typeof n.getBoundingClientRect!="function"||typeof r.getBoundingClientRect!="function")return!1;let a=n.getBoundingClientRect(),m=r.getBoundingClientRect();return!a.height||!m.height?!1:m.top>=a.top&&m.bottom<=a.bottom}function Ba(n=typeof document>"u"?void 0:document){let r=n?.querySelector(Qd),a=r?.querySelector(ec);return a?(tc(r,a)||a.scrollIntoView({block:"center",inline:"nearest"}),!0):!1}function Ma(n,r){return n.kind==="part"?n.nodeId??null:n.kind!=="puck"||r==null?null:String(r)}import{useEffect as $a,useState as Fa}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 Ha(n){let{pageSlug:r,siteSlug:a,hostname:m}=n,u=r===Wr?"/":`/${encodeURIComponent(r)}`;if(!fi(m))return u;let f=a?.trim();return f?`${u}?site=${encodeURIComponent(f)}`:u}function Wa(n){let{pageSlug:r,siteId:a,token:m}=n,[u,f]=Fa(null),[b,R]=Fa(null),C=zr();$a(()=>R(C?new URL(C).hostname:window.location.hostname),[C]),$a(()=>{if(!fi(b)||!a||!m){f(null);return}let A=!1;return _s(m,a).then(H=>{A||f(H)}),()=>{A=!0}},[b,a,m]);let M=Ha({pageSlug:r,siteSlug:u,hostname:b});return C?`${C}${M}`:M}var _a="sf-editor-left-view";function qa(){if(typeof window>"u")return"pages";try{let n=window.localStorage.getItem(_a);return n==="sections"||n==="styles"||n==="media"?n:"pages"}catch{return"pages"}}function ja(n){if(!(typeof window>"u"))try{window.localStorage.setItem(_a,n)}catch{}}function Va(n,r,a=!1){return n==="styles"&&!r||n==="media"&&!a?"sections":n}function Ga(n,r){return n?"sections":r}import{jsx as Ka}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:r,strokeWidth:a=1.7}){return Ka("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round",className:r,"aria-hidden":"true",focusable:"false",children:Ka("path",{d:oc})})}var ic="Save your page changes first";function Ua(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 Ya="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{useEditor as Yc,useEditorApi as Xc}from"efficient-easel/editor";import{fieldKind as rc,STYLE_KIND as Xa,copyStyle as sc,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(as())),fc=new Set(["focal","imageFocal"]),gc=[ds,Lr,Dr];function Za(n){return`site:${n??""}`}function mc(n){if(!n||typeof n!="object")return null;let r=n,a=Mo(n)??n,m=r[Xa]??a[Xa];if(typeof m=="string")return m;let u=r.options??a.options;return Array.isArray(u)?`choice:${u.map(b=>String(b?.value)).sort().join("|")}`:rc(a)}function yc(n){let r=n,a=Mo(n);return gc.some(m=>m in r||a&&m in a)}function oo(n,r){let a=Zs(n,r)??{},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("_")||ss(b)||uc.has(f)||fc.has(f)||yc(b)||b.type!=="slot"&&m.push({path:[f],kind:mc(b),counted:os(b)?.tier!=="mobile"})}return m}function mi(n,r,a,m){sc({scope:r,type:a.type,label:m,rows:oo(n,a),props:a.props})}function Ja(n,r,a,m){let u=ac(r);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:r,onToggle:a,onRetry:m}){if(r)return c(ol,{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(ol,{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 so=n=>({parentId:`locations-${n}`,slot:"groups"}),xi=(n,r)=>({parentId:`locations-${n}`,slot:`cities:${r}`});function op(n,r){if(n.length!==r.length)return!1;for(let a=0;a<n.length;a++)if(n[a].top!==r[a].top||n[a].index!==r[a].index)return!1;return!0}function ip(){let n=Ft(),{adapter:r,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=Ua({hasTrustedConsole:!!ve,canCreatePlatformTemplate:Ee.canCreatePlatformTemplate,capabilities:a,siteId:f,hasUnsavedEdits:te}),ye=De(()=>{!f||!u||ae(Ya,{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=$r({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,rl]=ce("desktop"),Yt=Jr(),Si=k&&Yt!==null,qe=Qr(),[Nt,xn]=ce(qa),[sl,ki]=ce(Us[0].id),wt=Va(Nt,ue,Si);$(()=>{ja(Nt)},[Nt]);let[ao,Ct]=ce(!1),[wi,al]=ce(0),{surface:ll,setSurface:Ci}=Ss(),lo=de(null),Xt=de(null),nt=Hc(Xt,{readySelector:Bc}),Be=oa(Xt);ia(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=Ma(je,ee?.props.id),pt=de(null),uo=de(null),[Ri,Ei]=ce(null);$(()=>{Ri&&(Ba(),Ei(null))},[Ri]);let Ai=de(lt);Ai.current=lt;let kn=De((e,{scroll:o})=>{xn(p=>Ga(e,p)),o&&Ei(e);let s=[],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];s.push(h),l=h}s.length!==0&&Tn(p=>{if(s.every(h=>!p.has(h)))return p;let g=new Set(p);return s.forEach(h=>g.delete(h)),g})},[]);$(()=>{le(ee?.type===Fe?Jn:Le),ys(ee?.type==="BookingBox"&&ee.props.region==="confirm"?hs(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 s=ne.current;if(ne.current=null,!o)return;let l=lt(o);kn(String(o),{scroll:!Oa(s,l??null,P)})},[ee?.props.id,he,kn]);let{setSelected:Ni,setSelectHandler:Li}=ts(),{chat:dl,setChat:cl,setSelected:Di,setSelectHandler:zi}=xs(),{setSelectedHeroId:Oi,setSelectHandler:Bi}=Hs(),{editFooter:Mi}=vs(),{selectedLocationPartId:pl,setSelectedLocationPartId:Hi,setSelectHandler:$i}=$s(),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:Qs),G({type:"setUi",ui:{rightSideBarVisible:!0}})},[G]),Wi=je.kind==="chat";$(()=>{Di(Wi)},[Wi,Di]),$(()=>{zi(fo)},[zi,fo]);let{setOpenHandler:_i}=bs(),qi=De(()=>{le(e=>e.kind==="social"?e:ea),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 ul=De(e=>{G({type:"setUi",ui:{rightSideBarVisible:!0}}),Vt(e),kn(e,{scroll:!0})},[G,kn]),{selectNode:fl,openPartId:rp}=na({mode:je,setMode:le,onOpenPart:ul}),[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,gl]=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)=>gl(s=>{let l=typeof o=="function"?o(s[e]):o;return s[e]===l?s:{...s,[e]:l}}),[]),ml=De(e=>In("left",e),[In]),yl=De(e=>In("right",e),[In]),Tt=e=>Cn.has(e),ut=e=>Tn(o=>{let s=new Set(o);return s.has(e)?s.delete(e):s.add(e),s}),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),[hl,bl]=ce(0),Jt=de(null),It=(e,o="success")=>{Ui({msg:e,tone:o}),bl(s=>s+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=Ns();$(()=>{let e=Qt.current;if(!e)return;let o=()=>{Yi(e.clientWidth),Xi(e.clientHeight)};o();let s=new ResizeObserver(o);return s.observe(e),()=>s.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,vl=zt>0&&Ji>zt+1,xl={width:Ji,height:mo||"100%",flex:"none",position:"relative"},Sl={width:yo,height:mo?mo/en:"100%",maxHeight:"none",transform:en!==1?`scale(${en})`:void 0,transformOrigin:"top left"},kl=Wa({pageSlug:u,siteId:f,token:ve}),wl=r.previewHref?.(u)??kl,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}})}},Cl=()=>{Ct(!1),es(n,{accept:"image/*",title:"Media library"})},er=()=>{le(Le),w.select(null),Un()},tr=()=>{le(Jn),St||G({type:"setUi",ui:{rightSideBarVisible:!0}})},nr=()=>{if(ue){Ct(!1),xn("styles"),U||G({type:"setUi",ui:{leftSideBarVisible:!0}}),Un();return}le(Js),St||G({type:"setUi",ui:{rightSideBarVisible:!0}}),Un()},z=fe.data.content??[],gt=()=>{let e=z.findIndex(s=>s.type===Fe),o=z.findIndex(s=>s.type===oe);return{floor:e>=0?e+1:0,cap:o>=0?o:z.length}},or=xe,ho=Uc({data:fe.data,config:or,readOnly:!!W,clipboard:Na,afterRemove:"none",stepBounds:(e,o)=>{if(e.parentId!==_c||e.slot!==qc)return{min:0,max:o-1};let{floor:s,cap:l}=gt();return{min:s,max:l-1}},commit:(e,{select:o})=>{if(o!==void 0){le(Le);let s=o?.kind==="node"?Kc(e,or,o):null;w.select(s&&s.zone===P?{index:s.index}:s)}w.commitDocument(e)}}),Tl=(e,o)=>{let s=re(e)[o]?.props?.id;s!=null&&ho.remove(String(s))},Ve=e=>xe.components[e]?.label??e,Pt=De(e=>xe.components[e]?.defaultProps??{},[xe]),Te=e=>_t(e,"section",Ve(e)),tn=e=>us({type:e.type,props:e.props??{}},Te(e.type)),{nodeAddresses:En,zoneItems:ir}=yi(()=>{let e=new Map,o=new Map,s=(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>=Br)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)s(T,O,g+1)})};return s(z,P,0),{nodeAddresses:e,zoneItems:o}},[z,xe]),re=De(e=>ir.get(e)??[],[ir]),rr=Or(),Il=yi(()=>{let e=new Map;for(let o of rr??[])e.set(o.slug,o.name);return e},[rr]),An=e=>cs(e,Ve,o=>Il.get(o)),sr=(e,o)=>o===P?null:ps(xe.components[e.type]?.fields),Pl=(e,o,s)=>{let l=re(e)[o];if(!l)return;let p=sr(l,e);p&&w.replaceComponent(e,o,{...l,props:{...l.props,[p]:s.trim()}})},Rl=(e,o,s,l)=>{if(!(ji?.zone===e&&ji.index===o))return;let g=(h,v)=>{Vi(null),v&&Pl(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))}},s)},El=()=>Tn(new Set(re(P).map(e=>String(e.props.id)))),Nn=Za(f),Ln=xe,bo=(e,o)=>o===P?Te(e):Ve(e),ar=(e,o,s)=>{let l=Ja(Ln,Nn,s,bo(s.type,e));l&&(l.changed&&w.replaceComponent(e,o,{...s,props:{...l.props,id:s.props.id}}),It(l.message))},lr=Da({nodesIn:re,nodeAt:(e,o)=>re(e)[o]??null,labelOf:(e,o)=>o===P?Te(e):Ve(e),renamePropOf:sr,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:El,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,s,l)=>{e===P?mt(o):rn(e,o,s,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,s)=>ar(e,o,s)}},nt),dr=de({copy:(e,o)=>{},paste:(e,o,s)=>{},at:()=>null,readOnly:!1});$(()=>{dr.current={copy:(e,o)=>mi(Ln,Nn,e,bo(e.type,o)),paste:ar,at:()=>{let e=fe.ui.itemSelector;if(!e)return null;let o=e.zone??P,s=re(o)[e.index];return s?{zone:o,index:e.index,node:s}:null},readOnly:!!W}});let vo=De(e=>{let o=Oc(e);if(!o)return;let s=dr.current,l=s.at();l&&(e.preventDefault(),o==="copy"?s.copy(l.node,l.zone):s.readOnly||s.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 Al=z.map(e=>e.props.id).join("|");$(()=>{let e=nt?.document??null,o=nt?.window??null,s=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(s),s=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(s),l.forEach(clearTimeout),o.removeEventListener("scroll",g),h.disconnect()}},[nt,Al,kt,en,U,St,ee?.props.id]);let Nl=()=>{let e=nt?.document;if(!e)return null;let o=4,s=z.findIndex(g=>g.type===oe),l=s>=0?s: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},Ll=()=>{lo.current=Nl(),al(e=>e+1)},xo=nt?.document??null,nn=nt?.window??null;$(()=>{let e=lo.current;if(!e||!xo||!nn)return;let o=[],s=()=>{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,s()&&o.push(setTimeout(s,150),setTimeout(s,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||!Ur()))return Gs(()=>Yr())},[]);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)},cr=e=>{let{floor:o,cap:s}=gt(),l=g=>Math.min(Math.max(o,g),s);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:s)},pr=(e,o)=>{let{floor:s,cap:l}=gt(),p=Math.min(Math.max(o,s),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})},Dl=(e,o)=>{let s=Te(z[e]?.type??""),l=pr(e,o<0?e-1:e+2);if(!l.moved){It(`\u201C${s}\u201D is already ${o<0?"first":"last"}`);return}let{floor:p,cap:g}=gt();It(`Moved \u201C${s}\u201D to position ${l.dest-p+1} of ${g-p}`)},Dn=(e,o,s)=>{le(Le),w.select({index:e}),Vt(o),It(`Added \u201C${s}\u201D section`)},ko=(e,o)=>{let s=cr(o),l=Is(e);if(l){let h=l(Pt,Wt),v=w.insertNode(P,s,h);return Dn(s,v,Te(e)),s}if(ms(e)&&Wo(gn)&&Wo(jt)){let h={type:gn,props:{...Pt(gn),id:Wt(gn),direction:"column",name:`${Te(e)} section`,content:[{type:jt,props:{...Pt(jt),id:Wt(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:Wt(e),headPlacement:"own-box"}}]}},v=w.insertNode(P,s,h);return Dn(s,v,Te(e)),s}let g=Rs[e]?.fixed===!0?w.insertNode(P,s,{type:e,props:{...Pt(e),id:Wt(e),layout:"boxes"}}):w.insertSection(e,s);return Dn(s,g,Te(e)),s},wo=(e,o,s)=>{let l=cr(s),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},zl=e=>{if(Sn===null){ko(e);return}let o=ko(e,Sn);Ti(o+1)},Ol=(e,o)=>{if(Sn===null){wo(e,o);return}let s=wo(e,o,Sn);Ti(s+1)},ur=(e,o,s)=>{if(e.kind==="section")w.insertComponent(o,e.type,s);else if(e.kind==="template")w.insertNode(o,s,Zn(e.template.node));else return;le(Le),w.select({index:s,zone:o})},Bl=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 s=Mt(e.zone);return s?`Adding to ${s.parentName}`:"Adding here"},Ml=e=>{if(K&&e.kind!=="block"&&Xe(K.zone)){ur(e,K.zone,K.index),ot({zone:K.zone,index:K.index+1});return}if(e.kind==="section")return zl(e.type);if(e.kind==="template")return Ol(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}Nr?.onPick(e.type)},Se=e=>o=>{o.target.closest(".es-tree-select")||e()},fr=()=>Mi?Mi():pe({kind:"page",slug:pn,siteId:f??void 0}),Bn=(e,o,s)=>c(ro,{kind:"delete",label:`Delete ${s}`,onClick:()=>Tl(e,o),children:c(bi,{size:15})}),Mn=(e,o,s,l)=>{let p=!!s.props._hidden;return c(ro,{kind:"eye",label:p?`Show ${l}`:`Hide ${l}`,onClick:()=>Hl(e,o,s),children:p?c(We,{name:"eye-off",size:14}):c(We,{name:"eye",size:14})})},gr=e=>{let o=Te(z[e]?.type??""),s=o?`Add section before ${o}`:"Add section here";return Fn(P,e,()=>on(e),s)},Hl=(e,o,s)=>{w.replaceComponent(e,o,{...s,props:{...s.props,_hidden:!s.props._hidden}})},Co=e=>Vn(xe,e),yt=e=>Oo(xe,e),To=(e,o,s)=>{let l=Mr(xe,e.type,o)&&(s||yt(e).length>0);return{collapsible:l,folded:l&&Tt(String(e.props.id))}},Io=(e,o,s)=>yt(e).flatMap(({child:l})=>To(l,o,s(l.type)).collapsible?[String(l.props.id),...Io(l,o+1,s)]:[]),Hn=e=>yt(e).length>0||!!Pe(e.type),$n=e=>!!Pe(e),rn=(e,o,s,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(s)},Ot=(e,o,s,l,p)=>{let g=`${e}:${o}`;w.insertComponent(g,s,l),Pe(p)?.spec?.slider?requestAnimationFrame(()=>{Uo(e,l),w.select({index:l,zone:g})}):w.select({index:l,zone:g})},Po=(e,o,s)=>{w.insertComponent(e,o,s),le(Le),w.select({index:s,zone:e})},mr=de(new Set);$(()=>{z.forEach(e=>{let o=Pe(e.type)?.spec;if(!o)return;let s=e.props.id;if(mr.current.has(s)||(mr.current.add(s),(Array.isArray(e.props[o.slot])?e.props[o.slot]:[]).length>0)||o.skipSeed?.(e.props))return;let p=`${s}:${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 yr=de(new Set);$(()=>{z.forEach((e,o)=>{let s=e.props.id;if(yr.current.has(s))return;let l=za(e,Co(e.type));yr.current.add(s),l&&w.replaceComponent(P,o,{...e,props:l})})},[z,w]);let hr=Xc().getState,br=de(null);$(()=>{if(!Xr({docId:ze,saveStatus:C,seededDocId:br.current})||(br.current=ze,!V))return;let e=hr().appState.data,o=e.content,s=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=Hr(y,s);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=gs(o);if(v!==o&&w.setDocument({...e,content:[...v]}),!v.find(L=>L.type===oe)&&!l(s,oe)&&!l(v,mn)&&!l(s,mn)){let L=(T,B)=>$c(xe,T,B),O={type:oe,props:{blocks:Fo()}};w.insertNode(P,v.length,Vs(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(s,Fe)&&w.insertNode(P,0,$o())},[ze,C,E,hr,w,Y,V,he]);let Bt=z.findIndex(e=>e.type===oe),He=Bt>=0?z[Bt]:null,vr=z.find(e=>e.type===fs)??null,xr=z.find(e=>e.type===mn)??null,Sr=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)),$l=()=>Tn(e=>{let o=new Set(it);return Ro?new Set([...e].filter(s=>!o.has(s))):new Set([...e,...it])}),kr=e=>{let o=e.props;if(e.type==="FooterMenu"){let s=o.menu;return o.heading||s?.name||"Menu"}if(e.type==="FooterText"){let s=typeof o.text=="string"?o.text.trim():"";return s?s.length>28?`${s.slice(0,28)}\u2026`:s:"Text"}return e.type==="FooterEmailSignup"?o.heading||"Email signup":Ve(e.type)},wr=(e,o,s,l)=>{let p=re(e)[s];if(!p)return;let g={...xt(e),index:s},h={...xt(o),index:Math.min(Math.max(l,0),re(o).length)},v=Gc(g,h);if(!(e===o&&v===s))try{ho.move(String(p.props.id),{...h,index:v})}catch(y){if(!(y instanceof Fc))throw y}},Fl=(e,o,s)=>{if(e===o)return!0;let l=re(e)[s];if(!l)return!1;let p=o.split(":")[0],g=En.get(p),h=g?re(g.zone)[g.index]:void 0;if(!h||Wl(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?.(re(o),l))},Wl=e=>{let o=new Set,s=l=>{for(let{child:p,zone:g}of yt(l))o.add(g),s(p)};for(let l of Co(e.type))o.add(`${e.props.id}:${l}`);return s(e),o},Cr=e=>{let o=e.slice(0,e.indexOf(":"));for(let s=0;s<64;s++){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(":")),s=z.find(l=>yn(l.type)&&String(l.props.id)===o);return s&&Ho(o)===e?s:null},Eo=(e,o)=>{if(e.add)return _l(e.add,o);let s=tt(o);if(yn(e.type))return!1;let l=Xe(s),p=Xe(e.zone);if(l||p)return!l||!p?!1:o.index>=0&&o.index<=re(s).length;if(e.zone===P||s===P){if(e.zone!==s)return!1;let{floor:h,cap:v}=gt();return o.index>=h&&o.index<=v}if(o.index<0||o.index>re(s).length)return!1;if(e.zone===s)return!0;let g=He?String(He.props.id):null;return g&&(Cr(e.zone)===g||Cr(s)===g)?!1:Fl(e.zone,s,e.index)},Mt=e=>{let o=e.slice(0,e.indexOf(":")),s=En.get(o),l=s?re(s.zone)[s.index]:void 0;if(!s||!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:s.zone===P?Te(l.type):Ve(l.type)}},_l=(e,o)=>{let s=tt(o);if(e.kind!=="block"){if(Xe(s))return o.index>=0&&o.index<=re(s).length;if(s!==P)return!1;let{floor:p,cap:g}=gt();return o.index>=p&&o.index<=g}if(s===P)return!1;let l=Mt(s);return!l||!l.choices.some(p=>p.type===e.type)?!1:!l.target.spec?.addBlocked?.(re(s))},ql=(e,o)=>{if(e.kind!=="block"&&Xe(tt(o))){ur(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 s=tt(o),l=Mt(s);l&&(l.target.spec?Ot(l.parentId,l.target.slot,e.type,o.index,l.parent.type):Po(s,e.type,o.index))},Tr=(e,o)=>{if(e.add){ql(e.add,o);return}e.zone===P?pr(e.index,o.index):wr(e.zone,tt(o),e.index,o.index)},[Ao]=ce(()=>Vc()),Ht=vi({keyOf:e=>e.id,readOnly:!!W,session:Ao,canDrop:Eo,onDrop:Tr,onStep:(e,o)=>{e.zone===P?Dl(e.index,o):wr(e.zone,e.zone,e.index,o<0?e.index-1:e.index+2)}}),jl=De(e=>{let{floor:o,cap:s}=gt(),l=[];for(let g of e.nodes){let h=tt(g.place),v=re(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&&s-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]),Vl=e=>{le(Le),w.select(e.zone===P?{index:e.index}:{index:e.index,zone:e.zone})},Fn=(e,o,s,l)=>c(hi,{...W?{}:Ht.seam({place:{...xt(e),index:o}}),onAdd:W?void 0:s,label:l},`seam:${e}:${o}`),ht=(e,o)=>{let s=z[e];s&&w.replaceComponent(P,e,{type:s.type,props:{...s.props,locations:o}})},sn=e=>{let o=z[e]?.props?.locations;return Array.isArray(o)?o:[]},Ir=vi({keyOf:e=>`group:${e.si}:${e.index}`,readOnly:!!W,canDrop:(e,o)=>o.parentId===so(e.si).parentId&&o.slot==="groups",onDrop:(e,o)=>{ht(e.si,Vo(sn(e.si),e.index,o.index)),Me.level==="city"&&Ke({level:"groups"})},onStep:(e,o)=>{ht(e.si,Vo(sn(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===so(e.si).parentId&&o.slot.startsWith("cities:"),onDrop:(e,o)=>{let s=o.slot.slice(7);ht(e.si,Go(sn(e.si),e.group,e.index,s,o.index)),Ke({level:"group",key:s})},onStep:(e,o)=>{ht(e.si,Go(sn(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})}}),Pr=de(z);Pr.current=z;let Rr=de(()=>{});$(()=>{$i(e=>{let o=Ws(e);if(!o)return;let s=Pr.current.findIndex(l=>l.props?.id===o.nodeId);s<0||Rr.current(s,{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 s=z[e]?.props?.id;typeof s=="string"&&(o.level==="image"||o.level==="map")?Hi(Fs(s,o.index,o.level)):Hi(null),typeof s=="string"&&So(s)};Rr.current=$e;let Gl=(e,o)=>{let s=sn(o),l=qo(s),p=String(e.props.id),g=co&&ee?.props.id===p,h=y=>c(hi,{...W?{}:Ir.seam({place:{...so(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,_=Ls(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=Ir.row({item:{si:o,index:L},place:{...so(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(ro,{kind:"delete",label:`Delete ${_} group (${y.cards.length} ${y.cards.length===1?"city":"cities"})`,onClick:()=>{ht(o,Os(s,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(s,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(ro,{kind:"delete",label:`Delete ${Rt}`,onClick:()=>{ht(o,Bs(s,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=Ds(s,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}=zs(s);ht(o,y),$e(o,{level:"group",key:L})},children:[c("span",{className:"sf-plus sf-plus--sm",children:"+"}),"Add group"]})]})},Er=e=>{let o=String(e.props.id),s=z.findIndex(y=>String(y.props.id)===o),l=Ho(o),p=re(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(s),selected:Lt===o,rowProps:{"data-node-id":o,onClick:Se(()=>mt(s))},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=()=>rn(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)]})]})},Ar=(e,o)=>{let s=yt(e),l=(h,v)=>Fn(h,v),p=Pe(e.type),g=p?`${e.props.id}:${p.slot}`:null;return N(me,{children:[s.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),_=kr(h),Ze=()=>rn(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:Ar(h,o+1)}),l(v,y+1)]},String(h.props.id??`${v}-${y}`))}),g&&!s.some(h=>h.zone===g)?l(g,0):null]})},Lo=(e,o)=>{let s=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:[s.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:re(an).length}:void 0,ln=Ht.dragging,Wn=Rt&&ln&&Eo(ln,Rt)?Rt:void 0,_n=()=>rn(B,_,ke,e.type),{rowProps:zo,...Kl}=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:Rl(B,_,ke,Ge),selected:Ze,hidden:!!T.props._hidden,...Kl,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(Cs,{small:!0,label:p.addLabel,blocked:p.addBlocked?.(g)??null,onAdd:()=>Ot(e.props.id,p.slot,p.childType,g.length,e.type)}),L&&!s.some(T=>T.zone===L)?O(L,0):null]})},Nr=(()=>{if(!ee||!co)return null;let e=String(ee.type),o=String(ee.props.id),s=Pe(e,e===dn?cn(fe?.data,o):0);if(!s||s.source==="footer")return null;let l=z.some(h=>String(h.props?.id)===o),p=Array.isArray(ee.props[s.slot])?ee.props[s.slot]:[];if(s.spec?.addBlocked?.(p))return null;let g=s.choices??(s.spec?[{type:s.spec.childType,label:Ve(s.spec.childType)}]:[]);return g.length===0?null:{parentName:l?Te(e):Ve(e),choices:g,onPick:h=>{s.spec?Ot(o,s.slot,h,p.length,e):Po(`${o}:${s.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(Qa,{}),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:nr}),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(el,{}),active:U&&!Ae&&(qe!==null||wt==="media"),onSelect:()=>Rn("media")}):k&&$t.push({id:"media",label:"Media library",icon:c(el,{}),onSelect:Cl}),c(As.Provider,{value:!0,children:c(ns.Provider,{value:kt,children:N("div",{ref:Xt,className:"sf-editor es-editor",style:Xs(Dt),onContextMenu:lr.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(il,{children:[c(tl,{label:"Undo",disabled:!Oe.hasPast,onClick:()=>Oe.back(),children:c(Lc,{})}),c(tl,{label:"Redo",disabled:!Oe.hasFuture,onClick:()=>Oe.forward(),children:c(Ac,{})}),c(Ic,{}),c(kc,{devices:sa,value:kt,onChange:rl})]}),N(il,{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:Ll,children:"Refresh"}),_e&&u&&N("a",{className:"es-btn-ghost",href:wl,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(si,{blocks:K&&K.zone!==P&&!Xe(K.zone)?Mt(K.zone):Nr,blocksOnly:!!(K&&K.zone!==P&&!Xe(K.zone)),at:K?{label:Bl(K),onClear:()=>ot(null)}:void 0,onAdd:Ml,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:dl.enabled,onToggleChat:e=>cl({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:ll,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(Qa,{}),title:"Layers",context:`/${u}`,actions:it.length>0?c(Cc,{label:Ro?"Expand all sections":"Collapse all sections",onClick:$l,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:er,selected:!ee&&co,rowProps:{onClick:Se(er)}}),vr&&N(me,{children:[c(io,{children:"Header"}),Er(vr)]}),!he&&V&&N(me,{children:[c(io,{children:"Header"}),c(we,{icon:c(be,{type:"header",size:13}),name:"Header",onSelect:tr,selected:je.kind==="header",rowProps:{onClick:Se(tr)}})]}),!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 s=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&&gr(o),c(we,{icon:c(be,{type:e.type,size:13}),name:tn(e),onSelect:()=>mt(o),selected:s,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:Ms,onSelect:()=>wn(g),selected:po===g,rowProps:{onClick:Se(()=>wn(g))}})]}),h&&!y&&c(at,{children:Gl(e,o)})]},String(e.props.id??o))}),!he&&Sr>0&&gr(Sr),V&&c(io,{children:"Footer"}),He&&(()=>{let e=String(He.props.id),o=yt(He).length>0||!!Pe(He.type),s=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:!s,label:"section",onToggle:()=>ut(e)}:void 0,rowProps:{onClick:Se(()=>mt(Bt))}}),o&&!s&&c(at,{children:Ar(He,1)})]})})(),!he&&!He&&V&&c(we,{icon:c(be,{type:"footer",size:13}),name:"Footer",onSelect:fr,rowProps:{onClick:Se(fr),title:"Edit the site footer"}}),xr&&Er(xr),c("div",{className:"sf-tree-tool",children:c(pi,{})})]})]})}),c(nl,{side:"left",width:Dt.left,min:Qo,max:Jo,defaultWidth:vt.left,label:"Resize Sections panel",onResize:ml})]}):c(Ko,{side:"left",onShow:ft}),c("div",{ref:Qt,className:"sf-center sf-scroll",style:{overflowX:vl?"auto":"hidden",overflowY:"hidden"},children:c("div",{className:"sf-frame-scaler",style:xl,children:c("div",{className:`sf-frame ${kt==="desktop"?"":`sf-frame--${kt}`}`,style:Sl,children:N("div",{className:"sf-preview-host",children:[c(ra,{},wi),c(jc,{canvas:nt,session:Ao,model:jl,canDrop:Eo,onDrop:Tr,onPick:Vl,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(Ts,{value:{selectChild:rn,addChild:Ot,childRowName:An,blockRowName:kr},children:c(ta,{mode:je,onOpenWebsiteSettings:nr,onOpenSiteStyles:()=>{ki(Ks),xn("styles")},onSelectNode:fl,onNotify:It,onHidePanel:Qi})}),c(nl,{side:"right",width:Dt.right,min:Qo,max:Jo,defaultWidth:vt.right,label:"Resize settings panel",onResize:yl})]}):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]},hl),lr.menu]})})})}export{ip as default};