@riverbankcms/sdk 0.172.0 → 0.174.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 (215) hide show
  1. package/README.md +6 -1
  2. package/dist/_dts/{BlocksIslandsHydrator-DtrzTJ77.d.ts → BlocksIslandsHydrator-GqVX3I8E.d.ts} +1 -1
  3. package/dist/_dts/{Page-DViYbakk.d.ts → Page-BhUH31M-.d.ts} +27 -16
  4. package/dist/_dts/{SdkPreviewMode-D-5OeDbT.d.ts → SdkPreviewMode-DBn2x0UL.d.ts} +14 -7
  5. package/dist/_dts/{client-DZBOzd3U.d.ts → client-Cr-sOeSl.d.ts} +1002 -139
  6. package/dist/_dts/{content-types-DS3DrYn_.d.ts → content-types-DKw1yJdN.d.ts} +2 -2
  7. package/dist/_dts/{contracts-C3QGPCUf.d.ts → contracts-CJ2O03nB.d.ts} +6 -4
  8. package/dist/_dts/{footerPageOutline-D9Q7VIul.d.ts → footerPageOutline-DoGHHKr_.d.ts} +6 -6
  9. package/dist/_dts/{generatePageMetadata-R7NeFT1u.d.ts → generatePageMetadata-CJGu4hoa.d.ts} +2 -2
  10. package/dist/_dts/{index-Dns7OHyl.d.ts → index--39uLjrr.d.ts} +1 -1
  11. package/dist/_dts/{index-Da4UMgbs.d.ts → index-3GzargmS.d.ts} +2 -2
  12. package/dist/_dts/{index-DkFV_1Bc.d.ts → index-Bq-488M7.d.ts} +1 -1
  13. package/dist/_dts/{index-BnMavhoh.d.ts → index-DQZ5L0Gb.d.ts} +2 -2
  14. package/dist/_dts/{index-C0zjLMAW.d.ts → index-DYlfdT1O.d.ts} +2 -1
  15. package/dist/_dts/{index-CpOkfBt1.d.ts → index-DYsP4k6S.d.ts} +3 -3
  16. package/dist/_dts/{index-MuMYjetm.d.ts → index-DdEi2iXd.d.ts} +4 -4
  17. package/dist/_dts/{loadContent-DJmXHzfi.d.ts → loadContent-BVPagYmy.d.ts} +11 -11
  18. package/dist/_dts/{request-wQ28JWbr.d.ts → request-Be1E-H-V.d.ts} +4892 -1720
  19. package/dist/_dts/{resolveBlockData-C-IP53u9.d.ts → resolveBlockData-D1pL25bD.d.ts} +5 -5
  20. package/dist/_dts/{resolvePageContent-Cc4zqaEC.d.ts → resolvePageContent-B4sbTf96.d.ts} +2 -2
  21. package/dist/_dts/sdk/src/bookings/index.d.ts +2 -2
  22. package/dist/_dts/sdk/src/client/types.d.ts +2 -2
  23. package/dist/_dts/sdk/src/client.d.ts +9 -9
  24. package/dist/_dts/sdk/src/config/index.d.ts +6 -6
  25. package/dist/_dts/sdk/src/config/template-validation.d.ts +1 -1
  26. package/dist/_dts/sdk/src/config/validation.d.ts +1 -1
  27. package/dist/_dts/sdk/src/data/dataLoaderContext.d.ts +2 -2
  28. package/dist/_dts/sdk/src/data/resolveBlockData.d.ts +1 -1
  29. package/dist/_dts/sdk/src/data/types.d.ts +2 -2
  30. package/dist/_dts/sdk/src/index.d.ts +8 -8
  31. package/dist/_dts/sdk/src/manifest/index.d.ts +3 -3
  32. package/dist/_dts/sdk/src/metadata/index.d.ts +1 -1
  33. package/dist/_dts/sdk/src/navigation/index.d.ts +6 -2
  34. package/dist/_dts/sdk/src/next/index.d.ts +7 -7
  35. package/dist/_dts/sdk/src/next/middleware.d.ts +2 -2
  36. package/dist/_dts/sdk/src/page-converter/index.d.ts +3 -3
  37. package/dist/_dts/sdk/src/portal/client.d.ts +4 -2
  38. package/dist/_dts/sdk/src/prebuild/index.d.ts +1 -1
  39. package/dist/_dts/sdk/src/preview-next/before-render.d.ts +2 -2
  40. package/dist/_dts/sdk/src/preview-next/client/index.d.ts +2 -2
  41. package/dist/_dts/sdk/src/preview-next/client/runtime.d.ts +1 -1
  42. package/dist/_dts/sdk/src/rendering/client.d.ts +2 -2
  43. package/dist/_dts/sdk/src/rendering/components/pageShared.d.ts +1 -1
  44. package/dist/_dts/sdk/src/rendering/helpers/loadPage.d.ts +1 -1
  45. package/dist/_dts/sdk/src/rendering/helpers/pageRuntimeSupport.d.ts +13 -8
  46. package/dist/_dts/sdk/src/rendering/index.d.ts +6 -6
  47. package/dist/_dts/sdk/src/rendering/islands/client.d.ts +1 -1
  48. package/dist/_dts/sdk/src/rendering/server.d.ts +2 -2
  49. package/dist/_dts/sdk/src/rendering/themeAdmission.d.ts +1 -1
  50. package/dist/_dts/sdk/src/routing/index.d.ts +5 -5
  51. package/dist/_dts/sdk/src/server.d.ts +5 -5
  52. package/dist/_dts/sdk/src/spam-protection/index.d.ts +2 -2
  53. package/dist/_dts/sdk/src/theme/index.d.ts +36 -204
  54. package/dist/_dts/{types-CpjyP5I4.d.ts → types-5MeDI1w8.d.ts} +7 -7
  55. package/dist/_dts/{types-DrinAfeW.d.ts → types-Bm5_3VEd.d.ts} +3 -3
  56. package/dist/_dts/{types-ZuZoGsZV.d.ts → types-CVoCc_Ia.d.ts} +2 -2
  57. package/dist/_dts/{validation-CIZ_fP5l.d.ts → validation-lEtYD-Rh.d.ts} +4 -4
  58. package/dist/client/{BlocksIslandsHydrator-UFmQB1BE.mjs → BlocksIslandsHydrator-DkflFLGQ.mjs} +17 -17
  59. package/dist/client/{BookingMailingListNote-VjRYhx1c.mjs → BookingMailingListNote-CAyoiAGD.mjs} +18 -12
  60. package/dist/client/{BookingPanelArrangement-DpqnRo-t.mjs → BookingPanelArrangement-C7yiJrxm.mjs} +1 -1
  61. package/dist/client/{BookingQuestionFields-CzOT8ZWo.mjs → BookingQuestionFields-DZMrGvBh.mjs} +3 -3
  62. package/dist/client/{CalendarNavigationChevron-CNckKZct.mjs → CalendarNavigationChevron-BPQU5Snc.mjs} +41 -34
  63. package/dist/client/{DemoBookingPortalAccess-CmZLVXOy.mjs → DemoBookingPortalAccess-BnEgvJas.mjs} +22 -22
  64. package/dist/client/{EventCalendar.client-BU-SxLCn.mjs → EventCalendar.client-BiWQc28-.mjs} +11 -10
  65. package/dist/client/{EventCombined.client-f28VltfY.mjs → EventCombined.client-B_ytWQtn.mjs} +10 -9
  66. package/dist/client/{EventItem-sKBofjiW.mjs → EventItem-C-mxXpX_.mjs} +25 -16
  67. package/dist/client/{EventListWeekNavigation-IAcax47T.mjs → EventListWeekNavigation-Bm3Ap1Rd.mjs} +1 -1
  68. package/dist/client/{EventListing.client-BEtnRvZr.mjs → EventListing.client-Bs_8im5_.mjs} +3 -3
  69. package/dist/client/{EventListing.view-BZ4l_rmT.mjs → EventListing.view-CN7BjGgC.mjs} +37 -14
  70. package/dist/client/{EventRegistrationPayment-BWb295cD.mjs → EventRegistrationPayment-DPkRcSdw.mjs} +848 -146
  71. package/dist/client/{LocationMapActions-Hsj2HC_1.mjs → LocationMapActions-BJT7MqP2.mjs} +1 -1
  72. package/dist/client/{MapDrawingSvg-C7E7Lyfa.mjs → MapDrawingSvg-DCIwlON6.mjs} +1 -1
  73. package/dist/client/{Page-Ds1s3DuC.mjs → Page--xJ23nA5.mjs} +1160 -521
  74. package/dist/client/{StepIndicator-CSCyAaKY.mjs → StepIndicator-D391QRNc.mjs} +85 -13
  75. package/dist/client/{accessibleSurfaces-OsAseM7H.mjs → accessibleSurfaces-DN8it_Cx.mjs} +36 -27
  76. package/dist/client/{accordion-DgwFZJSx.mjs → accordion-BQtTkDN8.mjs} +1 -1
  77. package/dist/client/bookability-CE637yDE.mjs +17 -0
  78. package/dist/client/{booking-form.client-CKY9oksp.mjs → booking-form.client-D9M7TKGV.mjs} +362 -47
  79. package/dist/client/{bookingForm-CsHhcdSF.mjs → bookingForm-BsOS0sl9.mjs} +4 -4
  80. package/dist/client/bookings.mjs +6 -6
  81. package/dist/client/{boxStyleClassNames-B1Z_TGAe.mjs → boxStyleClassNames-CNDLpT06.mjs} +1 -1
  82. package/dist/client/{carousel-0sw2Kc3a.mjs → carousel-CPsW-FPh.mjs} +1 -1
  83. package/dist/client/{cart-CPfvMDGJ.mjs → cart-CwElmocm.mjs} +3 -3
  84. package/dist/client/{cart.client-BJBPUTmg.mjs → cart.client-RpqI56w8.mjs} +1 -1
  85. package/dist/client/{checkout-DU4JFjGT.mjs → checkout-CfMgqY8H.mjs} +3 -3
  86. package/dist/client/{checkout.client-BbNCO4xa.mjs → checkout.client-BpuPyOuJ.mjs} +1 -1
  87. package/dist/client/{checkoutUrls-BQ3OlWlM.mjs → checkoutUrls-VeHY6WYj.mjs} +1 -1
  88. package/dist/client/client.mjs +206 -7
  89. package/dist/client/{context-xNC1Cyjw.mjs → context-CNlesLfF.mjs} +81 -14
  90. package/dist/client/{cta-CNVQHLKs.mjs → course-q1sA4Cj-.mjs} +77 -3
  91. package/dist/client/{creditProducts-BTRX4edc.mjs → creditProducts-KYMVIH3J.mjs} +2 -84
  92. package/dist/client/{dateFormatting-B6ea-egy.mjs → dateFormatting-B73Ll0s4.mjs} +9 -1
  93. package/dist/client/{demoPortalMagicLink-BhjGxhX3.mjs → demoPortalMagicLink-BVbLD4pi.mjs} +1 -1
  94. package/dist/client/{display-B5DfNb6A.mjs → display-D8MW2b0e.mjs} +3076 -819
  95. package/dist/client/{enhanceHeaderSection-BFcHLuqk.mjs → enhanceHeaderSection-BzjY6AiY.mjs} +3 -3
  96. package/dist/client/{event-details.client-WHT5GLn2.mjs → event-details.client-CseTWUFC.mjs} +1 -1
  97. package/dist/client/{event-registration.client-CmnRKELC.mjs → event-registration.client-b5TLxntR.mjs} +1315 -553
  98. package/dist/client/{eventCalendar-2NbdCyov.mjs → eventCalendar-C-kJNIc9.mjs} +4 -4
  99. package/dist/client/{eventCombined-D1lH1n2T.mjs → eventCombined-BgHJGhwE.mjs} +4 -4
  100. package/dist/client/{eventDetails-BHvnF2Tw.mjs → eventDetails-CAwbreD0.mjs} +2 -2
  101. package/dist/client/{eventListing-EhSDk4UL.mjs → eventListing-_14atrj8.mjs} +4 -4
  102. package/dist/client/{eventRegistration-z_0jN_KS.mjs → eventRegistration-BOqSdstJ.mjs} +4 -4
  103. package/dist/client/{form-BfChzSkS.mjs → form-DfAB-llc.mjs} +3 -3
  104. package/dist/client/{form.client-D1zehtPk.mjs → form.client-DN-I9_qC.mjs} +6 -6
  105. package/dist/client/{form.parts-rMDlUQIv.mjs → form.parts-t2Q1neM6.mjs} +1 -1
  106. package/dist/client/{formatDate-ymSVT9Y5.mjs → formatDate-Dp7POa9Y.mjs} +1 -1
  107. package/dist/client/gifting/client.mjs +2 -2
  108. package/dist/client/{headerSection-BX9bQ84k.mjs → headerSection-Dces54pb.mjs} +2 -2
  109. package/dist/client/{newsletter-form.client-DMbuJCtJ.mjs → newsletter-form.client-D_YFUlR2.mjs} +9 -7
  110. package/dist/client/{newsletter-form.parts-BxrVsoI0.mjs → newsletter-form.parts-URO5Mn_I.mjs} +1 -1
  111. package/dist/client/{newsletterForm-B_I3FJFS.mjs → newsletterForm-_c9fKIzS.mjs} +3 -3
  112. package/dist/client/{noop-CamIX2yK.mjs → noop-D5mFWXtN.mjs} +139 -12
  113. package/dist/client/portal/client.mjs +346 -272
  114. package/dist/client/{product-detail.client-qxuiYCof.mjs → product-detail.client-CVW1UIxJ.mjs} +1 -1
  115. package/dist/client/{product-list.client-CDL-jihv.mjs → product-list.client-CF9hO23G.mjs} +1 -1
  116. package/dist/client/{productDetail-B97m0uZy.mjs → productDetail-C_qbmUuP.mjs} +3 -3
  117. package/dist/client/{productList-DE4vSSG_.mjs → productList-Df5qDD0z.mjs} +3 -3
  118. package/dist/client/{propsDecoder-BTde6Syh.mjs → propsDecoder-BiEyK2ii.mjs} +3 -3
  119. package/dist/client/{registry.server-Cn8XjRte.mjs → registry.server-ClcfWpvM.mjs} +93 -63
  120. package/dist/client/rendering/client.mjs +26 -26
  121. package/dist/client/rendering/islands.mjs +1 -1
  122. package/dist/client/rendering.mjs +34 -61
  123. package/dist/client/{richText-coerce-Bcl3vTb4.mjs → richText-coerce-C32cRQ03.mjs} +1 -1
  124. package/dist/client/{routeIslandApiConfig-BjRoLoMD.mjs → routeIslandApiConfig-DAypPzSo.mjs} +1 -1
  125. package/dist/client/{runtimeResponse-B-lrAGhX.mjs → runtimeResponse-9v8q2NBc.mjs} +1 -1
  126. package/dist/client/runtimeResponse-CVkM0dHy.mjs +3 -0
  127. package/dist/client/{shop-commerce-BsY7a71m.mjs → shop-commerce-Bw4_BXQg.mjs} +12 -11
  128. package/dist/client/{shop-commerce-store-BZ5j90HD.mjs → shop-commerce-store-Da6Ah-_4.mjs} +1 -1
  129. package/dist/client/shop-discount-apply.state-DidgH7ow.mjs +166 -0
  130. package/dist/client/{shop-BC4H0oYT.mjs → shop-gteEpeO5.mjs} +3 -3
  131. package/dist/client/{shop.client-WgGVGelc.mjs → shop.client-CbbdjWWd.mjs} +13 -12
  132. package/dist/client/{shop.interactive-Bb67gPLL.mjs → shop.interactive-CKFORzux.mjs} +45 -29
  133. package/dist/client/{shopShared-BE6TEk2A.mjs → shopShared-C7QjoywZ.mjs} +2 -2
  134. package/dist/client/stable-json-D0XAEIXc.mjs +22 -0
  135. package/dist/client/{timetableModel-Bbz_ECL5.mjs → timetableModel-CtZiIj9q.mjs} +25 -15
  136. package/dist/client/{useAvailableSlots-CdP14E_b.mjs → useAvailableSlots-CUVRD1nx.mjs} +39 -8
  137. package/dist/client/{useDiscountApply-DvOSso2l.mjs → useDiscountApply-BZU5DWZQ.mjs} +4 -167
  138. package/dist/client/{useDiscountCodeUi-B4fRd2jy.mjs → useDiscountCodeUi-BuLgof7O.mjs} +1 -1
  139. package/dist/client/{useEventPagination-M3jC8lgP.mjs → useEventPagination-B4VPtSEF.mjs} +6 -6
  140. package/dist/client/{view-DNNNbnNj.mjs → view-CvlTplao.mjs} +2 -2
  141. package/dist/client/{view-B0TFnP4y.mjs → view-CxUpgcM6.mjs} +56 -34
  142. package/dist/preview-next/client/{LocationPickerEnvironment-D4F_5rnr.mjs → LocationPickerEnvironment-8iKKoYZr.mjs} +1 -1
  143. package/dist/preview-next/client/{MapLibreEditMap-BKMNxSEJ.mjs → MapLibreEditMap-AIUPN1Zx.mjs} +2 -2
  144. package/dist/preview-next/client/{PageSectionToolbar-D59tHj_L.mjs → PageSectionToolbar-BFbSrDbi.mjs} +80 -160
  145. package/dist/preview-next/client/{PreviewEditorSidebar-CjOIZlUk.mjs → PreviewEditorSidebar-BtpzqQ-i.mjs} +780 -1634
  146. package/dist/preview-next/client/{PreviewEditorUI--kS9Cwsc.mjs → PreviewEditorUI-z22h-CCY.mjs} +29 -26
  147. package/dist/preview-next/client/{PreviewShell-Bi8-rclb.mjs → PreviewShell-BW3Qpoa_.mjs} +52 -32
  148. package/dist/preview-next/client/{SdkPreviewModeRuntime-CWTUw-3L.mjs → SdkPreviewModeRuntime-BvVeK1hR.mjs} +47 -69
  149. package/dist/preview-next/client/{lucide-react-BCNn8dEQ.mjs → lucide-react-Dfgl3Vtq.mjs} +7 -1
  150. package/dist/preview-next/client/{previewAssistantSlot-Caofnr1Z.mjs → previewAssistantSlot-BUqAh1FL.mjs} +98429 -46667
  151. package/dist/preview-next/client/{previewChromeRoot-CbAI_jSH.mjs → previewChromeRoot-NCy5zHO8.mjs} +1 -1
  152. package/dist/preview-next/client/runtime.mjs +3 -3
  153. package/dist/preview-next/client/{sdk-runtime-DY65_hLk.mjs → sdk-runtime-CxmKDVGZ.mjs} +2 -2
  154. package/dist/preview-next/client/siteStyleAccess-B_UaDyJO.mjs +9356 -0
  155. package/dist/preview-next/client/{useAutosaveStatus-CakNU3lp.mjs → useAutosaveStatus-BqmWvPLY.mjs} +2 -2
  156. package/dist/preview-next/client/{useOpenBlockForSetup-CCEMkosU.mjs → useOpenBlockForSetup-LAllV0rU.mjs} +8 -4
  157. package/dist/preview-next/container-responsive.css +117 -32
  158. package/dist/preview-next/keepAlive.mjs +1 -1
  159. package/dist/preview-next/middleware.mjs +1 -1
  160. package/dist/preview-next/{route-contract-DsKDQoVW.mjs → route-contract-DV6SeCNv.mjs} +200 -2
  161. package/dist/server/{Block.shared-D7Qy9F4a.mjs → Block.shared-Ch2FKAvU.mjs} +11 -6
  162. package/dist/server/{ThemeScopeCore-D1NTXZdX.mjs → ThemeScopeCore-DFvjDVzi.mjs} +23 -6
  163. package/dist/server/{accessibleSurfaces-Dbd2__Le.mjs → accessibleSurfaces-CM3QANtw.mjs} +22 -5
  164. package/dist/server/{bindings-Bp6OnR3n.mjs → bindings-CQg2lzZn.mjs} +6 -4
  165. package/dist/server/{client-dROAfMRa.mjs → client-aYRTVneD.mjs} +205 -6
  166. package/dist/server/config-validation.mjs +1 -1
  167. package/dist/server/config.mjs +2 -2
  168. package/dist/server/customCss-BGB8gMVb.mjs +210 -0
  169. package/dist/server/data/resolveBlockData.mjs +1 -1
  170. package/dist/server/{identity-20XHqyuO.mjs → identity-DQD_8lNO.mjs} +1 -1
  171. package/dist/server/index.mjs +3 -3
  172. package/dist/server/{loadContent-zOIrtqz-.mjs → loadContent-Cgpfr44e.mjs} +8 -10
  173. package/dist/server/{loadPage-vwFiq1Rk.mjs → loadPage-RDk10NMP.mjs} +3 -3
  174. package/dist/server/lookMediaFrame-CQtkvlDn.mjs +2528 -0
  175. package/dist/server/manifest.mjs +2 -2
  176. package/dist/server/{media-Brn9FW5s.mjs → media-luf7RF22.mjs} +2 -2
  177. package/dist/server/{navigation-DAwbICEL.mjs → navigation-iC_hXjJI.mjs} +3 -1
  178. package/dist/server/navigation.mjs +1 -1
  179. package/dist/server/next.mjs +9 -8
  180. package/dist/server/{overrideResolution-DjboggbB.mjs → overrideResolution-VhhN94d8.mjs} +3 -4
  181. package/dist/server/page-converter.mjs +2 -2
  182. package/dist/server/{pageRenderPlan-BR4t1rOw.mjs → pageRenderPlan-CkFTsxkd.mjs} +166 -42
  183. package/dist/server/{pageRuntimeSupport-BKo6XVK-.mjs → pageRuntimeSupport-CpAtzNxD.mjs} +15 -7
  184. package/dist/server/{pageShared-BJjptSGp.mjs → pageShared-B8yLPjs0.mjs} +531 -117
  185. package/dist/server/{parseThemeForPersistence-B18KDEue.mjs → parseThemeForPersistence-Cwqb5pZx.mjs} +2 -2
  186. package/dist/server/{portal-Ce1Prfl3.mjs → portal-BjVHMAUC.mjs} +1 -1
  187. package/dist/server/portal.mjs +1 -1
  188. package/dist/server/{prebuild-CntSkZQI.mjs → prebuild-DOu6QceG.mjs} +1 -1
  189. package/dist/server/prebuild.mjs +1 -1
  190. package/dist/server/{prefetchBlockData-BM9Ds0OQ.mjs → prefetchBlockData-CfOXFKYG.mjs} +3 -3
  191. package/dist/server/{registry-wYH0LH5f.mjs → registry-34rkAfaU.mjs} +1409 -3314
  192. package/dist/server/rendering/components/pageShared.mjs +1 -1
  193. package/dist/server/rendering/helpers/loadPage.mjs +1 -1
  194. package/dist/server/rendering/helpers/pageRuntimeSupport.mjs +2 -2
  195. package/dist/server/rendering/server.mjs +3 -3
  196. package/dist/server/rendering.mjs +8 -8
  197. package/dist/server/{resolveBlockData-Bu_p4HxZ.mjs → resolveBlockData-D7VeoWgr.mjs} +1 -1
  198. package/dist/server/{resolveButtonColourStates-CCPUY9Xh.mjs → resolveButtonColourStates--6yJp9Tq.mjs} +15 -4
  199. package/dist/server/{responseMedia-t6gs0cB7.mjs → responseMedia-DpBC1hTM.mjs} +1 -1
  200. package/dist/server/{schema-BFOqYIMQ.mjs → schema-CUDHMirj.mjs} +440 -154
  201. package/dist/server/server.mjs +3 -3
  202. package/dist/server/{src-Cxucn-1P.mjs → src-DHK4JUlp.mjs} +4 -1
  203. package/dist/server/theme-bridge.mjs +21 -15
  204. package/dist/server/theme.mjs +2 -2
  205. package/dist/server/{three-pass-converter-Bsfdy_ZV.mjs → three-pass-converter-39SXCCnh.mjs} +1 -1
  206. package/dist/server/{titleSourceSchema-DwKJfMYb.mjs → titleSourceSchema-Cu-3PRvv.mjs} +0 -1
  207. package/dist/server/{validation-DAQdPDku.mjs → validation-CLVKoJrX.mjs} +5 -5
  208. package/dist/server/{version-DAB0O3yx.mjs → version-HVfdvBJ0.mjs} +1 -1
  209. package/dist/styles/index.css +1038 -200
  210. package/package.json +1 -1
  211. package/dist/client/runtimeResponse-CPcA8xSm.mjs +0 -3
  212. package/dist/preview-next/client/SiteChromeCustomizeButton-CrgS3I8d.mjs +0 -53534
  213. package/dist/server/customCss-QymcmOZ-.mjs +0 -97
  214. package/dist/server/opaqueSurface-COEKXVwk.mjs +0 -54
  215. package/dist/server/rich-text-CRcONdyM.mjs +0 -33
