@riverbankcms/sdk 0.160.0 → 0.161.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 (207) hide show
  1. package/dist/_dts/{BlocksIslandsHydrator-CoqeotCL.d.ts → BlocksIslandsHydrator-Bx4kLiTA.d.ts} +1 -1
  2. package/dist/_dts/{Page-C0ENVLCF.d.ts → Page-Dm7_P13o.d.ts} +211 -9
  3. package/dist/_dts/{SdkPreviewMode-jZK0A49V.d.ts → SdkPreviewMode-D7HdWWwF.d.ts} +4 -4
  4. package/dist/_dts/{auth-contract-FPg0-2MC.d.ts → auth-contract-CgJ5nMaH.d.ts} +2 -0
  5. package/dist/_dts/{client-uMMuPq9V.d.ts → client-Ep0jI9eE.d.ts} +1 -1
  6. package/dist/_dts/{content-types-D6nXGqdQ.d.ts → content-types-BgAzCrBc.d.ts} +2 -2
  7. package/dist/_dts/{contracts-Bnmj1nxu.d.ts → contracts-DUiOnj9e.d.ts} +8 -5
  8. package/dist/_dts/{footerPageOutline-CeLjFX8b.d.ts → footerPageOutline-B-uXamTG.d.ts} +6 -6
  9. package/dist/_dts/{generatePageMetadata-nyU8q02J.d.ts → generatePageMetadata-BDkZYEcS.d.ts} +2 -2
  10. package/dist/_dts/{index-Blwl7yl6.d.ts → index-BQDBQvdu.d.ts} +1 -1
  11. package/dist/_dts/{index-lkpjIg5i.d.ts → index-BVkP8f70.d.ts} +1 -1
  12. package/dist/_dts/{index-CEaKil7G.d.ts → index-CF6Cjs7b.d.ts} +2 -2
  13. package/dist/_dts/{index-nVoi_74l.d.ts → index-CSsfq6KG.d.ts} +3 -17
  14. package/dist/_dts/{index-DahMwisK.d.ts → index-D_8uz4OP.d.ts} +3 -3
  15. package/dist/_dts/{index-Bg64CkV-.d.ts → index-DvKQA6AZ.d.ts} +4 -4
  16. package/dist/_dts/{index-C5xslEBn.d.ts → index-KPrWM0KF.d.ts} +1 -1
  17. package/dist/_dts/{index-BaaGBY1v.d.ts → index-ylivB7Jj.d.ts} +2 -2
  18. package/dist/_dts/{loadContent-CYLmzvLq.d.ts → loadContent-DTjKOO-T.d.ts} +10 -10
  19. package/dist/_dts/{resolvePageContent-DqnxChOs.d.ts → resolvePageContent-C1vA5c5w.d.ts} +2 -2
  20. package/dist/_dts/{schema-D0bNcPWK.d.ts → schema-BHu0PYWl.d.ts} +18821 -16622
  21. package/dist/_dts/sdk/src/bookings/index.d.ts +2 -2
  22. package/dist/_dts/sdk/src/client/types.d.ts +2 -2
  23. package/dist/_dts/sdk/src/client.d.ts +7 -7
  24. package/dist/_dts/sdk/src/config/index.d.ts +6 -6
  25. package/dist/_dts/sdk/src/config/template-validation.d.ts +1 -1
  26. package/dist/_dts/sdk/src/config/validation.d.ts +1 -1
  27. package/dist/_dts/sdk/src/index.d.ts +8 -8
  28. package/dist/_dts/sdk/src/manifest/index.d.ts +3 -3
  29. package/dist/_dts/sdk/src/metadata/index.d.ts +1 -1
  30. package/dist/_dts/sdk/src/navigation/index.d.ts +2 -2
  31. package/dist/_dts/sdk/src/next/index.d.ts +7 -7
  32. package/dist/_dts/sdk/src/next/middleware.d.ts +2 -2
  33. package/dist/_dts/sdk/src/page-converter/index.d.ts +3 -3
  34. package/dist/_dts/sdk/src/portal/client.d.ts +1 -1
  35. package/dist/_dts/sdk/src/prebuild/index.d.ts +1 -1
  36. package/dist/_dts/sdk/src/preview-next/before-render.d.ts +2 -2
  37. package/dist/_dts/sdk/src/preview-next/client/index.d.ts +2 -2
  38. package/dist/_dts/sdk/src/preview-next/client/runtime.d.ts +1 -1
  39. package/dist/_dts/sdk/src/preview-next/keep-alive.d.ts +1 -1
  40. package/dist/_dts/sdk/src/preview-next/session.d.ts +2 -2
  41. package/dist/_dts/sdk/src/rendering/client.d.ts +2 -2
  42. package/dist/_dts/sdk/src/rendering/index.d.ts +6 -6
  43. package/dist/_dts/sdk/src/rendering/islands/client.d.ts +1 -1
  44. package/dist/_dts/sdk/src/rendering/server.d.ts +2 -2
  45. package/dist/_dts/sdk/src/routing/index.d.ts +5 -5
  46. package/dist/_dts/sdk/src/server.d.ts +5 -5
  47. package/dist/_dts/sdk/src/theme/index.d.ts +1 -1
  48. package/dist/_dts/{session-Ba2CsnK5.d.ts → session-C_gtSFyZ.d.ts} +2 -1
  49. package/dist/_dts/{types-D8czmbQF.d.ts → types-BR1Yboa9.d.ts} +1060 -140
  50. package/dist/_dts/{types-Dm-KW7nj.d.ts → types-CJXTCF_F.d.ts} +3 -3
  51. package/dist/_dts/{types-CFrYuXYP.d.ts → types-D02ngcUH.d.ts} +4 -2
  52. package/dist/_dts/{types-DSgmJ15W.d.ts → types-ZGUiHpDE.d.ts} +7 -7
  53. package/dist/_dts/{validation-Bmb4WnHg.d.ts → validation-BaV565gb.d.ts} +4 -4
  54. package/dist/client/{BlocksIslandsHydrator-DZRKi6tT.mjs → BlocksIslandsHydrator-DTExCJsb.mjs} +22 -21
  55. package/dist/client/{BookingMailingListNote-C00sLLdL.mjs → BookingMailingListNote-BDpxmn1p.mjs} +1 -1
  56. package/dist/client/{CalendarNavigationChevron-CHSi9b3E.mjs → CalendarNavigationChevron-PeCiL82X.mjs} +6 -6
  57. package/dist/client/{CheckboxChoice-Bhm6RAUL.mjs → CheckboxChoice-DWexRLf6.mjs} +1 -1
  58. package/dist/client/{DemoBookingPortalAccess-CaN-7ui7.mjs → DemoBookingPortalAccess-3zmIqakW.mjs} +5 -5
  59. package/dist/client/{DemoPortalSignInLink-ClxN5_xZ.mjs → DemoPortalSignInLink-GHi-8BW5.mjs} +1 -1
  60. package/dist/client/{EventCalendar.client-BncvSa1n.mjs → EventCalendar.client-BxQLY5cX.mjs} +9 -9
  61. package/dist/client/{EventCombined.client-DluBxVVu.mjs → EventCombined.client-B5bmQ03b.mjs} +8 -8
  62. package/dist/client/{EventEmbeddedCheckoutStep-BiJrMtfp.mjs → EventEmbeddedCheckoutStep-CgMZ9TeU.mjs} +1 -1
  63. package/dist/client/{EventItem-CXhnT9pF.mjs → EventItem-BEx-qiDE.mjs} +4 -4
  64. package/dist/client/{EventListWeekNavigation-V-dtoDlD.mjs → EventListWeekNavigation-CyH5tA6Y.mjs} +1 -1
  65. package/dist/client/{EventListing.client-DPO6SZbx.mjs → EventListing.client-D3uySdGP.mjs} +3 -3
  66. package/dist/client/{EventListing.view-B-Yi5JZS.mjs → EventListing.view-9RFrBejr.mjs} +29 -13
  67. package/dist/client/{EventRegistrationPayment-Dc3Fnlnw.mjs → EventRegistrationPayment-CG2tQx8K.mjs} +25 -13
  68. package/dist/client/LocationMapActions-Wsr83Q7q.mjs +268 -0
  69. package/dist/client/{Page-7PkzO04N.mjs → Page-Bf2nPACI.mjs} +809 -298
  70. package/dist/client/{StepIndicator-DiD6euZ8.mjs → StepIndicator-CZweb1vs.mjs} +2 -2
  71. package/dist/client/{TabBarFragment-BHd8GN8y.mjs → TabBarFragment-Bkgz67gt.mjs} +1 -1
  72. package/dist/client/ThemedButton-CnyL3s1A.mjs +2243 -0
  73. package/dist/client/{accordion-2m27DsIk.mjs → accordion-TcimLLRQ.mjs} +1 -1
  74. package/dist/client/{booking-form.client-BddWV5w1.mjs → booking-form.client-q-RpJ4aF.mjs} +12 -12
  75. package/dist/client/{bookingForm-bcdXQjmw.mjs → bookingForm-DjGfk3Wj.mjs} +4 -4
  76. package/dist/client/bookings.mjs +5 -5
  77. package/dist/client/{carousel-D7nj9I0y.mjs → carousel-CGAk6j0m.mjs} +2 -2
  78. package/dist/client/{carousel.client-AffDJo_s.mjs → carousel.client-ArlGmYWV.mjs} +1 -1
  79. package/dist/client/{cart-PN6yCw1H.mjs → cart-D_h3rAZ2.mjs} +3 -3
  80. package/dist/client/{cart.client-D4t1f0cJ.mjs → cart.client-DHOxZbJ7.mjs} +1 -1
  81. package/dist/client/{checkout-CsTwXVSb.mjs → checkout-tC-3CzuM.mjs} +3 -3
  82. package/dist/client/{checkout.client-BhQE3zY7.mjs → checkout.client-DsBb2Pkm.mjs} +1 -1
  83. package/dist/client/client.mjs +5 -4
  84. package/dist/client/{context-BLAvalAa.mjs → context-9ZfMb6GA.mjs} +1 -1
  85. package/dist/client/{cta-CUXhX_D7.mjs → cta-D-ZqL7-e.mjs} +1 -1
  86. package/dist/client/{dateFormatting-BHIHxNuo.mjs → dateFormatting-BCwLqYpW.mjs} +1 -1
  87. package/dist/client/{demoPortalMagicLink-R-awbk_0.mjs → demoPortalMagicLink-BxkSS9fx.mjs} +1 -1
  88. package/dist/client/{enhanceHeaderSection-9Q93uvTo.mjs → enhanceHeaderSection-xg6to91E.mjs} +3 -3
  89. package/dist/client/{event-details.client-BS1WtG-a.mjs → event-details.client-C670TgRd.mjs} +2 -17
  90. package/dist/client/{event-registration.client-BXndwsET.mjs → event-registration.client-C6GApWTB.mjs} +16 -16
  91. package/dist/client/{eventCalendar-HyoOt1Qz.mjs → eventCalendar-CWc0dg9i.mjs} +4 -4
  92. package/dist/client/{eventCombined-sdG5oEaH.mjs → eventCombined-D4DbOrvQ.mjs} +4 -4
  93. package/dist/client/{eventDetails-FFAknE4w.mjs → eventDetails-C2DfmbC0.mjs} +2 -2
  94. package/dist/client/{eventListing-CGK6urk3.mjs → eventListing-C_yXmHyz.mjs} +4 -4
  95. package/dist/client/{eventRegistration-VhrvCs4l.mjs → eventRegistration-DJuaCB-O.mjs} +4 -4
  96. package/dist/client/{form-C-B5O_ko.mjs → form-QZhtdFHA.mjs} +3 -3
  97. package/dist/client/{form.client-DoZVcl8d.mjs → form.client-CgvPACwG.mjs} +4 -4
  98. package/dist/client/{form.parts-mttKpgif.mjs → form.parts-2uI0-5N-.mjs} +3 -3
  99. package/dist/client/{formatDate-xUSCknEO.mjs → formatDate-Danr0Nk4.mjs} +1 -1
  100. package/dist/client/gifting/client.mjs +3 -3
  101. package/dist/client/{headerSection-BHUEXsaI.mjs → headerSection-DJdlLdvZ.mjs} +2 -2
  102. package/dist/client/{mediaAssets-BOj-Co0B.mjs → mediaAssets-BvjcAZpS.mjs} +1 -1
  103. package/dist/client/mediaContext-jPeJ2PmJ.mjs +10801 -0
  104. package/dist/client/{newsletter-form.client-D_n0rftg.mjs → newsletter-form.client-Cbepz2KU.mjs} +5 -5
  105. package/dist/client/{newsletter-form.parts-DKHye4IE.mjs → newsletter-form.parts-DN8oMCQ0.mjs} +2 -2
  106. package/dist/client/{newsletterForm-tEaYelzx.mjs → newsletterForm-wjLtW-wq.mjs} +3 -3
  107. package/dist/client/{noop-B610YKEx.mjs → noop-B7H6gCbj.mjs} +297 -3
  108. package/dist/client/portal/client.mjs +12 -12
  109. package/dist/client/{product-detail.client-DUf5x5Jt.mjs → product-detail.client-CYTR165c.mjs} +1 -1
  110. package/dist/client/{product-list.client-Cqp1BPTV.mjs → product-list.client-B4vTvag8.mjs} +1 -1
  111. package/dist/client/{productDetail-B8bBiogP.mjs → productDetail-k8LEMSWn.mjs} +3 -3
  112. package/dist/client/{productList-BKN4D-1z.mjs → productList-DEo8Bqoe.mjs} +3 -3
  113. package/dist/client/{propsDecoder-2nNZh2Oe.mjs → propsDecoder-G0j0HXBO.mjs} +3 -28
  114. package/dist/client/{registry.server-BAm4RPNJ.mjs → registry.server-BTmSXE3D.mjs} +355 -162
  115. package/dist/client/rendering/client.mjs +27 -28
  116. package/dist/client/rendering/islands.mjs +1 -1
  117. package/dist/client/rendering.mjs +15 -9
  118. package/dist/client/{richText-coerce-Cv-qomNB.mjs → richText-coerce-B19taoH6.mjs} +1 -1
  119. package/dist/client/{routeIslandApiConfig-C5u8MbAA.mjs → routeIslandApiConfig-Chu5BHra.mjs} +1 -1
  120. package/dist/client/{ThemedButton-C22C9cCF.mjs → schema-C-m8XHuW.mjs} +990 -2310
  121. package/dist/client/{shop-DZNC0VKk.mjs → shop-RGWa43H7.mjs} +3 -3
  122. package/dist/client/{shop-commerce-DdX4LSa3.mjs → shop-commerce-TJYCBO_H.mjs} +11 -11
  123. package/dist/client/{shop-commerce-store-BJtrZov9.mjs → shop-commerce-store-CjCcUB_o.mjs} +1 -1
  124. package/dist/client/{shop.client-DmDd-igg.mjs → shop.client-tsKfZw1W.mjs} +12 -12
  125. package/dist/client/{shop.interactive-5SnnDHz3.mjs → shop.interactive-CVqLAU53.mjs} +6 -158
  126. package/dist/client/{shopShared-CPqUlAh9.mjs → shopShared-C3lHMz_R.mjs} +2 -2
  127. package/dist/client/{timetableModel-C19rcHEw.mjs → timetableModel-V2ifvGGy.mjs} +148 -8
  128. package/dist/client/{useAvailableSlots-BjbJXotk.mjs → useAvailableSlots-D1X69-pN.mjs} +3 -3
  129. package/dist/client/{useBookingNowIso-CMgfL7YJ.mjs → useBookingNowIso-Ch30jino.mjs} +1 -1
  130. package/dist/client/{useDiscountApply-KG8jB7WC.mjs → useDiscountApply-Bwzr1RjV.mjs} +2 -2
  131. package/dist/client/{useDiscountCodeUi-DK2w_i0a.mjs → useDiscountCodeUi-BimJbFC7.mjs} +1 -1
  132. package/dist/client/{useEventPagination-DW6MCirb.mjs → useEventPagination-CLAS0upd.mjs} +8 -21
  133. package/dist/client/{view-CkUn3Y0Y.mjs → view-BUh4LnLS.mjs} +4 -4
  134. package/dist/client/{view-CseyBW07.mjs → view-Dj_FZHmg.mjs} +18 -15
  135. package/dist/client/wizardSteps-BkZc-hKH.mjs +6598 -0
  136. package/dist/preview-next/before-render.mjs +5 -4
  137. package/dist/preview-next/chrome.css +2 -0
  138. package/dist/preview-next/client/{EventEmbeddedCheckoutStep-lUHBrzHv.mjs → EventEmbeddedCheckoutStep-CwerMfzn.mjs} +2 -1
  139. package/dist/preview-next/client/LocationPickerEnvironment-QtSG2Bl-.mjs +138 -0
  140. package/dist/preview-next/client/MapLibreEditMap-B-rohNcG.mjs +488 -0
  141. package/dist/preview-next/client/{PreviewEditorSidebar-DWyUGCAG.mjs → PreviewEditorSidebar-Dvq-RW9-.mjs} +110 -63
  142. package/dist/preview-next/client/{PreviewEditorUI-Wq0b3Daw.mjs → PreviewEditorUI-BdFjS39R.mjs} +4 -3
  143. package/dist/preview-next/client/{SdkPreviewModeRuntime-wSI_R361.mjs → SdkPreviewModeRuntime-BEfHln1E.mjs} +425 -412
  144. package/dist/preview-next/client/{SdkPreviewModeRuntime-BtZPcwYV.mjs → SdkPreviewModeRuntime-CjkGh1IG.mjs} +1 -1
  145. package/dist/preview-next/client/{SiteChromeCustomizeContext-Hc4pYnNe.mjs → SiteChromeCustomizeContext-CDbxk_qZ.mjs} +2982 -53859
  146. package/dist/preview-next/client/{ThemedButton-DzeycIlD.mjs → ThemedButton-b14Bv03E.mjs} +1079 -340
  147. package/dist/preview-next/client/lucide-react-CA9cpo0P.mjs +51984 -0
  148. package/dist/preview-next/client/maplibre-gl-DykfOYYn.mjs +34208 -0
  149. package/dist/preview-next/client/{previewChromeSurface-Corq4AG7.mjs → previewChromeSurface-Dd1_mNIg.mjs} +1 -1
  150. package/dist/preview-next/client/result-BjJUoxUF.mjs +16 -0
  151. package/dist/preview-next/client/rolldown-runtime-CE6sIgz8.mjs +34 -0
  152. package/dist/preview-next/client/runtime.mjs +3 -3
  153. package/dist/preview-next/client/{sdk-runtime-CWymRWhK.mjs → sdk-runtime-B-CXyGVb.mjs} +1 -1
  154. package/dist/preview-next/client/siteStyleAccess-Kqk0j0dE.mjs +5812 -0
  155. package/dist/preview-next/client/{spinner-C4If5Y-O.mjs → spinner-CGxS8Ns-.mjs} +2 -1
  156. package/dist/preview-next/{constants-D8Ya7bO4.mjs → constants-Bf-vqdKH.mjs} +2 -1
  157. package/dist/preview-next/editor-base.css +2 -2
  158. package/dist/preview-next/keepAlive.mjs +2 -2
  159. package/dist/preview-next/middleware.mjs +7 -3
  160. package/dist/preview-next/{route-contract-8csADeIT.mjs → route-contract-hLg-yjQN.mjs} +41 -4
  161. package/dist/preview-next/{session-BgkrPqu0.mjs → session-P1R_ajT7.mjs} +12 -2
  162. package/dist/preview-next/session.mjs +1 -1
  163. package/dist/server/{Block.shared-D1_gonwM.mjs → Block.shared-CeTd2saO.mjs} +4 -4
  164. package/dist/server/{bindings-CFmJg5lm.mjs → bindings-C5YpKuKt.mjs} +2 -1
  165. package/dist/server/{client-DPsi0Dai.mjs → client-Cv26lZQ4.mjs} +7 -5
  166. package/dist/server/config-validation.mjs +1 -1
  167. package/dist/server/config.mjs +2 -2
  168. package/dist/server/{siteChromeOverlayClearance-DALIAMwo.mjs → effectiveNavLinkStyle-CGvGr3yD.mjs} +461 -1064
  169. package/dist/server/index.mjs +3 -3
  170. package/dist/server/{loadContent-RMCcuVU_.mjs → loadContent-C8a0b-cC.mjs} +11 -5
  171. package/dist/server/loadPage--DXBwI8V.mjs +2 -0
  172. package/dist/server/{loadPage-DhDGzj7t.mjs → loadPage-BW7dklu3.mjs} +3 -2
  173. package/dist/server/next.mjs +9 -9
  174. package/dist/server/{overrideResolution-OxY5FMuy.mjs → overrideResolution-tIuqmJB3.mjs} +1 -1
  175. package/dist/server/{overrides-Bz_A6sB9.mjs → overrides-D1fiPOKF.mjs} +596 -301
  176. package/dist/server/page-converter.mjs +1 -1
  177. package/dist/server/{prebuild-B_1vrSru.mjs → prebuild--fO0E2tr.mjs} +1 -1
  178. package/dist/server/prebuild.mjs +1 -1
  179. package/dist/server/{prefetchBlockData-B7ukYXXR.mjs → prefetchBlockData-CqJnokWJ.mjs} +133 -87
  180. package/dist/server/{publicProducts-Djbpc81A.mjs → publicProducts-CvvZ4JIe.mjs} +41 -3
  181. package/dist/server/{registry-eFjKtEhF.mjs → registry-BVfCqaCq.mjs} +477 -1021
  182. package/dist/server/rendering/server.mjs +4 -4
  183. package/dist/server/rendering.mjs +8 -8
  184. package/dist/server/{resolveBlockData-DYvEa9c5.mjs → resolveBlockData-DPNvhXEz.mjs} +1 -1
  185. package/dist/server/routing.mjs +1 -1
  186. package/dist/server/{schema-C3dJ5UkL.mjs → schema-CD4peO7m.mjs} +2203 -1223
  187. package/dist/server/server.mjs +3 -3
  188. package/dist/server/site-styles-H-EvTJiW.mjs +787 -0
  189. package/dist/server/siteChromeOverlayClearance-DNC2k1U0.mjs +750 -0
  190. package/dist/server/{src-C5Mu-z0F.mjs → src-ILxc6pid.mjs} +161 -3
  191. package/dist/server/theme-bridge.mjs +1 -1
  192. package/dist/server/theme.mjs +1 -1
  193. package/dist/server/{themeAdmission-ruoyXb_0.mjs → themeAdmission-BNHIXiUj.mjs} +117 -26
  194. package/dist/server/{validation-B-Xar8QS.mjs → validation-B1ieVemg.mjs} +2 -2
  195. package/dist/server/{version-Bg7VHK3i.mjs → version-BQK44wFg.mjs} +1 -1
  196. package/dist/styles/index.css +157 -0
  197. package/package.json +1 -1
  198. package/dist/client/LeafletStaticMap-ClZCCzAm.mjs +0 -135
  199. package/dist/client/location-map.client-Cylb_MHw.mjs +0 -28
  200. package/dist/client/location-map.view-Cx4Bl7ij.mjs +0 -345
  201. package/dist/client/locationMap-QnKJi-nZ.mjs +0 -15
  202. package/dist/client/mediaContext-DThoeEBU.mjs +0 -136
  203. package/dist/client/renderableMediaAssetAdmission-DGjBr_e-.mjs +0 -152
  204. package/dist/client/wizardSteps-zgq10lN1.mjs +0 -17181
  205. package/dist/preview-next/client/siteStyleAccess-QZkJRHl5.mjs +0 -1359
  206. package/dist/server/loadPage-DUPP51C-.mjs +0 -2
  207. package/dist/server/media-CcHwZkdJ.mjs +0 -243
