@riverbankcms/sdk 0.174.1 → 0.176.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 (198) hide show
  1. package/dist/_dts/{BlocksIslandsHydrator-YRmc-Yxz.d.ts → BlocksIslandsHydrator-DvoTk7Py.d.ts} +1 -1
  2. package/dist/_dts/{Page-Du0zX1B-.d.ts → Page-D-l374tU.d.ts} +8 -16
  3. package/dist/_dts/{SdkPreviewMode-4L8v3FkY.d.ts → SdkPreviewMode-22DdQAj5.d.ts} +2 -2
  4. package/dist/_dts/{client-B1J6Akyf.d.ts → client-D4p0J1lK.d.ts} +487 -11
  5. package/dist/_dts/{content-types-CGGYI0u_.d.ts → content-types-0WWR6dC4.d.ts} +2 -2
  6. package/dist/_dts/{contracts-CHMlw9hT.d.ts → contracts-f_ZG_SwY.d.ts} +8 -8
  7. package/dist/_dts/{footerPageOutline-DIHSU1Vr.d.ts → footerPageOutline-DSeZvOaj.d.ts} +85 -8
  8. package/dist/_dts/{generatePageMetadata-JITXD6BU.d.ts → generatePageMetadata-BlitPA2D.d.ts} +2 -2
  9. package/dist/_dts/{index-BLEKFHt1.d.ts → index-CKkkCgb6.d.ts} +1 -1
  10. package/dist/_dts/{index-yWDbUojb.d.ts → index-CoLcwjqJ.d.ts} +1 -1
  11. package/dist/_dts/{index-DpJm0NpL.d.ts → index-D-ai8IQd.d.ts} +4 -4
  12. package/dist/_dts/{index-CXZSy_9M.d.ts → index-DDsfmM4d.d.ts} +2 -2
  13. package/dist/_dts/{index-CF62FntA.d.ts → index-EJMo-KSo.d.ts} +2 -2
  14. package/dist/_dts/{index-D9ZYmGAJ.d.ts → index-ZKEDvLuN.d.ts} +1 -1
  15. package/dist/_dts/{index-BgOr1Xyz.d.ts → index-tcPtGdag.d.ts} +3 -3
  16. package/dist/_dts/{loadContent-M-s0p0rq.d.ts → loadContent-Ci932ORy.d.ts} +7 -7
  17. package/dist/_dts/{request-BK-pHf0P.d.ts → request-B8jVdvgI.d.ts} +1993 -407
  18. package/dist/_dts/{resolveBlockData-DZAlnhwt.d.ts → resolveBlockData-DrSMuD76.d.ts} +5 -5
  19. package/dist/_dts/{resolvePageContent-DXUCWJ3y.d.ts → resolvePageContent-Be4iL6-F.d.ts} +2 -2
  20. package/dist/_dts/sdk/src/bookings/index.d.ts +2 -2
  21. package/dist/_dts/sdk/src/client/types.d.ts +2 -2
  22. package/dist/_dts/sdk/src/client.d.ts +7 -7
  23. package/dist/_dts/sdk/src/config/index.d.ts +6 -6
  24. package/dist/_dts/sdk/src/config/template-validation.d.ts +1 -1
  25. package/dist/_dts/sdk/src/config/validation.d.ts +1 -1
  26. package/dist/_dts/sdk/src/data/dataLoaderContext.d.ts +2 -2
  27. package/dist/_dts/sdk/src/data/resolveBlockData.d.ts +1 -1
  28. package/dist/_dts/sdk/src/data/types.d.ts +2 -2
  29. package/dist/_dts/sdk/src/gifting/client.d.ts +13 -1
  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 +3 -3
  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 +3 -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 +5 -177
  46. package/dist/_dts/sdk/src/rendering/index.d.ts +7 -7
  47. package/dist/_dts/sdk/src/rendering/islands/client.d.ts +1 -1
  48. package/dist/_dts/sdk/src/rendering/server.d.ts +3 -3
  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 +2 -1
  54. package/dist/_dts/{types-CwmB2NHU.d.ts → types-BXMX4z2j.d.ts} +7 -7
  55. package/dist/_dts/{types-DjVNADXR.d.ts → types-DXY64Xh4.d.ts} +4 -4
  56. package/dist/_dts/{types-Dmow_FI6.d.ts → types-lwSgCWZ4.d.ts} +11 -2
  57. package/dist/_dts/{validation-h8t1HLlL.d.ts → validation-C5xp--Fu.d.ts} +7 -4
  58. package/dist/client/{BlocksIslandsHydrator-DRVx_XLi.mjs → BlocksIslandsHydrator-CeYQQQs7.mjs} +17 -16
  59. package/dist/client/{BookingMailingListNote-CwrMzj-k.mjs → BookingMailingListNote-CDDWrY_W.mjs} +6 -6
  60. package/dist/client/{BookingPanelArrangement-C2_hFT6K.mjs → BookingPanelArrangement-BShQSial.mjs} +1 -1
  61. package/dist/client/{BookingQuestionFields-DZMrGvBh.mjs → BookingQuestionFields-MbvIo2jS.mjs} +3 -3
  62. package/dist/client/{CalendarNavigationChevron-Az1-TIEI.mjs → CalendarNavigationChevron-C6CSVfEB.mjs} +36 -11
  63. package/dist/client/DemoBookingPortalAccess-C9Ggcfx3.mjs +545 -0
  64. package/dist/client/{EventCalendar.client-CDkkP-Lv.mjs → EventCalendar.client-BSMuSqg0.mjs} +15 -25
  65. package/dist/client/{EventCombined.client-DK3aaz62.mjs → EventCombined.client-BTrmSyUB.mjs} +25 -17
  66. package/dist/client/{EventItem-WeUipfIP.mjs → EventItem-B0WjGXsH.mjs} +4 -3
  67. package/dist/client/{EventListWeekNavigation-D3sbAeDo.mjs → EventListWeekNavigation-8Ij7vuxY.mjs} +1 -1
  68. package/dist/client/{EventListing.client-DL3gGGmF.mjs → EventListing.client-CWk2NEwd.mjs} +3 -3
  69. package/dist/client/{EventListing.view-DKFImKOx.mjs → EventListing.view-BEH4UbSL.mjs} +18 -8
  70. package/dist/client/{EventRegistrationPayment-Dn9TpWyL.mjs → EventRegistrationPayment-B2EikR3f.mjs} +635 -359
  71. package/dist/client/{LocationMapActions-BJT7MqP2.mjs → LocationMapActions-myIQIvQL.mjs} +1 -1
  72. package/dist/client/{MapDrawingSvg-DCIwlON6.mjs → MapDrawingSvg-BfsVyPvB.mjs} +2 -22
  73. package/dist/client/{Page-BpeP9xdt.mjs → Page-F3lhDvw1.mjs} +1036 -953
  74. package/dist/client/{DemoBookingPortalAccess-1p-pJ1lg.mjs → SiteTermsAgreementField-BYACYP0T.mjs} +4 -301
  75. package/dist/client/{StepIndicator-CP6zrwkl.mjs → StepIndicator-Bb7rPtSq.mjs} +37 -12
  76. package/dist/client/{accordion-nR7D4m1a.mjs → accordion-BfsOiweL.mjs} +1 -1
  77. package/dist/client/{booking-form.client-Ce-mQZ7W.mjs → booking-form.client-B8ohIj13.mjs} +229 -42
  78. package/dist/client/{bookingForm-B-qT_AQB.mjs → bookingForm-CXsck2oH.mjs} +4 -4
  79. package/dist/client/bookings.mjs +22 -15
  80. package/dist/client/{boxStyleClassNames-CrE3TDpW.mjs → boxStyleClassNames-B_hcuT06.mjs} +2 -1
  81. package/dist/client/{carousel-CVUOatsY.mjs → carousel-Cz5Ddbsx.mjs} +1 -1
  82. package/dist/client/{cart-DE0K6E0R.mjs → cart-CTC2oS3p.mjs} +3 -3
  83. package/dist/client/{cart.client-C23E6WQ5.mjs → cart.client-c1YkTC-Q.mjs} +1 -1
  84. package/dist/client/{checkout-76cdHyPL.mjs → checkout-BeW1ufaH.mjs} +3 -3
  85. package/dist/client/{checkout.client-DJOzqb26.mjs → checkout.client-BeU32khQ.mjs} +1 -1
  86. package/dist/client/{checkoutUrls-CvIP5DCO.mjs → checkoutUrls-DVfSUSKp.mjs} +1 -1
  87. package/dist/client/client.mjs +145 -21
  88. package/dist/client/{context-CNlesLfF.mjs → context-R9p5c8IH.mjs} +76 -58
  89. package/dist/client/{course-DHIrXqNT.mjs → course-CUFVJEAc.mjs} +2 -2
  90. package/dist/client/{creditProducts-KYMVIH3J.mjs → creditProducts-BQ1t1erI.mjs} +14 -61
  91. package/dist/client/{dateFormatting-B73Ll0s4.mjs → dateFormatting-CF6FWCoo.mjs} +1 -1
  92. package/dist/client/{demoPortalMagicLink-BVbLD4pi.mjs → demoPortalMagicLink-tZxIm3RL.mjs} +1 -1
  93. package/dist/client/display-4HYOb-AK.mjs +11844 -0
  94. package/dist/client/{enhanceHeaderSection-5GD5o4Mt.mjs → enhanceHeaderSection-DEYDI54E.mjs} +3 -3
  95. package/dist/client/{event-details.client-D7Oz1q2L.mjs → event-details.client-BwjBJP-f.mjs} +1 -1
  96. package/dist/client/{event-registration.client-zbuX36aA.mjs → event-registration.client-DWvSODTI.mjs} +176 -75
  97. package/dist/client/{eventCalendar-uZrksODt.mjs → eventCalendar-C9Pn9eeZ.mjs} +4 -4
  98. package/dist/client/{eventCombined-DxhvNAx8.mjs → eventCombined-Bdhk0fp0.mjs} +4 -4
  99. package/dist/client/{eventDetails-DCIH4BYG.mjs → eventDetails-C2LfNW_o.mjs} +2 -2
  100. package/dist/client/{eventListing-B9KrnPvc.mjs → eventListing-B-bJOQUk.mjs} +4 -4
  101. package/dist/client/{eventRegistration-TjnURMKl.mjs → eventRegistration-CbdmUiDT.mjs} +4 -4
  102. package/dist/client/{form-CfqIAhfN.mjs → form-BbUUt784.mjs} +3 -3
  103. package/dist/client/{form.client-CL6fF0cW.mjs → form.client-BVlz-9_t.mjs} +4 -4
  104. package/dist/client/{form.parts-Bf-L66Gg.mjs → form.parts-TB4UIrML.mjs} +1 -1
  105. package/dist/client/{formatDate-Dp7POa9Y.mjs → formatDate-TDHhFjFN.mjs} +1 -1
  106. package/dist/client/gifting/client.mjs +5 -3
  107. package/dist/client/gifting-CbNSrp7C.mjs +28 -0
  108. package/dist/client/gifting.client-B__bGhFc.mjs +404 -0
  109. package/dist/client/gifting.parts-CTA1sDW6.mjs +86 -0
  110. package/dist/client/{headerSection-WVXtOcuW.mjs → headerSection-5Wn9nUW_.mjs} +2 -2
  111. package/dist/client/{display-Cf_j5stk.mjs → lookSurfaces-BwiNdgMU.mjs} +2951 -14395
  112. package/dist/client/{newsletter-form.client-Bb7GAZpO.mjs → newsletter-form.client-B17WYHxZ.mjs} +7 -5
  113. package/dist/client/{newsletter-form.parts-BqOVRdIc.mjs → newsletter-form.parts-DN9wD1ZG.mjs} +3 -3
  114. package/dist/client/{newsletterForm-DOVe-qY3.mjs → newsletterForm-DLMlxInp.mjs} +3 -3
  115. package/dist/client/{noop-D5mFWXtN.mjs → noop-CaQxI-Js.mjs} +94 -36
  116. package/dist/client/portal/client.mjs +313 -148
  117. package/dist/client/{product-detail.client-CNzeFnFf.mjs → product-detail.client-Di_anRGR.mjs} +1 -1
  118. package/dist/client/{product-list.client-LKpzC7pj.mjs → product-list.client-Duhl6rtL.mjs} +1 -1
  119. package/dist/client/{productDetail-D2JNeEgx.mjs → productDetail-BgKmCwA8.mjs} +3 -3
  120. package/dist/client/{productList-DTgZXOEq.mjs → productList-C_wMKsYS.mjs} +3 -3
  121. package/dist/client/{propsDecoder-mpBQt2AT.mjs → propsDecoder-y3LvxaiG.mjs} +4 -3
  122. package/dist/client/{registry.server-DdTJyar2.mjs → registry.server-CIWYKz1V.mjs} +369 -246
  123. package/dist/client/rendering/client.mjs +25 -491
  124. package/dist/client/rendering/islands.mjs +1 -1
  125. package/dist/client/rendering.mjs +87 -21
  126. package/dist/client/{richText-coerce-C32cRQ03.mjs → richText-coerce-DkPBFb_a.mjs} +1 -1
  127. package/dist/client/{routeIslandApiConfig-8cfSgT0E.mjs → routeIslandApiConfig-BgO0rZce.mjs} +1 -1
  128. package/dist/client/{shop-5LBhftWx.mjs → shop-CFbWlv_W.mjs} +3 -3
  129. package/dist/client/{shop-discount-apply.state-D0ifS6KX.mjs → shop-add-feedback-DvC2kP1K.mjs} +1 -78
  130. package/dist/client/{shop-commerce-DkValjZj.mjs → shop-commerce-C-I29eaA.mjs} +64 -32
  131. package/dist/client/{shop-commerce-store-BOmXFmk_.mjs → shop-commerce-store-DGcc7twO.mjs} +1 -1
  132. package/dist/client/shop-discount-apply.state-DOm7vx0X.mjs +83 -0
  133. package/dist/client/{shop.client-BTtZqNmv.mjs → shop.client-GHTWUKD6.mjs} +56 -19
  134. package/dist/client/{shop.interactive-DNRqG4aX.mjs → shop.interactive-CxDJ8P2r.mjs} +113 -35
  135. package/dist/client/{shopShared-Nky6kPYr.mjs → shopShared-Be9QJJpT.mjs} +2 -2
  136. package/dist/client/{timetableModel-DZArznD_.mjs → timetableModel--R0zVzZO.mjs} +10 -10
  137. package/dist/client/{useAvailableSlots-CUVRD1nx.mjs → useAvailableSlots-BGu_2F50.mjs} +3 -3
  138. package/dist/client/{useDiscountCodeUi-d7viY_mu.mjs → useDiscountCodeUi-I_mXI9Yd.mjs} +32 -17
  139. package/dist/client/{useEventPagination-Da2JqxGC.mjs → useEventPagination-DxIJ--JZ.mjs} +7 -6
  140. package/dist/client/{view-BvuYmQJ5.mjs → view-3foOzGWR.mjs} +3 -2
  141. package/dist/client/{view-D9ObkFtz.mjs → view-BbzH5MQb.mjs} +128 -32
  142. package/dist/preview-next/client/{PageSectionToolbar-DwxHT-2k.mjs → PageSectionToolbar-0xyUPWUB.mjs} +4 -4
  143. package/dist/preview-next/client/{PreviewEditorSidebar-D4SBxGU6.mjs → PreviewEditorSidebar-D8vUzXtI.mjs} +61 -55
  144. package/dist/preview-next/client/{PreviewEditorUI-D8mUct32.mjs → PreviewEditorUI-CRjS4gAu.mjs} +4 -4
  145. package/dist/preview-next/client/{PreviewShell-L2AEdNUQ.mjs → PreviewShell-BvdBdeH_.mjs} +5 -5
  146. package/dist/preview-next/client/{SdkPreviewModeRuntime-bhVAU2D2.mjs → SdkPreviewModeRuntime-DWTyKbFj.mjs} +156 -143
  147. package/dist/preview-next/client/{previewAssistantSlot-Jpj_HDra.mjs → previewAssistantSlot-BqY2TTcZ.mjs} +4535 -2913
  148. package/dist/preview-next/client/{previewChromeRoot-CYTDvx4u.mjs → previewChromeRoot-BuRYe2iL.mjs} +1 -1
  149. package/dist/preview-next/client/runtime.mjs +3 -3
  150. package/dist/preview-next/client/{sdk-runtime-CZHX6J_4.mjs → sdk-runtime-BnK5kH9f.mjs} +2 -2
  151. package/dist/preview-next/client/{siteStyleAccess-DmGIG9Hk.mjs → siteStyleAccess-DbKozRSn.mjs} +527 -236
  152. package/dist/preview-next/client/{useAutosaveStatus-DQCyswQ-.mjs → useAutosaveStatus-D9s6dyMW.mjs} +1 -1
  153. package/dist/preview-next/client/{useOpenBlockForSetup-LwE5yXvL.mjs → useOpenBlockForSetup-Ce4WCxpT.mjs} +28 -5
  154. package/dist/preview-next/container-responsive.css +51 -3
  155. package/dist/preview-next/keepAlive.mjs +1 -1
  156. package/dist/preview-next/middleware.mjs +1 -1
  157. package/dist/preview-next/{route-contract-BOuNcOcN.mjs → route-contract-BYezcMx5.mjs} +94 -12
  158. package/dist/server/{Block.shared-wfJfhs08.mjs → Block.shared-Cn7gg13_.mjs} +84 -16
  159. package/dist/server/{ThemeScopeCore-BtrJNHTB.mjs → ThemeScopeCore-DFEM1a85.mjs} +16 -2
  160. package/dist/server/{bindings-P1CF2Gm6.mjs → bindings-VGgS6UvF.mjs} +13 -34
  161. package/dist/server/{client-CGtU5fHI.mjs → client-Bvag5OtW.mjs} +145 -22
  162. package/dist/server/config-validation.mjs +1 -1
  163. package/dist/server/config.mjs +2 -2
  164. package/dist/server/{customCss-BGB8gMVb.mjs → customCss-BZ8YSrQg.mjs} +1 -0
  165. package/dist/server/data/resolveBlockData.mjs +1 -1
  166. package/dist/server/index.mjs +2 -2
  167. package/dist/server/{loadContent-ChnkJSay.mjs → loadContent-CxASA3PE.mjs} +6 -9
  168. package/dist/server/{loadPage-DesHhgxj.mjs → loadPage-CQgde5DN.mjs} +2 -2
  169. package/dist/server/{lookMediaFrame-BBr0mkze.mjs → lookMediaFrame-CaH018pK.mjs} +24 -5
  170. package/dist/server/mapLocation-BM5WX7FY.mjs +315 -0
  171. package/dist/server/next.mjs +35 -9
  172. package/dist/server/{overrideResolution-DHEkHcZs.mjs → overrideResolution-BqVLO4gX.mjs} +1 -1
  173. package/dist/server/page-converter.mjs +1 -1
  174. package/dist/server/{pageRenderPlan-0jvm0RBk.mjs → pageRenderPlan-CfSnAkCO.mjs} +67 -40
  175. package/dist/server/{pageRuntimeSupport-8-f1Zr9e.mjs → pageRuntimeSupport-uz4gzBOo.mjs} +7 -15
  176. package/dist/server/{pageShared-CuVFoV4z.mjs → pageShared-D23o5QgC.mjs} +1068 -891
  177. package/dist/server/{parseThemeForPersistence-Cwqb5pZx.mjs → parseThemeForPersistence-DOsfofCy.mjs} +1 -1
  178. package/dist/server/{prebuild-Bms_Y7wQ.mjs → prebuild-BuoXWT9y.mjs} +1 -1
  179. package/dist/server/prebuild.mjs +1 -1
  180. package/dist/server/{prefetchBlockData-5oC5kyHe.mjs → prefetchBlockData-CCiYV8_s.mjs} +21 -6
  181. package/dist/server/{registry-DmqxC8th.mjs → registry-CXRXsFSx.mjs} +19721 -19621
  182. package/dist/server/rendering/components/pageShared.mjs +1 -1
  183. package/dist/server/rendering/helpers/loadPage.mjs +1 -1
  184. package/dist/server/rendering/helpers/pageRuntimeSupport.mjs +1 -1
  185. package/dist/server/rendering/server.mjs +4 -4
  186. package/dist/server/rendering.mjs +7 -7
  187. package/dist/server/{resolveBlockData-EYogtwQc.mjs → resolveBlockData-yfe8WLEA.mjs} +1 -1
  188. package/dist/server/{responseMedia-DpBC1hTM.mjs → responseMedia-F-ElH2Rd.mjs} +1 -0
  189. package/dist/server/{schema-CUDHMirj.mjs → schema-BpsqaSSU.mjs} +2 -2
  190. package/dist/server/server.mjs +3 -3
  191. package/dist/server/theme-bridge.mjs +1 -1
  192. package/dist/server/theme.mjs +2 -2
  193. package/dist/server/{validation-Bt_8IL1g.mjs → validation-CozQ7wE0.mjs} +4 -4
  194. package/dist/server/{version-DT_efohp.mjs → version-CgCWRFEY.mjs} +1 -1
  195. package/dist/styles/index.css +295 -37
  196. package/package.json +1 -1
  197. package/dist/client/useDiscountApply-BBnStWXU.mjs +0 -199
  198. package/dist/server/identity-DQD_8lNO.mjs +0 -6
