efficient-storefront-blocks 0.123.3 → 0.124.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/dist/chunks/CustomHtmlCodeWindow-6QU56I6L.js +26 -0
- package/dist/chunks/{EditorPreviewCheckout-NQFCOASP.js → EditorPreviewCheckout-TRX42H6I.js} +4 -4
- package/dist/chunks/SiteEditorProvider-IBJ5A5V3.js +1 -0
- package/dist/chunks/chunk-27GSFHNV.js +1 -0
- package/dist/chunks/chunk-CDKQFBBA.js +1 -0
- package/dist/chunks/chunk-EKCLPISP.js +96 -0
- package/dist/chunks/{chunk-K5OPN6GZ.js → chunk-ESQTNC7T.js} +19 -18
- package/dist/chunks/chunk-JJ5MCDPE.js +1 -0
- package/dist/chunks/chunk-MC6E4ZLD.js +339 -0
- package/dist/chunks/chunk-O5WPKRAC.js +2 -0
- package/dist/chunks/chunk-S5N6H2MP.js +1 -0
- package/dist/chunks/chunk-T7CS442T.js +4 -0
- package/dist/chunks/chunk-YCL4MPLF.js +1 -0
- package/dist/chunks/fitment-data-MXT6XIW5.js +1 -0
- package/dist/chunks/{section-css-style-J4DULHLY.js → section-css-style-ZZ3ZOGPR.js} +1 -1
- package/dist/editor/components/HeaderSettingsPanel.js +1 -1
- package/dist/editor/lib/document/blocks/service/Events/fields.js +1 -1
- package/dist/editor/lib/storefront-editor-words.d.ts +2 -0
- package/dist/editor/lib/storefront-editor-words.js +1 -1
- package/dist/editor.css +1 -1
- package/dist/index.js +137 -26
- package/dist/render/built-with.json +1 -1
- package/dist/render/components/BoxHeaderBar.js +1 -1
- package/dist/render/components/Events.d.ts +1 -0
- package/dist/render/components/Events.js +1 -1
- package/dist/render/components/GalleryShowcase.js +1 -1
- package/dist/render/components/card-pieces/CardProductPicture.js +1 -1
- package/dist/render/components/card-pieces/HeadlineName.js +1 -1
- package/dist/render/components/checkout/CheckoutPageClient.js +1 -1
- package/dist/render/lib/api/index.js +1 -1
- package/dist/render/lib/content/english-variant.js +1 -1
- package/dist/render/lib/content/header-bar.js +1 -1
- package/dist/render/lib/content/post-list-continue.d.ts +1 -0
- package/dist/render/lib/content/post-list-continue.js +1 -1
- package/dist/render/lib/content/tab-strip.js +1 -1
- package/dist/render/lib/content/title-look.js +1 -1
- package/dist/render/lib/document/blocks/commerce/DetailRows/render.js +1 -1
- package/dist/render/lib/document/blocks/commerce/FitmentPicker/render.js +1 -1
- package/dist/render/lib/document/blocks/service/Events/render.js +1 -1
- package/dist/render/lib/document/blocks/service/OpeningHours/render.js +1 -1
- package/dist/render/lib/document/blocks/service/SignUp/render.js +1 -1
- package/dist/render/lib/document/subscribe-content-type.js +1 -1
- package/dist/render/lib/sections/catalog-filter-layout.js +1 -1
- package/dist/render/lib/sections/fitment-cell-look.js +1 -1
- package/dist/render/lib/sections/hero-arrangement.js +1 -1
- package/dist/render/lib/sections/hero-gallery.js +1 -1
- package/dist/render/lib/sections/hero-price-placement.js +1 -1
- package/dist/render/lib/sections/product-grid-pages.js +1 -1
- package/dist/render/lib/sections/shopper-filters.js +1 -1
- package/dist/render/lib/wheels/plp-filters.js +1 -1
- package/dist/render/lib/wheels/set-mode.js +1 -1
- package/dist/routine-index.json +1 -1
- package/dist/value-index.json +1 -1
- package/dist/words.d.ts +19 -0
- package/dist/words.js +4 -4
- package/package.json +4 -4
- package/dist/chunks/SiteEditorProvider-D2OPKHNG.js +0 -1
- package/dist/chunks/chunk-2CQGGANM.js +0 -342
- package/dist/chunks/chunk-BVHE65VQ.js +0 -96
- package/dist/chunks/chunk-EMEK5XSJ.js +0 -1
- package/dist/chunks/chunk-GUMG6SIC.js +0 -1
- package/dist/chunks/chunk-QL4PL74K.js +0 -1
- package/dist/chunks/chunk-ZROLUHOX.js +0 -1
- package/dist/chunks/fitment-data-32VKLJVO.js +0 -1
- /package/dist/chunks/{chunk-K5OPN6GZ.js.LEGAL.txt → chunk-ESQTNC7T.js.LEGAL.txt} +0 -0
- /package/dist/chunks/{chunk-2CQGGANM.js.LEGAL.txt → chunk-MC6E4ZLD.js.LEGAL.txt} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{normalizePath as s}from"efficient-web-builder/format/lib/popup/rules";import{menuLinkKind as u}from"../menu-link.js";import{linkParts as m}from"../links/link-rules.js";import{plpFilterQuery as b}from"../wheels/plp-filters.js";import{parseOption as d}from"efficient-
|
|
1
|
+
import{normalizePath as s}from"efficient-web-builder/format/lib/popup/rules";import{menuLinkKind as u}from"../menu-link.js";import{linkParts as m}from"../links/link-rules.js";import{plpFilterQuery as b}from"../wheels/plp-filters.js";import{parseOption as d}from"efficient-shell/format";const w="[scrollbar-width:none] [&::-webkit-scrollbar]:hidden",g="text-[length:var(--size-label,13px)]",h={rowLink:"relative opacity-100",row:"pointer-events-none absolute inset-x-0 -bottom-2 h-[2px] bg-accent",tab:"absolute inset-x-0 -bottom-px h-[2px] bg-accent"},S={list:`m-0 flex list-none items-stretch gap-0 overflow-auto p-0 ${w}`,item:(e,t)=>[`relative isolate flex whitespace-nowrap border-r border-line px-[26px] py-[18px] font-mono ${g} uppercase tracking-[0.22em]`,e?"border-l border-line":"",t?"":"[&_*]:pointer-events-none [&_a]:pointer-events-auto"].join(" "),tab:e=>["block transition-colors after:absolute after:inset-0 after:-z-1",e?"text-fg":"text-fg-dim hover:text-fg"].join(" "),underline:h.tab},_={nav:"-mx-1 [scrollbar-width:none] max-view-wide:overflow-x-auto [&::-webkit-scrollbar]:hidden",list:"flex flex-wrap gap-2 px-1 pb-1 max-view-wide:min-w-max max-view-wide:flex-nowrap",tab:e=>`flex flex-col gap-0.5 rounded-[var(--sf-button-radius,999px)] border px-5 py-2.5 transition-colors ${e?"border-accent bg-accent text-accent-ink":"border-line text-fg hover:border-accent hover:text-accent"}`},v=["row","column"];function R(e){return d(v,"column",e)}function T(e,t){return e==="row"&&t===!0}function p(e){return[...new URLSearchParams(b(e))].map(([t,r])=>`${t}=${r}`)}function B(e,t,r){if(!t)return-1;const n=s(t),o=new Set(p(r));let i=-1,c=-1;return e.forEach((l,f)=>{if(u(l)!=="page"||s(l)!==n)return;const a=p(m(l).query);a.every(x=>o.has(x))&&a.length>c&&(i=f,c=a.length)}),i}function O(e,t){let r=e?.querySelector('[aria-current="page"]')??null;if(!e||!r)return;for(;r.parentElement&&r.parentElement!==e;)r=r.parentElement;const n=e.getBoundingClientRect(),o=r.getBoundingClientRect(),i=o.left<n.left?o.left-n.left:o.right>n.right?Math.min(o.right-n.right,o.left-n.left):0;i!==0&&e.scrollBy({left:i,behavior:t})}export{h as CURRENT_LINE,S as TAB_CELLS,_ as TAB_PILLS,B as currentLinkIndex,T as marksCurrentLink,R as menuLayoutOf,O as showCurrentTab};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{parseOption as t}from"efficient-
|
|
1
|
+
import{parseOption as t}from"efficient-shell/format";const c="titleLook",e=["card","headline"],r="card",p=o=>t(e,r,o),s="accentLastWord",L="showBadge";export{r as DEFAULT_TITLE_LOOK,L as EYEBROW_BADGE_PROP,s as NAME_ACCENT_PROP,e as TITLE_LOOKS,c as TITLE_LOOK_PROP,p as parseTitleLook};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import d from"../../../../../components/pdp-dynamic/DynamicDetailRows.js";import a from"../../../../../components/DetailRows.js";import{phRows as r}from"efficient-web-builder/render/lib/document/blocks/scaffold";import{bandPadProps as i}from"../../../../sections/band-padding.js";import{parseOption as m}from"efficient-
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import d from"../../../../../components/pdp-dynamic/DynamicDetailRows.js";import a from"../../../../../components/DetailRows.js";import{phRows as r}from"efficient-web-builder/render/lib/document/blocks/scaffold";import{bandPadProps as i}from"../../../../sections/band-padding.js";import{parseOption as m}from"efficient-shell/format";import{DETAIL_ROWS_FROM as o,DETAIL_ROWS_FROM_FALLBACK as n,DetailRowsMeta as f,DETAILROWS_SCAFFOLD_ROWS as R}from"./meta.js";const F={...f,render:t=>t.dynamic?e(d,{rowsFrom:m(o,n,t.rowsFrom),startLeft:t.startLeft,pads:i(t),editing:t.editor?.isEditing,template:t.template,nodeId:typeof t.id=="string"?t.id:void 0}):e(a,{rows:r(t.rows,R,t.editor),startLeft:t.startLeft,layout:t.layout,pads:i(t),editing:t.editor?.isEditing,template:t.template,nodeId:typeof t.id=="string"?t.id:void 0})};export{F as DetailRowsRender};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as o}from"react/jsx-runtime";import i from"../../../../../components/fitment/FitmentPickerPart.js";import{phoneKey as r}from"efficient-easel/draw";import{parseOption as t}from"efficient-
|
|
1
|
+
import{jsx as o}from"react/jsx-runtime";import i from"../../../../../components/fitment/FitmentPickerPart.js";import{phoneKey as r}from"efficient-easel/draw";import{parseOption as t}from"efficient-shell/format";import{FITMENT_CELL_LOOK_PROP as m}from"../../../../sections/fitment-cell-look.js";import{FITMENT_PICKER_LAYOUT_FALLBACK as n,FITMENT_PICKER_LAYOUTS as c,FitmentPickerMeta as l}from"./meta.js";const a={...l,render:e=>o(i,{layout:t(c,n,e.layout),pickerColumns:e.pickerColumns,pickerColumnsPhone:e[r("pickerColumns")],cellLook:e[m],editing:!!e.editor?.isEditing})};export{a as FitmentPickerRender};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as f}from"react/jsx-runtime";import{phoneKey as g}from"efficient-easel/draw";import h,{readFacets as
|
|
1
|
+
import{jsx as f}from"react/jsx-runtime";import{phoneKey as g}from"efficient-easel/draw";import h,{readFacets as k,readTags as x}from"../../../../../components/Events.js";import{declaredBlockSource as v,sourcedRows as y}from"efficient-web-builder/format/lib/content/block-sources";import{servedListOf as b,servedRowLists as P}from"../../../../content/served-lists.js";import{hidableText as C}from"efficient-easel/screen/lib/document/hidable";import{parseSectionHeadPlacement as E}from"efficient-web-builder/format/lib/sections/section-head-placement";import{phHide as l}from"efficient-web-builder/render/lib/document/blocks/scaffold";import{say as a}from"efficient-web-builder/format/lib/editor-words";import{bandPadProps as H}from"../../../../sections/band-padding.js";import{EventsMeta as S,EVENTS_PH as m}from"./meta.js";import{nodeViewHidden as A}from"efficient-web-builder/format/lib/content/view-hide-class";const F=()=>[{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.")}],o=(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}:{}}),L=e=>P(e,i=>({facets:k(i.facets),tags:x(i.tags)})),O={...S,render:e=>{const i=E(e.headPlacement)==="own-box",t=r=>i?void 0:r,s=l(e.linkText,m.link,e.editor),n=v(e)!==""?y(e,!!e.editor?.isEditing,F()):null,c=n&&!n.sample?L(e):null,u=n?n.sample?[]:n.rows.map((r,d)=>o(r,d,b(c,r,d))):e.posts;return f(h,{num:t(l(e.num,m.num,e.editor)),title:t(l(e.title,m.title,e.editor)),link:t(s?{text:s,href:C(e.linkHref)||"/journal"}:void 0),omitHead:i,posts:u,servedCategory:e.servedCategory,sample:n?.sample?n.rows.map((r,d)=>o(r,d)):void 0,columns:e.columns,limit:e.limit,showAll:e.showAll,skipCurrentPost:e.skipCurrentPost===!0,layout:e.layout,featuredWidth:e.featuredWidth,listCover:e.listCover,featuredDarken:e.featuredDarken,cardImage:e.cardImage,gap:e.gap,gapPhone:e[g("gap")],nameFilter:e.nameFilter===!0,pads:H(e),editing:e.editor?.isEditing,template:e.template,ownerId:String(e.id??""),viewHidden:A(e)})}};export{O as EventsRender};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as r}from"react/jsx-runtime";import t from"../../../../../components/OpeningHours.js";import{OPENING_SAMPLE_MOMENT as i,OPENING_SAMPLE_WEEK as s,readOpeningRow as d}from"../../../../sections/opening-hours.js";import{sourcedRows as m}from"efficient-web-builder/format/lib/content/block-sources";import{readHidable as a}from"efficient-easel/screen/lib/document/hidable";import{parseOption as O}from"efficient-
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import t from"../../../../../components/OpeningHours.js";import{OPENING_SAMPLE_MOMENT as i,OPENING_SAMPLE_WEEK as s,readOpeningRow as d}from"../../../../sections/opening-hours.js";import{sourcedRows as m}from"efficient-web-builder/format/lib/content/block-sources";import{readHidable as a}from"efficient-easel/screen/lib/document/hidable";import{parseOption as O}from"efficient-shell/format";import{OPENING_HOURS_SHOW_FALLBACK as u,OPENING_HOURS_SHOWS as f,OpeningHoursMeta as p}from"./meta.js";const E=()=>[{week:s,zone:"Australia/Sydney",hours:""}],_=o=>{const{text:e,hidden:n}=a(o);return n||!e?void 0:e},P={...p,render:o=>{const{rows:e,sample:n}=m(o,!!o.editor?.isEditing,E());return r(t,{show:O(f,u,o.show),title:_(o.title),row:d(e),contained:o.contained!==!1,now:n?i:void 0})}};export{P as OpeningHoursRender,E as openingHoursSample};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as t}from"react/jsx-runtime";import i from"../../../../../components/SignUpSection.js";import{parseOption as a}from"efficient-
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import i from"../../../../../components/SignUpSection.js";import{parseOption as a}from"efficient-shell/format";import{SIGN_UP_MODE_FALLBACK as o,SIGN_UP_MODES as m,SignUpMeta as d}from"./meta.js";const f=()=>({firstName:"Amelia",lastName:"Chen",email:"amelia@harbourlane.co",company:"Harbour Lane Studio",slug:"harbourlane",country:"AU",currency:"AUD"}),r=(e,n="")=>typeof e=="string"?e.trim():n,y={...d,render:e=>t(i,{mode:a(m,o,e.mode),product:r(e.product),productName:r(e.productName),freeLine:r(e.freeLine),zone:r(e.zone),askCountry:e.askCountry===!0,termsHref:r(e.termsHref),privacyHref:r(e.privacyHref),findHref:r(e.findHref),contained:e.contained!==!1,sample:e.editor?.isEditing?f():void 0})};export{y as SignUpRender,f as signUpSample};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{parseOption as n}from"efficient-
|
|
1
|
+
import{parseOption as n}from"efficient-shell/format";import{shownForOption as r,withRowRules as i}from"efficient-web-builder/format/lib/document/show-when-attach";const t=["issues","posts"],S=[{label:"Issues",value:"issues"},{label:"Blog posts",value:"posts"}],o="issues";function _(s){return n(t,o,s)}const u={issues:["issues"],_gPosts:["posts"],posts:["posts"],limit:["posts"]};function c(s){return i(s,Object.entries(u).map(([e,p])=>[[e],r("contentType",t,o,p)]))}export{t as SUBSCRIBE_CONTENT_TYPES,o as SUBSCRIBE_CONTENT_TYPE_DEFAULT,u as SUBSCRIBE_CONTENT_TYPE_FIELDS,S as SUBSCRIBE_CONTENT_TYPE_OPTIONS,_ as subscribeContentTypeOf,c as withSubscribeContentRules};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{parseOption as o}from"efficient-
|
|
1
|
+
import{parseOption as o}from"efficient-shell/format";const e="pills",r=[{label:"Pills",value:"pills"},{label:"Columns",value:"columns"}];function p(l){return o(r,e,l)}export{e as DEFAULT_FILTER_BAR_LAYOUT,r as FILTER_BAR_LAYOUT_OPTIONS,p as parseFilterBarLayout};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{parseOption as o}from"efficient-
|
|
1
|
+
import{parseOption as o}from"efficient-shell/format";const l="cellLook",t=[{value:"joined",label:"Joined"},{value:"separate",label:"Separate"}],L="joined",p=e=>o(t,L,e);export{L as DEFAULT_FITMENT_CELL_LOOK,t as FITMENT_CELL_LOOK_OPTIONS,l as FITMENT_CELL_LOOK_PROP,p as parseFitmentCellLook};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{parseOption as r}from"efficient-
|
|
1
|
+
import{parseOption as r}from"efficient-shell/format";const o=["split","imageRight","stacked"],n="split";function T(t){return r(o,n,t)}const p=["left","center"],i="left";function a(t){return r(p,i,t)}const s=35,_=70,c=50;function u(t){const e=typeof t=="number"?t:Number(t);return Number.isFinite(e)?Math.min(_,Math.max(s,Math.round(e))):c}export{n as DEFAULT_HERO_LAYOUT,c as DEFAULT_HERO_RATIO,i as DEFAULT_HERO_TEXT_ALIGN,o as HERO_LAYOUTS,_ as HERO_RATIO_MAX,s as HERO_RATIO_MIN,T as parseHeroLayout,u as parseHeroRatio,a as parseHeroTextAlign};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{parseOption as r}from"efficient-
|
|
1
|
+
import{parseOption as r}from"efficient-shell/format";import{IMAGE_FIT_LABEL as e,parseImageFit as n}from"efficient-web-builder/format/lib/content/image-fit";const i=["main","thumbs","tiled"],p="thumbs";function s(t){return r(i,p,t)}const a=["contain","cover"],E="contain";function _(t){return n(t,E)}function I(){return a.map(t=>({label:e[t],value:t}))}function u(t,o){return o?"contain":t}export{p as DEFAULT_HERO_GALLERY_MODE,E as DEFAULT_HERO_IMAGE_FIT,i as HERO_GALLERY_MODES,a as HERO_IMAGE_FITS,I as heroImageFitOptions,s as parseHeroGalleryMode,_ as parseHeroImageFit,u as resolveHeroImageFit};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{parseOption as e}from"efficient-
|
|
1
|
+
import{parseOption as e}from"efficient-shell/format";const t=["top","belowSpecs"],r="top";function E(o){return e(t,r,o)}export{r as DEFAULT_HERO_PRICE_PLACEMENT,E as parseHeroPricePlacement};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{parseOption as o}from"efficient-
|
|
1
|
+
import{parseOption as o}from"efficient-shell/format";const i=[{value:"hide",label:"Hide the rest"},{value:"pages",label:"Pages"}],u="hide",f=12,m={min:4,max:48,step:4};function c(e){return o(i.map(t=>t.value),u,typeof e=="string"?e:void 0)}function a(e,t,r=1){const n=e===0?null:t.paged?{from:(r-1)*t.per+1,to:Math.min(e,r*t.per)}:t.cap?null:{from:1,to:e};return{total:e,range:n}}function P(e){return e.showAll||typeof e.limit!="number"?void 0:e.limit}const p=12;function s(e){const t=c(e.moreProducts)==="pages",r=t?void 0:P(e),n=typeof e.perPage=="number"&&e.perPage>0?Math.floor(e.perPage):f;return{paged:t,per:n,limit:r,cap:typeof r=="number"&&r>0}}export{u as DEFAULT_MORE_PRODUCTS,f as DEFAULT_PER_PAGE,p as GRID_TOP_UP_SPARE,i as MORE_PRODUCTS_OPTIONS,m as PER_PAGE_RANGE,P as gridLimitOf,s as gridPagingOf,a as gridShownOf,c as parseMoreProducts};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{DEFAULT_CATALOG_FILTER_LABELS as a}from"../content/catalog-filter-labels.js";import{STOCK_WORDS as I}from"../content/stock-words.js";import{parseOption as l}from"efficient-
|
|
1
|
+
import{DEFAULT_CATALOG_FILTER_LABELS as a}from"../content/catalog-filter-labels.js";import{STOCK_WORDS as I}from"../content/stock-words.js";import{parseOption as l}from"efficient-shell/format";import{viewHideClass as b}from"efficient-web-builder/format/lib/content/view-hide-class";import{asPlpSortKey as S}from"../wheels/plp-filters.js";const p=[{value:"bar-pills",label:"Bar · pills"},{value:"bar-columns",label:"Bar · columns"},{value:"rail",label:"Side rail"},{value:"button",label:"Filters button"}],E="bar-pills",u=[{value:"bar",label:"Bar"},{value:"button",label:"Filters button"},{value:"rail",label:"Side rail"}],F="bar",d=[{value:"inStock",label:I.inStock},{value:"category",label:"Category"},{value:"lugs",label:a.lugs},{value:"price",label:a.price}],x=["inStock","category","lugs","price"],v="recommended";function y(t){return l(p.map(o=>o.value),E,typeof t=="string"?t:void 0)}function K(t){return l(u.map(o=>o.value),F,typeof t=="string"?t:void 0)}const i=["rail","button"],w="filterLook",g="rail",L=t=>i.includes(t.value),D=p.filter(L),G=u.filter(L);function c(t){return l(i,g,typeof t=="string"?t:void 0)}const k=c,m="lg:flex-none lg:self-stretch";function H(t,o){const r=c(t),O=k(o),_=e=>e.desk&&e.phone?"":e.desk||e.phone?b({desktop:!e.desk,tablet:!e.desk,mobile:!e.phone}):null,s=e=>_({desk:r===e,phone:O===e}),f=e=>e&&`${e} ${m}`,n={rail:null,button:null};for(const e of i)switch(e){case"rail":n.rail=f(s(e));break;case"button":n.button=s(e);break;default:{const T=e;throw new Error(`no drawing for listing look ${String(T)}`)}}return n}function U(t){if(!Array.isArray(t))return[...x];const o=new Set(d.map(r=>r.value));return t.filter(r=>typeof r=="string"&&o.has(r))}function C(t){return S(typeof t=="string"?t:void 0)}export{E as DEFAULT_FILTER_LOOK,F as DEFAULT_FILTER_LOOK_PHONE,g as DEFAULT_LISTING_FILTER_LOOK,v as DEFAULT_OPENING_SORT,x as DEFAULT_SHOWN_FILTERS,p as FILTER_LOOK_OPTIONS,u as FILTER_LOOK_PHONE_OPTIONS,i as LISTING_FILTER_LOOKS,D as LISTING_FILTER_LOOK_OPTIONS,G as LISTING_FILTER_LOOK_PHONE_OPTIONS,w as LISTING_FILTER_LOOK_PROP,d as SHOWN_FILTER_OPTIONS,L as isListingFilterLook,y as parseFilterLook,K as parseFilterLookPhone,c as parseListingFilterLook,k as parseListingFilterLookPhone,C as parseOpeningSort,U as parseShownFilters,H as plpFilterViews};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{answerOrder as q,answersForKind as R,facetFieldKey as k,keepForFilter as J,NO_FIELD_ANSWERS as ee,orderByAnswers as te}from"../content/field-usage.js";import{STOCK_WORDS as ne}from"../content/stock-words.js";import{parseOption as L}from"efficient-
|
|
1
|
+
import{answerOrder as q,answersForKind as R,facetFieldKey as k,keepForFilter as J,NO_FIELD_ANSWERS as ee,orderByAnswers as te}from"../content/field-usage.js";import{STOCK_WORDS as ne}from"../content/stock-words.js";import{parseOption as L}from"efficient-shell/format";import{comparePrice as z,FROM_PREFIX_START as re,priceIn as ie,withinPriceRange as se}from"./price-display.js";import{trimDecimal as oe,wheelSizeLabel as le}from"./spec-format.js";import{itemLugs as ce,lugFilterLabel as ae}from"./lug-count.js";import{itemBrand as F,itemCollections as ue,itemDiameters as pe,itemFinishFamilies as fe,itemFinishes as de,itemInStock as E,itemIsNew as O,itemKind as b,itemName as N,itemPcds as me,itemPrices as y,itemSpeedRatings as he,itemTyreSizes as _,itemTyreTypes as Se,PLP_ANY_TYPE_LABEL as ge,PLP_KIND_LABELS as I,PLP_KINDS as ye}from"../catalog/plp-item.js";import{parseTyreSize as Pe,tyreSizeLabel as v,tyreSizeLabels as xe,TYRE_SIZE_PARTS as S,TYRE_SIZE_PART_LABELS as we}from"../tyres/tyre-size.js";const Me={recommended:"Recommended","price-asc":"Price · low to high","price-desc":"Price · high to low",new:"Newest",name:"Name A–Z"},B=Object.keys(Me);function C(e){return L(B,"recommended",e)}function be(e){return B.filter(t=>t!=="recommended"||e.length<=1)}function Ue(e,t){const r=C(e);return L(be(t),"name",r)}const P=["tyreSizes","brands","finishes","diameters","collections","pcds","tyreTypes","speedRatings"],A={tyreSizes:["tyre"],brands:["alloy-wheel","tyre"],finishes:["alloy-wheel"],diameters:["alloy-wheel","tyre"],collections:["alloy-wheel"],pcds:["alloy-wheel"],tyreTypes:["tyre"],speedRatings:["tyre"]},_e={diameters:"tyreSizes"};function K(e){if(e.length===0)return[];const t=P.filter(r=>e.every(n=>A[r].includes(n)));return t.filter(r=>{const n=_e[r];return!n||!t.includes(n)})}function Ze(e,t){return t&&e.includes(t)?[t]:[...e]}function D(e){const t=new Set;for(const r of e)t.add(b(r));return[...t]}const je={tyreSizes:[],brands:[],finishes:[],diameters:[],collections:[],pcds:[],tyreTypes:[],speedRatings:[],priceMax:null,priceMin:null,inStockOnly:!1,kind:null,sort:"recommended",page:1};function Ve(e){return`${Ae(e.width)}×${e.diameter}`}function Xe(e){return[...new Set((e.sizePairs??[]).map(t=>le(t.diameter,t.width)))]}function Ae(e){return oe(e)}function x(e,t,r,n=null,i="fail"){const s=b(e),o=l=>i==="fail"||(l==="lugs"?s==="alloy-wheel":A[l].includes(s));if(n!=="kind"&&t.kind&&s!==t.kind)return!1;for(const l of P){if(n===l)continue;const a=t[l];if(a.length===0||!o(l))continue;const f=a.map(String);if(!$(e,l).some(u=>f.includes(u)))return!1}if(n!=="lugs"&&t.lugs&&t.lugs.length>0&&o("lugs")){const l=ce(e);if(l===null||!t.lugs.includes(l))return!1}return!(n!=="price"&&!se(y(e),r,t.priceMin??null,t.priceMax)||n!=="inStock"&&t.inStockOnly&&!E(e))}function Ge(e,t,r){return e.filter(n=>E(n)&&x(n,t,r,"inStock")).length}function Y(e,t,r){const n=[...e],i=(o,l)=>N(o).localeCompare(N(l)),s=D(e).length>1;switch(t){case"price-asc":return n.sort((o,l)=>z(y(o),y(l),r,"asc"));case"price-desc":return n.sort((o,l)=>z(y(o),y(l),r,"desc"));case"name":return n.sort(i);case"new":return n.sort((o,l)=>{const a=(O(l)?1:0)-(O(o)?1:0);return a!==0||!s?a:i(o,l)});default:return n}}function He(e,t,r){return Y(e.filter(n=>x(n,t,r)),t.sort,r)}function Qe(e,t,r){return Y(e.filter(n=>x(n,t,r,null,"pass")),t.sort,r)}function qe(e){return P.some(t=>e[t].length>0)||(e.lugs?.length??0)>0||e.priceMin!=null||e.priceMax!=null||e.inStockOnly||e.kind!=null}const Je=e=>e.count===0&&!e.checked,Te={tyreSizes:"Size",brands:"Brand",finishes:"Colour",diameters:"Size · diameter",collections:"Collection",pcds:"PCD · fitment",tyreTypes:"Tyre type",speedRatings:"Speed rating"};function $(e,t){switch(t){case"tyreSizes":return[...new Set(_(e).flatMap(xe))];case"brands":return F(e)?[F(e)]:[];case"finishes":return fe(e);case"diameters":return pe(e).map(String);case"collections":return ue(e);case"pcds":return me(e);case"tyreTypes":return Se(e);case"speedRatings":return he(e)}}function Re(e){const t=new Map;for(const r of e)for(const n of de(r))n.color&&!t.has(n.family)&&t.set(n.family,n.color);return t}function et(e,t,r,n=D(e),i=ee,s="fail"){const o=c=>ke(c,n,i),l=Re(e),f=(s==="pass"?P.filter(c=>n.some(g=>A[c].includes(g))):K(n)).filter(c=>c!=="tyreSizes").filter(o).map(c=>{const g=t[c].map(String),T=new Set,M=new Map,w=new Map;for(const p of e){const h=$(p,c);for(const d of h)T.add(d);for(const d of new Set(h))w.set(d,(w.get(d)??0)+1);if(x(p,t,r,c,s))for(const d of new Set(h))M.set(d,(M.get(d)??0)+1)}const Q=[...T].map(p=>({value:p,label:c==="diameters"?`${p}″`:p,count:M.get(p)??0,checked:g.includes(p),swatch:c==="finishes"?l.get(p)??null:null})).sort((p,h)=>{if(c==="diameters")return Number(p.value)-Number(h.value);const d=(w.get(h.value)??0)-(w.get(p.value)??0);return d!==0?d:p.value.localeCompare(h.value)});return{key:c,label:Te[c],options:Q}}).filter(c=>c.options.length>W),u=[];for(const c of f){const g=Le(c.key,n,i);g!==void 0&&u.push({fieldKey:c.key,filterOrder:g})}return[...te(f,c=>c.key,u,"filterOrder")]}const W=1;function tt(e){return e.showCollection===!1?["collections"]:[]}function ke(e,t,r){return t.length===0||r.length===0?!0:t.some(n=>J(R(r,n))(k(e,n)))}function Le(e,t,r){if(r.length===0)return;let n;for(const i of t){const s=q(R(r,i),"filter")(k(e,i));s!==void 0&&(n===void 0||s<n)&&(n=s)}return n}function ze(e){const t=new Set;for(const r of e)for(const n of _(r))t.add(v(n));return t.size}function nt(e,t){return K(t).includes("tyreSizes")?ze(e)>W:!1}function U(e){const t=Pe(e);if(t)return t;const[r,n]=e.split("/");return{width:r?Number(r):void 0,profile:n?Number(n):void 0}}function Fe(e,t,r){return S.slice(0,S.indexOf(r)).every(n=>{const i=t[n];return i==null||e[n]===i})}function rt(e,t,r){const n=U(t.tyreSizes[0]??""),i=new Set(e.filter(s=>x(s,t,r,"tyreSizes")));return S.map(s=>{const o=new Map;for(const a of e){const f=_(a).filter(u=>Fe(u,n,s));for(const u of new Set(f.map(c=>c[s])))o.has(u)||o.set(u,0),i.has(a)&&o.set(u,(o.get(u)??0)+1)}const l=[...o.keys()].sort((a,f)=>a-f).map(a=>({value:a,label:s==="rim"?`R${a}`:String(a),count:o.get(a)??0}));return{part:s,label:we[s],value:n[s]??null,options:l}})}function it(e,t,r,n){const i={...U(t)},s=S.indexOf(r);i[r]=n??void 0;for(const o of S.slice(s+1))i[o]!=null&&e.some(f=>S.slice(0,S.indexOf(o)+1).every(u=>i[u]==null||f[u]===i[u]))||(i[o]=void 0);return v(i)}function st(e,t,r,n){if(t.length<2)return[];const i=e.filter(s=>x(s,r,n,"kind"));return[{kind:null,label:ge,count:i.length,checked:r.kind===null},...t.map(s=>({kind:s,label:I[s],count:i.filter(o=>b(o)===s).length,checked:r.kind===s}))]}function Ee(e,t){return e.map(r=>ie(y(r),t)).filter(r=>r!==null)}function Oe(e){if(e.length===0)return null;const t=Math.floor(Math.min(...e)),r=Math.ceil(Math.max(...e));return r>t?{min:t,max:r}:null}function ot(e,t){return Oe(Ee(e,t))}function lt(e,t,r){const n=[];e.kind&&n.push({key:"kind",value:e.kind,label:I[e.kind]}),e.inStockOnly&&n.push({key:"inStock",value:"",label:ne.inStock});for(const i of P)for(const s of e[i]){const o=String(s);n.push({key:i,value:o,label:i==="diameters"?`${o}″`:i==="pcds"?`PCD ${o}`:o})}for(const i of e.lugs??[])n.push({key:"lugs",value:String(i),label:ae(i)});return e.priceMin!=null&&n.push({key:"priceMin",value:"",label:`${re}${r(e.priceMin,t)}`}),e.priceMax!=null&&n.push({key:"price",value:"",label:`Up to ${r(e.priceMax,t)}`}),n}const m={tyreSizes:"tyreSize",brands:"brand",finishes:"colour",diameters:"size",collections:"collection",pcds:"pcd",tyreTypes:"tyreType",speedRatings:"speed"},Z="type",j="maxPrice",V="minPrice",X="inStock",G="sort",H="page";function Ne(e){const t=typeof e=="string"?new URLSearchParams(e):e,r=l=>t.getAll(l).flatMap(a=>a.split(",")).filter(Boolean),n=Number(t.get(j)),i=Number(t.get(V)),s=Number(t.get(H)),o=t.get(Z);return{tyreSizes:r(m.tyreSizes),brands:r(m.brands),finishes:r(m.finishes),diameters:r(m.diameters).map(Number).filter(Number.isFinite),collections:r(m.collections),pcds:r(m.pcds),tyreTypes:r(m.tyreTypes),speedRatings:r(m.speedRatings),priceMax:Number.isFinite(n)&&n>0?n:null,priceMin:Number.isFinite(i)&&i>0?i:null,inStockOnly:t.get(X)==="1",kind:ye.find(l=>l===o)??null,sort:C(t.get(G)),page:Number.isFinite(s)&&s>=1?Math.floor(s):1}}function Ie(e){const t=new URLSearchParams;for(const r of P){const n=e[r];n.length>0&&t.set(m[r],n.join(","))}return e.priceMin!=null&&t.set(V,String(e.priceMin)),e.priceMax!=null&&t.set(j,String(e.priceMax)),e.inStockOnly&&t.set(X,"1"),e.kind&&t.set(Z,e.kind),e.sort!=="recommended"&&t.set(G,e.sort),e.page>1&&t.set(H,String(e.page)),t}function ct(e){return Ie(Ne(e)).toString()}function at(e,t){if(e<=7)return Array.from({length:e},(s,o)=>o+1);const r=[1],n=Math.max(2,t-1),i=Math.min(e-1,t+1);n>2&&r.push(null);for(let s=n;s<=i;s++)r.push(s);return i<e-1&&r.push(null),r.push(e),r}function ut(e,t,r){const n=e.length,i=Math.max(1,Math.floor(r)),s=Math.max(1,Math.ceil(n/i)),o=Math.min(Math.max(1,Math.floor(t)),s),l=(o-1)*i;return{items:e.slice(l,l+i),page:o,pageCount:s,total:n,from:n===0?0:l+1,to:Math.min(l+i,n)}}export{je as EMPTY_PLP_FILTERS,P as PLP_FACET_KEYS,Te as PLP_FACET_LABELS,W as PLP_ONE_VALUE_MAX,m as PLP_PARAM,Me as PLP_SORT_LABELS,Z as PLP_TYPE_PARAM,He as applyPlpFilters,Qe as applyShopperFilters,C as asPlpSortKey,et as buildPlpFacets,st as buildPlpTypeOptions,rt as buildTyreSizeBoxes,ke as facetWantedByAnyKind,Ae as formatWidth,qe as hasActivePlpFilters,Je as isDeadPlpOption,x as itemMatchesPlp,tt as listingHiddenFacets,ut as paginatePlp,it as pickTyreSize,lt as plpActiveChips,K as plpFacetKeysFor,ct as plpFilterQuery,Ne as plpFiltersFromParams,Ie as plpFiltersToParams,Ge as plpInStockCount,Ue as plpOpeningSort,at as plpPageSequence,ot as plpPriceBounds,Oe as plpPriceBoundsOf,Ee as plpPricedAmounts,Ze as plpShownKinds,be as plpSortKeysFor,nt as plpTyreSizeBoxesShown,ze as plpTyreSizeCount,Ve as sizePairLabel,Y as sortPlpItems,Xe as wheelSizeLabels};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{parseOption as u}from"efficient-
|
|
1
|
+
import{parseOption as u}from"efficient-shell/format";import{WHEELS_PER_SET as r}from"../commerce.js";function a(e){return(e.components??[]).reduce((o,s)=>o+s.wheels,0)>r}function O(e){return e.kind==="alloy-wheel"&&(e.source.variants??[]).some(a)}const c=150,l="Front + rear",m="L/R pair",T="Not handed",i="L/R";function p(e){return e.et==null||e.rearEt==null?0:Math.abs(e.rearEt-e.et)}function n(e){return p(e)>=c}function I(e){return e.kind==="alloy-wheel"&&(e.source.variants??[]).some(n)}function d(e){return e.directional===!0}function x(e){return e.kind==="staggered"}function P(e){return e.rearWidth!=null||e.rearEt!=null&&e.rearEt!==e.et}function g(e){return{twoObjects:n(e),handed:d(e),staggered:x(e)}}function W(e){return{twoObjects:S(e),handed:e.handed??!1,staggered:!1}}function b(e){const t=[e.twoObjects?l:"",e.handed?i:""].filter(Boolean);return t.length?t.join(" · "):null}function H(e){return e.handed}function E(e){return new Set((e.components??[]).map(t=>t.partNumber)).size>1}function C(e){return e.kind==="alloy-wheel"&&(e.source.variants??[]).some(E)}function S(e){return(e.setWheelCount??0)>r}const f=new Set(["boltPattern"]);function L(e,t){return e&&f.has(t)}function N(e,t){return!e?.srcRight||!t||t!==e.src?null:e.srcRight}const _="per wheel";function y(e,t){return t?`${e} ${_}`:e}const h=[{label:"Pair",value:"pair"},{label:"One wheel",value:"one"}],R="pair";function A(e){return u(h,R,e)}export{l as AXLE_WORDS,i as CARD_HAND_WORDS,m as HAND_WORDS,T as NOT_HANDED_WORDS,_ as PER_WHEEL_UNIT,R as SET_PICTURE_DEFAULT,h as SET_PICTURE_POINTS,c as TWO_OBJECT_ET_SPREAD_MM,A as parseSetPicture,C as productHasComposedRender,O as productIsDually,I as productIsTwoObjects,b as setBuildLabel,H as setIsWide,N as setSecondSrc,L as setSuppressesRow,S as summaryIsDually,W as summarySetBuild,p as variantEtSpread,E as variantHasComposedRender,P as variantHasDistinctRear,a as variantIsDually,d as variantIsHanded,x as variantIsStaggered,n as variantIsTwoObjects,g as variantSetBuild,y as wheelCardPriceLine};
|