efficient-storefront-blocks 0.91.0 → 0.92.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 (101) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/chunks/{EditorPreviewCheckout-NFLTZCIQ.js → EditorPreviewCheckout-VHPWPS3N.js} +1 -1
  3. package/dist/chunks/{SiteEditorProvider-UWRLDKJS.js → SiteEditorProvider-C4HT4BT4.js} +1 -1
  4. package/dist/chunks/chunk-7L5DVQZ4.js +1 -0
  5. package/dist/chunks/chunk-PW7BA4ZJ.js +1 -0
  6. package/dist/chunks/{chunk-HRTZ7SYX.js → chunk-RAOSZKA3.js} +1 -1
  7. package/dist/chunks/chunk-S2WLJ6H2.js +388 -0
  8. package/dist/chunks/{fitment-data-6KHIA3AT.js → fitment-data-URJZ24LU.js} +1 -1
  9. package/dist/contract.js +11 -11
  10. package/dist/editor/lib/document/blocks/commerce/AlloyWheelsListing/fields.js +1 -1
  11. package/dist/editor/lib/document/blocks/commerce/index.d.ts +1 -1
  12. package/dist/editor/lib/document/blocks/service/AppointmentBooking/fields.js +1 -1
  13. package/dist/editor/lib/document/blocks/service/ContactRouting/fields.js +1 -1
  14. package/dist/editor/lib/document/blocks/service/Events/fields.js +1 -1
  15. package/dist/editor/lib/document/blocks/service/index.d.ts +1 -1
  16. package/dist/editor/lib/document/config.d.ts +2 -0
  17. package/dist/editor/lib/document/config.js +1 -1
  18. package/dist/editor/lib/storefront-editor-words.d.ts +2 -7
  19. package/dist/editor/lib/storefront-editor-words.js +1 -1
  20. package/dist/editor.css +1 -1
  21. package/dist/index.js +53 -39
  22. package/dist/links.js +1 -1
  23. package/dist/render/built-with.json +1 -1
  24. package/dist/render/components/AppointmentBooking.d.ts +2 -1
  25. package/dist/render/components/AppointmentBooking.js +1 -1
  26. package/dist/render/components/ContactRouting.d.ts +2 -1
  27. package/dist/render/components/ContactRouting.js +1 -1
  28. package/dist/render/components/Events.d.ts +3 -1
  29. package/dist/render/components/Events.js +1 -1
  30. package/dist/render/components/GridCardTemplate.d.ts +30 -1
  31. package/dist/render/components/GridCardTemplate.js +1 -1
  32. package/dist/render/components/ProductGridSection.d.ts +2 -1
  33. package/dist/render/components/ProductGridSection.js +1 -1
  34. package/dist/render/components/PublishedFooter.js +1 -1
  35. package/dist/render/components/PublishedHeader.js +1 -1
  36. package/dist/render/components/RatingBlockView.d.ts +5 -0
  37. package/dist/render/components/RatingBlockView.js +1 -0
  38. package/dist/render/components/ReviewForm.js +1 -1
  39. package/dist/render/components/TyrePlpCard.d.ts +2 -1
  40. package/dist/render/components/TyrePlpCard.js +1 -1
  41. package/dist/render/components/TyreSummaryCard.d.ts +2 -1
  42. package/dist/render/components/TyreSummaryCard.js +1 -1
  43. package/dist/render/components/WheelCardFrame.d.ts +1 -2
  44. package/dist/render/components/WheelCardFrame.js +1 -1
  45. package/dist/render/components/card-pieces/CardPicture.d.ts +1 -1
  46. package/dist/render/components/card-pieces/CardProductPicture.js +1 -1
  47. package/dist/render/components/wheels-plp/AlloyWheelsListing.d.ts +5 -14
  48. package/dist/render/components/wheels-plp/AlloyWheelsListing.js +1 -1
  49. package/dist/render/lib/api/index.d.ts +3 -1
  50. package/dist/render/lib/api/index.js +1 -1
  51. package/dist/render/lib/chrome-cache.d.ts +1 -0
  52. package/dist/render/lib/chrome-cache.js +1 -1
  53. package/dist/render/lib/content/events-featured-look.d.ts +3 -0
  54. package/dist/render/lib/content/events-featured-look.js +1 -0
  55. package/dist/render/lib/content/product-card-seed.d.ts +7 -0
  56. package/dist/render/lib/content/product-card-seed.js +1 -1
  57. package/dist/render/lib/content/rating.d.ts +1 -0
  58. package/dist/render/lib/content/rating.js +1 -0
  59. package/dist/render/lib/document/blocks/commerce/AlloyWheelsListing/meta.d.ts +6 -0
  60. package/dist/render/lib/document/blocks/commerce/AlloyWheelsListing/meta.js +1 -1
  61. package/dist/render/lib/document/blocks/commerce/AlloyWheelsListing/render.js +1 -1
  62. package/dist/render/lib/document/blocks/commerce/ProductColour/render.js +1 -1
  63. package/dist/render/lib/document/blocks/commerce/ProductEyebrow/render.js +1 -1
  64. package/dist/render/lib/document/blocks/commerce/ProductGrid/render.js +1 -1
  65. package/dist/render/lib/document/blocks/commerce/ProductPrice/render.js +1 -1
  66. package/dist/render/lib/document/blocks/commerce/ProductSpecs/render.js +1 -1
  67. package/dist/render/lib/document/blocks/service/AppointmentBooking/render.js +1 -1
  68. package/dist/render/lib/document/blocks/service/ContactRouting/render.js +1 -1
  69. package/dist/render/lib/document/blocks/service/Events/meta.d.ts +6 -0
  70. package/dist/render/lib/document/blocks/service/Events/meta.js +1 -1
  71. package/dist/render/lib/document/blocks/service/Events/render.js +1 -1
  72. package/dist/render/lib/document/blocks/service/RatingBlock/meta.d.ts +2 -1
  73. package/dist/render/lib/document/blocks/service/RatingBlock/meta.js +1 -1
  74. package/dist/render/lib/document/blocks/service/RatingBlock/render.js +1 -1
  75. package/dist/render/lib/document/card-templates.d.ts +3 -1
  76. package/dist/render/lib/document/card-templates.js +1 -1
  77. package/dist/render/lib/document/published-chrome-data.d.ts +2 -0
  78. package/dist/render/lib/document/published-chrome-data.js +1 -0
  79. package/dist/render/lib/document/render-config.d.ts +2 -0
  80. package/dist/render/lib/document/render-config.js +1 -1
  81. package/dist/render/lib/document/section-to-box-rows-detail.js +1 -1
  82. package/dist/render/lib/document/section-to-box-rows-events.d.ts +1 -0
  83. package/dist/render/lib/document/section-to-box-rows-events.js +1 -0
  84. package/dist/render/lib/document/section-to-box-rows-reviews.d.ts +2 -1
  85. package/dist/render/lib/document/section-to-box-rows-reviews.js +1 -1
  86. package/dist/render/lib/document/section-to-box-rows-service.d.ts +1 -0
  87. package/dist/render/lib/document/section-to-box-rows-service.js +1 -0
  88. package/dist/render/lib/document/section-to-box-rows-spec.js +1 -1
  89. package/dist/render/lib/sections/grid-no-hole.d.ts +1 -1
  90. package/dist/render/lib/wheels/plp-hydrate.d.ts +3 -0
  91. package/dist/render/lib/wheels/plp-hydrate.js +1 -1
  92. package/dist/words.d.ts +12 -7
  93. package/dist/words.js +4 -4
  94. package/package.json +4 -2
  95. package/dist/chunks/chunk-4VRLGKYU.js +0 -387
  96. package/dist/chunks/chunk-PHQQRGQZ.js +0 -1
  97. package/dist/chunks/chunk-YL2HPWVT.js +0 -1
  98. package/dist/render/components/wheels-plp/PlpCard.d.ts +0 -29
  99. package/dist/render/components/wheels-plp/PlpCard.js +0 -1
  100. /package/dist/chunks/{chunk-XMTQMRA3.js → chunk-JB6ISWYA.js} +0 -0
  101. /package/dist/chunks/{chunk-4VRLGKYU.js.LEGAL.txt → chunk-S2WLJ6H2.js.LEGAL.txt} +0 -0
@@ -1 +1 @@
1
- "use client";import{jsx as r,Fragment as p,jsxs as o}from"react/jsx-runtime";import{GAP_LENGTH_VAR as y,GAP_PHONE_LENGTH_VAR as j}from"efficient-web-builder/format/lib/content/container-gap";import g from"next/link";import{CardLookContext as k,CardRow as s}from"./card-pieces/card-row.js";import I from"./card-pieces/CardEyebrow.js";import O from"./card-pieces/CardName.js";import W from"./card-pieces/CardPicture.js";import{CardSpecLine as B}from"./card-pieces/CardSpecs.js";import{cardOutlineClass as H}from"efficient-web-builder/format/lib/sections/product-card-style";import{CARD_IMAGE_BG_OFF as K}from"efficient-web-builder/format/lib/content/card-image-background";const ar="sf-card-rows",or=a=>({rowGap:0,"--sf-card-row-gap":a}),sr=a=>j in a.style?"var(--sf-card-row-gap-auto)":`var(${y})`;import{CARD_PAD_X_PX as cr,GRID_GAP_PX as ir,SET_PLATE_PX as lr,SET_STACK_GAP_PX as dr,SET_STACK_MAX_PX as nr,setBandGapCss as fr,setBandGapPx as pr,setPlateWidthCss as mr}from"./card-pieces/CardPicture.js";import{CARD_SPEC_FIELD_CLASS as gr,cardSpecFields as wr}from"./card-pieces/CardSpecs.js";function M({variant:a="catalog",wide:m=!1,setGridGap:w,href:e,identityLink:C=!1,outline:u="none",imageBackgroundFill:x=K,containerProps:_,probes:t,indexBadge:c,badges:i,image:h,imageSecond:A,plate:G,eyebrow:v,reserveEyebrow:P=!1,name:S,spec:R,price:b,swatches:E,sizes:L,buy:D,wholeCardLink:F=!1}){const N=a==="catalog",T=r(W,{image:h,imageSecond:A,plate:G,wide:m,imageBackgroundFill:x,setGridGap:w}),l=[N?"sf-card sf-card-fill group relative flex min-h-[460px] flex-col bg-[var(--card-bg)] px-8 pt-8 pb-8 transition-colors duration-200 hover:bg-[var(--card-bg-hover)] [.sf-card-rows>&]:row-span-9 [.sf-card-rows>&]:mb-[var(--sf-card-row-gap)] [.sf-card-rows>&]:grid [.sf-card-rows>&]:grid-rows-subgrid [.sf-card-rows>&]:gap-y-0":"sf-card sf-card-fill group relative block bg-[var(--card-bg)] p-5 transition-colors duration-300 hover:bg-[var(--card-bg-hover)]",H(u),m?"col-span-2 max-view-wide:col-span-1 @max-[720px]:col-span-1":""].filter(Boolean).join(" "),d=o(p,{children:[T,r(I,{reserve:P,children:v}),r(O,{children:S})]}),n=o(p,{children:[r(B,{children:R}),b??o(p,{children:[r(s,{}),r(s,{})]}),E??r(s,{}),L??r(s,{}),D??r(s,{})]}),f=X=>r(k.Provider,{value:a,children:X});return f(e?C?o("article",{..._,className:l,children:[t,c,i,r(g,{href:e,className:`flex flex-col ${F?"after:absolute after:inset-0 after:content-['']":""} [.sf-card-rows>*>&]:row-span-3 [.sf-card-rows>*>&]:grid [.sf-card-rows>*>&]:grid-rows-subgrid [.sf-card-rows>*>&]:gap-y-0`,children:d}),n]}):o(g,{href:e,className:l,children:[t,c,i,d,n]}):o("article",{..._,className:l,children:[t,c,i,d,n]}))}export{cr as CARD_PAD_X_PX,ar as CARD_ROWS_GRID_CLASS,gr as CARD_SPEC_FIELD_CLASS,ir as GRID_GAP_PX,lr as SET_PLATE_PX,dr as SET_STACK_GAP_PX,nr as SET_STACK_MAX_PX,sr as cardRowsGap,or as cardRowsGridStyle,wr as cardSpecFields,M as default,fr as setBandGapCss,pr as setBandGapPx,mr as setPlateWidthCss};
1
+ "use client";import{jsx as r,Fragment as m,jsxs as o}from"react/jsx-runtime";import{GAP_LENGTH_VAR as X,GAP_PHONE_LENGTH_VAR as y}from"efficient-web-builder/format/lib/content/container-gap";import g from"next/link";import{CardLookContext as j,CardRow as s}from"./card-pieces/card-row.js";import k from"./card-pieces/CardEyebrow.js";import I from"./card-pieces/CardName.js";import O from"./card-pieces/CardPicture.js";import{CardSpecLine as W}from"./card-pieces/CardSpecs.js";import{cardOutlineClass as B}from"efficient-web-builder/format/lib/sections/product-card-style";import{CARD_IMAGE_BG_OFF as H}from"efficient-web-builder/format/lib/content/card-image-background";const rr="sf-card-rows",ar=a=>({rowGap:0,"--sf-card-row-gap":a}),or=a=>y in a.style?"var(--sf-card-row-gap-auto)":`var(${X})`;import{CARD_PAD_X_PX as cr,GRID_GAP_PX as tr,SET_PLATE_PX as ir,SET_STACK_GAP_PX as lr,SET_STACK_MAX_PX as dr,setBandGapCss as nr,setBandGapPx as fr,setPlateWidthCss as mr}from"./card-pieces/CardPicture.js";import{CARD_SPEC_FIELD_CLASS as _r,cardSpecFields as gr}from"./card-pieces/CardSpecs.js";function K({variant:a="catalog",wide:p=!1,href:e,identityLink:w=!1,outline:C="none",imageBackgroundFill:u=H,containerProps:_,probes:c,indexBadge:t,badges:i,image:x,imageSecond:h,plate:A,eyebrow:v,reserveEyebrow:P=!1,name:G,spec:S,price:R,swatches:b,sizes:E,buy:L,wholeCardLink:D=!1}){const F=a==="catalog",N=r(O,{image:x,imageSecond:h,plate:A,wide:p,imageBackgroundFill:u}),l=[F?"sf-card sf-card-fill group relative flex min-h-[460px] flex-col bg-[var(--card-bg)] px-8 pt-8 pb-8 transition-colors duration-200 hover:bg-[var(--card-bg-hover)] [.sf-card-rows>&]:row-span-9 [.sf-card-rows>&]:mb-[var(--sf-card-row-gap)] [.sf-card-rows>&]:grid [.sf-card-rows>&]:grid-rows-subgrid [.sf-card-rows>&]:gap-y-0":"sf-card sf-card-fill group relative block bg-[var(--card-bg)] p-5 transition-colors duration-300 hover:bg-[var(--card-bg-hover)]",B(C),p?"col-span-2 max-view-wide:col-span-1 @max-[720px]:col-span-1":""].filter(Boolean).join(" "),d=o(m,{children:[N,r(k,{reserve:P,children:v}),r(I,{children:G})]}),n=o(m,{children:[r(W,{children:S}),R??o(m,{children:[r(s,{}),r(s,{})]}),b??r(s,{}),E??r(s,{}),L??r(s,{})]}),f=T=>r(j.Provider,{value:a,children:T});return f(e?w?o("article",{..._,className:l,children:[c,t,i,r(g,{href:e,className:`flex flex-col ${D?"after:absolute after:inset-0 after:content-['']":""} [.sf-card-rows>*>&]:row-span-3 [.sf-card-rows>*>&]:grid [.sf-card-rows>*>&]:grid-rows-subgrid [.sf-card-rows>*>&]:gap-y-0`,children:d}),n]}):o(g,{href:e,className:l,children:[c,t,i,d,n]}):o("article",{..._,className:l,children:[c,t,i,d,n]}))}export{cr as CARD_PAD_X_PX,rr as CARD_ROWS_GRID_CLASS,_r as CARD_SPEC_FIELD_CLASS,tr as GRID_GAP_PX,ir as SET_PLATE_PX,lr as SET_STACK_GAP_PX,dr as SET_STACK_MAX_PX,or as cardRowsGap,ar as cardRowsGridStyle,gr as cardSpecFields,K as default,nr as setBandGapCss,fr as setBandGapPx,mr as setPlateWidthCss};
@@ -6,7 +6,7 @@ export declare const setBandGapPx: (showImageBackground: boolean) => number;
6
6
  export declare const setBandGapCss: (showImageBackground: boolean, gridGap?: string) => string;
7
7
  export declare const SET_PLATE_PX = 252;
8
8
  export declare const SET_STACK_GAP_PX = 16;