@@ -1,23 +1,25 @@
1
1
  "use client";
2
- import { $i as bookingHasPackagePaymentChoices, Ai as selectedBookingCollectionOptionKind, Bi as isAppointmentBookingQuestionsEvent, Ci as parseBookingCurrencyInputToCents, Di as resolveBookingSelectedService, Ea as resolveDateRuntimeContext, Ei as resolveBookingPaymentStep, Fi as resolveSelectedAppointmentConsent, Hi as bookingQuestionsAnswerDraftSchema, Ii as EMPTY_APPOINTMENT_BOOKING_QUESTIONS, Ji as toBookingQuestionsAnswerDraft, Li as applyAppointmentBookingQuestionsEvent, Ma as leavePage, Mi as formatCentsAsCurrencyInput, Oi as resolveBookingSiteId, Pi as projectSelectedAppointmentConsentIntoForm, Qi as applyBookingPaymentAdmission, Ri as appointmentQuestionsRefusal, Si as normalizeBookingServices, Ta as readRuntimeNow, Ti as resolveAppointmentCheckoutVerificationState, Vc as resolveBookingSignupOffer, Vi as needsAppointmentQuestionsRefresh, Wi as decideBookingQuestionsRestoration, Xi as BOOKING_FORM_DATA_RESERVED_KEYS, aa as resolveBookingPaymentAvailability, at as buildReviewedBookingPaymentViewModel, bi as isSameOpenCheckout, ca as resolveBookingPurchasablePackages, di as buildBookingFormInteractiveIslandProps, ea as bookingPackageRequestKey, fi as readOverrideServiceCategories, gi as getBookingSuccessCopy, hi as getBookingRedirectStateFromLocation, ia as resolveBookingPackageSources, it as buildBookingPaymentSelectionViewModel, ji as toSelectedCollectionOptionKind, ki as resolveDefaultBookingServiceId, l as formatValidity, la as toBookingPurchasablePackages, mi as formatBookingSubmissionPreparationError, na as reconcileBookingPackagePurchase, oa as resolveBookingPaymentChoice, ol as unsafeAsSiteId, ot as paymentChoiceDetails, pi as deriveBookingFormViewState, pr as bookingPresentation, qi as restoreBookingQuestionsAnswers, ra as resolveBookingPackagePaymentSelection, sa as resolveBookingPaymentMode, sr as createSignInReturnDraftStore, st as paymentChoicePrice, ta as bookingRequiresResourceSelection, ua as getBookingServiceSlidingScale, wi as prepareBookingSubmission, xi as normalizeBookingFormConfig, yi as isBookingServiceSlidingAmountInRange, zi as deriveAppointmentBookingQuestions } from "./display-Cf_j5stk.mjs";
3
- import { Bt as formatDate, G as isBookingRequirementConsentFieldId, Jt as resolveBookingDisplayContext, Kt as formatTimeZoneCityLabel, Ut as formatDateTimeRange, Wt as formatTime, an as resolveBookingBusinessTimeZone, cn as parseUtcIsoDateTimeString, ln as toUtcIsoDateTimeString, mn as formatCurrencyAmount, on as resolveBookingTimeZoneId, t as logger } from "./noop-D5mFWXtN.mjs";
4
- import { M as unsafeAsAppointmentResourceId, N as unsafeAsAppointmentServiceId, S as formatCreditProductUnits, _ as clearWorkflowFeedback, g as okWith, m as err, o as checkBookingQuestionsAnswered, p as assertNever, v as reportWorkflowError, x as formatCreditProductBalance, y as reportWorkflowSuccess } from "./creditProducts-KYMVIH3J.mjs";
5
- import { c as NavigationHandOffPanel, i as SiteTermsChangedNotice, l as DiscountCodeDisclosure, o as useSiteTermsAgreement, r as SiteTermsAgreementField, t as BookingConfirmation } from "./DemoBookingPortalAccess-1p-pJ1lg.mjs";
2
+ import { $i as bookingQuestionsAnswerDraftSchema, Ai as isSameOpenCheckout, Bi as selectedBookingCollectionOptionKind, Ci as deriveBookingFormViewState, Ei as getBookingSuccessCopy, Fa as readRuntimeNow, Fi as resolveAppointmentCheckoutVerificationState, Gi as projectSelectedAppointmentConsentIntoForm, Go as resolveBookingSignupOffer, Ha as leavePage, Hi as toSelectedCollectionOptionKind, Ia as resolveDateRuntimeContext, Ii as resolveBookingPaymentStep, Ji as applyAppointmentBookingQuestionsEvent, Ki as resolveSelectedAppointmentConsent, Li as resolveBookingSelectedService, Mi as normalizeBookingServices, Ni as parseBookingCurrencyInputToCents, Pi as prepareBookingSubmission, Qi as needsAppointmentQuestionsRefresh, Ri as resolveBookingSiteId, Ro as repriceBookingCollectionOptions, Si as readOverrideServiceCategories, Ti as getBookingRedirectStateFromLocation, Ui as formatCentsAsCurrencyInput, Vi as snapshotBookingShownTerms, Xi as deriveAppointmentBookingQuestions, Yi as appointmentQuestionsRefusal, Zi as isAppointmentBookingQuestionsEvent, _a as resolveBookingPaymentMode, at as buildBookingPaymentSelectionViewModel, ba as getBookingServiceSlidingScale, c as formatCommercePrice, ca as applyBookingPaymentAdmission, ct as paymentChoicePrice, da as bookingRequiresResourceSelection, ds as unsafeAsSiteId, ea as decideBookingQuestionsRestoration, fa as reconcileBookingPackagePurchase, ga as resolveBookingPaymentChoice, ha as resolveBookingPaymentAvailability, ia as toBookingQuestionsAnswerDraft, ji as normalizeBookingFormConfig, ki as isBookingServiceSlidingAmountInRange, la as bookingHasPackagePaymentChoices, ma as resolveBookingPackageSources, oa as BOOKING_FORM_DATA_RESERVED_KEYS, ot as buildReviewedBookingPaymentViewModel, pa as resolveBookingPackagePaymentSelection, pr as createSignInReturnDraftStore, qi as EMPTY_APPOINTMENT_BOOKING_QUESTIONS, ra as restoreBookingQuestionsAnswers, st as paymentChoiceDetails, u as formatValidity, ua as bookingPackageRequestKey, va as resolveBookingPurchasablePackages, wi as formatBookingSubmissionPreparationError, xi as buildBookingFormInteractiveIslandProps, ya as toBookingPurchasablePackages, yr as bookingPresentation, zi as resolveDefaultBookingServiceId } from "./display-4HYOb-AK.mjs";
3
+ import { Kt as formatDate, Q as isBookingRequirementConsentFieldId, Qt as formatTimeZoneCityLabel, Xt as formatTime, Yt as formatDateTimeRange, a as okWith, bn as formatCurrencyAmount, c as reportWorkflowSuccess, dn as resolveBookingBusinessTimeZone, en as resolveBookingDisplayContext, fn as resolveBookingTimeZoneId, hn as toUtcIsoDateTimeString, mn as parseUtcIsoDateTimeString, n as assertNever, o as clearWorkflowFeedback, r as err, s as reportWorkflowError, t as logger } from "./noop-CaQxI-Js.mjs";
4
+ import { D as unsafeAsAppointmentResourceId, O as unsafeAsAppointmentServiceId, g as formatCreditProductUnits, h as formatCreditProductPayment, m as formatCreditProductBalance, o as checkBookingQuestionsAnswered } from "./creditProducts-BQ1t1erI.mjs";
5
+ import { i as useSiteTermsAgreement, n as SiteTermsChangedNotice, t as SiteTermsAgreementField } from "./SiteTermsAgreementField-BYACYP0T.mjs";
6
6
  import { t as layoutServicesByCategory } from "./appointment-service-categories-Cl2pqw-z.mjs";
