@riverbankcms/sdk 0.184.0 → 0.185.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 (220) hide show
  1. package/dist/_dts/{BlocksIslandsHydrator-DjBTJYiF.d.ts → BlocksIslandsHydrator-Bu0O7l4p.d.ts} +1 -1
  2. package/dist/_dts/{Page-BpXEM2ET.d.ts → Page-DYoL0IWL.d.ts} +7 -7
  3. package/dist/_dts/{SdkPreviewMode-Bb3h7KRE.d.ts → SdkPreviewMode-DgFAiR8r.d.ts} +2 -2
  4. package/dist/_dts/{client-DgTRRtl_.d.ts → client-BKdjJ7A0.d.ts} +23 -4
  5. package/dist/_dts/{content-types-DZQJp_ak.d.ts → content-types-6K7zlJuF.d.ts} +2 -2
  6. package/dist/_dts/{contracts-Ww1fmd-c.d.ts → contracts-CUR8ccnX.d.ts} +3 -3
  7. package/dist/_dts/{generatePageMetadata-BGc7dju6.d.ts → generatePageMetadata-CveWSMew.d.ts} +2 -2
  8. package/dist/_dts/{index-Cni4jykw.d.ts → index-6WypKfbu.d.ts} +4 -4
  9. package/dist/_dts/{index-ukS-Ffem.d.ts → index-BMwrFX_K.d.ts} +1 -1
  10. package/dist/_dts/{index-W9-7djG3.d.ts → index-Bp5lk6I8.d.ts} +1 -1
  11. package/dist/_dts/{index-Cc85KVLW.d.ts → index-DTKn1H8g.d.ts} +1 -1
  12. package/dist/_dts/{index-DxxTQ_0V.d.ts → index-DX-Xe54X.d.ts} +2 -2
  13. package/dist/_dts/{index-BECaUNYs.d.ts → index-SD1fTP_7.d.ts} +2 -2
  14. package/dist/_dts/{loadContent-BlSWTlbD.d.ts → loadContent-BN8GtRsL.d.ts} +7 -7
  15. package/dist/_dts/{request-CZz2BoXJ.d.ts → request-BwYvMqLf.d.ts} +459 -109
  16. package/dist/_dts/{resolveBlockData-D12HXnS3.d.ts → resolveBlockData-CYy0VlSK.d.ts} +5 -5
  17. package/dist/_dts/{resolvePageContent-BteMsSGP.d.ts → resolvePageContent-BwUDLi_W.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 -1
  28. package/dist/_dts/sdk/src/index.d.ts +7 -7
  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 +7 -7
  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 +1 -1
  36. package/dist/_dts/sdk/src/portal/index.d.ts +1 -1
  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-aTlOvO3U.d.ts → serviceBookingOutline-CMNev0gz.d.ts} +10 -7
  54. package/dist/_dts/{types-CCcQlRBi.d.ts → types-BBazdRQf.d.ts} +3 -3
  55. package/dist/_dts/{types-Du4aMnWC.d.ts → types-BwngWRQ8.d.ts} +7 -7
  56. package/dist/_dts/{types-Bi7R07RX.d.ts → types-C9_amrul.d.ts} +2 -2
  57. package/dist/_dts/{validation-CjCWVmwe.d.ts → validation-B58kUTuV.d.ts} +4 -4
  58. package/dist/client/{BlocksIslandsHydrator-CFLWxjxR.mjs → BlocksIslandsHydrator-CooOPhs3.mjs} +17 -17
  59. package/dist/client/{BookingMailingListNote-C4LcfwyA.mjs → BookingMailingListNote-D_khdttF.mjs} +59 -60
  60. package/dist/client/{BookingQuestionFields-DdcmoHqQ.mjs → BookingQuestionFields-Bia1E7Cj.mjs} +48 -35
  61. package/dist/client/{CalendarAction-DYGewmvh.mjs → CalendarAction-C-AbMmct.mjs} +1 -1
  62. package/dist/client/{CalendarNavigationChevron-ZfrUiiiI.mjs → CalendarNavigationChevron-oaHxRbUO.mjs} +6 -6
  63. package/dist/client/{DemoBookingPortalAccess-pzkGVkgG.mjs → DemoBookingPortalAccess-M2xKYQjX.mjs} +4 -4
  64. package/dist/client/{EventCalendar.client-Ct1B3xI4.mjs → EventCalendar.client-By7e9nyF.mjs} +10 -10
  65. package/dist/client/{EventCombined.client-DgfNtcgW.mjs → EventCombined.client-BdRZXB14.mjs} +9 -9
  66. package/dist/client/EventEmbeddedCheckoutStep-CJoxbx2Y.mjs +147 -0
  67. package/dist/client/{EventItem-KGKkK19N.mjs → EventItem-CDMa9zOX.mjs} +4 -4
  68. package/dist/client/{EventListWeekNavigation-Ba9ezxuC.mjs → EventListWeekNavigation-B8WKaCrN.mjs} +1 -1
  69. package/dist/client/{EventListing.client-xFKRDLwC.mjs → EventListing.client-BEGiiFnO.mjs} +3 -3
  70. package/dist/client/{EventListing.view-Dy36vWHi.mjs → EventListing.view-B6LOK-z4.mjs} +5 -5
  71. package/dist/client/{EventRegistrationPayment-Dth9L00x.mjs → EventRegistrationPayment-CARdr15t.mjs} +44 -35
  72. package/dist/client/{Page-DB5KODiu.mjs → Page-uP7AKSyp.mjs} +37 -30
  73. package/dist/client/SiteChoiceGroup-BZ5I0Vhy.mjs +96 -0
  74. package/dist/client/{SiteTermsAgreementField-BDVP_HeK.mjs → SiteTermsAgreementField-BDqRo2C5.mjs} +2 -2
  75. package/dist/client/{StepIndicator-CLgDVzCs.mjs → StepIndicator-BWrXAKvs.mjs} +1 -1
  76. package/dist/client/{StepIndicator-DRyZ8igu.mjs → StepIndicator-Cb3NMw-Y.mjs} +29 -17
  77. package/dist/client/{accessibleSurfaces-CqroimVQ.mjs → accessibleSurfaces-q-dDOwsW.mjs} +5 -3
  78. package/dist/client/{accordion-BQYRP5xV.mjs → accordion-BYW2YSUN.mjs} +1 -1
  79. package/dist/client/{booking-form.client-B7ckDuOC.mjs → booking-form.client-DAlWWWjV.mjs} +108 -70
  80. package/dist/client/{bookingCalendar--aWnqFDn.mjs → bookingCalendar-9nFa_do4.mjs} +6 -2
  81. package/dist/client/{bookingForm-BeD4650p.mjs → bookingForm-DtVk9p5l.mjs} +4 -4
  82. package/dist/client/bookings.mjs +5 -5
  83. package/dist/client/{boxStyleClassNames-CA7FirMH.mjs → boxStyleClassNames-CaSq3-r-.mjs} +2 -2
  84. package/dist/client/{EventEmbeddedCheckoutStep-CjoaG1zy.mjs → browserStripe-Dh-LcDoW.mjs} +36 -142
  85. package/dist/client/{carousel-DJ9Aa1m3.mjs → carousel-msur7fxW.mjs} +1 -1
  86. package/dist/client/{cart-DdCenbTy.mjs → cart-Bx-JuY2n.mjs} +3 -3
  87. package/dist/client/{cart.client-BQm06qNw.mjs → cart.client-hB_9MimN.mjs} +1 -1
  88. package/dist/client/{checkout-45wPQULN.mjs → checkout-BVWZn5Qu.mjs} +3 -3
  89. package/dist/client/{checkout.client-bSv4cc5z.mjs → checkout.client-Bt_GtHW9.mjs} +1 -1
  90. package/dist/client/{checkoutUrls-CwlaMl3W.mjs → checkoutUrls-CP-rQOZV.mjs} +1 -1
  91. package/dist/client/client.mjs +43 -18
  92. package/dist/client/{constants-DXV4KR7l.mjs → constants-yA1RJGXD.mjs} +1 -1
  93. package/dist/client/{context-lCPfX-xe.mjs → context-CG77Keax.mjs} +30 -3
  94. package/dist/client/{dateFormatting-HvfmS_cH.mjs → dateFormatting-DIRIgfYr.mjs} +1 -1
  95. package/dist/client/{demoPortalMagicLink-Ce3Gyin_.mjs → demoPortalMagicLink-CgzNiOQ0.mjs} +1 -1
  96. package/dist/client/{enhanceHeaderSection-CGcDE9aE.mjs → enhanceHeaderSection-DgzZNM2M.mjs} +3 -3
  97. package/dist/client/{event-registration.client-DlPfn4YG.mjs → event-registration.client-Ckb4aDE9.mjs} +79 -58
  98. package/dist/client/{eventCalendar-CioAdryV.mjs → eventCalendar-lqqQSzBQ.mjs} +4 -4
  99. package/dist/client/{eventCombined-Dwt0G6ez.mjs → eventCombined-BIMyHrd-.mjs} +4 -4
  100. package/dist/client/{eventListing-B3H9ifOC.mjs → eventListing-CBYxfvNf.mjs} +4 -4
  101. package/dist/client/{eventRegistration-Do7cAhXb.mjs → eventRegistration-BhAqvkCb.mjs} +4 -4
  102. package/dist/client/{form-CsqzgC6v.mjs → form-CkOfk-Eb.mjs} +3 -3
  103. package/dist/client/{form.client-DVDB7hY6.mjs → form.client-Whi43oio.mjs} +4 -4
  104. package/dist/client/{form.parts-1q2rzSYt.mjs → form.parts-BgsWo2Me.mjs} +1 -1
  105. package/dist/client/gifting/client.mjs +7 -7
  106. package/dist/client/{gifting-BrXQGX-k.mjs → gifting-XtNpLcFI.mjs} +4 -4
  107. package/dist/client/{gifting.client--zAjnY5N.mjs → gifting.client-CraWj4I4.mjs} +173 -71
  108. package/dist/client/{gifting.interactive-CrwHpUJG.mjs → gifting.interactive-DiPDObN0.mjs} +3 -2
  109. package/dist/client/{gifting.parts-CcKdDaQq.mjs → gifting.parts-_mgGOcbA.mjs} +12 -43
  110. package/dist/client/{headerSection-DlcDH4bi.mjs → headerSection-CPIN3VSU.mjs} +2 -2
  111. package/dist/client/{islands-dMh0Oxli.mjs → islands-C95FyxUF.mjs} +11 -9
  112. package/dist/client/{newsletter-form.client-BxA1PsdS.mjs → newsletter-form.client-BgVJdKVe.mjs} +6 -6
  113. package/dist/client/{newsletter-form.interactive-D0iRg7p2.mjs → newsletter-form.interactive-DpcfRbI_.mjs} +35 -15
  114. package/dist/client/{newsletter-form.parts-Dmuklz0r.mjs → newsletter-form.parts-poPgHrUh.mjs} +1 -1
  115. package/dist/client/{newsletterForm-CBzvgIfg.mjs → newsletterForm-Dt6wFjTe.mjs} +3 -3
  116. package/dist/client/portal/client.mjs +978 -72
  117. package/dist/client/{portalOrders-tCxS04g0.mjs → portalOrders-CAfjTyV9.mjs} +1 -1
  118. package/dist/client/{portalRoutes-DiGibcZI.mjs → portalRoutes-D3Ttfv5x.mjs} +48 -13
  119. package/dist/client/presentation-CudSUZ6Q.mjs +169 -0
  120. package/dist/client/{product-detail.client-D9MP8hvH.mjs → product-detail.client-BrBNT7Mq.mjs} +1 -1
  121. package/dist/client/{product-list.client-wCz1qcUY.mjs → product-list.client-CftTl7n6.mjs} +1 -1
  122. package/dist/client/{productDetail-D9-fCY6c.mjs → productDetail-b1tpt585.mjs} +3 -3
  123. package/dist/client/{productList-PJyxXSac.mjs → productList-DRT5sabi.mjs} +3 -3
  124. package/dist/client/{propsDecoder-B8lrKGPw.mjs → propsDecoder-Co1VXFaW.mjs} +4 -4
  125. package/dist/client/{registry.server-CI63JVHW.mjs → registry.server-0UDNY7dO.mjs} +185 -224
  126. package/dist/client/rendering/client.mjs +23 -23
  127. package/dist/client/rendering/islands.mjs +1 -1
  128. package/dist/client/rendering.mjs +5 -5
  129. package/dist/client/{richText-coerce-Jt9hDHdh.mjs → richText-coerce-BFDEPZZA.mjs} +2 -2
  130. package/dist/client/{routeIslandApiConfig-ZSPcJWx1.mjs → routeIslandApiConfig-DtqRutuX.mjs} +1 -1
  131. package/dist/client/{runtimeResponse-_iW9oEYc.mjs → runtimeResponse-DBVXbcuz.mjs} +1 -1
  132. package/dist/client/runtimeResponse-LQnQdtNI.mjs +3 -0
  133. package/dist/client/{shop-CbdJlWOw.mjs → shop-DL3CYR7i.mjs} +3 -3
  134. package/dist/client/{shop-commerce-BqLbzUUn.mjs → shop-commerce-CDth2_qq.mjs} +13 -13
  135. package/dist/client/{shop-commerce-store-BT0-zRqN.mjs → shop-commerce-store-CE0aaSHJ.mjs} +1 -1
  136. package/dist/client/{shop-discount-apply.state-Cws0lnSb.mjs → shop-discount-apply.state-p4aXtVsF.mjs} +2 -2
  137. package/dist/client/{shop.client-0cNErhJT.mjs → shop.client-BI2iw6Z3.mjs} +56 -21
  138. package/dist/client/{shopShared-COuQ2MhQ.mjs → shopShared-BNWzgWAC.mjs} +2 -2
  139. package/dist/client/{src-Do_s2lqH.mjs → src-CJf3u16T.mjs} +1 -1
  140. package/dist/{preview-next/client/src-lX6heoDA.mjs → client/src-CMuv8vSO.mjs} +5 -1
  141. package/dist/client/src-CXOxpNtj.mjs +3 -0
  142. package/dist/client/{timetableModel-DqI6U1BS.mjs → timetableModel-DZzGD6rS.mjs} +8 -8
  143. package/dist/client/{useAutomaticDiscountPreview-CeVUVzGf.mjs → useAutomaticDiscountPreview-CJDylOUe.mjs} +1 -1
  144. package/dist/client/{useAvailableSlots-B0mjVhZr.mjs → useAvailableSlots-nD6nuvSW.mjs} +2 -2
  145. package/dist/client/{useDiscountCodeUi-B_hfgdAP.mjs → useDiscountCodeUi-DMtTHqex.mjs} +1 -1
  146. package/dist/client/{useEventPagination-Ct4A6iR1.mjs → useEventPagination-CM-DCokc.mjs} +7 -7
  147. package/dist/client/{view-Cj151w4m.mjs → view-CHOhliHv.mjs} +3 -3
  148. package/dist/client/{wizardSteps-B3gsXNnb.mjs → wizardSteps-BbroaNkT.mjs} +68 -22
  149. package/dist/preview-next/client/{PageSectionToolbar-Dv4CW0AQ.mjs → PageSectionToolbar-CR99z8BL.mjs} +3 -3
  150. package/dist/preview-next/client/{PreviewEditorSidebar-B7WW58uE.mjs → PreviewEditorSidebar-BaKS6H8F.mjs} +6 -6
  151. package/dist/preview-next/client/{PreviewEditorUI-BnJ1ughv.mjs → PreviewEditorUI-D6IG119o.mjs} +4 -4
  152. package/dist/preview-next/client/{PreviewShell-C7qWzAe4.mjs → PreviewShell-CKjkFOZS.mjs} +5 -5
  153. package/dist/preview-next/client/{SdkPreviewModeRuntime-CYi4UHtG.mjs → SdkPreviewModeRuntime-BexDQWGj.mjs} +4 -4
  154. package/dist/preview-next/client/{previewAssistantSlot-DrUoRNu9.mjs → previewAssistantSlot-DcEwU9l_.mjs} +977 -505
  155. package/dist/preview-next/client/{previewChromeRoot-CEYp90mM.mjs → previewChromeRoot-VqseF0yf.mjs} +1 -1
  156. package/dist/preview-next/client/runtime.mjs +3 -3
  157. package/dist/preview-next/client/{sdk-runtime-DnO2_c0A.mjs → sdk-runtime-DcoVpKUf.mjs} +2 -2
  158. package/dist/preview-next/client/{siteStyleAccess-B3PwHw2z.mjs → siteStyleAccess-BL1fZnUD.mjs} +1 -1
  159. package/dist/{client/src-uwCpbHXG.mjs → preview-next/client/src-B5x3r4cg.mjs} +5 -1
  160. package/dist/preview-next/client/src-CrT7h--V.mjs +3 -0
  161. package/dist/preview-next/client/{useAutosaveStatus-DrdQ4ier.mjs → useAutosaveStatus-CdFnzKac.mjs} +2 -2
  162. package/dist/preview-next/client/{useOpenBlockForSetup-kuGRKaRL.mjs → useOpenBlockForSetup-B62h7dhR.mjs} +1 -1
  163. package/dist/preview-next/container-responsive.css +8 -0
  164. package/dist/preview-next/keepAlive.mjs +1 -1
  165. package/dist/preview-next/middleware.mjs +1 -1
  166. package/dist/preview-next/{route-contract-CwrXkLT3.mjs → route-contract-CQfEvfbg.mjs} +38 -13
  167. package/dist/server/{Block.shared-C5ucphCJ.mjs → Block.shared-CbGnxkWX.mjs} +5 -5
  168. package/dist/server/{ThemeScopeCore-DvbqYXdK.mjs → ThemeScopeCore-BjxlpVaV.mjs} +5 -5
  169. package/dist/server/{accessibleSurfaces-CAcf1lHT.mjs → accessibleSurfaces-CZ7pLuJ7.mjs} +2 -2
  170. package/dist/server/{accordions-DjcsqjCK.mjs → accordions-C_C52VkS.mjs} +1 -1
  171. package/dist/server/{bindings-CFw4M-gZ.mjs → bindings-D-n66Oqc.mjs} +5 -5
  172. package/dist/server/{client-D0XCgITW.mjs → client-BGGlrkft.mjs} +41 -16
  173. package/dist/server/config-validation.mjs +1 -1
  174. package/dist/server/config.mjs +2 -2
  175. package/dist/server/{constants-BZduY8jG.mjs → constants-TkO9Uxma.mjs} +45 -10
  176. package/dist/server/data/resolveBlockData.mjs +1 -1
  177. package/dist/server/index.mjs +3 -3
  178. package/dist/server/{loadContent-C-qyB8Tq.mjs → loadContent-8H1hHdXo.mjs} +4 -4
  179. package/dist/server/{loadPage-BpKKmi8E.mjs → loadPage-BZyqF_g3.mjs} +3 -3
  180. package/dist/server/{lookMediaFrame-EFws7tAj.mjs → lookMediaFrame-Dw6R9B0L.mjs} +13 -11
  181. package/dist/server/manifest.mjs +2 -2
  182. package/dist/server/{navigation-DYkuiNXa.mjs → navigation-9TOyY5Zf.mjs} +1 -1
  183. package/dist/server/navigation.mjs +1 -1
  184. package/dist/server/next.mjs +9 -9
  185. package/dist/server/{overrideResolution-DmZn4xUE.mjs → overrideResolution-CuduOS6V.mjs} +1 -1
  186. package/dist/server/page-converter.mjs +3 -3
  187. package/dist/server/{pageRenderPlan-DRB7cUZ0.mjs → pageRenderPlan-DmP0HVMu.mjs} +30 -8
  188. package/dist/server/{pageRuntimeSupport-Uv1xDieJ.mjs → pageRuntimeSupport-BQ1dWs1V.mjs} +3 -3
  189. package/dist/server/{pageShared-BdQF875z.mjs → pageShared-ALu7y5Dq.mjs} +272 -165
  190. package/dist/server/{parseThemeForPersistence-CwcWZL7u.mjs → parseThemeForPersistence-D_8I28BB.mjs} +3 -3
  191. package/dist/server/{portal-BQ8qiQnk.mjs → portal-P4oHSRho.mjs} +2 -1
  192. package/dist/server/portal.mjs +2 -2
  193. package/dist/server/{prebuild-B51QZVNe.mjs → prebuild-BLL6RhjS.mjs} +1 -1
  194. package/dist/server/prebuild.mjs +1 -1
  195. package/dist/server/{prefetchBlockData-CppDAfJW.mjs → prefetchBlockData-aR5W1dVF.mjs} +3 -3
  196. package/dist/server/{registry-Bf4W8Qa7.mjs → registry-DD_s7l3Y.mjs} +82 -33
  197. package/dist/server/rendering/components/pageShared.mjs +1 -1
  198. package/dist/server/rendering/helpers/loadPage.mjs +1 -1
  199. package/dist/server/rendering/helpers/pageRuntimeSupport.mjs +1 -1
  200. package/dist/server/rendering/server.mjs +4 -4
  201. package/dist/server/rendering.mjs +9 -9
  202. package/dist/server/{resolveBlockData-DMHAZooQ.mjs → resolveBlockData-DnQ2N0lI.mjs} +2 -2
  203. package/dist/server/{resolveButtonColourStates-BMtAAPzp.mjs → resolveButtonColourStates-ChlP4NJ9.mjs} +1 -1
  204. package/dist/server/{responseMedia-DKYfR518.mjs → responseMedia-D6F1tvIm.mjs} +1 -1
  205. package/dist/server/{schema-DGaihVwp.mjs → schema-ClDfFtz2.mjs} +3 -3
  206. package/dist/server/server.mjs +3 -3
  207. package/dist/server/{servicePageContent-CRvmreX7.mjs → servicePageContent-CsUerbJ1.mjs} +14 -12
  208. package/dist/server/theme-bridge.mjs +3 -3
  209. package/dist/server/theme.mjs +2 -2
  210. package/dist/server/{three-pass-converter-mcy2E1Yd.mjs → three-pass-converter-CLJrZb7s.mjs} +1 -1
  211. package/dist/server/{titleSourceSchema-B2qFOUwZ.mjs → titleSourceSchema-DA_iErtG.mjs} +2 -2
  212. package/dist/server/{types-C_S0pWbR.mjs → types-CcKy8_tj.mjs} +5 -3
  213. package/dist/server/{validation-CUtNT_EZ.mjs → validation-BbImAsVs.mjs} +5 -5
  214. package/dist/server/{version-DebJQ4zn.mjs → version-BY48jPoe.mjs} +1 -1
  215. package/dist/styles/index.css +192 -134
  216. package/package.json +1 -1
  217. package/dist/client/appointment-service-categories-Cl2pqw-z.mjs +0 -70
  218. package/dist/client/runtimeResponse-DlPBWBd9.mjs +0 -3
  219. package/dist/client/src-DqMbCjI1.mjs +0 -3
  220. package/dist/preview-next/client/src-EO5QoRlU.mjs +0 -3
