efficient-storefront-blocks 0.130.8 → 0.130.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +129 -0
- package/dist/chunks/{EditorPreviewCheckout-HMNAHJIE.js → EditorPreviewCheckout-MXKJBKHR.js} +1 -1
- package/dist/chunks/chunk-4J3EMW4L.js +1 -0
- package/dist/chunks/{chunk-3YVTYYIP.js → chunk-4RSMAKOH.js} +1 -1
- package/dist/chunks/{fitment-data-I4QRQRK6.js → fitment-data-JY77OFQP.js} +1 -1
- package/dist/editor/lib/document/blocks/commerce/FitmentTable/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/ProductBuyButton/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/ProductEyebrow/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/ProductGallery/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/ProductHero/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/ProductPrice/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/ProductSku/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/SpecTable/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/hero-template-row.d.ts +4 -0
- package/dist/editor/lib/document/blocks/commerce/hero-template-row.js +1 -0
- package/dist/editor/lib/storefront-editor-words.d.ts +25 -0
- package/dist/editor/lib/storefront-editor-words.js +1 -1
- package/dist/fitment.js +1 -1
- package/dist/index.js +27 -27
- package/dist/render/components/FitmentTable.d.ts +2 -1
- package/dist/render/components/FitmentTable.js +1 -1
- package/dist/render/components/LinkedProductHero.d.ts +2 -0
- package/dist/render/components/ProductGallery.d.ts +5 -2
- package/dist/render/components/ProductGallery.js +1 -1
- package/dist/render/components/ProductHeroPanel.d.ts +6 -1
- package/dist/render/components/ProductHeroPanel.js +1 -1
- package/dist/render/components/SpecTable.d.ts +2 -1
- package/dist/render/components/SpecTable.js +1 -1
- package/dist/render/components/card-pieces/CardBuyButton.d.ts +5 -2
- package/dist/render/components/card-pieces/CardBuyButton.js +1 -1
- package/dist/render/components/card-pieces/CardPrice.d.ts +25 -1
- package/dist/render/components/card-pieces/CardPrice.js +1 -1
- package/dist/render/components/card-pieces/HostPart.d.ts +3 -0
- package/dist/render/components/card-pieces/HostPart.js +1 -1
- package/dist/render/components/card-pieces/ProductCardState.d.ts +5 -0
- package/dist/render/components/pdp-dynamic/DynamicFitmentTable.d.ts +1 -0
- package/dist/render/components/pdp-dynamic/DynamicFitmentTable.js +1 -1
- package/dist/render/components/pdp-dynamic/DynamicProductGallery.d.ts +6 -1
- package/dist/render/components/pdp-dynamic/DynamicProductGallery.js +1 -1
- package/dist/render/components/pdp-dynamic/DynamicProductHero.d.ts +2 -0
- package/dist/render/components/pdp-dynamic/DynamicSpecTable.d.ts +1 -0
- package/dist/render/components/pdp-dynamic/DynamicSpecTable.js +1 -1
- package/dist/render/components/product-hero/CarPickerRow.d.ts +14 -0
- package/dist/render/components/product-hero/CarPickerRow.js +1 -0
- package/dist/render/components/product-hero/OptionLooks.d.ts +25 -0
- package/dist/render/components/product-hero/OptionLooks.js +1 -0
- package/dist/render/components/product-hero/SpinLayer.d.ts +4 -0
- package/dist/render/components/product-hero/SpinLayer.js +1 -1
- package/dist/render/components/product-hero/VehicleQuestion.js +1 -1
- package/dist/render/lib/api/index.js +1 -1
- package/dist/render/lib/api/origins.d.ts +1 -0
- package/dist/render/lib/api/origins.js +1 -1
- package/dist/render/lib/content/buy-button-look.d.ts +5 -0
- package/dist/render/lib/content/buy-button-look.js +1 -0
- package/dist/render/lib/content/hero-option-seed.d.ts +13 -0
- package/dist/render/lib/content/hero-option-seed.js +1 -1
- package/dist/render/lib/content/title-look.d.ts +11 -0
- package/dist/render/lib/content/title-look.js +1 -1
- package/dist/render/lib/document/blocks/commerce/FitmentTable/render.js +1 -1
- package/dist/render/lib/document/blocks/commerce/ProductBuyButton/meta.js +1 -1
- package/dist/render/lib/document/blocks/commerce/ProductBuyButton/render.js +1 -1
- package/dist/render/lib/document/blocks/commerce/ProductEyebrow/render.js +1 -1
- package/dist/render/lib/document/blocks/commerce/ProductGallery/meta.js +1 -1
- package/dist/render/lib/document/blocks/commerce/ProductGallery/render.js +1 -1
- package/dist/render/lib/document/blocks/commerce/ProductHero/meta.d.ts +4 -0
- package/dist/render/lib/document/blocks/commerce/ProductHero/meta.js +1 -1
- package/dist/render/lib/document/blocks/commerce/ProductHero/render.js +1 -1
- package/dist/render/lib/document/blocks/commerce/ProductPrice/render.js +1 -1
- package/dist/render/lib/document/blocks/commerce/ProductSku/render.d.ts +7 -0
- package/dist/render/lib/document/blocks/commerce/ProductSku/render.js +1 -1
- package/dist/render/lib/document/blocks/commerce/ProductSpecs/render.js +1 -1
- package/dist/render/lib/document/blocks/commerce/SpecTable/render.js +1 -1
- package/dist/render/lib/document/card-templates.js +1 -1
- package/dist/render/lib/sections/hero-gallery.d.ts +16 -0
- package/dist/render/lib/sections/hero-gallery.js +1 -1
- package/dist/render/lib/sections/hero-option-looks.d.ts +37 -0
- package/dist/render/lib/sections/hero-option-looks.js +1 -0
- package/dist/render/lib/sections/hero-stage-edge.d.ts +3 -0
- package/dist/render/lib/sections/hero-stage-edge.js +1 -0
- package/dist/render/lib/sections/spin-sets.d.ts +11 -0
- package/dist/render/lib/sections/spin-sets.js +1 -1
- package/dist/render/lib/wheels/fitment-columns.d.ts +2 -0
- package/dist/render/lib/wheels/fitment-columns.js +1 -1
- package/dist/render/lib/wheels/spec-format.d.ts +1 -0
- package/dist/render/lib/wheels/spec-format.js +1 -1
- package/dist/render/lib/wheels/spec-sheet.d.ts +6 -0
- package/dist/render/lib/wheels/spec-sheet.js +1 -1
- package/dist/routine-index.json +1 -1
- package/dist/value-index.json +1 -1
- package/dist/words.d.ts +25 -0
- package/dist/words.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/chunk-LWJKGQLZ.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as T,jsxs as Q}from"react/jsx-runtime";import{createContext as Ee,useCallback as V,useContext as ke,useEffect as p,useRef as v,useState as h}from"react";import{VIEW_TABLET_MIN as _e}from"efficient-easel/screen/lib/content/view-tiers";import{cssStringBody as Ae}from"efficient-web-builder/format/lib/document/style-text";import{HALF_SIZES as Y,sizedImage as Ie}from"efficient-web-builder/format/lib/sized-image";import{prefersReducedMotion as Pe}from"efficient-web-builder/render/components/useReducedMotion";import{DEFAULT_SPIN_AUTO_TURN as Te,DEFAULT_SPIN_HINT as xe,SPIN_HINT_HIDE_MS as Me,SPIN_HINT_SHOW_MS as J,SPIN_RESUME_MS as Fe,isFullTurn as ee,spinAutoTurnStep as Le,spinClampPosition as De,spinFrameIndex as x,spinPositionAfterDrag as te,spinCell as ne,spinStartPosition as $}from"../../lib/sections/spin-sets.js";const Ne=.3,He=.85,re=24,oe=4,se=1e3,ie=77/72,ae=`${(1-ie)/2*100}%`,ce=`${ie*100}%`,le={left:ae,top:ae,width:ce,height:ce},Re=`(max-width: ${_e-.02}px)`,O=new Map;function C(n,A){let w=O.get(n);return w||(w=new Promise(E=>{const u=new Image;u.onload=()=>E({w:u.naturalWidth,h:u.naturalHeight}),u.onerror=()=>{O.delete(n),E(null)},A&&(u.sizes=Y,u.srcset=A),u.src=n}),O.set(n,w)),w}const $e=Ee({autoTurn:Te,turnHint:xe});let M=!1;const Oe="M3 4.5c3.2 3.6 18.8 3.6 22 0M5.6 2.6 3 4.5l3 1.2M22.4 2.6 25 4.5l-3 1.2",W=n=>Ie(n,{fallbackWidth:se,maxWidth:se});function Ce({set:n,name:A}){const[w,E]=h(()=>$(n)),u=v(null),F=v(0),g=v(w),I=v(null),y=v(null),{autoTurn:f,turnHint:L}=ke($e),[ue,D]=h(!1),[de,U]=h(!1),[N,X]=h(0),j=v(0),[fe,z]=h(!1),[me,he]=h(!0),[pe,we]=h(null),s=n.count,[H,B]=h(null),R=v(null),[S,q]=h(null),b=ee(n),k=x(w,s,b),_=V(e=>{const t=De(e,s,b);return g.current=t,E(t),t},[s,b]),P=V(()=>cancelAnimationFrame(F.current),[]);p(()=>{const e=window.matchMedia?.(Re);if(!e)return q(!1);const t=()=>q(e.matches);return t(),e.addEventListener?.("change",t),()=>e.removeEventListener?.("change",t)},[]),p(()=>{if(!n.sheets||!n.startFrame||S===null)return;const e=S?n.sheets.phone:n.sheets.desktop,t=`${n.startFrame} ${e.urls[0]}`;if(y.current===t)return;y.current=t,B({key:t,sheet:e,ready:new Set});const r=Math.floor($(n)/(e.cols*e.rows)),l=e.urls.map((a,o)=>e.urls[(r+o)%e.urls.length]),i=W(n.startFrame);C(i.src,i.srcSet).then(()=>{for(const a of l)C(a).then(o=>{!o||o.w!==e.cols*e.frame||o.h!==e.rows*e.frame||y.current===t&&B(m=>m?.key===t?{...m,ready:new Set(m.ready).add(a)}:m)})})},[n,S]),p(()=>{if(!n.frames)return;const e=n.frames,t=e[0];if(y.current===t)return;y.current=t;const r=x($(n),s,ee(n)),l=[];for(let a=0;a<oe;a+=1)for(let o=a;o<s;o+=oe)l.push((r+o)%s);const i=a=>{const o=W(e[a]);return C(o.src,o.srcSet)};i(l[0]).then(()=>Promise.all(l.slice(1).map(i))).then(a=>{y.current===t&&a.every(Boolean)&&we(t)})},[s,n]),p(()=>P,[P]),p(()=>{if(!L||M)return;const e=window.setTimeout(()=>D(!M),J),t=window.setTimeout(()=>{M=!0,D(!1)},J+Me);return()=>{window.clearTimeout(e),window.clearTimeout(t)}},[L]),p(()=>{const e=u.current;if(!f||!e)return;if(typeof IntersectionObserver>"u")return z(!0);const t=new IntersectionObserver(r=>z(r.some(l=>l.isIntersecting)));return t.observe(e),()=>t.disconnect()},[f]),p(()=>{if(!f)return;const e=()=>he(document.visibilityState!=="hidden");return e(),document.addEventListener("visibilitychange",e),()=>document.removeEventListener("visibilitychange",e)},[f]);const ge=e=>{P(),f&&U(!0),L&&(M=!0,D(!1)),e.currentTarget.setPointerCapture?.(e.pointerId),I.current={x0:e.clientX,f0:g.current,last:e.clientX,speed:0}},ve=e=>{const t=I.current,r=u.current;!t||!r||(t.speed=e.clientX-t.last,t.last=e.clientX,_(te(t.f0,e.clientX-t.x0,r.clientWidth,s)))},G=()=>{const e=I.current;I.current=null,f&&e&&(U(!1),X(i=>i+1));const t=u.current;if(!e||!t||Pe())return;let r=Math.max(-re,Math.min(re,e.speed));const l=()=>{if(Math.abs(r)<Ne)return;const i=te(g.current,r,t.clientWidth,s);_(i)===i&&(r*=He,F.current=requestAnimationFrame(l))};F.current=requestAnimationFrame(l)},ye=e=>{const t=e.key==="ArrowRight"||e.key==="ArrowUp"?1:e.key==="ArrowLeft"||e.key==="ArrowDown"?-1:0;if(e.key==="Home")_(0);else if(e.key==="End")_(s-1);else if(t)_(Math.round(g.current)+t);else return;P(),f&&X(r=>r+1),e.preventDefault()},c=n.sheets&&H&&H.key.startsWith(`${n.startFrame} `)?H:null;c&&c.ready.has(ne(c.sheet,k).url)&&(R.current={key:c.key,frame:k});const K=c&&R.current?.key===c.key?R.current.frame:null,d=c&&K!==null?{...ne(c.sheet,K),cols:c.sheet.cols,rows:c.sheet.rows}:null,Se=n.frames?pe===n.frames[0]:!!c&&c.ready.size===c.sheet.urls.length,Z=f&&Se&&fe&&me&&!de;return p(()=>{if(!Z)return;const e=j.current!==N;let t=-1,r=-1,l=1,i=0;const a=o=>{if(i=requestAnimationFrame(a),t<0&&(t=o),e&&o-t<Fe)return;if(j.current=N,r<0){r=o;return}const m=Le(n,g.current,l,o-r);r=o,l=m.way;const be=x(g.current,s,b);g.current=m.position,x(m.position,s,b)!==be&&E(m.position)};return i=requestAnimationFrame(a),()=>cancelAnimationFrame(i)},[Z,N,n,s,b]),Q("div",{ref:u,"data-spin-well":!0,role:"slider",tabIndex:0,"aria-label":`${A}, 360° view: drag or use the arrow keys to turn`,"aria-valuemin":1,"aria-valuemax":s,"aria-valuenow":k+1,"aria-valuetext":`Angle ${k+1} of ${s}`,"data-spin-auto-turn":f?"":void 0,onKeyDown:ye,className:"absolute inset-0 select-none overflow-hidden cursor-grab active:cursor-grabbing focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-fg",style:{touchAction:"pan-y"},onPointerDown:ge,onPointerMove:ve,onPointerUp:G,onPointerCancel:G,onTouchStart:e=>e.stopPropagation(),onTouchMove:e=>e.stopPropagation(),onTouchEnd:e=>e.stopPropagation(),onClick:e=>e.stopPropagation(),children:[d?T("div",{"data-spin-frame":!0,className:"pointer-events-none absolute",style:{...le,backgroundImage:`url("${Ae(d.url)}")`,backgroundSize:`${d.cols*100}% ${d.rows*100}%`,backgroundPosition:`${d.cols>1?d.col*100/(d.cols-1):0}% ${d.rows>1?d.row*100/(d.rows-1):0}%`}}):T("img",{...W(n.frames?n.frames[k]:n.startFrame??""),sizes:Y,alt:"",draggable:!1,fetchPriority:"high","data-spin-frame":!0,className:"pointer-events-none absolute max-w-none object-contain",style:le}),ue?Q("span",{"data-spin-hint":!0,className:`pointer-events-none absolute inset-x-0 flex flex-col items-center gap-1 text-xs text-fg ${S?"bottom-3":"bottom-5"}`,children:[S?null:T("svg",{viewBox:"0 0 28 12",width:"28",height:"12","aria-hidden":"true",children:T("path",{d:Oe,fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})}),S?"Swipe to turn":"Drag to turn"]}):null]})}export{$e as SpinChoices,Ce as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as a,jsxs as t}from"react/jsx-runtime";import{DEFAULT_FITMENT_CELL_LOOK as
|
|
1
|
+
"use client";import{jsx as a,Fragment as s,jsxs as t}from"react/jsx-runtime";import{DEFAULT_FITMENT_CELL_LOOK as p}from"../../lib/sections/fitment-cell-look.js";import f from"../fitment/FitmentPickerGrid.js";import x from"./CarPickerRow.js";import{useHeroOptionLooks as g}from"./OptionLooks.js";function u({vehicle:e,escape:r,override:n,verdict:l,showChangeCar:c,cascadeErrorNote:i}){const o=e.appliedName!=="",{picker:d}=g();if(d==="oneRow"){const m=a("button",{type:"button",onClick:e.clear,"aria-label":`Change car - forget ${e.appliedName} and ask again`,className:"cursor-pointer text-[length:var(--size-label,12px)] text-fg-dim underline underline-offset-4 hover:text-fg",children:"Change car"});return t("div",{className:"flex flex-col gap-3","data-vehicle-question":"one-row",children:[n||(o?t(s,{children:[l,c&&a("div",{children:m})]}):t(s,{children:[a(x,{cascade:e.cascade}),e.cascade.cascadeError&&a("p",{className:"text-[length:var(--size-label,12px)] leading-relaxed text-fg-dim",children:i})]})),r&&a("div",{className:"flex justify-end text-[length:var(--size-label,12px)]",children:r})]})}return t("div",{className:"pb-2",children:[t("div",{className:"mb-3 flex items-center justify-between gap-4 font-mono text-[13px] font-semibold uppercase tracking-[0.2em] text-fg",children:[a("span",{children:"Vehicle Fitment"}),r]}),n?a("div",{className:"flex flex-col gap-3",children:n}):o?t("div",{className:"flex flex-col gap-3",children:[l,c&&a("div",{children:a("button",{type:"button",onClick:e.clear,"aria-label":`Change car - forget ${e.appliedName} and ask again`,className:"cursor-pointer font-mono text-[12px] uppercase tracking-[0.16em] text-accent underline underline-offset-4 hover:text-fg",children:"Change car"})})]}):t("div",{className:"flex flex-col gap-3",children:[a(f,{cascade:e.cascade,compact:!0,cellLook:p}),e.cascade.cascadeError&&a("p",{className:"font-mono text-[12px] leading-relaxed tracking-[0.1em] text-fg-dim",children:i})]})]})}function C({vehicle:e}){return e.appliedName?t("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 border border-accent px-3 py-2 font-mono text-[12px] tracking-[0.1em] text-fg-dim",style:{background:"color-mix(in oklab, var(--accent) 8%, transparent)"},children:[t("span",{children:["Showing fitment for your"," ",a("strong",{className:"font-semibold text-fg",children:e.appliedName})]}),a("button",{type:"button",onClick:e.clear,"aria-label":`Change car - forget ${e.appliedName} and ask again`,className:"ml-auto cursor-pointer uppercase tracking-[0.16em] text-accent underline underline-offset-4 hover:text-fg",children:"Change car"})]}):null}export{C as HeroVehicleMemory,u as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{PREVIEW_TOKEN_HEADER as dt,SITE_HOST_HEADER as ut,SITE_SLUG_HEADER as lt}from"../site-headers.js";import{PRODUCT_API_BASE as pt,PRODUCT_BACKEND_URL as H}from"./origins.js";import{listRows as m}from"./list-rows.js";import{parseOption as yt}from"efficient-shell/format";import{backendHopHeaders as ht,clientIpFromForwardedFor as ft,FORWARDED_FOR_HEADER as gt,hopCachingOf as mt}from"../forwarded-for.js";import wt from"efficient-web-builder/format/lib/document/media-manifest.json";import{auth as O}from"../auth.js";import{efficientClientOpen as St}from"efficient-easel/screen/lib/session";import{listableWheelSummaries as U}from"../wheels/listable-wheels.js";import{dropRenderlessFinishes as F}from"../wheels/renderable-finishes.js";const Pt=process.env.NEXT_PUBLIC_API_URL??"http://localhost:8000";class w extends Error{status;data;constructor(e,n,s){super(n),this.status=e,this.data=s}}const v="Unable to reach the server. This could be a problem with your internet connection, or the server may be undergoing maintenance or an upgrade. Please try again shortly.",Ot=new Set([502,503,504]),k=0,bt="This editor runs on its host's own backend, which does not serve this request.",Tt=5e3,At=15e3,Rt=()=>typeof window>"u"?Tt:At;function M(t){const e=(t.method??"GET").toUpperCase();if(!(t.body!=null||e!=="GET"&&e!=="HEAD")&&!(t.audience!=null&&t.audience!=="shop")&&typeof AbortSignal?.timeout=="function")return AbortSignal.timeout(Rt())}const B=t=>t instanceof Error&&t.name==="TimeoutError",q=(t,e)=>Ot.has(t)?v:e,Et=["admin","venue"];let G="admin";function $e(t){G=yt(Et,"admin",t)}function _t(){return G}const Ut=/^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{1,8})*$/;let W=null;function Ce(t){W=t&&Ut.test(t)?t:null}function $t(){return W}function Ct(t){if(typeof window>"u"||!t.startsWith("/api/v1/"))return t;const e=Y();return!e||/[?&]site=/.test(t)?t:$(t,`site=${encodeURIComponent(e)}`)}async function i(t,e={}){const{token:n,baseUrl:s,headers:u,audience:l,...y}=e;if(typeof window<"u"&&!St())throw new w(k,bt,null);if(typeof window>"u"&&s===void 0)throw new Error(`apiFetch(${JSON.stringify(t)}) ran on the server without an explicit baseUrl. The API_URL default it would inherit is browser-only (the prod image bakes NEXT_PUBLIC_API_URL="" for same-origin use, which a Node fetch cannot resolve). Pass a base explicitly: \`await backendOpts()\` (or baseUrl: PRODUCT_FETCH_BASE) for product reads, or the server-only PRODUCT_BACKEND_URL env for other backend surfaces.`);const a=typeof FormData<"u"&&y.body instanceof FormData;let r;try{r=await fetch(`${s??Pt}${Ct(t)}`,{...y,headers:{...a?{}:{"Content-Type":"application/json"},...n?{Authorization:`Bearer ${n}`}:{},...l===null?{}:{"X-Portal-Audience":l??"shop"},...u},signal:y.signal??M({...y,audience:l})})}catch(h){throw h instanceof TypeError||B(h)?new w(k,v,null):h}let o;try{o=await r.text()}catch(h){throw B(h)?new w(k,v,null):h}let p=null;if(o)try{p=JSON.parse(o)}catch{throw new w(r.status,r.ok?"Expected JSON but received a non-JSON response":q(r.status,r.statusText),o)}if(!r.ok){const h=(p&&typeof p=="object"&&"detail"in p&&typeof p.detail=="string"?p.detail:null)??q(r.status,r.statusText);throw new w(r.status,h,p)}return p}let A=null;async function j(){return A||(A=Nt().finally(()=>{A=null}),A)}async function Nt(){const t=O.takeLegacyRefresh(),e=await kt.refresh(t??void 0);return O.setTokens(e.access),e.access}async function z(){return O.getAccess()??j()}async function g(t,e={}){let n;try{n=await z()}catch{throw O.clear(),new w(401,"Not signed in",null)}try{return await i(t,{...e,token:n})}catch(s){if(!(s instanceof w)||s.status!==401)throw s;try{const u=await j();return await i(t,{...e,token:u})}catch{throw O.clear(),s}}}const It=100,K=20;function vt(t){if(!t)return null;try{return new URL(t,"http://page.invalid").searchParams.get("page")}catch{return null}}async function V(t,e){const[n,s=""]=t.split("?"),u=[];let l="1";for(let y=0;y<K&&l;y++){const a=new URLSearchParams(s);a.set("page_size",String(It)),l!=="1"&&a.set("page",l);const r=await g(`${n}?${a.toString()}`);u.push(...m(r)),l=vt(r.next)}return l&&console.warn(`[${e}] stopped at ${K} pages (${u.length} rows); list may be truncated`),u}async function X(t,e={}){if(O.getAccess())try{return{data:await g(t,e),asShopper:!0}}catch(n){if(!(n instanceof w)||n.status!==401)throw n}return{data:await i(t,e),asShopper:!1}}async function Z(){const t=await g("/api/auth/me/");if(t.portal!=="shop")throw O.clear(),new w(403,"This session is not valid for this shop.",null);return t}const kt={login:(t,e)=>i("/api/auth/login/",{method:"POST",body:JSON.stringify({email:t,password:e,portal:"shop"}),credentials:"include"}),refresh:t=>i("/api/auth/refresh/",{method:"POST",body:JSON.stringify(t?{refresh:t,portal:"shop"}:{portal:"shop"}),credentials:"include"}),logout:async()=>{O.clear();try{await i("/api/auth/logout/",{method:"POST",body:JSON.stringify({portal:"shop"}),credentials:"include"})}catch{}},restoreSession:async()=>{const t=await z();return await Z(),t},me:Z,updateMe:t=>g("/api/auth/me/",{method:"PATCH",body:JSON.stringify(t)}),changePassword:(t,e)=>g("/api/auth/me/",{method:"PATCH",body:JSON.stringify({password:e,old_password:t})}),changeEmail:(t,e)=>g("/api/shop-portal/change-email/",{method:"POST",body:JSON.stringify({new_email:t,current_password:e})}),myProfile:()=>g("/api/shop-portal/profile/"),updateMyProfile:t=>g("/api/shop-portal/profile/",{method:"PATCH",body:JSON.stringify(t)}),myAddresses:()=>g("/api/shop-portal/delivery-locations/"),createAddress:t=>g("/api/shop-portal/delivery-locations/",{method:"POST",body:JSON.stringify(t)}),updateAddress:(t,e)=>g(`/api/shop-portal/delivery-locations/${t}/`,{method:"PATCH",body:JSON.stringify(e)}),deleteAddress:t=>g(`/api/shop-portal/delivery-locations/${t}/`,{method:"DELETE"}),passwordResetRequest:t=>i("/api/auth/password-reset/",{method:"POST",body:JSON.stringify({email:t})}),passwordResetConfirm:(t,e,n)=>i("/api/auth/password-reset/confirm/",{method:"POST",body:JSON.stringify({uid:t,token:e,new_password:n})}),brands:()=>g("/api/products/brands/"),myOrders:()=>V("/api/shop-portal/orders/","api.myOrders"),myOrder:t=>g(`/api/shop-portal/orders/${t}/`),cancelOrder:t=>g(`/api/shop-portal/orders/${t}/cancel/`,{method:"POST"}),myReturns:t=>V(`/api/shop-portal/returns/${t?`?order=${encodeURIComponent(t)}`:""}`,"api.myReturns"),createReturn:t=>g("/api/shop-portal/returns/",{method:"POST",body:JSON.stringify(t)}),withdrawReturn:t=>g(`/api/shop-portal/returns/${t}/cancel/`,{method:"POST"}),uploadReturnPhoto:(t,e)=>{const n=new FormData;return n.append("claim_item",t),n.append("file",e),n.append("media_type",e.type.startsWith("video/")?"video":"image"),g("/api/shop-portal/return-media/",{method:"POST",body:n})}};import{media as Lt,absolutizeApiUrl as L}from"efficient-web-builder/render/lib/media";import{analyzeLogoSvg as Jt,isSvgUrl as xt}from"efficient-web-builder/format/lib/logo/reverse-svg";import{getEditorSiteId as Dt}from"efficient-web-builder/render/lib/editor-site";import{shopRouteBase as Ht,webRuntimeSiteSlug as Y}from"efficient-web-builder/format/lib/web-runtime";import{readDealerList as Ft}from"../sections/dealer-finder.js";import{SIGN_UP_PATH as Mt,SIGN_UP_VERIFY_PATH as Bt,SIGN_UP_WAITING_PATH as qt,WORKSPACE_FINDS_PATH as Gt,WORKSPACE_FIND_OPEN_PATH as Wt,signInUrlOf as jt,readLinkAnswer as Q,readSignUpAvailability as zt,readSignUpSent as Kt,signUpAvailabilityPath as Vt}from"../sections/sign-up.js";function S(t){if(typeof t=="string")return t.startsWith("/media/")?Lt(t):t;if(Array.isArray(t))return t.map(S);if(t&&typeof t=="object"){const e={};for(const[n,s]of Object.entries(t))e[n]=n==="captions"&&s&&typeof s=="object"&&!Array.isArray(s)?Object.fromEntries(Object.entries(s).map(([u,l])=>[S(u),l])):S(s);return e}return t}import{PRODUCT_API_BASE as Ze}from"./origins.js";const tt=typeof window>"u"&&H!=="",Xt=tt?H:pt,Zt=Ht,b=()=>({baseUrl:Zt(),audience:null});function c(t,e){const n=e?`?process=${encodeURIComponent(e)}`:"";return`/api/v1${t}${n}`}const et=100,at=50;function J(t,e,n){const s=new URLSearchParams;for(const[u,l]of Object.entries(e))l!=null&&l!==""&&s.set(u,String(l));return s.set("pageSize",String(et)),n&&s.set("cursor",n),`/api/v1${t}?${s.toString()}`}function Yt(t,e){return J("/wheels",{process:t},e)}const rt=et;function Qt(t,e){return J("/wheels",{slug:t.join(",")},e)}function te(t,e,n){return J("/products",{kind:t.join(","),make:e?.make,model:e?.model,year:e?.year,modification:e?.modification},n)}function ee(t){if(!t)return null;try{return new URL(t,"http://cursor.invalid").searchParams.get("cursor")}catch{return null}}async function x(t,e,n=()=>!1,s=()=>!1){const u=[];let l=null;try{for(let y=0;y<at;y++){const a=await i(await e(l),await d());if(u.push(...m(a)),l=ee(a.next),!l)break;if(s(u))return u}l&&console.warn(`[${t}] stopped at ${at} pages (${u.length} rows); catalog may be truncated`)}catch(y){if(n(y))throw y;console.warn(`[${t}] product API unavailable, returning []`,y)}return u}const nt=t=>t instanceof w&&t.status===400;function st(t){return t.flatMap(e=>e.kind==="alloy-wheel"?U([e]):[e])}async function ot(){return(await ae()).host}async function ae(){try{const{headers:t}=await import("next/headers"),e=await t(),n=l=>l?.split(",")[0]?.split(":")[0]?.trim().toLowerCase()||null,s=n(e.get(ut)??e.get("x-forwarded-host")??e.get("host")),u=n(e.get("host"));return{host:s,matchesRequestHost:s!==null&&s===u}}catch{return{host:null,matchesRequestHost:!1}}}async function re(){try{const{headers:t}=await import("next/headers");return ft((await t()).get(gt))}catch{return null}}async function ne(){try{const{headers:t}=await import("next/headers");return(await t()).get(lt)||null}catch{return null}}async function se(){const t=await ne();if(t)return`site=${encodeURIComponent(t)}`;const e=await ot();return e?`host=${encodeURIComponent(e)}`:""}async function f(t){if(typeof window<"u"){const e=Y();return e?$(t,`site=${encodeURIComponent(e)}`):t}return $(t,await se())}function $(t,e){return e?`${t}${t.includes("?")?"&":"?"}${e}`:t}const oe="preview";async function ie(){if(typeof window<"u")return null;try{const{headers:t}=await import("next/headers");return(await t()).get(dt)}catch{return null}}async function ce(){try{const{headers:t}=await import("next/headers");return(await t()).get("user-agent")}catch{return null}}async function D(t,e){const n=await ie();if(n===null)return[await f(t),await d(e)];const s=$(await f(t),`${oe}=${encodeURIComponent(n)}`),{next:u,cache:l,...y}=e??{},a=await d({...y,cache:"no-store"}),r=await ce();return r&&(a.headers={...a.headers,"user-agent":r}),[s,a]}async function de(t){if(!tt)return;const[e,n]=await Promise.all([ot(),re()]),s=ht(e,n,t);return Object.keys(s).length>0?s:void 0}async function d(t){const e=await de(mt(t)),n={baseUrl:Xt,...t};return e&&(n.headers={...e,...t?.headers}),n}const R=typeof window>"u";function E(t,e){const n=new URLSearchParams;for(const[u,l]of Object.entries(e))l!==void 0&&l!==""&&n.set(u,String(l));const s=n.toString();return`/api/v1/fitment${t}${s?`?${s}`:""}`}const xe={listMakes:async t=>{if(R){const{fitmentData:n}=await import("./fitment-data.js");return n.makes(t)}const e=await i(E("/makes",{region:t}),b());return m(e)},listModels:async(t,e)=>{if(R){const{fitmentData:s}=await import("./fitment-data.js");return s.models(t,e)}const n=await i(E("/models",{make:t,region:e}),b());return m(n)},listYears:async(t,e,n)=>{if(R){const{fitmentData:u}=await import("./fitment-data.js");return u.years(t,e,n)}const s=await i(E("/years",{make:t,model:e,region:n}),b());return m(s)},listModifications:async(t,e,n,s)=>{if(R){const{fitmentData:l}=await import("./fitment-data.js");return l.modifications(t,e,n,s)}const u=await i(E("/modifications",{make:t,model:e,year:n,region:s}),b());return m(u)},getStockFitment:async(t,e,n,s,u)=>{if(R){const{fitmentData:l}=await import("./fitment-data.js");return l.stockFitment(t,e,n,s,u)}return i(E("/stock-fitment",{make:t,model:e,year:n,modification:s,region:u}),b())}},De={listWheels:async(t,e={})=>{const n=await x("products.listWheels",async s=>await f(Yt(t,s)),e.throwOnFailure?()=>!0:void 0,e.maxRows===void 0?void 0:s=>U([...s]).length>=e.maxRows);return U(S(n))},listWheelsBySlug:async(t,e={})=>{const n=[...new Set(t.map(a=>a.trim()).filter(Boolean))];if(n.length===0)return[];const s=[];for(let a=0;a<n.length;a+=rt)s.push(n.slice(a,a+rt));const u=await Promise.all(s.map(a=>x("products.listWheelsBySlug",async r=>await f(Qt(a,r)),e.throwOnFailure?()=>!0:nt))),l=new Set(n),y=u.flat().filter(a=>l.has(a.slug));return U(S(y))},listCatalog:async(t,e,n={})=>{if(t.length===0)throw new Error("products.listCatalog() needs at least one kind. An empty list would omit `kind`, which the contract reads as `alloy-wheel` — so the call would silently return the wheel catalog instead of nothing.");const s=await x("products.listCatalog",async u=>await f(te(t,e,u)),n.throwOnFailure?()=>!0:nt,n.maxRows===void 0?void 0:u=>st([...u]).length>=n.maxRows);return st(S(s))},getWheel:async t=>F(S(await i(await f(c(`/wheels/${t}`)),await d()))),getTyre:async t=>S(await i(await f(c(`/tyres/${t}`)),await d())),listBundles:async(t={})=>{try{return await i(await f(c("/bundles")),await d())}catch(e){if(t.throwOnFailure)throw e;return[]}},getBundle:async t=>i(await f(c(`/bundles/${t}`)),await d()),listGalleryBuilds:async(t={})=>{const{process:e=null,wheelSlug:n=null}=t;if(typeof window>"u"){const{listGalleryBuilds:s}=await import("./gallery-builds-data.js");return S(s(e,n))}try{const s=new URLSearchParams;e&&s.set("process",e),n&&s.set("wheelSlug",n);const u=s.toString(),l=await i(`/api/v1/gallery-builds${u?`?${u}`:""}`,b());return S(m(l))}catch(s){return console.warn("[products.listGalleryBuilds] product API unavailable, returning []",s),[]}},getSite:async()=>i(await f(c("/site")),await d()),getSiteBySlug:async t=>i(`${c("/site")}?${new URLSearchParams({site:t})}`,typeof window>"u"?await d():void 0),listPages:async()=>S(await i(await f(c("/pages")),await d())),listPopups:async()=>i(await f(c("/popups")),await d()),listProductTemplates:async()=>{try{return await i(await f(c("/product-templates")),await d())}catch(t){return console.warn("[products.listProductTemplates] unavailable, returning []",t),[]}},listDynamicPages:async t=>{const e=t?`?recordType=${encodeURIComponent(t)}`:"";try{return await i(await f(`${c("/dynamic-pages")}${e}`),await d())}catch(n){if(n instanceof w&&n.status===404)return[];throw n}},getRecord:async(t,e)=>{try{return await i(await f(c(`/records/${encodeURIComponent(t)}/${encodeURIComponent(e)}`)),await d())}catch(n){if(n instanceof w&&n.status===404)return null;throw n}},listRecordKeys:async t=>{try{const e=await i(await f(c(`/records/${encodeURIComponent(t)}`)),await d({cache:"no-store"}));return Array.isArray(e?.keys)?e.keys.filter(n=>typeof n=="string"&&n!==""):[]}catch(e){if(e instanceof w&&e.status===404)return[];throw e}},listProductTypeChoices:async()=>{try{return await i(await f(c("/product-type-choices")),await d())}catch(t){return console.warn("[products.listProductTypeChoices] unavailable, returning []",t),[]}},listFieldUsage:async()=>{try{return await i(await f(c("/field-usage")),await d())}catch(t){return console.warn("[products.listFieldUsage] unavailable, returning []",t),[]}},getPage:async(t,e={})=>{const n=e.record?`?record=${encodeURIComponent(e.record)}`:"",[s,u]=await D(c(`/pages/${t}`)+n,e.revalidate!==void 0?{next:{revalidate:e.revalidate}}:void 0);return S(await i(s,u))},listBlogPosts:async(t={},{throwOnFailure:e=!1}={})=>{const n=t.category?`?category=${encodeURIComponent(t.category)}`:"";try{return(await i(c("/blog-posts")+n,await d())).map(u=>({...u,coverImage:L(u.coverImage)??""}))}catch(s){if(e)throw s;return console.warn("[products.listBlogPosts] blog API unavailable, returning []",s),[]}},getBlogPost:async t=>{const e=await i(c(`/blog-posts/${t}`),await d());return{...e,coverImage:L(e.coverImage)??""}},createOrder:async t=>i(c("/orders"),await d({method:"POST",body:JSON.stringify(t)})),createOrderAuthed:async t=>g(c("/orders"),await d({method:"POST",body:JSON.stringify(t)})),lookupOrder:async t=>i(c("/orders/lookup"),await d({method:"POST",body:JSON.stringify(t)})),createPaymentIntent:async t=>i(c("/payments/intent"),await d({method:"POST",body:JSON.stringify(t)})),releaseCheckout:async t=>i(c("/checkouts/release"),await d({method:"POST",body:JSON.stringify(t)})),createPaypalOrder:async t=>i(c("/payments/paypal/order"),await d({method:"POST",body:JSON.stringify(t)})),capturePaypalOrder:async t=>i(c("/payments/paypal/capture"),await d({method:"POST",body:JSON.stringify(t)})),createAfterpayCheckout:async t=>i(c("/payments/afterpay/checkout"),await d({method:"POST",body:JSON.stringify(t)})),captureAfterpayPayment:async t=>i(c("/payments/afterpay/capture"),await d({method:"POST",body:JSON.stringify(t)})),chargeSquare:async t=>i(c("/payments/square/charge"),await d({method:"POST",body:JSON.stringify(t)})),createGocardlessBillingRequest:async t=>i(c("/payments/gocardless/billing-request"),await d({method:"POST",body:JSON.stringify(t)})),completeGocardlessPayment:async t=>i(c("/payments/gocardless/complete"),await d({method:"POST",body:JSON.stringify(t)})),createZipCheckout:async t=>i(c("/payments/zip/checkout"),await d({method:"POST",body:JSON.stringify(t)})),captureZipPayment:async t=>i(c("/payments/zip/capture"),await d({method:"POST",body:JSON.stringify(t)})),createKlarnaCheckout:async t=>i(c("/payments/klarna/checkout"),await d({method:"POST",body:JSON.stringify(t)})),captureKlarnaPayment:async t=>i(c("/payments/klarna/capture"),await d({method:"POST",body:JSON.stringify(t)})),createStockAlert:async t=>i(c("/stock-alerts"),await d({method:"POST",body:JSON.stringify(t)})),createPreOrderIntent:async t=>i(c("/pre-order-intents"),await d({method:"POST",body:JSON.stringify(t)})),createNewsletterSubscription:async t=>i(c("/newsletter-subscriptions"),await d({method:"POST",body:JSON.stringify(t)})),unsubscribeNewsletter:async t=>i(c("/newsletter-unsubscribe"),await d({method:"POST",body:JSON.stringify(t)})),captureCart:async t=>i(c("/carts"),await d({method:"POST",body:JSON.stringify(t)})),restoreCart:async t=>i(c("/carts/restore"),await d({method:"POST",body:JSON.stringify(t)})),unsubscribeCartReminders:async t=>i(c("/carts/unsubscribe"),await d({method:"POST",body:JSON.stringify(t)})),listReviews:async(t={})=>{const e=new URLSearchParams;t.limit&&e.set("limit",String(t.limit)),t.designCode&&e.set("designCode",t.designCode);const n=c("/reviews"),s=e.toString();try{return await i(await f(s?`${n}?${s}`:n),await d())}catch(u){return console.warn("[products.listReviews] product API unavailable, returning []",u),[]}},submitReview:async t=>i(c("/reviews"),await d({method:"POST",body:JSON.stringify(t)})),getForm:async t=>i(c(`/forms/${encodeURIComponent(t)}`),await d()),submitForm:async(t,e)=>i(c(`/forms/${encodeURIComponent(t)}/submissions`),await d({method:"POST",body:JSON.stringify(e)})),listShippingMethods:async()=>{try{return await i(c("/shipping-methods"),await d())}catch(t){return console.warn("[products.listShippingMethods] product API unavailable, returning []",t),[]}},listCountrySubdivisions:async t=>{try{return await i(c(`/countries/${encodeURIComponent(t)}/subdivisions`),await d())}catch(e){return console.warn("[products.listCountrySubdivisions] unavailable, returning []",e),[]}},quoteCart:async t=>{const e=c("/cart/quote"),n=await d({method:"POST",body:JSON.stringify(t)});return t.couponCode?(await X(e,n)).data:i(e,n)},validateCoupon:async t=>{const{data:e,asShopper:n}=await X(c("/coupons/validate"),await d({method:"POST",body:JSON.stringify(t)}));return{...e,askedAsShopper:n}},getHeaderSettings:async()=>{const t=M({method:"GET"}),e=await i(...await D(c("/header-settings"),{signal:t})),n=L(e.logoUrl);let s=null,u=null;if(n&&xt(n)){const l=await Jt(n,t);l&&(s=l.reversed,u=l.inkIsDark)}return{...e,logoUrl:n,logoReversed:s,logoInkIsDark:u}},getThemeSettings:async()=>i(...await D(c("/theme-settings"))),getChatSettings:async()=>i(await f(c("/chat-settings")),await d())},He={listServices:async()=>{try{return await i(c("/bookings/services"),await d())}catch(t){return console.warn("[bookings.listServices] API unavailable, returning []",t),{results:[],currency:"USD"}}},getAvailability:async(t,e)=>i(c(`/bookings/availability?service=${encodeURIComponent(t)}&date=${e}`),await d()),create:async t=>i(c("/bookings"),await d({method:"POST",body:JSON.stringify(t)})),get:async t=>i(c(`/bookings/manage/${encodeURIComponent(t)}`),await d()),cancel:async t=>i(c(`/bookings/manage/${encodeURIComponent(t)}/cancel`),await d({method:"POST"})),reschedule:async(t,e)=>i(c(`/bookings/manage/${encodeURIComponent(t)}/reschedule`),await d({method:"POST",body:JSON.stringify({startAt:e})})),createPaymentIntent:async t=>i(c("/bookings/payments/intent"),await d({method:"POST",body:JSON.stringify({manageToken:t})}))};class ue extends Error{slug;count;constructor(e,n){super(`Slug "${e}" exists on ${n} websites; a site is required to pick one.`),this.slug=e,this.count=n,this.name="AmbiguousPageSlugError"}}const C=(t,e,n)=>{const s=new URLSearchParams({...e?{site:e}:{},...n?{draft:"1"}:{}}).toString();return`/api/storefront/${t}/${s?`?${s}`:""}`},N=t=>`/api/storefront/sites/${encodeURIComponent(t)}/`,le=t=>`${N(t)}currencies/`,pe="/api/storefront/media/ingest/";class ye extends Error{constructor(){super("This editor is not connected to a website, so an upload has nowhere to go. Open the page from the website the file should belong to, then try again."),this.name="MediaUploadDestinationError"}}function he(){const t=Dt();if(!t)throw new ye;return`${pe}?${new URLSearchParams({site:t})}`}const fe="X-Puck-Media-Manifest",it=wt.contentHash,I={"X-Media-Manifest":it,[fe]:it},Fe=ct({});function ct(t){return(e,n={})=>{const s=$t(),u=t.headers||s?{...s?{"Accept-Language":s}:{},...t.headers,...n.headers}:void 0;return i(e,{...n,...t.baseUrl!==void 0?{baseUrl:t.baseUrl}:{},...u?{headers:u}:{},audience:t.audience??_t()})}}function ge(t={}){const e=ct(t),n=t.siteDrafts===!0,s=a=>C("header-settings",a,n),u=a=>C("theme-settings",a,n),l=a=>C("chat-settings",a,n),y=a=>C("social-settings",a,n);return{findPageBySlug:async(a,r,o)=>{const p=new URLSearchParams({slug:a});o&&p.set("site",o);const h=await e(`/api/storefront/pages/?${p.toString()}`,{token:r}),P=m(h);if(!o&&P.length>1)throw new ue(a,P.length);return P[0]??null},getPageById:(a,r)=>e(`/api/storefront/pages/${a}/`,{token:r}),saveLayout:(a,r,o,p,h)=>e(`/api/storefront/pages/${a}/`,{method:"PATCH",body:JSON.stringify({layout:r,expected_updated_at:p,...h?{client_id:h}:{}}),token:o}),duplicatePage:(a,r,o)=>e(`/api/storefront/pages/${a}/duplicate/`,{method:"POST",body:JSON.stringify({title:r.title,slug:r.slug}),token:o}),geocode:(a,r,o)=>e(`/api/storefront/geocode/?${new URLSearchParams(o?{q:a,country:o}:{q:a})}`,{token:r}),listBlockSources:a=>e("/api/storefront/block-sources/",{token:a}),listRecordTypes:a=>e("/api/storefront/record-types/",{token:a}),createPagePreviewLink:(a,r)=>e(`/api/storefront/pages/${a}/preview-link/`,{method:"POST",token:r}),claimPageEditLock:(a,r,o,p=!1)=>e(`/api/storefront/pages/${a}/edit-lock/`,{method:"POST",body:JSON.stringify({client_id:o,takeover:p}),token:r}),releasePageEditLock:(a,r)=>e(`/api/storefront/pages/${a}/edit-lock/`,{method:"DELETE",token:r}),createTemplate:(a,r,o)=>e("/api/storefront/page-templates/",{method:"POST",body:JSON.stringify({name:a,layout:r}),headers:I,token:o}),getTemplate:(a,r)=>e(`/api/storefront/page-templates/${a}/`,{token:r}),saveTemplateLayout:(a,r,o)=>e(`/api/storefront/page-templates/${a}/`,{method:"PATCH",body:JSON.stringify({layout:r}),headers:I,token:o}),listTemplatePages:async(a,r)=>{const o=await e(`/api/storefront/template-pages/?template=${encodeURIComponent(a)}`,{token:r});return m(o)},getPageLibrary:async a=>{const r=await e("/api/storefront/page-templates/?is_page_library=true&is_active=true",{token:a});return m(r)[0]??null},getTemplateLibrary:(a,r)=>e(`/api/storefront/pages/template-library/?site=${encodeURIComponent(a)}`,{token:r}),createPageFromTemplate:(a,r)=>e(`/api/storefront/pages/from-template/${n?"?draft=1":""}`,{method:"POST",body:JSON.stringify(a),token:r}),findTemplatePageBySlug:async(a,r,o)=>{const p=await e(`/api/storefront/template-pages/?template=${encodeURIComponent(a)}&slug=${encodeURIComponent(r)}`,{token:o});return m(p)[0]??null},createTemplatePage:(a,r,o)=>e("/api/storefront/template-pages/",{method:"POST",body:JSON.stringify({template:a,...r}),headers:I,token:o}),saveTemplatePageLayout:(a,r,o)=>e(`/api/storefront/template-pages/${a}/`,{method:"PATCH",body:JSON.stringify({layout:r}),headers:I,token:o}),deleteTemplatePage:(a,r,o)=>e(`/api/storefront/template-pages/${a}/`,{method:"DELETE",token:r,...o?.keepalive?{keepalive:!0}:{}}),listPages:async(a,r)=>{const o=new URLSearchParams({no_page:"true"});r&&o.set("site",r);const p=await e(`/api/storefront/pages/?${o.toString()}`,{token:a});return m(p)},createPage:(a,r,o,p)=>e("/api/storefront/pages/",{method:"POST",body:JSON.stringify({title:a,slug:r,layout:o}),token:p}),deletePage:(a,r)=>e(`/api/storefront/pages/${a}/`,{method:"DELETE",token:r}),getHeaderSettings:(a,r)=>e(s(r),{token:a}),listMenus:async(a,r)=>{const o=new URLSearchParams({no_page:"true"});r&&o.set("site",r);const p=await e(`/api/storefront/menus/?${o}`,{token:a});return m(p)},listBlogPosts:async(a,r={})=>{const o=new URLSearchParams({no_page:"true"});r.visibleOnly&&o.set("is_visible","true"),r.siteId&&o.set("site",r.siteId);const p=await e(`/api/storefront/blog-posts/?${o.toString()}`,{token:a});return m(p)},listFieldUsage:async(a,r)=>{const o=await e(`/api/storefront/field-usage/?site=${encodeURIComponent(r)}`,{token:a});return Array.isArray(o?.entries)?o.entries:[]},listCategories:async(a,r={})=>{const o=new URLSearchParams({no_page:"true"});r.visibleOnly&&o.set("is_visible","true"),r.siteId&&o.set("site",r.siteId);const p=await e(`/api/storefront/categories/?${o.toString()}`,{token:a});return[...m(p)].sort((P,_)=>P.sort_order-_.sort_order||P.name.localeCompare(_.name))},listForms:async(a,r={})=>{const o=new URLSearchParams({no_page:"true"});r.siteId&&o.set("site",r.siteId);const p=await e(`/api/storefront/forms/?${o.toString()}`,{token:a});return[...m(p)].sort((P,_)=>P.title.localeCompare(_.title))},listWheelSummaries:async(a,r={})=>{const o=new URLSearchParams;r.siteId&&o.set("site",r.siteId);const p=o.toString(),h=await e(`/api/storefront/wheel-curations/summaries/${p?`?${p}`:""}`,{token:a});return S(h)},listProducts:async(a,r={})=>{const o=new URLSearchParams;r.kinds?.length&&o.set("kind",r.kinds.join(",")),r.siteId&&o.set("site",r.siteId);const p=o.toString(),h=await e(`/api/storefront/products/${p?`?${p}`:""}`,{token:a});return S(h)},getWheelDetail:async(a,r,o={})=>{const p=new URLSearchParams({slug:r});return o.siteId&&p.set("site",o.siteId),F(S(await e(`/api/storefront/wheel-curations/detail/?${p.toString()}`,{token:a})))},updateHeaderSettings:(a,r,o)=>e(s(o),{method:"PATCH",body:JSON.stringify(a),token:r}),getSite:(a,r)=>e(N(a),{token:r}),listSites:async a=>{const r=await e("/api/storefront/sites/?no_page=true",{token:a});return m(r)},listSiteCurrencies:async(a,r)=>{const o=await e(le(a),{token:r});return Array.isArray(o)?o:[]},publishSite:(a,r)=>e(`${N(a)}publish/`,{method:"POST",token:r}),getSiteLiveState:(a,r)=>e(`${N(a)}live-state/`,{token:r}),getThemeSettings:(a,r)=>e(u(r),{token:a}),updateThemeSettings:(a,r,o)=>e(u(o),{method:"PATCH",body:JSON.stringify(a),token:r}),getMyPreferences:async a=>(await e("/api/auth/me/",{token:a})).preferences??{},updateMyPreferences:(a,r)=>e("/api/auth/me/",{method:"PATCH",body:JSON.stringify({preferences:a}),token:r}),getChatSettings:(a,r)=>e(l(r),{token:a}),updateChatSettings:(a,r,o)=>e(l(o),{method:"PATCH",body:JSON.stringify(a),token:r}),getSocialSettings:(a,r)=>e(y(r),{token:a}),updateSocialSettings:(a,r,o)=>e(y(o),{method:"PATCH",body:JSON.stringify(a),token:r}),uploadHeaderLogo:(a,r,o)=>{const p=new FormData;return p.append("logo",a),e(s(o),{method:"PATCH",body:p,token:r})},clearHeaderLogo:(a,r)=>e(s(r),{method:"PATCH",body:JSON.stringify({logo:null}),token:a}),setHeaderLogoFromAsset:(a,r,o)=>e(s(o),{method:"PATCH",body:JSON.stringify({logo_asset_id:a}),token:r}),uploadMedia:async(a,r)=>{const o=new FormData;return o.append("file",a),e(he(),{method:"POST",body:o,token:r})},listMedia:async(a,r)=>{const o=new URLSearchParams({no_page:"true"});r&&o.set("kind",r);const p=await e(`/api/storefront/media-assets/?${o.toString()}`,{token:a});return m(p)}}}const Me=ge({siteDrafts:!0});function me(t){const e=t.trim();return e?`/api/v1/dealers?${new URLSearchParams({near:e}).toString()}`:"/api/v1/dealers"}async function Be(t){return Ft(await i(me(t)))}const T={audience:null,baseUrl:""};async function qe(t,e){return zt(await i(Vt(t,e),T))}async function Ge(t){return Kt(await i(Mt,{...T,method:"POST",body:JSON.stringify(t)}))}async function We(t){try{const e=await i(Bt,{...T,method:"POST",body:JSON.stringify({token:t})});return Q(202,e)}catch(e){if(e instanceof w)return Q(e.status,e.data);throw e}}async function je(t,e){await i(qt,{...T,method:"POST",body:JSON.stringify({email:e.trim(),...t?{product:t}:{}})})}async function ze(t,e){await i(Gt,{...T,method:"POST",body:JSON.stringify({email:e.trim(),...t?{product:t}:{}})})}async function Ke(t){try{return jt(await i(Wt,{...T,method:"POST",body:JSON.stringify({token:t})}))}catch(e){if(e instanceof w&&we.has(e.status))return"";throw e}}const we=new Set([400,404,410]);export{Pt as API_URL,ue as AmbiguousPageSlugError,w as ApiError,At as BROWSER_READ_TIMEOUT_MS,bt as EFFICIENT_CLIENT_CLOSED_MESSAGE,ye as MediaUploadDestinationError,oe as PREVIEW_PARAM,Ze as PRODUCT_API_BASE,Tt as SERVER_READ_TIMEOUT_MS,v as SERVER_UNREACHABLE_MESSAGE,k as STATUS_NETWORK_ERROR,Fe as adminFetch,kt as api,i as apiFetch,$ as appendSiteQuery,ze as askForWorkspaces,Ge as askToSignUp,He as bookings,ge as createStorefrontAdmin,me as dealersPath,M as defaultRequestDeadline,he as editorMediaUploadPath,_t as editorPortalAudience,$t as editorRequestLanguage,Be as fetchDealers,qe as fetchSignUpAvailability,xe as fitment,je as joinSignUpWaitingList,We as openSignUpLink,Ke as openWorkspaceFind,De as products,Rt as readDeadlineMs,re as resolveClientIp,S as resolveMediaUrls,ie as resolvePreviewToken,ot as resolveSiteHost,ae as resolveSiteHostSource,ne as resolveSiteSlug,Ce as setEditorLanguage,$e as setEditorPortalAudience,Me as storefrontAdmin};
|
|
1
|
+
import{PREVIEW_TOKEN_HEADER as dt,SITE_HOST_HEADER as lt,SITE_SLUG_HEADER as ut}from"../site-headers.js";import{PRODUCT_API_BASE as pt,PRODUCT_BACKEND_URL as H,productBackendUrlNow as yt}from"./origins.js";import{listRows as m}from"./list-rows.js";import{parseOption as ft}from"efficient-shell/format";import{backendHopHeaders as ht,clientIpFromForwardedFor as gt,FORWARDED_FOR_HEADER as mt,hopCachingOf as wt}from"../forwarded-for.js";import St from"efficient-web-builder/format/lib/document/media-manifest.json";import{auth as O}from"../auth.js";import{efficientClientOpen as Pt}from"efficient-easel/screen/lib/session";import{listableWheelSummaries as U}from"../wheels/listable-wheels.js";import{dropRenderlessFinishes as F}from"../wheels/renderable-finishes.js";const Ot=process.env.NEXT_PUBLIC_API_URL??"http://localhost:8000";class w extends Error{status;data;constructor(e,n,s){super(n),this.status=e,this.data=s}}const v="Unable to reach the server. This could be a problem with your internet connection, or the server may be undergoing maintenance or an upgrade. Please try again shortly.",bt=new Set([502,503,504]),k=0,Tt="This editor runs on its host's own backend, which does not serve this request.",At=5e3,Rt=15e3,Et=()=>typeof window>"u"?At:Rt;function M(t){const e=(t.method??"GET").toUpperCase();if(!(t.body!=null||e!=="GET"&&e!=="HEAD")&&!(t.audience!=null&&t.audience!=="shop")&&typeof AbortSignal?.timeout=="function")return AbortSignal.timeout(Et())}const B=t=>t instanceof Error&&t.name==="TimeoutError",q=(t,e)=>bt.has(t)?v:e,_t=["admin","venue"];let G="admin";function Ne(t){G=ft(_t,"admin",t)}function Ut(){return G}const $t=/^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{1,8})*$/;let W=null;function Ie(t){W=t&&$t.test(t)?t:null}function Ct(){return W}function Nt(t){if(typeof window>"u"||!t.startsWith("/api/v1/"))return t;const e=Y();return!e||/[?&]site=/.test(t)?t:$(t,`site=${encodeURIComponent(e)}`)}async function i(t,e={}){const{token:n,baseUrl:s,headers:c,audience:u,...y}=e;if(typeof window<"u"&&!Pt())throw new w(k,Tt,null);if(typeof window>"u"&&s===void 0)throw new Error(`apiFetch(${JSON.stringify(t)}) ran on the server without an explicit baseUrl. The API_URL default it would inherit is browser-only (the prod image bakes NEXT_PUBLIC_API_URL="" for same-origin use, which a Node fetch cannot resolve). Pass a base explicitly: \`await backendOpts()\` (or baseUrl: PRODUCT_FETCH_BASE) for product reads, or the server-only PRODUCT_BACKEND_URL env for other backend surfaces.`);const a=typeof FormData<"u"&&y.body instanceof FormData;let r;try{r=await fetch(`${s??Ot}${Nt(t)}`,{...y,headers:{...a?{}:{"Content-Type":"application/json"},...n?{Authorization:`Bearer ${n}`}:{},...u===null?{}:{"X-Portal-Audience":u??"shop"},...c},signal:y.signal??M({...y,audience:u})})}catch(f){throw f instanceof TypeError||B(f)?new w(k,v,null):f}let o;try{o=await r.text()}catch(f){throw B(f)?new w(k,v,null):f}let p=null;if(o)try{p=JSON.parse(o)}catch{throw new w(r.status,r.ok?"Expected JSON but received a non-JSON response":q(r.status,r.statusText),o)}if(!r.ok){const f=(p&&typeof p=="object"&&"detail"in p&&typeof p.detail=="string"?p.detail:null)??q(r.status,r.statusText);throw new w(r.status,f,p)}return p}let A=null;async function j(){return A||(A=It().finally(()=>{A=null}),A)}async function It(){const t=O.takeLegacyRefresh(),e=await Lt.refresh(t??void 0);return O.setTokens(e.access),e.access}async function z(){return O.getAccess()??j()}async function g(t,e={}){let n;try{n=await z()}catch{throw O.clear(),new w(401,"Not signed in",null)}try{return await i(t,{...e,token:n})}catch(s){if(!(s instanceof w)||s.status!==401)throw s;try{const c=await j();return await i(t,{...e,token:c})}catch{throw O.clear(),s}}}const vt=100,K=20;function kt(t){if(!t)return null;try{return new URL(t,"http://page.invalid").searchParams.get("page")}catch{return null}}async function X(t,e){const[n,s=""]=t.split("?"),c=[];let u="1";for(let y=0;y<K&&u;y++){const a=new URLSearchParams(s);a.set("page_size",String(vt)),u!=="1"&&a.set("page",u);const r=await g(`${n}?${a.toString()}`);c.push(...m(r)),u=kt(r.next)}return u&&console.warn(`[${e}] stopped at ${K} pages (${c.length} rows); list may be truncated`),c}async function V(t,e={}){if(O.getAccess())try{return{data:await g(t,e),asShopper:!0}}catch(n){if(!(n instanceof w)||n.status!==401)throw n}return{data:await i(t,e),asShopper:!1}}async function Z(){const t=await g("/api/auth/me/");if(t.portal!=="shop")throw O.clear(),new w(403,"This session is not valid for this shop.",null);return t}const Lt={login:(t,e)=>i("/api/auth/login/",{method:"POST",body:JSON.stringify({email:t,password:e,portal:"shop"}),credentials:"include"}),refresh:t=>i("/api/auth/refresh/",{method:"POST",body:JSON.stringify(t?{refresh:t,portal:"shop"}:{portal:"shop"}),credentials:"include"}),logout:async()=>{O.clear();try{await i("/api/auth/logout/",{method:"POST",body:JSON.stringify({portal:"shop"}),credentials:"include"})}catch{}},restoreSession:async()=>{const t=await z();return await Z(),t},me:Z,updateMe:t=>g("/api/auth/me/",{method:"PATCH",body:JSON.stringify(t)}),changePassword:(t,e)=>g("/api/auth/me/",{method:"PATCH",body:JSON.stringify({password:e,old_password:t})}),changeEmail:(t,e)=>g("/api/shop-portal/change-email/",{method:"POST",body:JSON.stringify({new_email:t,current_password:e})}),myProfile:()=>g("/api/shop-portal/profile/"),updateMyProfile:t=>g("/api/shop-portal/profile/",{method:"PATCH",body:JSON.stringify(t)}),myAddresses:()=>g("/api/shop-portal/delivery-locations/"),createAddress:t=>g("/api/shop-portal/delivery-locations/",{method:"POST",body:JSON.stringify(t)}),updateAddress:(t,e)=>g(`/api/shop-portal/delivery-locations/${t}/`,{method:"PATCH",body:JSON.stringify(e)}),deleteAddress:t=>g(`/api/shop-portal/delivery-locations/${t}/`,{method:"DELETE"}),passwordResetRequest:t=>i("/api/auth/password-reset/",{method:"POST",body:JSON.stringify({email:t})}),passwordResetConfirm:(t,e,n)=>i("/api/auth/password-reset/confirm/",{method:"POST",body:JSON.stringify({uid:t,token:e,new_password:n})}),brands:()=>g("/api/products/brands/"),myOrders:()=>X("/api/shop-portal/orders/","api.myOrders"),myOrder:t=>g(`/api/shop-portal/orders/${t}/`),cancelOrder:t=>g(`/api/shop-portal/orders/${t}/cancel/`,{method:"POST"}),myReturns:t=>X(`/api/shop-portal/returns/${t?`?order=${encodeURIComponent(t)}`:""}`,"api.myReturns"),createReturn:t=>g("/api/shop-portal/returns/",{method:"POST",body:JSON.stringify(t)}),withdrawReturn:t=>g(`/api/shop-portal/returns/${t}/cancel/`,{method:"POST"}),uploadReturnPhoto:(t,e)=>{const n=new FormData;return n.append("claim_item",t),n.append("file",e),n.append("media_type",e.type.startsWith("video/")?"video":"image"),g("/api/shop-portal/return-media/",{method:"POST",body:n})}};import{media as Jt,absolutizeApiUrl as L}from"efficient-web-builder/render/lib/media";import{analyzeLogoSvg as Dt,isSvgUrl as xt}from"efficient-web-builder/format/lib/logo/reverse-svg";import{getEditorSiteId as Ht}from"efficient-web-builder/render/lib/editor-site";import{shopRouteBase as Ft,webRuntimeSiteSlug as Y}from"efficient-web-builder/format/lib/web-runtime";import{readDealerList as Mt}from"../sections/dealer-finder.js";import{SIGN_UP_PATH as Bt,SIGN_UP_VERIFY_PATH as qt,SIGN_UP_WAITING_PATH as Gt,WORKSPACE_FINDS_PATH as Wt,WORKSPACE_FIND_OPEN_PATH as jt,signInUrlOf as zt,readLinkAnswer as Q,readSignUpAvailability as Kt,readSignUpSent as Xt,signUpAvailabilityPath as Vt}from"../sections/sign-up.js";function S(t){if(typeof t=="string")return t.startsWith("/media/")?Jt(t):t;if(Array.isArray(t))return t.map(S);if(t&&typeof t=="object"){const e={};for(const[n,s]of Object.entries(t))e[n]=n==="captions"&&s&&typeof s=="object"&&!Array.isArray(s)?Object.fromEntries(Object.entries(s).map(([c,u])=>[S(c),u])):S(s);return e}return t}import{PRODUCT_API_BASE as Qe}from"./origins.js";const tt=typeof window>"u"&&H!=="",Zt=tt?H:pt,Yt=Ft,b=()=>({baseUrl:Yt(),audience:null});function d(t,e){const n=e?`?process=${encodeURIComponent(e)}`:"";return`/api/v1${t}${n}`}const et=100,at=50;function J(t,e,n){const s=new URLSearchParams;for(const[c,u]of Object.entries(e))u!=null&&u!==""&&s.set(c,String(u));return s.set("pageSize",String(et)),n&&s.set("cursor",n),`/api/v1${t}?${s.toString()}`}function Qt(t,e){return J("/wheels",{process:t},e)}const rt=et;function te(t,e){return J("/wheels",{slug:t.join(",")},e)}function ee(t,e,n){return J("/products",{kind:t.join(","),make:e?.make,model:e?.model,year:e?.year,modification:e?.modification},n)}function ae(t){if(!t)return null;try{return new URL(t,"http://cursor.invalid").searchParams.get("cursor")}catch{return null}}async function D(t,e,n=()=>!1,s=()=>!1){const c=[];let u=null;try{for(let y=0;y<at;y++){const a=await i(await e(u),await l());if(c.push(...m(a)),u=ae(a.next),!u)break;if(s(c))return c}u&&console.warn(`[${t}] stopped at ${at} pages (${c.length} rows); catalog may be truncated`)}catch(y){if(n(y))throw y;console.warn(`[${t}] product API unavailable, returning []`,y)}return c}const nt=t=>t instanceof w&&t.status===400;function st(t){return t.flatMap(e=>e.kind==="alloy-wheel"?U([e]):[e])}async function ot(){return(await re()).host}async function re(){try{const{headers:t}=await import("next/headers"),e=await t(),n=u=>u?.split(",")[0]?.split(":")[0]?.trim().toLowerCase()||null,s=n(e.get(lt)??e.get("x-forwarded-host")??e.get("host")),c=n(e.get("host"));return{host:s,matchesRequestHost:s!==null&&s===c}}catch{return{host:null,matchesRequestHost:!1}}}async function ne(){try{const{headers:t}=await import("next/headers");return gt((await t()).get(mt))}catch{return null}}async function se(){try{const{headers:t}=await import("next/headers");return(await t()).get(ut)||null}catch{return null}}async function oe(){const t=await se();if(t)return`site=${encodeURIComponent(t)}`;const e=await ot();return e?`host=${encodeURIComponent(e)}`:""}async function h(t){if(typeof window<"u"){const e=Y();return e?$(t,`site=${encodeURIComponent(e)}`):t}return $(t,await oe())}function $(t,e){return e?`${t}${t.includes("?")?"&":"?"}${e}`:t}const ie="preview";async function ce(){if(typeof window<"u")return null;try{const{headers:t}=await import("next/headers");return(await t()).get(dt)}catch{return null}}async function de(){try{const{headers:t}=await import("next/headers");return(await t()).get("user-agent")}catch{return null}}async function x(t,e){const n=await ce();if(n===null)return[await h(t),await l(e)];const s=$(await h(t),`${ie}=${encodeURIComponent(n)}`),{next:c,cache:u,...y}=e??{},a=await l({...y,cache:"no-store"}),r=await de();return r&&(a.headers={...a.headers,"user-agent":r}),[s,a]}async function le(t){if(!tt)return;const[e,n]=await Promise.all([ot(),ne()]),s=ht(e,n,t);return Object.keys(s).length>0?s:void 0}async function l(t){const e=await le(wt(t)),n={baseUrl:Zt,...t};return e&&(n.headers={...e,...t?.headers}),n}const R=typeof window>"u";function E(t,e){const n=new URLSearchParams;for(const[c,u]of Object.entries(e))u!==void 0&&u!==""&&n.set(c,String(u));const s=n.toString();return`/api/v1/fitment${t}${s?`?${s}`:""}`}const He={listMakes:async t=>{if(R){const{fitmentData:n}=await import("./fitment-data.js");return n.makes(t)}const e=await i(E("/makes",{region:t}),b());return m(e)},listModels:async(t,e)=>{if(R){const{fitmentData:s}=await import("./fitment-data.js");return s.models(t,e)}const n=await i(E("/models",{make:t,region:e}),b());return m(n)},listYears:async(t,e,n)=>{if(R){const{fitmentData:c}=await import("./fitment-data.js");return c.years(t,e,n)}const s=await i(E("/years",{make:t,model:e,region:n}),b());return m(s)},listModifications:async(t,e,n,s)=>{if(R){const{fitmentData:u}=await import("./fitment-data.js");return u.modifications(t,e,n,s)}const c=await i(E("/modifications",{make:t,model:e,year:n,region:s}),b());return m(c)},getStockFitment:async(t,e,n,s,c)=>{if(R){const{fitmentData:u}=await import("./fitment-data.js");return u.stockFitment(t,e,n,s,c)}return i(E("/stock-fitment",{make:t,model:e,year:n,modification:s,region:c}),b())}};function ue(t){if(!/^https?:\/\//i.test(t))return!1;const e=(y,a=y.protocol,r=y.port)=>`${a}//${y.hostname}:${r}`,n=y=>{if(!y)return null;try{return new URL(y)}catch{return null}},s=n(t);if(!s)return!1;const c=new Set,u=n(process.env.NEXT_PUBLIC_MEDIA_URL);u&&c.add(e(u,"https:",""));for(const y of[process.env.NEXT_PUBLIC_API_URL,yt()]){const a=n(y);a&&c.add(e(a))}for(const y of(process.env.ASSET_CDN_HOSTS??"").split(",").map(a=>a.trim()).filter(Boolean))c.add(`https://${y}:`);return c.has(e(s))}const Fe={listWheels:async(t,e={})=>{const n=await D("products.listWheels",async s=>await h(Qt(t,s)),e.throwOnFailure?()=>!0:void 0,e.maxRows===void 0?void 0:s=>U([...s]).length>=e.maxRows);return U(S(n))},listWheelsBySlug:async(t,e={})=>{const n=[...new Set(t.map(a=>a.trim()).filter(Boolean))];if(n.length===0)return[];const s=[];for(let a=0;a<n.length;a+=rt)s.push(n.slice(a,a+rt));const c=await Promise.all(s.map(a=>D("products.listWheelsBySlug",async r=>await h(te(a,r)),e.throwOnFailure?()=>!0:nt))),u=new Set(n),y=c.flat().filter(a=>u.has(a.slug));return U(S(y))},listCatalog:async(t,e,n={})=>{if(t.length===0)throw new Error("products.listCatalog() needs at least one kind. An empty list would omit `kind`, which the contract reads as `alloy-wheel` — so the call would silently return the wheel catalog instead of nothing.");const s=await D("products.listCatalog",async c=>await h(ee(t,e,c)),n.throwOnFailure?()=>!0:nt,n.maxRows===void 0?void 0:c=>st([...c]).length>=n.maxRows);return st(S(s))},getWheel:async t=>F(S(await i(await h(d(`/wheels/${t}`)),await l()))),getTyre:async t=>S(await i(await h(d(`/tyres/${t}`)),await l())),listBundles:async(t={})=>{try{return await i(await h(d("/bundles")),await l())}catch(e){if(t.throwOnFailure)throw e;return[]}},getBundle:async t=>i(await h(d(`/bundles/${t}`)),await l()),listGalleryBuilds:async(t={})=>{const{process:e=null,wheelSlug:n=null}=t;if(typeof window>"u"){const{listGalleryBuilds:s}=await import("./gallery-builds-data.js");return S(s(e,n))}try{const s=new URLSearchParams;e&&s.set("process",e),n&&s.set("wheelSlug",n);const c=s.toString(),u=await i(`/api/v1/gallery-builds${c?`?${c}`:""}`,b());return S(m(u))}catch(s){return console.warn("[products.listGalleryBuilds] product API unavailable, returning []",s),[]}},getSite:async()=>i(await h(d("/site")),await l()),getSiteBySlug:async t=>i(`${d("/site")}?${new URLSearchParams({site:t})}`,typeof window>"u"?await l():void 0),listPages:async()=>S(await i(await h(d("/pages")),await l())),listPopups:async()=>i(await h(d("/popups")),await l()),listProductTemplates:async()=>{try{return await i(await h(d("/product-templates")),await l())}catch(t){return console.warn("[products.listProductTemplates] unavailable, returning []",t),[]}},listDynamicPages:async t=>{const e=t?`?recordType=${encodeURIComponent(t)}`:"";try{return await i(await h(`${d("/dynamic-pages")}${e}`),await l())}catch(n){if(n instanceof w&&n.status===404)return[];throw n}},getRecord:async(t,e)=>{try{return await i(await h(d(`/records/${encodeURIComponent(t)}/${encodeURIComponent(e)}`)),await l())}catch(n){if(n instanceof w&&n.status===404)return null;throw n}},listRecordKeys:async t=>{try{const e=await i(await h(d(`/records/${encodeURIComponent(t)}`)),await l({cache:"no-store"}));return Array.isArray(e?.keys)?e.keys.filter(n=>typeof n=="string"&&n!==""):[]}catch(e){if(e instanceof w&&e.status===404)return[];throw e}},listProductTypeChoices:async()=>{try{return await i(await h(d("/product-type-choices")),await l())}catch(t){return console.warn("[products.listProductTypeChoices] unavailable, returning []",t),[]}},listFieldUsage:async()=>{try{return await i(await h(d("/field-usage")),await l())}catch(t){return console.warn("[products.listFieldUsage] unavailable, returning []",t),[]}},getPage:async(t,e={})=>{const n=e.record?`?record=${encodeURIComponent(e.record)}`:"",[s,c]=await x(d(`/pages/${t}`)+n,e.revalidate!==void 0?{next:{revalidate:e.revalidate}}:void 0);return S(await i(s,c))},listBlogPosts:async(t={},{throwOnFailure:e=!1}={})=>{const n=t.category?`?category=${encodeURIComponent(t.category)}`:"";try{return(await i(d("/blog-posts")+n,await l())).map(c=>({...c,coverImage:L(c.coverImage)??""}))}catch(s){if(e)throw s;return console.warn("[products.listBlogPosts] blog API unavailable, returning []",s),[]}},getBlogPost:async t=>{const e=await i(d(`/blog-posts/${t}`),await l());return{...e,coverImage:L(e.coverImage)??""}},createOrder:async t=>i(d("/orders"),await l({method:"POST",body:JSON.stringify(t)})),createOrderAuthed:async t=>g(d("/orders"),await l({method:"POST",body:JSON.stringify(t)})),lookupOrder:async t=>i(d("/orders/lookup"),await l({method:"POST",body:JSON.stringify(t)})),createPaymentIntent:async t=>i(d("/payments/intent"),await l({method:"POST",body:JSON.stringify(t)})),releaseCheckout:async t=>i(d("/checkouts/release"),await l({method:"POST",body:JSON.stringify(t)})),createPaypalOrder:async t=>i(d("/payments/paypal/order"),await l({method:"POST",body:JSON.stringify(t)})),capturePaypalOrder:async t=>i(d("/payments/paypal/capture"),await l({method:"POST",body:JSON.stringify(t)})),createAfterpayCheckout:async t=>i(d("/payments/afterpay/checkout"),await l({method:"POST",body:JSON.stringify(t)})),captureAfterpayPayment:async t=>i(d("/payments/afterpay/capture"),await l({method:"POST",body:JSON.stringify(t)})),chargeSquare:async t=>i(d("/payments/square/charge"),await l({method:"POST",body:JSON.stringify(t)})),createGocardlessBillingRequest:async t=>i(d("/payments/gocardless/billing-request"),await l({method:"POST",body:JSON.stringify(t)})),completeGocardlessPayment:async t=>i(d("/payments/gocardless/complete"),await l({method:"POST",body:JSON.stringify(t)})),createZipCheckout:async t=>i(d("/payments/zip/checkout"),await l({method:"POST",body:JSON.stringify(t)})),captureZipPayment:async t=>i(d("/payments/zip/capture"),await l({method:"POST",body:JSON.stringify(t)})),createKlarnaCheckout:async t=>i(d("/payments/klarna/checkout"),await l({method:"POST",body:JSON.stringify(t)})),captureKlarnaPayment:async t=>i(d("/payments/klarna/capture"),await l({method:"POST",body:JSON.stringify(t)})),createStockAlert:async t=>i(d("/stock-alerts"),await l({method:"POST",body:JSON.stringify(t)})),createPreOrderIntent:async t=>i(d("/pre-order-intents"),await l({method:"POST",body:JSON.stringify(t)})),createNewsletterSubscription:async t=>i(d("/newsletter-subscriptions"),await l({method:"POST",body:JSON.stringify(t)})),unsubscribeNewsletter:async t=>i(d("/newsletter-unsubscribe"),await l({method:"POST",body:JSON.stringify(t)})),captureCart:async t=>i(d("/carts"),await l({method:"POST",body:JSON.stringify(t)})),restoreCart:async t=>i(d("/carts/restore"),await l({method:"POST",body:JSON.stringify(t)})),unsubscribeCartReminders:async t=>i(d("/carts/unsubscribe"),await l({method:"POST",body:JSON.stringify(t)})),listReviews:async(t={})=>{const e=new URLSearchParams;t.limit&&e.set("limit",String(t.limit)),t.designCode&&e.set("designCode",t.designCode);const n=d("/reviews"),s=e.toString();try{return await i(await h(s?`${n}?${s}`:n),await l())}catch(c){return console.warn("[products.listReviews] product API unavailable, returning []",c),[]}},submitReview:async t=>i(d("/reviews"),await l({method:"POST",body:JSON.stringify(t)})),getForm:async t=>i(d(`/forms/${encodeURIComponent(t)}`),await l()),submitForm:async(t,e)=>i(d(`/forms/${encodeURIComponent(t)}/submissions`),await l({method:"POST",body:JSON.stringify(e)})),listShippingMethods:async()=>{try{return await i(d("/shipping-methods"),await l())}catch(t){return console.warn("[products.listShippingMethods] product API unavailable, returning []",t),[]}},listCountrySubdivisions:async t=>{try{return await i(d(`/countries/${encodeURIComponent(t)}/subdivisions`),await l())}catch(e){return console.warn("[products.listCountrySubdivisions] unavailable, returning []",e),[]}},quoteCart:async t=>{const e=d("/cart/quote"),n=await l({method:"POST",body:JSON.stringify(t)});return t.couponCode?(await V(e,n)).data:i(e,n)},validateCoupon:async t=>{const{data:e,asShopper:n}=await V(d("/coupons/validate"),await l({method:"POST",body:JSON.stringify(t)}));return{...e,askedAsShopper:n}},getHeaderSettings:async()=>{const t=M({method:"GET"}),e=await i(...await x(d("/header-settings"),{signal:t})),n=L(e.logoUrl);let s=null,c=null;if(n&&xt(n)&&ue(n)){const u=await Dt(n,t);u&&(s=u.reversed,c=u.inkIsDark)}return{...e,logoUrl:n,logoReversed:s,logoInkIsDark:c}},getThemeSettings:async()=>i(...await x(d("/theme-settings"))),getChatSettings:async()=>i(await h(d("/chat-settings")),await l())},Me={listServices:async()=>{try{return await i(d("/bookings/services"),await l())}catch(t){return console.warn("[bookings.listServices] API unavailable, returning []",t),{results:[],currency:"USD"}}},getAvailability:async(t,e)=>i(d(`/bookings/availability?service=${encodeURIComponent(t)}&date=${e}`),await l()),create:async t=>i(d("/bookings"),await l({method:"POST",body:JSON.stringify(t)})),get:async t=>i(d(`/bookings/manage/${encodeURIComponent(t)}`),await l()),cancel:async t=>i(d(`/bookings/manage/${encodeURIComponent(t)}/cancel`),await l({method:"POST"})),reschedule:async(t,e)=>i(d(`/bookings/manage/${encodeURIComponent(t)}/reschedule`),await l({method:"POST",body:JSON.stringify({startAt:e})})),createPaymentIntent:async t=>i(d("/bookings/payments/intent"),await l({method:"POST",body:JSON.stringify({manageToken:t})}))};class pe extends Error{slug;count;constructor(e,n){super(`Slug "${e}" exists on ${n} websites; a site is required to pick one.`),this.slug=e,this.count=n,this.name="AmbiguousPageSlugError"}}const C=(t,e,n)=>{const s=new URLSearchParams({...e?{site:e}:{},...n?{draft:"1"}:{}}).toString();return`/api/storefront/${t}/${s?`?${s}`:""}`},N=t=>`/api/storefront/sites/${encodeURIComponent(t)}/`,ye=t=>`${N(t)}currencies/`,fe="/api/storefront/media/ingest/";class he extends Error{constructor(){super("This editor is not connected to a website, so an upload has nowhere to go. Open the page from the website the file should belong to, then try again."),this.name="MediaUploadDestinationError"}}function ge(){const t=Ht();if(!t)throw new he;return`${fe}?${new URLSearchParams({site:t})}`}const me="X-Puck-Media-Manifest",it=St.contentHash,I={"X-Media-Manifest":it,[me]:it},Be=ct({});function ct(t){return(e,n={})=>{const s=Ct(),c=t.headers||s?{...s?{"Accept-Language":s}:{},...t.headers,...n.headers}:void 0;return i(e,{...n,...t.baseUrl!==void 0?{baseUrl:t.baseUrl}:{},...c?{headers:c}:{},audience:t.audience??Ut()})}}function we(t={}){const e=ct(t),n=t.siteDrafts===!0,s=a=>C("header-settings",a,n),c=a=>C("theme-settings",a,n),u=a=>C("chat-settings",a,n),y=a=>C("social-settings",a,n);return{findPageBySlug:async(a,r,o)=>{const p=new URLSearchParams({slug:a});o&&p.set("site",o);const f=await e(`/api/storefront/pages/?${p.toString()}`,{token:r}),P=m(f);if(!o&&P.length>1)throw new pe(a,P.length);return P[0]??null},getPageById:(a,r)=>e(`/api/storefront/pages/${a}/`,{token:r}),saveLayout:(a,r,o,p,f)=>e(`/api/storefront/pages/${a}/`,{method:"PATCH",body:JSON.stringify({layout:r,expected_updated_at:p,...f?{client_id:f}:{}}),token:o}),duplicatePage:(a,r,o)=>e(`/api/storefront/pages/${a}/duplicate/`,{method:"POST",body:JSON.stringify({title:r.title,slug:r.slug}),token:o}),geocode:(a,r,o)=>e(`/api/storefront/geocode/?${new URLSearchParams(o?{q:a,country:o}:{q:a})}`,{token:r}),listBlockSources:a=>e("/api/storefront/block-sources/",{token:a}),listRecordTypes:a=>e("/api/storefront/record-types/",{token:a}),createPagePreviewLink:(a,r)=>e(`/api/storefront/pages/${a}/preview-link/`,{method:"POST",token:r}),claimPageEditLock:(a,r,o,p=!1)=>e(`/api/storefront/pages/${a}/edit-lock/`,{method:"POST",body:JSON.stringify({client_id:o,takeover:p}),token:r}),releasePageEditLock:(a,r)=>e(`/api/storefront/pages/${a}/edit-lock/`,{method:"DELETE",token:r}),createTemplate:(a,r,o)=>e("/api/storefront/page-templates/",{method:"POST",body:JSON.stringify({name:a,layout:r}),headers:I,token:o}),getTemplate:(a,r)=>e(`/api/storefront/page-templates/${a}/`,{token:r}),saveTemplateLayout:(a,r,o)=>e(`/api/storefront/page-templates/${a}/`,{method:"PATCH",body:JSON.stringify({layout:r}),headers:I,token:o}),listTemplatePages:async(a,r)=>{const o=await e(`/api/storefront/template-pages/?template=${encodeURIComponent(a)}`,{token:r});return m(o)},getPageLibrary:async a=>{const r=await e("/api/storefront/page-templates/?is_page_library=true&is_active=true",{token:a});return m(r)[0]??null},getTemplateLibrary:(a,r)=>e(`/api/storefront/pages/template-library/?site=${encodeURIComponent(a)}`,{token:r}),createPageFromTemplate:(a,r)=>e(`/api/storefront/pages/from-template/${n?"?draft=1":""}`,{method:"POST",body:JSON.stringify(a),token:r}),findTemplatePageBySlug:async(a,r,o)=>{const p=await e(`/api/storefront/template-pages/?template=${encodeURIComponent(a)}&slug=${encodeURIComponent(r)}`,{token:o});return m(p)[0]??null},createTemplatePage:(a,r,o)=>e("/api/storefront/template-pages/",{method:"POST",body:JSON.stringify({template:a,...r}),headers:I,token:o}),saveTemplatePageLayout:(a,r,o)=>e(`/api/storefront/template-pages/${a}/`,{method:"PATCH",body:JSON.stringify({layout:r}),headers:I,token:o}),deleteTemplatePage:(a,r,o)=>e(`/api/storefront/template-pages/${a}/`,{method:"DELETE",token:r,...o?.keepalive?{keepalive:!0}:{}}),listPages:async(a,r)=>{const o=new URLSearchParams({no_page:"true"});r&&o.set("site",r);const p=await e(`/api/storefront/pages/?${o.toString()}`,{token:a});return m(p)},createPage:(a,r,o,p)=>e("/api/storefront/pages/",{method:"POST",body:JSON.stringify({title:a,slug:r,layout:o}),token:p}),deletePage:(a,r)=>e(`/api/storefront/pages/${a}/`,{method:"DELETE",token:r}),getHeaderSettings:(a,r)=>e(s(r),{token:a}),listMenus:async(a,r)=>{const o=new URLSearchParams({no_page:"true"});r&&o.set("site",r);const p=await e(`/api/storefront/menus/?${o}`,{token:a});return m(p)},listBlogPosts:async(a,r={})=>{const o=new URLSearchParams({no_page:"true"});r.visibleOnly&&o.set("is_visible","true"),r.siteId&&o.set("site",r.siteId);const p=await e(`/api/storefront/blog-posts/?${o.toString()}`,{token:a});return m(p)},listFieldUsage:async(a,r)=>{const o=await e(`/api/storefront/field-usage/?site=${encodeURIComponent(r)}`,{token:a});return Array.isArray(o?.entries)?o.entries:[]},listCategories:async(a,r={})=>{const o=new URLSearchParams({no_page:"true"});r.visibleOnly&&o.set("is_visible","true"),r.siteId&&o.set("site",r.siteId);const p=await e(`/api/storefront/categories/?${o.toString()}`,{token:a});return[...m(p)].sort((P,_)=>P.sort_order-_.sort_order||P.name.localeCompare(_.name))},listForms:async(a,r={})=>{const o=new URLSearchParams({no_page:"true"});r.siteId&&o.set("site",r.siteId);const p=await e(`/api/storefront/forms/?${o.toString()}`,{token:a});return[...m(p)].sort((P,_)=>P.title.localeCompare(_.title))},listWheelSummaries:async(a,r={})=>{const o=new URLSearchParams;r.siteId&&o.set("site",r.siteId);const p=o.toString(),f=await e(`/api/storefront/wheel-curations/summaries/${p?`?${p}`:""}`,{token:a});return S(f)},listProducts:async(a,r={})=>{const o=new URLSearchParams;r.kinds?.length&&o.set("kind",r.kinds.join(",")),r.siteId&&o.set("site",r.siteId);const p=o.toString(),f=await e(`/api/storefront/products/${p?`?${p}`:""}`,{token:a});return S(f)},getWheelDetail:async(a,r,o={})=>{const p=new URLSearchParams({slug:r});return o.siteId&&p.set("site",o.siteId),F(S(await e(`/api/storefront/wheel-curations/detail/?${p.toString()}`,{token:a})))},updateHeaderSettings:(a,r,o)=>e(s(o),{method:"PATCH",body:JSON.stringify(a),token:r}),getSite:(a,r)=>e(N(a),{token:r}),listSites:async a=>{const r=await e("/api/storefront/sites/?no_page=true",{token:a});return m(r)},listSiteCurrencies:async(a,r)=>{const o=await e(ye(a),{token:r});return Array.isArray(o)?o:[]},publishSite:(a,r)=>e(`${N(a)}publish/`,{method:"POST",token:r}),getSiteLiveState:(a,r)=>e(`${N(a)}live-state/`,{token:r}),getThemeSettings:(a,r)=>e(c(r),{token:a}),updateThemeSettings:(a,r,o)=>e(c(o),{method:"PATCH",body:JSON.stringify(a),token:r}),getMyPreferences:async a=>(await e("/api/auth/me/",{token:a})).preferences??{},updateMyPreferences:(a,r)=>e("/api/auth/me/",{method:"PATCH",body:JSON.stringify({preferences:a}),token:r}),getChatSettings:(a,r)=>e(u(r),{token:a}),updateChatSettings:(a,r,o)=>e(u(o),{method:"PATCH",body:JSON.stringify(a),token:r}),getSocialSettings:(a,r)=>e(y(r),{token:a}),updateSocialSettings:(a,r,o)=>e(y(o),{method:"PATCH",body:JSON.stringify(a),token:r}),uploadHeaderLogo:(a,r,o)=>{const p=new FormData;return p.append("logo",a),e(s(o),{method:"PATCH",body:p,token:r})},clearHeaderLogo:(a,r)=>e(s(r),{method:"PATCH",body:JSON.stringify({logo:null}),token:a}),setHeaderLogoFromAsset:(a,r,o)=>e(s(o),{method:"PATCH",body:JSON.stringify({logo_asset_id:a}),token:r}),uploadMedia:async(a,r)=>{const o=new FormData;return o.append("file",a),e(ge(),{method:"POST",body:o,token:r})},listMedia:async(a,r)=>{const o=new URLSearchParams({no_page:"true"});r&&o.set("kind",r);const p=await e(`/api/storefront/media-assets/?${o.toString()}`,{token:a});return m(p)}}}const qe=we({siteDrafts:!0});function Se(t){const e=t.trim();return e?`/api/v1/dealers?${new URLSearchParams({near:e}).toString()}`:"/api/v1/dealers"}async function Ge(t){return Mt(await i(Se(t)))}const T={audience:null,baseUrl:""};async function We(t,e){return Kt(await i(Vt(t,e),T))}async function je(t){return Xt(await i(Bt,{...T,method:"POST",body:JSON.stringify(t)}))}async function ze(t){try{const e=await i(qt,{...T,method:"POST",body:JSON.stringify({token:t})});return Q(202,e)}catch(e){if(e instanceof w)return Q(e.status,e.data);throw e}}async function Ke(t,e){await i(Gt,{...T,method:"POST",body:JSON.stringify({email:e.trim(),...t?{product:t}:{}})})}async function Xe(t,e){await i(Wt,{...T,method:"POST",body:JSON.stringify({email:e.trim(),...t?{product:t}:{}})})}async function Ve(t){try{return zt(await i(jt,{...T,method:"POST",body:JSON.stringify({token:t})}))}catch(e){if(e instanceof w&&Pe.has(e.status))return"";throw e}}const Pe=new Set([400,404,410]);export{Ot as API_URL,pe as AmbiguousPageSlugError,w as ApiError,Rt as BROWSER_READ_TIMEOUT_MS,Tt as EFFICIENT_CLIENT_CLOSED_MESSAGE,he as MediaUploadDestinationError,ie as PREVIEW_PARAM,Qe as PRODUCT_API_BASE,At as SERVER_READ_TIMEOUT_MS,v as SERVER_UNREACHABLE_MESSAGE,k as STATUS_NETWORK_ERROR,Be as adminFetch,Lt as api,i as apiFetch,$ as appendSiteQuery,Xe as askForWorkspaces,je as askToSignUp,Me as bookings,we as createStorefrontAdmin,Se as dealersPath,M as defaultRequestDeadline,ge as editorMediaUploadPath,Ut as editorPortalAudience,Ct as editorRequestLanguage,Ge as fetchDealers,We as fetchSignUpAvailability,He as fitment,Ke as joinSignUpWaitingList,ze as openSignUpLink,Ve as openWorkspaceFind,Fe as products,Et as readDeadlineMs,ne as resolveClientIp,S as resolveMediaUrls,ce as resolvePreviewToken,ot as resolveSiteHost,re as resolveSiteHostSource,se as resolveSiteSlug,Ie as setEditorLanguage,Ne as setEditorPortalAudience,qe as storefrontAdmin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const o=process.env.NEXT_PUBLIC_PRODUCT_API_URL??"",e=()=>(process.env.PRODUCT_BACKEND_URL??"").replace(/\/+$/,""),_=e();export{o as PRODUCT_API_BASE,_ as PRODUCT_BACKEND_URL,e as productBackendUrlNow};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const BUY_BUTTON_LOOK_PROP = "buttonLook";
|
|
2
|
+
export declare const BUY_BUTTON_LOOKS: readonly ["capitals", "solid"];
|
|
3
|
+
export type BuyButtonLook = (typeof BUY_BUTTON_LOOKS)[number];
|
|
4
|
+
export declare const DEFAULT_BUY_BUTTON_LOOK: BuyButtonLook;
|
|
5
|
+
export declare const parseBuyButtonLook: (v: unknown) => BuyButtonLook;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{parseOption as t}from"efficient-shell/format";const r="buttonLook",O=["capitals","solid"],p="capitals",B=o=>t(O,p,o);export{O as BUY_BUTTON_LOOKS,r as BUY_BUTTON_LOOK_PROP,p as DEFAULT_BUY_BUTTON_LOOK,B as parseBuyButtonLook};
|
|
@@ -25,4 +25,17 @@ export interface HeroOptionRow {
|
|
|
25
25
|
export declare const HERO_OPTION_ALLOW: readonly ["Text", "Flex"];
|
|
26
26
|
export declare function heroOptionSeed(nodeId: string): SeededNode[];
|
|
27
27
|
export declare function withHeroOptionTemplate(props: Props): Props;
|
|
28
|
+
export declare const HERO_TILE_SLOT = "tileTemplate";
|
|
29
|
+
export declare const HERO_TILE_SLOT_LABEL = "Tile template";
|
|
30
|
+
export declare const HERO_TILE_FIELDS: readonly [{
|
|
31
|
+
readonly key: "swatch";
|
|
32
|
+
readonly label: "Finish colour";
|
|
33
|
+
readonly kind: "colour";
|
|
34
|
+
}, {
|
|
35
|
+
readonly key: "name";
|
|
36
|
+
readonly label: "Finish name";
|
|
37
|
+
}];
|
|
38
|
+
export declare const HERO_TILE_ALLOW: readonly ["Text", "Flex"];
|
|
39
|
+
export declare function heroTileSeed(nodeId: string): SeededNode[];
|
|
40
|
+
export declare function withHeroTileTemplate(props: Props): Props;
|
|
28
41
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{BOX_SWATCH_PROP as
|
|
1
|
+
import{BOX_SWATCH_PROP as i}from"efficient-web-builder/format/lib/content/box-background";import{BOX_HIDE_WHEN_ROW_EMPTY as s}from"efficient-web-builder/format/lib/content/card-template";import{BOX_TYPE as o,CONTAINER_BLOCKS_SLOT as t}from"efficient-web-builder/format/lib/document/container-blocks";import{rowFieldTextSeed as r}from"efficient-web-builder/format/lib/document/blocks/general/Cards/card-seed";import{BOX as a,DIM as E,INNER_BOX as l,TEXT as O,boxPadding as n,labelStyle as L,seedNodes as c}from"efficient-web-builder/format/lib/document/seed-parts";import{roundBox as S,squareBox as w}from"./square-box.js";import{PRODUCT_HERO_TYPE as m}from"../document/document-nodes.js";import{slotSeedIds as T,withSeededSlot as _}from"./seed-ids.js";const x="optionTemplate",X="Option template",C=[{key:"swatch",label:"Finish colour",kind:"colour"},{key:"name",label:"Finish name"},{key:"label",label:"Option"},{key:"note",label:"Option note"}],I=["Text",o],p=(e,d,h={})=>({...L(e),letterSpacing:d,lineHeight:1.5,...h}),R={...a,direction:"row",align:"center",phoneRow:2,sharePhone:"content",wrapPhone:"nowrap"},u=()=>({type:o,props:{...a,direction:"column",name:"Option",...n(12,12),sectionBorder:{width:2}},slots:{[t]:[{type:o,props:{...R,name:"Finish",gap:12,gapPhone:12,[s]:["swatch"]},slots:{[t]:[{type:o,props:{...l,name:"Swatch"},slots:{[t]:[{type:o,props:{...S(20,{...n(0,0),sectionBorder:{width:1},[i]:"swatch"}),name:"Dot"}}]}},r("name",{...O,tag:"span",minWidth:0},p(12,.18,{weight:700}))]}},{type:o,props:{...l,name:"Words",gap:4,gapPhone:4,...n(0,4),[s]:["label"]},slots:{[t]:[r("label",{...O,tag:"span"},p(14,.18)),r("note",{...E,tag:"span"},p(11,.12))]}}]}});function H(e){return c([u()],T(e,"option"))}function Y(e){return _(e,x,m,H)}const P="tileTemplate",M="Tile template",q=[{key:"swatch",label:"Finish colour",kind:"colour"},{key:"name",label:"Finish name"}],K=I,y=40,B=()=>({type:o,props:{...w(y,{...n(0,0),sectionBorder:{width:1},[i]:"swatch"}),name:"Tile"}});function f(e){return c([B()],T(e,"tile"))}function U(e){return _(e,P,m,f)}export{I as HERO_OPTION_ALLOW,C as HERO_OPTION_FIELDS,x as HERO_OPTION_SLOT,X as HERO_OPTION_SLOT_LABEL,K as HERO_TILE_ALLOW,q as HERO_TILE_FIELDS,P as HERO_TILE_SLOT,M as HERO_TILE_SLOT_LABEL,H as heroOptionSeed,f as heroTileSeed,Y as withHeroOptionTemplate,U as withHeroTileTemplate};
|
|
@@ -5,4 +5,15 @@ export declare const DEFAULT_TITLE_LOOK: TitleLook;
|
|
|
5
5
|
export declare const parseTitleLook: (v: unknown) => TitleLook;
|
|
6
6
|
export declare const NAME_ACCENT_PROP = "accentLastWord";
|
|
7
7
|
export declare const EYEBROW_BADGE_PROP = "showBadge";
|
|
8
|
+
export declare const EYEBROW_SHOW_PROP = "show";
|
|
9
|
+
export declare const EYEBROW_SHOWS: readonly [{
|
|
10
|
+
readonly label: "Eyebrow words";
|
|
11
|
+
readonly value: "words";
|
|
12
|
+
}, {
|
|
13
|
+
readonly label: "Breadcrumb";
|
|
14
|
+
readonly value: "crumbs";
|
|
15
|
+
}];
|
|
16
|
+
export type EyebrowShow = (typeof EYEBROW_SHOWS)[number]["value"];
|
|
17
|
+
export declare const DEFAULT_EYEBROW_SHOW: EyebrowShow;
|
|
18
|
+
export declare const parseEyebrowShow: (v: unknown) => EyebrowShow;
|
|
8
19
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{parseOption as
|
|
1
|
+
import{parseOption as e}from"efficient-shell/format";const c="titleLook",r=["card","headline"],s="card",p=o=>e(r,s,o),_="accentLastWord",n="showBadge",L="show",E=[{label:"Eyebrow words",value:"words"},{label:"Breadcrumb",value:"crumbs"}],O="words",l=o=>e(E.map(t=>t.value),O,o);export{O as DEFAULT_EYEBROW_SHOW,s as DEFAULT_TITLE_LOOK,n as EYEBROW_BADGE_PROP,E as EYEBROW_SHOWS,L as EYEBROW_SHOW_PROP,_ as NAME_ACCENT_PROP,r as TITLE_LOOKS,c as TITLE_LOOK_PROP,l as parseEyebrowShow,p as parseTitleLook};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as a}from"react/jsx-runtime";import f from"../../../../../components/pdp-dynamic/FitmentTableBlock.js";import{TYRE_SIZES_HEAD as d}from"../../../../../components/TyreSizeGrid.js";import{hidableText as r}from"efficient-easel/screen/lib/document/hidable";import{parseSectionHeadPlacement as c}from"efficient-web-builder/format/lib/sections/section-head-placement";import{phHide as t,phHideDefault as m}from"efficient-web-builder/render/lib/document/blocks/scaffold";import{FitmentTableMeta as T,FITMENTTABLE_PH as i}from"./meta.js";import{padsItself as h}from"../../../pads-itself.js";const
|
|
1
|
+
import{jsx as a}from"react/jsx-runtime";import f from"../../../../../components/pdp-dynamic/FitmentTableBlock.js";import{TYRE_SIZES_HEAD as d}from"../../../../../components/TyreSizeGrid.js";import{hidableText as r}from"efficient-easel/screen/lib/document/hidable";import{parseSectionHeadPlacement as c}from"efficient-web-builder/format/lib/sections/section-head-placement";import{phHide as t,phHideDefault as m}from"efficient-web-builder/render/lib/document/blocks/scaffold";import{FitmentTableMeta as T,FITMENTTABLE_PH as i}from"./meta.js";import{padsItself as h}from"../../../pads-itself.js";const y=h("FitmentTable",{...T,render:e=>{const n=c(e.headPlacement)==="own-box",o=l=>n?void 0:l;return a(f,{dynamic:e.dynamic,wheel:e.wheel,num:o(t(e.num,i.num,e.editor)),title:o(t(e.title,i.title,e.editor)),description:o(t(e.description,i.description,e.editor)),tyreHead:n?void 0:{title:m(e.title,d.title,e.editor),description:m(e.description,d.description,e.editor)},omitHead:n,showFilter:e.showFilter,tooltipDefaultOn:e.tooltipDefaultOn,footnote:t(e.footnote,i.footnote,e.editor),footnoteLinkText:t(e.footnoteLinkText,i.footnoteLinkText,e.editor),footnoteLinkHref:r(e.footnoteLinkHref),editing:e.editor?.isEditing,template:e.template,headTemplate:e.headTemplate,nodeId:typeof e.id=="string"?e.id:void 0,hideEmptyColumns:e.showEmptyColumns===!1})}});export{y as FitmentTableRender};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
import{BUY_BUTTON_LOOK_PROP as t,DEFAULT_BUY_BUTTON_LOOK as o}from"../../../../content/buy-button-look.js";const u={label:"Buy button",defaultProps:{[t]:o},sitsInBox:!0};export{u as ProductBuyButtonMeta};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import e from"../../../../../components/card-pieces/CardBuyButton.js";import i from"../../../../../components/card-pieces/HostPart.js";import{BUY_BUTTON_LOOK_PROP as n,parseBuyButtonLook as u}from"../../../../content/buy-button-look.js";import{ProductBuyButtonMeta as r}from"./meta.js";const s={...r,render:o=>t(i,{label:r.label??"",editing:!!o.editor?.isEditing,onHero:!0,children:t(e,{look:u(o[n])})})};export{s as ProductBuyButtonRender};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{Fragment as
|
|
1
|
+
"use client";import{Fragment as f,jsx as o,jsxs as p}from"react/jsx-runtime";import{withRMark as c}from"efficient-web-builder/render/components/RMark";import y from"../../../../../components/card-pieces/CardEyebrow.js";import{readPartStyles as h}from"efficient-web-builder/render/lib/document/part-styles";import w from"../../../../../components/card-pieces/HostPart.js";import{useHeroStateOrNull as E,useProductCardStateOrNull as g}from"../../../../../components/card-pieces/ProductCardState.js";import x from"../../../../../components/card-pieces/HeadlineEyebrow.js";import{MarkedLabel as u}from"../../../../../components/product-hero/hero-view.js";import{EYEBROW_BADGE_PROP as k,EYEBROW_SHOW_PROP as P,TITLE_LOOK_PROP as C,parseEyebrowShow as O,parseTitleLook as _}from"../../../../content/title-look.js";import R from"next/link";import{useGridCard as m}from"../../../../../components/GridCardTemplate.js";import{itemBrand as B,plpKindNoun as L}from"../../../../catalog/plp-item.js";import{productCardEyebrow as S,wheelCardEyebrow as H}from"../../../../../components/ProductCardEyebrow.js";import{keepForCard as N}from"../../../../content/field-usage.js";import{ProductEyebrowMeta as b}from"./meta.js";function T(r){const{fieldUsage:t,tyreFieldUsage:e,eyebrow:n}=m();if(r.kind==="tyre"){const a=(n.tyreBrand??n.brand)&&N(e)("brand")&&r.tyre.brand||null,s=n.kindLabel?L(["tyre"]).one:null;return S(s,a)}const l=r.kind==="wheel"?r.wheel:null,i=l&&n.brand?B(l):null,d={kindLabel:l?n.kindLabel:null,brand:i?c(i):null,process:l&&n.process&&l.process?c(l.process):null};return H(d,t)}function W({state:r,children:t}){return o(f,{children:t(T(r),null)})}const j="data-product-crumbs";function v({product:r}){const t=r.crumbs.slice(1,-1);return t.length===0?null:o("nav",{"aria-label":"Breadcrumb",[j]:"",className:"text-xs text-fg-dim",children:t.map((e,n)=>p("span",{children:[n>0&&" / ",e.href?o(R,{href:e.href,className:"hover:text-fg",children:o(u,{text:e.label})}):o(u,{text:e.label})]},`${e.label}-${n}`))})}function F({props:r,region:t}){const e=E(),n=g(),{reserveEyebrow:l}=m(),i=_(r[C])==="headline",d=(a,s)=>i?o(x,{eyebrow:a,badge:r[k]===!0?s:null,region:t}):o(y,{reserve:l,region:t,children:a});return e&&O(r[P])==="crumbs"?o(v,{product:e.product}):e?d(e.title.eyebrow?o(u,{text:e.title.eyebrow}):null,e.title.badge):n?o(W,{state:n,children:d}):null}const Z={...b,render:r=>{const t=!!r.editor?.isEditing;return o(w,{label:b.label??"",editing:t,onHero:!0,children:o(F,{props:r,region:{nodeId:typeof r.id=="string"?r.id:void 0,partStyles:h(r),editing:t}})})}};export{Z as ProductEyebrowRender};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{DEFAULT_HERO_GALLERY_MODE as
|
|
1
|
+
import{DEFAULT_HERO_GALLERY_GAP as _,DEFAULT_HERO_GALLERY_MARKS as E,DEFAULT_HERO_GALLERY_MODE as A,DEFAULT_HERO_GALLERY_SHOW as L,DEFAULT_HERO_IMAGE_FIT as r,DEFAULT_HERO_PHOTO_GROUND as T}from"../../../../sections/hero-gallery.js";import{DEFAULT_SPIN_AUTO_TURN as o,DEFAULT_SPIN_HINT as R}from"../../../../sections/spin-sets.js";const U={label:"Product Gallery",defaultProps:{galleryMode:A,imageFit:r,ground:T,spin:{},show:L,marks:E,gap:_,autoTurn:o,turnHint:R}};export{U as ProductGalleryMeta};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as a}from"react/jsx-runtime";import o from"../../../../../components/pdp-dynamic/DynamicProductGallery.js";import{parseHeroGalleryGap as t,parseHeroGalleryMarks as i,parseHeroGalleryMode as n,parseHeroGalleryShow as l,parseHeroImageFit as m,parseHeroPhotoGround as d}from"../../../../sections/hero-gallery.js";import{parseSpinSets as s,parseSpinSwitch as e}from"../../../../sections/spin-sets.js";import{ProductGalleryMeta as u}from"./meta.js";const f={...u,render:r=>a(o,{editing:r.editor?.isEditing,galleryMode:n(r.galleryMode),imageFit:m(r.imageFit),spin:s(r.spin),ground:d(r.ground),show:l(r.show),marks:i(r.marks),gap:t(r.gap),autoTurn:e(r.autoTurn),turnHint:e(r.turnHint)})};export{f as ProductGalleryRender};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{DEFAULT_HERO_PRICE_PLACEMENT as t}from"../../../../sections/hero-price-placement.js";import{DEFAULT_HERO_LAYOUT as e,DEFAULT_HERO_RATIO as r,DEFAULT_HERO_TEXT_ALIGN as
|
|
1
|
+
import{DEFAULT_HERO_PRICE_PLACEMENT as t}from"../../../../sections/hero-price-placement.js";import{DEFAULT_HERO_LAYOUT as e,DEFAULT_HERO_RATIO as r,DEFAULT_HERO_TEXT_ALIGN as E}from"../../../../sections/hero-arrangement.js";import{DEFAULT_HERO_GALLERY_MODE as _,DEFAULT_HERO_IMAGE_FIT as l}from"../../../../sections/hero-gallery.js";import{cardTemplateSlot as O}from"efficient-web-builder/format/lib/content/card-template";import{HERO_TEMPLATE_BLOCKS as L}from"../../../../content/hero-seed.js";import{HERO_OPTION_ALLOW as T,HERO_OPTION_SLOT as a,HERO_TILE_ALLOW as m,HERO_TILE_SLOT as R}from"../../../../content/hero-option-seed.js";import{HERO_BUY_ALLOW as i,HERO_BUY_SLOT as p}from"../../../../content/hero-buy-seed.js";import{PRODUCT_HERO_OWN as s}from"../../../../content/block-own-pads.js";const o=O(),A={template:{...o,allow:[...o.allow,...L]},[a]:{type:"slot",allow:[...T]},[R]:{type:"slot",allow:[...m]},[p]:{type:"slot",allow:[...i]}},F={ownPad:s,label:"Product Hero",fields:A,defaultProps:{source:null,pricePlacement:t,showVehicleFitment:!0,heroLayout:e,imageRatio:r,textAlign:E,showSpecTable:!0,stageToEdge:!1,showBreadcrumb:!0,showPriceQuote:!0,galleryMode:_,imageFit:l}};export{F as ProductHeroMeta,A as ProductHeroSlots};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as i}from"react/jsx-runtime";import{SITE_WIDTH_CAP as
|
|
1
|
+
import{jsx as i}from"react/jsx-runtime";import{SITE_WIDTH_CAP as k}from"efficient-web-builder/format/lib/content/page-width";import{resolveWidth as D}from"efficient-web-builder/format/lib/content/section-width";import A from"../../../../../components/LinkedProductHero.js";import a from"../../../../../components/pdp-dynamic/DynamicProductHero.js";import C from"../../../../../components/SectionNotice.js";import{HERO_OPTION_SLOT as n,HERO_TILE_SLOT as d}from"../../../../content/hero-option-seed.js";import{HERO_BUY_SLOT as f}from"../../../../content/hero-buy-seed.js";import{cardPressTitlesOf as w}from"efficient-web-builder/render/lib/document/card-press-titles";import{useCurrentProduct as I}from"../../../current-product.js";import{LINKED_HERO_RECORD_PROP as S,matchingLinkedRecord as U}from"../../../linked-hero-hydrate.js";import{isEditorOnDynamicPage as N}from"efficient-web-builder/format/lib/document/editor-page-context";import{DEFAULT_HERO_LAYOUT as b,DEFAULT_HERO_RATIO as x,DEFAULT_HERO_TEXT_ALIGN as F,parseHeroLayout as p,parseHeroRatio as B,parseHeroTextAlign as V}from"../../../../sections/hero-arrangement.js";import{parseHeroOptionLooks as W}from"../../../../sections/hero-option-looks.js";import{say as Y}from"efficient-web-builder/format/lib/editor-words";import{ProductHeroMeta as j}from"./meta.js";import{HideTaker as v}from"efficient-web-builder/render/components/ViewHideRoot";import{SplitPadScope as z}from"../../../../../components/SectionPadScope.js";import{PRODUCT_HERO_TYPE as G}from"../../../document-nodes.js";import{splitPads as K}from"../../../pads-itself.js";import{PRODUCT_HERO_INNER as M,PRODUCT_HERO_OWN as X}from"../../../../content/block-own-pads.js";function q({source:e,editing:t=!1,showVehicleFitment:o=!0,heroLayout:u=b,imageRatio:l=x,textAlign:c=F,showSpecTable:s=!0,stickyColumns:T=!1,stageToEdge:O=!1,showBreadcrumb:R=!0,nodeId:_,template:E,optionTemplate:h,optionPressTitles:H,tileTemplate:P,buyTemplate:g,optionLooks:L,linkedRecord:y}){const r={heroLayout:u,imageRatio:l,textAlign:c,showSpecTable:s,stickyColumns:T,stageToEdge:O,showBreadcrumb:R,nodeId:_,template:E,optionTemplate:h,optionPressTitles:H,tileTemplate:P,buyTemplate:g,optionLooks:L};if(I()||t&&N())return i(a,{editing:t,showVehicleFitment:o,...r});if(e?.slug){const m=e.kind??"wheel";return i(A,{slug:e.slug,kind:m,initialRecord:U(y,m,e.slug),editing:t,showVehicleFitment:o,...r})}return t?i(C,{size:"tall",children:Y("Pick a product in the panel to fill this hero.")}):i(a,{showVehicleFitment:o,...r})}function J(e,t){return D(e,"full").mode!=="page"?t:i(v,{as:"div",style:{"--sf-content-cap":k},children:t})}const he={...j,render:e=>J(e,i(z,{pads:K(G,e,{both:X},M),children:i(q,{source:e.source,editing:e.editor?.isEditing,showVehicleFitment:e.showVehicleFitment??!0,heroLayout:p(e.heroLayout),imageRatio:B(e.imageRatio),textAlign:V(e.textAlign),showSpecTable:e.showSpecTable??!0,stickyColumns:e.stickyColumns===!0,stageToEdge:e.stageToEdge===!0,showBreadcrumb:e.showBreadcrumb!==!1,nodeId:typeof e.id=="string"?e.id:void 0,template:typeof e.template=="function"?e.template:void 0,optionTemplate:typeof e[n]=="function"?e[n]:void 0,optionPressTitles:w(e,n),tileTemplate:typeof e[d]=="function"?e[d]:void 0,buyTemplate:typeof e[f]=="function"?e[f]:void 0,optionLooks:W(e),linkedRecord:e[S]})}))};export{he as ProductHeroRender};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as o,Fragment as n}from"react/jsx-runtime";import a,{PRICE_SHOWS as l,PRICE_WORDS as s,UNIT_WORDS as c}from"../../../../../components/card-pieces/CardPrice.js";import{useGridCard as t}from"../../../../../components/GridCardTemplate.js";import u from"../../../../../components/card-pieces/HostPart.js";import{readPartStyles as m}from"efficient-web-builder/render/lib/document/part-styles";import{HideTaker as f}from"efficient-web-builder/render/components/ViewHideRoot";import{ProductPriceMeta as d}from"./meta.js";function g({children:e}){return t().ownerId?o(f,{children:e}):o(n,{children:e})}function P({region:e,heroLook:i}){const{rules:r}=t();return o(a,{setTotal:r.setTotal,wasFollowsSize:r.wasFollowsSize,priceWord:i.priceWord,heroLook:i,region:e})}const v={...d,render:e=>{const i=!!e.editor?.isEditing;return o(u,{label:d.label??"",editing:i,onHero:!0,children:o(g,{children:o(P,{heroLook:{priceWord:s.find(r=>r===e.priceWord),unitWords:c.find(r=>r.value===e.unitWords)?.value,setBadge:e.setBadge!==!1,show:l.find(r=>r.value===e.show)?.value},region:{nodeId:typeof e.id=="string"?e.id:void 0,partStyles:m(e),editing:i}})})})}};export{v as ProductPriceRender};
|
|
@@ -1,2 +1,9 @@
|
|
|
1
1
|
import type { BlockRender } from "efficient-web-builder/format/lib/document/blocks/block-types";
|
|
2
|
+
export declare const SKU_SHOWS: readonly [{
|
|
3
|
+
readonly label: "SKU and part numbers";
|
|
4
|
+
readonly value: "sku";
|
|
5
|
+
}, {
|
|
6
|
+
readonly label: "Product code";
|
|
7
|
+
readonly value: "code";
|
|
8
|
+
}];
|
|
2
9
|
export declare const ProductSkuRender: BlockRender;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as r,jsxs as u}from"react/jsx-runtime";import{readPartStyles as a}from"efficient-web-builder/render/lib/document/part-styles";import{HideTaker as c}from"efficient-web-builder/render/components/ViewHideRoot";import m from"../../../../../components/card-pieces/HostPart.js";import{useHeroStateOrNull as g}from"../../../../../components/card-pieces/ProductCardState.js";import{RegionBridge as f,RegionWords as S,regionAttr as k}from"../../../../../components/card-pieces/card-text-region.js";import{ProductSkuMeta as s}from"./meta.js";const h="data-product-sku",d=[{label:"SKU and part numbers",value:"sku"},{label:"Product code",value:"code"}];function p({region:e,shows:t}){const n=g(),o=n?.sku??[],i=t==="code"?n?.designCode??null:null,l=o.length>0?o:i?[i]:[];return l.length===0?null:r(f,{region:e,sectionType:"ProductSku",children:u(c,{as:"p",[h]:"",className:"font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.18em] text-fg-dim",children:[t==="sku"?"SKU ":null,r("span",{...k(e,"sku"),children:r(S,{region:e,at:"sku",children:l.join(" / ")})})]})})}const K={...s,render:e=>{const t=!!e.editor?.isEditing;return r(m,{label:s.label??"",editing:t,onHero:!0,children:r(p,{shows:d.find(n=>n.value===e.show)?.value??d[0].value,region:{nodeId:typeof e.id=="string"?e.id:void 0,partStyles:a(e),editing:t}})})}};export{K as ProductSkuRender,d as SKU_SHOWS};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as i}from"react/jsx-runtime";import c,{PartSample as u}from"../../../../../components/card-pieces/HostPart.js";import{CardSpecFacts as f,CardSpecLine as l,SPEC_SHOWS as m}from"../../../../../components/card-pieces/CardSpecs.js";import{useGridCard as S}from"../../../../../components/GridCardTemplate.js";import{useHeroStateOrNull as a,useProductCardState as p}from"../../../../../components/card-pieces/ProductCardState.js";import{sizesOnlyLabel as g}from"../../../../wheels/size-range.js";import{ProductSpecsMeta as s}from"./meta.js";function z({show:e,editing:r}){const t=a()?.product,o=e==="sizes"&&t?.kind==="alloy-wheel"?g(t.source.sizes):null;return o?i(l,{oneLine:!0,children:o}):r?i(u,{label:s.label??""}):null}function h({sizes:e,show:r,editing:t}){return a()?i(z,{show:r,editing:t}):i(C,{sizes:e,show:r})}function C({sizes:e,show:r}){const{fieldUsage:t,tyreFieldUsage:o,fit:d}=S(),n=p().kind==="tyre";return i(l,{oneLine:r==="sizes"&&!n,children:i(f,{sizes:e,show:n?"all":r,fieldUsage:n?o:t,car:d})})}const E={...s,render:e=>i(c,{label:s.label??"",editing:!!e.editor?.isEditing,onHero:!0,children:i(h,{sizes:e.sizes===!0,show:m.find(r=>r.value===e.show)?.value??"all",editing:!!e.editor?.isEditing})})};export{E as ProductSpecsRender};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as g}from"react/jsx-runtime";import S from"../../../../../components/pdp-dynamic/DynamicSpecTable.js";import y from"../../../../../components/SpecTable.js";import{buildSpecSheet as E,buildLegacySpecSheet as R,dropSpecRows as w,hiddenSpecRows as o,hidesEmptySpecRows as b}from"../../../../wheels/spec-sheet.js";import{parseSectionHeadPlacement as L}from"efficient-web-builder/format/lib/sections/section-head-placement";import{phHide as n}from"efficient-web-builder/render/lib/document/blocks/scaffold";import{SpecTableMeta as T,SPECTABLE_PH as d}from"./meta.js";import{padsItself as x}from"../../../pads-itself.js";const _=x("SpecTable",{...T,render:e=>{const m=L(e.headPlacement)==="own-box",t=i=>m?void 0:i;if(e.dynamic)return g(S,{nodeId:typeof e.id=="string"?e.id:void 0,num:t(n(e.num,d.num,e.editor)),title:t(n(e.title,d.title,e.editor)),description:t(n(e.description,d.description,e.editor)),showDiagram:e.showDiagram!==!1,omitHead:m,editing:e.editor?.isEditing,template:e.template,showEuLabel:e.showEuLabel===!0,hideRows:o(e),hideEmptyRows:b(e)});const a=e.source??null,s=e.wheel,f=!a?.slug&&typeof s=="string"?s:"",u=typeof e.finish=="string"?e.finish:"",r=typeof e.size=="string"?e.size:"";let l,h=!0,c=null;if(a?.slug&&a.spec){const i=E(a,u,r);l=w(i.rows,o(e)),c=e.showDiagram===!1?null:i.diagram}else if(f){const i=R(f,u,r);l=w(i.rows,o(e)),c=e.showDiagram===!1?null:i.diagram}else l=e.rows??[],h=!1;return g(y,{capped:!1,nodeId:typeof e.id=="string"?e.id:void 0,num:t(n(e.num,d.num,e.editor)),title:t(n(e.title,d.title,e.editor)),description:t(n(e.description,d.description,e.editor)),rows:l,builtInLabels:h,diagram:c,omitHead:m,editing:e.editor?.isEditing,template:e.template,hideEmptyRows:b(e)})}});export{_ as SpecTableRender};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{CARD_LIST_TYPE as R,CARD_ROW_FIELD_PROP as y,CARD_ROW_LINK_PROP as m,CARD_TEMPLATE_SLOT as E,registerCardTemplates as Oe}from"efficient-web-builder/format/lib/content/card-template";import{DIM as d,INNER_BOX as o,LABEL_FACE as C,TEXT as n,boxPadding as r,fillSlot as H,labelLook as T,labelStyle as K,seedNodes as S,token as _}from"efficient-web-builder/format/lib/document/seed-parts";import{BOX_SHOW_KEY as M,BOX_SHOW_ON_CARD_HOVER as Y,HOVER_KEY as me,PICTURE_HOVER_KEYS as G}from"efficient-web-builder/format/lib/animation/hover";import{BOX_TYPE as a,CONTAINER_BLOCKS_SLOT as i}from"efficient-web-builder/format/lib/document/container-blocks";import{BOX_ROW_IMAGE_PROP as f}from"efficient-web-builder/format/lib/content/box-card-rule";import{POST_CARD_HEIGHT as be}from"efficient-web-builder/format/lib/post-card-layout";import{OVERLAY_INK_LIGHT as he}from"efficient-web-builder/format/lib/theme";import{EVENTS_FEATURED_DARKEN as ge,EVENTS_FEATURED_DARKEN_STYLE as x,EVENTS_FEATURED_PLACEMENT as Pe}from"../content/events-featured-look.js";import{COLLECTION_DARKEN as Re,COLLECTION_HOVER_DARKEN as ye,COLLECTION_HOVER_ZOOM as U}from"../content/collection-card-look.js";import{COLLECTION_CARD_REGIONS as b,COLLECTION_CARD_TEXT_SIZE as Ce}from"efficient-web-builder/format/lib/sections/collection-card-text-regions";import{SH_LINK as V}from"efficient-web-builder/render/lib/document/blocks/general/section-to-box-row-parts";import{rowFieldTextSeed as t}from"efficient-web-builder/format/lib/document/blocks/general/Cards/card-seed";import{withRelatedTabletColumns as k}from"../sections/product-grid-columns.js";import{bundleColumns as Se}from"../sections/bundle-to-grid.js";import{HERO_GALLERY_BLOCK as fe,withHeroTemplate as ke}from"../content/hero-seed.js";import{THANKS_SLOT as W,THANKS_SLOT_LABEL as v}from"../content/thanks-slot.js";import{HERO_BUY_SLOT as Ae,HERO_BUY_SLOT_LABEL as Ie,withHeroBuyTemplate as Ne}from"../content/hero-buy-seed.js";import{HERO_OPTION_FIELDS as $,HERO_OPTION_SLOT as ue,HERO_OPTION_SLOT_LABEL as De,withHeroOptionTemplate as we}from"../content/hero-option-seed.js";import{FILTER_OPTIONS_FIELD as Be,withFilterChipsTemplate as Fe,withFilterTemplate as He}from"../content/filter-card-seed.js";import{FACET_ROW_FIELDS as h,FACET_TEMPLATE_LABEL as X,FACET_TEMPLATE_SLOT as Z,withFacetTemplate as j}from"../content/facet-row-seed.js";import{RAIL_HEAD_TEMPLATE_LABEL as Ke,RAIL_HEAD_TEMPLATE_SLOT as Me,RAIL_ROW_FIELDS as A,RAIL_TEMPLATE_LABEL as Ye,RAIL_TEMPLATE_SLOT as Ge,withRailTemplates as z}from"../content/rail-row-seed.js";import{MENU_LINK_BLOCK as xe,withMenuTemplate as Ue}from"../content/menu-card-seed.js";import{CONTACT_CHANNEL_FIELDS as q,CONTACT_CHANNEL_SLOT as Ve,CONTACT_REASON_FIELDS as We,CONTACT_REASON_SLOT as ve,CONTACT_TOPIC_FIELDS as Q,CONTACT_TOPIC_SLOT as $e,withContactTemplates as Xe}from"../content/contact-card-seed.js";import{ARTICLE_BODY_BLOCK as Ze,withArticleBodyTemplate as je}from"efficient-web-builder/format/lib/document/article-body-seed";import{APPOINTMENT_BOOKING_TYPE as ze,BOOKING_BOX_TYPE as qe,BOOKING_OPTION_FIELDS as Qe,BOOKING_TEMPLATE_SLOTS as Je,withBookingTemplates as et}from"../content/booking-card-seed.js";import{PRODUCT_BUY_BLOCK as tt,PRODUCT_CARD_FIELDS as I,PRODUCT_COLOUR_BLOCK as lt,PRODUCT_EYEBROW_BLOCK as J,PRODUCT_NAME_BLOCK as ee,PRODUCT_PICTURE_BLOCK as ot,PRODUCT_PRICE_BLOCK as te,PRODUCT_SKU_BLOCK as at,PRODUCT_SIZE_BLOCK as it,PRODUCT_SPECS_BLOCK as nt,productCardSeed as rt,withKitCardTemplate as N,withListingCardTemplate as st,withProductCardTemplate as u}from"../content/product-card-seed.js";import{ALLOY_WHEELS_LISTING_TYPE as Et,FILTER_BLOCK_TYPE as _t,FILTER_CHIPS_TYPE as dt,MENU_BLOCK_TYPE as Tt,PRODUCT_GRID_TYPE as pt,PRODUCT_HERO_TYPE as ct}from"./document-nodes.js";import{withSeededSlot as D}from"../content/seed-ids.js";import{FITMENT_HEAD_FIELDS as le,FITMENT_HEAD_TEMPLATE_LABEL as Lt,FITMENT_HEAD_TEMPLATE_SLOT as Ot,FITMENT_ROW_FIELDS as oe,FITMENT_ROW_TEMPLATE_LABEL as mt,FITMENT_ROW_TEMPLATE_SLOT as bt}from"../content/fitment-row-seed.js";const ae="tags",p=T(12),ie={textStyle:"heading-3",..._("headingSmall",20),weight:500,lineHeight:1.2,letterSpacing:-.02},ne={textStyle:"body-1",..._("body",14),lineHeight:1.55},ht={...ie,..._("headingSmall",30)},gt={sectionPaddingTop:24,sectionPaddingRight:28,sectionPaddingBottom:32,sectionPaddingLeft:28,sectionPaddingTopPhone:24,sectionPaddingRightPhone:28,sectionPaddingBottomPhone:32,sectionPaddingLeftPhone:28},Pt=be.fallback,Rt=480,yt=70,Ct=()=>({type:a,props:{...o,name:"Featured",[f]:"cover",darken:ge,darkenStyle:x,darkenPhone:yt,darkenStylePhone:x,placement:Pe,direction:"column",gap:8,gapPhone:8,...r(32,32,20,20),sectionHeightMode:"fixed",sectionHeightValue:Pt,sectionHeightUnit:"px",sectionHeightModePhone:"fixed",sectionHeightValuePhone:Rt,sectionHeightUnitPhone:"px",[m]:"href"},slots:{[i]:[t("meta",{...n,tag:"p"},p,!0),t("title",{...n,tag:"h3",widthFit:"fill"},ht),t("excerpt",{...d,tag:"p",widthFit:"fill",maxWidth:384},ne),t("dateLabel",{...d,tag:"p"},{...p,color:"muted"})]}}),St=()=>({type:a,props:{...o,name:"Post",gap:0,gapPhone:0,...r(0,0,0,0),...H("surface"),shadow:!0},slots:{[i]:[{type:"ImageBlock",props:{[y]:"cover",aspect:"16/10",contained:!1}},{type:a,props:{...o,name:"Words",gap:12,gapPhone:12,...gt},slots:{[i]:[{type:a,props:{...o,name:"Meta",direction:"row",wrap:!0,share:"content",sharePhone:"content",phoneRow:2,gap:12,gapPhone:12,...r(0,0,0,0)},slots:{[i]:[t("meta",{...n,tag:"p"},p,!0),t("dateLabel",{...d,tag:"p"},{...p,color:"muted"},!0)]}},t("title",{...n,tag:"h3",widthFit:"fill"},ie),t("excerpt",{...d,tag:"p",widthFit:"fill"},ne),{type:R,props:{[y]:ae},slots:{template:[{type:a,props:{...o,name:"Chip",...r(4,8,4,8),sectionBorder:{width:1}},slots:{[i]:[t("label",{...d,tag:"p"},p)]}}]}},{type:"ButtonBlock",props:{variant:"ghost",label:"Read more",href:"",[m]:"href",...V,icon:"arrow-right",iconPosition:"after",_partStyles:{label:K(12)}}}]}}]}}),ft=()=>[Ct(),St()];function kt(e){const l=["featured","post"];return D(e,E,"Events",O=>S(ft(),(s,Le)=>{const[w,...B]=Le.split("."),F=l[Number(w)]??`card${w}`;return B.length?`${O}~${F}.${B.join(".")}`:`${O}~${F}`}))}const At={fields:[{key:"cover",label:"Cover",kind:"image",alt:"title"},{key:"meta",label:"Eyebrow"},{key:"dateLabel",label:"Date"},{key:"title",label:"Title"},{key:"excerpt",label:"Excerpt",multiline:!0},{key:"href",label:"Link",kind:"link"},{key:ae,label:"Tags",kind:"list",fields:[{key:"label",label:"Tag"}]}],blocks:[{type:R,label:"Card list"}],seedOnInsert:kt},c=e=>Number(/(\d+)px/.exec(e)?.[1]),L={tag:c(b.tag.builtIn),name:c(b.name.builtIn),namePhone:c(Ce.namePhone),body:c(b.body.builtIn),link:c(b.link.builtIn)},It={...T(L.tag),letterSpacing:.25},Nt={textStyle:"heading-2",..._("headingMedium",L.name,L.namePhone),weight:500,lineHeight:1,letterSpacing:-.03},ut={textStyle:"body-1",..._("body",L.body),lineHeight:1.5,paragraphSpacing:12},re=()=>[t("tag",{...n,tag:"p"},It,!0),t("name",{...n,tag:"h3",widthFit:"fill"},Nt),t("desc",{...n,tag:"p",widthFit:"fill",maxWidth:420},ut),{type:"ButtonBlock",props:{variant:"ghost",label:"Explore",href:"",[m]:"href",...V,icon:"arrow-right",iconPosition:"after",_partStyles:{label:K(L.link)}}}],se={_hidden:!0,_hiddenTablet:!0,_hiddenPhone:!1},Dt=()=>({type:a,props:{...o,name:"Collection",gap:0,gapPhone:0,...r(0,0,0,0),[m]:"href"},slots:{[i]:[{type:a,props:{...o,name:"Picture",[f]:"image",boxShape:"portrait",darken:Re,placement:"bottom-left",direction:"column",gap:12,gapPhone:12,...r(32,32),hoverZoom:U,hoverDarken:ye,_hiddenPhone:!0},slots:{[i]:re()}},{type:"ImageBlock",props:{[y]:"image",aspect:"4/5",contained:!1,hoverZoom:U,...se}},{type:a,props:{...o,name:"Words",gap:12,gapPhone:12,...r(24,24),...H("surface"),...se},slots:{[i]:re()}}]}});function wt(e){return D(e,E,"Collections",l=>S([Dt()],(O,s)=>`${l}~card${s?`.${s}`:""}`))}const Bt={fields:[{key:"tag",label:"Eyebrow"},{key:"name",label:"Title"},{key:"desc",label:"Description",multiline:!0},{key:"image",label:"Image",kind:"image",alt:"name"},{key:"href",label:"Link",kind:"link"}],seedOnInsert:wt},Ft=35,Ht=50,Kt=106,Mt=85,Yt="nextImage",Gt=he,Ee="#c4c1ba",_e={...C,...T(11),letterSpacing:.24,color:"main"},xt={..._e,color:Ee},Ut={...C,...T(12,11),color:"main"},Vt={textStyle:"heading-3",..._("headingSmall",22,16),weight:500,lineHeight:1.05,letterSpacing:-.02,color:Gt},Wt={...C,...T(12),letterSpacing:.12,color:Ee},g=r(0,0,0,0),vt=()=>({type:a,props:{...o,name:"Tile",placement:"top-left",share:"content",gap:0,gapPhone:0,...g,[f]:"image",boxShape:"square",darken:Ft,[me]:Yt,[G.zoom]:Kt,[G.darken]:Ht},slots:{[i]:[{type:a,props:{...o,name:"Top row",direction:"row",justify:"between",align:"start",share:"content",phoneRow:2,sharePhone:"content",wrapPhone:"nowrap",widthFit:"fill",gap:8,gapPhone:8,...g,sectionPaddingTop:12,sectionPaddingLeft:12,sectionPaddingRight:12,sectionPaddingTopPhone:10,sectionPaddingLeftPhone:10,sectionPaddingRightPhone:10},slots:{[i]:[{type:a,props:{...o,name:"Tag",direction:"row",share:"content",minWidth:0,...g,[M]:Y},slots:{[i]:[t("tag",{...n,tag:"p",textFit:"ellipsis"},_e)]}},t("number",{...n,tag:"p",textFit:"line"},xt)]}},{type:a,props:{...o,name:"Words",justify:"end",align:"start",placement:"bottom-left",share:"content",widthFit:"fill",sectionHeightMode:"fill",gap:8,gapPhone:8,...r(24,24,12,14),sectionPaddingTopPhone:4,darken:Mt,darkenStyle:"bottom",[M]:Y},slots:{[i]:[{type:a,props:{...o,name:"Heading",widthFit:"fill",gap:4,gapPhone:4,...g},slots:{[i]:[t("eyebrow",{...n,tag:"p",_hiddenPhone:!0},Ut),t("name",{...n,tag:"h3"},Vt)]}},t("meta",{...n,tag:"p"},Wt)]}}]}});function $t(e){return D(e,E,"GalleryB",l=>S([vt()],(O,s)=>`${l}~tile${s?`.${s}`:""}`))}const Xt={fields:[{key:"image",label:"Image",kind:"image",alt:"name"},{key:"tag",label:"Tag"},{key:"number",label:"Card number"},{key:"eyebrow",label:"Eyebrow"},{key:"name",label:"Title"},{key:"meta",label:"Meta"},{key:"href",label:"Product link",kind:"link"}],seedOnInsert:$t},Zt=["showCardPrice","showCardFinishes","showCardSizes","showCardBuy","showCardPage"],jt=e=>Object.fromEntries(Object.entries(e).filter(([l])=>!Zt.includes(l))),de={fields:[{key:"label",label:"Label"},{key:"href",label:"Link",kind:"link"}],blocks:[{type:xe,label:"Menu link"}],seed:Ue},Te=e=>e.dynamic===!0&&e.relationship==="bundles",fl=(e={})=>rt(e),P={fields:I,blocks:[{type:ot,label:"Picture"},{type:J,label:"Eyebrow"},{type:ee,label:"Name"},{type:nt,label:"Specs"},{type:te,label:"Price"},{type:lt,label:"Colour"},{type:it,label:"Size"},{type:tt,label:"Buy"}],seed:e=>{if(e.dynamic!==!0)return u(e);const l=k(e);return Te(e)?N(l):u(l)}},pe=[{key:"label",label:"Filter name"},{key:Be,label:"Options",kind:"list",fields:[{key:"label",label:"Option"},{key:"count",label:"Count"}]}],ce=[{slot:Ge,label:Ye,fields:A},{slot:Me,label:Ke,fields:[]}],zt=[{block:"Reviews",fields:[{key:"quote",label:"Quote"},{key:"title",label:"Title"},{key:"name",label:"Name"},{key:"role",label:"Role · location"},{key:"rating",label:"Rating"},{key:"dateLabel",label:"Date"}],blocks:[{type:"RatingBlock",label:"Rating"}]},{block:"SpecTable",fields:[{key:"label",label:"Label"},{key:"value",label:"Value"}]},{block:"DetailRows",fields:[{key:"eyebrow",label:"Eyebrow"},{key:"title",label:"Title"},{key:"copy",label:"Body",multiline:!0},{key:"image",label:"Image",kind:"image",alt:"title"},{key:"tag",label:"Image tag"}]},{block:"FooterMenu",...de},{block:Tt,...de},{block:pt,...P},{block:Et,...P,slots:[{slot:E,fields:I},{slot:Z,label:X,fields:h},...ce],fields:[...I,...h,...A],seed:e=>z(j(st(e)))},{block:"RelatedProducts",...P,seed:e=>{const l=k({...jt(e),dynamic:!0});return Te(l)?N(l):u(l,{legacyWellHonoured:!0})}},{block:"BundleOffer",...P,seed:e=>N(k({...e,columns:Se(e),dynamic:!0}))},{block:ct,slots:[{slot:E,fields:[]},{slot:ue,label:De,fields:$},{slot:Ae,label:Ie,fields:[]}],fields:$,blocks:[{type:fe,label:"Product Gallery"},{type:J,label:"Eyebrow"},{type:ee,label:"Name"},{type:te,label:"Price"},{type:at,label:"SKU"}],seed:e=>Ne(we(ke(e)))},{block:_t,slots:[{slot:E,fields:pe},{slot:Z,label:X,fields:h},...ce],fields:[...pe,...h,...A],blocks:[{type:R,label:"Card list"}],seed:e=>z(j(He(e)))},{block:dt,fields:[{key:"label",label:"Pick"},{key:"mark",label:"Remove mark"}],seed:Fe},{block:"ContactRouting",slots:[{slot:$e,label:"Topic card",fields:Q},{slot:ve,label:"Reason chip",fields:We},{slot:Ve,label:"Channel row",fields:q},{slot:W,label:v,fields:[]}],fields:[...Q,...q],seed:Xe},{block:"Form",slots:[{slot:W,label:v,fields:[]}],fields:[]},{block:Ze,fields:[{key:"heading",label:"Subhead"},{key:"paragraph",label:"Paragraph",multiline:!0}],seed:je},...[qe,ze].map(e=>({block:e,slots:Je,fields:Qe,seed:l=>et(e,l)})),{block:"Events",...At},{block:"Collections",...Bt},{block:"GalleryB",...Xt},{block:"FitmentTable",fields:[...le,...oe],slots:[{slot:Ot,label:Lt,fields:le},{slot:bt,label:mt,fields:oe}]}];Oe(zt);export{zt as STOREFRONT_CARD_TEMPLATES,Dt as collectionCardSeed,Te as drawsKits,ft as eventsCardSeeds,vt as galleryTileSeed,fl as productGridCardSeed,wt as withCollectionsTemplate,kt as withEventsTemplate,$t as withGalleryTemplate};
|
|
1
|
+
import{CARD_LIST_TYPE as R,CARD_ROW_FIELD_PROP as y,CARD_ROW_LINK_PROP as m,CARD_TEMPLATE_SLOT as E,registerCardTemplates as me}from"efficient-web-builder/format/lib/content/card-template";import{DIM as T,INNER_BOX as o,LABEL_FACE as C,TEXT as n,boxPadding as r,fillSlot as H,labelLook as d,labelStyle as K,seedNodes as S,token as _}from"efficient-web-builder/format/lib/document/seed-parts";import{BOX_SHOW_KEY as M,BOX_SHOW_ON_CARD_HOVER as Y,HOVER_KEY as be,PICTURE_HOVER_KEYS as G}from"efficient-web-builder/format/lib/animation/hover";import{BOX_TYPE as a,CONTAINER_BLOCKS_SLOT as i}from"efficient-web-builder/format/lib/document/container-blocks";import{BOX_ROW_IMAGE_PROP as f}from"efficient-web-builder/format/lib/content/box-card-rule";import{POST_CARD_HEIGHT as he}from"efficient-web-builder/format/lib/post-card-layout";import{OVERLAY_INK_LIGHT as ge}from"efficient-web-builder/format/lib/theme";import{EVENTS_FEATURED_DARKEN as Pe,EVENTS_FEATURED_DARKEN_STYLE as x,EVENTS_FEATURED_PLACEMENT as Re}from"../content/events-featured-look.js";import{COLLECTION_DARKEN as ye,COLLECTION_HOVER_DARKEN as Ce,COLLECTION_HOVER_ZOOM as U}from"../content/collection-card-look.js";import{COLLECTION_CARD_REGIONS as b,COLLECTION_CARD_TEXT_SIZE as Se}from"efficient-web-builder/format/lib/sections/collection-card-text-regions";import{SH_LINK as V}from"efficient-web-builder/render/lib/document/blocks/general/section-to-box-row-parts";import{rowFieldTextSeed as t}from"efficient-web-builder/format/lib/document/blocks/general/Cards/card-seed";import{withRelatedTabletColumns as A}from"../sections/product-grid-columns.js";import{bundleColumns as fe}from"../sections/bundle-to-grid.js";import{HERO_GALLERY_BLOCK as Ae,withHeroTemplate as ke}from"../content/hero-seed.js";import{THANKS_SLOT as W,THANKS_SLOT_LABEL as v}from"../content/thanks-slot.js";import{HERO_BUY_SLOT as Ie,HERO_BUY_SLOT_LABEL as Ne,withHeroBuyTemplate as ue}from"../content/hero-buy-seed.js";import{HERO_OPTION_FIELDS as $,HERO_OPTION_SLOT as De,HERO_OPTION_SLOT_LABEL as we,HERO_TILE_FIELDS as Be,HERO_TILE_SLOT as Fe,HERO_TILE_SLOT_LABEL as He,withHeroOptionTemplate as Ke,withHeroTileTemplate as Me}from"../content/hero-option-seed.js";import{FILTER_OPTIONS_FIELD as Ye,withFilterChipsTemplate as Ge,withFilterTemplate as xe}from"../content/filter-card-seed.js";import{FACET_ROW_FIELDS as h,FACET_TEMPLATE_LABEL as X,FACET_TEMPLATE_SLOT as Z,withFacetTemplate as j}from"../content/facet-row-seed.js";import{RAIL_HEAD_TEMPLATE_LABEL as Ue,RAIL_HEAD_TEMPLATE_SLOT as Ve,RAIL_ROW_FIELDS as k,RAIL_TEMPLATE_LABEL as We,RAIL_TEMPLATE_SLOT as ve,withRailTemplates as z}from"../content/rail-row-seed.js";import{MENU_LINK_BLOCK as $e,withMenuTemplate as Xe}from"../content/menu-card-seed.js";import{CONTACT_CHANNEL_FIELDS as q,CONTACT_CHANNEL_SLOT as Ze,CONTACT_REASON_FIELDS as je,CONTACT_REASON_SLOT as ze,CONTACT_TOPIC_FIELDS as Q,CONTACT_TOPIC_SLOT as qe,withContactTemplates as Qe}from"../content/contact-card-seed.js";import{ARTICLE_BODY_BLOCK as Je,withArticleBodyTemplate as et}from"efficient-web-builder/format/lib/document/article-body-seed";import{APPOINTMENT_BOOKING_TYPE as tt,BOOKING_BOX_TYPE as lt,BOOKING_OPTION_FIELDS as ot,BOOKING_TEMPLATE_SLOTS as at,withBookingTemplates as it}from"../content/booking-card-seed.js";import{PRODUCT_BUY_BLOCK as nt,PRODUCT_CARD_FIELDS as I,PRODUCT_COLOUR_BLOCK as rt,PRODUCT_EYEBROW_BLOCK as J,PRODUCT_NAME_BLOCK as ee,PRODUCT_PICTURE_BLOCK as st,PRODUCT_PRICE_BLOCK as te,PRODUCT_SKU_BLOCK as Et,PRODUCT_SIZE_BLOCK as _t,PRODUCT_SPECS_BLOCK as le,productCardSeed as Tt,withKitCardTemplate as N,withListingCardTemplate as dt,withProductCardTemplate as u}from"../content/product-card-seed.js";import{ALLOY_WHEELS_LISTING_TYPE as pt,FILTER_BLOCK_TYPE as ct,FILTER_CHIPS_TYPE as Lt,MENU_BLOCK_TYPE as Ot,PRODUCT_GRID_TYPE as mt,PRODUCT_HERO_TYPE as bt}from"./document-nodes.js";import{withSeededSlot as D}from"../content/seed-ids.js";import{FITMENT_HEAD_FIELDS as oe,FITMENT_HEAD_TEMPLATE_LABEL as ht,FITMENT_HEAD_TEMPLATE_SLOT as gt,FITMENT_ROW_FIELDS as ae,FITMENT_ROW_TEMPLATE_LABEL as Pt,FITMENT_ROW_TEMPLATE_SLOT as Rt}from"../content/fitment-row-seed.js";const ie="tags",p=d(12),ne={textStyle:"heading-3",..._("headingSmall",20),weight:500,lineHeight:1.2,letterSpacing:-.02},re={textStyle:"body-1",..._("body",14),lineHeight:1.55},yt={...ne,..._("headingSmall",30)},Ct={sectionPaddingTop:24,sectionPaddingRight:28,sectionPaddingBottom:32,sectionPaddingLeft:28,sectionPaddingTopPhone:24,sectionPaddingRightPhone:28,sectionPaddingBottomPhone:32,sectionPaddingLeftPhone:28},St=he.fallback,ft=480,At=70,kt=()=>({type:a,props:{...o,name:"Featured",[f]:"cover",darken:Pe,darkenStyle:x,darkenPhone:At,darkenStylePhone:x,placement:Re,direction:"column",gap:8,gapPhone:8,...r(32,32,20,20),sectionHeightMode:"fixed",sectionHeightValue:St,sectionHeightUnit:"px",sectionHeightModePhone:"fixed",sectionHeightValuePhone:ft,sectionHeightUnitPhone:"px",[m]:"href"},slots:{[i]:[t("meta",{...n,tag:"p"},p,!0),t("title",{...n,tag:"h3",widthFit:"fill"},yt),t("excerpt",{...T,tag:"p",widthFit:"fill",maxWidth:384},re),t("dateLabel",{...T,tag:"p"},{...p,color:"muted"})]}}),It=()=>({type:a,props:{...o,name:"Post",gap:0,gapPhone:0,...r(0,0,0,0),...H("surface"),shadow:!0},slots:{[i]:[{type:"ImageBlock",props:{[y]:"cover",aspect:"16/10",contained:!1}},{type:a,props:{...o,name:"Words",gap:12,gapPhone:12,...Ct},slots:{[i]:[{type:a,props:{...o,name:"Meta",direction:"row",wrap:!0,share:"content",sharePhone:"content",phoneRow:2,gap:12,gapPhone:12,...r(0,0,0,0)},slots:{[i]:[t("meta",{...n,tag:"p"},p,!0),t("dateLabel",{...T,tag:"p"},{...p,color:"muted"},!0)]}},t("title",{...n,tag:"h3",widthFit:"fill"},ne),t("excerpt",{...T,tag:"p",widthFit:"fill"},re),{type:R,props:{[y]:ie},slots:{template:[{type:a,props:{...o,name:"Chip",...r(4,8,4,8),sectionBorder:{width:1}},slots:{[i]:[t("label",{...T,tag:"p"},p)]}}]}},{type:"ButtonBlock",props:{variant:"ghost",label:"Read more",href:"",[m]:"href",...V,icon:"arrow-right",iconPosition:"after",_partStyles:{label:K(12)}}}]}}]}}),Nt=()=>[kt(),It()];function ut(e){const l=["featured","post"];return D(e,E,"Events",O=>S(Nt(),(s,Oe)=>{const[w,...B]=Oe.split("."),F=l[Number(w)]??`card${w}`;return B.length?`${O}~${F}.${B.join(".")}`:`${O}~${F}`}))}const Dt={fields:[{key:"cover",label:"Cover",kind:"image",alt:"title"},{key:"meta",label:"Eyebrow"},{key:"dateLabel",label:"Date"},{key:"title",label:"Title"},{key:"excerpt",label:"Excerpt",multiline:!0},{key:"href",label:"Link",kind:"link"},{key:ie,label:"Tags",kind:"list",fields:[{key:"label",label:"Tag"}]}],blocks:[{type:R,label:"Card list"}],seedOnInsert:ut},c=e=>Number(/(\d+)px/.exec(e)?.[1]),L={tag:c(b.tag.builtIn),name:c(b.name.builtIn),namePhone:c(Se.namePhone),body:c(b.body.builtIn),link:c(b.link.builtIn)},wt={...d(L.tag),letterSpacing:.25},Bt={textStyle:"heading-2",..._("headingMedium",L.name,L.namePhone),weight:500,lineHeight:1,letterSpacing:-.03},Ft={textStyle:"body-1",..._("body",L.body),lineHeight:1.5,paragraphSpacing:12},se=()=>[t("tag",{...n,tag:"p"},wt,!0),t("name",{...n,tag:"h3",widthFit:"fill"},Bt),t("desc",{...n,tag:"p",widthFit:"fill",maxWidth:420},Ft),{type:"ButtonBlock",props:{variant:"ghost",label:"Explore",href:"",[m]:"href",...V,icon:"arrow-right",iconPosition:"after",_partStyles:{label:K(L.link)}}}],Ee={_hidden:!0,_hiddenTablet:!0,_hiddenPhone:!1},Ht=()=>({type:a,props:{...o,name:"Collection",gap:0,gapPhone:0,...r(0,0,0,0),[m]:"href"},slots:{[i]:[{type:a,props:{...o,name:"Picture",[f]:"image",boxShape:"portrait",darken:ye,placement:"bottom-left",direction:"column",gap:12,gapPhone:12,...r(32,32),hoverZoom:U,hoverDarken:Ce,_hiddenPhone:!0},slots:{[i]:se()}},{type:"ImageBlock",props:{[y]:"image",aspect:"4/5",contained:!1,hoverZoom:U,...Ee}},{type:a,props:{...o,name:"Words",gap:12,gapPhone:12,...r(24,24),...H("surface"),...Ee},slots:{[i]:se()}}]}});function Kt(e){return D(e,E,"Collections",l=>S([Ht()],(O,s)=>`${l}~card${s?`.${s}`:""}`))}const Mt={fields:[{key:"tag",label:"Eyebrow"},{key:"name",label:"Title"},{key:"desc",label:"Description",multiline:!0},{key:"image",label:"Image",kind:"image",alt:"name"},{key:"href",label:"Link",kind:"link"}],seedOnInsert:Kt},Yt=35,Gt=50,xt=106,Ut=85,Vt="nextImage",Wt=ge,_e="#c4c1ba",Te={...C,...d(11),letterSpacing:.24,color:"main"},vt={...Te,color:_e},$t={...C,...d(12,11),color:"main"},Xt={textStyle:"heading-3",..._("headingSmall",22,16),weight:500,lineHeight:1.05,letterSpacing:-.02,color:Wt},Zt={...C,...d(12),letterSpacing:.12,color:_e},g=r(0,0,0,0),jt=()=>({type:a,props:{...o,name:"Tile",placement:"top-left",share:"content",gap:0,gapPhone:0,...g,[f]:"image",boxShape:"square",darken:Yt,[be]:Vt,[G.zoom]:xt,[G.darken]:Gt},slots:{[i]:[{type:a,props:{...o,name:"Top row",direction:"row",justify:"between",align:"start",share:"content",phoneRow:2,sharePhone:"content",wrapPhone:"nowrap",widthFit:"fill",gap:8,gapPhone:8,...g,sectionPaddingTop:12,sectionPaddingLeft:12,sectionPaddingRight:12,sectionPaddingTopPhone:10,sectionPaddingLeftPhone:10,sectionPaddingRightPhone:10},slots:{[i]:[{type:a,props:{...o,name:"Tag",direction:"row",share:"content",minWidth:0,...g,[M]:Y},slots:{[i]:[t("tag",{...n,tag:"p",textFit:"ellipsis"},Te)]}},t("number",{...n,tag:"p",textFit:"line"},vt)]}},{type:a,props:{...o,name:"Words",justify:"end",align:"start",placement:"bottom-left",share:"content",widthFit:"fill",sectionHeightMode:"fill",gap:8,gapPhone:8,...r(24,24,12,14),sectionPaddingTopPhone:4,darken:Ut,darkenStyle:"bottom",[M]:Y},slots:{[i]:[{type:a,props:{...o,name:"Heading",widthFit:"fill",gap:4,gapPhone:4,...g},slots:{[i]:[t("eyebrow",{...n,tag:"p",_hiddenPhone:!0},$t),t("name",{...n,tag:"h3"},Xt)]}},t("meta",{...n,tag:"p"},Zt)]}}]}});function zt(e){return D(e,E,"GalleryB",l=>S([jt()],(O,s)=>`${l}~tile${s?`.${s}`:""}`))}const qt={fields:[{key:"image",label:"Image",kind:"image",alt:"name"},{key:"tag",label:"Tag"},{key:"number",label:"Card number"},{key:"eyebrow",label:"Eyebrow"},{key:"name",label:"Title"},{key:"meta",label:"Meta"},{key:"href",label:"Product link",kind:"link"}],seedOnInsert:zt},Qt=["showCardPrice","showCardFinishes","showCardSizes","showCardBuy","showCardPage"],Jt=e=>Object.fromEntries(Object.entries(e).filter(([l])=>!Qt.includes(l))),de={fields:[{key:"label",label:"Label"},{key:"href",label:"Link",kind:"link"}],blocks:[{type:$e,label:"Menu link"}],seed:Xe},pe=e=>e.dynamic===!0&&e.relationship==="bundles",Nl=(e={})=>Tt(e),P={fields:I,blocks:[{type:st,label:"Picture"},{type:J,label:"Eyebrow"},{type:ee,label:"Name"},{type:le,label:"Specs"},{type:te,label:"Price"},{type:rt,label:"Colour"},{type:_t,label:"Size"},{type:nt,label:"Buy"}],seed:e=>{if(e.dynamic!==!0)return u(e);const l=A(e);return pe(e)?N(l):u(l)}},ce=[{key:"label",label:"Filter name"},{key:Ye,label:"Options",kind:"list",fields:[{key:"label",label:"Option"},{key:"count",label:"Count"}]}],Le=[{slot:ve,label:We,fields:k},{slot:Ve,label:Ue,fields:[]}],el=[{block:"Reviews",fields:[{key:"quote",label:"Quote"},{key:"title",label:"Title"},{key:"name",label:"Name"},{key:"role",label:"Role · location"},{key:"rating",label:"Rating"},{key:"dateLabel",label:"Date"}],blocks:[{type:"RatingBlock",label:"Rating"}]},{block:"SpecTable",fields:[{key:"label",label:"Label"},{key:"value",label:"Value"}]},{block:"DetailRows",fields:[{key:"eyebrow",label:"Eyebrow"},{key:"title",label:"Title"},{key:"copy",label:"Body",multiline:!0},{key:"image",label:"Image",kind:"image",alt:"title"},{key:"tag",label:"Image tag"}]},{block:"FooterMenu",...de},{block:Ot,...de},{block:mt,...P},{block:pt,...P,slots:[{slot:E,fields:I},{slot:Z,label:X,fields:h},...Le],fields:[...I,...h,...k],seed:e=>z(j(dt(e)))},{block:"RelatedProducts",...P,seed:e=>{const l=A({...Jt(e),dynamic:!0});return pe(l)?N(l):u(l,{legacyWellHonoured:!0})}},{block:"BundleOffer",...P,seed:e=>N(A({...e,columns:fe(e),dynamic:!0}))},{block:bt,slots:[{slot:E,fields:[]},{slot:De,label:we,fields:$},{slot:Fe,label:He,fields:Be},{slot:Ie,label:Ne,fields:[]}],fields:$,blocks:[{type:Ae,label:"Product Gallery"},{type:J,label:"Eyebrow"},{type:ee,label:"Name"},{type:te,label:"Price"},{type:Et,label:"SKU"},{type:le,label:"Specs"}],seed:e=>ue(Me(Ke(ke(e))))},{block:ct,slots:[{slot:E,fields:ce},{slot:Z,label:X,fields:h},...Le],fields:[...ce,...h,...k],blocks:[{type:R,label:"Card list"}],seed:e=>z(j(xe(e)))},{block:Lt,fields:[{key:"label",label:"Pick"},{key:"mark",label:"Remove mark"}],seed:Ge},{block:"ContactRouting",slots:[{slot:qe,label:"Topic card",fields:Q},{slot:ze,label:"Reason chip",fields:je},{slot:Ze,label:"Channel row",fields:q},{slot:W,label:v,fields:[]}],fields:[...Q,...q],seed:Qe},{block:"Form",slots:[{slot:W,label:v,fields:[]}],fields:[]},{block:Je,fields:[{key:"heading",label:"Subhead"},{key:"paragraph",label:"Paragraph",multiline:!0}],seed:et},...[lt,tt].map(e=>({block:e,slots:at,fields:ot,seed:l=>it(e,l)})),{block:"Events",...Dt},{block:"Collections",...Mt},{block:"GalleryB",...qt},{block:"FitmentTable",fields:[...oe,...ae],slots:[{slot:gt,label:ht,fields:oe},{slot:Rt,label:Pt,fields:ae}]}];me(el);export{el as STOREFRONT_CARD_TEMPLATES,Ht as collectionCardSeed,pe as drawsKits,Nt as eventsCardSeeds,jt as galleryTileSeed,Nl as productGridCardSeed,Kt as withCollectionsTemplate,ut as withEventsTemplate,zt as withGalleryTemplate};
|