efficient-storefront-blocks 0.136.0 → 0.137.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/chunks/{CustomHtmlCodeWindow-I3KVLIVV.js → CustomHtmlCodeWindow-Z6VOLUDK.js} +1 -1
  3. package/dist/chunks/{EditorPreviewCheckout-F34WZNJI.js → EditorPreviewCheckout-2VQTCCYW.js} +1 -1
  4. package/dist/chunks/SiteEditorProvider-DRHFIJIM.js +1 -0
  5. package/dist/chunks/{chunk-Y7YKT7VT.js → chunk-2XZFXVKX.js} +1 -1
  6. package/dist/chunks/{chunk-HRFAKD3V.js → chunk-4AVKWZMD.js} +1 -1
  7. package/dist/chunks/{chunk-P34EYTSF.js → chunk-FI4EXF37.js} +1 -1
  8. package/dist/chunks/{chunk-R4EFOLOT.js → chunk-HTPROWNP.js} +1 -1
  9. package/dist/chunks/{chunk-IONUM72D.js → chunk-JBOIT52E.js} +1 -1
  10. package/dist/chunks/{chunk-6AODAOZ5.js → chunk-JRZLQGD3.js} +17 -17
  11. package/dist/chunks/{chunk-NMX2Y4EJ.js → chunk-MYDBTUHM.js} +1 -1
  12. package/dist/chunks/{chunk-WWLYHXN4.js → chunk-ZVHG5QQR.js} +1 -1
  13. package/dist/chunks/{fitment-data-VXH4D2UD.js → fitment-data-QZLRTN6S.js} +1 -1
  14. package/dist/chunks/{section-css-style-GUVXWUWX.js → section-css-style-MHLXSGS3.js} +1 -1
  15. package/dist/index.js +24 -24
  16. package/dist/links.js +1 -1
  17. package/dist/render/built-with.json +1 -1
  18. package/dist/routine-index.json +1 -1
  19. package/dist/value-index.json +1 -1
  20. package/package.json +3 -3
  21. package/dist/chunks/SiteEditorProvider-FYEVPZKT.js +0 -1
  22. /package/dist/chunks/{chunk-ERLKLMUX.js → chunk-BKBFZATI.js} +0 -0
  23. /package/dist/chunks/{chunk-6AODAOZ5.js.LEGAL.txt → chunk-JRZLQGD3.js.LEGAL.txt} +0 -0
  24. /package/dist/chunks/{chunk-PPCAEV32.js → chunk-MHHLECYD.js} +0 -0
  25. /package/dist/chunks/{chunk-BA5HNYFW.js → chunk-PAE6QL75.js} +0 -0
  26. /package/dist/chunks/{chunk-WWLYHXN4.js.LEGAL.txt → chunk-ZVHG5QQR.js.LEGAL.txt} +0 -0
