efficient-storefront-blocks 0.133.3 → 0.133.5

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.
@@ -1195,6 +1195,24 @@ body .sf-site-header[data-header-ink="dark"] {
1195
1195
  letter-spacing: normal;
1196
1196
  }
1197
1197
 
1198
+ /* Header → Letters: Capitalised reaches the cart drawer too (the drawer is
1199
+ a sibling of the bar, so the page is asked). Its capitals are drawn as
1200
+ typed, and the "N° 1 ·" line number goes: the process name stands alone.
1201
+ The drawer is found by its dialog name (components/CartDrawer
1202
+ `CART_DRAWER_LABEL`), so a site without Letters keeps today's markup. */
1203
+ :root:has([data-header-nav-case="capitalised"]) [role="dialog"][aria-label="Your cart"] .uppercase {
1204
+ text-transform: none;
1205
+ letter-spacing: normal;
1206
+ }
1207
+ :root:has([data-header-nav-case="capitalised"]) [role="dialog"][aria-label="Your cart"] [data-cart-line-no] {
1208
+ display: none;
1209
+ }
1210
+ /* Without their letter space the 9, 10 and 11 px capitals read too small, so
1211
+ they are drawn at the checkout's label size. */
1212
+ :root:has([data-header-nav-case="capitalised"]) [role="dialog"][aria-label="Your cart"] :is(.text-\[9px\], .text-\[10px\], .text-\[11px\]) {
1213
+ font-size: 12px;
1214
+ }
1215
+
1198
1216
  /* A Form's Label weight, Regular: its field labels at the regular weight
1199
1217
  (components/FormBlock `data-form-label`). Unset is today's semibold. */
