efficient-storefront-blocks 0.75.0 → 0.77.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 (278) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/dist/chunks/EditorPreviewCheckout-GNQP4MQ4.js +4 -0
  3. package/dist/chunks/{SiteEditorProvider-N4T55FAV.js → SiteEditorProvider-R3HXJAPW.js} +1 -1
  4. package/dist/chunks/chunk-BOJGJXIU.js +311 -0
  5. package/dist/chunks/chunk-CAULWKXR.js +1 -0
  6. package/dist/chunks/chunk-GDR5GGVW.js +1 -0
  7. package/dist/chunks/chunk-OWYNZAAY.js +1 -0
  8. package/dist/chunks/chunk-ZIZWJZ5T.js +1 -0
  9. package/dist/chunks/{fitment-data-5ZSHENM3.js → fitment-data-JNQKYQIB.js} +1 -1
  10. package/dist/contract.js +2 -2
  11. package/dist/editor/components/BlogSource.js +1 -1
  12. package/dist/editor/components/CategoryProductFields.d.ts +22 -0
  13. package/dist/editor/components/CategoryProductFields.js +1 -0
  14. package/dist/editor/components/CategorySource.d.ts +12 -0
  15. package/dist/editor/components/CategorySource.js +1 -1
  16. package/dist/editor/components/CollectionPicker.js +1 -1
  17. package/dist/editor/components/CountryShowAsTiles.js +1 -1
  18. package/dist/editor/components/EditorPreviewChat.js +1 -11
  19. package/dist/editor/components/EditorPreviewSurface.js +1 -1
  20. package/dist/editor/components/GalleryProductBinding.js +1 -1
  21. package/dist/editor/components/GalleryShowcaseSource.js +1 -1
  22. package/dist/editor/components/HeaderSettingsPanel.d.ts +8 -4
  23. package/dist/editor/components/HeaderSettingsPanel.js +1 -1
  24. package/dist/editor/components/MenuPicker.js +1 -1
  25. package/dist/editor/components/PreviewProductPicker.js +1 -1
  26. package/dist/editor/components/ProductHeroSource.js +1 -1
  27. package/dist/editor/components/ProductPicker.js +1 -1
  28. package/dist/editor/components/SocialLinksDoor.js +1 -1
  29. package/dist/editor/components/SpecTableSource.js +1 -1
  30. package/dist/editor/lib/document/block-align-row.d.ts +2 -0
  31. package/dist/editor/lib/document/block-align-row.js +1 -0
  32. package/dist/editor/lib/document/blocks/commerce/AccountBlock/fields.js +1 -1
  33. package/dist/editor/lib/document/blocks/commerce/AlloyWheelsListing/fields.js +1 -1
  34. package/dist/editor/lib/document/blocks/commerce/BundleOffer/fields.js +1 -1
  35. package/dist/editor/lib/document/blocks/commerce/CartBlock/fields.js +1 -1
  36. package/dist/editor/lib/document/blocks/commerce/CatalogFilterBar/fields.js +1 -1
  37. package/dist/editor/lib/document/blocks/commerce/CheckoutCTA/fields.js +1 -1
  38. package/dist/editor/lib/document/blocks/commerce/CollectionCard/fields.js +1 -1
  39. package/dist/editor/lib/document/blocks/commerce/Collections/fields.js +1 -1
  40. package/dist/editor/lib/document/blocks/commerce/CompatibleTyres/fields.js +1 -1
  41. package/dist/editor/lib/document/blocks/commerce/CountrySwitchBlock/fields.js +1 -1
  42. package/dist/editor/lib/document/blocks/commerce/DeliveryOptions/fields.js +1 -1
  43. package/dist/editor/lib/document/blocks/commerce/DetailRows/fields.js +1 -1
  44. package/dist/editor/lib/document/blocks/commerce/EuTyreLabel/fields.js +1 -1
  45. package/dist/editor/lib/document/blocks/commerce/FitmentFinder/fields.js +1 -1
  46. package/dist/editor/lib/document/blocks/commerce/FitmentTable/fields.js +1 -1
  47. package/dist/editor/lib/document/blocks/commerce/Gallery/fields.js +1 -1
  48. package/dist/editor/lib/document/blocks/commerce/GalleryB/fields.js +1 -1
  49. package/dist/editor/lib/document/blocks/commerce/GalleryItem/fields.js +1 -1
  50. package/dist/editor/lib/document/blocks/commerce/ProductGallery/fields.d.ts +2 -2
  51. package/dist/editor/lib/document/blocks/commerce/ProductGallery/fields.js +1 -1
  52. package/dist/editor/lib/document/blocks/commerce/ProductGrid/fields.js +1 -1
  53. package/dist/editor/lib/document/blocks/commerce/ProductHero/fields.js +1 -1
  54. package/dist/editor/lib/document/blocks/commerce/RelatedProducts/fields.js +1 -1
  55. package/dist/editor/lib/document/blocks/commerce/SearchBlock/fields.js +1 -1
  56. package/dist/editor/lib/document/blocks/commerce/SpecTable/fields.js +1 -1
  57. package/dist/editor/lib/document/blocks/commerce/TyreFitment/fields.js +1 -1
  58. package/dist/editor/lib/document/blocks/commerce/TyreSizes/fields.js +1 -1
  59. package/dist/editor/lib/document/blocks/commerce/shared-fields.d.ts +1 -0
  60. package/dist/editor/lib/document/blocks/commerce/shared-fields.js +1 -1
  61. package/dist/editor/lib/document/blocks/service/AppointmentBooking/fields.js +1 -1
  62. package/dist/editor/lib/document/blocks/service/BookingBox/fields.js +1 -1
  63. package/dist/editor/lib/document/blocks/service/ContactCards/fields.js +1 -1
  64. package/dist/editor/lib/document/blocks/service/ContactRouting/fields.js +1 -1
  65. package/dist/editor/lib/document/blocks/service/Events/fields.js +1 -1
  66. package/dist/editor/lib/document/blocks/service/Footer/fields.js +1 -1
  67. package/dist/editor/lib/document/blocks/service/FooterDivider/fields.js +1 -1
  68. package/dist/editor/lib/document/blocks/service/FooterEmailSignup/fields.js +1 -1
  69. package/dist/editor/lib/document/blocks/service/FooterGroup/fields.js +1 -1
  70. package/dist/editor/lib/document/blocks/service/FooterLogo/fields.js +1 -1
  71. package/dist/editor/lib/document/blocks/service/FooterMenu/fields.js +1 -1
  72. package/dist/editor/lib/document/blocks/service/FooterMessaging/fields.js +1 -1
  73. package/dist/editor/lib/document/blocks/service/FooterPayment/fields.js +1 -1
  74. package/dist/editor/lib/document/blocks/service/FooterSocial/fields.js +1 -1
  75. package/dist/editor/lib/document/blocks/service/FooterText/fields.js +1 -1
  76. package/dist/editor/lib/document/blocks/service/Form/fields.js +1 -1
  77. package/dist/editor/lib/document/blocks/service/MessagingCards/fields.js +1 -1
  78. package/dist/editor/lib/document/blocks/service/OpeningHours/fields.js +1 -1
  79. package/dist/editor/lib/document/blocks/service/RateTable/fields.js +1 -1
  80. package/dist/editor/lib/document/blocks/service/RatingBlock/fields.js +1 -1
  81. package/dist/editor/lib/document/blocks/service/ReviewForm/fields.js +1 -1
  82. package/dist/editor/lib/document/blocks/service/Reviews/fields.js +1 -1
  83. package/dist/editor/lib/document/blocks/service/SiteHeader/fields.js +1 -1
  84. package/dist/editor/lib/document/blocks/service/SubmitBox/fields.js +1 -1
  85. package/dist/editor/lib/document/blocks/service/SubmitBuild/fields.js +1 -1
  86. package/dist/editor/lib/document/blocks/service/Subscribe/fields.js +1 -1
  87. package/dist/editor/lib/document/blocks/service/SubscribeBlogs/fields.js +1 -1
  88. package/dist/editor/lib/document/box-header.js +1 -1
  89. package/dist/editor/lib/document/config.d.ts +16 -16
  90. package/dist/editor/lib/document/config.js +1 -1
  91. package/dist/editor/lib/editor-currency-source.js +1 -1
  92. package/dist/editor/lib/storefront-editor-words.d.ts +10 -13
  93. package/dist/editor/lib/storefront-editor-words.js +1 -1
  94. package/dist/editor.css +1 -1
  95. package/dist/index.js +214 -724
  96. package/dist/links.js +1 -1
  97. package/dist/render/app/globals.css +45 -79
  98. package/dist/render/built-with.json +1 -1
  99. package/dist/render/components/BoxHeaderBar.js +1 -1
  100. package/dist/render/components/CartContext.d.ts +1 -0
  101. package/dist/render/components/CartContext.js +1 -1
  102. package/dist/render/components/CartDrawer.js +2 -2
  103. package/dist/render/components/CatalogFilterBarSection.d.ts +1 -1
  104. package/dist/render/components/CatalogFilterBarSection.js +1 -1
  105. package/dist/render/components/ChatWidget.js +1 -1
  106. package/dist/render/components/Collections.js +1 -1
  107. package/dist/render/components/CompatibleTyres.js +1 -1
  108. package/dist/render/components/ConsentPanel.js +1 -1
  109. package/dist/render/components/ContactRouting.js +1 -1
  110. package/dist/render/components/CouponField.js +1 -1
  111. package/dist/render/components/CurrencyContext.js +1 -1
  112. package/dist/render/components/Events.d.ts +2 -1
  113. package/dist/render/components/Events.js +1 -1
  114. package/dist/render/components/FitmentTable.js +1 -1
  115. package/dist/render/components/FooterGroup.d.ts +3 -2
  116. package/dist/render/components/FooterGroup.js +1 -1
  117. package/dist/render/components/FooterLogo.d.ts +2 -1
  118. package/dist/render/components/FooterMenu.js +1 -1
  119. package/dist/render/components/FooterPayment.d.ts +1 -2
  120. package/dist/render/components/FooterPayment.js +1 -1
  121. package/dist/render/components/FooterSocial.d.ts +1 -2
  122. package/dist/render/components/FooterSocial.js +1 -1
  123. package/dist/render/components/FormBlock.js +1 -1
  124. package/dist/render/components/GalleryGrid.d.ts +2 -1
  125. package/dist/render/components/GalleryGrid.js +1 -1
  126. package/dist/render/components/GalleryItem.js +1 -1
  127. package/dist/render/components/GalleryShowcase.js +1 -1
  128. package/dist/render/components/Header.js +1 -1
  129. package/dist/render/components/HeaderTools.js +1 -1
  130. package/dist/render/components/Lightbox.d.ts +2 -2
  131. package/dist/render/components/Lightbox.js +1 -1
  132. package/dist/render/components/LinkedProductHero.d.ts +2 -0
  133. package/dist/render/components/Notice.d.ts +6 -0
  134. package/dist/render/components/Notice.js +1 -0
  135. package/dist/render/components/PopupFrame.d.ts +17 -4
  136. package/dist/render/components/PopupFrame.js +1 -1
  137. package/dist/render/components/ProductGallery.js +1 -1
  138. package/dist/render/components/ProductGridSection.d.ts +2 -1
  139. package/dist/render/components/ProductGridSection.js +1 -1
  140. package/dist/render/components/ProductHeroPanel.d.ts +3 -1
  141. package/dist/render/components/ProductHeroPanel.js +1 -1
  142. package/dist/render/components/ProductLightbox.js +1 -1
  143. package/dist/render/components/ReviewForm.js +1 -1
  144. package/dist/render/components/SpecTable.d.ts +2 -1
  145. package/dist/render/components/SpecTable.js +1 -1
  146. package/dist/render/components/SubscribePopup.js +2 -2
  147. package/dist/render/components/TyreFitVerdicts.d.ts +2 -1
  148. package/dist/render/components/TyreFitVerdicts.js +1 -1
  149. package/dist/render/components/TyreRenderSvg.js +1 -1
  150. package/dist/render/components/TyreVehicleFitment.js +1 -1
  151. package/dist/render/components/WheelCardFrame.d.ts +3 -0
  152. package/dist/render/components/WheelCardFrame.js +1 -1
  153. package/dist/render/components/booking/BookingRegions.js +1 -1
  154. package/dist/render/components/catalog/CatalogFilterBar.d.ts +4 -4
  155. package/dist/render/components/catalog/CatalogFilterBar.js +1 -1
  156. package/dist/render/components/catalog/CatalogFilterContext.d.ts +5 -3
  157. package/dist/render/components/catalog/CatalogFilterContext.js +1 -1
  158. package/dist/render/components/catalog/FilterPill.d.ts +3 -1
  159. package/dist/render/components/catalog/FilterPill.js +1 -1
  160. package/dist/render/components/checkout/CheckoutPageClient.d.ts +4 -0
  161. package/dist/render/components/checkout/CheckoutPageClient.js +1 -1
  162. package/dist/render/components/checkout/checkout-parts.js +1 -1
  163. package/dist/render/components/checkout/checkout-state.d.ts +25 -1
  164. package/dist/render/components/checkout/checkout-state.js +3 -3
  165. package/dist/render/components/fitment/StockFitmentCard.js +1 -1
  166. package/dist/render/components/pdp-dynamic/DynamicProductGallery.js +1 -1
  167. package/dist/render/components/pdp-dynamic/DynamicProductHero.d.ts +2 -0
  168. package/dist/render/components/pdp-dynamic/DynamicRelatedProducts.js +1 -1
  169. package/dist/render/components/pdp-dynamic/DynamicSpecTable.js +1 -1
  170. package/dist/render/components/pdp-dynamic/RecordPhotoGallery.js +1 -1
  171. package/dist/render/components/product-hero/TyreHeroFitment.d.ts +2 -1
  172. package/dist/render/components/product-hero/TyreHeroFitment.js +1 -1
  173. package/dist/render/components/product-hero/VehicleQuestion.d.ts +1 -6
  174. package/dist/render/components/product-hero/VehicleQuestion.js +1 -1
  175. package/dist/render/components/product-hero/WheelHeroFitment.js +1 -1
  176. package/dist/render/components/product-hero/trust-bullets.d.ts +5 -0
  177. package/dist/render/components/product-hero/trust-bullets.js +1 -0
  178. package/dist/render/components/useModalDismiss.d.ts +2 -1
  179. package/dist/render/components/useModalDismiss.js +1 -1
  180. package/dist/render/components/useTyreFitAnswer.d.ts +1 -0
  181. package/dist/render/components/useTyreFitAnswer.js +1 -1
  182. package/dist/render/components/wheels-plp/AlloyWheelsListing.js +1 -1
  183. package/dist/render/components/wheels-plp/PlpNotifyMeDialog.js +1 -1
  184. package/dist/render/lib/api/index.d.ts +6 -3
  185. package/dist/render/lib/api/index.js +1 -1
  186. package/dist/render/lib/api/types.d.ts +3 -0
  187. package/dist/render/lib/booking/appointment-time.d.ts +2 -0
  188. package/dist/render/lib/booking/appointment-time.js +1 -0
  189. package/dist/render/lib/catalog/from-wheel.js +1 -1
  190. package/dist/render/lib/catalog/plp-item.js +1 -1
  191. package/dist/render/lib/checkout/pay-first.d.ts +34 -0
  192. package/dist/render/lib/checkout/pay-first.js +1 -0
  193. package/dist/render/lib/checkout/stripe-appearance.d.ts +10 -0
  194. package/dist/render/lib/checkout/stripe-appearance.js +1 -0
  195. package/dist/render/lib/checkout/wallet-return.d.ts +1 -1
  196. package/dist/render/lib/commerce.d.ts +1 -0
  197. package/dist/render/lib/commerce.js +1 -1
  198. package/dist/render/lib/content/legacy-block-align.d.ts +2 -0
  199. package/dist/render/lib/content/legacy-block-align.js +1 -0
  200. package/dist/render/lib/content/menu-row.d.ts +0 -3
  201. package/dist/render/lib/content/menu-row.js +1 -1
  202. package/dist/render/lib/document/blocks/commerce/AlloyWheelsListing/meta.js +1 -1
  203. package/dist/render/lib/document/blocks/commerce/BundleOffer/meta.js +1 -1
  204. package/dist/render/lib/document/blocks/commerce/CheckoutCTA/meta.js +1 -1
  205. package/dist/render/lib/document/blocks/commerce/Collections/meta.js +1 -1
  206. package/dist/render/lib/document/blocks/commerce/CompatibleTyres/meta.js +1 -1
  207. package/dist/render/lib/document/blocks/commerce/DeliveryOptions/meta.js +1 -1
  208. package/dist/render/lib/document/blocks/commerce/DetailRows/meta.js +1 -1
  209. package/dist/render/lib/document/blocks/commerce/EuTyreLabel/meta.js +1 -1
  210. package/dist/render/lib/document/blocks/commerce/FitmentFinder/meta.js +1 -1
  211. package/dist/render/lib/document/blocks/commerce/FitmentTable/meta.js +1 -1
  212. package/dist/render/lib/document/blocks/commerce/GalleryB/render.js +1 -1
  213. package/dist/render/lib/document/blocks/commerce/ProductGrid/meta.js +1 -1
  214. package/dist/render/lib/document/blocks/commerce/ProductGrid/render.js +1 -1
  215. package/dist/render/lib/document/blocks/commerce/ProductHero/meta.d.ts +6 -0
  216. package/dist/render/lib/document/blocks/commerce/ProductHero/meta.js +1 -1
  217. package/dist/render/lib/document/blocks/commerce/ProductHero/render.js +1 -1
  218. package/dist/render/lib/document/blocks/commerce/RelatedProducts/meta.js +1 -1
  219. package/dist/render/lib/document/blocks/commerce/SpecTable/meta.js +1 -1
  220. package/dist/render/lib/document/blocks/commerce/SpecTable/render.js +1 -1
  221. package/dist/render/lib/document/blocks/commerce/TyreFitment/meta.js +1 -1
  222. package/dist/render/lib/document/blocks/commerce/TyreSizes/meta.js +1 -1
  223. package/dist/render/lib/document/blocks/service/ContactCards/meta.js +1 -1
  224. package/dist/render/lib/document/blocks/service/ContactRouting/meta.js +1 -1
  225. package/dist/render/lib/document/blocks/service/Events/render.js +1 -1
  226. package/dist/render/lib/document/blocks/service/FooterGroup/render.js +1 -1
  227. package/dist/render/lib/document/blocks/service/FooterPayment/meta.js +1 -1
  228. package/dist/render/lib/document/blocks/service/FooterSocial/meta.js +1 -1
  229. package/dist/render/lib/document/blocks/service/MessagingCards/meta.js +1 -1
  230. package/dist/render/lib/document/blocks/service/OpeningHours/meta.js +1 -1
  231. package/dist/render/lib/document/blocks/service/RateTable/meta.js +1 -1
  232. package/dist/render/lib/document/blocks/service/SubmitBuild/meta.js +1 -1
  233. package/dist/render/lib/document/blocks/service/Subscribe/meta.js +1 -1
  234. package/dist/render/lib/document/blocks/service/SubscribeBlogs/meta.js +1 -1
  235. package/dist/render/lib/document/lazy-draws.js +1 -1
  236. package/dist/render/lib/document/render-client.d.ts +8 -3
  237. package/dist/render/lib/document/render-client.js +1 -1
  238. package/dist/render/lib/document/section-to-box-rows-reviews.js +1 -1
  239. package/dist/render/lib/document/storefront-root.d.ts +0 -2
  240. package/dist/render/lib/document/storefront-root.js +1 -1
  241. package/dist/render/lib/field-input.d.ts +1 -0
  242. package/dist/render/lib/field-input.js +1 -0
  243. package/dist/render/lib/sections/content-cap-gutter.d.ts +1 -0
  244. package/dist/render/lib/sections/content-cap-gutter.js +1 -0
  245. package/dist/render/lib/sections/hero-trust-bullets.d.ts +2 -0
  246. package/dist/render/lib/sections/hero-trust-bullets.js +1 -0
  247. package/dist/render/lib/tyres/spec-sheet.d.ts +17 -0
  248. package/dist/render/lib/tyres/spec-sheet.js +1 -1
  249. package/dist/render/lib/tyres/tyre-fit-copy.js +1 -1
  250. package/dist/render/lib/tyres/tyre-vehicle-fitment.d.ts +3 -1
  251. package/dist/render/lib/tyres/tyre-vehicle-fitment.js +1 -1
  252. package/dist/render/lib/use-scope-class.d.ts +1 -0
  253. package/dist/render/lib/use-scope-class.js +1 -0
  254. package/dist/render/lib/wheels/catalog-default-layout.d.ts +3 -3
  255. package/dist/render/lib/wheels/catalog-default-layout.js +1 -1
  256. package/dist/render/lib/wheels/catalog-filters.d.ts +2 -2
  257. package/dist/render/lib/wheels/catalog-filters.js +1 -1
  258. package/dist/render/lib/wheels/grid-source.d.ts +7 -1
  259. package/dist/render/lib/wheels/grid-source.js +1 -1
  260. package/dist/render/lib/wheels/plp-hydrate.js +1 -1
  261. package/dist/words.d.ts +46 -50
  262. package/dist/words.js +6 -6
  263. package/package.json +4 -4
  264. package/dist/chunks/EditorPreviewCheckout-27GNLSNR.js +0 -4
  265. package/dist/chunks/chunk-3TBLX25X.js +0 -1
  266. package/dist/chunks/chunk-4V6BLJSG.js +0 -1
  267. package/dist/chunks/chunk-K26JUDGZ.js +0 -1
  268. package/dist/chunks/chunk-SJODSVWU.js +0 -1
  269. package/dist/chunks/chunk-WPHE7RI4.js +0 -246
  270. package/dist/render/components/product-hero/hero-content.d.ts +0 -7
  271. package/dist/render/components/product-hero/hero-content.js +0 -1
  272. package/dist/render/components/useIsLightTheme.d.ts +0 -1
  273. package/dist/render/components/useIsLightTheme.js +0 -1
  274. package/dist/render/lib/content/product-hero.d.ts +0 -14
  275. package/dist/render/lib/content/product-hero.js +0 -1
  276. package/dist/render/lib/wheels/collections.d.ts +0 -22
  277. package/dist/render/lib/wheels/collections.js +0 -1
  278. /package/dist/chunks/{chunk-WPHE7RI4.js.LEGAL.txt → chunk-BOJGJXIU.js.LEGAL.txt} +0 -0
