@riverbankcms/sdk 0.179.0 → 0.181.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 (240) hide show
  1. package/README.md +2 -2
  2. package/dist/_dts/{BlocksIslandsHydrator-DKwgs95u.d.ts → BlocksIslandsHydrator-CVCasDPz.d.ts} +1 -1
  3. package/dist/_dts/{Page-lWenra5i.d.ts → Page-Dtj2Ui3S.d.ts} +7 -7
  4. package/dist/_dts/{SdkPreviewMode-BRxhRw4I.d.ts → SdkPreviewMode-D1f_60WW.d.ts} +3 -2
  5. package/dist/_dts/{client-qWn7xAwJ.d.ts → client-Chr9pNVW.d.ts} +288 -121
  6. package/dist/_dts/{content-types-DL6GIvTm.d.ts → content-types-kjccgopX.d.ts} +2 -2
  7. package/dist/_dts/{contracts-CzWyAiJj.d.ts → contracts-BodaiS00.d.ts} +3 -3
  8. package/dist/_dts/{generatePageMetadata-CBKd0cJ4.d.ts → generatePageMetadata-BS6kaJFp.d.ts} +2 -2
  9. package/dist/_dts/{index-DCiSHd-C.d.ts → index-Brl6_I2j.d.ts} +5 -4
  10. package/dist/_dts/{index-CaCum9mM.d.ts → index-CJkefwYh.d.ts} +2 -2
  11. package/dist/_dts/{index-7CDBZGb-.d.ts → index-D1WpKwQe.d.ts} +1 -1
  12. package/dist/_dts/{index-BU9uAkHB.d.ts → index-DG0OvBs0.d.ts} +8 -8
  13. package/dist/_dts/{index-BYnG_vF5.d.ts → index-Diqt0PvG.d.ts} +1 -1
  14. package/dist/_dts/{index-CZgJrhzT.d.ts → index-Dy50xUMK.d.ts} +2 -2
  15. package/dist/_dts/{loadContent-CPKbFQyq.d.ts → loadContent-BgxshKrA.d.ts} +7 -7
  16. package/dist/_dts/{request-BjKBCS7t.d.ts → request-CA0izds5.d.ts} +4561 -1390
  17. package/dist/_dts/{resolveBlockData-DupbMCup.d.ts → resolveBlockData-ChQmwEd3.d.ts} +5 -5
  18. package/dist/_dts/{resolvePageContent-BqNyCHi8.d.ts → resolvePageContent-BvGyvblj.d.ts} +1 -1
  19. package/dist/_dts/sdk/src/bookings/index.d.ts +2 -2
  20. package/dist/_dts/sdk/src/client/types.d.ts +2 -2
  21. package/dist/_dts/sdk/src/client.d.ts +7 -7
  22. package/dist/_dts/sdk/src/config/index.d.ts +6 -6
  23. package/dist/_dts/sdk/src/config/template-validation.d.ts +1 -1
  24. package/dist/_dts/sdk/src/config/validation.d.ts +1 -1
  25. package/dist/_dts/sdk/src/data/dataLoaderContext.d.ts +2 -2
  26. package/dist/_dts/sdk/src/data/resolveBlockData.d.ts +1 -1
  27. package/dist/_dts/sdk/src/data/types.d.ts +2 -2
  28. package/dist/_dts/sdk/src/gifting/client.d.ts +1 -2
  29. package/dist/_dts/sdk/src/index.d.ts +104 -8
  30. package/dist/_dts/sdk/src/manifest/index.d.ts +3 -3
  31. package/dist/_dts/sdk/src/metadata/index.d.ts +1 -1
  32. package/dist/_dts/sdk/src/navigation/index.d.ts +3 -3
  33. package/dist/_dts/sdk/src/next/index.d.ts +84 -53
  34. package/dist/_dts/sdk/src/next/middleware.d.ts +2 -2
  35. package/dist/_dts/sdk/src/page-converter/index.d.ts +3 -3
  36. package/dist/_dts/sdk/src/portal/client.d.ts +43 -56
  37. package/dist/_dts/sdk/src/portal/index.d.ts +3 -18
  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 -4
  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 +6 -6
  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/{serviceBookingOutline-YcsIjvn1.d.ts → serviceBookingOutline-BgFbJQhU.d.ts} +8 -7
  55. package/dist/_dts/{types-B7e6Lmo5.d.ts → types-CQrsP1x_.d.ts} +3 -3
  56. package/dist/_dts/{types-CT-KOxl_.d.ts → types-CgS3xLk8.d.ts} +7 -2
  57. package/dist/_dts/{types-BOxSq-Bq.d.ts → types-R65DKjPn.d.ts} +9 -8
  58. package/dist/_dts/{validation-Dz6qccue.d.ts → validation-6LTIbuBA.d.ts} +4 -4
  59. package/dist/client/{BlocksIslandsHydrator-1XifJg6V.mjs → BlocksIslandsHydrator-DqZPz6oW.mjs} +19 -19
  60. package/dist/client/{BookingMailingListNote-BsbEgagJ.mjs → BookingMailingListNote-uWfR2kaG.mjs} +177 -70
  61. package/dist/client/{BookingQuestionFields-C8IbeLHj.mjs → BookingQuestionFields-CyNIKw6k.mjs} +23 -82
  62. package/dist/client/CalendarAction-D_Glwvz2.mjs +105 -0
  63. package/dist/client/{CalendarNavigationChevron-Bbqij1XQ.mjs → CalendarNavigationChevron-BGCX3zwG.mjs} +6 -6
  64. package/dist/client/{CheckboxChoice-BZPLCgTU.mjs → CheckboxChoice-C8i4NraK.mjs} +1 -1
  65. package/dist/client/{DemoBookingPortalAccess-uA9H8LIL.mjs → DemoBookingPortalAccess-DFLPyuqe.mjs} +18 -10
  66. package/dist/client/{EventCalendar.client-yoSI77ov.mjs → EventCalendar.client-zDL4-t-B.mjs} +10 -10
  67. package/dist/client/{EventCombined.client-HeCNlliq.mjs → EventCombined.client-uciDKLID.mjs} +60 -10
  68. package/dist/client/{EventEmbeddedCheckoutStep-BDnicDM6.mjs → EventEmbeddedCheckoutStep-BGkbUhuw.mjs} +1 -1
  69. package/dist/client/{EventItem-Duhk1vnF.mjs → EventItem-CwzrjcRw.mjs} +8 -7
  70. package/dist/client/{EventListWeekNavigation-BiutEqPK.mjs → EventListWeekNavigation-ChvcnPma.mjs} +1 -1
  71. package/dist/client/{EventListing.client-B5ln77jG.mjs → EventListing.client-DA57Qoyx.mjs} +3 -3
  72. package/dist/client/{EventListing.view-hUDhNtMv.mjs → EventListing.view-DZ0qMFF4.mjs} +8 -211
  73. package/dist/client/{EventRegistrationPayment-DqtX1vB2.mjs → EventRegistrationPayment-DSqCJL8E.mjs} +1657 -403
  74. package/dist/client/{Page-ChJ2TGVk.mjs → Page-C7mygH_f.mjs} +536 -287
  75. package/dist/client/{ProtectedSubmitButton-De6AzhE6.mjs → ProtectedSubmitButton-BNnKuir8.mjs} +1 -1
  76. package/dist/client/{SiteTermsAgreementField-CDBU31xW.mjs → SiteTermsAgreementField-B4z-e4Wq.mjs} +27 -24
  77. package/dist/client/{StepIndicator-JQA-VuEH.mjs → StepIndicator-Dn_DY4oY.mjs} +1 -1
  78. package/dist/client/{StepIndicator-2Dl9zon2.mjs → StepIndicator-atfDU82W.mjs} +21 -13
  79. package/dist/client/{ThemedButton-CnSa7o-I.mjs → ThemedButton-PFOhXktM.mjs} +1 -33
  80. package/dist/client/{accessibleSurfaces-Wl8-_OVJ.mjs → accessibleSurfaces-n6kS6Hct.mjs} +77 -1
  81. package/dist/client/{accordion-B6SqU49k.mjs → accordion-CsW8U3ff.mjs} +1 -1
  82. package/dist/client/{booking-form.client-DrEOjQ3N.mjs → booking-form.client-cBWM392H.mjs} +442 -86
  83. package/dist/client/bookingCalendar--aWnqFDn.mjs +180 -0
  84. package/dist/client/{bookingForm-drZBwEZW.mjs → bookingForm-DgySpp6C.mjs} +4 -4
  85. package/dist/client/bookings.mjs +51 -15
  86. package/dist/client/{boxStyleClassNames-DEh45w16.mjs → boxStyleClassNames-BpGVdLFD.mjs} +2 -2
  87. package/dist/client/{carousel-C-YJliD-.mjs → carousel-DJoleFV3.mjs} +2 -2
  88. package/dist/client/{carousel.client-DMtGYTTM.mjs → carousel.client-BtLwHefX.mjs} +1 -1
  89. package/dist/client/{cart-acGFWK9R.mjs → cart-EO5o6uPH.mjs} +3 -3
  90. package/dist/client/{cart.client-BzlOGP2j.mjs → cart.client-D_gPw45z.mjs} +1 -1
  91. package/dist/client/{checkout-SEontwhy.mjs → checkout-NVfZW0kR.mjs} +3 -3
  92. package/dist/client/{checkout.client-C0Qvh-d4.mjs → checkout.client-DD3JuqOy.mjs} +1 -1
  93. package/dist/client/{checkoutUrls-yUKeq1N9.mjs → checkoutUrls-z2gXvlGw.mjs} +1 -1
  94. package/dist/client/client.mjs +306 -196
  95. package/dist/client/constants-CoOkvw__.mjs +100 -0
  96. package/dist/client/{context-DTrwaQtg.mjs → context-CRhn9qzS.mjs} +922 -388
  97. package/dist/client/{dateFormatting-Cg8E1r9l.mjs → dateFormatting-BnWB4L1s.mjs} +15 -25
  98. package/dist/client/{demoPortalMagicLink-D0kOJYOX.mjs → demoPortalMagicLink-CWDGSTBu.mjs} +2 -3
  99. package/dist/client/{enhanceHeaderSection-DyrpZ7ks.mjs → enhanceHeaderSection-tdP_-Z9o.mjs} +4 -5
  100. package/dist/client/{event-registration.client-RLZQWi2V.mjs → event-registration.client-D7YYKySQ.mjs} +2084 -1640
  101. package/dist/client/{eventCalendar-CphYnImh.mjs → eventCalendar-CsAfu5d0.mjs} +4 -4
  102. package/dist/client/{eventCombined-BvqjASB_.mjs → eventCombined-VXJB5CoS.mjs} +4 -4
  103. package/dist/client/{eventListing-BaNAoC_M.mjs → eventListing-B3KIZNfY.mjs} +4 -4
  104. package/dist/client/{eventRegistration-COMHoRl6.mjs → eventRegistration-BP-dEk1c.mjs} +4 -4
  105. package/dist/client/{form-DyH2juYT.mjs → form-DM8Zbxbv.mjs} +3 -3
  106. package/dist/client/{form.client-DBwzkB0M.mjs → form.client-e2z_Tlgk.mjs} +5 -5
  107. package/dist/client/{form.parts-CY4kX3mh.mjs → form.parts-Ctljy1a3.mjs} +3 -3
  108. package/dist/client/gifting/client.mjs +32 -29
  109. package/dist/client/{gifting-CIx4V378.mjs → gifting-DWIsqQru.mjs} +4 -4
  110. package/dist/client/{gifting.client-BEVPpzJM.mjs → gifting.client-QsSWF0uA.mjs} +5 -5
  111. package/dist/client/{gifting.parts-VnORjnZK.mjs → gifting.parts-CedLgwa_.mjs} +2 -2
  112. package/dist/client/{headerSection-DGcJfRS8.mjs → headerSection-DAkRkwb-.mjs} +2 -2
  113. package/dist/client/{mediaAssets-B99AP7ai.mjs → mediaAssets-COfQolI3.mjs} +1 -1
  114. package/dist/client/{mediaContext-Fusweriw.mjs → mediaContext-DzvnjYXm.mjs} +1 -1
  115. package/dist/client/{newsletter-form.client-BvEDkjiD.mjs → newsletter-form.client-WYja9-WN.mjs} +7 -7
  116. package/dist/client/{newsletter-form.interactive-DCO1lErD.mjs → newsletter-form.interactive-RuM86VAv.mjs} +37 -44
  117. package/dist/client/{newsletter-form.parts-BIy4IUT3.mjs → newsletter-form.parts-2petDnWv.mjs} +2 -2
  118. package/dist/client/{newsletterForm-CoTXDNFS.mjs → newsletterForm-BUbXdA_e.mjs} +3 -3
  119. package/dist/client/{lookSurfaces-IqT_SVnX.mjs → noop-Dl4mZ-rr.mjs} +257 -49
  120. package/dist/client/portal/client.mjs +11779 -6745
  121. package/dist/client/portalOrders-COGn4BKG.mjs +596 -0
  122. package/dist/client/portalRoutes-D72yvtDh.mjs +862 -0
  123. package/dist/client/{product-detail.client-YHQ2aKX1.mjs → product-detail.client-pOAryevt.mjs} +1 -1
  124. package/dist/client/{product-list.client-DxoZw1vF.mjs → product-list.client-CcUpUiud.mjs} +1 -1
  125. package/dist/client/{productDetail-DjuFvkey.mjs → productDetail-BZJCfqat.mjs} +3 -3
  126. package/dist/client/{productList-DE9GEFoZ.mjs → productList-CiRs3mNb.mjs} +3 -3
  127. package/dist/client/{propsDecoder-Cyag_HOs.mjs → propsDecoder--uHW4tFM.mjs} +2 -2
  128. package/dist/client/{registry.server-BPwV-0Pp.mjs → registry.server-CDNNd8wC.mjs} +318 -235
  129. package/dist/client/{renderableMediaAssetAdmission-BlfqYLJW.mjs → renderableMediaAssetAdmission-BsOWd9lf.mjs} +1 -1
  130. package/dist/client/rendering/client.mjs +26 -26
  131. package/dist/client/rendering/islands.mjs +1 -1
  132. package/dist/client/rendering.mjs +16 -8
  133. package/dist/client/{richText-coerce-NrRqDeOg.mjs → richText-coerce-CQGE_wHV.mjs} +2 -1
  134. package/dist/client/{routeIslandApiConfig-BWq5gKFK.mjs → routeIslandApiConfig-BtCg87-N.mjs} +1 -1
  135. package/dist/client/{runtimeResponse-D2j2-mOk.mjs → runtimeResponse-DL_ARBpa.mjs} +1 -1
  136. package/dist/client/{runtimeResponse-DtWSfWSZ.mjs → runtimeResponse-Ds9cmBUf.mjs} +1 -1
  137. package/dist/client/{shop-C3wM0Hr4.mjs → shop-Rx_gEMK8.mjs} +3 -3
  138. package/dist/client/{shop-commerce-34YvcpbX.mjs → shop-commerce-D8evQnMT.mjs} +53 -16
  139. package/dist/client/{shop-commerce-store-B7xHksOs.mjs → shop-commerce-store-C9PcsSTj.mjs} +22 -5
  140. package/dist/client/{shop-discount-apply.state-BiBnozfO.mjs → shop-discount-apply.state-D5CtGfJI.mjs} +2 -2
  141. package/dist/client/{shop.client-C0v88nLd.mjs → shop.client-D4lzQ9oY.mjs} +17 -39
  142. package/dist/client/{shopShared-Ct-BRNez.mjs → shopShared-BVbq7Nm-.mjs} +2 -2
  143. package/dist/client/spam-protection.mjs +1 -1
  144. package/dist/client/src-Al4ooTl_.mjs +164 -0
  145. package/dist/client/{src-CCtanNlD.mjs → src-ZSqRK3dD.mjs} +345 -92
  146. package/dist/client/{timetableModel-lhE29TNT.mjs → timetableModel-BQJrSK0K.mjs} +205 -80
  147. package/dist/client/{shop-add-feedback-DvC2kP1K.mjs → urlParams-C2QHo1Pa.mjs} +1 -42
  148. package/dist/client/{useAvailableSlots-BelJviOT.mjs → useAvailableSlots-Dm3lKJKR.mjs} +3 -24
  149. package/dist/client/{useDiscountCodeUi-rQRE1-Ho.mjs → useDiscountCodeUi-klgfGn7f.mjs} +1 -1
  150. package/dist/client/{useEventPagination-C4rS2Xxl.mjs → useEventPagination-Jnjt7_ly.mjs} +8 -8
  151. package/dist/client/{view-LJVHVqsy.mjs → view-CC_yQLSA.mjs} +4 -4
  152. package/dist/client/{wizardSteps-CNDsxeJH.mjs → wizardSteps-BliJOzEX.mjs} +2512 -675
  153. package/dist/preview-next/before-render.mjs +1 -0
  154. package/dist/preview-next/client/{LocationPickerEnvironment-BHAT81Wx.mjs → LocationPickerEnvironment-BW3dRFIv.mjs} +1 -1
  155. package/dist/preview-next/client/{MapLibreEditMap-B52hkdIZ.mjs → MapLibreEditMap-Db9BHyXh.mjs} +2 -2
  156. package/dist/preview-next/client/{PageSectionToolbar-C4TtBPN-.mjs → PageSectionToolbar-BhL0uADo.mjs} +4 -4
  157. package/dist/preview-next/client/{PreviewEditorSidebar-D6fkE59-.mjs → PreviewEditorSidebar-Ct8eIm0i.mjs} +8 -7
  158. package/dist/preview-next/client/{PreviewEditorUI-amcDlj0O.mjs → PreviewEditorUI-BS32G4V9.mjs} +5 -5
  159. package/dist/preview-next/client/{PreviewShell-DeQjx4zk.mjs → PreviewShell-RL0WfZXD.mjs} +7 -7
  160. package/dist/preview-next/client/{SdkPreviewModeRuntime-Cx0SXnoX.mjs → SdkPreviewModeRuntime-MK_gHeGy.mjs} +39 -7
  161. package/dist/preview-next/client/{lucide-react-McYZeSMb.mjs → lucide-react-00FF_oar.mjs} +13 -1
  162. package/dist/preview-next/client/{previewAssistantSlot-aqpU34WI.mjs → previewAssistantSlot-CQyS8pcq.mjs} +10318 -3719
  163. package/dist/preview-next/client/{previewChromeRoot-D3Gy_Rs0.mjs → previewChromeRoot-BSxp3Mfu.mjs} +1 -1
  164. package/dist/preview-next/client/runtime.mjs +3 -3
  165. package/dist/preview-next/client/{sdk-runtime-Dzx_RrN7.mjs → sdk-runtime-DKnTzy74.mjs} +2 -2
  166. package/dist/preview-next/client/{siteStyleAccess-LHedw83e.mjs → siteStyleAccess-BlmbvbLN.mjs} +37 -25
  167. package/dist/preview-next/client/{useAutosaveStatus-DpSd9aVk.mjs → useAutosaveStatus-D-7GwZOQ.mjs} +1 -1
  168. package/dist/preview-next/client/{useOpenBlockForSetup-BGZn5AT1.mjs → useOpenBlockForSetup-BNZtGM5g.mjs} +2 -2
  169. package/dist/preview-next/container-responsive.css +292 -170
  170. package/dist/preview-next/keepAlive.mjs +1 -1
  171. package/dist/preview-next/middleware.mjs +1 -1
  172. package/dist/preview-next/{route-contract-DnL-FgSV.mjs → route-contract-R3PcMmax.mjs} +114 -37
  173. package/dist/server/{Block.shared-BEbq6EwO.mjs → Block.shared-CniF9tSu.mjs} +5 -5
  174. package/dist/server/{ThemeScopeCore-DFEM1a85.mjs → ThemeScopeCore-BQWsnGT6.mjs} +133 -120
  175. package/dist/server/{accessibleSurfaces-CM3QANtw.mjs → accessibleSurfaces-WPzUAHp4.mjs} +33 -2
  176. package/dist/server/accordions-By_0Ykks.mjs +111 -0
  177. package/dist/server/{bindings-Bly0dRs7.mjs → bindings-DxojjtK3.mjs} +7 -7
  178. package/dist/server/{client-CGJ2ztYp.mjs → client-CDndhbYO.mjs} +1412 -1307
  179. package/dist/server/config-validation.mjs +1 -1
  180. package/dist/server/config.mjs +2 -2
  181. package/dist/server/constants-VyF5nEhL.mjs +1474 -0
  182. package/dist/server/{customCss-BZ8YSrQg.mjs → customCss-C9kgPHvr.mjs} +41 -5
  183. package/dist/server/data/resolveBlockData.mjs +1 -1
  184. package/dist/server/index.mjs +3 -3
  185. package/dist/server/{loadContent-BkK1w3QQ.mjs → loadContent-BKstMBmX.mjs} +7 -4
  186. package/dist/server/{loadPage-DTLe0FEs.mjs → loadPage-IgNnZaqr.mjs} +3 -3
  187. package/dist/server/{lookMediaFrame-CaH018pK.mjs → lookMediaFrame-TFjgNG61.mjs} +74 -18
  188. package/dist/server/manifest.mjs +36 -25
  189. package/dist/server/{mapLocation-BM5WX7FY.mjs → mapLocation-MDDSubTp.mjs} +1 -1
  190. package/dist/server/media-BRmYrnzb.mjs +31 -0
  191. package/dist/server/{media-luf7RF22.mjs → media-gvfIw3z8.mjs} +2 -31
  192. package/dist/server/{navigation-BcNfYYuu.mjs → navigation-quBYlSKD.mjs} +2 -2
  193. package/dist/server/navigation.mjs +1 -1
  194. package/dist/server/next.mjs +170 -104
  195. package/dist/server/{overrideResolution-Uy9Zp2Ks.mjs → overrideResolution-CCaAPpIa.mjs} +1 -1
  196. package/dist/server/page-converter.mjs +3 -3
  197. package/dist/server/{pageRenderPlan-JzxBnqfV.mjs → pageRenderPlan-B7iULvKe.mjs} +15 -12
  198. package/dist/server/{pageRuntimeSupport-DyNSd2Yj.mjs → pageRuntimeSupport-BytMroxn.mjs} +9 -5
  199. package/dist/server/{pageShared-DU4ETFPS.mjs → pageShared-Dcs_XTIO.mjs} +836 -624
  200. package/dist/server/{parseThemeForPersistence-DOsfofCy.mjs → parseThemeForPersistence-Bihl4W5K.mjs} +3 -2
  201. package/dist/server/{portal-B4JVkdjc.mjs → portal-CMW_b9mG.mjs} +62 -46
  202. package/dist/server/portal.mjs +3 -3
  203. package/dist/server/portalQuestions-oUyohgL9.mjs +225 -0
  204. package/dist/server/{prebuild-8jNtDXmS.mjs → prebuild-agaH-vZV.mjs} +1 -1
  205. package/dist/server/prebuild.mjs +1 -1
  206. package/dist/server/{prefetchBlockData-xeMG42aw.mjs → prefetchBlockData-DwpRjqw4.mjs} +5 -3
  207. package/dist/server/{registry-DH1VrsCl.mjs → registry-DM9dHfDC.mjs} +582 -526
  208. package/dist/server/rendering/components/pageShared.mjs +1 -1
  209. package/dist/server/rendering/helpers/loadPage.mjs +1 -1
  210. package/dist/server/rendering/helpers/pageRuntimeSupport.mjs +1 -1
  211. package/dist/server/rendering/server.mjs +4 -4
  212. package/dist/server/rendering.mjs +10 -9
  213. package/dist/server/{resolveBlockData-BN8tweTx.mjs → resolveBlockData-CinHGf8l.mjs} +39 -31
  214. package/dist/server/{resolveButtonColourStates--6yJp9Tq.mjs → resolveButtonColourStates-B0O1IM16.mjs} +2 -1028
  215. package/dist/server/{resolvePageContent-DnM16_f9.mjs → resolvePageContent-BWKUZUIn.mjs} +1 -1
  216. package/dist/server/{responseMedia-F-ElH2Rd.mjs → responseMedia-IfH65QAH.mjs} +57 -2
  217. package/dist/server/routing.mjs +1 -1
  218. package/dist/server/{schema-BpsqaSSU.mjs → schema-CwfxQjc4.mjs} +10 -113
  219. package/dist/server/server.mjs +3 -3
  220. package/dist/server/{servicePageContent-B-FezJmH.mjs → servicePageContent-BBBhOtdE.mjs} +31 -26
  221. package/dist/server/theme-bridge.mjs +3 -2
  222. package/dist/server/theme.mjs +2 -2
  223. package/dist/server/{three-pass-converter-39SXCCnh.mjs → three-pass-converter-DPaUPTfl.mjs} +34 -16
  224. package/dist/server/titleSourceSchema-NhK6azFS.mjs +2018 -0
  225. package/dist/server/typeGuards-CTW_9AXq.mjs +413 -0
  226. package/dist/server/types-BKaBZFjD.mjs +1085 -0
  227. package/dist/server/{validation-3jOzYdPL.mjs → validation-DG5jX3jH.mjs} +70 -17
  228. package/dist/server/{version-8t0o6_jd.mjs → version-CipbxPHL.mjs} +1 -1
  229. package/dist/server/video-Cdr3wh-q.mjs +272 -0
  230. package/dist/styles/index.css +3446 -3796
  231. package/package.json +2 -1
  232. package/dist/_dts/index-DVSipdrT.d.ts +0 -101
  233. package/dist/client/TabBarFragment-DlKQRhP4.mjs +0 -56
  234. package/dist/client/checkoutRoute-DKlZRNZD.mjs +0 -22
  235. package/dist/client/constants-4o4_hl34.mjs +0 -6
  236. package/dist/client/creditProducts-BQ1t1erI.mjs +0 -266
  237. package/dist/client/formatDate-CTEN7gxW.mjs +0 -26
  238. package/dist/server/constants-Cj7hfbrA.mjs +0 -41
  239. package/dist/server/richTextSchema-QLaQrbII.mjs +0 -212
  240. package/dist/server/titleSourceSchema-Cu-3PRvv.mjs +0 -122