1200
1218
  [data-form-label="regular"] .font-semibold {
@@ -1,4 +1,5 @@
1
1
  import { type CartDrawerContent, type CartDrawerLook } from "efficient-web-builder/format/lib/content/cart-drawer";
2
+ export declare const CART_DRAWER_LABEL = "Your cart";
2
3
  export default function CartDrawer({ content, look, }: {
3
4
  content?: CartDrawerContent;
4
5
  look?: CartDrawerLook;
@@ -1 +1 @@
1
- "use client";import{jsx as r,jsxs as a}from"react/jsx-runtime";import{useEffect as m,useRef as u}from"react";import{useCart as C}from"./CartContext.js";import{isTyreLine as d}from"../lib/tyres/tyre-purchase.js";import{useTyreCatalog as R}from"./useTyreCatalog.js";import w from"./PopupFrame.js";import{CartActions as T,CartCouponRow as x,CartDrawerHeader as O,CartLines as _,CartStatusRail as v,CartTotals as y,CartTrustMarkers as A,CartUpsell as D}from"./cart/drawer-parts.js";import{CART_DRAWER_DEFAULTS as L,resolveCartDrawerLook as h}from"efficient-web-builder/format/lib/content/cart-drawer";const j=h(void 0);function E({content:e=L,look:t=j}){const{isOpen:l,preview:n,close:i,items:c,setAutoOpen:o}=C(),s=u(null),p=R(c.filter(d).map(f=>f.slug));return m(()=>{o(t.autoOpen)},[t.autoOpen,o]),a(w,{look:t,drawer:{closeRef:s,lockScroll:!n},open:l,onClose:i,label:"Your cart",children:[r(O,{content:e,closeRef:s}),r(v,{content:e}),a("div",{className:"flex-1 overflow-y-auto [scrollbar-color:var(--site-line)_transparent] [scrollbar-width:thin]",children:[r(_,{content:e,tyres:p}),r(D,{}),r(x,{}),r(A,{content:e})]}),r(y,{}),r(T,{})]})}export{E as default};
1
+ "use client";import{jsx as r,jsxs as a}from"react/jsx-runtime";import{useEffect as m,useRef as u}from"react";import{useCart as C}from"./CartContext.js";import{isTyreLine as R}from"../lib/tyres/tyre-purchase.js";import{useTyreCatalog as d}from"./useTyreCatalog.js";import w from"./PopupFrame.js";import{CartActions as A,CartCouponRow as T,CartDrawerHeader as _,CartLines as x,CartStatusRail as L,CartTotals as D,CartTrustMarkers as E,CartUpsell as O}from"./cart/drawer-parts.js";import{CART_DRAWER_DEFAULTS as v,resolveCartDrawerLook as y}from"efficient-web-builder/format/lib/content/cart-drawer";const h=y(void 0),j="Your cart";function S({content:e=v,look:t=h}){const{isOpen:l,preview:n,close:i,items:c,setAutoOpen:o}=C(),s=u(null),p=d(c.filter(R).map(f=>f.slug));return m(()=>{o(t.autoOpen)},[t.autoOpen,o]),a(w,{look:t,drawer:{closeRef:s,lockScroll:!n},open:l,onClose:i,label:j,children:[r(_,{content:e,closeRef:s}),r(L,{content:e}),a("div",{className:"flex-1 overflow-y-auto [scrollbar-color:var(--site-line)_transparent] [scrollbar-width:thin]",children:[r(x,{content:e,tyres:p}),r(O,{}),r(T,{}),r(E,{content:e})]}),r(D,{}),r(A,{})]})}export{j as CART_DRAWER_LABEL,S as default};
@@ -8,6 +8,7 @@ export interface GalleryGridProps {
8
8
  template?: SlotComponent;
9
9
  nodeId?: string;
10
10
  sourced?: readonly ProductPictureTile[];
11
+ galleryLink?: boolean;
11
12
  num?: string;
12
13
  title?: string;
13
14
  linkText?: string;
@@ -26,4 +27,4 @@ export interface GalleryGridProps {
26
27
  gapPhone?: unknown;
27
28
  sets?: boolean;
28
29
  }
29
- export default function GalleryGrid({ items: Items, template, nodeId, sourced, num, title, linkText, linkHref, galleryHref, submitHref, previewHover, display, displayPhone, styleOwner, layout, layoutPhone, columns, columnsMobile, gap: gapProp, gapPhone, sets, omitHead, pads, editing, }: GalleryGridProps): import("react").JSX.Element;
30
+ export default function GalleryGrid({ items: Items, template, nodeId, sourced, galleryLink, num, title, linkText, linkHref, galleryHref, submitHref, previewHover, display, displayPhone, styleOwner, layout, layoutPhone, columns, columnsMobile, gap: gapProp, gapPhone, sets, omitHead, pads, editing, }: GalleryGridProps): import("react").JSX.Element;
@@ -1,3 +1,3 @@
1
- "use client";import{jsx as r,jsxs as ce}from"react/jsx-runtime";import{useCallback as j,useMemo as f,useState as B}from"react";import{usePathname as me}from"next/navigation";import{containerGapProps as pe}from"efficient-web-builder/format/lib/content/container-gap";import fe from"efficient-web-builder/render/components/Btn";import ge,{GALLERY_GRID_ATTR as ue,GalleryLinksContext as ye,GalleryTilesContext as he}from"./GalleryItem.js";import{useShopperGallery as we}from"./catalog/ShopperScope.js";import{galleryShownIds as Le,galleryToolbarIdle as Se,WALL_PLACED_CELL as Ce,WALL_PLACED_CSS as xe,wallSpanAt as ve}from"../lib/sections/gallery-toolbar.js";import{GALLERY_MOSAIC_LAYOUT as Ge,galleryMosaicRowsCss as Ne}from"../lib/sections/gallery-mosaic.js";import{useSiteSells as _e}from"./SiteRecordContext.js";import{SharedPartKinds as Ae}from"efficient-web-builder/render/components/PublishedPartStylesContext";import{renderHeadline as Pe}from"efficient-web-builder/render/components/goldPhrases";import ke from"efficient-web-builder/render/components/SectionHeader";import{FRAME_120 as Oe,framedBandPad as be,headIsEmpty as Ie,withBandClasses as Te}from"../lib/sections/band-padding.js";import{galleryFrame as Ee,galleryTemplate as Re}from"../lib/sections/gallery-frame.js";import{SITE_COLUMN as Me,withSideOnce as je}from"efficient-web-builder/format/lib/content/page-width";import{resolveGridColumns as Be,resolveGridMobileColumns as $e}from"efficient-web-builder/format/lib/content/grid-span";import{galleryLayoutClass as $,galleryLayoutCss as De,resolveGalleryLayout as Ye}from"efficient-web-builder/format/lib/content/gallery-layout";import{HideTaker as ze}from"efficient-web-builder/render/components/ViewHideRoot";import{useSideSpaceOnce as Fe}from"efficient-web-builder/render/components/SideSpaceOnce";function Ue({items:c,template:D,nodeId:Y,sourced:a,num:x,title:w,linkText:v,linkHref:z,galleryHref:g="/gallery",submitHref:F="/contact",previewHover:U,display:W,displayPhone:K,styleOwner:V,layout:G,layoutPhone:q,columns:u,columnsMobile:H,gap:J,gapPhone:Q,sets:N=!1,omitHead:L=!1,pads:X,editing:_=!1}){const Z=Fe(),ee=me(),le=_e(),se=g!==ee&&(le||g!=="/gallery"),y={layout:G,layoutPhone:q},m=Ye(y),re=!m&&u!=null&&u!=="",i=pe("GalleryB",J,"both",Q),A=m?{className:`sf-card-grid sf-gallery-zone ${$(y)} grid${i.className}`,style:i.style}:re?{className:`sf-card-grid sf-grid-zone grid${i.className}`,style:{...i.style,"--sf-grid-cols":String(Be(u)),"--sf-grid-cols-phone":String($e(H,u))}}:{className:`sf-card-grid grid grid-cols-4${i.className} max-[1500px]:grid-cols-3 max-view-wide:grid-cols-1`,style:i.style},P=v?{text:v,href:z||"#"}:void 0,ne=w?Pe(w,!1):void 0,[k,te]=B({}),O=j((e,s)=>{te(l=>{const o=l[e.id];if(s){if(!o)return l;const{[e.id]:We,...de}=l;return de}return o&&o.tag===e.tag&&o.name===e.name?l:{...l,[e.id]:e}})},[]),h=a?.map(e=>e.tile.id).join(`
1
+ "use client";import{jsx as r,jsxs as me}from"react/jsx-runtime";import{useCallback as j,useMemo as f,useState as B}from"react";import{usePathname as pe}from"next/navigation";import{containerGapProps as fe}from"efficient-web-builder/format/lib/content/container-gap";import ge from"efficient-web-builder/render/components/Btn";import ue,{GALLERY_GRID_ATTR as ye,GalleryLinksContext as he,GalleryTilesContext as we}from"./GalleryItem.js";import{useShopperGallery as Le}from"./catalog/ShopperScope.js";import{galleryShownIds as Se,galleryToolbarIdle as Ce,WALL_PLACED_CELL as xe,WALL_PLACED_CSS as ve,wallSpanAt as Ge}from"../lib/sections/gallery-toolbar.js";import{GALLERY_MOSAIC_LAYOUT as Ne,galleryMosaicRowsCss as _e}from"../lib/sections/gallery-mosaic.js";import{useSiteSells as Ae}from"./SiteRecordContext.js";import{SharedPartKinds as Pe}from"efficient-web-builder/render/components/PublishedPartStylesContext";import{renderHeadline as ke}from"efficient-web-builder/render/components/goldPhrases";import Oe from"efficient-web-builder/render/components/SectionHeader";import{FRAME_120 as be,framedBandPad as Ie,headIsEmpty as Te,withBandClasses as Ee}from"../lib/sections/band-padding.js";import{galleryFrame as Re,galleryTemplate as Me}from"../lib/sections/gallery-frame.js";import{SITE_COLUMN as je,withSideOnce as Be}from"efficient-web-builder/format/lib/content/page-width";import{resolveGridColumns as $e,resolveGridMobileColumns as De}from"efficient-web-builder/format/lib/content/grid-span";import{galleryLayoutClass as $,galleryLayoutCss as Ye,resolveGalleryLayout as ze}from"efficient-web-builder/format/lib/content/gallery-layout";import{HideTaker as Fe}from"efficient-web-builder/render/components/ViewHideRoot";import{useSideSpaceOnce as Ue}from"efficient-web-builder/render/components/SideSpaceOnce";function We({items:c,template:D,nodeId:Y,sourced:a,galleryLink:z=!0,num:x,title:w,linkText:v,linkHref:F,galleryHref:g="/gallery",submitHref:U="/contact",previewHover:W,display:K,displayPhone:V,styleOwner:q,layout:G,layoutPhone:H,columns:u,columnsMobile:J,gap:Q,gapPhone:X,sets:N=!1,omitHead:L=!1,pads:Z,editing:_=!1}){const ee=Ue(),le=pe(),se=Ae(),re=z&&g!==le&&(se||g!=="/gallery"),y={layout:G,layoutPhone:H},m=ze(y),te=!m&&u!=null&&u!=="",i=fe("GalleryB",Q,"both",X),A=m?{className:`sf-card-grid sf-gallery-zone ${$(y)} grid${i.className}`,style:i.style}:te?{className:`sf-card-grid sf-grid-zone grid${i.className}`,style:{...i.style,"--sf-grid-cols":String($e(u)),"--sf-grid-cols-phone":String(De(J,u))}}:{className:`sf-card-grid grid grid-cols-4${i.className} max-[1500px]:grid-cols-3 max-view-wide:grid-cols-1`,style:i.style},P=v?{text:v,href:F||"#"}:void 0,ne=w?ke(w,!1):void 0,[k,oe]=B({}),O=j((e,s)=>{oe(l=>{const o=l[e.id];if(s){if(!o)return l;const{[e.id]:Ke,...ce}=l;return ce}return o&&o.tag===e.tag&&o.name===e.name?l:{...l,[e.id]:e}})},[]),h=a?.map(e=>e.tile.id).join(`
2
2
  `),b=f(()=>h!==void 0?h?h.split(`
3
- `):[]:c?.blockIds,[h,c?.blockIds]),d=f(()=>(b??[]).map(e=>k[e]).filter(e=>!!e),[b,k]),{ref:oe,toolbar:p}=we(d),I=p!==null&&!Se(p,d),n=f(()=>I&&p?Le(d,p):null,[I,p,d]),t=f(()=>n??d.map(e=>e.id),[n,d]),[T,ae]=B(null),E=j((e,s)=>{const l=t.indexOf(e);l<0||t.length<2||ae({id:t[(l+s+t.length)%t.length],at:s>0?"first":"last"})},[t]),ie=f(()=>{const e=new Map((n??[]).map((s,l)=>[s,l]));return{report:O,positionOf:s=>{const l=n?e.get(s):void 0;return l===void 0?null:{index:l+1,total:n.length}},walkCount:t.length,walk:E,opening:T}},[O,n,t.length,E,T]),S=n?e=>{const s=n.indexOf(e);if(s<0)return{style:{display:"none"}};if(!m)return{style:{order:s}};const l=ve(m,s,n.length);return{className:Ce,style:{order:s,"--sf-wall-c":l.col,"--sf-wall-r":l.row,"--sf-wall-cp":l.colPhone,"--sf-wall-rp":l.rowPhone}}}:void 0,R=m?De(y)+(G===Ge?Ne($(y)):""):"",C=be(X,Oe,{noTop:L,nonNegative:!0}),M=Re(D,!a);return r(ze,{as:"section",ref:oe,...C.attrs,className:Te(Ee(L,!!M),C),style:C.style,children:ce("div",{className:je(Me,Z),children:[L||!_&&Ie(x,w,P?.text)?null:r(ke,{num:x,title:ne,link:P}),R?r("style",{dangerouslySetInnerHTML:{__html:R+(n?xe:"")}}):null,(c||a)&&r(ye.Provider,{value:{galleryHref:g,submitHref:F,previewHover:U,display:W,displayPhone:K,styleOwner:V,wordsAtRest:!!a,ownerId:Y,Template:M,...N?{sets:N}:{}},children:r(he.Provider,{value:ie,children:r(Ae,{children:r("div",{[ue]:"",style:{display:"contents"},children:a?r("div",{...A,children:a.map(({tile:e,...s})=>{const l=r(ge,{...s,tile:e,editing:_},e.id),o=S?.(e.id);return o?r("div",{className:o.className,style:o.style,children:l},e.id):l})}):c?r(c,{...A,minEmptyHeight:320,...S?{cell:S}:{}}):null})})})}),se&&r("div",{className:"mt-12 flex flex-col items-center gap-3",children:r(fe,{href:g,variant:"ghost",children:"See Gallery"})})]})})}export{Ue as default};
3
+ `):[]:c?.blockIds,[h,c?.blockIds]),d=f(()=>(b??[]).map(e=>k[e]).filter(e=>!!e),[b,k]),{ref:ae,toolbar:p}=Le(d),I=p!==null&&!Ce(p,d),t=f(()=>I&&p?Se(d,p):null,[I,p,d]),n=f(()=>t??d.map(e=>e.id),[t,d]),[T,ie]=B(null),E=j((e,s)=>{const l=n.indexOf(e);l<0||n.length<2||ie({id:n[(l+s+n.length)%n.length],at:s>0?"first":"last"})},[n]),de=f(()=>{const e=new Map((t??[]).map((s,l)=>[s,l]));return{report:O,positionOf:s=>{const l=t?e.get(s):void 0;return l===void 0?null:{index:l+1,total:t.length}},walkCount:n.length,walk:E,opening:T}},[O,t,n.length,E,T]),S=t?e=>{const s=t.indexOf(e);if(s<0)return{style:{display:"none"}};if(!m)return{style:{order:s}};const l=Ge(m,s,t.length);return{className:xe,style:{order:s,"--sf-wall-c":l.col,"--sf-wall-r":l.row,"--sf-wall-cp":l.colPhone,"--sf-wall-rp":l.rowPhone}}}:void 0,R=m?Ye(y)+(G===Ne?_e($(y)):""):"",C=Ie(Z,be,{noTop:L,nonNegative:!0}),M=Me(D,!a);return r(Fe,{as:"section",ref:ae,...C.attrs,className:Ee(Re(L,!!M),C),style:C.style,children:me("div",{className:Be(je,ee),children:[L||!_&&Te(x,w,P?.text)?null:r(Oe,{num:x,title:ne,link:P}),R?r("style",{dangerouslySetInnerHTML:{__html:R+(t?ve:"")}}):null,(c||a)&&r(he.Provider,{value:{galleryHref:g,submitHref:U,previewHover:W,display:K,displayPhone:V,styleOwner:q,wordsAtRest:!!a,ownerId:Y,Template:M,...N?{sets:N}:{}},children:r(we.Provider,{value:de,children:r(Pe,{children:r("div",{[ye]:"",style:{display:"contents"},children:a?r("div",{...A,children:a.map(({tile:e,...s})=>{const l=r(ue,{...s,tile:e,editing:_},e.id),o=S?.(e.id);return o?r("div",{className:o.className,style:o.style,children:l},e.id):l})}):c?r(c,{...A,minEmptyHeight:320,...S?{cell:S}:{}}):null})})})}),re&&r("div",{className:"mt-12 flex flex-col items-center gap-3",children:r(ge,{href:g,variant:"ghost",children:"See Gallery"})})]})})}export{We as default};
@@ -1 +1 @@
1
- "use client";import{jsx as r,Fragment as E,jsxs as s}from"react/jsx-runtime";import oe from"next/link";import{usePathname as Ze}from"next/navigation";import{useCallback as et,useEffect as re,useRef as tt,useState as v}from"react";import{rootIsDark as nt,watchRootTheme as ot}from"efficient-shell/format";import{useCart as rt}from"./CartContext.js";import{useSearch as st}from"./SearchContext.js";import lt,{useCountrySelectShows as at}from"./CountrySelect.js";import{resolveCountryShowAs as it}from"../lib/content/country-show-as.js";import se from"./HeaderNavItem.js";import ct from"efficient-web-builder/render/components/Logo";import{siteLengthCss as dt}from"efficient-web-builder/format/lib/content/css-length";import mt from"./MenuPlaceholderLabel.js";import{withRMark as le}from"efficient-web-builder/render/components/RMark";import{AccountButton as ut,CartButton as ht,SearchButton as ft}from"./HeaderTools.js";import pt from"./HeaderCallButton.js";import{useHeaderBar as gt}from"./useHeaderBar.js";import{useHeaderAtTopIsDark as bt}from"./useHeaderAtTopIsDark.js";import{usePageOwnsTop as xt}from"./usePageOwnsTop.js";import{useModalDismiss as vt}from"./useModalDismiss.js";import yt from"./ThemeToggle.js";import{products as wt}from"../lib/api/index.js";import{shouldFetchPublicHeaderSettings as St}from"../lib/header-settings-fetch.js";import{menuDropdownAside as kt}from"../lib/menu-link.js";import{HEADER_MENU_PLACEHOLDER_COUNT as Nt}from"../lib/content/menu-placeholder.js";import{DEFAULT_SWITCH_SHOWN as Pt}from"efficient-web-builder/format/lib/theme";import{chromeWidthStyle as Tt,resolveChromeWidth as Et}from"efficient-web-builder/format/lib/content/page-width";import{headerThemeWrap as It}from"../lib/content/header-theme.js";import{headerSolidBackground as $t,isProductPage as Ct,resolveMenuRow as Lt,resolveNavTextCase as _t,resolveUtilStyle as Ht}from"../lib/content/header-bar.js";import{surfaceIsLight as Rt}from"../lib/logo/surface-is-light.js";import{HEADER_HEIGHT_PX as At,HEADER_MENU_GAP_PX as Dt,HEADER_SET_HEIGHT_CSS as Ut}from"efficient-web-builder/render/lib/document/header-clearance";import{HEADER_INK_OVERRIDE_ATTR as Mt,resolveHeaderInkMode as jt}from"efficient-web-builder/render/lib/document/header-ink";const ae={stacked:{grid:"hidden min-[1501px]:grid",flex:"hidden min-[1501px]:flex"},inline:{grid:"hidden view-tablet:grid",flex:"hidden view-tablet:flex"}},Ot=Array.from({length:Nt},()=>({href:"#",label:r(mt,{})}));function zt({previewSettings:p,initialSettings:I,editorPreview:$,showThemeToggle:ie,wordmark:ce,hideLogo:de,hideMenu:me,siteName:C,commerceEnabled:g=!0}={}){const ue=Ze(),B=Ct(ue),[c,y]=v(!1),{open:he,totals:fe}=rt(),{open:pe}=st(),[L,ge]=v(!1),[be,xe]=v(null),[ve,ye]=v(null),[t,we]=v(I??null),n=p??(t?{logoUrl:t.logoUrl,reverseLogo:t.reverseLogo,logoReversed:t.logoReversed,logoInkIsDark:t.logoInkIsDark,logoPosition:t.logoPosition,logoSize:t.logoSize,logoSizePx:t.logoSizePx,logoSizeUnit:t.logoSizeUnit??null,menuItems:(t.menuItems??[]).map(e=>({label:e.label,url:e.url,dropdown_menu:null,dropdown_items:e.dropdownItems??[],dropdown_aside:e.dropdownAside??null})),menuSplit:t.menuSplit??3,menuPosition:t.menuPosition,menuRow:t.menuRow,menuGapPx:t.menuGapPx??null,menuGapUnit:t.menuGapUnit??null,searchEnabled:t.searchEnabled,searchPosition:t.searchPosition,searchRow:t.searchRow,countrySelectorEnabled:t.countrySelectorEnabled,countrySelectorShowAs:t.countrySelectorShowAs,countryUrls:t.countryUrls,accountEnabled:t.accountEnabled,cartEnabled:t.cartEnabled,utilStyle:t.utilStyle,navTextCase:t.navTextCase,lightReverseText:t.lightReverseText,topTextColor:t.topTextColor,transparentTop:t.transparentTop,surface:t.surface,theme:t.theme,width:t.width,heightPx:t.heightPx,borderThickness:t.borderThickness??null,sticky:t.sticky,callButton:t.callButton,callPhone:t.callPhone,callHref:t.callHref}:null),Se=de?null:n?.logoUrl??null,ke=n?.reverseLogo??!1,Ne=n?.logoReversed??null,Pe=n?.logoInkIsDark??null,i=n?.logoPosition??"center",Te=n?.logoSize??"medium",Ee=n?.logoSizePx??null,Ie=n?.logoSizeUnit??null,G=Math.min(Math.max(n?.menuSplit??3,1),4),$e=(n?.menuPosition??"left")==="center",Ce=(n?.menuPosition??"left")==="beside",F=Lt(n?.menuRow)==="inline",_=n?.menuGapPx??null,Le=_!=null?{gap:dt(_,n?.menuGapUnit,"gap",Dt)??`${_}px`}:void 0,w=F?ae.inline:ae.stacked,_e=n?.searchEnabled??!1,W=n?.searchPosition??"right",He=n?.countrySelectorEnabled??!0,Re=it(n?.countrySelectorShowAs),H=n?.accountEnabled??!0,Ae=n?.cartEnabled??!0,R=Ht(n?.utilStyle)==="text",l=`mono-eyebrow${_t(n?.navTextCase)==="capitalised"?" mono-eyebrow-plain":""}`,V=n?.countryUrls??{},De=Et(n?.width),Ue=Tt(De)??void 0,Me=n?.heightPx??At.default,K=Math.round(n?.borderThickness??1),je=Number.isFinite(K)?Math.min(Math.max(K,0),20):1,X=n?.sticky??"always",A=jt(n?.topTextColor),m=It(n?.theme),S=Object.keys(V),Y=at(S.length?S:void 0),b=He?r(lt,{countries:S.length?S:void 0,urls:p?void 0:V,showAs:Re}):null,{headerRef:u,scrolled:J,navHidden:Oe}=gt({stickyMode:X,heightPx:Me}),ze=m?JSON.stringify(m.style):null;re(()=>{const e=u.current?.ownerDocument??document,o=e.defaultView??window,T=ne=>ne?Rt(o.getComputedStyle(ne).getPropertyValue("--bg")):null,z=()=>{ge(!nt({doc:e,whenUnset:!0})),xe(T(e.body)),ye(T(u.current))};z();const Qe=ot(z,{doc:e}),te=new MutationObserver(z);return e.body&&te.observe(e.body,{attributes:!0,attributeFilter:["style"]}),()=>{Qe(),te.disconnect()}},[u,ze]);const x=ie??Pt?r(yt,{}):null;re(()=>{if(!St({editorPreview:!!$,hasPreviewSettings:!!p,hasInitialSettings:!!I}))return;let e=!1;return wt.getHeaderSettings().then(o=>!e&&we(o)).catch(o=>{console.warn("[header] settings fetch failed; using built-in defaults",o)}),()=>{e=!0}},[$,p,I]);const Be=xt(u),k=J||B||Be,q=$t(L,B),Q=bt(u,A),Ge=k||!Q,Fe=k?ve??L:(be??L)&&!Q,We=A==="auto"?null:{[Mt]:A},Ve=et(()=>y(!1),[]),D=tt(null);vt({active:c,onDismiss:Ve,focusRef:D,trapRef:D});const d=(e,o,T="start")=>r(se,{item:e,dropdownAlign:T},o),Ke=!me&&(n?.menuItems?.length??0)>0,N=!!$||!!p,a=Ke?n.menuItems.map(e=>({href:e.url||"",label:le(e.label),plainLabel:e.label,dropdownItems:(e.dropdown_items??[]).map(o=>({href:o.url||"",label:le(o.label),plainLabel:o.label,description:o.description,image:o.image,badge:o.badge})),dropdownAside:kt(e.dropdown_aside)})):N?Ot.map(e=>({...e,plainLabel:"Menu item",dropdownItems:[]})):[],Xe=a.length>0||g&&H||!!b&&Y||!!x,Ye=i==="center"?a.slice(0,G):i==="right"?a:[],Je=i==="center"?a.slice(G):i==="left"?a:[],P=_e&&g?r(ft,{onClick:N?void 0:pe,asText:R}):null,U=g&&H?r(ut,{asText:R}):null,M=e=>g&&Ae?r(ht,{onClick:he,count:fe.sets,asText:R,className:e}):null,qe=n?.callPhone??"",Z=n?.callHref??"",j=e=>n?.callButton&&(Z||N)?r(pt,{href:N?"":Z,label:e?"Call":qe||"Call"}):null,h=s(E,{children:[W==="left"?P:null,b,x,U,M(),W==="right"?P:null,j(!1)]}),O=(e,o=!1)=>r(oe,{href:"/","aria-label":C?`${C} home`:"Home",className:e,children:r(ct,{variant:"header",scrolled:Ge,src:Se,reverse:ke,onLightSurface:Fe,reversedSrc:Ne,inkIsDark:Pe,size:Te,sizePx:Ee,sizeUnit:Ie,wordmark:ce,siteName:C,fitToContainer:o})}),f=O("inline-flex shrink-0 items-center justify-center"),ee="flex min-w-0 flex-1 items-center overflow-x-clip [container-type:inline-size]";return s(E,{children:[r("header",{ref:u,"data-scrolled":J||void 0,...We,className:["sf-site-header",...m?[m.className]:[],X==="none"?"absolute":"fixed","inset-x-0 top-0 z-50","flex items-center","px-[var(--sf-site-gutter,40px)] max-view-tablet:px-[min(20px,var(--sf-site-gutter,40px))]",k?"border-solid border-line backdrop-blur-md":"border-solid border-transparent","transition-[background,border-color,transform] duration-300 ease-out"].join(" "),style:{...m?m.style:null,minHeight:Ut,borderBottomWidth:`${je}px`,...Oe?{transform:"translateY(-100%)"}:null,...k?{background:q,color:"var(--fg)","--sf-header-ground":q}:{color:"var(--sf-header-overlay-fg)","--sf-header-ground":"var(--sf-header-overlay-ground)"}},children:s("div",{className:"w-full",style:Ue,children:[$e?s("div",{"data-header-band":"",className:`${w.grid} grid-cols-[1fr_auto_1fr] items-center gap-8`,children:[i==="right"?r("nav",{className:`${l} flex items-center gap-8`,children:h}):r("div",{className:"flex items-center",children:f}),r("nav",{className:`${l} flex items-center justify-center gap-8`,children:a.map((e,o)=>d(e,`${e.href}-${o}`,"center"))}),i==="right"?r("div",{className:"flex items-center justify-end",children:f}):r("nav",{className:`${l} flex items-center justify-end gap-8`,children:h})]}):i==="center"?s("div",{"data-header-band":"",className:`${w.grid} grid-cols-[1fr_auto_1fr] items-center gap-8`,children:[r("nav",{className:`${l} flex items-center gap-8`,children:Ye.map((e,o)=>d(e,`${e.href}-${o}`))}),f,s("nav",{className:`${l} flex items-center justify-end gap-8`,children:[Je.map((e,o)=>d(e,`${e.href}-${o}`,"end")),h]})]}):Ce?s("div",{"data-header-band":"",className:`${w.flex} items-center justify-between gap-8`,children:[s("div",{className:"flex items-center gap-8",style:Le,children:[f,r("nav",{className:`${l} flex items-center gap-8`,children:a.map((e,o)=>d(e,`${e.href}-${o}`))})]}),r("nav",{className:`${l} flex items-center justify-end gap-8`,children:h})]}):r("div",{"data-header-band":"",className:`${w.flex} items-center justify-between gap-8`,children:i==="right"?s(E,{children:[s("nav",{className:`${l} flex items-center gap-8`,children:[a.map((e,o)=>d(e,`${e.href}-${o}`)),h]}),f]}):s(E,{children:[f,s("nav",{className:`${l} flex items-center gap-8`,children:[a.map((e,o)=>d(e,`${e.href}-${o}`)),h]})]})}),!F&&s("div",{"data-header-band":"",className:"hidden view-tablet:max-[1501px]:flex flex-col gap-3",children:[s("div",{className:"flex items-center justify-between",children:[O(ee,!0),s("div",{className:`${l} flex shrink-0 items-center gap-5`,children:[P,b,x,U,M(),j(!1)]})]}),r("nav",{className:`${l} flex items-center gap-6 border-t border-line/60 pt-3`,children:a.map((e,o)=>d(e,`${e.href}-${o}`))})]}),s("div",{"data-header-phone":"",className:"hidden max-view-tablet:flex items-center justify-between",children:[O(ee,!0),s("div",{className:"flex shrink-0 items-center gap-4",children:[P,U,M(l),j(!0),Xe&&s("button",{type:"button","aria-label":c?"Close menu":"Open menu","aria-expanded":c,onClick:()=>y(e=>!e),className:"flex h-11 w-11 flex-col items-center justify-center gap-2",children:[r("span",{className:`block h-px w-5 bg-current transition-transform ${c?"translate-y-[3px] rotate-45":""}`}),r("span",{className:`block h-px w-5 bg-current transition-transform ${c?"opacity-0":""}`}),r("span",{className:`block h-px w-5 bg-current transition-transform ${c?"-translate-y-[3px] -rotate-45":""}`})]})]})]})]})}),c&&s("div",{ref:D,role:"dialog","aria-modal":"true","aria-label":"Menu",tabIndex:-1,"data-header-phone-menu":"",className:"fixed inset-x-0 top-0 bottom-0 z-40 hidden flex-col gap-8 overflow-y-auto bg-bg px-6 pt-24 pb-10 max-view-tablet:flex",children:[a.map((e,o)=>r(se,{item:e,mobile:!0,onNavigate:()=>y(!1)},`${e.href}-${o}`)),s("div",{className:"mt-auto flex flex-col gap-4 border-t border-line pt-6",children:[g&&H&&s("div",{className:"flex items-center justify-between",children:[r("span",{className:"mono-eyebrow text-fg-dim",children:"Account"}),r(oe,{href:"/account",onClick:()=>y(!1),className:"mono-eyebrow underline",children:"Your account"})]}),b&&Y&&s("div",{className:"flex items-center justify-between",children:[r("span",{className:"mono-eyebrow text-fg-dim",children:"Region"}),b]}),x&&s("div",{className:"flex items-center justify-between",children:[r("span",{className:"mono-eyebrow text-fg-dim",children:"Theme"}),x]})]})]})]})}export{zt as default};
1
+ "use client";import{jsx as r,Fragment as E,jsxs as s}from"react/jsx-runtime";import re from"next/link";import{usePathname as et}from"next/navigation";import{useCallback as tt,useEffect as se,useRef as nt,useState as v}from"react";import{rootIsDark as ot,watchRootTheme as rt}from"efficient-shell/format";import{useCart as st}from"./CartContext.js";import{useSearch as at}from"./SearchContext.js";import lt,{useCountrySelectShows as it}from"./CountrySelect.js";import{resolveCountryShowAs as ct}from"../lib/content/country-show-as.js";import ae from"./HeaderNavItem.js";import dt from"efficient-web-builder/render/components/Logo";import{siteLengthCss as mt}from"efficient-web-builder/format/lib/content/css-length";import ut from"./MenuPlaceholderLabel.js";import{withRMark as le}from"efficient-web-builder/render/components/RMark";import{AccountButton as ht,CartButton as ft,SearchButton as pt}from"./HeaderTools.js";import gt from"./HeaderCallButton.js";import{useHeaderBar as bt}from"./useHeaderBar.js";import{useHeaderAtTopIsDark as xt}from"./useHeaderAtTopIsDark.js";import{usePageOwnsTop as vt}from"./usePageOwnsTop.js";import{useModalDismiss as yt}from"./useModalDismiss.js";import wt from"./ThemeToggle.js";import{products as St}from"../lib/api/index.js";import{shouldFetchPublicHeaderSettings as kt}from"../lib/header-settings-fetch.js";import{menuDropdownAside as Nt}from"../lib/menu-link.js";import{HEADER_MENU_PLACEHOLDER_COUNT as Pt}from"../lib/content/menu-placeholder.js";import{DEFAULT_SWITCH_SHOWN as Tt}from"efficient-web-builder/format/lib/theme";import{chromeWidthStyle as Et,resolveChromeWidth as It}from"efficient-web-builder/format/lib/content/page-width";import{headerThemeWrap as $t}from"../lib/content/header-theme.js";import{headerSolidBackground as Ct,isProductPage as Lt,resolveMenuRow as _t,resolveNavTextCase as Ht,resolveUtilStyle as Rt}from"../lib/content/header-bar.js";import{surfaceIsLight as At}from"../lib/logo/surface-is-light.js";import{HEADER_HEIGHT_PX as Dt,HEADER_MENU_GAP_PX as Ut,HEADER_SET_HEIGHT_CSS as Mt}from"efficient-web-builder/render/lib/document/header-clearance";import{HEADER_INK_OVERRIDE_ATTR as jt,resolveHeaderInkMode as Ot}from"efficient-web-builder/render/lib/document/header-ink";const ie={stacked:{grid:"hidden min-[1501px]:grid",flex:"hidden min-[1501px]:flex"},inline:{grid:"hidden view-tablet:grid",flex:"hidden view-tablet:flex"}},zt=Array.from({length:Pt},()=>({href:"#",label:r(ut,{})}));function Bt({previewSettings:p,initialSettings:I,editorPreview:$,showThemeToggle:ce,wordmark:de,hideLogo:me,hideMenu:ue,siteName:C,commerceEnabled:g=!0}={}){const he=et(),B=Lt(he),[c,y]=v(!1),{open:fe,totals:pe}=st(),{open:ge}=at(),[L,be]=v(!1),[xe,ve]=v(null),[ye,we]=v(null),[t,Se]=v(I??null),n=p??(t?{logoUrl:t.logoUrl,reverseLogo:t.reverseLogo,logoReversed:t.logoReversed,logoInkIsDark:t.logoInkIsDark,logoPosition:t.logoPosition,logoSize:t.logoSize,logoSizePx:t.logoSizePx,logoSizeUnit:t.logoSizeUnit??null,menuItems:(t.menuItems??[]).map(e=>({label:e.label,url:e.url,dropdown_menu:null,dropdown_items:e.dropdownItems??[],dropdown_aside:e.dropdownAside??null})),menuSplit:t.menuSplit??3,menuPosition:t.menuPosition,menuRow:t.menuRow,menuGapPx:t.menuGapPx??null,menuGapUnit:t.menuGapUnit??null,searchEnabled:t.searchEnabled,searchPosition:t.searchPosition,searchRow:t.searchRow,countrySelectorEnabled:t.countrySelectorEnabled,countrySelectorShowAs:t.countrySelectorShowAs,countryUrls:t.countryUrls,accountEnabled:t.accountEnabled,cartEnabled:t.cartEnabled,utilStyle:t.utilStyle,navTextCase:t.navTextCase,lightReverseText:t.lightReverseText,topTextColor:t.topTextColor,transparentTop:t.transparentTop,surface:t.surface,theme:t.theme,width:t.width,heightPx:t.heightPx,borderThickness:t.borderThickness??null,sticky:t.sticky,callButton:t.callButton,callPhone:t.callPhone,callHref:t.callHref}:null),ke=me?null:n?.logoUrl??null,Ne=n?.reverseLogo??!1,Pe=n?.logoReversed??null,Te=n?.logoInkIsDark??null,i=n?.logoPosition??"center",Ee=n?.logoSize??"medium",Ie=n?.logoSizePx??null,$e=n?.logoSizeUnit??null,G=Math.min(Math.max(n?.menuSplit??3,1),4),Ce=(n?.menuPosition??"left")==="center",Le=(n?.menuPosition??"left")==="beside",F=_t(n?.menuRow)==="inline",_=n?.menuGapPx??null,_e=_!=null?{gap:mt(_,n?.menuGapUnit,"gap",Ut)??`${_}px`}:void 0,w=F?ie.inline:ie.stacked,He=n?.searchEnabled??!1,W=n?.searchPosition??"right",Re=n?.countrySelectorEnabled??!0,Ae=ct(n?.countrySelectorShowAs),H=n?.accountEnabled??!0,De=n?.cartEnabled??!0,R=Rt(n?.utilStyle)==="text",V=Ht(n?.navTextCase)==="capitalised",a=`mono-eyebrow${V?" mono-eyebrow-plain":""}`,K=n?.countryUrls??{},Ue=It(n?.width),Me=Et(Ue)??void 0,je=n?.heightPx??Dt.default,X=Math.round(n?.borderThickness??1),Oe=Number.isFinite(X)?Math.min(Math.max(X,0),20):1,Y=n?.sticky??"always",A=Ot(n?.topTextColor),m=$t(n?.theme),S=Object.keys(K),J=it(S.length?S:void 0),b=Re?r(lt,{countries:S.length?S:void 0,urls:p?void 0:K,showAs:Ae}):null,{headerRef:u,scrolled:q,navHidden:ze}=bt({stickyMode:Y,heightPx:je}),Be=m?JSON.stringify(m.style):null;se(()=>{const e=u.current?.ownerDocument??document,o=e.defaultView??window,T=oe=>oe?At(o.getComputedStyle(oe).getPropertyValue("--bg")):null,z=()=>{be(!ot({doc:e,whenUnset:!0})),ve(T(e.body)),we(T(u.current))};z();const Ze=rt(z,{doc:e}),ne=new MutationObserver(z);return e.body&&ne.observe(e.body,{attributes:!0,attributeFilter:["style"]}),()=>{Ze(),ne.disconnect()}},[u,Be]);const x=ce??Tt?r(wt,{}):null;se(()=>{if(!kt({editorPreview:!!$,hasPreviewSettings:!!p,hasInitialSettings:!!I}))return;let e=!1;return St.getHeaderSettings().then(o=>!e&&Se(o)).catch(o=>{console.warn("[header] settings fetch failed; using built-in defaults",o)}),()=>{e=!0}},[$,p,I]);const Ge=vt(u),k=q||B||Ge,Q=Ct(L,B),Z=xt(u,A),Fe=k||!Z,We=k?ye??L:(xe??L)&&!Z,Ve=A==="auto"?null:{[jt]:A},Ke=tt(()=>y(!1),[]),D=nt(null);yt({active:c,onDismiss:Ke,focusRef:D,trapRef:D});const d=(e,o,T="start")=>r(ae,{item:e,dropdownAlign:T},o),Xe=!ue&&(n?.menuItems?.length??0)>0,N=!!$||!!p,l=Xe?n.menuItems.map(e=>({href:e.url||"",label:le(e.label),plainLabel:e.label,dropdownItems:(e.dropdown_items??[]).map(o=>({href:o.url||"",label:le(o.label),plainLabel:o.label,description:o.description,image:o.image,badge:o.badge})),dropdownAside:Nt(e.dropdown_aside)})):N?zt.map(e=>({...e,plainLabel:"Menu item",dropdownItems:[]})):[],Ye=l.length>0||g&&H||!!b&&J||!!x,Je=i==="center"?l.slice(0,G):i==="right"?l:[],qe=i==="center"?l.slice(G):i==="left"?l:[],P=He&&g?r(pt,{onClick:N?void 0:ge,asText:R}):null,U=g&&H?r(ht,{asText:R}):null,M=e=>g&&De?r(ft,{onClick:fe,count:pe.sets,asText:R,className:e}):null,Qe=n?.callPhone??"",ee=n?.callHref??"",j=e=>n?.callButton&&(ee||N)?r(gt,{href:N?"":ee,label:e?"Call":Qe||"Call"}):null,h=s(E,{children:[W==="left"?P:null,b,x,U,M(),W==="right"?P:null,j(!1)]}),O=(e,o=!1)=>r(re,{href:"/","aria-label":C?`${C} home`:"Home",className:e,children:r(dt,{variant:"header",scrolled:Fe,src:ke,reverse:Ne,onLightSurface:We,reversedSrc:Pe,inkIsDark:Te,size:Ee,sizePx:Ie,sizeUnit:$e,wordmark:de,siteName:C,fitToContainer:o})}),f=O("inline-flex shrink-0 items-center justify-center"),te="flex min-w-0 flex-1 items-center overflow-x-clip [container-type:inline-size]";return s(E,{children:[r("header",{ref:u,"data-scrolled":q||void 0,"data-header-nav-case":V?"capitalised":void 0,...Ve,className:["sf-site-header",...m?[m.className]:[],Y==="none"?"absolute":"fixed","inset-x-0 top-0 z-50","flex items-center","px-[var(--sf-site-gutter,40px)] max-view-tablet:px-[min(20px,var(--sf-site-gutter,40px))]",k?"border-solid border-line backdrop-blur-md":"border-solid border-transparent","transition-[background,border-color,transform] duration-300 ease-out"].join(" "),style:{...m?m.style:null,minHeight:Mt,borderBottomWidth:`${Oe}px`,...ze?{transform:"translateY(-100%)"}:null,...k?{background:Q,color:"var(--fg)","--sf-header-ground":Q}:{color:"var(--sf-header-overlay-fg)","--sf-header-ground":"var(--sf-header-overlay-ground)"}},children:s("div",{className:"w-full",style:Me,children:[Ce?s("div",{"data-header-band":"",className:`${w.grid} grid-cols-[1fr_auto_1fr] items-center gap-8`,children:[i==="right"?r("nav",{className:`${a} flex items-center gap-8`,children:h}):r("div",{className:"flex items-center",children:f}),r("nav",{className:`${a} flex items-center justify-center gap-8`,children:l.map((e,o)=>d(e,`${e.href}-${o}`,"center"))}),i==="right"?r("div",{className:"flex items-center justify-end",children:f}):r("nav",{className:`${a} flex items-center justify-end gap-8`,children:h})]}):i==="center"?s("div",{"data-header-band":"",className:`${w.grid} grid-cols-[1fr_auto_1fr] items-center gap-8`,children:[r("nav",{className:`${a} flex items-center gap-8`,children:Je.map((e,o)=>d(e,`${e.href}-${o}`))}),f,s("nav",{className:`${a} flex items-center justify-end gap-8`,children:[qe.map((e,o)=>d(e,`${e.href}-${o}`,"end")),h]})]}):Le?s("div",{"data-header-band":"",className:`${w.flex} items-center justify-between gap-8`,children:[s("div",{className:"flex items-center gap-8",style:_e,children:[f,r("nav",{className:`${a} flex items-center gap-8`,children:l.map((e,o)=>d(e,`${e.href}-${o}`))})]}),r("nav",{className:`${a} flex items-center justify-end gap-8`,children:h})]}):r("div",{"data-header-band":"",className:`${w.flex} items-center justify-between gap-8`,children:i==="right"?s(E,{children:[s("nav",{className:`${a} flex items-center gap-8`,children:[l.map((e,o)=>d(e,`${e.href}-${o}`)),h]}),f]}):s(E,{children:[f,s("nav",{className:`${a} flex items-center gap-8`,children:[l.map((e,o)=>d(e,`${e.href}-${o}`)),h]})]})}),!F&&s("div",{"data-header-band":"",className:"hidden view-tablet:max-[1501px]:flex flex-col gap-3",children:[s("div",{className:"flex items-center justify-between",children:[O(te,!0),s("div",{className:`${a} flex shrink-0 items-center gap-5`,children:[P,b,x,U,M(),j(!1)]})]}),r("nav",{className:`${a} flex items-center gap-6 border-t border-line/60 pt-3`,children:l.map((e,o)=>d(e,`${e.href}-${o}`))})]}),s("div",{"data-header-phone":"",className:"hidden max-view-tablet:flex items-center justify-between",children:[O(te,!0),s("div",{className:"flex shrink-0 items-center gap-4",children:[P,U,M(a),j(!0),Ye&&s("button",{type:"button","aria-label":c?"Close menu":"Open menu","aria-expanded":c,onClick:()=>y(e=>!e),className:"flex h-11 w-11 flex-col items-center justify-center gap-2",children:[r("span",{className:`block h-px w-5 bg-current transition-transform ${c?"translate-y-[3px] rotate-45":""}`}),r("span",{className:`block h-px w-5 bg-current transition-transform ${c?"opacity-0":""}`}),r("span",{className:`block h-px w-5 bg-current transition-transform ${c?"-translate-y-[3px] -rotate-45":""}`})]})]})]})]})}),c&&s("div",{ref:D,role:"dialog","aria-modal":"true","aria-label":"Menu",tabIndex:-1,"data-header-phone-menu":"",className:"fixed inset-x-0 top-0 bottom-0 z-40 hidden flex-col gap-8 overflow-y-auto bg-bg px-6 pt-24 pb-10 max-view-tablet:flex",children:[l.map((e,o)=>r(ae,{item:e,mobile:!0,onNavigate:()=>y(!1)},`${e.href}-${o}`)),s("div",{className:"mt-auto flex flex-col gap-4 border-t border-line pt-6",children:[g&&H&&s("div",{className:"flex items-center justify-between",children:[r("span",{className:"mono-eyebrow text-fg-dim",children:"Account"}),r(re,{href:"/account",onClick:()=>y(!1),className:"mono-eyebrow underline",children:"Your account"})]}),b&&J&&s("div",{className:"flex items-center justify-between",children:[r("span",{className:"mono-eyebrow text-fg-dim",children:"Region"}),b]}),x&&s("div",{className:"flex items-center justify-between",children:[r("span",{className:"mono-eyebrow text-fg-dim",children:"Theme"}),x]})]})]})]})}export{Bt as default};
@@ -1 +1 @@
1
- "use client";import{jsx as t,jsxs as a,Fragment as o}from"react/jsx-runtime";import u from"next/link";import{FIGURE_UPDATING as N,FREE_PRICE as b,UNPRICED_LABEL as k}from"../../lib/wheels/price-display.js";import w from"../CartLineThumbnail.js";import C from"../CouponField.js";import S from"../QuantityStepper.js";import j from"efficient-web-builder/render/components/RMark";import{lineTotal as v,useCart as d}from"../CartContext.js";import{COUPON_DEFERRED_TOTAL as T}from"../../lib/cart/coupon-preview.js";import{couponSaving as B,shippingWords as F,TAX_PENDING as $}from"../../lib/cart/shipping-status.js";import{useCurrency as g}from"../CurrencyContext.js";import{cartSubtitle as _}from"efficient-web-builder/format/lib/content/cart-drawer";function X({content:e,closeRef:r}){const{close:s,items:n}=d(),l=r;return a("header",{className:"flex flex-shrink-0 flex-col gap-4 border-b border-line px-8 pb-6 pt-8 max-[640px]:px-6 max-[640px]:pt-6 max-[640px]:pb-5",children:[a("div",{className:"flex items-center justify-between",children:[a("span",{className:"flex items-center gap-3 font-mono text-[10px] uppercase tracking-[0.3em] text-accent",children:[e.kickerBadge?t("span",{className:"border px-2 py-1 text-[10px]",style:{background:"color-mix(in oklab, var(--accent) 12%, transparent)",borderColor:"color-mix(in oklab, var(--accent) 50%, transparent)"},children:e.kickerBadge}):null,(e.kickerBadge?"· ":"")+e.kickerText]}),t("button",{ref:l,type:"button",onClick:s,"aria-label":"Close cart",className:"flex h-8 w-8 items-center justify-center border border-line text-[14px] text-fg-dim transition-colors hover:border-accent hover:text-accent",children:"✕"})]}),a("h1",{className:"font-display text-[38px] font-medium uppercase leading-[0.95] tracking-[-0.03em] max-[640px]:text-[30px]",children:[e.titleLead+" ",t("em",{className:"font-serif font-normal italic text-accent tracking-[-0.02em] normal-case",children:e.titleAccent})]}),t("p",{className:"font-serif text-[13px] italic leading-[1.5] text-fg-dim",children:_(e,n.length)})]})}function Y({content:e}){const{totals:r}=d(),{activeCountry:s}=g(),n=s?.name??e.shipsToFallback,l=1+(e.leadTimeValue?1:0)+(n?1:0);return t(o,{children:a("div",{className:`grid flex-shrink-0 ${R[l-1]} gap-px border-b border-line bg-line`,children:[t(h,{label:"Items",value:a(o,{children:[t("em",{className:"font-serif font-normal italic text-accent",children:r.sets})," set",r.sets===1?"":"s"," · ",r.units," item",r.units===1?"":"s"]})}),e.leadTimeValue?t(h,{label:"Lead time",value:e.leadTimeValue}):null,n?t(h,{label:"Ships to",value:n}):null]})})}function J({content:e,tyres:r}){const{items:s,remove:n,setQty:l}=d();return t(o,{children:s.length===0?t(A,{content:e}):s.map(c=>t(E,{line:c,tyre:r.get(c.slug),onRemove:()=>n(c.id),onQtyChange:m=>l(c.id,m)},c.id))})}function Z(){const{items:e,totals:r,bundles:s}=d(),{formatMoney:n}=g(),l=new Set(e.flatMap(i=>(i.components??[]).map(x=>x.partNumber))),c=new Set(r.appliedBundles.map(i=>i.slug)),m=s.filter(i=>!c.has(i.slug)).filter(i=>i.components.some(x=>l.has(x.partNumber))).slice(0,2);return t(o,{children:m.length>0&&a("section",{className:"border-b border-line px-8 py-6 max-[640px]:px-6",style:{background:"color-mix(in oklab, var(--site-surface) 60%, transparent)"},children:[a("div",{className:"mb-4 flex items-center justify-between font-mono text-[10px] uppercase tracking-[0.3em] text-accent",children:[t("span",{children:"You may also need"}),t("span",{className:"font-display text-[11px] normal-case tracking-[0.08em] text-fg-dim",children:"Buy together, save"})]}),t("div",{className:"grid grid-cols-2 gap-2 max-[640px]:grid-cols-1",children:m.map(i=>t(L,{href:`/bundles/${i.slug}`,title:i.name,sub:U(i,r.currency,n)},i.slug))})]})})}function ee(){return t(o,{children:t("section",{className:"border-b border-line px-8 py-6 max-[640px]:px-6",children:t(C,{})})})}function te({content:e}){return t(o,{children:e.promises.length>0&&t("div",{className:"flex flex-wrap justify-center gap-5 border-b border-line px-8 pt-6 pb-8 font-mono text-[9px] uppercase tracking-[0.24em] text-fg-dim max-[640px]:px-6",children:e.promises.map(r=>t(I,{children:r},r))})})}function re(){const{totals:e,coupon:r}=d(),{formatMoney:s}=g();return t(o,{children:a("div",{className:"flex flex-shrink-0 flex-col gap-2 border-t border-line px-8 pt-5 max-[640px]:px-6",children:[t(p,{label:`Subtotal · ${e.sets} set${e.sets===1?"":"s"}`,value:s(e.subtotal,e.currency)}),e.appliedBundles.map(n=>t(p,{label:`Bundle · ${n.name}${n.multiples>1?` ×${n.multiples}`:""}`,value:a("span",{style:{color:"var(--green)"},children:["− ",s(n.discount,e.currency)]})},n.slug)),(e.discount>0||e.deliverySaving>0)&&r?.valid&&t(p,{label:`Coupon · ${r.code}`,value:t("span",{style:{color:"var(--green)"},children:B(e,n=>s(n,e.currency))})}),r?.deferred&&t(p,{label:`Coupon · ${r.code}`,value:T}),r?.valid&&r.effects?.gift&&t(p,{label:`Free gift · ${r.effects.gift.partNumber}${r.effects.gift.quantity>1?` ×${r.effects.gift.quantity}`:""}`,value:t("span",{style:{color:"var(--green)"},children:b})}),t(p,{label:"Shipping",value:e.shippingStatus==="free"?t("span",{style:{color:"var(--green)"},children:b}):F(e.shippingStatus)??s(e.shipping,e.currency)}),e.tax&&(e.tax.charged?t(p,{label:e.tax.inclusive?`${e.tax.name} included · ${e.tax.rate}%`:e.tax.name,value:s(e.tax.amount,e.currency)}):e.tax.name?t(p,{label:e.tax.name,value:$}):null),a("div",{className:"mt-2 flex items-center justify-between border-t border-line pt-4 text-fg",children:[a("span",{className:"font-display text-[22px] font-medium tracking-[-0.02em] normal-case",children:["Total ",t("em",{className:"font-serif font-normal italic text-accent",children:"due"})]}),t("span",{className:"text-right font-display text-[30px] font-medium tracking-[-0.025em] text-fg",children:e.repricing?N:s(e.grand,e.currency)})]})]})})}function ae(){const{items:e,close:r}=d();return t(o,{children:a("div",{className:"flex flex-shrink-0 flex-col gap-3 px-8 pb-6 pt-4 max-[640px]:px-6",children:[a(u,{href:"/checkout",onClick:r,"aria-disabled":e.length===0,className:["group flex items-center justify-between border px-5 py-5 font-mono text-[12px] uppercase tracking-[0.3em] transition-colors",e.length===0?"pointer-events-none cursor-not-allowed border-line bg-surface text-fg-dim":"border-btn bg-btn text-btn-ink hover:border-fg hover:bg-fg"].join(" "),children:["Begin checkout",t("span",{className:"transition-transform group-hover:translate-x-1",children:"→"})]}),t("div",{className:"flex items-center justify-between px-1 py-2 font-mono text-[10px] uppercase tracking-[0.24em] text-fg-dim",children:t(u,{href:"/wheels",onClick:r,className:"text-fg transition-colors hover:text-accent",children:"← Keep browsing"})})]})})}const R=["grid-cols-1","grid-cols-2","grid-cols-3"];function h({label:e,value:r}){return a("div",{className:"flex flex-col gap-1 bg-bg px-4 py-4",children:[t("span",{className:"font-mono text-[9px] uppercase tracking-[0.26em] text-fg-dim",children:e}),t("span",{className:"font-display text-[14px] font-medium tracking-[-0.005em] text-fg",children:r})]})}function E({line:e,tyre:r,onRemove:s,onQtyChange:n}){const{catalog:l,totals:c}=d(),m=(e.components??[]).reduce((f,y)=>f+(c.freeUnitsByPartNumber[y.partNumber]??0),0),{currency:i,formatMoney:x}=g();return a(o,{children:[a("article",{className:"grid grid-cols-[96px_1fr] gap-5 border-b border-line px-8 py-6 transition-colors hover:bg-[color-mix(in_oklab,var(--site-surface)_60%,transparent)] max-[640px]:grid-cols-[78px_1fr] max-[640px]:px-6 max-[640px]:py-5",children:[t(w,{line:e,catalog:l,tyre:r}),a("div",{className:"flex min-w-0 flex-col gap-2",children:[a("div",{className:"flex items-start justify-between gap-3",children:[a("span",{className:"font-mono text-[9px] uppercase tracking-[0.26em] text-accent",children:["N° ",e.positionNo," · ",e.process==="FusionForge®"?a(o,{children:["FusionForge",t(j,{})]}):e.process]}),t("span",{className:"whitespace-nowrap font-display text-[16px] font-medium tracking-[-0.015em] text-fg",children:v(e,i)===null?k:x(v(e,i),i)})]}),a("h3",{className:"mt-0.5 font-display text-[22px] font-medium uppercase leading-none tracking-[-0.02em]",children:[e.name.lead,t("em",{className:"font-serif font-normal italic text-accent tracking-[-0.01em] normal-case",children:e.name.accent})]}),e.config.length>0&&a("div",{className:"mt-1 flex flex-wrap gap-2",children:[e.config.map(f=>t("span",{className:["border px-2 py-1 font-mono text-[9px] uppercase tracking-[0.18em]",f.gold?"border-[color-mix(in_oklab,var(--accent)_45%,var(--site-line))] text-accent":"border-line text-fg-dim"].join(" "),children:f.label},f.label)),m>0&&a("span",{className:"border border-accent bg-accent px-2 py-1 font-mono text-[9px] uppercase tracking-[0.18em] text-bg",children:[m,"× free"]})]}),a("div",{className:"mt-3 flex items-center justify-between gap-3",children:[t(S,{value:e.qty,onChange:n,size:"small"}),a("div",{className:"flex gap-4 font-mono text-[10px] uppercase tracking-[0.22em]",children:[t(u,{href:e.href??`/wheels/${e.slug}`,className:"text-fg-dim transition-colors hover:text-accent",children:e.href?"View product":"Edit finish"}),t("button",{type:"button",onClick:s,className:"text-fg-dim transition-colors hover:text-alert",children:"Remove"})]})]})]})]}),e.verifiedFor&&a("div",{className:"mx-8 -mt-px flex items-start gap-3 border-t-0 px-4 py-4 font-display text-[13px] leading-[1.45] text-fg max-[640px]:mx-6",style:{background:"color-mix(in oklab, var(--accent) 8%, transparent)",border:"1px solid color-mix(in oklab, var(--accent) 35%, var(--site-line))",borderTop:"0"},children:[t("span",{className:"flex-shrink-0 pt-px font-mono text-[10px] uppercase tracking-[0.24em] text-accent",children:"Fits"}),a("span",{children:["Verified for your ",t("strong",{className:"font-medium text-accent",children:e.verifiedFor}),". Final torque values shipped with the wheels."]})]})]})}function L({title:e,sub:r,href:s}){return a(u,{href:s,className:"flex items-center justify-between border border-line bg-bg px-4 py-3 text-left transition-colors hover:border-accent",children:[a("span",{className:"flex min-w-0 flex-col gap-1",children:[t("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap font-display text-[13px] font-medium tracking-[-0.005em] text-fg",children:e}),t("span",{className:"font-mono text-[9px] uppercase tracking-[0.22em] text-fg-dim",children:r})]}),t("span",{className:"ml-2 flex h-6 w-6 flex-shrink-0 items-center justify-center font-mono text-[13px] text-accent",style:{borderColor:"color-mix(in oklab, var(--accent) 45%, var(--site-line))",borderWidth:1,borderStyle:"solid"},children:"+"})]})}function U(e,r,s){const n=e.savings[r];if(n===void 0)return"Buy together";const l=s(n,r);return e.savingIsFrom?`Save from ${l}`:`Save ${l}`}function I({children:e}){return t("span",{className:"inline-flex items-center gap-2 before:text-[6px] before:text-accent before:content-['●']",children:e})}function p({label:e,value:r}){return a("div",{className:"flex items-center justify-between font-mono text-[11px] uppercase tracking-[0.18em] text-fg-dim",children:[t("span",{children:e}),t("strong",{className:"font-display text-[14px] font-normal tracking-[-0.005em] normal-case text-fg",children:r})]})}function A({content:e}){return a("div",{className:"flex flex-col items-center justify-center gap-3 px-8 py-20 text-center",children:[t("span",{className:"font-mono text-[10px] uppercase tracking-[0.3em] text-accent",children:e.emptyKicker}),t("p",{className:"font-serif text-[16px] italic leading-[1.5] text-fg-dim",children:e.emptyBody}),a(u,{href:"/wheels",className:"mt-3 inline-flex items-center gap-3 border border-line px-5 py-3 font-mono text-[11px] uppercase tracking-[0.3em] text-fg transition-colors hover:border-accent hover:text-accent",children:["Browse the catalog ",t("span",{className:"text-accent",children:"→"})]})]})}export{ae as CartActions,ee as CartCouponRow,X as CartDrawerHeader,E as CartLineRow,J as CartLines,Y as CartStatusRail,re as CartTotals,te as CartTrustMarkers,Z as CartUpsell};
1
+ "use client";import{jsx as t,jsxs as a,Fragment as c}from"react/jsx-runtime";import u from"next/link";import{FIGURE_UPDATING as N,FREE_PRICE as b,UNPRICED_LABEL as k}from"../../lib/wheels/price-display.js";import w from"../CartLineThumbnail.js";import C from"../CouponField.js";import S from"../QuantityStepper.js";import j from"efficient-web-builder/render/components/RMark";import{lineTotal as v,useCart as d}from"../CartContext.js";import{COUPON_DEFERRED_TOTAL as T}from"../../lib/cart/coupon-preview.js";import{couponSaving as B,shippingWords as F,TAX_PENDING as $}from"../../lib/cart/shipping-status.js";import{useCurrency as g}from"../CurrencyContext.js";import{cartSubtitle as _}from"efficient-web-builder/format/lib/content/cart-drawer";function X({content:e,closeRef:r}){const{close:s,items:n}=d(),l=r;return a("header",{className:"flex flex-shrink-0 flex-col gap-4 border-b border-line px-8 pb-6 pt-8 max-[640px]:px-6 max-[640px]:pt-6 max-[640px]:pb-5",children:[a("div",{className:"flex items-center justify-between",children:[a("span",{className:"flex items-center gap-3 font-mono text-[10px] uppercase tracking-[0.3em] text-accent",children:[e.kickerBadge?t("span",{className:"border px-2 py-1 text-[10px]",style:{background:"color-mix(in oklab, var(--accent) 12%, transparent)",borderColor:"color-mix(in oklab, var(--accent) 50%, transparent)"},children:e.kickerBadge}):null,(e.kickerBadge?"· ":"")+e.kickerText]}),t("button",{ref:l,type:"button",onClick:s,"aria-label":"Close cart",className:"flex h-8 w-8 items-center justify-center border border-line text-[14px] text-fg-dim transition-colors hover:border-accent hover:text-accent",children:"✕"})]}),a("h1",{className:"font-display text-[38px] font-medium uppercase leading-[0.95] tracking-[-0.03em] max-[640px]:text-[30px]",children:[e.titleLead+" ",t("em",{className:"font-serif font-normal italic text-accent tracking-[-0.02em] normal-case",children:e.titleAccent})]}),t("p",{className:"font-serif text-[13px] italic leading-[1.5] text-fg-dim",children:_(e,n.length)})]})}function Y({content:e}){const{totals:r}=d(),{activeCountry:s}=g(),n=s?.name??e.shipsToFallback,l=1+(e.leadTimeValue?1:0)+(n?1:0);return t(c,{children:a("div",{className:`grid flex-shrink-0 ${R[l-1]} gap-px border-b border-line bg-line`,children:[t(h,{label:"Items",value:a(c,{children:[t("em",{className:"font-serif font-normal italic text-accent",children:r.sets})," set",r.sets===1?"":"s"," · ",r.units," item",r.units===1?"":"s"]})}),e.leadTimeValue?t(h,{label:"Lead time",value:e.leadTimeValue}):null,n?t(h,{label:"Ships to",value:n}):null]})})}function J({content:e,tyres:r}){const{items:s,remove:n,setQty:l}=d();return t(c,{children:s.length===0?t(A,{content:e}):s.map(o=>t(E,{line:o,tyre:r.get(o.slug),onRemove:()=>n(o.id),onQtyChange:m=>l(o.id,m)},o.id))})}function Z(){const{items:e,totals:r,bundles:s}=d(),{formatMoney:n}=g(),l=new Set(e.flatMap(i=>(i.components??[]).map(x=>x.partNumber))),o=new Set(r.appliedBundles.map(i=>i.slug)),m=s.filter(i=>!o.has(i.slug)).filter(i=>i.components.some(x=>l.has(x.partNumber))).slice(0,2);return t(c,{children:m.length>0&&a("section",{className:"border-b border-line px-8 py-6 max-[640px]:px-6",style:{background:"color-mix(in oklab, var(--site-surface) 60%, transparent)"},children:[a("div",{className:"mb-4 flex items-center justify-between font-mono text-[10px] uppercase tracking-[0.3em] text-accent",children:[t("span",{children:"You may also need"}),t("span",{className:"font-display text-[11px] normal-case tracking-[0.08em] text-fg-dim",children:"Buy together, save"})]}),t("div",{className:"grid grid-cols-2 gap-2 max-[640px]:grid-cols-1",children:m.map(i=>t(L,{href:`/bundles/${i.slug}`,title:i.name,sub:U(i,r.currency,n)},i.slug))})]})})}function ee(){return t(c,{children:t("section",{className:"border-b border-line px-8 py-6 max-[640px]:px-6",children:t(C,{})})})}function te({content:e}){return t(c,{children:e.promises.length>0&&t("div",{className:"flex flex-wrap justify-center gap-5 border-b border-line px-8 pt-6 pb-8 font-mono text-[9px] uppercase tracking-[0.24em] text-fg-dim max-[640px]:px-6",children:e.promises.map(r=>t(I,{children:r},r))})})}function re(){const{totals:e,coupon:r}=d(),{formatMoney:s}=g();return t(c,{children:a("div",{className:"flex flex-shrink-0 flex-col gap-2 border-t border-line px-8 pt-5 max-[640px]:px-6",children:[t(p,{label:`Subtotal · ${e.sets} set${e.sets===1?"":"s"}`,value:s(e.subtotal,e.currency)}),e.appliedBundles.map(n=>t(p,{label:`Bundle · ${n.name}${n.multiples>1?` ×${n.multiples}`:""}`,value:a("span",{style:{color:"var(--green)"},children:["− ",s(n.discount,e.currency)]})},n.slug)),(e.discount>0||e.deliverySaving>0)&&r?.valid&&t(p,{label:`Coupon · ${r.code}`,value:t("span",{style:{color:"var(--green)"},children:B(e,n=>s(n,e.currency))})}),r?.deferred&&t(p,{label:`Coupon · ${r.code}`,value:T}),r?.valid&&r.effects?.gift&&t(p,{label:`Free gift · ${r.effects.gift.partNumber}${r.effects.gift.quantity>1?` ×${r.effects.gift.quantity}`:""}`,value:t("span",{style:{color:"var(--green)"},children:b})}),t(p,{label:"Shipping",value:e.shippingStatus==="free"?t("span",{style:{color:"var(--green)"},children:b}):F(e.shippingStatus)??s(e.shipping,e.currency)}),e.tax&&(e.tax.charged?t(p,{label:e.tax.inclusive?`${e.tax.name} included · ${e.tax.rate}%`:e.tax.name,value:s(e.tax.amount,e.currency)}):e.tax.name?t(p,{label:e.tax.name,value:$}):null),a("div",{className:"mt-2 flex items-center justify-between border-t border-line pt-4 text-fg",children:[a("span",{className:"font-display text-[22px] font-medium tracking-[-0.02em] normal-case",children:["Total ",t("em",{className:"font-serif font-normal italic text-accent",children:"due"})]}),t("span",{className:"text-right font-display text-[30px] font-medium tracking-[-0.025em] text-fg",children:e.repricing?N:s(e.grand,e.currency)})]})]})})}function ae(){const{items:e,close:r}=d();return t(c,{children:a("div",{className:"flex flex-shrink-0 flex-col gap-3 px-8 pb-6 pt-4 max-[640px]:px-6",children:[a(u,{href:"/checkout",onClick:r,"aria-disabled":e.length===0,className:["group flex items-center justify-between border px-5 py-5 font-mono text-[12px] uppercase tracking-[0.3em] transition-colors",e.length===0?"pointer-events-none cursor-not-allowed border-line bg-surface text-fg-dim":"border-btn bg-btn text-btn-ink hover:border-fg hover:bg-fg"].join(" "),children:["Begin checkout",t("span",{className:"transition-transform group-hover:translate-x-1",children:"→"})]}),t("div",{className:"flex items-center justify-between px-1 py-2 font-mono text-[10px] uppercase tracking-[0.24em] text-fg-dim",children:t(u,{href:"/wheels",onClick:r,className:"text-fg transition-colors hover:text-accent",children:"← Keep browsing"})})]})})}const R=["grid-cols-1","grid-cols-2","grid-cols-3"];function h({label:e,value:r}){return a("div",{className:"flex flex-col gap-1 bg-bg px-4 py-4",children:[t("span",{className:"font-mono text-[9px] uppercase tracking-[0.26em] text-fg-dim",children:e}),t("span",{className:"font-display text-[14px] font-medium tracking-[-0.005em] text-fg",children:r})]})}function E({line:e,tyre:r,onRemove:s,onQtyChange:n}){const{catalog:l,totals:o}=d(),m=(e.components??[]).reduce((f,y)=>f+(o.freeUnitsByPartNumber[y.partNumber]??0),0),{currency:i,formatMoney:x}=g();return a(c,{children:[a("article",{className:"grid grid-cols-[96px_1fr] gap-5 border-b border-line px-8 py-6 transition-colors hover:bg-[color-mix(in_oklab,var(--site-surface)_60%,transparent)] max-[640px]:grid-cols-[78px_1fr] max-[640px]:px-6 max-[640px]:py-5",children:[t(w,{line:e,catalog:l,tyre:r}),a("div",{className:"flex min-w-0 flex-col gap-2",children:[a("div",{className:"flex items-start justify-between gap-3",children:[a("span",{className:"font-mono text-[9px] uppercase tracking-[0.26em] text-accent",children:[a("span",{"data-cart-line-no":"",children:["N° ",e.positionNo," · "]}),e.process==="FusionForge®"?a(c,{children:["FusionForge",t(j,{})]}):e.process]}),t("span",{className:"whitespace-nowrap font-display text-[16px] font-medium tracking-[-0.015em] text-fg",children:v(e,i)===null?k:x(v(e,i),i)})]}),a("h3",{className:"mt-0.5 font-display text-[22px] font-medium uppercase leading-none tracking-[-0.02em]",children:[e.name.lead,t("em",{className:"font-serif font-normal italic text-accent tracking-[-0.01em] normal-case",children:e.name.accent})]}),e.config.length>0&&a("div",{className:"mt-1 flex flex-wrap gap-2",children:[e.config.map(f=>t("span",{className:["border px-2 py-1 font-mono text-[9px] uppercase tracking-[0.18em]",f.gold?"border-[color-mix(in_oklab,var(--accent)_45%,var(--site-line))] text-accent":"border-line text-fg-dim"].join(" "),children:f.label},f.label)),m>0&&a("span",{className:"border border-accent bg-accent px-2 py-1 font-mono text-[9px] uppercase tracking-[0.18em] text-bg",children:[m,"× free"]})]}),a("div",{className:"mt-3 flex items-center justify-between gap-3",children:[t(S,{value:e.qty,onChange:n,size:"small"}),a("div",{className:"flex gap-4 font-mono text-[10px] uppercase tracking-[0.22em]",children:[t(u,{href:e.href??`/wheels/${e.slug}`,className:"text-fg-dim transition-colors hover:text-accent",children:e.href?"View product":"Edit finish"}),t("button",{type:"button",onClick:s,className:"text-fg-dim transition-colors hover:text-alert",children:"Remove"})]})]})]})]}),e.verifiedFor&&a("div",{className:"mx-8 -mt-px flex items-start gap-3 border-t-0 px-4 py-4 font-display text-[13px] leading-[1.45] text-fg max-[640px]:mx-6",style:{background:"color-mix(in oklab, var(--accent) 8%, transparent)",border:"1px solid color-mix(in oklab, var(--accent) 35%, var(--site-line))",borderTop:"0"},children:[t("span",{className:"flex-shrink-0 pt-px font-mono text-[10px] uppercase tracking-[0.24em] text-accent",children:"Fits"}),a("span",{children:["Verified for your ",t("strong",{className:"font-medium text-accent",children:e.verifiedFor}),". Final torque values shipped with the wheels."]})]})]})}function L({title:e,sub:r,href:s}){return a(u,{href:s,className:"flex items-center justify-between border border-line bg-bg px-4 py-3 text-left transition-colors hover:border-accent",children:[a("span",{className:"flex min-w-0 flex-col gap-1",children:[t("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap font-display text-[13px] font-medium tracking-[-0.005em] text-fg",children:e}),t("span",{className:"font-mono text-[9px] uppercase tracking-[0.22em] text-fg-dim",children:r})]}),t("span",{className:"ml-2 flex h-6 w-6 flex-shrink-0 items-center justify-center font-mono text-[13px] text-accent",style:{borderColor:"color-mix(in oklab, var(--accent) 45%, var(--site-line))",borderWidth:1,borderStyle:"solid"},children:"+"})]})}function U(e,r,s){const n=e.savings[r];if(n===void 0)return"Buy together";const l=s(n,r);return e.savingIsFrom?`Save from ${l}`:`Save ${l}`}function I({children:e}){return t("span",{className:"inline-flex items-center gap-2 before:text-[6px] before:text-accent before:content-['●']",children:e})}function p({label:e,value:r}){return a("div",{className:"flex items-center justify-between font-mono text-[11px] uppercase tracking-[0.18em] text-fg-dim",children:[t("span",{children:e}),t("strong",{className:"font-display text-[14px] font-normal tracking-[-0.005em] normal-case text-fg",children:r})]})}function A({content:e}){return a("div",{className:"flex flex-col items-center justify-center gap-3 px-8 py-20 text-center",children:[t("span",{className:"font-mono text-[10px] uppercase tracking-[0.3em] text-accent",children:e.emptyKicker}),t("p",{className:"font-serif text-[16px] italic leading-[1.5] text-fg-dim",children:e.emptyBody}),a(u,{href:"/wheels",className:"mt-3 inline-flex items-center gap-3 border border-line px-5 py-3 font-mono text-[11px] uppercase tracking-[0.3em] text-fg transition-colors hover:border-accent hover:text-accent",children:["Browse the catalog ",t("span",{className:"text-accent",children:"→"})]})]})}export{ae as CartActions,ee as CartCouponRow,X as CartDrawerHeader,E as CartLineRow,J as CartLines,Y as CartStatusRail,re as CartTotals,te as CartTrustMarkers,Z as CartUpsell};
@@ -1 +1 @@
1
- import{Fragment as g,jsx as d}from"react/jsx-runtime";import{phoneKey as H}from"efficient-easel/draw";import k,{SourcedGalleryGrid as P}from"../../../../../components/pdp-dynamic/DynamicGalleryGrid.js";import{declaredBlockSource as h,sourcedRows as x}from"efficient-web-builder/format/lib/content/block-sources";import y from"../../../../../components/GalleryGrid.js";import{PRODUCT_PICTURES_SOURCE as w,productPictureTiles as T,productPicturesLayout as v}from"../../../../sections/product-pictures.js";import{hidableText as a}from"efficient-easel/screen/lib/document/hidable";import{parseSectionHeadPlacement as G}from"efficient-web-builder/format/lib/sections/section-head-placement";import{phHide as i}from"efficient-web-builder/render/lib/document/blocks/scaffold";import{bandPadProps as u}from"../../../../sections/band-padding.js";import{GalleryBMeta as B,GALLERY_B_PH as l}from"./meta.js";const U={...B,render:e=>{const m=G(e.headPlacement)==="own-box",t=n=>m?void 0:n,o={num:t(i(e.num,l.num,e.editor)),title:t(i(e.title,l.title,e.editor)),omitHead:m,linkText:t(i(e.linkText,l.link,e.editor)),linkHref:t(a(e.linkHref)||"/contact"),galleryHref:a(e.galleryHref)||"/gallery",previewHover:e.previewHover,display:e.display,displayPhone:e.displayPhone,styleOwner:e.id,layout:e.layout,layoutPhone:e.layoutPhone,columns:e.columns,columnsMobile:e.columnsMobile,gap:e.gap,gapPhone:e[H("gap")],sets:e.sets===!0,pads:u(e),editing:e.editor?.isEditing,template:e.template,nodeId:typeof e.id=="string"?e.id:void 0},c=h(e);if(c===w){const n=!!e.editor?.isEditing,r=T(e,n,e.limit);return!n&&r.length===0?d(g,{}):d(y,{...o,layout:v(e),sourced:r})}if(c!==""){const n=!!e.editor?.isEditing,{rows:r,sample:f}=x(e,n);return d(P,{num:t(i(e.num,l.num,e.editor)),title:t(i(e.title,l.title,e.editor)),linkText:t(i(e.linkText,l.link,e.editor)),linkHref:t(a(e.linkHref)||"/contact"),omitHead:m,rows:f?[]:r,limit:e.limit,layout:e.layout,editing:n,pads:u(e)})}return e.dynamic?d(k,{num:t(i(e.num,l.num,e.editor)),title:t(i(e.title,l.title,e.editor)),linkText:t(i(e.linkText,l.link,e.editor)),linkHref:t(a(e.linkHref)||"/contact"),omitHead:m,galleryHref:a(e.galleryHref)||"/gallery",zone:e.mediaZone||"all",photoDisplay:e.photoDisplay||"covers",previewHover:e.previewHover,display:e.display,displayPhone:e.displayPhone,styleOwner:e.id,editing:e.editor?.isEditing,pads:u(e),template:o.template,nodeId:o.nodeId}):d(y,{...o,items:e.items})}};export{U as GalleryBRender};
1
+ import{Fragment as f,jsx as d}from"react/jsx-runtime";import{phoneKey as H}from"efficient-easel/draw";import P,{SourcedGalleryGrid as k}from"../../../../../components/pdp-dynamic/DynamicGalleryGrid.js";import{declaredBlockSource as h,sourcedRows as x}from"efficient-web-builder/format/lib/content/block-sources";import u from"../../../../../components/GalleryGrid.js";import{PRODUCT_PICTURES_SOURCE as T,productPictureTiles as w,productPicturesLayout as v}from"../../../../sections/product-pictures.js";import{PRODUCT_SETS_PROP as E,stampedProductSets as G}from"../../../../sections/gallery-product-sets.js";import{hidableText as m}from"efficient-easel/screen/lib/document/hidable";import{parseSectionHeadPlacement as R}from"efficient-web-builder/format/lib/sections/section-head-placement";import{phHide as n}from"efficient-web-builder/render/lib/document/blocks/scaffold";import{bandPadProps as c}from"../../../../sections/band-padding.js";import{GalleryBMeta as S,GALLERY_B_PH as l}from"./meta.js";const F={...S,render:e=>{const o=R(e.headPlacement)==="own-box",t=i=>o?void 0:i,a={num:t(n(e.num,l.num,e.editor)),title:t(n(e.title,l.title,e.editor)),omitHead:o,linkText:t(n(e.linkText,l.link,e.editor)),linkHref:t(m(e.linkHref)||"/contact"),galleryHref:m(e.galleryHref)||"/gallery",previewHover:e.previewHover,display:e.display,displayPhone:e.displayPhone,styleOwner:e.id,layout:e.layout,layoutPhone:e.layoutPhone,columns:e.columns,columnsMobile:e.columnsMobile,gap:e.gap,gapPhone:e[H("gap")],sets:e.sets===!0,pads:c(e),editing:e.editor?.isEditing,template:e.template,nodeId:typeof e.id=="string"?e.id:void 0};if(e[E]===!0&&!e.editor?.isEditing){const i=G(e);return!i||i.length===0?d(f,{}):d(u,{...a,num:void 0,title:void 0,linkText:void 0,omitHead:!0,galleryLink:!1,sourced:i})}const y=h(e);if(y===T){const i=!!e.editor?.isEditing,r=w(e,i,e.limit);return!i&&r.length===0?d(f,{}):d(u,{...a,layout:v(e),sourced:r})}if(y!==""){const i=!!e.editor?.isEditing,{rows:r,sample:g}=x(e,i);return d(k,{num:t(n(e.num,l.num,e.editor)),title:t(n(e.title,l.title,e.editor)),linkText:t(n(e.linkText,l.link,e.editor)),linkHref:t(m(e.linkHref)||"/contact"),omitHead:o,rows:g?[]:r,limit:e.limit,layout:e.layout,editing:i,pads:c(e)})}return e.dynamic?d(P,{num:t(n(e.num,l.num,e.editor)),title:t(n(e.title,l.title,e.editor)),linkText:t(n(e.linkText,l.link,e.editor)),linkHref:t(m(e.linkHref)||"/contact"),omitHead:o,galleryHref:m(e.galleryHref)||"/gallery",zone:e.mediaZone||"all",photoDisplay:e.photoDisplay||"covers",previewHover:e.previewHover,display:e.display,displayPhone:e.displayPhone,styleOwner:e.id,editing:e.editor?.isEditing,pads:c(e),template:a.template,nodeId:a.nodeId}):d(u,{...a,items:e.items})}};export{F as GalleryBRender};
@@ -0,0 +1,11 @@
1
+ import type { Data } from "efficient-easel/blocks";
2
+ import type { ProductPictureTile } from "./product-pictures.js";
3
+ export declare const PRODUCT_SETS_PROP = "productSets";
4
+ export declare const PRODUCT_SETS_STAMP_PROP = "productSetTiles";
5
+ export declare const GALLERY_PAGE_SLUG = "gallery";
6
+ export declare function setTagMatches(tag: string, productName: string): boolean;
7
+ export declare function gallerySetTiles(page: Data | null | undefined): ProductPictureTile[];
8
+ export declare function pageWantsProductSets(data: Data | null | undefined): boolean;
9
+ export declare function stampProductSets(data: Data, galleryPage: Data | null | undefined, productName: string): Data;
10
+ export declare function stripProductSets(data: Data): Data;
11
+ export declare function stampedProductSets(props: Record<string, unknown>): ProductPictureTile[] | null;
@@ -0,0 +1 @@
1
+ import{documentNodes as a,mapDocumentNodes as m}from"../document/document-nodes.js";const S="productSets",p="productSetTiles",h="gallery",l="GalleryB",x="GalleryItem";function i(t){if(typeof t=="string")return t.trim();const r=t?.text;return typeof r=="string"?r.trim():""}function y(t){if(typeof t=="string")return t.trim();const r=t?.src;return typeof r=="string"?r.trim():""}function A(t,r){const e=t.trim().toLocaleLowerCase();return e!==""&&e===r.trim().toLocaleLowerCase()}function L(t){const r=a(t).filter(e=>e.type===l);return r.find(e=>e.props?.sets===!0)??r[0]}function T(t){const r=L(t)?.props?.items;if(!Array.isArray(r))return[];const e=[];return r.forEach((n,o)=>{if(n?.type!==x||!n.props)return;const s=n.props,c=y(s.image);if(!c)return;const g=Array.isArray(s.photos)?s.photos.map(y).filter(Boolean).map(P=>({src:P})):[],u=i(s.process),f=i(s.name);e.push({image:c,photos:g,href:i(s.href)||void 0,process:u||void 0,eyebrow:i(s.eyebrow)||void 0,name:f||void 0,meta:i(s.meta)||void 0,tile:{id:typeof s.id=="string"&&s.id?s.id:`set-${o+1}`,tag:u,name:f}})}),e}const d=t=>t?.type===l&&t.props?.[S]===!0;function _(t){return a(t).some(r=>d(r))}function G(t,r,e){if(!_(t))return t;const n=T(r).filter(o=>A(o.tile.tag,e));return m(t,o=>d(o)?{...o,props:{...o.props??{},[p]:n}}:o)}function R(t){return m(t,r=>{const e=r.props;if(!e||!(p in e))return r;const{[p]:n,...o}=e;return{...r,props:o}})}function w(t){const r=t[p];return Array.isArray(r)?r:null}export{h as GALLERY_PAGE_SLUG,S as PRODUCT_SETS_PROP,p as PRODUCT_SETS_STAMP_PROP,T as gallerySetTiles,_ as pageWantsProductSets,A as setTagMatches,G as stampProductSets,w as stampedProductSets,R as stripProductSets};
@@ -1 +1 @@
1
- import{cardHoverOf as G}from"efficient-web-builder/format/lib/animation/hover";import{resolvePlpKinds as I}from"../catalog/plp-item.js";import{GRID_TOP_UP_SPARE as O,gridPagingOf as W}from"../sections/product-grid-pages.js";import{gridKindsOf as R,gridRowsOf as v,isAllProductsSource as C,isLinkedSource as H}from"./grid-source.js";import{ALLOY_WHEELS_LISTING_TYPE as u,FILTER_BLOCK_TYPE as T,PRODUCT_GRID_TYPE as w,documentNodes as N,mapDocumentNodes as U}from"../document/document-nodes.js";import{stripLinkedHeroRecords as g}from"../document/linked-hero-hydrate.js";import{selectedRangesOf as D,stripSelectedRanges as h}from"./selected-ranges.js";import{withShopperFirstPaint as B,withoutShopperFirstPaint as K,withoutShopperFirstPaintNode as k}from"./shopper-first-paint.js";const m="catalog",F="catalogTotal",Y="CatalogFilterBar",f="fieldUsage";function l(e){return e.props?.source}function p(e){return e?.type===w&&H(l(e))}function a(e){return e?.type===Y||e?.type===T}function S(e,r){if(r)return;const{limit:t,cap:o}=W(e.props??{});return o?Math.ceil(t)+O:void 0}function _(e){return e?.type===u||p(e)||a(e)}const c=e=>N(e);function M(e){return e?c(e).some(r=>r?.type===u||p(r)):!1}function ne(e){return e?M(e)||c(e).some(r=>k(r)!==r)||h(e)!==e||g(e)!==e:!1}function oe(e){return e?c(e).some(_):!1}function se(e,r){return r.length===0?e:y(e,_,t=>({...t,props:{...t.props??{},[f]:r}}))}function z(e){if(!e)return[];const r=new Set;for(const t of c(e)){if(t?.type!==u&&!p(t))continue;const o=t.props?.kinds;for(const n of p(t)?R(l(t),o):I(o))r.add(n)}return[...r]}function ie(e){if(!e)return;const r=c(e);if(r.some(a))return;const t=z(e).length;let o;for(const n of r){if(n?.type===u)return;if(!p(n))continue;const s=S(n,!1),i=n.props??{},d=new Set(R(l(n),i.kinds)),E=["num","title","description","linkText"].some(L=>typeof i[L]=="string"&&i[L]!=="");if(s===void 0||!C(l(n))||d.size!==t||E)return;o=Math.max(o??0,s)}return o}function pe(e){return e.length===1&&e[0]==="alloy-wheel"}function ue(e,r,{everyHoverPhoto:t=!1}={}){const o=D(e.root?.props),n=c(e).some(a),s=t?b:V;return B(q(e,i=>p(i)?j(i,r,S(i,n),s):{...i,props:{...x(i).props,products:s(i,r)}}),o)}const b=(e,r)=>[...r];function V(e,r){const t=G(e.props??{},e.type??""),o=t.kind==="nextImage"&&t.media&&t.media.kind!=="renderings"?t.media.kind:null;return r.map(n=>{const{hoverMedia:s,...i}=n;return s===void 0?n:o&&s?.[o]?{...i,hoverMedia:{[o]:s[o]}}:i})}function j(e,r,t,o){const n=o(e,v(l(e),e.props?.kinds,r)),s={...P(e).props};return t!==void 0&&n.length>t?(s[m]=n.slice(0,t),s[F]=n.length):s[m]=n,{...e,props:s}}function ce(e){return K(y(g(h(e)),_,r=>a(r)?A(r):p(r)?P(r):x(r)))}function A(e){if(!e.props||!(f in e.props))return e;const{[f]:r,...t}=e.props;return{...e,props:t}}function P(e){const{[m]:r,[F]:t,[f]:o,...n}=e.props??{},s=n.source;if(s&&"wheels"in s){const{wheels:i,...d}=s;n.source=d}return{...e,props:n}}function fe(e){const r=g(h({content:[e]})).content[0],t=k(r);return p(t)?P(t):a(t)?A(t):t?.type===u?x(t):t}function x(e){const{wheels:r,products:t,[f]:o,...n}=e.props??{};return{...e,props:n}}function q(e,r){return y(e,t=>t?.type===u||p(t),r)}function y(e,r,t){return U(e,o=>r(o)?t(o):o)}export{Y as CATALOG_FILTER_BAR_TYPE,f as FIELD_USAGE_PROP,T as FILTER_BLOCK_TYPE,m as GRID_CATALOG_PROP,F as GRID_CATALOG_TOTAL_PROP,O as GRID_TOP_UP_SPARE,w as PRODUCT_GRID_TYPE,ce as dehydrateWheelsListing,fe as dehydrateWheelsListingNode,se as hydrateFieldUsage,ue as hydrateWheelsListing,ie as listingCatalogBound,z as listingCatalogKinds,pe as listingWantsWheelsOnly,ne as pageHasHydratedValues,M as pageHasWheelsListing,oe as pageReadsFieldUsage};
1
+ import{cardHoverOf as I}from"efficient-web-builder/format/lib/animation/hover";import{resolvePlpKinds as W}from"../catalog/plp-item.js";import{GRID_TOP_UP_SPARE as R,gridPagingOf as v}from"../sections/product-grid-pages.js";import{gridKindsOf as T,gridRowsOf as C,isAllProductsSource as H,isLinkedSource as N}from"./grid-source.js";import{ALLOY_WHEELS_LISTING_TYPE as u,FILTER_BLOCK_TYPE as w,PRODUCT_GRID_TYPE as S,documentNodes as U,mapDocumentNodes as D}from"../document/document-nodes.js";import{stripLinkedHeroRecords as g}from"../document/linked-hero-hydrate.js";import{stripProductSets as m}from"../sections/gallery-product-sets.js";import{selectedRangesOf as B,stripSelectedRanges as h}from"./selected-ranges.js";import{withShopperFirstPaint as K,withoutShopperFirstPaint as Y,withoutShopperFirstPaintNode as k}from"./shopper-first-paint.js";const _="catalog",F="catalogTotal",M="CatalogFilterBar",f="fieldUsage";function l(e){return e.props?.source}function p(e){return e?.type===S&&N(l(e))}function d(e){return e?.type===M||e?.type===w}function A(e,r){if(r)return;const{limit:t,cap:o}=v(e.props??{});return o?Math.ceil(t)+R:void 0}function P(e){return e?.type===u||p(e)||d(e)}const c=e=>U(e);function z(e){return e?c(e).some(r=>r?.type===u||p(r)):!1}function se(e){return e?z(e)||c(e).some(r=>k(r)!==r)||h(e)!==e||g(e)!==e||m(e)!==e:!1}function ie(e){return e?c(e).some(P):!1}function pe(e,r){return r.length===0?e:L(e,P,t=>({...t,props:{...t.props??{},[f]:r}}))}function b(e){if(!e)return[];const r=new Set;for(const t of c(e)){if(t?.type!==u&&!p(t))continue;const o=t.props?.kinds;for(const n of p(t)?T(l(t),o):W(o))r.add(n)}return[...r]}function ue(e){if(!e)return;const r=c(e);if(r.some(d))return;const t=b(e).length;let o;for(const n of r){if(n?.type===u)return;if(!p(n))continue;const s=A(n,!1),i=n.props??{},a=new Set(T(l(n),i.kinds)),G=["num","title","description","linkText"].some(O=>typeof i[O]=="string"&&i[O]!=="");if(s===void 0||!H(l(n))||a.size!==t||G)return;o=Math.max(o??0,s)}return o}function ce(e){return e.length===1&&e[0]==="alloy-wheel"}function fe(e,r,{everyHoverPhoto:t=!1}={}){const o=B(e.root?.props),n=c(e).some(d),s=t?V:j;return K(J(e,i=>p(i)?q(i,r,A(i,n),s):{...i,props:{...y(i).props,products:s(i,r)}}),o)}const V=(e,r)=>[...r];function j(e,r){const t=I(e.props??{},e.type??""),o=t.kind==="nextImage"&&t.media&&t.media.kind!=="renderings"?t.media.kind:null;return r.map(n=>{const{hoverMedia:s,...i}=n;return s===void 0?n:o&&s?.[o]?{...i,hoverMedia:{[o]:s[o]}}:i})}function q(e,r,t,o){const n=o(e,C(l(e),e.props?.kinds,r)),s={...x(e).props};return t!==void 0&&n.length>t?(s[_]=n.slice(0,t),s[F]=n.length):s[_]=n,{...e,props:s}}function le(e){return Y(L(m(g(h(e))),P,r=>d(r)?E(r):p(r)?x(r):y(r)))}function E(e){if(!e.props||!(f in e.props))return e;const{[f]:r,...t}=e.props;return{...e,props:t}}function x(e){const{[_]:r,[F]:t,[f]:o,...n}=e.props??{},s=n.source;if(s&&"wheels"in s){const{wheels:i,...a}=s;n.source=a}return{...e,props:n}}function de(e){const r=m(g(h({content:[e]}))).content[0],t=k(r);return p(t)?x(t):d(t)?E(t):t?.type===u?y(t):t}function y(e){const{wheels:r,products:t,[f]:o,...n}=e.props??{};return{...e,props:n}}function J(e,r){return L(e,t=>t?.type===u||p(t),r)}function L(e,r,t){return D(e,o=>r(o)?t(o):o)}export{M as CATALOG_FILTER_BAR_TYPE,f as FIELD_USAGE_PROP,w as FILTER_BLOCK_TYPE,_ as GRID_CATALOG_PROP,F as GRID_CATALOG_TOTAL_PROP,R as GRID_TOP_UP_SPARE,S as PRODUCT_GRID_TYPE,le as dehydrateWheelsListing,de as dehydrateWheelsListingNode,pe as hydrateFieldUsage,fe as hydrateWheelsListing,ue as listingCatalogBound,b as listingCatalogKinds,ce as listingWantsWheelsOnly,se as pageHasHydratedValues,z as pageHasWheelsListing,ie as pageReadsFieldUsage};