@@ -1,21 +1,28 @@
1
1
  "use client";
2
2
  "use client";
3
- import { cn as parsePositiveMoneyInputToCents, t as logger, un as formatCurrencyAmount } from "../noop-CamIX2yK.mjs";
4
- import { F as unsafeAsAppointmentResourceId, M as resolveFlexibleBalancePaymentEligibility, N as assertNever$1, S as formatCreditProductUnits, T as formatOrderInstalmentStatusLabel$1, c as initialBookingQuestionValues, f as unansweredRequiredBookingQuestions, i as UNANSWERED_QUESTION_MESSAGE, n as getCreditProductTypeLabel, p as assertNever, r as UNANSWERED_QUESTIONS_SUMMARY, t as deriveCreditProductLabels, x as formatCreditProductBalance } from "../creditProducts-BTRX4edc.mjs";
3
+ import { fn as parsePositiveMoneyInputToCents, mn as formatCurrencyAmount, t as logger } from "../noop-D5mFWXtN.mjs";
4
+ import { A as assertNever$1, M as unsafeAsAppointmentResourceId, S as formatCreditProductUnits, T as formatOrderInstalmentStatusLabel$1, c as initialBookingQuestionValues, f as unansweredRequiredBookingQuestions, i as UNANSWERED_QUESTION_MESSAGE, n as getCreditProductTypeLabel, p as assertNever, r as UNANSWERED_QUESTIONS_SUMMARY, t as deriveCreditProductLabels, x as formatCreditProductBalance } from "../creditProducts-KYMVIH3J.mjs";
5
5
  import { t as generateUuidV4 } from "../uuid-BETKW8rS.mjs";