@@ -1,35 +1,138 @@
1
1
  "use client";
2
- import { $r as isSameOpenCheckout, B as paymentChoiceDetails, Bi as resolveBookingPaymentMode, Ci as decideBookingQuestionsRestoration, Di as toBookingQuestionsAnswerDraft, Ei as restoreBookingQuestionsAnswers, Fi as reconcileBookingPackagePurchase, Gr as readOverrideServiceCategories, Hi as toBookingPurchasablePackages, Ii as resolveBookingPackagePaymentSelection, Jr as getBookingRedirectStateFromLocation, Kr as deriveBookingFormViewState, Li as resolveBookingPackageSources, Mi as bookingHasPackagePaymentChoices, Ni as bookingPackageRequestKey, No as readRuntimeNow, Pi as bookingRequiresResourceSelection, Po as resolveDateRuntimeContext, Qr as isBookingServiceSlidingAmountInRange, R as buildBookingPaymentSelectionViewModel, Ri as resolveBookingPaymentAvailability, Si as bookingQuestionsAnswerDraftSchema, Ui as getBookingServiceSlidingScale, V as paymentChoicePrice, Vi as resolveBookingPurchasablePackages, Wo as repriceBookingCollectionOptions, Wr as buildBookingFormInteractiveIslandProps, Yr as getBookingSuccessCopy, Zo as resolveBookingSignupOffer, _a as bookingPresentation, _i as applyAppointmentBookingQuestionsEvent, _s as unsafeAsSiteId, ai as resolveBookingPaymentStep, bi as isAppointmentBookingQuestionsEvent, ci as resolveDefaultBookingServiceId, di as toSelectedCollectionOptionKind, ei as normalizeBookingFormConfig, fi as formatCentsAsCurrencyInput, fr as formatValidity, gi as EMPTY_APPOINTMENT_BOOKING_QUESTIONS, hi as resolveSelectedAppointmentConsent, ii as resolveAppointmentCheckoutVerificationState, ji as applyBookingPaymentAdmission, ki as BOOKING_FORM_DATA_RESERVED_KEYS, li as selectedBookingCollectionOptionKind, mi as projectSelectedAppointmentConsentIntoForm, ni as parseBookingCurrencyInputToCents, oi as resolveBookingSelectedService, pa as leavePage, qn as createSignInReturnDraftStore, qr as formatBookingSubmissionPreparationError, ri as prepareBookingSubmission, si as resolveBookingSiteId, ti as normalizeBookingServices, ui as snapshotBookingShownTerms, ur as formatCommercePrice, vi as appointmentQuestionsRefusal, xi as needsAppointmentQuestionsRefresh, yi as deriveAppointmentBookingQuestions, z as buildReviewedBookingPaymentViewModel, zi as resolveBookingPaymentChoice } from "./wizardSteps-CNDsxeJH.mjs";
3
- import { Kt as formatDate, Qt as formatTime, Yt as formatDateTimeRange, a as clearWorkflowFeedback, bn as formatCurrencyAmount, en as formatTimeZoneCityLabel, fn as parseUtcIsoDateTimeString, hn as resolveBookingTimeZoneId, i as okWith, k as isBookingRequirementConsentFieldId, mn as resolveBookingBusinessTimeZone, n as err, nn as resolveBookingDisplayContext, o as reportWorkflowError, pn as toUtcIsoDateTimeString, s as reportWorkflowSuccess, t as assertNever, u as logger } from "./src-CCtanNlD.mjs";
4
- import { D as unsafeAsAppointmentResourceId, O as unsafeAsAppointmentServiceId, g as formatCreditProductUnits, h as formatCreditProductPayment, m as formatCreditProductBalance, o as checkBookingQuestionsAnswered } from "./creditProducts-BQ1t1erI.mjs";
5
- import { i as useSiteTermsAgreement, n as SiteTermsChangedNotice, t as SiteTermsAgreementField } from "./SiteTermsAgreementField-CDBU31xW.mjs";
2
+ import { An as formatCurrencyAmount, Cn as toUtcIsoDateTimeString, D as isBookingRequirementConsentFieldId, Fn as unsafeAsAppointmentResourceId, In as unsafeAsAppointmentServiceId, Sn as parseUtcIsoDateTimeString, Tn as resolveBookingTimeZoneId, Zt as hasText, a as clearWorkflowFeedback, an as formatDateTimeRange, cn as formatTime, dn as inferSiteDateLocale, fn as resolveBookingDisplayContext, i as okWith, n as err, nn as formatDate, o as reportWorkflowError, s as reportWorkflowSuccess, t as assertNever, un as formatTimeZoneCityLabel, wn as resolveBookingBusinessTimeZone } from "./src-ZSqRK3dD.mjs";
3
+ import { $i as toSelectedCollectionOptionKind, $r as formatValidity, Aa as toBookingPurchasablePackages, Bi as isSameOpenCheckout, Bs as formatCreditProductPayment, Ca as reconcileBookingPackagePurchase, Da as resolveBookingPaymentChoice, Ea as resolveBookingPaymentAvailability, Fi as getBookingRedirectStateFromLocation, Gi as resolveAppointmentCheckoutVerificationState, Hi as normalizeBookingServices, Ii as getBookingSuccessCopy, Ji as resolveBookingSiteId, Ki as resolveBookingPaymentStep, Ls as repriceBookingCollectionOptions, Mi as readOverrideServiceCategories, Ni as deriveBookingFormViewState, Oa as resolveBookingPaymentMode, Pi as formatBookingSubmissionPreparationError, Pr as createSignInReturnDraftStore, Qi as snapshotBookingShownTerms, Sa as bookingRequiresResourceSelection, Ss as resolveDateRuntimeContext, Ta as resolveBookingPackageSources, Ui as parseBookingCurrencyInputToCents, Vi as normalizeBookingFormConfig, Vs as formatCreditProductUnits, Wi as prepareBookingSubmission, Xi as resolveLowestBookingPaymentStep, Yi as resolveDefaultBookingServiceId, Ys as resolveBookingSignupOffer, Zi as selectedBookingCollectionOptionKind, Zr as formatCommercePrice, _a as BOOKING_FORM_DATA_RESERVED_KEYS, aa as deriveAppointmentBookingQuestions, ao as bookingPresentation, ba as bookingHasPackagePaymentChoices, ca as bookingQuestionsAnswerDraftSchema, dt as paymentChoiceDetails, ea as projectSelectedAppointmentConsentIntoForm, fa as restoreBookingQuestionsAnswers, ft as paymentChoicePrice, gc as unsafeAsSiteId, ha as formatCentsAsCurrencyInput, ia as appointmentQuestionsRefusal, ja as getBookingServiceSlidingScale, ji as buildBookingFormInteractiveIslandProps, ka as resolveBookingPurchasablePackages, la as decideBookingQuestionsRestoration, lt as buildBookingPaymentSelectionViewModel, mr as isEmailAddress, na as EMPTY_APPOINTMENT_BOOKING_QUESTIONS, oa as isAppointmentBookingQuestionsEvent, pa as toBookingQuestionsAnswerDraft, qi as resolveBookingSelectedService, ra as applyAppointmentBookingQuestionsEvent, sa as needsAppointmentQuestionsRefresh, st as onlineBookingUnavailableMessage, ta as resolveSelectedAppointmentConsent, to as leavePage, ut as buildReviewedBookingPaymentViewModel, wa as resolveBookingPackagePaymentSelection, xa as bookingPackageRequestKey, xs as readRuntimeNow, ya as applyBookingPaymentAdmission, zi as isBookingServiceSlidingAmountInRange, zs as formatCreditProductBalance } from "./wizardSteps-BliJOzEX.mjs";
4
+ import { f as unsafeAsCustomerPassId, p as unsafeAsPassId } from "./portalRoutes-D72yvtDh.mjs";
5
+ import { c as checkBookingQuestionsAnswered, h as assertNever$1 } from "./bookingCalendar--aWnqFDn.mjs";
6
+ import { i as useSiteTermsAgreement, n as SiteTermsChangedNotice, t as SiteTermsAgreementField } from "./SiteTermsAgreementField-B4z-e4Wq.mjs";
6
7
  import { t as layoutServicesByCategory } from "./appointment-service-categories-Cl2pqw-z.mjs";
