efficient-storefront-blocks 0.117.1 → 0.118.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/chunks/{EditorPreviewCheckout-75F6QF5U.js → EditorPreviewCheckout-EAXEJX6G.js} +1 -1
  3. package/dist/chunks/{SiteEditorProvider-ZVNXSXBQ.js → SiteEditorProvider-QXV6Z27K.js} +1 -1
  4. package/dist/chunks/{chunk-3XS3LIPN.js → chunk-2ULOP225.js} +1 -1
  5. package/dist/chunks/chunk-6IGIBTC3.js +342 -0
  6. package/dist/chunks/{chunk-XZPK5PGX.js → chunk-H5F6BWNC.js} +1 -1
  7. package/dist/chunks/{fitment-data-3N56LEBE.js → fitment-data-GGY5ZYBZ.js} +1 -1
  8. package/dist/editor/lib/document/blocks/commerce/FitmentTable/fields.js +1 -1
  9. package/dist/editor/lib/document/blocks/commerce/index.d.ts +1 -1
  10. package/dist/editor/lib/document/config.d.ts +1 -0
  11. package/dist/editor/lib/document/config.js +1 -1
  12. package/dist/editor/lib/efficient-backend.js +1 -1
  13. package/dist/editor/lib/storefront-editor-words.d.ts +2 -0
  14. package/dist/editor/lib/storefront-editor-words.js +1 -1
  15. package/dist/index.d.ts +3 -0
  16. package/dist/index.js +30 -30
  17. package/dist/render/built-with.json +1 -1
  18. package/dist/render/components/FitmentTable.d.ts +5 -1
  19. package/dist/render/components/FitmentTable.js +1 -1
  20. package/dist/render/components/pdp-dynamic/DynamicFitmentTable.d.ts +4 -0
  21. package/dist/render/components/pdp-dynamic/DynamicFitmentTable.js +1 -1
  22. package/dist/render/lib/api/index.d.ts +27 -0
  23. package/dist/render/lib/api/index.js +1 -1
  24. package/dist/render/lib/content/fitment-row-seed.d.ts +15 -0
  25. package/dist/render/lib/content/fitment-row-seed.js +1 -0
  26. package/dist/render/lib/document/blocks/commerce/FitmentTable/meta.d.ts +10 -0
  27. package/dist/render/lib/document/blocks/commerce/FitmentTable/meta.js +1 -1
  28. package/dist/render/lib/document/blocks/commerce/FitmentTable/render.js +1 -1
  29. package/dist/render/lib/document/card-templates.js +1 -1
  30. package/dist/render/lib/document/render-config.d.ts +1 -0
  31. package/dist/render/lib/document/render-config.js +1 -1
  32. package/dist/render/lib/document/section-to-box-rows-fitment.d.ts +1 -0
  33. package/dist/render/lib/document/section-to-box-rows-fitment.js +1 -0
  34. package/dist/words.d.ts +2 -0
  35. package/dist/words.js +1 -1
  36. package/package.json +3 -2
  37. package/dist/chunks/chunk-XVPVTQYY.js +0 -342
  38. /package/dist/chunks/{chunk-NMYHWA3M.js → chunk-53R44PTG.js} +0 -0
  39. /package/dist/chunks/{chunk-XVPVTQYY.js.LEGAL.txt → chunk-6IGIBTC3.js.LEGAL.txt} +0 -0
  40. /package/dist/chunks/{chunk-JVAY6GGN.js → chunk-CL5JFHNP.js} +0 -0
@@ -1,3 +1,3 @@
1
1
  {
2
- "efficient-web-builder": "70.1.0"
2
+ "efficient-web-builder": "70.2.0"
3
3
  }
@@ -1,3 +1,4 @@
1
+ import type { SlotComponent } from "efficient-easel/blocks";
1
2
  import type { FitmentRow } from "../lib/wheels/fitments.js";
2
3
  import { type FieldUsageAnswer } from "../lib/content/field-usage.js";