6
- import { a as createBlockApi, i as BlockApiError, n as useBlockApi, t as BlockApiProvider } from "../context-xNC1Cyjw.mjs";
6
+ import { n as useAvailableDates, s as clientPersonPhrases, t as useAvailableSlots } from "../useAvailableSlots-CUVRD1nx.mjs";
7
+ import { a as createBlockApi, i as BlockApiError, n as useBlockApi, t as BlockApiProvider } from "../context-CNlesLfF.mjs";
7
8
  import { S as clsx, i as ThemedButtonLink, l as SpinnerNode, o as ThemedFileChooser, r as ThemedButton, t as ThemedActionsButton } from "../ThemedButton-DuaYtnvG.mjs";
8
9
  import { t as resolveDedicatedBookingHref } from "../bookingRoute-D6DlxYx6.mjs";
9
- import { a as DemoPortalSignInLink, i as useBookingNowIso, r as parseBookingSubmissionFailure, t as BookingQuestionFields } from "../BookingQuestionFields-CzOT8ZWo.mjs";
10
+ import { a as DemoPortalSignInLink, i as useBookingNowIso, r as parseBookingSubmissionFailure, t as BookingQuestionFields } from "../BookingQuestionFields-DZMrGvBh.mjs";
10
11
  import { t as ModalShell } from "../ModalShell-B_fHWK71.mjs";
11
12
  import { t as TabBarFragment } from "../TabBarFragment-BqfRLojo.mjs";
12
- import { t as formatDate } from "../formatDate-ymSVT9Y5.mjs";
13
- import { n as useAvailableDates, t as useAvailableSlots } from "../useAvailableSlots-CdP14E_b.mjs";
14
- import { n as buildPortalCallbackUrl, r as requestDemoPortalMagicLink } from "../demoPortalMagicLink-BhjGxhX3.mjs";
15
- import { a as formatPortalSessionDay, c as isPast, i as formatPortalSession, l as portalSessionDisplay, n as formatDateTime, o as formatPortalSessionTime, r as formatEntitlementEnd, s as formatPortalSessionWithWeekday, t as formatDate$1 } from "../dateFormatting-B6ea-egy.mjs";
13
+ import { t as formatDate } from "../formatDate-Dp7POa9Y.mjs";
14
+ import { n as buildPortalCallbackUrl, r as requestDemoPortalMagicLink } from "../demoPortalMagicLink-BVbLD4pi.mjs";
15
+ import { a as formatPortalSessionDay, c as isPast, i as formatPortalSession, l as portalSessionDisplay, n as formatDateTime, o as formatPortalSessionTime, r as formatEntitlementEnd, s as formatPortalSessionWithWeekday, t as formatDate$1 } from "../dateFormatting-B73Ll0s4.mjs";
16
16
  import * as React$1 from "react";
17
17
  import React, { createContext, forwardRef, useCallback, useContext, useEffect, useId, useMemo, useReducer, useRef, useState } from "react";
18
18
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
19
+ //#region ../core/src/booking-refunds.ts
20
+ /** A refund cut-off as a span of time: "24 hours", "2 days", "1 hour". */
21
+ function formatCancellationCutoffSpan(cutoffHours) {
22
+ if (cutoffHours > 24 && cutoffHours % 24 === 0) return `${cutoffHours / 24} days`;
23
+ return cutoffHours === 1 ? "1 hour" : `${cutoffHours} hours`;
24
+ }
25
+ //#endregion
19
26
  //#region ../core/src/appointment-lifecycle.ts