7
- import { a as formatTime$1, i as formatDatePillParts, n as useAvailableDates, o as getRuntimeTimeZone, r as formatDate$1, s as clientPersonPhrases, t as useAvailableSlots } from "./useAvailableSlots-BelJviOT.mjs";
8
- import { i as BlockApiError, n as useBlockApi, t as BlockApiProvider } from "./context-DTrwaQtg.mjs";
9
- import { r as ThemedButton, x as SpinnerNode } from "./ThemedButton-CnSa7o-I.mjs";
10
- import { n as BookingPanelArrangement, t as StepIndicator } from "./StepIndicator-JQA-VuEH.mjs";
11
- import { f as NavigationHandOffPanel, p as DiscountCodeDisclosure, r as DISCOUNT_APPLY_MESSAGES, t as BookingConfirmation } from "./DemoBookingPortalAccess-uA9H8LIL.mjs";
12
- import { t as buildCheckoutReturnUrls } from "./checkoutUrls-yUKeq1N9.mjs";
8
+ import { o as clientPersonPhrases, r as OptionalMark } from "./BookingQuestionFields-CyNIKw6k.mjs";
9
+ import { i as BlockApiError, n as useBlockApi, t as BlockApiProvider } from "./context-CRhn9qzS.mjs";
10
+ import { t as logger } from "./noop-Dl4mZ-rr.mjs";
11
+ import { b as SpinnerNode, n as ThemedButton } from "./ThemedButton-PFOhXktM.mjs";
12
+ import { n as BookingPanelArrangement, t as StepIndicator } from "./StepIndicator-Dn_DY4oY.mjs";
13
+ import { i as discountEmailProblem, m as DiscountCodeDisclosure, p as NavigationHandOffPanel, r as DISCOUNT_APPLY_MESSAGES, t as BookingConfirmation } from "./DemoBookingPortalAccess-DFLPyuqe.mjs";
14
+ import { t as buildCheckoutReturnUrls } from "./checkoutUrls-z2gXvlGw.mjs";
13
15
  import { t as scrollToBlock } from "./scrollToBlock-DrgKE0qZ.mjs";
