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