20
27
  const appointmentStatusLabels = {
21
28
  requested: "Waiting for approval",
@@ -29,6 +36,23 @@ function appointmentStatusLabel(status) {
29
36
  return appointmentStatusLabels[status];
30
37
  }
31
38
  //#endregion
39
+ //#region ../blocks/src/customer-portal/businessPerson.tsx
40
+ const PortalBusinessPersonContext = createContext(clientPersonPhrases(null));
41
+ /**
42
+ * What the business calls the people clients book with ("trainer"), for the
43
+ * portal's wording. Hosts pass the site's noun; without one, or where the
44
+ * business names nobody, the copy leaves the noun out ("Choose someone else").
45
+ */
46
+ function PortalBusinessPersonProvider({ person, children }) {
47
+ return /* @__PURE__ */ jsx(PortalBusinessPersonContext.Provider, {
48
+ value: clientPersonPhrases(person),
49
+ children
50
+ });
51
+ }
52
+ function usePortalBusinessPerson() {
53
+ return useContext(PortalBusinessPersonContext);
54
+ }
55
+ //#endregion
32
56
  //#region ../blocks/src/customer-portal/dateDisplay.tsx
33
57
  const PortalDateContext = createContext(null);
34
58
  /** Hosts supply business context and one SSR snapshot; the existing clock owns reconciliation. */
@@ -510,16 +534,50 @@ async function requestPortalLogin(api, email, returnPath, callbackPath) {
510
534
  }
511
535
  //#endregion
512
536
  //#region ../blocks/src/customer-portal/components/PortalLoginForm.tsx
537
+ const RESEND_WAIT_SECONDS = 60;
538
+ function useResendWait() {
539
+ const [left, setLeft] = React.useState(RESEND_WAIT_SECONDS);
540
+ React.useEffect(() => {
541
+ if (left <= 0) return;
542
+ const timer = setTimeout(() => setLeft((value) => value - 1), 1e3);
543
+ return () => clearTimeout(timer);
544
+ }, [left]);
545
+ return [left, () => setLeft(RESEND_WAIT_SECONDS)];
546
+ }
547
+ function PortalLinkSent(props) {
548
+ const [left, restart] = useResendWait();
549
+ const [sending, setSending] = React.useState(false);
550
+ const resend = async () => {
551
+ setSending(true);
552
+ try {
553
+ await props.onResend();
554
+ } finally {
555
+ setSending(false);
556
+ restart();
557
+ }
558
+ };
559
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("div", {
560
+ className: "cp-alert cp-alert--success",
561
+ role: "status",
562
+ children: [
563
+ "We’ve sent a sign-in link to ",
564
+ /* @__PURE__ */ jsx("strong", { children: props.email }),
565
+ ". It can take a minute to arrive, so check your spam or junk folder too. The link works for an hour."
566
+ ]
567
+ }), /* @__PURE__ */ jsx("button", {
568
+ type: "button",
569
+ className: "cp-login__reset-link",
570
+ disabled: left > 0 || sending,
571
+ onClick: () => void resend(),
572
+ children: sending ? "Sending…" : left > 0 ? `Send it again in ${left}s` : "Send it again"
573
+ })] });
574
+ }
513
575
  function PortalLoginSuccess(props) {
514
576
  return /* @__PURE__ */ jsxs("div", {
515
577
  className: "cp-login__success",
516
- children: [props.demoSignInUrl ? /* @__PURE__ */ jsx(DemoPortalSignInLink, { url: props.demoSignInUrl }) : /* @__PURE__ */ jsxs("div", {
517
- className: "cp-alert cp-alert--success",
518
- children: [
519
- "We have sent an email to ",
520
- props.email,
521
- " with a magic link - just click it to login to your account."
522
- ]
578
+ children: [props.demoSignInUrl ? /* @__PURE__ */ jsx(DemoPortalSignInLink, { url: props.demoSignInUrl }) : /* @__PURE__ */ jsx(PortalLinkSent, {
579
+ email: props.email,
580
+ onResend: props.onResend
523
581
  }), /* @__PURE__ */ jsx("button", {
524
582
  type: "button",
525
583
  className: "cp-login__reset-link",
@@ -532,6 +590,7 @@ function PortalLoginFeedback(props) {
532
590
  if (!props.error && !props.demoRefusalMessage) return null;
533
591
  return /* @__PURE__ */ jsxs(Fragment, { children: [props.error ? /* @__PURE__ */ jsx("div", {
534
592
  className: "cp-alert cp-alert--error",
593
+ role: "alert",
535
594
  children: props.error
536
595
  }) : null, props.demoRefusalMessage ? /* @__PURE__ */ jsx("div", {
537
596
  className: "cp-alert cp-alert--error",
@@ -543,35 +602,45 @@ function getDemoRefusalMessage(status) {
543
602
  return status.tag === "demo_refused" ? status.message : null;
544
603
  }
545
604
  function getDefaultLoginButtonText(demoEmailSuppressed) {
546
- return demoEmailSuppressed ? "Get sign-in link" : "Send Magic Link";
605
+ return demoEmailSuppressed ? "Get sign-in link" : "Email me a sign-in link";
547
606
  }
548
607
  function PortalLoginEmailHint({ demoEmailSuppressed }) {
549
608
  return demoEmailSuppressed ? null : /* @__PURE__ */ jsx("p", {
550
609
  className: "cp-login__helper",
551
- children: "You will receive an email with a link, just click it to login."
610
+ children: "We’ll email you a link that signs you in. There’s no password to remember."
552
611
  });
553
612
  }
554
- async function submitPortalLogin(event, props) {
555
- event.preventDefault();
556
- if (!props.state.email || props.state.status.tag === "submitting") return;
613
+ function loginFailureMessage(error) {
614
+ return (typeof error === "object" && error !== null && "status" in error ? error.status : null) === 429 ? "You’ve asked for a few links in a row. Wait a minute, then try again." : "We couldn’t send the link just now. Try again in a moment.";
615
+ }
616
+ async function sendPortalLogin(props, email) {
557
617
  props.dispatch({ type: "login-started" });
558
618
  try {
559
- props.dispatch(await requestPortalLogin(props.api, props.state.email, props.returnPath, props.callbackPath));
619
+ props.dispatch(await requestPortalLogin(props.api, email, props.returnPath, props.callbackPath));
560
620
  } catch (error) {
561
621
  console.error("Login error:", error);
562
622
  props.dispatch({
563
623
  type: "login-failed",
564
- message: error instanceof Error ? error.message : "Failed to send magic link. Please try again."
624
+ message: loginFailureMessage(error)
565
625
  });
566
626
  }
567
627
  }
628
+ async function submitPortalLogin(event, props) {
629
+ event.preventDefault();
630
+ if (!props.state.email || props.state.status.tag === "submitting") return;
631
+ await sendPortalLogin(props, props.state.email);
632
+ }
568
633
  function PortalLoginForm(props) {
569
634
  const status = props.state.status;
570
- if (status.tag === "sent" || status.tag === "demo_link") return /* @__PURE__ */ jsx(PortalLoginSuccess, {
571
- email: status.email,
572
- demoSignInUrl: status.tag === "demo_link" ? status.url : void 0,
573
- onReset: () => props.dispatch({ type: "login-reset" })
574
- });
635
+ if (status.tag === "sent" || status.tag === "demo_link") {
636
+ const sentTo = status.email;
637
+ return /* @__PURE__ */ jsx(PortalLoginSuccess, {
638
+ email: sentTo,
639
+ demoSignInUrl: status.tag === "demo_link" ? status.url : void 0,
640
+ onResend: () => sendPortalLogin(props, sentTo),
641
+ onReset: () => props.dispatch({ type: "login-reset" })
642
+ });
643
+ }
575
644
  const submitting = status.tag === "submitting";
576
645
  return /* @__PURE__ */ jsxs("form", {
577
646
  className: "cp-login__form",
@@ -588,10 +657,10 @@ function PortalLoginForm(props) {
588
657
  }),
589
658
  /* @__PURE__ */ jsx(ThemedButton, {
590
659
  type: "submit",
591
- disabled: submitting || !props.state.email,
660
+ disabled: submitting,
592
661
  variant: "default",
593
662
  size: "md",
594
- label: submitting ? "Sending..." : props.loginButtonText ?? getDefaultLoginButtonText(props.demoEmailSuppressed)
663
+ label: submitting ? "Sending…" : props.loginButtonText ?? getDefaultLoginButtonText(props.demoEmailSuppressed)
595
664
  })
596
665
  ]
597
666
  });
@@ -607,6 +676,7 @@ function PortalLoginEmailField(props) {
607
676
  }), /* @__PURE__ */ jsx("input", {
608
677
  id: inputId,
609
678
  type: "email",
679
+ autoComplete: "email",
610
680
  className: "form-input",
611
681
  placeholder: "you@example.com",
612
682
  value: props.state.email,
@@ -690,51 +760,12 @@ function orderFilterLabel(filter) {
690
760
  case "memberships": return "Memberships";
691
761
  }
692
762
  }
693
- function getOrderStatusBadgeVariant(status) {
694
- switch (status) {
695
- case "paid": return "success";
696
- case "pending": return "warning";
697
- case "partially_refunded": return "info";
698
- case "refunded":
699
- case "cancelled": return "default";
700
- case "failed": return "error";
701
- }
702
- }
703
- function getOrderPaymentStateBadgeVariant(paymentState) {
704
- switch (paymentState.kind) {
705
- case "unpaid":
706
- case "partially_paid": return "warning";
707
- case "paid": return "success";
708
- case "waived": return "info";
709
- case "not_required": return "info";
710
- case "refunded": return "default";
711
- case "collection_failed": return "error";
712
- case "cancelled": return "default";
713
- }
714
- }
715
- function formatOrderPaymentStateLabel(paymentState) {
716
- switch (paymentState.kind) {
717
- case "unpaid": return "Amount due";
718
- case "partially_paid": return "Partially paid";
719
- case "paid": switch (paymentState.settledVia) {
720
- case "manual": return "Paid offline";
721
- case "store_credit": return "Paid with credit";
722
- case "pass_redemption": return "Covered by pass or package";
723
- case "membership_access": return "Covered by membership";
724
- case "free": return "No payment due";
725
- case "mixed":
726
- case "stripe": return "Paid";
727
- }
728
- case "waived": return "Payment waived";
729
- case "not_required": switch (paymentState.reason) {
730
- case "waived": return "Payment waived";
731
- case "pass": return "Covered by pass or package";
732
- case "membership": return "Covered by membership";
733
- case "free": return "No payment due";
734
- }
735
- case "refunded": return "Refunded";
736
- case "collection_failed": return "Payment failed";
737
- case "cancelled": return "Cancelled";
763
+ function getOrderPaymentBadgeVariant(tone) {
764
+ switch (tone) {
765
+ case "success": return "success";
766
+ case "attention": return "warning";
767
+ case "problem": return "error";
768
+ case "neutral": return "default";
738
769
  }
739
770
  }
740
771
  function formatOrderInstalmentStatusLabel(instalment) {
@@ -800,9 +831,17 @@ function isUnavailableBeforeYouComeTask(task) {
800
831
  }
801
832
  //#endregion
802
833
  //#region ../blocks/src/customer-portal/components/badge.tsx
803
- function Badge({ variant, children }) {
834
+ /** `sentence` keeps a whole line of wording readable: normal case, and free to wrap on a phone. */
835
+ const SENTENCE_STYLE = {
836
+ textTransform: "none",
837
+ whiteSpace: "normal",
838
+ borderRadius: "0.5rem",
839
+ letterSpacing: "normal"
840
+ };
841
+ function Badge({ variant, sentence = false, children }) {
804
842
  return /* @__PURE__ */ jsx("span", {
805
843
  className: `cp-badge cp-badge--${variant}`,
844
+ style: sentence ? SENTENCE_STYLE : void 0,
806
845
  children
807
846
  });
808
847
  }
@@ -8043,7 +8082,7 @@ function getAppointmentReschedulePractitionerName(resourceId, resources) {
8043
8082
  function getAppointmentRescheduleSelectionLabel(selection, resources) {
8044
8083
  switch (selection.kind) {
8045
8084
  case "any": return null;
8046
- case "specific": return getAppointmentReschedulePractitionerName(selection.practitionerId, resources) ?? "this practitioner";
8085
+ case "specific": return getAppointmentReschedulePractitionerName(selection.practitionerId, resources) ?? "the person you chose";
8047
8086
  }
8048
8087
  }
8049
8088
  function resolveAppointmentRescheduleSelectedSlot(slots, selection) {
@@ -8051,18 +8090,23 @@ function resolveAppointmentRescheduleSelectedSlot(slots, selection) {
8051
8090
  if (!selectedSlot) return null;
8052
8091
  return slots.find((slot) => slot.startAt === selectedSlot.startAt && slot.endAt === selectedSlot.endAt && slot.resourceId === selectedSlot.resourceId) ?? null;
8053
8092
  }
8093
+ /** On a one-person site there's nobody else to offer. */
8094
+ function hasOtherPractitioner(resources, currentResourceId) {
8095
+ return resources.some((resource) => resource.id !== currentResourceId);
8096
+ }
8054
8097
  function resolveAppointmentRescheduleViewState(input) {
8055
- const currentPractitionerStillOffersService = input.currentResourceId != null ? input.resources.some((resource) => resource.id === input.currentResourceId) : false;
8098
+ const ifSomeoneElse = (sentence) => hasOtherPractitioner(input.resources, input.currentResourceId) ? sentence : "";
8099
+ const currentPractitionerStillOffersService = input.currentResourceId != null && input.resources.some((resource) => resource.id === input.currentResourceId);
8056
8100
  if (input.practitionerSelection == null) {
8057
8101
  if (!input.resourcesLoading && input.currentResourceId != null && !currentPractitionerStillOffersService) return {
8058
8102
  kind: "original-practitioner-requires-switch",
8059
8103
  reason: "current-practitioner-missing-service",
8060
- message: `This service is no longer available with ${input.currentPractitionerLabel}. You can still reschedule with another practitioner.`
8104
+ message: `This service is no longer available with ${input.currentPractitionerLabel}.${ifSomeoneElse(" You can still reschedule with someone else.")}`
8061
8105
  };
8062
8106
  if (!input.resourcesLoading && currentPractitionerStillOffersService && !input.datesLoading && input.availableDateCount === 0) return {
8063
8107
  kind: "original-practitioner-requires-switch",
8064
8108
  reason: "current-practitioner-unavailable",
8065
- message: `No more times are available with ${input.currentPractitionerLabel} before your reschedule deadline. You can choose another practitioner for the same service.`
8109
+ message: `No more times are available with ${input.currentPractitionerLabel} before your reschedule deadline.${ifSomeoneElse(" You can choose someone else for the same service.")}`
8066
8110
  };
8067
8111
  return { kind: "ready" };
8068
8112
  }
@@ -8070,7 +8114,7 @@ function resolveAppointmentRescheduleViewState(input) {
8070
8114
  if (input.practitionerSelection.kind === "specific") return {
8071
8115
  kind: "switching-practitioner-no-availability",
8072
8116
  reason: "selected-practitioner-unavailable",
8073
- message: `No online times are currently available with ${getAppointmentRescheduleSelectionLabel(input.practitionerSelection, input.resources) ?? "this practitioner"}. Choose another practitioner or contact the business.`
8117
+ message: `No online times are currently available with ${getAppointmentRescheduleSelectionLabel(input.practitionerSelection, input.resources) ?? "the person you chose"}. Choose someone else or contact the business.`
8074
8118
  };
8075
8119
  return {
8076
8120
  kind: "switching-practitioner-no-availability",
@@ -8204,7 +8248,7 @@ function useRescheduleAvailability(input, deps) {
8204
8248
  //#region ../blocks/src/system/runtime/shared/AppointmentRescheduleSlotOptions.tsx
8205
8249
  function AppointmentRescheduleSlotOptions({ slots, resources, switchingPractitioner, selectedPractitionerIsAny, formatSlotStartAt }) {
8206
8250
  return /* @__PURE__ */ jsx(Fragment, { children: slots.map((slot) => {
8207
- const slotPractitionerName = getAppointmentReschedulePractitionerName(slot.resourceId, resources) ?? "Practitioner";
8251
+ const slotPractitionerName = getAppointmentReschedulePractitionerName(slot.resourceId, resources) ?? "someone";
8208
8252
  const startLabel = formatSlotStartAt(slot.startAt);
8209
8253
  return /* @__PURE__ */ jsx("option", {
8210
8254
  value: formatAppointmentRescheduleSlotOptionValue(createAppointmentRescheduleSlotIdentity(slot.startAt, slot.resourceId, slot.endAt)),
@@ -8214,8 +8258,22 @@ function AppointmentRescheduleSlotOptions({ slots, resources, switchingPractitio
8214
8258
  }
8215
8259
  //#endregion
8216
8260
  //#region ../blocks/src/customer-portal/components/bookings/PortalAppointmentRescheduleFlow.tsx
8261
+ function ChooseAnotherButton({ show, label, onClick }) {
8262
+ if (!show) return null;
8263
+ return /* @__PURE__ */ jsx("div", {
8264
+ className: "cp-card-actions",
8265
+ children: /* @__PURE__ */ jsx(ThemedButton, {
8266
+ type: "button",
8267
+ onClick,
8268
+ variant: "secondary",
8269
+ size: "sm",
8270
+ label
8271
+ })
8272
+ });
8273
+ }
8217
8274
  function PortalAppointmentRescheduleFlow({ appointment, onClose, onSuccess }) {
8218
8275
  const { context: site } = usePortalDateDisplay();
8276
+ const person = usePortalBusinessPerson();
8219
8277
  const { context, zone } = portalSessionDisplay(appointment, site);
8220
8278
  const api = useBlockApi();
8221
8279
  const [resources, setResources] = React$1.useState([]);
@@ -8236,7 +8294,7 @@ function PortalAppointmentRescheduleFlow({ appointment, onClose, onSuccess }) {
8236
8294
  label: option.label
8237
8295
  })) ?? []);
8238
8296
  } catch (error) {
8239
- if (!cancelled) setResourceError(error instanceof Error ? error.message : "Failed to load practitioners.");
8297
+ if (!cancelled) setResourceError(error instanceof Error ? error.message : "We couldn't load who's available. Please try again.");
8240
8298
  } finally {
8241
8299
  if (!cancelled) setResourcesLoading(false);
8242
8300
  }
@@ -8250,7 +8308,7 @@ function PortalAppointmentRescheduleFlow({ appointment, onClose, onSuccess }) {
8250
8308
  timeZone: context.timeZone,
8251
8309
  serviceId: appointment.serviceId,
8252
8310
  currentResourceId: appointment.resourceId ? unsafeAsAppointmentResourceId(appointment.resourceId) : null,
8253
- currentPractitionerLabel: appointment.resourceName ?? "your practitioner",
8311
+ currentPractitionerLabel: appointment.resourceName ?? "the person you booked with",
8254
8312
  resources,
8255
8313
  resourcesLoading
8256
8314
  });
@@ -8258,6 +8316,11 @@ function PortalAppointmentRescheduleFlow({ appointment, onClose, onSuccess }) {
8258
8316
  startSwitchingPractitioner();
8259
8317
  setSubmitError(null);
8260
8318
  }, [startSwitchingPractitioner]);
8319
+ const chooseAnother = /* @__PURE__ */ jsx(ChooseAnotherButton, {
8320
+ show: hasOtherPractitioner(resources, appointment.resourceId),
8321
+ label: person.chooseAnother,
8322
+ onClick: handleSwitchPractitioner
8323
+ });
8261
8324
  const handleSubmit = React$1.useCallback(async () => {
8262
8325
  if (!selectedSlot || submitting) return;
8263
8326
  setSubmitting(true);
@@ -8312,16 +8375,7 @@ function PortalAppointmentRescheduleFlow({ appointment, onClose, onSuccess }) {
8312
8375
  viewState.kind === "original-practitioner-requires-switch" ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("p", {
8313
8376
  className: "cp-card-subtitle cp-card-subtitle--spaced",
8314
8377
  children: viewState.message
8315
- }), /* @__PURE__ */ jsx("div", {
8316
- className: "cp-card-actions",
8317
- children: /* @__PURE__ */ jsx(ThemedButton, {
8318
- type: "button",
8319
- onClick: handleSwitchPractitioner,
8320
- variant: "secondary",
8321
- size: "sm",
8322
- label: "Choose another practitioner"
8323
- })
8324
- })] }) : null,
8378
+ }), chooseAnother] }) : null,
8325
8379
  viewState.kind === "switching-practitioner-no-availability" ? /* @__PURE__ */ jsx("p", {
8326
8380
  className: "cp-card-subtitle cp-card-subtitle--spaced",
8327
8381
  children: viewState.message
@@ -8331,29 +8385,20 @@ function PortalAppointmentRescheduleFlow({ appointment, onClose, onSuccess }) {
8331
8385
  className: "cp-card-meta",
8332
8386
  children: [/* @__PURE__ */ jsx("label", {
8333
8387
  htmlFor: `cp-practitioner-${appointment.id}`,
8334
- children: "Practitioner"
8388
+ children: person.label
8335
8389
  }), /* @__PURE__ */ jsxs("select", {
8336
8390
  id: `cp-practitioner-${appointment.id}`,
8337
8391
  value: selectedPractitionerId,
8338
8392
  onChange: (event) => selectPractitionerOptionValue(event.target.value),
8339
8393
  children: [/* @__PURE__ */ jsx("option", {
8340
8394
  value: ANY_PRACTITIONER_SENTINEL,
8341
- children: "Any practitioner"
8395
+ children: person.anyone
8342
8396
  }), resources.map((resource) => /* @__PURE__ */ jsx("option", {
8343
8397
  value: resource.id,
8344
8398
  children: resource.label
8345
8399
  }, resource.id))]
8346
8400
  })]
8347
- }) : /* @__PURE__ */ jsx("div", {
8348
- className: "cp-card-actions",
8349
- children: /* @__PURE__ */ jsx(ThemedButton, {
8350
- type: "button",
8351
- onClick: handleSwitchPractitioner,
8352
- variant: "secondary",
8353
- size: "sm",
8354
- label: "Choose another practitioner"
8355
- })
8356
- }),
8401
+ }) : chooseAnother,
8357
8402
  /* @__PURE__ */ jsxs("div", {
8358
8403
  className: "cp-card-meta",
8359
8404
  children: [
@@ -8435,6 +8480,7 @@ function PortalAppointmentRescheduleFlow({ appointment, onClose, onSuccess }) {
8435
8480
  }
8436
8481
  function CurrentAppointment({ appointment }) {
8437
8482
  const { context: site } = usePortalDateDisplay();
8483
+ usePortalBusinessPerson();
8438
8484
  return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", {
8439
8485
  className: "cp-card-header",
8440
8486
  children: /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("h3", {
@@ -8451,13 +8497,56 @@ function CurrentAppointment({ appointment }) {
8451
8497
  }
8452
8498
  //#endregion
8453
8499
  //#region ../blocks/src/customer-portal/components/bookings/appointmentRequestPresentation.ts
8454
- function appointmentCancelCopy(appointment) {
8500
+ function keepReasonClause(reason, siteTitle) {
8501
+ switch (reason.kind) {
8502
+ case "cutoff_passed": return `your appointment starts in less than ${formatCancellationCutoffSpan(reason.cutoffHours)}`;
8503
+ case "never_refunded": return siteTitle !== null && siteTitle !== void 0 && siteTitle !== "" ? `${siteTitle} doesn't refund cancelled appointments` : "cancelled appointments aren't refunded";
8504
+ }
8505
+ }
8506
+ function packageCredits(credits) {
8507
+ return credits === 1 ? "package credit" : `${credits} package credits`;
8508
+ }
8509
+ function cancelBody(outcome, siteTitle) {
8510
+ switch (outcome.kind) {
8511
+ case "nothing_to_return": return "This will cancel your appointment.";
8512
+ case "refund": {
8513
+ const amount = formatCurrencyAmount(outcome.money.amountCents, outcome.money.currency);
8514
+ switch (outcome.to) {
8515
+ case "card": return `This will cancel your appointment and refund ${amount} to your card. It can take 5–10 working days to appear.`;
8516
+ case "site_credit": return `This will cancel your appointment and add ${amount} to your account as site credit.`;
8517
+ case "card_and_site_credit": return `This will cancel your appointment and refund ${amount}, partly to your card and partly as site credit on your account. The card refund can take 5–10 working days to appear.`;
8518
+ }
8519
+ break;
8520
+ }
8521
+ case "credit_back": return `This will cancel your appointment and put your ${packageCredits(outcome.credits)} back.`;
8522
+ case "keep_money": return `This will cancel your appointment. Your ${formatCurrencyAmount(outcome.money.amountCents, outcome.money.currency)} won't be refunded, because ${keepReasonClause(outcome.reason, siteTitle)}.`;
8523
+ case "keep_credit": return `This will cancel your appointment. Your ${packageCredits(outcome.credits)} won't be returned, because ${keepReasonClause(outcome.reason, siteTitle)}.`;
8524
+ case "contact_business": return `This will cancel your appointment. Your ${formatCurrencyAmount(outcome.money.amountCents, outcome.money.currency)} can't be refunded online, so please contact ${siteTitle ?? "the business"} about it.`;
8525
+ }
8526
+ }
8527
+ function appointmentCancelCopy(appointment, siteTitle) {
8528
+ const outcome = appointment.cancellation.moneyOnCancel;
8455
8529
  return {
8456
8530
  buttonLabel: "Cancel",
8457
8531
  title: "Cancel appointment?",
8458
- body: appointment.cancellation.canAutoRefundOnCancel ? "This will cancel your appointment and automatically refund it if payment can still be returned." : "This will cancel your appointment.",
8532
+ body: cancelBody(outcome, siteTitle),
8459
8533
  keepLabel: "Keep appointment",
8460
- confirmLabel: "Confirm cancel"
8534
+ confirmLabel: "Confirm cancel",
8535
+ confirmAcceptsNoRefund: outcome.kind === "keep_credit"
8536
+ };
8537
+ }
8538
+ /**
8539
+ * The portal's three appointment groups. Upcoming and Cancelled run soonest
8540
+ * first; Past runs latest first. Cancelled holds only dates still to come, so it
8541
+ * doesn't sit among real upcoming bookings; once the date passes it joins Past.
8542
+ */
8543
+ function groupPortalAppointments(appointments, isPast) {
8544
+ const soonestFirst = (a, b) => a.startAt.localeCompare(b.startAt);
8545
+ const future = appointments.filter((appointment) => !isPast(appointment.startAt)).sort(soonestFirst);
8546
+ return {
8547
+ upcoming: future.filter((appointment) => appointment.status !== "cancelled"),
8548
+ cancelled: future.filter((appointment) => appointment.status === "cancelled"),
8549
+ past: appointments.filter((appointment) => isPast(appointment.startAt)).sort((a, b) => soonestFirst(b, a))
8461
8550
  };
8462
8551
  }
8463
8552
  function requestOutcomeLabel(appointment) {
@@ -8490,7 +8579,7 @@ function presentPortalAppointment(appointment, display) {
8490
8579
  badgeVariant: getAppointmentBadgeVariant(appointment.status),
8491
8580
  hint: null,
8492
8581
  rescheduleNote: rescheduleNote(appointment),
8493
- cancel: appointmentCancelCopy(appointment)
8582
+ cancel: appointmentCancelCopy(appointment, display.siteTitle)
8494
8583
  };
8495
8584
  if (appointment.status === "requested") return {
8496
8585
  ...ordinary,
@@ -8500,7 +8589,8 @@ function presentPortalAppointment(appointment, display) {
8500
8589
  title: `Cancel your request for ${appointment.serviceName} on ${slot.when}?`,
8501
8590
  body: display.siteTitle ? `We'll let ${display.siteTitle} know.` : "We'll let them know.",
8502
8591
  keepLabel: "Keep it",
8503
- confirmLabel: "Cancel request"
8592
+ confirmLabel: "Cancel request",
8593
+ confirmAcceptsNoRefund: false
8504
8594
  }
8505
8595
  };
8506
8596
  const outcome = requestOutcomeLabel(appointment);
@@ -8608,11 +8698,7 @@ function resolveEffectiveOrderFilter(preference, summary) {
8608
8698
  return summary.counts[preference] > 0 ? preference : summary.visibleFilters[0] ?? "all";
8609
8699
  }
8610
8700
  function resolveOrderFlexibleBalanceEligibility(order) {
8611
- return order.flexibleBalance ? resolveFlexibleBalancePaymentEligibility({
8612
- status: order.flexibleBalance.status,
8613
- remainingBalanceCents: order.flexibleBalance.remainingBalanceCents,
8614
- stripeMinimumChargeCents: 50
8615
- }) : null;
8701
+ return order.flexibleBalance?.paymentEligibility ?? null;
8616
8702
  }
8617
8703
  function formatCentsForInput(value) {
8618
8704
  return (value / 100).toFixed(2).replace(/\.00$/, "");
@@ -8761,7 +8847,6 @@ function OrdersSection({ orders, emptyMessage, requestedOrderId = null, onReques
8761
8847
  })
8762
8848
  })
8763
8849
  ] }) }), /* @__PURE__ */ jsx("tbody", { children: filteredOrders.map((order) => {
8764
- const amountSummary = summarizeOrderAmount(order);
8765
8850
  const note = getOrderAttentionMessage(order);
8766
8851
  const isMuted = order.status === "cancelled" || order.status === "refunded";
8767
8852
  const openOrderDetails = () => openDetails(order.id);
@@ -8804,21 +8889,9 @@ function OrdersSection({ orders, emptyMessage, requestedOrderId = null, onReques
8804
8889
  display: "grid",
8805
8890
  gap: "0.25rem"
8806
8891
  },
8807
- children: [/* @__PURE__ */ jsx("span", { children: formatOrderStatusLabel(order.status) }), /* @__PURE__ */ jsx("span", {
8808
- className: "cp-row-muted",
8809
- children: formatOrderPaymentStateLabel(order.paymentState)
8810
- })]
8892
+ children: [order.paymentLabels.booking && /* @__PURE__ */ jsx("span", { children: order.paymentLabels.booking }), /* @__PURE__ */ jsx("span", { children: order.paymentLabels.money })]
8811
8893
  }) }),
8812
- /* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsxs("div", {
8813
- style: {
8814
- display: "grid",
8815
- gap: "0.25rem"
8816
- },
8817
- children: [/* @__PURE__ */ jsx("span", { children: amountSummary.primary }), /* @__PURE__ */ jsx("span", {
8818
- className: "cp-row-muted",
8819
- children: amountSummary.secondary
8820
- })]
8821
- }) })
8894
+ /* @__PURE__ */ jsx("td", { children: formatCurrencyCents(order.grandTotalCents, order.currency) })
8822
8895
  ]
8823
8896
  }, order.id);
8824
8897
  }) })]
@@ -8873,74 +8946,67 @@ function OrderDetailsModal({ order, balanceEligibility, payingOrderId, orderActi
8873
8946
  display: "grid",
8874
8947
  gap: "0.75rem"
8875
8948
  },
8876
- children: [
8877
- /* @__PURE__ */ jsxs("div", {
8878
- style: {
8879
- display: "flex",
8880
- flexWrap: "wrap",
8881
- gap: "0.5rem"
8882
- },
8883
- children: [/* @__PURE__ */ jsx(ThemedButton, {
8949
+ children: [/* @__PURE__ */ jsxs("div", {
8950
+ style: {
8951
+ display: "flex",
8952
+ flexWrap: "wrap",
8953
+ gap: "0.5rem"
8954
+ },
8955
+ children: [/* @__PURE__ */ jsx(ThemedButton, {
8956
+ type: "button",
8957
+ disabled: isPaying,
8958
+ onClick: onPayNow,
8959
+ variant: "default",
8960
+ size: "sm",
8961
+ label: isPaying ? "Redirecting…" : getPayNowLabel(order)
8962
+ }), canEnterCustomAmount && /* @__PURE__ */ jsx(ThemedButton, {
8963
+ type: "button",
8964
+ disabled: isPaying,
8965
+ onClick: onToggleCustomAmount,
8966
+ variant: "secondary",
8967
+ size: "sm",
8968
+ label: isCustomAmountOpen ? "Hide custom amount" : "Enter amount"
8969
+ })]
8970
+ }), isCustomAmountOpen && balanceEligibility?.kind === "eligible" && /* @__PURE__ */ jsxs("div", {
8971
+ style: {
8972
+ display: "grid",
8973
+ gap: "0.5rem",
8974
+ maxWidth: "18rem"
8975
+ },
8976
+ children: [
8977
+ /* @__PURE__ */ jsx("label", {
8978
+ htmlFor: `cp-order-custom-amount-${order.id}`,
8979
+ className: "cp-card-subtitle",
8980
+ children: "Enter an amount"
8981
+ }),
8982
+ /* @__PURE__ */ jsx("input", {
8983
+ id: `cp-order-custom-amount-${order.id}`,
8984
+ type: "text",
8985
+ inputMode: "decimal",
8986
+ className: "form-input",
8987
+ value: customAmountInput,
8988
+ onChange: (event) => onChangeCustomAmount(event.target.value),
8989
+ disabled: isPaying
8990
+ }),
8991
+ /* @__PURE__ */ jsxs("div", {
8992
+ className: "cp-card-subtitle",
8993
+ children: [
8994
+ "Minimum payment",
8995
+ " ",
8996
+ formatCurrencyCents(balanceEligibility.minimumAmountCents, order.currency),
8997
+ "."
8998
+ ]
8999
+ }),
9000
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(ThemedButton, {
8884
9001
  type: "button",
8885
9002
  disabled: isPaying,
8886
- onClick: onPayNow,
9003
+ onClick: onSubmitCustomAmount,
8887
9004
  variant: "default",
8888
9005
  size: "sm",
8889
- label: isPaying ? "Redirecting…" : getPayNowLabel(order)
8890
- }), canEnterCustomAmount && /* @__PURE__ */ jsx(ThemedButton, {
8891
- type: "button",
8892
- disabled: isPaying,
8893
- onClick: onToggleCustomAmount,
8894
- variant: "secondary",
8895
- size: "sm",
8896
- label: isCustomAmountOpen ? "Hide custom amount" : "Enter amount"
8897
- })]
8898
- }),
8899
- order.actions.payOnlineInProgress && /* @__PURE__ */ jsx("div", {
8900
- className: "cp-card-subtitle",
8901
- children: "Payment is already in progress for this order."
8902
- }),
8903
- isCustomAmountOpen && balanceEligibility?.kind === "eligible" && /* @__PURE__ */ jsxs("div", {
8904
- style: {
8905
- display: "grid",
8906
- gap: "0.5rem",
8907
- maxWidth: "18rem"
8908
- },
8909
- children: [
8910
- /* @__PURE__ */ jsx("label", {
8911
- htmlFor: `cp-order-custom-amount-${order.id}`,
8912
- className: "cp-card-subtitle",
8913
- children: "Enter an amount"
8914
- }),
8915
- /* @__PURE__ */ jsx("input", {
8916
- id: `cp-order-custom-amount-${order.id}`,
8917
- type: "text",
8918
- inputMode: "decimal",
8919
- className: "form-input",
8920
- value: customAmountInput,
8921
- onChange: (event) => onChangeCustomAmount(event.target.value),
8922
- disabled: isPaying
8923
- }),
8924
- /* @__PURE__ */ jsxs("div", {
8925
- className: "cp-card-subtitle",
8926
- children: [
8927
- "Minimum payment",
8928
- " ",
8929
- formatCurrencyCents(balanceEligibility.minimumAmountCents, order.currency),
8930
- "."
8931
- ]
8932
- }),
8933
- /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(ThemedButton, {
8934
- type: "button",
8935
- disabled: isPaying,
8936
- onClick: onSubmitCustomAmount,
8937
- variant: "default",
8938
- size: "sm",
8939
- label: isPaying ? "Redirecting…" : "Pay this amount"
8940
- }) })
8941
- ]
8942
- })
8943
- ]
9006
+ label: isPaying ? "Redirecting…" : "Pay this amount"
9007
+ }) })
9008
+ ]
9009
+ })]
8944
9010
  }),
8945
9011
  order.instalmentPlan && /* @__PURE__ */ jsxs("section", {
8946
9012
  className: "cp-card",
@@ -9002,7 +9068,7 @@ function OrderDetailsModal({ order, balanceEligibility, payingOrderId, orderActi
9002
9068
  })
9003
9069
  ]
9004
9070
  }),
9005
- order.flexibleBalance && /* @__PURE__ */ jsxs("section", {
9071
+ order.flexibleBalance && order.balanceDueCents > 0 && /* @__PURE__ */ jsxs("section", {
9006
9072
  className: "cp-card",
9007
9073
  style: {
9008
9074
  display: "grid",
@@ -9197,38 +9263,10 @@ function summarizeOrderQuantity(order) {
9197
9263
  return `${quantity} ${quantity === 1 ? "item" : "items"}`;
9198
9264
  }
9199
9265
  function getOrderAttentionMessage(order) {
9200
- if (order.actions.payOnlineInProgress) return "Payment is already in progress for this order.";
9201
- if (order.instalmentPlan && order.paymentState.kind === "collection_failed") return "A payment did not go through. You can pay the remaining balance now to get everything back on track.";
9202
- if (order.flexibleBalance?.status === "overdue") return "Overdue. You can pay the full remaining balance now.";
9266
+ const eligibility = resolveOrderFlexibleBalanceEligibility(order);
9267
+ if (order.actions.canPayOnline && eligibility?.kind === "full_balance_only" && eligibility.reason === "overdue") return "Overdue. You can pay the full remaining balance now.";
9203
9268
  return null;
9204
9269
  }
9205
- function summarizeOrderAmount(order) {
9206
- const total = `Total ${formatCurrencyCents(order.grandTotalCents, order.currency)}`;
9207
- if (order.instalmentPlan || order.flexibleBalance || order.paymentState.outstandingCents > 0) return {
9208
- primary: `Due ${formatCurrencyCents(order.balanceDueCents, order.currency)}`,
9209
- secondary: order.refundedCents > 0 ? `${total} · Refunded ${formatCurrencyCents(order.refundedCents, order.currency)}` : total
9210
- };
9211
- if (order.paymentState.kind === "paid") return {
9212
- primary: "Paid in full",
9213
- secondary: total
9214
- };
9215
- if (order.paymentState.kind === "waived") return {
9216
- primary: "No payment due",
9217
- secondary: total
9218
- };
9219
- if (order.paymentState.kind === "not_required") return {
9220
- primary: formatOrderPaymentStateLabel(order.paymentState),
9221
- secondary: total
9222
- };
9223
- if (order.paymentState.kind === "refunded") return {
9224
- primary: "Refunded",
9225
- secondary: total
9226
- };
9227
- return {
9228
- primary: "Cancelled",
9229
- secondary: total
9230
- };
9231
- }
9232
9270
  function getPayNowLabel(order) {
9233
9271
  if (order.flexibleBalance) return "Pay full balance now";
9234
9272
  if (order.instalmentPlan) return "Pay the rest now";
@@ -9252,12 +9290,13 @@ function OrderDetailHeader({ order }) {
9252
9290
  flexWrap: "wrap",
9253
9291
  gap: "0.5rem"
9254
9292
  },
9255
- children: [/* @__PURE__ */ jsx(Badge, {
9256
- variant: getOrderStatusBadgeVariant(order.status),
9257
- children: formatOrderStatusLabel(order.status)
9293
+ children: [order.paymentLabels.booking && /* @__PURE__ */ jsx(Badge, {
9294
+ variant: "default",
9295
+ children: order.paymentLabels.booking
9258
9296
  }), /* @__PURE__ */ jsx(Badge, {
9259
- variant: getOrderPaymentStateBadgeVariant(order.paymentState),
9260
- children: formatOrderPaymentStateLabel(order.paymentState)
9297
+ variant: getOrderPaymentBadgeVariant(order.paymentLabels.tone),
9298
+ sentence: true,
9299
+ children: order.paymentLabels.money
9261
9300
  })]
9262
9301
  }),
9263
9302
  /* @__PURE__ */ jsxs("div", {
@@ -9307,21 +9346,21 @@ function paymentLine(payment) {
9307
9346
  const left = payment.sessionsLeft === 0 ? "none left" : `${payment.sessionsLeft} left`;
9308
9347
  return `from your ${payment.name ?? "package"}, ${left}`;
9309
9348
  }
9310
- case "owed": return "you pay as you go";
9349
+ case "owed": return "you can pay at or after the session";
9311
9350
  case "payment_link": return "you’re emailed a payment link before each session";
9312
9351
  }
9313
9352
  }
9314
9353
  function capitalise(text) {
9315
9354
  return text.charAt(0).toUpperCase() + text.slice(1);
9316
9355
  }
9317
- /** "Sam keeps this time for you each week. To miss a week or change the time, message Sam." */
9356
+ /** "Sam keeps this time for you each week. To miss a week or change the time, message Sam." Without a name: "This time is kept for you each week…" */
9318
9357
  function heldNote(session) {
9319
9358
  if (!session.holdsTime) return null;
9320
9359
  const cadence = session.schedule.cadence;
9321
9360
  const period = cadence.kind === "monthly" ? "each month" : cadence.everyWeeks === 1 ? "each week" : "every other week";
9322
9361
  const miss = cadence.kind === "weekly" && cadence.everyWeeks === 1 ? "a week" : "one";
9323
9362
  const trainer = session.trainerName;
9324
- return `${trainer ?? "Your trainer"} keeps this time for you ${period}. To miss ${miss} or change the time, message ${trainer ?? "them"}.`;
9363
+ return trainer ? `${trainer} keeps this time for you ${period}. To miss ${miss} or change the time, message ${trainer}.` : `This time is kept for you ${period}. To miss ${miss} or change the time, get in touch.`;
9325
9364
  }
9326
9365
  function formatters(locale, timeZone) {
9327
9366
  const date = new Intl.DateTimeFormat(locale, {
@@ -9370,7 +9409,7 @@ const BADGES = {
9370
9409
  variant: "warning"
9371
9410
  },
9372
9411
  held: {
9373
- text: "Held for you",
9412
+ text: "Held, not booked yet",
9374
9413
  variant: "info"
9375
9414
  },
9376
9415
  open: {
@@ -9411,7 +9450,7 @@ function runsOf(dates) {
9411
9450
  }];
9412
9451
  }, []);
9413
9452
  }
9414
- function runRow(run, localStart, format) {
9453
+ function runRow(run, localStart, format, trainerName) {
9415
9454
  const [first] = run.dates;
9416
9455
  if (!first) return null;
9417
9456
  if (first.state === "away") return {
@@ -9423,13 +9462,16 @@ function runRow(run, localStart, format) {
9423
9462
  return {
9424
9463
  key: first.occurrence,
9425
9464
  label: dateLabel(first, localStart, format),
9426
- badge: BADGES[first.state],
9465
+ badge: first.state === "trainer_away" && trainerName ? {
9466
+ ...BADGES.trainer_away,
9467
+ text: `No session, ${trainerName}’s away`
9468
+ } : BADGES[first.state],
9427
9469
  muted: first.state === "trainer_away"
9428
9470
  };
9429
9471
  }
9430
9472
  function dateRows(session, format) {
9431
9473
  return runsOf(session.dates).flatMap((run) => {
9432
- const row = runRow(run, session.schedule.localStart, format);
9474
+ const row = runRow(run, session.schedule.localStart, format, session.trainerName);
9433
9475
  return row ? [row] : [];
9434
9476
  });
9435
9477
  }
@@ -10420,7 +10462,7 @@ function MembershipCancelAction({ membership, cancelFlow }) {
10420
10462
  function membershipDatesView(membership) {
10421
10463
  if (membership.status === "canceled") return {
10422
10464
  kind: "ended",
10423
- endedAt: membership.canceledAt ?? membership.currentPeriodEnd
10465
+ endedAt: membership.endedAt ?? null
10424
10466
  };
10425
10467
  if (membership.renews) return {
10426
10468
  kind: "renewing",
@@ -10444,7 +10486,7 @@ function MembershipDates({ membership }) {
10444
10486
  "Billed ",
10445
10487
  membership.billingInterval,
10446
10488
  "ly"
10447
- ] }), view.kind === "ended" ? /* @__PURE__ */ jsxs("span", { children: ["Ended ", formatDate(view.endedAt)] }) : view.kind === "renewing" ? view.renewsAt ? /* @__PURE__ */ jsxs("span", { children: ["Renews ", formatDate(view.renewsAt)] }) : /* @__PURE__ */ jsx("span", { children: "Renewal date unavailable" }) : view.endsAt ? /* @__PURE__ */ jsxs("span", { children: ["Valid until ", formatEntitlementEnd(view.endsAt)] }) : null]
10489
+ ] }), view.kind === "ended" ? view.endedAt ? /* @__PURE__ */ jsxs("span", { children: ["Ended ", formatEntitlementEnd(view.endedAt)] }) : /* @__PURE__ */ jsx("span", { children: "Ended" }) : view.kind === "renewing" ? view.renewsAt ? /* @__PURE__ */ jsxs("span", { children: ["Renews ", formatDate(view.renewsAt)] }) : /* @__PURE__ */ jsx("span", { children: "Renewal date unavailable" }) : view.endsAt ? /* @__PURE__ */ jsxs("span", { children: ["Valid until ", formatEntitlementEnd(view.endsAt)] }) : null]
10448
10490
  }), view.kind === "ending" && /* @__PURE__ */ jsxs("div", {
10449
10491
  className: "cp-alert cp-alert--success cp-alert--mt",
10450
10492
  children: [
@@ -10643,31 +10685,47 @@ function DigitalProductsSection({ digitalProducts, onRefresh }) {
10643
10685
  }
10644
10686
  function AppointmentsSection({ bookPath, siteTitle, appointments, regularSessions, emptyMessage, onRefresh }) {
10645
10687
  const { isPast } = usePortalDateFormatting();
10688
+ const [cancelledNotices, setCancelledNotices] = useState({});
10689
+ const onCancelled = React.useCallback((appointmentId, message) => {
10690
+ setCancelledNotices((notices) => ({
10691
+ ...notices,
10692
+ [appointmentId]: message
10693
+ }));
10694
+ }, []);
10646
10695
  if (appointments.length === 0) return /* @__PURE__ */ jsx(NoAppointments, {
10647
10696
  regularSessions,
10648
10697
  emptyMessage
10649
10698
  });
10650
- const upcomingAppointments = appointments.filter((a) => !isPast(a.startAt));
10651
- const pastAppointments = appointments.filter((a) => isPast(a.startAt));
10699
+ const groups = groupPortalAppointments(appointments, isPast);
10700
+ const shared = {
10701
+ bookPath,
10702
+ siteTitle,
10703
+ onRefresh,
10704
+ cancelledNotices,
10705
+ onCancelled
10706
+ };
10652
10707
  return /* @__PURE__ */ jsxs("div", {
10653
10708
  className: "cp-section cp-section--appointments",
10654
10709
  children: [
10655
10710
  /* @__PURE__ */ jsx(RegularSessionsSection, { sessions: regularSessions }),
10656
10711
  /* @__PURE__ */ jsx(AppointmentGroup, {
10657
- appointments: upcomingAppointments,
10658
- bookPath,
10659
- siteTitle,
10660
- onRefresh,
10712
+ appointments: groups.upcoming,
10713
+ ...shared,
10661
10714
  title: "Upcoming Appointments"
10662
10715
  }),
10663
10716
  /* @__PURE__ */ jsx(AppointmentGroup, {
10664
- appointments: pastAppointments,
10665
- bookPath,
10666
- siteTitle,
10667
- onRefresh,
10717
+ appointments: groups.cancelled,
10718
+ ...shared,
10719
+ title: "Cancelled Appointments",
10720
+ isPast: true,
10721
+ spaced: groups.upcoming.length > 0
10722
+ }),
10723
+ /* @__PURE__ */ jsx(AppointmentGroup, {
10724
+ appointments: groups.past,
10725
+ ...shared,
10668
10726
  title: "Past Appointments",
10669
10727
  isPast: true,
10670
- spaced: upcomingAppointments.length > 0
10728
+ spaced: groups.upcoming.length > 0 || groups.cancelled.length > 0
10671
10729
  })
10672
10730
  ]
10673
10731
  });
@@ -10684,7 +10742,7 @@ function NoAppointments({ regularSessions, emptyMessage }) {
10684
10742
  })]
10685
10743
  });
10686
10744
  }
10687
- function AppointmentGroup({ appointments, bookPath, siteTitle, onRefresh, title, isPast, spaced }) {
10745
+ function AppointmentGroup({ appointments, bookPath, siteTitle, onRefresh, cancelledNotices, onCancelled, title, isPast, spaced }) {
10688
10746
  if (appointments.length === 0) return null;
10689
10747
  return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("h3", {
10690
10748
  className: "cp-section-title",
@@ -10697,17 +10755,23 @@ function AppointmentGroup({ appointments, bookPath, siteTitle, onRefresh, title,
10697
10755
  bookPath,
10698
10756
  siteTitle,
10699
10757
  onRefresh,
10758
+ cancelledNotice: cancelledNotices[appointment.id] ?? null,
10759
+ onCancelled,
10700
10760
  isPast
10701
10761
  }, appointment.id))
10702
10762
  })] });
10703
10763
  }
10764
+ /** The card's own cancel feedback, or the confirmation kept after the card moved group. */
10765
+ function cancelCardNote(feedback, cancelledNotice) {
10766
+ return feedback.tag !== "idle" ? feedback.message : cancelledNotice;
10767
+ }
10704
10768
  function PortalCardNote({ text }) {
10705
10769
  return text ? /* @__PURE__ */ jsx("p", {
10706
10770
  className: "cp-card-subtitle cp-card-subtitle--spaced",
10707
10771
  children: text
10708
10772
  }) : null;
10709
10773
  }
10710
- function AppointmentCard({ appointment, bookPath, siteTitle, isPast: isApptPast = false, onRefresh }) {
10774
+ function AppointmentCard({ appointment, bookPath, siteTitle, isPast: isApptPast = false, onRefresh, cancelledNotice, onCancelled }) {
10711
10775
  const { context } = usePortalDateDisplay();
10712
10776
  const presentation = presentPortalAppointment(appointment, {
10713
10777
  context,
@@ -10718,7 +10782,15 @@ function AppointmentCard({ appointment, bookPath, siteTitle, isPast: isApptPast
10718
10782
  const [rescheduleOpen, setRescheduleOpen] = useState(false);
10719
10783
  const [rescheduleFeedback, setRescheduleFeedback] = useState(null);
10720
10784
  const cancelFlow = usePortalCancelFlow({
10721
- cancel: React.useCallback((opts) => api.cancelAppointment(appointment.id, { confirmCancelWithoutRefund: opts?.confirmCancelWithoutRefund }), [api, appointment.id]),
10785
+ cancel: React.useCallback(async (opts) => {
10786
+ const result = await api.cancelAppointment(appointment.id, { confirmCancelWithoutRefund: opts?.confirmCancelWithoutRefund });
10787
+ if (result.cancelled && !result.requiresCancelWithoutRefundConfirmation) onCancelled(appointment.id, formatPortalCancelSuccessMessage(result));
10788
+ return result;
10789
+ }, [
10790
+ api,
10791
+ appointment.id,
10792
+ onCancelled
10793
+ ]),
10722
10794
  onRefresh
10723
10795
  });
10724
10796
  const rebookHref = portalRebookHref(appointment, bookPath);
@@ -10739,9 +10811,10 @@ function AppointmentCard({ appointment, bookPath, siteTitle, isPast: isApptPast
10739
10811
  }), /* @__PURE__ */ jsx(ThemedButton, {
10740
10812
  type: "button",
10741
10813
  disabled: cancelFlow.submitting,
10742
- onClick: () => void cancelFlow.submitCancel(),
10814
+ onClick: () => void cancelFlow.submitCancel(cancelCopy.confirmAcceptsNoRefund ? { confirmCancelWithoutRefund: true } : void 0),
10743
10815
  variant: "primary",
10744
10816
  size: "sm",
10817
+ extraClassName: "cp-button--danger",
10745
10818
  label: cancelFlow.submitting ? "Cancelling..." : cancelCopy.confirmLabel
10746
10819
  })]
10747
10820
  })]
@@ -10765,6 +10838,7 @@ function AppointmentCard({ appointment, bookPath, siteTitle, isPast: isApptPast
10765
10838
  onClick: () => void cancelFlow.submitCancel({ confirmCancelWithoutRefund: true }),
10766
10839
  variant: "primary",
10767
10840
  size: "sm",
10841
+ extraClassName: "cp-button--danger",
10768
10842
  label: cancelFlow.submitting ? "Cancelling..." : "Cancel without refund"
10769
10843
  })]
10770
10844
  })]
@@ -10804,10 +10878,7 @@ function AppointmentCard({ appointment, bookPath, siteTitle, isPast: isApptPast
10804
10878
  className: "cp-card-subtitle cp-card-subtitle--spaced",
10805
10879
  children: rescheduleFeedback
10806
10880
  }) : null,
10807
- cancelFlow.feedback.tag !== "idle" ? /* @__PURE__ */ jsx("p", {
10808
- className: "cp-card-subtitle cp-card-subtitle--spaced",
10809
- children: cancelFlow.feedback.message
10810
- }) : null,
10881
+ /* @__PURE__ */ jsx(PortalCardNote, { text: cancelCardNote(cancelFlow.feedback, cancelledNotice) }),
10811
10882
  /* @__PURE__ */ jsxs("div", {
10812
10883
  className: "cp-card-actions",
10813
10884
  children: [
@@ -11069,23 +11140,26 @@ function useFocusedBookingQuestionsTask(api, taskLink) {
11069
11140
  //#endregion
11070
11141
  //#region ../blocks/src/customer-portal/route-client.tsx
11071
11142
  /** Reserved customer route, shared by managed and headless hosts. The host supplies theme scope. */
11072
- function CustomerPortal({ apiBaseUrl, portalToken, siteId, dateContext, now, ...props }) {
11143
+ function CustomerPortal({ apiBaseUrl, portalToken, siteId, dateContext, now, businessPerson = null, ...props }) {
11073
11144
  return /* @__PURE__ */ jsx(PortalDateDisplayProvider, {
11074
11145
  context: dateContext,
11075
11146
  now,
11076
- children: /* @__PURE__ */ jsx(BlockApiProvider, {
11077
- config: {
11078
- baseUrl: apiBaseUrl,
11079
- auth: { type: "none" },
11080
- authOverrides: { portal: portalToken ? {
11081
- type: "bearer",
11082
- token: portalToken
11083
- } : { type: "none" } },
11084
- siteId
11085
- },
11086
- children: /* @__PURE__ */ jsx(CustomerPortalClient, {
11087
- hasInitialPortalToken: portalToken !== null,
11088
- ...props
11147
+ children: /* @__PURE__ */ jsx(PortalBusinessPersonProvider, {
11148
+ person: businessPerson,
11149
+ children: /* @__PURE__ */ jsx(BlockApiProvider, {
11150
+ config: {
11151
+ baseUrl: apiBaseUrl,
11152
+ auth: { type: "none" },
11153
+ authOverrides: { portal: portalToken ? {
11154
+ type: "bearer",
11155
+ token: portalToken
11156
+ } : { type: "none" } },
11157
+ siteId
11158
+ },
11159
+ children: /* @__PURE__ */ jsx(CustomerPortalClient, {
11160
+ hasInitialPortalToken: portalToken !== null,
11161
+ ...props
11162
+ })
11089
11163
  })
11090
11164
  })
11091
11165
  });