14
- import { t as CheckboxChoice } from "./CheckboxChoice-BZPLCgTU.mjs";
16
+ import { t as CheckboxChoice } from "./CheckboxChoice-C8i4NraK.mjs";
15
17
  import { t as CheckIcon } from "./CheckIcon-CVcKteXH.mjs";
16
18
  import { n as getFieldValidationControlProps, t as FieldValidationMessage } from "./FieldValidationMessage-CsqxShw4.mjs";
17
19
  import { t as FeedbackMessage } from "./FeedbackMessage-CSJrAuXH.mjs";
18
- import { i as useBookingNowIso, n as OptionalMark, r as parseBookingSubmissionFailure } from "./BookingQuestionFields-C8IbeLHj.mjs";
19
- import { n as TerminalPanel, r as StateIcon, t as useDiscountCodeUi } from "./useDiscountCodeUi-rQRE1-Ho.mjs";
20
- import { a as usePolling, c as useBookingQuestionsRefresh, i as BookingConsentAgreement, l as PaymentChoiceRows, n as BookingQuestionSections, o as portalSessionIdentity, s as useSignInReturn, t as BookingMailingListNote } from "./BookingMailingListNote-BsbEgagJ.mjs";
21
- import { c as storeDemoBookingPassIfAvailable } from "./demoPortalMagicLink-D0kOJYOX.mjs";
22
- import { i as getDiscountApplyFeedback } from "./shop-discount-apply.state-BiBnozfO.mjs";
20
+ import { c as parseBookingSubmissionFailure, d as useSignInReturn, f as useBookingQuestionsRefresh, i as SignInNotice, l as useBookingNowIso, n as OrganiserContactLine, o as BookingConsentAgreement, p as PaymentChoiceRows, r as BookingQuestionSections, s as usePolling, t as BookingMailingListNote, u as portalSessionIdentity } from "./BookingMailingListNote-uWfR2kaG.mjs";
21
+ import { n as TerminalPanel, r as StateIcon, t as useDiscountCodeUi } from "./useDiscountCodeUi-klgfGn7f.mjs";
22
+ import { a as formatTime$1, i as formatDatePillParts, n as useAvailableDates, o as getRuntimeTimeZone, r as formatDate$1, t as useAvailableSlots } from "./useAvailableSlots-Dm3lKJKR.mjs";
23
+ import { c as storeDemoBookingPassIfAvailable } from "./demoPortalMagicLink-CWDGSTBu.mjs";
24
+ import { i as getDiscountApplyFeedback } from "./shop-discount-apply.state-D5CtGfJI.mjs";
23
25
  import React, { useCallback, useEffect, useLayoutEffect, useMemo, useReducer, useRef, useState } from "react";
24
26
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
25
27
  import { z } from "zod";
26
- //#region ../core/src/branded/entitlements.ts
27
- const unsafeAsPassId = (id) => id;
28
- const unsafeAsCustomerPassId = (id) => id;
29
- //#endregion
30
28
  //#region ../core/src/branded/communications.ts
31
29
  const unsafeAsFormId = (id) => id;
32
30
  //#endregion
31
+ //#region ../core/src/booking-payment-copy.ts
32
+ function siteDay(dueAt, context) {
33
+ const parsed = parseUtcIsoDateTimeString(dueAt);
34
+ return parsed.ok ? formatDate({
35
+ kind: "instant",
36
+ value: parsed.value
37
+ }, {
38
+ timeZone: context.siteTimezone,
39
+ locale: context.locale
40
+ }) : null;
41
+ }
42
+ /** Balance deadlines name their payable instant's site-local calendar day. */
43
+ function formatManagedBalanceDueText(dueAt, context) {
44
+ const date = dueAt === null ? null : siteDay(dueAt, context);
45
+ return date === null ? "Remaining balance due before the due date" : `Remaining balance due by ${date}`;
46
+ }
47
+ /** "£20.00 paid, £80.00 due by 5 Dec 2026", for a balance the client pays on the site later. */
48
+ function managedBalanceText(summary, context) {
49
+ const outstanding = formatCurrencyAmount(summary.amountOutstandingCents, summary.currency);
50
+ const date = summary.dueAt === null ? null : siteDay(summary.dueAt, context);
51
+ const due = date === null ? `${outstanding} still to pay` : `${outstanding} due by ${date}`;
52
+ return summary.amountPaidCents > 0 ? `${formatCurrencyAmount(summary.amountPaidCents, summary.currency)} paid, ${due}` : due;
53
+ }
54
+ /** Zero and unavailable counts do not describe credits consumed. */
55
+ function hasUsedPassCredits(credits) {
56
+ return credits !== void 0 && credits !== 0 && !Number.isNaN(credits);
57
+ }
58
+ /** Older stored emails have no balance; zero is a known balance, not missing data. */
59
+ function remainingPassCredits(summary) {
60
+ return summary.passCreditsRemaining === void 0 ? "" : ` (${summary.passCreditsRemaining} left)`;
61
+ }
62
+ function withDiscount(payment, text) {
63
+ if (payment?.discount === void 0) return text;
64
+ const discount = `Discount code ${payment.discount.code}: ${formatCurrencyAmount(payment.discount.savingCents, payment.discount.currency)} off`;
65
+ return text !== null && text.length > 0 ? `${text}. ${discount}` : discount;
66
+ }
67
+ function baseConfirmationEmailPaymentInfo(summary, context) {
68
+ if (summary === void 0) return null;
69
+ switch (summary.kind) {
70
+ case "free":
71
+ case "waived": return null;
72
+ case "manual_due": return `${formatCurrencyAmount(summary.amountDueCents, summary.currency)} to be paid directly`;
73
+ case "managed_balance_due": return managedBalanceText(summary, context);
74
+ case "pass":
75
+ if (!hasText(summary.passName)) return null;
76
+ return (hasUsedPassCredits(summary.passCreditsUsed) ? `${summary.passName} (${summary.passCreditsUsed} credit${summary.passCreditsUsed === 1 ? "" : "s"} used)` : summary.passName) + remainingPassCredits(summary);
77
+ case "membership": return `${summary.membershipName ?? "Membership"} membership`;
78
+ case "monetary":
79
+ if (summary.amountOutstandingCents == null || summary.amountOutstandingCents === 0) return formatCurrencyAmount(summary.amountPaidCents, summary.currency);
80
+ return `${formatCurrencyAmount(summary.amountPaidCents, summary.currency)} paid. ${formatCurrencyAmount(summary.amountOutstandingCents, summary.currency)} remaining${hasText(summary.dueAt) ? ` — ${formatManagedBalanceDueText(summary.dueAt, context)}` : ""}`;
81
+ }
82
+ return assertNever$1(summary);
83
+ }
84
+ /** How a paid booking was paid, as the customer shell's Payment row says it. */
85
+ function paidWith(method) {
86
+ switch (method) {
87
+ case "stripe": return "by card";
88
+ case "store_credit": return "with your account credit";
89
+ case "mixed": return "by card and account credit";
90
+ case "manual": return "";
91
+ }
92
+ }
93
+ /** What's owed outside the site, and what was paid already: nothing either way says arrival. */
94
+ function directBalance(summary) {
95
+ if (summary?.kind === "manual_due") return {
96
+ paidCents: 0,
97
+ owedCents: summary.amountDueCents,
98
+ currency: summary.currency
99
+ };
100
+ if (summary?.kind !== "monetary" || summary.paymentMethod !== "manual" || (summary.amountOutstandingCents ?? 0) === 0) return null;
101
+ return {
102
+ paidCents: summary.amountPaidCents,
103
+ owedCents: summary.amountOutstandingCents ?? 0,
104
+ currency: summary.currency
105
+ };
106
+ }
107
+ /** A balance agreed outside the system has no link or portal payment, so say who it goes to. */
108
+ function directBalanceSentence(summary, context) {
109
+ const balance = directBalance(summary);
110
+ if (balance === null) return null;
111
+ const owed = formatCurrencyAmount(balance.owedCents, balance.currency);
112
+ return `${balance.paidCents > 0 ? `${formatCurrencyAmount(balance.paidCents, balance.currency)} paid. ` : ""}${owed} to pay directly to ${hasText(context.siteTitle) ? context.siteTitle : "the business"}.${context.surface === "email" ? " If you have any questions, just reply to this email." : ""}`;
113
+ }
114
+ /** Customer payment copy shared by built-in confirmations, editable wording and the success page. */
115
+ function formatBookingPaymentSentence(summary, context) {
116
+ return withDiscount(summary, baseBookingPaymentSentence(summary, context));
117
+ }
118
+ function baseBookingPaymentSentence(summary, context) {
119
+ if (summary === void 0) return null;
120
+ const direct = directBalanceSentence(summary, context);
121
+ if (direct !== null) return direct;
122
+ switch (summary.kind) {
123
+ case "free": return "Free";
124
+ case "waived": return "Nothing to pay";
125
+ case "pass":
126
+ if (!hasText(summary.passName)) return null;
127
+ return `Paid with your ${summary.passName}${context.passNoun ? ` ${context.passNoun}` : ""}${remainingPassCredits(summary)}`;
128
+ case "membership": return hasText(summary.membershipName) ? `Included in your ${summary.membershipName} membership` : "Included in your membership";
129
+ case "monetary": return summary.amountOutstandingCents == null || summary.amountOutstandingCents === 0 ? `Paid ${formatCurrencyAmount(summary.amountPaidCents, summary.currency, { decimals: "auto" })}${paidWith(summary.paymentMethod) ? ` ${paidWith(summary.paymentMethod)}` : ""}` : baseConfirmationEmailPaymentInfo(summary, context);
130
+ case "manual_due": return null;
131
+ case "managed_balance_due": return managedBalanceText(summary, context);
132
+ }
133
+ return assertNever$1(summary);
134
+ }
135
+ //#endregion
33
136
  //#region ../blocks/src/system/runtime/nodes/booking-form.checkout-return-session.ts
