riverbankcms 0.35.0 → 0.37.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.
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
- import { $ as walkAndCollectImageAttrs, $t as flatInkParametersSchema, A as parseSiteChromeBackgroundColorToken, An as buildEntryScaffold, Ar as createContentEntryRef, At as getMimeType, B as sectionStylesOverrideSchema, Bn as isResolvedInternalLinkEntityType, Bt as footerPreferencesSchema, C as blockOrderIdentifiersForCommand, Cn as bookingPaymentCollectionOptionSchema, Cr as makeBoundaryId, Ct as parseCanonicalMediaIdentifier, D as pagePathForCommand, Dn as RichTextDocSchema, Dr as createBlockRef, Dt as deriveVideoSlotPolicy, E as pageIdentifierForCommand, Er as ianaTimezoneSchema, F as defaultHeaderBrandPreferences, Fn as entryLinkSchema$1, Fr as createNavigationRef, G as headerInteractionQuietPalette, Gn as parseGradientPresetId, Gt as cardVariantRoleValues, H as skinBookingBarSchema, Hn as pageLinkSchema$1, Hr as __toESM, Ht as boxlessCardVariantValue, In as externalLinkSchema$1, Ir as createPageRef, It as classifyKnownMimeType, J as boxBackgroundOverlaySchema, Jn as asHeaderLayoutId, Jt as surfaceCardRoleValues, K as blockCustomCssRuleSchema, Kt as itemRoleValues, L as cardStylesOverrideSchema, Ln as internalLinkSchema, Lt as managementMediaLibraryUploadLimitForMimeType, M as defaultHeaderPreferences, Mn as findUnfilledSentinels, Mr as createEventSeriesRef, N as defaultHeaderNavPreferences, Nn as RESOLVED_INTERNAL_LINK_ENTITY_TYPES, Nr as createFooterRef, Nt as parseRelativeStoragePath, O as hasConfiguredBookingVertical, On as isRichTextDoc, Or as createBlocksRef, Ot as resolveVideoSelectionIntentForMediaField, P as defaultHeaderBrandPresentation, Pn as customLinkSchema$1, Pr as createFormRef, Pt as FILE_SIZE_LIMITS, Q as summarizePortableMediaReferences, Qt as flatInkHoverTreatmentSchema, R as containerStylesOverrideSchema, Rn as internalResolvedLinkSchema, Rr as createVenueRef, Rt as parseSafeDownloadFilename, S as blockIdentifierForCommand, Sr as asSiteStyleId, St as buildMediaIdentifierFromFilename, T as pageIdentifierForBlockCommand, Tn as eventCommandScheduleSchema, U as headerVariantValues, Un as ICON_PICKER_PRESETS, Ut as cardRoleSchema, V as themeSchema, Vn as linkSchema, Vr as __commonJSMin, Vt as getFontWidthRange, W as headerInteractionPaletteValues, Wn as gradientPresetIdValues, Wt as cardRoleValues, X as runtimeBoxBackgroundSchema, Xn as bookingPageLookIdValues, Xt as buttonStyleSelectionSchema, Y as boxBackgroundSchema, Yn as asHeaderStyleId, Yt as BUTTON_STYLE_IDS, Z as collectPortableMediaReferencesFromContent, Zt as editorialLinkParametersSchema, _ as mapEventCommandContent, _n as paletteTokenNameSchema, _t as resolveManagedMediaReference, an as buttonVariantIdSchema, ar as arrangementModes, at as parseAspectRatioValue, bn as changeBookingQuestionsInputSchema, br as asLayoutVariantKey, bt as mediaTypeDiscriminants, c as isEventVisibility, cn as parseOpaqueButtonColourToken, cr as headingDecorationColorTokenValues, ct as getDirectImageUrlForSiteScopedPath, d as venueManagementFields, dn as hexColorSchema, dr as visibleHeadingDecorationFamilyValues, dt as imageMediaSchema, en as quietArrowParametersSchema, er as pageDesignEditorBackgroundOverrideOwner, et as deleteEnvSpecificKeys, f as sortRecord, fn as normalizePaletteHex, fr as asAppearancePresetId, ft as mediaSchema, g as resolveEventSeriesWaitlistMapping, gn as paletteModeSchema, gr as asDesignBlockId, gt as buildRenderableMediaAssetIndex, hn as paletteColorsSchema, hr as asBoundaryOptionId, ht as videoMediaSchema, i as sdkEventUpsertOptionalFieldSchemas, in as buttonSystemSchema, ir as VARIANT_ROLES, it as isExplicitRectCrop, j as backgroundAppearanceColorTokenNames, jn as validateEntryInstance, jr as createEventCategoryRef, jt as asRecord, k as headerPreferencesSchema, kn as sanitizeHref, kr as createCommandRef, ln as PALETTE_TOKEN_NAMES, lr as isArrangementMode, lt as getImageUrl, mn as paletteColorsFromEntries, mr as asBlockOrderIndex, mt as runtimeMediaSchema, nn as buttonEffectApplicationSchema, nr as siteChromeBackgroundOverrideOwner, nt as rotateNormalizedPoint, o as classifySdkEventBookingOffer, on as buttonVisualStatesSchema, or as eventListTreatmentValues, ot as resolveMediaTransformForAspect, p as stableStringify, pn as paletteColorEntries, pr as asBlockContentVersionId, pt as persistableMediaSchema, q as customCssRuleSchema, qn as asFooterLookId, qt as openCardRoleValue, rn as buttonPressOffsetSchema, rt as normalizeWidthCandidates, sn as opaqueButtonColourTokenSchema, sr as eyebrowTreatmentValues, st as getDirectImageUrlForRelativePath, t as classifySdkEventTiming, tn as squareOutlineParametersSchema, tr as parseBookingPageLookId, tt as looksLikeUuid, u as eventCategoryManagementFields, un as blockColorTokenNames, ur as tileTreatmentValues, ut as isSiteScopedDirectImageStoragePath, vn as parseColorTokenParts, vr as asDesignPageId, vt as PUBLIC_FILE_FIELD_KINDS, w as entryIdentifierForCommand, wn as bookingPaymentTermsSchema, wt as parseMediaIdentifier, x as eventManagementTiming, xr as asPageFlowPresetId, xt as mediaIdentifierSchema, yn as parseThemeColorToken, yr as asDesignSystemTemplateId, z as headerPositioningValues, zn as internalRouteOnlyLinkSchema, zr as refSlug, zt as defaultFooterPreferences } from "../sdk-event-upsert-DoazwQVt.mjs";
3
- import { $ as footerLayoutForLookId, $t as resolveBookingDisplayContext, B as parseManagementKey, Bt as deriveTotalTicketQuantity, Cn as publicEventPricingDisplay, Ct as mapDrawingSchema, Dn as resolveExactOrFreePriceDisplay, En as publicEventPricingType, F as orderedLiveRunSessions, Fr as blockInteractionContextSchema, G as parseMailingListRuntimeContext, Gt as hasBookingClosed, H as parseMailingListBlockId, Hn as formatDurationUnitLabel, Ht as bookingCutOffHoursBetween, I as resolveWholeSeriesBookingPhase, In as toNonNegativeCents, Jn as parseSiteTermsVersionId, Jt as formatDateTime, K as assessMailingListTargeting, Kt as formatDate, L as resolveWholeSeriesRunLifecycle, M as CANCELLED_SESSION_STATUS, Mt as getBookingInstalmentPlanIntervalCount, N as firstLiveRunSessionStartMs, Nr as err, Nt as getBookingInstalmentProtectedDepositAmountCents, On as resolvePricingOptionsPriceDisplay, P as nextLiveRunSessionStartMs, Pr as ok, Q as parseFooterCompositionV1, Qt as inferSiteDateLocale, R as createSecret, S as EVENT_PRESET_VALUES, Sn as publicEventPricingCurrency, Sr as parseUserId, St as trimmedStringOrNull, T as WHOLE_SERIES_EVENT_PRESET_VALUES, Tn as publicEventPricingStrategy, Tr as parseEventSeriesId, Tt as buildBookingUtcDateWindow, U as parseMailingListContentVersionId, Ut as formatBookingClosedTime, V as slugify, Vn as assertNever, W as parseMailingListSignedSourceToken, Wn as unsafeAsDemoCapability, Wt as formatBookingCutOffHours, X as DEFAULT_MAILING_LIST_SUCCESS_MESSAGE, Xt as formatTime$1, Y as DEFAULT_MAILING_LIST_PRIVACY_NOTE, Yt as formatDateTimeRange, Zt as formatTimeRange, _n as parsePageSurfaceSubject, _t as parseLocationValue, a as authoredValuesEqual, an as getBookingLocalDateKey, ar as unsafeAsMediaAssetId, at as formatOpeningHoursRows, b as resolveSiteVerticalBookingConfig, bn as formatEventPricing, br as parseApiKeyId, bt as toLocationCoordinates, d as formatCreditProductUnits, dn as parseUtcIsoDateTimeString, dt as decideLocationSave, en as toScheduledBookingDateTime, et as parseMailingListPlacementTargeting, fn as toUtcIsoDateTimeString, ft as stableJsonStringify, gt as normalizeLocationAddressText, h as NAVIGATION_LOCATIONS, hn as toBookingTimeZone, ht as locationValueSchema, i as isRecord$27, in as formatLocalScheduleTime, it as richTextHasText, jn as mapReadonlyNonEmptyArray, l as creditProductUnitNoun, ln as parseBookingLocalDate, mn as resolveBookingTimeZoneId, mt as EVENT_ADDRESS_AFTER_BOOKING_LABEL, nn as compareLocalScheduleDates, nt as planMailingListChoicePresentation, on as getLocalScheduleDate, pn as resolveBookingBusinessTimeZone, pt as locationMapLinks, qt as formatDateRange, rn as formatLocalScheduleDate, rt as isCanonicalRichTextDoc, sn as getLocalScheduleTime, sr as unsafeAsPositiveByteCount, st as parseWeeklyOpeningHours, tt as DEFAULT_MAILING_LIST_TARGETING, u as formatCreditProductPayment, un as parseLocalScheduleTime, vn as EVENT_PRESET_VOCABULARY, vt as projectPublicLocation, wn as publicEventPricingOptions, wt as selectCategoryView, xn as isPublicEventPricingOptionDisplayable, xr as parseSiteId, yn as formatBookingPriceDisplay, yt as publicLocationSchema, z as exposeSecret, zn as formatCurrencyAmount } from "../src-CysOxz1U.mjs";
4
- import { $ as walkLocalContentMedia, $n as extractApiErrorMessage, $r as ApiEnvelopeError, $t as commandContexts, A as formatDiffSummary, An as isLocalConfigured, Ar as getBookingLaterInstalments, At as navigationIdentityMap, B as formatFieldChange, Bn as DEFAULT_MEDIA_FIELD_KINDS, Br as publicProductSchema, Bt as ACCOUNT_SITE_SEARCH_MAX_LENGTH, C as reportFromOutcomes, Cn as ErrorCodes, Cr as planFlexibleBalanceCreditFirst, Ct as listFiles, D as calculateDiff, Dr as resolveAvailableBookingCollectionOptions, Dt as isMediaValue, E as createEmptySyncResult, En as CliExit, Er as repriceBookingCollectionOptions, Et as writeJsonFileAtomic, F as buildJsonDiff, Fn as cardListKnobBlocks, Fr as eventCalendarListLayoutValues, Ft as createBearerAccountApi, G as applyLocalMediaPush, Gn as MAX_REPEATER_GRID_COLUMNS, Gr as calendarMonthWindowSchema, Gt as createPushConfigCommand, H as revalidateLocalMediaPushPlan, Hn as blockContentSourceSchema, Hr as purchasablePublicPassProductSchema, Ht as navigationCommandItemToManagementInput, I as hasPageOperations, In as lookKnobBlocks, Ir as publicMapLocationResultSchema, It as ACCOUNT_SITE_CURSOR_MAX_LENGTH, J as readStableBinaryFile, Jn as resolveRepeaterGridColumnFieldId, Jr as eventSurfacePresetValues, Jt as revalidatePushConfigPlan, K as prepareLocalMediaForPush, Kn as isAcceptedRepeaterGridSpan, Kr as calendarSourceCursorSchema, Kt as loadPushConfigTarget, L as pageMetadataForUpsert, Ln as NodeSchema, Lr as publicVenueMapLocationSchema, Lt as ACCOUNT_SITE_LIST_LIMIT_DEFAULT, M as findChangedFieldsWithValues, Mn as loadSdkEnvironment, Mr as eventCalendarDefaultViewValues, Mt as convertPulledNavigationToLocal, N as formatHumanDiff, Nn as cardListBlockParts, Nr as eventCalendarDisplayModeValues, Nt as convertPulledPagesToLocal, O as calculateFooterDiff, On as getEnvPrefix, Or as resolveBookingCollectionOptionFacts, Ot as duplicateNavigationIdentityMessage, P as calculatePullDiff, Pn as cardListFamilyBlocks, Pr as eventCalendarListLayoutCompatibleDisplayModeValues, Pt as AccountApiMalformedResponseError, Q as normalizeMediaValueToIdentifierOnly, Qn as ManagementApiError, Qr as publicEventLoaderQuerySchemaShape, Qt as CommandFailure, Rn as NodeTreeSchema, Rr as publicMembershipProductSchema, Rt as ACCOUNT_SITE_LIST_LIMIT_MAX, S as planCliCommandBatchForBindings, Sn as withRiverbankEnv, Sr as planCheckoutPaymentFlow, St as fileExists, T as executeResidualSettingsSyncPlan, Tn as transportSuggestion, Tr as isBookingCollectionEquivalentToUpfront, Tt as writeJsonFile, Un as blockRequiredFeatureSchema, Ur as CALENDAR_SSR_PAGE_SIZE, Ut as normalizeNavigationConfigItemForCommand, V as formatFieldPath, Vn as blockCategoryEnum, Vr as purchasablePublicMembershipProductSchema, Vt as ACCOUNT_SITE_TITLE_MAX_LENGTH, W as syncLocalMediaForPull, Wn as fieldSchema$1, Wr as calendarMonthDate, Wt as applyPushConfigPlan, X as sha256, Xn as resolveRepeaterGridSpanFieldId, Xr as monthNumber, Xt as deriveCmsApiUrlFromDashboardUrl, Y as writeBinaryFileAtomic, Yn as resolveRepeaterGridRowFieldId, Yr as eventSurfaceScopeValues, Yt as createBearerAPIClient, Z as normalizeMediaIdentifierInput, Zn as visibilityLevels, Zr as normalizeCalendarFilterId, Zt as mapEnvironmentExecutionOutcomesJson, _ as commandExecutionToReport, _n as executeEnvironmentPlan, _r as nextCombinationHint, _t as metadataTargetFromEnvironment, a as executeEntryCommandPlanAsReport, an as confirmAction, ar as linkPayloadSchema, at as readAllMeta, b as executeCompiledCliCommandPlanAsReport, bn as planEnvironmentWriteAuthorization, br as checkoutCopy, bt as writeMetadataRecordMap, c as titleFromEntryData, cn as formatDateShort, cr as pageDesignIntentSchemaVersion, ct as readFooterMeta, d as unsafeAsCliEntryIdentifier, dn as managementClientFor, dr as areEventBookingRequirementsIdentical, dt as readPagesMeta, ei as unwrapResponse, en as defineCommand, er as normalizeApiError, et as buildStorageUrl, f as unsafeAsCliFormSlug, fn as mapEntryForOutput, fr as eventBookingConsentContentKey, ft as readSettingsMeta, g as commandCompileFailureToReport, gn as runWithInvocation, gr as checkoutStatusArms, gt as metadataFilePath, h as mutationCounterForEffect, hn as resolveCommandPath, hr as resolveSelectionAttendanceMode, ht as ensureMetadataDir, i as entrySiteCommandTypes, in as bindRequestTimeout, ir as sdkSettingsUpdateSchema, it as readEntries, j as hasPendingChanges, jn as isRemoteConfigured, jr as MAX_EVENT_BOOKING_SELECTION_ITEMS, jt as convertPulledFooterToLocal, k as formatDiffDetail, kn as getEnvironmentDebugInfo, kr as getStripeMinimumChargeRequirement, kt as navigationIdentity, l as unsafeAsCliBlockIdentifier, ln as handleCommandError, lr as sdkConfiguredBookingVerticalConfigSchema, lt as readFormsMeta, m as commandReportToSyncResult, mn as parseJsonData, mr as decideSelectionAttendance, mt as writeMediaManifest, n as entryCommandCompileErrorToReport, nn as registerCommand, nr as ApiRequestError, nt as extractMediaIdentifiers, o as executeEntryCommandPlanAsSyncResult, on as createOutputForCommand, or as portablePageDesignSchema, ot as readEventCategoriesMeta, p as unsafeAsCliPageIdentifier, pn as parseJsonArray, pr as INCOMPATIBLE_ATTENDANCE_MESSAGE, pt as readVenuesMeta, q as admitBinaryWriteDestination, qn as parseRepeaterGridInteger, qr as eventScheduleScopeValues, qt as preparePushConfigTarget, r as entryCommandReportToSyncResult, rn as renderedByOwner, rr as sdkEventScheduleSchema, rt as findLegacyEntryFiles, s as syncResultForEntryCommandCompileError, sn as currentInvocationEnvelope, sr as pageDesignDecisionsV2Schema, st as readEventsMeta, t as compileEntryPushCommands, tn as defineCommandGroup, tr as isRecord$2, tt as downloadMedia, u as unsafeAsCliContentTypeKey, un as loadManagementTarget, ur as API_ENDPOINTS, ut as readNavigationMeta, v as commandReportHasFailures, vn as parseEnvironmentSelection, vr as planSelectionCombinationPrices, vt as readMetadataFile, w as mergeManySyncResults, wn as formatError, wr as flexibleBalanceDueDay, wt as readJsonFile, x as formatManagementError, xn as requireEnvironmentWriteAuthorization, xr as unsafeAsPositiveCheckoutQuantity, xt as ensureDir, y as executeCliCommandPlan, yn as planEnvironmentExecution, yr as eventRegistrationErrors, yt as writeMetadataFile, z as buildFieldChanges, zn as bindingSchema, zr as publicPassProductSchema, zt as ACCOUNT_SITE_LIST_LIMIT_MIN } from "../entryCommands-D-1ldejM.mjs";
5
- import { r as CLI_VERSION, t as loadConfigFile } from "../load-config-DB_S_gdr.mjs";
6
- import { t as eventUpsertInputSchema } from "../eventUpsertInputSchema-D1CXYu1M.mjs";
7
- import { a as prepareScaffoldExecution, c as LOCAL_PACKAGE_VENDOR_DIR, d as loadGeneratedPackageRanges, i as preflightScaffoldTargets, n as createScaffoldCompletion, s as deriveScaffoldLocalManifest, t as deriveScaffoldPlan } from "../plan-CMMvs6Nr.mjs";
2
+ import { $ as walkAndCollectImageAttrs, $t as flatInkParametersSchema, A as parseSiteChromeBackgroundColorToken, An as buildEntryScaffold, Ar as createContentEntryRef, At as getMimeType, B as sectionStylesOverrideSchema, Bn as isResolvedInternalLinkEntityType, Bt as footerPreferencesSchema, C as blockOrderIdentifiersForCommand, Cn as bookingPaymentCollectionOptionSchema, Cr as makeBoundaryId, Ct as parseCanonicalMediaIdentifier, D as pagePathForCommand, Dn as RichTextDocSchema, Dr as createBlockRef, Dt as deriveVideoSlotPolicy, E as pageIdentifierForCommand, Er as ianaTimezoneSchema, F as defaultHeaderBrandPreferences, Fn as entryLinkSchema$1, Fr as createNavigationRef, G as headerInteractionQuietPalette, Gn as parseGradientPresetId, Gt as cardVariantRoleValues, H as skinBookingBarSchema, Hn as pageLinkSchema$1, Hr as __toESM, Ht as boxlessCardVariantValue, In as externalLinkSchema$1, Ir as createPageRef, It as classifyKnownMimeType, J as boxBackgroundOverlaySchema, Jn as asHeaderLayoutId, Jt as surfaceCardRoleValues, K as blockCustomCssRuleSchema, Kt as itemRoleValues, L as cardStylesOverrideSchema, Ln as internalLinkSchema, Lt as managementMediaLibraryUploadLimitForMimeType, M as defaultHeaderPreferences, Mn as findUnfilledSentinels, Mr as createEventSeriesRef, N as defaultHeaderNavPreferences, Nn as RESOLVED_INTERNAL_LINK_ENTITY_TYPES, Nr as createFooterRef, Nt as parseRelativeStoragePath, O as hasConfiguredBookingVertical, On as isRichTextDoc, Or as createBlocksRef, Ot as resolveVideoSelectionIntentForMediaField, P as defaultHeaderBrandPresentation, Pn as customLinkSchema$1, Pr as createFormRef, Pt as FILE_SIZE_LIMITS, Q as summarizePortableMediaReferences, Qt as flatInkHoverTreatmentSchema, R as containerStylesOverrideSchema, Rn as internalResolvedLinkSchema, Rr as createVenueRef, Rt as parseSafeDownloadFilename, S as blockIdentifierForCommand, Sr as asSiteStyleId, St as buildMediaIdentifierFromFilename, T as pageIdentifierForBlockCommand, Tn as eventCommandScheduleSchema, U as headerVariantValues, Un as ICON_PICKER_PRESETS, Ut as cardRoleSchema, V as themeSchema, Vn as linkSchema, Vr as __commonJSMin, Vt as getFontWidthRange, W as headerInteractionPaletteValues, Wn as gradientPresetIdValues, Wt as cardRoleValues, X as runtimeBoxBackgroundSchema, Xn as bookingPageLookIdValues, Xt as buttonStyleSelectionSchema, Y as boxBackgroundSchema, Yn as asHeaderStyleId, Yt as BUTTON_STYLE_IDS, Z as collectPortableMediaReferencesFromContent, Zt as editorialLinkParametersSchema, _ as mapEventCommandContent, _n as paletteTokenNameSchema, _t as resolveManagedMediaReference, an as buttonVariantIdSchema, ar as arrangementModes, at as parseAspectRatioValue, bn as changeBookingQuestionsInputSchema, br as asLayoutVariantKey, bt as mediaTypeDiscriminants, c as isEventVisibility, cn as parseOpaqueButtonColourToken, cr as headingDecorationColorTokenValues, ct as getDirectImageUrlForSiteScopedPath, d as venueManagementFields, dn as hexColorSchema, dr as visibleHeadingDecorationFamilyValues, dt as imageMediaSchema, en as quietArrowParametersSchema, er as pageDesignEditorBackgroundOverrideOwner, et as deleteEnvSpecificKeys, f as sortRecord, fn as normalizePaletteHex, fr as asAppearancePresetId, ft as mediaSchema, g as resolveEventSeriesWaitlistMapping, gn as paletteModeSchema, gr as asDesignBlockId, gt as buildRenderableMediaAssetIndex, hn as paletteColorsSchema, hr as asBoundaryOptionId, ht as videoMediaSchema, i as sdkEventUpsertOptionalFieldSchemas, in as buttonSystemSchema, ir as VARIANT_ROLES, it as isExplicitRectCrop, j as backgroundAppearanceColorTokenNames, jn as validateEntryInstance, jr as createEventCategoryRef, jt as asRecord, k as headerPreferencesSchema, kn as sanitizeHref, kr as createCommandRef, ln as PALETTE_TOKEN_NAMES, lr as isArrangementMode, lt as getImageUrl, mn as paletteColorsFromEntries, mr as asBlockOrderIndex, mt as runtimeMediaSchema, nn as buttonEffectApplicationSchema, nr as siteChromeBackgroundOverrideOwner, nt as rotateNormalizedPoint, o as classifySdkEventBookingOffer, on as buttonVisualStatesSchema, or as eventListTreatmentValues, ot as resolveMediaTransformForAspect, p as stableStringify, pn as paletteColorEntries, pr as asBlockContentVersionId, pt as persistableMediaSchema, q as customCssRuleSchema, qn as asFooterLookId, qt as openCardRoleValue, rn as buttonPressOffsetSchema, rt as normalizeWidthCandidates, sn as opaqueButtonColourTokenSchema, sr as eyebrowTreatmentValues, st as getDirectImageUrlForRelativePath, t as classifySdkEventTiming, tn as squareOutlineParametersSchema, tr as parseBookingPageLookId, tt as looksLikeUuid, u as eventCategoryManagementFields, un as blockColorTokenNames, ur as tileTreatmentValues, ut as isSiteScopedDirectImageStoragePath, vn as parseColorTokenParts, vr as asDesignPageId, vt as PUBLIC_FILE_FIELD_KINDS, w as entryIdentifierForCommand, wn as bookingPaymentTermsSchema, wt as parseMediaIdentifier, x as eventManagementTiming, xr as asPageFlowPresetId, xt as mediaIdentifierSchema, yn as parseThemeColorToken, yr as asDesignSystemTemplateId, z as headerPositioningValues, zn as internalRouteOnlyLinkSchema, zr as refSlug, zt as defaultFooterPreferences } from "../sdk-event-upsert-BL6uAz53.mjs";
3
+ import { $ as parseFooterCompositionV1, $t as inferSiteDateLocale, B as exposeSecret, Bn as formatCurrencyAmount, Cn as publicEventPricingCurrency, Ct as trimmedStringOrNull, Dn as publicEventPricingType, En as publicEventPricingStrategy, Er as parseUserId, Et as buildBookingUtcDateWindow, F as orderedLiveRunSessions, G as parseMailingListSignedSourceToken, Gn as unsafeAsDemoCapability, Gt as formatBookingCutOffHours, H as slugify, Hn as assertNever, I as resolveWholeSeriesBookingPhase, Ir as err, Jt as formatDateRange, K as parseMailingListRuntimeContext, Kt as hasBookingClosed, L as resolveWholeSeriesPaymentDates, Ln as toNonNegativeCents, Lr as ok, M as CANCELLED_SESSION_STATUS, Mn as mapReadonlyNonEmptyArray, N as firstLiveRunSessionStartMs, Nt as getBookingInstalmentPlanIntervalCount, On as resolveExactOrFreePriceDisplay, P as nextLiveRunSessionStartMs, Pt as getBookingInstalmentProtectedDepositAmountCents, Qt as formatTimeRange, R as resolveWholeSeriesRunLifecycle, Rr as blockInteractionContextSchema, S as EVENT_PRESET_VALUES, Sn as isPublicEventPricingOptionDisplayable, T as WHOLE_SERIES_EVENT_PRESET_VALUES, Tn as publicEventPricingOptions, Tr as parseSiteId, Tt as selectCategoryView, U as parseMailingListBlockId, Un as formatDurationUnitLabel, Ut as bookingCutOffHoursBetween, V as parseManagementKey, Vt as deriveTotalTicketQuantity, W as parseMailingListContentVersionId, Wt as formatBookingClosedTime, X as DEFAULT_MAILING_LIST_PRIVACY_NOTE, Xn as parseSiteTermsVersionId, Xt as formatDateTimeRange, Yt as formatDateTime, Z as DEFAULT_MAILING_LIST_SUCCESS_MESSAGE, Zt as formatTime$1, _t as normalizeLocationAddressText, a as authoredValuesEqual, an as formatLocalScheduleTime, at as richTextHasText, b as resolveSiteVerticalBookingConfig, bn as formatBookingPriceDisplay, bt as publicLocationSchema, cn as getLocalScheduleTime, ct as parseWeeklyOpeningHours, d as formatCreditProductUnits, dn as parseLocalScheduleTime, en as resolveBookingDisplayContext, et as footerLayoutForLookId, fn as parseUtcIsoDateTimeString, ft as decideLocationSave, gn as toBookingTimeZone, gt as locationValueSchema, h as NAVIGATION_LOCATIONS, hn as resolveBookingTimeZoneId, ht as EVENT_ADDRESS_AFTER_BOOKING_LABEL, i as isRecord$27, in as formatLocalScheduleDate, it as isCanonicalRichTextDoc, kn as resolvePricingOptionsPriceDisplay, kr as parseEventSeriesId, l as creditProductUnitNoun, lr as unsafeAsPositiveByteCount, mn as resolveBookingBusinessTimeZone, mt as locationMapLinks, nt as DEFAULT_MAILING_LIST_TARGETING, on as getBookingLocalDateKey, ot as formatOpeningHoursRows, pn as toUtcIsoDateTimeString, pt as stableJsonStringify, q as assessMailingListTargeting, qt as formatDate, rn as compareLocalScheduleDates, rt as planMailingListChoicePresentation, sn as getLocalScheduleDate, sr as unsafeAsMediaAssetId, tn as toScheduledBookingDateTime, tt as parseMailingListPlacementTargeting, u as formatCreditProductPayment, un as parseBookingLocalDate, vn as parsePageSurfaceSubject, vt as parseLocationValue, wn as publicEventPricingDisplay, wr as parseApiKeyId, wt as mapDrawingSchema, xn as formatEventPricing, xt as toLocationCoordinates, yn as EVENT_PRESET_VOCABULARY, yt as projectPublicLocation, z as createSecret } from "../src-ClX_VLD6.mjs";
4
+ import { $ as walkLocalContentMedia, $n as extractApiErrorMessage, $r as publicVenueMapLocationSchema, $t as commandContexts, A as formatDiffSummary, An as isLocalConfigured, Ar as planSelectionCombinationPrices, At as navigationIdentityMap, B as formatFieldChange, Bn as DEFAULT_MEDIA_FIELD_KINDS, Br as flexibleBalanceDueDay, Bt as ACCOUNT_SITE_SEARCH_MAX_LENGTH, C as reportFromOutcomes, Cn as ErrorCodes, Cr as reviewedStay, Ct as listFiles, D as calculateDiff, Dr as roomSetupSchema, Dt as isMediaValue, E as createEmptySyncResult, En as CliExit, Er as roomOccupancySchema, Et as writeJsonFileAtomic, F as buildJsonDiff, Fn as cardListKnobBlocks, Fr as checkoutCopy, Ft as createBearerAccountApi, G as applyLocalMediaPush, Gn as MAX_REPEATER_GRID_COLUMNS, Gr as getStripeMinimumChargeRequirement, Gt as createPushConfigCommand, H as revalidateLocalMediaPushPlan, Hn as blockContentSourceSchema, Hr as repriceBookingCollectionOptions, Ht as navigationCommandItemToManagementInput, I as hasPageOperations, In as lookKnobBlocks, Ir as unsafeAsPositiveCheckoutQuantity, It as ACCOUNT_SITE_CURSOR_MAX_LENGTH, J as readStableBinaryFile, Jn as resolveRepeaterGridColumnFieldId, Jr as eventCalendarDefaultViewValues, Jt as revalidatePushConfigPlan, K as prepareLocalMediaForPush, Kn as isAcceptedRepeaterGridSpan, Kr as getBookingLaterInstalments, Kt as loadPushConfigTarget, L as pageMetadataForUpsert, Ln as NodeSchema, Lr as planCheckoutPaymentFlow, Lt as ACCOUNT_SITE_LIST_LIMIT_DEFAULT, M as findChangedFieldsWithValues, Mn as loadSdkEnvironment, Mr as placementProblemText, Mt as convertPulledNavigationToLocal, N as formatHumanDiff, Nn as cardListBlockParts, Nr as stayLineText, Nt as convertPulledPagesToLocal, O as calculateFooterDiff, On as getEnvPrefix, Or as sharedRoomArrangementSchema, Ot as duplicateNavigationIdentityMessage, P as calculatePullDiff, Pn as cardListFamilyBlocks, Pr as stayNoteText, Pt as AccountApiMalformedResponseError, Q as normalizeMediaValueToIdentifierOnly, Qn as ManagementApiError, Qr as publicMapLocationResultSchema, Qt as CommandFailure, Rn as NodeTreeSchema, Rr as planFlexibleBalanceCreditFirst, Rt as ACCOUNT_SITE_LIST_LIMIT_MAX, S as planCliCommandBatchForBindings, Sn as withRiverbankEnv, Sr as placeBooking, St as fileExists, T as executeResidualSettingsSyncPlan, Tn as transportSuggestion, Tr as roomChoicesSchema, Tt as writeJsonFile, Un as blockRequiredFeatureSchema, Ur as resolveAvailableBookingCollectionOptions, Ut as normalizeNavigationConfigItemForCommand, V as formatFieldPath, Vn as blockCategoryEnum, Vr as isBookingCollectionEquivalentToUpfront, Vt as ACCOUNT_SITE_TITLE_MAX_LENGTH, W as syncLocalMediaForPull, Wn as fieldSchema$1, Wr as resolveBookingCollectionOptionFacts, Wt as applyPushConfigPlan, X as sha256, Xn as resolveRepeaterGridSpanFieldId, Xr as eventCalendarListLayoutCompatibleDisplayModeValues, Xt as deriveCmsApiUrlFromDashboardUrl, Y as writeBinaryFileAtomic, Yn as resolveRepeaterGridRowFieldId, Yr as eventCalendarDisplayModeValues, Yt as createBearerAPIClient, Z as normalizeMediaIdentifierInput, Zn as visibilityLevels, Zr as eventCalendarListLayoutValues, Zt as mapEnvironmentExecutionOutcomesJson, _ as commandExecutionToReport, _n as executeEnvironmentPlan, _r as placesLeftText, _t as metadataTargetFromEnvironment, a as executeEntryCommandPlanAsReport, ai as CALENDAR_SSR_PAGE_SIZE, an as confirmAction, ar as linkPayloadSchema, at as readAllMeta, b as executeCompiledCliCommandPlanAsReport, bn as planEnvironmentWriteAuthorization, br as sameRoomOption, bt as writeMetadataRecordMap, c as titleFromEntryData, ci as calendarSourceCursorSchema, cn as formatDateShort, cr as pageDesignIntentSchemaVersion, ct as readFooterMeta, d as unsafeAsCliEntryIdentifier, di as eventSurfaceScopeValues, dn as managementClientFor, dr as areEventBookingRequirementsIdentical, dt as readPagesMeta, ei as publicMembershipProductSchema, en as defineCommand, er as normalizeApiError, et as buildStorageUrl, f as unsafeAsCliFormSlug, fi as monthNumber, fn as mapEntryForOutput, fr as eventBookingConsentContentKey, ft as readSettingsMeta, g as commandCompileFailureToReport, gi as unwrapResponse, gn as runWithInvocation, gr as checkoutStatusArms, gt as metadataFilePath, h as mutationCounterForEffect, hi as ApiEnvelopeError, hn as resolveCommandPath, hr as resolveSelectionAttendanceMode, ht as ensureMetadataDir, i as entrySiteCommandTypes, ii as purchasablePublicPassProductSchema, in as bindRequestTimeout, ir as sdkSettingsUpdateSchema, it as readEntries, j as hasPendingChanges, jn as isRemoteConfigured, jr as eventRegistrationErrors, jt as convertPulledFooterToLocal, k as formatDiffDetail, kn as getEnvironmentDebugInfo, kr as nextCombinationHint, kt as navigationIdentity, l as unsafeAsCliBlockIdentifier, li as eventScheduleScopeValues, ln as handleCommandError, lr as sdkConfiguredBookingVerticalConfigSchema, lt as readFormsMeta, m as commandReportToSyncResult, mi as publicEventLoaderQuerySchemaShape, mn as parseJsonData, mr as decideSelectionAttendance, mt as writeMediaManifest, n as entryCommandCompileErrorToReport, ni as publicProductSchema, nn as registerCommand, nr as ApiRequestError, nt as extractMediaIdentifiers, o as executeEntryCommandPlanAsSyncResult, oi as calendarMonthDate, on as createOutputForCommand, or as portablePageDesignSchema, ot as readEventCategoriesMeta, p as unsafeAsCliPageIdentifier, pi as normalizeCalendarFilterId, pn as parseJsonArray, pr as INCOMPATIBLE_ATTENDANCE_MESSAGE, pt as readVenuesMeta, q as admitBinaryWriteDestination, qn as parseRepeaterGridInteger, qr as MAX_EVENT_BOOKING_SELECTION_ITEMS, qt as preparePushConfigTarget, r as entryCommandReportToSyncResult, ri as purchasablePublicMembershipProductSchema, rn as renderedByOwner, rr as sdkEventScheduleSchema, rt as findLegacyEntryFiles, s as syncResultForEntryCommandCompileError, si as calendarMonthWindowSchema, sn as currentInvocationEnvelope, sr as pageDesignDecisionsV2Schema, st as readEventsMeta, t as compileEntryPushCommands, ti as publicPassProductSchema, tn as defineCommandGroup, tr as isRecord$2, tt as downloadMedia, u as unsafeAsCliContentTypeKey, ui as eventSurfacePresetValues, un as loadManagementTarget, ur as API_ENDPOINTS, ut as readNavigationMeta, v as commandReportHasFailures, vn as parseEnvironmentSelection, vr as roomKindOptions, vt as readMetadataFile, w as mergeManySyncResults, wn as formatError, wr as reviewedRoomsSchema, wt as readJsonFile, x as formatManagementError, xn as requireEnvironmentWriteAuthorization, xr as countSoFar, xt as ensureDir, y as executeCliCommandPlan, yn as planEnvironmentExecution, yr as roomsOfferSharing, yt as writeMetadataFile, z as buildFieldChanges, zn as bindingSchema, zr as bookingCollectionDatesOpen, zt as ACCOUNT_SITE_LIST_LIMIT_MIN } from "../entryCommands-CXGj-eca.mjs";
5
+ import { r as CLI_VERSION, t as loadConfigFile } from "../load-config-Bhh-kYhx.mjs";
6
+ import { t as eventUpsertInputSchema } from "../eventUpsertInputSchema-DZdxyRB6.mjs";
7
+ import { a as prepareScaffoldExecution, c as LOCAL_PACKAGE_VENDOR_DIR, d as loadGeneratedPackageRanges, i as preflightScaffoldTargets, n as createScaffoldCompletion, s as deriveScaffoldLocalManifest, t as deriveScaffoldPlan } from "../plan-FPq8qKNu.mjs";
8
8
  import { config } from "dotenv";
