efficient-storefront-blocks 0.91.0 → 0.92.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/chunks/{EditorPreviewCheckout-NFLTZCIQ.js → EditorPreviewCheckout-VHPWPS3N.js} +1 -1
  3. package/dist/chunks/{SiteEditorProvider-UWRLDKJS.js → SiteEditorProvider-C4HT4BT4.js} +1 -1
  4. package/dist/chunks/chunk-7L5DVQZ4.js +1 -0
  5. package/dist/chunks/chunk-PW7BA4ZJ.js +1 -0
  6. package/dist/chunks/{chunk-HRTZ7SYX.js → chunk-RAOSZKA3.js} +1 -1
  7. package/dist/chunks/chunk-S2WLJ6H2.js +388 -0
  8. package/dist/chunks/{fitment-data-6KHIA3AT.js → fitment-data-URJZ24LU.js} +1 -1
  9. package/dist/contract.js +11 -11
  10. package/dist/editor/lib/document/blocks/commerce/AlloyWheelsListing/fields.js +1 -1
  11. package/dist/editor/lib/document/blocks/commerce/index.d.ts +1 -1
  12. package/dist/editor/lib/document/blocks/service/AppointmentBooking/fields.js +1 -1
  13. package/dist/editor/lib/document/blocks/service/ContactRouting/fields.js +1 -1
  14. package/dist/editor/lib/document/blocks/service/Events/fields.js +1 -1
  15. package/dist/editor/lib/document/blocks/service/index.d.ts +1 -1
  16. package/dist/editor/lib/document/config.d.ts +2 -0
  17. package/dist/editor/lib/document/config.js +1 -1
  18. package/dist/editor/lib/storefront-editor-words.d.ts +2 -7
  19. package/dist/editor/lib/storefront-editor-words.js +1 -1
  20. package/dist/editor.css +1 -1
  21. package/dist/index.js +53 -39
  22. package/dist/links.js +1 -1
  23. package/dist/render/built-with.json +1 -1
  24. package/dist/render/components/AppointmentBooking.d.ts +2 -1
  25. package/dist/render/components/AppointmentBooking.js +1 -1
  26. package/dist/render/components/ContactRouting.d.ts +2 -1
  27. package/dist/render/components/ContactRouting.js +1 -1
  28. package/dist/render/components/Events.d.ts +3 -1
  29. package/dist/render/components/Events.js +1 -1
  30. package/dist/render/components/GridCardTemplate.d.ts +30 -1
  31. package/dist/render/components/GridCardTemplate.js +1 -1
  32. package/dist/render/components/ProductGridSection.d.ts +2 -1
  33. package/dist/render/components/ProductGridSection.js +1 -1
  34. package/dist/render/components/PublishedFooter.js +1 -1
  35. package/dist/render/components/PublishedHeader.js +1 -1
  36. package/dist/render/components/RatingBlockView.d.ts +5 -0
  37. package/dist/render/components/RatingBlockView.js +1 -0
  38. package/dist/render/components/ReviewForm.js +1 -1
  39. package/dist/render/components/TyrePlpCard.d.ts +2 -1
  40. package/dist/render/components/TyrePlpCard.js +1 -1
  41. package/dist/render/components/TyreSummaryCard.d.ts +2 -1
  42. package/dist/render/components/TyreSummaryCard.js +1 -1
  43. package/dist/render/components/WheelCardFrame.d.ts +1 -2
  44. package/dist/render/components/WheelCardFrame.js +1 -1
  45. package/dist/render/components/card-pieces/CardPicture.d.ts +1 -1
  46. package/dist/render/components/card-pieces/CardProductPicture.js +1 -1
  47. package/dist/render/components/wheels-plp/AlloyWheelsListing.d.ts +5 -14
  48. package/dist/render/components/wheels-plp/AlloyWheelsListing.js +1 -1
  49. package/dist/render/lib/api/index.d.ts +3 -1
  50. package/dist/render/lib/api/index.js +1 -1
  51. package/dist/render/lib/chrome-cache.d.ts +1 -0
  52. package/dist/render/lib/chrome-cache.js +1 -1
  53. package/dist/render/lib/content/events-featured-look.d.ts +3 -0
  54. package/dist/render/lib/content/events-featured-look.js +1 -0
  55. package/dist/render/lib/content/product-card-seed.d.ts +7 -0
  56. package/dist/render/lib/content/product-card-seed.js +1 -1
  57. package/dist/render/lib/content/rating.d.ts +1 -0
  58. package/dist/render/lib/content/rating.js +1 -0
  59. package/dist/render/lib/document/blocks/commerce/AlloyWheelsListing/meta.d.ts +6 -0
  60. package/dist/render/lib/document/blocks/commerce/AlloyWheelsListing/meta.js +1 -1
  61. package/dist/render/lib/document/blocks/commerce/AlloyWheelsListing/render.js +1 -1
  62. package/dist/render/lib/document/blocks/commerce/ProductColour/render.js +1 -1
  63. package/dist/render/lib/document/blocks/commerce/ProductEyebrow/render.js +1 -1
  64. package/dist/render/lib/document/blocks/commerce/ProductGrid/render.js +1 -1
  65. package/dist/render/lib/document/blocks/commerce/ProductPrice/render.js +1 -1
  66. package/dist/render/lib/document/blocks/commerce/ProductSpecs/render.js +1 -1
  67. package/dist/render/lib/document/blocks/service/AppointmentBooking/render.js +1 -1
  68. package/dist/render/lib/document/blocks/service/ContactRouting/render.js +1 -1
  69. package/dist/render/lib/document/blocks/service/Events/meta.d.ts +6 -0
  70. package/dist/render/lib/document/blocks/service/Events/meta.js +1 -1
  71. package/dist/render/lib/document/blocks/service/Events/render.js +1 -1
  72. package/dist/render/lib/document/blocks/service/RatingBlock/meta.d.ts +2 -1
  73. package/dist/render/lib/document/blocks/service/RatingBlock/meta.js +1 -1
  74. package/dist/render/lib/document/blocks/service/RatingBlock/render.js +1 -1
  75. package/dist/render/lib/document/card-templates.d.ts +3 -1
  76. package/dist/render/lib/document/card-templates.js +1 -1
  77. package/dist/render/lib/document/published-chrome-data.d.ts +2 -0
  78. package/dist/render/lib/document/published-chrome-data.js +1 -0
  79. package/dist/render/lib/document/render-config.d.ts +2 -0
  80. package/dist/render/lib/document/render-config.js +1 -1
  81. package/dist/render/lib/document/section-to-box-rows-detail.js +1 -1
  82. package/dist/render/lib/document/section-to-box-rows-events.d.ts +1 -0
  83. package/dist/render/lib/document/section-to-box-rows-events.js +1 -0
  84. package/dist/render/lib/document/section-to-box-rows-reviews.d.ts +2 -1
  85. package/dist/render/lib/document/section-to-box-rows-reviews.js +1 -1
  86. package/dist/render/lib/document/section-to-box-rows-service.d.ts +1 -0
  87. package/dist/render/lib/document/section-to-box-rows-service.js +1 -0
  88. package/dist/render/lib/document/section-to-box-rows-spec.js +1 -1
  89. package/dist/render/lib/sections/grid-no-hole.d.ts +1 -1
  90. package/dist/render/lib/wheels/plp-hydrate.d.ts +3 -0
  91. package/dist/render/lib/wheels/plp-hydrate.js +1 -1
  92. package/dist/words.d.ts +12 -7
  93. package/dist/words.js +4 -4
  94. package/package.json +4 -2
  95. package/dist/chunks/chunk-4VRLGKYU.js +0 -387
  96. package/dist/chunks/chunk-PHQQRGQZ.js +0 -1
  97. package/dist/chunks/chunk-YL2HPWVT.js +0 -1
  98. package/dist/render/components/wheels-plp/PlpCard.d.ts +0 -29
  99. package/dist/render/components/wheels-plp/PlpCard.js +0 -1
  100. /package/dist/chunks/{chunk-XMTQMRA3.js → chunk-JB6ISWYA.js} +0 -0
  101. /package/dist/chunks/{chunk-4VRLGKYU.js.LEGAL.txt → chunk-S2WLJ6H2.js.LEGAL.txt} +0 -0
