@riverbankcms/sdk 0.151.0 → 0.153.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/CHANGELOG.md +52 -0
- package/dist/{EventEmbeddedCheckoutStep-BBHbM22D.mjs → EventEmbeddedCheckoutStep-veN-QiAE.mjs} +10 -9
- package/dist/{PreviewEditorSidebar-BHplI9HE.mjs → PreviewEditorSidebar-jI_4DTZY.mjs} +4 -3
- package/dist/{PreviewEditorUI-DuyN8nsD.mjs → PreviewEditorUI-ORkVZhfu.mjs} +5 -4
- package/dist/{SdkPreviewModeRuntime-CR5ypwxJ.mjs → SdkPreviewModeRuntime-DaNqevI1.mjs} +341 -164
- package/dist/{SiteChromeCustomizeContext-D5t6joF_.mjs → SiteChromeCustomizeContext-CgNuBHC0.mjs} +27124 -39230
- package/dist/ThemedButton-X2UxhW6F.mjs +16525 -0
- package/dist/_dts/ai/src/contracts/proposals.d.ts +52 -52
- package/dist/_dts/ai/src/contracts/siteStyleProposalSchemas.d.ts +2357 -7859
- package/dist/_dts/api/src/bookingOperations.d.ts +5 -3
- package/dist/_dts/api/src/commercePortalEndpoints.d.ts +4 -0
- package/dist/_dts/api/src/communications.d.ts +19 -5
- package/dist/_dts/api/src/endpoints.d.ts +7 -0
- package/dist/_dts/api/src/index.d.ts +1 -1
- package/dist/_dts/api/src/indexExtendedTypes.d.ts +1 -1
- package/dist/_dts/api/src/navigation/types.d.ts +7 -0
- package/dist/_dts/api/src/navigation.d.ts +1 -1
- package/dist/_dts/api/src/publicAppointmentBookingContracts.d.ts +10 -1
- package/dist/_dts/api/src/sdkThemeWire.d.ts +186 -1434
- package/dist/_dts/api/src/shared-contracts.d.ts +10 -0
- package/dist/_dts/api/src/siteAssets.d.ts +1 -0
- package/dist/_dts/api/src/siteInfrastructure.d.ts +2 -1
- package/dist/_dts/api/src/teamMembers.d.ts +2 -27
- package/dist/_dts/block-form/src/widgets/RepeaterField/components/layoutGridDomain.d.ts +3 -13
- package/dist/_dts/blocks/src/contracts/index.d.ts +1 -0
- package/dist/_dts/blocks/src/definitions.d.ts +1 -1
- package/dist/_dts/blocks/src/index.d.ts +2 -0
- package/dist/_dts/blocks/src/lib/media.d.ts +1 -0
- package/dist/_dts/blocks/src/lib/picsum.d.ts +2 -2
- package/dist/_dts/blocks/src/pageRenderPreparation.d.ts +1 -0
- package/dist/_dts/blocks/src/pageRendererContracts.d.ts +2 -1
- package/dist/_dts/blocks/src/primitives/content/utils/sanitizeHref.d.ts +1 -1
- package/dist/_dts/blocks/src/system/blocks/event-registration.d.ts +4 -4
- package/dist/_dts/blocks/src/system/blocks/events/eventSelectionFields.d.ts +1 -1
- package/dist/_dts/blocks/src/system/blocks/events/shared/schemas.d.ts +212 -804
- package/dist/_dts/blocks/src/system/blocks/events/shared/types.d.ts +7 -2
- package/dist/_dts/blocks/src/system/blocks/location-map.d.ts +1 -1
- package/dist/_dts/blocks/src/system/blocks/media-text.d.ts +45 -45
- package/dist/_dts/blocks/src/system/blocks/offerings-preview/model.d.ts +2 -0
- package/dist/_dts/blocks/src/system/blocks/shared/teamMembers.d.ts +4 -7
- package/dist/_dts/blocks/src/system/blocks/team-members.d.ts +2 -2
- package/dist/_dts/blocks/src/system/customize/backgrounds.d.ts +6 -6
- package/dist/_dts/blocks/src/system/fields/backgroundContent.d.ts +377 -1
- package/dist/_dts/blocks/src/system/helpers/backgroundMedia.d.ts +6 -2
- package/dist/_dts/blocks/src/system/helpers/normalizeMailingListBlockContent.d.ts +2 -0
- package/dist/_dts/blocks/src/system/helpers/resolveBackground.d.ts +3 -3
- package/dist/_dts/blocks/src/system/layout/repeaterGrid.d.ts +12 -5
- package/dist/_dts/blocks/src/system/manifest/fieldValidation/index.d.ts +3 -3
- package/dist/_dts/blocks/src/system/manifest/schema.d.ts +24 -24
- package/dist/_dts/blocks/src/system/manifest/validation.d.ts +2 -0
- package/dist/_dts/blocks/src/system/node/fragments/lookSlot.d.ts +1 -1
- package/dist/_dts/blocks/src/system/registry.d.ts +14 -2
- package/dist/_dts/blocks/src/system/runtime/api/client.d.ts +0 -5
- package/dist/_dts/blocks/src/system/runtime/api/index.d.ts +2 -0
- package/dist/_dts/blocks/src/system/runtime/api/schemas/events.d.ts +971 -0
- package/dist/_dts/blocks/src/system/runtime/api/schemas/waitlist-claims.d.ts +42 -0
- package/dist/_dts/blocks/src/system/runtime/api/types/appointments.d.ts +10 -2
- package/dist/_dts/blocks/src/system/runtime/api/types/events.d.ts +10 -136
- package/dist/_dts/blocks/src/system/runtime/components/registry.client.d.ts +48 -6
- package/dist/_dts/blocks/src/system/runtime/components/runtime-backed-blocks.d.ts +24 -3
- package/dist/_dts/blocks/src/system/runtime/hooks/useBookingFlowController.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/hooks/useBookingSubmission.state.d.ts +2 -0
- package/dist/_dts/blocks/src/system/runtime/hooks/useHeadlessBookingFlow.d.ts +5 -1
- package/dist/_dts/blocks/src/system/runtime/hooks/useHeadlessBookingFlow.state.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/lookSurfaces.d.ts +2 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/ImageResolveContext.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/appointment-services.d.ts +50 -202
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.headless.state.d.ts +51 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.state.d.ts +6 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/carousel.client.hooks.d.ts +6 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/carousel.client.state.d.ts +7 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-details/lookPresentation.d.ts +2 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-details/presentation.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/BookingEntryViews.d.ts +42 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/EventEmbeddedCheckoutStep.d.ts +4 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/EventRegistrationBookingLayer.d.ts +19 -9
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/EventRegistrationPayment.d.ts +4 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/EventRegistrationSurface.d.ts +24 -9
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/EventRegistrationWizardContent.d.ts +4 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/EventSelectionStep.d.ts +5 -4
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/GuestDetailsSection.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/PaymentStatusStep.d.ts +2 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/SingleTicketEntitlementNote.d.ts +11 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/SuccessStep.d.ts +4 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/TicketSelectionStep.d.ts +5 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/VerifyingTimeoutStep.d.ts +2 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/bookingCardDisplay.d.ts +31 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/bookingEntry.d.ts +154 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/bookingFocus.d.ts +12 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/event-registration.headless.contract.d.ts +2 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/event-registration.headless.planning.d.ts +2 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/eventSourceRecovery.d.ts +9 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/finishedBooking.d.ts +77 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/index.d.ts +0 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/offeringNoun.d.ts +12 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/paymentResponse.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/registrationCompletion.d.ts +33 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/registrationDerivations.d.ts +11 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/registrationDisplay.d.ts +31 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/registrationDraft.state.d.ts +60 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/registrationErrorRecovery.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/registrationEventAdapter.d.ts +3 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/registrationStateMachine.d.ts +58 -10
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/registrationSurface.d.ts +17 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/types.d.ts +23 -7
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useBookingBarFacts.d.ts +12 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationRecoveryRequest.d.ts +3 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationStripeReturn.d.ts +4 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationSubmit.d.ts +4 -11
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationWizard.d.ts +1563 -31
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventSourceRecovery.d.ts +2 -12
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/usePaymentStatusRecovery.d.ts +147 -4
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/utils.d.ts +50 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/waitlistClaimRestoration.d.ts +6 -5
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/wizardSteps.d.ts +85 -15
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration.interactive.d.ts +53 -8
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/CardListItem.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/MonthLookView.d.ts +10 -3
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/eventCollectionContract.d.ts +290 -882
- package/dist/_dts/blocks/src/system/runtime/nodes/file-download.d.ts +3 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/media.d.ts +22 -90
- package/dist/_dts/blocks/src/system/runtime/nodes/mediaContext.d.ts +69 -0
- package/dist/_dts/blocks/src/system/runtime/shared/bookingPaymentOptionCopy.d.ts +5 -1
- package/dist/_dts/blocks/src/system/runtime/shared/bookingPaymentOptions.d.ts +37 -1
- package/dist/_dts/blocks/src/system/runtime/shared/components/ModalShell.d.ts +9 -2
- package/dist/_dts/blocks/src/system/runtime/shared/components/PaymentChoiceRows.d.ts +28 -0
- package/dist/_dts/blocks/src/system/runtime/shared/components/StepIndicator.d.ts +6 -8
- package/dist/_dts/blocks/src/system/runtime/shared/components/index.d.ts +2 -2
- package/dist/_dts/blocks/src/system/runtime/shared/index.d.ts +2 -2
- package/dist/_dts/blocks/src/system/runtime/shared/useWaitlistClaim.d.ts +9 -12
- package/dist/_dts/blocks/src/system/runtime/shared/useWaitlistClaim.state.d.ts +15 -0
- package/dist/_dts/blocks/src/system/runtime/shared/utils/themePortalRoot.d.ts +10 -15
- package/dist/_dts/blocks/src/system/transforms/registry/index.d.ts +2 -0
- package/dist/_dts/blocks/src/system/transforms/registry/links.d.ts +2 -0
- package/dist/_dts/commerce/src/purchase/bookingInstalmentSchedule.d.ts +2 -0
- package/dist/_dts/commerce/src/purchase/bookingPaymentSelection.d.ts +6 -0
- package/dist/_dts/commerce/src/purchase/confirmationEmailPayment.d.ts +14 -14
- package/dist/_dts/commerce/src/purchase/confirmationPayment.d.ts +65 -0
- package/dist/_dts/commerce/src/purchase/confirmationPaymentSchema.d.ts +66 -0
- package/dist/_dts/commerce/src/purchase/index.d.ts +2 -0
- package/dist/_dts/commerce/src/purchase/orderPaymentState.d.ts +8 -0
- package/dist/_dts/content-model/src/content-types/schema.d.ts +3 -3
- package/dist/_dts/content-model/src/templates/defaults.d.ts +2 -2
- package/dist/_dts/core/src/appointment-booking-terms.d.ts +20 -0
- package/dist/_dts/core/src/booking-payment-schemas.d.ts +70 -0
- package/dist/_dts/core/src/branded.d.ts +0 -2
- package/dist/_dts/core/src/demo-claim-access.d.ts +1 -1
- package/dist/_dts/core/src/demo-claim-readiness.d.ts +18 -0
- package/dist/_dts/core/src/demo-lifecycle-status.d.ts +1 -1
- package/dist/_dts/core/src/demo-warm-pool-target.d.ts +1 -1
- package/dist/_dts/core/src/index.d.ts +4 -0
- package/dist/_dts/core/src/mailing-list-runtime.d.ts +2 -2
- package/dist/_dts/core/src/mailing-list-setup-parser.d.ts +9 -1
- package/dist/_dts/core/src/mailing-list-setup.d.ts +9 -1
- package/dist/_dts/core/src/mailing-list-submission.d.ts +1 -1
- package/dist/_dts/core/src/mailing-list-targeting-availability.d.ts +68 -0
- package/dist/_dts/core/src/mailing-list-targeting.d.ts +11 -1
- package/dist/_dts/core/src/ticket-quantity.d.ts +13 -0
- package/dist/_dts/db/src/generated/supabase/database.types.d.ts +106 -36
- package/dist/_dts/editor/src/chrome/chromeLayers.d.ts +7 -0
- package/dist/_dts/editor/src/index.d.ts +1 -0
- package/dist/_dts/editor-blocks/src/index.d.ts +1 -0
- package/dist/_dts/editor-blocks/src/media/MediaField.d.ts +2 -2
- package/dist/_dts/editor-blocks/src/media/admitEditorMediaField.d.ts +4 -0
- package/dist/_dts/editor-blocks/src/widgets/link/LinkAddressInput.d.ts +8 -0
- package/dist/_dts/editor-blocks/src/widgets/link/LinkContentList.d.ts +12 -0
- package/dist/_dts/editor-blocks/src/widgets/link/LinkPicker.d.ts +5 -1
- package/dist/_dts/editor-blocks/src/widgets/link/LinkPickerDialog.d.ts +3 -3
- package/dist/_dts/editor-blocks/src/widgets/link/LinkSummary.d.ts +8 -2
- package/dist/_dts/editor-blocks/src/widgets/link/LinkWidget.d.ts +4 -3
- package/dist/_dts/editor-blocks/src/widgets/link/LinkWidgetContext.d.ts +2 -1
- package/dist/_dts/editor-blocks/src/widgets/link/draft.d.ts +44 -0
- package/dist/_dts/editor-blocks/src/widgets/link/presentation.d.ts +13 -0
- package/dist/_dts/editor-blocks/src/widgets/link/types.d.ts +14 -0
- package/dist/_dts/editor-blocks/src/widgets/link/useRoutableContent.d.ts +2 -0
- package/dist/_dts/editor-blocks/src/widgets/link/utils.d.ts +5 -4
- package/dist/_dts/editor-blocks/src/widgets/mailing-list-targeting/MailingListTargetingField.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/widgets/mailing-list-targeting/targetingState.d.ts +13 -8
- package/dist/_dts/media-core/src/assetsInUseSummary.d.ts +6 -0
- package/dist/_dts/media-core/src/contentMediaAudit.d.ts +3 -2
- package/dist/_dts/media-core/src/fileStorage.d.ts +4 -3
- package/dist/_dts/media-core/src/index.d.ts +5 -0
- package/dist/_dts/media-core/src/media.d.ts +406 -0
- package/dist/_dts/media-core/src/mediaIdentifierSchema.d.ts +3 -0
- package/dist/_dts/media-core/src/mediaKinds.d.ts +2 -0
- package/dist/_dts/media-core/src/mediaUsageProjection.d.ts +13 -1
- package/dist/_dts/media-core/src/mediaWriteNormalizer.d.ts +2 -6
- package/dist/_dts/media-core/src/portableMediaReferences.d.ts +8 -21
- package/dist/_dts/media-core/src/renderableMediaAsset.d.ts +28 -14
- package/dist/_dts/media-core/src/renderableMediaAssetAdmission.d.ts +15 -0
- package/dist/_dts/media-core/src/storageObjectKey.d.ts +12 -0
- package/dist/_dts/media-editor/src/CropDialog.d.ts +6 -3
- package/dist/_dts/media-editor/src/MediaEditor.d.ts +2 -1
- package/dist/_dts/media-editor/src/MediaPreview.d.ts +3 -3
- package/dist/_dts/media-editor/src/cropEditorSource.d.ts +5 -7
- package/dist/_dts/media-editor/src/editorMediaState.d.ts +29 -0
- package/dist/_dts/media-editor/src/mediaSelection.d.ts +1 -2
- package/dist/_dts/media-editor/src/runtimeMediaAssetState.d.ts +4 -5
- package/dist/_dts/media-editor/src/types.d.ts +1 -1
- package/dist/_dts/media-editor/src/utils.d.ts +0 -1
- package/dist/_dts/media-react/src/components/cropChangePolicy.d.ts +4 -1
- package/dist/_dts/media-react/src/components/cropGeometry.d.ts +1 -0
- package/dist/_dts/media-react/src/components/useImageCropperController.d.ts +1 -0
- package/dist/_dts/media-react/src/hooks/useSupabaseMediaUploader.d.ts +1 -1
- package/dist/_dts/media-react/src/internal/supabaseResumableUpload.d.ts +13 -0
- package/dist/_dts/preview-next/src/client/blocks/BlockBackgroundChooser.d.ts +2 -1
- package/dist/_dts/preview-next/src/client/blocks/previewCustomizeSelectedMedia.d.ts +11 -12
- package/dist/_dts/preview-next/src/client/preview/previewModeRootAttribute.d.ts +11 -0
- package/dist/_dts/sdk/src/contracts/content.d.ts +2 -45
- package/dist/_dts/sdk/src/contracts/index.d.ts +1 -1
- package/dist/_dts/sdk/src/contracts/rendering.d.ts +3 -3
- package/dist/_dts/sdk/src/index.d.ts +1 -0
- package/dist/_dts/sdk/src/rendering/blocks-page-renderer.d.ts +0 -1
- package/dist/_dts/sdk/src/rendering/image.d.ts +14 -4
- package/dist/_dts/sdk/src/rendering/index.d.ts +5 -2
- package/dist/_dts/sdk/src/rendering/link.d.ts +5 -0
- package/dist/_dts/sdk/src/rendering/mediaAssets.d.ts +2 -4
- package/dist/_dts/sdk/src/rendering/overrides.d.ts +1 -0
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/_dts/theme-core/src/accordions/types.d.ts +1 -1
- package/dist/_dts/theme-core/src/blocks/opaquePanels.d.ts +3 -3
- package/dist/_dts/theme-core/src/boxBackgroundSchema.d.ts +397 -26
- package/dist/_dts/theme-core/src/buttons/types.d.ts +21 -21
- package/dist/_dts/theme-core/src/cards/types.d.ts +34 -34
- package/dist/_dts/theme-core/src/generated/containerResponsiveThemeCss.d.ts +1 -1
- package/dist/_dts/theme-core/src/inputs/types.d.ts +3 -3
- package/dist/_dts/theme-core/src/lib/media.d.ts +2 -616
- package/dist/_dts/theme-core/src/mock-themes/all.d.ts +261 -2619
- package/dist/_dts/theme-core/src/palette/curated/types.d.ts +1 -1
- package/dist/_dts/theme-core/src/schema.d.ts +548 -3187
- package/dist/_dts/theme-core/src/site-styles/backgroundAppearance.d.ts +2 -2
- package/dist/_dts/theme-core/src/site-styles/runtimeBackgroundResolution.d.ts +9 -9
- package/dist/_dts/theme-core/src/site-styles/styleTags.d.ts +1 -1
- package/dist/_dts/theme-core/src/site-styles/tokenRecipes.d.ts +1 -1
- package/dist/_dts/theme-core/src/styles/skinTokens.d.ts +2 -2
- package/dist/_dts/theme-core/src/typography/schema.d.ts +2 -2
- package/dist/client/BookingMailingListNote-DrchYW1m.mjs +386 -0
- package/dist/client/{CardListItem-ZDLYh6dL.mjs → CardListItem-CC_GVmF6.mjs} +5 -5
- package/dist/client/CheckIcon-CpyXr-Kg.mjs +35 -0
- package/dist/client/{CheckboxChoice-M-3HycLw.mjs → CheckboxChoice-Dq30m3DO.mjs} +1 -1
- package/dist/client/{DemoBookingPortalAccess-BMtvPTWE.mjs → DemoBookingPortalAccess-ojwbVUmx.mjs} +85 -85
- package/dist/client/{EventCombined.client-DUm_DOxW.mjs → EventCombined.client-DyN0v0Xk.mjs} +7 -9
- package/dist/client/{EventEmbeddedCheckoutStep-DsNNzgRm.mjs → EventEmbeddedCheckoutStep-CgfpKc3n.mjs} +11 -10
- package/dist/client/{EventListing.client-DjNYGUVm.mjs → EventListing.client-CuOuvYMz.mjs} +2 -2
- package/dist/client/{LeafletStaticMap-DuFiOHq_.mjs → LeafletStaticMap-B0WhRr3j.mjs} +1 -1
- package/dist/client/{ModalShell-CqkBvBIC.mjs → ModalShell-BXzucfR6.mjs} +83 -12
- package/dist/client/{RichText-LjPCUGGi.mjs → RichText-C1fIXBzA.mjs} +50 -34
- package/dist/client/{ThemedButton-DZKjtaDD.mjs → ThemedButton-B7HFqFBg.mjs} +1 -2
- package/dist/client/{accordion-Qe--SILD.mjs → accordion-DCDVWSye.mjs} +1 -1
- package/dist/client/{bookingForm-3BCl4g_f.mjs → bookingForm-BJ3C4GlM.mjs} +321 -154
- package/dist/client/bookings.mjs +118607 -22429
- package/dist/client/{carousel-h2YjKOS2.mjs → carousel-BSCBhfHY.mjs} +2 -2
- package/dist/client/{carousel.client-BLrd4hmY.mjs → carousel.client-GEtOGsxo.mjs} +46 -41
- package/dist/client/{cart-5NeiigVd.mjs → cart-Yv-aAtck.mjs} +3 -3
- package/dist/client/{checkout-G4UWjOEw.mjs → checkout-B9xDkl30.mjs} +3 -3
- package/dist/client/client.mjs +37511 -33793
- package/dist/client/{context-GK4-AVAh.mjs → context-BOGe3rIA.mjs} +275 -10
- package/dist/client/{eventCalendar-Prw3Yo_L.mjs → eventCalendar-D6M0T9hs.mjs} +18 -17
- package/dist/client/{eventCombined-BUugi6__.mjs → eventCombined-NM4UFBq8.mjs} +4 -4
- package/dist/client/{eventDetails-CBHUda-R.mjs → eventDetails-f_FhV4O8.mjs} +3 -4
- package/dist/client/{eventListing-CQeG45Dg.mjs → eventListing-WLkfAROh.mjs} +4 -4
- package/dist/client/{eventRegistration-Dif3p3oJ.mjs → eventRegistration-D3ejfLvW.mjs} +2209 -2144
- package/dist/client/{form-Cf0WMtfG.mjs → form-D5Or2Jyu.mjs} +5 -6
- package/dist/client/{headerSection-Bqdr3JWp.mjs → headerSection-hWgnv27V.mjs} +9 -9
- package/dist/client/hooks.mjs +17278 -16106
- package/dist/client/{locationMap-BVvPou4O.mjs → locationMap-Di1K0O2S.mjs} +3 -4
- package/dist/client/{media-47fcnhzD.mjs → media-D29-F1u_.mjs} +183 -362
- package/dist/client/mediaContext-CwbbimYB.mjs +135 -0
- package/dist/client/{newsletterForm-Cx-1dnic.mjs → newsletterForm-CwxcwTNO.mjs} +5 -5
- package/dist/client/{productDetail-DaUMaJYk.mjs → productDetail-BLSnhPdA.mjs} +3 -3
- package/dist/client/{productList-BKQlWEKE.mjs → productList-oGytONOX.mjs} +3 -3
- package/dist/client/{propsDecoder-DO5iXphQ.mjs → propsDecoder-lf_dTeZS.mjs} +18659 -14473
- package/dist/client/renderableMediaAssetAdmission-CHkXYDC_.mjs +143 -0
- package/dist/client/rendering/client.mjs +58971 -55722
- package/dist/client/rendering/islands.mjs +20 -23
- package/dist/client/rendering.mjs +41610 -37917
- package/dist/client/{routeIslandApiConfig-BNm0Z3-g.mjs → routeIslandApiConfig-Bc_WVPS8.mjs} +1 -1
- package/dist/client/{shop-D7ytcFBC.mjs → shop-BQ3bR7fA.mjs} +16 -14
- package/dist/client/{shop-commerce-D68-hHy2.mjs → shop-commerce-DDPll6ZC.mjs} +9 -9
- package/dist/client/{shop-commerce-store-Cu7X2lyu.mjs → shop-commerce-store-DO-e1pTe.mjs} +1 -1
- package/dist/client/{shopShared-D12rxE69.mjs → shopShared-BylM9jh1.mjs} +5 -5
- package/dist/client/themePortalRoot-DS92SRVZ.mjs +47 -0
- package/dist/client/{TerminalPanel-DOTSUCO0.mjs → useDiscountCodeUi-B1Puub2v.mjs} +60 -77
- package/dist/client/{useEventPagination-jgKa67KV.mjs → useEventPagination-BBhkmQaT.mjs} +6 -8
- package/dist/preview-next/before-render.mjs +96 -4
- package/dist/preview-next/client/runtime.mjs +3 -3
- package/dist/preview-next/keepAlive.mjs +7 -0
- package/dist/preview-next/middleware.mjs +7 -0
- package/dist/{sdk-runtime-4cCWO_3i.mjs → sdk-runtime-DWCvhJGu.mjs} +1 -1
- package/dist/server/components.mjs +21820 -19902
- package/dist/server/config-validation.mjs +1786 -642
- package/dist/server/config.mjs +1786 -642
- package/dist/server/data.mjs +17220 -16076
- package/dist/server/index.mjs +234 -2
- package/dist/server/next.mjs +22505 -20528
- package/dist/server/page-converter.mjs +7587 -6572
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +20487 -19044
- package/dist/server/rendering.mjs +21844 -19901
- package/dist/server/routing.mjs +19186 -17961
- package/dist/server/server.mjs +1874 -695
- package/dist/server/theme-bridge.mjs +1371 -914
- package/dist/server/theme.mjs +154 -37
- package/dist/{spinner-tSdG9YvG.mjs → spinner-BYM-Y81w.mjs} +1 -1
- package/dist/styles/index.css +1088 -721
- package/package.json +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/OrderSummary.d.ts +0 -15
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useWaitlistClaimRestoration.d.ts +0 -22
- package/dist/_dts/blocks/src/system/runtime/shared/components/SelectableOptionCard.d.ts +0 -30
- package/dist/client/BookingMailingListNote-DlDSs5Vm.mjs +0 -567
- package/dist/client/colorStyles-DTunOThj.mjs +0 -1316
- package/dist/client/pricing-CMD0kADd.mjs +0 -314
- package/dist/client/result-DRW7JWXz.mjs +0 -30
- package/dist/client/scrollToBlock-C86BYkyV.mjs +0 -17
- package/dist/client/themePortalRoot-AGs4cE7t.mjs +0 -30
- package/dist/spinner-BL3kW9Uh.mjs +0 -803
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { i as SpinnerNode, t as ThemedButton } from "./ThemedButton-
|
|
5
|
-
import {
|
|
6
|
-
import { n as
|
|
7
|
-
import {
|
|
8
|
-
import { o as DiscountCodeDisclosure, p as storeDemoBookingPassIfAvailable, t as BookingConfirmation } from "./DemoBookingPortalAccess-BMtvPTWE.mjs";
|
|
9
|
-
import { i as useDiscountCodeUi, n as StateIcon, r as CheckIcon, t as TerminalPanel } from "./TerminalPanel-DOTSUCO0.mjs";
|
|
2
|
+
import { d as unsafeAsCustomerPassId, f as unsafeAsFormId, l as unsafeAsAppointmentResourceId, m as unsafeAsPassId, u as unsafeAsAppointmentServiceId } from "./renderableMediaAssetAdmission-CHkXYDC_.mjs";
|
|
3
|
+
import { Ai as formatCurrencyAmount, Ar as toSelectedCollectionOptionKind, At as buildBookingPaymentSelectionViewModel, Cr as parseBookingCurrencyInputToCents, Dr as resolveBookingSiteId, Er as resolveBookingPaymentStep, Hr as reportWorkflowError, Lr as assertNever, Mr as resolveSelectedAppointmentConsent, Mt as paymentChoiceDetails, Nr as BOOKING_FORM_DATA_RESERVED_KEYS, Nt as paymentChoicePrice, Or as resolveDefaultBookingServiceId, Pr as isBookingRequirementConsentFieldId, Rr as clearWorkflowFeedback, Sr as isBookingServiceSlidingAmountInRange, Tr as resolveAppointmentCheckoutVerificationState, Ur as reportWorkflowSuccess, Vr as okWith, _i as formatLocalScheduleDate, _r as getBookingRedirectStateFromLocation, bi as parseBookingLocalDate, gi as formatBookingInstant, gr as formatBookingSubmissionPreparationError, hi as addLocalScheduleDays, hr as formatBookingCentsAsCurrencyInput, jr as projectSelectedAppointmentConsentIntoForm, jt as buildReviewedBookingPaymentViewModel, kr as selectedBookingCollectionOptionKind, mi as resolveBookingSignupOffer, mr as deriveBookingFormViewState, pr as logger, t as defineIslandPropsDecoder, vr as getBookingServiceSlidingScale, wr as prepareBookingSubmission, xi as resolveBookingTimeZoneId, yr as getBookingSuccessCopy, zr as err } from "./propsDecoder-lf_dTeZS.mjs";
|
|
4
|
+
import { i as SpinnerNode, t as ThemedButton } from "./ThemedButton-B7HFqFBg.mjs";
|
|
5
|
+
import { t as buildCheckoutReturnUrls } from "./checkoutUrls-ChxwaNtO.mjs";
|
|
6
|
+
import { n as scrollToBlock, t as CheckIcon } from "./CheckIcon-CpyXr-Kg.mjs";
|
|
7
|
+
import { f as storeDemoBookingPassIfAvailable, p as DiscountCodeDisclosure, t as BookingConfirmation } from "./DemoBookingPortalAccess-ojwbVUmx.mjs";
|
|
10
8
|
import { t as FeedbackMessage } from "./FeedbackMessage-CtLvvS_d.mjs";
|
|
9
|
+
import { n as TerminalPanel, r as StateIcon, t as useDiscountCodeUi } from "./useDiscountCodeUi-B1Puub2v.mjs";
|
|
10
|
+
import { a as useBookingNowIso, i as usePolling, n as BookingConsentAgreement, o as StepIndicator, r as PaymentChoiceRows, t as BookingMailingListNote } from "./BookingMailingListNote-DrchYW1m.mjs";
|
|
11
|
+
import { n as useBlockApi, t as BlockApiProvider } from "./context-BOGe3rIA.mjs";
|
|
12
|
+
import { n as isSpamProtectionEnabled, r as AltchaWidget, t as getChallengeUrl } from "./src-B833rYRr.mjs";
|
|
11
13
|
import { i as getFieldValidationControlProps, r as FieldValidationMessage } from "./mailingListSignupCopy-DZSHZrm6.mjs";
|
|
12
|
-
import { t as CheckboxChoice } from "./CheckboxChoice-
|
|
13
|
-
import { t as buildCheckoutReturnUrls } from "./checkoutUrls-ChxwaNtO.mjs";
|
|
14
|
-
import { t as scrollToBlock } from "./scrollToBlock-C86BYkyV.mjs";
|
|
14
|
+
import { t as CheckboxChoice } from "./CheckboxChoice-Dq30m3DO.mjs";
|
|
15
15
|
import { t as mountReactIsland } from "./reactMount-SY8AVRof.mjs";
|
|
16
|
-
import { t as buildRouteIslandApiConfig } from "./routeIslandApiConfig-
|
|
16
|
+
import { t as buildRouteIslandApiConfig } from "./routeIslandApiConfig-Bc_WVPS8.mjs";
|
|
17
17
|
import React, { useCallback, useEffect, useLayoutEffect, useMemo, useReducer, useRef, useState } from "react";
|
|
18
18
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
19
19
|
//#region ../core/src/appointment-service-categories.ts
|
|
@@ -572,6 +572,10 @@ function bookingSubmissionReducer(state, action) {
|
|
|
572
572
|
...clearWorkflowFeedback(state),
|
|
573
573
|
status: { tag: "submitting" }
|
|
574
574
|
};
|
|
575
|
+
case "submission-reviewed": return {
|
|
576
|
+
status: { tag: "idle" },
|
|
577
|
+
feedback: { tag: "idle" }
|
|
578
|
+
};
|
|
575
579
|
case "submission-succeeded": return {
|
|
576
580
|
status: { tag: "idle" },
|
|
577
581
|
feedback: reportWorkflowSuccess(state, action.message).feedback
|
|
@@ -628,32 +632,11 @@ function useBookingSubmission(_siteId) {
|
|
|
628
632
|
const submit = async (data) => {
|
|
629
633
|
dispatch({ type: "submission-started" });
|
|
630
634
|
try {
|
|
631
|
-
const response =
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
endAt: data.endAt,
|
|
637
|
-
customFields: data.customFields,
|
|
638
|
-
mailingListOptIn: data.mailingListOptIn,
|
|
639
|
-
timezone: data.timezone,
|
|
640
|
-
customerPassId: data.customerPassId
|
|
641
|
-
}) : await api.submitBooking({
|
|
642
|
-
formId: data.formId,
|
|
643
|
-
serviceId: data.serviceId,
|
|
644
|
-
resourceId: data.resourceId || null,
|
|
645
|
-
startAt: data.startAt,
|
|
646
|
-
endAt: data.endAt,
|
|
647
|
-
customFields: data.customFields,
|
|
648
|
-
mailingListOptIn: data.mailingListOptIn,
|
|
649
|
-
timezone: data.timezone,
|
|
650
|
-
discountCode: data.discountCode,
|
|
651
|
-
selectedSlidingAmount: data.selectedSlidingAmount,
|
|
652
|
-
selectedCollectionOptionKind: data.selectedCollectionOptionKind,
|
|
653
|
-
altchaSolution: data.altchaSolution ?? null,
|
|
654
|
-
successUrl: data.successUrl,
|
|
655
|
-
cancelUrl: data.cancelUrl
|
|
656
|
-
});
|
|
635
|
+
const response = await executeBookingSubmission(api, data);
|
|
636
|
+
if (response.type === "review_required" || response.type === "payment_choice_required") {
|
|
637
|
+
dispatch({ type: "submission-reviewed" });
|
|
638
|
+
return okWith(response);
|
|
639
|
+
}
|
|
657
640
|
storeDemoBookingPassIfAvailable(response.customer.email, response.demoBookingPass);
|
|
658
641
|
dispatch({
|
|
659
642
|
type: "submission-succeeded",
|
|
@@ -681,6 +664,35 @@ function useBookingSubmission(_siteId) {
|
|
|
681
664
|
isSubmitting: selectIsSubmitting(state)
|
|
682
665
|
};
|
|
683
666
|
}
|
|
667
|
+
function executeBookingSubmission(api, data) {
|
|
668
|
+
return data.kind === "appointment_package" ? api.submitBookingWithPackage({
|
|
669
|
+
formId: data.formId,
|
|
670
|
+
serviceId: data.serviceId,
|
|
671
|
+
resourceId: data.resourceId || null,
|
|
672
|
+
startAt: data.startAt,
|
|
673
|
+
endAt: data.endAt,
|
|
674
|
+
customFields: data.customFields,
|
|
675
|
+
mailingListOptIn: data.mailingListOptIn,
|
|
676
|
+
timezone: data.timezone,
|
|
677
|
+
customerPassId: data.customerPassId
|
|
678
|
+
}) : api.submitBooking({
|
|
679
|
+
formId: data.formId,
|
|
680
|
+
serviceId: data.serviceId,
|
|
681
|
+
resourceId: data.resourceId || null,
|
|
682
|
+
startAt: data.startAt,
|
|
683
|
+
endAt: data.endAt,
|
|
684
|
+
customFields: data.customFields,
|
|
685
|
+
mailingListOptIn: data.mailingListOptIn,
|
|
686
|
+
timezone: data.timezone,
|
|
687
|
+
shownTerms: data.shownTerms,
|
|
688
|
+
discountCode: data.discountCode,
|
|
689
|
+
selectedSlidingAmount: data.selectedSlidingAmount,
|
|
690
|
+
selectedCollectionOptionKind: data.selectedCollectionOptionKind,
|
|
691
|
+
altchaSolution: data.altchaSolution ?? null,
|
|
692
|
+
successUrl: data.successUrl,
|
|
693
|
+
cancelUrl: data.cancelUrl
|
|
694
|
+
});
|
|
695
|
+
}
|
|
684
696
|
//#endregion
|
|
685
697
|
//#region ../blocks/src/system/runtime/nodes/booking-form.validationErrors.ts
|
|
686
698
|
function omitRecordKey(record, key) {
|
|
@@ -789,6 +801,7 @@ function createInitialBookingFlowReducerState(input) {
|
|
|
789
801
|
selectedSlidingAmountInput: toOptionalString(initialData.selectedSlidingAmountInput) ?? bookingSlidingAmountDefault(input.services, input.defaultServiceId),
|
|
790
802
|
selectedCollectionOptionKind: toSelectedCollectionOptionKind(initialData.selectedCollectionOptionKind),
|
|
791
803
|
selectedAppointmentPackageId: toOptionalCustomerPassId(toOptionalString(initialData.selectedAppointmentPackageId)),
|
|
804
|
+
review: null,
|
|
792
805
|
altchaSolution: null,
|
|
793
806
|
validationErrors: createEmptyBookingValidationErrors(),
|
|
794
807
|
feedback: { kind: "none" }
|
|
@@ -891,6 +904,25 @@ function reduceBookingFlowEvent(state, event) {
|
|
|
891
904
|
phase: "editing",
|
|
892
905
|
feedback: { kind: "none" }
|
|
893
906
|
};
|
|
907
|
+
case "review-required": return {
|
|
908
|
+
...state,
|
|
909
|
+
phase: "editing",
|
|
910
|
+
review: event.review,
|
|
911
|
+
feedback: { kind: "none" }
|
|
912
|
+
};
|
|
913
|
+
case "payment-choice-required": return {
|
|
914
|
+
...state,
|
|
915
|
+
phase: "editing",
|
|
916
|
+
review: null,
|
|
917
|
+
paymentChoices: event.paymentChoices,
|
|
918
|
+
selectedCollectionOptionKind: void 0,
|
|
919
|
+
currentStepId: "payment-selection",
|
|
920
|
+
feedback: {
|
|
921
|
+
kind: "error",
|
|
922
|
+
scope: "submission",
|
|
923
|
+
message: "The payment details have changed. Please review them before continuing."
|
|
924
|
+
}
|
|
925
|
+
};
|
|
894
926
|
case "submission-started": return {
|
|
895
927
|
...state,
|
|
896
928
|
phase: "submitting"
|
|
@@ -1028,7 +1060,7 @@ function resolveBookingStepVisibility(input, defaultServiceId, payment) {
|
|
|
1028
1060
|
!hasValidConfiguredService && input.services.length > 1,
|
|
1029
1061
|
(input.form?.settings?.serviceIds?.length ?? 0) > 1
|
|
1030
1062
|
].some(Boolean),
|
|
1031
|
-
needsPayment: needsBookingPaymentStep(input, payment),
|
|
1063
|
+
needsPayment: Boolean(input.forcePaymentSelection) || needsBookingPaymentStep(input, payment),
|
|
1032
1064
|
hasFields: Boolean(input.form?.schema?.fields.length)
|
|
1033
1065
|
};
|
|
1034
1066
|
}
|
|
@@ -1196,24 +1228,11 @@ function deriveBookingFieldViews(input) {
|
|
|
1196
1228
|
});
|
|
1197
1229
|
}
|
|
1198
1230
|
function buildBookingSubmitPlan(input) {
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
return {
|
|
1202
|
-
ok: false,
|
|
1203
|
-
errors: createFormBookingValidationError(message),
|
|
1204
|
-
message
|
|
1205
|
-
};
|
|
1206
|
-
}
|
|
1207
|
-
const fieldErrors = validateBookingFields({
|
|
1208
|
-
fields: input.form?.schema?.fields ?? [],
|
|
1209
|
-
values: input.state.fieldValues
|
|
1210
|
-
});
|
|
1211
|
-
if (Object.keys(fieldErrors).length > 0) return {
|
|
1212
|
-
ok: false,
|
|
1213
|
-
errors: createFieldBookingValidationErrors(fieldErrors),
|
|
1214
|
-
message: "Please check the highlighted fields."
|
|
1215
|
-
};
|
|
1231
|
+
const invalid = validateBookingSubmissionContact(input);
|
|
1232
|
+
if (invalid) return invalid;
|
|
1216
1233
|
const prepared = prepareBookingSubmission({
|
|
1234
|
+
shownTerms: input.shownTerms,
|
|
1235
|
+
promisedDiscountId: input.promisedDiscountId,
|
|
1217
1236
|
formId: input.formId,
|
|
1218
1237
|
nowIso: input.nowIso,
|
|
1219
1238
|
data: bookingFormDataWithEligibleOptIn(toBookingFormData(input.state), Boolean(input.mailingListEligible)),
|
|
@@ -1234,17 +1253,39 @@ function buildBookingSubmitPlan(input) {
|
|
|
1234
1253
|
return {
|
|
1235
1254
|
ok: true,
|
|
1236
1255
|
redirect: input.redirect,
|
|
1237
|
-
value: prepared.value
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
}
|
|
1256
|
+
value: finalizeBookingSubmissionCommand(prepared.value, input)
|
|
1257
|
+
};
|
|
1258
|
+
}
|
|
1259
|
+
function validateBookingSubmissionContact(input) {
|
|
1260
|
+
if (input.requiresResourceSelection && !(input.state.selectedResourceId ?? input.defaultResourceId)) {
|
|
1261
|
+
const message = "Please select a practitioner";
|
|
1262
|
+
return {
|
|
1263
|
+
ok: false,
|
|
1264
|
+
errors: createFormBookingValidationError(message),
|
|
1265
|
+
message
|
|
1266
|
+
};
|
|
1267
|
+
}
|
|
1268
|
+
const fieldErrors = validateBookingFields({
|
|
1269
|
+
fields: input.form?.schema?.fields ?? [],
|
|
1270
|
+
values: input.state.fieldValues
|
|
1271
|
+
});
|
|
1272
|
+
if (Object.keys(fieldErrors).length > 0) return {
|
|
1273
|
+
ok: false,
|
|
1274
|
+
errors: createFieldBookingValidationErrors(fieldErrors),
|
|
1275
|
+
message: "Please check the highlighted fields."
|
|
1276
|
+
};
|
|
1277
|
+
return null;
|
|
1278
|
+
}
|
|
1279
|
+
function finalizeBookingSubmissionCommand(value, input) {
|
|
1280
|
+
const selected = {
|
|
1281
|
+
...value,
|
|
1282
|
+
endAt: input.state.selectedSlot?.endAt ?? value.endAt,
|
|
1283
|
+
resourceId: value.resourceId ?? input.state.selectedSlot?.resourceId
|
|
1284
|
+
};
|
|
1285
|
+
return selected.kind === "appointment_package" ? selected : {
|
|
1286
|
+
...selected,
|
|
1287
|
+
successUrl: input.successUrl,
|
|
1288
|
+
cancelUrl: input.cancelUrl
|
|
1248
1289
|
};
|
|
1249
1290
|
}
|
|
1250
1291
|
function resolveAppointmentPackagesModel(input) {
|
|
@@ -1360,7 +1401,10 @@ function isBlankFieldValue(value) {
|
|
|
1360
1401
|
}
|
|
1361
1402
|
/** Reconcile customer intent as part of the edit, never from a rendering effect. */
|
|
1362
1403
|
function bookingFlowReducer(state, event, context) {
|
|
1363
|
-
const changed = reduceBookingFlowEvent(state
|
|
1404
|
+
const changed = reduceBookingFlowEvent(state.review && changesBookingIntent(event) ? {
|
|
1405
|
+
...state,
|
|
1406
|
+
review: null
|
|
1407
|
+
} : state, event);
|
|
1364
1408
|
const next = event.type === "service-selected" ? {
|
|
1365
1409
|
...changed,
|
|
1366
1410
|
selectedSlidingAmountInput: bookingSlidingAmountDefault(context.services, event.serviceId)
|
|
@@ -1451,7 +1495,28 @@ function planBookingSubmissionStart(input) {
|
|
|
1451
1495
|
},
|
|
1452
1496
|
events: []
|
|
1453
1497
|
};
|
|
1454
|
-
|
|
1498
|
+
if (input.intent.kind === "accept-review" && input.intent.review !== input.state.review) return {
|
|
1499
|
+
kind: "blocked",
|
|
1500
|
+
result: {
|
|
1501
|
+
ok: false,
|
|
1502
|
+
reason: "blocked",
|
|
1503
|
+
message: "booking-review-changed"
|
|
1504
|
+
},
|
|
1505
|
+
events: []
|
|
1506
|
+
};
|
|
1507
|
+
if (input.intent.kind === "submit" && input.state.review) return {
|
|
1508
|
+
kind: "review",
|
|
1509
|
+
result: {
|
|
1510
|
+
ok: false,
|
|
1511
|
+
reason: "review-required",
|
|
1512
|
+
review: input.state.review
|
|
1513
|
+
},
|
|
1514
|
+
events: []
|
|
1515
|
+
};
|
|
1516
|
+
const plan = buildBookingSubmitPlan({
|
|
1517
|
+
...input,
|
|
1518
|
+
shownTerms: input.intent.kind === "accept-review" ? input.intent.review.terms : void 0
|
|
1519
|
+
});
|
|
1455
1520
|
return plan.ok ? {
|
|
1456
1521
|
kind: "submit",
|
|
1457
1522
|
plan,
|
|
@@ -1497,41 +1562,46 @@ function isBookingPaymentEvent(event) {
|
|
|
1497
1562
|
return event.type === "payment-option-selected" || event.type === "sliding-amount-changed" || event.type === "appointment-package-selected" || event.type === "discount-code-changed" || event.type === "altcha-solution-set" || event.type === "altcha-solution-invalidated";
|
|
1498
1563
|
}
|
|
1499
1564
|
function applyBookingPaymentEvent(state, event) {
|
|
1565
|
+
const change = bookingPaymentEventChange(event);
|
|
1566
|
+
return {
|
|
1567
|
+
...state,
|
|
1568
|
+
...change,
|
|
1569
|
+
validationErrors: event.type === "altcha-solution-invalidated" ? state.validationErrors : clearBookingFormError(state.validationErrors)
|
|
1570
|
+
};
|
|
1571
|
+
}
|
|
1572
|
+
function bookingPaymentEventChange(event) {
|
|
1500
1573
|
switch (event.type) {
|
|
1501
1574
|
case "payment-option-selected": return {
|
|
1502
|
-
...state,
|
|
1503
1575
|
selectedCollectionOptionKind: event.kind ?? void 0,
|
|
1504
|
-
selectedAppointmentPackageId: void 0
|
|
1505
|
-
validationErrors: clearBookingFormError(state.validationErrors)
|
|
1576
|
+
selectedAppointmentPackageId: void 0
|
|
1506
1577
|
};
|
|
1507
1578
|
case "sliding-amount-changed": return {
|
|
1508
|
-
...state,
|
|
1509
1579
|
selectedSlidingAmountInput: event.value,
|
|
1510
|
-
selectedAppointmentPackageId: void 0
|
|
1511
|
-
validationErrors: clearBookingFormError(state.validationErrors)
|
|
1580
|
+
selectedAppointmentPackageId: void 0
|
|
1512
1581
|
};
|
|
1513
1582
|
case "appointment-package-selected": return {
|
|
1514
|
-
...state,
|
|
1515
1583
|
selectedAppointmentPackageId: event.packageId ?? void 0,
|
|
1516
|
-
selectedCollectionOptionKind: void 0
|
|
1517
|
-
validationErrors: clearBookingFormError(state.validationErrors)
|
|
1518
|
-
};
|
|
1519
|
-
case "discount-code-changed": return {
|
|
1520
|
-
...state,
|
|
1521
|
-
discountCode: event.code,
|
|
1522
|
-
validationErrors: clearBookingFormError(state.validationErrors)
|
|
1523
|
-
};
|
|
1524
|
-
case "altcha-solution-set": return {
|
|
1525
|
-
...state,
|
|
1526
|
-
altchaSolution: event.solution,
|
|
1527
|
-
validationErrors: clearBookingFormError(state.validationErrors)
|
|
1528
|
-
};
|
|
1529
|
-
case "altcha-solution-invalidated": return {
|
|
1530
|
-
...state,
|
|
1531
|
-
altchaSolution: null
|
|
1584
|
+
selectedCollectionOptionKind: void 0
|
|
1532
1585
|
};
|
|
1586
|
+
case "discount-code-changed": return { discountCode: event.code };
|
|
1587
|
+
case "altcha-solution-set": return { altchaSolution: event.solution };
|
|
1588
|
+
case "altcha-solution-invalidated": return { altchaSolution: null };
|
|
1533
1589
|
}
|
|
1534
1590
|
}
|
|
1591
|
+
function changesBookingIntent(event) {
|
|
1592
|
+
return changesBookingPaymentFacts(event) || [
|
|
1593
|
+
"field-updated",
|
|
1594
|
+
"discount-code-changed",
|
|
1595
|
+
"appointment-package-selected"
|
|
1596
|
+
].includes(event.type);
|
|
1597
|
+
}
|
|
1598
|
+
/** Applies server-owned recovery facts to the existing catalogue model. */
|
|
1599
|
+
function applyBookingPaymentChoices(services, choices) {
|
|
1600
|
+
return choices ? services.map((service) => choices.id === service.id ? {
|
|
1601
|
+
...service,
|
|
1602
|
+
...choices
|
|
1603
|
+
} : service) : services;
|
|
1604
|
+
}
|
|
1535
1605
|
//#endregion
|
|
1536
1606
|
//#region ../blocks/src/system/runtime/hooks/useBookingChoices.ts
|
|
1537
1607
|
/** Accept remote facts here; payment/navigation controllers do not own request lifetime. */
|
|
@@ -1626,6 +1696,30 @@ function useBookingChoicesRequest(key, load, accept, errorMessage) {
|
|
|
1626
1696
|
//#region ../blocks/src/system/runtime/nodes/booking-form.submit-success.ts
|
|
1627
1697
|
function planBookingSubmissionCompletion(input) {
|
|
1628
1698
|
const { data } = input;
|
|
1699
|
+
if (data.type === "review_required") return {
|
|
1700
|
+
navigation: { kind: "none" },
|
|
1701
|
+
events: [{
|
|
1702
|
+
type: "review-required",
|
|
1703
|
+
review: data.review
|
|
1704
|
+
}],
|
|
1705
|
+
result: {
|
|
1706
|
+
ok: false,
|
|
1707
|
+
reason: "review-required",
|
|
1708
|
+
review: data.review
|
|
1709
|
+
}
|
|
1710
|
+
};
|
|
1711
|
+
if (data.type === "payment_choice_required") return {
|
|
1712
|
+
navigation: { kind: "none" },
|
|
1713
|
+
events: [{
|
|
1714
|
+
type: "payment-choice-required",
|
|
1715
|
+
paymentChoices: data.paymentChoices
|
|
1716
|
+
}],
|
|
1717
|
+
result: {
|
|
1718
|
+
ok: false,
|
|
1719
|
+
reason: "payment-choice-required",
|
|
1720
|
+
paymentChoices: data.paymentChoices
|
|
1721
|
+
}
|
|
1722
|
+
};
|
|
1629
1723
|
const extras = {
|
|
1630
1724
|
...data.demoBookingPass ? { demoBookingPass: data.demoBookingPass } : {},
|
|
1631
1725
|
...data.mailingListSignupNote ? { mailingListSignupNote: data.mailingListSignupNote } : {},
|
|
@@ -1703,7 +1797,11 @@ function useBookingFlowController(input) {
|
|
|
1703
1797
|
navigate("back");
|
|
1704
1798
|
},
|
|
1705
1799
|
goToStep: async (stepId) => navigate(stepId),
|
|
1706
|
-
submit: submitBooking,
|
|
1800
|
+
submit: (options) => submitBooking({ kind: "submit" }, options),
|
|
1801
|
+
acceptReview: (review, options) => submitBooking({
|
|
1802
|
+
kind: "accept-review",
|
|
1803
|
+
review
|
|
1804
|
+
}, options),
|
|
1707
1805
|
setDiscountCode: (code) => {
|
|
1708
1806
|
input.dispatch({
|
|
1709
1807
|
type: "discount-code-changed",
|
|
@@ -1735,10 +1833,11 @@ function useBookingFlowController(input) {
|
|
|
1735
1833
|
}
|
|
1736
1834
|
function useBookingSubmitAction(latestRef) {
|
|
1737
1835
|
const submittingRef = useRef(false);
|
|
1738
|
-
return useCallback(async (options) => {
|
|
1836
|
+
return useCallback(async (intent, options) => {
|
|
1739
1837
|
const latest = latestRef.current;
|
|
1740
1838
|
const start = planBookingSubmissionStart({
|
|
1741
1839
|
...latest,
|
|
1840
|
+
intent,
|
|
1742
1841
|
inFlight: submittingRef.current,
|
|
1743
1842
|
state: {
|
|
1744
1843
|
...latest.state,
|
|
@@ -1753,6 +1852,11 @@ function useBookingSubmitAction(latestRef) {
|
|
|
1753
1852
|
submittingRef.current = true;
|
|
1754
1853
|
try {
|
|
1755
1854
|
const result = await latest.submit(start.plan.value);
|
|
1855
|
+
if (isOutdatedBookingReview(result, latest.state, latestRef.current.state)) return {
|
|
1856
|
+
ok: false,
|
|
1857
|
+
reason: "blocked",
|
|
1858
|
+
message: "booking-details-changed"
|
|
1859
|
+
};
|
|
1756
1860
|
if (!result.ok) return failBookingSubmission(result.error, latest.dispatch);
|
|
1757
1861
|
return completeBookingSubmission({
|
|
1758
1862
|
data: result.data,
|
|
@@ -1833,6 +1937,12 @@ function failBookingSubmission(message, dispatch) {
|
|
|
1833
1937
|
message
|
|
1834
1938
|
};
|
|
1835
1939
|
}
|
|
1940
|
+
function sameBookingIntent(left, right) {
|
|
1941
|
+
return left.selectedServiceId === right.selectedServiceId && left.selectedResourceId === right.selectedResourceId && left.selectedSlot?.key === right.selectedSlot?.key && left.selectedSlidingAmountInput === right.selectedSlidingAmountInput && left.selectedCollectionOptionKind === right.selectedCollectionOptionKind && left.selectedAppointmentPackageId === right.selectedAppointmentPackageId && left.discountCode === right.discountCode && left.fieldValues === right.fieldValues;
|
|
1942
|
+
}
|
|
1943
|
+
function isOutdatedBookingReview(result, submitted, current) {
|
|
1944
|
+
return result.ok && (result.data.type === "review_required" || result.data.type === "payment_choice_required") && !sameBookingIntent(submitted, current);
|
|
1945
|
+
}
|
|
1836
1946
|
//#endregion
|
|
1837
1947
|
//#region ../blocks/src/system/runtime/hooks/useHeadlessBookingFlow.ts
|
|
1838
1948
|
function useHeadlessBookingFlow(options) {
|
|
@@ -1853,14 +1963,15 @@ function useHeadlessBookingFlow(options) {
|
|
|
1853
1963
|
options.services
|
|
1854
1964
|
]);
|
|
1855
1965
|
const [state, dispatch] = useReducer((previous, event) => bookingFlowReducer(previous, event, {
|
|
1856
|
-
services: options.services,
|
|
1966
|
+
services: applyBookingPaymentChoices(options.services, previous.paymentChoices),
|
|
1857
1967
|
defaultServiceId,
|
|
1858
1968
|
nowIso: bookingNowIso
|
|
1859
1969
|
}), initialState);
|
|
1860
1970
|
const api = useBlockApi();
|
|
1861
1971
|
const selectedServiceId = state.selectedServiceId ?? defaultServiceId;
|
|
1862
1972
|
const selectedResourceId = state.selectedResourceId ?? defaultResourceId;
|
|
1863
|
-
const
|
|
1973
|
+
const services = useMemo(() => applyBookingPaymentChoices(options.services, state.paymentChoices), [options.services, state.paymentChoices]);
|
|
1974
|
+
const selectedService = services.find((service) => service.id === selectedServiceId) ?? null;
|
|
1864
1975
|
const runtimeForm = useSelectedAppointmentConsentForm(options.form, selectedService);
|
|
1865
1976
|
const hasPortalBearerAuth = (api.config.authOverrides?.portal ?? api.config.auth).type === "bearer";
|
|
1866
1977
|
const selectedServiceSlidingScale = getBookingServiceSlidingScale(selectedService);
|
|
@@ -1895,7 +2006,8 @@ function useHeadlessBookingFlow(options) {
|
|
|
1895
2006
|
const stepState = useMemo(() => deriveBookingFlowSteps({
|
|
1896
2007
|
form: runtimeForm,
|
|
1897
2008
|
nowIso: bookingNowIso,
|
|
1898
|
-
services
|
|
2009
|
+
services,
|
|
2010
|
+
forcePaymentSelection: state.paymentChoices?.id === selectedServiceId,
|
|
1899
2011
|
data,
|
|
1900
2012
|
defaultServiceId,
|
|
1901
2013
|
defaultResourceId,
|
|
@@ -1914,7 +2026,9 @@ function useHeadlessBookingFlow(options) {
|
|
|
1914
2026
|
runtimeForm,
|
|
1915
2027
|
options.requiresResourceSelection,
|
|
1916
2028
|
options.requiresServiceSelection,
|
|
1917
|
-
|
|
2029
|
+
services,
|
|
2030
|
+
state.paymentChoices,
|
|
2031
|
+
selectedServiceId,
|
|
1918
2032
|
state.currentStepId
|
|
1919
2033
|
]);
|
|
1920
2034
|
const { availableDates, isLoading: isLoadingDates, error: datesError, hasMore, loadMore, loadedRange: availableDatesLoadedRange } = useAvailableDates({
|
|
@@ -2002,7 +2116,8 @@ function useHeadlessBookingFlow(options) {
|
|
|
2002
2116
|
nowIso: bookingNowIso,
|
|
2003
2117
|
form: runtimeForm,
|
|
2004
2118
|
formId: formKey,
|
|
2005
|
-
services
|
|
2119
|
+
services,
|
|
2120
|
+
promisedDiscountId: resolveDisclosedBookingDiscountId(discountUi),
|
|
2006
2121
|
defaultServiceId,
|
|
2007
2122
|
defaultResourceId,
|
|
2008
2123
|
requiresResourceSelection: options.requiresResourceSelection,
|
|
@@ -2089,6 +2204,8 @@ function useHeadlessBookingFlow(options) {
|
|
|
2089
2204
|
confirmationSummary: paymentConfirmationSummary
|
|
2090
2205
|
};
|
|
2091
2206
|
return {
|
|
2207
|
+
review: state.review,
|
|
2208
|
+
paymentAnchorAt: bookingNowIso,
|
|
2092
2209
|
mailingList,
|
|
2093
2210
|
mailingListOptIn: state.mailingListOptIn,
|
|
2094
2211
|
status,
|
|
@@ -2097,7 +2214,7 @@ function useHeadlessBookingFlow(options) {
|
|
|
2097
2214
|
currentStep: stepState.currentStep,
|
|
2098
2215
|
data,
|
|
2099
2216
|
services: {
|
|
2100
|
-
items:
|
|
2217
|
+
items: services,
|
|
2101
2218
|
categories: readServiceCategories(options),
|
|
2102
2219
|
selected: selectedService,
|
|
2103
2220
|
defaultServiceId,
|
|
@@ -2170,6 +2287,9 @@ function readServiceCategories(options) {
|
|
|
2170
2287
|
function navigateToCheckout(checkoutUrl) {
|
|
2171
2288
|
window.location.href = checkoutUrl;
|
|
2172
2289
|
}
|
|
2290
|
+
function resolveDisclosedBookingDiscountId(discount) {
|
|
2291
|
+
return discount.discountsAvailableLoading || discount.discountCode.trim() ? void 0 : discount.autoAppliedDiscount?.id;
|
|
2292
|
+
}
|
|
2173
2293
|
//#endregion
|
|
2174
2294
|
//#region ../blocks/src/system/runtime/hooks/useAppointmentCheckoutVerification.ts
|
|
2175
2295
|
const APPOINTMENT_CHECKOUT_MAX_ATTEMPTS = 12;
|
|
@@ -2505,8 +2625,8 @@ function resolvePrimaryActionLabel(isLastStep, requiresPayment) {
|
|
|
2505
2625
|
if (!isLastStep) return "Continue";
|
|
2506
2626
|
return requiresPayment ? "Continue to payment" : "Complete";
|
|
2507
2627
|
}
|
|
2508
|
-
function formatBookingConfirmationDateTime(booking) {
|
|
2509
|
-
const startAt = booking.currentStep?.id === "datetime-selection" ? booking.availability.selectedSlot?.startAt : void 0;
|
|
2628
|
+
function formatBookingConfirmationDateTime(booking, includeSelection = false) {
|
|
2629
|
+
const startAt = includeSelection || booking.currentStep?.id === "datetime-selection" ? booking.availability.selectedSlot?.startAt : void 0;
|
|
2510
2630
|
return startAt ? new Intl.DateTimeFormat(void 0, {
|
|
2511
2631
|
dateStyle: "medium",
|
|
2512
2632
|
timeStyle: "short",
|
|
@@ -2538,8 +2658,9 @@ function BookingFormSubmitActions({ booking, onSubmit }) {
|
|
|
2538
2658
|
const handlePrimaryAction = async () => {
|
|
2539
2659
|
if ((await booking.actions.next()).ok && isLastStep) await onSubmit();
|
|
2540
2660
|
};
|
|
2541
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(
|
|
2661
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(BookingSubmissionSummary, {
|
|
2542
2662
|
booking,
|
|
2663
|
+
isLastStep,
|
|
2543
2664
|
summary: paymentSummary
|
|
2544
2665
|
}), /* @__PURE__ */ jsxs("div", {
|
|
2545
2666
|
className: "rb-wizard-actions",
|
|
@@ -2557,7 +2678,7 @@ function BookingFormSubmitActions({ booking, onSubmit }) {
|
|
|
2557
2678
|
disabled: isSubmitting,
|
|
2558
2679
|
variant: "primary",
|
|
2559
2680
|
size: "md",
|
|
2560
|
-
label:
|
|
2681
|
+
label: bookingPrimaryActionLabel(booking, isLastStep, paymentSummary),
|
|
2561
2682
|
pending: isSubmitting ? {
|
|
2562
2683
|
label: "Submitting...",
|
|
2563
2684
|
srLabel: "Submitting"
|
|
@@ -2565,6 +2686,72 @@ function BookingFormSubmitActions({ booking, onSubmit }) {
|
|
|
2565
2686
|
})]
|
|
2566
2687
|
})] });
|
|
2567
2688
|
}
|
|
2689
|
+
function reviewedActionLabel(review) {
|
|
2690
|
+
if (review.terms.dueNowCents > 0) return "Continue to payment";
|
|
2691
|
+
return review.terms.totalCents > 0 ? `Confirm booking at ${formatCurrencyAmount(review.terms.totalCents, review.terms.currency, { decimals: "auto" })}` : "Confirm booking";
|
|
2692
|
+
}
|
|
2693
|
+
function BookingOfferReview({ review, booking }) {
|
|
2694
|
+
const payment = buildReviewedBookingPaymentViewModel({
|
|
2695
|
+
terms: review.terms,
|
|
2696
|
+
bookingStartAt: booking.availability.selectedSlot?.startAt ?? null,
|
|
2697
|
+
anchorAt: booking.paymentAnchorAt
|
|
2698
|
+
});
|
|
2699
|
+
const money = (amount) => formatCurrencyAmount(amount, review.terms.currency, { decimals: "auto" });
|
|
2700
|
+
return /* @__PURE__ */ jsxs("section", {
|
|
2701
|
+
className: "rb-reg-summary",
|
|
2702
|
+
"aria-label": "Updated booking price",
|
|
2703
|
+
"aria-live": "polite",
|
|
2704
|
+
children: [
|
|
2705
|
+
/* @__PURE__ */ jsx("p", {
|
|
2706
|
+
className: "ab-text",
|
|
2707
|
+
children: review.reason === "discount_unavailable" ? "The discount previously shown is no longer available for this booking. Please review the updated price before continuing." : review.reason === "payment_terms_changed" ? "The payment details have changed. Please review them before continuing." : "The amount due has changed. Please review the updated price before continuing."
|
|
2708
|
+
}),
|
|
2709
|
+
/* @__PURE__ */ jsxs("dl", { children: [
|
|
2710
|
+
/* @__PURE__ */ jsx("dt", { children: "Price" }),
|
|
2711
|
+
/* @__PURE__ */ jsx("dd", { children: money(review.subtotalCents) }),
|
|
2712
|
+
review.discountCents > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("dt", { children: "Discount" }), /* @__PURE__ */ jsx("dd", { children: money(review.discountCents) })] }) : null,
|
|
2713
|
+
review.creditCents > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("dt", { children: "Account credit applied" }), /* @__PURE__ */ jsx("dd", { children: money(review.creditCents) })] }) : null,
|
|
2714
|
+
payment ? payment.summaryRows.map((row) => /* @__PURE__ */ jsxs(React.Fragment, { children: [/* @__PURE__ */ jsx("dt", { children: row.label }), /* @__PURE__ */ jsx("dd", { children: row.value })] }, row.label)) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2715
|
+
/* @__PURE__ */ jsx("dt", { children: "Total" }),
|
|
2716
|
+
/* @__PURE__ */ jsx("dd", { children: money(review.terms.totalCents) }),
|
|
2717
|
+
/* @__PURE__ */ jsx("dt", { children: "Due today" }),
|
|
2718
|
+
/* @__PURE__ */ jsx("dd", { children: money(0) })
|
|
2719
|
+
] })
|
|
2720
|
+
] }),
|
|
2721
|
+
payment?.helperText ? /* @__PURE__ */ jsx("p", {
|
|
2722
|
+
className: "ab-text rb-on-surface--muted",
|
|
2723
|
+
children: payment.helperText
|
|
2724
|
+
}) : null
|
|
2725
|
+
]
|
|
2726
|
+
});
|
|
2727
|
+
}
|
|
2728
|
+
function bookingPrimaryActionLabel(booking, isLastStep, summary) {
|
|
2729
|
+
return isLastStep && booking.review ? reviewedActionLabel(booking.review) : resolvePrimaryActionLabel(isLastStep, Boolean(summary));
|
|
2730
|
+
}
|
|
2731
|
+
function BookingSubmissionSummary({ booking, isLastStep, summary }) {
|
|
2732
|
+
return isLastStep && booking.review ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(BookingReviewIdentity, { booking }), /* @__PURE__ */ jsx(BookingOfferReview, {
|
|
2733
|
+
review: booking.review,
|
|
2734
|
+
booking
|
|
2735
|
+
})] }) : /* @__PURE__ */ jsx(BookingPaymentConfirmationText, {
|
|
2736
|
+
booking,
|
|
2737
|
+
summary
|
|
2738
|
+
});
|
|
2739
|
+
}
|
|
2740
|
+
function BookingReviewIdentity({ booking }) {
|
|
2741
|
+
const service = booking.services.selected;
|
|
2742
|
+
if (!service) return null;
|
|
2743
|
+
const dateTime = formatBookingConfirmationDateTime(booking, true);
|
|
2744
|
+
return /* @__PURE__ */ jsxs("p", {
|
|
2745
|
+
className: "ab-text rb-on-surface--muted",
|
|
2746
|
+
children: [
|
|
2747
|
+
service.title,
|
|
2748
|
+
" · ",
|
|
2749
|
+
service.durationMinutes,
|
|
2750
|
+
" min",
|
|
2751
|
+
dateTime ? ` · ${dateTime}` : ""
|
|
2752
|
+
]
|
|
2753
|
+
});
|
|
2754
|
+
}
|
|
2568
2755
|
//#endregion
|
|
2569
2756
|
//#region ../blocks/src/system/runtime/nodes/booking-form.default-ui.tsx
|
|
2570
2757
|
function formatBookingAmount(amount, currency) {
|
|
@@ -2847,53 +3034,32 @@ function HeadlessBookingPaymentSelectionStep({ booking }) {
|
|
|
2847
3034
|
})
|
|
2848
3035
|
]
|
|
2849
3036
|
}) : null,
|
|
2850
|
-
/* @__PURE__ */
|
|
2851
|
-
className: "rb-reg-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
id: option.kind,
|
|
2877
|
-
title: option.title,
|
|
2878
|
-
description: option.description,
|
|
2879
|
-
summaryRows: option.summaryRows,
|
|
2880
|
-
helperText: option.helperText
|
|
2881
|
-
})
|
|
2882
|
-
}, option.kind);
|
|
2883
|
-
return /* @__PURE__ */ jsxs("button", {
|
|
2884
|
-
type: "button",
|
|
2885
|
-
className: optionCardClassName(isSelected),
|
|
2886
|
-
onClick: () => booking.actions.selectPaymentOption(option.kind),
|
|
2887
|
-
"aria-pressed": isSelected,
|
|
2888
|
-
children: [/* @__PURE__ */ jsx(PaymentOptionContent, {
|
|
2889
|
-
id: option.kind,
|
|
2890
|
-
title: option.title,
|
|
2891
|
-
description: option.description,
|
|
2892
|
-
summaryRows: option.summaryRows,
|
|
2893
|
-
helperText: option.helperText
|
|
2894
|
-
}), isSelected ? /* @__PURE__ */ jsx(SelectedCheck, {}) : null]
|
|
2895
|
-
}, option.kind);
|
|
2896
|
-
})]
|
|
3037
|
+
viewModel.mode === "single_option" && !hasPackageOptions ? viewModel.options.map((option) => /* @__PURE__ */ jsx("div", {
|
|
3038
|
+
className: "rb-reg-summary",
|
|
3039
|
+
children: /* @__PURE__ */ jsx(PaymentOptionContent, {
|
|
3040
|
+
id: option.kind,
|
|
3041
|
+
title: option.title,
|
|
3042
|
+
description: option.description,
|
|
3043
|
+
summaryRows: option.summaryRows,
|
|
3044
|
+
helperText: option.helperText
|
|
3045
|
+
})
|
|
3046
|
+
}, option.kind)) : /* @__PURE__ */ jsx(PaymentChoiceRows, {
|
|
3047
|
+
label: "Payment options",
|
|
3048
|
+
rows: [...packageOptions.map((appointmentPackage) => ({
|
|
3049
|
+
id: appointmentPackage.customerPassId,
|
|
3050
|
+
label: appointmentPackage.passName,
|
|
3051
|
+
details: ["Use 1 package credit", `Balance: ${appointmentPackage.creditsRemaining} of ${appointmentPackage.creditsTotal} credits remaining`],
|
|
3052
|
+
price: "1 credit",
|
|
3053
|
+
selected: booking.payment.selectedAppointmentPackageId === appointmentPackage.customerPassId,
|
|
3054
|
+
onSelect: () => booking.actions.selectAppointmentPackage(appointmentPackage.customerPassId)
|
|
3055
|
+
})), ...viewModel.options.map((option) => ({
|
|
3056
|
+
id: option.kind,
|
|
3057
|
+
label: option.title,
|
|
3058
|
+
details: paymentChoiceDetails(option),
|
|
3059
|
+
price: paymentChoicePrice(option.amounts),
|
|
3060
|
+
selected: !booking.payment.selectedAppointmentPackageId && (booking.payment.selectedCollectionOptionKind === option.kind || viewModel.mode === "single_option"),
|
|
3061
|
+
onSelect: () => booking.actions.selectPaymentOption(option.kind)
|
|
3062
|
+
}))]
|
|
2897
3063
|
})
|
|
2898
3064
|
]
|
|
2899
3065
|
});
|
|
@@ -3155,7 +3321,7 @@ function DefaultBookingDiscount({ booking }) {
|
|
|
3155
3321
|
booking.discount.clear();
|
|
3156
3322
|
booking.discount.setOpen(false);
|
|
3157
3323
|
}
|
|
3158
|
-
}) : null, booking.discount.autoAppliedDiscount && booking.discount.code.trim().length === 0 ? /* @__PURE__ */ jsx(FeedbackMessage, {
|
|
3324
|
+
}) : null, !booking.review && booking.discount.autoAppliedDiscount && booking.discount.code.trim().length === 0 ? /* @__PURE__ */ jsx(FeedbackMessage, {
|
|
3159
3325
|
tone: "info",
|
|
3160
3326
|
className: "alert alert-info rb-mt-4",
|
|
3161
3327
|
role: "status",
|
|
@@ -3305,11 +3471,12 @@ function appendRebookFlag(url, enabled) {
|
|
|
3305
3471
|
function createBookingFormSubmitHandler(input) {
|
|
3306
3472
|
return async () => {
|
|
3307
3473
|
const { successUrl, cancelUrl } = buildCheckoutReturnUrls("booking", input.bookingAnchorId);
|
|
3308
|
-
const
|
|
3474
|
+
const options = {
|
|
3309
3475
|
redirect: "manual",
|
|
3310
3476
|
successUrl: appendRebookFlag(successUrl, input.isPortalRebook),
|
|
3311
3477
|
cancelUrl: appendRebookFlag(cancelUrl, input.isPortalRebook)
|
|
3312
|
-
}
|
|
3478
|
+
};
|
|
3479
|
+
const result = input.booking.review ? await input.booking.actions.acceptReview(input.booking.review, options) : await input.booking.actions.submit(options);
|
|
3313
3480
|
if (!result.ok) return;
|
|
3314
3481
|
storeDemoBookingPassIfAvailable(result.outcome.customerEmail, result.outcome.demoBookingPass);
|
|
3315
3482
|
if (result.outcome.kind === "checkout_redirect") {
|