7
- import { a as formatTime$1, i as formatDatePillParts, n as useAvailableDates, o as getRuntimeTimeZone, r as formatDate$1, s as clientPersonPhrases, t as useAvailableSlots } from "./useAvailableSlots-CUVRD1nx.mjs";
8
- import { n as useBlockApi, t as BlockApiProvider } from "./context-CNlesLfF.mjs";
7
+ import { a as formatTime$1, i as formatDatePillParts, n as useAvailableDates, o as getRuntimeTimeZone, r as formatDate$1, s as clientPersonPhrases, t as useAvailableSlots } from "./useAvailableSlots-BGu_2F50.mjs";
8
+ import { i as BlockApiError, n as useBlockApi, t as BlockApiProvider } from "./context-R9p5c8IH.mjs";
9
9
  import { l as SpinnerNode, r as ThemedButton } from "./ThemedButton-DuaYtnvG.mjs";
10
- import { t as buildCheckoutReturnUrls } from "./checkoutUrls-CvIP5DCO.mjs";
10
+ import { f as NavigationHandOffPanel, p as DiscountCodeDisclosure, r as DISCOUNT_APPLY_MESSAGES, t as BookingConfirmation } from "./DemoBookingPortalAccess-C9Ggcfx3.mjs";
11
+ import { t as buildCheckoutReturnUrls } from "./checkoutUrls-DVfSUSKp.mjs";
11
12
  import { t as scrollToBlock } from "./scrollToBlock-DrgKE0qZ.mjs";