9
- export declare const SET_STACK_MAX_PX: 800 | 720;
9
+ export declare const SET_STACK_MAX_PX: 800;
10
10
  export interface CardPictureSettings {
11
11
  image: ReactNode;
12
12
  imageSecond?: ReactNode;
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as m,Fragment as P}from"react/jsx-runtime";import k from"next/image";import{useState as H}from"react";import{HideTaker as v}from"efficient-web-builder/render/components/ViewHideRoot";import{CARD_INDEX_BADGE_CLASS as j,CARD_INDEX_CLASS as z,parseCardIndexFormat as X}from"efficient-web-builder/format/lib/sections/product-card-style";import{CARD_IMAGE_BG_OFF as B,cardImageBackgroundPaints as K,resolveCardImageBackground as D}from"efficient-web-builder/format/lib/content/card-image-background";import{cardImageShapeTokens as _}from"efficient-web-builder/format/lib/content/card-image-shape";import{sayCount as Z}from"efficient-web-builder/format/lib/editor-words";import{parseSetPicture as q,setSecondSrc as J}from"../../lib/wheels/set-mode.js";import{coverSrcForWheel as Q,parseCoverIndex as V,resolvePaintedSrc as Y}from"../../lib/wheels/cover-rendering.js";import ee from"../WheelPlaceholder.js";import{cardSpinOf as re}from"../card-spin.js";import{useGridCard as R}from"../GridCardTemplate.js";import T from"./CardPicture.js";import N from"./CardProductBadge.js";import{useHeldCardPicture as te}from"./useHeldCardPicture.js";import{useProductCardState as ne}from"./ProductCardState.js";const _e=["well","full"],ae="well",G=r=>r==="full"?"full":ae;function le({children:r}){return e("div",{className:"h-full w-full transition-transform duration-500 motion-safe:group-hover:scale-[1.03]",children:r})}function L({fill:r,badge:a,children:o}){const c=K(r);return m("div",{className:`sf-card-image relative aspect-[4/3] overflow-hidden${c?"":" bg-surface"}`,style:c?{backgroundColor:r}:void 0,children:[o,a]})}function ie(r){const a=ne();return a.kind==="bundle"?e(se,{state:a,...r}):a.kind!=="wheel"?null:e(oe,{state:a,...r})}function se({state:r,imageBackground:a,cardImage:o,showBadge:c,frame:w}){const{bundle:i}=r,{imageSizes:g}=R(),f=G(w)==="full",s=i.components.length,t=i.image?f?e(k,{alt:i.name,src:i.image,fill:!0,sizes:g,className:"object-cover",draggable:!1}):e(k,{alt:i.name,src:i.image,width:1e3,height:1e3,sizes:g,className:"block h-full w-full object-cover",draggable:!1}):e("div",{className:"flex h-full w-full items-center justify-center font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.3em] text-fg-dim",children:Z("{n} piece","{n} pieces",s,{})}),d=e(le,{children:t}),p=D(a,B),u=c!==!1?e(N,{edge:f}):null;return e(v,{style:_(o),children:f?e(L,{fill:p,badge:u,children:d}):m(P,{children:[u,e(T,{image:d,imageBackgroundFill:p})]})})}function oe({state:r,imageBackground:a,cardImage:o,coverIndex:c,indexBadge:w,showBadge:i,frame:g,setPicture:f}){const{wheel:s,sel:t,isSet:d}=r,{hover:p,imageSizes:u}=R(),C=re(p),M=Q(s,V(c),t.finish?.name,t.shownSrc),[A,O]=H(()=>new Set),E=n=>{t.pictureFailed(n),O(h=>h.has(n)?h:new Set(h).add(n))},y=Y({overrideSrc:M,hookSrc:t.shownSrc,failed:A}),F=(n,h)=>e(k,{alt:h,src:n,width:1e3,height:1e3,sizes:u,className:`block h-full w-full object-contain ${C.className}`,style:C.style,draggable:!1,onError:()=>E(n)},n),U=t.finish?`${s.name} — ${t.finish.name}`:s.name,S=d&&q(f)==="pair",W=S?J(s.finishes?.find(n=>n.name===t.finish?.name),y):null,l=te({src:y,second:W,alt:U,sizes:u,failed:A,onFailed:E,near:t.nearScreen,holdEmpty:t.awaitingProbe}),I=m(P,{children:[l.src?F(l.src,l.alt):e(ee,{imageLabel:s.name,spin:C}),l.trial]}),x=X(w),b=x!=="off",$=D(a,B);if(G(g)==="full"){const n=m(P,{children:[b?e("span",{"aria-hidden":!0,"data-format":x,className:`${z} ${j}`}):null,e(N,{show:i!==!1,numbered:b,axleSets:!0,edge:!0})]});return e(v,{style:_(o),"data-set-picture":d&&!S?"one":void 0,children:e(L,{fill:$,badge:n,children:m("div",{className:"flex h-full w-full items-center justify-center",children:[I,l.second?F(l.second,`${l.alt} — right`):null]})})})}return m(v,{style:_(o),"data-set-picture":d&&!S?"one":void 0,children:[b?e("span",{"aria-hidden":!0,"data-format":x,className:`${z} ${j}`}):null,e(N,{show:i!==!1,numbered:b,axleSets:!0}),e(T,{image:I,imageSecond:l.second?F(l.second,`${l.alt} — right`):void 0,wide:S,imageBackgroundFill:$})]})}export{ae as DEFAULT_PICTURE_FRAME,_e as PICTURE_FRAMES,ie as default};
1
+ "use client";import{jsx as e,jsxs as m,Fragment as k}from"react/jsx-runtime";import v from"next/image";import{useState as Z}from"react";import{HideTaker as _}from"efficient-web-builder/render/components/ViewHideRoot";import{CARD_INDEX_BADGE_CLASS as z,CARD_INDEX_CLASS as G,parseCardIndexFormat as q}from"efficient-web-builder/format/lib/sections/product-card-style";import{CARD_IMAGE_BG_OFF as B,cardImageBackgroundPaints as J,resolveCardImageBackground as D}from"efficient-web-builder/format/lib/content/card-image-background";import{cardImageShapeTokens as N}from"efficient-web-builder/format/lib/content/card-image-shape";import{sayCount as Q}from"efficient-web-builder/format/lib/editor-words";import{parseSetPicture as V,setSecondSrc as Y}from"../../lib/wheels/set-mode.js";import{coverSrcForWheel as ee,parseCoverIndex as re,resolvePaintedSrc as te}from"../../lib/wheels/cover-rendering.js";import ae from"../WheelPlaceholder.js";import{cardSpinOf as ne}from"../card-spin.js";import{useGridCard as R}from"../GridCardTemplate.js";import T from"./CardPicture.js";import A from"./CardProductBadge.js";import{useHeldCardPicture as le}from"./useHeldCardPicture.js";import{useProductCardState as se}from"./ProductCardState.js";const Ee=["well","full"],ie="well",L=r=>r==="full"?"full":ie;function oe({children:r}){return e("div",{className:"h-full w-full transition-transform duration-500 motion-safe:group-hover:scale-[1.03]",children:r})}function M({fill:r,badge:n,children:o}){const c=J(r);return m("div",{className:`sf-card-image relative aspect-[4/3] overflow-hidden${c?"":" bg-surface"}`,style:c?{backgroundColor:r}:void 0,children:[o,n]})}function ce(r){const n=se();return n.kind==="bundle"?e(de,{state:n,...r}):n.kind!=="wheel"?null:e(me,{state:n,...r})}function de({state:r,imageBackground:n,cardImage:o,showBadge:c,frame:x}){const{bundle:s}=r,{imageSizes:p}=R(),f=L(x)==="full",i=s.components.length,t=s.image?f?e(v,{alt:s.name,src:s.image,fill:!0,sizes:p,className:"object-cover",draggable:!1}):e(v,{alt:s.name,src:s.image,width:1e3,height:1e3,sizes:p,className:"block h-full w-full object-cover",draggable:!1}):e("div",{className:"flex h-full w-full items-center justify-center font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.3em] text-fg-dim",children:Q("{n} piece","{n} pieces",i,{})}),d=e(oe,{children:t}),g=D(n,B),u=c!==!1?e(A,{edge:f}):null;return e(_,{style:N(o),children:f?e(M,{fill:g,badge:u,children:d}):m(k,{children:[u,e(T,{image:d,imageBackgroundFill:g})]})})}function me({state:r,imageBackground:n,cardImage:o,coverIndex:c,indexBadge:x,showBadge:s,frame:p,setPicture:f}){const{wheel:i,sel:t,isSet:d}=r,{hover:g,imageSizes:u,fit:O,rules:S,setGridGap:U}=R(),C=ne(g),W=ee(i,re(c),t.finish?.name,t.shownSrc,O?.holes),[E,H]=Z(()=>new Set),y=a=>{t.pictureFailed(a),H(h=>h.has(a)?h:new Set(h).add(a))},I=te({overrideSrc:W,hookSrc:t.shownSrc,failed:E}),F=(a,h)=>e(v,{alt:h,src:a,width:1e3,height:1e3,sizes:u,className:`block h-full w-full object-contain ${C.className}`,style:C.style,draggable:!1,onError:()=>y(a)},a),X=t.finish?`${i.name} — ${t.finish.name}`:i.name,b=d&&V(f)==="pair",K=b?Y(i.finishes?.find(a=>a.name===t.finish?.name),I):null,l=le({src:I,second:K,alt:X,sizes:u,failed:E,onFailed:y,near:t.nearScreen,holdEmpty:t.awaitingProbe}),$=m(k,{children:[l.src?F(l.src,l.alt):e(ae,{imageLabel:i.name,spin:C}),l.trial]}),P=q(x),w=P!=="off",j=D(n,B);if(L(p)==="full"){const a=m(k,{children:[w?e("span",{"aria-hidden":!0,"data-format":P,className:`${G} ${z}`}):null,e(A,{show:s!==!1,numbered:w,sale:S.sale,axleSets:S.axleSets,edge:!0})]});return e(_,{style:N(o),"data-set-picture":d&&!b?"one":void 0,children:e(M,{fill:j,badge:a,children:m("div",{className:"flex h-full w-full items-center justify-center",children:[$,l.second?F(l.second,`${l.alt} — right`):null]})})})}return m(_,{style:N(o),"data-set-picture":d&&!b?"one":void 0,children:[w?e("span",{"aria-hidden":!0,"data-format":P,className:`${G} ${z}`}):null,e(A,{show:s!==!1,numbered:w,sale:S.sale,axleSets:S.axleSets}),e(T,{image:$,imageSecond:l.second?F(l.second,`${l.alt} — right`):void 0,wide:b,imageBackgroundFill:j,setGridGap:U})]})}export{ie as DEFAULT_PICTURE_FRAME,Ee as PICTURE_FRAMES,ce as default};
@@ -1,6 +1,5 @@
1
- import { type CardImageBackground } from "efficient-web-builder/format/lib/content/card-image-background";
2
- import type { CardHoverDrawn } from "efficient-web-builder/format/lib/animation/hover";
3
- import { type CardIndexFormat, type CardOutline } from "efficient-web-builder/format/lib/sections/product-card-style";
1
+ import { type CardHoverDrawn } from "efficient-web-builder/format/lib/animation/hover";
2
+ import type { SlotComponent } from "efficient-easel/blocks";
4
3
  import { type FieldUsageAnswer } from "../../lib/content/field-usage.js";
5
4
  import type { ProductSummary, WheelSummary } from "../../lib/api/index.js";
6
5
  import { type PlpColumns } from "../../lib/wheels/plp-grid.js";
@@ -24,21 +23,13 @@ export interface AlloyWheelsListingProps {
24
23
  requestQuery?: string;
25
24
  wheels?: WheelSummary[];
26
25
  editing?: boolean;
27
- coverIndex?: number;
26
+ ownerId?: string;
27
+ template?: SlotComponent;
28
28
  cardImage?: number | null;
29
29
  hover?: CardHoverDrawn;
30
- imageBackground?: CardImageBackground;
31
- showBadge?: boolean;
32
- showCardSizes?: boolean;
33
- showCardBuy?: boolean;
34
- showCardPage?: boolean;
35
- showCardPrice?: boolean;
36
- showCardFinishes?: boolean;
37
- outline?: CardOutline;
38
- indexBadge?: CardIndexFormat;
39
30
  }
40
31
  export declare const PLP_GATE_DEFAULTS: {
41
32
  readonly heading: "Let's find wheels that fit your car.";
42
33
  readonly intro: "Tell us what you drive and we'll show you every set that bolts straight on — bolt pattern, offset and hub bore checked for you.";
43
34
  };
