efficient-storefront-blocks 0.134.4 → 0.135.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 (35) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/chunks/{CustomHtmlCodeWindow-PCCIJDTP.js → CustomHtmlCodeWindow-LZU74WYM.js} +1 -1
  3. package/dist/chunks/{EditorPreviewCheckout-PUHW43VL.js → EditorPreviewCheckout-FVJV7XRD.js} +1 -1
  4. package/dist/chunks/SiteEditorProvider-WDCJF3SS.js +1 -0
  5. package/dist/chunks/{chunk-UYU65XIT.js → chunk-75GXE5JB.js} +1 -1
  6. package/dist/chunks/chunk-AK2HCCZS.js +337 -0
  7. package/dist/chunks/{chunk-ITZRFN64.js → chunk-S63MCVEE.js} +1 -1
  8. package/dist/chunks/{chunk-JHEIFPET.js → chunk-VBCLGIPA.js} +1 -1
  9. package/dist/chunks/{chunk-VJSXEYRL.js → chunk-VLFGNHX5.js} +1 -1
  10. package/dist/chunks/{chunk-4HZQEMGD.js → chunk-XMX3KEE4.js} +1 -1
  11. package/dist/chunks/chunk-XSJNH2U7.js +9 -0
  12. package/dist/chunks/{chunk-GZKBN53C.js → chunk-Y3CRPIPD.js} +1 -1
  13. package/dist/chunks/{fitment-data-OO37TN7S.js → fitment-data-UPS55DR5.js} +1 -1
  14. package/dist/chunks/{section-css-style-K25L45AT.js → section-css-style-VSIE7KKW.js} +1 -1
  15. package/dist/index.js +23 -23
  16. package/dist/links.js +1 -1
  17. package/dist/render/built-with.json +1 -1
  18. package/dist/render/components/ProductGallery.js +1 -1
  19. package/dist/render/lib/api/types.d.ts +5 -0
  20. package/dist/render/lib/commerce.d.ts +4 -0
  21. package/dist/render/lib/sections/spin-sets.d.ts +8 -0
  22. package/dist/render/lib/sections/spin-sets.js +1 -1
  23. package/dist/routine-index.json +1 -1
  24. package/dist/value-index.json +1 -1
  25. package/dist/words.d.ts +2 -0
  26. package/dist/words.js +2 -2
  27. package/package.json +3 -3
  28. package/dist/chunks/SiteEditorProvider-5GQBSTAR.js +0 -1
  29. package/dist/chunks/chunk-AKNNDIRL.js +0 -9
  30. package/dist/chunks/chunk-MM7TBACQ.js +0 -337
  31. /package/dist/chunks/{chunk-YMJRKOEC.js → chunk-62AOYUOH.js} +0 -0
  32. /package/dist/chunks/{chunk-MM7TBACQ.js.LEGAL.txt → chunk-AK2HCCZS.js.LEGAL.txt} +0 -0
  33. /package/dist/chunks/{chunk-XPDSLIZ3.js → chunk-GAND7LXQ.js} +0 -0
  34. /package/dist/chunks/{chunk-DSTQVJ5G.js → chunk-RNSKQVLG.js} +0 -0
  35. /package/dist/chunks/{chunk-ITZRFN64.js.LEGAL.txt → chunk-S63MCVEE.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 W(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 H(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 H(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 Le(e){if(d(e)!=="tyre")return[];let t=m(e).sizes;return Array.isArray(t)?t.map(n=>W(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 Ae(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)=>Ae(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 F=(e,t,n,r)=>({default:e,min:t,max:n,step:r}),Wn=F(30,0,100,10),Yn=F(0,0,100,5),Hn=F(100,0,100,5);var Vn=F(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 Fe="homepage";var I=[{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?I:I.filter(t=>!t.needs||(t.needs==="commerce"?e.offersCommerce:e.offersService))}var Z="#popup:";function Ie(e){return`${Z}${e}`}function ve(e){return e.startsWith(Z)&&e.slice(Z.length).trim()||null}function b(e){return e===Fe?"/":`/${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:Ie(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"]},Lt={diameters:"tyreSizes"};function At(e){if(e.length===0)return[];let t=J.filter(n=>e.every(r=>ee[n].includes(r)));return t.filter(n=>{let r=Lt[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(Le(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 Ft(e){let t=new Map;for(let n of e)for(let r of H(n))r.color&&!t.has(r.family)&&t.set(r.family,r.color);return t}function We(e,t,n,r=Ot(e),o=Ce,s="fail"){let i=u=>vt(u,r,o),l=Ft(e),p=(s==="pass"?J.filter(u=>r.some(P=>ee[u].includes(P))):At(r)).filter(u=>u!=="tyreSizes").filter(i).map(u=>{let P=t[u].map(String),ce=new Set,B=new Map,A=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))A.set(h,(A.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=(A.get(S.value)??0)-(A.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>It),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 It=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 He(e,t){return t==="root"?e.root:e.components[t]}function Ve(e){return e?.fields??{}}function Ge(e,t){return Ve(He(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 Wt(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 Wt(e).map(t=>t.node)}function rt(e){return j(e.trim())}var L="/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(L)?[...n,L]: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 Ht(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=We(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===L)&&s.push({value:L,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{L as BUILT_IN_LISTING_PATH,I 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,Ht 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 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,3 +1,3 @@
1
1
  {
2
- "efficient-web-builder": "78.0.0"
2
+ "efficient-web-builder": "79.0.0"
3
3
  }
@@ -1 +1 @@
1
- "use client";import{jsx as o,Fragment as O,jsxs as u}from"react/jsx-runtime";import{useRef as G}from"react";import{photoLabel as N}from"./product-hero/hero-view.js";import R from"./product-hero/SpinLayer.js";import{stageControls as $,useHeldStagePhoto as I}from"./product-hero/stage-photo.js";import{DEFAULT_HERO_CLOSE_UPS_FILL as z,DEFAULT_HERO_GALLERY_GAP as F,DEFAULT_HERO_GALLERY_MARKS as B,DEFAULT_HERO_GALLERY_MODE as V,DEFAULT_HERO_GALLERY_SHOW as v,DEFAULT_HERO_IMAGE_FIT as Y,DEFAULT_HERO_PHOTO_GROUND as W,parseHeroGalleryGap as q,parseHeroCloseUpsFill as X,parseHeroGalleryMarks as Z,parseHeroGalleryMode as w,parseHeroGalleryShow as K,parseHeroImageFit as J,parseHeroPhotoGround as Q,resolveHeroImageFit as ee}from"../lib/sections/hero-gallery.js";import{spinSetFor as te}from"../lib/sections/spin-sets.js";import{productHasComposedRender as ae}from"../lib/wheels/set-mode.js";import{HideTaker as C}from"efficient-web-builder/render/components/ViewHideRoot";import{swipeEnabled as oe,swipeStep as le}from"efficient-web-builder/format/lib/hero-swipe";function ne({product:t,view:e,angleIdx:n,onSelect:c,isLight:l,onLightbox:s,galleryMode:i=V,imageFit:h=Y,style:a,takesViewHide:m=!1,spin:p=re,ground:d=W,show:g=v,marks:y=B,gap:S=F,closeUpsFill:_=z}){const b=te(p,t.slug,e.metaValue),L=se(Q(d),l),f=K(g)==="closeUps"||b?ie(e):e,E=Z(y),T=ce(e,f,X(_)),r=w(i),x=ee(J(h),ae(t)),H=o(ue,{name:t.name,view:f,wellGround:L,angleIdx:n,onSelect:c,onLightbox:s,fit:x,spinSet:b,marks:E,fillsTile:T});return r==="stacked"?o(C,{as:"div",takes:m,"data-hero-gallery":r,"data-hero-fit":x,style:a,children:f.photos.length<2&&!b?H:u(O,{children:[o(me,{name:t.name,view:f,wellGround:L,onLightbox:s,fit:x,spinSet:b,gap:q(S),fillsTile:T}),o(pe,{angleIdx:n,total:U(f),onSelect:c,children:H})]})}):u(C,{as:"div",takes:m,"data-hero-gallery":r,"data-hero-fit":x,className:r==="tiled"?"flex items-start gap-3 max-view-tablet:gap-2":void 0,style:a,children:[o("div",{className:r==="tiled"?"min-w-0 flex-1":void 0,children:H}),r!=="main"&&o(he,{name:t.name,view:f,angleIdx:n,onSelect:c,isLight:l,tiled:r==="tiled"})]})}function U(t){return t.photos.length>0?t.photos.length:t.thumbFallbackCells}const j="relative flex aspect-square items-center justify-center overflow-hidden",re={},k="sf-photo-ground-studio";function se(t,e){return t==="studio"?k:e?"bg-bg":""}function ie(t){return t.photos.length===0||t.closeUps.length===0?t:{...t,photos:[t.photos[0],...t.closeUps.map(e=>e.url)],captions:[t.captions[0],...t.closeUps.map(e=>e.title)]}}const A=()=>!1;function ce(t,e,n){if(!n||e===t)return A;const c=new Set(t.closeUps.map(l=>l.url));return(l,s)=>s>0&&l!==void 0&&c.has(l)}const M=(t,e,n)=>[t,e.metaValue,n].filter(Boolean).join(" — "),P=(t,e)=>[t,e.metaValue].filter(Boolean).join(" "),D=(t,e)=>`Open ${[t,e.metaValue].filter(Boolean).join(" ")} at full resolution`;function me({name:t,view:e,wellGround:n,onLightbox:c,fit:l,spinSet:s,gap:i,fillsTile:h=A}){const a=s?o(R,{set:s,name:P(t,e),poster:e.photos[0]}):null,m=i===F;return o("div",{"data-hero-stack":!0,className:m?"flex flex-col gap-2 max-view-tablet:hidden":"flex flex-col max-view-tablet:hidden",style:m?void 0:{gap:`${i}px`},children:e.photos.map((p,d)=>{const g=M(t,e,N(e,d));return o("div",{"data-hero-stack-photo":!0,className:[j,n].join(" "),style:{color:e.tint},children:d===0&&a?a:e.stageImage({photo:p,alt:g,label:D(t,e),onZoom:()=>c(p,g),fit:l,eager:d===0,fillsTile:h(p,d)})},p)})})}function pe({angleIdx:t,total:e,onSelect:n,children:c}){const l=G(null),s=G(null),i=oe({count:e}),h=a=>({x:a.touches[0].clientX,y:a.touches[0].clientY});return o("div",{"data-hero-phone-stage":!0,className:"view-tablet:hidden",onTouchStart:a=>{l.current=i&&a.touches.length===1?h(a):null,s.current=l.current},onTouchMove:a=>{l.current&&(a.touches.length!==1?l.current=null:s.current=h(a))},onTouchEnd:()=>{const a=l.current,m=s.current;if(l.current=null,s.current=null,!a||!m)return;const p=le(m.x-a.x,m.y-a.y,t,e);p!==t&&n(p)},children:c})}const de=6;function ue({name:t,view:e,angleIdx:n,onSelect:c,onLightbox:l,fit:s,spinSet:i,wellGround:h,marks:a,fillsTile:m=A}){const p=e.photos[Math.min(n,e.photos.length-1)],d=I(e.photos,p),g=U(e),y=g>=2,S=String(g).padStart(2,"0"),_=Math.min(n,Math.max(e.photos.length-1,0)),b=y||e.captions[_]?N(e,_):"",L=M(t,e,b),f="max-view-tablet:static",E=[`${j} max-view-tablet:col-span-2`,h].join(" ");return u("div",{className:"relative max-view-tablet:grid max-view-tablet:grid-cols-[minmax(0,1fr)_auto] max-view-tablet:items-start max-view-tablet:gap-x-3 max-view-tablet:gap-y-2",style:{color:e.tint},children:[a&&u("div",{className:`absolute left-0 top-0 z-10 flex items-center gap-3 font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.2em] text-fg ${f} max-view-tablet:min-w-0 max-view-tablet:flex-wrap max-view-tablet:gap-x-2 max-view-tablet:gap-y-1`,children:[y&&u(O,{children:[u("span",{className:"text-accent",children:[String(n+1).padStart(2,"0")," / ",S]}),o("span",{className:"text-fg-dim",children:"·"})]}),o("span",{children:t}),e.metaValue&&u(O,{children:[o("span",{className:"text-fg-dim",children:"·"}),o("span",{className:"text-accent",children:e.metaValue})]})]}),a&&y&&o("div",{className:`absolute right-5 top-5 z-10 flex gap-1 ${f}`,children:$(n,g,c).map(r=>o("button",{type:"button","aria-label":r.label,title:r.label,onClick:r.onClick,className:"flex h-7 w-7 items-center justify-center border border-fg-dim/60 text-fg transition-colors hover:border-accent hover:text-accent",children:r.glyph},r.label))}),u("div",{className:E,children:[h!==k&&["top-3 left-3","top-3 right-3","bottom-3 left-3","bottom-3 right-3"].map((r,x)=>o("span",{className:`absolute ${r} h-3 w-3 border border-fg-dim/40`,style:{borderTop:r.includes("top")?"1px solid var(--site-line)":"none",borderBottom:r.includes("bottom")?"1px solid var(--site-line)":"none",borderLeft:r.includes("left")?"1px solid var(--site-line)":"none",borderRight:r.includes("right")?"1px solid var(--site-line)":"none"}},x)),i&&_===0?o(R,{set:i,name:P(t,e),poster:e.photos[0]}):e.stageImage({photo:d,alt:L,label:D(t,e),onZoom:()=>l(d,L),fit:s,fillsTile:m(d,e.photos.indexOf(d??""))})]}),a&&u("div",{className:`absolute bottom-0 left-0 right-0 z-10 flex items-end justify-between gap-3 font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.18em] text-fg-dim ${f} max-view-tablet:col-span-2 max-view-tablet:flex-wrap`,children:[u("span",{className:"flex min-w-0 flex-col gap-1",children:[e.specCaption&&o("span",{children:e.specCaption}),e.referenceNote&&o("span",{"data-hero-reference-note":!0,children:e.referenceNote}),e.galleryHint&&o("span",{"data-hero-gallery-hint":!0,children:e.galleryHint})]}),o("span",{children:e.originCaption})]})]})}function he({name:t,view:e,angleIdx:n,onSelect:c,isLight:l,tiled:s=!1}){const i=U(e);return i<2?null:o("div",{className:s?"order-[-1] flex w-16 flex-col gap-2 max-view-tablet:w-12 max-view-tablet:gap-1":"mt-2 grid grid-cols-4 gap-2 max-view-tablet:gap-1",style:!s&&i>4?{gridTemplateColumns:`repeat(${Math.min(i,de)}, minmax(0, 1fr))`}:void 0,children:Array.from({length:i}).map((h,a)=>{const m=e.photos[a];return u("button",{type:"button",onClick:()=>c(a),"aria-label":`View ${N(e,a)}`,"aria-pressed":a===n,className:["relative flex aspect-square items-center justify-center overflow-hidden transition-colors",l?"bg-bg":"",a===n?"border border-accent":"border border-transparent hover:border-fg-dim"].join(" "),style:{color:e.tint},children:[o("span",{className:"absolute top-1.5 left-2 z-10 font-mono text-[length:var(--size-label,8px)] uppercase tracking-[0.18em] text-fg-dim",children:String(a+1).padStart(2,"0")}),e.thumbImage({photo:m,alt:`${t} — ${N(e,a)}`})]},a)})})}export{ne as default};
1
+ "use client";import{jsx as o,Fragment as O,jsxs as u}from"react/jsx-runtime";import{useRef as F}from"react";import{photoLabel as N}from"./product-hero/hero-view.js";import G from"./product-hero/SpinLayer.js";import{stageControls as $,useHeldStagePhoto as I}from"./product-hero/stage-photo.js";import{DEFAULT_HERO_CLOSE_UPS_FILL as z,DEFAULT_HERO_GALLERY_GAP as R,DEFAULT_HERO_GALLERY_MARKS as V,DEFAULT_HERO_GALLERY_MODE as B,DEFAULT_HERO_GALLERY_SHOW as Y,DEFAULT_HERO_IMAGE_FIT as v,DEFAULT_HERO_PHOTO_GROUND as W,parseHeroGalleryGap as q,parseHeroCloseUpsFill as X,parseHeroGalleryMarks as Z,parseHeroGalleryMode as K,parseHeroGalleryShow as w,parseHeroImageFit as J,parseHeroPhotoGround as Q,resolveHeroImageFit as ee}from"../lib/sections/hero-gallery.js";import{apiSpinFor as te,spinSetFor as ae}from"../lib/sections/spin-sets.js";import{productHasComposedRender as oe}from"../lib/wheels/set-mode.js";import{HideTaker as C}from"efficient-web-builder/render/components/ViewHideRoot";import{swipeEnabled as le,swipeStep as ne}from"efficient-web-builder/format/lib/hero-swipe";function re({product:t,view:e,angleIdx:n,onSelect:c,isLight:l,onLightbox:s,galleryMode:i=B,imageFit:h=v,style:a,takesViewHide:m=!1,spin:p=se,ground:d=W,show:g=Y,marks:y=V,gap:S=R,closeUpsFill:_=z}){const b=ae(p,t.slug,e.metaValue)??te(t.parts,e.metaValue),L=ie(Q(d),l),f=w(g)==="closeUps"||b?ce(e):e,E=Z(y),T=me(e,f,X(_)),r=K(i),x=ee(J(h),oe(t)),H=o(he,{name:t.name,view:f,wellGround:L,angleIdx:n,onSelect:c,onLightbox:s,fit:x,spinSet:b,marks:E,fillsTile:T});return r==="stacked"?o(C,{as:"div",takes:m,"data-hero-gallery":r,"data-hero-fit":x,style:a,children:f.photos.length<2&&!b?H:u(O,{children:[o(pe,{name:t.name,view:f,wellGround:L,onLightbox:s,fit:x,spinSet:b,gap:q(S),fillsTile:T}),o(de,{angleIdx:n,total:U(f),onSelect:c,children:H})]})}):u(C,{as:"div",takes:m,"data-hero-gallery":r,"data-hero-fit":x,className:r==="tiled"?"flex items-start gap-3 max-view-tablet:gap-2":void 0,style:a,children:[o("div",{className:r==="tiled"?"min-w-0 flex-1":void 0,children:H}),r!=="main"&&o(fe,{name:t.name,view:f,angleIdx:n,onSelect:c,isLight:l,tiled:r==="tiled"})]})}function U(t){return t.photos.length>0?t.photos.length:t.thumbFallbackCells}const j="relative flex aspect-square items-center justify-center overflow-hidden",se={},k="sf-photo-ground-studio";function ie(t,e){return t==="studio"?k:e?"bg-bg":""}function ce(t){return t.photos.length===0||t.closeUps.length===0?t:{...t,photos:[t.photos[0],...t.closeUps.map(e=>e.url)],captions:[t.captions[0],...t.closeUps.map(e=>e.title)]}}const A=()=>!1;function me(t,e,n){if(!n||e===t)return A;const c=new Set(t.closeUps.map(l=>l.url));return(l,s)=>s>0&&l!==void 0&&c.has(l)}const M=(t,e,n)=>[t,e.metaValue,n].filter(Boolean).join(" — "),P=(t,e)=>[t,e.metaValue].filter(Boolean).join(" "),D=(t,e)=>`Open ${[t,e.metaValue].filter(Boolean).join(" ")} at full resolution`;function pe({name:t,view:e,wellGround:n,onLightbox:c,fit:l,spinSet:s,gap:i,fillsTile:h=A}){const a=s?o(G,{set:s,name:P(t,e),poster:e.photos[0]}):null,m=i===R;return o("div",{"data-hero-stack":!0,className:m?"flex flex-col gap-2 max-view-tablet:hidden":"flex flex-col max-view-tablet:hidden",style:m?void 0:{gap:`${i}px`},children:e.photos.map((p,d)=>{const g=M(t,e,N(e,d));return o("div",{"data-hero-stack-photo":!0,className:[j,n].join(" "),style:{color:e.tint},children:d===0&&a?a:e.stageImage({photo:p,alt:g,label:D(t,e),onZoom:()=>c(p,g),fit:l,eager:d===0,fillsTile:h(p,d)})},p)})})}function de({angleIdx:t,total:e,onSelect:n,children:c}){const l=F(null),s=F(null),i=le({count:e}),h=a=>({x:a.touches[0].clientX,y:a.touches[0].clientY});return o("div",{"data-hero-phone-stage":!0,className:"view-tablet:hidden",onTouchStart:a=>{l.current=i&&a.touches.length===1?h(a):null,s.current=l.current},onTouchMove:a=>{l.current&&(a.touches.length!==1?l.current=null:s.current=h(a))},onTouchEnd:()=>{const a=l.current,m=s.current;if(l.current=null,s.current=null,!a||!m)return;const p=ne(m.x-a.x,m.y-a.y,t,e);p!==t&&n(p)},children:c})}const ue=6;function he({name:t,view:e,angleIdx:n,onSelect:c,onLightbox:l,fit:s,spinSet:i,wellGround:h,marks:a,fillsTile:m=A}){const p=e.photos[Math.min(n,e.photos.length-1)],d=I(e.photos,p),g=U(e),y=g>=2,S=String(g).padStart(2,"0"),_=Math.min(n,Math.max(e.photos.length-1,0)),b=y||e.captions[_]?N(e,_):"",L=M(t,e,b),f="max-view-tablet:static",E=[`${j} max-view-tablet:col-span-2`,h].join(" ");return u("div",{className:"relative max-view-tablet:grid max-view-tablet:grid-cols-[minmax(0,1fr)_auto] max-view-tablet:items-start max-view-tablet:gap-x-3 max-view-tablet:gap-y-2",style:{color:e.tint},children:[a&&u("div",{className:`absolute left-0 top-0 z-10 flex items-center gap-3 font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.2em] text-fg ${f} max-view-tablet:min-w-0 max-view-tablet:flex-wrap max-view-tablet:gap-x-2 max-view-tablet:gap-y-1`,children:[y&&u(O,{children:[u("span",{className:"text-accent",children:[String(n+1).padStart(2,"0")," / ",S]}),o("span",{className:"text-fg-dim",children:"·"})]}),o("span",{children:t}),e.metaValue&&u(O,{children:[o("span",{className:"text-fg-dim",children:"·"}),o("span",{className:"text-accent",children:e.metaValue})]})]}),a&&y&&o("div",{className:`absolute right-5 top-5 z-10 flex gap-1 ${f}`,children:$(n,g,c).map(r=>o("button",{type:"button","aria-label":r.label,title:r.label,onClick:r.onClick,className:"flex h-7 w-7 items-center justify-center border border-fg-dim/60 text-fg transition-colors hover:border-accent hover:text-accent",children:r.glyph},r.label))}),u("div",{className:E,children:[h!==k&&["top-3 left-3","top-3 right-3","bottom-3 left-3","bottom-3 right-3"].map((r,x)=>o("span",{className:`absolute ${r} h-3 w-3 border border-fg-dim/40`,style:{borderTop:r.includes("top")?"1px solid var(--site-line)":"none",borderBottom:r.includes("bottom")?"1px solid var(--site-line)":"none",borderLeft:r.includes("left")?"1px solid var(--site-line)":"none",borderRight:r.includes("right")?"1px solid var(--site-line)":"none"}},x)),i&&_===0?o(G,{set:i,name:P(t,e),poster:e.photos[0]}):e.stageImage({photo:d,alt:L,label:D(t,e),onZoom:()=>l(d,L),fit:s,fillsTile:m(d,e.photos.indexOf(d??""))})]}),a&&u("div",{className:`absolute bottom-0 left-0 right-0 z-10 flex items-end justify-between gap-3 font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.18em] text-fg-dim ${f} max-view-tablet:col-span-2 max-view-tablet:flex-wrap`,children:[u("span",{className:"flex min-w-0 flex-col gap-1",children:[e.specCaption&&o("span",{children:e.specCaption}),e.referenceNote&&o("span",{"data-hero-reference-note":!0,children:e.referenceNote}),e.galleryHint&&o("span",{"data-hero-gallery-hint":!0,children:e.galleryHint})]}),o("span",{children:e.originCaption})]})]})}function fe({name:t,view:e,angleIdx:n,onSelect:c,isLight:l,tiled:s=!1}){const i=U(e);return i<2?null:o("div",{className:s?"order-[-1] flex w-16 flex-col gap-2 max-view-tablet:w-12 max-view-tablet:gap-1":"mt-2 grid grid-cols-4 gap-2 max-view-tablet:gap-1",style:!s&&i>4?{gridTemplateColumns:`repeat(${Math.min(i,ue)}, minmax(0, 1fr))`}:void 0,children:Array.from({length:i}).map((h,a)=>{const m=e.photos[a];return u("button",{type:"button",onClick:()=>c(a),"aria-label":`View ${N(e,a)}`,"aria-pressed":a===n,className:["relative flex aspect-square items-center justify-center overflow-hidden transition-colors",l?"bg-bg":"",a===n?"border border-accent":"border border-transparent hover:border-fg-dim"].join(" "),style:{color:e.tint},children:[o("span",{className:"absolute top-1.5 left-2 z-10 font-mono text-[length:var(--size-label,8px)] uppercase tracking-[0.18em] text-fg-dim",children:String(a+1).padStart(2,"0")}),e.thumbImage({photo:m,alt:`${t} — ${N(e,a)}`})]},a)})})}export{re as default};
@@ -1356,6 +1356,11 @@ export interface components {
1356
1356
  hand?: "left" | "right" | null;
1357
1357
  axle?: "front" | "rear" | null;
1358
1358
  renderKey?: string;
1359
+ spin?: components["schemas"]["ComponentSpin"] | null;
1360
+ };
1361
+ ComponentSpin: {
1362
+ frame_count: number;
1363
+ frames: string[];
1359
1364
  };
1360
1365
  WheelVariant: {
1361
1366
  finishName: string;
@@ -6,6 +6,10 @@ export interface SetComponent {
6
6
  prices: Record<string, number | null>;
7
7
  hand?: SpareSide | null;
8
8
  axle?: SpareAxle | null;
9
+ spin?: {
10
+ frame_count: number;
11
+ frames: string[];
12
+ } | null;
9
13
  }
10
14
  export declare function orderLinesForSets(components: SetComponent[], sets: number): {
11
15
  partNumber: string;
@@ -30,6 +30,14 @@ export declare function spinAutoTurnStep(set: SpinSet, position: number, way: 1
30
30
  };
31
31
  export declare function parseSpinSets(v: unknown): SpinSets;
32
32
  export declare function spinSetFor(sets: SpinSets, productSlug: string, finishName: string | undefined): SpinSet | null;
33
+ export declare function apiSpinFor(parts: readonly {
34
+ options: Record<string, string>;
35
+ components: readonly {
36
+ spin?: {
37
+ frames: string[];
38
+ } | null;
39
+ }[];
40
+ }[], finishName: string | undefined): SpinSet | null;
33
41
  export declare function spinPreference(sets: SpinSets | undefined, productSlug: string): {
34
42
  finish: string[];
35
43
  } | null;
@@ -1 +1 @@
1
- import{resolveMedia as m}from"efficient-web-builder/render/lib/media";const h=4096,c=360,y=.9,E=!1,U=!1;function F(n){return n===!0}const S=14e3,M=1e-6,j=5e3,g=160;function R(n,t,r,e){const o=n.autoArc??g;if(a(n)&&o<c)return d(n.count,o,t,r,e*n.count/S);const i=a(n)?c:n.arc,s=t+r*e*n.count*c/(S*i);if(a(n))return{position:(s%n.count+n.count)%n.count,way:r};const u=n.count-M;return s>=u?{position:u,way:-1}:s<=0?{position:0,way:1}:{position:s,way:r}}const _=n=>Array.isArray(n)&&n.length>0&&n.every(t=>typeof t=="string"&&t.length>0),x=n=>m(n)??n,p=n=>Number.isInteger(n)&&n>0;function A(n,t){if(!n||typeof n!="object")return null;const{frame:r,cols:e,rows:o,urls:i}=n;return!p(r)||!p(e)||!p(o)||!_(i)||r*e>h||r*o>h||i.length!==Math.ceil(t/(e*o))?null:{frame:r,cols:e,rows:o,urls:i.map(x)}}function T(n){const{frames:t,count:r,startFrame:e,sheets:o}=n,i=_(t)?{count:t.length,frames:t.map(x)}:null;if(o&&typeof o=="object"&&p(r)&&typeof e=="string"&&e){const s=A(o.desktop,r),u=A(o.phone,r);if(s&&u)return{count:r,startFrame:x(e),sheets:{desktop:s,phone:u}}}return i}function b(n){if(!n||typeof n!="object")return null;const{arc:t,start:r}=n,e=T(n);if(!e)return null;if(t!==void 0){if(typeof t!="number"||!(t>0&&t<=c))return null;e.arc=t}const{autoArc:o}=n;return typeof o=="number"&&o>0&&o<=c&&(e.autoArc=o),Number.isInteger(r)&&r>=0&&r<e.count&&(e.start=r),e}function L(n){if(!n||typeof n!="object"||Array.isArray(n))return{};const t={};for(const[r,e]of Object.entries(n)){if(!e||typeof e!="object"||Array.isArray(e))continue;const o={};for(const[i,s]of Object.entries(e)){const u=b(s);u&&(o[i]=u)}Object.keys(o).length>0&&(t[r]=o)}return t}function k(n,t,r){return r?n[t]?.[r]??null:null}function w(n,t){const r=Object.keys(n?.[t]??{});return r.length>0?{finish:r}:null}function a(n){return n.arc===void 0||n.arc>=c}function d(n,t,r,e,o){const i=n*t/(2*c),s=(r%n+n)%n,u=s>n/2?s-n:s;let f=u>i?-1:u<-i?1:e,l=u+f*o;return f===1&&u<=i&&l>=i?[l,f]=[i,-1]:f===-1&&u>=-i&&l<=-i&&([l,f]=[-i,1]),{position:(l%n+n)%n,way:f}}function N(n){return a(n)?0:Math.floor(n.count/2)}function D(n){return n.start??N(n)}function I(n,t,r=!0){return r?(Math.floor(n)%t+t)%t:Math.max(0,Math.min(t-1,Math.floor(n)))}function O(n,t,r,e){const o=I(n,t,r),i=n-Math.floor(n),s=r?(o+1)%t:o+1<t?o+1:null;return e||i===0||s===null?{a:o,b:null,mix:0}:{a:o,b:s,mix:i}}function C(n,t,r){return r?n:Math.max(0,Math.min(t-1,n))}function H(n,t,r,e){return r<=0?n:n-t/r*e*y}function B(n,t){const r=n.cols*n.rows,e=t%r;return{url:n.urls[Math.floor(t/r)],col:e%n.cols,row:Math.floor(e/n.cols)}}export{g as DEFAULT_SPIN_AUTO_ARC,E as DEFAULT_SPIN_AUTO_TURN,U as DEFAULT_SPIN_HINT,j as SPIN_RESUME_MS,h as SPIN_SHEET_MAX_SIDE,S as SPIN_TURN_MS,a as isFullTurn,L as parseSpinSets,F as parseSpinSwitch,R as spinAutoTurnStep,O as spinBlend,B as spinCell,C as spinClampPosition,I as spinFrameIndex,H as spinPositionAfterDrag,w as spinPreference,k as spinSetFor,D as spinStartPosition};
1
+ import{resolveMedia as g}from"efficient-web-builder/render/lib/media";const h=4096,f=360,A=.9,E=!1,F=!1;function U(n){return n===!0}const m=14e3,y=1e-6,j=5e3,M=160;function R(n,t,r,e){const o=n.autoArc??M;if(x(n)&&o<f)return d(n.count,o,t,r,e*n.count/m);const i=x(n)?f:n.arc,s=t+r*e*n.count*f/(m*i);if(x(n))return{position:(s%n.count+n.count)%n.count,way:r};const u=n.count-y;return s>=u?{position:u,way:-1}:s<=0?{position:0,way:1}:{position:s,way:r}}const S=n=>Array.isArray(n)&&n.length>0&&n.every(t=>typeof t=="string"&&t.length>0),p=n=>g(n)??n,a=n=>Number.isInteger(n)&&n>0;function _(n,t){if(!n||typeof n!="object")return null;const{frame:r,cols:e,rows:o,urls:i}=n;return!a(r)||!a(e)||!a(o)||!S(i)||r*e>h||r*o>h||i.length!==Math.ceil(t/(e*o))?null:{frame:r,cols:e,rows:o,urls:i.map(p)}}function T(n){const{frames:t,count:r,startFrame:e,sheets:o}=n,i=S(t)?{count:t.length,frames:t.map(p)}:null;if(o&&typeof o=="object"&&a(r)&&typeof e=="string"&&e){const s=_(o.desktop,r),u=_(o.phone,r);if(s&&u)return{count:r,startFrame:p(e),sheets:{desktop:s,phone:u}}}return i}function b(n){if(!n||typeof n!="object")return null;const{arc:t,start:r}=n,e=T(n);if(!e)return null;if(t!==void 0){if(typeof t!="number"||!(t>0&&t<=f))return null;e.arc=t}const{autoArc:o}=n;return typeof o=="number"&&o>0&&o<=f&&(e.autoArc=o),Number.isInteger(r)&&r>=0&&r<e.count&&(e.start=r),e}function L(n){if(!n||typeof n!="object"||Array.isArray(n))return{};const t={};for(const[r,e]of Object.entries(n)){if(!e||typeof e!="object"||Array.isArray(e))continue;const o={};for(const[i,s]of Object.entries(e)){const u=b(s);u&&(o[i]=u)}Object.keys(o).length>0&&(t[r]=o)}return t}function k(n,t,r){return r?n[t]?.[r]??null:null}function w(n,t){if(!t)return null;for(const r of n)if(r.options.finish===t)for(const e of r.components){const o=e.spin?.frames?.filter(i=>typeof i=="string"&&i.length>0)??[];if(o.length>1)return{count:o.length,frames:o.map(p)}}return null}function D(n,t){const r=Object.keys(n?.[t]??{});return r.length>0?{finish:r}:null}function x(n){return n.arc===void 0||n.arc>=f}function d(n,t,r,e,o){const i=n*t/(2*f),s=(r%n+n)%n,u=s>n/2?s-n:s;let c=u>i?-1:u<-i?1:e,l=u+c*o;return c===1&&u<=i&&l>=i?[l,c]=[i,-1]:c===-1&&u>=-i&&l<=-i&&([l,c]=[-i,1]),{position:(l%n+n)%n,way:c}}function N(n){return x(n)?0:Math.floor(n.count/2)}function O(n){return n.start??N(n)}function I(n,t,r=!0){return r?(Math.floor(n)%t+t)%t:Math.max(0,Math.min(t-1,Math.floor(n)))}function C(n,t,r,e){const o=I(n,t,r),i=n-Math.floor(n),s=r?(o+1)%t:o+1<t?o+1:null;return e||i===0||s===null?{a:o,b:null,mix:0}:{a:o,b:s,mix:i}}function H(n,t,r){return r?n:Math.max(0,Math.min(t-1,n))}function B(n,t,r,e){return r<=0?n:n-t/r*e*A}function G(n,t){const r=n.cols*n.rows,e=t%r;return{url:n.urls[Math.floor(t/r)],col:e%n.cols,row:Math.floor(e/n.cols)}}export{M as DEFAULT_SPIN_AUTO_ARC,E as DEFAULT_SPIN_AUTO_TURN,F as DEFAULT_SPIN_HINT,j as SPIN_RESUME_MS,h as SPIN_SHEET_MAX_SIDE,m as SPIN_TURN_MS,w as apiSpinFor,x as isFullTurn,L as parseSpinSets,U as parseSpinSwitch,R as spinAutoTurnStep,C as spinBlend,G as spinCell,H as spinClampPosition,I as spinFrameIndex,B as spinPositionAfterDrag,D as spinPreference,k as spinSetFor,O as spinStartPosition};