@@ -1,345 +0,0 @@
1
- "use client";
2
- import { i as ThemedButtonLink, ir as textColorStyle } from "./ThemedButton-C22C9cCF.mjs";
3
- import { St as toScheduledBookingDateTime, _t as parseLocalScheduleTime, ft as formatBookingCompactEnglishTime } from "./noop-B610YKEx.mjs";
4
- import { hn as parseWeeklyOpeningHours } from "./shop.interactive-5SnnDHz3.mjs";
5
- import "react";
6
- import { z } from "zod";
7
- import { jsx, jsxs } from "react/jsx-runtime";
8
- //#region ../core/src/string.ts
9
- /**
10
- * Trim a user-entered string and collapse blank values to null.
11
- */
12
- function trimmedStringOrNull(value) {
13
- const trimmed = typeof value === "string" ? value.trim() : "";
14
- return trimmed.length > 0 ? trimmed : null;
15
- }
16
- //#endregion
17
- //#region ../core/src/location.ts
18
- /** One complete, finite, bounded arrival pin; zero is a valid coordinate. */
19
- const locationPinSchema = z.strictObject({
20
- lat: z.number().min(-90).max(90),
21
- lng: z.number().min(-180).max(180)
22
- }).readonly().brand();
23
- const addressPart = z.string().trim().max(200).nullish().transform((value) => trimmedStringOrNull(value));
24
- /** Building identifies the place; unit/floor refine it without moving it. */
25
- const locationAddressSchema = z.strictObject({
26
- building: addressPart,
27
- unit: addressPart,
28
- floor: addressPart,
29
- street: addressPart,
30
- locality: addressPart,
31
- region: addressPart,
32
- postalCode: addressPart,
33
- country: addressPart.transform((value) => value?.length === 2 ? value.toUpperCase() : value)
34
- }).readonly().transform((address) => Object.values(address).some((part) => part !== null) ? address : null);
35
- const locationAddressMatchSchema = z.strictObject({
36
- point: locationPinSchema,
37
- precision: z.enum([
38
- "building",
39
- "street",
40
- "area",
41
- "unknown"
42
- ]),
43
- placeId: z.string().trim().max(1024).regex(/^[a-z][a-z0-9-]*:\S+$/),
44
- attribution: z.array(z.strictObject({
45
- text: z.string().trim().min(1).max(500),
46
- url: z.url().max(2048).refine((value) => /^https?:\/\//.test(value))
47
- }).readonly()).min(1).max(4).readonly()
48
- }).readonly();
49
- z.strictObject({
50
- address: locationAddressSchema.nullable().default(null),
51
- pin: locationPinSchema.nullable().default(null),
52
- doorNote: z.string().trim().max(1e3).nullish().transform(trimmedStringOrNull),
53
- addressMatch: locationAddressMatchSchema.nullable().default(null),
54
- ownerConfirmedPinAndAddress: z.boolean().default(false)
55
- }).superRefine((value, context) => {
56
- if (value.address === null && value.pin === null) context.addIssue({
57
- code: "custom",
58
- path: ["address"],
59
- message: "Use null to remove a location."
60
- });
61
- if (value.address === null && value.addressMatch !== null) context.addIssue({
62
- code: "custom",
63
- path: ["addressMatch"],
64
- message: "Address evidence requires an address."
65
- });
66
- if (value.ownerConfirmedPinAndAddress && (value.address === null || value.pin === null)) context.addIssue({
67
- code: "custom",
68
- path: ["ownerConfirmedPinAndAddress"],
69
- message: "Confirmation requires both address and pin."
70
- });
71
- }).readonly();
72
- function normalizeLocationAddressText(value) {
73
- if (typeof value !== "string") return null;
74
- return trimmedStringOrNull(value);
75
- }
76
- function hasLocationCoordinates(value) {
77
- return value != null && typeof value.lat === "number" && Number.isFinite(value.lat) && Math.abs(value.lat) <= 90 && typeof value.lng === "number" && Number.isFinite(value.lng) && Math.abs(value.lng) <= 180;
78
- }
79
- function toLocationCoordinates(value) {
80
- if (!hasLocationCoordinates(value)) return null;
81
- return {
82
- lat: value.lat,
83
- lng: value.lng
84
- };
85
- }
86
- //#endregion
87
- //#region ../core/src/opening-hours.ts
88
- const openingHoursWeekdayLabels = {
89
- monday: "Monday",
90
- tuesday: "Tuesday",
91
- wednesday: "Wednesday",
92
- thursday: "Thursday",
93
- friday: "Friday",
94
- saturday: "Saturday",
95
- sunday: "Sunday"
96
- };
97
- function formatOpeningHoursTime(value) {
98
- const time = parseLocalScheduleTime(value);
99
- return formatBookingCompactEnglishTime(toScheduledBookingDateTime({
100
- startsAt: new Date(Date.UTC(2e3, 0, 1, time.hour, time.minute)).toISOString(),
101
- timeZone: "UTC",
102
- locale: "en-GB"
103
- }));
104
- }
105
- function formatDayHours(day) {
106
- return day.kind === "closed" ? "Closed" : day.intervals.map((interval) => `${formatOpeningHoursTime(interval.opensAt)} to ${formatOpeningHoursTime(interval.closesAt)}`).join(", ");
107
- }
108
- function weekdayRangeLabel(weekdays) {
109
- const first = weekdays[0];
110
- const last = weekdays[weekdays.length - 1];
111
- if (!first || !last) return "";
112
- return first === last ? openingHoursWeekdayLabels[first] : `${openingHoursWeekdayLabels[first]} to ${openingHoursWeekdayLabels[last]}`;
113
- }
114
- /** Monday-first table rows; only adjacent days with identical ranges are grouped. */
115
- function formatOpeningHoursRows(hours) {
116
- return (hours?.days ?? []).reduce((rows, day) => {
117
- const text = formatDayHours(day);
118
- const previous = rows[rows.length - 1];
119
- const weekdays = previous?.kind === day.kind && previous.hours === text ? [...previous.weekdays, day.weekday] : [day.weekday];
120
- const row = {
121
- kind: day.kind,
122
- weekdays,
123
- label: weekdayRangeLabel(weekdays),
124
- hours: text
125
- };
126
- return weekdays.length > 1 ? [...rows.slice(0, -1), row] : [...rows, row];
127
- }, []);
128
- }
129
- //#endregion
130
- //#region ../blocks/src/system/runtime/nodes/location-map.shared.ts
131
- const LOCATION_MAP_DEFAULTS = {
132
- zoom: 15,
133
- heightPx: 320,
134
- showAddressText: true,
135
- showDirections: true,
136
- directionsLabel: "Get directions"
137
- };
138
- const LOCATION_MAP_LIMITS = {
139
- zoom: {
140
- min: 3,
141
- max: 18
142
- },
143
- heightPx: {
144
- min: 200,
145
- max: 600
146
- }
147
- };
148
- function normalizeNumber(value, fallback) {
149
- if (typeof value === "number" && Number.isFinite(value)) return value;
150
- if (typeof value === "string") {
151
- const parsed = Number.parseFloat(value);
152
- if (Number.isFinite(parsed)) return parsed;
153
- }
154
- return fallback;
155
- }
156
- function normalizeOptionalNumber(value) {
157
- if (typeof value === "number" && Number.isFinite(value)) return value;
158
- if (typeof value === "string") {
159
- const parsed = Number.parseFloat(value);
160
- if (Number.isFinite(parsed)) return parsed;
161
- }
162
- return null;
163
- }
164
- function normalizeBoolean(value, fallback) {
165
- if (typeof value === "boolean") return value;
166
- if (typeof value === "string") {
167
- if (value === "true") return true;
168
- if (value === "false") return false;
169
- }
170
- return fallback;
171
- }
172
- function normalizeLocationMapValueRecord(record) {
173
- const normalized = {
174
- addressText: normalizeLocationAddressText(typeof record.addressText === "string" ? record.addressText : typeof record.displayAddress === "string" ? record.displayAddress : null),
175
- lat: normalizeOptionalNumber(record.lat),
176
- lng: normalizeOptionalNumber(record.lng)
177
- };
178
- if (normalized.addressText === null && normalized.lat === null && normalized.lng === null) return null;
179
- return normalized;
180
- }
181
- function normalizeLocationMapValue(value) {
182
- if (typeof value !== "object" || value === null) return null;
183
- return normalizeLocationMapValueRecord(value);
184
- }
185
- function normalizeLocationMapSource(value) {
186
- return value === "business_address" || value === "venue" ? value : "custom";
187
- }
188
- function resolveLocationMapLocation(input) {
189
- const source = normalizeLocationMapSource(input.locationSource);
190
- if (source === "business_address") {
191
- const locationValue = normalizeLocationMapValue(input.businessAddress ?? input.location);
192
- return locationValue ? {
193
- kind: "business_address",
194
- locationValue
195
- } : {
196
- kind: "unresolved",
197
- source,
198
- reason: "missing_business_address"
199
- };
200
- }
201
- if (source === "venue") {
202
- const venueId = typeof input.venueId === "string" && input.venueId.trim() ? input.venueId.trim() : null;
203
- if (!venueId) return {
204
- kind: "unresolved",
205
- source,
206
- reason: "missing_venue_id"
207
- };
208
- const locationValue = input.venuesById ? normalizeLocationMapValue(input.venuesById[venueId] ?? null) : null;
209
- return locationValue ? {
210
- kind: "venue",
211
- venueId,
212
- locationValue
213
- } : {
214
- kind: "unresolved",
215
- source,
216
- reason: "missing_venue_location"
217
- };
218
- }
219
- const locationValue = normalizeLocationMapValue(input.location);
220
- return locationValue ? {
221
- kind: "custom",
222
- locationValue
223
- } : {
224
- kind: "unresolved",
225
- source,
226
- reason: "missing_custom_location"
227
- };
228
- }
229
- function describeUnresolvedLocationMapLocation(resolvedLocation) {
230
- if (resolvedLocation.kind !== "unresolved") return null;
231
- switch (resolvedLocation.reason) {
232
- case "missing_business_address": return "Business address details are not configured yet.";
233
- case "missing_venue_id": return "Choose a venue to show this map.";
234
- case "missing_venue_location": return "The selected venue does not have location details yet.";
235
- case "missing_custom_location": return "Location details coming soon.";
236
- }
237
- }
238
- function normalizeLocationMapProps(input) {
239
- const parsedHours = parseWeeklyOpeningHours(input.openingHours);
240
- const resolvedLocation = resolveLocationMapLocation(input);
241
- const locationValue = resolvedLocation.kind === "unresolved" ? null : resolvedLocation.locationValue;
242
- const directionsLabel = normalizeLocationAddressText(input.directionsLabel) ?? LOCATION_MAP_DEFAULTS.directionsLabel;
243
- return {
244
- resolvedLocation,
245
- locationValue,
246
- unresolvedMessage: describeUnresolvedLocationMapLocation(resolvedLocation),
247
- addressText: locationValue?.addressText ?? null,
248
- location: toLocationCoordinates(locationValue),
249
- zoom: Math.min(LOCATION_MAP_LIMITS.zoom.max, Math.max(LOCATION_MAP_LIMITS.zoom.min, Math.round(normalizeNumber(input.zoom, LOCATION_MAP_DEFAULTS.zoom)))),
250
- heightPx: Math.min(LOCATION_MAP_LIMITS.heightPx.max, Math.max(LOCATION_MAP_LIMITS.heightPx.min, Math.round(normalizeNumber(input.heightPx, LOCATION_MAP_DEFAULTS.heightPx)))),
251
- openingHours: parsedHours.ok ? parsedHours.value : null,
252
- showOpeningHours: normalizeBoolean(input.showOpeningHours, true),
253
- showAddressText: normalizeBoolean(input.showAddressText, LOCATION_MAP_DEFAULTS.showAddressText),
254
- showDirections: normalizeBoolean(input.showDirections, LOCATION_MAP_DEFAULTS.showDirections),
255
- directionsLabel,
256
- className: typeof input.className === "string" ? input.className : null
257
- };
258
- }
259
- function toLocationMapHydrationProps(input) {
260
- const normalized = normalizeLocationMapProps(input);
261
- return {
262
- location: normalized.locationValue,
263
- zoom: normalized.zoom,
264
- heightPx: normalized.heightPx,
265
- openingHours: normalized.openingHours,
266
- showOpeningHours: normalized.showOpeningHours,
267
- showAddressText: normalized.showAddressText,
268
- showDirections: normalized.showDirections,
269
- directionsLabel: normalized.directionsLabel,
270
- className: normalized.className
271
- };
272
- }
273
- function buildGoogleMapsDirectionsUrl(input) {
274
- const destination = input.location ? `${input.location.lat},${input.location.lng}` : normalizeLocationAddressText(input.addressText);
275
- if (!destination) return null;
276
- const url = new URL("https://www.google.com/maps/dir/");
277
- url.searchParams.set("api", "1");
278
- url.searchParams.set("destination", destination);
279
- return url.toString();
280
- }
281
- //#endregion
282
- //#region ../blocks/src/system/runtime/nodes/location-map.view.tsx
283
- function OpeningHoursTable({ hours }) {
284
- if (!hours) return null;
285
- return /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsxs("table", { children: [/* @__PURE__ */ jsx("caption", { children: "Opening hours" }), /* @__PURE__ */ jsx("tbody", { children: formatOpeningHoursRows(hours).map((row) => /* @__PURE__ */ jsxs("tr", {
286
- "data-closed": row.kind === "closed" ? true : void 0,
287
- children: [/* @__PURE__ */ jsx("th", {
288
- scope: "row",
289
- children: row.label
290
- }), /* @__PURE__ */ jsx("td", { children: row.hours })]
291
- }, row.label)) })] }), hours.note ? /* @__PURE__ */ jsx("p", { children: hours.note }) : null] });
292
- }
293
- function LocationMapDirections({ url, label }) {
294
- return url ? /* @__PURE__ */ jsx(ThemedButtonLink, {
295
- href: url,
296
- target: "_blank",
297
- rel: "noreferrer",
298
- variant: "ghost",
299
- size: "sm",
300
- extraClassName: "rb-w-fit",
301
- label
302
- }) : null;
303
- }
304
- function LocationMapView(props) {
305
- const { addressText, location, renderMap, zoom, heightPx, showAddressText, directionsLabel } = props;
306
- const directionsUrl = props.showDirections ? buildGoogleMapsDirectionsUrl({
307
- addressText,
308
- location
309
- }) : null;
310
- const hours = props.showOpeningHours === false ? null : props.openingHours ?? null;
311
- if (![
312
- location,
313
- addressText,
314
- directionsUrl,
315
- hours
316
- ].some(Boolean)) return /* @__PURE__ */ jsx("p", {
317
- className: "rb-caption",
318
- style: textColorStyle("mutedText"),
319
- children: props.unresolvedMessage ?? "Location details coming soon."
320
- });
321
- return /* @__PURE__ */ jsxs("div", {
322
- className: "rb-flex rb-flex-col rb-gap-4 rb-text-left",
323
- children: [
324
- location && renderMap ? renderMap({
325
- addressText,
326
- location,
327
- className: "rb-location-map-canvas",
328
- height: heightPx,
329
- zoom
330
- }) : null,
331
- showAddressText && addressText ? /* @__PURE__ */ jsx("p", {
332
- className: "rb-caption",
333
- style: textColorStyle("mutedText"),
334
- children: addressText
335
- }) : null,
336
- /* @__PURE__ */ jsx(OpeningHoursTable, { hours }),
337
- /* @__PURE__ */ jsx(LocationMapDirections, {
338
- url: directionsUrl,
339
- label: directionsLabel
340
- })
341
- ]
342
- });
343
- }
344
- //#endregion
345
- export { normalizeLocationMapSource as a, normalizeLocationMapProps as i, LOCATION_MAP_DEFAULTS as n, toLocationMapHydrationProps as o, LOCATION_MAP_LIMITS as r, LocationMapView as t };
@@ -1,15 +0,0 @@
1
- "use client";
2
- import { t as defineIslandPropsDecoder } from "./propsDecoder-2nNZh2Oe.mjs";
3
- import { t as LocationMapIslandClient } from "./location-map.client-Cylb_MHw.mjs";
4
- import { t as mountReactIsland } from "./reactMount-BGJVsHRb.mjs";
5
- import "react";
6
- import { jsx } from "react/jsx-runtime";
7
- //#region src/rendering/islands/enhancers/locationMap.tsx
8
- const decode = defineIslandPropsDecoder("location-map");
9
- const enhance = (root, props) => {
10
- return mountReactIsland(root, ({ root: reactRoot }) => {
11
- reactRoot.render(/* @__PURE__ */ jsx(LocationMapIslandClient, { ...props }));
12
- });
13
- };
14
- //#endregion
15
- export { decode, enhance };
@@ -1,136 +0,0 @@
1
- "use client";
2
- import { t as buildRenderableMediaAssetIndex } from "./renderableMediaAssetAdmission-DGjBr_e-.mjs";
3
- //#region ../blocks/src/system/runtime/nodes/mediaContext.ts
4
- function buildMediaAssetIndex(assets) {
5
- return buildRenderableMediaAssetIndex(assets);
6
- }
7
- function normalizeSupabaseUrl(value) {
8
- return value?.replace(/\/$/, "");
9
- }
10
- function buildResolveImageUrlContext(input) {
11
- return {
12
- supabaseUrl: normalizeSupabaseUrl(input?.supabaseUrl),
13
- siteId: input?.siteId,
14
- mediaAssetIndex: input?.mediaAssetIndex ?? buildMediaAssetIndex(input?.mediaAssets)
15
- };
16
- }
17
- /**
18
- * Server-side: AsyncLocalStorage for request isolation.
19
- * Prevents race conditions when multiple requests are processed concurrently.
20
- *
21
- * Lazy initialization to avoid issues in environments that don't support async_hooks.
22
- */
23
- const serverStorageState = {
24
- storage: null,
25
- checked: false
26
- };
27
- function getServerStorage() {
28
- if (typeof window !== "undefined") return null;
29
- if (serverStorageState.checked) return serverStorageState.storage;
30
- serverStorageState.checked = true;
31
- try {
32
- const globalWithNonWebpackRequire = globalThis;
33
- const AsyncLocalStorage = (typeof globalWithNonWebpackRequire.__non_webpack_require__ === "function" ? globalWithNonWebpackRequire.__non_webpack_require__ : new Function("id", "return require(id)"))("async_hooks").AsyncLocalStorage;
34
- if (AsyncLocalStorage) {
35
- serverStorageState.storage = new AsyncLocalStorage();
36
- return serverStorageState.storage;
37
- }
38
- return null;
39
- } catch {
40
- console.warn("[blocks] AsyncLocalStorage not available - using module-level state");
41
- return null;
42
- }
43
- }
44
- /**
45
- * Client-side context storage.
46
- * Safe because browsers are single-threaded per tab.
47
- *
48
- * IMPORTANT: This must be shared across bundles.
49
- * SDK preview mode can load multiple independently-bundled entrypoints
50
- * (e.g. `@riverbankcms/sdk/rendering` + `@riverbankcms/sdk/preview-next/client`),
51
- * which can otherwise each get their own module-scoped singleton.
52
- */
53
- const RB_MEDIA_CONTEXT_KEY = Symbol.for("riverbankcms.blocks.mediaContext");
54
- function getClientContextStore() {
55
- const g = globalThis;
56
- const existing = g[RB_MEDIA_CONTEXT_KEY];
57
- if (existing && typeof existing === "object") return existing;
58
- const next = {};
59
- g[RB_MEDIA_CONTEXT_KEY] = next;
60
- return next;
61
- }
62
- /**
63
- * Get the current media context.
64
- * Server-side: Uses AsyncLocalStorage for request isolation.
65
- * Client-side: Uses module-level state (safe in single-threaded browser).
66
- */
67
- function getMediaContext() {
68
- const storage = getServerStorage();
69
- if (storage) return storage.getStore() ?? {};
70
- return getClientContextStore();
71
- }
72
- /**
73
- * Set the Supabase URL in the current context.
74
- * @deprecated Use runWithMediaContext instead for request isolation.
75
- */
76
- function updateMediaContext(patch) {
77
- const storage = getServerStorage();
78
- const current = storage?.getStore();
79
- if (current) Object.assign(current, patch);
80
- else if (storage?.enterWith) storage.enterWith(patch);
81
- else Object.assign(getClientContextStore(), patch);
82
- }
83
- function setContextSupabaseUrl(url) {
84
- updateMediaContext({ supabaseUrl: normalizeSupabaseUrl(url) });
85
- }
86
- /** @deprecated Use runWithMediaContext for request isolation. */
87
- function setContextSiteId(siteId) {
88
- updateMediaContext({ siteId });
89
- }
90
- function setContextMediaAssetIndex(index) {
91
- updateMediaContext({ mediaAssetIndex: index });
92
- }
93
- function setContextResolveImageUrlContext(context) {
94
- setContextSupabaseUrl(context?.supabaseUrl);
95
- setContextSiteId(context?.siteId);
96
- setContextMediaAssetIndex(context?.mediaAssetIndex);
97
- }
98
- function getCurrentResolveImageUrlContext() {
99
- const context = getMediaContext();
100
- if (!context.supabaseUrl && !context.siteId && !context.mediaAssetIndex) return;
101
- return {
102
- supabaseUrl: context.supabaseUrl,
103
- siteId: context.siteId,
104
- mediaAssetIndex: context.mediaAssetIndex
105
- };
106
- }
107
- /**
108
- * Get the Supabase URL for constructing direct storage URLs.
109
- * Used for serving images directly from Supabase storage CDN.
110
- *
111
- * Resolution order:
112
- * 1. Context URL (set via runWithMediaContext or setContextSupabaseUrl)
113
- * 2. Environment variable NEXT_PUBLIC_SUPABASE_URL
114
- *
115
- * SDK sites receive the URL from the API, so they don't need the env var.
116
- * Dashboard and frontend apps use the env var.
117
- */
118
- function getSupabaseUrl() {
119
- const context = getMediaContext();
120
- if (context.supabaseUrl) return context.supabaseUrl;
121
- const url = process.env.NEXT_PUBLIC_SUPABASE_URL;
122
- if (!url) throw new Error("NEXT_PUBLIC_SUPABASE_URL is not configured. Set it to your Supabase project URL (e.g., https://xxx.supabase.co)");
123
- return url.replace(/\/$/, "");
124
- }
125
- /**
126
- * Get the site ID for constructing storage paths.
127
- * Required for relative path resolution.
128
- */
129
- function getSiteId() {
130
- return getMediaContext().siteId;
131
- }
132
- function getMediaAssetIndex(context) {
133
- return context?.mediaAssetIndex ?? getMediaContext().mediaAssetIndex;
134
- }
135
- //#endregion
136
- export { getSupabaseUrl as a, getSiteId as i, getCurrentResolveImageUrlContext as n, setContextResolveImageUrlContext as o, getMediaAssetIndex as r, buildResolveImageUrlContext as t };
@@ -1,152 +0,0 @@
1
- "use client";
2
- import { z } from "zod";
3
- //#region ../core/src/result.ts
4
- function ok(value) {
5
- return {
6
- ok: true,
7
- value
8
- };
9
- }
10
- function err(error) {
11
- return {
12
- ok: false,
13
- error
14
- };
15
- }
16
- //#endregion
17
- //#region ../core/src/branded.ts
18
- const UUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
19
- function parseUuidBrand(value, unsafeConstructor) {
20
- if (typeof value !== "string") return err({ kind: "not_string" });
21
- const normalized = value.trim().toLowerCase();
22
- if (normalized.length === 0) return err({ kind: "empty_string" });
23
- if (!UUID_PATTERN.test(normalized)) return err({ kind: "invalid_uuid" });
24
- return ok(unsafeConstructor(normalized));
25
- }
26
- const unsafeAsSiteId = (id) => id;
27
- const unsafeAsApiKeyId = (id) => id;
28
- const unsafeAsEventOfferingId = (id) => id;
29
- const unsafeAsEventSeriesId = (id) => id;
30
- const unsafeAsMediaAssetId = (id) => id;
31
- const unsafeAsStorageBucketName = (value) => value;
32
- const unsafeAsStoragePath = (value) => value;
33
- const unsafeAsUserId = (id) => id;
34
- const unsafeAsFormId = (id) => id;
35
- const unsafeAsPassId = (id) => id;
36
- const unsafeAsSiteTermsVersionId = (id) => id;
37
- const unsafeAsCustomerPassId = (id) => id;
38
- const unsafeAsAppointmentServiceId = (id) => id;
39
- const unsafeAsAppointmentResourceId = (id) => id;
40
- const unsafeAsContentVersionId = (id) => id;
41
- const parseSiteId = (value) => parseUuidBrand(value, unsafeAsSiteId);
42
- const parseApiKeyId = (value) => parseUuidBrand(value, unsafeAsApiKeyId);
43
- const parseEventOfferingId = (value) => parseUuidBrand(value, unsafeAsEventOfferingId);
44
- const parseUserId = (value) => parseUuidBrand(value, unsafeAsUserId);
45
- const parseMediaAssetId = (value) => parseUuidBrand(value, unsafeAsMediaAssetId);
46
- const parseContentVersionId = (value) => parseUuidBrand(value, unsafeAsContentVersionId);
47
- const parseSiteTermsVersionId = (value) => parseUuidBrand(value, unsafeAsSiteTermsVersionId);
48
- const parseEventSeriesId = (value) => parseUuidBrand(value, unsafeAsEventSeriesId);
49
- //#endregion
50
- //#region ../media-core/src/identifiers.ts
51
- function slugifyMediaIdentifier(value) {
52
- return value.toLowerCase().trim().replace(/[^a-z0-9\s-]/g, "").replace(/\s+/g, "-").replace(/-+/g, "-");
53
- }
54
- function parseMediaIdentifier(value) {
55
- if (typeof value !== "string") return err({ kind: "not_string" });
56
- const trimmed = value.trim();
57
- if (trimmed.length === 0) return err({ kind: "empty_identifier" });
58
- const normalized = slugifyMediaIdentifier(trimmed);
59
- if (normalized.length === 0) return err({
60
- kind: "empty_after_normalization",
61
- value
62
- });
63
- return ok(normalized);
64
- }
65
- /**
66
- * Admits identifiers read from trusted persistence without repairing dirty data in memory.
67
- * User input should use parseMediaIdentifier, which intentionally canonicalizes it.
68
- */
69
- function parseCanonicalMediaIdentifier(value) {
70
- if (typeof value !== "string") return err({ kind: "not_string" });
71
- const parsed = parseMediaIdentifier(value);
72
- if (!parsed.ok) return parsed;
73
- if (value !== parsed.value) return err({
74
- kind: "non_canonical_identifier",
75
- value,
76
- canonical: parsed.value
77
- });
78
- return parsed;
79
- }
80
- //#endregion
81
- //#region ../media-core/src/mediaIdentifierSchema.ts
82
- /** Strict stored-reference admission delegates the canonical identifier decision. */
83
- const mediaIdentifierSchema = z.string().transform((value, context) => {
84
- const parsed = parseCanonicalMediaIdentifier(value);
85
- if (parsed.ok) return parsed.value;
86
- context.addIssue({
87
- code: "custom",
88
- message: "Expected a canonical media identifier"
89
- });
90
- return z.NEVER;
91
- });
92
- //#endregion
93
- //#region ../media-core/src/renderableMediaAsset.ts
94
- /** Shared identifier indexing for admitted site-scoped projections. */
95
- function buildMediaIdentifierIndex(assets) {
96
- const index = new Map(assets.map((asset) => [asset.identifier, asset]));
97
- if (index.size !== assets.length) throw new Error("Duplicate media identifier in a site asset list");
98
- return index;
99
- }
100
- /** Index already admitted projections, including runtime registration updates. */
101
- function indexRenderableMediaAssets(assets) {
102
- if (!assets.length) return void 0;
103
- const byId = new Map(assets.map((asset) => [asset.id, asset]));
104
- const byIdentifier = buildMediaIdentifierIndex(assets);
105
- if (byId.size !== assets.length) throw new Error("Duplicate media asset identity in a site asset list");
106
- return {
107
- assets,
108
- byId,
109
- byIdentifier
110
- };
111
- }
112
- /** A portable reference never uses an incidental UUID, URL or storage snapshot for identity. */
113
- function resolveManagedMediaReference(reference, index) {
114
- const asset = index?.byIdentifier.get(reference.identifier);
115
- return asset ? {
116
- kind: "resolved",
117
- reference,
118
- asset
119
- } : {
120
- kind: "missing",
121
- reference
122
- };
123
- }
124
- //#endregion
125
- //#region ../media-core/src/renderableMediaAssetAdmission.ts
126
- const mediaAssetIdSchema = z.string().transform((value, context) => {
127
- const parsed = parseMediaAssetId(value);
128
- if (parsed.ok) return parsed.value;
129
- context.addIssue({
130
- code: "custom",
131
- message: "Expected a media asset ID"
132
- });
133
- return z.NEVER;
134
- });
135
- const nonemptyStorageValue = z.string().refine((value) => value.trim().length > 0);
136
- const renderableMediaAssetSchema = z.object({
137
- id: mediaAssetIdSchema,
138
- identifier: mediaIdentifierSchema,
139
- storageBucket: nonemptyStorageValue,
140
- storagePath: nonemptyStorageValue,
141
- mimeType: nonemptyStorageValue,
142
- filename: z.string().optional(),
143
- width: z.number().positive().nullable(),
144
- height: z.number().positive().nullable()
145
- });
146
- /** Admission precedes the identifier-only runtime resolution decision. */
147
- function buildRenderableMediaAssetIndex(assets) {
148
- if (!assets?.length) return void 0;
149
- return indexRenderableMediaAssets(assets.map((asset) => renderableMediaAssetSchema.parse(asset)));
150
- }
151
- //#endregion
152
- export { unsafeAsStoragePath as C, unsafeAsStorageBucketName as S, ok as T, unsafeAsCustomerPassId as _, mediaIdentifierSchema as a, unsafeAsPassId as b, parseApiKeyId as c, parseEventSeriesId as d, parseSiteId as f, unsafeAsAppointmentServiceId as g, unsafeAsAppointmentResourceId as h, resolveManagedMediaReference as i, parseContentVersionId as l, parseUserId as m, renderableMediaAssetSchema as n, parseCanonicalMediaIdentifier as o, parseSiteTermsVersionId as p, indexRenderableMediaAssets as r, parseMediaIdentifier as s, buildRenderableMediaAssetIndex as t, parseEventOfferingId as u, unsafeAsFormId as v, err as w, unsafeAsSiteId as x, unsafeAsMediaAssetId as y };