@riverbankcms/sdk 0.180.0 → 0.182.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 (232) hide show
  1. package/dist/_dts/{BlocksIslandsHydrator-DC_AvZwy.d.ts → BlocksIslandsHydrator-Bvw2bUif.d.ts} +1 -1
  2. package/dist/_dts/{Page-DQOxVtp3.d.ts → Page-B2EAT-bE.d.ts} +7 -7
  3. package/dist/_dts/{SdkPreviewMode-DrLgY9_f.d.ts → SdkPreviewMode-D0vww6rh.d.ts} +2 -2
  4. package/dist/_dts/{client-BP7VBRvs.d.ts → client-D6T430bk.d.ts} +56 -70
  5. package/dist/_dts/{content-types-1-K2qi__.d.ts → content-types-wZVWccC6.d.ts} +2 -2
  6. package/dist/_dts/{contracts-Dfqz0Tcu.d.ts → contracts-B-vtOcr8.d.ts} +3 -3
  7. package/dist/_dts/{generatePageMetadata-CSfAqmry.d.ts → generatePageMetadata-CxfwHE6z.d.ts} +2 -2
  8. package/dist/_dts/{index-BeM5Ylwf.d.ts → index-CEyYMhLJ.d.ts} +1 -2
  9. package/dist/_dts/{index-DQr358-m.d.ts → index-CQrb3Ccc.d.ts} +8 -8
  10. package/dist/_dts/{index-DCcxLa8p.d.ts → index-CciRW_w1.d.ts} +2 -2
  11. package/dist/_dts/{index-Blrw2oVk.d.ts → index-Cqxis-nv.d.ts} +1 -1
  12. package/dist/_dts/{index-CB5Csefo.d.ts → index-DIU-wL1M.d.ts} +2 -2
  13. package/dist/_dts/{index-DQBGwBPx.d.ts → index-DqPKdeTk.d.ts} +1 -1
  14. package/dist/_dts/{loadContent-BG2tLGXj.d.ts → loadContent-D0wrxiSp.d.ts} +7 -7
  15. package/dist/_dts/{request-P08l6mkr.d.ts → request-DEwxUSw8.d.ts} +2375 -883
  16. package/dist/_dts/{resolveBlockData-BDHc8lFs.d.ts → resolveBlockData-VaG_MYbN.d.ts} +5 -5
  17. package/dist/_dts/{resolvePageContent-Y3IZBbtL.d.ts → resolvePageContent-DTwklC_v.d.ts} +1 -1
  18. package/dist/_dts/sdk/src/bookings/index.d.ts +2 -2
  19. package/dist/_dts/sdk/src/client/types.d.ts +2 -2
  20. package/dist/_dts/sdk/src/client.d.ts +7 -7
  21. package/dist/_dts/sdk/src/config/index.d.ts +6 -6
  22. package/dist/_dts/sdk/src/config/template-validation.d.ts +1 -1
  23. package/dist/_dts/sdk/src/config/validation.d.ts +1 -1
  24. package/dist/_dts/sdk/src/data/dataLoaderContext.d.ts +2 -2
  25. package/dist/_dts/sdk/src/data/resolveBlockData.d.ts +1 -1
  26. package/dist/_dts/sdk/src/data/types.d.ts +2 -2
  27. package/dist/_dts/sdk/src/gifting/client.d.ts +1 -2
  28. package/dist/_dts/sdk/src/index.d.ts +104 -8
  29. package/dist/_dts/sdk/src/manifest/index.d.ts +3 -3
  30. package/dist/_dts/sdk/src/metadata/index.d.ts +1 -1
  31. package/dist/_dts/sdk/src/navigation/index.d.ts +3 -3
  32. package/dist/_dts/sdk/src/next/index.d.ts +83 -52
  33. package/dist/_dts/sdk/src/next/middleware.d.ts +2 -2
  34. package/dist/_dts/sdk/src/page-converter/index.d.ts +3 -3
  35. package/dist/_dts/sdk/src/portal/client.d.ts +43 -56
  36. package/dist/_dts/sdk/src/portal/index.d.ts +3 -18
  37. package/dist/_dts/sdk/src/prebuild/index.d.ts +1 -1
  38. package/dist/_dts/sdk/src/preview-next/before-render.d.ts +2 -2
  39. package/dist/_dts/sdk/src/preview-next/client/index.d.ts +2 -2
  40. package/dist/_dts/sdk/src/preview-next/client/runtime.d.ts +1 -1
  41. package/dist/_dts/sdk/src/rendering/client.d.ts +2 -2
  42. package/dist/_dts/sdk/src/rendering/components/pageShared.d.ts +1 -1
  43. package/dist/_dts/sdk/src/rendering/helpers/loadPage.d.ts +1 -1
  44. package/dist/_dts/sdk/src/rendering/helpers/pageRuntimeSupport.d.ts +4 -4
  45. package/dist/_dts/sdk/src/rendering/index.d.ts +6 -6
  46. package/dist/_dts/sdk/src/rendering/islands/client.d.ts +1 -1
  47. package/dist/_dts/sdk/src/rendering/server.d.ts +2 -2
  48. package/dist/_dts/sdk/src/rendering/themeAdmission.d.ts +1 -1
  49. package/dist/_dts/sdk/src/routing/index.d.ts +6 -6
  50. package/dist/_dts/sdk/src/server.d.ts +5 -5
  51. package/dist/_dts/sdk/src/spam-protection/index.d.ts +2 -2
  52. package/dist/_dts/sdk/src/theme/index.d.ts +1 -1
  53. package/dist/_dts/{serviceBookingOutline-BvtNagjw.d.ts → serviceBookingOutline-DtQuFlID.d.ts} +6 -6
  54. package/dist/_dts/{types-DpEAnP4F.d.ts → types-B3RjeBLV.d.ts} +2 -2
  55. package/dist/_dts/{types-HAy1-Jjo.d.ts → types-BvUSGQrw.d.ts} +3 -3
  56. package/dist/_dts/{types-BrK6SS5c.d.ts → types-CkRFtBqd.d.ts} +7 -7
  57. package/dist/_dts/{validation-D6q3tOBA.d.ts → validation-BZA3DhcV.d.ts} +4 -4
  58. package/dist/client/{BlocksIslandsHydrator-DJSmdNUJ.mjs → BlocksIslandsHydrator-CQMf0HdN.mjs} +19 -19
  59. package/dist/client/{BookingMailingListNote-CGxg37zx.mjs → BookingMailingListNote-7kdvuPow.mjs} +93 -18
  60. package/dist/client/{BookingQuestionFields-DXegGSnS.mjs → BookingQuestionFields-BJI7mZuV.mjs} +7 -87
  61. package/dist/client/CalendarAction-D_Glwvz2.mjs +105 -0
  62. package/dist/client/{CalendarNavigationChevron-VfP50sYm.mjs → CalendarNavigationChevron-DPUD6wjy.mjs} +8 -8
  63. package/dist/client/{CheckboxChoice-BZPLCgTU.mjs → CheckboxChoice-C8i4NraK.mjs} +1 -1
  64. package/dist/client/{DemoBookingPortalAccess-0Ua44F1j.mjs → DemoBookingPortalAccess-8kwNF9HN.mjs} +9 -6
  65. package/dist/client/{EventCalendar.client-CrpiyDSP.mjs → EventCalendar.client-Dhb14bcC.mjs} +10 -10
  66. package/dist/client/{EventCombined.client-D0me9wnz.mjs → EventCombined.client-C1jEZBN9.mjs} +60 -10
  67. package/dist/client/{EventEmbeddedCheckoutStep-BDnicDM6.mjs → EventEmbeddedCheckoutStep-BGkbUhuw.mjs} +1 -1
  68. package/dist/client/{EventItem-CJITrGkF.mjs → EventItem-Bb0ppG2N.mjs} +9 -177
  69. package/dist/client/{EventListWeekNavigation-BlEm_xjq.mjs → EventListWeekNavigation-DMryCaNV.mjs} +1 -1
  70. package/dist/client/{EventListing.client-BNM_HuS0.mjs → EventListing.client-BuH5kKA3.mjs} +3 -3
  71. package/dist/client/{EventListing.view-CXfb7RRy.mjs → EventListing.view-DsqvuulZ.mjs} +8 -8
  72. package/dist/client/{EventRegistrationPayment-DiD9uYs6.mjs → EventRegistrationPayment-D4FvQSFF.mjs} +555 -502
  73. package/dist/client/{Page-bX7iy_MK.mjs → Page-sV6BJkXX.mjs} +550 -339
  74. package/dist/client/{ProtectedSubmitButton-De6AzhE6.mjs → ProtectedSubmitButton-BNnKuir8.mjs} +1 -1
  75. package/dist/client/{SiteTermsAgreementField-BAdW5DvE.mjs → SiteTermsAgreementField-VfSd6JU-.mjs} +7 -11
  76. package/dist/client/{StepIndicator-DCfdcb7s.mjs → StepIndicator-B6o5B7g3.mjs} +1 -1
  77. package/dist/client/{StepIndicator-DCqorVne.mjs → StepIndicator-BTqO7cJl.mjs} +235 -26
  78. package/dist/client/{ThemedButton-CnSa7o-I.mjs → ThemedButton-PFOhXktM.mjs} +1 -33
  79. package/dist/client/{accessibleSurfaces-Wl8-_OVJ.mjs → accessibleSurfaces-BogaGutk.mjs} +983 -634
  80. package/dist/client/{accordion-wofJY8xY.mjs → accordion-6cuswD_s.mjs} +1 -1
  81. package/dist/client/{booking-form.client-CYl9NrqS.mjs → booking-form.client-BOMe_SKi.mjs} +52 -29
  82. package/dist/client/bookingCalendar--aWnqFDn.mjs +180 -0
  83. package/dist/client/{bookingForm-kgVWtuMe.mjs → bookingForm-DSCH-VHo.mjs} +4 -4
  84. package/dist/client/bookings.mjs +17 -11
  85. package/dist/client/{boxStyleClassNames-CQHWz5gJ.mjs → boxStyleClassNames-BFuqZCfz.mjs} +2 -2
  86. package/dist/client/{carousel-BE1dEFsD.mjs → carousel-CGyQVV1M.mjs} +2 -2
  87. package/dist/client/{carousel.client-DMtGYTTM.mjs → carousel.client-BtLwHefX.mjs} +1 -1
  88. package/dist/client/{cart-BsjsdGZE.mjs → cart-BYOe7MCh.mjs} +3 -3
  89. package/dist/client/{cart.client-DylGUWXY.mjs → cart.client-BKFkaXdV.mjs} +1 -1
  90. package/dist/client/{checkout-B5KxEUDr.mjs → checkout-Dwd7Di77.mjs} +3 -3
  91. package/dist/client/{checkout.client-C98fhch3.mjs → checkout.client-C25hpi-z.mjs} +1 -1
  92. package/dist/client/{checkoutUrls-BMLYTf38.mjs → checkoutUrls-tG788sw0.mjs} +1 -1
  93. package/dist/client/client.mjs +106 -43
  94. package/dist/client/{constants-PfYJsEZF.mjs → constants-DdxFG3Ic.mjs} +1 -2
  95. package/dist/client/{context-DtKdUdkO.mjs → context-Hi1RuYEM.mjs} +753 -373
  96. package/dist/client/{dateFormatting-BaGPvQS3.mjs → dateFormatting-C8vBCHuo.mjs} +15 -25
  97. package/dist/client/{demoPortalMagicLink-B8eDjhuG.mjs → demoPortalMagicLink-BAL5UIDG.mjs} +2 -3
  98. package/dist/client/{enhanceHeaderSection-DvhD-8eE.mjs → enhanceHeaderSection-Dv1Lr9kJ.mjs} +4 -5
  99. package/dist/client/{event-registration.client-Du9a_xAN.mjs → event-registration.client-dB_Z7bb-.mjs} +191 -210
  100. package/dist/client/{eventCalendar-Di9wDfzl.mjs → eventCalendar-CQnRA4Ww.mjs} +4 -4
  101. package/dist/client/{eventCombined-CNW6nBsB.mjs → eventCombined-BDOG1hVp.mjs} +4 -4
  102. package/dist/client/{eventListing-CQMxQ8By.mjs → eventListing-DSVmhy9n.mjs} +4 -4
  103. package/dist/client/{eventRegistration-CprS9k1D.mjs → eventRegistration-CD5mRtEH.mjs} +4 -4
  104. package/dist/client/{form-Zl1_8RJ6.mjs → form-DWnlEVSK.mjs} +3 -3
  105. package/dist/client/{form.client-TaMUys6I.mjs → form.client-D7zmeqNI.mjs} +5 -5
  106. package/dist/client/{form.parts-CpNPbPPM.mjs → form.parts-C-G6N_MK.mjs} +3 -3
  107. package/dist/client/gifting/client.mjs +32 -29
  108. package/dist/client/{gifting-DNVa7-Wj.mjs → gifting-Cn0jidP5.mjs} +4 -4
  109. package/dist/client/{gifting.client-CFUq3GVx.mjs → gifting.client-DVo1YFLs.mjs} +5 -5
  110. package/dist/client/{gifting.parts-CDQvxA4A.mjs → gifting.parts-Bak93gD2.mjs} +2 -2
  111. package/dist/client/{headerSection-Cg6083rn.mjs → headerSection-DjQuj_6v.mjs} +2 -2
  112. package/dist/client/{mediaAssets-B99AP7ai.mjs → mediaAssets-COfQolI3.mjs} +1 -1
  113. package/dist/client/{mediaContext-Fusweriw.mjs → mediaContext-DzvnjYXm.mjs} +1 -1
  114. package/dist/client/{newsletter-form.client-VuL9I96G.mjs → newsletter-form.client-rIYPziZC.mjs} +7 -7
  115. package/dist/client/{newsletter-form.interactive-7Of3eYn0.mjs → newsletter-form.interactive-DVt3enLr.mjs} +181 -155
  116. package/dist/client/{newsletter-form.parts-OBqsfT24.mjs → newsletter-form.parts-CH6dGfdn.mjs} +2 -2
  117. package/dist/client/{newsletterForm-BkJe_RTv.mjs → newsletterForm-Cg8cBDHd.mjs} +3 -3
  118. package/dist/client/{lookSurfaces-gJ3OqPf9.mjs → noop-jesvJXEE.mjs} +403 -275
  119. package/dist/client/portal/client.mjs +12202 -7166
  120. package/dist/client/portalOrders-oEoTvzkW.mjs +596 -0
  121. package/dist/client/portalRoutes-ByyVZfVq.mjs +873 -0
  122. package/dist/client/{product-detail.client-B2hdxqJN.mjs → product-detail.client-5aHq-vuu.mjs} +1 -1
  123. package/dist/client/{product-list.client-CCEgu9rx.mjs → product-list.client-CyAk5rnC.mjs} +1 -1
  124. package/dist/client/{productDetail-CRX_ZRfS.mjs → productDetail-B8aZ2mqY.mjs} +3 -3
  125. package/dist/client/{productList-BAdJ6z5S.mjs → productList-BuLemmod.mjs} +3 -3
  126. package/dist/client/{propsDecoder-BLKAmX0S.mjs → propsDecoder-0Unsqn3R.mjs} +2 -2
  127. package/dist/client/{registry.server-Bj9cmHHF.mjs → registry.server-DzvtVVD0.mjs} +664 -434
  128. package/dist/client/{renderableMediaAssetAdmission-BlfqYLJW.mjs → renderableMediaAssetAdmission-BsOWd9lf.mjs} +1 -1
  129. package/dist/client/rendering/client.mjs +26 -26
  130. package/dist/client/rendering/islands.mjs +1 -1
  131. package/dist/client/rendering.mjs +16 -8
  132. package/dist/client/{richText-coerce-Z45OLLEX.mjs → richText-coerce-Bnng7JFA.mjs} +2 -1
  133. package/dist/client/{routeIslandApiConfig-DHpTTK77.mjs → routeIslandApiConfig-BGfcc9sk.mjs} +1 -1
  134. package/dist/client/{runtimeResponse-DtWSfWSZ.mjs → runtimeResponse-DAPVRToN.mjs} +1 -1
  135. package/dist/client/{runtimeResponse-D2j2-mOk.mjs → runtimeResponse-nXT8VAMl.mjs} +1 -1
  136. package/dist/client/{shop-BKsgxm_-.mjs → shop-GuMqnDL-.mjs} +3 -3
  137. package/dist/client/{shop-commerce-Cbtk_kUW.mjs → shop-commerce-D5bDY1o1.mjs} +53 -16
  138. package/dist/client/{shop-commerce-store-B-rv2p5h.mjs → shop-commerce-store-B7sHnLwI.mjs} +22 -5
  139. package/dist/client/{shop-discount-apply.state-CiCDLNh7.mjs → shop-discount-apply.state-Dos2zdC2.mjs} +2 -2
  140. package/dist/client/{shop.client-Rnqa74Tk.mjs → shop.client-uvj5GDZb.mjs} +17 -39
  141. package/dist/client/{shopShared-BaBfhjCq.mjs → shopShared-3giNWE3H.mjs} +2 -2
  142. package/dist/client/spam-protection.mjs +1 -1
  143. package/dist/client/src-Al4ooTl_.mjs +164 -0
  144. package/dist/client/{src-o7WEvbK1.mjs → src-CmXh3JWs.mjs} +233 -91
  145. package/dist/client/{timetableModel-BOff1Kk5.mjs → timetableModel-GA-hn1qM.mjs} +11 -87
  146. package/dist/client/{shop-add-feedback-DvC2kP1K.mjs → urlParams-C2QHo1Pa.mjs} +1 -42
  147. package/dist/client/{useAvailableSlots-DQJNh10g.mjs → useAvailableSlots-CBneCxbG.mjs} +2 -3
  148. package/dist/client/{useDiscountCodeUi-BcFQRI_7.mjs → useDiscountCodeUi-D0kGF0C7.mjs} +1 -1
  149. package/dist/client/{useEventPagination-BvdcexDC.mjs → useEventPagination-xX8n_Tuu.mjs} +8 -8
  150. package/dist/client/{view-CTBwSpKv.mjs → view-DOyZc-DF.mjs} +4 -4
  151. package/dist/client/{wizardSteps-CWIQyRIw.mjs → wizardSteps-B952ify5.mjs} +1241 -295
  152. package/dist/preview-next/client/{PageSectionToolbar-CG6KwITA.mjs → PageSectionToolbar-BI3UCdpu.mjs} +3 -3
  153. package/dist/preview-next/client/{PreviewEditorSidebar-BGBqrC9m.mjs → PreviewEditorSidebar-jkfLVOgY.mjs} +12 -9
  154. package/dist/preview-next/client/{PreviewEditorUI-Bwkyx28x.mjs → PreviewEditorUI-DwJQs4hM.mjs} +4 -4
  155. package/dist/preview-next/client/{PreviewShell-DB1l6JNU.mjs → PreviewShell-BAxAkuz8.mjs} +5 -5
  156. package/dist/preview-next/client/{SdkPreviewModeRuntime-Bs6Cwzr3.mjs → SdkPreviewModeRuntime-0UVB-39f.mjs} +68 -17
  157. package/dist/preview-next/client/{previewAssistantSlot-T-oDD_Dd.mjs → previewAssistantSlot-BgiYk3PB.mjs} +7347 -3516
  158. package/dist/preview-next/client/{previewChromeRoot-BeukcDRy.mjs → previewChromeRoot-tieNdF3E.mjs} +1 -1
  159. package/dist/preview-next/client/runtime.mjs +3 -3
  160. package/dist/preview-next/client/{sdk-runtime-ceDW_9q2.mjs → sdk-runtime-DXb_Evl0.mjs} +2 -2
  161. package/dist/preview-next/client/{siteStyleAccess-CCB9bScO.mjs → siteStyleAccess-BlN0jt2c.mjs} +3 -3
  162. package/dist/preview-next/client/{useAutosaveStatus-D4o0CKq7.mjs → useAutosaveStatus-BUEPA4oL.mjs} +1 -1
  163. package/dist/preview-next/client/{useOpenBlockForSetup-Seccrvwu.mjs → useOpenBlockForSetup-BVfr5P--.mjs} +1 -1
  164. package/dist/preview-next/container-responsive.css +203 -174
  165. package/dist/preview-next/keepAlive.mjs +1 -1
  166. package/dist/preview-next/middleware.mjs +1 -1
  167. package/dist/preview-next/{route-contract-FwFj8zGL.mjs → route-contract-BHTBA48n.mjs} +90 -37
  168. package/dist/server/{Block.shared-D6WrRCxX.mjs → Block.shared-hGoyEdjJ.mjs} +5 -5
  169. package/dist/server/{ThemeScopeCore-BQzjDQ2q.mjs → ThemeScopeCore-BfUCTOwj.mjs} +160 -142
  170. package/dist/server/{accessibleSurfaces-CM3QANtw.mjs → accessibleSurfaces-Dskni4Xj.mjs} +94 -330
  171. package/dist/server/accordions-By_0Ykks.mjs +111 -0
  172. package/dist/server/{bindings-CS6ih1Yc.mjs → bindings-DMJH4bvo.mjs} +7 -7
  173. package/dist/server/{client-m0ylCj_f.mjs → client-DrwlRNAH.mjs} +105 -42
  174. package/dist/server/config-validation.mjs +1 -1
  175. package/dist/server/config.mjs +2 -2
  176. package/dist/server/constants-CeMywaiD.mjs +1485 -0
  177. package/dist/server/{customCss-BZ8YSrQg.mjs → customCss-C9kgPHvr.mjs} +41 -5
  178. package/dist/server/data/resolveBlockData.mjs +1 -1
  179. package/dist/server/{resolveButtonColourStates--6yJp9Tq.mjs → expandPalette-ehuW8r2g.mjs} +745 -1229
  180. package/dist/server/index.mjs +3 -3
  181. package/dist/server/{loadContent-vgWMz1uD.mjs → loadContent-D0prFflT.mjs} +5 -4
  182. package/dist/server/{loadPage-CIOL3-9t.mjs → loadPage-CBLke9pJ.mjs} +3 -3
  183. package/dist/server/{lookMediaFrame-m-91jGGn.mjs → lookMediaFrame-H0fi4bJk.mjs} +38 -18
  184. package/dist/server/manifest.mjs +36 -25
  185. package/dist/server/{mapLocation-BM5WX7FY.mjs → mapLocation-MDDSubTp.mjs} +1 -1
  186. package/dist/server/media-BRmYrnzb.mjs +31 -0
  187. package/dist/server/{media-luf7RF22.mjs → media-gvfIw3z8.mjs} +2 -31
  188. package/dist/server/{navigation-BcNfYYuu.mjs → navigation-wrcuWmgp.mjs} +2 -2
  189. package/dist/server/navigation.mjs +1 -1
  190. package/dist/server/next.mjs +134 -81
  191. package/dist/server/{overrideResolution-BiHmsvTZ.mjs → overrideResolution-DUgCEH8z.mjs} +1 -1
  192. package/dist/server/page-converter.mjs +3 -3
  193. package/dist/server/{pageRenderPlan-DJo_obpi.mjs → pageRenderPlan-BHrmogsW.mjs} +165 -247
  194. package/dist/server/{pageRuntimeSupport-BnSuoHON.mjs → pageRuntimeSupport-D2-YMRei.mjs} +5 -5
  195. package/dist/server/{pageShared-BJuOzxzn.mjs → pageShared-CG8O31Eo.mjs} +3402 -3249
  196. package/dist/server/{parseThemeForPersistence-DOsfofCy.mjs → parseThemeForPersistence-CrPlbJEN.mjs} +3 -2
  197. package/dist/server/{portal-B4JVkdjc.mjs → portal-pG_uhsI2.mjs} +62 -46
  198. package/dist/server/portal.mjs +3 -3
  199. package/dist/server/portalQuestions-oUyohgL9.mjs +225 -0
  200. package/dist/server/{prebuild-Cr8p8T7V.mjs → prebuild-C8Amvzce.mjs} +1 -1
  201. package/dist/server/prebuild.mjs +1 -1
  202. package/dist/server/{prefetchBlockData-BZh57-ua.mjs → prefetchBlockData-BxUETRIZ.mjs} +4 -3
  203. package/dist/server/{registry-CvhFwbXJ.mjs → registry-Cc88-23f.mjs} +1514 -1190
  204. package/dist/server/rendering/components/pageShared.mjs +1 -1
  205. package/dist/server/rendering/helpers/loadPage.mjs +1 -1
  206. package/dist/server/rendering/helpers/pageRuntimeSupport.mjs +1 -1
  207. package/dist/server/rendering/server.mjs +4 -4
  208. package/dist/server/rendering.mjs +10 -9
  209. package/dist/server/{resolveBlockData-Cv_W1LVB.mjs → resolveBlockData-OG3KOkig.mjs} +2 -2
  210. package/dist/server/{responseMedia-KRKguBC5.mjs → responseMedia-IfH65QAH.mjs} +1 -1
  211. package/dist/server/{schema-BpsqaSSU.mjs → schema-CwfxQjc4.mjs} +10 -113
  212. package/dist/server/server.mjs +3 -3
  213. package/dist/server/{servicePageContent-CRKbTm_7.mjs → servicePageContent-BcFuhhD7.mjs} +22 -21
  214. package/dist/server/theme-bridge.mjs +34 -8
  215. package/dist/server/theme.mjs +2 -2
  216. package/dist/server/{three-pass-converter-39SXCCnh.mjs → three-pass-converter-DPaUPTfl.mjs} +34 -16
  217. package/dist/server/titleSourceSchema-NhK6azFS.mjs +2018 -0
  218. package/dist/server/typeGuards-CTW_9AXq.mjs +413 -0
  219. package/dist/server/types-BKaBZFjD.mjs +1085 -0
  220. package/dist/server/{validation-DCl-FCk_.mjs → validation-BovmbS8N.mjs} +70 -17
  221. package/dist/server/{version-DT_R5JAR.mjs → version-hws4hgyX.mjs} +1 -1
  222. package/dist/server/video-Cdr3wh-q.mjs +272 -0
  223. package/dist/styles/index.css +1098 -1885
  224. package/package.json +2 -1
  225. package/dist/_dts/index-B0_2-65A.d.ts +0 -101
  226. package/dist/client/TabBarFragment-DlKQRhP4.mjs +0 -56
  227. package/dist/client/checkoutRoute-DKlZRNZD.mjs +0 -22
  228. package/dist/client/creditProducts-BQ1t1erI.mjs +0 -266
  229. package/dist/client/formatDate-hhI1-tzt.mjs +0 -26
  230. package/dist/server/constants-Cj7hfbrA.mjs +0 -41
  231. package/dist/server/richTextSchema-QLaQrbII.mjs +0 -212
  232. package/dist/server/titleSourceSchema-Cu-3PRvv.mjs +0 -122