9
9
  import { z } from "zod";
10
10
  import { Command, CommanderError } from "commander";
@@ -13660,6 +13660,24 @@ const blockAppearancePresets = [
13660
13660
  },
13661
13661
  styleFallback: [id$1("media-text-photo-beside-text")]
13662
13662
  }),
13663
+ defineArrangementLook("media-text-quote-beside-circle", "media-text", "Quote beside a round photo", "circle-beside", ["imagePosition"], {
13664
+ mediaFrame: { default: {
13665
+ kind: "fixed",
13666
+ aspectRatio: "1/1",
13667
+ borderRadius: "50%"
13668
+ } },
13669
+ thumbnail: sketch.page([sketch.middle([sketch.photo("medium", "circle")], [
13670
+ sketch.title(.6),
13671
+ sketch.quote("small"),
13672
+ sketch.text(2),
13673
+ sketch.text(1, .5)
13674
+ ])]),
13675
+ forcedKnobs: {
13676
+ imageShape: "circle",
13677
+ aspectRatio: "1/1"
13678
+ },
13679
+ styleFallback: [id$1("media-text-circle-beside-text"), id$1("media-text-photo-beside-text")]
13680
+ }),
13663
13681
  defineArrangementLook("hero-photo-beside-text", "hero", "Photo beside the text", "split", heroKnobs, {
13664
13682
  photoUse: "beside",
13665
13683
  thumbnail: sketch.page([sketch.middle([
@@ -14391,6 +14409,24 @@ const blockAppearancePresets = [
14391
14409
  }),
14392
14410
  blockKinds: ["block.team-members"]
14393
14411
  },
14412
+ {
14413
+ ...defineCardListLook("team-members-person-rows", "One person per row, with facts", "stack", [
14414
+ "media",
14415
+ "title",
14416
+ "text",
14417
+ "facts"
14418
+ ], ["showPhotos"], {
14419
+ thumbnail: sketch.page([sketch.down(2, [sketch.row(sketch.weight(2, [sketch.photo("medium", "circle"), sketch.card([sketch.text(3, .7)])]), sketch.weight(3, [
14420
+ sketch.title(.4, "small"),
14421
+ sketch.title(.6),
14422
+ sketch.text(4)
14423
+ ]))])]),
14424
+ teamBiography: "profile",
14425
+ teamFacts: "person",
14426
+ styleFallback: [id$1("team-members-portrait-bio")]
14427
+ }),
14428
+ blockKinds: ["block.team-members"]
14429
+ },
14394
14430
  {
14395
14431
  ...defineCardListLook("team-members-ruled-names", "Names in a ruled list", "index", [
14396
14432
  "title",
@@ -32829,6 +32865,11 @@ const loomLooks = {
32829
32865
  treatment: "team-ruled-names",
32830
32866
  roleMap: loomRoles
32831
32867
  },
32868
+ {
32869
+ id: id("team-members-person-rows"),
32870
+ treatment: "team-person",
32871
+ roleMap: loomRoles
32872
+ },
32832
32873
  {
32833
32874
  id: id("shop-price-cards"),
32834
32875
  treatment: "shop-price-cards",
@@ -32884,6 +32925,11 @@ const poiseOffers = [
32884
32925
  roleMap: poiseRoles,
32885
32926
  itemRoles: { items: "card" }
32886
32927
  },
32928
+ {
32929
+ id: id("team-members-person-rows"),
32930
+ treatment: "team-person",
32931
+ roleMap: poiseRoles
32932
+ },
32887
32933
  {
32888
32934
  id: id("shop-price-cards-featured"),
32889
32935
  treatment: "prices-featured",
@@ -33325,6 +33371,11 @@ const havenOffers = [
33325
33371
  roleMap: havenRoles,
33326
33372
  itemRoles: { container: "card" }
33327
33373
  },
33374
+ {
33375
+ id: id("team-members-person-rows"),
33376
+ treatment: "team-person",
33377
+ roleMap: havenRoles
33378
+ },
33328
33379
  {
33329
33380
  id: id("shop-price-cards-featured"),
33330
33381
  treatment: "prices-featured",
@@ -33846,6 +33897,11 @@ const brookOffers = [
33846
33897
  treatment: "team-names",
33847
33898
  roleMap: brookRoles
33848
33899
  },
33900
+ {
33901
+ id: id("team-members-person-rows"),
33902
+ treatment: "team-person",
33903
+ roleMap: brookRoles
33904
+ },
33849
33905
  {
33850
33906
  id: id("shop-price-cards"),
33851
33907
  treatment: "prices",
@@ -34460,6 +34516,11 @@ const orbitOffers = [
34460
34516
  treatment: "media-circle",
34461
34517
  roleMap: orbitRoles
34462
34518
  },
34519
+ {
34520
+ id: id("media-text-quote-beside-circle"),
34521
+ treatment: "media-quote",
34522
+ roleMap: orbitRoles
34523
+ },
34463
34524
  {
34464
34525
  id: id("media-text-photo-beside-text"),
34465
34526
  treatment: "media-beside",
@@ -34480,6 +34541,12 @@ const orbitOffers = [
34480
34541
  treatment: "team-names",
34481
34542
  roleMap: orbitRoles
34482
34543
  },
34544
+ {
34545
+ id: id("team-members-person-rows"),
34546
+ treatment: "team-person",
34547
+ slotRoles: { facts: "card" },
34548
+ roleMap: orbitRoles
34549
+ },
34483
34550
  {
34484
34551
  id: id("shop-price-cards"),
34485
34552
  treatment: "prices",
@@ -34705,6 +34772,21 @@ const orbitOffers = [
34705
34772
  treatment: "faq-open",
34706
34773
  roleMap: orbitRoles
34707
34774
  },
34775
+ {
34776
+ id: id("list-ticked-points"),
34777
+ treatment: "list-ticks",
34778
+ roleMap: orbitRoles
34779
+ },
34780
+ {
34781
+ id: id("list-two-columns"),
34782
+ treatment: "list-columns",
34783
+ roleMap: orbitRoles
34784
+ },
34785
+ {
34786
+ id: id("list-headed-cards"),
34787
+ treatment: "list-cards",
34788
+ roleMap: orbitRoles
34789
+ },
34708
34790
  {
34709
34791
  id: id("cta-text-in-panel"),
34710
34792
  treatment: "cta-panel",
@@ -37672,7 +37754,10 @@ const curatedSiteStyles = [
37672
37754
  defineCuratedSiteStyle({
37673
37755
  id: "site-style:orbit",
37674
37756
  name: "Orbit",
37675
- offering: { kind: "lab" },
37757
+ offering: {
37758
+ kind: "client",
37759
+ siteSlugs: ["danu"]
37760
+ },
37676
37761
  description: "Round photos with a ring around them, three dots above each heading, white rounded cards and pill buttons, with arcs where your bands of colour begin and end. For dance schools, movement classes and community studios.",
37677
37762
  generationBrief: "Use warm, lively words in sentence case for the text, and keep headings short, because they are set in capitals. Say plainly who a class is for and that beginners are welcome, give real times, prices and places, and avoid fitness slogans and promises about results.",
37678
37763
  headingDecoration: noHeadingDecoration,
@@ -37826,6 +37911,11 @@ function withTeamLooks(looks, roleMap) {
37826
37911
  treatment: "team-names",
37827
37912
  roleMap
37828
37913
  },
37914
+ {
37915
+ id: id("team-members-person-rows"),
37916
+ treatment: "team-person",
37917
+ roleMap
37918
+ },
37829
37919
  ...looks.offers
37830
37920
  ]
37831
37921
  };
@@ -49800,6 +49890,13 @@ const opaquePanels = [
49800
49890
  token: "surface"
49801
49891
  }
49802
49892
  },
49893
+ {
49894
+ selector: ":where([data-block='event-registration']) .er-room-photos",
49895
+ paint: {
49896
+ kind: "solid",
49897
+ token: "surface"
49898
+ }
49899
+ },
49803
49900
  {
49804
49901
  selector: ":where([data-block='event-calendar']) .event-agenda-card",
49805
49902
  paint: {
@@ -67851,7 +67948,6 @@ const publicEventDestinationSchema = z.discriminatedUnion("kind", [z.object({
67851
67948
  const eventVenueSchema = z.object({
67852
67949
  area: z.string().nullable().optional(),
67853
67950
  addressWithBooking: z.boolean().optional(),
67854
- drawing: z.lazy(() => mapDrawingSchema).optional().catch(undefined),
67855
67951
  id: z.string(),
67856
67952
  name: z.string(),
67857
67953
  address: z.string().nullable(),
@@ -68037,6 +68133,34 @@ const publicWholeSeriesRunSchema = z.object({
68037
68133
  /**
68038
68134
  * Zod schema for the fields shared by both booking scopes.
68039
68135
  */
68136
+ /** An event's rooms as placement reads them. Nothing here says who has booked. */
68137
+ const publicEventRoomsSchema = z.object({
68138
+ seriesId: z.string(),
68139
+ arrangement: sharedRoomArrangementSchema,
68140
+ kinds: z.array(z.object({
68141
+ id: z.string(),
68142
+ name: z.string(),
68143
+ sleeps: z.number().int().positive(),
68144
+ description: z.string(),
68145
+ photos: z.array(z.object({
68146
+ src: z.string(),
68147
+ alt: z.string()
68148
+ })),
68149
+ prices: z.array(z.object({
68150
+ pricingOptionId: z.string(),
68151
+ peopleInRoom: z.number().int().positive().nullable(),
68152
+ priceName: z.string()
68153
+ }))
68154
+ })),
68155
+ rooms: z.array(z.object({
68156
+ id: z.string(),
68157
+ kindId: z.string(),
68158
+ setup: roomSetupSchema,
68159
+ occupancy: roomOccupancySchema,
68160
+ freePlaces: z.number().int().nonnegative()
68161
+ })),
68162
+ linkedOptionIds: z.array(z.string())
68163
+ });
68040
68164
  const publicEventBaseSchema = z.object({
68041
68165
  eventPreset: eventPresetSchema.optional(),
68042
68166
  eventDestinationMode: eventDestinationModeSchema.optional(),
@@ -68114,7 +68238,8 @@ const publicEventBaseSchema = z.object({
68114
68238
  acceptsPasses: z.boolean(),
68115
68239
  acceptsMemberships: z.boolean(),
68116
68240
  allowsMultipleBooking: z.boolean().default(false),
68117
- combinationPrices: z.array(combinationOfferSchema).default([])
68241
+ combinationPrices: z.array(combinationOfferSchema).default([]),
68242
+ rooms: publicEventRoomsSchema.optional()
68118
68243
  });
68119
68244
  /**
68120
68245
  * Zod schema for public event data.
@@ -68215,27 +68340,21 @@ function formatEventStartingPrice(pricing) {
68215
68340
  }
68216
68341
  }
68217
68342
  /**
68218
- * A short note on booking with a deposit, said next to the price so the
68219
- * option isn't first seen at checkout: "or a £40 deposit to book", or "with a
68220
- * £40 deposit to book" when paying in full isn't offered. Null when no option
68221
- * starts with a deposit (equal instalments have none).
68343
+ * A short note on how booking is paid, said next to the price so it isn't
68344
+ * first seen at checkout: "or a £40 deposit to book", or "with a £40 deposit
68345
+ * to book" when paying in full isn't offered, with the balance's due day when
68346
+ * there is one. Once it's too late for the deposit the event offers, "paid in
68347
+ * full when you book". Null when the event never offers a deposit.
68222
68348
  */
68223
- function formatEventDepositNote(pricing, paymentTerms, start) {
68224
- const currency = publicEventPricingCurrency(pricing);
68225
- if (!currency) return null;
68226
- const deposit = paymentTerms.allowedOptions.map((option) => {
68227
- switch (option.kind) {
68228
- case "flexible_balance": return option.config.upfrontAmountCents;
68229
- case "instalment_plan": return getBookingInstalmentProtectedDepositAmountCents(option.plan);
68230
- case "upfront":
68231
- case "deferred_manual": return null;
68232
- }
68233
- }).find((amount) => amount !== null && amount > 0);
68234
- if (deposit === undefined) return null;
68235
- const payInFull = paymentTerms.allowedOptions.some((option) => option.kind === "upfront");
68236
- const flexible = paymentTerms.allowedOptions.find((option) => option.kind === "flexible_balance");
68237
- const dueBy = flexible && start ? `, the rest due by ${formatDueDay(flexibleBalanceDueDay(flexible.config, start.startsAt, start.timeZone))}` : "";
68238
- return `${payInFull ? "or" : "with"} a ${formatEventPriceAmount(deposit, currency)} deposit to book${dueBy}`;
68349
+ function formatEventDepositNote(offer) {
68350
+ switch (offer.kind) {
68351
+ case "none": return null;
68352
+ case "paid_in_full": return "paid in full when you book";
68353
+ case "deposit": {
68354
+ const dueBy = offer.balanceDueDay ? `, the rest due by ${formatDueDay(offer.balanceDueDay)}` : "";
68355
+ return `${offer.payInFullOffered ? "or" : "with"} a ${formatEventPriceAmount(offer.amountCents, offer.currency)} deposit to book${dueBy}`;
68356
+ }
68357
+ }
68239
68358
  }
68240
68359
  /** A calendar day ("2026-11-12") as "12 Nov 2026"; it has no time zone to convert. */
68241
68360
  function formatDueDay(day) {
@@ -77770,9 +77889,11 @@ const carouselCardsLayout = (arrangement) => arrangementCardsLayout(el("carousel
77770
77889
  }]
77771
77890
  }]));
77772
77891
  const leadSupportLayout = arrangementCardsLayout(el("div", lookSlot("items"), [leadCard]));
77892
+ const comingUpCardHook = { "data-has-coming-up": { $bind: { from: "card.comingUp" } } };
77773
77893
  const indexRow = el("li", {
77774
77894
  ...lookSlot("item"),
77775
- ...featuredCardHook
77895
+ ...featuredCardHook,
77896
+ ...comingUpCardHook
77776
77897
  }, [
77777
77898
  el("div", {
77778
77899
  ...lookSlot("numeral"),
@@ -77907,6 +78028,21 @@ const featureCardsConfig = {
77907
78028
  }
77908
78029
  }
77909
78030
  },
78031
+ {
78032
+ id: "comingUp",
78033
+ type: "boolean",
78034
+ label: "Coming up",
78035
+ description: "For something that hasn't happened yet. On a timeline, these come after a Now marker and are drawn in outline.",
78036
+ required: false,
78037
+ defaultValue: false,
78038
+ ui: {
78039
+ intent: "content",
78040
+ visibleWhen: {
78041
+ field: "$root.blockLook",
78042
+ equals: "feature-cards-timeline"
78043
+ }
78044
+ }
78045
+ },
77910
78046
  {
77911
78047
  id: "label",
77912
78048
  type: "text",
@@ -79799,24 +79935,6 @@ function hasEventBookingClosedEarly(event, now) {
79799
79935
 
79800
79936
  //#endregion
79801
79937
  //#region ../blocks/src/system/blocks/events/shared/pageSelection.ts
79802
- /**
79803
- * What a system-managed Event URL actually selected.
79804
- *
79805
- * The resolver used to assume that one returned `PublicEvent` meant one
79806
- * occurrence. A whole-series Event breaks that assumption in two directions: a
79807
- * parent Event path selects nothing concrete until a run is chosen, and a run
79808
- * path selects a run whose identity spans every one of its sessions. This
79809
- * module parses those cases once, so the renderer switches over a closed set of
79810
- * page states instead of probing booking scopes at render time.
79811
- *
79812
- * Everything here is pure. Loading events and resolving run slugs is the
79813
- * resolver's job; deciding what the page is and which runs the chooser
79814
- * advertises happens here. When a run is open to join, and where it sits in its
79815
- * own life, come from `@riverbankcms/core`: the same authority the
79816
- * public read projection and the write-side run-facts loader use, so a run
79817
- * cannot report itself open on the storefront and closed at the point of
79818
- * booking.
79819
- */
79820
79938
  function planWholeSeriesParentBooking(eligibleRuns) {
79821
79939
  const [first, second, ...rest] = eligibleRuns;
79822
79940
  if (!second) return {
@@ -80888,6 +81006,102 @@ function formatEventTeacherLine(event) {
80888
81006
  return names$1 ? `with ${names$1}` : null;
80889
81007
  }
80890
81008
 
81009
+ //#endregion
81010
+ //#region ../blocks/src/system/runtime/nodes/events/domain/depositOffer.ts
81011
+ const NO_DEPOSIT = { kind: "none" };
81012
+ /**
81013
+ * True when the terms offer a deposit and every deposit option has run out of
81014
+ * time for these dates (commerce's `bookingCollectionDatesOpen`): a flexible balance whose due day has passed (in the
81015
+ * site's time zone), or an instalment plan that can no longer finish before
81016
+ * its deadline (a course's last session when it says so). Dates only: whether
81017
+ * a total can take a deposit is the commerce resolver's decision, not this one.
81018
+ */
81019
+ function depositDeadlinesPassed(paymentTerms, dates) {
81020
+ const deposits = depositOptions(paymentTerms);
81021
+ return deposits.length > 0 && deposits.every((option) => !bookingCollectionDatesOpen(option, dates));
81022
+ }
81023
+ /** Whether the terms include an option that starts with a deposit. */
81024
+ function termsOfferDeposit(paymentTerms) {
81025
+ return depositOptions(paymentTerms).length > 0;
81026
+ }
81027
+ /**
81028
+ * The event page's deposit note for an event, decided on dates and the prices
81029
+ * shown. A course's dates come from its live sessions, as the server reads
81030
+ * them for the booking panel; a single date starts when it starts.
81031
+ */
81032
+ function resolvePublicEventDepositOffer(event, input) {
81033
+ const prices = paidPriceSpan(event.pricing);
81034
+ const terms = event.paymentTerms;
81035
+ const payInFullOffered = terms.allowedOptions.some((option) => option.kind === "upfront");
81036
+ const applies = (option) => prices !== null && (depositCents(option) ?? Infinity) < (payInFullOffered ? prices.highestCents : prices.lowestCents);
81037
+ const deposits = depositOptions(terms).filter(applies);
81038
+ if (!prices || deposits.length === 0) return NO_DEPOSIT;
81039
+ const dates = {
81040
+ ...input.sessions ? resolveWholeSeriesPaymentDates({
81041
+ sessions: input.sessions,
81042
+ paymentTerms: terms
81043
+ }) : { bookingStartAt: event.startsAt },
81044
+ timeZone: event.siteTimeZone,
81045
+ nowIso: input.nowIso
81046
+ };
81047
+ const open$1 = deposits.find((option) => bookingCollectionDatesOpen(option, dates));
81048
+ if (!open$1) {
81049
+ return terms.allowedOptions.some((option) => option.kind === "deferred_manual") ? NO_DEPOSIT : { kind: "paid_in_full" };
81050
+ }
81051
+ return {
81052
+ kind: "deposit",
81053
+ amountCents: depositCents(open$1) ?? 0,
81054
+ currency: prices.currency,
81055
+ payInFullOffered,
81056
+ balanceDueDay: open$1.kind === "flexible_balance" && dates.bookingStartAt ? flexibleBalanceDueDay(open$1.config, dates.bookingStartAt, dates.timeZone) : null
81057
+ };
81058
+ }
81059
+ const DEPOSIT_KINDS = new Set(["flexible_balance", "instalment_plan"]);
81060
+ /**
81061
+ * The payment step's sentence when the visitor's booking is paid in full
81062
+ * although the terms offer a deposit, perhaps advertised on a cached page.
81063
+ * `offeredKinds` are the ways to pay the step shows (the live, repriced
81064
+ * decision); `dates.nowIso` should be a live clock. Too late when the
81065
+ * deposit's dates have passed; otherwise it went for an amount reason, which
81066
+ * isn't the visitor's to fix, so the sentence only says how it's paid.
81067
+ */
81068
+ function paidInFullNote(input) {
81069
+ if (!termsOfferDeposit(input.paymentTerms) || input.offeredKinds.length === 0) return null;
81070
+ if (input.offeredKinds.some((kind) => DEPOSIT_KINDS.has(kind) || kind === "deferred_manual")) return null;
81071
+ return depositDeadlinesPassed(input.paymentTerms, input.dates) ? "It’s too close to the date for a deposit, so this is paid in full now." : "This booking is paid in full when you book.";
81072
+ }
81073
+ function depositOptions(paymentTerms) {
81074
+ return paymentTerms.allowedOptions.filter((option) => depositCents(option) !== null);
81075
+ }
81076
+ /** A deposit is an amount taken up front that's less than the whole; equal instalments have none. */
81077
+ function depositCents(option) {
81078
+ switch (option.kind) {
81079
+ case "flexible_balance": return positive(option.config.upfrontAmountCents);
81080
+ case "instalment_plan": return positive(getBookingInstalmentProtectedDepositAmountCents(option.plan));
81081
+ case "upfront":
81082
+ case "deferred_manual": return null;
81083
+ }
81084
+ }
81085
+ const positive = (amount) => amount !== null && amount > 0 ? amount : null;
81086
+ /** The cheapest and dearest paid place shown; null when nothing shown is paid. */
81087
+ function paidPriceSpan(pricing) {
81088
+ const display = publicEventPricingDisplay(pricing);
81089
+ const span = (lowestCents, highestCents) => highestCents > 0 ? {
81090
+ lowestCents: Math.max(lowestCents, 0),
81091
+ highestCents,
81092
+ currency: "currency" in display ? display.currency : ""
81093
+ } : null;
81094
+ switch (display.kind) {
81095
+ case "exact": return span(display.amount, display.amount);
81096
+ case "from": return span(display.amount, Infinity);
81097
+ case "range": return span(display.minAmount, display.maxAmount);
81098
+ case "mixed": return span(display.paidFromAmount, display.paidToAmount);
81099
+ case "free":
81100
+ case "unavailable":
81101
+ case "external": return null;
81102
+ }
81103
+ }
81104
+
80891
81105
  //#endregion
80892
81106
  //#region ../blocks/src/system/runtime/nodes/events/domain/quickDates.ts
80893
81107
  const QUICK_EVENT_DATE_LIMIT = 4;
@@ -81450,6 +81664,19 @@ function decideBookingQuestionsRestoration(source) {
81450
81664
  answerMode: draft.answerMode
81451
81665
  });
81452
81666
  }
81667
+ if (source.kind === "tab_draft") {
81668
+ const { draft, identity } = source;
81669
+ const answers = tabDraftAnswersStillAsked(draft, source.current);
81670
+ if (Object.keys(answers).length === 0) return null;
81671
+ return decided({
81672
+ scope: {
81673
+ identity,
81674
+ requirementId: draft.requirementId
81675
+ },
81676
+ edits: answers,
81677
+ answerMode: "answers"
81678
+ });
81679
+ }
81453
81680
  const { snapshot: snapshot$1, currentIdentity } = source;
81454
81681
  if (!isBookingQuestionsOwner(snapshot$1.owner, currentIdentity)) return null;
81455
81682
  const scope = {
@@ -81479,6 +81706,64 @@ function restoreBookingQuestionsAnswers(state, restoration) {
81479
81706
  answerMode: restoration.answerMode
81480
81707
  };
81481
81708
  }
81709
+ const scalarQuestionTypes = [
81710
+ "text",
81711
+ "email",
81712
+ "textarea",
81713
+ "select",
81714
+ "radio",
81715
+ "checkbox",
81716
+ "tel",
81717
+ "url",
81718
+ "number",
81719
+ "date",
81720
+ "time"
81721
+ ];
81722
+ const plainAnswerSchema = z.union([
81723
+ z.string(),
81724
+ z.number(),
81725
+ z.boolean(),
81726
+ z.null(),
81727
+ z.array(z.string())
81728
+ ]);
81729
+ const bookingQuestionsTabDraftSchema = z.object({
81730
+ requirementId: z.string().min(1),
81731
+ answers: z.record(z.string(), z.object({
81732
+ type: z.enum(scalarQuestionTypes),
81733
+ value: plainAnswerSchema
81734
+ }))
81735
+ });
81736
+ function questionSet(presentation$1) {
81737
+ return presentation$1.kind === "none" || presentation$1.kind === "unavailable" ? null : presentation$1.set;
81738
+ }
81739
+ function scalarQuestions(presentation$1) {
81740
+ const set = questionSet(presentation$1);
81741
+ return new Map((set?.sections ?? []).flatMap((section$2) => section$2.items).flatMap((item) => item.type === "document_upload" ? [] : [[item.id, item.type]]));
81742
+ }
81743
+ /** The booker's own answers to the set they were shown, to keep in this tab; null when there's nothing to keep. */
81744
+ function toBookingQuestionsTabDraft(state, shown) {
81745
+ const requirementId = bookingQuestionsRequirementId(shown);
81746
+ if (!state.scope || requirementId === null || state.scope.requirementId !== requirementId || state.answerMode === "keep_existing") return null;
81747
+ const types = scalarQuestions(shown);
81748
+ const answers = Object.fromEntries(Object.entries(state.edits).flatMap(([id$2, value]) => {
81749
+ const type = types.get(id$2);
81750
+ const plain$1 = plainAnswerSchema.safeParse(value);
81751
+ return type && plain$1.success ? [[id$2, {
81752
+ type,
81753
+ value: plain$1.data
81754
+ }]] : [];
81755
+ }));
81756
+ return Object.keys(answers).length > 0 ? {
81757
+ requirementId,
81758
+ answers
81759
+ } : null;
81760
+ }
81761
+ /** Kept answers whose question is still asked, as the same kind of question, in the same set. */
81762
+ function tabDraftAnswersStillAsked(draft, current) {
81763
+ if (bookingQuestionsRequirementId(current) !== draft.requirementId) return {};
81764
+ const types = scalarQuestions(current);
81765
+ return Object.fromEntries(Object.entries(draft.answers).filter(([id$2, answer]) => types.get(id$2) === answer.type).map(([id$2, answer]) => [id$2, answer.value]));
81766
+ }
81482
81767
 
81483
81768
  //#endregion
81484
81769
  //#region ../blocks/src/system/runtime/shared/signInReturnDrafts.ts
@@ -81783,15 +82068,6 @@ function getRegistrationOccurrenceId(target) {
81783
82068
  function shouldLoadRegistrationOptions(authState, step) {
81784
82069
  return authState === "authenticated" || step === "select-tickets" || step === "enter-details" || step === "select-payment";
81785
82070
  }
81786
- function getEligibilityFlowFlags(input) {
81787
- const hasPass = (input.eligibility?.eligiblePasses.length ?? 0) > 0;
81788
- const hasMembership = (input.eligibility?.eligibleMemberships.length ?? 0) > 0;
81789
- return {
81790
- hasEligibility: hasPass || hasMembership,
81791
- hasMembershipEligibility: hasMembership,
81792
- isMembershipFastTrack: input.portalAuthState === "authenticated" && hasMembership && input.ticketsCount === 1 && input.paymentMethod === "membership"
81793
- };
81794
- }
81795
82071
  /** Prefer refreshed capacity, including a known zero; fall back while options load. */
81796
82072
  function getTicketSelectionRemainingPlaces(input) {
81797
82073
  const availability = input.eligibility?.availability;
@@ -81824,7 +82100,7 @@ function resolveHeldTicketPlaces(current, invitation, paymentHold) {
81824
82100
  const held = invitation.kind === "ready" ? {
81825
82101
  selectionId: invitation.restoration.event?.selectionId ?? current.selectionId,
81826
82102
  attendanceMode: invitation.restoration.attendanceMode,
81827
- lines: invitation.restoration.ticketSelections
82103
+ lines: invitation.restoration.claimed.kind === "reservedTickets" ? invitation.restoration.claimed.ticketSelections : []
81828
82104
  } : paymentHold;
81829
82105
  return getHeldPlacesBySelection(current, held);
81830
82106
  }
@@ -82302,9 +82578,20 @@ function consumeSearchParams(paramNames) {
82302
82578
  return values;
82303
82579
  }
82304
82580
 
82581
+ //#endregion
82582
+ //#region ../blocks/src/system/runtime/shared/utils/email.ts
82583
+ /**
82584
+ * The public booking, checkout and discount endpoints check addresses with
82585
+ * zod's email rule, so the forms use the same one: an address a form accepts
82586
+ * is never refused later, after the visitor has moved on.
82587
+ */
82588
+ const emailAddressSchema = z.string().trim().email().max(320);
82589
+ function isEmailAddress(value) {
82590
+ return emailAddressSchema.safeParse(value).success;
82591
+ }
82592
+
82305
82593
  //#endregion
82306
82594
  //#region ../blocks/src/system/runtime/shared/utils/validation.ts
82307
- const EMAIL_REGEX = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
82308
82595
  /**
82309
82596
  * Validate registration form data.
82310
82597
  *
@@ -82321,7 +82608,7 @@ function validateFormData$1(data) {
82321
82608
  }
82322
82609
  if (!data.email.trim()) {
82323
82610
  errors.email = "Email is required";
82324
- } else if (!EMAIL_REGEX.test(data.email.trim())) {
82611
+ } else if (!isEmailAddress(data.email)) {
82325
82612
  errors.email = "Please enter a valid email";
82326
82613
  }
82327
82614
  return errors;
@@ -83965,6 +84252,13 @@ const BOOKING_DATE_PRESENTATIONS = {
83965
84252
  year: "omit"
83966
84253
  }
83967
84254
  },
84255
+ dayMonth: {
84256
+ kind: "date",
84257
+ options: {
84258
+ date: "short",
84259
+ year: "omit"
84260
+ }
84261
+ },
83968
84262
  dayLong: {
83969
84263
  kind: "date",
83970
84264
  options: {
@@ -84104,48 +84398,13 @@ function scheduleInput(event, occurrence) {
84104
84398
  deliveryMode: event.deliveryMode
84105
84399
  };
84106
84400
  }
84107
- /** Tooltip text shown when pass/membership redemptions are unavailable for multi-ticket bookings. */
84108
- const ENTITLEMENT_SINGLE_TICKET_TOOLTIP = "Only available for single-ticket bookings";
84109
- /** Passes and memberships can only be redeemed for single-ticket registrations. */
84110
- function areEntitlementsDisabledForTicketCount(ticketsCount) {
84111
- return ticketsCount > 1;
84112
- }
84113
- /**
84114
- * Describe what redeeming a pass costs the customer.
84115
- *
84116
- * The balance is what they hold *before* this booking, so "1 of 5" means four
84117
- * are left afterwards. Spelling out the balance is what stops people missing
84118
- * that a credit is being spent at all.
84119
- *
84120
- * Always one credit: passes are only redeemable for single-ticket bookings,
84121
- * per {@link areEntitlementsDisabledForTicketCount}.
84122
- *
84123
- * @param creditsRemaining - Credits on the pass before this booking, if known
84124
- */
84125
- function formatPassCreditUsageLabel(creditsRemaining) {
84126
- if (typeof creditsRemaining !== "number" || creditsRemaining <= 0) {
84127
- return `Uses ${formatCreditProductUnits("event_pass", 1)} from your pass`;
84128
- }
84129
- if (creditsRemaining === 1) {
84130
- return `Uses your last ${creditProductUnitNoun("event_pass", 1)}`;
84131
- }
84132
- return `Uses 1 of your ${formatCreditProductUnits("event_pass", creditsRemaining)}`;
84133
- }
84134
84401
  function transformRegistrationOptionsResponse(response) {
84135
- const eligiblePasses = response.entitlements.passes.map((pass) => ({
84136
- id: pass.customerPassId,
84137
- passName: pass.passName,
84138
- creditsRemaining: pass.creditsRemaining
84139
- }));
84140
- const eligibleMemberships = response.entitlements.memberships.map((membership) => ({
84141
- id: membership.customerMembershipId,
84142
- membershipName: membership.membershipName
84143
- }));
84144
- const eventAcceptsPasses = response.entitlements.requiresLoginForPasses || eligiblePasses.length > 0 || response.entitlements.availableForPurchase.passes.length > 0;
84145
- const eventAcceptsMemberships = response.entitlements.requiresLoginForMemberships || eligibleMemberships.length > 0 || response.entitlements.availableForPurchase.memberships.length > 0;
84402
+ const entitlements = registrationEntitlements(response.entitlements);
84146
84403
  const monetaryPaymentAvailable = hasMonetaryPaymentOption(response);
84147
84404
  return {
84405
+ discountPreview: response.discountPreview,
84148
84406
  availability: response.availability,
84407
+ ...siteOnlinePayments(response),
84149
84408
  registration: response.registration,
84150
84409
  paymentOptions: response.paymentOptions,
84151
84410
  isFree: response.paymentOptions.some((option) => option.kind === "free"),
@@ -84165,19 +84424,16 @@ function transformRegistrationOptionsResponse(response) {
84165
84424
  currency: response.pricing.currency
84166
84425
  })),
84167
84426
  ticketTypes: response.pricing.options,
84427
+ ...response.rooms ? { rooms: response.rooms } : {},
84168
84428
  price: response.pricing.subtotalCents,
84169
84429
  currency: response.pricing.currency,
84170
- requiresAuthForCredit: response.entitlements.requiresLoginForCredit ?? false,
84171
- requiresAuthForPasses: response.entitlements.requiresLoginForPasses,
84172
- requiresAuthForMemberships: response.entitlements.requiresLoginForMemberships,
84173
- eligiblePasses,
84174
- eligibleMemberships,
84175
- eventAcceptsPasses,
84176
- eventAcceptsMemberships,
84177
- availablePasses: [...response.entitlements.availableForPurchase.passes],
84178
- availableMemberships: [...response.entitlements.availableForPurchase.memberships]
84430
+ ...entitlements
84179
84431
  };
84180
84432
  }
84433
+ /** Older servers don't say whether the site takes cards; the block then assumes it does. */
84434
+ function siteOnlinePayments(response) {
84435
+ return response.onlinePayments ? { onlinePayments: response.onlinePayments } : {};
84436
+ }
84181
84437
  function customerCredit(credit) {
84182
84438
  if (!credit) return null;
84183
84439
  return {
@@ -84253,6 +84509,32 @@ function findSelectedTicketType(input) {
84253
84509
  selectedAttendanceMode: input.selectedAttendanceMode
84254
84510
  }).find((ticketType) => ticketType.pricingOptionId === input.selectedPricingOptionId) ?? null;
84255
84511
  }
84512
+ /** The server's entitlement decision, adapted once for the payment step. */
84513
+ function registrationEntitlements(entitlements) {
84514
+ const eligiblePasses = entitlements.passes.map((pass) => ({
84515
+ id: pass.customerPassId,
84516
+ passName: pass.passName,
84517
+ creditsRemaining: pass.creditsRemaining
84518
+ }));
84519
+ const eligibleMemberships = entitlements.memberships.map((membership) => ({
84520
+ id: membership.customerMembershipId,
84521
+ membershipName: membership.membershipName
84522
+ }));
84523
+ const eventAcceptsPasses = entitlements.requiresLoginForPasses || eligiblePasses.length > 0 || entitlements.availableForPurchase.passes.length > 0;
84524
+ const eventAcceptsMemberships = entitlements.requiresLoginForMemberships || eligibleMemberships.length > 0 || entitlements.availableForPurchase.memberships.length > 0;
84525
+ return {
84526
+ requiresAuthForCredit: entitlements.requiresLoginForCredit ?? false,
84527
+ requiresAuthForPasses: entitlements.requiresLoginForPasses,
84528
+ requiresAuthForMemberships: entitlements.requiresLoginForMemberships,
84529
+ unavailableEntitlements: entitlements.unavailableEntitlements ?? [],
84530
+ eligiblePasses,
84531
+ eligibleMemberships,
84532
+ eventAcceptsPasses,
84533
+ eventAcceptsMemberships,
84534
+ availablePasses: [...entitlements.availableForPurchase.passes],
84535
+ availableMemberships: [...entitlements.availableForPurchase.memberships]
84536
+ };
84537
+ }
84256
84538
 
84257
84539
  //#endregion
84258
84540
  //#region ../blocks/src/system/runtime/nodes/event-registration/combinationPrices.state.ts
@@ -84494,6 +84776,7 @@ function paymentSubtotal(subtotalCents, reductions) {
84494
84776
  }
84495
84777
  /** "4 dates, 1 place on each", above the list. */
84496
84778
  function paymentCaption(several, items$1, places) {
84779
+ if (items$1 === 1) return plural$1(places, "place");
84497
84780
  const noun = several === "runs" ? "run" : "date";
84498
84781
  return `${plural$1(items$1, noun)}, ${plural$1(places, "place")} on each`;
84499
84782
  }
@@ -84692,6 +84975,7 @@ function sameOffering(events) {
84692
84975
  function registrationSelectionMode(input) {
84693
84976
  const { events } = input;
84694
84977
  if (input.hasPreSelectedContext || events.length < 2) return SINGLE;
84978
+ if (events.some((event) => event.rooms)) return SINGLE;
84695
84979
  if (!events.every((event) => event.allowsMultipleBooking)) return SINGLE;
84696
84980
  const firstSeriesId = events[0]?.seriesId;
84697
84981
  if (events.every((event) => event.registrationSubject.kind === "occurrence" && event.seriesId === firstSeriesId)) {
@@ -84838,12 +85122,16 @@ function severalConfirmationSentence(kind, email) {
84838
85122
  }
84839
85123
  const SEVERAL_BOOKINGS_ACCOUNT_NOTE = "You can see and manage your bookings in your account.";
84840
85124
  /**
84841
- * Why passes and memberships, and the first item's deposit or instalments
84842
- * when it had them, aren't offered while several items are ticked.
85125
+ * What several items can't use. Runs can't use passes, memberships, or the
85126
+ * first run's deposit or instalments. Dates can use a pass or membership
85127
+ * (issue 1767, set 6), which the payment step's own options explain, so only a
85128
+ * deposit or instalments need saying; otherwise there's no note.
84843
85129
  */
84844
85130
  function selectionEntitlementNote(kind, hadDepositOrInstalments) {
84845
- const what = hadDepositOrInstalments ? "Deposits, instalments, class passes and memberships" : "Class passes and memberships";
84846
- return `${what} can be used when you book one ${kind === "dates" ? "date" : "run"} at a time.`;
85131
+ switch (kind) {
85132
+ case "dates": return hadDepositOrInstalments ? "Deposits and instalments can be used when you book one date at a time." : null;
85133
+ case "runs": return `${hadDepositOrInstalments ? "Deposits, instalments, class passes and memberships" : "Class passes and memberships"} can be used when you book one run at a time.`;
85134
+ }
84847
85135
  }
84848
85136
  const NO_RUN_PRICING_CHOICES = {};
84849
85137
  /** Runs whose price needs a choice get their own section on the tickets step. */
@@ -84940,7 +85228,7 @@ function severalRunsChoiceMessage(input) {
84940
85228
  }
84941
85229
  function selectionTicketInputs(input) {
84942
85230
  const priced = pricedTicketInputs(input);
84943
- const ticketsCount = input.invitation.kind === "ready" ? input.invitation.restoration.ticketsCount : priced.usesTicketLines ? getTicketSelectionTotal(priced.lines) : input.placeCount;
85231
+ const ticketsCount = input.invitation.kind === "ready" && input.invitation.restoration.claimed.kind === "reservedTickets" ? input.invitation.restoration.claimed.places : priced.usesTicketLines ? getTicketSelectionTotal(priced.lines) : input.placeCount;
84944
85232
  return {
84945
85233
  ...priced,
84946
85234
  ticketsCount
@@ -85101,6 +85389,19 @@ function selectionCostsNothing(several, input) {
85101
85389
 
85102
85390
  //#endregion
85103
85391
  //#region ../blocks/src/system/runtime/nodes/event-registration/registrationPaymentReturn.ts
85392
+ /** On an event with rooms, what was asked for: the room lines come from placement, not from here. */
85393
+ function roomsRestoration(pending) {
85394
+ const { rooms } = pending;
85395
+ return rooms ? {
85396
+ ticketLines: rooms.dayLines,
85397
+ roomChoices: rooms.choices,
85398
+ reviewedRooms: rooms.reviewed ?? []
85399
+ } : {
85400
+ ticketLines: pending.ticketSelections,
85401
+ roomChoices: [],
85402
+ reviewedRooms: []
85403
+ };
85404
+ }
85104
85405
  /**
85105
85406
  * The server owns submitted answers and consent; payment recovery only restores choices.
85106
85407
  */
@@ -85108,7 +85409,7 @@ function paymentReturnRestoration(pending, events) {
85108
85409
  return {
85109
85410
  selection: findSelection(pending.selectedEventIds, events),
85110
85411
  runChoices: pending.runChoices ?? NO_RUN_PRICING_CHOICES,
85111
- ticketLines: pending.ticketSelections,
85412
+ ...roomsRestoration(pending),
85112
85413
  placeCount: getTicketSelectionTotal(pending.ticketSelections),
85113
85414
  formData: {
85114
85415
  ...pending.formData,
@@ -85429,6 +85730,8 @@ const draftFields = z.object({
85429
85730
  pricingOptionId: z.string().nullable(),
85430
85731
  quantity: z.number().int().positive()
85431
85732
  })),
85733
+ roomChoices: roomChoicesSchema.default([]),
85734
+ reviewedRooms: reviewedRoomsSchema.default([]),
85432
85735
  ticketsCount: z.number().int().positive(),
85433
85736
  selectedSlidingAmountInput: z.string(),
85434
85737
  formData: z.object({
@@ -85467,6 +85770,8 @@ function toEventSignInDraft(source, attempt) {
85467
85770
  runChoices: draft.runChoices,
85468
85771
  selectedAttendanceMode: draft.selectedAttendanceMode,
85469
85772
  ticketSelections: draft.selectedTicketLines,
85773
+ roomChoices: draft.roomChoices,
85774
+ reviewedRooms: draft.reviewedRooms,
85470
85775
  ticketsCount: flow.placeCount,
85471
85776
  selectedSlidingAmountInput: draft.selectedSlidingAmountInput,
85472
85777
  formData,
@@ -85545,6 +85850,8 @@ function restoreEventSignInDraft(state, restoration) {
85545
85850
  runChoices: draft.runChoices,
85546
85851
  selectedAttendanceMode: draft.selectedAttendanceMode,
85547
85852
  selectedTicketLines: draft.ticketSelections.map((line) => ({ ...line })),
85853
+ roomChoices: draft.roomChoices,
85854
+ reviewedRooms: draft.reviewedRooms,
85548
85855
  selectedSlidingAmountInput: draft.selectedSlidingAmountInput
85549
85856
  }
85550
85857
  };
@@ -85875,15 +86182,16 @@ function oneBooking(result, context) {
85875
86182
  ...row("Where", arrival),
85876
86183
  ...facts$1.rows
85877
86184
  ],
85878
- payment: facts$1.payment,
86185
+ payment: withSubmissionPayment(facts$1.payment, result.submissionPayment),
85879
86186
  calendar: bookingCalendar(event, result.outcome),
85880
- several: null
86187
+ several: null,
86188
+ creditsLeftSentence: null
85881
86189
  };
85882
86190
  }
85883
86191
  /**
85884
86192
  * Several bookings made together: a line for each, in order, then the places
85885
- * each one has and what was paid in all. The finished card and bar keep the
85886
- * first booking's facts; there's no single calendar entry for them all.
86193
+ * each one has and what was paid in all. The finished card and bar say how
86194
+ * many were booked, from the first; there's no single calendar entry for them all.
85887
86195
  */
85888
86196
  function severalBookings(result, outcomes, context) {
85889
86197
  const several = outcomes[0]?.identity.scope === "occurrence" ? "dates" : "runs";
@@ -85892,11 +86200,27 @@ function severalBookings(result, outcomes, context) {
85892
86200
  return event ? [bookedItemRow(several, event)] : [];
85893
86201
  });
85894
86202
  return {
85895
- entry: oneBooking(result, context).entry,
85896
- summary: [...items$1, ...placesOnEachRow(several, outcomes)],
85897
- payment: severalPayment(outcomes),
86203
+ entry: severalEntry(several, outcomes, oneBooking(result, context).entry, context),
86204
+ summary: [
86205
+ ...items$1,
86206
+ ...placesOnEachRow(several, outcomes),
86207
+ ...severalFundingRow(outcomes)
86208
+ ],
86209
+ payment: withSubmissionPayment({ kind: "none" }, result.submissionPayment),
85898
86210
  calendar: null,
85899
- several
86211
+ several,
86212
+ creditsLeftSentence: creditsLeftSentence(outcomes, result.passCreditsRemaining)
86213
+ };
86214
+ }
86215
+ /** "3 dates from Mon 9 Nov" on the card and bar, with the first booking's places. */
86216
+ function severalEntry(several, outcomes, first, context) {
86217
+ const firstEvent = outcomes[0] ? findBookedEvent(context.events, outcomes[0].identity) : null;
86218
+ const count = `${outcomes.length} ${several === "runs" ? "runs" : "dates"}`;
86219
+ const when$1 = firstEvent ? `${count} from ${formatBookingWhen(firstEvent, "day")}` : count;
86220
+ return {
86221
+ ...first,
86222
+ when: when$1,
86223
+ shortWhen: when$1
85900
86224
  };
85901
86225
  }
85902
86226
  /** Runs by name and dates; dates by day, both with their times. */
@@ -85918,27 +86242,84 @@ function placesOnEachRow(several, outcomes) {
85918
86242
  value: `${places} on each ${several === "runs" ? "run" : "date"}`
85919
86243
  }] : [];
85920
86244
  }
85921
- /**
85922
- * What several bookings cost together. They're always paid up front by card
85923
- * or free, so anything else (or a booking whose details didn't load) shows
85924
- * no payment rather than a partial sum.
85925
- */
85926
- function severalPayment(outcomes) {
85927
- const payments = outcomes.flatMap((outcome) => outcome.kind === "detailsAvailable" ? [outcome.payment] : []);
85928
- if (payments.length !== outcomes.length) return { kind: "none" };
85929
- const paid = payments.flatMap((payment) => payment.kind === "monetary" && payment.balance.kind === "settled" ? [payment] : []);
85930
- const free = payments.filter((payment) => payment.kind === "free" || payment.kind === "waived");
85931
- const currency = paid[0]?.currency;
85932
- if (paid.length + free.length !== payments.length || paid.some((payment) => payment.currency !== currency)) return { kind: "none" };
85933
- const total = paid.reduce((sum, payment) => sum + payment.amountPaidCents, 0);
85934
- return {
86245
+ /** A checkout's cash comes from its order; booking funding and debt keep their own rows. */
86246
+ function withSubmissionPayment(payment, submission) {
86247
+ if (submission === undefined) return payment;
86248
+ const rows = submission ? [
86249
+ ...row("Paid", submission.amountPaidCents > 0 ? formatPrice(submission.amountPaidCents, submission.currency) : null),
86250
+ ...row("From account credit", submission.creditCents > 0 ? formatPrice(submission.creditCents, submission.currency) : null),
86251
+ ...submission.purchasedItems.map((item) => ({
86252
+ label: item.name,
86253
+ value: formatPrice(item.priceCents, submission.currency)
86254
+ }))
86255
+ ] : [];
86256
+ const retained = confirmationPaymentRows(payment).filter((item) => item.label !== "Paid" && item.label !== "Still to pay");
86257
+ return payment.kind === "due" ? {
86258
+ ...payment,
86259
+ paidRows: [...retained, ...rows]
86260
+ } : {
85935
86261
  kind: "settled",
85936
- rows: currency && total > 0 ? [{
85937
- label: "Paid",
85938
- value: formatPrice(total, currency)
85939
- }] : []
86262
+ rows: [...retained, ...rows]
85940
86263
  };
85941
86264
  }
86265
+ /** How one date was paid, as the finished screen groups them. */
86266
+ function fundingGroup(payment) {
86267
+ switch (payment.kind) {
86268
+ case "pass": return `with your ${payment.passName?.trim() || "class pass"}`;
86269
+ case "membership": return `with your ${payment.membershipName?.trim() || "membership"}`;
86270
+ case "monetary": switch (payment.paymentMethod) {
86271
+ case "stripe": return "paid by card";
86272
+ case "store_credit": return "paid with account credit";
86273
+ case "mixed": return "paid by card and account credit";
86274
+ case "manual": return null;
86275
+ default: return assertNever(payment.paymentMethod);
86276
+ }
86277
+ case "free":
86278
+ case "waived": return "free of charge";
86279
+ case "manual_due":
86280
+ case "managed_balance_due": return null;
86281
+ default: return assertNever(payment);
86282
+ }
86283
+ }
86284
+ function detailedPayments(outcomes) {
86285
+ const payments = outcomes.flatMap((outcome) => outcome.kind === "detailsAvailable" ? [outcome.payment] : []);
86286
+ return payments.length === outcomes.length ? payments : null;
86287
+ }
86288
+ /**
86289
+ * Several dates where a pass or membership covered some: a Payment row with
86290
+ * each way they were paid and how many dates it paid for, as one date's
86291
+ * Payment row says how it was paid. Dates paid only with money keep the total alone.
86292
+ */
86293
+ function severalFundingRow(outcomes) {
86294
+ const payments = detailedPayments(outcomes);
86295
+ return row("Payment", payments ? fundingGroupLines(payments).join(", ") : null);
86296
+ }
86297
+ /**
86298
+ * The pass's balance once several dates are booked. A covered booking's
86299
+ * receipt says it once every date had settled, so it's shown even when a
86300
+ * date's details didn't load; a booking finished through checkout has it on
86301
+ * each date's payment instead.
86302
+ */
86303
+ function creditsLeftSentence(outcomes, receiptBalance) {
86304
+ const payments = detailedPayments(outcomes);
86305
+ const left = receiptBalance ?? (payments ? passBalanceOnDates(payments) : null);
86306
+ return left === null ? null : `You have ${left} ${left === 1 ? "credit" : "credits"} left on your pass.`;
86307
+ }
86308
+ /** How many dates each way paid for, when a pass or membership paid for any. */
86309
+ function fundingGroupLines(payments) {
86310
+ if (!payments.some((payment) => payment.kind === "pass" || payment.kind === "membership")) return [];
86311
+ const groups = payments.flatMap((payment) => {
86312
+ const group = fundingGroup(payment);
86313
+ return group === null ? [] : [group];
86314
+ });
86315
+ if (groups.length !== payments.length) return [];
86316
+ const counts = groups.reduce((dates, group) => dates.set(group, (dates.get(group) ?? 0) + 1), new Map());
86317
+ return [...counts].map(([group, count]) => `${count} ${count === 1 ? "date" : "dates"} ${group}`);
86318
+ }
86319
+ function passBalanceOnDates(payments) {
86320
+ const balances = payments.flatMap((payment) => payment.kind === "pass" && payment.passCreditsRemaining !== undefined ? [payment.passCreditsRemaining] : []);
86321
+ return balances.length > 0 ? Math.min(...balances) : null;
86322
+ }
85942
86323
  function waitlistedBooking(context) {
85943
86324
  const event = context.draftEvent;
85944
86325
  const dates = entryFacts(withOccurrenceTitle(event, context.occurrenceContext), context.occurrenceContext);
@@ -85950,7 +86331,8 @@ function waitlistedBooking(context) {
85950
86331
  summary: scheduleRows(event, dates.shortWhen, "venue", context.display),
85951
86332
  payment: { kind: "none" },
85952
86333
  calendar: null,
85953
- several: null
86334
+ several: null,
86335
+ creditsLeftSentence: null
85954
86336
  };
85955
86337
  }
85956
86338
  /**
@@ -86047,6 +86429,256 @@ function isWaitlistClaimLoading(state) {
86047
86429
  return state.kind === "resolving";
86048
86430
  }
86049
86431
 
86432
+ //#endregion
86433
+ //#region ../blocks/src/system/runtime/nodes/event-registration/registrationRooms.state.ts
86434
+ /**
86435
+ * The room offer for what's selected: the freshest facts we have, or the page's
86436
+ * own. The last booking options that had rooms in them are kept while no options
86437
+ * are being asked for, because a choice that no longer fits has no lines to ask
86438
+ * with, and falling back to the page's older facts would make it fit again. Facts
86439
+ * about another event are ignored.
86440
+ */
86441
+ function selectRoomOffer(selection, roomFacts) {
86442
+ const page = selection[0]?.rooms ?? null;
86443
+ return page && roomFacts?.seriesId === page.seriesId ? roomFacts : page;
86444
+ }
86445
+ function decideRoomStay(offer, choices) {
86446
+ if (offer === null) return { kind: "none" };
86447
+ return choices.length === 0 ? { kind: "empty" } : placeBooking(offer, choices);
86448
+ }
86449
+ function stayIsPlaced(stay) {
86450
+ return stay.kind === "placed";
86451
+ }
86452
+ function stayFailure(stay) {
86453
+ return stay.kind === "none" || stay.kind === "empty" || stayIsPlaced(stay) ? null : stay;
86454
+ }
86455
+ /** What the booking charges for: the places without a room, then what placement decided. */
86456
+ function bookingLines(dayLines, stay) {
86457
+ return stayIsPlaced(stay) ? [...dayLines, ...stay.ticketLines] : dayLines;
86458
+ }
86459
+ const draftRoomStay = (draft, roomFacts) => decideRoomStay(selectRoomOffer(draft.selection, roomFacts), draft.roomChoices);
86460
+ /** Whether the rooms the guest chose still fit the latest facts. Nothing chosen, or no rooms, always does. */
86461
+ function draftRoomsStillPlace(draft, roomFacts) {
86462
+ return stayFailure(draftRoomStay(draft, roomFacts)) === null;
86463
+ }
86464
+ /** The same derivation, from the draft and the options it was last checked against. */
86465
+ function draftBookingLines(draft, roomFacts) {
86466
+ return bookingLines(draft.selectedTicketLines, draftRoomStay(draft, roomFacts));
86467
+ }
86468
+ /**
86469
+ * The stay the guest is agreeing to by carrying on. The server compares the booking
86470
+ * with this, so it must be what they saw here, not what placement says by the time
86471
+ * they've signed in or paid.
86472
+ */
86473
+ function withReviewedRooms(draft, roomFacts) {
86474
+ const stay = draftRoomStay(draft, roomFacts);
86475
+ return stayIsPlaced(stay) ? {
86476
+ ...draft,
86477
+ reviewedRooms: reviewedStay(stay)
86478
+ } : draft;
86479
+ }
86480
+ /** Room prices are chosen through rooms, so they're never listed as flat tickets. */
86481
+ function dayOptionsOf(options, offer) {
86482
+ if (offer === null) return options;
86483
+ return options.filter((option) => !offer.linkedOptionIds.includes(option.pricingOptionId));
86484
+ }
86485
+ /**
86486
+ * What goes with the booking on an event with rooms: always the rooms the guest asked
86487
+ * for, whatever placement here last said. Placement on this page is only a preview;
86488
+ * the server places for real, and when the rooms have gone it refuses with a room
86489
+ * reason that takes the guest back to choose again. Someone staying only for the day
86490
+ * sends the rooms part empty. A line for a room's price outside the rooms (a custom
86491
+ * renderer listing the ticket types) sends nothing, so the server's clear refusal
86492
+ * explains it.
86493
+ */
86494
+ function roomSubmission(offer, choices, dayLines, reviewed) {
86495
+ if (offer === null) return undefined;
86496
+ if (dayLines.some((line) => line.pricingOptionId !== null && offer.linkedOptionIds.includes(line.pricingOptionId))) return undefined;
86497
+ return {
86498
+ request: choices.length === 0 ? {
86499
+ choices: [],
86500
+ reviewed: []
86501
+ } : {
86502
+ choices,
86503
+ reviewed
86504
+ },
86505
+ dayLines
86506
+ };
86507
+ }
86508
+ const NO_DEFAULT_TICKETS = [];
86509
+ /** What a sole ticket type can be picked from by default. An event with rooms has no default: its guests choose. */
86510
+ function defaultTicketOptions(offer, options) {
86511
+ return offer ? NO_DEFAULT_TICKETS : options;
86512
+ }
86513
+ /** What's still needed before the guest can carry on, or null. */
86514
+ function roomChoiceMessage(stay, dayLines) {
86515
+ if (stay.kind === "empty") return dayLines.length > 0 ? null : ADD_A_PLACE;
86516
+ const failure = stayFailure(stay);
86517
+ return failure ? placementProblemText(failure, "guest") : null;
86518
+ }
86519
+ /** The refusals the guest can put right from the rooms step, with fresh facts. */
86520
+ function isRoomChoiceRefusal(reason) {
86521
+ return reason === "roomNotEnoughPlaces" || reason === "roomNeedsMorePeople" || reason === "roomStayChanged" || reason === "roomOptionsChanged";
86522
+ }
86523
+ const ADD_A_PLACE = "Add a place to see your total.";
86524
+ /** The sticky bar's short form of the split-rooms note, for a guest who can't see the note yet. */
86525
+ const SPLIT_ROOMS_SHORT = "You'd be in separate rooms";
86526
+ const NO_TOTAL_YET = "We can't work out your total yet.";
86527
+ const TOTAL_SO_FAR = "Your total so far.";
86528
+ const TAKE_IT_OFF = "Take it off, then choose another room.";
86529
+ const PRICES_ARE = "Prices are per person, for the whole retreat.";
86530
+ const SHARING_INTRO = {
86531
+ together: `Add a place for each person. If you choose the same shared option in the same kind of room, we'll put you together when there's one free. ${PRICES_ARE}`,
86532
+ separate: `Add a place for each person. People booking together are usually given separate rooms on this retreat. ${PRICES_ARE}`,
86533
+ organiser: `Add a place for each person. The organiser decides who shares with whom. ${PRICES_ARE}`
86534
+ };
86535
+ function roomChooserIntro(offer) {
86536
+ return roomsOfferSharing(offer) ? SHARING_INTRO[offer.arrangement] : `Add a place for each person. ${PRICES_ARE}`;
86537
+ }
86538
+ const peopleIn = (lines) => lines.reduce((sum, line) => sum + line.quantity, 0);
86539
+ const peopleChoosing = (choices) => choices.reduce((sum, choice) => sum + choice.people, 0);
86540
+ function kindViews(input) {
86541
+ const details = new Map(input.offer.kinds.map((kind) => [kind.id, kind]));
86542
+ const amountOf = (id$2) => input.options.find((option) => option.pricingOptionId === id$2)?.priceAmount;
86543
+ return roomKindOptions(input.offer, input.choices, "guest").flatMap((kind) => {
86544
+ const detail = details.get(kind.kindId);
86545
+ if (!detail) return [];
86546
+ const options = kind.options.flatMap((option) => {
86547
+ const priceCents = amountOf(option.pricingOptionId);
86548
+ if (priceCents === undefined) return [];
86549
+ return [{
86550
+ key: option.key,
86551
+ choice: option.choice,
86552
+ title: option.title,
86553
+ detail: option.detail,
86554
+ priceCents,
86555
+ each: option.each,
86556
+ people: option.people,
86557
+ maxPeople: Math.min(option.mostPeople, input.maxTickets - (input.everyone - option.people)),
86558
+ placesLeft: placesLeftText(option, detail.sleeps),
86559
+ gone: option.people > 0 && option.mostPeople === 0
86560
+ }];
86561
+ });
86562
+ return [{
86563
+ kindId: kind.kindId,
86564
+ name: kind.kindName,
86565
+ description: detail.description,
86566
+ photos: detail.photos,
86567
+ options,
86568
+ fullyBooked: options.every((option) => option.gone)
86569
+ }];
86570
+ });
86571
+ }
86572
+ function totalOf(lines, options) {
86573
+ if (lines.length === 0) return null;
86574
+ return lines.reduce((total, line) => {
86575
+ const amount = options.find((option) => option.pricingOptionId === line.pricingOptionId)?.priceAmount;
86576
+ return total === null || amount === undefined ? null : total + amount * line.quantity;
86577
+ }, 0);
86578
+ }
86579
+ function lastDayText(saleEndsAt, timeZone) {
86580
+ const instant = Date.parse(saleEndsAt);
86581
+ if (Number.isNaN(instant)) return null;
86582
+ return new Intl.DateTimeFormat(inferSiteDateLocale(timeZone), {
86583
+ day: "numeric",
86584
+ month: "long",
86585
+ year: "numeric",
86586
+ timeZone
86587
+ }).format(new Date(instant - 1));
86588
+ }
86589
+ /** The soonest a chosen room's named price ends. A room with only one price has nothing to say. */
86590
+ function priceNoteOf(stay, offer, options, timeZone) {
86591
+ if (!stayIsPlaced(stay)) return null;
86592
+ const prices = offer.kinds.flatMap((kind) => kind.prices);
86593
+ const ending = stay.ticketLines.flatMap((line) => {
86594
+ const priceName = prices.find((price$1) => price$1.pricingOptionId === line.pricingOptionId)?.priceName;
86595
+ const saleEndsAt = options.find((option) => option.pricingOptionId === line.pricingOptionId)?.saleEndsAt;
86596
+ return priceName && saleEndsAt ? [{
86597
+ priceName,
86598
+ saleEndsAt
86599
+ }] : [];
86600
+ }).sort((left, right) => Date.parse(left.saleEndsAt) - Date.parse(right.saleEndsAt))[0];
86601
+ const lastDay = ending ? lastDayText(ending.saleEndsAt, timeZone) : null;
86602
+ return ending && lastDay ? `${ending.priceName} price until ${lastDay}` : null;
86603
+ }
86604
+ function stayLinesOf(stay, dayLines, options) {
86605
+ const rooms = stayIsPlaced(stay) ? stay.stay.map((line) => stayLineText(line, "guest")) : [];
86606
+ const day = dayLines.flatMap((line) => {
86607
+ const name = options.find((option) => option.pricingOptionId === line.pricingOptionId)?.name;
86608
+ return name ? [`${line.quantity} × ${name}`] : [];
86609
+ });
86610
+ return [...rooms, ...day];
86611
+ }
86612
+ /** What's stopping the booking, with the next step when a chosen place has gone. */
86613
+ function failureNotice(failure) {
86614
+ switch (failure.kind) {
86615
+ case "not_enough_places": return `${placementProblemText(failure, "guest")} ${TAKE_IT_OFF}`;
86616
+ case "option_unavailable": return `That room option isn't available any more. ${TAKE_IT_OFF}`;
86617
+ case "whole_room_needs_more_people": return placementProblemText(failure, "guest");
86618
+ }
86619
+ }
86620
+ function takeOffFor(failure, offer, choices) {
86621
+ if (!failure || failure.kind === "whole_room_needs_more_people") return null;
86622
+ const name = offer.kinds.find((kind) => kind.id === failure.kindId)?.name;
86623
+ return {
86624
+ label: name ? `Take off the ${name}` : "Take off that room",
86625
+ choices: choicesLeftAfterTakingOff(failure.kindId, offer, choices)
86626
+ };
86627
+ }
86628
+ /** Only what no longer fits comes off. A kind can have other choices that still do, like a men's bed beside a women's. */
86629
+ function choicesLeftAfterTakingOff(kindId, offer, choices) {
86630
+ const options = roomKindOptions(offer, choices, "guest").find((kind) => kind.kindId === kindId)?.options ?? [];
86631
+ const stillFits = (choice) => options.some((option) => sameRoomOption(option.choice, choice) && option.people <= option.mostPeople);
86632
+ const left = choices.filter((choice) => choice.kindId !== kindId || stillFits(choice));
86633
+ return left.length < choices.length ? left : choices.filter((choice) => choice.kindId !== kindId);
86634
+ }
86635
+ /** The people and money the summary can stand behind, however far the booking has got. */
86636
+ function bookingSoFar(offer, choices, stay, dayLines, options) {
86637
+ const counted = stayFailure(stay) ? countSoFar(offer, choices) : null;
86638
+ const people = peopleIn(dayLines) + (counted ? counted.people : peopleChoosing(choices));
86639
+ const totalCents = totalOf(counted ? [...dayLines, ...counted.ticketLines] : bookingLines(dayLines, stay), options);
86640
+ const stillAdding = stayFailure(stay)?.kind === "whole_room_needs_more_people";
86641
+ const totalNote = people === 0 ? null : totalCents === null ? NO_TOTAL_YET : stillAdding ? TOTAL_SO_FAR : null;
86642
+ return {
86643
+ people,
86644
+ totalCents,
86645
+ totalNote
86646
+ };
86647
+ }
86648
+ /** Why it can't go ahead, the note when nothing's stopping it, and the stay a refusal asks them to agree to. */
86649
+ function stayMessages(stay, refusal, stayLines) {
86650
+ const failure = stayFailure(stay);
86651
+ const notice = failure ? failureNotice(failure) : refusal || null;
86652
+ const notes = stayIsPlaced(stay) ? stay.notes : [];
86653
+ const note = notice === null ? notes[0] : undefined;
86654
+ return {
86655
+ notice,
86656
+ noticeStay: notice !== null && notes.length > 0 ? stayLines : [],
86657
+ note: note ? stayNoteText(note, "guest") : null,
86658
+ splitWarning: note ? SPLIT_ROOMS_SHORT : null
86659
+ };
86660
+ }
86661
+ /** The chooser, as a pure reading of the draft and the freshest room facts. */
86662
+ function presentRoomChooser(input) {
86663
+ const { offer, choices, stay, dayLines, options } = input;
86664
+ const stayLines = stayLinesOf(stay, dayLines, options);
86665
+ return {
86666
+ intro: roomChooserIntro(offer),
86667
+ kinds: kindViews({
86668
+ offer,
86669
+ choices,
86670
+ options,
86671
+ maxTickets: input.maxTickets,
86672
+ everyone: peopleChoosing(choices) + peopleIn(dayLines)
86673
+ }),
86674
+ stayLines,
86675
+ ...stayMessages(stay, input.refusal, stayLines),
86676
+ takeOff: takeOffFor(stayFailure(stay), offer, choices),
86677
+ ...bookingSoFar(offer, choices, stay, dayLines, options),
86678
+ priceNote: priceNoteOf(stay, offer, options, input.timeZone)
86679
+ };
86680
+ }
86681
+
86050
86682
  //#endregion
86051
86683
  //#region ../frontend-state/dist/index.mjs
86052
86684
  const FIELD_ORDER = [
@@ -87848,7 +88480,7 @@ function createInitialRegistrationFormData() {
87848
88480
  function validateFormData(formData, requiresConsent = false) {
87849
88481
  return {
87850
88482
  ...!formData.name.trim() ? { name: "Name is required" } : {},
87851
- ...!formData.email.trim() ? { email: "Email is required" } : !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(formData.email) ? { email: "Invalid email address" } : {},
88483
+ ...!formData.email.trim() ? { email: "Email is required" } : !isEmailAddress(formData.email) ? { email: "Invalid email address" } : {},
87852
88484
  ...requiresConsent && formData.consentAccepted !== true ? { consentAccepted: "Please read and accept the agreement before continuing." } : {}
87853
88485
  };
87854
88486
  }
@@ -87857,123 +88489,6 @@ function registrationQuestionsMessage(questionFieldErrors, errorMessage$1) {
87857
88489
  return Object.keys(questionFieldErrors).length > 0 ? errorMessage$1 : "";
87858
88490
  }
87859
88491
 
87860
- //#endregion
87861
- //#region ../blocks/src/system/runtime/nodes/event-registration/registrationDraft.state.ts
87862
- function createRegistrationDraftData(event) {
87863
- const defaults = event ? getEventSelectionDefaults(event) : null;
87864
- return {
87865
- selection: event ? [event] : [],
87866
- runChoices: NO_RUN_PRICING_CHOICES,
87867
- formData: createInitialRegistrationFormData(),
87868
- guests: [],
87869
- selectedAttendanceMode: defaults?.attendanceMode ?? null,
87870
- selectedTicketLines: [],
87871
- selectedSlidingAmountInput: defaults?.slidingAmountInput ?? "",
87872
- bookingQuestions: EMPTY_BOOKING_QUESTIONS_ANSWERS,
87873
- runRequirements: NO_RUN_REQUIREMENTS
87874
- };
87875
- }
87876
- function updated(current, value) {
87877
- return typeof value === "function" ? value(current) : value;
87878
- }
87879
- function editRegistrationDraft(draft, edit) {
87880
- switch (edit.field) {
87881
- case "selection": {
87882
- const selection = updated(draft.selection, edit.value);
87883
- return {
87884
- ...draft,
87885
- selection,
87886
- selectedAttendanceMode: resolveSelectionAttendanceMode(decideSelectionAttendance(selection), draft.selectedAttendanceMode)
87887
- };
87888
- }
87889
- case "runChoices": return {
87890
- ...draft,
87891
- runChoices: updated(draft.runChoices, edit.value)
87892
- };
87893
- case "formData": return {
87894
- ...draft,
87895
- formData: updated(draft.formData, edit.value)
87896
- };
87897
- case "guests": return {
87898
- ...draft,
87899
- guests: updated(draft.guests, edit.value)
87900
- };
87901
- case "selectedAttendanceMode": return {
87902
- ...draft,
87903
- selectedAttendanceMode: resolveSelectionAttendanceMode(decideSelectionAttendance(draft.selection), updated(draft.selectedAttendanceMode, edit.value))
87904
- };
87905
- case "selectedTicketLines": return {
87906
- ...draft,
87907
- selectedTicketLines: updated(draft.selectedTicketLines, edit.value)
87908
- };
87909
- case "selectedSlidingAmountInput": return {
87910
- ...draft,
87911
- selectedSlidingAmountInput: updated(draft.selectedSlidingAmountInput, edit.value)
87912
- };
87913
- default: return assertNever$4(edit);
87914
- }
87915
- }
87916
- /** Ready invitations own their reserved selection; identity fields remain editable. */
87917
- function canEditInvitedDraft(invitation, edit) {
87918
- return invitation.kind !== "ready" || edit.field === "formData" || edit.field === "guests";
87919
- }
87920
- function beginWaitlistInvitation(credential) {
87921
- return credential ? {
87922
- kind: "resolving",
87923
- request: { credential }
87924
- } : { kind: "none" };
87925
- }
87926
- /** A source notification is not a new attempt when its credential is unchanged. */
87927
- function receiveWaitlistInvitation(invitation, credential) {
87928
- const current = invitation.kind === "none" ? null : invitation.request.credential;
87929
- return current === credential ? invitation : beginWaitlistInvitation(credential);
87930
- }
87931
- function restoreRegistrationDraft(draft, claim, restoration) {
87932
- return {
87933
- bookingQuestions: draft.bookingQuestions,
87934
- runRequirements: NO_RUN_REQUIREMENTS,
87935
- selection: restoration.event ? [restoration.event] : draft.selection,
87936
- runChoices: NO_RUN_PRICING_CHOICES,
87937
- selectedAttendanceMode: restoration.attendanceMode,
87938
- selectedTicketLines: [...restoration.ticketSelections],
87939
- selectedSlidingAmountInput: restoration.slidingAmountInput ?? draft.selectedSlidingAmountInput,
87940
- formData: {
87941
- ...draft.formData,
87942
- email: claim.prefill.email,
87943
- name: claim.prefill.name,
87944
- phone: claim.prefill.phone ?? "",
87945
- notes: claim.prefill.notes ?? ""
87946
- },
87947
- guests: claim.prefill.guests.map((guest) => ({
87948
- name: guest.name,
87949
- email: guest.email ?? "",
87950
- phone: guest.phone ?? ""
87951
- }))
87952
- };
87953
- }
87954
- function invitationSubmission(invitation) {
87955
- switch (invitation.kind) {
87956
- case "none": return {
87957
- kind: "available",
87958
- credential: null
87959
- };
87960
- case "ready": return {
87961
- kind: "available",
87962
- credential: invitation.request.credential
87963
- };
87964
- case "resolving": return {
87965
- kind: "blocked",
87966
- message: "Please wait while we check your waiting list invitation."
87967
- };
87968
- case "portal-login-required":
87969
- case "error": return {
87970
- kind: "blocked",
87971
- message: invitation.message
87972
- };
87973
- default: return assertNever$4(invitation);
87974
- }
87975
- }
87976
-
87977
88492
  //#endregion
87978
88493
  //#region ../blocks/src/system/runtime/nodes/event-registration/registrationDerivations.ts
87979
88494
  /** Public requests share subject identity without copying the run's display sessions. */
@@ -88052,18 +88567,6 @@ function resolveDiscountContext(input) {
88052
88567
  if (!input.event) {
88053
88568
  return null;
88054
88569
  }
88055
- if (selection?.method === "pass_bundle" && selection.bundlePassId) {
88056
- return {
88057
- type: "pass",
88058
- passId: selection.bundlePassId
88059
- };
88060
- }
88061
- if (selection?.method === "membership_bundle" && selection.bundleMembershipId) {
88062
- return {
88063
- type: "membership",
88064
- membershipId: selection.bundleMembershipId
88065
- };
88066
- }
88067
88570
  if (!input.eventRequiresPayment) {
88068
88571
  return null;
88069
88572
  }
@@ -88105,6 +88608,8 @@ function buildRegistrationSelectionRequest(input) {
88105
88608
 
88106
88609
  //#endregion
88107
88610
  //#region ../blocks/src/system/runtime/nodes/event-registration/waitlistClaimRestoration.ts
88611
+ /** A date's waiting list is joined one place at a time, and its offer holds that one place. */
88612
+ const DATE_OFFER_PLACES = 1;
88108
88613
  function findClaimEvent(subject, events) {
88109
88614
  switch (subject.kind) {
88110
88615
  case "event_occurrence": return findEventByOccurrenceId(events, subject.occurrenceId);
@@ -88113,24 +88618,37 @@ function findClaimEvent(subject, events) {
88113
88618
  }
88114
88619
  }
88115
88620
  /** Reserved quantities and amounts have one interpretation across restoration and submission. */
88116
- function claimedSelection(subject) {
88621
+ function claimedPlaces(subject) {
88117
88622
  switch (subject.kind) {
88118
88623
  case "event_occurrence": return {
88119
- ticketSelections: [{
88120
- pricingOptionId: null,
88121
- quantity: 1
88122
- }],
88123
- ticketsCount: 1,
88124
- slidingAmountInput: null
88624
+ kind: "anyTicket",
88625
+ places: DATE_OFFER_PLACES
88125
88626
  };
88126
88627
  case "whole_series": return {
88628
+ kind: "reservedTickets",
88629
+ places: subject.seatCount,
88127
88630
  ticketSelections: subject.ticketSelections,
88128
- ticketsCount: subject.seatCount,
88129
88631
  slidingAmountInput: subject.selectedSlidingAmount === null ? null : formatCentsAsCurrencyInput(subject.selectedSlidingAmount)
88130
88632
  };
88131
88633
  default: return assertNever$4(subject);
88132
88634
  }
88133
88635
  }
88636
+ /** The tickets they're booking: the reserved ones, or what they've chosen for the places held. */
88637
+ function claimTicketSelections(claimed, chosen) {
88638
+ return claimed.kind === "reservedTickets" ? claimed.ticketSelections : chosen;
88639
+ }
88640
+ /**
88641
+ * What to quote while they haven't chosen a ticket yet: the places held, with no ticket. The
88642
+ * answer says which tickets have room for them, which the page's own figures can't, since
88643
+ * they count the held place as taken.
88644
+ */
88645
+ function claimQuoteSelections(claimed, chosen) {
88646
+ const lines = claimTicketSelections(claimed, chosen);
88647
+ return lines.length > 0 ? lines : [{
88648
+ pricingOptionId: null,
88649
+ quantity: claimed.places
88650
+ }];
88651
+ }
88134
88652
  function resolveWaitlistClaimRestoration(input) {
88135
88653
  if (input.events.kind !== "ready") return { kind: "awaitingEvents" };
88136
88654
  const { subject } = input.claim;
@@ -88140,18 +88658,162 @@ function resolveWaitlistClaimRestoration(input) {
88140
88658
  kind: "ready",
88141
88659
  event,
88142
88660
  attendanceMode: subject.attendanceMode,
88143
- ...claimedSelection(subject)
88661
+ claimed: claimedPlaces(subject)
88144
88662
  } : {
88145
88663
  kind: "different-event",
88146
88664
  message: "This waiting list invitation is for a different event. Please open the link in your invitation email."
88147
88665
  };
88148
88666
  }
88667
+ /**
88668
+ * What this visitor books and quotes, and how many places they can ask for. An invitation books
88669
+ * only the places it holds; anyone else chooses freely, up to the block's own limit.
88670
+ */
88671
+ function invitationBooking(invitation, chosen, blockLimit) {
88672
+ if (invitation.kind !== "ready") return {
88673
+ ticketSelections: [...chosen],
88674
+ quoteSelections: chosen,
88675
+ maxTicketsNum: blockLimit
88676
+ };
88677
+ const { claimed } = invitation.restoration;
88678
+ return {
88679
+ ticketSelections: [...claimTicketSelections(claimed, chosen)],
88680
+ quoteSelections: claimQuoteSelections(claimed, chosen),
88681
+ maxTicketsNum: claimed.places
88682
+ };
88683
+ }
88149
88684
  /** A place held on a run or date that's closed is still theirs, so it stays on the list they see. */
88150
88685
  function withOfferedEvent(choices, invitation) {
88151
88686
  const offered$1 = invitation.kind === "ready" ? invitation.restoration.event : null;
88152
88687
  return offered$1 && !choices.some((event) => event.selectionId === offered$1.selectionId) ? [offered$1, ...choices] : choices;
88153
88688
  }
88154
88689
 
88690
+ //#endregion
88691
+ //#region ../blocks/src/system/runtime/nodes/event-registration/registrationDraft.state.ts
88692
+ function createRegistrationDraftData(event) {
88693
+ const defaults = event ? getEventSelectionDefaults(event) : null;
88694
+ return {
88695
+ selection: event ? [event] : [],
88696
+ runChoices: NO_RUN_PRICING_CHOICES,
88697
+ formData: createInitialRegistrationFormData(),
88698
+ guests: [],
88699
+ selectedAttendanceMode: defaults?.attendanceMode ?? null,
88700
+ selectedTicketLines: [],
88701
+ roomChoices: [],
88702
+ reviewedRooms: [],
88703
+ selectedSlidingAmountInput: defaults?.slidingAmountInput ?? "",
88704
+ bookingQuestions: EMPTY_BOOKING_QUESTIONS_ANSWERS,
88705
+ runRequirements: NO_RUN_REQUIREMENTS
88706
+ };
88707
+ }
88708
+ function updated(current, value) {
88709
+ return typeof value === "function" ? value(current) : value;
88710
+ }
88711
+ function editRegistrationDraft(draft, edit) {
88712
+ switch (edit.field) {
88713
+ case "selection": {
88714
+ const selection = updated(draft.selection, edit.value);
88715
+ return {
88716
+ ...draft,
88717
+ selection,
88718
+ selectedAttendanceMode: resolveSelectionAttendanceMode(decideSelectionAttendance(selection), draft.selectedAttendanceMode)
88719
+ };
88720
+ }
88721
+ case "runChoices": return {
88722
+ ...draft,
88723
+ runChoices: updated(draft.runChoices, edit.value)
88724
+ };
88725
+ case "formData": return {
88726
+ ...draft,
88727
+ formData: updated(draft.formData, edit.value)
88728
+ };
88729
+ case "guests": return {
88730
+ ...draft,
88731
+ guests: updated(draft.guests, edit.value)
88732
+ };
88733
+ case "selectedAttendanceMode": return {
88734
+ ...draft,
88735
+ selectedAttendanceMode: resolveSelectionAttendanceMode(decideSelectionAttendance(draft.selection), updated(draft.selectedAttendanceMode, edit.value))
88736
+ };
88737
+ case "selectedTicketLines": return {
88738
+ ...draft,
88739
+ selectedTicketLines: updated(draft.selectedTicketLines, edit.value)
88740
+ };
88741
+ case "roomChoices": return {
88742
+ ...draft,
88743
+ roomChoices: updated(draft.roomChoices, edit.value),
88744
+ reviewedRooms: []
88745
+ };
88746
+ case "selectedSlidingAmountInput": return {
88747
+ ...draft,
88748
+ selectedSlidingAmountInput: updated(draft.selectedSlidingAmountInput, edit.value)
88749
+ };
88750
+ default: return assertNever$4(edit);
88751
+ }
88752
+ }
88753
+ /** Ready invitations own their reserved selection; identity fields remain editable. */
88754
+ function canEditInvitedDraft(invitation, edit) {
88755
+ if (invitation.kind !== "ready" || edit.field === "formData" || edit.field === "guests") return true;
88756
+ return invitation.restoration.claimed.kind === "anyTicket" && (edit.field === "selectedTicketLines" || edit.field === "selectedSlidingAmountInput");
88757
+ }
88758
+ function beginWaitlistInvitation(credential) {
88759
+ return credential ? {
88760
+ kind: "resolving",
88761
+ request: { credential }
88762
+ } : { kind: "none" };
88763
+ }
88764
+ /** A source notification is not a new attempt when its credential is unchanged. */
88765
+ function receiveWaitlistInvitation(invitation, credential) {
88766
+ const current = invitation.kind === "none" ? null : invitation.request.credential;
88767
+ return current === credential ? invitation : beginWaitlistInvitation(credential);
88768
+ }
88769
+ function restoreRegistrationDraft(draft, claim, restoration) {
88770
+ return {
88771
+ bookingQuestions: draft.bookingQuestions,
88772
+ runRequirements: NO_RUN_REQUIREMENTS,
88773
+ selection: restoration.event ? [restoration.event] : draft.selection,
88774
+ runChoices: NO_RUN_PRICING_CHOICES,
88775
+ selectedAttendanceMode: restoration.attendanceMode,
88776
+ selectedTicketLines: [...claimTicketSelections(restoration.claimed, [])],
88777
+ roomChoices: [],
88778
+ reviewedRooms: [],
88779
+ selectedSlidingAmountInput: (restoration.claimed.kind === "reservedTickets" ? restoration.claimed.slidingAmountInput : null) ?? draft.selectedSlidingAmountInput,
88780
+ formData: {
88781
+ ...draft.formData,
88782
+ email: claim.prefill.email,
88783
+ name: claim.prefill.name,
88784
+ phone: claim.prefill.phone ?? "",
88785
+ notes: claim.prefill.notes ?? ""
88786
+ },
88787
+ guests: claim.prefill.guests.map((guest) => ({
88788
+ name: guest.name,
88789
+ email: guest.email ?? "",
88790
+ phone: guest.phone ?? ""
88791
+ }))
88792
+ };
88793
+ }
88794
+ function invitationSubmission(invitation) {
88795
+ switch (invitation.kind) {
88796
+ case "none": return {
88797
+ kind: "available",
88798
+ credential: null
88799
+ };
88800
+ case "ready": return {
88801
+ kind: "available",
88802
+ credential: invitation.request.credential
88803
+ };
88804
+ case "resolving": return {
88805
+ kind: "blocked",
88806
+ message: "Please wait while we check your waiting list invitation."
88807
+ };
88808
+ case "portal-login-required":
88809
+ case "error": return {
88810
+ kind: "blocked",
88811
+ message: invitation.message
88812
+ };
88813
+ default: return assertNever$4(invitation);
88814
+ }
88815
+ }
88816
+
88155
88817
  //#endregion
88156
88818
  //#region ../blocks/src/system/runtime/nodes/event-registration/registrationBrowserDraft.ts
88157
88819
  const browserDraftSteps = [
@@ -88160,11 +88822,22 @@ const browserDraftSteps = [
88160
88822
  "enter-details",
88161
88823
  "select-payment"
88162
88824
  ];
88163
- /**
88164
- * An allowlist: free text, questions, agreement and payment authority never go to storage.
88165
- * The discount code is its text only, never a price or amount, and the server checks it again on restore.
88825
+ /** How long this tab's draft is kept after it was last saved; older drafts are ignored and cleared. */
88826
+ const BROWSER_DRAFT_LIFETIME_MS = 3 * 60 * 60 * 1e3;
88827
+ /**
88828
+ * An allowlist of what the booker typed or chose, kept in this tab only, for
88829
+ * `BROWSER_DRAFT_LIFETIME_MS`: the selection and tickets, their contact
88830
+ * details, the guests' names and contact details, and their answers to the
88831
+ * questions, by question ID (`BookingQuestionsTabDraft`: plain answers only,
88832
+ * never file uploads, and dropped on restore if the question has gone or
88833
+ * changed kind), once for the selection or per run when runs ask their own.
88834
+ * `owner` is whoever was signed in (or nobody) when it was saved: contact,
88835
+ * guests and answers come back only to that same visitor. Notes, the terms agreement, payment choices and anything
88836
+ * else payment-related never go to storage. The discount code is its text
88837
+ * only, never a price or amount, and the server checks it again on restore.
88166
88838
  */
88167
88839
  const registrationBrowserDraftSchema = z.object({
88840
+ owner: bookingQuestionsOwnerSchema,
88168
88841
  step: z.enum(browserDraftSteps),
88169
88842
  selectedEventIds: z.array(z.string()),
88170
88843
  placeCount: z.number().int().positive(),
@@ -88183,15 +88856,23 @@ const registrationBrowserDraftSchema = z.object({
88183
88856
  email: z.string(),
88184
88857
  phone: z.string()
88185
88858
  }),
88186
- discountCode: z.string().default("")
88859
+ discountCode: z.string().default(""),
88860
+ guests: z.array(z.object({
88861
+ name: z.string(),
88862
+ email: z.string().nullable(),
88863
+ phone: z.string().nullable()
88864
+ })).default([]),
88865
+ questions: bookingQuestionsTabDraftSchema.nullable().default(null),
88866
+ runQuestions: z.record(z.string(), bookingQuestionsTabDraftSchema).default({})
88187
88867
  });
88188
88868
  function isBrowserDraftStep(step) {
88189
88869
  return browserDraftSteps.some((candidate$1) => candidate$1 === step);
88190
88870
  }
88191
- function registrationBrowserDraft(flow, discountCode) {
88871
+ function registrationBrowserDraft(flow, discountCode, identity) {
88192
88872
  if (!isBrowserDraftStep(flow.step)) return null;
88193
88873
  const { draft } = flow;
88194
88874
  return {
88875
+ owner: bookingQuestionsOwnerOf(identity),
88195
88876
  step: flow.step,
88196
88877
  selectedEventIds: draft.selection.map((event) => event.selectionId),
88197
88878
  placeCount: flow.placeCount,
@@ -88204,7 +88885,44 @@ function registrationBrowserDraft(flow, discountCode) {
88204
88885
  email: draft.formData.email,
88205
88886
  phone: draft.formData.phone
88206
88887
  },
88207
- discountCode
88888
+ discountCode,
88889
+ guests: draft.guests.map(({ name, email, phone }) => ({
88890
+ name,
88891
+ email,
88892
+ phone
88893
+ })),
88894
+ ...questionsDrafts(draft.selection, draft.bookingQuestions, draft.runRequirements, identity)
88895
+ };
88896
+ }
88897
+ /** Who asks the questions: one event for the whole selection, or each run for itself. */
88898
+ function questionAskers(selection) {
88899
+ const layout$1 = decideSelectionRequirementsLayout(selection);
88900
+ return layout$1.kind === "per_run" ? {
88901
+ kind: "per_run",
88902
+ runs: layout$1.runs
88903
+ } : {
88904
+ kind: "once",
88905
+ event: primarySelectionItem(selection)
88906
+ };
88907
+ }
88908
+ /** Only answers typed as the visitor signed in now are kept, so the draft's one stamp covers them. */
88909
+ function answersDraft(answers, event, identity) {
88910
+ if ((answers.scope?.identity ?? null) !== identity) return null;
88911
+ const shown = answers.refreshed?.targetKey === event.seriesId ? answers.refreshed.presentation : event.bookingQuestions;
88912
+ return toBookingQuestionsTabDraft(answers, shown);
88913
+ }
88914
+ function questionsDrafts(selection, answers, runs, identity) {
88915
+ const askers = questionAskers(selection);
88916
+ if (askers.kind === "once") return {
88917
+ questions: askers.event ? answersDraft(answers, askers.event, identity) : null,
88918
+ runQuestions: {}
88919
+ };
88920
+ return {
88921
+ questions: null,
88922
+ runQuestions: Object.fromEntries(askers.runs.flatMap((run) => {
88923
+ const kept = answersDraft(runAnswers(runs, run.seriesId).questions, run, identity);
88924
+ return kept ? [[run.seriesId, kept]] : [];
88925
+ }))
88208
88926
  };
88209
88927
  }
88210
88928
  /** A code belongs to its selection: it only comes back when that whole selection does. */
@@ -88212,13 +88930,14 @@ function restorableBrowserDraftCode(saved, events) {
88212
88930
  return findSelection(saved.selectedEventIds, events).length === saved.selectedEventIds.length ? saved.discountCode : "";
88213
88931
  }
88214
88932
  /** Restore against current events, never a saved price/capacity or a partial selection. */
88215
- function restoreRegistrationBrowserDraft(state, saved, events) {
88933
+ function restoreRegistrationBrowserDraft(state, saved, events, identity) {
88216
88934
  if (state.invitation.kind !== "none" || !isBrowserDraftStep(state.step)) return state;
88217
88935
  const selection = findSelection(saved.selectedEventIds, events);
88218
- const contact$1 = {
88936
+ const theirs = isBookingQuestionsOwner(saved.owner, identity);
88937
+ const contact$1 = theirs ? {
88219
88938
  ...state.draft.formData,
88220
88939
  ...saved.contact
88221
- };
88940
+ } : state.draft.formData;
88222
88941
  if (selection.length !== saved.selectedEventIds.length) return {
88223
88942
  ...state,
88224
88943
  draft: {
@@ -88226,6 +88945,8 @@ function restoreRegistrationBrowserDraft(state, saved, events) {
88226
88945
  formData: contact$1
88227
88946
  }
88228
88947
  };
88948
+ const restoredSelection = selection.length ? selection : state.draft.selection;
88949
+ const questions = theirs ? restoredQuestions(state.draft, saved, restoredSelection, identity) : {};
88229
88950
  return {
88230
88951
  ...state,
88231
88952
  step: saved.step === "select-payment" ? "enter-details" : saved.step,
@@ -88233,7 +88954,9 @@ function restoreRegistrationBrowserDraft(state, saved, events) {
88233
88954
  draft: {
88234
88955
  ...state.draft,
88235
88956
  formData: contact$1,
88236
- selection: selection.length ? selection : state.draft.selection,
88957
+ guests: theirs ? saved.guests.map((guest) => ({ ...guest })) : state.draft.guests,
88958
+ ...questions,
88959
+ selection: restoredSelection,
88237
88960
  selectedTicketLines: saved.selectedTicketLines,
88238
88961
  selectedSlidingAmountInput: saved.selectedSlidingAmountInput,
88239
88962
  selectedAttendanceMode: resolveSelectionAttendanceMode(decideSelectionAttendance(selection.length ? selection : state.draft.selection), saved.selectedAttendanceMode),
@@ -88241,6 +88964,27 @@ function restoreRegistrationBrowserDraft(state, saved, events) {
88241
88964
  }
88242
88965
  };
88243
88966
  }
88967
+ /** Answers come back against the questions as they're asked now, never as they were saved. */
88968
+ function restoredQuestions(current, saved, selection, identity) {
88969
+ const restore = (answers, draft, event) => draft ? restoreBookingQuestionsAnswers(answers, decideBookingQuestionsRestoration({
88970
+ kind: "tab_draft",
88971
+ draft,
88972
+ identity,
88973
+ current: event.bookingQuestions
88974
+ })) : answers;
88975
+ const askers = questionAskers(selection);
88976
+ if (askers.kind === "once") return askers.event ? { bookingQuestions: restore(current.bookingQuestions, saved.questions, askers.event) } : {};
88977
+ return { runRequirements: askers.runs.reduce((runs, run) => {
88978
+ const answers = runAnswers(runs, run.seriesId);
88979
+ return {
88980
+ ...runs,
88981
+ [run.seriesId]: {
88982
+ ...answers,
88983
+ questions: restore(answers.questions, saved.runQuestions[run.seriesId], run)
88984
+ }
88985
+ };
88986
+ }, current.runRequirements) };
88987
+ }
88244
88988
 
88245
88989
  //#endregion
88246
88990
  //#region ../blocks/src/system/runtime/shared/bookingPaymentOptions.ts
@@ -88573,6 +89317,17 @@ function buildSelectedSiteCreditPreview(input) {
88573
89317
  });
88574
89318
  }
88575
89319
 
89320
+ //#endregion
89321
+ //#region ../blocks/src/system/runtime/shared/onlineBookingUnavailable.ts
89322
+ /**
89323
+ * Said, for events and appointments alike, when a booking needs a card
89324
+ * payment the site can't take yet, so the client books with the business
89325
+ * instead. Shown with the business's published contact details.
89326
+ */
89327
+ function onlineBookingUnavailableMessage(businessName) {
89328
+ return `You can’t book this online yet. Please contact ${businessName?.trim() || "the organiser"} to book your place.`;
89329
+ }
89330
+
88576
89331
  //#endregion
88577
89332
  //#region ../blocks/src/system/runtime/nodes/event-registration/event-registration.headless.contract.ts
88578
89333
  const DEFAULT_EVENT_REGISTRATION_MAX_TICKETS = 5;
@@ -88600,13 +89355,6 @@ function toHeadlessPaymentSelection(selection) {
88600
89355
  method: "stripe",
88601
89356
  collectionOptionKind: selection.collectionOptionKind
88602
89357
  };
88603
- case "pass":
88604
- if (!selection.passId) return { method: "none" };
88605
- return {
88606
- method: "pass",
88607
- passId: selection.passId,
88608
- ...selection.productName ? { productName: selection.productName } : {}
88609
- };
88610
89358
  case "membership":
88611
89359
  if (!selection.membershipId) return { method: "none" };
88612
89360
  return {
@@ -88614,20 +89362,6 @@ function toHeadlessPaymentSelection(selection) {
88614
89362
  membershipId: selection.membershipId,
88615
89363
  ...selection.productName ? { productName: selection.productName } : {}
88616
89364
  };
88617
- case "pass_bundle":
88618
- if (!selection.bundlePassId) return { method: "none" };
88619
- return {
88620
- method: "pass_bundle",
88621
- passId: selection.bundlePassId,
88622
- ...selection.productName ? { productName: selection.productName } : {}
88623
- };
88624
- case "membership_bundle":
88625
- if (!selection.bundleMembershipId) return { method: "none" };
88626
- return {
88627
- method: "membership_bundle",
88628
- membershipId: selection.bundleMembershipId,
88629
- ...selection.productName ? { productName: selection.productName } : {}
88630
- };
88631
89365
  }
88632
89366
  }
88633
89367
  function toInternalPaymentSelection(selection) {
@@ -88638,26 +89372,11 @@ function toInternalPaymentSelection(selection) {
88638
89372
  method: "stripe",
88639
89373
  collectionOptionKind: selection.collectionOptionKind
88640
89374
  };
88641
- case "pass": return {
88642
- method: "pass",
88643
- passId: selection.passId,
88644
- ...selection.productName ? { productName: selection.productName } : {}
88645
- };
88646
89375
  case "membership": return {
88647
89376
  method: "membership",
88648
89377
  membershipId: selection.membershipId,
88649
89378
  ...selection.productName ? { productName: selection.productName } : {}
88650
89379
  };
88651
- case "pass_bundle": return {
88652
- method: "pass_bundle",
88653
- bundlePassId: selection.passId,
88654
- ...selection.productName ? { productName: selection.productName } : {}
88655
- };
88656
- case "membership_bundle": return {
88657
- method: "membership_bundle",
88658
- bundleMembershipId: selection.membershipId,
88659
- ...selection.productName ? { productName: selection.productName } : {}
88660
- };
88661
89380
  }
88662
89381
  }
88663
89382
  function resolveEventRegistrationSubmitPlan(input) {
@@ -88682,13 +89401,7 @@ function toSubmitArgs(selection) {
88682
89401
  switch (selection.method) {
88683
89402
  case "stripe":
88684
89403
  case "free": return { method: selection.method };
88685
- case "pass":
88686
- case "pass_bundle": return {
88687
- method: selection.method,
88688
- passId: selection.passId
88689
- };
88690
- case "membership":
88691
- case "membership_bundle": return {
89404
+ case "membership": return {
88692
89405
  method: selection.method,
88693
89406
  membershipId: selection.membershipId
88694
89407
  };
@@ -88789,7 +89502,7 @@ function resolveHeadlessEventRegistrationView(wizard) {
88789
89502
  }
88790
89503
  }
88791
89504
  function deriveEventRegistrationSteps(input) {
88792
- const needsPaymentStep = input.eventRequiresPayment && input.paymentSelection.method !== "pass" && input.paymentSelection.method !== "membership";
89505
+ const needsPaymentStep = input.eventRequiresPayment && input.paymentSelection.method !== "membership";
88793
89506
  const ids = [
88794
89507
  ...!input.hasPreSelectedContext ? ["select-event"] : [],
88795
89508
  "select-tickets",
@@ -88861,9 +89574,27 @@ function resolveRegistrationAdmission(input) {
88861
89574
  reason: "alreadyWaitlisted",
88862
89575
  message: "You're already on the waitlist for this event."
88863
89576
  };
88864
- return admissionFromAvailability(availability, input.isAuthenticated);
89577
+ const admission = admissionFromAvailability(availability, input.isAuthenticated, input.businessName);
89578
+ return admission.kind === "open" && input.severalRunsNeedCard ? admissionWithCardDue(input.eligibility.onlinePayments, input.businessName) : admission;
88865
89579
  }
88866
- function admissionFromAvailability(availability, isAuthenticated) {
89580
+ /** Several runs whose total has to go to card payment (issue 1725), priced from every run. */
89581
+ function severalRunsNeedCard(several, payment) {
89582
+ return several === "runs" && payment.kind === "several" && payment.due === "card";
89583
+ }
89584
+ /** An open selection that has to go to card payment, which the site may not be able to take. */
89585
+ function admissionWithCardDue(onlinePayments, businessName) {
89586
+ return onlinePayments?.kind === "unavailable" ? cannotBookOnline(businessName, onlinePayments.organiserContact) : { kind: "open" };
89587
+ }
89588
+ /** The site can't take this payment now, so the client books with the business instead. */
89589
+ function cannotBookOnline(businessName, contact$1) {
89590
+ return {
89591
+ kind: "closed",
89592
+ reason: "unavailable",
89593
+ message: onlineBookingUnavailableMessage(businessName),
89594
+ ...contact$1 ? { contact: contact$1 } : {}
89595
+ };
89596
+ }
89597
+ function admissionFromAvailability(availability, isAuthenticated, businessName) {
88867
89598
  switch (availability.kind) {
88868
89599
  case "available": return { kind: "open" };
88869
89600
  case "waitlist": return {
@@ -88875,11 +89606,7 @@ function admissionFromAvailability(availability, isAuthenticated) {
88875
89606
  kind: "fullyBooked",
88876
89607
  placesLeft: Math.max(0, availability.remainingPlaces ?? 0)
88877
89608
  };
88878
- case "paymentUnavailable": return {
88879
- kind: "closed",
88880
- reason: "unavailable",
88881
- message: "Payment options are not available for this event."
88882
- };
89609
+ case "paymentUnavailable": return cannotBookOnline(businessName, availability.organiserContact);
88883
89610
  case "selectionRequired": return { kind: "open" };
88884
89611
  case "bookingClosed": return {
88885
89612
  kind: "closed",
@@ -88919,6 +89646,22 @@ function settledRemainingPlaces(eligibility) {
88919
89646
  const availability = eligibility?.availability;
88920
89647
  return availability?.kind === "available" ? availability.remainingPlaces ?? null : null;
88921
89648
  }
89649
+ /** The primary button's words while admission is closed, where it shows at all (`registrationStopsHere`). */
89650
+ function closedAdmissionLabel(reason) {
89651
+ switch (reason) {
89652
+ case "alreadyWaitlisted": return "Already on waitlist";
89653
+ case "optionsUnavailable": return "Couldn’t load times";
89654
+ case "unavailable": return "Can’t book online";
89655
+ }
89656
+ }
89657
+ /**
89658
+ * This can't be booked online at all (the site can't take the payment, or
89659
+ * registration is closed): the notice says why and who to contact, so the
89660
+ * form shows no places to choose and no button to press.
89661
+ */
89662
+ function registrationStopsHere(admission) {
89663
+ return admission.kind === "closed" && admission.reason === "unavailable";
89664
+ }
88922
89665
  function resolveRegistrationAvailabilityBlocker(admission) {
88923
89666
  switch (admission.kind) {
88924
89667
  case "open":
@@ -89038,7 +89781,7 @@ function resolveRegistrationTicketContinuation(input) {
89038
89781
  };
89039
89782
  case "closed": return {
89040
89783
  kind: "blocked",
89041
- label: input.admission.reason === "alreadyWaitlisted" ? "Already on waitlist" : input.admission.reason === "optionsUnavailable" ? "Availability unavailable" : "Registration unavailable",
89784
+ label: closedAdmissionLabel(input.admission.reason),
89042
89785
  pending: false,
89043
89786
  message: input.admission.message
89044
89787
  };
@@ -89270,8 +90013,8 @@ function selectionPaymentPresentation(payment, eligibility) {
89270
90013
  /**
89271
90014
  * Label for the button that acts on the chosen payment method.
89272
90015
  *
89273
- * A pass redemption spends a credit the moment it is pressed, so the label
89274
- * names the pass instead of describing the step.
90016
+ * Dates paid with a pass or membership take their button from the funding
90017
+ * option instead.
89275
90018
  */
89276
90019
  function resolvePaymentButtonText(method, siteCreditPreview, eligibility, selectedDirectOption) {
89277
90020
  switch (method) {
@@ -89286,9 +90029,6 @@ function resolvePaymentButtonText(method, siteCreditPreview, eligibility, select
89286
90029
  }
89287
90030
  return `Book with ${formatPrice(siteCreditPreview.appliedCreditCents, eligibility.currency)} site credit`;
89288
90031
  }
89289
- case "pass": return "Book using class pass";
89290
- case "pass_bundle":
89291
- case "membership_bundle": return "Buy and book";
89292
90032
  case "free":
89293
90033
  case "membership":
89294
90034
  case null: return "Book your place";
@@ -89297,10 +90037,7 @@ function resolvePaymentButtonText(method, siteCreditPreview, eligibility, select
89297
90037
  function canContinueWithPaymentSelection(selection, directPaymentSelection) {
89298
90038
  switch (selection.method) {
89299
90039
  case "stripe": return directPaymentSelection.kind === "valid";
89300
- case "pass": return Boolean(selection.passId);
89301
90040
  case "membership": return Boolean(selection.membershipId);
89302
- case "pass_bundle": return Boolean(selection.bundlePassId);
89303
- case "membership_bundle": return Boolean(selection.bundleMembershipId);
89304
90041
  case "free": return true;
89305
90042
  case null: return false;
89306
90043
  }
@@ -89365,7 +90102,7 @@ function resetRegistrationDraft(session, hasPreSelectedContext) {
89365
90102
  completedOutcomes: session.completedOutcomes,
89366
90103
  spentClaim: session.spentClaim,
89367
90104
  eligibility: null,
89368
- passOptOut: false,
90105
+ roomFacts: null,
89369
90106
  paymentSelection: { method: null },
89370
90107
  selectionSource: "auto"
89371
90108
  };
@@ -89380,10 +90117,7 @@ function paymentSelectionIdentity(selection) {
89380
90117
  case null:
89381
90118
  case "free": return [selection.method, undefined];
89382
90119
  case "stripe": return [selection.method, selection.collectionOptionKind];
89383
- case "pass": return [selection.method, selection.passId];
89384
90120
  case "membership": return [selection.method, selection.membershipId];
89385
- case "pass_bundle": return [selection.method, selection.bundlePassId];
89386
- case "membership_bundle": return [selection.method, selection.bundleMembershipId];
89387
90121
  }
89388
90122
  }
89389
90123
  function normalizePaymentSelection(selection) {
@@ -89400,7 +90134,7 @@ function flowTicketsCount(state) {
89400
90134
  const { ticketsCount } = selectionTicketInputs({
89401
90135
  several: severalItemsOf(state.draft.selection),
89402
90136
  primary: state.draft.selection[0] ?? null,
89403
- lines: state.draft.selectedTicketLines,
90137
+ lines: draftBookingLines(state.draft, state.roomFacts),
89404
90138
  slidingAmountInput: state.draft.selectedSlidingAmountInput,
89405
90139
  placeCount: state.placeCount,
89406
90140
  runChoices: state.draft.runChoices,
@@ -89416,50 +90150,37 @@ function flowSelectionPayment(state) {
89416
90150
  eligibility: state.eligibility
89417
90151
  });
89418
90152
  }
89419
- /** Passes, memberships and bundles cover one item for one person. */
89420
- function entitlementsAllowed(state) {
89421
- return flowTicketsCount(state) === 1 && severalItemsOf(state.draft.selection) === null;
90153
+ /**
90154
+ * A membership covers one run for one person, so it's chosen for the visitor
90155
+ * then. Dates are paid with the server's funding options instead (issue 1767).
90156
+ */
90157
+ function membershipAllowed(state) {
90158
+ return flowTicketsCount(state) === 1 && severalItemsOf(state.draft.selection) === null && state.draft.selection[0]?.registrationSubject.kind === "wholeSeries";
89422
90159
  }
89423
90160
  function computeAutoSelection(state) {
89424
- const { isAuthenticated, eligibility, passOptOut } = state;
90161
+ const { isAuthenticated, eligibility } = state;
89425
90162
  if (!eligibility) return { method: null };
89426
90163
  const payment = flowSelectionPayment(state);
89427
90164
  if (payment.kind === "several") return payment.due === "nothing" ? { method: "free" } : { method: null };
89428
90165
  if (eligibility.isFree) return { method: "free" };
89429
- if (isAuthenticated && entitlementsAllowed(state)) {
89430
- const membership = eligibility.eligibleMemberships[0];
89431
- if (membership) {
89432
- return {
89433
- method: "membership",
89434
- membershipId: membership.id,
89435
- productName: membership.membershipName
89436
- };
89437
- }
89438
- const pass = eligibility.eligiblePasses[0];
89439
- if (pass && !passOptOut) {
89440
- return {
89441
- method: "pass",
89442
- passId: pass.id,
89443
- productName: pass.passName
89444
- };
89445
- }
89446
- }
89447
- return { method: null };
90166
+ const membership = isAuthenticated && membershipAllowed(state) ? eligibility.eligibleMemberships[0] : undefined;
90167
+ return membership ? {
90168
+ method: "membership",
90169
+ membershipId: membership.id,
90170
+ productName: membership.membershipName
90171
+ } : { method: null };
89448
90172
  }
89449
90173
  function isSelectionValid(input) {
89450
90174
  const { selection, isAuthenticated, eligibility } = input;
89451
90175
  if (!selection.method) return false;
89452
90176
  if (input.payment.kind === "several") return isSeveralItemsSelectionValid(selection, input.payment.due);
89453
90177
  if (!eligibility) {
89454
- return selection.method === "stripe" || selection.method === "pass_bundle" || selection.method === "membership_bundle";
90178
+ return selection.method === "stripe";
89455
90179
  }
89456
90180
  switch (selection.method) {
89457
90181
  case "free": return eligibility.isFree;
89458
90182
  case "stripe": return isCardSelectionValid(selection, eligibility);
89459
- case "pass":
89460
- case "membership":
89461
- case "pass_bundle":
89462
- case "membership_bundle": return input.entitlementsAllowed && isEntitlementSelectionValid(selection, eligibility, isAuthenticated);
90183
+ case "membership": return input.membershipAllowed && isAuthenticated && eligibility.eligibleMemberships.some((membership) => membership.id === selection.membershipId);
89463
90184
  default: return false;
89464
90185
  }
89465
90186
  }
@@ -89478,22 +90199,13 @@ function isCardSelectionValid(selection, eligibility) {
89478
90199
  if (!eligibility.requiresPayment || !eligibility.price) return false;
89479
90200
  return getApprovedDirectPaymentCollectionOptionKinds(eligibility.paymentOptions).includes(selection.collectionOptionKind);
89480
90201
  }
89481
- function isEntitlementSelectionValid(selection, eligibility, isAuthenticated) {
89482
- if ((selection.method === "pass" || selection.method === "membership") && !isAuthenticated) return false;
89483
- switch (selection.method) {
89484
- case "pass": return eligibility.eligiblePasses.some((pass) => pass.id === selection.passId);
89485
- case "membership": return eligibility.eligibleMemberships.some((membership) => membership.id === selection.membershipId);
89486
- case "pass_bundle": return eligibility.availablePasses.some((pass) => pass.id === selection.bundlePassId);
89487
- case "membership_bundle": return eligibility.availableMemberships.some((membership) => membership.id === selection.bundleMembershipId);
89488
- }
89489
- }
89490
90202
  function normalizeRegistrationFlowState(state) {
89491
90203
  const autoSelection = computeAutoSelection(state);
89492
90204
  const canKeepManualSelection = state.step !== "select-tickets" && state.selectionSource === "manual" && isSelectionValid({
89493
90205
  selection: state.paymentSelection,
89494
90206
  isAuthenticated: state.isAuthenticated,
89495
90207
  eligibility: state.eligibility,
89496
- entitlementsAllowed: entitlementsAllowed(state),
90208
+ membershipAllowed: membershipAllowed(state),
89497
90209
  payment: flowSelectionPayment(state)
89498
90210
  });
89499
90211
  const nextSelection = canKeepManualSelection ? state.paymentSelection : autoSelection;
@@ -89558,12 +90270,13 @@ function restorePaymentReturn(state, restoration) {
89558
90270
  selection: restoration.selection.length > 0 ? restoration.selection : state.draft.selection,
89559
90271
  runChoices: restoration.runChoices,
89560
90272
  selectedTicketLines: restoration.ticketLines.map((line) => ({ ...line })),
90273
+ roomChoices: restoration.roomChoices,
90274
+ reviewedRooms: restoration.reviewedRooms,
89561
90275
  selectedAttendanceMode: restoration.attendanceMode,
89562
90276
  selectedSlidingAmountInput: restoration.slidingAmountInput
89563
90277
  },
89564
90278
  paymentSelection: normalizePaymentSelection(restoration.paymentSelection),
89565
- selectionSource: "manual",
89566
- passOptOut: passOptOutAfterManualSelection(state, restoration.paymentSelection)
90279
+ selectionSource: "manual"
89567
90280
  };
89568
90281
  return isRegistrationLocked(state.step) ? restored : normalizeRegistrationFlowState(restored);
89569
90282
  }
@@ -89576,12 +90289,12 @@ function synchronizeRegistrationAuthentication(state, isAuthenticated) {
89576
90289
  return isRegistrationLocked(state.step) ? updated$1 : normalizeRegistrationFlowState(updated$1);
89577
90290
  }
89578
90291
  function isPaymentChoiceAction(action) {
89579
- return action.type === "set-manual-payment-selection" || action.type === "use-card-instead-of-pass" || action.type === "use-pass";
90292
+ return action.type === "set-manual-payment-selection";
89580
90293
  }
89581
90294
  /** Active navigation and draft updates share the same selection normalization. */
89582
90295
  function reduceActiveRegistration(state, action) {
89583
90296
  switch (action.type) {
89584
- case "browser-draft-restored": return normalizeRegistrationFlowState(restoreRegistrationBrowserDraft(state, action.draft, action.events));
90297
+ case "browser-draft-restored": return normalizeRegistrationFlowState(restoreRegistrationBrowserDraft(state, action.draft, action.events, action.identity));
89585
90298
  case "claim-arrived": {
89586
90299
  if (isSameWaitlistClaim(action.credential, state.spentClaim)) return state;
89587
90300
  const invitation = receiveWaitlistInvitation(state.invitation, action.credential);
@@ -89606,7 +90319,8 @@ function reduceActiveRegistration(state, action) {
89606
90319
  case "sign-in-draft-restored": return normalizeRegistrationFlowState(restoreEventSignInDraft(state, action.restoration));
89607
90320
  case "tickets-completed": return state.step === "select-tickets" ? normalizeRegistrationFlowState({
89608
90321
  ...state,
89609
- step: "enter-details"
90322
+ step: "enter-details",
90323
+ draft: withReviewedRooms(state.draft, state.roomFacts)
89610
90324
  }) : state;
89611
90325
  case "set-step": return isRegistrationLocked(action.step) ? {
89612
90326
  ...state,
@@ -89618,7 +90332,7 @@ function reduceActiveRegistration(state, action) {
89618
90332
  });
89619
90333
  case "reset": return resetRegistrationDraft(state, action.hasPreSelectedContext);
89620
90334
  case "set-tickets-count":
89621
- case "eligibility-updated": return normalizeRegistrationFlowState(updateRegistrationDraft(state, action));
90335
+ case "eligibility-updated": return normalizeRegistrationFlowState(backToRoomsWhenTheyveGone(updateRegistrationDraft(state, action)));
89622
90336
  case "event-continued": return action.navigation === "advance" ? {
89623
90337
  ...state,
89624
90338
  step: "select-tickets"
@@ -89670,6 +90384,7 @@ function applyRunRequirementsAction(state, action) {
89670
90384
  const SELECTION_FIELDS = new Set([
89671
90385
  "selection",
89672
90386
  "selectedTicketLines",
90387
+ "roomChoices",
89673
90388
  "runChoices"
89674
90389
  ]);
89675
90390
  function applyDraftEdit(state, edit) {
@@ -89718,6 +90433,20 @@ function isRegistrationLocked(step) {
89718
90433
  "payment-status"
89719
90434
  ].includes(step);
89720
90435
  }
90436
+ /** Steps after the rooms are chosen and before anything's submitted, where fresher room facts can still send the guest back. */
90437
+ const BEFORE_SUBMITTING = new Set(["enter-details", "select-payment"]);
90438
+ /**
90439
+ * Someone else took the room while this guest was on their details or payment. Their
90440
+ * choices stay as they were, and they go back to the rooms, which say what changed,
90441
+ * rather than carrying on with a booking that no longer has its room.
90442
+ */
90443
+ function backToRoomsWhenTheyveGone(state) {
90444
+ if (!BEFORE_SUBMITTING.has(state.step) || draftRoomsStillPlace(state.draft, state.roomFacts)) return state;
90445
+ return {
90446
+ ...state,
90447
+ step: "select-tickets"
90448
+ };
90449
+ }
89721
90450
  /** Draft edits change inputs; the existing selection owner normalizes their consequences. */
89722
90451
  function updateRegistrationDraft(state, action) {
89723
90452
  switch (action.type) {
@@ -89727,71 +90456,26 @@ function updateRegistrationDraft(state, action) {
89727
90456
  };
89728
90457
  case "eligibility-updated": return {
89729
90458
  ...state,
89730
- eligibility: action.eligibility
90459
+ eligibility: action.eligibility,
90460
+ roomFacts: action.eligibility?.rooms ?? state.roomFacts
89731
90461
  };
89732
90462
  default: return assertNever$4(action);
89733
90463
  }
89734
90464
  }
89735
- /**
89736
- * The pass the customer turned down, while it would otherwise cover this booking.
89737
- *
89738
- * The opt-out lasts for the whole booking; it only matters while a pass would
89739
- * be chosen automatically, so this is what offers the way back to it.
89740
- */
89741
- function getDeclinedPass(state) {
89742
- const paysDirectly = state.paymentSelection.method === "stripe" || state.paymentSelection.method === null;
89743
- return state.passOptOut && paysDirectly ? getOfferedPass(state) : null;
89744
- }
89745
- /** The pass auto-selection picks for this booking when the customer hasn't opted out. */
89746
- function getOfferedPass(state) {
89747
- const offered$1 = computeAutoSelection({
89748
- ...state,
89749
- passOptOut: false
89750
- });
89751
- return offered$1.method === "pass" ? offered$1 : null;
89752
- }
89753
- /**
89754
- * A manual card choice only opts out of a pass that was on offer; choosing the
89755
- * pass itself opts back in.
89756
- */
89757
- function passOptOutAfterManualSelection(state, selection) {
89758
- switch (selection.method) {
89759
- case "stripe": return state.passOptOut || getOfferedPass(state) !== null;
89760
- case "pass": return false;
89761
- case null:
89762
- case "free":
89763
- case "membership":
89764
- case "pass_bundle":
89765
- case "membership_bundle": return state.passOptOut;
89766
- }
89767
- }
90465
+ /** A run's membership books without a payment step. */
89768
90466
  function isEntitlementSelection(selection) {
89769
- return selection.method === "pass" || selection.method === "membership";
90467
+ return selection.method === "membership";
89770
90468
  }
89771
90469
  function requiresPaymentStep(params) {
89772
90470
  if (!params.eventRequiresPayment) return false;
89773
90471
  return !isEntitlementSelection(params.paymentSelection);
89774
90472
  }
89775
90473
  function reduceRegistrationPaymentChoice(state, action) {
89776
- switch (action.type) {
89777
- case "set-manual-payment-selection": return normalizeRegistrationFlowState({
89778
- ...state,
89779
- paymentSelection: normalizePaymentSelection(action.selection),
89780
- selectionSource: "manual",
89781
- passOptOut: passOptOutAfterManualSelection(state, action.selection)
89782
- });
89783
- case "use-card-instead-of-pass": return normalizeRegistrationFlowState({
89784
- ...state,
89785
- passOptOut: true,
89786
- paymentSelection: { method: null },
89787
- selectionSource: "manual"
89788
- });
89789
- case "use-pass": return normalizeRegistrationFlowState({
89790
- ...state,
89791
- passOptOut: false,
89792
- selectionSource: "auto"
89793
- });
89794
- }
90474
+ return normalizeRegistrationFlowState({
90475
+ ...state,
90476
+ paymentSelection: normalizePaymentSelection(action.selection),
90477
+ selectionSource: "manual"
90478
+ });
89795
90479
  }
89796
90480
  /** Only explicit navigation leaves a completed booking; draft refreshes retain it. */
89797
90481
  function reduceCompletedRegistration(state, action) {
@@ -89822,9 +90506,7 @@ function reduceCompletedRegistration(state, action) {
89822
90506
  case "tickets-completed":
89823
90507
  case "set-tickets-count":
89824
90508
  case "eligibility-updated":
89825
- case "set-manual-payment-selection":
89826
- case "use-card-instead-of-pass":
89827
- case "use-pass": return state;
90509
+ case "set-manual-payment-selection": return state;
89828
90510
  default: return assertNever$4(action);
89829
90511
  }
89830
90512
  }
@@ -89862,7 +90544,7 @@ function applyWaitlistClaimLookup(state, action) {
89862
90544
  case "awaitingEvents": return state;
89863
90545
  case "ready": return normalizeRegistrationFlowState({
89864
90546
  ...state,
89865
- placeCount: restoration.ticketsCount,
90547
+ placeCount: restoration.claimed.places,
89866
90548
  draft: restoreRegistrationDraft(state.draft, lookup.claim, restoration),
89867
90549
  invitation: {
89868
90550
  kind: "ready",
@@ -90012,6 +90694,7 @@ const REGISTRATION_STEP_LABELS = [
90012
90694
  "Dates",
90013
90695
  "Tickets",
90014
90696
  "Places",
90697
+ "Rooms",
90015
90698
  "Your details",
90016
90699
  "How you’ll pay",
90017
90700
  "Payment"
@@ -90032,7 +90715,8 @@ function registrationStepLabelContext(scopedEvents, bookedEvent) {
90032
90715
  const several = scopedEvents.every((event) => event.allowsMultipleBooking === true);
90033
90716
  return {
90034
90717
  eventSelection: mode === "date" && several ? "dates" : severalRuns(scopedEvents) ? "runs" : mode,
90035
- booksWholeSeries: bookedEvent?.registrationSubject.kind === "wholeSeries"
90718
+ booksWholeSeries: bookedEvent?.registrationSubject.kind === "wholeSeries",
90719
+ booksRooms: Boolean((bookedEvent ?? (scopedEvents.length === 1 ? scopedEvents[0] : null))?.rooms)
90036
90720
  };
90037
90721
  }
90038
90722
  /** One label owner for the live progress and the server placeholder. */
@@ -90044,7 +90728,9 @@ function registrationStepLabel(step, context) {
90044
90728
  case "runs": return "Choose what to book";
90045
90729
  case "event": return "Event";
90046
90730
  }
90047
- case "select-tickets": return context.booksWholeSeries ? "Places" : "Tickets";
90731
+ case "select-tickets":
90732
+ if (context.booksRooms) return "Rooms";
90733
+ return context.booksWholeSeries ? "Places" : "Tickets";
90048
90734
  case "enter-details": return "Your details";
90049
90735
  case "select-payment": return "How you’ll pay";
90050
90736
  case "payment": return "Payment";
@@ -91316,7 +92002,7 @@ function buildEventRegistrationShellBodyText(stepLabels) {
91316
92002
  if (stepLabels.includes("How you’ll pay")) {
91317
92003
  return "Preparing tickets, details, and payment options.";
91318
92004
  }
91319
- if (stepLabels[0] === "Tickets" || stepLabels[0] === "Places") {
92005
+ if (stepLabels[0] === "Tickets" || stepLabels[0] === "Places" || stepLabels[0] === "Rooms") {
91320
92006
  return "Preparing tickets and booking details.";
91321
92007
  }
91322
92008
  return "Preparing dates, tickets, and booking details.";
@@ -95225,208 +95911,11 @@ function cardItemSlotParents(arrangement) {
95225
95911
  "item-media": "item",
95226
95912
  dates: body,
95227
95913
  date,
95228
- availability: body
95914
+ availability: body,
95915
+ facts: body
95229
95916
  };
95230
95917
  }
95231
95918
 
95232
- //#endregion
95233
- //#region ../blocks/src/system/runtime/nodes/svg.tsx
95234
- /**
95235
- * Strict SVG-`transform` validator.
95236
- *
95237
- * Accepts only a whitespace/comma-separated list of the geometric transform
95238
- * functions (`translate`/`rotate`/`scale`/`skewX`/`skewY`/`matrix`) whose
95239
- * arguments are plain numbers. This deliberately rejects anything else —
95240
- * `url(...)`, CSS functions, `javascript:`, angle/length units, stray letters —
95241
- * so a persisted custom-block tree can't smuggle an executable or exfiltrating
95242
- * value into the attribute.
95243
- */
95244
- const TRANSFORM_NUMBER = String.raw`-?(?:\d+\.?\d*|\.\d+)(?:e-?\d+)?`;
95245
- const TRANSFORM_ARGS = String.raw`${TRANSFORM_NUMBER}(?:[\s,]+${TRANSFORM_NUMBER})*`;
95246
- const TRANSFORM_FN = String.raw`(?:translate|rotate|scale|skewX|skewY|matrix)\(\s*${TRANSFORM_ARGS}\s*\)`;
95247
- const SAFE_TRANSFORM_RE = new RegExp(String.raw`^\s*${TRANSFORM_FN}(?:[\s,]*${TRANSFORM_FN})*\s*$`);
95248
- function safeTransform(value) {
95249
- if (typeof value !== "string") return undefined;
95250
- const trimmed = value.trim();
95251
- if (trimmed.length === 0) return undefined;
95252
- return SAFE_TRANSFORM_RE.test(trimmed) ? trimmed : undefined;
95253
- }
95254
- /**
95255
- * Turn paint props into a CSS style object. Colour values pass through as-is so
95256
- * they may reference theme tokens via `var()`, which only resolves in a CSS
95257
- * property context (not in a bare presentation attribute).
95258
- */
95259
- function paintStyle(shape) {
95260
- const style = {};
95261
- if (shape.fill !== undefined) style.fill = shape.fill;
95262
- if (shape.stroke !== undefined) style.stroke = shape.stroke;
95263
- if (shape.strokeWidth !== undefined) style.strokeWidth = shape.strokeWidth;
95264
- if (shape.fillOpacity !== undefined) style.fillOpacity = shape.fillOpacity;
95265
- if (shape.strokeOpacity !== undefined) style.strokeOpacity = shape.strokeOpacity;
95266
- if (shape.strokeLinecap !== undefined) style.strokeLinecap = shape.strokeLinecap;
95267
- if (shape.strokeLinejoin !== undefined) style.strokeLinejoin = shape.strokeLinejoin;
95268
- if (shape.strokeDasharray !== undefined) style.strokeDasharray = shape.strokeDasharray;
95269
- return style;
95270
- }
95271
- function renderShape(shape, key) {
95272
- const style = paintStyle(shape);
95273
- const transform = safeTransform(shape.transform);
95274
- switch (shape.kind) {
95275
- case "text": return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", {
95276
- className: shape.className,
95277
- x: shape.x,
95278
- y: shape.y,
95279
- transform,
95280
- children: shape.text
95281
- }, key);
95282
- case "path": return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", {
95283
- d: shape.d,
95284
- className: shape.className,
95285
- fillRule: shape.fillRule,
95286
- style,
95287
- transform
95288
- }, key);
95289
- case "ellipse": return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("ellipse", {
95290
- cx: shape.cx,
95291
- cy: shape.cy,
95292
- rx: shape.rx,
95293
- ry: shape.ry,
95294
- style,
95295
- transform
95296
- }, key);
95297
- case "circle": return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", {
95298
- cx: shape.cx,
95299
- cy: shape.cy,
95300
- r: shape.r,
95301
- style,
95302
- transform
95303
- }, key);
95304
- case "rect": return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", {
95305
- x: shape.x,
95306
- y: shape.y,
95307
- className: shape.className,
95308
- width: shape.width,
95309
- height: shape.height,
95310
- rx: shape.rx,
95311
- ry: shape.ry,
95312
- style,
95313
- transform
95314
- }, key);
95315
- case "line": return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("line", {
95316
- x1: shape.x1,
95317
- y1: shape.y1,
95318
- x2: shape.x2,
95319
- y2: shape.y2,
95320
- style,
95321
- transform
95322
- }, key);
95323
- default: return null;
95324
- }
95325
- }
95326
- const SvgNode = ({ blockId: _blockId, blockKind: _blockKind, blockContent: _blockContent, fragmentRegistry: _fragmentRegistry, pathBase: _pathBase, viewBox, width, height, className, style, ariaHidden = true, ariaLabel, shapes }) => {
95327
- const safeShapes = Array.isArray(shapes) ? shapes : [];
95328
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", {
95329
- viewBox,
95330
- width,
95331
- height,
95332
- className,
95333
- style,
95334
- "aria-hidden": ariaHidden || undefined,
95335
- role: ariaLabel ? "img" : undefined,
95336
- "aria-label": ariaLabel,
95337
- xmlns: "http://www.w3.org/2000/svg",
95338
- fill: "none",
95339
- children: safeShapes.map((shape, index) => renderShape(shape, index))
95340
- });
95341
- };
95342
-
95343
- //#endregion
95344
- //#region ../blocks/src/system/runtime/nodes/shared/MapDrawingSvg.tsx
95345
- const PIN_PATH = "M0 0C-3.5-9-13-15-13-25A13 13 0 1 1 13-25C13-15 3.5-9 0 0ZM0-20.5A4.5 4.5 0 1 0 0-29.5A4.5 4.5 0 1 0 0-20.5Z";
95346
- const commands = (points) => points.map(([x$1, y$1], index) => `${index ? "L" : "M"}${x$1} ${y$1}`).join(" ");
95347
- function pathShape(path$3) {
95348
- return path$3.kind === "polygon" ? {
95349
- kind: "path",
95350
- className: path$3.className,
95351
- fillRule: path$3.fillRule,
95352
- d: path$3.rings.map((ring) => `${commands(ring)} Z`).join(" ")
95353
- } : {
95354
- kind: "path",
95355
- className: path$3.className,
95356
- d: commands(path$3.points)
95357
- };
95358
- }
95359
- function labelShapes(label$1) {
95360
- const [x$1, y$1] = label$1.point, transform = `rotate(${label$1.angle} ${x$1} ${y$1})`;
95361
- return [label$1.haloClassName, label$1.className].map((className) => ({
95362
- kind: "text",
95363
- className,
95364
- x: x$1,
95365
- y: y$1,
95366
- transform,
95367
- text: label$1.text
95368
- }));
95369
- }
95370
- /** The drawing the renderer below would show, or null when there's nothing it can draw. */
95371
- function readableMapDrawing(drawing) {
95372
- const parsed = mapDrawingSchema.safeParse(drawing);
95373
- return parsed.success ? parsed.data : null;
95374
- }
95375
- /** Untrusted standalone callers retain boundary admission. */
95376
- function MapDrawingSvg(props$1) {
95377
- const drawing = readableMapDrawing(props$1.drawing);
95378
- return drawing ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AdmittedMapDrawingSvg, {
95379
- ...props$1,
95380
- drawing
95381
- }) : null;
95382
- }
95383
- /** Render an already admitted value without allocating another validation copy. */
95384
- function AdmittedMapDrawingSvg(props$1) {
95385
- const drawing = props$1.drawing;
95386
- const name = props$1.wider ? "wider" : "neighbourhood", frame = drawing.frames[name];
95387
- const shapes = [
95388
- {
95389
- kind: "rect",
95390
- className: frame.backgroundClass,
95391
- x: 0,
95392
- y: 0,
95393
- width: 800,
95394
- height: 800
95395
- },
95396
- ...frame.paths.map(pathShape),
95397
- ...frame.labels.flatMap(labelShapes),
95398
- {
95399
- kind: "path",
95400
- className: frame.pin.className,
95401
- fillRule: "evenodd",
95402
- d: PIN_PATH,
95403
- transform: `translate(${frame.pin.point.join(" ")})`
95404
- }
95405
- ];
95406
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("figure", {
95407
- className: `rb-map-drawing ${props$1.className ?? ""}`.trim(),
95408
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
95409
- className: "rb-map-drawing-crop",
95410
- style: cropHeightStyle(Math.max(255, props$1.height ?? 320), props$1.heightAs ?? "fixed"),
95411
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SvgNode, {
95412
- className: `map-${name}`,
95413
- viewBox: frame.viewBox.join(" "),
95414
- shapes,
95415
- ariaHidden: false,
95416
- ariaLabel: props$1.label ? `Map showing ${props$1.label}` : "Map showing the arrival pin"
95417
- })
95418
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("figcaption", { children: ["© ", /* @__PURE__ */ (0, import_jsx_runtime.jsx)("a", {
95419
- href: "https://www.openstreetmap.org/copyright",
95420
- target: "_blank",
95421
- rel: "noreferrer",
95422
- children: "OpenStreetMap contributors"
95423
- })] })]
95424
- });
95425
- }
95426
- function cropHeightStyle(height, heightAs) {
95427
- return heightAs === "minimum" ? { minHeight: height } : { height };
95428
- }
95429
-
95430
95919
  //#endregion
95431
95920
  //#region ../blocks/src/system/runtime/nodes/events/shared/EventCard.tsx
95432
95921
  /**
@@ -95483,7 +95972,7 @@ const EventCard = ({ event, cardRole = "default", buttonVariant = "primary", but
95483
95972
  formattedTime,
95484
95973
  hasImage,
95485
95974
  headingLevel: cardHeadingLevel,
95486
- mapSlot: resolveVenueMapSlot(event.venue, mapSlot),
95975
+ mapSlot,
95487
95976
  priceText,
95488
95977
  showMap,
95489
95978
  showSummary,
@@ -95495,13 +95984,6 @@ const EventCard = ({ event, cardRole = "default", buttonVariant = "primary", but
95495
95984
  })]
95496
95985
  });
95497
95986
  };
95498
- function resolveVenueMapSlot(venue, override) {
95499
- return override ?? (venue?.drawing ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MapDrawingSvg, {
95500
- drawing: venue.drawing,
95501
- label: venue.name,
95502
- height: 255
95503
- }) : null);
95504
- }
95505
95987
  function EventCardMedia(props$1) {
95506
95988
  if (props$1.lookPresentation.lookSlots !== undefined) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EventLookDate, {
95507
95989
  event: props$1.event,
@@ -103973,7 +104455,11 @@ const teamMemberDataSchema = z.object({
103973
104455
  photo: teamMemberPhotoSchema,
103974
104456
  profilePath: z.string().nullable(),
103975
104457
  specialties: z.array(z.string()).optional(),
103976
- profileBio: RichTextDocSchema.nullable().optional()
104458
+ profileBio: RichTextDocSchema.nullable().optional(),
104459
+ facts: z.array(z.object({
104460
+ label: z.string(),
104461
+ value: z.string()
104462
+ })).readonly().optional()
103977
104463
  });
103978
104464
  const teamMembersDataSchema = z.array(teamMemberDataSchema);
103979
104465
  const dynamicSourceWhen = { equals: "site_staff" };
@@ -104146,6 +104632,7 @@ const cardListVariant = styledSection({
104146
104632
  el("team-members", {
104147
104633
  ...cardListPresentationBindings,
104148
104634
  biographySource: { $bind: { from: "content._effectiveLook.look.structure.teamBiography" } },
104635
+ teamFacts: { $bind: { from: "content._effectiveLook.look.structure.teamFacts" } },
104149
104636
  onePerson: { $bind: { from: "content.onePerson" } },
104150
104637
  cardBiography: { $bind: { from: "content.cardBiography" } },
104151
104638
  source: { $bind: {
@@ -106356,6 +106843,7 @@ function presentPublicBlock(block) {
106356
106843
  id: block.id,
106357
106844
  kind: block.kind,
106358
106845
  purpose: block.purpose,
106846
+ ...block.identifier ? { identifier: block.identifier } : {},
106359
106847
  ...block.contentVersionId ? { contentVersionId: block.contentVersionId } : {},
106360
106848
  ...block.draftContentId !== undefined ? { draftContentId: block.draftContentId } : {},
106361
106849
  publishedPlacement: block.publishedPlacement,
@@ -107276,7 +107764,7 @@ function eventHeaderContent(selection, show) {
107276
107764
  label: "Time",
107277
107765
  value: timeRange
107278
107766
  },
107279
- ...show.cost ? (item.facts ?? []).filter(({ label: label$1 }) => label$1 === "Price").map((fact) => withDepositNote(fact, event)) : [],
107767
+ ...show.cost ? (item.facts ?? []).filter(({ label: label$1 }) => label$1 === "Price").map((fact) => withDepositNote(fact, selection)) : [],
107280
107768
  ...groupSize === null ? [] : [{
107281
107769
  label: "Group size",
107282
107770
  value: groupSize
@@ -107285,9 +107773,9 @@ function eventHeaderContent(selection, show) {
107285
107773
  action: headerAction(selection, item.action)
107286
107774
  };
107287
107775
  }
107288
- /** The page states a deposit option beside the price, so it isn't first seen at checkout. */
107289
- function withDepositNote(fact, event) {
107290
- const note = formatEventDepositNote(event.pricing, event.paymentTerms, event);
107776
+ /** The page says how booking is paid beside the price, so a deposit isn't first seen (or missed) at checkout. */
107777
+ function withDepositNote(fact, selection) {
107778
+ const note = formatEventDepositNote(selection.depositOffer);
107291
107779
  return note ? {
107292
107780
  ...fact,
107293
107781
  value: `${fact.value}, ${note}`
@@ -109300,6 +109788,204 @@ function LocationMapActions(props$1) {
109300
109788
  }) }) : null;
109301
109789
  }
109302
109790
 
109791
+ //#endregion
109792
+ //#region ../blocks/src/system/runtime/nodes/svg.tsx
109793
+ /**
109794
+ * Strict SVG-`transform` validator.
109795
+ *
109796
+ * Accepts only a whitespace/comma-separated list of the geometric transform
109797
+ * functions (`translate`/`rotate`/`scale`/`skewX`/`skewY`/`matrix`) whose
109798
+ * arguments are plain numbers. This deliberately rejects anything else —
109799
+ * `url(...)`, CSS functions, `javascript:`, angle/length units, stray letters —
109800
+ * so a persisted custom-block tree can't smuggle an executable or exfiltrating
109801
+ * value into the attribute.
109802
+ */
109803
+ const TRANSFORM_NUMBER = String.raw`-?(?:\d+\.?\d*|\.\d+)(?:e-?\d+)?`;
109804
+ const TRANSFORM_ARGS = String.raw`${TRANSFORM_NUMBER}(?:[\s,]+${TRANSFORM_NUMBER})*`;
109805
+ const TRANSFORM_FN = String.raw`(?:translate|rotate|scale|skewX|skewY|matrix)\(\s*${TRANSFORM_ARGS}\s*\)`;
109806
+ const SAFE_TRANSFORM_RE = new RegExp(String.raw`^\s*${TRANSFORM_FN}(?:[\s,]*${TRANSFORM_FN})*\s*$`);
109807
+ function safeTransform(value) {
109808
+ if (typeof value !== "string") return undefined;
109809
+ const trimmed = value.trim();
109810
+ if (trimmed.length === 0) return undefined;
109811
+ return SAFE_TRANSFORM_RE.test(trimmed) ? trimmed : undefined;
109812
+ }
109813
+ /**
109814
+ * Turn paint props into a CSS style object. Colour values pass through as-is so
109815
+ * they may reference theme tokens via `var()`, which only resolves in a CSS
109816
+ * property context (not in a bare presentation attribute).
109817
+ */
109818
+ function paintStyle(shape) {
109819
+ const style = {};
109820
+ if (shape.fill !== undefined) style.fill = shape.fill;
109821
+ if (shape.stroke !== undefined) style.stroke = shape.stroke;
109822
+ if (shape.strokeWidth !== undefined) style.strokeWidth = shape.strokeWidth;
109823
+ if (shape.fillOpacity !== undefined) style.fillOpacity = shape.fillOpacity;
109824
+ if (shape.strokeOpacity !== undefined) style.strokeOpacity = shape.strokeOpacity;
109825
+ if (shape.strokeLinecap !== undefined) style.strokeLinecap = shape.strokeLinecap;
109826
+ if (shape.strokeLinejoin !== undefined) style.strokeLinejoin = shape.strokeLinejoin;
109827
+ if (shape.strokeDasharray !== undefined) style.strokeDasharray = shape.strokeDasharray;
109828
+ return style;
109829
+ }
109830
+ function renderShape(shape, key) {
109831
+ const style = paintStyle(shape);
109832
+ const transform = safeTransform(shape.transform);
109833
+ switch (shape.kind) {
109834
+ case "text": return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", {
109835
+ className: shape.className,
109836
+ x: shape.x,
109837
+ y: shape.y,
109838
+ transform,
109839
+ children: shape.text
109840
+ }, key);
109841
+ case "path": return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", {
109842
+ d: shape.d,
109843
+ className: shape.className,
109844
+ fillRule: shape.fillRule,
109845
+ style,
109846
+ transform
109847
+ }, key);
109848
+ case "ellipse": return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("ellipse", {
109849
+ cx: shape.cx,
109850
+ cy: shape.cy,
109851
+ rx: shape.rx,
109852
+ ry: shape.ry,
109853
+ style,
109854
+ transform
109855
+ }, key);
109856
+ case "circle": return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", {
109857
+ cx: shape.cx,
109858
+ cy: shape.cy,
109859
+ r: shape.r,
109860
+ style,
109861
+ transform
109862
+ }, key);
109863
+ case "rect": return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", {
109864
+ x: shape.x,
109865
+ y: shape.y,
109866
+ className: shape.className,
109867
+ width: shape.width,
109868
+ height: shape.height,
109869
+ rx: shape.rx,
109870
+ ry: shape.ry,
109871
+ style,
109872
+ transform
109873
+ }, key);
109874
+ case "line": return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("line", {
109875
+ x1: shape.x1,
109876
+ y1: shape.y1,
109877
+ x2: shape.x2,
109878
+ y2: shape.y2,
109879
+ style,
109880
+ transform
109881
+ }, key);
109882
+ default: return null;
109883
+ }
109884
+ }
109885
+ const SvgNode = ({ blockId: _blockId, blockKind: _blockKind, blockContent: _blockContent, fragmentRegistry: _fragmentRegistry, pathBase: _pathBase, viewBox, width, height, className, style, ariaHidden = true, ariaLabel, shapes }) => {
109886
+ const safeShapes = Array.isArray(shapes) ? shapes : [];
109887
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", {
109888
+ viewBox,
109889
+ width,
109890
+ height,
109891
+ className,
109892
+ style,
109893
+ "aria-hidden": ariaHidden || undefined,
109894
+ role: ariaLabel ? "img" : undefined,
109895
+ "aria-label": ariaLabel,
109896
+ xmlns: "http://www.w3.org/2000/svg",
109897
+ fill: "none",
109898
+ children: safeShapes.map((shape, index) => renderShape(shape, index))
109899
+ });
109900
+ };
109901
+
109902
+ //#endregion
109903
+ //#region ../blocks/src/system/runtime/nodes/shared/MapDrawingSvg.tsx
109904
+ const PIN_PATH = "M0 0C-3.5-9-13-15-13-25A13 13 0 1 1 13-25C13-15 3.5-9 0 0ZM0-20.5A4.5 4.5 0 1 0 0-29.5A4.5 4.5 0 1 0 0-20.5Z";
109905
+ const commands = (points) => points.map(([x$1, y$1], index) => `${index ? "L" : "M"}${x$1} ${y$1}`).join(" ");
109906
+ function pathShape(path$3) {
109907
+ return path$3.kind === "polygon" ? {
109908
+ kind: "path",
109909
+ className: path$3.className,
109910
+ fillRule: path$3.fillRule,
109911
+ d: path$3.rings.map((ring) => `${commands(ring)} Z`).join(" ")
109912
+ } : {
109913
+ kind: "path",
109914
+ className: path$3.className,
109915
+ d: commands(path$3.points)
109916
+ };
109917
+ }
109918
+ function labelShapes(label$1) {
109919
+ const [x$1, y$1] = label$1.point, transform = `rotate(${label$1.angle} ${x$1} ${y$1})`;
109920
+ return [label$1.haloClassName, label$1.className].map((className) => ({
109921
+ kind: "text",
109922
+ className,
109923
+ x: x$1,
109924
+ y: y$1,
109925
+ transform,
109926
+ text: label$1.text
109927
+ }));
109928
+ }
109929
+ /** The drawing the renderer below would show, or null when there's nothing it can draw. */
109930
+ function readableMapDrawing(drawing) {
109931
+ const parsed = mapDrawingSchema.safeParse(drawing);
109932
+ return parsed.success ? parsed.data : null;
109933
+ }
109934
+ /** Untrusted standalone callers retain boundary admission. */
109935
+ function MapDrawingSvg(props$1) {
109936
+ const drawing = readableMapDrawing(props$1.drawing);
109937
+ return drawing ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AdmittedMapDrawingSvg, {
109938
+ ...props$1,
109939
+ drawing
109940
+ }) : null;
109941
+ }
109942
+ /** Render an already admitted value without allocating another validation copy. */
109943
+ function AdmittedMapDrawingSvg(props$1) {
109944
+ const drawing = props$1.drawing;
109945
+ const name = props$1.wider ? "wider" : "neighbourhood", frame = drawing.frames[name];
109946
+ const shapes = [
109947
+ {
109948
+ kind: "rect",
109949
+ className: frame.backgroundClass,
109950
+ x: 0,
109951
+ y: 0,
109952
+ width: 800,
109953
+ height: 800
109954
+ },
109955
+ ...frame.paths.map(pathShape),
109956
+ ...frame.labels.flatMap(labelShapes),
109957
+ {
109958
+ kind: "path",
109959
+ className: frame.pin.className,
109960
+ fillRule: "evenodd",
109961
+ d: PIN_PATH,
109962
+ transform: `translate(${frame.pin.point.join(" ")})`
109963
+ }
109964
+ ];
109965
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("figure", {
109966
+ className: `rb-map-drawing ${props$1.className ?? ""}`.trim(),
109967
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
109968
+ className: "rb-map-drawing-crop",
109969
+ style: cropHeightStyle(Math.max(255, props$1.height ?? 320), props$1.heightAs ?? "fixed"),
109970
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SvgNode, {
109971
+ className: `map-${name}`,
109972
+ viewBox: frame.viewBox.join(" "),
109973
+ shapes,
109974
+ ariaHidden: false,
109975
+ ariaLabel: props$1.label ? `Map showing ${props$1.label}` : "Map showing the arrival pin"
109976
+ })
109977
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("figcaption", { children: ["© ", /* @__PURE__ */ (0, import_jsx_runtime.jsx)("a", {
109978
+ href: "https://www.openstreetmap.org/copyright",
109979
+ target: "_blank",
109980
+ rel: "noreferrer",
109981
+ children: "OpenStreetMap contributors"
109982
+ })] })]
109983
+ });
109984
+ }
109985
+ function cropHeightStyle(height, heightAs) {
109986
+ return heightAs === "minimum" ? { minHeight: height } : { height };
109987
+ }
109988
+
109303
109989
  //#endregion
109304
109990
  //#region ../blocks/src/system/runtime/nodes/location-map.view.tsx
109305
109991
  function OpeningHoursTable({ hours: hours$1, lookLayout }) {
@@ -110880,21 +111566,55 @@ const teamMemberCardSchema = z.object({
110880
111566
  photo: runtimeMediaSchema.refine((value) => value.type === "image").nullish(),
110881
111567
  summary: z.string().nullish(),
110882
111568
  profilePath: z.string().nullish(),
110883
- specialties: z.unknown().transform(parseTeamMemberSpecialties)
111569
+ specialties: z.unknown().transform(parseTeamMemberSpecialties),
111570
+ facts: z.array(z.object({
111571
+ label: z.string(),
111572
+ value: z.string()
111573
+ })).nullish()
110884
111574
  });
110885
- /** Staff and manual members meet at one boundary; Look data chooses biography length. */
110886
- function teamMemberCardContent(member$1, index, biographySource, cardBiography) {
110887
- const biography = cardBiography === "any" ? cardText(teamMemberCardBiography(member$1)) : biographySource === "profile" && member$1.profileBio ? member$1.profileBio : member$1.bio;
110888
- const href = sanitizeHref(member$1.profilePath);
111575
+ /**
111576
+ * Staff and manual members meet at one boundary, and this is the one place
111577
+ * that decides what a person's card says and where. Look data chooses the bio's
111578
+ * length, and whether the facts are the person's own quick facts (with the role
111579
+ * above the name, after the bio, and no link to a profile) or the role on its own.
111580
+ */
111581
+ function teamMemberCards(members, choices = {}) {
110889
111582
  return {
111583
+ items: members.map((member$1, index) => teamMemberCardContent(member$1, index, choices)),
111584
+ bodyParts: choices.teamFacts === "person" ? [
111585
+ "title",
111586
+ "text",
111587
+ "facts"
111588
+ ] : [
111589
+ "title",
111590
+ "facts",
111591
+ "text",
111592
+ "chips",
111593
+ "action"
111594
+ ]
111595
+ };
111596
+ }
111597
+ function teamMemberCardContent(member$1, index, choices) {
111598
+ const biography = cardBiographyFor(member$1, choices);
111599
+ const role = member$1.role ? [{
111600
+ label: "Role",
111601
+ value: member$1.role
111602
+ }] : [];
111603
+ const card = {
110890
111604
  id: member$1.id ?? `member-${index}`,
110891
111605
  title: member$1.name,
110892
111606
  media: member$1.photo,
110893
- ...typeof biography === "string" ? { text: biography } : { textDocument: biography ?? undefined },
110894
- facts: member$1.role ? [{
110895
- label: "Role",
110896
- value: member$1.role
110897
- }] : [],
111607
+ ...typeof biography === "string" ? { text: biography } : { textDocument: biography ?? undefined }
111608
+ };
111609
+ if (choices.teamFacts === "person") return {
111610
+ ...card,
111611
+ eyebrowFacts: role,
111612
+ facts: member$1.facts ?? []
111613
+ };
111614
+ const href = sanitizeHref(member$1.profilePath);
111615
+ return {
111616
+ ...card,
111617
+ facts: role,
110898
111618
  chips: member$1.specialties,
110899
111619
  ...href ? { action: {
110900
111620
  label: `About ${member$1.name}`,
@@ -110902,6 +111622,10 @@ function teamMemberCardContent(member$1, index, biographySource, cardBiography)
110902
111622
  } } : {}
110903
111623
  };
110904
111624
  }
111625
+ function cardBiographyFor(member$1, choices) {
111626
+ if (choices.cardBiography === "any") return cardText(teamMemberCardBiography(member$1));
111627
+ return choices.biographySource === "profile" && member$1.profileBio ? member$1.profileBio : member$1.bio;
111628
+ }
110905
111629
  function cardText(biography) {
110906
111630
  if (!biography) return null;
110907
111631
  return biography.kind === "document" ? biography.document : biography.paragraphs.join("\n\n");
@@ -110977,18 +111701,13 @@ function TeamMembersNode(props$1) {
110977
111701
  ...about,
110978
111702
  props: props$1
110979
111703
  });
111704
+ const cards = teamMemberCards(parsed.data, props$1);
110980
111705
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CardListItems, {
110981
111706
  Carousel: props$1.Carousel,
110982
- items: parsed.data.map((member$1, index) => teamMemberCardContent(member$1, index, props$1.biographySource, props$1.cardBiography)),
111707
+ items: cards.items,
110983
111708
  presentation: {
110984
111709
  ...props$1,
110985
- bodyParts: [
110986
- "title",
110987
- "facts",
110988
- "text",
110989
- "chips",
110990
- "action"
110991
- ]
111710
+ bodyParts: cards.bodyParts
110992
111711
  },
110993
111712
  Title: props$1.sectionHeading?.trim() ? "h3" : "h2",
110994
111713
  carouselLabels: {
@@ -111011,7 +111730,21 @@ function BookingPanelArrangement({ pageKind, children }) {
111011
111730
 
111012
111731
  //#endregion
111013
111732
  //#region ../blocks/src/system/runtime/nodes/booking-form.service-pricing.ts
111733
+ /**
111734
+ * The amounts the client can choose for a sliding-scale service. A site that
111735
+ * can't take cards yet (the server says `pending_stripe_setup`) can only take
111736
+ * the free end of the scale online, so a scale that starts at nothing narrows
111737
+ * to nothing; one that starts higher stays as it is and needs a card.
111738
+ */
111014
111739
  function getBookingServiceSlidingScale(service) {
111740
+ const scale$1 = configuredSlidingScale(service);
111741
+ return scale$1 && scale$1.minAmount === 0 && service?.paymentTermsAvailability?.kind === "pending_stripe_setup" ? {
111742
+ ...scale$1,
111743
+ maxAmount: 0,
111744
+ suggestedAmount: 0
111745
+ } : scale$1;
111746
+ }
111747
+ function configuredSlidingScale(service) {
111015
111748
  const pricing = service?.pricing;
111016
111749
  if (!pricing || pricing.pricingStrategy !== "sliding_scale" || pricing.slidingMinAmount === null || pricing.slidingMinAmount === undefined || pricing.slidingMaxAmount === null || pricing.slidingMaxAmount === undefined) {
111017
111750
  return null;
@@ -111056,11 +111789,15 @@ function resolveBookingPurchasablePackages(enabled, state) {
111056
111789
  }
111057
111790
  }
111058
111791
  function resolveBookingPaymentAvailability(perSession, held, purchase) {
111059
- if (perSession || held.items.length > 0 || purchase.kind === "ready" && purchase.items.length > 0) return { kind: "available" };
111792
+ if (perSession || heldPackagesOffered(held) || purchase.kind === "ready" && purchase.items.length > 0) return { kind: "available" };
111060
111793
  if (held.kind === "loading" || held.kind === "idle" || purchase.kind === "loading") return { kind: "loading" };
111061
111794
  if (held.kind === "error" || purchase.kind === "error") return { kind: "load_error" };
111062
111795
  return { kind: "no_choices" };
111063
111796
  }
111797
+ /** Packages held with one team member count: the payment step offers to book with them. */
111798
+ function heldPackagesOffered(held) {
111799
+ return held.items.length > 0 || held.kind === "ready" && held.heldWithTeamMembers.length > 0;
111800
+ }
111064
111801
  /** Disclose the package's purchase price; server settlement may require a review for discounts or credit. */
111065
111802
  function bookingPackagePurchaseTerms(product, promisedDiscountId) {
111066
111803
  return {
@@ -111102,10 +111839,20 @@ function resolveBookingPackageSources(service, enabled, bearerAuth) {
111102
111839
  const packageOnly = service?.onlinePaymentChoices?.perSession === false;
111103
111840
  return {
111104
111841
  packageOnly,
111105
- held: resolveHeldPackageSource(service, service?.onlinePaymentChoices?.heldPackage !== false && (enabled || packageOnly), bearerAuth),
111842
+ held: resolveHeldPackageSource(service, serviceOffersHeldPackages(service, enabled || packageOnly, bearerAuth), bearerAuth),
111106
111843
  canBuy: service?.onlinePaymentChoices?.buyPackage === true
111107
111844
  };
111108
111845
  }
111846
+ /**
111847
+ * Whether the client's own packages are offered for this service at all.
111848
+ * Forms turn packages on once the client is signed in, so signed out, a
111849
+ * service that says it takes them still counts: signing in may let them pay
111850
+ * with one.
111851
+ */
111852
+ function serviceOffersHeldPackages(service, enabled, bearerAuth) {
111853
+ const heldPackage = service?.onlinePaymentChoices?.heldPackage;
111854
+ return heldPackage !== false && (enabled || !bearerAuth && heldPackage === true);
111855
+ }
111109
111856
  function resolveHeldPackageSource(service, enabled, bearerAuth) {
111110
111857
  if (!enabled) return "disabled";
111111
111858
  if (!heldPackageServiceEligible(service)) return "missing-priced-service";
@@ -111126,7 +111873,7 @@ function bookingPackageRequestKey(enabled, serviceId, resourceId) {
111126
111873
  function applyBookingPaymentAdmission(services, unrestrictedHeldServiceId) {
111127
111874
  return services.map((service) => {
111128
111875
  const choices = service.onlinePaymentChoices;
111129
- if (service.requiresApproval) return {
111876
+ if (service.requiresApproval || service.onlinePaymentChoices?.perSession !== false && !getBookingServiceSlidingScale(service) && (service.priceAmount ?? 0) === 0) return {
111130
111877
  ...service,
111131
111878
  onlinePaymentChoices: {
111132
111879
  perSession: true,
@@ -111590,7 +112337,8 @@ function resolveBookingPaymentStep(input) {
111590
112337
  kind: "unavailable",
111591
112338
  mode: "unsupported",
111592
112339
  service,
111593
- errorMessage: "Online payments are not set up for this service yet."
112340
+ reason: "cardPaymentsUnavailable",
112341
+ errorMessage: "Card payments aren’t set up for this service yet."
111594
112342
  };
111595
112343
  const [first, ...rest] = resolveAvailableBookingCollectionOptions({
111596
112344
  paymentTerms: service.paymentTerms ?? { allowedOptions: [{ kind: "upfront" }] },
@@ -111604,11 +112352,27 @@ function resolveBookingPaymentStep(input) {
111604
112352
  kind: "unavailable",
111605
112353
  mode: "unsupported",
111606
112354
  service,
112355
+ reason: "paymentOptionsUnavailable",
111607
112356
  errorMessage: "This service has a payment configuration that cannot be booked right now."
111608
112357
  };
111609
112358
  const availableOptions = [first, ...rest];
111610
112359
  return resolveReadyBookingPayment(service, availableOptions, input.data.selectedCollectionOptionKind);
111611
112360
  }
112361
+ /**
112362
+ * The same decision at the least the client can choose to pay, whatever
112363
+ * they've typed so far: whether some per-session choice can go ahead at all.
112364
+ * A sliding scale that starts at nothing is free at its low end.
112365
+ */
112366
+ function resolveLowestBookingPaymentStep(input) {
112367
+ const slidingScale = getBookingServiceSlidingScale(resolveBookingSelectedService(input));
112368
+ return resolveBookingPaymentStep(slidingScale ? {
112369
+ ...input,
112370
+ data: {
112371
+ ...input.data,
112372
+ selectedSlidingAmountInput: formatCentsAsCurrencyInput(slidingScale.minAmount)
112373
+ }
112374
+ } : input);
112375
+ }
111612
112376
  function resolveReadyBookingPayment(service, availableOptions, requestedKind) {
111613
112377
  const [first, ...rest] = availableOptions;
111614
112378
  const current = toSelectedCollectionOptionKind(requestedKind);
@@ -111649,7 +112413,7 @@ function prepareBookingSubmission(input) {
111649
112413
  value: {
111650
112414
  ...common,
111651
112415
  kind: "package_purchase",
111652
- purchasePassId: input.data.packagePurchase.package.id,
112416
+ passProductId: input.data.packagePurchase.package.id,
111653
112417
  discountCode: toTrimmedString(input.data.discountCode),
111654
112418
  shownTerms: input.shownTerms ?? bookingPackagePurchaseTerms(input.data.packagePurchase.package, input.promisedDiscountId)
111655
112419
  }
@@ -111877,6 +112641,7 @@ function resolveMissingBookingPaymentStep(input) {
111877
112641
  kind: "unavailable",
111878
112642
  mode: "unsupported",
111879
112643
  service: null,
112644
+ reason: "paymentOptionsUnavailable",
111880
112645
  errorMessage: "Payment options are unavailable for the selected service right now."
111881
112646
  } : {
111882
112647
  kind: "unselected",
@@ -112044,6 +112809,7 @@ function normalizeAppointmentBookingServices(input) {
112044
112809
  requiresApproval: service.requiresApproval,
112045
112810
  onlinePaymentMode: service.onlinePaymentMode,
112046
112811
  onlinePaymentChoices: service.onlinePaymentChoices,
112812
+ ...service.onlinePayments ? { onlinePayments: service.onlinePayments } : {},
112047
112813
  pricing: service.pricing,
112048
112814
  priceAmount: service.priceAmount,
112049
112815
  priceCurrency: service.priceCurrency,
@@ -112152,6 +112918,13 @@ const bookingServiceSchema = z.object({
112152
112918
  buyPackage: z.boolean(),
112153
112919
  anyAvailable: z.boolean()
112154
112920
  }).optional(),
112921
+ onlinePayments: z.discriminatedUnion("kind", [z.object({ kind: z.literal("available") }), z.object({
112922
+ kind: z.literal("unavailable"),
112923
+ organiserContact: z.object({
112924
+ email: z.string().nullable(),
112925
+ phone: z.string().nullable()
112926
+ }).optional()
112927
+ })]).optional(),
112155
112928
  pricing: z.custom().optional(),
112156
112929
  priceAmount: z.number().nullable().optional(),
112157
112930
  priceCurrency: z.string().nullable().optional(),
@@ -112564,7 +113337,11 @@ function selectEventDetails(args) {
112564
113337
  selected,
112565
113338
  run,
112566
113339
  sessions: run.sessions,
112567
- timeZone
113340
+ timeZone,
113341
+ depositOffer: resolvePublicEventDepositOffer(selected, {
113342
+ nowIso: args.nowIso,
113343
+ sessions: run.sessions
113344
+ })
112568
113345
  };
112569
113346
  }
112570
113347
  if (!isOrdinaryEvent(selected)) return emptySelection(timeZone);
@@ -112573,7 +113350,8 @@ function selectEventDetails(args) {
112573
113350
  mode: mode === "selected" ? "selected" : "next",
112574
113351
  selected,
112575
113352
  otherDates: otherDates.filter(isOrdinaryEvent),
112576
- timeZone
113353
+ timeZone,
113354
+ depositOffer: resolvePublicEventDepositOffer(selected, { nowIso: args.nowIso })
112577
113355
  };
112578
113356
  }
112579
113357
 
@@ -112694,7 +113472,8 @@ function formatTicketTypePrice(ticketType, currency) {
112694
113472
  return formatBookingPriceDisplay(resolveExactOrFreePriceDisplay(ticketType.priceAmount, currency), { decimals: "auto" });
112695
113473
  }
112696
113474
  function getDisplayablePricingOptions(event) {
112697
- return event.pricing.kind === "tiered" ? event.pricing.options.filter(isPublicEventPricingOptionDisplayable).sort((left, right) => left.sortOrder - right.sortOrder) : [];
113475
+ const roomPriceIds = event.rooms?.linkedOptionIds ?? [];
113476
+ return event.pricing.kind === "tiered" ? event.pricing.options.filter(isPublicEventPricingOptionDisplayable).filter((option) => !roomPriceIds.includes(option.id)).sort((left, right) => left.sortOrder - right.sortOrder) : [];
112698
113477
  }
112699
113478
  function TicketTypePriceList({ ticketTypes, currency }) {
112700
113479
  if (ticketTypes.length === 0) return null;
@@ -113022,7 +113801,8 @@ function EventVenueMap({ venue, drawing, showMap, mapHeight, mapClassName }) {
113022
113801
  });
113023
113802
  }
113024
113803
  /** One pricing projection governs the selected panel, including drop-in and whole-series behavior. */
113025
- function selectedEventPricing(event, showCost) {
113804
+ function selectedEventPricing(selection, showCost) {
113805
+ const event = selection.selected;
113026
113806
  const isDropIn = isDropInEvent(event);
113027
113807
  const wholeSeriesPricing = wholeSeriesPricingOf(event);
113028
113808
  const showEventCost = showCost && !isDropIn && wholeSeriesPricing === null;
@@ -113030,7 +113810,7 @@ function selectedEventPricing(event, showCost) {
113030
113810
  isDropIn,
113031
113811
  wholeSeriesPricingDisplay: showCost ? wholeSeriesPricing : null,
113032
113812
  eventCostLabel: showEventCost ? formatEventPrice(event) : null,
113033
- depositNote: showCost && !isDropIn ? paidDepositNote(event) : null,
113813
+ depositNote: showCost && !isDropIn && isPaid(event) ? formatEventDepositNote(selection.depositOffer) : null,
113034
113814
  eventPricingCurrency: publicEventPricingCurrency(event.pricing),
113035
113815
  ticketTypes: showEventCost && isPaid(event) ? getDisplayablePricingOptions(event) : []
113036
113816
  };
@@ -113038,14 +113818,13 @@ function selectedEventPricing(event, showCost) {
113038
113818
  const isDropInEvent = (event) => event.bookingScope === "single_occurrence" && event.requiresRegistration === false;
113039
113819
  const wholeSeriesPricingOf = (event) => event.bookingScope === "whole_series" && event.pricing.kind !== "external" ? event.pricing : null;
113040
113820
  const isPaid = (event) => publicEventPricingType(event.pricing) !== "free";
113041
- const paidDepositNote = (event) => isPaid(event) ? formatEventDepositNote(event.pricing, event.paymentTerms, event) : null;
113042
113821
  function SelectedEventDetailsView(props$1) {
113043
113822
  const { selection, showVenue, showMap, showOtherDates, showTitle, showDescription, showCapacity, mapHeight, mapClassName, acceptedItems } = props$1;
113044
113823
  const selected = selection.selected;
113045
113824
  const venue = showVenue ? selected.venue : undefined;
113046
113825
  const online = eventOnlinePlaceShown(selected, showVenue);
113047
113826
  const addressAfterBooking = addressAfterBookingShown(selected, showVenue);
113048
- const pricing = selectedEventPricing(selected, props$1.showCost);
113827
+ const pricing = selectedEventPricing(selection, props$1.showCost);
113049
113828
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
113050
113829
  className: "rb-flex rb-flex-col rb-gap-6 rb-text-left",
113051
113830
  children: [
@@ -113178,7 +113957,7 @@ function headerPanelContent(props$1) {
113178
113957
  const venue = props$1.showVenue ? selection.selected.venue : undefined;
113179
113958
  const online = eventOnlinePlaceShown(selection.selected, props$1.showVenue);
113180
113959
  const teamMembers = selection.selected.teamMembers ?? [];
113181
- const pricing = headerPanelPricing(props$1, selection.selected);
113960
+ const pricing = headerPanelPricing(props$1, selection);
113182
113961
  const scheduled = selection.kind === "wholeSeries" ? selection.sessions.length : selection.otherDates.length;
113183
113962
  return {
113184
113963
  venue,
@@ -113196,8 +113975,8 @@ function headerPanelContent(props$1) {
113196
113975
  * discount, or passes that also admit. Decided from the same projection
113197
113976
  * `EventPricingDetails` renders, so a panel is only drawn when it will show something.
113198
113977
  */
113199
- function headerPanelPricing(props$1, event) {
113200
- const pricing = selectedEventPricing(event, props$1.showCost ?? true);
113978
+ function headerPanelPricing(props$1, selection) {
113979
+ const pricing = selectedEventPricing(selection, props$1.showCost ?? true);
113201
113980
  if (pricing.isDropIn) return null;
113202
113981
  const detail = {
113203
113982
  ...pricing,
@@ -113225,40 +114004,8 @@ function withLookParts(props$1, arrangement) {
113225
114004
 
113226
114005
  //#endregion
113227
114006
  //#region ../blocks/src/system/runtime/nodes/event-details.server.tsx
113228
- function eventDetailsIslandValue({ props: props$1, presentation: presentation$1, scopedEvents, subject }) {
113229
- return {
113230
- ...props$1.arrangement ? {
113231
- arrangement: props$1.arrangement,
113232
- entryTitle: props$1.entryTitle,
113233
- actionSize: props$1.actionSize,
113234
- lookSlots: props$1.lookSlots,
113235
- surfacePresentation: props$1.surfacePresentation,
113236
- panelHeading: props$1.panelHeading
113237
- } : {},
113238
- quickFacts: props$1.quickFacts,
113239
- occurrenceContext: props$1.occurrenceContext ?? null,
113240
- subject,
113241
- events: scopedEvents,
113242
- venueDrawing: props$1.venueDrawing ?? null,
113243
- showVenue: presentation$1.showVenue,
113244
- showMap: presentation$1.showMap,
113245
- showOtherDates: presentation$1.showOtherDates,
113246
- otherDatesLimit: props$1.otherDatesLimit,
113247
- showCost: presentation$1.showCost,
113248
- showTitle: presentation$1.showTitle,
113249
- showDescription: presentation$1.showDescription,
113250
- showCapacity: presentation$1.showCapacity,
113251
- showAcceptedPasses: presentation$1.showAcceptedPasses,
113252
- showAcceptedMemberships: presentation$1.showAcceptedMemberships,
113253
- sitePasses: props$1.sitePasses,
113254
- siteMemberships: props$1.siteMemberships,
113255
- autoApplyDiscount: presentation$1.autoApplyDiscount,
113256
- className: props$1.className,
113257
- now: props$1.now
113258
- };
113259
- }
113260
114007
  function EventDetailsSSR(props$1) {
113261
- const { blockId, occurrenceContext = null, subject, events = null, className, children } = props$1;
114008
+ const { occurrenceContext = null, subject, events = null, className, children } = props$1;
113262
114009
  const normalizedSubject = normalizeEventRegistrationPageSurfaceSubject(subject);
113263
114010
  const scopedEvents = events === null ? null : resolveEventRegistrationScopedEvents(events, {
113264
114011
  occurrenceContext,
@@ -113270,19 +114017,9 @@ function EventDetailsSSR(props$1) {
113270
114017
  occurrenceContext,
113271
114018
  subject: normalizedSubject
113272
114019
  });
113273
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(IslandRoot, {
113274
- kind: "event-details",
113275
- id: blockId,
113276
- attributes: {
113277
- className: `event-details ${className ?? ""}`.trim(),
113278
- "data-block": "event-details"
113279
- },
113280
- value: eventDetailsIslandValue({
113281
- props: props$1,
113282
- presentation: presentation$1,
113283
- scopedEvents,
113284
- subject: normalizedSubject
113285
- }),
114020
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
114021
+ className: `event-details ${className ?? ""}`.trim(),
114022
+ "data-block": "event-details",
113286
114023
  children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(EventDetailsView, {
113287
114024
  ...presentation$1,
113288
114025
  mapClassName: "venue-map event-details-map"
@@ -131911,7 +132648,7 @@ async function loadConfig(configPath, output) {
131911
132648
  return { errorMessage: "No config path provided." };
131912
132649
  }
131913
132650
  try {
131914
- const { loadConfigFile: loadConfigFile$1 } = await import("../load-config-DSGN-x3K.mjs");
132651
+ const { loadConfigFile: loadConfigFile$1 } = await import("../load-config-DTT9jeYi.mjs");
131915
132652
  const rawConfig = await loadConfigFile$1(configPath);
131916
132653
  const parsed = z.safeParse(riverbankSiteConfigSchema, rawConfig);
131917
132654
  if (!parsed.success) {
@@ -144888,6 +145625,7 @@ const CUSTOMER_PASS_REFUND_INVALID_CODES = [...MANAGED_PRODUCT_REFUND_INVALID_CO
144888
145625
  const CUSTOMER_PASS_REFUND_FAILED_CODES = [
144889
145626
  "not_found",
144890
145627
  "credit_refunds_disabled",
145628
+ "ending_dates_changed",
144891
145629
  "payment_intent_lookup_failed",
144892
145630
  ...CANONICAL_ADMIN_REFUND_FAILURE_CODES
144893
145631
  ];
@@ -144931,7 +145669,7 @@ function classifyCustomerPassRefundCode(code) {
144931
145669
  if (CUSTOMER_PASS_REFUND_INVALID_CODES.includes(code)) {
144932
145670
  return "invalid";
144933
145671
  }
144934
- if (CANONICAL_REFUND_CONFLICT_CODES.includes(code)) {
145672
+ if (code === "ending_dates_changed" || CANONICAL_REFUND_CONFLICT_CODES.includes(code)) {
144935
145673
  return "conflict";
144936
145674
  }
144937
145675
  return "failed";
@@ -147628,6 +148366,7 @@ function toPublicBookingServiceCatalogueItem(service, categoryId) {
147628
148366
  requiresApproval: service.requiresApproval,
147629
148367
  ...service.onlinePaymentMode === undefined ? {} : { onlinePaymentMode: service.onlinePaymentMode },
147630
148368
  ...service.onlinePaymentChoices === undefined ? {} : { onlinePaymentChoices: service.onlinePaymentChoices },
148369
+ ...service.onlinePayments === undefined ? {} : { onlinePayments: service.onlinePayments },
147631
148370
  id: service.id,
147632
148371
  asksSiteTerms: service.asksSiteTerms,
147633
148372
  siteId: service.siteId,