3
4
  export interface FitmentTableProps {
@@ -13,5 +14,8 @@ export interface FitmentTableProps {
13
14
  editing?: boolean;
14
15
  omitHead?: boolean;
15
16
  fieldUsage?: readonly FieldUsageAnswer[];
17
+ template?: SlotComponent;
18
+ headTemplate?: SlotComponent;
19
+ nodeId?: string;
16
20
  }
17
- export default function FitmentTable({ num, title, description, rows, showFilter, tooltipDefaultOn, footnote, footnoteLinkText, footnoteLinkHref, editing, omitHead, fieldUsage, }: FitmentTableProps): import("react").JSX.Element | null;
21
+ export default function FitmentTable({ num, title, description, rows, showFilter, tooltipDefaultOn, footnote, footnoteLinkText, footnoteLinkHref, editing, omitHead, fieldUsage, template, headTemplate, nodeId, }: FitmentTableProps): import("react").JSX.Element | null;
@@ -1 +1 @@
1
- "use client";import{jsx as t,jsxs as l,Fragment as q}from"react/jsx-runtime";import C from"./SectionBand.js";import{useEffect as J,useState as E}from"react";import _ from"efficient-web-builder/render/components/SectionHeader";import M from"./SectionFootnote.js";import{renderGold as u,renderHeadline as A}from"efficient-web-builder/render/components/goldPhrases";import Q from"./fitment/FitmentRowFit.js";import{useVehicleFit as Y}from"./fitment/useVehicleFit.js";import{fitmentRowAnswer as ee}from"../lib/wheels/fitment-row-fit.js";import{fitmentColumns as te,loadUnitFor as ne}from"../lib/wheels/fitment-columns.js";import{useActiveCountry as le}from"./CurrencyContext.js";import{NO_FIELD_ANSWERS as re}from"../lib/content/field-usage.js";import{say as T}from"efficient-web-builder/format/lib/editor-words";import{useEnglish as oe}from"./EnglishVariant.js";const o={body:"text-[length:var(--size-body,12px)]",labelXs:"text-[length:var(--size-label,11px)]",labelSmall:"text-[length:var(--size-label,12px)]",labelLarge:"text-[length:var(--size-label,13px)]",labelXl:"text-[length:var(--size-label,14px)]"},ae="whitespace-nowrap border-b border-line px-4 py-4",L=`relative cursor-pointer border-2 px-4 py-2 font-mono ${o.labelSmall} font-semibold uppercase tracking-[0.18em] text-fg transition-colors`,X="border-b border-line py-[120px] max-view-desktop:py-20",j="border-b border-line pt-0 pb-[120px] max-view-desktop:pt-0 max-view-desktop:pb-20",I={background:"color-mix(in oklab, var(--accent) 14%, transparent)"},R=(a,i,s)=>i.map(f=>f.cell(a,s)).join("|");function ie({num:a,title:i,description:s,rows:f,showFilter:B=!0,tooltipDefaultOn:b=!0,footnote:H,footnoteLinkText:O,footnoteLinkHref:W,editing:y=!1,omitHead:p=!1,fieldUsage:G=re}){const N=f??[],c=te(G),K=oe(),h=ne(le()),[x,k]=E(null),[r,S]=E(b);J(()=>S(b),[b]);const P=Y({editing:y}),$=c.length===0;if(N.length===0||$)return y?l(C,{className:p?j:X,children:[p?null:t(_,{num:a!=null?u(a):void 0,title:i!=null?A(i,!1):void 0,description:s!=null?u(s):void 0,accent:!0}),t("p",{className:`border-t border-line py-6 font-mono ${o.labelLarge} uppercase tracking-[0.18em] text-fg-dim`,children:$?T("Every fitment column is hidden in Product Types — show one to draw this table."):T("No fitment data for this wheel — pick a wheel with fitment specs.")})]}):null;const F=new Set,g=N.filter(e=>{const n=R(e,c,h);return F.has(n)?!1:(F.add(n),!0)}),w=Array.from(new Set(g.map(e=>e.diameter))).sort((e,n)=>e-n),d=x!==null&&w.includes(x)?x:null,v=d===null?g:g.filter(e=>e.diameter===d),V=B&&w.length>1,D=e=>{if(e===0)return!1;const n=v[e-1],m=v[e];return n.diameter!==m.diameter||n.width!==m.width};return l(C,{className:p?j:X,children:[p?null:t(_,{num:a!=null?u(a):void 0,title:i!=null?A(i,!1):void 0,description:s!=null?u(s):void 0,accent:!0}),l("div",{className:"mb-6 flex flex-wrap items-center gap-x-2 gap-y-3",children:[V&&l(q,{children:[t("span",{className:`mr-2 font-mono ${o.labelSmall} uppercase tracking-[0.24em] text-fg-dim max-view-tablet:mr-0 max-view-tablet:mb-1 max-view-tablet:w-full`,children:"Filter by size:"}),l("button",{type:"button",onClick:()=>k(null),className:`${L} ${d===null?"border-accent outline outline-1 outline-accent -outline-offset-1":"border-fg-dim/50 hover:border-accent"}`,style:d===null?I:void 0,children:[d===null&&t("span",{"aria-hidden":!0,className:"absolute inset-y-0 left-0 w-[3px] bg-accent"}),"All"]}),w.map(e=>{const n=e===d;return l("button",{type:"button",onClick:()=>k(n?null:e),className:`${L} ${n?"border-accent outline outline-1 outline-accent -outline-offset-1":"border-fg-dim/50 hover:border-accent"}`,style:n?I:void 0,children:[n&&t("span",{"aria-hidden":!0,className:"absolute inset-y-0 left-0 w-[3px] bg-accent"}),e,'"']},e)})]}),l("button",{type:"button",onClick:()=>S(e=>!e),"aria-pressed":r,"aria-label":r?"Hide vehicle tooltip":"Show vehicle tooltip",className:`ml-auto inline-flex items-center gap-3 font-mono ${o.labelSmall} uppercase tracking-[0.24em] text-fg-dim transition-colors hover:text-fg max-view-tablet:hidden`,children:[t("span",{children:"Vehicle tooltip"}),t("span",{className:`relative inline-flex h-5 w-9 shrink-0 items-center rounded-full border-2 transition-colors ${r?"border-accent":"border-fg-dim/50"}`,style:r?{background:"color-mix(in oklab, var(--accent) 30%, transparent)"}:void 0,"aria-hidden":!0,children:t("span",{className:`block h-3 w-3 rounded-full transition-transform ${r?"translate-x-[18px] bg-accent":"translate-x-[2px] bg-fg-dim"}`})}),t("span",{className:r?"text-accent":"text-fg-dim",children:r?"On":"Off"})]})]}),t("div",{className:"-mx-1 overflow-x-auto",children:l("table",{className:`w-full border-collapse font-mono ${o.labelXl} tracking-[0.06em] text-fg`,children:[t("thead",{children:t("tr",{children:c.map(({header:e},n)=>t("th",{className:`whitespace-nowrap border-b border-line bg-surface px-4 py-4 text-left ${o.body} font-normal uppercase tracking-[0.22em] text-fg-dim`,children:K(e)},n))})}),t("tbody",{children:v.map((e,n)=>t("tr",{className:`group transition-colors hover:[&>td]:bg-surface ${D(n)?"[&>td]:border-t [&>td]:border-line":""}`,children:c.map((m,U)=>{const z=U===c.length-1,Z=m.fieldKey==="diameter";return l("td",{className:`${z?"relative ":""}${ae}${Z?" text-accent":""}`,children:[m.cell(e,h),z&&r&&t("span",{role:"tooltip",className:`pointer-events-none absolute top-1/2 right-0 z-20 hidden w-[520px] -translate-y-1/2 whitespace-normal bg-[var(--tooltip-bg)] px-3 py-2 text-right font-mono ${o.labelXs} normal-case tracking-[0.12em] text-fg shadow-lg group-hover:block max-view-tablet:!hidden`,children:t(Q,{answer:ee(e,P)})})]},m.fieldKey)})},R(e,c,h)))})]})}),t(M,{text:H,linkText:O,linkHref:W})]})}export{ie as default};
1
+ "use client";import{jsx as t,jsxs as l,Fragment as re}from"react/jsx-runtime";import L from"./SectionBand.js";import{useEffect as oe,useState as R}from"react";import{CardTemplateRows as B}from"efficient-web-builder/render/components/CardRowContext";import{BOX_HOLDS_NO_GUTTER_CLASS as ae}from"efficient-web-builder/format/lib/content/page-width";import{SPEC_TABLE_BAND as I}from"../lib/sections/spec-table-band.js";import{FITMENT_HEAD_TEMPLATE_SLOT as ie,fitmentCardRow as se,fitmentHeadRow as ce}from"../lib/content/fitment-row-seed.js";import O from"efficient-web-builder/render/components/SectionHeader";import de from"./SectionFootnote.js";import{renderGold as b,renderHeadline as X}from"efficient-web-builder/render/components/goldPhrases";import me from"./fitment/FitmentRowFit.js";import{useVehicleFit as pe}from"./fitment/useVehicleFit.js";import{fitmentRowAnswer as ue}from"../lib/wheels/fitment-row-fit.js";import{fitmentColumns as fe,loadUnitFor as be}from"../lib/wheels/fitment-columns.js";import{useActiveCountry as he}from"./CurrencyContext.js";import{NO_FIELD_ANSWERS as xe}from"../lib/content/field-usage.js";import{say as H}from"efficient-web-builder/format/lib/editor-words";import{useEnglish as ge}from"./EnglishVariant.js";const a={body:"text-[length:var(--size-body,12px)]",labelXs:"text-[length:var(--size-label,11px)]",labelSmall:"text-[length:var(--size-label,12px)]",labelLarge:"text-[length:var(--size-label,13px)]",labelXl:"text-[length:var(--size-label,14px)]"},we="whitespace-nowrap border-b border-line px-4 py-4",j=`relative cursor-pointer border-2 px-4 py-2 font-mono ${a.labelSmall} font-semibold uppercase tracking-[0.18em] text-fg transition-colors`,P=I.inline,D=I.ownBox,h={scroll:"-mx-1 overflow-x-auto",table:`min-w-[600px] ${ae}`,head:"border-b border-line bg-surface",row:"group relative border-b border-line transition-colors hover:bg-surface"},G={background:"color-mix(in oklab, var(--accent) 14%, transparent)"},y=(i,s,c)=>s.map(x=>x.cell(i,c)).join("|");function ve({num:i,title:s,description:c,rows:x,showFilter:W=!0,tooltipDefaultOn:g=!0,footnote:K,footnoteLinkText:M,footnoteLinkHref:U,editing:S=!1,omitHead:f=!1,fieldUsage:V=xe,template:Z,headTemplate:q,nodeId:T}){const k=x??[],r=fe(V),_=ge(),u=be(he()),[w,E]=R(null),[o,$]=R(g);oe(()=>$(g),[g]);const J=pe({editing:S}),C=r.length===0;if(k.length===0||C)return S?l(L,{className:f?D:P,children:[f?null:t(O,{num:i!=null?b(i):void 0,title:s!=null?X(s,!1):void 0,description:c!=null?b(c):void 0,accent:!0}),t("p",{className:`border-t border-line py-6 font-mono ${a.labelLarge} uppercase tracking-[0.18em] text-fg-dim`,children:C?H("Every fitment column is hidden in Product Types — show one to draw this table."):H("No fitment data for this wheel — pick a wheel with fitment specs.")})]}):null;const A=new Set,v=k.filter(e=>{const n=y(e,r,u);return A.has(n)?!1:(A.add(n),!0)}),N=Array.from(new Set(v.map(e=>e.diameter))).sort((e,n)=>e-n),d=w!==null&&N.includes(w)?w:null,m=d===null?v:v.filter(e=>e.diameter===d),Q=W&&N.length>1,Y=e=>{if(e===0)return!1;const n=m[e-1],p=m[e];return n.diameter!==p.diameter||n.width!==p.width},F=e=>o?t("span",{role:"tooltip",className:`pointer-events-none absolute top-1/2 right-0 z-20 hidden w-[520px] -translate-y-1/2 whitespace-normal bg-[var(--tooltip-bg)] px-3 py-2 text-right font-mono ${a.labelXs} normal-case tracking-[0.12em] text-fg shadow-lg group-hover:block max-view-tablet:!hidden`,children:t(me,{answer:ue(e,J)})}):null,ee=(e,n)=>l("div",{className:h.row,children:[e,m[n.index]?F(m[n.index]):null]}),te=t("div",{className:"-mx-1 overflow-x-auto",children:l("table",{className:`w-full border-collapse font-mono ${a.labelXl} tracking-[0.06em] text-fg`,children:[t("thead",{children:t("tr",{children:r.map(({header:e},n)=>t("th",{className:`whitespace-nowrap border-b border-line bg-surface px-4 py-4 text-left ${a.body} font-normal uppercase tracking-[0.22em] text-fg-dim`,children:_(e)},n))})}),t("tbody",{children:m.map((e,n)=>t("tr",{className:`group transition-colors hover:[&>td]:bg-surface ${Y(n)?"[&>td]:border-t [&>td]:border-line":""}`,children:r.map((p,ne)=>{const z=ne===r.length-1,le=p.fieldKey==="diameter";return l("td",{className:`${z?"relative ":""}${we}${le?" text-accent":""}`,children:[p.cell(e,u),z?F(e):null]},p.fieldKey)})},y(e,r,u)))})]})});return l(L,{className:f?D:P,children:[f?null:t(O,{num:i!=null?b(i):void 0,title:s!=null?X(s,!1):void 0,description:c!=null?b(c):void 0,accent:!0}),l("div",{className:"mb-6 flex flex-wrap items-center gap-x-2 gap-y-3",children:[Q&&l(re,{children:[t("span",{className:`mr-2 font-mono ${a.labelSmall} uppercase tracking-[0.24em] text-fg-dim max-view-tablet:mr-0 max-view-tablet:mb-1 max-view-tablet:w-full`,children:"Filter by size:"}),l("button",{type:"button",onClick:()=>E(null),className:`${j} ${d===null?"border-accent outline outline-1 outline-accent -outline-offset-1":"border-fg-dim/50 hover:border-accent"}`,style:d===null?G:void 0,children:[d===null&&t("span",{"aria-hidden":!0,className:"absolute inset-y-0 left-0 w-[3px] bg-accent"}),"All"]}),N.map(e=>{const n=e===d;return l("button",{type:"button",onClick:()=>E(n?null:e),className:`${j} ${n?"border-accent outline outline-1 outline-accent -outline-offset-1":"border-fg-dim/50 hover:border-accent"}`,style:n?G:void 0,children:[n&&t("span",{"aria-hidden":!0,className:"absolute inset-y-0 left-0 w-[3px] bg-accent"}),e,'"']},e)})]}),l("button",{type:"button",onClick:()=>$(e=>!e),"aria-pressed":o,"aria-label":o?"Hide vehicle tooltip":"Show vehicle tooltip",className:`ml-auto inline-flex items-center gap-3 font-mono ${a.labelSmall} uppercase tracking-[0.24em] text-fg-dim transition-colors hover:text-fg max-view-tablet:hidden`,children:[t("span",{children:"Vehicle tooltip"}),t("span",{className:`relative inline-flex h-5 w-9 shrink-0 items-center rounded-full border-2 transition-colors ${o?"border-accent":"border-fg-dim/50"}`,style:o?{background:"color-mix(in oklab, var(--accent) 30%, transparent)"}:void 0,"aria-hidden":!0,children:t("span",{className:`block h-3 w-3 rounded-full transition-transform ${o?"translate-x-[18px] bg-accent":"translate-x-[2px] bg-fg-dim"}`})}),t("span",{className:o?"text-accent":"text-fg-dim",children:o?"On":"Off"})]})]}),t(B,{ownerId:T??"",ownerType:"FitmentTable",Template:Z,rows:m.map(e=>se(e,r,u,y(e,r,u))),wrapCopy:ee,fallback:te,children:e=>t("div",{className:h.scroll,children:l("div",{className:h.table,children:[t(B,{ownerId:T??"",ownerType:"FitmentTable",slot:ie,Template:q,rows:[ce(r,_)],fallback:null,children:n=>t("div",{className:h.head,children:n})}),e]})})}),t(de,{text:K,linkText:M,linkHref:U})]})}export{ve as default};
@@ -1,4 +1,5 @@
1
1
  import type { ProductKind } from "../../lib/api/index.js";
2
+ import type { SlotComponent } from "efficient-easel/blocks";
2
3
  export declare const supportedKinds: readonly ProductKind[];
3
4
  export interface TyreHead {
4
5
  title?: string;
@@ -16,6 +17,9 @@ interface Props {
16
17
  footnoteLinkHref?: string;
17
18
  editing?: boolean;
18
19
  omitHead?: boolean;
20
+ template?: SlotComponent;
21
+ headTemplate?: SlotComponent;
22
+ nodeId?: string;
19
23
  }
20
24
  export default function DynamicFitmentTable(props: Props): import("react").JSX.Element;
21
25
  export {};
@@ -1 +1 @@
1
- "use client";import{jsx as n}from"react/jsx-runtime";import k from"../FitmentTable.js";import x from"./KindGate.js";import{TyreSizesContent as F}from"../TyreSizeGrid.js";import{useCurrentProduct as T}from"../../lib/document/current-product.js";import{NO_FIELD_ANSWERS as w}from"../../lib/content/field-usage.js";import{useSampleProduct as b}from"./useSampleProduct.js";const h=["alloy-wheel","tyre"];function y(t){return n(x,{kinds:h,type:"FitmentTable",editing:t.editing,children:n(S,{...t})})}function S({num:t,title:s,description:l,showFilter:f,tooltipDefaultOn:a,footnote:d,footnoteLinkText:u,footnoteLinkHref:c,editing:r=!1,omitHead:m=!1,tyreHead:e}){const o=T(),p=b(r&&!o),i=o?.product??p;if(i?.kind==="tyre")return n(F,{variants:i.source.variants,fieldUsage:o?.fieldUsage??w,num:t,title:e?e.title:s,description:e?e.description:l,editing:r,omitHead:m,keepHiddenHead:e!=null});const g=i?.kind==="alloy-wheel"?i.source.fitments??[]:[];return n(k,{num:t,title:s,description:l,rows:g,showFilter:f,tooltipDefaultOn:a,footnote:d,footnoteLinkText:u,footnoteLinkHref:c,editing:r,omitHead:m,fieldUsage:o?.fieldUsage})}export{y as default,h as supportedKinds};
1
+ "use client";import{jsx as n}from"react/jsx-runtime";import F from"../FitmentTable.js";import h from"./KindGate.js";import{TyreSizesContent as w}from"../TyreSizeGrid.js";import{useCurrentProduct as b}from"../../lib/document/current-product.js";import{NO_FIELD_ANSWERS as y}from"../../lib/content/field-usage.js";import{useSampleProduct as S}from"./useSampleProduct.js";const U=["alloy-wheel","tyre"];function D(t){return n(h,{kinds:U,type:"FitmentTable",editing:t.editing,children:n(L,{...t})})}function L({num:t,title:s,description:l,showFilter:a,tooltipDefaultOn:d,footnote:f,footnoteLinkText:p,footnoteLinkHref:u,editing:r=!1,omitHead:m=!1,tyreHead:e,template:c,headTemplate:T,nodeId:g}){const o=b(),k=S(r&&!o),i=o?.product??k;if(i?.kind==="tyre")return n(w,{variants:i.source.variants,fieldUsage:o?.fieldUsage??y,num:t,title:e?e.title:s,description:e?e.description:l,editing:r,omitHead:m,keepHiddenHead:e!=null});const x=i?.kind==="alloy-wheel"?i.source.fitments??[]:[];return n(F,{num:t,title:s,description:l,rows:x,showFilter:a,tooltipDefaultOn:d,footnote:f,footnoteLinkText:p,footnoteLinkHref:u,editing:r,omitHead:m,fieldUsage:o?.fieldUsage,template:c,headTemplate:T,nodeId:g})}export{D as default,U as supportedKinds};
@@ -525,6 +525,17 @@ export interface AdminStorefrontTemplatePage {
525
525
  layout: Record<string, unknown>;
526
526
  display_order: number;
527
527
  }
528
+ export interface AdminTemplateLibrary {
529
+ template: {
530
+ id: string;
531
+ name: string;
532
+ } | null;
533
+ pages: {
534
+ template_page: string | null;
535
+ slug: string;
536
+ title: string;
537
+ }[];
538
+ }
528
539
  export interface AdminHeaderSettings {
529
540
  id: string;
530
541
  logo: string | null;
@@ -723,6 +734,14 @@ export declare function createStorefrontAdmin(client?: AdminClient): {
723
734
  getTemplate: (id: string, token: string) => Promise<AdminStorefrontPageTemplate>;
724
735
  saveTemplateLayout: (id: string, layout: Record<string, unknown>, token: string) => Promise<AdminStorefrontPageTemplate>;
725
736
  listTemplatePages: (templateId: string, token: string) => Promise<AdminStorefrontTemplatePage[]>;
737
+ getPageLibrary: (token: string) => Promise<AdminStorefrontPageTemplate | null>;
738
+ getTemplateLibrary: (siteId: string, token: string) => Promise<AdminTemplateLibrary>;
739
+ createPageFromTemplate: (page: {
740
+ site: string;
741
+ title: string;
742
+ slug: string;
743
+ template_page: string | null;
744
+ }, token: string) => Promise<AdminStorefrontPage>;
726
745
  findTemplatePageBySlug: (templateId: string, slug: string, token: string) => Promise<AdminStorefrontTemplatePage | null>;
727
746
  createTemplatePage: (templateId: string, page: {
728
747
  slug: string;
@@ -803,6 +822,14 @@ export declare const storefrontAdmin: {
803
822
  getTemplate: (id: string, token: string) => Promise<AdminStorefrontPageTemplate>;
804
823
  saveTemplateLayout: (id: string, layout: Record<string, unknown>, token: string) => Promise<AdminStorefrontPageTemplate>;
805
824
  listTemplatePages: (templateId: string, token: string) => Promise<AdminStorefrontTemplatePage[]>;
825
+ getPageLibrary: (token: string) => Promise<AdminStorefrontPageTemplate | null>;
826
+ getTemplateLibrary: (siteId: string, token: string) => Promise<AdminTemplateLibrary>;
827
+ createPageFromTemplate: (page: {
828
+ site: string;
829
+ title: string;
830
+ slug: string;
831
+ template_page: string | null;
832
+ }, token: string) => Promise<AdminStorefrontPage>;
806
833
  findTemplatePageBySlug: (templateId: string, slug: string, token: string) => Promise<AdminStorefrontTemplatePage | null>;
807
834
  createTemplatePage: (templateId: string, page: {
808
835
  slug: string;
@@ -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{backendHopHeaders as yt,clientIpFromForwardedFor as ht,FORWARDED_FOR_HEADER as ft,hopCachingOf as gt}from"../forwarded-for.js";import mt from"efficient-web-builder/format/lib/document/media-manifest.json";import{auth as O}from"../auth.js";import{efficientClientOpen as wt}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 St=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.",Pt=new Set([502,503,504]),k=0,Ot="This editor runs on its host's own backend, which does not serve this request.",bt=5e3,Tt=15e3,At=()=>typeof window>"u"?bt:Tt;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(At())}const B=t=>t instanceof Error&&t.name==="TimeoutError",q=(t,e)=>Pt.has(t)?v:e,Rt=["admin","venue"];let G="admin";function Ee(t){G=Rt.includes(t)?t:"admin"}function Et(){return G}const _t=/^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{1,8})*$/;let W=null;function _e(t){W=t&&_t.test(t)?t:null}function Ut(){return W}function $t(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"&&!wt())throw new w(k,Ot,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??St}${$t(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=Ct().finally(()=>{A=null}),A)}async function Ct(){const t=O.takeLegacyRefresh(),e=await vt.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 Nt=100,K=20;function It(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(Nt)),l!=="1"&&a.set("page",l);const r=await g(`${n}?${a.toString()}`);u.push(...m(r)),l=It(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 vt={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 kt,absolutizeApiUrl as L}from"efficient-web-builder/render/lib/media";import{analyzeLogoSvg as Lt,isSvgUrl as Jt}from"efficient-web-builder/format/lib/logo/reverse-svg";import{getEditorSiteId as xt}from"efficient-web-builder/render/lib/editor-site";import{shopRouteBase as Dt,webRuntimeSiteSlug as Y}from"efficient-web-builder/format/lib/web-runtime";import{readDealerList as Ht}from"../sections/dealer-finder.js";import{SIGN_UP_PATH as Ft,SIGN_UP_VERIFY_PATH as Mt,SIGN_UP_WAITING_PATH as Bt,WORKSPACE_FINDS_PATH as qt,WORKSPACE_FIND_OPEN_PATH as Gt,signInUrlOf as Wt,readLinkAnswer as Q,readSignUpAvailability as jt,readSignUpSent as zt,signUpAvailabilityPath as Kt}from"../sections/sign-up.js";function S(t){if(typeof t=="string")return t.startsWith("/media/")?kt(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 Ke}from"./origins.js";const tt=typeof window>"u"&&H!=="",Vt=tt?H:pt,Xt=Dt,b=()=>({baseUrl:Xt(),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 Zt(t,e){return J("/wheels",{process:t},e)}const rt=et;function Yt(t,e){return J("/wheels",{slug:t.join(",")},e)}function Qt(t,e,n){return J("/products",{kind:t.join(","),make:e?.make,model:e?.model,year:e?.year,modification:e?.modification},n)}function te(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=te(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 ee()).host}async function ee(){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 ae(){try{const{headers:t}=await import("next/headers");return ht((await t()).get(ft))}catch{return null}}async function re(){try{const{headers:t}=await import("next/headers");return(await t()).get(lt)||null}catch{return null}}async function ne(){const t=await re();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 ne())}function $(t,e){return e?`${t}${t.includes("?")?"&":"?"}${e}`:t}const se="preview";async function oe(){if(typeof window<"u")return null;try{const{headers:t}=await import("next/headers");return(await t()).get(dt)}catch{return null}}async function ie(){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 oe();if(n===null)return[await f(t),await d(e)];const s=$(await f(t),`${se}=${encodeURIComponent(n)}`),{next:u,cache:l,...y}=e??{},a=await d({...y,cache:"no-store"}),r=await ie();return r&&(a.headers={...a.headers,"user-agent":r}),[s,a]}async function ce(t){if(!tt)return;const[e,n]=await Promise.all([ot(),ae()]),s=yt(e,n,t);return Object.keys(s).length>0?s:void 0}async function d(t){const e=await ce(gt(t)),n={baseUrl:Vt,...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 ke={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())}},Le={listWheels:async(t,e={})=>{const n=await x("products.listWheels",async s=>await f(Zt(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(Yt(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(Qt(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&&Jt(n)){const l=await Lt(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())},Je={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"})),createPaymentIntent:async t=>i(c("/bookings/payments/intent"),await d({method:"POST",body:JSON.stringify({manageToken:t})}))};class de 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)}/`,ue=t=>`${N(t)}currencies/`,le="/api/storefront/media/ingest/";class pe 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 ye(){const t=xt();if(!t)throw new pe;return`${le}?${new URLSearchParams({site:t})}`}const he="X-Puck-Media-Manifest",it=mt.contentHash,I={"X-Media-Manifest":it,[he]:it},xe=ct({});function ct(t){return(e,n={})=>{const s=Ut(),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??Et()})}}function fe(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 de(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)},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(ue(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(ye(),{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 De=fe({siteDrafts:!0});function ge(t){const e=t.trim();return e?`/api/v1/dealers?${new URLSearchParams({near:e}).toString()}`:"/api/v1/dealers"}async function He(t){return Ht(await i(ge(t)))}const T={audience:null,baseUrl:""};async function Fe(t,e){return jt(await i(Kt(t,e),T))}async function Me(t){return zt(await i(Ft,{...T,method:"POST",body:JSON.stringify(t)}))}async function Be(t){try{const e=await i(Mt,{...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 qe(t,e){await i(Bt,{...T,method:"POST",body:JSON.stringify({email:e.trim(),...t?{product:t}:{}})})}async function Ge(t,e){await i(qt,{...T,method:"POST",body:JSON.stringify({email:e.trim(),...t?{product:t}:{}})})}async function We(t){try{return Wt(await i(Gt,{...T,method:"POST",body:JSON.stringify({token:t})}))}catch(e){if(e instanceof w)return"";throw e}}export{St as API_URL,de as AmbiguousPageSlugError,w as ApiError,Tt as BROWSER_READ_TIMEOUT_MS,Ot as EFFICIENT_CLIENT_CLOSED_MESSAGE,pe as MediaUploadDestinationError,se as PREVIEW_PARAM,Ke as PRODUCT_API_BASE,bt as SERVER_READ_TIMEOUT_MS,v as SERVER_UNREACHABLE_MESSAGE,k as STATUS_NETWORK_ERROR,xe as adminFetch,vt as api,i as apiFetch,$ as appendSiteQuery,Ge as askForWorkspaces,Me as askToSignUp,Je as bookings,fe as createStorefrontAdmin,ge as dealersPath,M as defaultRequestDeadline,ye as editorMediaUploadPath,Et as editorPortalAudience,Ut as editorRequestLanguage,He as fetchDealers,Fe as fetchSignUpAvailability,ke as fitment,qe as joinSignUpWaitingList,Be as openSignUpLink,We as openWorkspaceFind,Le as products,At as readDeadlineMs,ae as resolveClientIp,S as resolveMediaUrls,oe as resolvePreviewToken,ot as resolveSiteHost,ee as resolveSiteHostSource,re as resolveSiteSlug,_e as setEditorLanguage,Ee as setEditorPortalAudience,De as storefrontAdmin};
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{backendHopHeaders as yt,clientIpFromForwardedFor as ht,FORWARDED_FOR_HEADER as ft,hopCachingOf as gt}from"../forwarded-for.js";import mt from"efficient-web-builder/format/lib/document/media-manifest.json";import{auth as O}from"../auth.js";import{efficientClientOpen as wt}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 St=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.",Pt=new Set([502,503,504]),k=0,Ot="This editor runs on its host's own backend, which does not serve this request.",bt=5e3,Tt=15e3,At=()=>typeof window>"u"?bt:Tt;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(At())}const B=t=>t instanceof Error&&t.name==="TimeoutError",q=(t,e)=>Pt.has(t)?v:e,Rt=["admin","venue"];let G="admin";function Ee(t){G=Rt.includes(t)?t:"admin"}function Et(){return G}const _t=/^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{1,8})*$/;let W=null;function _e(t){W=t&&_t.test(t)?t:null}function Ut(){return W}function $t(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"&&!wt())throw new w(k,Ot,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??St}${$t(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=Ct().finally(()=>{A=null}),A)}async function Ct(){const t=O.takeLegacyRefresh(),e=await vt.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 Nt=100,K=20;function It(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(Nt)),l!=="1"&&a.set("page",l);const r=await g(`${n}?${a.toString()}`);u.push(...m(r)),l=It(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 vt={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 kt,absolutizeApiUrl as L}from"efficient-web-builder/render/lib/media";import{analyzeLogoSvg as Lt,isSvgUrl as Jt}from"efficient-web-builder/format/lib/logo/reverse-svg";import{getEditorSiteId as xt}from"efficient-web-builder/render/lib/editor-site";import{shopRouteBase as Dt,webRuntimeSiteSlug as Y}from"efficient-web-builder/format/lib/web-runtime";import{readDealerList as Ht}from"../sections/dealer-finder.js";import{SIGN_UP_PATH as Ft,SIGN_UP_VERIFY_PATH as Mt,SIGN_UP_WAITING_PATH as Bt,WORKSPACE_FINDS_PATH as qt,WORKSPACE_FIND_OPEN_PATH as Gt,signInUrlOf as Wt,readLinkAnswer as Q,readSignUpAvailability as jt,readSignUpSent as zt,signUpAvailabilityPath as Kt}from"../sections/sign-up.js";function S(t){if(typeof t=="string")return t.startsWith("/media/")?kt(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 Ke}from"./origins.js";const tt=typeof window>"u"&&H!=="",Vt=tt?H:pt,Xt=Dt,b=()=>({baseUrl:Xt(),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 Zt(t,e){return J("/wheels",{process:t},e)}const rt=et;function Yt(t,e){return J("/wheels",{slug:t.join(",")},e)}function Qt(t,e,n){return J("/products",{kind:t.join(","),make:e?.make,model:e?.model,year:e?.year,modification:e?.modification},n)}function te(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=te(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 ee()).host}async function ee(){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 ae(){try{const{headers:t}=await import("next/headers");return ht((await t()).get(ft))}catch{return null}}async function re(){try{const{headers:t}=await import("next/headers");return(await t()).get(lt)||null}catch{return null}}async function ne(){const t=await re();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 ne())}function $(t,e){return e?`${t}${t.includes("?")?"&":"?"}${e}`:t}const se="preview";async function oe(){if(typeof window<"u")return null;try{const{headers:t}=await import("next/headers");return(await t()).get(dt)}catch{return null}}async function ie(){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 oe();if(n===null)return[await f(t),await d(e)];const s=$(await f(t),`${se}=${encodeURIComponent(n)}`),{next:u,cache:l,...y}=e??{},a=await d({...y,cache:"no-store"}),r=await ie();return r&&(a.headers={...a.headers,"user-agent":r}),[s,a]}async function ce(t){if(!tt)return;const[e,n]=await Promise.all([ot(),ae()]),s=yt(e,n,t);return Object.keys(s).length>0?s:void 0}async function d(t){const e=await ce(gt(t)),n={baseUrl:Vt,...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 ke={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())}},Le={listWheels:async(t,e={})=>{const n=await x("products.listWheels",async s=>await f(Zt(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(Yt(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(Qt(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&&Jt(n)){const l=await Lt(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())},Je={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"})),createPaymentIntent:async t=>i(c("/bookings/payments/intent"),await d({method:"POST",body:JSON.stringify({manageToken:t})}))};class de 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)}/`,ue=t=>`${N(t)}currencies/`,le="/api/storefront/media/ingest/";class pe 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 ye(){const t=xt();if(!t)throw new pe;return`${le}?${new URLSearchParams({site:t})}`}const he="X-Puck-Media-Manifest",it=mt.contentHash,I={"X-Media-Manifest":it,[he]:it},xe=ct({});function ct(t){return(e,n={})=>{const s=Ut(),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??Et()})}}function fe(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 de(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(ue(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(ye(),{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 De=fe({siteDrafts:!0});function ge(t){const e=t.trim();return e?`/api/v1/dealers?${new URLSearchParams({near:e}).toString()}`:"/api/v1/dealers"}async function He(t){return Ht(await i(ge(t)))}const T={audience:null,baseUrl:""};async function Fe(t,e){return jt(await i(Kt(t,e),T))}async function Me(t){return zt(await i(Ft,{...T,method:"POST",body:JSON.stringify(t)}))}async function Be(t){try{const e=await i(Mt,{...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 qe(t,e){await i(Bt,{...T,method:"POST",body:JSON.stringify({email:e.trim(),...t?{product:t}:{}})})}async function Ge(t,e){await i(qt,{...T,method:"POST",body:JSON.stringify({email:e.trim(),...t?{product:t}:{}})})}async function We(t){try{return Wt(await i(Gt,{...T,method:"POST",body:JSON.stringify({token:t})}))}catch(e){if(e instanceof w)return"";throw e}}export{St as API_URL,de as AmbiguousPageSlugError,w as ApiError,Tt as BROWSER_READ_TIMEOUT_MS,Ot as EFFICIENT_CLIENT_CLOSED_MESSAGE,pe as MediaUploadDestinationError,se as PREVIEW_PARAM,Ke as PRODUCT_API_BASE,bt as SERVER_READ_TIMEOUT_MS,v as SERVER_UNREACHABLE_MESSAGE,k as STATUS_NETWORK_ERROR,xe as adminFetch,vt as api,i as apiFetch,$ as appendSiteQuery,Ge as askForWorkspaces,Me as askToSignUp,Je as bookings,fe as createStorefrontAdmin,ge as dealersPath,M as defaultRequestDeadline,ye as editorMediaUploadPath,Et as editorPortalAudience,Ut as editorRequestLanguage,He as fetchDealers,Fe as fetchSignUpAvailability,ke as fitment,qe as joinSignUpWaitingList,Be as openSignUpLink,We as openWorkspaceFind,Le as products,At as readDeadlineMs,ae as resolveClientIp,S as resolveMediaUrls,oe as resolvePreviewToken,ot as resolveSiteHost,ee as resolveSiteHostSource,re as resolveSiteSlug,_e as setEditorLanguage,Ee as setEditorPortalAudience,De as storefrontAdmin};
@@ -0,0 +1,15 @@
1
+ import { type CardRowFieldSpec } from "efficient-web-builder/format/lib/content/card-template";
2
+ import { type BlockSeed } from "efficient-web-builder/format/lib/document/seed-parts";
3
+ import type { SourceRow } from "efficient-web-builder/format/lib/content/block-sources";
4
+ import { type FitmentColumn, type LoadUnit } from "../wheels/fitment-columns.js";
5
+ import type { FitmentRow } from "../wheels/fitments.js";
6
+ export declare const FITMENT_ROW_TEMPLATE_SLOT = "template";
7
+ export declare const FITMENT_ROW_TEMPLATE_LABEL = "Row template";
8
+ export declare const FITMENT_HEAD_TEMPLATE_SLOT = "headTemplate";
9
+ export declare const FITMENT_HEAD_TEMPLATE_LABEL = "Head template";
10
+ export declare const FITMENT_ROW_FIELDS: readonly CardRowFieldSpec[];
11
+ export declare const FITMENT_HEAD_FIELDS: readonly CardRowFieldSpec[];
12
+ export declare const fitmentRowSeed: () => BlockSeed;
13
+ export declare const fitmentHeadSeed: () => BlockSeed;
14
+ export declare function fitmentCardRow(row: FitmentRow, shown: readonly FitmentColumn[], unit: LoadUnit, key: string): SourceRow;
15
+ export declare function fitmentHeadRow(shown: readonly FitmentColumn[], english: (word: string) => string): SourceRow;
@@ -0,0 +1 @@
1
+ import{CARD_TEMPLATE_SLOT as L}from"efficient-web-builder/format/lib/content/card-template";import{rowFieldTextSeed as E}from"efficient-web-builder/format/lib/document/blocks/general/Cards/card-seed";import{DIM as h,INNER_BOX as O,LABEL_FACE as T,TEXT as c,boxPadding as y,token as d}from"efficient-web-builder/format/lib/document/seed-parts";import{BOX_TYPE as S,CONTAINER_BLOCKS_SLOT as w}from"efficient-web-builder/format/lib/document/container-blocks";import{phoneKey as r}from"efficient-easel/draw";import{FITMENT_COLUMNS as a}from"../wheels/fitment-columns.js";const K=L,u="Row template",C="headTemplate",D="Head template",B=a.map(e=>({key:e.fieldKey,label:e.header})),p=e=>`head_${e.fieldKey}`,P=a.map(e=>({key:p(e),label:`${e.header} heading`})),A="diameter",l={textStyle:T.textStyle,...d("label",14),letterSpacing:.06,lineHeight:1.5},N={...T,...d("body",12),letterSpacing:.22,weight:400,lineHeight:1.5},_=a.filter(e=>e.shownByDefault),x={...O,direction:"row",justify:"start",align:"start",share:"equal",phoneRow:2,[r("share")]:"content",[r("wrap")]:"nowrap",widthFit:"fill",gap:32,gapPhone:16,...y(16,16)},m={[r("widthFit")]:"fixed",[r("width")]:120},s=(e,o)=>({type:S,props:{...x,name:e},slots:{[w]:o}}),b=()=>s("Row",_.map(e=>E(e.fieldKey,{...c,name:e.header,tag:"p",...m},e.fieldKey===A?{...l,color:"main"}:l))),W=()=>s("Head",_.map(e=>E(p(e),{...h,name:e.header,tag:"p",...m},N)));function f(e,o,n){const i=new Set(e.map(t=>t.fieldKey));return Object.fromEntries(a.map(t=>[o(t),i.has(t.fieldKey)?n(t):""]))}function k(e,o,n,i){return{key:i,...f(o,t=>t.fieldKey,t=>String(t.cell(e,n)))}}function X(e,o){return{key:"head",...f(e,p,n=>o(n.header))}}export{P as FITMENT_HEAD_FIELDS,D as FITMENT_HEAD_TEMPLATE_LABEL,C as FITMENT_HEAD_TEMPLATE_SLOT,B as FITMENT_ROW_FIELDS,u as FITMENT_ROW_TEMPLATE_LABEL,K as FITMENT_ROW_TEMPLATE_SLOT,k as fitmentCardRow,X as fitmentHeadRow,W as fitmentHeadSeed,b as fitmentRowSeed};
@@ -6,4 +6,14 @@ export declare const FITMENTTABLE_PH: {
6
6
  footnote: string;
7
7
  footnoteLinkText: string;
8
8
  };
9
+ export declare const FitmentTableSlots: {
10
+ headTemplate: {
11
+ type: "slot";
12
+ allow: string[];
13
+ };
14
+ template: {
15
+ type: "slot";
16
+ allow: string[];
17
+ };
18
+ };
9
19
  export declare const FitmentTableMeta: Omit<BlockRender, "render">;
@@ -1 +1 @@
1
- import{PH as t}from"efficient-web-builder/format/lib/document/blocks/placeholders";const e={num:t.sectionNumber,title:"Specifications *table.*",description:t.body,footnote:"Add a short footnote here.",footnoteLinkText:"Contact us"},n={label:"Sizes",defaultProps:{dynamic:!1,num:"",title:"",description:"",wheel:"",showFilter:!0,tooltipDefaultOn:!0,footnote:"",footnoteLinkText:"",footnoteLinkHref:""}};export{e as FITMENTTABLE_PH,n as FitmentTableMeta};
1
+ import{cardTemplateSlot as t}from"efficient-web-builder/format/lib/content/card-template";import{PH as o}from"efficient-web-builder/format/lib/document/blocks/placeholders";import{FITMENT_HEAD_TEMPLATE_SLOT as e}from"../../../../content/fitment-row-seed.js";const a={num:o.sectionNumber,title:"Specifications *table.*",description:o.body,footnote:"Add a short footnote here.",footnoteLinkText:"Contact us"},i={[e]:t(),template:t()},f={label:"Sizes",fields:i,defaultProps:{dynamic:!1,num:"",title:"",description:"",wheel:"",showFilter:!0,tooltipDefaultOn:!0,footnote:"",footnoteLinkText:"",footnoteLinkHref:""}};export{a as FITMENTTABLE_PH,f as FitmentTableMeta,i as FitmentTableSlots};
@@ -1 +1 @@
1
- import{jsx as l}from"react/jsx-runtime";import r from"../../../../../components/pdp-dynamic/FitmentTableBlock.js";import{TYRE_SIZES_HEAD as d}from"../../../../../components/TyreSizeGrid.js";import{hidableText as a}from"efficient-easel/screen/lib/document/hidable";import{parseSectionHeadPlacement as c}from"efficient-web-builder/format/lib/sections/section-head-placement";import{phHide as e,phHideDefault as m}from"efficient-web-builder/render/lib/document/blocks/scaffold";import{FitmentTableMeta as T,FITMENTTABLE_PH as i}from"./meta.js";const F={...T,render:t=>{const o=c(t.headPlacement)==="own-box",n=f=>o?void 0:f;return l(r,{dynamic:t.dynamic,wheel:t.wheel,num:n(e(t.num,i.num,t.editor)),title:n(e(t.title,i.title,t.editor)),description:n(e(t.description,i.description,t.editor)),tyreHead:o?void 0:{title:m(t.title,d.title,t.editor),description:m(t.description,d.description,t.editor)},omitHead:o,showFilter:t.showFilter,tooltipDefaultOn:t.tooltipDefaultOn,footnote:e(t.footnote,i.footnote,t.editor),footnoteLinkText:e(t.footnoteLinkText,i.footnoteLinkText,t.editor),footnoteLinkHref:a(t.footnoteLinkHref),editing:t.editor?.isEditing})}};export{F as FitmentTableRender};
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";const F={...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})}};export{F as FitmentTableRender};
@@ -1 +1 @@
1
- import{CARD_LIST_TYPE as R,CARD_ROW_FIELD_PROP as y,CARD_ROW_LINK_PROP as L,CARD_TEMPLATE_SLOT as d,registerCardTemplates as de}from"efficient-web-builder/format/lib/content/card-template";import{DIM as p,INNER_BOX as o,LABEL_FACE as C,TEXT as n,boxPadding as r,fillSlot as F,labelLook as _,labelStyle as K,seedNodes as k,token as E}from"efficient-web-builder/format/lib/document/seed-parts";import{BOX_SHOW_KEY as M,BOX_SHOW_ON_CARD_HOVER as x,HOVER_KEY as Ee,PICTURE_HOVER_KEYS as Y}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 pe}from"efficient-web-builder/format/lib/post-card-layout";import{EVENTS_FEATURED_DARKEN as _e,EVENTS_FEATURED_DARKEN_STYLE as G,EVENTS_FEATURED_PLACEMENT as ce}from"../content/events-featured-look.js";import{COLLECTION_DARKEN as Te,COLLECTION_HOVER_DARKEN as Oe,COLLECTION_HOVER_ZOOM as U}from"../content/collection-card-look.js";import{COLLECTION_CARD_REGIONS as b,COLLECTION_CARD_TEXT_SIZE as me}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 S}from"../sections/product-grid-columns.js";import{bundleColumns as Le}from"../sections/bundle-to-grid.js";import{HERO_PRICE_BLOCK as be,withHeroPriceTemplate as he}from"../content/hero-price-seed.js";import{HERO_BUY_SLOT as ge,HERO_BUY_SLOT_LABEL as Pe,withHeroBuyTemplate as Re}from"../content/hero-buy-seed.js";import{HERO_OPTION_FIELDS as W,HERO_OPTION_SLOT as ye,HERO_OPTION_SLOT_LABEL as Ce,withHeroOptionTemplate as ke}from"../content/hero-option-seed.js";import{FILTER_OPTIONS_FIELD as fe,withFilterChipsTemplate as Se,withFilterTemplate as Ae}from"../content/filter-card-seed.js";import{FACET_ROW_FIELDS as h,FACET_TEMPLATE_LABEL as v,FACET_TEMPLATE_SLOT as $,withFacetTemplate as X}from"../content/facet-row-seed.js";import{RAIL_HEAD_TEMPLATE_LABEL as ue,RAIL_HEAD_TEMPLATE_SLOT as Ie,RAIL_ROW_FIELDS as A,RAIL_TEMPLATE_LABEL as Ne,RAIL_TEMPLATE_SLOT as we,withRailTemplates as Z}from"../content/rail-row-seed.js";import{MENU_LINK_BLOCK as De,withMenuTemplate as Be}from"../content/menu-card-seed.js";import{CONTACT_CHANNEL_FIELDS as j,CONTACT_CHANNEL_SLOT as He,CONTACT_REASON_FIELDS as Fe,CONTACT_REASON_SLOT as Ke,CONTACT_TOPIC_FIELDS as z,CONTACT_TOPIC_SLOT as Me,withContactTemplates as xe}from"../content/contact-card-seed.js";import{ARTICLE_BODY_BLOCK as Ye,withArticleBodyTemplate as Ge}from"efficient-web-builder/format/lib/document/article-body-seed";import{APPOINTMENT_BOOKING_TYPE as Ue,BOOKING_BOX_TYPE as Ve,BOOKING_OPTION_FIELDS as We,BOOKING_TEMPLATE_SLOTS as ve,withBookingTemplates as $e}from"../content/booking-card-seed.js";import{PRODUCT_BUY_BLOCK as Xe,PRODUCT_CARD_FIELDS as u,PRODUCT_COLOUR_BLOCK as Ze,PRODUCT_EYEBROW_BLOCK as je,PRODUCT_NAME_BLOCK as ze,PRODUCT_PICTURE_BLOCK as qe,PRODUCT_PRICE_BLOCK as Qe,PRODUCT_SIZE_BLOCK as Je,PRODUCT_SPECS_BLOCK as et,productCardSeed as tt,withKitCardTemplate as I,withListingCardTemplate as lt,withProductCardTemplate as N}from"../content/product-card-seed.js";import{ALLOY_WHEELS_LISTING_TYPE as ot,FILTER_BLOCK_TYPE as at,FILTER_CHIPS_TYPE as it,MENU_BLOCK_TYPE as nt,PRODUCT_GRID_TYPE as rt,PRODUCT_HERO_TYPE as st}from"./document-nodes.js";import{withSeededSlot as w}from"../content/seed-ids.js";const q="tags",c=_(12),Q={textStyle:"heading-3",...E("headingSmall",20),weight:500,lineHeight:1.2,letterSpacing:-.02},J={textStyle:"body-1",...E("body",14),lineHeight:1.55},dt={...Q,...E("headingSmall",30)},Et={sectionPaddingTop:24,sectionPaddingRight:28,sectionPaddingBottom:32,sectionPaddingLeft:28,sectionPaddingTopPhone:24,sectionPaddingRightPhone:28,sectionPaddingBottomPhone:32,sectionPaddingLeftPhone:28},pt=pe.fallback,_t=480,ct=70,Tt=()=>({type:a,props:{...o,name:"Featured",[f]:"cover",darken:_e,darkenStyle:G,darkenPhone:ct,darkenStylePhone:G,placement:ce,direction:"column",gap:8,gapPhone:8,...r(32,32,20,20),sectionHeightMode:"fixed",sectionHeightValue:pt,sectionHeightUnit:"px",sectionHeightModePhone:"fixed",sectionHeightValuePhone:_t,sectionHeightUnitPhone:"px",[L]:"href"},slots:{[i]:[t("meta",{...n,tag:"p"},c,!0),t("title",{...n,tag:"h3",widthFit:"fill"},dt),t("excerpt",{...p,tag:"p",widthFit:"fill",maxWidth:384},J),t("dateLabel",{...p,tag:"p"},{...c,color:"muted"})]}}),Ot=()=>({type:a,props:{...o,name:"Post",gap:0,gapPhone:0,...r(0,0,0,0),...F("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,...Et},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"},c,!0),t("dateLabel",{...p,tag:"p"},{...c,color:"muted"},!0)]}},t("title",{...n,tag:"h3",widthFit:"fill"},Q),t("excerpt",{...p,tag:"p",widthFit:"fill"},J),{type:R,props:{[y]:q},slots:{template:[{type:a,props:{...o,name:"Chip",...r(4,8,4,8),sectionBorder:{width:1}},slots:{[i]:[t("label",{...p,tag:"p"},c)]}}]}},{type:"ButtonBlock",props:{variant:"ghost",label:"Read more",href:"",[L]:"href",...V,icon:"arrow-right",iconPosition:"after",_partStyles:{label:K(12)}}}]}}]}}),mt=()=>[Tt(),Ot()];function Lt(e){const l=["featured","post"];return w(e,d,"Events",m=>k(mt(),(s,se)=>{const[D,...B]=se.split("."),H=l[Number(D)]??`card${D}`;return B.length?`${m}~${H}.${B.join(".")}`:`${m}~${H}`}))}const bt={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:q,label:"Tags",kind:"list",fields:[{key:"label",label:"Tag"}]}],blocks:[{type:R,label:"Card list"}],seedOnInsert:Lt},T=e=>Number(/(\d+)px/.exec(e)?.[1]),O={tag:T(b.tag.builtIn),name:T(b.name.builtIn),namePhone:T(me.namePhone),body:T(b.body.builtIn),link:T(b.link.builtIn)},ht={..._(O.tag),letterSpacing:.25},gt={textStyle:"heading-2",...E("headingMedium",O.name,O.namePhone),weight:500,lineHeight:1,letterSpacing:-.03},Pt={textStyle:"body-1",...E("body",O.body),lineHeight:1.5,paragraphSpacing:12},ee=()=>[t("tag",{...n,tag:"p"},ht,!0),t("name",{...n,tag:"h3",widthFit:"fill"},gt),t("desc",{...n,tag:"p",widthFit:"fill",maxWidth:420},Pt),{type:"ButtonBlock",props:{variant:"ghost",label:"Explore",href:"",[L]:"href",...V,icon:"arrow-right",iconPosition:"after",_partStyles:{label:K(O.link)}}}],te={_hidden:!0,_hiddenTablet:!0,_hiddenPhone:!1},Rt=()=>({type:a,props:{...o,name:"Collection",gap:0,gapPhone:0,...r(0,0,0,0),[L]:"href"},slots:{[i]:[{type:a,props:{...o,name:"Picture",[f]:"image",boxShape:"portrait",darken:Te,placement:"bottom-left",direction:"column",gap:12,gapPhone:12,...r(32,32),hoverZoom:U,hoverDarken:Oe,_hiddenPhone:!0},slots:{[i]:ee()}},{type:"ImageBlock",props:{[y]:"image",aspect:"4/5",contained:!1,hoverZoom:U,...te}},{type:a,props:{...o,name:"Words",gap:12,gapPhone:12,...r(24,24),...F("surface"),...te},slots:{[i]:ee()}}]}});function yt(e){return w(e,d,"Collections",l=>k([Rt()],(m,s)=>`${l}~card${s?`.${s}`:""}`))}const Ct={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:yt},kt=35,ft=50,St=106,At=85,ut="nextImage",It="#f5f1e8",le="#c4c1ba",oe={...C,..._(11),letterSpacing:.24,color:"main"},Nt={...oe,color:le},wt={...C,..._(12,11),color:"main"},Dt={textStyle:"heading-3",...E("headingSmall",22,16),weight:500,lineHeight:1.05,letterSpacing:-.02,color:It},Bt={...C,..._(12),letterSpacing:.12,color:le},g=r(0,0,0,0),Ht=()=>({type:a,props:{...o,name:"Tile",placement:"top-left",share:"content",gap:0,gapPhone:0,...g,[f]:"image",boxShape:"square",darken:kt,[Ee]:ut,[Y.zoom]:St,[Y.darken]:ft},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]:x},slots:{[i]:[t("tag",{...n,tag:"p",textFit:"ellipsis"},oe)]}},t("number",{...n,tag:"p",textFit:"line"},Nt)]}},{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:At,darkenStyle:"bottom",[M]:x},slots:{[i]:[{type:a,props:{...o,name:"Heading",widthFit:"fill",gap:4,gapPhone:4,...g},slots:{[i]:[t("eyebrow",{...n,tag:"p",_hiddenPhone:!0},wt),t("name",{...n,tag:"h3"},Dt)]}},t("meta",{...n,tag:"p"},Bt)]}}]}});function Ft(e){return w(e,d,"GalleryB",l=>k([Ht()],(m,s)=>`${l}~tile${s?`.${s}`:""}`))}const Kt={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:Ft},Mt=["showCardPrice","showCardFinishes","showCardSizes","showCardBuy","showCardPage"],xt=e=>Object.fromEntries(Object.entries(e).filter(([l])=>!Mt.includes(l))),ae={fields:[{key:"label",label:"Label"},{key:"href",label:"Link",kind:"link"}],blocks:[{type:De,label:"Menu link"}],seed:Be},ie=e=>e.dynamic===!0&&e.relationship==="bundles",cl=(e={})=>tt(e),P={fields:u,blocks:[{type:qe,label:"Picture"},{type:je,label:"Eyebrow"},{type:ze,label:"Name"},{type:et,label:"Specs"},{type:Qe,label:"Price"},{type:Ze,label:"Colour"},{type:Je,label:"Size"},{type:Xe,label:"Buy"}],seed:e=>{if(e.dynamic!==!0)return N(e);const l=S(e);return ie(e)?I(l):N(l)}},ne=[{key:"label",label:"Filter name"},{key:fe,label:"Options",kind:"list",fields:[{key:"label",label:"Option"},{key:"count",label:"Count"}]}],re=[{slot:we,label:Ne,fields:A},{slot:Ie,label:ue,fields:[]}],Yt=[{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",...ae},{block:nt,...ae},{block:rt,...P},{block:ot,...P,slots:[{slot:d,fields:u},{slot:$,label:v,fields:h},...re],fields:[...u,...h,...A],seed:e=>Z(X(lt(e)))},{block:"RelatedProducts",...P,seed:e=>{const l=S({...xt(e),dynamic:!0});return ie(l)?I(l):N(l,{legacyWellHonoured:!0})}},{block:"BundleOffer",...P,seed:e=>I(S({...e,columns:Le(e),dynamic:!0}))},{block:st,slots:[{slot:d,fields:[]},{slot:ye,label:Ce,fields:W},{slot:ge,label:Pe,fields:[]}],fields:W,blocks:[{type:be,label:"Price"}],seed:e=>Re(ke(he(e)))},{block:at,slots:[{slot:d,fields:ne},{slot:$,label:v,fields:h},...re],fields:[...ne,...h,...A],blocks:[{type:R,label:"Card list"}],seed:e=>Z(X(Ae(e)))},{block:it,fields:[{key:"label",label:"Pick"},{key:"mark",label:"Remove mark"}],seed:Se},{block:"ContactRouting",slots:[{slot:Me,label:"Topic card",fields:z},{slot:Ke,label:"Reason chip",fields:Fe},{slot:He,label:"Channel row",fields:j}],fields:[...z,...j],seed:xe},{block:Ye,fields:[{key:"heading",label:"Subhead"},{key:"paragraph",label:"Paragraph",multiline:!0}],seed:Ge},...[Ve,Ue].map(e=>({block:e,slots:ve,fields:We,seed:l=>$e(e,l)})),{block:"Events",...bt},{block:"Collections",...Ct},{block:"GalleryB",...Kt}];de(Yt);export{Yt as STOREFRONT_CARD_TEMPLATES,Rt as collectionCardSeed,ie as drawsKits,mt as eventsCardSeeds,Ht as galleryTileSeed,cl as productGridCardSeed,yt as withCollectionsTemplate,Lt as withEventsTemplate,Ft 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 de}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 f,token as _}from"efficient-web-builder/format/lib/document/seed-parts";import{BOX_SHOW_KEY as M,BOX_SHOW_ON_CARD_HOVER as x,HOVER_KEY as Te,PICTURE_HOVER_KEYS as Y}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 k}from"efficient-web-builder/format/lib/content/box-card-rule";import{POST_CARD_HEIGHT as pe}from"efficient-web-builder/format/lib/post-card-layout";import{EVENTS_FEATURED_DARKEN as ce,EVENTS_FEATURED_DARKEN_STYLE as G,EVENTS_FEATURED_PLACEMENT as Oe}from"../content/events-featured-look.js";import{COLLECTION_DARKEN as Le,COLLECTION_HOVER_DARKEN as me,COLLECTION_HOVER_ZOOM as U}from"../content/collection-card-look.js";import{COLLECTION_CARD_REGIONS as b,COLLECTION_CARD_TEXT_SIZE as be}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 S}from"../sections/product-grid-columns.js";import{bundleColumns as he}from"../sections/bundle-to-grid.js";import{HERO_PRICE_BLOCK as ge,withHeroPriceTemplate as Pe}from"../content/hero-price-seed.js";import{HERO_BUY_SLOT as Re,HERO_BUY_SLOT_LABEL as ye,withHeroBuyTemplate as Ce}from"../content/hero-buy-seed.js";import{HERO_OPTION_FIELDS as W,HERO_OPTION_SLOT as fe,HERO_OPTION_SLOT_LABEL as ke,withHeroOptionTemplate as Se}from"../content/hero-option-seed.js";import{FILTER_OPTIONS_FIELD as Ae,withFilterChipsTemplate as Ie,withFilterTemplate as ue}from"../content/filter-card-seed.js";import{FACET_ROW_FIELDS as h,FACET_TEMPLATE_LABEL as v,FACET_TEMPLATE_SLOT as $,withFacetTemplate as X}from"../content/facet-row-seed.js";import{RAIL_HEAD_TEMPLATE_LABEL as Ne,RAIL_HEAD_TEMPLATE_SLOT as De,RAIL_ROW_FIELDS as A,RAIL_TEMPLATE_LABEL as we,RAIL_TEMPLATE_SLOT as Be,withRailTemplates as Z}from"../content/rail-row-seed.js";import{MENU_LINK_BLOCK as Fe,withMenuTemplate as He}from"../content/menu-card-seed.js";import{CONTACT_CHANNEL_FIELDS as j,CONTACT_CHANNEL_SLOT as Ke,CONTACT_REASON_FIELDS as Me,CONTACT_REASON_SLOT as xe,CONTACT_TOPIC_FIELDS as z,CONTACT_TOPIC_SLOT as Ye,withContactTemplates as Ge}from"../content/contact-card-seed.js";import{ARTICLE_BODY_BLOCK as Ue,withArticleBodyTemplate as Ve}from"efficient-web-builder/format/lib/document/article-body-seed";import{APPOINTMENT_BOOKING_TYPE as We,BOOKING_BOX_TYPE as ve,BOOKING_OPTION_FIELDS as $e,BOOKING_TEMPLATE_SLOTS as Xe,withBookingTemplates as Ze}from"../content/booking-card-seed.js";import{PRODUCT_BUY_BLOCK as je,PRODUCT_CARD_FIELDS as I,PRODUCT_COLOUR_BLOCK as ze,PRODUCT_EYEBROW_BLOCK as qe,PRODUCT_NAME_BLOCK as Qe,PRODUCT_PICTURE_BLOCK as Je,PRODUCT_PRICE_BLOCK as et,PRODUCT_SIZE_BLOCK as tt,PRODUCT_SPECS_BLOCK as lt,productCardSeed as ot,withKitCardTemplate as u,withListingCardTemplate as at,withProductCardTemplate as N}from"../content/product-card-seed.js";import{ALLOY_WHEELS_LISTING_TYPE as it,FILTER_BLOCK_TYPE as nt,FILTER_CHIPS_TYPE as rt,MENU_BLOCK_TYPE as st,PRODUCT_GRID_TYPE as Et,PRODUCT_HERO_TYPE as _t}from"./document-nodes.js";import{withSeededSlot as D}from"../content/seed-ids.js";import{FITMENT_HEAD_FIELDS as q,FITMENT_HEAD_TEMPLATE_LABEL as dt,FITMENT_HEAD_TEMPLATE_SLOT as Tt,FITMENT_ROW_FIELDS as Q,FITMENT_ROW_TEMPLATE_LABEL as pt,FITMENT_ROW_TEMPLATE_SLOT as ct}from"../content/fitment-row-seed.js";const J="tags",p=T(12),ee={textStyle:"heading-3",..._("headingSmall",20),weight:500,lineHeight:1.2,letterSpacing:-.02},te={textStyle:"body-1",..._("body",14),lineHeight:1.55},Ot={...ee,..._("headingSmall",30)},Lt={sectionPaddingTop:24,sectionPaddingRight:28,sectionPaddingBottom:32,sectionPaddingLeft:28,sectionPaddingTopPhone:24,sectionPaddingRightPhone:28,sectionPaddingBottomPhone:32,sectionPaddingLeftPhone:28},mt=pe.fallback,bt=480,ht=70,gt=()=>({type:a,props:{...o,name:"Featured",[k]:"cover",darken:ce,darkenStyle:G,darkenPhone:ht,darkenStylePhone:G,placement:Oe,direction:"column",gap:8,gapPhone:8,...r(32,32,20,20),sectionHeightMode:"fixed",sectionHeightValue:mt,sectionHeightUnit:"px",sectionHeightModePhone:"fixed",sectionHeightValuePhone:bt,sectionHeightUnitPhone:"px",[m]:"href"},slots:{[i]:[t("meta",{...n,tag:"p"},p,!0),t("title",{...n,tag:"h3",widthFit:"fill"},Ot),t("excerpt",{...d,tag:"p",widthFit:"fill",maxWidth:384},te),t("dateLabel",{...d,tag:"p"},{...p,color:"muted"})]}}),Pt=()=>({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,...Lt},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"},ee),t("excerpt",{...d,tag:"p",widthFit:"fill"},te),{type:R,props:{[y]:J},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)}}}]}}]}}),Rt=()=>[gt(),Pt()];function yt(e){const l=["featured","post"];return D(e,E,"Events",L=>f(Rt(),(s,_e)=>{const[w,...B]=_e.split("."),F=l[Number(w)]??`card${w}`;return B.length?`${L}~${F}.${B.join(".")}`:`${L}~${F}`}))}const Ct={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:J,label:"Tags",kind:"list",fields:[{key:"label",label:"Tag"}]}],blocks:[{type:R,label:"Card list"}],seedOnInsert:yt},c=e=>Number(/(\d+)px/.exec(e)?.[1]),O={tag:c(b.tag.builtIn),name:c(b.name.builtIn),namePhone:c(be.namePhone),body:c(b.body.builtIn),link:c(b.link.builtIn)},ft={...T(O.tag),letterSpacing:.25},kt={textStyle:"heading-2",..._("headingMedium",O.name,O.namePhone),weight:500,lineHeight:1,letterSpacing:-.03},St={textStyle:"body-1",..._("body",O.body),lineHeight:1.5,paragraphSpacing:12},le=()=>[t("tag",{...n,tag:"p"},ft,!0),t("name",{...n,tag:"h3",widthFit:"fill"},kt),t("desc",{...n,tag:"p",widthFit:"fill",maxWidth:420},St),{type:"ButtonBlock",props:{variant:"ghost",label:"Explore",href:"",[m]:"href",...V,icon:"arrow-right",iconPosition:"after",_partStyles:{label:K(O.link)}}}],oe={_hidden:!0,_hiddenTablet:!0,_hiddenPhone:!1},At=()=>({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",[k]:"image",boxShape:"portrait",darken:Le,placement:"bottom-left",direction:"column",gap:12,gapPhone:12,...r(32,32),hoverZoom:U,hoverDarken:me,_hiddenPhone:!0},slots:{[i]:le()}},{type:"ImageBlock",props:{[y]:"image",aspect:"4/5",contained:!1,hoverZoom:U,...oe}},{type:a,props:{...o,name:"Words",gap:12,gapPhone:12,...r(24,24),...H("surface"),...oe},slots:{[i]:le()}}]}});function It(e){return D(e,E,"Collections",l=>f([At()],(L,s)=>`${l}~card${s?`.${s}`:""}`))}const ut={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:It},Nt=35,Dt=50,wt=106,Bt=85,Ft="nextImage",Ht="#f5f1e8",ae="#c4c1ba",ie={...C,...T(11),letterSpacing:.24,color:"main"},Kt={...ie,color:ae},Mt={...C,...T(12,11),color:"main"},xt={textStyle:"heading-3",..._("headingSmall",22,16),weight:500,lineHeight:1.05,letterSpacing:-.02,color:Ht},Yt={...C,...T(12),letterSpacing:.12,color:ae},g=r(0,0,0,0),Gt=()=>({type:a,props:{...o,name:"Tile",placement:"top-left",share:"content",gap:0,gapPhone:0,...g,[k]:"image",boxShape:"square",darken:Nt,[Te]:Ft,[Y.zoom]:wt,[Y.darken]:Dt},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]:x},slots:{[i]:[t("tag",{...n,tag:"p",textFit:"ellipsis"},ie)]}},t("number",{...n,tag:"p",textFit:"line"},Kt)]}},{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:Bt,darkenStyle:"bottom",[M]:x},slots:{[i]:[{type:a,props:{...o,name:"Heading",widthFit:"fill",gap:4,gapPhone:4,...g},slots:{[i]:[t("eyebrow",{...n,tag:"p",_hiddenPhone:!0},Mt),t("name",{...n,tag:"h3"},xt)]}},t("meta",{...n,tag:"p"},Yt)]}}]}});function Ut(e){return D(e,E,"GalleryB",l=>f([Gt()],(L,s)=>`${l}~tile${s?`.${s}`:""}`))}const Vt={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:Ut},Wt=["showCardPrice","showCardFinishes","showCardSizes","showCardBuy","showCardPage"],vt=e=>Object.fromEntries(Object.entries(e).filter(([l])=>!Wt.includes(l))),ne={fields:[{key:"label",label:"Label"},{key:"href",label:"Link",kind:"link"}],blocks:[{type:Fe,label:"Menu link"}],seed:He},re=e=>e.dynamic===!0&&e.relationship==="bundles",gl=(e={})=>ot(e),P={fields:I,blocks:[{type:Je,label:"Picture"},{type:qe,label:"Eyebrow"},{type:Qe,label:"Name"},{type:lt,label:"Specs"},{type:et,label:"Price"},{type:ze,label:"Colour"},{type:tt,label:"Size"},{type:je,label:"Buy"}],seed:e=>{if(e.dynamic!==!0)return N(e);const l=S(e);return re(e)?u(l):N(l)}},se=[{key:"label",label:"Filter name"},{key:Ae,label:"Options",kind:"list",fields:[{key:"label",label:"Option"},{key:"count",label:"Count"}]}],Ee=[{slot:Be,label:we,fields:A},{slot:De,label:Ne,fields:[]}],$t=[{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",...ne},{block:st,...ne},{block:Et,...P},{block:it,...P,slots:[{slot:E,fields:I},{slot:$,label:v,fields:h},...Ee],fields:[...I,...h,...A],seed:e=>Z(X(at(e)))},{block:"RelatedProducts",...P,seed:e=>{const l=S({...vt(e),dynamic:!0});return re(l)?u(l):N(l,{legacyWellHonoured:!0})}},{block:"BundleOffer",...P,seed:e=>u(S({...e,columns:he(e),dynamic:!0}))},{block:_t,slots:[{slot:E,fields:[]},{slot:fe,label:ke,fields:W},{slot:Re,label:ye,fields:[]}],fields:W,blocks:[{type:ge,label:"Price"}],seed:e=>Ce(Se(Pe(e)))},{block:nt,slots:[{slot:E,fields:se},{slot:$,label:v,fields:h},...Ee],fields:[...se,...h,...A],blocks:[{type:R,label:"Card list"}],seed:e=>Z(X(ue(e)))},{block:rt,fields:[{key:"label",label:"Pick"},{key:"mark",label:"Remove mark"}],seed:Ie},{block:"ContactRouting",slots:[{slot:Ye,label:"Topic card",fields:z},{slot:xe,label:"Reason chip",fields:Me},{slot:Ke,label:"Channel row",fields:j}],fields:[...z,...j],seed:Ge},{block:Ue,fields:[{key:"heading",label:"Subhead"},{key:"paragraph",label:"Paragraph",multiline:!0}],seed:Ve},...[ve,We].map(e=>({block:e,slots:Xe,fields:$e,seed:l=>Ze(e,l)})),{block:"Events",...Ct},{block:"Collections",...ut},{block:"GalleryB",...Vt},{block:"FitmentTable",fields:[...q,...Q],slots:[{slot:Tt,label:dt,fields:q},{slot:ct,label:pt,fields:Q}]}];de($t);export{$t as STOREFRONT_CARD_TEMPLATES,At as collectionCardSeed,re as drawsKits,Rt as eventsCardSeeds,Gt as galleryTileSeed,gl as productGridCardSeed,It as withCollectionsTemplate,yt as withEventsTemplate,Ut as withGalleryTemplate};
@@ -7,6 +7,7 @@ import "./section-to-box-rows-productgrid.js";
7
7
  import "./section-to-box-rows-events.js";
8
8
  import "./section-to-box-rows-collections.js";
9
9
  import "./section-to-box-rows-gallery.js";
10
+ import "./section-to-box-rows-fitment.js";
10
11
  import "./section-to-box-rows-detail.js";
11
12
  import "./section-to-box-rows-service.js";
12
13
  import "./section-to-box-rows-listing.js";
@@ -1 +1 @@
1
- import{Fragment as h,jsx as E}from"react/jsx-runtime";import{generalRenderMetas as g}from"efficient-web-builder/format/lib/document/blocks/general/metas";import{finishRenderRegistry as S}from"efficient-web-builder/render/lib/document/render-registry";import{buildBlockCategories as R}from"efficient-web-builder/format/lib/document/section-catalog";import{SITE_HEADER_TYPE as a}from"efficient-web-builder/format/lib/document/section-groups";import"./slot-seeds.js";import"./card-templates.js";import"./section-to-box-rows-reviews.js";import"./section-to-box-rows-spec.js";import"./section-to-box-rows-productgrid.js";import"./section-to-box-rows-events.js";import"./section-to-box-rows-collections.js";import"./section-to-box-rows-gallery.js";import"./section-to-box-rows-detail.js";import"./section-to-box-rows-service.js";import"./section-to-box-rows-listing.js";import{COMMERCE_METAS as _}from"./blocks/commerce/metas.js";import{SERVICE_METAS as O}from"./blocks/service/metas.js";import P from"./blocks/text-part-shapes.json";import{addPageBlocksFromFooter as b}from"./footer-page-blocks.js";import{LAZY_DRAWS as f}from"./lazy-draws.js";import{drawPublishedStorefrontRoot as k}from"./storefront-root.js";import{withShopperAddressMark as T}from"../../components/catalog/ShopperScope.js";import{SHOPPER_BLOCK_TYPES as j}from"../wheels/shopper-first-paint.js";const l=P,w=(t,e)=>{const r=Object.hasOwn(l,t)?l[t]:void 0;return{...e,...r?{textParts:r}:null}};let p=null;function d(){if(p)return p;const t={},e=g();for(const o of Object.keys(e))t[o]={...e[o],render:f[o]};const r={..._,...O};for(const o of Object.keys(r)){const m=j.has(o)?T(f[o]):f[o];t[o]=w(o,{...r[o],render:m})}b(t);const n={root:{render:k},categories:R(),components:t};return S(n),p=n,n}function x(t=d()){const e=t.components,r=Object.keys(e),n=new Set([a]),o=[a];for(;o.length;){const m=o.shift();for(const c of Object.values(e[m]?.fields??{})){if(c?.type!=="slot")continue;const u=c.allow??r.filter(s=>!c.disallow?.includes(s));for(const s of u)n.has(s)||!(s in e)||(n.add(s),o.push(s))}}return[...n]}let i=null;function $(){if(i)return i;const t=d(),e=t.components;return i={...t,root:{render:({children:r})=>E(h,{children:r})},components:Object.fromEntries(x(t).map(r=>[r,e[r]]))},i}export{w as drawnBlock,$ as headerRenderConfig,d as renderConfig};
1
+ import{Fragment as h,jsx as E}from"react/jsx-runtime";import{generalRenderMetas as g}from"efficient-web-builder/format/lib/document/blocks/general/metas";import{finishRenderRegistry as S}from"efficient-web-builder/render/lib/document/render-registry";import{buildBlockCategories as R}from"efficient-web-builder/format/lib/document/section-catalog";import{SITE_HEADER_TYPE as a}from"efficient-web-builder/format/lib/document/section-groups";import"./slot-seeds.js";import"./card-templates.js";import"./section-to-box-rows-reviews.js";import"./section-to-box-rows-spec.js";import"./section-to-box-rows-productgrid.js";import"./section-to-box-rows-events.js";import"./section-to-box-rows-collections.js";import"./section-to-box-rows-gallery.js";import"./section-to-box-rows-fitment.js";import"./section-to-box-rows-detail.js";import"./section-to-box-rows-service.js";import"./section-to-box-rows-listing.js";import{COMMERCE_METAS as _}from"./blocks/commerce/metas.js";import{SERVICE_METAS as O}from"./blocks/service/metas.js";import P from"./blocks/text-part-shapes.json";import{addPageBlocksFromFooter as b}from"./footer-page-blocks.js";import{LAZY_DRAWS as p}from"./lazy-draws.js";import{drawPublishedStorefrontRoot as k}from"./storefront-root.js";import{withShopperAddressMark as T}from"../../components/catalog/ShopperScope.js";import{SHOPPER_BLOCK_TYPES as j}from"../wheels/shopper-first-paint.js";const l=P,w=(t,e)=>{const r=Object.hasOwn(l,t)?l[t]:void 0;return{...e,...r?{textParts:r}:null}};let f=null;function d(){if(f)return f;const t={},e=g();for(const o of Object.keys(e))t[o]={...e[o],render:p[o]};const r={..._,...O};for(const o of Object.keys(r)){const m=j.has(o)?T(p[o]):p[o];t[o]=w(o,{...r[o],render:m})}b(t);const n={root:{render:k},categories:R(),components:t};return S(n),f=n,n}function x(t=d()){const e=t.components,r=Object.keys(e),n=new Set([a]),o=[a];for(;o.length;){const m=o.shift();for(const c of Object.values(e[m]?.fields??{})){if(c?.type!=="slot")continue;const u=c.allow??r.filter(s=>!c.disallow?.includes(s));for(const s of u)n.has(s)||!(s in e)||(n.add(s),o.push(s))}}return[...n]}let i=null;function oo(){if(i)return i;const t=d(),e=t.components;return i={...t,root:{render:({children:r})=>E(h,{children:r})},components:Object.fromEntries(x(t).map(r=>[r,e[r]]))},i}export{w as drawnBlock,oo as headerRenderConfig,d as renderConfig};
@@ -0,0 +1 @@
1
+ import{registerSectionToBox as t}from"efficient-web-builder/render/lib/sections/section-to-box";import{headOnlyRow as e}from"efficient-web-builder/render/lib/document/blocks/general/section-to-box-rows-head";import{lineSides as m}from"efficient-web-builder/render/lib/document/blocks/general/section-to-box-row-parts";import{FITMENT_HEAD_TEMPLATE_SLOT as r,FITMENT_ROW_TEMPLATE_SLOT as i,fitmentHeadSeed as n,fitmentRowSeed as T}from"../content/fitment-row-seed.js";import{bandRoomBelow as E}from"../sections/section-band.js";import{SPEC_TABLE_BAND as b}from"../sections/spec-table-band.js";const o=E(b.ownBox);t({FitmentTable:e("FitmentTable",{slots:{[i]:[T()],[r]:[n()]},roomBelow:{bottom:o.bottom,bottomPhone:o.bottomPhone},boxProps:o.line?{sectionBorder:m({bottom:1})}:{},pressHeading:!0})});
package/dist/words.d.ts CHANGED
@@ -1833,6 +1833,7 @@ export type StorefrontBlocksPhrase =
1833
1833
  | "Group covers"
1834
1834
  | "Group {n}"
1835
1835
  | "Groups"
1836
+ | "Head template"
1836
1837
  | "Header button"
1837
1838
  | "Header link"
1838
1839
  | "Header settings"
@@ -2095,6 +2096,7 @@ export type StorefrontBlocksPhrase =
2095
2096
  | "Rim Profile"
2096
2097
  | "Routing groups"
2097
2098
  | "Row shape"
2099
+ | "Row template"
2098
2100
  | "Row {n}"
2099
2101
  | "Rows from"
2100
2102
  | "S"