@@ -2,7 +2,7 @@
2
2
  import { n as useOptionalPreviewLayout } from "./PreviewLayoutContext-Dy0LwcHc.mjs";
3
3
  import { Bt as normalizeLocationAddressText, D as Minus, Ht as projectPublicLocation, Kt as capitalize$1, Pt as stableJsonStringify, Qt as ok$2, Ut as publicLocationSchema, Vt as parseLocationValue, Wt as toLocationCoordinates, Xt as mapDrawingSchema, Yt as trimmedStringOrNull, Zt as err$1, ct as CircleMinus, d as Sparkles, ft as ChevronRight, kt as decideLocationSave, mt as ChevronDown, n as X, pt as ChevronLeft, qt as hasText, st as CirclePlus, wt as ArrowDown, y as Plus, zt as locationValueSchema } from "./lucide-react-B4c6U3ZU.mjs";
4
4
  import { $ as parseOpaqueButtonColourToken, A as UserIcon, B as actionVariableFallback, C as FileTextIcon, D as MinusIcon, E as MapPinIcon$1, F as BUTTON_LABEL_CLASS, G as buttonSizeNameSchema, H as actionVariablePrefix, I as buttonPartsCss, J as buttonEffectApplicationSchema, K as createStandardButtonSurfacePolicy, L as buttonShadowLayersValue, M as parseThemeButtonVariantId, N as themeButtonSelector, O as PlusIcon, P as AFFORDANCE_SUPPRESS_CLASS, Q as opaqueButtonColourTokenSchema, R as partOwnedPseudoElements, S as FileSpreadsheetIcon, T as InfoIcon, U as DEFAULT_VARIANT_ALIAS_ID, V as actionVariableName, W as STANDARD_BUTTON_SURFACE_POLICY, X as buttonSystemSchema, Y as buttonPressOffsetSchema, Z as buttonVisualStatesSchema, _ as CirclePlusIcon, _t as ICON_PICKER_PRESETS, a as ThemedDownloadLink, at as hexColorSchema, b as FileArchiveIcon, bt as SpinnerNode, ct as paletteColorEntries, d as SEMANTIC_ICON_DEFINITIONS, dt as paletteModeSchema, et as buttonKeyframesSchema, f as isSemanticIconId, g as CircleMinusIcon, gt as themeColorTokenSchema, h as ChevronDownIcon, ht as themeColorShadeSteps, it as blockColorTokenNames, j as UsersIcon, k as TicketIcon, lt as paletteColorsFromEntries, m as CalendarIcon$1, mt as parseThemeColorToken, n as ThemedButton, nt as PALETTE_TOKEN_NAMES, o as getIconComponent, ot as isThemeColorToken, p as ArrowDownIcon, pt as parseColorTokenParts, q as unsafeAsOpaqueButtonColourToken, r as ThemedButtonLink, rt as absoluteInkColors, st as normalizePaletteHex, t as ThemedAuthoredButton, tt as isFreeButtonRadius, ut as paletteColorsSchema, v as ClockIcon$1, vt as SYSTEM_BLOCK_KINDS, w as GlobeIcon, x as FileAudioIcon, xt as clsx, y as ExternalLinkIcon, yt as VARIANT_ROLES, z as affordanceIconMaskUrl } from "./ThemedButton-CRgbU75r.mjs";
5
- import { a as buildTimetableModel$1, b as shiftCalendarAnchorDate, c as addDays, f as formatDateKey$1, g as getWeekCalendarDayTuple, h as getOrderedDayNames, i as groupItemsByDate, l as addMonths, p as getDayOfWeek, r as calendarLinks, u as buildCalendarViewport$1, v as isSameCalendarDay, y as isToday } from "./src-lX6heoDA.mjs";
5
+ import { _ as getWeekCalendarDayTuple, a as groupItemsByDate, b as isToday, d as buildCalendarViewport$1, g as getOrderedDayNames, i as customerBookingCalendarUid, l as addDays, m as getDayOfWeek, o as buildTimetableModel$1, p as formatDateKey$1, r as calendarLinks, u as addMonths, x as shiftCalendarAnchorDate, y as isSameCalendarDay } from "./src-B5x3r4cg.mjs";
6
6
  import * as React$1 from "react";
7
7
  import React, { Suspense, createContext, createElement, forwardRef, lazy, startTransition, useCallback, useContext, useEffect, useId, useLayoutEffect, useMemo, useReducer, useRef, useState, useSyncExternalStore, useTransition } from "react";
8
8
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
@@ -4740,12 +4740,13 @@ const eventRegistrationErrors = {
4740
4740
  },
4741
4741
  /**
4742
4742
  * The server's own message says which date or run. This one is only shown if that's missing. The
4743
- * earlier booking still stands, so the command isn't ended.
4743
+ * earlier booking still stands, so the command isn't ended. Trying again would meet the same refusal,
4744
+ * so one booking has no button; several go back to the choices (`eventRegistrationRefusalAction`).
4744
4745
  */
4745
4746
  earlierBookingUnpaid: {
4746
4747
  endsCommand: false,
4747
4748
  message: earlierBookingUnpaid(null),
4748
- action: "retry"
4749
+ action: "none"
4749
4750
  },
4750
4751
  /**
4751
4752
  * Several dates or runs were chosen where only one can be booked at a time: the event's setting
@@ -4782,6 +4783,12 @@ function eventRegistrationRefusalMessage(reason, serverMessage, bookings) {
4782
4783
  const worded = serverWordedRefusals[reason];
4783
4784
  return (worded === "always" || worded === "several_bookings" && bookings === "several") && serverMessage.trim().length > 0 ? serverMessage : eventRegistrationErrors[reason].message;
4784
4785
  }
4786
+ /** Refusals whose next step changes when several were being booked, because the others can still go ahead. */
4787
+ const severalBookingsActions = { earlierBookingUnpaid: "places" };
4788
+ /** What a refusal's button does: the reason's own next step, or the one for several bookings where that differs. */
4789
+ function eventRegistrationRefusalAction(reason, bookings) {
4790
+ return (bookings === "several" ? severalBookingsActions[reason] : void 0) ?? eventRegistrationErrors[reason].action;
4791
+ }
4785
4792
  function parseEventRegistrationErrorReason(value) {
4786
4793
  return typeof value === "string" && Object.prototype.hasOwnProperty.call(eventRegistrationErrors, value) ? value : null;
4787
4794
  }
