@riverbankcms/sdk 0.167.0 → 0.168.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 (224) hide show
  1. package/dist/_dts/{BlocksIslandsHydrator-Dgb-ptph.d.ts → BlocksIslandsHydrator-CiD_VVGM.d.ts} +1 -1
  2. package/dist/_dts/{Page-Bs3WxFgr.d.ts → Page-Bj6VJRS5.d.ts} +7 -6
  3. package/dist/_dts/{SdkPreviewMode-DtUCsaHY.d.ts → SdkPreviewMode-ChpsnwDX.d.ts} +2 -2
  4. package/dist/_dts/{client-CwsI23pj.d.ts → client-C8mfUxrJ.d.ts} +65 -35
  5. package/dist/_dts/{content-types-CAeP_-cV.d.ts → content-types-_vXZyR4H.d.ts} +2 -2
  6. package/dist/_dts/{contracts-BXHCiF-b.d.ts → contracts-CJFfrVKU.d.ts} +5 -4
  7. package/dist/_dts/{footerPageOutline-Bb2gbppW.d.ts → footerPageOutline-CMegb23G.d.ts} +6 -6
  8. package/dist/_dts/{generatePageMetadata-DaBBDx7M.d.ts → generatePageMetadata-D9YdAIMh.d.ts} +2 -2
  9. package/dist/_dts/{index-CS6b1B-c.d.ts → index-BQXaZ7aY.d.ts} +4 -4
  10. package/dist/_dts/{index-5_jf52sZ.d.ts → index-Bpr-wT5k.d.ts} +2 -2
  11. package/dist/_dts/{index-DeHDwMfu.d.ts → index-C7_Rz8EY.d.ts} +3 -3
  12. package/dist/_dts/{index-D7EbliE3.d.ts → index-Cx2BQlHL.d.ts} +3 -3
  13. package/dist/_dts/{index-C20yUyob.d.ts → index-Dgz6yhsy.d.ts} +1 -1
  14. package/dist/_dts/index-Vh8B9FSa.d.ts +14 -0
  15. package/dist/_dts/{index-bDln38Hm.d.ts → index-vR3p9Bu-.d.ts} +2 -2
  16. package/dist/_dts/{loadContent-CTqcL7CS.d.ts → loadContent-dhWSgLeS.d.ts} +7 -7
  17. package/dist/_dts/previewCompiler-BVVgDSdq.d.ts +1 -0
  18. package/dist/_dts/{index-ChpjHK0U.d.ts → request-BrYhNV9Z.d.ts} +80718 -47665
  19. package/dist/_dts/{resolveBlockData-C3s9WMPs.d.ts → resolveBlockData-BfSHm8Ms.d.ts} +5 -5
  20. package/dist/_dts/{resolvePageContent-JPwgRxwh.d.ts → resolvePageContent-gZJ4i1wN.d.ts} +2 -2
  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/data/dataLoaderContext.d.ts +2 -2
  28. package/dist/_dts/sdk/src/data/resolveBlockData.d.ts +1 -1
  29. package/dist/_dts/sdk/src/data/types.d.ts +2 -2
  30. package/dist/_dts/sdk/src/index.d.ts +8 -8
  31. package/dist/_dts/sdk/src/manifest/index.d.ts +3 -3
  32. package/dist/_dts/sdk/src/metadata/index.d.ts +1 -1
  33. package/dist/_dts/sdk/src/navigation/index.d.ts +2 -2
  34. package/dist/_dts/sdk/src/next/index.d.ts +7 -7
  35. package/dist/_dts/sdk/src/next/middleware.d.ts +2 -2
  36. package/dist/_dts/sdk/src/page-converter/index.d.ts +3 -3
  37. package/dist/_dts/sdk/src/portal/client.d.ts +1 -1
  38. package/dist/_dts/sdk/src/prebuild/index.d.ts +1 -1
  39. package/dist/_dts/sdk/src/preview-next/before-render.d.ts +2 -2
  40. package/dist/_dts/sdk/src/preview-next/client/index.d.ts +2 -2
  41. package/dist/_dts/sdk/src/preview-next/client/runtime.d.ts +1 -1
  42. package/dist/_dts/sdk/src/rendering/client.d.ts +2 -2
  43. package/dist/_dts/sdk/src/rendering/components/pageShared.d.ts +1 -1
  44. package/dist/_dts/sdk/src/rendering/helpers/loadPage.d.ts +1 -1
  45. package/dist/_dts/sdk/src/rendering/helpers/pageRuntimeSupport.d.ts +4 -5
  46. package/dist/_dts/sdk/src/rendering/index.d.ts +6 -6
  47. package/dist/_dts/sdk/src/rendering/islands/client.d.ts +1 -1
  48. package/dist/_dts/sdk/src/rendering/server.d.ts +2 -2
  49. package/dist/_dts/sdk/src/rendering/themeAdmission.d.ts +1 -1
  50. package/dist/_dts/sdk/src/routing/index.d.ts +5 -5
  51. package/dist/_dts/sdk/src/server.d.ts +5 -5
  52. package/dist/_dts/sdk/src/spam-protection/index.d.ts +2 -2
  53. package/dist/_dts/sdk/src/theme/index.d.ts +1 -1
  54. package/dist/_dts/{types-CwtTcaQP.d.ts → types-BB33-Spd.d.ts} +3 -3
  55. package/dist/_dts/{types-D-WElMCy.d.ts → types-BVFXYtRg.d.ts} +7 -7
  56. package/dist/_dts/{types-BlaCuPLr.d.ts → types-FOsJ-KYb.d.ts} +4 -2
  57. package/dist/_dts/{validation-Y5wD9fGK.d.ts → validation-DckTc6TQ.d.ts} +4 -4
  58. package/dist/client/{BlocksIslandsHydrator-DFqkx158.mjs → BlocksIslandsHydrator-DcwEaliO.mjs} +21 -21
  59. package/dist/client/BookingMailingListNote-Dsugoe-n.mjs +946 -0
  60. package/dist/client/BookingQuestionFields-Bhh0cvsl.mjs +359 -0
  61. package/dist/client/{CalendarNavigationChevron-DQwJ7BPx.mjs → CalendarNavigationChevron-CNe3ZjdC.mjs} +7 -7
  62. package/dist/client/{CheckboxChoice-CZ-anOqV.mjs → CheckboxChoice-W_uiRgDK.mjs} +1 -1
  63. package/dist/client/{DemoBookingPortalAccess-DdkY86qI.mjs → DemoBookingPortalAccess-BeiZxEUJ.mjs} +7 -7
  64. package/dist/client/{EventCalendar.client-DAeQPV76.mjs → EventCalendar.client-BL943-tl.mjs} +9 -9
  65. package/dist/client/{EventCombined.client-Bus9R0bj.mjs → EventCombined.client-BFVxECTp.mjs} +8 -8
  66. package/dist/client/{EventEmbeddedCheckoutStep-D_14yqAU.mjs → EventEmbeddedCheckoutStep-Cf-HRHtb.mjs} +1 -1
  67. package/dist/client/{EventItem-DPBLjGwj.mjs → EventItem-BIc4gjiD.mjs} +37 -15
  68. package/dist/client/{EventListWeekNavigation-D6cwU82_.mjs → EventListWeekNavigation-a0QEIEf0.mjs} +1 -1
  69. package/dist/client/{EventListing.client-Bogi_SnJ.mjs → EventListing.client-CEFTC3jH.mjs} +3 -3
  70. package/dist/client/{EventListing.view-CEumpN7i.mjs → EventListing.view-Bt2sBBms.mjs} +34 -16
  71. package/dist/client/{EventRegistrationPayment-CIQw6vNy.mjs → EventRegistrationPayment-D9YBNb_E.mjs} +250 -40
  72. package/dist/client/{LocationMapActions-BVO-qx4q.mjs → LocationMapActions-gqzt5gkW.mjs} +2 -2
  73. package/dist/client/{MapDrawingSvg-CcGaFawl.mjs → MapDrawingSvg-13JQI7_z.mjs} +1 -1
  74. package/dist/client/{Page-D4_H_u9V.mjs → Page-D_M2Vxz3.mjs} +4471 -1601
  75. package/dist/client/{ProtectedSubmitButton-8DuDw2ag.mjs → ProtectedSubmitButton-C3H26pN9.mjs} +1 -1
  76. package/dist/client/{StepIndicator-Dptantmg.mjs → StepIndicator-CaN8snZ8.mjs} +3 -3
  77. package/dist/client/{TabBarFragment-BxEGsKUx.mjs → TabBarFragment-DkVKtK5a.mjs} +1 -1
  78. package/dist/client/{ThemedButton-8jUc02mZ.mjs → ThemedButton-BdnEwA38.mjs} +2 -5
  79. package/dist/client/accessibleSurfaces-chpD4C2c.mjs +4278 -0
  80. package/dist/client/{accordion--EUHmEGa.mjs → accordion-DE7OG--d.mjs} +1 -1
  81. package/dist/client/{booking-form.client-BCXwOnhc.mjs → booking-form.client-CS1PPjw7.mjs} +842 -374
  82. package/dist/client/{bookingForm-sHHcdism.mjs → bookingForm-DE2CwIU9.mjs} +5 -4
  83. package/dist/client/{src-DjnxOjXG.mjs → bookingQuestionValues-BjcyCru5.mjs} +88 -1
  84. package/dist/client/bookingQuestions-BHq83mzS.mjs +13 -0
  85. package/dist/client/bookings.mjs +18 -13
  86. package/dist/client/{carousel-Cp9xPBFZ.mjs → carousel-DZyUdnFh.mjs} +3 -3
  87. package/dist/client/{carousel.client-BO7sCEpH.mjs → carousel.client-BD4DXMtI.mjs} +62 -16
  88. package/dist/client/{carousel.shared-DBnWEJzo.mjs → carousel.shared-BFQ3kBEw.mjs} +6 -3
  89. package/dist/client/{cart-CCZZC-Lq.mjs → cart-D7HkkNwe.mjs} +3 -3
  90. package/dist/client/{cart.client-B7JfA19I.mjs → cart.client-H4sv2TpD.mjs} +1 -1
  91. package/dist/client/{checkout-CipmYL4A.mjs → checkout-2qVyG-Sh.mjs} +3 -3
  92. package/dist/client/{checkout.client-DraalWdH.mjs → checkout.client-DAjrBZ74.mjs} +1 -1
  93. package/dist/client/client.mjs +240 -63
  94. package/dist/client/{context-Cv3QHjAF.mjs → context-DXmIbXCK.mjs} +297 -3
  95. package/dist/client/{cta-P2vJVTEn.mjs → cta-DP_IBnq3.mjs} +2 -2
  96. package/dist/client/{dateFormatting-D8D47VT4.mjs → dateFormatting-CwrkFZTr.mjs} +1 -1
  97. package/dist/client/{demoPortalMagicLink-CXWZoV-d.mjs → demoPortalMagicLink-DQXK-Fh6.mjs} +1 -1
  98. package/dist/client/{enhanceHeaderSection-BkAro1DJ.mjs → enhanceHeaderSection-DheQj7rg.mjs} +3 -3
  99. package/dist/client/{event-details.client-dLmyuPap.mjs → event-details.client-C5UufcRp.mjs} +1 -1
  100. package/dist/client/{event-registration.client-BEhC2_-Y.mjs → event-registration.client-CMGg63IU.mjs} +72 -235
  101. package/dist/client/{eventCalendar-FBMS2Cpb.mjs → eventCalendar-DlD0GCEy.mjs} +4 -4
  102. package/dist/client/{eventCombined-BrBhUvGe.mjs → eventCombined-DoSi8p_l.mjs} +4 -4
  103. package/dist/client/{eventDetails-C7WUrbZ2.mjs → eventDetails-DzuQYgmO.mjs} +2 -2
  104. package/dist/client/{eventListing-Bih-BgQM.mjs → eventListing-CkiMjl0g.mjs} +4 -4
  105. package/dist/client/{eventRegistration-DfTlqGbl.mjs → eventRegistration-CjS3Zpjp.mjs} +4 -4
  106. package/dist/client/{form-Bw1uuiUs.mjs → form-DgQqm7T2.mjs} +3 -3
  107. package/dist/client/{form.client-pZ-9gN33.mjs → form.client-BI9Dcsq5.mjs} +5 -5
  108. package/dist/client/{form.parts-PXlu6XQO.mjs → form.parts-DevF0L_A.mjs} +3 -3
  109. package/dist/client/{formatDate-DI3DP48e.mjs → formatDate-DDyURjoe.mjs} +1 -1
  110. package/dist/client/gifting/client.mjs +3 -3
  111. package/dist/client/{headerSection-BpJYUMd6.mjs → headerSection-DYIG6Pwb.mjs} +2 -2
  112. package/dist/client/{mediaAssets-DpPauppt.mjs → mediaAssets-B99AP7ai.mjs} +1 -1
  113. package/dist/client/{mediaContext-BLo4NtjP.mjs → mediaContext-Fusweriw.mjs} +1 -1
  114. package/dist/client/{newsletter-form.client-CSoP0cGR.mjs → newsletter-form.client-BWp7Y1e1.mjs} +6 -6
  115. package/dist/client/{newsletter-form.parts-DDbX_Sj0.mjs → newsletter-form.parts-Dg8s9NwJ.mjs} +2 -2
  116. package/dist/client/{newsletterForm-vCxYRar_.mjs → newsletterForm-DnPraMzx.mjs} +3 -3
  117. package/dist/client/{noop-ByVtIWf4.mjs → noop-ByFRHYQ2.mjs} +437 -496
  118. package/dist/client/portal/client.mjs +76 -229
  119. package/dist/client/{product-detail.client-7Pi6avM-.mjs → product-detail.client-BFAgHrdg.mjs} +1 -1
  120. package/dist/client/{product-list.client-DEad-Pma.mjs → product-list.client-DVrs_DyY.mjs} +1 -1
  121. package/dist/client/{productDetail-G1SMXG13.mjs → productDetail-D4rvl6Xg.mjs} +3 -3
  122. package/dist/client/{productList-B21TGdpT.mjs → productList-B8o5AOMX.mjs} +3 -3
  123. package/dist/client/{propsDecoder-B3vIBkex.mjs → propsDecoder-hhotPP6P.mjs} +5 -4
  124. package/dist/client/{registry.server-B8aQhJpO.mjs → registry.server-Ch3EpupA.mjs} +2213 -2433
  125. package/dist/client/{surfaceTransportMarker-BXepAVF6.mjs → renderableMediaAssetAdmission-BlfqYLJW.mjs} +1 -18
  126. package/dist/client/rendering/client.mjs +30 -30
  127. package/dist/client/rendering/islands.mjs +1 -1
  128. package/dist/client/rendering.mjs +10 -9
  129. package/dist/client/{richText-coerce-DHkBtO0G.mjs → richText-coerce-C3LabQ1O.mjs} +1 -1
  130. package/dist/client/{routeIslandApiConfig-DbHX4JOS.mjs → routeIslandApiConfig-CQGlxId8.mjs} +1 -1
  131. package/dist/client/runtimeResponse-BP-L6exS.mjs +3 -0
  132. package/dist/client/runtimeResponse-Dg4XFsuM.mjs +9 -0
  133. package/dist/client/{shop-commerce-B2UmrQg_.mjs → shop-commerce-VDbVaKY-.mjs} +12 -12
  134. package/dist/client/{shop-commerce-store-B7n-Z7nY.mjs → shop-commerce-store-DqdgJ8Zw.mjs} +1 -1
  135. package/dist/client/{shop-mqyoOvOK.mjs → shop-rRXplPGZ.mjs} +3 -3
  136. package/dist/client/{shop.client-BH-BBnA9.mjs → shop.client-DdwvMvaK.mjs} +13 -13
  137. package/dist/client/{shop.interactive-mdM3UMWG.mjs → shop.interactive-C8OvFY06.mjs} +141 -66
  138. package/dist/client/{shopShared-CXF5wxdg.mjs → shopShared-BeuJiGPU.mjs} +2 -2
  139. package/dist/client/spam-protection.mjs +1 -1
  140. package/dist/client/surfaceTransportMarker-BuwkYxsI.mjs +19 -0
  141. package/dist/client/{timetableModel-CrC80EOG.mjs → timetableModel-Cko9LRKy.mjs} +11 -11
  142. package/dist/client/{types-sF-IrGQr.mjs → types-5fOsPIpL.mjs} +248 -111
  143. package/dist/client/{useAvailableSlots-C4LOaI_Z.mjs → useAvailableSlots-M6QIEiWf.mjs} +3 -3
  144. package/dist/client/{useDiscountApply-6Q0nToVA.mjs → useDiscountApply-BJSnyO0f.mjs} +3 -3
  145. package/dist/client/{useDiscountCodeUi-CM-DTX5X.mjs → useDiscountCodeUi-D3XnOSCi.mjs} +1 -1
  146. package/dist/client/{useEventPagination-Bcs89BR5.mjs → useEventPagination-PhTIoFVX.mjs} +7 -7
  147. package/dist/client/{view-BN-fxyfq.mjs → view-448wvvEY.mjs} +11 -7
  148. package/dist/client/{view-Dh2tGoS0.mjs → view-L_mkgtnk.mjs} +4 -4
  149. package/dist/client/{site-styles-D56hT2u1.mjs → wizardSteps-CFulHWnT.mjs} +19660 -18565
  150. package/dist/preview-next/client/{ArrangementLookControls-D4VjPs-r.mjs → ArrangementLookControls-BpvnOGlN.mjs} +26 -17
  151. package/dist/preview-next/client/{EventEmbeddedCheckoutStep-C_h1cMYm.mjs → EventEmbeddedCheckoutStep-8-qtHjpb.mjs} +1 -1
  152. package/dist/preview-next/client/{LocationPickerEnvironment-D56RD3e_.mjs → LocationPickerEnvironment-CZQ4vkRe.mjs} +1 -1
  153. package/dist/preview-next/client/{MapLibreEditMap-DFnyCckr.mjs → MapLibreEditMap-CP4w7T_0.mjs} +2 -2
  154. package/dist/preview-next/client/{PreviewEditorSidebar-Ckr2zk_L.mjs → PreviewEditorSidebar-C0OtdWu_.mjs} +128 -21
  155. package/dist/preview-next/client/{PreviewEditorUI-KOZgw_gS.mjs → PreviewEditorUI-Csc5vH5k.mjs} +6 -6
  156. package/dist/preview-next/client/{PreviewShell-CyO2V4kB.mjs → PreviewShell-BOLH_pm-.mjs} +199 -155
  157. package/dist/preview-next/client/{SdkPreviewModeRuntime-DW3uKvNF.mjs → SdkPreviewModeRuntime-CKodLReY.mjs} +31 -32
  158. package/dist/preview-next/client/{SiteChromeCustomizeButton-CU9VD-7O.mjs → SiteChromeCustomizeButton-BeEZpeKn.mjs} +3780 -3436
  159. package/dist/preview-next/client/{ThemedButton-C0dgGJ5k.mjs → ThemedButton-BQU45t-E.mjs} +260 -121
  160. package/dist/preview-next/client/{lucide-react-CPBCf6QT.mjs → lucide-react-DkZ8fO-G.mjs} +1 -1
  161. package/dist/preview-next/client/{previewAssistantSlot-DBi-WybM.mjs → previewAssistantSlot-BBdN5kfY.mjs} +18697 -15557
  162. package/dist/preview-next/client/{previewChromeSurface-BhkUJst9.mjs → previewChromeSurface-VZtGwPuH.mjs} +1 -1
  163. package/dist/preview-next/client/runtime.mjs +3 -3
  164. package/dist/preview-next/client/{sdk-runtime-BjCb6lOn.mjs → sdk-runtime-kiZkMcuR.mjs} +2 -2
  165. package/dist/preview-next/client/{useAutosaveStatus-CKxTaC3j.mjs → useAutosaveStatus-BiIHEeE0.mjs} +2 -2
  166. package/dist/preview-next/client/{useBlockCustomizeControls-B7MLTjBX.mjs → useBlockCustomizeControls-BuFLIpmX.mjs} +2 -2
  167. package/dist/preview-next/client/{useOpenBlockForSetup-BTUc0g9X.mjs → useOpenBlockForSetup-DlxYgmh_.mjs} +1 -1
  168. package/dist/preview-next/keepAlive.mjs +1 -1
  169. package/dist/preview-next/middleware.mjs +1 -1
  170. package/dist/preview-next/{route-contract-Bv3nkdpV.mjs → route-contract-C0sCvCYL.mjs} +165 -0
  171. package/dist/server/{Block.shared-4fMqzltx.mjs → Block.shared-Dnhc0Wu5.mjs} +5 -5
  172. package/dist/server/{ThemeScopeCore-C72VC_lR.mjs → ThemeScopeCore-NAQ_zsFu.mjs} +461 -128
  173. package/dist/server/{accessibleSurfaces-B_Y_dA20.mjs → accessibleSurfaces-108nxyGc.mjs} +319 -131
  174. package/dist/server/{bindings-ConMYJ2U.mjs → bindings-DLoZYUxG.mjs} +2 -2
  175. package/dist/server/{client-Cot-H5fQ.mjs → client-Bc8jI8zN.mjs} +261 -61
  176. package/dist/server/config-validation.mjs +1 -1
  177. package/dist/server/config.mjs +1 -1
  178. package/dist/server/{validation-CDd6m8Ry.mjs → customCss-QymcmOZ-.mjs} +12 -55
  179. package/dist/server/data/resolveBlockData.mjs +1 -1
  180. package/dist/server/headerVariant-BwR9NV4b.mjs +463 -0
  181. package/dist/server/{identity-Bn9OQiT1.mjs → identity-20XHqyuO.mjs} +1 -1
  182. package/dist/server/index.mjs +3 -3
  183. package/dist/server/{loadContent-BkaWYEwt.mjs → loadContent-D61gpqHB.mjs} +4 -5
  184. package/dist/server/{loadPage-kviUdH8c.mjs → loadPage-B4ZYpIcd.mjs} +2 -2
  185. package/dist/server/manifest.mjs +1 -1
  186. package/dist/server/{media-DnlczCMA.mjs → media-Brn9FW5s.mjs} +15 -1
  187. package/dist/server/{mode-Cv_TG9gP.mjs → mode-bkFS8glh.mjs} +4 -2
  188. package/dist/server/next.mjs +6 -6
  189. package/dist/server/{opaqueSurface-BTnS09GS.mjs → opaqueSurface-BawlEAd_.mjs} +6 -6
  190. package/dist/server/{overrideResolution-itXZCXs7.mjs → overrideResolution-CDReKy2P.mjs} +1 -1
  191. package/dist/server/page-converter.mjs +3 -3
  192. package/dist/server/{pageRenderPlan-CDyn7iLy.mjs → pageRenderPlan-ByVTA7-4.mjs} +255 -158
  193. package/dist/server/{pageRuntimeSupport-DZ6cLxrM.mjs → pageRuntimeSupport-Dzz_Dze6.mjs} +291 -5
  194. package/dist/server/{pageShared-Q_Vij87H.mjs → pageShared-Dk5Ku6hs.mjs} +1285 -897
  195. package/dist/server/{schema-DEizlyi4.mjs → parseThemeForPersistence-pJPGfMrf.mjs} +593 -1592
  196. package/dist/server/{prebuild-DOG4MkOy.mjs → prebuild-CW4M0WEZ.mjs} +1 -1
  197. package/dist/server/prebuild.mjs +1 -1
  198. package/dist/server/{prefetchBlockData-DlprLLsc.mjs → prefetchBlockData-Bvx0SiIM.mjs} +5 -4
  199. package/dist/server/{registry-BPFcpn6k.mjs → registry-Bh0Y25zH.mjs} +4399 -4065
  200. package/dist/server/rendering/components/pageShared.mjs +1 -1
  201. package/dist/server/rendering/helpers/loadPage.mjs +1 -1
  202. package/dist/server/rendering/helpers/pageRuntimeSupport.mjs +1 -1
  203. package/dist/server/rendering/server.mjs +3 -3
  204. package/dist/server/rendering.mjs +8 -8
  205. package/dist/server/{resolveBlockData-BHvfGD4y.mjs → resolveBlockData-CnHHst9r.mjs} +1 -1
  206. package/dist/server/{resolveButtonColourStates-OXFRGn5M.mjs → resolveButtonColourStates-Cn6j8Ee0.mjs} +399 -518
  207. package/dist/server/{responseMedia-D8J3VAFs.mjs → responseMedia-t6gs0cB7.mjs} +2 -2
  208. package/dist/server/{richTextSchema-Euhuj-7V.mjs → richTextSchema-DQ2NBP0n.mjs} +5 -16
  209. package/dist/server/server.mjs +3 -3
  210. package/dist/server/theme-bridge.mjs +2 -3
  211. package/dist/server/theme.mjs +1 -2
  212. package/dist/server/{three-pass-converter-_j2UE2tR.mjs → three-pass-converter-CQWdnfjV.mjs} +1 -1
  213. package/dist/server/{validation-bl6WcAi_.mjs → validation-D2bHWSxJ.mjs} +57 -8
  214. package/dist/server/{version-BLXZ31S-.mjs → version-DkM1eAxG.mjs} +1 -1
  215. package/dist/styles/index.css +340 -68
  216. package/package.json +4 -3
  217. package/dist/_dts/index-CXsnaCGe.d.ts +0 -10
  218. package/dist/_dts/index-RugyUnqR.d.ts +0 -31535
  219. package/dist/client/BookingMailingListNote-CCVXX1LN.mjs +0 -331
  220. package/dist/client/DemoPortalSignInLink-B9YrzZt2.mjs +0 -19
  221. package/dist/client/site-styles-CMCUxsIM.mjs +0 -3
  222. package/dist/client/useBookingNowIso-BDmWkYUW.mjs +0 -58
  223. package/dist/client/wizardSteps-DtkhwKXK.mjs +0 -6933
  224. package/dist/server/parseThemeForPersistence-CDrF51tJ.mjs +0 -52