package/dist/links.js CHANGED
@@ -1 +1 @@
1
- var h={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"],et=[...ue,"surface"];var tt={bold:h.bold.placeholder,italic:h.italic.placeholder,strike:h.strike.placeholder,code:h.code.placeholder,highlight:h.highlight.placeholder,quiet:h.quiet.placeholder,link:"link text",underline:h.underline.placeholder,sup:h.sup.placeholder,sub:h.sub.placeholder,color:"colored text",style:"styled text"};var ce=[{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 F=[{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}],pe=["highlight","quiet"],nt=ce.map(e=>e.style).filter(e=>F.some(t=>t.kind===e)).filter(e=>!pe.includes(e)),rt=[...F,{open:"*",close:"*",kind:"accent"}],ot=[...F,{open:"*",close:"*",kind:"accent"},{open:"#",close:"#",kind:"bold",notBefore:"0123456789"},{open:"[",close:"]",kind:"italic",notBefore:"(",notBeforeBlock:!0}];var it=["http","https","mailto","tel"];function $(e){if(e===""||/[\s\u0000-\u001f\u007f]/.test(e))return!1;let t=/^([a-zA-Z][a-zA-Z0-9+.-]*):/.exec(e);return!t||it.includes(t[1].toLowerCase())}var de=["width","profile","rim"];var st=/^\s*(\d{2,3})\s*\/\s*(\d{2,3})\s*[A-Za-z]*\s*(\d{2}(?:\.\d+)?)\s*$/,lt={width:[100,500],profile:[20,100],rim:[10,30]};function B(e){let t=st.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[i,a]=lt[o];return n[o]>=i&&n[o]<=a})?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 fe(e){return[_({width:e.width}),_({width:e.width,profile:e.profile}),_(e)]}var k=["alloy-wheel","tyre"],me=["alloy-wheel"],R={"alloy-wheel":"Alloy wheels",tyre:"Tyres"};var hn=k.map(e=>({value:e,label:R[e]}));function O(e){return e==null?[...me]:Array.isArray(e)?k.filter(t=>e.includes(t)):[...me]}var m=e=>e;function d(e){return m(e).kind==="tyre"?"tyre":"alloy-wheel"}function W(e){return m(e).brand??""}function ge(e){return m(e).prices??void 0}function he(e){return m(e).inStock!==!1}function ye(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 G(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 G(e).map(t=>t.family)}function H(e){if(d(e)==="tyre")return[];let t=m(e);return Array.isArray(t.categories)?t.categories:t.process?[t.process]:[]}function Se(e){return d(e)==="tyre"?[]:m(e).spec?.pcds??[]}function be(e){return d(e)!=="tyre"?[]:m(e).tyreTypes??[]}function ke(e){return d(e)!=="tyre"?[]:m(e).speedRatings??[]}function xe(e){if(d(e)!=="tyre")return[];let t=m(e).sizes;return Array.isArray(t)?t.map(n=>B(typeof n=="string"?n:null)).filter(n=>n!==null):[]}var Y=e=>typeof e=="string"&&e?e:void 0;var we=null;function Le(e,t){return t?e.replace(/\{([A-Za-z][A-Za-z0-9_]*)\}/g,(n,r)=>Object.prototype.hasOwnProperty.call(t,r)?String(t[r]):n):e}function y(e,t){let n=we?we[e]:void 0;if(typeof n=="function"){try{let r=Y(n(t??{}));if(r)return r}catch{}return Le(e,t)}return Le(Y(n)??e,t)}function q(e){return(e??"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}var E=(e,t,n,r)=>({default:e,min:t,max:n,step:r}),xn=E(30,0,100,10),wn=E(0,0,100,5),Ln=E(100,0,100,5),Tn=E(2,0,4,.5);function Te(e){return typeof e=="string"?e.trim():e&&typeof e=="object"&&typeof e.text=="string"?e.text.trim():""}var Fe="homepage";var A=[{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 I(e){return e.offersCommerce&&e.offersService?A:A.filter(t=>!t.needs||(t.needs==="commerce"?e.offersCommerce:e.offersService))}var j="#popup:";function _e(e){return`${j}${e}`}function Re(e){return e.startsWith(j)&&e.slice(j.length).trim()||null}function P(e){return e===Fe?"/":`/${e}`}function N(e){return`/journal/${e}`}function C(e){return`/wheels/${e}`}function K(e,t){return`${P(e)}#${t}`}function v(...e){let t=new Set,n=[];for(let r of e)for(let o of r?.content??[]){let i=Te(o?.props?.anchor);if(!i)continue;let a=q(i);!a||t.has(a)||(t.add(a),n.push({slug:a,name:i}))}return n}function Oe(e){return/^\/wheels\/[^/?#]+(?:[?#].*)?$/.test(e)}var at=()=>({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 D(e,t,n){if(!e)return"page";if(Re(e))return"popup";if(e.startsWith("/journal/"))return"blog";if(Oe(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 Ee(e,t){let n=at(),r=e.pages.map(s=>({value:P(s.slug),label:s.title})),o=t?.pageOptions?t.pageOptions(r):r,i=o.map(s=>s.value),a=e.pages.map(s=>({label:s.title,options:v(...s.docs).map(u=>({value:K(s.slug,u.slug),label:u.name}))})).filter(s=>s.options.length>0),p=s=>{switch(s){case"page":return{type:"select",options:o,placeholder:n.choosePage};case"anchor":return{type:"groups",groups:a,placeholder:a.length?n.chooseSection:n.noSections};case"blog":return{type:"select",options:e.posts.map(u=>({value:N(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:_e(u.slug),label:u.title||u.slug})),placeholder:n.choosePopup};case"custom":return{type:"text"}}},l=I(e.offers).map(s=>({value:s.value,label:y(s.label),target:p(s.value),...s.value==="anchor"?{hint:n.sectionHint}:{},...s.value==="blog"||s.value==="product"||s.value==="popup"?{hideWhenEmpty:!0}:{}}));if(!t)return{kinds:l,rules:{kindOf:s=>D(s,i),targetOf:s=>s,readFilter:()=>null,withFilter:s=>s}};let c=s=>{let u=t.withFilter(s,null);return t.listingPaths.includes(u)?u:s};return{kinds:l,rules:{kindOf:s=>D(s,i,{listingPaths:t.listingPaths,targetOf:c}),targetOf:c,readFilter:t.readFilter,withFilter:t.withFilter},filtersFor:s=>t.listingPaths.includes(s)?t.filtersFor(s):null}}var Ae=Object.freeze([]);function V(e,t){return e.length===0?e:e.filter(n=>n.kind===void 0||n.kind===t)}function Ie(e,t){let n=t==="filter"?"filterOrder":"cardOrder",r=new Map;for(let o of e){let i=o[n];if(typeof i!="number"||!Number.isFinite(i))continue;let a=r.get(o.fieldKey);(a===void 0||i<a)&&r.set(o.fieldKey,i)}return o=>o?r.get(o):void 0}function Ne(e,t,n,r){let o=new Map;for(let l of n){let c=l[r];typeof c=="number"&&o.set(l.fieldKey,c)}if(o.size===0)return e;let i=[],a=[];e.forEach((l,c)=>{let s=t(l);s&&(i.push(c),a.push({item:l,index:c,order:o.get(s)}))}),a.sort((l,c)=>l.order!==void 0&&c.order!==void 0?l.order-c.order||l.index-c.index:l.order!==void 0?-1:c.order!==void 0?1:l.index-c.index);let p=[...e];return i.forEach((l,c)=>{p[l]=a[c].item}),p.every((l,c)=>l===e[c])?e:p}function Ce(e){return ct(e,"filter")}var ut="collection";function Z(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":ut},pcds:{"alloy-wheel":"pcd"},tyreTypes:{tyre:"tire_type"},speedRatings:{tyre:"speed_rating"}}[e]?.[t]}function ct(e,t){let n=new Set(e.filter(r=>r[t]===!1).map(r=>r.fieldKey));return r=>!r||!n.has(r)}var Q={inStock:"In stock",outOfStock:"Out of stock",notInStockHere:"Not in stock here"};function pt(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function Ke(e,t){let n=e?.[t];return pt(n)?n:null}function ve(e,t,n,r){if(n==null&&r==null)return!0;let o=Ke(e,t);return!(o===null||n!=null&&o<n||r!=null&&o>r)}function De(e){let t=e.spec?.lugs;return typeof t=="number"?t:null}var dt={recommended:"Recommended","price-asc":"Price \xB7 low to high","price-desc":"Price \xB7 high to low",new:"Newest",name:"Name A\u2013Z"},ur=Object.keys(dt);var X=["tyreSizes","brands","finishes","diameters","collections","pcds","tyreTypes","speedRatings"],J={tyreSizes:["tyre"],brands:["alloy-wheel","tyre"],finishes:["alloy-wheel"],diameters:["alloy-wheel","tyre"],collections:["alloy-wheel"],pcds:["alloy-wheel"],tyreTypes:["tyre"],speedRatings:["tyre"]},ft={diameters:"tyreSizes"};function mt(e){if(e.length===0)return[];let t=X.filter(n=>e.every(r=>J[n].includes(r)));return t.filter(n=>{let r=ft[n];return!r||!t.includes(r)})}function gt(e){let t=new Set;for(let n of e)t.add(d(n));return[...t]}var ee={tyreSizes:[],brands:[],finishes:[],diameters:[],collections:[],pcds:[],tyreTypes:[],speedRatings:[],priceMax:null,inStockOnly:!1,kind:null,sort:"recommended",page:1};function Me(e,t,n,r=null,o="fail"){let i=d(e),a=p=>o==="fail"||(p==="lugs"?i==="alloy-wheel":J[p].includes(i));if(r!=="kind"&&t.kind&&i!==t.kind)return!1;for(let p of X){if(r===p)continue;let l=t[p];if(l.length===0||!a(p))continue;let c=l.map(String);if(!Ue(e,p).some(s=>c.includes(s)))return!1}if(r!=="lugs"&&t.lugs&&t.lugs.length>0&&a("lugs")){let p=De(e);if(p===null||!t.lugs.includes(p))return!1}return!(r!=="price"&&!ve(ge(e),n,t.priceMin??null,t.priceMax)||r!=="inStock"&&t.inStockOnly&&!he(e))}var ht={tyreSizes:"Size",brands:"Brand",finishes:"Colour",diameters:"Size \xB7 diameter",collections:"Collection",pcds:"PCD \xB7 fitment",tyreTypes:"Tyre type",speedRatings:"Speed rating"};function Ue(e,t){switch(t){case"tyreSizes":return[...new Set(xe(e).flatMap(fe))];case"brands":return W(e)?[W(e)]:[];case"finishes":return Pe(e);case"diameters":return ye(e).map(String);case"collections":return H(e);case"pcds":return Se(e);case"tyreTypes":return be(e);case"speedRatings":return ke(e)}}function yt(e){let t=new Map;for(let n of e)for(let r of G(n))r.color&&!t.has(r.family)&&t.set(r.family,r.color);return t}function ze(e,t,n,r=gt(e),o=Ae,i="fail"){let a=u=>St(u,r,o),p=yt(e),c=(i==="pass"?X.filter(u=>r.some(b=>J[u].includes(b))):mt(r)).filter(u=>u!=="tyreSizes").filter(a).map(u=>{let b=t[u].map(String),ae=new Set,z=new Map,T=new Map;for(let f of e){let S=Ue(f,u);for(let g of S)ae.add(g);for(let g of new Set(S))T.set(g,(T.get(g)??0)+1);if(Me(f,t,n,u,i))for(let g of new Set(S))z.set(g,(z.get(g)??0)+1)}let Je=[...ae].map(f=>({value:f,label:u==="diameters"?`${f}\u2033`:f,count:z.get(f)??0,checked:b.includes(f),swatch:u==="finishes"?p.get(f)??null:null})).sort((f,S)=>{if(u==="diameters")return Number(f.value)-Number(S.value);let g=(T.get(S.value)??0)-(T.get(f.value)??0);return g!==0?g:f.value.localeCompare(S.value)});return{key:u,label:ht[u],options:Je}}).filter(u=>u.options.length>Pt),s=[];for(let u of c){let b=bt(u.key,r,o);b!==void 0&&s.push({fieldKey:u.key,filterOrder:b})}return[...Ne(c,u=>u.key,s,"filterOrder")]}var Pt=1;function $e(e){return e.showCollection===!1?["collections"]:[]}function St(e,t,n){return t.length===0||n.length===0?!0:t.some(r=>Ce(V(n,r))(Z(e,r)))}function bt(e,t,n){if(n.length===0)return;let r;for(let o of t){let i=Ie(V(n,o),"filter")(Z(e,o));i!==void 0&&(r===void 0||i<r)&&(r=i)}return r}var te={tyreSizes:"tyreSize",brands:"brand",finishes:"colour",diameters:"size",collections:"collection",pcds:"pcd",tyreTypes:"tyreType",speedRatings:"speed"},ne="type";var x="FilterBlock";function Be(e){let t=e;return!!t&&typeof t=="object"&&typeof t.type=="string"&&!!t.props&&typeof t.props=="object"}function kt(e){return Object.entries(e.props??{}).filter(t=>Array.isArray(t[1])&&t[1].length>0&&t[1].every(Be))}function xt(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 We(e){let t=[],n=(r,o)=>{let i=[r,...o];for(let a of r)if(Be(a)){t.push({node:a,order:t.length,lists:i});for(let[,p]of kt(a))n(p,i)}};for(let r of xt(e))n(r,[]);return t}function w(e){return We(e).map(t=>t.node)}var re={vehicle:"My Car",process:"Process",size:"Size",lugs:"Lugs",finish:"Finish",price:"Price"};var br=[{value:"inStock",label:Q.inStock},{value:"category",label:"Category"},{value:"lugs",label:re.lugs},{value:"price",label:re.price}];var He="AlloyWheelsListing";function Ye(e){return $(e.trim())}var L="/wheels",M="Products";function qe(e,t){return t>1?`${M} \xB7 ${e}`:M}function oe(...e){for(let t of[He,x])for(let n of e){let r=w({content:n?.content}).find(o=>o.type===t);if(r)return r.props??{}}return null}function U(...e){return oe(...e)!==null}function je(e,t){let n=e.filter(r=>U(...r.docs)).map(r=>P(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 Ve(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 Tt(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return e}}function Ze(e){let t=new URLSearchParams(Ve(e).query);for(let n of ie){let r=t.get(n);if(r)return{param:n,value:r}}return null}function se(e,t){let{path:n,query:r,hash:o}=Ve(e),i=r.split("&").filter(a=>a&&!ie.includes(Tt(a.split("=")[0])));return t?.value&&i.push(`${encodeURIComponent(t.param)}=${encodeURIComponent(t.value)}`),`${n}${i.length?`?${i.join("&")}`:""}${o}`}function Qe(e,t){let n=se(e,null);return t.includes(n)?n:e}function Ft(e,t,n=[]){return D(e,t,{listingPaths:n,targetOf:r=>Qe(r,n)})}function _t(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 Xe="Product type",Rt="AUD";function le(e,t){let n=t.listing??{},r=O(n.kinds),o=e.filter(l=>r.includes(d(l))),i=$e(n),a=ze(o,ee,Rt,r,t.fieldUsage).filter(l=>!i.includes(l.key)).map(l=>({param:te[l.key],label:l.label,values:l.options.filter(c=>!c.value.includes(",")).map(c=>({value:c.value,label:c.label}))})).filter(l=>l.values.length>0),p=k.filter(l=>r.includes(l)&&o.some(c=>d(c)===l));return p.length>1&&a.unshift({param:ne,label:Xe,values:p.map(l=>({value:l,label:R[l]}))}),a}function Ot(e){return t=>{let n=je(t,{fallback:e.offersCommerce}),r=t.filter(o=>U(...o.docs)).length;return{listingPaths:n,pageOptions:o=>{let i=o.map(a=>{let p=t.find(l=>P(l.slug)===a.value);return p&&U(...p.docs)?{...a,label:qe(p.title,r)}:a});return r===0&&e.offersCommerce&&!i.some(a=>a.value===L)&&i.push({value:L,label:M}),i},filtersFor:o=>{if(!n.includes(o))return null;let i=t.find(a=>P(a.slug)===o);return le(e.catalogue,{listing:i?oe(...i.docs):null,fieldUsage:e.fieldUsage})},readFilter:Ze,withFilter:se}}}function Et(e){let t=Ot({catalogue:e.catalogue,fieldUsage:e.fieldUsage,offersCommerce:e.offers.offersCommerce})(e.pages),n=Ee({pages:e.pages,posts:e.posts,products:e.products.map(r=>({href:C(r.slug),name:r.name||r.slug})),offers:e.offers},t);return{...n,rules:{...n.rules,isSafe:Ye},filtersFor:n.filtersFor??(()=>null)}}function co(e,t){return le(e,t)}export{L as BUILT_IN_LISTING_PATH,A as LINK_KINDS,ie as LISTING_FILTER_PARAMS,M as LISTING_PAGE_LABEL,Xe as PRODUCT_TYPE_FILTER_LABEL,K as anchorPath,_t as fieldUsageFromAdminRows,Ft as inferLinkKind,U as isProductListingPage,Ye as isSafeLink,I as linkKindsFor,Et as linkPickerSetup,co as listingFilterFields,oe as listingNode,qe as listingPageLabel,Qe as listingTarget,v as pageAnchors,P as pagePath,N as postPath,je as productListingPaths,Ze as readListingFilter,C as wheelPath,se as withListingFilter};
1
+ var h={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"],en=[...ue,"surface"];var nn={bold:h.bold.placeholder,italic:h.italic.placeholder,strike:h.strike.placeholder,code:h.code.placeholder,highlight:h.highlight.placeholder,quiet:h.quiet.placeholder,link:"link text",underline:h.underline.placeholder,sup:h.sup.placeholder,sub:h.sub.placeholder,color:"colored text",style:"styled text"};var ce=[{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 F=[{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}],pe=["highlight","quiet"],tn=ce.map(e=>e.style).filter(e=>F.some(n=>n.kind===e)).filter(e=>!pe.includes(e)),rn=[...F,{open:"*",close:"*",kind:"accent"}],on=[...F,{open:"*",close:"*",kind:"accent"},{open:"#",close:"#",kind:"bold",notBefore:"0123456789"},{open:"[",close:"]",kind:"italic",notBefore:"(",notBeforeBlock:!0}];var sn=["http","https","mailto","tel"];function $(e){if(e===""||/[\s\u0000-\u001f\u007f]/.test(e))return!1;let n=/^([a-zA-Z][a-zA-Z0-9+.-]*):/.exec(e);return!n||sn.includes(n[1].toLowerCase())}var de=["width","profile","rim"];var ln=/^\s*(\d{2,3})\s*\/\s*(\d{2,3})\s*[A-Za-z]*\s*(\d{2}(?:\.\d+)?)\s*$/,an={width:[100,500],profile:[20,100],rim:[10,30]};function B(e){let n=ln.exec(e??"");if(!n)return null;let t={width:Number(n[1]),profile:Number(n[2]),rim:Number(n[3])};return de.every(o=>{let[i,a]=an[o];return t[o]>=i&&t[o]<=a})?t:null}function _(e){if(e.width==null)return"";if(e.profile==null)return String(e.width);let n=`${e.width}/${e.profile}`;return e.rim==null?n:`${n} R${e.rim}`}function fe(e){return[_({width:e.width}),_({width:e.width,profile:e.profile}),_(e)]}var k=["alloy-wheel","tyre"],me=["alloy-wheel"],R={"alloy-wheel":"Alloy wheels",tyre:"Tyres"};var yt=k.map(e=>({value:e,label:R[e]}));function O(e){return e==null?[...me]:Array.isArray(e)?k.filter(n=>e.includes(n)):[...me]}var m=e=>e;function d(e){return m(e).kind==="tyre"?"tyre":"alloy-wheel"}function W(e){return m(e).brand??""}function ge(e){return m(e).prices??void 0}function he(e){return m(e).inStock!==!1}function ye(e){let n=m(e),t=d(e)==="tyre"?n.rimDiameters:n.sizes;return Array.isArray(t)?t.filter(r=>typeof r=="number"&&Number.isFinite(r)):[]}function G(e){return d(e)==="tyre"?[]:(m(e).finishes??[]).filter(n=>typeof n?.family=="string").map(n=>({family:n.family,color:n.color??null}))}function Pe(e){return G(e).map(n=>n.family)}function H(e){if(d(e)==="tyre")return[];let n=m(e);return Array.isArray(n.categories)?n.categories:n.process?[n.process]:[]}function Se(e){return d(e)==="tyre"?[]:m(e).spec?.pcds??[]}function be(e){return d(e)!=="tyre"?[]:m(e).tyreTypes??[]}function ke(e){return d(e)!=="tyre"?[]:m(e).speedRatings??[]}function xe(e){if(d(e)!=="tyre")return[];let n=m(e).sizes;return Array.isArray(n)?n.map(t=>B(typeof t=="string"?t:null)).filter(t=>t!==null):[]}var Y=e=>typeof e=="string"&&e?e:void 0;var we=null;function Le(e,n){return n?e.replace(/\{([A-Za-z][A-Za-z0-9_]*)\}/g,(t,r)=>Object.prototype.hasOwnProperty.call(n,r)?String(n[r]):t):e}function y(e,n){let t=we?we[e]:void 0;if(typeof t=="function"){try{let r=Y(t(n??{}));if(r)return r}catch{}return Le(e,n)}return Le(Y(t)??e,n)}function q(e){return(e??"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}var A=(e,n,t,r)=>({default:e,min:n,max:t,step:r}),wt=A(30,0,100,10),Lt=A(0,0,100,5),Tt=A(100,0,100,5),Ft=A(2,0,4,.5);function Te(e){return typeof e=="string"?e.trim():e&&typeof e=="object"&&typeof e.text=="string"?e.text.trim():""}var Fe="homepage";var E=[{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 I(e){return e.offersCommerce&&e.offersService?E:E.filter(n=>!n.needs||(n.needs==="commerce"?e.offersCommerce:e.offersService))}var j="#popup:";function _e(e){return`${j}${e}`}function Re(e){return e.startsWith(j)&&e.slice(j.length).trim()||null}function P(e){return e===Fe?"/":`/${e}`}function N(e){return`/journal/${e}`}function C(e){return`/wheels/${e}`}function K(e,n){return`${P(e)}#${n}`}function D(...e){let n=new Set,t=[];for(let r of e)for(let o of r?.content??[]){let i=Te(o?.props?.anchor);if(!i)continue;let a=q(i);!a||n.has(a)||(n.add(a),t.push({slug:a,name:i}))}return t}function Oe(e){return/^\/wheels\/[^/?#]+(?:[?#].*)?$/.test(e)}var un=()=>({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 v(e,n,t){if(!e)return"page";if(Re(e))return"popup";if(e.startsWith("/journal/"))return"blog";if(Oe(e))return"product";if(e.includes("#")){let r=e.slice(0,e.indexOf("#"));if(r===""||r==="/"||n.includes(r))return"anchor"}return e==="/"||n.includes(e)||t&&t.listingPaths.includes(t.targetOf(e))?"page":"custom"}function Ae(e,n){let t=un(),r=e.pages.map(s=>({value:P(s.slug),label:s.title})),o=n?.pageOptions?n.pageOptions(r):r,i=o.map(s=>s.value),a=e.pages.map(s=>({label:s.title,options:D(...s.docs).map(u=>({value:K(s.slug,u.slug),label:u.name}))})).filter(s=>s.options.length>0),p=s=>{switch(s){case"page":return{type:"select",options:o,placeholder:t.choosePage};case"anchor":return{type:"groups",groups:a,placeholder:a.length?t.chooseSection:t.noSections};case"blog":return{type:"select",options:e.posts.map(u=>({value:N(u.slug),label:u.title||u.slug})),placeholder:t.choosePost};case"product":return{type:"select",options:e.products.map(u=>({value:u.href,label:u.name||u.href})),placeholder:t.chooseProduct};case"popup":return{type:"select",options:(e.popups??[]).map(u=>({value:_e(u.slug),label:u.title||u.slug})),placeholder:t.choosePopup};case"custom":return{type:"text"}}},l=I(e.offers).map(s=>({value:s.value,label:y(s.label),target:p(s.value),...s.value==="anchor"?{hint:t.sectionHint}:{},...s.value==="blog"||s.value==="product"||s.value==="popup"?{hideWhenEmpty:!0}:{}}));if(!n)return{kinds:l,rules:{kindOf:s=>v(s,i),targetOf:s=>s,readFilter:()=>null,withFilter:s=>s}};let c=s=>{let u=n.withFilter(s,null);return n.listingPaths.includes(u)?u:s};return{kinds:l,rules:{kindOf:s=>v(s,i,{listingPaths:n.listingPaths,targetOf:c}),targetOf:c,readFilter:n.readFilter,withFilter:n.withFilter},filtersFor:s=>n.listingPaths.includes(s)?n.filtersFor(s):null}}var Ee=Object.freeze([]);function V(e,n){return e.length===0?e:e.filter(t=>t.kind===void 0||t.kind===n)}function Ie(e,n){let t=n==="filter"?"filterOrder":"cardOrder",r=new Map;for(let o of e){let i=o[t];if(typeof i!="number"||!Number.isFinite(i))continue;let a=r.get(o.fieldKey);(a===void 0||i<a)&&r.set(o.fieldKey,i)}return o=>o?r.get(o):void 0}function Ne(e,n,t,r){let o=new Map;for(let l of t){let c=l[r];typeof c=="number"&&o.set(l.fieldKey,c)}if(o.size===0)return e;let i=[],a=[];e.forEach((l,c)=>{let s=n(l);s&&(i.push(c),a.push({item:l,index:c,order:o.get(s)}))}),a.sort((l,c)=>l.order!==void 0&&c.order!==void 0?l.order-c.order||l.index-c.index:l.order!==void 0?-1:c.order!==void 0?1:l.index-c.index);let p=[...e];return i.forEach((l,c)=>{p[l]=a[c].item}),p.every((l,c)=>l===e[c])?e:p}function Ce(e){return pn(e,"filter")}var cn="collection";function Z(e,n){return{tyreSizes:{},brands:{"alloy-wheel":"brand",tyre:"brand"},finishes:{"alloy-wheel":"wheel_finish_ref"},diameters:{"alloy-wheel":"diameter",tyre:"rim_diameter"},collections:{"alloy-wheel":cn},pcds:{"alloy-wheel":"pcd"},tyreTypes:{tyre:"tire_type"},speedRatings:{tyre:"speed_rating"}}[e]?.[n]}function pn(e,n){let t=new Set(e.filter(r=>r[n]===!1).map(r=>r.fieldKey));return r=>!r||!t.has(r)}var Q={inStock:"In stock",outOfStock:"Out of stock",notInStockHere:"Not in stock here"};function dn(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function Ke(e,n){let t=e?.[n];return dn(t)?t:null}function De(e,n,t,r){if(t==null&&r==null)return!0;let o=Ke(e,n);return!(o===null||t!=null&&o<t||r!=null&&o>r)}function ve(e){let n=e.spec?.lugs;return typeof n=="number"?n:null}var fn={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(fn);var X=["tyreSizes","brands","finishes","diameters","collections","pcds","tyreTypes","speedRatings"],J={tyreSizes:["tyre"],brands:["alloy-wheel","tyre"],finishes:["alloy-wheel"],diameters:["alloy-wheel","tyre"],collections:["alloy-wheel"],pcds:["alloy-wheel"],tyreTypes:["tyre"],speedRatings:["tyre"]},mn={diameters:"tyreSizes"};function gn(e){if(e.length===0)return[];let n=X.filter(t=>e.every(r=>J[t].includes(r)));return n.filter(t=>{let r=mn[t];return!r||!n.includes(r)})}function hn(e){let n=new Set;for(let t of e)n.add(d(t));return[...n]}var ee={tyreSizes:[],brands:[],finishes:[],diameters:[],collections:[],pcds:[],tyreTypes:[],speedRatings:[],priceMax:null,inStockOnly:!1,kind:null,sort:"recommended",page:1};function Me(e,n,t,r=null,o="fail"){let i=d(e),a=p=>o==="fail"||(p==="lugs"?i==="alloy-wheel":J[p].includes(i));if(r!=="kind"&&n.kind&&i!==n.kind)return!1;for(let p of X){if(r===p)continue;let l=n[p];if(l.length===0||!a(p))continue;let c=l.map(String);if(!Ue(e,p).some(s=>c.includes(s)))return!1}if(r!=="lugs"&&n.lugs&&n.lugs.length>0&&a("lugs")){let p=ve(e);if(p===null||!n.lugs.includes(p))return!1}return!(r!=="price"&&!De(ge(e),t,n.priceMin??null,n.priceMax)||r!=="inStock"&&n.inStockOnly&&!he(e))}var yn={tyreSizes:"Size",brands:"Brand",finishes:"Colour",diameters:"Size \xB7 diameter",collections:"Collection",pcds:"PCD \xB7 fitment",tyreTypes:"Tyre type",speedRatings:"Speed rating"};function Ue(e,n){switch(n){case"tyreSizes":return[...new Set(xe(e).flatMap(fe))];case"brands":return W(e)?[W(e)]:[];case"finishes":return Pe(e);case"diameters":return ye(e).map(String);case"collections":return H(e);case"pcds":return Se(e);case"tyreTypes":return be(e);case"speedRatings":return ke(e)}}function Pn(e){let n=new Map;for(let t of e)for(let r of G(t))r.color&&!n.has(r.family)&&n.set(r.family,r.color);return n}function ze(e,n,t,r=hn(e),o=Ee,i="fail"){let a=u=>bn(u,r,o),p=Pn(e),c=(i==="pass"?X.filter(u=>r.some(b=>J[u].includes(b))):gn(r)).filter(u=>u!=="tyreSizes").filter(a).map(u=>{let b=n[u].map(String),ae=new Set,z=new Map,T=new Map;for(let f of e){let S=Ue(f,u);for(let g of S)ae.add(g);for(let g of new Set(S))T.set(g,(T.get(g)??0)+1);if(Me(f,n,t,u,i))for(let g of new Set(S))z.set(g,(z.get(g)??0)+1)}let Je=[...ae].map(f=>({value:f,label:u==="diameters"?`${f}\u2033`:f,count:z.get(f)??0,checked:b.includes(f),swatch:u==="finishes"?p.get(f)??null:null})).sort((f,S)=>{if(u==="diameters")return Number(f.value)-Number(S.value);let g=(T.get(S.value)??0)-(T.get(f.value)??0);return g!==0?g:f.value.localeCompare(S.value)});return{key:u,label:yn[u],options:Je}}).filter(u=>u.options.length>Sn),s=[];for(let u of c){let b=kn(u.key,r,o);b!==void 0&&s.push({fieldKey:u.key,filterOrder:b})}return[...Ne(c,u=>u.key,s,"filterOrder")]}var Sn=1;function $e(e){return e.showCollection===!1?["collections"]:[]}function bn(e,n,t){return n.length===0||t.length===0?!0:n.some(r=>Ce(V(t,r))(Z(e,r)))}function kn(e,n,t){if(t.length===0)return;let r;for(let o of n){let i=Ie(V(t,o),"filter")(Z(e,o));i!==void 0&&(r===void 0||i<r)&&(r=i)}return r}var ne={tyreSizes:"tyreSize",brands:"brand",finishes:"colour",diameters:"size",collections:"collection",pcds:"pcd",tyreTypes:"tyreType",speedRatings:"speed"},te="type";var x="FilterBlock";function Be(e){let n=e;return!!n&&typeof n=="object"&&typeof n.type=="string"&&!!n.props&&typeof n.props=="object"}function xn(e){return Object.entries(e.props??{}).filter(n=>Array.isArray(n[1])&&n[1].length>0&&n[1].every(Be))}function wn(e){let n=e??{},t=[];Array.isArray(n.content)&&t.push(n.content);for(let r of Object.values(n.zones??{}))Array.isArray(r)&&t.push(r);return t}function We(e){let n=[],t=(r,o)=>{let i=[r,...o];for(let a of r)if(Be(a)){n.push({node:a,order:n.length,lists:i});for(let[,p]of xn(a))t(p,i)}};for(let r of wn(e))t(r,[]);return n}function w(e){return We(e).map(n=>n.node)}var re={vehicle:"My Car",process:"Process",size:"Size",lugs:"Lugs",finish:"Finish",price:"Price"};var kr=[{value:"inStock",label:Q.inStock},{value:"category",label:"Category"},{value:"lugs",label:re.lugs},{value:"price",label:re.price}];var He="AlloyWheelsListing";function Ye(e){return $(e.trim())}var L="/wheels",M="Products";function qe(e,n){return n>1?`${M} \xB7 ${e}`:M}function oe(...e){for(let n of[He,x])for(let t of e){let r=w({content:t?.content}).find(o=>o.type===n);if(r)return r.props??{}}return null}function U(...e){return oe(...e)!==null}function je(e,n){let t=e.filter(r=>U(...r.docs)).map(r=>P(r.slug));return n.fallback&&!t.includes(L)?[...t,L]:t}var ie=[te,...Object.entries(ne).filter(([e])=>e!=="tyreSizes").map(([,e])=>e)];function Ve(e){let n=e.indexOf("#"),t=n===-1?"":e.slice(n),r=n===-1?e:e.slice(0,n),o=r.indexOf("?");return{path:o===-1?r:r.slice(0,o),query:o===-1?"":r.slice(o+1),hash:t}}function _n(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return e}}function Ze(e){let n=new URLSearchParams(Ve(e).query);for(let t of ie){let r=n.get(t);if(r)return{param:t,value:r}}return null}function se(e,n){let{path:t,query:r,hash:o}=Ve(e),i=r.split("&").filter(a=>a&&!ie.includes(_n(a.split("=")[0])));return n?.value&&i.push(`${encodeURIComponent(n.param)}=${encodeURIComponent(n.value)}`),`${t}${i.length?`?${i.join("&")}`:""}${o}`}function Qe(e,n){let t=se(e,null);return n.includes(t)?t:e}function Rn(e,n,t=[]){return v(e,n,{listingPaths:t,targetOf:r=>Qe(r,t)})}function On(e){return Array.isArray(e)?e.filter(n=>typeof n?.kind=="string"&&typeof n.field_key=="string").map(n=>({kind:n.kind,fieldKey:n.field_key,...typeof n.filter=="boolean"?{filter:n.filter}:{},filterOrder:n.filter_order??null})):[]}var Xe="Product type",An="AUD";function le(e,n){let t=n.listing??{},r=O(t.kinds),o=e.filter(l=>r.includes(d(l))),i=$e(t),a=ze(o,ee,An,r,n.fieldUsage).filter(l=>!i.includes(l.key)).map(l=>({param:ne[l.key],label:l.label,values:l.options.filter(c=>!c.value.includes(",")).map(c=>({value:c.value,label:c.label}))})).filter(l=>l.values.length>0),p=k.filter(l=>r.includes(l)&&o.some(c=>d(c)===l));return p.length>1&&a.unshift({param:te,label:Xe,values:p.map(l=>({value:l,label:R[l]}))}),a}function En(e){return n=>{let t=je(n,{fallback:e.offersCommerce}),r=n.filter(o=>U(...o.docs)).length;return{listingPaths:t,pageOptions:o=>{let i=o.map(a=>{let p=n.find(l=>P(l.slug)===a.value);return p&&U(...p.docs)?{...a,label:qe(p.title,r)}:a});return r===0&&e.offersCommerce&&!i.some(a=>a.value===L)&&i.push({value:L,label:M}),i},filtersFor:o=>{if(!t.includes(o))return null;let i=n.find(a=>P(a.slug)===o);return le(e.catalogue,{listing:i?oe(...i.docs):null,fieldUsage:e.fieldUsage})},readFilter:Ze,withFilter:se}}}function In(e){let n=En({catalogue:e.catalogue,fieldUsage:e.fieldUsage,offersCommerce:e.offers.offersCommerce})(e.pages),t=Ae({pages:e.pages,posts:e.posts,products:e.products.map(r=>({href:C(r.slug),name:r.name||r.slug})),offers:e.offers},n);return{...t,rules:{...t.rules,isSafe:Ye},filtersFor:t.filtersFor??(()=>null)}}function fo(e,n){return le(e,n)}export{L as BUILT_IN_LISTING_PATH,E as LINK_KINDS,ie as LISTING_FILTER_PARAMS,M as LISTING_PAGE_LABEL,Xe as PRODUCT_TYPE_FILTER_LABEL,K as anchorPath,On as fieldUsageFromAdminRows,Rn as inferLinkKind,U as isProductListingPage,Ye as isSafeLink,I as linkKindsFor,In as linkPickerSetup,fo as listingFilterFields,oe as listingNode,qe as listingPageLabel,Qe as listingTarget,D as pageAnchors,P as pagePath,N as postPath,je as productListingPaths,Ze as readListingFilter,C as wheelPath,se as withListingFilter};
@@ -1,3 +1,3 @@
1
1
  {
2
- "efficient-web-builder": "59.1.0"
2
+ "efficient-web-builder": "59.3.0"
3
3
  }
@@ -9,6 +9,7 @@ export interface AppointmentBookingProps {
9
9
  boxes?: SlotComponent;
10
10
  inBoxes?: boolean;
11
11
  nodeId?: string;
12
+ omitHead?: boolean;
12
13
  }
13
14
  export default function AppointmentBooking(props?: AppointmentBookingProps): import("react").JSX.Element;
14
- export declare function AppointmentBookingBody({ eyebrow, heading, intro, buttonLabel, successMessage, boxes: Boxes, inBoxes, }: AppointmentBookingProps): import("react").JSX.Element;
15
+ export declare function AppointmentBookingBody({ eyebrow, heading, intro, buttonLabel, successMessage, boxes: Boxes, inBoxes, omitHead, }: AppointmentBookingProps): import("react").JSX.Element;
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as i}from"react/jsx-runtime";import{BookingFormProvider as b,useBookingForm as k}from"./booking/BookingFormState.js";import{useBookingPreview as N}from"efficient-web-builder/render/lib/document/booking-preview";import{say as o}from"efficient-web-builder/format/lib/editor-words";import{BookingChoose as w,BookingConfirmed as B,BookingDetails as y,BookingHead as A}from"./booking/BookingRegions.js";import{HideTaker as p}from"efficient-web-builder/render/components/ViewHideRoot";function C(t={}){const n=N();return e(b,{editing:t.editing,previewConfirmation:!!t.nodeId&&n===t.nodeId,children:e(_,{...t})})}const g="mx-auto max-w-[var(--sf-site-width,1600px)] px-[min(24px,var(--sf-site-gutter,40px))] py-16 view-wide:px-[var(--sf-site-gutter,40px)] view-wide:py-[88px]",s="grid gap-8 min-[960px]:grid-cols-[minmax(0,1fr)_minmax(360px,0.8fr)] min-[960px]:gap-12";function _({eyebrow:t,heading:n,intro:f,buttonLabel:u,successMessage:x,boxes:r,inBoxes:v=!1}){const{fieldPrefix:D,editing:h,services:m,currency:I,serviceId:L,setServiceId:P,requiresPayment:j,date:T,earliestDate:z,setDate:E,setDateTouched:F,availability:M,loadingSlots:H,noSlotsMessage:R,selectedStart:$,setSelectedStart:q,customerTimezone:G,name:O,setName:J,email:K,setEmail:Q,phone:U,setPhone:V,notes:W,setNotes:X,confirmation:c,submitting:Y,error:Z,canSubmit:ee,handleSubmit:l,sample:S}=k(),d=S?e("p",{className:"mb-6 font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",role:"status",children:o("Example form — add an active service in {place}.",{place:o("Storefront → Booking Services")})}):null,a=m===void 0?e("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Loading appointments…"}):m?.length===0?e("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",role:"status",children:h?o("Add an active service in {place}.",{place:o("Storefront → Booking Services")}):"Appointments are not available right now."}):null;return v&&r?e(p,{as:"section",className:"relative z-[2] border-t border-line bg-surface",children:i("div",{className:g,children:[d,c?e(r,{className:`${s} items-start`}):i("form",{onSubmit:l,children:[e(r,{className:`${s} items-start`}),a]})]})}):e(p,{as:"section",className:"relative z-[2] border-t border-line bg-surface",children:i("div",{className:g,children:[d,e(A,{eyebrow:t,heading:n,intro:f}),c?e(B,{successMessage:x}):a||i("form",{onSubmit:l,className:s,children:[e(w,{}),e(y,{buttonLabel:u})]})]})})}export{_ as AppointmentBookingBody,C as default};
1
+ "use client";import{jsx as e,jsxs as i}from"react/jsx-runtime";import{BookingFormProvider as N,useBookingForm as B}from"./booking/BookingFormState.js";import{useBookingPreview as w}from"efficient-web-builder/render/lib/document/booking-preview";import{say as o}from"efficient-web-builder/format/lib/editor-words";import{BookingChoose as y,BookingConfirmed as A,BookingDetails as C,BookingHead as _}from"./booking/BookingRegions.js";import{HideTaker as u}from"efficient-web-builder/render/components/ViewHideRoot";import D from"./SectionBand.js";function I(t={}){const n=w();return e(N,{editing:t.editing,previewConfirmation:!!t.nodeId&&n===t.nodeId,children:e(L,{...t})})}const m="mx-auto max-w-[var(--sf-site-width,1600px)] px-[min(24px,var(--sf-site-gutter,40px))] py-16 view-wide:px-[var(--sf-site-gutter,40px)] view-wide:py-[88px]",c="grid gap-8 min-[960px]:grid-cols-[minmax(0,1fr)_minmax(360px,0.8fr)] min-[960px]:gap-12";function L({eyebrow:t,heading:n,intro:x,buttonLabel:v,successMessage:b,boxes:r,inBoxes:h=!1,omitHead:l=!1}){const{fieldPrefix:P,editing:S,services:d,currency:j,serviceId:z,setServiceId:T,requiresPayment:E,date:F,earliestDate:M,setDate:R,setDateTouched:$,availability:q,loadingSlots:G,noSlotsMessage:H,selectedStart:O,setSelectedStart:J,customerTimezone:K,name:Q,setName:U,email:V,setEmail:W,phone:X,setPhone:Y,notes:Z,setNotes:ee,confirmation:p,submitting:te,error:ie,canSubmit:oe,handleSubmit:f,sample:k}=B(),a=k?e("p",{className:"mb-6 font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",role:"status",children:o("Example form — add an active service in {place}.",{place:o("Storefront → Booking Services")})}):null,s=d===void 0?e("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Loading appointments…"}):d?.length===0?e("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",role:"status",children:S?o("Add an active service in {place}.",{place:o("Storefront → Booking Services")}):"Appointments are not available right now."}):null;if(h&&r&&!l)return e(u,{as:"section",className:"relative z-[2] border-t border-line bg-surface",children:i("div",{className:m,children:[a,p?e(r,{className:`${c} items-start`}):i("form",{onSubmit:f,children:[e(r,{className:`${c} items-start`}),s]})]})});const g=p?e(A,{successMessage:b}):s||i("form",{onSubmit:f,className:c,children:[e(y,{}),e(C,{buttonLabel:v})]});return l?i(D,{className:"relative z-[2] border-t border-line bg-surface",column:m,children:[a,g]}):e(u,{as:"section",className:"relative z-[2] border-t border-line bg-surface",children:i("div",{className:m,children:[a,e(_,{eyebrow:t,heading:n,intro:x}),g]})})}export{L as AppointmentBookingBody,I as default};
@@ -37,7 +37,8 @@ export interface ContactRoutingProps {
37
37
  initialActiveId?: string;
38
38
  onActiveChange?: (id: string) => void;
39
39
  reasonExtras?: (activeId: string) => ReactNode;
40
+ omitHead?: boolean;
40
41
  }
