@riverbankcms/sdk 0.89.1 → 0.90.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -4
- package/dist/{PreviewEditorSidebar-JDR64FEC.mjs → PreviewEditorSidebar-KVXNF3VW.mjs} +3 -3
- package/dist/{PreviewEditorUI-67TMJMAF.mjs → PreviewEditorUI-J3JN5Z7T.mjs} +3 -3
- package/dist/SdkPreviewModeRuntime-UBL6MSNP.mjs +8 -0
- package/dist/_dts/ai/src/contracts/proposals.d.ts +216 -0
- package/dist/_dts/altcha/src/AltchaWidget.d.ts +1 -1
- package/dist/_dts/api/src/bookingOperations.d.ts +2 -0
- package/dist/_dts/api/src/bookingRecords.d.ts +4 -2
- package/dist/_dts/api/src/bookings.d.ts +3 -1
- package/dist/_dts/api/src/index.d.ts +6 -5
- package/dist/_dts/api/src/publicExperienceEndpoints.d.ts +15 -5
- package/dist/_dts/api/src/request.d.ts +21 -0
- package/dist/_dts/api/src/sdk-event-upsert.d.ts +3 -1
- package/dist/_dts/api/src/sdkContracts.d.ts +2 -0
- package/dist/_dts/api/src/types.d.ts +3 -1
- package/dist/_dts/api/src/url.d.ts +6 -3
- package/dist/_dts/block-form/src/utils/visibleWhen.d.ts +1 -0
- package/dist/_dts/block-form/src/widgets/RepeaterField/components/RepeaterThumbnailCard.d.ts +5 -1
- package/dist/_dts/block-form/src/widgets/RepeaterField/components/RepeaterThumbnailGrid.d.ts +9 -1
- package/dist/_dts/block-form/src/widgets/RepeaterField/components/index.d.ts +1 -0
- package/dist/_dts/blocks/src/contracts/non-block-islands.d.ts +7 -11
- package/dist/_dts/blocks/src/contracts/proof-block-islands.d.ts +6 -0
- package/dist/_dts/blocks/src/index.d.ts +2 -1
- package/dist/_dts/blocks/src/system/blocks/events/event-calendar.d.ts +14 -6
- package/dist/_dts/blocks/src/system/blocks/events/shared/types.d.ts +4 -4
- package/dist/_dts/blocks/src/system/blocks/hero.d.ts +0 -2
- package/dist/_dts/blocks/src/system/blocks/shop.d.ts +3 -3
- package/dist/_dts/blocks/src/system/blocks/shop.shared.d.ts +8 -0
- package/dist/_dts/blocks/src/system/constants/events.d.ts +4 -1
- package/dist/_dts/blocks/src/system/manifest/schema.d.ts +3 -1
- package/dist/_dts/blocks/src/system/runtime/api/index.d.ts +1 -0
- package/dist/_dts/blocks/src/system/runtime/api/types.d.ts +17 -5
- package/dist/_dts/blocks/src/system/runtime/components/registry.client.d.ts +51 -6
- package/dist/_dts/blocks/src/system/runtime/components/runtime-backed-blocks.d.ts +24 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/course-registration/useCourseRegistrationWizard.d.ts +2 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-details/logic.d.ts +1 -17
- package/dist/_dts/blocks/src/system/runtime/nodes/event-details.client.d.ts +5 -9
- package/dist/_dts/blocks/src/system/runtime/nodes/event-details.server.d.ts +5 -9
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/event-registration.headless.contract.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/eventPaymentOptions.d.ts +24 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/types.d.ts +5 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useDiscountCodeUi.d.ts +4 -4
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useDiscountCodeUi.state.d.ts +50 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationWizard.d.ts +2 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration.interactive.d.ts +21 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration.server.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/events/EventCalendar.interactive.d.ts +11 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/events/EventCombined.client.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/events/EventCombined.interactive.d.ts +11 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/calendarViewOptions.d.ts +10 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/eventProductEligibility.d.ts +24 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/shared/contract-schemas.d.ts +5 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/shop-checkout-form.d.ts +2 -2
- package/dist/_dts/content-model/src/entry-slots/index.d.ts +1 -0
- package/dist/_dts/content-model/src/entry-slots/sdkBlocks.d.ts +21 -0
- package/dist/_dts/content-model/src/entry-slots/types.d.ts +7 -0
- package/dist/_dts/core/src/money-input.d.ts +18 -0
- package/dist/_dts/db/src/generated/supabase/database.types.d.ts +50 -0
- package/dist/_dts/media-editor/src/MediaEditor.d.ts +2 -1
- package/dist/_dts/media-editor/src/fieldUi.d.ts +6 -0
- package/dist/_dts/media-editor/src/index.d.ts +1 -1
- package/dist/_dts/preview-next/src/client/index.d.ts +1 -0
- package/dist/_dts/preview-next/src/client/preview/PreviewShell.d.ts +3 -2
- package/dist/_dts/preview-next/src/client/preview/PreviewShellLayout.d.ts +3 -2
- package/dist/_dts/preview-next/src/client/preview/PreviewThemedSiteDocument.d.ts +3 -2
- package/dist/_dts/preview-next/src/client/preview/SiteChromeEditableSurface.d.ts +2 -2
- package/dist/_dts/preview-next/src/client/preview/themeRuntime.d.ts +6 -0
- package/dist/_dts/preview-next/src/client/sdk/SdkPreviewMode.d.ts +2 -1
- package/dist/_dts/sdk/src/cli/commands/pull-dated-offering-scope.d.ts +10 -0
- package/dist/_dts/sdk/src/cli/content/reader.d.ts +12 -5
- package/dist/_dts/sdk/src/client/management/types.d.ts +6 -55
- package/dist/_dts/sdk/src/components.d.ts +1 -0
- package/dist/_dts/sdk/src/config/field-definitions.d.ts +3 -1
- package/dist/_dts/sdk/src/contracts/system-block-content.d.ts +3 -1
- package/dist/_dts/sdk/src/next/types.d.ts +8 -11
- package/dist/_dts/sdk/src/preview-next/client/index.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/blocks-theme-scope.d.ts +2 -1
- package/dist/_dts/sdk/src/rendering/components/Layout.d.ts +8 -7
- package/dist/_dts/sdk/src/rendering/components/pageShared.d.ts +5 -6
- package/dist/_dts/sdk/src/rendering/index.d.ts +1 -0
- package/dist/_dts/sdk/src/rendering/server.d.ts +1 -0
- package/dist/_dts/sdk/src/rendering/themeRuntime.d.ts +26 -0
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/_dts/site-commands/src/commands.d.ts +18 -0
- package/dist/_dts/theme-core/src/ResponsiveScope.d.ts +12 -0
- package/dist/_dts/theme-core/src/accordions/types.d.ts +1 -1
- package/dist/_dts/theme-core/src/buttons/personalities/types.d.ts +2 -2
- package/dist/_dts/theme-core/src/buttons/types.d.ts +5 -5
- package/dist/_dts/theme-core/src/cards/types.d.ts +2 -2
- package/dist/_dts/theme-core/src/index.d.ts +2 -0
- package/dist/_dts/theme-core/src/mock-themes/all.d.ts +21 -21
- package/dist/_dts/theme-core/src/schema.d.ts +18 -18
- package/dist/_dts/theme-core/src/site-styles/designState.d.ts +2 -2
- package/dist/_dts/theme-core/src/site-styles/generatedSchemas.d.ts +2 -2
- package/dist/_dts/theme-core/src/site-styles/logoBranding.d.ts +4 -4
- package/dist/_dts/theme-core/src/themeRuntime.d.ts +11 -0
- package/dist/{chunk-HKJQERFR.mjs → chunk-AEOYWPE4.mjs} +91 -55
- package/dist/{chunk-F645A5UV.mjs → chunk-BOQXMCSP.mjs} +129 -101
- package/dist/{chunk-ZQRBLCW5.mjs → chunk-GSPFFUVB.mjs} +2 -2
- package/dist/{chunk-7YUAXONX.mjs → chunk-PMBB6MQ7.mjs} +1280 -774
- package/dist/{chunk-TGBJWKMP.mjs → chunk-RQ3XZ4SJ.mjs} +9 -1
- package/dist/{chunk-7N46MZHI.mjs → chunk-UG7I7S7W.mjs} +1 -1
- package/dist/cli/index.mjs +899 -531
- package/dist/cli/init-docs/content/cli-reference.md +6 -1
- package/dist/cli/init-docs/content/content-management.md +27 -0
- package/dist/client/{accordion-MUCVNGQ7.mjs → accordion-GXQNWQ6O.mjs} +1 -1
- package/dist/client/{bookingForm-PKD6EFIE.mjs → bookingForm-STLUJ36H.mjs} +25 -270
- package/dist/client/bookings.mjs +432 -269
- package/dist/client/{carousel-3TKQSNJC.mjs → carousel-CVRN6EPP.mjs} +1 -1
- package/dist/client/{cart-6XHSZK23.mjs → cart-IYIBA5CL.mjs} +5 -6
- package/dist/client/{checkout-FVSPM6FI.mjs → checkout-O3BGM4GS.mjs} +5 -6
- package/dist/client/chunk-4RTFGHZN.mjs +433 -0
- package/dist/client/{chunk-UQFY4AHX.mjs → chunk-6DPXDOIL.mjs} +65 -28
- package/dist/client/{chunk-ZT5XE7FK.mjs → chunk-D3ETC2SU.mjs} +1 -1
- package/dist/client/{chunk-CQKKFEQD.mjs → chunk-DAS5CIER.mjs} +274 -105
- package/dist/client/{chunk-SDIYSQAY.mjs → chunk-HIHOQGIP.mjs} +2 -3
- package/dist/client/{chunk-ZJZZA5EP.mjs → chunk-MFPKS6QS.mjs} +11 -14
- package/dist/client/{chunk-EY42X22F.mjs → chunk-NBFRJ5NB.mjs} +156 -4
- package/dist/client/{chunk-VGLXACVK.mjs → chunk-VFHZLZAC.mjs} +1 -1
- package/dist/client/{chunk-STJ2NCQM.mjs → chunk-WHZQDPBZ.mjs} +19 -1
- package/dist/client/{chunk-RSQWWUAD.mjs → chunk-Z62JYS5O.mjs} +3 -3
- package/dist/client/client.mjs +3292 -2827
- package/dist/client/{courseRegistration-ATZSYDHM.mjs → courseRegistration-2D3ACMJR.mjs} +18 -56
- package/dist/client/{eventCalendar-6T2UGKKP.mjs → eventCalendar-QY4UZUFF.mjs} +8 -9
- package/dist/client/{eventCombined-Q4VANXVF.mjs → eventCombined-RRCDKJC2.mjs} +8 -9
- package/dist/client/{eventDetails-DW37E7VW.mjs → eventDetails-YO335BUT.mjs} +8 -9
- package/dist/client/{eventListing-XURTSAUW.mjs → eventListing-PXA6GFQ3.mjs} +8 -9
- package/dist/client/{eventRegistration-MRKEVAXW.mjs → eventRegistration-2ZHEDDXO.mjs} +8 -9
- package/dist/client/{form-WZZFFGMU.mjs → form-ZS6KX4U2.mjs} +6 -6
- package/dist/client/{headerSection-EQYVQBLM.mjs → headerSection-QK5SLIIB.mjs} +2 -2
- package/dist/client/hooks.mjs +1084 -1029
- package/dist/client/{locationMap-MFF5VAZR.mjs → locationMap-GFNIUD2X.mjs} +2 -2
- package/dist/client/{newsletterForm-JQ77UYIE.mjs → newsletterForm-PGLTTCUG.mjs} +4 -4
- package/dist/client/{productDetail-25LMT3IZ.mjs → productDetail-OPBE5ZPI.mjs} +5 -6
- package/dist/client/{productList-5ABEMKUG.mjs → productList-NI72Q62Z.mjs} +5 -6
- package/dist/client/rendering/client.mjs +2692 -2285
- package/dist/client/rendering/islands.mjs +18 -18
- package/dist/client/rendering.mjs +2611 -2156
- package/dist/client/{shop-OMMQZ6YO.mjs → shop-3ZQPEWYI.mjs} +5 -6
- package/dist/client/spam-protection.mjs +4 -5
- package/dist/preview-next/before-render.mjs +2 -2
- package/dist/preview-next/client/runtime.mjs +5 -5
- package/dist/{sdk-runtime-WNLBZ3ZH.mjs → sdk-runtime-FSHXCWDS.mjs} +6 -6
- package/dist/server/components.mjs +1722 -1453
- package/dist/server/config-validation.mjs +1316 -1261
- package/dist/server/config.mjs +1316 -1261
- package/dist/server/data.mjs +1084 -1029
- package/dist/server/index.mjs +135 -100
- package/dist/server/navigation.mjs +20 -30
- package/dist/server/next.mjs +1782 -1500
- package/dist/server/page-converter.mjs +1009 -946
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +1722 -1453
- package/dist/server/rendering.mjs +1728 -1459
- package/dist/server/routing.mjs +1127 -1045
- package/dist/server/server.mjs +1219 -1129
- package/dist/server/theme-bridge.mjs +8 -5
- package/package.json +2 -2
- package/dist/SdkPreviewModeRuntime-ZBEMRV7N.mjs +0 -8
- package/dist/client/chunk-LQFDYWPJ.mjs +0 -184
- package/dist/client/chunk-ZFHRN6W2.mjs +0 -66
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { LeafletStaticMap } from './chunk-
|
|
3
|
-
import { resolveCoursePricingState, useWaitlistClaim, MagicLinkForm, formatCoursePriceAmount, formatCoursePriceDisplay } from './chunk-
|
|
2
|
+
import { LeafletStaticMap } from './chunk-D3ETC2SU.mjs';
|
|
3
|
+
import { resolveCoursePricingState, useWaitlistClaim, MagicLinkForm, formatCoursePriceAmount, formatCoursePriceDisplay } from './chunk-Z62JYS5O.mjs';
|
|
4
4
|
import { CreditCard, Ticket, Star, Sparkles } from './chunk-6N7YRNYU.mjs';
|
|
5
|
-
import { usePolling } from './chunk-
|
|
5
|
+
import { usePolling, buildBookingPaymentSelectionViewModel } from './chunk-4RTFGHZN.mjs';
|
|
6
6
|
import { SpinnerNode } from './chunk-FHU6PFPM.mjs';
|
|
7
|
-
import { useDiscountCodeUi } from './chunk-
|
|
8
|
-
import { createBodyThemePortalRoot, TabBarFragment, logoutPortal, consumeSearchParam, StepIndicator, DiscountCodeDisclosure, TerminalPanel, StateIcon, formatPrice, CrossIcon, ClockIcon, LoggedInAsUser, CheckIcon } from './chunk-EY42X22F.mjs';
|
|
7
|
+
import { createBodyThemePortalRoot, TabBarFragment, useDiscountCodeUi, logoutPortal, consumeSearchParam, StepIndicator, DiscountCodeDisclosure, TerminalPanel, StateIcon, formatPrice, CrossIcon, ClockIcon, LoggedInAsUser, CheckIcon } from './chunk-NBFRJ5NB.mjs';
|
|
9
8
|
import { getFieldValidationControlProps, FieldValidationMessage } from './chunk-3DCJ45Z2.mjs';
|
|
10
9
|
import { ModalShell } from './chunk-WBQG7VJA.mjs';
|
|
11
|
-
import { isSpamProtectionEnabled, AltchaWidget, getChallengeUrl } from './chunk-
|
|
12
|
-
import { useBlockApi, FeedbackMessage } from './chunk-
|
|
13
|
-
import { buildEventRuntimeFilters, buildEventCalendarListingRender, groupEventsByDate, getOrderedDayNames, formatDateKey, getEventRuntimeFiltersKey, themeButtonClassName, normalizeCsvIds, normalizeOptionalId, normalizeEventBlockKind, normalizeCsvString, EventCompactRow, EmptyState, getContainerClass, getCardOrientation, isToday, MAX_EVENTS_PER_DAY, formatTime, WIZARD_STEPS, getWizardStepsForContext, getStepNumber, formatEventPriceDisplay, resolveRuntimeEventPricing, formatEventPrice, formatEventDateParts, DateTimeTile,
|
|
10
|
+
import { isSpamProtectionEnabled, AltchaWidget, getChallengeUrl } from './chunk-HIHOQGIP.mjs';
|
|
11
|
+
import { useBlockApi, FeedbackMessage } from './chunk-WHZQDPBZ.mjs';
|
|
12
|
+
import { buildEventRuntimeFilters, buildEventCalendarListingRender, groupEventsByDate, getOrderedDayNames, formatDateKey, getEventRuntimeFiltersKey, themeButtonClassName, normalizeCsvIds, normalizeOptionalId, normalizeEventBlockKind, normalizeCsvString, EventCompactRow, EmptyState, getContainerClass, getCardOrientation, isToday, MAX_EVENTS_PER_DAY, formatTime, WIZARD_STEPS, getWizardStepsForContext, getStepNumber, formatEventPriceDisplay, resolveRuntimeEventPricing, formatEventPrice, formatEventDateParts, DateTimeTile, assertNever, EventCard, buildCalendarViewport, shiftCalendarAnchorDate, addMonths, getThreeMonthRange, buildTimetableModel, formatDate, MONTH_NAMES, getEventAvailability, formatEventTeacherLine, toRegistrationEvents, isEventContentType, findPreSelectedEvent, resolveRegistrationTarget, findEventByOccurrenceId, resolveEventRequiresPayment, resolveDiscountContext } from './chunk-6DPXDOIL.mjs';
|
|
14
13
|
import { publicEventPricingType, getBookingLocalDateKey, toScheduledBookingDateTime, toBookingTimeZone, publicEventPricingCurrency, formatBookingDateTime, publicEventPricingMode, publicEventScalarPrice, publicEventTicketTypes, formatCurrencyAmount, formatBookingDate, formatBookingTime } from './chunk-25W2EQUN.mjs';
|
|
15
14
|
import React9, { createContext, useId, useMemo, useReducer, useState, useRef, useEffect, useCallback, useContext } from 'react';
|
|
16
15
|
import { createPortal } from 'react-dom';
|
|
@@ -33,12 +32,18 @@ function createInitialRegistrationFlowState(hasPreSelectedContext) {
|
|
|
33
32
|
};
|
|
34
33
|
}
|
|
35
34
|
function selectionEquals(a, b) {
|
|
36
|
-
return a.method === b.method && a.passId === b.passId && a.membershipId === b.membershipId && a.bundlePassId === b.bundlePassId && a.bundleMembershipId === b.bundleMembershipId && a.productName === b.productName && a.productDescription === b.productDescription && a.productPrice === b.productPrice && a.productCurrency === b.productCurrency && a.productInterval === b.productInterval;
|
|
35
|
+
return a.method === b.method && a.passId === b.passId && a.membershipId === b.membershipId && a.bundlePassId === b.bundlePassId && a.bundleMembershipId === b.bundleMembershipId && a.productName === b.productName && a.productDescription === b.productDescription && a.productPrice === b.productPrice && a.productCurrency === b.productCurrency && a.productInterval === b.productInterval && a.collectionOptionKind === b.collectionOptionKind;
|
|
37
36
|
}
|
|
38
37
|
function withDefaultSelection(selection) {
|
|
39
38
|
if (!selection || !selection.method) {
|
|
40
39
|
return { method: null };
|
|
41
40
|
}
|
|
41
|
+
if (selection.method === "stripe") {
|
|
42
|
+
return {
|
|
43
|
+
...selection,
|
|
44
|
+
collectionOptionKind: selection.collectionOptionKind ?? "upfront"
|
|
45
|
+
};
|
|
46
|
+
}
|
|
42
47
|
return selection;
|
|
43
48
|
}
|
|
44
49
|
function computeAutoSelection(input) {
|
|
@@ -64,7 +69,7 @@ function computeAutoSelection(input) {
|
|
|
64
69
|
}
|
|
65
70
|
}
|
|
66
71
|
if (eligibility.canPayDirectly && eligibility.price) {
|
|
67
|
-
return { method: "stripe" };
|
|
72
|
+
return { method: "stripe", collectionOptionKind: "upfront" };
|
|
68
73
|
}
|
|
69
74
|
return { method: null };
|
|
70
75
|
}
|
|
@@ -82,11 +87,17 @@ function isSelectionValid(input) {
|
|
|
82
87
|
case "pass":
|
|
83
88
|
return isAuthenticated && ticketsCount === 1 && !!selection.passId && eligibility.eligiblePasses.some((pass) => pass.id === selection.passId);
|
|
84
89
|
case "membership":
|
|
85
|
-
return isAuthenticated && ticketsCount === 1 && !!selection.membershipId && eligibility.eligibleMemberships.some(
|
|
90
|
+
return isAuthenticated && ticketsCount === 1 && !!selection.membershipId && eligibility.eligibleMemberships.some(
|
|
91
|
+
(membership) => membership.id === selection.membershipId
|
|
92
|
+
);
|
|
86
93
|
case "pass_bundle":
|
|
87
|
-
return ticketsCount === 1 && !!selection.bundlePassId && eligibility.availablePasses.some(
|
|
94
|
+
return ticketsCount === 1 && !!selection.bundlePassId && eligibility.availablePasses.some(
|
|
95
|
+
(pass) => pass.id === selection.bundlePassId
|
|
96
|
+
);
|
|
88
97
|
case "membership_bundle":
|
|
89
|
-
return ticketsCount === 1 && !!selection.bundleMembershipId && eligibility.availableMemberships.some(
|
|
98
|
+
return ticketsCount === 1 && !!selection.bundleMembershipId && eligibility.availableMemberships.some(
|
|
99
|
+
(membership) => membership.id === selection.bundleMembershipId
|
|
100
|
+
);
|
|
90
101
|
default:
|
|
91
102
|
return false;
|
|
92
103
|
}
|
|
@@ -133,9 +144,15 @@ function registrationFlowReducer(state, action) {
|
|
|
133
144
|
ticketsCount: Math.max(1, action.ticketsCount)
|
|
134
145
|
});
|
|
135
146
|
case "set-authenticated":
|
|
136
|
-
return normalizeRegistrationFlowState({
|
|
147
|
+
return normalizeRegistrationFlowState({
|
|
148
|
+
...state,
|
|
149
|
+
isAuthenticated: action.isAuthenticated
|
|
150
|
+
});
|
|
137
151
|
case "eligibility-updated":
|
|
138
|
-
return normalizeRegistrationFlowState({
|
|
152
|
+
return normalizeRegistrationFlowState({
|
|
153
|
+
...state,
|
|
154
|
+
eligibility: action.eligibility
|
|
155
|
+
});
|
|
139
156
|
case "set-manual-payment-selection":
|
|
140
157
|
return normalizeRegistrationFlowState({
|
|
141
158
|
...state,
|
|
@@ -147,7 +164,7 @@ function registrationFlowReducer(state, action) {
|
|
|
147
164
|
return normalizeRegistrationFlowState({
|
|
148
165
|
...state,
|
|
149
166
|
passOptOut: true,
|
|
150
|
-
paymentSelection: { method: "stripe" },
|
|
167
|
+
paymentSelection: { method: "stripe", collectionOptionKind: "upfront" },
|
|
151
168
|
selectionSource: "manual"
|
|
152
169
|
});
|
|
153
170
|
case "event-changed":
|
|
@@ -193,7 +210,10 @@ function normalizeEventRegistrationMaxTickets(value) {
|
|
|
193
210
|
function resolveEventRegistrationSubmitPlan(input) {
|
|
194
211
|
const selection = input.paymentSelection.method ? input.paymentSelection : void 0;
|
|
195
212
|
if (input.canJoinWaitlist) {
|
|
196
|
-
return {
|
|
213
|
+
return {
|
|
214
|
+
ok: true,
|
|
215
|
+
args: withOptionalSelection({ method: "free" }, selection)
|
|
216
|
+
};
|
|
197
217
|
}
|
|
198
218
|
switch (input.paymentSelection.method) {
|
|
199
219
|
case "pass":
|
|
@@ -208,19 +228,28 @@ function resolveEventRegistrationSubmitPlan(input) {
|
|
|
208
228
|
return input.paymentSelection.membershipId ? {
|
|
209
229
|
ok: true,
|
|
210
230
|
args: withOptionalSelection(
|
|
211
|
-
{
|
|
231
|
+
{
|
|
232
|
+
method: "membership",
|
|
233
|
+
membershipId: input.paymentSelection.membershipId
|
|
234
|
+
},
|
|
212
235
|
selection
|
|
213
236
|
)
|
|
214
237
|
} : missingPaymentSelection();
|
|
215
238
|
case "free":
|
|
216
|
-
return {
|
|
239
|
+
return {
|
|
240
|
+
ok: true,
|
|
241
|
+
args: withOptionalSelection({ method: "free" }, selection)
|
|
242
|
+
};
|
|
217
243
|
case null:
|
|
218
244
|
return input.eventRequiresPayment ? missingPaymentSelection() : { ok: true, args: { method: "free" } };
|
|
219
245
|
case "pass_bundle":
|
|
220
246
|
return input.paymentSelection.bundlePassId ? {
|
|
221
247
|
ok: true,
|
|
222
248
|
args: withOptionalSelection(
|
|
223
|
-
{
|
|
249
|
+
{
|
|
250
|
+
method: "pass_bundle",
|
|
251
|
+
passId: input.paymentSelection.bundlePassId
|
|
252
|
+
},
|
|
224
253
|
selection
|
|
225
254
|
)
|
|
226
255
|
} : missingPaymentSelection();
|
|
@@ -236,7 +265,10 @@ function resolveEventRegistrationSubmitPlan(input) {
|
|
|
236
265
|
)
|
|
237
266
|
} : missingPaymentSelection();
|
|
238
267
|
case "stripe":
|
|
239
|
-
return {
|
|
268
|
+
return {
|
|
269
|
+
ok: true,
|
|
270
|
+
args: withOptionalSelection({ method: "stripe" }, selection)
|
|
271
|
+
};
|
|
240
272
|
}
|
|
241
273
|
}
|
|
242
274
|
function withOptionalSelection(args, selection) {
|
|
@@ -390,7 +422,7 @@ function eligibilityLookupReducer(state, action) {
|
|
|
390
422
|
error: action.message
|
|
391
423
|
};
|
|
392
424
|
default:
|
|
393
|
-
return
|
|
425
|
+
return assertNever(action);
|
|
394
426
|
}
|
|
395
427
|
}
|
|
396
428
|
var initialExistingRegistrationLookupState = {
|
|
@@ -412,7 +444,7 @@ function existingRegistrationLookupReducer(state, action) {
|
|
|
412
444
|
registration: action.registration
|
|
413
445
|
};
|
|
414
446
|
default:
|
|
415
|
-
return
|
|
447
|
+
return assertNever(action);
|
|
416
448
|
}
|
|
417
449
|
}
|
|
418
450
|
|
|
@@ -1320,10 +1352,72 @@ function SelectableOptionCard(props) {
|
|
|
1320
1352
|
}
|
|
1321
1353
|
);
|
|
1322
1354
|
}
|
|
1355
|
+
|
|
1356
|
+
// ../blocks/src/system/runtime/nodes/event-registration/eventPaymentOptions.ts
|
|
1357
|
+
var DEFAULT_EVENT_DIRECT_PAYMENT_OPTION = {
|
|
1358
|
+
kind: "upfront"
|
|
1359
|
+
};
|
|
1360
|
+
function buildEventRegistrationPaymentOptionsViewModel(input) {
|
|
1361
|
+
const supportedOptions = selectSupportedEventDirectPaymentOptions(
|
|
1362
|
+
input.paymentTerms
|
|
1363
|
+
);
|
|
1364
|
+
const selection = buildBookingPaymentSelectionViewModel({
|
|
1365
|
+
serviceTitle: input.eventTitle,
|
|
1366
|
+
paymentTerms: { allowedOptions: [...supportedOptions] },
|
|
1367
|
+
priceAmount: input.totalPriceCents,
|
|
1368
|
+
priceCurrency: input.currency,
|
|
1369
|
+
bookingStartAt: input.startsAt,
|
|
1370
|
+
locale: input.locale
|
|
1371
|
+
});
|
|
1372
|
+
return {
|
|
1373
|
+
mode: selection.mode,
|
|
1374
|
+
sectionTitle: selection.sectionTitle,
|
|
1375
|
+
options: selection.options.map(
|
|
1376
|
+
(option) => toEventDirectPaymentOption(option, selection.mode)
|
|
1377
|
+
)
|
|
1378
|
+
};
|
|
1379
|
+
}
|
|
1380
|
+
function selectSupportedEventDirectPaymentOptions(paymentTerms) {
|
|
1381
|
+
const supported = paymentTerms?.allowedOptions.filter(isSupportedEventDirectPaymentOption) ?? [];
|
|
1382
|
+
return supported.length > 0 ? supported : [DEFAULT_EVENT_DIRECT_PAYMENT_OPTION];
|
|
1383
|
+
}
|
|
1384
|
+
function isSupportedEventDirectPaymentOption(option) {
|
|
1385
|
+
return option.kind === "upfront" || option.kind === "flexible_balance";
|
|
1386
|
+
}
|
|
1387
|
+
function toEventDirectPaymentOption(option, mode) {
|
|
1388
|
+
switch (option.kind) {
|
|
1389
|
+
case "upfront":
|
|
1390
|
+
return {
|
|
1391
|
+
...option,
|
|
1392
|
+
kind: "upfront",
|
|
1393
|
+
label: mode === "choice_required" ? "Pay in full now" : "Pay by card"
|
|
1394
|
+
};
|
|
1395
|
+
case "flexible_balance":
|
|
1396
|
+
return {
|
|
1397
|
+
...option,
|
|
1398
|
+
kind: "flexible_balance",
|
|
1399
|
+
label: "Pay deposit now"
|
|
1400
|
+
};
|
|
1401
|
+
case "deferred_manual":
|
|
1402
|
+
case "instalment_plan":
|
|
1403
|
+
throw new Error(
|
|
1404
|
+
`Unsupported event registration payment option: ${option.kind}`
|
|
1405
|
+
);
|
|
1406
|
+
}
|
|
1407
|
+
}
|
|
1323
1408
|
function PaymentCheckIcon() {
|
|
1324
1409
|
return /* @__PURE__ */ jsx("div", { className: "er-check", children: /* @__PURE__ */ jsx(CheckIcon, {}) });
|
|
1325
1410
|
}
|
|
1326
|
-
function PaymentTile({
|
|
1411
|
+
function PaymentTile({
|
|
1412
|
+
icon,
|
|
1413
|
+
label,
|
|
1414
|
+
detail,
|
|
1415
|
+
selected,
|
|
1416
|
+
disabled,
|
|
1417
|
+
tooltip,
|
|
1418
|
+
upsell,
|
|
1419
|
+
onClick
|
|
1420
|
+
}) {
|
|
1327
1421
|
return /* @__PURE__ */ jsx(
|
|
1328
1422
|
SelectableOptionCard,
|
|
1329
1423
|
{
|
|
@@ -1346,6 +1440,16 @@ function PaymentTile({ icon, label, detail, selected, disabled, tooltip, upsell,
|
|
|
1346
1440
|
}
|
|
1347
1441
|
);
|
|
1348
1442
|
}
|
|
1443
|
+
function formatDirectPaymentOptionDetail(option) {
|
|
1444
|
+
const dueToday = option.summaryRows.find((row) => row.label === "Due today");
|
|
1445
|
+
const balanceDueBy = option.summaryRows.find(
|
|
1446
|
+
(row) => row.label === "Balance due by"
|
|
1447
|
+
);
|
|
1448
|
+
return [
|
|
1449
|
+
dueToday ? `Due today: ${dueToday.value}` : option.description,
|
|
1450
|
+
balanceDueBy ? `Balance due by: ${balanceDueBy.value}` : null
|
|
1451
|
+
].filter((part) => Boolean(part)).join(" \xB7 ");
|
|
1452
|
+
}
|
|
1349
1453
|
var PaymentSelectionStep = ({
|
|
1350
1454
|
event,
|
|
1351
1455
|
occurrenceContext,
|
|
@@ -1365,9 +1469,12 @@ var PaymentSelectionStep = ({
|
|
|
1365
1469
|
const canContinue = (() => {
|
|
1366
1470
|
if (!selectedMethod) return false;
|
|
1367
1471
|
if (selectedMethod === "pass") return Boolean(selectedSelection.passId);
|
|
1368
|
-
if (selectedMethod === "membership")
|
|
1369
|
-
|
|
1370
|
-
if (selectedMethod === "
|
|
1472
|
+
if (selectedMethod === "membership")
|
|
1473
|
+
return Boolean(selectedSelection.membershipId);
|
|
1474
|
+
if (selectedMethod === "pass_bundle")
|
|
1475
|
+
return Boolean(selectedSelection.bundlePassId);
|
|
1476
|
+
if (selectedMethod === "membership_bundle")
|
|
1477
|
+
return Boolean(selectedSelection.bundleMembershipId);
|
|
1371
1478
|
return true;
|
|
1372
1479
|
})();
|
|
1373
1480
|
const getButtonText = useCallback(() => {
|
|
@@ -1396,7 +1503,15 @@ var PaymentSelectionStep = ({
|
|
|
1396
1503
|
buttonText: getButtonText(),
|
|
1397
1504
|
showLoginPrompt
|
|
1398
1505
|
});
|
|
1399
|
-
}, [
|
|
1506
|
+
}, [
|
|
1507
|
+
onStateChange,
|
|
1508
|
+
eligibilityLoading,
|
|
1509
|
+
eligibilityError,
|
|
1510
|
+
eligibility,
|
|
1511
|
+
isAuthenticated,
|
|
1512
|
+
canContinue,
|
|
1513
|
+
getButtonText
|
|
1514
|
+
]);
|
|
1400
1515
|
if (eligibilityLoading) {
|
|
1401
1516
|
return /* @__PURE__ */ jsx("div", { className: "er-stack", children: /* @__PURE__ */ jsxs("div", { className: "er-center", children: [
|
|
1402
1517
|
/* @__PURE__ */ jsx(SpinnerNode, { size: "lg", srLabel: "Checking payment options" }),
|
|
@@ -1444,7 +1559,10 @@ var PaymentSelectionStep = ({
|
|
|
1444
1559
|
"button",
|
|
1445
1560
|
{
|
|
1446
1561
|
type: "button",
|
|
1447
|
-
className: themeButtonClassName({
|
|
1562
|
+
className: themeButtonClassName({
|
|
1563
|
+
variant: "primary",
|
|
1564
|
+
size: "md"
|
|
1565
|
+
}),
|
|
1448
1566
|
disabled: !email.trim(),
|
|
1449
1567
|
onClick: onRequestLogin,
|
|
1450
1568
|
children: "Email me a login link"
|
|
@@ -1459,20 +1577,31 @@ var PaymentSelectionStep = ({
|
|
|
1459
1577
|
] });
|
|
1460
1578
|
}
|
|
1461
1579
|
const totalPrice = eligibility.price ? eligibility.price * ticketsCount : 0;
|
|
1580
|
+
const directPaymentOptions = buildEventRegistrationPaymentOptionsViewModel({
|
|
1581
|
+
eventTitle: event?.title ?? "Event",
|
|
1582
|
+
paymentTerms: event?.paymentTerms,
|
|
1583
|
+
totalPriceCents: totalPrice,
|
|
1584
|
+
currency: eligibility.currency,
|
|
1585
|
+
startsAt: occurrenceContext?.startsAt ?? event?.startsAt
|
|
1586
|
+
}).options;
|
|
1462
1587
|
const isMultiTicket = areEntitlementsDisabledForTicketCount(ticketsCount);
|
|
1463
1588
|
return /* @__PURE__ */ jsxs("div", { className: "er-stack", children: [
|
|
1464
1589
|
/* @__PURE__ */ jsx("h3", { className: "er-title", children: "Payment Options" }),
|
|
1465
1590
|
/* @__PURE__ */ jsxs("div", { className: "er-payment-tiles", children: [
|
|
1466
|
-
eligibility.canPayDirectly && eligibility.price && /* @__PURE__ */ jsx(
|
|
1591
|
+
eligibility.canPayDirectly && eligibility.price && /* @__PURE__ */ jsx(Fragment, { children: directPaymentOptions.map((option) => /* @__PURE__ */ jsx(
|
|
1467
1592
|
PaymentTile,
|
|
1468
1593
|
{
|
|
1469
1594
|
icon: /* @__PURE__ */ jsx(CreditCard, { size: 24, "aria-hidden": "true" }),
|
|
1470
|
-
label:
|
|
1471
|
-
detail:
|
|
1472
|
-
selected: selectedMethod === "stripe",
|
|
1473
|
-
onClick: () => onSelectionChange({
|
|
1474
|
-
|
|
1475
|
-
|
|
1595
|
+
label: option.label,
|
|
1596
|
+
detail: formatDirectPaymentOptionDetail(option),
|
|
1597
|
+
selected: selectedMethod === "stripe" && (selectedSelection.collectionOptionKind ?? "upfront") === option.kind,
|
|
1598
|
+
onClick: () => onSelectionChange({
|
|
1599
|
+
method: "stripe",
|
|
1600
|
+
collectionOptionKind: option.kind
|
|
1601
|
+
})
|
|
1602
|
+
},
|
|
1603
|
+
option.kind
|
|
1604
|
+
)) }),
|
|
1476
1605
|
isAuthenticated && eligibility.eligiblePasses.map((pass) => /* @__PURE__ */ jsx(
|
|
1477
1606
|
PaymentTile,
|
|
1478
1607
|
{
|
|
@@ -1482,7 +1611,11 @@ var PaymentSelectionStep = ({
|
|
|
1482
1611
|
selected: selectedMethod === "pass" && selectedSelection.passId === pass.id,
|
|
1483
1612
|
disabled: isMultiTicket,
|
|
1484
1613
|
tooltip: isMultiTicket ? ENTITLEMENT_SINGLE_TICKET_TOOLTIP : void 0,
|
|
1485
|
-
onClick: () => onSelectionChange({
|
|
1614
|
+
onClick: () => onSelectionChange({
|
|
1615
|
+
method: "pass",
|
|
1616
|
+
passId: pass.id,
|
|
1617
|
+
productName: pass.passName
|
|
1618
|
+
})
|
|
1486
1619
|
},
|
|
1487
1620
|
pass.id
|
|
1488
1621
|
)),
|
|
@@ -2726,6 +2859,46 @@ function useEventRegistrationWizard(options) {
|
|
|
2726
2859
|
};
|
|
2727
2860
|
}
|
|
2728
2861
|
|
|
2862
|
+
// ../blocks/src/system/runtime/nodes/events/shared/eventProductEligibility.ts
|
|
2863
|
+
function isCategoryEligible(eligibleCategoryIds, eventCategoryId) {
|
|
2864
|
+
const categories = eligibleCategoryIds ?? [];
|
|
2865
|
+
if (categories.length === 0) return true;
|
|
2866
|
+
if (!eventCategoryId) return false;
|
|
2867
|
+
return categories.includes(eventCategoryId);
|
|
2868
|
+
}
|
|
2869
|
+
function passCoversEvent(args, event) {
|
|
2870
|
+
if (!event.acceptsPasses) return false;
|
|
2871
|
+
return isCategoryEligible(args.eligibleCategoryIds, event.eventCategoryId);
|
|
2872
|
+
}
|
|
2873
|
+
function membershipCoversEvent(args, event) {
|
|
2874
|
+
if (!event.acceptsMemberships) return false;
|
|
2875
|
+
return isCategoryEligible(args.eligibleCategoryIds, event.eventCategoryId);
|
|
2876
|
+
}
|
|
2877
|
+
function filterPassesForEvent(sitePasses, event) {
|
|
2878
|
+
if (!sitePasses || !event) return [];
|
|
2879
|
+
if (event.requiresRegistration === false) return [];
|
|
2880
|
+
const acceptsPasses = event.acceptsPasses ?? true;
|
|
2881
|
+
const eventCategoryId = event.eventCategory?.id ?? null;
|
|
2882
|
+
return sitePasses.filter(
|
|
2883
|
+
(pass) => pass.productUseCase === "event_pass" && passCoversEvent(
|
|
2884
|
+
{ eligibleCategoryIds: pass.eligibleCategoryIds },
|
|
2885
|
+
{ acceptsPasses, eventCategoryId }
|
|
2886
|
+
)
|
|
2887
|
+
);
|
|
2888
|
+
}
|
|
2889
|
+
function filterMembershipsForEvent(siteMemberships, event) {
|
|
2890
|
+
if (!siteMemberships || !event) return [];
|
|
2891
|
+
if (event.requiresRegistration === false) return [];
|
|
2892
|
+
const acceptsMemberships = event.acceptsMemberships ?? true;
|
|
2893
|
+
const eventCategoryId = event.eventCategory?.id ?? null;
|
|
2894
|
+
return siteMemberships.filter(
|
|
2895
|
+
(membership) => membershipCoversEvent(
|
|
2896
|
+
{ eligibleCategoryIds: membership.eligibleCategoryIds },
|
|
2897
|
+
{ acceptsMemberships, eventCategoryId }
|
|
2898
|
+
)
|
|
2899
|
+
);
|
|
2900
|
+
}
|
|
2901
|
+
|
|
2729
2902
|
// ../blocks/src/system/runtime/nodes/event-registration/constants.ts
|
|
2730
2903
|
var EVENT_REGISTRATION_ANCHOR_ID = "event-registration";
|
|
2731
2904
|
var EVENT_PORTAL_AUTH_COPY = {
|
|
@@ -2766,7 +2939,9 @@ function EventRegistrationWizard(props) {
|
|
|
2766
2939
|
buttonVariant = "primary",
|
|
2767
2940
|
className,
|
|
2768
2941
|
spamProtectionEnabled,
|
|
2769
|
-
supportEmail
|
|
2942
|
+
supportEmail,
|
|
2943
|
+
sitePasses,
|
|
2944
|
+
siteMemberships
|
|
2770
2945
|
} = props;
|
|
2771
2946
|
const maxTicketsNum = normalizeEventRegistrationMaxTickets(maxTickets);
|
|
2772
2947
|
const showSpamProtection = spamProtectionEnabled ?? isSpamProtectionEnabled();
|
|
@@ -2862,11 +3037,13 @@ function EventRegistrationWizard(props) {
|
|
|
2862
3037
|
const summaryPriceLabel = summaryEvent ? formatEventPriceDisplay(summaryEvent.pricing) : null;
|
|
2863
3038
|
const summaryAvailabilityLabel = summaryEvent?.availableSpots === null || summaryEvent?.availableSpots === void 0 ? null : summaryEvent.availableSpots > 0 ? `${summaryEvent.availableSpots} spots left` : summaryEvent.waitlistEnabled ? "Waitlist available" : "Fully booked";
|
|
2864
3039
|
const waitlistClaimRequiresPortalLogin = wizard.waitlistClaim.requiresPortalLogin && wizard.portalAuthState !== "authenticated" && wizard.portalAuthState !== "checking";
|
|
3040
|
+
const selectedProductEvent = wizard.selectedEvent ?? wizard.preSelectedEvent;
|
|
3041
|
+
const hasPassOrMembershipProducts = filterPassesForEvent(sitePasses?.passes, selectedProductEvent).length > 0 || filterMembershipsForEvent(siteMemberships?.memberships, selectedProductEvent).length > 0;
|
|
2865
3042
|
const portalAuthCopy = waitlistClaimRequiresPortalLogin ? {
|
|
2866
3043
|
...EVENT_PORTAL_AUTH_COPY["waitlist-claim"],
|
|
2867
3044
|
description: wizard.waitlistClaim.loginMessage ?? "Log in to continue with your waitlist claim."
|
|
2868
3045
|
} : EVENT_PORTAL_AUTH_COPY.membership;
|
|
2869
|
-
const showPortalAuthPrompt = waitlistClaimRequiresPortalLogin || wizard.step === "select-tickets" && wizard.portalAuthState !== "authenticated" && wizard.portalAuthState !== "checking" && summaryEventPricingType !== "free";
|
|
3046
|
+
const showPortalAuthPrompt = waitlistClaimRequiresPortalLogin || wizard.step === "select-tickets" && wizard.portalAuthState !== "authenticated" && wizard.portalAuthState !== "checking" && hasPassOrMembershipProducts && summaryEventPricingType !== "free";
|
|
2870
3047
|
const renderRegistrationSurface = (variant) => /* @__PURE__ */ jsxs("div", { className: `er-container${variant === "overlay" ? " er-container--overlay" : ""}`, children: [
|
|
2871
3048
|
isWizardStep && /* @__PURE__ */ jsxs("div", { className: "er-payment-layout er-payment-layout--no-sidebar", children: [
|
|
2872
3049
|
/* @__PURE__ */ jsxs("div", { className: "er-payment-layout-main", children: [
|
|
@@ -3090,20 +3267,6 @@ var EventRegistrationIslandClient = (props) => {
|
|
|
3090
3267
|
};
|
|
3091
3268
|
|
|
3092
3269
|
// ../blocks/src/system/runtime/nodes/event-details/logic.ts
|
|
3093
|
-
function isCategoryEligible(eligibleCategoryIds, eventCategoryId) {
|
|
3094
|
-
const categories = eligibleCategoryIds ?? [];
|
|
3095
|
-
if (categories.length === 0) return true;
|
|
3096
|
-
if (!eventCategoryId) return false;
|
|
3097
|
-
return categories.includes(eventCategoryId);
|
|
3098
|
-
}
|
|
3099
|
-
function passCoversEvent(args, event) {
|
|
3100
|
-
if (!event.acceptsPasses) return false;
|
|
3101
|
-
return isCategoryEligible(args.eligibleCategoryIds, event.eventCategoryId);
|
|
3102
|
-
}
|
|
3103
|
-
function membershipCoversEvent(args, event) {
|
|
3104
|
-
if (!event.acceptsMemberships) return false;
|
|
3105
|
-
return isCategoryEligible(args.eligibleCategoryIds, event.eventCategoryId);
|
|
3106
|
-
}
|
|
3107
3270
|
function parseLimit(value, fallback) {
|
|
3108
3271
|
const n = typeof value === "string" ? parseInt(value, 10) : typeof value === "number" ? value : NaN;
|
|
3109
3272
|
return Number.isFinite(n) && n > 0 ? n : fallback;
|
|
@@ -3162,30 +3325,6 @@ function selectEventDetails(args) {
|
|
|
3162
3325
|
}).slice(0, otherLimit) : [];
|
|
3163
3326
|
return { mode, selected, otherDates, timeZone };
|
|
3164
3327
|
}
|
|
3165
|
-
function filterPassesForEvent(sitePasses, event) {
|
|
3166
|
-
if (!sitePasses || !event) return [];
|
|
3167
|
-
if (event.requiresRegistration === false) return [];
|
|
3168
|
-
const acceptsPasses = event.acceptsPasses ?? true;
|
|
3169
|
-
const eventCategoryId = event.eventCategory?.id ?? null;
|
|
3170
|
-
return sitePasses.filter(
|
|
3171
|
-
(pass) => pass.productUseCase === "event_pass" && passCoversEvent(
|
|
3172
|
-
{ eligibleCategoryIds: pass.eligibleCategoryIds },
|
|
3173
|
-
{ acceptsPasses, eventCategoryId }
|
|
3174
|
-
)
|
|
3175
|
-
);
|
|
3176
|
-
}
|
|
3177
|
-
function filterMembershipsForEvent(siteMemberships, event) {
|
|
3178
|
-
if (!siteMemberships || !event) return [];
|
|
3179
|
-
if (event.requiresRegistration === false) return [];
|
|
3180
|
-
const acceptsMemberships = event.acceptsMemberships ?? true;
|
|
3181
|
-
const eventCategoryId = event.eventCategory?.id ?? null;
|
|
3182
|
-
return siteMemberships.filter(
|
|
3183
|
-
(membership) => membershipCoversEvent(
|
|
3184
|
-
{ eligibleCategoryIds: membership.eligibleCategoryIds },
|
|
3185
|
-
{ acceptsMemberships, eventCategoryId }
|
|
3186
|
-
)
|
|
3187
|
-
);
|
|
3188
|
-
}
|
|
3189
3328
|
function CoursePricingDisplay({
|
|
3190
3329
|
pricing,
|
|
3191
3330
|
acceptedItems
|
|
@@ -3736,7 +3875,7 @@ function eventPaginationLoadReducer(state, action) {
|
|
|
3736
3875
|
case "synced":
|
|
3737
3876
|
return createInitialEventPaginationLoadState(action.events, action.pageSize);
|
|
3738
3877
|
default:
|
|
3739
|
-
return
|
|
3878
|
+
return assertNever(action);
|
|
3740
3879
|
}
|
|
3741
3880
|
}
|
|
3742
3881
|
function getEventIdentity(event) {
|
|
@@ -3957,7 +4096,7 @@ function eventFiltersLoadReducer(state, action) {
|
|
|
3957
4096
|
case "failed":
|
|
3958
4097
|
return { kind: "error", filters: state.filters, error: action.error };
|
|
3959
4098
|
default:
|
|
3960
|
-
return
|
|
4099
|
+
return assertNever(action);
|
|
3961
4100
|
}
|
|
3962
4101
|
}
|
|
3963
4102
|
function toEventFiltersLoadError(error) {
|
|
@@ -4387,7 +4526,7 @@ function calendarEventCacheLoadReducer(_state, action) {
|
|
|
4387
4526
|
case "failed":
|
|
4388
4527
|
return { kind: "error", error: action.error };
|
|
4389
4528
|
default:
|
|
4390
|
-
return
|
|
4529
|
+
return assertNever(action);
|
|
4391
4530
|
}
|
|
4392
4531
|
}
|
|
4393
4532
|
function toCalendarEventCacheLoadError(error) {
|
|
@@ -4980,6 +5119,23 @@ function EventModals({
|
|
|
4980
5119
|
}
|
|
4981
5120
|
return marker;
|
|
4982
5121
|
}
|
|
5122
|
+
|
|
5123
|
+
// ../blocks/src/system/runtime/nodes/events/shared/calendarViewOptions.ts
|
|
5124
|
+
var monthOption = { id: "month", label: "Month" };
|
|
5125
|
+
var weekOption = { id: "week", label: "Week" };
|
|
5126
|
+
function resolveInitialCalendarView(input) {
|
|
5127
|
+
switch (input.calendarTabViews) {
|
|
5128
|
+
case "month":
|
|
5129
|
+
return "month";
|
|
5130
|
+
case "week":
|
|
5131
|
+
return "week";
|
|
5132
|
+
case "both":
|
|
5133
|
+
return input.defaultCalendarView ?? "month";
|
|
5134
|
+
}
|
|
5135
|
+
}
|
|
5136
|
+
function orderCalendarViewToggleOptions(defaultCalendarView) {
|
|
5137
|
+
return defaultCalendarView === "week" ? [weekOption, monthOption] : [monthOption, weekOption];
|
|
5138
|
+
}
|
|
4983
5139
|
function toEventCombinedControllerProps(props) {
|
|
4984
5140
|
return {
|
|
4985
5141
|
events: props.render.hydration.prefetchedEvents ? [...props.render.display.events] : void 0,
|
|
@@ -4991,6 +5147,7 @@ function toEventCombinedControllerProps(props) {
|
|
|
4991
5147
|
paginationAction: props.render.display.paginationAction,
|
|
4992
5148
|
startOfWeek: props.render.display.startOfWeek,
|
|
4993
5149
|
calendarTabViews: props.render.display.calendarTabViews,
|
|
5150
|
+
defaultCalendarView: props.render.display.defaultCalendarView,
|
|
4994
5151
|
showFilters: props.render.display.showFilters,
|
|
4995
5152
|
showCategoryFilter: props.render.display.showCategoryFilter,
|
|
4996
5153
|
showVenueFilter: props.render.display.showVenueFilter,
|
|
@@ -5023,6 +5180,7 @@ var EventCombinedClient = ({
|
|
|
5023
5180
|
// Calendar options
|
|
5024
5181
|
startOfWeek = "monday",
|
|
5025
5182
|
calendarTabViews = "both",
|
|
5183
|
+
defaultCalendarView,
|
|
5026
5184
|
// Filtering options
|
|
5027
5185
|
showFilters,
|
|
5028
5186
|
showCategoryFilter = "auto",
|
|
@@ -5055,9 +5213,21 @@ var EventCombinedClient = ({
|
|
|
5055
5213
|
const resolvedEventSurface = eventSurface ?? "all";
|
|
5056
5214
|
const resolvedScheduleScope = scheduleScope ?? "any";
|
|
5057
5215
|
const [activeTab, setActiveTab] = useState("list");
|
|
5058
|
-
const
|
|
5059
|
-
|
|
5216
|
+
const initialCalendarView = useMemo(
|
|
5217
|
+
() => resolveInitialCalendarView({
|
|
5218
|
+
calendarTabViews,
|
|
5219
|
+
defaultCalendarView
|
|
5220
|
+
}),
|
|
5221
|
+
[calendarTabViews, defaultCalendarView]
|
|
5222
|
+
);
|
|
5223
|
+
const [calendarView, setCalendarView] = useState(initialCalendarView);
|
|
5224
|
+
const calendarViewOptions = useMemo(
|
|
5225
|
+
() => orderCalendarViewToggleOptions(initialCalendarView),
|
|
5226
|
+
[initialCalendarView]
|
|
5060
5227
|
);
|
|
5228
|
+
useEffect(() => {
|
|
5229
|
+
setCalendarView(initialCalendarView);
|
|
5230
|
+
}, [initialCalendarView]);
|
|
5061
5231
|
const filtersIdBase = useId();
|
|
5062
5232
|
const {
|
|
5063
5233
|
categories,
|
|
@@ -5239,26 +5409,16 @@ var EventCombinedClient = ({
|
|
|
5239
5409
|
),
|
|
5240
5410
|
activeTab === "calendar" && /* @__PURE__ */ jsxs(EventModalProvider, { children: [
|
|
5241
5411
|
/* @__PURE__ */ jsxs("div", { className: "event-combined-content event-calendar", children: [
|
|
5242
|
-
calendarTabViews === "both" && /* @__PURE__ */
|
|
5243
|
-
|
|
5244
|
-
|
|
5245
|
-
|
|
5246
|
-
|
|
5247
|
-
|
|
5248
|
-
|
|
5249
|
-
|
|
5250
|
-
|
|
5251
|
-
|
|
5252
|
-
/* @__PURE__ */ jsx(
|
|
5253
|
-
"button",
|
|
5254
|
-
{
|
|
5255
|
-
type: "button",
|
|
5256
|
-
className: `event-calendar-view-btn ${calendarView === "week" ? "event-calendar-view-btn--active" : ""}`,
|
|
5257
|
-
onClick: () => setCalendarView("week"),
|
|
5258
|
-
children: "Week"
|
|
5259
|
-
}
|
|
5260
|
-
)
|
|
5261
|
-
] }),
|
|
5412
|
+
calendarTabViews === "both" && /* @__PURE__ */ jsx("div", { className: "event-calendar-view-toggle", children: calendarViewOptions.map((option) => /* @__PURE__ */ jsx(
|
|
5413
|
+
"button",
|
|
5414
|
+
{
|
|
5415
|
+
type: "button",
|
|
5416
|
+
className: `event-calendar-view-btn ${calendarView === option.id ? "event-calendar-view-btn--active" : ""}`,
|
|
5417
|
+
onClick: () => setCalendarView(option.id),
|
|
5418
|
+
children: option.label
|
|
5419
|
+
},
|
|
5420
|
+
option.id
|
|
5421
|
+
)) }),
|
|
5262
5422
|
/* @__PURE__ */ jsxs("div", { className: "event-calendar-header", children: [
|
|
5263
5423
|
/* @__PURE__ */ jsxs("div", { className: "event-calendar-nav", children: [
|
|
5264
5424
|
/* @__PURE__ */ jsx(
|
|
@@ -5598,6 +5758,7 @@ var EventCalendarClient = ({
|
|
|
5598
5758
|
paginationAction: display.paginationAction,
|
|
5599
5759
|
startOfWeek: display.startOfWeek,
|
|
5600
5760
|
calendarTabViews: display.calendarTabViews,
|
|
5761
|
+
defaultCalendarView: display.defaultCalendarView,
|
|
5601
5762
|
showFilters: display.showFilters,
|
|
5602
5763
|
showCategoryFilter: display.showCategoryFilter,
|
|
5603
5764
|
showVenueFilter: display.showVenueFilter,
|
|
@@ -5692,7 +5853,7 @@ var EventCalendarTimetableClient = ({ render }) => {
|
|
|
5692
5853
|
};
|
|
5693
5854
|
var EventCalendarGridClient = ({ render }) => {
|
|
5694
5855
|
const { display, hydration } = render;
|
|
5695
|
-
const calendarView = display.
|
|
5856
|
+
const calendarView = display.defaultCalendarView;
|
|
5696
5857
|
const { filtersNode, listFilters } = useEventCalendarFilterState(display);
|
|
5697
5858
|
const calendarInitialEvents = usePrefetchedCalendarEvents(display, listFilters);
|
|
5698
5859
|
const {
|
|
@@ -5732,7 +5893,15 @@ var EventCalendarGridClient = ({ render }) => {
|
|
|
5732
5893
|
onPrevious: goToPrevious,
|
|
5733
5894
|
onToday: goToToday,
|
|
5734
5895
|
children: [
|
|
5735
|
-
|
|
5896
|
+
viewport.kind === "week" ? /* @__PURE__ */ jsx(
|
|
5897
|
+
WeekAgendaView,
|
|
5898
|
+
{
|
|
5899
|
+
days: viewport.days,
|
|
5900
|
+
events,
|
|
5901
|
+
emptyMessage: display.emptyMessage,
|
|
5902
|
+
showCapacity: display.showCapacity
|
|
5903
|
+
}
|
|
5904
|
+
) : /* @__PURE__ */ jsxs("div", { className: "event-calendar-container", children: [
|
|
5736
5905
|
/* @__PURE__ */ jsx("div", { className: "event-calendar-day-headers", children: dayNames.map((day) => /* @__PURE__ */ jsx("div", { className: "event-calendar-day-header", children: day }, day)) }),
|
|
5737
5906
|
/* @__PURE__ */ jsx("div", { className: "event-calendar-grid", children: viewport.days.map((date) => {
|
|
5738
5907
|
const dateKey = formatDateKey(date);
|
|
@@ -5748,7 +5917,7 @@ var EventCalendarGridClient = ({ render }) => {
|
|
|
5748
5917
|
);
|
|
5749
5918
|
}) })
|
|
5750
5919
|
] }),
|
|
5751
|
-
events.length === 0 && !loading && !error ? /* @__PURE__ */ jsx("p", { className: "event-calendar-empty", children: display.emptyMessage }) : null
|
|
5920
|
+
viewport.kind === "month" && events.length === 0 && !loading && !error ? /* @__PURE__ */ jsx("p", { className: "event-calendar-empty", children: display.emptyMessage }) : null
|
|
5752
5921
|
]
|
|
5753
5922
|
}
|
|
5754
5923
|
),
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { useRef, useEffect } from 'react';
|
|
3
|
-
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useRef, useEffect, createElement } from 'react';
|
|
4
3
|
|
|
5
4
|
// ../altcha/src/AltchaWidget.tsx
|
|
6
5
|
function AltchaWidget({
|
|
@@ -46,7 +45,7 @@ function AltchaWidget({
|
|
|
46
45
|
}
|
|
47
46
|
};
|
|
48
47
|
}, [challengeUrl, auto, hidelogo, className, onSolutionChange]);
|
|
49
|
-
return
|
|
48
|
+
return createElement("div", { ref: containerRef });
|
|
50
49
|
}
|
|
51
50
|
|
|
52
51
|
// ../altcha/src/client.ts
|