@@ -0,0 +1,946 @@
1
+ "use client";
2
+ import { Gt as clearSignInReturnDrafts, Jt as nextSignInReturnExpiry, Xt as signInReturnPath, Yt as readSignInReturn, Zt as sweepExpiredSignInReturnDrafts, nn as RichText, qt as decideSignInReturn } from "./wizardSteps-CFulHWnT.mjs";
3
+ import { d as assertNever } from "./bookingQuestionValues-BjcyCru5.mjs";
4
+ import { n as useBlockApi, r as BlockApiError } from "./context-DXmIbXCK.mjs";
5
+ import { r as ThemedButton } from "./ThemedButton-BdnEwA38.mjs";
6
+ import { a as DemoPortalSignInLink, t as BookingQuestionFields } from "./BookingQuestionFields-Bhh0cvsl.mjs";
7
+ import { t as ModalShell } from "./ModalShell-B_fHWK71.mjs";
8
+ import { n as buildPortalCallbackUrl, r as requestDemoPortalMagicLink } from "./demoPortalMagicLink-DQXK-Fh6.mjs";
9
+ import { n as getBookingMailingListNoteCopy } from "./mailingListSignupCopy-CX4sDozG.mjs";
10
+ import * as React$1 from "react";
11
+ import { useCallback, useEffect, useId, useLayoutEffect, useMemo, useReducer, useRef, useState } from "react";
12
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
13
+ //#region ../blocks/src/system/runtime/shared/components/PaymentChoiceRows.tsx
14
+ /**
15
+ * Payment choices as a radio group. Native radios give the whole row as the
16
+ * hit area and arrow-key movement between choices; the selected row takes the
17
+ * primary accent and disabled rows stay readable with their reason.
18
+ */
19
+ function PaymentChoiceRows(props) {
20
+ const name = useId();
21
+ return /* @__PURE__ */ jsx("div", {
22
+ className: "rb-pay-choices",
23
+ role: "radiogroup",
24
+ "aria-label": props.label,
25
+ children: props.rows.map((row) => {
26
+ const selected = row.selected && !row.disabled;
27
+ return /* @__PURE__ */ jsxs("label", {
28
+ className: [
29
+ "rb-pay-choice",
30
+ selected && "rb-pay-choice--selected",
31
+ row.disabled && "rb-pay-choice--disabled"
32
+ ].filter(Boolean).join(" "),
33
+ children: [
34
+ /* @__PURE__ */ jsx("input", {
35
+ type: "radio",
36
+ className: "rb-pay-choice__radio",
37
+ name,
38
+ value: row.id,
39
+ checked: selected,
40
+ disabled: row.disabled,
41
+ onChange: row.onSelect,
42
+ onClick: selected ? row.onSelect : void 0
43
+ }),
44
+ /* @__PURE__ */ jsxs("span", {
45
+ className: "rb-pay-choice__body",
46
+ children: [
47
+ /* @__PURE__ */ jsx("span", {
48
+ className: "rb-pay-choice__label",
49
+ children: row.label
50
+ }),
51
+ (row.details ?? []).map((detail) => /* @__PURE__ */ jsx("span", {
52
+ className: "rb-pay-choice__detail",
53
+ children: detail
54
+ }, detail)),
55
+ row.disabled && row.disabledReason ? /* @__PURE__ */ jsx("span", {
56
+ className: "rb-pay-choice__reason",
57
+ children: row.disabledReason
58
+ }) : null
59
+ ]
60
+ }),
61
+ row.price ? /* @__PURE__ */ jsx("span", {
62
+ className: "rb-pay-choice__price",
63
+ children: row.price
64
+ }) : null
65
+ ]
66
+ }, row.id);
67
+ })
68
+ });
69
+ }
70
+ //#endregion
71
+ //#region ../blocks/src/system/runtime/hooks/useBookingQuestionsRefresh.ts
72
+ /**
73
+ * With a portal session (including straight after signing in), the
74
+ * authenticated read replaces the public presentation for the selected
75
+ * target. A failed read leaves the public presentation in place, which still
76
+ * lets the booker answer; the server checks the answers either way. Shared by
77
+ * the appointment booking form and event registration.
78
+ */
79
+ function useBookingQuestionsRefresh(input) {
80
+ const { api, dispatch, identity, targetKey } = input;
81
+ const targetRef = useRef(input.target);
82
+ useLayoutEffect(() => {
83
+ targetRef.current = input.target;
84
+ });
85
+ const reading = input.target !== null;
86
+ useEffect(() => {
87
+ const target = targetRef.current;
88
+ if (!reading || !target || targetKey === null || identity === null) return;
89
+ const request = { live: true };
90
+ api.getBeforeBookingQuestions(target).then((presentation) => {
91
+ if (request.live) dispatch({
92
+ type: "booking-questions-refreshed",
93
+ targetKey,
94
+ identity,
95
+ presentation
96
+ });
97
+ }).catch(() => {});
98
+ return () => {
99
+ request.live = false;
100
+ };
101
+ }, [
102
+ api,
103
+ dispatch,
104
+ identity,
105
+ reading,
106
+ targetKey
107
+ ]);
108
+ }
109
+ //#endregion
110
+ //#region ../blocks/src/system/runtime/hooks/useSignInReturn.ts
111
+ /**
112
+ * The one owner of a booking flow's sign-in draft, shared by the appointment
113
+ * booking form and event registration. Asking for a link starts an attempt,
114
+ * and every change after that updates its draft, since the booker can carry on
115
+ * before opening the link. The return that names the attempt takes its draft,
116
+ * and `decideSignInReturn` settles whether it lands in this session.
117
+ * Finishing, the flow's own `ends` rule, or another tab using the draft ends
118
+ * the attempt; drafts nobody came back for are swept while a flow is open
119
+ * (see `useSweepExpiredDrafts`).
120
+ */
121
+ function useSignInReturn(input) {
122
+ const { siteId, formId, state, store, toDraft, ends } = input;
123
+ const target = useMemo(() => ({
124
+ siteId,
125
+ formId
126
+ }), [siteId, formId]);
127
+ const attemptRef = useRef(null);
128
+ const stateRef = useRef(state);
129
+ useLayoutEffect(() => {
130
+ stateRef.current = state;
131
+ });
132
+ useRestoreDecided(useTakeOnReturn(target, store), input);
133
+ const scheduleSweep = useSweepExpiredDrafts();
134
+ const endSignInReturn = useCallback(() => {
135
+ attemptRef.current = null;
136
+ clearSignInReturnDrafts(target);
137
+ sweepExpiredSignInReturnDrafts();
138
+ }, [target]);
139
+ const previousRef = useRef(state);
140
+ useEffect(() => {
141
+ const previous = previousRef.current;
142
+ previousRef.current = state;
143
+ if (previous === state) return;
144
+ const end = ends(previous, state);
145
+ const attempt = attemptRef.current;
146
+ if (end === "finished" || end === "abandoned" && attempt) return endSignInReturn();
147
+ if (attempt && !store.update(target, toDraft(state, attempt))) attemptRef.current = null;
148
+ }, [
149
+ endSignInReturn,
150
+ ends,
151
+ state,
152
+ store,
153
+ target,
154
+ toDraft
155
+ ]);
156
+ return {
157
+ signInReturnPath: useCallback((email) => {
158
+ const nonce = store.begin(target, (attempt) => {
159
+ attemptRef.current = attempt;
160
+ return toDraft(stateRef.current, attempt);
161
+ }, email);
162
+ scheduleSweep();
163
+ return signInReturnPath(window.location, nonce);
164
+ }, [
165
+ scheduleSweep,
166
+ store,
167
+ target,
168
+ toDraft
169
+ ]),
170
+ endSignInReturn
171
+ };
172
+ }
173
+ /**
174
+ * On load, a return address naming an attempt of this flow takes that
175
+ * attempt's draft and drops the name from the address. A name this flow has
176
+ * no draft for is left for another flow on the page. The draft is held until
177
+ * it's settled.
178
+ */
179
+ function useTakeOnReturn(target, store) {
180
+ const [draft, setDraft] = useState(null);
181
+ const handledRef = useRef(false);
182
+ useEffect(() => {
183
+ if (handledRef.current) return;
184
+ handledRef.current = true;
185
+ const signInReturn = readSignInReturn(window.location);
186
+ const taken = signInReturn ? store.take(target, signInReturn.nonce) : null;
187
+ if (!signInReturn || !taken || taken.kind === "missing") return;
188
+ window.history.replaceState(window.history.state, "", signInReturn.cleanPath);
189
+ if (taken.draft) setDraft(taken.draft);
190
+ }, [store, target]);
191
+ return {
192
+ draft,
193
+ settle: useCallback(() => setDraft(null), [])
194
+ };
195
+ }
196
+ /** Applies `decideSignInReturn` to a held draft as the session and the flow become ready. */
197
+ function useRestoreDecided(returned, input) {
198
+ const { draft, settle } = returned;
199
+ const session = useReturnSession(input.session, draft !== null);
200
+ const restoreRef = useRef(input.restore);
201
+ useLayoutEffect(() => {
202
+ restoreRef.current = input.restore;
203
+ });
204
+ const { ready } = input;
205
+ useEffect(() => {
206
+ if (!draft) return;
207
+ const decision = decideSignInReturn(draft, session, ready);
208
+ if (decision.kind === "wait") return;
209
+ settle();
210
+ if (decision.kind === "restore") restoreRef.current(draft, decision.verifiedIdentity);
211
+ }, [
212
+ draft,
213
+ ready,
214
+ session,
215
+ settle
216
+ ]);
217
+ }
218
+ /**
219
+ * The session a returned draft is judged against, from the portal profile
220
+ * read for the current session. It's only read while a draft is waiting, and
221
+ * a failed read counts as signed out, so the draft is discarded.
222
+ */
223
+ function useReturnSession(input, waiting) {
224
+ const { api, identity } = input;
225
+ const [read, setRead] = useState(null);
226
+ useEffect(() => {
227
+ if (!waiting || identity === null) return;
228
+ const run = { live: true };
229
+ api.getPortalProfile().then((me) => {
230
+ if (run.live) setRead({
231
+ identity,
232
+ email: me.profile.email
233
+ });
234
+ }, () => {
235
+ if (run.live) setRead({
236
+ identity,
237
+ email: null
238
+ });
239
+ });
240
+ return () => {
241
+ run.live = false;
242
+ };
243
+ }, [
244
+ api,
245
+ identity,
246
+ waiting
247
+ ]);
248
+ return useMemo(() => {
249
+ if (identity === null) return { kind: "signed_out" };
250
+ if (read?.identity !== identity) return { kind: "resolving" };
251
+ return read.email === null ? { kind: "signed_out" } : {
252
+ kind: "signed_in",
253
+ identity,
254
+ email: read.email
255
+ };
256
+ }, [identity, read]);
257
+ }
258
+ /**
259
+ * Local storage has no expiry of its own and keeps a draft until something
260
+ * removes it. While a flow is open, this sweeps on load, when the next draft
261
+ * runs out, and whenever the page comes back into view or focus (timers stall
262
+ * in background tabs). Saving a draft pushes its expiry back, which the timer
263
+ * finds when it fires: it sweeps nothing and waits for the new time. A closed
264
+ * browser runs none of this, so its drafts stay until the next booking-flow
265
+ * visit on this site, whose load sweeps them. Returns the scheduler, for a
266
+ * newly begun draft.
267
+ */
268
+ function useSweepExpiredDrafts() {
269
+ const timerRef = useRef(void 0);
270
+ const mountedRef = useRef(false);
271
+ const sweepAndSchedule = useCallback(function sweep() {
272
+ clearTimeout(timerRef.current);
273
+ timerRef.current = void 0;
274
+ if (!mountedRef.current) return;
275
+ sweepExpiredSignInReturnDrafts();
276
+ const next = nextSignInReturnExpiry();
277
+ if (next !== null) timerRef.current = setTimeout(sweep, Math.max(0, next - Date.now()) + 1);
278
+ }, []);
279
+ useEffect(() => {
280
+ mountedRef.current = true;
281
+ const onVisible = () => {
282
+ if (document.visibilityState === "visible") sweepAndSchedule();
283
+ };
284
+ sweepAndSchedule();
285
+ document.addEventListener("visibilitychange", onVisible);
286
+ window.addEventListener("focus", sweepAndSchedule);
287
+ return () => {
288
+ mountedRef.current = false;
289
+ clearTimeout(timerRef.current);
290
+ document.removeEventListener("visibilitychange", onVisible);
291
+ window.removeEventListener("focus", sweepAndSchedule);
292
+ };
293
+ }, [sweepAndSchedule]);
294
+ return sweepAndSchedule;
295
+ }
296
+ //#endregion
297
+ //#region ../blocks/src/system/runtime/shared/portalSessionIdentity.ts
298
+ /**
299
+ * The portal session a booking flow runs in, or null when signed out.
300
+ * During-booking answers and the authenticated question read belong to this
301
+ * session, in the appointment booking form and event registration alike.
302
+ */
303
+ function portalSessionIdentity(config) {
304
+ const portalAuth = config.authOverrides?.portal ?? config.auth;
305
+ return portalAuth.type === "bearer" ? portalAuth.token : null;
306
+ }
307
+ //#endregion
308
+ //#region ../blocks/src/system/runtime/hooks/usePolling.state.ts
309
+ function createInitialPollingState() {
310
+ return {
311
+ tag: "idle",
312
+ result: null,
313
+ error: null
314
+ };
315
+ }
316
+ function pollingReducer(state, action) {
317
+ switch (action.type) {
318
+ case "polling-went-idle": return createInitialPollingState();
319
+ case "polling-reset": return {
320
+ tag: "polling",
321
+ result: null,
322
+ error: null
323
+ };
324
+ case "polling-progressed": return {
325
+ tag: "polling",
326
+ result: action.result,
327
+ error: null
328
+ };
329
+ case "polling-completed": return {
330
+ tag: "completed",
331
+ result: action.result,
332
+ error: null
333
+ };
334
+ case "polling-failed": return {
335
+ tag: "failed",
336
+ result: action.result,
337
+ error: null
338
+ };
339
+ case "polling-request-failed": switch (state.tag) {
340
+ case "idle": return {
341
+ tag: "polling",
342
+ result: null,
343
+ error: action.error
344
+ };
345
+ case "polling": return {
346
+ tag: "polling",
347
+ result: state.result,
348
+ error: action.error
349
+ };
350
+ case "completed":
351
+ case "failed":
352
+ case "timeout": return state;
353
+ default: return assertNever(state);
354
+ }
355
+ case "polling-timed-out": return {
356
+ tag: "timeout",
357
+ result: state.result,
358
+ error: /* @__PURE__ */ new Error("Polling timed out")
359
+ };
360
+ default: return assertNever(action);
361
+ }
362
+ }
363
+ //#endregion
364
+ //#region ../blocks/src/system/runtime/hooks/usePolling.ts
365
+ /**
366
+ * Generic polling hook for async operations.
367
+ *
368
+ * Provides a reusable polling mechanism with configurable intervals,
369
+ * max attempts, and completion detection. Used by usePaymentVerification
370
+ * and other hooks that need to poll for status changes.
371
+ */
372
+ const DEFAULT_MAX_ATTEMPTS = 10;
373
+ const DEFAULT_POLL_INTERVAL = 1e3;
374
+ function usePollingRuntime(config) {
375
+ const runtime = {
376
+ configRef: useRef(config),
377
+ attemptsRef: useRef(0),
378
+ timeoutRef: useRef(null),
379
+ isPollingRef: useRef(false),
380
+ isActiveRef: useRef(false),
381
+ generationRef: useRef(0)
382
+ };
383
+ runtime.configRef.current = config;
384
+ return runtime;
385
+ }
386
+ function usePollingCleanup(runtime) {
387
+ const { isActiveRef, generationRef, timeoutRef, isPollingRef } = runtime;
388
+ return useCallback(() => {
389
+ isActiveRef.current = false;
390
+ generationRef.current += 1;
391
+ if (timeoutRef.current) {
392
+ clearTimeout(timeoutRef.current);
393
+ timeoutRef.current = null;
394
+ }
395
+ isPollingRef.current = false;
396
+ }, [
397
+ generationRef,
398
+ isActiveRef,
399
+ isPollingRef,
400
+ timeoutRef
401
+ ]);
402
+ }
403
+ function usePollingReset(runtime, dispatch) {
404
+ const { attemptsRef } = runtime;
405
+ return useCallback(() => {
406
+ dispatch({ type: "polling-reset" });
407
+ attemptsRef.current = 0;
408
+ }, [attemptsRef, dispatch]);
409
+ }
410
+ function usePollingRequest(runtime, dispatch, cleanup) {
411
+ const { configRef, attemptsRef, isPollingRef, isActiveRef, generationRef } = runtime;
412
+ return useCallback(async () => {
413
+ const config = configRef.current;
414
+ if (!config) return true;
415
+ if (isPollingRef.current) return false;
416
+ const maxAttempts = config.maxAttempts ?? DEFAULT_MAX_ATTEMPTS;
417
+ if (attemptsRef.current >= maxAttempts) {
418
+ dispatch({ type: "polling-timed-out" });
419
+ cleanup();
420
+ return true;
421
+ }
422
+ isPollingRef.current = true;
423
+ attemptsRef.current += 1;
424
+ const generation = generationRef.current;
425
+ try {
426
+ const result = await config.pollFn();
427
+ if (generation !== generationRef.current || !isActiveRef.current) return true;
428
+ if (config.isFailed?.(result)) {
429
+ dispatch({
430
+ type: "polling-failed",
431
+ result
432
+ });
433
+ cleanup();
434
+ return true;
435
+ }
436
+ if (config.isComplete(result)) {
437
+ dispatch({
438
+ type: "polling-completed",
439
+ result
440
+ });
441
+ cleanup();
442
+ return true;
443
+ }
444
+ dispatch({
445
+ type: "polling-progressed",
446
+ result
447
+ });
448
+ isPollingRef.current = false;
449
+ return false;
450
+ } catch (error) {
451
+ if (generation !== generationRef.current || !isActiveRef.current) return true;
452
+ if (error instanceof Error) dispatch({
453
+ type: "polling-request-failed",
454
+ error
455
+ });
456
+ isPollingRef.current = false;
457
+ return false;
458
+ }
459
+ }, [
460
+ attemptsRef,
461
+ cleanup,
462
+ configRef,
463
+ dispatch,
464
+ generationRef,
465
+ isActiveRef,
466
+ isPollingRef
467
+ ]);
468
+ }
469
+ function usePollingScheduler(runtime, poll) {
470
+ const { attemptsRef, configRef, isActiveRef, timeoutRef } = runtime;
471
+ return useCallback(() => {
472
+ if (!isActiveRef.current) return;
473
+ const doPoll = async () => {
474
+ if (!await poll() && isActiveRef.current) {
475
+ const configuredInterval = configRef.current?.interval;
476
+ const interval = typeof configuredInterval === "function" ? configuredInterval(attemptsRef.current) : configuredInterval ?? DEFAULT_POLL_INTERVAL;
477
+ timeoutRef.current = setTimeout(doPoll, interval);
478
+ }
479
+ };
480
+ doPoll();
481
+ }, [
482
+ attemptsRef,
483
+ configRef,
484
+ isActiveRef,
485
+ poll,
486
+ timeoutRef
487
+ ]);
488
+ }
489
+ function usePollingCycle(config, runtime, dispatch) {
490
+ const cleanup = usePollingCleanup(runtime);
491
+ const resetState = usePollingReset(runtime, dispatch);
492
+ const schedulePoll = usePollingScheduler(runtime, usePollingRequest(runtime, dispatch, cleanup));
493
+ const pollingEnabled = config !== null;
494
+ useEffect(() => {
495
+ if (!pollingEnabled) {
496
+ cleanup();
497
+ dispatch({ type: "polling-went-idle" });
498
+ return;
499
+ }
500
+ resetState();
501
+ runtime.isActiveRef.current = true;
502
+ schedulePoll();
503
+ return cleanup;
504
+ }, [
505
+ cleanup,
506
+ dispatch,
507
+ pollingEnabled,
508
+ resetState,
509
+ config?.restartKey ?? null,
510
+ runtime.isActiveRef,
511
+ schedulePoll
512
+ ]);
513
+ return useCallback(() => {
514
+ if (!runtime.configRef.current) return;
515
+ cleanup();
516
+ resetState();
517
+ runtime.isActiveRef.current = true;
518
+ schedulePoll();
519
+ }, [
520
+ cleanup,
521
+ resetState,
522
+ runtime.configRef,
523
+ runtime.isActiveRef,
524
+ schedulePoll
525
+ ]);
526
+ }
527
+ /**
528
+ * Polls until the operation completes, fails, times out, or becomes disabled.
529
+ * Config objects may be rebuilt across renders; change restartKey to begin a
530
+ * new operation and reset its attempt budget.
531
+ */
532
+ function usePolling(config) {
533
+ const [state, dispatch] = useReducer(pollingReducer, void 0, createInitialPollingState);
534
+ const retry = usePollingCycle(config, usePollingRuntime(config), dispatch);
535
+ return {
536
+ status: config ? state.tag : "idle",
537
+ result: config ? state.result : null,
538
+ error: config ? state.error : null,
539
+ retry
540
+ };
541
+ }
542
+ //#endregion
543
+ //#region ../blocks/src/system/runtime/shared/components/BookingConsentAgreement.tsx
544
+ function BookingConsentAgreement({ agreement, showTitle = true, title, titleId, requiredMark = "asterisk" }) {
545
+ return /* @__PURE__ */ jsxs(Fragment, { children: [showTitle ? /* @__PURE__ */ jsxs("div", {
546
+ id: titleId,
547
+ className: "form-label",
548
+ children: [title, requiredMark === "asterisk" ? /* @__PURE__ */ jsx("span", {
549
+ className: "required-marker",
550
+ children: "*"
551
+ }) : null]
552
+ }) : null, /* @__PURE__ */ jsx("div", {
553
+ role: "group",
554
+ "aria-label": showTitle ? void 0 : title,
555
+ "aria-labelledby": showTitle ? titleId : void 0,
556
+ children: /* @__PURE__ */ jsx(RichText, {
557
+ doc: agreement,
558
+ linkTarget: "new-tab",
559
+ className: "rb-prose rb-max-w-none"
560
+ })
561
+ })] });
562
+ }
563
+ //#endregion
564
+ //#region ../blocks/src/system/runtime/nodes/shared/MagicLinkForm.state.ts
565
+ const initialMagicLinkSubmissionState = Object.freeze({ tag: "idle" });
566
+ function magicLinkSubmissionReducer(state, action) {
567
+ switch (action.type) {
568
+ case "submit-started":
569
+ if (state.tag === "submitting") return state;
570
+ return { tag: "submitting" };
571
+ case "submit-succeeded":
572
+ if (state.tag !== "submitting") return state;
573
+ return { tag: "success" };
574
+ case "submit-demo-link": return state.tag === "submitting" ? {
575
+ tag: "demo_link",
576
+ url: action.url
577
+ } : state;
578
+ case "submit-demo-refused": return state.tag === "submitting" ? {
579
+ tag: "demo_refused",
580
+ message: action.message
581
+ } : state;
582
+ case "submit-failed":
583
+ if (state.tag !== "submitting") return state;
584
+ return {
585
+ tag: "error",
586
+ message: action.message
587
+ };
588
+ case "reset": return initialMagicLinkSubmissionState;
589
+ default: return assertNever(action);
590
+ }
591
+ }
592
+ function isMagicLinkSubmitting(state) {
593
+ return state.tag === "submitting";
594
+ }
595
+ function getMagicLinkError(state) {
596
+ return state.tag === "error" ? state.message : null;
597
+ }
598
+ //#endregion
599
+ //#region ../blocks/src/system/runtime/nodes/shared/MagicLinkForm.tsx
600
+ function usesThemedControls(classPrefix) {
601
+ return classPrefix === "cp" || classPrefix === "rb-reg";
602
+ }
603
+ function emailInputClassName(classPrefix) {
604
+ if (classPrefix === "cp") return "cp-input";
605
+ if (classPrefix === "rb-reg") return "form-input";
606
+ return `${classPrefix}-form__input`;
607
+ }
608
+ function normalizeMagicLinkEmail(email) {
609
+ return email.trim().toLowerCase();
610
+ }
611
+ function MagicLinkForm(props) {
612
+ const api = useBlockApi();
613
+ const [email, setEmail] = useState(props.initialEmail ?? "");
614
+ const [state, dispatch] = useReducer(magicLinkSubmissionReducer, initialMagicLinkSubmissionState);
615
+ const loading = isMagicLinkSubmitting(state);
616
+ const handleSubmit = (event) => {
617
+ submitMagicLink({
618
+ event,
619
+ email,
620
+ loading,
621
+ api,
622
+ dispatch,
623
+ onSuccess: props.onSuccess,
624
+ returnPath: props.returnPath
625
+ });
626
+ };
627
+ if (state.tag === "success" || state.tag === "demo_link") return /* @__PURE__ */ jsx(MagicLinkSuccess, {
628
+ state,
629
+ classPrefix: props.classPrefix ?? "er",
630
+ compact: props.compact ?? false,
631
+ successMessage: resolveSuccessMessage(props.successMessage, email),
632
+ successDetail: props.successDetail,
633
+ successAction: props.successAction,
634
+ onReset: () => {
635
+ setEmail("");
636
+ dispatch({ type: "reset" });
637
+ }
638
+ });
639
+ return /* @__PURE__ */ jsx(MagicLinkFormView, {
640
+ classPrefix: props.classPrefix ?? "er",
641
+ compact: props.compact ?? false,
642
+ email,
643
+ error: getMagicLinkError(state),
644
+ loading,
645
+ title: props.title,
646
+ subtitle: props.subtitle,
647
+ buttonText: props.buttonText ?? "Send login link",
648
+ state,
649
+ onEmailChange: setEmail,
650
+ onSubmit: handleSubmit
651
+ });
652
+ }
653
+ function resolveSuccessMessage(message, email) {
654
+ if (typeof message === "function") return message(normalizeMagicLinkEmail(email));
655
+ return message ?? "Check your email for a login link to sign in.";
656
+ }
657
+ function MagicLinkFormView(props) {
658
+ const classPrefix = props.classPrefix;
659
+ return /* @__PURE__ */ jsxs("form", {
660
+ onSubmit: props.onSubmit,
661
+ className: `${classPrefix}-magic-link-form`,
662
+ children: [
663
+ props.title ? /* @__PURE__ */ jsx("h3", {
664
+ className: `${classPrefix}-magic-link-title`,
665
+ children: props.title
666
+ }) : null,
667
+ props.subtitle ? /* @__PURE__ */ jsx("p", {
668
+ className: `${classPrefix}-portal-auth-text`,
669
+ children: props.subtitle
670
+ }) : null,
671
+ /* @__PURE__ */ jsx("input", {
672
+ type: "email",
673
+ className: emailInputClassName(classPrefix),
674
+ placeholder: "your@email.com",
675
+ value: props.email,
676
+ onChange: (event) => props.onEmailChange(event.target.value),
677
+ autoFocus: !props.compact,
678
+ required: true,
679
+ disabled: props.loading
680
+ }),
681
+ /* @__PURE__ */ jsx(MagicLinkFormFeedback, {
682
+ classPrefix,
683
+ error: props.error,
684
+ state: props.state
685
+ }),
686
+ /* @__PURE__ */ jsx(MagicLinkButton, {
687
+ themed: usesThemedControls(classPrefix),
688
+ type: "submit",
689
+ variant: "primary",
690
+ className: `${classPrefix}-modal-btn`,
691
+ label: props.loading ? "Sending..." : props.buttonText,
692
+ disabled: !props.email.trim() || props.loading
693
+ })
694
+ ]
695
+ });
696
+ }
697
+ function MagicLinkFormFeedback(props) {
698
+ if (!props.error && props.state.tag !== "demo_refused") return null;
699
+ return /* @__PURE__ */ jsxs(Fragment, { children: [props.error ? /* @__PURE__ */ jsx("p", {
700
+ className: `${props.classPrefix}-portal-auth-text ${props.classPrefix}-portal-auth-text--error`,
701
+ children: props.error
702
+ }) : null, props.state.tag === "demo_refused" ? /* @__PURE__ */ jsx("p", {
703
+ role: "alert",
704
+ className: `${props.classPrefix}-portal-auth-text ${props.classPrefix}-portal-auth-text--error`,
705
+ children: props.state.message
706
+ }) : null] });
707
+ }
708
+ function MagicLinkSuccess(props) {
709
+ const themed = usesThemedControls(props.classPrefix);
710
+ return /* @__PURE__ */ jsxs("div", {
711
+ className: `${props.classPrefix}-magic-link-success`,
712
+ children: [
713
+ props.state.tag === "success" ? /* @__PURE__ */ jsx("p", {
714
+ className: `${props.classPrefix}-portal-auth-text ${props.classPrefix}-portal-auth-text--success`,
715
+ children: props.successMessage
716
+ }) : /* @__PURE__ */ jsx(DemoPortalSignInLink, { url: props.state.url }),
717
+ props.state.tag === "success" && props.successDetail ? /* @__PURE__ */ jsx("p", {
718
+ className: `${props.classPrefix}-portal-auth-text`,
719
+ children: props.successDetail
720
+ }) : null,
721
+ props.successAction ? /* @__PURE__ */ jsx(MagicLinkButton, {
722
+ themed,
723
+ type: "button",
724
+ variant: "primary",
725
+ className: `${props.classPrefix}-modal-btn`,
726
+ label: props.successAction.label,
727
+ onClick: props.successAction.onClick
728
+ }) : null,
729
+ !props.compact ? /* @__PURE__ */ jsx(MagicLinkButton, {
730
+ themed,
731
+ type: "button",
732
+ variant: "secondary",
733
+ className: `${props.classPrefix}-modal-btn ${props.classPrefix}-modal-btn--secondary`,
734
+ label: "Try a different email",
735
+ onClick: props.onReset
736
+ }) : null
737
+ ]
738
+ });
739
+ }
740
+ function MagicLinkButton(props) {
741
+ return props.themed ? /* @__PURE__ */ jsx(ThemedButton, {
742
+ type: props.type,
743
+ variant: props.variant,
744
+ size: "md",
745
+ label: props.label,
746
+ disabled: props.disabled,
747
+ onClick: props.onClick
748
+ }) : /* @__PURE__ */ jsx("button", {
749
+ type: props.type,
750
+ className: props.className,
751
+ disabled: props.disabled,
752
+ onClick: props.onClick,
753
+ children: props.label
754
+ });
755
+ }
756
+ async function submitMagicLink(input) {
757
+ input.event.preventDefault();
758
+ const email = normalizeMagicLinkEmail(input.email);
759
+ if (!email || input.loading) return;
760
+ input.dispatch({ type: "submit-started" });
761
+ try {
762
+ const result = await requestDemoPortalMagicLink({
763
+ email,
764
+ redirectUrl: getMagicLinkRedirectUrl(input.returnPath?.(email)),
765
+ send: (request) => input.api.sendMagicLink(request)
766
+ });
767
+ input.dispatch(magicLinkActionForResult(result));
768
+ if (result.kind === "email_sent") input.onSuccess?.();
769
+ } catch (error) {
770
+ console.error("Magic link error:", error);
771
+ input.dispatch({
772
+ type: "submit-failed",
773
+ message: getMagicLinkErrorMessage(error)
774
+ });
775
+ }
776
+ }
777
+ function magicLinkActionForResult(result) {
778
+ switch (result.kind) {
779
+ case "email_sent": return { type: "submit-succeeded" };
780
+ case "demo_sign_in": return {
781
+ type: "submit-demo-link",
782
+ url: result.url
783
+ };
784
+ case "refused": return {
785
+ type: "submit-demo-refused",
786
+ message: result.message
787
+ };
788
+ }
789
+ }
790
+ function getMagicLinkRedirectUrl(returnPath) {
791
+ const redirectTo = returnPath ?? `${window.location.pathname}${window.location.search}${window.location.hash}`;
792
+ return buildPortalCallbackUrl(window.location.origin, redirectTo);
793
+ }
794
+ function getMagicLinkErrorMessage(error) {
795
+ return error instanceof BlockApiError ? error.message : "We couldn’t send the sign-in link. Please try again.";
796
+ }
797
+ //#endregion
798
+ //#region ../blocks/src/system/runtime/nodes/shared/BookingQuestionSections.tsx
799
+ /**
800
+ * The question set asked while booking, shared by the appointment booking
801
+ * form and event registration. It renders what the presentation says and
802
+ * reports the booker's choices; submitting is the flow's job.
803
+ */
804
+ function BookingQuestionSections(props) {
805
+ const { presentation } = props;
806
+ switch (presentation.kind) {
807
+ case "none": return null;
808
+ case "unavailable": return /* @__PURE__ */ jsx("p", {
809
+ role: "alert",
810
+ children: presentation.message
811
+ });
812
+ case "ask": return /* @__PURE__ */ jsxs(QuestionSetSection, { children: [presentation.signIn === "offered" ? /* @__PURE__ */ jsx(SignInNotice, {
813
+ email: props.signInEmail,
814
+ returnPath: props.signInReturnPath
815
+ }) : null, /* @__PURE__ */ jsx(QuestionFields, {
816
+ set: presentation.set,
817
+ props
818
+ })] });
819
+ case "prefill": return /* @__PURE__ */ jsxs(QuestionSetSection, { children: [/* @__PURE__ */ jsx("p", {
820
+ className: "rb-bq-note",
821
+ children: "We’ve filled in the answers you gave last time. Please check they’re still right."
822
+ }), /* @__PURE__ */ jsx(QuestionFields, {
823
+ set: presentation.set,
824
+ props
825
+ })] });
826
+ case "already_answered": return /* @__PURE__ */ jsx(AlreadyAnswered, {
827
+ set: presentation.set,
828
+ props
829
+ });
830
+ }
831
+ }
832
+ /** A set's name is the practitioner's own label, so customers see a fixed heading instead. */
833
+ const BOOKING_QUESTIONS_HEADING = "A few questions";
834
+ function QuestionSetSection(props) {
835
+ const headingId = `${React$1.useId()}-heading`;
836
+ return /* @__PURE__ */ jsxs("section", {
837
+ className: "rb-bq",
838
+ "aria-labelledby": headingId,
839
+ children: [/* @__PURE__ */ jsx("h3", {
840
+ id: headingId,
841
+ className: "rb-bq-heading",
842
+ children: BOOKING_QUESTIONS_HEADING
843
+ }), props.children]
844
+ });
845
+ }
846
+ function QuestionFields(input) {
847
+ const idPrefix = `${React$1.useId()}-`;
848
+ return /* @__PURE__ */ jsx("div", {
849
+ className: "rb-space-y-3",
850
+ children: /* @__PURE__ */ jsx(BookingQuestionFields, {
851
+ sections: input.set.sections,
852
+ values: input.props.values,
853
+ fieldErrors: input.props.fieldErrors,
854
+ onChange: input.props.onChange,
855
+ disabled: input.props.disabled,
856
+ idPrefix,
857
+ showFirstSectionTitle: input.props.showFirstSectionTitle,
858
+ renderDocumentField: input.props.renderDocumentField
859
+ })
860
+ });
861
+ }
862
+ function AlreadyAnswered(input) {
863
+ const { set, props } = input;
864
+ if (props.answerMode === "answers") return /* @__PURE__ */ jsxs(QuestionSetSection, { children: [/* @__PURE__ */ jsx(QuestionFields, {
865
+ set,
866
+ props
867
+ }), /* @__PURE__ */ jsx("p", {
868
+ className: "rb-bq-note",
869
+ children: /* @__PURE__ */ jsx("button", {
870
+ type: "button",
871
+ className: "rb-bq-link",
872
+ disabled: props.disabled,
873
+ onClick: () => props.onAnswerModeChange("keep_existing"),
874
+ children: "Keep my earlier answers"
875
+ })
876
+ })] });
877
+ return /* @__PURE__ */ jsxs("section", {
878
+ className: "rb-bq rb-bq--answered",
879
+ children: [/* @__PURE__ */ jsx("p", {
880
+ className: "rb-bq-note",
881
+ children: "We already have your answers from your last booking."
882
+ }), /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(ThemedButton, {
883
+ type: "button",
884
+ variant: "secondary",
885
+ size: "sm",
886
+ label: "Change my answers",
887
+ disabled: props.disabled,
888
+ onClick: () => props.onAnswerModeChange("answers")
889
+ }) })]
890
+ });
891
+ }
892
+ function SignInNotice(props) {
893
+ const [open, setOpen] = React$1.useState(false);
894
+ const titleId = `${React$1.useId()}-sign-in-title`;
895
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("p", {
896
+ className: "rb-bq-note",
897
+ children: [
898
+ "Booked with us before?",
899
+ " ",
900
+ /* @__PURE__ */ jsx("button", {
901
+ type: "button",
902
+ className: "rb-bq-link",
903
+ onClick: () => setOpen(true),
904
+ children: "Sign in"
905
+ }),
906
+ " ",
907
+ "and we’ll fill in the answers you gave last time."
908
+ ]
909
+ }), open ? /* @__PURE__ */ jsx(ModalShell, {
910
+ title: "Sign in with email",
911
+ titleId,
912
+ onClose: () => setOpen(false),
913
+ overlayClassName: "rb-reg-modal-overlay",
914
+ modalClassName: "rb-reg-modal",
915
+ titleClassName: "rb-reg-modal-title",
916
+ closeButtonClassName: "rb-reg-modal-close",
917
+ children: /* @__PURE__ */ jsx("div", {
918
+ className: "rb-reg-modal-content",
919
+ children: /* @__PURE__ */ jsx(MagicLinkForm, {
920
+ initialEmail: props.email,
921
+ subtitle: "Enter your email and we’ll send you a link to sign in.",
922
+ buttonText: "Send sign-in link",
923
+ successMessage: (email) => `We’ve sent a sign-in link to ${email}.`,
924
+ successDetail: "Open it on this device and you’ll come back to this booking with everything you’ve typed so far.",
925
+ successAction: {
926
+ label: "Back to my booking",
927
+ onClick: () => setOpen(false)
928
+ },
929
+ classPrefix: "rb-reg",
930
+ returnPath: props.returnPath
931
+ })
932
+ })
933
+ }) : null] });
934
+ }
935
+ //#endregion
936
+ //#region ../blocks/src/system/runtime/shared/components/BookingMailingListNote.tsx
937
+ function BookingMailingListNote(props) {
938
+ const copy = getBookingMailingListNoteCopy(props.note, props.context);
939
+ return /* @__PURE__ */ jsxs("div", {
940
+ role: "status",
941
+ className: props.className,
942
+ children: [/* @__PURE__ */ jsx("p", { children: copy.title }), copy.detail ? /* @__PURE__ */ jsx("p", { children: copy.detail }) : null]
943
+ });
944
+ }
945
+ //#endregion
946
+ export { usePolling as a, useBookingQuestionsRefresh as c, BookingConsentAgreement as i, PaymentChoiceRows as l, BookingQuestionSections as n, portalSessionIdentity as o, MagicLinkForm as r, useSignInReturn as s, BookingMailingListNote as t };