@riverbankcms/sdk 0.90.0 → 0.90.1
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-KVXNF3VW.mjs → PreviewEditorSidebar-FNFRVSIM.mjs} +2 -2
- package/dist/{PreviewEditorUI-J3JN5Z7T.mjs → PreviewEditorUI-3WXJFQXG.mjs} +2 -2
- package/dist/SdkPreviewModeRuntime-2UCIMKUB.mjs +8 -0
- package/dist/_dts/api/src/bookingConfig.d.ts +3 -0
- package/dist/_dts/api/src/event-listing-destination.d.ts +59 -0
- package/dist/_dts/api/src/index.d.ts +4 -0
- package/dist/_dts/api/src/navigation/dashboardSettingsNav.d.ts +0 -1
- package/dist/_dts/api/src/navigation.d.ts +2 -0
- package/dist/_dts/api/src/publicExperienceEndpoints.d.ts +3 -1
- package/dist/_dts/api/src/settings/permissions.d.ts +273 -0
- package/dist/_dts/api/src/types.d.ts +1 -0
- package/dist/_dts/blocks/src/system/blocks/events/shared/schemas.d.ts +60 -2
- package/dist/_dts/blocks/src/system/blocks/events/shared/types.d.ts +12 -1
- package/dist/_dts/blocks/src/system/blocks/media-text.d.ts +9 -9
- package/dist/_dts/blocks/src/system/blocks/team-members.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/event-registration.headless.contract.d.ts +5 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/eventPaymentOptions.d.ts +24 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/destination.d.ts +8 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/pricing.d.ts +3 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/utils.d.ts +7 -0
- package/dist/_dts/core/src/event-pricing.d.ts +12 -2
- package/dist/_dts/sdk/src/public-api/contracts.d.ts +11 -1
- package/dist/_dts/sdk/src/rendering/islands/types.d.ts +11 -1
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/{chunk-PMBB6MQ7.mjs → chunk-CR2VX432.mjs} +297 -117
- package/dist/{chunk-AEOYWPE4.mjs → chunk-FA6LVZ7C.mjs} +5 -5
- package/dist/{chunk-RQ3XZ4SJ.mjs → chunk-H6TT5ZXI.mjs} +1 -1
- package/dist/{chunk-GSPFFUVB.mjs → chunk-SYYJZPKU.mjs} +1 -1
- package/dist/cli/index.mjs +160 -103
- package/dist/client/{accordion-GXQNWQ6O.mjs → accordion-4K7VGZ3I.mjs} +2 -2
- package/dist/client/{bookingForm-STLUJ36H.mjs → bookingForm-3QXA3CIS.mjs} +5 -5
- package/dist/client/bookings.mjs +1154 -556
- package/dist/client/{carousel-CVRN6EPP.mjs → carousel-BEJKNGQ7.mjs} +3 -3
- package/dist/client/{cart-IYIBA5CL.mjs → cart-44BBM6XG.mjs} +6 -6
- package/dist/client/{checkout-O3BGM4GS.mjs → checkout-THMHEYKF.mjs} +6 -6
- package/dist/client/{chunk-25W2EQUN.mjs → chunk-3H5CLFKT.mjs} +8 -0
- package/dist/client/{chunk-MFPKS6QS.mjs → chunk-4COPESPO.mjs} +5 -5
- package/dist/client/{chunk-4RTFGHZN.mjs → chunk-5AJIMWKS.mjs} +6 -3
- package/dist/client/{chunk-6DPXDOIL.mjs → chunk-B4H6QMPY.mjs} +93 -22
- package/dist/client/{chunk-VFHZLZAC.mjs → chunk-DQIRKNZE.mjs} +1 -1
- package/dist/client/{chunk-7DH35FGA.mjs → chunk-EJBHK74Y.mjs} +1 -1
- package/dist/client/{chunk-DAS5CIER.mjs → chunk-JV7ZNAOU.mjs} +118 -20
- package/dist/client/{chunk-FHU6PFPM.mjs → chunk-KNTLBQ3N.mjs} +1 -1
- package/dist/client/{chunk-Z62JYS5O.mjs → chunk-PEDNDLPB.mjs} +2 -2
- package/dist/client/{chunk-NBFRJ5NB.mjs → chunk-SLY6UDAS.mjs} +2 -2
- package/dist/client/{chunk-D3ETC2SU.mjs → chunk-ZIAF2DA4.mjs} +1 -1
- package/dist/client/client.mjs +272 -83
- package/dist/client/{courseRegistration-2D3ACMJR.mjs → courseRegistration-URX7RCCK.mjs} +5 -5
- package/dist/client/{eventCalendar-QY4UZUFF.mjs → eventCalendar-GTENOQCE.mjs} +8 -8
- package/dist/client/{eventCombined-RRCDKJC2.mjs → eventCombined-EZVB72MF.mjs} +8 -8
- package/dist/client/{eventDetails-YO335BUT.mjs → eventDetails-CH4BJR5Z.mjs} +8 -8
- package/dist/client/{eventListing-PXA6GFQ3.mjs → eventListing-4BVOI5HS.mjs} +8 -8
- package/dist/client/{eventRegistration-2ZHEDDXO.mjs → eventRegistration-37LPIKIE.mjs} +8 -8
- package/dist/client/{form-ZS6KX4U2.mjs → form-FX3Y54YK.mjs} +2 -2
- package/dist/client/{headerSection-QK5SLIIB.mjs → headerSection-UOZZGVYL.mjs} +3 -3
- package/dist/client/hooks.mjs +86 -35
- package/dist/client/{locationMap-GFNIUD2X.mjs → locationMap-VSIPKV35.mjs} +3 -3
- package/dist/client/{newsletterForm-PGLTTCUG.mjs → newsletterForm-6FRJKNAF.mjs} +2 -2
- package/dist/client/{productDetail-OPBE5ZPI.mjs → productDetail-6AHMLXCO.mjs} +6 -6
- package/dist/client/{productList-NI72Q62Z.mjs → productList-M2CYIZVH.mjs} +6 -6
- package/dist/client/rendering/client.mjs +231 -42
- package/dist/client/rendering/islands.mjs +19 -19
- package/dist/client/rendering.mjs +273 -84
- package/dist/client/{shop-3ZQPEWYI.mjs → shop-AUOT6GEX.mjs} +6 -6
- package/dist/preview-next/client/runtime.mjs +3 -3
- package/dist/{sdk-runtime-FSHXCWDS.mjs → sdk-runtime-6GPJNLU6.mjs} +4 -4
- package/dist/server/components.mjs +136 -58
- package/dist/server/config-validation.mjs +78 -27
- package/dist/server/config.mjs +78 -27
- package/dist/server/data.mjs +86 -35
- package/dist/server/index.mjs +1 -1
- package/dist/server/next.mjs +157 -79
- package/dist/server/page-converter.mjs +72 -21
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +148 -70
- package/dist/server/rendering.mjs +152 -74
- package/dist/server/routing.mjs +121 -44
- package/dist/server/server.mjs +95 -44
- package/package.json +2 -2
- package/dist/SdkPreviewModeRuntime-UBL6MSNP.mjs +0 -8
package/dist/client/client.mjs
CHANGED
|
@@ -176,6 +176,8 @@ function publicEventPricingType(pricing) {
|
|
|
176
176
|
case "ticket_types":
|
|
177
177
|
case "course":
|
|
178
178
|
return isFreePublicEventPriceDisplay(pricing.display) ? "free" : "paid";
|
|
179
|
+
case "external":
|
|
180
|
+
return "external";
|
|
179
181
|
}
|
|
180
182
|
}
|
|
181
183
|
function publicEventPricingCurrency(pricing) {
|
|
@@ -187,6 +189,8 @@ function publicEventPricingCurrency(pricing) {
|
|
|
187
189
|
return pricing.currency;
|
|
188
190
|
case "course":
|
|
189
191
|
return pricing.display.display.currency;
|
|
192
|
+
case "external":
|
|
193
|
+
return null;
|
|
190
194
|
}
|
|
191
195
|
}
|
|
192
196
|
function publicEventScalarPrice(pricing) {
|
|
@@ -201,6 +205,7 @@ function publicEventPricingMode(pricing) {
|
|
|
201
205
|
return "ticket_types";
|
|
202
206
|
case "drop_in":
|
|
203
207
|
case "course":
|
|
208
|
+
case "external":
|
|
204
209
|
return void 0;
|
|
205
210
|
}
|
|
206
211
|
}
|
|
@@ -218,6 +223,7 @@ function isFreePublicEventPriceDisplay(display) {
|
|
|
218
223
|
case "range":
|
|
219
224
|
case "mixed":
|
|
220
225
|
case "unavailable":
|
|
226
|
+
case "external":
|
|
221
227
|
return false;
|
|
222
228
|
}
|
|
223
229
|
}
|
|
@@ -248,6 +254,8 @@ function formatBookingPriceDisplay(display, options = {}) {
|
|
|
248
254
|
return display.paidToAmount > display.paidFromAmount ? `Free / ${formatCurrencyAmount(display.paidFromAmount, display.currency, options)} - ${formatCurrencyAmount(display.paidToAmount, display.currency, options)}` : `Free / ${formatCurrencyAmount(display.paidFromAmount, display.currency, options)}`;
|
|
249
255
|
case "unavailable":
|
|
250
256
|
return "Pricing unavailable";
|
|
257
|
+
case "external":
|
|
258
|
+
return display.label;
|
|
251
259
|
case "course":
|
|
252
260
|
return formatCoursePriceDisplayLabel(display.display, options);
|
|
253
261
|
default:
|
|
@@ -22943,7 +22951,7 @@ var init_schemas = __esm({
|
|
|
22943
22951
|
|
|
22944
22952
|
// ../blocks/src/system/blocks/events/shared/schemas.ts
|
|
22945
22953
|
import { z as z46 } from "zod";
|
|
22946
|
-
var eventPresetSchema, eventScheduleScopeSchema, eventDestinationModeSchema, eventVenueSchema, eventCategorySchema, pricingTypeSchema, accessRestrictionSchema, eventPricingModeSchema, publicCoursePriceDisplaySchema, publicEventPriceDisplaySchema, publicEventTicketTypePriceDisplaySchema, publicEventAttendanceModeSchema, publicEventAttendanceModeAvailabilitySchema, publicEventTicketTypeAvailabilitySchema, publicEventTicketTypeSchema, publicEventPricingSchema, publicTeamMemberSummarySchema, publicEventSchema, publicEventsArraySchema;
|
|
22954
|
+
var eventPresetSchema, eventScheduleScopeSchema, eventDestinationModeSchema, publicEventDestinationSchema, eventVenueSchema, eventCategorySchema, pricingTypeSchema, accessRestrictionSchema, eventPricingModeSchema, publicCoursePriceDisplaySchema, publicEventPriceDisplaySchema, publicEventTicketTypePriceDisplaySchema, publicEventAttendanceModeSchema, publicEventAttendanceModeAvailabilitySchema, publicEventTicketTypeAvailabilitySchema, publicEventTicketTypeSchema, publicEventPricingSchema, publicTeamMemberSummarySchema, publicEventSchema, publicEventsArraySchema;
|
|
22947
22955
|
var init_schemas2 = __esm({
|
|
22948
22956
|
"../blocks/src/system/blocks/events/shared/schemas.ts"() {
|
|
22949
22957
|
"use strict";
|
|
@@ -22954,6 +22962,18 @@ var init_schemas2 = __esm({
|
|
|
22954
22962
|
eventPresetSchema = z46.enum(["event", "class", "workshop", "retreat", "performance"]);
|
|
22955
22963
|
eventScheduleScopeSchema = z46.enum(["recurring", "oneOff"]);
|
|
22956
22964
|
eventDestinationModeSchema = z46.enum(["cms-managed", "system-managed"]);
|
|
22965
|
+
publicEventDestinationSchema = z46.discriminatedUnion("kind", [
|
|
22966
|
+
z46.object({
|
|
22967
|
+
kind: z46.literal("native"),
|
|
22968
|
+
mode: eventDestinationModeSchema,
|
|
22969
|
+
path: z46.string()
|
|
22970
|
+
}),
|
|
22971
|
+
z46.object({
|
|
22972
|
+
kind: z46.literal("external"),
|
|
22973
|
+
url: z46.string(),
|
|
22974
|
+
label: z46.string()
|
|
22975
|
+
})
|
|
22976
|
+
]);
|
|
22957
22977
|
eventVenueSchema = z46.object({
|
|
22958
22978
|
id: z46.string(),
|
|
22959
22979
|
name: z46.string(),
|
|
@@ -22968,7 +22988,7 @@ var init_schemas2 = __esm({
|
|
|
22968
22988
|
name: z46.string(),
|
|
22969
22989
|
color: z46.string().nullable()
|
|
22970
22990
|
});
|
|
22971
|
-
pricingTypeSchema = z46.enum(["free", "paid"]);
|
|
22991
|
+
pricingTypeSchema = z46.enum(["free", "paid", "external"]);
|
|
22972
22992
|
accessRestrictionSchema = z46.enum(["none", "category"]);
|
|
22973
22993
|
eventPricingModeSchema = z46.enum(["single", "ticket_types"]);
|
|
22974
22994
|
publicCoursePriceDisplaySchema = z46.discriminatedUnion("kind", [
|
|
@@ -22989,6 +23009,7 @@ var init_schemas2 = __esm({
|
|
|
22989
23009
|
currency: z46.string()
|
|
22990
23010
|
}),
|
|
22991
23011
|
z46.object({ kind: z46.literal("unavailable"), currency: z46.string() }),
|
|
23012
|
+
z46.object({ kind: z46.literal("external"), label: z46.string() }),
|
|
22992
23013
|
z46.object({ kind: z46.literal("course"), display: publicCoursePriceDisplaySchema })
|
|
22993
23014
|
]);
|
|
22994
23015
|
publicEventTicketTypePriceDisplaySchema = z46.union([
|
|
@@ -23067,6 +23088,10 @@ var init_schemas2 = __esm({
|
|
|
23067
23088
|
z46.object({
|
|
23068
23089
|
kind: z46.literal("course"),
|
|
23069
23090
|
display: z46.object({ kind: z46.literal("course"), display: publicCoursePriceDisplaySchema })
|
|
23091
|
+
}),
|
|
23092
|
+
z46.object({
|
|
23093
|
+
kind: z46.literal("external"),
|
|
23094
|
+
display: z46.object({ kind: z46.literal("external"), label: z46.string() })
|
|
23070
23095
|
})
|
|
23071
23096
|
]);
|
|
23072
23097
|
publicTeamMemberSummarySchema = z46.object({
|
|
@@ -23095,7 +23120,8 @@ var init_schemas2 = __esm({
|
|
|
23095
23120
|
image: mediaSchema2.nullable().optional()
|
|
23096
23121
|
}).optional(),
|
|
23097
23122
|
slug: z46.string(),
|
|
23098
|
-
path: z46.string(),
|
|
23123
|
+
path: z46.string().nullable(),
|
|
23124
|
+
destination: publicEventDestinationSchema,
|
|
23099
23125
|
requiresRegistration: z46.boolean(),
|
|
23100
23126
|
deliveryMode: z46.enum(["in_person", "online", "hybrid"]),
|
|
23101
23127
|
attendanceModes: z46.array(publicEventAttendanceModeAvailabilitySchema),
|
|
@@ -23447,11 +23473,45 @@ var init_events = __esm({
|
|
|
23447
23473
|
}
|
|
23448
23474
|
});
|
|
23449
23475
|
|
|
23476
|
+
// ../blocks/src/system/runtime/nodes/events/shared/destination.ts
|
|
23477
|
+
function isRecord5(value) {
|
|
23478
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
23479
|
+
}
|
|
23480
|
+
function isRuntimeEventDestination(value) {
|
|
23481
|
+
if (!isRecord5(value) || typeof value.kind !== "string") return false;
|
|
23482
|
+
if (value.kind === "native") {
|
|
23483
|
+
return (value.mode === "cms-managed" || value.mode === "system-managed") && typeof value.path === "string";
|
|
23484
|
+
}
|
|
23485
|
+
return value.kind === "external" && typeof value.url === "string" && typeof value.label === "string";
|
|
23486
|
+
}
|
|
23487
|
+
function resolveRuntimeEventDestination(event) {
|
|
23488
|
+
if (isRuntimeEventDestination(event.destination)) {
|
|
23489
|
+
return event.destination;
|
|
23490
|
+
}
|
|
23491
|
+
return {
|
|
23492
|
+
kind: "native",
|
|
23493
|
+
mode: event.eventDestinationMode === "system-managed" ? "system-managed" : "cms-managed",
|
|
23494
|
+
path: typeof event.path === "string" ? event.path : ""
|
|
23495
|
+
};
|
|
23496
|
+
}
|
|
23497
|
+
var init_destination = __esm({
|
|
23498
|
+
"../blocks/src/system/runtime/nodes/events/shared/destination.ts"() {
|
|
23499
|
+
"use strict";
|
|
23500
|
+
}
|
|
23501
|
+
});
|
|
23502
|
+
|
|
23450
23503
|
// ../blocks/src/system/runtime/nodes/events/shared/pricing.ts
|
|
23451
23504
|
function resolveRuntimeEventPricing(event) {
|
|
23452
23505
|
if (isPublicEventPricing(event.pricing)) {
|
|
23453
23506
|
return event.pricing;
|
|
23454
23507
|
}
|
|
23508
|
+
const destination = resolveRuntimeEventDestination(event);
|
|
23509
|
+
if (destination.kind === "external") {
|
|
23510
|
+
return {
|
|
23511
|
+
kind: "external",
|
|
23512
|
+
display: { kind: "external", label: "External registration" }
|
|
23513
|
+
};
|
|
23514
|
+
}
|
|
23455
23515
|
const legacy = event;
|
|
23456
23516
|
const currency = readCurrency(legacy.currency);
|
|
23457
23517
|
if (event.requiresRegistration === false) {
|
|
@@ -23488,22 +23548,22 @@ function resolveRuntimeEventPricing(event) {
|
|
|
23488
23548
|
function readCurrency(value) {
|
|
23489
23549
|
return typeof value === "string" && value.trim().length > 0 ? value : DEFAULT_EVENT_CURRENCY;
|
|
23490
23550
|
}
|
|
23491
|
-
function
|
|
23551
|
+
function isRecord6(value) {
|
|
23492
23552
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
23493
23553
|
}
|
|
23494
23554
|
function isPublicEventPricing(value) {
|
|
23495
|
-
if (!
|
|
23496
|
-
return value.kind === "drop_in" || value.kind === "free_registration" || value.kind === "single_paid" || value.kind === "ticket_types" || value.kind === "course";
|
|
23555
|
+
if (!isRecord6(value) || typeof value.kind !== "string") return false;
|
|
23556
|
+
return value.kind === "drop_in" || value.kind === "free_registration" || value.kind === "single_paid" || value.kind === "ticket_types" || value.kind === "course" || value.kind === "external";
|
|
23497
23557
|
}
|
|
23498
23558
|
function isPublicEventTicketType(value) {
|
|
23499
|
-
return
|
|
23559
|
+
return isRecord6(value) && typeof value.id === "string";
|
|
23500
23560
|
}
|
|
23501
23561
|
function readTicketTypePriceDisplay(value, currency) {
|
|
23502
23562
|
const display = readLegacyPriceDisplay(value, currency);
|
|
23503
|
-
return display.kind === "course" ? { kind: "unavailable", currency } : display;
|
|
23563
|
+
return display.kind === "course" || display.kind === "external" ? { kind: "unavailable", currency } : display;
|
|
23504
23564
|
}
|
|
23505
23565
|
function readLegacyPriceDisplay(value, currency) {
|
|
23506
|
-
if (!
|
|
23566
|
+
if (!isRecord6(value) || typeof value.kind !== "string") {
|
|
23507
23567
|
return { kind: "unavailable", currency };
|
|
23508
23568
|
}
|
|
23509
23569
|
const displayCurrency = readCurrency(value.currency);
|
|
@@ -23542,7 +23602,7 @@ function readLegacyPriceDisplay(value, currency) {
|
|
|
23542
23602
|
case "unavailable":
|
|
23543
23603
|
return { kind: "unavailable", currency: displayCurrency };
|
|
23544
23604
|
case "course":
|
|
23545
|
-
return
|
|
23605
|
+
return isRecord6(value.display) ? {
|
|
23546
23606
|
kind: "course",
|
|
23547
23607
|
display: readCoursePriceDisplay(value.display, displayCurrency)
|
|
23548
23608
|
} : {
|
|
@@ -23580,6 +23640,7 @@ var DEFAULT_EVENT_CURRENCY;
|
|
|
23580
23640
|
var init_pricing = __esm({
|
|
23581
23641
|
"../blocks/src/system/runtime/nodes/events/shared/pricing.ts"() {
|
|
23582
23642
|
"use strict";
|
|
23643
|
+
init_destination();
|
|
23583
23644
|
DEFAULT_EVENT_CURRENCY = "USD";
|
|
23584
23645
|
}
|
|
23585
23646
|
});
|
|
@@ -23672,7 +23733,7 @@ function resolveEventRequiresPayment(input) {
|
|
|
23672
23733
|
if (!input.event) {
|
|
23673
23734
|
return false;
|
|
23674
23735
|
}
|
|
23675
|
-
return publicEventPricingType(resolveRuntimeEventPricing(input.event))
|
|
23736
|
+
return publicEventPricingType(resolveRuntimeEventPricing(input.event)) === "paid";
|
|
23676
23737
|
}
|
|
23677
23738
|
function resolveDiscountContext(input) {
|
|
23678
23739
|
const selection = input.paymentSelection.method ? input.paymentSelection : null;
|
|
@@ -23804,15 +23865,16 @@ function buildEventRegistrationShellBodyText(stepLabels) {
|
|
|
23804
23865
|
return "Preparing dates, tickets, and booking details.";
|
|
23805
23866
|
}
|
|
23806
23867
|
function normalizeEventRegistrationEventInput(value) {
|
|
23807
|
-
if (!
|
|
23868
|
+
if (!isRecord7(value)) {
|
|
23808
23869
|
return value;
|
|
23809
23870
|
}
|
|
23810
23871
|
return {
|
|
23811
23872
|
...value,
|
|
23873
|
+
destination: resolveRuntimeEventDestination(value),
|
|
23812
23874
|
pricing: resolveRuntimeEventPricing(value)
|
|
23813
23875
|
};
|
|
23814
23876
|
}
|
|
23815
|
-
function
|
|
23877
|
+
function isRecord7(value) {
|
|
23816
23878
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
23817
23879
|
}
|
|
23818
23880
|
function buildEventRegistrationInteractiveIslandProps(props2) {
|
|
@@ -23838,6 +23900,7 @@ var init_event_registration_interactive = __esm({
|
|
|
23838
23900
|
init_event_registration_shared();
|
|
23839
23901
|
init_events();
|
|
23840
23902
|
init_pricing();
|
|
23903
|
+
init_destination();
|
|
23841
23904
|
init_islands();
|
|
23842
23905
|
init_runtime();
|
|
23843
23906
|
init_contract_schemas();
|
|
@@ -25129,16 +25192,28 @@ function formatEventPrice(event) {
|
|
|
25129
25192
|
function formatEventPriceDisplay(pricing) {
|
|
25130
25193
|
return formatEventPricing(pricing, { decimals: "auto" });
|
|
25131
25194
|
}
|
|
25195
|
+
function resolveEventHref(event) {
|
|
25196
|
+
const destination = resolveRuntimeEventDestination(event);
|
|
25197
|
+
return destination.kind === "external" ? destination.url : destination.path;
|
|
25198
|
+
}
|
|
25199
|
+
function resolveEventLinkProps(event) {
|
|
25200
|
+
const href = resolveEventHref(event);
|
|
25201
|
+
const destination = resolveRuntimeEventDestination(event);
|
|
25202
|
+
return destination.kind === "external" ? { href, target: "_blank", rel: "noopener noreferrer" } : { href };
|
|
25203
|
+
}
|
|
25132
25204
|
function resolveEventCta(event, buttonText) {
|
|
25133
25205
|
const { isFull: isSoldOut } = getEventAvailability(event);
|
|
25134
|
-
const
|
|
25206
|
+
const destination = resolveRuntimeEventDestination(event);
|
|
25207
|
+
const isExternal = destination.kind === "external";
|
|
25208
|
+
const defaultButtonText = isExternal ? destination.label : event.kind === "course_session" ? "Book course" : "Book";
|
|
25135
25209
|
const effectiveButtonText = buttonText ?? defaultButtonText;
|
|
25136
|
-
|
|
25137
|
-
|
|
25210
|
+
const href = resolveEventHref(event);
|
|
25211
|
+
if (!isExternal && isSoldOut) {
|
|
25212
|
+
return { label: "Sold out", href, external: false, hidden: true };
|
|
25138
25213
|
}
|
|
25139
25214
|
const enrollmentOpen = event.kind === "course_session" ? event.course?.enrollmentOpen !== false : true;
|
|
25140
25215
|
const label = !enrollmentOpen ? "Registration closed" : effectiveButtonText;
|
|
25141
|
-
return { label, href:
|
|
25216
|
+
return { label, href, external: isExternal, hidden: false };
|
|
25142
25217
|
}
|
|
25143
25218
|
var COLUMN_CLASSES;
|
|
25144
25219
|
var init_utils3 = __esm({
|
|
@@ -25147,6 +25222,7 @@ var init_utils3 = __esm({
|
|
|
25147
25222
|
init_src();
|
|
25148
25223
|
init_src3();
|
|
25149
25224
|
init_eventCapacity();
|
|
25225
|
+
init_destination();
|
|
25150
25226
|
init_pricing();
|
|
25151
25227
|
init_src3();
|
|
25152
25228
|
init_src3();
|
|
@@ -26681,6 +26757,8 @@ var init_EventCard = __esm({
|
|
|
26681
26757
|
"a",
|
|
26682
26758
|
{
|
|
26683
26759
|
href: cta.href,
|
|
26760
|
+
target: cta.external ? "_blank" : void 0,
|
|
26761
|
+
rel: cta.external ? "noopener noreferrer" : void 0,
|
|
26684
26762
|
className: `${buttonClass} event-card-cta`,
|
|
26685
26763
|
children: cta.label
|
|
26686
26764
|
}
|
|
@@ -26738,10 +26816,19 @@ var init_EventCompactRow = __esm({
|
|
|
26738
26816
|
formattedTime,
|
|
26739
26817
|
/* @__PURE__ */ jsx8("span", { className: "event-compact-row-action-price", children: price })
|
|
26740
26818
|
] }),
|
|
26741
|
-
cta.hidden ? /* @__PURE__ */ jsx8("span", { className: "event-compact-row-status", children: cta.label }) : /* @__PURE__ */ jsxs6(
|
|
26742
|
-
|
|
26743
|
-
|
|
26744
|
-
|
|
26819
|
+
cta.hidden ? /* @__PURE__ */ jsx8("span", { className: "event-compact-row-status", children: cta.label }) : /* @__PURE__ */ jsxs6(
|
|
26820
|
+
"a",
|
|
26821
|
+
{
|
|
26822
|
+
href: cta.href,
|
|
26823
|
+
target: cta.external ? "_blank" : void 0,
|
|
26824
|
+
rel: cta.external ? "noopener noreferrer" : void 0,
|
|
26825
|
+
className: `${buttonClass} event-compact-row-cta`,
|
|
26826
|
+
children: [
|
|
26827
|
+
/* @__PURE__ */ jsx8("span", { children: cta.label }),
|
|
26828
|
+
/* @__PURE__ */ jsx8(ArrowRightIcon, { "aria-hidden": "true" })
|
|
26829
|
+
]
|
|
26830
|
+
}
|
|
26831
|
+
)
|
|
26745
26832
|
] })
|
|
26746
26833
|
] })
|
|
26747
26834
|
] });
|
|
@@ -29445,12 +29532,12 @@ function resolveBookingSiteId(siteId, form2) {
|
|
|
29445
29532
|
return siteId || form2?.siteId || "";
|
|
29446
29533
|
}
|
|
29447
29534
|
function normalizeBookingFormConfig(form2) {
|
|
29448
|
-
if (!
|
|
29535
|
+
if (!isRecord11(form2)) return null;
|
|
29449
29536
|
const id = readNonEmptyString(form2.id);
|
|
29450
29537
|
const name = readNonEmptyString(form2.name);
|
|
29451
29538
|
if (!id || !name) return null;
|
|
29452
|
-
const schemaSource =
|
|
29453
|
-
const settingsSource =
|
|
29539
|
+
const schemaSource = isRecord11(form2.schema) ? form2.schema : isRecord11(form2.schemaJson) ? form2.schemaJson : null;
|
|
29540
|
+
const settingsSource = isRecord11(form2.settings) ? form2.settings : isRecord11(form2.settingsJson) ? form2.settingsJson : null;
|
|
29454
29541
|
return {
|
|
29455
29542
|
id,
|
|
29456
29543
|
name,
|
|
@@ -29474,10 +29561,10 @@ function normalizeBookingServices(services) {
|
|
|
29474
29561
|
if (Array.isArray(services)) {
|
|
29475
29562
|
return services.filter(isBookingFormService).map(normalizeService);
|
|
29476
29563
|
}
|
|
29477
|
-
if (
|
|
29564
|
+
if (isRecord11(services) && "services" in services) {
|
|
29478
29565
|
return Array.isArray(services.services) ? services.services.filter(isBookingFormService).map(normalizeService) : [];
|
|
29479
29566
|
}
|
|
29480
|
-
return
|
|
29567
|
+
return isRecord11(services) ? Object.values(services).filter(isBookingFormService).map(normalizeService) : [];
|
|
29481
29568
|
}
|
|
29482
29569
|
function normalizeBookingSchema(value) {
|
|
29483
29570
|
if (!value) return void 0;
|
|
@@ -29489,7 +29576,7 @@ function normalizeBookingSchema(value) {
|
|
|
29489
29576
|
};
|
|
29490
29577
|
}
|
|
29491
29578
|
function readBookingFormField(value) {
|
|
29492
|
-
if (!
|
|
29579
|
+
if (!isRecord11(value)) return null;
|
|
29493
29580
|
const id = readNonEmptyString(value.id);
|
|
29494
29581
|
const label = readNonEmptyString(value.label);
|
|
29495
29582
|
const type = readBookingFieldType(value.type);
|
|
@@ -29535,7 +29622,7 @@ function readBookingFieldOptions(value) {
|
|
|
29535
29622
|
return options.length > 0 ? options : void 0;
|
|
29536
29623
|
}
|
|
29537
29624
|
function readBookingFieldOption(value) {
|
|
29538
|
-
if (!
|
|
29625
|
+
if (!isRecord11(value)) return null;
|
|
29539
29626
|
const optionValue = readNonEmptyString(value.value);
|
|
29540
29627
|
const label = readNonEmptyString(value.label);
|
|
29541
29628
|
return optionValue && label ? { value: optionValue, label } : null;
|
|
@@ -29552,7 +29639,7 @@ function normalizeBookingSettings(value) {
|
|
|
29552
29639
|
};
|
|
29553
29640
|
}
|
|
29554
29641
|
function isBookingFormService(value) {
|
|
29555
|
-
return
|
|
29642
|
+
return isRecord11(value) && typeof value.id === "string" && typeof value.siteId === "string" && typeof value.title === "string";
|
|
29556
29643
|
}
|
|
29557
29644
|
function collectBookingCustomFields(data) {
|
|
29558
29645
|
const customFields = {};
|
|
@@ -29582,7 +29669,7 @@ function readStringArray(value) {
|
|
|
29582
29669
|
const strings = value.filter((item) => typeof item === "string");
|
|
29583
29670
|
return strings.length > 0 ? strings : void 0;
|
|
29584
29671
|
}
|
|
29585
|
-
function
|
|
29672
|
+
function isRecord11(value) {
|
|
29586
29673
|
return typeof value === "object" && value !== null;
|
|
29587
29674
|
}
|
|
29588
29675
|
function getBookingServicePaymentSelectionMode(service) {
|
|
@@ -30370,7 +30457,7 @@ function EventDetailsView({
|
|
|
30370
30457
|
"a",
|
|
30371
30458
|
{
|
|
30372
30459
|
className: "rb-tile rb-tile--interactive",
|
|
30373
|
-
|
|
30460
|
+
...resolveEventLinkProps(e),
|
|
30374
30461
|
children: /* @__PURE__ */ jsx30(
|
|
30375
30462
|
DateTimeTile,
|
|
30376
30463
|
{
|
|
@@ -30884,7 +30971,7 @@ var init_AgendaEventCard = __esm({
|
|
|
30884
30971
|
showCapacity,
|
|
30885
30972
|
onClick
|
|
30886
30973
|
}) => {
|
|
30887
|
-
const
|
|
30974
|
+
const eventLinkProps = resolveEventLinkProps(event);
|
|
30888
30975
|
const categoryColor = event.eventCategory?.color || "rgb(var(--tb-accent))";
|
|
30889
30976
|
const price = formatEventPrice(event);
|
|
30890
30977
|
const { available, isFull } = getEventAvailability(event);
|
|
@@ -30945,7 +31032,7 @@ var init_AgendaEventCard = __esm({
|
|
|
30945
31032
|
}
|
|
30946
31033
|
);
|
|
30947
31034
|
}
|
|
30948
|
-
return /* @__PURE__ */ jsx47("a", {
|
|
31035
|
+
return /* @__PURE__ */ jsx47("a", { ...eventLinkProps, className: "event-agenda-card", children: cardContent });
|
|
30949
31036
|
};
|
|
30950
31037
|
}
|
|
30951
31038
|
});
|
|
@@ -32802,7 +32889,7 @@ var init_embla_carousel_autoplay_esm = __esm({
|
|
|
32802
32889
|
function isObject(subject) {
|
|
32803
32890
|
return Object.prototype.toString.call(subject) === "[object Object]";
|
|
32804
32891
|
}
|
|
32805
|
-
function
|
|
32892
|
+
function isRecord15(subject) {
|
|
32806
32893
|
return isObject(subject) || Array.isArray(subject);
|
|
32807
32894
|
}
|
|
32808
32895
|
function canUseDOM() {
|
|
@@ -32819,7 +32906,7 @@ function areOptionsEqual(optionsA, optionsB) {
|
|
|
32819
32906
|
const valueA = optionsA[key];
|
|
32820
32907
|
const valueB = optionsB[key];
|
|
32821
32908
|
if (typeof valueA === "function") return `${valueA}` === `${valueB}`;
|
|
32822
|
-
if (!
|
|
32909
|
+
if (!isRecord15(valueA) || !isRecord15(valueB)) return valueA === valueB;
|
|
32823
32910
|
return areOptionsEqual(valueA, valueB);
|
|
32824
32911
|
});
|
|
32825
32912
|
}
|
|
@@ -35634,7 +35721,7 @@ function encodePublicProductCategorySelector2(selector) {
|
|
|
35634
35721
|
};
|
|
35635
35722
|
}
|
|
35636
35723
|
}
|
|
35637
|
-
function
|
|
35724
|
+
function isRecord16(value) {
|
|
35638
35725
|
return typeof value === "object" && value !== null;
|
|
35639
35726
|
}
|
|
35640
35727
|
function isJsonResponseContentType(contentType) {
|
|
@@ -35657,10 +35744,10 @@ async function parseJsonBody(response) {
|
|
|
35657
35744
|
}
|
|
35658
35745
|
}
|
|
35659
35746
|
function getBlockApiErrorDetails(data) {
|
|
35660
|
-
if (!
|
|
35747
|
+
if (!isRecord16(data)) {
|
|
35661
35748
|
return {};
|
|
35662
35749
|
}
|
|
35663
|
-
const nestedError =
|
|
35750
|
+
const nestedError = isRecord16(data.error) ? data.error : void 0;
|
|
35664
35751
|
const message = typeof nestedError?.message === "string" ? nestedError.message : typeof data.message === "string" ? data.message : void 0;
|
|
35665
35752
|
const code = typeof nestedError?.code === "string" ? nestedError.code : typeof data.code === "string" ? data.code : void 0;
|
|
35666
35753
|
return { message, code };
|
|
@@ -40562,8 +40649,10 @@ function buildBookingPaymentOptionViewModel(input) {
|
|
|
40562
40649
|
totalAmountCents: input.totalCents,
|
|
40563
40650
|
config: input.option.config
|
|
40564
40651
|
});
|
|
40652
|
+
const remainingBalance = Math.max(0, input.totalCents - dueToday);
|
|
40565
40653
|
const formattedTotal = formatPrice(input.totalCents, input.currency, input.locale);
|
|
40566
40654
|
const formattedDueToday = formatPrice(dueToday, input.currency, input.locale);
|
|
40655
|
+
const formattedRemainingBalance = formatPrice(remainingBalance, input.currency, input.locale);
|
|
40567
40656
|
const dueAt = resolveFlexibleBalanceDueAt({
|
|
40568
40657
|
bookingStartAt: input.bookingStartAt ?? (/* @__PURE__ */ new Date()).toISOString(),
|
|
40569
40658
|
dueDateRule: input.option.config.dueDateRule
|
|
@@ -40580,6 +40669,7 @@ function buildBookingPaymentOptionViewModel(input) {
|
|
|
40580
40669
|
summaryRows: [
|
|
40581
40670
|
{ label: "Total", value: formattedTotal },
|
|
40582
40671
|
{ label: "Due today", value: formattedDueToday },
|
|
40672
|
+
{ label: "Remaining balance", value: formattedRemainingBalance },
|
|
40583
40673
|
{ label: "Balance due by", value: formatScheduleDate(dueAt, input.locale) },
|
|
40584
40674
|
{
|
|
40585
40675
|
label: "Deposit policy",
|
|
@@ -45630,6 +45720,33 @@ function toEventDirectPaymentOption(option, mode) {
|
|
|
45630
45720
|
);
|
|
45631
45721
|
}
|
|
45632
45722
|
}
|
|
45723
|
+
function resolveEventRegistrationDirectPaymentSelection(input) {
|
|
45724
|
+
if (input.selection.method !== "stripe") {
|
|
45725
|
+
return { kind: "not-stripe" };
|
|
45726
|
+
}
|
|
45727
|
+
const fallbackOption = input.options[0];
|
|
45728
|
+
if (!fallbackOption) {
|
|
45729
|
+
return { kind: "unavailable" };
|
|
45730
|
+
}
|
|
45731
|
+
const requestedKind = input.selection.collectionOptionKind;
|
|
45732
|
+
const selectedOption = requestedKind == null ? input.options.find((option) => option.kind === "upfront") : input.options.find((option) => option.kind === requestedKind);
|
|
45733
|
+
if (selectedOption) {
|
|
45734
|
+
return {
|
|
45735
|
+
kind: "valid",
|
|
45736
|
+
selection: {
|
|
45737
|
+
method: "stripe",
|
|
45738
|
+
collectionOptionKind: selectedOption.kind
|
|
45739
|
+
}
|
|
45740
|
+
};
|
|
45741
|
+
}
|
|
45742
|
+
return {
|
|
45743
|
+
kind: "invalid",
|
|
45744
|
+
fallbackSelection: {
|
|
45745
|
+
method: "stripe",
|
|
45746
|
+
collectionOptionKind: fallbackOption.kind
|
|
45747
|
+
}
|
|
45748
|
+
};
|
|
45749
|
+
}
|
|
45633
45750
|
var DEFAULT_EVENT_DIRECT_PAYMENT_OPTION;
|
|
45634
45751
|
var init_eventPaymentOptions = __esm({
|
|
45635
45752
|
"../blocks/src/system/runtime/nodes/event-registration/eventPaymentOptions.ts"() {
|
|
@@ -45689,6 +45806,9 @@ function formatDirectPaymentOptionDetail(option) {
|
|
|
45689
45806
|
balanceDueBy ? `Balance due by: ${balanceDueBy.value}` : null
|
|
45690
45807
|
].filter((part) => Boolean(part)).join(" \xB7 ");
|
|
45691
45808
|
}
|
|
45809
|
+
function isDirectPaymentOptionSelected(option, selectionState) {
|
|
45810
|
+
return selectionState.kind === "valid" && selectionState.selection.collectionOptionKind === option.kind;
|
|
45811
|
+
}
|
|
45692
45812
|
var PaymentSelectionStep;
|
|
45693
45813
|
var init_PaymentSelectionStep = __esm({
|
|
45694
45814
|
"../blocks/src/system/runtime/nodes/event-registration/PaymentSelectionStep.tsx"() {
|
|
@@ -45717,8 +45837,28 @@ var init_PaymentSelectionStep = __esm({
|
|
|
45717
45837
|
}) => {
|
|
45718
45838
|
const occurrenceId = occurrenceContext?.id ?? event?.registrationOccurrenceId;
|
|
45719
45839
|
const selectedMethod = selectedSelection.method;
|
|
45840
|
+
const totalPrice = eligibility?.price ? eligibility.price * ticketsCount : 0;
|
|
45841
|
+
const canShowDirectPaymentOptions = Boolean(
|
|
45842
|
+
eligibility?.eligible && eligibility.canPayDirectly && eligibility.price
|
|
45843
|
+
);
|
|
45844
|
+
const directPaymentOptions = eligibility && canShowDirectPaymentOptions ? buildEventRegistrationPaymentOptionsViewModel({
|
|
45845
|
+
eventTitle: event?.title ?? "Event",
|
|
45846
|
+
paymentTerms: event?.paymentTerms,
|
|
45847
|
+
totalPriceCents: totalPrice,
|
|
45848
|
+
currency: eligibility.currency,
|
|
45849
|
+
startsAt: occurrenceContext?.startsAt ?? event?.startsAt
|
|
45850
|
+
}).options : [];
|
|
45851
|
+
const directPaymentSelectionState = resolveEventRegistrationDirectPaymentSelection({
|
|
45852
|
+
options: directPaymentOptions,
|
|
45853
|
+
selection: selectedSelection
|
|
45854
|
+
});
|
|
45855
|
+
const directPaymentFallbackSelection = directPaymentSelectionState.kind === "invalid" ? directPaymentSelectionState.fallbackSelection : null;
|
|
45856
|
+
const directPaymentFallbackKind = directPaymentFallbackSelection?.collectionOptionKind;
|
|
45720
45857
|
const canContinue = (() => {
|
|
45721
45858
|
if (!selectedMethod) return false;
|
|
45859
|
+
if (selectedMethod === "stripe") {
|
|
45860
|
+
return directPaymentSelectionState.kind === "valid";
|
|
45861
|
+
}
|
|
45722
45862
|
if (selectedMethod === "pass") return Boolean(selectedSelection.passId);
|
|
45723
45863
|
if (selectedMethod === "membership")
|
|
45724
45864
|
return Boolean(selectedSelection.membershipId);
|
|
@@ -45728,6 +45868,13 @@ var init_PaymentSelectionStep = __esm({
|
|
|
45728
45868
|
return Boolean(selectedSelection.bundleMembershipId);
|
|
45729
45869
|
return true;
|
|
45730
45870
|
})();
|
|
45871
|
+
useEffect14(() => {
|
|
45872
|
+
if (!directPaymentFallbackKind) return;
|
|
45873
|
+
onSelectionChange({
|
|
45874
|
+
method: "stripe",
|
|
45875
|
+
collectionOptionKind: directPaymentFallbackKind
|
|
45876
|
+
});
|
|
45877
|
+
}, [directPaymentFallbackKind, onSelectionChange]);
|
|
45731
45878
|
const getButtonText = useCallback7(() => {
|
|
45732
45879
|
if (selectedMethod === "stripe") return "Continue to Payment";
|
|
45733
45880
|
if (selectedMethod === "pass_bundle" || selectedMethod === "membership_bundle") {
|
|
@@ -45827,25 +45974,20 @@ var init_PaymentSelectionStep = __esm({
|
|
|
45827
45974
|
] }) })
|
|
45828
45975
|
] });
|
|
45829
45976
|
}
|
|
45830
|
-
const totalPrice = eligibility.price ? eligibility.price * ticketsCount : 0;
|
|
45831
|
-
const directPaymentOptions = buildEventRegistrationPaymentOptionsViewModel({
|
|
45832
|
-
eventTitle: event?.title ?? "Event",
|
|
45833
|
-
paymentTerms: event?.paymentTerms,
|
|
45834
|
-
totalPriceCents: totalPrice,
|
|
45835
|
-
currency: eligibility.currency,
|
|
45836
|
-
startsAt: occurrenceContext?.startsAt ?? event?.startsAt
|
|
45837
|
-
}).options;
|
|
45838
45977
|
const isMultiTicket = areEntitlementsDisabledForTicketCount(ticketsCount);
|
|
45839
45978
|
return /* @__PURE__ */ jsxs71("div", { className: "er-stack", children: [
|
|
45840
45979
|
/* @__PURE__ */ jsx98("h3", { className: "er-title", children: "Payment Options" }),
|
|
45841
45980
|
/* @__PURE__ */ jsxs71("div", { className: "er-payment-tiles", children: [
|
|
45842
|
-
|
|
45981
|
+
canShowDirectPaymentOptions && /* @__PURE__ */ jsx98(Fragment19, { children: directPaymentOptions.map((option) => /* @__PURE__ */ jsx98(
|
|
45843
45982
|
PaymentTile,
|
|
45844
45983
|
{
|
|
45845
45984
|
icon: /* @__PURE__ */ jsx98(CreditCard, { size: 24, "aria-hidden": "true" }),
|
|
45846
45985
|
label: option.label,
|
|
45847
45986
|
detail: formatDirectPaymentOptionDetail(option),
|
|
45848
|
-
selected:
|
|
45987
|
+
selected: isDirectPaymentOptionSelected(
|
|
45988
|
+
option,
|
|
45989
|
+
directPaymentSelectionState
|
|
45990
|
+
),
|
|
45849
45991
|
onClick: () => onSelectionChange({
|
|
45850
45992
|
method: "stripe",
|
|
45851
45993
|
collectionOptionKind: option.kind
|
|
@@ -46370,6 +46512,24 @@ import { Fragment as Fragment22, jsx as jsx106, jsxs as jsxs77 } from "react/jsx
|
|
|
46370
46512
|
function isProductMethod(method) {
|
|
46371
46513
|
return method !== null && ["pass", "membership", "pass_bundle", "membership_bundle"].includes(method);
|
|
46372
46514
|
}
|
|
46515
|
+
function getSummaryRow(option, label) {
|
|
46516
|
+
return option.summaryRows.find((row) => row.label === label)?.value ?? null;
|
|
46517
|
+
}
|
|
46518
|
+
function getSelectedDirectPaymentOption(input) {
|
|
46519
|
+
const summaryEvent = input.wizard.selectedEvent ?? input.wizard.preSelectedEvent;
|
|
46520
|
+
if (!summaryEvent || input.wizard.paymentSelection.method !== "stripe") {
|
|
46521
|
+
return null;
|
|
46522
|
+
}
|
|
46523
|
+
const options = buildEventRegistrationPaymentOptionsViewModel({
|
|
46524
|
+
eventTitle: summaryEvent.title,
|
|
46525
|
+
paymentTerms: summaryEvent.paymentTerms,
|
|
46526
|
+
totalPriceCents: input.totalCents,
|
|
46527
|
+
currency: input.currency,
|
|
46528
|
+
startsAt: input.wizard.occurrenceContext?.startsAt ?? summaryEvent.startsAt
|
|
46529
|
+
}).options;
|
|
46530
|
+
const requestedKind = input.wizard.paymentSelection.collectionOptionKind ?? "upfront";
|
|
46531
|
+
return options.find((option) => option.kind === requestedKind) ?? options.find((option) => option.kind === "upfront") ?? options[0] ?? null;
|
|
46532
|
+
}
|
|
46373
46533
|
function EventRegistrationSummaryBar(props2) {
|
|
46374
46534
|
const { wizard } = props2;
|
|
46375
46535
|
const summaryEvent = wizard.selectedEvent ?? wizard.preSelectedEvent;
|
|
@@ -46384,6 +46544,18 @@ function EventRegistrationSummaryBar(props2) {
|
|
|
46384
46544
|
const autoAppliedDiscount = wizard.discountCode.trim().length > 0 ? null : wizard.autoAppliedDiscount;
|
|
46385
46545
|
const autoAppliedDiscountCents = Math.max(0, autoAppliedDiscount?.computedAmountCents ?? 0);
|
|
46386
46546
|
const discountedTotalCents = Math.max(0, subtotalCents - autoAppliedDiscountCents);
|
|
46547
|
+
const selectedDirectPaymentOption = getSelectedDirectPaymentOption({
|
|
46548
|
+
wizard,
|
|
46549
|
+
totalCents: discountedTotalCents,
|
|
46550
|
+
currency: summaryCurrency
|
|
46551
|
+
});
|
|
46552
|
+
const flexibleBalanceSummary = selectedDirectPaymentOption?.kind === "flexible_balance" ? {
|
|
46553
|
+
total: getSummaryRow(selectedDirectPaymentOption, "Total"),
|
|
46554
|
+
dueToday: getSummaryRow(selectedDirectPaymentOption, "Due today"),
|
|
46555
|
+
remainingBalance: getSummaryRow(selectedDirectPaymentOption, "Remaining balance"),
|
|
46556
|
+
balanceDueBy: getSummaryRow(selectedDirectPaymentOption, "Balance due by"),
|
|
46557
|
+
depositPolicy: getSummaryRow(selectedDirectPaymentOption, "Deposit policy")
|
|
46558
|
+
} : null;
|
|
46387
46559
|
if (!summaryTitle) return null;
|
|
46388
46560
|
const productMethod = isProductMethod(wizard.paymentSelection.method);
|
|
46389
46561
|
return /* @__PURE__ */ jsxs77(Fragment22, { children: [
|
|
@@ -46427,6 +46599,22 @@ function EventRegistrationSummaryBar(props2) {
|
|
|
46427
46599
|
summaryPrice > 0 && /* @__PURE__ */ jsx106("div", { className: "er-summary-bar-pricing", children: productMethod ? /* @__PURE__ */ jsxs77(Fragment22, { children: [
|
|
46428
46600
|
/* @__PURE__ */ jsx106("span", { className: "er-summary-bar-price er-summary-bar-price--struck", children: formatPrice(summaryPrice * wizard.ticketsCount, summaryCurrency) }),
|
|
46429
46601
|
/* @__PURE__ */ jsx106("div", { className: "er-summary-bar-included", children: wizard.paymentSelection.method === "pass" || wizard.paymentSelection.method === "pass_bundle" ? "1 pass credit" : "Included in membership" })
|
|
46602
|
+
] }) : flexibleBalanceSummary ? /* @__PURE__ */ jsxs77(Fragment22, { children: [
|
|
46603
|
+
flexibleBalanceSummary.total ? /* @__PURE__ */ jsxs77("div", { className: "er-summary-bar-product-detail", children: [
|
|
46604
|
+
"Total: ",
|
|
46605
|
+
flexibleBalanceSummary.total
|
|
46606
|
+
] }) : null,
|
|
46607
|
+
/* @__PURE__ */ jsx106("div", { className: "er-summary-bar-price", children: flexibleBalanceSummary.dueToday ?? formatPrice(discountedTotalCents, summaryCurrency) }),
|
|
46608
|
+
/* @__PURE__ */ jsx106("div", { className: "er-summary-bar-included", children: "Payable now" }),
|
|
46609
|
+
flexibleBalanceSummary.remainingBalance ? /* @__PURE__ */ jsxs77("div", { className: "er-summary-bar-product-detail", children: [
|
|
46610
|
+
"Remaining balance: ",
|
|
46611
|
+
flexibleBalanceSummary.remainingBalance,
|
|
46612
|
+
flexibleBalanceSummary.balanceDueBy ? ` due by ${flexibleBalanceSummary.balanceDueBy}` : ""
|
|
46613
|
+
] }) : null,
|
|
46614
|
+
flexibleBalanceSummary.depositPolicy ? /* @__PURE__ */ jsxs77("div", { className: "er-summary-bar-product-detail", children: [
|
|
46615
|
+
"Deposit: ",
|
|
46616
|
+
flexibleBalanceSummary.depositPolicy
|
|
46617
|
+
] }) : null
|
|
46430
46618
|
] }) : autoAppliedDiscount && autoAppliedDiscountCents > 0 ? /* @__PURE__ */ jsxs77(Fragment22, { children: [
|
|
46431
46619
|
/* @__PURE__ */ jsx106("span", { className: "er-summary-bar-price er-summary-bar-price--struck", children: formatPrice(subtotalCents, summaryCurrency) }),
|
|
46432
46620
|
/* @__PURE__ */ jsx106("div", { className: "er-summary-bar-price", children: formatPrice(discountedTotalCents, summaryCurrency) }),
|
|
@@ -46445,6 +46633,7 @@ var init_EventRegistrationSummaryBar = __esm({
|
|
|
46445
46633
|
"use client";
|
|
46446
46634
|
init_src();
|
|
46447
46635
|
init_utils5();
|
|
46636
|
+
init_eventPaymentOptions();
|
|
46448
46637
|
}
|
|
46449
46638
|
});
|
|
46450
46639
|
|
|
@@ -70521,7 +70710,7 @@ function inferLegacyOfferingsPreviewGroupOrder(overrides) {
|
|
|
70521
70710
|
return keys.length >= 2 ? keys : [];
|
|
70522
70711
|
}
|
|
70523
70712
|
function normalizeOfferingsPreviewContentForWrite(value) {
|
|
70524
|
-
if (!
|
|
70713
|
+
if (!isRecord8(value)) return null;
|
|
70525
70714
|
const groupOrderValue = value.groupOrder;
|
|
70526
70715
|
if (Array.isArray(groupOrderValue)) {
|
|
70527
70716
|
const normalized = normalizeOfferingsPreviewGroupOrder(groupOrderValue);
|
|
@@ -70534,7 +70723,7 @@ function normalizeOfferingsPreviewContentForWrite(value) {
|
|
|
70534
70723
|
return { ...value, groupOrder: [] };
|
|
70535
70724
|
}
|
|
70536
70725
|
const legacyOrder = inferLegacyOfferingsPreviewGroupOrder(
|
|
70537
|
-
Array.isArray(value.groupOverrides) ? value.groupOverrides.filter(
|
|
70726
|
+
Array.isArray(value.groupOverrides) ? value.groupOverrides.filter(isRecord8) : []
|
|
70538
70727
|
);
|
|
70539
70728
|
return legacyOrder.length > 0 ? { ...value, groupOrder: legacyOrder } : value;
|
|
70540
70729
|
}
|
|
@@ -70588,7 +70777,7 @@ function uniqueOfferingsPreviewSourceKeys(values) {
|
|
|
70588
70777
|
}
|
|
70589
70778
|
return keys;
|
|
70590
70779
|
}
|
|
70591
|
-
function
|
|
70780
|
+
function isRecord8(value) {
|
|
70592
70781
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
70593
70782
|
}
|
|
70594
70783
|
function mergeOrderedKeysWithDefaults(orderedKeys, defaultKeys) {
|
|
@@ -71050,7 +71239,7 @@ function isOfferingsPreviewItemLimit(value) {
|
|
|
71050
71239
|
return value === "1" || value === "2" || value === "3" || value === "4" || value === "5" || value === "6" || value === null;
|
|
71051
71240
|
}
|
|
71052
71241
|
function normalizeOfferingsPreviewGroupOverride(value) {
|
|
71053
|
-
if (!
|
|
71242
|
+
if (!isRecord9(value)) return [];
|
|
71054
71243
|
const override = {};
|
|
71055
71244
|
if (isOfferingsPreviewSourceKey(value.sourceKey) || value.sourceKey === null) {
|
|
71056
71245
|
override.sourceKey = value.sourceKey;
|
|
@@ -71082,12 +71271,12 @@ function isButtonVariant(value) {
|
|
|
71082
71271
|
return value === "primary" || value === "secondary" || value === "outline" || value === "link" || value === null;
|
|
71083
71272
|
}
|
|
71084
71273
|
function normalizeCardStylesContent(value) {
|
|
71085
|
-
return
|
|
71274
|
+
return isRecord9(value) || value === null ? value : void 0;
|
|
71086
71275
|
}
|
|
71087
71276
|
function normalizeSectionStylesContent(value) {
|
|
71088
|
-
return
|
|
71277
|
+
return isRecord9(value) || value === null ? value : void 0;
|
|
71089
71278
|
}
|
|
71090
|
-
function
|
|
71279
|
+
function isRecord9(value) {
|
|
71091
71280
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
71092
71281
|
}
|
|
71093
71282
|
|
|
@@ -75222,7 +75411,7 @@ import React4 from "react";
|
|
|
75222
75411
|
init_src();
|
|
75223
75412
|
var LINKED_CONTENT_ENTRY_META_KEY = "__rbLinkedContentEntry";
|
|
75224
75413
|
function coerceLinkedContentEntriesPayload(payload) {
|
|
75225
|
-
if (!
|
|
75414
|
+
if (!isRecord10(payload)) return payload;
|
|
75226
75415
|
const response = payload;
|
|
75227
75416
|
if (!Array.isArray(response.entries)) return payload;
|
|
75228
75417
|
const contentType = parsePublicContentTypeMeta(response.contentType);
|
|
@@ -75230,16 +75419,16 @@ function coerceLinkedContentEntriesPayload(payload) {
|
|
|
75230
75419
|
return response.entries.map((entry) => enrichLinkedContentEntry(entry, contentType));
|
|
75231
75420
|
}
|
|
75232
75421
|
function getLinkedContentEntryMeta(value) {
|
|
75233
|
-
if (!
|
|
75422
|
+
if (!isRecord10(value)) return null;
|
|
75234
75423
|
const candidate = value[LINKED_CONTENT_ENTRY_META_KEY];
|
|
75235
75424
|
return isLinkedContentEntryMeta(candidate) ? candidate : null;
|
|
75236
75425
|
}
|
|
75237
75426
|
function buildLinkedContentEditTarget(input) {
|
|
75238
75427
|
const { entry, sourceBlockId, sourceBlockKind, itemIndex } = input;
|
|
75239
|
-
if (!
|
|
75428
|
+
if (!isRecord10(entry)) return null;
|
|
75240
75429
|
const meta = getLinkedContentEntryMeta(entry);
|
|
75241
75430
|
if (!meta || meta.support.kind !== "supported") return null;
|
|
75242
|
-
const content =
|
|
75431
|
+
const content = isRecord10(entry.content) ? entry.content : {};
|
|
75243
75432
|
return {
|
|
75244
75433
|
kind: "linked-content-entry",
|
|
75245
75434
|
entryId: meta.entryId,
|
|
@@ -75289,12 +75478,12 @@ function resolveLinkedEntryInlineFieldEligibility(input) {
|
|
|
75289
75478
|
};
|
|
75290
75479
|
}
|
|
75291
75480
|
function enrichLinkedContentEntry(entry, contentType) {
|
|
75292
|
-
if (!
|
|
75481
|
+
if (!isRecord10(entry)) return entry;
|
|
75293
75482
|
const entryId = typeof entry.id === "string" ? entry.id : null;
|
|
75294
75483
|
if (!entryId) return entry;
|
|
75295
75484
|
const title = typeof entry.title === "string" && entry.title.trim().length > 0 ? entry.title : entryId;
|
|
75296
75485
|
const optimisticHash = typeof entry.optimisticHash === "string" && entry.optimisticHash.length > 0 ? entry.optimisticHash : null;
|
|
75297
|
-
const content =
|
|
75486
|
+
const content = isRecord10(entry.content) ? entry.content : {};
|
|
75298
75487
|
const meta = {
|
|
75299
75488
|
kind: "linked-content-entry",
|
|
75300
75489
|
entryId,
|
|
@@ -75390,7 +75579,7 @@ function capitalize(value) {
|
|
|
75390
75579
|
return value.charAt(0).toUpperCase() + value.slice(1).toLowerCase();
|
|
75391
75580
|
}
|
|
75392
75581
|
function parsePublicContentTypeMeta(value) {
|
|
75393
|
-
if (!
|
|
75582
|
+
if (!isRecord10(value)) return null;
|
|
75394
75583
|
if (typeof value.key !== "string" || value.key.trim().length === 0) return null;
|
|
75395
75584
|
return {
|
|
75396
75585
|
key: value.key,
|
|
@@ -75400,7 +75589,7 @@ function parsePublicContentTypeMeta(value) {
|
|
|
75400
75589
|
};
|
|
75401
75590
|
}
|
|
75402
75591
|
function parsePublicContentTypeLinkedEntryEditing(value) {
|
|
75403
|
-
if (!
|
|
75592
|
+
if (!isRecord10(value) || typeof value.kind !== "string") return null;
|
|
75404
75593
|
switch (value.kind) {
|
|
75405
75594
|
case "generic":
|
|
75406
75595
|
return { kind: "generic" };
|
|
@@ -75414,7 +75603,7 @@ function parsePublicContentTypeLinkedEntryEditing(value) {
|
|
|
75414
75603
|
}
|
|
75415
75604
|
}
|
|
75416
75605
|
function parsePublicContentTypeFieldMeta(value) {
|
|
75417
|
-
if (!
|
|
75606
|
+
if (!isRecord10(value)) return [];
|
|
75418
75607
|
if (typeof value.id !== "string" || typeof value.type !== "string") return [];
|
|
75419
75608
|
return [{
|
|
75420
75609
|
id: value.id,
|
|
@@ -75429,14 +75618,14 @@ function parseStringArray(value) {
|
|
|
75429
75618
|
return value.filter((item) => typeof item === "string");
|
|
75430
75619
|
}
|
|
75431
75620
|
function isLinkedContentEntryMeta(value) {
|
|
75432
|
-
if (!
|
|
75621
|
+
if (!isRecord10(value)) return false;
|
|
75433
75622
|
if (value.kind !== "linked-content-entry") return false;
|
|
75434
75623
|
if (typeof value.entryId !== "string") return false;
|
|
75435
75624
|
if (typeof value.contentTypeKey !== "string") return false;
|
|
75436
75625
|
if (typeof value.contentTypeLabel !== "string") return false;
|
|
75437
75626
|
if (typeof value.title !== "string") return false;
|
|
75438
75627
|
if (!(value.optimisticHash === null || typeof value.optimisticHash === "string")) return false;
|
|
75439
|
-
if (!
|
|
75628
|
+
if (!isRecord10(value.contentType)) return false;
|
|
75440
75629
|
if (!isLinkedEntryFieldSourceArray(value.fieldSources)) return false;
|
|
75441
75630
|
return isLinkedContentEditSupport(value.support);
|
|
75442
75631
|
}
|
|
@@ -75444,7 +75633,7 @@ function isLinkedEntryFieldSourceArray(value) {
|
|
|
75444
75633
|
return Array.isArray(value) && value.every(isLinkedEntryFieldSource);
|
|
75445
75634
|
}
|
|
75446
75635
|
function isLinkedEntryFieldSource(value) {
|
|
75447
|
-
if (!
|
|
75636
|
+
if (!isRecord10(value)) return false;
|
|
75448
75637
|
if (typeof value.displayPath !== "string") return false;
|
|
75449
75638
|
switch (value.kind) {
|
|
75450
75639
|
case "content-field":
|
|
@@ -75470,7 +75659,7 @@ function isLinkedEntryInlineFieldReadOnlyReason(value) {
|
|
|
75470
75659
|
}
|
|
75471
75660
|
}
|
|
75472
75661
|
function isLinkedContentEditSupport(value) {
|
|
75473
|
-
if (!
|
|
75662
|
+
if (!isRecord10(value) || typeof value.kind !== "string") return false;
|
|
75474
75663
|
switch (value.kind) {
|
|
75475
75664
|
case "supported":
|
|
75476
75665
|
return true;
|
|
@@ -75482,7 +75671,7 @@ function isLinkedContentEditSupport(value) {
|
|
|
75482
75671
|
return false;
|
|
75483
75672
|
}
|
|
75484
75673
|
}
|
|
75485
|
-
function
|
|
75674
|
+
function isRecord10(value) {
|
|
75486
75675
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
75487
75676
|
}
|
|
75488
75677
|
|
|
@@ -78131,7 +78320,7 @@ function renderCalendarSsr(display) {
|
|
|
78131
78320
|
dayEvents.slice(0, MAX_EVENTS_PER_DAY).map((event) => /* @__PURE__ */ jsxs35(
|
|
78132
78321
|
"a",
|
|
78133
78322
|
{
|
|
78134
|
-
|
|
78323
|
+
...resolveEventLinkProps(event),
|
|
78135
78324
|
className: "event-calendar-event",
|
|
78136
78325
|
title: `${event.title} at ${formatTime(event.startsAt, { timeZone: getEventTimeZone(event) })}`,
|
|
78137
78326
|
children: [
|
|
@@ -78259,7 +78448,7 @@ function renderTimetableSsr(display) {
|
|
|
78259
78448
|
day.events.length === 0 ? /* @__PURE__ */ jsx49("p", { className: "event-timetable-day-empty", children: "No classes" }) : day.events.map((cell) => /* @__PURE__ */ jsxs35(
|
|
78260
78449
|
"a",
|
|
78261
78450
|
{
|
|
78262
|
-
|
|
78451
|
+
...resolveEventLinkProps(cell.event),
|
|
78263
78452
|
className: "event-timetable-event",
|
|
78264
78453
|
title: `${cell.event.title}, ${cell.timeLabel}`,
|
|
78265
78454
|
style: {
|
|
@@ -79047,14 +79236,14 @@ function isDecoratedHeadingBlockKind(blockKind) {
|
|
|
79047
79236
|
return blockKind === "block.intro" || blockKind === "block.feature-cards" || blockKind === "block.testimonials" || blockKind === "block.faq";
|
|
79048
79237
|
}
|
|
79049
79238
|
function readVariant(blockContent) {
|
|
79050
|
-
if (!
|
|
79239
|
+
if (!isRecord12(blockContent)) return void 0;
|
|
79051
79240
|
const variant = blockContent.variant;
|
|
79052
79241
|
return typeof variant === "string" ? variant : void 0;
|
|
79053
79242
|
}
|
|
79054
79243
|
function isFaqDecoratedVariant(variant) {
|
|
79055
79244
|
return variant === "default" || variant === "question-columns";
|
|
79056
79245
|
}
|
|
79057
|
-
function
|
|
79246
|
+
function isRecord12(value) {
|
|
79058
79247
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
79059
79248
|
}
|
|
79060
79249
|
function buildHeadingDecorationWrapperClassName(className) {
|
|
@@ -97178,7 +97367,7 @@ function preset(id, verticalId, canonicalBehaviour, label, pluralLabel, descript
|
|
|
97178
97367
|
}
|
|
97179
97368
|
|
|
97180
97369
|
// ../api/src/utils/isRecord.ts
|
|
97181
|
-
function
|
|
97370
|
+
function isRecord13(value) {
|
|
97182
97371
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
97183
97372
|
}
|
|
97184
97373
|
|
|
@@ -97485,7 +97674,7 @@ function sanitizeMarks(marks) {
|
|
|
97485
97674
|
if (mark.type === "bold" || mark.type === "strong" || mark.type === "italic" || mark.type === "em") {
|
|
97486
97675
|
return [{ type: mark.type }];
|
|
97487
97676
|
}
|
|
97488
|
-
if (mark.type === "link" &&
|
|
97677
|
+
if (mark.type === "link" && isRecord13(mark.attrs) && typeof mark.attrs.href === "string") {
|
|
97489
97678
|
const attrs = { href: mark.attrs.href };
|
|
97490
97679
|
if (typeof mark.attrs.target === "string" && mark.attrs.target.trim().length > 0) {
|
|
97491
97680
|
attrs.target = mark.attrs.target;
|
|
@@ -97500,10 +97689,10 @@ function sanitizeMarks(marks) {
|
|
|
97500
97689
|
return sanitized.length > 0 ? sanitized : void 0;
|
|
97501
97690
|
}
|
|
97502
97691
|
function unwrapRichTextValue(value) {
|
|
97503
|
-
if (
|
|
97692
|
+
if (isRecord13(value) && isRecord13(value.doc)) {
|
|
97504
97693
|
return unwrapRichTextValue(value.doc);
|
|
97505
97694
|
}
|
|
97506
|
-
if (
|
|
97695
|
+
if (isRecord13(value) && value.type === "doc") {
|
|
97507
97696
|
return {
|
|
97508
97697
|
type: "doc",
|
|
97509
97698
|
content: Array.isArray(value.content) ? value.content.filter(isTipTapNodeLike).map(coerceTipTapNode) : []
|
|
@@ -97512,7 +97701,7 @@ function unwrapRichTextValue(value) {
|
|
|
97512
97701
|
return EMPTY_SITE_BANNER_BODY;
|
|
97513
97702
|
}
|
|
97514
97703
|
function isTipTapNodeLike(value) {
|
|
97515
|
-
return
|
|
97704
|
+
return isRecord13(value) && typeof value.type === "string";
|
|
97516
97705
|
}
|
|
97517
97706
|
function coerceTipTapNode(value) {
|
|
97518
97707
|
return {
|
|
@@ -97520,9 +97709,9 @@ function coerceTipTapNode(value) {
|
|
|
97520
97709
|
...Array.isArray(value.content) ? { content: value.content.filter(isTipTapNodeLike).map(coerceTipTapNode) } : {},
|
|
97521
97710
|
...typeof value.text === "string" ? { text: value.text } : {},
|
|
97522
97711
|
...Array.isArray(value.marks) ? {
|
|
97523
|
-
marks: value.marks.filter((mark) =>
|
|
97712
|
+
marks: value.marks.filter((mark) => isRecord13(mark) && typeof mark.type === "string").map((mark) => ({
|
|
97524
97713
|
type: mark.type,
|
|
97525
|
-
...
|
|
97714
|
+
...isRecord13(mark.attrs) ? { attrs: mark.attrs } : {}
|
|
97526
97715
|
}))
|
|
97527
97716
|
} : {}
|
|
97528
97717
|
};
|
|
@@ -97712,7 +97901,7 @@ var ENTRY_REF_KEYS = [
|
|
|
97712
97901
|
"entryId",
|
|
97713
97902
|
"slug"
|
|
97714
97903
|
];
|
|
97715
|
-
function
|
|
97904
|
+
function isRecord14(value) {
|
|
97716
97905
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
97717
97906
|
}
|
|
97718
97907
|
function extractManualEntryRef(item) {
|
|
@@ -97720,7 +97909,7 @@ function extractManualEntryRef(item) {
|
|
|
97720
97909
|
const trimmed = item.trim();
|
|
97721
97910
|
return trimmed.length > 0 ? trimmed : null;
|
|
97722
97911
|
}
|
|
97723
|
-
if (!
|
|
97912
|
+
if (!isRecord14(item)) return null;
|
|
97724
97913
|
for (const key of ENTRY_REF_KEYS) {
|
|
97725
97914
|
const raw = item[key];
|
|
97726
97915
|
if (typeof raw === "string" && raw.trim().length > 0) {
|
|
@@ -98906,7 +99095,7 @@ var SimpleCache = class {
|
|
|
98906
99095
|
};
|
|
98907
99096
|
|
|
98908
99097
|
// src/version.ts
|
|
98909
|
-
var SDK_VERSION = "0.90.
|
|
99098
|
+
var SDK_VERSION = "0.90.1";
|
|
98910
99099
|
|
|
98911
99100
|
// src/client/error.ts
|
|
98912
99101
|
var RiverbankApiError = class _RiverbankApiError extends Error {
|