package/dist/links.js CHANGED
@@ -1 +1 @@
1
- var g={bold:{open:"**",close:"**",placeholder:"bold text"},italic:{open:"_",close:"_",placeholder:"italic text"},strike:{open:"~~",close:"~~",placeholder:"struck out"},code:{open:"`",close:"`",placeholder:"code"},highlight:{open:"==",close:"==",placeholder:"highlighted text"},quiet:{open:"^^",close:"^^",placeholder:"quiet text"},underline:{open:"[",close:"]{underline}",placeholder:"underlined text"},sup:{open:"[",close:"]{sup}",placeholder:"superscript"},sub:{open:"[",close:"]{sub}",placeholder:"subscript"}};var ue=["main","text","background","muted"],pt=[...ue,"surface"];var ft={bold:g.bold.placeholder,italic:g.italic.placeholder,strike:g.strike.placeholder,code:g.code.placeholder,highlight:g.highlight.placeholder,quiet:g.quiet.placeholder,link:"link text",underline:g.underline.placeholder,sup:g.sup.placeholder,sub:g.sub.placeholder,color:"colored text",style:"styled text"};var pe=[{style:"bold",label:"B",name:"Strong",title:"Strong \xB7 **words** \xB7 \u2318B",shortcut:"b"},{style:"italic",label:"I",name:"Italic",title:"Italic \xB7 _words_ \xB7 \u2318I",shortcut:"i"},{style:"strike",label:"S",name:"Strikethrough",title:"Strikethrough \xB7 ~~words~~"},{style:"highlight",label:"\u25C6",name:"Emphasis",title:"Emphasis \xB7 ==words=="},{style:"quiet",label:"a",name:"Quiet",title:"Quiet \xB7 ^^words^^"},{style:"code",label:"\u2039\u203A",name:"Code",title:"Code"},{style:"link",label:"\u{1F517}",name:"Link",title:"Link \xB7 [words](https://\u2026) \xB7 \u2318K",shortcut:"k"},{style:"bullet",label:"\u2022",name:"Bulleted list",title:"Bulleted list"},{style:"number",label:"1.",name:"Numbered list",title:"Numbered list"},{style:"quote",label:"\u275D",name:"Quote",title:"Quote"},{style:"clear",label:"T\xD7",name:"Clear marks",title:"Clear marks \xB7 \u2318\u21E7X",shortcut:"shift+x"}];var O=[{open:"**",close:"**",kind:"bold"},{open:"==",close:"==",kind:"highlight"},{open:"~~",close:"~~",kind:"strike"},{open:"_",close:"_",kind:"italic",wordBoundary:!0},{open:"^^",close:"^^",kind:"quiet"},{open:"@@",close:"@@",kind:"highlight"},{open:"++",close:"++",kind:"bold",wordStart:!0}],fe=["highlight","quiet"],dt=pe.map(e=>e.style).filter(e=>O.some(t=>t.kind===e)).filter(e=>!fe.includes(e)),mt=[...O,{open:"*",close:"*",kind:"accent"}],ht=[...O,{open:"*",close:"*",kind:"accent"},{open:"#",close:"#",kind:"bold",notBefore:"0123456789"},{open:"[",close:"]",kind:"italic",notBefore:"(",notBeforeBlock:!0}];var gt=["http","https","mailto","tel"];function j(e){if(e===""||/[\s\u0000-\u001f\u007f]/.test(e))return!1;let t=/^([a-zA-Z][a-zA-Z0-9+.-]*):/.exec(e);return!t||gt.includes(t[1].toLowerCase())}var de=["width","profile","rim"];var yt=/^\s*(\d{2,3})\s*\/\s*(\d{2,3})\s*[A-Za-z]*\s*(\d{2}(?:\.\d+)?)\s*$/,bt={width:[100,500],profile:[20,100],rim:[10,30]};function H(e){let t=yt.exec(e??"");if(!t)return null;let n={width:Number(t[1]),profile:Number(t[2]),rim:Number(t[3])};return de.every(o=>{let[s,i]=bt[o];return n[o]>=s&&n[o]<=i})?n:null}function _(e){if(e.width==null)return"";if(e.profile==null)return String(e.width);let t=`${e.width}/${e.profile}`;return e.rim==null?t:`${t} R${e.rim}`}function me(e){return[_({width:e.width}),_({width:e.width,profile:e.profile}),_(e)]}var x=["alloy-wheel","tyre"],he=["alloy-wheel"],E={"alloy-wheel":"Alloy wheels",tyre:"Tyres"};var Mn=x.map(e=>({value:e,label:E[e]}));function ge(e){return e==null?[...he]:Array.isArray(e)?x.filter(t=>e.includes(t)):[...he]}var m=e=>e;function d(e){return m(e).kind==="tyre"?"tyre":"alloy-wheel"}function Y(e){return m(e).brand??""}function ye(e){return m(e).prices??void 0}function be(e){return m(e).inStock!==!1}function Se(e){let t=m(e),n=d(e)==="tyre"?t.rimDiameters:t.sizes;return Array.isArray(n)?n.filter(r=>typeof r=="number"&&Number.isFinite(r)):[]}function W(e){return d(e)==="tyre"?[]:(m(e).finishes??[]).filter(t=>typeof t?.family=="string").map(t=>({family:t.family,color:t.color??null}))}function Pe(e){return W(e).map(t=>t.family)}function ke(e){if(d(e)==="tyre")return[];let t=m(e);return Array.isArray(t.categories)?t.categories:t.process?[t.process]:[]}function xe(e){return d(e)==="tyre"?[]:m(e).spec?.pcds??[]}function we(e){return d(e)!=="tyre"?[]:m(e).tyreTypes??[]}function Te(e){return d(e)!=="tyre"?[]:m(e).speedRatings??[]}function Ae(e){if(d(e)!=="tyre")return[];let t=m(e).sizes;return Array.isArray(t)?t.map(n=>H(typeof n=="string"?n:null)).filter(n=>n!==null):[]}var V=e=>typeof e=="string"&&e?e:void 0;function G(e,t){return Object.hasOwn(e,t)?e[t]:void 0}function Le(e,t){return Object.hasOwn(e,t)}var Oe=null;function _e(e,t){return t?e.replace(/\{([A-Za-z][A-Za-z0-9_]*)\}/g,(n,r)=>Le(t,r)?String(G(t,r)):n):e}function y(e,t){let n=Oe?G(Oe,e):void 0;if(typeof n=="function"){try{let r=V(n(t??{}));if(r)return r}catch{}return _e(e,t)}return _e(V(n)??e,t)}function q(e){return(e??"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}var I=(e,t,n,r)=>({default:e,min:t,max:n,step:r}),Hn=I(30,0,100,10),Yn=I(0,0,100,5),Wn=I(100,0,100,5);var Vn=I(2,0,4,.5);var Gn=["button","summary",'[role="button"]','[role="checkbox"]','[role="switch"]',"video[controls]","audio[controls]",...["checkbox","button","submit","reset","image","color","file"].map(e=>`input[type="${e}"]`)].join(", "),qn=["menuitem","option","listbox","slider","tab","tablist","combobox","radio","radiogroup","spinbutton","menu","menubar","tree","treeitem","grid","gridcell"].map(e=>`[role="${e}"]`).concat('input[type="radio"]','input[type="range"]').join(", "),St="data-motion-pin-free",Zn=`.maplibregl-map, .mapboxgl-map, .leaflet-container, .gm-style, [${St}]`;function Ee(e){return typeof e=="string"?e.trim():e&&typeof e=="object"&&typeof e.text=="string"?e.text.trim():""}var Ie="homepage";var F=[{value:"page",label:"Page"},{value:"anchor",label:"Anchor"},{value:"blog",label:"Blog post",needs:"service"},{value:"product",label:"Product",needs:"commerce"},{value:"popup",label:"Popup"},{value:"custom",label:"Custom URL"}];function v(e){return e.offersCommerce&&e.offersService?F:F.filter(t=>!t.needs||(t.needs==="commerce"?e.offersCommerce:e.offersService))}var Z="#popup:";function Fe(e){return`${Z}${e}`}function ve(e){return e.startsWith(Z)&&e.slice(Z.length).trim()||null}function b(e){return e===Ie?"/":`/${e}`}function R(e){return`/journal/${e}`}function N(e){return`/wheels/${e}`}function C(e,t){return`${b(e)}#${t}`}function M(...e){let t=new Set,n=[];for(let r of e)for(let o of r?.content??[]){let s=Ee(o?.props?.anchor);if(!s)continue;let i=q(s);!i||t.has(i)||(t.add(i),n.push({slug:i,name:s}))}return n}function Re(e){return/^\/wheels\/[^/?#]+(?:[?#].*)?$/.test(e)}var Pt=()=>({choosePage:y("Choose a page"),chooseSection:y("Choose a section"),noSections:y("No section anchors yet"),sectionHint:y("Jumps to a section on that page."),choosePost:y("Choose a post"),chooseProduct:y("Choose a product"),choosePopup:y("Choose a popup")});function K(e,t,n){if(!e)return"page";if(ve(e))return"popup";if(e.startsWith("/journal/"))return"blog";if(Re(e))return"product";if(e.includes("#")){let r=e.slice(0,e.indexOf("#"));if(r===""||r==="/"||t.includes(r))return"anchor"}return e==="/"||t.includes(e)||n&&n.listingPaths.includes(n.targetOf(e))?"page":"custom"}function Ne(e,t){let n=Pt(),r=e.pages.map(c=>({value:b(c.slug),label:c.title})),o=t?.pageOptions?t.pageOptions(r):r,s=o.map(c=>c.value),i=e.pages.map(c=>({label:c.title,options:M(...c.docs).map(u=>({value:C(c.slug,u.slug),label:u.name}))})).filter(c=>c.options.length>0),l=c=>{switch(c){case"page":return{type:"select",options:o,placeholder:n.choosePage};case"anchor":return{type:"groups",groups:i,placeholder:i.length?n.chooseSection:n.noSections};case"blog":return{type:"select",options:e.posts.map(u=>({value:R(u.slug),label:u.title||u.slug})),placeholder:n.choosePost};case"product":return{type:"select",options:e.products.map(u=>({value:u.href,label:u.name||u.href})),placeholder:n.chooseProduct};case"popup":return{type:"select",options:(e.popups??[]).map(u=>({value:Fe(u.slug),label:u.title||u.slug})),placeholder:n.choosePopup};case"custom":return{type:"text"}}},a=v(e.offers).map(c=>({value:c.value,label:y(c.label),target:l(c.value),...c.value==="anchor"?{hint:n.sectionHint}:{},...c.value==="blog"||c.value==="product"||c.value==="popup"?{hideWhenEmpty:!0}:{}}));if(!t)return{kinds:a,rules:{kindOf:c=>K(c,s),targetOf:c=>c,readFilter:()=>null,withFilter:c=>c}};let p=c=>{let u=t.withFilter(c,null);return t.listingPaths.includes(u)?u:c};return{kinds:a,rules:{kindOf:c=>K(c,s,{listingPaths:t.listingPaths,targetOf:p}),targetOf:p,readFilter:t.readFilter,withFilter:t.withFilter},filtersFor:c=>t.listingPaths.includes(c)?t.filtersFor(c):null}}var Ce=Object.freeze([]);function X(e,t){return e.length===0?e:e.filter(n=>n.kind===void 0||n.kind===t)}function Me(e,t){let n=t==="filter"?"filterOrder":"cardOrder",r=new Map;for(let o of e){let s=o[n];if(typeof s!="number"||!Number.isFinite(s))continue;let i=r.get(o.fieldKey);(i===void 0||s<i)&&r.set(o.fieldKey,s)}return o=>o?r.get(o):void 0}function Ke(e,t,n,r){let o=new Map;for(let a of n){let p=a[r];typeof p=="number"&&o.set(a.fieldKey,p)}if(o.size===0)return e;let s=[],i=[];e.forEach((a,p)=>{let c=t(a);c&&(s.push(p),i.push({item:a,index:p,order:o.get(c)}))}),i.sort((a,p)=>a.order!==void 0&&p.order!==void 0?a.order-p.order||a.index-p.index:a.order!==void 0?-1:p.order!==void 0?1:a.index-p.index);let l=[...e];return s.forEach((a,p)=>{l[a]=i[p].item}),l.every((a,p)=>a===e[p])?e:l}function $e(e){return xt(e,"filter")}var kt="collection";function Q(e,t){return{tyreSizes:{},brands:{"alloy-wheel":"brand",tyre:"brand"},finishes:{"alloy-wheel":"wheel_finish_ref"},diameters:{"alloy-wheel":"diameter",tyre:"rim_diameter"},collections:{"alloy-wheel":kt},pcds:{"alloy-wheel":"pcd"},tyreTypes:{tyre:"tire_type"},speedRatings:{tyre:"speed_rating"}}[e]?.[t]}function xt(e,t){let n=new Set(e.filter(r=>r[t]===!1).map(r=>r.fieldKey));return r=>!r||!n.has(r)}function wt(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function ze(e,t){let n=e?.[t];return wt(n)?n:null}function De(e,t,n,r){if(n==null&&r==null)return!0;let o=ze(e,t);return!(o===null||n!=null&&o<n||r!=null&&o>r)}function Ue(e){let t=e.spec?.lugs;return typeof t=="number"?t:null}var Tt={recommended:"Recommended","price-asc":"Price \xB7 low to high","price-desc":"Price \xB7 high to low",new:"Newest",name:"Name A\u2013Z"},Cr=Object.keys(Tt);var J=["tyreSizes","brands","finishes","diameters","collections","pcds","tyreTypes","speedRatings"],ee={tyreSizes:["tyre"],brands:["alloy-wheel","tyre"],finishes:["alloy-wheel"],diameters:["alloy-wheel","tyre"],collections:["alloy-wheel"],pcds:["alloy-wheel"],tyreTypes:["tyre"],speedRatings:["tyre"]},At={diameters:"tyreSizes"};function Lt(e){if(e.length===0)return[];let t=J.filter(n=>e.every(r=>ee[n].includes(r)));return t.filter(n=>{let r=At[n];return!r||!t.includes(r)})}function Ot(e){let t=new Set;for(let n of e)t.add(d(n));return[...t]}var Be={tyreSizes:[],brands:[],finishes:[],diameters:[],collections:[],pcds:[],tyreTypes:[],speedRatings:[],priceMax:null,priceMin:null,inStockOnly:!1,kind:null,sort:"recommended",page:1};function _t(e,t,n,r=null,o="fail"){let s=d(e),i=l=>o==="fail"||(l==="lugs"?s==="alloy-wheel":ee[l].includes(s));if(r!=="kind"&&t.kind&&s!==t.kind)return!1;for(let l of J){if(r===l)continue;let a=t[l];if(a.length===0||!i(l))continue;let p=a.map(String);if(!je(e,l).some(c=>p.includes(c)))return!1}if(r!=="lugs"&&t.lugs&&t.lugs.length>0&&i("lugs")){let l=Ue(e);if(l===null||!t.lugs.includes(l))return!1}return!(r!=="price"&&!De(ye(e),n,t.priceMin??null,t.priceMax)||r!=="inStock"&&t.inStockOnly&&!be(e))}var Et={tyreSizes:"Size",brands:"Brand",finishes:"Colour",diameters:"Size \xB7 diameter",collections:"Collection",pcds:"PCD \xB7 fitment",tyreTypes:"Tyre type",speedRatings:"Speed rating"};function je(e,t){switch(t){case"tyreSizes":return[...new Set(Ae(e).flatMap(me))];case"brands":return Y(e)?[Y(e)]:[];case"finishes":return Pe(e);case"diameters":return Se(e).map(String);case"collections":return ke(e);case"pcds":return xe(e);case"tyreTypes":return we(e);case"speedRatings":return Te(e)}}function It(e){let t=new Map;for(let n of e)for(let r of W(n))r.color&&!t.has(r.family)&&t.set(r.family,r.color);return t}function He(e,t,n,r=Ot(e),o=Ce,s="fail"){let i=u=>vt(u,r,o),l=It(e),p=(s==="pass"?J.filter(u=>r.some(P=>ee[u].includes(P))):Lt(r)).filter(u=>u!=="tyreSizes").filter(i).map(u=>{let P=t[u].map(String),ce=new Set,B=new Map,L=new Map;for(let f of e){let S=je(f,u);for(let h of S)ce.add(h);for(let h of new Set(S))L.set(h,(L.get(h)??0)+1);if(_t(f,t,n,u,s))for(let h of new Set(S))B.set(h,(B.get(h)??0)+1)}let ut=[...ce].map(f=>({value:f,label:u==="diameters"?`${f}\u2033`:f,count:B.get(f)??0,checked:P.includes(f),swatch:u==="finishes"?l.get(f)??null:null})).sort((f,S)=>{if(u==="diameters")return Number(f.value)-Number(S.value);let h=(L.get(S.value)??0)-(L.get(f.value)??0);return h!==0?h:f.value.localeCompare(S.value)});return{key:u,label:Et[u],options:ut}}).filter(u=>u.options.length>Ft),c=[];for(let u of p){let P=Rt(u.key,r,o);P!==void 0&&c.push({fieldKey:u.key,filterOrder:P})}return[...Ke(p,u=>u.key,c,"filterOrder")]}var Ft=1;function Ye(e){return e.showCollection===!1?["collections"]:[]}function vt(e,t,n){return t.length===0||n.length===0?!0:t.some(r=>$e(X(n,r))(Q(e,r)))}function Rt(e,t,n){if(n.length===0)return;let r;for(let o of t){let s=Me(X(n,o),"filter")(Q(e,o));s!==void 0&&(r===void 0||s<r)&&(r=s)}return r}var te={tyreSizes:"tyreSize",brands:"brand",finishes:"colour",diameters:"size",collections:"collection",pcds:"pcd",tyreTypes:"tyreType",speedRatings:"speed"},ne="type";var w=e=>!!e&&typeof e=="object"&&!Array.isArray(e),T=e=>w(e)&&typeof e.type=="string"&&w(e.props);var $=e=>Array.isArray(e)&&e.length>0&&e.every(T);function Nt(e){let t="";for(let n of e)t+=typeof n=="number"?`[${n}]`:t===""?n:`.${n}`;return t}function We(e,t){return t==="root"?e.root:e.components[t]}function Ve(e){return e?.fields??{}}function Ge(e,t){return Ve(We(e,t))}function qe(e,t){let n=[];return re(e,t,[],n),n}function re(e,t,n,r){for(let o of Object.keys(t)){let s=t[o];if(!s)continue;let i=[...n,o],l=e[o];if(s.type==="slot"){let a=Array.isArray(l);r.push({slot:Nt(i),segments:i,content:a?l:[],present:a})}else if(s.type==="object"&&s.objectFields&&w(l))re(l,s.objectFields,i,r);else if(s.type==="array"&&s.arrayFields&&Array.isArray(l)){let a=s.arrayFields;l.forEach((p,c)=>{w(p)&&re(p,a,[...i,c],r)})}}}function oe(e,t,n){return Mt(e,t,n).map(({slot:r,content:o})=>({slot:r,content:o}))}function z(e){let t=new TextEncoder,n=new Map(e.map(r=>[r,t.encode(r)]));return[...e].sort((r,o)=>{let s=n.get(r),i=n.get(o);if(s.length!==i.length)return s.length-i.length;for(let l=0;l<s.length;l++)if(s[l]!==i[l])return s[l]-i[l];return 0})}function Mt(e,t,n){let r=qe(e.props,Ge(t,e.type));if(n?.order!=="stored")return r;let o=z(Object.keys(e.props)),s=i=>{let l=i.present?o.indexOf(String(i.segments[0])):-1;return l<0?Number.POSITIVE_INFINITY:l};return r.map((i,l)=>({loc:i,i:l,r:s(i)})).sort((i,l)=>i.r-l.r||i.i-l.i).map(({loc:i})=>i)}var Ze=["Text","ImageBlock","ButtonBlock","Flex"];function k(){return{type:"slot",allow:[...Ze]}}var Kt=Ze.filter(e=>e!=="ButtonBlock");function Xe(){return{type:"slot",allow:[...Kt]}}var $t="boxes",Qe={CardList:{template:Xe()},Cards:{template:k()},FAQ:{template:k()},Flex:{rowTitle:{type:"slot",allow:["Text"]},content:{type:"slot"}},Footprint:{template:k()},Grid:{content:{type:"slot"}},Hero:{slides:{type:"slot",ownPictures:!0},strip:{type:"slot",allow:["Flex"]}},HeroGroup:{content:{type:"slot"}},HeroSingle:{boxes:{type:"slot",allow:["HeroGroup"]}},HeroSlide:{groups:{type:"slot",allow:["HeroGroup"]}},Logos:{logos:{type:"slot",allow:["LogoBlock"]},template:{type:"slot",allow:["LogoBlock"]}},OrderSummary:{template:k()},ProcessSteps:{[$t]:{type:"slot"},template:k()}};var zt={},Dt=null;function Ut(){let e=Object.fromEntries(Object.entries(Qe).map(([t,n])=>[t,{fields:n}]));return Dt??={components:{...e,...zt}}}function Bt(e){let t=e.props??{},n=typeof e.type=="string"?e.type:"",r=Ut(),o=n!==""&&Object.prototype.hasOwnProperty.call(r.components,n)?oe({type:n,props:t},r).map(l=>l.slot).filter(l=>!l.includes(".")):[],s=o.filter(l=>$(t[l])),i=z(Object.keys(t).filter(l=>!o.includes(l)&&$(t[l])));return[...s,...i]}function Je(e,t){let n=null;for(let r of Bt(e)){let o=e.props[r],s=t(o,r);s!==o&&((n??={...e.props})[r]=s)}return n?{...e,props:n}:e}var et="FilterBlock";var tt="AlloyWheelsListing";function jt(e){let t=e??{},n=[];Array.isArray(t.content)&&n.push(t.content);for(let r of Object.values(t.zones??{}))Array.isArray(r)&&n.push(r);return n}function Ht(e){let t=[],n=(r,o)=>{let s=[r,...o];for(let i of r)T(i)&&(t.push({node:i,order:t.length,lists:s}),Je(i,l=>(n(l,s),l)))};for(let r of jt(e))n(r,[]);return t}function nt(e){return Ht(e).map(t=>t.node)}function rt(e){return j(e.trim())}var A="/wheels",D="Products";function ot(e,t){return t>1?`${D} \xB7 ${e}`:D}function se(...e){for(let t of[tt,et])for(let n of e){let r=nt({content:n?.content}).find(o=>o.type===t);if(r)return r.props??{}}return null}function U(...e){return se(...e)!==null}function st(e,t){let n=e.filter(r=>U(...r.docs)).map(r=>b(r.slug));return t.fallback&&!n.includes(A)?[...n,A]:n}var ie=[ne,...Object.entries(te).filter(([e])=>e!=="tyreSizes").map(([,e])=>e)];function it(e){let t=e.indexOf("#"),n=t===-1?"":e.slice(t),r=t===-1?e:e.slice(0,t),o=r.indexOf("?");return{path:o===-1?r:r.slice(0,o),query:o===-1?"":r.slice(o+1),hash:n}}function Yt(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return e}}function lt(e){let t=new URLSearchParams(it(e).query);for(let n of ie){let r=t.get(n);if(r)return{param:n,value:r}}return null}function le(e,t){let{path:n,query:r,hash:o}=it(e),s=r.split("&").filter(i=>i&&!ie.includes(Yt(i.split("=")[0])));return t?.value&&s.push(`${encodeURIComponent(t.param)}=${encodeURIComponent(t.value)}`),`${n}${s.length?`?${s.join("&")}`:""}${o}`}function at(e,t){let n=le(e,null);return t.includes(n)?n:e}function Wt(e,t,n=[]){return K(e,t,{listingPaths:n,targetOf:r=>at(r,n)})}function Vt(e){return Array.isArray(e)?e.filter(t=>typeof t?.kind=="string"&&typeof t.field_key=="string").map(t=>({kind:t.kind,fieldKey:t.field_key,...typeof t.filter=="boolean"?{filter:t.filter}:{},filterOrder:t.filter_order??null})):[]}var ct="Product type",Gt="AUD";function ae(e,t){let n=t.listing??{},r=ge(n.kinds),o=e.filter(a=>r.includes(d(a))),s=Ye(n),i=He(o,Be,Gt,r,t.fieldUsage).filter(a=>!s.includes(a.key)).map(a=>({param:te[a.key],label:a.label,values:a.options.filter(p=>!p.value.includes(",")).map(p=>({value:p.value,label:p.label}))})).filter(a=>a.values.length>0),l=x.filter(a=>r.includes(a)&&o.some(p=>d(p)===a));return l.length>1&&i.unshift({param:ne,label:ct,values:l.map(a=>({value:a,label:E[a]}))}),i}function qt(e){return t=>{let n=st(t,{fallback:e.offersCommerce}),r=t.filter(o=>U(...o.docs)).length;return{listingPaths:n,pageOptions:o=>{let s=o.map(i=>{let l=t.find(a=>b(a.slug)===i.value);return l&&U(...l.docs)?{...i,label:ot(l.title,r)}:i});return r===0&&e.offersCommerce&&!s.some(i=>i.value===A)&&s.push({value:A,label:D}),s},filtersFor:o=>{if(!n.includes(o))return null;let s=t.find(i=>b(i.slug)===o);return ae(e.catalogue,{listing:s?se(...s.docs):null,fieldUsage:e.fieldUsage})},readFilter:lt,withFilter:le}}}function Zt(e){let t=qt({catalogue:e.catalogue,fieldUsage:e.fieldUsage,offersCommerce:e.offers.offersCommerce})(e.pages),n=Ne({pages:e.pages,posts:e.posts,products:e.products.map(r=>({href:N(r.slug),name:r.name||r.slug})),offers:e.offers},t);return{...n,rules:{...n.rules,isSafe:rt},filtersFor:n.filtersFor??(()=>null)}}function ns(e,t){return ae(e,t)}export{A as BUILT_IN_LISTING_PATH,F as LINK_KINDS,ie as LISTING_FILTER_PARAMS,D as LISTING_PAGE_LABEL,ct as PRODUCT_TYPE_FILTER_LABEL,C as anchorPath,Vt as fieldUsageFromAdminRows,Wt as inferLinkKind,U as isProductListingPage,rt as isSafeLink,v as linkKindsFor,Zt as linkPickerSetup,ns as listingFilterFields,se as listingNode,ot as listingPageLabel,at as listingTarget,M as pageAnchors,b as pagePath,R as postPath,st as productListingPaths,lt as readListingFilter,N as wheelPath,le as withListingFilter};
1
+ var g={bold:{open:"**",close:"**",placeholder:"bold text"},italic:{open:"_",close:"_",placeholder:"italic text"},strike:{open:"~~",close:"~~",placeholder:"struck out"},code:{open:"`",close:"`",placeholder:"code"},highlight:{open:"==",close:"==",placeholder:"highlighted text"},quiet:{open:"^^",close:"^^",placeholder:"quiet text"},underline:{open:"[",close:"]{underline}",placeholder:"underlined text"},sup:{open:"[",close:"]{sup}",placeholder:"superscript"},sub:{open:"[",close:"]{sub}",placeholder:"subscript"}};var ue=["main","text","background","muted"],pt=[...ue,"surface"];var ft={bold:g.bold.placeholder,italic:g.italic.placeholder,strike:g.strike.placeholder,code:g.code.placeholder,highlight:g.highlight.placeholder,quiet:g.quiet.placeholder,link:"link text",underline:g.underline.placeholder,sup:g.sup.placeholder,sub:g.sub.placeholder,color:"colored text",style:"styled text"};var pe=[{style:"bold",label:"B",name:"Strong",title:"Strong \xB7 **words** \xB7 \u2318B",shortcut:"b"},{style:"italic",label:"I",name:"Italic",title:"Italic \xB7 _words_ \xB7 \u2318I",shortcut:"i"},{style:"strike",label:"S",name:"Strikethrough",title:"Strikethrough \xB7 ~~words~~"},{style:"highlight",label:"\u25C6",name:"Emphasis",title:"Emphasis \xB7 ==words=="},{style:"quiet",label:"a",name:"Quiet",title:"Quiet \xB7 ^^words^^"},{style:"code",label:"\u2039\u203A",name:"Code",title:"Code"},{style:"link",label:"\u{1F517}",name:"Link",title:"Link \xB7 [words](https://\u2026) \xB7 \u2318K",shortcut:"k"},{style:"bullet",label:"\u2022",name:"Bulleted list",title:"Bulleted list"},{style:"number",label:"1.",name:"Numbered list",title:"Numbered list"},{style:"quote",label:"\u275D",name:"Quote",title:"Quote"},{style:"clear",label:"T\xD7",name:"Clear marks",title:"Clear marks \xB7 \u2318\u21E7X",shortcut:"shift+x"}];var O=[{open:"**",close:"**",kind:"bold"},{open:"==",close:"==",kind:"highlight"},{open:"~~",close:"~~",kind:"strike"},{open:"_",close:"_",kind:"italic",wordBoundary:!0},{open:"^^",close:"^^",kind:"quiet"},{open:"@@",close:"@@",kind:"highlight"},{open:"++",close:"++",kind:"bold",wordStart:!0}],fe=["highlight","quiet"],dt=pe.map(e=>e.style).filter(e=>O.some(t=>t.kind===e)).filter(e=>!fe.includes(e)),mt=[...O,{open:"*",close:"*",kind:"accent"}],ht=[...O,{open:"*",close:"*",kind:"accent"},{open:"#",close:"#",kind:"bold",notBefore:"0123456789"},{open:"[",close:"]",kind:"italic",notBefore:"(",notBeforeBlock:!0}];var gt=["http","https","mailto","tel"];function j(e){if(e===""||/[\s\u0000-\u001f\u007f]/.test(e))return!1;let t=/^([a-zA-Z][a-zA-Z0-9+.-]*):/.exec(e);return!t||gt.includes(t[1].toLowerCase())}var de=["width","profile","rim"];var yt=/^\s*(\d{2,3})\s*\/\s*(\d{2,3})\s*[A-Za-z]*\s*(\d{2}(?:\.\d+)?)\s*$/,bt={width:[100,500],profile:[20,100],rim:[10,30]};function Y(e){let t=yt.exec(e??"");if(!t)return null;let n={width:Number(t[1]),profile:Number(t[2]),rim:Number(t[3])};return de.every(o=>{let[s,i]=bt[o];return n[o]>=s&&n[o]<=i})?n:null}function E(e){if(e.width==null)return"";if(e.profile==null)return String(e.width);let t=`${e.width}/${e.profile}`;return e.rim==null?t:`${t} R${e.rim}`}function me(e){return[E({width:e.width}),E({width:e.width,profile:e.profile}),E(e)]}var w=["alloy-wheel","tyre"],he=["alloy-wheel"],_={"alloy-wheel":"Alloy wheels",tyre:"Tyres"};var Mn=w.map(e=>({value:e,label:_[e]}));function ge(e){return e==null?[...he]:Array.isArray(e)?w.filter(t=>e.includes(t)):[...he]}var m=e=>e;function d(e){return m(e).kind==="tyre"?"tyre":"alloy-wheel"}function H(e){return m(e).brand??""}function ye(e){return m(e).prices??void 0}function be(e){return m(e).inStock!==!1}function Se(e){let t=m(e),n=d(e)==="tyre"?t.rimDiameters:t.sizes;return Array.isArray(n)?n.filter(r=>typeof r=="number"&&Number.isFinite(r)):[]}function W(e){return d(e)==="tyre"?[]:(m(e).finishes??[]).filter(t=>typeof t?.family=="string").map(t=>({family:t.family,color:t.color??null}))}function Pe(e){return W(e).map(t=>t.family)}function ke(e){if(d(e)==="tyre")return[];let t=m(e);return Array.isArray(t.categories)?t.categories:t.process?[t.process]:[]}function we(e){return d(e)==="tyre"?[]:m(e).spec?.pcds??[]}function xe(e){return d(e)!=="tyre"?[]:m(e).tyreTypes??[]}function Te(e){return d(e)!=="tyre"?[]:m(e).speedRatings??[]}function Ae(e){if(d(e)!=="tyre")return[];let t=m(e).sizes;return Array.isArray(t)?t.map(n=>Y(typeof n=="string"?n:null)).filter(n=>n!==null):[]}var V=e=>typeof e=="string"&&e?e:void 0;function G(e,t){return Object.hasOwn(e,t)?e[t]:void 0}function Le(e,t){return Object.hasOwn(e,t)}var Oe=null;function Ee(e,t){return t?e.replace(/\{([A-Za-z][A-Za-z0-9_]*)\}/g,(n,r)=>Le(t,r)?String(G(t,r)):n):e}function y(e,t){let n=Oe?G(Oe,e):void 0;if(typeof n=="function"){try{let r=V(n(t??{}));if(r)return r}catch{}return Ee(e,t)}return Ee(V(n)??e,t)}function q(e){return(e??"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}var I=(e,t,n,r)=>({default:e,min:t,max:n,step:r}),Yn=I(30,0,100,10),Hn=I(0,0,100,5),Wn=I(100,0,100,5);var Vn=I(2,0,4,.5);var Gn=["button","summary",'[role="button"]','[role="checkbox"]','[role="switch"]',"video[controls]","audio[controls]",...["checkbox","button","submit","reset","image","color","file"].map(e=>`input[type="${e}"]`)].join(", "),qn=["menuitem","option","listbox","slider","tab","tablist","combobox","radio","radiogroup","spinbutton","menu","menubar","tree","treeitem","grid","gridcell"].map(e=>`[role="${e}"]`).concat('input[type="radio"]','input[type="range"]').join(", "),St="data-motion-pin-free",Zn=`.maplibregl-map, .mapboxgl-map, .leaflet-container, .gm-style, [${St}]`;function _e(e){return typeof e=="string"?e.trim():e&&typeof e=="object"&&typeof e.text=="string"?e.text.trim():""}var Ie="homepage";var F=[{value:"page",label:"Page"},{value:"anchor",label:"Anchor"},{value:"blog",label:"Blog post",needs:"service"},{value:"product",label:"Product",needs:"commerce"},{value:"popup",label:"Popup"},{value:"custom",label:"Custom URL"}];function v(e){return e.offersCommerce&&e.offersService?F:F.filter(t=>!t.needs||(t.needs==="commerce"?e.offersCommerce:e.offersService))}var Z="#popup:";function Fe(e){return`${Z}${e}`}function ve(e){return e.startsWith(Z)&&e.slice(Z.length).trim()||null}function b(e){return e===Ie?"/":`/${e}`}function R(e){return`/journal/${e}`}function N(e){return`/wheels/${e}`}function C(e,t){return`${b(e)}#${t}`}function M(...e){let t=new Set,n=[];for(let r of e)for(let o of r?.content??[]){let s=_e(o?.props?.anchor);if(!s)continue;let i=q(s);!i||t.has(i)||(t.add(i),n.push({slug:i,name:s}))}return n}function Re(e){return/^\/wheels\/[^/?#]+(?:[?#].*)?$/.test(e)}var Pt=()=>({choosePage:y("Choose a page"),chooseSection:y("Choose a section"),noSections:y("No section anchors yet"),sectionHint:y("Jumps to a section on that page."),choosePost:y("Choose a post"),chooseProduct:y("Choose a product"),choosePopup:y("Choose a popup")});function K(e,t,n){if(!e)return"page";if(ve(e))return"popup";if(e.startsWith("/journal/"))return"blog";if(Re(e))return"product";if(e.includes("#")){let r=e.slice(0,e.indexOf("#"));if(r===""||r==="/"||t.includes(r))return"anchor"}return e==="/"||t.includes(e)||n&&n.listingPaths.includes(n.targetOf(e))?"page":"custom"}function Ne(e,t){let n=Pt(),r=e.pages.map(c=>({value:b(c.slug),label:c.title})),o=t?.pageOptions?t.pageOptions(r):r,s=o.map(c=>c.value),i=e.pages.map(c=>({label:c.title,options:M(...c.docs).map(u=>({value:C(c.slug,u.slug),label:u.name}))})).filter(c=>c.options.length>0),l=c=>{switch(c){case"page":return{type:"select",options:o,placeholder:n.choosePage};case"anchor":return{type:"groups",groups:i,placeholder:i.length?n.chooseSection:n.noSections};case"blog":return{type:"select",options:e.posts.map(u=>({value:R(u.slug),label:u.title||u.slug})),placeholder:n.choosePost};case"product":return{type:"select",options:e.products.map(u=>({value:u.href,label:u.name||u.href})),placeholder:n.chooseProduct};case"popup":return{type:"select",options:(e.popups??[]).map(u=>({value:Fe(u.slug),label:u.title||u.slug})),placeholder:n.choosePopup};case"custom":return{type:"text"}}},a=v(e.offers).map(c=>({value:c.value,label:y(c.label),target:l(c.value),...c.value==="anchor"?{hint:n.sectionHint}:{},...c.value==="blog"||c.value==="product"||c.value==="popup"?{hideWhenEmpty:!0}:{}}));if(!t)return{kinds:a,rules:{kindOf:c=>K(c,s),targetOf:c=>c,readFilter:()=>null,withFilter:c=>c}};let p=c=>{let u=t.withFilter(c,null);return t.listingPaths.includes(u)?u:c};return{kinds:a,rules:{kindOf:c=>K(c,s,{listingPaths:t.listingPaths,targetOf:p}),targetOf:p,readFilter:t.readFilter,withFilter:t.withFilter},filtersFor:c=>t.listingPaths.includes(c)?t.filtersFor(c):null}}var Ce=Object.freeze([]);function X(e,t){return e.length===0?e:e.filter(n=>n.kind===void 0||n.kind===t)}function Me(e,t){let n=t==="filter"?"filterOrder":"cardOrder",r=new Map;for(let o of e){let s=o[n];if(typeof s!="number"||!Number.isFinite(s))continue;let i=r.get(o.fieldKey);(i===void 0||s<i)&&r.set(o.fieldKey,s)}return o=>o?r.get(o):void 0}function Ke(e,t,n,r){let o=new Map;for(let a of n){let p=a[r];typeof p=="number"&&o.set(a.fieldKey,p)}if(o.size===0)return e;let s=[],i=[];e.forEach((a,p)=>{let c=t(a);c&&(s.push(p),i.push({item:a,index:p,order:o.get(c)}))}),i.sort((a,p)=>a.order!==void 0&&p.order!==void 0?a.order-p.order||a.index-p.index:a.order!==void 0?-1:p.order!==void 0?1:a.index-p.index);let l=[...e];return s.forEach((a,p)=>{l[a]=i[p].item}),l.every((a,p)=>a===e[p])?e:l}function $e(e){return wt(e,"filter")}var kt="collection";function Q(e,t){return{tyreSizes:{},brands:{"alloy-wheel":"brand",tyre:"brand"},finishes:{"alloy-wheel":"wheel_finish_ref"},diameters:{"alloy-wheel":"diameter",tyre:"rim_diameter"},collections:{"alloy-wheel":kt},pcds:{"alloy-wheel":"pcd"},tyreTypes:{tyre:"tire_type"},speedRatings:{tyre:"speed_rating"}}[e]?.[t]}function wt(e,t){let n=new Set(e.filter(r=>r[t]===!1).map(r=>r.fieldKey));return r=>!r||!n.has(r)}function xt(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function ze(e,t){let n=e?.[t];return xt(n)?n:null}function De(e,t,n,r){if(n==null&&r==null)return!0;let o=ze(e,t);return!(o===null||n!=null&&o<n||r!=null&&o>r)}function Ue(e){let t=e.spec?.lugs;return typeof t=="number"?t:null}var Tt={recommended:"Recommended","price-asc":"Price \xB7 low to high","price-desc":"Price \xB7 high to low",new:"Newest",name:"Name A\u2013Z"},Cr=Object.keys(Tt);var J=["tyreSizes","brands","finishes","diameters","collections","pcds","tyreTypes","speedRatings"],ee={tyreSizes:["tyre"],brands:["alloy-wheel","tyre"],finishes:["alloy-wheel"],diameters:["alloy-wheel","tyre"],collections:["alloy-wheel"],pcds:["alloy-wheel"],tyreTypes:["tyre"],speedRatings:["tyre"]},At={diameters:"tyreSizes"};function Lt(e){if(e.length===0)return[];let t=J.filter(n=>e.every(r=>ee[n].includes(r)));return t.filter(n=>{let r=At[n];return!r||!t.includes(r)})}function Ot(e){let t=new Set;for(let n of e)t.add(d(n));return[...t]}var Be={tyreSizes:[],brands:[],finishes:[],diameters:[],collections:[],pcds:[],tyreTypes:[],speedRatings:[],priceMax:null,priceMin:null,inStockOnly:!1,kind:null,sort:"recommended",page:1};function Et(e,t,n,r=null,o="fail"){let s=d(e),i=l=>o==="fail"||(l==="lugs"?s==="alloy-wheel":ee[l].includes(s));if(r!=="kind"&&t.kind&&s!==t.kind)return!1;for(let l of J){if(r===l)continue;let a=t[l];if(a.length===0||!i(l))continue;let p=a.map(String);if(!je(e,l).some(c=>p.includes(c)))return!1}if(r!=="lugs"&&t.lugs&&t.lugs.length>0&&i("lugs")){let l=Ue(e);if(l===null||!t.lugs.includes(l))return!1}return!(r!=="price"&&!De(ye(e),n,t.priceMin??null,t.priceMax)||r!=="inStock"&&t.inStockOnly&&!be(e))}var _t={tyreSizes:"Size",brands:"Brand",finishes:"Colour",diameters:"Size \xB7 diameter",collections:"Collection",pcds:"PCD \xB7 fitment",tyreTypes:"Tyre type",speedRatings:"Speed rating"};function je(e,t){switch(t){case"tyreSizes":return[...new Set(Ae(e).flatMap(me))];case"brands":return H(e)?[H(e)]:[];case"finishes":return Pe(e);case"diameters":return Se(e).map(String);case"collections":return ke(e);case"pcds":return we(e);case"tyreTypes":return xe(e);case"speedRatings":return Te(e)}}function It(e){let t=new Map;for(let n of e)for(let r of W(n))r.color&&!t.has(r.family)&&t.set(r.family,r.color);return t}function Ye(e,t,n,r=Ot(e),o=Ce,s="fail"){let i=u=>vt(u,r,o),l=It(e),p=(s==="pass"?J.filter(u=>r.some(P=>ee[u].includes(P))):Lt(r)).filter(u=>u!=="tyreSizes").filter(i).map(u=>{let P=t[u].map(String),ce=new Set,B=new Map,L=new Map;for(let f of e){let S=je(f,u);for(let h of S)ce.add(h);for(let h of new Set(S))L.set(h,(L.get(h)??0)+1);if(Et(f,t,n,u,s))for(let h of new Set(S))B.set(h,(B.get(h)??0)+1)}let ut=[...ce].map(f=>({value:f,label:u==="diameters"?`${f}\u2033`:f,count:B.get(f)??0,checked:P.includes(f),swatch:u==="finishes"?l.get(f)??null:null})).sort((f,S)=>{if(u==="diameters")return Number(f.value)-Number(S.value);let h=(L.get(S.value)??0)-(L.get(f.value)??0);return h!==0?h:f.value.localeCompare(S.value)});return{key:u,label:_t[u],options:ut}}).filter(u=>u.options.length>Ft),c=[];for(let u of p){let P=Rt(u.key,r,o);P!==void 0&&c.push({fieldKey:u.key,filterOrder:P})}return[...Ke(p,u=>u.key,c,"filterOrder")]}var Ft=1;function He(e){return e.showCollection===!1?["collections"]:[]}function vt(e,t,n){return t.length===0||n.length===0?!0:t.some(r=>$e(X(n,r))(Q(e,r)))}function Rt(e,t,n){if(n.length===0)return;let r;for(let o of t){let s=Me(X(n,o),"filter")(Q(e,o));s!==void 0&&(r===void 0||s<r)&&(r=s)}return r}var te={tyreSizes:"tyreSize",brands:"brand",finishes:"colour",diameters:"size",collections:"collection",pcds:"pcd",tyreTypes:"tyreType",speedRatings:"speed"},ne="type";var x=e=>!!e&&typeof e=="object"&&!Array.isArray(e),T=e=>x(e)&&typeof e.type=="string"&&x(e.props);var $=e=>Array.isArray(e)&&e.length>0&&e.every(T);function Nt(e){let t="";for(let n of e)t+=typeof n=="number"?`[${n}]`:t===""?n:`.${n}`;return t}function We(e,t){return t==="root"?e.root:e.components[t]}function Ve(e){return e?.fields??{}}function Ge(e,t){return Ve(We(e,t))}function qe(e,t){let n=[];return re(e,t,[],n),n}function re(e,t,n,r){for(let o of Object.keys(t)){let s=t[o];if(!s)continue;let i=[...n,o],l=e[o];if(s.type==="slot"){let a=Array.isArray(l);r.push({slot:Nt(i),segments:i,content:a?l:[],present:a})}else if(s.type==="object"&&s.objectFields&&x(l))re(l,s.objectFields,i,r);else if(s.type==="array"&&s.arrayFields&&Array.isArray(l)){let a=s.arrayFields;l.forEach((p,c)=>{x(p)&&re(p,a,[...i,c],r)})}}}function oe(e,t,n){return Mt(e,t,n).map(({slot:r,content:o})=>({slot:r,content:o}))}function z(e){let t=new TextEncoder,n=new Map(e.map(r=>[r,t.encode(r)]));return[...e].sort((r,o)=>{let s=n.get(r),i=n.get(o);if(s.length!==i.length)return s.length-i.length;for(let l=0;l<s.length;l++)if(s[l]!==i[l])return s[l]-i[l];return 0})}function Mt(e,t,n){let r=qe(e.props,Ge(t,e.type));if(n?.order!=="stored")return r;let o=z(Object.keys(e.props)),s=i=>{let l=i.present?o.indexOf(String(i.segments[0])):-1;return l<0?Number.POSITIVE_INFINITY:l};return r.map((i,l)=>({loc:i,i:l,r:s(i)})).sort((i,l)=>i.r-l.r||i.i-l.i).map(({loc:i})=>i)}var Ze=["Text","ImageBlock","ButtonBlock","Flex"];function k(){return{type:"slot",allow:[...Ze]}}var Kt=Ze.filter(e=>e!=="ButtonBlock");function Xe(){return{type:"slot",allow:[...Kt]}}var $t="boxes",Qe={CardList:{template:Xe()},Cards:{template:k()},FAQ:{template:k()},Flex:{rowTitle:{type:"slot",allow:["Text"]},content:{type:"slot"}},Footprint:{template:k()},Grid:{content:{type:"slot"}},Hero:{slides:{type:"slot",ownPictures:!0},strip:{type:"slot",allow:["Flex"]}},HeroGroup:{content:{type:"slot"}},HeroSingle:{boxes:{type:"slot",allow:["HeroGroup"]}},HeroSlide:{groups:{type:"slot",allow:["HeroGroup"]}},Logos:{logos:{type:"slot",allow:["LogoBlock"]},template:{type:"slot",allow:["LogoBlock"]}},OrderSummary:{template:k()},ProcessSteps:{[$t]:{type:"slot"},template:k()}};var zt={},Dt=null;function Ut(){let e=Object.fromEntries(Object.entries(Qe).map(([t,n])=>[t,{fields:n}]));return Dt??={components:{...e,...zt}}}function Bt(e){let t=e.props??{},n=typeof e.type=="string"?e.type:"",r=Ut(),o=n!==""&&Object.prototype.hasOwnProperty.call(r.components,n)?oe({type:n,props:t},r).map(l=>l.slot).filter(l=>!l.includes(".")):[],s=o.filter(l=>$(t[l])),i=z(Object.keys(t).filter(l=>!o.includes(l)&&$(t[l])));return[...s,...i]}function Je(e,t){let n=null;for(let r of Bt(e)){let o=e.props[r],s=t(o,r);s!==o&&((n??={...e.props})[r]=s)}return n?{...e,props:n}:e}var et="FilterBlock";var tt="AlloyWheelsListing";function jt(e){let t=e??{},n=[];Array.isArray(t.content)&&n.push(t.content);for(let r of Object.values(t.zones??{}))Array.isArray(r)&&n.push(r);return n}function Yt(e){let t=[],n=(r,o)=>{let s=[r,...o];for(let i of r)T(i)&&(t.push({node:i,order:t.length,lists:s}),Je(i,l=>(n(l,s),l)))};for(let r of jt(e))n(r,[]);return t}function nt(e){return Yt(e).map(t=>t.node)}function rt(e){return j(e.trim())}var A="/wheels",D="Products";function ot(e,t){return t>1?`${D} \xB7 ${e}`:D}function se(...e){for(let t of[tt,et])for(let n of e){let r=nt({content:n?.content}).find(o=>o.type===t);if(r)return r.props??{}}return null}function U(...e){return se(...e)!==null}function st(e,t){let n=e.filter(r=>U(...r.docs)).map(r=>b(r.slug));return t.fallback&&!n.includes(A)?[...n,A]:n}var ie=[ne,...Object.entries(te).filter(([e])=>e!=="tyreSizes").map(([,e])=>e)];function it(e){let t=e.indexOf("#"),n=t===-1?"":e.slice(t),r=t===-1?e:e.slice(0,t),o=r.indexOf("?");return{path:o===-1?r:r.slice(0,o),query:o===-1?"":r.slice(o+1),hash:n}}function Ht(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return e}}function lt(e){let t=new URLSearchParams(it(e).query);for(let n of ie){let r=t.get(n);if(r)return{param:n,value:r}}return null}function le(e,t){let{path:n,query:r,hash:o}=it(e),s=r.split("&").filter(i=>i&&!ie.includes(Ht(i.split("=")[0])));return t?.value&&s.push(`${encodeURIComponent(t.param)}=${encodeURIComponent(t.value)}`),`${n}${s.length?`?${s.join("&")}`:""}${o}`}function at(e,t){let n=le(e,null);return t.includes(n)?n:e}function Wt(e,t,n=[]){return K(e,t,{listingPaths:n,targetOf:r=>at(r,n)})}function Vt(e){return Array.isArray(e)?e.filter(t=>typeof t?.kind=="string"&&typeof t.field_key=="string").map(t=>({kind:t.kind,fieldKey:t.field_key,...typeof t.filter=="boolean"?{filter:t.filter}:{},filterOrder:t.filter_order??null})):[]}var ct="Product type",Gt="AUD";function ae(e,t){let n=t.listing??{},r=ge(n.kinds),o=e.filter(a=>r.includes(d(a))),s=He(n),i=Ye(o,Be,Gt,r,t.fieldUsage).filter(a=>!s.includes(a.key)).map(a=>({param:te[a.key],label:a.label,values:a.options.filter(p=>!p.value.includes(",")).map(p=>({value:p.value,label:p.label}))})).filter(a=>a.values.length>0),l=w.filter(a=>r.includes(a)&&o.some(p=>d(p)===a));return l.length>1&&i.unshift({param:ne,label:ct,values:l.map(a=>({value:a,label:_[a]}))}),i}function qt(e){return t=>{let n=st(t,{fallback:e.offersCommerce}),r=t.filter(o=>U(...o.docs)).length;return{listingPaths:n,pageOptions:o=>{let s=o.map(i=>{let l=t.find(a=>b(a.slug)===i.value);return l&&U(...l.docs)?{...i,label:ot(l.title,r)}:i});return r===0&&e.offersCommerce&&!s.some(i=>i.value===A)&&s.push({value:A,label:D}),s},filtersFor:o=>{if(!n.includes(o))return null;let s=t.find(i=>b(i.slug)===o);return ae(e.catalogue,{listing:s?se(...s.docs):null,fieldUsage:e.fieldUsage})},readFilter:lt,withFilter:le}}}function Zt(e){let t=qt({catalogue:e.catalogue,fieldUsage:e.fieldUsage,offersCommerce:e.offers.offersCommerce})(e.pages),n=Ne({pages:e.pages,posts:e.posts,products:e.products.map(r=>({href:N(r.slug),name:r.name||r.slug})),offers:e.offers},t);return{...n,rules:{...n.rules,isSafe:rt},filtersFor:n.filtersFor??(()=>null)}}function ns(e,t){return ae(e,t)}export{A as BUILT_IN_LISTING_PATH,F as LINK_KINDS,ie as LISTING_FILTER_PARAMS,D as LISTING_PAGE_LABEL,ct as PRODUCT_TYPE_FILTER_LABEL,C as anchorPath,Vt as fieldUsageFromAdminRows,Wt as inferLinkKind,U as isProductListingPage,rt as isSafeLink,v as linkKindsFor,Zt as linkPickerSetup,ns as listingFilterFields,se as listingNode,ot as listingPageLabel,at as listingTarget,M as pageAnchors,b as pagePath,R as postPath,st as productListingPaths,lt as readListingFilter,N as wheelPath,le as withListingFilter};
@@ -1,3 +1,3 @@
1
1
  {
2
- "efficient-web-builder": "79.1.0"
2
+ "efficient-web-builder": "80.0.0"
3
3
  }