@riverbankcms/sdk 0.132.0 → 0.134.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/dist/{PreviewEditorSidebar-DKQ5eFK9.mjs → PreviewEditorSidebar-DfRhJPFQ.mjs} +3 -3
- package/dist/{PreviewEditorUI-CNTcOjCC.mjs → PreviewEditorUI-Dppxcr_g.mjs} +2 -2
- package/dist/{SdkPreviewModeRuntime-DJu3qu33.mjs → SdkPreviewModeRuntime-8CyGCXir.mjs} +46 -15
- package/dist/{SiteChromeCustomizeContext-2TzT3vbj.mjs → SiteChromeCustomizeContext-DVMTMvqA.mjs} +497 -169
- package/dist/_dts/ai/src/contracts/proposals.d.ts +384 -384
- package/dist/_dts/ai/src/contracts/siteStyleProposalSchemas.d.ts +219 -219
- package/dist/_dts/api/src/accountApi.d.ts +5 -5
- package/dist/_dts/api/src/appointmentEndpointDefinitions.d.ts +1 -1
- package/dist/_dts/api/src/bookingOperations.d.ts +2 -14
- package/dist/_dts/api/src/bookings.d.ts +2 -2
- package/dist/_dts/api/src/contentRuntime.d.ts +1 -1
- package/dist/_dts/api/src/courseEndpointDefinitions.d.ts +2 -2
- package/dist/_dts/api/src/endpoints.d.ts +3 -3
- package/dist/_dts/api/src/indexCoreTypes.d.ts +1 -1
- package/dist/_dts/api/src/navigation/contracts.d.ts +9 -6
- package/dist/_dts/api/src/navigation/linkResolver.d.ts +6 -2
- package/dist/_dts/api/src/navigation/types.d.ts +23 -6
- package/dist/_dts/api/src/navigation.d.ts +1 -1
- package/dist/_dts/api/src/publicBookingService.d.ts +15 -0
- package/dist/_dts/api/src/publicExperience/eventEndpoints.d.ts +3 -1
- package/dist/_dts/api/src/publicExperience/wholeSeriesEndpoints.d.ts +2 -0
- package/dist/_dts/api/src/sdk-event-upsert.d.ts +1 -1
- package/dist/_dts/api/src/sdkThemeWire.d.ts +50 -50
- package/dist/_dts/api/src/siteBanner.d.ts +4 -2
- package/dist/_dts/api/src/types.d.ts +1 -1
- package/dist/_dts/api/src/webhooks.d.ts +12 -12
- package/dist/_dts/blocks/src/client.d.ts +1 -1
- package/dist/_dts/blocks/src/contracts/proof-block-islands.d.ts +28 -72
- package/dist/_dts/blocks/src/index.d.ts +3 -2
- package/dist/_dts/blocks/src/primitives/content/components/RichText.d.ts +2 -2
- package/dist/_dts/blocks/src/primitives/content/primitives.d.ts +1 -0
- package/dist/_dts/blocks/src/system/blocks/events/shared/schemas.d.ts +36 -14
- package/dist/_dts/blocks/src/system/blocks/events/shared/types.d.ts +3 -0
- package/dist/_dts/blocks/src/system/blocks/events/whole-series/schemas.d.ts +3 -3
- package/dist/_dts/blocks/src/system/blocks/events/whole-series/types.d.ts +3 -0
- package/dist/_dts/blocks/src/system/blocks/location-map.d.ts +4 -4
- package/dist/_dts/blocks/src/system/blocks/media-text.d.ts +148 -148
- package/dist/_dts/blocks/src/system/blocks/offerings-preview/model.d.ts +2 -1
- package/dist/_dts/blocks/src/system/blocks/shared/bookingConsent.d.ts +36 -0
- package/dist/_dts/blocks/src/system/manifest/hydrateLinks.d.ts +9 -2
- package/dist/_dts/blocks/src/system/manifest/resolveBlockData.d.ts +8 -0
- package/dist/_dts/blocks/src/system/manifest/schema.d.ts +79 -79
- package/dist/_dts/blocks/src/system/runtime/api/types/appointments.d.ts +2 -11
- package/dist/_dts/blocks/src/system/runtime/api/types/courses.d.ts +2 -0
- package/dist/_dts/blocks/src/system/runtime/api/types/events.d.ts +1 -0
- package/dist/_dts/blocks/src/system/runtime/components/multi-step/DynamicFormFields.d.ts +3 -19
- package/dist/_dts/blocks/src/system/runtime/components/runtime-backed-blocks.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/hooks/useSelectedAppointmentConsentForm.d.ts +2 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.consent.d.ts +10 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.field-values.d.ts +4 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.fields.d.ts +21 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.headless.state.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.interactive.d.ts +38 -144
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.state.d.ts +5 -19
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-runtime-sources.d.ts +3 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/AttendeeDetailsStep.d.ts +2 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/registrationSurface.d.ts +18 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationWizard.d.ts +4 -4
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/validation.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/whole-series/components.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/whole-series/whole-series-registration.headless.contract.d.ts +2 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/eventCollectionContract.d.ts +34 -12
- package/dist/_dts/blocks/src/system/runtime/shared/components/BookingConsentAgreement.d.ts +7 -0
- package/dist/_dts/blocks/src/system/runtime/shared/types.d.ts +1 -0
- package/dist/_dts/blocks/src/system/types/link.d.ts +7 -1
- package/dist/_dts/content-model/src/content-types/schema.d.ts +4 -4
- package/dist/_dts/core/src/booking-consent.d.ts +8 -0
- package/dist/_dts/core/src/index.d.ts +1 -0
- package/dist/_dts/db/src/generated/supabase/database.types.d.ts +9 -3
- package/dist/_dts/db/src/schemas/forms.d.ts +21 -21
- package/dist/_dts/db/src/types/jsonb.d.ts +1 -1
- package/dist/_dts/editor/src/primitives/rich-text/RichTextEditorSurface.d.ts +2 -1
- package/dist/_dts/editor/src/primitives/rich-text/config.d.ts +2 -1
- package/dist/_dts/editor/src/primitives/rich-text/toolbar/linkPopoverUtils.d.ts +3 -2
- package/dist/_dts/editor/src/primitives/rich-text/useRichTextEditor.d.ts +3 -4
- package/dist/_dts/media-core/src/usageScanner.d.ts +1 -1
- package/dist/_dts/sdk/src/bookings/types.d.ts +7 -89
- package/dist/_dts/sdk/src/config/validation.d.ts +30 -30
- package/dist/_dts/sdk/src/contracts/content.d.ts +10 -36
- package/dist/_dts/sdk/src/contracts/rendering.d.ts +1 -1
- package/dist/_dts/sdk/src/manifest/passes/pass1-fields.d.ts +9 -9
- package/dist/_dts/sdk/src/public-api/contracts.d.ts +6 -19
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/_dts/theme-core/src/accordions/types.d.ts +2 -2
- package/dist/_dts/theme-core/src/buttons/types.d.ts +12 -12
- package/dist/_dts/theme-core/src/cards/types.d.ts +5 -5
- package/dist/_dts/theme-core/src/mock-themes/all.d.ts +72 -72
- package/dist/_dts/theme-core/src/navigation/types.d.ts +4 -4
- package/dist/_dts/theme-core/src/palette/colors.d.ts +1 -1
- package/dist/_dts/theme-core/src/palette/curated/types.d.ts +2 -2
- package/dist/_dts/theme-core/src/schema.d.ts +82 -82
- package/dist/_dts/theme-core/src/site-styles/cardRoleVocabulary.d.ts +1 -1
- package/dist/_dts/theme-core/src/site-styles/designState.d.ts +2 -2
- package/dist/_dts/theme-core/src/site-styles/generatedSchemas.d.ts +4 -4
- package/dist/_dts/theme-core/src/site-styles/logoBranding.d.ts +4 -4
- package/dist/_dts/theme-core/src/tokens/themeColorTokens.d.ts +1 -1
- package/dist/_dts/ui/src/badge.d.ts +1 -1
- package/dist/_dts/ui/src/button.d.ts +1 -1
- package/dist/_dts/ui/src/callout.d.ts +1 -1
- package/dist/_dts/ui/src/card.d.ts +1 -1
- package/dist/client/{StepIndicator-CGixP_LW.mjs → BookingConsentAgreement-BxgpGEFD.mjs} +26 -4
- package/dist/client/{DiscountCodeDisclosure-DO7llLxm.mjs → DiscountCodeDisclosure-CfuPOHD0.mjs} +1 -1
- package/dist/client/{EventCombined.client-xID7zN__.mjs → EventCombined.client-DB8Qfzi-.mjs} +3 -3
- package/dist/client/{EventListing.client-CriBslp0.mjs → EventListing.client-DD4X8hp4.mjs} +2 -2
- package/dist/client/{LeafletStaticMap-DYmHnM8g.mjs → LeafletStaticMap-QhgIBQbv.mjs} +1 -1
- package/dist/client/{WholeSeriesRegistrationWizard-BEjzSiOA.mjs → WholeSeriesRegistrationWizard-DwtC7bCs.mjs} +72 -22
- package/dist/client/{accordion-CgFbnnnQ.mjs → accordion-DFXpLvwg.mjs} +1 -1
- package/dist/client/{bookingForm-dUyGpbxc.mjs → bookingForm-sI05d3lk.mjs} +73 -47
- package/dist/client/bookings.mjs +989 -140
- package/dist/client/{carousel-BvBwkUzx.mjs → carousel-wjyWTZCh.mjs} +1 -1
- package/dist/client/{cart-DiZENT2E.mjs → cart-DCwdpA4i.mjs} +3 -3
- package/dist/client/{checkout-Dq13KIgR.mjs → checkout-DTDW3l0R.mjs} +3 -3
- package/dist/client/checkoutUrls-DQYC_Br-.mjs +187 -0
- package/dist/client/client.mjs +556 -237
- package/dist/client/{context-B83PiNzm.mjs → context-TSK1CGx8.mjs} +1 -14
- package/dist/client/{courseRegistration-CKC5NmyH.mjs → courseRegistration-A-Tg7qw_.mjs} +3 -3
- package/dist/client/{eventCalendar-BF0Jatfw.mjs → eventCalendar-B0Zg-i_w.mjs} +5 -5
- package/dist/client/{eventCombined-BuoCF8je.mjs → eventCombined-B8Y2wizd.mjs} +3 -3
- package/dist/client/{eventDetails-CKwh0S9s.mjs → eventDetails-DPDOwURJ.mjs} +3 -3
- package/dist/client/{eventListing-eUxaWFaB.mjs → eventListing-CjBcmSLn.mjs} +3 -3
- package/dist/client/{eventRegistration-CfkNOkPb.mjs → eventRegistration-CK30HsAq.mjs} +111 -64
- package/dist/client/{form-C17H1c_H.mjs → form-CUXfsABE.mjs} +2 -2
- package/dist/client/{headerSection-DEwUmrtt.mjs → headerSection-N-mN3rjr.mjs} +2 -2
- package/dist/client/hooks.mjs +106 -3
- package/dist/client/{locationMap-Pf2QwuvW.mjs → locationMap-oiIDQMBt.mjs} +2 -2
- package/dist/client/{newsletterForm-BWQAH5Sv.mjs → newsletterForm-CkQ2tTrM.mjs} +2 -2
- package/dist/client/{pricing-CVdvbopJ.mjs → pricing-Caa0QWzh.mjs} +1 -1
- package/dist/client/{productDetail-BZi1Fa_G.mjs → productDetail-CnidyrsN.mjs} +3 -3
- package/dist/client/{productList-qq-55DNk.mjs → productList-CttYcS_S.mjs} +3 -3
- package/dist/client/{propsDecoder-BxmqPKdP.mjs → propsDecoder-CeUMxI9a.mjs} +211 -100
- package/dist/client/rendering/client.mjs +428 -151
- package/dist/client/rendering/islands.mjs +18 -18
- package/dist/client/rendering.mjs +643 -324
- package/dist/client/{scrollToBlock-B3CcKdtG.mjs → scrollToBlock-lPr1oqxB.mjs} +1 -1
- package/dist/client/{shop-DNWJPut5.mjs → shop-DXQtMo2O.mjs} +6 -6
- package/dist/client/{shop-commerce-BhvQCosS.mjs → shop-commerce-quDL411J.mjs} +7 -164
- package/dist/client/{shop-commerce-store-B04sCNnW.mjs → shop-commerce-store-Dnu-8Iub.mjs} +1 -1
- package/dist/client/{shopShared-DNNgZlmW.mjs → shopShared-BWPUURvG.mjs} +3 -3
- package/dist/client/{useEventFilters-CUmhE24_.mjs → useEventFilters-DRhWp2_5.mjs} +3 -3
- package/dist/client/{usePolling-M5jG675x.mjs → usePolling-UN4WKnaM.mjs} +2 -2
- package/dist/preview-next/client/runtime.mjs +3 -3
- package/dist/{sdk-runtime-BEXb1wqo.mjs → sdk-runtime-Ca5RD78X.mjs} +1 -1
- package/dist/{separator-DGMuip1D.mjs → separator-CMhj6BTi.mjs} +1 -1
- package/dist/server/components.mjs +117 -37
- package/dist/server/config-validation.mjs +106 -3
- package/dist/server/config.mjs +106 -3
- package/dist/server/data.mjs +106 -3
- package/dist/server/index.mjs +1 -1
- package/dist/server/next.mjs +186 -106
- package/dist/server/page-converter.mjs +105 -2
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +119 -37
- package/dist/server/rendering.mjs +117 -37
- package/dist/server/routing.mjs +132 -73
- package/dist/server/server.mjs +107 -4
- package/dist/server/theme-bridge.mjs +4 -4
- package/package.json +2 -2
- package/dist/client/checkoutUrls-Ct8Mxna3.mjs +0 -26
|
@@ -842,20 +842,7 @@ function createBlockApi(config) {
|
|
|
842
842
|
const path = buildPath(WHOLE_SERIES.checkout.path, { siteId: sid });
|
|
843
843
|
return request(WHOLE_SERIES.checkout, {
|
|
844
844
|
path,
|
|
845
|
-
body:
|
|
846
|
-
eventSeriesId: data.eventSeriesId,
|
|
847
|
-
...data.pricingOptionId ? { pricingOptionId: data.pricingOptionId } : {},
|
|
848
|
-
...data.selectedSlidingAmount !== void 0 ? { selectedSlidingAmount: data.selectedSlidingAmount } : {},
|
|
849
|
-
email: data.email,
|
|
850
|
-
name: data.name,
|
|
851
|
-
phone: data.phone,
|
|
852
|
-
formData: data.formData,
|
|
853
|
-
altchaSolution: data.altchaSolution,
|
|
854
|
-
discountCode: data.discountCode,
|
|
855
|
-
successUrl: data.successUrl,
|
|
856
|
-
cancelUrl: data.cancelUrl,
|
|
857
|
-
claimToken: data.claimToken
|
|
858
|
-
}
|
|
845
|
+
body: data
|
|
859
846
|
});
|
|
860
847
|
},
|
|
861
848
|
async getWholeSeriesRegistrationStatus(params) {
|
|
@@ -7364,7 +7351,10 @@ var init_booking_date_time = __esmMin((() => {
|
|
|
7364
7351
|
LOCAL_DATE_PATTERN = /^(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})$/u;
|
|
7365
7352
|
DATE_TIME_FORMATTER_CACHE_LIMIT = 100;
|
|
7366
7353
|
dateTimeFormatterCache = /* @__PURE__ */ new Map();
|
|
7367
|
-
}))
|
|
7354
|
+
}));
|
|
7355
|
+
//#endregion
|
|
7356
|
+
//#region ../core/src/booking-consent.ts
|
|
7357
|
+
var init_booking_consent = __esmMin((() => {})), init_dated_offering_settlement = __esmMin((() => {
|
|
7368
7358
|
init_result$1();
|
|
7369
7359
|
}));
|
|
7370
7360
|
var init_person_records = __esmMin((() => {
|
|
@@ -7780,6 +7770,7 @@ var init_src$3 = __esmMin((() => {
|
|
|
7780
7770
|
init_booking_refunds();
|
|
7781
7771
|
init_booking_instalments();
|
|
7782
7772
|
init_booking_date_time();
|
|
7773
|
+
init_booking_consent();
|
|
7783
7774
|
init_dated_offering_settlement();
|
|
7784
7775
|
init_person_records();
|
|
7785
7776
|
init_rectification();
|
|
@@ -9838,7 +9829,7 @@ function normalizeRel(target, rel) {
|
|
|
9838
9829
|
tokens.add("noreferrer");
|
|
9839
9830
|
return Array.from(tokens).join(" ");
|
|
9840
9831
|
}
|
|
9841
|
-
function renderMarks(text, marks, key) {
|
|
9832
|
+
function renderMarks(text, marks, key, linkTarget) {
|
|
9842
9833
|
if (!marks || marks.length === 0) return text;
|
|
9843
9834
|
return marks.reduce((acc, mark) => {
|
|
9844
9835
|
switch (mark.type) {
|
|
@@ -9851,7 +9842,8 @@ function renderMarks(text, marks, key) {
|
|
|
9851
9842
|
const attrs = mark.attrs ?? {};
|
|
9852
9843
|
const href = sanitizeHref(attrs.href);
|
|
9853
9844
|
if (!href) return acc;
|
|
9854
|
-
const
|
|
9845
|
+
const storedTarget = typeof attrs.target === "string" && attrs.target.trim().length > 0 ? attrs.target.trim() : void 0;
|
|
9846
|
+
const target = linkTarget === "new-tab" ? "_blank" : storedTarget;
|
|
9855
9847
|
return /* @__PURE__ */ jsx("a", {
|
|
9856
9848
|
href,
|
|
9857
9849
|
target,
|
|
@@ -9863,14 +9855,14 @@ function renderMarks(text, marks, key) {
|
|
|
9863
9855
|
}
|
|
9864
9856
|
}, text);
|
|
9865
9857
|
}
|
|
9866
|
-
function renderDoc(node, key, imageResolveContext) {
|
|
9858
|
+
function renderDoc(node, key, imageResolveContext, linkTarget) {
|
|
9867
9859
|
if (!node || !node.type) return null;
|
|
9868
|
-
const children = node.content?.map((child, index) => renderDoc(child, `${key}-${index}`, imageResolveContext));
|
|
9860
|
+
const children = node.content?.map((child, index) => renderDoc(child, `${key}-${index}`, imageResolveContext, linkTarget));
|
|
9869
9861
|
switch (node.type) {
|
|
9870
9862
|
case "doc": return /* @__PURE__ */ jsx(Fragment, { children });
|
|
9871
9863
|
case "paragraph":
|
|
9872
9864
|
if (!children && !node.text) return /* @__PURE__ */ jsx("p", {}, key);
|
|
9873
|
-
return /* @__PURE__ */ jsx("p", { children: children ?? renderMarks(node.text ?? "", node.marks, key) }, key);
|
|
9865
|
+
return /* @__PURE__ */ jsx("p", { children: children ?? renderMarks(node.text ?? "", node.marks, key, linkTarget) }, key);
|
|
9874
9866
|
case "heading": {
|
|
9875
9867
|
const headingTag = `h${Math.min(Math.max(node.attrs?.level ?? 2, 1), 6)}`;
|
|
9876
9868
|
return React.createElement(headingTag, { key }, children);
|
|
@@ -9912,13 +9904,13 @@ function renderDoc(node, key, imageResolveContext) {
|
|
|
9912
9904
|
decoding: "async"
|
|
9913
9905
|
}, key);
|
|
9914
9906
|
}
|
|
9915
|
-
case "text": return renderMarks(node.text ?? "", node.marks, key);
|
|
9907
|
+
case "text": return renderMarks(node.text ?? "", node.marks, key, linkTarget);
|
|
9916
9908
|
default: return null;
|
|
9917
9909
|
}
|
|
9918
9910
|
}
|
|
9919
|
-
function RichText({ as: Comp = "div", className, doc, path }) {
|
|
9911
|
+
function RichText({ as: Comp = "div", className, doc, path, linkTarget = "stored" }) {
|
|
9920
9912
|
const imageResolveContext = getCurrentResolveImageUrlContext() ?? null;
|
|
9921
|
-
const content = doc ? renderDoc(doc, "doc", imageResolveContext) : null;
|
|
9913
|
+
const content = doc ? renderDoc(doc, "doc", imageResolveContext, linkTarget) : null;
|
|
9922
9914
|
const dataAttributes = path ? { "data-builder-richtext": path } : void 0;
|
|
9923
9915
|
return /* @__PURE__ */ jsx(Comp, {
|
|
9924
9916
|
className: className?.trim() || DEFAULT_RICH_TEXT_CLASS,
|
|
@@ -13106,6 +13098,44 @@ function assertNever$11(value, message) {
|
|
|
13106
13098
|
throw new Error(message ?? `Unexpected value: ${String(value)}`);
|
|
13107
13099
|
}
|
|
13108
13100
|
var init_dist$1 = __esmMin((() => {}));
|
|
13101
|
+
//#endregion
|
|
13102
|
+
//#region ../blocks/src/system/blocks/shared/bookingConsent.ts
|
|
13103
|
+
function toBookingRequirementConsentFieldId(requirementId) {
|
|
13104
|
+
return `${BOOKING_REQUIREMENT_CONSENT_FIELD_PREFIX}${requirementId}`;
|
|
13105
|
+
}
|
|
13106
|
+
function isBookingRequirementConsentFieldId(value) {
|
|
13107
|
+
return value.startsWith(BOOKING_REQUIREMENT_CONSENT_FIELD_PREFIX);
|
|
13108
|
+
}
|
|
13109
|
+
function toBookingRequirementConsentField(consent) {
|
|
13110
|
+
return {
|
|
13111
|
+
id: toBookingRequirementConsentFieldId(consent.requirementId),
|
|
13112
|
+
label: consent.title,
|
|
13113
|
+
type: "booking_requirement_consent",
|
|
13114
|
+
required: true,
|
|
13115
|
+
agreement: consent.agreement,
|
|
13116
|
+
checkboxLabel: consent.checkboxLabel
|
|
13117
|
+
};
|
|
13118
|
+
}
|
|
13119
|
+
var BOOKING_REQUIREMENT_CONSENT_FIELD_PREFIX, blockBookingConsentSchema, bookingRequirementConsentFieldSchema;
|
|
13120
|
+
var init_bookingConsent = __esmMin((() => {
|
|
13121
|
+
init_richTextSchema();
|
|
13122
|
+
BOOKING_REQUIREMENT_CONSENT_FIELD_PREFIX = "booking_requirement_consent_";
|
|
13123
|
+
blockBookingConsentSchema = z.object({
|
|
13124
|
+
requirementId: z.string(),
|
|
13125
|
+
title: z.string(),
|
|
13126
|
+
agreement: RichTextDocSchema,
|
|
13127
|
+
checkboxLabel: z.string()
|
|
13128
|
+
});
|
|
13129
|
+
bookingRequirementConsentFieldSchema = z.object({
|
|
13130
|
+
id: z.string(),
|
|
13131
|
+
label: z.string(),
|
|
13132
|
+
type: z.literal("booking_requirement_consent"),
|
|
13133
|
+
required: z.literal(true),
|
|
13134
|
+
agreement: RichTextDocSchema,
|
|
13135
|
+
checkboxLabel: z.string().min(1)
|
|
13136
|
+
});
|
|
13137
|
+
z.union([blockBookingConsentSchema, bookingRequirementConsentFieldSchema]);
|
|
13138
|
+
}));
|
|
13109
13139
|
var BOOKING_FORM_DATA_RESERVED_KEY_VALUES, BOOKING_FORM_DATA_RESERVED_KEYS;
|
|
13110
13140
|
var init_booking_form_reserved_fields = __esmMin((() => {
|
|
13111
13141
|
BOOKING_FORM_DATA_RESERVED_KEY_VALUES = [
|
|
@@ -13121,6 +13151,31 @@ var init_booking_form_reserved_fields = __esmMin((() => {
|
|
|
13121
13151
|
BOOKING_FORM_DATA_RESERVED_KEYS = new Set(BOOKING_FORM_DATA_RESERVED_KEY_VALUES);
|
|
13122
13152
|
}));
|
|
13123
13153
|
//#endregion
|
|
13154
|
+
//#region ../blocks/src/system/runtime/nodes/booking-form.consent.ts
|
|
13155
|
+
function resolveSelectedAppointmentConsent(service) {
|
|
13156
|
+
return service?.consent ? {
|
|
13157
|
+
kind: "required-for-selected-service",
|
|
13158
|
+
field: toBookingRequirementConsentField(service.consent)
|
|
13159
|
+
} : { kind: "not-applicable" };
|
|
13160
|
+
}
|
|
13161
|
+
function projectSelectedAppointmentConsentIntoForm(form, selectedConsent) {
|
|
13162
|
+
if (!form) return null;
|
|
13163
|
+
const sourceFields = form.schema?.fields ?? [];
|
|
13164
|
+
const baseFields = sourceFields.filter((field) => field.type !== "booking_requirement_consent");
|
|
13165
|
+
const fields = selectedConsent.kind === "required-for-selected-service" ? [...baseFields, selectedConsent.field] : baseFields;
|
|
13166
|
+
if (selectedConsent.kind === "not-applicable" && baseFields.length === sourceFields.length) return form;
|
|
13167
|
+
return {
|
|
13168
|
+
...form,
|
|
13169
|
+
schema: {
|
|
13170
|
+
...form.schema,
|
|
13171
|
+
fields
|
|
13172
|
+
}
|
|
13173
|
+
};
|
|
13174
|
+
}
|
|
13175
|
+
var init_booking_form_consent = __esmMin((() => {
|
|
13176
|
+
init_bookingConsent();
|
|
13177
|
+
}));
|
|
13178
|
+
//#endregion
|
|
13124
13179
|
//#region ../blocks/src/system/runtime/nodes/booking-form.state.ts
|
|
13125
13180
|
function toTrimmedString(value) {
|
|
13126
13181
|
const trimmed = value?.trim();
|
|
@@ -13303,7 +13358,6 @@ function readBookingFieldType(value) {
|
|
|
13303
13358
|
case "select":
|
|
13304
13359
|
case "radio":
|
|
13305
13360
|
case "checkbox":
|
|
13306
|
-
case "booking_requirement_consent":
|
|
13307
13361
|
case "tel":
|
|
13308
13362
|
case "url":
|
|
13309
13363
|
case "number":
|
|
@@ -13338,7 +13392,7 @@ function normalizeBookingSettings(value) {
|
|
|
13338
13392
|
};
|
|
13339
13393
|
}
|
|
13340
13394
|
function isBookingFormService(value) {
|
|
13341
|
-
return isRecord$10(value) && typeof value.id === "string" && typeof value.siteId === "string" && typeof value.title === "string";
|
|
13395
|
+
return isRecord$10(value) && typeof value.id === "string" && typeof value.siteId === "string" && typeof value.title === "string" && (value.consent === void 0 || blockBookingConsentSchema.safeParse(value.consent).success);
|
|
13342
13396
|
}
|
|
13343
13397
|
function collectBookingCustomFields(data) {
|
|
13344
13398
|
const customFields = {};
|
|
@@ -13584,16 +13638,27 @@ function getBookingSuccessMessage(successMessage) {
|
|
|
13584
13638
|
var init_booking_form_state = __esmMin((() => {
|
|
13585
13639
|
init_dist$1();
|
|
13586
13640
|
init_src$3();
|
|
13641
|
+
init_bookingConsent();
|
|
13587
13642
|
init_booking_form_reserved_fields();
|
|
13643
|
+
init_booking_form_consent();
|
|
13588
13644
|
}));
|
|
13589
|
-
var bookingFieldOptionSchema, bookingFieldSchema, bookingSettingsSchema, bookingSourceFormSchema;
|
|
13645
|
+
var bookingFieldOptionSchema, standardBookingFieldRules, standardBookingFieldSchema, bookingFieldSchema, bookingSettingsSchema, bookingSourceFormSchema;
|
|
13590
13646
|
var init_booking_runtime_sources = __esmMin((() => {
|
|
13591
13647
|
init_noop();
|
|
13592
13648
|
bookingFieldOptionSchema = z.object({
|
|
13593
13649
|
value: z.string(),
|
|
13594
13650
|
label: z.string()
|
|
13595
13651
|
});
|
|
13596
|
-
|
|
13652
|
+
standardBookingFieldRules = {
|
|
13653
|
+
options: z.array(bookingFieldOptionSchema).optional(),
|
|
13654
|
+
multiple: z.boolean().optional(),
|
|
13655
|
+
minLength: z.number().optional(),
|
|
13656
|
+
maxLength: z.number().optional(),
|
|
13657
|
+
pattern: z.string().optional(),
|
|
13658
|
+
min: z.number().optional(),
|
|
13659
|
+
max: z.number().optional()
|
|
13660
|
+
};
|
|
13661
|
+
standardBookingFieldSchema = z.object({
|
|
13597
13662
|
id: z.string(),
|
|
13598
13663
|
label: z.string(),
|
|
13599
13664
|
type: z.enum([
|
|
@@ -13603,7 +13668,6 @@ var init_booking_runtime_sources = __esmMin((() => {
|
|
|
13603
13668
|
"select",
|
|
13604
13669
|
"radio",
|
|
13605
13670
|
"checkbox",
|
|
13606
|
-
"booking_requirement_consent",
|
|
13607
13671
|
"tel",
|
|
13608
13672
|
"url",
|
|
13609
13673
|
"number",
|
|
@@ -13613,14 +13677,9 @@ var init_booking_runtime_sources = __esmMin((() => {
|
|
|
13613
13677
|
required: z.boolean().optional(),
|
|
13614
13678
|
placeholder: z.string().optional(),
|
|
13615
13679
|
helpText: z.string().optional(),
|
|
13616
|
-
|
|
13617
|
-
multiple: z.boolean().optional(),
|
|
13618
|
-
minLength: z.number().optional(),
|
|
13619
|
-
maxLength: z.number().optional(),
|
|
13620
|
-
pattern: z.string().optional(),
|
|
13621
|
-
min: z.number().optional(),
|
|
13622
|
-
max: z.number().optional()
|
|
13680
|
+
...standardBookingFieldRules
|
|
13623
13681
|
});
|
|
13682
|
+
bookingFieldSchema = standardBookingFieldSchema;
|
|
13624
13683
|
bookingSettingsSchema = z.object({
|
|
13625
13684
|
type: z.literal("booking"),
|
|
13626
13685
|
serviceId: z.string().optional(),
|
|
@@ -13740,6 +13799,7 @@ var init_booking_form_interactive = __esmMin((() => {
|
|
|
13740
13799
|
init_booking_form_state();
|
|
13741
13800
|
init_booking_runtime_sources();
|
|
13742
13801
|
init_bookingPaymentTerms();
|
|
13802
|
+
init_bookingConsent();
|
|
13743
13803
|
blockBookingPaymentTermsAvailabilitySchema = z.union([z.object({
|
|
13744
13804
|
kind: z.literal("available"),
|
|
13745
13805
|
paymentTerms: blockBookingPaymentTermsSchema
|
|
@@ -13758,7 +13818,8 @@ var init_booking_form_interactive = __esmMin((() => {
|
|
|
13758
13818
|
priceAmount: z.number().nullable().optional(),
|
|
13759
13819
|
priceCurrency: z.string().nullable().optional(),
|
|
13760
13820
|
paymentTerms: blockBookingPaymentTermsSchema.optional(),
|
|
13761
|
-
paymentTermsAvailability: blockBookingPaymentTermsAvailabilitySchema.optional()
|
|
13821
|
+
paymentTermsAvailability: blockBookingPaymentTermsAvailabilitySchema.optional(),
|
|
13822
|
+
consent: blockBookingConsentSchema.optional()
|
|
13762
13823
|
});
|
|
13763
13824
|
bookingServicesSourceSchema = z.union([
|
|
13764
13825
|
z.array(bookingServiceSchema),
|
|
@@ -14280,6 +14341,7 @@ var init_types$8 = __esmMin((() => {}));
|
|
|
14280
14341
|
var wholeSeriesVenueSchema, wholeSeriesSessionSchema, wholeSeriesTeamMemberSummarySchema, wholeSeriesPricingOptionSchema, wholeSeriesPricingSchema, publicWholeSeriesOfferingSchema, publicWholeSeriesOfferingsArraySchema;
|
|
14281
14342
|
var init_schemas$2 = __esmMin((() => {
|
|
14282
14343
|
init_bookingPaymentTerms();
|
|
14344
|
+
init_bookingConsent();
|
|
14283
14345
|
wholeSeriesVenueSchema = z.object({
|
|
14284
14346
|
id: z.string(),
|
|
14285
14347
|
name: z.string(),
|
|
@@ -14343,6 +14405,7 @@ var init_schemas$2 = __esmMin((() => {
|
|
|
14343
14405
|
pricing: wholeSeriesPricingSchema,
|
|
14344
14406
|
currency: z.string(),
|
|
14345
14407
|
paymentTerms: blockBookingPaymentTermsSchema,
|
|
14408
|
+
consent: blockBookingConsentSchema.nullable(),
|
|
14346
14409
|
enrollmentCapacity: z.number().nullable(),
|
|
14347
14410
|
acceptsMemberships: z.boolean(),
|
|
14348
14411
|
status: z.enum([
|
|
@@ -17083,6 +17146,7 @@ var init_schemas = __esmMin((() => {
|
|
|
17083
17146
|
init_media();
|
|
17084
17147
|
init_richTextSchema();
|
|
17085
17148
|
init_bookingPaymentTerms();
|
|
17149
|
+
init_bookingConsent();
|
|
17086
17150
|
init_whole_series();
|
|
17087
17151
|
eventPresetSchema = z.enum([
|
|
17088
17152
|
"event",
|
|
@@ -17373,6 +17437,7 @@ var init_schemas = __esmMin((() => {
|
|
|
17373
17437
|
timeZone: z.string(),
|
|
17374
17438
|
pricing: publicEventPricingSchema,
|
|
17375
17439
|
paymentTerms: blockBookingPaymentTermsSchema,
|
|
17440
|
+
consent: blockBookingConsentSchema.nullable(),
|
|
17376
17441
|
accessRestriction: accessRestrictionSchema,
|
|
17377
17442
|
allowedCategoryIds: z.array(z.string()),
|
|
17378
17443
|
requireGuestDetails: z.boolean().optional(),
|
|
@@ -19320,6 +19385,7 @@ function normalizeGroupPresentation(value) {
|
|
|
19320
19385
|
function resolveAutoCtaPath(source, routes) {
|
|
19321
19386
|
const routeByNormalizedPath = /* @__PURE__ */ new Map();
|
|
19322
19387
|
for (const route of routes ?? []) {
|
|
19388
|
+
if (route.kind === "pageSurface") continue;
|
|
19323
19389
|
const normalized = normalizeRoutePath(route.path);
|
|
19324
19390
|
if (normalized && !routeByNormalizedPath.has(normalized)) routeByNormalizedPath.set(normalized, route.path);
|
|
19325
19391
|
}
|
|
@@ -32271,6 +32337,57 @@ var init_event_registration_shared = __esmMin((() => {
|
|
|
32271
32337
|
}).nullable();
|
|
32272
32338
|
}));
|
|
32273
32339
|
//#endregion
|
|
32340
|
+
//#region ../blocks/src/system/runtime/nodes/event-registration/registrationSurface.ts
|
|
32341
|
+
function planEventRegistrationScope(input) {
|
|
32342
|
+
const subject = input.subject;
|
|
32343
|
+
const selectedRunOffering = input.wholeSeriesOffering;
|
|
32344
|
+
if (subject?.kind !== "eventOffering" || !selectedRunOffering) return {
|
|
32345
|
+
kind: "context",
|
|
32346
|
+
events: resolveEventRegistrationScopedEvents(input.events, {
|
|
32347
|
+
occurrenceContext: input.occurrenceContext,
|
|
32348
|
+
subject
|
|
32349
|
+
})
|
|
32350
|
+
};
|
|
32351
|
+
if (!(selectedRunOffering.eventOfferingId === subject.eventOfferingId && subject.availableEventSeriesIds.some((seriesId) => seriesId === selectedRunOffering.eventSeriesId))) return { kind: "invalidSelectedRun" };
|
|
32352
|
+
return {
|
|
32353
|
+
kind: "selectedRun",
|
|
32354
|
+
events: input.events.filter((event) => event.seriesId === selectedRunOffering.eventSeriesId),
|
|
32355
|
+
offering: selectedRunOffering
|
|
32356
|
+
};
|
|
32357
|
+
}
|
|
32358
|
+
function planEventRegistrationSurface(input) {
|
|
32359
|
+
const scope = planEventRegistrationScope(input);
|
|
32360
|
+
if (scope.kind === "invalidSelectedRun") return { kind: "unavailableWholeSeries" };
|
|
32361
|
+
const scopedEvents = scope.events;
|
|
32362
|
+
const bookingScopes = new Set(scopedEvents.map((event) => event.bookingScope));
|
|
32363
|
+
if (scope.kind === "selectedRun") {
|
|
32364
|
+
if (bookingScopes.size !== 1 || !bookingScopes.has("whole_series")) return { kind: "unavailableWholeSeries" };
|
|
32365
|
+
return {
|
|
32366
|
+
kind: "wholeSeries",
|
|
32367
|
+
offerings: [scope.offering]
|
|
32368
|
+
};
|
|
32369
|
+
}
|
|
32370
|
+
if (!input.occurrenceContext && !input.subject && bookingScopes.has("single_occurrence")) return {
|
|
32371
|
+
kind: "occurrence",
|
|
32372
|
+
events: scopedEvents.filter((event) => event.bookingScope === "single_occurrence")
|
|
32373
|
+
};
|
|
32374
|
+
if (bookingScopes.size === 0 || bookingScopes.has("single_occurrence")) return bookingScopes.has("whole_series") ? { kind: "mixedBookingScopes" } : {
|
|
32375
|
+
kind: "occurrence",
|
|
32376
|
+
events: scopedEvents
|
|
32377
|
+
};
|
|
32378
|
+
const requiredSeriesIds = new Set(scopedEvents.map((event) => event.seriesId));
|
|
32379
|
+
const wholeSeriesOffering = input.wholeSeriesOffering;
|
|
32380
|
+
const offerings = (wholeSeriesOffering ? [wholeSeriesOffering, ...input.wholeSeriesOfferings.filter((offering) => offering.eventSeriesId !== wholeSeriesOffering.eventSeriesId)] : input.wholeSeriesOfferings).filter((offering) => requiredSeriesIds.has(offering.eventSeriesId));
|
|
32381
|
+
const loadedSeriesIds = new Set(offerings.map((offering) => offering.eventSeriesId));
|
|
32382
|
+
return [...requiredSeriesIds].every((seriesId) => loadedSeriesIds.has(seriesId)) && offerings.length > 0 ? {
|
|
32383
|
+
kind: "wholeSeries",
|
|
32384
|
+
offerings
|
|
32385
|
+
} : { kind: "unavailableWholeSeries" };
|
|
32386
|
+
}
|
|
32387
|
+
var init_registrationSurface = __esmMin((() => {
|
|
32388
|
+
init_eventScope();
|
|
32389
|
+
}));
|
|
32390
|
+
//#endregion
|
|
32274
32391
|
//#region ../blocks/src/system/runtime/nodes/event-registration/wizardSteps.ts
|
|
32275
32392
|
/**
|
|
32276
32393
|
* Determine which wizard steps to show based on context and payment requirements.
|
|
@@ -32418,10 +32535,13 @@ function buildEventRegistrationShellStepLabels(source) {
|
|
|
32418
32535
|
}) : false).map((step) => shellLabelForRegistrationStep(step, scopedEvents));
|
|
32419
32536
|
}
|
|
32420
32537
|
function scopeEventRegistrationEvents(source) {
|
|
32421
|
-
|
|
32538
|
+
const scope = planEventRegistrationScope({
|
|
32539
|
+
events: toRegistrationEvents(source.events ?? []),
|
|
32540
|
+
wholeSeriesOffering: source.wholeSeriesOffering,
|
|
32422
32541
|
occurrenceContext: source.occurrenceContext,
|
|
32423
32542
|
subject: source.subject
|
|
32424
32543
|
});
|
|
32544
|
+
return scope.kind === "invalidSelectedRun" ? [] : scope.events;
|
|
32425
32545
|
}
|
|
32426
32546
|
function shellLabelForRegistrationStep(step, events) {
|
|
32427
32547
|
switch (step) {
|
|
@@ -32479,6 +32599,7 @@ var init_event_registration_interactive = __esmMin((() => {
|
|
|
32479
32599
|
init_shop_shared();
|
|
32480
32600
|
init_event_registration_shared();
|
|
32481
32601
|
init_eventScope();
|
|
32602
|
+
init_registrationSurface();
|
|
32482
32603
|
init_pricing$1();
|
|
32483
32604
|
init_destination();
|
|
32484
32605
|
init_islands();
|
|
@@ -40393,6 +40514,14 @@ var init_src = __esmMin((() => {
|
|
|
40393
40514
|
init_dist();
|
|
40394
40515
|
}));
|
|
40395
40516
|
//#endregion
|
|
40517
|
+
//#region ../blocks/src/system/runtime/hooks/useSelectedAppointmentConsentForm.ts
|
|
40518
|
+
function useSelectedAppointmentConsentForm(form, selectedService) {
|
|
40519
|
+
return useMemo(() => projectSelectedAppointmentConsentIntoForm(form, resolveSelectedAppointmentConsent(selectedService)), [form, selectedService]);
|
|
40520
|
+
}
|
|
40521
|
+
var init_useSelectedAppointmentConsentForm = __esmMin((() => {
|
|
40522
|
+
init_booking_form_consent();
|
|
40523
|
+
}));
|
|
40524
|
+
//#endregion
|
|
40396
40525
|
//#region ../blocks/src/utils/date-formatting.ts
|
|
40397
40526
|
function warnRuntimeTimeZoneFallback() {
|
|
40398
40527
|
if (hasWarnedAboutRuntimeTimeZoneFallback) return;
|
|
@@ -41474,6 +41603,23 @@ function clearBookingFieldError(errors, fieldId) {
|
|
|
41474
41603
|
}
|
|
41475
41604
|
var init_booking_form_validationErrors = __esmMin((() => {}));
|
|
41476
41605
|
//#endregion
|
|
41606
|
+
//#region ../blocks/src/system/runtime/nodes/booking-form.field-values.ts
|
|
41607
|
+
function collectInitialBookingFieldValues(initialData) {
|
|
41608
|
+
const values = {};
|
|
41609
|
+
for (const [key, value] of Object.entries(initialData)) if (!BOOKING_FORM_DATA_RESERVED_KEYS.has(key) && !isBookingRequirementConsentFieldId(key) && isBookingFieldValue(value)) values[key] = value;
|
|
41610
|
+
return values;
|
|
41611
|
+
}
|
|
41612
|
+
function omitBookingConsentEntries(record) {
|
|
41613
|
+
return Object.fromEntries(Object.entries(record).filter(([key]) => !isBookingRequirementConsentFieldId(key)));
|
|
41614
|
+
}
|
|
41615
|
+
function isBookingFieldValue(value) {
|
|
41616
|
+
return value === null || typeof value === "string" || typeof value === "number" || typeof value === "boolean" || Array.isArray(value) && value.every((item) => typeof item === "string");
|
|
41617
|
+
}
|
|
41618
|
+
var init_booking_form_field_values = __esmMin((() => {
|
|
41619
|
+
init_bookingConsent();
|
|
41620
|
+
init_booking_form_reserved_fields();
|
|
41621
|
+
}));
|
|
41622
|
+
//#endregion
|
|
41477
41623
|
//#region ../blocks/src/system/runtime/nodes/booking-form.headless.state.ts
|
|
41478
41624
|
function createInitialBookingFlowReducerState(input) {
|
|
41479
41625
|
const initialData = input.initialData ?? {};
|
|
@@ -41484,7 +41630,7 @@ function createInitialBookingFlowReducerState(input) {
|
|
|
41484
41630
|
selectedResourceId: toOptionalAppointmentResourceId(toOptionalString(initialData.resourceId) ?? input.defaultResourceId),
|
|
41485
41631
|
selectedDate: toOptionalString(initialData.selectedDate),
|
|
41486
41632
|
selectedSlot: null,
|
|
41487
|
-
fieldValues:
|
|
41633
|
+
fieldValues: collectInitialBookingFieldValues(initialData),
|
|
41488
41634
|
touchedFields: {},
|
|
41489
41635
|
attemptedStepIds: {},
|
|
41490
41636
|
discountCode: toOptionalString(initialData.discountCode) ?? "",
|
|
@@ -41496,14 +41642,6 @@ function createInitialBookingFlowReducerState(input) {
|
|
|
41496
41642
|
feedback: { kind: "none" }
|
|
41497
41643
|
};
|
|
41498
41644
|
}
|
|
41499
|
-
function collectInitialFieldValues(initialData) {
|
|
41500
|
-
const values = {};
|
|
41501
|
-
for (const [key, value] of Object.entries(initialData)) {
|
|
41502
|
-
if (BOOKING_FORM_DATA_RESERVED_KEYS.has(key) || !isBookingFieldValue(value)) continue;
|
|
41503
|
-
values[key] = value;
|
|
41504
|
-
}
|
|
41505
|
-
return values;
|
|
41506
|
-
}
|
|
41507
41645
|
function toOptionalString(value) {
|
|
41508
41646
|
if (typeof value !== "string") return void 0;
|
|
41509
41647
|
const trimmed = value.trim();
|
|
@@ -41522,9 +41660,6 @@ function toOptionalAppointmentResourceId(value) {
|
|
|
41522
41660
|
function toOptionalCustomerPassId(value) {
|
|
41523
41661
|
return toOptionalBrandedId(value, unsafeAsCustomerPassId);
|
|
41524
41662
|
}
|
|
41525
|
-
function isBookingFieldValue(value) {
|
|
41526
|
-
return value === null || typeof value === "string" || typeof value === "number" || typeof value === "boolean" || Array.isArray(value) && value.every((item) => typeof item === "string");
|
|
41527
|
-
}
|
|
41528
41663
|
/**
|
|
41529
41664
|
* Send the flow back to the date step when the slot it was holding went away,
|
|
41530
41665
|
* leaving a scoped feedback message. A completed booking is left alone.
|
|
@@ -41546,17 +41681,7 @@ function applyAvailabilitySelectionInvalidation(state, invalidation) {
|
|
|
41546
41681
|
}
|
|
41547
41682
|
function bookingFlowReducer(state, event) {
|
|
41548
41683
|
switch (event.type) {
|
|
41549
|
-
case "service-selected": return
|
|
41550
|
-
...state,
|
|
41551
|
-
selectedServiceId: event.serviceId,
|
|
41552
|
-
selectedResourceId: void 0,
|
|
41553
|
-
selectedDate: void 0,
|
|
41554
|
-
selectedSlot: null,
|
|
41555
|
-
selectedAppointmentPackageId: void 0,
|
|
41556
|
-
selectedSlidingAmountInput: "",
|
|
41557
|
-
selectedCollectionOptionKind: void 0,
|
|
41558
|
-
validationErrors: clearBookingFormError(state.validationErrors)
|
|
41559
|
-
};
|
|
41684
|
+
case "service-selected": return applyBookingServiceSelection(state, event.serviceId);
|
|
41560
41685
|
case "resource-selected": return {
|
|
41561
41686
|
...state,
|
|
41562
41687
|
selectedResourceId: event.resourceId ?? void 0,
|
|
@@ -41663,6 +41788,24 @@ function bookingFlowReducer(state, event) {
|
|
|
41663
41788
|
default: return assertNever$11(event);
|
|
41664
41789
|
}
|
|
41665
41790
|
}
|
|
41791
|
+
function applyBookingServiceSelection(state, serviceId) {
|
|
41792
|
+
return {
|
|
41793
|
+
...state,
|
|
41794
|
+
selectedServiceId: serviceId,
|
|
41795
|
+
selectedResourceId: void 0,
|
|
41796
|
+
selectedDate: void 0,
|
|
41797
|
+
selectedSlot: null,
|
|
41798
|
+
selectedAppointmentPackageId: void 0,
|
|
41799
|
+
selectedSlidingAmountInput: "",
|
|
41800
|
+
selectedCollectionOptionKind: void 0,
|
|
41801
|
+
fieldValues: omitBookingConsentEntries(state.fieldValues),
|
|
41802
|
+
touchedFields: omitBookingConsentEntries(state.touchedFields),
|
|
41803
|
+
validationErrors: {
|
|
41804
|
+
...clearBookingFormError(state.validationErrors),
|
|
41805
|
+
fieldErrors: omitBookingConsentEntries(state.validationErrors.fieldErrors)
|
|
41806
|
+
}
|
|
41807
|
+
};
|
|
41808
|
+
}
|
|
41666
41809
|
function clearAvailabilityFeedback(feedback) {
|
|
41667
41810
|
return feedback.kind === "error" && feedback.scope === "availability" ? { kind: "none" } : feedback;
|
|
41668
41811
|
}
|
|
@@ -41823,7 +41966,8 @@ function validateBookingFields(input) {
|
|
|
41823
41966
|
return errors;
|
|
41824
41967
|
}
|
|
41825
41968
|
function validateBookingField(field, value) {
|
|
41826
|
-
|
|
41969
|
+
const requiredError = validateRequiredBookingField(field, value);
|
|
41970
|
+
if (requiredError) return requiredError;
|
|
41827
41971
|
if (isBlankFieldValue(value)) return null;
|
|
41828
41972
|
const strValue = typeof value === "string" ? value : String(value);
|
|
41829
41973
|
if (field.type === "email") return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(strValue) ? null : "Please enter a valid email address";
|
|
@@ -41852,6 +41996,10 @@ function validateBookingField(field, value) {
|
|
|
41852
41996
|
}
|
|
41853
41997
|
return null;
|
|
41854
41998
|
}
|
|
41999
|
+
function validateRequiredBookingField(field, value) {
|
|
42000
|
+
if (field.type === "booking_requirement_consent") return value === true ? null : `${field.label} is required`;
|
|
42001
|
+
return field.required && isBlankFieldValue(value) ? `${field.label} is required` : null;
|
|
42002
|
+
}
|
|
41855
42003
|
function deriveBookingFlowSteps(input) {
|
|
41856
42004
|
const stepResolution = buildBookingStepResolution({
|
|
41857
42005
|
form: input.form,
|
|
@@ -41923,7 +42071,8 @@ function deriveBookingFieldViews(input) {
|
|
|
41923
42071
|
return (input.form?.schema?.fields ?? []).map((field) => {
|
|
41924
42072
|
const fieldId = unsafeAsBookingFieldId(field.id);
|
|
41925
42073
|
const inputId = `${input.idPrefix}-${fieldId}`;
|
|
41926
|
-
const
|
|
42074
|
+
const helpText = field.type === "booking_requirement_consent" ? null : field.helpText ?? null;
|
|
42075
|
+
const helpTextId = helpText ? `${inputId}-help` : null;
|
|
41927
42076
|
const fieldValue = input.values[field.id] ?? null;
|
|
41928
42077
|
const localError = input.touched?.[field.id] ? validateBookingField(field, fieldValue) : null;
|
|
41929
42078
|
const error = input.errors[field.id] ?? localError;
|
|
@@ -41933,17 +42082,17 @@ function deriveBookingFieldViews(input) {
|
|
|
41933
42082
|
field,
|
|
41934
42083
|
id: fieldId,
|
|
41935
42084
|
label: field.label,
|
|
41936
|
-
type: field.type,
|
|
41937
42085
|
value: fieldValue,
|
|
41938
42086
|
required: Boolean(field.required),
|
|
41939
42087
|
error,
|
|
41940
|
-
helpText
|
|
42088
|
+
helpText,
|
|
41941
42089
|
inputId,
|
|
41942
42090
|
labelId: `${inputId}-label`,
|
|
41943
42091
|
helpTextId,
|
|
41944
42092
|
errorId,
|
|
41945
42093
|
describedBy,
|
|
41946
|
-
ariaInvalid: Boolean(error)
|
|
42094
|
+
ariaInvalid: Boolean(error),
|
|
42095
|
+
type: field.type
|
|
41947
42096
|
};
|
|
41948
42097
|
});
|
|
41949
42098
|
}
|
|
@@ -42118,6 +42267,7 @@ var init_booking_form_headless_state = __esmMin((() => {
|
|
|
42118
42267
|
init_dist$1();
|
|
42119
42268
|
init_booking_form_state();
|
|
42120
42269
|
init_booking_form_validationErrors();
|
|
42270
|
+
init_booking_form_field_values();
|
|
42121
42271
|
unsafeAsBookingFieldId = (id) => id;
|
|
42122
42272
|
}));
|
|
42123
42273
|
//#endregion
|
|
@@ -42150,6 +42300,7 @@ function useHeadlessBookingFlow(options) {
|
|
|
42150
42300
|
const selectedServiceId = state.selectedServiceId ?? defaultServiceId;
|
|
42151
42301
|
const selectedResourceId = state.selectedResourceId ?? defaultResourceId;
|
|
42152
42302
|
const selectedService = options.services.find((service) => service.id === selectedServiceId) ?? null;
|
|
42303
|
+
const runtimeForm = useSelectedAppointmentConsentForm(options.form, selectedService);
|
|
42153
42304
|
const lastSlidingServiceIdRef = useRef(null);
|
|
42154
42305
|
useEffect(() => {
|
|
42155
42306
|
const selectedId = selectedService?.id ?? null;
|
|
@@ -42190,7 +42341,7 @@ function useHeadlessBookingFlow(options) {
|
|
|
42190
42341
|
viewerTimeZone
|
|
42191
42342
|
]);
|
|
42192
42343
|
const stepState = useMemo(() => deriveBookingFlowSteps({
|
|
42193
|
-
form:
|
|
42344
|
+
form: runtimeForm,
|
|
42194
42345
|
services: options.services,
|
|
42195
42346
|
data,
|
|
42196
42347
|
defaultServiceId,
|
|
@@ -42206,7 +42357,7 @@ function useHeadlessBookingFlow(options) {
|
|
|
42206
42357
|
defaultServiceId,
|
|
42207
42358
|
defaultResourceId,
|
|
42208
42359
|
options.enableAppointmentPackages,
|
|
42209
|
-
|
|
42360
|
+
runtimeForm,
|
|
42210
42361
|
options.requiresResourceSelection,
|
|
42211
42362
|
options.requiresServiceSelection,
|
|
42212
42363
|
options.services,
|
|
@@ -42260,13 +42411,13 @@ function useHeadlessBookingFlow(options) {
|
|
|
42260
42411
|
state.selectedSlot
|
|
42261
42412
|
]);
|
|
42262
42413
|
const fields = useMemo(() => deriveBookingFieldViews({
|
|
42263
|
-
form:
|
|
42414
|
+
form: runtimeForm,
|
|
42264
42415
|
values: state.fieldValues,
|
|
42265
42416
|
errors: state.validationErrors.fieldErrors,
|
|
42266
42417
|
touched: state.touchedFields,
|
|
42267
42418
|
idPrefix: `booking-${options.formId}`
|
|
42268
42419
|
}), [
|
|
42269
|
-
|
|
42420
|
+
runtimeForm,
|
|
42270
42421
|
options.formId,
|
|
42271
42422
|
state.fieldValues,
|
|
42272
42423
|
state.touchedFields,
|
|
@@ -42386,7 +42537,7 @@ function useHeadlessBookingFlow(options) {
|
|
|
42386
42537
|
const latestRef = useLatestRef({
|
|
42387
42538
|
state,
|
|
42388
42539
|
data,
|
|
42389
|
-
form:
|
|
42540
|
+
form: runtimeForm,
|
|
42390
42541
|
formId: formKey,
|
|
42391
42542
|
services: options.services,
|
|
42392
42543
|
defaultServiceId,
|
|
@@ -42638,7 +42789,7 @@ function useHeadlessBookingFlow(options) {
|
|
|
42638
42789
|
phase: state.phase
|
|
42639
42790
|
});
|
|
42640
42791
|
const view = resolveHeadlessBookingView({
|
|
42641
|
-
form:
|
|
42792
|
+
form: runtimeForm,
|
|
42642
42793
|
feedback: state.feedback
|
|
42643
42794
|
});
|
|
42644
42795
|
const appointmentPackagesModel = resolveAppointmentPackagesModel({
|
|
@@ -42762,6 +42913,7 @@ var init_useHeadlessBookingFlow = __esmMin((() => {
|
|
|
42762
42913
|
init_src$3();
|
|
42763
42914
|
init_api();
|
|
42764
42915
|
init_booking_form_state();
|
|
42916
|
+
init_useSelectedAppointmentConsentForm();
|
|
42765
42917
|
init_useAvailableDates();
|
|
42766
42918
|
init_useAvailableSlots();
|
|
42767
42919
|
init_useBookingSubmission();
|
|
@@ -43434,6 +43586,30 @@ function FieldValidationMessage({ id, children, className, live = "assertive" })
|
|
|
43434
43586
|
}
|
|
43435
43587
|
var init_FieldValidationMessage = __esmMin((() => {}));
|
|
43436
43588
|
//#endregion
|
|
43589
|
+
//#region ../blocks/src/system/runtime/shared/components/BookingConsentAgreement.tsx
|
|
43590
|
+
function BookingConsentAgreement({ agreement, showTitle = true, title, titleId }) {
|
|
43591
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [showTitle ? /* @__PURE__ */ jsxs("div", {
|
|
43592
|
+
id: titleId,
|
|
43593
|
+
className: "form-label",
|
|
43594
|
+
children: [title, /* @__PURE__ */ jsx("span", {
|
|
43595
|
+
className: "required-marker",
|
|
43596
|
+
children: "*"
|
|
43597
|
+
})]
|
|
43598
|
+
}) : null, /* @__PURE__ */ jsx("div", {
|
|
43599
|
+
role: "group",
|
|
43600
|
+
"aria-label": showTitle ? void 0 : title,
|
|
43601
|
+
"aria-labelledby": showTitle ? titleId : void 0,
|
|
43602
|
+
children: /* @__PURE__ */ jsx(RichText, {
|
|
43603
|
+
doc: agreement,
|
|
43604
|
+
linkTarget: "new-tab",
|
|
43605
|
+
className: "rb-prose rb-max-w-none"
|
|
43606
|
+
})
|
|
43607
|
+
})] });
|
|
43608
|
+
}
|
|
43609
|
+
var init_BookingConsentAgreement = __esmMin((() => {
|
|
43610
|
+
init_RichText();
|
|
43611
|
+
}));
|
|
43612
|
+
//#endregion
|
|
43437
43613
|
//#region ../blocks/src/system/runtime/nodes/booking-form.default-ui.tsx
|
|
43438
43614
|
function optionCardClassName(isSelected) {
|
|
43439
43615
|
return `rb-option-card${isSelected ? " rb-option-card--selected" : ""}`;
|
|
@@ -43882,7 +44058,11 @@ function DefaultDynamicField({ booking, field }) {
|
|
|
43882
44058
|
return /* @__PURE__ */ jsxs("div", {
|
|
43883
44059
|
className: "rb-space-y-2",
|
|
43884
44060
|
children: [
|
|
43885
|
-
/* @__PURE__ */
|
|
44061
|
+
field.field.type === "booking_requirement_consent" ? /* @__PURE__ */ jsx(BookingConsentAgreement, {
|
|
44062
|
+
agreement: field.field.agreement,
|
|
44063
|
+
title: field.label,
|
|
44064
|
+
titleId: field.labelId
|
|
44065
|
+
}) : /* @__PURE__ */ jsxs("label", {
|
|
43886
44066
|
id: field.labelId,
|
|
43887
44067
|
htmlFor: field.inputId,
|
|
43888
44068
|
className: "form-label",
|
|
@@ -43927,7 +44107,7 @@ function DefaultFieldInput({ describedBy, error, errorId, field, onBlur, onChang
|
|
|
43927
44107
|
required: field.required,
|
|
43928
44108
|
...validationProps
|
|
43929
44109
|
};
|
|
43930
|
-
switch (field.type) {
|
|
44110
|
+
switch (field.field.type) {
|
|
43931
44111
|
case "textarea": return /* @__PURE__ */ jsx("textarea", {
|
|
43932
44112
|
...commonProps,
|
|
43933
44113
|
value: strValue,
|
|
@@ -44041,7 +44221,7 @@ function DefaultFieldInput({ describedBy, error, errorId, field, onBlur, onChang
|
|
|
44041
44221
|
className: "form-checkbox rb-mt-0.5"
|
|
44042
44222
|
}), /* @__PURE__ */ jsx("span", {
|
|
44043
44223
|
className: "rb-caption",
|
|
44044
|
-
children: field.field.
|
|
44224
|
+
children: field.field.checkboxLabel
|
|
44045
44225
|
})]
|
|
44046
44226
|
});
|
|
44047
44227
|
case "number": return /* @__PURE__ */ jsx("input", {
|
|
@@ -44110,10 +44290,10 @@ function DefaultBookingDiscount({ booking }) {
|
|
|
44110
44290
|
children: /* @__PURE__ */ jsxs("p", {
|
|
44111
44291
|
className: "ab-text",
|
|
44112
44292
|
children: [
|
|
44113
|
-
"Discount available:
|
|
44114
|
-
booking.discount.autoAppliedDiscount.publicLabel,
|
|
44293
|
+
"Discount available:",
|
|
44115
44294
|
" ",
|
|
44116
|
-
|
|
44295
|
+
booking.discount.autoAppliedDiscount.publicLabel,
|
|
44296
|
+
" will apply automatically at checkout."
|
|
44117
44297
|
]
|
|
44118
44298
|
})
|
|
44119
44299
|
}) : null]
|
|
@@ -44179,6 +44359,7 @@ var init_booking_form_default_ui = __esmMin((() => {
|
|
|
44179
44359
|
init_FeedbackMessage();
|
|
44180
44360
|
init_DiscountCodeDisclosure();
|
|
44181
44361
|
init_FieldValidationMessage();
|
|
44362
|
+
init_BookingConsentAgreement();
|
|
44182
44363
|
}));
|
|
44183
44364
|
//#endregion
|
|
44184
44365
|
//#region ../blocks/src/system/runtime/shared/utils/checkoutUrls.ts
|
|
@@ -46920,12 +47101,72 @@ var init_GuestDetailsSection = __esmMin((() => {
|
|
|
46920
47101
|
}));
|
|
46921
47102
|
//#endregion
|
|
46922
47103
|
//#region ../blocks/src/system/runtime/nodes/event-registration/AttendeeDetailsStep.tsx
|
|
47104
|
+
function EventConsentField({ consent, error, formData, idBase, onChange }) {
|
|
47105
|
+
const errorId = `${idBase}-consent-error`;
|
|
47106
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
47107
|
+
className: "er-field",
|
|
47108
|
+
children: [
|
|
47109
|
+
/* @__PURE__ */ jsx(BookingConsentAgreement, {
|
|
47110
|
+
agreement: consent.agreement,
|
|
47111
|
+
title: consent.title,
|
|
47112
|
+
titleId: `${idBase}-consent-title`
|
|
47113
|
+
}),
|
|
47114
|
+
/* @__PURE__ */ jsxs("label", {
|
|
47115
|
+
className: "er-label rb-flex rb-items-start rb-gap-2 rb-cursor-pointer",
|
|
47116
|
+
children: [
|
|
47117
|
+
/* @__PURE__ */ jsx("input", {
|
|
47118
|
+
"aria-describedby": error ? errorId : void 0,
|
|
47119
|
+
className: "form-checkbox rb-mt-0.5",
|
|
47120
|
+
checked: formData.consentAccepted === true,
|
|
47121
|
+
onChange: (event) => onChange({
|
|
47122
|
+
...formData,
|
|
47123
|
+
consentAccepted: event.target.checked
|
|
47124
|
+
}),
|
|
47125
|
+
type: "checkbox"
|
|
47126
|
+
}),
|
|
47127
|
+
consent.checkboxLabel,
|
|
47128
|
+
" ",
|
|
47129
|
+
/* @__PURE__ */ jsx("span", {
|
|
47130
|
+
className: "er-required",
|
|
47131
|
+
children: "*"
|
|
47132
|
+
})
|
|
47133
|
+
]
|
|
47134
|
+
}),
|
|
47135
|
+
error ? /* @__PURE__ */ jsx(FieldValidationMessage, {
|
|
47136
|
+
id: errorId,
|
|
47137
|
+
className: "er-error",
|
|
47138
|
+
children: error
|
|
47139
|
+
}) : null
|
|
47140
|
+
]
|
|
47141
|
+
});
|
|
47142
|
+
}
|
|
47143
|
+
function resolveGuestDetailsChangeHandler(requireGuestDetails, ticketsCount, onGuestsChange) {
|
|
47144
|
+
return requireGuestDetails && ticketsCount > 1 && onGuestsChange ? onGuestsChange : null;
|
|
47145
|
+
}
|
|
47146
|
+
function NotesField({ id, onChange, value }) {
|
|
47147
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
47148
|
+
className: "er-field",
|
|
47149
|
+
children: [/* @__PURE__ */ jsx("label", {
|
|
47150
|
+
className: "er-label",
|
|
47151
|
+
htmlFor: id,
|
|
47152
|
+
children: "Notes"
|
|
47153
|
+
}), /* @__PURE__ */ jsx("textarea", {
|
|
47154
|
+
id,
|
|
47155
|
+
value,
|
|
47156
|
+
onChange: (event) => onChange(event.target.value),
|
|
47157
|
+
className: "er-input",
|
|
47158
|
+
placeholder: "Any special requirements or notes (optional)",
|
|
47159
|
+
rows: 3
|
|
47160
|
+
})]
|
|
47161
|
+
});
|
|
47162
|
+
}
|
|
46923
47163
|
var AttendeeDetailsStep;
|
|
46924
47164
|
var init_AttendeeDetailsStep = __esmMin((() => {
|
|
46925
47165
|
init_GuestDetailsSection();
|
|
46926
47166
|
init_LoggedInAsUser();
|
|
46927
47167
|
init_FieldValidationMessage();
|
|
46928
|
-
|
|
47168
|
+
init_BookingConsentAgreement();
|
|
47169
|
+
AttendeeDetailsStep = ({ formData, onChange, errors, emailLocked = false, onLogout, ticketsCount = 1, requireGuestDetails = false, guests = [], onGuestsChange, guestErrors = {}, guestSectionShake = false, onGuestShakeEnd, consent }) => {
|
|
46929
47170
|
const idBase = useId();
|
|
46930
47171
|
const nameId = `${idBase}-name`;
|
|
46931
47172
|
const emailId = `${idBase}-email`;
|
|
@@ -46941,7 +47182,7 @@ var init_AttendeeDetailsStep = __esmMin((() => {
|
|
|
46941
47182
|
message: errors.email,
|
|
46942
47183
|
messageId: emailErrorId
|
|
46943
47184
|
});
|
|
46944
|
-
const
|
|
47185
|
+
const guestDetailsChangeHandler = resolveGuestDetailsChangeHandler(requireGuestDetails, ticketsCount, onGuestsChange);
|
|
46945
47186
|
return /* @__PURE__ */ jsxs("div", {
|
|
46946
47187
|
className: "rb-reg-stack er-stack",
|
|
46947
47188
|
children: [
|
|
@@ -47034,29 +47275,26 @@ var init_AttendeeDetailsStep = __esmMin((() => {
|
|
|
47034
47275
|
placeholder: "(optional)"
|
|
47035
47276
|
})]
|
|
47036
47277
|
}),
|
|
47037
|
-
/* @__PURE__ */
|
|
47038
|
-
|
|
47039
|
-
|
|
47040
|
-
|
|
47041
|
-
|
|
47042
|
-
|
|
47043
|
-
})
|
|
47044
|
-
|
|
47045
|
-
|
|
47046
|
-
|
|
47047
|
-
|
|
47048
|
-
|
|
47049
|
-
|
|
47050
|
-
|
|
47051
|
-
|
|
47052
|
-
rows: 3
|
|
47053
|
-
})]
|
|
47054
|
-
})
|
|
47278
|
+
/* @__PURE__ */ jsx(NotesField, {
|
|
47279
|
+
id: notesId,
|
|
47280
|
+
value: formData.notes,
|
|
47281
|
+
onChange: (notes) => onChange({
|
|
47282
|
+
...formData,
|
|
47283
|
+
notes
|
|
47284
|
+
})
|
|
47285
|
+
}),
|
|
47286
|
+
consent ? /* @__PURE__ */ jsx(EventConsentField, {
|
|
47287
|
+
consent,
|
|
47288
|
+
error: errors.consentAccepted,
|
|
47289
|
+
formData,
|
|
47290
|
+
idBase,
|
|
47291
|
+
onChange
|
|
47292
|
+
}) : null
|
|
47055
47293
|
] }),
|
|
47056
|
-
|
|
47294
|
+
guestDetailsChangeHandler && /* @__PURE__ */ jsx(GuestDetailsSection, {
|
|
47057
47295
|
guests,
|
|
47058
47296
|
errors: guestErrors,
|
|
47059
|
-
onChange:
|
|
47297
|
+
onChange: guestDetailsChangeHandler,
|
|
47060
47298
|
shake: guestSectionShake,
|
|
47061
47299
|
onShakeEnd: onGuestShakeEnd
|
|
47062
47300
|
})
|
|
@@ -102220,6 +102458,9 @@ var init_event_registration = __esmMin((() => {
|
|
|
102220
102458
|
}));
|
|
102221
102459
|
//#endregion
|
|
102222
102460
|
//#region ../blocks/src/system/runtime/nodes/event-registration/EventRegistrationWizardContent.tsx
|
|
102461
|
+
function getWizardConsent(wizard) {
|
|
102462
|
+
return (wizard.selectedEvent ?? wizard.preSelectedEvent)?.consent ?? null;
|
|
102463
|
+
}
|
|
102223
102464
|
function EventRegistrationWizardContent(props) {
|
|
102224
102465
|
const { wizard } = props;
|
|
102225
102466
|
const showSpamProtection = props.showSpamProtection ?? isSpamProtectionEnabled();
|
|
@@ -102299,7 +102540,8 @@ function EventRegistrationWizardContent(props) {
|
|
|
102299
102540
|
onGuestsChange: wizard.setGuests,
|
|
102300
102541
|
guestErrors: wizard.guestErrors,
|
|
102301
102542
|
guestSectionShake: wizard.guestSectionShake,
|
|
102302
|
-
onGuestShakeEnd: wizard.handleGuestShakeEnd
|
|
102543
|
+
onGuestShakeEnd: wizard.handleGuestShakeEnd,
|
|
102544
|
+
consent: getWizardConsent(wizard)
|
|
102303
102545
|
}),
|
|
102304
102546
|
showSpamProtection && /* @__PURE__ */ jsx("div", {
|
|
102305
102547
|
className: "er-altcha",
|
|
@@ -102682,11 +102924,21 @@ var init_EventRegistrationSummaryBar = __esmMin((() => {
|
|
|
102682
102924
|
}));
|
|
102683
102925
|
//#endregion
|
|
102684
102926
|
//#region ../blocks/src/system/runtime/nodes/event-registration/validation.ts
|
|
102685
|
-
function
|
|
102927
|
+
function createInitialRegistrationFormData() {
|
|
102928
|
+
return {
|
|
102929
|
+
name: "",
|
|
102930
|
+
email: "",
|
|
102931
|
+
phone: "",
|
|
102932
|
+
notes: "",
|
|
102933
|
+
consentAccepted: false
|
|
102934
|
+
};
|
|
102935
|
+
}
|
|
102936
|
+
function validateFormData(formData, requiresConsent = false) {
|
|
102686
102937
|
const errors = {};
|
|
102687
102938
|
if (!formData.name.trim()) errors.name = "Name is required";
|
|
102688
102939
|
if (!formData.email.trim()) errors.email = "Email is required";
|
|
102689
102940
|
else if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(formData.email)) errors.email = "Invalid email address";
|
|
102941
|
+
if (requiresConsent && formData.consentAccepted !== true) errors.consentAccepted = "Please read and accept the agreement before continuing.";
|
|
102690
102942
|
return errors;
|
|
102691
102943
|
}
|
|
102692
102944
|
var init_validation = __esmMin((() => {}));
|
|
@@ -103061,6 +103313,7 @@ function useEventRegistrationSubmitWithDeps(options, deps) {
|
|
|
103061
103313
|
name: options.formData.name.trim(),
|
|
103062
103314
|
phone: options.formData.phone.trim() || void 0,
|
|
103063
103315
|
notes: options.formData.notes.trim() || void 0,
|
|
103316
|
+
consentAccepted: options.formData.consentAccepted,
|
|
103064
103317
|
altchaSolution: options.altchaSolution,
|
|
103065
103318
|
paymentMethod: method,
|
|
103066
103319
|
customerPassId: method === "pass" ? passId : void 0,
|
|
@@ -103196,12 +103449,7 @@ function useEventRegistrationWizardWithDeps(options, deps) {
|
|
|
103196
103449
|
const step = flowState.step;
|
|
103197
103450
|
const paymentSelection = flowState.paymentSelection;
|
|
103198
103451
|
const [selectedEvent, setSelectedEvent] = useState(preSelectedEvent ?? null);
|
|
103199
|
-
const [formData, setFormData] = useState(
|
|
103200
|
-
name: "",
|
|
103201
|
-
email: "",
|
|
103202
|
-
phone: "",
|
|
103203
|
-
notes: ""
|
|
103204
|
-
});
|
|
103452
|
+
const [formData, setFormData] = useState(createInitialRegistrationFormData);
|
|
103205
103453
|
const [errors, setErrors] = useState({});
|
|
103206
103454
|
const [guests, setGuests] = useState([]);
|
|
103207
103455
|
const [guestErrors, setGuestErrors] = useState({});
|
|
@@ -103499,7 +103747,7 @@ function useEventRegistrationWizardWithDeps(options, deps) {
|
|
|
103499
103747
|
guests
|
|
103500
103748
|
]);
|
|
103501
103749
|
const validateForm = () => {
|
|
103502
|
-
const newErrors = validateFormData(formData);
|
|
103750
|
+
const newErrors = validateFormData(formData, Boolean(currentEvent?.consent));
|
|
103503
103751
|
setErrors(newErrors);
|
|
103504
103752
|
const newGuestErrors = {};
|
|
103505
103753
|
if (requireGuestDetails && guests.length > 0) {
|
|
@@ -103688,6 +103936,10 @@ function useEventRegistrationWizardWithDeps(options, deps) {
|
|
|
103688
103936
|
});
|
|
103689
103937
|
const handleEventSelect = (event) => {
|
|
103690
103938
|
setSelectedEvent(event);
|
|
103939
|
+
setFormData((current) => ({
|
|
103940
|
+
...current,
|
|
103941
|
+
consentAccepted: false
|
|
103942
|
+
}));
|
|
103691
103943
|
const slidingScale = getSlidingScaleForEvent(event);
|
|
103692
103944
|
setSelectedSlidingAmountInput(slidingScale?.suggestedAmount !== null && slidingScale?.suggestedAmount !== void 0 ? formatCentsAsCurrencyInput$1(slidingScale.suggestedAmount) : "");
|
|
103693
103945
|
setSelectedAttendanceMode((event.deliveryMode ?? "in_person") === "hybrid" ? null : (event.deliveryMode ?? "in_person") === "online" ? "online" : "in_person");
|
|
@@ -104924,6 +105176,7 @@ function validateSubmission(state, setters) {
|
|
|
104924
105176
|
message: "Choose an available set of dates to continue."
|
|
104925
105177
|
};
|
|
104926
105178
|
const errors = validateFormData$1(state.formData);
|
|
105179
|
+
if (state.selectedRun.consent && state.formData.consentAccepted !== true) errors.consentAccepted = "Please read and accept the agreement before continuing.";
|
|
104927
105180
|
setters.setErrors(errors);
|
|
104928
105181
|
if (Object.keys(errors).length > 0) return { kind: "validation-failed" };
|
|
104929
105182
|
const pricingMessage = getMissingWholeSeriesPricingSelectionMessage(state.pricing);
|
|
@@ -104947,6 +105200,7 @@ function registrantPayload(state) {
|
|
|
104947
105200
|
name: state.formData.name.trim(),
|
|
104948
105201
|
phone: state.formData.phone.trim() || void 0,
|
|
104949
105202
|
formData: { notes: state.formData.notes.trim() || void 0 },
|
|
105203
|
+
consentAccepted: state.formData.consentAccepted,
|
|
104950
105204
|
altchaSolution: state.altchaSolution,
|
|
104951
105205
|
claimToken: state.claimToken ?? void 0
|
|
104952
105206
|
};
|
|
@@ -105112,7 +105366,8 @@ var init_useWholeSeriesRegistrationPortal = __esmMin((() => {
|
|
|
105112
105366
|
name: "",
|
|
105113
105367
|
email: "",
|
|
105114
105368
|
phone: "",
|
|
105115
|
-
notes: ""
|
|
105369
|
+
notes: "",
|
|
105370
|
+
consentAccepted: false
|
|
105116
105371
|
};
|
|
105117
105372
|
}));
|
|
105118
105373
|
//#endregion
|
|
@@ -105643,19 +105898,65 @@ function WholeSeriesSlidingScaleInput({ pricing, value, onChange }) {
|
|
|
105643
105898
|
]
|
|
105644
105899
|
});
|
|
105645
105900
|
}
|
|
105646
|
-
function
|
|
105647
|
-
|
|
105648
|
-
|
|
105649
|
-
|
|
105650
|
-
|
|
105651
|
-
|
|
105652
|
-
|
|
105653
|
-
|
|
105654
|
-
|
|
105655
|
-
|
|
105656
|
-
|
|
105657
|
-
|
|
105658
|
-
|
|
105901
|
+
function WholeSeriesConsentField({ consent, error, formData, isLoading, onChange }) {
|
|
105902
|
+
const errorId = "er-whole-series-consent-error";
|
|
105903
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
105904
|
+
className: "er-whole-series-form__field",
|
|
105905
|
+
children: [
|
|
105906
|
+
/* @__PURE__ */ jsx(BookingConsentAgreement, {
|
|
105907
|
+
agreement: consent.agreement,
|
|
105908
|
+
title: consent.title,
|
|
105909
|
+
titleId: "er-whole-series-consent-title"
|
|
105910
|
+
}),
|
|
105911
|
+
/* @__PURE__ */ jsxs("label", {
|
|
105912
|
+
className: "er-whole-series-form__label rb-flex rb-items-start rb-gap-2 rb-cursor-pointer",
|
|
105913
|
+
children: [
|
|
105914
|
+
/* @__PURE__ */ jsx("input", {
|
|
105915
|
+
type: "checkbox",
|
|
105916
|
+
className: "form-checkbox rb-mt-0.5",
|
|
105917
|
+
checked: formData.consentAccepted === true,
|
|
105918
|
+
disabled: isLoading,
|
|
105919
|
+
"aria-describedby": error ? errorId : void 0,
|
|
105920
|
+
onChange: (event) => onChange({
|
|
105921
|
+
...formData,
|
|
105922
|
+
consentAccepted: event.target.checked
|
|
105923
|
+
})
|
|
105924
|
+
}),
|
|
105925
|
+
consent.checkboxLabel,
|
|
105926
|
+
" *"
|
|
105927
|
+
]
|
|
105928
|
+
}),
|
|
105929
|
+
error ? /* @__PURE__ */ jsx(FieldValidationMessage, {
|
|
105930
|
+
id: errorId,
|
|
105931
|
+
className: "er-whole-series-form__error",
|
|
105932
|
+
children: error
|
|
105933
|
+
}) : null
|
|
105934
|
+
]
|
|
105935
|
+
});
|
|
105936
|
+
}
|
|
105937
|
+
function EnrollmentForm({ formData, errors, onChange, isEmailLocked, isLoading, onLogout, consent }) {
|
|
105938
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
105939
|
+
/* @__PURE__ */ jsx(EnrollmentIdentityFields, {
|
|
105940
|
+
formData,
|
|
105941
|
+
errors,
|
|
105942
|
+
onChange,
|
|
105943
|
+
isEmailLocked,
|
|
105944
|
+
isLoading,
|
|
105945
|
+
onLogout
|
|
105946
|
+
}),
|
|
105947
|
+
/* @__PURE__ */ jsx(EnrollmentOptionalFields, {
|
|
105948
|
+
formData,
|
|
105949
|
+
onChange,
|
|
105950
|
+
isLoading
|
|
105951
|
+
}),
|
|
105952
|
+
consent ? /* @__PURE__ */ jsx(WholeSeriesConsentField, {
|
|
105953
|
+
consent,
|
|
105954
|
+
error: errors.consentAccepted,
|
|
105955
|
+
formData,
|
|
105956
|
+
isLoading,
|
|
105957
|
+
onChange
|
|
105958
|
+
}) : null
|
|
105959
|
+
] });
|
|
105659
105960
|
}
|
|
105660
105961
|
function EnrollmentIdentityFields({ formData, errors, onChange, isEmailLocked, isLoading, onLogout }) {
|
|
105661
105962
|
const nameErrorId = "er-whole-series-name-error";
|
|
@@ -105769,6 +106070,7 @@ var init_components = __esmMin((() => {
|
|
|
105769
106070
|
init_utils();
|
|
105770
106071
|
init_LoggedInAsUser();
|
|
105771
106072
|
init_FieldValidationMessage();
|
|
106073
|
+
init_BookingConsentAgreement();
|
|
105772
106074
|
}));
|
|
105773
106075
|
//#endregion
|
|
105774
106076
|
//#region ../blocks/src/system/runtime/nodes/event-registration/whole-series/WholeSeriesRegistrationActiveSteps.tsx
|
|
@@ -105856,7 +106158,8 @@ function RegistrationDetailsForm({ wizard, display }) {
|
|
|
105856
106158
|
onChange: wizard.updateFormData,
|
|
105857
106159
|
isEmailLocked: wizard.portalAuthState === "authenticated" || wizard.waitlistClaim.claim !== null,
|
|
105858
106160
|
isLoading: wizard.portalAuthState === "checking" || wizard.waitlistClaim.isLoading,
|
|
105859
|
-
onLogout: wizard.handleLogout
|
|
106161
|
+
onLogout: wizard.handleLogout,
|
|
106162
|
+
consent: wizard.selectedRun?.consent ?? null
|
|
105860
106163
|
}),
|
|
105861
106164
|
/* @__PURE__ */ jsx(PricingFields, { wizard }),
|
|
105862
106165
|
wizard.showSpamProtection ? /* @__PURE__ */ jsx("div", {
|
|
@@ -106456,33 +106759,6 @@ var init_WholeSeriesRegistrationWizard = __esmMin((() => {
|
|
|
106456
106759
|
};
|
|
106457
106760
|
}));
|
|
106458
106761
|
//#endregion
|
|
106459
|
-
//#region ../blocks/src/system/runtime/nodes/event-registration/registrationSurface.ts
|
|
106460
|
-
function planEventRegistrationSurface(input) {
|
|
106461
|
-
const scopedEvents = resolveEventRegistrationScopedEvents(input.events, {
|
|
106462
|
-
occurrenceContext: input.occurrenceContext,
|
|
106463
|
-
subject: input.subject
|
|
106464
|
-
});
|
|
106465
|
-
const bookingScopes = new Set(scopedEvents.map((event) => event.bookingScope));
|
|
106466
|
-
if (!input.occurrenceContext && !input.subject && bookingScopes.has("single_occurrence")) return {
|
|
106467
|
-
kind: "occurrence",
|
|
106468
|
-
events: scopedEvents.filter((event) => event.bookingScope === "single_occurrence")
|
|
106469
|
-
};
|
|
106470
|
-
if (bookingScopes.size === 0 || bookingScopes.has("single_occurrence")) return bookingScopes.has("whole_series") ? { kind: "mixedBookingScopes" } : {
|
|
106471
|
-
kind: "occurrence",
|
|
106472
|
-
events: scopedEvents
|
|
106473
|
-
};
|
|
106474
|
-
const requiredSeriesIds = new Set(scopedEvents.map((event) => event.seriesId));
|
|
106475
|
-
const offerings = input.wholeSeriesOfferings.filter((offering) => requiredSeriesIds.has(offering.eventSeriesId));
|
|
106476
|
-
const loadedSeriesIds = new Set(offerings.map((offering) => offering.eventSeriesId));
|
|
106477
|
-
return [...requiredSeriesIds].every((seriesId) => loadedSeriesIds.has(seriesId)) && offerings.length > 0 ? {
|
|
106478
|
-
kind: "wholeSeries",
|
|
106479
|
-
offerings
|
|
106480
|
-
} : { kind: "unavailableWholeSeries" };
|
|
106481
|
-
}
|
|
106482
|
-
var init_registrationSurface = __esmMin((() => {
|
|
106483
|
-
init_eventScope();
|
|
106484
|
-
}));
|
|
106485
|
-
//#endregion
|
|
106486
106762
|
//#region ../blocks/src/system/runtime/nodes/event-registration/PastOccurrenceNotice.tsx
|
|
106487
106763
|
function isPastOccurrence(startsAt) {
|
|
106488
106764
|
if (!startsAt) return false;
|
|
@@ -106548,7 +106824,8 @@ var init_event_registration_client = __esmMin((() => {
|
|
|
106548
106824
|
EventRegistrationClient = (clientProps) => {
|
|
106549
106825
|
const surface = planEventRegistrationSurface({
|
|
106550
106826
|
events: clientProps.events ?? [],
|
|
106551
|
-
wholeSeriesOfferings: clientProps.
|
|
106827
|
+
wholeSeriesOfferings: clientProps.wholeSeriesOfferings ?? [],
|
|
106828
|
+
wholeSeriesOffering: clientProps.wholeSeriesOffering,
|
|
106552
106829
|
occurrenceContext: clientProps.occurrenceContext,
|
|
106553
106830
|
subject: clientProps.subject
|
|
106554
106831
|
});
|