12
13
  import { t as CheckboxChoice } from "./CheckboxChoice-b-PJLEXe.mjs";
13
14
  import { t as CheckIcon } from "./CheckIcon-CVcKteXH.mjs";
14
15
  import { n as getFieldValidationControlProps, t as FieldValidationMessage } from "./FieldValidationMessage-CsqxShw4.mjs";
15
16
  import { t as FeedbackMessage } from "./FeedbackMessage-CSJrAuXH.mjs";
16
- import { i as useBookingNowIso, n as OptionalMark, r as parseBookingSubmissionFailure } from "./BookingQuestionFields-DZMrGvBh.mjs";
17
- import { n as TerminalPanel, r as StateIcon, t as useDiscountCodeUi } from "./useDiscountCodeUi-d7viY_mu.mjs";
18
- import { a as usePolling, c as useBookingQuestionsRefresh, i as BookingConsentAgreement, l as PaymentChoiceRows, n as BookingQuestionSections, o as portalSessionIdentity, s as useSignInReturn, t as BookingMailingListNote } from "./BookingMailingListNote-CwrMzj-k.mjs";
19
- import { n as StepIndicator, t as BookingPanelArrangement } from "./BookingPanelArrangement-C2_hFT6K.mjs";
20
- import { s as storeDemoBookingPassIfAvailable } from "./demoPortalMagicLink-BVbLD4pi.mjs";
17
+ import { i as useBookingNowIso, n as OptionalMark, r as parseBookingSubmissionFailure } from "./BookingQuestionFields-MbvIo2jS.mjs";
18
+ import { n as TerminalPanel, r as StateIcon, t as useDiscountCodeUi } from "./useDiscountCodeUi-I_mXI9Yd.mjs";
19
+ import { a as usePolling, c as useBookingQuestionsRefresh, i as BookingConsentAgreement, l as PaymentChoiceRows, n as BookingQuestionSections, o as portalSessionIdentity, s as useSignInReturn, t as BookingMailingListNote } from "./BookingMailingListNote-CDDWrY_W.mjs";
20
+ import { n as StepIndicator, t as BookingPanelArrangement } from "./BookingPanelArrangement-BShQSial.mjs";
21
+ import { s as storeDemoBookingPassIfAvailable } from "./demoPortalMagicLink-tZxIm3RL.mjs";
22
+ import { i as getDiscountApplyFeedback } from "./shop-discount-apply.state-DOm7vx0X.mjs";
21
23
  import React, { useCallback, useEffect, useLayoutEffect, useMemo, useReducer, useRef, useState } from "react";