@@ -1,18 +1,19 @@
1
1
  "use client";
2
- import { f as err, p as ok } from "./renderableMediaAssetAdmission-BlfqYLJW.mjs";
3
- import { $ as withOfferedEvent, $o as decideSelectionAttendance, A as visitorHoldsOwnPlace, At as eventSignInRestoration, B as calculateEventRegistrationPreviewTotal, Bi as toBookingQuestionsPaymentSnapshot, Bt as withoutKeptAnswers, Cn as selectionCombinationHint, Cr as formatCommercePrice, Ct as getRegistrationStartAt, D as resolveRegistrationTicketContinuation, Da as leavePage, Dn as findSelectedTicketType, Dt as EVENT_SIGN_IN_FORM_ID, En as serverPricedTotalCents, Et as toWholeSeriesRegistrationEvents, Ft as deriveRunRequirements, Gn as getTicketSelectionRemainingPlaces, Gt as decideSelectionPayment, Hi as formatPrice, Hn as getRegistrationOccurrenceId, Hr as resolveEventRegistrationChoices, Ii as deriveBookingQuestions, In as getVisibleTicketTypes, It as nextRunToRead, J as restorableBrowserDraftCode, Jn as shouldLoadRegistrationOptions, Jt as planSelectionPrice, K as registrationBrowserDraft, Kn as parseCurrencyInputToCents, Kt as effectiveSelection, Li as needsBookingQuestionsRefresh, Lr as closedDatesCopy, Lt as runFieldErrors, Mt as buildSelectionRequirementsSubmission, Nn as getImplicitSingleTicketType, Nt as checkRunRequirements, On as formatBookingWhen, Ot as eventSignInDraftStore, P as resolveEventRegistrationSubmitPlan, Pn as getPortalSubjectEmail, Pt as decideSelectionRequirementsLayout, Q as invitationBooking, Rn as transformRegistrationOptionsResponse, Rr as closedRunCopy, Rt as runsKeepingAnswers, S as planRegistrationDetailsContinuation, Sn as paymentCaption, T as resolveRegistrationAdmission, Ta as PAGE_NAVIGATION, Tn as selectionPreviewLines, U as paymentChoiceDetails, Un as getSlidingScaleForEvent, Ur as resolveEventRegistrationScopedEvents, Vi as formatCentsAsCurrencyInput, Vn as getCurrentTicketSelection, Vt as paymentReturnRestoration, W as paymentChoicePrice, Wn as getSlidingScaleSelectionMessage, Wt as canToggleSelectionItem, X as createRegistrationDraftData, Xt as quoteReductions, Y as beginWaitlistInvitation, Yn as withRegistrationAvailability, Yt as primarySelectionItem, Z as invitationSubmission, Zn as getSingleSelectedPricingOptionId, Zt as registrationSelectionMode, _n as toggleSelectionItem, _t as roomSubmission, a as registrationPresentation, at as resolveRouteRequiresPayment, bn as combinationOffersOf, bt as toWaitlistClaimResolveFailure, cs as getStripeMinimumChargeRequirement, ct as validateFormData, d as decideEventChoice, ds as orderedLiveRunSessions, dt as dayOptionsOf, et as buildRegistrationSelectionRequest, f as isRegistrationLocked, fn as selectionTicketInputs, fs as resolveWholeSeriesBookingPhase, ft as decideRoomStay, gn as summariseSelectionPayment, gr as appliedDiscountHint, gs as resolveBookingSignupOffer, gt as roomChoiceMessage, h as decideEventRegistrationPayment, hn as severalRunsChoiceMessage, ht as presentRoomChooser, i as registrationPaymentRoute, is as planCheckoutPaymentFlow, it as resolveRegistrationTarget, jt as toEventSignInDraft, k as severalRunsNeedCard, ka as requestSignIn, ks as publicEventPricingCurrency, kt as eventSignInEnds, m as buildEventRegistrationPaymentOptionsViewModel, mn as severalItemsOf, mt as isRoomChoiceRefusal, nr as normalizeTicketSelectionLines, ns as eventRegistrationErrors, nt as resolveDiscountContext, o as registrationRoute, on as selectionIncludes, ot as toRegistrationRequestSubject, p as registrationFlowReducer, pt as defaultTicketOptions, q as registrationBrowserDraftSchema, qn as resolveHeldTicketPlaces, qt as incompleteRunChoiceMessage, rs as parseEventRegistrationErrorReason, rt as resolveEventRequiresPayment, sn as selectionItemPrice, st as registrationQuestionsMessage, ti as groupPublicEventsByRun, tr as hasValidPricingOptionSelection, ts as eventRegistrationErrorEndsCommand, tt as findPreSelectedEvent, u as createInitialRegistrationFlowState, ut as bookingLines, vn as combinationHintCopy, vt as selectRoomOffer, w as resolveGuestNextStepCheck, wt as toRegistrationEvents, x as planRegistrationDetailsCheck, xn as combinationWorking, y as getTicketSelectionPurpose, yt as isSameWaitlistClaim, zr as closedDateCopy, zt as toRunRequirementsSnapshots } from "./wizardSteps-CWIQyRIw.mjs";
4
- import { Tn as formatCurrencyAmount, _t as roomChoicesSchema, gt as reviewedRoomsSchema, on as inferSiteDateLocale, t as assertNever, yn as resolveBookingBusinessTimeZone } from "./src-o7WEvbK1.mjs";
5
- import { o as checkBookingQuestionsAnswered } from "./creditProducts-BQ1t1erI.mjs";
6
- import { i as useSiteTermsAgreement, r as siteTermsFailureKind } from "./SiteTermsAgreementField-BAdW5DvE.mjs";
2
+ import { m as ok, p as err } from "./renderableMediaAssetAdmission-BsOWd9lf.mjs";
3
+ import { An as formatCurrencyAmount, St as roomChoicesSchema, dn as inferSiteDateLocale, t as assertNever, wn as resolveBookingBusinessTimeZone, xt as reviewedRoomsSchema } from "./src-CmXh3JWs.mjs";
4
+ import { $n as serverPricedTotalCents, $s as resolveWholeSeriesBookingPhase, $t as toWholeSeriesRegistrationEvents, A as ownCoverPaysEveryDate, Ar as normalizeTicketSelectionLines, At as resolveEventRequiresPayment, Bs as eventRegistrationRefusalMessage, Bt as defaultTicketOptions, C as currentSelectionFundingLookup, Cn as primarySelectionItem, Cr as withRegistrationAvailability, Ct as beginWaitlistInvitation, D as fundingOptionPick, Dt as buildRegistrationSelectionRequest, E as fundingOptionKey, Et as withOfferedEvent, F as selectionFundingRequest, Ft as validateFormData, G as planRegistrationDetailsContinuation, Gn as combinationHintCopy, Gt as selectRoomOffer, H as getTicketSelectionPurpose, Hn as severalRunsChoiceMessage, Hs as planCheckoutPaymentFlow, Ht as presentRoomChooser, I as buildEventRegistrationPaymentOptionsViewModel, Is as decideSelectionAttendance, J as resolveRegistrationAdmission, Jn as combinationWorking, Ks as getStripeMinimumChargeRequirement, Kt as isSameWaitlistClaim, L as buildSelectionCollectionOptions, Lt as bookingLines, M as selectionFundingBasis, Mt as resolveRouteRequiresPayment, N as selectionFundingFetchWanted, Ni as groupPublicEventsByRun, Nn as selectionIncludes, Nt as toRegistrationRequestSubject, O as initialSelectionFundingLookup, P as selectionFundingReducer, Pn as selectionItemPrice, Pt as registrationQuestionsMessage, Q as visitorHoldsOwnPlace, Qn as selectionPreviewLines, Qs as orderedLiveRunSessions, R as decideEventRegistrationPayment, Rs as eventRegistrationErrorEndsCommand, Rt as dayOptionsOf, S as chosenFundingOption, Sn as planSelectionPrice, Sr as shouldLoadRegistrationOptions, St as entryStart, T as fundingMoneyDates, Tr as getSingleSelectedPricingOptionId, Tt as invitationBooking, Un as summariseSelectionPayment, Ut as roomChoiceMessage, Vn as severalItemsOf, Vs as parseEventRegistrationErrorReason, Vt as isRoomChoiceRefusal, W as planRegistrationDetailsCheck, Wn as toggleSelectionItem, Wr as appliedDiscountHint, Wt as roomSubmission, X as resolveRegistrationTicketContinuation, Xn as selectionCombinationHint, Xt as getRegistrationStartAt, Yn as paymentCaption, Zr as formatCommercePrice, Zt as toRegistrationEvents, _ as pickCollections, _c as publicEventPricingCurrency, _r as getSlidingScaleForEvent, _t as bookingOccurrenceContext, a as registrationPresentation, an as buildSelectionRequirementsSubmission, ao as leavePage, b as selectionPaysNothing, ba as formatPrice, bi as resolveEventRegistrationScopedEvents, bn as effectiveSelection, br as parseCurrencyInputToCents, bt as entryPageEvent, cn as deriveRunRequirements, cr as getPortalSubjectEmail, ct as calculateEventRegistrationPreviewTotal, d as decideEventChoice, dn as runsKeepingAnswers, dt as paymentChoiceDetails, en as EVENT_SIGN_IN_FORM_ID, er as findSelectedTicketType, f as isRegistrationLocked, fi as closedDatesCopy, fn as toRunRequirementsSnapshots, fr as transformRegistrationOptionsResponse, ft as paymentChoicePrice, g as paymentOptionFor, gr as getRegistrationOccurrenceId, gt as restorableBrowserDraftCode, h as moneyCollections, ha as needsBookingQuestionsRefresh, hi as closedDateCopy, hn as ATTENDANCE_CHOICE_MESSAGE, hr as getCurrentTicketSelection, ht as registrationBrowserDraftSchema, i as registrationPaymentRoute, in as toEventSignInDraft, j as selectionDatesQuote, jt as resolveRegistrationTarget, k as lookupChosenOption, kr as hasValidPricingOptionSelection, kt as resolveDiscountContext, ln as nextRunToRead, m as collectionsOf, ma as deriveBookingQuestions, mn as paymentReturnRestoration, mt as registrationBrowserDraft, nn as eventSignInEnds, nt as resolveEventRegistrationSubmitPlan, o as registrationRoute, on as checkRunRequirements, p as registrationFlowReducer, pi as closedRunCopy, pn as withoutKeptAnswers, q as resolveGuestNextStepCheck, qn as combinationOffersOf, qt as toWaitlistClaimResolveFailure, rc as resolveBookingSignupOffer, rn as eventSignInRestoration, ro as PAGE_NAVIGATION, sn as decideSelectionRequirementsLayout, so as requestSignIn, sr as getImplicitSingleTicketType, tn as eventSignInDraftStore, tr as formatBookingWhen, u as createInitialRegistrationFlowState, un as runFieldErrors, ur as getVisibleTicketTypes, v as runsSelectionPaymentRequest, va as toBookingQuestionsPaymentSnapshot, vn as attendanceChoicePending, vr as getSlidingScaleSelectionMessage, vt as decideRegistrationEntry, w as fundingChoice, wn as quoteReductions, wt as invitationSubmission, x as cardStepServesDates, xn as incompleteRunChoiceMessage, xr as resolveHeldTicketPlaces, xt as entrySelectionMode, y as selectionItemLabels, yi as resolveEventRegistrationChoices, yn as canToggleSelectionItem, yr as getTicketSelectionRemainingPlaces, yt as entryChoosesEvent, zn as selectionTicketInputs, zs as eventRegistrationErrors, zt as decideRoomStay } from "./wizardSteps-B952ify5.mjs";
5
+ import { i as portalPath } from "./portalRoutes-ByyVZfVq.mjs";
6
+ import { c as checkBookingQuestionsAnswered } from "./bookingCalendar--aWnqFDn.mjs";
7
+ import { i as useSiteTermsAgreement, r as siteTermsFailureKind } from "./SiteTermsAgreementField-VfSd6JU-.mjs";
7
8
  import { t as generateUuidV4 } from "./uuid-BETKW8rS.mjs";