@@ -13088,11 +13095,13 @@ function opaqueSurfaceContextFromTheme(theme) {
13088
13095
  * The declarations that make an element own its surface: `color`, every
13089
13096
  * `--rb-surface-*` role and every `--rb-action-*` variable. Card roles and
13090
13097
  * opaque block panels both publish through this, so a nested surface can never
13091
- * inherit a band's light text or its band-resolved buttons.
13098
+ * inherit a band's light text or its band-resolved buttons. Every foreground
13099
+ * role, muted included, is always published; only the line and mark
13100
+ * decorations wait for an arrangement (`withDecorations`).
13092
13101
  */
13093
- function opaqueSurfaceDeclarations(surface, arrangement = false) {
13102
+ function opaqueSurfaceDeclarations(surface, withDecorations = false) {
13094
13103
  requireResolvedSurface(surface);
13095
- if (surface.kind === "inherit") return inheritedSurfaceDeclarations(arrangement);
13104
+ if (surface.kind === "inherit") return inheritedSurfaceDeclarations(withDecorations);
13096
13105
  const foreground = surface.foreground;
13097
13106
  return [
13098
13107
  ...surfaceForegroundDeclarations({
@@ -13101,11 +13110,11 @@ function opaqueSurfaceDeclarations(surface, arrangement = false) {
13101
13110
  link: colorValue(foreground.link),
13102
13111
  linkHover: colorValue(foreground.linkHover),
13103
13112
  supporting: colorValue(foreground.supporting),
13104
- ...arrangement ? { muted: colorValue(foreground.muted) } : {},
13113
+ muted: colorValue(foreground.muted),
13105
13114
  hoverDecoration: surface.hoverDecoration
13106
13115
  }),
13107
13116
  ...surfaceInkDeclarations(surface.inks),
13108
- ...arrangement && surface.decorations !== void 0 ? [`${SURFACE_FOREGROUND_CSS_VARS.line}: ${surface.decorations.line};`, `${SURFACE_FOREGROUND_CSS_VARS.mark}: ${surface.decorations.mark};`] : [],
13117
+ ...withDecorations && surface.decorations !== void 0 ? [`${SURFACE_FOREGROUND_CSS_VARS.line}: ${surface.decorations.line};`, `${SURFACE_FOREGROUND_CSS_VARS.mark}: ${surface.decorations.mark};`] : [],
13109
13118
  ...Object.entries(surface.buttonContext.styles).map(([property, value]) => `${property}: ${value};`)
13110
13119
  ];
13111
13120
  }
@@ -13114,10 +13123,10 @@ function colorValue(token) {
13114
13123
  return parsed ? rgbColorValue(parsed) : token;
13115
13124
  }
13116
13125
  /** Every property a surface publishes, set to `inherit`. */
13117
- function inheritedSurfaceDeclarations(arrangement) {
13126
+ function inheritedSurfaceDeclarations(withDecorations) {
13118
13127
  return [
13119
13128
  "color",
13120
- ...Object.entries(SURFACE_FOREGROUND_CSS_VARS).filter(([role]) => arrangement || role !== "line" && role !== "mark" && role !== "muted").map(([, variable]) => variable),
13129
+ ...Object.entries(SURFACE_FOREGROUND_CSS_VARS).filter(([role]) => withDecorations || role !== "line" && role !== "mark").map(([, variable]) => variable),
13121
13130
  ...Object.values(SURFACE_INK_CSS_VARS),
13122
13131
  "--rb-surface-link-hover-decoration",
13123
13132
  ...Object.keys(contextualButtonSurfaceResetStyles())
@@ -13652,13 +13661,14 @@ function requireSurfaceColorValue(role, value) {
13652
13661
  function completeSurfaceForegrounds(input) {
13653
13662
  const text = requireSurfaceColorValue("text", input.text);
13654
13663
  const link = input.link === void 0 ? text : requireSurfaceColorValue("link", input.link);
13664
+ const supporting = input.supporting === void 0 ? text : requireSurfaceColorValue("supporting", input.supporting);
13655
13665
  return {
13656
13666
  text,
13657
13667
  heading: input.heading === void 0 ? text : requireSurfaceColorValue("heading", input.heading),
13658
13668
  link,
13659
13669
  linkHover: input.linkHover === void 0 ? link : requireSurfaceColorValue("linkHover", input.linkHover),
13660
- muted: input.muted === void 0 ? text : requireSurfaceColorValue("muted", input.muted),
13661
- supporting: input.supporting === void 0 ? text : requireSurfaceColorValue("supporting", input.supporting)
13670
+ muted: input.muted === void 0 ? supporting : requireSurfaceColorValue("muted", input.muted),
13671
+ supporting
13662
13672
  };
13663
13673
  }
13664
13674
  function surfaceForegroundValue(role, outsideProviderFallback = DEFAULT_ROLE_FALLBACKS[role]) {
@@ -13724,7 +13734,7 @@ function surfaceForegroundStyle(input) {
13724
13734
  [SURFACE_FOREGROUND_CSS_VARS.link]: foregrounds.link,
13725
13735
  [SURFACE_FOREGROUND_CSS_VARS.linkHover]: foregrounds.linkHover,
13726
13736
  [SURFACE_FOREGROUND_CSS_VARS.supporting]: foregrounds.supporting,
13727
- ...input.muted === void 0 ? {} : { [SURFACE_FOREGROUND_CSS_VARS.muted]: foregrounds.muted },
13737
+ [SURFACE_FOREGROUND_CSS_VARS.muted]: foregrounds.muted,
13728
13738
  "--rb-surface-link-hover-decoration": hoverDecoration(input)
13729
13739
  };
13730
13740
  }
@@ -13743,6 +13753,7 @@ function surfaceForegroundInputFromResolved(foreground, color) {
13743
13753
  link: value(roles.link),
13744
13754
  linkHover: value(roles.linkHover),
13745
13755
  supporting: value(roles.supporting),
13756
+ muted: value(roles.muted),
13746
13757
  hoverDecoration: foreground.hoverDecoration
13747
13758
  };
13748
13759
  }
@@ -42482,18 +42493,14 @@ const portalRegularSessionSchema = exactSchema()(z.object({
42482
42493
  trainerName: z.string().nullable(),
42483
42494
  serviceName: z.string().nullable(),
42484
42495
  holdsTime: z.boolean(),
42485
- payment: z.intersection(z.union([z.object({
42486
- kind: z.literal("package"),
42487
- name: z.string().nullable(),
42488
- sessionsLeft: z.number()
42489
- }), z.object({ kind: z.enum(["owed", "payment_link"]) })]), z.object({
42496
+ payment: z.object({
42490
42497
  coverage: z.object({ packages: z.array(z.object({
42491
42498
  name: z.string().nullable(),
42492
42499
  sessionsLeft: z.number(),
42493
42500
  forNewSessions: z.boolean()
42494
42501
  })).readonly() }),
42495
42502
  owedFollowUp: z.enum(["direct", "payment_link"])
42496
- })),
42503
+ }),
42497
42504
  dates: z.array(dateSchema).readonly()
42498
42505
  }));
42499
42506
  exactSchema()(z.object({ arrangements: z.array(portalRegularSessionSchema).readonly() }));
@@ -42810,7 +42817,7 @@ const eventDetailSchema = exactSchema()(z.object({
42810
42817
  }));
42811
42818
  const courseDetailSchema = exactSchema()(z.object({
42812
42819
  eventPath: z.string().nullable(),
42813
- sessions: z.array(whenSchema).readonly(),
42820
+ sessions: z.array(whenSchema.extend({ calendarUid: z.string() })).readonly(),
42814
42821
  nextSessionAt: z.string().nullable(),
42815
42822
  ticketLines: z.array(ticketLineSchema).readonly()
42816
42823
  }));
@@ -42902,8 +42909,10 @@ const ENTRY_REASON_PARAMS = {
42902
42909
  };
42903
42910
  /** The query a page's own data puts in its address. */
42904
42911
  function targetParams(target) {
42905
- return target.page === "continue" ? ENTRY_REASON_PARAMS[target.reason] : [];
42912
+ if (target.page === "continue") return ENTRY_REASON_PARAMS[target.reason];
42913
+ return target.page === "membership_payment" && target.invoiceId ? [[INVOICE_PARAM, target.invoiceId]] : [];
42906
42914
  }
42915
+ const INVOICE_PARAM = "invoice";
42907
42916
  function withQuery(path, params) {
42908
42917
  const query = new URLSearchParams(params.map(([name, value]) => [name, value])).toString();
42909
42918
  return query ? `${path}?${query}` : path;
@@ -42925,6 +42934,7 @@ function targetPath(target) {
42925
42934
  case "ticket": return `${bookingPath(target.ref)}/ticket`;
42926
42935
  case "waitlist_offer": return `${base}/bookings/waitlist/${target.entryId}`;
42927
42936
  case "passes": return `${base}/passes`;
42937
+ case "membership_payment": return `${base}/passes/memberships/${target.customerMembershipId}/payment`;
42928
42938
  case "payments": return `${base}/payments`;
42929
42939
  case "order": return `${base}/payments/orders/${target.orderId}`;
42930
42940
  case "receipt": return `${base}/payments/receipts/${target.receiptId}`;
@@ -43214,6 +43224,27 @@ exactSchema()(z.union([z.object({
43214
43224
  ]),
43215
43225
  message: z.string()
43216
43226
  })]));
43227
+ exactSchema()(z.discriminatedUnion("kind", [
43228
+ z.object({
43229
+ kind: z.literal("pay"),
43230
+ reason: z.enum(["authenticate", "new_card"]),
43231
+ invoiceId: z.string(),
43232
+ clientSecret: z.string().transform((secret) => secret),
43233
+ amount: portalMoneySchema,
43234
+ nextAttempt: z.string().nullable(),
43235
+ browser: eventEmbeddedCheckoutSchema.shape.browser
43236
+ }),
43237
+ z.object({ kind: z.literal("checking") }),
43238
+ z.object({
43239
+ kind: z.literal("paid"),
43240
+ nextRenewal: z.object({
43241
+ date: z.string(),
43242
+ usesThisCard: z.boolean()
43243
+ }).nullable()
43244
+ }),
43245
+ z.object({ kind: z.literal("nothing_to_pay") }),
43246
+ z.object({ kind: z.literal("unavailable") })
43247
+ ]));
43217
43248
  //#endregion
43218
43249
  //#region ../site-contracts/src/siteData/bookingQuestions.ts
43219
43250
  /**
@@ -44876,6 +44907,35 @@ const BOOKING_PEOPLE_ENDPOINT_DEFINITIONS = defineEndpointDefinitions({
44876
44907
  }
44877
44908
  });
44878
44909
  //#endregion
44910
+ //#region ../api/src/portalMembershipEndpointDefinitions.ts
44911
+ /**
44912
+ * Customer portal endpoints for a membership: paying an overdue payment (#1825),
44913
+ * cancelling at the end of the period, and resuming.
44914
+ */
44915
+ const PORTAL_MEMBERSHIP_ENDPOINT_DEFINITIONS = defineEndpointDefinitions({
44916
+ portalMembershipPayment: {
44917
+ path: "/portal/memberships/{customerMembershipId}/payment",
44918
+ method: "POST",
44919
+ auth: "public",
44920
+ responseKind: "json",
44921
+ errors: []
44922
+ },
44923
+ portalCancelMembershipAtPeriodEnd: {
44924
+ path: "/portal/memberships/{customerMembershipId}/cancel",
44925
+ method: "POST",
44926
+ auth: "public",
44927
+ responseKind: "json",
44928
+ errors: []
44929
+ },
44930
+ portalResumeMembership: {
44931
+ path: "/portal/memberships/{customerMembershipId}/resume",
44932
+ method: "POST",
44933
+ auth: "public",
44934
+ responseKind: "json",
44935
+ errors: []
44936
+ }
44937
+ });
44938
+ //#endregion
44879
44939
  //#region ../api/src/clientErrorReporting.ts
44880
44940
  const CLIENT_ERROR_REPORT_ENDPOINT_DEFINITIONS = defineEndpointDefinitions({ reportClientError: {
44881
44941
  path: "/client/error-report",
@@ -48132,6 +48192,14 @@ const API_ENDPOINTS = {
48132
48192
  auth: "public",
48133
48193
  responseKind: "text"
48134
48194
  },
48195
+ getPublicCourseCalendarIcs: {
48196
+ path: "/public/sites/{siteId}/bookings/courses/{token}/course.ics",
48197
+ method: "GET",
48198
+ tags: ["public-course-calendar-{siteId}"],
48199
+ auth: "public",
48200
+ responseKind: "text",
48201
+ errors: ["resource:not_found", "server:internal_error"]
48202
+ },
48135
48203
  getPublicAppointmentCalendarIcs: {
48136
48204
  path: "/public/sites/{siteId}/bookings/appointments/{token}/appointment.ics",
48137
48205
  method: "GET",
@@ -49209,6 +49277,7 @@ const API_ENDPOINTS = {
49209
49277
  errors: []
49210
49278
  },
49211
49279
  ...BOOKING_PEOPLE_ENDPOINT_DEFINITIONS,
49280
+ ...PORTAL_MEMBERSHIP_ENDPOINT_DEFINITIONS,
49212
49281
  createBookingCustomer: {
49213
49282
  path: "/sites/{siteId}/bookings/customers",
49214
49283
  method: "POST",
@@ -50526,19 +50595,6 @@ const API_ENDPOINTS = {
50526
50595
  auth: "public",
50527
50596
  responseKind: "json"
50528
50597
  },
50529
- portalCancelMembershipAtPeriodEnd: {
50530
- path: "/portal/memberships/{customerMembershipId}/cancel",
50531
- method: "POST",
50532
- auth: "public",
50533
- responseKind: "json"
50534
- },
50535
- portalResumeMembership: {
50536
- path: "/portal/memberships/{customerMembershipId}/resume",
50537
- method: "POST",
50538
- auth: "public",
50539
- responseKind: "json",
50540
- errors: []
50541
- },
50542
50598
  portalSendMagicLink: {
50543
50599
  path: "/portal/auth/send-magic-link",
50544
50600
  method: "POST",
@@ -90759,7 +90815,7 @@ function resolveSurfaceForegroundStyles(value, context, options) {
90759
90815
  ...inks
90760
90816
  };
90761
90817
  case "known": return {
90762
- ...arrangementSurfaceInk(foreground, context),
90818
+ ...arrangementDecorations(foreground, context),
90763
90819
  ...resolved.buttonStyles,
90764
90820
  ...surfaceForegroundStyle(surfaceForegroundInputFromResolved(foreground, (token) => resolveBackgroundColorValue(token, context))),
90765
90821
  ...inks
@@ -90818,21 +90874,19 @@ function resolveRuntimeSectionSurface(value, context, options) {
90818
90874
  solvedInks: transformSolvedInks(context)
90819
90875
  });
90820
90876
  }
90821
- function arrangementSurfaceInk(foreground, context) {
90877
+ /** Line and mark are drawn by arrangements only; muted comes with the other foreground roles. */
90878
+ function arrangementDecorations(foreground, context) {
90822
90879
  if (context.data?._lookSlots === void 0) return {};
90823
- return surfaceInkStyles(foreground, context.theme.palette);
90880
+ return surfaceDecorationStyles(foreground, context.theme.palette);
90824
90881
  }
90825
90882
  /** Decoration roles already resolved by the surface owner, shared with footer arrangements. */
90826
- function surfaceInkStyles(foreground, palette) {
90883
+ function surfaceDecorationStyles(foreground, palette) {
90827
90884
  if (foreground.kind !== "known") return {};
90828
90885
  const decorations = surfaceDecorationColors(foreground, palette);
90829
- return {
90830
- "--rb-surface-muted-color": foreground.roles.muted ?? foreground.roles.text,
90831
- ...decorations ? {
90832
- "--rb-surface-line-color": decorations.line,
90833
- "--rb-surface-mark-color": decorations.mark
90834
- } : {}
90835
- };
90886
+ return decorations ? {
90887
+ "--rb-surface-line-color": decorations.line,
90888
+ "--rb-surface-mark-color": decorations.mark
90889
+ } : {};
90836
90890
  }
90837
90891
  //#endregion
90838
90892
  //#region ../blocks/src/system/fields/backgroundContent.ts
@@ -100862,12 +100916,12 @@ function footerAreaPaintStyle(footer, area, context) {
100862
100916
  const palette = context.theme.palette;
100863
100917
  if (area === "main") {
100864
100918
  const foreground = resolveFooterRootForeground(footer, palette, context.proseHoverCandidate);
100865
- return mergeStyles(backgroundColorStyle(footerMainPaint(footer).ground), resolvedForegroundStyle(foreground), solvedInkStyle(foreground, context), surfaceInkStyles(foreground, palette));
100919
+ return mergeStyles(backgroundColorStyle(footerMainPaint(footer).ground), resolvedForegroundStyle(foreground), solvedInkStyle(foreground, context), surfaceDecorationStyles(foreground, palette));
100866
100920
  }
100867
100921
  const paint = footerSideBandPaint(footer, area);
100868
100922
  const foreground = resolveFooterSideBandForeground(footer, area, palette, context.proseHoverCandidate);
100869
100923
  if (!paint || !foreground) return void 0;
100870
- return mergeStyles({ [`--rb-footer-${area}-bg`]: rgbColorValue(paint.ground) }, resolvedForegroundStyle(foreground), solvedInkStyle(foreground, context), surfaceInkStyles(foreground, palette));
100924
+ return mergeStyles({ [`--rb-footer-${area}-bg`]: rgbColorValue(paint.ground) }, resolvedForegroundStyle(foreground), solvedInkStyle(foreground, context), surfaceDecorationStyles(foreground, palette));
100871
100925
  }
100872
100926
  const footerAreaValues = [
100873
100927
  "band",
@@ -105698,6 +105752,18 @@ function renderClockClosedCta(event, now) {
105698
105752
  };
105699
105753
  }
105700
105754
  //#endregion
105755
+ //#region ../blocks/src/system/blocks/events/shared/cancellation.ts
105756
+ /**
105757
+ * Why a date won't go ahead: the whole event was cancelled, or just this date.
105758
+ * Null while it's still on. A cancelled event wins, as it does in admission.
105759
+ */
105760
+ function publicEventCancellation(event) {
105761
+ const closedReason = event.bookingAvailability.kind === "closed" ? event.bookingAvailability.reason : null;
105762
+ if (closedReason === "series_cancelled") return "event";
105763
+ if (event.status === "cancelled" || closedReason === "occurrence_cancelled") return "date";
105764
+ return null;
105765
+ }
105766
+ //#endregion
105701
105767
  //#region ../blocks/src/system/blocks/events/shared/pageSelection.ts
105702
105768
  function planWholeSeriesParentBooking(eligibleRuns) {
105703
105769
  const [first, second, ...rest] = eligibleRuns;
@@ -105759,10 +105825,21 @@ function planOrdinarySeriesSelection(events) {
105759
105825
  };
105760
105826
  }
105761
105827
  const event = first ?? ordinary[0];
105762
- return event ? {
105828
+ return event ? seriesPageOccurrence(event, ordinary) : null;
105829
+ }
105830
+ /** The one date a series page holds, with the rest of a cancelled event's dates. */
105831
+ function seriesPageOccurrence(event, dates) {
105832
+ const cancelledEventDates = otherCancelledEventDates(event, dates);
105833
+ return {
105763
105834
  kind: "occurrence",
105764
- event
105765
- } : null;
105835
+ event,
105836
+ ...cancelledEventDates.length ? { cancelledEventDates } : {}
105837
+ };
105838
+ }
105839
+ /** When the whole event is cancelled, its page speaks for every date, not just the one it opens on. */
105840
+ function otherCancelledEventDates(event, dates) {
105841
+ if (publicEventCancellation(event) !== "event") return [];
105842
+ return dates.filter((date) => date.occurrenceId !== event.occurrenceId && publicEventCancellation(date) === "event");
105766
105843
  }
105767
105844
  function isOpenForBooking(event) {
105768
105845
  return event.requiresRegistration && event.bookingAvailability.kind === "open";
@@ -106069,17 +106146,36 @@ const occurrenceContextSchema = z.object({
106069
106146
  }).nullable();
106070
106147
  //#endregion
106071
106148
  //#region ../blocks/src/system/runtime/nodes/event-registration/cancelledDate.ts
106072
- const cancelledDateCopy = {
106073
- titleText: "This event has been cancelled",
106074
- bodyText: "This date is no longer going ahead. If you had a place booked, the organiser will be in touch."
106149
+ const copyByScope = {
106150
+ event: {
106151
+ titleText: "This event has been cancelled",
106152
+ bodyText: "It’s no longer going ahead. If you had a place booked, the organiser will be in touch."
106153
+ },
106154
+ date: {
106155
+ titleText: "This date has been cancelled",
106156
+ bodyText: "It’s no longer going ahead. If you had a place booked, the organiser will be in touch."
106157
+ }
106075
106158
  };
106076
- /** A selected cancelled date stays informational, including when its data was recovered in the browser. */
106077
- function hasCancelledRegistrationDate(events, occurrenceId) {
106159
+ /**
106160
+ * The informational notice for a selected cancelled date, including when its
106161
+ * data was recovered in the browser. It says "event" when the whole event was
106162
+ * cancelled and "date" when only this date was. Null when the selection is
106163
+ * still going ahead, or is a course run (closed runs have their own copy).
106164
+ */
106165
+ function cancelledRegistrationCopy(events, occurrenceId) {
106078
106166
  const dates = occurrenceId ? events.filter((event) => event.occurrenceId === occurrenceId) : events;
106079
- return dates.length > 0 && dates.every(isCancelledOrdinaryDate);
106167
+ if (dates.length === 0 || dates.some((event) => event.bookingScope !== "single_occurrence")) return null;
106168
+ const scopes = dates.map(publicEventCancellation);
106169
+ if (scopes.some((scope) => scope === null)) return null;
106170
+ return copyByScope[scopes.every((scope) => scope === "event") ? "event" : "date"];
106080
106171
  }
106081
- function isCancelledOrdinaryDate(event) {
106082
- return event.bookingScope === "single_occurrence" && (event.status === "cancelled" || event.bookingAvailability.kind === "closed" && (event.bookingAvailability.reason === "occurrence_cancelled" || event.bookingAvailability.reason === "series_cancelled"));
106172
+ /**
106173
+ * A course page whose every run was cancelled says the event was cancelled,
106174
+ * rather than inviting people to check back for dates. One run still on, or
106175
+ * a run closed for any other reason, leaves the page to its usual copy.
106176
+ */
106177
+ function cancelledRunsCopy(runRepresentatives) {
106178
+ return runRepresentatives.length > 0 && runRepresentatives.every((event) => publicEventCancellation(event) === "event") ? copyByScope.event : null;
106083
106179
  }
106084
106180
  //#endregion
106085
106181
  //#region ../blocks/src/system/blocks/shared/bookingPageKind.ts
@@ -106490,11 +106586,12 @@ function eventVenuePlace(venue) {
106490
106586
  *
106491
106587
  * Booking here sends a confirmation email that carries the joining link (the
106492
106588
  * link is required for an online event people book here), so the note only
106493
- * promises it when the visitor books on this site. Null for in-person events.
106589
+ * promises it when the visitor books on this site, and not once the date's
106590
+ * cancelled. Null for in-person events.
106494
106591
  */
106495
106592
  function eventOnlinePlace(event) {
106496
106593
  if (event.deliveryMode === "in_person") return null;
106497
- const bookedHere = event.requiresRegistration && event.destination.kind !== "external";
106594
+ const bookedHere = event.requiresRegistration && event.destination.kind !== "external" && publicEventCancellation(event) === null;
106498
106595
  return {
106499
106596
  mode: event.deliveryMode,
106500
106597
  note: bookedHere ? "The joining link comes with your booking confirmation." : null
@@ -108592,61 +108689,122 @@ function ModalShell({ title, titleId, onClose, children, portalRoot, portal = fa
108592
108689
  }) : modal, portalRoot);
108593
108690
  }
108594
108691
  //#endregion
108692
+ //#region ../blocks/src/system/runtime/shared/components/SiteChoiceGroup.tsx
108693
+ /**
108694
+ * The options on their own, for a fieldset someone else owns (a booking
108695
+ * question's fieldset already holds its legend, help and error).
108696
+ */
108697
+ function SiteChoiceOptions(props) {
108698
+ const size = props.size ?? "pill";
108699
+ return /* @__PURE__ */ jsx("div", {
108700
+ className: "rb-choice-options",
108701
+ "data-choice-size": size,
108702
+ children: props.options.map((option) => /* @__PURE__ */ jsxs("label", {
108703
+ className: "rb-choice",
108704
+ "data-choice-size": size,
108705
+ children: [/* @__PURE__ */ jsx(ChoiceInput, {
108706
+ option,
108707
+ size,
108708
+ group: props
108709
+ }), size === "row" ? /* @__PURE__ */ jsx(RowBody, { option }) : /* @__PURE__ */ jsx(ChipFace, { option })]
108710
+ }, option.value))
108711
+ });
108712
+ }
108713
+ /** A named group of choices: a fieldset whose legend names it, announced as a radio group. */
108714
+ function SiteChoiceGroup(props) {
108715
+ const { legend, legendHidden, className, disabled, ...options } = props;
108716
+ return /* @__PURE__ */ jsxs("fieldset", {
108717
+ className: ["rb-choice-group", className].filter(Boolean).join(" "),
108718
+ role: "radiogroup",
108719
+ "aria-required": props.required || void 0,
108720
+ disabled,
108721
+ children: [/* @__PURE__ */ jsx("legend", {
108722
+ className: legendHidden ? "rb-choice-legend rb-choice-legend--hidden" : "rb-choice-legend",
108723
+ children: legend
108724
+ }), /* @__PURE__ */ jsx(SiteChoiceOptions, { ...options })]
108725
+ });
108726
+ }
108727
+ function ChoiceInput({ option, size, group }) {
108728
+ const controlled = group.value !== void 0;
108729
+ const checked = controlled && option.value === group.value;
108730
+ const report = group.onChange ? () => group.onChange?.(option.value) : void 0;
108731
+ return /* @__PURE__ */ jsx("input", {
108732
+ type: "radio",
108733
+ className: size === "row" ? "rb-choice-radio form-radio" : "rb-choice-input",
108734
+ name: group.name,
108735
+ value: option.value,
108736
+ required: group.required,
108737
+ disabled: group.disabled || option.disabled,
108738
+ "aria-invalid": group.invalid || void 0,
108739
+ "aria-describedby": group.describedBy,
108740
+ ...controlled ? { checked } : { defaultChecked: option.value === group.defaultValue },
108741
+ onChange: report,
108742
+ onClick: checked ? report : void 0,
108743
+ onBlur: group.onBlur
108744
+ });
108745
+ }
108746
+ function ChipFace({ option }) {
108747
+ return /* @__PURE__ */ jsxs("span", {
108748
+ className: "rb-choice-face",
108749
+ children: [/* @__PURE__ */ jsx("span", {
108750
+ className: "rb-choice-label",
108751
+ children: option.label
108752
+ }), (option.details ?? []).map((detail) => /* @__PURE__ */ jsx("span", {
108753
+ className: "rb-choice-detail",
108754
+ children: detail
108755
+ }, detail))]
108756
+ });
108757
+ }
108758
+ function RowBody({ option }) {
108759
+ return /* @__PURE__ */ jsxs("span", {
108760
+ className: "rb-choice-body",
108761
+ children: [/* @__PURE__ */ jsxs("span", {
108762
+ className: "rb-choice-text",
108763
+ children: [
108764
+ /* @__PURE__ */ jsx("span", {
108765
+ className: "rb-choice-label",
108766
+ children: option.label
108767
+ }),
108768
+ (option.details ?? []).map((detail) => /* @__PURE__ */ jsx("span", {
108769
+ className: "rb-choice-detail",
108770
+ children: detail
108771
+ }, detail)),
108772
+ option.disabled && option.disabledReason ? /* @__PURE__ */ jsx("span", {
108773
+ className: "rb-choice-reason",
108774
+ children: option.disabledReason
108775
+ }) : null
108776
+ ]
108777
+ }), option.aside ? /* @__PURE__ */ jsx("span", {
108778
+ className: "rb-choice-aside",
108779
+ children: option.aside
108780
+ }) : null]
108781
+ });
108782
+ }
108783
+ //#endregion
108595
108784
  //#region ../blocks/src/system/runtime/shared/components/PaymentChoiceRows.tsx
108596
108785
  /**
108597
- * Payment choices as a radio group. Native radios give the whole row as the
108598
- * hit area and arrow-key movement between choices; the selected row takes the
108599
- * primary accent and disabled rows stay readable with their reason.
108786
+ * Payment choices as SiteChoiceGroup rows. Each row carries its own
108787
+ * selection and callback, so this hands the group the chosen id and routes
108788
+ * a choice back to its row. A disabled row is never shown as chosen.
108600
108789
  */
108601
108790
  function PaymentChoiceRows(props) {
108602
108791
  const name = useId();
108603
- return /* @__PURE__ */ jsx("div", {
108604
- className: "rb-pay-choices",
108605
- role: "radiogroup",
108606
- "aria-label": props.label,
108607
- children: props.rows.map((row) => {
108608
- const selected = row.selected && !row.disabled;
108609
- return /* @__PURE__ */ jsxs("label", {
108610
- className: [
108611
- "rb-pay-choice",
108612
- selected && "rb-pay-choice--selected",
108613
- row.disabled && "rb-pay-choice--disabled"
108614
- ].filter(Boolean).join(" "),
108615
- children: [
108616
- /* @__PURE__ */ jsx("input", {
108617
- type: "radio",
108618
- className: "rb-pay-choice__radio",
108619
- name,
108620
- value: row.id,
108621
- checked: selected,
108622
- disabled: row.disabled,
108623
- onChange: row.onSelect,
108624
- onClick: selected ? row.onSelect : void 0
108625
- }),
108626
- /* @__PURE__ */ jsxs("span", {
108627
- className: "rb-pay-choice__body",
108628
- children: [
108629
- /* @__PURE__ */ jsx("span", {
108630
- className: "rb-pay-choice__label",
108631
- children: row.label
108632
- }),
108633
- (row.details ?? []).map((detail) => /* @__PURE__ */ jsx("span", {
108634
- className: "rb-pay-choice__detail",
108635
- children: detail
108636
- }, detail)),
108637
- row.disabled && row.disabledReason ? /* @__PURE__ */ jsx("span", {
108638
- className: "rb-pay-choice__reason",
108639
- children: row.disabledReason
108640
- }) : null
108641
- ]
108642
- }),
108643
- row.price ? /* @__PURE__ */ jsx("span", {
108644
- className: "rb-pay-choice__price",
108645
- children: row.price
108646
- }) : null
108647
- ]
108648
- }, row.id);
108649
- })
108792
+ const chosen = props.rows.find((row) => row.selected && !row.disabled);
108793
+ return /* @__PURE__ */ jsx(SiteChoiceGroup, {
108794
+ name,
108795
+ legend: props.label,
108796
+ legendHidden: true,
108797
+ size: "row",
108798
+ value: chosen?.id ?? "",
108799
+ options: props.rows.map((row) => ({
108800
+ value: row.id,
108801
+ label: row.label,
108802
+ details: row.details,
108803
+ aside: row.price,
108804
+ disabled: row.disabled,
108805
+ disabledReason: row.disabledReason
108806
+ })),
108807
+ onChange: (id) => props.rows.find((row) => row.id === id && !row.disabled)?.onSelect()
108650
108808
  });
108651
108809
  }
108652
108810
  //#endregion
@@ -108786,45 +108944,6 @@ function StepIndicator$1({ currentStep, totalSteps, stepLabels, classPrefix, emi
108786
108944
  });
108787
108945
  }
108788
108946
  //#endregion
108789
- //#region ../blocks/src/system/runtime/shared/components/ChoiceGroup.tsx
108790
- function ChoiceGroup(props) {
108791
- const size = props.size ?? "pill";
108792
- return /* @__PURE__ */ jsxs("fieldset", {
108793
- className: ["rb-choice-group", props.className].filter(Boolean).join(" "),
108794
- "data-choice-size": size,
108795
- disabled: props.disabled,
108796
- children: [/* @__PURE__ */ jsx("legend", {
108797
- className: props.legendHidden ? "rb-choice-legend rb-choice-legend--hidden" : "rb-choice-legend",
108798
- children: props.legend
108799
- }), /* @__PURE__ */ jsx("div", {
108800
- className: "rb-choice-options",
108801
- children: props.options.map((option) => /* @__PURE__ */ jsxs("label", {
108802
- className: "rb-choice",
108803
- "data-choice-size": size,
108804
- children: [/* @__PURE__ */ jsx("input", {
108805
- type: "radio",
108806
- className: "rb-choice-input",
108807
- name: props.name,
108808
- value: option.value,
108809
- required: props.required,
108810
- disabled: option.disabled,
108811
- ...props.value === void 0 ? { defaultChecked: option.value === props.defaultValue } : { checked: option.value === props.value },
108812
- onChange: props.onChange ? () => props.onChange?.(option.value) : void 0
108813
- }), /* @__PURE__ */ jsxs("span", {
108814
- className: "rb-choice-face",
108815
- children: [/* @__PURE__ */ jsx("span", {
108816
- className: "rb-choice-label",
108817
- children: option.label
108818
- }), option.detail ? /* @__PURE__ */ jsx("span", {
108819
- className: "rb-choice-detail",
108820
- children: option.detail
108821
- }) : null]
108822
- })]
108823
- }, option.value))
108824
- })]
108825
- });
108826
- }
108827
- //#endregion
108828
108947
  //#region ../blocks/src/system/runtime/nodes/event-registration/utils.ts
108829
108948
  function getPortalSubjectEmail(profile) {
108830
108949
  return profile?.email ?? null;
@@ -109724,7 +109843,7 @@ function severalConfirmationSentence(kind, email) {
109724
109843
  const to = email.trim();
109725
109844
  return to ? `We’ve emailed a confirmation for each ${each} to ${to}.` : `We’ve emailed a confirmation for each ${each}.`;
109726
109845
  }
109727
- const SEVERAL_BOOKINGS_ACCOUNT_NOTE = "You can see and manage your bookings in your account.";
109846
+ const SEVERAL_BOOKINGS_ACCOUNT_NOTE = "You can see and change each of them from your account.";
109728
109847
  /**
109729
109848
  * What several items can't use. Runs can't use passes or memberships. Dates
109730
109849
  * can (issue 1767, set 6), and the payment step's own options explain them, so
@@ -110436,8 +110555,8 @@ function buildUpfrontBookingPaymentOptionCopy(formattedTotal) {
110436
110555
  ctaLabel: `Pay ${formattedTotal} now`
110437
110556
  };
110438
110557
  }
110439
- /** Reused after booking; payment remains outside the platform. */
110440
- const OFFLINE_BOOKING_PAYMENT_INSTRUCTIONS = "Pay the business later, outside the platform.";
110558
+ /** Reused after booking: the client pays the organiser themselves, not through us. */
110559
+ const OFFLINE_BOOKING_PAYMENT_INSTRUCTIONS = "Pay the organiser directly.";
110441
110560
  function buildDeferredManualBookingPaymentOptionCopy() {
110442
110561
  return {
110443
110562
  title: "Pay offline",
@@ -110494,7 +110613,11 @@ function bookingCalendar(event, outcome) {
110494
110613
  }];
110495
110614
  const bookingId = identity.scope === "occurrence" ? identity.attendeeId : identity.registrationId;
110496
110615
  const entries = sessions.map((session) => ({
110497
- uid: `booking-${bookingId}-${session.occurrenceId}@riverbankcms.com`,
110616
+ uid: customerBookingCalendarUid({
110617
+ kind: "event",
110618
+ bookingId,
110619
+ occurrenceId: session.occurrenceId
110620
+ }),
110498
110621
  sequence: 0,
110499
110622
  title: event.title,
110500
110623
  startsAt: new Date(session.startsAt),
@@ -112762,11 +112885,14 @@ function pricingDetailsBlocker(input) {
112762
112885
  message
112763
112886
  } : null;
112764
112887
  }
112888
+ /**
112889
+ * Where details go next. A refusal names its own next step: the server's refusal says in its words
112890
+ * what to do (contact the organiser, or nothing can be done here), so it has no button, while a check
112891
+ * that couldn't run, or a choice the form can't submit, goes back to the details to try again.
112892
+ */
112765
112893
  function planRegistrationDetailsContinuation(input) {
112766
- if (input.next.kind === "unavailable") return {
112767
- kind: "blocked",
112768
- message: input.next.message
112769
- };
112894
+ if (input.next.kind === "unavailable") return detailsBlocked(input.next.message, "none");
112895
+ if (input.next.kind === "checkFailed") return detailsBlocked(input.next.message, "details");
112770
112896
  const canJoinWaitlist = input.next.kind === "waitlist";
112771
112897
  if (!canJoinWaitlist && (input.quoteReady === false || requiresPaymentStep(input))) return { kind: "payment-step" };
112772
112898
  const plan = resolveEventRegistrationSubmitPlan({
@@ -112776,9 +112902,21 @@ function planRegistrationDetailsContinuation(input) {
112776
112902
  return plan.ok ? {
112777
112903
  kind: "submit",
112778
112904
  args: plan.args
112779
- } : {
112905
+ } : detailsBlocked(plan.message, "details");
112906
+ }
112907
+ function detailsBlocked(message, action) {
112908
+ return {
112780
112909
  kind: "blocked",
112781
- message: plan.message
112910
+ message,
112911
+ action
112912
+ };
112913
+ }
112914
+ /** Claims hold a place and ask the booking questions; joining the queue does neither. */
112915
+ function registrationBookingRequirements(admission, event) {
112916
+ const source = admission.kind === "waitlist" ? null : event;
112917
+ return {
112918
+ event: source,
112919
+ consent: source?.consent ?? null
112782
112920
  };
112783
112921
  }
112784
112922
  //#endregion
@@ -115060,7 +115198,8 @@ function closedRegistrationDisplay(source, events) {
115060
115198
  } : null;
115061
115199
  }
115062
115200
  function closedRegistrationCopy(source, events) {
115063
- if (hasCancelledRegistrationDate(events, source.occurrenceContext?.id)) return cancelledDateCopy;
115201
+ const cancelled = cancelledRegistrationCopy(events, source.occurrenceContext?.id);
115202
+ if (cancelled) return cancelled;
115064
115203
  const selectedRun = resolveSelectedWholeSeriesRun(events);
115065
115204
  const phase = selectedRun ? resolveWholeSeriesBookingPhase(selectedRun.run, new Date(source.now)) : null;
115066
115205
  return phase?.kind === "closed" ? closedRunCopy(phase.reason, selectedRun?.run) : null;
@@ -115870,6 +116009,10 @@ const eventDetailsBlockDefinition = {
115870
116009
  fallback: null
115871
116010
  } },
115872
116011
  events: { $bind: { from: "data.eventDetailsData.events" } },
116012
+ eventOverview: { $bind: {
116013
+ from: "data.eventDetailsData.eventOverview",
116014
+ fallback: false
116015
+ } },
115873
116016
  venueDrawing: { $bind: {
115874
116017
  from: "data.eventDetailsData.venueDrawing",
115875
116018
  fallback: null
@@ -115910,6 +116053,8 @@ const eventDetailsBlockDefinition = {
115910
116053
  dataSchemas: {
115911
116054
  eventDetailsData: z.object({
115912
116055
  events: publicEventsArraySchema,
116056
+ /** The page is about the whole event, not the date the page's booking column holds. */
116057
+ eventOverview: z.boolean().optional(),
115913
116058
  venueDrawing: eventVenueDrawingSchema.optional().catch(void 0),
115914
116059
  sitePasses: publicPassProductCollectionSchema,
115915
116060
  siteMemberships: publicMembershipProductCollectionSchema,
@@ -127951,6 +128096,7 @@ const publicVoucherOfferSchema = z.object({
127951
128096
  });
127952
128097
  const publicGiftingOffersResponseSchema = z.object({
127953
128098
  currency: z.string(),
128099
+ expiryDays: z.number().int().positive(),
127954
128100
  giftCards: z.array(publicGiftCardOfferSchema),
127955
128101
  vouchers: z.array(publicVoucherOfferSchema)
127956
128102
  });
@@ -132199,12 +132345,34 @@ function headerDateFact(selection) {
132199
132345
  endsAt: event.endsAt,
132200
132346
  ...eventDateOptions(event)
132201
132347
  });
132202
- return {
132348
+ return cancelledEventDatesFact(selection) ?? {
132203
132349
  label: selection.mode === "next" ? "Next date" : "Date",
132204
132350
  value: date
132205
132351
  };
132206
132352
  }
132207
132353
  /**
132354
+ * A cancelled event's dates, as its own page names them: the span of its
132355
+ * remaining dates, or the one date it was due on. A cancelled event has no
132356
+ * next date. Null for anything still on, or a date's own page.
132357
+ */
132358
+ function cancelledEventDatesFact(selection) {
132359
+ const cancelled = selection.kind === "ordinary" ? selection.cancelledEventDates : null;
132360
+ if (!cancelled) return null;
132361
+ if (cancelled.first !== cancelled.last) return {
132362
+ label: "Dates",
132363
+ value: formatEventRunDates(cancelled.first, cancelled.last, eventDateOptions(cancelled.first))
132364
+ };
132365
+ const { date } = formatEventDateParts({
132366
+ startsAt: cancelled.first.startsAt,
132367
+ endsAt: cancelled.first.endsAt,
132368
+ ...eventDateOptions(cancelled.first)
132369
+ });
132370
+ return {
132371
+ label: "Date",
132372
+ value: date
132373
+ };
132374
+ }
132375
+ /**
132208
132376
  * Dates booked elsewhere take the page's shared booking decision, the one the
132209
132377
  * registration panel shows. A later booking date is named by
132210
132378
  * `laterBookingFact`, not in the button.
@@ -136854,15 +137022,27 @@ function selectEventDetails(args) {
136854
137022
  otherDates: otherDates.filter(isOrdinaryEvent),
136855
137023
  timeZone,
136856
137024
  depositOffer: resolvePublicEventDepositOffer(selected, { nowIso: args.nowIso }),
136857
- bookedElsewhere: pageBookedElsewhere(all, occurrenceContext, args.nowIso)
137025
+ bookedElsewhere: pageBookedElsewhere(all, occurrenceContext, args.nowIso),
137026
+ cancelledEventDates: cancelledEventDates(selected, mode, all, args.nowIso)
136858
137027
  };
136859
137028
  }
137029
+ /** Only the overview speaks for the whole cancelled event; a chosen date keeps its own. */
137030
+ function cancelledEventDates(selected, mode, events, nowIso) {
137031
+ if (mode === "selected" || publicEventCancellation(selected) !== "event") return null;
137032
+ const dates = [selected, ...events.filter(isOrdinaryEvent).filter((event) => event.seriesId === selected.seriesId && event.occurrenceId !== selected.occurrenceId && isFutureOrNow(event.startsAt, nowIso))].sort((left, right) => Date.parse(left.startsAt) - Date.parse(right.startsAt));
137033
+ const first = dates[0];
137034
+ const last = dates.at(-1);
137035
+ return first && last ? {
137036
+ first,
137037
+ last
137038
+ } : null;
137039
+ }
136860
137040
  //#endregion
136861
137041
  //#region ../blocks/src/system/runtime/nodes/event-details/presentation.ts
136862
137042
  function resolveSelection(input) {
136863
137043
  return selectEventDetails({
136864
137044
  events: input.events ?? null,
136865
- occurrenceContext: input.occurrenceContext ?? null,
137045
+ occurrenceContext: input.eventOverview ? null : input.occurrenceContext ?? null,
136866
137046
  subject: input.subject,
136867
137047
  nowIso: input.now,
136868
137048
  otherDatesLimit: input.otherDatesLimit
@@ -136966,10 +137146,11 @@ function EventFactList({ slot, children }) {
136966
137146
  children
136967
137147
  });
136968
137148
  }
136969
- function EventFactRow({ fact, label, icon: Icon, slots, children }) {
137149
+ function EventFactRow({ fact, label, icon: Icon, slots, wide = false, children }) {
136970
137150
  return /* @__PURE__ */ jsxs("div", {
136971
137151
  ...slots.detail,
136972
137152
  "data-fact": fact,
137153
+ "data-fact-wide": wide ? "" : void 0,
136973
137154
  children: [/* @__PURE__ */ jsx("dt", {
136974
137155
  ...slots.label,
136975
137156
  className: "rb-sr-only",
@@ -137006,6 +137187,10 @@ function PriceOptionList({ options }) {
137006
137187
  }) : null] }, option.id))
137007
137188
  });
137008
137189
  }
137190
+ /** Prices with descriptions read as sentences, so they need the width of the row. */
137191
+ function priceSummaryIsWide(summary) {
137192
+ return summary.kind !== "price" && summary.options.some((option) => option.description);
137193
+ }
137009
137194
  const sentence = (text) => `${text.charAt(0).toUpperCase()}${text.slice(1)}`;
137010
137195
  function EventPriceSummaryLines({ summary }) {
137011
137196
  if (summary.kind === "price") return /* @__PURE__ */ jsx(PriceLine, {
@@ -137076,27 +137261,35 @@ function EventPricingDetails(props) {
137076
137261
  icon: TicketIcon,
137077
137262
  children: /* @__PURE__ */ jsx("p", { children: "No registration required - just show up" })
137078
137263
  });
137079
- if (props.wholeSeriesPricingDisplay) return /* @__PURE__ */ jsxs(EventFactRow, {
137080
- slots,
137081
- fact: "price",
137082
- label: "Cost",
137083
- icon: TicketIcon,
137084
- children: [/* @__PURE__ */ jsx(EventPriceSummaryLines, { summary: wholeSeriesPriceSummary(props.wholeSeriesPricingDisplay, props.depositNote) }), /* @__PURE__ */ jsx(AcceptedItemsLine, { acceptedItems })]
137085
- });
137086
- if (props.eventCostLabel) return /* @__PURE__ */ jsxs(EventFactRow, {
137087
- slots,
137088
- fact: "price",
137089
- label: "Cost",
137090
- icon: TicketIcon,
137091
- children: [
137092
- /* @__PURE__ */ jsx(EventPriceSummaryLines, { summary: ticketPriceSummary(props, props.eventCostLabel) }),
137093
- props.autoApplyDiscount && props.eventPricingCurrency ? /* @__PURE__ */ jsx("p", {
137094
- className: "rb-caption",
137095
- children: formatAutoApplyDiscountLine(props.autoApplyDiscount, props.eventPricingCurrency)
137096
- }) : null,
137097
- /* @__PURE__ */ jsx(AcceptedItemsLine, { acceptedItems })
137098
- ]
137099
- });
137264
+ if (props.wholeSeriesPricingDisplay) {
137265
+ const summary = wholeSeriesPriceSummary(props.wholeSeriesPricingDisplay, props.depositNote);
137266
+ return /* @__PURE__ */ jsxs(EventFactRow, {
137267
+ slots,
137268
+ fact: "price",
137269
+ label: "Cost",
137270
+ icon: TicketIcon,
137271
+ wide: priceSummaryIsWide(summary),
137272
+ children: [/* @__PURE__ */ jsx(EventPriceSummaryLines, { summary }), /* @__PURE__ */ jsx(AcceptedItemsLine, { acceptedItems })]
137273
+ });
137274
+ }
137275
+ if (props.eventCostLabel) {
137276
+ const summary = ticketPriceSummary(props, props.eventCostLabel);
137277
+ return /* @__PURE__ */ jsxs(EventFactRow, {
137278
+ slots,
137279
+ fact: "price",
137280
+ label: "Cost",
137281
+ icon: TicketIcon,
137282
+ wide: priceSummaryIsWide(summary),
137283
+ children: [
137284
+ /* @__PURE__ */ jsx(EventPriceSummaryLines, { summary }),
137285
+ props.autoApplyDiscount && props.eventPricingCurrency ? /* @__PURE__ */ jsx("p", {
137286
+ className: "rb-caption",
137287
+ children: formatAutoApplyDiscountLine(props.autoApplyDiscount, props.eventPricingCurrency)
137288
+ }) : null,
137289
+ /* @__PURE__ */ jsx(AcceptedItemsLine, { acceptedItems })
137290
+ ]
137291
+ });
137292
+ }
137100
137293
  return acceptedItems.length > 0 ? /* @__PURE__ */ jsx(EventFactRow, {
137101
137294
  slots,
137102
137295
  fact: "accepted",
@@ -137111,16 +137304,19 @@ function EventFacts({ selection, selected, venue, online, addressAfterBooking, t
137111
137304
  endsAt: selected.endsAt,
137112
137305
  ...eventDateOptions(selected)
137113
137306
  });
137114
- const dateHeading = selection.kind === "wholeSeries" ? runLifecycleLabel(selection.lifecycle) : selection.mode === "next" ? "Next date" : "Date";
137307
+ const dateFact = cancelledEventDatesFact(selection) ?? {
137308
+ label: ordinaryDateHeading(selection),
137309
+ value: date
137310
+ };
137115
137311
  return /* @__PURE__ */ jsxs(EventFactList, {
137116
137312
  slot: listLookSlot({ lookSlots }, "facts"),
137117
137313
  children: [
137118
137314
  /* @__PURE__ */ jsxs(EventFactRow, {
137119
137315
  slots,
137120
137316
  fact: "date",
137121
- label: dateHeading,
137317
+ label: dateFact.label,
137122
137318
  icon: CalendarIcon$1,
137123
- children: [/* @__PURE__ */ jsx("p", { children: /* @__PURE__ */ jsx("strong", { children: date }) }), /* @__PURE__ */ jsx("p", {
137319
+ children: [/* @__PURE__ */ jsx("p", { children: /* @__PURE__ */ jsx("strong", { children: dateFact.value }) }), /* @__PURE__ */ jsx("p", {
137124
137320
  className: "rb-event-fact-muted",
137125
137321
  children: timeRange
137126
137322
  })]
@@ -137151,6 +137347,7 @@ function EventFacts({ selection, selected, venue, online, addressAfterBooking, t
137151
137347
  ]
137152
137348
  });
137153
137349
  }
137350
+ const ordinaryDateHeading = (selection) => selection.kind === "wholeSeries" ? runLifecycleLabel(selection.lifecycle) : selection.mode === "next" ? "Next date" : "Date";
137154
137351
  const eventOnlinePlaceShown = (event, showVenue) => showVenue ? eventOnlinePlace(event) : null;
137155
137352
  const hasEventPlaceFact = (event, showVenue) => showVenue && (Boolean(event.venue) || eventOnlinePlace(event) !== null || event.addressAfterBooking === true);
137156
137353
  const addressAfterBookingShown = (event, showVenue) => showVenue && event.addressAfterBooking === true;
@@ -137169,6 +137366,7 @@ function EventPlaceWithoutVenue({ online, addressAfterBooking, slots }) {
137169
137366
  fact: "venue",
137170
137367
  label: "Venue",
137171
137368
  icon: GlobeIcon,
137369
+ wide: addressAfterBooking || Boolean(online.note),
137172
137370
  children: [
137173
137371
  /* @__PURE__ */ jsx("p", { children: /* @__PURE__ */ jsx("strong", { children: online.mode === "online" ? "Online" : "In person or online" }) }),
137174
137372
  addressAfterBooking ? /* @__PURE__ */ jsxs("p", {
@@ -137195,6 +137393,7 @@ function EventVenueFact({ venue, online, addressAfterBooking, slots }) {
137195
137393
  fact: "venue",
137196
137394
  label: "Venue",
137197
137395
  icon: MapPinIcon$1,
137396
+ wide: addressWithBooking || online !== null,
137198
137397
  children: [
137199
137398
  /* @__PURE__ */ jsxs("p", { children: [/* @__PURE__ */ jsx("strong", { children: venue.name }), place ? `, ${place}` : null] }),
137200
137399
  addressWithBooking ? /* @__PURE__ */ jsx("p", {
@@ -139518,7 +139717,7 @@ function GiftCardAmounts(props) {
139518
139717
  value: CUSTOM_GIFT_AMOUNT,
139519
139718
  label: "Another amount"
139520
139719
  }] : []];
139521
- return /* @__PURE__ */ jsx(ChoiceGroup, {
139720
+ return /* @__PURE__ */ jsx(SiteChoiceGroup, {
139522
139721
  className: "gifting-amounts",
139523
139722
  name: props.groupName ?? "amountChoice",
139524
139723
  legend: "Amount",
@@ -139555,6 +139754,13 @@ function GiftGroup(props) {
139555
139754
  }), props.children]
139556
139755
  });
139557
139756
  }
139757
+ /** The same validity before hydration and while filling in the purchase form. */
139758
+ function GiftingExpiry({ days }) {
139759
+ return days === void 0 ? null : /* @__PURE__ */ jsx("p", {
139760
+ className: "gifting-offer-description",
139761
+ children: `Valid for ${days} ${days === 1 ? "day" : "days"} from the date the gift is sent.`
139762
+ });
139763
+ }
139558
139764
  //#endregion
139559
139765
  //#region ../blocks/src/system/runtime/nodes/gifting.server.tsx
139560
139766
  /** What shows until the island takes over: the same panel, with the details form still closed. */
@@ -139577,87 +139783,91 @@ function GiftingSSR({ blockId, ...rest }) {
139577
139783
  children: /* @__PURE__ */ jsxs("div", {
139578
139784
  className: "gifting",
139579
139785
  ...display.lookSlots ? { "data-slot": "layout" } : {},
139580
- children: [/* @__PURE__ */ jsx(GiftingPanelHead, {
139581
- heading: display.heading,
139582
- intro: display.intro,
139583
- look: display
139584
- }), /* @__PURE__ */ jsx("div", {
139585
- className: "gifting-main",
139586
- children: hasOffers ? /* @__PURE__ */ jsx("div", {
139587
- className: "gifting-groups",
139588
- "data-group-count": display.groups.length,
139589
- children: display.groups.map((group) => /* @__PURE__ */ jsx(GiftGroup, {
139590
- group,
139591
- look: display,
139592
- children: group.kind === "gift_card" ? /* @__PURE__ */ jsx(Fragment$1, { children: giftCards.map((offer) => /* @__PURE__ */ jsxs("div", {
139593
- className: "gifting-offer",
139594
- "data-gift-offer": offer.id,
139595
- children: [
139596
- giftCards.length > 1 ? /* @__PURE__ */ jsx("h4", {
139597
- className: "gifting-offer-title",
139598
- children: offer.title
139599
- }) : null,
139600
- offer.description ? /* @__PURE__ */ jsx("p", {
139601
- className: "gifting-offer-description",
139602
- children: offer.description
139603
- }) : null,
139604
- /* @__PURE__ */ jsxs("div", {
139605
- className: "gifting-offer-row",
139606
- "data-gift-offer-row": "",
139607
- children: [/* @__PURE__ */ jsx(GiftCardAmounts, {
139608
- offer,
139609
- currency: offers?.currency ?? "GBP",
139610
- groupName: `amountChoice-${offer.id}`,
139611
- look: display
139612
- }), /* @__PURE__ */ jsx(ThemedButton, {
139613
- ...giftingSlot(display, "action"),
139614
- type: "button",
139615
- variant: "primary",
139616
- size: "md",
139617
- extraClassName: "gifting-buy",
139618
- label: "Buy a gift card"
139619
- })]
139620
- })
139621
- ]
139622
- }, offer.id)) }) : /* @__PURE__ */ jsx("ul", {
139623
- className: "gifting-voucher-list",
139624
- children: vouchers.map((offer) => /* @__PURE__ */ jsx("li", {
139625
- className: "gifting-voucher",
139626
- children: /* @__PURE__ */ jsxs("div", {
139627
- className: "gifting-offer",
139628
- children: [
139629
- /* @__PURE__ */ jsxs("div", {
139630
- className: "gifting-offer-summary",
139631
- children: [/* @__PURE__ */ jsx("h4", {
139632
- className: "gifting-offer-title",
139633
- children: offer.title
139634
- }), /* @__PURE__ */ jsx("strong", {
139635
- className: "gifting-offer-price",
139636
- children: formatGiftAmount(offer.voucher.purchaseAmountCents, offers?.currency ?? "GBP")
139637
- })]
139638
- }),
139639
- offer.description ? /* @__PURE__ */ jsx("p", {
139640
- className: "gifting-offer-description",
139641
- children: offer.description
139642
- }) : null,
139643
- /* @__PURE__ */ jsx(ThemedButton, {
139786
+ children: [
139787
+ /* @__PURE__ */ jsx(GiftingPanelHead, {
139788
+ heading: display.heading,
139789
+ intro: display.intro,
139790
+ look: display
139791
+ }),
139792
+ /* @__PURE__ */ jsx(GiftingExpiry, { days: offers?.expiryDays }),
139793
+ /* @__PURE__ */ jsx("div", {
139794
+ className: "gifting-main",
139795
+ children: hasOffers ? /* @__PURE__ */ jsx("div", {
139796
+ className: "gifting-groups",
139797
+ "data-group-count": display.groups.length,
139798
+ children: display.groups.map((group) => /* @__PURE__ */ jsx(GiftGroup, {
139799
+ group,
139800
+ look: display,
139801
+ children: group.kind === "gift_card" ? /* @__PURE__ */ jsx(Fragment$1, { children: giftCards.map((offer) => /* @__PURE__ */ jsxs("div", {
139802
+ className: "gifting-offer",
139803
+ "data-gift-offer": offer.id,
139804
+ children: [
139805
+ giftCards.length > 1 ? /* @__PURE__ */ jsx("h4", {
139806
+ className: "gifting-offer-title",
139807
+ children: offer.title
139808
+ }) : null,
139809
+ offer.description ? /* @__PURE__ */ jsx("p", {
139810
+ className: "gifting-offer-description",
139811
+ children: offer.description
139812
+ }) : null,
139813
+ /* @__PURE__ */ jsxs("div", {
139814
+ className: "gifting-offer-row",
139815
+ "data-gift-offer-row": "",
139816
+ children: [/* @__PURE__ */ jsx(GiftCardAmounts, {
139817
+ offer,
139818
+ currency: offers?.currency ?? "GBP",
139819
+ groupName: `amountChoice-${offer.id}`,
139820
+ look: display
139821
+ }), /* @__PURE__ */ jsx(ThemedButton, {
139644
139822
  ...giftingSlot(display, "action"),
139645
139823
  type: "button",
139646
- variant: "secondary",
139824
+ variant: "primary",
139647
139825
  size: "md",
139648
139826
  extraClassName: "gifting-buy",
139649
- label: "Buy this voucher"
139650
- })
139651
- ]
139652
- })
139653
- }, offer.id))
139654
- })
139655
- }, group.kind))
139656
- }) : /* @__PURE__ */ jsx("p", {
139657
- className: "gifting-empty",
139658
- children: GIFTING_NOTHING_TO_SHOW
139827
+ label: "Buy a gift card"
139828
+ })]
139829
+ })
139830
+ ]
139831
+ }, offer.id)) }) : /* @__PURE__ */ jsx("ul", {
139832
+ className: "gifting-voucher-list",
139833
+ children: vouchers.map((offer) => /* @__PURE__ */ jsx("li", {
139834
+ className: "gifting-voucher",
139835
+ children: /* @__PURE__ */ jsxs("div", {
139836
+ className: "gifting-offer",
139837
+ children: [
139838
+ /* @__PURE__ */ jsxs("div", {
139839
+ className: "gifting-offer-summary",
139840
+ children: [/* @__PURE__ */ jsx("h4", {
139841
+ className: "gifting-offer-title",
139842
+ children: offer.title
139843
+ }), /* @__PURE__ */ jsx("strong", {
139844
+ className: "gifting-offer-price",
139845
+ children: formatGiftAmount(offer.voucher.purchaseAmountCents, offers?.currency ?? "GBP")
139846
+ })]
139847
+ }),
139848
+ offer.description ? /* @__PURE__ */ jsx("p", {
139849
+ className: "gifting-offer-description",
139850
+ children: offer.description
139851
+ }) : null,
139852
+ /* @__PURE__ */ jsx(ThemedButton, {
139853
+ ...giftingSlot(display, "action"),
139854
+ type: "button",
139855
+ variant: "secondary",
139856
+ size: "md",
139857
+ extraClassName: "gifting-buy",
139858
+ label: "Buy this voucher"
139859
+ })
139860
+ ]
139861
+ })
139862
+ }, offer.id))
139863
+ })
139864
+ }, group.kind))
139865
+ }) : /* @__PURE__ */ jsx("p", {
139866
+ className: "gifting-empty",
139867
+ children: GIFTING_NOTHING_TO_SHOW
139868
+ })
139659
139869
  })
139660
- })]
139870
+ ]
139661
139871
  })
139662
139872
  });
139663
139873
  }
@@ -140791,10 +141001,10 @@ function EventBookingPanelBody({ panel }) {
140791
141001
  className: "event-booking-panel__cancelled",
140792
141002
  children: [/* @__PURE__ */ jsx("h2", {
140793
141003
  className: "card-title rb-mb-3",
140794
- children: cancelledDateCopy.titleText
141004
+ children: panel.copy.titleText
140795
141005
  }), /* @__PURE__ */ jsx("p", {
140796
141006
  className: "status-muted rb-text-base rb-leading-relaxed",
140797
- children: cancelledDateCopy.bodyText
141007
+ children: panel.copy.bodyText
140798
141008
  })]
140799
141009
  });
140800
141010
  case "bookElsewhere": return /* @__PURE__ */ jsx("div", {
@@ -141044,9 +141254,11 @@ function selectOccurrenceForPanel(events, occurrenceId) {
141044
141254
  } : null;
141045
141255
  }
141046
141256
  function planEventBookingPanel({ selection, subject, pageEvents }, now) {
141047
- if (isCancelledDateSelection(selection)) return {
141257
+ const cancelled = cancelledDateSelectionCopy(selection);
141258
+ if (cancelled) return {
141048
141259
  kind: "cancelled",
141049
- registration: null
141260
+ registration: null,
141261
+ copy: cancelled
141050
141262
  };
141051
141263
  const elsewhere = planBookElsewherePanel(selection, now);
141052
141264
  if (elsewhere) return elsewhere;
@@ -141080,12 +141292,22 @@ function planEventBookingPanel({ selection, subject, pageEvents }, now) {
141080
141292
  registration
141081
141293
  };
141082
141294
  }
141083
- case "wholeSeriesParentUnavailable": return {
141084
- ...nonBookingPanel ?? { kind: "unavailable" },
141085
- registration: parentRegistrationTarget(selection, subject)
141086
- };
141295
+ case "wholeSeriesParentUnavailable": return unavailableParentPanel(selection, parentRegistrationTarget(selection, subject), nonBookingPanel);
141087
141296
  }
141088
141297
  }
141298
+ /** A course with nothing to book: cancelled when every run is, otherwise why it can't be booked. */
141299
+ function unavailableParentPanel(selection, registration, nonBookingPanel) {
141300
+ const cancelledRuns = cancelledRunsCopy(selection.admittedRuns.map((run) => run.representative));
141301
+ if (cancelledRuns) return {
141302
+ kind: "cancelled",
141303
+ copy: cancelledRuns,
141304
+ registration
141305
+ };
141306
+ return {
141307
+ ...nonBookingPanel ?? { kind: "unavailable" },
141308
+ registration
141309
+ };
141310
+ }
141089
141311
  /**
141090
141312
  * A date past its cut-off, however old the page's data is. A list of dates only
141091
141313
  * closes when every date has: until then the closed ones just leave the list.
@@ -141201,8 +141423,8 @@ function parentRegistrationTarget(selection, subject) {
141201
141423
  };
141202
141424
  }
141203
141425
  /** Cancelled dates have no new-booking or recovery form, including old direct links. */
141204
- function isCancelledDateSelection(selection) {
141205
- return selection.kind === "occurrence" && hasCancelledRegistrationDate([selection.event]);
141426
+ function cancelledDateSelectionCopy(selection) {
141427
+ return selection.kind === "occurrence" ? cancelledRegistrationCopy([selection.event]) : null;
141206
141428
  }
141207
141429
  //#endregion
141208
141430
  //#region ../blocks/src/system/runtime/nodes/event-registration/RegistrationClosedState.tsx
@@ -153793,6 +154015,12 @@ const PORTAL = {
153793
154015
  authScope: "portal",
153794
154016
  skipPreviewStage: true
153795
154017
  },
154018
+ membershipPayment: {
154019
+ path: "/portal/memberships/{customerMembershipId}/payment",
154020
+ method: "POST",
154021
+ authScope: "portal",
154022
+ skipPreviewStage: true
154023
+ },
153796
154024
  cancelMembershipAtPeriodEnd: {
153797
154025
  path: "/portal/memberships/{customerMembershipId}/cancel",
153798
154026
  method: "POST",
@@ -155526,6 +155754,10 @@ function summariseBookingHeldPackages(source, packages, heldWithTeamMembers) {
155526
155754
  }
155527
155755
  //#endregion
155528
155756
  //#region ../blocks/src/system/runtime/nodes/booking-form.payment-confirmation.ts
155757
+ /** Whether pressing the button goes on to a card payment. */
155758
+ function confirmationLeadsToPayment(summary) {
155759
+ return summary !== null && summary.kind !== "pay_directly";
155760
+ }
155529
155761
  function resolveBookingPaymentConfirmationSummary(input) {
155530
155762
  const service = input.service;
155531
155763
  if (!service || !service.durationMinutes || !Number.isFinite(input.priceAmount) || input.priceAmount <= 0) return null;
@@ -155543,15 +155775,30 @@ function resolveBookingPaymentConfirmationSummary(input) {
155543
155775
  };
155544
155776
  case "held_package": return null;
155545
155777
  case "per_session":
155546
- case "unselected": return bookingPaymentNeedsCardConfirmation(input.paymentResolution) ? {
155778
+ case "unselected": return perSessionConfirmationSummary({
155547
155779
  ...base,
155548
- kind: "per_session",
155549
155780
  priceCurrency: service.priceCurrency ?? service.pricing?.currency ?? "USD"
155550
- } : null;
155781
+ }, input.paymentResolution, input.businessName);
155551
155782
  }
155552
155783
  }
155553
- function bookingPaymentNeedsCardConfirmation(payment) {
155554
- return payment.kind === "ready" && payment.choice.kind === "selected" && payment.choice.option.kind !== "deferred_manual";
155784
+ /** A single session: paid by card here, or straight to the business. */
155785
+ function perSessionConfirmationSummary(base, payment, businessName) {
155786
+ switch (perSessionConfirmationKind(payment)) {
155787
+ case "per_session": return {
155788
+ ...base,
155789
+ kind: "per_session"
155790
+ };
155791
+ case "pay_directly": return {
155792
+ ...base,
155793
+ kind: "pay_directly",
155794
+ payee: businessName?.trim() || null
155795
+ };
155796
+ case null: return null;
155797
+ }
155798
+ }
155799
+ function perSessionConfirmationKind(payment) {
155800
+ if (payment.kind !== "ready" || payment.choice.kind !== "selected") return null;
155801
+ return payment.choice.option.kind === "deferred_manual" ? "pay_directly" : "per_session";
155555
155802
  }
155556
155803
  /** The discounted amount actually shown is the submission's ceiling, using the existing term snapshot. */
155557
155804
  function discountedBookingShownTerms(payment, totalCents, currency) {
@@ -159256,7 +159503,8 @@ function useHeadlessBookingFlow(options) {
159256
159503
  service: selectedService,
159257
159504
  priceAmount: discountedPriceAmount(manualDiscount.discount, paymentPriceAmount),
159258
159505
  choice: paymentChoice,
159259
- paymentResolution
159506
+ paymentResolution,
159507
+ businessName: options.siteName
159260
159508
  });
159261
159509
  const availabilityDisplay = resolveBookingFormDateDisplay({
159262
159510
  viewerTimeZone,
@@ -160051,6 +160299,20 @@ function BookingPaymentConfirmationText({ booking, summary }) {
160051
160299
  const dateTime = formatBookingConfirmationDateTime(booking);
160052
160300
  const price = formatCurrencyAmount(summary.priceAmount, summary.priceCurrency, { decimals: "auto" });
160053
160301
  const when = dateTime ? ` · ${dateTime}` : "";
160302
+ if (summary.kind === "pay_directly") return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("p", {
160303
+ className: "ab-text rb-on-surface--muted",
160304
+ children: [
160305
+ summary.serviceTitle,
160306
+ " · ",
160307
+ summary.durationMinutes,
160308
+ " min · ",
160309
+ price,
160310
+ when
160311
+ ]
160312
+ }), /* @__PURE__ */ jsx("p", {
160313
+ className: "ab-text",
160314
+ children: payDirectlyLine(price, summary.payee)
160315
+ })] });
160054
160316
  if (summary.kind === "buy_package") return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("p", {
160055
160317
  className: "ab-text rb-on-surface--muted",
160056
160318
  children: [
@@ -160081,6 +160343,10 @@ function BookingPaymentConfirmationText({ booking, summary }) {
160081
160343
  ]
160082
160344
  });
160083
160345
  }
160346
+ /** Nothing is taken online, so say so before the client confirms, and who they'll pay. */
160347
+ function payDirectlyLine(price, payee) {
160348
+ return `You’ll pay ${price} to ${payee ?? "the business"} directly. Nothing is taken online.`;
160349
+ }
160084
160350
  function BookingFormSubmitActions({ booking, onSubmit }) {
160085
160351
  const currentStepIndex = booking.currentStep?.visibleIndex ?? 0;
160086
160352
  const isFirstStep = currentStepIndex === 0;
@@ -160160,7 +160426,7 @@ function BookingOfferReview({ review, booking }) {
160160
160426
  });
160161
160427
  }
160162
160428
  function bookingPrimaryActionLabel(booking, isLastStep, summary) {
160163
- return isLastStep ? lastStepActionLabel(booking, summary) : resolvePrimaryActionLabel(false, Boolean(summary));
160429
+ return isLastStep ? lastStepActionLabel(booking, summary) : resolvePrimaryActionLabel(false, confirmationLeadsToPayment(summary));
160164
160430
  }
160165
160431
  function lastStepActionLabel(booking, summary) {
160166
160432
  if (booking.services.selected?.requiresApproval) return "Send request";
@@ -160168,7 +160434,7 @@ function lastStepActionLabel(booking, summary) {
160168
160434
  if (summary?.kind === "buy_package") return resolvePrimaryActionLabel(true, true);
160169
160435
  const discount = booking.discount.preview?.discount;
160170
160436
  if (discount) return discountedActionLabel(booking, discount);
160171
- return resolvePrimaryActionLabel(true, Boolean(summary));
160437
+ return resolvePrimaryActionLabel(true, confirmationLeadsToPayment(summary));
160172
160438
  }
160173
160439
  function discountedActionLabel(booking, discount) {
160174
160440
  if (discount.totalAfterDiscountCents === 0) return "Confirm booking";
@@ -160443,24 +160709,15 @@ function SelectQuestionInput({ field, inputId, value, disabled, control, onChang
160443
160709
  });
160444
160710
  }
160445
160711
  function RadioQuestionInput({ field, inputId, value, disabled, control, onChange }) {
160446
- return /* @__PURE__ */ jsx("div", {
160447
- className: "rb-space-y-2",
160448
- children: field.options?.map((option) => /* @__PURE__ */ jsxs("label", {
160449
- className: "form-check",
160450
- children: [/* @__PURE__ */ jsx("input", {
160451
- type: "radio",
160452
- name: inputId,
160453
- value: option.value,
160454
- checked: value === option.value,
160455
- disabled,
160456
- className: "form-radio",
160457
- "aria-invalid": control["aria-invalid"],
160458
- onChange: (event) => onChange(event.target.value)
160459
- }), /* @__PURE__ */ jsx("span", {
160460
- className: "form-check-label",
160461
- children: option.label
160462
- })]
160463
- }, option.value))
160712
+ return /* @__PURE__ */ jsx(SiteChoiceOptions, {
160713
+ size: "row",
160714
+ name: inputId,
160715
+ options: field.options ?? [],
160716
+ value: toStringValue(value),
160717
+ disabled,
160718
+ invalid: control["aria-invalid"] === "true",
160719
+ describedBy: control["aria-describedby"],
160720
+ onChange
160464
160721
  });
160465
160722
  }
160466
160723
  function toggledValues(selected, value, checked) {
@@ -160540,13 +160797,17 @@ function questionControlProps(field, ids, error) {
160540
160797
  ...field.required ? { "aria-required": "true" } : {}
160541
160798
  };
160542
160799
  }
160543
- /** Radios and multi-choice checkboxes answer one question with several controls, so they're a named group. */
160544
- function isChoiceGroup(field) {
160800
+ /**
160801
+ * Radios and multi-choice checkboxes answer one question with several
160802
+ * controls, so the question is a fieldset. The booking form's own fields
160803
+ * follow the same rule, so it takes anything with a type and options.
160804
+ */
160805
+ function isFieldsetQuestion(field) {
160545
160806
  return field.type === "radio" || field.type === "checkbox" && (field.options?.length ?? 0) > 1;
160546
160807
  }
160547
160808
  function QuestionLabel({ field, inputId }) {
160548
160809
  const text = /* @__PURE__ */ jsxs(Fragment$1, { children: [field.label, field.required ? null : /* @__PURE__ */ jsx(OptionalMark$1, {})] });
160549
- return isChoiceGroup(field) ? /* @__PURE__ */ jsx("legend", {
160810
+ return isFieldsetQuestion(field) ? /* @__PURE__ */ jsx("legend", {
160550
160811
  className: "form-label rb-p-0",
160551
160812
  children: text
160552
160813
  }) : /* @__PURE__ */ jsx("label", {
@@ -160555,22 +160816,38 @@ function QuestionLabel({ field, inputId }) {
160555
160816
  children: text
160556
160817
  });
160557
160818
  }
160558
- /** A choice group is a fieldset: the question is its legend, and the group carries required state and descriptions. */
160559
- function QuestionFrame({ field, control, children }) {
160560
- if (!isChoiceGroup(field)) return /* @__PURE__ */ jsx("div", {
160561
- className: "rb-space-y-2",
160562
- children
160563
- });
160819
+ /**
160820
+ * The fieldset of a question answered with several controls: the question is
160821
+ * its legend, and it carries the help and error descriptions. Radios make it
160822
+ * a radio group, which carries the required state. Every surface that asks
160823
+ * booking questions frames them with this.
160824
+ */
160825
+ function QuestionFieldset({ field, describedBy, required, className, children }) {
160564
160826
  return /* @__PURE__ */ jsx("fieldset", {
160565
- className: "rb-space-y-2 rb-border-0 rb-p-0 rb-m-0 rb-min-w-0",
160566
- "aria-describedby": control["aria-describedby"],
160827
+ className,
160828
+ "aria-describedby": describedBy,
160567
160829
  ...field.type === "radio" ? {
160568
160830
  role: "radiogroup",
160569
- "aria-required": control["aria-required"]
160831
+ "aria-required": required || void 0
160570
160832
  } : {},
160571
160833
  children
160572
160834
  });
160573
160835
  }
160836
+ const BOOKING_FIELDSET_CLASS = "rb-space-y-2 rb-border-0 rb-p-0 rb-m-0 rb-min-w-0";
160837
+ /** The booking surfaces' frame for one question: a fieldset for grouped controls, a plain stack otherwise. */
160838
+ function BookingQuestionFrame({ field, describedBy, required, children }) {
160839
+ if (!isFieldsetQuestion(field)) return /* @__PURE__ */ jsx("div", {
160840
+ className: "rb-space-y-2",
160841
+ children
160842
+ });
160843
+ return /* @__PURE__ */ jsx(QuestionFieldset, {
160844
+ field,
160845
+ describedBy,
160846
+ required,
160847
+ className: BOOKING_FIELDSET_CLASS,
160848
+ children
160849
+ });
160850
+ }
160574
160851
  function QuestionField({ field, value, error, disabled, idPrefix, onChange, renderDocumentField }) {
160575
160852
  const inputId = `${idPrefix}${field.id}`;
160576
160853
  const helpTextId = field.helpText ? `${inputId}-help` : void 0;
@@ -160579,9 +160856,10 @@ function QuestionField({ field, value, error, disabled, idPrefix, onChange, rend
160579
160856
  errorId,
160580
160857
  helpTextId
160581
160858
  }, error);
160582
- return /* @__PURE__ */ jsxs(QuestionFrame, {
160859
+ return /* @__PURE__ */ jsxs(BookingQuestionFrame, {
160583
160860
  field,
160584
- control,
160861
+ describedBy: control["aria-describedby"],
160862
+ required: Boolean(field.required),
160585
160863
  children: [
160586
160864
  /* @__PURE__ */ jsx(QuestionLabel, {
160587
160865
  field,
@@ -161041,11 +161319,16 @@ function QuestionSetSection(props) {
161041
161319
  }), props.children]
161042
161320
  });
161043
161321
  }
161322
+ /** Answers are one per booking, so a group's booker says who an answer concerns. */
161323
+ const SEVERAL_PEOPLE_QUESTIONS_NOTE = "If an answer is about someone else in your booking, please say who.";
161044
161324
  function QuestionFields(input) {
161045
161325
  const idPrefix = `${React$1.useId()}-`;
161046
- return /* @__PURE__ */ jsx("div", {
161326
+ return /* @__PURE__ */ jsxs("div", {
161047
161327
  className: "rb-space-y-3",
161048
- children: /* @__PURE__ */ jsx(BookingQuestionFields, {
161328
+ children: [input.props.severalPeople ? /* @__PURE__ */ jsx("p", {
161329
+ className: "rb-bq-note",
161330
+ children: SEVERAL_PEOPLE_QUESTIONS_NOTE
161331
+ }) : null, /* @__PURE__ */ jsx(BookingQuestionFields, {
161049
161332
  sections: input.set.sections,
161050
161333
  values: input.props.values,
161051
161334
  fieldErrors: input.props.fieldErrors,
@@ -161054,7 +161337,7 @@ function QuestionFields(input) {
161054
161337
  idPrefix,
161055
161338
  showFirstSectionTitle: input.props.showFirstSectionTitle,
161056
161339
  renderDocumentField: input.props.renderDocumentField
161057
- })
161340
+ })]
161058
161341
  });
161059
161342
  }
161060
161343
  function AlreadyAnswered(input) {
@@ -161193,17 +161476,14 @@ function DefaultBookingQuestions({ booking }) {
161193
161476
  disabled: booking.status.tag === "submitting"
161194
161477
  });
161195
161478
  }
161196
- /** Radios and multi-choice checkboxes answer one question with several controls, so they're a named group. */
161197
- function isChoiceGroupField(field) {
161198
- return field.type === "radio" || field.type === "checkbox" && (field.options?.length ?? 0) > 1;
161199
- }
161200
161479
  function DefaultDynamicField({ booking, field }) {
161201
161480
  const error = field.error;
161202
161481
  const errorId = error ? field.errorId ?? `${field.inputId}-error` : `${field.inputId}-error`;
161203
161482
  const describedBy = [field.helpTextId, error ? errorId : null].filter(Boolean).join(" ") || void 0;
161204
- return /* @__PURE__ */ jsxs(DynamicFieldFrame, {
161205
- field,
161483
+ return /* @__PURE__ */ jsxs(BookingQuestionFrame, {
161484
+ field: field.field,
161206
161485
  describedBy,
161486
+ required: field.required,
161207
161487
  children: [
161208
161488
  /* @__PURE__ */ jsx(DynamicFieldLabel, { field }),
161209
161489
  field.helpText ? /* @__PURE__ */ jsx("p", {
@@ -161228,22 +161508,6 @@ function DefaultDynamicField({ booking, field }) {
161228
161508
  ]
161229
161509
  });
161230
161510
  }
161231
- /** A choice group is a fieldset whose legend is the question, as in the shared question fields. */
161232
- function DynamicFieldFrame({ children, describedBy, field }) {
161233
- if (!isChoiceGroupField(field.field)) return /* @__PURE__ */ jsx("div", {
161234
- className: "rb-space-y-2",
161235
- children
161236
- });
161237
- return /* @__PURE__ */ jsx("fieldset", {
161238
- className: "rb-space-y-2 rb-border-0 rb-p-0 rb-m-0 rb-min-w-0",
161239
- "aria-describedby": describedBy,
161240
- ...field.field.type === "radio" ? {
161241
- role: "radiogroup",
161242
- ...field.required ? { "aria-required": true } : {}
161243
- } : {},
161244
- children
161245
- });
161246
- }
161247
161511
  /** Optional fields say so and required ones carry no mark, matching the question fields beside them. */
161248
161512
  function DynamicFieldLabel({ field }) {
161249
161513
  if (field.field.type === "booking_requirement_consent") return /* @__PURE__ */ jsx(BookingConsentAgreement, {
@@ -161253,7 +161517,7 @@ function DynamicFieldLabel({ field }) {
161253
161517
  requiredMark: "none"
161254
161518
  });
161255
161519
  const text = /* @__PURE__ */ jsxs(Fragment$1, { children: [field.label, field.required ? null : /* @__PURE__ */ jsx(OptionalMark$1, {})] });
161256
- return isChoiceGroupField(field.field) ? /* @__PURE__ */ jsx("legend", {
161520
+ return isFieldsetQuestion(field.field) ? /* @__PURE__ */ jsx("legend", {
161257
161521
  id: field.labelId,
161258
161522
  className: "form-label rb-p-0",
161259
161523
  children: text
@@ -161357,26 +161621,17 @@ function SelectInput({ control }) {
161357
161621
  });
161358
161622
  }
161359
161623
  function RadioInput({ control }) {
161360
- const { field, value, onChange, onBlur } = control.props;
161361
- return /* @__PURE__ */ jsx("div", {
161362
- className: "rb-space-y-2",
161363
- children: fieldOptions(control).map((option) => /* @__PURE__ */ jsxs("label", {
161364
- className: "form-check",
161365
- children: [/* @__PURE__ */ jsx("input", {
161366
- type: "radio",
161367
- name: field.id,
161368
- value: option.value,
161369
- checked: value === option.value,
161370
- onChange: (event) => onChange(event.target.value),
161371
- onBlur,
161372
- required: field.required,
161373
- ...control.validation,
161374
- className: "form-radio"
161375
- }), /* @__PURE__ */ jsx("span", {
161376
- className: "form-check-label",
161377
- children: option.label
161378
- })]
161379
- }, option.value))
161624
+ const { field, onChange, onBlur } = control.props;
161625
+ return /* @__PURE__ */ jsx(SiteChoiceOptions, {
161626
+ size: "row",
161627
+ name: field.id,
161628
+ options: fieldOptions(control),
161629
+ value: control.text,
161630
+ required: field.required,
161631
+ invalid: control.validation["aria-invalid"] === "true",
161632
+ describedBy: control.validation["aria-describedby"],
161633
+ onChange,
161634
+ onBlur
161380
161635
  });
161381
161636
  }
161382
161637
  function CheckboxGroupInput({ control }) {
@@ -161719,9 +161974,25 @@ function DefaultResourceChoices({ allowAnyResource, booking, resources, selected
161719
161974
  ]
161720
161975
  });
161721
161976
  }
161977
+ /** The listing's own price label; a tiered service carries no tiers here, so its session price stands in. */
161978
+ function selectedServicePrice(service) {
161979
+ return formatAppointmentPrice({
161980
+ pricing: service.pricing && service.pricing.pricingStrategy !== "tiered" ? {
161981
+ ...service.pricing,
161982
+ singlePriceAmount: service.pricing.singlePriceAmount ?? null,
161983
+ slidingMinAmount: service.pricing.slidingMinAmount ?? null,
161984
+ slidingMaxAmount: service.pricing.slidingMaxAmount ?? null,
161985
+ options: []
161986
+ } : void 0,
161987
+ priceAmount: service.priceAmount ?? null,
161988
+ priceCurrency: service.priceCurrency ?? null,
161989
+ onlinePaymentMode: service.onlinePaymentMode
161990
+ });
161991
+ }
161722
161992
  function BookingSelectedServiceSummary({ services }) {
161723
161993
  const service = services.items.length === 1 ? services.items[0] : void 0;
161724
161994
  if (!service) return null;
161995
+ const price = selectedServicePrice(service);
161725
161996
  return /* @__PURE__ */ jsxs("div", {
161726
161997
  className: "rb-reg-summary",
161727
161998
  children: [
@@ -161741,6 +162012,10 @@ function BookingSelectedServiceSummary({ services }) {
161741
162012
  service.durationMinutes,
161742
162013
  " minutes"
161743
162014
  ]
162015
+ }) : null,
162016
+ price ? /* @__PURE__ */ jsxs("p", {
162017
+ className: "ab-text rb-on-surface--muted",
162018
+ children: ["Price: ", price]
161744
162019
  }) : null
161745
162020
  ]
161746
162021
  });
@@ -162175,6 +162450,29 @@ function handlePortalAccessError(error) {
162175
162450
  };
162176
162451
  }
162177
162452
  //#endregion
162453
+ //#region ../blocks/src/system/runtime/shared/components/BookingNextStep.tsx
162454
+ function bookingNextStepHref(target) {
162455
+ return target.kind === "appointment" ? portalPath({
162456
+ page: "booking",
162457
+ ref: {
162458
+ tag: "appointment",
162459
+ appointmentId: target.appointmentId
162460
+ }
162461
+ }) : portalPath({ page: "bookings" });
162462
+ }
162463
+ function BookingNextStep({ target, className }) {
162464
+ return /* @__PURE__ */ jsx("div", {
162465
+ className: ["rb-mt-4", className ?? ""].join(" ").trim(),
162466
+ "data-booking-next-step": true,
162467
+ children: /* @__PURE__ */ jsx(ThemedButtonLink, {
162468
+ variant: "outline",
162469
+ size: "md",
162470
+ href: bookingNextStepHref(target),
162471
+ label: target.kind === "appointment" ? "View your booking" : "View your bookings"
162472
+ })
162473
+ });
162474
+ }
162475
+ //#endregion
162178
162476
  //#region ../blocks/src/system/runtime/components/booking/SuccessMessage.tsx
162179
162477
  const SuccessMessage = ({ copy, resourceName, appointment, dateContext, className, demoEmailSuppressed = false, customerEmail = null, person = clientPersonPhrases(null) }) => {
162180
162478
  return /* @__PURE__ */ jsx(TerminalPanel, {
@@ -162194,18 +162492,25 @@ const SuccessMessage = ({ copy, resourceName, appointment, dateContext, classNam
162194
162492
  },
162195
162493
  noteClassName: "ab-text"
162196
162494
  }),
162197
- secondaryBody: /* @__PURE__ */ jsx(AppointmentDetails, {
162495
+ secondaryBody: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(AppointmentDetails, {
162198
162496
  appointment,
162199
162497
  dateContext,
162200
162498
  resourceName,
162201
162499
  person
162202
- }),
162500
+ }), demoEmailSuppressed ? null : /* @__PURE__ */ jsx(BookingNextStep, { target: appointmentNextStep(appointment) })] }),
162203
162501
  className: ["ab-center", className ?? ""].join(" ").trim(),
162204
162502
  titleClassName: "ab-terminal-title",
162205
162503
  role: "alert",
162206
162504
  live: "polite"
162207
162505
  });
162208
162506
  };
162507
+ function appointmentNextStep(appointment) {
162508
+ const id = appointment ? parseAppointmentId(appointment.id) : null;
162509
+ return id?.ok ? {
162510
+ kind: "appointment",
162511
+ appointmentId: id.value
162512
+ } : { kind: "bookings" };
162513
+ }
162209
162514
  function AppointmentDetails({ appointment, dateContext, resourceName, person }) {
162210
162515
  if (!appointment) return resourceName ? /* @__PURE__ */ jsx("p", {
162211
162516
  className: "ab-text rb-on-surface--muted",
@@ -163020,13 +163325,6 @@ function resolveRegistrationRecoveryAction(step, action) {
163020
163325
  if (step === "verifying-payment" || step === "verifying-timeout" || step === "payment") return "none";
163021
163326
  return action;
163022
163327
  }
163023
- /**
163024
- * After the details check refuses the booker (an earlier unpaid booking of theirs stands, or it couldn't be
163025
- * found safely), Try again returns to their details so continuing runs the check again. Not 'retry', which
163026
- * goes straight to payment and is for a refused submission. Not 'places', which on a full event swaps the
163027
- * message for the waitlist offer.
163028
- */
163029
- const DETAILS_CHECK_REFUSAL_RECOVERY = "details";
163030
163328
  function shouldRefreshAfterRegistrationError(step, action, enabled) {
163031
163329
  return enabled || step === "error" && action === "places";
163032
163330
  }
@@ -164228,7 +164526,7 @@ function registrationErrorContent(failure, bookings) {
164228
164526
  heading: entry.heading ?? defaultEventRegistrationErrorAppearance.heading,
164229
164527
  tone: entry.tone ?? defaultEventRegistrationErrorAppearance.tone,
164230
164528
  message: eventRegistrationRefusalMessage(reason, failure.message, bookings),
164231
- action: entry.action
164529
+ action: eventRegistrationRefusalAction(reason, bookings)
164232
164530
  };
164233
164531
  }
164234
164532
  if (failure.isClientError) {
@@ -165245,6 +165543,7 @@ function ownedPassShortfall(facts) {
165245
165543
  default: return assertNever$3(facts.shortfall);
165246
165544
  }
165247
165545
  }
165546
+ const boughtPassEnds = (facts) => facts.endsOn === null ? "" : ` It ends on ${facts.endsOn}.`;
165248
165547
  function boughtPassShortfall(facts) {
165249
165548
  switch (facts.shortfall) {
165250
165549
  case "ends": return `It ends on ${facts.endsOn ?? ""}, so it covers ${datesCount(facts.covered)}. You pay for ${facts.moneyDays}.`;
@@ -165299,7 +165598,7 @@ const ENTITLEMENT_COPY = {
165299
165598
  coveredValue: credits(1),
165300
165599
  countsCredits: false,
165301
165600
  title: (facts) => facts.moneyDates === 0 ? `Buy ${indefiniteArticle(facts.name)} ${facts.name}` : `Buy ${indefiniteArticle(facts.name)} ${facts.name} and pay for the rest`,
165302
- detail: (facts) => facts.moneyDates === 0 ? `${credits(facts.creditsBefore ?? 0)}. ${facts.dateCount === 1 ? "This date uses" : "These dates use"} ${facts.covered}, leaving ${facts.creditsLeftAfter ?? 0}.` : boughtPassShortfall(facts),
165601
+ detail: (facts) => facts.moneyDates === 0 ? `${credits(facts.creditsBefore ?? 0)}. ${facts.dateCount === 1 ? "This date uses" : "These dates use"} ${facts.covered}, leaving ${facts.creditsLeftAfter ?? 0}.${boughtPassEnds(facts)}` : `${boughtPassShortfall(facts)}${facts.shortfall === "ends" ? "" : boughtPassEnds(facts)}`,
165303
165602
  price: (facts) => facts.toPay,
165304
165603
  button: (facts) => facts.moneyDates === 0 || facts.charge.cardCents === 0 ? "Buy pass and book" : `Buy pass and pay ${facts.toPay}`,
165305
165604
  boughtLine: (facts) => ({ note: facts.creditsBefore === 1 ? "Uses its 1 class" : `Uses ${facts.covered} of its ${facts.creditsBefore ?? facts.covered} classes, ${facts.creditsLeftAfter ?? 0} left for later` })
@@ -165314,12 +165613,20 @@ const ENTITLEMENT_COPY = {
165314
165613
  boughtLine: (facts) => ({ note: `${membershipRenewal(facts)} You can cancel from your account.` })
165315
165614
  }
165316
165615
  };
165616
+ /**
165617
+ * A pass's `expiresAt` is the midnight after its last day, so the day to name
165618
+ * is the one just before it: a 90-day pass bought on 16 Nov "ends on 14 Feb",
165619
+ * as its receipt says, not 15 Feb.
165620
+ */
165621
+ function passLastDay(expiresAt) {
165622
+ return expiresAt === null ? null : (/* @__PURE__ */ new Date(Date.parse(expiresAt) - 1)).toISOString();
165623
+ }
165317
165624
  function entitlementFacts(entitlement, currency) {
165318
165625
  switch (entitlement.kind) {
165319
165626
  case "ownedPass": return {
165320
165627
  creditsBefore: entitlement.credits.used + entitlement.credits.leftAfter,
165321
165628
  creditsLeftAfter: entitlement.credits.leftAfter,
165322
- ends: entitlement.expiresAt,
165629
+ ends: passLastDay(entitlement.expiresAt),
165323
165630
  boughtPrice: null,
165324
165631
  interval: null
165325
165632
  };
@@ -165333,7 +165640,7 @@ function entitlementFacts(entitlement, currency) {
165333
165640
  case "buyPass": return {
165334
165641
  creditsBefore: entitlement.credits.total,
165335
165642
  creditsLeftAfter: entitlement.credits.leftAfter,
165336
- ends: entitlement.expiresAt,
165643
+ ends: passLastDay(entitlement.expiresAt),
165337
165644
  boughtPrice: formatPrice(entitlement.priceCents, currency),
165338
165645
  interval: null
165339
165646
  };
@@ -165572,13 +165879,18 @@ function fundingDatesOf(selection, itemPrice) {
165572
165879
  priceCents: itemPrice(event)?.subtotalCents ?? null
165573
165880
  }] : []);
165574
165881
  }
165575
- /** "31 Jan", where the event is. */
165882
+ /**
165883
+ * "31 Jan", for the day a pass or membership ends. Those end at midnight where
165884
+ * the business is, not where one event happens to be, so an event abroad or
165885
+ * online doesn't move the last day.
165886
+ */
165576
165887
  function fundingDayFormatter(event) {
165888
+ const siteTimeZone = event?.siteTimeZone ?? null;
165577
165889
  return (iso) => formatBookingWhen({
165578
165890
  startsAt: iso,
165579
- timeZone: event?.timeZone ?? null,
165580
- siteTimeZone: event?.siteTimeZone ?? null,
165581
- deliveryMode: event?.deliveryMode ?? null
165891
+ timeZone: siteTimeZone,
165892
+ siteTimeZone,
165893
+ deliveryMode: "in_person"
165582
165894
  }, "dayMonth");
165583
165895
  }
165584
165896
  /**
@@ -165633,7 +165945,7 @@ async function checkGuestNextStep(input, request, setCheckingNextStep) {
165633
165945
  switch (plan.kind) {
165634
165946
  case "skip": return plan.outcome;
165635
165947
  case "blocked": return {
165636
- kind: "unavailable",
165948
+ kind: "checkFailed",
165637
165949
  message: plan.message
165638
165950
  };
165639
165951
  case "check": break;
@@ -165643,8 +165955,8 @@ async function checkGuestNextStep(input, request, setCheckingNextStep) {
165643
165955
  return await input.api.checkRegistrationNextStep(plan.request);
165644
165956
  } catch {
165645
165957
  return {
165646
- kind: "unavailable",
165647
- message: "We could not check availability. Please try again."
165958
+ kind: "checkFailed",
165959
+ message: "We couldn’t check availability just now. Please go back and try again."
165648
165960
  };
165649
165961
  } finally {
165650
165962
  setCheckingNextStep(false);
@@ -166827,7 +167139,7 @@ function useEventRegistrationWizardWithDeps(options, deps) {
166827
167139
  formData,
166828
167140
  requireGuestDetails,
166829
167141
  guests,
166830
- ...detailsRequirementsCheck(requirements.checkRuns(), questions, currentEvent)
167142
+ ...detailsRequirementsCheck(requirements.checkRuns(), questions, bookingRequirementsEvent)
166831
167143
  });
166832
167144
  if (check.kind === "blocked") return blockDetailsCompletion(check.blocker);
166833
167145
  setErrors(check.errors);
@@ -166863,7 +167175,7 @@ function useEventRegistrationWizardWithDeps(options, deps) {
166863
167175
  kind: "unavailable",
166864
167176
  reason: "closed",
166865
167177
  message: continuation.message
166866
- }, DETAILS_CHECK_REFUSAL_RECOVERY);
167178
+ }, continuation.action);
166867
167179
  case "payment-step":
166868
167180
  setStep("select-payment");
166869
167181
  return {
@@ -167089,12 +167401,13 @@ function useEventRegistrationWizardWithDeps(options, deps) {
167089
167401
  });
167090
167402
  const shouldShowDiscountToggle = registrationDiscountEntryVisible(discountView);
167091
167403
  const requirementsLayout = useMemo(() => decideSelectionRequirementsLayout(selection), [selection]);
167404
+ const { event: bookingRequirementsEvent, consent: bookingConsent } = registrationBookingRequirements(admission, onceAskedEvent(requirementsLayout, currentEvent));
167092
167405
  const questions = useEventRegistrationQuestions({
167093
167406
  api,
167094
167407
  siteId: api.config.siteId,
167095
167408
  flow: flowState,
167096
167409
  dispatch: dispatchFlow,
167097
- event: onceAskedEvent(requirementsLayout, currentEvent),
167410
+ event: bookingRequirementsEvent,
167098
167411
  offersKeptAnswers: requirementsLayout.kind !== "shared",
167099
167412
  identity: portalIdentity,
167100
167413
  eventSource: options.eventSource,
@@ -167441,6 +167754,7 @@ function useEventRegistrationWizardWithDeps(options, deps) {
167441
167754
  organiserContact: submissionError.organiserContact ?? organiserContact,
167442
167755
  questionFieldErrors: flowState.questionFieldErrors,
167443
167756
  bookingQuestions: questions,
167757
+ bookingConsent,
167444
167758
  /** How the selection's questions and agreement are asked: once, or once per run. */
167445
167759
  requirementsLayout,
167446
167760
  /** One section per run when several runs ask different questions or agreements. */
@@ -167555,7 +167869,7 @@ function resolveSelectionChoiceMessages(input) {
167555
167869
  }
167556
167870
  /** The event whose questions are asked once; none when runs are asked separately. */
167557
167871
  function onceAskedEvent(layout, currentEvent) {
167558
- return layout.kind === "per_run" ? null : currentEvent;
167872
+ return layout.kind === "per_run" ? null : layout.kind === "shared" ? layout.source : currentEvent;
167559
167873
  }
167560
167874
  /**
167561
167875
  * What the details step checks for questions and agreement: each run's own
@@ -169091,7 +169405,7 @@ const labels = {
169091
169405
  retry: "Try again",
169092
169406
  places: "Choose places",
169093
169407
  start: "Start again",
169094
- details: "Check my details",
169408
+ details: "Back to my details",
169095
169409
  "payment-options": "View payment options",
169096
169410
  portal: "View my bookings",
169097
169411
  event: "View event"
@@ -171151,7 +171465,8 @@ function QuestionsSection(props) {
171151
171465
  answerMode: bookingQuestions.answerMode,
171152
171466
  onAnswerModeChange: bookingQuestions.chooseAnswerMode,
171153
171467
  signInEmail: props.signInEmail.trim() || void 0,
171154
- signInReturnPath: bookingQuestions.signInReturnPath
171468
+ signInReturnPath: bookingQuestions.signInReturnPath,
171469
+ severalPeople: props.severalPeople
171155
171470
  });
171156
171471
  }
171157
171472
  /** One run's questions and agreement, headed with the run's name. */
@@ -171169,7 +171484,8 @@ function RunRequirementsBlock(props) {
171169
171484
  }),
171170
171485
  section.bookingQuestions ? /* @__PURE__ */ jsx(QuestionsSection, {
171171
171486
  bookingQuestions: section.bookingQuestions,
171172
- signInEmail: props.signInEmail
171487
+ signInEmail: props.signInEmail,
171488
+ severalPeople: props.severalPeople
171173
171489
  }) : null,
171174
171490
  section.consent ? /* @__PURE__ */ jsx(EventConsentField, {
171175
171491
  consent: section.consent,
@@ -171186,7 +171502,8 @@ function QuestionsAndAgreement(props) {
171186
171502
  return /* @__PURE__ */ jsxs(Fragment$1, { children: [
171187
171503
  bookingQuestions ? /* @__PURE__ */ jsx(QuestionsSection, {
171188
171504
  bookingQuestions,
171189
- signInEmail: formData.email
171505
+ signInEmail: formData.email,
171506
+ severalPeople: props.severalPeople
171190
171507
  }) : null,
171191
171508
  consent ? /* @__PURE__ */ jsx(EventConsentField, {
171192
171509
  consent,
@@ -171201,7 +171518,8 @@ function QuestionsAndAgreement(props) {
171201
171518
  props.runRequirements?.map((section) => /* @__PURE__ */ jsx(RunRequirementsBlock, {
171202
171519
  section,
171203
171520
  idBase: props.idBase,
171204
- signInEmail: formData.email
171521
+ signInEmail: formData.email,
171522
+ severalPeople: props.severalPeople
171205
171523
  }, section.seriesId)),
171206
171524
  props.siteTerms,
171207
171525
  props.questionsMessage ? /* @__PURE__ */ jsx("p", {
@@ -171315,7 +171633,8 @@ const AttendeeDetailsStep = ({ formData, onChange, errors, emailLocked = false,
171315
171633
  bookingQuestions,
171316
171634
  runRequirements,
171317
171635
  questionsMessage,
171318
- siteTerms
171636
+ siteTerms,
171637
+ severalPeople: ticketsCount > 1
171319
171638
  })
171320
171639
  ] }),
171321
171640
  guestDetailsChangeHandler && /* @__PURE__ */ jsx(GuestDetailsSection, {
@@ -171455,7 +171774,7 @@ function UnavailableEntitlementNotes({ eligibility }) {
171455
171774
  //#region ../blocks/src/system/runtime/nodes/event-registration/CalendarAction.tsx
171456
171775
  /** Download effects happen only after a click, including in editor preview. */
171457
171776
  async function downloadCalendar(calendar) {
171458
- const { renderCalendarFeedIcs } = await import("./src-EO5QoRlU.mjs");
171777
+ const { renderCalendarFeedIcs } = await import("./src-CrT7h--V.mjs");
171459
171778
  const url = URL.createObjectURL(new Blob([renderCalendarFeedIcs(calendar.feed)], { type: "text/calendar;charset=utf-8" }));
171460
171779
  const link = document.createElement("a");
171461
171780
  link.href = url;
@@ -171576,6 +171895,48 @@ function SeveralBookingsNote({ several }) {
171576
171895
  children: SEVERAL_BOOKINGS_ACCOUNT_NOTE
171577
171896
  }) : null;
171578
171897
  }
171898
+ /** Where to see the booking again; a waiting-list place isn't a booking yet, and a demo has its own portal button. */
171899
+ function SuccessNextStep({ context, variant, demo }) {
171900
+ return context === "booking" && variant === "success" && !demo ? /* @__PURE__ */ jsx(BookingNextStep, {
171901
+ target: { kind: "bookings" },
171902
+ className: "er-center"
171903
+ }) : null;
171904
+ }
171905
+ function SuccessIcon({ variant }) {
171906
+ return /* @__PURE__ */ jsx(StateIcon, {
171907
+ variant,
171908
+ children: /* @__PURE__ */ jsx("svg", {
171909
+ fill: "none",
171910
+ stroke: "currentColor",
171911
+ viewBox: "0 0 24 24",
171912
+ children: variant === "info" ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
171913
+ /* @__PURE__ */ jsx("path", {
171914
+ strokeLinecap: "round",
171915
+ strokeLinejoin: "round",
171916
+ strokeWidth: 2,
171917
+ d: "M12 8h.01"
171918
+ }),
171919
+ /* @__PURE__ */ jsx("path", {
171920
+ strokeLinecap: "round",
171921
+ strokeLinejoin: "round",
171922
+ strokeWidth: 2,
171923
+ d: "M11 12h1v4h1"
171924
+ }),
171925
+ /* @__PURE__ */ jsx("path", {
171926
+ strokeLinecap: "round",
171927
+ strokeLinejoin: "round",
171928
+ strokeWidth: 2,
171929
+ d: "M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10z"
171930
+ })
171931
+ ] }) : /* @__PURE__ */ jsx("path", {
171932
+ strokeLinecap: "round",
171933
+ strokeLinejoin: "round",
171934
+ strokeWidth: 2,
171935
+ d: "M5 13l4 4L19 7"
171936
+ })
171937
+ })
171938
+ });
171939
+ }
171579
171940
  function defaultHeading(variant, several) {
171580
171941
  if (variant === "info") return "You’re already booked";
171581
171942
  return several ? "You’re booked" : "You’re booked!";
@@ -171589,44 +171950,12 @@ const SuccessStep = ({ title, copy, variant = "success", mailingListSignupNote,
171589
171950
  const heading = title ?? defaultHeading(variant, several);
171590
171951
  return /* @__PURE__ */ jsxs(Fragment$1, { children: [
171591
171952
  /* @__PURE__ */ jsx(TerminalPanel, {
171592
- tone: variant === "info" ? "info" : "success",
171953
+ tone: variant,
171593
171954
  className: "er-center",
171594
171955
  iconClassName: "er-icon",
171595
171956
  titleClassName: "er-title--lg er-message",
171596
171957
  bodyClassName: "er-text--muted",
171597
- icon: /* @__PURE__ */ jsx(StateIcon, {
171598
- variant: variant === "info" ? "info" : "success",
171599
- children: /* @__PURE__ */ jsx("svg", {
171600
- fill: "none",
171601
- stroke: "currentColor",
171602
- viewBox: "0 0 24 24",
171603
- children: variant === "info" ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
171604
- /* @__PURE__ */ jsx("path", {
171605
- strokeLinecap: "round",
171606
- strokeLinejoin: "round",
171607
- strokeWidth: 2,
171608
- d: "M12 8h.01"
171609
- }),
171610
- /* @__PURE__ */ jsx("path", {
171611
- strokeLinecap: "round",
171612
- strokeLinejoin: "round",
171613
- strokeWidth: 2,
171614
- d: "M11 12h1v4h1"
171615
- }),
171616
- /* @__PURE__ */ jsx("path", {
171617
- strokeLinecap: "round",
171618
- strokeLinejoin: "round",
171619
- strokeWidth: 2,
171620
- d: "M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10z"
171621
- })
171622
- ] }) : /* @__PURE__ */ jsx("path", {
171623
- strokeLinecap: "round",
171624
- strokeLinejoin: "round",
171625
- strokeWidth: 2,
171626
- d: "M5 13l4 4L19 7"
171627
- })
171628
- })
171629
- }),
171958
+ icon: /* @__PURE__ */ jsx(SuccessIcon, { variant }),
171630
171959
  title: heading,
171631
171960
  body: /* @__PURE__ */ jsx(BookingConfirmation, {
171632
171961
  demoEmailSuppressed,
@@ -171645,7 +171974,12 @@ const SuccessStep = ({ title, copy, variant = "success", mailingListSignupNote,
171645
171974
  payment
171646
171975
  }),
171647
171976
  /* @__PURE__ */ jsx(SeveralBookingsNote, { several }),
171648
- /* @__PURE__ */ jsx(CalendarAction, { calendar })
171977
+ /* @__PURE__ */ jsx(CalendarAction, { calendar }),
171978
+ /* @__PURE__ */ jsx(SuccessNextStep, {
171979
+ context,
171980
+ variant,
171981
+ demo: demoEmailSuppressed
171982
+ })
171649
171983
  ] });
171650
171984
  };
171651
171985
  //#endregion
@@ -171809,7 +172143,7 @@ function heroMembership(wizard) {
171809
172143
  }
171810
172144
  /** The event's consent, with its checkbox worded for every item being booked. */
171811
172145
  function selectionConsent(wizard) {
171812
- const consent = (wizard.selectedEvent ?? wizard.preSelectedEvent)?.consent ?? null;
172146
+ const consent = wizard.bookingConsent;
171813
172147
  if (!consent) return null;
171814
172148
  return {
171815
172149
  ...consent,
@@ -172998,9 +173332,10 @@ const EventRegistrationClient = (clientProps) => {
172998
173332
  subject: clientProps.subject
172999
173333
  })
173000
173334
  });
173001
- if (hasCancelledRegistrationDate(clientProps.events ?? [], clientProps.occurrenceContext?.id)) return /* @__PURE__ */ jsx(RegistrationClosedState, {
173002
- title: cancelledDateCopy.titleText,
173003
- body: cancelledDateCopy.bodyText
173335
+ const cancelled = cancelledRegistrationCopy(clientProps.events ?? [], clientProps.occurrenceContext?.id);
173336
+ if (cancelled) return /* @__PURE__ */ jsx(RegistrationClosedState, {
173337
+ title: cancelled.titleText,
173338
+ body: cancelled.bodyText
173004
173339
  });
173005
173340
  switch (surface) {
173006
173341
  case "wizard": return /* @__PURE__ */ jsx(EventRegistrationWizard, { ...clientProps });
@@ -174080,6 +174415,38 @@ function checkoutSubmitLabel(checkout, status) {
174080
174415
  if (totalAfterDiscountCents !== 0) return `Pay ${formatCommercePrice(totalAfterDiscountCents, currency)}`;
174081
174416
  return checkout.item.productType === "membership" ? "Continue to payment" : "Complete purchase";
174082
174417
  }
174418
+ /** Manual application owns the displayed price; otherwise the automatic quote does. */
174419
+ function checkoutDiscountPresentation(status, automatic) {
174420
+ if (status.type === "applied" || !automatic) return {
174421
+ status,
174422
+ automatic: false
174423
+ };
174424
+ return {
174425
+ status: {
174426
+ type: "applied",
174427
+ discount: automatic
174428
+ },
174429
+ automatic: true
174430
+ };
174431
+ }
174432
+ function ShopAutomaticDiscountNotice(props) {
174433
+ if (props.presentation.automatic) return /* @__PURE__ */ jsxs(FeedbackMessage, {
174434
+ tone: "success",
174435
+ className: "shop__modal-discount",
174436
+ role: "status",
174437
+ children: [
174438
+ getDiscountApplyFeedback(props.presentation.status, formatCommercePrice)?.message,
174439
+ " ",
174440
+ checkoutDiscountHint(props.checkout, props.presentation.status)
174441
+ ]
174442
+ });
174443
+ return !props.loading && props.discountsAvailable && !props.manualCodeEntryAllowed ? /* @__PURE__ */ jsx(FeedbackMessage, {
174444
+ tone: "info",
174445
+ className: "shop__modal-discount",
174446
+ role: "status",
174447
+ children: "Eligible discounts will be applied at checkout."
174448
+ }) : null;
174449
+ }
174083
174450
  function getCheckoutModalTitle(checkout) {
174084
174451
  if (!checkout) return "";
174085
174452
  if (checkout.item.productType === "membership") return "Subscribe to Membership";
@@ -174140,6 +174507,8 @@ function PassesMembershipsController({ render }) {
174140
174507
  api,
174141
174508
  ...directShopAutomaticDiscountInput(checkout)
174142
174509
  });
174510
+ const discountPresentation = checkoutDiscountPresentation(discountApply.status, automaticPreview.discount);
174511
+ const shownDiscountStatus = discountPresentation.status;
174143
174512
  const discountApplyFeedback = getDiscountApplyFeedback(discountApply.status, formatCommercePrice);
174144
174513
  const handleBuyPass = useCallback((pass, teamMember) => {
174145
174514
  dispatch({
@@ -174328,7 +174697,7 @@ function PassesMembershipsController({ render }) {
174328
174697
  children: [
174329
174698
  /* @__PURE__ */ jsxs("p", {
174330
174699
  className: "shop__modal-product",
174331
- children: [checkoutProductLabel(checkout, checkoutShownTotalCents(checkout, discountApply.status)), checkout.item.productType === "membership" ? /* @__PURE__ */ jsx("span", {
174700
+ children: [checkoutProductLabel(checkout, checkoutShownTotalCents(checkout, shownDiscountStatus)), checkout.item.productType === "membership" ? /* @__PURE__ */ jsx("span", {
174332
174701
  className: "shop__modal-interval",
174333
174702
  children: formatInterval(checkout.item.product.billingInterval)
174334
174703
  }) : null]
@@ -174446,12 +174815,13 @@ function PassesMembershipsController({ render }) {
174446
174815
  isApplying: isDiscountApplyInFlight(discountApply),
174447
174816
  disabled: checkout.submitting
174448
174817
  }) : null,
174449
- !discountUi.discountsAvailableLoading && discountUi.discountsAvailable && !discountUi.manualCodeEntryAllowed ? /* @__PURE__ */ jsx(FeedbackMessage, {
174450
- tone: "info",
174451
- className: "shop__modal-discount",
174452
- role: "status",
174453
- children: "Eligible discounts will be applied at checkout."
174454
- }) : null,
174818
+ /* @__PURE__ */ jsx(ShopAutomaticDiscountNotice, {
174819
+ checkout,
174820
+ presentation: discountPresentation,
174821
+ discountsAvailable: discountUi.discountsAvailable,
174822
+ loading: discountUi.discountsAvailableLoading,
174823
+ manualCodeEntryAllowed: discountUi.manualCodeEntryAllowed
174824
+ }),
174455
174825
  checkout.formError ? /* @__PURE__ */ jsx(FeedbackMessage, {
174456
174826
  tone: "error",
174457
174827
  className: "shop__modal-error",
@@ -174477,7 +174847,7 @@ function PassesMembershipsController({ render }) {
174477
174847
  type: "submit",
174478
174848
  variant: "default",
174479
174849
  size: "md",
174480
- label: checkoutSubmitLabel(checkout, discountApply.status),
174850
+ label: checkoutSubmitLabel(checkout, shownDiscountStatus),
174481
174851
  disabled: checkoutPayBlocked(checkout, discountApply)
174482
174852
  })]
174483
174853
  })
@@ -175114,6 +175484,42 @@ function CheckoutClient(props) {
175114
175484
  }
175115
175485
  //#endregion
175116
175486
  //#region ../blocks/src/system/runtime/nodes/gifting.client.state.ts
175487
+ /** Whether a stored value is a receipt this module wrote. */
175488
+ function isGiftingReceipt(value) {
175489
+ if (typeof value !== "object" || value === null) return false;
175490
+ const record = value;
175491
+ return typeof record.amountCents === "number" && typeof record.currency === "string" && typeof record.offerTitle === "string" && typeof record.recipient === "string";
175492
+ }
175493
+ /** "£20.00 Gift card for Sam Taylor": the amount, the offer's own name, and who it's for. */
175494
+ function giftingReceiptLine(receipt) {
175495
+ return `${formatCurrencyAmount(receipt.amountCents, receipt.currency, { decimals: "auto" })} ${receipt.offerTitle} for ${receipt.recipient}`;
175496
+ }
175497
+ /** The offer's own name, and the price a voucher fixes (a gift card's comes from the form). */
175498
+ function giftingOfferBought(offers, offerId) {
175499
+ const voucher = offers.vouchers.find((offer) => offer.id === offerId);
175500
+ if (voucher) return {
175501
+ title: voucher.title.trim(),
175502
+ fixedCents: voucher.voucher.purchaseAmountCents
175503
+ };
175504
+ return {
175505
+ title: offers.giftCards.find((offer) => offer.id === offerId)?.title.trim(),
175506
+ fixedCents: null
175507
+ };
175508
+ }
175509
+ /** The receipt for an offer about to be paid for, or null when the form doesn't say enough. */
175510
+ function giftingReceiptFor(input) {
175511
+ const { offers, checkout } = input;
175512
+ if (!offers) return null;
175513
+ const { title: offerTitle, fixedCents } = giftingOfferBought(offers, checkout.offerId);
175514
+ const amountCents = fixedCents ?? checkout.amountCents;
175515
+ const recipient = checkout.recipientName?.trim() || checkout.recipientEmail.trim();
175516
+ return offerTitle && recipient && amountCents && amountCents > 0 ? {
175517
+ amountCents,
175518
+ currency: offers.currency,
175519
+ offerTitle,
175520
+ recipient
175521
+ } : null;
175522
+ }
175117
175523
  function createInitialGiftingClientState(initialOffers) {
175118
175524
  return {
175119
175525
  offers: initialOffers,
@@ -175156,15 +175562,20 @@ function giftingClientReducer(state, action) {
175156
175562
  default: return assertNever$3(action);
175157
175563
  }
175158
175564
  }
175159
- function resolveGiftingPurchaseNotice(search, defaultSuccessMessage, today = /* @__PURE__ */ new Date()) {
175565
+ function resolveGiftingPurchaseNotice(search, defaultSuccessMessage, today = /* @__PURE__ */ new Date(), receipt = null) {
175160
175566
  const params = new URLSearchParams(search);
175161
175567
  switch (params.get("gifting")) {
175162
175568
  case null: return null;
175163
175569
  case "success": {
175164
175570
  const day = formatSendOnDay(params.get("gift_send_on"), today);
175165
- return {
175571
+ const message = day ? `Thanks, that's all paid for. We'll email the gift to them on ${day}.` : defaultSuccessMessage;
175572
+ return receipt ? {
175573
+ kind: "success",
175574
+ message,
175575
+ receipt: giftingReceiptLine(receipt)
175576
+ } : {
175166
175577
  kind: "success",
175167
- message: day ? `Thanks, that's all paid for. We'll email the gift to them on ${day}.` : defaultSuccessMessage
175578
+ message
175168
175579
  };
175169
175580
  }
175170
175581
  case "cancelled": return {
@@ -175183,13 +175594,26 @@ function toGiftingControllerProps(props) {
175183
175594
  successMessage: props.render.hydration.successMessage
175184
175595
  };
175185
175596
  }
175186
- function buildGiftingCheckoutReturnUrl(currentHref, kind, sendOnDate = null) {
175597
+ const RECEIPT_PARAM = "gift_receipt";
175598
+ /**
175599
+ * Where checkout comes back to. A successful return names its own receipt, so
175600
+ * the thank-you repeats what this checkout bought and not one started later
175601
+ * in the same tab.
175602
+ */
175603
+ function buildGiftingCheckoutReturnUrl(currentHref, kind, options = {}) {
175187
175604
  const url = new URL(currentHref);
175188
175605
  url.searchParams.set("gifting", kind);
175189
- if (kind === "success" && sendOnDate) url.searchParams.set("gift_send_on", sendOnDate);
175606
+ if (kind === "success" && options.sendOnDate) url.searchParams.set("gift_send_on", options.sendOnDate);
175190
175607
  else url.searchParams.delete("gift_send_on");
175608
+ if (kind === "success" && options.receiptId) url.searchParams.set(RECEIPT_PARAM, options.receiptId);
175609
+ else url.searchParams.delete(RECEIPT_PARAM);
175191
175610
  return url.toString();
175192
175611
  }
175612
+ /** The receipt a successful return names, if any. */
175613
+ function giftingReturnReceiptId(search) {
175614
+ const params = new URLSearchParams(search);
175615
+ return params.get("gifting") === "success" ? params.get(RECEIPT_PARAM) || null : null;
175616
+ }
175193
175617
  function hasPublicGiftingOffers(offers) {
175194
175618
  return Boolean((offers?.giftCards.length ?? 0) > 0 || (offers?.vouchers.length ?? 0) > 0);
175195
175619
  }
@@ -175238,10 +175662,36 @@ function giftingReturnUrlWithoutNotice(currentHref) {
175238
175662
  const url = new URL(currentHref);
175239
175663
  url.searchParams.delete("gifting");
175240
175664
  url.searchParams.delete("gift_send_on");
175665
+ url.searchParams.delete(RECEIPT_PARAM);
175241
175666
  return url.toString();
175242
175667
  }
175243
175668
  //#endregion
175669
+ //#region ../blocks/src/system/runtime/nodes/gifting.receipt-storage.ts
175670
+ /** Each checkout keeps its own receipt, so returning from one never shows another's. */
175671
+ const receiptKey = (receiptId) => `rb-gifting-receipt:${receiptId}`;
175672
+ function rememberGiftingReceipt(receiptId, receipt) {
175673
+ try {
175674
+ window.sessionStorage.setItem(receiptKey(receiptId), JSON.stringify(receipt));
175675
+ } catch {}
175676
+ }
175677
+ /** Read once: a reload after the thank-you shouldn't repeat it. */
175678
+ function takeGiftingReceipt(receiptId) {
175679
+ try {
175680
+ const stored = window.sessionStorage.getItem(receiptKey(receiptId));
175681
+ window.sessionStorage.removeItem(receiptKey(receiptId));
175682
+ const parsed = stored ? JSON.parse(stored) : null;
175683
+ return isGiftingReceipt(parsed) ? parsed : null;
175684
+ } catch {
175685
+ return null;
175686
+ }
175687
+ }
175688
+ //#endregion
175244
175689
  //#region ../blocks/src/system/runtime/nodes/gifting.client.tsx
175690
+ /** The receipt this return names, and only that one. */
175691
+ function receiptFromReturn(search) {
175692
+ const receiptId = giftingReturnReceiptId(search);
175693
+ return receiptId ? takeGiftingReceipt(receiptId) : null;
175694
+ }
175245
175695
  function GiftingClient(props) {
175246
175696
  const api = useBlockApi();
175247
175697
  const noticeRef = useRef(null);
@@ -175252,7 +175702,7 @@ function GiftingClient(props) {
175252
175702
  const controller = toGiftingControllerProps(props);
175253
175703
  const [state, dispatch] = useReducer(giftingClientReducer, props.render.hydration.offers, createInitialGiftingClientState);
175254
175704
  useEffect(() => {
175255
- const notice = resolveGiftingPurchaseNotice(window.location.search, props.render.hydration.successMessage);
175705
+ const notice = resolveGiftingPurchaseNotice(window.location.search, props.render.hydration.successMessage, /* @__PURE__ */ new Date(), receiptFromReturn(window.location.search));
175256
175706
  dispatch({
175257
175707
  type: "purchaseNoticeResolved",
175258
175708
  notice
@@ -175304,14 +175754,24 @@ function GiftingClient(props) {
175304
175754
  offerId,
175305
175755
  submission
175306
175756
  });
175757
+ const receiptId = crypto.randomUUID();
175307
175758
  try {
175308
- const checkout = await siteTerms.api.createGiftingCheckout(buildGiftingCheckoutInput(formData, {
175759
+ const checkoutInput = buildGiftingCheckoutInput(formData, {
175309
175760
  offerId,
175310
175761
  purchaseToken: submission.token,
175311
175762
  kind,
175312
- successUrl: buildGiftingCheckoutReturnUrl(window.location.href, "success", typeof sendOnDate === "string" ? sendOnDate : null),
175763
+ successUrl: buildGiftingCheckoutReturnUrl(window.location.href, "success", {
175764
+ sendOnDate: typeof sendOnDate === "string" ? sendOnDate : null,
175765
+ receiptId
175766
+ }),
175313
175767
  cancelUrl: buildGiftingCheckoutReturnUrl(window.location.href, "cancelled")
175314
- }));
175768
+ });
175769
+ const checkout = await siteTerms.api.createGiftingCheckout(checkoutInput);
175770
+ const receipt = giftingReceiptFor({
175771
+ offers: state.offers,
175772
+ checkout: checkoutInput
175773
+ });
175774
+ if (receipt) rememberGiftingReceipt(receiptId, receipt);
175315
175775
  window.location.assign(checkout.checkoutUrl);
175316
175776
  } catch (error) {
175317
175777
  dispatch({
@@ -175340,65 +175800,77 @@ function GiftingClient(props) {
175340
175800
  children: /* @__PURE__ */ jsxs("div", {
175341
175801
  className: "gifting",
175342
175802
  ...look.lookSlots ? { "data-slot": "layout" } : {},
175343
- children: [/* @__PURE__ */ jsx(GiftingPanelHead, {
175344
- heading: look.heading,
175345
- intro: look.intro,
175346
- look
175347
- }), /* @__PURE__ */ jsxs("div", {
175348
- className: "gifting-main",
175349
- children: [
175350
- state.purchaseNotice ? /* @__PURE__ */ jsx("div", {
175351
- ref: noticeRef,
175352
- tabIndex: -1,
175353
- className: "gifting-notice",
175354
- children: /* @__PURE__ */ jsx(FeedbackMessage, {
175355
- tone: state.purchaseNotice.kind === "success" ? "success" : "warning",
175803
+ children: [
175804
+ /* @__PURE__ */ jsx(GiftingPanelHead, {
175805
+ heading: look.heading,
175806
+ intro: look.intro,
175807
+ look
175808
+ }),
175809
+ /* @__PURE__ */ jsx(GiftingExpiry, { days: offers?.expiryDays }),
175810
+ /* @__PURE__ */ jsxs("div", {
175811
+ className: "gifting-main",
175812
+ children: [
175813
+ /* @__PURE__ */ jsx(GiftingPurchaseNoticeView, {
175814
+ notice: state.purchaseNotice,
175815
+ noticeRef
175816
+ }),
175817
+ state.errorMessage ? /* @__PURE__ */ jsx(FeedbackMessage, {
175818
+ tone: "error",
175356
175819
  className: "gifting-feedback",
175357
- role: "status",
175358
- children: state.purchaseNotice.message
175359
- })
175360
- }) : null,
175361
- state.errorMessage ? /* @__PURE__ */ jsx(FeedbackMessage, {
175362
- tone: "error",
175363
- className: "gifting-feedback",
175364
- role: "alert",
175365
- children: state.errorMessage
175366
- }) : null,
175367
- /* @__PURE__ */ jsx(SiteTermsChangedNotice, { message: siteTerms.notice }),
175368
- hasOffers ? /* @__PURE__ */ jsx("div", {
175369
- className: "gifting-groups",
175370
- "data-group-count": look.groups.length,
175371
- children: look.groups.map((group) => /* @__PURE__ */ jsx(GiftGroup, {
175372
- group,
175373
- look,
175374
- children: group.kind === "gift_card" ? giftCards.map((offer) => /* @__PURE__ */ jsx(GiftCardOfferForm, {
175375
- offer,
175376
- currency,
175377
- showTitle: giftCards.length > 1,
175378
- initialAmount: props.chosenAmounts?.[offer.id],
175820
+ role: "alert",
175821
+ children: state.errorMessage
175822
+ }) : null,
175823
+ /* @__PURE__ */ jsx(SiteTermsChangedNotice, { message: siteTerms.notice }),
175824
+ hasOffers ? /* @__PURE__ */ jsx("div", {
175825
+ className: "gifting-groups",
175826
+ "data-group-count": look.groups.length,
175827
+ children: look.groups.map((group) => /* @__PURE__ */ jsx(GiftGroup, {
175828
+ group,
175379
175829
  look,
175380
- onSubmit: (event) => void handleSubmit(event, offer.id, "gift_card"),
175381
- fields: purchaseFields(offer.id)
175382
- }, offer.id)) : /* @__PURE__ */ jsx("ul", {
175383
- className: "gifting-voucher-list",
175384
- children: vouchers.map((offer) => /* @__PURE__ */ jsx("li", {
175385
- className: "gifting-voucher",
175386
- children: /* @__PURE__ */ jsx(VoucherOfferForm, {
175387
- offer,
175388
- currency,
175389
- look,
175390
- onSubmit: (event) => void handleSubmit(event, offer.id, "voucher"),
175391
- fields: purchaseFields(offer.id)
175392
- })
175393
- }, offer.id))
175394
- })
175395
- }, group.kind))
175396
- }) : /* @__PURE__ */ jsx("p", {
175397
- className: "gifting-empty",
175398
- children: GIFTING_NOTHING_TO_SHOW
175399
- })
175400
- ]
175401
- })]
175830
+ children: group.kind === "gift_card" ? giftCards.map((offer) => /* @__PURE__ */ jsx(GiftCardOfferForm, {
175831
+ offer,
175832
+ currency,
175833
+ showTitle: giftCards.length > 1,
175834
+ initialAmount: props.chosenAmounts?.[offer.id],
175835
+ look,
175836
+ onSubmit: (event) => void handleSubmit(event, offer.id, "gift_card"),
175837
+ fields: purchaseFields(offer.id)
175838
+ }, offer.id)) : /* @__PURE__ */ jsx("ul", {
175839
+ className: "gifting-voucher-list",
175840
+ children: vouchers.map((offer) => /* @__PURE__ */ jsx("li", {
175841
+ className: "gifting-voucher",
175842
+ children: /* @__PURE__ */ jsx(VoucherOfferForm, {
175843
+ offer,
175844
+ currency,
175845
+ look,
175846
+ onSubmit: (event) => void handleSubmit(event, offer.id, "voucher"),
175847
+ fields: purchaseFields(offer.id)
175848
+ })
175849
+ }, offer.id))
175850
+ })
175851
+ }, group.kind))
175852
+ }) : /* @__PURE__ */ jsx("p", {
175853
+ className: "gifting-empty",
175854
+ children: GIFTING_NOTHING_TO_SHOW
175855
+ })
175856
+ ]
175857
+ })
175858
+ ]
175859
+ })
175860
+ });
175861
+ }
175862
+ /** How the return from checkout went, with what was bought when this tab remembers it. */
175863
+ function GiftingPurchaseNoticeView({ notice, noticeRef }) {
175864
+ if (!notice) return null;
175865
+ return /* @__PURE__ */ jsx("div", {
175866
+ ref: noticeRef,
175867
+ tabIndex: -1,
175868
+ className: "gifting-notice",
175869
+ children: /* @__PURE__ */ jsxs(FeedbackMessage, {
175870
+ tone: notice.kind === "success" ? "success" : "warning",
175871
+ className: "gifting-feedback",
175872
+ role: "status",
175873
+ children: [notice.receipt ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("strong", { children: notice.receipt }), /* @__PURE__ */ jsx("br", {})] }) : null, notice.message]
175402
175874
  })
175403
175875
  });
175404
175876
  }