riverbankcms 0.38.0 → 0.38.2

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,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
- import { $n as footerLookIdValues, At as getMimeType, Bt as footerPreferencesSchema, Cn as eventBookingOfferIntentSchema, Cr as asPageFlowPresetId, Dr as bookingQuestionAttachmentSchema, Er as compareEntrySlug, Et as slugifyMediaIdentifier, Fn as RESOLVED_INTERNAL_LINK_ENTITY_TYPES, Ft as MAX_MANAGEMENT_MEDIA_UPLOAD_BYTES, Gn as ICON_PICKER_PRESETS, Hr as slugPart, I as footerModeSchema, Jn as SUPPORTED_LOADER_ENDPOINTS, Mr as createContentEntryRef, Mt as normalizeAmbiguousStoragePathForSite, Pt as FILE_SIZE_LIMITS, Sn as require_dist, St as buildMediaIdentifierFromFilename, Tr as makeBoundaryId, Tt as resolveMediaIdentifier, V as themeSchema, Xn as asHeaderLayoutId, Yn as asFooterLookId, Zn as asHeaderStyleId, Zt as buttonStyleSelectionSchema, ar as SYSTEM_BLOCK_KINDS, at as parseAspectRatioValue, b as getSiteCommandMetadata, bt as mediaTypeDiscriminants, ct as getDirectImageUrlForSiteScopedPath, er as headerLayoutIdValues, h as parseAndPlanCommandBatchForTypes, jr as createCommandRef, k as headerPreferencesSchema, kt as getExtensionForMimeType, l as resolvePageUpsertSeo, m as createDryRunReport, mr as asAppearancePresetId, n as sdkCourseBookingSettingsSchema, p as stableStringify, r as sdkEventOccurrenceInputSchema, s as eventVisibilitySchema, tr as headerStyleIdValues, v as evaluateSiteCommandBatchExposure, vr as asDesignBlockId, vt as PUBLIC_FILE_FIELD_KINDS, w as entryIdentifierForCommand, wr as asSiteStyleId, y as evaluateSiteCommandExposure, yr as asDesignBoundaryId, yt as isDisplayMediaKind, zr as createSiteCommandSiteRef } from "./sdk-event-upsert-CLqEh-D2.mjs";
3
- import { $n as parseCustomerId, A as getPublicReadCachePolicy, At as validateBookingPaymentOptionKinds, Bn as unsafeAsNonNegativeCents, Br as parseRetiredCourseId, Bt as scheduleBookingReasonCodes, C as DEFAULT_EVENT_TYPE_PRESETS, Cr as parseOrderId, Dr as unsafeAsOrderPaymentPlanId, E as SURFACE_EVENT_PRESET_VALUES, Er as unsafeAsOrderFlexibleBalanceContractId, Fn as isNonNegativeWholeCents$1, Gr as unsafeAsPricingOptionId, H as exposeSecret, Hn as formatCurrencyAmount, Hr as unsafeAsEventOfferingId, Ht as resolveFlexibleBalanceInitialPaymentCents, In as parseNonNegativeCents, Kr as err, Ln as parsePositiveCents, Lr as parseAttendeeId, Lt as omitZeroAmountFutureRows, M as publicReadBatchFreshnessSeconds, Mn as fromArray, Mr as parseApiKeyId, Mt as addIntervalPreservingMonthAnchor, N as publicReadFreshnessSeconds, Nr as parseSiteId, Nt as clampConfiguredAmount, O as PUBLIC_AVAILABILITY_FRESHNESS_SECONDS, Or as unsafeAsOrderPaymentReceiptId, Pr as parseUserId, Pt as getBookingInstalmentDepositRefundability, Qn as unsafeAsStaffMemberId, Rn as toCents, Rr as parseEventSeriesId, Rt as splitAmountWithRemainderInFirst, S as resolveSiteVerticalBookingConfig, St as publicLocationSchema, Tr as unsafeAsCheckoutLineId, Tt as trimmedStringOrNull, U as parseManagementKey, Un as parseCurrencyCode, Ur as unsafeAsEventSeriesId, V as createSecret, Vn as unsafeAsPositiveCents, Vt as resolveFlexibleBalanceDueAt, Wn as assertNever, Wr as unsafeAsOccurrenceId, Xn as parseClientArrangementId, Yn as parseAppointmentId, Yt as formatDate, Zn as unsafeAsAppointmentResourceId, _n as resolveBookingTimeZoneId, ar as parseDatedOfferingCapacityHoldAuditRef, b as parseVerticalId, dt as assertAllowedPublicUrl, er as parseSiteTermsVersionId, et as parseMailingListProviderScope, fn as parseBookingLocalDate, g as withBookingModulesForSelectionChange, h as resolveEventCatalogue, hn as toUtcIsoDateTimeString, ht as stableJsonStringify, i as committedWriteProofSchema, in as addLocalScheduleDays, ir as unsafeAsPassId, j as isPublicReadEndpoint, jt as isLiveOrderInstalmentPlanStatus, k as PUBLIC_CONTENT_FRESHNESS_SECONDS, kr as parseEditorSessionGeneration, ln as getLocalScheduleDate, lr as parseMediaAssetId, m as planTurningOnCourses, n as OFFLINE_PAYMENT_METHODS, nr as parseMembershipId, on as formatLocalScheduleDate, or as parseDatedOfferingCapacityHoldId, qr as ok, r as bookingContextId, s as APPOINTMENT_REQUEST_OUTCOME_VALUES, sr as parseWaitlistEntryId, tr as parseEntitlementId, tt as parseFooterCompositionV1, u as STAFF_OPERATIONAL_CAPABILITIES, v as areConfiguredBookingVerticalConfigsEqual, vt as locationValueSchema, w as EVENT_PRESET_VALUES, wr as parseOrderPaymentReceiptId, x as parseVerticalPresetId, y as canonicalizeConfiguredBookingVerticalConfig, zn as toNonNegativeCents, zr as parseEventSeriesRegistrationId, zt as businessCancellationRefusalCodes } from "./src-CE4CDO3T.mjs";
4
- import { n as CliSdkPeerError, t as loadConfigFile } from "./load-config-aVpLIpK_.mjs";
2
+ import { Ar as asSiteStyleId, At as getMimeType, Bt as footerPreferencesSchema, Et as slugifyMediaIdentifier, Ft as MAX_MANAGEMENT_MEDIA_UPLOAD_BYTES, Gr as createSiteCommandSiteRef, I as footerModeSchema, Jr as slugPart, Lr as createCommandRef, Mr as compareEntrySlug, Mt as normalizeAmbiguousStoragePathForSite, Nr as bookingQuestionAttachmentSchema, On as require_dist, Pt as FILE_SIZE_LIMITS, Qt as buttonStyleSelectionSchema, Rr as createContentEntryRef, St as buildMediaIdentifierFromFilename, Tr as asDesignBoundaryId, Tt as resolveMediaIdentifier, V as themeSchema, Vn as RESOLVED_INTERNAL_LINK_ENTITY_TYPES, Zn as ICON_PICKER_PRESETS, ar as footerLookIdValues, at as parseAspectRatioValue, b as getSiteCommandMetadata, br as asAppearancePresetId, bt as mediaTypeDiscriminants, ct as getDirectImageUrlForSiteScopedPath, dr as SYSTEM_BLOCK_KINDS, er as SUPPORTED_LOADER_ENDPOINTS, h as parseAndPlanCommandBatchForTypes, jr as makeBoundaryId, k as headerPreferencesSchema, kn as eventBookingOfferIntentSchema, kr as asPageFlowPresetId, kt as getExtensionForMimeType, l as resolvePageUpsertSeo, m as createDryRunReport, n as sdkCourseBookingSettingsSchema, nr as asHeaderLayoutId, or as headerLayoutIdValues, p as stableStringify, r as sdkEventOccurrenceInputSchema, rr as asHeaderStyleId, s as eventVisibilitySchema, sr as headerStyleIdValues, tr as asFooterLookId, v as evaluateSiteCommandBatchExposure, vt as PUBLIC_FILE_FIELD_KINDS, w as entryIdentifierForCommand, wr as asDesignBlockId, y as evaluateSiteCommandExposure, yt as isDisplayMediaKind } from "./sdk-event-upsert-CdBZDquG.mjs";
3
+ import { $n as parseClientArrangementId, A as PUBLIC_RENDERED_AVAILABILITY_FRESHNESS_SECONDS, Ar as unsafeAsOrderFlexibleBalanceContractId, Bn as toNonNegativeCents, Bt as businessCancellationRefusalCodes, C as DEFAULT_EVENT_TYPE_PRESETS, Ct as publicLocationSchema, Dr as parseOrderId, E as SURFACE_EVENT_PRESET_VALUES, Et as trimmedStringOrNull, Ft as getBookingInstalmentDepositRefundability, Gn as assertNever, H as createSecret, Hn as unsafeAsPositiveCents, Hr as parseEventSeriesId, Ht as resolveFlexibleBalanceDueAt, In as isNonNegativeWholeCents$1, Ir as parseApiKeyId, Jn as unsafeAsGiftingInstrumentId, Jr as unsafeAsOccurrenceId, Kr as unsafeAsEventOfferingId, Ln as parseNonNegativeCents, Lr as parseSiteId, M as isPublicReadEndpoint, Mr as unsafeAsOrderPaymentReceiptId, Mt as isLiveOrderInstalmentPlanStatus, N as publicReadBatchFreshnessSeconds, Nn as fromArray, Nr as parseEditorSessionGeneration, Nt as addIntervalPreservingMonthAnchor, O as PUBLIC_AVAILABILITY_FRESHNESS_SECONDS, Or as parseOrderPaymentReceiptId, P as publicReadFreshnessSeconds, Pt as clampConfiguredAmount, Qn as parseAppointmentId, Rn as parsePositiveCents, Rr as parseUserId, Rt as omitZeroAmountFutureRows, S as resolveSiteVerticalBookingConfig, U as exposeSecret, Un as formatCurrencyAmount, Ur as parseEventSeriesRegistrationId, Ut as resolveFlexibleBalanceInitialPaymentCents, Vn as unsafeAsNonNegativeCents, Vr as parseAttendeeId, Vt as scheduleBookingReasonCodes, W as parseManagementKey, Wn as parseCurrencyCode, Wr as parseRetiredCourseId, Xr as err, Xt as formatDate, Yn as unsafeAsGiftingOfferId, Yr as unsafeAsPricingOptionId, Zr as ok, an as addLocalScheduleDays, ar as parseEntitlementId, b as parseVerticalId, cr as unsafeAsPassId, dr as parseWaitlistEntryId, er as unsafeAsAppointmentResourceId, ft as assertAllowedPublicUrl, g as withBookingModulesForSelectionChange, gn as toUtcIsoDateTimeString, gt as stableJsonStringify, h as resolveEventCatalogue, i as committedWriteProofSchema, ir as unsafeAsCustomerId, j as getPublicReadCachePolicy, jr as unsafeAsOrderPaymentPlanId, jt as validateBookingPaymentOptionKinds, k as PUBLIC_CONTENT_FRESHNESS_SECONDS, kr as unsafeAsCheckoutLineId, lr as parseDatedOfferingCapacityHoldAuditRef, m as planTurningOnCourses, n as OFFLINE_PAYMENT_METHODS, nr as parseCustomerId, nt as parseFooterCompositionV1, or as parseMembershipId, pn as parseBookingLocalDate, pr as parseMediaAssetId, qr as unsafeAsEventSeriesId, r as bookingContextId, rr as parseSiteTermsVersionId, s as APPOINTMENT_REQUEST_OUTCOME_VALUES, sn as formatLocalScheduleDate, tr as unsafeAsStaffMemberId, tt as parseMailingListProviderScope, u as STAFF_OPERATIONAL_CAPABILITIES, un as getLocalScheduleDate, ur as parseDatedOfferingCapacityHoldId, v as areConfiguredBookingVerticalConfigsEqual, vn as resolveBookingTimeZoneId, w as EVENT_PRESET_VALUES, x as parseVerticalPresetId, y as canonicalizeConfiguredBookingVerticalConfig, yt as locationValueSchema, zn as toCents, zt as splitAmountWithRemainderInFirst } from "./src-CnUjAAn9.mjs";
4
+ import { n as CliSdkPeerError, t as loadConfigFile } from "./load-config-BQtsKco-.mjs";
5
5
  import { safeParse, z } from "zod";
6
6
  import { Argument, Command, Option } from "commander";
7
7
  import { AsyncLocalStorage } from "node:async_hooks";
@@ -836,7 +836,20 @@ const PREVIEW_BLOCKED_REASONS = [
836
836
  "past_date",
837
837
  "invalid_schedule",
838
838
  "stale",
839
- "invalid_state"
839
+ "invalid_state",
840
+ "not_available",
841
+ "closure",
842
+ "outside_hours",
843
+ "too_close",
844
+ "held",
845
+ "google_busy",
846
+ "minimum_notice",
847
+ "booking_window",
848
+ "clash",
849
+ "package_not_eligible",
850
+ "service_not_provided",
851
+ "not_upcoming",
852
+ "invalid_time"
840
853
  ];
841
854
 
842
855
  //#endregion
@@ -1065,6 +1078,13 @@ const PAGE_JOURNAL_ENDPOINT_DEFINITIONS = {
1065
1078
  responseKind: "json",
1066
1079
  errors: ["validation:invalid_input", "server:internal_error"]
1067
1080
  },
1081
+ getEditorSiteFacts: {
1082
+ path: "/sites/{siteId}/editor/site-facts",
1083
+ method: "GET",
1084
+ auth: "user",
1085
+ responseKind: "json",
1086
+ errors: ["server:internal_error"]
1087
+ },
1068
1088
  replayThemeJournalChange: {
1069
1089
  path: "/sites/{siteId}/theme/journal",
1070
1090
  method: "POST",
@@ -1627,20 +1647,38 @@ const PAGE_READ_DEPENDENCIES_HEADER = "x-riverbank-page-dependencies";
1627
1647
  * fell back to an empty value), so no cache may keep it: the next read should get the complete page.
1628
1648
  */
1629
1649
  const PAGE_READ_STORAGE_HEADER = "x-riverbank-page-storage";
1630
- /** A page may depend on admission even when an ordinary CMS page won precedence. */
1650
+ function availabilityPageReadTags(siteId) {
1651
+ return normalizeRevalidateTags([
1652
+ ...buildCacheReadTags([TAG_TEMPLATES.siteRoutableContent], { siteId }),
1653
+ ...buildPublicReadFetchTags("listPublicEvents", { siteId }),
1654
+ ...buildPublicReadFetchTags("getPublicBookingService", { siteId })
1655
+ ]);
1656
+ }
1657
+ /**
1658
+ * The tags and framework lifetime a complete page read registers. A page may depend on admission even when an
1659
+ * ordinary CMS page won precedence. Booking and event writes purge an availability page by its tags, so its
1660
+ * lifetime is only the rendered-availability backstop for a failed purge. Caches that no write reaches (the
1661
+ * SDK's in-process map and durable runtime rows) keep `PUBLIC_AVAILABILITY_FRESHNESS_SECONDS` instead.
1662
+ */
1631
1663
  function buildPageReadCachePolicy(siteId, dependencies) {
1632
1664
  return dependencies === "availability" ? {
1633
- tags: normalizeRevalidateTags([
1634
- ...buildCacheReadTags([TAG_TEMPLATES.siteRoutableContent], { siteId }),
1635
- ...buildPublicReadFetchTags("listPublicEvents", { siteId }),
1636
- ...buildPublicReadFetchTags("getPublicBookingService", { siteId })
1637
- ]),
1638
- revalidate: PUBLIC_AVAILABILITY_FRESHNESS_SECONDS
1665
+ tags: availabilityPageReadTags(siteId),
1666
+ revalidate: PUBLIC_RENDERED_AVAILABILITY_FRESHNESS_SECONDS
1639
1667
  } : {
1640
1668
  tags: buildCacheReadTags([TAG_TEMPLATES.siteRoutableContent], { siteId }),
1641
1669
  revalidate: PUBLIC_CONTENT_FRESHNESS_SECONDS
1642
1670
  };
1643
1671
  }
1672
+ /**
1673
+ * What an incomplete or malformed page read registers, so the rendered route is rebuilt within a minute
1674
+ * instead of keeping a broken page for a backstop's length. It carries every page tag, so a write still purges it.
1675
+ */
1676
+ function buildPageReadRetryPolicy(siteId) {
1677
+ return {
1678
+ tags: availabilityPageReadTags(siteId),
1679
+ revalidate: PUBLIC_AVAILABILITY_FRESHNESS_SECONDS
1680
+ };
1681
+ }
1644
1682
  function pageReadDependencies(payload) {
1645
1683
  return typeof payload === "object" && payload !== null && "dependencies" in payload && payload.dependencies === "content" ? "content" : "availability";
1646
1684
  }
@@ -1727,20 +1765,68 @@ const weekday = z.union([
1727
1765
  z.literal(5),
1728
1766
  z.literal(6)
1729
1767
  ]);