package/dist/links.js CHANGED
@@ -1 +1 @@
1
- var g={bold:{open:"**",close:"**",placeholder:"bold text"},italic:{open:"_",close:"_",placeholder:"italic text"},strike:{open:"~~",close:"~~",placeholder:"struck out"},code:{open:"`",close:"`",placeholder:"code"},highlight:{open:"==",close:"==",placeholder:"highlighted text"},quiet:{open:"^^",close:"^^",placeholder:"quiet text"},underline:{open:"[",close:"]{underline}",placeholder:"underlined text"},sup:{open:"[",close:"]{sup}",placeholder:"superscript"},sub:{open:"[",close:"]{sub}",placeholder:"subscript"}};var De={bold:g.bold.placeholder,italic:g.italic.placeholder,strike:g.strike.placeholder,code:g.code.placeholder,highlight:g.highlight.placeholder,quiet:g.quiet.placeholder,link:"link text",underline:g.underline.placeholder,sup:g.sup.placeholder,sub:g.sub.placeholder,color:"colored text"};var X=[{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 x=[{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}],J=["highlight","quiet"],Ue=X.map(e=>e.style).filter(e=>x.some(n=>n.kind===e)).filter(e=>!J.includes(e)),ze=[...x,{open:"*",close:"*",kind:"accent"}],$e=[...x,{open:"*",close:"*",kind:"accent"},{open:"#",close:"#",kind:"bold",notBefore:"0123456789"},{open:"[",close:"]",kind:"italic",notBefore:"(",notBeforeBlock:!0}];var Be=["http","https","mailto","tel"];function M(e){if(e===""||/[\s\u0000-\u001f\u007f]/.test(e))return!1;let n=/^([a-zA-Z][a-zA-Z0-9+.-]*):/.exec(e);return!n||Be.includes(n[1].toLowerCase())}var ee=["width","profile","rim"];var We=/^\s*(\d{2,3})\s*\/\s*(\d{2,3})\s*[A-Za-z]*\s*(\d{2}(?:\.\d+)?)\s*$/,Ge={width:[100,500],profile:[20,100],rim:[10,30]};function v(e){let n=We.exec(e??"");if(!n)return null;let t={width:Number(n[1]),profile:Number(n[2]),rim:Number(n[3])};return ee.every(i=>{let[a,u]=Ge[i];return t[i]>=a&&t[i]<=u})?t:null}function w(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 ne(e){return[w({width:e.width}),w({width:e.width,profile:e.profile}),w(e)]}var S=["alloy-wheel","tyre"],te=["alloy-wheel"],L={"alloy-wheel":"Alloy wheels",tyre:"Tyres"};var Hn=S.map(e=>({value:e,label:L[e]}));function D(e){return e==null?[...te]:Array.isArray(e)?S.filter(n=>e.includes(n)):[...te]}var m=e=>e;function f(e){return m(e).kind==="tyre"?"tyre":"alloy-wheel"}function U(e){return m(e).brand??""}function re(e){return m(e).prices??void 0}function ie(e){return m(e).inStock!==!1}function oe(e){let n=m(e),t=f(e)==="tyre"?n.rimDiameters:n.sizes;return Array.isArray(t)?t.filter(r=>typeof r=="number"&&Number.isFinite(r)):[]}function z(e){return f(e)==="tyre"?[]:(m(e).finishes??[]).filter(n=>typeof n?.family=="string").map(n=>({family:n.family,color:n.color??null}))}function le(e){return z(e).map(n=>n.family)}function se(e){if(f(e)==="tyre")return[];let n=m(e),t=n.categories;return t&&t.length>0?t:n.process?[n.process]:[]}function ae(e){return f(e)==="tyre"?[]:m(e).spec?.pcds??[]}function ue(e){return f(e)!=="tyre"?[]:m(e).tyreTypes??[]}function ce(e){return f(e)!=="tyre"?[]:m(e).speedRatings??[]}function pe(e){if(f(e)!=="tyre")return[];let n=m(e).sizes;return Array.isArray(n)?n.map(t=>v(typeof t=="string"?t:null)).filter(t=>t!==null):[]}var $=e=>typeof e=="string"&&e?e:void 0;var de=null;function fe(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=de?de[e]:void 0;if(typeof t=="function"){try{let r=$(t(n??{}));if(r)return r}catch{}return fe(e,n)}return fe($(t)??e,n)}var me="homepage";function B(e){return(e??"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}var F=[{value:"page",label:"Page"},{value:"anchor",label:"Anchor"},{value:"blog",label:"Blog post",needs:"service"},{value:"product",label:"Product",needs:"commerce"},{value:"popup",label:"Popup"},{value:"custom",label:"Custom URL"}];function T(e){return e.offersCommerce&&e.offersService?F:F.filter(n=>!n.needs||(n.needs==="commerce"?e.offersCommerce:e.offersService))}var W="#popup:";function he(e){return`${W}${e}`}function ge(e){return e.startsWith(W)&&e.slice(W.length).trim()||null}function P(e){return e===me?"/":`/${e}`}function _(e){return`/journal/${e}`}function A(e){return`/wheels/${e}`}function R(e,n){return`${P(e)}#${n}`}function Ye(e){return typeof e=="string"?e.trim():e&&typeof e=="object"&&typeof e.text=="string"?e.text.trim():""}function E(...e){let n=new Set,t=[];for(let r of e)for(let i of r?.content??[]){let a=Ye(i?.props?.anchor);if(!a)continue;let u=B(a);!u||n.has(u)||(n.add(u),t.push({slug:u,name:a}))}return t}function ye(e){return/^\/wheels\/[^/?#]+(?:[?#].*)?$/.test(e)}var qe=()=>({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 I(e,n,t){if(!e)return"page";if(ge(e))return"popup";if(e.startsWith("/journal/"))return"blog";if(ye(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 Pe(e,n){let t=qe(),r=e.pages.map(l=>({value:P(l.slug),label:l.title})),i=n?.pageOptions?n.pageOptions(r):r,a=i.map(l=>l.value),u=e.pages.map(l=>({label:l.title,options:E(...l.docs).map(c=>({value:R(l.slug,c.slug),label:c.name}))})).filter(l=>l.options.length>0),p=l=>{switch(l){case"page":return{type:"select",options:i,placeholder:t.choosePage};case"anchor":return{type:"groups",groups:u,placeholder:u.length?t.chooseSection:t.noSections};case"blog":return{type:"select",options:e.posts.map(c=>({value:_(c.slug),label:c.title||c.slug})),placeholder:t.choosePost};case"product":return{type:"select",options:e.products.map(c=>({value:c.href,label:c.name||c.href})),placeholder:t.chooseProduct};case"popup":return{type:"select",options:(e.popups??[]).map(c=>({value:he(c.slug),label:c.title||c.slug})),placeholder:t.choosePopup};case"custom":return{type:"text"}}},s=T(e.offers).map(l=>({value:l.value,label:y(l.label),target:p(l.value),...l.value==="anchor"?{hint:t.sectionHint}:{},...l.value==="blog"||l.value==="product"||l.value==="popup"?{hideWhenEmpty:!0}:{}}));if(!n)return{kinds:s,rules:{kindOf:l=>I(l,a),targetOf:l=>l,readFilter:()=>null,withFilter:l=>l}};let o=l=>{let c=n.withFilter(l,null);return n.listingPaths.includes(c)?c:l};return{kinds:s,rules:{kindOf:l=>I(l,a,{listingPaths:n.listingPaths,targetOf:o}),targetOf:o,readFilter:n.readFilter,withFilter:n.withFilter},filtersFor:l=>n.listingPaths.includes(l)?n.filtersFor(l):null}}function G(e,n){return e.length===0?e:e.filter(t=>t.kind===void 0||t.kind===n)}function be(e,n){let t=n==="filter"?"filterOrder":"cardOrder",r=new Map;for(let i of e){let a=i[t];if(typeof a!="number"||!Number.isFinite(a))continue;let u=r.get(i.fieldKey);(u===void 0||a<u)&&r.set(i.fieldKey,a)}return i=>i?r.get(i):void 0}function Se(e,n,t,r){let i=new Map;for(let s of t){let o=s[r];typeof o=="number"&&i.set(s.fieldKey,o)}if(i.size===0)return e;let a=[],u=[];e.forEach((s,o)=>{let l=n(s);l&&(a.push(o),u.push({item:s,index:o,order:i.get(l)}))}),u.sort((s,o)=>s.order!==void 0&&o.order!==void 0?s.order-o.order||s.index-o.index:s.order!==void 0?-1:o.order!==void 0?1:s.index-o.index);let p=[...e];return a.forEach((s,o)=>{p[s]=u[o].item}),p.every((s,o)=>s===e[o])?e:p}function ke(e){return je(e,"filter")}var He="collection";function Y(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":He},pcds:{"alloy-wheel":"pcd"},tyreTypes:{tyre:"tire_type"},speedRatings:{tyre:"speed_rating"}}[e]?.[n]}function je(e,n){let t=new Set(e.filter(r=>r[n]===!1).map(r=>r.fieldKey));return r=>!r||!t.has(r)}function Ze(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function xe(e,n){let t=e?.[n];return Ze(t)?t:null}function we(e,n,t,r){if(t==null&&r==null)return!0;let i=xe(e,n);return!(i===null||t!=null&&i<t||r!=null&&i>r)}var Ve={recommended:"Recommended","price-asc":"Price \xB7 low to high","price-desc":"Price \xB7 high to low",new:"Newest",name:"Name A\u2013Z"},It=Object.keys(Ve);var Le=["tyreSizes","brands","finishes","diameters","collections","pcds","tyreTypes","speedRatings"],Qe={tyreSizes:["tyre"],brands:["alloy-wheel","tyre"],finishes:["alloy-wheel"],diameters:["alloy-wheel","tyre"],collections:["alloy-wheel"],pcds:["alloy-wheel"],tyreTypes:["tyre"],speedRatings:["tyre"]},Xe={diameters:"tyreSizes"};function Je(e){if(e.length===0)return[];let n=Le.filter(t=>e.every(r=>Qe[t].includes(r)));return n.filter(t=>{let r=Xe[t];return!r||!n.includes(r)})}function en(e){let n=new Set;for(let t of e)n.add(f(t));return[...n]}var Fe={tyreSizes:[],brands:[],finishes:[],diameters:[],collections:[],pcds:[],tyreTypes:[],speedRatings:[],priceMax:null,inStockOnly:!1,kind:null,sort:"recommended",page:1};function nn(e,n,t,r=null){if(r!=="kind"&&n.kind&&f(e)!==n.kind)return!1;for(let i of Le){if(r===i)continue;let a=n[i];if(a.length===0)continue;let u=a.map(String);if(!Te(e,i).some(p=>u.includes(p)))return!1}return!(r!=="price"&&!we(re(e),t,null,n.priceMax)||r!=="inStock"&&n.inStockOnly&&!ie(e))}var tn={tyreSizes:"Size",brands:"Brand",finishes:"Colour",diameters:"Size \xB7 diameter",collections:"Collection",pcds:"PCD \xB7 fitment",tyreTypes:"Tyre type",speedRatings:"Speed rating"};function Te(e,n){switch(n){case"tyreSizes":return[...new Set(pe(e).flatMap(ne))];case"brands":return U(e)?[U(e)]:[];case"finishes":return le(e);case"diameters":return oe(e).map(String);case"collections":return se(e);case"pcds":return ae(e);case"tyreTypes":return ue(e);case"speedRatings":return ce(e)}}function rn(e){let n=new Map;for(let t of e)for(let r of z(t))r.color&&!n.has(r.family)&&n.set(r.family,r.color);return n}function _e(e,n,t,r=en(e),i=[]){let a=o=>ln(o,r,i),u=rn(e),p=Je(r).filter(o=>o!=="tyreSizes").filter(a).map(o=>{let l=n[o].map(String),c=new Set,N=new Map,k=new Map;for(let d of e){let b=Te(d,o);for(let h of b)c.add(h);for(let h of new Set(b))k.set(h,(k.get(h)??0)+1);if(nn(d,n,t,o))for(let h of new Set(b))N.set(h,(N.get(h)??0)+1)}let ve=[...c].map(d=>({value:d,label:o==="diameters"?`${d}\u2033`:d,count:N.get(d)??0,checked:l.includes(d),swatch:o==="finishes"?u.get(d)??null:null})).sort((d,b)=>{if(o==="diameters")return Number(d.value)-Number(b.value);let h=(k.get(b.value)??0)-(k.get(d.value)??0);return h!==0?h:d.value.localeCompare(b.value)});return{key:o,label:tn[o],options:ve}}).filter(o=>o.options.length>on),s=[];for(let o of p){let l=sn(o.key,r,i);l!==void 0&&s.push({fieldKey:o.key,filterOrder:l})}return[...Se(p,o=>o.key,s,"filterOrder")]}var on=1;function Ae(e){return e.showCollection===!1?["collections"]:[]}function ln(e,n,t){return n.length===0||t.length===0?!0:n.some(r=>ke(G(t,r))(Y(e,r)))}function sn(e,n,t){if(t.length===0)return;let r;for(let i of n){let a=be(G(t,i),"filter")(Y(e,i));a!==void 0&&(r===void 0||a<r)&&(r=a)}return r}var q={tyreSizes:"tyreSize",brands:"brand",finishes:"colour",diameters:"size",collections:"collection",pcds:"pcd",tyreTypes:"tyreType",speedRatings:"speed"},H="type";var Re="AlloyWheelsListing";function Ee(e){return M(e.trim())}var C="/wheels",O="Products";function Ie(e,n){return n>1?`${O} \xB7 ${e}`:O}function j(...e){for(let n of e){let t=(n?.content??[]).find(r=>r?.type===Re);if(t)return t.props??{}}return null}function K(...e){return j(...e)!==null}function Ce(e,n){let t=e.filter(r=>K(...r.docs)).map(r=>P(r.slug));return t.length===0&&n.fallback?[C]:t}var Z=[H,...Object.entries(q).filter(([e])=>e!=="tyreSizes").map(([,e])=>e)];function Oe(e){let n=e.indexOf("#"),t=n===-1?"":e.slice(n),r=n===-1?e:e.slice(0,n),i=r.indexOf("?");return{path:i===-1?r:r.slice(0,i),query:i===-1?"":r.slice(i+1),hash:t}}function an(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return e}}function Ke(e){let n=new URLSearchParams(Oe(e).query);for(let t of Z){let r=n.get(t);if(r)return{param:t,value:r}}return null}function V(e,n){let{path:t,query:r,hash:i}=Oe(e),a=r.split("&").filter(u=>u&&!Z.includes(an(u.split("=")[0])));return n?.value&&a.push(`${encodeURIComponent(n.param)}=${encodeURIComponent(n.value)}`),`${t}${a.length?`?${a.join("&")}`:""}${i}`}function Ne(e,n){let t=V(e,null);return n.includes(t)?t:e}function un(e,n,t=[]){return I(e,n,{listingPaths:t,targetOf:r=>Ne(r,t)})}function cn(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 Me="Product type",pn="AUD";function Q(e,n){let t=n.listing??{},r=D(t.kinds),i=e.filter(s=>r.includes(f(s))),a=Ae(t),u=_e(i,Fe,pn,r,n.fieldUsage).filter(s=>!a.includes(s.key)).map(s=>({param:q[s.key],label:s.label,values:s.options.filter(o=>!o.value.includes(",")).map(o=>({value:o.value,label:o.label}))})).filter(s=>s.values.length>0),p=S.filter(s=>r.includes(s)&&i.some(o=>f(o)===s));return p.length>1&&u.unshift({param:H,label:Me,values:p.map(s=>({value:s,label:L[s]}))}),u}function dn(e){return n=>{let t=Ce(n,{fallback:e.offersCommerce}),r=n.filter(i=>K(...i.docs)).length;return{listingPaths:t,pageOptions:i=>{let a=i.map(u=>{let p=n.find(s=>P(s.slug)===u.value);return p&&K(...p.docs)?{...u,label:Ie(p.title,r)}:u});return r===0&&e.offersCommerce&&!a.some(u=>u.value===C)&&a.push({value:C,label:O}),a},filtersFor:i=>{if(!t.includes(i))return null;let a=n.find(u=>P(u.slug)===i);return Q(e.catalogue,{listing:a?j(...a.docs):null,fieldUsage:e.fieldUsage})},readFilter:Ke,withFilter:V}}}function fn(e){let n=dn({catalogue:e.catalogue,fieldUsage:e.fieldUsage,offersCommerce:e.offers.offersCommerce})(e.pages),t=Pe({pages:e.pages,posts:e.posts,products:e.products.map(r=>({href:A(r.slug),name:r.name||r.slug})),offers:e.offers},n);return{...t,rules:{...t.rules,isSafe:Ee},filtersFor:t.filtersFor??(()=>null)}}function Zt(e,n){return Q(e,n)}export{C as BUILT_IN_LISTING_PATH,F as LINK_KINDS,Z as LISTING_FILTER_PARAMS,O as LISTING_PAGE_LABEL,Me as PRODUCT_TYPE_FILTER_LABEL,R as anchorPath,cn as fieldUsageFromAdminRows,un as inferLinkKind,K as isProductListingPage,Ee as isSafeLink,T as linkKindsFor,fn as linkPickerSetup,Zt as listingFilterFields,j as listingNode,Ie as listingPageLabel,Ne as listingTarget,E as pageAnchors,P as pagePath,_ as postPath,Ce as productListingPaths,Ke as readListingFilter,A as wheelPath,V as withListingFilter};
1
+ var g={bold:{open:"**",close:"**",placeholder:"bold text"},italic:{open:"_",close:"_",placeholder:"italic text"},strike:{open:"~~",close:"~~",placeholder:"struck out"},code:{open:"`",close:"`",placeholder:"code"},highlight:{open:"==",close:"==",placeholder:"highlighted text"},quiet:{open:"^^",close:"^^",placeholder:"quiet text"},underline:{open:"[",close:"]{underline}",placeholder:"underlined text"},sup:{open:"[",close:"]{sup}",placeholder:"superscript"},sub:{open:"[",close:"]{sub}",placeholder:"subscript"}};var Ue={bold:g.bold.placeholder,italic:g.italic.placeholder,strike:g.strike.placeholder,code:g.code.placeholder,highlight:g.highlight.placeholder,quiet:g.quiet.placeholder,link:"link text",underline:g.underline.placeholder,sup:g.sup.placeholder,sub:g.sub.placeholder,color:"colored text",style:"styled text"};var J=[{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 x=[{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}],ee=["highlight","quiet"],De=J.map(e=>e.style).filter(e=>x.some(t=>t.kind===e)).filter(e=>!ee.includes(e)),ze=[...x,{open:"*",close:"*",kind:"accent"}],$e=[...x,{open:"*",close:"*",kind:"accent"},{open:"#",close:"#",kind:"bold",notBefore:"0123456789"},{open:"[",close:"]",kind:"italic",notBefore:"(",notBeforeBlock:!0}];var Be=["http","https","mailto","tel"];function v(e){if(e===""||/[\s\u0000-\u001f\u007f]/.test(e))return!1;let t=/^([a-zA-Z][a-zA-Z0-9+.-]*):/.exec(e);return!t||Be.includes(t[1].toLowerCase())}var te=["width","profile","rim"];var We=/^\s*(\d{2,3})\s*\/\s*(\d{2,3})\s*[A-Za-z]*\s*(\d{2}(?:\.\d+)?)\s*$/,Ge={width:[100,500],profile:[20,100],rim:[10,30]};function U(e){let t=We.exec(e??"");if(!t)return null;let n={width:Number(t[1]),profile:Number(t[2]),rim:Number(t[3])};return te.every(i=>{let[a,u]=Ge[i];return n[i]>=a&&n[i]<=u})?n:null}function T(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 ne(e){return[T({width:e.width}),T({width:e.width,profile:e.profile}),T(e)]}var S=["alloy-wheel","tyre"],re=["alloy-wheel"],L={"alloy-wheel":"Alloy wheels",tyre:"Tyres"};var Qt=S.map(e=>({value:e,label:L[e]}));function w(e){return e==null?[...re]:Array.isArray(e)?S.filter(t=>e.includes(t)):[...re]}var m=e=>e;function f(e){return m(e).kind==="tyre"?"tyre":"alloy-wheel"}function D(e){return m(e).brand??""}function ie(e){return m(e).prices??void 0}function oe(e){return m(e).inStock!==!1}function le(e){let t=m(e),n=f(e)==="tyre"?t.rimDiameters:t.sizes;return Array.isArray(n)?n.filter(r=>typeof r=="number"&&Number.isFinite(r)):[]}function z(e){return f(e)==="tyre"?[]:(m(e).finishes??[]).filter(t=>typeof t?.family=="string").map(t=>({family:t.family,color:t.color??null}))}function se(e){return z(e).map(t=>t.family)}function $(e){if(f(e)==="tyre")return[];let t=m(e);return Array.isArray(t.categories)?t.categories:t.process?[t.process]:[]}function ae(e){return f(e)==="tyre"?[]:m(e).spec?.pcds??[]}function ue(e){return f(e)!=="tyre"?[]:m(e).tyreTypes??[]}function ce(e){return f(e)!=="tyre"?[]:m(e).speedRatings??[]}function pe(e){if(f(e)!=="tyre")return[];let t=m(e).sizes;return Array.isArray(t)?t.map(n=>U(typeof n=="string"?n:null)).filter(n=>n!==null):[]}var B=e=>typeof e=="string"&&e?e:void 0;var de=null;function fe(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=de?de[e]:void 0;if(typeof n=="function"){try{let r=B(n(t??{}));if(r)return r}catch{}return fe(e,t)}return fe(B(n)??e,t)}var me="homepage";function W(e){return(e??"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}var F=[{value:"page",label:"Page"},{value:"anchor",label:"Anchor"},{value:"blog",label:"Blog post",needs:"service"},{value:"product",label:"Product",needs:"commerce"},{value:"popup",label:"Popup"},{value:"custom",label:"Custom URL"}];function _(e){return e.offersCommerce&&e.offersService?F:F.filter(t=>!t.needs||(t.needs==="commerce"?e.offersCommerce:e.offersService))}var G="#popup:";function he(e){return`${G}${e}`}function ge(e){return e.startsWith(G)&&e.slice(G.length).trim()||null}function P(e){return e===me?"/":`/${e}`}function A(e){return`/journal/${e}`}function R(e){return`/wheels/${e}`}function E(e,t){return`${P(e)}#${t}`}function Ye(e){return typeof e=="string"?e.trim():e&&typeof e=="object"&&typeof e.text=="string"?e.text.trim():""}function I(...e){let t=new Set,n=[];for(let r of e)for(let i of r?.content??[]){let a=Ye(i?.props?.anchor);if(!a)continue;let u=W(a);!u||t.has(u)||(t.add(u),n.push({slug:u,name:a}))}return n}function ye(e){return/^\/wheels\/[^/?#]+(?:[?#].*)?$/.test(e)}var He=()=>({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 O(e,t,n){if(!e)return"page";if(ge(e))return"popup";if(e.startsWith("/journal/"))return"blog";if(ye(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 Pe(e,t){let n=He(),r=e.pages.map(l=>({value:P(l.slug),label:l.title})),i=t?.pageOptions?t.pageOptions(r):r,a=i.map(l=>l.value),u=e.pages.map(l=>({label:l.title,options:I(...l.docs).map(c=>({value:E(l.slug,c.slug),label:c.name}))})).filter(l=>l.options.length>0),p=l=>{switch(l){case"page":return{type:"select",options:i,placeholder:n.choosePage};case"anchor":return{type:"groups",groups:u,placeholder:u.length?n.chooseSection:n.noSections};case"blog":return{type:"select",options:e.posts.map(c=>({value:A(c.slug),label:c.title||c.slug})),placeholder:n.choosePost};case"product":return{type:"select",options:e.products.map(c=>({value:c.href,label:c.name||c.href})),placeholder:n.chooseProduct};case"popup":return{type:"select",options:(e.popups??[]).map(c=>({value:he(c.slug),label:c.title||c.slug})),placeholder:n.choosePopup};case"custom":return{type:"text"}}},s=_(e.offers).map(l=>({value:l.value,label:y(l.label),target:p(l.value),...l.value==="anchor"?{hint:n.sectionHint}:{},...l.value==="blog"||l.value==="product"||l.value==="popup"?{hideWhenEmpty:!0}:{}}));if(!t)return{kinds:s,rules:{kindOf:l=>O(l,a),targetOf:l=>l,readFilter:()=>null,withFilter:l=>l}};let o=l=>{let c=t.withFilter(l,null);return t.listingPaths.includes(c)?c:l};return{kinds:s,rules:{kindOf:l=>O(l,a,{listingPaths:t.listingPaths,targetOf:o}),targetOf:o,readFilter:t.readFilter,withFilter:t.withFilter},filtersFor:l=>t.listingPaths.includes(l)?t.filtersFor(l):null}}function Y(e,t){return e.length===0?e:e.filter(n=>n.kind===void 0||n.kind===t)}function be(e,t){let n=t==="filter"?"filterOrder":"cardOrder",r=new Map;for(let i of e){let a=i[n];if(typeof a!="number"||!Number.isFinite(a))continue;let u=r.get(i.fieldKey);(u===void 0||a<u)&&r.set(i.fieldKey,a)}return i=>i?r.get(i):void 0}function Se(e,t,n,r){let i=new Map;for(let s of n){let o=s[r];typeof o=="number"&&i.set(s.fieldKey,o)}if(i.size===0)return e;let a=[],u=[];e.forEach((s,o)=>{let l=t(s);l&&(a.push(o),u.push({item:s,index:o,order:i.get(l)}))}),u.sort((s,o)=>s.order!==void 0&&o.order!==void 0?s.order-o.order||s.index-o.index:s.order!==void 0?-1:o.order!==void 0?1:s.index-o.index);let p=[...e];return a.forEach((s,o)=>{p[s]=u[o].item}),p.every((s,o)=>s===e[o])?e:p}function ke(e){return je(e,"filter")}var qe="collection";function H(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":qe},pcds:{"alloy-wheel":"pcd"},tyreTypes:{tyre:"tire_type"},speedRatings:{tyre:"speed_rating"}}[e]?.[t]}function je(e,t){let n=new Set(e.filter(r=>r[t]===!1).map(r=>r.fieldKey));return r=>!r||!n.has(r)}function Ze(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function xe(e,t){let n=e?.[t];return Ze(n)?n:null}function Te(e,t,n,r){if(n==null&&r==null)return!0;let i=xe(e,t);return!(i===null||n!=null&&i<n||r!=null&&i>r)}var Ve={recommended:"Recommended","price-asc":"Price \xB7 low to high","price-desc":"Price \xB7 high to low",new:"Newest",name:"Name A\u2013Z"},Mn=Object.keys(Ve);var Le=["tyreSizes","brands","finishes","diameters","collections","pcds","tyreTypes","speedRatings"],Qe={tyreSizes:["tyre"],brands:["alloy-wheel","tyre"],finishes:["alloy-wheel"],diameters:["alloy-wheel","tyre"],collections:["alloy-wheel"],pcds:["alloy-wheel"],tyreTypes:["tyre"],speedRatings:["tyre"]},Xe={diameters:"tyreSizes"};function Je(e){if(e.length===0)return[];let t=Le.filter(n=>e.every(r=>Qe[n].includes(r)));return t.filter(n=>{let r=Xe[n];return!r||!t.includes(r)})}function et(e){let t=new Set;for(let n of e)t.add(f(n));return[...t]}var we={tyreSizes:[],brands:[],finishes:[],diameters:[],collections:[],pcds:[],tyreTypes:[],speedRatings:[],priceMax:null,inStockOnly:!1,kind:null,sort:"recommended",page:1};function tt(e,t,n,r=null){if(r!=="kind"&&t.kind&&f(e)!==t.kind)return!1;for(let i of Le){if(r===i)continue;let a=t[i];if(a.length===0)continue;let u=a.map(String);if(!Fe(e,i).some(p=>u.includes(p)))return!1}return!(r!=="price"&&!Te(ie(e),n,null,t.priceMax)||r!=="inStock"&&t.inStockOnly&&!oe(e))}var nt={tyreSizes:"Size",brands:"Brand",finishes:"Colour",diameters:"Size \xB7 diameter",collections:"Collection",pcds:"PCD \xB7 fitment",tyreTypes:"Tyre type",speedRatings:"Speed rating"};function Fe(e,t){switch(t){case"tyreSizes":return[...new Set(pe(e).flatMap(ne))];case"brands":return D(e)?[D(e)]:[];case"finishes":return se(e);case"diameters":return le(e).map(String);case"collections":return $(e);case"pcds":return ae(e);case"tyreTypes":return ue(e);case"speedRatings":return ce(e)}}function rt(e){let t=new Map;for(let n of e)for(let r of z(n))r.color&&!t.has(r.family)&&t.set(r.family,r.color);return t}function _e(e,t,n,r=et(e),i=[]){let a=o=>ot(o,r,i),u=rt(e),p=Je(r).filter(o=>o!=="tyreSizes").filter(a).map(o=>{let l=t[o].map(String),c=new Set,M=new Map,k=new Map;for(let d of e){let b=Fe(d,o);for(let h of b)c.add(h);for(let h of new Set(b))k.set(h,(k.get(h)??0)+1);if(tt(d,t,n,o))for(let h of new Set(b))M.set(h,(M.get(h)??0)+1)}let ve=[...c].map(d=>({value:d,label:o==="diameters"?`${d}\u2033`:d,count:M.get(d)??0,checked:l.includes(d),swatch:o==="finishes"?u.get(d)??null:null})).sort((d,b)=>{if(o==="diameters")return Number(d.value)-Number(b.value);let h=(k.get(b.value)??0)-(k.get(d.value)??0);return h!==0?h:d.value.localeCompare(b.value)});return{key:o,label:nt[o],options:ve}}).filter(o=>o.options.length>it),s=[];for(let o of p){let l=lt(o.key,r,i);l!==void 0&&s.push({fieldKey:o.key,filterOrder:l})}return[...Se(p,o=>o.key,s,"filterOrder")]}var it=1;function Ae(e){return e.showCollection===!1?["collections"]:[]}function ot(e,t,n){return t.length===0||n.length===0?!0:t.some(r=>ke(Y(n,r))(H(e,r)))}function lt(e,t,n){if(n.length===0)return;let r;for(let i of t){let a=be(Y(n,i),"filter")(H(e,i));a!==void 0&&(r===void 0||a<r)&&(r=a)}return r}var q={tyreSizes:"tyreSize",brands:"brand",finishes:"colour",diameters:"size",collections:"collection",pcds:"pcd",tyreTypes:"tyreType",speedRatings:"speed"},j="type";var Re="AlloyWheelsListing";function Ee(e){return v(e.trim())}var C="/wheels",K="Products";function Ie(e,t){return t>1?`${K} \xB7 ${e}`:K}function Z(...e){for(let t of e){let n=(t?.content??[]).find(r=>r?.type===Re);if(n)return n.props??{}}return null}function N(...e){return Z(...e)!==null}function Oe(e,t){let n=e.filter(r=>N(...r.docs)).map(r=>P(r.slug));return n.length===0&&t.fallback?[C]:n}var V=[j,...Object.entries(q).filter(([e])=>e!=="tyreSizes").map(([,e])=>e)];function Ce(e){let t=e.indexOf("#"),n=t===-1?"":e.slice(t),r=t===-1?e:e.slice(0,t),i=r.indexOf("?");return{path:i===-1?r:r.slice(0,i),query:i===-1?"":r.slice(i+1),hash:n}}function st(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return e}}function Ke(e){let t=new URLSearchParams(Ce(e).query);for(let n of V){let r=t.get(n);if(r)return{param:n,value:r}}return null}function Q(e,t){let{path:n,query:r,hash:i}=Ce(e),a=r.split("&").filter(u=>u&&!V.includes(st(u.split("=")[0])));return t?.value&&a.push(`${encodeURIComponent(t.param)}=${encodeURIComponent(t.value)}`),`${n}${a.length?`?${a.join("&")}`:""}${i}`}function Ne(e,t){let n=Q(e,null);return t.includes(n)?n:e}function at(e,t,n=[]){return O(e,t,{listingPaths:n,targetOf:r=>Ne(r,n)})}function ut(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 Me="Product type",ct="AUD";function X(e,t){let n=t.listing??{},r=w(n.kinds),i=e.filter(s=>r.includes(f(s))),a=Ae(n),u=_e(i,we,ct,r,t.fieldUsage).filter(s=>!a.includes(s.key)).map(s=>({param:q[s.key],label:s.label,values:s.options.filter(o=>!o.value.includes(",")).map(o=>({value:o.value,label:o.label}))})).filter(s=>s.values.length>0),p=S.filter(s=>r.includes(s)&&i.some(o=>f(o)===s));return p.length>1&&u.unshift({param:j,label:Me,values:p.map(s=>({value:s,label:L[s]}))}),u}function pt(e){return t=>{let n=Oe(t,{fallback:e.offersCommerce}),r=t.filter(i=>N(...i.docs)).length;return{listingPaths:n,pageOptions:i=>{let a=i.map(u=>{let p=t.find(s=>P(s.slug)===u.value);return p&&N(...p.docs)?{...u,label:Ie(p.title,r)}:u});return r===0&&e.offersCommerce&&!a.some(u=>u.value===C)&&a.push({value:C,label:K}),a},filtersFor:i=>{if(!n.includes(i))return null;let a=t.find(u=>P(u.slug)===i);return X(e.catalogue,{listing:a?Z(...a.docs):null,fieldUsage:e.fieldUsage})},readFilter:Ke,withFilter:Q}}}function dt(e){let t=pt({catalogue:e.catalogue,fieldUsage:e.fieldUsage,offersCommerce:e.offers.offersCommerce})(e.pages),n=Pe({pages:e.pages,posts:e.posts,products:e.products.map(r=>({href:R(r.slug),name:r.name||r.slug})),offers:e.offers},t);return{...n,rules:{...n.rules,isSafe:Ee},filtersFor:n.filtersFor??(()=>null)}}function rr(e,t){return X(e,t)}export{C as BUILT_IN_LISTING_PATH,F as LINK_KINDS,V as LISTING_FILTER_PARAMS,K as LISTING_PAGE_LABEL,Me as PRODUCT_TYPE_FILTER_LABEL,E as anchorPath,ut as fieldUsageFromAdminRows,at as inferLinkKind,N as isProductListingPage,Ee as isSafeLink,_ as linkKindsFor,dt as linkPickerSetup,rr as listingFilterFields,Z as listingNode,Ie as listingPageLabel,Ne as listingTarget,I as pageAnchors,P as pagePath,A as postPath,Oe as productListingPaths,Ke as readListingFilter,R as wheelPath,Q as withListingFilter};
@@ -9,6 +9,15 @@
9
9
  is built from this repository's own. Everything below is the storefront's
10
10
  `app/globals.css` from line 79 on, as it stood on 2026-10-10. */
11
11
 
12
+ /* ── PAGE MOTION: efficient-shell's sheet ───────────────────────────────────
13
+ The keyframes, times and reduce-motion answer of every Entrance (C27; the
14
+ shell's src/motion, efficient-web-builder 45). The builder wraps a block that
15
+ has an Entrance in `div.sf-entrance` with the shell's `data-motion-*`
16
+ attributes; nothing moves without this sheet. It is loaded HERE, once, so the
17
+ published page and the editor's canvas (package/canvas.css) read the same
18
+ one. An `@import` must come before every rule, so it is first. */
19
+ @import "efficient-shell/motion.css";
20
+
12
21
  /* ─── Storefront design tokens ───────────────────────────────────── */
13
22
  /* ⚠️ THE SURFACE, LINE AND RADIUS TOKENS ARE `--site-*`, AND THAT IS A NAME
14
23
  COLLISION FIXED, NOT A STYLE. efficient-shell's UI kit declares `--surface`,
@@ -1146,18 +1155,18 @@ body .sf-site-header[data-header-ink="dark"] {
1146
1155
  flex: 1 1 0%;
1147
1156
  min-width: 0;
1148
1157
  }
1149
- /* Start and End fill the cell they grow into; a centred menu is as wide as
1158
+ /* Left and Right fill the cell they grow into; a centred menu is as wide as
1150
1159
  its links, so the links sit on the bar's centre. */
1151
- [data-section-group="header"] [data-menu-row]:is([data-menu-align="start"], [data-menu-align="end"]) {
1160
+ [data-section-group="header"] [data-menu-row]:is([data-menu-align="left"], [data-menu-align="right"]) {
1152
1161
  width: 100%;
1153
1162
  }
1154
- [data-section-group="header"] [data-menu-row][data-menu-align="start"] > ul {
1163
+ [data-section-group="header"] [data-menu-row][data-menu-align="left"] > ul {
1155
1164
  justify-content: flex-start;
1156
1165
  }
1157
1166
  [data-section-group="header"] [data-menu-row][data-menu-align="center"] > ul {
1158
1167
  justify-content: center;
1159
1168
  }
1160
- [data-section-group="header"] [data-menu-row][data-menu-align="end"] > ul {
1169
+ [data-section-group="header"] [data-menu-row][data-menu-align="right"] > ul {
1161
1170
  justify-content: flex-end;
1162
1171
  }
1163
1172
  /* Centred links: the cells either side share the rest equally. */
@@ -2563,10 +2572,31 @@ em.text-accent {
2563
2572
  utilities the same elements still carry. */
2564
2573
  .sf-gap-zone {
2565
2574
  gap: var(--sf-gap-len);
2566
- }
2575
+ /* A custom property inherits, so a nested container with no phone Gap would
2576
+ take its parent's. Every zone resets it here; a container's own value is
2577
+ inline and beats this rule, and its blocks still inherit that value. */
2578
+ --sf-gap-len-phone: initial;
2579
+ }
2580
+ /* Below 800px: the container's own phone Gap when it stores one (C25 row 2,
2581
+ Lewis 2026-10-29: `--sf-gap-len-phone`, written by efficient-web-builder's
2582
+ `containerGapProps`), else half the desktop length (the 2026-09-03 ruling).
2583
+ With no phone value the fallback is the old declaration, so no page moves. */
2567
2584
  @media (max-width: 800px) {
2568
2585
  .sf-gap-zone {
2569
- gap: calc(var(--sf-gap-len) / 2);
2586
+ gap: var(--sf-gap-len-phone, calc(var(--sf-gap-len) / 2));
2587
+ }
2588
+ }
2589
+ /* A shared-rows card grid (`.sf-card-rows`, components/WheelCardFrame) moves
2590
+ its row gap onto the cards as a margin, so `gap` above does not reach it.
2591
+ Its phone answer is this property, named by the grid ONLY when it stores a
2592
+ phone Gap (`cardRowsGap`, C38): the desktop length above 800px, the phone's
2593
+ own below. A grid with no phone value never reads it. */
2594
+ .sf-card-rows {
2595
+ --sf-card-row-gap-auto: var(--sf-gap-len);
2596
+ }
2597
+ @media (max-width: 800px) {
2598
+ .sf-card-rows {
2599
+ --sf-card-row-gap-auto: var(--sf-gap-len-phone, var(--sf-gap-len));
2570
2600
  }
2571
2601
  }
2572
2602
 
@@ -3174,9 +3204,13 @@ em.text-accent {
3174
3204
  `display: contents`). Each rule names both shapes of "the Box's blocks", so
3175
3205
  the canvas reads THIS rule from this sheet and no copy of it can lag behind
3176
3206
  (the builder's canvas copy, efficient-web-builder 37 and later, goes).
3177
- scripts/test-gap-only-one-rule.tsx draws both. */
3207
+ A block with an Entrance (efficient-web-builder 45) has one more element,
3208
+ the builder's `div.sf-entrance`, around its whole render, so each shape is
3209
+ named again through it. scripts/test-gap-only-one-rule.tsx draws all four. */
3178
3210
  .sf-box-gap-only > *,
3179
- .sf-box-gap-only > [data-easel-block] > [data-sf-part-host] > * {
3211
+ .sf-box-gap-only > .sf-entrance > *,
3212
+ .sf-box-gap-only > [data-easel-block] > [data-sf-part-host] > *,
3213
+ .sf-box-gap-only > [data-easel-block] > [data-sf-part-host] > .sf-entrance > * {
3180
3214
  padding-block: 0;
3181
3215
  }
3182
3216
 
@@ -3189,80 +3223,12 @@ em.text-accent {
3189
3223
  wrapper's own padding is an INLINE style, which this never beats, so what the
3190
3224
  merchant typed still draws. Unlayered, like the rule above, for its reason. */
3191
3225
  .sf-box-gap-only > .sf-section-pad > *,
3192
- .sf-box-gap-only > [data-easel-block] > [data-sf-part-host] > .sf-section-pad > * {
3226
+ .sf-box-gap-only > .sf-entrance > .sf-section-pad > *,
3227
+ .sf-box-gap-only > [data-easel-block] > [data-sf-part-host] > .sf-section-pad > *,
3228
+ .sf-box-gap-only > [data-easel-block] > [data-sf-part-host] > .sf-entrance > .sf-section-pad > * {
3193
3229
  padding-block: 0;
3194
3230
  }
3195
3231
 
3196
- /* ── A SECTION ANIMATES IN ─────────────────────────────────────────────────────
3197
- card [ADD] A Section Can Animate In — step two of three. Step one taught the
3198
- site to answer `prefers-reduced-motion` (#1364, the rule directly below this
3199
- one); step three draws the Animation tab. This is the motion itself.
3200
-
3201
- THREE MOTIONS, and the three ideas behind them are written in
3202
- `lib/content/section-animation.ts` rather than repeated here. What belongs
3203
- HERE, and nowhere else, is the timing: CSS is what runs it, so the duration,
3204
- the curve and the distance live in exactly one place and no TypeScript
3205
- constant restates them. Nothing times this animation from JS — the wrapper
3206
- ends on the element's own `animationend`.
3207
-
3208
- ⚠️ EVERY MOTION DECLARES A `from` AND NO `to`, AND THAT IS LOAD-BEARING.
3209
- A keyframe list with no `to` animates to the element's OWN computed style, so
3210
- the resting appearance of a section is never described twice. The alternative
3211
- — `to { opacity: 1; transform: none }` — is a second statement of how the
3212
- section looks, and it is the statement that would be wrong the first time a
3213
- section arrives already carrying a transform of its own.
3214
-
3215
- ⚠️ AND IT IS WHY A DROPPED `animationend` COSTS NOTHING. With
3216
- `animation-fill-mode: both` the element rests on the last keyframe, and the
3217
- last keyframe IS its natural appearance. The wrapper clears the state to drop
3218
- the compositor layer, not to make the content visible.
3219
-
3220
- ── HOW THE REDUCE-MOTION RULE BELOW REACHES THIS ────────────────────────────
3221
- It is not asked about anywhere. The rule below sets
3222
- `animation-duration: 1ms !important` on everything, so an armed section plays
3223
- its one pass in a millisecond and lands at rest — i.e. it is simply there,
3224
- which is what "reduce motion" means. `!important` is why order does not
3225
- matter and why these rules may sit above it. `scripts/probe-section-animation.mjs`
3226
- reads that back out of a real Chrome with the media feature emulated instead
3227
- of trusting this paragraph.
3228
-
3229
- ⛔ AND THAT IS ALSO WHY THE HIDDEN STATE IS NOT A KEYFRAME'S JOB. `armed` is
3230
- a plain `opacity: 0` written by JS, never by the server, and only ever onto a
3231
- section that is below the fold with an observer already watching it. See
3232
- `SECTION_ANIM_STATE` in lib/content/section-animation.ts. */
3233
- @keyframes sf-section-fade {
3234
- from { opacity: 0; }
3235
- }
3236
- @keyframes sf-section-rise {
3237
- from { opacity: 0; transform: translateY(24px); }
3238
- }
3239
- @keyframes sf-section-scale {
3240
- from { opacity: 0; transform: scale(0.96); }
3241
- }
3242
-
3243
- [data-sf-anim][data-sf-anim-state="armed"] {
3244
- opacity: 0;
3245
- }
3246
-
3247
- [data-sf-anim][data-sf-anim-state="play"] {
3248
- animation-duration: 600ms;
3249
- /* Ease-out. A section arrives quickly and settles — the shape every entrance
3250
- in the house drawings has, and the inverse of the ease-in a thing leaving
3251
- would take. */
3252
- animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
3253
- animation-fill-mode: both;
3254
- }
3255
-
3256
- [data-sf-anim="fade"][data-sf-anim-state="play"] {
3257
- animation-name: sf-section-fade;
3258
- }
3259
- [data-sf-anim="rise"][data-sf-anim-state="play"] {
3260
- animation-name: sf-section-rise;
3261
- }
3262
- [data-sf-anim="scale"][data-sf-anim-state="play"] {
3263
- animation-name: sf-section-scale;
3264
- }
3265
-
3266
3232
  /* ── THE VISITOR'S OWN "REDUCE MOTION" SETTING ──────────────────────────────
3267
3233
  [ADD] The Site Respects Reduce Motion.
3268
3234
 
@@ -1,3 +1,3 @@
1
1
  {
2
- "efficient-web-builder": "44.0.1"
2
+ "efficient-web-builder": "47.0.0"
3
3
  }
@@ -1 +1 @@
1
- "use client";import{jsx as H}from"react/jsx-runtime";import{useEffect as k,useState as _}from"react";import{usePathname as y}from"next/navigation";import{useHeaderBar as R}from"./useHeaderBar.js";import{headerSolidBackground as A,isProductPage as I,resolveHeaderHeightPx as P}from"../lib/content/header-bar.js";import{headerThemeWrap as S}from"../lib/content/header-theme.js";import{HEADER_SET_HEIGHT_VAR as T}from"efficient-web-builder/render/lib/document/header-clearance";import{HEADER_INK_OVERRIDE_ATTR as B,resolveHeaderInkMode as D}from"efficient-web-builder/render/lib/document/header-ink";const M=["none","always","on_scroll_up"],j=e=>M.includes(e)?e:"always";function w({sticky:e,topTextColor:f,heightPx:h,theme:b,children:g}){const o=j(e),n=P(h),{headerRef:t,scrolled:a,navHidden:p}=R({stickyMode:o,heightPx:n}),s=D(f),x=s==="auto"?null:{[B]:s},r=S(b),d=I(y()),[v,E]=_(!1);k(()=>{const l=t.current?.ownerDocument??document,u=()=>E(l.documentElement.getAttribute("data-theme")==="light");u();const m=new MutationObserver(u);return m.observe(l.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),()=>m.disconnect()},[t]);const c=a||d,i=A(v,d);return H("header",{ref:t,"data-scrolled":a||void 0,"data-box-header":"",...x,className:["sf-site-header",...r?[r.className]:[],"flex flex-col justify-center",o==="none"?"absolute":"fixed","inset-x-0 top-0 z-50",c?"border-b border-line backdrop-blur-md":"border-b border-transparent","transition-[background,border-color,transform] duration-300 ease-out"].join(" "),style:{...r?r.style:null,minHeight:`var(${T}, ${n}px)`,...p?{transform:"translateY(-100%)"}:null,...c?{background:i,color:"var(--fg)","--sf-header-ground":i}:{color:"var(--sf-header-overlay-fg)","--sf-header-ground":"var(--sf-header-overlay-ground)"}},children:g})}export{w as default,j as resolveStickyMode};
1
+ "use client";import{jsx as k}from"react/jsx-runtime";import{useEffect as H,useState as v}from"react";import{useRootIsDark as E}from"efficient-shell/theme";import{usePathname as _}from"next/navigation";import{useHeaderBar as y}from"./useHeaderBar.js";import{headerSolidBackground as R,isProductPage as D,resolveHeaderHeightPx as I}from"../lib/content/header-bar.js";import{headerThemeWrap as P}from"../lib/content/header-theme.js";import{HEADER_SET_HEIGHT_VAR as S}from"efficient-web-builder/render/lib/document/header-clearance";import{HEADER_INK_OVERRIDE_ATTR as T,resolveHeaderInkMode as A}from"efficient-web-builder/render/lib/document/header-ink";const B=["none","always","on_scroll_up"],j=e=>B.includes(e)?e:"always";function w({sticky:e,topTextColor:i,heightPx:u,theme:f,children:m}){const t=j(e),n=I(u),{headerRef:o,scrolled:a,navHidden:h}=y({stickyMode:t,heightPx:n}),s=A(i),p=s==="auto"?null:{[T]:s},r=P(f),d=D(_()),[g,b]=v(null);H(()=>b(o.current?.ownerDocument??null),[o]);const x=!E({doc:g,whenUnset:!0}),l=a||d,c=R(x,d);return k("header",{ref:o,"data-scrolled":a||void 0,"data-box-header":"",...p,className:["sf-site-header",...r?[r.className]:[],"flex flex-col justify-center",t==="none"?"absolute":"fixed","inset-x-0 top-0 z-50",l?"border-b border-line backdrop-blur-md":"border-b border-transparent","transition-[background,border-color,transform] duration-300 ease-out"].join(" "),style:{...r?r.style:null,minHeight:`var(${S}, ${n}px)`,...h?{transform:"translateY(-100%)"}:null,...l?{background:c,color:"var(--fg)","--sf-header-ground":c}:{color:"var(--sf-header-overlay-fg)","--sf-header-ground":"var(--sf-header-overlay-ground)"}},children:m})}export{w as default,j as resolveStickyMode};
@@ -33,6 +33,7 @@ export interface AppliedCoupon {
33
33
  valid: boolean;
34
34
  deferred?: boolean;
35
35
  refused?: boolean;
36
+ unchecked?: boolean;
36
37
  message?: string;
37
38
  effects?: CouponEffects;
38
39
  }
@@ -1 +1 @@
1
- "use client";import{jsx as Ve}from"react/jsx-runtime";import{createContext as ve,useCallback as u,useContext as je,useEffect as g,useMemo as ye,useRef as A,useState as c}from"react";import{products as E}from"../lib/api/index.js";import{couponDeferredToCheckout as Fe}from"../lib/cart/coupon-preview.js";import{snapshotCartLines as ze}from"../lib/cart/snapshot-lines.js";import{MAX_QTY_PER_LINE as Ce,orderLinesForSets as Je,setPrice as Xe}from"../lib/commerce.js";import{UNPRICED_LABEL as Ye}from"../lib/wheels/price-display.js";import{isValidEmail as Ge}from"../lib/email-shape.js";import{trackAddToCart as Ke}from"../lib/google-tag.js";import{shippingStatus as Ze}from"../lib/cart/shipping-status.js";import{useCurrency as $e}from"./CurrencyContext.js";const et=400,tt=400,nt=1500;function ge(a){return(a.components?.length??0)>0}function Ee(a,s){return{code:a,valid:s.valid,deferred:Fe(s,s.askedAsShopper),message:s.message||void 0,effects:s.effects??void 0}}function Ne(a,s){return Xe(a.components,s)}function k(a,s){const r=Ne(a,s);return r===null?null:r*a.qty}function Te(a){return a!=="tyre"}const be=ve(null);function pt({children:a,preview:s=!1}){const{currency:r,country:L,formatMoney:qe}=$e(),[W,D]=c(s),[l,M]=c([]),[Q,Be]=c([]),[H,Me]=c([]),[V,Ie]=c(!1),[v,xe]=c(!1),[Oe,Se]=c(!1),[_e,Ae]=c(!1),[m,j]=c(null),[De,Pe]=c(0),F=u(()=>Pe(e=>e+1),[]),[z,J]=c(void 0),[N,Ue]=c(null),[i,y]=c(null),[X,I]=c(!1),[p,Y]=c(null),x=A(void 0),T=u(()=>D(!0),[]),G=u(()=>D(!1),[]),K=u(()=>D(e=>!e),[]);g(()=>{s||typeof window>"u"||new URLSearchParams(window.location.search).get("cart")==="open"&&T()},[T,s]);const Z=u(e=>{Ue(t=>t?.country===e?.country&&t?.subdivision===e?.subdivision&&t?.postcode===e?.postcode?t:e)},[]),$=u(e=>{Ae(!0),Te(e)&&Se(!0)},[]),ee=Oe||l.some(e=>Te(e.kind)),te=_e||l.length>0;g(()=>{if(s||!ee||V)return;let e=!0;return E.listWheels().then(t=>{e&&(Be(t),Ie(!0))}),()=>{e=!1}},[s,ee,V]),g(()=>{if(s||!te||v)return;let e=!0;return E.listBundles().then(t=>{e&&(Me(t),xe(!0))}),()=>{e=!1}},[s,te,v]);const C=m?.deliveryOptions??[],ne=m?.courier??null;g(()=>{m&&Y(e=>e&&C.some(t=>t.id===e)?e:C[0]?.id??null)},[m]);const O=u(()=>l.filter(ge).flatMap(e=>Je(e.components,e.qty)),[l]),oe=u(async(e,t)=>{const o=e.trim().toUpperCase();if(!o)return;const n=O();if(n.length===0){y({code:o,valid:!1,message:"Add a wheel to the cart first."});return}I(!0),x.current=t;try{const d=await E.validateCoupon({code:o,items:n,currency:r,shippingMethodId:p??void 0,customerEmail:t});y(Ee(o,d))}catch{y({code:o,valid:!1,message:"Could not check that code. Please try again."})}finally{I(!1)}},[O,r,p]),se=u(()=>{y(null),x.current=void 0},[]),re=u(e=>{if(!i)return;const{code:t}=i;y(o=>o&&o.code===t?{code:t,valid:!1,refused:!0,message:e}:o)},[i]);g(()=>{if(!i||i.refused)return;const e=i.code,t=n=>n!==null&&n.code===e&&!n.refused,o=setTimeout(async()=>{const n=O();if(n.length===0){y(d=>t(d)?{code:e,valid:!1,message:"Add a wheel to the cart first."}:d);return}I(!0);try{const d=await E.validateCoupon({code:e,items:n,currency:r,shippingMethodId:p??void 0,customerEmail:x.current});y(B=>t(B)?Ee(e,d):B)}catch{}finally{I(!1)}},et);return()=>clearTimeout(o)},[l,r,p]);const P=i&&!i.refused?i.code:void 0;g(()=>{if(s)return;let e=!0;const t=setTimeout(async()=>{const o=O();if(o.length===0){j(null),J(void 0);return}try{const n=await E.quoteCart({items:o,currency:r,shippingMethodId:p??void 0,couponCode:P,customerEmail:x.current||void 0,country:N?.country||L||void 0,subdivision:N?.country&&N.subdivision||void 0,postcode:N?.country&&N.postcode||void 0});if(!e)return;j(n)}catch{if(!e)return}J(P)},tt);return()=>{e=!1,clearTimeout(t)}},[l,r,p,P,L,N,De]);const S=u(e=>{M(t=>{const o=t.findIndex(n=>n.id===e.id);return o===-1?[...t,e]:t.map((n,d)=>d===o?{...n,qty:Math.min(Ce,n.qty+e.qty)}:n)}),Ke(e,r)},[r]),ue=u(e=>{M(t=>t.filter(o=>o.id!==e))},[]),ie=u((e,t)=>{const o=Math.max(1,Math.min(Ce,t));M(n=>n.map(d=>d.id===e?{...d,qty:o}:d))},[]),ce=u(e=>{M(e)},[]),[q,we]=c(null),ae=A(null);ae.current=q;const h=A(null),U=A(""),le=u((e,t)=>{const o=e.trim().toLowerCase();Ge(o)&&we(n=>n&&n.email===o&&n.firstName===(t??"")?n:{email:o,firstName:t??""})},[]);g(()=>{if(s||!q)return;const e=ze(l.filter(ge),n=>k(n,r)===null?Ye:qe(k(n,r),r)),t={email:q.email,firstName:q.firstName,currency:r,items:e},o=JSON.stringify(t);if(o!==U.current)return h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{h.current=null,U.current=o,E.captureCart(t).catch(n=>{process.env.NODE_ENV!=="production"&&console.warn("abandoned-cart capture failed",n)})},nt),()=>{h.current&&(clearTimeout(h.current),h.current=null)}},[l,q,r,s]);const de=u(()=>{h.current&&(clearTimeout(h.current),h.current=null);const e=ae.current;e&&(U.current="",E.captureCart({email:e.email,firstName:e.firstName,currency:r,items:[]}).catch(t=>{process.env.NODE_ENV!=="production"&&console.warn("abandoned-cart clear failed",t)}))},[r]),fe=ye(()=>{const e=l.reduce((f,b)=>{const _=k(b,r);return _===null?f:f+_},0),t=l.some(f=>Ne(f,r)===null),o=l.reduce((f,b)=>f+b.qty,0),n=i?.valid?i.effects:void 0,d=n?Math.min(e,Number(n.discountAmount)):0,B=m?.bundleDiscount??0,ke=m?.appliedBundles??[],w=!!n?.freeShipping,pe=C.find(f=>f.id===p),he=w?0:m?.shipping??pe?.amount??0,Le=Ze({quoted:m!==null,optionCount:C.length,chosenAmount:pe?.amount,couponWaivesFreight:w}),R={};for(const f of n?.freeUnits??[])R[f.partNumber]=(R[f.partNumber]??0)+f.quantity;const We=m?.tax??null,Qe=m?m.grandTotal:e-d-B+he;return{sets:o,units:l.reduce((f,b)=>f+(b.components??[]).reduce((_,He)=>_+He.wheels*b.qty,0),0),subtotal:e,hasUnpricedLine:t,discount:d,bundleDiscount:B,appliedBundles:ke,shipping:he,freeShipping:w,shippingStatus:Le,freeUnitsByPartNumber:R,tax:We,grand:Qe,repricing:!!i?.refused&&m!==null&&z===i?.code,currency:r}},[l,r,i,C,p,m,z]),me=u(e=>{S(e),T()},[S,T]),Re=ye(()=>({isOpen:W,preview:s,open:T,close:G,toggle:K,items:l,catalog:Q,bundles:H,warmCatalog:$,add:S,addAndOpen:me,remove:ue,setQty:ie,replaceItems:ce,identify:le,clearCapturedCart:de,coupon:i,applyCoupon:oe,removeCoupon:se,refuseCoupon:re,couponBusy:X,deliveryOptions:C,setQuoteDestination:Z,courier:ne,requote:F,shippingMethodId:p,setShippingMethodId:Y,totals:fe}),[W,s,T,G,K,l,Q,H,$,S,me,ue,ie,ce,le,de,i,oe,se,re,X,C,Z,ne,F,p,fe]);return Ve(be.Provider,{value:Re,children:a})}function ht(){const a=je(be);if(!a)throw new Error("useCart() must be called inside <CartProvider>. Mount the provider in app/layout.tsx.");return a}export{pt as CartProvider,ge as isOrderable,k as lineTotal,ht as useCart};
1
+ "use client";import{jsx as Ft}from"react/jsx-runtime";import{createContext as vt,useCallback as u,useContext as zt,useEffect as y,useMemo as gt,useRef as M,useState as i}from"react";import{usePathname as Jt}from"next/navigation";import{products as E}from"../lib/api/index.js";import{couponDeferredToCheckout as Xt}from"../lib/cart/coupon-preview.js";import{snapshotCartLines as Yt}from"../lib/cart/snapshot-lines.js";import{MAX_QTY_PER_LINE as Et,orderLinesForSets as Gt,setPrice as Kt}from"../lib/commerce.js";import{UNPRICED_LABEL as Zt}from"../lib/wheels/price-display.js";import{isValidEmail as $t}from"../lib/email-shape.js";import{trackAddToCart as te}from"../lib/google-tag.js";import{shippingStatus as ee}from"../lib/cart/shipping-status.js";import{useCurrency as ne}from"./CurrencyContext.js";const oe=400,se=400,re=1500;function Nt(a){return(a.components?.length??0)>0}function Tt(a,s){return{code:a,valid:s.valid,deferred:Xt(s,s.askedAsShopper),message:s.message||void 0,effects:s.effects??void 0}}function bt(a,s){return Kt(a.components,s)}function W(a,s){const r=bt(a,s);return r===null?null:r*a.qty}function qt(a){return a!=="tyre"}const Bt=vt(null);function ge({children:a,preview:s=!1}){const{currency:r,country:Q,formatMoney:Mt}=ne(),[H,U]=i(s),[l,I]=i([]),[V,It]=i([]),[j,xt]=i([]),[F,Ot]=i(!1),[v,St]=i(!1),[_t,At]=i(!1),[Pt,Dt]=i(!1),[m,z]=i(null),[Ut,kt]=i(0),J=u(()=>kt(t=>t+1),[]),[X,Y]=i(void 0),[N,Rt]=i(null),[c,C]=i(null),[G,x]=i(!1),[p,K]=i(null),O=M(void 0),T=u(()=>U(!0),[]),S=u(()=>U(!1),[]),Z=u(()=>U(t=>!t),[]);y(()=>{s||typeof window>"u"||new URLSearchParams(window.location.search).get("cart")==="open"&&T()},[T,s]);const _=Jt(),$=M(_);y(()=>{$.current!==_&&($.current=_,s||S())},[_,s,S]);const tt=u(t=>{Rt(e=>e?.country===t?.country&&e?.subdivision===t?.subdivision&&e?.postcode===t?.postcode?e:t)},[]),et=u(t=>{Dt(!0),qt(t)&&At(!0)},[]),nt=_t||l.some(t=>qt(t.kind)),ot=Pt||l.length>0;y(()=>{if(s||!nt||F)return;let t=!0;return E.listWheels().then(e=>{t&&(It(e),Ot(!0))}),()=>{t=!1}},[s,nt,F]),y(()=>{if(s||!ot||v)return;let t=!0;return E.listBundles().then(e=>{t&&(xt(e),St(!0))}),()=>{t=!1}},[s,ot,v]);const g=m?.deliveryOptions??[],st=m?.courier??null;y(()=>{m&&K(t=>t&&g.some(e=>e.id===t)?t:g[0]?.id??null)},[m]);const A=u(()=>l.filter(Nt).flatMap(t=>Gt(t.components,t.qty)),[l]),rt=u(async(t,e)=>{const o=t.trim().toUpperCase();if(!o)return;const n=A();if(n.length===0){C({code:o,valid:!1,message:"Add a wheel to the cart first."});return}x(!0),O.current=e;try{const d=await E.validateCoupon({code:o,items:n,currency:r,shippingMethodId:p??void 0,customerEmail:e});C(Tt(o,d))}catch{C({code:o,valid:!1,unchecked:!0,message:"Could not check that code. Please try again."})}finally{x(!1)}},[A,r,p]),ut=u(()=>{C(null),O.current=void 0},[]),ct=u(t=>{if(!c)return;const{code:e}=c;C(o=>o&&o.code===e?{code:e,valid:!1,refused:!0,message:t}:o)},[c]);y(()=>{if(!c||c.refused)return;const t=c.code,e=n=>n!==null&&n.code===t&&!n.refused,o=setTimeout(async()=>{const n=A();if(n.length===0){C(d=>e(d)?{code:t,valid:!1,message:"Add a wheel to the cart first."}:d);return}x(!0);try{const d=await E.validateCoupon({code:t,items:n,currency:r,shippingMethodId:p??void 0,customerEmail:O.current});C(B=>e(B)?Tt(t,d):B)}catch{}finally{x(!1)}},oe);return()=>clearTimeout(o)},[l,r,p]);const k=c&&!c.refused?c.code:void 0;y(()=>{if(s)return;let t=!0;const e=setTimeout(async()=>{const o=A();if(o.length===0){z(null),Y(void 0);return}try{const n=await E.quoteCart({items:o,currency:r,shippingMethodId:p??void 0,couponCode:k,customerEmail:O.current||void 0,country:N?.country||Q||void 0,subdivision:N?.country&&N.subdivision||void 0,postcode:N?.country&&N.postcode||void 0});if(!t)return;z(n)}catch{if(!t)return}Y(k)},se);return()=>{t=!1,clearTimeout(e)}},[l,r,p,k,Q,N,Ut]);const P=u(t=>{I(e=>{const o=e.findIndex(n=>n.id===t.id);return o===-1?[...e,t]:e.map((n,d)=>d===o?{...n,qty:Math.min(Et,n.qty+t.qty)}:n)}),te(t,r)},[r]),it=u(t=>{I(e=>e.filter(o=>o.id!==t))},[]),at=u((t,e)=>{const o=Math.max(1,Math.min(Et,e));I(n=>n.map(d=>d.id===t?{...d,qty:o}:d))},[]),lt=u(t=>{I(t)},[]),[q,wt]=i(null),dt=M(null);dt.current=q;const h=M(null),R=M(""),ft=u((t,e)=>{const o=t.trim().toLowerCase();$t(o)&&wt(n=>n&&n.email===o&&n.firstName===(e??"")?n:{email:o,firstName:e??""})},[]);y(()=>{if(s||!q)return;const t=Yt(l.filter(Nt),n=>W(n,r)===null?Zt:Mt(W(n,r),r)),e={email:q.email,firstName:q.firstName,currency:r,items:t},o=JSON.stringify(e);if(o!==R.current)return h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{h.current=null,R.current=o,E.captureCart(e).catch(n=>{process.env.NODE_ENV!=="production"&&console.warn("abandoned-cart capture failed",n)})},re),()=>{h.current&&(clearTimeout(h.current),h.current=null)}},[l,q,r,s]);const mt=u(()=>{h.current&&(clearTimeout(h.current),h.current=null);const t=dt.current;t&&(R.current="",E.captureCart({email:t.email,firstName:t.firstName,currency:r,items:[]}).catch(e=>{process.env.NODE_ENV!=="production"&&console.warn("abandoned-cart clear failed",e)}))},[r]),pt=gt(()=>{const t=l.reduce((f,b)=>{const D=W(b,r);return D===null?f:f+D},0),e=l.some(f=>bt(f,r)===null),o=l.reduce((f,b)=>f+b.qty,0),n=c?.valid?c.effects:void 0,d=n?Math.min(t,Number(n.discountAmount)):0,B=m?.bundleDiscount??0,Wt=m?.appliedBundles??[],w=!!n?.freeShipping,yt=g.find(f=>f.id===p),Ct=w?0:m?.shipping??yt?.amount??0,Qt=ee({quoted:m!==null,optionCount:g.length,chosenAmount:yt?.amount,couponWaivesFreight:w}),L={};for(const f of n?.freeUnits??[])L[f.partNumber]=(L[f.partNumber]??0)+f.quantity;const Ht=m?.tax??null,Vt=m?m.grandTotal:t-d-B+Ct;return{sets:o,units:l.reduce((f,b)=>f+(b.components??[]).reduce((D,jt)=>D+jt.wheels*b.qty,0),0),subtotal:t,hasUnpricedLine:e,discount:d,bundleDiscount:B,appliedBundles:Wt,shipping:Ct,freeShipping:w,shippingStatus:Qt,freeUnitsByPartNumber:L,tax:Ht,grand:Vt,repricing:!!c?.refused&&m!==null&&X===c?.code,currency:r}},[l,r,c,g,p,m,X]),ht=u(t=>{P(t),T()},[P,T]),Lt=gt(()=>({isOpen:H,preview:s,open:T,close:S,toggle:Z,items:l,catalog:V,bundles:j,warmCatalog:et,add:P,addAndOpen:ht,remove:it,setQty:at,replaceItems:lt,identify:ft,clearCapturedCart:mt,coupon:c,applyCoupon:rt,removeCoupon:ut,refuseCoupon:ct,couponBusy:G,deliveryOptions:g,setQuoteDestination:tt,courier:st,requote:J,shippingMethodId:p,setShippingMethodId:K,totals:pt}),[H,s,T,S,Z,l,V,j,et,P,ht,it,at,lt,ft,mt,c,rt,ut,ct,G,g,tt,st,J,p,pt]);return Ft(Bt.Provider,{value:Lt,children:a})}function Ee(){const a=zt(Bt);if(!a)throw new Error("useCart() must be called inside <CartProvider>. Mount the provider in app/layout.tsx.");return a}export{ge as CartProvider,Nt as isOrderable,W as lineTotal,Ee as useCart};
@@ -1,4 +1,4 @@
1
- "use client";import{jsx as r,jsxs as o,Fragment as m}from"react/jsx-runtime";import{useEffect as f,useRef as p}from"react";import{useCart as d}from"./CartContext.js";import{isTyreLine as u}from"../lib/tyres/tyre-purchase.js";import{useTyreCatalog as x}from"./useTyreCatalog.js";import{useModalDismiss as b}from"./useModalDismiss.js";import{CartActions as y,CartCouponRow as C,CartDrawerHeader as g,CartLines as h,CartStatusRail as w,CartTotals as k,CartTrustMarkers as v,CartUpsell as R}from"./cart/drawer-parts.js";import{CART_DRAWER_DEFAULTS as D}from"efficient-web-builder/format/lib/content/cart-drawer";function T({content:e=D}){const{isOpen:t,preview:i,close:a,items:l}=d(),s=p(null),n=x(l.some(u));return b({active:t,onDismiss:a,lockScroll:!i}),f(()=>{t&&s.current?.focus({preventScroll:!0})},[t]),t?o(m,{children:[r("div",{onClick:a,className:"fixed inset-0 z-[60] backdrop-blur-[4px]",style:{background:"rgba(0,0,0,0.68)",animation:"storefront-cart-fade 350ms ease both"},"aria-hidden":"true"}),o("aside",{role:"dialog","aria-label":"Your cart","aria-modal":"true",className:"fixed inset-y-0 right-0 z-[61] flex w-[520px] max-w-[100vw] flex-col border-l border-line bg-bg max-[640px]:w-screen max-[640px]:border-l-0",style:{animation:"storefront-cart-slide 450ms cubic-bezier(.2,.7,.2,1) both",boxShadow:"-30px 0 80px rgba(0,0,0,.5)"},onClick:c=>c.stopPropagation(),children:[r("style",{children:`
1
+ "use client";import{jsx as r,jsxs as a,Fragment as p}from"react/jsx-runtime";import{useEffect as d,useRef as l}from"react";import{useCart as u}from"./CartContext.js";import{isTyreLine as x}from"../lib/tyres/tyre-purchase.js";import{useTyreCatalog as b}from"./useTyreCatalog.js";import{useModalDismiss as y}from"./useModalDismiss.js";import{CartActions as C,CartCouponRow as g,CartDrawerHeader as h,CartLines as w,CartStatusRail as R,CartTotals as k,CartTrustMarkers as v,CartUpsell as D}from"./cart/drawer-parts.js";import{CART_DRAWER_DEFAULTS as T}from"efficient-web-builder/format/lib/content/cart-drawer";function _({content:e=T}){const{isOpen:t,preview:n,close:o,items:c}=u(),s=l(null),i=l(null),f=b(c.some(x));return y({active:t,onDismiss:o,lockScroll:!n,trapRef:i}),d(()=>{t&&s.current?.focus({preventScroll:!0})},[t]),t?a(p,{children:[r("div",{onClick:o,className:"fixed inset-0 z-[60] backdrop-blur-[4px]",style:{background:"rgba(0,0,0,0.68)",animation:"storefront-cart-fade 350ms ease both"},"aria-hidden":"true"}),a("aside",{ref:i,role:"dialog","aria-label":"Your cart","aria-modal":"true",className:"fixed inset-y-0 right-0 z-[61] flex w-[520px] max-w-[100vw] flex-col border-l border-line bg-bg max-[640px]:w-screen max-[640px]:border-l-0",style:{animation:"storefront-cart-slide 450ms cubic-bezier(.2,.7,.2,1) both",boxShadow:"-30px 0 80px rgba(0,0,0,.5)"},onClick:m=>m.stopPropagation(),children:[r("style",{children:`
2
2
  @keyframes storefront-cart-fade { from { opacity: 0 } to { opacity: 1 } }
3
3
  @keyframes storefront-cart-slide { from { transform: translateX(40px); opacity: 0 } to { transform: translateX(0); opacity: 1 } }
4
- `}),r(g,{content:e,closeRef:s}),r(w,{content:e}),o("div",{className:"flex-1 overflow-y-auto [scrollbar-color:var(--site-line)_transparent] [scrollbar-width:thin]",children:[r(h,{content:e,tyres:n}),r(R,{}),r(C,{}),r(v,{content:e})]}),r(k,{}),r(y,{})]})]}):null}export{T as default};
4
+ `}),r(h,{content:e,closeRef:s}),r(R,{content:e}),a("div",{className:"flex-1 overflow-y-auto [scrollbar-color:var(--site-line)_transparent] [scrollbar-width:thin]",children:[r(w,{content:e,tyres:f}),r(D,{}),r(g,{}),r(v,{content:e})]}),r(k,{}),r(C,{})]})]}):null}export{_ as default};
@@ -3,7 +3,7 @@ import { type FieldUsageAnswer } from "../lib/content/field-usage.js";
3
3
  import type { FilterBarLayout } from "../lib/sections/catalog-filter-layout.js";
4
4
  export default function CatalogFilterBarSection({ show, layout, processOptions, fieldUsage, editing, resultsHref, resultsLabel, }: {
5
5
  show?: FilterBarVisibility;
6
- processOptions?: readonly import("../lib/api/index.js").Process[];
6
+ processOptions?: readonly string[];
7
7
  fieldUsage?: readonly FieldUsageAnswer[];
8
8
  layout?: FilterBarLayout;
9
9
  editing?: boolean;
@@ -1 +1 @@
1
- "use client";import{jsx as R}from"react/jsx-runtime";import{useEffect as p,useMemo as j}from"react";import E from"./catalog/CatalogFilterBar.js";import{useCatalogFilter as $}from"./catalog/CatalogFilterContext.js";import{useVehicleFit as B}from"./fitment/useVehicleFit.js";import{answersForKind as N}from"../lib/content/field-usage.js";import{appendVehicleParams as _,VEHICLE_PARAM as q}from"../lib/wheels/plp-vehicle-params.js";import{listingLinkFromCatalogFilters as I,unmappableCatalogFacets as K}from"../lib/wheels/catalog-filters-to-listing.js";function D({show:c,layout:u,processOptions:f,fieldUsage:s,editing:t=!1,resultsHref:l,resultsLabel:m}){const{filters:o,setProcess:d,setSize:h,setLugs:w,setFinish:g,setPriceMin:P,setPriceMax:F,setSort:v,clearAll:S,total:O,scrollProcess:y,publishVehicle:n,lugOptions:L,sizeOptions:A,finishOptions:C,optionsReported:M}=$(),k=j(()=>s?N(s,"alloy-wheel"):void 0,[s]),e=B({editing:t,autoApply:!0});p(()=>{n({fit:e.fit,name:e.appliedName,resolving:e.resolving,unresolved:e.unresolved})},[n,e.fit,e.appliedName,e.resolving,e.unresolved]);const r=e.applied?.vehicle??null;p(()=>{if(t||!e.restored||typeof window>"u")return;const i=new URLSearchParams(window.location.search);for(const z of Object.values(q))i.delete(z);_(i,r);const a=i.toString();window.history.replaceState(null,"",`${window.location.pathname}${a?`?${a}`:""}`)},[t,e.restored,r]);const x=K(o),V=(m??"").trim()||"See all results",b=l&&!t&&x.length===0?{href:I(l,o,r),label:V}:void 0;return R(E,{resultsLink:b,filters:o,setProcess:d,setSize:h,setLugs:w,setFinish:g,setPriceMin:P,setPriceMax:F,setSort:v,clearAll:S,total:O,lugOptions:L,sizeOptions:A,finishOptions:C,scrollProcess:y,show:c,layout:u,processOptions:f,optionsReported:M,fieldUsage:k,picker:e})}export{D as default};
1
+ "use client";import{jsx as j}from"react/jsx-runtime";import{useEffect as p,useMemo as E}from"react";import $ from"./catalog/CatalogFilterBar.js";import{useCatalogFilter as B}from"./catalog/CatalogFilterContext.js";import{useVehicleFit as N}from"./fitment/useVehicleFit.js";import{answersForKind as _}from"../lib/content/field-usage.js";import{appendVehicleParams as q,VEHICLE_PARAM as I}from"../lib/wheels/plp-vehicle-params.js";import{listingLinkFromCatalogFilters as K,unmappableCatalogFacets as D}from"../lib/wheels/catalog-filters-to-listing.js";function G({show:c,layout:u,processOptions:f,fieldUsage:s,editing:t=!1,resultsHref:l,resultsLabel:m}){const{filters:o,setProcess:d,setSize:h,setLugs:w,setFinish:g,setPriceMin:P,setPriceMax:F,setSort:v,clearAll:O,total:S,scrollProcess:y,publishVehicle:n,lugOptions:L,sizeOptions:A,finishOptions:C,categoryOptions:M,optionsReported:k}=B(),x=E(()=>s?_(s,"alloy-wheel"):void 0,[s]),e=N({editing:t,autoApply:!0});p(()=>{n({fit:e.fit,name:e.appliedName,resolving:e.resolving,unresolved:e.unresolved})},[n,e.fit,e.appliedName,e.resolving,e.unresolved]);const r=e.applied?.vehicle??null;p(()=>{if(t||!e.restored||typeof window>"u")return;const i=new URLSearchParams(window.location.search);for(const R of Object.values(I))i.delete(R);q(i,r);const a=i.toString();window.history.replaceState(null,"",`${window.location.pathname}${a?`?${a}`:""}`)},[t,e.restored,r]);const V=D(o),b=(m??"").trim()||"See all results",z=l&&!t&&V.length===0?{href:K(l,o,r),label:b}:void 0;return j($,{resultsLink:z,filters:o,setProcess:d,setSize:h,setLugs:w,setFinish:g,setPriceMin:P,setPriceMax:F,setSort:v,clearAll:O,total:S,lugOptions:L,sizeOptions:A,finishOptions:C,scrollProcess:y,show:c,layout:u,processOptions:f??M,optionsReported:k,fieldUsage:x,picker:e})}export{G as default};
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as r}from"react/jsx-runtime";import{useEffect as S,useRef as A,useState as u}from"react";import{stripMarkup as B}from"efficient-web-builder/format/lib/markup";import{sizedImage as z}from"efficient-web-builder/format/lib/sized-image";import D,{chatLauncherOnLeft as W}from"./ChatLauncher.js";import{useChat as U}from"./ChatContext.js";import{scrollBehavior as F}from"efficient-web-builder/render/components/useReducedMotion";const M="Chat with us",O="We usually reply within a few minutes",R="Hi! Ask us anything — about a wheel, an order, or fitment. Leave your details and we’ll reply.";function $({m:t}){if(t.sender_role==="system")return e("div",{className:"text-center text-[11px] text-fg/50 py-1",children:t.body});const a=t.sender_role==="bot",s=t.sender_role==="employee"||a;return e("div",{className:`flex ${s?"justify-start":"justify-end"}`,children:r("div",{className:`max-w-[80%] rounded-2xl px-3 py-2 text-sm ${s?"bg-fg/5 text-fg":"bg-accent text-accent-ink"}`,children:[s&&r("div",{className:"mb-0.5 flex items-center gap-1 text-[10px] font-semibold uppercase tracking-wide text-fg/50",children:[a&&e("span",{"aria-hidden":"true",children:"✦"}),e("span",{children:a?t.sender_name||"Assistant":t.sender_name||"Support"}),a&&e("span",{className:"font-normal normal-case tracking-normal",children:"· automated"})]}),t.body&&e("p",{className:"whitespace-pre-wrap",children:t.body}),t.image_url&&e("a",{href:t.image_url,target:"_blank",rel:"noopener noreferrer",children:e("img",{...z(t.image_url,{fallbackWidth:640,maxWidth:1280}),sizes:"(max-width: 640px) 80vw, 320px",alt:"Attachment",className:"mt-2 max-h-48 w-auto rounded-lg"})})]})})}function G({title:t,subtitle:a,greeting:s,look:x}={}){const{isOpen:o,toggle:N,close:_,messages:l,sending:i,error:h,unread:f,hasConversation:k,isSignedIn:C,send:L}=U(),g=t?.trim()||M,E=a?.trim()||O,T=s?.trim()||R,[d,b]=u(""),[c,j]=u(""),[m,I]=u(""),y=A(null),p=!C&&!k;S(()=>{o&&y.current?.scrollIntoView({behavior:F(),block:"nearest"})},[l.length,o]);const v=d.trim().length>0&&(!p||c.trim()&&/.+@.+/.test(m)),w=()=>{!v||i||(L(d,p?{name:c.trim(),email:m.trim()}:void 0),b(""))};return o?r("aside",{role:"dialog","aria-label":"Chat with us","data-sf-floating":"",className:`fixed bottom-5 ${W(x)?"left-5":"right-5"} z-[61] flex h-[min(560px,80vh)] w-[min(380px,calc(100vw-2.5rem))] flex-col overflow-hidden rounded-2xl border border-line bg-bg shadow-[0_20px_60px_rgba(0,0,0,.45)]`,style:{color:"var(--fg)"},children:[r("div",{className:"flex items-center justify-between border-b border-line px-4 py-3",children:[r("div",{children:[e("div",{className:"text-sm font-semibold text-fg",children:g}),e("div",{className:"text-[11px] text-fg/50",children:E})]}),e("button",{type:"button",onClick:_,"aria-label":"Close chat",className:"rounded-md p-1 text-fg/60 hover:bg-fg/5",children:e("svg",{className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:e("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),r("div",{className:"flex-1 space-y-2 overflow-y-auto px-3 py-3",children:[l.length===0&&e("p",{className:"px-2 py-4 text-center text-sm text-fg/50",children:T}),l.map(n=>e($,{m:n},n.id)),e("div",{ref:y})]}),r("div",{className:"border-t border-line p-3",children:[p&&r("div",{className:"mb-2 grid grid-cols-2 gap-2",children:[e("input",{value:c,onChange:n=>j(n.target.value),placeholder:"Your name",className:"rounded-lg border border-line bg-transparent px-3 py-2 text-sm outline-none focus:border-accent"}),e("input",{value:m,onChange:n=>I(n.target.value),type:"email",placeholder:"Email",className:"rounded-lg border border-line bg-transparent px-3 py-2 text-sm outline-none focus:border-accent"})]}),h&&e("p",{className:"mb-2 text-xs text-red-600",children:h}),r("div",{className:"flex items-end gap-2",children:[e("textarea",{value:d,onChange:n=>b(n.target.value),onKeyDown:n=>{n.key==="Enter"&&!n.shiftKey&&(n.preventDefault(),w())},rows:1,placeholder:"Type a message…",className:"max-h-28 flex-1 resize-none rounded-lg border border-line bg-transparent px-3 py-2 text-sm outline-none focus:border-accent"}),e("button",{type:"button",onClick:w,disabled:!v||i,className:"rounded-lg bg-btn px-3 py-2 text-sm font-semibold text-btn-ink disabled:opacity-40",children:i?"…":"Send"})]})]})]}):e(D,{label:B(g),onOpen:N,zIndex:60,look:x,badge:f>0&&e("span",{className:"absolute -top-1 -right-1 flex h-5 min-w-5 items-center justify-center rounded-full bg-red-600 px-1 text-[11px] font-bold text-white",children:f})})}export{R as DEFAULT_GREETING,O as DEFAULT_SUBTITLE,M as DEFAULT_TITLE,G as default};
1
+ "use client";import{jsx as e,jsxs as r}from"react/jsx-runtime";import{useEffect as S,useRef as A,useState as u}from"react";import{stripMarkup as B}from"efficient-web-builder/format/lib/markup";import{sizedImage as z}from"efficient-web-builder/format/lib/sized-image";import D,{chatLauncherOnLeft as W}from"./ChatLauncher.js";import{useChat as U}from"./ChatContext.js";import{scrollBehavior as F}from"efficient-web-builder/render/components/useReducedMotion";const M="Chat with us",O="We usually reply within a few minutes",R="Hi! Ask us anything — about a wheel, an order, or fitment. Leave your details and we’ll reply.";function $({m:t}){if(t.sender_role==="system")return e("div",{className:"text-center text-[11px] text-fg/50 py-1",children:t.body});const a=t.sender_role==="bot",s=t.sender_role==="employee"||a;return e("div",{className:`flex ${s?"justify-start":"justify-end"}`,children:r("div",{className:`max-w-[80%] rounded-2xl px-3 py-2 text-sm ${s?"bg-fg/5 text-fg":"bg-accent text-accent-ink"}`,children:[s&&r("div",{className:"mb-0.5 flex items-center gap-1 text-[10px] font-semibold uppercase tracking-wide text-fg/50",children:[a&&e("span",{"aria-hidden":"true",children:"✦"}),e("span",{children:a?t.sender_name||"Assistant":t.sender_name||"Support"}),a&&e("span",{className:"font-normal normal-case tracking-normal",children:"· automated"})]}),t.body&&e("p",{className:"whitespace-pre-wrap",children:t.body}),t.image_url&&e("a",{href:t.image_url,target:"_blank",rel:"noopener noreferrer",children:e("img",{...z(t.image_url,{fallbackWidth:640,maxWidth:1280}),sizes:"(max-width: 640px) 80vw, 320px",alt:"Attachment",className:"mt-2 max-h-48 w-auto rounded-lg"})})]})})}function G({title:t,subtitle:a,greeting:s,look:x}={}){const{isOpen:l,toggle:N,close:_,messages:o,sending:i,error:h,unread:f,hasConversation:k,isSignedIn:C,send:L}=U(),g=t?.trim()||M,E=a?.trim()||O,T=s?.trim()||R,[d,b]=u(""),[c,j]=u(""),[m,I]=u(""),y=A(null),p=!C&&!k;S(()=>{l&&y.current?.scrollIntoView({behavior:F(),block:"nearest"})},[o.length,l]);const v=d.trim().length>0&&(!p||c.trim()&&/.+@.+/.test(m)),w=()=>{!v||i||(L(d,p?{name:c.trim(),email:m.trim()}:void 0),b(""))};return l?r("aside",{role:"dialog","aria-label":"Chat with us","data-sf-floating":"",className:`fixed bottom-5 ${W(x)?"left-5":"right-5"} z-[61] flex h-[min(560px,80vh)] w-[min(380px,calc(100vw-2.5rem))] flex-col overflow-hidden rounded-2xl border border-line bg-bg shadow-[0_20px_60px_rgba(0,0,0,.45)]`,style:{color:"var(--fg)"},children:[r("div",{className:"flex items-center justify-between border-b border-line px-4 py-3",children:[r("div",{children:[e("div",{className:"text-sm font-semibold text-fg",children:g}),e("div",{className:"text-[11px] text-fg/50",children:E})]}),e("button",{type:"button",onClick:_,"aria-label":"Close chat",className:"rounded-md p-1 text-fg/60 hover:bg-fg/5",children:e("svg",{className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:e("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),r("div",{className:"flex-1 space-y-2 overflow-y-auto px-3 py-3",children:[o.length===0&&e("p",{className:"px-2 py-4 text-center text-sm text-fg/50",children:T}),o.map(n=>e($,{m:n},n.id)),e("div",{ref:y})]}),r("div",{className:"border-t border-line p-3",children:[p&&r("div",{className:"mb-2 grid grid-cols-2 gap-2",children:[e("input",{value:c,onChange:n=>j(n.target.value),placeholder:"Your name",className:"rounded-lg border border-line bg-transparent px-3 py-2 text-sm outline-none focus:border-accent"}),e("input",{value:m,onChange:n=>I(n.target.value),type:"email",placeholder:"Email",className:"rounded-lg border border-line bg-transparent px-3 py-2 text-sm outline-none focus:border-accent"})]}),h&&e("p",{className:"mb-2 text-xs text-alert",children:h}),r("div",{className:"flex items-end gap-2",children:[e("textarea",{value:d,onChange:n=>b(n.target.value),onKeyDown:n=>{n.key==="Enter"&&!n.shiftKey&&(n.preventDefault(),w())},rows:1,placeholder:"Type a message…",className:"max-h-28 flex-1 resize-none rounded-lg border border-line bg-transparent px-3 py-2 text-sm outline-none focus:border-accent"}),e("button",{type:"button",onClick:w,disabled:!v||i,className:"rounded-lg bg-btn px-3 py-2 text-sm font-semibold text-btn-ink disabled:opacity-40",children:i?"…":"Send"})]})]})]}):e(D,{label:B(g),onOpen:N,zIndex:60,look:x,badge:f>0&&e("span",{className:"absolute -top-1 -right-1 flex h-5 min-w-5 items-center justify-center rounded-full bg-red-600 px-1 text-[11px] font-bold text-white",children:f})})}export{R as DEFAULT_GREETING,O as DEFAULT_SUBTITLE,M as DEFAULT_TITLE,G as default};
@@ -1 +1 @@
1
- "use client";import{Fragment as d,jsx as e,jsxs as i}from"react/jsx-runtime";import{useId as v}from"react";import y from"efficient-web-builder/render/components/SectionHeader";import{SectionTextParts as N}from"efficient-web-builder/render/lib/document/editing-bridges";import{CollectionCardStyleContext as M}from"./CollectionCard.js";import{fillRowCss as S}from"../lib/sections/fill-row.js";import{renderHeadline as $}from"efficient-web-builder/render/components/goldPhrases";function j({editing:r,nodeId:t,children:s}){return!r||!t?e(d,{children:s}):e(N,{nodeId:t,sectionType:"Collections",children:s})}const E="px-[max(var(--sf-site-gutter,40px),calc((100%_-_var(--sf-content-cap,100%))/2_+_var(--sf-site-gutter,40px)))] py-[120px] max-[800px]:px-[min(20px,var(--sf-site-gutter,40px))] max-[800px]:py-[70px]",F="px-[max(var(--sf-site-gutter,40px),calc((100%_-_var(--sf-content-cap,100%))/2_+_var(--sf-site-gutter,40px)))] pt-0 pb-[120px] max-[800px]:px-[min(20px,var(--sf-site-gutter,40px))] max-[800px]:pt-0 max-[800px]:pb-[70px]",I={2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5"};function R({eyebrow:r,heading:t,columns:s,showPrice:m,cardStyle:f,layout:g,limit:n,cards:l,omitHead:a=!1,nodeId:u,partStyles:h,editing:c=!1}={}){const o=`cg-${v().replace(/:/g,"")}`,_=typeof n=="number"&&n>0,C=g==="list"?"grid-cols-1":s===void 0?"grid-cols-3":I[Math.min(5,Math.max(2,Math.round(s)))]??"grid-cols-3",p=`${o} grid ${C} gap-4 max-[800px]:grid-cols-1 max-[800px]:gap-3`,x=S(o,p,{limit:n});return i("section",{className:a?F:E,children:[a?null:e(y,{num:r!==void 0?r:"01 / Collections",accentNum:!0,title:t!==void 0?$(t,!1):i(d,{children:["Three ranges,",e("br",{}),"one standard."]}),link:{text:"View all",href:"/wheels"}}),l&&e(j,{editing:c,nodeId:u,children:i(M.Provider,{value:{showPrice:m,cardStyle:f,partStyles:h,editing:c},children:[_&&e("style",{children:`.${o} > *:nth-child(n+${n+1}){display:none}`}),x&&e("style",{children:x}),e(l,{className:p,minEmptyHeight:260})]})})]})}export{R as default};
1
+ "use client";import{Fragment as x,jsx as e,jsxs as l}from"react/jsx-runtime";import{useScopeClass as y}from"../lib/use-scope-class.js";import T from"efficient-web-builder/render/components/SectionHeader";import{SectionTextParts as E}from"efficient-web-builder/render/lib/document/editing-bridges";import{CollectionCardStyleContext as M}from"./CollectionCard.js";import{fillRowCss as S}from"../lib/sections/fill-row.js";import{renderHeadline as $}from"efficient-web-builder/render/components/goldPhrases";import{CONTENT_CAP_GUTTER as m}from"../lib/sections/content-cap-gutter.js";function R({editing:n,nodeId:s,children:t}){return!n||!s?e(x,{children:t}):e(E,{nodeId:s,sectionType:"Collections",children:t})}const j=`${m} py-[120px] max-[800px]:px-[min(20px,var(--sf-site-gutter,40px))] max-[800px]:py-[70px]`,v=`${m} pt-0 pb-[120px] max-[800px]:px-[min(20px,var(--sf-site-gutter,40px))] max-[800px]:pt-0 max-[800px]:pb-[70px]`,A={2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5"};function F({eyebrow:n,heading:s,columns:t,showPrice:f,cardStyle:g,layout:u,limit:r,cards:i,omitHead:c=!1,nodeId:h,partStyles:C,editing:a=!1}={}){const o=y("cg"),N=typeof r=="number"&&r>0,_=u==="list"?"grid-cols-1":t===void 0?"grid-cols-3":A[Math.min(5,Math.max(2,Math.round(t)))]??"grid-cols-3",p=`${o} grid ${_} gap-4 max-[800px]:grid-cols-1 max-[800px]:gap-3`,d=S(o,p,{limit:r});return l("section",{className:c?v:j,children:[c?null:e(T,{num:n!==void 0?n:"01 / Collections",accentNum:!0,title:s!==void 0?$(s,!1):l(x,{children:["Three ranges,",e("br",{}),"one standard."]}),link:{text:"View all",href:"/wheels"}}),i&&e(R,{editing:a,nodeId:h,children:l(M.Provider,{value:{showPrice:f,cardStyle:g,partStyles:C,editing:a},children:[N&&e("style",{children:`.${o} > *:nth-child(n+${r+1}){display:none}`}),d&&e("style",{children:d}),e(i,{className:p,minEmptyHeight:260})]})})]})}export{F as default};
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as p}from"react/jsx-runtime";import R from"./SectionBand.js";import{useId as j}from"react";import z from"efficient-web-builder/render/components/SectionHeader";import F from"./SectionFootnote.js";import L from"./TyreCard.js";import H from"./ViewMoreLink.js";import{renderGold as f,renderHeadline as O}from"efficient-web-builder/render/components/goldPhrases";import{useCurrency as P}from"./CurrencyContext.js";import{tyrePagePath as $}from"../lib/tyres/tyre-page-path.js";import{TYRE_ILLUSTRATION_NOTE as w}from"../lib/wheels/tyre-render.js";import{cardImageShapeTokens as B}from"efficient-web-builder/format/lib/content/card-image-shape";import{DEFAULT_CARD_INDEX_FORMAT as v,cardIndexCss as U}from"efficient-web-builder/format/lib/sections/product-card-style";import{say as Y}from"efficient-web-builder/format/lib/editor-words";const G="border-b border-line py-[120px] max-[1100px]:py-20";function u({frameClassName:o,style:i,children:n}){return o!==void 0?e("section",{className:o,style:i,children:n}):e(R,{className:G,style:i,children:n})}const x={2:"grid grid-cols-2 gap-2 max-[720px]:grid-cols-1",3:"grid grid-cols-3 gap-2 max-[1100px]:grid-cols-2 max-[720px]:grid-cols-1",4:"grid grid-cols-4 gap-2 max-[1100px]:grid-cols-2 max-[720px]:grid-cols-1"};function V({num:o,title:i,description:n,tyres:g,footnote:h,footnoteLinkText:y,footnoteLinkHref:T,viewMore:t,editing:b=!1,frameClassName:l,omitHead:N=!1,columns:S=3,cardImage:_,outline:k,indexBadge:C}){const{currency:I,formatPrice:A}=P(),s=g??[],c=`ct-${j().replace(/:/g,"")}`,m=C??v,a=U(c,m),D=s.some(r=>!r.image),E=[h,D?w:null].filter(Boolean).join(" "),d=N?null:e(z,{num:o!=null?f(o):void 0,title:i!=null?O(i,!1):void 0,description:n!=null?f(n):void 0,accent:!0});return s.length===0?b?p(u,{frameClassName:l,children:[d,e("p",{className:"border-t border-line py-6 font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.18em] text-fg-dim",children:Y("No compatible tyres found for this wheel’s sizes yet — tyres appear automatically when a matching size is active and priced in the catalog.")})]}):null:p(u,{frameClassName:l,style:B(_),children:[a&&e("style",{children:a}),d,e("div",{className:`${a?`${c} `:""}${x[S]??x[3]}`,children:s.map(r=>e(L,{outline:k,showIndex:m!=="off",size:r.size,specs:r.specs,prices:r.prices,image:r.image,inStock:r.inStock,href:$(r.slug),currency:I,formatPrice:A},r.sku))}),t&&e("div",{className:"mt-10 flex",children:e(H,{href:t.href,label:t.label})}),e(F,{text:E,linkText:y,linkHref:T})]})}export{V as default};
1
+ "use client";import{jsx as e,jsxs as p}from"react/jsx-runtime";import R from"./SectionBand.js";import{useScopeClass as j}from"../lib/use-scope-class.js";import z from"efficient-web-builder/render/components/SectionHeader";import F from"./SectionFootnote.js";import L from"./TyreCard.js";import H from"./ViewMoreLink.js";import{renderGold as f,renderHeadline as O}from"efficient-web-builder/render/components/goldPhrases";import{useCurrency as P}from"./CurrencyContext.js";import{tyrePagePath as w}from"../lib/tyres/tyre-page-path.js";import{TYRE_ILLUSTRATION_NOTE as B}from"../lib/wheels/tyre-render.js";import{cardImageShapeTokens as $}from"efficient-web-builder/format/lib/content/card-image-shape";import{DEFAULT_CARD_INDEX_FORMAT as v,cardIndexCss as U}from"efficient-web-builder/format/lib/sections/product-card-style";import{say as Y}from"efficient-web-builder/format/lib/editor-words";const G="border-b border-line py-[120px] max-[1100px]:py-20";function u({frameClassName:o,style:i,children:n}){return o!==void 0?e("section",{className:o,style:i,children:n}):e(R,{className:G,style:i,children:n})}const x={2:"grid grid-cols-2 gap-2 max-[720px]:grid-cols-1",3:"grid grid-cols-3 gap-2 max-[1100px]:grid-cols-2 max-[720px]:grid-cols-1",4:"grid grid-cols-4 gap-2 max-[1100px]:grid-cols-2 max-[720px]:grid-cols-1"};function V({num:o,title:i,description:n,tyres:g,footnote:h,footnoteLinkText:y,footnoteLinkHref:T,viewMore:s,editing:b=!1,frameClassName:l,omitHead:N=!1,columns:S=3,cardImage:_,outline:k,indexBadge:C}){const{currency:A,formatPrice:D}=P(),t=g??[],c=j("ct"),m=C??v,a=U(c,m),E=t.some(r=>!r.image),I=[h,E?B:null].filter(Boolean).join(" "),d=N?null:e(z,{num:o!=null?f(o):void 0,title:i!=null?O(i,!1):void 0,description:n!=null?f(n):void 0,accent:!0});return t.length===0?b?p(u,{frameClassName:l,children:[d,e("p",{className:"border-t border-line py-6 font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.18em] text-fg-dim",children:Y("No compatible tyres found for this wheel’s sizes yet — tyres appear automatically when a matching size is active and priced in the catalog.")})]}):null:p(u,{frameClassName:l,style:$(_),children:[a&&e("style",{children:a}),d,e("div",{className:`${a?`${c} `:""}${x[S]??x[3]}`,children:t.map(r=>e(L,{outline:k,showIndex:m!=="off",size:r.size,specs:r.specs,prices:r.prices,image:r.image,inStock:r.inStock,href:w(r.slug),currency:A,formatPrice:D},r.sku))}),s&&e("div",{className:"mt-10 flex",children:e(H,{href:s.href,label:s.label})}),e(F,{text:I,linkText:y,linkHref:T})]})}export{V as default};
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import{useEffect as O,useRef as S,useState as k}from"react";import j from"./SiteSwitch.js";import{CONSENT_CHOICE_BUTTON as v,ConsentEyebrow as T}from"./ConsentBanner.js";import{useModalDismiss as _}from"./useModalDismiss.js";import{useEnglish as R}from"./EnglishVariant.js";import{useSiteSells as P}from"./SiteRecordContext.js";import{CONSENT_BUTTONS as c,GPC_HONOURED as C,PANEL_ROWS as r}from"../lib/consent/rules.js";const U="flex items-center justify-center gap-5 border border-btn bg-btn px-6 py-4 font-mono text-[14px] uppercase tracking-[0.3em] text-btn-ink transition-colors hover:border-fg hover:bg-fg",B="text-fg underline decoration-line underline-offset-4";function m({name:n,body:o,checked:i,onChange:t,locked:l=!1}){return a("div",{className:"flex items-start justify-between gap-6 border-t border-line py-5",children:[a("div",{className:"min-w-0",children:[e("div",{className:"font-display text-[17px] text-fg",children:n}),e("p",{className:"mt-1 font-body text-[14px] leading-[1.5] text-fg-dim",children:o})]}),e(j,{checked:i,onChange:s=>t?.(s),ariaLabel:n,disabled:l,className:"flex flex-none cursor-pointer items-center gap-3 pt-1",children:l&&e("span",{className:"order-first font-mono text-[11px] uppercase tracking-[0.18em] text-fg-dim",children:c.alwaysOn})})]})}function K({rule:n,analytics:o,ads:i,gpc:t,privacyHref:l,open:s=!0,onSave:d,onClose:x,inline:p=!1}){const[f,b]=k(o),[u,y]=k(i&&!t),h=P(),w=R(),N=S(null);if(O(()=>{s&&(b(o),y(i&&!t))},[s,o,i,t]),_({active:!p&&s,onDismiss:x,focusRef:N}),!s)return null;const g=a("div",{ref:N,tabIndex:-1,onClick:E=>E.stopPropagation(),className:"relative w-[min(640px,100%)] overflow-auto border border-line bg-bg p-10 outline-none [border-radius:var(--sf-section-radius,0px)] max-[880px]:max-h-[88dvh] max-[880px]:w-full max-[880px]:border-x-0 max-[880px]:border-b-0 max-[880px]:px-5 max-[880px]:pb-8 max-[880px]:pt-7 max-[880px]:[border-radius:0]",children:[e(T,{text:n.panelEyebrow}),a("h2",{id:"consent-panel-title",className:"mt-4 font-display text-[36px] leading-[1.05] tracking-[-0.01em] text-fg max-[880px]:text-[28px]",children:["Your privacy ",e("span",{className:"font-serif font-light italic text-accent",children:"choices."})]}),t&&a("div",{className:"mt-5 border border-line bg-surface px-4 py-3 font-body text-[14px] leading-[1.5] text-fg",children:[e("span",{className:"font-mono text-[12px] uppercase tracking-[0.18em] text-accent",children:w(C.title)}),e("br",{}),C.body]}),a("div",{className:"mt-6",children:[e(m,{name:r.necessary.name,body:h?r.necessary.body:r.necessary.bodyNoSale,checked:!0,locked:!0}),e(m,{name:r.analytics.name,body:r.analytics.body,checked:f,onChange:b}),e(m,{name:n.adsRowName,body:h?r.ads.body:r.ads.bodyNoSale,checked:u,onChange:y,locked:t})]}),a("div",{className:"mt-2 grid grid-cols-3 gap-3 border-t border-line pt-6 max-[880px]:grid-cols-1",children:[e("button",{type:"button",className:U,onClick:()=>d({analytics:f,ads:u&&!t}),children:c.save}),e("button",{type:"button",className:v,onClick:()=>d({analytics:!1,ads:!1}),children:c.reject}),e("button",{type:"button",className:v,onClick:()=>d({analytics:!0,ads:!t}),children:c.accept})]}),l&&a("p",{className:"mt-5 font-body text-[13px] text-fg-dim",children:["More in our"," ",e("a",{className:B,href:l,children:c.privacyPolicy}),"."]})]});return p?e("div",{className:"flex w-full justify-center p-6",children:g}):e("div",{role:"dialog","aria-modal":"true","aria-labelledby":"consent-panel-title",onClick:x,className:"fixed inset-0 z-[95] flex items-center justify-center p-6 backdrop-blur-[8px] max-[880px]:items-end max-[880px]:p-0",style:{background:"color-mix(in oklab, var(--bg) 78%, transparent)"},children:g})}export{K as ConsentPanelView};
1
+ "use client";import{jsx as e,jsxs as n}from"react/jsx-runtime";import{useEffect as E,useRef as S,useState as N}from"react";import j from"./SiteSwitch.js";import{CONSENT_CHOICE_BUTTON as g,ConsentEyebrow as T}from"./ConsentBanner.js";import _ from"./PopupFrame.js";import{Notice as P}from"./Notice.js";import{useEnglish as R}from"./EnglishVariant.js";import{useSiteSells as B}from"./SiteRecordContext.js";import{CONSENT_BUTTONS as c,GPC_HONOURED as C,PANEL_ROWS as a}from"../lib/consent/rules.js";const U="flex items-center justify-center gap-5 border border-btn bg-btn px-6 py-4 font-mono text-[14px] uppercase tracking-[0.3em] text-btn-ink transition-colors hover:border-fg hover:bg-fg",I="text-fg underline decoration-line underline-offset-4";function m({name:r,body:s,checked:o,onChange:t,locked:l=!1}){return n("div",{className:"flex items-start justify-between gap-6 border-t border-line py-5",children:[n("div",{className:"min-w-0",children:[e("div",{className:"font-display text-[17px] text-fg",children:r}),e("p",{className:"mt-1 font-body text-[14px] leading-[1.5] text-fg-dim",children:s})]}),e(j,{checked:o,onChange:i=>t?.(i),ariaLabel:r,disabled:l,className:"flex flex-none cursor-pointer items-center gap-3 pt-1",children:l&&e("span",{className:"order-first font-mono text-[11px] uppercase tracking-[0.18em] text-fg-dim",children:c.alwaysOn})})]})}function W({rule:r,analytics:s,ads:o,gpc:t,privacyHref:l,open:i=!0,onSave:d,onClose:k,inline:v=!1}){const[p,x]=N(s),[f,b]=N(o&&!t),u=B(),w=R(),h=S(null);if(E(()=>{i&&(x(s),b(o&&!t))},[i,s,o,t]),!i)return null;const y=n("div",{ref:h,tabIndex:-1,onClick:O=>O.stopPropagation(),className:"relative w-[min(640px,100%)] overflow-auto border border-line bg-bg p-10 outline-none [border-radius:var(--sf-section-radius,0px)] max-[880px]:max-h-[88dvh] max-[880px]:w-full max-[880px]:border-x-0 max-[880px]:border-b-0 max-[880px]:px-5 max-[880px]:pb-8 max-[880px]:pt-7 max-[880px]:[border-radius:0]",children:[e(T,{text:r.panelEyebrow}),n("h2",{id:"consent-panel-title",className:"mt-4 font-display text-[36px] leading-[1.05] tracking-[-0.01em] text-fg max-[880px]:text-[28px]",children:["Your privacy ",e("span",{className:"font-serif font-light italic text-accent",children:"choices."})]}),t&&e("div",{className:"mt-5",children:n(P,{tone:"quiet",children:[e("span",{className:"font-mono text-[12px] uppercase tracking-[0.18em] text-accent",children:w(C.title)}),e("br",{}),C.body]})}),n("div",{className:"mt-6",children:[e(m,{name:a.necessary.name,body:u?a.necessary.body:a.necessary.bodyNoSale,checked:!0,locked:!0}),e(m,{name:a.analytics.name,body:a.analytics.body,checked:p,onChange:x}),e(m,{name:r.adsRowName,body:u?a.ads.body:a.ads.bodyNoSale,checked:f,onChange:b,locked:t})]}),n("div",{className:"mt-2 grid grid-cols-3 gap-3 border-t border-line pt-6 max-[880px]:grid-cols-1",children:[e("button",{type:"button",className:U,onClick:()=>d({analytics:p,ads:f&&!t}),children:c.save}),e("button",{type:"button",className:g,onClick:()=>d({analytics:!1,ads:!1}),children:c.reject}),e("button",{type:"button",className:g,onClick:()=>d({analytics:!0,ads:!t}),children:c.accept})]}),l&&n("p",{className:"mt-5 font-body text-[13px] text-fg-dim",children:["More in our"," ",e("a",{className:I,href:l,children:c.privacyPolicy}),"."]})]});return v?e("div",{className:"flex w-full justify-center p-6",children:y}):e(_,{site:{blur:8,layer:"consent",sheetOnPhone:!0,focusRef:h},labelledBy:"consent-panel-title",onClose:k,children:y})}export{W as ConsentPanelView};
@@ -1 +1 @@
1
- "use client";import{jsx as n,jsxs as s,Fragment as ee}from"react/jsx-runtime";import ne from"./SectionBand.js";import{useEffect as z,useState as _}from"react";import{OTHER_REASON_ID as v}from"efficient-web-builder/format/lib/content/contact";import{FormFieldInput as te,FormHoneypot as ae,successMessageFor as le,useBoundForm as re,useFormSubmission as oe}from"./formSubmission.js";import se from"efficient-web-builder/render/components/SectionEyebrow";import ie,{FieldCaption as ce}from"./WebFormField.js";import{scrollBehavior as de}from"efficient-web-builder/render/components/useReducedMotion";import{renderChrome as q,renderGold as w,renderHeadline as me,splitParagraphs as pe}from"efficient-web-builder/render/components/goldPhrases";import{say as j}from"efficient-web-builder/format/lib/editor-words";import{phoneHref as fe}from"efficient-web-builder/format/lib/links/phone-href";import{PART_ROW_ATTR as ue,encodePartRow as xe}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)]",labelXs:"text-[length:var(--size-label,10px)]",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 be(i,l){return i.map((r,a)=>l?{...r,at:a,label:r.label||j(M.label),value:r.value||j(M.value),sub:r.sub||j(M.sub)}:{...r,at:a}).filter(r=>!r.hidden)}function A(i,l){return l?{[ue]:xe("channels",i.at)}:{}}function T(i){if(i.href)return i.href;const l=(i.value??"").trim();if(l.includes("@"))return`mailto:${l}`;if(/^\+?[\d\s().-]{6,}$/.test(l))return fe(l)}function ge(i){const l=[],r=new Map;for(const a of i){if(!a.groupId){l.push(a);continue}const p=a.value.trim().toLowerCase(),x=r.get(p);if(x)x.label=`${x.label} · ${a.label}`;else{const b={...a};r.set(p,b),l.push(b)}}return l}function he(i,l,r){const a=p=>String(p??"").trim().toLowerCase();for(const p of i?.fields??[]){if(p.type!=="select"||!Array.isArray(p.options))continue;const x=p.options.map(String);if(!l.some(d=>x.some(f=>a(f)===a(d.title))))continue;const b=d=>a(d===v?r:l.find(f=>f.id===d)?.title);return{key:p.key,optionFor:d=>x.find(f=>a(f)===b(d)&&b(d)!==""),idFor:d=>{const f=l.find($=>a($.title)===a(d));return f?f.id:r&&a(d)===a(r)?v:void 0}}}return null}const V=`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 ve({routingNumber:i,routingTagline:l,groups:r,formNumber:a,formHeading:p,metaLines:x,showOther:b=!0,otherLabel:d="Other",otherNoteTitle:f,otherNoteBody:$,buttonText:O,consent:H,channels:B,formSlug:L,form:W,editing:y,initialActiveId:k,onActiveChange:P,reasonExtras:D}){const N=[...r.map(e=>e.id),...b?[v]:[]],G=k&&N.includes(k)?k:N[0]??v,[g,C]=_(G);z(()=>{N.includes(g)||C(N[0]??v)},[N.join("|")]),z(()=>{k&&N.includes(k)&&C(k)},[k]);const h=re(L,W),m=oe({form:h,formSlug:L,editing:y}),u=he(h,r,b?d:void 0),I=e=>{C(e),R(null);const o=u?.optionFor(e);u&&o!==void 0&&m.set(u.key,o),P?.(e)};z(()=>{if(!u||m.valueOf(u.key))return;const e=u.optionFor(g);e!==void 0&&m.set(u.key,e)},[u?.key]);const[X,R]=_(null),S=be(B??[],!!y),Z=e=>X!==null?!e.groupId&&e.value===X:e.groupId===g,J=h===void 0,E=!!h||!!y,[K,Q]=_(!1);z(()=>{const e=()=>Q(document.documentElement.getAttribute("data-theme")==="light");e();const o=new MutationObserver(e);return o.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),()=>o.disconnect()},[]);const U=r.length>0||!!y;return s(ee,{children:[U&&s(ne,{className:"border-b border-line py-[60px]",style:K?void 0:{background:"var(--section-bg)"},children:[(i||l)&&s("div",{className:"mb-6 flex items-center gap-6 border-b border-line pb-6",children:[i&&n(se,{text:i}),l&&n("span",{className:`font-display ${t.bodySmall} uppercase tracking-[0.04em] text-fg-dim`,children:w(l)})]}),n("div",{className:"sf-card grid grid-cols-4 gap-[2px] border border-line bg-line max-[1100px]:grid-cols-2 max-[700px]:grid-cols-1",children:r.map(e=>{const o=g===e.id;return s("button",{type:"button",onClick:()=>{I(e.id),typeof window<"u"&&window.matchMedia("(max-width: 1100px)").matches&&document.getElementById("contact-form")?.scrollIntoView({behavior:de(),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&&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)})})]}),(E||S.length>0)&&n("section",{id:"contact-form",className:"scroll-mt-[80px] border-b border-line py-20 max-[1100px]:py-[60px]",children:s("div",{className:["mx-auto grid max-w-[var(--sf-site-width,1600px)] gap-20 px-[var(--sf-site-gutter,40px)] max-[1100px]:grid-cols-1 max-[1100px]:gap-[60px] max-[1100px]:px-[min(24px,var(--sf-site-gutter,40px))]",E&&S.length>0?"grid-cols-[1.3fr_1fr]":"grid-cols-1"].join(" "),children:[E&&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:w(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:me(p,!0)})]}),!!(x&&x.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:x.map((e,o)=>n("div",{children:e},o))})]}),h?m.done?n("div",{className:`border border-accent bg-accent/[0.08] p-8 font-display ${t.body} leading-[1.6] text-fg-dim`,children:le(h,"Thanks — we've received your message.")}):s("form",{className:"grid grid-cols-2 gap-5 max-[700px]:grid-cols-1",onSubmit:m.handleSubmit,children:[h.fields.map(e=>n(ie,{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(te,{field:e,value:m.valueOf(e.key),onChange:o=>{m.set(e.key,o);const c=u&&e.key===u.key?u.idFor(o):void 0;c!==void 0&&(C(c),R(null),P?.(c))},className:e.type==="textarea"?`${V} min-h-[140px] resize-y leading-[1.5]`:e.type==="checkbox"?"size-4 self-start accent-accent":V})},e.key)),s("div",{className:"col-span-2 flex flex-col gap-2 max-[700px]:col-span-1",children:[n(ce,{required:!0,children:"Reason"}),s("div",{className:"mt-1 flex flex-wrap gap-2",children:[r.map(e=>{const o=g===e.id;return n("button",{type:"button",onClick:()=>I(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)}),b&&n("button",{type:"button",onClick:()=>I(v),className:[`cursor-pointer border px-4 py-3 font-mono ${t.labelSmall} uppercase tracking-[0.2em] transition-colors`,g===v?"border-accent bg-accent text-bg":"border-line text-fg-dim hover:text-fg"].join(" "),children:q(d)})]})]}),D?.(g),g===v&&(f||$)&&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:w(f)}),$&&pe($).map((e,o)=>n("p",{className:`font-display ${t.body} leading-[1.55] text-fg-dim`,children:w(e)},o))]}),n(ae,{value:m.honeypot,onChange:m.setHoneypot}),m.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:m.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:[H&&n("span",{className:`max-w-[380px] font-mono ${t.labelSmall} uppercase leading-[1.6] tracking-[0.18em] text-fg-dim`,children:w(H)}),n("button",{type:y?"button":"submit",disabled:m.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:m.submitting?"Sending…":O?q(O):"Send Message →"})]})]}):n("p",{className:`font-mono ${t.labelSmall} uppercase tracking-[0.22em] text-fg-dim`,children:J?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.")})]}),S.length>0&&n("aside",{className:"flex flex-col gap-0 max-[1100px]:hidden",children:S.map((e,o)=>{const c=Z(e),F=!!!e.groupId;return s("div",{...A(e,y),onClick:F?()=>R(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":"",c?"border-l-accent pl-6":F?"border-l-transparent hover:bg-accent/[0.04]":"border-l-transparent"].join(" "),style:c?{background:"color-mix(in oklab, var(--accent) 8%, transparent)"}:void 0,children:[c&&!!h&&s("span",{className:"absolute right-[18px] top-6 flex flex-col items-end gap-0.5 text-right",children:[n("span",{className:`font-mono ${t.labelSmall} uppercase tracking-[0.24em] text-accent`,children:"→ Message routes here"}),n("span",{className:`font-mono ${t.labelXs} uppercase tracking-[0.18em] text-fg-dim`,children:"Other inboxes filter as spam"})]}),n("span",{className:[`font-mono ${t.labelSmall} uppercase tracking-[0.3em] transition-colors`,c?"text-fg":"text-accent"].join(" "),children:e.label}),F?n("a",{href:e.href,onClick:Y=>Y.stopPropagation(),className:[`font-heading3 ${t.headingSmall1} font-medium leading-[1.2] tracking-[-0.02em] transition-colors hover:text-accent`,c?"text-accent":"text-fg"].join(" "),children:e.value}):n("a",{href:T(e),className:[`font-heading3 ${t.headingSmall1} font-medium leading-[1.2] tracking-[-0.02em]`,c?"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}`)})}),S.length>0&&n("div",{"data-contact-phone-list":!0,className:"hidden flex-col gap-0 max-[1100px]:flex",children:ge(S).map((e,o)=>{const c=!!e.groupId;return s("div",{...A(e,y),className:["flex flex-col gap-3 border-b border-line px-5 py-5",c?"":"border-t-2 border-t-accent"].join(" "),children:[n("span",{className:[`font-mono ${t.labelSmall} uppercase tracking-[0.3em]`,c?"text-fg":"text-accent"].join(" "),children:e.label}),n("a",{href:T(e),className:[`font-heading3 ${t.headingSmall1} font-medium leading-[1.2] tracking-[-0.02em] [overflow-wrap:anywhere]`,c?"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{M as CHANNEL_HINTS,T as channelHref,ve as default,be as drawnChannels,V as fieldClass,ge as mergeChannelsForPhone,he as topicFieldOf};
1
+ "use client";import{jsx as n,jsxs as i,Fragment as Y}from"react/jsx-runtime";import ee from"./SectionBand.js";import{useEffect as _,useState as q}from"react";import{useRootIsDark as ne}from"efficient-shell/theme";import{OTHER_REASON_ID as h}from"efficient-web-builder/format/lib/content/contact";import{FormFieldInput as te,FormHoneypot as ae,successMessageFor as re,useBoundForm as le,useFormSubmission as oe}from"./formSubmission.js";import ie from"efficient-web-builder/render/components/SectionEyebrow";import se,{FieldCaption as ce}from"./WebFormField.js";import{scrollBehavior as de}from"efficient-web-builder/render/components/useReducedMotion";import{renderChrome as T,renderGold as $,renderHeadline as me,splitParagraphs as pe}from"efficient-web-builder/render/components/goldPhrases";import{say as j}from"efficient-web-builder/format/lib/editor-words";import{phoneHref as fe}from"efficient-web-builder/format/lib/links/phone-href";import{PART_ROW_ATTR as ue,encodePartRow as xe}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)]"},E={label:"Label",value:"Value",sub:"Sub line"};function be(s,r){return s.map((l,a)=>r?{...l,at:a,label:l.label||j(E.label),value:l.value||j(E.value),sub:l.sub||j(E.sub)}:{...l,at:a}).filter(l=>!l.hidden)}function V(s,r){return r?{[ue]:xe("channels",s.at)}:{}}function X(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 fe(r)}function ge(s){const r=[],l=new Map;for(const a of s){if(!a.groupId){r.push(a);continue}const p=a.value.trim().toLowerCase(),x=l.get(p);if(x)x.label=`${x.label} · ${a.label}`;else{const b={...a};l.set(p,b),r.push(b)}}return r}function he(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 x=p.options.map(String);if(!r.some(c=>x.some(f=>a(f)===a(c.title))))continue;const b=c=>a(c===h?l:r.find(f=>f.id===c)?.title);return{key:p.key,optionFor:c=>x.find(f=>a(f)===b(c)&&b(c)!==""),idFor:c=>{const f=r.find(w=>a(w.title)===a(c));return f?f.id:l&&a(c)===a(l)?h:void 0}}}return null}const A=`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 ye({routingNumber:s,routingTagline:r,groups:l,formNumber:a,formHeading:p,metaLines:x,showOther:b=!0,otherLabel:c="Other",otherNoteTitle:f,otherNoteBody:w,buttonText:H,consent:M,channels:B,formSlug:O,form:D,editing:y,initialActiveId:v,onActiveChange:L,reasonExtras:W}){const N=[...l.map(e=>e.id),...b?[h]:[]],G=v&&N.includes(v)?v:N[0]??h,[g,C]=q(G);_(()=>{N.includes(g)||C(N[0]??h)},[N.join("|")]),_(()=>{v&&N.includes(v)&&C(v)},[v]);const k=le(O,D),d=oe({form:k,formSlug:O,editing:y}),u=he(k,l,b?c:void 0),R=e=>{C(e),z(null);const o=u?.optionFor(e);u&&o!==void 0&&d.set(u.key,o),L?.(e)};_(()=>{if(!u||d.valueOf(u.key))return;const e=u.optionFor(g);e!==void 0&&d.set(u.key,e)},[u?.key]);const[P,z]=q(null),S=be(B??[],!!y),U=e=>P!==null?!e.groupId&&e.value===P:e.groupId===g,Z=k===void 0,I=!!k||!!y,J=!ne({whenUnset:!0}),K=l.length>0||!!y;return i(Y,{children:[K&&i(ee,{className:"border-b border-line py-[60px]",style:J?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(ie,{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-[1100px]: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:de(),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||S.length>0)&&n("section",{id:"contact-form",className:"scroll-mt-[80px] border-b border-line py-20 max-[1100px]:py-[60px]",children:i("div",{className:["mx-auto grid max-w-[var(--sf-site-width,1600px)] gap-20 px-[var(--sf-site-gutter,40px)] max-[1100px]:grid-cols-1 max-[1100px]:gap-[60px] max-[1100px]:px-[min(24px,var(--sf-site-gutter,40px))]",I&&S.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:me(p,!0)})]}),!!(x&&x.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:x.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:re(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(se,{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(te,{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),L?.(m))},className:e.type==="textarea"?`${A} min-h-[140px] resize-y leading-[1.5]`:e.type==="checkbox"?"size-4 self-start accent-accent":A})},e.key)),i("div",{className:"col-span-2 flex flex-col gap-2 max-[700px]:col-span-1",children:[n(ce,{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)}),b&&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:T(c)})]})]}),W?.(g),g===h&&(f||w)&&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)}),w&&pe(w).map((e,o)=>n("p",{className:`font-display ${t.body} leading-[1.55] text-fg-dim`,children:$(e)},o))]}),n(ae,{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:y?"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…":H?T(H):"Send Message →"})]})]}):n("p",{className:`font-mono ${t.labelSmall} uppercase tracking-[0.22em] text-fg-dim`,children:Z?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.")})]}),S.length>0&&n("aside",{className:"flex flex-col gap-0 max-[1100px]:hidden",children:S.map((e,o)=>{const m=U(e),F=!!!e.groupId;return i("div",{...V(e,y),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:Q=>Q.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:X(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}`)})}),S.length>0&&n("div",{"data-contact-phone-list":!0,className:"hidden flex-col gap-0 max-[1100px]:flex",children:ge(S).map((e,o)=>{const m=!!e.groupId;return i("div",{...V(e,y),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:X(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{E as CHANNEL_HINTS,X as channelHref,ye as default,be as drawnChannels,A as fieldClass,ge as mergeChannelsForPhone,he as topicFieldOf};
@@ -1 +1 @@
1
- "use client";import{jsx as t,jsxs as a}from"react/jsx-runtime";import{useState as d}from"react";import{COUPON_DEFERRED_MESSAGE as m}from"../lib/cart/coupon-preview.js";import{useCart as u}from"./CartContext.js";function x({customerEmail:c}){const{coupon:e,applyCoupon:s,removeCoupon:p,couponBusy:n}=u(),[r,i]=d("");async function l(){n||!r.trim()||(await s(r,c),i(""))}return a("div",{className:"flex flex-col gap-2",children:[e===null?a("div",{className:"flex border border-line",children:[t("input",{type:"text",value:r,onChange:o=>i(o.target.value),onKeyDown:o=>{o.key==="Enter"&&(o.preventDefault(),l())},placeholder:"Coupon code","aria-label":"Coupon code",className:"flex-1 bg-transparent px-4 py-4 font-mono text-[11px] uppercase tracking-[0.18em] text-fg outline-none placeholder:text-fg-dim"}),t("button",{type:"button",onClick:()=>{l()},disabled:n,className:"border-l border-line px-4 font-mono text-[10px] uppercase tracking-[0.26em] text-btn transition-colors hover:bg-btn hover:text-btn-ink disabled:cursor-wait disabled:opacity-60",children:n?"…":"Apply"})]}):a("div",{className:["flex items-center justify-between gap-3 border px-4 py-3",e.valid?"border-accent":"border-line"].join(" "),style:e.valid?{background:"color-mix(in oklab, var(--accent) 8%, transparent)"}:void 0,children:[t("span",{className:["font-mono text-[11px] uppercase tracking-[0.22em]",e.valid?"text-accent":e.deferred?"text-fg":"text-fg-dim line-through"].join(" "),children:e.code}),t("button",{type:"button",onClick:p,"aria-label":`Remove coupon ${e.code}`,className:"font-mono text-[12px] text-fg-dim transition-colors hover:text-fg",children:"✕"})]}),e?.deferred?t("p",{className:"font-mono text-[10px] uppercase tracking-[0.18em] text-fg-dim",children:m}):e&&!e.valid&&e.message&&t("p",{className:"font-mono text-[10px] uppercase tracking-[0.18em] text-alert",children:e.message})]})}export{x as default};
1
+ "use client";import{jsx as t,jsxs as r}from"react/jsx-runtime";import{useState as p}from"react";import{COUPON_DEFERRED_MESSAGE as u}from"../lib/cart/coupon-preview.js";import{useCart as m}from"./CartContext.js";function x({customerEmail:i}){const{coupon:e,applyCoupon:c,removeCoupon:d,couponBusy:o}=m(),[a,l]=p("");async function s(){o||!a.trim()||(await c(a,i),l(""))}return r("div",{className:"flex flex-col gap-2",children:[e===null?r("div",{className:"flex border border-line",children:[t("input",{type:"text",value:a,onChange:n=>l(n.target.value),onKeyDown:n=>{n.key==="Enter"&&(n.preventDefault(),s())},placeholder:"Coupon code","aria-label":"Coupon code",className:"flex-1 bg-transparent px-4 py-4 font-mono text-[11px] uppercase tracking-[0.18em] text-fg outline-none placeholder:text-fg-dim"}),t("button",{type:"button",onClick:()=>{s()},disabled:o,className:"border-l border-line px-4 font-mono text-[10px] uppercase tracking-[0.26em] text-btn transition-colors hover:bg-btn hover:text-btn-ink disabled:cursor-wait disabled:opacity-60",children:o?"…":"Apply"})]}):r("div",{className:["flex items-center justify-between gap-3 border px-4 py-3",e.valid?"border-accent":"border-line"].join(" "),style:e.valid?{background:"color-mix(in oklab, var(--accent) 8%, transparent)"}:void 0,children:[t("span",{className:["font-mono text-[11px] uppercase tracking-[0.22em]",e.valid?"text-accent":e.deferred||e.unchecked?"text-fg":"text-fg-dim line-through"].join(" "),children:e.code}),e.unchecked&&t("button",{type:"button",onClick:()=>{c(e.code,i)},disabled:o,className:"ml-auto font-mono text-[10px] uppercase tracking-[0.26em] text-btn transition-colors hover:text-fg disabled:cursor-wait disabled:opacity-60",children:o?"…":"Try again"}),t("button",{type:"button",onClick:d,"aria-label":`Remove coupon ${e.code}`,className:"font-mono text-[12px] text-fg-dim transition-colors hover:text-fg",children:"✕"})]}),e?.deferred?t("p",{className:"font-mono text-[10px] uppercase tracking-[0.18em] text-fg-dim",children:u}):e&&!e.valid&&e.message&&t("p",{className:"font-mono text-[10px] uppercase tracking-[0.18em] text-alert",children:e.message})]})}export{x as default};
@@ -1 +1 @@
1
- "use client";import{jsx as h}from"react/jsx-runtime";import{createContext as A,useContext as g,useEffect as D,useMemo as a,useState as v}from"react";import{PRICE_LOCALE as I}from"../lib/commerce.js";import{safeLocalStorage as E}from"efficient-web-builder/format/lib/safe-storage";const O="storefront-country",P=O,C=A(null);function L(o){return w(o,"catalogue")}function T(o){return w(o,"money")}function w(o,m){const f=new Map(o.map(n=>[n.code,n.decimalPlaces])),s=new Map;return(n,t)=>{if(!t)return"";let e=s.get(t);if(!e){const u=f.get(t)??0;e=new Intl.NumberFormat(I,{style:"currency",currency:t,minimumFractionDigits:m==="money"?u:0,maximumFractionDigits:u}),s.set(t,e)}return e.format(n)}}function N({children:o,currencies:m,countries:f,defaultCurrency:s,defaultCountry:n}){const t=a(()=>m??[],[m]),e=a(()=>f??[],[f]),u=a(()=>s||t.find(r=>r.isDefault)?.code||t[0]?.code||"",[s,t]),F=a(()=>n||e.find(r=>r.isDefault)?.code||e[0]?.code||"",[n,e]),[d,p]=v(F),[x,M]=v(!1);D(()=>{const r=E.getItem(P);r&&e.some(i=>i.code===r)&&p(r),M(!0)},[e]);function R(r){p(r),E.setItem(P,r)}const S=a(()=>{const r=e.find(c=>c.code===d)??null,i=r?.currency,l=i&&t.some(c=>c.code===i)?i:u,_=L(t),b=T(t);return{country:d,currency:l,setCountry:R,currencies:t,countries:e,activeCountry:r,formatPrice:(c,y)=>_(c,y??l),formatMoney:(c,y)=>b(c,y??l),ready:x}},[d,t,e,u,x]);return h(C.Provider,{value:S,children:o})}function k(){const o=g(C);if(!o)throw new Error("useCurrency must be used within a CurrencyProvider");return o}function U(){return g(C)?.country??""}export{O as COUNTRY_STORAGE_KEY,N as CurrencyProvider,T as createMoneyFormatter,L as createPriceFormatter,U as useActiveCountry,k as useCurrency};
1
+ "use client";import{jsx as h}from"react/jsx-runtime";import{createContext as A,useContext as v,useEffect as O,useMemo as i,useState as E}from"react";import{currencyFormat as T}from"../lib/commerce.js";import{safeLocalStorage as P}from"efficient-web-builder/format/lib/safe-storage";const Y="storefront-country",g=Y,l=A(null);function j(r){return S(r,"catalogue")}function D(r){return S(r,"money")}function S(r,a){const f=new Map(r.map(n=>[n.code,n.decimalPlaces]));return(n,s)=>{if(!s)return"";const t=f.get(s)??0;return T(s,a==="money"?t:0,t).format(n)}}function L({children:r,currencies:a,countries:f,defaultCurrency:n,defaultCountry:s}){const t=i(()=>a??[],[a]),o=i(()=>f??[],[f]),C=i(()=>n||t.find(e=>e.isDefault)?.code||t[0]?.code||"",[n,t]),w=i(()=>s||o.find(e=>e.isDefault)?.code||o[0]?.code||"",[s,o]),[m,p]=E(w),[x,F]=E(!1);O(()=>{const e=P.getItem(g);e&&o.some(u=>u.code===e)&&p(e),F(!0)},[o]);function M(e){p(e),P.setItem(g,e)}const R=i(()=>{const e=o.find(c=>c.code===m)??null,u=e?.currency,d=u&&t.some(c=>c.code===u)?u:C,_=j(t),b=D(t);return{country:m,currency:d,setCountry:M,currencies:t,countries:o,activeCountry:e,formatPrice:(c,y)=>_(c,y??d),formatMoney:(c,y)=>b(c,y??d),ready:x}},[m,t,o,C,x]);return h(l.Provider,{value:R,children:r})}function N(){const r=v(l);if(!r)throw new Error("useCurrency must be used within a CurrencyProvider");return r}function U(){return v(l)?.country??""}export{Y as COUNTRY_STORAGE_KEY,L as CurrencyProvider,D as createMoneyFormatter,j as createPriceFormatter,U as useActiveCountry,N as useCurrency};