22
24
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
23
25
  import { z } from "zod";
@@ -237,6 +239,26 @@ function resolveBookingPaymentConfirmationSummary(input) {
237
239
  function bookingPaymentNeedsCardConfirmation(payment) {
238
240
  return payment.kind === "ready" && payment.choice.kind === "selected" && payment.choice.option.kind !== "deferred_manual";
239
241
  }
242
+ /** The discounted amount actually shown is the submission's ceiling, using the existing term snapshot. */
243
+ function discountedBookingShownTerms(payment, totalCents, currency) {
244
+ if (payment.kind !== "ready" || payment.choice.kind !== "selected") return void 0;
245
+ const [first, ...rest] = repriceBookingCollectionOptions({
246
+ options: payment.availableOptions,
247
+ totalCents,
248
+ currency
249
+ });
250
+ if (!first) return void 0;
251
+ const selectedKind = payment.choice.option.kind;
252
+ const option = [first, ...rest].find((option) => option.kind === selectedKind) ?? first;
253
+ return snapshotBookingShownTerms({
254
+ ...payment,
255
+ availableOptions: [first, ...rest],
256
+ choice: {
257
+ kind: "selected",
258
+ option
259
+ }
260
+ });
261
+ }
240
262
  //#endregion
241
263
  //#region ../blocks/src/system/runtime/hooks/useSelectedAppointmentConsentForm.ts
242
264
  function useSelectedAppointmentConsentForm(form, selectedService) {
@@ -548,7 +570,7 @@ function selectIsSubmitting(state) {
548
570
  * }
549
571
  * ```
550
572
  */
551
- function useBookingSubmission(siteId, terms) {
573
+ function useBookingSubmission(siteId, terms, onDiscountRefused) {
552
574
  const api = terms.api;
553
575
  const [state, dispatch] = useReducer(bookingSubmissionReducer, initialBookingSubmissionState);
554
576
  const submit = async (data) => {
@@ -567,6 +589,7 @@ function useBookingSubmission(siteId, terms) {
567
589
  });
568
590
  return okWith(response);
569
591
  } catch (error) {
592
+ if (error instanceof BlockApiError && error.tag === "INVALID_DISCOUNT_CODE") onDiscountRefused?.(error.message);
570
593
  console.error("Booking submission error:", error);
571
594
  const failure = parseBookingSubmissionFailure(error, "Failed to book appointment");
572
595
  dispatch({
@@ -2172,6 +2195,74 @@ function isOutdatedBookingReview(result, submitted, current) {
2172
2195
  return result.ok && (result.data.type === "review_required" || result.data.type === "payment_choice_required") && !sameBookingIntent(submitted, current);
2173
2196
  }
2174
2197
  //#endregion
2198
+ //#region ../blocks/src/system/runtime/hooks/useManualDiscountPreview.ts
2199
+ /** A preview belongs to the exact code, email and basket; late responses cannot price a newer draft. */
2200
+ function useManualDiscountPreview(input) {
2201
+ const key = JSON.stringify([
2202
+ input.code.trim(),
2203
+ input.email.trim().toLowerCase(),
2204
+ input.lines
2205
+ ]);
2206
+ const [state, setState] = useState(null);
2207
+ const status = state?.key === key ? state.status : { type: "idle" };
2208
+ const refuse = (message) => setState({
2209
+ key,
2210
+ status: {
2211
+ type: "rejected",
2212
+ reason: "invalid_or_not_applicable",
2213
+ message
2214
+ }
2215
+ });
2216
+ const apply = async () => {
2217
+ if (status.type === "applying") return;
2218
+ if (!input.code.trim()) return refuse(DISCOUNT_APPLY_MESSAGES.emptyCode);
2219
+ if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(input.email.trim())) return refuse(DISCOUNT_APPLY_MESSAGES.emailRequired);
2220
+ if (!input.lines.length) return refuse(DISCOUNT_APPLY_MESSAGES.unavailable);
2221
+ const pending = {
2222
+ key,
2223
+ status: { type: "applying" }
2224
+ };
2225
+ setState(pending);
2226
+ const next = await requestManualPreview(input);
2227
+ setState((previous) => previous === pending ? {
2228
+ key,
2229
+ status: next
2230
+ } : previous);
2231
+ };
2232
+ const discount = status.type === "applied" ? status.discount : null;
2233
+ return {
2234
+ discount,
2235
+ apply,
2236
+ refuse,
2237
+ isApplying: status.type === "applying",
2238
+ ready: !input.code.trim() || discount !== null,
2239
+ feedback: getDiscountApplyFeedback(status, formatCommercePrice)
2240
+ };
2241
+ }
2242
+ async function requestManualPreview(input) {
2243
+ try {
2244
+ const result = await input.api.applyDiscountCode({
2245
+ discountCode: input.code.trim(),
2246
+ customerEmail: input.email.trim(),
2247
+ lines: input.lines
2248
+ });
2249
+ return result.type === "applied" ? {
2250
+ type: "applied",
2251
+ discount: result
2252
+ } : {
2253
+ type: "rejected",
2254
+ reason: result.type === "rejected" ? result.reason : "unavailable",
2255
+ message: result.type === "rejected" ? result.message : DISCOUNT_APPLY_MESSAGES.unavailable
2256
+ };
2257
+ } catch {
2258
+ return {
2259
+ type: "rejected",
2260
+ reason: "unknown",
2261
+ message: DISCOUNT_APPLY_MESSAGES.unknown
2262
+ };
2263
+ }
2264
+ }
2265
+ //#endregion
2175
2266
  //#region ../blocks/src/system/runtime/hooks/useHeadlessBookingFlow.ts
2176
2267
  function HeadlessBookingProvider({ config, children }) {
2177
2268
  return React.createElement(BlockApiProvider, {
@@ -2179,6 +2270,29 @@ function HeadlessBookingProvider({ config, children }) {
2179
2270
  children
2180
2271
  });
2181
2272
  }
2273
+ /** A chosen package pays with credit, so it never carries a typed code. */
2274
+ function bookingManualDiscountInput(input) {
2275
+ return {
2276
+ code: input.packageSelected ? "" : input.code,
2277
+ email: typeof input.email === "string" ? input.email : "",
2278
+ lines: input.context ? [{
2279
+ context: input.context,
2280
+ subtotalCents: input.subtotalCents,
2281
+ currency: input.service?.priceCurrency ?? "GBP"
2282
+ }] : []
2283
+ };
2284
+ }
2285
+ function bookingPreviewOptions(resolution, discount) {
2286
+ if (resolution.kind !== "ready") return [];
2287
+ return discount ? repriceBookingCollectionOptions({
2288
+ options: resolution.availableOptions,
2289
+ currency: discount.currency,
2290
+ totalCents: discount.totalAfterDiscountCents
2291
+ }) : resolution.availableOptions;
2292
+ }
2293
+ function discountedPriceAmount(discount, priceAmount) {
2294
+ return discount?.totalAfterDiscountCents ?? priceAmount;
2295
+ }
2182
2296
  function useHeadlessBookingFlow(options) {
2183
2297
  const viewerTimeZone = options.viewerTimeZone ?? getRuntimeTimeZone();
2184
2298
  const availabilityTimeZone = options.dateContext.timeZone;
@@ -2370,22 +2484,59 @@ function useHeadlessBookingFlow(options) {
2370
2484
  const resources = resourcesState.tag === "loaded" ? resourcesState.value : [];
2371
2485
  const purchase = state.packagePurchase;
2372
2486
  const paymentPriceAmount = purchase.kind === "selected" ? purchase.package.price : selectedAppointmentPriceAmount;
2487
+ const appointmentDiscountContext = useMemo(() => purchase.kind === "selected" ? {
2488
+ type: "pass",
2489
+ passId: purchase.package.id
2490
+ } : selectedService && selectedAppointmentPriceAmount > 0 ? {
2491
+ type: "appointment",
2492
+ serviceId: selectedService.id
2493
+ } : null, [
2494
+ purchase,
2495
+ selectedAppointmentPriceAmount,
2496
+ selectedService?.id
2497
+ ]);
2373
2498
  const discountUi = useDiscountCodeUi({
2374
2499
  api,
2375
- discountContext: useMemo(() => purchase.kind === "selected" ? {
2376
- type: "pass",
2377
- passId: purchase.package.id
2378
- } : selectedService && selectedAppointmentPriceAmount > 0 ? {
2379
- type: "appointment",
2380
- serviceId: selectedService.id
2381
- } : null, [
2382
- purchase,
2383
- selectedAppointmentPriceAmount,
2384
- selectedService?.id
2385
- ]),
2500
+ discountContext: appointmentDiscountContext,
2386
2501
  subtotalCents: paymentPriceAmount
2387
2502
  });
2388
- const { submit, clearFeedback } = useBookingSubmission(options.siteId, siteTerms);
2503
+ const manualDiscount = useManualDiscountPreview({
2504
+ api,
2505
+ ...bookingManualDiscountInput({
2506
+ packageSelected: Boolean(state.selectedAppointmentPackageId),
2507
+ code: discountUi.discountCode,
2508
+ email: state.fieldValues.email,
2509
+ context: appointmentDiscountContext,
2510
+ subtotalCents: paymentPriceAmount,
2511
+ service: selectedService
2512
+ })
2513
+ });
2514
+ const { submit: submitBooking, clearFeedback } = useBookingSubmission(options.siteId, siteTerms, (message) => {
2515
+ manualDiscount.refuse(message);
2516
+ discountUi.setDiscountUiOpen(true);
2517
+ dispatch({
2518
+ type: "step-changed",
2519
+ stepId: "payment-selection"
2520
+ });
2521
+ });
2522
+ const submit = async (booking) => {
2523
+ if (!manualDiscount.ready) {
2524
+ manualDiscount.refuse("Apply your code before paying.");
2525
+ return {
2526
+ ok: false,
2527
+ error: {
2528
+ message: "Apply your code before paying.",
2529
+ questionFieldErrors: {},
2530
+ answersNeeded: false
2531
+ }
2532
+ };
2533
+ }
2534
+ const shownTerms = !state.review && manualDiscount.discount ? discountedBookingShownTerms(stepState.paymentResolution, manualDiscount.discount.totalAfterDiscountCents, manualDiscount.discount.currency) : void 0;
2535
+ return submitBooking(booking.kind === "standard" && shownTerms ? {
2536
+ ...booking,
2537
+ shownTerms
2538
+ } : booking);
2539
+ };
2389
2540
  const promisedDiscountId = resolveDisclosedBookingDiscountId(discountUi);
2390
2541
  const actions = useBookingFlowController({
2391
2542
  state,
@@ -2422,23 +2573,25 @@ function useHeadlessBookingFlow(options) {
2422
2573
  dispatch
2423
2574
  });
2424
2575
  const paymentResolution = stepState.paymentResolution;
2576
+ const previewOptions = bookingPreviewOptions(paymentResolution, manualDiscount.discount);
2425
2577
  const selectedCollectionOptionKind = selectedBookingCollectionOptionKind(paymentResolution);
2426
2578
  const paymentSelection = useMemo(() => paymentResolution.kind === "ready" || paymentResolution.kind === "not_required" ? buildBookingPaymentSelectionViewModel({
2427
2579
  dateContext: options.dateContext,
2428
2580
  serviceTitle: paymentResolution.service.title,
2429
- availableOptions: paymentResolution.kind === "ready" ? paymentResolution.availableOptions : [],
2581
+ availableOptions: previewOptions,
2430
2582
  priceCurrency: paymentResolution.service.priceCurrency
2431
2583
  }) : null, [
2432
2584
  options.dateContext,
2433
2585
  bookingNowIso,
2434
2586
  paymentResolution,
2587
+ manualDiscount.discount,
2435
2588
  selectedAppointmentPriceAmount,
2436
2589
  selectedService,
2437
2590
  state.selectedSlot?.startAt
2438
2591
  ]);
2439
2592
  const paymentConfirmationSummary = resolveBookingPaymentConfirmationSummary({
2440
2593
  service: selectedService,
2441
- priceAmount: selectedAppointmentPriceAmount,
2594
+ priceAmount: discountedPriceAmount(manualDiscount.discount, selectedAppointmentPriceAmount),
2442
2595
  hasSelectedAppointmentPackage: Boolean(state.selectedAppointmentPackageId) || purchase.kind === "selected",
2443
2596
  paymentResolution
2444
2597
  });
@@ -2559,6 +2712,7 @@ function useHeadlessBookingFlow(options) {
2559
2712
  },
2560
2713
  payment,
2561
2714
  discount: {
2715
+ preview: manualDiscount,
2562
2716
  code: discountUi.discountCode,
2563
2717
  isOpen: discountUi.discountUiOpen,
2564
2718
  manualCodeEntryAllowed: discountUi.manualCodeEntryAllowed,
@@ -3087,7 +3241,14 @@ function BookingOfferReview({ review, booking }) {
3087
3241
  }
3088
3242
  function bookingPrimaryActionLabel(booking, isLastStep, summary) {
3089
3243
  if (isLastStep && booking.services.selected?.requiresApproval) return "Send request";
3090
- return isLastStep && booking.review ? reviewedActionLabel(booking.review) : resolvePrimaryActionLabel(isLastStep, Boolean(summary));
3244
+ if (isLastStep && booking.review) return reviewedActionLabel(booking.review);
3245
+ const discount = booking.discount.preview?.discount;
3246
+ if (isLastStep && discount) return discountedActionLabel(booking, discount);
3247
+ return resolvePrimaryActionLabel(isLastStep, Boolean(summary));
3248
+ }
3249
+ function discountedActionLabel(booking, discount) {
3250
+ if (discount.totalAfterDiscountCents === 0) return "Confirm booking";
3251
+ return (booking.payment.selection?.options.find((option) => option.kind === booking.payment.selectedCollectionOptionKind))?.ctaLabel ?? `Pay ${formatCurrencyAmount(discount.totalAfterDiscountCents, discount.currency, { decimals: "auto" })} now`;
3091
3252
  }
3092
3253
  function BookingSubmissionSummary({ booking, isLastStep, summary }) {
3093
3254
  if (isLastStep && booking.services.selected?.requiresApproval) return /* @__PURE__ */ jsxs("p", {
@@ -4035,21 +4196,35 @@ function PaymentOptionContent({ description, helperText, id, summaryRows, title
4035
4196
  ]
4036
4197
  });
4037
4198
  }
4199
+ function shouldShowBookingDiscountSection(booking) {
4200
+ return !booking.payment.selectedAppointmentPackageId && !booking.discount.loading && (booking.discount.manualCodeEntryAllowed || Boolean(booking.discount.autoAppliedDiscount));
4201
+ }
4202
+ function shouldShowAutomaticDiscountNotice(booking) {
4203
+ return !booking.review && Boolean(booking.discount.autoAppliedDiscount) && booking.discount.code.trim().length === 0;
4204
+ }
4205
+ function DefaultBookingDiscountCode({ discount }) {
4206
+ return /* @__PURE__ */ jsx(DiscountCodeDisclosure, {
4207
+ surface: "theme-form",
4208
+ onApply: () => void discount.preview?.apply(),
4209
+ isApplying: discount.preview?.isApplying,
4210
+ applied: Boolean(discount.preview?.discount),
4211
+ feedback: discount.preview?.feedback,
4212
+ hint: discount.preview?.discount?.totalAfterDiscountCents === 0 ? "There's nothing to pay. You won't need to enter card details." : void 0,
4213
+ isOpen: discount.isOpen,
4214
+ code: discount.code,
4215
+ onOpen: () => discount.setOpen(true),
4216
+ onChange: discount.setCode,
4217
+ onRemove: () => {
4218
+ discount.clear();
4219
+ discount.setOpen(false);
4220
+ }
4221
+ });
4222
+ }
4038
4223
  function DefaultBookingDiscount({ booking }) {
4039
- if (!(!booking.payment.selectedAppointmentPackageId && !booking.discount.loading && (booking.discount.manualCodeEntryAllowed || Boolean(booking.discount.autoAppliedDiscount)))) return null;
4224
+ if (!shouldShowBookingDiscountSection(booking)) return null;
4040
4225
  return /* @__PURE__ */ jsxs("div", {
4041
4226
  className: "rb-mt-6",
4042
- children: [booking.discount.manualCodeEntryAllowed ? /* @__PURE__ */ jsx(DiscountCodeDisclosure, {
4043
- surface: "theme-form",
4044
- isOpen: booking.discount.isOpen,
4045
- code: booking.discount.code,
4046
- onOpen: () => booking.discount.setOpen(true),
4047
- onChange: booking.discount.setCode,
4048
- onRemove: () => {
4049
- booking.discount.clear();
4050
- booking.discount.setOpen(false);
4051
- }
4052
- }) : null, !booking.review && booking.discount.autoAppliedDiscount && booking.discount.code.trim().length === 0 ? /* @__PURE__ */ jsx(FeedbackMessage, {
4227
+ children: [booking.discount.manualCodeEntryAllowed ? /* @__PURE__ */ jsx(DefaultBookingDiscountCode, { discount: booking.discount }) : null, shouldShowAutomaticDiscountNotice(booking) ? /* @__PURE__ */ jsx(FeedbackMessage, {
4053
4228
  tone: "info",
4054
4229
  className: "alert alert-info rb-mt-4",
4055
4230
  role: "status",
@@ -4058,7 +4233,7 @@ function DefaultBookingDiscount({ booking }) {
4058
4233
  children: [
4059
4234
  "Discount available:",
4060
4235
  " ",
4061
- booking.discount.autoAppliedDiscount.publicLabel,
4236
+ booking.discount.autoAppliedDiscount?.publicLabel,
4062
4237
  " will apply automatically at checkout."
4063
4238
  ]
4064
4239
  })
@@ -4135,7 +4310,19 @@ function AppointmentDetails({ appointment, dateContext, resourceName, person })
4135
4310
  dateContext
4136
4311
  }),
4137
4312
  appointment.resourceName ? /* @__PURE__ */ jsx("p", { children: person.withName(appointment.resourceName) }) : null,
4138
- appointment.location ? /* @__PURE__ */ jsx("p", { children: appointment.location }) : null
4313
+ appointment.location ? /* @__PURE__ */ jsx("p", { children: appointment.location }) : null,
4314
+ appointment.paymentSummary?.discount ? /* @__PURE__ */ jsxs("p", { children: [
4315
+ "Discount code ",
4316
+ appointment.paymentSummary.discount.code,
4317
+ ": ",
4318
+ formatCommercePrice(appointment.paymentSummary.discount.savingCents, appointment.paymentSummary.discount.currency),
4319
+ " off"
4320
+ ] }) : null,
4321
+ appointment.paymentSummary?.kind === "pass" ? /* @__PURE__ */ jsx("p", { children: formatCreditProductPayment({
4322
+ name: appointment.paymentSummary.passName ?? "package",
4323
+ creditsUsed: appointment.paymentSummary.passCreditsUsed,
4324
+ creditsRemaining: appointment.paymentSummary.passCreditsRemaining
4325
+ }) }) : null
4139
4326
  ]
4140
4327
  });
4141
4328
  }
@@ -1,9 +1,9 @@
1
1
  "use client";
2
- import { t as BookingFormClient } from "./booking-form.client-Ce-mQZ7W.mjs";
3
- import { t as BlockApiProvider } from "./context-CNlesLfF.mjs";
4
- import { t as defineIslandPropsDecoder } from "./propsDecoder-mpBQt2AT.mjs";
2
+ import { t as BookingFormClient } from "./booking-form.client-B8ohIj13.mjs";
3
+ import { t as BlockApiProvider } from "./context-R9p5c8IH.mjs";
4
+ import { t as defineIslandPropsDecoder } from "./propsDecoder-y3LvxaiG.mjs";
5
5
  import { t as mountReactIsland } from "./reactMount-DFQy3CmO.mjs";
6
- import { t as buildRouteIslandApiConfig } from "./routeIslandApiConfig-8cfSgT0E.mjs";
6
+ import { t as buildRouteIslandApiConfig } from "./routeIslandApiConfig-BgO0rZce.mjs";
7
7
  import "react";
8
8
  import { jsx } from "react/jsx-runtime";
9
9
  //#region src/rendering/islands/enhancers/bookingForm.tsx
@@ -1,10 +1,9 @@
1
1
  "use client";
2
- import { $ as resolveHeadlessEventRegistrationStatus, $n as getSingleSelectedPricingOptionId, Ba as normalizeEventRegistrationPageSurfaceSubject, Oa as createHostedBlockApiConfig, Q as resolveEventRegistrationSubmitPlan, Si as normalizeBookingServices, Ta as readRuntimeNow, Y as deriveEventRegistrationSteps, Z as normalizeEventRegistrationMaxTickets, Zi as BOOKING_FORM_DATA_RESERVED_KEY_VALUES, et as resolveHeadlessEventRegistrationView, gr as resolveRegistrationDisplay, li as resolveRuntimeEventDestination, nt as toInternalPaymentSelection, tt as toHeadlessPaymentSelection, xi as normalizeBookingFormConfig } from "./display-Cf_j5stk.mjs";
3
- import { a as useHeadlessBookingFlow, i as HeadlessBookingProvider$1, o as createBookingBlockApiConfig, r as HeadlessBookingPaymentSelectionStep$1, s as getAppointmentBookingOverrideInput, t as BookingFormClient$1 } from "./booking-form.client-Ce-mQZ7W.mjs";
4
- import { B as publicEventSchema } from "./noop-D5mFWXtN.mjs";
5
- import { p as assertNever } from "./creditProducts-KYMVIH3J.mjs";
6
- import { n as useBlockApi, t as BlockApiProvider } from "./context-CNlesLfF.mjs";
7
- import { n as EventRegistrationPayment, r as useEventRegistrationWizard } from "./EventRegistrationPayment-Dn9TpWyL.mjs";
2
+ import { $ as resolveEventRegistrationSubmitPlan, Fa as readRuntimeNow, Mi as normalizeBookingServices, Q as normalizeEventRegistrationMaxTickets, Ra as createHostedBlockApiConfig, Sr as resolveRegistrationDisplay, X as deriveEventRegistrationSteps, Xa as normalizeEventRegistrationPageSurfaceSubject, et as resolveHeadlessEventRegistrationStatus, ir as getSingleSelectedPricingOptionId, ji as normalizeBookingFormConfig, nt as toHeadlessPaymentSelection, rt as toInternalPaymentSelection, sa as BOOKING_FORM_DATA_RESERVED_KEY_VALUES, tt as resolveHeadlessEventRegistrationView, yi as resolveRuntimeEventDestination } from "./display-4HYOb-AK.mjs";
3
+ import { a as useHeadlessBookingFlow, i as HeadlessBookingProvider$1, o as createBookingBlockApiConfig, r as HeadlessBookingPaymentSelectionStep$1, s as getAppointmentBookingOverrideInput, t as BookingFormClient$1 } from "./booking-form.client-B8ohIj13.mjs";
4
+ import { n as assertNever, q as publicEventSchema } from "./noop-CaQxI-Js.mjs";
5
+ import { n as useBlockApi, t as BlockApiProvider } from "./context-R9p5c8IH.mjs";
6
+ import { n as EventRegistrationPayment, r as useEventRegistrationWizard } from "./EventRegistrationPayment-B2EikR3f.mjs";
8
7
  import * as React$1 from "react";
9
8
  import React, { useCallback, useEffect, useMemo, useReducer } from "react";
10
9
  //#region ../blocks/src/system/runtime/nodes/event-registration/event-registration.headless.override.ts
@@ -171,14 +170,7 @@ function useEventRegistrationControllerWithDeps(options, deps) {
171
170
  shake: wizard.guestSectionShake
172
171
  },
173
172
  payment,
174
- discount: {
175
- code: wizard.discountCode,
176
- isOpen: wizard.discountUiOpen,
177
- available: wizard.discountsAvailable,
178
- manualCodeEntryAllowed: wizard.manualCodeEntryAllowed,
179
- loading: wizard.discountsAvailableLoading,
180
- autoAppliedDiscount: wizard.autoAppliedDiscount
181
- },
173
+ discount: projectRegistrationDiscount(wizard),
182
174
  portalAuth: {
183
175
  state: wizard.portalAuthState,
184
176
  profile: wizard.portalProfile,
@@ -204,6 +196,9 @@ function useEventRegistrationControllerWithDeps(options, deps) {
204
196
  selectPayment,
205
197
  setDiscountCode: wizard.setDiscountCode,
206
198
  setDiscountOpen: wizard.setDiscountUiOpen,
199
+ applyDiscountCode: async () => {
200
+ await wizard.combinationCodeField?.apply();
201
+ },
207
202
  requestLogin: () => wizard.setShowMagicLinkModal(true),
208
203
  logout: wizard.handleLogout,
209
204
  next,
@@ -289,7 +284,7 @@ function useEventRegistrationNext(wizard, submit) {
289
284
  function useEventRegistrationBack(wizard) {
290
285
  return useCallback(() => {
291
286
  if (wizard.paymentController.state.kind !== "idle") {
292
- wizard.paymentController.backToBooking();
287
+ wizard.paymentController.check();
293
288
  return;
294
289
  }
295
290
  switch (wizard.step) {
@@ -375,6 +370,18 @@ function resolvePaymentModel(wizard, directPaymentOptions) {
375
370
  eligibilityError: wizard.eligibilityError
376
371
  };
377
372
  }
373
+ function projectRegistrationDiscount(wizard) {
374
+ return {
375
+ code: wizard.discountCode,
376
+ isOpen: wizard.discountUiOpen,
377
+ available: wizard.discountsAvailable,
378
+ manualCodeEntryAllowed: wizard.manualCodeEntryAllowed,
379
+ loading: wizard.discountsAvailableLoading,
380
+ autoAppliedDiscount: wizard.autoAppliedDiscount,
381
+ applying: wizard.combinationCodeField?.applying ?? false,
382
+ feedback: wizard.combinationCodeField?.feedback ?? null
383
+ };
384
+ }
378
385
  function projectRegistrationAttendee(wizard) {
379
386
  return {
380
387
  values: wizard.formData,
@@ -1,5 +1,6 @@
1
1
  "use client";
2
- import { Rr as asPartialObject, _c as itemRoleValues, dc as boxBackgroundOverlaySchema, fc as boxBackgroundSchema, gc as cardVariantRoleValues, mc as boxlessCardVariantValue, pc as runtimeBoxBackgroundSchema, vc as openCardRoleValue } from "./display-Cf_j5stk.mjs";
2
+ import { Wr as asPartialObject } from "./display-4HYOb-AK.mjs";
3
+ import { an as cardVariantRoleValues, en as boxBackgroundOverlaySchema, nn as runtimeBoxBackgroundSchema, on as itemRoleValues, rn as boxlessCardVariantValue, sn as openCardRoleValue, tn as boxBackgroundSchema } from "./lookSurfaces-BwiNdgMU.mjs";
3
4
  import { z } from "zod";
4
5
  z.enum(itemRoleValues);
5
6
  z.enum(cardVariantRoleValues);
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { t as defineIslandPropsDecoder } from "./propsDecoder-mpBQt2AT.mjs";
2
+ import { t as defineIslandPropsDecoder } from "./propsDecoder-y3LvxaiG.mjs";
3
3
  import { i as carouselRegionAttributes } from "./carousel.shared-BFQ3kBEw.mjs";
4
4
  import { t as CarouselNodeClient } from "./carousel.client-h65clfUO.mjs";
5
5
  import { t as mountReactIsland } from "./reactMount-DFQy3CmO.mjs";
@@ -1,7 +1,7 @@
1
1
  "use client";
2
- import { t as defineIslandPropsDecoder } from "./propsDecoder-mpBQt2AT.mjs";
3
- import { t as CartClient } from "./cart.client-C23E6WQ5.mjs";
4
- import { t as mountShopBlockIsland } from "./shopShared-Nky6kPYr.mjs";
2
+ import { t as defineIslandPropsDecoder } from "./propsDecoder-y3LvxaiG.mjs";
3
+ import { t as CartClient } from "./cart.client-c1YkTC-Q.mjs";
4
+ import { t as mountShopBlockIsland } from "./shopShared-Be9QJJpT.mjs";
5
5
  //#region src/rendering/islands/enhancers/cart.tsx
6
6
  const decode = defineIslandPropsDecoder("cart");
7
7
  const enhance = (root, props) => mountShopBlockIsland(root, props, CartClient, "cart");
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { t as CartController } from "./shop-commerce-DkValjZj.mjs";
2
+ import { t as CartController } from "./shop-commerce-C-I29eaA.mjs";
3
3
  import "react";
4
4
  import { jsx } from "react/jsx-runtime";
5
5
  //#region ../blocks/src/system/runtime/nodes/cart.client.tsx
@@ -1,7 +1,7 @@
1
1
  "use client";
2
- import { t as defineIslandPropsDecoder } from "./propsDecoder-mpBQt2AT.mjs";
3
- import { t as CheckoutClient } from "./checkout.client-DJOzqb26.mjs";
4
- import { t as mountShopBlockIsland } from "./shopShared-Nky6kPYr.mjs";
2
+ import { t as defineIslandPropsDecoder } from "./propsDecoder-y3LvxaiG.mjs";
3
+ import { t as CheckoutClient } from "./checkout.client-BeU32khQ.mjs";
4
+ import { t as mountShopBlockIsland } from "./shopShared-Be9QJJpT.mjs";
5
5
  //#region src/rendering/islands/enhancers/checkout.tsx
6
6
  const decode = defineIslandPropsDecoder("checkout");
7
7
  const enhance = (root, props) => mountShopBlockIsland(root, props, CheckoutClient, "checkout");
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { n as CheckoutController } from "./shop-commerce-DkValjZj.mjs";
2
+ import { n as CheckoutController } from "./shop-commerce-C-I29eaA.mjs";
3
3
  import "react";
4
4
  import { jsx } from "react/jsx-runtime";
5
5
  //#region ../blocks/src/system/runtime/nodes/checkout.client.tsx
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { ja as canonicalUrl } from "./display-Cf_j5stk.mjs";
2
+ import { Va as canonicalUrl } from "./display-4HYOb-AK.mjs";
3
3
  //#region ../blocks/src/system/runtime/shared/utils/checkoutUrls.ts
4
4
  /**
5
5
  * Build return URLs for Stripe checkout redirect.