44
- export default function AlloyWheelsListing({ heading, intro, askForCar, gateHeading, gateIntro, perPage, columns, defaultSort, hiddenFacets, fieldUsage, showPrice, showInStock, kinds, products, wheels, requestQuery, editing, coverIndex, cardImage, hover, imageBackground, showBadge, showCardSizes, showCardBuy, showCardPage, showCardPrice, showCardFinishes, outline, indexBadge, titleLevel, }: AlloyWheelsListingProps): import("react").JSX.Element | null;
35
+ export default function AlloyWheelsListing({ heading, intro, askForCar, gateHeading, gateIntro, perPage, columns, defaultSort, hiddenFacets, fieldUsage, showPrice, showInStock, kinds, products, wheels, requestQuery, editing, ownerId, template, cardImage, hover, titleLevel, }: AlloyWheelsListingProps): import("react").JSX.Element | null;
@@ -1 +1 @@
1
- "use client";import{jsx as r,jsxs as p,Fragment as se}from"react/jsx-runtime";import{LISTING_CARD_SHOW as O}from"../../lib/sections/card-show-defaults.js";import{useScopeClass as Qe}from"../../lib/use-scope-class.js";import{useCallback as d,useEffect as Ze,useMemo as i,useRef as et,useState as tt}from"react";import{CARD_IMAGE_BG_OFF as ot,resolveCardImageBackground as rt}from"efficient-web-builder/format/lib/content/card-image-background";import{cardImageShapeTokens as nt}from"efficient-web-builder/format/lib/content/card-image-shape";import{cardIndexCss as st,DEFAULT_CARD_INDEX_FORMAT as it,DEFAULT_CARD_OUTLINE as lt}from"efficient-web-builder/format/lib/sections/product-card-style";import{NO_FIELD_ANSWERS as at,answersForKind as ie}from"../../lib/content/field-usage.js";import{useCurrency as ct}from"../CurrencyContext.js";import pt from"../NoCurrencyNote.js";import{usePreviewDevice as dt}from"efficient-easel/screen/components/PreviewDeviceContext";import{renderGold as mt,renderHeadline as ht}from"efficient-web-builder/render/components/goldPhrases";import{useUnifiedProductCatalog as ut}from"../useProductCatalog.js";import{scrollBehavior as ft}from"efficient-web-builder/render/components/useReducedMotion";import{normalizePlpColumns as gt,PLP_GRID_GAP_VAR as yt,plpGridVars as St}from"../../lib/wheels/plp-grid.js";import{plpCardImageSizes as xt}from"../../lib/sections/card-image-sizes.js";import{CARD_ROWS_GRID_CLASS as wt,cardRowsGridStyle as bt}from"../WheelCardFrame.js";import{applyPlpFilters as Ct,buildPlpFacets as Pt,buildPlpTypeOptions as kt,buildTyreSizeBoxes as vt,EMPTY_PLP_FILTERS as le,hasActivePlpFilters as Nt,paginatePlp as _t,pickTyreSize as Tt,plpTyreSizeBoxesShown as At,plpInStockCount as zt,plpOpeningSort as Ft,plpPriceBounds as It,plpShownKinds as Bt,plpSortKeysFor as Ot,PLP_SORT_LABELS as Lt}from"../../lib/wheels/plp-filters.js";import{itemKind as z,itemSlug as L,itemTyreSizes as Rt,plpBrandVaries as Vt,plpProcessVaries as Et,plpItemsOfKinds as Dt,plpKindNoun as R,resolvePlpKinds as Gt}from"../../lib/catalog/plp-item.js";import{plpGateWords as Kt,plpVehicleCopy as jt}from"../../lib/catalog/plp-vehicle-copy.js";import{oemBadgeSize as Mt,oemTyreSizes as $t}from"../../lib/tyres/tyre-vehicle-fitment.js";import Wt from"../TyreSummaryCard.js";import{wheelsFittingVehicle as Ut}from"../../lib/wheels/plp-fitment-match.js";import Ht from"./PlpActiveChips.js";import{DEFAULT_COVER_INDEX as Xt}from"../../lib/wheels/cover-rendering.js";import Yt from"./PlpCard.js";import qt from"./PlpPagination.js";import Jt from"./PlpSidebar.js";import{PlpResultRange as Qt,PlpToolbar as Zt}from"./PlpToolbar.js";import eo from"../catalog/SortSelect.js";import to from"./PlpVehicleBar.js";import oo from"./PlpVehicleGate.js";import{useVehicleCatalog as ro}from"./useVehicleCatalog.js";import{useVehicleFit as no}from"../fitment/useVehicleFit.js";import{usePlpFiltersInUrl as so}from"./usePlpFiltersInUrl.js";import{say as V}from"efficient-web-builder/format/lib/editor-words";const Wo={heading:"Let's find wheels that fit your car.",intro:"Tell us what you drive and we'll show you every set that bolts straight on — bolt pattern, offset and hub bore checked for you."};function io({level:C,className:P,children:k}){return r(C===2?"h2":"h1",{className:P,children:k})}function lo({heading:C="",intro:P="",askForCar:k=!0,gateHeading:E="",gateIntro:ae="",perPage:D=24,columns:ce,defaultSort:pe="recommended",hiddenFacets:de=[],fieldUsage:f=at,showPrice:G=!0,showInStock:me=!0,kinds:he,products:ue,wheels:fe,requestQuery:ge,editing:m=!1,coverIndex:ye=Xt,cardImage:Se,hover:xe,imageBackground:we,showBadge:be=!0,showCardSizes:Ce,showCardBuy:Pe,showCardPage:ke,showCardPrice:ve,showCardFinishes:Ne,outline:_e=lt,indexBadge:K=it,titleLevel:Te}){const{currency:l}=ct(),Ae=rt(we,ot),h=Gt(he),j=dt(),M=gt(ce),ze=St(M,m?j:null),Fe=xt(M,m?j:null),$=Qe("plp"),F=st($,K),Ie=ut(),W=ue??fe??Ie??[],U=i(()=>Dt(W,h),[W,h.join(",")]),o=no({editing:m,enabled:k,autoApply:!0}),[Be,I]=tt(!1),Oe=Ft(pe,h),g=o.applied?.vehicle??null,[e,x]=so({editing:m,openingSort:Oe,appliedVehicle:g,vehicleRestored:o.restored,requestQuery:ge}),c=Bt(h,e.kind),s=d(t=>x(t),[x]),H=d((t,u)=>{const a=e[t],qe=a.map(String).includes(u)?a.filter(Je=>String(Je)!==u):[...a,t==="diameters"?Number(u):u];s({...e,[t]:qe,page:1})},[e,s]),X=d(t=>s({...e,priceMax:t,page:1}),[e,s]),Y=d(t=>s({...e,inStockOnly:t,page:1}),[e,s]),q=d(t=>s({...le,kind:t,inStockOnly:e.inStockOnly,priceMax:e.priceMax,sort:e.sort}),[e.inStockOnly,e.priceMax,e.sort,s]),Le=d(t=>s({...e,sort:t,page:1}),[e,s]),Re=d(t=>{s({...e,page:t}),typeof window<"u"&&window.scrollTo({top:0,behavior:ft()})},[e,s]),J=d(()=>s({...le,sort:e.sort}),[e.sort,s]),{clear:N}=o,Q=d(()=>{N(),I(!0),x(t=>({...t,page:1}))},[N]),Ve=d(()=>{N(),I(!1),x(t=>({...t,page:1}))},[N]),_=g?[g.make,g.model,g.year,g.modification].join("|"):"",T=et(null);Ze(()=>{if(o.restored){if(T.current===null){T.current=_;return}T.current!==_&&(T.current=_,x(t=>t.page===1?t:{...t,page:1}))}},[o.restored,_,x]);const A=ro({catalog:U,shownKinds:h,vehicle:g,editing:m}),n=i(()=>{if(!o.fit)return A;const t=A.filter(a=>z(a)==="alloy-wheel"),u=new Set(Ut(t,o.fit).map(a=>a.slug));return A.filter(a=>z(a)!=="alloy-wheel"||u.has(L(a)))},[A,o.fit]),w=de.join(","),Ee=i(()=>{const t=new Set(w?w.split(","):[]);return Pt(n,e,l,c,f).filter(u=>!t.has(u.key))},[n,e,l,w,c.join(","),f]),y=i(()=>Ct(n,e,l),[n,e,l]),Z=c.length>1,De=i(()=>ie(f,"alloy-wheel"),[f]),Ge=i(()=>ie(f,"tyre"),[f]),ee=i(()=>Vt(y),[y]),Ke=i(()=>Et(y),[y]),je=i(()=>G?It(n,l):null,[n,l,G]),Me=i(()=>zt(n,e,l),[n,e,l]),$e=i(()=>kt(n,h,e,l),[n,h.join(","),e,l]),We=d((t,u)=>{const a=Tt(n.flatMap(Rt),e.tyreSizes[0]??"",t,u);s({...e,tyreSizes:a?[a]:[],page:1})},[n,e,s]),Ue=i(()=>{const t=new Set(w?w.split(","):[]);return!At(n,c)||t.has("tyreSizes")?null:vt(n,e,l)},[n,e,l,w,c.join(","),f]),S=i(()=>_t(y,e.page,D),[y,e.page,D]),b=R(c),B=jt(c),te=Kt(E,ae,c,h),oe=c.length===1&&c[0]==="tyre",re=o.applied?.stock??null,v=i(()=>$t(re),[re]),He=i(()=>n.filter(t=>c.includes(z(t))).length,[n,c.join(",")]),ne=U.length===0,Xe=!ne&&n.length===0,Ye=k&&!m&&!o.applied&&!Be;return h.length===0?null:p("section",{style:nt(Se),children:[k&&r(to,{cascade:o.cascade,appliedName:o.appliedName,fit:o.fit,fitSummary:oe&&v.length>0?`Takes ${v.join(" · ")}`:null,resolving:o.resolving,unresolved:oe?!!o.applied&&!o.resolving&&v.length===0:o.unresolved,matchCount:He,copy:B,onAmend:Ve,onClear:Q}),Ye&&r(oo,{cascade:o.cascade,heading:te.heading,intro:te.intro,ready:o.restored,copy:B,onSkip:()=>I(!0)}),p("div",{className:"px-5 py-10 md:px-[max(2.5rem,calc((100%_-_var(--sf-content-cap,100%))/2_+_2.5rem))]",children:[(C||P)&&p("header",{className:"mb-6",children:[C&&r(io,{level:Te,className:"font-display text-[clamp(28px,4vw,40px)] [font-weight:var(--sf-heading-weight,500)] [text-transform:var(--sf-heading-case,uppercase)] leading-[1.05] tracking-[-0.02em]",children:ht(C,!1)}),P&&r("p",{className:"mt-2 max-w-[60ch] text-[15px] text-fg-dim",children:mt(P)})]}),p("div",{className:"flex flex-col gap-8 lg:flex-row lg:items-start",children:[r(Jt,{facets:Ee,filters:e,typeOptions:$e,sizeBoxes:Ue,sizeMatches:e.tyreSizes.length>0?y.length:null,noun:b,priceBounds:je,inStockCount:me?Me:null,onToggle:H,onPickType:q,onPickSize:We,onPriceMax:X,onInStockOnly:Y,onClearAll:J}),p("div",{className:"min-w-0 flex-1",children:[r(Zt,{className:"mb-4",start:p(se,{children:[r(Qt,{total:S.total,range:{from:S.from,to:S.to},noun:b}),r(Ht,{filters:e,onToggle:H,onPriceMax:X,onInStockOnly:Y,onPickType:q})]}),end:r(eo,{value:e.sort,keys:Ot(h),labels:Lt,onChange:Le})}),ne?r("div",{className:"border border-dashed border-line p-10",children:r("p",{className:"font-mono text-[12px] uppercase tracking-[0.16em] text-fg-dim",children:m?b.many==="wheels"?V("No wheels in this website's catalog yet — curate products to see them here."):b.many==="tyres"?V("No tyres in this website's catalog yet — curate products to see them here."):V("No products in this website's catalog yet — curate products to see them here."):"Our catalog is being updated. Please check back shortly."})}):Xe?p("div",{className:"border border-line p-10",children:[p("h3",{className:"font-display text-[22px] font-medium uppercase tracking-[-0.01em]",children:["No confirmed fit for your ",o.appliedName]}),r("p",{className:"mt-2 max-w-[52ch] text-[14px] text-fg-dim",children:B.nothingFits}),p("button",{type:"button",onClick:Q,className:"mt-4 cursor-pointer bg-btn px-4 py-3 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-btn-ink hover:bg-fg",children:["Show all ",b.many]})]}):S.total===0?p("div",{className:"border border-line p-10",children:[p("h3",{className:"font-display text-[22px] font-medium uppercase tracking-[-0.01em]",children:["No ",b.many," match those filters"]}),r("p",{className:"mt-2 max-w-[46ch] text-[14px] text-fg-dim",children:"Try widening the price range or clearing a filter."}),Nt(e)&&r("button",{type:"button",onClick:J,className:"mt-4 cursor-pointer bg-btn px-4 py-3 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-btn-ink hover:bg-fg",children:"Clear all filters"})]}):p(se,{children:[F&&r("style",{children:F}),r("div",{className:`${F?`${$} plp-card-grid`:"plp-card-grid"} ${wt}`,style:{...ze,...bt(`var(${yt})`)},children:S.items.map(t=>z(t)==="tyre"?r(Wt,{item:t,currency:l,fitSize:v.length>0?Mt(t.sizes,v):null,kindLabel:Z?R(["tyre"]).one:null,showBrand:ee,editing:m,fieldUsage:Ge},`tyre:${L(t)}`):r(Yt,{wheel:t,colours:e.finishes,fit:o.fit,editing:m,kindLabel:Z?R(["alloy-wheel"]).one:null,showBrand:ee,coverIndex:ye,fieldUsage:De,showProcess:Ke,hover:xe,imageBackgroundFill:Ae,showBadge:be,outline:_e,indexBadge:K,showCardSizes:Ce??O.showCardSizes,showCardBuy:Pe??O.showCardBuy,showCardPage:ke??O.showCardPage,showCardPrice:ve??!0,showCardFinishes:Ne??!0,imageSizes:Fe},`wheel:${L(t)}`))})]}),r(qt,{page:S.page,pageCount:S.pageCount,onPage:Re}),r(pt,{editing:m})]})]})]})]})}export{Wo as PLP_GATE_DEFAULTS,lo as default};
1
+ "use client";import{jsx as r,jsxs as p,Fragment as $e}from"react/jsx-runtime";import{useScopeClass as He}from"../../lib/use-scope-class.js";import{useCallback as m,useEffect as Ye,useMemo as i,useRef as qe,useState as Je}from"react";import{cardHoverOf as Qe}from"efficient-web-builder/format/lib/animation/hover";import{SHARED_ROWS_LIST_CLASS as Ue}from"efficient-web-builder/render/lib/content/box-shared-columns";import{NO_FIELD_ANSWERS as Xe,answersForKind as ne}from"../../lib/content/field-usage.js";import{useCurrency as Ze}from"../CurrencyContext.js";import et from"../NoCurrencyNote.js";import{usePreviewDevice as tt}from"efficient-easel/screen/components/PreviewDeviceContext";import{renderGold as ot,renderHeadline as rt}from"efficient-web-builder/render/components/goldPhrases";import{useUnifiedProductCatalog as nt}from"../useProductCatalog.js";import{scrollBehavior as st}from"efficient-web-builder/render/components/useReducedMotion";import{normalizePlpColumns as it,PLP_GRID_GAP_VAR as se,plpGridVars as lt}from"../../lib/wheels/plp-grid.js";import{plpCardImageSizes as at}from"../../lib/sections/card-image-sizes.js";import{CARD_ROWS_GRID_CLASS as ct,cardRowsGridStyle as pt}from"../WheelCardFrame.js";import{applyPlpFilters as mt,buildPlpFacets as dt,buildPlpTypeOptions as ut,buildTyreSizeBoxes as ht,EMPTY_PLP_FILTERS as ie,hasActivePlpFilters as ft,paginatePlp as gt,pickTyreSize as yt,plpTyreSizeBoxesShown as St,plpInStockCount as xt,plpOpeningSort as wt,plpPriceBounds as bt,plpShownKinds as vt,plpSortKeysFor as Pt,PLP_SORT_LABELS as kt}from"../../lib/wheels/plp-filters.js";import{itemKind as L,itemSlug as le,itemTyreSizes as Ct,plpBrandVaries as Nt,plpProcessVaries as Tt,plpItemsOfKinds as _t,plpKindNoun as V,resolvePlpKinds as At}from"../../lib/catalog/plp-item.js";import{plpGateWords as zt,plpVehicleCopy as Lt}from"../../lib/catalog/plp-vehicle-copy.js";import{oemBadgeSize as It,oemTyreSizes as Ot}from"../../lib/tyres/tyre-vehicle-fitment.js";import Rt from"../TyreSummaryCard.js";import{wheelsFittingVehicle as Gt}from"../../lib/wheels/plp-fitment-match.js";import Vt from"./PlpActiveChips.js";import{GridCardProvider as Ft,GridMixedCards as Bt,gridIndexCss as Et,LISTING_CARD_RULES as Kt}from"../GridCardTemplate.js";import{wheelCardEyebrowShows as jt}from"../ProductCardEyebrow.js";import Mt from"./PlpPagination.js";import Dt from"./PlpSidebar.js";import{PlpResultRange as Wt,PlpToolbar as $t}from"./PlpToolbar.js";import Ht from"../catalog/SortSelect.js";import Yt from"./PlpVehicleBar.js";import qt from"./PlpVehicleGate.js";import{useVehicleCatalog as Jt}from"./useVehicleCatalog.js";import{useVehicleFit as Qt}from"../fitment/useVehicleFit.js";import{usePlpFiltersInUrl as Ut}from"./usePlpFiltersInUrl.js";import{say as F}from"efficient-web-builder/format/lib/editor-words";const Vo={heading:"Let's find wheels that fit your car.",intro:"Tell us what you drive and we'll show you every set that bolts straight on — bolt pattern, offset and hub bore checked for you."};function Xt({level:v,className:P,children:k}){return r(v===2?"h2":"h1",{className:P,children:k})}const Zt=Qe({},"AlloyWheelsListing");function eo({heading:v="",intro:P="",askForCar:k=!0,gateHeading:B="",gateIntro:ae="",perPage:E=24,columns:ce,defaultSort:pe="recommended",hiddenFacets:me=[],fieldUsage:f=Xe,showPrice:K=!0,showInStock:de=!0,kinds:ue,products:he,wheels:fe,requestQuery:ge,editing:d=!1,ownerId:ye="",template:Se,cardImage:xe,hover:we=Zt,titleLevel:be}){const{currency:l}=Ze(),u=At(ue),j=tt(),M=it(ce),ve=lt(M,d?j:null),Pe=at(M,d?j:null),D=He("plp"),ke=Et(D),Ce=nt(),W=he??fe??Ce??[],$=i(()=>_t(W,u),[W,u.join(",")]),o=Qt({editing:d,enabled:k,autoApply:!0}),[Ne,I]=Je(!1),Te=wt(pe,u),g=o.applied?.vehicle??null,[e,x]=Ut({editing:d,openingSort:Te,appliedVehicle:g,vehicleRestored:o.restored,requestQuery:ge}),c=vt(u,e.kind),s=m(t=>x(t),[x]),H=m((t,h)=>{const a=e[t],De=a.map(String).includes(h)?a.filter(We=>String(We)!==h):[...a,t==="diameters"?Number(h):h];s({...e,[t]:De,page:1})},[e,s]),Y=m(t=>s({...e,priceMax:t,page:1}),[e,s]),q=m(t=>s({...e,inStockOnly:t,page:1}),[e,s]),J=m(t=>s({...ie,kind:t,inStockOnly:e.inStockOnly,priceMax:e.priceMax,sort:e.sort}),[e.inStockOnly,e.priceMax,e.sort,s]),_e=m(t=>s({...e,sort:t,page:1}),[e,s]),Ae=m(t=>{s({...e,page:t}),typeof window<"u"&&window.scrollTo({top:0,behavior:st()})},[e,s]),Q=m(()=>s({...ie,sort:e.sort}),[e.sort,s]),{clear:N}=o,U=m(()=>{N(),I(!0),x(t=>({...t,page:1}))},[N]),ze=m(()=>{N(),I(!1),x(t=>({...t,page:1}))},[N]),T=g?[g.make,g.model,g.year,g.modification].join("|"):"",_=qe(null);Ye(()=>{if(o.restored){if(_.current===null){_.current=T;return}_.current!==T&&(_.current=T,x(t=>t.page===1?t:{...t,page:1}))}},[o.restored,T,x]);const A=Jt({catalog:$,shownKinds:u,vehicle:g,editing:d}),n=i(()=>{if(!o.fit)return A;const t=A.filter(a=>L(a)==="alloy-wheel"),h=new Set(Gt(t,o.fit).map(a=>a.slug));return A.filter(a=>L(a)!=="alloy-wheel"||h.has(le(a)))},[A,o.fit]),w=me.join(","),Le=i(()=>{const t=new Set(w?w.split(","):[]);return dt(n,e,l,c,f).filter(h=>!t.has(h.key))},[n,e,l,w,c.join(","),f]),y=i(()=>mt(n,e,l),[n,e,l]),X=c.length>1,Z=i(()=>ne(f,"alloy-wheel"),[f]),Ie=i(()=>ne(f,"tyre"),[f]),z=i(()=>Nt(y),[y]),O=i(()=>Tt(y),[y]),R=X?V(["alloy-wheel"]).one:null,Oe=i(()=>({kindLabel:R,brand:z,process:O}),[R,z,O]),Re=jt({kind:!!R,brand:z,process:O},Z),Ge=i(()=>K?bt(n,l):null,[n,l,K]),Ve=i(()=>xt(n,e,l),[n,e,l]),Fe=i(()=>ut(n,u,e,l),[n,u.join(","),e,l]),Be=m((t,h)=>{const a=yt(n.flatMap(Ct),e.tyreSizes[0]??"",t,h);s({...e,tyreSizes:a?[a]:[],page:1})},[n,e,s]),Ee=i(()=>{const t=new Set(w?w.split(","):[]);return!St(n,c)||t.has("tyreSizes")?null:ht(n,e,l)},[n,e,l,w,c.join(","),f]),S=i(()=>gt(y,e.page,E),[y,e.page,E]),b=V(c),G=Lt(c),ee=zt(B,ae,c,u),te=c.length===1&&c[0]==="tyre",oe=o.applied?.stock??null,C=i(()=>Ot(oe),[oe]),Ke=i(()=>n.filter(t=>c.includes(L(t))).length,[n,c.join(",")]),re=$.length===0,je=!re&&n.length===0,Me=k&&!d&&!o.applied&&!Ne;return u.length===0?null:p("section",{children:[k&&r(Yt,{cascade:o.cascade,appliedName:o.appliedName,fit:o.fit,fitSummary:te&&C.length>0?`Takes ${C.join(" · ")}`:null,resolving:o.resolving,unresolved:te?!!o.applied&&!o.resolving&&C.length===0:o.unresolved,matchCount:Ke,copy:G,onAmend:ze,onClear:U}),Me&&r(qt,{cascade:o.cascade,heading:ee.heading,intro:ee.intro,ready:o.restored,copy:G,onSkip:()=>I(!0)}),p("div",{className:"px-5 py-10 md:px-[max(2.5rem,calc((100%_-_var(--sf-content-cap,100%))/2_+_2.5rem))]",children:[(v||P)&&p("header",{className:"mb-6",children:[v&&r(Xt,{level:be,className:"font-display text-[clamp(28px,4vw,40px)] [font-weight:var(--sf-heading-weight,500)] [text-transform:var(--sf-heading-case,uppercase)] leading-[1.05] tracking-[-0.02em]",children:rt(v,!1)}),P&&r("p",{className:"mt-2 max-w-[60ch] text-[15px] text-fg-dim",children:ot(P)})]}),p("div",{className:"flex flex-col gap-8 lg:flex-row lg:items-start",children:[r(Dt,{facets:Le,filters:e,typeOptions:Fe,sizeBoxes:Ee,sizeMatches:e.tyreSizes.length>0?y.length:null,noun:b,priceBounds:Ge,inStockCount:de?Ve:null,onToggle:H,onPickType:J,onPickSize:Be,onPriceMax:Y,onInStockOnly:q,onClearAll:Q}),p("div",{className:"min-w-0 flex-1",children:[r($t,{className:"mb-4",start:p($e,{children:[r(Wt,{total:S.total,range:{from:S.from,to:S.to},noun:b}),r(Vt,{filters:e,onToggle:H,onPriceMax:Y,onInStockOnly:q,onPickType:J})]}),end:r(Ht,{value:e.sort,keys:Pt(u),labels:kt,onChange:_e})}),re?r("div",{className:"border border-dashed border-line p-10",children:r("p",{className:"font-mono text-[12px] uppercase tracking-[0.16em] text-fg-dim",children:d?b.many==="wheels"?F("No wheels in this website's catalog yet — curate products to see them here."):b.many==="tyres"?F("No tyres in this website's catalog yet — curate products to see them here."):F("No products in this website's catalog yet — curate products to see them here."):"Our catalog is being updated. Please check back shortly."})}):je?p("div",{className:"border border-line p-10",children:[p("h3",{className:"font-display text-[22px] font-medium uppercase tracking-[-0.01em]",children:["No confirmed fit for your ",o.appliedName]}),r("p",{className:"mt-2 max-w-[52ch] text-[14px] text-fg-dim",children:G.nothingFits}),p("button",{type:"button",onClick:U,className:"mt-4 cursor-pointer bg-btn px-4 py-3 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-btn-ink hover:bg-fg",children:["Show all ",b.many]})]}):S.total===0?p("div",{className:"border border-line p-10",children:[p("h3",{className:"font-display text-[22px] font-medium uppercase tracking-[-0.01em]",children:["No ",b.many," match those filters"]}),r("p",{className:"mt-2 max-w-[46ch] text-[14px] text-fg-dim",children:"Try widening the price range or clearing a filter."}),ft(e)&&r("button",{type:"button",onClick:Q,className:"mt-4 cursor-pointer bg-btn px-4 py-3 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-btn-ink hover:bg-fg",children:"Clear all filters"})]}):p(Ft,{value:{ownerId:ye,ownerType:"AlloyWheelsListing",Template:Se,hover:we,imageSizes:Pe,fieldUsage:Z,reserveEyebrow:Re,editing:d,eyebrow:Oe,fit:o.fit,colours:e.finishes,setGridGap:`var(${se})`,rules:Kt},children:[r("style",{children:ke}),r("div",{className:`plp-card-grid ${D} ${ct} ${Ue}`,style:{...ve,...pt(`var(${se})`)},children:r(Bt,{items:S.items,isWheel:t=>L(t)!=="tyre",other:t=>r(Rt,{item:t,currency:l,fitSize:C.length>0?It(t.sizes,C):null,kindLabel:X?V(["tyre"]).one:null,showBrand:z,editing:d,fieldUsage:Ie,cardImage:xe},`tyre:${le(t)}`)})})]}),r(Mt,{page:S.page,pageCount:S.pageCount,onPage:Ae}),r(et,{editing:d})]})]})]})]})}export{Vo as PLP_GATE_DEFAULTS,eo as default};
@@ -335,7 +335,9 @@ export declare const fitment: {
335
335
  export declare const products: {
336
336
  listWheels: (process?: string | null, opts?: ListReadOpts) => Promise<WheelSummary[]>;
337
337
  listWheelsBySlug: (slugs: readonly string[], opts?: ListReadOpts) => Promise<WheelSummary[]>;
338
- listCatalog: (kinds: readonly ProductKind[], vehicle?: TyreFitVehicleQuery | null) => Promise<ProductSummary[]>;
338
+ listCatalog: (kinds: readonly ProductKind[], vehicle?: TyreFitVehicleQuery | null, opts?: {
339
+ maxRows?: number;
340
+ }) => Promise<ProductSummary[]>;
339
341
  getWheel: (slug: string) => Promise<Wheel>;
340
342
  getTyre: (slug: string) => Promise<Tyre>;
341
343
  listBundles: (opts?: ListReadOpts) => Promise<Bundle[]>;
@@ -1 +1 @@
1
- import{PREVIEW_TOKEN_HEADER as at,SITE_HOST_HEADER as st,SITE_SLUG_HEADER as nt}from"../site-headers.js";import{PRODUCT_API_BASE as ot,PRODUCT_BACKEND_URL as D}from"./origins.js";import{backendHopHeaders as it,clientIpFromForwardedFor as ct,FORWARDED_FOR_HEADER as dt,hopCachingOf as ut}from"../forwarded-for.js";import lt from"efficient-web-builder/format/lib/document/media-manifest.json";import{auth as P}from"../auth.js";import{efficientClientOpen as pt}from"efficient-easel/screen/lib/session";import{listableWheelSummaries as U}from"../wheels/listable-wheels.js";import{dropRenderlessFinishes as x}from"../wheels/renderable-finishes.js";const yt=process.env.NEXT_PUBLIC_API_URL??"http://localhost:8000";class m extends Error{status;data;constructor(e,s,o){super(s),this.status=e,this.data=o}}const N="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.",ht=new Set([502,503,504]),I=0,ft="This editor runs on its host's own backend, which does not serve this request.",gt=5e3,wt=15e3,mt=()=>typeof window>"u"?gt:wt;function H(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(mt())}const F=t=>t instanceof Error&&t.name==="TimeoutError",M=(t,e)=>ht.has(t)?N:e,St=["admin","venue"];let B="admin";function ie(t){B=St.includes(t)?t:"admin"}function Pt(){return B}const Ot=/^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{1,8})*$/;let q=null;function ce(t){q=t&&Ot.test(t)?t:null}function bt(){return q}function At(t){if(typeof window>"u"||!t.startsWith("/api/v1/"))return t;const e=K();return!e||/[?&]site=/.test(t)?t:E(t,`site=${encodeURIComponent(e)}`)}async function i(t,e={}){const{token:s,baseUrl:o,headers:l,audience:p,...w}=e;if(typeof window<"u"&&!pt())throw new m(I,ft,null);if(typeof window>"u"&&o===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 r=typeof FormData<"u"&&w.body instanceof FormData;let a;try{a=await fetch(`${o??yt}${At(t)}`,{...w,headers:{...r?{}:{"Content-Type":"application/json"},...s?{Authorization:`Bearer ${s}`}:{},...p===null?{}:{"X-Portal-Audience":p??"shop"},...l},signal:w.signal??H({...w,audience:p})})}catch(y){throw y instanceof TypeError||F(y)?new m(I,N,null):y}let n;try{n=await a.text()}catch(y){throw F(y)?new m(I,N,null):y}let c=null;if(n)try{c=JSON.parse(n)}catch{throw new m(a.status,a.ok?"Expected JSON but received a non-JSON response":M(a.status,a.statusText),n)}if(!a.ok){const y=(c&&typeof c=="object"&&"detail"in c&&typeof c.detail=="string"?c.detail:null)??M(a.status,a.statusText);throw new m(a.status,y,c)}return c}let b=null;async function G(){return b||(b=Tt().finally(()=>{b=null}),b)}async function Tt(){const t=P.takeLegacyRefresh(),e=await Rt.refresh(t??void 0);return P.setTokens(e.access),e.access}async function W(){return P.getAccess()??G()}async function h(t,e={}){let s;try{s=await W()}catch{throw P.clear(),new m(401,"Not signed in",null)}try{return await i(t,{...e,token:s})}catch(o){if(!(o instanceof m)||o.status!==401)throw o;try{const l=await G();return await i(t,{...e,token:l})}catch{throw P.clear(),o}}}async function j(t,e={}){if(P.getAccess())try{return{data:await h(t,e),asShopper:!0}}catch(s){if(!(s instanceof m)||s.status!==401)throw s}return{data:await i(t,e),asShopper:!1}}async function z(){const t=await h("/api/auth/me/");if(t.portal!=="shop")throw P.clear(),new m(403,"This session is not valid for this shop.",null);return t}const Rt={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()=>{P.clear();try{await i("/api/auth/logout/",{method:"POST",body:JSON.stringify({portal:"shop"}),credentials:"include"})}catch{}},restoreSession:async()=>{const t=await W();return await z(),t},me:z,updateMe:t=>h("/api/auth/me/",{method:"PATCH",body:JSON.stringify(t)}),changePassword:(t,e)=>h("/api/auth/me/",{method:"PATCH",body:JSON.stringify({password:e,old_password:t})}),changeEmail:(t,e)=>h("/api/shop-portal/change-email/",{method:"POST",body:JSON.stringify({new_email:t,current_password:e})}),myProfile:()=>h("/api/shop-portal/profile/"),updateMyProfile:t=>h("/api/shop-portal/profile/",{method:"PATCH",body:JSON.stringify(t)}),myAddresses:()=>h("/api/shop-portal/delivery-locations/"),createAddress:t=>h("/api/shop-portal/delivery-locations/",{method:"POST",body:JSON.stringify(t)}),updateAddress:(t,e)=>h(`/api/shop-portal/delivery-locations/${t}/`,{method:"PATCH",body:JSON.stringify(e)}),deleteAddress:t=>h(`/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,s)=>i("/api/auth/password-reset/confirm/",{method:"POST",body:JSON.stringify({uid:t,token:e,new_password:s})}),brands:()=>h("/api/products/brands/"),myOrders:()=>h("/api/shop-portal/orders/").then(t=>t.results),myOrder:t=>h(`/api/shop-portal/orders/${t}/`),cancelOrder:t=>h(`/api/shop-portal/orders/${t}/cancel/`,{method:"POST"}),myReturns:t=>h(`/api/shop-portal/returns/${t?`?order=${encodeURIComponent(t)}`:""}`).then(e=>e.results),createReturn:t=>h("/api/shop-portal/returns/",{method:"POST",body:JSON.stringify(t)}),withdrawReturn:t=>h(`/api/shop-portal/returns/${t}/cancel/`,{method:"POST"}),uploadReturnPhoto:(t,e)=>{const s=new FormData;return s.append("claim_item",t),s.append("file",e),s.append("media_type",e.type.startsWith("video/")?"video":"image"),h("/api/shop-portal/return-media/",{method:"POST",body:s})}};import{media as Et,absolutizeApiUrl as v}from"efficient-web-builder/render/lib/media";import{analyzeLogoSvg as Ct,isSvgUrl as $t}from"efficient-web-builder/format/lib/logo/reverse-svg";import{getEditorSiteId as _t}from"efficient-web-builder/render/lib/editor-site";import{shopRouteBase as Ut,webRuntimeSiteSlug as K}from"efficient-web-builder/format/lib/web-runtime";function g(t){if(typeof t=="string")return t.startsWith("/media/")?Et(t):t;if(Array.isArray(t))return t.map(g);if(t&&typeof t=="object"){const e={};for(const[s,o]of Object.entries(t))e[s]=s==="captions"&&o&&typeof o=="object"&&!Array.isArray(o)?Object.fromEntries(Object.entries(o).map(([l,p])=>[g(l),p])):g(o);return e}return t}import{PRODUCT_API_BASE as Pe}from"./origins.js";const V=typeof window>"u"&&D!=="",Nt=V?D:ot,It=Ut,O=()=>({baseUrl:It(),audience:null});function d(t,e){const s=e?`?process=${encodeURIComponent(e)}`:"";return`/api/v1${t}${s}`}const X=100,Z=50;function k(t,e,s){const o=new URLSearchParams;for(const[l,p]of Object.entries(e))p!=null&&p!==""&&o.set(l,String(p));return o.set("pageSize",String(X)),s&&o.set("cursor",s),`/api/v1${t}?${o.toString()}`}function vt(t,e){return k("/wheels",{process:t},e)}const Y=X;function kt(t,e){return k("/wheels",{slug:t.join(",")},e)}function Jt(t,e,s){return k("/products",{kind:t.join(","),make:e?.make,model:e?.model,year:e?.year,modification:e?.modification},s)}function Lt(t){if(!t)return null;try{return new URL(t,"http://cursor.invalid").searchParams.get("cursor")}catch{return null}}async function J(t,e,s=()=>!1){const o=[];let l=null;try{for(let p=0;p<Z;p++){const w=await i(await e(l),await u());if(o.push(...w.results),l=Lt(w.next),!l)break}l&&console.warn(`[${t}] stopped at ${Z} pages (${o.length} rows); catalog may be truncated`)}catch(p){if(s(p))throw p;console.warn(`[${t}] product API unavailable, returning []`,p)}return o}const Q=t=>t instanceof m&&t.status===400;function Dt(t){return t.flatMap(e=>e.kind==="alloy-wheel"?U([e]):[e])}async function tt(){return(await xt()).host}async function xt(){try{const{headers:t}=await import("next/headers"),e=await t(),s=p=>p?.split(",")[0]?.split(":")[0]?.trim().toLowerCase()||null,o=s(e.get(st)??e.get("x-forwarded-host")??e.get("host")),l=s(e.get("host"));return{host:o,matchesRequestHost:o!==null&&o===l}}catch{return{host:null,matchesRequestHost:!1}}}async function Ht(){try{const{headers:t}=await import("next/headers");return ct((await t()).get(dt))}catch{return null}}async function Ft(){try{const{headers:t}=await import("next/headers");return(await t()).get(nt)||null}catch{return null}}async function Mt(){const t=await Ft();if(t)return`site=${encodeURIComponent(t)}`;const e=await tt();return e?`host=${encodeURIComponent(e)}`:""}async function f(t){if(typeof window<"u"){const e=K();return e?E(t,`site=${encodeURIComponent(e)}`):t}return E(t,await Mt())}function E(t,e){return e?`${t}${t.includes("?")?"&":"?"}${e}`:t}const Bt="preview";async function qt(){if(typeof window<"u")return null;try{const{headers:t}=await import("next/headers");return(await t()).get(at)}catch{return null}}async function Gt(){try{const{headers:t}=await import("next/headers");return(await t()).get("user-agent")}catch{return null}}async function L(t,e){const s=await qt();if(s===null)return[await f(t),await u(e)];const o=E(await f(t),`${Bt}=${encodeURIComponent(s)}`),{next:l,cache:p,...w}=e??{},r=await u({...w,cache:"no-store"}),a=await Gt();return a&&(r.headers={...r.headers,"user-agent":a}),[o,r]}async function Wt(t){if(!V)return;const[e,s]=await Promise.all([tt(),Ht()]),o=it(e,s,t);return Object.keys(o).length>0?o:void 0}async function u(t){const e=await Wt(ut(t)),s={baseUrl:Nt,...t};return e&&(s.headers={...e,...t?.headers}),s}const A=typeof window>"u";function T(t,e){const s=new URLSearchParams;for(const[l,p]of Object.entries(e))p!==void 0&&p!==""&&s.set(l,String(p));const o=s.toString();return`/api/v1/fitment${t}${o?`?${o}`:""}`}const ye={listMakes:async t=>{if(A){const{fitmentData:s}=await import("./fitment-data.js");return s.makes(t)}return(await i(T("/makes",{region:t}),O())).results},listModels:async(t,e)=>{if(A){const{fitmentData:o}=await import("./fitment-data.js");return o.models(t,e)}return(await i(T("/models",{make:t,region:e}),O())).results},listYears:async(t,e,s)=>{if(A){const{fitmentData:l}=await import("./fitment-data.js");return l.years(t,e,s)}return(await i(T("/years",{make:t,model:e,region:s}),O())).results},listModifications:async(t,e,s,o)=>{if(A){const{fitmentData:p}=await import("./fitment-data.js");return p.modifications(t,e,s,o)}return(await i(T("/modifications",{make:t,model:e,year:s,region:o}),O())).results},getStockFitment:async(t,e,s,o,l)=>{if(A){const{fitmentData:p}=await import("./fitment-data.js");return p.stockFitment(t,e,s,o,l)}return i(T("/stock-fitment",{make:t,model:e,year:s,modification:o,region:l}),O())}},he={listWheels:async(t,e={})=>{const s=await J("products.listWheels",async o=>await f(vt(t,o)),e.throwOnFailure?()=>!0:void 0);return U(g(s))},listWheelsBySlug:async(t,e={})=>{const s=[...new Set(t.map(r=>r.trim()).filter(Boolean))];if(s.length===0)return[];const o=[];for(let r=0;r<s.length;r+=Y)o.push(s.slice(r,r+Y));const l=await Promise.all(o.map(r=>J("products.listWheelsBySlug",async a=>await f(kt(r,a)),e.throwOnFailure?()=>!0:Q))),p=new Set(s),w=l.flat().filter(r=>p.has(r.slug));return U(g(w))},listCatalog:async(t,e)=>{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 J("products.listCatalog",async o=>await f(Jt(t,e,o)),Q);return Dt(g(s))},getWheel:async t=>x(g(await i(await f(d(`/wheels/${t}`)),await u()))),getTyre:async t=>g(await i(await f(d(`/tyres/${t}`)),await u())),listBundles:async(t={})=>{try{return await i(await f(d("/bundles")),await u())}catch(e){if(t.throwOnFailure)throw e;return[]}},getBundle:async t=>i(await f(d(`/bundles/${t}`)),await u()),listGalleryBuilds:async(t={})=>{const{process:e=null,wheelSlug:s=null}=t;if(typeof window>"u"){const{listGalleryBuilds:o}=await import("./gallery-builds-data.js");return g(o(e,s))}try{const o=new URLSearchParams;e&&o.set("process",e),s&&o.set("wheelSlug",s);const l=o.toString(),p=await i(`/api/v1/gallery-builds${l?`?${l}`:""}`,O());return g(p.results)}catch(o){return console.warn("[products.listGalleryBuilds] product API unavailable, returning []",o),[]}},getSite:async()=>i(await f(d("/site")),await u()),getSiteBySlug:async t=>i(`${d("/site")}?${new URLSearchParams({site:t})}`,typeof window>"u"?await u():void 0),listPages:async()=>g(await i(await f(d("/pages")),await u())),listPopups:async()=>i(await f(d("/popups")),await u()),listProductTemplates:async()=>{try{return await i(await f(d("/product-templates")),await u())}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(`${d("/dynamic-pages")}${e}`),await u())}catch(s){if(s instanceof m&&s.status===404)return[];throw s}},getRecord:async(t,e)=>{try{return await i(await f(d(`/records/${encodeURIComponent(t)}/${encodeURIComponent(e)}`)),await u())}catch(s){if(s instanceof m&&s.status===404)return null;throw s}},listRecordKeys:async t=>{try{const e=await i(await f(d(`/records/${encodeURIComponent(t)}`)),await u({cache:"no-store"}));return Array.isArray(e?.keys)?e.keys.filter(s=>typeof s=="string"&&s!==""):[]}catch(e){if(e instanceof m&&e.status===404)return[];throw e}},listProductTypeChoices:async()=>{try{return await i(await f(d("/product-type-choices")),await u())}catch(t){return console.warn("[products.listProductTypeChoices] unavailable, returning []",t),[]}},listFieldUsage:async()=>{try{return await i(await f(d("/field-usage")),await u())}catch(t){return console.warn("[products.listFieldUsage] unavailable, returning []",t),[]}},getPage:async(t,e={})=>{const s=e.record?`?record=${encodeURIComponent(e.record)}`:"",[o,l]=await L(d(`/pages/${t}`)+s,e.revalidate!==void 0?{next:{revalidate:e.revalidate}}:void 0);return g(await i(o,l))},listBlogPosts:async(t={},{throwOnFailure:e=!1}={})=>{const s=t.category?`?category=${encodeURIComponent(t.category)}`:"";try{return(await i(d("/blog-posts")+s,await u())).map(l=>({...l,coverImage:v(l.coverImage)??""}))}catch(o){if(e)throw o;return console.warn("[products.listBlogPosts] blog API unavailable, returning []",o),[]}},getBlogPost:async t=>{const e=await i(d(`/blog-posts/${t}`),await u());return{...e,coverImage:v(e.coverImage)??""}},createOrder:async t=>i(d("/orders"),await u({method:"POST",body:JSON.stringify(t)})),createOrderAuthed:async t=>h(d("/orders"),await u({method:"POST",body:JSON.stringify(t)})),lookupOrder:async t=>i(d("/orders/lookup"),await u({method:"POST",body:JSON.stringify(t)})),createPaymentIntent:async t=>i(d("/payments/intent"),await u({method:"POST",body:JSON.stringify(t)})),releaseCheckout:async t=>i(d("/checkouts/release"),await u({method:"POST",body:JSON.stringify(t)})),createPaypalOrder:async t=>i(d("/payments/paypal/order"),await u({method:"POST",body:JSON.stringify(t)})),capturePaypalOrder:async t=>i(d("/payments/paypal/capture"),await u({method:"POST",body:JSON.stringify(t)})),createAfterpayCheckout:async t=>i(d("/payments/afterpay/checkout"),await u({method:"POST",body:JSON.stringify(t)})),captureAfterpayPayment:async t=>i(d("/payments/afterpay/capture"),await u({method:"POST",body:JSON.stringify(t)})),chargeSquare:async t=>i(d("/payments/square/charge"),await u({method:"POST",body:JSON.stringify(t)})),createGocardlessBillingRequest:async t=>i(d("/payments/gocardless/billing-request"),await u({method:"POST",body:JSON.stringify(t)})),completeGocardlessPayment:async t=>i(d("/payments/gocardless/complete"),await u({method:"POST",body:JSON.stringify(t)})),createZipCheckout:async t=>i(d("/payments/zip/checkout"),await u({method:"POST",body:JSON.stringify(t)})),captureZipPayment:async t=>i(d("/payments/zip/capture"),await u({method:"POST",body:JSON.stringify(t)})),createKlarnaCheckout:async t=>i(d("/payments/klarna/checkout"),await u({method:"POST",body:JSON.stringify(t)})),captureKlarnaPayment:async t=>i(d("/payments/klarna/capture"),await u({method:"POST",body:JSON.stringify(t)})),createStockAlert:async t=>i(d("/stock-alerts"),await u({method:"POST",body:JSON.stringify(t)})),createPreOrderIntent:async t=>i(d("/pre-order-intents"),await u({method:"POST",body:JSON.stringify(t)})),createNewsletterSubscription:async t=>i(d("/newsletter-subscriptions"),await u({method:"POST",body:JSON.stringify(t)})),unsubscribeNewsletter:async t=>i(d("/newsletter-unsubscribe"),await u({method:"POST",body:JSON.stringify(t)})),captureCart:async t=>i(d("/carts"),await u({method:"POST",body:JSON.stringify(t)})),restoreCart:async t=>i(d("/carts/restore"),await u({method:"POST",body:JSON.stringify(t)})),unsubscribeCartReminders:async t=>i(d("/carts/unsubscribe"),await u({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 s=d("/reviews"),o=e.toString();try{return await i(await f(o?`${s}?${o}`:s),await u())}catch(l){return console.warn("[products.listReviews] product API unavailable, returning []",l),[]}},submitReview:async t=>i(d("/reviews"),await u({method:"POST",body:JSON.stringify(t)})),getForm:async t=>i(d(`/forms/${encodeURIComponent(t)}`),await u()),submitForm:async(t,e)=>i(d(`/forms/${encodeURIComponent(t)}/submissions`),await u({method:"POST",body:JSON.stringify(e)})),listShippingMethods:async()=>{try{return await i(d("/shipping-methods"),await u())}catch(t){return console.warn("[products.listShippingMethods] product API unavailable, returning []",t),[]}},listCountrySubdivisions:async t=>{try{return await i(d(`/countries/${encodeURIComponent(t)}/subdivisions`),await u())}catch(e){return console.warn("[products.listCountrySubdivisions] unavailable, returning []",e),[]}},quoteCart:async t=>{const e=d("/cart/quote"),s=await u({method:"POST",body:JSON.stringify(t)});return t.couponCode?(await j(e,s)).data:i(e,s)},validateCoupon:async t=>{const{data:e,asShopper:s}=await j(d("/coupons/validate"),await u({method:"POST",body:JSON.stringify(t)}));return{...e,askedAsShopper:s}},getHeaderSettings:async()=>{const t=H({method:"GET"}),e=await i(...await L(d("/header-settings"),{signal:t})),s=v(e.logoUrl);let o=null,l=null;if(s&&$t(s)){const p=await Ct(s,t);p&&(o=p.reversed,l=p.inkIsDark)}return{...e,logoUrl:s,logoReversed:o,logoInkIsDark:l}},getThemeSettings:async()=>i(...await L(d("/theme-settings"))),getChatSettings:async()=>i(await f(d("/chat-settings")),await u())},fe={listServices:async()=>{try{return await i(d("/bookings/services"),await u())}catch(t){return console.warn("[bookings.listServices] API unavailable, returning []",t),{results:[],currency:"USD"}}},getAvailability:async(t,e)=>i(d(`/bookings/availability?service=${encodeURIComponent(t)}&date=${e}`),await u()),create:async t=>i(d("/bookings"),await u({method:"POST",body:JSON.stringify(t)})),get:async t=>i(d(`/bookings/manage/${encodeURIComponent(t)}`),await u()),cancel:async t=>i(d(`/bookings/manage/${encodeURIComponent(t)}/cancel`),await u({method:"POST"})),createPaymentIntent:async t=>i(d("/bookings/payments/intent"),await u({method:"POST",body:JSON.stringify({manageToken:t})}))};class jt extends Error{slug;count;constructor(e,s){super(`Slug "${e}" exists on ${s} websites; a site is required to pick one.`),this.slug=e,this.count=s,this.name="AmbiguousPageSlugError"}}const C=(t,e,s)=>{const o=new URLSearchParams({...e?{site:e}:{},...s?{draft:"1"}:{}}).toString();return`/api/storefront/${t}/${o?`?${o}`:""}`},$=t=>`/api/storefront/sites/${encodeURIComponent(t)}/`,zt=t=>`${$(t)}currencies/`,Kt="/api/storefront/media/ingest/";class Vt 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 Xt(){const t=_t();if(!t)throw new Vt;return`${Kt}?${new URLSearchParams({site:t})}`}const Zt="X-Puck-Media-Manifest",et=lt.contentHash,_={"X-Media-Manifest":et,[Zt]:et},ge=rt({});function rt(t){return(e,s={})=>{const o=bt(),l=t.headers||o?{...o?{"Accept-Language":o}:{},...t.headers,...s.headers}:void 0;return i(e,{...s,...t.baseUrl!==void 0?{baseUrl:t.baseUrl}:{},...l?{headers:l}:{},audience:t.audience??Pt()})}}function Yt(t={}){const e=rt(t),s=t.siteDrafts===!0,o=r=>C("header-settings",r,s),l=r=>C("theme-settings",r,s),p=r=>C("chat-settings",r,s),w=r=>C("social-settings",r,s);return{findPageBySlug:async(r,a,n)=>{const c=new URLSearchParams({slug:r});n&&c.set("site",n);const y=await e(`/api/storefront/pages/?${c.toString()}`,{token:a}),S=Array.isArray(y)?y:y.results??[];if(!n&&S.length>1)throw new jt(r,S.length);return S[0]??null},getPageById:(r,a)=>e(`/api/storefront/pages/${r}/`,{token:a}),saveLayout:(r,a,n,c,y)=>e(`/api/storefront/pages/${r}/`,{method:"PATCH",body:JSON.stringify({layout:a,expected_updated_at:c,...y?{client_id:y}:{}}),token:n}),duplicatePage:(r,a,n)=>e(`/api/storefront/pages/${r}/duplicate/`,{method:"POST",body:JSON.stringify({title:a.title,slug:a.slug}),token:n}),geocode:(r,a,n)=>e(`/api/storefront/geocode/?${new URLSearchParams(n?{q:r,country:n}:{q:r})}`,{token:a}),listBlockSources:r=>e("/api/storefront/block-sources/",{token:r}),listRecordTypes:r=>e("/api/storefront/record-types/",{token:r}),createPagePreviewLink:(r,a)=>e(`/api/storefront/pages/${r}/preview-link/`,{method:"POST",token:a}),claimPageEditLock:(r,a,n,c=!1)=>e(`/api/storefront/pages/${r}/edit-lock/`,{method:"POST",body:JSON.stringify({client_id:n,takeover:c}),token:a}),releasePageEditLock:(r,a)=>e(`/api/storefront/pages/${r}/edit-lock/`,{method:"DELETE",token:a}),createTemplate:(r,a,n)=>e("/api/storefront/page-templates/",{method:"POST",body:JSON.stringify({name:r,layout:a}),headers:_,token:n}),getTemplate:(r,a)=>e(`/api/storefront/page-templates/${r}/`,{token:a}),saveTemplateLayout:(r,a,n)=>e(`/api/storefront/page-templates/${r}/`,{method:"PATCH",body:JSON.stringify({layout:a}),headers:_,token:n}),listTemplatePages:async(r,a)=>{const n=await e(`/api/storefront/template-pages/?template=${encodeURIComponent(r)}`,{token:a});return Array.isArray(n)?n:n.results??[]},findTemplatePageBySlug:async(r,a,n)=>{const c=await e(`/api/storefront/template-pages/?template=${encodeURIComponent(r)}&slug=${encodeURIComponent(a)}`,{token:n});return(Array.isArray(c)?c:c.results??[])[0]??null},createTemplatePage:(r,a,n)=>e("/api/storefront/template-pages/",{method:"POST",body:JSON.stringify({template:r,...a}),headers:_,token:n}),saveTemplatePageLayout:(r,a,n)=>e(`/api/storefront/template-pages/${r}/`,{method:"PATCH",body:JSON.stringify({layout:a}),headers:_,token:n}),deleteTemplatePage:(r,a,n)=>e(`/api/storefront/template-pages/${r}/`,{method:"DELETE",token:a,...n?.keepalive?{keepalive:!0}:{}}),listPages:async(r,a)=>{const n=new URLSearchParams({no_page:"true"});a&&n.set("site",a);const c=await e(`/api/storefront/pages/?${n.toString()}`,{token:r});return Array.isArray(c)?c:c.results??[]},createPage:(r,a,n,c)=>e("/api/storefront/pages/",{method:"POST",body:JSON.stringify({title:r,slug:a,layout:n}),token:c}),deletePage:(r,a)=>e(`/api/storefront/pages/${r}/`,{method:"DELETE",token:a}),getHeaderSettings:(r,a)=>e(o(a),{token:r}),listMenus:async(r,a)=>{const n=new URLSearchParams({no_page:"true"});a&&n.set("site",a);const c=await e(`/api/storefront/menus/?${n}`,{token:r});return Array.isArray(c)?c:c.results??[]},listBlogPosts:async(r,a={})=>{const n=new URLSearchParams({no_page:"true"});a.visibleOnly&&n.set("is_visible","true"),a.siteId&&n.set("site",a.siteId);const c=await e(`/api/storefront/blog-posts/?${n.toString()}`,{token:r});return Array.isArray(c)?c:c.results??[]},listFieldUsage:async(r,a)=>{const n=await e(`/api/storefront/field-usage/?site=${encodeURIComponent(a)}`,{token:r});return Array.isArray(n?.entries)?n.entries:[]},listCategories:async(r,a={})=>{const n=new URLSearchParams({no_page:"true"});a.visibleOnly&&n.set("is_visible","true"),a.siteId&&n.set("site",a.siteId);const c=await e(`/api/storefront/categories/?${n.toString()}`,{token:r});return[...Array.isArray(c)?c:c.results??[]].sort((S,R)=>S.sort_order-R.sort_order||S.name.localeCompare(R.name))},listForms:async(r,a={})=>{const n=new URLSearchParams({no_page:"true"});a.siteId&&n.set("site",a.siteId);const c=await e(`/api/storefront/forms/?${n.toString()}`,{token:r});return[...Array.isArray(c)?c:c.results??[]].sort((S,R)=>S.title.localeCompare(R.title))},listWheelSummaries:async(r,a={})=>{const n=new URLSearchParams;a.siteId&&n.set("site",a.siteId);const c=n.toString(),y=await e(`/api/storefront/wheel-curations/summaries/${c?`?${c}`:""}`,{token:r});return g(y)},listProducts:async(r,a={})=>{const n=new URLSearchParams;a.kinds?.length&&n.set("kind",a.kinds.join(",")),a.siteId&&n.set("site",a.siteId);const c=n.toString(),y=await e(`/api/storefront/products/${c?`?${c}`:""}`,{token:r});return g(y)},getWheelDetail:async(r,a,n={})=>{const c=new URLSearchParams({slug:a});return n.siteId&&c.set("site",n.siteId),x(g(await e(`/api/storefront/wheel-curations/detail/?${c.toString()}`,{token:r})))},updateHeaderSettings:(r,a,n)=>e(o(n),{method:"PATCH",body:JSON.stringify(r),token:a}),getSite:(r,a)=>e($(r),{token:a}),listSites:async r=>{const a=await e("/api/storefront/sites/?no_page=true",{token:r});return Array.isArray(a)?a:a.results??[]},listSiteCurrencies:async(r,a)=>{const n=await e(zt(r),{token:a});return Array.isArray(n)?n:[]},publishSite:(r,a)=>e(`${$(r)}publish/`,{method:"POST",token:a}),getSiteLiveState:(r,a)=>e(`${$(r)}live-state/`,{token:a}),getThemeSettings:(r,a)=>e(l(a),{token:r}),updateThemeSettings:(r,a,n)=>e(l(n),{method:"PATCH",body:JSON.stringify(r),token:a}),getMyPreferences:async r=>(await e("/api/auth/me/",{token:r})).preferences??{},updateMyPreferences:(r,a)=>e("/api/auth/me/",{method:"PATCH",body:JSON.stringify({preferences:r}),token:a}),getChatSettings:(r,a)=>e(p(a),{token:r}),updateChatSettings:(r,a,n)=>e(p(n),{method:"PATCH",body:JSON.stringify(r),token:a}),getSocialSettings:(r,a)=>e(w(a),{token:r}),updateSocialSettings:(r,a,n)=>e(w(n),{method:"PATCH",body:JSON.stringify(r),token:a}),uploadHeaderLogo:(r,a,n)=>{const c=new FormData;return c.append("logo",r),e(o(n),{method:"PATCH",body:c,token:a})},clearHeaderLogo:(r,a)=>e(o(a),{method:"PATCH",body:JSON.stringify({logo:null}),token:r}),setHeaderLogoFromAsset:(r,a,n)=>e(o(n),{method:"PATCH",body:JSON.stringify({logo_asset_id:r}),token:a}),uploadMedia:async(r,a)=>{const n=new FormData;return n.append("file",r),e(Xt(),{method:"POST",body:n,token:a})},listMedia:async(r,a)=>{const n=new URLSearchParams({no_page:"true"});a&&n.set("kind",a);const c=await e(`/api/storefront/media-assets/?${n.toString()}`,{token:r});return Array.isArray(c)?c:c.results??[]}}}const we=Yt({siteDrafts:!0});export{yt as API_URL,jt as AmbiguousPageSlugError,m as ApiError,wt as BROWSER_READ_TIMEOUT_MS,ft as EFFICIENT_CLIENT_CLOSED_MESSAGE,Vt as MediaUploadDestinationError,Bt as PREVIEW_PARAM,Pe as PRODUCT_API_BASE,gt as SERVER_READ_TIMEOUT_MS,N as SERVER_UNREACHABLE_MESSAGE,I as STATUS_NETWORK_ERROR,ge as adminFetch,Rt as api,i as apiFetch,E as appendSiteQuery,fe as bookings,Yt as createStorefrontAdmin,H as defaultRequestDeadline,Xt as editorMediaUploadPath,Pt as editorPortalAudience,bt as editorRequestLanguage,ye as fitment,he as products,mt as readDeadlineMs,Ht as resolveClientIp,g as resolveMediaUrls,qt as resolvePreviewToken,tt as resolveSiteHost,xt as resolveSiteHostSource,Ft as resolveSiteSlug,ce as setEditorLanguage,ie as setEditorPortalAudience,we as storefrontAdmin};
1
+ import{PREVIEW_TOKEN_HEADER as st,SITE_HOST_HEADER as nt,SITE_SLUG_HEADER as ot}from"../site-headers.js";import{PRODUCT_API_BASE as it,PRODUCT_BACKEND_URL as D}from"./origins.js";import{backendHopHeaders as ct,clientIpFromForwardedFor as dt,FORWARDED_FOR_HEADER as ut,hopCachingOf as lt}from"../forwarded-for.js";import pt from"efficient-web-builder/format/lib/document/media-manifest.json";import{auth as P}from"../auth.js";import{efficientClientOpen as yt}from"efficient-easel/screen/lib/session";import{listableWheelSummaries as U}from"../wheels/listable-wheels.js";import{dropRenderlessFinishes as x}from"../wheels/renderable-finishes.js";const ht=process.env.NEXT_PUBLIC_API_URL??"http://localhost:8000";class m extends Error{status;data;constructor(e,s,o){super(s),this.status=e,this.data=o}}const N="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.",ft=new Set([502,503,504]),I=0,gt="This editor runs on its host's own backend, which does not serve this request.",wt=5e3,mt=15e3,St=()=>typeof window>"u"?wt:mt;function H(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(St())}const F=t=>t instanceof Error&&t.name==="TimeoutError",M=(t,e)=>ft.has(t)?N:e,Pt=["admin","venue"];let B="admin";function ie(t){B=Pt.includes(t)?t:"admin"}function Ot(){return B}const bt=/^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{1,8})*$/;let q=null;function ce(t){q=t&&bt.test(t)?t:null}function At(){return q}function Tt(t){if(typeof window>"u"||!t.startsWith("/api/v1/"))return t;const e=K();return!e||/[?&]site=/.test(t)?t:E(t,`site=${encodeURIComponent(e)}`)}async function i(t,e={}){const{token:s,baseUrl:o,headers:l,audience:p,...g}=e;if(typeof window<"u"&&!yt())throw new m(I,gt,null);if(typeof window>"u"&&o===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 r=typeof FormData<"u"&&g.body instanceof FormData;let a;try{a=await fetch(`${o??ht}${Tt(t)}`,{...g,headers:{...r?{}:{"Content-Type":"application/json"},...s?{Authorization:`Bearer ${s}`}:{},...p===null?{}:{"X-Portal-Audience":p??"shop"},...l},signal:g.signal??H({...g,audience:p})})}catch(y){throw y instanceof TypeError||F(y)?new m(I,N,null):y}let n;try{n=await a.text()}catch(y){throw F(y)?new m(I,N,null):y}let c=null;if(n)try{c=JSON.parse(n)}catch{throw new m(a.status,a.ok?"Expected JSON but received a non-JSON response":M(a.status,a.statusText),n)}if(!a.ok){const y=(c&&typeof c=="object"&&"detail"in c&&typeof c.detail=="string"?c.detail:null)??M(a.status,a.statusText);throw new m(a.status,y,c)}return c}let b=null;async function G(){return b||(b=Rt().finally(()=>{b=null}),b)}async function Rt(){const t=P.takeLegacyRefresh(),e=await Et.refresh(t??void 0);return P.setTokens(e.access),e.access}async function W(){return P.getAccess()??G()}async function h(t,e={}){let s;try{s=await W()}catch{throw P.clear(),new m(401,"Not signed in",null)}try{return await i(t,{...e,token:s})}catch(o){if(!(o instanceof m)||o.status!==401)throw o;try{const l=await G();return await i(t,{...e,token:l})}catch{throw P.clear(),o}}}async function j(t,e={}){if(P.getAccess())try{return{data:await h(t,e),asShopper:!0}}catch(s){if(!(s instanceof m)||s.status!==401)throw s}return{data:await i(t,e),asShopper:!1}}async function z(){const t=await h("/api/auth/me/");if(t.portal!=="shop")throw P.clear(),new m(403,"This session is not valid for this shop.",null);return t}const Et={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()=>{P.clear();try{await i("/api/auth/logout/",{method:"POST",body:JSON.stringify({portal:"shop"}),credentials:"include"})}catch{}},restoreSession:async()=>{const t=await W();return await z(),t},me:z,updateMe:t=>h("/api/auth/me/",{method:"PATCH",body:JSON.stringify(t)}),changePassword:(t,e)=>h("/api/auth/me/",{method:"PATCH",body:JSON.stringify({password:e,old_password:t})}),changeEmail:(t,e)=>h("/api/shop-portal/change-email/",{method:"POST",body:JSON.stringify({new_email:t,current_password:e})}),myProfile:()=>h("/api/shop-portal/profile/"),updateMyProfile:t=>h("/api/shop-portal/profile/",{method:"PATCH",body:JSON.stringify(t)}),myAddresses:()=>h("/api/shop-portal/delivery-locations/"),createAddress:t=>h("/api/shop-portal/delivery-locations/",{method:"POST",body:JSON.stringify(t)}),updateAddress:(t,e)=>h(`/api/shop-portal/delivery-locations/${t}/`,{method:"PATCH",body:JSON.stringify(e)}),deleteAddress:t=>h(`/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,s)=>i("/api/auth/password-reset/confirm/",{method:"POST",body:JSON.stringify({uid:t,token:e,new_password:s})}),brands:()=>h("/api/products/brands/"),myOrders:()=>h("/api/shop-portal/orders/").then(t=>t.results),myOrder:t=>h(`/api/shop-portal/orders/${t}/`),cancelOrder:t=>h(`/api/shop-portal/orders/${t}/cancel/`,{method:"POST"}),myReturns:t=>h(`/api/shop-portal/returns/${t?`?order=${encodeURIComponent(t)}`:""}`).then(e=>e.results),createReturn:t=>h("/api/shop-portal/returns/",{method:"POST",body:JSON.stringify(t)}),withdrawReturn:t=>h(`/api/shop-portal/returns/${t}/cancel/`,{method:"POST"}),uploadReturnPhoto:(t,e)=>{const s=new FormData;return s.append("claim_item",t),s.append("file",e),s.append("media_type",e.type.startsWith("video/")?"video":"image"),h("/api/shop-portal/return-media/",{method:"POST",body:s})}};import{media as Ct,absolutizeApiUrl as v}from"efficient-web-builder/render/lib/media";import{analyzeLogoSvg as $t,isSvgUrl as _t}from"efficient-web-builder/format/lib/logo/reverse-svg";import{getEditorSiteId as Ut}from"efficient-web-builder/render/lib/editor-site";import{shopRouteBase as Nt,webRuntimeSiteSlug as K}from"efficient-web-builder/format/lib/web-runtime";function w(t){if(typeof t=="string")return t.startsWith("/media/")?Ct(t):t;if(Array.isArray(t))return t.map(w);if(t&&typeof t=="object"){const e={};for(const[s,o]of Object.entries(t))e[s]=s==="captions"&&o&&typeof o=="object"&&!Array.isArray(o)?Object.fromEntries(Object.entries(o).map(([l,p])=>[w(l),p])):w(o);return e}return t}import{PRODUCT_API_BASE as Pe}from"./origins.js";const V=typeof window>"u"&&D!=="",It=V?D:it,vt=Nt,O=()=>({baseUrl:vt(),audience:null});function d(t,e){const s=e?`?process=${encodeURIComponent(e)}`:"";return`/api/v1${t}${s}`}const X=100,Z=50;function k(t,e,s){const o=new URLSearchParams;for(const[l,p]of Object.entries(e))p!=null&&p!==""&&o.set(l,String(p));return o.set("pageSize",String(X)),s&&o.set("cursor",s),`/api/v1${t}?${o.toString()}`}function kt(t,e){return k("/wheels",{process:t},e)}const Y=X;function Jt(t,e){return k("/wheels",{slug:t.join(",")},e)}function Lt(t,e,s){return k("/products",{kind:t.join(","),make:e?.make,model:e?.model,year:e?.year,modification:e?.modification},s)}function Dt(t){if(!t)return null;try{return new URL(t,"http://cursor.invalid").searchParams.get("cursor")}catch{return null}}async function J(t,e,s=()=>!1,o=()=>!1){const l=[];let p=null;try{for(let g=0;g<Z;g++){const r=await i(await e(p),await u());if(l.push(...r.results),p=Dt(r.next),!p)break;if(o(l))return l}p&&console.warn(`[${t}] stopped at ${Z} pages (${l.length} rows); catalog may be truncated`)}catch(g){if(s(g))throw g;console.warn(`[${t}] product API unavailable, returning []`,g)}return l}const Q=t=>t instanceof m&&t.status===400;function tt(t){return t.flatMap(e=>e.kind==="alloy-wheel"?U([e]):[e])}async function et(){return(await xt()).host}async function xt(){try{const{headers:t}=await import("next/headers"),e=await t(),s=p=>p?.split(",")[0]?.split(":")[0]?.trim().toLowerCase()||null,o=s(e.get(nt)??e.get("x-forwarded-host")??e.get("host")),l=s(e.get("host"));return{host:o,matchesRequestHost:o!==null&&o===l}}catch{return{host:null,matchesRequestHost:!1}}}async function Ht(){try{const{headers:t}=await import("next/headers");return dt((await t()).get(ut))}catch{return null}}async function Ft(){try{const{headers:t}=await import("next/headers");return(await t()).get(ot)||null}catch{return null}}async function Mt(){const t=await Ft();if(t)return`site=${encodeURIComponent(t)}`;const e=await et();return e?`host=${encodeURIComponent(e)}`:""}async function f(t){if(typeof window<"u"){const e=K();return e?E(t,`site=${encodeURIComponent(e)}`):t}return E(t,await Mt())}function E(t,e){return e?`${t}${t.includes("?")?"&":"?"}${e}`:t}const Bt="preview";async function qt(){if(typeof window<"u")return null;try{const{headers:t}=await import("next/headers");return(await t()).get(st)}catch{return null}}async function Gt(){try{const{headers:t}=await import("next/headers");return(await t()).get("user-agent")}catch{return null}}async function L(t,e){const s=await qt();if(s===null)return[await f(t),await u(e)];const o=E(await f(t),`${Bt}=${encodeURIComponent(s)}`),{next:l,cache:p,...g}=e??{},r=await u({...g,cache:"no-store"}),a=await Gt();return a&&(r.headers={...r.headers,"user-agent":a}),[o,r]}async function Wt(t){if(!V)return;const[e,s]=await Promise.all([et(),Ht()]),o=ct(e,s,t);return Object.keys(o).length>0?o:void 0}async function u(t){const e=await Wt(lt(t)),s={baseUrl:It,...t};return e&&(s.headers={...e,...t?.headers}),s}const A=typeof window>"u";function T(t,e){const s=new URLSearchParams;for(const[l,p]of Object.entries(e))p!==void 0&&p!==""&&s.set(l,String(p));const o=s.toString();return`/api/v1/fitment${t}${o?`?${o}`:""}`}const ye={listMakes:async t=>{if(A){const{fitmentData:s}=await import("./fitment-data.js");return s.makes(t)}return(await i(T("/makes",{region:t}),O())).results},listModels:async(t,e)=>{if(A){const{fitmentData:o}=await import("./fitment-data.js");return o.models(t,e)}return(await i(T("/models",{make:t,region:e}),O())).results},listYears:async(t,e,s)=>{if(A){const{fitmentData:l}=await import("./fitment-data.js");return l.years(t,e,s)}return(await i(T("/years",{make:t,model:e,region:s}),O())).results},listModifications:async(t,e,s,o)=>{if(A){const{fitmentData:p}=await import("./fitment-data.js");return p.modifications(t,e,s,o)}return(await i(T("/modifications",{make:t,model:e,year:s,region:o}),O())).results},getStockFitment:async(t,e,s,o,l)=>{if(A){const{fitmentData:p}=await import("./fitment-data.js");return p.stockFitment(t,e,s,o,l)}return i(T("/stock-fitment",{make:t,model:e,year:s,modification:o,region:l}),O())}},he={listWheels:async(t,e={})=>{const s=await J("products.listWheels",async o=>await f(kt(t,o)),e.throwOnFailure?()=>!0:void 0);return U(w(s))},listWheelsBySlug:async(t,e={})=>{const s=[...new Set(t.map(r=>r.trim()).filter(Boolean))];if(s.length===0)return[];const o=[];for(let r=0;r<s.length;r+=Y)o.push(s.slice(r,r+Y));const l=await Promise.all(o.map(r=>J("products.listWheelsBySlug",async a=>await f(Jt(r,a)),e.throwOnFailure?()=>!0:Q))),p=new Set(s),g=l.flat().filter(r=>p.has(r.slug));return U(w(g))},listCatalog:async(t,e,s={})=>{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 o=await J("products.listCatalog",async l=>await f(Lt(t,e,l)),Q,s.maxRows===void 0?void 0:l=>tt([...l]).length>=s.maxRows);return tt(w(o))},getWheel:async t=>x(w(await i(await f(d(`/wheels/${t}`)),await u()))),getTyre:async t=>w(await i(await f(d(`/tyres/${t}`)),await u())),listBundles:async(t={})=>{try{return await i(await f(d("/bundles")),await u())}catch(e){if(t.throwOnFailure)throw e;return[]}},getBundle:async t=>i(await f(d(`/bundles/${t}`)),await u()),listGalleryBuilds:async(t={})=>{const{process:e=null,wheelSlug:s=null}=t;if(typeof window>"u"){const{listGalleryBuilds:o}=await import("./gallery-builds-data.js");return w(o(e,s))}try{const o=new URLSearchParams;e&&o.set("process",e),s&&o.set("wheelSlug",s);const l=o.toString(),p=await i(`/api/v1/gallery-builds${l?`?${l}`:""}`,O());return w(p.results)}catch(o){return console.warn("[products.listGalleryBuilds] product API unavailable, returning []",o),[]}},getSite:async()=>i(await f(d("/site")),await u()),getSiteBySlug:async t=>i(`${d("/site")}?${new URLSearchParams({site:t})}`,typeof window>"u"?await u():void 0),listPages:async()=>w(await i(await f(d("/pages")),await u())),listPopups:async()=>i(await f(d("/popups")),await u()),listProductTemplates:async()=>{try{return await i(await f(d("/product-templates")),await u())}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(`${d("/dynamic-pages")}${e}`),await u())}catch(s){if(s instanceof m&&s.status===404)return[];throw s}},getRecord:async(t,e)=>{try{return await i(await f(d(`/records/${encodeURIComponent(t)}/${encodeURIComponent(e)}`)),await u())}catch(s){if(s instanceof m&&s.status===404)return null;throw s}},listRecordKeys:async t=>{try{const e=await i(await f(d(`/records/${encodeURIComponent(t)}`)),await u({cache:"no-store"}));return Array.isArray(e?.keys)?e.keys.filter(s=>typeof s=="string"&&s!==""):[]}catch(e){if(e instanceof m&&e.status===404)return[];throw e}},listProductTypeChoices:async()=>{try{return await i(await f(d("/product-type-choices")),await u())}catch(t){return console.warn("[products.listProductTypeChoices] unavailable, returning []",t),[]}},listFieldUsage:async()=>{try{return await i(await f(d("/field-usage")),await u())}catch(t){return console.warn("[products.listFieldUsage] unavailable, returning []",t),[]}},getPage:async(t,e={})=>{const s=e.record?`?record=${encodeURIComponent(e.record)}`:"",[o,l]=await L(d(`/pages/${t}`)+s,e.revalidate!==void 0?{next:{revalidate:e.revalidate}}:void 0);return w(await i(o,l))},listBlogPosts:async(t={},{throwOnFailure:e=!1}={})=>{const s=t.category?`?category=${encodeURIComponent(t.category)}`:"";try{return(await i(d("/blog-posts")+s,await u())).map(l=>({...l,coverImage:v(l.coverImage)??""}))}catch(o){if(e)throw o;return console.warn("[products.listBlogPosts] blog API unavailable, returning []",o),[]}},getBlogPost:async t=>{const e=await i(d(`/blog-posts/${t}`),await u());return{...e,coverImage:v(e.coverImage)??""}},createOrder:async t=>i(d("/orders"),await u({method:"POST",body:JSON.stringify(t)})),createOrderAuthed:async t=>h(d("/orders"),await u({method:"POST",body:JSON.stringify(t)})),lookupOrder:async t=>i(d("/orders/lookup"),await u({method:"POST",body:JSON.stringify(t)})),createPaymentIntent:async t=>i(d("/payments/intent"),await u({method:"POST",body:JSON.stringify(t)})),releaseCheckout:async t=>i(d("/checkouts/release"),await u({method:"POST",body:JSON.stringify(t)})),createPaypalOrder:async t=>i(d("/payments/paypal/order"),await u({method:"POST",body:JSON.stringify(t)})),capturePaypalOrder:async t=>i(d("/payments/paypal/capture"),await u({method:"POST",body:JSON.stringify(t)})),createAfterpayCheckout:async t=>i(d("/payments/afterpay/checkout"),await u({method:"POST",body:JSON.stringify(t)})),captureAfterpayPayment:async t=>i(d("/payments/afterpay/capture"),await u({method:"POST",body:JSON.stringify(t)})),chargeSquare:async t=>i(d("/payments/square/charge"),await u({method:"POST",body:JSON.stringify(t)})),createGocardlessBillingRequest:async t=>i(d("/payments/gocardless/billing-request"),await u({method:"POST",body:JSON.stringify(t)})),completeGocardlessPayment:async t=>i(d("/payments/gocardless/complete"),await u({method:"POST",body:JSON.stringify(t)})),createZipCheckout:async t=>i(d("/payments/zip/checkout"),await u({method:"POST",body:JSON.stringify(t)})),captureZipPayment:async t=>i(d("/payments/zip/capture"),await u({method:"POST",body:JSON.stringify(t)})),createKlarnaCheckout:async t=>i(d("/payments/klarna/checkout"),await u({method:"POST",body:JSON.stringify(t)})),captureKlarnaPayment:async t=>i(d("/payments/klarna/capture"),await u({method:"POST",body:JSON.stringify(t)})),createStockAlert:async t=>i(d("/stock-alerts"),await u({method:"POST",body:JSON.stringify(t)})),createPreOrderIntent:async t=>i(d("/pre-order-intents"),await u({method:"POST",body:JSON.stringify(t)})),createNewsletterSubscription:async t=>i(d("/newsletter-subscriptions"),await u({method:"POST",body:JSON.stringify(t)})),unsubscribeNewsletter:async t=>i(d("/newsletter-unsubscribe"),await u({method:"POST",body:JSON.stringify(t)})),captureCart:async t=>i(d("/carts"),await u({method:"POST",body:JSON.stringify(t)})),restoreCart:async t=>i(d("/carts/restore"),await u({method:"POST",body:JSON.stringify(t)})),unsubscribeCartReminders:async t=>i(d("/carts/unsubscribe"),await u({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 s=d("/reviews"),o=e.toString();try{return await i(await f(o?`${s}?${o}`:s),await u())}catch(l){return console.warn("[products.listReviews] product API unavailable, returning []",l),[]}},submitReview:async t=>i(d("/reviews"),await u({method:"POST",body:JSON.stringify(t)})),getForm:async t=>i(d(`/forms/${encodeURIComponent(t)}`),await u()),submitForm:async(t,e)=>i(d(`/forms/${encodeURIComponent(t)}/submissions`),await u({method:"POST",body:JSON.stringify(e)})),listShippingMethods:async()=>{try{return await i(d("/shipping-methods"),await u())}catch(t){return console.warn("[products.listShippingMethods] product API unavailable, returning []",t),[]}},listCountrySubdivisions:async t=>{try{return await i(d(`/countries/${encodeURIComponent(t)}/subdivisions`),await u())}catch(e){return console.warn("[products.listCountrySubdivisions] unavailable, returning []",e),[]}},quoteCart:async t=>{const e=d("/cart/quote"),s=await u({method:"POST",body:JSON.stringify(t)});return t.couponCode?(await j(e,s)).data:i(e,s)},validateCoupon:async t=>{const{data:e,asShopper:s}=await j(d("/coupons/validate"),await u({method:"POST",body:JSON.stringify(t)}));return{...e,askedAsShopper:s}},getHeaderSettings:async()=>{const t=H({method:"GET"}),e=await i(...await L(d("/header-settings"),{signal:t})),s=v(e.logoUrl);let o=null,l=null;if(s&&_t(s)){const p=await $t(s,t);p&&(o=p.reversed,l=p.inkIsDark)}return{...e,logoUrl:s,logoReversed:o,logoInkIsDark:l}},getThemeSettings:async()=>i(...await L(d("/theme-settings"))),getChatSettings:async()=>i(await f(d("/chat-settings")),await u())},fe={listServices:async()=>{try{return await i(d("/bookings/services"),await u())}catch(t){return console.warn("[bookings.listServices] API unavailable, returning []",t),{results:[],currency:"USD"}}},getAvailability:async(t,e)=>i(d(`/bookings/availability?service=${encodeURIComponent(t)}&date=${e}`),await u()),create:async t=>i(d("/bookings"),await u({method:"POST",body:JSON.stringify(t)})),get:async t=>i(d(`/bookings/manage/${encodeURIComponent(t)}`),await u()),cancel:async t=>i(d(`/bookings/manage/${encodeURIComponent(t)}/cancel`),await u({method:"POST"})),createPaymentIntent:async t=>i(d("/bookings/payments/intent"),await u({method:"POST",body:JSON.stringify({manageToken:t})}))};class jt extends Error{slug;count;constructor(e,s){super(`Slug "${e}" exists on ${s} websites; a site is required to pick one.`),this.slug=e,this.count=s,this.name="AmbiguousPageSlugError"}}const C=(t,e,s)=>{const o=new URLSearchParams({...e?{site:e}:{},...s?{draft:"1"}:{}}).toString();return`/api/storefront/${t}/${o?`?${o}`:""}`},$=t=>`/api/storefront/sites/${encodeURIComponent(t)}/`,zt=t=>`${$(t)}currencies/`,Kt="/api/storefront/media/ingest/";class Vt 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 Xt(){const t=Ut();if(!t)throw new Vt;return`${Kt}?${new URLSearchParams({site:t})}`}const Zt="X-Puck-Media-Manifest",rt=pt.contentHash,_={"X-Media-Manifest":rt,[Zt]:rt},ge=at({});function at(t){return(e,s={})=>{const o=At(),l=t.headers||o?{...o?{"Accept-Language":o}:{},...t.headers,...s.headers}:void 0;return i(e,{...s,...t.baseUrl!==void 0?{baseUrl:t.baseUrl}:{},...l?{headers:l}:{},audience:t.audience??Ot()})}}function Yt(t={}){const e=at(t),s=t.siteDrafts===!0,o=r=>C("header-settings",r,s),l=r=>C("theme-settings",r,s),p=r=>C("chat-settings",r,s),g=r=>C("social-settings",r,s);return{findPageBySlug:async(r,a,n)=>{const c=new URLSearchParams({slug:r});n&&c.set("site",n);const y=await e(`/api/storefront/pages/?${c.toString()}`,{token:a}),S=Array.isArray(y)?y:y.results??[];if(!n&&S.length>1)throw new jt(r,S.length);return S[0]??null},getPageById:(r,a)=>e(`/api/storefront/pages/${r}/`,{token:a}),saveLayout:(r,a,n,c,y)=>e(`/api/storefront/pages/${r}/`,{method:"PATCH",body:JSON.stringify({layout:a,expected_updated_at:c,...y?{client_id:y}:{}}),token:n}),duplicatePage:(r,a,n)=>e(`/api/storefront/pages/${r}/duplicate/`,{method:"POST",body:JSON.stringify({title:a.title,slug:a.slug}),token:n}),geocode:(r,a,n)=>e(`/api/storefront/geocode/?${new URLSearchParams(n?{q:r,country:n}:{q:r})}`,{token:a}),listBlockSources:r=>e("/api/storefront/block-sources/",{token:r}),listRecordTypes:r=>e("/api/storefront/record-types/",{token:r}),createPagePreviewLink:(r,a)=>e(`/api/storefront/pages/${r}/preview-link/`,{method:"POST",token:a}),claimPageEditLock:(r,a,n,c=!1)=>e(`/api/storefront/pages/${r}/edit-lock/`,{method:"POST",body:JSON.stringify({client_id:n,takeover:c}),token:a}),releasePageEditLock:(r,a)=>e(`/api/storefront/pages/${r}/edit-lock/`,{method:"DELETE",token:a}),createTemplate:(r,a,n)=>e("/api/storefront/page-templates/",{method:"POST",body:JSON.stringify({name:r,layout:a}),headers:_,token:n}),getTemplate:(r,a)=>e(`/api/storefront/page-templates/${r}/`,{token:a}),saveTemplateLayout:(r,a,n)=>e(`/api/storefront/page-templates/${r}/`,{method:"PATCH",body:JSON.stringify({layout:a}),headers:_,token:n}),listTemplatePages:async(r,a)=>{const n=await e(`/api/storefront/template-pages/?template=${encodeURIComponent(r)}`,{token:a});return Array.isArray(n)?n:n.results??[]},findTemplatePageBySlug:async(r,a,n)=>{const c=await e(`/api/storefront/template-pages/?template=${encodeURIComponent(r)}&slug=${encodeURIComponent(a)}`,{token:n});return(Array.isArray(c)?c:c.results??[])[0]??null},createTemplatePage:(r,a,n)=>e("/api/storefront/template-pages/",{method:"POST",body:JSON.stringify({template:r,...a}),headers:_,token:n}),saveTemplatePageLayout:(r,a,n)=>e(`/api/storefront/template-pages/${r}/`,{method:"PATCH",body:JSON.stringify({layout:a}),headers:_,token:n}),deleteTemplatePage:(r,a,n)=>e(`/api/storefront/template-pages/${r}/`,{method:"DELETE",token:a,...n?.keepalive?{keepalive:!0}:{}}),listPages:async(r,a)=>{const n=new URLSearchParams({no_page:"true"});a&&n.set("site",a);const c=await e(`/api/storefront/pages/?${n.toString()}`,{token:r});return Array.isArray(c)?c:c.results??[]},createPage:(r,a,n,c)=>e("/api/storefront/pages/",{method:"POST",body:JSON.stringify({title:r,slug:a,layout:n}),token:c}),deletePage:(r,a)=>e(`/api/storefront/pages/${r}/`,{method:"DELETE",token:a}),getHeaderSettings:(r,a)=>e(o(a),{token:r}),listMenus:async(r,a)=>{const n=new URLSearchParams({no_page:"true"});a&&n.set("site",a);const c=await e(`/api/storefront/menus/?${n}`,{token:r});return Array.isArray(c)?c:c.results??[]},listBlogPosts:async(r,a={})=>{const n=new URLSearchParams({no_page:"true"});a.visibleOnly&&n.set("is_visible","true"),a.siteId&&n.set("site",a.siteId);const c=await e(`/api/storefront/blog-posts/?${n.toString()}`,{token:r});return Array.isArray(c)?c:c.results??[]},listFieldUsage:async(r,a)=>{const n=await e(`/api/storefront/field-usage/?site=${encodeURIComponent(a)}`,{token:r});return Array.isArray(n?.entries)?n.entries:[]},listCategories:async(r,a={})=>{const n=new URLSearchParams({no_page:"true"});a.visibleOnly&&n.set("is_visible","true"),a.siteId&&n.set("site",a.siteId);const c=await e(`/api/storefront/categories/?${n.toString()}`,{token:r});return[...Array.isArray(c)?c:c.results??[]].sort((S,R)=>S.sort_order-R.sort_order||S.name.localeCompare(R.name))},listForms:async(r,a={})=>{const n=new URLSearchParams({no_page:"true"});a.siteId&&n.set("site",a.siteId);const c=await e(`/api/storefront/forms/?${n.toString()}`,{token:r});return[...Array.isArray(c)?c:c.results??[]].sort((S,R)=>S.title.localeCompare(R.title))},listWheelSummaries:async(r,a={})=>{const n=new URLSearchParams;a.siteId&&n.set("site",a.siteId);const c=n.toString(),y=await e(`/api/storefront/wheel-curations/summaries/${c?`?${c}`:""}`,{token:r});return w(y)},listProducts:async(r,a={})=>{const n=new URLSearchParams;a.kinds?.length&&n.set("kind",a.kinds.join(",")),a.siteId&&n.set("site",a.siteId);const c=n.toString(),y=await e(`/api/storefront/products/${c?`?${c}`:""}`,{token:r});return w(y)},getWheelDetail:async(r,a,n={})=>{const c=new URLSearchParams({slug:a});return n.siteId&&c.set("site",n.siteId),x(w(await e(`/api/storefront/wheel-curations/detail/?${c.toString()}`,{token:r})))},updateHeaderSettings:(r,a,n)=>e(o(n),{method:"PATCH",body:JSON.stringify(r),token:a}),getSite:(r,a)=>e($(r),{token:a}),listSites:async r=>{const a=await e("/api/storefront/sites/?no_page=true",{token:r});return Array.isArray(a)?a:a.results??[]},listSiteCurrencies:async(r,a)=>{const n=await e(zt(r),{token:a});return Array.isArray(n)?n:[]},publishSite:(r,a)=>e(`${$(r)}publish/`,{method:"POST",token:a}),getSiteLiveState:(r,a)=>e(`${$(r)}live-state/`,{token:a}),getThemeSettings:(r,a)=>e(l(a),{token:r}),updateThemeSettings:(r,a,n)=>e(l(n),{method:"PATCH",body:JSON.stringify(r),token:a}),getMyPreferences:async r=>(await e("/api/auth/me/",{token:r})).preferences??{},updateMyPreferences:(r,a)=>e("/api/auth/me/",{method:"PATCH",body:JSON.stringify({preferences:r}),token:a}),getChatSettings:(r,a)=>e(p(a),{token:r}),updateChatSettings:(r,a,n)=>e(p(n),{method:"PATCH",body:JSON.stringify(r),token:a}),getSocialSettings:(r,a)=>e(g(a),{token:r}),updateSocialSettings:(r,a,n)=>e(g(n),{method:"PATCH",body:JSON.stringify(r),token:a}),uploadHeaderLogo:(r,a,n)=>{const c=new FormData;return c.append("logo",r),e(o(n),{method:"PATCH",body:c,token:a})},clearHeaderLogo:(r,a)=>e(o(a),{method:"PATCH",body:JSON.stringify({logo:null}),token:r}),setHeaderLogoFromAsset:(r,a,n)=>e(o(n),{method:"PATCH",body:JSON.stringify({logo_asset_id:r}),token:a}),uploadMedia:async(r,a)=>{const n=new FormData;return n.append("file",r),e(Xt(),{method:"POST",body:n,token:a})},listMedia:async(r,a)=>{const n=new URLSearchParams({no_page:"true"});a&&n.set("kind",a);const c=await e(`/api/storefront/media-assets/?${n.toString()}`,{token:r});return Array.isArray(c)?c:c.results??[]}}}const we=Yt({siteDrafts:!0});export{ht as API_URL,jt as AmbiguousPageSlugError,m as ApiError,mt as BROWSER_READ_TIMEOUT_MS,gt as EFFICIENT_CLIENT_CLOSED_MESSAGE,Vt as MediaUploadDestinationError,Bt as PREVIEW_PARAM,Pe as PRODUCT_API_BASE,wt as SERVER_READ_TIMEOUT_MS,N as SERVER_UNREACHABLE_MESSAGE,I as STATUS_NETWORK_ERROR,ge as adminFetch,Et as api,i as apiFetch,E as appendSiteQuery,fe as bookings,Yt as createStorefrontAdmin,H as defaultRequestDeadline,Xt as editorMediaUploadPath,Ot as editorPortalAudience,At as editorRequestLanguage,ye as fitment,he as products,St as readDeadlineMs,Ht as resolveClientIp,w as resolveMediaUrls,qt as resolvePreviewToken,et as resolveSiteHost,xt as resolveSiteHostSource,Ft as resolveSiteSlug,ce as setEditorLanguage,ie as setEditorPortalAudience,we as storefrontAdmin};
@@ -3,4 +3,5 @@ export declare const CHROME_CACHE_TTL_MS = 60000;
3
3
  export declare const CHROME_CACHE_FAILURE_TTL_MS = 5000;
4
4
  export declare const CHROME_CACHE_MAX = 500;
5
5
  export declare function cachedChrome<T>(name: ChromeLoadName, load: () => Promise<ChromeLoad<T>>): Promise<ChromeLoad<T>>;
6
+ export declare function cachedSiteRead<T>(name: string, load: () => Promise<T>): Promise<T>;
6
7
  export declare function clearChromeCache(): void;
@@ -1 +1 @@
1
- import{resolvePreviewToken as d,resolveSiteHostSource as h,resolveSiteSlug as f}from"./api/index.js";import{evictForInsert as p}from"./cache-evict.js";const m=6e4,_=5e3,w=500,s=new Map;async function x(e){const{host:t,matchesRequestHost:o}=await h();if(!t)return"";const n=await f();return n?`${e}|slug:${encodeURIComponent(t)}/${encodeURIComponent(n)}`:o?`${e}|host:${t}`:`${e}|xhost:${t}`}const H=e=>e.includes("|slug:")||e.includes("|xhost:");async function E(e,t){if(await d()!==null)return t();const o=await x(e);if(!o)return t();const n=Date.now(),r=s.get(o);if(r&&r.expiresAt>n)return r.load;const c=await t(),a=c.outcome.state==="failed",l=a?_:m,C=s.get(o)?.lastGood,i=c.outcome.state==="ok"?c:a?C:void 0,u=a&&i?i:c;return p(s,w,H,n),s.set(o,{load:u,expiresAt:n+l,lastGood:i}),u}function M(){s.clear()}export{_ as CHROME_CACHE_FAILURE_TTL_MS,w as CHROME_CACHE_MAX,m as CHROME_CACHE_TTL_MS,E as cachedChrome,M as clearChromeCache};
1
+ import{resolvePreviewToken as l,resolveSiteHostSource as m,resolveSiteSlug as _}from"./api/index.js";import{evictForInsert as d}from"./cache-evict.js";const C=6e4,A=5e3,f=500,s=new Map;async function h(t){const{host:e,matchesRequestHost:o}=await m();if(!e)return"";const n=await _();return n?`${t}|slug:${encodeURIComponent(e)}/${encodeURIComponent(n)}`:o?`${t}|host:${e}`:`${t}|xhost:${e}`}const p=t=>t.includes("|slug:")||t.includes("|xhost:");async function g(t,e){if(await l()!==null)return e();const o=await h(t);if(!o)return e();const n=Date.now(),c=s.get(o);if(c&&c.expiresAt>n)return c.load;const r=await e(),a=r.outcome.state==="failed",w=a?A:C,x=s.get(o)?.lastGood,i=r.outcome.state==="ok"?r:a?x:void 0,u=a&&i?i:r;return d(s,f,p,n),s.set(o,{load:u,expiresAt:n+w,lastGood:i}),u}async function v(t,e){if(await l()!==null)return e();const o=await h(t);if(!o)return e();const n=s.get(o);if(n&&n.expiresAt>Date.now())return n.load;const c=await e(),r=Date.now();return d(s,f,p,r),s.set(o,{load:c,expiresAt:r+C}),c}function E(){s.clear()}export{A as CHROME_CACHE_FAILURE_TTL_MS,f as CHROME_CACHE_MAX,C as CHROME_CACHE_TTL_MS,g as cachedChrome,v as cachedSiteRead,E as clearChromeCache};
@@ -0,0 +1,3 @@
1
+ export declare const EVENTS_FEATURED_PLACEMENT = "bottom-left";
2
+ export declare const EVENTS_FEATURED_DARKEN = 55;
3
+ export declare const EVENTS_FEATURED_DARKEN_STYLE = "bottom";
@@ -0,0 +1 @@
1
+ const E="bottom-left",t=55,o="bottom";export{t as EVENTS_FEATURED_DARKEN,o as EVENTS_FEATURED_DARKEN_STYLE,E as EVENTS_FEATURED_PLACEMENT};
@@ -25,10 +25,17 @@ export declare const PRODUCT_CARD_FIELDS: readonly [{
25
25
  }];
26
26
  export interface ProductCardSeedOptions {
27
27
  legacyWellHonoured?: boolean;
28
+ showRest?: {
29
+ showCardSizes: boolean;
30
+ showCardBuy: boolean;
31
+ showCardPage: boolean;
32
+ };
33
+ section?: string;
28
34
  }
29
35
  export declare function productCardSeed(props: Props, options?: ProductCardSeedOptions): BlockSeed;
30
36
  export declare function kitCardSeed(props: Props): BlockSeed;
31
37
  export declare function withKitCardTemplate(props: Props): Props;
32
38
  export declare function productCardTemplate(props: Props, options?: ProductCardSeedOptions): SeededNode[];
39
+ export declare function withListingCardTemplate(props: Props): Props;
33
40
  export declare function withProductCardTemplate(props: Props, options?: ProductCardSeedOptions): Props;
34
41
  export {};
@@ -1 +1 @@
1
- import{BOX_TYPE as c,CONTAINER_BLOCKS_SLOT as s}from"efficient-web-builder/format/lib/document/container-blocks";import{DIM as D,INNER_BOX as u,boxPadding as C,seedNodes as P,token as x}from"efficient-web-builder/format/lib/document/seed-parts";import{CARD_ROW_FIELD_PROP as E}from"efficient-web-builder/format/lib/content/card-template";import{CARDS_BODY_LOOK as S}from"efficient-web-builder/format/lib/document/blocks/general/Cards/card-seed";import{THEME_CARD_IMAGE_BG as w,resolveBoundCardImageBackground as I}from"efficient-web-builder/format/lib/content/card-image-background";import{SHARED_ROWS_KEY as K}from"efficient-web-builder/render/lib/content/box-shared-columns";import{GRID_CARD_SHOW as _}from"../sections/card-show-defaults.js";const g="ProductPicture",l="ProductSpecs",m="ProductBuy",p="ProductPrice",f="ProductColour",b="ProductSize",B="ProductEyebrow",O="ProductName",Z=[g,B,O,l,p,f,b,m],j=[{key:"name",label:"Name"},{key:"eyebrow",label:"Eyebrow"},{key:"note",label:"Note"},{key:"href",label:"Product page",kind:"link"}],L={...u,gap:0,gapPhone:0,...C(32,32,32,32),[K]:"shared"},h=e=>typeof e.id=="string"&&e.id.trim()?e.id:"ProductGrid",a=(e,t)=>typeof e=="boolean"?e:t,k={type:"Text",props:{...D,tag:"p",text:"",[E]:"note",_partStyles:{text:{...S,...x("body",14),lineHeight:1.375}}}};function A(e,t={}){const n=e.dynamic===!0,o={},i=n?t.legacyWellHonoured?e.imageBackground??w:I(e.imageBackground):e.imageBackground;i!==void 0&&(o.imageBackground=i);for(const d of["cardImage","coverIndex","indexBadge","showBadge"])e[d]!==void 0&&(o[d]=e[d]);const r={price:a(e.showCardPrice,!0),finishes:a(e.showCardFinishes,!0),sizes:a(e.showCardSizes,_.showCardSizes),buy:a(e.showCardBuy,_.showCardBuy),page:a(e.showCardPage,_.showCardPage)},y={...L,name:"Card"};e.outline==="hairline"&&(y.sectionBorder={width:1,style:"solid"});const T=[{type:g,props:o},{type:B},{type:O},{type:l,props:{sizes:r.sizes}},...r.price?[{type:p}]:[],...r.finishes?[{type:f}]:[],...r.buy||r.page?[{type:m,props:{buy:r.buy,page:r.page}}]:[]];return{type:c,props:y,slots:{[s]:T}}}const U={...u,gap:0,gapPhone:0,...C(0,0,0,0)},N={...u,gap:8,gapPhone:8,...C(16,20,16,20)},z={role:"heading",size:18,weight:500,case:"none",letterSpacing:-.015,lineHeight:1.2},R=24;function H(e){const t={frame:"full"};for(const o of["cardImage","showBadge"])e[o]!==void 0&&(t[o]=e[o]);const n={type:c,props:{...N,name:"Copy"},slots:{[s]:[{type:O,props:{fixedHeight:!1,_partStyles:{"@name":z}}},k,{type:p}]}};return{type:c,props:{...U,name:"Card"},slots:{[s]:[{type:g,props:t},n]}}}function q(e){if(e.template!==void 0)return e;const t=h(e);return{...e,gap:e.gap??R,gapPhone:e.gapPhone??R,template:P([H(e)],(n,o)=>`${t}~card-${o}-${n}`)}}function G(e,t={}){const n=h(e);return P([A(e,t)],(o,i)=>`${n}~card-${i}-${o}`)}function J(e,t={}){return e.template!==void 0?e:{...e,template:G(e,t)}}export{m as PRODUCT_BUY_BLOCK,j as PRODUCT_CARD_FIELDS,Z as PRODUCT_CARD_SLOT_BLOCKS,f as PRODUCT_COLOUR_BLOCK,B as PRODUCT_EYEBROW_BLOCK,O as PRODUCT_NAME_BLOCK,g as PRODUCT_PICTURE_BLOCK,p as PRODUCT_PRICE_BLOCK,b as PRODUCT_SIZE_BLOCK,l as PRODUCT_SPECS_BLOCK,H as kitCardSeed,A as productCardSeed,G as productCardTemplate,q as withKitCardTemplate,J as withProductCardTemplate};
1
+ import{BOX_TYPE as s,CONTAINER_BLOCKS_SLOT as u}from"efficient-web-builder/format/lib/document/container-blocks";import{DIM as D,INNER_BOX as C,boxPadding as _,seedNodes as y,token as x}from"efficient-web-builder/format/lib/document/seed-parts";import{CARD_ROW_FIELD_PROP as S}from"efficient-web-builder/format/lib/content/card-template";import{CARDS_BODY_LOOK as w}from"efficient-web-builder/format/lib/document/blocks/general/Cards/card-seed";import{THEME_CARD_IMAGE_BG as E,resolveBoundCardImageBackground as I}from"efficient-web-builder/format/lib/content/card-image-background";import{SHARED_ROWS_KEY as L}from"efficient-web-builder/render/lib/content/box-shared-columns";import{GRID_CARD_SHOW as K,LISTING_CARD_SHOW as b}from"../sections/card-show-defaults.js";const g="ProductPicture",P="ProductSpecs",m="ProductBuy",p="ProductPrice",f="ProductColour",k="ProductSize",h="ProductEyebrow",l="ProductName",J=[g,h,l,P,p,f,k,m],Q=[{key:"name",label:"Name"},{key:"eyebrow",label:"Eyebrow"},{key:"note",label:"Note"},{key:"href",label:"Product page",kind:"link"}],A={...C,gap:0,gapPhone:0,..._(32,32,32,32),[L]:"shared"},R=(e,t="ProductGrid")=>typeof e.id=="string"&&e.id.trim()?e.id:t,a=(e,t)=>typeof e=="boolean"?e:t,U={type:"Text",props:{...D,tag:"p",text:"",[S]:"note",_partStyles:{text:{...w,...x("body",14),lineHeight:1.375}}}};function N(e,t={}){const n=e.dynamic===!0,o={},i=n?t.legacyWellHonoured?e.imageBackground??E:I(e.imageBackground):e.imageBackground;i!==void 0&&(o.imageBackground=i);for(const c of["cardImage","coverIndex","indexBadge","showBadge"])e[c]!==void 0&&(o[c]=e[c]);const d=t.showRest??K,r={price:a(e.showCardPrice,!0),finishes:a(e.showCardFinishes,!0),sizes:a(e.showCardSizes,d.showCardSizes),buy:a(e.showCardBuy,d.showCardBuy),page:a(e.showCardPage,d.showCardPage)},O={...A,name:"Card"};e.outline==="hairline"&&(O.sectionBorder={width:1,style:"solid"});const T=[{type:g,props:o},{type:h},{type:l},{type:P,props:{sizes:r.sizes}},...r.price?[{type:p}]:[],...r.finishes?[{type:f}]:[],...r.buy||r.page?[{type:m,props:{buy:r.buy,page:r.page}}]:[]];return{type:s,props:O,slots:{[u]:T}}}const H={...C,gap:0,gapPhone:0,..._(0,0,0,0)},z={...C,gap:8,gapPhone:8,..._(16,20,16,20)},G={role:"heading",size:18,weight:500,case:"none",letterSpacing:-.015,lineHeight:1.2},B=24;function W(e){const t={frame:"full"};for(const o of["cardImage","showBadge"])e[o]!==void 0&&(t[o]=e[o]);const n={type:s,props:{...z,name:"Copy"},slots:{[u]:[{type:l,props:{fixedHeight:!1,_partStyles:{"@name":G}}},U,{type:p}]}};return{type:s,props:{...H,name:"Card"},slots:{[u]:[{type:g,props:t},n]}}}function V(e){if(e.template!==void 0)return e;const t=R(e);return{...e,gap:e.gap??B,gapPhone:e.gapPhone??B,template:y([W(e)],(n,o)=>`${t}~card-${o}-${n}`)}}function X(e,t={}){const n=R(e,t.section);return y([N(e,t)],(o,i)=>`${n}~card-${i}-${o}`)}function ee(e){return Y(e,{showRest:b,section:"AlloyWheelsListing"})}function Y(e,t={}){return e.template!==void 0?e:{...e,template:X(e,t)}}export{m as PRODUCT_BUY_BLOCK,Q as PRODUCT_CARD_FIELDS,J as PRODUCT_CARD_SLOT_BLOCKS,f as PRODUCT_COLOUR_BLOCK,h as PRODUCT_EYEBROW_BLOCK,l as PRODUCT_NAME_BLOCK,g as PRODUCT_PICTURE_BLOCK,p as PRODUCT_PRICE_BLOCK,k as PRODUCT_SIZE_BLOCK,P as PRODUCT_SPECS_BLOCK,W as kitCardSeed,N as productCardSeed,X as productCardTemplate,V as withKitCardTemplate,ee as withListingCardTemplate,Y as withProductCardTemplate};
@@ -0,0 +1 @@
1
+ export declare const RATING_NONE = 0;
@@ -0,0 +1 @@
1
+ const N=0;export{N as RATING_NONE};
@@ -1,4 +1,10 @@
1
1
  import type { BlockRender } from "efficient-web-builder/format/lib/document/blocks/block-types";
2
+ export declare const AlloyWheelsListingSlots: {
3
+ template: {
4
+ allow: string[];
5
+ type: "slot";
6
+ };
7
+ };
2
8
  export declare const ALLOYWHEELSLISTING_PH: {
3
9
  heading: string;
4
10
  intro: string;
@@ -1 +1 @@
1
- import{PLP_DEFAULT_KINDS as e}from"../../../../catalog/plp-item.js";import{PLP_COLUMNS_DEFAULT as o}from"../../../../wheels/plp-grid.js";import{DEFAULT_COVER_INDEX as t}from"../../../../wheels/cover-rendering.js";const l={heading:"Alloy wheels",intro:"Filter by brand, colour, size and fitment to find your set."},s={label:"List",defaultProps:{heading:"",intro:"",askForCar:!0,gateHeading:"",gateIntro:"",kinds:[...e],perPage:24,columns:o,defaultSort:"recommended",coverIndex:String(t),showInStock:!0,showCollection:!0,showPrice:!0}};export{l as ALLOYWHEELSLISTING_PH,s as AlloyWheelsListingMeta};
1
+ import{PLP_DEFAULT_KINDS as t}from"../../../../catalog/plp-item.js";import{PLP_COLUMNS_DEFAULT as e}from"../../../../wheels/plp-grid.js";import{ProductGridSlots as o}from"../ProductGrid/meta.js";const r={template:o.template},n={heading:"Alloy wheels",intro:"Filter by brand, colour, size and fitment to find your set."},a={label:"List",fields:r,defaultProps:{heading:"",intro:"",askForCar:!0,gateHeading:"",gateIntro:"",kinds:[...t],perPage:24,columns:e,defaultSort:"recommended",showInStock:!0,showCollection:!0,showPrice:!0}};export{n as ALLOYWHEELSLISTING_PH,a as AlloyWheelsListingMeta,r as AlloyWheelsListingSlots};
@@ -1 +1 @@
1
- import{jsx as t}from"react/jsx-runtime";import n from"../../../../../components/wheels-plp/AlloyWheelsListing.js";import{hidableText as i}from"efficient-easel/screen/lib/document/hidable";import{asPlpSortKey as r,listingHiddenFacets as o}from"../../../../wheels/plp-filters.js";import{parseCoverIndex as l}from"../../../../wheels/cover-rendering.js";import{cardHoverOf as g}from"efficient-web-builder/format/lib/animation/hover";import{parseCardOutline as h,parseCardIndexFormat as s}from"efficient-web-builder/format/lib/sections/product-card-style";import{phHide as a}from"efficient-web-builder/render/lib/document/blocks/scaffold";import{AlloyWheelsListingMeta as m,ALLOYWHEELSLISTING_PH as d}from"./meta.js";const S={...m,render:e=>t(n,{titleLevel:e.titleLevel,heading:a(e.heading,d.heading,e.editor),intro:a(e.intro,d.intro,e.editor),askForCar:e.askForCar!==!1,gateHeading:i(e.gateHeading),gateIntro:i(e.gateIntro),perPage:e.perPage,columns:e.columns,defaultSort:r(e.defaultSort),coverIndex:l(e.coverIndex),cardImage:e.cardImage,hover:g(e,"AlloyWheelsListing"),imageBackground:e.imageBackground,showBadge:e.showBadge!==!1,showCardPrice:e.showCardPrice,showCardFinishes:e.showCardFinishes,showCardSizes:e.showCardSizes,showCardBuy:e.showCardBuy,showCardPage:e.showCardPage,outline:h(e.outline),indexBadge:s(e.indexBadge),hiddenFacets:o(e),showPrice:e.showPrice,showInStock:e.showInStock!==!1,kinds:e.kinds,products:e.products,wheels:e.wheels,fieldUsage:e.fieldUsage,editing:e.editor?.isEditing})};export{S as AlloyWheelsListingRender};
1
+ import{jsx as d}from"react/jsx-runtime";import l from"../../../../../components/wheels-plp/AlloyWheelsListing.js";import{hidableText as t}from"efficient-easel/screen/lib/document/hidable";import{asPlpSortKey as n,listingHiddenFacets as o}from"../../../../wheels/plp-filters.js";import{cardHoverOf as g}from"efficient-web-builder/format/lib/animation/hover";import{phHide as i}from"efficient-web-builder/render/lib/document/blocks/scaffold";import{AlloyWheelsListingMeta as r,ALLOYWHEELSLISTING_PH as a}from"./meta.js";const w={...r,render:e=>d(l,{titleLevel:e.titleLevel,heading:i(e.heading,a.heading,e.editor),intro:i(e.intro,a.intro,e.editor),askForCar:e.askForCar!==!1,gateHeading:t(e.gateHeading),gateIntro:t(e.gateIntro),perPage:e.perPage,columns:e.columns,defaultSort:n(e.defaultSort),ownerId:typeof e.id=="string"?e.id:"",template:e.template,cardImage:e.cardImage,hover:g(e,"AlloyWheelsListing"),hiddenFacets:o(e),showPrice:e.showPrice,showInStock:e.showInStock!==!1,kinds:e.kinds,products:e.products,wheels:e.wheels,fieldUsage:e.fieldUsage,editing:e.editor?.isEditing})};export{w as AlloyWheelsListingRender};
@@ -1 +1 @@
1
- import{jsx as o}from"react/jsx-runtime";import e from"../../../../../components/card-pieces/CardFinishSwatches.js";import i from"../../../../../components/card-pieces/HostPart.js";import{ProductColourMeta as r}from"./meta.js";const n={...r,render:t=>o(i,{label:r.label??"",editing:!!t.editor?.isEditing,children:o(e,{})})};export{n as ProductColourRender};
1
+ import{jsx as r}from"react/jsx-runtime";import t from"../../../../../components/card-pieces/CardFinishSwatches.js";import{useGridCard as i}from"../../../../../components/GridCardTemplate.js";import n from"../../../../../components/card-pieces/HostPart.js";import{ProductColourMeta as o}from"./meta.js";function s(){return r(t,{showSingle:i().rules.showSingle})}const c={...o,render:e=>r(n,{label:o.label??"",editing:!!e.editor?.isEditing,children:r(s,{})})};export{c as ProductColourRender};
@@ -1 +1 @@
1
- "use client";import{jsx as o}from"react/jsx-runtime";import{withRMark as s}from"efficient-web-builder/render/components/RMark";import l from"../../../../../components/card-pieces/CardEyebrow.js";import{readPartStyles as a}from"efficient-web-builder/render/lib/document/part-styles";import m from"../../../../../components/card-pieces/HostPart.js";import{useProductCardState as c}from"../../../../../components/card-pieces/ProductCardState.js";import{useGridCard as f}from"../../../../../components/GridCardTemplate.js";import{wheelCardEyebrow as u}from"../../../../../components/ProductCardEyebrow.js";import{ProductEyebrowMeta as t}from"./meta.js";function w({region:e}){const r=c(),{fieldUsage:i,reserveEyebrow:n}=f(),d=r.kind==="wheel"&&r.wheel.process?s(r.wheel.process):null;return o(l,{reserve:n,region:e,children:u({kindLabel:null,brand:null,process:d},i)})}const x={...t,render:e=>{const r=!!e.editor?.isEditing;return o(m,{label:t.label??"",editing:r,children:o(w,{region:{nodeId:typeof e.id=="string"?e.id:void 0,partStyles:a(e),editing:r}})})}};export{x as ProductEyebrowRender};
1
+ "use client";import{jsx as n}from"react/jsx-runtime";import{withRMark as d}from"efficient-web-builder/render/components/RMark";import c from"../../../../../components/card-pieces/CardEyebrow.js";import{readPartStyles as u}from"efficient-web-builder/render/lib/document/part-styles";import b from"../../../../../components/card-pieces/HostPart.js";import{useProductCardState as f}from"../../../../../components/card-pieces/ProductCardState.js";import{useGridCard as w}from"../../../../../components/GridCardTemplate.js";import{itemBrand as p}from"../../../../catalog/plp-item.js";import{wheelCardEyebrow as y}from"../../../../../components/ProductCardEyebrow.js";import{ProductEyebrowMeta as s}from"./meta.js";function g({region:r}){const o=f(),{fieldUsage:l,reserveEyebrow:a,eyebrow:t}=w(),e=o.kind==="wheel"?o.wheel:null,i=e&&t.brand?p(e):null,m={kindLabel:e?t.kindLabel:null,brand:i?d(i):null,process:e&&t.process&&e.process?d(e.process):null};return n(c,{reserve:a,region:r,children:y(m,l)})}const L={...s,render:r=>{const o=!!r.editor?.isEditing;return n(b,{label:s.label??"",editing:o,children:n(g,{region:{nodeId:typeof r.id=="string"?r.id:void 0,partStyles:u(r),editing:o}})})}};export{L as ProductEyebrowRender};
@@ -1 +1 @@
1
- import{jsx as g}from"react/jsx-runtime";import{gridLimitOf as H}from"../../../../sections/product-grid-pages.js";import{FIRST_COUNT_IN_CHIPS_PROP as T}from"../../../../wheels/shopper-first-paint.js";import{phoneKey as d,tabletKey as P}from"efficient-easel/draw";import b from"../../../../../components/pdp-dynamic/DynamicRelatedProducts.js";import{DEFAULT_RELATIONSHIP as y}from"../../../../catalog/relationships.js";import{resolveWidth as C}from"efficient-web-builder/format/lib/content/section-width";import s from"../../../../../components/ProductGridSection.js";import{relatedCardCount as k}from"../../../../catalog/related-cards.js";import{hidableText as R}from"efficient-easel/screen/lib/document/hidable";import{cardHoverOf as h}from"efficient-web-builder/format/lib/animation/hover";import{parseSectionHeadPlacement as w}from"efficient-web-builder/format/lib/sections/section-head-placement";import{PH as o}from"efficient-web-builder/format/lib/document/blocks/placeholders";import{phHide as t}from"efficient-web-builder/render/lib/document/blocks/scaffold";import{PRODUCTGRID_PH as l}from"../placeholders.js";import{parseMoreProducts as S}from"../../../../sections/product-grid-pages.js";import{ProductGridMeta as _}from"./meta.js";const Q={..._,render:e=>{const a=typeof e.id=="string"?e.id:"",c=e.template;if(e.dynamic){const n=w(e.headPlacement)==="own-box",m=I=>n?void 0:I;return g(b,{num:m(t(e.num,l.num,e.editor)),title:m(t(e.title,o.sectionHeading,e.editor)),description:m(t(e.description,o.body,e.editor)),omitHead:n,columns:typeof e.columns=="number"?e.columns:3,columnsPhone:e[d("columns")],columnsTablet:e[P("columns")],gap:e.gap,gapPhone:e[d("gap")],cardCount:k(e.limit),relationship:typeof e.relationship=="string"?e.relationship:y,hover:h(e,"ProductGrid"),ownerId:a,template:c,cardImage:e.cardImage,outline:e.outline,indexBadge:e.indexBadge,editing:e.editor?.isEditing})}const r=t(e.linkText,l.link,e.editor),u=e.source,x=C(e,"full"),f=w(e.headPlacement)==="own-box",i=n=>f?void 0:n;return g(s,{gap:e.gap,gapPhone:e[d("gap")],contentCapped:x.mode==="page",num:i(t(e.num,l.num,e.editor)),title:i(t(e.title,o.sectionHeading,e.editor)),titleSize:e.titleSize,padTop:f?0:e.padTop,description:i(t(e.description,o.body,e.editor)),link:i(r?{text:r,href:R(e.linkHref)||"#"}:void 0),products:e.products,wheels:e.wheels,source:u?.slug?u:void 0,catalog:e.catalog,firstCountInChips:e[T]===!0,kinds:e.kinds,fieldUsage:e.fieldUsage,columns:e.columns,columnsPhone:e[d("columns")],columnsTablet:e[P("columns")],limit:H({limit:e.limit,showAll:e.showAll}),moreProducts:S(e.moreProducts),perPage:e.perPage,editing:e.editor?.isEditing,hover:h(e,"ProductGrid"),ownerId:a,template:c})}};export{Q as ProductGridRender};
1
+ import{jsx as g}from"react/jsx-runtime";import{gridLimitOf as I}from"../../../../sections/product-grid-pages.js";import{FIRST_COUNT_IN_CHIPS_PROP as H}from"../../../../wheels/shopper-first-paint.js";import{phoneKey as d,tabletKey as P}from"efficient-easel/draw";import b from"../../../../../components/pdp-dynamic/DynamicRelatedProducts.js";import{DEFAULT_RELATIONSHIP as y}from"../../../../catalog/relationships.js";import{resolveWidth as C}from"efficient-web-builder/format/lib/content/section-width";import k from"../../../../../components/ProductGridSection.js";import{relatedCardCount as s}from"../../../../catalog/related-cards.js";import{hidableText as R}from"efficient-easel/screen/lib/document/hidable";import{cardHoverOf as h}from"efficient-web-builder/format/lib/animation/hover";import{parseSectionHeadPlacement as T}from"efficient-web-builder/format/lib/sections/section-head-placement";import{PH as o}from"efficient-web-builder/format/lib/document/blocks/placeholders";import{phHide as t}from"efficient-web-builder/render/lib/document/blocks/scaffold";import{PRODUCTGRID_PH as a}from"../placeholders.js";import{parseMoreProducts as S}from"../../../../sections/product-grid-pages.js";import{ProductGridMeta as _}from"./meta.js";const Q={..._,render:e=>{const l=typeof e.id=="string"?e.id:"",c=e.template;if(e.dynamic){const n=T(e.headPlacement)==="own-box",m=x=>n?void 0:x;return g(b,{num:m(t(e.num,a.num,e.editor)),title:m(t(e.title,o.sectionHeading,e.editor)),description:m(t(e.description,o.body,e.editor)),omitHead:n,columns:typeof e.columns=="number"?e.columns:3,columnsPhone:e[d("columns")],columnsTablet:e[P("columns")],gap:e.gap,gapPhone:e[d("gap")],cardCount:s(e.limit),relationship:typeof e.relationship=="string"?e.relationship:y,hover:h(e,"ProductGrid"),ownerId:l,template:c,cardImage:e.cardImage,outline:e.outline,indexBadge:e.indexBadge,editing:e.editor?.isEditing})}const r=t(e.linkText,a.link,e.editor),u=e.source,w=C(e,"full"),f=T(e.headPlacement)==="own-box",i=n=>f?void 0:n;return g(k,{gap:e.gap,gapPhone:e[d("gap")],contentCapped:w.mode==="page",num:i(t(e.num,a.num,e.editor)),title:i(t(e.title,o.sectionHeading,e.editor)),titleSize:e.titleSize,padTop:f?0:e.padTop,description:i(t(e.description,o.body,e.editor)),link:i(r?{text:r,href:R(e.linkHref)||"#"}:void 0),products:e.products,wheels:e.wheels,source:u?.slug?u:void 0,catalog:e.catalog,catalogTotal:e.catalogTotal,firstCountInChips:e[H]===!0,kinds:e.kinds,fieldUsage:e.fieldUsage,columns:e.columns,columnsPhone:e[d("columns")],columnsTablet:e[P("columns")],limit:I({limit:e.limit,showAll:e.showAll}),moreProducts:S(e.moreProducts),perPage:e.perPage,editing:e.editor?.isEditing,hover:h(e,"ProductGrid"),ownerId:l,template:c})}};export{Q as ProductGridRender};
@@ -1 +1 @@
1
- import{jsx as e,Fragment as o}from"react/jsx-runtime";import n from"../../../../../components/card-pieces/CardPrice.js";import{useGridCard as d}from"../../../../../components/GridCardTemplate.js";import m from"../../../../../components/card-pieces/HostPart.js";import{readPartStyles as a}from"efficient-web-builder/render/lib/document/part-styles";import{HideTaker as c}from"efficient-web-builder/render/components/ViewHideRoot";import{ProductPriceMeta as i}from"./meta.js";function f({children:r}){return d().ownerId?e(c,{children:r}):e(o,{children:r})}const x={...i,render:r=>{const t=!!r.editor?.isEditing;return e(m,{label:i.label??"",editing:t,onHero:!0,children:e(f,{children:e(n,{quoteSets:!0,region:{nodeId:typeof r.id=="string"?r.id:void 0,partStyles:a(r),editing:t}})})})}};export{x as ProductPriceRender};
1
+ import{jsx as t,Fragment as n}from"react/jsx-runtime";import d from"../../../../../components/card-pieces/CardPrice.js";import{useGridCard as o}from"../../../../../components/GridCardTemplate.js";import a from"../../../../../components/card-pieces/HostPart.js";import{readPartStyles as s}from"efficient-web-builder/render/lib/document/part-styles";import{HideTaker as l}from"efficient-web-builder/render/components/ViewHideRoot";import{ProductPriceMeta as i}from"./meta.js";function m({children:e}){return o().ownerId?t(l,{children:e}):t(n,{children:e})}function c({region:e}){const{rules:r}=o();return t(d,{quoteSets:r.quoteSets,setTotal:r.setTotal,wasFollowsSize:r.wasFollowsSize,region:e})}const F={...i,render:e=>{const r=!!e.editor?.isEditing;return t(a,{label:i.label??"",editing:r,onHero:!0,children:t(m,{children:t(c,{region:{nodeId:typeof e.id=="string"?e.id:void 0,partStyles:s(e),editing:r}})})})}};export{F as ProductPriceRender};
@@ -1 +1 @@
1
- "use client";import{jsx as r}from"react/jsx-runtime";import s from"../../../../../components/card-pieces/HostPart.js";import{CardSpecFacts as o,CardSpecLine as d}from"../../../../../components/card-pieces/CardSpecs.js";import{useGridCard as c}from"../../../../../components/GridCardTemplate.js";import{ProductSpecsMeta as i}from"./meta.js";function n({sizes:e}){const{fieldUsage:t}=c();return r(d,{children:r(o,{sizes:e,fieldUsage:t})})}const u={...i,render:e=>r(s,{label:i.label??"",editing:!!e.editor?.isEditing,children:r(n,{sizes:e.sizes===!0})})};export{u as ProductSpecsRender};
1
+ "use client";import{jsx as r}from"react/jsx-runtime";import o from"../../../../../components/card-pieces/HostPart.js";import{CardSpecFacts as c,CardSpecLine as d}from"../../../../../components/card-pieces/CardSpecs.js";import{useGridCard as n}from"../../../../../components/GridCardTemplate.js";import{ProductSpecsMeta as i}from"./meta.js";function a({sizes:e}){const{fieldUsage:t,fit:s}=n();return r(d,{children:r(c,{sizes:e,fieldUsage:t,car:s})})}const S={...i,render:e=>r(o,{label:i.label??"",editing:!!e.editor?.isEditing,children:r(a,{sizes:e.sizes===!0})})};export{S as ProductSpecsRender};
@@ -1 +1 @@
1
- import{jsx as o}from"react/jsx-runtime";import n from"../../../../../components/AppointmentBooking.js";import{PH as i}from"efficient-web-builder/format/lib/document/blocks/placeholders";import{phHide as t}from"efficient-web-builder/render/lib/document/blocks/scaffold";import{AppointmentBookingMeta as d}from"./meta.js";const f={...d,render:e=>o(n,{eyebrow:t(e.eyebrow,i.eyebrow,e.editor),heading:t(e.heading,i.heading,e.editor),intro:t(e.intro,i.body,e.editor),buttonLabel:t(e.buttonLabel,i.button,e.editor),successMessage:t(e.successMessage,i.bookingConfirmation,e.editor),boxes:e.boxes,inBoxes:e.layout==="boxes",nodeId:typeof e.id=="string"?e.id:void 0,editing:e.editor?.isEditing})};export{f as AppointmentBookingRender};
1
+ import{jsx as m}from"react/jsx-runtime";import a from"../../../../../components/AppointmentBooking.js";import{PH as o}from"efficient-web-builder/format/lib/document/blocks/placeholders";import{parseSectionHeadPlacement as r}from"efficient-web-builder/format/lib/sections/section-head-placement";import{phHide as t}from"efficient-web-builder/render/lib/document/blocks/scaffold";import{AppointmentBookingMeta as b}from"./meta.js";const h={...b,render:e=>{const n=r(e.headPlacement)==="own-box",i=d=>n?void 0:d;return m(a,{eyebrow:i(t(e.eyebrow,o.eyebrow,e.editor)),heading:i(t(e.heading,o.heading,e.editor)),intro:i(t(e.intro,o.body,e.editor)),omitHead:n,buttonLabel:t(e.buttonLabel,o.button,e.editor),successMessage:t(e.successMessage,o.bookingConfirmation,e.editor),boxes:e.boxes,inBoxes:e.layout==="boxes",nodeId:typeof e.id=="string"?e.id:void 0,editing:e.editor?.isEditing})}};export{h as AppointmentBookingRender};
@@ -1 +1 @@
1
- import{jsx as r}from"react/jsx-runtime";import m from"../../../../../components/ContactRouting.js";import{CONTACT_ROUTING_DEFAULTS as e}from"efficient-web-builder/format/lib/content/contact";import{hidableText as i}from"efficient-easel/screen/lib/document/hidable";import{phHide as o}from"efficient-web-builder/render/lib/document/blocks/scaffold";import{ContactRoutingMeta as u}from"./meta.js";const N={...u,render:t=>r(m,{routingNumber:o(t.routingNumber,e.routingNumber,t.editor),routingTagline:o(t.routingTagline,e.routingTagline,t.editor),groups:t.groups??[],formNumber:o(t.formNumber,e.formNumber,t.editor),formHeading:o(t.formHeading,e.formHeading,t.editor),metaLines:(t.metaItems??[]).map(n=>n?.text??"").filter(Boolean),showOther:t.showOther,otherLabel:i(t.otherLabel)||e.otherLabel,otherNoteTitle:o(t.otherNoteTitle,e.otherNoteTitle,t.editor),otherNoteBody:o(t.otherNoteBody,e.otherNoteBody,t.editor),buttonText:i(t.buttonText)||e.buttonText,consent:o(t.consent,e.consent,t.editor),channels:t.channels??[],formSlug:i(t.formSlug)||void 0,form:t.form,editing:t.editor?.isEditing})};export{N as ContactRoutingRender};
1
+ import{jsx as a}from"react/jsx-runtime";import d from"../../../../../components/ContactRouting.js";import{CONTACT_ROUTING_DEFAULTS as t}from"efficient-web-builder/format/lib/content/contact";import{hidableText as i}from"efficient-easel/screen/lib/document/hidable";import{parseSectionHeadPlacement as u}from"efficient-web-builder/format/lib/sections/section-head-placement";import{phHide as o}from"efficient-web-builder/render/lib/document/blocks/scaffold";import{ContactRoutingMeta as g}from"./meta.js";const x={...g,render:e=>{const r=u(e.headPlacement)==="own-box",m=n=>r?void 0:n;return a(d,{routingNumber:m(o(e.routingNumber,t.routingNumber,e.editor)),routingTagline:m(o(e.routingTagline,t.routingTagline,e.editor)),omitHead:r,groups:e.groups??[],formNumber:o(e.formNumber,t.formNumber,e.editor),formHeading:o(e.formHeading,t.formHeading,e.editor),metaLines:(e.metaItems??[]).map(n=>n?.text??"").filter(Boolean),showOther:e.showOther,otherLabel:i(e.otherLabel)||t.otherLabel,otherNoteTitle:o(e.otherNoteTitle,t.otherNoteTitle,e.editor),otherNoteBody:o(e.otherNoteBody,t.otherNoteBody,e.editor),buttonText:i(e.buttonText)||t.buttonText,consent:o(e.consent,t.consent,e.editor),channels:e.channels??[],formSlug:i(e.formSlug)||void 0,form:e.form,editing:e.editor?.isEditing})}};export{x as ContactRoutingRender};
@@ -4,4 +4,10 @@ export declare const EVENTS_PH: {
4
4
  title: string;
5
5
  link: string;
6
6
  };
7
+ export declare const EventsSlots: {
8
+ template: {
9
+ type: "slot";
10
+ allow: string[];
11
+ };
12
+ };
7
13
  export declare const EventsMeta: Omit<BlockRender, "render">;
@@ -1 +1 @@
1
- import{PH as t}from"efficient-web-builder/format/lib/document/blocks/placeholders";const l={num:t.sectionNumber,title:"Section title",link:t.viewAll},o={label:"Latest Posts",defaultProps:{num:"",title:"",linkText:"",linkHref:"/journal",columns:3,limit:3,showAll:!1}};export{l as EVENTS_PH,o as EventsMeta};
1
+ import{PH as t}from"efficient-web-builder/format/lib/document/blocks/placeholders";import{cardTemplateSlot as e}from"efficient-web-builder/format/lib/content/card-template";const i={num:t.sectionNumber,title:"Section title",link:t.viewAll},l={template:e()},n={label:"Latest Posts",fields:l,defaultProps:{num:"",title:"",linkText:"",linkHref:"/journal",columns:3,limit:3,showAll:!1}};export{i as EVENTS_PH,n as EventsMeta,l as EventsSlots};
@@ -1 +1 @@
1
- import{jsx as f}from"react/jsx-runtime";import{phoneKey as h}from"efficient-easel/draw";import g,{readFacets as x,readTags as k}from"../../../../../components/Events.js";import{declaredBlockSource as y,sourcedRows as b}from"efficient-web-builder/format/lib/content/block-sources";import{servedListOf as v,servedRowLists as T}from"../../../../content/served-lists.js";import{hidableText as E}from"efficient-easel/screen/lib/document/hidable";import{parseSectionHeadPlacement as A}from"efficient-web-builder/format/lib/sections/section-head-placement";import{phHide as o}from"efficient-web-builder/render/lib/document/blocks/scaffold";import{say as a}from"efficient-web-builder/format/lib/editor-words";import{EventsMeta as B,EVENTS_PH as r}from"./meta.js";const S=()=>[{key:"sample-1",title:a("First card"),excerpt:a("A line about it appears here.")},{key:"sample-2",title:a("Second card"),excerpt:a("A line about it appears here.")},{key:"sample-3",title:a("Third card"),excerpt:a("A line about it appears here.")},{key:"sample-4",title:a("Fourth card"),excerpt:a("A line about it appears here.")}],s=(e,i,t)=>({slug:e.key||`card-${i}`,title:e.title??"",excerpt:e.excerpt??"",cover:e.cover??"",meta:e.meta||void 0,dateLabel:e.dateLabel||void 0,href:e.href||"#",...t?.facets?{facets:t.facets}:{},...t?.tags?{tags:t.tags}:{}}),F=e=>T(e,i=>({facets:x(i.facets),tags:k(i.tags)})),K={...B,render:e=>{const i=A(e.headPlacement)==="own-box",t=d=>i?void 0:d,m=o(e.linkText,r.link,e.editor),n=y(e)!==""?b(e,!!e.editor?.isEditing,S()):null,c=n&&!n.sample?F(e):null,u=n?n.sample?[]:n.rows.map((d,l)=>s(d,l,v(c,d,l))):e.posts;return f(g,{num:t(o(e.num,r.num,e.editor)),title:t(o(e.title,r.title,e.editor)),link:t(m?{text:m,href:E(e.linkHref)||"/journal"}:void 0),omitHead:i,posts:u,sample:n?.sample?n.rows.map((d,l)=>s(d,l)):void 0,columns:e.columns,limit:e.limit,showAll:e.showAll,layout:e.layout,featuredWidth:e.featuredWidth,listCover:e.listCover,featuredDarken:e.featuredDarken,cardImage:e.cardImage,gap:e.gap,gapPhone:e[h("gap")],nameFilter:e.nameFilter===!0,padTop:typeof e.padTop=="number"?e.padTop:void 0,padBottom:typeof e.padBottom=="number"?e.padBottom:void 0,editing:e.editor?.isEditing})}};export{K as EventsRender};
1
+ import{jsx as f}from"react/jsx-runtime";import{phoneKey as h}from"efficient-easel/draw";import g,{readFacets as x,readTags as k}from"../../../../../components/Events.js";import{declaredBlockSource as y,sourcedRows as b}from"efficient-web-builder/format/lib/content/block-sources";import{servedListOf as v,servedRowLists as T}from"../../../../content/served-lists.js";import{hidableText as E}from"efficient-easel/screen/lib/document/hidable";import{parseSectionHeadPlacement as S}from"efficient-web-builder/format/lib/sections/section-head-placement";import{phHide as m}from"efficient-web-builder/render/lib/document/blocks/scaffold";import{say as a}from"efficient-web-builder/format/lib/editor-words";import{EventsMeta as A,EVENTS_PH as r}from"./meta.js";const B=()=>[{key:"sample-1",title:a("First card"),excerpt:a("A line about it appears here.")},{key:"sample-2",title:a("Second card"),excerpt:a("A line about it appears here.")},{key:"sample-3",title:a("Third card"),excerpt:a("A line about it appears here.")},{key:"sample-4",title:a("Fourth card"),excerpt:a("A line about it appears here.")}],c=(e,i,t)=>({slug:e.key||`card-${i}`,title:e.title??"",excerpt:e.excerpt??"",cover:e.cover??"",meta:e.meta||void 0,dateLabel:e.dateLabel||void 0,href:e.href||"#",...t?.facets?{facets:t.facets}:{},...t?.tags?{tags:t.tags}:{}}),F=e=>T(e,i=>({facets:x(i.facets),tags:k(i.tags)})),K={...A,render:e=>{const i=S(e.headPlacement)==="own-box",t=d=>i?void 0:d,o=m(e.linkText,r.link,e.editor),n=y(e)!==""?b(e,!!e.editor?.isEditing,B()):null,s=n&&!n.sample?F(e):null,u=n?n.sample?[]:n.rows.map((d,l)=>c(d,l,v(s,d,l))):e.posts;return f(g,{num:t(m(e.num,r.num,e.editor)),title:t(m(e.title,r.title,e.editor)),link:t(o?{text:o,href:E(e.linkHref)||"/journal"}:void 0),omitHead:i,posts:u,sample:n?.sample?n.rows.map((d,l)=>c(d,l)):void 0,columns:e.columns,limit:e.limit,showAll:e.showAll,layout:e.layout,featuredWidth:e.featuredWidth,listCover:e.listCover,featuredDarken:e.featuredDarken,cardImage:e.cardImage,gap:e.gap,gapPhone:e[h("gap")],nameFilter:e.nameFilter===!0,padTop:typeof e.padTop=="number"?e.padTop:void 0,padBottom:typeof e.padBottom=="number"?e.padBottom:void 0,editing:e.editor?.isEditing,template:e.template,ownerId:String(e.id??"")})}};export{K as EventsRender};
@@ -1,3 +1,4 @@
1
1
  import type { BlockRender } from "efficient-web-builder/format/lib/document/blocks/block-types";
2
- export declare const RATING_NONE = 0;
2
+ import { RATING_NONE } from "../../../../content/rating.js";
3
+ export { RATING_NONE };
3
4
  export declare const RatingBlockMeta: Omit<BlockRender, "render">;
@@ -1 +1 @@
1
- const t=0,a={label:"Rating",defaultProps:{rating:0}};export{t as RATING_NONE,a as RatingBlockMeta};
1
+ import{RATING_NONE as t}from"../../../../content/rating.js";const a={label:"Rating",defaultProps:{rating:t}};export{t as RATING_NONE,a as RatingBlockMeta};