@riverbankcms/sdk 0.140.0 → 0.142.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/dist/{PreviewEditorSidebar-CUyTzd5z.mjs → PreviewEditorSidebar-Dk6Dt11f.mjs} +24 -15
- package/dist/{PreviewEditorUI-Agkw4v5i.mjs → PreviewEditorUI-D6EQTsCA.mjs} +3 -3
- package/dist/{PreviewQueryProvider-CN0ewic5.mjs → PreviewQueryProvider-CC-EPkyQ.mjs} +1 -1
- package/dist/{SdkPreviewModeRuntime-DdbeAdS8.mjs → SdkPreviewModeRuntime-DH1n4ytY.mjs} +85 -54
- package/dist/{SiteChromeCustomizeContext-CqGOz-Kv.mjs → SiteChromeCustomizeContext-DunIzY0K.mjs} +797 -216
- package/dist/_dts/api/src/billing.d.ts +6 -1
- package/dist/_dts/api/src/bookingConfig.d.ts +1 -1
- package/dist/_dts/api/src/commercePortalEndpoints.d.ts +2 -2
- package/dist/_dts/api/src/contentRuntime.d.ts +12 -31
- package/dist/_dts/api/src/domainConnection.d.ts +4 -0
- package/dist/_dts/api/src/endpoints.d.ts +0 -27
- package/dist/_dts/api/src/footerCompositionContracts.d.ts +25 -0
- package/dist/_dts/api/src/index.d.ts +2 -2
- package/dist/_dts/api/src/launchReadiness.d.ts +1 -0
- package/dist/_dts/api/src/navigation/dashboardSiteNav.d.ts +2 -1
- package/dist/_dts/api/src/publicBookingService.d.ts +1 -0
- package/dist/_dts/api/src/sdkConfig/layout.d.ts +13 -0
- package/dist/_dts/api/src/sdkContracts.d.ts +3 -8
- package/dist/_dts/api/src/siteManagementEndpoints.d.ts +3 -26
- package/dist/_dts/api/src/siteOnboarding.d.ts +7 -0
- package/dist/_dts/api/src/sitePlatformEndpoints.d.ts +1 -31
- package/dist/_dts/api/src/siteRuntimeEndpoints.d.ts +6 -1
- package/dist/_dts/billing/src/site-arrangements.d.ts +18 -5
- package/dist/_dts/blocks/src/contracts/proof-block-islands.d.ts +4 -0
- package/dist/_dts/blocks/src/pageRendererContracts.d.ts +2 -0
- package/dist/_dts/blocks/src/system/blocks/events/event-calendar.d.ts +2 -0
- package/dist/_dts/blocks/src/system/blocks/events/eventSelectionFields.d.ts +122 -0
- package/dist/_dts/blocks/src/system/blocks/events/shared/calendarWindow.d.ts +2 -1
- package/dist/_dts/blocks/src/system/blocks/events/shared/eventSelection.d.ts +11 -0
- package/dist/_dts/blocks/src/system/blocks/events/shared/schemas.d.ts +56 -0
- package/dist/_dts/blocks/src/system/blocks/events/shared/types.d.ts +8 -0
- package/dist/_dts/blocks/src/system/blocks/location-map.d.ts +2 -2
- package/dist/_dts/blocks/src/system/blocks/media-text.d.ts +47 -47
- package/dist/_dts/blocks/src/system/data/prefetchBlockData.d.ts +5 -0
- package/dist/_dts/blocks/src/system/data/utils.d.ts +1 -1
- package/dist/_dts/blocks/src/system/manifest/schema.d.ts +27 -1
- package/dist/_dts/blocks/src/system/runtime/components/registry.client.d.ts +12 -180
- package/dist/_dts/blocks/src/system/runtime/components/runtime-backed-blocks.d.ts +6 -90
- package/dist/_dts/blocks/src/system/runtime/hooks/useEventFilters.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/appointment-services.d.ts +5 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/hooks.d.ts +4 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/hooks.state.d.ts +5 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useDiscountCodeUi.d.ts +3 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useDiscountCodeUi.state.d.ts +10 -3
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventCheckoutHandoffRestore.d.ts +9 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationWizard.d.ts +4 -5
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useSettledCommerceView.d.ts +37 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/events/EventCombined.client.d.ts +4 -3
- package/dist/_dts/blocks/src/system/runtime/nodes/events/EventCombined.interactive.d.ts +3 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/events/EventListing.interactive.d.ts +11 -101
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/eventCollectionContract.d.ts +63 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/listOptions.d.ts +2 -0
- package/dist/_dts/blocks/src/system/transforms/registry/eventCalendar.d.ts +12 -0
- package/dist/_dts/commerce/src/purchase/bookingInstalmentSchedule.d.ts +4 -0
- package/dist/_dts/commerce/src/purchase/stripeCommissionMetadata.d.ts +1 -2
- package/dist/_dts/db/src/generated/supabase/database.types.d.ts +3102 -3122
- package/dist/_dts/editor-blocks/src/block-editor/ColourFieldOptionsProvider.d.ts +7 -0
- package/dist/_dts/editor-blocks/src/block-editor/colourFieldVisibility.d.ts +7 -0
- package/dist/_dts/editor-blocks/src/block-editor/preparedManifest.d.ts +2 -0
- package/dist/_dts/editor-blocks/src/index.d.ts +1 -0
- package/dist/_dts/editor-blocks/src/widgets/site-option-picker/loaders.d.ts +27 -1
- package/dist/_dts/preview-next/src/client/preview/PreviewEditorSidebar.d.ts +2 -2
- package/dist/_dts/preview-next/src/client/preview/PreviewFooterEditorPanel.d.ts +3 -6
- package/dist/_dts/preview-next/src/client/preview/PreviewShell.d.ts +2 -2
- package/dist/_dts/preview-next/src/client/preview/PreviewShellLayout.d.ts +2 -2
- package/dist/_dts/preview-next/src/client/preview/footerInspection.d.ts +16 -0
- package/dist/_dts/preview-next/src/client/preview/sdkConfig.d.ts +6 -0
- package/dist/_dts/sdk/src/config/types.d.ts +2 -18
- package/dist/_dts/sdk/src/config/validation.d.ts +6 -0
- package/dist/_dts/sdk/src/public-api/contracts.d.ts +4 -1
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/_dts/theme-core/src/ThemeFontLoader.d.ts +17 -1
- package/dist/_dts/theme-core/src/buttons/affordanceSuppression.d.ts +17 -0
- package/dist/_dts/theme-core/src/buttons/buttonColourContract.d.ts +1 -1
- package/dist/_dts/theme-core/src/buttons/classNames.d.ts +16 -0
- package/dist/_dts/theme-core/src/buttons/generateButtonCss.d.ts +0 -6
- package/dist/_dts/theme-core/src/buttons/resolvedButtonCss.d.ts +4 -4
- package/dist/_dts/theme-core/src/footer/mode.d.ts +10 -1
- package/dist/_dts/theme-core/src/generated/containerResponsiveThemeCss.d.ts +1 -1
- package/dist/_dts/theme-core/src/hosted-booking-appearance.d.ts +54 -12
- package/dist/_dts/theme-core/src/index.d.ts +1 -1
- package/dist/_dts/theme-core/src/schema.d.ts +1 -7
- package/dist/_dts/theme-core/src/site-styles/effectivePageDesign.d.ts +32 -0
- package/dist/_dts/theme-core/src/site-styles/index.d.ts +1 -0
- package/dist/client/{BookingConsentAgreement-CuKa82V4.mjs → BookingConsentAgreement-CnJeq3_r.mjs} +2 -2
- package/dist/client/{DiscountCodeDisclosure-BbYieKWB.mjs → DiscountCodeDisclosure-BINEO6J9.mjs} +1 -1
- package/dist/client/{EventCombined.client-LTfR1Aby.mjs → EventCombined.client-srxNQ6sZ.mjs} +11 -15
- package/dist/client/{EventListing.client-DUHpYSuo.mjs → EventListing.client-DbyVyGkX.mjs} +4 -17
- package/dist/client/{LeafletStaticMap-CHRupL6m.mjs → LeafletStaticMap-B-wpijzL.mjs} +1 -1
- package/dist/client/{accordion-6HiIFxNL.mjs → accordion-B-iUXU7n.mjs} +1 -1
- package/dist/client/{bookingForm-Dlmid43H.mjs → bookingForm-BXYPke5q.mjs} +5 -5
- package/dist/client/bookings.mjs +194 -102
- package/dist/client/{carousel-DmkZRRq_.mjs → carousel-Cr4aj63H.mjs} +1 -1
- package/dist/client/{cart-CIC24330.mjs → cart-DibP9WWa.mjs} +3 -3
- package/dist/client/{checkout-D1Zw9imo.mjs → checkout-CrSBVnL8.mjs} +3 -3
- package/dist/client/client.mjs +643 -192
- package/dist/client/{context-Cy1OayHx.mjs → context-Ces-AgdR.mjs} +1 -1
- package/dist/client/{dates-aDcfoLHr.mjs → dates-BXyNeNhB.mjs} +2 -2
- package/dist/client/{eventCalendar-FQxMPAjf.mjs → eventCalendar-HwpPeqrH.mjs} +11 -7
- package/dist/client/{eventCombined-Dr3ac6Hb.mjs → eventCombined-BpFUkuEI.mjs} +3 -3
- package/dist/client/{eventDetails-D-AzUHFQ.mjs → eventDetails-DK_agiWy.mjs} +4 -4
- package/dist/client/{eventListing-B3XxBf3i.mjs → eventListing-DhzHqP1c.mjs} +3 -3
- package/dist/client/{eventRegistration-I6EaokFD.mjs → eventRegistration-BdQ_Dn2d.mjs} +124 -32
- package/dist/client/{form-BbWckVWY.mjs → form-B1frcuzy.mjs} +2 -2
- package/dist/client/{headerSection-C9qU4Y7x.mjs → headerSection-CT5z460s.mjs} +2 -2
- package/dist/client/hooks.mjs +274 -45
- package/dist/client/{locationMap-CLCShvlG.mjs → locationMap-CIQXB9i2.mjs} +2 -2
- package/dist/client/{newsletterForm-Briukxzi.mjs → newsletterForm-BYNYZSes.mjs} +23 -10
- package/dist/client/{pricing-Copadu-2.mjs → pricing-CbTlAsmt.mjs} +1 -1
- package/dist/client/{productDetail-oujlRd-r.mjs → productDetail-CR7Z3yjS.mjs} +3 -3
- package/dist/client/{productList-BRiIRUcd.mjs → productList-DXj00vzR.mjs} +3 -3
- package/dist/client/{propsDecoder-CB2KS_ko.mjs → propsDecoder-DiLiBdek.mjs} +57 -16
- package/dist/client/rendering/client.mjs +476 -132
- package/dist/client/rendering/islands.mjs +17 -17
- package/dist/client/rendering.mjs +686 -195
- package/dist/client/{scrollToBlock-B1IS1_ua.mjs → scrollToBlock-CrcbBf0h.mjs} +28 -11
- package/dist/client/{shop-Vn6yNFED.mjs → shop-DgqiB_1b.mjs} +6 -6
- package/dist/client/{shop-commerce-BVTqipYp.mjs → shop-commerce-D_J781in.mjs} +5 -5
- package/dist/client/{shop-commerce-store-BVnJVy7v.mjs → shop-commerce-store-PGUbDwqe.mjs} +1 -1
- package/dist/client/{shopShared-COIeK77T.mjs → shopShared-C_Bb2zwG.mjs} +3 -3
- package/dist/client/{useEventFilters-DzIUcS9n.mjs → useEventFilters-CM17Xpr1.mjs} +17 -11
- package/dist/preview-next/before-render.mjs +0 -37
- package/dist/preview-next/client/runtime.mjs +4 -4
- package/dist/preview-next/editor-chrome.css +4 -8
- package/dist/preview-next/keepAlive.mjs +0 -37
- package/dist/preview-next/middleware.mjs +0 -37
- package/dist/{previewAuthStore-Gjb6r6vz.mjs → previewAuthStore-oVttoRDO.mjs} +0 -37
- package/dist/{sdk-runtime-CnCLvZRv.mjs → sdk-runtime-DhmuRhIX.mjs} +2 -2
- package/dist/{separator-DKDRJ1oH.mjs → separator-C3hlg9LH.mjs} +1 -1
- package/dist/server/components.mjs +452 -111
- package/dist/server/config-validation.mjs +263 -40
- package/dist/server/config.mjs +263 -40
- package/dist/server/data.mjs +274 -45
- package/dist/server/index.mjs +1 -38
- package/dist/server/next.mjs +427 -119
- package/dist/server/page-converter.mjs +208 -33
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +467 -119
- package/dist/server/rendering.mjs +467 -117
- package/dist/server/routing.mjs +301 -50
- package/dist/server/server.mjs +275 -83
- package/dist/server/theme-bridge.mjs +57 -23
- package/dist/server/theme.mjs +11 -9
- package/dist/styles/index.css +28 -2
- package/package.json +1 -1
package/dist/client/bookings.mjs
CHANGED
|
@@ -3114,6 +3114,14 @@ function orderedLiveRunSessions(sessions) {
|
|
|
3114
3114
|
return sessions.filter((session) => session.status !== "cancelled" && Number.isFinite(sessionStartMs(session))).sort((left, right) => sessionStartMs(left) - sessionStartMs(right));
|
|
3115
3115
|
}
|
|
3116
3116
|
//#endregion
|
|
3117
|
+
//#region ../theme-core/src/footer/mode.ts
|
|
3118
|
+
const footerModeSchema = z.enum([
|
|
3119
|
+
"default",
|
|
3120
|
+
"blocks",
|
|
3121
|
+
"default+blocks",
|
|
3122
|
+
"none"
|
|
3123
|
+
]);
|
|
3124
|
+
//#endregion
|
|
3117
3125
|
//#region ../theme-core/src/lib/media.ts
|
|
3118
3126
|
const hotspotSchema = z.object({
|
|
3119
3127
|
x: z.number().min(0).max(1),
|
|
@@ -7447,12 +7455,6 @@ const footerVariant = z.enum([
|
|
|
7447
7455
|
"split"
|
|
7448
7456
|
]);
|
|
7449
7457
|
const footerMaxWidth = z.enum(["container", "full"]);
|
|
7450
|
-
const footerMode = z.enum([
|
|
7451
|
-
"default",
|
|
7452
|
-
"blocks",
|
|
7453
|
-
"default+blocks",
|
|
7454
|
-
"none"
|
|
7455
|
-
]);
|
|
7456
7458
|
const footerNavLayoutMode = z.enum([
|
|
7457
7459
|
"stack",
|
|
7458
7460
|
"inline",
|
|
@@ -7541,9 +7543,9 @@ const footerSchema = z.object({
|
|
|
7541
7543
|
/**
|
|
7542
7544
|
* SDK-only footer rendering mode.
|
|
7543
7545
|
*
|
|
7544
|
-
*
|
|
7546
|
+
* Historical persisted field; SDK rendering mode now lives in layout.footerMode.
|
|
7545
7547
|
*/
|
|
7546
|
-
mode:
|
|
7548
|
+
mode: footerModeSchema.optional(),
|
|
7547
7549
|
variant: footerVariant,
|
|
7548
7550
|
maxWidth: footerMaxWidth,
|
|
7549
7551
|
showLogoText: z.boolean().optional(),
|
|
@@ -8125,6 +8127,15 @@ const publicEventBaseSchema = z.object({
|
|
|
8125
8127
|
timeZone: z.string(),
|
|
8126
8128
|
pricing: publicEventPricingSchema,
|
|
8127
8129
|
paymentTerms: blockBookingPaymentTermsSchema,
|
|
8130
|
+
cancellationPolicy: z.object({ refunds: z.object({
|
|
8131
|
+
mode: z.enum([
|
|
8132
|
+
"never",
|
|
8133
|
+
"always",
|
|
8134
|
+
"cutoff"
|
|
8135
|
+
]),
|
|
8136
|
+
cutoffHours: z.number(),
|
|
8137
|
+
method: z.enum(["original_payment_method", "site_credit"])
|
|
8138
|
+
}) }),
|
|
8128
8139
|
consent: blockBookingConsentSchema.nullable(),
|
|
8129
8140
|
accessRestriction: accessRestrictionSchema,
|
|
8130
8141
|
allowedCategoryIds: z.array(z.string()),
|
|
@@ -8196,6 +8207,7 @@ z.object({
|
|
|
8196
8207
|
eventSurface: z.enum(eventSurfaceScopeValues).optional(),
|
|
8197
8208
|
eventPresets: z.string().optional(),
|
|
8198
8209
|
scheduleScope: z.enum(eventScheduleScopeValues).optional(),
|
|
8210
|
+
seriesIds: z.string().optional(),
|
|
8199
8211
|
categoryIds: z.string().optional(),
|
|
8200
8212
|
venueId: z.string().transform(normalizeCalendarFilterId).optional(),
|
|
8201
8213
|
staffMemberId: z.string().transform(normalizeCalendarFilterId).optional()
|
|
@@ -10625,10 +10637,14 @@ function buildDiscountAvailabilityRequestPlan(options) {
|
|
|
10625
10637
|
}
|
|
10626
10638
|
};
|
|
10627
10639
|
}
|
|
10628
|
-
function discountAvailabilityStateFromResponse(response) {
|
|
10629
|
-
if (!discountAvailabilityHasDiscounts(response)) return {
|
|
10640
|
+
function discountAvailabilityStateFromResponse(requestKey, response) {
|
|
10641
|
+
if (!discountAvailabilityHasDiscounts(response)) return {
|
|
10642
|
+
tag: "unavailable",
|
|
10643
|
+
requestKey
|
|
10644
|
+
};
|
|
10630
10645
|
return {
|
|
10631
10646
|
tag: "available",
|
|
10647
|
+
requestKey,
|
|
10632
10648
|
manualCodeEntryAllowed: discountAvailabilityAllowsManualEntry(response),
|
|
10633
10649
|
autoAppliedDiscount: getAutoAppliedDiscountPreview(response)
|
|
10634
10650
|
};
|
|
@@ -10638,10 +10654,13 @@ function discountCodeUiReducer(state, event) {
|
|
|
10638
10654
|
case "availability-disabled": return initialDiscountCodeUiState;
|
|
10639
10655
|
case "availability-loading": return {
|
|
10640
10656
|
...state,
|
|
10641
|
-
availability: {
|
|
10657
|
+
availability: {
|
|
10658
|
+
tag: "loading",
|
|
10659
|
+
previous: state.availability.tag === "available" || state.availability.tag === "unavailable" ? state.availability : state.availability.tag === "loading" ? state.availability.previous : null
|
|
10660
|
+
}
|
|
10642
10661
|
};
|
|
10643
10662
|
case "availability-loaded": {
|
|
10644
|
-
const availability = discountAvailabilityStateFromResponse(event.response);
|
|
10663
|
+
const availability = discountAvailabilityStateFromResponse(event.requestKey, event.response);
|
|
10645
10664
|
if (availability.tag !== "available" || !availability.manualCodeEntryAllowed) return {
|
|
10646
10665
|
...state,
|
|
10647
10666
|
discountUiOpen: false,
|
|
@@ -10657,7 +10676,10 @@ function discountCodeUiReducer(state, event) {
|
|
|
10657
10676
|
...state,
|
|
10658
10677
|
discountUiOpen: false,
|
|
10659
10678
|
discountCode: "",
|
|
10660
|
-
availability: {
|
|
10679
|
+
availability: {
|
|
10680
|
+
tag: "error",
|
|
10681
|
+
requestKey: event.requestKey
|
|
10682
|
+
}
|
|
10661
10683
|
};
|
|
10662
10684
|
case "discount-code-changed": return {
|
|
10663
10685
|
...state,
|
|
@@ -10693,11 +10715,15 @@ function useDiscountCodeUi(options) {
|
|
|
10693
10715
|
if (cancelled) return;
|
|
10694
10716
|
dispatch({
|
|
10695
10717
|
type: "availability-loaded",
|
|
10718
|
+
requestKey: requestPlan.key,
|
|
10696
10719
|
response: res
|
|
10697
10720
|
});
|
|
10698
10721
|
} catch {
|
|
10699
10722
|
if (cancelled) return;
|
|
10700
|
-
dispatch({
|
|
10723
|
+
dispatch({
|
|
10724
|
+
type: "availability-failed",
|
|
10725
|
+
requestKey: requestPlan.key
|
|
10726
|
+
});
|
|
10701
10727
|
}
|
|
10702
10728
|
}
|
|
10703
10729
|
checkDiscountAvailability();
|
|
@@ -10706,8 +10732,9 @@ function useDiscountCodeUi(options) {
|
|
|
10706
10732
|
};
|
|
10707
10733
|
}, [options.api, requestPlan]);
|
|
10708
10734
|
const availability = state.availability;
|
|
10709
|
-
const
|
|
10710
|
-
const
|
|
10735
|
+
const settledAvailability = availability.tag === "loading" ? availability.previous : availability.tag === "available" || availability.tag === "unavailable" ? availability : null;
|
|
10736
|
+
const isAvailable = settledAvailability?.tag === "available";
|
|
10737
|
+
const manualCodeEntryAllowed = isAvailable ? settledAvailability.manualCodeEntryAllowed : false;
|
|
10711
10738
|
return {
|
|
10712
10739
|
discountUiOpen: state.discountUiOpen,
|
|
10713
10740
|
setDiscountUiOpen: (isOpen) => dispatch({
|
|
@@ -10721,8 +10748,10 @@ function useDiscountCodeUi(options) {
|
|
|
10721
10748
|
}),
|
|
10722
10749
|
discountsAvailable: isAvailable,
|
|
10723
10750
|
manualCodeEntryAllowed,
|
|
10724
|
-
autoAppliedDiscount: isAvailable ?
|
|
10725
|
-
discountsAvailableLoading: availability.tag === "loading"
|
|
10751
|
+
autoAppliedDiscount: isAvailable ? settledAvailability.autoAppliedDiscount : null,
|
|
10752
|
+
discountsAvailableLoading: availability.tag === "loading",
|
|
10753
|
+
discountAvailabilityRequestKey: requestPlan.key,
|
|
10754
|
+
settledDiscountAvailabilityRequestKey: availability.tag === "error" ? availability.requestKey : settledAvailability?.requestKey ?? null
|
|
10726
10755
|
};
|
|
10727
10756
|
}
|
|
10728
10757
|
//#endregion
|
|
@@ -15249,6 +15278,7 @@ function hasValidPricingOptionSelection(input) {
|
|
|
15249
15278
|
const initialEligibilityLookupState = {
|
|
15250
15279
|
tag: "idle",
|
|
15251
15280
|
eligibility: null,
|
|
15281
|
+
settledRequestKey: null,
|
|
15252
15282
|
error: null
|
|
15253
15283
|
};
|
|
15254
15284
|
function eligibilityLookupReducer(state, action) {
|
|
@@ -15257,16 +15287,19 @@ function eligibilityLookupReducer(state, action) {
|
|
|
15257
15287
|
case "loading-started": return {
|
|
15258
15288
|
tag: "loading",
|
|
15259
15289
|
eligibility: state.eligibility,
|
|
15290
|
+
settledRequestKey: state.settledRequestKey,
|
|
15260
15291
|
error: null
|
|
15261
15292
|
};
|
|
15262
15293
|
case "resolved": return {
|
|
15263
15294
|
tag: "resolved",
|
|
15264
15295
|
eligibility: action.eligibility,
|
|
15296
|
+
settledRequestKey: action.requestKey,
|
|
15265
15297
|
error: null
|
|
15266
15298
|
};
|
|
15267
15299
|
case "failed": return {
|
|
15268
15300
|
tag: "failed",
|
|
15269
15301
|
eligibility: null,
|
|
15302
|
+
settledRequestKey: null,
|
|
15270
15303
|
error: action.message
|
|
15271
15304
|
};
|
|
15272
15305
|
default: return assertNever(action);
|
|
@@ -15372,9 +15405,23 @@ function toRegistrationOptionsSubject(subject, attendanceMode) {
|
|
|
15372
15405
|
function useEligibility(params) {
|
|
15373
15406
|
return useEligibilityWithDeps(params, eventRegistrationHooksDeps);
|
|
15374
15407
|
}
|
|
15408
|
+
function eligibilityRequestKey(params) {
|
|
15409
|
+
return JSON.stringify({
|
|
15410
|
+
enabled: params.enabled,
|
|
15411
|
+
refreshKey: params.refreshKey ?? 0,
|
|
15412
|
+
subject: params.subject,
|
|
15413
|
+
attendanceMode: params.attendanceMode ?? null,
|
|
15414
|
+
ticketSelections: params.ticketSelectionsKey,
|
|
15415
|
+
selectedSlidingAmount: params.selectedSlidingAmount ?? null
|
|
15416
|
+
});
|
|
15417
|
+
}
|
|
15375
15418
|
function useEligibilityWithDeps(params, deps) {
|
|
15376
15419
|
const api = deps.useBlockApi();
|
|
15377
15420
|
const ticketSelectionsKey = JSON.stringify(normalizeTicketSelectionLines(params.ticketSelections));
|
|
15421
|
+
const requestKey = eligibilityRequestKey({
|
|
15422
|
+
...params,
|
|
15423
|
+
ticketSelectionsKey
|
|
15424
|
+
});
|
|
15378
15425
|
const [state, dispatch] = useReducer(eligibilityLookupReducer, initialEligibilityLookupState);
|
|
15379
15426
|
const requestIdRef = useRef(0);
|
|
15380
15427
|
useEffect(() => {
|
|
@@ -15407,7 +15454,8 @@ function useEligibilityWithDeps(params, deps) {
|
|
|
15407
15454
|
if (cancelled || requestIdRef.current !== requestId) return;
|
|
15408
15455
|
dispatch({
|
|
15409
15456
|
type: "resolved",
|
|
15410
|
-
eligibility: transformRegistrationOptionsResponse(result)
|
|
15457
|
+
eligibility: transformRegistrationOptionsResponse(result),
|
|
15458
|
+
requestKey
|
|
15411
15459
|
});
|
|
15412
15460
|
} catch {
|
|
15413
15461
|
if (cancelled || requestIdRef.current !== requestId) return;
|
|
@@ -15436,6 +15484,8 @@ function useEligibilityWithDeps(params, deps) {
|
|
|
15436
15484
|
return {
|
|
15437
15485
|
state,
|
|
15438
15486
|
eligibility: state.eligibility,
|
|
15487
|
+
settledRequestKey: state.settledRequestKey,
|
|
15488
|
+
requestKey,
|
|
15439
15489
|
isLoading: state.tag === "loading",
|
|
15440
15490
|
error: state.error,
|
|
15441
15491
|
creditState
|
|
@@ -15596,7 +15646,6 @@ const STRIPE_COMMISSION_FREE_REASONS = [
|
|
|
15596
15646
|
"no_commission_plan",
|
|
15597
15647
|
"billing_evidence_invalid",
|
|
15598
15648
|
"fee_rounds_to_zero",
|
|
15599
|
-
"non_commissionable_scope",
|
|
15600
15649
|
"payment_not_stripe"
|
|
15601
15650
|
];
|
|
15602
15651
|
const historicalContext = {
|
|
@@ -16569,6 +16618,126 @@ function buildOccurrenceRegistrationRequest(options, prepared, method, passId, m
|
|
|
16569
16618
|
};
|
|
16570
16619
|
}
|
|
16571
16620
|
//#endregion
|
|
16621
|
+
//#region ../blocks/src/system/runtime/nodes/event-registration/registrationDerivations.ts
|
|
16622
|
+
function eventMatchesOccurrenceId(event, occurrenceId) {
|
|
16623
|
+
return event.registrationSubject.kind === "occurrence" && (event.registrationSubject.occurrenceId === occurrenceId || event.selectionId === occurrenceId);
|
|
16624
|
+
}
|
|
16625
|
+
function findEventByOccurrenceId(events, occurrenceId) {
|
|
16626
|
+
return events.find((event) => eventMatchesOccurrenceId(event, occurrenceId)) ?? null;
|
|
16627
|
+
}
|
|
16628
|
+
function findPreSelectedEvent(input) {
|
|
16629
|
+
const occurrenceContext = input.occurrenceContext;
|
|
16630
|
+
if (!occurrenceContext) return input.scopedEvents.length === 1 ? input.scopedEvents[0] ?? null : null;
|
|
16631
|
+
const contextDate = getBookingLocalDateKey(toScheduledBookingDateTime({
|
|
16632
|
+
startsAt: occurrenceContext.startsAt,
|
|
16633
|
+
timeZone: occurrenceContext.timeZone
|
|
16634
|
+
}));
|
|
16635
|
+
return input.scopedEvents.find((event) => eventMatchesOccurrenceId(event, occurrenceContext.id) || getBookingLocalDateKey(toScheduledBookingDateTime({
|
|
16636
|
+
startsAt: event.startsAt,
|
|
16637
|
+
timeZone: event.timeZone
|
|
16638
|
+
})) === contextDate) ?? null;
|
|
16639
|
+
}
|
|
16640
|
+
function resolveRegistrationTarget(input) {
|
|
16641
|
+
const subject = input.occurrenceContext ? {
|
|
16642
|
+
kind: "occurrence",
|
|
16643
|
+
occurrenceId: input.occurrenceContext.id
|
|
16644
|
+
} : input.selectedEvent?.registrationSubject ?? null;
|
|
16645
|
+
if (!subject) return null;
|
|
16646
|
+
return {
|
|
16647
|
+
subject,
|
|
16648
|
+
selectedEventId: input.selectedEvent?.selectionId ?? null
|
|
16649
|
+
};
|
|
16650
|
+
}
|
|
16651
|
+
function resolveEventRequiresPayment(input) {
|
|
16652
|
+
if (input.eligibility) return input.eligibility.requiresPayment;
|
|
16653
|
+
if (input.selectedTicketType) return input.selectedTicketType.priceAmount > 0;
|
|
16654
|
+
if (!input.event) return false;
|
|
16655
|
+
return publicEventPricingType(input.event.pricing) === "paid";
|
|
16656
|
+
}
|
|
16657
|
+
function resolveDiscountContext(input) {
|
|
16658
|
+
const selection = input.paymentSelection.method ? input.paymentSelection : null;
|
|
16659
|
+
if (!input.event) return null;
|
|
16660
|
+
if (selection?.method === "pass_bundle" && selection.bundlePassId) return {
|
|
16661
|
+
type: "pass",
|
|
16662
|
+
passId: selection.bundlePassId
|
|
16663
|
+
};
|
|
16664
|
+
if (selection?.method === "membership_bundle" && selection.bundleMembershipId) return {
|
|
16665
|
+
type: "membership",
|
|
16666
|
+
membershipId: selection.bundleMembershipId
|
|
16667
|
+
};
|
|
16668
|
+
if (!input.eventRequiresPayment) return null;
|
|
16669
|
+
if (input.ticketsCount <= 0) return null;
|
|
16670
|
+
if (selection?.method && selection.method !== "stripe") return null;
|
|
16671
|
+
return {
|
|
16672
|
+
type: "event",
|
|
16673
|
+
eventSeriesId: input.event.seriesId,
|
|
16674
|
+
eventCategoryId: input.event.eventCategory?.id ?? null,
|
|
16675
|
+
ticketsCount: input.ticketsCount
|
|
16676
|
+
};
|
|
16677
|
+
}
|
|
16678
|
+
//#endregion
|
|
16679
|
+
//#region ../blocks/src/system/runtime/nodes/event-registration/useSettledCommerceView.ts
|
|
16680
|
+
function buildCandidate(input) {
|
|
16681
|
+
if (!input.eligibilityIsSettled || !input.eligibility || !input.currentEvent) return null;
|
|
16682
|
+
return {
|
|
16683
|
+
eventSelectionId: input.currentEvent.selectionId,
|
|
16684
|
+
discountContext: resolveDiscountContext({
|
|
16685
|
+
paymentSelection: input.paymentSelection,
|
|
16686
|
+
event: input.currentEvent,
|
|
16687
|
+
eventRequiresPayment: input.eventRequiresPayment,
|
|
16688
|
+
ticketsCount: input.ticketsCount
|
|
16689
|
+
}),
|
|
16690
|
+
subtotalCents: input.eligibility.price,
|
|
16691
|
+
summaryLines: input.eligibility.ticketLines.map((line) => ({
|
|
16692
|
+
pricingOptionId: line.pricingOptionId,
|
|
16693
|
+
label: line.label,
|
|
16694
|
+
quantity: line.quantity,
|
|
16695
|
+
unitPriceCents: line.unitPriceCents,
|
|
16696
|
+
subtotalCents: line.subtotalCents
|
|
16697
|
+
}))
|
|
16698
|
+
};
|
|
16699
|
+
}
|
|
16700
|
+
function eligibilityIsSettled(result) {
|
|
16701
|
+
return result.settledRequestKey === result.requestKey;
|
|
16702
|
+
}
|
|
16703
|
+
function viewIsStale(view, currentEvent, eligibilityState) {
|
|
16704
|
+
return view.eventSelectionId !== currentEvent?.selectionId || eligibilityState?.tag === "failed" || eligibilityState?.tag === "idle";
|
|
16705
|
+
}
|
|
16706
|
+
function requestIsSettled(discountUi) {
|
|
16707
|
+
return discountUi.discountAvailabilityRequestKey === "disabled" || discountUi.settledDiscountAvailabilityRequestKey === discountUi.discountAvailabilityRequestKey;
|
|
16708
|
+
}
|
|
16709
|
+
function discountRequest(view) {
|
|
16710
|
+
const discountContext = view?.discountContext ?? null;
|
|
16711
|
+
return {
|
|
16712
|
+
discountContext,
|
|
16713
|
+
subtotalCents: discountContext?.type === "event" && view?.subtotalCents !== null ? view?.subtotalCents : void 0
|
|
16714
|
+
};
|
|
16715
|
+
}
|
|
16716
|
+
function useSettledCommerceView(input) {
|
|
16717
|
+
const candidate = buildCandidate({
|
|
16718
|
+
eligibilityIsSettled: eligibilityIsSettled(input.eligibilityResult),
|
|
16719
|
+
eligibility: input.eligibility,
|
|
16720
|
+
currentEvent: input.currentEvent,
|
|
16721
|
+
paymentSelection: input.paymentSelection,
|
|
16722
|
+
eventRequiresPayment: input.eventRequiresPayment,
|
|
16723
|
+
ticketsCount: input.ticketsCount
|
|
16724
|
+
});
|
|
16725
|
+
const settledRef = useRef(candidate);
|
|
16726
|
+
if (settledRef.current && viewIsStale(settledRef.current, input.currentEvent, input.eligibilityResult.state)) settledRef.current = null;
|
|
16727
|
+
const requestView = candidate ?? settledRef.current;
|
|
16728
|
+
const discountUi = input.useDiscountCodeUi({
|
|
16729
|
+
api: input.api,
|
|
16730
|
+
...discountRequest(requestView)
|
|
16731
|
+
});
|
|
16732
|
+
if (candidate && requestIsSettled(discountUi)) settledRef.current = candidate;
|
|
16733
|
+
return {
|
|
16734
|
+
discountUi,
|
|
16735
|
+
discountContext: settledRef.current?.discountContext ?? null,
|
|
16736
|
+
ticketSelectionSubtotalCents: settledRef.current?.subtotalCents ?? null,
|
|
16737
|
+
ticketSelectionSummaryLines: settledRef.current?.summaryLines ?? []
|
|
16738
|
+
};
|
|
16739
|
+
}
|
|
16740
|
+
//#endregion
|
|
16572
16741
|
//#region ../blocks/src/system/runtime/nodes/event-registration/eventPaymentOptions.ts
|
|
16573
16742
|
function getApprovedDirectPaymentCollectionOptionKinds(paymentOptions) {
|
|
16574
16743
|
return paymentOptions.flatMap((option) => {
|
|
@@ -17210,64 +17379,6 @@ function getStepLabel(step) {
|
|
|
17210
17379
|
}
|
|
17211
17380
|
}
|
|
17212
17381
|
//#endregion
|
|
17213
|
-
//#region ../blocks/src/system/runtime/nodes/event-registration/registrationDerivations.ts
|
|
17214
|
-
function eventMatchesOccurrenceId(event, occurrenceId) {
|
|
17215
|
-
return event.registrationSubject.kind === "occurrence" && (event.registrationSubject.occurrenceId === occurrenceId || event.selectionId === occurrenceId);
|
|
17216
|
-
}
|
|
17217
|
-
function findEventByOccurrenceId(events, occurrenceId) {
|
|
17218
|
-
return events.find((event) => eventMatchesOccurrenceId(event, occurrenceId)) ?? null;
|
|
17219
|
-
}
|
|
17220
|
-
function findPreSelectedEvent(input) {
|
|
17221
|
-
const occurrenceContext = input.occurrenceContext;
|
|
17222
|
-
if (!occurrenceContext) return input.scopedEvents.length === 1 ? input.scopedEvents[0] ?? null : null;
|
|
17223
|
-
const contextDate = getBookingLocalDateKey(toScheduledBookingDateTime({
|
|
17224
|
-
startsAt: occurrenceContext.startsAt,
|
|
17225
|
-
timeZone: occurrenceContext.timeZone
|
|
17226
|
-
}));
|
|
17227
|
-
return input.scopedEvents.find((event) => eventMatchesOccurrenceId(event, occurrenceContext.id) || getBookingLocalDateKey(toScheduledBookingDateTime({
|
|
17228
|
-
startsAt: event.startsAt,
|
|
17229
|
-
timeZone: event.timeZone
|
|
17230
|
-
})) === contextDate) ?? null;
|
|
17231
|
-
}
|
|
17232
|
-
function resolveRegistrationTarget(input) {
|
|
17233
|
-
const subject = input.occurrenceContext ? {
|
|
17234
|
-
kind: "occurrence",
|
|
17235
|
-
occurrenceId: input.occurrenceContext.id
|
|
17236
|
-
} : input.selectedEvent?.registrationSubject ?? null;
|
|
17237
|
-
if (!subject) return null;
|
|
17238
|
-
return {
|
|
17239
|
-
subject,
|
|
17240
|
-
selectedEventId: input.selectedEvent?.selectionId ?? null
|
|
17241
|
-
};
|
|
17242
|
-
}
|
|
17243
|
-
function resolveEventRequiresPayment(input) {
|
|
17244
|
-
if (input.eligibility) return input.eligibility.requiresPayment;
|
|
17245
|
-
if (input.selectedTicketType) return input.selectedTicketType.priceAmount > 0;
|
|
17246
|
-
if (!input.event) return false;
|
|
17247
|
-
return publicEventPricingType(input.event.pricing) === "paid";
|
|
17248
|
-
}
|
|
17249
|
-
function resolveDiscountContext(input) {
|
|
17250
|
-
const selection = input.paymentSelection.method ? input.paymentSelection : null;
|
|
17251
|
-
if (!input.event) return null;
|
|
17252
|
-
if (selection?.method === "pass_bundle" && selection.bundlePassId) return {
|
|
17253
|
-
type: "pass",
|
|
17254
|
-
passId: selection.bundlePassId
|
|
17255
|
-
};
|
|
17256
|
-
if (selection?.method === "membership_bundle" && selection.bundleMembershipId) return {
|
|
17257
|
-
type: "membership",
|
|
17258
|
-
membershipId: selection.bundleMembershipId
|
|
17259
|
-
};
|
|
17260
|
-
if (!input.eventRequiresPayment) return null;
|
|
17261
|
-
if (input.ticketsCount <= 0) return null;
|
|
17262
|
-
if (selection?.method && selection.method !== "stripe") return null;
|
|
17263
|
-
return {
|
|
17264
|
-
type: "event",
|
|
17265
|
-
eventSeriesId: input.event.seriesId,
|
|
17266
|
-
eventCategoryId: input.event.eventCategory?.id ?? null,
|
|
17267
|
-
ticketsCount: input.ticketsCount
|
|
17268
|
-
};
|
|
17269
|
-
}
|
|
17270
|
-
//#endregion
|
|
17271
17382
|
//#region ../blocks/src/system/blocks/events/shared/runGrouping.ts
|
|
17272
17383
|
function isWholeSeriesPublicEvent(event) {
|
|
17273
17384
|
return event.bookingScope === "whole_series";
|
|
@@ -17506,10 +17617,6 @@ function isSoldOutWithoutWaitlist(input) {
|
|
|
17506
17617
|
}
|
|
17507
17618
|
//#endregion
|
|
17508
17619
|
//#region ../blocks/src/system/runtime/nodes/event-registration/useEventRegistrationWizard.ts
|
|
17509
|
-
function resolveDiscountSubtotalCents(context, subtotalCents) {
|
|
17510
|
-
if (context?.type !== "event" || subtotalCents === null) return void 0;
|
|
17511
|
-
return subtotalCents;
|
|
17512
|
-
}
|
|
17513
17620
|
function usesTieredPricing(event) {
|
|
17514
17621
|
return event !== null && event !== void 0 ? publicEventPricingStrategy(event.pricing) === "tiered" : false;
|
|
17515
17622
|
}
|
|
@@ -17961,30 +18068,15 @@ function useEventRegistrationWizardWithDeps(options, deps) {
|
|
|
17961
18068
|
}
|
|
17962
18069
|
setStep("select-tickets");
|
|
17963
18070
|
};
|
|
17964
|
-
const discountContext
|
|
17965
|
-
|
|
17966
|
-
|
|
17967
|
-
|
|
17968
|
-
|
|
17969
|
-
}), [
|
|
18071
|
+
const { discountUi, discountContext, ticketSelectionSubtotalCents, ticketSelectionSummaryLines } = useSettledCommerceView({
|
|
18072
|
+
api,
|
|
18073
|
+
useDiscountCodeUi: deps.useDiscountCodeUi,
|
|
18074
|
+
eligibilityResult,
|
|
18075
|
+
eligibility,
|
|
17970
18076
|
currentEvent,
|
|
17971
18077
|
eventRequiresPayment,
|
|
17972
18078
|
paymentSelection,
|
|
17973
18079
|
ticketsCount
|
|
17974
|
-
]);
|
|
17975
|
-
const ticketSelectionSubtotalCents = eligibility?.price ?? null;
|
|
17976
|
-
const ticketSelectionSummaryLines = useMemo(() => eligibility?.ticketLines.map((line) => ({
|
|
17977
|
-
pricingOptionId: line.pricingOptionId,
|
|
17978
|
-
label: line.label,
|
|
17979
|
-
quantity: line.quantity,
|
|
17980
|
-
unitPriceCents: line.unitPriceCents,
|
|
17981
|
-
subtotalCents: line.subtotalCents
|
|
17982
|
-
})) ?? [], [eligibility]);
|
|
17983
|
-
const discountSubtotalCents = resolveDiscountSubtotalCents(discountContext, ticketSelectionSubtotalCents);
|
|
17984
|
-
const discountUi = deps.useDiscountCodeUi({
|
|
17985
|
-
api,
|
|
17986
|
-
discountContext,
|
|
17987
|
-
subtotalCents: discountSubtotalCents
|
|
17988
18080
|
});
|
|
17989
18081
|
const selectionMethod = paymentSelection.method;
|
|
17990
18082
|
const shouldShowDiscountToggle = discountContext !== null && discountUi.manualCodeEntryAllowed && (selectionMethod === "stripe" || selectionMethod === "pass_bundle" || selectionMethod === "membership_bundle");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as defineIslandPropsDecoder } from "./propsDecoder-
|
|
1
|
+
import { t as defineIslandPropsDecoder } from "./propsDecoder-DiLiBdek.mjs";
|
|
2
2
|
import { t as mountReactIsland } from "./reactMount-SY8AVRof.mjs";
|
|
3
3
|
import { n as normalizeCarouselProps, t as CarouselNodeClient } from "./carousel.client-DQTjCVQT.mjs";
|
|
4
4
|
import "react";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as defineIslandPropsDecoder } from "./propsDecoder-
|
|
2
|
-
import { t as CartController } from "./shop-commerce-
|
|
3
|
-
import { t as mountShopBlockIsland } from "./shopShared-
|
|
1
|
+
import { t as defineIslandPropsDecoder } from "./propsDecoder-DiLiBdek.mjs";
|
|
2
|
+
import { t as CartController } from "./shop-commerce-D_J781in.mjs";
|
|
3
|
+
import { t as mountShopBlockIsland } from "./shopShared-C_Bb2zwG.mjs";
|
|
4
4
|
import "react";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
//#region ../blocks/src/system/runtime/nodes/cart.client.tsx
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as defineIslandPropsDecoder } from "./propsDecoder-
|
|
2
|
-
import { n as CheckoutController } from "./shop-commerce-
|
|
3
|
-
import { t as mountShopBlockIsland } from "./shopShared-
|
|
1
|
+
import { t as defineIslandPropsDecoder } from "./propsDecoder-DiLiBdek.mjs";
|
|
2
|
+
import { n as CheckoutController } from "./shop-commerce-D_J781in.mjs";
|
|
3
|
+
import { t as mountShopBlockIsland } from "./shopShared-C_Bb2zwG.mjs";
|
|
4
4
|
import "react";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
//#region ../blocks/src/system/runtime/nodes/checkout.client.tsx
|