34
137
  /** Each cancellation URL names its own browser-held session, even with several checkouts open. */
35
138
  function appointmentCheckoutCancelUrl(cancelUrl, returnKey) {
@@ -225,16 +328,106 @@ function resolveBookingFormDateDisplay(input) {
225
328
  };
226
329
  }
227
330
  //#endregion
331
+ //#region ../blocks/src/system/runtime/nodes/booking-form.admission.ts
332
+ const BOOKABLE = { kind: "bookable" };
333
+ const CHECKING = { kind: "checking" };
334
+ /**
335
+ * The one decision on whether a site without card payments can take this
336
+ * booking, from every way the client could pay: a request for approval pays
337
+ * nothing now; a per-session choice the site can take without a card (free,
338
+ * the free end of a sliding scale, or paid to the business directly); or a
339
+ * package the client already holds, including one held with a single team
340
+ * member. Nothing can be bought without cards, so a package purchase never
341
+ * counts.
342
+ *
343
+ * `payment` is the collection decision at the lowest price the client can
344
+ * choose (`resolveLowestBookingPaymentStep`), so what they've typed into a
345
+ * sliding scale doesn't change the answer.
346
+ */
347
+ function decideBookingAdmission(input) {
348
+ const { payment } = input;
349
+ const service = payment.service;
350
+ if (!service || service.requiresApproval || !needsCardTheSiteCantTake(service, payment)) return BOOKABLE;
351
+ const contact = (service.onlinePayments?.kind === "unavailable" ? service.onlinePayments.organiserContact : void 0) ?? null;
352
+ const refused = (message, recovery) => ({
353
+ kind: "refused",
354
+ message,
355
+ contact,
356
+ recovery
357
+ });
358
+ switch (input.heldPackages) {
359
+ case "some": return BOOKABLE;
360
+ case "checking": return CHECKING;
361
+ case "none": return refused(onlineBookingUnavailableMessage(input.businessName), "none");
362
+ case "signedOut": return refused(onlineBookingUnavailableMessage(input.businessName), "signIn");
363
+ case "unreadable": return refused(packagesUnreadableMessage(input.businessName), "retry");
364
+ }
365
+ }
366
+ /**
367
+ * Whether to ask a signed-out client to sign in and use a package. We can't see
368
+ * what they hold until they do, so it's offered whenever the service takes
369
+ * packages. A refusal already makes the same offer, so it isn't made twice.
370
+ */
371
+ function bookingOffersPackageSignIn(heldPackages, admission) {
372
+ return heldPackages === "signedOut" && admission.kind !== "refused";
373
+ }
374
+ function packagesUnreadableMessage(businessName) {
375
+ return `We couldn’t check your packages just now. Please try again, or contact ${businessName?.trim() || "the organiser"} to book.`;
376
+ }
377
+ /**
378
+ * Without a package of their own, the client would have to pay by card and the
379
+ * site can't take cards. A package-only service has nothing else to pay with;
380
+ * otherwise the collection decision says whether even its cheapest choice
381
+ * needs a card.
382
+ */
383
+ function needsCardTheSiteCantTake(service, payment) {
384
+ if (service.onlinePaymentChoices?.perSession === false) return service.onlinePayments?.kind === "unavailable";
385
+ return payment.kind === "unavailable" && payment.reason === "cardPaymentsUnavailable";
386
+ }
387
+ /**
388
+ * The client's own packages, from the eligibility read: those that pay for
389
+ * this booking as it stands, and, booking with anyone, the team members they
390
+ * hold packages with.
391
+ */
392
+ function summariseBookingHeldPackages(source, packages, heldWithTeamMembers) {
393
+ switch (source) {
394
+ case "disabled":
395
+ case "missing-priced-service": return "none";
396
+ case "missing-portal-auth": return "signedOut";
397
+ case "enabled": break;
398
+ }
399
+ switch (packages.tag) {
400
+ case "idle":
401
+ case "loading": return "checking";
402
+ case "loaded": return packages.value.length > 0 || heldWithTeamMembers.length > 0 ? "some" : "none";
403
+ case "error": return "unreadable";
404
+ }
405
+ }
406
+ //#endregion
228
407
  //#region ../blocks/src/system/runtime/nodes/booking-form.payment-confirmation.ts