1730
- const arrangementCadenceSchema = z.discriminatedUnion("kind", [z.object({
1768
+ const localStart = z.string().regex(/^([01]\d|2[0-3]):[0-5]\d$/);
1769
+ const everyWeeks = z.union([z.literal(1), z.literal(2)]);
1770
+ const nth = z.union([
1771
+ z.literal(1),
1772
+ z.literal(2),
1773
+ z.literal(3),
1774
+ z.literal(4),
1775
+ z.literal("last")
1776
+ ]);
1777
+ /** A recurring day in an arrangement's week, with the id it keeps in every segment. */
1778
+ const arrangementSlotSchema = z.object({
1779
+ id: z.string().uuid(),
1780
+ weekday,
1781
+ localStart
1782
+ }).strict();
1783
+ /** A saved pattern: weekly (several days, counted in weeks from a Monday anchor) or monthly (one day). */
1784
+ const arrangementPatternSchema = z.discriminatedUnion("kind", [z.object({
1731
1785
  kind: z.literal("weekly"),
1732
- everyWeeks: z.union([z.literal(1), z.literal(2)]),
1733
- weekday
1786
+ everyWeeks,
1787
+ anchorMonday: localDate,
1788
+ slots: z.array(arrangementSlotSchema).min(1).max(7).readonly()
1734
1789
  }).strict(), z.object({
1735
1790
  kind: z.literal("monthly"),
1791
+ nth,
1792
+ slot: arrangementSlotSchema
1793
+ }).strict()]);
1794
+ const slotTime = z.object({
1736
1795
  weekday,
1737
- nth: z.union([
1738
- z.literal(1),
1739
- z.literal(2),
1740
- z.literal(3),
1741
- z.literal(4),
1742
- z.literal("last")
1743
- ])
1796
+ localStart
1797
+ }).strict();
1798
+ const differentDays = (days) => new Set(days.map((day) => day.weekday)).size === days.length;
1799
+ /** What setup asks for: the days and times, with no ids or anchor. The server mints those. */
1800
+ const arrangementSetUpScheduleSchema = z.object({
1801
+ effectiveFrom: localDate,
1802
+ pattern: z.discriminatedUnion("kind", [z.object({
1803
+ kind: z.literal("weekly"),
1804
+ everyWeeks,
1805
+ days: z.array(slotTime).min(1).max(7).refine(differentDays, "Each day can only be picked once.")
1806
+ }).strict(), z.object({
1807
+ kind: z.literal("monthly"),
1808
+ nth,
1809
+ day: slotTime
1810
+ }).strict()])
1811
+ }).strict();
1812
+ /**
1813
+ * A change to the schedule from a date. `move` changes one day's weekday or time. `add` adds a
1814
+ * day (weekly patterns only); the server mints its id from the operation, and it books the new
1815
+ * day's next `bookAhead` sessions the way setup does.
1816
+ */
1817
+ const arrangementScheduleCommandSchema = z.discriminatedUnion("kind", [z.object({
1818
+ kind: z.literal("move"),
1819
+ slotId: z.string().uuid(),
1820
+ weekday,
1821
+ localStart,
1822
+ effectiveFrom: localDate
1823
+ }).strict(), z.object({
1824
+ kind: z.literal("add"),
1825
+ weekday,
1826
+ localStart,
1827
+ effectiveFrom: localDate,
1828
+ bookAhead: z.number().int().min(0).max(52),
1829
+ bookShortfallAsOwed: z.boolean().default(false)
1744
1830
  }).strict()]);
1745
1831
  const arrangementEndSchema = z.discriminatedUnion("kind", [
1746
1832
  z.object({ kind: z.literal("open") }).strict(),
@@ -1766,8 +1852,7 @@ const arrangementPaymentSchema = z.discriminatedUnion("kind", [
1766
1852
  ]);
1767
1853
  const arrangementScheduleSchema = z.object({
1768
1854
  effectiveFrom: localDate,
1769
- cadence: arrangementCadenceSchema,
1770
- localStart: z.string().regex(/^([01]\d|2[0-3]):[0-5]\d$/)
1855
+ pattern: arrangementPatternSchema
1771
1856
  }).strict();
1772
1857
  const recordedReturn = { recordedReturn: z.literal("staff_confirmed").optional() };
1773
1858
  const operation = {
@@ -1783,7 +1868,7 @@ const createClientArrangementSchema = z.object({
1783
1868
  holdsTime: z.boolean(),
1784
1869
  end: arrangementEndSchema,
1785
1870
  payment: arrangementPaymentSchema,
1786
- schedule: arrangementScheduleSchema,
1871
+ schedule: arrangementSetUpScheduleSchema,
1787
1872
  bookAhead: z.number().int().min(0).max(52),
1788
1873
  bookShortfallAsOwed: z.boolean().default(false)
1789
1874
  }).strict();
@@ -1802,7 +1887,7 @@ const arrangementAwaySchema = z.object({
1802
1887
  }).strict().refine((value) => value.backOn > value.from, "Choose a return date after the first day away.");
1803
1888
  const arrangementChangeFromSchema = z.object({
1804
1889
  ...operation,
1805
- schedule: arrangementScheduleSchema
1890
+ command: arrangementScheduleCommandSchema
1806
1891
  }).strict();
1807
1892
  const arrangementOneWeekSchema = z.object({
1808
1893
  ...operation,
@@ -1811,14 +1896,27 @@ const arrangementOneWeekSchema = z.object({
1811
1896
  endAt: z.iso.datetime({ offset: true }),
1812
1897
  bookShortfallAsOwed: z.boolean().default(false)
1813
1898
  }).strict().refine((value) => Date.parse(value.endAt) > Date.parse(value.startAt), "Choose an end after the start.");
1814
- const arrangementEndRequestSchema = z.object({
1899
+ /**
1900
+ * Ending all of it, or one day: that day stops after `lastDate`, its bookings after then are
1901
+ * cancelled, and the other days carry on.
1902
+ */
1903
+ const arrangementEndRequestSchema = z.discriminatedUnion("scope", [z.object({
1815
1904
  ...operation,
1816
1905
  ...recordedReturn,
1906
+ scope: z.literal("all"),
1817
1907
  lastDate: localDate
1818
- }).strict();
1908
+ }).strict(), z.object({
1909
+ ...operation,
1910
+ ...recordedReturn,
1911
+ scope: z.literal("day"),
1912
+ slotId: z.string().uuid(),
1913
+ lastDate: localDate
1914
+ }).strict()]);
1819
1915
  /** `expectedUpdatedAt` is the version the dialog was showing, so a save can't overwrite a newer change. */
1916
+ /** `confirmation` is the preview's, when booked sessions change with the service. */
1820
1917
  const arrangementEditSchema = z.object({
1821
1918
  ...operation,
1919
+ confirmation: z.string().optional(),
1822
1920
  expectedUpdatedAt: z.string().min(1),
1823
1921
  serviceId: z.string().uuid(),
1824
1922
  holdsTime: z.boolean(),
@@ -1940,6 +2038,19 @@ const arrangementDateResultSchema = z.intersection(z.object({ occurrenceDate: lo
1940
2038
  })
1941
2039
  ])
1942
2040
  }),
2041
+ z.object({
2042
+ outcome: z.literal("service_changed"),
2043
+ appointmentId: z.string(),
2044
+ startAt: z.string(),
2045
+ endAt: z.string(),
2046
+ previousEndAt: z.string(),
2047
+ price: z.discriminatedUnion("kind", [z.object({
2048
+ kind: z.literal("restated"),
2049
+ fromCents: z.number().int(),
2050
+ toCents: z.number().int(),
2051
+ currency: z.string()
2052
+ }), z.object({ kind: z.literal("kept") })])
2053
+ }),
1943
2054
  z.object({
1944
2055
  outcome: z.literal("cancelled"),
1945
2056
  appointmentId: z.string(),
@@ -4108,11 +4219,6 @@ const eventCalendarListLayoutCompatibleDisplayModeValues = ["combined", "list"];
4108
4219
  //#region ../site-contracts/src/siteData/eventCheckoutTypes.ts
4109
4220
  /** The most dates or runs one booking request may name; the block stops ticking at the same number. */
4110
4221
  const MAX_EVENT_BOOKING_SELECTION_ITEMS = 20;
4111
- /**
4112
- * The most earlier bookings one request may name as its own. A tab holds one place at a time, so the
4113
- * few are that booking and the attempts that might have replaced it.
4114
- */
4115
- const MAX_REPLACED_REGISTRATION_COMMAND_IDS = 3;
4116
4222
 
4117
4223
  //#endregion
4118
4224
  //#region ../site-contracts/src/siteData/eventSelectionFunding.ts
@@ -4339,12 +4445,19 @@ const ORDER_ITEM_KINDS = [
4339
4445
  "pass",
4340
4446
  "event_series_registration",
4341
4447
  "appointment",
4342
- "membership"
4448
+ "membership",
4449
+ "gift"
4343
4450
  ];
4344
4451
  const orderItemKindSet = new Set(ORDER_ITEM_KINDS);
4345
4452
  function isOrderItemKind(value) {
4346
4453
  return orderItemKindSet.has(value);
4347
4454
  }
4455
+ function parseOrderItemKind(value) {
4456
+ return isOrderItemKind(value) ? ok(value) : err({
4457
+ kind: "invalid_order_item_kind",
4458
+ value
4459
+ });
4460
+ }
4348
4461
 
4349
4462
  //#endregion
4350
4463
  //#region ../commerce/src/utils/assertNever.ts
@@ -6477,7 +6590,7 @@ function isShopRefundablePaymentMethod(paymentMethod) {
6477
6590
  //#endregion
6478
6591
  //#region ../commerce/src/purchase/orderItemSupport.ts
6479
6592
  function isShopRefundableOrderItem(item) {
6480
- return item.kind === "product" || item.kind === "pass";
6593
+ return item.kind === "product" || item.kind === "pass" || item.kind === "gift";
6481
6594
  }
6482
6595
  function usesShopRefundFlow(paymentMethod, item) {
6483
6596
  return isShopRefundablePaymentMethod(paymentMethod) && isShopRefundableOrderItem(item);
@@ -6510,6 +6623,7 @@ function partitionActiveUnshippedOrderItems(items, shippedQuantityByItemId) {
6510
6623
  }
6511
6624
  function fallbackOrderItemDisplayName(kind) {
6512
6625
  switch (kind) {
6626
+ case "gift": return "Gift";
6513
6627
  case "product": return "Product";
6514
6628
  case "pass": return "Pass";
6515
6629
  case "membership": return "Membership";
@@ -6568,6 +6682,7 @@ function bookingCancellationIdentity(item) {
6568
6682
  case "appointment": return item.appointmentId ? `appointment:${item.appointmentId}` : null;
6569
6683
  case "membership":
6570
6684
  case "pass":
6685
+ case "gift":
6571
6686
  case "product": return null;
6572
6687
  }
6573
6688
  }
@@ -6914,6 +7029,13 @@ function planItem(item, input) {
6914
7029
  orderItemId: item.id
6915
7030
  }]
6916
7031
  };
7032
+ case "gift": return item.giftingInstrumentId ? {
7033
+ warnings: [],
7034
+ actions: [{
7035
+ kind: "deliver_gift",
7036
+ giftingInstrumentId: item.giftingInstrumentId
7037
+ }]
7038
+ } : noActions();
6917
7039
  case "product": return noActions();
6918
7040
  }
6919
7041
  }
@@ -6928,7 +7050,7 @@ function buildOrderCompletionEmailPlan(input) {
6928
7050
  const id$1 = bookingGroupId(item);
6929
7051
  return id$1 === null || !input.items.slice(0, index).some((previous) => bookingGroupId(previous) === id$1);
6930
7052
  }).map((item) => planItem(item, input));
6931
- const receipt = input.items.some((item) => item.kind === "product" || item.kind === "pass") ? [{
7053
+ const receipt = input.items.some((item) => item.kind === "product" || item.kind === "pass" || item.kind === "gift") ? [{
6932
7054
  kind: "send_order_confirmation",
6933
7055
  orderId: first.orderId
6934
7056
  }] : [];
@@ -7256,6 +7378,409 @@ function resolveRecurringInterval(planDefinition) {
7256
7378
  }
7257
7379
  }
7258
7380
 
7381
+ //#endregion
7382
+ //#region ../commerce/src/gifting/voucherScope.ts
7383
+ const voucherScopeSchema = z.discriminatedUnion("kind", [
7384
+ z.object({
7385
+ kind: z.literal("event_offering"),
7386
+ eventOfferingId: z.string().uuid()
7387
+ }),
7388
+ z.object({
7389
+ kind: z.literal("event_category"),
7390
+ eventCategoryId: z.string().uuid()
7391
+ }),
7392
+ z.object({ kind: z.literal("any_event") }),
7393
+ z.object({
7394
+ kind: z.literal("appointment_service"),
7395
+ serviceId: z.string().uuid()
7396
+ }),
7397
+ z.object({ kind: z.literal("any_appointment") })
7398
+ ]);
7399
+ function matchesVoucherScope(scope, context) {
7400
+ switch (scope.kind) {
7401
+ case "event_offering": return context.type === "event" && context.eventOfferingId === scope.eventOfferingId;
7402
+ case "event_category": return context.type === "event" && context.eventCategoryId === scope.eventCategoryId;
7403
+ case "any_event": return context.type === "event";
7404
+ case "appointment_service": return context.type === "appointment" && context.serviceId === scope.serviceId;
7405
+ case "any_appointment": return context.type === "appointment";
7406
+ }
7407
+ }
7408
+
7409
+ //#endregion
7410
+ //#region ../commerce/src/gifting/domain.ts
7411
+ /**
7412
+ * Dashboard status filter for the gifts list. `all` means "no status filter";
7413
+ * the rest are derived buckets, not raw column values.
7414
+ */
7415
+ const GIFTING_STATUS_FILTERS = [
7416
+ "all",
7417
+ "waiting",
7418
+ "sent",
7419
+ "done",
7420
+ "expiring_soon",
7421
+ "expired",
7422
+ "attention"
7423
+ ];
7424
+ const unsafeAsGiftingCode = (value) => value;
7425
+ const unsafeAsGiftingNormalizedCode = (value) => value;
7426
+ const unsafeAsGiftingClaimTokenPublicId = (value) => value;
7427
+ const unsafeAsGiftingClaimTokenSecretHash = (value) => value;
7428
+ const unsafeAsGiftCardClaimLinkToken = (value) => value;
7429
+ function serializeGiftCardClaimLinkToken(input) {
7430
+ return unsafeAsGiftCardClaimLinkToken(`${input.publicId}.${input.secret}`);
7431
+ }
7432
+ const DEFAULT_GIFT_CARD_DENOMINATION_CENTS = [
7433
+ 2e3,
7434
+ 3e3,
7435
+ 5e3,
7436
+ 1e4
7437
+ ];
7438
+ const DEFAULT_GIFT_CARD_CUSTOM_MIN_CENTS = 2e3;
7439
+ const DEFAULT_GIFT_CARD_CUSTOM_MAX_CENTS = 1e5;
7440
+ const giftCardAmountConfigSchema = z.object({
7441
+ fixedDenominations: z.array(z.number().int().positive()).min(1),
7442
+ customAmount: z.object({
7443
+ enabled: z.boolean(),
7444
+ minCents: z.number().int().positive(),
7445
+ maxCents: z.number().int().positive()
7446
+ })
7447
+ });
7448
+ const giftCardOfferConfigSchema = z.object({
7449
+ kind: z.literal("gift_card"),
7450
+ amountConfig: giftCardAmountConfigSchema
7451
+ });
7452
+ const voucherOfferConfigSchema = z.object({
7453
+ kind: z.literal("voucher"),
7454
+ purchaseAmountCents: z.number().int().positive(),
7455
+ scope: voucherScopeSchema
7456
+ });
7457
+ /** Parses a stored `config_json` payload for either offer kind. */
7458
+ const giftingOfferConfigSchema = z.union([giftCardOfferConfigSchema, voucherOfferConfigSchema]);
7459
+ const giftingOfferSnapshotSchema = z.discriminatedUnion("kind", [z.object({
7460
+ id: z.string().uuid(),
7461
+ kind: z.literal("gift_card"),
7462
+ title: z.string(),
7463
+ description: z.string().nullable(),
7464
+ config: giftCardOfferConfigSchema
7465
+ }), z.object({
7466
+ id: z.string().uuid(),
7467
+ kind: z.literal("voucher"),
7468
+ title: z.string(),
7469
+ description: z.string().nullable(),
7470
+ config: voucherOfferConfigSchema
7471
+ })]).transform(asGiftingOfferSnapshot);
7472
+ function createDefaultGiftCardAmountConfig() {
7473
+ return {
7474
+ fixedDenominations: DEFAULT_GIFT_CARD_DENOMINATION_CENTS,
7475
+ customAmount: {
7476
+ enabled: true,
7477
+ minCents: DEFAULT_GIFT_CARD_CUSTOM_MIN_CENTS,
7478
+ maxCents: DEFAULT_GIFT_CARD_CUSTOM_MAX_CENTS
7479
+ }
7480
+ };
7481
+ }
7482
+ function asGiftingOfferSnapshot(input) {
7483
+ if (input.kind === "gift_card" && input.config.kind === "gift_card") {
7484
+ return {
7485
+ id: unsafeAsGiftingOfferId(input.id),
7486
+ kind: "gift_card",
7487
+ title: input.title,
7488
+ description: input.description,
7489
+ config: input.config
7490
+ };
7491
+ }
7492
+ if (input.kind === "voucher" && input.config.kind === "voucher") {
7493
+ return {
7494
+ id: unsafeAsGiftingOfferId(input.id),
7495
+ kind: "voucher",
7496
+ title: input.title,
7497
+ description: input.description,
7498
+ config: input.config
7499
+ };
7500
+ }
7501
+ throw new Error(`Offer ${input.id} has mismatched kind/config.`);
7502
+ }
7503
+ function parseGiftingOfferSnapshot(raw) {
7504
+ const parsed = z.safeParse(giftingOfferSnapshotSchema, raw);
7505
+ if (!parsed.success) {
7506
+ return null;
7507
+ }
7508
+ return parsed.data;
7509
+ }
7510
+ function normalizeGiftingCode(code) {
7511
+ return unsafeAsGiftingNormalizedCode(code.trim().toUpperCase());
7512
+ }
7513
+ function deriveGiftingExpiryIso(input) {
7514
+ const issuedAtMs = Date.parse(input.issuedAtIso);
7515
+ const expiryMs = issuedAtMs + input.settings.expiryDays * 24 * 60 * 60 * 1e3;
7516
+ return new Date(expiryMs).toISOString();
7517
+ }
7518
+ function validateGiftCardAmountCents(config, amountCents) {
7519
+ if (!Number.isFinite(amountCents) || !Number.isInteger(amountCents) || amountCents <= 0) {
7520
+ return err({
7521
+ code: "invalid_amount",
7522
+ message: "Choose a valid gift card amount."
7523
+ });
7524
+ }
7525
+ if (config.fixedDenominations.includes(amountCents)) {
7526
+ return ok(amountCents);
7527
+ }
7528
+ if (!config.customAmount.enabled) {
7529
+ return err({
7530
+ code: "custom_amount_disabled",
7531
+ message: "Custom gift card amounts are not enabled for this offer."
7532
+ });
7533
+ }
7534
+ if (amountCents < config.customAmount.minCents) {
7535
+ return err({
7536
+ code: "amount_below_minimum",
7537
+ message: "This gift card amount is below the minimum allowed value."
7538
+ });
7539
+ }
7540
+ if (amountCents > config.customAmount.maxCents) {
7541
+ return err({
7542
+ code: "amount_above_maximum",
7543
+ message: "This gift card amount is above the maximum allowed value."
7544
+ });
7545
+ }
7546
+ return ok(amountCents);
7547
+ }
7548
+ function groupPublicOffersByKind(offers) {
7549
+ const giftCards = [];
7550
+ const vouchers = [];
7551
+ for (const offer of offers) {
7552
+ if (offer.kind === "gift_card") {
7553
+ giftCards.push(offer);
7554
+ continue;
7555
+ }
7556
+ vouchers.push(offer);
7557
+ }
7558
+ return {
7559
+ giftCards,
7560
+ vouchers
7561
+ };
7562
+ }
7563
+ function classifyDiscountCodeOrigin(input) {
7564
+ return typeof input.giftingInstrumentId === "string" && input.giftingInstrumentId.length > 0 ? {
7565
+ kind: "voucher",
7566
+ instrumentId: unsafeAsGiftingInstrumentId(input.giftingInstrumentId)
7567
+ } : { kind: "standard" };
7568
+ }
7569
+ function voucherNotApplicableMessage(origin) {
7570
+ return origin.kind === "voucher" ? "This voucher is valid, but not for anything you're purchasing here." : "Discount code is not valid for this booking";
7571
+ }
7572
+ function isVoucherDiscountOrigin(origin) {
7573
+ return origin.kind === "voucher";
7574
+ }
7575
+ function planVoucherSingleUnitDiscount(candidates) {
7576
+ let best = null;
7577
+ for (const candidate of candidates) {
7578
+ if (!Number.isFinite(candidate.unitPriceCents) || candidate.unitPriceCents <= 0 || candidate.quantity <= 0) {
7579
+ continue;
7580
+ }
7581
+ if (!best) {
7582
+ best = candidate;
7583
+ continue;
7584
+ }
7585
+ if (candidate.unitPriceCents > best.unitPriceCents) {
7586
+ best = candidate;
7587
+ continue;
7588
+ }
7589
+ if (candidate.unitPriceCents === best.unitPriceCents && candidate.lineId.localeCompare(best.lineId) < 0) {
7590
+ best = candidate;
7591
+ }
7592
+ }
7593
+ if (!best) {
7594
+ return null;
7595
+ }
7596
+ return {
7597
+ mode: "single_eligible_unit",
7598
+ selectedLineId: best.lineId,
7599
+ amountCents: best.unitPriceCents
7600
+ };
7601
+ }
7602
+ function toDomainGiftingInstrument(instrument, nowIso) {
7603
+ const offerSnapshot = parseGiftingOfferSnapshot(instrument.offerSnapshotJson);
7604
+ if (instrument.offerSnapshotJson != null && !offerSnapshot) {
7605
+ return err({
7606
+ code: "invalid_offer_snapshot",
7607
+ message: `Instrument ${instrument.id} has an invalid offer snapshot.`
7608
+ });
7609
+ }
7610
+ const delivery = parseGiftingDelivery(instrument);
7611
+ if (!delivery) {
7612
+ return err({
7613
+ code: "invalid_delivery_state",
7614
+ message: `Instrument ${instrument.id} has an invalid delivery state.`
7615
+ });
7616
+ }
7617
+ const base = {
7618
+ raw: instrument,
7619
+ id: unsafeAsGiftingInstrumentId(instrument.id),
7620
+ offerId: instrument.offerId ? unsafeAsGiftingOfferId(instrument.offerId) : null,
7621
+ issuanceKind: instrument.issuanceKind,
7622
+ code: unsafeAsGiftingCode(instrument.code),
7623
+ codeNormalized: unsafeAsGiftingNormalizedCode(instrument.codeNormalized),
7624
+ delivery,
7625
+ recipientEmail: instrument.recipientEmail,
7626
+ recipientName: instrument.recipientName,
7627
+ purchaserEmail: instrument.purchaserEmail,
7628
+ purchaserName: instrument.purchaserName,
7629
+ message: instrument.message,
7630
+ expiresAt: instrument.expiresAt,
7631
+ offerSnapshot
7632
+ };
7633
+ const lifecycle = deriveGiftingLifecycle({
7634
+ state: instrument.state,
7635
+ expiresAt: instrument.expiresAt,
7636
+ nowIso
7637
+ });
7638
+ if (instrument.kind === "gift_card") {
7639
+ return parseGiftCardInstrument(instrument, base, lifecycle);
7640
+ }
7641
+ return parseVoucherInstrument(instrument, base, lifecycle);
7642
+ }
7643
+ function parseGiftCardInstrument(instrument, base, lifecycle) {
7644
+ const amountCents = instrument.amountCents;
7645
+ const currency = instrument.currency;
7646
+ if (typeof amountCents !== "number" || !Number.isInteger(amountCents) || amountCents <= 0 || typeof currency !== "string" || currency.length === 0) {
7647
+ return err({
7648
+ code: "invalid_gift_card_state",
7649
+ message: `Gift card ${instrument.id} is missing amount or currency.`
7650
+ });
7651
+ }
7652
+ switch (lifecycle) {
7653
+ case "issued":
7654
+ if (!instrument.claimTokenPublicId || !instrument.claimTokenSecretHash) {
7655
+ return err({
7656
+ code: "invalid_gift_card_state",
7657
+ message: `Issued gift card ${instrument.id} is missing claim token fields.`
7658
+ });
7659
+ }
7660
+ return ok({
7661
+ ...base,
7662
+ kind: "gift_card",
7663
+ lifecycle: "issued",
7664
+ amountCents,
7665
+ currency,
7666
+ claimTokenPublicId: unsafeAsGiftingClaimTokenPublicId(instrument.claimTokenPublicId),
7667
+ claimTokenSecretHash: unsafeAsGiftingClaimTokenSecretHash(instrument.claimTokenSecretHash)
7668
+ });
7669
+ case "claimed":
7670
+ if (!instrument.claimedCustomerId || !instrument.claimedByEmail || !instrument.claimedAt) {
7671
+ return err({
7672
+ code: "invalid_gift_card_state",
7673
+ message: `Claimed gift card ${instrument.id} is missing claim fields.`
7674
+ });
7675
+ }
7676
+ return ok({
7677
+ ...base,
7678
+ kind: "gift_card",
7679
+ lifecycle: "claimed",
7680
+ amountCents,
7681
+ currency,
7682
+ claimedCustomerId: unsafeAsCustomerId(instrument.claimedCustomerId),
7683
+ claimedByEmail: instrument.claimedByEmail,
7684
+ claimedAt: instrument.claimedAt
7685
+ });
7686
+ case "expired": return ok({
7687
+ ...base,
7688
+ kind: "gift_card",
7689
+ lifecycle: "expired",
7690
+ amountCents,
7691
+ currency
7692
+ });
7693
+ case "cancelled": return ok({
7694
+ ...base,
7695
+ kind: "gift_card",
7696
+ lifecycle: "cancelled",
7697
+ amountCents,
7698
+ currency
7699
+ });
7700
+ case "redeemed": return err({
7701
+ code: "invalid_gift_card_state",
7702
+ message: `Gift card ${instrument.id} has unsupported lifecycle ${lifecycle}.`
7703
+ });
7704
+ }
7705
+ }
7706
+ function parseVoucherInstrument(instrument, base, lifecycle) {
7707
+ if (!instrument.discountCodeId) {
7708
+ return err({
7709
+ code: "invalid_voucher_state",
7710
+ message: `Voucher ${instrument.id} is missing its discount code link.`
7711
+ });
7712
+ }
7713
+ switch (lifecycle) {
7714
+ case "issued": return ok({
7715
+ ...base,
7716
+ kind: "voucher",
7717
+ lifecycle: "issued",
7718
+ discountCodeId: instrument.discountCodeId
7719
+ });
7720
+ case "redeemed":
7721
+ if (!instrument.redeemedAt) {
7722
+ return err({
7723
+ code: "invalid_voucher_state",
7724
+ message: `Redeemed voucher ${instrument.id} is missing redeemedAt.`
7725
+ });
7726
+ }
7727
+ return ok({
7728
+ ...base,
7729
+ kind: "voucher",
7730
+ lifecycle: "redeemed",
7731
+ discountCodeId: instrument.discountCodeId,
7732
+ redeemedAt: instrument.redeemedAt
7733
+ });
7734
+ case "expired": return ok({
7735
+ ...base,
7736
+ kind: "voucher",
7737
+ lifecycle: "expired",
7738
+ discountCodeId: instrument.discountCodeId
7739
+ });
7740
+ case "cancelled": return ok({
7741
+ ...base,
7742
+ kind: "voucher",
7743
+ lifecycle: "cancelled",
7744
+ discountCodeId: instrument.discountCodeId
7745
+ });
7746
+ case "claimed": return err({
7747
+ code: "invalid_voucher_state",
7748
+ message: `Voucher ${instrument.id} has unsupported lifecycle ${lifecycle}.`
7749
+ });
7750
+ }
7751
+ }
7752
+ function parseGiftingDelivery(instrument) {
7753
+ switch (instrument.deliveryState) {
7754
+ case "scheduled": return instrument.scheduledSendAt ? {
7755
+ kind: "scheduled",
7756
+ scheduledSendAt: instrument.scheduledSendAt
7757
+ } : null;
7758
+ case "ready_to_send": return { kind: "ready_to_send" };
7759
+ case "sent": return instrument.sentAt ? {
7760
+ kind: "sent",
7761
+ sentAt: instrument.sentAt
7762
+ } : null;
7763
+ case "failed": return { kind: "failed" };
7764
+ case "cancelled": return { kind: "cancelled" };
7765
+ }
7766
+ }
7767
+ function deriveGiftingLifecycle(input) {
7768
+ if (input.state === "cancelled") {
7769
+ return "cancelled";
7770
+ }
7771
+ if (input.state === "claimed") {
7772
+ return "claimed";
7773
+ }
7774
+ if (input.state === "redeemed") {
7775
+ return "redeemed";
7776
+ }
7777
+ if (input.state === "expired") {
7778
+ return "expired";
7779
+ }
7780
+ if (input.expiresAt && input.expiresAt < input.nowIso) return "expired";
7781
+ return "issued";
7782
+ }
7783
+
7259
7784
  //#endregion
7260
7785
  //#region ../commerce/src/purchase/stripeCommissionMetadata.ts
7261
7786
  /** Reasons are payment evidence, not an independent pricing policy. */
@@ -7434,6 +7959,33 @@ function parseOptionalDatedOfferingOrderItemEngineMetadata(raw) {
7434
7959
  const checkout = parseDatedOfferingOrderItemEngineMetadata(raw);
7435
7960
  return checkout.ok ? checkout : err("Invalid dated offering order item metadata");
7436
7961
  }
7962
+ const giftSummarySchema = z.object({
7963
+ offerId: z.string().min(1),
7964
+ displayName: z.string().min(1),
7965
+ giftKind: z.enum(["gift_card", "voucher"]),
7966
+ amountCents: z.number().int().nonnegative()
7967
+ });
7968
+ const giftMetadataSchema = z.discriminatedUnion("stage", [giftSummarySchema.extend({ stage: z.literal("summary") }), giftSummarySchema.extend({
7969
+ stage: z.literal("request"),
7970
+ recipientName: z.string().nullable(),
7971
+ recipientEmail: z.string().min(1),
7972
+ message: z.string().nullable(),
7973
+ sendAt: z.string().refine((value) => Number.isFinite(Date.parse(value))).nullable(),
7974
+ issuance: z.object({
7975
+ offer: giftingOfferSnapshotSchema,
7976
+ expiryDays: z.number().int().positive(),
7977
+ currency: z.string().length(3)
7978
+ })
7979
+ })]);
7980
+ function parseGiftOrderItemMetadata(raw) {
7981
+ const parsed = giftMetadataSchema.safeParse(raw);
7982
+ if (!parsed.success) return err("Invalid gift order item metadata");
7983
+ const commission = parseStripeBookingCommissionMetadata(raw);
7984
+ return commission.ok ? ok({
7985
+ ...parsed.data,
7986
+ ...commission.value
7987
+ }) : err(commission.error);
7988
+ }
7437
7989
  function isObjectRecord(raw) {
7438
7990
  return raw != null && typeof raw === "object" && !Array.isArray(raw);
7439
7991
  }
@@ -7482,6 +8034,7 @@ function parseOrderItemMetadata(kind, raw) {
7482
8034
  const commissionMetadata = parseStripeBookingCommissionMetadata(raw);
7483
8035
  if (!commissionMetadata.ok) return err(commissionMetadata.error);
7484
8036
  switch (kind) {
8037
+ case "gift": return parseGiftOrderItemMetadata(raw);
7485
8038
  case "event_ticket": {
7486
8039
  const checkoutLineMetadata = parseCheckoutLineMetadata(raw);
7487
8040
  const pricingMetadata = parseBookableOrderItemPricingMetadata(raw);
@@ -8680,8 +9233,8 @@ function planShopRefund(order, shopItems) {
8680
9233
  const refundableItems = shopItems.map((item) => ({
8681
9234
  item,
8682
9235
  displayName: getOrderItemDisplayName(item),
8683
- refundMode: "refund_and_revoke",
8684
- sourceType: item.kind === "pass" ? "pass_order_refund" : "product_order_refund"
9236
+ refundMode: item.kind === "gift" ? "refund_only" : "refund_and_revoke",
9237
+ sourceType: item.kind === "pass" ? "pass_order_refund" : item.kind === "gift" ? "gift_order_refund" : "product_order_refund"
8685
9238
  }));
8686
9239
  return {
8687
9240
  ok: true,
@@ -8817,39 +9370,6 @@ function orderRefundNeedsReconciliation(refund) {
8817
9370
  return !orderRefundEffectsComplete(refund.entitlementActionStatus) || refund.status === "reconciliation_needed" || refund.status === "failed";
8818
9371
  }
8819
9372
 
8820
- //#endregion
8821
- //#region ../commerce/src/purchase/eventCheckoutRecoveryWindow.ts
8822
- const EVENT_CHECKOUT_HOLD_DURATION_MS = 35 * 60 * 1e3;
8823
- /** The crons that release lapsed holds run every five minutes, so a place can stay held this much longer. */
8824
- const EVENT_CHECKOUT_HOLD_SWEEP_ALLOWANCE_MS = 5 * 60 * 1e3;
8825
- /**
8826
- * How long after an unfinished checkout starts its places are free again, in whole minutes. Copy that
8827
- * tells a booker when to try again reads this ("about 40 minutes"), so it follows the hold if that changes.
8828
- */
8829
- const EVENT_CHECKOUT_PLACES_FREE_AFTER_MINUTES = Math.ceil((EVENT_CHECKOUT_HOLD_DURATION_MS + EVENT_CHECKOUT_HOLD_SWEEP_ALLOWANCE_MS) / 6e4);
8830
- const EVENT_CHECKOUT_RECOVERY_GRACE_MS = 24 * 60 * 60 * 1e3;
8831
- /** Admission deadlines close new bookings; an admitted payment gets the full hold window. */
8832
- function eventCheckoutPaymentDeadlineEpoch(deadlineEpoch, nowMs) {
8833
- return Math.max(deadlineEpoch, Math.floor((nowMs + EVENT_CHECKOUT_HOLD_DURATION_MS) / 1e3));
8834
- }
8835
- function validInstant(value) {
8836
- const instant = Date.parse(value);
8837
- return Number.isFinite(instant) ? instant : null;
8838
- }
8839
- function eventCheckoutProvisionalRecoverableUntil(now) {
8840
- return new Date(now.getTime() + EVENT_CHECKOUT_HOLD_DURATION_MS + EVENT_CHECKOUT_RECOVERY_GRACE_MS).toISOString();
8841
- }
8842
- function eventCheckoutRecoverableUntil(input) {
8843
- const holdExpiresAt = validInstant(input.holdExpiresAt);
8844
- const sessionExpiresAt = input.sessionExpiresAtEpochSeconds * 1e3;
8845
- if (holdExpiresAt === null || !Number.isFinite(sessionExpiresAt)) return null;
8846
- return new Date(Math.max(holdExpiresAt, sessionExpiresAt) + EVENT_CHECKOUT_RECOVERY_GRACE_MS).toISOString();
8847
- }
8848
- function eventCheckoutRecoveryIsDiscoverable(recoverableUntil, now) {
8849
- const instant = validInstant(recoverableUntil);
8850
- return instant !== null && instant > now.getTime();
8851
- }
8852
-
8853
9373
  //#endregion
8854
9374
  //#region ../commerce/src/purchase/roomWords.ts
8855
9375
  const PEOPLE_WORD = {
@@ -8933,19 +9453,18 @@ const fundingChangedMessages = {
8933
9453
  membership: "Your membership changed since you chose it. Check how you’d like to pay and try again."
8934
9454
  };
8935
9455
  /**
8936
- * Said to a booker whose earlier unfinished booking this one can't replace, because nothing shows the
8937
- * earlier one is theirs (#1832). They aren't where that booking is, so it can't ask them to pay for it
8938
- * or cancel it here: it sends them back to where they started, or tells them when the places free up.
9456
+ * Said to a booker whose earlier booking this one can't replace, because its payment has started (or
9457
+ * can't be checked yet). An unpaid one would just be replaced (#1832). It doesn't hand back the earlier
9458
+ * booking, so it tells them where the answer will come from: the confirmation email, or the organiser.
8939
9459
  */
8940
9460
  function earlierBookingUnpaid(subject, otherwise = "") {
8941
- const booking = subject === null ? "a booking" : `a booking for ${subject}`;
8942
- return `You’ve already started ${booking} that isn’t paid yet. Go back to where you started it to pay, ${otherwise}or try again in about ${EVENT_CHECKOUT_PLACES_FREE_AFTER_MINUTES} minutes.`;
9461
+ const started = subject === null ? "You’ve already started paying for an earlier booking, so we can’t take another one." : `You’ve already started paying for ${subject}, so we can’t take another booking for it.`;
9462
+ return `${started} ${otherwise}If that payment goes through, you’ll get a confirmation email. If you don’t get one, please contact the organiser.`;
8943
9463
  }
8944
9464
  /** The server picks one of these, since it knows the date and what else was chosen; the form shows it as sent. */
8945
9465
  const earlierBookingUnpaidMessages = {
8946
9466
  oneDate: (date) => earlierBookingUnpaid(date),
8947
- amongDates: (date) => earlierBookingUnpaid(date, "untick that date, "),
8948
- thisDate: earlierBookingUnpaid("this date"),
9467
+ amongDates: (date) => earlierBookingUnpaid(date, "You can untick that date to book the others. "),
8949
9468
  run: earlierBookingUnpaid("this run")
8950
9469
  };
8951
9470
  const eventRegistrationErrors = {
@@ -9119,6 +9638,32 @@ function eventRegistrationErrorEndsCommand(value) {
9119
9638
  return reason !== null && eventRegistrationErrors[reason].endsCommand;
9120
9639
  }
9121
9640
 
9641
+ //#endregion
9642
+ //#region ../commerce/src/purchase/eventCheckoutRecoveryWindow.ts
9643
+ const EVENT_CHECKOUT_HOLD_DURATION_MS = 35 * 60 * 1e3;
9644
+ const EVENT_CHECKOUT_RECOVERY_GRACE_MS = 24 * 60 * 60 * 1e3;
9645
+ /** Admission deadlines close new bookings; an admitted payment gets the full hold window. */
9646
+ function eventCheckoutPaymentDeadlineEpoch(deadlineEpoch, nowMs) {
9647
+ return Math.max(deadlineEpoch, Math.floor((nowMs + EVENT_CHECKOUT_HOLD_DURATION_MS) / 1e3));
9648
+ }
9649
+ function validInstant(value) {
9650
+ const instant = Date.parse(value);
9651
+ return Number.isFinite(instant) ? instant : null;
9652
+ }
9653
+ function eventCheckoutProvisionalRecoverableUntil(now) {
9654
+ return new Date(now.getTime() + EVENT_CHECKOUT_HOLD_DURATION_MS + EVENT_CHECKOUT_RECOVERY_GRACE_MS).toISOString();
9655
+ }
9656
+ function eventCheckoutRecoverableUntil(input) {
9657
+ const holdExpiresAt = validInstant(input.holdExpiresAt);
9658
+ const sessionExpiresAt = input.sessionExpiresAtEpochSeconds * 1e3;
9659
+ if (holdExpiresAt === null || !Number.isFinite(sessionExpiresAt)) return null;
9660
+ return new Date(Math.max(holdExpiresAt, sessionExpiresAt) + EVENT_CHECKOUT_RECOVERY_GRACE_MS).toISOString();
9661
+ }
9662
+ function eventCheckoutRecoveryIsDiscoverable(recoverableUntil, now) {
9663
+ const instant = validInstant(recoverableUntil);
9664
+ return instant !== null && instant > now.getTime();
9665
+ }
9666
+
9122
9667
  //#endregion
9123
9668
  //#region ../commerce/src/purchase/checkoutPresentation.ts
9124
9669
  function publishableKeyMode(publishableKey) {
@@ -9196,11 +9741,12 @@ function discountCodeAppliesTo(code, scopes, context, now) {
9196
9741
  }
9197
9742
  /**
9198
9743
  * Public refusal wording also owns the lifecycle check used by applicability. A gift voucher's code is
9199
- * switched off once it's redeemed, so an inactive voucher says it's been used; any other inactive code
9744
+ * switched off once it's redeemed or cancelled, with the gift state distinguishing those outcomes. Any other inactive code
9200
9745
  * reads as unknown, so turning a code off doesn't advertise that it existed.
9201
9746
  */
9202
9747
  function discountCodeAvailabilityMessage(code, now) {
9203
9748
  const voucher = Boolean(code.giftingInstrumentId);
9749
+ if (voucher && code.giftingInstrumentState === "cancelled") return "This gift voucher has been cancelled.";
9204
9750
  if (!code.isActive) return voucher ? "This gift voucher has already been used." : "We don't recognise that code.";
9205
9751
  if (code.startsAt !== null && code.startsAt > now) return "This code isn't active yet.";
9206
9752
  if (code.endsAt !== null && code.endsAt < now) return voucher ? "This gift voucher has expired." : "This code has ended.";
@@ -11662,7 +12208,8 @@ const orderItemSchema = exactSchema()(z.object({
11662
12208
  "event_series_registration",
11663
12209
  "pass",
11664
12210
  "membership",
11665
- "appointment"
12211
+ "appointment",
12212
+ "gift"
11666
12213
  ]),
11667
12214
  displayName: z.string(),
11668
12215
  quantity: z.number(),
@@ -11853,10 +12400,20 @@ const customerPortalWaitlistSubjectSchema = exactSchema()(z.discriminatedUnion("
11853
12400
  startsAt: z.string(),
11854
12401
  endsAt: z.string(),
11855
12402
  timeZone: z.string(),
12403
+ deliveryMode: z.enum([
12404
+ "in_person",
12405
+ "online",
12406
+ "hybrid"
12407
+ ]),
11856
12408
  isOnline: z.boolean()
11857
12409
  }), z.object({
11858
12410
  kind: z.literal("wholeSeries"),
11859
12411
  timeZone: z.string(),
12412
+ deliveryMode: z.enum([
12413
+ "in_person",
12414
+ "online",
12415
+ "hybrid"
12416
+ ]),
11860
12417
  isOnline: z.boolean(),
11861
12418
  eventSeriesId: z.string(),
11862
12419
  scheduleSummary: z.string().nullable()
@@ -11887,6 +12444,7 @@ const waitlistEntryBase = {
11887
12444
  subject: customerPortalWaitlistSubjectSchema,
11888
12445
  eventTitle: z.string(),
11889
12446
  eventPath: z.string().nullable(),
12447
+ venueName: z.string().nullable(),
11890
12448
  requestedPlaces: z.number(),
11891
12449
  joinedAt: z.string()
11892
12450
  };
@@ -11939,6 +12497,25 @@ const portalRegularSessionCadenceSchema = exactSchema()(z.discriminatedUnion("ki
11939
12497
  "last"
11940
12498
  ])
11941
12499
  })]));
12500
+ const patternSchema = exactSchema()(z.object({
12501
+ cadence: z.discriminatedUnion("kind", [z.object({
12502
+ kind: z.literal("weekly"),
12503
+ everyWeeks: z.literal([1, 2])
12504
+ }), z.object({
12505
+ kind: z.literal("monthly"),
12506
+ nth: z.literal([
12507
+ 1,
12508
+ 2,
12509
+ 3,
12510
+ 4,
12511
+ "last"
12512
+ ])
12513
+ })]),
12514
+ days: z.array(z.object({
12515
+ weekday: weekdaySchema,
12516
+ localStart: z.string()
12517
+ })).min(1).readonly()
12518
+ }));
11942
12519
  const dateSchema = exactSchema()(z.union([
11943
12520
  z.object({
11944
12521
  state: z.literal("booked"),
@@ -11965,11 +12542,7 @@ const dateSchema = exactSchema()(z.union([
11965
12542
  const portalRegularSessionSchema = exactSchema()(z.object({
11966
12543
  arrangementId: brandedId(parseClientArrangementId, "regular sessions id"),
11967
12544
  timezone: z.string(),
11968
- schedule: z.object({
11969
- effectiveFrom: z.string(),
11970
- cadence: portalRegularSessionCadenceSchema,
11971
- localStart: z.string()
11972
- }),
12545
+ pattern: patternSchema,
11973
12546
  trainerName: z.string().nullable(),
11974
12547
  serviceName: z.string().nullable(),
11975
12548
  holdsTime: z.boolean(),
@@ -12434,6 +13007,8 @@ const knownTaskSchema = evolvingSchema()(z.discriminatedUnion("kind", [
12434
13007
  ...taskBase,
12435
13008
  kind: z.literal("pay"),
12436
13009
  orderId: z.string(),
13010
+ orderNumber: z.string(),
13011
+ placedAt: z.string(),
12437
13012
  for: portalPaymentForViewSchema,
12438
13013
  due: portalPaymentDueSchema,
12439
13014
  moneyLine: z.string()
@@ -12738,6 +13313,7 @@ const knownEntrySchema = exactSchema()(z.discriminatedUnion("kind", [z.object({
12738
13313
  kind: z.literal("refund"),
12739
13314
  key: z.string(),
12740
13315
  order: paymentOrderSchema,
13316
+ paymentReceiptId: z.string().nullable(),
12741
13317
  ...refundFields
12742
13318
  })]));
12743
13319
  const unsupportedEntrySchema = unknownKind(ENTRY_KINDS).extend({
@@ -14154,6 +14730,59 @@ const GIFTING_ENDPOINT_DEFINITIONS = defineEndpointDefinitions({
14154
14730
  "server:internal_error"
14155
14731
  ]
14156
14732
  },
14733
+ getGiftRefund: {
14734
+ path: "/sites/{siteId}/gifting/refunds/{orderItemId}",
14735
+ method: "GET",
14736
+ auth: "user",
14737
+ responseKind: "json",
14738
+ errors: [
14739
+ "auth:forbidden",
14740
+ "resource:conflict",
14741
+ "server:internal_error"
14742
+ ]
14743
+ },
14744
+ refundGift: {
14745
+ path: "/sites/{siteId}/gifting/refunds/{orderItemId}",
14746
+ method: "POST",
14747
+ auth: "user",
14748
+ responseKind: "json",
14749
+ tags: ["site-{siteId}", "gifting-gifts-{siteId}"],
14750
+ demoMutation: DEMO_MUTATION_BLOCKED_HIDDEN,
14751
+ errors: [
14752
+ "auth:forbidden",
14753
+ "resource:conflict",
14754
+ "server:internal_error"
14755
+ ]
14756
+ },
14757
+ cancelGift: {
14758
+ path: "/sites/{siteId}/gifting/gifts/{giftId}/cancel",
14759
+ method: "POST",
14760
+ tags: ["site-{siteId}", "gifting-gifts-{siteId}"],
14761
+ demoMutation: DEMO_MUTATION_BLOCKED_HIDDEN,
14762
+ auth: "user",
14763
+ responseKind: "json",
14764
+ errors: [
14765
+ "auth:forbidden",
14766
+ "resource:not_found",
14767
+ "resource:conflict",
14768
+ "server:internal_error"
14769
+ ]
14770
+ },
14771
+ changeGiftExpiry: {
14772
+ path: "/sites/{siteId}/gifting/gifts/{giftId}/expiry",
14773
+ method: "POST",
14774
+ tags: ["site-{siteId}", "gifting-gifts-{siteId}"],
14775
+ auth: "user",
14776
+ demoMutation: DEMO_MUTATION_BLOCKED_HIDDEN,
14777
+ responseKind: "json",
14778
+ errors: [
14779
+ "validation:invalid_input",
14780
+ "auth:forbidden",
14781
+ "resource:not_found",
14782
+ "resource:conflict",
14783
+ "server:internal_error"
14784
+ ]
14785
+ },
14157
14786
  updateGiftingSettings: {
14158
14787
  path: "/sites/{siteId}/gifting/settings",
14159
14788
  method: "PATCH",
@@ -16711,6 +17340,22 @@ const ENDPOINT_DEFINITIONS = {
16711
17340
  auth: "user",
16712
17341
  responseKind: "json"
16713
17342
  },
17343
+ getRegisteredDomainContact: {
17344
+ errors: [
17345
+ "resource:not_found",
17346
+ "auth:forbidden",
17347
+ "validation:invalid_input"
17348
+ ],
17349
+ path: "/domains/{domainId}/registrar/contact",
17350
+ method: "GET",
17351
+ auth: "user",
17352
+ tags: [
17353
+ "domains",
17354
+ "domain-{domainId}",
17355
+ "domain-registrar"
17356
+ ],
17357
+ responseKind: "json"
17358
+ },
16714
17359
  updateRegisteredDomainContact: {
16715
17360
  path: "/domains/{domainId}/registrar/contact",
16716
17361
  method: "POST",
@@ -16795,6 +17440,18 @@ const ENDPOINT_DEFINITIONS = {
16795
17440
  auth: "user",
16796
17441
  responseKind: "json"
16797
17442
  },
17443
+ retryDomainEmailSending: {
17444
+ errors: [],
17445
+ path: "/sites/{siteId}/domains/{domainId}/email/retry",
17446
+ method: "POST",
17447
+ tags: [
17448
+ "domains",
17449
+ "domain-{domainId}",
17450
+ "domain-dns"
17451
+ ],
17452
+ auth: "user",
17453
+ responseKind: "json"
17454
+ },
16798
17455
  retryDomainResend: {
16799
17456
  path: "/domains/{domainId}/resend",
16800
17457
  method: "POST",
@@ -20545,7 +21202,11 @@ const ENDPOINT_DEFINITIONS = {
20545
21202
  method: "GET",
20546
21203
  auth: "public",
20547
21204
  responseKind: "json",
20548
- errors: ["resource:not_found", "server:internal_error"]
21205
+ errors: [
21206
+ "resource:not_found",
21207
+ "resource:gone",
21208
+ "server:internal_error"
21209
+ ]
20549
21210
  },
20550
21211
  portalGetBooking: {
20551
21212
  path: "/portal/bookings/{kind}/{bookingId}",
@@ -21034,6 +21695,25 @@ function parseBillingReturn(raw) {
21034
21695
  return parsed.success ? parsed.data : null;
21035
21696
  }
21036
21697
 
21698
+ //#endregion
21699
+ //#region ../api/src/common/releaseOperationPause.ts
21700
+ const RELEASE_PAUSE_KINDS = [
21701
+ "bookings_money",
21702
+ "site_editing",
21703
+ "background_jobs"
21704
+ ];
21705
+ const RELEASE_PAUSE_MAX_DURATION_MS = 30 * 60 * 1e3;
21706
+ const releaseOperationPauseSchema = z.object({
21707
+ kinds: z.array(z.enum(RELEASE_PAUSE_KINDS)),
21708
+ expiresAt: z.string().datetime({ offset: true }).nullable()
21709
+ });
21710
+ const RELEASE_BOOKINGS_PAUSED_MESSAGE = "Bookings are briefly unavailable while we make an update. Please try again in a few minutes.";
21711
+ const RELEASE_STAFF_PAUSED_MESSAGE = "Changes are paused briefly while we make an update. You can still view your site.";
21712
+ /** Expiry belongs to the decision, including a read retained while work was queued. */
21713
+ function releaseOperationIsPaused(pause, kind, now) {
21714
+ return pause.expiresAt !== null && Date.parse(pause.expiresAt) > now && pause.kinds.includes(kind);
21715
+ }
21716
+
21037
21717
  //#endregion
21038
21718
  //#region ../api/src/bookingVerticals.ts
21039
21719
  /**
@@ -21440,9 +22120,15 @@ const pageDesignBoundaryTreatmentSchema = z.discriminatedUnion("kind", [
21440
22120
  slope: z.enum([
21441
22121
  "subtle",
21442
22122
  "balanced",
21443
- "steep"
22123
+ "steep",
22124
+ "steady"
21444
22125
  ]),
21445
22126
  direction: z.enum(["forward", "reverse"])
22127
+ }).strict(),
22128
+ z.object({
22129
+ kind: z.literal("torn-edge"),
22130
+ height: z.enum(["compact"]),
22131
+ cut: z.enum(["holes"])
21446
22132
  }).strict()
21447
22133
  ]);
21448
22134
  const pageDesignUserPinnedBoundaryTreatmentChoiceSchema = z.object({
@@ -22293,7 +22979,11 @@ const BOOKING_SETTINGS_EMAIL_SEND_KEYS = [
22293
22979
  //#endregion
22294
22980
  //#region ../api/src/event-listing-destination.ts
22295
22981
  const EVENT_LISTING_DESTINATION_SETTINGS_KEY = "listingDestination";
22982
+ /** The button's label for an external event with no page: the card is all there is. */
22296
22983
  const DEFAULT_EXTERNAL_EVENT_CTA_LABEL = "View details";
22984
+ /** The button's label for an external event with a page: its title already opens the details. */
22985
+ const DEFAULT_EXTERNAL_EVENT_WITH_PAGE_CTA_LABEL = "Book";
22986
+ const externalEventPageValues = ["own", "none"];
22297
22987
  function isRecord$11(value) {
22298
22988
  return value !== null && typeof value === "object" && !Array.isArray(value);
22299
22989
  }
@@ -22303,16 +22993,32 @@ function normalizeOptionalLabel(value) {
22303
22993
  function normalizeOptionalUrl(value) {
22304
22994
  return typeof value === "string" ? value.trim() : "";
22305
22995
  }
22306
- function normalizeEventListingDestinationInput(value) {
22996
+ function readStoredPage(value) {
22997
+ return value === "own" ? "own" : "none";
22998
+ }
22999
+ function normalizeDestinationInput(value, pageWhenNotGiven) {
22307
23000
  if (!value || value.kind === "native") {
22308
23001
  return { kind: "native" };
22309
23002
  }
22310
23003
  return {
22311
23004
  kind: "external",
22312
23005
  url: normalizeOptionalUrl(value.url),
22313
- label: normalizeOptionalLabel(value.label)
23006
+ label: normalizeOptionalLabel(value.label),
23007
+ page: value.page ?? pageWhenNotGiven
22314
23008
  };
22315
23009
  }
23010
+ /** A new event's destination: an external one has its own page unless told otherwise. */
23011
+ function normalizeEventListingDestinationInput(value) {
23012
+ return normalizeDestinationInput(value, "own");
23013
+ }
23014
+ /**
23015
+ * An existing event's next destination. An omitted `page` keeps the stored
23016
+ * choice; an event switching from booking here to booking elsewhere keeps the
23017
+ * page it already has.
23018
+ */
23019
+ function resolveEventListingDestinationUpdate(current, value) {
23020
+ return normalizeDestinationInput(value, current.kind === "external" ? current.page : "own");
23021
+ }
22316
23022
  function readEventListingDestinationFromSettings(settingsJson) {
22317
23023
  if (!isRecord$11(settingsJson)) {
22318
23024
  return { kind: "native" };
@@ -22324,16 +23030,55 @@ function readEventListingDestinationFromSettings(settingsJson) {
22324
23030
  return {
22325
23031
  kind: "external",
22326
23032
  url: normalizeOptionalUrl(rawDestination.url),
22327
- label: normalizeOptionalLabel(rawDestination.label)
23033
+ label: normalizeOptionalLabel(rawDestination.label),
23034
+ page: readStoredPage(rawDestination.page)
22328
23035
  };
22329
23036
  }
23037
+ /**
23038
+ * Whether the event has a page people are sent to: every event booked here,
23039
+ * and one booked elsewhere that has its own page. Page links, serving, the
23040
+ * Content tab, page checks and taking the page offline follow this;
23041
+ * cancellation, payments and availability follow `kind`.
23042
+ */
23043
+ function eventDestinationHasPage(destination) {
23044
+ return destination.kind === "native" || destination.page === "own";
23045
+ }
23046
+ /**
23047
+ * The page fact for a page backed by several series: a series page has one,
23048
+ * an offering page has its linked series. A valid ordinary offering has exactly
23049
+ * one; if the links are malformed, any series without a page withholds it
23050
+ * rather than guessing which one speaks for it.
23051
+ */
23052
+ function eventPageDestinationFromSettings(linkedSeriesSettings) {
23053
+ const destinations = linkedSeriesSettings.map(readEventListingDestinationFromSettings);
23054
+ if (!destinations.some((destination) => destination.kind === "external")) {
23055
+ return { kind: "native" };
23056
+ }
23057
+ return {
23058
+ kind: "external",
23059
+ page: destinations.every(eventDestinationHasPage) ? "own" : "none"
23060
+ };
23061
+ }
23062
+ /**
23063
+ * Whether an event page is withheld from the public (#1540, #1864).
23064
+ *
23065
+ * Every event keeps its page, and the page's publish state follows Go live as
23066
+ * it does for any event. An event booked on another website without its own
23067
+ * page sends nobody there, so public reads treat that page as not found and
23068
+ * its card links out instead. Switching back to booking on the site, or giving
23069
+ * it its own page, serves the page again as it stands.
23070
+ */
23071
+ function isEventPageWithheld(linkedSeriesSettings) {
23072
+ return !eventDestinationHasPage(eventPageDestinationFromSettings(linkedSeriesSettings));
23073
+ }
22330
23074
  function serializeEventListingDestination(destination) {
22331
23075
  switch (destination.kind) {
22332
23076
  case "native": return { kind: "native" };
22333
23077
  case "external": return {
22334
23078
  kind: "external",
22335
23079
  url: destination.url,
22336
- label: destination.label
23080
+ label: destination.label,
23081
+ page: destination.page
22337
23082
  };
22338
23083
  }
22339
23084
  }
@@ -22371,7 +23116,7 @@ function parseExternalEventUrl(value) {
22371
23116
  }
22372
23117
  }
22373
23118
  function getExternalEventCtaLabel(destination) {
22374
- return destination.label ?? DEFAULT_EXTERNAL_EVENT_CTA_LABEL;
23119
+ return destination.label ?? (destination.page === "own" ? DEFAULT_EXTERNAL_EVENT_WITH_PAGE_CTA_LABEL : DEFAULT_EXTERNAL_EVENT_CTA_LABEL);
22375
23120
  }
22376
23121
  function getEventListingDestinationPublicationIssue(destination) {
22377
23122
  if (destination.kind === "native") {
@@ -22387,26 +23132,43 @@ function getEventListingDestinationPublicationIssue(destination) {
22387
23132
  message: validation.error.message
22388
23133
  };
22389
23134
  }
23135
+ /**
23136
+ * Where a public event sends people. A native event needs its page path. An
23137
+ * external event needs a valid link, and carries its page when it has one and
23138
+ * the page has a path; without a path it links out like an event with no page.
23139
+ */
22390
23140
  function buildPublicEventDestination(input) {
23141
+ const pagePath = input.pagePath.trim() ? input.pagePath : null;
22391
23142
  if (input.listingDestination.kind === "native") {
22392
- if (!input.nativePath.trim()) {
22393
- return null;
22394
- }
22395
- return {
23143
+ return pagePath ? {
22396
23144
  kind: "native",
22397
- mode: input.nativeMode,
22398
- path: input.nativePath
22399
- };
23145
+ mode: input.pageMode,
23146
+ path: pagePath
23147
+ } : null;
22400
23148
  }
22401
23149
  const validation = parseExternalEventUrl(input.listingDestination.url);
22402
23150
  if (!validation.ok) {
22403
23151
  return null;
22404
23152
  }
22405
- return {
23153
+ const base = {
22406
23154
  kind: "external",
22407
23155
  url: validation.url,
22408
23156
  label: getExternalEventCtaLabel(input.listingDestination)
22409
23157
  };
23158
+ return input.listingDestination.page === "own" && pagePath ? {
23159
+ ...base,
23160
+ page: {
23161
+ mode: input.pageMode,
23162
+ path: pagePath
23163
+ }
23164
+ } : base;
23165
+ }
23166
+ /** The page a public destination links to, if it has one. */
23167
+ function publicEventDestinationPage(destination) {
23168
+ return destination.kind === "native" ? {
23169
+ mode: destination.mode,
23170
+ path: destination.path
23171
+ } : destination.page ?? null;
22410
23172
  }
22411
23173
 
22412
23174
  //#endregion
@@ -23702,6 +24464,127 @@ function createPageOperations(http) {
23702
24464
  };
23703
24465
  }
23704
24466
 
24467
+ //#endregion
24468
+ //#region ../site-contracts/src/blocks/editorData.ts
24469
+ const unavailableSiteFacts = { catalogue: { kind: "Unavailable" } };
24470
+ /** The values each fact can take, as data: the manifest schema and the condition check both read it. */
24471
+ const CONDITION_FACT_VALUES = {
24472
+ "catalogue.passes": ["none", "some"],
24473
+ "catalogue.memberships": ["none", "some"]
24474
+ };
24475
+ const noneOrSome = (count) => count > 0 ? "some" : "none";
24476
+ const conditionFactReaders = {
24477
+ "catalogue.passes": (facts) => mapReadinessFact(facts.catalogue, (catalogue) => noneOrSome(catalogue.passes)),
24478
+ "catalogue.memberships": (facts) => mapReadinessFact(facts.catalogue, (catalogue) => noneOrSome(catalogue.memberships))
24479
+ };
24480
+ /** A named fact's value for a condition, or `Unavailable` when the site fact behind it couldn't be read. */
24481
+ function readConditionFact(facts, name) {
24482
+ return conditionFactReaders[name](facts);
24483
+ }
24484
+ function mapReadinessFact(fact, project) {
24485
+ return fact.kind === "Loaded" ? {
24486
+ kind: "Loaded",
24487
+ value: project(fact.value)
24488
+ } : fact;
24489
+ }
24490
+
24491
+ //#endregion
24492
+ //#region ../site-contracts/src/blocks/knobs.ts
24493
+ /** Knob ownership is shared by facets and style-offer validation. */
24494
+ const cardListItemParts = [
24495
+ "media",
24496
+ "title",
24497
+ "text",
24498
+ "facts",
24499
+ "chips",
24500
+ "numeral",
24501
+ "schedule",
24502
+ "dates",
24503
+ "availability",
24504
+ "action",
24505
+ "price",
24506
+ "date-stamp"
24507
+ ];
24508
+ /** Block supply is capability, never a second Look catalogue. */
24509
+ const cardListBlockParts = {
24510
+ "block.feature-cards": [
24511
+ "media",
24512
+ "title",
24513
+ "text",
24514
+ "action"
24515
+ ],
24516
+ "block.offerings-preview": [
24517
+ "media",
24518
+ "title",
24519
+ "text",
24520
+ "facts",
24521
+ "chips",
24522
+ "numeral",
24523
+ "schedule",
24524
+ "dates",
24525
+ "availability",
24526
+ "action",
24527
+ "date-stamp"
24528
+ ],
24529
+ "block.appointment-services": [
24530
+ "media",
24531
+ "title",
24532
+ "text",
24533
+ "facts",
24534
+ "action"
24535
+ ],
24536
+ "block.team-members": [
24537
+ "media",
24538
+ "title",
24539
+ "text",
24540
+ "facts",
24541
+ "chips",
24542
+ "action"
24543
+ ],
24544
+ "block.shop": [
24545
+ "title",
24546
+ "text",
24547
+ "facts",
24548
+ "price",
24549
+ "action"
24550
+ ]
24551
+ };
24552
+ const cardListFamilyBlocks = Object.keys(cardListBlockParts);
24553
+ const cardListKnobBlocks = [...cardListFamilyBlocks, "block.event-calendar"];
24554
+ const lookKnobBlocks = {
24555
+ actionStyle: cardListKnobBlocks,
24556
+ titleSize: "block.hero",
24557
+ imagePosition: [
24558
+ "block.hero",
24559
+ "block.intro",
24560
+ "block.media-text"
24561
+ ],
24562
+ imageShape: ["block.intro", "block.media-text"],
24563
+ aspectRatio: "block.media-text",
24564
+ stickerLine: "block.hero",
24565
+ smallCaption: "block.hero",
24566
+ photoTint: "block.hero",
24567
+ candleGlow: "block.hero",
24568
+ columnGuides: "block.hero",
24569
+ showPhotos: cardListKnobBlocks,
24570
+ cardMarker: cardListFamilyBlocks,
24571
+ dates: "block.offerings-preview",
24572
+ grouping: "block.offerings-preview",
24573
+ columns: "block.feature-cards",
24574
+ listColumns: "block.event-calendar",
24575
+ blackAndWhite: "block.image-gallery",
24576
+ showCapacity: "block.event-calendar",
24577
+ alignment: "block.body-text",
24578
+ autoAdvance: "block.testimonials",
24579
+ quoteCount: "block.testimonials",
24580
+ archFrame: [
24581
+ "block.testimonials",
24582
+ "block.newsletter-signup",
24583
+ "block.form"
24584
+ ],
24585
+ tilt: "block.testimonials"
24586
+ };
24587
+
23705
24588
  //#endregion
23706
24589
  //#region ../site-contracts/src/blocks/fieldUi.ts
23707
24590
  const visibilityLevels = [
@@ -23728,6 +24611,46 @@ const mediaDeliverySchema = z.object({
23728
24611
  ]).optional(),
23729
24612
  strategyOptions: z.record(z.string(), z.unknown()).optional()
23730
24613
  });
24614
+ /**
24615
+ * The key each kind of condition is told apart by. A condition is exactly one
24616
+ * kind, so it carries exactly one of these: two tests together are written as
24617
+ * `allOf`, never as one object with two kinds' keys.
24618
+ */
24619
+ const CONDITION_KIND_KEYS = [
24620
+ "field",
24621
+ "fact",
24622
+ "look",
24623
+ "knob",
24624
+ "template",
24625
+ "observation",
24626
+ "allOf",
24627
+ "anyOf"
24628
+ ];
24629
+ const BLOCK_LOOK_STATES = ["applies", "none"];
24630
+ /** The values each observation can include, as data: the manifest schema reads it. */
24631
+ const BLOCK_OBSERVATION_VALUES = { "classPrices.items": [
24632
+ "session",
24633
+ "discount",
24634
+ "passes"
24635
+ ] };
24636
+ const unknownBlockObservations = { "classPrices.items": { kind: "Unavailable" } };
24637
+ /** Nothing known about the block's place: every condition on it is unknown, so its fields show. */
24638
+ const unknownBlockFacts = {
24639
+ look: { kind: "Unavailable" },
24640
+ template: { kind: "Unavailable" },
24641
+ observations: unknownBlockObservations
24642
+ };
24643
+ /** One case per kind of condition, so a new kind fails to compile wherever conditions are read. */
24644
+ function matchVisibleWhen(condition, cases) {
24645
+ if (condition.allOf !== undefined) return cases.allOf(condition.allOf);
24646
+ if (condition.anyOf !== undefined) return cases.anyOf(condition.anyOf);
24647
+ if (condition.fact !== undefined) return cases.fact(condition);
24648
+ if (condition.look !== undefined) return cases.look(condition);
24649
+ if (condition.knob !== undefined) return cases.knob(condition);
24650
+ if (condition.template !== undefined) return cases.template(condition);
24651
+ if (condition.observation !== undefined) return cases.observation(condition);
24652
+ return cases.field(condition);
24653
+ }
23731
24654
  const visibleWhenPredicateSchema = z.object({
23732
24655
  field: z.string().min(1),
23733
24656
  equals: z.any().optional(),
@@ -23735,13 +24658,51 @@ const visibleWhenPredicateSchema = z.object({
23735
24658
  oneOf: z.array(z.any()).optional(),
23736
24659
  notIn: z.array(z.any()).optional(),
23737
24660
  minItems: z.number().int().nonnegative().optional(),
23738
- maxItems: z.number().int().nonnegative().optional()
24661
+ maxItems: z.number().int().nonnegative().optional(),
24662
+ hasValue: z.boolean().optional()
24663
+ });
24664
+ const visibleWhenFactSchema = z.union([factPredicateSchema("catalogue.passes"), factPredicateSchema("catalogue.memberships")]);
24665
+ function factPredicateSchema(fact) {
24666
+ return z.strictObject({
24667
+ fact: z.literal(fact),
24668
+ is: z.enum(CONDITION_FACT_VALUES[fact])
24669
+ });
24670
+ }
24671
+ const visibleWhenLookSchema = z.strictObject({ look: z.enum(BLOCK_LOOK_STATES) });
24672
+ const lookKnobIds = Object.keys(lookKnobBlocks);
24673
+ const visibleWhenKnobSchema = z.strictObject({
24674
+ knob: z.enum(lookKnobIds),
24675
+ oneOf: z.array(z.string()).min(1)
23739
24676
  });
23740
- const visibleWhenSchema = z.lazy(() => z.union([
24677
+ const visibleWhenTemplateSchema = z.strictObject({ template: z.enum(["product", "page"]) });
24678
+ const visibleWhenObservationSchema = z.strictObject({
24679
+ observation: z.literal("classPrices.items"),
24680
+ includes: z.enum(BLOCK_OBSERVATION_VALUES["classPrices.items"])
24681
+ });
24682
+ /**
24683
+ * A condition carries exactly one kind's key. Checked on the input, before any
24684
+ * arm can strip the keys it doesn't know, so `{ field, equals, look }` is a
24685
+ * declaration error rather than a field test that quietly lost its Look test.
24686
+ */
24687
+ function checkOneConditionKind(value, ctx) {
24688
+ if (typeof value !== "object" || value === null) return;
24689
+ const kinds = CONDITION_KIND_KEYS.filter((key) => key in value);
24690
+ if (kinds.length <= 1) return;
24691
+ ctx.addIssue({
24692
+ code: "custom",
24693
+ message: `A condition tests one thing, but this one has ${kinds.join(", ")}. Put each test in its own condition inside allOf.`
24694
+ });
24695
+ }
24696
+ const visibleWhenSchema = z.lazy(() => z.unknown().superRefine(checkOneConditionKind).pipe(z.union([
24697
+ visibleWhenFactSchema,
24698
+ visibleWhenObservationSchema,
24699
+ visibleWhenLookSchema,
24700
+ visibleWhenKnobSchema,
24701
+ visibleWhenTemplateSchema,
23741
24702
  visibleWhenPredicateSchema,
23742
24703
  z.object({ allOf: z.array(visibleWhenSchema).min(1) }),
23743
24704
  z.object({ anyOf: z.array(visibleWhenSchema).min(1) })
23744
- ]));
24705
+ ])));
23745
24706
  const uiSchema = z.object({
23746
24707
  widget: z.string().optional(),
23747
24708
  preset: z.enum(["disclosure"]).optional(),
@@ -24353,10 +25314,144 @@ function validateManifestLookField(data, ctx) {
24353
25314
  message: "lookField must name an existing single select field"
24354
25315
  });
24355
25316
  }
24356
- const blockSectionDeclarationShape = {
24357
- promotedFields: z.array(z.string().min(1)).optional(),
24358
- lookField: z.string().min(1).optional()
24359
- };
25317
+ const blockLookFieldShape = { lookField: z.string().min(1).optional() };
25318
+
25319
+ //#endregion
25320
+ //#region ../site-contracts/src/blocks/editing.ts
25321
+ const fieldPathSchema = z.string().min(1);
25322
+ const phraseSchema = z.string().min(1);
25323
+ const summaryPartSchema = z.union([
25324
+ z.strictObject({
25325
+ field: fieldPathSchema,
25326
+ on: phraseSchema
25327
+ }),
25328
+ z.strictObject({
25329
+ field: fieldPathSchema,
25330
+ options: z.record(z.string(), phraseSchema.nullable())
25331
+ }),
25332
+ z.strictObject({
25333
+ field: fieldPathSchema,
25334
+ text: z.strictObject({
25335
+ before: z.string().optional(),
25336
+ after: z.string().optional(),
25337
+ empty: phraseSchema.optional()
25338
+ })
25339
+ }),
25340
+ z.strictObject({
25341
+ field: fieldPathSchema,
25342
+ set: phraseSchema,
25343
+ unset: phraseSchema.optional()
25344
+ }),
25345
+ z.strictObject({
25346
+ field: fieldPathSchema,
25347
+ count: z.strictObject({
25348
+ one: phraseSchema,
25349
+ many: phraseSchema
25350
+ })
25351
+ }),
25352
+ z.strictObject({
25353
+ field: fieldPathSchema,
25354
+ chosen: z.strictObject({
25355
+ fallback: phraseSchema,
25356
+ before: z.string().optional(),
25357
+ after: z.string().optional()
25358
+ })
25359
+ })
25360
+ ]);
25361
+ const editingGroupSchema = z.strictObject({
25362
+ id: z.string().regex(/^[a-z][a-z0-9-]*$/u, "A group id is lower-case letters, numbers and hyphens"),
25363
+ title: z.string().min(1),
25364
+ fields: z.array(fieldPathSchema).min(1),
25365
+ summary: z.strictObject({
25366
+ parts: z.array(summaryPartSchema),
25367
+ none: phraseSchema
25368
+ })
25369
+ });
25370
+ const settingsSchema = z.array(z.union([fieldPathSchema, editingGroupSchema]));
25371
+ const blockEditingSchema = z.strictObject({
25372
+ content: z.array(fieldPathSchema),
25373
+ settings: settingsSchema,
25374
+ setup: z.array(fieldPathSchema).optional()
25375
+ });
25376
+ const blockEditingExtensionSchema = z.strictObject({
25377
+ content: z.array(fieldPathSchema).optional(),
25378
+ settings: settingsSchema.optional(),
25379
+ join: z.array(z.strictObject({
25380
+ group: z.string().min(1),
25381
+ fields: z.array(fieldPathSchema).min(1),
25382
+ summary: z.array(summaryPartSchema).optional()
25383
+ })).optional(),
25384
+ setup: z.array(fieldPathSchema).optional()
25385
+ });
25386
+ /** For a block's own declaration: a system manifest or an SDK custom block. */
25387
+ const blockEditingDeclarationShape = { editing: blockEditingSchema.optional() };
25388
+ /** For an SDK field extension on a built-in block. */
25389
+ const blockEditingExtensionShape = { editing: blockEditingExtensionSchema.optional() };
25390
+ /** The most questions setup asks before a block is added. */
25391
+ const MAX_SETUP_FIELDS = 3;
25392
+ /**
25393
+ * A block's declaration with an extension's additions. A `join` naming a
25394
+ * group the block doesn't have is left out here; the layout check reports it,
25395
+ * and its fields go where undeclared fields go.
25396
+ */
25397
+ function mergeBlockEditing(base, extension) {
25398
+ if (!extension) return base;
25399
+ const added = {
25400
+ content: extension.content ?? [],
25401
+ settings: extension.settings ?? [],
25402
+ setup: extension.setup ?? []
25403
+ };
25404
+ if (!base) return placesSomething(extension) ? withSetup({
25405
+ content: added.content,
25406
+ settings: added.settings
25407
+ }, added.setup) : undefined;
25408
+ const joins = extension.join ?? [];
25409
+ return withSetup({
25410
+ content: [...base.content, ...added.content],
25411
+ settings: [...base.settings.map((entry) => typeof entry === "string" ? entry : joined(entry, joins)), ...added.settings]
25412
+ }, [...base.setup ?? [], ...added.setup]);
25413
+ }
25414
+ function placesSomething(extension) {
25415
+ return [
25416
+ extension.content,
25417
+ extension.settings,
25418
+ extension.setup
25419
+ ].some((part) => part !== undefined);
25420
+ }
25421
+ function withSetup(editing, setup) {
25422
+ return setup.length > 0 ? {
25423
+ ...editing,
25424
+ setup
25425
+ } : editing;
25426
+ }
25427
+ function joined(group, joins) {
25428
+ const mine = joins.filter((join$1) => join$1.group === group.id);
25429
+ if (mine.length === 0) return group;
25430
+ return {
25431
+ ...group,
25432
+ fields: [...group.fields, ...mine.flatMap((join$1) => join$1.fields)],
25433
+ summary: {
25434
+ ...group.summary,
25435
+ parts: [...group.summary.parts, ...mine.flatMap((join$1) => join$1.summary ?? [])]
25436
+ }
25437
+ };
25438
+ }
25439
+ /** One case per kind of part, so a new kind fails to compile wherever parts are read. */
25440
+ function matchSummaryPart(part, cases) {
25441
+ if ("on" in part) return cases.on(part);
25442
+ if ("options" in part) return cases.options(part);
25443
+ if ("text" in part) return cases.text(part);
25444
+ if ("set" in part) return cases.set(part);
25445
+ if ("count" in part) return cases.count(part);
25446
+ return cases.chosen(part);
25447
+ }
25448
+ /** Every path a declaration places, in order: content, then settings with each group's fields. */
25449
+ function placedEditingPaths(editing) {
25450
+ return [...editing.content, ...editing.settings.flatMap((entry) => typeof entry === "string" ? [entry] : entry.fields)];
25451
+ }
25452
+ function editingGroups(editing) {
25453
+ return editing.settings.filter((entry) => typeof entry !== "string");
25454
+ }
24360
25455
 
24361
25456
  //#endregion
24362
25457
  //#region ../site-contracts/src/blocks/nodes.ts
@@ -24557,103 +25652,6 @@ const blockSchema = z.object({
24557
25652
  bindings: z.record(z.string(), z.unknown()).optional()
24558
25653
  }).passthrough();
24559
25654
 
24560
- //#endregion
24561
- //#region ../site-contracts/src/blocks/knobs.ts
24562
- /** Knob ownership is shared by facets and style-offer validation. */
24563
- const cardListItemParts = [
24564
- "media",
24565
- "title",
24566
- "text",
24567
- "facts",
24568
- "chips",
24569
- "numeral",
24570
- "schedule",
24571
- "dates",
24572
- "availability",
24573
- "action",
24574
- "price",
24575
- "date-stamp"
24576
- ];
24577
- /** Block supply is capability, never a second Look catalogue. */
24578
- const cardListBlockParts = {
24579
- "block.feature-cards": [
24580
- "media",
24581
- "title",
24582
- "text",
24583
- "action"
24584
- ],
24585
- "block.offerings-preview": [
24586
- "media",
24587
- "title",
24588
- "text",
24589
- "facts",
24590
- "chips",
24591
- "numeral",
24592
- "schedule",
24593
- "dates",
24594
- "availability",
24595
- "action",
24596
- "date-stamp"
24597
- ],
24598
- "block.appointment-services": [
24599
- "media",
24600
- "title",
24601
- "text",
24602
- "facts",
24603
- "action"
24604
- ],
24605
- "block.team-members": [
24606
- "media",
24607
- "title",
24608
- "text",
24609
- "facts",
24610
- "chips",
24611
- "action"
24612
- ],
24613
- "block.shop": [
24614
- "title",
24615
- "text",
24616
- "facts",
24617
- "price",
24618
- "action"
24619
- ]
24620
- };
24621
- const cardListFamilyBlocks = Object.keys(cardListBlockParts);
24622
- const cardListKnobBlocks = [...cardListFamilyBlocks, "block.event-calendar"];
24623
- const lookKnobBlocks = {
24624
- actionStyle: cardListKnobBlocks,
24625
- titleSize: "block.hero",
24626
- imagePosition: [
24627
- "block.hero",
24628
- "block.intro",
24629
- "block.media-text"
24630
- ],
24631
- imageShape: ["block.intro", "block.media-text"],
24632
- aspectRatio: "block.media-text",
24633
- stickerLine: "block.hero",
24634
- smallCaption: "block.hero",
24635
- photoTint: "block.hero",
24636
- candleGlow: "block.hero",
24637
- columnGuides: "block.hero",
24638
- showPhotos: cardListKnobBlocks,
24639
- cardMarker: cardListFamilyBlocks,
24640
- dates: "block.offerings-preview",
24641
- grouping: "block.offerings-preview",
24642
- columns: "block.feature-cards",
24643
- listColumns: "block.event-calendar",
24644
- blackAndWhite: "block.image-gallery",
24645
- showCapacity: "block.event-calendar",
24646
- alignment: "block.body-text",
24647
- autoAdvance: "block.testimonials",
24648
- quoteCount: "block.testimonials",
24649
- archFrame: [
24650
- "block.testimonials",
24651
- "block.newsletter-signup",
24652
- "block.form"
24653
- ],
24654
- tilt: "block.testimonials"
24655
- };
24656
-
24657
25655
  //#endregion
24658
25656
  //#region ../api/src/sdkConfig/contracts.ts
24659
25657
  /**
@@ -24750,11 +25748,13 @@ const sdkCustomBlockInputSchema = z.object({
24750
25748
  dataLoaders: sdkDataLoadersSchema,
24751
25749
  layout: z.optional(customBlockLayoutSchema),
24752
25750
  ...sdkBlockPresentationShape,
24753
- ...blockSectionDeclarationShape
25751
+ ...blockLookFieldShape,
25752
+ ...blockEditingDeclarationShape
24754
25753
  }).superRefine(validateManifestLookField).superRefine(validateSdkBlockDeclaration);
24755
25754
  const sdkBlockFieldExtensionInputSchema = z.object({
24756
25755
  fields: z.array(fieldDefinitionInputSchema).min(1),
24757
- ...blockSectionDeclarationShape
25756
+ ...blockLookFieldShape,
25757
+ ...blockEditingExtensionShape
24758
25758
  }).superRefine(validateManifestLookField);
24759
25759
  const sdkBlockFieldExtensionsInputSchema = z.record(z.string().min(1), sdkBlockFieldExtensionInputSchema);
24760
25760
  const sdkThemePaletteSchema = z.record(z.string(), z.string());
@@ -27485,6 +28485,9 @@ function parsePublicProductCategorySelector(value) {
27485
28485
 
27486
28486
  //#endregion
27487
28487
  //#region ../api/src/pageReadResponseCache.ts
28488
+ function pageReadPolicy(siteId, policy) {
28489
+ return policy === "retry" ? buildPageReadRetryPolicy(siteId) : buildPageReadCachePolicy(siteId, policy);
28490
+ }
27488
28491
  function isRecord$7(value) {
27489
28492
  return typeof value === "object" && value !== null && !Array.isArray(value);
27490
28493
  }
@@ -27495,8 +28498,20 @@ function isResolvedPage(page) {
27495
28498
  "system_service"
27496
28499
  ].includes(String(page.result.kind));
27497
28500
  }
28501
+ /**
28502
+ * The key `serializeSurfaceTree` (theme-core) wraps a response in when it carries surface revisions. This package
28503
+ * can't depend on theme-core, so the SDK's tests check the two stay equal.
28504
+ */
28505
+ const SURFACE_TRANSPORT_ENVELOPE_KEY = "$surfaceTransport";
28506
+ /** A revision-transport body keeps the page's own fields under the envelope's `value`. */
28507
+ function withoutSurfaceTransport(data) {
28508
+ const envelope = data[SURFACE_TRANSPORT_ENVELOPE_KEY];
28509
+ if (envelope === undefined) return data;
28510
+ return isRecord$7(envelope) && Array.isArray(envelope.revisions) && envelope.revisions.length > 0 && isRecord$7(envelope.value) ? envelope.value : null;
28511
+ }
27498
28512
  function envelopePage(body) {
27499
- const data = isRecord$7(body) && body.success === true && isRecord$7(body.data) ? body.data : null;
28513
+ const raw = isRecord$7(body) && body.success === true && isRecord$7(body.data) ? body.data : null;
28514
+ const data = raw ? withoutSurfaceTransport(raw) : null;
27500
28515
  return data?.type === "content" && isRecord$7(data.content) ? data.content : data;
27501
28516
  }
27502
28517
  function parseBody(body) {
@@ -27513,40 +28528,44 @@ function admit(snapshot) {
27513
28528
  if (snapshot.status === 200 && isResolvedPage(page)) {
27514
28529
  if (header(snapshot, PAGE_READ_STORAGE_HEADER) === "no-store") return {
27515
28530
  kind: "pass-through",
27516
- dependencies: "availability"
28531
+ policy: "retry"
27517
28532
  };
27518
28533
  return {
27519
28534
  kind: "store",
27520
- dependencies: page.dependencies
28535
+ policy: page.dependencies
27521
28536
  };
27522
28537
  }
28538
+ if (snapshot.status === 200) return {
28539
+ kind: "pass-through",
28540
+ policy: "retry"
28541
+ };
27523
28542
  return {
27524
28543
  kind: "pass-through",
27525
- dependencies: snapshot.status === 200 || header(snapshot, PAGE_READ_DEPENDENCIES_HEADER) === "availability" ? "availability" : "content"
28544
+ policy: header(snapshot, PAGE_READ_DEPENDENCIES_HEADER) === "availability" ? "availability" : "content"
27526
28545
  };
27527
28546
  }
27528
28547
  /**
27529
28548
  * One cache entry per request, judged by the policy it is looked up with. Content is looked up first, so a
27530
28549
  * plain page costs one lookup and never registers the availability policy. A page whose snapshot depends on
27531
- * availability is looked up again under that policy, which checks its tags and 60-second budget. A snapshot
28550
+ * availability (or must be retried soon) is looked up again under that policy, which checks its tags and budget. A snapshot
27532
28551
  * past its own budget is never served: the live read replaces it.
27533
28552
  */
27534
28553
  function planPageRead(state, now, budgetSeconds) {
27535
28554
  const subject = state.live ?? state.cached;
27536
28555
  if (!subject) return {
27537
28556
  kind: "lookup",
27538
- dependencies: "content"
28557
+ policy: "content"
27539
28558
  };
27540
- const { dependencies } = admit(subject);
27541
- if (!state.lookedUp.includes(dependencies)) return {
28559
+ const { policy } = admit(subject);
28560
+ if (!state.lookedUp.includes(policy)) return {
27542
28561
  kind: "lookup",
27543
- dependencies
28562
+ policy
27544
28563
  };
27545
28564
  if (state.live) return {
27546
28565
  kind: "serve",
27547
28566
  snapshot: state.live
27548
28567
  };
27549
- return now - subject.cachedAt < budgetSeconds(dependencies) * 1e3 ? {
28568
+ return now - subject.cachedAt < budgetSeconds(policy) * 1e3 ? {
27550
28569
  kind: "serve",
27551
28570
  snapshot: subject
27552
28571
  } : { kind: "read-live" };
@@ -27557,12 +28576,21 @@ function planPageRead(state, now, budgetSeconds) {
27557
28576
  */
27558
28577
  var PassThroughResponse = class extends Error {
27559
28578
  constructor(snapshot) {
27560
- super("Page read must not be stored");
28579
+ super("Read must not be stored");
27561
28580
  this.snapshot = snapshot;
27562
28581
  }
27563
28582
  };
27564
- async function lookup(input, dependencies) {
27565
- const { tags: tags$1 } = buildPageReadCachePolicy(input.siteId, dependencies);
28583
+ /**
28584
+ * Names this cache's entries. Next keys an entry by these parts plus the callback's source text, and neither
28585
+ * changes when the response contract does, so a contract change bumps this name: otherwise a deploy keeps
28586
+ * serving responses the previous release cached, in the old shape, for up to their whole budget.
28587
+ *
28588
+ * - v4: a resolved page carries its own mailing-list support (`mailingList`); the hosted frontend no longer
28589
+ * asks the site read for it, so a v3 response would leave the page's newsletter forms without their lists.
28590
+ */
28591
+ const PAGE_READ_RESPONSE_CACHE_NAME = "page-read-envelope-v4";
28592
+ async function lookup(input, policy) {
28593
+ const { tags: tags$1 } = pageReadPolicy(input.siteId, policy);
27566
28594
  const load = async () => {
27567
28595
  const snapshot = await input.live();
27568
28596
  if (admit(snapshot).kind === "pass-through") throw new PassThroughResponse(snapshot);
@@ -27570,8 +28598,8 @@ async function lookup(input, dependencies) {
27570
28598
  };
27571
28599
  try {
27572
28600
  return {
27573
- cached: await input.cache(load, ["page-read-envelope-v3", input.key], {
27574
- revalidate: input.budgetSeconds(dependencies),
28601
+ cached: await input.cache(load, [PAGE_READ_RESPONSE_CACHE_NAME, input.key], {
28602
+ revalidate: input.budgetSeconds(policy),
27575
28603
  tags: tags$1
27576
28604
  })(),
27577
28605
  live: null
@@ -27593,9 +28621,9 @@ async function runPlan(input, state) {
27593
28621
  live: await input.live()
27594
28622
  });
27595
28623
  case "lookup": {
27596
- const found = await lookup(input, step.dependencies);
28624
+ const found = await lookup(input, step.policy);
27597
28625
  return runPlan(input, {
27598
- lookedUp: [...state.lookedUp, step.dependencies],
28626
+ lookedUp: [...state.lookedUp, step.policy],
27599
28627
  cached: found.cached ?? state.cached,
27600
28628
  live: state.live ?? found.live
27601
28629
  });
@@ -27627,9 +28655,9 @@ async function frameworkCacheKey(request) {
27627
28655
  async function cachePageReadResponse(input) {
27628
28656
  if (!input.cache || input.maxAge !== undefined && input.maxAge <= 0) return input.read();
27629
28657
  const maxAge = input.maxAge;
27630
- const budgetSeconds = (dependencies) => {
27631
- const policy = buildPageReadCachePolicy(input.siteId, dependencies).revalidate;
27632
- return maxAge === undefined ? policy : Math.min(policy, maxAge);
28658
+ const budgetSeconds = (policy) => {
28659
+ const revalidate = pageReadPolicy(input.siteId, policy).revalidate;
28660
+ return maxAge === undefined ? revalidate : Math.min(revalidate, maxAge);
27633
28661
  };
27634
28662
  const key = await frameworkCacheKey(input.key);
27635
28663
  const result = await runPlan({
@@ -27648,15 +28676,53 @@ async function cachePageReadResponse(input) {
27648
28676
  headers: result.headers
27649
28677
  });
27650
28678
  }
28679
+ /**
28680
+ * Names the site read's entries, for the same reason as `PAGE_READ_RESPONSE_CACHE_NAME`. A site read only
28681
+ * enters this cache when the host can answer it from its durable copy; otherwise it stays in Next's fetch cache.
28682
+ */
28683
+ const SITE_READ_RESPONSE_CACHE_NAME = "site-read-envelope-v1";
28684
+ /**
28685
+ * A site read through the framework cache, with the fetch cache's lifetime and tags, so its fill can come from
28686
+ * the host's durable copy. As in Next's fetch cache, only a 200 is kept: an incomplete site (207) or a failure
28687
+ * passes through and the next read asks again.
28688
+ */
28689
+ async function cacheSiteReadResponse(input) {
28690
+ const live = sharedRead(input.read);
28691
+ const load = async () => {
28692
+ const snapshot$1 = await live();
28693
+ if (snapshot$1.status !== 200) throw new PassThroughResponse(snapshot$1);
28694
+ return snapshot$1;
28695
+ };
28696
+ const key = await frameworkCacheKey(input.key);
28697
+ const found = await input.cache(load, [SITE_READ_RESPONSE_CACHE_NAME, key], {
28698
+ revalidate: input.policy.revalidate,
28699
+ tags: input.policy.tags
28700
+ })().catch((error) => {
28701
+ if (error instanceof PassThroughResponse) return error.snapshot;
28702
+ throw error;
28703
+ });
28704
+ const snapshot = Date.now() - found.cachedAt < input.policy.revalidate * 1e3 ? found : await live();
28705
+ return new Response(snapshot.body, {
28706
+ status: snapshot.status,
28707
+ headers: snapshot.headers
28708
+ });
28709
+ }
27651
28710
  /** Result adapters use this when the SDK served a page without the HTTP transport (memory, durable or prebuild fallback). */
27652
28711
  async function observePageReadPolicy(cache, siteId, payload) {
27653
28712
  if (!cache) return;
27654
- const dependency = pageReadDependencies(payload);
28713
+ const policy = observedPageReadPolicy(pageReadDependencies(payload));
27655
28714
  await cache(async () => true, [
27656
- "page-read-policy-v2",
28715
+ "page-read-policy-v3",
27657
28716
  siteId,
27658
- dependency
27659
- ], buildPageReadCachePolicy(siteId, dependency))();
28717
+ policy
28718
+ ], pageReadPolicy(siteId, policy))();
28719
+ }
28720
+ /**
28721
+ * A page served without the tagged transport (memory, durable or prebuild) may predate a write's purge, so an
28722
+ * availability page only earns the retry window, not the rendered-availability backstop a purge would end.
28723
+ */
28724
+ function observedPageReadPolicy(dependency) {
28725
+ return dependency === "availability" ? "retry" : "content";
27660
28726
  }
27661
28727
 
27662
28728
  //#endregion
@@ -28409,20 +29475,90 @@ function createApiResponseTransport(getHeaders = () => ({}), baseUrl, { sdkVersi
28409
29475
  function isPublishedPageRead(endpoint, params, options) {
28410
29476
  return (endpoint === "getContentByPath" || endpoint === "resolveRouteOutcome") && params?.preview !== true && params?.preview !== "true" && options.cache !== "no-store";
28411
29477
  }
29478
+ /** The dashboard's reading of a boolean query flag, so a host never treats `force=1` as unforced. */
29479
+ const isTruthyRequestParam = (value) => value === true || value === "true" || value === 1 || value === "1";
29480
+ /** Forced reads skip every cache, and an id-only lookup is a different response the durable cache never holds. */
29481
+ function isFullSiteRead(params) {
29482
+ return !isTruthyRequestParam(params.force) && (params.scope === undefined || params.scope === "full");
29483
+ }
29484
+ /** A published, full site read with a lifetime: the host's durable copy may answer it, under the fetch's policy. */
29485
+ function publishedSiteReadPolicy(endpoint, params, plan) {
29486
+ const next = plan.init.cache === "no-store" ? undefined : plan.init.next;
29487
+ const revalidate = typeof next?.revalidate === "number" && next.revalidate > 0 ? next.revalidate : null;
29488
+ return endpoint === "getSite" && revalidate !== null && isFullSiteRead(params) ? {
29489
+ revalidate,
29490
+ tags: next?.tags ?? []
29491
+ } : null;
29492
+ }
29493
+ /** The dashboard's success envelope around a durable copy, so admission and parsing treat it like a live response. */
29494
+ function freshPublishedResponse(data) {
29495
+ return new Response(JSON.stringify(buildSuccessEnvelope(data, undefined)), {
29496
+ status: 200,
29497
+ headers: {
29498
+ "content-type": "application/json",
29499
+ "x-riverbank-cache": "frontend-hit"
29500
+ }
29501
+ });
29502
+ }
29503
+ /** The cache fill's read: the host's fresh durable copy when it has one, otherwise the dashboard. */
29504
+ function freshPublishedFirst(read, request, live) {
29505
+ if (!read) return live;
29506
+ return async () => {
29507
+ const found = await read(request).catch(() => null);
29508
+ return found ? freshPublishedResponse(found.data) : live();
29509
+ };
29510
+ }
29511
+ function publishedPageResponse(read) {
29512
+ const revalidate = read.plan.init.next?.revalidate;
29513
+ return cachePageReadResponse({
29514
+ cache: read.frameworkCache?.cache ?? null,
29515
+ key: read.key,
29516
+ siteId: typeof read.params.siteId === "string" ? read.params.siteId : "",
29517
+ maxAge: typeof revalidate === "number" ? revalidate : undefined,
29518
+ read: read.endpoint === "getContentByPath" ? freshPublishedFirst(read.frameworkCache?.readFreshPublished, {
29519
+ endpoint: "getContentByPath",
29520
+ params: read.params
29521
+ }, read.uncachedFetch) : read.uncachedFetch
29522
+ });
29523
+ }
29524
+ /** Without a durable reader, a site read stays in Next's fetch cache exactly as before. */
29525
+ function siteOrFetchResponse(read) {
29526
+ const durable = read.frameworkCache?.readFreshPublished;
29527
+ const policy = durable ? publishedSiteReadPolicy(read.endpoint, read.params, read.plan) : null;
29528
+ return read.frameworkCache && policy ? cacheSiteReadResponse({
29529
+ cache: read.frameworkCache.cache,
29530
+ key: read.key,
29531
+ policy,
29532
+ read: freshPublishedFirst(durable, {
29533
+ endpoint: "getSite",
29534
+ params: read.params
29535
+ }, read.uncachedFetch)
29536
+ }) : observedFetch(read.plan, read.endpoint, read.frameworkCache);
29537
+ }
28412
29538
  function executeApiRequest(plan, endpoint, params, options, frameworkCache) {
28413
- const inputParams = params;
28414
- const { next: fetchPolicy, ...uncachedInit } = plan.init;
28415
- const publishedPage = isPublishedPageRead(endpoint, inputParams, options);
28416
- return publishedPage ? cachePageReadResponse({
28417
- cache: frameworkCache?.cache ?? null,
29539
+ const { next: _fetchPolicy, ...uncachedInit } = plan.init;
29540
+ const read = {
29541
+ plan,
29542
+ endpoint,
29543
+ params: params ?? {},
29544
+ frameworkCache,
28418
29545
  key: JSON.stringify([plan.url, [...new Headers(plan.init.headers).entries()]]),
28419
- siteId: typeof inputParams?.siteId === "string" ? inputParams.siteId : "",
28420
- maxAge: typeof fetchPolicy?.revalidate === "number" ? fetchPolicy.revalidate : undefined,
28421
- read: () => fetch(plan.url, {
29546
+ uncachedFetch: () => fetch(plan.url, {
28422
29547
  ...uncachedInit,
28423
29548
  cache: "no-store"
28424
29549
  })
28425
- }) : fetch(plan.url, plan.init);
29550
+ };
29551
+ return isPublishedPageRead(endpoint, params, options) ? publishedPageResponse(read) : siteOrFetchResponse(read);
29552
+ }
29553
+ function observedFetch(plan, endpoint, frameworkCache) {
29554
+ const revalidate = plan.init.next?.revalidate;
29555
+ if (typeof revalidate === "number" && plan.init.cache !== "no-store") {
29556
+ frameworkCache?.observeFetchLifetime?.({
29557
+ endpoint: String(endpoint),
29558
+ revalidate
29559
+ });
29560
+ }
29561
+ return fetch(plan.url, plan.init);
28426
29562
  }
28427
29563
  const batchReadPolicyBodySchema = z.object({ requests: z.array(z.object({
28428
29564
  endpoint: z.string(),
@@ -28778,7 +29914,8 @@ const PERSON_REMOVAL_CLEANUP_KINDS = [
28778
29914
  "storage",
28779
29915
  "stripe",
28780
29916
  "google_calendar",
28781
- "newsletter"
29917
+ "newsletter",
29918
+ "gift_delivery"
28782
29919
  ];
28783
29920
 
28784
29921
  //#endregion
@@ -29489,6 +30626,103 @@ Examples:
29489
30626
  }
29490
30627
  });
29491
30628
 
30629
+ //#endregion
30630
+ //#region ../api/src/navigation/siteLegalLinks.ts
30631
+ const noPlatformLegalPages = {
30632
+ privacyPolicyHref: null,
30633
+ bookingTermsHref: null,
30634
+ siteHosts: []
30635
+ };
30636
+ const PLATFORM_LEGAL_MENU_ID = "platform-legal-menu";
30637
+ /** Stands in for the site's own origin while resolving a relative link. */
30638
+ const OWN_SITE_BASE = "https://own-site.invalid";
30639
+ function bareHost(host) {
30640
+ return host.trim().toLowerCase().replace(/^https?:\/\//u, "").replace(/[/:].*$/u, "").replace(/^www\./u, "");
30641
+ }
30642
+ /**
30643
+ * Where a link goes, compared case-insensitively and without trailing
30644
+ * slashes: a path on the site itself (relative, or absolute on one of its
30645
+ * hosts) is keyed by its path alone; any other link keeps its whole address.
30646
+ */
30647
+ function destinationKey(href, siteHosts) {
30648
+ const trimmed = href.trim().toLowerCase();
30649
+ const parsed = URL.canParse(trimmed, OWN_SITE_BASE) ? new URL(trimmed, OWN_SITE_BASE) : null;
30650
+ if (parsed === null || !/^https?:$/u.test(parsed.protocol)) return trimmed.replace(/(.)\/+$/u, "$1");
30651
+ const path$3 = parsed.pathname.replace(/(.)\/+$/u, "$1") + parsed.search;
30652
+ const own = parsed.origin === OWN_SITE_BASE || siteHosts.has(bareHost(parsed.hostname));
30653
+ return own ? path$3 : `${parsed.protocol}//${bareHost(parsed.host)}${path$3}`;
30654
+ }
30655
+ /**
30656
+ * The written address of an owner's link, whatever its kind (url, external or
30657
+ * an internal link that carries one). Links to the owner's own pages can't
30658
+ * point at the platform's reserved legal routes, so they never duplicate one.
30659
+ */
30660
+ function urlHref(url) {
30661
+ if (url === null || typeof url !== "object" || Array.isArray(url)) return null;
30662
+ const href = url.href;
30663
+ return typeof href === "string" && href.trim().length > 0 ? href : null;
30664
+ }
30665
+ /**
30666
+ * The one owner of which platform legal links a site's footer adds: a link
30667
+ * for each published platform page the owner's Legal links menu doesn't
30668
+ * already point at. Derived on every read, so it can't outlive the page.
30669
+ */
30670
+ function platformLegalLinks(pages, ownerLegalItems) {
30671
+ const siteHosts = new Set(pages.siteHosts.map(bareHost));
30672
+ const ownerHrefs = new Set(ownerLegalItems.flatMap((item) => {
30673
+ const href = urlHref(item.url);
30674
+ return href === null ? [] : [destinationKey(href, siteHosts)];
30675
+ }));
30676
+ const candidates = [pages.privacyPolicyHref === null ? null : {
30677
+ id: "platform-legal-privacy",
30678
+ label: "Privacy policy",
30679
+ href: pages.privacyPolicyHref
30680
+ }, pages.bookingTermsHref === null ? null : {
30681
+ id: "platform-legal-booking-terms",
30682
+ label: "Booking terms",
30683
+ href: pages.bookingTermsHref
30684
+ }];
30685
+ return candidates.filter((link$1) => link$1 !== null && !ownerHrefs.has(destinationKey(link$1.href, siteHosts)));
30686
+ }
30687
+ /** The site's Legal links menu, with its platform links after the owner's own items. */
30688
+ function withPlatformLegalLinks(menus, pages, site) {
30689
+ const ownerMenu = menus.find((menu$1) => menu$1.location === "legal");
30690
+ const links = platformLegalLinks(pages, ownerMenu?.items ?? []);
30691
+ if (links.length === 0) return [...menus];
30692
+ const stamp = site.updatedAt;
30693
+ const menu = ownerMenu ?? {
30694
+ id: PLATFORM_LEGAL_MENU_ID,
30695
+ location: "legal",
30696
+ siteId: site.id,
30697
+ userId: site.userId,
30698
+ createdAt: stamp,
30699
+ updatedAt: stamp,
30700
+ sdkContentHash: null,
30701
+ sdkSyncedAt: null,
30702
+ items: []
30703
+ };
30704
+ const firstIndex = menu.items.reduce((max, item) => Math.max(max, item.orderIndex + 1), 0);
30705
+ const merged = {
30706
+ ...menu,
30707
+ items: [...menu.items, ...links.map((link$1, index) => ({
30708
+ id: link$1.id,
30709
+ label: link$1.label,
30710
+ urlType: "url",
30711
+ url: {
30712
+ kind: "url",
30713
+ href: link$1.href
30714
+ },
30715
+ menuId: menu.id,
30716
+ isCta: false,
30717
+ orderIndex: firstIndex + index,
30718
+ parentId: null,
30719
+ createdAt: stamp,
30720
+ updatedAt: stamp
30721
+ }))]
30722
+ };
30723
+ return ownerMenu ? menus.map((candidate) => candidate === ownerMenu ? merged : candidate) : [...menus, merged];
30724
+ }
30725
+
29492
30726
  //#endregion
29493
30727
  //#region ../api/src/navigationMenuValidation.ts
29494
30728
  function hasChildren(item) {
@@ -32658,8 +33892,9 @@ function footerNavigationFacts(menu) {
32658
33892
  * the SDK and the editor preview (which has no route map) all decide alike, and a link
32659
33893
  * that needs a route can't drop the whole links module.
32660
33894
  */
32661
- function footerMenuNavigationFacts(menus) {
33895
+ function footerMenuNavigationFacts(menus, platformLegalPages = noPlatformLegalPages) {
32662
33896
  const items = menus.find((menu) => menu.location === "footer")?.items ?? [];
33897
+ const legalItems = menus.find((menu) => menu.location === "legal")?.items ?? [];
32663
33898
  const roots = items.filter((item) => !item.parentId);
32664
33899
  const groups = roots.filter((item) => items.some((child) => child.parentId === item.id));
32665
33900
  const links = roots.filter((item) => item.urlType !== "dropdown" && !groups.includes(item));
@@ -32668,7 +33903,7 @@ function footerMenuNavigationFacts(menus) {
32668
33903
  groups,
32669
33904
  links
32670
33905
  }),
32671
- hasLegalPolicyNavigation: menus.some((menu) => menu.location === "legal" && menu.items.length > 0)
33906
+ hasLegalPolicyNavigation: legalItems.length > 0 || platformLegalLinks(platformLegalPages, legalItems).length > 0
32672
33907
  };
32673
33908
  }
32674
33909
 
@@ -38779,4 +40014,4 @@ function optionalTitle(data) {
38779
40014
  }
38780
40015
 
38781
40016
  //#endregion
38782
- export { walkLocalContentMedia as $, ManagementApiError as $n, eventCalendarDisplayModeValues as $r, commandContexts as $t, formatDiffSummary as A, isLocalConfigured as An, roomOccupancySchema as Ar, navigationIdentityMap as At, formatFieldChange as B, customLayoutSizeProblem as Bn, unsafeAsPositiveCheckoutQuantity as Br, ACCOUNT_SITE_SEARCH_MAX_LENGTH as Bt, reportFromOutcomes as C, ErrorCodes as Cn, roomsOfferSharing as Cr, listFiles as Ct, calculateDiff as D, createOutput as Dn, reviewedStay as Dr, isMediaValue as Dt, createEmptySyncResult as E, CliExit as En, placeBooking as Er, writeJsonFileAtomic as Et, buildJsonDiff as F, cardListKnobBlocks as Fn, eventRegistrationErrors as Fr, createBearerAccountApi as Ft, applyLocalMediaPush as G, fieldSchema as Gn, isBookingCollectionEquivalentToUpfront as Gr, createPushConfigCommand as Gt, revalidateLocalMediaPushPlan as H, blockCategoryEnum as Hn, planFlexibleBalanceCreditFirst as Hr, navigationCommandItemToManagementInput as Ht, hasPageOperations as I, lookKnobBlocks as In, placementProblemText as Ir, ACCOUNT_SITE_CURSOR_MAX_LENGTH as It, readStableBinaryFile as J, parseRepeaterGridInteger as Jn, resolveBookingCollectionOptionFacts as Jr, revalidatePushConfigPlan as Jt, prepareLocalMediaForPush as K, MAX_REPEATER_GRID_COLUMNS as Kn, repriceBookingCollectionOptions as Kr, loadPushConfigTarget as Kt, pageMetadataForUpsert as L, NodeSchema as Ln, stayLineText as Lr, ACCOUNT_SITE_LIST_LIMIT_DEFAULT as Lt, findChangedFieldsWithValues as M, loadSdkEnvironment as Mn, sharedRoomArrangementSchema as Mr, convertPulledNavigationToLocal as Mt, formatHumanDiff as N, cardListBlockParts as Nn, nextCombinationHint as Nr, convertPulledPagesToLocal as Nt, calculateFooterDiff as O, getEnvPrefix as On, reviewedRoomsSchema as Or, duplicateNavigationIdentityMessage as Ot, calculatePullDiff as P, cardListFamilyBlocks as Pn, planSelectionCombinationPrices as Pr, AccountApiMalformedResponseError as Pt, normalizeMediaValueToIdentifierOnly as Q, visibilityLevels as Qn, eventCalendarDefaultViewValues as Qr, CommandFailure as Qt, calculateEntryDiffs as R, NodeTreeSchema as Rn, stayNoteText as Rr, ACCOUNT_SITE_LIST_LIMIT_MAX as Rt, planCliCommandBatchForBindings as S, withRiverbankEnv as Sn, roomKindOptions as Sr, fileExists$1 as St, executeResidualSettingsSyncPlan as T, transportSuggestion as Tn, countSoFar as Tr, writeJsonFile$1 as Tt, syncLocalMediaForPush as U, blockContentSourceSchema as Un, bookingCollectionDatesOpen as Ur, normalizeNavigationConfigItemForCommand as Ut, formatFieldPath as V, DEFAULT_MEDIA_FIELD_KINDS as Vn, planCheckoutPaymentFlow as Vr, ACCOUNT_SITE_TITLE_MAX_LENGTH as Vt, syncLocalMediaForPull as W, blockRequiredFeatureSchema as Wn, flexibleBalanceDueDay as Wr, applyPushConfigPlan as Wt, sha256 as X, resolveRepeaterGridRowFieldId as Xn, getBookingLaterInstalments as Xr, deriveCmsApiUrlFromDashboardUrl as Xt, writeBinaryFileAtomic as Y, resolveRepeaterGridColumnFieldId as Yn, getStripeMinimumChargeRequirement as Yr, createBearerAPIClient as Yt, normalizeMediaIdentifierInput as Z, resolveRepeaterGridSpanFieldId as Zn, MAX_EVENT_BOOKING_SELECTION_ITEMS as Zr, mapEnvironmentExecutionOutcomesJson as Zt, commandExecutionToReport as _, normalizeCalendarFilterId as _i, executeEnvironmentPlan as _n, bookingQuestionsAnswerValueSchema as _r, metadataTargetFromEnvironment as _t, executeEntryCommandPlanAsReport as a, publicPassProductSchema as ai, confirmAction as an, sdkSettingsUpdateSchema as ar, readAllMeta as at, executeCompiledCliCommandPlanAsReport as b, unwrapResponse as bi, planEnvironmentWriteAuthorization as bn, checkoutStatusArms as br, writeMetadataRecordMap as bt, titleFromEntryData as c, purchasablePublicPassProductSchema as ci, formatDateShort as cn, pageDesignDecisionsV2Schema as cr, readFooterMeta as ct, unsafeAsCliEntryIdentifier as d, calendarMonthWindowSchema as di, managementClientFor as dn, API_ENDPOINTS as dr, readPagesMeta as dt, eventCalendarListLayoutCompatibleDisplayModeValues as ei, defineCommand as en, extractApiErrorMessage as er, buildStorageUrl as et, unsafeAsCliFormSlug as f, calendarSourceCursorSchema as fi, mapEntryForOutput as fn, areEventBookingRequirementsIdentical as fr, readSettingsMeta as ft, commandCompileFailureToReport as g, monthNumber as gi, runWithInvocation as gn, resolveSelectionAttendanceMode as gr, metadataFilePath as gt, mutationCounterForEffect as h, eventSurfaceScopeValues as hi, resolveCommandPath as hn, decideSelectionAttendance as hr, ensureMetadataDir as ht, entrySiteCommandTypes as i, publicMembershipProductSchema as ii, bindRequestTimeout as in, sdkEventScheduleSchema as ir, readEntries as it, hasPendingChanges as j, isRemoteConfigured as jn, roomSetupSchema as jr, convertPulledFooterToLocal as jt, formatDiffDetail as k, getEnvironmentDebugInfo as kn, roomChoicesSchema as kr, navigationIdentity as kt, unsafeAsCliBlockIdentifier as l, CALENDAR_SSR_PAGE_SIZE as li, handleCommandError as ln, pageDesignIntentSchemaVersion as lr, readFormsMeta as lt, commandReportToSyncResult as m, eventSurfacePresetValues as mi, parseJsonData as mn, INCOMPATIBLE_ATTENDANCE_MESSAGE as mr, writeMediaManifest as mt, entryCommandCompileErrorToReport as n, publicMapLocationResultSchema as ni, registerCommand as nn, isRecord$5 as nr, extractMediaIdentifiers as nt, executeEntryCommandPlanAsSyncResult as o, publicProductSchema as oi, createOutputForCommand as on, linkPayloadSchema as or, readEventCategoriesMeta as ot, unsafeAsCliPageIdentifier as p, eventScheduleScopeValues as pi, parseJsonArray as pn, eventBookingConsentContentKey as pr, readVenuesMeta as pt, admitBinaryWriteDestination as q, isAcceptedRepeaterGridSpan as qn, resolveAvailableBookingCollectionOptions as qr, preparePushConfigTarget as qt, entryCommandReportToSyncResult as r, publicVenueMapLocationSchema as ri, renderedByOwner as rn, ApiRequestError as rr, findLegacyEntryFiles as rt, syncResultForEntryCommandCompileError as s, purchasablePublicMembershipProductSchema as si, currentInvocationEnvelope as sn, portablePageDesignSchema as sr, readEventsMeta as st, compileEntryPushCommands as t, eventCalendarListLayoutValues as ti, defineCommandGroup as tn, normalizeApiError as tr, downloadMedia as tt, unsafeAsCliContentTypeKey as u, calendarMonthDate as ui, loadManagementTarget as un, sdkConfiguredBookingVerticalConfigSchema as ur, readNavigationMeta as ut, commandReportHasFailures as v, publicEventLoaderQuerySchemaShape as vi, parseEnvironmentSelection as vn, bookingQuestionsAnswersSchema as vr, readMetadataFile as vt, mergeManySyncResults as w, formatError as wn, sameRoomOption as wr, readJsonFile as wt, formatManagementError as x, requireEnvironmentWriteAuthorization as xn, placesLeftText as xr, ensureDir$1 as xt, executeCliCommandPlan as y, ApiEnvelopeError as yi, planEnvironmentExecution as yn, bookingQuestionsSectionSchema as yr, writeMetadataFile as yt, buildFieldChanges as z, bindingSchema as zn, checkoutCopy as zr, ACCOUNT_SITE_LIST_LIMIT_MIN as zt };
40017
+ export { walkLocalContentMedia as $, resolveRepeaterGridSpanFieldId as $n, repriceBookingCollectionOptions as $r, commandContexts as $t, formatDiffSummary as A, isLocalConfigured as An, roomsOfferSharing as Ar, navigationIdentityMap as At, formatFieldChange as B, matchSummaryPart as Bn, nextCombinationHint as Br, ACCOUNT_SITE_SEARCH_MAX_LENGTH as Bt, reportFromOutcomes as C, monthNumber as Ci, ErrorCodes as Cn, resolveSelectionAttendanceMode as Cr, listFiles as Ct, calculateDiff as D, unwrapResponse as Di, createOutput as Dn, checkoutStatusArms as Dr, isMediaValue as Dt, createEmptySyncResult as E, ApiEnvelopeError as Ei, CliExit as En, bookingQuestionsSectionSchema as Er, writeJsonFileAtomic as Et, buildJsonDiff as F, bindingSchema as Fn, reviewedRoomsSchema as Fr, createBearerAccountApi as Ft, applyLocalMediaPush as G, blockContentSourceSchema as Gn, stayNoteText as Gr, createPushConfigCommand as Gt, revalidateLocalMediaPushPlan as H, placedEditingPaths as Hn, eventRegistrationErrors as Hr, navigationCommandItemToManagementInput as Ht, hasPageOperations as I, customLayoutSizeProblem as In, roomChoicesSchema as Ir, ACCOUNT_SITE_CURSOR_MAX_LENGTH as It, readStableBinaryFile as J, MAX_REPEATER_GRID_COLUMNS as Jn, planCheckoutPaymentFlow as Jr, revalidatePushConfigPlan as Jt, prepareLocalMediaForPush as K, blockRequiredFeatureSchema as Kn, checkoutCopy as Kr, loadPushConfigTarget as Kt, pageMetadataForUpsert as L, MAX_SETUP_FIELDS as Ln, roomOccupancySchema as Lr, ACCOUNT_SITE_LIST_LIMIT_DEFAULT as Lt, findChangedFieldsWithValues as M, loadSdkEnvironment as Mn, countSoFar as Mr, convertPulledNavigationToLocal as Mt, formatHumanDiff as N, NodeSchema as Nn, placeBooking as Nr, convertPulledPagesToLocal as Nt, calculateFooterDiff as O, getEnvPrefix as On, placesLeftText as Or, duplicateNavigationIdentityMessage as Ot, calculatePullDiff as P, NodeTreeSchema as Pn, reviewedStay as Pr, AccountApiMalformedResponseError as Pt, normalizeMediaValueToIdentifierOnly as Q, resolveRepeaterGridRowFieldId as Qn, isBookingCollectionEquivalentToUpfront as Qr, CommandFailure as Qt, calculateEntryDiffs as R, blockEditingSchema as Rn, roomSetupSchema as Rr, ACCOUNT_SITE_LIST_LIMIT_MAX as Rt, planCliCommandBatchForBindings as S, eventSurfaceScopeValues as Si, withRiverbankEnv as Sn, decideSelectionAttendance as Sr, fileExists$1 as St, executeResidualSettingsSyncPlan as T, publicEventLoaderQuerySchemaShape as Ti, transportSuggestion as Tn, bookingQuestionsAnswersSchema as Tr, writeJsonFile$1 as Tt, syncLocalMediaForPush as U, DEFAULT_MEDIA_FIELD_KINDS as Un, placementProblemText as Ur, normalizeNavigationConfigItemForCommand as Ut, formatFieldPath as V, mergeBlockEditing as Vn, planSelectionCombinationPrices as Vr, ACCOUNT_SITE_TITLE_MAX_LENGTH as Vt, syncLocalMediaForPull as W, blockCategoryEnum as Wn, stayLineText as Wr, applyPushConfigPlan as Wt, sha256 as X, parseRepeaterGridInteger as Xn, bookingCollectionDatesOpen as Xr, deriveCmsApiUrlFromDashboardUrl as Xt, writeBinaryFileAtomic as Y, isAcceptedRepeaterGridSpan as Yn, planFlexibleBalanceCreditFirst as Yr, createBearerAPIClient as Yt, normalizeMediaIdentifierInput as Z, resolveRepeaterGridColumnFieldId as Zn, flexibleBalanceDueDay as Zr, mapEnvironmentExecutionOutcomesJson as Zt, commandExecutionToReport as _, calendarMonthDate as _i, executeEnvironmentPlan as _n, sdkConfiguredBookingVerticalConfigSchema as _r, metadataTargetFromEnvironment as _t, executeEntryCommandPlanAsReport as a, eventCalendarDefaultViewValues as ai, confirmAction as an, mapReadinessFact as ar, readAllMeta as at, executeCompiledCliCommandPlanAsReport as b, eventScheduleScopeValues as bi, planEnvironmentWriteAuthorization as bn, eventBookingConsentContentKey as br, writeMetadataRecordMap as bt, titleFromEntryData as c, eventCalendarListLayoutValues as ci, formatDateShort as cn, normalizeApiError as cr, readFooterMeta as ct, unsafeAsCliEntryIdentifier as d, publicMembershipProductSchema as di, managementClientFor as dn, sdkEventScheduleSchema as dr, readPagesMeta as dt, resolveAvailableBookingCollectionOptions as ei, defineCommand as en, visibilityLevels as er, buildStorageUrl as et, unsafeAsCliFormSlug as f, publicPassProductSchema as fi, mapEntryForOutput as fn, sdkSettingsUpdateSchema as fr, readSettingsMeta as ft, commandCompileFailureToReport as g, CALENDAR_SSR_PAGE_SIZE as gi, runWithInvocation as gn, pageDesignIntentSchemaVersion as gr, metadataFilePath as gt, mutationCounterForEffect as h, purchasablePublicPassProductSchema as hi, resolveCommandPath as hn, pageDesignDecisionsV2Schema as hr, ensureMetadataDir as ht, entrySiteCommandTypes as i, MAX_EVENT_BOOKING_SELECTION_ITEMS as ii, bindRequestTimeout as in, lookKnobBlocks as ir, readEntries as it, hasPendingChanges as j, isRemoteConfigured as jn, sameRoomOption as jr, convertPulledFooterToLocal as jt, formatDiffDetail as k, getEnvironmentDebugInfo as kn, roomKindOptions as kr, navigationIdentity as kt, unsafeAsCliBlockIdentifier as l, publicMapLocationResultSchema as li, handleCommandError as ln, isRecord$5 as lr, readFormsMeta as lt, commandReportToSyncResult as m, purchasablePublicMembershipProductSchema as mi, parseJsonData as mn, portablePageDesignSchema as mr, writeMediaManifest as mt, entryCommandCompileErrorToReport as n, getStripeMinimumChargeRequirement as ni, registerCommand as nn, cardListFamilyBlocks as nr, extractMediaIdentifiers as nt, executeEntryCommandPlanAsSyncResult as o, eventCalendarDisplayModeValues as oi, createOutputForCommand as on, ManagementApiError as or, readEventCategoriesMeta as ot, unsafeAsCliPageIdentifier as p, publicProductSchema as pi, parseJsonArray as pn, linkPayloadSchema as pr, readVenuesMeta as pt, admitBinaryWriteDestination as q, fieldSchema as qn, unsafeAsPositiveCheckoutQuantity as qr, preparePushConfigTarget as qt, entryCommandReportToSyncResult as r, getBookingLaterInstalments as ri, renderedByOwner as rn, cardListKnobBlocks as rr, findLegacyEntryFiles as rt, syncResultForEntryCommandCompileError as s, eventCalendarListLayoutCompatibleDisplayModeValues as si, currentInvocationEnvelope as sn, extractApiErrorMessage as sr, readEventsMeta as st, compileEntryPushCommands as t, resolveBookingCollectionOptionFacts as ti, defineCommandGroup as tn, cardListBlockParts as tr, downloadMedia as tt, unsafeAsCliContentTypeKey as u, publicVenueMapLocationSchema as ui, loadManagementTarget as un, ApiRequestError as ur, readNavigationMeta as ut, commandReportHasFailures as v, calendarMonthWindowSchema as vi, parseEnvironmentSelection as vn, API_ENDPOINTS as vr, readMetadataFile as vt, mergeManySyncResults as w, normalizeCalendarFilterId as wi, formatError as wn, bookingQuestionsAnswerValueSchema as wr, readJsonFile as wt, formatManagementError as x, eventSurfacePresetValues as xi, requireEnvironmentWriteAuthorization as xn, INCOMPATIBLE_ATTENDANCE_MESSAGE as xr, ensureDir$1 as xt, executeCliCommandPlan as y, calendarSourceCursorSchema as yi, planEnvironmentExecution as yn, areEventBookingRequirementsIdentical as yr, writeMetadataFile as yt, buildFieldChanges as z, editingGroups as zn, sharedRoomArrangementSchema as zr, ACCOUNT_SITE_LIST_LIMIT_MIN as zt };