@riverbankcms/sdk 0.89.1 → 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/README.md +27 -4
- package/dist/{PreviewEditorSidebar-JDR64FEC.mjs → PreviewEditorSidebar-FNFRVSIM.mjs} +3 -3
- package/dist/{PreviewEditorUI-67TMJMAF.mjs → PreviewEditorUI-3WXJFQXG.mjs} +3 -3
- package/dist/SdkPreviewModeRuntime-2UCIMKUB.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/bookingConfig.d.ts +3 -0
- 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/event-listing-destination.d.ts +59 -0
- package/dist/_dts/api/src/index.d.ts +10 -5
- 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 +18 -6
- 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/settings/permissions.d.ts +273 -0
- package/dist/_dts/api/src/types.d.ts +4 -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/schemas.d.ts +60 -2
- package/dist/_dts/blocks/src/system/blocks/events/shared/types.d.ts +16 -5
- package/dist/_dts/blocks/src/system/blocks/hero.d.ts +0 -2
- package/dist/_dts/blocks/src/system/blocks/media-text.d.ts +9 -9
- 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/blocks/team-members.d.ts +1 -1
- 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 +7 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/eventPaymentOptions.d.ts +48 -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/destination.d.ts +8 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/eventProductEligibility.d.ts +24 -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/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/event-pricing.d.ts +12 -2
- 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/public-api/contracts.d.ts +11 -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/islands/types.d.ts +11 -1
- 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-F645A5UV.mjs → chunk-BOQXMCSP.mjs} +129 -101
- package/dist/{chunk-7YUAXONX.mjs → chunk-CR2VX432.mjs} +1563 -877
- package/dist/{chunk-HKJQERFR.mjs → chunk-FA6LVZ7C.mjs} +91 -55
- package/dist/{chunk-TGBJWKMP.mjs → chunk-H6TT5ZXI.mjs} +9 -1
- package/dist/{chunk-ZQRBLCW5.mjs → chunk-SYYJZPKU.mjs} +2 -2
- package/dist/{chunk-7N46MZHI.mjs → chunk-UG7I7S7W.mjs} +1 -1
- package/dist/cli/index.mjs +1057 -632
- 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-4K7VGZ3I.mjs} +2 -2
- package/dist/client/{bookingForm-PKD6EFIE.mjs → bookingForm-3QXA3CIS.mjs} +26 -271
- package/dist/client/bookings.mjs +1586 -825
- package/dist/client/{carousel-3TKQSNJC.mjs → carousel-BEJKNGQ7.mjs} +3 -3
- package/dist/client/{cart-6XHSZK23.mjs → cart-44BBM6XG.mjs} +7 -8
- package/dist/client/{checkout-FVSPM6FI.mjs → checkout-THMHEYKF.mjs} +7 -8
- package/dist/client/{chunk-25W2EQUN.mjs → chunk-3H5CLFKT.mjs} +8 -0
- package/dist/client/{chunk-ZJZZA5EP.mjs → chunk-4COPESPO.mjs} +13 -16
- package/dist/client/chunk-5AJIMWKS.mjs +436 -0
- package/dist/client/{chunk-UQFY4AHX.mjs → chunk-B4H6QMPY.mjs} +157 -49
- package/dist/client/{chunk-VGLXACVK.mjs → chunk-DQIRKNZE.mjs} +1 -1
- package/dist/client/{chunk-7DH35FGA.mjs → chunk-EJBHK74Y.mjs} +1 -1
- package/dist/client/{chunk-SDIYSQAY.mjs → chunk-HIHOQGIP.mjs} +2 -3
- package/dist/client/{chunk-CQKKFEQD.mjs → chunk-JV7ZNAOU.mjs} +378 -111
- package/dist/client/{chunk-FHU6PFPM.mjs → chunk-KNTLBQ3N.mjs} +1 -1
- package/dist/client/{chunk-RSQWWUAD.mjs → chunk-PEDNDLPB.mjs} +4 -4
- package/dist/client/{chunk-EY42X22F.mjs → chunk-SLY6UDAS.mjs} +157 -5
- package/dist/client/{chunk-STJ2NCQM.mjs → chunk-WHZQDPBZ.mjs} +19 -1
- package/dist/client/{chunk-ZT5XE7FK.mjs → chunk-ZIAF2DA4.mjs} +1 -1
- package/dist/client/client.mjs +3552 -2898
- package/dist/client/{courseRegistration-ATZSYDHM.mjs → courseRegistration-URX7RCCK.mjs} +20 -58
- package/dist/client/{eventCalendar-6T2UGKKP.mjs → eventCalendar-GTENOQCE.mjs} +10 -11
- package/dist/client/{eventCombined-Q4VANXVF.mjs → eventCombined-EZVB72MF.mjs} +10 -11
- package/dist/client/{eventDetails-DW37E7VW.mjs → eventDetails-CH4BJR5Z.mjs} +10 -11
- package/dist/client/{eventListing-XURTSAUW.mjs → eventListing-4BVOI5HS.mjs} +10 -11
- package/dist/client/{eventRegistration-MRKEVAXW.mjs → eventRegistration-37LPIKIE.mjs} +10 -11
- package/dist/client/{form-WZZFFGMU.mjs → form-FX3Y54YK.mjs} +7 -7
- package/dist/client/{headerSection-EQYVQBLM.mjs → headerSection-UOZZGVYL.mjs} +3 -3
- package/dist/client/hooks.mjs +1169 -1063
- package/dist/client/{locationMap-MFF5VAZR.mjs → locationMap-VSIPKV35.mjs} +3 -3
- package/dist/client/{newsletterForm-JQ77UYIE.mjs → newsletterForm-6FRJKNAF.mjs} +5 -5
- package/dist/client/{productDetail-25LMT3IZ.mjs → productDetail-6AHMLXCO.mjs} +7 -8
- package/dist/client/{productList-5ABEMKUG.mjs → productList-M2CYIZVH.mjs} +7 -8
- package/dist/client/rendering/client.mjs +2912 -2316
- package/dist/client/rendering/islands.mjs +19 -19
- package/dist/client/rendering.mjs +2874 -2230
- package/dist/client/{shop-OMMQZ6YO.mjs → shop-AUOT6GEX.mjs} +7 -8
- 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-6GPJNLU6.mjs} +6 -6
- package/dist/server/components.mjs +1856 -1509
- package/dist/server/config-validation.mjs +1394 -1288
- package/dist/server/config.mjs +1394 -1288
- package/dist/server/data.mjs +1169 -1063
- package/dist/server/index.mjs +135 -100
- package/dist/server/navigation.mjs +20 -30
- package/dist/server/next.mjs +1936 -1576
- package/dist/server/page-converter.mjs +1081 -967
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +1868 -1521
- package/dist/server/rendering.mjs +1878 -1531
- package/dist/server/routing.mjs +1248 -1089
- package/dist/server/server.mjs +1312 -1171
- package/dist/server/theme-bridge.mjs +8 -5
- package/package.json +3 -3
- package/dist/SdkPreviewModeRuntime-ZBEMRV7N.mjs +0 -8
- package/dist/client/chunk-LQFDYWPJ.mjs +0 -184
- package/dist/client/chunk-ZFHRN6W2.mjs +0 -66
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { ApiRequestError } from './chunk-
|
|
2
|
+
import { ApiRequestError } from './chunk-BOQXMCSP.mjs';
|
|
3
3
|
import { __commonJS, __export, __toESM } from './chunk-R7POPVJR.mjs';
|
|
4
4
|
import * as React61 from 'react';
|
|
5
5
|
import React61__default, { createContext, forwardRef, useContext, createElement, useRef, useMemo, useEffect, useState, useCallback, useImperativeHandle, useLayoutEffect, memo, createRef, Component as Component$1, useDebugValue, useId as useId$1, useSyncExternalStore, isValidElement, cloneElement, useReducer, startTransition } from 'react';
|
|
@@ -209,6 +209,8 @@ function publicEventPricingType(pricing) {
|
|
|
209
209
|
case "ticket_types":
|
|
210
210
|
case "course":
|
|
211
211
|
return isFreePublicEventPriceDisplay(pricing.display) ? "free" : "paid";
|
|
212
|
+
case "external":
|
|
213
|
+
return "external";
|
|
212
214
|
}
|
|
213
215
|
}
|
|
214
216
|
function publicEventPricingCurrency(pricing) {
|
|
@@ -220,6 +222,8 @@ function publicEventPricingCurrency(pricing) {
|
|
|
220
222
|
return pricing.currency;
|
|
221
223
|
case "course":
|
|
222
224
|
return pricing.display.display.currency;
|
|
225
|
+
case "external":
|
|
226
|
+
return null;
|
|
223
227
|
}
|
|
224
228
|
}
|
|
225
229
|
function publicEventScalarPrice(pricing) {
|
|
@@ -234,6 +238,7 @@ function publicEventPricingMode(pricing) {
|
|
|
234
238
|
return "ticket_types";
|
|
235
239
|
case "drop_in":
|
|
236
240
|
case "course":
|
|
241
|
+
case "external":
|
|
237
242
|
return void 0;
|
|
238
243
|
}
|
|
239
244
|
}
|
|
@@ -251,6 +256,7 @@ function isFreePublicEventPriceDisplay(display) {
|
|
|
251
256
|
case "range":
|
|
252
257
|
case "mixed":
|
|
253
258
|
case "unavailable":
|
|
259
|
+
case "external":
|
|
254
260
|
return false;
|
|
255
261
|
}
|
|
256
262
|
}
|
|
@@ -281,6 +287,8 @@ function formatBookingPriceDisplay(display, options = {}) {
|
|
|
281
287
|
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)}`;
|
|
282
288
|
case "unavailable":
|
|
283
289
|
return "Pricing unavailable";
|
|
290
|
+
case "external":
|
|
291
|
+
return display.label;
|
|
284
292
|
case "course":
|
|
285
293
|
return formatCoursePriceDisplayLabel(display.display, options);
|
|
286
294
|
default:
|
|
@@ -31343,12 +31351,17 @@ var visibleWhenPredicateSchema = z.object({
|
|
|
31343
31351
|
minItems: z.number().int().nonnegative().optional(),
|
|
31344
31352
|
maxItems: z.number().int().nonnegative().optional()
|
|
31345
31353
|
});
|
|
31346
|
-
var visibleWhenSchema = z.
|
|
31347
|
-
|
|
31348
|
-
|
|
31349
|
-
|
|
31350
|
-
|
|
31351
|
-
|
|
31354
|
+
var visibleWhenSchema = z.lazy(
|
|
31355
|
+
() => z.union([
|
|
31356
|
+
visibleWhenPredicateSchema,
|
|
31357
|
+
z.object({
|
|
31358
|
+
allOf: z.array(visibleWhenSchema).min(1)
|
|
31359
|
+
}),
|
|
31360
|
+
z.object({
|
|
31361
|
+
anyOf: z.array(visibleWhenSchema).min(1)
|
|
31362
|
+
})
|
|
31363
|
+
])
|
|
31364
|
+
);
|
|
31352
31365
|
var uiSchema = z.object({
|
|
31353
31366
|
widget: z.string().optional(),
|
|
31354
31367
|
// Container/widget presets (used by Group/Repeater widgets themselves, not for widget selection)
|
|
@@ -51971,9 +51984,6 @@ var heroCopyFragment = defineFragment({
|
|
|
51971
51984
|
maxLength: 600
|
|
51972
51985
|
}
|
|
51973
51986
|
],
|
|
51974
|
-
// Layout order is [eyebrow, headline, subheadline]. The hero block's
|
|
51975
|
-
// `splitEditorial` variant reads these nodes by index; keep the order stable
|
|
51976
|
-
// (it fails fast at import if the count changes).
|
|
51977
51987
|
layout: [
|
|
51978
51988
|
text(
|
|
51979
51989
|
{
|
|
@@ -54302,32 +54312,6 @@ var splitReverseLayout = splitLayoutWith([
|
|
|
54302
54312
|
splitContentColumn,
|
|
54303
54313
|
splitImageColumn
|
|
54304
54314
|
]);
|
|
54305
|
-
var heroEyebrowNode = heroCopyFragment.layout[0];
|
|
54306
|
-
var heroHeadlineNode = heroCopyFragment.layout[1];
|
|
54307
|
-
var heroSubheadlineNode = heroCopyFragment.layout[2];
|
|
54308
|
-
var heroCtaRowNode = heroCtaRowFragment.layout[0];
|
|
54309
|
-
if (!heroEyebrowNode || !heroHeadlineNode || !heroSubheadlineNode || !heroCtaRowNode) {
|
|
54310
|
-
throw new Error("Hero copy/CTA fragments are missing their expected layout nodes.");
|
|
54311
|
-
}
|
|
54312
|
-
var heroEditorialBottomRow = inline(
|
|
54313
|
-
{
|
|
54314
|
-
gap: "lg",
|
|
54315
|
-
align: "end",
|
|
54316
|
-
justify: "start",
|
|
54317
|
-
wrap: true,
|
|
54318
|
-
className: "rb-w-full"
|
|
54319
|
-
},
|
|
54320
|
-
[heroSubheadlineNode, heroCtaRowNode]
|
|
54321
|
-
);
|
|
54322
|
-
var splitEditorialContentColumn = heroContentWrapper(
|
|
54323
|
-
[heroEyebrowNode, heroHeadlineNode, heroEditorialBottomRow],
|
|
54324
|
-
"md",
|
|
54325
|
-
"rb-w-full rb-text-left"
|
|
54326
|
-
);
|
|
54327
|
-
var splitEditorialLayout = splitLayoutWith([
|
|
54328
|
-
splitEditorialContentColumn,
|
|
54329
|
-
splitImageColumn
|
|
54330
|
-
]);
|
|
54331
54315
|
var heroConfig = {
|
|
54332
54316
|
id: "block.hero",
|
|
54333
54317
|
title: "Hero",
|
|
@@ -54351,7 +54335,8 @@ var heroConfig = {
|
|
|
54351
54335
|
id: "imageShape",
|
|
54352
54336
|
label: "Image shape",
|
|
54353
54337
|
defaultValue: "default",
|
|
54354
|
-
uiIntent: "display"
|
|
54338
|
+
uiIntent: "display",
|
|
54339
|
+
visibleWhen: { field: "variant", oneOf: ["split", "splitReverse"] }
|
|
54355
54340
|
})
|
|
54356
54341
|
],
|
|
54357
54342
|
layout: classicLayout,
|
|
@@ -54359,8 +54344,7 @@ var heroConfig = {
|
|
|
54359
54344
|
classic: classicLayout,
|
|
54360
54345
|
micro: microLayout,
|
|
54361
54346
|
split: splitLayout,
|
|
54362
|
-
splitReverse: splitReverseLayout
|
|
54363
|
-
splitEditorial: splitEditorialLayout
|
|
54347
|
+
splitReverse: splitReverseLayout
|
|
54364
54348
|
},
|
|
54365
54349
|
defaultVariant: "classic",
|
|
54366
54350
|
description: "Hero section with headline, subtitle, and repeatable CTAs.",
|
|
@@ -56138,8 +56122,10 @@ function resolveGeneratedHeroLayoutStyles(content) {
|
|
|
56138
56122
|
return isPlainObject2(raw) ? raw : null;
|
|
56139
56123
|
}
|
|
56140
56124
|
function readHeroLayoutString(content, generatedKey, fallbackKey = generatedKey) {
|
|
56125
|
+
const explicitValue = readString(content, fallbackKey);
|
|
56126
|
+
if (explicitValue !== void 0) return explicitValue;
|
|
56141
56127
|
const generated = resolveGeneratedHeroLayoutStyles(content);
|
|
56142
|
-
return generated && typeof generated[generatedKey] === "string" ? generated[generatedKey] :
|
|
56128
|
+
return generated && typeof generated[generatedKey] === "string" ? generated[generatedKey] : void 0;
|
|
56143
56129
|
}
|
|
56144
56130
|
function resolveHeroVariant(content) {
|
|
56145
56131
|
const variant = readString(content, "variant");
|
|
@@ -56152,7 +56138,7 @@ function resolveHeroContentAlignment(content) {
|
|
|
56152
56138
|
const raw = readHeroLayoutString(content, "contentAlignment");
|
|
56153
56139
|
if (raw === "left" || raw === "center" || raw === "right") return raw;
|
|
56154
56140
|
const variant = resolveHeroVariant(content);
|
|
56155
|
-
if (variant === "split" || variant === "splitReverse"
|
|
56141
|
+
if (variant === "split" || variant === "splitReverse") return "left";
|
|
56156
56142
|
return "center";
|
|
56157
56143
|
}
|
|
56158
56144
|
function resolveHeroVerticalAlignment(content) {
|
|
@@ -56162,7 +56148,7 @@ function resolveHeroVerticalAlignment(content) {
|
|
|
56162
56148
|
const minHeight = sectionStyles?.minHeight;
|
|
56163
56149
|
if (minHeight === "banner" || minHeight === "hero" || minHeight === "immersive") return "center";
|
|
56164
56150
|
const variant = resolveHeroVariant(content);
|
|
56165
|
-
if (variant === "split" || variant === "splitReverse"
|
|
56151
|
+
if (variant === "split" || variant === "splitReverse") return "center";
|
|
56166
56152
|
return "top";
|
|
56167
56153
|
}
|
|
56168
56154
|
function resolveHeroContentMaxWidth(content) {
|
|
@@ -60176,6 +60162,18 @@ var publicCoursesArraySchema = z.array(publicCourseSchema);
|
|
|
60176
60162
|
var eventPresetSchema = z.enum(["event", "class", "workshop", "retreat", "performance"]);
|
|
60177
60163
|
var eventScheduleScopeSchema = z.enum(["recurring", "oneOff"]);
|
|
60178
60164
|
var eventDestinationModeSchema = z.enum(["cms-managed", "system-managed"]);
|
|
60165
|
+
var publicEventDestinationSchema = z.discriminatedUnion("kind", [
|
|
60166
|
+
z.object({
|
|
60167
|
+
kind: z.literal("native"),
|
|
60168
|
+
mode: eventDestinationModeSchema,
|
|
60169
|
+
path: z.string()
|
|
60170
|
+
}),
|
|
60171
|
+
z.object({
|
|
60172
|
+
kind: z.literal("external"),
|
|
60173
|
+
url: z.string(),
|
|
60174
|
+
label: z.string()
|
|
60175
|
+
})
|
|
60176
|
+
]);
|
|
60179
60177
|
var eventVenueSchema = z.object({
|
|
60180
60178
|
id: z.string(),
|
|
60181
60179
|
name: z.string(),
|
|
@@ -60190,7 +60188,7 @@ var eventCategorySchema = z.object({
|
|
|
60190
60188
|
name: z.string(),
|
|
60191
60189
|
color: z.string().nullable()
|
|
60192
60190
|
});
|
|
60193
|
-
z.enum(["free", "paid"]);
|
|
60191
|
+
z.enum(["free", "paid", "external"]);
|
|
60194
60192
|
var accessRestrictionSchema = z.enum(["none", "category"]);
|
|
60195
60193
|
z.enum(["single", "ticket_types"]);
|
|
60196
60194
|
var publicCoursePriceDisplaySchema = z.discriminatedUnion("kind", [
|
|
@@ -60211,6 +60209,7 @@ z.discriminatedUnion("kind", [
|
|
|
60211
60209
|
currency: z.string()
|
|
60212
60210
|
}),
|
|
60213
60211
|
z.object({ kind: z.literal("unavailable"), currency: z.string() }),
|
|
60212
|
+
z.object({ kind: z.literal("external"), label: z.string() }),
|
|
60214
60213
|
z.object({ kind: z.literal("course"), display: publicCoursePriceDisplaySchema })
|
|
60215
60214
|
]);
|
|
60216
60215
|
var publicEventTicketTypePriceDisplaySchema = z.union([
|
|
@@ -60289,6 +60288,10 @@ var publicEventPricingSchema = z.discriminatedUnion("kind", [
|
|
|
60289
60288
|
z.object({
|
|
60290
60289
|
kind: z.literal("course"),
|
|
60291
60290
|
display: z.object({ kind: z.literal("course"), display: publicCoursePriceDisplaySchema })
|
|
60291
|
+
}),
|
|
60292
|
+
z.object({
|
|
60293
|
+
kind: z.literal("external"),
|
|
60294
|
+
display: z.object({ kind: z.literal("external"), label: z.string() })
|
|
60292
60295
|
})
|
|
60293
60296
|
]);
|
|
60294
60297
|
var publicTeamMemberSummarySchema = z.object({
|
|
@@ -60317,7 +60320,8 @@ var publicEventSchema = z.object({
|
|
|
60317
60320
|
image: mediaSchema2.nullable().optional()
|
|
60318
60321
|
}).optional(),
|
|
60319
60322
|
slug: z.string(),
|
|
60320
|
-
path: z.string(),
|
|
60323
|
+
path: z.string().nullable(),
|
|
60324
|
+
destination: publicEventDestinationSchema,
|
|
60321
60325
|
requiresRegistration: z.boolean(),
|
|
60322
60326
|
deliveryMode: z.enum(["in_person", "online", "hybrid"]),
|
|
60323
60327
|
attendanceModes: z.array(publicEventAttendanceModeAvailabilitySchema),
|
|
@@ -60549,6 +60553,35 @@ function normalizeEventStaffMemberId(value) {
|
|
|
60549
60553
|
const trimmed = value.trim();
|
|
60550
60554
|
return trimmed ? trimmed : null;
|
|
60551
60555
|
}
|
|
60556
|
+
var publicPassProductSchema = z.object({
|
|
60557
|
+
id: z.string(),
|
|
60558
|
+
productUseCase: z.enum(["event_pass", "appointment_package"]).default("event_pass"),
|
|
60559
|
+
name: z.string(),
|
|
60560
|
+
description: z.string().nullable(),
|
|
60561
|
+
price: z.number(),
|
|
60562
|
+
currency: z.string(),
|
|
60563
|
+
creditsTotal: z.number(),
|
|
60564
|
+
pricePerCredit: z.number(),
|
|
60565
|
+
validDays: z.number().nullable(),
|
|
60566
|
+
eligibleCategoryIds: z.array(z.string()),
|
|
60567
|
+
eligibleCategoryNames: z.array(z.string())
|
|
60568
|
+
});
|
|
60569
|
+
var publicPassProductCollectionSchema = z.object({
|
|
60570
|
+
passes: z.array(publicPassProductSchema)
|
|
60571
|
+
});
|
|
60572
|
+
var publicMembershipProductSchema = z.object({
|
|
60573
|
+
id: z.string(),
|
|
60574
|
+
name: z.string(),
|
|
60575
|
+
description: z.string().nullable(),
|
|
60576
|
+
price: z.number(),
|
|
60577
|
+
currency: z.string(),
|
|
60578
|
+
billingInterval: z.enum(["month", "year"]),
|
|
60579
|
+
eligibleCategoryIds: z.array(z.string()),
|
|
60580
|
+
eligibleCategoryNames: z.array(z.string())
|
|
60581
|
+
});
|
|
60582
|
+
var publicMembershipProductCollectionSchema = z.object({
|
|
60583
|
+
memberships: z.array(publicMembershipProductSchema)
|
|
60584
|
+
});
|
|
60552
60585
|
var occurrenceContextSchema = z.object({
|
|
60553
60586
|
id: z.string(),
|
|
60554
60587
|
seriesId: z.string(),
|
|
@@ -60561,7 +60594,8 @@ var occurrenceContextSchema = z.object({
|
|
|
60561
60594
|
|
|
60562
60595
|
// ../blocks/src/system/constants/events.ts
|
|
60563
60596
|
var EVENT_CONTENT_TYPE_SLUGS = ["event", "events"];
|
|
60564
|
-
var eventCalendarDisplayModeValues = ["combined", "
|
|
60597
|
+
var eventCalendarDisplayModeValues = ["combined", "calendar", "list", "timetable"];
|
|
60598
|
+
var eventCalendarDefaultViewValues = ["month", "week"];
|
|
60565
60599
|
var eventCalendarListLayoutValues = ["stack", "grid", "compact"];
|
|
60566
60600
|
var eventCalendarListLayoutOptions = [
|
|
60567
60601
|
{ id: "stack", label: "Stack" },
|
|
@@ -60572,6 +60606,9 @@ var eventCalendarListLayoutCompatibleDisplayModeValues = ["combined", "list"];
|
|
|
60572
60606
|
function isEventCalendarDisplayMode(value) {
|
|
60573
60607
|
return typeof value === "string" && eventCalendarDisplayModeValues.includes(value);
|
|
60574
60608
|
}
|
|
60609
|
+
function isEventCalendarDefaultView(value) {
|
|
60610
|
+
return typeof value === "string" && eventCalendarDefaultViewValues.includes(value);
|
|
60611
|
+
}
|
|
60575
60612
|
function isEventCalendarListLayout(value) {
|
|
60576
60613
|
return typeof value === "string" && eventCalendarListLayoutValues.includes(value);
|
|
60577
60614
|
}
|
|
@@ -60580,12 +60617,41 @@ function isEventContentType(slug) {
|
|
|
60580
60617
|
return EVENT_CONTENT_TYPE_SLUGS.includes(slug);
|
|
60581
60618
|
}
|
|
60582
60619
|
|
|
60620
|
+
// ../blocks/src/system/runtime/nodes/events/shared/destination.ts
|
|
60621
|
+
function isRecord6(value) {
|
|
60622
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
60623
|
+
}
|
|
60624
|
+
function isRuntimeEventDestination(value) {
|
|
60625
|
+
if (!isRecord6(value) || typeof value.kind !== "string") return false;
|
|
60626
|
+
if (value.kind === "native") {
|
|
60627
|
+
return (value.mode === "cms-managed" || value.mode === "system-managed") && typeof value.path === "string";
|
|
60628
|
+
}
|
|
60629
|
+
return value.kind === "external" && typeof value.url === "string" && typeof value.label === "string";
|
|
60630
|
+
}
|
|
60631
|
+
function resolveRuntimeEventDestination(event) {
|
|
60632
|
+
if (isRuntimeEventDestination(event.destination)) {
|
|
60633
|
+
return event.destination;
|
|
60634
|
+
}
|
|
60635
|
+
return {
|
|
60636
|
+
kind: "native",
|
|
60637
|
+
mode: event.eventDestinationMode === "system-managed" ? "system-managed" : "cms-managed",
|
|
60638
|
+
path: typeof event.path === "string" ? event.path : ""
|
|
60639
|
+
};
|
|
60640
|
+
}
|
|
60641
|
+
|
|
60583
60642
|
// ../blocks/src/system/runtime/nodes/events/shared/pricing.ts
|
|
60584
60643
|
var DEFAULT_EVENT_CURRENCY = "USD";
|
|
60585
60644
|
function resolveRuntimeEventPricing(event) {
|
|
60586
60645
|
if (isPublicEventPricing(event.pricing)) {
|
|
60587
60646
|
return event.pricing;
|
|
60588
60647
|
}
|
|
60648
|
+
const destination = resolveRuntimeEventDestination(event);
|
|
60649
|
+
if (destination.kind === "external") {
|
|
60650
|
+
return {
|
|
60651
|
+
kind: "external",
|
|
60652
|
+
display: { kind: "external", label: "External registration" }
|
|
60653
|
+
};
|
|
60654
|
+
}
|
|
60589
60655
|
const legacy = event;
|
|
60590
60656
|
const currency = readCurrency(legacy.currency);
|
|
60591
60657
|
if (event.requiresRegistration === false) {
|
|
@@ -60622,22 +60688,22 @@ function resolveRuntimeEventPricing(event) {
|
|
|
60622
60688
|
function readCurrency(value) {
|
|
60623
60689
|
return typeof value === "string" && value.trim().length > 0 ? value : DEFAULT_EVENT_CURRENCY;
|
|
60624
60690
|
}
|
|
60625
|
-
function
|
|
60691
|
+
function isRecord7(value) {
|
|
60626
60692
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
60627
60693
|
}
|
|
60628
60694
|
function isPublicEventPricing(value) {
|
|
60629
|
-
if (!
|
|
60630
|
-
return value.kind === "drop_in" || value.kind === "free_registration" || value.kind === "single_paid" || value.kind === "ticket_types" || value.kind === "course";
|
|
60695
|
+
if (!isRecord7(value) || typeof value.kind !== "string") return false;
|
|
60696
|
+
return value.kind === "drop_in" || value.kind === "free_registration" || value.kind === "single_paid" || value.kind === "ticket_types" || value.kind === "course" || value.kind === "external";
|
|
60631
60697
|
}
|
|
60632
60698
|
function isPublicEventTicketType(value) {
|
|
60633
|
-
return
|
|
60699
|
+
return isRecord7(value) && typeof value.id === "string";
|
|
60634
60700
|
}
|
|
60635
60701
|
function readTicketTypePriceDisplay(value, currency) {
|
|
60636
60702
|
const display = readLegacyPriceDisplay(value, currency);
|
|
60637
|
-
return display.kind === "course" ? { kind: "unavailable", currency } : display;
|
|
60703
|
+
return display.kind === "course" || display.kind === "external" ? { kind: "unavailable", currency } : display;
|
|
60638
60704
|
}
|
|
60639
60705
|
function readLegacyPriceDisplay(value, currency) {
|
|
60640
|
-
if (!
|
|
60706
|
+
if (!isRecord7(value) || typeof value.kind !== "string") {
|
|
60641
60707
|
return { kind: "unavailable", currency };
|
|
60642
60708
|
}
|
|
60643
60709
|
const displayCurrency = readCurrency(value.currency);
|
|
@@ -60676,7 +60742,7 @@ function readLegacyPriceDisplay(value, currency) {
|
|
|
60676
60742
|
case "unavailable":
|
|
60677
60743
|
return { kind: "unavailable", currency: displayCurrency };
|
|
60678
60744
|
case "course":
|
|
60679
|
-
return
|
|
60745
|
+
return isRecord7(value.display) ? {
|
|
60680
60746
|
kind: "course",
|
|
60681
60747
|
display: readCoursePriceDisplay(value.display, displayCurrency)
|
|
60682
60748
|
} : {
|
|
@@ -60715,6 +60781,7 @@ var registrationButtonVariantSchema = z.enum(["primary", "secondary", "outline"]
|
|
|
60715
60781
|
var eventButtonVariantSchema = z.enum(["primary", "secondary", "outline", "link"]);
|
|
60716
60782
|
var eventLayoutSchema = z.enum(eventCalendarListLayoutValues);
|
|
60717
60783
|
var eventCalendarDisplayModeSchema = z.enum(eventCalendarDisplayModeValues);
|
|
60784
|
+
var eventCalendarDefaultViewSchema = z.enum(eventCalendarDefaultViewValues);
|
|
60718
60785
|
var columnOptionSchema = z.enum(["2", "3", "4"]);
|
|
60719
60786
|
var weekStartSchema = z.enum(["sunday", "monday"]);
|
|
60720
60787
|
var filterAutoShowSchema = z.enum(["auto", "always", "never"]);
|
|
@@ -60749,7 +60816,7 @@ function findEventByOccurrenceId(events2, occurrenceId) {
|
|
|
60749
60816
|
function findPreSelectedEvent(input) {
|
|
60750
60817
|
const occurrenceContext = input.occurrenceContext;
|
|
60751
60818
|
if (!occurrenceContext) {
|
|
60752
|
-
return null;
|
|
60819
|
+
return input.scopedEvents.length === 1 ? input.scopedEvents[0] ?? null : null;
|
|
60753
60820
|
}
|
|
60754
60821
|
const contextDate = getBookingLocalDateKey(toScheduledBookingDateTime({
|
|
60755
60822
|
startsAt: occurrenceContext.startsAt,
|
|
@@ -60782,7 +60849,7 @@ function resolveEventRequiresPayment(input) {
|
|
|
60782
60849
|
if (!input.event) {
|
|
60783
60850
|
return false;
|
|
60784
60851
|
}
|
|
60785
|
-
return publicEventPricingType(resolveRuntimeEventPricing(input.event))
|
|
60852
|
+
return publicEventPricingType(resolveRuntimeEventPricing(input.event)) === "paid";
|
|
60786
60853
|
}
|
|
60787
60854
|
function resolveDiscountContext(input) {
|
|
60788
60855
|
const selection = input.paymentSelection.method ? input.paymentSelection : null;
|
|
@@ -60853,7 +60920,9 @@ var eventRegistrationSourceSchema = z.object({
|
|
|
60853
60920
|
overlayEnabled: z.boolean().optional(),
|
|
60854
60921
|
spamProtectionEnabled: z.boolean().optional(),
|
|
60855
60922
|
stage: previewStageSchema.optional(),
|
|
60856
|
-
supportEmail: z.string().optional()
|
|
60923
|
+
supportEmail: z.string().optional(),
|
|
60924
|
+
sitePasses: publicPassProductCollectionSchema.nullable().optional(),
|
|
60925
|
+
siteMemberships: publicMembershipProductCollectionSchema.nullable().optional()
|
|
60857
60926
|
});
|
|
60858
60927
|
var eventRegistrationDisplaySchema = z.object({
|
|
60859
60928
|
kind: z.literal("event-registration"),
|
|
@@ -60876,7 +60945,9 @@ var eventRegistrationHydrationSchema = z.object({
|
|
|
60876
60945
|
buttonVariant: registrationButtonVariantSchema.optional(),
|
|
60877
60946
|
overlayEnabled: z.boolean().optional(),
|
|
60878
60947
|
spamProtectionEnabled: z.boolean().optional(),
|
|
60879
|
-
supportEmail: z.string().optional()
|
|
60948
|
+
supportEmail: z.string().optional(),
|
|
60949
|
+
sitePasses: publicPassProductCollectionSchema.nullable().optional(),
|
|
60950
|
+
siteMemberships: publicMembershipProductCollectionSchema.nullable().optional()
|
|
60880
60951
|
});
|
|
60881
60952
|
var eventRegistrationRenderSchema = z.object({
|
|
60882
60953
|
display: eventRegistrationDisplaySchema,
|
|
@@ -60985,20 +61056,23 @@ var eventRegistrationBlockRuntime = defineClientOwnedBlockRuntime({
|
|
|
60985
61056
|
buttonVariant: source.buttonVariant,
|
|
60986
61057
|
overlayEnabled: source.overlayEnabled,
|
|
60987
61058
|
spamProtectionEnabled: source.spamProtectionEnabled,
|
|
60988
|
-
supportEmail: source.supportEmail
|
|
61059
|
+
supportEmail: source.supportEmail,
|
|
61060
|
+
sitePasses: source.sitePasses ?? null,
|
|
61061
|
+
siteMemberships: source.siteMemberships ?? null
|
|
60989
61062
|
}
|
|
60990
61063
|
})
|
|
60991
61064
|
});
|
|
60992
61065
|
function normalizeEventRegistrationEventInput(value) {
|
|
60993
|
-
if (!
|
|
61066
|
+
if (!isRecord8(value)) {
|
|
60994
61067
|
return value;
|
|
60995
61068
|
}
|
|
60996
61069
|
return {
|
|
60997
61070
|
...value,
|
|
61071
|
+
destination: resolveRuntimeEventDestination(value),
|
|
60998
61072
|
pricing: resolveRuntimeEventPricing(value)
|
|
60999
61073
|
};
|
|
61000
61074
|
}
|
|
61001
|
-
function
|
|
61075
|
+
function isRecord8(value) {
|
|
61002
61076
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
61003
61077
|
}
|
|
61004
61078
|
function buildEventRegistrationInteractiveIslandProps(props2) {
|
|
@@ -61168,6 +61242,8 @@ var eventRegistrationManifest = createBlockManifest({
|
|
|
61168
61242
|
},
|
|
61169
61243
|
// Event data from loader
|
|
61170
61244
|
events: { $bind: { from: "data.events" } },
|
|
61245
|
+
sitePasses: { $bind: { from: "data.sitePasses" } },
|
|
61246
|
+
siteMemberships: { $bind: { from: "data.siteMemberships" } },
|
|
61171
61247
|
// Stage for preview mode (allows registering for draft events)
|
|
61172
61248
|
stage: {
|
|
61173
61249
|
$bind: { from: "$root.previewStage", fallback: "published" }
|
|
@@ -61186,7 +61262,9 @@ var eventRegistrationBlockDefinition = {
|
|
|
61186
61262
|
manifest: eventRegistrationManifest,
|
|
61187
61263
|
runtime: eventRegistrationBlockRuntime,
|
|
61188
61264
|
dataSchemas: {
|
|
61189
|
-
events:
|
|
61265
|
+
events: publicEventsArraySchema.optional(),
|
|
61266
|
+
sitePasses: publicPassProductCollectionSchema.optional(),
|
|
61267
|
+
siteMemberships: publicMembershipProductCollectionSchema.optional(),
|
|
61190
61268
|
occurrenceContext: occurrenceContextSchema.optional()
|
|
61191
61269
|
},
|
|
61192
61270
|
dataLoaders: {
|
|
@@ -61205,6 +61283,20 @@ var eventRegistrationBlockDefinition = {
|
|
|
61205
61283
|
entryId: { $bind: { from: "$root.contentEntry._entryId", fallback: "" } }
|
|
61206
61284
|
},
|
|
61207
61285
|
mode: "server"
|
|
61286
|
+
},
|
|
61287
|
+
sitePasses: {
|
|
61288
|
+
endpoint: "listPublicPasses",
|
|
61289
|
+
params: {
|
|
61290
|
+
siteId: { $bind: { from: "$root.siteId" } }
|
|
61291
|
+
},
|
|
61292
|
+
mode: "server"
|
|
61293
|
+
},
|
|
61294
|
+
siteMemberships: {
|
|
61295
|
+
endpoint: "listPublicMemberships",
|
|
61296
|
+
params: {
|
|
61297
|
+
siteId: { $bind: { from: "$root.siteId" } }
|
|
61298
|
+
},
|
|
61299
|
+
mode: "server"
|
|
61208
61300
|
}
|
|
61209
61301
|
}
|
|
61210
61302
|
};
|
|
@@ -61639,31 +61731,6 @@ var courseRegistrationBlockDefinition = {
|
|
|
61639
61731
|
}
|
|
61640
61732
|
}
|
|
61641
61733
|
};
|
|
61642
|
-
var publicPassProductSchema = z.object({
|
|
61643
|
-
id: z.string(),
|
|
61644
|
-
productUseCase: z.enum(["event_pass", "appointment_package"]).default("event_pass"),
|
|
61645
|
-
name: z.string(),
|
|
61646
|
-
description: z.string().nullable(),
|
|
61647
|
-
price: z.number(),
|
|
61648
|
-
currency: z.string(),
|
|
61649
|
-
creditsTotal: z.number(),
|
|
61650
|
-
pricePerCredit: z.number(),
|
|
61651
|
-
validDays: z.number().nullable(),
|
|
61652
|
-
eligibleCategoryIds: z.array(z.string()),
|
|
61653
|
-
eligibleCategoryNames: z.array(z.string())
|
|
61654
|
-
});
|
|
61655
|
-
var publicMembershipProductSchema = z.object({
|
|
61656
|
-
id: z.string(),
|
|
61657
|
-
name: z.string(),
|
|
61658
|
-
description: z.string().nullable(),
|
|
61659
|
-
price: z.number(),
|
|
61660
|
-
currency: z.string(),
|
|
61661
|
-
billingInterval: z.enum(["month", "year"]),
|
|
61662
|
-
eligibleCategoryIds: z.array(z.string()),
|
|
61663
|
-
eligibleCategoryNames: z.array(z.string())
|
|
61664
|
-
});
|
|
61665
|
-
|
|
61666
|
-
// ../blocks/src/system/blocks/event-details.ts
|
|
61667
61734
|
var eventDetailsManifest = createBlockManifest({
|
|
61668
61735
|
id: "block.event-details",
|
|
61669
61736
|
version: "1.0.0",
|
|
@@ -61827,8 +61894,8 @@ var eventDetailsBlockDefinition = {
|
|
|
61827
61894
|
dataSchemas: {
|
|
61828
61895
|
eventDetailsData: z.object({
|
|
61829
61896
|
events: publicEventsArraySchema,
|
|
61830
|
-
sitePasses:
|
|
61831
|
-
siteMemberships:
|
|
61897
|
+
sitePasses: publicPassProductCollectionSchema,
|
|
61898
|
+
siteMemberships: publicMembershipProductCollectionSchema,
|
|
61832
61899
|
autoApplyDiscount: eventAutoApplyDiscountPreviewSchema.nullable().optional().default(null)
|
|
61833
61900
|
}).optional(),
|
|
61834
61901
|
occurrenceContext: occurrenceContextSchema2.optional()
|
|
@@ -62795,16 +62862,28 @@ function formatEventPrice(event) {
|
|
|
62795
62862
|
function formatEventPriceDisplay(pricing) {
|
|
62796
62863
|
return formatEventPricing(pricing, { decimals: "auto" });
|
|
62797
62864
|
}
|
|
62865
|
+
function resolveEventHref(event) {
|
|
62866
|
+
const destination = resolveRuntimeEventDestination(event);
|
|
62867
|
+
return destination.kind === "external" ? destination.url : destination.path;
|
|
62868
|
+
}
|
|
62869
|
+
function resolveEventLinkProps(event) {
|
|
62870
|
+
const href = resolveEventHref(event);
|
|
62871
|
+
const destination = resolveRuntimeEventDestination(event);
|
|
62872
|
+
return destination.kind === "external" ? { href, target: "_blank", rel: "noopener noreferrer" } : { href };
|
|
62873
|
+
}
|
|
62798
62874
|
function resolveEventCta(event, buttonText) {
|
|
62799
62875
|
const { isFull: isSoldOut } = getEventAvailability(event);
|
|
62800
|
-
const
|
|
62876
|
+
const destination = resolveRuntimeEventDestination(event);
|
|
62877
|
+
const isExternal = destination.kind === "external";
|
|
62878
|
+
const defaultButtonText = isExternal ? destination.label : event.kind === "course_session" ? "Book course" : "Book";
|
|
62801
62879
|
const effectiveButtonText = buttonText ?? defaultButtonText;
|
|
62802
|
-
|
|
62803
|
-
|
|
62880
|
+
const href = resolveEventHref(event);
|
|
62881
|
+
if (!isExternal && isSoldOut) {
|
|
62882
|
+
return { label: "Sold out", href, external: false, hidden: true };
|
|
62804
62883
|
}
|
|
62805
62884
|
const enrollmentOpen = event.kind === "course_session" ? event.course?.enrollmentOpen !== false : true;
|
|
62806
62885
|
const label = !enrollmentOpen ? "Registration closed" : effectiveButtonText;
|
|
62807
|
-
return { label, href:
|
|
62886
|
+
return { label, href, external: isExternal, hidden: false };
|
|
62808
62887
|
}
|
|
62809
62888
|
|
|
62810
62889
|
// ../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
|
|
@@ -64223,6 +64302,8 @@ var EventCard = ({
|
|
|
64223
64302
|
"a",
|
|
64224
64303
|
{
|
|
64225
64304
|
href: cta.href,
|
|
64305
|
+
target: cta.external ? "_blank" : void 0,
|
|
64306
|
+
rel: cta.external ? "noopener noreferrer" : void 0,
|
|
64226
64307
|
className: `${buttonClass} event-card-cta`,
|
|
64227
64308
|
children: cta.label
|
|
64228
64309
|
}
|
|
@@ -64309,10 +64390,19 @@ var EventCompactRow = ({
|
|
|
64309
64390
|
formattedTime,
|
|
64310
64391
|
/* @__PURE__ */ jsx("span", { className: "event-compact-row-action-price", children: price })
|
|
64311
64392
|
] }),
|
|
64312
|
-
cta.hidden ? /* @__PURE__ */ jsx("span", { className: "event-compact-row-status", children: cta.label }) : /* @__PURE__ */ jsxs(
|
|
64313
|
-
|
|
64314
|
-
|
|
64315
|
-
|
|
64393
|
+
cta.hidden ? /* @__PURE__ */ jsx("span", { className: "event-compact-row-status", children: cta.label }) : /* @__PURE__ */ jsxs(
|
|
64394
|
+
"a",
|
|
64395
|
+
{
|
|
64396
|
+
href: cta.href,
|
|
64397
|
+
target: cta.external ? "_blank" : void 0,
|
|
64398
|
+
rel: cta.external ? "noopener noreferrer" : void 0,
|
|
64399
|
+
className: `${buttonClass} event-compact-row-cta`,
|
|
64400
|
+
children: [
|
|
64401
|
+
/* @__PURE__ */ jsx("span", { children: cta.label }),
|
|
64402
|
+
/* @__PURE__ */ jsx(ArrowRightIcon, { "aria-hidden": "true" })
|
|
64403
|
+
]
|
|
64404
|
+
}
|
|
64405
|
+
)
|
|
64316
64406
|
] })
|
|
64317
64407
|
] })
|
|
64318
64408
|
] });
|
|
@@ -64886,6 +64976,7 @@ var eventCalendarSourceSchema = z.object(
|
|
|
64886
64976
|
loadMoreText: z.string().optional(),
|
|
64887
64977
|
startOfWeek: weekStartSchema.optional(),
|
|
64888
64978
|
calendarTabViews: calendarTabViewsSchema.optional(),
|
|
64979
|
+
defaultCalendarView: eventCalendarDefaultViewSchema.optional(),
|
|
64889
64980
|
showFilters: z.boolean().nullable().optional(),
|
|
64890
64981
|
showCategoryFilter: filterAutoShowSchema.optional(),
|
|
64891
64982
|
showVenueFilter: z.boolean().nullable().optional(),
|
|
@@ -64917,6 +65008,7 @@ var eventCalendarDisplaySchema = z.object({
|
|
|
64917
65008
|
paginationAction: eventListPaginationActionSchema,
|
|
64918
65009
|
startOfWeek: weekStartSchema,
|
|
64919
65010
|
calendarTabViews: calendarTabViewsSchema,
|
|
65011
|
+
defaultCalendarView: eventCalendarDefaultViewSchema,
|
|
64920
65012
|
showFilters: z.boolean(),
|
|
64921
65013
|
showCategoryFilter: filterAutoShowSchema,
|
|
64922
65014
|
showVenueFilter: z.boolean(),
|
|
@@ -64976,6 +65068,7 @@ function buildEventCalendarDisplay(source) {
|
|
|
64976
65068
|
}),
|
|
64977
65069
|
startOfWeek: source.startOfWeek ?? "monday",
|
|
64978
65070
|
calendarTabViews: source.calendarTabViews ?? "both",
|
|
65071
|
+
defaultCalendarView: source.defaultCalendarView ?? "month",
|
|
64979
65072
|
showFilters: source.showFilters ?? true,
|
|
64980
65073
|
showCategoryFilter: source.showCategoryFilter ?? "auto",
|
|
64981
65074
|
showVenueFilter: source.showVenueFilter ?? false,
|
|
@@ -65089,6 +65182,9 @@ function normalizeEventCalendarContent(content) {
|
|
|
65089
65182
|
...variant ? { variant } : {},
|
|
65090
65183
|
displayMode: normalizeEventCalendarDisplayMode(record.displayMode),
|
|
65091
65184
|
listLayout: normalizeEventCalendarListLayout(record.listLayout),
|
|
65185
|
+
defaultCalendarView: normalizeEventCalendarDefaultView(
|
|
65186
|
+
record.defaultCalendarView
|
|
65187
|
+
),
|
|
65092
65188
|
kind,
|
|
65093
65189
|
eventSurface: normalizeEventSurfaceScope(record.eventSurface),
|
|
65094
65190
|
filterEventPresets: normalizeEventSurfacePresets(record.filterEventPresets),
|
|
@@ -65106,6 +65202,9 @@ function normalizeEventCalendarDisplayMode(value) {
|
|
|
65106
65202
|
function normalizeEventCalendarListLayout(value) {
|
|
65107
65203
|
return isEventCalendarListLayout(value) ? value : void 0;
|
|
65108
65204
|
}
|
|
65205
|
+
function normalizeEventCalendarDefaultView(value) {
|
|
65206
|
+
return isEventCalendarDefaultView(value) ? value : void 0;
|
|
65207
|
+
}
|
|
65109
65208
|
var eventCalendarLayout = [
|
|
65110
65209
|
styledSection({
|
|
65111
65210
|
children: sectionContainer(
|
|
@@ -65165,6 +65264,9 @@ var eventCalendarLayout = [
|
|
|
65165
65264
|
calendarTabViews: {
|
|
65166
65265
|
$bind: { from: "content.calendarTabViews", fallback: "both" }
|
|
65167
65266
|
},
|
|
65267
|
+
defaultCalendarView: {
|
|
65268
|
+
$bind: { from: "content.defaultCalendarView", fallback: "month" }
|
|
65269
|
+
},
|
|
65168
65270
|
// Filtering options
|
|
65169
65271
|
showFilters: {
|
|
65170
65272
|
$bind: { from: "content.showFilters", fallback: true }
|
|
@@ -65231,8 +65333,7 @@ var eventCalendarAdditionalFields = [
|
|
|
65231
65333
|
defaultValue: "combined",
|
|
65232
65334
|
options: [
|
|
65233
65335
|
{ value: "combined", label: "Combined (List + Calendar tabs)" },
|
|
65234
|
-
{ value: "
|
|
65235
|
-
{ value: "week", label: "Week agenda" },
|
|
65336
|
+
{ value: "calendar", label: "Calendar" },
|
|
65236
65337
|
{ value: "timetable", label: "Timetable" },
|
|
65237
65338
|
{ value: "list", label: "List" }
|
|
65238
65339
|
],
|
|
@@ -65271,7 +65372,12 @@ var eventCalendarAdditionalFields = [
|
|
|
65271
65372
|
],
|
|
65272
65373
|
ui: {
|
|
65273
65374
|
intent: "display",
|
|
65274
|
-
visibleWhen: {
|
|
65375
|
+
visibleWhen: {
|
|
65376
|
+
allOf: [
|
|
65377
|
+
{ field: "variant", oneOf: ["combined", "list"] },
|
|
65378
|
+
{ field: "listLayout", equals: "grid" }
|
|
65379
|
+
]
|
|
65380
|
+
}
|
|
65275
65381
|
}
|
|
65276
65382
|
},
|
|
65277
65383
|
{
|
|
@@ -65319,7 +65425,12 @@ var eventCalendarAdditionalFields = [
|
|
|
65319
65425
|
required: false,
|
|
65320
65426
|
ui: {
|
|
65321
65427
|
intent: "display",
|
|
65322
|
-
visibleWhen: {
|
|
65428
|
+
visibleWhen: {
|
|
65429
|
+
allOf: [
|
|
65430
|
+
{ field: "variant", oneOf: ["combined", "list"] },
|
|
65431
|
+
{ field: "paginationMode", equals: "seeAllLink" }
|
|
65432
|
+
]
|
|
65433
|
+
}
|
|
65323
65434
|
}
|
|
65324
65435
|
},
|
|
65325
65436
|
{
|
|
@@ -65352,7 +65463,7 @@ var eventCalendarAdditionalFields = [
|
|
|
65352
65463
|
intent: "display",
|
|
65353
65464
|
visibleWhen: {
|
|
65354
65465
|
field: "variant",
|
|
65355
|
-
oneOf: ["combined", "
|
|
65466
|
+
oneOf: ["combined", "calendar", "timetable"]
|
|
65356
65467
|
}
|
|
65357
65468
|
}
|
|
65358
65469
|
},
|
|
@@ -65375,6 +65486,33 @@ var eventCalendarAdditionalFields = [
|
|
|
65375
65486
|
visibleWhen: { field: "variant", equals: "combined" }
|
|
65376
65487
|
}
|
|
65377
65488
|
},
|
|
65489
|
+
{
|
|
65490
|
+
id: "defaultCalendarView",
|
|
65491
|
+
type: "select",
|
|
65492
|
+
label: "Calendar view",
|
|
65493
|
+
description: "Choose the standalone calendar view, or the first view in combined mode",
|
|
65494
|
+
required: false,
|
|
65495
|
+
multiple: false,
|
|
65496
|
+
defaultValue: "month",
|
|
65497
|
+
options: [
|
|
65498
|
+
{ value: "month", label: "Month" },
|
|
65499
|
+
{ value: "week", label: "Week" }
|
|
65500
|
+
],
|
|
65501
|
+
ui: {
|
|
65502
|
+
intent: "display",
|
|
65503
|
+
visibleWhen: {
|
|
65504
|
+
anyOf: [
|
|
65505
|
+
{ field: "variant", equals: "calendar" },
|
|
65506
|
+
{
|
|
65507
|
+
allOf: [
|
|
65508
|
+
{ field: "variant", equals: "combined" },
|
|
65509
|
+
{ field: "calendarTabViews", equals: "both" }
|
|
65510
|
+
]
|
|
65511
|
+
}
|
|
65512
|
+
]
|
|
65513
|
+
}
|
|
65514
|
+
}
|
|
65515
|
+
},
|
|
65378
65516
|
// Filtering options
|
|
65379
65517
|
{
|
|
65380
65518
|
id: "kind",
|
|
@@ -65402,7 +65540,7 @@ var eventCalendarAdditionalFields = [
|
|
|
65402
65540
|
intent: "display",
|
|
65403
65541
|
visibleWhen: {
|
|
65404
65542
|
field: "variant",
|
|
65405
|
-
oneOf: ["combined", "list", "timetable"]
|
|
65543
|
+
oneOf: ["combined", "calendar", "list", "timetable"]
|
|
65406
65544
|
}
|
|
65407
65545
|
}
|
|
65408
65546
|
},
|
|
@@ -65422,8 +65560,10 @@ var eventCalendarAdditionalFields = [
|
|
|
65422
65560
|
ui: {
|
|
65423
65561
|
intent: "display",
|
|
65424
65562
|
visibleWhen: {
|
|
65425
|
-
|
|
65426
|
-
|
|
65563
|
+
allOf: [
|
|
65564
|
+
{ field: "variant", oneOf: ["combined", "calendar", "list", "timetable"] },
|
|
65565
|
+
{ field: "showFilters", equals: true }
|
|
65566
|
+
]
|
|
65427
65567
|
}
|
|
65428
65568
|
}
|
|
65429
65569
|
},
|
|
@@ -65437,8 +65577,10 @@ var eventCalendarAdditionalFields = [
|
|
|
65437
65577
|
ui: {
|
|
65438
65578
|
intent: "display",
|
|
65439
65579
|
visibleWhen: {
|
|
65440
|
-
|
|
65441
|
-
|
|
65580
|
+
allOf: [
|
|
65581
|
+
{ field: "variant", oneOf: ["combined", "calendar", "list", "timetable"] },
|
|
65582
|
+
{ field: "showFilters", equals: true }
|
|
65583
|
+
]
|
|
65442
65584
|
}
|
|
65443
65585
|
}
|
|
65444
65586
|
},
|
|
@@ -65452,8 +65594,10 @@ var eventCalendarAdditionalFields = [
|
|
|
65452
65594
|
ui: {
|
|
65453
65595
|
intent: "display",
|
|
65454
65596
|
visibleWhen: {
|
|
65455
|
-
|
|
65456
|
-
|
|
65597
|
+
allOf: [
|
|
65598
|
+
{ field: "variant", oneOf: ["combined", "calendar", "list", "timetable"] },
|
|
65599
|
+
{ field: "showFilters", equals: true }
|
|
65600
|
+
]
|
|
65457
65601
|
}
|
|
65458
65602
|
}
|
|
65459
65603
|
},
|
|
@@ -65467,8 +65611,15 @@ var eventCalendarAdditionalFields = [
|
|
|
65467
65611
|
ui: {
|
|
65468
65612
|
intent: "display",
|
|
65469
65613
|
visibleWhen: {
|
|
65470
|
-
|
|
65471
|
-
|
|
65614
|
+
anyOf: [
|
|
65615
|
+
{ field: "variant", oneOf: ["combined", "list", "timetable"] },
|
|
65616
|
+
{
|
|
65617
|
+
allOf: [
|
|
65618
|
+
{ field: "variant", equals: "calendar" },
|
|
65619
|
+
{ field: "defaultCalendarView", equals: "week" }
|
|
65620
|
+
]
|
|
65621
|
+
}
|
|
65622
|
+
]
|
|
65472
65623
|
}
|
|
65473
65624
|
}
|
|
65474
65625
|
},
|
|
@@ -65584,8 +65735,7 @@ var eventCalendarAdditionalFields = [
|
|
|
65584
65735
|
];
|
|
65585
65736
|
var eventCalendarVariants = {
|
|
65586
65737
|
combined: eventCalendarLayout[0],
|
|
65587
|
-
|
|
65588
|
-
week: eventCalendarLayout[0],
|
|
65738
|
+
calendar: eventCalendarLayout[0],
|
|
65589
65739
|
timetable: eventCalendarLayout[0],
|
|
65590
65740
|
list: eventCalendarLayout[0]
|
|
65591
65741
|
};
|
|
@@ -65597,8 +65747,7 @@ var eventCalendarVariants = {
|
|
|
65597
65747
|
multiple: false,
|
|
65598
65748
|
options: [
|
|
65599
65749
|
{ value: "combined" },
|
|
65600
|
-
{ value: "
|
|
65601
|
-
{ value: "week" },
|
|
65750
|
+
{ value: "calendar" },
|
|
65602
65751
|
{ value: "timetable" },
|
|
65603
65752
|
{ value: "list" }
|
|
65604
65753
|
]
|
|
@@ -65611,6 +65760,13 @@ var eventCalendarVariants = {
|
|
|
65611
65760
|
options: eventCalendarListLayoutOptions.map((option) => ({
|
|
65612
65761
|
value: option.id
|
|
65613
65762
|
}))
|
|
65763
|
+
},
|
|
65764
|
+
{
|
|
65765
|
+
id: "defaultCalendarView",
|
|
65766
|
+
type: "select",
|
|
65767
|
+
required: false,
|
|
65768
|
+
multiple: false,
|
|
65769
|
+
options: [{ value: "month" }, { value: "week" }]
|
|
65614
65770
|
}
|
|
65615
65771
|
];
|
|
65616
65772
|
var eventCalendarConfig = {
|
|
@@ -65654,8 +65810,7 @@ var eventCalendarConfig = {
|
|
|
65654
65810
|
defaultVariant: "combined",
|
|
65655
65811
|
variantOptions: {
|
|
65656
65812
|
combined: { label: "Combined" },
|
|
65657
|
-
|
|
65658
|
-
week: { label: "Week" },
|
|
65813
|
+
calendar: { label: "Calendar" },
|
|
65659
65814
|
timetable: { label: "Timetable" },
|
|
65660
65815
|
list: { label: "List" }
|
|
65661
65816
|
}
|
|
@@ -65851,7 +66006,7 @@ function inferLegacyOfferingsPreviewGroupOrder(overrides) {
|
|
|
65851
66006
|
return keys2.length >= 2 ? keys2 : [];
|
|
65852
66007
|
}
|
|
65853
66008
|
function normalizeOfferingsPreviewContentForWrite(value) {
|
|
65854
|
-
if (!
|
|
66009
|
+
if (!isRecord9(value)) return null;
|
|
65855
66010
|
const groupOrderValue = value.groupOrder;
|
|
65856
66011
|
if (Array.isArray(groupOrderValue)) {
|
|
65857
66012
|
const normalized = normalizeOfferingsPreviewGroupOrder(groupOrderValue);
|
|
@@ -65864,7 +66019,7 @@ function normalizeOfferingsPreviewContentForWrite(value) {
|
|
|
65864
66019
|
return { ...value, groupOrder: [] };
|
|
65865
66020
|
}
|
|
65866
66021
|
const legacyOrder = inferLegacyOfferingsPreviewGroupOrder(
|
|
65867
|
-
Array.isArray(value.groupOverrides) ? value.groupOverrides.filter(
|
|
66022
|
+
Array.isArray(value.groupOverrides) ? value.groupOverrides.filter(isRecord9) : []
|
|
65868
66023
|
);
|
|
65869
66024
|
return legacyOrder.length > 0 ? { ...value, groupOrder: legacyOrder } : value;
|
|
65870
66025
|
}
|
|
@@ -65918,7 +66073,7 @@ function uniqueOfferingsPreviewSourceKeys(values) {
|
|
|
65918
66073
|
}
|
|
65919
66074
|
return keys2;
|
|
65920
66075
|
}
|
|
65921
|
-
function
|
|
66076
|
+
function isRecord9(value) {
|
|
65922
66077
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
65923
66078
|
}
|
|
65924
66079
|
function mergeOrderedKeysWithDefaults(orderedKeys, defaultKeys) {
|
|
@@ -66380,7 +66535,7 @@ function isOfferingsPreviewItemLimit(value) {
|
|
|
66380
66535
|
return value === "1" || value === "2" || value === "3" || value === "4" || value === "5" || value === "6" || value === null;
|
|
66381
66536
|
}
|
|
66382
66537
|
function normalizeOfferingsPreviewGroupOverride(value) {
|
|
66383
|
-
if (!
|
|
66538
|
+
if (!isRecord10(value)) return [];
|
|
66384
66539
|
const override = {};
|
|
66385
66540
|
if (isOfferingsPreviewSourceKey(value.sourceKey) || value.sourceKey === null) {
|
|
66386
66541
|
override.sourceKey = value.sourceKey;
|
|
@@ -66412,12 +66567,12 @@ function isButtonVariant(value) {
|
|
|
66412
66567
|
return value === "primary" || value === "secondary" || value === "outline" || value === "link" || value === null;
|
|
66413
66568
|
}
|
|
66414
66569
|
function normalizeCardStylesContent(value) {
|
|
66415
|
-
return
|
|
66570
|
+
return isRecord10(value) || value === null ? value : void 0;
|
|
66416
66571
|
}
|
|
66417
66572
|
function normalizeSectionStylesContent(value) {
|
|
66418
|
-
return
|
|
66573
|
+
return isRecord10(value) || value === null ? value : void 0;
|
|
66419
66574
|
}
|
|
66420
|
-
function
|
|
66575
|
+
function isRecord10(value) {
|
|
66421
66576
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
66422
66577
|
}
|
|
66423
66578
|
var embedFields = [
|
|
@@ -68949,9 +69104,9 @@ var shopBlockDefinition = {
|
|
|
68949
69104
|
runtime: shopBlockRuntime,
|
|
68950
69105
|
dataSchemas: {
|
|
68951
69106
|
// listPublicPasses returns { passes: [...] }
|
|
68952
|
-
passes:
|
|
69107
|
+
passes: publicPassProductCollectionSchema.optional(),
|
|
68953
69108
|
// listPublicMemberships returns { memberships: [...] }
|
|
68954
|
-
memberships:
|
|
69109
|
+
memberships: publicMembershipProductCollectionSchema.optional()
|
|
68955
69110
|
},
|
|
68956
69111
|
dataLoaders: {
|
|
68957
69112
|
// Load passes for display
|
|
@@ -70823,13 +70978,6 @@ var systemBlockDefinitionsRaw = [
|
|
|
70823
70978
|
weight: "featured",
|
|
70824
70979
|
bias: "clear",
|
|
70825
70980
|
surfaces: heroSectionSurfaces
|
|
70826
|
-
}),
|
|
70827
|
-
layoutProfile({
|
|
70828
|
-
variantKey: "splitEditorial",
|
|
70829
|
-
family: "split",
|
|
70830
|
-
weight: "featured",
|
|
70831
|
-
bias: "clear",
|
|
70832
|
-
surfaces: heroSectionSurfaces
|
|
70833
70981
|
})
|
|
70834
70982
|
]
|
|
70835
70983
|
})),
|
|
@@ -71073,9 +71221,8 @@ var systemBlockDefinitionsRaw = [
|
|
|
71073
71221
|
flow: offeringsFlow,
|
|
71074
71222
|
layoutProfiles: [
|
|
71075
71223
|
layoutProfile({ variantKey: "combined", family: "grid", weight: "standard" }),
|
|
71224
|
+
layoutProfile({ variantKey: "calendar", family: "stack", weight: "standard" }),
|
|
71076
71225
|
layoutProfile({ variantKey: "list", family: "stack", weight: "standard" }),
|
|
71077
|
-
layoutProfile({ variantKey: "month", family: "grid", weight: "standard" }),
|
|
71078
|
-
layoutProfile({ variantKey: "week", family: "stack", weight: "standard" }),
|
|
71079
71226
|
layoutProfile({ variantKey: "timetable", family: "stack", weight: "standard" })
|
|
71080
71227
|
]
|
|
71081
71228
|
})),
|
|
@@ -71655,10 +71802,7 @@ function normalizeRenderStage(stage) {
|
|
|
71655
71802
|
return stage === "preview" ? "preview" : "published";
|
|
71656
71803
|
}
|
|
71657
71804
|
function isRouteVisibleInStage(routeEntry, stageInput) {
|
|
71658
|
-
|
|
71659
|
-
if (stage === "preview" || !isRouteRecord(routeEntry)) {
|
|
71660
|
-
return true;
|
|
71661
|
-
}
|
|
71805
|
+
if (normalizeRenderStage(stageInput) === "preview" || !isRouteRecord(routeEntry)) return true;
|
|
71662
71806
|
const status = routeEntry.status;
|
|
71663
71807
|
return !(typeof status === "string" && status !== "published");
|
|
71664
71808
|
}
|
|
@@ -71667,52 +71811,45 @@ function extractRouteHref(candidate, stageInput = "published") {
|
|
|
71667
71811
|
const trimmed = candidate.trim();
|
|
71668
71812
|
return trimmed.length > 0 ? trimmed : null;
|
|
71669
71813
|
}
|
|
71670
|
-
if (!isRouteRecord(candidate))
|
|
71671
|
-
|
|
71672
|
-
|
|
71673
|
-
|
|
71674
|
-
|
|
71814
|
+
if (!isRouteRecord(candidate)) return null;
|
|
71815
|
+
const fields3 = normalizeRenderStage(stageInput) === "preview" ? [
|
|
71816
|
+
"draftPath",
|
|
71817
|
+
"path",
|
|
71818
|
+
"href",
|
|
71819
|
+
"url"
|
|
71820
|
+
] : [
|
|
71821
|
+
"path",
|
|
71822
|
+
"href",
|
|
71823
|
+
"url"
|
|
71824
|
+
];
|
|
71675
71825
|
for (const field of fields3) {
|
|
71676
71826
|
const value = candidate[field];
|
|
71677
|
-
if (typeof value === "string" && value.trim().length > 0)
|
|
71678
|
-
return value.trim();
|
|
71679
|
-
}
|
|
71827
|
+
if (typeof value === "string" && value.trim().length > 0) return value.trim();
|
|
71680
71828
|
}
|
|
71681
71829
|
return null;
|
|
71682
71830
|
}
|
|
71683
71831
|
function extractRouteUpdatedAt(candidate) {
|
|
71684
|
-
if (!isRouteRecord(candidate))
|
|
71685
|
-
|
|
71686
|
-
}
|
|
71687
|
-
const fields3 = [
|
|
71832
|
+
if (!isRouteRecord(candidate)) return null;
|
|
71833
|
+
for (const field of [
|
|
71688
71834
|
"updatedAt",
|
|
71689
71835
|
"updated_at",
|
|
71690
71836
|
"publishedAt",
|
|
71691
71837
|
"published_at",
|
|
71692
71838
|
"modifiedAt",
|
|
71693
71839
|
"modified_at"
|
|
71694
|
-
]
|
|
71695
|
-
for (const field of fields3) {
|
|
71840
|
+
]) {
|
|
71696
71841
|
const value = candidate[field];
|
|
71697
|
-
if (typeof value === "string" && value.length > 0)
|
|
71698
|
-
return value;
|
|
71699
|
-
}
|
|
71842
|
+
if (typeof value === "string" && value.length > 0) return value;
|
|
71700
71843
|
}
|
|
71701
71844
|
return null;
|
|
71702
71845
|
}
|
|
71703
71846
|
function resolveRouteTargetForStage(routeIdValue, routes, stageInput) {
|
|
71704
71847
|
const routeId = typeof routeIdValue === "string" ? routeIdValue : null;
|
|
71705
|
-
if (!routeId || !routes)
|
|
71706
|
-
return null;
|
|
71707
|
-
}
|
|
71848
|
+
if (!routeId || !routes) return null;
|
|
71708
71849
|
const routeEntry = routes[routeId];
|
|
71709
|
-
if (!isRouteVisibleInStage(routeEntry, stageInput))
|
|
71710
|
-
return null;
|
|
71711
|
-
}
|
|
71850
|
+
if (!isRouteVisibleInStage(routeEntry, stageInput)) return null;
|
|
71712
71851
|
const href = extractRouteHref(routeEntry, stageInput);
|
|
71713
|
-
if (!href)
|
|
71714
|
-
return null;
|
|
71715
|
-
}
|
|
71852
|
+
if (!href) return null;
|
|
71716
71853
|
return {
|
|
71717
71854
|
routeId,
|
|
71718
71855
|
href,
|
|
@@ -71858,7 +71995,7 @@ var defaultTransforms = createTransformRegistry(builtinTransformDefinitions);
|
|
|
71858
71995
|
// ../blocks/src/system/data/linkedContentEntries.ts
|
|
71859
71996
|
var LINKED_CONTENT_ENTRY_META_KEY = "__rbLinkedContentEntry";
|
|
71860
71997
|
function coerceLinkedContentEntriesPayload(payload) {
|
|
71861
|
-
if (!
|
|
71998
|
+
if (!isRecord11(payload)) return payload;
|
|
71862
71999
|
const response = payload;
|
|
71863
72000
|
if (!Array.isArray(response.entries)) return payload;
|
|
71864
72001
|
const contentType = parsePublicContentTypeMeta(response.contentType);
|
|
@@ -71866,16 +72003,16 @@ function coerceLinkedContentEntriesPayload(payload) {
|
|
|
71866
72003
|
return response.entries.map((entry) => enrichLinkedContentEntry(entry, contentType));
|
|
71867
72004
|
}
|
|
71868
72005
|
function getLinkedContentEntryMeta(value) {
|
|
71869
|
-
if (!
|
|
72006
|
+
if (!isRecord11(value)) return null;
|
|
71870
72007
|
const candidate = value[LINKED_CONTENT_ENTRY_META_KEY];
|
|
71871
72008
|
return isLinkedContentEntryMeta(candidate) ? candidate : null;
|
|
71872
72009
|
}
|
|
71873
72010
|
function buildLinkedContentEditTarget(input) {
|
|
71874
72011
|
const { entry, sourceBlockId, sourceBlockKind, itemIndex } = input;
|
|
71875
|
-
if (!
|
|
72012
|
+
if (!isRecord11(entry)) return null;
|
|
71876
72013
|
const meta = getLinkedContentEntryMeta(entry);
|
|
71877
72014
|
if (!meta || meta.support.kind !== "supported") return null;
|
|
71878
|
-
const content =
|
|
72015
|
+
const content = isRecord11(entry.content) ? entry.content : {};
|
|
71879
72016
|
return {
|
|
71880
72017
|
kind: "linked-content-entry",
|
|
71881
72018
|
entryId: meta.entryId,
|
|
@@ -71925,12 +72062,12 @@ function resolveLinkedEntryInlineFieldEligibility(input) {
|
|
|
71925
72062
|
};
|
|
71926
72063
|
}
|
|
71927
72064
|
function enrichLinkedContentEntry(entry, contentType) {
|
|
71928
|
-
if (!
|
|
72065
|
+
if (!isRecord11(entry)) return entry;
|
|
71929
72066
|
const entryId = typeof entry.id === "string" ? entry.id : null;
|
|
71930
72067
|
if (!entryId) return entry;
|
|
71931
72068
|
const title = typeof entry.title === "string" && entry.title.trim().length > 0 ? entry.title : entryId;
|
|
71932
72069
|
const optimisticHash = typeof entry.optimisticHash === "string" && entry.optimisticHash.length > 0 ? entry.optimisticHash : null;
|
|
71933
|
-
const content =
|
|
72070
|
+
const content = isRecord11(entry.content) ? entry.content : {};
|
|
71934
72071
|
const meta = {
|
|
71935
72072
|
kind: "linked-content-entry",
|
|
71936
72073
|
entryId,
|
|
@@ -72026,7 +72163,7 @@ function capitalize(value) {
|
|
|
72026
72163
|
return value.charAt(0).toUpperCase() + value.slice(1).toLowerCase();
|
|
72027
72164
|
}
|
|
72028
72165
|
function parsePublicContentTypeMeta(value) {
|
|
72029
|
-
if (!
|
|
72166
|
+
if (!isRecord11(value)) return null;
|
|
72030
72167
|
if (typeof value.key !== "string" || value.key.trim().length === 0) return null;
|
|
72031
72168
|
return {
|
|
72032
72169
|
key: value.key,
|
|
@@ -72036,7 +72173,7 @@ function parsePublicContentTypeMeta(value) {
|
|
|
72036
72173
|
};
|
|
72037
72174
|
}
|
|
72038
72175
|
function parsePublicContentTypeLinkedEntryEditing(value) {
|
|
72039
|
-
if (!
|
|
72176
|
+
if (!isRecord11(value) || typeof value.kind !== "string") return null;
|
|
72040
72177
|
switch (value.kind) {
|
|
72041
72178
|
case "generic":
|
|
72042
72179
|
return { kind: "generic" };
|
|
@@ -72050,7 +72187,7 @@ function parsePublicContentTypeLinkedEntryEditing(value) {
|
|
|
72050
72187
|
}
|
|
72051
72188
|
}
|
|
72052
72189
|
function parsePublicContentTypeFieldMeta(value) {
|
|
72053
|
-
if (!
|
|
72190
|
+
if (!isRecord11(value)) return [];
|
|
72054
72191
|
if (typeof value.id !== "string" || typeof value.type !== "string") return [];
|
|
72055
72192
|
return [{
|
|
72056
72193
|
id: value.id,
|
|
@@ -72065,14 +72202,14 @@ function parseStringArray(value) {
|
|
|
72065
72202
|
return value.filter((item) => typeof item === "string");
|
|
72066
72203
|
}
|
|
72067
72204
|
function isLinkedContentEntryMeta(value) {
|
|
72068
|
-
if (!
|
|
72205
|
+
if (!isRecord11(value)) return false;
|
|
72069
72206
|
if (value.kind !== "linked-content-entry") return false;
|
|
72070
72207
|
if (typeof value.entryId !== "string") return false;
|
|
72071
72208
|
if (typeof value.contentTypeKey !== "string") return false;
|
|
72072
72209
|
if (typeof value.contentTypeLabel !== "string") return false;
|
|
72073
72210
|
if (typeof value.title !== "string") return false;
|
|
72074
72211
|
if (!(value.optimisticHash === null || typeof value.optimisticHash === "string")) return false;
|
|
72075
|
-
if (!
|
|
72212
|
+
if (!isRecord11(value.contentType)) return false;
|
|
72076
72213
|
if (!isLinkedEntryFieldSourceArray(value.fieldSources)) return false;
|
|
72077
72214
|
return isLinkedContentEditSupport(value.support);
|
|
72078
72215
|
}
|
|
@@ -72080,7 +72217,7 @@ function isLinkedEntryFieldSourceArray(value) {
|
|
|
72080
72217
|
return Array.isArray(value) && value.every(isLinkedEntryFieldSource);
|
|
72081
72218
|
}
|
|
72082
72219
|
function isLinkedEntryFieldSource(value) {
|
|
72083
|
-
if (!
|
|
72220
|
+
if (!isRecord11(value)) return false;
|
|
72084
72221
|
if (typeof value.displayPath !== "string") return false;
|
|
72085
72222
|
switch (value.kind) {
|
|
72086
72223
|
case "content-field":
|
|
@@ -72106,7 +72243,7 @@ function isLinkedEntryInlineFieldReadOnlyReason(value) {
|
|
|
72106
72243
|
}
|
|
72107
72244
|
}
|
|
72108
72245
|
function isLinkedContentEditSupport(value) {
|
|
72109
|
-
if (!
|
|
72246
|
+
if (!isRecord11(value) || typeof value.kind !== "string") return false;
|
|
72110
72247
|
switch (value.kind) {
|
|
72111
72248
|
case "supported":
|
|
72112
72249
|
return true;
|
|
@@ -72118,7 +72255,7 @@ function isLinkedContentEditSupport(value) {
|
|
|
72118
72255
|
return false;
|
|
72119
72256
|
}
|
|
72120
72257
|
}
|
|
72121
|
-
function
|
|
72258
|
+
function isRecord11(value) {
|
|
72122
72259
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
72123
72260
|
}
|
|
72124
72261
|
var Section2 = forwardRef(function Section3({
|
|
@@ -73534,21 +73671,33 @@ function idleSubmissionFeedback() {
|
|
|
73534
73671
|
return { tag: "idle" };
|
|
73535
73672
|
}
|
|
73536
73673
|
function errorSubmissionFeedback(message2) {
|
|
73537
|
-
return {
|
|
73674
|
+
return {
|
|
73675
|
+
tag: "error",
|
|
73676
|
+
message: message2
|
|
73677
|
+
};
|
|
73538
73678
|
}
|
|
73539
73679
|
function successSubmissionFeedback(message2) {
|
|
73540
|
-
return {
|
|
73680
|
+
return {
|
|
73681
|
+
tag: "success",
|
|
73682
|
+
message: message2
|
|
73683
|
+
};
|
|
73541
73684
|
}
|
|
73542
73685
|
function ok2() {
|
|
73543
73686
|
return { ok: true };
|
|
73544
73687
|
}
|
|
73545
|
-
function
|
|
73546
|
-
return {
|
|
73688
|
+
function okWith(data) {
|
|
73689
|
+
return {
|
|
73690
|
+
ok: true,
|
|
73691
|
+
data
|
|
73692
|
+
};
|
|
73547
73693
|
}
|
|
73548
73694
|
function err2(error) {
|
|
73549
|
-
return {
|
|
73695
|
+
return {
|
|
73696
|
+
ok: false,
|
|
73697
|
+
error
|
|
73698
|
+
};
|
|
73550
73699
|
}
|
|
73551
|
-
function
|
|
73700
|
+
function assertNever8(value, message2) {
|
|
73552
73701
|
throw new Error(`Unexpected value: ${String(value)}`);
|
|
73553
73702
|
}
|
|
73554
73703
|
|
|
@@ -73703,19 +73852,19 @@ function deriveBookingFormViewState(input) {
|
|
|
73703
73852
|
resourceName: input.verificationState.resourceName
|
|
73704
73853
|
};
|
|
73705
73854
|
default:
|
|
73706
|
-
return
|
|
73855
|
+
return assertNever8(input.verificationState);
|
|
73707
73856
|
}
|
|
73708
73857
|
}
|
|
73709
73858
|
function resolveBookingSiteId(siteId, form2) {
|
|
73710
73859
|
return siteId || form2?.siteId || "";
|
|
73711
73860
|
}
|
|
73712
73861
|
function normalizeBookingFormConfig(form2) {
|
|
73713
|
-
if (!
|
|
73862
|
+
if (!isRecord12(form2)) return null;
|
|
73714
73863
|
const id = readNonEmptyString(form2.id);
|
|
73715
73864
|
const name = readNonEmptyString(form2.name);
|
|
73716
73865
|
if (!id || !name) return null;
|
|
73717
|
-
const schemaSource =
|
|
73718
|
-
const settingsSource =
|
|
73866
|
+
const schemaSource = isRecord12(form2.schema) ? form2.schema : isRecord12(form2.schemaJson) ? form2.schemaJson : null;
|
|
73867
|
+
const settingsSource = isRecord12(form2.settings) ? form2.settings : isRecord12(form2.settingsJson) ? form2.settingsJson : null;
|
|
73719
73868
|
return {
|
|
73720
73869
|
id,
|
|
73721
73870
|
name,
|
|
@@ -73739,10 +73888,10 @@ function normalizeBookingServices(services) {
|
|
|
73739
73888
|
if (Array.isArray(services)) {
|
|
73740
73889
|
return services.filter(isBookingFormService).map(normalizeService);
|
|
73741
73890
|
}
|
|
73742
|
-
if (
|
|
73891
|
+
if (isRecord12(services) && "services" in services) {
|
|
73743
73892
|
return Array.isArray(services.services) ? services.services.filter(isBookingFormService).map(normalizeService) : [];
|
|
73744
73893
|
}
|
|
73745
|
-
return
|
|
73894
|
+
return isRecord12(services) ? Object.values(services).filter(isBookingFormService).map(normalizeService) : [];
|
|
73746
73895
|
}
|
|
73747
73896
|
function normalizeBookingSchema(value) {
|
|
73748
73897
|
if (!value) return void 0;
|
|
@@ -73754,7 +73903,7 @@ function normalizeBookingSchema(value) {
|
|
|
73754
73903
|
};
|
|
73755
73904
|
}
|
|
73756
73905
|
function readBookingFormField(value) {
|
|
73757
|
-
if (!
|
|
73906
|
+
if (!isRecord12(value)) return null;
|
|
73758
73907
|
const id = readNonEmptyString(value.id);
|
|
73759
73908
|
const label = readNonEmptyString(value.label);
|
|
73760
73909
|
const type = readBookingFieldType(value.type);
|
|
@@ -73800,7 +73949,7 @@ function readBookingFieldOptions(value) {
|
|
|
73800
73949
|
return options.length > 0 ? options : void 0;
|
|
73801
73950
|
}
|
|
73802
73951
|
function readBookingFieldOption(value) {
|
|
73803
|
-
if (!
|
|
73952
|
+
if (!isRecord12(value)) return null;
|
|
73804
73953
|
const optionValue = readNonEmptyString(value.value);
|
|
73805
73954
|
const label = readNonEmptyString(value.label);
|
|
73806
73955
|
return optionValue && label ? { value: optionValue, label } : null;
|
|
@@ -73817,7 +73966,7 @@ function normalizeBookingSettings(value) {
|
|
|
73817
73966
|
};
|
|
73818
73967
|
}
|
|
73819
73968
|
function isBookingFormService(value) {
|
|
73820
|
-
return
|
|
73969
|
+
return isRecord12(value) && typeof value.id === "string" && typeof value.siteId === "string" && typeof value.title === "string";
|
|
73821
73970
|
}
|
|
73822
73971
|
function collectBookingCustomFields(data) {
|
|
73823
73972
|
const customFields = {};
|
|
@@ -73847,7 +73996,7 @@ function readStringArray(value) {
|
|
|
73847
73996
|
const strings = value.filter((item) => typeof item === "string");
|
|
73848
73997
|
return strings.length > 0 ? strings : void 0;
|
|
73849
73998
|
}
|
|
73850
|
-
function
|
|
73999
|
+
function isRecord12(value) {
|
|
73851
74000
|
return typeof value === "object" && value !== null;
|
|
73852
74001
|
}
|
|
73853
74002
|
function getBookingServicePaymentSelectionMode(service) {
|
|
@@ -73873,7 +74022,7 @@ function getBookingServicePaymentSelectionMode(service) {
|
|
|
73873
74022
|
case "flexible_balance":
|
|
73874
74023
|
return "implicit_flexible_balance";
|
|
73875
74024
|
default:
|
|
73876
|
-
return
|
|
74025
|
+
return assertNever8(onlyKind);
|
|
73877
74026
|
}
|
|
73878
74027
|
}
|
|
73879
74028
|
if (allowedKinds.length === 2 && allowedKinds.includes("upfront") && (allowedKinds.includes("deferred_manual") || allowedKinds.includes("instalment_plan") || allowedKinds.includes("flexible_balance"))) {
|
|
@@ -74075,7 +74224,7 @@ function formatBookingSubmissionPreparationError(error) {
|
|
|
74075
74224
|
case "service-missing-duration":
|
|
74076
74225
|
return `Service "${error.serviceTitle}" is missing duration. Please update the service in the dashboard to include a duration (e.g., 30 minutes).`;
|
|
74077
74226
|
default:
|
|
74078
|
-
return
|
|
74227
|
+
return assertNever8(error);
|
|
74079
74228
|
}
|
|
74080
74229
|
}
|
|
74081
74230
|
function getBookingSuccessMessage(successMessage) {
|
|
@@ -74356,7 +74505,7 @@ function BookingFormSSR({
|
|
|
74356
74505
|
}
|
|
74357
74506
|
var booking_form_server_default = BookingFormSSR;
|
|
74358
74507
|
|
|
74359
|
-
// ../blocks/src/system/runtime/nodes/
|
|
74508
|
+
// ../blocks/src/system/runtime/nodes/events/shared/eventProductEligibility.ts
|
|
74360
74509
|
function isCategoryEligible(eligibleCategoryIds, eventCategoryId) {
|
|
74361
74510
|
const categories = eligibleCategoryIds ?? [];
|
|
74362
74511
|
if (categories.length === 0) return true;
|
|
@@ -74371,6 +74520,32 @@ function membershipCoversEvent(args, event) {
|
|
|
74371
74520
|
if (!event.acceptsMemberships) return false;
|
|
74372
74521
|
return isCategoryEligible(args.eligibleCategoryIds, event.eventCategoryId);
|
|
74373
74522
|
}
|
|
74523
|
+
function filterPassesForEvent(sitePasses, event) {
|
|
74524
|
+
if (!sitePasses || !event) return [];
|
|
74525
|
+
if (event.requiresRegistration === false) return [];
|
|
74526
|
+
const acceptsPasses = event.acceptsPasses ?? true;
|
|
74527
|
+
const eventCategoryId = event.eventCategory?.id ?? null;
|
|
74528
|
+
return sitePasses.filter(
|
|
74529
|
+
(pass) => pass.productUseCase === "event_pass" && passCoversEvent(
|
|
74530
|
+
{ eligibleCategoryIds: pass.eligibleCategoryIds },
|
|
74531
|
+
{ acceptsPasses, eventCategoryId }
|
|
74532
|
+
)
|
|
74533
|
+
);
|
|
74534
|
+
}
|
|
74535
|
+
function filterMembershipsForEvent(siteMemberships, event) {
|
|
74536
|
+
if (!siteMemberships || !event) return [];
|
|
74537
|
+
if (event.requiresRegistration === false) return [];
|
|
74538
|
+
const acceptsMemberships = event.acceptsMemberships ?? true;
|
|
74539
|
+
const eventCategoryId = event.eventCategory?.id ?? null;
|
|
74540
|
+
return siteMemberships.filter(
|
|
74541
|
+
(membership) => membershipCoversEvent(
|
|
74542
|
+
{ eligibleCategoryIds: membership.eligibleCategoryIds },
|
|
74543
|
+
{ acceptsMemberships, eventCategoryId }
|
|
74544
|
+
)
|
|
74545
|
+
);
|
|
74546
|
+
}
|
|
74547
|
+
|
|
74548
|
+
// ../blocks/src/system/runtime/nodes/event-details/logic.ts
|
|
74374
74549
|
function parseLimit(value, fallback2) {
|
|
74375
74550
|
const n3 = typeof value === "string" ? parseInt(value, 10) : typeof value === "number" ? value : NaN;
|
|
74376
74551
|
return Number.isFinite(n3) && n3 > 0 ? n3 : fallback2;
|
|
@@ -74429,30 +74604,6 @@ function selectEventDetails(args) {
|
|
|
74429
74604
|
}).slice(0, otherLimit) : [];
|
|
74430
74605
|
return { mode, selected, otherDates, timeZone };
|
|
74431
74606
|
}
|
|
74432
|
-
function filterPassesForEvent(sitePasses, event) {
|
|
74433
|
-
if (!sitePasses || !event) return [];
|
|
74434
|
-
if (event.requiresRegistration === false) return [];
|
|
74435
|
-
const acceptsPasses = event.acceptsPasses ?? true;
|
|
74436
|
-
const eventCategoryId = event.eventCategory?.id ?? null;
|
|
74437
|
-
return sitePasses.filter(
|
|
74438
|
-
(pass) => pass.productUseCase === "event_pass" && passCoversEvent(
|
|
74439
|
-
{ eligibleCategoryIds: pass.eligibleCategoryIds },
|
|
74440
|
-
{ acceptsPasses, eventCategoryId }
|
|
74441
|
-
)
|
|
74442
|
-
);
|
|
74443
|
-
}
|
|
74444
|
-
function filterMembershipsForEvent(siteMemberships, event) {
|
|
74445
|
-
if (!siteMemberships || !event) return [];
|
|
74446
|
-
if (event.requiresRegistration === false) return [];
|
|
74447
|
-
const acceptsMemberships = event.acceptsMemberships ?? true;
|
|
74448
|
-
const eventCategoryId = event.eventCategory?.id ?? null;
|
|
74449
|
-
return siteMemberships.filter(
|
|
74450
|
-
(membership) => membershipCoversEvent(
|
|
74451
|
-
{ eligibleCategoryIds: membership.eligibleCategoryIds },
|
|
74452
|
-
{ acceptsMemberships, eventCategoryId }
|
|
74453
|
-
)
|
|
74454
|
-
);
|
|
74455
|
-
}
|
|
74456
74607
|
function CoursePricingDisplay({
|
|
74457
74608
|
pricing,
|
|
74458
74609
|
acceptedItems
|
|
@@ -74619,7 +74770,7 @@ function EventDetailsView({
|
|
|
74619
74770
|
"a",
|
|
74620
74771
|
{
|
|
74621
74772
|
className: "rb-tile rb-tile--interactive",
|
|
74622
|
-
|
|
74773
|
+
...resolveEventLinkProps(e3),
|
|
74623
74774
|
children: /* @__PURE__ */ jsx(
|
|
74624
74775
|
DateTimeTile,
|
|
74625
74776
|
{
|
|
@@ -75176,6 +75327,7 @@ var eventCombinedSourceSchema = z.object(
|
|
|
75176
75327
|
loadMoreText: z.string().optional(),
|
|
75177
75328
|
startOfWeek: weekStartSchema.optional(),
|
|
75178
75329
|
calendarTabViews: calendarTabViewsSchema.optional(),
|
|
75330
|
+
defaultCalendarView: eventCalendarDefaultViewSchema.optional(),
|
|
75179
75331
|
showFilters: z.boolean().nullable().optional(),
|
|
75180
75332
|
showCategoryFilter: filterAutoShowSchema.optional(),
|
|
75181
75333
|
showVenueFilter: z.boolean().nullable().optional(),
|
|
@@ -75206,6 +75358,7 @@ var eventCombinedDisplaySchema = z.object({
|
|
|
75206
75358
|
paginationAction: eventListPaginationActionSchema,
|
|
75207
75359
|
startOfWeek: weekStartSchema,
|
|
75208
75360
|
calendarTabViews: calendarTabViewsSchema,
|
|
75361
|
+
defaultCalendarView: eventCalendarDefaultViewSchema,
|
|
75209
75362
|
showFilters: z.boolean(),
|
|
75210
75363
|
showCategoryFilter: filterAutoShowSchema,
|
|
75211
75364
|
showVenueFilter: z.boolean(),
|
|
@@ -75262,6 +75415,7 @@ function buildEventCombinedDisplay(source) {
|
|
|
75262
75415
|
}),
|
|
75263
75416
|
startOfWeek: source.startOfWeek ?? "monday",
|
|
75264
75417
|
calendarTabViews: source.calendarTabViews ?? "both",
|
|
75418
|
+
defaultCalendarView: source.defaultCalendarView ?? "month",
|
|
75265
75419
|
showFilters: source.showFilters ?? true,
|
|
75266
75420
|
showCategoryFilter: source.showCategoryFilter ?? "auto",
|
|
75267
75421
|
showVenueFilter: source.showVenueFilter ?? false,
|
|
@@ -76225,10 +76379,118 @@ function EventListingFrameView(props2) {
|
|
|
76225
76379
|
footer
|
|
76226
76380
|
] });
|
|
76227
76381
|
}
|
|
76382
|
+
var AgendaEventCard = ({
|
|
76383
|
+
event,
|
|
76384
|
+
showCapacity,
|
|
76385
|
+
onClick
|
|
76386
|
+
}) => {
|
|
76387
|
+
const eventLinkProps = resolveEventLinkProps(event);
|
|
76388
|
+
const categoryColor = event.eventCategory?.color || "rgb(var(--tb-accent))";
|
|
76389
|
+
const price = formatEventPrice(event);
|
|
76390
|
+
const { available, isFull } = getEventAvailability(event);
|
|
76391
|
+
const capacity = showCapacity && available != null ? isFull ? "Full" : `${available} spots left` : null;
|
|
76392
|
+
const title = event.title;
|
|
76393
|
+
const timeZone = event.timeZone ?? null;
|
|
76394
|
+
const teacherLine = formatEventTeacherLine(event);
|
|
76395
|
+
const cardContent = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
76396
|
+
/* @__PURE__ */ jsx(
|
|
76397
|
+
"div",
|
|
76398
|
+
{
|
|
76399
|
+
className: "event-agenda-card-indicator",
|
|
76400
|
+
style: { backgroundColor: categoryColor },
|
|
76401
|
+
"aria-hidden": "true"
|
|
76402
|
+
}
|
|
76403
|
+
),
|
|
76404
|
+
/* @__PURE__ */ jsxs("div", { className: "event-agenda-card-content", children: [
|
|
76405
|
+
/* @__PURE__ */ jsxs("div", { className: "event-agenda-card-header", children: [
|
|
76406
|
+
/* @__PURE__ */ jsx("span", { className: "event-agenda-card-time", children: formatTime(event.startsAt, { timeZone }) }),
|
|
76407
|
+
/* @__PURE__ */ jsx("span", { className: "event-agenda-card-title", children: title })
|
|
76408
|
+
] }),
|
|
76409
|
+
/* @__PURE__ */ jsxs("div", { className: "event-agenda-card-details", children: [
|
|
76410
|
+
event.venue && /* @__PURE__ */ jsxs("span", { className: "event-agenda-card-venue", children: [
|
|
76411
|
+
/* @__PURE__ */ jsxs(
|
|
76412
|
+
"svg",
|
|
76413
|
+
{
|
|
76414
|
+
className: "event-agenda-card-icon",
|
|
76415
|
+
width: "14",
|
|
76416
|
+
height: "14",
|
|
76417
|
+
viewBox: "0 0 24 24",
|
|
76418
|
+
fill: "none",
|
|
76419
|
+
stroke: "currentColor",
|
|
76420
|
+
strokeWidth: "2",
|
|
76421
|
+
strokeLinecap: "round",
|
|
76422
|
+
strokeLinejoin: "round",
|
|
76423
|
+
children: [
|
|
76424
|
+
/* @__PURE__ */ jsx("path", { d: "M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z" }),
|
|
76425
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "10", r: "3" })
|
|
76426
|
+
]
|
|
76427
|
+
}
|
|
76428
|
+
),
|
|
76429
|
+
event.venue.name
|
|
76430
|
+
] }),
|
|
76431
|
+
teacherLine && /* @__PURE__ */ jsx("span", { className: "event-agenda-card-teacher", children: teacherLine }),
|
|
76432
|
+
/* @__PURE__ */ jsx("span", { className: "event-agenda-card-price", children: price }),
|
|
76433
|
+
capacity && /* @__PURE__ */ jsx("span", { className: `event-agenda-card-capacity ${isFull ? "event-agenda-card-capacity--full" : ""}`, children: capacity })
|
|
76434
|
+
] })
|
|
76435
|
+
] })
|
|
76436
|
+
] });
|
|
76437
|
+
if (onClick) {
|
|
76438
|
+
return /* @__PURE__ */ jsx(
|
|
76439
|
+
"button",
|
|
76440
|
+
{
|
|
76441
|
+
type: "button",
|
|
76442
|
+
className: "event-agenda-card",
|
|
76443
|
+
onClick: () => onClick(event),
|
|
76444
|
+
children: cardContent
|
|
76445
|
+
}
|
|
76446
|
+
);
|
|
76447
|
+
}
|
|
76448
|
+
return /* @__PURE__ */ jsx("a", { ...eventLinkProps, className: "event-agenda-card", children: cardContent });
|
|
76449
|
+
};
|
|
76450
|
+
var FULL_DAY_NAMES = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
|
|
76451
|
+
function formatAgendaDayHeader(date) {
|
|
76452
|
+
const dayName = FULL_DAY_NAMES[date.getDay()];
|
|
76453
|
+
const monthName = MONTH_NAMES[date.getMonth()];
|
|
76454
|
+
return `${dayName ?? "Day"}, ${monthName ?? "Month"} ${date.getDate()}`;
|
|
76455
|
+
}
|
|
76456
|
+
var WeekAgendaView = ({
|
|
76457
|
+
days,
|
|
76458
|
+
events: events2,
|
|
76459
|
+
showCapacity,
|
|
76460
|
+
emptyMessage = "No events scheduled"
|
|
76461
|
+
}) => {
|
|
76462
|
+
const eventsByDate = groupEventsByDate(events2);
|
|
76463
|
+
return /* @__PURE__ */ jsx("div", { className: "event-agenda-week", children: days.map((date) => {
|
|
76464
|
+
const dateKey = formatDateKey2(date);
|
|
76465
|
+
const dayEvents = eventsByDate.get(dateKey) || [];
|
|
76466
|
+
const today = isToday(date);
|
|
76467
|
+
return /* @__PURE__ */ jsxs(
|
|
76468
|
+
"div",
|
|
76469
|
+
{
|
|
76470
|
+
className: `event-agenda-day ${today ? "event-agenda-day--today" : ""}`,
|
|
76471
|
+
children: [
|
|
76472
|
+
/* @__PURE__ */ jsx("div", { className: "event-agenda-day-header", children: /* @__PURE__ */ jsxs("h4", { className: "event-agenda-day-title", children: [
|
|
76473
|
+
formatAgendaDayHeader(date),
|
|
76474
|
+
today && /* @__PURE__ */ jsx("span", { className: "event-agenda-day-today-badge", children: "Today" })
|
|
76475
|
+
] }) }),
|
|
76476
|
+
/* @__PURE__ */ jsx("div", { className: "event-agenda-day-content", children: dayEvents.length === 0 ? /* @__PURE__ */ jsx("p", { className: "event-agenda-day-empty", children: emptyMessage }) : /* @__PURE__ */ jsx("div", { className: "event-agenda-day-events", children: dayEvents.map((event) => /* @__PURE__ */ jsx(
|
|
76477
|
+
AgendaEventCard,
|
|
76478
|
+
{
|
|
76479
|
+
event,
|
|
76480
|
+
showCapacity
|
|
76481
|
+
},
|
|
76482
|
+
event.occurrenceId || event.id
|
|
76483
|
+
)) }) })
|
|
76484
|
+
]
|
|
76485
|
+
},
|
|
76486
|
+
dateKey
|
|
76487
|
+
);
|
|
76488
|
+
}) });
|
|
76489
|
+
};
|
|
76228
76490
|
|
|
76229
76491
|
// ../blocks/src/system/runtime/nodes/events/shared/timetableModel.ts
|
|
76230
76492
|
var DEFAULT_EVENT_CELL_COLOR = "rgb(var(--tb-accent))";
|
|
76231
|
-
var
|
|
76493
|
+
var FULL_DAY_NAMES2 = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
|
|
76232
76494
|
function buildTimetableModel2(input) {
|
|
76233
76495
|
const generic = buildTimetableModel({
|
|
76234
76496
|
items: input.events,
|
|
@@ -76288,12 +76550,12 @@ function formatEventTimeRange(event) {
|
|
|
76288
76550
|
return `${formatTime(event.startsAt, { timeZone })} - ${formatTime(event.endsAt, { timeZone })}`;
|
|
76289
76551
|
}
|
|
76290
76552
|
function formatDayLabel(date) {
|
|
76291
|
-
const dayName =
|
|
76553
|
+
const dayName = FULL_DAY_NAMES2[date.getDay()] ?? "";
|
|
76292
76554
|
const monthName = MONTH_NAMES[date.getMonth()] ?? "";
|
|
76293
76555
|
return `${dayName}, ${monthName} ${date.getDate()}`;
|
|
76294
76556
|
}
|
|
76295
76557
|
function formatShortDayLabel(date) {
|
|
76296
|
-
const dayName =
|
|
76558
|
+
const dayName = FULL_DAY_NAMES2[date.getDay()] ?? "";
|
|
76297
76559
|
return `${dayName.slice(0, 3)} ${date.getDate()}`;
|
|
76298
76560
|
}
|
|
76299
76561
|
function assertNeverDisplayMode(value) {
|
|
@@ -76349,8 +76611,8 @@ function renderListSsr(display, prefetchedEvents) {
|
|
|
76349
76611
|
}
|
|
76350
76612
|
);
|
|
76351
76613
|
}
|
|
76352
|
-
function
|
|
76353
|
-
const calendarView = display.
|
|
76614
|
+
function renderCalendarSsr(display) {
|
|
76615
|
+
const calendarView = display.defaultCalendarView;
|
|
76354
76616
|
const viewDate = /* @__PURE__ */ new Date();
|
|
76355
76617
|
const viewport = buildCalendarViewport({
|
|
76356
76618
|
view: calendarView,
|
|
@@ -76394,7 +76656,15 @@ function renderCalendarGrid(display) {
|
|
|
76394
76656
|
}
|
|
76395
76657
|
)
|
|
76396
76658
|
] }),
|
|
76397
|
-
|
|
76659
|
+
viewport.kind === "week" ? /* @__PURE__ */ jsx(
|
|
76660
|
+
WeekAgendaView,
|
|
76661
|
+
{
|
|
76662
|
+
days: viewport.days,
|
|
76663
|
+
events: [...display.events],
|
|
76664
|
+
emptyMessage: display.emptyMessage,
|
|
76665
|
+
showCapacity: display.showCapacity
|
|
76666
|
+
}
|
|
76667
|
+
) : /* @__PURE__ */ jsxs("div", { className: "event-calendar-container", children: [
|
|
76398
76668
|
/* @__PURE__ */ jsx("div", { className: "event-calendar-day-headers", children: dayNames.map((day) => /* @__PURE__ */ jsx("div", { className: "event-calendar-day-header", children: day }, day)) }),
|
|
76399
76669
|
/* @__PURE__ */ jsx("div", { className: "event-calendar-grid", children: viewport.days.map((date) => {
|
|
76400
76670
|
const dateKey = formatDateKey2(date);
|
|
@@ -76412,7 +76682,7 @@ function renderCalendarGrid(display) {
|
|
|
76412
76682
|
dayEvents.slice(0, MAX_EVENTS_PER_DAY).map((event) => /* @__PURE__ */ jsxs(
|
|
76413
76683
|
"a",
|
|
76414
76684
|
{
|
|
76415
|
-
|
|
76685
|
+
...resolveEventLinkProps(event),
|
|
76416
76686
|
className: "event-calendar-event",
|
|
76417
76687
|
title: `${event.title} at ${formatTime(event.startsAt, { timeZone: getEventTimeZone(event) })}`,
|
|
76418
76688
|
children: [
|
|
@@ -76432,7 +76702,7 @@ function renderCalendarGrid(display) {
|
|
|
76432
76702
|
] }, dateKey);
|
|
76433
76703
|
}) })
|
|
76434
76704
|
] }),
|
|
76435
|
-
display.events.length === 0 ? /* @__PURE__ */ jsx("p", { className: "event-calendar-empty", children: display.emptyMessage }) : null
|
|
76705
|
+
viewport.kind === "month" && display.events.length === 0 ? /* @__PURE__ */ jsx("p", { className: "event-calendar-empty", children: display.emptyMessage }) : null
|
|
76436
76706
|
] });
|
|
76437
76707
|
}
|
|
76438
76708
|
function renderTimetableSsr(display) {
|
|
@@ -76540,7 +76810,7 @@ function renderTimetableSsr(display) {
|
|
|
76540
76810
|
day.events.length === 0 ? /* @__PURE__ */ jsx("p", { className: "event-timetable-day-empty", children: "No classes" }) : day.events.map((cell) => /* @__PURE__ */ jsxs(
|
|
76541
76811
|
"a",
|
|
76542
76812
|
{
|
|
76543
|
-
|
|
76813
|
+
...resolveEventLinkProps(cell.event),
|
|
76544
76814
|
className: "event-timetable-event",
|
|
76545
76815
|
title: `${cell.event.title}, ${cell.timeLabel}`,
|
|
76546
76816
|
style: {
|
|
@@ -76607,9 +76877,8 @@ var EventCalendarSSR = (props2) => {
|
|
|
76607
76877
|
case "timetable":
|
|
76608
76878
|
content = renderTimetableSsr(display);
|
|
76609
76879
|
break;
|
|
76610
|
-
case "
|
|
76611
|
-
|
|
76612
|
-
content = renderCalendarGrid(display);
|
|
76880
|
+
case "calendar":
|
|
76881
|
+
content = renderCalendarSsr(display);
|
|
76613
76882
|
break;
|
|
76614
76883
|
default:
|
|
76615
76884
|
content = assertNeverDisplayMode(display.displayMode);
|
|
@@ -76660,6 +76929,8 @@ function EventRegistrationSSR({
|
|
|
76660
76929
|
spamProtectionEnabled,
|
|
76661
76930
|
stage,
|
|
76662
76931
|
supportEmail,
|
|
76932
|
+
sitePasses,
|
|
76933
|
+
siteMemberships,
|
|
76663
76934
|
children
|
|
76664
76935
|
}) {
|
|
76665
76936
|
const islandProps = buildEventRegistrationInteractiveIslandProps({
|
|
@@ -76681,7 +76952,9 @@ function EventRegistrationSSR({
|
|
|
76681
76952
|
overlayEnabled,
|
|
76682
76953
|
spamProtectionEnabled,
|
|
76683
76954
|
stage,
|
|
76684
|
-
supportEmail
|
|
76955
|
+
supportEmail,
|
|
76956
|
+
sitePasses,
|
|
76957
|
+
siteMemberships
|
|
76685
76958
|
});
|
|
76686
76959
|
const display = islandProps.render.display;
|
|
76687
76960
|
return /* @__PURE__ */ jsxs(
|
|
@@ -77330,14 +77603,14 @@ function isDecoratedHeadingBlockKind(blockKind) {
|
|
|
77330
77603
|
return blockKind === "block.intro" || blockKind === "block.feature-cards" || blockKind === "block.testimonials" || blockKind === "block.faq";
|
|
77331
77604
|
}
|
|
77332
77605
|
function readVariant(blockContent) {
|
|
77333
|
-
if (!
|
|
77606
|
+
if (!isRecord13(blockContent)) return void 0;
|
|
77334
77607
|
const variant = blockContent.variant;
|
|
77335
77608
|
return typeof variant === "string" ? variant : void 0;
|
|
77336
77609
|
}
|
|
77337
77610
|
function isFaqDecoratedVariant(variant) {
|
|
77338
77611
|
return variant === "default" || variant === "question-columns";
|
|
77339
77612
|
}
|
|
77340
|
-
function
|
|
77613
|
+
function isRecord13(value) {
|
|
77341
77614
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
77342
77615
|
}
|
|
77343
77616
|
function buildHeadingDecorationWrapperClassName(className) {
|
|
@@ -93908,6 +94181,39 @@ function ThemeScope({
|
|
|
93908
94181
|
}
|
|
93909
94182
|
);
|
|
93910
94183
|
}
|
|
94184
|
+
function ResponsiveScope({
|
|
94185
|
+
children,
|
|
94186
|
+
responsiveMode = DEFAULT_THEME_RESPONSIVE_MODE,
|
|
94187
|
+
className
|
|
94188
|
+
}) {
|
|
94189
|
+
const responsiveScope = getResponsiveScopeSpec(responsiveMode);
|
|
94190
|
+
const isContainerResponsive = responsiveScope.kind === "container";
|
|
94191
|
+
const wrapperStyle = isContainerResponsive ? {
|
|
94192
|
+
containerType: "inline-size",
|
|
94193
|
+
containerName: responsiveScope.containerName
|
|
94194
|
+
} : {};
|
|
94195
|
+
return /* @__PURE__ */ jsxs(
|
|
94196
|
+
"div",
|
|
94197
|
+
{
|
|
94198
|
+
className: className ? `theme-scope ${className}` : "theme-scope",
|
|
94199
|
+
style: wrapperStyle,
|
|
94200
|
+
"data-rb-responsive-mode": responsiveScope.kind,
|
|
94201
|
+
"data-theme-scope": "responsive",
|
|
94202
|
+
children: [
|
|
94203
|
+
isContainerResponsive && /* @__PURE__ */ jsx(
|
|
94204
|
+
"style",
|
|
94205
|
+
{
|
|
94206
|
+
"data-container-responsive-overrides": true,
|
|
94207
|
+
dangerouslySetInnerHTML: {
|
|
94208
|
+
__html: escapeStyleContent(containerResponsiveThemeCss)
|
|
94209
|
+
}
|
|
94210
|
+
}
|
|
94211
|
+
),
|
|
94212
|
+
children
|
|
94213
|
+
]
|
|
94214
|
+
}
|
|
94215
|
+
);
|
|
94216
|
+
}
|
|
93911
94217
|
z.object({
|
|
93912
94218
|
tokens: z.record(z.string(), z.string()),
|
|
93913
94219
|
typography: z.object({
|
|
@@ -94919,14 +95225,14 @@ function backgroundCapabilityFromModes(modeCapabilities) {
|
|
|
94919
95225
|
};
|
|
94920
95226
|
}
|
|
94921
95227
|
function parseBackgroundOverrideFromContent(content) {
|
|
94922
|
-
const sectionStyles =
|
|
95228
|
+
const sectionStyles = isRecord14(content._sectionStyles) ? content._sectionStyles : null;
|
|
94923
95229
|
return parseBackgroundOverride(sectionStyles?.background);
|
|
94924
95230
|
}
|
|
94925
95231
|
function parseBackgroundOverride(value) {
|
|
94926
95232
|
if (value === null || value === void 0) {
|
|
94927
95233
|
return { kind: "supported", override: DEFAULT_BACKGROUND_OVERRIDE };
|
|
94928
95234
|
}
|
|
94929
|
-
if (!
|
|
95235
|
+
if (!isRecord14(value)) {
|
|
94930
95236
|
return { kind: "legacy", reason: "unsupported-shape", background: {} };
|
|
94931
95237
|
}
|
|
94932
95238
|
if (Object.keys(value).length === 0) {
|
|
@@ -95007,7 +95313,7 @@ function serializeBackgroundOverride(override) {
|
|
|
95007
95313
|
}
|
|
95008
95314
|
}
|
|
95009
95315
|
function applyBackgroundOverrideContentPatch(content, override) {
|
|
95010
|
-
const sectionStyles =
|
|
95316
|
+
const sectionStyles = isRecord14(content._sectionStyles) ? content._sectionStyles : {};
|
|
95011
95317
|
const serialized = serializeBackgroundOverride(override);
|
|
95012
95318
|
if (serialized === null) {
|
|
95013
95319
|
const nextSectionStyles = omitRecordKey2(sectionStyles, "background");
|
|
@@ -95209,7 +95515,7 @@ function imageAllowed(mediaId, pool) {
|
|
|
95209
95515
|
return pool?.some((item) => item.mediaId === mediaId) ?? false;
|
|
95210
95516
|
}
|
|
95211
95517
|
function parseImageMediaAssetId(value) {
|
|
95212
|
-
if (!
|
|
95518
|
+
if (!isRecord14(value)) return { kind: "missing" };
|
|
95213
95519
|
if (value.type !== void 0 && value.type !== "image") return { kind: "missing" };
|
|
95214
95520
|
const parsed = parseMediaAssetId(value.assetId);
|
|
95215
95521
|
if (!parsed.ok) {
|
|
@@ -95257,18 +95563,18 @@ function omitRecordKey2(content, key) {
|
|
|
95257
95563
|
Object.entries(content).filter(([entryKey]) => entryKey !== key)
|
|
95258
95564
|
);
|
|
95259
95565
|
}
|
|
95260
|
-
function
|
|
95566
|
+
function isRecord14(value) {
|
|
95261
95567
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
95262
95568
|
}
|
|
95263
95569
|
|
|
95264
95570
|
// ../path-utils/src/index.ts
|
|
95265
95571
|
var PATH_SEPARATOR_REGEX2 = /\./g;
|
|
95266
95572
|
var BRACKET_ACCESS_REGEX2 = /\[([^\]]+)\]/g;
|
|
95267
|
-
function
|
|
95573
|
+
function isRecord15(value) {
|
|
95268
95574
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
95269
95575
|
}
|
|
95270
95576
|
function isPathContainer(value) {
|
|
95271
|
-
return Array.isArray(value) ||
|
|
95577
|
+
return Array.isArray(value) || isRecord15(value);
|
|
95272
95578
|
}
|
|
95273
95579
|
function createPathContainer(nextIsIndex) {
|
|
95274
95580
|
return nextIsIndex ? [] : {};
|
|
@@ -95387,7 +95693,7 @@ function extractBlockData(content) {
|
|
|
95387
95693
|
}
|
|
95388
95694
|
|
|
95389
95695
|
// ../content-editor/src/utils/assertNever.ts
|
|
95390
|
-
function
|
|
95696
|
+
function assertNever9(value, message2) {
|
|
95391
95697
|
throw new Error(`Unexpected value: ${String(value)}`);
|
|
95392
95698
|
}
|
|
95393
95699
|
function cloneRecord(value) {
|
|
@@ -96146,7 +96452,7 @@ function applyEditorCommand(snapshot, command2) {
|
|
|
96146
96452
|
return nextSnapshot;
|
|
96147
96453
|
}
|
|
96148
96454
|
default:
|
|
96149
|
-
return
|
|
96455
|
+
return assertNever9(command2);
|
|
96150
96456
|
}
|
|
96151
96457
|
}
|
|
96152
96458
|
function applyUserOperation(snapshot, operation) {
|
|
@@ -96234,7 +96540,7 @@ function applySystemOperation(snapshot, operation) {
|
|
|
96234
96540
|
case "replace-block-list":
|
|
96235
96541
|
return replaceEditorBlockList(snapshot, operation.next);
|
|
96236
96542
|
default:
|
|
96237
|
-
return
|
|
96543
|
+
return assertNever9(operation);
|
|
96238
96544
|
}
|
|
96239
96545
|
}
|
|
96240
96546
|
function hydrateMetadataSnapshot(snapshot, baseline, current, published) {
|
|
@@ -98319,16 +98625,16 @@ function unwrapResponse(result) {
|
|
|
98319
98625
|
}
|
|
98320
98626
|
|
|
98321
98627
|
// ../api/src/utils/isRecord.ts
|
|
98322
|
-
function
|
|
98628
|
+
function isRecord16(value) {
|
|
98323
98629
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
98324
98630
|
}
|
|
98325
98631
|
|
|
98326
98632
|
// ../api/src/utils/error-propagation.ts
|
|
98327
98633
|
function extractApiErrorMessage(body) {
|
|
98328
|
-
if (!
|
|
98634
|
+
if (!isRecord16(body)) {
|
|
98329
98635
|
return null;
|
|
98330
98636
|
}
|
|
98331
|
-
if (
|
|
98637
|
+
if (isRecord16(body.error)) {
|
|
98332
98638
|
if (typeof body.error.message === "string" && body.error.message.trim().length > 0) {
|
|
98333
98639
|
return body.error.message;
|
|
98334
98640
|
}
|
|
@@ -100111,7 +100417,7 @@ function toDrainFailure(effect, error) {
|
|
|
100111
100417
|
case "persist-remove":
|
|
100112
100418
|
return { kind: effect.type, message: message2 };
|
|
100113
100419
|
default:
|
|
100114
|
-
return
|
|
100420
|
+
return assertNever9(effect);
|
|
100115
100421
|
}
|
|
100116
100422
|
}
|
|
100117
100423
|
async function drainEditorEffect(effect, context) {
|
|
@@ -100123,7 +100429,7 @@ async function drainEditorEffect(effect, context) {
|
|
|
100123
100429
|
case "persist-remove":
|
|
100124
100430
|
return drainPersistRemoveEffect(effect, context);
|
|
100125
100431
|
default:
|
|
100126
|
-
return
|
|
100432
|
+
return assertNever9(effect);
|
|
100127
100433
|
}
|
|
100128
100434
|
}
|
|
100129
100435
|
async function drainEditorEffects(effects, context) {
|
|
@@ -113228,7 +113534,7 @@ ColorPicker.displayName = "ColorPicker";
|
|
|
113228
113534
|
function isObject2(subject) {
|
|
113229
113535
|
return Object.prototype.toString.call(subject) === "[object Object]";
|
|
113230
113536
|
}
|
|
113231
|
-
function
|
|
113537
|
+
function isRecord17(subject) {
|
|
113232
113538
|
return isObject2(subject) || Array.isArray(subject);
|
|
113233
113539
|
}
|
|
113234
113540
|
function canUseDOM2() {
|
|
@@ -113245,7 +113551,7 @@ function areOptionsEqual(optionsA, optionsB) {
|
|
|
113245
113551
|
const valueA = optionsA[key];
|
|
113246
113552
|
const valueB = optionsB[key];
|
|
113247
113553
|
if (typeof valueA === "function") return `${valueA}` === `${valueB}`;
|
|
113248
|
-
if (!
|
|
113554
|
+
if (!isRecord17(valueA) || !isRecord17(valueB)) return valueA === valueB;
|
|
113249
113555
|
return areOptionsEqual(valueA, valueB);
|
|
113250
113556
|
});
|
|
113251
113557
|
}
|
|
@@ -123088,7 +123394,7 @@ function ResizableSplitPane({
|
|
|
123088
123394
|
}
|
|
123089
123395
|
|
|
123090
123396
|
// ../block-form/src/utils/typeGuards.ts
|
|
123091
|
-
function
|
|
123397
|
+
function isRecord18(value) {
|
|
123092
123398
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
123093
123399
|
}
|
|
123094
123400
|
function isObjectRecord3(value) {
|
|
@@ -123346,9 +123652,9 @@ function createStoreBackend(options) {
|
|
|
123346
123652
|
},
|
|
123347
123653
|
reset: (values) => {
|
|
123348
123654
|
if (scope === "blocks") {
|
|
123349
|
-
getBlocksSlice().updateBlockBaseline?.(getBlockId(),
|
|
123655
|
+
getBlocksSlice().updateBlockBaseline?.(getBlockId(), isRecord18(values) ? values : null);
|
|
123350
123656
|
} else {
|
|
123351
|
-
const recordValues =
|
|
123657
|
+
const recordValues = isRecord18(values) ? values : null;
|
|
123352
123658
|
getRootSlice().hydrate?.(recordValues, recordValues);
|
|
123353
123659
|
}
|
|
123354
123660
|
},
|
|
@@ -123425,7 +123731,7 @@ function readSliderFieldUiConfig(ui) {
|
|
|
123425
123731
|
}
|
|
123426
123732
|
|
|
123427
123733
|
// ../block-form/src/manifest/utils.ts
|
|
123428
|
-
function
|
|
123734
|
+
function assertNever10(value) {
|
|
123429
123735
|
throw new Error(`Unhandled manifest variant: ${JSON.stringify(value)}`);
|
|
123430
123736
|
}
|
|
123431
123737
|
function getGroupChildFields(field) {
|
|
@@ -123483,7 +123789,7 @@ function toManifestFieldInput(field) {
|
|
|
123483
123789
|
case "entryPicker":
|
|
123484
123790
|
return field;
|
|
123485
123791
|
}
|
|
123486
|
-
return
|
|
123792
|
+
return assertNever10(field);
|
|
123487
123793
|
}
|
|
123488
123794
|
function numberFieldToManifestInput(field) {
|
|
123489
123795
|
const ui = readNumberFieldUiConfig(field.ui);
|
|
@@ -124117,7 +124423,7 @@ function shouldUseCanonicalSchema(field) {
|
|
|
124117
124423
|
case "button":
|
|
124118
124424
|
return false;
|
|
124119
124425
|
}
|
|
124120
|
-
return
|
|
124426
|
+
return assertNever10(field);
|
|
124121
124427
|
}
|
|
124122
124428
|
function createManifestValidation(manifest, options) {
|
|
124123
124429
|
const { fields: fields3, schema } = createManifestFormAdapter(manifest, {
|
|
@@ -125224,11 +125530,33 @@ function getVisibleWhenPredicates(visibleWhen) {
|
|
|
125224
125530
|
if (isVisibleWhenPredicate(visibleWhen)) {
|
|
125225
125531
|
return [visibleWhen];
|
|
125226
125532
|
}
|
|
125227
|
-
const allOf = visibleWhen.allOf;
|
|
125228
|
-
if (
|
|
125229
|
-
return [];
|
|
125533
|
+
const allOf = "allOf" in visibleWhen ? visibleWhen.allOf : void 0;
|
|
125534
|
+
if (Array.isArray(allOf)) {
|
|
125535
|
+
return allOf.flatMap((condition) => [...getVisibleWhenPredicates(condition)]);
|
|
125536
|
+
}
|
|
125537
|
+
const anyOf = "anyOf" in visibleWhen ? visibleWhen.anyOf : void 0;
|
|
125538
|
+
if (Array.isArray(anyOf)) {
|
|
125539
|
+
return anyOf.flatMap((condition) => [...getVisibleWhenPredicates(condition)]);
|
|
125540
|
+
}
|
|
125541
|
+
return [];
|
|
125542
|
+
}
|
|
125543
|
+
function evaluateVisibleWhen(visibleWhen, evaluatePredicate) {
|
|
125544
|
+
if (isVisibleWhenPredicate(visibleWhen)) {
|
|
125545
|
+
return evaluatePredicate(visibleWhen);
|
|
125546
|
+
}
|
|
125547
|
+
if ("allOf" in visibleWhen) {
|
|
125548
|
+
const conditions = visibleWhen.allOf;
|
|
125549
|
+
return conditions.length === 0 || conditions.every(
|
|
125550
|
+
(condition) => evaluateVisibleWhen(condition, evaluatePredicate)
|
|
125551
|
+
);
|
|
125552
|
+
}
|
|
125553
|
+
if ("anyOf" in visibleWhen) {
|
|
125554
|
+
const conditions = visibleWhen.anyOf;
|
|
125555
|
+
return conditions.length === 0 || conditions.some(
|
|
125556
|
+
(condition) => evaluateVisibleWhen(condition, evaluatePredicate)
|
|
125557
|
+
);
|
|
125230
125558
|
}
|
|
125231
|
-
return
|
|
125559
|
+
return true;
|
|
125232
125560
|
}
|
|
125233
125561
|
function evaluateVisibleWhenPredicate(condition, watchedValue) {
|
|
125234
125562
|
if (condition.equals !== void 0) {
|
|
@@ -125276,9 +125604,10 @@ function useRepeaterVisibility(field, backend, path) {
|
|
|
125276
125604
|
const satisfiesCondition = useMemo(() => {
|
|
125277
125605
|
if (!visibleWhen) return true;
|
|
125278
125606
|
if (conditions.length === 0) return true;
|
|
125279
|
-
return
|
|
125280
|
-
|
|
125281
|
-
|
|
125607
|
+
return evaluateVisibleWhen(visibleWhen, (condition) => {
|
|
125608
|
+
const index2 = conditions.indexOf(condition);
|
|
125609
|
+
return evaluateVisibleWhenPredicate(condition, watchedValues[index2]);
|
|
125610
|
+
});
|
|
125282
125611
|
}, [visibleWhen, conditions, watchedValues]);
|
|
125283
125612
|
return !isHidden2 && satisfiesCondition;
|
|
125284
125613
|
}
|
|
@@ -125292,7 +125621,7 @@ function useRepeaterRowErrors(field, index2, backend, basePath) {
|
|
|
125292
125621
|
const rowErrorNode = getErrorAtPath(errorsRoot, rowPath);
|
|
125293
125622
|
if (!rowErrorNode) return [];
|
|
125294
125623
|
const rowValues = backend.getValue(rowPath);
|
|
125295
|
-
const valueContext =
|
|
125624
|
+
const valueContext = isRecord18(rowValues) ? rowValues : {};
|
|
125296
125625
|
const baseSegments = rowPath.split(".").filter((s2) => s2.length > 0);
|
|
125297
125626
|
const results = [];
|
|
125298
125627
|
let fieldsToTraverse = [];
|
|
@@ -125331,7 +125660,7 @@ function useRepeaterRowErrors(field, index2, backend, basePath) {
|
|
|
125331
125660
|
const itemError = errorArray[itemIndex];
|
|
125332
125661
|
let nestedFields = [];
|
|
125333
125662
|
if (childRepeater.polymorphic && childRepeater.itemTypes) {
|
|
125334
|
-
const itemType =
|
|
125663
|
+
const itemType = isRecord18(itemValue) && typeof itemValue._type === "string" ? itemValue._type : Object.keys(childRepeater.itemTypes)[0] ?? "";
|
|
125335
125664
|
const typeSchema = itemType ? childRepeater.itemTypes[itemType] : void 0;
|
|
125336
125665
|
if (typeSchema) {
|
|
125337
125666
|
nestedFields = typeSchema.fields;
|
|
@@ -125363,13 +125692,13 @@ function getErrorAtPath(errors, path) {
|
|
|
125363
125692
|
const segments = path.split(".").filter((s2) => s2.length > 0);
|
|
125364
125693
|
let current = errors;
|
|
125365
125694
|
for (const segment of segments) {
|
|
125366
|
-
if (!
|
|
125695
|
+
if (!isRecord18(current)) return void 0;
|
|
125367
125696
|
current = current[segment];
|
|
125368
125697
|
}
|
|
125369
125698
|
return current;
|
|
125370
125699
|
}
|
|
125371
125700
|
function getChildValue(node, key) {
|
|
125372
|
-
if (
|
|
125701
|
+
if (isRecord18(node)) {
|
|
125373
125702
|
return node[key];
|
|
125374
125703
|
}
|
|
125375
125704
|
return void 0;
|
|
@@ -125384,7 +125713,7 @@ function extractMessage(error) {
|
|
|
125384
125713
|
}
|
|
125385
125714
|
return void 0;
|
|
125386
125715
|
}
|
|
125387
|
-
if (
|
|
125716
|
+
if (isRecord18(error) && typeof error.message === "string") {
|
|
125388
125717
|
return error.message;
|
|
125389
125718
|
}
|
|
125390
125719
|
return void 0;
|
|
@@ -125847,7 +126176,7 @@ var BlockApiError = class extends Error {
|
|
|
125847
126176
|
this.name = "BlockApiError";
|
|
125848
126177
|
}
|
|
125849
126178
|
};
|
|
125850
|
-
function
|
|
126179
|
+
function isRecord19(value) {
|
|
125851
126180
|
return typeof value === "object" && value !== null;
|
|
125852
126181
|
}
|
|
125853
126182
|
function isJsonResponseContentType(contentType) {
|
|
@@ -125870,10 +126199,10 @@ async function parseJsonBody(response) {
|
|
|
125870
126199
|
}
|
|
125871
126200
|
}
|
|
125872
126201
|
function getBlockApiErrorDetails(data) {
|
|
125873
|
-
if (!
|
|
126202
|
+
if (!isRecord19(data)) {
|
|
125874
126203
|
return {};
|
|
125875
126204
|
}
|
|
125876
|
-
const nestedError =
|
|
126205
|
+
const nestedError = isRecord19(data.error) ? data.error : void 0;
|
|
125877
126206
|
const message2 = typeof nestedError?.message === "string" ? nestedError.message : typeof data.message === "string" ? data.message : void 0;
|
|
125878
126207
|
const code = typeof nestedError?.code === "string" ? nestedError.code : typeof data.code === "string" ? data.code : void 0;
|
|
125879
126208
|
return { message: message2, code };
|
|
@@ -126553,6 +126882,24 @@ function useBlockApi() {
|
|
|
126553
126882
|
}
|
|
126554
126883
|
return client;
|
|
126555
126884
|
}
|
|
126885
|
+
|
|
126886
|
+
// ../blocks/src/system/runtime/api/types.ts
|
|
126887
|
+
function discountAvailabilityHasDiscounts(availability) {
|
|
126888
|
+
return availability.type !== "none";
|
|
126889
|
+
}
|
|
126890
|
+
function discountAvailabilityAllowsManualEntry(availability) {
|
|
126891
|
+
return "manualCodeEntryAllowed" in availability && availability.manualCodeEntryAllowed;
|
|
126892
|
+
}
|
|
126893
|
+
function getAutoAppliedDiscountPreview(availability) {
|
|
126894
|
+
switch (availability.type) {
|
|
126895
|
+
case "none":
|
|
126896
|
+
case "manual":
|
|
126897
|
+
return null;
|
|
126898
|
+
case "auto":
|
|
126899
|
+
case "auto_and_manual":
|
|
126900
|
+
return availability.autoAppliedDiscount;
|
|
126901
|
+
}
|
|
126902
|
+
}
|
|
126556
126903
|
function AltchaWidget({
|
|
126557
126904
|
challengeUrl,
|
|
126558
126905
|
onSolutionChange,
|
|
@@ -126596,7 +126943,7 @@ function AltchaWidget({
|
|
|
126596
126943
|
}
|
|
126597
126944
|
};
|
|
126598
126945
|
}, [challengeUrl, auto, hidelogo, className, onSolutionChange]);
|
|
126599
|
-
return
|
|
126946
|
+
return createElement("div", { ref: containerRef });
|
|
126600
126947
|
}
|
|
126601
126948
|
|
|
126602
126949
|
// ../altcha/src/client.ts
|
|
@@ -126817,7 +127164,7 @@ function availableDatesReducer(state, action) {
|
|
|
126817
127164
|
case "load-failed":
|
|
126818
127165
|
return { tag: "error", data: state.data, message: action.message };
|
|
126819
127166
|
default:
|
|
126820
|
-
return
|
|
127167
|
+
return assertNever8(action);
|
|
126821
127168
|
}
|
|
126822
127169
|
}
|
|
126823
127170
|
|
|
@@ -126938,7 +127285,7 @@ function getAvailableSlots(state) {
|
|
|
126938
127285
|
case "error":
|
|
126939
127286
|
return state.slots;
|
|
126940
127287
|
default:
|
|
126941
|
-
return
|
|
127288
|
+
return assertNever8(state);
|
|
126942
127289
|
}
|
|
126943
127290
|
}
|
|
126944
127291
|
function hasLoadedAvailableSlots(state) {
|
|
@@ -126952,7 +127299,7 @@ function hasLoadedAvailableSlots(state) {
|
|
|
126952
127299
|
case "loaded":
|
|
126953
127300
|
return true;
|
|
126954
127301
|
default:
|
|
126955
|
-
return
|
|
127302
|
+
return assertNever8(state);
|
|
126956
127303
|
}
|
|
126957
127304
|
}
|
|
126958
127305
|
function isLoadingAvailableSlots(state) {
|
|
@@ -126986,7 +127333,7 @@ function availableSlotsReducer(state, action) {
|
|
|
126986
127333
|
message: action.message
|
|
126987
127334
|
};
|
|
126988
127335
|
default:
|
|
126989
|
-
return
|
|
127336
|
+
return assertNever8(action);
|
|
126990
127337
|
}
|
|
126991
127338
|
}
|
|
126992
127339
|
|
|
@@ -127092,7 +127439,7 @@ function bookingSubmissionReducer(state, action) {
|
|
|
127092
127439
|
case "feedback-cleared":
|
|
127093
127440
|
return clearWorkflowFeedback(state);
|
|
127094
127441
|
default:
|
|
127095
|
-
return
|
|
127442
|
+
return assertNever8(action);
|
|
127096
127443
|
}
|
|
127097
127444
|
}
|
|
127098
127445
|
function selectIsSubmitting(state) {
|
|
@@ -127136,7 +127483,7 @@ function useBookingSubmission(_siteId) {
|
|
|
127136
127483
|
type: "submission-succeeded",
|
|
127137
127484
|
message: response.type === "checkout_redirect" ? "Redirecting to secure checkout..." : "Booking submitted successfully."
|
|
127138
127485
|
});
|
|
127139
|
-
return
|
|
127486
|
+
return okWith(response);
|
|
127140
127487
|
} catch (error) {
|
|
127141
127488
|
console.error("Booking submission error:", error);
|
|
127142
127489
|
const message2 = error instanceof Error ? error.message : "Failed to book appointment";
|
|
@@ -127155,64 +127502,156 @@ function useBookingSubmission(_siteId) {
|
|
|
127155
127502
|
isSubmitting: selectIsSubmitting(state)
|
|
127156
127503
|
};
|
|
127157
127504
|
}
|
|
127505
|
+
|
|
127506
|
+
// ../blocks/src/system/runtime/nodes/event-registration/useDiscountCodeUi.state.ts
|
|
127507
|
+
var initialDiscountCodeUiState = {
|
|
127508
|
+
discountUiOpen: false,
|
|
127509
|
+
discountCode: "",
|
|
127510
|
+
availability: { tag: "disabled" }
|
|
127511
|
+
};
|
|
127512
|
+
function getDiscountContextKey(context) {
|
|
127513
|
+
if (!context) return "disabled";
|
|
127514
|
+
switch (context.type) {
|
|
127515
|
+
case "event":
|
|
127516
|
+
return [
|
|
127517
|
+
context.type,
|
|
127518
|
+
context.eventSeriesId,
|
|
127519
|
+
context.eventCategoryId ?? "",
|
|
127520
|
+
context.ticketsCount ?? ""
|
|
127521
|
+
].join(":");
|
|
127522
|
+
case "appointment":
|
|
127523
|
+
return [context.type, context.serviceId].join(":");
|
|
127524
|
+
case "course":
|
|
127525
|
+
return [context.type, context.courseId].join(":");
|
|
127526
|
+
case "pass":
|
|
127527
|
+
return [context.type, context.passId].join(":");
|
|
127528
|
+
case "membership":
|
|
127529
|
+
return [context.type, context.membershipId].join(":");
|
|
127530
|
+
case "product":
|
|
127531
|
+
return [context.type, context.productId, context.productCategoryId ?? ""].join(":");
|
|
127532
|
+
}
|
|
127533
|
+
}
|
|
127534
|
+
function buildDiscountAvailabilityRequestPlan(options) {
|
|
127535
|
+
if (!options.discountContext) {
|
|
127536
|
+
return { ok: false, key: "disabled" };
|
|
127537
|
+
}
|
|
127538
|
+
const subtotalCents = options.subtotalCents;
|
|
127539
|
+
const key = [
|
|
127540
|
+
getDiscountContextKey(options.discountContext),
|
|
127541
|
+
subtotalCents ?? ""
|
|
127542
|
+
].join("|");
|
|
127543
|
+
return {
|
|
127544
|
+
ok: true,
|
|
127545
|
+
key,
|
|
127546
|
+
request: {
|
|
127547
|
+
context: options.discountContext,
|
|
127548
|
+
...subtotalCents !== void 0 ? { subtotalCents } : {}
|
|
127549
|
+
}
|
|
127550
|
+
};
|
|
127551
|
+
}
|
|
127552
|
+
function discountAvailabilityStateFromResponse(response) {
|
|
127553
|
+
if (!discountAvailabilityHasDiscounts(response)) {
|
|
127554
|
+
return { tag: "unavailable" };
|
|
127555
|
+
}
|
|
127556
|
+
return {
|
|
127557
|
+
tag: "available",
|
|
127558
|
+
manualCodeEntryAllowed: discountAvailabilityAllowsManualEntry(response),
|
|
127559
|
+
autoAppliedDiscount: getAutoAppliedDiscountPreview(response)
|
|
127560
|
+
};
|
|
127561
|
+
}
|
|
127562
|
+
function discountCodeUiReducer(state, event) {
|
|
127563
|
+
switch (event.type) {
|
|
127564
|
+
case "availability-disabled":
|
|
127565
|
+
return initialDiscountCodeUiState;
|
|
127566
|
+
case "availability-loading":
|
|
127567
|
+
return {
|
|
127568
|
+
...state,
|
|
127569
|
+
availability: { tag: "loading" }
|
|
127570
|
+
};
|
|
127571
|
+
case "availability-loaded": {
|
|
127572
|
+
const availability = discountAvailabilityStateFromResponse(event.response);
|
|
127573
|
+
if (availability.tag !== "available" || !availability.manualCodeEntryAllowed) {
|
|
127574
|
+
return {
|
|
127575
|
+
...state,
|
|
127576
|
+
discountUiOpen: false,
|
|
127577
|
+
discountCode: "",
|
|
127578
|
+
availability
|
|
127579
|
+
};
|
|
127580
|
+
}
|
|
127581
|
+
return {
|
|
127582
|
+
...state,
|
|
127583
|
+
availability
|
|
127584
|
+
};
|
|
127585
|
+
}
|
|
127586
|
+
case "availability-failed":
|
|
127587
|
+
return {
|
|
127588
|
+
...state,
|
|
127589
|
+
discountUiOpen: false,
|
|
127590
|
+
discountCode: "",
|
|
127591
|
+
availability: { tag: "error" }
|
|
127592
|
+
};
|
|
127593
|
+
case "discount-code-changed":
|
|
127594
|
+
return {
|
|
127595
|
+
...state,
|
|
127596
|
+
discountCode: event.code
|
|
127597
|
+
};
|
|
127598
|
+
case "discount-ui-open-changed":
|
|
127599
|
+
return {
|
|
127600
|
+
...state,
|
|
127601
|
+
discountUiOpen: event.isOpen
|
|
127602
|
+
};
|
|
127603
|
+
}
|
|
127604
|
+
}
|
|
127605
|
+
|
|
127606
|
+
// ../blocks/src/system/runtime/nodes/event-registration/useDiscountCodeUi.ts
|
|
127607
|
+
function useStableDiscountAvailabilityRequestPlan(options) {
|
|
127608
|
+
const nextPlan = buildDiscountAvailabilityRequestPlan(options);
|
|
127609
|
+
const planRef = useRef(nextPlan);
|
|
127610
|
+
if (planRef.current.key !== nextPlan.key) {
|
|
127611
|
+
planRef.current = nextPlan;
|
|
127612
|
+
}
|
|
127613
|
+
return planRef.current;
|
|
127614
|
+
}
|
|
127158
127615
|
function useDiscountCodeUi(options) {
|
|
127159
|
-
const [
|
|
127160
|
-
|
|
127161
|
-
|
|
127162
|
-
|
|
127163
|
-
const
|
|
127164
|
-
const [discountsAvailableLoading, setDiscountsAvailableLoading] = useState(false);
|
|
127616
|
+
const [state, dispatch] = useReducer(
|
|
127617
|
+
discountCodeUiReducer,
|
|
127618
|
+
initialDiscountCodeUiState
|
|
127619
|
+
);
|
|
127620
|
+
const requestPlan = useStableDiscountAvailabilityRequestPlan(options);
|
|
127165
127621
|
useEffect(() => {
|
|
127166
127622
|
let cancelled = false;
|
|
127167
127623
|
async function checkDiscountAvailability() {
|
|
127168
|
-
if (!
|
|
127169
|
-
|
|
127170
|
-
setManualCodeEntryAllowed(false);
|
|
127171
|
-
setAutoAppliedDiscount(null);
|
|
127172
|
-
setDiscountsAvailableLoading(false);
|
|
127173
|
-
setDiscountUiOpen(false);
|
|
127174
|
-
setDiscountCode("");
|
|
127624
|
+
if (!requestPlan.ok) {
|
|
127625
|
+
dispatch({ type: "availability-disabled" });
|
|
127175
127626
|
return;
|
|
127176
127627
|
}
|
|
127177
|
-
|
|
127628
|
+
dispatch({ type: "availability-loading" });
|
|
127178
127629
|
try {
|
|
127179
|
-
const res = await options.api.getDiscountsAvailable(
|
|
127180
|
-
context: options.discountContext,
|
|
127181
|
-
subtotalCents: options.subtotalCents
|
|
127182
|
-
});
|
|
127630
|
+
const res = await options.api.getDiscountsAvailable(requestPlan.request);
|
|
127183
127631
|
if (cancelled) return;
|
|
127184
|
-
|
|
127185
|
-
setManualCodeEntryAllowed(res.manualCodeEntryAllowed);
|
|
127186
|
-
setAutoAppliedDiscount(res.autoAppliedDiscount);
|
|
127187
|
-
if (!res.hasDiscounts || !res.manualCodeEntryAllowed) {
|
|
127188
|
-
setDiscountUiOpen(false);
|
|
127189
|
-
setDiscountCode("");
|
|
127190
|
-
}
|
|
127632
|
+
dispatch({ type: "availability-loaded", response: res });
|
|
127191
127633
|
} catch {
|
|
127192
127634
|
if (cancelled) return;
|
|
127193
|
-
|
|
127194
|
-
setManualCodeEntryAllowed(false);
|
|
127195
|
-
setAutoAppliedDiscount(null);
|
|
127196
|
-
setDiscountUiOpen(false);
|
|
127197
|
-
setDiscountCode("");
|
|
127198
|
-
} finally {
|
|
127199
|
-
if (!cancelled) setDiscountsAvailableLoading(false);
|
|
127635
|
+
dispatch({ type: "availability-failed" });
|
|
127200
127636
|
}
|
|
127201
127637
|
}
|
|
127202
127638
|
void checkDiscountAvailability();
|
|
127203
127639
|
return () => {
|
|
127204
127640
|
cancelled = true;
|
|
127205
127641
|
};
|
|
127206
|
-
}, [options.api,
|
|
127642
|
+
}, [options.api, requestPlan]);
|
|
127643
|
+
const availability = state.availability;
|
|
127644
|
+
const isAvailable = availability.tag === "available";
|
|
127645
|
+
const manualCodeEntryAllowed = isAvailable ? availability.manualCodeEntryAllowed : false;
|
|
127207
127646
|
return {
|
|
127208
|
-
discountUiOpen,
|
|
127209
|
-
setDiscountUiOpen,
|
|
127210
|
-
discountCode,
|
|
127211
|
-
setDiscountCode,
|
|
127212
|
-
discountsAvailable,
|
|
127647
|
+
discountUiOpen: state.discountUiOpen,
|
|
127648
|
+
setDiscountUiOpen: (isOpen) => dispatch({ type: "discount-ui-open-changed", isOpen }),
|
|
127649
|
+
discountCode: state.discountCode,
|
|
127650
|
+
setDiscountCode: (code) => dispatch({ type: "discount-code-changed", code }),
|
|
127651
|
+
discountsAvailable: isAvailable,
|
|
127213
127652
|
manualCodeEntryAllowed,
|
|
127214
|
-
autoAppliedDiscount,
|
|
127215
|
-
discountsAvailableLoading
|
|
127653
|
+
autoAppliedDiscount: isAvailable ? availability.autoAppliedDiscount : null,
|
|
127654
|
+
discountsAvailableLoading: availability.tag === "loading"
|
|
127216
127655
|
};
|
|
127217
127656
|
}
|
|
127218
127657
|
|
|
@@ -127366,8 +127805,10 @@ function buildBookingPaymentOptionViewModel(input) {
|
|
|
127366
127805
|
totalAmountCents: input.totalCents,
|
|
127367
127806
|
config: input.option.config
|
|
127368
127807
|
});
|
|
127808
|
+
const remainingBalance = Math.max(0, input.totalCents - dueToday);
|
|
127369
127809
|
const formattedTotal = formatPrice(input.totalCents, input.currency, input.locale);
|
|
127370
127810
|
const formattedDueToday = formatPrice(dueToday, input.currency, input.locale);
|
|
127811
|
+
const formattedRemainingBalance = formatPrice(remainingBalance, input.currency, input.locale);
|
|
127371
127812
|
const dueAt = resolveFlexibleBalanceDueAt({
|
|
127372
127813
|
bookingStartAt: input.bookingStartAt ?? (/* @__PURE__ */ new Date()).toISOString(),
|
|
127373
127814
|
dueDateRule: input.option.config.dueDateRule
|
|
@@ -127384,6 +127825,7 @@ function buildBookingPaymentOptionViewModel(input) {
|
|
|
127384
127825
|
summaryRows: [
|
|
127385
127826
|
{ label: "Total", value: formattedTotal },
|
|
127386
127827
|
{ label: "Due today", value: formattedDueToday },
|
|
127828
|
+
{ label: "Remaining balance", value: formattedRemainingBalance },
|
|
127387
127829
|
{ label: "Balance due by", value: formatScheduleDate(dueAt, input.locale) },
|
|
127388
127830
|
{
|
|
127389
127831
|
label: "Deposit policy",
|
|
@@ -127395,7 +127837,7 @@ function buildBookingPaymentOptionViewModel(input) {
|
|
|
127395
127837
|
};
|
|
127396
127838
|
}
|
|
127397
127839
|
default:
|
|
127398
|
-
return
|
|
127840
|
+
return assertNever8(input.option);
|
|
127399
127841
|
}
|
|
127400
127842
|
}
|
|
127401
127843
|
function buildInstalmentSchedulePreview(input) {
|
|
@@ -127452,7 +127894,7 @@ function buildInstalmentSchedulePreview(input) {
|
|
|
127452
127894
|
})));
|
|
127453
127895
|
}
|
|
127454
127896
|
default:
|
|
127455
|
-
return
|
|
127897
|
+
return assertNever8(input.option.plan);
|
|
127456
127898
|
}
|
|
127457
127899
|
}
|
|
127458
127900
|
function getPaymentCadenceLabel(plan) {
|
|
@@ -127676,7 +128118,7 @@ function bookingFlowReducer(state, event) {
|
|
|
127676
128118
|
case "reset":
|
|
127677
128119
|
return event.initial;
|
|
127678
128120
|
default:
|
|
127679
|
-
return
|
|
128121
|
+
return assertNever8(event);
|
|
127680
128122
|
}
|
|
127681
128123
|
}
|
|
127682
128124
|
function clearAvailabilityFeedback(feedback) {
|
|
@@ -127805,7 +128247,7 @@ function validateBookingStep(input) {
|
|
|
127805
128247
|
return Object.keys(errors).length > 0 ? { ok: false, errors: createFieldBookingValidationErrors(errors) } : { ok: true };
|
|
127806
128248
|
}
|
|
127807
128249
|
default:
|
|
127808
|
-
return
|
|
128250
|
+
return assertNever8(input.stepId);
|
|
127809
128251
|
}
|
|
127810
128252
|
}
|
|
127811
128253
|
function validateBookingFields(input) {
|
|
@@ -128097,7 +128539,7 @@ function resolveAppointmentPackagesModel(input) {
|
|
|
128097
128539
|
};
|
|
128098
128540
|
}
|
|
128099
128541
|
default:
|
|
128100
|
-
return
|
|
128542
|
+
return assertNever8(input.state);
|
|
128101
128543
|
}
|
|
128102
128544
|
}
|
|
128103
128545
|
function toHeadlessEligibleAppointmentPackage(appointmentPackage) {
|
|
@@ -128421,7 +128863,10 @@ function useHeadlessBookingFlow(options) {
|
|
|
128421
128863
|
state.selectedDate,
|
|
128422
128864
|
state.selectedSlot
|
|
128423
128865
|
]);
|
|
128424
|
-
const appointmentDiscountContext =
|
|
128866
|
+
const appointmentDiscountContext = useMemo(
|
|
128867
|
+
() => selectedService && (selectedService.priceAmount ?? 0) > 0 ? { type: "appointment", serviceId: selectedService.id } : null,
|
|
128868
|
+
[selectedService?.id, selectedService?.priceAmount]
|
|
128869
|
+
);
|
|
128425
128870
|
const discountUi = useDiscountCodeUi({
|
|
128426
128871
|
api,
|
|
128427
128872
|
discountContext: appointmentDiscountContext,
|
|
@@ -128807,7 +129252,7 @@ function pollingReducer(state, action) {
|
|
|
128807
129252
|
case "timeout":
|
|
128808
129253
|
return state;
|
|
128809
129254
|
default:
|
|
128810
|
-
return
|
|
129255
|
+
return assertNever8(state);
|
|
128811
129256
|
}
|
|
128812
129257
|
case "polling-timed-out":
|
|
128813
129258
|
return {
|
|
@@ -128816,7 +129261,7 @@ function pollingReducer(state, action) {
|
|
|
128816
129261
|
error: new Error("Polling timed out")
|
|
128817
129262
|
};
|
|
128818
129263
|
default:
|
|
128819
|
-
return
|
|
129264
|
+
return assertNever8(action);
|
|
128820
129265
|
}
|
|
128821
129266
|
}
|
|
128822
129267
|
|
|
@@ -129342,7 +129787,7 @@ function DefaultBookingStepContent({
|
|
|
129342
129787
|
case "custom-fields":
|
|
129343
129788
|
return /* @__PURE__ */ jsx(DefaultDynamicFields, { fields: booking.fields.items, booking });
|
|
129344
129789
|
default:
|
|
129345
|
-
return
|
|
129790
|
+
return assertNever8(stepId);
|
|
129346
129791
|
}
|
|
129347
129792
|
}
|
|
129348
129793
|
function DefaultServiceSelectionStep({
|
|
@@ -130649,12 +131094,18 @@ function createInitialRegistrationFlowState(hasPreSelectedContext) {
|
|
|
130649
131094
|
};
|
|
130650
131095
|
}
|
|
130651
131096
|
function selectionEquals(a2, b2) {
|
|
130652
|
-
return a2.method === b2.method && a2.passId === b2.passId && a2.membershipId === b2.membershipId && a2.bundlePassId === b2.bundlePassId && a2.bundleMembershipId === b2.bundleMembershipId && a2.productName === b2.productName && a2.productDescription === b2.productDescription && a2.productPrice === b2.productPrice && a2.productCurrency === b2.productCurrency && a2.productInterval === b2.productInterval;
|
|
131097
|
+
return a2.method === b2.method && a2.passId === b2.passId && a2.membershipId === b2.membershipId && a2.bundlePassId === b2.bundlePassId && a2.bundleMembershipId === b2.bundleMembershipId && a2.productName === b2.productName && a2.productDescription === b2.productDescription && a2.productPrice === b2.productPrice && a2.productCurrency === b2.productCurrency && a2.productInterval === b2.productInterval && a2.collectionOptionKind === b2.collectionOptionKind;
|
|
130653
131098
|
}
|
|
130654
131099
|
function withDefaultSelection(selection) {
|
|
130655
131100
|
if (!selection || !selection.method) {
|
|
130656
131101
|
return { method: null };
|
|
130657
131102
|
}
|
|
131103
|
+
if (selection.method === "stripe") {
|
|
131104
|
+
return {
|
|
131105
|
+
...selection,
|
|
131106
|
+
collectionOptionKind: selection.collectionOptionKind ?? "upfront"
|
|
131107
|
+
};
|
|
131108
|
+
}
|
|
130658
131109
|
return selection;
|
|
130659
131110
|
}
|
|
130660
131111
|
function computeAutoSelection(input) {
|
|
@@ -130680,7 +131131,7 @@ function computeAutoSelection(input) {
|
|
|
130680
131131
|
}
|
|
130681
131132
|
}
|
|
130682
131133
|
if (eligibility.canPayDirectly && eligibility.price) {
|
|
130683
|
-
return { method: "stripe" };
|
|
131134
|
+
return { method: "stripe", collectionOptionKind: "upfront" };
|
|
130684
131135
|
}
|
|
130685
131136
|
return { method: null };
|
|
130686
131137
|
}
|
|
@@ -130698,11 +131149,17 @@ function isSelectionValid(input) {
|
|
|
130698
131149
|
case "pass":
|
|
130699
131150
|
return isAuthenticated && ticketsCount === 1 && !!selection.passId && eligibility.eligiblePasses.some((pass) => pass.id === selection.passId);
|
|
130700
131151
|
case "membership":
|
|
130701
|
-
return isAuthenticated && ticketsCount === 1 && !!selection.membershipId && eligibility.eligibleMemberships.some(
|
|
131152
|
+
return isAuthenticated && ticketsCount === 1 && !!selection.membershipId && eligibility.eligibleMemberships.some(
|
|
131153
|
+
(membership) => membership.id === selection.membershipId
|
|
131154
|
+
);
|
|
130702
131155
|
case "pass_bundle":
|
|
130703
|
-
return ticketsCount === 1 && !!selection.bundlePassId && eligibility.availablePasses.some(
|
|
131156
|
+
return ticketsCount === 1 && !!selection.bundlePassId && eligibility.availablePasses.some(
|
|
131157
|
+
(pass) => pass.id === selection.bundlePassId
|
|
131158
|
+
);
|
|
130704
131159
|
case "membership_bundle":
|
|
130705
|
-
return ticketsCount === 1 && !!selection.bundleMembershipId && eligibility.availableMemberships.some(
|
|
131160
|
+
return ticketsCount === 1 && !!selection.bundleMembershipId && eligibility.availableMemberships.some(
|
|
131161
|
+
(membership) => membership.id === selection.bundleMembershipId
|
|
131162
|
+
);
|
|
130706
131163
|
default:
|
|
130707
131164
|
return false;
|
|
130708
131165
|
}
|
|
@@ -130749,9 +131206,15 @@ function registrationFlowReducer(state, action) {
|
|
|
130749
131206
|
ticketsCount: Math.max(1, action.ticketsCount)
|
|
130750
131207
|
});
|
|
130751
131208
|
case "set-authenticated":
|
|
130752
|
-
return normalizeRegistrationFlowState({
|
|
131209
|
+
return normalizeRegistrationFlowState({
|
|
131210
|
+
...state,
|
|
131211
|
+
isAuthenticated: action.isAuthenticated
|
|
131212
|
+
});
|
|
130753
131213
|
case "eligibility-updated":
|
|
130754
|
-
return normalizeRegistrationFlowState({
|
|
131214
|
+
return normalizeRegistrationFlowState({
|
|
131215
|
+
...state,
|
|
131216
|
+
eligibility: action.eligibility
|
|
131217
|
+
});
|
|
130755
131218
|
case "set-manual-payment-selection":
|
|
130756
131219
|
return normalizeRegistrationFlowState({
|
|
130757
131220
|
...state,
|
|
@@ -130763,7 +131226,7 @@ function registrationFlowReducer(state, action) {
|
|
|
130763
131226
|
return normalizeRegistrationFlowState({
|
|
130764
131227
|
...state,
|
|
130765
131228
|
passOptOut: true,
|
|
130766
|
-
paymentSelection: { method: "stripe" },
|
|
131229
|
+
paymentSelection: { method: "stripe", collectionOptionKind: "upfront" },
|
|
130767
131230
|
selectionSource: "manual"
|
|
130768
131231
|
});
|
|
130769
131232
|
case "event-changed":
|
|
@@ -130809,7 +131272,10 @@ function normalizeEventRegistrationMaxTickets(value) {
|
|
|
130809
131272
|
function resolveEventRegistrationSubmitPlan(input) {
|
|
130810
131273
|
const selection = input.paymentSelection.method ? input.paymentSelection : void 0;
|
|
130811
131274
|
if (input.canJoinWaitlist) {
|
|
130812
|
-
return {
|
|
131275
|
+
return {
|
|
131276
|
+
ok: true,
|
|
131277
|
+
args: withOptionalSelection({ method: "free" }, selection)
|
|
131278
|
+
};
|
|
130813
131279
|
}
|
|
130814
131280
|
switch (input.paymentSelection.method) {
|
|
130815
131281
|
case "pass":
|
|
@@ -130824,19 +131290,28 @@ function resolveEventRegistrationSubmitPlan(input) {
|
|
|
130824
131290
|
return input.paymentSelection.membershipId ? {
|
|
130825
131291
|
ok: true,
|
|
130826
131292
|
args: withOptionalSelection(
|
|
130827
|
-
{
|
|
131293
|
+
{
|
|
131294
|
+
method: "membership",
|
|
131295
|
+
membershipId: input.paymentSelection.membershipId
|
|
131296
|
+
},
|
|
130828
131297
|
selection
|
|
130829
131298
|
)
|
|
130830
131299
|
} : missingPaymentSelection();
|
|
130831
131300
|
case "free":
|
|
130832
|
-
return {
|
|
131301
|
+
return {
|
|
131302
|
+
ok: true,
|
|
131303
|
+
args: withOptionalSelection({ method: "free" }, selection)
|
|
131304
|
+
};
|
|
130833
131305
|
case null:
|
|
130834
131306
|
return input.eventRequiresPayment ? missingPaymentSelection() : { ok: true, args: { method: "free" } };
|
|
130835
131307
|
case "pass_bundle":
|
|
130836
131308
|
return input.paymentSelection.bundlePassId ? {
|
|
130837
131309
|
ok: true,
|
|
130838
131310
|
args: withOptionalSelection(
|
|
130839
|
-
{
|
|
131311
|
+
{
|
|
131312
|
+
method: "pass_bundle",
|
|
131313
|
+
passId: input.paymentSelection.bundlePassId
|
|
131314
|
+
},
|
|
130840
131315
|
selection
|
|
130841
131316
|
)
|
|
130842
131317
|
} : missingPaymentSelection();
|
|
@@ -130852,7 +131327,10 @@ function resolveEventRegistrationSubmitPlan(input) {
|
|
|
130852
131327
|
)
|
|
130853
131328
|
} : missingPaymentSelection();
|
|
130854
131329
|
case "stripe":
|
|
130855
|
-
return {
|
|
131330
|
+
return {
|
|
131331
|
+
ok: true,
|
|
131332
|
+
args: withOptionalSelection({ method: "stripe" }, selection)
|
|
131333
|
+
};
|
|
130856
131334
|
}
|
|
130857
131335
|
}
|
|
130858
131336
|
function withOptionalSelection(args, selection) {
|
|
@@ -131006,7 +131484,7 @@ function eligibilityLookupReducer(state, action) {
|
|
|
131006
131484
|
error: action.message
|
|
131007
131485
|
};
|
|
131008
131486
|
default:
|
|
131009
|
-
return
|
|
131487
|
+
return assertNever8(action);
|
|
131010
131488
|
}
|
|
131011
131489
|
}
|
|
131012
131490
|
var initialExistingRegistrationLookupState = {
|
|
@@ -131028,7 +131506,7 @@ function existingRegistrationLookupReducer(state, action) {
|
|
|
131028
131506
|
registration: action.registration
|
|
131029
131507
|
};
|
|
131030
131508
|
default:
|
|
131031
|
-
return
|
|
131509
|
+
return assertNever8(action);
|
|
131032
131510
|
}
|
|
131033
131511
|
}
|
|
131034
131512
|
|
|
@@ -131936,10 +132414,99 @@ function SelectableOptionCard(props2) {
|
|
|
131936
132414
|
}
|
|
131937
132415
|
);
|
|
131938
132416
|
}
|
|
132417
|
+
|
|
132418
|
+
// ../blocks/src/system/runtime/nodes/event-registration/eventPaymentOptions.ts
|
|
132419
|
+
var DEFAULT_EVENT_DIRECT_PAYMENT_OPTION = {
|
|
132420
|
+
kind: "upfront"
|
|
132421
|
+
};
|
|
132422
|
+
function buildEventRegistrationPaymentOptionsViewModel(input) {
|
|
132423
|
+
const supportedOptions = selectSupportedEventDirectPaymentOptions(
|
|
132424
|
+
input.paymentTerms
|
|
132425
|
+
);
|
|
132426
|
+
const selection = buildBookingPaymentSelectionViewModel({
|
|
132427
|
+
serviceTitle: input.eventTitle,
|
|
132428
|
+
paymentTerms: { allowedOptions: [...supportedOptions] },
|
|
132429
|
+
priceAmount: input.totalPriceCents,
|
|
132430
|
+
priceCurrency: input.currency,
|
|
132431
|
+
bookingStartAt: input.startsAt,
|
|
132432
|
+
locale: input.locale
|
|
132433
|
+
});
|
|
132434
|
+
return {
|
|
132435
|
+
mode: selection.mode,
|
|
132436
|
+
sectionTitle: selection.sectionTitle,
|
|
132437
|
+
options: selection.options.map(
|
|
132438
|
+
(option) => toEventDirectPaymentOption(option, selection.mode)
|
|
132439
|
+
)
|
|
132440
|
+
};
|
|
132441
|
+
}
|
|
132442
|
+
function selectSupportedEventDirectPaymentOptions(paymentTerms) {
|
|
132443
|
+
const supported = paymentTerms?.allowedOptions.filter(isSupportedEventDirectPaymentOption) ?? [];
|
|
132444
|
+
return supported.length > 0 ? supported : [DEFAULT_EVENT_DIRECT_PAYMENT_OPTION];
|
|
132445
|
+
}
|
|
132446
|
+
function isSupportedEventDirectPaymentOption(option) {
|
|
132447
|
+
return option.kind === "upfront" || option.kind === "flexible_balance";
|
|
132448
|
+
}
|
|
132449
|
+
function toEventDirectPaymentOption(option, mode) {
|
|
132450
|
+
switch (option.kind) {
|
|
132451
|
+
case "upfront":
|
|
132452
|
+
return {
|
|
132453
|
+
...option,
|
|
132454
|
+
kind: "upfront",
|
|
132455
|
+
label: mode === "choice_required" ? "Pay in full now" : "Pay by card"
|
|
132456
|
+
};
|
|
132457
|
+
case "flexible_balance":
|
|
132458
|
+
return {
|
|
132459
|
+
...option,
|
|
132460
|
+
kind: "flexible_balance",
|
|
132461
|
+
label: "Pay deposit now"
|
|
132462
|
+
};
|
|
132463
|
+
case "deferred_manual":
|
|
132464
|
+
case "instalment_plan":
|
|
132465
|
+
throw new Error(
|
|
132466
|
+
`Unsupported event registration payment option: ${option.kind}`
|
|
132467
|
+
);
|
|
132468
|
+
}
|
|
132469
|
+
}
|
|
132470
|
+
function resolveEventRegistrationDirectPaymentSelection(input) {
|
|
132471
|
+
if (input.selection.method !== "stripe") {
|
|
132472
|
+
return { kind: "not-stripe" };
|
|
132473
|
+
}
|
|
132474
|
+
const fallbackOption = input.options[0];
|
|
132475
|
+
if (!fallbackOption) {
|
|
132476
|
+
return { kind: "unavailable" };
|
|
132477
|
+
}
|
|
132478
|
+
const requestedKind = input.selection.collectionOptionKind;
|
|
132479
|
+
const selectedOption = requestedKind == null ? input.options.find((option) => option.kind === "upfront") : input.options.find((option) => option.kind === requestedKind);
|
|
132480
|
+
if (selectedOption) {
|
|
132481
|
+
return {
|
|
132482
|
+
kind: "valid",
|
|
132483
|
+
selection: {
|
|
132484
|
+
method: "stripe",
|
|
132485
|
+
collectionOptionKind: selectedOption.kind
|
|
132486
|
+
}
|
|
132487
|
+
};
|
|
132488
|
+
}
|
|
132489
|
+
return {
|
|
132490
|
+
kind: "invalid",
|
|
132491
|
+
fallbackSelection: {
|
|
132492
|
+
method: "stripe",
|
|
132493
|
+
collectionOptionKind: fallbackOption.kind
|
|
132494
|
+
}
|
|
132495
|
+
};
|
|
132496
|
+
}
|
|
131939
132497
|
function PaymentCheckIcon() {
|
|
131940
132498
|
return /* @__PURE__ */ jsx("div", { className: "er-check", children: /* @__PURE__ */ jsx(CheckIcon2, {}) });
|
|
131941
132499
|
}
|
|
131942
|
-
function PaymentTile({
|
|
132500
|
+
function PaymentTile({
|
|
132501
|
+
icon: icon2,
|
|
132502
|
+
label,
|
|
132503
|
+
detail,
|
|
132504
|
+
selected,
|
|
132505
|
+
disabled,
|
|
132506
|
+
tooltip,
|
|
132507
|
+
upsell,
|
|
132508
|
+
onClick
|
|
132509
|
+
}) {
|
|
131943
132510
|
return /* @__PURE__ */ jsx(
|
|
131944
132511
|
SelectableOptionCard,
|
|
131945
132512
|
{
|
|
@@ -131962,6 +132529,19 @@ function PaymentTile({ icon: icon2, label, detail, selected, disabled, tooltip,
|
|
|
131962
132529
|
}
|
|
131963
132530
|
);
|
|
131964
132531
|
}
|
|
132532
|
+
function formatDirectPaymentOptionDetail(option) {
|
|
132533
|
+
const dueToday = option.summaryRows.find((row) => row.label === "Due today");
|
|
132534
|
+
const balanceDueBy = option.summaryRows.find(
|
|
132535
|
+
(row) => row.label === "Balance due by"
|
|
132536
|
+
);
|
|
132537
|
+
return [
|
|
132538
|
+
dueToday ? `Due today: ${dueToday.value}` : option.description,
|
|
132539
|
+
balanceDueBy ? `Balance due by: ${balanceDueBy.value}` : null
|
|
132540
|
+
].filter((part) => Boolean(part)).join(" \xB7 ");
|
|
132541
|
+
}
|
|
132542
|
+
function isDirectPaymentOptionSelected(option, selectionState) {
|
|
132543
|
+
return selectionState.kind === "valid" && selectionState.selection.collectionOptionKind === option.kind;
|
|
132544
|
+
}
|
|
131965
132545
|
var PaymentSelectionStep = ({
|
|
131966
132546
|
event,
|
|
131967
132547
|
occurrenceContext,
|
|
@@ -131978,14 +132558,44 @@ var PaymentSelectionStep = ({
|
|
|
131978
132558
|
}) => {
|
|
131979
132559
|
const occurrenceId = occurrenceContext?.id ?? event?.registrationOccurrenceId;
|
|
131980
132560
|
const selectedMethod = selectedSelection.method;
|
|
132561
|
+
const totalPrice = eligibility?.price ? eligibility.price * ticketsCount : 0;
|
|
132562
|
+
const canShowDirectPaymentOptions = Boolean(
|
|
132563
|
+
eligibility?.eligible && eligibility.canPayDirectly && eligibility.price
|
|
132564
|
+
);
|
|
132565
|
+
const directPaymentOptions = eligibility && canShowDirectPaymentOptions ? buildEventRegistrationPaymentOptionsViewModel({
|
|
132566
|
+
eventTitle: event?.title ?? "Event",
|
|
132567
|
+
paymentTerms: event?.paymentTerms,
|
|
132568
|
+
totalPriceCents: totalPrice,
|
|
132569
|
+
currency: eligibility.currency,
|
|
132570
|
+
startsAt: occurrenceContext?.startsAt ?? event?.startsAt
|
|
132571
|
+
}).options : [];
|
|
132572
|
+
const directPaymentSelectionState = resolveEventRegistrationDirectPaymentSelection({
|
|
132573
|
+
options: directPaymentOptions,
|
|
132574
|
+
selection: selectedSelection
|
|
132575
|
+
});
|
|
132576
|
+
const directPaymentFallbackSelection = directPaymentSelectionState.kind === "invalid" ? directPaymentSelectionState.fallbackSelection : null;
|
|
132577
|
+
const directPaymentFallbackKind = directPaymentFallbackSelection?.collectionOptionKind;
|
|
131981
132578
|
const canContinue = (() => {
|
|
131982
132579
|
if (!selectedMethod) return false;
|
|
132580
|
+
if (selectedMethod === "stripe") {
|
|
132581
|
+
return directPaymentSelectionState.kind === "valid";
|
|
132582
|
+
}
|
|
131983
132583
|
if (selectedMethod === "pass") return Boolean(selectedSelection.passId);
|
|
131984
|
-
if (selectedMethod === "membership")
|
|
131985
|
-
|
|
131986
|
-
if (selectedMethod === "
|
|
132584
|
+
if (selectedMethod === "membership")
|
|
132585
|
+
return Boolean(selectedSelection.membershipId);
|
|
132586
|
+
if (selectedMethod === "pass_bundle")
|
|
132587
|
+
return Boolean(selectedSelection.bundlePassId);
|
|
132588
|
+
if (selectedMethod === "membership_bundle")
|
|
132589
|
+
return Boolean(selectedSelection.bundleMembershipId);
|
|
131987
132590
|
return true;
|
|
131988
132591
|
})();
|
|
132592
|
+
useEffect(() => {
|
|
132593
|
+
if (!directPaymentFallbackKind) return;
|
|
132594
|
+
onSelectionChange({
|
|
132595
|
+
method: "stripe",
|
|
132596
|
+
collectionOptionKind: directPaymentFallbackKind
|
|
132597
|
+
});
|
|
132598
|
+
}, [directPaymentFallbackKind, onSelectionChange]);
|
|
131989
132599
|
const getButtonText = useCallback(() => {
|
|
131990
132600
|
if (selectedMethod === "stripe") return "Continue to Payment";
|
|
131991
132601
|
if (selectedMethod === "pass_bundle" || selectedMethod === "membership_bundle") {
|
|
@@ -132012,7 +132622,15 @@ var PaymentSelectionStep = ({
|
|
|
132012
132622
|
buttonText: getButtonText(),
|
|
132013
132623
|
showLoginPrompt
|
|
132014
132624
|
});
|
|
132015
|
-
}, [
|
|
132625
|
+
}, [
|
|
132626
|
+
onStateChange,
|
|
132627
|
+
eligibilityLoading,
|
|
132628
|
+
eligibilityError,
|
|
132629
|
+
eligibility,
|
|
132630
|
+
isAuthenticated,
|
|
132631
|
+
canContinue,
|
|
132632
|
+
getButtonText
|
|
132633
|
+
]);
|
|
132016
132634
|
if (eligibilityLoading) {
|
|
132017
132635
|
return /* @__PURE__ */ jsx("div", { className: "er-stack", children: /* @__PURE__ */ jsxs("div", { className: "er-center", children: [
|
|
132018
132636
|
/* @__PURE__ */ jsx(SpinnerNode, { size: "lg", srLabel: "Checking payment options" }),
|
|
@@ -132060,7 +132678,10 @@ var PaymentSelectionStep = ({
|
|
|
132060
132678
|
"button",
|
|
132061
132679
|
{
|
|
132062
132680
|
type: "button",
|
|
132063
|
-
className: themeButtonClassName({
|
|
132681
|
+
className: themeButtonClassName({
|
|
132682
|
+
variant: "primary",
|
|
132683
|
+
size: "md"
|
|
132684
|
+
}),
|
|
132064
132685
|
disabled: !email.trim(),
|
|
132065
132686
|
onClick: onRequestLogin,
|
|
132066
132687
|
children: "Email me a login link"
|
|
@@ -132074,21 +132695,27 @@ var PaymentSelectionStep = ({
|
|
|
132074
132695
|
] }) })
|
|
132075
132696
|
] });
|
|
132076
132697
|
}
|
|
132077
|
-
const totalPrice = eligibility.price ? eligibility.price * ticketsCount : 0;
|
|
132078
132698
|
const isMultiTicket = areEntitlementsDisabledForTicketCount(ticketsCount);
|
|
132079
132699
|
return /* @__PURE__ */ jsxs("div", { className: "er-stack", children: [
|
|
132080
132700
|
/* @__PURE__ */ jsx("h3", { className: "er-title", children: "Payment Options" }),
|
|
132081
132701
|
/* @__PURE__ */ jsxs("div", { className: "er-payment-tiles", children: [
|
|
132082
|
-
|
|
132702
|
+
canShowDirectPaymentOptions && /* @__PURE__ */ jsx(Fragment, { children: directPaymentOptions.map((option) => /* @__PURE__ */ jsx(
|
|
132083
132703
|
PaymentTile,
|
|
132084
132704
|
{
|
|
132085
132705
|
icon: /* @__PURE__ */ jsx(CreditCard, { size: 24, "aria-hidden": "true" }),
|
|
132086
|
-
label:
|
|
132087
|
-
detail:
|
|
132088
|
-
selected:
|
|
132089
|
-
|
|
132090
|
-
|
|
132091
|
-
|
|
132706
|
+
label: option.label,
|
|
132707
|
+
detail: formatDirectPaymentOptionDetail(option),
|
|
132708
|
+
selected: isDirectPaymentOptionSelected(
|
|
132709
|
+
option,
|
|
132710
|
+
directPaymentSelectionState
|
|
132711
|
+
),
|
|
132712
|
+
onClick: () => onSelectionChange({
|
|
132713
|
+
method: "stripe",
|
|
132714
|
+
collectionOptionKind: option.kind
|
|
132715
|
+
})
|
|
132716
|
+
},
|
|
132717
|
+
option.kind
|
|
132718
|
+
)) }),
|
|
132092
132719
|
isAuthenticated && eligibility.eligiblePasses.map((pass) => /* @__PURE__ */ jsx(
|
|
132093
132720
|
PaymentTile,
|
|
132094
132721
|
{
|
|
@@ -132098,7 +132725,11 @@ var PaymentSelectionStep = ({
|
|
|
132098
132725
|
selected: selectedMethod === "pass" && selectedSelection.passId === pass.id,
|
|
132099
132726
|
disabled: isMultiTicket,
|
|
132100
132727
|
tooltip: isMultiTicket ? ENTITLEMENT_SINGLE_TICKET_TOOLTIP : void 0,
|
|
132101
|
-
onClick: () => onSelectionChange({
|
|
132728
|
+
onClick: () => onSelectionChange({
|
|
132729
|
+
method: "pass",
|
|
132730
|
+
passId: pass.id,
|
|
132731
|
+
productName: pass.passName
|
|
132732
|
+
})
|
|
132102
132733
|
},
|
|
132103
132734
|
pass.id
|
|
132104
132735
|
)),
|
|
@@ -132497,6 +133128,24 @@ function EventRegistrationWizardActions(props2) {
|
|
|
132497
133128
|
function isProductMethod(method) {
|
|
132498
133129
|
return method !== null && ["pass", "membership", "pass_bundle", "membership_bundle"].includes(method);
|
|
132499
133130
|
}
|
|
133131
|
+
function getSummaryRow(option, label) {
|
|
133132
|
+
return option.summaryRows.find((row) => row.label === label)?.value ?? null;
|
|
133133
|
+
}
|
|
133134
|
+
function getSelectedDirectPaymentOption(input) {
|
|
133135
|
+
const summaryEvent = input.wizard.selectedEvent ?? input.wizard.preSelectedEvent;
|
|
133136
|
+
if (!summaryEvent || input.wizard.paymentSelection.method !== "stripe") {
|
|
133137
|
+
return null;
|
|
133138
|
+
}
|
|
133139
|
+
const options = buildEventRegistrationPaymentOptionsViewModel({
|
|
133140
|
+
eventTitle: summaryEvent.title,
|
|
133141
|
+
paymentTerms: summaryEvent.paymentTerms,
|
|
133142
|
+
totalPriceCents: input.totalCents,
|
|
133143
|
+
currency: input.currency,
|
|
133144
|
+
startsAt: input.wizard.occurrenceContext?.startsAt ?? summaryEvent.startsAt
|
|
133145
|
+
}).options;
|
|
133146
|
+
const requestedKind = input.wizard.paymentSelection.collectionOptionKind ?? "upfront";
|
|
133147
|
+
return options.find((option) => option.kind === requestedKind) ?? options.find((option) => option.kind === "upfront") ?? options[0] ?? null;
|
|
133148
|
+
}
|
|
132500
133149
|
function EventRegistrationSummaryBar(props2) {
|
|
132501
133150
|
const { wizard } = props2;
|
|
132502
133151
|
const summaryEvent = wizard.selectedEvent ?? wizard.preSelectedEvent;
|
|
@@ -132511,6 +133160,18 @@ function EventRegistrationSummaryBar(props2) {
|
|
|
132511
133160
|
const autoAppliedDiscount = wizard.discountCode.trim().length > 0 ? null : wizard.autoAppliedDiscount;
|
|
132512
133161
|
const autoAppliedDiscountCents = Math.max(0, autoAppliedDiscount?.computedAmountCents ?? 0);
|
|
132513
133162
|
const discountedTotalCents = Math.max(0, subtotalCents - autoAppliedDiscountCents);
|
|
133163
|
+
const selectedDirectPaymentOption = getSelectedDirectPaymentOption({
|
|
133164
|
+
wizard,
|
|
133165
|
+
totalCents: discountedTotalCents,
|
|
133166
|
+
currency: summaryCurrency
|
|
133167
|
+
});
|
|
133168
|
+
const flexibleBalanceSummary = selectedDirectPaymentOption?.kind === "flexible_balance" ? {
|
|
133169
|
+
total: getSummaryRow(selectedDirectPaymentOption, "Total"),
|
|
133170
|
+
dueToday: getSummaryRow(selectedDirectPaymentOption, "Due today"),
|
|
133171
|
+
remainingBalance: getSummaryRow(selectedDirectPaymentOption, "Remaining balance"),
|
|
133172
|
+
balanceDueBy: getSummaryRow(selectedDirectPaymentOption, "Balance due by"),
|
|
133173
|
+
depositPolicy: getSummaryRow(selectedDirectPaymentOption, "Deposit policy")
|
|
133174
|
+
} : null;
|
|
132514
133175
|
if (!summaryTitle) return null;
|
|
132515
133176
|
const productMethod = isProductMethod(wizard.paymentSelection.method);
|
|
132516
133177
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -132554,6 +133215,22 @@ function EventRegistrationSummaryBar(props2) {
|
|
|
132554
133215
|
summaryPrice > 0 && /* @__PURE__ */ jsx("div", { className: "er-summary-bar-pricing", children: productMethod ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
132555
133216
|
/* @__PURE__ */ jsx("span", { className: "er-summary-bar-price er-summary-bar-price--struck", children: formatPrice(summaryPrice * wizard.ticketsCount, summaryCurrency) }),
|
|
132556
133217
|
/* @__PURE__ */ jsx("div", { className: "er-summary-bar-included", children: wizard.paymentSelection.method === "pass" || wizard.paymentSelection.method === "pass_bundle" ? "1 pass credit" : "Included in membership" })
|
|
133218
|
+
] }) : flexibleBalanceSummary ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
133219
|
+
flexibleBalanceSummary.total ? /* @__PURE__ */ jsxs("div", { className: "er-summary-bar-product-detail", children: [
|
|
133220
|
+
"Total: ",
|
|
133221
|
+
flexibleBalanceSummary.total
|
|
133222
|
+
] }) : null,
|
|
133223
|
+
/* @__PURE__ */ jsx("div", { className: "er-summary-bar-price", children: flexibleBalanceSummary.dueToday ?? formatPrice(discountedTotalCents, summaryCurrency) }),
|
|
133224
|
+
/* @__PURE__ */ jsx("div", { className: "er-summary-bar-included", children: "Payable now" }),
|
|
133225
|
+
flexibleBalanceSummary.remainingBalance ? /* @__PURE__ */ jsxs("div", { className: "er-summary-bar-product-detail", children: [
|
|
133226
|
+
"Remaining balance: ",
|
|
133227
|
+
flexibleBalanceSummary.remainingBalance,
|
|
133228
|
+
flexibleBalanceSummary.balanceDueBy ? ` due by ${flexibleBalanceSummary.balanceDueBy}` : ""
|
|
133229
|
+
] }) : null,
|
|
133230
|
+
flexibleBalanceSummary.depositPolicy ? /* @__PURE__ */ jsxs("div", { className: "er-summary-bar-product-detail", children: [
|
|
133231
|
+
"Deposit: ",
|
|
133232
|
+
flexibleBalanceSummary.depositPolicy
|
|
133233
|
+
] }) : null
|
|
132557
133234
|
] }) : autoAppliedDiscount && autoAppliedDiscountCents > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
132558
133235
|
/* @__PURE__ */ jsx("span", { className: "er-summary-bar-price er-summary-bar-price--struck", children: formatPrice(subtotalCents, summaryCurrency) }),
|
|
132559
133236
|
/* @__PURE__ */ jsx("div", { className: "er-summary-bar-price", children: formatPrice(discountedTotalCents, summaryCurrency) }),
|
|
@@ -133513,7 +134190,7 @@ function magicLinkSubmissionReducer(state, action) {
|
|
|
133513
134190
|
case "reset":
|
|
133514
134191
|
return initialMagicLinkSubmissionState;
|
|
133515
134192
|
default:
|
|
133516
|
-
return
|
|
134193
|
+
return assertNever8(action);
|
|
133517
134194
|
}
|
|
133518
134195
|
}
|
|
133519
134196
|
function isMagicLinkSubmitting(state) {
|
|
@@ -133648,7 +134325,9 @@ function EventRegistrationWizard(props2) {
|
|
|
133648
134325
|
buttonVariant = "primary",
|
|
133649
134326
|
className,
|
|
133650
134327
|
spamProtectionEnabled,
|
|
133651
|
-
supportEmail
|
|
134328
|
+
supportEmail,
|
|
134329
|
+
sitePasses,
|
|
134330
|
+
siteMemberships
|
|
133652
134331
|
} = props2;
|
|
133653
134332
|
const maxTicketsNum = normalizeEventRegistrationMaxTickets(maxTickets);
|
|
133654
134333
|
const showSpamProtection = spamProtectionEnabled ?? isSpamProtectionEnabled();
|
|
@@ -133744,11 +134423,13 @@ function EventRegistrationWizard(props2) {
|
|
|
133744
134423
|
const summaryPriceLabel = summaryEvent ? formatEventPriceDisplay(summaryEvent.pricing) : null;
|
|
133745
134424
|
const summaryAvailabilityLabel = summaryEvent?.availableSpots === null || summaryEvent?.availableSpots === void 0 ? null : summaryEvent.availableSpots > 0 ? `${summaryEvent.availableSpots} spots left` : summaryEvent.waitlistEnabled ? "Waitlist available" : "Fully booked";
|
|
133746
134425
|
const waitlistClaimRequiresPortalLogin = wizard.waitlistClaim.requiresPortalLogin && wizard.portalAuthState !== "authenticated" && wizard.portalAuthState !== "checking";
|
|
134426
|
+
const selectedProductEvent = wizard.selectedEvent ?? wizard.preSelectedEvent;
|
|
134427
|
+
const hasPassOrMembershipProducts = filterPassesForEvent(sitePasses?.passes, selectedProductEvent).length > 0 || filterMembershipsForEvent(siteMemberships?.memberships, selectedProductEvent).length > 0;
|
|
133747
134428
|
const portalAuthCopy = waitlistClaimRequiresPortalLogin ? {
|
|
133748
134429
|
...EVENT_PORTAL_AUTH_COPY["waitlist-claim"],
|
|
133749
134430
|
description: wizard.waitlistClaim.loginMessage ?? "Log in to continue with your waitlist claim."
|
|
133750
134431
|
} : EVENT_PORTAL_AUTH_COPY.membership;
|
|
133751
|
-
const showPortalAuthPrompt = waitlistClaimRequiresPortalLogin || wizard.step === "select-tickets" && wizard.portalAuthState !== "authenticated" && wizard.portalAuthState !== "checking" && summaryEventPricingType !== "free";
|
|
134432
|
+
const showPortalAuthPrompt = waitlistClaimRequiresPortalLogin || wizard.step === "select-tickets" && wizard.portalAuthState !== "authenticated" && wizard.portalAuthState !== "checking" && hasPassOrMembershipProducts && summaryEventPricingType !== "free";
|
|
133752
134433
|
const renderRegistrationSurface = (variant) => /* @__PURE__ */ jsxs("div", { className: `er-container${variant === "overlay" ? " er-container--overlay" : ""}`, children: [
|
|
133753
134434
|
isWizardStep && /* @__PURE__ */ jsxs("div", { className: "er-payment-layout er-payment-layout--no-sidebar", children: [
|
|
133754
134435
|
/* @__PURE__ */ jsxs("div", { className: "er-payment-layout-main", children: [
|
|
@@ -134667,11 +135348,6 @@ function useCourseRegistrationWizard(props2) {
|
|
|
134667
135348
|
const [eligibleMemberships, setEligibleMemberships] = useState([]);
|
|
134668
135349
|
const [paymentChoice, setPaymentChoice] = useState("checkout");
|
|
134669
135350
|
const [selectedMembershipId, setSelectedMembershipId] = useState(null);
|
|
134670
|
-
const [discountUiOpen, setDiscountUiOpen] = useState(false);
|
|
134671
|
-
const [discountCode, setDiscountCode] = useState("");
|
|
134672
|
-
const [discountsAvailable, setDiscountsAvailable] = useState(false);
|
|
134673
|
-
const [manualCodeEntryAllowed, setManualCodeEntryAllowed] = useState(false);
|
|
134674
|
-
const [discountsAvailableLoading, setDiscountsAvailableLoading] = useState(false);
|
|
134675
135351
|
const [bookingMode, setBookingMode] = useState(null);
|
|
134676
135352
|
const waitlistClaim = useWaitlistClaim();
|
|
134677
135353
|
const selectedCoursePricing = useMemo(
|
|
@@ -135092,45 +135768,12 @@ function useCourseRegistrationWizard(props2) {
|
|
|
135092
135768
|
if (paymentChoice !== "checkout") return null;
|
|
135093
135769
|
return { type: "course", courseId: selectedCourse.id };
|
|
135094
135770
|
}, [selectedCourse, selectedCoursePricing?.selectedRequiresPayment, paymentChoice]);
|
|
135095
|
-
|
|
135096
|
-
|
|
135097
|
-
|
|
135098
|
-
|
|
135099
|
-
|
|
135100
|
-
|
|
135101
|
-
setDiscountsAvailableLoading(false);
|
|
135102
|
-
setDiscountUiOpen(false);
|
|
135103
|
-
setDiscountCode("");
|
|
135104
|
-
return;
|
|
135105
|
-
}
|
|
135106
|
-
setDiscountsAvailableLoading(true);
|
|
135107
|
-
try {
|
|
135108
|
-
const res = await api.getDiscountsAvailable({
|
|
135109
|
-
context: courseDiscountContext,
|
|
135110
|
-
subtotalCents: selectedCoursePricing?.selectedPriceAmount ?? void 0
|
|
135111
|
-
});
|
|
135112
|
-
if (cancelled) return;
|
|
135113
|
-
setDiscountsAvailable(res.hasDiscounts);
|
|
135114
|
-
setManualCodeEntryAllowed(res.manualCodeEntryAllowed);
|
|
135115
|
-
if (!res.hasDiscounts || !res.manualCodeEntryAllowed) {
|
|
135116
|
-
setDiscountUiOpen(false);
|
|
135117
|
-
setDiscountCode("");
|
|
135118
|
-
}
|
|
135119
|
-
} catch {
|
|
135120
|
-
if (cancelled) return;
|
|
135121
|
-
setDiscountsAvailable(false);
|
|
135122
|
-
setManualCodeEntryAllowed(false);
|
|
135123
|
-
setDiscountUiOpen(false);
|
|
135124
|
-
setDiscountCode("");
|
|
135125
|
-
} finally {
|
|
135126
|
-
if (!cancelled) setDiscountsAvailableLoading(false);
|
|
135127
|
-
}
|
|
135128
|
-
}
|
|
135129
|
-
void checkDiscountAvailability();
|
|
135130
|
-
return () => {
|
|
135131
|
-
cancelled = true;
|
|
135132
|
-
};
|
|
135133
|
-
}, [api, courseDiscountContext, selectedCoursePricing?.selectedPriceAmount]);
|
|
135771
|
+
const discountUi = useDiscountCodeUi({
|
|
135772
|
+
api,
|
|
135773
|
+
discountContext: courseDiscountContext,
|
|
135774
|
+
subtotalCents: selectedCoursePricing?.selectedPriceAmount ?? void 0
|
|
135775
|
+
});
|
|
135776
|
+
const discountCode = discountUi.discountCode;
|
|
135134
135777
|
const hasCoursePayment = resolveHasCoursePayment(selectedCoursePricing);
|
|
135135
135778
|
const canUseMembership = hasCoursePayment && selectedCourse?.acceptsMemberships === true && portalAuthState === "authenticated" && eligibleMemberships.length > 0;
|
|
135136
135779
|
const hasPreSelectedCourse = scopedCourses.length === 1;
|
|
@@ -135179,13 +135822,13 @@ function useCourseRegistrationWizard(props2) {
|
|
|
135179
135822
|
setPaymentChoice,
|
|
135180
135823
|
selectedMembershipId,
|
|
135181
135824
|
setSelectedMembershipId,
|
|
135182
|
-
discountUiOpen,
|
|
135183
|
-
setDiscountUiOpen,
|
|
135184
|
-
discountCode,
|
|
135185
|
-
setDiscountCode,
|
|
135186
|
-
discountsAvailable,
|
|
135187
|
-
manualCodeEntryAllowed,
|
|
135188
|
-
discountsAvailableLoading,
|
|
135825
|
+
discountUiOpen: discountUi.discountUiOpen,
|
|
135826
|
+
setDiscountUiOpen: discountUi.setDiscountUiOpen,
|
|
135827
|
+
discountCode: discountUi.discountCode,
|
|
135828
|
+
setDiscountCode: discountUi.setDiscountCode,
|
|
135829
|
+
discountsAvailable: discountUi.discountsAvailable,
|
|
135830
|
+
manualCodeEntryAllowed: discountUi.manualCodeEntryAllowed,
|
|
135831
|
+
discountsAvailableLoading: discountUi.discountsAvailableLoading,
|
|
135189
135832
|
canUseMembership,
|
|
135190
135833
|
waitlistClaim,
|
|
135191
135834
|
// New booking mode state
|
|
@@ -136161,7 +136804,7 @@ function shopPassesMembershipsReducer(state, action) {
|
|
|
136161
136804
|
returnNotice: null
|
|
136162
136805
|
};
|
|
136163
136806
|
default:
|
|
136164
|
-
return
|
|
136807
|
+
return assertNever8(action);
|
|
136165
136808
|
}
|
|
136166
136809
|
}
|
|
136167
136810
|
function getOpenCheckout(state) {
|
|
@@ -136295,15 +136938,13 @@ function planCartDiscountAvailabilityRequests(checkout2) {
|
|
|
136295
136938
|
}));
|
|
136296
136939
|
}
|
|
136297
136940
|
function aggregateCartDiscountUiState(availability) {
|
|
136298
|
-
if (!availability.some(
|
|
136941
|
+
if (!availability.some(discountAvailabilityHasDiscounts)) {
|
|
136299
136942
|
return { type: "unavailable" };
|
|
136300
136943
|
}
|
|
136301
|
-
if (availability.some(
|
|
136944
|
+
if (availability.some(discountAvailabilityAllowsManualEntry)) {
|
|
136302
136945
|
return { type: "manual-allowed" };
|
|
136303
136946
|
}
|
|
136304
|
-
const autoAppliedDiscount = availability.find(
|
|
136305
|
-
(item) => item.autoAppliedDiscount
|
|
136306
|
-
)?.autoAppliedDiscount ?? null;
|
|
136947
|
+
const autoAppliedDiscount = availability.map(getAutoAppliedDiscountPreview).find((discount) => discount !== null) ?? null;
|
|
136307
136948
|
return {
|
|
136308
136949
|
type: "auto-only",
|
|
136309
136950
|
autoAppliedDiscount
|
|
@@ -136370,7 +137011,7 @@ function discountApplyReducer(state, action) {
|
|
|
136370
137011
|
status: { type: "idle" }
|
|
136371
137012
|
};
|
|
136372
137013
|
default:
|
|
136373
|
-
return
|
|
137014
|
+
return assertNever8(action);
|
|
136374
137015
|
}
|
|
136375
137016
|
}
|
|
136376
137017
|
function getAppliedDiscountCode(state) {
|
|
@@ -136401,7 +137042,7 @@ function getDiscountApplyFeedback(status, formatPrice2) {
|
|
|
136401
137042
|
message: status.message
|
|
136402
137043
|
};
|
|
136403
137044
|
default:
|
|
136404
|
-
return
|
|
137045
|
+
return assertNever8(status);
|
|
136405
137046
|
}
|
|
136406
137047
|
}
|
|
136407
137048
|
var DISCOUNT_APPLY_MESSAGES = {
|
|
@@ -137396,7 +138037,7 @@ function shopCheckoutReducer(state, action) {
|
|
|
137396
138037
|
notice: action.notice
|
|
137397
138038
|
};
|
|
137398
138039
|
default:
|
|
137399
|
-
return
|
|
138040
|
+
return assertNever8(action);
|
|
137400
138041
|
}
|
|
137401
138042
|
}
|
|
137402
138043
|
var CART_DISCOUNT_UNAVAILABLE = { type: "unavailable" };
|
|
@@ -137879,7 +138520,7 @@ function giftingClientReducer(state, action) {
|
|
|
137879
138520
|
purchaseNotice: action.notice
|
|
137880
138521
|
};
|
|
137881
138522
|
default:
|
|
137882
|
-
return
|
|
138523
|
+
return assertNever8(action);
|
|
137883
138524
|
}
|
|
137884
138525
|
}
|
|
137885
138526
|
function resolveGiftingPurchaseNotice(search, defaultSuccessMessage) {
|
|
@@ -139472,7 +140113,7 @@ function eventPaginationLoadReducer(state, action) {
|
|
|
139472
140113
|
case "synced":
|
|
139473
140114
|
return createInitialEventPaginationLoadState(action.events, action.pageSize);
|
|
139474
140115
|
default:
|
|
139475
|
-
return
|
|
140116
|
+
return assertNever8(action);
|
|
139476
140117
|
}
|
|
139477
140118
|
}
|
|
139478
140119
|
function getEventIdentity(event) {
|
|
@@ -139693,7 +140334,7 @@ function eventFiltersLoadReducer(state, action) {
|
|
|
139693
140334
|
case "failed":
|
|
139694
140335
|
return { kind: "error", filters: state.filters, error: action.error };
|
|
139695
140336
|
default:
|
|
139696
|
-
return
|
|
140337
|
+
return assertNever8(action);
|
|
139697
140338
|
}
|
|
139698
140339
|
}
|
|
139699
140340
|
function toEventFiltersLoadError(error) {
|
|
@@ -140123,7 +140764,7 @@ function calendarEventCacheLoadReducer(_state, action) {
|
|
|
140123
140764
|
case "failed":
|
|
140124
140765
|
return { kind: "error", error: action.error };
|
|
140125
140766
|
default:
|
|
140126
|
-
return
|
|
140767
|
+
return assertNever8(action);
|
|
140127
140768
|
}
|
|
140128
140769
|
}
|
|
140129
140770
|
function toCalendarEventCacheLoadError(error) {
|
|
@@ -140440,114 +141081,6 @@ var CalendarDayCell = ({
|
|
|
140440
141081
|
] })
|
|
140441
141082
|
] });
|
|
140442
141083
|
};
|
|
140443
|
-
var AgendaEventCard = ({
|
|
140444
|
-
event,
|
|
140445
|
-
showCapacity,
|
|
140446
|
-
onClick
|
|
140447
|
-
}) => {
|
|
140448
|
-
const eventUrl = event.path;
|
|
140449
|
-
const categoryColor = event.eventCategory?.color || "rgb(var(--tb-accent))";
|
|
140450
|
-
const price = formatEventPrice(event);
|
|
140451
|
-
const { available, isFull } = getEventAvailability(event);
|
|
140452
|
-
const capacity = showCapacity && available != null ? isFull ? "Full" : `${available} spots left` : null;
|
|
140453
|
-
const title = event.title;
|
|
140454
|
-
const timeZone = event.timeZone ?? null;
|
|
140455
|
-
const teacherLine = formatEventTeacherLine(event);
|
|
140456
|
-
const cardContent = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
140457
|
-
/* @__PURE__ */ jsx(
|
|
140458
|
-
"div",
|
|
140459
|
-
{
|
|
140460
|
-
className: "event-agenda-card-indicator",
|
|
140461
|
-
style: { backgroundColor: categoryColor },
|
|
140462
|
-
"aria-hidden": "true"
|
|
140463
|
-
}
|
|
140464
|
-
),
|
|
140465
|
-
/* @__PURE__ */ jsxs("div", { className: "event-agenda-card-content", children: [
|
|
140466
|
-
/* @__PURE__ */ jsxs("div", { className: "event-agenda-card-header", children: [
|
|
140467
|
-
/* @__PURE__ */ jsx("span", { className: "event-agenda-card-time", children: formatTime(event.startsAt, { timeZone }) }),
|
|
140468
|
-
/* @__PURE__ */ jsx("span", { className: "event-agenda-card-title", children: title })
|
|
140469
|
-
] }),
|
|
140470
|
-
/* @__PURE__ */ jsxs("div", { className: "event-agenda-card-details", children: [
|
|
140471
|
-
event.venue && /* @__PURE__ */ jsxs("span", { className: "event-agenda-card-venue", children: [
|
|
140472
|
-
/* @__PURE__ */ jsxs(
|
|
140473
|
-
"svg",
|
|
140474
|
-
{
|
|
140475
|
-
className: "event-agenda-card-icon",
|
|
140476
|
-
width: "14",
|
|
140477
|
-
height: "14",
|
|
140478
|
-
viewBox: "0 0 24 24",
|
|
140479
|
-
fill: "none",
|
|
140480
|
-
stroke: "currentColor",
|
|
140481
|
-
strokeWidth: "2",
|
|
140482
|
-
strokeLinecap: "round",
|
|
140483
|
-
strokeLinejoin: "round",
|
|
140484
|
-
children: [
|
|
140485
|
-
/* @__PURE__ */ jsx("path", { d: "M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z" }),
|
|
140486
|
-
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "10", r: "3" })
|
|
140487
|
-
]
|
|
140488
|
-
}
|
|
140489
|
-
),
|
|
140490
|
-
event.venue.name
|
|
140491
|
-
] }),
|
|
140492
|
-
teacherLine && /* @__PURE__ */ jsx("span", { className: "event-agenda-card-teacher", children: teacherLine }),
|
|
140493
|
-
/* @__PURE__ */ jsx("span", { className: "event-agenda-card-price", children: price }),
|
|
140494
|
-
capacity && /* @__PURE__ */ jsx("span", { className: `event-agenda-card-capacity ${isFull ? "event-agenda-card-capacity--full" : ""}`, children: capacity })
|
|
140495
|
-
] })
|
|
140496
|
-
] })
|
|
140497
|
-
] });
|
|
140498
|
-
if (onClick) {
|
|
140499
|
-
return /* @__PURE__ */ jsx(
|
|
140500
|
-
"button",
|
|
140501
|
-
{
|
|
140502
|
-
type: "button",
|
|
140503
|
-
className: "event-agenda-card",
|
|
140504
|
-
onClick: () => onClick(event),
|
|
140505
|
-
children: cardContent
|
|
140506
|
-
}
|
|
140507
|
-
);
|
|
140508
|
-
}
|
|
140509
|
-
return /* @__PURE__ */ jsx("a", { href: eventUrl, className: "event-agenda-card", children: cardContent });
|
|
140510
|
-
};
|
|
140511
|
-
var FULL_DAY_NAMES2 = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
|
|
140512
|
-
function formatAgendaDayHeader(date) {
|
|
140513
|
-
const dayName = FULL_DAY_NAMES2[date.getDay()];
|
|
140514
|
-
const monthName = MONTH_NAMES[date.getMonth()];
|
|
140515
|
-
return `${dayName ?? "Day"}, ${monthName ?? "Month"} ${date.getDate()}`;
|
|
140516
|
-
}
|
|
140517
|
-
var WeekAgendaView = ({
|
|
140518
|
-
days,
|
|
140519
|
-
events: events2,
|
|
140520
|
-
showCapacity,
|
|
140521
|
-
emptyMessage = "No events scheduled"
|
|
140522
|
-
}) => {
|
|
140523
|
-
const eventsByDate = groupEventsByDate(events2);
|
|
140524
|
-
return /* @__PURE__ */ jsx("div", { className: "event-agenda-week", children: days.map((date) => {
|
|
140525
|
-
const dateKey = formatDateKey2(date);
|
|
140526
|
-
const dayEvents = eventsByDate.get(dateKey) || [];
|
|
140527
|
-
const today = isToday(date);
|
|
140528
|
-
return /* @__PURE__ */ jsxs(
|
|
140529
|
-
"div",
|
|
140530
|
-
{
|
|
140531
|
-
className: `event-agenda-day ${today ? "event-agenda-day--today" : ""}`,
|
|
140532
|
-
children: [
|
|
140533
|
-
/* @__PURE__ */ jsx("div", { className: "event-agenda-day-header", children: /* @__PURE__ */ jsxs("h4", { className: "event-agenda-day-title", children: [
|
|
140534
|
-
formatAgendaDayHeader(date),
|
|
140535
|
-
today && /* @__PURE__ */ jsx("span", { className: "event-agenda-day-today-badge", children: "Today" })
|
|
140536
|
-
] }) }),
|
|
140537
|
-
/* @__PURE__ */ jsx("div", { className: "event-agenda-day-content", children: dayEvents.length === 0 ? /* @__PURE__ */ jsx("p", { className: "event-agenda-day-empty", children: emptyMessage }) : /* @__PURE__ */ jsx("div", { className: "event-agenda-day-events", children: dayEvents.map((event) => /* @__PURE__ */ jsx(
|
|
140538
|
-
AgendaEventCard,
|
|
140539
|
-
{
|
|
140540
|
-
event,
|
|
140541
|
-
showCapacity
|
|
140542
|
-
},
|
|
140543
|
-
event.occurrenceId || event.id
|
|
140544
|
-
)) }) })
|
|
140545
|
-
]
|
|
140546
|
-
},
|
|
140547
|
-
dateKey
|
|
140548
|
-
);
|
|
140549
|
-
}) });
|
|
140550
|
-
};
|
|
140551
141084
|
function EventDetailModal({
|
|
140552
141085
|
event,
|
|
140553
141086
|
showCapacity,
|
|
@@ -140716,6 +141249,23 @@ function EventModals({
|
|
|
140716
141249
|
}
|
|
140717
141250
|
return marker;
|
|
140718
141251
|
}
|
|
141252
|
+
|
|
141253
|
+
// ../blocks/src/system/runtime/nodes/events/shared/calendarViewOptions.ts
|
|
141254
|
+
var monthOption = { id: "month", label: "Month" };
|
|
141255
|
+
var weekOption = { id: "week", label: "Week" };
|
|
141256
|
+
function resolveInitialCalendarView(input) {
|
|
141257
|
+
switch (input.calendarTabViews) {
|
|
141258
|
+
case "month":
|
|
141259
|
+
return "month";
|
|
141260
|
+
case "week":
|
|
141261
|
+
return "week";
|
|
141262
|
+
case "both":
|
|
141263
|
+
return input.defaultCalendarView ?? "month";
|
|
141264
|
+
}
|
|
141265
|
+
}
|
|
141266
|
+
function orderCalendarViewToggleOptions(defaultCalendarView) {
|
|
141267
|
+
return defaultCalendarView === "week" ? [weekOption, monthOption] : [monthOption, weekOption];
|
|
141268
|
+
}
|
|
140719
141269
|
function toEventCombinedControllerProps(props2) {
|
|
140720
141270
|
return {
|
|
140721
141271
|
events: props2.render.hydration.prefetchedEvents ? [...props2.render.display.events] : void 0,
|
|
@@ -140727,6 +141277,7 @@ function toEventCombinedControllerProps(props2) {
|
|
|
140727
141277
|
paginationAction: props2.render.display.paginationAction,
|
|
140728
141278
|
startOfWeek: props2.render.display.startOfWeek,
|
|
140729
141279
|
calendarTabViews: props2.render.display.calendarTabViews,
|
|
141280
|
+
defaultCalendarView: props2.render.display.defaultCalendarView,
|
|
140730
141281
|
showFilters: props2.render.display.showFilters,
|
|
140731
141282
|
showCategoryFilter: props2.render.display.showCategoryFilter,
|
|
140732
141283
|
showVenueFilter: props2.render.display.showVenueFilter,
|
|
@@ -140759,6 +141310,7 @@ var EventCombinedClient = ({
|
|
|
140759
141310
|
// Calendar options
|
|
140760
141311
|
startOfWeek: startOfWeek2 = "monday",
|
|
140761
141312
|
calendarTabViews = "both",
|
|
141313
|
+
defaultCalendarView,
|
|
140762
141314
|
// Filtering options
|
|
140763
141315
|
showFilters,
|
|
140764
141316
|
showCategoryFilter = "auto",
|
|
@@ -140791,9 +141343,21 @@ var EventCombinedClient = ({
|
|
|
140791
141343
|
const resolvedEventSurface = eventSurface ?? "all";
|
|
140792
141344
|
const resolvedScheduleScope = scheduleScope ?? "any";
|
|
140793
141345
|
const [activeTab, setActiveTab] = useState("list");
|
|
140794
|
-
const
|
|
140795
|
-
|
|
141346
|
+
const initialCalendarView = useMemo(
|
|
141347
|
+
() => resolveInitialCalendarView({
|
|
141348
|
+
calendarTabViews,
|
|
141349
|
+
defaultCalendarView
|
|
141350
|
+
}),
|
|
141351
|
+
[calendarTabViews, defaultCalendarView]
|
|
141352
|
+
);
|
|
141353
|
+
const [calendarView, setCalendarView] = useState(initialCalendarView);
|
|
141354
|
+
const calendarViewOptions = useMemo(
|
|
141355
|
+
() => orderCalendarViewToggleOptions(initialCalendarView),
|
|
141356
|
+
[initialCalendarView]
|
|
140796
141357
|
);
|
|
141358
|
+
useEffect(() => {
|
|
141359
|
+
setCalendarView(initialCalendarView);
|
|
141360
|
+
}, [initialCalendarView]);
|
|
140797
141361
|
const filtersIdBase = useId$1();
|
|
140798
141362
|
const {
|
|
140799
141363
|
categories,
|
|
@@ -140975,26 +141539,16 @@ var EventCombinedClient = ({
|
|
|
140975
141539
|
),
|
|
140976
141540
|
activeTab === "calendar" && /* @__PURE__ */ jsxs(EventModalProvider, { children: [
|
|
140977
141541
|
/* @__PURE__ */ jsxs("div", { className: "event-combined-content event-calendar", children: [
|
|
140978
|
-
calendarTabViews === "both" && /* @__PURE__ */
|
|
140979
|
-
|
|
140980
|
-
|
|
140981
|
-
|
|
140982
|
-
|
|
140983
|
-
|
|
140984
|
-
|
|
140985
|
-
|
|
140986
|
-
|
|
140987
|
-
|
|
140988
|
-
/* @__PURE__ */ jsx(
|
|
140989
|
-
"button",
|
|
140990
|
-
{
|
|
140991
|
-
type: "button",
|
|
140992
|
-
className: `event-calendar-view-btn ${calendarView === "week" ? "event-calendar-view-btn--active" : ""}`,
|
|
140993
|
-
onClick: () => setCalendarView("week"),
|
|
140994
|
-
children: "Week"
|
|
140995
|
-
}
|
|
140996
|
-
)
|
|
140997
|
-
] }),
|
|
141542
|
+
calendarTabViews === "both" && /* @__PURE__ */ jsx("div", { className: "event-calendar-view-toggle", children: calendarViewOptions.map((option) => /* @__PURE__ */ jsx(
|
|
141543
|
+
"button",
|
|
141544
|
+
{
|
|
141545
|
+
type: "button",
|
|
141546
|
+
className: `event-calendar-view-btn ${calendarView === option.id ? "event-calendar-view-btn--active" : ""}`,
|
|
141547
|
+
onClick: () => setCalendarView(option.id),
|
|
141548
|
+
children: option.label
|
|
141549
|
+
},
|
|
141550
|
+
option.id
|
|
141551
|
+
)) }),
|
|
140998
141552
|
/* @__PURE__ */ jsxs("div", { className: "event-calendar-header", children: [
|
|
140999
141553
|
/* @__PURE__ */ jsxs("div", { className: "event-calendar-nav", children: [
|
|
141000
141554
|
/* @__PURE__ */ jsx(
|
|
@@ -141263,6 +141817,7 @@ var EventCalendarClient = ({
|
|
|
141263
141817
|
paginationAction: display.paginationAction,
|
|
141264
141818
|
startOfWeek: display.startOfWeek,
|
|
141265
141819
|
calendarTabViews: display.calendarTabViews,
|
|
141820
|
+
defaultCalendarView: display.defaultCalendarView,
|
|
141266
141821
|
showFilters: display.showFilters,
|
|
141267
141822
|
showCategoryFilter: display.showCategoryFilter,
|
|
141268
141823
|
showVenueFilter: display.showVenueFilter,
|
|
@@ -141357,7 +141912,7 @@ var EventCalendarTimetableClient = ({ render }) => {
|
|
|
141357
141912
|
};
|
|
141358
141913
|
var EventCalendarGridClient = ({ render }) => {
|
|
141359
141914
|
const { display, hydration } = render;
|
|
141360
|
-
const calendarView = display.
|
|
141915
|
+
const calendarView = display.defaultCalendarView;
|
|
141361
141916
|
const { filtersNode, listFilters } = useEventCalendarFilterState(display);
|
|
141362
141917
|
const calendarInitialEvents = usePrefetchedCalendarEvents(display, listFilters);
|
|
141363
141918
|
const {
|
|
@@ -141397,7 +141952,15 @@ var EventCalendarGridClient = ({ render }) => {
|
|
|
141397
141952
|
onPrevious: goToPrevious,
|
|
141398
141953
|
onToday: goToToday,
|
|
141399
141954
|
children: [
|
|
141400
|
-
|
|
141955
|
+
viewport.kind === "week" ? /* @__PURE__ */ jsx(
|
|
141956
|
+
WeekAgendaView,
|
|
141957
|
+
{
|
|
141958
|
+
days: viewport.days,
|
|
141959
|
+
events: events2,
|
|
141960
|
+
emptyMessage: display.emptyMessage,
|
|
141961
|
+
showCapacity: display.showCapacity
|
|
141962
|
+
}
|
|
141963
|
+
) : /* @__PURE__ */ jsxs("div", { className: "event-calendar-container", children: [
|
|
141401
141964
|
/* @__PURE__ */ jsx("div", { className: "event-calendar-day-headers", children: dayNames.map((day) => /* @__PURE__ */ jsx("div", { className: "event-calendar-day-header", children: day }, day)) }),
|
|
141402
141965
|
/* @__PURE__ */ jsx("div", { className: "event-calendar-grid", children: viewport.days.map((date) => {
|
|
141403
141966
|
const dateKey = formatDateKey2(date);
|
|
@@ -141413,7 +141976,7 @@ var EventCalendarGridClient = ({ render }) => {
|
|
|
141413
141976
|
);
|
|
141414
141977
|
}) })
|
|
141415
141978
|
] }),
|
|
141416
|
-
events2.length === 0 && !loading && !error ? /* @__PURE__ */ jsx("p", { className: "event-calendar-empty", children: display.emptyMessage }) : null
|
|
141979
|
+
viewport.kind === "month" && events2.length === 0 && !loading && !error ? /* @__PURE__ */ jsx("p", { className: "event-calendar-empty", children: display.emptyMessage }) : null
|
|
141417
141980
|
]
|
|
141418
141981
|
}
|
|
141419
141982
|
),
|
|
@@ -141633,7 +142196,7 @@ function formSubmissionReducer(_state, action) {
|
|
|
141633
142196
|
case "submission-failed":
|
|
141634
142197
|
return { tag: "failed", message: action.message };
|
|
141635
142198
|
default:
|
|
141636
|
-
return
|
|
142199
|
+
return assertNever8(action);
|
|
141637
142200
|
}
|
|
141638
142201
|
}
|
|
141639
142202
|
|
|
@@ -141941,7 +142504,7 @@ function newsletterFormSubmissionReducer(state, action) {
|
|
|
141941
142504
|
case "succeeded":
|
|
141942
142505
|
return { tag: "success" };
|
|
141943
142506
|
default:
|
|
141944
|
-
return
|
|
142507
|
+
return assertNever8(action);
|
|
141945
142508
|
}
|
|
141946
142509
|
}
|
|
141947
142510
|
function newsletterFieldError(fieldId, message2) {
|
|
@@ -142157,7 +142720,7 @@ function NewsletterFormClient({
|
|
|
142157
142720
|
var newsletter_form_client_default = NewsletterFormClient;
|
|
142158
142721
|
|
|
142159
142722
|
// ../blocks/src/system/runtime/components/registry.client.tsx
|
|
142160
|
-
function
|
|
142723
|
+
function isRecord20(value) {
|
|
142161
142724
|
return typeof value === "object" && value !== null;
|
|
142162
142725
|
}
|
|
142163
142726
|
function buildRenderFromLooseProps(runtime, mode, props2) {
|
|
@@ -142177,14 +142740,14 @@ function withRuntimeBackedEnvelope(source, runtime, render) {
|
|
|
142177
142740
|
function normalizeLegacyInteractiveRenderProps(runtime, mode, props2) {
|
|
142178
142741
|
const source = props2;
|
|
142179
142742
|
const render = props2["render"];
|
|
142180
|
-
if (!
|
|
142743
|
+
if (!isRecord20(render)) {
|
|
142181
142744
|
return withRuntimeBackedEnvelope(
|
|
142182
142745
|
source,
|
|
142183
142746
|
runtime,
|
|
142184
142747
|
buildRenderFromLooseProps(runtime, mode, props2)
|
|
142185
142748
|
);
|
|
142186
142749
|
}
|
|
142187
|
-
if (
|
|
142750
|
+
if (isRecord20(render["hydration"])) {
|
|
142188
142751
|
return withRuntimeBackedEnvelope(
|
|
142189
142752
|
source,
|
|
142190
142753
|
runtime,
|
|
@@ -142194,7 +142757,7 @@ function normalizeLegacyInteractiveRenderProps(runtime, mode, props2) {
|
|
|
142194
142757
|
}
|
|
142195
142758
|
);
|
|
142196
142759
|
}
|
|
142197
|
-
if (!
|
|
142760
|
+
if (!isRecord20(render["display"])) {
|
|
142198
142761
|
return withRuntimeBackedEnvelope(
|
|
142199
142762
|
source,
|
|
142200
142763
|
runtime,
|
|
@@ -148451,7 +149014,7 @@ function sanitizeMarks(marks) {
|
|
|
148451
149014
|
if (mark.type === "bold" || mark.type === "strong" || mark.type === "italic" || mark.type === "em") {
|
|
148452
149015
|
return [{ type: mark.type }];
|
|
148453
149016
|
}
|
|
148454
|
-
if (mark.type === "link" &&
|
|
149017
|
+
if (mark.type === "link" && isRecord16(mark.attrs) && typeof mark.attrs.href === "string") {
|
|
148455
149018
|
const attrs = { href: mark.attrs.href };
|
|
148456
149019
|
if (typeof mark.attrs.target === "string" && mark.attrs.target.trim().length > 0) {
|
|
148457
149020
|
attrs.target = mark.attrs.target;
|
|
@@ -148466,10 +149029,10 @@ function sanitizeMarks(marks) {
|
|
|
148466
149029
|
return sanitized.length > 0 ? sanitized : void 0;
|
|
148467
149030
|
}
|
|
148468
149031
|
function unwrapRichTextValue(value) {
|
|
148469
|
-
if (
|
|
149032
|
+
if (isRecord16(value) && isRecord16(value.doc)) {
|
|
148470
149033
|
return unwrapRichTextValue(value.doc);
|
|
148471
149034
|
}
|
|
148472
|
-
if (
|
|
149035
|
+
if (isRecord16(value) && value.type === "doc") {
|
|
148473
149036
|
return {
|
|
148474
149037
|
type: "doc",
|
|
148475
149038
|
content: Array.isArray(value.content) ? value.content.filter(isTipTapNodeLike).map(coerceTipTapNode) : []
|
|
@@ -148478,7 +149041,7 @@ function unwrapRichTextValue(value) {
|
|
|
148478
149041
|
return EMPTY_SITE_BANNER_BODY;
|
|
148479
149042
|
}
|
|
148480
149043
|
function isTipTapNodeLike(value) {
|
|
148481
|
-
return
|
|
149044
|
+
return isRecord16(value) && typeof value.type === "string";
|
|
148482
149045
|
}
|
|
148483
149046
|
function coerceTipTapNode(value) {
|
|
148484
149047
|
return {
|
|
@@ -148486,9 +149049,9 @@ function coerceTipTapNode(value) {
|
|
|
148486
149049
|
...Array.isArray(value.content) ? { content: value.content.filter(isTipTapNodeLike).map(coerceTipTapNode) } : {},
|
|
148487
149050
|
...typeof value.text === "string" ? { text: value.text } : {},
|
|
148488
149051
|
...Array.isArray(value.marks) ? {
|
|
148489
|
-
marks: value.marks.filter((mark) =>
|
|
149052
|
+
marks: value.marks.filter((mark) => isRecord16(mark) && typeof mark.type === "string").map((mark) => ({
|
|
148490
149053
|
type: mark.type,
|
|
148491
|
-
...
|
|
149054
|
+
...isRecord16(mark.attrs) ? { attrs: mark.attrs } : {}
|
|
148492
149055
|
}))
|
|
148493
149056
|
} : {}
|
|
148494
149057
|
};
|
|
@@ -148922,11 +149485,17 @@ var useUploads = ({ uploader, maxParallel = 3, onComplete }) => {
|
|
|
148922
149485
|
[items, enqueue, retry, remove, reset2]
|
|
148923
149486
|
);
|
|
148924
149487
|
};
|
|
148925
|
-
function
|
|
148926
|
-
return {
|
|
149488
|
+
function ok$1(value) {
|
|
149489
|
+
return {
|
|
149490
|
+
ok: true,
|
|
149491
|
+
value
|
|
149492
|
+
};
|
|
148927
149493
|
}
|
|
148928
149494
|
function err3(error) {
|
|
148929
|
-
return {
|
|
149495
|
+
return {
|
|
149496
|
+
ok: false,
|
|
149497
|
+
error
|
|
149498
|
+
};
|
|
148930
149499
|
}
|
|
148931
149500
|
var unsafeAsSiteId2 = (id) => id;
|
|
148932
149501
|
var unsafeAsBookingSessionId = (id) => id;
|
|
@@ -148935,20 +149504,55 @@ var unsafeAsSiteFontId = (id) => id;
|
|
|
148935
149504
|
var unsafeAsBookingRequirementId = (id) => id;
|
|
148936
149505
|
function fromArray(items) {
|
|
148937
149506
|
const [first2, ...rest] = items;
|
|
148938
|
-
if (first2 === void 0)
|
|
148939
|
-
|
|
148940
|
-
|
|
148941
|
-
|
|
148942
|
-
|
|
148943
|
-
|
|
148944
|
-
|
|
148945
|
-
|
|
148946
|
-
|
|
149507
|
+
if (first2 === void 0) return err3("empty_array");
|
|
149508
|
+
return ok$1([first2, ...rest]);
|
|
149509
|
+
}
|
|
149510
|
+
var IMAGE_FILE_FORMATS = [
|
|
149511
|
+
"jpeg",
|
|
149512
|
+
"png",
|
|
149513
|
+
"webp",
|
|
149514
|
+
"gif",
|
|
149515
|
+
"avif",
|
|
149516
|
+
"heic",
|
|
149517
|
+
"heif",
|
|
149518
|
+
"svg"
|
|
149519
|
+
];
|
|
149520
|
+
var VIDEO_FILE_FORMATS = [
|
|
149521
|
+
"mp4",
|
|
149522
|
+
"webm",
|
|
149523
|
+
"mov"
|
|
149524
|
+
];
|
|
149525
|
+
var AUDIO_FILE_FORMATS = [
|
|
149526
|
+
"mpeg",
|
|
149527
|
+
"mp4",
|
|
149528
|
+
"wav",
|
|
149529
|
+
"ogg",
|
|
149530
|
+
"webm",
|
|
149531
|
+
"flac"
|
|
149532
|
+
];
|
|
149533
|
+
var DOCUMENT_FILE_FORMATS = [
|
|
149534
|
+
"pdf",
|
|
149535
|
+
"docx",
|
|
149536
|
+
"txt",
|
|
149537
|
+
"rtf"
|
|
149538
|
+
];
|
|
148947
149539
|
var SPREADSHEET_FILE_FORMATS = ["csv"];
|
|
148948
149540
|
var FONT_FILE_FORMATS = ["woff2"];
|
|
148949
149541
|
var ARCHIVE_FILE_FORMATS = ["zip"];
|
|
148950
|
-
var FILE_KIND_TAGS = [
|
|
148951
|
-
|
|
149542
|
+
var FILE_KIND_TAGS = [
|
|
149543
|
+
"image",
|
|
149544
|
+
"video",
|
|
149545
|
+
"audio",
|
|
149546
|
+
"document",
|
|
149547
|
+
"spreadsheet",
|
|
149548
|
+
"font",
|
|
149549
|
+
"archive"
|
|
149550
|
+
];
|
|
149551
|
+
var RENDERABLE_FILE_KIND_TAGS = [
|
|
149552
|
+
"image",
|
|
149553
|
+
"video",
|
|
149554
|
+
"audio"
|
|
149555
|
+
];
|
|
148952
149556
|
var FILE_USE_TAGS = [
|
|
148953
149557
|
"media-library",
|
|
148954
149558
|
"content-download",
|
|
@@ -148962,19 +149566,19 @@ var FILE_USE_TAGS = [
|
|
|
148962
149566
|
];
|
|
148963
149567
|
var WORKFLOW_INPUT_KINDS = ["audio-enrichment", "generic-file-processing"];
|
|
148964
149568
|
var SITE_BRAND_ASSET_USES = ["logo", "social-image"];
|
|
148965
|
-
var
|
|
149569
|
+
var SITE_BACKGROUND_ASSET_USES3 = ["selected-background", ...[
|
|
148966
149570
|
"light-texture",
|
|
148967
149571
|
"proof-band-dark",
|
|
148968
149572
|
"cta-wash",
|
|
148969
149573
|
"footer-detail",
|
|
148970
149574
|
"style-atmosphere-1",
|
|
148971
149575
|
"style-atmosphere-2"
|
|
149576
|
+
]];
|
|
149577
|
+
var TEMPORARY_INGESTION_KINDS = [
|
|
149578
|
+
"backup-zip",
|
|
149579
|
+
"newsletter-csv",
|
|
149580
|
+
"instagram-zip"
|
|
148972
149581
|
];
|
|
148973
|
-
var SITE_BACKGROUND_ASSET_USES3 = [
|
|
148974
|
-
"selected-background",
|
|
148975
|
-
...AMBIENT_BACKGROUND_ROLES3
|
|
148976
|
-
];
|
|
148977
|
-
var TEMPORARY_INGESTION_KINDS = ["backup-zip", "newsletter-csv", "instagram-zip"];
|
|
148978
149582
|
var ACCESS_POLICY_TAGS = [
|
|
148979
149583
|
"public-read",
|
|
148980
149584
|
"site-editor-read",
|
|
@@ -148984,12 +149588,10 @@ var ACCESS_POLICY_TAGS = [
|
|
|
148984
149588
|
"management-api-read"
|
|
148985
149589
|
];
|
|
148986
149590
|
function asPositiveSeconds(value) {
|
|
148987
|
-
if (!Number.isSafeInteger(value) || value <= 0)
|
|
148988
|
-
|
|
148989
|
-
}
|
|
148990
|
-
return ok3(value);
|
|
149591
|
+
if (!Number.isSafeInteger(value) || value <= 0) return err3("not-positive-seconds");
|
|
149592
|
+
return ok$1(value);
|
|
148991
149593
|
}
|
|
148992
|
-
function
|
|
149594
|
+
function isRecord21(value) {
|
|
148993
149595
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
148994
149596
|
}
|
|
148995
149597
|
function parseFileKindJson(value) {
|
|
@@ -149004,37 +149606,59 @@ function parseFileKindJson(value) {
|
|
|
149004
149606
|
if (!family.ok || family.value !== "raster") return err3("invalid-field");
|
|
149005
149607
|
const format2 = parseOneOf(record.format, IMAGE_FILE_FORMATS);
|
|
149006
149608
|
if (!format2.ok) return format2;
|
|
149007
|
-
return
|
|
149609
|
+
return ok$1({
|
|
149610
|
+
tag: "image",
|
|
149611
|
+
family: "raster",
|
|
149612
|
+
format: format2.value
|
|
149613
|
+
});
|
|
149008
149614
|
}
|
|
149009
149615
|
case "video": {
|
|
149010
149616
|
const format2 = parseOneOf(record.format, VIDEO_FILE_FORMATS);
|
|
149011
149617
|
if (!format2.ok) return format2;
|
|
149012
|
-
return
|
|
149618
|
+
return ok$1({
|
|
149619
|
+
tag: "video",
|
|
149620
|
+
format: format2.value
|
|
149621
|
+
});
|
|
149013
149622
|
}
|
|
149014
149623
|
case "audio": {
|
|
149015
149624
|
const format2 = parseOneOf(record.format, AUDIO_FILE_FORMATS);
|
|
149016
149625
|
if (!format2.ok) return format2;
|
|
149017
|
-
return
|
|
149626
|
+
return ok$1({
|
|
149627
|
+
tag: "audio",
|
|
149628
|
+
format: format2.value
|
|
149629
|
+
});
|
|
149018
149630
|
}
|
|
149019
149631
|
case "document": {
|
|
149020
149632
|
const format2 = parseOneOf(record.format, DOCUMENT_FILE_FORMATS);
|
|
149021
149633
|
if (!format2.ok) return format2;
|
|
149022
|
-
return
|
|
149634
|
+
return ok$1({
|
|
149635
|
+
tag: "document",
|
|
149636
|
+
format: format2.value
|
|
149637
|
+
});
|
|
149023
149638
|
}
|
|
149024
149639
|
case "spreadsheet": {
|
|
149025
149640
|
const format2 = parseOneOf(record.format, SPREADSHEET_FILE_FORMATS);
|
|
149026
149641
|
if (!format2.ok) return format2;
|
|
149027
|
-
return
|
|
149642
|
+
return ok$1({
|
|
149643
|
+
tag: "spreadsheet",
|
|
149644
|
+
format: format2.value
|
|
149645
|
+
});
|
|
149028
149646
|
}
|
|
149029
149647
|
case "font": {
|
|
149030
149648
|
const format2 = parseOneOf(record.format, FONT_FILE_FORMATS);
|
|
149031
149649
|
if (!format2.ok) return format2;
|
|
149032
|
-
return
|
|
149650
|
+
return ok$1({
|
|
149651
|
+
tag: "font",
|
|
149652
|
+
format: format2.value
|
|
149653
|
+
});
|
|
149033
149654
|
}
|
|
149034
149655
|
case "archive": {
|
|
149035
149656
|
const format2 = parseOneOf(record.format, ARCHIVE_FILE_FORMATS);
|
|
149036
149657
|
if (!format2.ok) return format2;
|
|
149037
|
-
return
|
|
149658
|
+
return ok$1({
|
|
149659
|
+
tag: "archive",
|
|
149660
|
+
format: format2.value
|
|
149661
|
+
});
|
|
149038
149662
|
}
|
|
149039
149663
|
}
|
|
149040
149664
|
}
|
|
@@ -149048,44 +149672,68 @@ function parseFileUseJson(value) {
|
|
|
149048
149672
|
case "media-library": {
|
|
149049
149673
|
const renderUse = parseOneOf(record.renderUse, RENDERABLE_FILE_KIND_TAGS);
|
|
149050
149674
|
if (!renderUse.ok) return renderUse;
|
|
149051
|
-
return
|
|
149675
|
+
return ok$1({
|
|
149676
|
+
tag: "media-library",
|
|
149677
|
+
renderUse: renderUse.value
|
|
149678
|
+
});
|
|
149052
149679
|
}
|
|
149053
149680
|
case "content-download":
|
|
149054
|
-
return
|
|
149681
|
+
return ok$1({ tag: "content-download" });
|
|
149055
149682
|
case "digital-product-file": {
|
|
149056
149683
|
const fulfillmentVisibility = requireString(record.fulfillmentVisibility);
|
|
149057
149684
|
if (!fulfillmentVisibility.ok || fulfillmentVisibility.value !== "entitled-customer") return err3("invalid-field");
|
|
149058
|
-
return
|
|
149685
|
+
return ok$1({
|
|
149686
|
+
tag: "digital-product-file",
|
|
149687
|
+
fulfillmentVisibility: "entitled-customer"
|
|
149688
|
+
});
|
|
149059
149689
|
}
|
|
149060
149690
|
case "workflow-input": {
|
|
149061
149691
|
const workflowKind = parseOneOf(record.workflowKind, WORKFLOW_INPUT_KINDS);
|
|
149062
149692
|
if (!workflowKind.ok) return workflowKind;
|
|
149063
|
-
return
|
|
149693
|
+
return ok$1({
|
|
149694
|
+
tag: "workflow-input",
|
|
149695
|
+
workflowKind: workflowKind.value
|
|
149696
|
+
});
|
|
149064
149697
|
}
|
|
149065
149698
|
case "booking-evidence": {
|
|
149066
149699
|
const requirementId = requireNonEmptyString(record.requirementId);
|
|
149067
149700
|
if (!requirementId.ok) return requirementId;
|
|
149068
|
-
return
|
|
149701
|
+
return ok$1({
|
|
149702
|
+
tag: "booking-evidence",
|
|
149703
|
+
requirementId: unsafeAsBookingRequirementId(requirementId.value)
|
|
149704
|
+
});
|
|
149069
149705
|
}
|
|
149070
149706
|
case "site-brand-asset": {
|
|
149071
149707
|
const brandUse = parseOneOf(record.brandUse, SITE_BRAND_ASSET_USES);
|
|
149072
149708
|
if (!brandUse.ok) return brandUse;
|
|
149073
|
-
return
|
|
149709
|
+
return ok$1({
|
|
149710
|
+
tag: "site-brand-asset",
|
|
149711
|
+
brandUse: brandUse.value
|
|
149712
|
+
});
|
|
149074
149713
|
}
|
|
149075
149714
|
case "site-background-asset": {
|
|
149076
149715
|
const backgroundUse = parseOneOf(record.backgroundUse, SITE_BACKGROUND_ASSET_USES3);
|
|
149077
149716
|
if (!backgroundUse.ok) return backgroundUse;
|
|
149078
|
-
return
|
|
149717
|
+
return ok$1({
|
|
149718
|
+
tag: "site-background-asset",
|
|
149719
|
+
backgroundUse: backgroundUse.value
|
|
149720
|
+
});
|
|
149079
149721
|
}
|
|
149080
149722
|
case "site-font-file": {
|
|
149081
149723
|
const fontId = requireNonEmptyString(record.fontId);
|
|
149082
149724
|
if (!fontId.ok) return fontId;
|
|
149083
|
-
return
|
|
149725
|
+
return ok$1({
|
|
149726
|
+
tag: "site-font-file",
|
|
149727
|
+
fontId: unsafeAsSiteFontId(fontId.value)
|
|
149728
|
+
});
|
|
149084
149729
|
}
|
|
149085
149730
|
case "temporary-ingestion": {
|
|
149086
149731
|
const ingestionKind = parseOneOf(record.ingestionKind, TEMPORARY_INGESTION_KINDS);
|
|
149087
149732
|
if (!ingestionKind.ok) return ingestionKind;
|
|
149088
|
-
return
|
|
149733
|
+
return ok$1({
|
|
149734
|
+
tag: "temporary-ingestion",
|
|
149735
|
+
ingestionKind: ingestionKind.value
|
|
149736
|
+
});
|
|
149089
149737
|
}
|
|
149090
149738
|
}
|
|
149091
149739
|
}
|
|
@@ -149095,7 +149743,7 @@ function parseFileUsesJson(value) {
|
|
|
149095
149743
|
if (!parsed.ok) return parsed;
|
|
149096
149744
|
const nonEmpty = fromArray(parsed.value);
|
|
149097
149745
|
if (!nonEmpty.ok) return err3("expected-non-empty-array");
|
|
149098
|
-
return
|
|
149746
|
+
return ok$1(nonEmpty.value);
|
|
149099
149747
|
}
|
|
149100
149748
|
function parseAccessPolicyJson(value) {
|
|
149101
149749
|
const recordResult = requireRecord(value);
|
|
@@ -149105,23 +149753,29 @@ function parseAccessPolicyJson(value) {
|
|
|
149105
149753
|
if (!tag.ok) return tag;
|
|
149106
149754
|
switch (tag.value) {
|
|
149107
149755
|
case "public-read":
|
|
149108
|
-
return
|
|
149756
|
+
return ok$1({ tag: "public-read" });
|
|
149109
149757
|
case "site-editor-read": {
|
|
149110
149758
|
const siteId = requireNonEmptyString(record.siteId);
|
|
149111
149759
|
if (!siteId.ok) return siteId;
|
|
149112
|
-
return
|
|
149760
|
+
return ok$1({
|
|
149761
|
+
tag: "site-editor-read",
|
|
149762
|
+
siteId: unsafeAsSiteId2(siteId.value)
|
|
149763
|
+
});
|
|
149113
149764
|
}
|
|
149114
149765
|
case "signed-public-render": {
|
|
149115
|
-
const expiresInSeconds =
|
|
149766
|
+
const expiresInSeconds = parsePositiveSeconds$1(record.expiresInSeconds);
|
|
149116
149767
|
if (!expiresInSeconds.ok) return expiresInSeconds;
|
|
149117
|
-
return
|
|
149768
|
+
return ok$1({
|
|
149769
|
+
tag: "signed-public-render",
|
|
149770
|
+
expiresInSeconds: expiresInSeconds.value
|
|
149771
|
+
});
|
|
149118
149772
|
}
|
|
149119
149773
|
case "entitled-customer-read": {
|
|
149120
149774
|
const scope = parseEntitledCustomerAccessScopeJson(record.scope);
|
|
149121
149775
|
if (!scope.ok) return scope;
|
|
149122
149776
|
const expiresInSeconds = parseOptionalPositiveSeconds(record.expiresInSeconds);
|
|
149123
149777
|
if (!expiresInSeconds.ok) return expiresInSeconds;
|
|
149124
|
-
return
|
|
149778
|
+
return ok$1({
|
|
149125
149779
|
tag: "entitled-customer-read",
|
|
149126
149780
|
scope: scope.value,
|
|
149127
149781
|
...expiresInSeconds.value !== void 0 ? { expiresInSeconds: expiresInSeconds.value } : {}
|
|
@@ -149132,14 +149786,14 @@ function parseAccessPolicyJson(value) {
|
|
|
149132
149786
|
if (!sessionId.ok) return sessionId;
|
|
149133
149787
|
const expiresInSeconds = parseOptionalPositiveSeconds(record.expiresInSeconds);
|
|
149134
149788
|
if (!expiresInSeconds.ok) return expiresInSeconds;
|
|
149135
|
-
return
|
|
149789
|
+
return ok$1({
|
|
149136
149790
|
tag: "booking-session-read",
|
|
149137
149791
|
sessionId: unsafeAsBookingSessionId(sessionId.value),
|
|
149138
149792
|
...expiresInSeconds.value !== void 0 ? { expiresInSeconds: expiresInSeconds.value } : {}
|
|
149139
149793
|
});
|
|
149140
149794
|
}
|
|
149141
149795
|
case "management-api-read":
|
|
149142
|
-
return
|
|
149796
|
+
return ok$1({ tag: "management-api-read" });
|
|
149143
149797
|
}
|
|
149144
149798
|
}
|
|
149145
149799
|
function parseEntitledCustomerAccessScopeJson(value) {
|
|
@@ -149150,11 +149804,11 @@ function parseEntitledCustomerAccessScopeJson(value) {
|
|
|
149150
149804
|
if (!tag.ok) return tag;
|
|
149151
149805
|
switch (tag.value) {
|
|
149152
149806
|
case "any-entitled-customer":
|
|
149153
|
-
return
|
|
149807
|
+
return ok$1({ tag: "any-entitled-customer" });
|
|
149154
149808
|
case "specific-entitlement": {
|
|
149155
149809
|
const entitlementId = requireNonEmptyString(record.entitlementId);
|
|
149156
149810
|
if (!entitlementId.ok) return entitlementId;
|
|
149157
|
-
return
|
|
149811
|
+
return ok$1({
|
|
149158
149812
|
tag: "specific-entitlement",
|
|
149159
149813
|
entitlementId: unsafeAsEntitlementId(entitlementId.value)
|
|
149160
149814
|
});
|
|
@@ -149162,19 +149816,19 @@ function parseEntitledCustomerAccessScopeJson(value) {
|
|
|
149162
149816
|
}
|
|
149163
149817
|
}
|
|
149164
149818
|
function requireRecord(value) {
|
|
149165
|
-
if (!
|
|
149166
|
-
return
|
|
149819
|
+
if (!isRecord21(value)) return err3("expected-object");
|
|
149820
|
+
return ok$1(value);
|
|
149167
149821
|
}
|
|
149168
149822
|
function requireString(value) {
|
|
149169
149823
|
if (typeof value !== "string") return err3("invalid-string");
|
|
149170
|
-
return
|
|
149824
|
+
return ok$1(value);
|
|
149171
149825
|
}
|
|
149172
149826
|
function requireNonEmptyString(value) {
|
|
149173
149827
|
const string = requireString(value);
|
|
149174
149828
|
if (!string.ok) return string;
|
|
149175
149829
|
const trimmed = string.value.trim();
|
|
149176
149830
|
if (!trimmed || trimmed !== string.value) return err3("invalid-string");
|
|
149177
|
-
return
|
|
149831
|
+
return ok$1(string.value);
|
|
149178
149832
|
}
|
|
149179
149833
|
function parseOneOf(value, allowed) {
|
|
149180
149834
|
return parseStringIn(value, allowed, "invalid-field");
|
|
@@ -149186,17 +149840,17 @@ function parseStringIn(value, allowed, outOfSetError) {
|
|
|
149186
149840
|
const string = requireString(value);
|
|
149187
149841
|
if (!string.ok) return string;
|
|
149188
149842
|
if (!isOneOf(string.value, allowed)) return err3(outOfSetError);
|
|
149189
|
-
return
|
|
149843
|
+
return ok$1(string.value);
|
|
149190
149844
|
}
|
|
149191
|
-
function
|
|
149845
|
+
function parsePositiveSeconds$1(value) {
|
|
149192
149846
|
if (typeof value !== "number") return err3("invalid-number");
|
|
149193
149847
|
const parsed = asPositiveSeconds(value);
|
|
149194
149848
|
if (!parsed.ok) return err3("invalid-positive-seconds");
|
|
149195
|
-
return
|
|
149849
|
+
return ok$1(parsed.value);
|
|
149196
149850
|
}
|
|
149197
149851
|
function parseOptionalPositiveSeconds(value) {
|
|
149198
|
-
if (value === void 0 || value === null) return
|
|
149199
|
-
return
|
|
149852
|
+
if (value === void 0 || value === null) return ok$1(void 0);
|
|
149853
|
+
return parsePositiveSeconds$1(value);
|
|
149200
149854
|
}
|
|
149201
149855
|
function traverse(items, parse2) {
|
|
149202
149856
|
const values = [];
|
|
@@ -149205,36 +149859,12 @@ function traverse(items, parse2) {
|
|
|
149205
149859
|
if (!parsed.ok) return parsed;
|
|
149206
149860
|
values.push(parsed.value);
|
|
149207
149861
|
}
|
|
149208
|
-
return
|
|
149862
|
+
return ok$1(values);
|
|
149209
149863
|
}
|
|
149210
149864
|
function isOneOf(value, allowed) {
|
|
149211
149865
|
return allowed.includes(value);
|
|
149212
149866
|
}
|
|
149213
149867
|
new TextDecoder("latin1");
|
|
149214
|
-
var PRODUCT_FILE_EXTENSION_TAGS = [
|
|
149215
|
-
"pdf",
|
|
149216
|
-
"docx",
|
|
149217
|
-
"txt",
|
|
149218
|
-
"rtf",
|
|
149219
|
-
"csv",
|
|
149220
|
-
"zip",
|
|
149221
|
-
"mp3",
|
|
149222
|
-
"m4a",
|
|
149223
|
-
"wav",
|
|
149224
|
-
"ogg",
|
|
149225
|
-
"flac",
|
|
149226
|
-
"webm",
|
|
149227
|
-
"mp4",
|
|
149228
|
-
"mov"
|
|
149229
|
-
];
|
|
149230
|
-
new Set(PRODUCT_FILE_EXTENSION_TAGS);
|
|
149231
|
-
var RASTER_IMAGE_MIME_TYPES = [
|
|
149232
|
-
"image/jpeg",
|
|
149233
|
-
"image/png",
|
|
149234
|
-
"image/webp",
|
|
149235
|
-
"image/avif"
|
|
149236
|
-
];
|
|
149237
|
-
new Set(RASTER_IMAGE_MIME_TYPES);
|
|
149238
149868
|
var MEDIA_KINDS2 = [
|
|
149239
149869
|
"image",
|
|
149240
149870
|
"video",
|
|
@@ -149251,10 +149881,7 @@ var MEDIA_ASSET_FILE_FILTERS2 = [
|
|
|
149251
149881
|
"documents",
|
|
149252
149882
|
"downloads"
|
|
149253
149883
|
];
|
|
149254
|
-
var MEDIA_ASSET_LIBRARY_SCOPES = [
|
|
149255
|
-
"files-and-media",
|
|
149256
|
-
"product-files"
|
|
149257
|
-
];
|
|
149884
|
+
var MEDIA_ASSET_LIBRARY_SCOPES = ["files-and-media", "product-files"];
|
|
149258
149885
|
var MediaStorageError = class extends Error {
|
|
149259
149886
|
constructor(message2, options = {}) {
|
|
149260
149887
|
super(message2);
|
|
@@ -149265,24 +149892,30 @@ var MediaStorageError = class extends Error {
|
|
|
149265
149892
|
this.cause = options.cause;
|
|
149266
149893
|
}
|
|
149267
149894
|
};
|
|
149268
|
-
function
|
|
149269
|
-
return {
|
|
149895
|
+
function ok3(value) {
|
|
149896
|
+
return {
|
|
149897
|
+
ok: true,
|
|
149898
|
+
value
|
|
149899
|
+
};
|
|
149270
149900
|
}
|
|
149271
149901
|
function fail(error) {
|
|
149272
|
-
return {
|
|
149902
|
+
return {
|
|
149903
|
+
ok: false,
|
|
149904
|
+
error
|
|
149905
|
+
};
|
|
149273
149906
|
}
|
|
149274
149907
|
function normalizeStringInput(value) {
|
|
149275
149908
|
if (typeof value !== "string") return fail({ tag: "MISSING" });
|
|
149276
149909
|
const trimmed = value.trim();
|
|
149277
149910
|
if (!trimmed) return fail({ tag: "EMPTY" });
|
|
149278
|
-
return
|
|
149911
|
+
return ok3(trimmed);
|
|
149279
149912
|
}
|
|
149280
149913
|
function validateRelativeStoragePath(value) {
|
|
149281
149914
|
if (value.startsWith("sites/")) return fail({ tag: "SITE_SCOPED_PATH" });
|
|
149282
149915
|
if (value.startsWith("/")) return fail({ tag: "LEADING_SLASH" });
|
|
149283
149916
|
if (value.includes("//")) return fail({ tag: "DOUBLE_SLASH" });
|
|
149284
149917
|
if (value.includes("..")) return fail({ tag: "TRAVERSAL" });
|
|
149285
|
-
return
|
|
149918
|
+
return ok3(value);
|
|
149286
149919
|
}
|
|
149287
149920
|
function brandRelativeStoragePath(value) {
|
|
149288
149921
|
return value;
|
|
@@ -149292,13 +149925,11 @@ function parseRelativeStoragePath(value) {
|
|
|
149292
149925
|
if (!normalized.ok) return normalized;
|
|
149293
149926
|
const validated = validateRelativeStoragePath(normalized.value);
|
|
149294
149927
|
if (!validated.ok) return validated;
|
|
149295
|
-
return
|
|
149928
|
+
return ok3(brandRelativeStoragePath(validated.value));
|
|
149296
149929
|
}
|
|
149297
149930
|
function assertRelativeStoragePath(value) {
|
|
149298
149931
|
const parsed = parseRelativeStoragePath(value);
|
|
149299
|
-
if (!parsed.ok) {
|
|
149300
|
-
throw new Error(`Expected RelativeStoragePath, got ${parsed.error.tag}`);
|
|
149301
|
-
}
|
|
149932
|
+
if (!parsed.ok) throw new Error(`Expected RelativeStoragePath, got ${parsed.error.tag}`);
|
|
149302
149933
|
return parsed.value;
|
|
149303
149934
|
}
|
|
149304
149935
|
var pad = (value) => value.toString().padStart(2, "0");
|
|
@@ -149311,55 +149942,47 @@ var extractExtension = (filename) => {
|
|
|
149311
149942
|
var generateId4 = () => {
|
|
149312
149943
|
const crypto2 = globalThis.crypto;
|
|
149313
149944
|
if (crypto2 && typeof crypto2.getRandomValues === "function") {
|
|
149314
|
-
const array = crypto2.getRandomValues(new Uint32Array(4));
|
|
149945
|
+
const array = crypto2.getRandomValues(/* @__PURE__ */ new Uint32Array(4));
|
|
149315
149946
|
return Array.from(array).map((value) => value.toString(16).padStart(8, "0")).join("-");
|
|
149316
149947
|
}
|
|
149317
149948
|
return `${Date.now()}-${Math.random().toString(16).slice(2)}`;
|
|
149318
149949
|
};
|
|
149319
|
-
var generateStoragePath = ({
|
|
149320
|
-
filename,
|
|
149321
|
-
folder = "originals",
|
|
149322
|
-
variantKey,
|
|
149323
|
-
now = /* @__PURE__ */ new Date()
|
|
149324
|
-
}) => {
|
|
149950
|
+
var generateStoragePath = ({ filename, folder = "originals", variantKey, now = /* @__PURE__ */ new Date() }) => {
|
|
149325
149951
|
const extension = extractExtension(filename);
|
|
149326
149952
|
const year = now.getUTCFullYear();
|
|
149327
149953
|
const month = pad(now.getUTCMonth() + 1);
|
|
149328
149954
|
const id = generateId4();
|
|
149329
|
-
if (folder === "variants") {
|
|
149330
|
-
|
|
149331
|
-
return assertRelativeStoragePath(`variants/${key}/${id}${extension}`);
|
|
149332
|
-
}
|
|
149333
|
-
if (folder === "imports") {
|
|
149334
|
-
const key = variantKey ?? generateId4();
|
|
149335
|
-
return assertRelativeStoragePath(`imports/${key}${extension}`);
|
|
149336
|
-
}
|
|
149955
|
+
if (folder === "variants") return assertRelativeStoragePath(`variants/${variantKey ?? generateId4()}/${id}${extension}`);
|
|
149956
|
+
if (folder === "imports") return assertRelativeStoragePath(`imports/${variantKey ?? generateId4()}${extension}`);
|
|
149337
149957
|
return assertRelativeStoragePath(`originals/${year}/${month}/${id}${extension}`);
|
|
149338
149958
|
};
|
|
149339
149959
|
var DEFAULT_BUCKET = "media";
|
|
149340
149960
|
var MAX_LIMIT = 100;
|
|
149341
|
-
var fileKindSchema = z.custom(
|
|
149342
|
-
|
|
149343
|
-
|
|
149344
|
-
);
|
|
149345
|
-
var fileUsesSchema = z.custom(
|
|
149346
|
-
(value) => parseFileUsesJson(value).ok,
|
|
149347
|
-
{ message: "Invalid file uses JSON" }
|
|
149348
|
-
);
|
|
149349
|
-
var accessPolicySchema = z.custom(
|
|
149350
|
-
(value) => parseAccessPolicyJson(value).ok,
|
|
149351
|
-
{ message: "Invalid access policy JSON" }
|
|
149352
|
-
);
|
|
149961
|
+
var fileKindSchema = z.custom((value) => parseFileKindJson(value).ok, { message: "Invalid file kind JSON" });
|
|
149962
|
+
var fileUsesSchema = z.custom((value) => parseFileUsesJson(value).ok, { message: "Invalid file uses JSON" });
|
|
149963
|
+
var accessPolicySchema = z.custom((value) => parseAccessPolicyJson(value).ok, { message: "Invalid access policy JSON" });
|
|
149353
149964
|
var fileDomainSchema = z.object({
|
|
149354
149965
|
fileKind: fileKindSchema,
|
|
149355
149966
|
fileUses: fileUsesSchema,
|
|
149356
149967
|
accessPolicy: accessPolicySchema,
|
|
149357
|
-
storageClass: z.enum([
|
|
149968
|
+
storageClass: z.enum([
|
|
149969
|
+
"public-site",
|
|
149970
|
+
"private-site",
|
|
149971
|
+
"temporary"
|
|
149972
|
+
]),
|
|
149358
149973
|
mimeTypeDetected: z.string().min(1).optional().nullable(),
|
|
149359
149974
|
safeDownloadFilename: z.string().min(1).optional().nullable(),
|
|
149360
|
-
lifecycleState: z.enum([
|
|
149975
|
+
lifecycleState: z.enum([
|
|
149976
|
+
"active",
|
|
149977
|
+
"pending-delete",
|
|
149978
|
+
"deleted"
|
|
149979
|
+
]),
|
|
149361
149980
|
originAssetId: z.string().uuid().optional().nullable(),
|
|
149362
|
-
derivativeKind: z.enum([
|
|
149981
|
+
derivativeKind: z.enum([
|
|
149982
|
+
"image-variant",
|
|
149983
|
+
"video-poster",
|
|
149984
|
+
"audio-waveform"
|
|
149985
|
+
]).optional().nullable(),
|
|
149363
149986
|
uploadSessionId: z.string().uuid().optional().nullable()
|
|
149364
149987
|
});
|
|
149365
149988
|
var fileDomainPatchSchema = fileDomainSchema.partial();
|
|
@@ -149400,13 +150023,10 @@ z.object({
|
|
|
149400
150023
|
altText: z.string().nullable().optional(),
|
|
149401
150024
|
caption: z.string().nullable().optional(),
|
|
149402
150025
|
exif: z.record(z.string(), z.any()).nullable().optional(),
|
|
149403
|
-
// Video metadata
|
|
149404
150026
|
durationSeconds: z.number().positive().nullable().optional(),
|
|
149405
150027
|
thumbnailAssetId: z.string().uuid().nullable().optional(),
|
|
149406
150028
|
isThumbnail: z.boolean().optional()
|
|
149407
|
-
}).refine((value) => Object.keys(value).length > 0, {
|
|
149408
|
-
message: "Update payload must include at least one field"
|
|
149409
|
-
});
|
|
150029
|
+
}).refine((value) => Object.keys(value).length > 0, { message: "Update payload must include at least one field" });
|
|
149410
150030
|
z.object({
|
|
149411
150031
|
siteId: z.string().min(1),
|
|
149412
150032
|
limit: z.number().int().min(1).max(MAX_LIMIT).optional(),
|
|
@@ -156624,6 +157244,7 @@ var MediaEditor = ({
|
|
|
156624
157244
|
cropEditorMode = "dialog",
|
|
156625
157245
|
cropEditorAutoOpen = false,
|
|
156626
157246
|
mediaPickerAutoOpen = false,
|
|
157247
|
+
onMediaPickerOpenChange,
|
|
156627
157248
|
mediaPickerDialogMaxWidth,
|
|
156628
157249
|
mediaPickerPolicy,
|
|
156629
157250
|
showPreview = true,
|
|
@@ -156683,7 +157304,8 @@ var MediaEditor = ({
|
|
|
156683
157304
|
useEffect(() => {
|
|
156684
157305
|
if (!mediaPickerAutoOpen) return;
|
|
156685
157306
|
setPickerOpen(true);
|
|
156686
|
-
|
|
157307
|
+
onMediaPickerOpenChange?.(true);
|
|
157308
|
+
}, [mediaPickerAutoOpen, onMediaPickerOpenChange]);
|
|
156687
157309
|
useEffect(() => {
|
|
156688
157310
|
if (mediaPickerAutoOpen) {
|
|
156689
157311
|
setCropOpen(false);
|
|
@@ -156851,7 +157473,10 @@ var MediaEditor = ({
|
|
|
156851
157473
|
{
|
|
156852
157474
|
value,
|
|
156853
157475
|
previewAspectRatio,
|
|
156854
|
-
onReplace: () =>
|
|
157476
|
+
onReplace: () => {
|
|
157477
|
+
setPickerOpen(true);
|
|
157478
|
+
onMediaPickerOpenChange?.(true);
|
|
157479
|
+
},
|
|
156855
157480
|
onEditCrop: openCropper,
|
|
156856
157481
|
onEditDetails,
|
|
156857
157482
|
onRemove: clear,
|
|
@@ -156877,6 +157502,7 @@ var MediaEditor = ({
|
|
|
156877
157502
|
open: pickerOpen,
|
|
156878
157503
|
onOpenChange: (open) => {
|
|
156879
157504
|
setPickerOpen(open);
|
|
157505
|
+
onMediaPickerOpenChange?.(open);
|
|
156880
157506
|
},
|
|
156881
157507
|
children: ({
|
|
156882
157508
|
assets,
|
|
@@ -156962,7 +157588,7 @@ var DEFAULT_MESSAGES = {
|
|
|
156962
157588
|
update: "Failed to update media asset",
|
|
156963
157589
|
delete: "Failed to delete media asset"
|
|
156964
157590
|
};
|
|
156965
|
-
function
|
|
157591
|
+
function isRecord22(value) {
|
|
156966
157592
|
return typeof value === "object" && value !== null;
|
|
156967
157593
|
}
|
|
156968
157594
|
var normalizeLabels = (labels) => labels && labels.length ? labels.map((label) => label.trim()).filter(Boolean).join(",") : void 0;
|
|
@@ -157000,54 +157626,39 @@ var filterUpdatePayload = (input) => {
|
|
|
157000
157626
|
return payload;
|
|
157001
157627
|
};
|
|
157002
157628
|
var extractErrorMessage = (body) => {
|
|
157003
|
-
if (!
|
|
157004
|
-
|
|
157005
|
-
|
|
157006
|
-
|
|
157007
|
-
|
|
157629
|
+
if (!isRecord22(body)) return typeof body === "string" && body.trim().length > 0 ? body : null;
|
|
157630
|
+
for (const key of [
|
|
157631
|
+
"error",
|
|
157632
|
+
"message",
|
|
157633
|
+
"detail",
|
|
157634
|
+
"reason"
|
|
157635
|
+
]) {
|
|
157008
157636
|
const value = body[key];
|
|
157009
|
-
if (typeof value === "string" && value.trim().length > 0)
|
|
157010
|
-
return value;
|
|
157011
|
-
}
|
|
157637
|
+
if (typeof value === "string" && value.trim().length > 0) return value;
|
|
157012
157638
|
}
|
|
157013
157639
|
const details = body.details;
|
|
157014
|
-
if (Array.isArray(details)) {
|
|
157015
|
-
|
|
157016
|
-
|
|
157017
|
-
return entry;
|
|
157018
|
-
}
|
|
157019
|
-
if (isRecord21(entry) && typeof entry.message === "string" && entry.message.trim().length > 0) {
|
|
157020
|
-
return entry.message;
|
|
157021
|
-
}
|
|
157022
|
-
}
|
|
157640
|
+
if (Array.isArray(details)) for (const entry of details) {
|
|
157641
|
+
if (typeof entry === "string" && entry.trim().length > 0) return entry;
|
|
157642
|
+
if (isRecord22(entry) && typeof entry.message === "string" && entry.message.trim().length > 0) return entry.message;
|
|
157023
157643
|
}
|
|
157024
157644
|
const errors = body.errors;
|
|
157025
157645
|
if (Array.isArray(errors)) {
|
|
157026
|
-
for (const entry of errors)
|
|
157027
|
-
if (isRecord21(entry) && typeof entry.message === "string" && entry.message.trim().length > 0) {
|
|
157028
|
-
return entry.message;
|
|
157029
|
-
}
|
|
157030
|
-
}
|
|
157646
|
+
for (const entry of errors) if (isRecord22(entry) && typeof entry.message === "string" && entry.message.trim().length > 0) return entry.message;
|
|
157031
157647
|
}
|
|
157032
157648
|
return null;
|
|
157033
157649
|
};
|
|
157034
157650
|
var toMediaStorageError = (error, fallback2) => {
|
|
157035
|
-
if (error instanceof MediaStorageError)
|
|
157036
|
-
|
|
157037
|
-
|
|
157038
|
-
|
|
157039
|
-
|
|
157040
|
-
|
|
157041
|
-
}
|
|
157042
|
-
if (error instanceof Error && error.message.trim().length > 0) {
|
|
157043
|
-
return new MediaStorageError(error.message, { cause: error });
|
|
157044
|
-
}
|
|
157651
|
+
if (error instanceof MediaStorageError) return error;
|
|
157652
|
+
if (error instanceof ApiRequestError) return new MediaStorageError(extractErrorMessage(error.body ?? null) ?? fallback2, {
|
|
157653
|
+
status: error.status,
|
|
157654
|
+
cause: error
|
|
157655
|
+
});
|
|
157656
|
+
if (error instanceof Error && error.message.trim().length > 0) return new MediaStorageError(error.message, { cause: error });
|
|
157045
157657
|
return new MediaStorageError(fallback2, { cause: error });
|
|
157046
157658
|
};
|
|
157047
157659
|
var callClient = async (client, params, mapError) => {
|
|
157048
157660
|
try {
|
|
157049
|
-
|
|
157050
|
-
return unwrapResponse(result);
|
|
157661
|
+
return unwrapResponse(await client(params));
|
|
157051
157662
|
} catch (error) {
|
|
157052
157663
|
throw mapError(error);
|
|
157053
157664
|
}
|
|
@@ -157055,82 +157666,63 @@ var callClient = async (client, params, mapError) => {
|
|
|
157055
157666
|
var createApiMediaRepo = ({ client }) => ({
|
|
157056
157667
|
async getAsset(assetId) {
|
|
157057
157668
|
try {
|
|
157058
|
-
|
|
157669
|
+
return unwrapResponse(await client({
|
|
157059
157670
|
endpoint: "mediaGet",
|
|
157060
157671
|
params: { assetId }
|
|
157061
|
-
});
|
|
157062
|
-
return unwrapResponse(result);
|
|
157672
|
+
}));
|
|
157063
157673
|
} catch (error) {
|
|
157064
|
-
if (error instanceof ApiRequestError && error.status === 404)
|
|
157065
|
-
return null;
|
|
157066
|
-
}
|
|
157674
|
+
if (error instanceof ApiRequestError && error.status === 404) return null;
|
|
157067
157675
|
throw toMediaStorageError(error, DEFAULT_MESSAGES.get);
|
|
157068
157676
|
}
|
|
157069
157677
|
},
|
|
157070
157678
|
async listAssets(options) {
|
|
157071
|
-
return callClient(
|
|
157072
|
-
|
|
157073
|
-
{
|
|
157074
|
-
|
|
157075
|
-
|
|
157076
|
-
|
|
157077
|
-
|
|
157078
|
-
|
|
157079
|
-
|
|
157080
|
-
|
|
157081
|
-
|
|
157082
|
-
}
|
|
157083
|
-
},
|
|
157084
|
-
(error) => toMediaStorageError(error, DEFAULT_MESSAGES.list)
|
|
157085
|
-
);
|
|
157679
|
+
return callClient(client, {
|
|
157680
|
+
endpoint: "mediaList",
|
|
157681
|
+
params: {
|
|
157682
|
+
siteId: options.siteId,
|
|
157683
|
+
q: options.search,
|
|
157684
|
+
limit: options.limit === void 0 ? void 0 : String(options.limit),
|
|
157685
|
+
offset: options.offset === void 0 ? void 0 : String(options.offset),
|
|
157686
|
+
labels: normalizeLabels(options.labels),
|
|
157687
|
+
fileFilter: options.fileFilter ?? fileFilterForMediaKinds(options.mediaKinds)
|
|
157688
|
+
}
|
|
157689
|
+
}, (error) => toMediaStorageError(error, DEFAULT_MESSAGES.list));
|
|
157086
157690
|
},
|
|
157087
157691
|
async createAsset(input) {
|
|
157088
|
-
return callClient(
|
|
157089
|
-
|
|
157090
|
-
{
|
|
157091
|
-
|
|
157092
|
-
|
|
157093
|
-
|
|
157094
|
-
|
|
157095
|
-
|
|
157096
|
-
|
|
157097
|
-
|
|
157098
|
-
|
|
157099
|
-
|
|
157100
|
-
|
|
157101
|
-
|
|
157102
|
-
|
|
157103
|
-
|
|
157104
|
-
|
|
157105
|
-
|
|
157106
|
-
}
|
|
157107
|
-
},
|
|
157108
|
-
(error) => toMediaStorageError(error, DEFAULT_MESSAGES.create)
|
|
157109
|
-
);
|
|
157692
|
+
return callClient(client, {
|
|
157693
|
+
endpoint: "createMediaAsset",
|
|
157694
|
+
body: {
|
|
157695
|
+
siteId: input.siteId,
|
|
157696
|
+
storageBucket: input.storageBucket ?? "media",
|
|
157697
|
+
storagePath: input.storagePath,
|
|
157698
|
+
filename: input.filename,
|
|
157699
|
+
mimeType: input.mimeType,
|
|
157700
|
+
width: input.width,
|
|
157701
|
+
height: input.height,
|
|
157702
|
+
bytes: input.bytes,
|
|
157703
|
+
checksumSha256: input.checksumSha256 ?? null,
|
|
157704
|
+
source: input.source ?? "upload",
|
|
157705
|
+
altText: input.altText ?? null,
|
|
157706
|
+
caption: input.caption ?? null,
|
|
157707
|
+
exif: input.exif ?? null
|
|
157708
|
+
}
|
|
157709
|
+
}, (error) => toMediaStorageError(error, DEFAULT_MESSAGES.create));
|
|
157110
157710
|
},
|
|
157111
157711
|
async updateAsset(assetId, input) {
|
|
157112
157712
|
const payload = filterUpdatePayload(input);
|
|
157113
|
-
if (Object.keys(payload).length === 0)
|
|
157114
|
-
|
|
157115
|
-
|
|
157116
|
-
|
|
157117
|
-
|
|
157118
|
-
|
|
157119
|
-
endpoint: "mediaUpdate",
|
|
157120
|
-
params: { assetId },
|
|
157121
|
-
body: payload
|
|
157122
|
-
},
|
|
157123
|
-
(error) => toMediaStorageError(error, DEFAULT_MESSAGES.update)
|
|
157124
|
-
);
|
|
157713
|
+
if (Object.keys(payload).length === 0) throw new MediaStorageError("No update payload provided");
|
|
157714
|
+
return callClient(client, {
|
|
157715
|
+
endpoint: "mediaUpdate",
|
|
157716
|
+
params: { assetId },
|
|
157717
|
+
body: payload
|
|
157718
|
+
}, (error) => toMediaStorageError(error, DEFAULT_MESSAGES.update));
|
|
157125
157719
|
},
|
|
157126
157720
|
async deleteAsset(assetId, options) {
|
|
157127
157721
|
try {
|
|
157128
157722
|
await client({
|
|
157129
157723
|
endpoint: "mediaDelete",
|
|
157130
157724
|
params: { assetId },
|
|
157131
|
-
body: {
|
|
157132
|
-
deleteObject: options?.deleteObject
|
|
157133
|
-
}
|
|
157725
|
+
body: { deleteObject: options?.deleteObject }
|
|
157134
157726
|
});
|
|
157135
157727
|
} catch (error) {
|
|
157136
157728
|
throw toMediaStorageError(error, DEFAULT_MESSAGES.delete);
|
|
@@ -157145,7 +157737,7 @@ var globalAssetInflightRequests = /* @__PURE__ */ new Map();
|
|
|
157145
157737
|
function createCachedMediaRepo(baseRepo, options) {
|
|
157146
157738
|
const cacheTtlMs = DEFAULT_CACHE_TTL_MS;
|
|
157147
157739
|
function buildCacheKey(options2) {
|
|
157148
|
-
|
|
157740
|
+
return [
|
|
157149
157741
|
options2.siteId,
|
|
157150
157742
|
options2.search ?? "",
|
|
157151
157743
|
options2.limit ?? "all",
|
|
@@ -157154,8 +157746,7 @@ function createCachedMediaRepo(baseRepo, options) {
|
|
|
157154
157746
|
JSON.stringify(options2.mediaKinds ?? null),
|
|
157155
157747
|
options2.fileFilter ?? "all",
|
|
157156
157748
|
options2.libraryScope ?? "files-and-media"
|
|
157157
|
-
];
|
|
157158
|
-
return parts.join(":");
|
|
157749
|
+
].join(":");
|
|
157159
157750
|
}
|
|
157160
157751
|
function readCache(key, cache) {
|
|
157161
157752
|
const entry = cache.get(key);
|
|
@@ -157181,17 +157772,10 @@ function createCachedMediaRepo(baseRepo, options) {
|
|
|
157181
157772
|
async getAsset(assetId) {
|
|
157182
157773
|
const cacheKey = `asset:${assetId}`;
|
|
157183
157774
|
const entry = globalAssetCache.get(cacheKey);
|
|
157184
|
-
if (entry)
|
|
157185
|
-
|
|
157186
|
-
return entry.data;
|
|
157187
|
-
} else {
|
|
157188
|
-
globalAssetCache.delete(cacheKey);
|
|
157189
|
-
}
|
|
157190
|
-
}
|
|
157775
|
+
if (entry) if (entry.expiresAt > Date.now()) return entry.data;
|
|
157776
|
+
else globalAssetCache.delete(cacheKey);
|
|
157191
157777
|
const inflightRequest = globalAssetInflightRequests.get(assetId);
|
|
157192
|
-
if (inflightRequest)
|
|
157193
|
-
return inflightRequest;
|
|
157194
|
-
}
|
|
157778
|
+
if (inflightRequest) return inflightRequest;
|
|
157195
157779
|
const fetchPromise = baseRepo.getAsset(assetId).then((result) => {
|
|
157196
157780
|
writeCache(cacheKey, result, globalAssetCache);
|
|
157197
157781
|
globalAssetInflightRequests.delete(assetId);
|
|
@@ -157206,9 +157790,7 @@ function createCachedMediaRepo(baseRepo, options) {
|
|
|
157206
157790
|
async listAssets(options2) {
|
|
157207
157791
|
const cacheKey = buildCacheKey(options2);
|
|
157208
157792
|
const cached = readCache(cacheKey, globalListCache);
|
|
157209
|
-
if (cached)
|
|
157210
|
-
return cached;
|
|
157211
|
-
}
|
|
157793
|
+
if (cached) return cached;
|
|
157212
157794
|
const result = await baseRepo.listAssets(options2);
|
|
157213
157795
|
writeCache(cacheKey, result, globalListCache);
|
|
157214
157796
|
return result;
|
|
@@ -157452,6 +158034,26 @@ function withRepeaterThumbnailMediaFieldUi(field, options) {
|
|
|
157452
158034
|
}
|
|
157453
158035
|
};
|
|
157454
158036
|
}
|
|
158037
|
+
function withRepeaterThumbnailPickerOnlyMediaFieldUi(field, options) {
|
|
158038
|
+
if (!field || field.type !== "media") {
|
|
158039
|
+
return null;
|
|
158040
|
+
}
|
|
158041
|
+
return {
|
|
158042
|
+
...field,
|
|
158043
|
+
ui: {
|
|
158044
|
+
...field.ui ?? {},
|
|
158045
|
+
variant: "inline",
|
|
158046
|
+
hideLabel: true,
|
|
158047
|
+
hideDescription: true,
|
|
158048
|
+
cropEditorMode: "inline",
|
|
158049
|
+
cropEditorAutoOpen: false,
|
|
158050
|
+
mediaPickerAutoOpen: true,
|
|
158051
|
+
...options?.onMediaPickerOpenChange ? { onMediaPickerOpenChange: options.onMediaPickerOpenChange } : {},
|
|
158052
|
+
showMediaPreview: false,
|
|
158053
|
+
showMediaOverlayActions: false
|
|
158054
|
+
}
|
|
158055
|
+
};
|
|
158056
|
+
}
|
|
157455
158057
|
function withRepeaterStackMediaFieldUi(field) {
|
|
157456
158058
|
return {
|
|
157457
158059
|
...field,
|
|
@@ -157830,6 +158432,7 @@ function InlineThumbnailAltField({ backend, path }) {
|
|
|
157830
158432
|
}
|
|
157831
158433
|
);
|
|
157832
158434
|
}
|
|
158435
|
+
var idleThumbnailPickerOnlyFlow = { kind: "idle" };
|
|
157833
158436
|
function handleDoneButtonKeyDown2(event, onDone) {
|
|
157834
158437
|
if (event.key !== "Enter" && event.key !== " ") {
|
|
157835
158438
|
return;
|
|
@@ -157854,7 +158457,9 @@ function RepeaterThumbnailCard({
|
|
|
157854
158457
|
onMoveUp,
|
|
157855
158458
|
onMoveDown,
|
|
157856
158459
|
disableMoveUp,
|
|
157857
|
-
disableMoveDown
|
|
158460
|
+
disableMoveDown,
|
|
158461
|
+
mediaPickerAutoOpenRequest,
|
|
158462
|
+
onMediaPickerAutoOpenHandled
|
|
157858
158463
|
}) {
|
|
157859
158464
|
const rowPath = `${basePath}.${index2}`;
|
|
157860
158465
|
const blockContext = useBlockContext();
|
|
@@ -157913,6 +158518,19 @@ function RepeaterThumbnailCard({
|
|
|
157913
158518
|
}),
|
|
157914
158519
|
[thumbnailField, imageTabPickerAutoOpen]
|
|
157915
158520
|
);
|
|
158521
|
+
const [pickerOnlyFlow, setPickerOnlyFlow] = useState(
|
|
158522
|
+
idleThumbnailPickerOnlyFlow
|
|
158523
|
+
);
|
|
158524
|
+
const handlePickerOnlyOpenChange = useCallback((open) => {
|
|
158525
|
+
if (open) return;
|
|
158526
|
+
setPickerOnlyFlow(idleThumbnailPickerOnlyFlow);
|
|
158527
|
+
}, []);
|
|
158528
|
+
const pickerOnlyField = useMemo(
|
|
158529
|
+
() => pickerOnlyFlow.kind === "picker-only" ? withRepeaterThumbnailPickerOnlyMediaFieldUi(thumbnailField, {
|
|
158530
|
+
onMediaPickerOpenChange: handlePickerOnlyOpenChange
|
|
158531
|
+
}) : null,
|
|
158532
|
+
[handlePickerOnlyOpenChange, pickerOnlyFlow.kind, thumbnailField]
|
|
158533
|
+
);
|
|
157916
158534
|
const rawThumbnailValue = getObjectPathValue(normalizedItemValue, thumbnailFieldId);
|
|
157917
158535
|
const [resolvedThumbnailValue, setResolvedThumbnailValue] = useState(null);
|
|
157918
158536
|
const effectiveThumbnailValue = resolvedThumbnailValue ?? rawThumbnailValue;
|
|
@@ -157942,6 +158560,7 @@ function RepeaterThumbnailCard({
|
|
|
157942
158560
|
const density = densityClasses(presentation.density);
|
|
157943
158561
|
const [detailsOpen, setDetailsOpen] = useState(false);
|
|
157944
158562
|
const [editorTab, setEditorTab] = useState("image");
|
|
158563
|
+
const handledMediaPickerAutoOpenRequestIdRef = useRef(null);
|
|
157945
158564
|
const layoutGridSpanFactor = useMemo(() => {
|
|
157946
158565
|
if (presentation.mode !== "layoutGrid") {
|
|
157947
158566
|
return 1;
|
|
@@ -158082,11 +158701,26 @@ function RepeaterThumbnailCard({
|
|
|
158082
158701
|
setEditorTab(tab);
|
|
158083
158702
|
setDetailsOpen(true);
|
|
158084
158703
|
};
|
|
158085
|
-
const openReplaceFlow = () => {
|
|
158704
|
+
const openReplaceFlow = useCallback(() => {
|
|
158086
158705
|
setImageTabPickerAutoOpen(true);
|
|
158087
158706
|
setEditorTab("image");
|
|
158088
158707
|
setDetailsOpen(true);
|
|
158089
|
-
};
|
|
158708
|
+
}, []);
|
|
158709
|
+
useEffect(() => {
|
|
158710
|
+
const requestId = mediaPickerAutoOpenRequest?.requestId;
|
|
158711
|
+
if (requestId === void 0) return;
|
|
158712
|
+
if (handledMediaPickerAutoOpenRequestIdRef.current === requestId) return;
|
|
158713
|
+
handledMediaPickerAutoOpenRequestIdRef.current = requestId;
|
|
158714
|
+
if (thumbnailField?.type === "media") {
|
|
158715
|
+
setPickerOnlyFlow({ kind: "picker-only", requestId });
|
|
158716
|
+
}
|
|
158717
|
+
onMediaPickerAutoOpenHandled?.(requestId);
|
|
158718
|
+
}, [mediaPickerAutoOpenRequest, onMediaPickerAutoOpenHandled, thumbnailField]);
|
|
158719
|
+
useEffect(() => {
|
|
158720
|
+
if (pickerOnlyFlow.kind !== "picker-only") return;
|
|
158721
|
+
if (rawThumbnailValue == null) return;
|
|
158722
|
+
setPickerOnlyFlow(idleThumbnailPickerOnlyFlow);
|
|
158723
|
+
}, [pickerOnlyFlow.kind, rawThumbnailValue]);
|
|
158090
158724
|
const handlePreviewClick = (event) => {
|
|
158091
158725
|
if (event.defaultPrevented) {
|
|
158092
158726
|
return;
|
|
@@ -158254,6 +158888,7 @@ function RepeaterThumbnailCard({
|
|
|
158254
158888
|
]
|
|
158255
158889
|
}
|
|
158256
158890
|
),
|
|
158891
|
+
pickerOnlyFlow.kind === "picker-only" && pickerOnlyField ? /* @__PURE__ */ jsx("div", { "data-repeater-thumbnail-picker-only-flow": pickerOnlyFlow.requestId, children: renderChild(pickerOnlyField, thumbnailFieldPath) }) : null,
|
|
158257
158892
|
/* @__PURE__ */ jsx(
|
|
158258
158893
|
Dialog2,
|
|
158259
158894
|
{
|
|
@@ -158782,7 +159417,9 @@ function RepeaterThumbnailGridItem({
|
|
|
158782
159417
|
onRemove,
|
|
158783
159418
|
renderChild,
|
|
158784
159419
|
presentation,
|
|
158785
|
-
canDrag
|
|
159420
|
+
canDrag,
|
|
159421
|
+
mediaPickerAutoOpenRequest,
|
|
159422
|
+
onMediaPickerAutoOpenHandled
|
|
158786
159423
|
}) {
|
|
158787
159424
|
const sortable = useSortable({ id, disabled: !canDrag });
|
|
158788
159425
|
const style2 = {
|
|
@@ -158804,6 +159441,8 @@ function RepeaterThumbnailGridItem({
|
|
|
158804
159441
|
onRemove,
|
|
158805
159442
|
renderChild,
|
|
158806
159443
|
presentation,
|
|
159444
|
+
mediaPickerAutoOpenRequest: mediaPickerAutoOpenRequest?.targetIndex === index2 ? { requestId: mediaPickerAutoOpenRequest.requestId } : null,
|
|
159445
|
+
onMediaPickerAutoOpenHandled,
|
|
158807
159446
|
renderDragHandle: canDrag ? () => /* @__PURE__ */ jsx(
|
|
158808
159447
|
RepeaterDragHandle,
|
|
158809
159448
|
{
|
|
@@ -158827,6 +159466,9 @@ function RepeaterThumbnailGrid({
|
|
|
158827
159466
|
minItems,
|
|
158828
159467
|
onMove,
|
|
158829
159468
|
onRemove,
|
|
159469
|
+
onAdd,
|
|
159470
|
+
mediaPickerAutoOpenRequest,
|
|
159471
|
+
onMediaPickerAutoOpenHandled,
|
|
158830
159472
|
renderChild,
|
|
158831
159473
|
presentation
|
|
158832
159474
|
}) {
|
|
@@ -158836,33 +159478,54 @@ function RepeaterThumbnailGrid({
|
|
|
158836
159478
|
activationDistance: 6,
|
|
158837
159479
|
onMove
|
|
158838
159480
|
});
|
|
158839
|
-
return /* @__PURE__ */
|
|
158840
|
-
|
|
158841
|
-
|
|
158842
|
-
|
|
158843
|
-
|
|
158844
|
-
|
|
158845
|
-
|
|
158846
|
-
|
|
158847
|
-
|
|
158848
|
-
|
|
158849
|
-
|
|
158850
|
-
|
|
158851
|
-
|
|
158852
|
-
|
|
158853
|
-
|
|
158854
|
-
|
|
158855
|
-
|
|
158856
|
-
|
|
158857
|
-
|
|
158858
|
-
|
|
158859
|
-
|
|
158860
|
-
|
|
158861
|
-
|
|
158862
|
-
|
|
158863
|
-
|
|
158864
|
-
|
|
159481
|
+
return /* @__PURE__ */ jsxs("div", { ref: linearDnd.containerRef, children: [
|
|
159482
|
+
items.length === 0 ? /* @__PURE__ */ jsxs(
|
|
159483
|
+
"button",
|
|
159484
|
+
{
|
|
159485
|
+
type: "button",
|
|
159486
|
+
className: "flex min-h-36 w-full flex-col items-center justify-center gap-3 rounded-md border-2 border-dashed border-input bg-muted/30 px-4 py-6 text-sm font-medium text-muted-foreground transition hover:border-primary/60 hover:bg-muted/50 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
159487
|
+
onClick: onAdd,
|
|
159488
|
+
children: [
|
|
159489
|
+
/* @__PURE__ */ jsx("span", { className: "flex h-10 w-10 items-center justify-center rounded-full bg-background shadow-sm", children: /* @__PURE__ */ jsx(Image, { className: "h-5 w-5", "aria-hidden": "true" }) }),
|
|
159490
|
+
/* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-2", children: [
|
|
159491
|
+
/* @__PURE__ */ jsx(Plus, { className: "h-4 w-4", "aria-hidden": "true" }),
|
|
159492
|
+
"Add ",
|
|
159493
|
+
config.itemLabel ?? "Item"
|
|
159494
|
+
] })
|
|
159495
|
+
]
|
|
159496
|
+
}
|
|
159497
|
+
) : null,
|
|
159498
|
+
/* @__PURE__ */ jsx(
|
|
159499
|
+
DndContext,
|
|
159500
|
+
{
|
|
159501
|
+
sensors: linearDnd.sensors,
|
|
159502
|
+
collisionDetection: linearDnd.collisionDetection,
|
|
159503
|
+
onDragEnd: linearDnd.handleDragEnd,
|
|
159504
|
+
children: /* @__PURE__ */ jsx(SortableContext, { items: linearDnd.sortableItemIds, strategy: linearDnd.sortingStrategy, children: /* @__PURE__ */ jsx("div", { className: getGridClassName(presentation.density), children: items.map((item, index2) => /* @__PURE__ */ jsx(
|
|
159505
|
+
RepeaterThumbnailGridItem,
|
|
159506
|
+
{
|
|
159507
|
+
id: item.id,
|
|
159508
|
+
index: index2,
|
|
159509
|
+
config,
|
|
159510
|
+
backend,
|
|
159511
|
+
basePath,
|
|
159512
|
+
itemsLength: items.length,
|
|
159513
|
+
minItems,
|
|
159514
|
+
onMove,
|
|
159515
|
+
onRemove,
|
|
159516
|
+
renderChild,
|
|
159517
|
+
presentation,
|
|
159518
|
+
canDrag: linearDnd.canUsePointerDrag,
|
|
159519
|
+
mediaPickerAutoOpenRequest,
|
|
159520
|
+
onMediaPickerAutoOpenHandled
|
|
159521
|
+
},
|
|
159522
|
+
item.id
|
|
159523
|
+
)) }) })
|
|
159524
|
+
}
|
|
159525
|
+
)
|
|
159526
|
+
] });
|
|
158865
159527
|
}
|
|
159528
|
+
var noAddFollowUp = { kind: "none" };
|
|
158866
159529
|
function RepeaterField({ path, backend, config, renderChild }) {
|
|
158867
159530
|
const repeaterOps = useRepeaterBackend(backend, path);
|
|
158868
159531
|
const fieldState = backend.getFieldState(path);
|
|
@@ -158871,6 +159534,8 @@ function RepeaterField({ path, backend, config, renderChild }) {
|
|
|
158871
159534
|
const polymorphicWarnOnceRef = useRef(false);
|
|
158872
159535
|
const labelFieldWarnOnceRef = useRef(false);
|
|
158873
159536
|
const addButtonRef = useRef(null);
|
|
159537
|
+
const mediaPickerAutoOpenRequestIdRef = useRef(0);
|
|
159538
|
+
const [mediaPickerAutoOpenRequest, setMediaPickerAutoOpenRequest] = useState(null);
|
|
158874
159539
|
const minItems = config.minItems ?? 0;
|
|
158875
159540
|
const maxItems = config.maxItems;
|
|
158876
159541
|
const isPolymorphic = Boolean(config.polymorphic && config.itemTypes);
|
|
@@ -158910,20 +159575,33 @@ function RepeaterField({ path, backend, config, renderChild }) {
|
|
|
158910
159575
|
labelFieldWarnOnceRef.current = true;
|
|
158911
159576
|
}, [presentation, isPolymorphic, path, config.fields]);
|
|
158912
159577
|
const addDisabled = maxItems != null && repeaterOps.items.length >= maxItems || layoutGridAddDisabled;
|
|
158913
|
-
const handleAdd = (itemType) => {
|
|
159578
|
+
const handleAdd = (itemType, followUp = noAddFollowUp) => {
|
|
159579
|
+
if (maxItems != null && repeaterOps.items.length >= maxItems) {
|
|
159580
|
+
return { kind: "skipped" };
|
|
159581
|
+
}
|
|
158914
159582
|
if (useLayoutGrid && !canAppendLayoutGridDefaultItem(itemType)) {
|
|
158915
|
-
return;
|
|
159583
|
+
return { kind: "skipped" };
|
|
158916
159584
|
}
|
|
158917
159585
|
const nextItem = createDefaultItem(config, itemType);
|
|
159586
|
+
const nextIndex = repeaterOps.items.length;
|
|
158918
159587
|
if (presentation.mode === "layoutGrid") {
|
|
158919
159588
|
const nextPlacement = getNextLayoutGridPlacement(itemType);
|
|
158920
159589
|
if (!nextPlacement) {
|
|
158921
|
-
return;
|
|
159590
|
+
return { kind: "skipped" };
|
|
158922
159591
|
}
|
|
158923
159592
|
nextItem[presentation.rowField] = nextPlacement.row;
|
|
158924
159593
|
nextItem[presentation.columnField] = nextPlacement.colStart;
|
|
158925
159594
|
}
|
|
158926
159595
|
repeaterOps.append(nextItem);
|
|
159596
|
+
if (followUp.kind === "open-thumbnail-media-picker") {
|
|
159597
|
+
mediaPickerAutoOpenRequestIdRef.current += 1;
|
|
159598
|
+
setMediaPickerAutoOpenRequest({
|
|
159599
|
+
kind: "open-thumbnail-media-picker",
|
|
159600
|
+
targetIndex: nextIndex,
|
|
159601
|
+
requestId: mediaPickerAutoOpenRequestIdRef.current
|
|
159602
|
+
});
|
|
159603
|
+
}
|
|
159604
|
+
return { kind: "added", index: nextIndex };
|
|
158927
159605
|
};
|
|
158928
159606
|
const handleMove = (from2, to) => {
|
|
158929
159607
|
if (to < 0 || to >= repeaterOps.items.length) return;
|
|
@@ -158959,6 +159637,13 @@ function RepeaterField({ path, backend, config, renderChild }) {
|
|
|
158959
159637
|
basePath: path,
|
|
158960
159638
|
items: repeaterOps.items,
|
|
158961
159639
|
minItems,
|
|
159640
|
+
onAdd: () => handleAdd(void 0, { kind: "open-thumbnail-media-picker" }),
|
|
159641
|
+
mediaPickerAutoOpenRequest,
|
|
159642
|
+
onMediaPickerAutoOpenHandled: (requestId) => {
|
|
159643
|
+
setMediaPickerAutoOpenRequest(
|
|
159644
|
+
(current) => current?.requestId === requestId ? null : current
|
|
159645
|
+
);
|
|
159646
|
+
},
|
|
158962
159647
|
onMove: handleMove,
|
|
158963
159648
|
onRemove: handleRemove,
|
|
158964
159649
|
renderChild,
|
|
@@ -158978,7 +159663,7 @@ function RepeaterField({ path, backend, config, renderChild }) {
|
|
|
158978
159663
|
focusFallbackRef: addButtonRef
|
|
158979
159664
|
}
|
|
158980
159665
|
),
|
|
158981
|
-
/* @__PURE__ */ jsx("div", { className: "mt-3", children: isPolymorphic ? /* @__PURE__ */ jsxs(DropdownMenu2, { children: [
|
|
159666
|
+
useThumbnailGrid && repeaterOps.items.length === 0 ? null : /* @__PURE__ */ jsx("div", { className: "mt-3", children: isPolymorphic ? /* @__PURE__ */ jsxs(DropdownMenu2, { children: [
|
|
158982
159667
|
/* @__PURE__ */ jsx(DropdownMenuTrigger2, { asChild: true, children: /* @__PURE__ */ jsxs(Button, { ref: addButtonRef, type: "button", variant: "secondary", disabled: addDisabled, children: [
|
|
158983
159668
|
/* @__PURE__ */ jsx(Plus, { className: "mr-2 h-4 w-4" }),
|
|
158984
159669
|
"Add ",
|
|
@@ -159485,7 +160170,7 @@ function sanitizeSlugInput(value, maxLength) {
|
|
|
159485
160170
|
}
|
|
159486
160171
|
|
|
159487
160172
|
// ../block-form/src/widgets/SlugField/utils/slugUtils.ts
|
|
159488
|
-
function
|
|
160173
|
+
function isRecord23(value) {
|
|
159489
160174
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
159490
160175
|
}
|
|
159491
160176
|
function isUnknownArray6(value) {
|
|
@@ -159501,7 +160186,7 @@ function ensureUniqueSlug(candidate, backend, collectionPath, currentIndex, fiel
|
|
|
159501
160186
|
for (let i2 = 0; i2 < items.length; i2 += 1) {
|
|
159502
160187
|
if (i2 === currentIndex) continue;
|
|
159503
160188
|
const item = items[i2];
|
|
159504
|
-
if (
|
|
160189
|
+
if (isRecord23(item)) {
|
|
159505
160190
|
const value = item[fieldId];
|
|
159506
160191
|
if (typeof value === "string") {
|
|
159507
160192
|
const normalized = normalize2(value.trim());
|
|
@@ -159744,7 +160429,8 @@ function evaluateVisibility(field, backend, path) {
|
|
|
159744
160429
|
if (conditions.length === 0) {
|
|
159745
160430
|
return true;
|
|
159746
160431
|
}
|
|
159747
|
-
return
|
|
160432
|
+
return evaluateVisibleWhen(
|
|
160433
|
+
visibleWhen,
|
|
159748
160434
|
(condition) => evaluateVisibilityCondition(condition, backend, path)
|
|
159749
160435
|
);
|
|
159750
160436
|
}
|
|
@@ -181606,7 +182292,7 @@ function requireUseSyncExternalStoreShim_development() {
|
|
|
181606
182292
|
return x === y2 && (x !== 0 || 1 / x === 1 / y2) || x !== x && y2 !== y2;
|
|
181607
182293
|
}
|
|
181608
182294
|
var objectIs = typeof Object.is === "function" ? Object.is : is;
|
|
181609
|
-
var useState95 = React$1.useState,
|
|
182295
|
+
var useState95 = React$1.useState, useEffect101 = React$1.useEffect, useLayoutEffect11 = React$1.useLayoutEffect, useDebugValue2 = React$1.useDebugValue;
|
|
181610
182296
|
var didWarnOld18Alpha = false;
|
|
181611
182297
|
var didWarnUncachedGetSnapshot = false;
|
|
181612
182298
|
function useSyncExternalStore7(subscribe, getSnapshot, getServerSnapshot) {
|
|
@@ -181643,7 +182329,7 @@ function requireUseSyncExternalStoreShim_development() {
|
|
|
181643
182329
|
});
|
|
181644
182330
|
}
|
|
181645
182331
|
}, [subscribe, value, getSnapshot]);
|
|
181646
|
-
|
|
182332
|
+
useEffect101(function() {
|
|
181647
182333
|
if (checkIfSnapshotChanged(inst)) {
|
|
181648
182334
|
forceUpdate({
|
|
181649
182335
|
inst
|
|
@@ -181908,9 +182594,9 @@ function requireWithSelector_development() {
|
|
|
181908
182594
|
}
|
|
181909
182595
|
var objectIs = typeof Object.is === "function" ? Object.is : is;
|
|
181910
182596
|
var useSyncExternalStore7 = shim2.useSyncExternalStore;
|
|
181911
|
-
var
|
|
182597
|
+
var useRef83 = React$1.useRef, useEffect101 = React$1.useEffect, useMemo92 = React$1.useMemo, useDebugValue2 = React$1.useDebugValue;
|
|
181912
182598
|
function useSyncExternalStoreWithSelector(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) {
|
|
181913
|
-
var instRef =
|
|
182599
|
+
var instRef = useRef83(null);
|
|
181914
182600
|
var inst;
|
|
181915
182601
|
if (instRef.current === null) {
|
|
181916
182602
|
inst = {
|
|
@@ -181965,7 +182651,7 @@ function requireWithSelector_development() {
|
|
|
181965
182651
|
return [getSnapshotWithSelector, getServerSnapshotWithSelector];
|
|
181966
182652
|
}, [getSnapshot, getServerSnapshot, selector, isEqual]), getSelection2 = _useMemo[0], getServerSelection = _useMemo[1];
|
|
181967
182653
|
var value = useSyncExternalStore7(subscribe, getSelection2, getServerSelection);
|
|
181968
|
-
|
|
182654
|
+
useEffect101(function() {
|
|
181969
182655
|
inst.hasValue = true;
|
|
181970
182656
|
inst.value = value;
|
|
181971
182657
|
}, [value]);
|
|
@@ -182423,7 +183109,7 @@ function normaliseDoc(doc3) {
|
|
|
182423
183109
|
}
|
|
182424
183110
|
|
|
182425
183111
|
// ../editor/src/primitives/rich-text/sanitize.ts
|
|
182426
|
-
function
|
|
183112
|
+
function isRecord24(value) {
|
|
182427
183113
|
return typeof value === "object" && value !== null;
|
|
182428
183114
|
}
|
|
182429
183115
|
function getFromMapLike(mapLike, name) {
|
|
@@ -182448,7 +183134,7 @@ function parentInlineContent(parentType) {
|
|
|
182448
183134
|
return Boolean(p2?.inlineContent);
|
|
182449
183135
|
}
|
|
182450
183136
|
function extractText(nodeJson) {
|
|
182451
|
-
if (!
|
|
183137
|
+
if (!isRecord24(nodeJson)) return "";
|
|
182452
183138
|
if (nodeJson.type === "text" && typeof nodeJson.text === "string") {
|
|
182453
183139
|
return nodeJson.text;
|
|
182454
183140
|
}
|
|
@@ -182459,13 +183145,13 @@ function sanitizeMarksJson(schema, marks, unsupported) {
|
|
|
182459
183145
|
if (!Array.isArray(marks)) return void 0;
|
|
182460
183146
|
const out = [];
|
|
182461
183147
|
for (const markJson of marks) {
|
|
182462
|
-
if (!
|
|
183148
|
+
if (!isRecord24(markJson) || typeof markJson.type !== "string") continue;
|
|
182463
183149
|
if (!schemaHasMark(schema, markJson.type)) {
|
|
182464
183150
|
unsupported.marks.add(markJson.type);
|
|
182465
183151
|
continue;
|
|
182466
183152
|
}
|
|
182467
183153
|
const next = { type: markJson.type };
|
|
182468
|
-
if (
|
|
183154
|
+
if (isRecord24(markJson.attrs)) next.attrs = markJson.attrs;
|
|
182469
183155
|
out.push(next);
|
|
182470
183156
|
}
|
|
182471
183157
|
return out.length > 0 ? out : void 0;
|
|
@@ -182474,7 +183160,7 @@ function coerceChildrenForParentJson(schema, parentType, children) {
|
|
|
182474
183160
|
if (parentInlineContent(parentType)) {
|
|
182475
183161
|
const inlines = [];
|
|
182476
183162
|
for (const child of children) {
|
|
182477
|
-
if (
|
|
183163
|
+
if (isRecord24(child) && typeof child.type === "string" && nodeTypeIsInline(schema, child.type)) {
|
|
182478
183164
|
inlines.push(child);
|
|
182479
183165
|
continue;
|
|
182480
183166
|
}
|
|
@@ -182497,7 +183183,7 @@ function coerceChildrenForParentJson(schema, parentType, children) {
|
|
|
182497
183183
|
inlineBuffer = [];
|
|
182498
183184
|
};
|
|
182499
183185
|
for (const child of children) {
|
|
182500
|
-
if (
|
|
183186
|
+
if (isRecord24(child) && typeof child.type === "string" && nodeTypeIsInline(schema, child.type)) {
|
|
182501
183187
|
inlineBuffer.push(child);
|
|
182502
183188
|
continue;
|
|
182503
183189
|
}
|
|
@@ -182508,7 +183194,7 @@ function coerceChildrenForParentJson(schema, parentType, children) {
|
|
|
182508
183194
|
return blocks;
|
|
182509
183195
|
}
|
|
182510
183196
|
function sanitizeNodeJson(schema, nodeJson, parentType, unsupported) {
|
|
182511
|
-
if (!
|
|
183197
|
+
if (!isRecord24(nodeJson) || typeof nodeJson.type !== "string") return [];
|
|
182512
183198
|
const type = nodeJson.type;
|
|
182513
183199
|
if (type === "text") {
|
|
182514
183200
|
const text2 = typeof nodeJson.text === "string" ? nodeJson.text : "";
|
|
@@ -182529,7 +183215,7 @@ function sanitizeNodeJson(schema, nodeJson, parentType, unsupported) {
|
|
|
182529
183215
|
const coercedChildren = coerceChildrenForParentJson(schema, nodeType, sanitizedChildren);
|
|
182530
183216
|
const marks = sanitizeMarksJson(schema, nodeJson.marks, unsupported);
|
|
182531
183217
|
const next = { type };
|
|
182532
|
-
if (
|
|
183218
|
+
if (isRecord24(nodeJson.attrs)) next.attrs = nodeJson.attrs;
|
|
182533
183219
|
if (marks) next.marks = marks;
|
|
182534
183220
|
if (hasRawChildren || coercedChildren.length > 0) next.content = coercedChildren;
|
|
182535
183221
|
return [next];
|
|
@@ -182549,7 +183235,7 @@ function sanitizeRichTextContentForSchema(schema, content) {
|
|
|
182549
183235
|
const coerced = coerceChildrenForParentJson(schema, topType, children);
|
|
182550
183236
|
const out = { type: "doc", content: coerced };
|
|
182551
183237
|
const maybeAttrs = docJson.attrs;
|
|
182552
|
-
if (
|
|
183238
|
+
if (isRecord24(maybeAttrs)) {
|
|
182553
183239
|
out.attrs = maybeAttrs;
|
|
182554
183240
|
}
|
|
182555
183241
|
return {
|
|
@@ -183110,7 +183796,7 @@ function recordPreviewDesignHistoryDomain(state, domainId) {
|
|
|
183110
183796
|
};
|
|
183111
183797
|
}
|
|
183112
183798
|
function confirmPreviewDesignHistoryUndo(state, domainId) {
|
|
183113
|
-
if (state.past.
|
|
183799
|
+
if (state.past[state.past.length - 1] !== domainId) return state;
|
|
183114
183800
|
return {
|
|
183115
183801
|
past: state.past.slice(0, -1),
|
|
183116
183802
|
future: [domainId, ...state.future]
|
|
@@ -183124,7 +183810,7 @@ function confirmPreviewDesignHistoryRedo(state, domainId) {
|
|
|
183124
183810
|
};
|
|
183125
183811
|
}
|
|
183126
183812
|
function selectPreviewDesignHistoryDomain(state, command2, capabilities) {
|
|
183127
|
-
const domainId = command2 === "undo" ? state.past.
|
|
183813
|
+
const domainId = command2 === "undo" ? state.past[state.past.length - 1] : state.future[0];
|
|
183128
183814
|
if (!domainId) return null;
|
|
183129
183815
|
const domain2 = capabilities[domainId];
|
|
183130
183816
|
if (domain2.isPending || domain2.isStale) return null;
|
|
@@ -183140,7 +183826,7 @@ function selectPreviewDesignHistoryDomain(state, command2, capabilities) {
|
|
|
183140
183826
|
function previewDesignHistoryDomainForCommand(state, command2) {
|
|
183141
183827
|
switch (command2) {
|
|
183142
183828
|
case "undo":
|
|
183143
|
-
return state.past.
|
|
183829
|
+
return state.past[state.past.length - 1] ?? null;
|
|
183144
183830
|
case "redo":
|
|
183145
183831
|
return state.future[0] ?? null;
|
|
183146
183832
|
default:
|
|
@@ -183261,7 +183947,7 @@ function deriveStagedSessionCapabilities(state) {
|
|
|
183261
183947
|
requiresReload: true
|
|
183262
183948
|
};
|
|
183263
183949
|
default:
|
|
183264
|
-
return
|
|
183950
|
+
return assertNever11(state, "Unhandled editor staged session state");
|
|
183265
183951
|
}
|
|
183266
183952
|
}
|
|
183267
183953
|
function beginStagedSession(state, transaction) {
|
|
@@ -183274,7 +183960,7 @@ function beginStagedSession(state, transaction) {
|
|
|
183274
183960
|
case "stale":
|
|
183275
183961
|
return state;
|
|
183276
183962
|
default:
|
|
183277
|
-
return
|
|
183963
|
+
return assertNever11(state, "Unhandled editor staged session state");
|
|
183278
183964
|
}
|
|
183279
183965
|
}
|
|
183280
183966
|
function applyStagedSession(state) {
|
|
@@ -183287,7 +183973,7 @@ function applyStagedSession(state) {
|
|
|
183287
183973
|
case "stale":
|
|
183288
183974
|
return state;
|
|
183289
183975
|
default:
|
|
183290
|
-
return
|
|
183976
|
+
return assertNever11(state, "Unhandled editor staged session state");
|
|
183291
183977
|
}
|
|
183292
183978
|
}
|
|
183293
183979
|
function confirmStagedSession(state) {
|
|
@@ -183315,7 +184001,7 @@ function cancelStagedSession(state) {
|
|
|
183315
184001
|
case "applying":
|
|
183316
184002
|
return state;
|
|
183317
184003
|
default:
|
|
183318
|
-
return
|
|
184004
|
+
return assertNever11(state, "Unhandled editor staged session state");
|
|
183319
184005
|
}
|
|
183320
184006
|
}
|
|
183321
184007
|
function enqueueTransaction(state, transaction) {
|
|
@@ -183349,7 +184035,7 @@ function enqueueTransaction(state, transaction) {
|
|
|
183349
184035
|
case "stale":
|
|
183350
184036
|
return state;
|
|
183351
184037
|
default:
|
|
183352
|
-
return
|
|
184038
|
+
return assertNever11(state, "Unhandled editor transaction queue state");
|
|
183353
184039
|
}
|
|
183354
184040
|
}
|
|
183355
184041
|
function beginAutosaveBatch(state) {
|
|
@@ -183366,7 +184052,7 @@ function beginAutosaveBatch(state) {
|
|
|
183366
184052
|
case "stale":
|
|
183367
184053
|
return state;
|
|
183368
184054
|
default:
|
|
183369
|
-
return
|
|
184055
|
+
return assertNever11(state, "Unhandled editor transaction queue state");
|
|
183370
184056
|
}
|
|
183371
184057
|
}
|
|
183372
184058
|
function confirmAutosaveBatch(state) {
|
|
@@ -183401,7 +184087,7 @@ function mergeBatchAndFollowUpTransactions(batch, followUp) {
|
|
|
183401
184087
|
batch
|
|
183402
184088
|
);
|
|
183403
184089
|
}
|
|
183404
|
-
function
|
|
184090
|
+
function assertNever11(value, message2) {
|
|
183405
184091
|
throw new Error(`${message2}: ${JSON.stringify(value)}`);
|
|
183406
184092
|
}
|
|
183407
184093
|
|
|
@@ -187835,4 +188521,4 @@ lucide-react/dist/esm/lucide-react.mjs:
|
|
|
187835
188521
|
*)
|
|
187836
188522
|
*/
|
|
187837
188523
|
|
|
187838
|
-
export { AMBIENT_BACKGROUND_ROLES2 as AMBIENT_BACKGROUND_ROLES, ArrowDown, ArrowUp, BackgroundColorField, BackgroundGradientField, Badge2 as Badge, BlockApiProvider, Box, Button, CSS2 as CSS, Callout, CalloutDescription, CalloutTitle, Card, CardContent, CardHeader, CardTitle, Check, ChevronDown, ChevronLeft, ChevronRight, Collapsible2 as Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, ColorPicker, Combobox, CommandMultiSelect, Content, ContentFieldsForm, ContentSpinner, Copy, DEFAULT_LAUNCH_READINESS_INPUT, Dialog2 as Dialog, DialogClose2 as DialogClose, DialogContent2 as DialogContent, DialogDescription2 as DialogDescription, DialogFooter, DialogHeader, DialogTitle2 as DialogTitle, DndContext, DropdownMenu2 as DropdownMenu, DropdownMenuContent2 as DropdownMenuContent, DropdownMenuItem2 as DropdownMenuItem, DropdownMenuLabel2 as DropdownMenuLabel, DropdownMenuSeparator2 as DropdownMenuSeparator, DropdownMenuTrigger2 as DropdownMenuTrigger, EDITABLE_SURFACE_FORWARDING_PROP, EMPTY_DOC, EditableBlockProvider, EditorChrome, EditorProvider, EllipsisVertical, EmptyState2 as EmptyState, EntryControllerProvider, EyeOff, FieldFrame, FixedBottomSurface, FormRenderer, GRADIENT_PRESETS, GripVertical, Image, ImagePlus, Input, KeyboardCode, LINKED_CONTENT_ENTRY_META_KEY, Label4 as Label, List2 as List, LoaderCircle, ManifestForm, Maximize2, MediaEditor, MediaEditorProvider, MediaPickerDialog, MediaPickerMini, Monitor, PAGE_DESIGN_EDITOR_STATE_FETCH_ERROR_MESSAGE, PUBLIC_FILE_FIELD_KINDS, PageRenderer, Palette, PaletteProvider, Pencil, Plus, PointerSensor, PreviewDesignCoordinatorProvider, PreviewDesignHistoryOrderProvider, PreviewRichTextEditor, PreviewTextEditor, PreviewThemeOverlayProvider, ResizableSplitPane, RichText2 as RichText, RichTextEditorSurface, Root2, RotateCcw, SECTION_BACKGROUND_MIN_SOURCE_HEIGHT, SECTION_BACKGROUND_MIN_SOURCE_WIDTH, SITE_CHROME_CLASS_NAMES, SITE_CHROME_VISIBLE_HEADER_SELECTOR, SUBROUTE_KINDS, ScrollableDialogContent, SdkConfigProvider, Search, Select2 as Select, SelectContent2 as SelectContent, SelectItem2 as SelectItem, SelectTrigger2 as SelectTrigger, SelectValue2 as SelectValue, Separator2 as Separator, Settings, SiteChromeCustomizeProvider, SiteDocumentLayout, Smartphone, Sparkles, Surface, Tablet, Tabs2 as Tabs, TabsContent2 as TabsContent, TabsList2 as TabsList, TabsTrigger2 as TabsTrigger, Text2 as Text, Textarea, ThemeScope, Trash2, TriangleAlert, Trigger, Upload, X, applyBackgroundOverrideContentPatch, applyCompiledRuntimeFieldsToContent, applyFeatureCardIconSuggestions, applyPageDesignEditorAction, applyResolvedSelections, asDesignBlockId, asRecord, assertNever, assertNever5 as assertNever2, attachRenderableMediaAssetFields, augmentManifestWithStyleGroups, backgroundColorTokens, backgroundOverrideEquals, beginAutosaveBatch, buildApplySiteStyleSelectionBody, buildEditorModelRuntimeFieldsByBlockId, buildSiteChromeLookModels, buildThemeRuntime, buttonPersonalities, canCycleBackgroundOverrideValue, canRedoHistory, canUndoHistory, cancelPreview, classifyHistoryShortcut, classifyKnownMimeType, clearTypographyFontOverrides, clientComponentRegistry, closestCenter, cn, confirmAutosaveBatch, createBlock, createCustomBlockRegistry, createEditorInsertBlockCommand, createEditorRemoveBlockCommand, createEditorReorderBlocksCommand, createEntrySlotBlock, createFeatureCardIconKey, createHistoryState, createManifestFormAdapter, createManifestValidation, createMicrobatcher, createOptimisticActionRunner, createRoutingHelpers, createSnapshotFromPageRecord, createStoreBackend, createStyleConfiguratorState, curatedSiteStyles, cycleSiteChromeLookId, cycleableSiteChromeOptions, decodePublicProductCategorySelectorQuery, defaultBackgroundOverrideForMode, defaultSectionTransitionVariantForFamily, deleteBlock, deleteEntrySlotBlock, deriveLaunchReadiness, deriveRouteMetadataPresentation, deriveStyleConfiguratorCapabilities, deriveTransactionCapabilities, designRuntimeRulesForTheme, dismissNotices, dismissWarnings, emitMediaCropDebug, enabledBackgroundModes, enqueueTransaction, evaluateTypographyFontSlot, evaluateVisibility, expectParsedBrandedId, findButtonPersonality, findFooterLook, findPaletteVariant, findTypographyPreset, foldSubroute, formatSiteChromeBackgroundTokenLabel, getBlockDefinition, getBlockIconSemanticFallbackId, getClientRect, getCuratedSiteStyle, getDirectImageUrlForMediaAsset, getFeatureCardIconCompletion, getFieldIntent, getFooterLayout, getGeneratedBlockIconStyleState, getHeaderLayout, getHeaderStyle, getIconComponent, getIconPickerOptionsForPreset, getLinkedContentEntryMeta, getModalConfig, getPageDesignEditorState, getRichTextImagePositionFromTarget, gradientToCss, idleEditorTransactionQueueState, imagePoolForOverride, inferLegacyOfferingsPreviewGroupOrder, insertOrReplaceRichTextImage, isHeaderField, isIconPickerPreset, isInternalResolvedLinkValue, isKeyboardEvent, isKnownIconName, isNonEmptyValue, isObjectRecord2 as isObjectRecord, isOfferingsPreviewSourceKey, isPreviewingChange, isSupportedLoaderEndpoint, isSvgMimeType, isThemeV2NormalEditorRawStyleFieldName, isThemeV2NormalEditorRawStylePath, listBlockDescriptors, listContentTypes, listEntryPageContentSlots, lucide_react_exports, markApplyFailed, markApplySaved, markApplySaving, mergeBlockDescriptorsWithRegistry, mergeManifestWithSdkOptions, mutateBlockContent, normalEditorCuratedPromotedFieldPaths, normalizeOfferingsPreviewGroupOrder, normalizePickerSearchThreshold, normalizePublicApiLoaderParams, openRow, paletteOverridesSchema, paletteVariants, parseAspectRatioValue, parseBackgroundOverrideFromContent, parseBlockIconValue, parseMediaAssetId, parseSiteIconStyleGuideVersionId, parseSiteId, planBackgroundOverride, planBackgroundTransition, planPageDesignLayoutLookCompatibility, planSiteChromeFooterLayoutSelection, planSiteChromeLookSelection, planSiteDocument, planSiteStylePreviewChange, prefetchBlockData, previewAssistantEnabled, previewButtonPersonality, previewDesignHistoryDomainForCommand, previewFooterLook, previewHeaderLayout, previewHeaderStyle, previewPaletteVariant, previewSiteStyle, previewTypographyPreset, pushHistoryEntry, rankBackgroundImagePoolItems, recoveryConflictCopy, redoHistory, rejectAutosaveBatch, renderBlock, reorderBlocks, reorderEntrySlotBlocks, requireEntriesForCuratedChoices, resolveBackgroundCapability, resolveBlockTitle, resolveContentTitle, resolveIconPickerPreset, resolveImageUrlWithContext, resolveMediaSlotContract, resolveOfferingsPreviewGroupOrderEntries, resolvePageRouteSlug, resolvePickerSelectionLabel, resolvePreviewSidebarTab, resolveStyleConfiguratorInitialSnapshot, resolveVideoSelectionIntentForMediaField, resolveVisiblePromotedFieldPathsForEditorBlock, sectionTransitionFamilies, sectionTransitionFamilyForBoundaryOptionId, sectionTransitionVariantForBoundaryOptionId, selectPreviewDesignHistoryDomain, selectionSnapshotFromApplySiteStyleSelectionResponse, setPaletteOverrides, setTypographyBodyFontOverride, setTypographyHeadingFontOverride, shouldShowPickerSearch, siteFooterManifest, siteHeaderManifest, siteOptionSources, stableSerialize, styleConfiguratorHistoryEntryForPersistedSelection, suggestFeatureCardSemanticIcons, suggestSemanticIconForFeatureCard, surfaceResolutionContextFromTheme, syncStyleConfiguratorState, systemCustomizeFacetAppliesToLayoutVariant, systemCustomizeFacetApplyContentPatch, systemCustomizeFacetCurrentValue, systemCustomizeFacetDefinitionForBlock, systemCustomizeFacetDefinitionsForBlock, systemCustomizeFacetLabelForValue, systemCustomizeFacetNextValue, systemCustomizeFacetRollbackContentPatch, toFeatureCardIconSuggestionInputs, toRoutableLinkPayload, toggleRow, typographyPresets, undoHistory, unfinishedBlockCopy, unsafeAsEditorBlockId, unsafeAsEditorBlockValues, unsafeAsLinkedContentEntryId, unwrapResponse, useAsyncPickerOptions, useBackendWatch, useBlockContext, useCombinedRefs, useDebouncedLatestSave, useDndContext, useDraggable, useDroppable, useEditor, useEditorUiStore, useEditorUiStoreInstance, useEntryController, useEntryEditorController, useField, useIsomorphicLayoutEffect3 as useIsomorphicLayoutEffect, useMediaEditor, useMediaEditorOptional, useMultiAutosave, useOptionalEditorUiStoreInstance, usePreviewDesignCoordinator, usePreviewDesignHistoryOrder, usePreviewThemeOverlay, useRichTextEditor, useSdkConfig, useSensor, useSensors, useSiteChromeCustomizeOptional, useUISelector, useUniqueId, validateBlockManifestIssues, visibleHeaderClearancePx };
|
|
188524
|
+
export { AMBIENT_BACKGROUND_ROLES2 as AMBIENT_BACKGROUND_ROLES, ArrowDown, ArrowUp, BackgroundColorField, BackgroundGradientField, Badge2 as Badge, BlockApiProvider, Box, Button, CSS2 as CSS, Callout, CalloutDescription, CalloutTitle, Card, CardContent, CardHeader, CardTitle, Check, ChevronDown, ChevronLeft, ChevronRight, Collapsible2 as Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, ColorPicker, Combobox, CommandMultiSelect, Content, ContentFieldsForm, ContentSpinner, Copy, DEFAULT_LAUNCH_READINESS_INPUT, Dialog2 as Dialog, DialogClose2 as DialogClose, DialogContent2 as DialogContent, DialogDescription2 as DialogDescription, DialogFooter, DialogHeader, DialogTitle2 as DialogTitle, DndContext, DropdownMenu2 as DropdownMenu, DropdownMenuContent2 as DropdownMenuContent, DropdownMenuItem2 as DropdownMenuItem, DropdownMenuLabel2 as DropdownMenuLabel, DropdownMenuSeparator2 as DropdownMenuSeparator, DropdownMenuTrigger2 as DropdownMenuTrigger, EDITABLE_SURFACE_FORWARDING_PROP, EMPTY_DOC, EditableBlockProvider, EditorChrome, EditorProvider, EllipsisVertical, EmptyState2 as EmptyState, EntryControllerProvider, EyeOff, FieldFrame, FixedBottomSurface, FormRenderer, GRADIENT_PRESETS, GripVertical, Image, ImagePlus, Input, KeyboardCode, LINKED_CONTENT_ENTRY_META_KEY, Label4 as Label, List2 as List, LoaderCircle, ManifestForm, Maximize2, MediaEditor, MediaEditorProvider, MediaPickerDialog, MediaPickerMini, Monitor, PAGE_DESIGN_EDITOR_STATE_FETCH_ERROR_MESSAGE, PUBLIC_FILE_FIELD_KINDS, PageRenderer, Palette, PaletteProvider, Pencil, Plus, PointerSensor, PreviewDesignCoordinatorProvider, PreviewDesignHistoryOrderProvider, PreviewRichTextEditor, PreviewTextEditor, PreviewThemeOverlayProvider, ResizableSplitPane, ResponsiveScope, RichText2 as RichText, RichTextEditorSurface, Root2, RotateCcw, SECTION_BACKGROUND_MIN_SOURCE_HEIGHT, SECTION_BACKGROUND_MIN_SOURCE_WIDTH, SITE_CHROME_CLASS_NAMES, SITE_CHROME_VISIBLE_HEADER_SELECTOR, SUBROUTE_KINDS, ScrollableDialogContent, SdkConfigProvider, Search, Select2 as Select, SelectContent2 as SelectContent, SelectItem2 as SelectItem, SelectTrigger2 as SelectTrigger, SelectValue2 as SelectValue, Separator2 as Separator, Settings, SiteChromeCustomizeProvider, SiteDocumentLayout, Smartphone, Sparkles, Surface, Tablet, Tabs2 as Tabs, TabsContent2 as TabsContent, TabsList2 as TabsList, TabsTrigger2 as TabsTrigger, Text2 as Text, Textarea, ThemeScope, Trash2, TriangleAlert, Trigger, Upload, X, applyBackgroundOverrideContentPatch, applyCompiledRuntimeFieldsToContent, applyFeatureCardIconSuggestions, applyPageDesignEditorAction, applyResolvedSelections, asDesignBlockId, asRecord, assertNever, assertNever5 as assertNever2, attachRenderableMediaAssetFields, augmentManifestWithStyleGroups, backgroundColorTokens, backgroundOverrideEquals, beginAutosaveBatch, buildApplySiteStyleSelectionBody, buildEditorModelRuntimeFieldsByBlockId, buildSiteChromeLookModels, buildThemeRuntime, buttonPersonalities, canCycleBackgroundOverrideValue, canRedoHistory, canUndoHistory, cancelPreview, classifyHistoryShortcut, classifyKnownMimeType, clearTypographyFontOverrides, clientComponentRegistry, closestCenter, cn, confirmAutosaveBatch, createBlock, createCustomBlockRegistry, createEditorInsertBlockCommand, createEditorRemoveBlockCommand, createEditorReorderBlocksCommand, createEntrySlotBlock, createFeatureCardIconKey, createHistoryState, createManifestFormAdapter, createManifestValidation, createMicrobatcher, createOptimisticActionRunner, createRoutingHelpers, createSnapshotFromPageRecord, createStoreBackend, createStyleConfiguratorState, curatedSiteStyles, cycleSiteChromeLookId, cycleableSiteChromeOptions, decodePublicProductCategorySelectorQuery, defaultBackgroundOverrideForMode, defaultSectionTransitionVariantForFamily, deleteBlock, deleteEntrySlotBlock, deriveLaunchReadiness, deriveRouteMetadataPresentation, deriveStyleConfiguratorCapabilities, deriveTransactionCapabilities, designRuntimeRulesForTheme, dismissNotices, dismissWarnings, emitMediaCropDebug, enabledBackgroundModes, enqueueTransaction, evaluateTypographyFontSlot, evaluateVisibility, expectParsedBrandedId, findButtonPersonality, findFooterLook, findPaletteVariant, findTypographyPreset, foldSubroute, formatSiteChromeBackgroundTokenLabel, getBlockDefinition, getBlockIconSemanticFallbackId, getClientRect, getCuratedSiteStyle, getDirectImageUrlForMediaAsset, getFeatureCardIconCompletion, getFieldIntent, getFooterLayout, getGeneratedBlockIconStyleState, getHeaderLayout, getHeaderStyle, getIconComponent, getIconPickerOptionsForPreset, getLinkedContentEntryMeta, getModalConfig, getPageDesignEditorState, getRichTextImagePositionFromTarget, gradientToCss, idleEditorTransactionQueueState, imagePoolForOverride, inferLegacyOfferingsPreviewGroupOrder, insertOrReplaceRichTextImage, isHeaderField, isIconPickerPreset, isInternalResolvedLinkValue, isKeyboardEvent, isKnownIconName, isNonEmptyValue, isObjectRecord2 as isObjectRecord, isOfferingsPreviewSourceKey, isPreviewingChange, isSupportedLoaderEndpoint, isSvgMimeType, isThemeV2NormalEditorRawStyleFieldName, isThemeV2NormalEditorRawStylePath, listBlockDescriptors, listContentTypes, listEntryPageContentSlots, lucide_react_exports, markApplyFailed, markApplySaved, markApplySaving, mergeBlockDescriptorsWithRegistry, mergeManifestWithSdkOptions, mutateBlockContent, normalEditorCuratedPromotedFieldPaths, normalizeOfferingsPreviewGroupOrder, normalizePickerSearchThreshold, normalizePublicApiLoaderParams, openRow, paletteOverridesSchema, paletteVariants, parseAspectRatioValue, parseBackgroundOverrideFromContent, parseBlockIconValue, parseMediaAssetId, parseSiteIconStyleGuideVersionId, parseSiteId, planBackgroundOverride, planBackgroundTransition, planPageDesignLayoutLookCompatibility, planSiteChromeFooterLayoutSelection, planSiteChromeLookSelection, planSiteDocument, planSiteStylePreviewChange, prefetchBlockData, previewAssistantEnabled, previewButtonPersonality, previewDesignHistoryDomainForCommand, previewFooterLook, previewHeaderLayout, previewHeaderStyle, previewPaletteVariant, previewSiteStyle, previewTypographyPreset, pushHistoryEntry, rankBackgroundImagePoolItems, recoveryConflictCopy, redoHistory, rejectAutosaveBatch, renderBlock, reorderBlocks, reorderEntrySlotBlocks, requireEntriesForCuratedChoices, resolveBackgroundCapability, resolveBlockTitle, resolveContentTitle, resolveIconPickerPreset, resolveImageUrlWithContext, resolveMediaSlotContract, resolveOfferingsPreviewGroupOrderEntries, resolvePageRouteSlug, resolvePickerSelectionLabel, resolvePreviewSidebarTab, resolveStyleConfiguratorInitialSnapshot, resolveVideoSelectionIntentForMediaField, resolveVisiblePromotedFieldPathsForEditorBlock, sectionTransitionFamilies, sectionTransitionFamilyForBoundaryOptionId, sectionTransitionVariantForBoundaryOptionId, selectPreviewDesignHistoryDomain, selectionSnapshotFromApplySiteStyleSelectionResponse, setPaletteOverrides, setTypographyBodyFontOverride, setTypographyHeadingFontOverride, shouldShowPickerSearch, siteFooterManifest, siteHeaderManifest, siteOptionSources, stableSerialize, styleConfiguratorHistoryEntryForPersistedSelection, suggestFeatureCardSemanticIcons, suggestSemanticIconForFeatureCard, surfaceResolutionContextFromTheme, syncStyleConfiguratorState, systemCustomizeFacetAppliesToLayoutVariant, systemCustomizeFacetApplyContentPatch, systemCustomizeFacetCurrentValue, systemCustomizeFacetDefinitionForBlock, systemCustomizeFacetDefinitionsForBlock, systemCustomizeFacetLabelForValue, systemCustomizeFacetNextValue, systemCustomizeFacetRollbackContentPatch, toFeatureCardIconSuggestionInputs, toRoutableLinkPayload, toggleRow, typographyPresets, undoHistory, unfinishedBlockCopy, unsafeAsEditorBlockId, unsafeAsEditorBlockValues, unsafeAsLinkedContentEntryId, unwrapResponse, useAsyncPickerOptions, useBackendWatch, useBlockContext, useCombinedRefs, useDebouncedLatestSave, useDndContext, useDraggable, useDroppable, useEditor, useEditorUiStore, useEditorUiStoreInstance, useEntryController, useEntryEditorController, useField, useIsomorphicLayoutEffect3 as useIsomorphicLayoutEffect, useMediaEditor, useMediaEditorOptional, useMultiAutosave, useOptionalEditorUiStoreInstance, usePreviewDesignCoordinator, usePreviewDesignHistoryOrder, usePreviewThemeOverlay, useRichTextEditor, useSdkConfig, useSensor, useSensors, useSiteChromeCustomizeOptional, useUISelector, useUniqueId, validateBlockManifestIssues, visibleHeaderClearancePx };
|