41
42
  export declare const fieldClass: string;
42
- export default function ContactRouting({ routingNumber, routingTagline, groups, formNumber, formHeading, metaLines, showOther, otherLabel, otherNoteTitle, otherNoteBody, buttonText, consent, channels, formSlug, form: injectedForm, editing, initialActiveId, onActiveChange, reasonExtras, }: ContactRoutingProps): import("react").JSX.Element;
43
+ export default function ContactRouting({ routingNumber, routingTagline, groups, formNumber, formHeading, metaLines, showOther, otherLabel, otherNoteTitle, otherNoteBody, buttonText, consent, channels, formSlug, form: injectedForm, editing, initialActiveId, onActiveChange, reasonExtras, omitHead, }: ContactRoutingProps): import("react").JSX.Element;
43
44
  export {};
@@ -1 +1 @@
1
- "use client";import{jsx as n,jsxs as i,Fragment as ne}from"react/jsx-runtime";import te from"./SectionBand.js";import{usePeekViewHide as ae,useTakeViewHide as re,withViewHide as le}from"efficient-web-builder/render/components/ViewHideRoot";import{useEffect as H,useState as q}from"react";import{useRootIsDark as oe}from"efficient-shell/theme";import{OTHER_REASON_ID as h}from"efficient-web-builder/format/lib/content/contact";import{FormFieldInput as ie,FormHoneypot as se,successMessageFor as ce,useBoundForm as de,useFormSubmission as me}from"./formSubmission.js";import pe from"efficient-web-builder/render/components/SectionEyebrow";import fe,{FieldCaption as ue}from"./WebFormField.js";import{scrollBehavior as be}from"efficient-web-builder/render/components/useReducedMotion";import{renderChrome as X,renderGold as $,renderHeadline as xe,splitParagraphs as ge}from"efficient-web-builder/render/components/goldPhrases";import{say as j}from"efficient-web-builder/format/lib/editor-words";import{phoneHref as he}from"efficient-web-builder/format/lib/links/phone-href";import{PART_ROW_ATTR as ve,encodePartRow as ye}from"efficient-web-builder/render/lib/document/text-parts";const t={bodySmall:"text-[length:var(--size-body,14px)]",body:"text-[length:var(--size-body,15px)]",bodyLarge:"text-[length:var(--size-body,18px)]",headingSmall1:"text-[length:var(--size-headingSmall,24px)]",headingSmall2:"text-[length:var(--size-headingSmall,26px)]",labelSmall:"text-[length:var(--size-label,12px)]",labelLarge:"text-[length:var(--size-label,13px)]",labelXl:"text-[length:var(--size-label,14px)]"},_={label:"Label",value:"Value",sub:"Sub line"};function ke(s,r){return s.map((l,a)=>r?{...l,at:a,label:l.label||j(_.label),value:l.value||j(_.value),sub:l.sub||j(_.sub)}:{...l,at:a}).filter(l=>!l.hidden)}function A(s,r){return r?{[ve]:ye("channels",s.at)}:{}}function B(s){if(s.href)return s.href;const r=(s.value??"").trim();if(r.includes("@"))return`mailto:${r}`;if(/^\+?[\d\s().-]{6,}$/.test(r))return he(r)}function we(s){const r=[],l=new Map;for(const a of s){if(!a.groupId){r.push(a);continue}const p=a.value.trim().toLowerCase(),b=l.get(p);if(b)b.label=`${b.label} · ${a.label}`;else{const x={...a};l.set(p,x),r.push(x)}}return r}function Ne(s,r,l){const a=p=>String(p??"").trim().toLowerCase();for(const p of s?.fields??[]){if(p.type!=="select"||!Array.isArray(p.options))continue;const b=p.options.map(String);if(!r.some(c=>b.some(f=>a(f)===a(c.title))))continue;const x=c=>a(c===h?l:r.find(f=>f.id===c)?.title);return{key:p.key,optionFor:c=>b.find(f=>a(f)===x(c)&&x(c)!==""),idFor:c=>{const f=r.find(S=>a(S.title)===a(c));return f?f.id:l&&a(c)===a(l)?h:void 0}}}return null}const D=`border-b border-line bg-transparent py-4 font-display ${t.bodyLarge} tracking-[0.01em] text-fg outline-none transition-colors focus:border-accent`;function Se({routingNumber:s,routingTagline:r,groups:l,formNumber:a,formHeading:p,metaLines:b,showOther:x=!0,otherLabel:c="Other",otherNoteTitle:f,otherNoteBody:S,buttonText:E,consent:M,channels:W,formSlug:O,form:G,editing:v,initialActiveId:y,onActiveChange:P,reasonExtras:U}){const w=[...l.map(e=>e.id),...x?[h]:[]],Z=y&&w.includes(y)?y:w[0]??h,[g,C]=q(Z);H(()=>{w.includes(g)||C(w[0]??h)},[w.join("|")]),H(()=>{y&&w.includes(y)&&C(y)},[y]);const k=de(O,G),d=me({form:k,formSlug:O,editing:v}),u=Ne(k,l,x?c:void 0),R=e=>{C(e),z(null);const o=u?.optionFor(e);u&&o!==void 0&&d.set(u.key,o),P?.(e)};H(()=>{if(!u||d.valueOf(u.key))return;const e=u.optionFor(g);e!==void 0&&d.set(u.key,e)},[u?.key]);const[V,z]=q(null),N=ke(W??[],!!v),J=e=>V!==null?!e.groupId&&e.value===V:e.groupId===g,K=k===void 0,I=!!k||!!v,Q=!oe({whenUnset:!0}),L=l.length>0||!!v,Y=ae(),T=re();return i(ne,{children:[L&&i(te,{className:"border-b border-line py-[60px]",style:Q?void 0:{background:"var(--section-bg)"},children:[(s||r)&&i("div",{className:"mb-6 flex items-center gap-6 border-b border-line pb-6",children:[s&&n(pe,{text:s}),r&&n("span",{className:`font-display ${t.bodySmall} uppercase tracking-[0.04em] text-fg-dim`,children:$(r)})]}),n("div",{className:"sf-card grid grid-cols-4 gap-[2px] border border-line bg-line max-view-desktop:grid-cols-2 max-[700px]:grid-cols-1",children:l.map(e=>{const o=g===e.id;return i("button",{type:"button",onClick:()=>{R(e.id),typeof window<"u"&&window.matchMedia("(max-width: 1100px)").matches&&document.getElementById("contact-form")?.scrollIntoView({behavior:be(),block:"start"})},className:["flex min-h-[240px] cursor-pointer flex-col gap-4 px-8 py-10 text-left transition-colors",o?"bg-surface outline outline-2 -outline-offset-2 outline-accent":"bg-bg hover:bg-surface"].join(" "),children:[e.eyebrow&&n("span",{className:`font-mono ${t.labelSmall} uppercase tracking-[0.24em] text-accent`,children:e.eyebrow}),n("h3",{className:`whitespace-pre-line font-heading3 ${t.headingSmall2} font-medium uppercase leading-[1.05] tracking-[-0.02em]`,children:e.title}),e.copy&&n("p",{className:`mt-auto font-display ${t.bodySmall} leading-[1.5] text-fg-dim`,children:e.copy}),e.response&&i("div",{className:`mt-2 flex justify-between border-t border-line pt-4 font-mono ${t.labelSmall} uppercase tracking-[0.22em] text-fg-dim`,children:[n("span",{children:"Response"}),n("strong",{className:"font-normal text-fg",children:e.response})]})]},e.id)})})]}),(I||N.length>0)&&T.scope(n("section",{id:"contact-form",className:le("scroll-mt-[80px] border-b border-line py-20 max-view-desktop:py-[60px]",Y),...L?{}:T.attrs,children:i("div",{className:["mx-auto grid max-w-[var(--sf-site-width,1600px)] gap-20 px-[var(--sf-site-gutter,40px)] max-view-desktop:grid-cols-1 max-view-desktop:gap-[60px] max-view-desktop:px-[min(24px,var(--sf-site-gutter,40px))]",I&&N.length>0?"grid-cols-[1.3fr_1fr]":"grid-cols-1"].join(" "),children:[I&&i("div",{children:[i("div",{className:"mb-8 flex items-end justify-between gap-6 border-b border-line pb-6",children:[i("div",{children:[a&&n("div",{className:`pb-2 font-mono ${t.labelLarge} uppercase tracking-[0.3em] text-accent`,children:$(a)}),p&&n("h2",{className:"font-heading2 text-[length:min(var(--size-headingMedium,clamp(36px,4vw,56px)),var(--sf-heading-max,9999px))] font-medium uppercase leading-none tracking-[-0.03em]",children:xe(p,!0)})]}),!!(b&&b.length)&&n("div",{className:`text-right font-mono ${t.labelSmall} uppercase leading-[1.8] tracking-[0.22em] text-fg-dim max-[700px]:text-left`,children:b.map((e,o)=>n("div",{children:e},o))})]}),k?d.done?n("div",{className:`border border-accent bg-accent/[0.08] p-8 font-display ${t.body} leading-[1.6] text-fg-dim`,children:ce(k,"Thanks — we've received your message.")}):i("form",{className:"grid grid-cols-2 gap-5 max-[700px]:grid-cols-1",onSubmit:d.handleSubmit,children:[k.fields.map(e=>n(fe,{label:e.label,required:e.required,className:e.type==="textarea"||e.type==="checkbox"?"col-span-2 max-[700px]:col-span-1":void 0,children:n(ie,{field:e,value:d.valueOf(e.key),onChange:o=>{d.set(e.key,o);const m=u&&e.key===u.key?u.idFor(o):void 0;m!==void 0&&(C(m),z(null),P?.(m))},className:e.type==="textarea"?`${D} min-h-[140px] resize-y leading-[1.5]`:e.type==="checkbox"?"size-4 self-start accent-accent":D})},e.key)),i("div",{className:"col-span-2 flex flex-col gap-2 max-[700px]:col-span-1",children:[n(ue,{required:!0,children:"Reason"}),i("div",{className:"mt-1 flex flex-wrap gap-2",children:[l.map(e=>{const o=g===e.id;return n("button",{type:"button",onClick:()=>R(e.id),className:[`cursor-pointer border px-4 py-3 font-mono ${t.labelSmall} uppercase tracking-[0.2em] transition-colors`,o?"border-accent bg-accent text-bg":"border-line text-fg-dim hover:text-fg"].join(" "),children:e.title},e.id)}),x&&n("button",{type:"button",onClick:()=>R(h),className:[`cursor-pointer border px-4 py-3 font-mono ${t.labelSmall} uppercase tracking-[0.2em] transition-colors`,g===h?"border-accent bg-accent text-bg":"border-line text-fg-dim hover:text-fg"].join(" "),children:X(c)})]})]}),U?.(g),g===h&&(f||S)&&i("div",{className:"sf-card col-span-2 flex flex-col gap-2 border border-line bg-bg/40 p-5 max-[700px]:col-span-1",children:[f&&n("span",{className:`font-mono ${t.labelSmall} uppercase tracking-[0.24em] text-accent`,children:$(f)}),S&&ge(S).map((e,o)=>n("p",{className:`font-display ${t.body} leading-[1.55] text-fg-dim`,children:$(e)},o))]}),n(se,{value:d.honeypot,onChange:d.setHoneypot}),d.error&&n("p",{role:"alert",className:`col-span-2 font-mono ${t.labelSmall} uppercase tracking-[0.18em] text-alert max-[700px]:col-span-1`,children:d.error}),i("div",{className:"col-span-2 mt-5 flex flex-wrap items-center justify-between gap-6 border-t border-line pt-6 max-[700px]:col-span-1 max-[700px]:flex-col max-[700px]:items-stretch",children:[M&&n("span",{className:`max-w-[380px] font-mono ${t.labelSmall} uppercase leading-[1.6] tracking-[0.18em] text-fg-dim`,children:$(M)}),n("button",{type:v?"button":"submit",disabled:d.submitting,className:`cursor-pointer bg-btn px-8 py-5 font-mono ${t.labelXl} uppercase tracking-[0.32em] text-btn-ink transition-colors hover:bg-fg disabled:cursor-wait disabled:opacity-60 max-[700px]:w-full`,children:d.submitting?"Sending…":E?X(E):"Send Message →"})]})]}):n("p",{className:`font-mono ${t.labelSmall} uppercase tracking-[0.22em] text-fg-dim`,children:K?j("Loading form…"):j("Choose a form in the inspector, under Message form — until then this column is hidden on the live page and no message can be sent.")})]}),N.length>0&&n("aside",{className:"flex flex-col gap-0 max-view-desktop:hidden",children:N.map((e,o)=>{const m=J(e),F=!!!e.groupId;return i("div",{...A(e,v),onClick:F?()=>z(e.value):void 0,className:["relative flex flex-col gap-3 border-b border-line border-l-2 px-5 py-8 transition-all",F?"cursor-pointer border-t-2 border-t-accent":"",m?"border-l-accent pl-6":F?"border-l-transparent hover:bg-accent/[0.04]":"border-l-transparent"].join(" "),style:m?{background:"color-mix(in oklab, var(--accent) 8%, transparent)"}:void 0,children:[n("span",{className:[`font-mono ${t.labelSmall} uppercase tracking-[0.3em] transition-colors`,m?"text-fg":"text-accent"].join(" "),children:e.label}),F?n("a",{href:e.href,onClick:ee=>ee.stopPropagation(),className:[`font-heading3 ${t.headingSmall1} font-medium leading-[1.2] tracking-[-0.02em] transition-colors hover:text-accent`,m?"text-accent":"text-fg"].join(" "),children:e.value}):n("a",{href:B(e),className:[`font-heading3 ${t.headingSmall1} font-medium leading-[1.2] tracking-[-0.02em]`,m?"text-accent":"text-fg"].join(" "),children:e.value}),e.sub&&n("span",{className:`font-mono ${t.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,children:e.sub})]},`${e.value}-${o}`)})}),N.length>0&&n("div",{"data-contact-phone-list":!0,className:"hidden flex-col gap-0 max-view-desktop:flex",children:we(N).map((e,o)=>{const m=!!e.groupId;return i("div",{...A(e,v),className:["flex flex-col gap-3 border-b border-line px-5 py-5",m?"":"border-t-2 border-t-accent"].join(" "),children:[n("span",{className:[`font-mono ${t.labelSmall} uppercase tracking-[0.3em]`,m?"text-fg":"text-accent"].join(" "),children:e.label}),n("a",{href:B(e),className:[`font-heading3 ${t.headingSmall1} font-medium leading-[1.2] tracking-[-0.02em] [overflow-wrap:anywhere]`,m?"text-accent":"text-fg"].join(" "),children:e.value}),e.sub&&n("span",{className:`font-mono ${t.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,children:e.sub})]},`${e.value}-${o}`)})})]})}))]})}export{_ as CHANNEL_HINTS,B as channelHref,Se as default,ke as drawnChannels,D as fieldClass,we as mergeChannelsForPhone,Ne as topicFieldOf};
1
+ "use client";import{jsx as n,jsxs as s,Fragment as le}from"react/jsx-runtime";import se from"./SectionBand.js";import{HideTaker as ie,usePeekViewHide as ce,useTakeViewHide as de,withViewHide as pe}from"efficient-web-builder/render/components/ViewHideRoot";import{useEffect as H,useState as W}from"react";import{useRootIsDark as me}from"efficient-shell/theme";import{OTHER_REASON_ID as h}from"efficient-web-builder/format/lib/content/contact";import{FormFieldInput as fe,FormHoneypot as ue,successMessageFor as be,useBoundForm as xe,useFormSubmission as ge}from"./formSubmission.js";import he from"efficient-web-builder/render/components/SectionEyebrow";import{useSectionEdge as ve}from"efficient-web-builder/render/components/SiteGutterFrame";import{sectionEdgeBandAttrs as ye}from"efficient-web-builder/render/lib/content/section-edge";import ke,{FieldCaption as we}from"./WebFormField.js";import{scrollBehavior as Ne}from"efficient-web-builder/render/components/useReducedMotion";import{renderChrome as G,renderGold as $,renderHeadline as Se,splitParagraphs as $e}from"efficient-web-builder/render/components/goldPhrases";import{say as C}from"efficient-web-builder/format/lib/editor-words";import{phoneHref as Ce}from"efficient-web-builder/format/lib/links/phone-href";import{PART_ROW_ATTR as je,encodePartRow as Fe}from"efficient-web-builder/render/lib/document/text-parts";const t={bodySmall:"text-[length:var(--size-body,14px)]",body:"text-[length:var(--size-body,15px)]",bodyLarge:"text-[length:var(--size-body,18px)]",headingSmall1:"text-[length:var(--size-headingSmall,24px)]",headingSmall2:"text-[length:var(--size-headingSmall,26px)]",labelSmall:"text-[length:var(--size-label,12px)]",labelLarge:"text-[length:var(--size-label,13px)]",labelXl:"text-[length:var(--size-label,14px)]"},M={label:"Label",value:"Value",sub:"Sub line"};function Re(i,r){return i.map((o,a)=>r?{...o,at:a,label:o.label||C(M.label),value:o.value||C(M.value),sub:o.sub||C(M.sub)}:{...o,at:a}).filter(o=>!o.hidden)}function U(i,r){return r?{[je]:Fe("channels",i.at)}:{}}function Z(i){if(i.href)return i.href;const r=(i.value??"").trim();if(r.includes("@"))return`mailto:${r}`;if(/^\+?[\d\s().-]{6,}$/.test(r))return Ce(r)}function ze(i){const r=[],o=new Map;for(const a of i){if(!a.groupId){r.push(a);continue}const m=a.value.trim().toLowerCase(),b=o.get(m);if(b)b.label=`${b.label} · ${a.label}`;else{const x={...a};o.set(m,x),r.push(x)}}return r}function Ee(i,r,o){const a=m=>String(m??"").trim().toLowerCase();for(const m of i?.fields??[]){if(m.type!=="select"||!Array.isArray(m.options))continue;const b=m.options.map(String);if(!r.some(c=>b.some(f=>a(f)===a(c.title))))continue;const x=c=>a(c===h?o:r.find(f=>f.id===c)?.title);return{key:m.key,optionFor:c=>b.find(f=>a(f)===x(c)&&x(c)!==""),idFor:c=>{const f=r.find(S=>a(S.title)===a(c));return f?f.id:o&&a(c)===a(o)?h:void 0}}}return null}const J=`border-b border-line bg-transparent py-4 font-display ${t.bodyLarge} tracking-[0.01em] text-fg outline-none transition-colors focus:border-accent`;function Ie({routingNumber:i,routingTagline:r,groups:o,formNumber:a,formHeading:m,metaLines:b,showOther:x=!0,otherLabel:c="Other",otherNoteTitle:f,otherNoteBody:S,buttonText:O,consent:P,channels:K,formSlug:V,form:Q,editing:v,initialActiveId:y,onActiveChange:L,reasonExtras:Y,omitHead:j=!1}){const w=[...o.map(e=>e.id),...x?[h]:[]],ee=y&&w.includes(y)?y:w[0]??h,[g,F]=W(ee);H(()=>{w.includes(g)||F(w[0]??h)},[w.join("|")]),H(()=>{y&&w.includes(y)&&F(y)},[y]);const k=xe(V,Q),d=ge({form:k,formSlug:V,editing:v}),u=Ee(k,o,x?c:void 0),E=e=>{F(e),I(null);const l=u?.optionFor(e);u&&l!==void 0&&d.set(u.key,l),L?.(e)};H(()=>{if(!u||d.valueOf(u.key))return;const e=u.optionFor(g);e!==void 0&&d.set(u.key,e)},[u?.key]);const[T,I]=W(null),N=Re(K??[],!!v),ne=e=>T!==null?!e.groupId&&e.value===T:e.groupId===g,te=k===void 0,_=!!k||!!v,ae=!me({whenUnset:!0}),q=ve(),R=j&&q?ye(q):null,A=R?`${R.className} `:"",B=o.length>0||!!v,X=n("div",{className:"sf-card grid grid-cols-4 gap-[2px] border border-line bg-line max-view-desktop:grid-cols-2 max-[700px]:grid-cols-1",children:o.map(e=>{const l=g===e.id;return s("button",{type:"button",onClick:()=>{E(e.id),typeof window<"u"&&window.matchMedia("(max-width: 1100px)").matches&&document.getElementById("contact-form")?.scrollIntoView({behavior:Ne(),block:"start"})},className:["flex min-h-[240px] cursor-pointer flex-col gap-4 px-8 py-10 text-left transition-colors",l?"bg-surface outline outline-2 -outline-offset-2 outline-accent":"bg-bg hover:bg-surface"].join(" "),children:[e.eyebrow&&n("span",{className:`font-mono ${t.labelSmall} uppercase tracking-[0.24em] text-accent`,children:e.eyebrow}),n("h3",{className:`whitespace-pre-line font-heading3 ${t.headingSmall2} font-medium uppercase leading-[1.05] tracking-[-0.02em]`,children:e.title}),e.copy&&n("p",{className:`mt-auto font-display ${t.bodySmall} leading-[1.5] text-fg-dim`,children:e.copy}),e.response&&s("div",{className:`mt-2 flex justify-between border-t border-line pt-4 font-mono ${t.labelSmall} uppercase tracking-[0.22em] text-fg-dim`,children:[n("span",{children:"Response"}),n("strong",{className:"font-normal text-fg",children:e.response})]})]},e.id)})}),re=ce(),D=de();return s(le,{children:[B&&(j?n(ie,{as:"section",className:`${A}border-b border-line bg-surface pt-6 pb-[60px]`,style:R?.style,children:X}):s(se,{className:"border-b border-line py-[60px]",style:ae?void 0:{background:"var(--section-bg)"},children:[(i||r)&&s("div",{className:"mb-6 flex items-center gap-6 border-b border-line pb-6",children:[i&&n(he,{text:i}),r&&n("span",{className:`font-display ${t.bodySmall} uppercase tracking-[0.04em] text-fg-dim`,children:$(r)})]}),X]})),(_||N.length>0)&&D.scope(n("section",{id:"contact-form",className:pe(`${A}${j?"bg-bg ":""}scroll-mt-[80px] border-b border-line py-20 max-view-desktop:py-[60px]`,re),style:R?.style,...B?{}:D.attrs,children:s("div",{className:[j?"grid gap-20 max-view-desktop:grid-cols-1 max-view-desktop:gap-[60px]":"mx-auto grid max-w-[var(--sf-site-width,1600px)] gap-20 px-[var(--sf-site-gutter,40px)] max-view-desktop:grid-cols-1 max-view-desktop:gap-[60px] max-view-desktop:px-[min(24px,var(--sf-site-gutter,40px))]",_&&N.length>0?"grid-cols-[1.3fr_1fr]":"grid-cols-1"].join(" "),children:[_&&s("div",{children:[s("div",{className:"mb-8 flex items-end justify-between gap-6 border-b border-line pb-6",children:[s("div",{children:[a&&n("div",{className:`pb-2 font-mono ${t.labelLarge} uppercase tracking-[0.3em] text-accent`,children:$(a)}),m&&n("h2",{className:"font-heading2 text-[length:min(var(--size-headingMedium,clamp(36px,4vw,56px)),var(--sf-heading-max,9999px))] font-medium uppercase leading-none tracking-[-0.03em]",children:Se(m,!0)})]}),!!(b&&b.length)&&n("div",{className:`text-right font-mono ${t.labelSmall} uppercase leading-[1.8] tracking-[0.22em] text-fg-dim max-[700px]:text-left`,children:b.map((e,l)=>n("div",{children:e},l))})]}),k?d.done?n("div",{className:`border border-accent bg-accent/[0.08] p-8 font-display ${t.body} leading-[1.6] text-fg-dim`,children:be(k,"Thanks — we've received your message.")}):s("form",{className:"grid grid-cols-2 gap-5 max-[700px]:grid-cols-1",onSubmit:d.handleSubmit,children:[k.fields.map(e=>n(ke,{label:e.label,required:e.required,className:e.type==="textarea"||e.type==="checkbox"?"col-span-2 max-[700px]:col-span-1":void 0,children:n(fe,{field:e,value:d.valueOf(e.key),onChange:l=>{d.set(e.key,l);const p=u&&e.key===u.key?u.idFor(l):void 0;p!==void 0&&(F(p),I(null),L?.(p))},className:e.type==="textarea"?`${J} min-h-[140px] resize-y leading-[1.5]`:e.type==="checkbox"?"size-4 self-start accent-accent":J})},e.key)),s("div",{className:"col-span-2 flex flex-col gap-2 max-[700px]:col-span-1",children:[n(we,{required:!0,children:"Reason"}),s("div",{className:"mt-1 flex flex-wrap gap-2",children:[o.map(e=>{const l=g===e.id;return n("button",{type:"button",onClick:()=>E(e.id),className:[`cursor-pointer border px-4 py-3 font-mono ${t.labelSmall} uppercase tracking-[0.2em] transition-colors`,l?"border-accent bg-accent text-bg":"border-line text-fg-dim hover:text-fg"].join(" "),children:e.title},e.id)}),x&&n("button",{type:"button",onClick:()=>E(h),className:[`cursor-pointer border px-4 py-3 font-mono ${t.labelSmall} uppercase tracking-[0.2em] transition-colors`,g===h?"border-accent bg-accent text-bg":"border-line text-fg-dim hover:text-fg"].join(" "),children:G(c)})]})]}),Y?.(g),g===h&&(f||S)&&s("div",{className:"sf-card col-span-2 flex flex-col gap-2 border border-line bg-bg/40 p-5 max-[700px]:col-span-1",children:[f&&n("span",{className:`font-mono ${t.labelSmall} uppercase tracking-[0.24em] text-accent`,children:$(f)}),S&&$e(S).map((e,l)=>n("p",{className:`font-display ${t.body} leading-[1.55] text-fg-dim`,children:$(e)},l))]}),n(ue,{value:d.honeypot,onChange:d.setHoneypot}),d.error&&n("p",{role:"alert",className:`col-span-2 font-mono ${t.labelSmall} uppercase tracking-[0.18em] text-alert max-[700px]:col-span-1`,children:d.error}),s("div",{className:"col-span-2 mt-5 flex flex-wrap items-center justify-between gap-6 border-t border-line pt-6 max-[700px]:col-span-1 max-[700px]:flex-col max-[700px]:items-stretch",children:[P&&n("span",{className:`max-w-[380px] font-mono ${t.labelSmall} uppercase leading-[1.6] tracking-[0.18em] text-fg-dim`,children:$(P)}),n("button",{type:v?"button":"submit",disabled:d.submitting,className:`cursor-pointer bg-btn px-8 py-5 font-mono ${t.labelXl} uppercase tracking-[0.32em] text-btn-ink transition-colors hover:bg-fg disabled:cursor-wait disabled:opacity-60 max-[700px]:w-full`,children:d.submitting?"Sending…":O?G(O):"Send Message →"})]})]}):n("p",{className:`font-mono ${t.labelSmall} uppercase tracking-[0.22em] text-fg-dim`,children:te?C("Loading form…"):C("Choose a form in the inspector, under Message form — until then this column is hidden on the live page and no message can be sent.")})]}),N.length>0&&n("aside",{className:"flex flex-col gap-0 max-view-desktop:hidden",children:N.map((e,l)=>{const p=ne(e),z=!!!e.groupId;return s("div",{...U(e,v),onClick:z?()=>I(e.value):void 0,className:["relative flex flex-col gap-3 border-b border-line border-l-2 px-5 py-8 transition-all",z?"cursor-pointer border-t-2 border-t-accent":"",p?"border-l-accent pl-6":z?"border-l-transparent hover:bg-accent/[0.04]":"border-l-transparent"].join(" "),style:p?{background:"color-mix(in oklab, var(--accent) 8%, transparent)"}:void 0,children:[n("span",{className:[`font-mono ${t.labelSmall} uppercase tracking-[0.3em] transition-colors`,p?"text-fg":"text-accent"].join(" "),children:e.label}),z?n("a",{href:e.href,onClick:oe=>oe.stopPropagation(),className:[`font-heading3 ${t.headingSmall1} font-medium leading-[1.2] tracking-[-0.02em] transition-colors hover:text-accent`,p?"text-accent":"text-fg"].join(" "),children:e.value}):n("a",{href:Z(e),className:[`font-heading3 ${t.headingSmall1} font-medium leading-[1.2] tracking-[-0.02em]`,p?"text-accent":"text-fg"].join(" "),children:e.value}),e.sub&&n("span",{className:`font-mono ${t.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,children:e.sub})]},`${e.value}-${l}`)})}),N.length>0&&n("div",{"data-contact-phone-list":!0,className:"hidden flex-col gap-0 max-view-desktop:flex",children:ze(N).map((e,l)=>{const p=!!e.groupId;return s("div",{...U(e,v),className:["flex flex-col gap-3 border-b border-line px-5 py-5",p?"":"border-t-2 border-t-accent"].join(" "),children:[n("span",{className:[`font-mono ${t.labelSmall} uppercase tracking-[0.3em]`,p?"text-fg":"text-accent"].join(" "),children:e.label}),n("a",{href:Z(e),className:[`font-heading3 ${t.headingSmall1} font-medium leading-[1.2] tracking-[-0.02em] [overflow-wrap:anywhere]`,p?"text-accent":"text-fg"].join(" "),children:e.value}),e.sub&&n("span",{className:`font-mono ${t.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,children:e.sub})]},`${e.value}-${l}`)})})]})}))]})}export{M as CHANNEL_HINTS,Z as channelHref,Ie as default,Re as drawnChannels,J as fieldClass,ze as mergeChannelsForPhone,Ee as topicFieldOf};
@@ -71,6 +71,8 @@ export interface EventsProps {
71
71
  nameFilter?: boolean;
72
72
  padTop?: number;
73
73
  padBottom?: number;
74
+ template?: unknown;
75
+ ownerId?: string;
74
76
  }
75
77
  export declare function matchesName(title: string, typed: string): boolean;
76
- export default function Events({ num, title, link, posts, columns, limit, showAll, editing, cardImage, gap: gapProp, gapPhone, layout, featuredWidth, listCover, featuredDarken, omitHead, sample, nameFilter, padTop, padBottom, }: EventsProps): import("react").JSX.Element | null;
78
+ export default function Events({ num, title, link, posts, columns, limit, showAll, editing, cardImage, gap: gapProp, gapPhone, layout, featuredWidth, listCover, featuredDarken, omitHead, sample, nameFilter, padTop, padBottom, template, ownerId, }: EventsProps): import("react").JSX.Element | null;
@@ -1 +1 @@
1
- import{jsx as n,jsxs as l}from"react/jsx-runtime";import{useState as H}from"react";import{servedWords as be}from"../lib/content/served-lists.js";import{TAB_PILLS as k}from"../lib/content/tab-strip.js";import{useScopeClass as ve}from"../lib/use-scope-class.js";import{containerGapProps as Ne}from"efficient-web-builder/format/lib/content/container-gap";import Ee from"efficient-web-builder/render/components/SectionHeader";import v from"efficient-web-builder/render/components/PostCard";import ye from"efficient-web-builder/render/components/Placeholder";import{SiteLink as z}from"efficient-web-builder/render/lib/site-runtime";import{renderGold as g,renderHeadline as N}from"efficient-web-builder/render/components/goldPhrases";import{say as E}from"efficient-web-builder/format/lib/editor-words";import{cardImageShapeTokens as Te}from"efficient-web-builder/format/lib/content/card-image-shape";import{SITE_COLUMN as K}from"efficient-web-builder/format/lib/content/page-width";import{fillRowCss as we}from"../lib/sections/fill-row.js";import{headIsEmpty as _e,ownPadding as Ae}from"../lib/sections/own-padding.js";import{HideTaker as W}from"efficient-web-builder/render/components/ViewHideRoot";const Le=4;function ft(e){return be(e,Le)}function pt(e){if(!e||typeof e!="object"||Array.isArray(e))return;const a={};for(const[t,s]of Object.entries(e))if(t.trim()){if(typeof s=="string")s.trim()&&(a[t]=s.trim());else if(Array.isArray(s)){const o=s.filter(c=>typeof c=="string"&&!!c.trim()).map(c=>c.trim());o.length&&(a[t]=o)}}return Object.keys(a).length?a:void 0}function X(e,a){const t=e.facets?.[a];return t===void 0?[]:typeof t=="string"?[t]:t}const Ce=new Intl.Collator("en",{numeric:!0,sensitivity:"base"});function Se(e){const a=[],t=new Map;for(const s of e)for(const o of Object.keys(s.facets??{})){t.has(o)||(a.push(o),t.set(o,new Set));for(const c of X(s,o))t.get(o).add(c)}return a.map(s=>({label:s,values:[...t.get(s)].sort(Ce.compare)}))}function Oe(e,a){return Object.entries(a).every(([t,s])=>s===""||X(e,t).includes(s))}const J=3,q="featured",Q="tabs",Z="portrait",x="spread",ee="count",mt=[{label:"Even grid",value:"even"},{label:"Featured first",value:q},{label:"Tabs",value:Q},{label:"Photo cards",value:Z},{label:"Staggered spread",value:x},{label:"Count",value:ee}],$e=[Z,x],gt="even",R={min:2,max:11,step:1,fallback:7,unit:"of 12"},Fe="bottom-left",ke=55,ze="bottom";function Re(e){const a=typeof e=="number"?e:Number.parseFloat(String(e??"")),t=Number.isFinite(a)?Math.min(R.max,Math.max(R.min,Math.round(a))):R.fallback;return`${t}fr ${12-t}fr`}const te={1:"grid-cols-1",2:"grid-cols-2 max-view-wide:grid-cols-1",3:"grid-cols-3 max-view-wide:grid-cols-1",4:"grid-cols-4 max-view-desktop:grid-cols-2 max-view-wide:grid-cols-1"},ne={2:"grid-cols-2",3:"grid-cols-3 max-view-wide:grid-cols-2",4:"grid-cols-4 max-view-desktop:grid-cols-3 max-view-wide:grid-cols-2"},Ie="Find by name",Me="Nobody by that name.",Ue="Nobody matches.",De="Any";function Pe(e,a){const t=o=>o.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLocaleLowerCase().trim(),s=t(a);return s===""||t(e).includes(s)}function ae({typed:e,onType:a,wide:t=!1}){return l("label",{className:`flex max-w-[360px] flex-col gap-1.5${t?" w-full":""}`,children:[n("span",{className:"font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.18em] text-fg-dim",children:Ie}),n("input",{type:"search",value:e,onChange:s=>a(s.target.value),autoComplete:"off",className:"rounded-[var(--sf-button-radius,6px)] border border-line bg-bg px-4 py-2.5 text-[length:var(--size-body,15px)] text-fg outline-none focus:border-accent"})]})}function se({tags:e}){return n("ul",{"aria-label":"Details",className:"flex gap-1.5 overflow-hidden",children:e.map((a,t)=>n("li",{className:"shrink-0 rounded-[var(--sf-button-radius,4px)] border border-line px-2 py-0.5 text-[length:var(--size-label,12px)] text-fg-dim",children:a},`${a}-${t}`))})}function je({card:e,scaffold:a,lower:t=!1}){return l(z,{href:e.href||"#",className:`sf-card group relative isolate flex aspect-[3/4] overflow-hidden bg-surface${t?" min-[801px]:mt-16":""}`,"aria-disabled":a||void 0,tabIndex:a?-1:void 0,children:[n("div",{className:"absolute inset-0 transition-transform duration-700 group-hover:scale-[1.03] motion-reduce:transition-none motion-reduce:group-hover:scale-100",children:n(ye,{label:`card-${e.slug}`,src:e.cover||void 0,sizes:"(max-width: 800px) 50vw, 25vw"})}),n("div",{"aria-hidden":!0,className:"absolute inset-0 z-0",style:{background:"linear-gradient(180deg, transparent 45%, color-mix(in srgb, var(--bg) 88%, transparent) 100%)"}}),e.meta&&n("span",{className:"absolute left-3 top-3 z-[1] rounded-[var(--sf-button-radius,999px)] bg-bg/85 px-2.5 py-1 font-mono text-[length:var(--size-label,11px)] uppercase tracking-[0.16em] text-accent",children:g(e.meta)}),l("div",{className:"relative z-[1] mt-auto flex w-full flex-col gap-1 p-4 max-view-wide:p-3",children:[n("h3",{className:"font-heading3 text-[length:var(--size-headingSmall,24px)] leading-[1.1] tracking-[-0.01em] text-fg",children:N(e.title,!1)}),e.dateLabel&&n("p",{className:"font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.16em] text-accent",children:g(e.dateLabel)}),e.tags&&e.tags.length>0&&n(se,{tags:e.tags}),e.excerpt&&n("p",{className:"line-clamp-2 text-[length:var(--size-body,14px)] leading-[1.45] text-fg-dim",children:g(e.excerpt)})]})]})}function Ve({cards:e,scaffold:a}){return n("nav",{"aria-label":"Days",className:k.nav,children:n("ul",{className:k.list,children:e.map((t,s)=>{const o=!!t.meta;return n("li",{children:l(z,{href:t.href||"#","aria-current":o?"page":void 0,"aria-disabled":a||void 0,tabIndex:a?-1:void 0,className:k.tab(o),children:[n("span",{className:"font-heading3 text-[length:var(--size-body,15px)] leading-[1.2]",children:N(t.title,!1)}),t.excerpt&&n("span",{className:`font-mono text-[length:var(--size-label,11px)] uppercase tracking-[0.14em] ${o?"opacity-80":"text-fg-dim"}`,children:g(t.excerpt)})]})},`${t.slug}-${s}`)})})})}function Ye({count:e,words:a,href:t}){const s=l("span",{className:"inline-flex items-baseline gap-3",children:[n("span",{className:"font-heading text-[length:var(--size-headingLarge,64px)] leading-none text-accent",children:e}),a!==void 0&&n("span",{className:"font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.2em] text-fg",children:a})]});return t?n(z,{href:t,className:"inline-flex hover:opacity-85",children:s}):s}const Be="relative z-[2] bg-bg py-[120px] max-view-wide:py-[70px]",Ge="relative z-[2] bg-bg pt-0 pb-[120px] max-view-wide:pt-0 max-view-wide:pb-[70px]",He="relative z-[2] bg-bg py-[32px] max-view-wide:py-[24px]";function Ke({num:e,title:a,link:t,posts:s,columns:o,limit:c,showAll:y=!1,editing:T=!1,cardImage:re,gap:oe,gapPhone:le,layout:p,featuredWidth:ie,listCover:ce=!0,featuredDarken:de,omitHead:h=!1,sample:w,nameFilter:fe=!1,padTop:pe,padBottom:me}){const[_,I]=H(""),[M,ge]=H({}),A=ve("ev"),U=s??[],D=y?U.length:typeof c=="number"&&c>0?c:J,L=U.slice(0,D),m=T&&L.length===0;if(L.length===0&&!T)return null;const P=y?J:D,d=m?w?.length?w.slice(0,y?w.length:P):Array.from({length:P},(r,i)=>({slug:`placeholder-${i}`,title:E("Blog post title"),excerpt:E("A short summary of the post appears here."),cover:"",meta:E("Journal"),dateLabel:E("Date")})):L,f=Ne("Events",oe,"both",le),C=p===q&&d.length>1,ue=Re(ie),S=p===Q,j=p===ee,V=$e.includes(p??""),O=fe&&!S&&!j&&!C,$=O?Se(d):[],b=O?d.filter(r=>Pe(r.title,_)&&Oe(r,M)):d,F=Ae(pe,me),xe=!T&&_e(e,a,t?.text),Y=p===x?"grid-cols-3 max-view-wide:grid-cols-2":ne[Math.min(4,Math.max(2,o??3))]??ne[3],B=te[Math.min(4,Math.max(1,o??3))]??te[3],G=S||C||p===x?"":we(A,V?Y:B,{cards:b.length});return j?n(W,{as:"section",className:He,style:Object.keys(F).length?F:void 0,children:n("div",{className:K,children:n(Ye,{count:d.length,words:h||a===void 0?void 0:N(a,!1),href:h?void 0:t?.href})})}):n(W,{as:"section",className:h?Ge:Be,style:{...Te(re),...F},children:l("div",{className:K,children:[h||xe?null:n(Ee,{num:e!==void 0?g(e):void 0,title:a!==void 0?N(a,!1):void 0,link:t?{text:g(t.text),href:t.href}:void 0}),O&&l("div",{className:"mb-6 flex flex-col gap-2",children:[$.length===0?n(ae,{typed:_,onType:I}):l("div",{className:"flex flex-wrap items-end gap-3",children:[n(ae,{typed:_,onType:I,wide:!0}),$.map(({label:r,values:i})=>l("label",{className:"flex min-w-[140px] flex-col gap-1.5 max-view-wide:flex-1",children:[n("span",{className:"font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.18em] text-fg-dim",children:r}),l("select",{value:M[r]??"",onChange:u=>ge(he=>({...he,[r]:u.target.value})),className:"rounded-[var(--sf-button-radius,6px)] border border-line bg-bg px-4 py-2.5 text-[length:var(--size-body,15px)] text-fg outline-none focus:border-accent",children:[n("option",{value:"",children:De}),i.map(u=>n("option",{value:u,children:u},u))]})]},r))]}),b.length===0&&n("p",{role:"status",className:"text-[length:var(--size-body,14px)] text-fg-dim",children:$.length===0?Me:Ue})]}),G&&n("style",{children:G}),S?n(Ve,{cards:d,scaffold:m}):V?n("div",{className:`${A} sf-card-grid grid${f.className} ${Y}`,style:f.style,children:b.map((r,i)=>n(je,{card:r,scaffold:m,lower:p===x&&i%3===1},`${r.slug}-${i}`))}):C?l("div",{className:`sf-card-grid grid grid-cols-[var(--sf-events-split)] max-view-wide:grid-cols-1${f.className}`,style:{...f.style,"--sf-events-split":ue},children:[n(v,{post:d[0],href:d[0].href,scaffold:m,layout:"cover",darken:de??ke,darkenStyle:ze,placement:Fe},`${d[0].slug}-0`),n("div",{className:`grid auto-rows-min${f.className}`,style:f.style,children:d.slice(1).map((r,i)=>n(v,{post:r,href:r.href,scaffold:m,showCover:ce},`${r.slug}-${i+1}`))})]}):n("div",{className:`${A} sf-card-grid grid${f.className} ${B}`,style:f.style,children:b.map((r,i)=>r.tags&&r.tags.length>0?l("div",{className:"flex flex-col gap-2",children:[n(v,{post:r,href:r.href,scaffold:m}),n(se,{tags:r.tags})]},`${r.slug}-${i}`):n(v,{post:r,href:r.href,scaffold:m},`${r.slug}-${i}`))})]})})}export{R as EVENTS_FEATURED_WIDTH,mt as EVENTS_LAYOUTS,ee as EVENTS_LAYOUT_COUNT,gt as EVENTS_LAYOUT_FALLBACK,q as EVENTS_LAYOUT_FEATURED,Z as EVENTS_LAYOUT_PORTRAIT,x as EVENTS_LAYOUT_SPREAD,Q as EVENTS_LAYOUT_TABS,$e as EVENTS_PHOTO_LAYOUTS,Le as MAX_CARD_TAGS,Ke as default,Se as facetChoices,Oe as matchesFacets,Pe as matchesName,pt as readFacets,ft as readTags};
1
+ import{jsx as s,jsxs as c}from"react/jsx-runtime";import{Children as _e,useState as Z}from"react";import{servedWords as Ae}from"../lib/content/served-lists.js";import{TAB_PILLS as P}from"../lib/content/tab-strip.js";import{useScopeClass as Ce}from"../lib/use-scope-class.js";import{containerGapProps as Le}from"efficient-web-builder/format/lib/content/container-gap";import Se from"efficient-web-builder/render/components/SectionHeader";import w from"efficient-web-builder/render/components/PostCard";import $e from"efficient-web-builder/render/components/Placeholder";import{SiteLink as U}from"efficient-web-builder/render/lib/site-runtime";import{renderGold as x,renderHeadline as _}from"efficient-web-builder/render/components/goldPhrases";import{say as A}from"efficient-web-builder/format/lib/editor-words";import{cardImageShapeTokens as Oe}from"efficient-web-builder/format/lib/content/card-image-shape";import{SITE_COLUMN as ee}from"efficient-web-builder/format/lib/content/page-width";import{fillRowCss as ke}from"../lib/sections/fill-row.js";import{headIsEmpty as Ie,ownPadding as Re}from"../lib/sections/own-padding.js";import{HideTaker as te}from"efficient-web-builder/render/components/ViewHideRoot";import{CardTemplateRows as Fe,useCardRow as De}from"efficient-web-builder/render/components/CardRowContext";import{SECTION_FILL_CLASS as ze}from"efficient-web-builder/format/lib/content/section-min-height";import{postPath as Me}from"efficient-web-builder/format/lib/links/page-link-rules";import{EVENTS_FEATURED_DARKEN as Pe,EVENTS_FEATURED_DARKEN_STYLE as Ue,EVENTS_FEATURED_PLACEMENT as Ve}from"../lib/content/events-featured-look.js";const Ye=4;function Mt(e){return Ae(e,Ye)}function Pt(e){if(!e||typeof e!="object"||Array.isArray(e))return;const a={};for(const[t,r]of Object.entries(e))if(t.trim()){if(typeof r=="string")r.trim()&&(a[t]=r.trim());else if(Array.isArray(r)){const l=r.filter(d=>typeof d=="string"&&!!d.trim()).map(d=>d.trim());l.length&&(a[t]=l)}}return Object.keys(a).length?a:void 0}function se(e,a){const t=e.facets?.[a];return t===void 0?[]:typeof t=="string"?[t]:t}const je=new Intl.Collator("en",{numeric:!0,sensitivity:"base"});function Be(e){const a=[],t=new Map;for(const r of e)for(const l of Object.keys(r.facets??{})){t.has(l)||(a.push(l),t.set(l,new Set));for(const d of se(r,l))t.get(l).add(d)}return a.map(r=>({label:r,values:[...t.get(r)].sort(je.compare)}))}function Ke(e,a){return Object.entries(a).every(([t,r])=>r===""||se(e,t).includes(r))}const ae=3,ne="featured",re="tabs",le="portrait",v="spread",oe="count",Ut=[{label:"Even grid",value:"even"},{label:"Featured first",value:ne},{label:"Tabs",value:re},{label:"Photo cards",value:le},{label:"Staggered spread",value:v},{label:"Count",value:oe}],We=[le,v],Vt="even",V={min:2,max:11,step:1,fallback:7,unit:"of 12"},He=Ve,Ge=Pe,Xe=Ue;function Je(e){const a=typeof e=="number"?e:Number.parseFloat(String(e??"")),t=Number.isFinite(a)?Math.min(V.max,Math.max(V.min,Math.round(a))):V.fallback;return`${t}fr ${12-t}fr`}const ie={1:"grid-cols-1",2:"grid-cols-2 max-view-wide:grid-cols-1",3:"grid-cols-3 max-view-wide:grid-cols-1",4:"grid-cols-4 max-view-desktop:grid-cols-2 max-view-wide:grid-cols-1"},qe={2:"grid-cols-2",3:"grid-cols-3 max-view-wide:grid-cols-2",4:"grid-cols-4 max-view-desktop:grid-cols-3 max-view-wide:grid-cols-2"},Qe={2:"grid-cols-2 max-view-wide:grid-cols-1",3:"grid-cols-3 max-view-wide:grid-cols-1",4:"grid-cols-4 max-view-desktop:grid-cols-3 max-view-wide:grid-cols-1"};function ce(e,a){return{key:e.slug,title:e.title??"",excerpt:e.excerpt??"",cover:e.cover??"",meta:e.meta??"",dateLabel:e.dateLabel??"",href:e.href||(a?"#":Me(e.slug))}}function Ze(e,a){return{...ce(e,a),tags:(e.tags??[]).map(t=>({label:t}))}}const de=new WeakMap,et={className:"hidden"},tt={className:ze};function fe(e,a){const t=e.blockIds[0],r=e;function l(d){const b=De(),N=a&&b?.index===0;return s(r,{...d,cell:C=>C===t===N?tt:et})}return Object.assign(l,{blockCount:1,blockIds:e.blockIds})}function st(e,a){const t=e;if(typeof t!="function"||(t.blockCount??0)<2||!Array.isArray(t.blockIds))return e;let r=de.get(t);return r||(r={lead:fe(t,!0),rest:fe(t,!1)},de.set(t,r)),a?r.lead:r.rest}const at="Find by name",nt="Nobody by that name.",rt="Nobody matches.",lt="Any";function ot(e,a){const t=l=>l.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLocaleLowerCase().trim(),r=t(a);return r===""||t(e).includes(r)}function pe({typed:e,onType:a,wide:t=!1}){return c("label",{className:`flex max-w-[360px] flex-col gap-1.5${t?" w-full":""}`,children:[s("span",{className:"font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.18em] text-fg-dim",children:at}),s("input",{type:"search",value:e,onChange:r=>a(r.target.value),autoComplete:"off",className:"rounded-[var(--sf-button-radius,6px)] border border-line bg-bg px-4 py-2.5 text-[length:var(--size-body,15px)] text-fg outline-none focus:border-accent"})]})}function me({tags:e}){return s("ul",{"aria-label":"Details",className:"flex gap-1.5 overflow-hidden",children:e.map((a,t)=>s("li",{className:"shrink-0 rounded-[var(--sf-button-radius,4px)] border border-line px-2 py-0.5 text-[length:var(--size-label,12px)] text-fg-dim",children:a},`${a}-${t}`))})}function it({card:e,scaffold:a,lower:t=!1}){return c(U,{href:e.href||"#",className:`sf-card group relative isolate flex aspect-[3/4] overflow-hidden bg-surface${t?" min-[801px]:mt-16":""}`,"aria-disabled":a||void 0,tabIndex:a?-1:void 0,children:[s("div",{className:"absolute inset-0 transition-transform duration-700 group-hover:scale-[1.03] motion-reduce:transition-none motion-reduce:group-hover:scale-100",children:s($e,{label:`card-${e.slug}`,src:e.cover||void 0,sizes:"(max-width: 800px) 50vw, 25vw"})}),s("div",{"aria-hidden":!0,className:"absolute inset-0 z-0",style:{background:"linear-gradient(180deg, transparent 45%, color-mix(in srgb, var(--bg) 88%, transparent) 100%)"}}),e.meta&&s("span",{className:"absolute left-3 top-3 z-[1] rounded-[var(--sf-button-radius,999px)] bg-bg/85 px-2.5 py-1 font-mono text-[length:var(--size-label,11px)] uppercase tracking-[0.16em] text-accent",children:x(e.meta)}),c("div",{className:"relative z-[1] mt-auto flex w-full flex-col gap-1 p-4 max-view-wide:p-3",children:[s("h3",{className:"font-heading3 text-[length:var(--size-headingSmall,24px)] leading-[1.1] tracking-[-0.01em] text-fg",children:_(e.title,!1)}),e.dateLabel&&s("p",{className:"font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.16em] text-accent",children:x(e.dateLabel)}),e.tags&&e.tags.length>0&&s(me,{tags:e.tags}),e.excerpt&&s("p",{className:"line-clamp-2 text-[length:var(--size-body,14px)] leading-[1.45] text-fg-dim",children:x(e.excerpt)})]})]})}function ct({cards:e,scaffold:a}){return s("nav",{"aria-label":"Days",className:P.nav,children:s("ul",{className:P.list,children:e.map((t,r)=>{const l=!!t.meta;return s("li",{children:c(U,{href:t.href||"#","aria-current":l?"page":void 0,"aria-disabled":a||void 0,tabIndex:a?-1:void 0,className:P.tab(l),children:[s("span",{className:"font-heading3 text-[length:var(--size-body,15px)] leading-[1.2]",children:_(t.title,!1)}),t.excerpt&&s("span",{className:`font-mono text-[length:var(--size-label,11px)] uppercase tracking-[0.14em] ${l?"opacity-80":"text-fg-dim"}`,children:x(t.excerpt)})]})},`${t.slug}-${r}`)})})})}function dt({count:e,words:a,href:t}){const r=c("span",{className:"inline-flex items-baseline gap-3",children:[s("span",{className:"font-heading text-[length:var(--size-headingLarge,64px)] leading-none text-accent",children:e}),a!==void 0&&s("span",{className:"font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.2em] text-fg",children:a})]});return t?s(U,{href:t,className:"inline-flex hover:opacity-85",children:r}):r}const Y="[&>[data-sf-repeat]>*]:h-full [&>[data-sf-repeat]>*>*]:h-full",ft="[&>[data-sf-repeat]]:h-full [&>[data-sf-repeat]>*]:h-full [&>[data-sf-repeat]>*>*]:h-full",pt="relative z-[2] bg-bg py-[120px] max-view-wide:py-[70px]",mt="relative z-[2] bg-bg pt-0 pb-[120px] max-view-wide:pt-0 max-view-wide:pb-[70px]",gt="relative z-[2] bg-bg py-[32px] max-view-wide:py-[24px]";function ut({num:e,title:a,link:t,posts:r,columns:l,limit:d,showAll:b=!1,editing:N=!1,cardImage:C,gap:ge,gapPhone:ue,layout:g,featuredWidth:he,listCover:xe=!0,featuredDarken:ve,omitHead:T=!1,sample:L,nameFilter:be=!1,padTop:Ne,padBottom:Ee,template:j,ownerId:Te=""}){const[S,B]=Z(""),[K,ye]=Z({}),E=Ce("ev"),W=r??[],H=b?W.length:typeof d=="number"&&d>0?d:ae,$=W.slice(0,H),m=N&&$.length===0;if($.length===0&&!N)return null;const G=b?ae:H,f=m?L?.length?L.slice(0,b?L.length:G):Array.from({length:G},(n,i)=>({slug:`placeholder-${i}`,title:A("Blog post title"),excerpt:A("A short summary of the post appears here."),cover:"",meta:A("Journal"),dateLabel:A("Date")})):$,o=Le("Events",ge,"both",ue),y=g===ne&&f.length>1,X=Je(he),O=g===re,J=g===oe,q=We.includes(g??""),k=be&&!O&&!J&&!y,I=k?Be(f):[],h=k?f.filter(n=>ot(n.title,S)&&Ke(n,K)):f,R=Re(Ne,Ee),we=!N&&Ie(e,a,t?.text),F=(j?.blockCount??0)>0?Qe:qe,D=g===v?F[3]:F[Math.min(4,Math.max(2,l??3))]??F[3],z=ie[Math.min(4,Math.max(1,l??3))]??ie[3],Q=O||y||g===v?"":ke(E,q?D:z,{cards:h.length}),M=(n,i,p)=>s(Fe,{ownerId:Te,ownerType:"Events",Template:st(j,y),rows:n.map(u=>ce(u,m)),items:n.map(u=>Ze(u,m)),fallback:i,children:u=>p(_e.toArray(u))});return J?s(te,{as:"section",className:gt,style:Object.keys(R).length?R:void 0,children:s("div",{className:ee,children:s(dt,{count:f.length,words:T||a===void 0?void 0:_(a,!1),href:T?void 0:t?.href})})}):s(te,{as:"section",className:T?mt:pt,style:{...Oe(C),...R},children:c("div",{className:ee,children:[T||we?null:s(Se,{num:e!==void 0?x(e):void 0,title:a!==void 0?_(a,!1):void 0,link:t?{text:x(t.text),href:t.href}:void 0}),k&&c("div",{className:"mb-6 flex flex-col gap-2",children:[I.length===0?s(pe,{typed:S,onType:B}):c("div",{className:"flex flex-wrap items-end gap-3",children:[s(pe,{typed:S,onType:B,wide:!0}),I.map(({label:n,values:i})=>c("label",{className:"flex min-w-[140px] flex-col gap-1.5 max-view-wide:flex-1",children:[s("span",{className:"font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.18em] text-fg-dim",children:n}),c("select",{value:K[n]??"",onChange:p=>ye(u=>({...u,[n]:p.target.value})),className:"rounded-[var(--sf-button-radius,6px)] border border-line bg-bg px-4 py-2.5 text-[length:var(--size-body,15px)] text-fg outline-none focus:border-accent",children:[s("option",{value:"",children:lt}),i.map(p=>s("option",{value:p,children:p},p))]})]},n))]}),h.length===0&&s("p",{role:"status",className:"text-[length:var(--size-body,14px)] text-fg-dim",children:I.length===0?nt:rt})]}),Q&&s("style",{children:Q}),O?s(ct,{cards:f,scaffold:m}):q?M(h,s("div",{className:`${E} sf-card-grid grid${o.className} ${D}`,style:o.style,children:h.map((n,i)=>s(it,{card:n,scaffold:m,lower:g===v&&i%3===1},`${n.slug}-${i}`))}),n=>s("div",{className:`${E} sf-card-grid grid${o.className} ${D} ${Y}`,style:o.style,children:g===v?n.map((i,p)=>s("div",{className:`${ft}${p%3===1?" view-wide:mt-16":""}`,children:i},p)):n})):y?M(f,c("div",{className:`sf-card-grid grid grid-cols-[var(--sf-events-split)] max-view-wide:grid-cols-1${o.className}`,style:{...o.style,"--sf-events-split":X},children:[s(w,{post:f[0],href:f[0].href,scaffold:m,layout:"cover",darken:ve??Ge,darkenStyle:Xe,placement:He},`${f[0].slug}-0`),s("div",{className:`grid auto-rows-min${o.className}`,style:o.style,children:f.slice(1).map((n,i)=>s(w,{post:n,href:n.href,scaffold:m,showCover:xe},`${n.slug}-${i+1}`))})]}),n=>c("div",{className:`sf-card-grid grid grid-cols-[var(--sf-events-split)] max-view-wide:grid-cols-1${o.className} ${Y}`,style:{...o.style,"--sf-events-split":X},children:[n[0],s("div",{className:`grid auto-rows-min${o.className}`,style:o.style,children:n.slice(1)})]})):M(h,s("div",{className:`${E} sf-card-grid grid${o.className} ${z}`,style:o.style,children:h.map((n,i)=>n.tags&&n.tags.length>0?c("div",{className:"flex flex-col gap-2",children:[s(w,{post:n,href:n.href,scaffold:m}),s(me,{tags:n.tags})]},`${n.slug}-${i}`):s(w,{post:n,href:n.href,scaffold:m},`${n.slug}-${i}`))}),n=>s("div",{className:`${E} sf-card-grid grid${o.className} ${z} ${Y}`,style:o.style,children:n}))]})})}export{V as EVENTS_FEATURED_WIDTH,Ut as EVENTS_LAYOUTS,oe as EVENTS_LAYOUT_COUNT,Vt as EVENTS_LAYOUT_FALLBACK,ne as EVENTS_LAYOUT_FEATURED,le as EVENTS_LAYOUT_PORTRAIT,v as EVENTS_LAYOUT_SPREAD,re as EVENTS_LAYOUT_TABS,We as EVENTS_PHOTO_LAYOUTS,Ye as MAX_CARD_TAGS,ut as default,Be as facetChoices,Ke as matchesFacets,ot as matchesName,Pt as readFacets,Mt as readTags};
@@ -3,6 +3,7 @@ import type { SlotComponent } from "efficient-easel/blocks";
3
3
  import { type CardHoverDrawn } from "efficient-web-builder/format/lib/animation/hover";
4
4
  import type { SourceRow } from "efficient-web-builder/format/lib/content/block-sources";
5
5
  import type { Bundle, WheelSummary } from "../lib/api/index.js";
6
+ import type { VehicleFitment } from "../lib/wheels/plp-fitment-match.js";
6
7
  import { type FieldUsageAnswer } from "../lib/content/field-usage.js";
7
8
  export declare function gridIndexCss(cls: string): string;
8
9
  export declare function cardRowsGrid(gapZone: {
@@ -12,16 +13,39 @@ export declare function cardRowsGrid(gapZone: {
12
13
  className: string;
13
14
  style: CSSProperties;
14
15
  };
16
+ export interface GridCardRules {
17
+ sale: boolean;
18
+ axleSets: boolean;
19
+ setTotal: boolean;
20
+ wasFollowsSize: boolean;
21
+ quoteSets: boolean;
22
+ showSingle: boolean;
23
+ armOnContact: boolean;
24
+ }
25
+ export declare const GRID_CARD_RULES: GridCardRules;
26
+ export declare const LISTING_CARD_RULES: GridCardRules;
27
+ export interface GridCardEyebrow {
28
+ kindLabel: string | null;
29
+ brand: boolean;
30
+ process: boolean;
31
+ }
15
32
  export interface GridCardValues {
16
33
  ownerId: string;
34
+ ownerType?: string;
17
35
  Template: SlotComponent | undefined;
18
36
  hover: CardHoverDrawn;
19
37
  imageSizes: string;
20
38
  fieldUsage: readonly FieldUsageAnswer[];
21
39
  reserveEyebrow: boolean;
22
40
  editing: boolean;
41
+ eyebrow?: GridCardEyebrow;
42
+ fit?: VehicleFitment | null;
43
+ colours?: readonly string[];
44
+ setGridGap?: string;
45
+ rules?: GridCardRules;
23
46
  }
24
- export declare function useGridCard(): GridCardValues;
47
+ export type GridCardRead = Required<Omit<GridCardValues, "setGridGap">> & Pick<GridCardValues, "setGridGap">;
48
+ export declare function useGridCard(): GridCardRead;
25
49
  export declare function GridCardProvider({ value, children }: {
26
50
  value: GridCardValues;
27
51
  children: ReactNode;
@@ -34,6 +58,11 @@ export declare function GridCards({ wheels, finishes, children, }: {
34
58
  finishes?: readonly (string | undefined)[];
35
59
  children: (copies: ReactNode) => ReactNode;
36
60
  }): import("react").JSX.Element;
61
+ export declare function GridMixedCards<T>({ items, isWheel, other, }: {
62
+ items: readonly T[];
63
+ isWheel: (item: T) => boolean;
64
+ other: (item: T, at: number) => ReactNode;
65
+ }): import("react").JSX.Element;
37
66
  export declare function GridBundleCards({ bundles, children }: {
38
67
  bundles: readonly Bundle[];
39
68
  children: (copies: ReactNode) => ReactNode;
@@ -1 +1 @@
1
- "use client";import{jsx as t,jsxs as c,Fragment as b}from"react/jsx-runtime";import v from"next/link";import{createContext as h,useContext as g}from"react";import{CardTemplateRows as m}from"efficient-web-builder/render/components/CardRowContext";import{InsideSiteColumn as w}from"efficient-web-builder/render/components/SiteGutterFrame";import{HideTaker as S}from"efficient-web-builder/render/components/ViewHideRoot";import{cardHoverOf as _}from"efficient-web-builder/format/lib/animation/hover";import{NO_FIELD_ANSWERS as y}from"../lib/content/field-usage.js";import{CARD_IMAGE_SIZES as I}from"../lib/sections/card-image-sizes.js";import{CardLookContext as f}from"./card-pieces/card-row.js";import{CardBuyDialog as R}from"./card-pieces/CardBuyButton.js";import{BundleCardStateProvider as E,useWheelCardState as P,WheelCardStateProvider as T}from"./card-pieces/ProductCardState.js";import{say as G}from"efficient-web-builder/format/lib/editor-words";import{CARD_INDEX_OPTIONS as A,cardIndexCss as N}from"efficient-web-builder/format/lib/sections/product-card-style";import{SHARED_ROWS_LIST_CLASS as D}from"efficient-web-builder/render/lib/content/box-shared-columns";import{GAP_ZONE_CLASS as L}from"efficient-web-builder/format/lib/content/container-gap";import{CARD_ROWS_GRID_CLASS as O,cardRowsGap as $,cardRowsGridStyle as k}from"./WheelCardFrame.js";function fe(e){return A.map(({value:r})=>r==="off"?"":N(e,r).replace(".sf-card-index::before",`.sf-card-index[data-format="${r}"]::before`)).join("")}function pe(e){return e.className.includes(L)?{className:`${e.className} ${O} ${D}`,style:{...e.style,...k($(e))}}:e}const F={ownerId:"",Template:void 0,hover:_({},"ProductGrid"),imageSizes:I,fieldUsage:y,reserveEyebrow:!1,editing:!1},p=h(F);function d(){return g(p)}function ue({value:e,children:r}){return t(p.Provider,{value:e,children:r})}function W(e){return{name:e.name??"",eyebrow:e.process??"",note:"",href:e.slug?`/wheels/${e.slug}`:""}}const u=e=>`/bundles/${e.slug}`;function j(e){return{name:e.name,eyebrow:"",note:e.subtitle??"",href:u(e)}}const z="sf-card sf-card-fill group relative flex flex-col bg-[var(--card-bg)] transition-colors duration-200 hover:bg-[var(--card-bg-hover)] [.sf-card-rows>&]:mb-[var(--sf-card-row-gap)]",B="sf-card group relative flex flex-col border border-line bg-bg transition-colors hover:border-accent",H="col-span-2 max-view-wide:col-span-1 @max-[720px]:col-span-1 [&:has([data-set-picture=one])]:col-span-1",U="relative z-[2] flex flex-1 flex-col pointer-events-none [&_a]:pointer-events-auto [&_button]:pointer-events-auto [&_input]:pointer-events-auto [&_select]:pointer-events-auto [&_label]:pointer-events-auto",Y="relative flex flex-1 flex-col";function x({copy:e,href:r,label:o,wide:n=!1,kit:a=!1,probes:l}){const{editing:i}=d(),s=a?B:z;return c(S,{as:"article",className:n?`${s} ${H}`:s,children:[l,!i&&r?t(v,{href:r,"aria-label":o,className:"absolute inset-0 z-[1]"}):null,t("div",{className:i?Y:U,children:t(w,{children:e})})]})}function K({copy:e}){const{wheel:r,sel:o,isSet:n}=P();return c(b,{children:[t(x,{copy:e,href:r.slug?`/wheels/${r.slug}`:"",label:r.name,wide:n,probes:o.probes}),t(R,{})]})}function M(e,r,o){const n=r.item;return t(T,{wheel:n,defaultFinish:o?.[r.index],children:t(f.Provider,{value:"catalog",children:t(K,{copy:e})})})}function xe({wheels:e,finishes:r,children:o}){const{ownerId:n,Template:a,editing:l}=d();return t(m,{ownerId:n,ownerType:"ProductGrid",Template:a,rows:e.map(W),items:e,fallback:l?t(C,{}):null,wrapCopy:(i,s)=>M(i,s,r),children:o})}function V(e,r){const o=r.item;return t(E,{bundle:o,children:t(f.Provider,{value:"catalog",children:t(x,{copy:e,href:u(o),label:o.name,kit:!0})})})}function Ce({bundles:e,children:r}){const{ownerId:o,Template:n,editing:a}=d();return t(m,{ownerId:o,ownerType:"ProductGrid",Template:n,rows:e.map(j),items:e,fallback:a?t(C,{}):null,wrapCopy:V,children:r})}function C(){return t("div",{"data-grid-card-empty":"",className:"p-4 text-center font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.2em] text-fg-dim",children:G("The card is empty. Add parts to its card template in Layers.")})}export{Ce as GridBundleCards,ue as GridCardProvider,xe as GridCards,j as bundleCardRow,u as bundlePagePath,pe as cardRowsGrid,fe as gridIndexCss,W as productCardRow,d as useGridCard};
1
+ "use client";import{jsx as o,jsxs as f,Fragment as p}from"react/jsx-runtime";import _ from"next/link";import{createContext as v,useContext as y,useMemo as R}from"react";import{CardTemplateRows as m}from"efficient-web-builder/render/components/CardRowContext";import{InsideSiteColumn as I}from"efficient-web-builder/render/components/SiteGutterFrame";import{HideTaker as T}from"efficient-web-builder/render/components/ViewHideRoot";import{cardHoverOf as E}from"efficient-web-builder/format/lib/animation/hover";import{NO_FIELD_ANSWERS as O}from"../lib/content/field-usage.js";import{CARD_IMAGE_SIZES as G}from"../lib/sections/card-image-sizes.js";import{CardLookContext as x}from"./card-pieces/card-row.js";import{CardBuyDialog as A}from"./card-pieces/CardBuyButton.js";import{BundleCardStateProvider as N,useWheelCardState as P,WheelCardStateProvider as D}from"./card-pieces/ProductCardState.js";import{say as L}from"efficient-web-builder/format/lib/editor-words";import{CARD_INDEX_OPTIONS as F,cardIndexCss as k}from"efficient-web-builder/format/lib/sections/product-card-style";import{SHARED_ROWS_LIST_CLASS as $}from"efficient-web-builder/render/lib/content/box-shared-columns";import{GAP_ZONE_CLASS as j}from"efficient-web-builder/format/lib/content/container-gap";import{CARD_ROWS_GRID_CLASS as U,cardRowsGap as z,cardRowsGridStyle as W}from"./WheelCardFrame.js";function he(e){return F.map(({value:r})=>r==="off"?"":k(e,r).replace(".sf-card-index::before",`.sf-card-index[data-format="${r}"]::before`)).join("")}function ge(e){return e.className.includes(j)?{className:`${e.className} ${U} ${$}`,style:{...e.style,...W(z(e))}}:e}const B={sale:!1,axleSets:!0,setTotal:!1,wasFollowsSize:!1,quoteSets:!0,showSingle:!1,armOnContact:!1},_e={sale:!0,axleSets:!1,setTotal:!0,wasFollowsSize:!0,quoteSets:!1,showSingle:!0,armOnContact:!0},H={kindLabel:null,brand:!1,process:!0},M=[],C={ownerId:"",ownerType:"ProductGrid",Template:void 0,hover:E({},"ProductGrid"),imageSizes:G,fieldUsage:O,reserveEyebrow:!1,editing:!1,eyebrow:H,fit:null,colours:M,rules:B},w=v(C);function u(){return y(w)}function ve({value:e,children:r}){const t=R(()=>({...C,...Y(e)}),[e]);return o(w.Provider,{value:t,children:r})}const Y=e=>Object.fromEntries(Object.entries(e).filter(([,r])=>r!==void 0));function q(e){return{name:e.name??"",eyebrow:e.process??"",note:"",href:e.slug?`/wheels/${e.slug}`:""}}const S=e=>`/bundles/${e.slug}`;function K(e){return{name:e.name,eyebrow:"",note:e.subtitle??"",href:S(e)}}const V="sf-card sf-card-fill group relative flex flex-col bg-[var(--card-bg)] transition-colors duration-200 hover:bg-[var(--card-bg-hover)] [.sf-card-rows>&]:mb-[var(--sf-card-row-gap)]",X="sf-card group relative flex flex-col border border-line bg-bg transition-colors hover:border-accent",J="col-span-2 max-view-wide:col-span-1 @max-[720px]:col-span-1 [&:has([data-set-picture=one])]:col-span-1",Q="relative z-[2] flex flex-1 flex-col pointer-events-none [&_a]:pointer-events-auto [&_button]:pointer-events-auto [&_input]:pointer-events-auto [&_select]:pointer-events-auto [&_label]:pointer-events-auto",Z="relative flex flex-1 flex-col";function b({copy:e,href:r,label:t,wide:a=!1,kit:s=!1,probes:i,arm:n}){const{editing:l}=u(),c=s?X:V,d=n?{onPointerEnter:n,onTouchStart:n,onFocusCapture:n}:{};return f(T,{as:"article",className:a?`${c} ${J}`:c,...d,children:[i,!l&&r?o(_,{href:r,"aria-label":t,className:"absolute inset-0 z-[1]"}):null,o("div",{className:l?Z:Q,children:o(I,{children:e})})]})}function ee({copy:e}){const{wheel:r,sel:t,isSet:a}=P(),{rules:s}=u();return f(p,{children:[o(b,{copy:e,href:r.slug?`/wheels/${r.slug}`:"",label:r.name,wide:a,probes:t.probes,arm:s.armOnContact?t.arm:void 0}),o(A,{})]})}function re(e,r,t,a){const s=r.item;return o(D,{wheel:s,colours:t.colours,defaultFinish:a?.[r.index],editing:t.editing,children:o(x.Provider,{value:"catalog",children:o(ee,{copy:e})})})}function h({wheels:e,finishes:r,children:t}){const a=u(),{ownerId:s,ownerType:i,Template:n,editing:l}=a;return o(m,{ownerId:s,ownerType:i,Template:n,rows:e.map(q),items:e,fallback:l?o(g,{}):null,wrapCopy:(c,d)=>re(c,d,a,r),children:t})}function ye({items:e,isWheel:r,other:t}){const{Template:a}=u(),s=e.filter(r),i=n=>{let l=0;return e.map((c,d)=>r(c)?n[l++]??null:t(c,d))};return!a||(a.blockCount??0)<=0?f(p,{children:[e.map((n,l)=>r(n)?null:t(n,l)),s.length>0&&o(h,{wheels:s,children:n=>n})]}):o(h,{wheels:s,children:n=>i(n)})}function te(e,r){const t=r.item;return o(N,{bundle:t,children:o(x.Provider,{value:"catalog",children:o(b,{copy:e,href:S(t),label:t.name,kit:!0})})})}function Re({bundles:e,children:r}){const{ownerId:t,ownerType:a,Template:s,editing:i}=u();return o(m,{ownerId:t,ownerType:a,Template:s,rows:e.map(K),items:e,fallback:i?o(g,{}):null,wrapCopy:te,children:r})}function g(){return o("div",{"data-grid-card-empty":"",className:"p-4 text-center font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.2em] text-fg-dim",children:L("The card is empty. Add parts to its card template in Layers.")})}export{B as GRID_CARD_RULES,Re as GridBundleCards,ve as GridCardProvider,h as GridCards,ye as GridMixedCards,_e as LISTING_CARD_RULES,K as bundleCardRow,S as bundlePagePath,ge as cardRowsGrid,he as gridIndexCss,q as productCardRow,u as useGridCard};
@@ -42,6 +42,7 @@ interface Props {
42
42
  wheels?: WheelSummary[];
43
43
  source?: CategorySourceValue;
44
44
  catalog?: ProductSummary[];
45
+ catalogTotal?: number;
45
46
  firstCountInChips?: boolean;
46
47
  kinds?: string[];
47
48
  columns?: number;
@@ -57,5 +58,5 @@ interface Props {
57
58
  ownerId?: string;
58
59
  template?: SlotComponent;
59
60
  }
60
- export default function ProductGridSection({ num, catalog, firstCountInChips, kinds, title, titleSize, padTop, description, link, products: Products, wheels, source, columns, columnsPhone, columnsTablet, limit: limitProp, moreProducts, perPage, editing, contentCapped, hover, fieldUsage, ownerId, template, gap: gapProp, gapPhone, }: Props): import("react").JSX.Element | null;
61
+ export default function ProductGridSection({ num, catalog, catalogTotal, firstCountInChips, kinds, title, titleSize, padTop, description, link, products: Products, wheels, source, columns, columnsPhone, columnsTablet, limit: limitProp, moreProducts, perPage, editing, contentCapped, hover, fieldUsage, ownerId, template, gap: gapProp, gapPhone, }: Props): import("react").JSX.Element | null;
61
62
  export {};
@@ -1 +1 @@
1
- "use client";import{jsx as t,jsxs as f,Fragment as tt}from"react/jsx-runtime";import{useScopeClass as rt}from"../lib/use-scope-class.js";import{useEffect as A,useMemo as u,useState as me}from"react";import{cardHoverOf as nt}from"efficient-web-builder/format/lib/animation/hover";import{containerGapProps as it}from"efficient-web-builder/format/lib/content/container-gap";import st from"next/link";import{cardRowsGrid as ot,GridCardProvider as at,GridCards as lt,gridIndexCss as mt}from"./GridCardTemplate.js";import{gridClassImageSizes as dt}from"../lib/sections/card-image-sizes.js";import{fillRowCss as de}from"../lib/sections/fill-row.js";import{hiddenCardsRule as ce,noHoleBands as pe,noHoleCss as ue,ONE_WHEEL_MARK as ct,oneWheelScope as ge,pairScope as pt,showsASetCard as fe}from"../lib/sections/grid-no-hole.js";import{setIsWide as ut,summarySetBuild as gt}from"../lib/wheels/set-mode.js";import{answersForKind as he,NO_FIELD_ANSWERS as ft}from"../lib/content/field-usage.js";import{wheelCardEyebrowShows as ht}from"./ProductCardEyebrow.js";import xt from"./NoCurrencyNote.js";import{SITE_WIDTH_CAP as wt,centredCap as vt}from"efficient-web-builder/format/lib/content/page-width";import{ProductCatalogProvider as yt,SectionWheelsProvider as bt}from"./ProductRef.js";import{useCurrency as St}from"./CurrencyContext.js";import{COLLECTION_ATTR as Ct,useCatalogFilter as Mt}from"./catalog/CatalogFilterContext.js";import{useIsoLayoutEffect as $t,useShopperMember as Nt}from"./catalog/ShopperScope.js";import Et from"./wheels-plp/PlpPagination.js";import{CATALOG_TEXT_SIZE as Tt}from"../lib/sections/catalog-text-size.js";import{applyShopperFilters as zt,hasActivePlpFilters as Pt}from"../lib/wheels/plp-filters.js";import Lt from"./catalog/ClearAllButton.js";import{gridPagingOf as It,gridShownOf as _t}from"../lib/sections/product-grid-pages.js";import Ot from"./SectionBand.js";import{useInsideBox as At,useInsideSiteGutter as Ht}from"efficient-web-builder/render/components/SiteGutterFrame";import{productGridColumnsClass as Bt}from"../lib/sections/product-grid-columns.js";import{renderGold as V,renderHeadline as Rt}from"efficient-web-builder/render/components/goldPhrases";import{applyCatalogFilters as Gt}from"../lib/wheels/catalog-filters.js";import{normalizeCatalogRows as kt}from"../lib/wheels/wheel-summary-casing.js";import Ft from"./TyreSummaryCard.js";import{itemKind as Y,plpKindNoun as xe}from"../lib/catalog/plp-item.js";import{filterBarCategoryOf as Wt,gridKindsOf as we,gridRowsOf as jt}from"../lib/wheels/grid-source.js";import{useUnifiedProductCatalog as Ut}from"./useProductCatalog.js";import{STICKY_UNDERHEADER_CLASS as Kt}from"efficient-web-builder/render/lib/document/header-clearance";import{finishFamiliesOf as Xt}from"../lib/wheels/finish-defaults.js";import{lugCountsOf as Dt}from"../lib/wheels/lug-count.js";import{diametersOf as Zt}from"../lib/wheels/size-range.js";import{say as qt}from"efficient-web-builder/format/lib/editor-words";import{DEFAULT_TITLE_SIZE as Vt}from"../lib/sections/product-grid-title.js";const Yt=nt({},"ProductGrid"),i={headingMediumUpTo800Xs:"max-view-wide:text-[length:var(--size-headingMedium,28px)]",headingMediumUpTo800Small:"max-view-wide:text-[length:var(--size-headingMedium,32px)]",headingMediumUpTo800Large:"max-view-wide:text-[length:var(--size-headingMedium,36px)]",headingMediumUpTo800Xl:"max-view-wide:text-[length:var(--size-headingMedium,40px)]",body:"text-[length:var(--size-body,13px)]",headingMedium1:"text-[length:var(--size-headingMedium,40px)]",headingMedium2:"text-[length:var(--size-headingMedium,48px)]",headingMedium3:"text-[length:var(--size-headingMedium,56px)]",headingMedium4:"text-[length:var(--size-headingMedium,64px)]",labelSmall:"text-[length:var(--size-label,12px)]",labelLarge:"text-[length:var(--size-label,13px)]"},ve=[{value:"para",label:"Paragraph size — 13px",cls:`font-mono font-normal uppercase tracking-[0.22em] ${i.labelLarge}`},{value:"sm",label:"Small — 40px",cls:`font-heading2 font-medium tracking-[-0.03em] ${i.headingMedium1} ${i.headingMediumUpTo800Xs}`},{value:"md",label:"Medium — 48px",cls:`font-heading2 font-medium tracking-[-0.03em] ${i.headingMedium2} ${i.headingMediumUpTo800Small}`},{value:"lg",label:"Large — 56px",cls:`font-heading2 font-medium tracking-[-0.03em] ${i.headingMedium3} ${i.headingMediumUpTo800Large}`},{value:"xl",label:"Extra large — 64px",cls:`font-heading2 font-medium tracking-[-0.03em] ${i.headingMedium4} ${i.headingMediumUpTo800Xl}`}];function Jt(M){return(ve.find(h=>h.value===M)??ve.find(h=>h.value===Vt)).cls}function Qt({num:M,catalog:h,firstCountInChips:ye=!1,kinds:T,title:H,titleSize:be,padTop:J,description:z,link:$,products:Se,wheels:Ce,source:p,columns:Me,columnsPhone:$e,columnsTablet:Ne,limit:Ee,moreProducts:Te,perPage:ze,editing:x,contentCapped:Pe=!1,hover:Le,fieldUsage:w,ownerId:Ie="",template:_e,gap:Oe,gapPhone:Ae}){const B=u(()=>w?he(w,"alloy-wheel"):void 0,[w]),He=u(()=>w?he(w,"tyre"):void 0,[w]),e=rt("pg"),{paged:v,per:y,limit:l,cap:N}=It({moreProducts:Te,perPage:ze,limit:Ee}),d=Bt(Me,$e,Ne),Q=Pe,Be=Ht(),Re=At(),Ge=Be||Re,ee=Ut(x===!0&&!!p),o=u(()=>p?kt(jt(p,T,ee??h??[])):null,[h,ee,p,T]),R=Nt("grid",o),a=o?R.scope:null,g=Wt(p),b=g!==null&&!a,{filters:P,reportCount:G,reportLugs:k,reportSizes:F,reportFinishes:W,reportCategories:j,vehicle:te}=Mt(),{currency:S}=St(),U=b&&!!P.process&&P.process!==g,K=a?.state,n=u(()=>o?K?zt(o,K,S):b?Gt(o,P,S,te.fit):o:null,[o,K,b,P,S,te.fit]),[ke,Fe]=me(1),X=v&&n?Math.max(1,Math.ceil(n.length/y)):1,C=Math.min(X,Math.max(1,a?a.state.page:ke)),{reportShown:D}=R,re=a!==null;$t(()=>{if(!re||!n)return D(null);D(_t(n.length,{paged:v,per:y,cap:N},C))},[re,n,D,v,C,y,N]);const We=r=>a?a.update({page:r}):Fe(r),s=u(()=>v&&n?n.slice((C-1)*y,C*y):n,[v,n,C,y]);A(()=>(j(e,g===null?[]:[g]),()=>j(e,[])),[g,j,e]),A(()=>{if(b)return G(e,U?0:n?.length??0),()=>G(e,0)},[b,U,n,G,e]);const L=u(()=>({lugs:Dt(o??[]),sizes:Zt(o??[]),finishes:Xt(o??[])}),[o]);A(()=>(k(e,L.lugs),F(e,L.sizes),W(e,L.finishes),()=>{k(e,[]),F(e,[]),W(e,[])}),[L,k,F,W,e]);const Z=it("ProductGrid",Oe,"both",Ae),je=`${e} grid${Z.className} bg-[var(--catalog-grid-bg)] ${d}`,ne=ot(Z),Ue=`${e} grid${ne.className} bg-[var(--catalog-grid-bg)] ${d}`,Ke=ne.style,Xe=u(()=>{const r=(n??[]).filter(c=>Y(c)!=="tyre");if(r.length===0)return!1;const m=r.some(c=>!!c.process);return r.some(c=>!!c.setWords)||ht({kind:!1,brand:!1,process:m},B??[])},[n,B]),De=s?s.length>0?t("div",{className:Ue,style:Ke,children:s.map((r,m)=>Y(r)==="tyre"?t(Ft,{item:r,currency:S,editing:x,fieldUsage:He},`tyre:${r.slug}-${m}`):t(lt,{wheels:[r],children:E=>E},`${r.slug}-${m}`))}):a&&Pt(a.state)?f("div",{className:"flex min-h-[320px] flex-col items-center justify-center gap-4 bg-surface-2 p-4 text-center",children:[t("span",{className:`font-mono ${i.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,children:`No ${xe(we(p,T)).many} match those filters`}),t(Lt,{onClick:a.clear})]}):x?t("div",{className:"flex min-h-[320px] items-center justify-center rounded bg-surface-2 p-4 text-center",children:t("span",{className:`font-mono ${i.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,children:qt("No products in “{name}” yet",{name:p?.name??""})})}):null:t(Se,{className:je,style:Z.style,minEmptyHeight:320}),Ze=a?a.countInChips:ye,I=n&&!Ze?n.length:null,ie=xe(we(p,T)),qe=M||H||z||$?f("div",{className:`${Kt} sticky top-[var(--sf-header-h,88px)] z-30 mb-5 flex items-center justify-between gap-4 max-view-wide:flex-wrap max-view-wide:gap-y-2 border-b border-line bg-bg/95 py-3 backdrop-blur-md ${Q||Ge?"":"-mx-[var(--sf-site-gutter,40px)] px-[var(--sf-site-gutter,40px)] max-view-wide:-mx-[min(20px,var(--sf-site-gutter,40px))] max-view-wide:px-[min(20px,var(--sf-site-gutter,40px))]"}`,children:[f("div",{className:"flex min-w-0 items-end gap-6 max-view-wide:flex-col max-view-wide:items-stretch max-view-wide:gap-3",children:[M&&t("span",{className:`font-mono ${i.labelLarge} leading-none uppercase tracking-[0.22em] text-fg-dim`,children:V(M)}),H&&t("h2",{className:`${Jt(be)} leading-none text-fg max-view-wide:leading-[1] [&>span]:block`,children:Rt(H,!1)})]}),(z||$||I!==null)&&f("div",{className:"flex items-center gap-5 max-view-wide:gap-3 view-wide:grow view-wide:justify-end",children:[z&&t("span",{className:`max-w-[340px] truncate font-display ${i.body} leading-[1.4] text-fg-dim max-view-wide:hidden view-wide:w-0 view-wide:grow view-wide:text-right`,children:V(z)}),$&&f(st,{href:$.href,className:`inline-flex items-center gap-2 whitespace-nowrap font-mono ${i.labelLarge} uppercase tracking-[0.2em] text-fg-dim transition-colors hover:text-fg`,children:[V($.text),t("span",{"aria-hidden":!0,children:"→"})]}),I!==null&&f("span",{className:`whitespace-nowrap font-mono ${i.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,children:[I," ",I===1?ie.one:ie.many]})]})]}):null,Ve=typeof J=="number"?{"--pg-pt":`${J}px`}:{},_=u(()=>{if(!s)return null;const r=s.map(m=>Y(m)!=="tyre"&&ut(gt(m))?2:1);return fe(r,l)?pe(d,r,l):null},[s,d,l]),[Ye,Je]=me("");A(()=>{if(s)return;const r=document.querySelector(`.${e}`);if(!r)return;const m=()=>{const c=[...r.children].map(le=>le.classList.contains("col-span-2")&&!le.querySelector(ct)?2:1);Je(fe(c,l)?ue(e,pe(d,c,l,!1),c.length):"")};m();const E=new MutationObserver(m);return E.observe(r,{childList:!0}),()=>E.disconnect()},[s,e,d,l]);const Qe=_?_[0].tracks:s?N?Math.min(s.length,l):s.length:void 0,O=_?ue(pt(e),_,s.length)+(N?ce(ge(e),l+1):"")+de(ge(e),d,{limit:l,cards:s.length}):Ye,se=O?"":de(e,d,{limit:l,cards:s?.length}),oe=mt(e),ae=f(tt,{children:[N&&!O&&t("style",{children:ce(e,l+1)}),O&&t("style",{children:O}),se&&t("style",{children:se}),oe&&t("style",{children:oe}),qe,De,v&&X>1&&t(Et,{textSize:Tt.labelSmall,page:C,pageCount:X,onPage:We}),t(xt,{editing:x})]});if(U)return null;const q=t(Ot,{rootRef:R.ref,attrs:b&&g!==null?{[Ct]:g}:void 0,className:"relative z-[2] bg-bg px-[var(--sf-site-gutter,40px)] pt-[var(--pg-pt)] pb-[120px] max-view-wide:px-[min(20px,var(--sf-site-gutter,40px))] max-view-wide:pt-[70px] max-view-wide:pb-[70px]",column:null,inAnyBox:!0,style:Ve,defaults:{"--pg-pt":"120px"},children:Q?t("div",{style:vt(wt),children:ae}):ae}),et=o?q:x?t(yt,{currency:S,children:q}):t(bt,{wheels:Ce,currency:S,children:q});return t(at,{value:{ownerId:Ie,Template:_e,hover:Le??Yt,imageSizes:dt(d,Qe),fieldUsage:B??ft,reserveEyebrow:Xe,editing:x===!0},children:et})}export{ve as TITLE_SIZES,Qt as default};
1
+ "use client";import{jsx as t,jsxs as f,Fragment as rt}from"react/jsx-runtime";import{useScopeClass as nt}from"../lib/use-scope-class.js";import{useEffect as O,useMemo as u,useState as me}from"react";import{cardHoverOf as it}from"efficient-web-builder/format/lib/animation/hover";import{containerGapProps as st}from"efficient-web-builder/format/lib/content/container-gap";import ot from"next/link";import{cardRowsGrid as at,GridCardProvider as lt,GridMixedCards as mt,gridIndexCss as dt}from"./GridCardTemplate.js";import{gridClassImageSizes as ct}from"../lib/sections/card-image-sizes.js";import{fillRowCss as de}from"../lib/sections/fill-row.js";import{hiddenCardsRule as ce,noHoleBands as pe,noHoleCss as ue,ONE_WHEEL_MARK as pt,oneWheelScope as ge,pairScope as ut,showsASetCard as fe}from"../lib/sections/grid-no-hole.js";import{setIsWide as gt,summarySetBuild as ft}from"../lib/wheels/set-mode.js";import{answersForKind as he,NO_FIELD_ANSWERS as ht}from"../lib/content/field-usage.js";import{wheelCardEyebrowShows as xt}from"./ProductCardEyebrow.js";import wt from"./NoCurrencyNote.js";import{SITE_WIDTH_CAP as vt,centredCap as yt}from"efficient-web-builder/format/lib/content/page-width";import{ProductCatalogProvider as bt,SectionWheelsProvider as St}from"./ProductRef.js";import{useCurrency as Ct}from"./CurrencyContext.js";import{COLLECTION_ATTR as Mt,useCatalogFilter as Nt}from"./catalog/CatalogFilterContext.js";import{useIsoLayoutEffect as $t,useShopperMember as Et}from"./catalog/ShopperScope.js";import Tt from"./wheels-plp/PlpPagination.js";import{CATALOG_TEXT_SIZE as zt}from"../lib/sections/catalog-text-size.js";import{applyShopperFilters as Pt,hasActivePlpFilters as Lt}from"../lib/wheels/plp-filters.js";import It from"./catalog/ClearAllButton.js";import{gridPagingOf as _t,gridShownOf as Ot}from"../lib/sections/product-grid-pages.js";import At from"./SectionBand.js";import{useInsideBox as Ht,useInsideSiteGutter as Bt}from"efficient-web-builder/render/components/SiteGutterFrame";import{productGridColumnsClass as Rt}from"../lib/sections/product-grid-columns.js";import{renderGold as Y,renderHeadline as Gt}from"efficient-web-builder/render/components/goldPhrases";import{applyCatalogFilters as kt}from"../lib/wheels/catalog-filters.js";import{normalizeCatalogRows as Ft}from"../lib/wheels/wheel-summary-casing.js";import Wt from"./TyreSummaryCard.js";import{itemKind as J,plpKindNoun as xe}from"../lib/catalog/plp-item.js";import{filterBarCategoryOf as jt,gridKindsOf as we,gridRowsOf as Ut}from"../lib/wheels/grid-source.js";import{useUnifiedProductCatalog as Kt}from"./useProductCatalog.js";import{STICKY_UNDERHEADER_CLASS as Xt}from"efficient-web-builder/render/lib/document/header-clearance";import{finishFamiliesOf as Dt}from"../lib/wheels/finish-defaults.js";import{lugCountsOf as Zt}from"../lib/wheels/lug-count.js";import{diametersOf as qt}from"../lib/wheels/size-range.js";import{say as Vt}from"efficient-web-builder/format/lib/editor-words";import{DEFAULT_TITLE_SIZE as Yt}from"../lib/sections/product-grid-title.js";const Jt=it({},"ProductGrid"),i={headingMediumUpTo800Xs:"max-view-wide:text-[length:var(--size-headingMedium,28px)]",headingMediumUpTo800Small:"max-view-wide:text-[length:var(--size-headingMedium,32px)]",headingMediumUpTo800Large:"max-view-wide:text-[length:var(--size-headingMedium,36px)]",headingMediumUpTo800Xl:"max-view-wide:text-[length:var(--size-headingMedium,40px)]",body:"text-[length:var(--size-body,13px)]",headingMedium1:"text-[length:var(--size-headingMedium,40px)]",headingMedium2:"text-[length:var(--size-headingMedium,48px)]",headingMedium3:"text-[length:var(--size-headingMedium,56px)]",headingMedium4:"text-[length:var(--size-headingMedium,64px)]",labelSmall:"text-[length:var(--size-label,12px)]",labelLarge:"text-[length:var(--size-label,13px)]"},ve=[{value:"para",label:"Paragraph size — 13px",cls:`font-mono font-normal uppercase tracking-[0.22em] ${i.labelLarge}`},{value:"sm",label:"Small — 40px",cls:`font-heading2 font-medium tracking-[-0.03em] ${i.headingMedium1} ${i.headingMediumUpTo800Xs}`},{value:"md",label:"Medium — 48px",cls:`font-heading2 font-medium tracking-[-0.03em] ${i.headingMedium2} ${i.headingMediumUpTo800Small}`},{value:"lg",label:"Large — 56px",cls:`font-heading2 font-medium tracking-[-0.03em] ${i.headingMedium3} ${i.headingMediumUpTo800Large}`},{value:"xl",label:"Extra large — 64px",cls:`font-heading2 font-medium tracking-[-0.03em] ${i.headingMedium4} ${i.headingMediumUpTo800Xl}`}];function Qt(M){return(ve.find(h=>h.value===M)??ve.find(h=>h.value===Yt)).cls}function er({num:M,catalog:h,catalogTotal:ye,firstCountInChips:be=!1,kinds:E,title:A,titleSize:Se,padTop:Q,description:T,link:N,products:Ce,wheels:Me,source:p,columns:Ne,columnsPhone:$e,columnsTablet:Ee,limit:Te,moreProducts:ze,perPage:Pe,editing:x,contentCapped:Le=!1,hover:Ie,fieldUsage:w,ownerId:_e="",template:Oe,gap:Ae,gapPhone:He}){const H=u(()=>w?he(w,"alloy-wheel"):void 0,[w]),Be=u(()=>w?he(w,"tyre"):void 0,[w]),e=nt("pg"),{paged:v,per:y,limit:l,cap:$}=_t({moreProducts:ze,perPage:Pe,limit:Te}),m=Rt(Ne,$e,Ee),ee=Le,Re=Bt(),Ge=Ht(),ke=Re||Ge,B=Kt(x===!0&&!!p),o=u(()=>p?Ft(Ut(p,E,B??h??[])):null,[h,B,p,E]),R=Et("grid",o),a=o?R.scope:null,g=jt(p),b=g!==null&&!a,{filters:z,reportCount:G,reportLugs:k,reportSizes:F,reportFinishes:W,reportCategories:j,vehicle:te}=Nt(),{currency:S}=Ct(),U=b&&!!z.process&&z.process!==g,K=a?.state,n=u(()=>o?K?Pt(o,K,S):b?kt(o,z,S,te.fit):o:null,[o,K,b,z,S,te.fit]),[Fe,We]=me(1),X=v&&n?Math.max(1,Math.ceil(n.length/y)):1,C=Math.min(X,Math.max(1,a?a.state.page:Fe)),{reportShown:D}=R,re=a!==null;$t(()=>{if(!re||!n)return D(null);D(Ot(n.length,{paged:v,per:y,cap:$},C))},[re,n,D,v,C,y,$]);const je=r=>a?a.update({page:r}):We(r),s=u(()=>v&&n?n.slice((C-1)*y,C*y):n,[v,n,C,y]);O(()=>(j(e,g===null?[]:[g]),()=>j(e,[])),[g,j,e]),O(()=>{if(b)return G(e,U?0:n?.length??0),()=>G(e,0)},[b,U,n,G,e]);const P=u(()=>({lugs:Zt(o??[]),sizes:qt(o??[]),finishes:Dt(o??[])}),[o]);O(()=>(k(e,P.lugs),F(e,P.sizes),W(e,P.finishes),()=>{k(e,[]),F(e,[]),W(e,[])}),[P,k,F,W,e]);const Z=st("ProductGrid",Ae,"both",He),Ue=`${e} grid${Z.className} bg-[var(--catalog-grid-bg)] ${m}`,ne=at(Z),Ke=`${e} grid${ne.className} bg-[var(--catalog-grid-bg)] ${m}`,Xe=ne.style,De=u(()=>{const r=(n??[]).filter(c=>J(c)!=="tyre");if(r.length===0)return!1;const d=r.some(c=>!!c.process);return r.some(c=>!!c.setWords)||xt({kind:!1,brand:!1,process:d},H??[])},[n,H]),Ze=s?s.length>0?t("div",{className:Ke,style:Xe,children:t(mt,{items:s,isWheel:r=>J(r)!=="tyre",other:(r,d)=>t(Wt,{item:r,currency:S,editing:x,fieldUsage:Be},`tyre:${r.slug}-${d}`)})}):a&&Lt(a.state)?f("div",{className:"flex min-h-[320px] flex-col items-center justify-center gap-4 bg-surface-2 p-4 text-center",children:[t("span",{className:`font-mono ${i.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,children:`No ${xe(we(p,E)).many} match those filters`}),t(It,{onClick:a.clear})]}):x?t("div",{className:"flex min-h-[320px] items-center justify-center rounded bg-surface-2 p-4 text-center",children:t("span",{className:`font-mono ${i.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,children:Vt("No products in “{name}” yet",{name:p?.name??""})})}):null:t(Ce,{className:Ue,style:Z.style,minEmptyHeight:320}),qe=a?a.countInChips:be,L=n&&!qe?n===o&&!B?ye??n.length:n.length:null,ie=xe(we(p,E)),Ve=M||A||T||N?f("div",{className:`${Xt} sticky top-[var(--sf-header-h,88px)] z-30 mb-5 flex items-center justify-between gap-4 max-view-wide:flex-wrap max-view-wide:gap-y-2 border-b border-line bg-bg/95 py-3 backdrop-blur-md ${ee||ke?"":"-mx-[var(--sf-site-gutter,40px)] px-[var(--sf-site-gutter,40px)] max-view-wide:-mx-[min(20px,var(--sf-site-gutter,40px))] max-view-wide:px-[min(20px,var(--sf-site-gutter,40px))]"}`,children:[f("div",{className:"flex min-w-0 items-end gap-6 max-view-wide:flex-col max-view-wide:items-stretch max-view-wide:gap-3",children:[M&&t("span",{className:`font-mono ${i.labelLarge} leading-none uppercase tracking-[0.22em] text-fg-dim`,children:Y(M)}),A&&t("h2",{className:`${Qt(Se)} leading-none text-fg max-view-wide:leading-[1] [&>span]:block`,children:Gt(A,!1)})]}),(T||N||L!==null)&&f("div",{className:"flex items-center gap-5 max-view-wide:gap-3 view-wide:grow view-wide:justify-end",children:[T&&t("span",{className:`max-w-[340px] truncate font-display ${i.body} leading-[1.4] text-fg-dim max-view-wide:hidden view-wide:w-0 view-wide:grow view-wide:text-right`,children:Y(T)}),N&&f(ot,{href:N.href,className:`inline-flex items-center gap-2 whitespace-nowrap font-mono ${i.labelLarge} uppercase tracking-[0.2em] text-fg-dim transition-colors hover:text-fg`,children:[Y(N.text),t("span",{"aria-hidden":!0,children:"→"})]}),L!==null&&f("span",{className:`whitespace-nowrap font-mono ${i.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,children:[L," ",L===1?ie.one:ie.many]})]})]}):null,Ye=typeof Q=="number"?{"--pg-pt":`${Q}px`}:{},I=u(()=>{if(!s)return null;const r=s.map(d=>J(d)!=="tyre"&&gt(ft(d))?2:1);return fe(r,l)?pe(m,r,l):null},[s,m,l]),[Je,Qe]=me("");O(()=>{if(s)return;const r=document.querySelector(`.${e}`);if(!r)return;const d=()=>{const c=[...r.children].map(le=>le.classList.contains("col-span-2")&&!le.querySelector(pt)?2:1);Qe(fe(c,l)?ue(e,pe(m,c,l,!1),c.length):"")};d();const V=new MutationObserver(d);return V.observe(r,{childList:!0}),()=>V.disconnect()},[s,e,m,l]);const et=I?I[0].tracks:s?$?Math.min(s.length,l):s.length:void 0,_=I?ue(ut(e),I,s.length)+($?ce(ge(e),l+1):"")+de(ge(e),m,{limit:l,cards:s.length}):Je,se=_?"":de(e,m,{limit:l,cards:s?.length}),oe=dt(e),ae=f(rt,{children:[$&&!_&&t("style",{children:ce(e,l+1)}),_&&t("style",{children:_}),se&&t("style",{children:se}),oe&&t("style",{children:oe}),Ve,Ze,v&&X>1&&t(Tt,{textSize:zt.labelSmall,page:C,pageCount:X,onPage:je}),t(wt,{editing:x})]});if(U)return null;const q=t(At,{rootRef:R.ref,attrs:b&&g!==null?{[Mt]:g}:void 0,className:"relative z-[2] bg-bg px-[var(--sf-site-gutter,40px)] pt-[var(--pg-pt)] pb-[120px] max-view-wide:px-[min(20px,var(--sf-site-gutter,40px))] max-view-wide:pt-[70px] max-view-wide:pb-[70px]",column:null,inAnyBox:!0,style:Ye,defaults:{"--pg-pt":"120px"},children:ee?t("div",{style:yt(vt),children:ae}):ae}),tt=o?q:x?t(bt,{currency:S,children:q}):t(St,{wheels:Me,currency:S,children:q});return t(lt,{value:{ownerId:_e,Template:Oe,hover:Ie??Jt,imageSizes:ct(m,et),fieldUsage:H??ht,reserveEyebrow:De,editing:x===!0},children:tt})}export{ve as TITLE_SIZES,er as default};
@@ -1 +1 @@
1
- "use client";import{jsx as r}from"react/jsx-runtime";import{Render as s}from"efficient-easel/render";import{renderConfig as d}from"../lib/document/render-config.js";import{migrateRenamedProps as p}from"efficient-web-builder/format/lib/document/renamed-props";import{dropEmptySourcedBoxes as f}from"efficient-web-builder/render/lib/document/head-core-boxes";import{markWallLabels as u}from"efficient-web-builder/render/lib/document/wall-labels";import{SITE_FOOTER_KIND as c}from"efficient-web-builder/format/lib/content/footer";import{PublishedFooterContext as g}from"efficient-web-builder/render/components/PublishedFooterContext";import{EMPTY_SOCIAL_LINKS as I}from"efficient-web-builder/format/lib/content/social-links";function k({footerBlock:l,rootProps:e,headerSettings:o,siteName:m,legalName:n,foundedYear:t,socialLinks:i}){const a=u(f(p({root:{props:{...e??{},kind:c}},content:[l],zones:{}})));return r(g.Provider,{value:{logoUrl:o?.logoUrl??null,logoReversed:o?.logoReversed??null,logoInkIsDark:o?.logoInkIsDark??null,siteName:m,legalName:n??null,foundedYear:t??null,socialLinks:i??I},children:r(s,{config:d(),data:a})})}export{k as default};
1
+ "use client";import{jsx as r}from"react/jsx-runtime";import{Render as u}from"efficient-easel/render";import{renderConfig as a}from"../lib/document/render-config.js";import{publishedChromeData as d}from"../lib/document/published-chrome-data.js";import{SITE_FOOTER_KIND as f}from"efficient-web-builder/format/lib/content/footer";import{PublishedFooterContext as p}from"efficient-web-builder/render/components/PublishedFooterContext";import{EMPTY_SOCIAL_LINKS as I}from"efficient-web-builder/format/lib/content/social-links";function c({footerBlock:l,rootProps:e,headerSettings:o,siteName:n,legalName:t,foundedYear:i,socialLinks:m}){const s=d({root:{props:{...e??{},kind:f}},content:[l],zones:{}});return r(p.Provider,{value:{logoUrl:o?.logoUrl??null,logoReversed:o?.logoReversed??null,logoInkIsDark:o?.logoInkIsDark??null,siteName:n,legalName:t??null,foundedYear:i??null,socialLinks:m??I},children:r(u,{config:a(),data:s})})}export{c as default};
@@ -1 +1 @@
1
- "use client";import{jsx as t}from"react/jsx-runtime";import{Render as n}from"efficient-easel/render";import i from"./BoxHeaderBar.js";import{headerRenderConfig as p}from"../lib/document/render-config.js";import{migrateRenamedProps as m}from"efficient-web-builder/format/lib/document/renamed-props";import{chromeOwnWidth as s}from"efficient-web-builder/format/lib/content/section-width";function a({group:e}){const r=m({root:{props:{}},content:[e],zones:{}}),o=e.props??{};return t(i,{sticky:o.sticky,topTextColor:o.topTextColor,heightPx:o.heightPx,theme:o.sectionAccent,bandCapped:s(e.props??{}).background==="content",children:t(n,{config:p(),data:r})})}export{a as default};
1
+ "use client";import{jsx as e}from"react/jsx-runtime";import{Render as n}from"efficient-easel/render";import i from"./BoxHeaderBar.js";import{headerRenderConfig as p}from"../lib/document/render-config.js";import{publishedChromeData as s}from"../lib/document/published-chrome-data.js";import{chromeOwnWidth as a}from"efficient-web-builder/format/lib/content/section-width";function c({group:t}){const r=s({root:{props:{}},content:[t],zones:{}}),o=t.props??{};return e(i,{sticky:o.sticky,topTextColor:o.topTextColor,heightPx:o.heightPx,theme:o.sectionAccent,bandCapped:a(t.props??{}).background==="content",children:e(n,{config:p(),data:r})})}export{c as default};
@@ -0,0 +1,5 @@
1
+ export default function RatingBlockView({ rating: own, field, editing }: {
2
+ rating: number;
3
+ field: string;
4
+ editing: boolean;
5
+ }): import("react").JSX.Element | null;
@@ -0,0 +1 @@
1
+ "use client";import{jsx as i}from"react/jsx-runtime";import e,{RATING_STARS as u}from"./RatingStars.js";import{useCardRow as c}from"efficient-web-builder/render/components/CardRowContext";import{HideTaker as p}from"efficient-web-builder/render/components/ViewHideRoot";import{RATING_NONE as n}from"../lib/content/rating.js";function f({rating:m,field:r,editing:s}){const t=c(),o=Number.parseFloat(r&&t?t.row[r]??"":""),a=r&&t?Number.isFinite(o)&&o>n?o:n:m;return a>n?i(e,{rating:a}):!s||r&&t?null:i(p,{className:"opacity-60",children:i(e,{rating:u})})}export{f as default};
@@ -1 +1 @@
1
- "use client";import{jsx as e,Fragment as E,jsxs as r}from"react/jsx-runtime";import{useState as a}from"react";import{products as _}from"../lib/api/index.js";import j from"efficient-web-builder/render/components/SectionEyebrow";import n,{FieldCaption as q}from"./WebFormField.js";import{renderHeadline as T}from"efficient-web-builder/render/components/goldPhrases";import{FIELD_INPUT_CLASS as l}from"../lib/field-input.js";import{HideTaker as z}from"efficient-web-builder/render/components/ViewHideRoot";const A="mx-auto max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)] py-[84px] max-[960px]:px-[min(24px,var(--sf-site-gutter,40px))]",I="mx-auto max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)] pt-0 pb-[84px] max-[960px]:px-[min(24px,var(--sf-site-gutter,40px))]";function M({eyebrow:p,title:u,designCode:d,omitHead:x=!1,editing:g=!1}={}){const[f,w]=a(""),[o,N]=a(""),[i,y]=a(0),[m,S]=a(""),[h,F]=a(""),[c,v]=a(!1),[R,k]=a(!1),[b,s]=a(null);async function C(t){if(t.preventDefault(),!(g||c)){if(i<1){s("Choose a star rating.");return}v(!0),s(null);try{await _.submitReview({authorName:f.trim(),...o.trim()?{email:o.trim()}:{},rating:i,...m.trim()?{title:m.trim()}:{},body:h.trim(),...d?.trim()?{designCode:d.trim()}:{}}),k(!0)}catch{s("Something went wrong — your review wasn't sent. Please try again.")}finally{v(!1)}}}return e(z,{as:"section",className:"relative z-[2] border-t border-line bg-surface",children:r("div",{className:x?I:A,children:[x?null:r(E,{children:[(p??"").trim()&&e(j,{text:p??"",scaled:!1,className:"mb-4 block"}),(u??"").trim()&&e("h2",{className:"mb-12 font-heading2 text-[length:min(var(--size-headingMedium,44px),var(--sf-heading-max,9999px))] font-medium uppercase leading-none tracking-[-0.02em] text-fg max-view-wide:mb-8 max-view-wide:text-[length:min(var(--size-headingMedium,32px),var(--sf-heading-max,9999px))]",children:T(u??"",!1)})]}),R?e("p",{role:"status",className:"max-w-[560px] font-serif text-[19px] italic leading-[1.6] text-fg-dim",children:"Thanks — your review will appear once approved."}):r("form",{className:"flex max-w-[720px] flex-col gap-5",onSubmit:C,children:[r("div",{className:"grid grid-cols-2 gap-3 max-[640px]:grid-cols-1",children:[e(n,{label:"Name",required:!0,children:e("input",{type:"text",required:!0,value:f,onChange:t=>w(t.target.value),className:l})}),e(n,{label:"Email — never shown publicly",children:e("input",{type:"email",value:o,onChange:t=>N(t.target.value),className:l})})]}),r("div",{className:"flex flex-col gap-2",children:[e(q,{required:!0,children:"Rating"}),e("div",{role:"group","aria-label":"Rating",className:"flex gap-1",children:[1,2,3,4,5].map(t=>e("button",{type:"button","aria-pressed":i>=t,"aria-label":`${t} star${t===1?"":"s"}`,onClick:()=>{y(t),s(null)},className:["cursor-pointer text-[30px] leading-none transition-colors",i>=t?"text-accent":"text-fg-dim/30 hover:text-fg-dim"].join(" "),children:"★"},t))})]}),e(n,{label:"Review title (optional)",children:e("input",{type:"text",value:m,onChange:t=>S(t.target.value),className:l})}),e(n,{label:"Your review",required:!0,children:e("textarea",{required:!0,rows:5,value:h,onChange:t=>F(t.target.value),className:l+" resize-y"})}),b&&e("p",{role:"alert",className:"font-mono text-[12px] uppercase tracking-[0.18em] text-alert",children:b}),e("button",{type:g?"button":"submit",disabled:c,className:"cursor-pointer self-start bg-btn px-8 py-4 font-mono text-[14px] uppercase tracking-[0.32em] text-btn-ink transition-colors hover:bg-fg hover:text-bg disabled:cursor-wait disabled:opacity-60",children:c?"Sending…":"Submit review →"})]})]})})}export{M as default};
1
+ "use client";import{jsx as e,jsxs as s}from"react/jsx-runtime";import{useState as a}from"react";import{products as _}from"../lib/api/index.js";import j from"efficient-web-builder/render/components/SectionEyebrow";import n,{FieldCaption as q}from"./WebFormField.js";import{renderHeadline as z}from"efficient-web-builder/render/components/goldPhrases";import{FIELD_INPUT_CLASS as l}from"../lib/field-input.js";import{HideTaker as T}from"efficient-web-builder/render/components/ViewHideRoot";import A from"./SectionBand.js";const I="mx-auto max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)] py-[84px] max-[960px]:px-[min(24px,var(--sf-site-gutter,40px))]",M="mx-auto max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)] pt-0 pb-[84px] max-[960px]:px-[min(24px,var(--sf-site-gutter,40px))]";function B({eyebrow:u,title:p,designCode:d,omitHead:w=!1,editing:x=!1}={}){const[g,N]=a(""),[o,y]=a(""),[r,S]=a(0),[m,R]=a(""),[f,k]=a(""),[c,h]=a(!1),[C,E]=a(!1),[v,i]=a(null);async function F(t){if(t.preventDefault(),!(x||c)){if(r<1){i("Choose a star rating.");return}h(!0),i(null);try{await _.submitReview({authorName:g.trim(),...o.trim()?{email:o.trim()}:{},rating:r,...m.trim()?{title:m.trim()}:{},body:f.trim(),...d?.trim()?{designCode:d.trim()}:{}}),E(!0)}catch{i("Something went wrong — your review wasn't sent. Please try again.")}finally{h(!1)}}}const b=C?e("p",{role:"status",className:"max-w-[560px] font-serif text-[19px] italic leading-[1.6] text-fg-dim",children:"Thanks — your review will appear once approved."}):s("form",{className:"flex max-w-[720px] flex-col gap-5",onSubmit:F,children:[s("div",{className:"grid grid-cols-2 gap-3 max-[640px]:grid-cols-1",children:[e(n,{label:"Name",required:!0,children:e("input",{type:"text",required:!0,value:g,onChange:t=>N(t.target.value),className:l})}),e(n,{label:"Email — never shown publicly",children:e("input",{type:"email",value:o,onChange:t=>y(t.target.value),className:l})})]}),s("div",{className:"flex flex-col gap-2",children:[e(q,{required:!0,children:"Rating"}),e("div",{role:"group","aria-label":"Rating",className:"flex gap-1",children:[1,2,3,4,5].map(t=>e("button",{type:"button","aria-pressed":r>=t,"aria-label":`${t} star${t===1?"":"s"}`,onClick:()=>{S(t),i(null)},className:["cursor-pointer text-[30px] leading-none transition-colors",r>=t?"text-accent":"text-fg-dim/30 hover:text-fg-dim"].join(" "),children:"★"},t))})]}),e(n,{label:"Review title (optional)",children:e("input",{type:"text",value:m,onChange:t=>R(t.target.value),className:l})}),e(n,{label:"Your review",required:!0,children:e("textarea",{required:!0,rows:5,value:f,onChange:t=>k(t.target.value),className:l+" resize-y"})}),v&&e("p",{role:"alert",className:"font-mono text-[12px] uppercase tracking-[0.18em] text-alert",children:v}),e("button",{type:x?"button":"submit",disabled:c,className:"cursor-pointer self-start bg-btn px-8 py-4 font-mono text-[14px] uppercase tracking-[0.32em] text-btn-ink transition-colors hover:bg-fg hover:text-bg disabled:cursor-wait disabled:opacity-60",children:c?"Sending…":"Submit review →"})]});return w?e(A,{className:"relative z-[2] border-t border-line bg-surface",column:M,children:b}):e(T,{as:"section",className:"relative z-[2] border-t border-line bg-surface",children:s("div",{className:I,children:[(u??"").trim()&&e(j,{text:u??"",scaled:!1,className:"mb-4 block"}),(p??"").trim()&&e("h2",{className:"mb-12 font-heading2 text-[length:min(var(--size-headingMedium,44px),var(--sf-heading-max,9999px))] font-medium uppercase leading-none tracking-[-0.02em] text-fg max-view-wide:mb-8 max-view-wide:text-[length:min(var(--size-headingMedium,32px),var(--sf-heading-max,9999px))]",children:z(p??"",!1)}),b]})})}export{B as default};
@@ -6,6 +6,7 @@ export interface TyrePlpCardProps {
6
6
  kindLabel?: string | null;
7
7
  showBrand?: boolean;
8
8
  fieldUsage?: readonly FieldUsageAnswer[];
9
+ cardImage?: number | null;
9
10
  name: string;
10
11
  slug?: string | null;
11
12
  sizes: string[];
@@ -16,4 +17,4 @@ export interface TyrePlpCardProps {
16
17
  currency: string;
17
18
  editing?: boolean;
18
19
  }
19
- export default function TyrePlpCard({ brand, brandLogo, brandPlate, kindLabel, showBrand, name, slug, sizes, fitSize, rimDiameters, prices, image, currency, editing, fieldUsage, }: TyrePlpCardProps): import("react").JSX.Element;
20
+ export default function TyrePlpCard({ brand, brandLogo, brandPlate, kindLabel, showBrand, name, slug, sizes, fitSize, rimDiameters, prices, image, currency, editing, fieldUsage, cardImage, }: TyrePlpCardProps): import("react").JSX.Element;
@@ -1 +1 @@
1
- "use client";import{jsx as r}from"react/jsx-runtime";import w from"./BrandPlate.js";import g from"./card-pieces/CardBuyButton.js";import C from"./card-pieces/CardFinishSwatches.js";import P from"./card-pieces/CardPrice.js";import b from"./card-pieces/CardSizes.js";import{TyreCardStateProvider as x,useProductCardState as S}from"./card-pieces/ProductCardState.js";import{productCardEyebrow as z}from"./ProductCardEyebrow.js";import B from"./TyreImage.js";import k from"./WheelCardFrame.js";import{keepForCard as L,NO_FIELD_ANSWERS as T}from"../lib/content/field-usage.js";import{tyreModelLine as E}from"../lib/tyres/tyre-brand-name.js";import{formatSizeRange as F}from"../lib/wheels/size-range.js";function _({brand:n,brandLogo:m,brandPlate:l=!0,kindLabel:s=null,showBrand:a=!0,name:d,slug:p,sizes:e,fitSize:t=null,rimDiameters:u,prices:f,image:o,currency:c,editing:h=!1,fieldUsage:i=T}){return r(x,{tyre:{brand:n,brandLogo:m,name:d,slug:p,sizes:e,fitSize:t,rimDiameters:u,prices:f,image:o},currency:c,editing:h,children:r(j,{brandPlate:l,kindLabel:s,showBrand:a,fieldUsage:i})})}function j({brandPlate:n,kindLabel:m,showBrand:l,fieldUsage:s}){const a=S();if(a.kind!=="tyre")throw new Error("TyrePlpCard drew outside its own tyre state.");const{tyre:d,pagePath:p,arm:e}=a,{brand:t,brandLogo:u,name:f,sizes:o,rimDiameters:c,image:h}=d,i=L(s),y=[o.length>0?`${o.length} ${o.length===1?"size":"sizes"}`:null,i("rim_diameter")?F(c):null].filter(Boolean).join(" · ");return r(k,{href:p,identityLink:!0,containerProps:{onPointerEnter:e,onTouchStart:e,onFocusCapture:e},image:r(B,{image:h,className:"h-full w-full",sizes:"(max-width: 640px) 90vw, (max-width: 1024px) 45vw, 280px",showBackground:!1}),plate:n?r(w,{brand:t,logo:u}):null,eyebrow:z(m,l&&i("brand")&&t||null),name:E(t??"",f),spec:y,price:r(P,{}),swatches:r(C,{}),sizes:r(b,{}),buy:r(g,{})})}export{_ as default};
1
+ "use client";import{jsx as r}from"react/jsx-runtime";import w from"./BrandPlate.js";import C from"./card-pieces/CardBuyButton.js";import P from"./card-pieces/CardFinishSwatches.js";import b from"./card-pieces/CardPrice.js";import S from"./card-pieces/CardSizes.js";import{TyreCardStateProvider as k,useProductCardState as x}from"./card-pieces/ProductCardState.js";import{productCardEyebrow as z}from"./ProductCardEyebrow.js";import B from"./TyreImage.js";import T from"./WheelCardFrame.js";import{cardImageShapeTokens as L}from"efficient-web-builder/format/lib/content/card-image-shape";import{keepForCard as E,NO_FIELD_ANSWERS as F}from"../lib/content/field-usage.js";import{tyreModelLine as I}from"../lib/tyres/tyre-brand-name.js";import{formatSizeRange as j}from"../lib/wheels/size-range.js";function _(t){const e=L(t);return Object.keys(e).length>0?e:void 0}function v({brand:t,brandLogo:e,brandPlate:s=!0,kindLabel:d=null,showBrand:l=!0,name:i,slug:u,sizes:p,fitSize:o=null,rimDiameters:a,prices:c,image:f,currency:n,editing:y=!1,fieldUsage:h=F,cardImage:m}){return r(k,{tyre:{brand:t,brandLogo:e,name:i,slug:u,sizes:p,fitSize:o,rimDiameters:a,prices:c,image:f},currency:n,editing:y,children:r(N,{brandPlate:s,kindLabel:d,showBrand:l,fieldUsage:h,cardImage:m})})}function N({brandPlate:t,kindLabel:e,showBrand:s,fieldUsage:d,cardImage:l}){const i=x();if(i.kind!=="tyre")throw new Error("TyrePlpCard drew outside its own tyre state.");const{tyre:u,pagePath:p,arm:o}=i,{brand:a,brandLogo:c,name:f,sizes:n,rimDiameters:y,image:h}=u,m=E(d),g=[n.length>0?`${n.length} ${n.length===1?"size":"sizes"}`:null,m("rim_diameter")?j(y):null].filter(Boolean).join(" · ");return r(T,{href:p,identityLink:!0,containerProps:{style:_(l),onPointerEnter:o,onTouchStart:o,onFocusCapture:o},image:r(B,{image:h,className:"h-full w-full",sizes:"(max-width: 640px) 90vw, (max-width: 1024px) 45vw, 280px",showBackground:!1}),plate:t?r(w,{brand:a,logo:c}):null,eyebrow:z(e,s&&m("brand")&&a||null),name:I(a??"",f),spec:g,price:r(b,{}),swatches:r(P,{}),sizes:r(S,{}),buy:r(C,{})})}export{v as default};
@@ -1,6 +1,6 @@
1
1
  import type { TyreProductSummary } from "../lib/api/index.js";
2
2
  import type { FieldUsageAnswer } from "../lib/content/field-usage.js";
3
- export default function TyreSummaryCard({ item, currency, kindLabel, showBrand, fitSize, editing, fieldUsage, }: {
3
+ export default function TyreSummaryCard({ item, currency, kindLabel, showBrand, fitSize, editing, fieldUsage, cardImage, }: {
4
4
  item: TyreProductSummary;
5
5
  currency: string;
6
6
  fitSize?: string | null;
@@ -8,4 +8,5 @@ export default function TyreSummaryCard({ item, currency, kindLabel, showBrand,
8
8
  showBrand?: boolean;
9
9
  editing?: boolean;
10
10
  fieldUsage?: readonly FieldUsageAnswer[];
11
+ cardImage?: number | null;
11
12
  }): import("react").JSX.Element;
@@ -1 +1 @@
1
- "use client";import{jsx as o}from"react/jsx-runtime";import d from"./TyrePlpCard.js";function u({item:r,currency:e,kindLabel:a=null,showBrand:s=!0,fitSize:n=null,editing:i=!1,fieldUsage:l}){return o(d,{brand:r.brand,brandLogo:r.brandLogo,kindLabel:a,showBrand:s,name:r.name,slug:r.slug,sizes:r.sizes,fitSize:n,rimDiameters:r.rimDiameters,prices:r.prices,image:r.coverImage,currency:e,editing:i,fieldUsage:l})}export{u as default};
1
+ "use client";import{jsx as o}from"react/jsx-runtime";import u from"./TyrePlpCard.js";function g({item:r,currency:e,kindLabel:a=null,showBrand:s=!0,fitSize:n=null,editing:d=!1,fieldUsage:i,cardImage:l}){return o(u,{brand:r.brand,brandLogo:r.brandLogo,kindLabel:a,showBrand:s,name:r.name,slug:r.slug,sizes:r.sizes,fitSize:n,rimDiameters:r.rimDiameters,prices:r.prices,image:r.coverImage,currency:e,editing:d,fieldUsage:i,cardImage:l})}export{g as default};
@@ -7,10 +7,9 @@ export declare const cardRowsGap: (zone: {
7
7
  }) => string;
8
8
  export { CARD_PAD_X_PX, GRID_GAP_PX, SET_PLATE_PX, SET_STACK_GAP_PX, SET_STACK_MAX_PX, setBandGapCss, setBandGapPx, setPlateWidthCss, } from "./card-pieces/CardPicture.js";
9
9
  export { CARD_SPEC_FIELD_CLASS, cardSpecFields, type CardSpecField } from "./card-pieces/CardSpecs.js";
10
- export default function WheelCardFrame({ variant, wide, setGridGap, href, identityLink, outline, imageBackgroundFill, containerProps, probes, indexBadge, badges, image, imageSecond, plate, eyebrow, reserveEyebrow, name, spec, price, swatches, sizes, buy, wholeCardLink, }: {
10
+ export default function WheelCardFrame({ variant, wide, href, identityLink, outline, imageBackgroundFill, containerProps, probes, indexBadge, badges, image, imageSecond, plate, eyebrow, reserveEyebrow, name, spec, price, swatches, sizes, buy, wholeCardLink, }: {
11
11
  variant?: "compact" | "catalog";
12
12
  wide?: boolean;
13
- setGridGap?: string;
14
13
  href?: string | null;
15
14
  identityLink?: boolean;
16
15
  outline?: CardOutline;