8
- import { i as useBookingNowIso, r as parseBookingSubmissionFailure, s as indefiniteArticle } from "./BookingQuestionFields-DXegGSnS.mjs";
9
- import { i as BlockApiError, n as useBlockApi } from "./context-DtKdUdkO.mjs";
10
- import { n as EVENT_REGISTRATION_CHECKOUT_ATTEMPT_PARAM, r as paidInFullNote, t as EVENT_REGISTRATION_ANCHOR_ID } from "./constants-PfYJsEZF.mjs";
9
+ import { s as indefiniteArticle } from "./BookingQuestionFields-BJI7mZuV.mjs";
10
+ import { i as BlockApiError, n as useBlockApi } from "./context-Hi1RuYEM.mjs";
11
+ import { n as EVENT_REGISTRATION_CHECKOUT_ATTEMPT_PARAM, r as paidInFullNote, t as EVENT_REGISTRATION_ANCHOR_ID } from "./constants-DdxFG3Ic.mjs";
11
12
  import { t as resolveDedicatedBookingHref } from "./bookingRoute-D6DlxYx6.mjs";
12
- import { i as discountEmailProblem } from "./DemoBookingPortalAccess-0Ua44F1j.mjs";
13
- import { t as useDiscountCodeUi } from "./useDiscountCodeUi-BcFQRI_7.mjs";
14
- import { c as portalSessionIdentity, l as useSignInReturn, s as usePolling, u as useBookingQuestionsRefresh } from "./BookingMailingListNote-CGxg37zx.mjs";
15
- import { s as storeDemoBookingPass, t as CUSTOMER_PORTAL_PATH } from "./demoPortalMagicLink-B8eDjhuG.mjs";
13
+ import { i as discountEmailProblem } from "./DemoBookingPortalAccess-8kwNF9HN.mjs";
14
+ import { c as parseBookingSubmissionFailure, d as useSignInReturn, f as useBookingQuestionsRefresh, l as useBookingNowIso, s as usePolling, u as portalSessionIdentity } from "./BookingMailingListNote-7kdvuPow.mjs";
15
+ import { t as useDiscountCodeUi } from "./useDiscountCodeUi-D0kGF0C7.mjs";
16
+ import { s as storeDemoBookingPass } from "./demoPortalMagicLink-BAL5UIDG.mjs";
16
17
  import { Suspense, lazy, useCallback, useEffect, useMemo, useReducer, useRef, useState, useSyncExternalStore } from "react";
17
18
  import { jsx } from "react/jsx-runtime";
18
19
  import { z } from "zod";
@@ -244,238 +245,6 @@ function planEventRegistrationSurface(input) {
244
245
  } : { kind: "unavailableWholeSeries" };
245
246
  }
246
247
  //#endregion
247
- //#region ../blocks/src/system/runtime/nodes/event-registration/useSelectionFunding.state.ts
248
- /**
249
- * How the dates are paid, one date or several (issue 1767, sets 6 and 7). The server
250
- * plans every option, its order and the one to select; the block keeps which one
251
- * the visitor picked and sends that option back with the split it showed.
252
- */
253
- /** The pass or membership an entitlement option uses, as the server names it on submit. */
254
- function entitlementSource(entitlement) {
255
- switch (entitlement.kind) {
256
- case "ownedPass": return {
257
- kind: "ownedPass",
258
- passId: entitlement.passId
259
- };
260
- case "ownedMembership": return {
261
- kind: "ownedMembership",
262
- membershipId: entitlement.membershipId
263
- };
264
- case "buyPass": return {
265
- kind: "buyPass",
266
- productId: entitlement.productId
267
- };
268
- case "buyMembership": return {
269
- kind: "buyMembership",
270
- productId: entitlement.productId
271
- };
272
- default: return assertNever(entitlement);
273
- }
274
- }
275
- function sourceKey(source) {
276
- switch (source.kind) {
277
- case "ownedPass": return `ownedPass:${source.passId}`;
278
- case "ownedMembership": return `ownedMembership:${source.membershipId}`;
279
- case "buyPass": return `buyPass:${source.productId}`;
280
- case "buyMembership": return `buyMembership:${source.productId}`;
281
- default: return assertNever(source);
282
- }
283
- }
284
- /** One key per option, so a pick survives a refetch that still offers it. */
285
- function fundingPickKey(pick) {
286
- switch (pick.kind) {
287
- case "money": return "money";
288
- case "entitlement": return sourceKey(pick.source);
289
- default: return assertNever(pick);
290
- }
291
- }
292
- function fundingOptionPick(option) {
293
- switch (option.kind) {
294
- case "money": return { kind: "money" };
295
- case "entitlement": return {
296
- kind: "entitlement",
297
- source: entitlementSource(option.entitlement)
298
- };
299
- default: return assertNever(option);
300
- }
301
- }
302
- function fundingOptionKey(option) {
303
- return fundingPickKey(fundingOptionPick(option));
304
- }
305
- function findOption(funding, pick) {
306
- const key = fundingPickKey(pick);
307
- return funding.options.find((option) => fundingOptionKey(option) === key);
308
- }
309
- /** The picked option, or the server's own selection when the pick isn't offered. */
310
- function chosenFundingOption(funding, pick) {
311
- return findOption(funding, pick) ?? findOption(funding, funding.selected) ?? funding.options[0];
312
- }
313
- /** The dates the option charges money for, earliest first. */
314
- function fundingMoneyDates(option) {
315
- switch (option.kind) {
316
- case "money": return option.moneyDates;
317
- case "entitlement": return option.uncovered.map((date) => date.occurrenceId);
318
- default: return assertNever(option);
319
- }
320
- }
321
- /** What submit sends: the option's source and the split the visitor saw. */
322
- function fundingChoice(option) {
323
- switch (option.kind) {
324
- case "money": return { kind: "money" };
325
- case "entitlement": return {
326
- kind: "entitlement",
327
- source: entitlementSource(option.entitlement),
328
- expected: {
329
- covered: [...option.covered],
330
- moneyDates: [...fundingMoneyDates(option)]
331
- }
332
- };
333
- default: return assertNever(option);
334
- }
335
- }
336
- /**
337
- * The options request for the dates of one event, one date or several; null
338
- * for anything else, which keeps its own payment step. A waitlist claim asks the
339
- * same way: the claim admits the held place, and the funding pays for it.
340
- */
341
- function selectionFundingRequest(input) {
342
- const selection = input.target?.selection;
343
- if (selection?.kind !== "dates") return null;
344
- const eventSeriesId = datesSeries(selection, input.eventSeriesId);
345
- const lines = normalizeTicketSelectionLines(input.ticketSelections);
346
- if (!eventSeriesId || lines.length === 0) return null;
347
- return {
348
- subject: {
349
- kind: "dates",
350
- eventSeriesId,
351
- occurrenceIds: selection.occurrenceIds,
352
- ...input.attendanceMode ? { attendanceMode: input.attendanceMode } : {}
353
- },
354
- selections: lines.map(({ pricingOptionId, quantity }) => ({
355
- pricingOptionId,
356
- quantity
357
- })),
358
- ...input.selectedSlidingAmount !== null ? { selectedSlidingAmount: input.selectedSlidingAmount } : {}
359
- };
360
- }
361
- /** Several dates name their series; one date's comes from the event being booked. */
362
- function datesSeries(selection, eventSeriesId) {
363
- return selection.eventSeriesId ?? (selection.occurrenceIds.length === 1 ? eventSeriesId : null);
364
- }
365
- /**
366
- * What the quote prices for the dates: nothing while the ways to pay are on their way or when the
367
- * visitor's own pass or membership covers every date, and otherwise the chosen option's whole order,
368
- * which the server funds and prices itself. Null for anything that isn't dates. One date paid with
369
- * money keeps its own booking's quote, so its card options, deposits and automatic discount stay
370
- * as they are, and it waits for nothing.
371
- */
372
- function selectionDatesQuote(lookup, request) {
373
- if (request === null) return null;
374
- const oneDate = request.subject.occurrenceIds.length === 1;
375
- switch (lookup.tag) {
376
- case "idle": return null;
377
- case "loading":
378
- case "failed": return oneDate ? null : { kind: "waiting" };
379
- case "loaded": {
380
- const option = chosenFundingOption(lookup.funding, lookup.pick);
381
- if (oneDate && option.kind === "money") return null;
382
- return ownCoverPaysEveryDate(option) ? { kind: "nothingToPay" } : {
383
- kind: "order",
384
- selection: {
385
- ...request,
386
- funding: fundingChoice(option)
387
- }
388
- };
389
- }
390
- default: return assertNever(lookup);
391
- }
392
- }
393
- /** A pass or membership the visitor already has, covering every date: submit books them with no order. */
394
- function ownCoverPaysEveryDate(option) {
395
- if (option.kind === "money" || option.uncovered.length > 0) return false;
396
- switch (option.entitlement.kind) {
397
- case "ownedPass":
398
- case "ownedMembership": return true;
399
- case "buyPass":
400
- case "buyMembership": return false;
401
- default: return assertNever(option.entitlement);
402
- }
403
- }
404
- /**
405
- * One date with nothing but money to offer, no note and no change to explain keeps
406
- * the card step it always had; anything else shows the ways to pay.
407
- */
408
- function cardStepServesDates(lookup, dateCount) {
409
- if (dateCount !== 1 || lookup.tag !== "loaded" || lookup.notice !== null) return false;
410
- const { options, entitlementNote } = lookup.funding;
411
- return options.length === 1 && options[0].kind === "money" && entitlementNote === "none";
412
- }
413
- /** The option the visitor has chosen, once the options are in. */
414
- function lookupChosenOption(lookup) {
415
- return lookup.tag === "loaded" ? chosenFundingOption(lookup.funding, lookup.pick) : null;
416
- }
417
- /** What the visitor is looking at now, for a quote or submit to say which options it was about. */
418
- function selectionFundingBasis(lookup) {
419
- return lookup.tag === "loaded" ? {
420
- requestKey: lookup.requestKey,
421
- pickKey: fundingPickKey(lookup.pick)
422
- } : null;
423
- }
424
- const initialSelectionFundingLookup = { tag: "idle" };
425
- function settles(state, requestKey) {
426
- return state.tag === "loading" && state.requestKey === requestKey;
427
- }
428
- function stillCurrent(state, basis) {
429
- const now = selectionFundingBasis(state);
430
- return now !== null && basis !== null && now.requestKey === basis.requestKey && now.pickKey === basis.pickKey;
431
- }
432
- function selectionFundingReducer(state, action) {
433
- switch (action.type) {
434
- case "loading": return {
435
- tag: "loading",
436
- requestKey: action.requestKey
437
- };
438
- case "loaded": return settles(state, action.requestKey) ? {
439
- tag: "loaded",
440
- requestKey: action.requestKey,
441
- funding: action.funding,
442
- pick: action.funding.selected,
443
- notice: null
444
- } : state;
445
- case "failed": return settles(state, action.requestKey) ? {
446
- tag: "failed",
447
- requestKey: action.requestKey
448
- } : state;
449
- case "picked": return state.tag === "loaded" && findOption(state.funding, action.pick) ? {
450
- ...state,
451
- pick: action.pick,
452
- notice: null
453
- } : state;
454
- case "changed": return stillCurrent(state, action.basis) ? {
455
- tag: "loaded",
456
- requestKey: state.requestKey,
457
- funding: action.funding,
458
- pick: action.funding.selected,
459
- notice: action.message
460
- } : state;
461
- case "reset": return initialSelectionFundingLookup;
462
- default: return assertNever(action);
463
- }
464
- }
465
- /** The lookup for this request: another request's answer, or none yet, is still loading. */
466
- function currentSelectionFundingLookup(state, requestKey) {
467
- if (requestKey === null) return initialSelectionFundingLookup;
468
- if (state.tag !== "idle" && state.requestKey === requestKey) return state;
469
- return {
470
- tag: "loading",
471
- requestKey
472
- };
473
- }
474
- /** Whether the hook should ask the server now. */
475
- function selectionFundingFetchWanted(state, requestKey, enabled) {
476
- return enabled && requestKey !== null && (state.tag === "idle" || state.requestKey !== requestKey);
477
- }
478
- //#endregion
479
248
  //#region ../blocks/src/system/runtime/nodes/event-registration/registrationDiscountView.state.ts
