@riverbankcms/sdk 0.179.0 → 0.180.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.
- package/README.md +2 -2
- package/dist/_dts/{BlocksIslandsHydrator-DKwgs95u.d.ts → BlocksIslandsHydrator-DC_AvZwy.d.ts} +1 -1
- package/dist/_dts/{Page-lWenra5i.d.ts → Page-DQOxVtp3.d.ts} +7 -7
- package/dist/_dts/{SdkPreviewMode-BRxhRw4I.d.ts → SdkPreviewMode-DrLgY9_f.d.ts} +3 -2
- package/dist/_dts/{client-qWn7xAwJ.d.ts → client-BP7VBRvs.d.ts} +235 -56
- package/dist/_dts/{content-types-DL6GIvTm.d.ts → content-types-1-K2qi__.d.ts} +2 -2
- package/dist/_dts/{contracts-CzWyAiJj.d.ts → contracts-Dfqz0Tcu.d.ts} +3 -3
- package/dist/_dts/{generatePageMetadata-CBKd0cJ4.d.ts → generatePageMetadata-CSfAqmry.d.ts} +2 -2
- package/dist/_dts/{index-DVSipdrT.d.ts → index-B0_2-65A.d.ts} +3 -3
- package/dist/_dts/{index-DCiSHd-C.d.ts → index-BeM5Ylwf.d.ts} +5 -3
- package/dist/_dts/{index-BYnG_vF5.d.ts → index-Blrw2oVk.d.ts} +1 -1
- package/dist/_dts/{index-CaCum9mM.d.ts → index-CB5Csefo.d.ts} +2 -2
- package/dist/_dts/{index-CZgJrhzT.d.ts → index-DCcxLa8p.d.ts} +2 -2
- package/dist/_dts/{index-7CDBZGb-.d.ts → index-DQBGwBPx.d.ts} +1 -1
- package/dist/_dts/{index-BU9uAkHB.d.ts → index-DQr358-m.d.ts} +4 -4
- package/dist/_dts/{loadContent-CPKbFQyq.d.ts → loadContent-BG2tLGXj.d.ts} +7 -7
- package/dist/_dts/{request-BjKBCS7t.d.ts → request-P08l6mkr.d.ts} +2602 -821
- package/dist/_dts/{resolveBlockData-DupbMCup.d.ts → resolveBlockData-BDHc8lFs.d.ts} +5 -5
- package/dist/_dts/{resolvePageContent-BqNyCHi8.d.ts → resolvePageContent-Y3IZBbtL.d.ts} +1 -1
- package/dist/_dts/sdk/src/bookings/index.d.ts +2 -2
- package/dist/_dts/sdk/src/client/types.d.ts +2 -2
- package/dist/_dts/sdk/src/client.d.ts +7 -7
- package/dist/_dts/sdk/src/config/index.d.ts +6 -6
- package/dist/_dts/sdk/src/config/template-validation.d.ts +1 -1
- package/dist/_dts/sdk/src/config/validation.d.ts +1 -1
- package/dist/_dts/sdk/src/data/dataLoaderContext.d.ts +2 -2
- package/dist/_dts/sdk/src/data/resolveBlockData.d.ts +1 -1
- package/dist/_dts/sdk/src/data/types.d.ts +2 -2
- package/dist/_dts/sdk/src/gifting/client.d.ts +1 -1
- package/dist/_dts/sdk/src/index.d.ts +8 -8
- package/dist/_dts/sdk/src/manifest/index.d.ts +3 -3
- package/dist/_dts/sdk/src/metadata/index.d.ts +1 -1
- package/dist/_dts/sdk/src/navigation/index.d.ts +3 -3
- package/dist/_dts/sdk/src/next/index.d.ts +8 -8
- package/dist/_dts/sdk/src/next/middleware.d.ts +2 -2
- package/dist/_dts/sdk/src/page-converter/index.d.ts +3 -3
- package/dist/_dts/sdk/src/portal/client.d.ts +3 -3
- package/dist/_dts/sdk/src/prebuild/index.d.ts +1 -1
- package/dist/_dts/sdk/src/preview-next/before-render.d.ts +2 -2
- package/dist/_dts/sdk/src/preview-next/client/index.d.ts +2 -2
- package/dist/_dts/sdk/src/preview-next/client/runtime.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/client.d.ts +2 -2
- package/dist/_dts/sdk/src/rendering/components/pageShared.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/helpers/loadPage.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/helpers/pageRuntimeSupport.d.ts +4 -4
- package/dist/_dts/sdk/src/rendering/index.d.ts +6 -6
- package/dist/_dts/sdk/src/rendering/islands/client.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/server.d.ts +2 -2
- package/dist/_dts/sdk/src/rendering/themeAdmission.d.ts +1 -1
- package/dist/_dts/sdk/src/routing/index.d.ts +6 -6
- package/dist/_dts/sdk/src/server.d.ts +5 -5
- package/dist/_dts/sdk/src/spam-protection/index.d.ts +2 -2
- package/dist/_dts/sdk/src/theme/index.d.ts +1 -1
- package/dist/_dts/{serviceBookingOutline-YcsIjvn1.d.ts → serviceBookingOutline-BvtNagjw.d.ts} +8 -7
- package/dist/_dts/{types-BOxSq-Bq.d.ts → types-BrK6SS5c.d.ts} +9 -8
- package/dist/_dts/{types-CT-KOxl_.d.ts → types-DpEAnP4F.d.ts} +7 -2
- package/dist/_dts/{types-B7e6Lmo5.d.ts → types-HAy1-Jjo.d.ts} +3 -3
- package/dist/_dts/{validation-Dz6qccue.d.ts → validation-D6q3tOBA.d.ts} +4 -4
- package/dist/client/{BlocksIslandsHydrator-1XifJg6V.mjs → BlocksIslandsHydrator-DJSmdNUJ.mjs} +16 -16
- package/dist/client/{BookingMailingListNote-BsbEgagJ.mjs → BookingMailingListNote-CGxg37zx.mjs} +91 -59
- package/dist/client/{BookingQuestionFields-C8IbeLHj.mjs → BookingQuestionFields-DXegGSnS.mjs} +24 -3
- package/dist/client/{CalendarNavigationChevron-Bbqij1XQ.mjs → CalendarNavigationChevron-VfP50sYm.mjs} +5 -5
- package/dist/client/{DemoBookingPortalAccess-uA9H8LIL.mjs → DemoBookingPortalAccess-0Ua44F1j.mjs} +12 -7
- package/dist/client/{EventCalendar.client-yoSI77ov.mjs → EventCalendar.client-CrpiyDSP.mjs} +9 -9
- package/dist/client/{EventCombined.client-HeCNlliq.mjs → EventCombined.client-D0me9wnz.mjs} +8 -8
- package/dist/client/{EventItem-Duhk1vnF.mjs → EventItem-CJITrGkF.mjs} +5 -4
- package/dist/client/{EventListWeekNavigation-BiutEqPK.mjs → EventListWeekNavigation-BlEm_xjq.mjs} +1 -1
- package/dist/client/{EventListing.client-B5ln77jG.mjs → EventListing.client-BNM_HuS0.mjs} +3 -3
- package/dist/client/{EventListing.view-hUDhNtMv.mjs → EventListing.view-CXfb7RRy.mjs} +7 -210
- package/dist/client/{EventRegistrationPayment-DqtX1vB2.mjs → EventRegistrationPayment-DiD9uYs6.mjs} +1292 -224
- package/dist/client/{Page-ChJ2TGVk.mjs → Page-bX7iy_MK.mjs} +158 -50
- package/dist/client/{SiteTermsAgreementField-CDBU31xW.mjs → SiteTermsAgreementField-BAdW5DvE.mjs} +22 -15
- package/dist/client/{StepIndicator-JQA-VuEH.mjs → StepIndicator-DCfdcb7s.mjs} +1 -1
- package/dist/client/{StepIndicator-2Dl9zon2.mjs → StepIndicator-DCqorVne.mjs} +6 -6
- package/dist/client/{accordion-B6SqU49k.mjs → accordion-wofJY8xY.mjs} +1 -1
- package/dist/client/{booking-form.client-DrEOjQ3N.mjs → booking-form.client-CYl9NrqS.mjs} +410 -77
- package/dist/client/{bookingForm-drZBwEZW.mjs → bookingForm-kgVWtuMe.mjs} +4 -4
- package/dist/client/bookings.mjs +40 -10
- package/dist/client/{boxStyleClassNames-DEh45w16.mjs → boxStyleClassNames-CQHWz5gJ.mjs} +2 -2
- package/dist/client/{carousel-C-YJliD-.mjs → carousel-BE1dEFsD.mjs} +1 -1
- package/dist/client/{cart-acGFWK9R.mjs → cart-BsjsdGZE.mjs} +3 -3
- package/dist/client/{cart.client-BzlOGP2j.mjs → cart.client-DylGUWXY.mjs} +1 -1
- package/dist/client/{checkout-SEontwhy.mjs → checkout-B5KxEUDr.mjs} +3 -3
- package/dist/client/{checkout.client-C0Qvh-d4.mjs → checkout.client-C98fhch3.mjs} +1 -1
- package/dist/client/{checkoutUrls-yUKeq1N9.mjs → checkoutUrls-BMLYTf38.mjs} +1 -1
- package/dist/client/client.mjs +224 -158
- package/dist/client/constants-PfYJsEZF.mjs +101 -0
- package/dist/client/{context-DTrwaQtg.mjs → context-DtKdUdkO.mjs} +199 -27
- package/dist/client/{dateFormatting-Cg8E1r9l.mjs → dateFormatting-BaGPvQS3.mjs} +1 -1
- package/dist/client/{demoPortalMagicLink-D0kOJYOX.mjs → demoPortalMagicLink-B8eDjhuG.mjs} +1 -1
- package/dist/client/{enhanceHeaderSection-DyrpZ7ks.mjs → enhanceHeaderSection-DvhD-8eE.mjs} +3 -3
- package/dist/client/{event-registration.client-RLZQWi2V.mjs → event-registration.client-Du9a_xAN.mjs} +1980 -1517
- package/dist/client/{eventCalendar-CphYnImh.mjs → eventCalendar-Di9wDfzl.mjs} +4 -4
- package/dist/client/{eventCombined-BvqjASB_.mjs → eventCombined-CNW6nBsB.mjs} +4 -4
- package/dist/client/{eventListing-BaNAoC_M.mjs → eventListing-CQMxQ8By.mjs} +4 -4
- package/dist/client/{eventRegistration-COMHoRl6.mjs → eventRegistration-CprS9k1D.mjs} +4 -4
- package/dist/client/{form-DyH2juYT.mjs → form-Zl1_8RJ6.mjs} +3 -3
- package/dist/client/{form.client-DBwzkB0M.mjs → form.client-TaMUys6I.mjs} +4 -4
- package/dist/client/{form.parts-CY4kX3mh.mjs → form.parts-CpNPbPPM.mjs} +1 -1
- package/dist/client/{formatDate-CTEN7gxW.mjs → formatDate-hhI1-tzt.mjs} +1 -1
- package/dist/client/gifting/client.mjs +5 -5
- package/dist/client/{gifting-CIx4V378.mjs → gifting-DNVa7-Wj.mjs} +4 -4
- package/dist/client/{gifting.client-BEVPpzJM.mjs → gifting.client-CFUq3GVx.mjs} +4 -4
- package/dist/client/{gifting.parts-VnORjnZK.mjs → gifting.parts-CDQvxA4A.mjs} +2 -2
- package/dist/client/{headerSection-DGcJfRS8.mjs → headerSection-Cg6083rn.mjs} +2 -2
- package/dist/client/{lookSurfaces-IqT_SVnX.mjs → lookSurfaces-gJ3OqPf9.mjs} +92 -2
- package/dist/client/{newsletter-form.client-BvEDkjiD.mjs → newsletter-form.client-VuL9I96G.mjs} +5 -5
- package/dist/client/{newsletter-form.interactive-DCO1lErD.mjs → newsletter-form.interactive-7Of3eYn0.mjs} +18 -24
- package/dist/client/{newsletter-form.parts-BIy4IUT3.mjs → newsletter-form.parts-OBqsfT24.mjs} +1 -1
- package/dist/client/{newsletterForm-CoTXDNFS.mjs → newsletterForm-BkJe_RTv.mjs} +3 -3
- package/dist/client/portal/client.mjs +299 -115
- package/dist/client/{product-detail.client-YHQ2aKX1.mjs → product-detail.client-B2hdxqJN.mjs} +1 -1
- package/dist/client/{product-list.client-DxoZw1vF.mjs → product-list.client-CCEgu9rx.mjs} +1 -1
- package/dist/client/{productDetail-DjuFvkey.mjs → productDetail-CRX_ZRfS.mjs} +3 -3
- package/dist/client/{productList-DE9GEFoZ.mjs → productList-BAdJ6z5S.mjs} +3 -3
- package/dist/client/{propsDecoder-Cyag_HOs.mjs → propsDecoder-BLKAmX0S.mjs} +2 -2
- package/dist/client/{registry.server-BPwV-0Pp.mjs → registry.server-Bj9cmHHF.mjs} +89 -50
- package/dist/client/rendering/client.mjs +22 -22
- package/dist/client/rendering/islands.mjs +1 -1
- package/dist/client/rendering.mjs +4 -4
- package/dist/client/{richText-coerce-NrRqDeOg.mjs → richText-coerce-Z45OLLEX.mjs} +1 -1
- package/dist/client/{routeIslandApiConfig-BWq5gKFK.mjs → routeIslandApiConfig-DHpTTK77.mjs} +1 -1
- package/dist/client/{shop-C3wM0Hr4.mjs → shop-BKsgxm_-.mjs} +3 -3
- package/dist/client/{shop-commerce-34YvcpbX.mjs → shop-commerce-Cbtk_kUW.mjs} +12 -12
- package/dist/client/{shop-commerce-store-B7xHksOs.mjs → shop-commerce-store-B-rv2p5h.mjs} +1 -1
- package/dist/client/{shop-discount-apply.state-BiBnozfO.mjs → shop-discount-apply.state-CiCDLNh7.mjs} +2 -2
- package/dist/client/{shop.client-C0v88nLd.mjs → shop.client-Rnqa74Tk.mjs} +12 -12
- package/dist/client/{shopShared-Ct-BRNez.mjs → shopShared-BaBfhjCq.mjs} +2 -2
- package/dist/client/{src-CCtanNlD.mjs → src-o7WEvbK1.mjs} +118 -3
- package/dist/client/{timetableModel-lhE29TNT.mjs → timetableModel-BOff1Kk5.mjs} +201 -7
- package/dist/client/{useAvailableSlots-BelJviOT.mjs → useAvailableSlots-DQJNh10g.mjs} +3 -23
- package/dist/client/{useDiscountCodeUi-rQRE1-Ho.mjs → useDiscountCodeUi-BcFQRI_7.mjs} +1 -1
- package/dist/client/{useEventPagination-C4rS2Xxl.mjs → useEventPagination-BvdcexDC.mjs} +7 -7
- package/dist/client/{view-LJVHVqsy.mjs → view-CTBwSpKv.mjs} +3 -3
- package/dist/client/{wizardSteps-CNDsxeJH.mjs → wizardSteps-CWIQyRIw.mjs} +1605 -442
- package/dist/preview-next/before-render.mjs +1 -0
- package/dist/preview-next/client/{LocationPickerEnvironment-BHAT81Wx.mjs → LocationPickerEnvironment-BW3dRFIv.mjs} +1 -1
- package/dist/preview-next/client/{MapLibreEditMap-B52hkdIZ.mjs → MapLibreEditMap-Db9BHyXh.mjs} +2 -2
- package/dist/preview-next/client/{PageSectionToolbar-C4TtBPN-.mjs → PageSectionToolbar-CG6KwITA.mjs} +4 -4
- package/dist/preview-next/client/{PreviewEditorSidebar-D6fkE59-.mjs → PreviewEditorSidebar-BGBqrC9m.mjs} +8 -7
- package/dist/preview-next/client/{PreviewEditorUI-amcDlj0O.mjs → PreviewEditorUI-Bwkyx28x.mjs} +5 -5
- package/dist/preview-next/client/{PreviewShell-DeQjx4zk.mjs → PreviewShell-DB1l6JNU.mjs} +7 -7
- package/dist/preview-next/client/{SdkPreviewModeRuntime-Cx0SXnoX.mjs → SdkPreviewModeRuntime-Bs6Cwzr3.mjs} +15 -7
- package/dist/preview-next/client/{lucide-react-McYZeSMb.mjs → lucide-react-00FF_oar.mjs} +13 -1
- package/dist/preview-next/client/{previewAssistantSlot-aqpU34WI.mjs → previewAssistantSlot-T-oDD_Dd.mjs} +5735 -2073
- package/dist/preview-next/client/{previewChromeRoot-D3Gy_Rs0.mjs → previewChromeRoot-BeukcDRy.mjs} +1 -1
- package/dist/preview-next/client/runtime.mjs +3 -3
- package/dist/preview-next/client/{sdk-runtime-Dzx_RrN7.mjs → sdk-runtime-ceDW_9q2.mjs} +2 -2
- package/dist/preview-next/client/{siteStyleAccess-LHedw83e.mjs → siteStyleAccess-CCB9bScO.mjs} +35 -23
- package/dist/preview-next/client/{useAutosaveStatus-DpSd9aVk.mjs → useAutosaveStatus-D4o0CKq7.mjs} +1 -1
- package/dist/preview-next/client/{useOpenBlockForSetup-BGZn5AT1.mjs → useOpenBlockForSetup-Seccrvwu.mjs} +2 -2
- package/dist/preview-next/container-responsive.css +103 -10
- package/dist/preview-next/keepAlive.mjs +1 -1
- package/dist/preview-next/middleware.mjs +1 -1
- package/dist/preview-next/{route-contract-DnL-FgSV.mjs → route-contract-FwFj8zGL.mjs} +43 -0
- package/dist/server/{Block.shared-BEbq6EwO.mjs → Block.shared-D6WrRCxX.mjs} +4 -4
- package/dist/server/{ThemeScopeCore-DFEM1a85.mjs → ThemeScopeCore-BQzjDQ2q.mjs} +8 -1
- package/dist/server/{bindings-Bly0dRs7.mjs → bindings-CS6ih1Yc.mjs} +4 -4
- package/dist/server/{client-CGJ2ztYp.mjs → client-m0ylCj_f.mjs} +847 -786
- package/dist/server/config-validation.mjs +1 -1
- package/dist/server/config.mjs +2 -2
- package/dist/server/data/resolveBlockData.mjs +1 -1
- package/dist/server/index.mjs +2 -2
- package/dist/server/{loadContent-BkK1w3QQ.mjs → loadContent-vgWMz1uD.mjs} +6 -4
- package/dist/server/{loadPage-DTLe0FEs.mjs → loadPage-CIOL3-9t.mjs} +3 -3
- package/dist/server/{lookMediaFrame-CaH018pK.mjs → lookMediaFrame-m-91jGGn.mjs} +36 -0
- package/dist/server/next.mjs +43 -30
- package/dist/server/{overrideResolution-Uy9Zp2Ks.mjs → overrideResolution-BiHmsvTZ.mjs} +1 -1
- package/dist/server/page-converter.mjs +1 -1
- package/dist/server/{pageRenderPlan-JzxBnqfV.mjs → pageRenderPlan-DJo_obpi.mjs} +9 -7
- package/dist/server/{pageRuntimeSupport-DyNSd2Yj.mjs → pageRuntimeSupport-BnSuoHON.mjs} +5 -1
- package/dist/server/{pageShared-DU4ETFPS.mjs → pageShared-BJuOzxzn.mjs} +550 -258
- package/dist/server/{prebuild-8jNtDXmS.mjs → prebuild-Cr8p8T7V.mjs} +1 -1
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/{prefetchBlockData-xeMG42aw.mjs → prefetchBlockData-BZh57-ua.mjs} +4 -3
- package/dist/server/{registry-DH1VrsCl.mjs → registry-CvhFwbXJ.mjs} +240 -80
- package/dist/server/rendering/components/pageShared.mjs +1 -1
- package/dist/server/rendering/helpers/loadPage.mjs +1 -1
- package/dist/server/rendering/helpers/pageRuntimeSupport.mjs +1 -1
- package/dist/server/rendering/server.mjs +4 -4
- package/dist/server/rendering.mjs +8 -8
- package/dist/server/{resolveBlockData-BN8tweTx.mjs → resolveBlockData-Cv_W1LVB.mjs} +39 -31
- package/dist/server/{resolvePageContent-DnM16_f9.mjs → resolvePageContent-BWKUZUIn.mjs} +1 -1
- package/dist/server/{responseMedia-F-ElH2Rd.mjs → responseMedia-KRKguBC5.mjs} +56 -1
- package/dist/server/routing.mjs +1 -1
- package/dist/server/server.mjs +3 -3
- package/dist/server/{servicePageContent-B-FezJmH.mjs → servicePageContent-CRKbTm_7.mjs} +14 -10
- package/dist/server/theme-bridge.mjs +1 -1
- package/dist/server/{validation-3jOzYdPL.mjs → validation-DCl-FCk_.mjs} +4 -4
- package/dist/server/{version-8t0o6_jd.mjs → version-DT_R5JAR.mjs} +1 -1
- package/dist/styles/index.css +504 -27
- package/package.json +1 -1
- package/dist/client/constants-4o4_hl34.mjs +0 -6
package/dist/client/{EventRegistrationPayment-DqtX1vB2.mjs → EventRegistrationPayment-DiD9uYs6.mjs}
RENAMED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { f as err, p as ok } from "./renderableMediaAssetAdmission-BlfqYLJW.mjs";
|
|
3
|
-
import { $ as
|
|
4
|
-
import {
|
|
3
|
+
import { $ as withOfferedEvent, $o as decideSelectionAttendance, A as visitorHoldsOwnPlace, At as eventSignInRestoration, B as calculateEventRegistrationPreviewTotal, Bi as toBookingQuestionsPaymentSnapshot, Bt as withoutKeptAnswers, Cn as selectionCombinationHint, Cr as formatCommercePrice, Ct as getRegistrationStartAt, D as resolveRegistrationTicketContinuation, Da as leavePage, Dn as findSelectedTicketType, Dt as EVENT_SIGN_IN_FORM_ID, En as serverPricedTotalCents, Et as toWholeSeriesRegistrationEvents, Ft as deriveRunRequirements, Gn as getTicketSelectionRemainingPlaces, Gt as decideSelectionPayment, Hi as formatPrice, Hn as getRegistrationOccurrenceId, Hr as resolveEventRegistrationChoices, Ii as deriveBookingQuestions, In as getVisibleTicketTypes, It as nextRunToRead, J as restorableBrowserDraftCode, Jn as shouldLoadRegistrationOptions, Jt as planSelectionPrice, K as registrationBrowserDraft, Kn as parseCurrencyInputToCents, Kt as effectiveSelection, Li as needsBookingQuestionsRefresh, Lr as closedDatesCopy, Lt as runFieldErrors, Mt as buildSelectionRequirementsSubmission, Nn as getImplicitSingleTicketType, Nt as checkRunRequirements, On as formatBookingWhen, Ot as eventSignInDraftStore, P as resolveEventRegistrationSubmitPlan, Pn as getPortalSubjectEmail, Pt as decideSelectionRequirementsLayout, Q as invitationBooking, Rn as transformRegistrationOptionsResponse, Rr as closedRunCopy, Rt as runsKeepingAnswers, S as planRegistrationDetailsContinuation, Sn as paymentCaption, T as resolveRegistrationAdmission, Ta as PAGE_NAVIGATION, Tn as selectionPreviewLines, U as paymentChoiceDetails, Un as getSlidingScaleForEvent, Ur as resolveEventRegistrationScopedEvents, Vi as formatCentsAsCurrencyInput, Vn as getCurrentTicketSelection, Vt as paymentReturnRestoration, W as paymentChoicePrice, Wn as getSlidingScaleSelectionMessage, Wt as canToggleSelectionItem, X as createRegistrationDraftData, Xt as quoteReductions, Y as beginWaitlistInvitation, Yn as withRegistrationAvailability, Yt as primarySelectionItem, Z as invitationSubmission, Zn as getSingleSelectedPricingOptionId, Zt as registrationSelectionMode, _n as toggleSelectionItem, _t as roomSubmission, a as registrationPresentation, at as resolveRouteRequiresPayment, bn as combinationOffersOf, bt as toWaitlistClaimResolveFailure, cs as getStripeMinimumChargeRequirement, ct as validateFormData, d as decideEventChoice, ds as orderedLiveRunSessions, dt as dayOptionsOf, et as buildRegistrationSelectionRequest, f as isRegistrationLocked, fn as selectionTicketInputs, fs as resolveWholeSeriesBookingPhase, ft as decideRoomStay, gn as summariseSelectionPayment, gr as appliedDiscountHint, gs as resolveBookingSignupOffer, gt as roomChoiceMessage, h as decideEventRegistrationPayment, hn as severalRunsChoiceMessage, ht as presentRoomChooser, i as registrationPaymentRoute, is as planCheckoutPaymentFlow, it as resolveRegistrationTarget, jt as toEventSignInDraft, k as severalRunsNeedCard, ka as requestSignIn, ks as publicEventPricingCurrency, kt as eventSignInEnds, m as buildEventRegistrationPaymentOptionsViewModel, mn as severalItemsOf, mt as isRoomChoiceRefusal, nr as normalizeTicketSelectionLines, ns as eventRegistrationErrors, nt as resolveDiscountContext, o as registrationRoute, on as selectionIncludes, ot as toRegistrationRequestSubject, p as registrationFlowReducer, pt as defaultTicketOptions, q as registrationBrowserDraftSchema, qn as resolveHeldTicketPlaces, qt as incompleteRunChoiceMessage, rs as parseEventRegistrationErrorReason, rt as resolveEventRequiresPayment, sn as selectionItemPrice, st as registrationQuestionsMessage, ti as groupPublicEventsByRun, tr as hasValidPricingOptionSelection, ts as eventRegistrationErrorEndsCommand, tt as findPreSelectedEvent, u as createInitialRegistrationFlowState, ut as bookingLines, vn as combinationHintCopy, vt as selectRoomOffer, w as resolveGuestNextStepCheck, wt as toRegistrationEvents, x as planRegistrationDetailsCheck, xn as combinationWorking, y as getTicketSelectionPurpose, yt as isSameWaitlistClaim, zr as closedDateCopy, zt as toRunRequirementsSnapshots } from "./wizardSteps-CWIQyRIw.mjs";
|
|
4
|
+
import { Tn as formatCurrencyAmount, _t as roomChoicesSchema, gt as reviewedRoomsSchema, on as inferSiteDateLocale, t as assertNever, yn as resolveBookingBusinessTimeZone } from "./src-o7WEvbK1.mjs";
|
|
5
5
|
import { o as checkBookingQuestionsAnswered } from "./creditProducts-BQ1t1erI.mjs";
|
|
6
|
-
import {
|
|
6
|
+
import { i as useSiteTermsAgreement, r as siteTermsFailureKind } from "./SiteTermsAgreementField-BAdW5DvE.mjs";
|
|
7
7
|
import { t as generateUuidV4 } from "./uuid-BETKW8rS.mjs";
|
|
8
|
-
import { i as
|
|
8
|
+
import { i as useBookingNowIso, r as parseBookingSubmissionFailure, s as indefiniteArticle } from "./BookingQuestionFields-DXegGSnS.mjs";
|
|
9
|
+
import { i as BlockApiError, n as useBlockApi } from "./context-DtKdUdkO.mjs";
|
|
10
|
+
import { n as EVENT_REGISTRATION_CHECKOUT_ATTEMPT_PARAM, r as paidInFullNote, t as EVENT_REGISTRATION_ANCHOR_ID } from "./constants-PfYJsEZF.mjs";
|
|
9
11
|
import { t as resolveDedicatedBookingHref } from "./bookingRoute-D6DlxYx6.mjs";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { t as
|
|
14
|
-
import { a as usePolling, c as useBookingQuestionsRefresh, o as portalSessionIdentity, s as useSignInReturn } from "./BookingMailingListNote-BsbEgagJ.mjs";
|
|
15
|
-
import { s as storeDemoBookingPass, t as CUSTOMER_PORTAL_PATH } from "./demoPortalMagicLink-D0kOJYOX.mjs";
|
|
12
|
+
import { i as discountEmailProblem } from "./DemoBookingPortalAccess-0Ua44F1j.mjs";
|
|
13
|
+
import { t as useDiscountCodeUi } from "./useDiscountCodeUi-BcFQRI_7.mjs";
|
|
14
|
+
import { c as portalSessionIdentity, l as useSignInReturn, s as usePolling, u as useBookingQuestionsRefresh } from "./BookingMailingListNote-CGxg37zx.mjs";
|
|
15
|
+
import { s as storeDemoBookingPass, t as CUSTOMER_PORTAL_PATH } from "./demoPortalMagicLink-B8eDjhuG.mjs";
|
|
16
16
|
import { Suspense, lazy, useCallback, useEffect, useMemo, useReducer, useRef, useState, useSyncExternalStore } from "react";
|
|
17
17
|
import { jsx } from "react/jsx-runtime";
|
|
18
18
|
import { z } from "zod";
|
|
@@ -244,6 +244,238 @@ function planEventRegistrationSurface(input) {
|
|
|
244
244
|
} : { kind: "unavailableWholeSeries" };
|
|
245
245
|
}
|
|
246
246
|
//#endregion
|
|
247
|
+
//#region ../blocks/src/system/runtime/nodes/event-registration/useSelectionFunding.state.ts
|
|
248
|
+
/**
|
|
249
|
+
* How the dates are paid, one date or several (issue 1767, sets 6 and 7). The server
|
|
250
|
+
* plans every option, its order and the one to select; the block keeps which one
|
|
251
|
+
* the visitor picked and sends that option back with the split it showed.
|
|
252
|
+
*/
|
|
253
|
+
/** The pass or membership an entitlement option uses, as the server names it on submit. */
|
|
254
|
+
function entitlementSource(entitlement) {
|
|
255
|
+
switch (entitlement.kind) {
|
|
256
|
+
case "ownedPass": return {
|
|
257
|
+
kind: "ownedPass",
|
|
258
|
+
passId: entitlement.passId
|
|
259
|
+
};
|
|
260
|
+
case "ownedMembership": return {
|
|
261
|
+
kind: "ownedMembership",
|
|
262
|
+
membershipId: entitlement.membershipId
|
|
263
|
+
};
|
|
264
|
+
case "buyPass": return {
|
|
265
|
+
kind: "buyPass",
|
|
266
|
+
productId: entitlement.productId
|
|
267
|
+
};
|
|
268
|
+
case "buyMembership": return {
|
|
269
|
+
kind: "buyMembership",
|
|
270
|
+
productId: entitlement.productId
|
|
271
|
+
};
|
|
272
|
+
default: return assertNever(entitlement);
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
function sourceKey(source) {
|
|
276
|
+
switch (source.kind) {
|
|
277
|
+
case "ownedPass": return `ownedPass:${source.passId}`;
|
|
278
|
+
case "ownedMembership": return `ownedMembership:${source.membershipId}`;
|
|
279
|
+
case "buyPass": return `buyPass:${source.productId}`;
|
|
280
|
+
case "buyMembership": return `buyMembership:${source.productId}`;
|
|
281
|
+
default: return assertNever(source);
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
/** One key per option, so a pick survives a refetch that still offers it. */
|
|
285
|
+
function fundingPickKey(pick) {
|
|
286
|
+
switch (pick.kind) {
|
|
287
|
+
case "money": return "money";
|
|
288
|
+
case "entitlement": return sourceKey(pick.source);
|
|
289
|
+
default: return assertNever(pick);
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
function fundingOptionPick(option) {
|
|
293
|
+
switch (option.kind) {
|
|
294
|
+
case "money": return { kind: "money" };
|
|
295
|
+
case "entitlement": return {
|
|
296
|
+
kind: "entitlement",
|
|
297
|
+
source: entitlementSource(option.entitlement)
|
|
298
|
+
};
|
|
299
|
+
default: return assertNever(option);
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
function fundingOptionKey(option) {
|
|
303
|
+
return fundingPickKey(fundingOptionPick(option));
|
|
304
|
+
}
|
|
305
|
+
function findOption(funding, pick) {
|
|
306
|
+
const key = fundingPickKey(pick);
|
|
307
|
+
return funding.options.find((option) => fundingOptionKey(option) === key);
|
|
308
|
+
}
|
|
309
|
+
/** The picked option, or the server's own selection when the pick isn't offered. */
|
|
310
|
+
function chosenFundingOption(funding, pick) {
|
|
311
|
+
return findOption(funding, pick) ?? findOption(funding, funding.selected) ?? funding.options[0];
|
|
312
|
+
}
|
|
313
|
+
/** The dates the option charges money for, earliest first. */
|
|
314
|
+
function fundingMoneyDates(option) {
|
|
315
|
+
switch (option.kind) {
|
|
316
|
+
case "money": return option.moneyDates;
|
|
317
|
+
case "entitlement": return option.uncovered.map((date) => date.occurrenceId);
|
|
318
|
+
default: return assertNever(option);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
/** What submit sends: the option's source and the split the visitor saw. */
|
|
322
|
+
function fundingChoice(option) {
|
|
323
|
+
switch (option.kind) {
|
|
324
|
+
case "money": return { kind: "money" };
|
|
325
|
+
case "entitlement": return {
|
|
326
|
+
kind: "entitlement",
|
|
327
|
+
source: entitlementSource(option.entitlement),
|
|
328
|
+
expected: {
|
|
329
|
+
covered: [...option.covered],
|
|
330
|
+
moneyDates: [...fundingMoneyDates(option)]
|
|
331
|
+
}
|
|
332
|
+
};
|
|
333
|
+
default: return assertNever(option);
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
/**
|
|
337
|
+
* The options request for the dates of one event, one date or several; null
|
|
338
|
+
* for anything else, which keeps its own payment step. A waitlist claim asks the
|
|
339
|
+
* same way: the claim admits the held place, and the funding pays for it.
|
|
340
|
+
*/
|
|
341
|
+
function selectionFundingRequest(input) {
|
|
342
|
+
const selection = input.target?.selection;
|
|
343
|
+
if (selection?.kind !== "dates") return null;
|
|
344
|
+
const eventSeriesId = datesSeries(selection, input.eventSeriesId);
|
|
345
|
+
const lines = normalizeTicketSelectionLines(input.ticketSelections);
|
|
346
|
+
if (!eventSeriesId || lines.length === 0) return null;
|
|
347
|
+
return {
|
|
348
|
+
subject: {
|
|
349
|
+
kind: "dates",
|
|
350
|
+
eventSeriesId,
|
|
351
|
+
occurrenceIds: selection.occurrenceIds,
|
|
352
|
+
...input.attendanceMode ? { attendanceMode: input.attendanceMode } : {}
|
|
353
|
+
},
|
|
354
|
+
selections: lines.map(({ pricingOptionId, quantity }) => ({
|
|
355
|
+
pricingOptionId,
|
|
356
|
+
quantity
|
|
357
|
+
})),
|
|
358
|
+
...input.selectedSlidingAmount !== null ? { selectedSlidingAmount: input.selectedSlidingAmount } : {}
|
|
359
|
+
};
|
|
360
|
+
}
|
|
361
|
+
/** Several dates name their series; one date's comes from the event being booked. */
|
|
362
|
+
function datesSeries(selection, eventSeriesId) {
|
|
363
|
+
return selection.eventSeriesId ?? (selection.occurrenceIds.length === 1 ? eventSeriesId : null);
|
|
364
|
+
}
|
|
365
|
+
/**
|
|
366
|
+
* What the quote prices for the dates: nothing while the ways to pay are on their way or when the
|
|
367
|
+
* visitor's own pass or membership covers every date, and otherwise the chosen option's whole order,
|
|
368
|
+
* which the server funds and prices itself. Null for anything that isn't dates. One date paid with
|
|
369
|
+
* money keeps its own booking's quote, so its card options, deposits and automatic discount stay
|
|
370
|
+
* as they are, and it waits for nothing.
|
|
371
|
+
*/
|
|
372
|
+
function selectionDatesQuote(lookup, request) {
|
|
373
|
+
if (request === null) return null;
|
|
374
|
+
const oneDate = request.subject.occurrenceIds.length === 1;
|
|
375
|
+
switch (lookup.tag) {
|
|
376
|
+
case "idle": return null;
|
|
377
|
+
case "loading":
|
|
378
|
+
case "failed": return oneDate ? null : { kind: "waiting" };
|
|
379
|
+
case "loaded": {
|
|
380
|
+
const option = chosenFundingOption(lookup.funding, lookup.pick);
|
|
381
|
+
if (oneDate && option.kind === "money") return null;
|
|
382
|
+
return ownCoverPaysEveryDate(option) ? { kind: "nothingToPay" } : {
|
|
383
|
+
kind: "order",
|
|
384
|
+
selection: {
|
|
385
|
+
...request,
|
|
386
|
+
funding: fundingChoice(option)
|
|
387
|
+
}
|
|
388
|
+
};
|
|
389
|
+
}
|
|
390
|
+
default: return assertNever(lookup);
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
/** A pass or membership the visitor already has, covering every date: submit books them with no order. */
|
|
394
|
+
function ownCoverPaysEveryDate(option) {
|
|
395
|
+
if (option.kind === "money" || option.uncovered.length > 0) return false;
|
|
396
|
+
switch (option.entitlement.kind) {
|
|
397
|
+
case "ownedPass":
|
|
398
|
+
case "ownedMembership": return true;
|
|
399
|
+
case "buyPass":
|
|
400
|
+
case "buyMembership": return false;
|
|
401
|
+
default: return assertNever(option.entitlement);
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
/**
|
|
405
|
+
* One date with nothing but money to offer, no note and no change to explain keeps
|
|
406
|
+
* the card step it always had; anything else shows the ways to pay.
|
|
407
|
+
*/
|
|
408
|
+
function cardStepServesDates(lookup, dateCount) {
|
|
409
|
+
if (dateCount !== 1 || lookup.tag !== "loaded" || lookup.notice !== null) return false;
|
|
410
|
+
const { options, entitlementNote } = lookup.funding;
|
|
411
|
+
return options.length === 1 && options[0].kind === "money" && entitlementNote === "none";
|
|
412
|
+
}
|
|
413
|
+
/** The option the visitor has chosen, once the options are in. */
|
|
414
|
+
function lookupChosenOption(lookup) {
|
|
415
|
+
return lookup.tag === "loaded" ? chosenFundingOption(lookup.funding, lookup.pick) : null;
|
|
416
|
+
}
|
|
417
|
+
/** What the visitor is looking at now, for a quote or submit to say which options it was about. */
|
|
418
|
+
function selectionFundingBasis(lookup) {
|
|
419
|
+
return lookup.tag === "loaded" ? {
|
|
420
|
+
requestKey: lookup.requestKey,
|
|
421
|
+
pickKey: fundingPickKey(lookup.pick)
|
|
422
|
+
} : null;
|
|
423
|
+
}
|
|
424
|
+
const initialSelectionFundingLookup = { tag: "idle" };
|
|
425
|
+
function settles(state, requestKey) {
|
|
426
|
+
return state.tag === "loading" && state.requestKey === requestKey;
|
|
427
|
+
}
|
|
428
|
+
function stillCurrent(state, basis) {
|
|
429
|
+
const now = selectionFundingBasis(state);
|
|
430
|
+
return now !== null && basis !== null && now.requestKey === basis.requestKey && now.pickKey === basis.pickKey;
|
|
431
|
+
}
|
|
432
|
+
function selectionFundingReducer(state, action) {
|
|
433
|
+
switch (action.type) {
|
|
434
|
+
case "loading": return {
|
|
435
|
+
tag: "loading",
|
|
436
|
+
requestKey: action.requestKey
|
|
437
|
+
};
|
|
438
|
+
case "loaded": return settles(state, action.requestKey) ? {
|
|
439
|
+
tag: "loaded",
|
|
440
|
+
requestKey: action.requestKey,
|
|
441
|
+
funding: action.funding,
|
|
442
|
+
pick: action.funding.selected,
|
|
443
|
+
notice: null
|
|
444
|
+
} : state;
|
|
445
|
+
case "failed": return settles(state, action.requestKey) ? {
|
|
446
|
+
tag: "failed",
|
|
447
|
+
requestKey: action.requestKey
|
|
448
|
+
} : state;
|
|
449
|
+
case "picked": return state.tag === "loaded" && findOption(state.funding, action.pick) ? {
|
|
450
|
+
...state,
|
|
451
|
+
pick: action.pick,
|
|
452
|
+
notice: null
|
|
453
|
+
} : state;
|
|
454
|
+
case "changed": return stillCurrent(state, action.basis) ? {
|
|
455
|
+
tag: "loaded",
|
|
456
|
+
requestKey: state.requestKey,
|
|
457
|
+
funding: action.funding,
|
|
458
|
+
pick: action.funding.selected,
|
|
459
|
+
notice: action.message
|
|
460
|
+
} : state;
|
|
461
|
+
case "reset": return initialSelectionFundingLookup;
|
|
462
|
+
default: return assertNever(action);
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
/** The lookup for this request: another request's answer, or none yet, is still loading. */
|
|
466
|
+
function currentSelectionFundingLookup(state, requestKey) {
|
|
467
|
+
if (requestKey === null) return initialSelectionFundingLookup;
|
|
468
|
+
if (state.tag !== "idle" && state.requestKey === requestKey) return state;
|
|
469
|
+
return {
|
|
470
|
+
tag: "loading",
|
|
471
|
+
requestKey
|
|
472
|
+
};
|
|
473
|
+
}
|
|
474
|
+
/** Whether the hook should ask the server now. */
|
|
475
|
+
function selectionFundingFetchWanted(state, requestKey, enabled) {
|
|
476
|
+
return enabled && requestKey !== null && (state.tag === "idle" || state.requestKey !== requestKey);
|
|
477
|
+
}
|
|
478
|
+
//#endregion
|
|
247
479
|
//#region ../blocks/src/system/runtime/nodes/event-registration/registrationDiscountView.state.ts
|
|
248
480
|
/** The quote owns the code for one booking or several; one booking still finds out what's on offer from availability. */
|
|
249
481
|
function registrationDiscountView(input) {
|
|
@@ -271,29 +503,22 @@ function registrationDiscountView(input) {
|
|
|
271
503
|
}
|
|
272
504
|
/** A draft code must remain editable while its price is unresolved and payment choices are disabled. */
|
|
273
505
|
function registrationDiscountEntryVisible(view, method) {
|
|
274
|
-
return
|
|
506
|
+
return method === "membership" || view.manualCodeEntryAllowed || view.editingCode;
|
|
507
|
+
}
|
|
508
|
+
/** Typed codes belong to the money choice, including when a pass leaves a card remainder. */
|
|
509
|
+
function registrationDiscountCardOnly(method, funding) {
|
|
510
|
+
return method === "membership" || funding.tag === "loaded" && chosenFundingOption(funding.funding, funding.pick).kind === "entitlement";
|
|
275
511
|
}
|
|
276
512
|
//#endregion
|
|
277
513
|
//#region ../blocks/src/system/runtime/nodes/event-registration/registrationDiscountCode.state.ts
|
|
278
514
|
const NO_REDUCTION = {
|
|
279
515
|
bookingTotalCents: null,
|
|
280
|
-
automaticDiscount: null
|
|
281
|
-
passTotalCents: null,
|
|
282
|
-
membershipFirstPaymentCents: null
|
|
516
|
+
automaticDiscount: null
|
|
283
517
|
};
|
|
284
518
|
function decideSingleBookingPrices(input) {
|
|
285
519
|
const { context, quote } = input;
|
|
286
520
|
if (input.several || !context) return NO_REDUCTION;
|
|
287
|
-
|
|
288
|
-
if (!quote) return NO_REDUCTION;
|
|
289
|
-
if (context.type === "pass") return {
|
|
290
|
-
...NO_REDUCTION,
|
|
291
|
-
passTotalCents: reducedTotal(quote)
|
|
292
|
-
};
|
|
293
|
-
return context.type === "membership" ? {
|
|
294
|
-
...NO_REDUCTION,
|
|
295
|
-
membershipFirstPaymentCents: reducedTotal(quote)
|
|
296
|
-
} : NO_REDUCTION;
|
|
521
|
+
return context.type === "event" || context.type === "whole_series" ? eventPrices(input, quote) : NO_REDUCTION;
|
|
297
522
|
}
|
|
298
523
|
function eventPrices(input, quote) {
|
|
299
524
|
if (!quote) return input.typedCode.trim() || input.lookupFailed ? NO_REDUCTION : {
|
|
@@ -313,9 +538,6 @@ function eventPrices(input, quote) {
|
|
|
313
538
|
automaticDiscount: automaticFromQuote(quote.preview, input.advertisedAutomatic)
|
|
314
539
|
};
|
|
315
540
|
}
|
|
316
|
-
function reducedTotal(quote) {
|
|
317
|
-
return quote.preview.type === "applied" ? quote.preview.totalAfterDiscountCents : null;
|
|
318
|
-
}
|
|
319
541
|
/** The discount the server chose for this customer, which may not be the one advertised to everyone. */
|
|
320
542
|
function automaticFromQuote(preview, advertised) {
|
|
321
543
|
const shared = {
|
|
@@ -336,21 +558,11 @@ function automaticFromQuote(preview, advertised) {
|
|
|
336
558
|
};
|
|
337
559
|
}
|
|
338
560
|
/** What an applied code does to this purchase, said beside the code. */
|
|
339
|
-
function appliedCodeHint(
|
|
340
|
-
|
|
341
|
-
if (selection.method !== "membership_bundle") return appliedDiscountHint({
|
|
561
|
+
function appliedCodeHint(discount) {
|
|
562
|
+
return discount ? appliedDiscountHint({
|
|
342
563
|
...discount,
|
|
343
564
|
membership: null
|
|
344
|
-
}) ?? "";
|
|
345
|
-
const { productPrice, productInterval } = selection;
|
|
346
|
-
if (!productPrice || productInterval !== "month" && productInterval !== "year") return "";
|
|
347
|
-
return appliedDiscountHint({
|
|
348
|
-
...discount,
|
|
349
|
-
membership: {
|
|
350
|
-
priceCents: productPrice,
|
|
351
|
-
billingInterval: productInterval
|
|
352
|
-
}
|
|
353
|
-
}) ?? "";
|
|
565
|
+
}) ?? "" : "";
|
|
354
566
|
}
|
|
355
567
|
/** Holds Pay for a code awaiting Apply, and says whether that's the only thing holding it. */
|
|
356
568
|
function holdPaymentForCode(state, awaitingApply) {
|
|
@@ -489,7 +701,7 @@ function getRegistrationBrowserDraft(scope) {
|
|
|
489
701
|
try {
|
|
490
702
|
const stored = sessionStorage.getItem(`riverbank:event-draft:${scope}`);
|
|
491
703
|
const entry = browserDraftEntry.safeParse(stored ? JSON.parse(stored) : null);
|
|
492
|
-
if (entry.success && Date.now() - entry.data.timestamp <=
|
|
704
|
+
if (entry.success && Date.now() - entry.data.timestamp <= 108e5) return entry.data.draft;
|
|
493
705
|
clearRegistrationBrowserDraft(scope);
|
|
494
706
|
} catch {}
|
|
495
707
|
return null;
|
|
@@ -510,32 +722,10 @@ const paymentSelection = z.discriminatedUnion("method", [
|
|
|
510
722
|
"flexible_balance"
|
|
511
723
|
])
|
|
512
724
|
}),
|
|
513
|
-
z.object({
|
|
514
|
-
method: z.literal("pass"),
|
|
515
|
-
passId: z.string(),
|
|
516
|
-
productName: z.string().optional()
|
|
517
|
-
}),
|
|
518
725
|
z.object({
|
|
519
726
|
method: z.literal("membership"),
|
|
520
727
|
membershipId: z.string(),
|
|
521
728
|
productName: z.string().optional()
|
|
522
|
-
}),
|
|
523
|
-
z.object({
|
|
524
|
-
method: z.literal("pass_bundle"),
|
|
525
|
-
bundlePassId: z.string(),
|
|
526
|
-
productName: z.string().optional(),
|
|
527
|
-
productDescription: z.string().optional(),
|
|
528
|
-
productPrice: z.number().optional(),
|
|
529
|
-
productCurrency: z.string().optional()
|
|
530
|
-
}),
|
|
531
|
-
z.object({
|
|
532
|
-
method: z.literal("membership_bundle"),
|
|
533
|
-
bundleMembershipId: z.string(),
|
|
534
|
-
productName: z.string().optional(),
|
|
535
|
-
productDescription: z.string().optional(),
|
|
536
|
-
productPrice: z.number().optional(),
|
|
537
|
-
productCurrency: z.string().optional(),
|
|
538
|
-
productInterval: z.string().optional()
|
|
539
729
|
})
|
|
540
730
|
]);
|
|
541
731
|
const reference = z.discriminatedUnion("scope", [z.object({
|
|
@@ -574,7 +764,15 @@ const currentSchema = z.object({
|
|
|
574
764
|
runChoices: z.record(z.string(), z.object({
|
|
575
765
|
pricingOptionId: z.string().nullable(),
|
|
576
766
|
slidingAmountInput: z.string()
|
|
577
|
-
})).optional()
|
|
767
|
+
})).optional(),
|
|
768
|
+
rooms: z.object({
|
|
769
|
+
choices: roomChoicesSchema,
|
|
770
|
+
reviewed: reviewedRoomsSchema.default([]),
|
|
771
|
+
dayLines: z.array(z.object({
|
|
772
|
+
pricingOptionId: z.string().nullable(),
|
|
773
|
+
quantity: z.number().int().positive()
|
|
774
|
+
}))
|
|
775
|
+
}).optional()
|
|
578
776
|
});
|
|
579
777
|
/** Saved before booking several existed: one reference and one event. */
|
|
580
778
|
const version6Schema = z.object({
|
|
@@ -651,7 +849,7 @@ function hasRegistrationReturn(flow) {
|
|
|
651
849
|
const params = new URLSearchParams(window.location.search);
|
|
652
850
|
return flow.invitation.kind !== "none" || params.has("registration") || params.has("rb_booking_sign_in");
|
|
653
851
|
}
|
|
654
|
-
/** Only the allowlisted
|
|
852
|
+
/** Only the allowlisted draft (`registrationBrowserDraftSchema`) survives a reload in this tab. */
|
|
655
853
|
function useRegistrationBrowserDraft(input) {
|
|
656
854
|
const [ready, setReady] = useState(false);
|
|
657
855
|
const restored = useRef(false);
|
|
@@ -663,7 +861,8 @@ function useRegistrationBrowserDraft(input) {
|
|
|
663
861
|
input.dispatch({
|
|
664
862
|
type: "browser-draft-restored",
|
|
665
863
|
draft: saved,
|
|
666
|
-
events: input.events
|
|
864
|
+
events: input.events,
|
|
865
|
+
identity: input.identity
|
|
667
866
|
});
|
|
668
867
|
const code = restorableBrowserDraftCode(saved, input.events);
|
|
669
868
|
if (code.trim()) input.onDiscountCodeRestored(code);
|
|
@@ -682,7 +881,7 @@ function useSaveRegistrationBrowserDraft(input) {
|
|
|
682
881
|
return;
|
|
683
882
|
}
|
|
684
883
|
if (hasRegistrationReturn(input.flow)) return;
|
|
685
|
-
const draft = registrationBrowserDraft(input.flow, input.discountCode);
|
|
884
|
+
const draft = registrationBrowserDraft(input.flow, input.discountCode, input.identity);
|
|
686
885
|
if (draft) saveRegistrationBrowserDraft(input.scope, draft);
|
|
687
886
|
}, [input, ready]);
|
|
688
887
|
}
|
|
@@ -1076,7 +1275,7 @@ function useRunQuestionsRefresh(input) {
|
|
|
1076
1275
|
}
|
|
1077
1276
|
//#endregion
|
|
1078
1277
|
//#region ../blocks/src/system/runtime/nodes/event-registration/useTicketSelectionInitialization.ts
|
|
1079
|
-
/** Pick the single default once; removing or refreshing a line never picks it again. */
|
|
1278
|
+
/** Pick the single default once; removing or refreshing a line never picks it again. An event with rooms passes no options: its guests choose. */
|
|
1080
1279
|
function useTicketSelectionInitialization(input) {
|
|
1081
1280
|
const initializedSelection = useRef(null);
|
|
1082
1281
|
useEffect(() => {
|
|
@@ -1264,7 +1463,7 @@ async function loadEligibility(input) {
|
|
|
1264
1463
|
input.dispatch({
|
|
1265
1464
|
type: "failed",
|
|
1266
1465
|
requestKey: input.requestKey,
|
|
1267
|
-
message: "We couldn’t load the booking options for this event.
|
|
1466
|
+
message: "We couldn’t load the booking options for this event. Try again, or contact the organiser if this keeps happening."
|
|
1268
1467
|
});
|
|
1269
1468
|
}
|
|
1270
1469
|
}
|
|
@@ -1590,6 +1789,23 @@ function registrationErrorPresentation(failure, bookings = "one") {
|
|
|
1590
1789
|
};
|
|
1591
1790
|
}
|
|
1592
1791
|
//#endregion
|
|
1792
|
+
//#region ../blocks/src/system/runtime/nodes/event-registration/eventRegistrationFunding.ts
|
|
1793
|
+
/**
|
|
1794
|
+
* How a whole run is paid on the wire. Dates send the server's funding option
|
|
1795
|
+
* instead (issue 1767), so a run is the only booking that names a method.
|
|
1796
|
+
*/
|
|
1797
|
+
function toEventRunPayment(choice) {
|
|
1798
|
+
switch (choice.method) {
|
|
1799
|
+
case "free":
|
|
1800
|
+
case "stripe": return { paymentMethod: choice.method };
|
|
1801
|
+
case "membership": return {
|
|
1802
|
+
paymentMethod: "membership",
|
|
1803
|
+
customerMembershipId: choice.membershipId
|
|
1804
|
+
};
|
|
1805
|
+
default: return assertNever(choice.method);
|
|
1806
|
+
}
|
|
1807
|
+
}
|
|
1808
|
+
//#endregion
|
|
1593
1809
|
//#region ../blocks/src/system/runtime/nodes/event-registration/useEventRegistrationSubmit.ts
|
|
1594
1810
|
function wantsMailingListSignup(options) {
|
|
1595
1811
|
return options.mailingListSignup !== null && options.formData.mailingListOptIn === true;
|
|
@@ -1647,20 +1863,20 @@ function useEventRegistrationSubmitWithDeps(options, deps) {
|
|
|
1647
1863
|
*/
|
|
1648
1864
|
const { commandRef } = options;
|
|
1649
1865
|
const inFlightRef = useRef(null);
|
|
1650
|
-
const submit = async (method,
|
|
1866
|
+
const submit = async (method, membershipId, selection) => {
|
|
1651
1867
|
const start = resolveSubmissionStart(options);
|
|
1652
1868
|
if (start.kind === "blocked") return start.result;
|
|
1653
1869
|
const { invitation, target } = start;
|
|
1654
1870
|
options.setStep("submitting");
|
|
1655
1871
|
const registrationCommandId = commandRef.current?.id ?? deps.createClientCommandId();
|
|
1656
1872
|
try {
|
|
1657
|
-
const initialPrepared = prepareSubmitContext(options, registrationCommandId, target, method,
|
|
1658
|
-
const intentKey = registrationRequestIntentKey(buildRegistrationRequest(options, initialPrepared, invitation, method,
|
|
1873
|
+
const initialPrepared = prepareSubmitContext(options, registrationCommandId, target, method, membershipId, selection);
|
|
1874
|
+
const intentKey = registrationRequestIntentKey(buildRegistrationRequest(options, initialPrepared, invitation, method, membershipId));
|
|
1659
1875
|
const prepared = commandRef.current !== null && commandRef.current.intentKey !== intentKey ? {
|
|
1660
1876
|
...initialPrepared,
|
|
1661
1877
|
registrationCommandId: deps.createClientCommandId()
|
|
1662
1878
|
} : initialPrepared;
|
|
1663
|
-
const request = buildRegistrationRequest(options, prepared, invitation, method,
|
|
1879
|
+
const request = buildRegistrationRequest(options, prepared, invitation, method, membershipId);
|
|
1664
1880
|
commandRef.current = {
|
|
1665
1881
|
id: prepared.registrationCommandId,
|
|
1666
1882
|
intentKey
|
|
@@ -1671,7 +1887,7 @@ function useEventRegistrationSubmitWithDeps(options, deps) {
|
|
|
1671
1887
|
}));
|
|
1672
1888
|
} catch (error) {
|
|
1673
1889
|
if (error instanceof BlockApiError && (eventRegistrationErrorEndsCommand(error.tag) || error.fieldErrors.some((field) => field.field === "discountCode"))) commandRef.current = null;
|
|
1674
|
-
return reportFailedRegistration(options, error
|
|
1890
|
+
return reportFailedRegistration(options, error);
|
|
1675
1891
|
}
|
|
1676
1892
|
};
|
|
1677
1893
|
return (...args) => {
|
|
@@ -1726,15 +1942,20 @@ async function completeRegistrationSubmission(options, deps, prepared, result) {
|
|
|
1726
1942
|
mailingListSignupNote: result.mailingListSignupNote
|
|
1727
1943
|
});
|
|
1728
1944
|
break;
|
|
1945
|
+
case "fundingChanged":
|
|
1946
|
+
options.commandRef.current = null;
|
|
1947
|
+
if (options.onFundingChanged) options.onFundingChanged(result.funding, result.message);
|
|
1948
|
+
else options.setErrorMessage(result.message);
|
|
1949
|
+
options.setStep("select-payment");
|
|
1950
|
+
return {
|
|
1951
|
+
ok: false,
|
|
1952
|
+
reason: "blocked",
|
|
1953
|
+
message: result.message
|
|
1954
|
+
};
|
|
1729
1955
|
case "bookingComplete":
|
|
1730
|
-
options.complete(
|
|
1731
|
-
status: "confirmed",
|
|
1732
|
-
outcome: result.outcome,
|
|
1733
|
-
...result.outcomes ? { outcomes: result.outcomes } : {},
|
|
1734
|
-
message: result.summary.passCreditsRemaining !== void 0 ? result.summary.message : void 0,
|
|
1735
|
-
mailingListSignupNote: result.mailingListSignupNote
|
|
1736
|
-
});
|
|
1956
|
+
options.complete(confirmedRegistration(result));
|
|
1737
1957
|
break;
|
|
1958
|
+
default: return assertNever(result);
|
|
1738
1959
|
}
|
|
1739
1960
|
options.commandRef.current = null;
|
|
1740
1961
|
return {
|
|
@@ -1742,6 +1963,21 @@ async function completeRegistrationSubmission(options, deps, prepared, result) {
|
|
|
1742
1963
|
outcome: { kind: "completed" }
|
|
1743
1964
|
};
|
|
1744
1965
|
}
|
|
1966
|
+
/**
|
|
1967
|
+
* A completed booking as the finished screen reads it. One booking says its pass balance in the
|
|
1968
|
+
* summary's message; several list it with how each date was paid, so the message would repeat it.
|
|
1969
|
+
*/
|
|
1970
|
+
function confirmedRegistration(result) {
|
|
1971
|
+
const { passCreditsRemaining } = result.summary;
|
|
1972
|
+
return {
|
|
1973
|
+
status: "confirmed",
|
|
1974
|
+
submissionPayment: result.submissionPayment,
|
|
1975
|
+
outcome: result.outcome,
|
|
1976
|
+
mailingListSignupNote: result.mailingListSignupNote,
|
|
1977
|
+
...result.outcomes ? { outcomes: result.outcomes } : { message: passCreditsRemaining !== void 0 ? result.summary.message : void 0 },
|
|
1978
|
+
...passCreditsRemaining !== void 0 ? { passCreditsRemaining } : {}
|
|
1979
|
+
};
|
|
1980
|
+
}
|
|
1745
1981
|
function toTicketSelectionRequests(lines) {
|
|
1746
1982
|
return lines.map((line) => ({
|
|
1747
1983
|
pricingOptionId: line.pricingOptionId,
|
|
@@ -1752,15 +1988,13 @@ function toTicketSelectionRequests(lines) {
|
|
|
1752
1988
|
* Freeze everything this submission is about to send, including the command
|
|
1753
1989
|
* identity the server keys the commit on.
|
|
1754
1990
|
*/
|
|
1755
|
-
function prepareSubmitContext(options, registrationCommandId, target, method,
|
|
1991
|
+
function prepareSubmitContext(options, registrationCommandId, target, method, membershipId, selection) {
|
|
1756
1992
|
const ticketSelections = normalizeTicketSelectionLines(options.ticketSelections);
|
|
1757
1993
|
if (ticketSelections.length === 0) throw new Error("Choose at least one ticket to continue.");
|
|
1758
|
-
const bundleProductId = method === "pass_bundle" || method === "membership_bundle" ? passId || membershipId : void 0;
|
|
1759
1994
|
return {
|
|
1760
1995
|
registrationCommandId,
|
|
1761
1996
|
ticketSelections,
|
|
1762
|
-
|
|
1763
|
-
selectionSnapshot: resolveSelectionSnapshot(method, passId, membershipId, bundleProductId, selection),
|
|
1997
|
+
selectionSnapshot: resolveSelectionSnapshot(method, membershipId, selection),
|
|
1764
1998
|
guestsPayload: options.requireGuestDetails && options.guests.length > 0 ? options.guests.map((guest) => ({
|
|
1765
1999
|
name: guest.name.trim(),
|
|
1766
2000
|
email: guest.email?.trim().toLowerCase() || void 0,
|
|
@@ -1775,24 +2009,12 @@ function prepareSubmitContext(options, registrationCommandId, target, method, pa
|
|
|
1775
2009
|
})
|
|
1776
2010
|
};
|
|
1777
2011
|
}
|
|
1778
|
-
function resolveSelectionSnapshot(method,
|
|
2012
|
+
function resolveSelectionSnapshot(method, membershipId, selection) {
|
|
1779
2013
|
if (selection?.method) return selection;
|
|
1780
|
-
if (method === "pass" && passId) return {
|
|
1781
|
-
method,
|
|
1782
|
-
passId
|
|
1783
|
-
};
|
|
1784
2014
|
if (method === "membership" && membershipId) return {
|
|
1785
2015
|
method,
|
|
1786
2016
|
membershipId
|
|
1787
2017
|
};
|
|
1788
|
-
if (method === "pass_bundle" && bundleProductId) return {
|
|
1789
|
-
method,
|
|
1790
|
-
bundlePassId: bundleProductId
|
|
1791
|
-
};
|
|
1792
|
-
if (method === "membership_bundle" && bundleProductId) return {
|
|
1793
|
-
method,
|
|
1794
|
-
bundleMembershipId: bundleProductId
|
|
1795
|
-
};
|
|
1796
2018
|
if (method === "free") return { method };
|
|
1797
2019
|
throw new Error("Choose an available payment option.");
|
|
1798
2020
|
}
|
|
@@ -1809,7 +2031,12 @@ function savePendingCheckout(options, deps, prepared, checkoutAttemptId, mailing
|
|
|
1809
2031
|
guests: options.guests,
|
|
1810
2032
|
selectedSlidingAmount: options.selectedSlidingAmount,
|
|
1811
2033
|
discountCode: options.discountCode,
|
|
1812
|
-
mailingListSignupNote
|
|
2034
|
+
mailingListSignupNote,
|
|
2035
|
+
...options.rooms ? { rooms: {
|
|
2036
|
+
choices: options.rooms.request.choices,
|
|
2037
|
+
reviewed: options.rooms.request.reviewed,
|
|
2038
|
+
dayLines: options.rooms.dayLines
|
|
2039
|
+
} } : {}
|
|
1813
2040
|
});
|
|
1814
2041
|
}
|
|
1815
2042
|
function registrationRequestIntentKey(request) {
|
|
@@ -1822,15 +2049,14 @@ function registrationRequestIntentKey(request) {
|
|
|
1822
2049
|
} : void 0
|
|
1823
2050
|
});
|
|
1824
2051
|
}
|
|
1825
|
-
function buildRegistrationRequest(options, prepared, invitation, method,
|
|
1826
|
-
|
|
2052
|
+
function buildRegistrationRequest(options, prepared, invitation, method, membershipId) {
|
|
2053
|
+
const common = {
|
|
1827
2054
|
registrationCommandId: prepared.registrationCommandId,
|
|
1828
2055
|
checkout: {
|
|
1829
2056
|
returnUrl: eventPaymentReturnUrl(prepared.registrationCommandId),
|
|
1830
2057
|
discountCode: options.discountCode.trim() || void 0,
|
|
1831
2058
|
collectionOptionKind: prepared.selectionSnapshot.method === "stripe" ? prepared.selectionSnapshot.collectionOptionKind : void 0
|
|
1832
2059
|
},
|
|
1833
|
-
selection: prepared.selection,
|
|
1834
2060
|
ticketSelections: toTicketSelectionRequests(prepared.ticketSelections),
|
|
1835
2061
|
selectedSlidingAmount: options.selectedSlidingAmount ?? void 0,
|
|
1836
2062
|
email: options.formData.email.trim().toLowerCase(),
|
|
@@ -1839,12 +2065,22 @@ function buildRegistrationRequest(options, prepared, invitation, method, passId,
|
|
|
1839
2065
|
notes: options.formData.notes.trim() || void 0,
|
|
1840
2066
|
...singleBookingRequirements(options, prepared),
|
|
1841
2067
|
mailingListOptIn: wantsMailingListSignup(options),
|
|
1842
|
-
paymentMethod: method,
|
|
1843
|
-
customerPassId: method === "pass" ? passId : void 0,
|
|
1844
|
-
customerMembershipId: method === "membership" ? membershipId : void 0,
|
|
1845
|
-
bundleProductId: prepared.bundleProductId,
|
|
1846
2068
|
...invitationRequestCredential(invitation.credential),
|
|
1847
|
-
guests: prepared.guestsPayload
|
|
2069
|
+
guests: prepared.guestsPayload,
|
|
2070
|
+
...options.rooms ? { rooms: options.rooms.request } : {}
|
|
2071
|
+
};
|
|
2072
|
+
const selection = prepared.selection;
|
|
2073
|
+
return selection.kind === "dates" ? {
|
|
2074
|
+
...common,
|
|
2075
|
+
selection,
|
|
2076
|
+
funding: options.selectionFunding ?? { kind: "money" }
|
|
2077
|
+
} : {
|
|
2078
|
+
...common,
|
|
2079
|
+
selection,
|
|
2080
|
+
...toEventRunPayment({
|
|
2081
|
+
method,
|
|
2082
|
+
membershipId
|
|
2083
|
+
})
|
|
1848
2084
|
};
|
|
1849
2085
|
}
|
|
1850
2086
|
/**
|
|
@@ -1865,19 +2101,30 @@ function invitationRequestCredential(credential) {
|
|
|
1865
2101
|
}
|
|
1866
2102
|
}
|
|
1867
2103
|
/** Legal rejection returns to the intact draft, before any payment effect. */
|
|
1868
|
-
function failedRegistrationStep(failure,
|
|
2104
|
+
function failedRegistrationStep(failure, funding) {
|
|
2105
|
+
if (isRoomChoiceRefusal(failure.reason)) return "select-tickets";
|
|
1869
2106
|
if (failure.discountRefused) return "select-payment";
|
|
1870
2107
|
if (failure.reason === "paymentContextMismatch") return "select-payment";
|
|
1871
2108
|
if (failure.reason === "invalidAnswers") return "enter-details";
|
|
1872
2109
|
if (!failure.siteTermsFailure) return "error";
|
|
1873
|
-
return
|
|
2110
|
+
return buysWithBooking(funding) ? "select-payment" : "enter-details";
|
|
2111
|
+
}
|
|
2112
|
+
function buysWithBooking(funding) {
|
|
2113
|
+
if (!funding || funding.kind === "money") return false;
|
|
2114
|
+
switch (funding.source.kind) {
|
|
2115
|
+
case "buyPass":
|
|
2116
|
+
case "buyMembership": return true;
|
|
2117
|
+
case "ownedPass":
|
|
2118
|
+
case "ownedMembership": return false;
|
|
2119
|
+
default: return assertNever(funding.source);
|
|
2120
|
+
}
|
|
1874
2121
|
}
|
|
1875
2122
|
function bookingCount(target) {
|
|
1876
2123
|
const selection = target?.selection;
|
|
1877
2124
|
return (selection?.kind === "runs" ? selection.eventSeriesIds.length : selection?.occurrenceIds.length ?? 1) > 1 ? "several" : "one";
|
|
1878
2125
|
}
|
|
1879
2126
|
/** Keep feedback, field errors and navigation together when a submission fails. */
|
|
1880
|
-
function reportFailedRegistration(options, error
|
|
2127
|
+
function reportFailedRegistration(options, error) {
|
|
1881
2128
|
const parsed = parseEventRegistrationFailure(error);
|
|
1882
2129
|
const { message, action } = registrationErrorPresentation(parsed, bookingCount(options.registrationTarget));
|
|
1883
2130
|
const failure = {
|
|
@@ -1889,7 +2136,8 @@ function reportFailedRegistration(options, error, method) {
|
|
|
1889
2136
|
options.setErrorAction?.(action);
|
|
1890
2137
|
options.setErrorMessage(message);
|
|
1891
2138
|
options.setSubmissionFailure(failure);
|
|
1892
|
-
|
|
2139
|
+
if (isRoomChoiceRefusal(parsed.reason)) options.refreshOptions?.();
|
|
2140
|
+
options.setStep(failedRegistrationStep(parsed, options.selectionFunding));
|
|
1893
2141
|
return {
|
|
1894
2142
|
ok: false,
|
|
1895
2143
|
reason: "submission-failed",
|
|
@@ -1918,10 +2166,21 @@ function quoteFeedback(state) {
|
|
|
1918
2166
|
message: state.preview.type === "applied" ? `${state.preview.publicLabel} applied. You'll pay ${formatCommercePrice(state.preview.totalAfterDiscountCents, state.preview.currency)}.` : ""
|
|
1919
2167
|
} : null;
|
|
1920
2168
|
}
|
|
2169
|
+
/** The request for this input, or null while there's nothing to price yet. */
|
|
2170
|
+
function selectionQuoteRequest(input) {
|
|
2171
|
+
if (input.dates !== null) switch (input.dates.kind) {
|
|
2172
|
+
case "order": return { selection: input.dates.selection };
|
|
2173
|
+
case "waiting":
|
|
2174
|
+
case "nothingToPay": return null;
|
|
2175
|
+
default: return assertNever(input.dates);
|
|
2176
|
+
}
|
|
2177
|
+
const lines = input.several !== null ? selectionPreviewLines(input) : input.singleLines.length > 0 ? input.singleLines : null;
|
|
2178
|
+
return lines ? { lines } : null;
|
|
2179
|
+
}
|
|
1921
2180
|
/** A quote belongs to the complete priced input and the customer, never just the draft code. */
|
|
1922
|
-
function selectionQuoteKey(
|
|
1923
|
-
return
|
|
1924
|
-
|
|
2181
|
+
function selectionQuoteKey(request, email, scope) {
|
|
2182
|
+
return request ? JSON.stringify([
|
|
2183
|
+
request,
|
|
1925
2184
|
email.trim().toLowerCase(),
|
|
1926
2185
|
...scope ? [scope] : []
|
|
1927
2186
|
]) : null;
|
|
@@ -1937,16 +2196,20 @@ function editedSelectionCode(state, key, draftCode) {
|
|
|
1937
2196
|
...same && state.uncoded ? { uncoded: state.uncoded } : {}
|
|
1938
2197
|
};
|
|
1939
2198
|
}
|
|
2199
|
+
/**
|
|
2200
|
+
* What one quote answer means for the selection. A changed pass or membership isn't a price at all: the
|
|
2201
|
+
* options go back to the server's revised ones, as when submit refuses the split, and the new option is
|
|
2202
|
+
* priced from there. Its state stays unpriced, so nothing is charged on the old split meanwhile.
|
|
2203
|
+
*/
|
|
2204
|
+
function decideSelectionQuoteAnswer(pending, result) {
|
|
2205
|
+
return {
|
|
2206
|
+
state: decideSelectionQuoteResponse(pending, result),
|
|
2207
|
+
fundingChanged: result.type === "fundingChanged" ? result : null
|
|
2208
|
+
};
|
|
2209
|
+
}
|
|
1940
2210
|
function decideSelectionQuoteResponse(pending, result) {
|
|
1941
2211
|
const typed = Boolean(pending.draftCode.trim());
|
|
1942
|
-
if (result.type === "rejected"
|
|
1943
|
-
...pending,
|
|
1944
|
-
status: "refused",
|
|
1945
|
-
message: result.message
|
|
1946
|
-
} : {
|
|
1947
|
-
...pending,
|
|
1948
|
-
status: "failed"
|
|
1949
|
-
};
|
|
2212
|
+
if (result.type === "rejected" || result.type === "fundingChanged") return unpricedQuote(pending, typed, result);
|
|
1950
2213
|
if (typed && result.type !== "applied") return {
|
|
1951
2214
|
...pending,
|
|
1952
2215
|
status: "failed"
|
|
@@ -1960,6 +2223,17 @@ function decideSelectionQuoteResponse(pending, result) {
|
|
|
1960
2223
|
decidedCode: typed && result.type === "applied" ? result.code : void 0
|
|
1961
2224
|
};
|
|
1962
2225
|
}
|
|
2226
|
+
/** No price: a typed code the server refused shows why; anything else, a changed pass included, is unresolved. */
|
|
2227
|
+
function unpricedQuote(pending, typed, result) {
|
|
2228
|
+
return typed && result.type === "rejected" && result.reason === "invalid_or_not_applicable" ? {
|
|
2229
|
+
...pending,
|
|
2230
|
+
status: "refused",
|
|
2231
|
+
message: result.message
|
|
2232
|
+
} : {
|
|
2233
|
+
...pending,
|
|
2234
|
+
status: "failed"
|
|
2235
|
+
};
|
|
2236
|
+
}
|
|
1963
2237
|
/**
|
|
1964
2238
|
* Whether to ask the server now, without the visitor pressing Apply: for the
|
|
1965
2239
|
* automatic code, or for a code the visitor typed before (in one item's box,
|
|
@@ -1967,28 +2241,43 @@ function decideSelectionQuoteResponse(pending, result) {
|
|
|
1967
2241
|
* as far as they know. A code typed here waits for Apply.
|
|
1968
2242
|
*/
|
|
1969
2243
|
function explicitSelectionQuoteWanted(state, input, carried = false) {
|
|
1970
|
-
if (input
|
|
1971
|
-
return input.automaticWanted && state.status === "draft" && (carried || (input
|
|
2244
|
+
if (!serverPricesTotal(input) && input.combinedPending) return false;
|
|
2245
|
+
return input.automaticWanted && state.status === "draft" && (carried || uncodedQuoteWanted(input) && !state.draftCode.trim());
|
|
1972
2246
|
}
|
|
1973
|
-
/**
|
|
2247
|
+
/**
|
|
2248
|
+
* Several items, and dates paid with a pass or membership, have no total until the server
|
|
2249
|
+
* prices their order; one booking paid by card has a price already.
|
|
2250
|
+
*/
|
|
2251
|
+
function serverPricesTotal(input) {
|
|
2252
|
+
return input.several !== null || input.dates !== null;
|
|
2253
|
+
}
|
|
2254
|
+
function uncodedQuoteWanted(input) {
|
|
2255
|
+
return serverPricesTotal(input) || input.productAutomaticOffered;
|
|
2256
|
+
}
|
|
2257
|
+
/** Nothing to price: no code or automatic discount can change a free selection, or dates the visitor's own cover pays for. */
|
|
1974
2258
|
function freeSelection(input) {
|
|
1975
|
-
return input
|
|
2259
|
+
return serverPricesTotal(input) && (input.price.listTotalCents === 0 || input.dates?.kind === "nothingToPay");
|
|
1976
2260
|
}
|
|
1977
2261
|
function selectionPayable(input, state) {
|
|
1978
|
-
if (
|
|
2262
|
+
if (!serverPricesTotal(input)) return input.price.totalCents;
|
|
2263
|
+
if (freeSelection(input)) return input.dates?.kind === "nothingToPay" ? 0 : input.price.totalCents;
|
|
1979
2264
|
if (input.payment.kind === "payment") return serverPricedTotalCents({
|
|
1980
|
-
listTotalCents: input
|
|
2265
|
+
listTotalCents: paymentListCents(input, state),
|
|
1981
2266
|
reductions: input.payment.checkout.priceReductions ?? []
|
|
1982
2267
|
});
|
|
1983
2268
|
return pricedPreview(state)?.totalAfterDiscountCents ?? null;
|
|
1984
2269
|
}
|
|
2270
|
+
/** A dates order can hold a bought pass besides the dates, so its list price is the one the server priced. */
|
|
2271
|
+
function paymentListCents(input, state) {
|
|
2272
|
+
return (input.dates?.kind === "order" ? pricedPreview(state)?.subtotalCents ?? null : null) ?? input.price.listTotalCents;
|
|
2273
|
+
}
|
|
1985
2274
|
/** The price to show and charge: the decided quote, or after a refused code, the price without it. */
|
|
1986
2275
|
function pricedPreview(state) {
|
|
1987
2276
|
if (state.status === "priced") return state.preview;
|
|
1988
2277
|
return state.status === "refused" ? state.uncoded ?? null : null;
|
|
1989
2278
|
}
|
|
1990
2279
|
function selectionPriceSettled(input, state) {
|
|
1991
|
-
return !(input
|
|
2280
|
+
return !(!serverPricesTotal(input) && state.key !== null && Boolean(state.draftCode.trim()) && state.status !== "priced") && (pricedPreview(state) !== null || freeSelection(input) || singleBookingNeedsNoAnswer(input, state));
|
|
1992
2281
|
}
|
|
1993
2282
|
/** The only projection that can expose a selection's payable total and submitted code. */
|
|
1994
2283
|
function decidedSelectionPricing(input, state, apply) {
|
|
@@ -2021,11 +2310,11 @@ function decidedSelectionPricing(input, state, apply) {
|
|
|
2021
2310
|
* price anyway, so a preview that failed never stops a booking. A typed code always waits.
|
|
2022
2311
|
*/
|
|
2023
2312
|
function singleBookingNeedsNoAnswer(input, state) {
|
|
2024
|
-
if (input
|
|
2313
|
+
if (serverPricesTotal(input) || input.combinedPending) return false;
|
|
2025
2314
|
if (state.key === null) return true;
|
|
2026
2315
|
if (state.draftCode.trim()) return false;
|
|
2027
2316
|
if (state.status === "failed") return true;
|
|
2028
|
-
return state.status === "draft" && !((input
|
|
2317
|
+
return state.status === "draft" && !(uncodedQuoteWanted(input) && input.automaticWanted);
|
|
2029
2318
|
}
|
|
2030
2319
|
/** What the payment step is waiting for. Checking a typed code on one booking leaves its choices on screen, with Pay held. */
|
|
2031
2320
|
function quoteWaiting(input, state, settled) {
|
|
@@ -2034,7 +2323,7 @@ function quoteWaiting(input, state, settled) {
|
|
|
2034
2323
|
awaitingVisitor: false,
|
|
2035
2324
|
codeHoldingOne: false
|
|
2036
2325
|
};
|
|
2037
|
-
const typedOnOne = input
|
|
2326
|
+
const typedOnOne = !serverPricesTotal(input) && Boolean(state.draftCode.trim());
|
|
2038
2327
|
const deciding = serverDeciding(state);
|
|
2039
2328
|
return {
|
|
2040
2329
|
quoting: deciding && !typedOnOne,
|
|
@@ -2122,17 +2411,20 @@ function presentSelectionCombination(input) {
|
|
|
2122
2411
|
/** The checkout and quote both consume the code decided by this response. */
|
|
2123
2412
|
async function requestSelectionQuote(input) {
|
|
2124
2413
|
try {
|
|
2125
|
-
const code = input.pending.draftCode.trim();
|
|
2414
|
+
const code = "selection" in input.request && input.request.selection.funding.kind === "entitlement" ? "" : input.pending.draftCode.trim();
|
|
2126
2415
|
const result = await input.api.applyDiscountCode({
|
|
2127
2416
|
customerEmail: input.email.trim(),
|
|
2128
|
-
|
|
2417
|
+
...input.request,
|
|
2129
2418
|
...code ? { discountCode: code } : {}
|
|
2130
2419
|
});
|
|
2131
|
-
return
|
|
2420
|
+
return decideSelectionQuoteAnswer(input.pending, result);
|
|
2132
2421
|
} catch {
|
|
2133
2422
|
return {
|
|
2134
|
-
|
|
2135
|
-
|
|
2423
|
+
state: {
|
|
2424
|
+
...input.pending,
|
|
2425
|
+
status: "failed"
|
|
2426
|
+
},
|
|
2427
|
+
fundingChanged: null
|
|
2136
2428
|
};
|
|
2137
2429
|
}
|
|
2138
2430
|
}
|
|
@@ -2143,21 +2435,24 @@ async function requestSelectionQuote(input) {
|
|
|
2143
2435
|
* request remains unresolved and can be retried explicitly.
|
|
2144
2436
|
*/
|
|
2145
2437
|
function useSelectionCombinationPricing(input) {
|
|
2146
|
-
const
|
|
2147
|
-
const
|
|
2438
|
+
const request = selectionQuoteRequest(input);
|
|
2439
|
+
const seededFromOptions = input.several === null && input.dates === null;
|
|
2440
|
+
const key = selectionQuoteKey(request, input.email, seededFromOptions ? input.registrationRequestKey : void 0);
|
|
2148
2441
|
const [state, setState] = useState(() => emptyQuoteDraft(key));
|
|
2149
2442
|
const [carried, setCarried] = useState(false);
|
|
2150
|
-
const
|
|
2443
|
+
const latestPending = useRef(null);
|
|
2444
|
+
const latestKey = useRef(key);
|
|
2445
|
+
latestKey.current = key;
|
|
2446
|
+
const registrationPreview = seededFromOptions ? input.registrationPreview : null;
|
|
2151
2447
|
const current = seedRegistrationQuote(currentSelectionQuote(state, key), registrationPreview);
|
|
2152
|
-
const activeKey = useRef(key);
|
|
2153
|
-
activeKey.current = key;
|
|
2154
2448
|
const apply = async () => {
|
|
2155
|
-
if (key === null ||
|
|
2156
|
-
|
|
2449
|
+
if (key === null || request === null) return;
|
|
2450
|
+
const emailProblem = current.draftCode.trim() ? discountEmailProblem(input.email) : null;
|
|
2451
|
+
if (emailProblem) {
|
|
2157
2452
|
setState({
|
|
2158
2453
|
...current,
|
|
2159
2454
|
status: "refused",
|
|
2160
|
-
message:
|
|
2455
|
+
message: emailProblem
|
|
2161
2456
|
});
|
|
2162
2457
|
return;
|
|
2163
2458
|
}
|
|
@@ -2167,13 +2462,17 @@ function useSelectionCombinationPricing(input) {
|
|
|
2167
2462
|
};
|
|
2168
2463
|
setCarried(false);
|
|
2169
2464
|
setState(pending);
|
|
2170
|
-
|
|
2465
|
+
latestPending.current = pending;
|
|
2466
|
+
const answer = await requestSelectionQuote({
|
|
2171
2467
|
api: input.api,
|
|
2172
2468
|
email: input.email,
|
|
2173
|
-
|
|
2469
|
+
request,
|
|
2174
2470
|
pending
|
|
2175
2471
|
});
|
|
2176
|
-
setState((previous) =>
|
|
2472
|
+
setState((previous) => latestKey.current === pending.key && previous === pending ? answer.state : previous);
|
|
2473
|
+
if (latestPending.current !== pending || latestKey.current !== pending.key || answer.fundingChanged === null) return;
|
|
2474
|
+
setCarried(Boolean(pending.draftCode.trim()));
|
|
2475
|
+
input.onFundingChanged(answer.fundingChanged.funding, answer.fundingChanged.message);
|
|
2177
2476
|
};
|
|
2178
2477
|
useEffect(() => {
|
|
2179
2478
|
if (explicitSelectionQuoteWanted(current, input, carried)) apply();
|
|
@@ -2197,6 +2496,7 @@ function useSelectionCombinationPricing(input) {
|
|
|
2197
2496
|
};
|
|
2198
2497
|
/** A new booking starts with no code and no earlier price. */
|
|
2199
2498
|
const reset = () => {
|
|
2499
|
+
latestPending.current = null;
|
|
2200
2500
|
setCarried(false);
|
|
2201
2501
|
setState(emptyQuoteDraft(key));
|
|
2202
2502
|
};
|
|
@@ -2224,6 +2524,466 @@ function useEventRegistrationRecoveryRequest() {
|
|
|
2224
2524
|
return arrival;
|
|
2225
2525
|
}
|
|
2226
2526
|
//#endregion
|
|
2527
|
+
//#region ../blocks/src/system/runtime/nodes/event-registration/useSelectionFunding.ts
|
|
2528
|
+
const SELECTION_FUNDING_LOAD_FAILED = "We couldn’t load the ways to pay for these dates. Try again, or refresh the page.";
|
|
2529
|
+
const ONE_DATE_FUNDING_LOAD_FAILED = "We couldn’t load the ways to pay for this date. Try again, or refresh the page.";
|
|
2530
|
+
/**
|
|
2531
|
+
* The server's ways to pay for the dates, one or several, fetched when the
|
|
2532
|
+
* payment step wants them. The key carries the dates, places and who's signed in, so any
|
|
2533
|
+
* change asks again and the pick goes back to the server's default.
|
|
2534
|
+
*/
|
|
2535
|
+
function useSelectionFunding(input) {
|
|
2536
|
+
const requestKey = input.request ? JSON.stringify([input.request, input.identity]) : null;
|
|
2537
|
+
const [state, dispatch] = useReducer(selectionFundingReducer, initialSelectionFundingLookup);
|
|
2538
|
+
const wanted = selectionFundingFetchWanted(state, requestKey, input.enabled);
|
|
2539
|
+
useEffect(() => {
|
|
2540
|
+
if (!wanted || requestKey === null || input.request === null) return;
|
|
2541
|
+
dispatch({
|
|
2542
|
+
type: "loading",
|
|
2543
|
+
requestKey
|
|
2544
|
+
});
|
|
2545
|
+
input.api.getSelectionFunding(input.request).then((response) => dispatch({
|
|
2546
|
+
type: "loaded",
|
|
2547
|
+
requestKey,
|
|
2548
|
+
funding: response.funding
|
|
2549
|
+
}), () => dispatch({
|
|
2550
|
+
type: "failed",
|
|
2551
|
+
requestKey
|
|
2552
|
+
}));
|
|
2553
|
+
}, [wanted, requestKey]);
|
|
2554
|
+
const lookup = input.enabled || state.tag !== "idle" ? currentSelectionFundingLookup(state, requestKey) : initialSelectionFundingLookup;
|
|
2555
|
+
const basis = selectionFundingBasis(lookup);
|
|
2556
|
+
return {
|
|
2557
|
+
lookup,
|
|
2558
|
+
choose: (pick) => dispatch({
|
|
2559
|
+
type: "picked",
|
|
2560
|
+
pick
|
|
2561
|
+
}),
|
|
2562
|
+
revise: (funding, message) => dispatch({
|
|
2563
|
+
type: "changed",
|
|
2564
|
+
funding,
|
|
2565
|
+
message,
|
|
2566
|
+
basis
|
|
2567
|
+
}),
|
|
2568
|
+
reset: () => dispatch({ type: "reset" })
|
|
2569
|
+
};
|
|
2570
|
+
}
|
|
2571
|
+
//#endregion
|
|
2572
|
+
//#region ../blocks/src/system/runtime/nodes/event-registration/selectionFundingView.ts
|
|
2573
|
+
const SEVERAL_PLACES_ENTITLEMENT_NOTE = "Class passes and memberships can be used when you book one place on each date.";
|
|
2574
|
+
const ONE_DATE_SEVERAL_PLACES_ENTITLEMENT_NOTE = "Class passes and memberships can be used when you book one place.";
|
|
2575
|
+
/** The chosen option at the quote's price once it's in; every other option at the funding read's. */
|
|
2576
|
+
function orderPrice(option, chosen, input) {
|
|
2577
|
+
return chosen && input.chosenOrder !== null ? input.chosenOrder : {
|
|
2578
|
+
totalCents: option.money.totalCents,
|
|
2579
|
+
discountCents: 0
|
|
2580
|
+
};
|
|
2581
|
+
}
|
|
2582
|
+
/** The server's price for the option's order, with account credit taken off the whole of it, as checkout takes it. */
|
|
2583
|
+
function decideCharge(option, order, input) {
|
|
2584
|
+
const moneyDateCount = fundingMoneyDates(option).length;
|
|
2585
|
+
const creditCents = planCheckoutPaymentFlow({
|
|
2586
|
+
amountDueCents: order.totalCents,
|
|
2587
|
+
discountCents: order.discountCents,
|
|
2588
|
+
availableCreditCents: input.availableCreditCents,
|
|
2589
|
+
creditCurrencyMatches: true,
|
|
2590
|
+
minimumStripeChargeCents: input.minimumCardChargeCents
|
|
2591
|
+
}).reserveCreditCents;
|
|
2592
|
+
const cardCents = order.totalCents - creditCents;
|
|
2593
|
+
const remainder = moneyDateCount === 0 ? "none" : order.totalCents === 0 ? "free" : cardCents === 0 ? "credit" : "card";
|
|
2594
|
+
return {
|
|
2595
|
+
moneyDateCount,
|
|
2596
|
+
boughtCents: boughtPriceCents(option),
|
|
2597
|
+
creditCents,
|
|
2598
|
+
cardCents,
|
|
2599
|
+
remainder
|
|
2600
|
+
};
|
|
2601
|
+
}
|
|
2602
|
+
function boughtPriceCents(option) {
|
|
2603
|
+
if (option.kind === "money") return 0;
|
|
2604
|
+
switch (option.entitlement.kind) {
|
|
2605
|
+
case "buyPass":
|
|
2606
|
+
case "buyMembership": return option.entitlement.priceCents;
|
|
2607
|
+
case "ownedPass":
|
|
2608
|
+
case "ownedMembership": return 0;
|
|
2609
|
+
default: return assertNever(option.entitlement);
|
|
2610
|
+
}
|
|
2611
|
+
}
|
|
2612
|
+
function plural(count, singular, pluralForm = `${singular}s`) {
|
|
2613
|
+
return `${count} ${count === 1 ? singular : pluralForm}`;
|
|
2614
|
+
}
|
|
2615
|
+
const credits = (count) => plural(count, "credit");
|
|
2616
|
+
const datesCount = (count) => plural(count, "date");
|
|
2617
|
+
/** "Fri 13 Nov", "Fri 13 Nov and Fri 20 Nov", "A, B and C". */
|
|
2618
|
+
function joinDays(days) {
|
|
2619
|
+
const last = days[days.length - 1] ?? "";
|
|
2620
|
+
return days.length < 2 ? last : `${days.slice(0, -1).join(", ")} and ${last}`;
|
|
2621
|
+
}
|
|
2622
|
+
/** "the other 2", or "the other date" for one. */
|
|
2623
|
+
function theOther(count) {
|
|
2624
|
+
return count === 1 ? "the other date" : `the other ${count}`;
|
|
2625
|
+
}
|
|
2626
|
+
/** Card wording only when a card is really charged. */
|
|
2627
|
+
function payer(charge) {
|
|
2628
|
+
return charge.remainder === "card" ? "Card pays for" : "You pay for";
|
|
2629
|
+
}
|
|
2630
|
+
/** Why a date isn't covered, under the date. */
|
|
2631
|
+
const UNCOVERED_REASON_COPY = {
|
|
2632
|
+
ends_before: "After your pass ends",
|
|
2633
|
+
not_started: "Before your membership starts",
|
|
2634
|
+
membership_ended: "After your membership ends",
|
|
2635
|
+
already_used_on_date: "Already used for this date",
|
|
2636
|
+
no_credits_left: "No credits left for this date"
|
|
2637
|
+
};
|
|
2638
|
+
function partTitle(facts) {
|
|
2639
|
+
switch (facts.charge.remainder) {
|
|
2640
|
+
case "none":
|
|
2641
|
+
case "free": return facts.name;
|
|
2642
|
+
case "card": return `${facts.name} and card`;
|
|
2643
|
+
case "credit": return `${facts.name} and account credit`;
|
|
2644
|
+
default: return assertNever(facts.charge.remainder);
|
|
2645
|
+
}
|
|
2646
|
+
}
|
|
2647
|
+
function ownedPassShortfall(facts) {
|
|
2648
|
+
switch (facts.shortfall) {
|
|
2649
|
+
case "credits": return facts.covered === 1 ? `Your last credit covers the first date. ${payer(facts.charge)} ${theOther(facts.moneyDates)}.` : `Your last ${facts.covered} credits cover the first ${facts.covered} dates. ${payer(facts.charge)} ${theOther(facts.moneyDates)}.`;
|
|
2650
|
+
case "ends": return `Your pass ends on ${facts.endsOn ?? ""}, so it covers ${datesCount(facts.covered)}. ${payer(facts.charge)} ${facts.moneyDays}.`;
|
|
2651
|
+
case "other": return `Your pass covers ${facts.coveredDays}. ${payer(facts.charge)} ${theOther(facts.moneyDates)}.`;
|
|
2652
|
+
default: return assertNever(facts.shortfall);
|
|
2653
|
+
}
|
|
2654
|
+
}
|
|
2655
|
+
function boughtPassShortfall(facts) {
|
|
2656
|
+
switch (facts.shortfall) {
|
|
2657
|
+
case "ends": return `It ends on ${facts.endsOn ?? ""}, so it covers ${datesCount(facts.covered)}. You pay for ${facts.moneyDays}.`;
|
|
2658
|
+
case "credits": return `${credits(facts.creditsBefore ?? facts.covered)}, so it covers the first ${datesCount(facts.covered)}. You pay for ${theOther(facts.moneyDates)}.`;
|
|
2659
|
+
case "other": return `It covers ${facts.coveredDays}. You pay for ${facts.moneyDays}.`;
|
|
2660
|
+
default: return assertNever(facts.shortfall);
|
|
2661
|
+
}
|
|
2662
|
+
}
|
|
2663
|
+
const membershipRenewal = (facts) => `${facts.boughtPrice ?? ""} a ${facts.interval ?? "month"}, renews ${facts.interval === "year" ? "yearly" : "monthly"}.`;
|
|
2664
|
+
const passCredits = (facts) => `${facts.covered} pass ${facts.covered === 1 ? "credit" : "credits"}`;
|
|
2665
|
+
/** Each kind's words. A new kind of pass or membership won't compile until it has its own. */
|
|
2666
|
+
const ENTITLEMENT_COPY = {
|
|
2667
|
+
ownedPass: {
|
|
2668
|
+
coveredValue: credits(1),
|
|
2669
|
+
countsCredits: true,
|
|
2670
|
+
title: partTitle,
|
|
2671
|
+
detail: (facts) => facts.moneyDates === 0 ? `${credits(facts.creditsBefore ?? 0)} left, ${facts.creditsLeftAfter ?? 0} after this booking` : ownedPassShortfall(facts),
|
|
2672
|
+
price: (facts) => facts.charge.remainder === "card" ? facts.toPay : credits(facts.covered),
|
|
2673
|
+
button: (facts) => {
|
|
2674
|
+
switch (facts.charge.remainder) {
|
|
2675
|
+
case "none": return `Book using ${passCredits(facts)}`;
|
|
2676
|
+
case "card": return `Use ${passCredits(facts)} and pay ${facts.toPay}`;
|
|
2677
|
+
case "credit":
|
|
2678
|
+
case "free": return `Use ${passCredits(facts)} and book`;
|
|
2679
|
+
default: return assertNever(facts.charge.remainder);
|
|
2680
|
+
}
|
|
2681
|
+
},
|
|
2682
|
+
boughtLine: () => null
|
|
2683
|
+
},
|
|
2684
|
+
ownedMembership: {
|
|
2685
|
+
coveredValue: "Included",
|
|
2686
|
+
countsCredits: false,
|
|
2687
|
+
title: partTitle,
|
|
2688
|
+
detail: (facts) => facts.moneyDates === 0 ? facts.dateCount === 1 ? "Your membership covers this date" : `Your membership covers all ${facts.dateCount} dates` : `Your membership covers ${facts.covered} of these dates. ${payer(facts.charge)} ${theOther(facts.moneyDates)}.`,
|
|
2689
|
+
price: (facts) => facts.charge.remainder === "card" ? facts.toPay : "Included",
|
|
2690
|
+
button: (facts) => facts.charge.remainder === "card" ? `Pay ${facts.toPay}` : facts.dateCount === 1 ? "Book your place" : "Book your places",
|
|
2691
|
+
boughtLine: () => null
|
|
2692
|
+
},
|
|
2693
|
+
buyPass: {
|
|
2694
|
+
coveredValue: credits(1),
|
|
2695
|
+
countsCredits: false,
|
|
2696
|
+
title: (facts) => facts.moneyDates === 0 ? `Buy ${indefiniteArticle(facts.name)} ${facts.name}` : `Buy ${indefiniteArticle(facts.name)} ${facts.name} and pay for the rest`,
|
|
2697
|
+
detail: (facts) => facts.moneyDates === 0 ? `${credits(facts.creditsBefore ?? 0)}. ${facts.dateCount === 1 ? "This date uses" : "These dates use"} ${facts.covered}, leaving ${facts.creditsLeftAfter ?? 0}.` : boughtPassShortfall(facts),
|
|
2698
|
+
price: (facts) => facts.toPay,
|
|
2699
|
+
button: (facts) => facts.moneyDates === 0 || facts.charge.cardCents === 0 ? "Buy pass and book" : `Buy pass and pay ${facts.toPay}`,
|
|
2700
|
+
boughtLine: (facts) => ({ note: facts.creditsBefore === 1 ? "Uses its 1 class" : `Uses ${facts.covered} of its ${facts.creditsBefore ?? facts.covered} classes, ${facts.creditsLeftAfter ?? 0} left for later` })
|
|
2701
|
+
},
|
|
2702
|
+
buyMembership: {
|
|
2703
|
+
coveredValue: "Covered",
|
|
2704
|
+
countsCredits: false,
|
|
2705
|
+
title: (facts) => `Buy ${indefiniteArticle(facts.name)} ${facts.name}`,
|
|
2706
|
+
detail: (facts) => facts.dateCount === 1 ? `${membershipRenewal(facts)} It covers this date. You can cancel from your account.` : `${facts.boughtPrice ?? ""} a ${facts.interval ?? "month"}. It covers all ${datesCount(facts.covered)}.`,
|
|
2707
|
+
price: (facts) => facts.toPay,
|
|
2708
|
+
button: (facts) => facts.moneyDates === 0 || facts.charge.cardCents === 0 ? "Buy membership and book" : `Buy membership and pay ${facts.toPay}`,
|
|
2709
|
+
boughtLine: (facts) => ({ note: `${membershipRenewal(facts)} You can cancel from your account.` })
|
|
2710
|
+
}
|
|
2711
|
+
};
|
|
2712
|
+
function entitlementFacts(entitlement, currency) {
|
|
2713
|
+
switch (entitlement.kind) {
|
|
2714
|
+
case "ownedPass": return {
|
|
2715
|
+
creditsBefore: entitlement.credits.used + entitlement.credits.leftAfter,
|
|
2716
|
+
creditsLeftAfter: entitlement.credits.leftAfter,
|
|
2717
|
+
ends: entitlement.expiresAt,
|
|
2718
|
+
boughtPrice: null,
|
|
2719
|
+
interval: null
|
|
2720
|
+
};
|
|
2721
|
+
case "ownedMembership": return {
|
|
2722
|
+
creditsBefore: null,
|
|
2723
|
+
creditsLeftAfter: null,
|
|
2724
|
+
ends: entitlement.endsAt,
|
|
2725
|
+
boughtPrice: null,
|
|
2726
|
+
interval: null
|
|
2727
|
+
};
|
|
2728
|
+
case "buyPass": return {
|
|
2729
|
+
creditsBefore: entitlement.credits.total,
|
|
2730
|
+
creditsLeftAfter: entitlement.credits.leftAfter,
|
|
2731
|
+
ends: entitlement.expiresAt,
|
|
2732
|
+
boughtPrice: formatPrice(entitlement.priceCents, currency),
|
|
2733
|
+
interval: null
|
|
2734
|
+
};
|
|
2735
|
+
case "buyMembership": return {
|
|
2736
|
+
creditsBefore: null,
|
|
2737
|
+
creditsLeftAfter: null,
|
|
2738
|
+
ends: null,
|
|
2739
|
+
boughtPrice: formatPrice(entitlement.priceCents, currency),
|
|
2740
|
+
interval: entitlement.interval
|
|
2741
|
+
};
|
|
2742
|
+
default: return assertNever(entitlement);
|
|
2743
|
+
}
|
|
2744
|
+
}
|
|
2745
|
+
/**
|
|
2746
|
+
* Credits ran out when every skipped date ran out and the covered ones are
|
|
2747
|
+
* the earliest; the pass ended when every skipped date is after its end.
|
|
2748
|
+
* Anything else names the dates it covers.
|
|
2749
|
+
*/
|
|
2750
|
+
function decideShortfall(option, dates, ends) {
|
|
2751
|
+
const reasons = option.uncovered.map((date) => date.reason);
|
|
2752
|
+
const firstCovered = dates.slice(0, option.covered.length).every((date) => option.covered.includes(date.occurrenceId));
|
|
2753
|
+
if (reasons.every((reason) => reason === "no_credits_left") && firstCovered) return "credits";
|
|
2754
|
+
if (ends !== null && reasons.every((reason) => reason === "ends_before")) return "ends";
|
|
2755
|
+
return "other";
|
|
2756
|
+
}
|
|
2757
|
+
function daysOf(ids, dates) {
|
|
2758
|
+
return joinDays(dates.filter((date) => ids.includes(date.occurrenceId)).map((date) => date.day));
|
|
2759
|
+
}
|
|
2760
|
+
function optionFacts(option, charge, input) {
|
|
2761
|
+
const facts = entitlementFacts(option.entitlement, input.currency);
|
|
2762
|
+
return {
|
|
2763
|
+
name: option.entitlement.name,
|
|
2764
|
+
dateCount: input.dates.length,
|
|
2765
|
+
covered: option.covered.length,
|
|
2766
|
+
moneyDates: charge.moneyDateCount,
|
|
2767
|
+
creditsBefore: facts.creditsBefore,
|
|
2768
|
+
creditsLeftAfter: facts.creditsLeftAfter,
|
|
2769
|
+
endsOn: facts.ends === null ? null : input.formatDay(facts.ends),
|
|
2770
|
+
boughtPrice: facts.boughtPrice,
|
|
2771
|
+
interval: facts.interval,
|
|
2772
|
+
shortfall: decideShortfall(option, input.dates, facts.ends),
|
|
2773
|
+
coveredDays: daysOf(option.covered, input.dates),
|
|
2774
|
+
moneyDays: daysOf(fundingMoneyDates(option), input.dates),
|
|
2775
|
+
toPay: formatPrice(charge.cardCents, input.currency),
|
|
2776
|
+
charge
|
|
2777
|
+
};
|
|
2778
|
+
}
|
|
2779
|
+
function optionRows(option, chosenKey, input) {
|
|
2780
|
+
const key = fundingOptionKey(option);
|
|
2781
|
+
const selected = key === chosenKey;
|
|
2782
|
+
const pick = fundingOptionPick(option);
|
|
2783
|
+
switch (option.kind) {
|
|
2784
|
+
case "money": {
|
|
2785
|
+
const price = formatPrice(orderPrice(option, selected, input).totalCents, input.currency);
|
|
2786
|
+
return input.moneyRows.map((row) => ({
|
|
2787
|
+
key: input.moneyRows.length === 1 ? key : `${key}:${row.key}`,
|
|
2788
|
+
pick,
|
|
2789
|
+
card: row.card,
|
|
2790
|
+
label: row.label,
|
|
2791
|
+
details: row.details,
|
|
2792
|
+
price: row.price ?? price,
|
|
2793
|
+
selected: selected && row.current
|
|
2794
|
+
}));
|
|
2795
|
+
}
|
|
2796
|
+
case "entitlement": {
|
|
2797
|
+
const facts = optionFacts(option, decideCharge(option, orderPrice(option, selected, input), input), input);
|
|
2798
|
+
const copy = ENTITLEMENT_COPY[option.entitlement.kind];
|
|
2799
|
+
return [{
|
|
2800
|
+
key,
|
|
2801
|
+
pick,
|
|
2802
|
+
card: null,
|
|
2803
|
+
selected,
|
|
2804
|
+
label: copy.title(facts),
|
|
2805
|
+
details: [copy.detail(facts)],
|
|
2806
|
+
price: copy.price(facts)
|
|
2807
|
+
}];
|
|
2808
|
+
}
|
|
2809
|
+
default: return assertNever(option);
|
|
2810
|
+
}
|
|
2811
|
+
}
|
|
2812
|
+
function dateLines(option, copy, charge, input) {
|
|
2813
|
+
const money = (cents) => formatCurrencyAmount(cents, input.currency);
|
|
2814
|
+
return input.dates.map((date) => {
|
|
2815
|
+
if (option.covered.includes(date.occurrenceId)) return {
|
|
2816
|
+
key: date.occurrenceId,
|
|
2817
|
+
label: date.label,
|
|
2818
|
+
note: null,
|
|
2819
|
+
value: copy.coveredValue
|
|
2820
|
+
};
|
|
2821
|
+
const uncovered = option.uncovered.find((entry) => entry.occurrenceId === date.occurrenceId);
|
|
2822
|
+
const value = charge.remainder === "free" ? "Free" : date.priceCents === null ? "" : money(date.priceCents);
|
|
2823
|
+
return {
|
|
2824
|
+
key: date.occurrenceId,
|
|
2825
|
+
label: date.label,
|
|
2826
|
+
note: uncovered ? UNCOVERED_REASON_COPY[uncovered.reason] : null,
|
|
2827
|
+
value
|
|
2828
|
+
};
|
|
2829
|
+
});
|
|
2830
|
+
}
|
|
2831
|
+
function fundedSummary(option, input) {
|
|
2832
|
+
const charge = decideCharge(option, orderPrice(option, true, input), input);
|
|
2833
|
+
const facts = optionFacts(option, charge, input);
|
|
2834
|
+
const copy = ENTITLEMENT_COPY[option.entitlement.kind];
|
|
2835
|
+
const money = (cents) => formatCurrencyAmount(cents, input.currency);
|
|
2836
|
+
const bought = copy.boughtLine(facts);
|
|
2837
|
+
const lines = [...dateLines(option, copy, charge, input), ...bought ? [{
|
|
2838
|
+
key: "bought",
|
|
2839
|
+
label: `${facts.name} (buying now)`,
|
|
2840
|
+
note: bought.note,
|
|
2841
|
+
value: money(charge.boughtCents)
|
|
2842
|
+
}] : []];
|
|
2843
|
+
const owesMoney = charge.moneyDateCount > 0 || charge.boughtCents > 0;
|
|
2844
|
+
const totals = [
|
|
2845
|
+
...copy.countsCredits && facts.covered > 0 && owesMoney ? [{
|
|
2846
|
+
key: "credits",
|
|
2847
|
+
label: "From your pass",
|
|
2848
|
+
value: credits(facts.covered),
|
|
2849
|
+
total: false
|
|
2850
|
+
}] : [],
|
|
2851
|
+
...owesMoney ? input.reductions.map((row) => ({
|
|
2852
|
+
key: row.key,
|
|
2853
|
+
label: row.label,
|
|
2854
|
+
value: `−${money(row.amountCents)}`,
|
|
2855
|
+
total: false
|
|
2856
|
+
})) : [],
|
|
2857
|
+
...charge.creditCents > 0 ? [{
|
|
2858
|
+
key: "account-credit",
|
|
2859
|
+
label: "Account credit",
|
|
2860
|
+
value: `−${money(charge.creditCents)}`,
|
|
2861
|
+
total: false
|
|
2862
|
+
}] : [],
|
|
2863
|
+
...owesMoney ? [{
|
|
2864
|
+
key: "to-pay",
|
|
2865
|
+
label: "To pay",
|
|
2866
|
+
value: money(charge.cardCents),
|
|
2867
|
+
total: true
|
|
2868
|
+
}] : copy.countsCredits ? [{
|
|
2869
|
+
key: "credits",
|
|
2870
|
+
label: "From your pass",
|
|
2871
|
+
value: credits(facts.covered),
|
|
2872
|
+
total: true
|
|
2873
|
+
}] : []
|
|
2874
|
+
];
|
|
2875
|
+
return {
|
|
2876
|
+
summary: {
|
|
2877
|
+
caption: paymentCaption("dates", input.dates.length, input.places),
|
|
2878
|
+
lines,
|
|
2879
|
+
totals
|
|
2880
|
+
},
|
|
2881
|
+
facts,
|
|
2882
|
+
copy
|
|
2883
|
+
};
|
|
2884
|
+
}
|
|
2885
|
+
/**
|
|
2886
|
+
* Whether the breakdown says something the chosen option's row and button don't:
|
|
2887
|
+
* a code, a combination price or account credit coming off. One date shows it
|
|
2888
|
+
* only then.
|
|
2889
|
+
*/
|
|
2890
|
+
function summaryExplainsMoreThanTheOption(summary) {
|
|
2891
|
+
return summary.totals.some((row) => row.key !== "credits" && row.key !== "to-pay");
|
|
2892
|
+
}
|
|
2893
|
+
function entitlementNote(funding, dateCount) {
|
|
2894
|
+
switch (funding.entitlementNote) {
|
|
2895
|
+
case "none": return null;
|
|
2896
|
+
case "severalPlaces": return dateCount === 1 ? ONE_DATE_SEVERAL_PLACES_ENTITLEMENT_NOTE : SEVERAL_PLACES_ENTITLEMENT_NOTE;
|
|
2897
|
+
default: return assertNever(funding.entitlementNote);
|
|
2898
|
+
}
|
|
2899
|
+
}
|
|
2900
|
+
function termsSurfaceOf(option) {
|
|
2901
|
+
if (option.kind === "money") return "primary";
|
|
2902
|
+
switch (option.entitlement.kind) {
|
|
2903
|
+
case "buyPass":
|
|
2904
|
+
case "buyMembership": return "commerce";
|
|
2905
|
+
case "ownedPass":
|
|
2906
|
+
case "ownedMembership": return "primary";
|
|
2907
|
+
default: return assertNever(option.entitlement);
|
|
2908
|
+
}
|
|
2909
|
+
}
|
|
2910
|
+
function presentSelectionFunding(input) {
|
|
2911
|
+
const option = chosenFundingOption(input.funding, input.pick);
|
|
2912
|
+
const chosenKey = fundingOptionKey(option);
|
|
2913
|
+
const common = {
|
|
2914
|
+
option,
|
|
2915
|
+
rows: (ownCoverPaysEveryDate(option) ? input.funding.options.filter((candidate) => candidate.kind === "money" || ownCoverPaysEveryDate(candidate)) : input.funding.options).flatMap((candidate) => optionRows(candidate, chosenKey, input)),
|
|
2916
|
+
termsSurface: termsSurfaceOf(option),
|
|
2917
|
+
note: entitlementNote(input.funding, input.dates.length)
|
|
2918
|
+
};
|
|
2919
|
+
switch (option.kind) {
|
|
2920
|
+
case "money": return {
|
|
2921
|
+
...common,
|
|
2922
|
+
summary: null,
|
|
2923
|
+
buttonText: null,
|
|
2924
|
+
cardCents: null,
|
|
2925
|
+
takesPayment: orderPrice(option, true, input).totalCents > 0
|
|
2926
|
+
};
|
|
2927
|
+
case "entitlement": {
|
|
2928
|
+
const { summary, facts, copy } = fundedSummary(option, input);
|
|
2929
|
+
return {
|
|
2930
|
+
...common,
|
|
2931
|
+
summary,
|
|
2932
|
+
buttonText: copy.button(facts),
|
|
2933
|
+
cardCents: facts.charge.cardCents,
|
|
2934
|
+
takesPayment: facts.charge.cardCents > 0
|
|
2935
|
+
};
|
|
2936
|
+
}
|
|
2937
|
+
default: return assertNever(option);
|
|
2938
|
+
}
|
|
2939
|
+
}
|
|
2940
|
+
/** The chosen dates as the summary lists them, each at its own price for every place. */
|
|
2941
|
+
function fundingDatesOf(selection, itemPrice) {
|
|
2942
|
+
return selection.flatMap((event) => event.registrationSubject.kind === "occurrence" ? [{
|
|
2943
|
+
occurrenceId: event.registrationSubject.occurrenceId,
|
|
2944
|
+
label: formatBookingWhen(event, "short"),
|
|
2945
|
+
day: formatBookingWhen(event, "day"),
|
|
2946
|
+
priceCents: itemPrice(event)?.subtotalCents ?? null
|
|
2947
|
+
}] : []);
|
|
2948
|
+
}
|
|
2949
|
+
/** "31 Jan", where the event is. */
|
|
2950
|
+
function fundingDayFormatter(event) {
|
|
2951
|
+
return (iso) => formatBookingWhen({
|
|
2952
|
+
startsAt: iso,
|
|
2953
|
+
timeZone: event?.timeZone ?? null,
|
|
2954
|
+
siteTimeZone: event?.siteTimeZone ?? null,
|
|
2955
|
+
deliveryMode: event?.deliveryMode ?? null
|
|
2956
|
+
}, "dayMonth");
|
|
2957
|
+
}
|
|
2958
|
+
/**
|
|
2959
|
+
* The payment step's status and button for several dates. The money option
|
|
2960
|
+
* keeps the card step's own; a pass or membership option waits for the
|
|
2961
|
+
* server to price its order.
|
|
2962
|
+
*/
|
|
2963
|
+
function fundingPaymentStepState(base, lookup, view, priced) {
|
|
2964
|
+
switch (lookup.tag) {
|
|
2965
|
+
case "idle": return base;
|
|
2966
|
+
case "loading": return {
|
|
2967
|
+
...base,
|
|
2968
|
+
status: base.status === "ready" ? "loading" : base.status,
|
|
2969
|
+
canContinue: false
|
|
2970
|
+
};
|
|
2971
|
+
case "failed": return {
|
|
2972
|
+
...base,
|
|
2973
|
+
status: base.status === "ready" ? "error" : base.status,
|
|
2974
|
+
canContinue: false
|
|
2975
|
+
};
|
|
2976
|
+
case "loaded":
|
|
2977
|
+
if (!view || view.buttonText === null) return base;
|
|
2978
|
+
return {
|
|
2979
|
+
...base,
|
|
2980
|
+
canContinue: base.status === "ready" && priced,
|
|
2981
|
+
buttonText: view.buttonText
|
|
2982
|
+
};
|
|
2983
|
+
default: return assertNever(lookup);
|
|
2984
|
+
}
|
|
2985
|
+
}
|
|
2986
|
+
//#endregion
|
|
2227
2987
|
//#region ../blocks/src/system/runtime/nodes/event-registration/useGuestDetailsCheck.ts
|
|
2228
2988
|
/** When a guest completes details on a full event with a waitlist, asks the
|
|
2229
2989
|
* server whether their email has an unfinished booking to pay for instead.
|
|
@@ -2300,6 +3060,7 @@ function planCheckoutOutcome({ outcome, subject }, intent) {
|
|
|
2300
3060
|
switch (outcome.kind) {
|
|
2301
3061
|
case "resolved": return {
|
|
2302
3062
|
kind: "confirmed",
|
|
3063
|
+
submissionPayment: outcome.submissionPayment,
|
|
2303
3064
|
outcome: outcome.outcome,
|
|
2304
3065
|
...outcome.outcomes ? { outcomes: outcome.outcomes } : {}
|
|
2305
3066
|
};
|
|
@@ -2485,6 +3246,7 @@ function usePaymentTransitions(options, runtime) {
|
|
|
2485
3246
|
case "confirmed":
|
|
2486
3247
|
options.complete({
|
|
2487
3248
|
status: "confirmed",
|
|
3249
|
+
submissionPayment: transition.submissionPayment,
|
|
2488
3250
|
outcome: transition.outcome,
|
|
2489
3251
|
...transition.outcomes ? { outcomes: transition.outcomes } : {},
|
|
2490
3252
|
mailingListSignupNote: note.current
|
|
@@ -2915,7 +3677,8 @@ function useEventRegistrationWizardWithDeps(options, deps) {
|
|
|
2915
3677
|
const api = useBlockApi();
|
|
2916
3678
|
const arrivalCredential = deps.useWaitlistClaimCredential();
|
|
2917
3679
|
const nowIso = deps.useBookingNowIso(options.now);
|
|
2918
|
-
const
|
|
3680
|
+
const choiceNowIso = deps.useBookingNowIso(options.now, CHOOSER_CLOCK);
|
|
3681
|
+
const { events, registrationEvents, recoveryEvents, scopedEvents, claimEventSource } = useRegistrationEventSource(options, choiceNowIso);
|
|
2919
3682
|
const preSelectedEvent = useMemo(() => findPreSelectedEvent({
|
|
2920
3683
|
scopedEvents,
|
|
2921
3684
|
occurrenceContext: options.occurrenceContext
|
|
@@ -2933,12 +3696,13 @@ function useEventRegistrationWizardWithDeps(options, deps) {
|
|
|
2933
3696
|
flow: flowState,
|
|
2934
3697
|
dispatch: dispatchFlow,
|
|
2935
3698
|
events: scopedEvents,
|
|
3699
|
+
identity: portalSessionIdentity(api.config),
|
|
2936
3700
|
eventsReady: options.eventSource.kind === "ready",
|
|
2937
3701
|
onDiscountCodeRestored: restoreDiscountCode
|
|
2938
3702
|
});
|
|
2939
3703
|
const step = flowState.step;
|
|
2940
3704
|
const paymentIntent = flowState.paymentSelection;
|
|
2941
|
-
const { selection, runChoices, formData: draftFormData, guests, selectedAttendanceMode, selectedTicketLines, selectedSlidingAmountInput: draftSlidingAmountInput } = flowState.draft;
|
|
3705
|
+
const { selection, runChoices, formData: draftFormData, guests, selectedAttendanceMode, selectedTicketLines, roomChoices, selectedSlidingAmountInput: draftSlidingAmountInput } = flowState.draft;
|
|
2942
3706
|
const selectedEvent = primarySelectionItem(selection);
|
|
2943
3707
|
const selectionMode = registrationSelectionMode({
|
|
2944
3708
|
events: scopedEvents,
|
|
@@ -2987,6 +3751,13 @@ function useEventRegistrationWizardWithDeps(options, deps) {
|
|
|
2987
3751
|
value
|
|
2988
3752
|
}
|
|
2989
3753
|
}), []);
|
|
3754
|
+
const setRoomChoices = useCallback((value) => dispatchFlow({
|
|
3755
|
+
type: "draft-edited",
|
|
3756
|
+
edit: {
|
|
3757
|
+
field: "roomChoices",
|
|
3758
|
+
value
|
|
3759
|
+
}
|
|
3760
|
+
}), []);
|
|
2990
3761
|
const setSelectedSlidingAmountInput = useCallback((value) => dispatchFlow({
|
|
2991
3762
|
type: "draft-edited",
|
|
2992
3763
|
edit: {
|
|
@@ -3058,7 +3829,8 @@ function useEventRegistrationWizardWithDeps(options, deps) {
|
|
|
3058
3829
|
});
|
|
3059
3830
|
const { showMagicLinkModal, changeSignInVisibility: setShowMagicLinkModal, interceptPaymentSelection } = registrationNavigation;
|
|
3060
3831
|
const currentEvent = selectedEvent ?? preSelectedEvent;
|
|
3061
|
-
const
|
|
3832
|
+
const activeSelection = useMemo(() => effectiveSelection(selection, preSelectedEvent ?? null), [selection, preSelectedEvent]);
|
|
3833
|
+
const attendance = useMemo(() => decideSelectionAttendance(activeSelection), [activeSelection]);
|
|
3062
3834
|
const commandRef = useRef(null);
|
|
3063
3835
|
const setStep = useCallback((nextStep) => {
|
|
3064
3836
|
dispatchFlow({
|
|
@@ -3066,10 +3838,13 @@ function useEventRegistrationWizardWithDeps(options, deps) {
|
|
|
3066
3838
|
step: nextStep
|
|
3067
3839
|
});
|
|
3068
3840
|
}, []);
|
|
3841
|
+
const roomOffer = selectRoomOffer(activeSelection, flowState.roomFacts);
|
|
3842
|
+
const roomStay = useMemo(() => decideRoomStay(roomOffer, roomChoices), [roomOffer, roomChoices]);
|
|
3843
|
+
const bookedTicketLines = useMemo(() => bookingLines(selectedTicketLines, roomStay), [selectedTicketLines, roomStay]);
|
|
3069
3844
|
const ticketInputs = useMemo(() => selectionTicketInputs({
|
|
3070
3845
|
several,
|
|
3071
3846
|
primary: currentEvent,
|
|
3072
|
-
lines:
|
|
3847
|
+
lines: bookedTicketLines,
|
|
3073
3848
|
slidingAmountInput: draftSlidingAmountInput,
|
|
3074
3849
|
placeCount: flowState.placeCount,
|
|
3075
3850
|
runChoices,
|
|
@@ -3077,7 +3852,7 @@ function useEventRegistrationWizardWithDeps(options, deps) {
|
|
|
3077
3852
|
}), [
|
|
3078
3853
|
several,
|
|
3079
3854
|
currentEvent,
|
|
3080
|
-
|
|
3855
|
+
bookedTicketLines,
|
|
3081
3856
|
draftSlidingAmountInput,
|
|
3082
3857
|
flowState.placeCount,
|
|
3083
3858
|
runChoices,
|
|
@@ -3085,10 +3860,15 @@ function useEventRegistrationWizardWithDeps(options, deps) {
|
|
|
3085
3860
|
]);
|
|
3086
3861
|
const usesTicketTypeSelections = ticketInputs.usesTicketLines;
|
|
3087
3862
|
const selectedSlidingAmountInput = ticketInputs.slidingAmountInput;
|
|
3088
|
-
const normalizedSelectedTicketLines = useMemo(() => normalizeTicketSelectionLines(
|
|
3863
|
+
const normalizedSelectedTicketLines = useMemo(() => normalizeTicketSelectionLines(bookedTicketLines), [bookedTicketLines]);
|
|
3864
|
+
const roomlessTicketLines = useMemo(() => normalizeTicketSelectionLines(selectedTicketLines), [selectedTicketLines]);
|
|
3089
3865
|
const primaryLines = useMemo(() => normalizeTicketSelectionLines(ticketInputs.lines), [ticketInputs.lines]);
|
|
3090
3866
|
const ticketsCount = ticketInputs.ticketsCount;
|
|
3091
|
-
const ticketSelections = useMemo(() => waitlistClaim
|
|
3867
|
+
const { ticketSelections, quoteSelections, maxTicketsNum } = useMemo(() => invitationBooking(waitlistClaim, primaryLines, options.maxTicketsNum), [
|
|
3868
|
+
waitlistClaim,
|
|
3869
|
+
primaryLines,
|
|
3870
|
+
options.maxTicketsNum
|
|
3871
|
+
]);
|
|
3092
3872
|
const currentTicketSelection = getCurrentTicketSelection(currentEvent, selectedAttendanceMode, ticketSelections);
|
|
3093
3873
|
const paymentController = usePaymentStatusRecovery({
|
|
3094
3874
|
api,
|
|
@@ -3117,7 +3897,7 @@ function useEventRegistrationWizardWithDeps(options, deps) {
|
|
|
3117
3897
|
enabled: bookingClosureAllowsQuote(bookingClosure, shouldRefreshAfterRegistrationError(step, errorAction, shouldLoadRegistrationOptions(portalAuthState, step))),
|
|
3118
3898
|
subject: registrationTarget?.subject ?? null,
|
|
3119
3899
|
attendanceMode: selectedAttendanceMode,
|
|
3120
|
-
ticketSelections,
|
|
3900
|
+
ticketSelections: quoteSelections,
|
|
3121
3901
|
selectedSlidingAmount: parseCurrencyInputToCents(selectedSlidingAmountInput),
|
|
3122
3902
|
subjectEmail: getPortalSubjectEmail(portalProfile),
|
|
3123
3903
|
waitlistClaim: waitlistClaimCredential(waitlistClaim)
|
|
@@ -3214,15 +3994,18 @@ function useEventRegistrationWizardWithDeps(options, deps) {
|
|
|
3214
3994
|
maxTickets: options.maxTicketsNum,
|
|
3215
3995
|
attendanceMode: selectedAttendanceMode
|
|
3216
3996
|
};
|
|
3217
|
-
const
|
|
3997
|
+
const choiceMessages = resolveSelectionChoiceMessages({
|
|
3218
3998
|
several,
|
|
3219
3999
|
attendance,
|
|
3220
4000
|
selection,
|
|
3221
4001
|
runChoices,
|
|
3222
4002
|
facts: runChoiceFacts,
|
|
3223
4003
|
slidingScale: selectedEventSlidingScale,
|
|
3224
|
-
selectedAmount: selectedSlidingAmount
|
|
4004
|
+
selectedAmount: selectedSlidingAmount,
|
|
4005
|
+
roomMessage: roomChoiceMessage(roomStay, roomlessTicketLines)
|
|
3225
4006
|
});
|
|
4007
|
+
const { slidingScaleSelectionMessage } = choiceMessages;
|
|
4008
|
+
const selectionChoiceMessage = choiceMessages.selectionChoiceMessage;
|
|
3226
4009
|
const ticketTypeSelectionRequired = useMemo(() => {
|
|
3227
4010
|
const event = currentEvent;
|
|
3228
4011
|
if (!event || !usesTicketTypeSelections) return false;
|
|
@@ -3233,6 +4016,11 @@ function useEventRegistrationWizardWithDeps(options, deps) {
|
|
|
3233
4016
|
selectedAttendanceMode,
|
|
3234
4017
|
usesTicketTypeSelections
|
|
3235
4018
|
]);
|
|
4019
|
+
const selectionPayment = decideSelectionPayment({
|
|
4020
|
+
selection,
|
|
4021
|
+
runChoices,
|
|
4022
|
+
eligibility
|
|
4023
|
+
});
|
|
3236
4024
|
const admission = resolveRegistrationAdmission({
|
|
3237
4025
|
eligibility,
|
|
3238
4026
|
eligibilityError,
|
|
@@ -3241,7 +4029,9 @@ function useEventRegistrationWizardWithDeps(options, deps) {
|
|
|
3241
4029
|
hasWaitlistClaim: waitlistClaim.kind === "ready",
|
|
3242
4030
|
retryingHeldPlace: paymentController.retryingHeldPlace
|
|
3243
4031
|
}),
|
|
3244
|
-
isAuthenticated: portalAuthState === "authenticated"
|
|
4032
|
+
isAuthenticated: portalAuthState === "authenticated",
|
|
4033
|
+
businessName: options.siteName,
|
|
4034
|
+
severalRunsNeedCard: severalRunsNeedCard(several, selectionPayment)
|
|
3245
4035
|
});
|
|
3246
4036
|
const ticketSelectionPurpose = getTicketSelectionPurpose({
|
|
3247
4037
|
admission,
|
|
@@ -3259,7 +4049,7 @@ function useEventRegistrationWizardWithDeps(options, deps) {
|
|
|
3259
4049
|
purpose: ticketSelectionPurpose,
|
|
3260
4050
|
lines: normalizedSelectedTicketLines,
|
|
3261
4051
|
visibleOptions: visibleTicketTypes,
|
|
3262
|
-
maxTickets:
|
|
4052
|
+
maxTickets: maxTicketsNum,
|
|
3263
4053
|
overallRemainingPlaces,
|
|
3264
4054
|
heldPlacesBySelection
|
|
3265
4055
|
});
|
|
@@ -3269,8 +4059,8 @@ function useEventRegistrationWizardWithDeps(options, deps) {
|
|
|
3269
4059
|
locked: selectionLocked,
|
|
3270
4060
|
restoring: !browserDraftReady,
|
|
3271
4061
|
usesTicketTypes: usesTicketTypeSelections,
|
|
3272
|
-
lines:
|
|
3273
|
-
visibleOptions: visibleTicketTypes,
|
|
4062
|
+
lines: roomlessTicketLines,
|
|
4063
|
+
visibleOptions: defaultTicketOptions(roomOffer, visibleTicketTypes),
|
|
3274
4064
|
purpose: ticketSelectionPurpose,
|
|
3275
4065
|
setLines: setSelectedTicketLines
|
|
3276
4066
|
});
|
|
@@ -3299,11 +4089,6 @@ function useEventRegistrationWizardWithDeps(options, deps) {
|
|
|
3299
4089
|
const handleGuestShakeEnd = () => {
|
|
3300
4090
|
setGuestSectionShake(false);
|
|
3301
4091
|
};
|
|
3302
|
-
const selectionPayment = decideSelectionPayment({
|
|
3303
|
-
selection,
|
|
3304
|
-
runChoices,
|
|
3305
|
-
eligibility
|
|
3306
|
-
});
|
|
3307
4092
|
const eventRequiresPayment = useMemo(() => {
|
|
3308
4093
|
if (selectionPayment.kind === "several") return selectionPayment.due === "card";
|
|
3309
4094
|
if (selectedEventSlidingScale) return (selectedSlidingAmount ?? 0) > 0;
|
|
@@ -3404,8 +4189,8 @@ function useEventRegistrationWizardWithDeps(options, deps) {
|
|
|
3404
4189
|
outcome: "payment-step"
|
|
3405
4190
|
};
|
|
3406
4191
|
case "submit": {
|
|
3407
|
-
const { method,
|
|
3408
|
-
const result = await handleSubmit(method,
|
|
4192
|
+
const { method, membershipId, selection } = continuation.args;
|
|
4193
|
+
const result = await handleSubmit(method, membershipId, selection);
|
|
3409
4194
|
return result.ok ? {
|
|
3410
4195
|
ok: true,
|
|
3411
4196
|
outcome: "submitted"
|
|
@@ -3417,9 +4202,18 @@ function useEventRegistrationWizardWithDeps(options, deps) {
|
|
|
3417
4202
|
}
|
|
3418
4203
|
}
|
|
3419
4204
|
};
|
|
4205
|
+
/** The payment step's button, for the block and the headless flow alike. */
|
|
3420
4206
|
const handlePaymentSelect = async () => {
|
|
3421
|
-
const surface =
|
|
3422
|
-
if (surface === "commerce" && !siteTerms.requireAgreement(surface)) return
|
|
4207
|
+
const surface = paymentTermsSurface;
|
|
4208
|
+
if (surface === "commerce" && !siteTerms.requireAgreement(surface)) return {
|
|
4209
|
+
ok: false,
|
|
4210
|
+
reason: "blocked",
|
|
4211
|
+
message: "Agree to the terms of sale to continue."
|
|
4212
|
+
};
|
|
4213
|
+
if (fundingView?.option.kind === "entitlement") return handleSubmit("stripe", void 0, {
|
|
4214
|
+
method: "stripe",
|
|
4215
|
+
collectionOptionKind: "upfront"
|
|
4216
|
+
});
|
|
3423
4217
|
const submitPlan = resolveEventRegistrationSubmitPlan({
|
|
3424
4218
|
paymentSelection,
|
|
3425
4219
|
eventRequiresPayment,
|
|
@@ -3428,15 +4222,13 @@ function useEventRegistrationWizardWithDeps(options, deps) {
|
|
|
3428
4222
|
if (!submitPlan.ok) {
|
|
3429
4223
|
setErrorMessage(submitPlan.message);
|
|
3430
4224
|
setStep("error");
|
|
3431
|
-
return
|
|
4225
|
+
return {
|
|
4226
|
+
ok: false,
|
|
4227
|
+
reason: "blocked",
|
|
4228
|
+
message: submitPlan.message
|
|
4229
|
+
};
|
|
3432
4230
|
}
|
|
3433
|
-
|
|
3434
|
-
};
|
|
3435
|
-
const handleUseCardInsteadOfPass = () => {
|
|
3436
|
-
dispatchFlow({ type: "use-card-instead-of-pass" });
|
|
3437
|
-
};
|
|
3438
|
-
const handleUsePassInstead = () => {
|
|
3439
|
-
dispatchFlow({ type: "use-pass" });
|
|
4231
|
+
return handleSubmit(submitPlan.args.method, submitPlan.args.membershipId, submitPlan.args.selection);
|
|
3440
4232
|
};
|
|
3441
4233
|
const handleBookForSomeoneElse = () => {
|
|
3442
4234
|
if (portalAuthState === "authenticated") {
|
|
@@ -3475,6 +4267,22 @@ function useEventRegistrationWizardWithDeps(options, deps) {
|
|
|
3475
4267
|
runChoices,
|
|
3476
4268
|
primaryTicketUnits: ticketSelectionSummaryLines
|
|
3477
4269
|
});
|
|
4270
|
+
const { selectionFunding, datesQuote } = useWizardSelectionFunding({
|
|
4271
|
+
api,
|
|
4272
|
+
target: registrationTarget,
|
|
4273
|
+
event: currentEvent,
|
|
4274
|
+
attendanceMode: selectedAttendanceMode,
|
|
4275
|
+
ticketSelections,
|
|
4276
|
+
selectedSlidingAmount,
|
|
4277
|
+
identity: getPortalSubjectEmail(portalProfile),
|
|
4278
|
+
step,
|
|
4279
|
+
portalAuthState
|
|
4280
|
+
});
|
|
4281
|
+
const pricedAsOrder = pricedAsWholeOrder(several, datesQuote);
|
|
4282
|
+
const reviseFunding = (revised, message) => {
|
|
4283
|
+
setErrorMessage("");
|
|
4284
|
+
selectionFunding.revise(revised, message);
|
|
4285
|
+
};
|
|
3478
4286
|
const combinationPricing = useSelectionCombinationPricing({
|
|
3479
4287
|
api,
|
|
3480
4288
|
selection,
|
|
@@ -3482,6 +4290,8 @@ function useEventRegistrationWizardWithDeps(options, deps) {
|
|
|
3482
4290
|
places: ticketsCount,
|
|
3483
4291
|
price: selectionPrice,
|
|
3484
4292
|
itemPrice,
|
|
4293
|
+
dates: datesQuote,
|
|
4294
|
+
onFundingChanged: reviseFunding,
|
|
3485
4295
|
email: formData.email,
|
|
3486
4296
|
payment: paymentController.state,
|
|
3487
4297
|
automaticWanted: step === "select-payment",
|
|
@@ -3499,12 +4309,20 @@ function useEventRegistrationWizardWithDeps(options, deps) {
|
|
|
3499
4309
|
productAutomaticOffered: discountUi.autoAppliedDiscount !== null && discountContext?.type === "pass"
|
|
3500
4310
|
});
|
|
3501
4311
|
const discountView = registrationDiscountView({
|
|
3502
|
-
several:
|
|
4312
|
+
several: pricedAsOrder,
|
|
3503
4313
|
single: discountUi,
|
|
3504
4314
|
selection: combinationPricing,
|
|
3505
4315
|
context: discountContext
|
|
3506
4316
|
});
|
|
3507
4317
|
const { code: discountCode, editCode: setDiscountCode } = discountView;
|
|
4318
|
+
const discountCardOnly = registrationDiscountCardOnly(paymentIntent.method, selectionFunding.lookup);
|
|
4319
|
+
useEffect(() => {
|
|
4320
|
+
if (discountCardOnly && discountCode) setDiscountCode("");
|
|
4321
|
+
}, [
|
|
4322
|
+
discountCardOnly,
|
|
4323
|
+
discountCode,
|
|
4324
|
+
setDiscountCode
|
|
4325
|
+
]);
|
|
3508
4326
|
useEffect(() => {
|
|
3509
4327
|
if (restoredCode === null || paymentReturn) return;
|
|
3510
4328
|
restoreDiscountCode(null);
|
|
@@ -3515,10 +4333,11 @@ function useEventRegistrationWizardWithDeps(options, deps) {
|
|
|
3515
4333
|
scope: browserScope,
|
|
3516
4334
|
ready: browserDraftReady,
|
|
3517
4335
|
flow: flowState,
|
|
3518
|
-
discountCode
|
|
4336
|
+
discountCode,
|
|
4337
|
+
identity: portalSessionIdentity(api.config)
|
|
3519
4338
|
});
|
|
3520
4339
|
const singlePrices = decideSingleBookingPrices({
|
|
3521
|
-
several:
|
|
4340
|
+
several: pricedAsOrder,
|
|
3522
4341
|
context: discountContext,
|
|
3523
4342
|
quote: combinationPricing.quote,
|
|
3524
4343
|
typedCode: discountCode,
|
|
@@ -3527,15 +4346,22 @@ function useEventRegistrationWizardWithDeps(options, deps) {
|
|
|
3527
4346
|
});
|
|
3528
4347
|
const codeAwaitingApply = combinationPricing.codeHoldingOne;
|
|
3529
4348
|
const ticketSelectionSubtotalCents = singlePrices.bookingTotalCents ?? combinationPricing.payableCents;
|
|
3530
|
-
const
|
|
4349
|
+
const directPaymentInput = {
|
|
3531
4350
|
eligibility,
|
|
3532
4351
|
currentEvent,
|
|
3533
4352
|
occurrenceContext: options.occurrenceContext,
|
|
3534
|
-
ticketSelectionSubtotalCents
|
|
4353
|
+
ticketSelectionSubtotalCents: cardOptionsSubtotal({
|
|
4354
|
+
several,
|
|
4355
|
+
datesQuote,
|
|
4356
|
+
primarySubtotalCents,
|
|
4357
|
+
ticketSelectionSubtotalCents
|
|
4358
|
+
}),
|
|
3535
4359
|
automaticDiscount: singlePrices.automaticDiscount,
|
|
3536
4360
|
nowIso,
|
|
3537
4361
|
selectionPayment
|
|
3538
|
-
}
|
|
4362
|
+
};
|
|
4363
|
+
const directPaymentOptions = resolveWizardDirectPaymentOptions(directPaymentInput);
|
|
4364
|
+
const paymentInFullNote = decidePaidInFullNote(directPaymentInput, directPaymentOptions, choiceNowIso);
|
|
3539
4365
|
const { paymentDecision, paymentSelection, paymentStepState: quotedPaymentStepState } = resolveWizardPaymentView({
|
|
3540
4366
|
directPaymentOptions,
|
|
3541
4367
|
paymentIntent,
|
|
@@ -3551,7 +4377,21 @@ function useEventRegistrationWizardWithDeps(options, deps) {
|
|
|
3551
4377
|
discountCode: codeAwaitingApply ? discountCode : "",
|
|
3552
4378
|
step
|
|
3553
4379
|
});
|
|
3554
|
-
const { state:
|
|
4380
|
+
const { state: cardPaymentStepState, heldForCode: paymentHeldForCode } = holdPaymentForCode(quotedPaymentStepState, codeAwaitingApply);
|
|
4381
|
+
const funding = decideWizardSelectionFunding({
|
|
4382
|
+
lookup: selectionFunding.lookup,
|
|
4383
|
+
selection,
|
|
4384
|
+
itemPrice,
|
|
4385
|
+
places: ticketsCount,
|
|
4386
|
+
eligibility,
|
|
4387
|
+
event: currentEvent,
|
|
4388
|
+
directPaymentOptions,
|
|
4389
|
+
paymentDecision,
|
|
4390
|
+
pricing: combinationPricing,
|
|
4391
|
+
creditState: portalCreditState,
|
|
4392
|
+
cardStepState: cardPaymentStepState
|
|
4393
|
+
});
|
|
4394
|
+
const { view: fundingView, paymentStepState, termsSurface: paymentTermsSurface } = funding;
|
|
3555
4395
|
const siteTerms = useSiteTermsAgreement({
|
|
3556
4396
|
terms: options.siteTerms,
|
|
3557
4397
|
context: {
|
|
@@ -3602,6 +4442,8 @@ function useEventRegistrationWizardWithDeps(options, deps) {
|
|
|
3602
4442
|
registrationTarget,
|
|
3603
4443
|
selectedAttendanceMode,
|
|
3604
4444
|
ticketSelections,
|
|
4445
|
+
rooms: roomSubmission(roomOffer, roomChoices, roomlessTicketLines, flowState.draft.reviewedRooms),
|
|
4446
|
+
refreshOptions: () => setOptionsRefreshKey((value) => value + 1),
|
|
3605
4447
|
selectedSlidingAmount,
|
|
3606
4448
|
runChoices,
|
|
3607
4449
|
formData,
|
|
@@ -3616,6 +4458,8 @@ function useEventRegistrationWizardWithDeps(options, deps) {
|
|
|
3616
4458
|
combinationPricing.refuse(message);
|
|
3617
4459
|
},
|
|
3618
4460
|
quoteReady: combinationPricing.ready,
|
|
4461
|
+
selectionFunding: funding.choice,
|
|
4462
|
+
onFundingChanged: reviseFunding,
|
|
3619
4463
|
invitation: invitationSubmission(waitlistClaim),
|
|
3620
4464
|
setStep,
|
|
3621
4465
|
complete,
|
|
@@ -3646,6 +4490,16 @@ function useEventRegistrationWizardWithDeps(options, deps) {
|
|
|
3646
4490
|
event
|
|
3647
4491
|
});
|
|
3648
4492
|
};
|
|
4493
|
+
/**
|
|
4494
|
+
* Several dates: back to the dates with the same ones ticked. The way to pay
|
|
4495
|
+
* and the code's price are dropped; coming back plans them again.
|
|
4496
|
+
*/
|
|
4497
|
+
const handleChangeDates = () => {
|
|
4498
|
+
if (selectionLocked) return;
|
|
4499
|
+
selectionFunding.reset();
|
|
4500
|
+
combinationPricing.carryCode(discountCode);
|
|
4501
|
+
setStep("select-event");
|
|
4502
|
+
};
|
|
3649
4503
|
/** Booking several: Continue moves on with whatever is ticked. */
|
|
3650
4504
|
const handleSelectionContinue = () => {
|
|
3651
4505
|
if (selection.length > 0) dispatchFlow({
|
|
@@ -3686,10 +4540,12 @@ function useEventRegistrationWizardWithDeps(options, deps) {
|
|
|
3686
4540
|
setErrorMessage
|
|
3687
4541
|
});
|
|
3688
4542
|
setSelectedSlidingAmountInput(initialSlidingAmountInput(preSelectedEvent ?? null));
|
|
4543
|
+
setRoomChoices([]);
|
|
3689
4544
|
setSelection(preSelectedEvent ? [preSelectedEvent] : []);
|
|
3690
4545
|
setGuests([]);
|
|
3691
4546
|
setGuestErrors({});
|
|
3692
4547
|
combinationPricing.reset();
|
|
4548
|
+
selectionFunding.reset();
|
|
3693
4549
|
commandRef.current = null;
|
|
3694
4550
|
setOptionsRefreshKey((value) => value + 1);
|
|
3695
4551
|
};
|
|
@@ -3709,6 +4565,7 @@ function useEventRegistrationWizardWithDeps(options, deps) {
|
|
|
3709
4565
|
setSelectedAttendanceMode,
|
|
3710
4566
|
setErrorMessage
|
|
3711
4567
|
});
|
|
4568
|
+
setRoomChoices([]);
|
|
3712
4569
|
}
|
|
3713
4570
|
});
|
|
3714
4571
|
const handlePaymentSelectionChange = useCallback((selection) => {
|
|
@@ -3740,27 +4597,45 @@ function useEventRegistrationWizardWithDeps(options, deps) {
|
|
|
3740
4597
|
navigate: setStep,
|
|
3741
4598
|
payment: paymentController
|
|
3742
4599
|
});
|
|
3743
|
-
const { hasEligibility, hasMembershipEligibility, isMembershipFastTrack } = getEligibilityFlowFlags({
|
|
3744
|
-
eligibility,
|
|
3745
|
-
portalAuthState,
|
|
3746
|
-
ticketsCount,
|
|
3747
|
-
paymentMethod: paymentSelection.method
|
|
3748
|
-
});
|
|
3749
4600
|
const displayEvent = withRegistrationAvailability(currentEvent, eligibilityLoading ? null : eligibility, selectedAttendanceMode);
|
|
3750
4601
|
return {
|
|
3751
4602
|
...registrationNavigation.presentation,
|
|
4603
|
+
/** The rooms step, on an event with rooms; null otherwise. */
|
|
4604
|
+
roomChooser: roomChooserStep({
|
|
4605
|
+
step,
|
|
4606
|
+
offer: roomOffer,
|
|
4607
|
+
choices: roomChoices,
|
|
4608
|
+
stay: roomStay,
|
|
4609
|
+
dayLines: roomlessTicketLines,
|
|
4610
|
+
options: visibleTicketTypes,
|
|
4611
|
+
maxTickets: options.maxTicketsNum,
|
|
4612
|
+
refusal: submissionErrorMessage,
|
|
4613
|
+
event: currentEvent,
|
|
4614
|
+
setRoomChoices: (choices) => {
|
|
4615
|
+
setErrorMessage("");
|
|
4616
|
+
setRoomChoices(choices);
|
|
4617
|
+
},
|
|
4618
|
+
setDayLines: (lines) => {
|
|
4619
|
+
setErrorMessage("");
|
|
4620
|
+
setSelectedTicketLines(normalizeTicketSelectionLines(lines));
|
|
4621
|
+
}
|
|
4622
|
+
}),
|
|
4623
|
+
/** What can be listed as a ticket: an event's room prices can only be chosen through its rooms. */
|
|
4624
|
+
listableTicketTypes: dayOptionsOf(visibleTicketTypes, roomOffer),
|
|
3752
4625
|
api,
|
|
3753
4626
|
nowIso,
|
|
3754
4627
|
/** Whether the clock has stopped this visitor starting a booking on this page. */
|
|
3755
4628
|
bookingClosure,
|
|
3756
4629
|
directPaymentOptions,
|
|
3757
4630
|
paymentDecision,
|
|
4631
|
+
/** Why one booking's card payment is the whole price although its terms offer a deposit; null otherwise. */
|
|
4632
|
+
paymentInFullNote,
|
|
3758
4633
|
anchorId: options.anchorId,
|
|
3759
4634
|
occurrenceContext: options.occurrenceContext,
|
|
3760
4635
|
registrationTarget,
|
|
3761
4636
|
subject: options.subject,
|
|
3762
4637
|
events,
|
|
3763
|
-
maxTicketsNum
|
|
4638
|
+
maxTicketsNum,
|
|
3764
4639
|
/** The new-booking choices, plus the run or date an invitation holds a place on. */
|
|
3765
4640
|
scopedEvents: withOfferedEvent(scopedEvents, waitlistClaim),
|
|
3766
4641
|
/** Everything on this page a booking could be for, whether or not it's still a choice. */
|
|
@@ -3775,7 +4650,10 @@ function useEventRegistrationWizardWithDeps(options, deps) {
|
|
|
3775
4650
|
},
|
|
3776
4651
|
admission,
|
|
3777
4652
|
ticketContinuation,
|
|
3778
|
-
handleTicketsComplete
|
|
4653
|
+
handleTicketsComplete: () => {
|
|
4654
|
+
setErrorMessage("");
|
|
4655
|
+
return handleTicketsComplete();
|
|
4656
|
+
},
|
|
3779
4657
|
selectedEvent: selectedEvent ? displayEvent : null,
|
|
3780
4658
|
/** Every chosen item, in date order; the first is `selectedEvent`. */
|
|
3781
4659
|
selection,
|
|
@@ -3800,8 +4678,26 @@ function useEventRegistrationWizardWithDeps(options, deps) {
|
|
|
3800
4678
|
itemPrice
|
|
3801
4679
|
}),
|
|
3802
4680
|
/** The code field shares the booking's server quote. */
|
|
3803
|
-
combinationCodeField: registrationCodeField(combinationPricing.codeField, combinationPricing.quote
|
|
4681
|
+
combinationCodeField: registrationCodeField(combinationPricing.codeField, combinationPricing.quote),
|
|
3804
4682
|
combinationAwaitingVisitor: combinationPricing.awaitingVisitor,
|
|
4683
|
+
/**
|
|
4684
|
+
* The dates' ways to pay from the server and the visitor's pick; null for anything else, and
|
|
4685
|
+
* for one date the card alone pays for, which keeps the card step.
|
|
4686
|
+
*/
|
|
4687
|
+
selectionFunding: selectionFundingStepModel({
|
|
4688
|
+
funding: selectionFunding,
|
|
4689
|
+
view: fundingView,
|
|
4690
|
+
locked: selectionLocked,
|
|
4691
|
+
dateCount: fundingDateCount(registrationTarget),
|
|
4692
|
+
chooseCard: (card) => {
|
|
4693
|
+
if (!selectionLocked) handlePaymentSelectionChange({
|
|
4694
|
+
method: "stripe",
|
|
4695
|
+
collectionOptionKind: card
|
|
4696
|
+
});
|
|
4697
|
+
}
|
|
4698
|
+
}),
|
|
4699
|
+
handleChangeDates,
|
|
4700
|
+
paymentTermsSurface,
|
|
3805
4701
|
/** The payment step's list of what several items cost; null for one item. */
|
|
3806
4702
|
selectionPaymentSummary: summariseSelectionPayment({
|
|
3807
4703
|
ready: combinationPricing.ready,
|
|
@@ -3829,7 +4725,7 @@ function useEventRegistrationWizardWithDeps(options, deps) {
|
|
|
3829
4725
|
ticketSelections,
|
|
3830
4726
|
selectedTicketLines: normalizedSelectedTicketLines,
|
|
3831
4727
|
setSelectedTicketLines: (lines) => {
|
|
3832
|
-
if (selectionLocked
|
|
4728
|
+
if (selectionLocked) return;
|
|
3833
4729
|
setSelectedTicketLines(normalizeTicketSelectionLines(lines));
|
|
3834
4730
|
},
|
|
3835
4731
|
selectedSlidingAmountInput,
|
|
@@ -3884,27 +4780,21 @@ function useEventRegistrationWizardWithDeps(options, deps) {
|
|
|
3884
4780
|
paymentStepState,
|
|
3885
4781
|
/** Pay is off only because a typed code hasn't been applied yet, which the customer needs telling. */
|
|
3886
4782
|
paymentHeldForCode: paymentHeldForCode && combinationPricing.awaitingVisitor,
|
|
3887
|
-
/** What the pass costs once an applied code is taken off; null when no code applies. */
|
|
3888
|
-
passPriceAfterCodeCents: singlePrices.passTotalCents,
|
|
3889
|
-
/** A membership's first payment after its discount; it renews at the regular price. */
|
|
3890
|
-
membershipFirstPaymentCents: singlePrices.membershipFirstPaymentCents,
|
|
3891
4783
|
handlePaymentSelectionChange: (value) => {
|
|
3892
4784
|
if (!selectionLocked) handlePaymentSelectionChange(value);
|
|
3893
4785
|
},
|
|
3894
4786
|
paymentSelection,
|
|
3895
|
-
declinedPass: getDeclinedPass(flowState),
|
|
3896
|
-
isMembershipFastTrack,
|
|
3897
4787
|
waitlistClaim,
|
|
3898
4788
|
eligibility,
|
|
3899
4789
|
registrationOptionsState,
|
|
3900
4790
|
eligibilityLoading: anyLoading(eligibilityLoading, checkingNextStep, combinationPricing.quoting),
|
|
3901
4791
|
eligibilityError,
|
|
4792
|
+
/** Asks for the booking options again, after they failed to load. */
|
|
4793
|
+
reloadOptions: () => setOptionsRefreshKey((value) => value + 1),
|
|
3902
4794
|
existingRegistrations,
|
|
3903
4795
|
existingRegistrationLoading: existingRegistrationResult.isLoading || portalAuthState === "authenticated" && eligibilityLoading,
|
|
3904
4796
|
existingRegistrationState: existingRegistrationResult.state,
|
|
3905
4797
|
registrationState,
|
|
3906
|
-
hasEligibility,
|
|
3907
|
-
hasMembershipEligibility,
|
|
3908
4798
|
requireGuestDetails,
|
|
3909
4799
|
discountCode,
|
|
3910
4800
|
setDiscountCode: (value) => {
|
|
@@ -3918,6 +4808,7 @@ function useEventRegistrationWizardWithDeps(options, deps) {
|
|
|
3918
4808
|
discountsAvailableLoading: discountView.discountsAvailableLoading,
|
|
3919
4809
|
discountContext,
|
|
3920
4810
|
shouldShowDiscountToggle,
|
|
4811
|
+
discountCardOnly,
|
|
3921
4812
|
verification,
|
|
3922
4813
|
paymentController,
|
|
3923
4814
|
paymentStatusRecovery,
|
|
@@ -3928,8 +4819,6 @@ function useEventRegistrationWizardWithDeps(options, deps) {
|
|
|
3928
4819
|
checkingNextStep,
|
|
3929
4820
|
handleDetailsComplete,
|
|
3930
4821
|
handlePaymentSelect,
|
|
3931
|
-
handleUseCardInsteadOfPass,
|
|
3932
|
-
handleUsePassInstead,
|
|
3933
4822
|
handleBookForSomeoneElse,
|
|
3934
4823
|
handleBookAnother,
|
|
3935
4824
|
handleSubmit: (...args) => selectionLocked ? Promise.resolve({
|
|
@@ -3947,6 +4836,25 @@ function useEventRegistrationWizardWithDeps(options, deps) {
|
|
|
3947
4836
|
...registrationCompletionState(flowState)
|
|
3948
4837
|
};
|
|
3949
4838
|
}
|
|
4839
|
+
/** The rooms step, while the guest is on it. */
|
|
4840
|
+
function roomChooserStep(input) {
|
|
4841
|
+
const { offer, options } = input;
|
|
4842
|
+
if (!offer || input.step !== "select-tickets") return null;
|
|
4843
|
+
const dayOptions = dayOptionsOf(options, offer);
|
|
4844
|
+
const dayIds = new Set(dayOptions.map((option) => option.pricingOptionId));
|
|
4845
|
+
return {
|
|
4846
|
+
view: presentRoomChooser({
|
|
4847
|
+
...input,
|
|
4848
|
+
offer,
|
|
4849
|
+
timeZone: resolveBookingBusinessTimeZone(input.event?.siteTimeZone)
|
|
4850
|
+
}),
|
|
4851
|
+
choices: input.choices,
|
|
4852
|
+
/** The places without a room. */
|
|
4853
|
+
dayOptions,
|
|
4854
|
+
setRoomChoices: input.setRoomChoices,
|
|
4855
|
+
setDayLines: (lines) => input.setDayLines(lines.filter((line) => line.pricingOptionId !== null && dayIds.has(line.pricingOptionId)))
|
|
4856
|
+
};
|
|
4857
|
+
}
|
|
3950
4858
|
/**
|
|
3951
4859
|
* What still needs choosing. Several runs need one way of attending and a
|
|
3952
4860
|
* usable ticket or amount for each run before the tickets step goes on; one
|
|
@@ -3955,7 +4863,7 @@ function useEventRegistrationWizardWithDeps(options, deps) {
|
|
|
3955
4863
|
function resolveSelectionChoiceMessages(input) {
|
|
3956
4864
|
if (input.several !== "runs") return {
|
|
3957
4865
|
slidingScaleSelectionMessage: getSlidingScaleSelectionMessage(input),
|
|
3958
|
-
selectionChoiceMessage:
|
|
4866
|
+
selectionChoiceMessage: input.roomMessage
|
|
3959
4867
|
};
|
|
3960
4868
|
return {
|
|
3961
4869
|
slidingScaleSelectionMessage: incompleteRunChoiceMessage(input),
|
|
@@ -3995,34 +4903,27 @@ function registrationCompletionState(state) {
|
|
|
3995
4903
|
function preSelectedDisplayEvent(preSelected, current, display) {
|
|
3996
4904
|
return preSelected?.selectionId === current?.selectionId ? display : preSelected;
|
|
3997
4905
|
}
|
|
3998
|
-
/** What a single booking's typed code is checked against. Several items have their own quote. */
|
|
4906
|
+
/** What a single booking's typed code is checked against. Several items, and dates bought with a pass, have their own quote. */
|
|
3999
4907
|
function singleBookingDiscountLines(input) {
|
|
4000
4908
|
const { discountContext, eligibility } = input;
|
|
4001
4909
|
if (!discountContext || !eligibility) return [];
|
|
4002
|
-
const product = bundleProductPrice(discountContext, eligibility);
|
|
4003
4910
|
return [{
|
|
4004
4911
|
context: discountContext,
|
|
4005
|
-
subtotalCents:
|
|
4006
|
-
currency:
|
|
4007
|
-
...singleBookingTicketDetails(discountContext
|
|
4912
|
+
subtotalCents: input.primarySubtotalCents ?? 0,
|
|
4913
|
+
currency: eligibility.currency,
|
|
4914
|
+
...singleBookingTicketDetails(discountContext, input)
|
|
4008
4915
|
}];
|
|
4009
4916
|
}
|
|
4010
|
-
|
|
4011
|
-
function bundleProductPrice(context, eligibility) {
|
|
4012
|
-
if (context.type === "pass") return eligibility.availablePasses.find((pass) => pass.id === context.passId) ?? null;
|
|
4013
|
-
if (context.type === "membership") return eligibility.availableMemberships.find((membership) => membership.id === context.membershipId) ?? null;
|
|
4014
|
-
return null;
|
|
4015
|
-
}
|
|
4016
|
-
function singleBookingTicketDetails(contextType, input) {
|
|
4917
|
+
function singleBookingTicketDetails(context, input) {
|
|
4017
4918
|
const ticketUnits = input.ticketLines.map((line) => ({
|
|
4018
4919
|
unitPriceCents: line.unitPriceCents,
|
|
4019
4920
|
quantity: line.quantity
|
|
4020
4921
|
}));
|
|
4021
|
-
if (
|
|
4922
|
+
if (context.type === "whole_series") return {
|
|
4022
4923
|
quantity: input.ticketsCount,
|
|
4023
4924
|
ticketUnits
|
|
4024
4925
|
};
|
|
4025
|
-
if (
|
|
4926
|
+
if (context.type !== "event") return {};
|
|
4026
4927
|
const subject = input.currentEvent?.registrationSubject;
|
|
4027
4928
|
return {
|
|
4028
4929
|
occurrenceId: subject?.kind === "occurrence" ? subject.occurrenceId : void 0,
|
|
@@ -4030,12 +4931,12 @@ function singleBookingTicketDetails(contextType, input) {
|
|
|
4030
4931
|
};
|
|
4031
4932
|
}
|
|
4032
4933
|
/** The quote's field, saying beside an applied code what it does to this purchase. */
|
|
4033
|
-
function registrationCodeField(field, quote
|
|
4934
|
+
function registrationCodeField(field, quote) {
|
|
4034
4935
|
if (!field) return null;
|
|
4035
4936
|
const applied = quote?.source === "typed" && quote.preview.type === "applied" ? quote.preview : null;
|
|
4036
4937
|
return {
|
|
4037
4938
|
...field,
|
|
4038
|
-
hint: appliedCodeHint(
|
|
4939
|
+
hint: appliedCodeHint(applied)
|
|
4039
4940
|
};
|
|
4040
4941
|
}
|
|
4041
4942
|
/**
|
|
@@ -4069,6 +4970,24 @@ function resolveWizardDirectPaymentOptions(input) {
|
|
|
4069
4970
|
}
|
|
4070
4971
|
}
|
|
4071
4972
|
}
|
|
4973
|
+
/**
|
|
4974
|
+
* The payment step's sentence when one booking's card options, as shown
|
|
4975
|
+
* (repriced, discounts included), have no deposit although its terms offer one.
|
|
4976
|
+
*/
|
|
4977
|
+
function decidePaidInFullNote(input, cardOptions, liveNowIso) {
|
|
4978
|
+
const { eligibility } = input;
|
|
4979
|
+
if (!eligibility || input.selectionPayment.kind !== "one-item") return null;
|
|
4980
|
+
return paidInFullNote({
|
|
4981
|
+
paymentTerms: eligibility.paymentTerms,
|
|
4982
|
+
offeredKinds: cardOptions.map((option) => option.kind),
|
|
4983
|
+
dates: {
|
|
4984
|
+
bookingStartAt: getRegistrationStartAt(input.currentEvent, input.occurrenceContext) ?? null,
|
|
4985
|
+
instalmentCollectionDeadlineAt: eligibility.instalmentCollectionDeadlineAt,
|
|
4986
|
+
timeZone: resolveBookingBusinessTimeZone(input.currentEvent?.siteTimeZone),
|
|
4987
|
+
nowIso: liveNowIso
|
|
4988
|
+
}
|
|
4989
|
+
});
|
|
4990
|
+
}
|
|
4072
4991
|
/** One item: its price less the automatic discount; a typed code is already out of the price. */
|
|
4073
4992
|
function previewTotalWithAutomaticDiscount(input) {
|
|
4074
4993
|
return (subtotalCents) => calculateEventRegistrationPreviewTotal({
|
|
@@ -4125,6 +5044,155 @@ function resolveWizardPaymentView(input) {
|
|
|
4125
5044
|
paymentSelection: resolveRegistrationPhaseSelection(input.step, input.paymentIntent, paymentDecision.selection)
|
|
4126
5045
|
};
|
|
4127
5046
|
}
|
|
5047
|
+
/**
|
|
5048
|
+
* Several dates' ways to pay, and what they decide for the payment step: its
|
|
5049
|
+
* button, the terms the visitor agrees to and the choice submit sends.
|
|
5050
|
+
*/
|
|
5051
|
+
function decideWizardSelectionFunding(input) {
|
|
5052
|
+
const view = presentWizardSelectionFunding(input);
|
|
5053
|
+
const option = lookupChosenOption(input.lookup);
|
|
5054
|
+
return {
|
|
5055
|
+
view,
|
|
5056
|
+
paymentStepState: fundingPaymentStepState(input.cardStepState, input.lookup, view, input.pricing.ready),
|
|
5057
|
+
termsSurface: view?.termsSurface ?? "primary",
|
|
5058
|
+
choice: option ? fundingChoice(option) : null
|
|
5059
|
+
};
|
|
5060
|
+
}
|
|
5061
|
+
/**
|
|
5062
|
+
* The payment step's view of the dates' ways to pay, once the server has
|
|
5063
|
+
* sent them. The money rows keep the card options' own words.
|
|
5064
|
+
*/
|
|
5065
|
+
function presentWizardSelectionFunding(input) {
|
|
5066
|
+
const currency = input.eligibility?.currency;
|
|
5067
|
+
if (input.lookup.tag !== "loaded" || !currency) return null;
|
|
5068
|
+
const dates = fundingDatesOf(input.selection, input.itemPrice);
|
|
5069
|
+
return presentSelectionFunding({
|
|
5070
|
+
funding: input.lookup.funding,
|
|
5071
|
+
pick: input.lookup.pick,
|
|
5072
|
+
dates,
|
|
5073
|
+
places: input.places,
|
|
5074
|
+
currency,
|
|
5075
|
+
moneyRows: moneyRows(input, dates.length === 1),
|
|
5076
|
+
chosenOrder: input.pricing.ready ? quotedOrder(input.pricing.quote) : null,
|
|
5077
|
+
reductions: quoteReductions(input.pricing.quote),
|
|
5078
|
+
availableCreditCents: availableCreditCents(input.creditState, currency),
|
|
5079
|
+
minimumCardChargeCents: getStripeMinimumChargeRequirement(currency)?.minimumAmountCents ?? null,
|
|
5080
|
+
formatDay: fundingDayFormatter(input.event)
|
|
5081
|
+
});
|
|
5082
|
+
}
|
|
5083
|
+
/**
|
|
5084
|
+
* How the money option is offered. Several dates are paid in full, so one row. One date
|
|
5085
|
+
* keeps each of its card options (a deposit, say), so choosing money still chooses how.
|
|
5086
|
+
*/
|
|
5087
|
+
function moneyRows(input, oneDate) {
|
|
5088
|
+
const { directPaymentOptions, paymentDecision, lookup } = input;
|
|
5089
|
+
const money = lookup.tag === "loaded" && lookup.pick.kind === "money";
|
|
5090
|
+
const chosen = paymentDecision.directPaymentSelectionState.kind === "valid" ? paymentDecision.directPaymentSelectionState.selection.collectionOptionKind : null;
|
|
5091
|
+
if (!oneDate || directPaymentOptions.length === 0) {
|
|
5092
|
+
const card = directPaymentOptions[0];
|
|
5093
|
+
return [{
|
|
5094
|
+
key: "card",
|
|
5095
|
+
label: moneyRowLabel(money && chosen !== null, paymentDecision.preview, card?.label),
|
|
5096
|
+
details: card ? paymentChoiceDetails(card) : [],
|
|
5097
|
+
price: null,
|
|
5098
|
+
card: null,
|
|
5099
|
+
current: true
|
|
5100
|
+
}];
|
|
5101
|
+
}
|
|
5102
|
+
return directPaymentOptions.map((card) => ({
|
|
5103
|
+
key: card.kind,
|
|
5104
|
+
label: moneyRowLabel(money && chosen === card.kind, paymentDecision.preview, card.label),
|
|
5105
|
+
details: paymentChoiceDetails(card),
|
|
5106
|
+
price: paymentChoicePrice(card.amounts),
|
|
5107
|
+
card: directPaymentOptions.length > 1 ? card.kind : null,
|
|
5108
|
+
current: directPaymentOptions.length === 1 || chosen === card.kind
|
|
5109
|
+
}));
|
|
5110
|
+
}
|
|
5111
|
+
/** A chosen money row says site credit when the credit preview spends it, as the card step does. */
|
|
5112
|
+
function moneyRowLabel(chosen, preview, label) {
|
|
5113
|
+
if (!chosen || preview.kind !== "applied") return label ?? "Pay by card";
|
|
5114
|
+
return preview.outcome === "credit_only" ? "Pay with site credit" : "Use site credit + card";
|
|
5115
|
+
}
|
|
5116
|
+
/**
|
|
5117
|
+
* The payment step's model for the dates; null while nothing is asked, and for one date
|
|
5118
|
+
* the card alone pays for, which keeps the card step it always had. Picks wait while a
|
|
5119
|
+
* payment is under way.
|
|
5120
|
+
*/
|
|
5121
|
+
function selectionFundingStepModel(input) {
|
|
5122
|
+
const { funding, view, locked } = input;
|
|
5123
|
+
const lookup = funding.lookup;
|
|
5124
|
+
if (lookup.tag === "idle" || cardStepServesDates(lookup, input.dateCount)) return null;
|
|
5125
|
+
return {
|
|
5126
|
+
status: lookup.tag,
|
|
5127
|
+
view,
|
|
5128
|
+
dateCount: input.dateCount,
|
|
5129
|
+
notice: lookup.tag === "loaded" ? lookup.notice : null,
|
|
5130
|
+
choose: (row) => {
|
|
5131
|
+
if (locked) return;
|
|
5132
|
+
funding.choose(row.pick);
|
|
5133
|
+
if (row.card !== null) input.chooseCard(row.card);
|
|
5134
|
+
},
|
|
5135
|
+
retry: funding.reset
|
|
5136
|
+
};
|
|
5137
|
+
}
|
|
5138
|
+
/** The server's price for the chosen option's order, from its quote. */
|
|
5139
|
+
function quotedOrder(quote) {
|
|
5140
|
+
if (!quote) return null;
|
|
5141
|
+
const { subtotalCents, totalAfterDiscountCents } = quote.preview;
|
|
5142
|
+
return {
|
|
5143
|
+
totalCents: totalAfterDiscountCents,
|
|
5144
|
+
discountCents: subtotalCents - totalAfterDiscountCents
|
|
5145
|
+
};
|
|
5146
|
+
}
|
|
5147
|
+
/**
|
|
5148
|
+
* Asks for the dates' ways to pay while the payment step is open, and
|
|
5149
|
+
* what the quote then prices: the chosen option's whole order.
|
|
5150
|
+
*/
|
|
5151
|
+
function useWizardSelectionFunding(input) {
|
|
5152
|
+
const { target, attendanceMode, ticketSelections, selectedSlidingAmount } = input;
|
|
5153
|
+
const eventSeriesId = input.event?.seriesId ?? null;
|
|
5154
|
+
const request = useMemo(() => selectionFundingRequest({
|
|
5155
|
+
target,
|
|
5156
|
+
eventSeriesId,
|
|
5157
|
+
attendanceMode,
|
|
5158
|
+
ticketSelections,
|
|
5159
|
+
selectedSlidingAmount
|
|
5160
|
+
}), [
|
|
5161
|
+
target,
|
|
5162
|
+
eventSeriesId,
|
|
5163
|
+
attendanceMode,
|
|
5164
|
+
ticketSelections,
|
|
5165
|
+
selectedSlidingAmount
|
|
5166
|
+
]);
|
|
5167
|
+
const selectionFunding = useSelectionFunding({
|
|
5168
|
+
api: input.api,
|
|
5169
|
+
request,
|
|
5170
|
+
identity: input.identity,
|
|
5171
|
+
enabled: input.step === "select-payment" && input.portalAuthState !== "checking"
|
|
5172
|
+
});
|
|
5173
|
+
return {
|
|
5174
|
+
selectionFunding,
|
|
5175
|
+
datesQuote: useMemo(() => selectionDatesQuote(selectionFunding.lookup, request), [selectionFunding.lookup, request])
|
|
5176
|
+
};
|
|
5177
|
+
}
|
|
5178
|
+
/** Several items, or one date paid with a pass or membership, are priced as one whole order. */
|
|
5179
|
+
function pricedAsWholeOrder(several, datesQuote) {
|
|
5180
|
+
return several !== null || datesQuote !== null;
|
|
5181
|
+
}
|
|
5182
|
+
/** One date's card options keep the date's own price while a pass or membership is picked. */
|
|
5183
|
+
function cardOptionsSubtotal(input) {
|
|
5184
|
+
return input.several === null && input.datesQuote !== null ? input.primarySubtotalCents : input.ticketSelectionSubtotalCents;
|
|
5185
|
+
}
|
|
5186
|
+
/** How many dates the funding step's copy speaks of; 0 for anything that isn't dates. */
|
|
5187
|
+
function fundingDateCount(target) {
|
|
5188
|
+
return target?.selection.kind === "dates" ? target.selection.occurrenceIds.length : 0;
|
|
5189
|
+
}
|
|
5190
|
+
/** Account credit the visitor can spend on this booking's currency. */
|
|
5191
|
+
function availableCreditCents(state, currency) {
|
|
5192
|
+
if (state.kind !== "loaded") return 0;
|
|
5193
|
+
const summary = state.credit?.summary;
|
|
5194
|
+
return summary && summary.currency.toUpperCase() === currency.toUpperCase() ? Math.max(0, summary.availableCents) : 0;
|
|
5195
|
+
}
|
|
4128
5196
|
//#endregion
|
|
4129
5197
|
//#region ../blocks/src/system/runtime/nodes/event-registration/EventRegistrationPayment.tsx
|
|
4130
5198
|
const Payment = lazy(() => import("./EventEmbeddedCheckoutStep-BDnicDM6.mjs"));
|
|
@@ -4160,4 +5228,4 @@ function EventRegistrationPayment({ flow }) {
|
|
|
4160
5228
|
});
|
|
4161
5229
|
}
|
|
4162
5230
|
//#endregion
|
|
4163
|
-
export {
|
|
5231
|
+
export { ONE_DATE_FUNDING_LOAD_FAILED as a, planEventRegistrationSurface as c, summaryExplainsMoreThanTheOption as i, registrationAdmissionSurface as l, EventRegistrationPayment as n, SELECTION_FUNDING_LOAD_FAILED as o, useEventRegistrationWizard as r, useEventRegistrationRecoveryRequest as s, EventPaymentMount as t, resolveEventRegistrationClientSurface as u };
|