229
408
  function resolveBookingPaymentConfirmationSummary(input) {
230
409
  const service = input.service;
231
- if (!service || input.hasSelectedAppointmentPackage || !Number.isFinite(input.priceAmount) || input.priceAmount <= 0 || !service.durationMinutes || !bookingPaymentNeedsCardConfirmation(input.paymentResolution)) return null;
232
- return {
410
+ if (!service || !service.durationMinutes || !Number.isFinite(input.priceAmount) || input.priceAmount <= 0) return null;
411
+ const base = {
233
412
  serviceTitle: service.title,
234
413
  durationMinutes: service.durationMinutes,
235
- priceAmount: input.priceAmount,
236
- priceCurrency: service.priceCurrency ?? service.pricing?.currency ?? "USD"
414
+ priceAmount: input.priceAmount
237
415
  };
416
+ switch (input.choice.kind) {
417
+ case "buy_package": return {
418
+ ...base,
419
+ kind: "buy_package",
420
+ packageName: input.choice.package.name,
421
+ priceCurrency: input.choice.package.currency
422
+ };
423
+ case "held_package": return null;
424
+ case "per_session":
425
+ case "unselected": return bookingPaymentNeedsCardConfirmation(input.paymentResolution) ? {
426
+ ...base,
427
+ kind: "per_session",
428
+ priceCurrency: service.priceCurrency ?? service.pricing?.currency ?? "USD"
429
+ } : null;
430
+ }
238
431
  }
239
432
  function bookingPaymentNeedsCardConfirmation(payment) {
240
433
  return payment.kind === "ready" && payment.choice.kind === "selected" && payment.choice.option.kind !== "deferred_manual";
@@ -633,7 +826,10 @@ function executeBookingSubmission$1(api, data, resumeSessionId) {
633
826
  bookingQuestions: data.bookingQuestions,
634
827
  mailingListOptIn: data.mailingListOptIn,
635
828
  timezone: data.timezone,
636
- ...data.kind === "package_purchase" ? { purchasePassId: data.purchasePassId } : {},
829
+ ...data.kind === "package_purchase" ? { purchase: {
830
+ kind: "pass",
831
+ productId: data.passProductId
832
+ } } : {},
637
833
  shownTerms: data.shownTerms,
638
834
  discountCode: data.discountCode,
639
835
  selectedSlidingAmount: data.selectedSlidingAmount,
@@ -1004,16 +1200,19 @@ function toBookingFormData(state) {
1004
1200
  }
1005
1201
  function buildBookingStepResolution(input) {
1006
1202
  const defaultServiceId = input.defaultServiceId ?? resolveDefaultBookingServiceId(input.form, input.services);
1007
- const paymentResolution = resolveBookingPaymentStep({
1203
+ const paymentInput = {
1008
1204
  data: input.data,
1009
1205
  nowIso: input.nowIso,
1010
1206
  timeZone: input.timeZone,
1011
1207
  services: input.services,
1012
1208
  defaultServiceId
1013
- });
1209
+ };
1210
+ const paymentResolution = resolveBookingPaymentStep(paymentInput);
1211
+ const lowestPaymentResolution = resolveLowestBookingPaymentStep(paymentInput);
1014
1212
  if (!input.form) return {
1015
1213
  steps: [],
1016
- paymentResolution
1214
+ paymentResolution,
1215
+ lowestPaymentResolution
1017
1216
  };
1018
1217
  const { needsServiceSelection, needsPayment, hasFields } = resolveBookingStepVisibility(input, defaultServiceId, paymentResolution);
1019
1218
  return {
@@ -1039,7 +1238,8 @@ function buildBookingStepResolution(input) {
1039
1238
  visible: hasFields
1040
1239
  }
1041
1240
  ],
1042
- paymentResolution
1241
+ paymentResolution,
1242
+ lowestPaymentResolution
1043
1243
  };
1044
1244
  }
1045
1245
  function resolveBookingStepVisibility(input, defaultServiceId, payment) {
@@ -1076,7 +1276,7 @@ function serviceSelectionMessage(input) {
1076
1276
  return input.data.serviceId ? null : "Please select a service";
1077
1277
  }
1078
1278
  function validateBookingStep(input) {
1079
- const refusal = input.questionsRefusal ?? null;
1279
+ const refusal = bookingRefusal(input);
1080
1280
  switch (input.stepId) {
1081
1281
  case "service-selection": return bookingStepValidationFromMessage(refusal ?? serviceSelectionMessage(input));
1082
1282
  case "datetime-selection": return bookingStepValidationFromMessage(refusal ?? (input.data.selectedSlot ? null : "Please select a date and time"));
@@ -1094,6 +1294,10 @@ function validateBookingStep(input) {
1094
1294
  default: return assertNever(input.stepId);
1095
1295
  }
1096
1296
  }
1297
+ /** Why the selected service can't be booked at all, if it can't. */
1298
+ function bookingRefusal(input) {
1299
+ return input.questionsRefusal ?? (input.admission?.kind === "refused" ? input.admission.message : null);
1300
+ }
1097
1301
  function bookingStepValidationFromMessage(message) {
1098
1302
  return message ? {
1099
1303
  ok: false,
@@ -1106,7 +1310,7 @@ function validateBookingPaymentStep(input) {
1106
1310
  const resolution = input.paymentResolution ?? resolveBookingPaymentStep(input);
1107
1311
  const slidingScale = getBookingServiceSlidingScale(resolution.service);
1108
1312
  if (slidingScale && !isBookingServiceSlidingAmountInRange(slidingScale, parseBookingCurrencyInputToCents(input.data.selectedSlidingAmountInput))) return bookingStepValidationFromMessage("Please choose an amount within the sliding scale");
1109
- if (resolution.kind === "unavailable") return bookingStepValidationFromMessage(resolution.errorMessage ?? "This service cannot be booked right now.");
1313
+ if (resolution.kind === "unavailable") return bookingStepValidationFromMessage(resolution.reason === "cardPaymentsUnavailable" ? "Please choose a payment option" : resolution.errorMessage);
1110
1314
  switch (resolution.kind) {
1111
1315
  case "not_required": return { ok: true };
1112
1316
  case "ready": return bookingStepValidationFromMessage(resolution.choice.kind === "selected" ? null : "Please choose a payment option");
@@ -1125,7 +1329,7 @@ function validateBookingField(field, value) {
1125
1329
  if (requiredError) return requiredError;
1126
1330
  if (isBlankFieldValue(value)) return null;
1127
1331
  const strValue = typeof value === "string" ? value : String(value);
1128
- if (field.type === "email") return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(strValue) ? null : "Please enter a valid email address";
1332
+ if (field.type === "email") return isEmailAddress(strValue) ? null : "Please enter a valid email address";
1129
1333
  if (field.type === "url") try {
1130
1334
  new URL(strValue);
1131
1335
  return null;
@@ -1157,12 +1361,18 @@ function validateRequiredBookingField(field, value) {
1157
1361
  }
1158
1362
  function deriveBookingFlowSteps(input) {
1159
1363
  const stepResolution = buildBookingStepResolution(input);
1364
+ const admission = decideBookingAdmission({
1365
+ payment: stepResolution.lowestPaymentResolution,
1366
+ heldPackages: input.heldPackages ?? "none",
1367
+ businessName: input.businessName
1368
+ });
1160
1369
  const stepPlan = stepResolution.steps.filter((step) => step.visible);
1161
1370
  const currentStepIndex = Math.max(0, stepPlan.findIndex((step) => step.id === input.currentStepId));
1162
1371
  const validations = new Map(stepPlan.map((step) => [step.id, validateBookingStep({
1163
1372
  ...input,
1164
1373
  stepId: step.id,
1165
- paymentResolution: stepResolution.paymentResolution
1374
+ paymentResolution: stepResolution.paymentResolution,
1375
+ admission
1166
1376
  })]));
1167
1377
  const attemptedStepIds = input.attemptedStepIds ?? {};
1168
1378
  const steps = stepPlan.map((step, index) => {
@@ -1185,6 +1395,7 @@ function deriveBookingFlowSteps(input) {
1185
1395
  currentStep: steps[currentStepIndex] ?? null,
1186
1396
  stepIds: steps.map((step) => step.id),
1187
1397
  paymentResolution: stepResolution.paymentResolution,
1398
+ admission,
1188
1399
  validations
1189
1400
  };
1190
1401
  }
@@ -1680,7 +1891,14 @@ function planBookingResourceAcceptance(input) {
1680
1891
  }] : [];
1681
1892
  }
1682
1893
  function planBookingPackageAcceptance(input) {
1683
- return input.state.selectedAppointmentPackageId && !input.packages.some((item) => item.customerPassId === input.state.selectedAppointmentPackageId) ? [{
1894
+ const { state, packages } = input;
1895
+ if (state.phase !== "editing" || state.packagePurchase.kind === "selected" || state.selectedCollectionOptionKind) return [];
1896
+ if (packages.some((item) => item.customerPassId === state.selectedAppointmentPackageId)) return [];
1897
+ const [first] = packages;
1898
+ return first ? [{
1899
+ type: "appointment-package-selected",
1900
+ packageId: unsafeAsCustomerPassId(first.customerPassId)
1901
+ }] : state.selectedAppointmentPackageId ? [{
1684
1902
  type: "appointment-package-selected",
1685
1903
  packageId: null
1686
1904
  }] : [];
@@ -1788,7 +2006,7 @@ function useBookingChoices(input) {
1788
2006
  });
1789
2007
  }, []);
1790
2008
  const resources = useBookingChoicesRequest(input.serviceId ?? null, loadResources, acceptResources, "Failed to load booking resources.");
1791
- const packagesResponse = useBookingPackageEligibility(input);
2009
+ const { state: packagesResponse, retry: retryPackages } = useBookingPackageEligibility(input);
1792
2010
  const purchasablePackages = useBookingChoicesRequest(bookingPackageRequestKey(input.canLoadPurchasablePackages, input.serviceId, input.selectedResourceId), loadPurchasablePackages, acceptPurchasablePackages, "Failed to load packages.");
1793
2011
  useEffect(() => {
1794
2012
  if (!input.canLoadPurchasablePackages) acceptPurchasablePackages([]);
@@ -1799,6 +2017,7 @@ function useBookingChoices(input) {
1799
2017
  tag: "loaded",
1800
2018
  value: packagesResponse.value.packages
1801
2019
  } : packagesResponse, [packagesResponse]),
2020
+ retryPackages,
1802
2021
  purchasablePackages,
1803
2022
  heldPackageTeamMembers: packagesResponse.tag === "loaded" && !input.selectedResourceId ? packagesResponse.value.heldPackageTeamMembers ?? [] : [],
1804
2023
  resourceFacts: input.serviceId && resources.tag === "loaded" ? {
@@ -1809,6 +2028,8 @@ function useBookingChoices(input) {
1809
2028
  }
1810
2029
  /** Unscoped eligibility resolves practitioner admission independently of the selected practitioner. */
1811
2030
  function useBookingPackageEligibility(input) {
2031
+ const [attempt, setAttempt] = useState(0);
2032
+ const retry = useCallback(() => setAttempt((previous) => previous + 1), []);
1812
2033
  const latest = useRef(input);
1813
2034
  useLayoutEffect(() => {
1814
2035
  latest.current = input;
@@ -1836,8 +2057,8 @@ function useBookingPackageEligibility(input) {
1836
2057
  });
1837
2058
  if (!current.selectedResourceId) accept(response);
1838
2059
  }, [accept]);
1839
- const any = useBookingChoicesRequest(bookingPackageRequestKey(input.canLoadPackages, input.serviceId, null), loadAny, acceptAny, "Could not check package credits.");
1840
- const scoped = useBookingChoicesRequest(bookingPackageRequestKey(input.canLoadPackages && !!input.selectedResourceId, input.serviceId, input.selectedResourceId), loadScoped, accept, "Could not check package credits.");
2060
+ const any = useBookingChoicesRequest(bookingPackageRequestKey(input.canLoadPackages, input.serviceId, null), loadAny, acceptAny, "Could not check package credits.", attempt);
2061
+ const scoped = useBookingChoicesRequest(bookingPackageRequestKey(input.canLoadPackages && !!input.selectedResourceId, input.serviceId, input.selectedResourceId), loadScoped, accept, "Could not check package credits.", attempt);
1841
2062
  useEffect(() => {
1842
2063
  if (!input.canLoadPackages) {
1843
2064
  accept(NO_PACKAGES);
@@ -1855,9 +2076,13 @@ function useBookingPackageEligibility(input) {
1855
2076
  any,
1856
2077
  accept
1857
2078
  ]);
1858
- return input.selectedResourceId ? scoped : any;
2079
+ return {
2080
+ state: input.selectedResourceId ? scoped : any,
2081
+ retry
2082
+ };
1859
2083
  }
1860
- function useBookingChoicesRequest(key, load, accept, errorMessage) {
2084
+ /** `attempt` asks again for the same key: a retry after a failed read. */
2085
+ function useBookingChoicesRequest(key, load, accept, errorMessage, attempt = 0) {
1861
2086
  const [receipt, setReceipt] = useState({
1862
2087
  key: null,
1863
2088
  state: { tag: "idle" }
@@ -1897,7 +2122,8 @@ function useBookingChoicesRequest(key, load, accept, errorMessage) {
1897
2122
  key,
1898
2123
  load,
1899
2124
  accept,
1900
- errorMessage
2125
+ errorMessage,
2126
+ attempt
1901
2127
  ]);
1902
2128
  return receipt.key === key ? receipt.state : key ? { tag: "loading" } : { tag: "idle" };
1903
2129
  }
@@ -2029,6 +2255,7 @@ function useBookingFlowController(input) {
2029
2255
  package: product
2030
2256
  });
2031
2257
  },
2258
+ retryPackages: () => latestRef.current.retryPackages(),
2032
2259
  next: async () => navigate("next"),
2033
2260
  back: () => {
2034
2261
  navigate("back");
@@ -2216,7 +2443,8 @@ function useManualDiscountPreview(input) {
2216
2443
  const apply = async () => {
2217
2444
  if (status.type === "applying") return;
2218
2445
  if (!input.code.trim()) return refuse(DISCOUNT_APPLY_MESSAGES.emptyCode);
2219
- if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(input.email.trim())) return refuse(DISCOUNT_APPLY_MESSAGES.emailRequired);
2446
+ const emailProblem = discountEmailProblem(input.email);
2447
+ if (emailProblem) return refuse(emailProblem);
2220
2448
  if (!input.lines.length) return refuse(DISCOUNT_APPLY_MESSAGES.unavailable);
2221
2449
  const pending = {
2222
2450
  key,
@@ -2379,6 +2607,17 @@ function useHeadlessBookingFlow(options) {
2379
2607
  state.selectedDate,
2380
2608
  availabilityTimeZone
2381
2609
  ]);
2610
+ const choices = useBookingChoices({
2611
+ api,
2612
+ serviceId: selectedServiceId,
2613
+ selectedResourceId: selectedResourceId ?? null,
2614
+ defaultResourceId,
2615
+ canLoadPackages: canLoadAppointmentPackages,
2616
+ canLoadPurchasablePackages,
2617
+ autoSelectSingleResource: options.shouldAutoSelectSingleResource !== false,
2618
+ dispatch
2619
+ });
2620
+ const heldPackages = summariseBookingHeldPackages(packageSources.held, choices.packages, choices.heldPackageTeamMembers);
2382
2621
  const stepState = useMemo(() => deriveBookingFlowSteps({
2383
2622
  form: runtimeForm,
2384
2623
  nowIso: bookingNowIso,
@@ -2393,9 +2632,13 @@ function useHeadlessBookingFlow(options) {
2393
2632
  requiresResourceSelection,
2394
2633
  enableAppointmentPackages: options.enableAppointmentPackages,
2395
2634
  attemptedStepIds: state.attemptedStepIds,
2396
- questionsRefusal
2635
+ questionsRefusal,
2636
+ businessName: options.siteName,
2637
+ heldPackages
2397
2638
  }), [
2398
2639
  questionsRefusal,
2640
+ options.siteName,
2641
+ heldPackages,
2399
2642
  options.dateContext.timeZone,
2400
2643
  data,
2401
2644
  bookingNowIso,
@@ -2469,16 +2712,6 @@ function useHeadlessBookingFlow(options) {
2469
2712
  state.touchedFields,
2470
2713
  state.validationErrors.fieldErrors
2471
2714
  ]);
2472
- const choices = useBookingChoices({
2473
- api,
2474
- serviceId: selectedServiceId,
2475
- selectedResourceId: selectedResourceId ?? null,
2476
- defaultResourceId,
2477
- canLoadPackages: canLoadAppointmentPackages,
2478
- canLoadPurchasablePackages,
2479
- autoSelectSingleResource: options.shouldAutoSelectSingleResource !== false,
2480
- dispatch
2481
- });
2482
2715
  const resourcesState = choices.resources;
2483
2716
  const appointmentPackages = choices.packages;
2484
2717
  const resources = resourcesState.tag === "loaded" ? resourcesState.value : [];
@@ -2570,6 +2803,7 @@ function useHeadlessBookingFlow(options) {
2570
2803
  mailingListEligible,
2571
2804
  bookingQuestions: questions,
2572
2805
  endSignInReturn: questions.endSignInReturn,
2806
+ retryPackages: choices.retryPackages,
2573
2807
  dispatch
2574
2808
  });
2575
2809
  const paymentResolution = stepState.paymentResolution;
@@ -2589,10 +2823,11 @@ function useHeadlessBookingFlow(options) {
2589
2823
  selectedService,
2590
2824
  state.selectedSlot?.startAt
2591
2825
  ]);
2826
+ const paymentChoice = resolveBookingPaymentChoice(state.packagePurchase, state.selectedAppointmentPackageId, packageOnly ? void 0 : selectedCollectionOptionKind);
2592
2827
  const paymentConfirmationSummary = resolveBookingPaymentConfirmationSummary({
2593
2828
  service: selectedService,
2594
- priceAmount: discountedPriceAmount(manualDiscount.discount, selectedAppointmentPriceAmount),
2595
- hasSelectedAppointmentPackage: Boolean(state.selectedAppointmentPackageId) || purchase.kind === "selected",
2829
+ priceAmount: discountedPriceAmount(manualDiscount.discount, paymentPriceAmount),
2830
+ choice: paymentChoice,
2596
2831
  paymentResolution
2597
2832
  });
2598
2833
  const availabilityDisplay = resolveBookingFormDateDisplay({
@@ -2621,9 +2856,10 @@ function useHeadlessBookingFlow(options) {
2621
2856
  });
2622
2857
  const purchasablePackages = resolveBookingPurchasablePackages(canLoadPurchasablePackages, choices.purchasablePackages);
2623
2858
  const packagePaymentModel = {
2624
- choice: resolveBookingPaymentChoice(state.packagePurchase, state.selectedAppointmentPackageId, packageOnly ? void 0 : selectedCollectionOptionKind),
2859
+ choice: paymentChoice,
2625
2860
  purchasablePackages,
2626
- availability: resolveBookingPaymentAvailability(!packageOnly && paymentResolution.kind !== "unavailable", appointmentPackagesModel, purchasablePackages)
2861
+ availability: resolveBookingPaymentAvailability(!packageOnly && paymentResolution.kind !== "unavailable", appointmentPackagesModel, purchasablePackages),
2862
+ packageSignInOffered: bookingOffersPackageSignIn(heldPackages, stepState.admission)
2627
2863
  };
2628
2864
  const payment = paymentResolution.kind === "unavailable" && packagePaymentModel.availability.kind === "no_choices" ? {
2629
2865
  ...packagePaymentModel,
@@ -2653,6 +2889,7 @@ function useHeadlessBookingFlow(options) {
2653
2889
  };
2654
2890
  return {
2655
2891
  review: state.review,
2892
+ admission: stepState.admission,
2656
2893
  dateContext: options.dateContext,
2657
2894
  paymentAnchorAt: bookingNowIso,
2658
2895
  siteTerms,
@@ -3149,16 +3386,35 @@ function formatBookingConfirmationDateTime(booking, includeSelection = false) {
3149
3386
  function BookingPaymentConfirmationText({ booking, summary }) {
3150
3387
  if (!summary) return null;
3151
3388
  const dateTime = formatBookingConfirmationDateTime(booking);
3389
+ const price = formatCurrencyAmount(summary.priceAmount, summary.priceCurrency, { decimals: "auto" });
3390
+ const when = dateTime ? ` · ${dateTime}` : "";
3391
+ if (summary.kind === "buy_package") return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("p", {
3392
+ className: "ab-text rb-on-surface--muted",
3393
+ children: [
3394
+ summary.serviceTitle,
3395
+ " · ",
3396
+ summary.durationMinutes,
3397
+ " min",
3398
+ when
3399
+ ]
3400
+ }), /* @__PURE__ */ jsxs("p", {
3401
+ className: "ab-text rb-on-surface--muted",
3402
+ children: [
3403
+ "Buying ",
3404
+ summary.packageName,
3405
+ " · ",
3406
+ price
3407
+ ]
3408
+ })] });
3152
3409
  return /* @__PURE__ */ jsxs("p", {
3153
3410
  className: "ab-text rb-on-surface--muted",
3154
3411
  children: [
3155
3412
  summary.serviceTitle,
3156
3413
  " · ",
3157
3414
  summary.durationMinutes,
3158
- " min ·",
3159
- " ",
3160
- formatCurrencyAmount(summary.priceAmount, summary.priceCurrency, { decimals: "auto" }),
3161
- dateTime ? ` · ${dateTime}` : ""
3415
+ " min · ",
3416
+ price,
3417
+ when
3162
3418
  ]
3163
3419
  });
3164
3420
  }
@@ -3171,11 +3427,12 @@ function BookingFormSubmitActions({ booking, onSubmit }) {
3171
3427
  const handlePrimaryAction = async () => {
3172
3428
  if ((await booking.actions.next()).ok && isLastStep) await onSubmit();
3173
3429
  };
3430
+ const refused = booking.admission.kind === "refused";
3174
3431
  return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(BookingSubmissionSummary, {
3175
3432
  booking,
3176
3433
  isLastStep,
3177
3434
  summary: paymentSummary
3178
- }), /* @__PURE__ */ jsxs("div", {
3435
+ }), !isFirstStep || !refused ? /* @__PURE__ */ jsxs("div", {
3179
3436
  className: "rb-wizard-actions",
3180
3437
  children: [!isFirstStep ? /* @__PURE__ */ jsx(ThemedButton, {
3181
3438
  type: "button",
@@ -3183,7 +3440,7 @@ function BookingFormSubmitActions({ booking, onSubmit }) {
3183
3440
  variant: "outline",
3184
3441
  size: "md",
3185
3442
  label: "Back"
3186
- }) : null, /* @__PURE__ */ jsx(ThemedButton, {
3443
+ }) : null, refused ? null : /* @__PURE__ */ jsx(ThemedButton, {
3187
3444
  type: "button",
3188
3445
  onClick: () => {
3189
3446
  handlePrimaryAction();
@@ -3197,7 +3454,7 @@ function BookingFormSubmitActions({ booking, onSubmit }) {
3197
3454
  srLabel: "Submitting"
3198
3455
  } : void 0
3199
3456
  })]
3200
- })] });
3457
+ }) : null] });
3201
3458
  }
3202
3459
  function reviewedActionLabel(review) {
3203
3460
  if (review.terms.dueNowCents > 0) return "Continue to payment";
@@ -3240,11 +3497,15 @@ function BookingOfferReview({ review, booking }) {
3240
3497
  });
3241
3498
  }
3242
3499
  function bookingPrimaryActionLabel(booking, isLastStep, summary) {
3243
- if (isLastStep && booking.services.selected?.requiresApproval) return "Send request";
3244
- if (isLastStep && booking.review) return reviewedActionLabel(booking.review);
3500
+ return isLastStep ? lastStepActionLabel(booking, summary) : resolvePrimaryActionLabel(false, Boolean(summary));
3501
+ }
3502
+ function lastStepActionLabel(booking, summary) {
3503
+ if (booking.services.selected?.requiresApproval) return "Send request";
3504
+ if (booking.review) return reviewedActionLabel(booking.review);
3505
+ if (summary?.kind === "buy_package") return resolvePrimaryActionLabel(true, true);
3245
3506
  const discount = booking.discount.preview?.discount;
3246
- if (isLastStep && discount) return discountedActionLabel(booking, discount);
3247
- return resolvePrimaryActionLabel(isLastStep, Boolean(summary));
3507
+ if (discount) return discountedActionLabel(booking, discount);
3508
+ return resolvePrimaryActionLabel(true, Boolean(summary));
3248
3509
  }
3249
3510
  function discountedActionLabel(booking, discount) {
3250
3511
  if (discount.totalAfterDiscountCents === 0) return "Confirm booking";
@@ -3783,6 +4044,7 @@ function HeadlessBookingDefaultForm({ booking, onSubmit, pageKind }) {
3783
4044
  labelAs: presentation.stepLabelAs
3784
4045
  }) : null,
3785
4046
  /* @__PURE__ */ jsx(DefaultQuestionsRefusal, { booking }),
4047
+ /* @__PURE__ */ jsx(DefaultAdmissionRefusal, { booking }),
3786
4048
  /* @__PURE__ */ jsx("div", {
3787
4049
  className: "step-content",
3788
4050
  children: /* @__PURE__ */ jsx(DefaultBookingStepContent, {
@@ -3791,7 +4053,7 @@ function HeadlessBookingDefaultForm({ booking, onSubmit, pageKind }) {
3791
4053
  presentation
3792
4054
  })
3793
4055
  }),
3794
- /* @__PURE__ */ jsx(DefaultBookingErrorSummary, {
4056
+ admissionRefused(booking) ? null : /* @__PURE__ */ jsx(DefaultBookingErrorSummary, {
3795
4057
  errors: currentStep.errors,
3796
4058
  id: errorSummaryId
3797
4059
  }),
@@ -3813,12 +4075,71 @@ function DefaultQuestionsRefusal({ booking }) {
3813
4075
  const presentation = booking.questions.presentation;
3814
4076
  if (presentation.kind !== "unavailable" || booking.currentStep?.id === "custom-fields") return null;
3815
4077
  return /* @__PURE__ */ jsx(FeedbackMessage, {
3816
- tone: "error",
3817
- className: "alert alert-error",
3818
- role: "alert",
4078
+ tone: "info",
4079
+ className: "alert alert-info rb-mb-4",
4080
+ role: "status",
3819
4081
  children: presentation.message
3820
4082
  });
3821
4083
  }
4084
+ /**
4085
+ * A booking the admission decision turns away: it needs a card payment the
4086
+ * site can't take, and the client has no package we know of to pay with. Say
4087
+ * so once, as soon as the service is chosen, with how to reach the business
4088
+ * and, while we don't know what packages they hold, a way to find out. On the
4089
+ * payment step the notice stands in place of the ways to pay instead.
4090
+ */
4091
+ function DefaultAdmissionRefusal({ booking }) {
4092
+ if (booking.currentStep?.id === "payment-selection") return null;
4093
+ return /* @__PURE__ */ jsx(AdmissionRefusalNotice, { booking });
4094
+ }
4095
+ function AdmissionRefusalNotice({ booking }) {
4096
+ const admission = booking.admission;
4097
+ if (admission.kind !== "refused") return null;
4098
+ return /* @__PURE__ */ jsx(FeedbackMessage, {
4099
+ tone: "info",
4100
+ className: "alert alert-info rb-mb-4",
4101
+ role: "status",
4102
+ children: /* @__PURE__ */ jsxs("div", {
4103
+ className: "rb-space-y-2",
4104
+ children: [
4105
+ /* @__PURE__ */ jsx("p", { children: admission.message }),
4106
+ admission.contact ? /* @__PURE__ */ jsx(OrganiserContactLine, { contact: admission.contact }) : null,
4107
+ admission.recovery === "signIn" ? /* @__PURE__ */ jsx(PackageSignInNotice, {
4108
+ booking,
4109
+ lead: "Already have a package?"
4110
+ }) : null,
4111
+ admission.recovery === "retry" ? /* @__PURE__ */ jsx(ThemedButton, {
4112
+ type: "button",
4113
+ variant: "secondary",
4114
+ size: "sm",
4115
+ label: "Try again",
4116
+ onClick: booking.actions.retryPackages
4117
+ }) : null
4118
+ ]
4119
+ })
4120
+ });
4121
+ }
4122
+ /** The offer to sign in so a package can pay, worded the way the event form offers a pass. */
4123
+ function PackageSignInNotice({ booking, lead }) {
4124
+ const email = booking.fields.values.email;
4125
+ return /* @__PURE__ */ jsx(SignInNotice, {
4126
+ lead,
4127
+ after: "to use it.",
4128
+ email: typeof email === "string" && email.trim() ? email.trim() : void 0,
4129
+ returnPath: booking.questions.signInReturnPath
4130
+ });
4131
+ }
4132
+ /** Signed out, we can't tell whether the client holds a package for this service, so we ask. */
4133
+ function OfferedPackageSignIn({ booking }) {
4134
+ return booking.payment.packageSignInOffered ? /* @__PURE__ */ jsx(PackageSignInNotice, {
4135
+ booking,
4136
+ lead: "Have a package?"
4137
+ }) : null;
4138
+ }
4139
+ /** Refused, nothing on the form leads anywhere but the notice and choosing another service. */
4140
+ function admissionRefused(booking) {
4141
+ return booking.admission.kind === "refused";
4142
+ }
3822
4143
  function DefaultBookingStepContent({ booking, errorSummaryId, presentation }) {
3823
4144
  const stepId = booking.currentStep?.id;
3824
4145
  if (!stepId) return null;
@@ -3840,12 +4161,19 @@ function DefaultBookingStepContent({ booking, errorSummaryId, presentation }) {
3840
4161
  default: return assertNever(stepId);
3841
4162
  }
3842
4163
  }
4164
+ /**
4165
+ * Ask who to see when there's a choice to make, refused or not: a package held
4166
+ * with one team member can reopen a refused booking once they're chosen.
4167
+ */
4168
+ function shouldChooseResource(booking) {
4169
+ return booking.resources.requiresSelection || booking.resources.items.length > 1;
4170
+ }
3843
4171
  function DefaultServiceSelectionStep({ booking, presentation }) {
3844
4172
  const services = booking.services.items;
3845
4173
  const resources = booking.resources.items;
3846
4174
  const selectedResourceId = booking.resources.selectedResourceId;
3847
4175
  const showServiceSelect = booking.services.requiresSelection || services.length > 1;
3848
- const showResourceSelect = booking.resources.requiresSelection || resources.length > 1;
4176
+ const showResourceSelect = shouldChooseResource(booking);
3849
4177
  const allowAnyResource = !booking.resources.requiresSelection;
3850
4178
  return /* @__PURE__ */ jsxs("div", {
3851
4179
  className: "rb-reg-stack",
@@ -4005,7 +4333,8 @@ function DefaultDateTimeSelectionStep({ booking, errorSummaryId, presentation })
4005
4333
  zoneNote: booking.availability.zoneNote,
4006
4334
  ariaDescribedBy: validationDescribedBy,
4007
4335
  ariaInvalid: hasValidationError
4008
- }) : null
4336
+ }) : null,
4337
+ /* @__PURE__ */ jsx(OfferedPackageSignIn, { booking })
4009
4338
  ]
4010
4339
  });
4011
4340
  }
@@ -4042,6 +4371,7 @@ function HeadlessBookingPaymentSelectionStep({ booking, presentation = bookingPr
4042
4371
  const service = booking.services.selected;
4043
4372
  const { perSessionOffered, perSessionOptions, otherRows, onlyOneWayToPay } = planPaymentStepChoices(booking);
4044
4373
  const unavailableMessage = paymentStepUnavailableMessage(booking);
4374
+ if (admissionRefused(booking)) return /* @__PURE__ */ jsx(AdmissionRefusalNotice, { booking });
4045
4375
  if (unavailableMessage !== null || !service) return /* @__PURE__ */ jsx(FeedbackMessage, {
4046
4376
  tone: "error",
4047
4377
  className: "alert alert-error",
@@ -4083,7 +4413,8 @@ function HeadlessBookingPaymentSelectionStep({ booking, presentation = bookingPr
4083
4413
  booking,
4084
4414
  serviceTitle: service.title,
4085
4415
  hasOtherChoices: otherRows.length > 0
4086
- })
4416
+ }),
4417
+ /* @__PURE__ */ jsx(OfferedPackageSignIn, { booking })
4087
4418
  ]
4088
4419
  });
4089
4420
  }
@@ -4136,6 +4467,10 @@ function HeldPackageStatus({ booking }) {
4136
4467
  function SlidingScaleField({ booking }) {
4137
4468
  const slidingScale = booking.payment.slidingScale;
4138
4469
  if (!slidingScale) return null;
4470
+ if (slidingScale.minAmount === slidingScale.maxAmount) return /* @__PURE__ */ jsx("p", {
4471
+ className: "ab-text",
4472
+ children: slidingScale.maxAmount === 0 ? "You can book this for free online." : `The price is ${formatBookingAmount(slidingScale.maxAmount, slidingScale.currency)}.`
4473
+ });
4139
4474
  return /* @__PURE__ */ jsxs("div", {
4140
4475
  className: "rb-space-y-2",
4141
4476
  children: [
@@ -4311,21 +4646,42 @@ function AppointmentDetails({ appointment, dateContext, resourceName, person })
4311
4646
  }),
4312
4647
  appointment.resourceName ? /* @__PURE__ */ jsx("p", { children: person.withName(appointment.resourceName) }) : null,
4313
4648
  appointment.location ? /* @__PURE__ */ jsx("p", { children: appointment.location }) : null,
4314
- appointment.paymentSummary?.discount ? /* @__PURE__ */ jsxs("p", { children: [
4315
- "Discount code ",
4316
- appointment.paymentSummary.discount.code,
4317
- ": ",
4318
- formatCommercePrice(appointment.paymentSummary.discount.savingCents, appointment.paymentSummary.discount.currency),
4319
- " off"
4320
- ] }) : null,
4321
- appointment.paymentSummary?.kind === "pass" ? /* @__PURE__ */ jsx("p", { children: formatCreditProductPayment({
4322
- name: appointment.paymentSummary.passName ?? "package",
4323
- creditsUsed: appointment.paymentSummary.passCreditsUsed,
4324
- creditsRemaining: appointment.paymentSummary.passCreditsRemaining
4325
- }) }) : null
4649
+ appointmentPaymentLines(appointment, dateContext).map((line) => /* @__PURE__ */ jsx("p", { children: line }, line))
4326
4650
  ]
4327
4651
  });
4328
4652
  }
4653
+ function discountLine(payment) {
4654
+ return payment.discount ? [`Discount code ${payment.discount.code}: ${formatCommercePrice(payment.discount.savingCents, payment.discount.currency)} off`] : [];
4655
+ }
4656
+ /**
4657
+ * What was paid, in the confirmation email's words ("Paid £40 by card"). Package and
4658
+ * free bookings keep their own lines: the credits used, and any discount code.
4659
+ */
4660
+ function appointmentPaymentLines(appointment, dateContext) {
4661
+ const payment = appointment.paymentSummary;
4662
+ if (!payment) return [];
4663
+ switch (payment.kind) {
4664
+ case "free": return discountLine(payment);
4665
+ case "pass": return [...discountLine(payment), formatCreditProductPayment({
4666
+ name: payment.passName ?? "package",
4667
+ creditsUsed: payment.passCreditsUsed,
4668
+ creditsRemaining: payment.passCreditsRemaining
4669
+ })];
4670
+ case "waived":
4671
+ case "membership":
4672
+ case "monetary":
4673
+ case "manual_due":
4674
+ case "managed_balance_due": {
4675
+ const sentence = formatBookingPaymentSentence(payment, {
4676
+ siteTimezone: dateContext?.timeZone ?? resolveBookingTimeZoneId(appointment.timezone),
4677
+ locale: dateContext?.locale ?? inferSiteDateLocale(appointment.timezone),
4678
+ siteTitle: null,
4679
+ surface: "page"
4680
+ });
4681
+ return sentence === null ? [] : [sentence];
4682
+ }
4683
+ }
4684
+ }
4329
4685
  function AppointmentDateTime({ appointment, dateContext }) {
4330
4686
  if (!dateContext) return null;
4331
4687
  const start = parseUtcIsoDateTimeString(appointment.startAt);