480
249
  /** The quote owns the code for one booking or several; one booking still finds out what's on offer from availability. */
481
250
  function registrationDiscountView(input) {
@@ -502,12 +271,13 @@ function registrationDiscountView(input) {
502
271
  };
503
272
  }
504
273
  /** A draft code must remain editable while its price is unresolved and payment choices are disabled. */
505
- function registrationDiscountEntryVisible(view, method) {
506
- return method === "membership" || view.manualCodeEntryAllowed || view.editingCode;
274
+ function registrationDiscountEntryVisible(view) {
275
+ return view.manualCodeEntryAllowed || view.editingCode;
507
276
  }
508
- /** Typed codes belong to the money choice, including when a pass leaves a card remainder. */
509
- function registrationDiscountCardOnly(method, funding) {
510
- return method === "membership" || funding.tag === "loaded" && chosenFundingOption(funding.funding, funding.pick).kind === "entitlement";
277
+ function registrationDiscountAccess(method, funding) {
278
+ if (method === "membership") return "notOffered";
279
+ if (funding.tag !== "loaded") return "card";
280
+ return chosenFundingOption(funding.funding, funding.pick).kind === "money" ? "card" : "notOffered";
511
281
  }
512
282
  //#endregion
513
283
  //#region ../blocks/src/system/runtime/nodes/event-registration/registrationDiscountCode.state.ts
@@ -582,25 +352,29 @@ function resolveRegistrationRecoveryAction(step, action) {
582
352
  if (step === "verifying-payment" || step === "verifying-timeout" || step === "payment") return "none";
583
353
  return action;
584
354
  }
355
+ /**
356
+ * After the details check refuses the booker (an earlier unpaid booking of theirs stands, or it couldn't be
357
+ * found safely), Try again returns to their details so continuing runs the check again. Not 'retry', which
358
+ * goes straight to payment and is for a refused submission. Not 'places', which on a full event swaps the
359
+ * message for the waitlist offer.
360
+ */
361
+ const DETAILS_CHECK_REFUSAL_RECOVERY = "details";
585
362
  function shouldRefreshAfterRegistrationError(step, action, enabled) {
586
363
  return enabled || step === "error" && action === "places";
587
364
  }
365
+ /** A fresh booking where this page's bookings start; the reset owns the start item's own defaults. */
588
366
  function resetRegistrationAfterExpiry(input) {
589
367
  input.dispatchFlow({
590
368
  type: "reset",
591
- hasPreSelectedContext: input.hasPreSelectedContext
369
+ start: input.start
592
370
  });
593
- input.setSelectedTicketLines([]);
594
- input.setSelectedSlidingAmountInput("");
595
- const mode = input.preSelectedEvent?.deliveryMode;
596
- input.setSelectedAttendanceMode(mode === "online" || mode === "in_person" ? mode : null);
597
371
  input.setErrorMessage("");
598
372
  }
599
373
  /** Retry the retained submission in place; explicit payment uncertainty stays status-only. */
600
374
  function recoverRegistrationError(action, handlers, navigation) {
601
375
  switch (action) {
602
376
  case "none": return { kind: "navigated" };
603
- case "portal": return leavePage(CUSTOMER_PORTAL_PATH, navigation);
377
+ case "portal": return leavePage(portalPath({ page: "bookings" }), navigation);
604
378
  case "event": return leavePage(window.location.pathname, navigation);
605
379
  case "retry":
606
380
  handlers.clearError();
@@ -1327,7 +1101,8 @@ function eligibilityLookupReducer(state, action) {
1327
1101
  tag: "failed",
1328
1102
  eligibility: null,
1329
1103
  settledRequestKey: action.requestKey,
1330
- error: action.message
1104
+ error: action.message,
1105
+ closed: action.closed
1331
1106
  };
1332
1107
  default: return assertNever(action);
1333
1108
  }
@@ -1347,6 +1122,10 @@ function existingRegistrationLookupReducer(state, action) {
1347
1122
  tag: "resolved",
1348
1123
  registrations: action.registrations
1349
1124
  };
1125
+ case "failed": return {
1126
+ tag: "failed",
1127
+ registrations: []
1128
+ };
1350
1129
  default: return assertNever(action);
1351
1130
  }
1352
1131
  }
@@ -1376,27 +1155,28 @@ function usePortalAuthWithDeps(deps) {
1376
1155
  useEffect(() => {
1377
1156
  let cancelled = false;
1378
1157
  async function checkPortalAuth() {
1379
- if ((api.config.authOverrides?.portal ?? api.config.auth).type !== "bearer") {
1158
+ const visitor = api.portalVisitor;
1159
+ if (!visitor) {
1380
1160
  setAuthState("unauthenticated");
1381
1161
  setProfile(null);
1382
1162
  return;
1383
1163
  }
1384
1164
  setAuthState("checking");
1385
1165
  setProfile(null);
1386
- try {
1387
- const me = await api.getPortalProfile();
1388
- if (cancelled) return;
1389
- setProfile({
1390
- email: me.profile.email,
1391
- name: me.profile.name,
1392
- phone: me.profile.phone || ""
1393
- });
1394
- setAuthState("authenticated");
1395
- } catch {
1396
- if (cancelled) return;
1166
+ const result = await visitor.profile();
1167
+ if (cancelled) return;
1168
+ if (!result.ok) {
1397
1169
  setAuthState("unauthenticated");
1398
1170
  setProfile(null);
1171
+ return;
1399
1172
  }
1173
+ const { profile: me } = result.value;
1174
+ setProfile({
1175
+ email: me.email,
1176
+ name: me.name,
1177
+ phone: me.phone || ""
1178
+ });
1179
+ setAuthState("authenticated");
1400
1180
  }
1401
1181
  checkPortalAuth();
1402
1182
  return () => {
@@ -1458,15 +1238,25 @@ async function loadEligibility(input) {
1458
1238
  eligibility: transformRegistrationOptionsResponse(result),
1459
1239
  requestKey: input.requestKey
1460
1240
  });
1461
- } catch {
1241
+ } catch (error) {
1462
1242
  if (!input.isCurrent()) return;
1463
- input.dispatch({
1243
+ input.dispatch(isBookingsClosedRefusal(error) ? {
1244
+ type: "failed",
1245
+ requestKey: input.requestKey,
1246
+ closed: true,
1247
+ message: "Bookings for this event have closed."
1248
+ } : {
1464
1249
  type: "failed",
1465
1250
  requestKey: input.requestKey,
1251
+ closed: false,
1466
1252
  message: "We couldn’t load the booking options for this event. Try again, or contact the organiser if this keeps happening."
1467
1253
  });
1468
1254
  }
1469
1255
  }
1256
+ /** The options route tags a refusal from an event that has stopped taking bookings. */
1257
+ function isBookingsClosedRefusal(error) {
1258
+ return error instanceof BlockApiError && error.tag === "REGISTRATION_OPTIONS_CLOSED";
1259
+ }
1470
1260
  function useEligibilityWithDeps(params, deps) {
1471
1261
  const api = deps.useBlockApi();
1472
1262
  const request = eligibilityRequest(params);
@@ -1513,6 +1303,7 @@ function useEligibilityWithDeps(params, deps) {
1513
1303
  requestKey,
1514
1304
  isLoading: effectiveState.tag === "loading",
1515
1305
  error: effectiveState.error,
1306
+ bookingsClosed: effectiveState.tag === "failed" && effectiveState.closed,
1516
1307
  creditState: registrationOptionsCreditState(effectiveState, params.subjectEmail)
1517
1308
  };
1518
1309
  }
@@ -1533,13 +1324,10 @@ function registrationOptionsCreditState(state, subjectEmail) {
1533
1324
  credit: state.eligibility.credit ?? null
1534
1325
  };
1535
1326
  }
1536
- function useExistingEventRegistration({ isAuthenticated, occurrenceId }) {
1537
- return useExistingEventRegistrationWithDeps({
1538
- isAuthenticated,
1539
- occurrenceId
1540
- }, eventRegistrationHooksDeps);
1327
+ function useExistingEventRegistration(params) {
1328
+ return useExistingEventRegistrationWithDeps(params, eventRegistrationHooksDeps);
1541
1329
  }
1542
- function useExistingEventRegistrationWithDeps({ isAuthenticated, occurrenceId }, deps) {
1330
+ function useExistingEventRegistrationWithDeps({ isAuthenticated, occurrenceId, completedBookings }, deps) {
1543
1331
  const api = deps.useBlockApi();
1544
1332
  const [state, dispatch] = useReducer(existingRegistrationLookupReducer, initialExistingRegistrationLookupState);
1545
1333
  const requestIdRef = useRef(0);
@@ -1551,23 +1339,20 @@ function useExistingEventRegistrationWithDeps({ isAuthenticated, occurrenceId },
1551
1339
  dispatch({ type: "reset" });
1552
1340
  return;
1553
1341
  }
1342
+ const visitor = api.portalVisitor;
1554
1343
  const requestId = requestIdRef.current + 1;
1555
1344
  requestIdRef.current = requestId;
1556
- dispatch({ type: "loading-started" });
1557
- try {
1558
- const { registrations: events } = await api.getPortalEvents({ occurrenceId });
1559
- if (cancelled || requestIdRef.current !== requestId) return;
1560
- dispatch({
1561
- type: "resolved",
1562
- registrations: events.filter((event) => event.occurrenceId === occurrenceId && event.status !== "cancelled" && event.transferState !== "transferred_out")
1563
- });
1564
- } catch {
1565
- if (cancelled || requestIdRef.current !== requestId) return;
1566
- dispatch({
1567
- type: "resolved",
1568
- registrations: []
1569
- });
1345
+ if (!visitor) {
1346
+ dispatch({ type: "reset" });
1347
+ return;
1570
1348
  }
1349
+ dispatch({ type: "loading-started" });
1350
+ const result = await visitor.occurrenceBookings(occurrenceId);
1351
+ if (cancelled || requestIdRef.current !== requestId) return;
1352
+ dispatch(result.ok ? {
1353
+ type: "resolved",
1354
+ registrations: result.value
1355
+ } : { type: "failed" });
1571
1356
  }
1572
1357
  fetchExistingRegistration();
1573
1358
  return () => {
@@ -1576,7 +1361,8 @@ function useExistingEventRegistrationWithDeps({ isAuthenticated, occurrenceId },
1576
1361
  }, [
1577
1362
  api,
1578
1363
  isAuthenticated,
1579
- occurrenceId
1364
+ occurrenceId,
1365
+ completedBookings
1580
1366
  ]);
1581
1367
  return {
1582
1368
  state,
@@ -1718,11 +1504,13 @@ function eventPaymentReturnUrl(submissionId) {
1718
1504
  url.hash = EVENT_REGISTRATION_ANCHOR_ID;
1719
1505
  return url.toString();
1720
1506
  }
1507
+ /** Keep payment in the tab address for reloads and returns from the bank. */
1721
1508
  function rememberEventPayment(submissionId, sessionId) {
1722
1509
  const url = new URL(eventPaymentReturnUrl(submissionId));
1723
1510
  url.searchParams.set("session_id", sessionId);
1724
1511
  window.history.replaceState(window.history.state, "", url);
1725
1512
  }
1513
+ /** Clear this tab’s payment address and saved registration details. */
1726
1514
  function clearEventPayment(siteId) {
1727
1515
  const url = new URL(window.location.href);
1728
1516
  const submissionId = url.searchParams.get(EVENT_REGISTRATION_CHECKOUT_ATTEMPT_PARAM);
@@ -1733,9 +1521,17 @@ function clearEventPayment(siteId) {
1733
1521
  window.history.replaceState(window.history.state, "", url);
1734
1522
  }
1735
1523
  //#endregion
1524
+ //#region ../blocks/src/system/runtime/api/serverRefusal.ts
1525
+ /**
1526
+ * The server answered and refused the request (a 4xx), so nothing was written
1527
+ * and its message is meant for the person. A 5xx, no answer at all, or a 2xx
1528
+ * whose body couldn't be read leaves the outcome unknown.
1529
+ */
1530
+ function isServerRefusal(error) {
1531
+ return error instanceof BlockApiError && error.status >= 400 && error.status < 500;
1532
+ }
1533
+ //#endregion
1736
1534
  //#region ../blocks/src/system/runtime/nodes/event-registration/registrationErrorPresentation.ts
1737
- /** The tag the server gives a refused booking request, with a message meant for the booker. */
1738
- const REFUSED_INPUT_TAG = "REGISTRATION_INVALID_INPUT";
1739
1535
  /**
1740
1536
  * Public-site admission refusals: the site isn't open for online bookings.
1741
1537
  * The booker's details were fine, so these never ask them to check them.
@@ -1749,15 +1545,14 @@ function parseEventRegistrationFailure(error) {
1749
1545
  ...parseBookingSubmissionFailure(error, "Something went wrong. Please try again."),
1750
1546
  reason: !(error instanceof BlockApiError) ? null : siteUnavailable(error) ? "siteNotTakingBookings" : parseEventRegistrationErrorReason(error.tag),
1751
1547
  siteTermsFailure: siteTermsFailureKind(error),
1752
- isClientError: error instanceof BlockApiError && error.status < 500 && error.code !== "invalid_booking_response",
1753
- discountRefused: error instanceof BlockApiError && error.fieldErrors.some((field) => field.field === "discountCode"),
1754
- refusedInput: error instanceof BlockApiError && error.tag === REFUSED_INPUT_TAG && error.message.trim().length > 0
1548
+ isClientError: isServerRefusal(error),
1549
+ discountRefused: error instanceof BlockApiError && error.fieldErrors.some((field) => field.field === "discountCode")
1755
1550
  };
1756
1551
  }
1757
1552
  /**
1758
- * What the booker reads when a booking is refused. Booking several items
1759
- * (issue 1725) shows the server's own refusal ("Book one run at a time for
1760
- * this course.") rather than the general one, since it says what to change.
1553
+ * What the booker reads when a booking is refused. A known reason says its own message, or the
1554
+ * server's words where `eventRegistrationRefusalMessage` prefers them. A reason the form doesn't
1555
+ * know, as a form built before that reason was added won't, reads as a general refusal.
1761
1556
  */
1762
1557
  function registrationErrorPresentation(failure, bookings = "one") {
1763
1558
  if (failure.discountRefused) return {
@@ -1769,17 +1564,14 @@ function registrationErrorPresentation(failure, bookings = "one") {
1769
1564
  action: "details"
1770
1565
  };
1771
1566
  const reason = failure.reason;
1772
- if (reason) {
1773
- const { message, action } = eventRegistrationErrors[reason];
1774
- return {
1775
- message,
1776
- action
1777
- };
1778
- }
1567
+ if (reason) return {
1568
+ message: eventRegistrationRefusalMessage(reason, failure.message, bookings),
1569
+ action: eventRegistrationErrors[reason].action
1570
+ };
1779
1571
  if (failure.isClientError) {
1780
1572
  const { message, action } = eventRegistrationErrors.invalidCommitInput;
1781
1573
  return {
1782
- message: bookings === "several" && failure.refusedInput ? failure.message : message,
1574
+ message,
1783
1575
  action
1784
1576
  };
1785
1577
  }
@@ -1810,6 +1602,20 @@ function toEventRunPayment(choice) {
1810
1602
  function wantsMailingListSignup(options) {
1811
1603
  return options.mailingListSignup !== null && options.formData.mailingListOptIn === true;
1812
1604
  }
1605
+ /** The command this submission runs under: the same one for an identical retry, a new one once the details change. */
1606
+ function nextCommand(previous, submitted, createId) {
1607
+ return {
1608
+ id: previous !== null && previous.intentKey !== submitted.intentKey ? createId() : submitted.id,
1609
+ intentKey: submitted.intentKey
1610
+ };
1611
+ }
1612
+ /** The request under its retryable command. */
1613
+ function commandRequest(request, command) {
1614
+ return {
1615
+ ...request,
1616
+ registrationCommandId: command.id
1617
+ };
1618
+ }
1813
1619
  const eventRegistrationSubmitDeps = {
1814
1620
  savePendingRegistration,
1815
1621
  createClientCommandId: generateUuidV4
@@ -1872,19 +1678,16 @@ function useEventRegistrationSubmitWithDeps(options, deps) {
1872
1678
  try {
1873
1679
  const initialPrepared = prepareSubmitContext(options, registrationCommandId, target, method, membershipId, selection);
1874
1680
  const intentKey = registrationRequestIntentKey(buildRegistrationRequest(options, initialPrepared, invitation, method, membershipId));
1875
- const prepared = commandRef.current !== null && commandRef.current.intentKey !== intentKey ? {
1876
- ...initialPrepared,
1877
- registrationCommandId: deps.createClientCommandId()
1878
- } : initialPrepared;
1879
- const request = buildRegistrationRequest(options, prepared, invitation, method, membershipId);
1880
- commandRef.current = {
1881
- id: prepared.registrationCommandId,
1681
+ const command = nextCommand(commandRef.current, {
1682
+ id: registrationCommandId,
1882
1683
  intentKey
1684
+ }, deps.createClientCommandId);
1685
+ const prepared = {
1686
+ ...initialPrepared,
1687
+ registrationCommandId: command.id
1883
1688
  };
1884
- return await completeRegistrationSubmission(options, deps, prepared, await options.api.registerForEvent({
1885
- ...request,
1886
- registrationCommandId: prepared.registrationCommandId
1887
- }));
1689
+ commandRef.current = command;
1690
+ return await completeRegistrationSubmission(options, deps, prepared, await options.api.registerForEvent(commandRequest(buildRegistrationRequest(options, prepared, invitation, method, membershipId), command)));
1888
1691
  } catch (error) {
1889
1692
  if (error instanceof BlockApiError && (eventRegistrationErrorEndsCommand(error.tag) || error.fieldErrors.some((field) => field.field === "discountCode"))) commandRef.current = null;
1890
1693
  return reportFailedRegistration(options, error);
@@ -2529,7 +2332,8 @@ const SELECTION_FUNDING_LOAD_FAILED = "We couldn’t load the ways to pay for th
2529
2332
  const ONE_DATE_FUNDING_LOAD_FAILED = "We couldn’t load the ways to pay for this date. Try again, or refresh the page.";
2530
2333
  /**
2531
2334
  * The server's ways to pay for the dates, one or several, fetched when the
2532
- * payment step wants them. The key carries the dates, places and who's signed in, so any
2335
+ * wizard wants them: one date on its payment step, several once their tickets
2336
+ * are chosen. The key carries the dates, places and who's signed in, so any
2533
2337
  * change asks again and the pick goes back to the server's default.
2534
2338
  */
2535
2339
  function useSelectionFunding(input) {
@@ -2542,10 +2346,15 @@ function useSelectionFunding(input) {
2542
2346
  type: "loading",
2543
2347
  requestKey
2544
2348
  });
2545
- input.api.getSelectionFunding(input.request).then((response) => dispatch({
2349
+ const severalDates = input.request.subject.occurrenceIds.length > 1;
2350
+ input.api.getSelectionFunding(input.request).then((response) => dispatch(severalDates && !response.payment ? {
2351
+ type: "failed",
2352
+ requestKey
2353
+ } : {
2546
2354
  type: "loaded",
2547
2355
  requestKey,
2548
- funding: response.funding
2356
+ funding: response.funding,
2357
+ payment: response.payment ?? null
2549
2358
  }), () => dispatch({
2550
2359
  type: "failed",
2551
2360
  requestKey
@@ -2569,6 +2378,75 @@ function useSelectionFunding(input) {
2569
2378
  };
2570
2379
  }
2571
2380
  //#endregion
2381
+ //#region ../blocks/src/system/runtime/nodes/event-registration/useRunsSelectionPayment.state.ts
2382
+ /**
2383
+ * The runs read's lookup: which request is being asked, and the answer it got.
2384
+ * Dates get their answer with their funding (useSelectionFunding.state).
2385
+ */
2386
+ const RUNS_PAYMENT_LOAD_FAILED = "We couldn’t load the ways to pay for these runs. Refresh the page to try again.";
2387
+ const IDLE_SELECTION_PAYMENT = { tag: "idle" };
2388
+ /** An answer settles only the request it was sent for. */
2389
+ function selectionPaymentLookupReducer(state, action) {
2390
+ const settles = state.tag === "loading" && state.requestKey === action.requestKey;
2391
+ switch (action.type) {
2392
+ case "loading": return {
2393
+ tag: "loading",
2394
+ requestKey: action.requestKey
2395
+ };
2396
+ case "loaded": return settles ? {
2397
+ tag: "loaded",
2398
+ requestKey: action.requestKey,
2399
+ payment: action.payment
2400
+ } : state;
2401
+ case "failed": return settles ? {
2402
+ tag: "failed",
2403
+ requestKey: action.requestKey
2404
+ } : state;
2405
+ default: return assertNever(action);
2406
+ }
2407
+ }
2408
+ /** The lookup for this request: another request's answer, or none yet, is still loading. */
2409
+ function currentSelectionPaymentLookup(state, requestKey) {
2410
+ if (requestKey === null) return IDLE_SELECTION_PAYMENT;
2411
+ if (state.tag !== "idle" && state.requestKey === requestKey) return state;
2412
+ return {
2413
+ tag: "loading",
2414
+ requestKey
2415
+ };
2416
+ }
2417
+ /** Whether the hook should ask the server now. */
2418
+ function selectionPaymentFetchWanted(state, requestKey, enabled) {
2419
+ return enabled && requestKey !== null && (state.tag === "idle" || state.requestKey !== requestKey);
2420
+ }
2421
+ //#endregion
2422
+ //#region ../blocks/src/system/runtime/nodes/event-registration/useRunsSelectionPayment.ts
2423
+ /**
2424
+ * How several runs can be paid, from the server, asked once the runs and
2425
+ * their tickets are chosen. The key carries the runs, tickets, places and who's
2426
+ * signed in, so any change asks again. Dates get theirs with their funding.
2427
+ */
2428
+ function useRunsSelectionPayment(input) {
2429
+ const requestKey = input.request ? JSON.stringify([input.request, input.identity]) : null;
2430
+ const [state, dispatch] = useReducer(selectionPaymentLookupReducer, IDLE_SELECTION_PAYMENT);
2431
+ const wanted = selectionPaymentFetchWanted(state, requestKey, input.enabled);
2432
+ useEffect(() => {
2433
+ if (!wanted || requestKey === null || input.request === null) return;
2434
+ dispatch({
2435
+ type: "loading",
2436
+ requestKey
2437
+ });
2438
+ input.api.getRunsSelectionPayment(input.request).then((response) => dispatch({
2439
+ type: "loaded",
2440
+ requestKey,
2441
+ payment: response.payment
2442
+ }), () => dispatch({
2443
+ type: "failed",
2444
+ requestKey
2445
+ }));
2446
+ }, [wanted, requestKey]);
2447
+ return input.enabled || state.tag !== "idle" ? currentSelectionPaymentLookup(state, requestKey) : IDLE_SELECTION_PAYMENT;
2448
+ }
2449
+ //#endregion
2572
2450
  //#region ../blocks/src/system/runtime/nodes/event-registration/selectionFundingView.ts
2573
2451
  const SEVERAL_PLACES_ENTITLEMENT_NOTE = "Class passes and memberships can be used when you book one place on each date.";
2574
2452
  const ONE_DATE_SEVERAL_PLACES_ENTITLEMENT_NOTE = "Class passes and memberships can be used when you book one place.";
@@ -2579,9 +2457,23 @@ function orderPrice(option, chosen, input) {
2579
2457
  discountCents: 0
2580
2458
  };
2581
2459
  }
2582
- /** The server's price for the option's order, with account credit taken off the whole of it, as checkout takes it. */
2583
- function decideCharge(option, order, input) {
2460
+ /**
2461
+ * The server's price for the option's order, with account credit taken off the whole of it, as checkout takes it.
2462
+ * Paid directly, nothing is taken online: the whole order is owed to the business.
2463
+ */
2464
+ function decideCharge(option, order, input, collection) {
2584
2465
  const moneyDateCount = fundingMoneyDates(option).length;
2466
+ if (collection === "deferred_manual") {
2467
+ const remainder = moneyDateCount === 0 ? "none" : order.totalCents === 0 ? "free" : "direct";
2468
+ return {
2469
+ moneyDateCount,
2470
+ boughtCents: boughtPriceCents(option),
2471
+ creditCents: 0,
2472
+ cardCents: 0,
2473
+ directCents: order.totalCents,
2474
+ remainder
2475
+ };
2476
+ }
2585
2477
  const creditCents = planCheckoutPaymentFlow({
2586
2478
  amountDueCents: order.totalCents,
2587
2479
  discountCents: order.discountCents,
@@ -2596,6 +2488,7 @@ function decideCharge(option, order, input) {
2596
2488
  boughtCents: boughtPriceCents(option),
2597
2489
  creditCents,
2598
2490
  cardCents,
2491
+ directCents: 0,
2599
2492
  remainder
2600
2493
  };
2601
2494
  }
@@ -2625,7 +2518,14 @@ function theOther(count) {
2625
2518
  }
2626
2519
  /** Card wording only when a card is really charged. */
2627
2520
  function payer(charge) {
2628
- return charge.remainder === "card" ? "Card pays for" : "You pay for";
2521
+ switch (charge.remainder) {
2522
+ case "card": return "Card pays for";
2523
+ case "direct": return "You pay the business directly for";
2524
+ case "none":
2525
+ case "credit":
2526
+ case "free": return "You pay for";
2527
+ default: return assertNever(charge.remainder);
2528
+ }
2629
2529
  }
2630
2530
  /** Why a date isn't covered, under the date. */
2631
2531
  const UNCOVERED_REASON_COPY = {
@@ -2640,6 +2540,7 @@ function partTitle(facts) {
2640
2540
  case "none":
2641
2541
  case "free": return facts.name;
2642
2542
  case "card": return `${facts.name} and card`;
2543
+ case "direct": return `${facts.name} and pay the rest directly`;
2643
2544
  case "credit": return `${facts.name} and account credit`;
2644
2545
  default: return assertNever(facts.charge.remainder);
2645
2546
  }
@@ -2661,6 +2562,17 @@ function boughtPassShortfall(facts) {
2661
2562
  }
2662
2563
  }
2663
2564
  const membershipRenewal = (facts) => `${facts.boughtPrice ?? ""} a ${facts.interval ?? "month"}, renews ${facts.interval === "year" ? "yearly" : "monthly"}.`;
2565
+ /** The option's price when money is owed: today's card payment, or "£24.00 due" to the business. */
2566
+ function remainderPrice(facts) {
2567
+ switch (facts.charge.remainder) {
2568
+ case "card": return facts.toPay;
2569
+ case "direct": return `${facts.toPayDirectly} due`;
2570
+ case "none":
2571
+ case "credit":
2572
+ case "free": return null;
2573
+ default: return assertNever(facts.charge.remainder);
2574
+ }
2575
+ }
2664
2576
  const passCredits = (facts) => `${facts.covered} pass ${facts.covered === 1 ? "credit" : "credits"}`;
2665
2577
  /** Each kind's words. A new kind of pass or membership won't compile until it has its own. */
2666
2578
  const ENTITLEMENT_COPY = {
@@ -2669,11 +2581,12 @@ const ENTITLEMENT_COPY = {
2669
2581
  countsCredits: true,
2670
2582
  title: partTitle,
2671
2583
  detail: (facts) => facts.moneyDates === 0 ? `${credits(facts.creditsBefore ?? 0)} left, ${facts.creditsLeftAfter ?? 0} after this booking` : ownedPassShortfall(facts),
2672
- price: (facts) => facts.charge.remainder === "card" ? facts.toPay : credits(facts.covered),
2584
+ price: (facts) => remainderPrice(facts) ?? credits(facts.covered),
2673
2585
  button: (facts) => {
2674
2586
  switch (facts.charge.remainder) {
2675
2587
  case "none": return `Book using ${passCredits(facts)}`;
2676
2588
  case "card": return `Use ${passCredits(facts)} and pay ${facts.toPay}`;
2589
+ case "direct":
2677
2590
  case "credit":
2678
2591
  case "free": return `Use ${passCredits(facts)} and book`;
2679
2592
  default: return assertNever(facts.charge.remainder);
@@ -2686,7 +2599,7 @@ const ENTITLEMENT_COPY = {
2686
2599
  countsCredits: false,
2687
2600
  title: partTitle,
2688
2601
  detail: (facts) => facts.moneyDates === 0 ? facts.dateCount === 1 ? "Your membership covers this date" : `Your membership covers all ${facts.dateCount} dates` : `Your membership covers ${facts.covered} of these dates. ${payer(facts.charge)} ${theOther(facts.moneyDates)}.`,
2689
- price: (facts) => facts.charge.remainder === "card" ? facts.toPay : "Included",
2602
+ price: (facts) => remainderPrice(facts) ?? "Included",
2690
2603
  button: (facts) => facts.charge.remainder === "card" ? `Pay ${facts.toPay}` : facts.dateCount === 1 ? "Book your place" : "Book your places",
2691
2604
  boughtLine: () => null
2692
2605
  },
@@ -2773,6 +2686,7 @@ function optionFacts(option, charge, input) {
2773
2686
  coveredDays: daysOf(option.covered, input.dates),
2774
2687
  moneyDays: daysOf(fundingMoneyDates(option), input.dates),
2775
2688
  toPay: formatPrice(charge.cardCents, input.currency),
2689
+ toPayDirectly: formatPrice(charge.directCents, input.currency),
2776
2690
  charge
2777
2691
  };
2778
2692
  }
@@ -2794,17 +2708,21 @@ function optionRows(option, chosenKey, input) {
2794
2708
  }));
2795
2709
  }
2796
2710
  case "entitlement": {
2797
- const facts = optionFacts(option, decideCharge(option, orderPrice(option, selected, input), input), input);
2798
2711
  const copy = ENTITLEMENT_COPY[option.entitlement.kind];
2799
- return [{
2800
- key,
2801
- pick,
2802
- card: null,
2803
- selected,
2804
- label: copy.title(facts),
2805
- details: [copy.detail(facts)],
2806
- price: copy.price(facts)
2807
- }];
2712
+ const ways = input.collectionsOf(pick);
2713
+ const chosenWay = collectionShown(ways, input.chosenCollection);
2714
+ return (ways.length > 1 ? ways : [chosenWay]).map((way) => {
2715
+ const facts = optionFacts(option, decideCharge(option, orderPrice(option, selected, input), input, way), input);
2716
+ return {
2717
+ key: ways.length > 1 ? `${key}:${way ?? ""}` : key,
2718
+ pick,
2719
+ card: ways.length > 1 ? way : null,
2720
+ selected: selected && way === chosenWay,
2721
+ label: copy.title(facts),
2722
+ details: [copy.detail(facts)],
2723
+ price: copy.price(facts)
2724
+ };
2725
+ });
2808
2726
  }
2809
2727
  default: return assertNever(option);
2810
2728
  }
@@ -2828,8 +2746,12 @@ function dateLines(option, copy, charge, input) {
2828
2746
  };
2829
2747
  });
2830
2748
  }
2831
- function fundedSummary(option, input) {
2832
- const charge = decideCharge(option, orderPrice(option, true, input), input);
2749
+ /** The way an option's money is collected: the visitor's choice when the option offers it, otherwise its first. */
2750
+ function collectionShown(ways, chosen) {
2751
+ return chosen !== null && ways.includes(chosen) ? chosen : ways[0] ?? null;
2752
+ }
2753
+ function fundedSummary(option, collection, input) {
2754
+ const charge = decideCharge(option, orderPrice(option, true, input), input, collection);
2833
2755
  const facts = optionFacts(option, charge, input);
2834
2756
  const copy = ENTITLEMENT_COPY[option.entitlement.kind];
2835
2757
  const money = (cents) => formatCurrencyAmount(cents, input.currency);
@@ -2860,12 +2782,7 @@ function fundedSummary(option, input) {
2860
2782
  value: `−${money(charge.creditCents)}`,
2861
2783
  total: false
2862
2784
  }] : [],
2863
- ...owesMoney ? [{
2864
- key: "to-pay",
2865
- label: "To pay",
2866
- value: money(charge.cardCents),
2867
- total: true
2868
- }] : copy.countsCredits ? [{
2785
+ ...owesMoney ? [toPayTotal(charge, money)] : copy.countsCredits ? [{
2869
2786
  key: "credits",
2870
2787
  label: "From your pass",
2871
2788
  value: credits(facts.covered),
@@ -2882,6 +2799,20 @@ function fundedSummary(option, input) {
2882
2799
  copy
2883
2800
  };
2884
2801
  }
2802
+ /** What's left to pay: today by card, or to the business directly. */
2803
+ function toPayTotal(charge, money) {
2804
+ return charge.remainder === "direct" ? {
2805
+ key: "to-pay",
2806
+ label: "To pay directly",
2807
+ value: money(charge.directCents),
2808
+ total: true
2809
+ } : {
2810
+ key: "to-pay",
2811
+ label: "To pay",
2812
+ value: money(charge.cardCents),
2813
+ total: true
2814
+ };
2815
+ }
2885
2816
  /**
2886
2817
  * Whether the breakdown says something the chosen option's row and button don't:
2887
2818
  * a code, a combination price or account credit coming off. One date shows it
@@ -2922,15 +2853,18 @@ function presentSelectionFunding(input) {
2922
2853
  summary: null,
2923
2854
  buttonText: null,
2924
2855
  cardCents: null,
2856
+ collection: null,
2925
2857
  takesPayment: orderPrice(option, true, input).totalCents > 0
2926
2858
  };
2927
2859
  case "entitlement": {
2928
- const { summary, facts, copy } = fundedSummary(option, input);
2860
+ const collection = collectionShown(input.collectionsOf(fundingOptionPick(option)), input.chosenCollection);
2861
+ const { summary, facts, copy } = fundedSummary(option, collection, input);
2929
2862
  return {
2930
2863
  ...common,
2931
2864
  summary,
2932
2865
  buttonText: copy.button(facts),
2933
2866
  cardCents: facts.charge.cardCents,
2867
+ collection,
2934
2868
  takesPayment: facts.charge.cardCents > 0
2935
2869
  };
2936
2870
  }
@@ -2974,6 +2908,11 @@ function fundingPaymentStepState(base, lookup, view, priced) {
2974
2908
  canContinue: false
2975
2909
  };
2976
2910
  case "loaded":
2911
+ if (lookup.reload !== null) return {
2912
+ ...base,
2913
+ status: base.status === "ready" ? "loading" : base.status,
2914
+ canContinue: false
2915
+ };
2977
2916
  if (!view || view.buttonText === null) return base;
2978
2917
  return {
2979
2918
  ...base,
@@ -2987,7 +2926,8 @@ function fundingPaymentStepState(base, lookup, view, priced) {
2987
2926
  //#region ../blocks/src/system/runtime/nodes/event-registration/useGuestDetailsCheck.ts
2988
2927
  /** When a guest completes details on a full event with a waitlist, asks the
2989
2928
  * server whether their email has an unfinished booking to pay for instead.
2990
- * The answer is navigation only; submission still owns the booking. */
2929
+ * The answer is navigation only;
2930
+ * submission still owns the booking. */
2991
2931
  function useGuestDetailsCheck(input) {
2992
2932
  const [checkingNextStep, setCheckingNextStep] = useState(false);
2993
2933
  const checkDetailsNextStep = () => checkGuestNextStep(input, guestNextStepRequest(input), setCheckingNextStep);
@@ -3020,7 +2960,8 @@ async function checkGuestNextStep(input, request, setCheckingNextStep) {
3020
2960
  }
3021
2961
  function guestNextStepRequest(input) {
3022
2962
  const buyer = parseParticipantEmail(input.formData.email);
3023
- return input.registrationTarget ? {
2963
+ if (!input.registrationTarget) return null;
2964
+ return {
3024
2965
  subject: toRegistrationRequestSubject(input.registrationTarget.subject, input.selectedAttendanceMode),
3025
2966
  selections: input.ticketSelections,
3026
2967
  selectedSlidingAmount: input.selectedSlidingAmount ?? void 0,
@@ -3030,7 +2971,7 @@ function guestNextStepRequest(input) {
3030
2971
  email: buyer.value
3031
2972
  } : { kind: "unknown" },
3032
2973
  purchaseTarget: "eventTickets"
3033
- } : null;
2974
+ };
3034
2975
  }
3035
2976
  //#endregion
3036
2977
  //#region ../blocks/src/system/runtime/nodes/event-registration/paymentResponse.ts
@@ -3209,6 +3150,7 @@ function usePaymentTransitions(options, runtime) {
3209
3150
  });
3210
3151
  options.setStep("payment");
3211
3152
  }, [
3153
+ options.api.config.siteId,
3212
3154
  options.setStep,
3213
3155
  setState,
3214
3156
  note
@@ -3534,22 +3476,16 @@ const eventRegistrationWizardDeps = {
3534
3476
  */
3535
3477
  function presentWizardStep(facts) {
3536
3478
  return registrationPresentation(facts.flow, registrationRoute({
3537
- chooseEvent: !facts.hasPreSelectedContext,
3479
+ chooseEvent: entryChoosesEvent(facts.entry),
3538
3480
  payment: registrationPaymentRoute(facts)
3539
3481
  }));
3540
3482
  }
3541
- /** The amount field starts at the suggested price on a sliding-scale event. */
3542
- function initialSlidingAmountInput(event) {
3543
- const suggested = getSlidingScaleForEvent(event)?.suggestedAmount;
3544
- return suggested === null || suggested === void 0 ? "" : formatCentsAsCurrencyInput(suggested);
3545
- }
3546
3483
  function useEventRegistrationWizard(options) {
3547
3484
  return useEventRegistrationWizardWithDeps(options, eventRegistrationWizardDeps);
3548
3485
  }
3549
3486
  const CHOOSER_CLOCK = { kind: "relative" };
3550
3487
  /** The wizard owns the step, so it owns whether the clock has stopped this visitor starting a booking. */
3551
- function useFreshBookingClosure(deps, options, events, step, visitorHoldsPlace) {
3552
- const recoveryRequest = useEventRegistrationRecoveryRequest();
3488
+ function useFreshBookingClosure(deps, options, events, step, visitorHoldsPlace, recoveryRequest) {
3553
3489
  const nextBoundary = useMemo(() => nextFreshBookingBoundary(events, options.occurrenceContext, options.subject), [
3554
3490
  events,
3555
3491
  options.occurrenceContext,
@@ -3572,6 +3508,10 @@ function useFreshBookingClosure(deps, options, events, step, visitorHoldsPlace)
3572
3508
  function holdsPlace(claim, payment) {
3573
3509
  return claim.kind !== "none" || payment.retryingHeldPlace;
3574
3510
  }
3511
+ /** A hybrid event's places and prices depend on how they'll attend, so nothing is quoted until they've said. */
3512
+ function attendanceAllowsQuote(attendance, selected, wanted) {
3513
+ return wanted && !attendanceChoicePending(attendance, selected);
3514
+ }
3575
3515
  /** A date that has closed has nothing to quote for a new booking. */
3576
3516
  function bookingClosureAllowsQuote(closure, wanted) {
3577
3517
  return closure.kind !== "closedEarly" && closure.kind !== "started" && wanted;
@@ -3678,15 +3618,27 @@ function useEventRegistrationWizardWithDeps(options, deps) {
3678
3618
  const arrivalCredential = deps.useWaitlistClaimCredential();
3679
3619
  const nowIso = deps.useBookingNowIso(options.now);
3680
3620
  const choiceNowIso = deps.useBookingNowIso(options.now, CHOOSER_CLOCK);
3681
- const { events, registrationEvents, recoveryEvents, scopedEvents, claimEventSource } = useRegistrationEventSource(options, choiceNowIso);
3682
- const preSelectedEvent = useMemo(() => findPreSelectedEvent({
3683
- scopedEvents,
3684
- occurrenceContext: options.occurrenceContext
3685
- }), [scopedEvents, options.occurrenceContext]);
3686
- const hasPreSelectedContext = !!(options.occurrenceContext || preSelectedEvent);
3687
- const [flowState, dispatchFlow] = useReducer(registrationFlowReducer, hasPreSelectedContext, (context) => ({
3688
- ...createInitialRegistrationFlowState(context),
3689
- draft: createRegistrationDraftData(preSelectedEvent ?? null),
3621
+ const { events, registrationEvents, recoveryEvents, scopedEvents: pageChoices, claimEventSource } = useRegistrationEventSource(options, choiceNowIso);
3622
+ const arrivedFor = useEventRegistrationRecoveryRequest();
3623
+ const [arrivalFinished, setArrivalFinished] = useState(false);
3624
+ const arrival = arrivalFinished ? "none" : arrivedFor;
3625
+ const entryFor = useCallback((request) => decideRegistrationEntry({
3626
+ events: pageChoices,
3627
+ occurrenceContext: options.occurrenceContext,
3628
+ offer: options.datePageOffer,
3629
+ arrival: request,
3630
+ now: new Date(choiceNowIso)
3631
+ }), [
3632
+ pageChoices,
3633
+ options.occurrenceContext,
3634
+ options.datePageOffer,
3635
+ choiceNowIso
3636
+ ]);
3637
+ const entry = useMemo(() => entryFor(arrival), [entryFor, arrival]);
3638
+ const scopedEvents = entry.choices;
3639
+ const preSelectedEvent = entryPageEvent(entry);
3640
+ const [flowState, dispatchFlow] = useReducer(registrationFlowReducer, entryStart(entry), (start) => ({
3641
+ ...createInitialRegistrationFlowState(start),
3690
3642
  invitation: beginWaitlistInvitation(arrivalCredential)
3691
3643
  }));
3692
3644
  const [restoredCode, restoreDiscountCode] = useState(null);
@@ -3704,18 +3656,8 @@ function useEventRegistrationWizardWithDeps(options, deps) {
3704
3656
  const paymentIntent = flowState.paymentSelection;
3705
3657
  const { selection, runChoices, formData: draftFormData, guests, selectedAttendanceMode, selectedTicketLines, roomChoices, selectedSlidingAmountInput: draftSlidingAmountInput } = flowState.draft;
3706
3658
  const selectedEvent = primarySelectionItem(selection);
3707
- const selectionMode = registrationSelectionMode({
3708
- events: scopedEvents,
3709
- hasPreSelectedContext
3710
- });
3659
+ const selectionMode = entrySelectionMode(entry);
3711
3660
  const several = severalItemsOf(selection);
3712
- const setSelection = useCallback((value) => dispatchFlow({
3713
- type: "draft-edited",
3714
- edit: {
3715
- field: "selection",
3716
- value
3717
- }
3718
- }), []);
3719
3661
  const setRunChoices = useCallback((value) => dispatchFlow({
3720
3662
  type: "draft-edited",
3721
3663
  edit: {
@@ -3816,10 +3758,11 @@ function useEventRegistrationWizardWithDeps(options, deps) {
3816
3758
  }));
3817
3759
  }, [portalAuthState, portalProfile]);
3818
3760
  const handleLogout = () => logoutPortal(options.anchorId);
3761
+ const bookingContext = bookingOccurrenceContext(options.occurrenceContext, preSelectedEvent, selection);
3819
3762
  const registrationTarget = useMemo(() => resolveRegistrationTarget({
3820
- occurrenceContext: options.occurrenceContext,
3763
+ occurrenceContext: bookingContext,
3821
3764
  selection
3822
- }), [options.occurrenceContext, selection]);
3765
+ }), [bookingContext, selection]);
3823
3766
  const registrationOccurrenceId = getRegistrationOccurrenceId(registrationTarget);
3824
3767
  const registrationNavigation = useRegistrationNavigation({
3825
3768
  pageNavigation: options.pageNavigation,
@@ -3883,7 +3826,7 @@ function useEventRegistrationWizardWithDeps(options, deps) {
3883
3826
  detailsInPage: () => Object.keys(validateFormData(formData)).length === 0
3884
3827
  });
3885
3828
  const { recovery: paymentStatusRecovery, showRecovery: setPaymentStatusRecovery, check: handleCheckPaymentStatus, continuePayment: handleContinueExistingPayment, returnToPayment: handleReturnToPayment, returnToBooking: handleReturnToBooking } = paymentController;
3886
- const bookingClosure = useFreshBookingClosure(deps, options, events, step, holdsPlace(waitlistClaim, paymentController));
3829
+ const bookingClosure = useFreshBookingClosure(deps, options, events, step, holdsPlace(waitlistClaim, paymentController), arrival);
3887
3830
  const eligibilityResult = deps.useEligibility({
3888
3831
  refreshKey: optionsRefreshKey,
3889
3832
  buyerEmail: formData.email,
@@ -3894,7 +3837,7 @@ function useEventRegistrationWizardWithDeps(options, deps) {
3894
3837
  api.config.siteId,
3895
3838
  portalIdentity
3896
3839
  ]),
3897
- enabled: bookingClosureAllowsQuote(bookingClosure, shouldRefreshAfterRegistrationError(step, errorAction, shouldLoadRegistrationOptions(portalAuthState, step))),
3840
+ enabled: bookingClosureAllowsQuote(bookingClosure, attendanceAllowsQuote(attendance, selectedAttendanceMode, shouldRefreshAfterRegistrationError(step, errorAction, shouldLoadRegistrationOptions(portalAuthState, step)))),
3898
3841
  subject: registrationTarget?.subject ?? null,
3899
3842
  attendanceMode: selectedAttendanceMode,
3900
3843
  ticketSelections: quoteSelections,
@@ -3904,7 +3847,8 @@ function useEventRegistrationWizardWithDeps(options, deps) {
3904
3847
  });
3905
3848
  const existingRegistrationResult = deps.useExistingEventRegistration({
3906
3849
  isAuthenticated: portalAuthState === "authenticated",
3907
- occurrenceId: registrationOccurrenceId
3850
+ occurrenceId: registrationOccurrenceId,
3851
+ completedBookings: flowState.completedOutcomes.length
3908
3852
  });
3909
3853
  const existingRegistrations = useMemo(() => existingRegistrationResult.registrations.filter((registration) => registration.occurrenceId === registrationOccurrenceId), [existingRegistrationResult.registrations, registrationOccurrenceId]);
3910
3854
  const registrationOptionsState = eligibilityResult.state;
@@ -4016,14 +3960,46 @@ function useEventRegistrationWizardWithDeps(options, deps) {
4016
3960
  selectedAttendanceMode,
4017
3961
  usesTicketTypeSelections
4018
3962
  ]);
4019
- const selectionPayment = decideSelectionPayment({
4020
- selection,
4021
- runChoices,
4022
- eligibility
3963
+ const { selectionFunding, datesQuote } = useWizardSelectionFunding({
3964
+ api,
3965
+ target: registrationTarget,
3966
+ event: currentEvent,
3967
+ several,
3968
+ attendanceMode: selectedAttendanceMode,
3969
+ ticketSelections,
3970
+ selectedSlidingAmount,
3971
+ identity: getPortalSubjectEmail(portalProfile),
3972
+ step,
3973
+ portalAuthState
3974
+ });
3975
+ const runsPayment = useRunsSelectionPayment({
3976
+ api,
3977
+ identity: getPortalSubjectEmail(portalProfile),
3978
+ ...runsPaymentAsk({
3979
+ several,
3980
+ step,
3981
+ portalAuthState,
3982
+ selectionChoiceMessage,
3983
+ request: {
3984
+ selection,
3985
+ runChoices,
3986
+ places: ticketsCount,
3987
+ attendanceMode: selectedAttendanceMode
3988
+ }
3989
+ })
4023
3990
  });
3991
+ const severalAnswer = severalItemsPaymentAnswer(several, selectionFunding.lookup, runsPayment);
3992
+ const selectionPayment = answeredPayment(severalAnswer);
3993
+ useEffect(() => {
3994
+ dispatchFlow({
3995
+ type: "selection-payment-updated",
3996
+ payment: selectionPayment
3997
+ });
3998
+ }, [selectionPayment]);
4024
3999
  const admission = resolveRegistrationAdmission({
4025
4000
  eligibility,
4026
4001
  eligibilityError,
4002
+ bookingsClosed: eligibilityResult.bookingsClosed,
4027
4003
  eligibilityLoading,
4028
4004
  holdsOwnPlace: visitorHoldsOwnPlace({
4029
4005
  hasWaitlistClaim: waitlistClaim.kind === "ready",
@@ -4031,7 +4007,7 @@ function useEventRegistrationWizardWithDeps(options, deps) {
4031
4007
  }),
4032
4008
  isAuthenticated: portalAuthState === "authenticated",
4033
4009
  businessName: options.siteName,
4034
- severalRunsNeedCard: severalRunsNeedCard(several, selectionPayment)
4010
+ selectionPayment
4035
4011
  });
4036
4012
  const ticketSelectionPurpose = getTicketSelectionPurpose({
4037
4013
  admission,
@@ -4090,7 +4066,7 @@ function useEventRegistrationWizardWithDeps(options, deps) {
4090
4066
  setGuestSectionShake(false);
4091
4067
  };
4092
4068
  const eventRequiresPayment = useMemo(() => {
4093
- if (selectionPayment.kind === "several") return selectionPayment.due === "card";
4069
+ if (several !== null) return !selectionPaysNothing(selectionPayment);
4094
4070
  if (selectedEventSlidingScale) return (selectedSlidingAmount ?? 0) > 0;
4095
4071
  return resolveEventRequiresPayment({
4096
4072
  eligibility,
@@ -4103,6 +4079,7 @@ function useEventRegistrationWizardWithDeps(options, deps) {
4103
4079
  currentEvent,
4104
4080
  selectedEventSlidingScale,
4105
4081
  selectedSlidingAmount,
4082
+ several,
4106
4083
  selectionPayment
4107
4084
  ]);
4108
4085
  const { ticketContinuation, handleTicketsComplete } = useRegistrationAdmission({
@@ -4124,9 +4101,9 @@ function useEventRegistrationWizardWithDeps(options, deps) {
4124
4101
  ticketSelections,
4125
4102
  selectedSlidingAmount
4126
4103
  });
4127
- const blockDetailsCompletion = (blocker) => {
4104
+ const blockDetailsCompletion = (blocker, action = "places") => {
4128
4105
  if (blocker.kind === "unavailable") {
4129
- setErrorAction("places");
4106
+ setErrorAction(action);
4130
4107
  setErrorMessage(blocker.message);
4131
4108
  setStep("error");
4132
4109
  }
@@ -4181,7 +4158,7 @@ function useEventRegistrationWizardWithDeps(options, deps) {
4181
4158
  kind: "unavailable",
4182
4159
  reason: "closed",
4183
4160
  message: continuation.message
4184
- });
4161
+ }, DETAILS_CHECK_REFUSAL_RECOVERY);
4185
4162
  case "payment-step":
4186
4163
  setStep("select-payment");
4187
4164
  return {
@@ -4210,10 +4187,17 @@ function useEventRegistrationWizardWithDeps(options, deps) {
4210
4187
  reason: "blocked",
4211
4188
  message: "Agree to the terms of sale to continue."
4212
4189
  };
4213
- if (fundingView?.option.kind === "entitlement") return handleSubmit("stripe", void 0, {
4214
- method: "stripe",
4215
- collectionOptionKind: "upfront"
4216
- });
4190
+ if (fundingView?.option.kind === "entitlement") {
4191
+ if (fundingView.collection === null && fundingView.takesPayment) return {
4192
+ ok: false,
4193
+ reason: "blocked",
4194
+ message: "Choose an available payment option."
4195
+ };
4196
+ return handleSubmit("stripe", void 0, {
4197
+ method: "stripe",
4198
+ collectionOptionKind: fundingView.collection ?? "upfront"
4199
+ });
4200
+ }
4217
4201
  const submitPlan = resolveEventRegistrationSubmitPlan({
4218
4202
  paymentSelection,
4219
4203
  eventRequiresPayment,
@@ -4267,18 +4251,7 @@ function useEventRegistrationWizardWithDeps(options, deps) {
4267
4251
  runChoices,
4268
4252
  primaryTicketUnits: ticketSelectionSummaryLines
4269
4253
  });
4270
- const { selectionFunding, datesQuote } = useWizardSelectionFunding({
4271
- api,
4272
- target: registrationTarget,
4273
- event: currentEvent,
4274
- attendanceMode: selectedAttendanceMode,
4275
- ticketSelections,
4276
- selectedSlidingAmount,
4277
- identity: getPortalSubjectEmail(portalProfile),
4278
- step,
4279
- portalAuthState
4280
- });
4281
- const pricedAsOrder = pricedAsWholeOrder(several, datesQuote);
4254
+ const pricedAsOrder = pricesAsOrder(several, datesQuote);
4282
4255
  const reviseFunding = (revised, message) => {
4283
4256
  setErrorMessage("");
4284
4257
  selectionFunding.revise(revised, message);
@@ -4315,11 +4288,11 @@ function useEventRegistrationWizardWithDeps(options, deps) {
4315
4288
  context: discountContext
4316
4289
  });
4317
4290
  const { code: discountCode, editCode: setDiscountCode } = discountView;
4318
- const discountCardOnly = registrationDiscountCardOnly(paymentIntent.method, selectionFunding.lookup);
4291
+ const discountAccess = registrationDiscountAccess(paymentIntent.method, selectionFunding.lookup);
4319
4292
  useEffect(() => {
4320
- if (discountCardOnly && discountCode) setDiscountCode("");
4293
+ if (discountAccess !== "card" && discountCode) setDiscountCode("");
4321
4294
  }, [
4322
- discountCardOnly,
4295
+ discountAccess,
4323
4296
  discountCode,
4324
4297
  setDiscountCode
4325
4298
  ]);
@@ -4349,29 +4322,37 @@ function useEventRegistrationWizardWithDeps(options, deps) {
4349
4322
  const directPaymentInput = {
4350
4323
  eligibility,
4351
4324
  currentEvent,
4352
- occurrenceContext: options.occurrenceContext,
4353
- ticketSelectionSubtotalCents: cardOptionsSubtotal({
4354
- several,
4325
+ occurrenceContext: bookingContext,
4326
+ ticketSelectionSubtotalCents: oneBookingCardSubtotal({
4355
4327
  datesQuote,
4356
4328
  primarySubtotalCents,
4357
4329
  ticketSelectionSubtotalCents
4358
4330
  }),
4359
4331
  automaticDiscount: singlePrices.automaticDiscount,
4360
- nowIso,
4361
- selectionPayment
4332
+ nowIso
4362
4333
  };
4363
- const directPaymentOptions = resolveWizardDirectPaymentOptions(directPaymentInput);
4364
- const paymentInFullNote = decidePaidInFullNote(directPaymentInput, directPaymentOptions, choiceNowIso);
4334
+ const itemLabel = useMemo(() => selectionItemLabels(selection), [selection]);
4335
+ const { directPaymentOptions, moneyCardOptions, paymentInFullNote, paysNothing, paymentOptionsLoading, paymentOptionsError } = decideWizardPaymentOptions({
4336
+ several,
4337
+ severalAnswer,
4338
+ directPaymentInput,
4339
+ chosenFunding: chosenFundingPick(selectionFunding.lookup),
4340
+ orderTotalCents: ticketSelectionSubtotalCents,
4341
+ itemLabel,
4342
+ choiceNowIso,
4343
+ eligibility,
4344
+ eligibilityError,
4345
+ loading: anyLoading(eligibilityLoading, checkingNextStep, combinationPricing.quoting)
4346
+ });
4365
4347
  const { paymentDecision, paymentSelection, paymentStepState: quotedPaymentStepState } = resolveWizardPaymentView({
4366
4348
  directPaymentOptions,
4367
4349
  paymentIntent,
4368
4350
  eligibility,
4369
4351
  admission,
4370
- selectionPayment,
4371
- eligibilityLoading,
4372
- quoting: combinationPricing.quoting,
4373
- checkingNextStep,
4374
- eligibilityError,
4352
+ paysNothing,
4353
+ offersEntitlements: several === null,
4354
+ loading: paymentOptionsLoading,
4355
+ error: paymentOptionsError,
4375
4356
  isAuthenticated: flowState.isAuthenticated,
4376
4357
  portalCreditState,
4377
4358
  discountCode: codeAwaitingApply ? discountCode : "",
@@ -4385,7 +4366,8 @@ function useEventRegistrationWizardWithDeps(options, deps) {
4385
4366
  places: ticketsCount,
4386
4367
  eligibility,
4387
4368
  event: currentEvent,
4388
- directPaymentOptions,
4369
+ moneyCardOptions,
4370
+ several,
4389
4371
  paymentDecision,
4390
4372
  pricing: combinationPricing,
4391
4373
  creditState: portalCreditState,
@@ -4400,8 +4382,7 @@ function useEventRegistrationWizardWithDeps(options, deps) {
4400
4382
  admission
4401
4383
  }
4402
4384
  });
4403
- const selectionMethod = paymentSelection.method;
4404
- const shouldShowDiscountToggle = registrationDiscountEntryVisible(discountView, selectionMethod);
4385
+ const shouldShowDiscountToggle = registrationDiscountEntryVisible(discountView);
4405
4386
  const requirementsLayout = useMemo(() => decideSelectionRequirementsLayout(selection), [selection]);
4406
4387
  const questions = useEventRegistrationQuestions({
4407
4388
  api,
@@ -4530,19 +4511,12 @@ function useEventRegistrationWizardWithDeps(options, deps) {
4530
4511
  */
4531
4512
  const handleBookAnother = () => {
4532
4513
  clearWaitlistClaimLocation();
4514
+ setArrivalFinished(true);
4533
4515
  resetRegistrationAfterExpiry({
4534
- hasPreSelectedContext,
4535
- preSelectedEvent,
4516
+ start: entryStart(entryFor("none")),
4536
4517
  dispatchFlow,
4537
- setSelectedTicketLines,
4538
- setSelectedSlidingAmountInput,
4539
- setSelectedAttendanceMode,
4540
4518
  setErrorMessage
4541
4519
  });
4542
- setSelectedSlidingAmountInput(initialSlidingAmountInput(preSelectedEvent ?? null));
4543
- setRoomChoices([]);
4544
- setSelection(preSelectedEvent ? [preSelectedEvent] : []);
4545
- setGuests([]);
4546
4520
  setGuestErrors({});
4547
4521
  combinationPricing.reset();
4548
4522
  selectionFunding.reset();
@@ -4557,15 +4531,10 @@ function useEventRegistrationWizardWithDeps(options, deps) {
4557
4531
  reset: () => {
4558
4532
  clearWaitlistClaimLocation();
4559
4533
  resetRegistrationAfterExpiry({
4560
- hasPreSelectedContext,
4561
- preSelectedEvent,
4534
+ start: entryStart(entry),
4562
4535
  dispatchFlow,
4563
- setSelectedTicketLines,
4564
- setSelectedSlidingAmountInput,
4565
- setSelectedAttendanceMode,
4566
4536
  setErrorMessage
4567
4537
  });
4568
- setRoomChoices([]);
4569
4538
  }
4570
4539
  });
4571
4540
  const handlePaymentSelectionChange = useCallback((selection) => {
@@ -4578,7 +4547,7 @@ function useEventRegistrationWizardWithDeps(options, deps) {
4578
4547
  const presentation = presentWizardStep({
4579
4548
  step,
4580
4549
  flow: flowState,
4581
- hasPreSelectedContext,
4550
+ entry,
4582
4551
  admission,
4583
4552
  eventRequiresPayment: resolveRouteRequiresPayment({
4584
4553
  event: currentEvent,
@@ -4631,7 +4600,8 @@ function useEventRegistrationWizardWithDeps(options, deps) {
4631
4600
  /** Why one booking's card payment is the whole price although its terms offer a deposit; null otherwise. */
4632
4601
  paymentInFullNote,
4633
4602
  anchorId: options.anchorId,
4634
- occurrenceContext: options.occurrenceContext,
4603
+ /** The page's occurrence while the booking is for the page's date, otherwise null. */
4604
+ occurrenceContext: bookingContext,
4635
4605
  registrationTarget,
4636
4606
  subject: options.subject,
4637
4607
  events,
@@ -4641,7 +4611,8 @@ function useEventRegistrationWizardWithDeps(options, deps) {
4641
4611
  /** Everything on this page a booking could be for, whether or not it's still a choice. */
4642
4612
  recoveryEvents,
4643
4613
  preSelectedEvent: preSelectedDisplayEvent(preSelectedEvent, currentEvent, displayEvent),
4644
- hasPreSelectedContext,
4614
+ /** Where booking starts on this page, and what it chooses from. */
4615
+ entry,
4645
4616
  presentation,
4646
4617
  flow: flowState,
4647
4618
  setStep: (next) => {
@@ -4662,8 +4633,6 @@ function useEventRegistrationWizardWithDeps(options, deps) {
4662
4633
  severalItems: several,
4663
4634
  /** One way of attending for every chosen item. */
4664
4635
  attendance,
4665
- /** How the whole selection is paid. */
4666
- selectionPayment,
4667
4636
  /** What each run's ticket choice is checked against when booking several runs. */
4668
4637
  runChoiceFacts,
4669
4638
  selectionPrice,
@@ -4789,6 +4758,10 @@ function useEventRegistrationWizardWithDeps(options, deps) {
4789
4758
  registrationOptionsState,
4790
4759
  eligibilityLoading: anyLoading(eligibilityLoading, checkingNextStep, combinationPricing.quoting),
4791
4760
  eligibilityError,
4761
+ /** The payment step's own wait: the booking options, and several runs' ways to pay. */
4762
+ paymentOptionsLoading,
4763
+ /** Why the payment step can't show ways to pay, when the booking options or several runs' ways to pay didn't load. */
4764
+ paymentOptionsError,
4792
4765
  /** Asks for the booking options again, after they failed to load. */
4793
4766
  reloadOptions: () => setOptionsRefreshKey((value) => value + 1),
4794
4767
  existingRegistrations,
@@ -4808,7 +4781,7 @@ function useEventRegistrationWizardWithDeps(options, deps) {
4808
4781
  discountsAvailableLoading: discountView.discountsAvailableLoading,
4809
4782
  discountContext,
4810
4783
  shouldShowDiscountToggle,
4811
- discountCardOnly,
4784
+ discountAccess,
4812
4785
  verification,
4813
4786
  paymentController,
4814
4787
  paymentStatusRecovery,
@@ -4863,7 +4836,7 @@ function roomChooserStep(input) {
4863
4836
  function resolveSelectionChoiceMessages(input) {
4864
4837
  if (input.several !== "runs") return {
4865
4838
  slidingScaleSelectionMessage: getSlidingScaleSelectionMessage(input),
4866
- selectionChoiceMessage: input.roomMessage
4839
+ selectionChoiceMessage: attendanceChoicePending(input.attendance, input.facts.attendanceMode) ? ATTENDANCE_CHOICE_MESSAGE : input.roomMessage
4867
4840
  };
4868
4841
  return {
4869
4842
  slidingScaleSelectionMessage: incompleteRunChoiceMessage(input),
@@ -4940,43 +4913,118 @@ function registrationCodeField(field, quote) {
4940
4913
  };
4941
4914
  }
4942
4915
  /**
4943
- * The card options on the payment step. One item offers what its own options
4944
- * allow. Several items offer one way, paying the whole total up front, when
4945
- * anything is due (issue 1725); the first item's options don't decide it.
4916
+ * One booking's card options: what its own options allow, repriced with its
4917
+ * automatic discount. Several items take theirs from the server's answer.
4918
+ */
4919
+ function oneBookingCardOptions(input) {
4920
+ const { eligibility } = input;
4921
+ if (!eligibility || !eligibility.requiresPayment || !eligibility.price) return [];
4922
+ return buildDirectPaymentOptions(input, eligibility, {
4923
+ subtotalCents: input.ticketSelectionSubtotalCents ?? eligibility.price,
4924
+ approvedPaymentOptions: eligibility.paymentOptions,
4925
+ paymentTerms: eligibility.paymentTerms
4926
+ }, previewTotalWithAutomaticDiscount(input));
4927
+ }
4928
+ /** The steps where several items need the server's answer: their tickets are chosen from here on. */
4929
+ const SEVERAL_ANSWER_STEPS = /* @__PURE__ */ new Set([
4930
+ "select-tickets",
4931
+ "enter-details",
4932
+ "select-payment"
4933
+ ]);
4934
+ /**
4935
+ * The payment step's options. One booking keeps its own card options and
4936
+ * paid-in-full note; several items offer the ways the server's answer collects
4937
+ * the chosen option's money.
4946
4938
  */
4947
- function resolveWizardDirectPaymentOptions(input) {
4948
- const { eligibility, selectionPayment } = input;
4949
- if (!eligibility) return [];
4950
- switch (selectionPayment.kind) {
4951
- case "one-item":
4952
- if (!eligibility.requiresPayment || !eligibility.price) return [];
4953
- return buildDirectPaymentOptions(input, eligibility, {
4954
- subtotalCents: input.ticketSelectionSubtotalCents ?? eligibility.price,
4955
- approvedPaymentOptions: eligibility.paymentOptions,
4956
- paymentTerms: eligibility.paymentTerms
4957
- }, previewTotalWithAutomaticDiscount(input));
4958
- case "several": {
4959
- const subtotalCents = input.ticketSelectionSubtotalCents;
4960
- if (selectionPayment.due === "nothing" || subtotalCents === null) return [];
4961
- return buildDirectPaymentOptions(input, eligibility, {
4962
- subtotalCents,
4963
- approvedPaymentOptions: [{
4964
- kind: "payInFull",
4965
- amountCents: subtotalCents,
4966
- currency: eligibility.currency
4967
- }],
4968
- paymentTerms: { allowedOptions: [{ kind: "upfront" }] }
4969
- }, (decided) => decided);
4939
+ function decideWizardPaymentOptions(input) {
4940
+ return input.several === null ? oneBookingPaymentOptions(input) : severalItemsPaymentOptions(input);
4941
+ }
4942
+ function oneBookingPaymentOptions(input) {
4943
+ const directPaymentOptions = oneBookingCardOptions(input.directPaymentInput);
4944
+ return {
4945
+ directPaymentOptions,
4946
+ moneyCardOptions: directPaymentOptions,
4947
+ paymentInFullNote: decidePaidInFullNote(input.directPaymentInput, directPaymentOptions, input.choiceNowIso),
4948
+ paysNothing: input.eligibility?.isFree ?? false,
4949
+ paymentOptionsLoading: input.loading,
4950
+ paymentOptionsError: input.eligibilityError
4951
+ };
4952
+ }
4953
+ /** The chosen option's ways to pay, and the money option's own for its rows beside a pass or membership. */
4954
+ function severalItemsPaymentOptions(input) {
4955
+ const payment = answeredPayment(input.severalAnswer);
4956
+ const optionsFor = (collections, orderTotalCents) => buildSelectionCollectionOptions({
4957
+ collections,
4958
+ orderTotalCents,
4959
+ itemLabel: input.itemLabel
4960
+ });
4961
+ const runsStatus = input.several === "runs" ? input.severalAnswer.tag : "loaded";
4962
+ return {
4963
+ directPaymentOptions: optionsFor(pickCollections(payment, input.chosenFunding), input.orderTotalCents),
4964
+ moneyCardOptions: optionsFor(moneyCollections(payment), input.chosenFunding.kind === "money" ? input.orderTotalCents : null),
4965
+ paymentInFullNote: null,
4966
+ paysNothing: selectionPaysNothing(payment),
4967
+ paymentOptionsLoading: input.loading || runsStatus === "waiting",
4968
+ paymentOptionsError: input.eligibilityError ?? runsLoadError(runsStatus)
4969
+ };
4970
+ }
4971
+ function runsLoadError(status) {
4972
+ return status === "failed" ? RUNS_PAYMENT_LOAD_FAILED : null;
4973
+ }
4974
+ function answeredPayment(answer) {
4975
+ return answer.tag === "loaded" ? answer.payment : null;
4976
+ }
4977
+ /** Several runs ask how they can be paid once each run's ticket is chosen. */
4978
+ function runsPaymentAsk(input) {
4979
+ return {
4980
+ request: input.selectionChoiceMessage === null ? runsSelectionPaymentRequest(input.request) : null,
4981
+ enabled: input.several === "runs" && SEVERAL_ANSWER_STEPS.has(input.step) && input.portalAuthState !== "checking"
4982
+ };
4983
+ }
4984
+ /** Several items, and one date paid by a pass or membership, are priced as an order. */
4985
+ function pricesAsOrder(several, datesQuote) {
4986
+ return several !== null || datesQuote !== null;
4987
+ }
4988
+ /** One date's card options keep the date's own price while a pass or membership prices the order. */
4989
+ function oneBookingCardSubtotal(input) {
4990
+ return input.datesQuote !== null ? input.primarySubtotalCents : input.ticketSelectionSubtotalCents;
4991
+ }
4992
+ /** Dates have their answer with their funding; runs ask for theirs on their own. */
4993
+ function severalItemsPaymentAnswer(several, dates, runs) {
4994
+ switch (several) {
4995
+ case null: return { tag: "none" };
4996
+ case "dates": switch (dates.tag) {
4997
+ case "idle":
4998
+ case "loading": return { tag: "waiting" };
4999
+ case "failed": return { tag: "failed" };
5000
+ case "loaded": return dates.payment ? {
5001
+ tag: "loaded",
5002
+ payment: dates.payment
5003
+ } : { tag: "failed" };
5004
+ }
5005
+ case "runs": switch (runs.tag) {
5006
+ case "idle":
5007
+ case "loading": return { tag: "waiting" };
5008
+ case "failed": return { tag: "failed" };
5009
+ case "loaded": return {
5010
+ tag: "loaded",
5011
+ payment: runs.payment
5012
+ };
4970
5013
  }
4971
5014
  }
4972
5015
  }
5016
+ /** The funding option the visitor has picked; money until a pass or membership is offered and picked. */
5017
+ function chosenFundingPick(lookup) {
5018
+ const option = lookupChosenOption(lookup);
5019
+ return option ? fundingOptionPick(option) : { kind: "money" };
5020
+ }
4973
5021
  /**
4974
5022
  * The payment step's sentence when one booking's card options, as shown
4975
5023
  * (repriced, discounts included), have no deposit although its terms offer one.
4976
5024
  */
4977
5025
  function decidePaidInFullNote(input, cardOptions, liveNowIso) {
4978
5026
  const { eligibility } = input;
4979
- if (!eligibility || input.selectionPayment.kind !== "one-item") return null;
5027
+ if (!eligibility) return null;
4980
5028
  return paidInFullNote({
4981
5029
  paymentTerms: eligibility.paymentTerms,
4982
5030
  offeredKinds: cardOptions.map((option) => option.kind),
@@ -5029,11 +5077,12 @@ function resolveWizardPaymentView(input) {
5029
5077
  const paymentDecision = decideEventRegistrationPayment({
5030
5078
  directPaymentOptions: input.directPaymentOptions,
5031
5079
  selection: input.paymentIntent,
5032
- selectionPayment: input.selectionPayment,
5080
+ paysNothing: input.paysNothing,
5081
+ offersEntitlements: input.offersEntitlements,
5033
5082
  eligibility: input.eligibility,
5034
5083
  admission: input.admission,
5035
- loading: anyLoading(input.eligibilityLoading, input.checkingNextStep, input.quoting),
5036
- error: input.eligibilityError,
5084
+ loading: input.loading,
5085
+ error: input.error,
5037
5086
  isAuthenticated: input.isAuthenticated,
5038
5087
  creditState: input.portalCreditState,
5039
5088
  manualDiscountPending: Boolean(input.discountCode.trim())
@@ -5066,13 +5115,16 @@ function presentWizardSelectionFunding(input) {
5066
5115
  const currency = input.eligibility?.currency;
5067
5116
  if (input.lookup.tag !== "loaded" || !currency) return null;
5068
5117
  const dates = fundingDatesOf(input.selection, input.itemPrice);
5118
+ const payment = input.lookup.payment;
5069
5119
  return presentSelectionFunding({
5070
5120
  funding: input.lookup.funding,
5071
5121
  pick: input.lookup.pick,
5072
5122
  dates,
5073
5123
  places: input.places,
5074
5124
  currency,
5075
- moneyRows: moneyRows(input, dates.length === 1),
5125
+ moneyRows: moneyRows(input),
5126
+ collectionsOf: (pick) => payment ? collectionsOf(paymentOptionFor(payment, pick)).map((collection) => collection.kind) : ["upfront"],
5127
+ chosenCollection: chosenCardKind(input.paymentDecision),
5076
5128
  chosenOrder: input.pricing.ready ? quotedOrder(input.pricing.quote) : null,
5077
5129
  reductions: quoteReductions(input.pricing.quote),
5078
5130
  availableCreditCents: availableCreditCents(input.creditState, currency),
@@ -5080,32 +5132,38 @@ function presentWizardSelectionFunding(input) {
5080
5132
  formatDay: fundingDayFormatter(input.event)
5081
5133
  });
5082
5134
  }
5135
+ /** The way to pay the visitor has chosen on the payment step, if it's one on offer. */
5136
+ function chosenCardKind(decision) {
5137
+ const state = decision.directPaymentSelectionState;
5138
+ return state.kind === "valid" ? state.selection.collectionOptionKind : null;
5139
+ }
5083
5140
  /**
5084
- * How the money option is offered. Several dates are paid in full, so one row. One date
5085
- * keeps each of its card options (a deposit, say), so choosing money still chooses how.
5141
+ * How the money option is offered: each of its ways to pay (a deposit for one date,
5142
+ * say, or paying directly for several), so choosing money still chooses how. Paying
5143
+ * several dates in full shows the order's price, codes and combination prices included.
5086
5144
  */
5087
- function moneyRows(input, oneDate) {
5088
- const { directPaymentOptions, paymentDecision, lookup } = input;
5145
+ function moneyRows(input) {
5146
+ const { moneyCardOptions: cards, paymentDecision, lookup } = input;
5089
5147
  const money = lookup.tag === "loaded" && lookup.pick.kind === "money";
5090
- const chosen = paymentDecision.directPaymentSelectionState.kind === "valid" ? paymentDecision.directPaymentSelectionState.selection.collectionOptionKind : null;
5091
- if (!oneDate || directPaymentOptions.length === 0) {
5092
- const card = directPaymentOptions[0];
5148
+ const chosen = chosenCardKind(paymentDecision);
5149
+ if (cards.length === 0) {
5150
+ if (input.several !== null && !(lookup.tag === "loaded" && selectionPaysNothing(lookup.payment))) return [];
5093
5151
  return [{
5094
5152
  key: "card",
5095
- label: moneyRowLabel(money && chosen !== null, paymentDecision.preview, card?.label),
5096
- details: card ? paymentChoiceDetails(card) : [],
5153
+ label: moneyRowLabel(false, paymentDecision.preview, void 0),
5154
+ details: [],
5097
5155
  price: null,
5098
5156
  card: null,
5099
5157
  current: true
5100
5158
  }];
5101
5159
  }
5102
- return directPaymentOptions.map((card) => ({
5160
+ return cards.map((card) => ({
5103
5161
  key: card.kind,
5104
5162
  label: moneyRowLabel(money && chosen === card.kind, paymentDecision.preview, card.label),
5105
5163
  details: paymentChoiceDetails(card),
5106
- price: paymentChoicePrice(card.amounts),
5107
- card: directPaymentOptions.length > 1 ? card.kind : null,
5108
- current: directPaymentOptions.length === 1 || chosen === card.kind
5164
+ price: input.several !== null && card.kind === "upfront" ? null : paymentChoicePrice(card.amounts),
5165
+ card: cards.length > 1 ? card.kind : null,
5166
+ current: cards.length === 1 || chosen === card.kind
5109
5167
  }));
5110
5168
  }
5111
5169
  /** A chosen money row says site credit when the credit preview spends it, as the card step does. */
@@ -5145,8 +5203,10 @@ function quotedOrder(quote) {
5145
5203
  };
5146
5204
  }
5147
5205
  /**
5148
- * Asks for the dates' ways to pay while the payment step is open, and
5149
- * what the quote then prices: the chosen option's whole order.
5206
+ * Asks for the dates' ways to pay, and what the quote then prices: the chosen
5207
+ * option's whole order. One date asks on its payment step; several dates as
5208
+ * soon as their tickets are chosen, since their answer decides whether there's
5209
+ * anything to pay and whether the site can take it.
5150
5210
  */
5151
5211
  function useWizardSelectionFunding(input) {
5152
5212
  const { target, attendanceMode, ticketSelections, selectedSlidingAmount } = input;
@@ -5164,25 +5224,18 @@ function useWizardSelectionFunding(input) {
5164
5224
  ticketSelections,
5165
5225
  selectedSlidingAmount
5166
5226
  ]);
5227
+ const wanted = input.step === "select-payment" || input.several === "dates" && SEVERAL_ANSWER_STEPS.has(input.step);
5167
5228
  const selectionFunding = useSelectionFunding({
5168
5229
  api: input.api,
5169
5230
  request,
5170
5231
  identity: input.identity,
5171
- enabled: input.step === "select-payment" && input.portalAuthState !== "checking"
5232
+ enabled: wanted && input.portalAuthState !== "checking"
5172
5233
  });
5173
5234
  return {
5174
5235
  selectionFunding,
5175
5236
  datesQuote: useMemo(() => selectionDatesQuote(selectionFunding.lookup, request), [selectionFunding.lookup, request])
5176
5237
  };
5177
5238
  }
5178
- /** Several items, or one date paid with a pass or membership, are priced as one whole order. */
5179
- function pricedAsWholeOrder(several, datesQuote) {
5180
- return several !== null || datesQuote !== null;
5181
- }
5182
- /** One date's card options keep the date's own price while a pass or membership is picked. */
5183
- function cardOptionsSubtotal(input) {
5184
- return input.several === null && input.datesQuote !== null ? input.primarySubtotalCents : input.ticketSelectionSubtotalCents;
5185
- }
5186
5239
  /** How many dates the funding step's copy speaks of; 0 for anything that isn't dates. */
5187
5240
  function fundingDateCount(target) {
5188
5241
  return target?.selection.kind === "dates" ? target.selection.occurrenceIds.length : 0;
@@ -5195,7 +5248,7 @@ function availableCreditCents(state, currency) {
5195
5248
  }
5196
5249
  //#endregion
5197
5250
  //#region ../blocks/src/system/runtime/nodes/event-registration/EventRegistrationPayment.tsx
5198
- const Payment = lazy(() => import("./EventEmbeddedCheckoutStep-BDnicDM6.mjs"));
5251
+ const Payment = lazy(() => import("./EventEmbeddedCheckoutStep-BGkbUhuw.mjs"));
5199
5252
  /** The one Stripe mount, shared by the standard wizard and headless arrangements. */
5200
5253
  function EventPaymentMount({ state, onComplete, onRetry, onBack, buttonVariant }) {
5201
5254
  if (state.kind === "abandoning") return /* @__PURE__ */ jsx("p", {