riverbankcms 0.31.0 → 0.31.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 { $t as buttonStyleSelectionSchema, At as resolveMediaIdentifier, Bt as MAX_MANAGEMENT_MEDIA_UPLOAD_BYTES, C as entryIdentifierForCommand, Cn as ICON_PICKER_PRESETS, Ct as PUBLIC_FILE_FIELD_KINDS, Dn as asFooterLookId, Dt as buildMediaIdentifierFromFilename, En as SUPPORTED_LOADER_ENDPOINTS, Er as createContentEntryRef, Ft as getMimeType, Ir as slugPart, K as themeSchema, Kn as asAppearancePresetId, Ln as SYSTEM_BLOCK_KINDS, Lt as normalizeAmbiguousStoragePathForSite, Mn as headerLayoutIdValues, N as footerPreferencesSchema, Nn as headerStyleIdValues, Nr as createSiteCommandSiteRef, On as asHeaderLayoutId, P as headerPreferencesSchema, Pt as getExtensionForMimeType, Tr as createCommandRef, Tt as mediaTypeDiscriminants, V as footerModeSchema, Xn as asDesignBlockId, Zn as asDesignBoundaryId, _ as evaluateSiteCommandBatchExposure, br as require_dist, f as stableStringify, jn as footerLookIdValues, jt as slugifyMediaIdentifier, k as eventBookingOfferIntentSchema, kn as asHeaderStyleId, l as resolvePageUpsertSeo, lr as RESOLVED_INTERNAL_LINK_ENTITY_TYPES, m as parseAndPlanCommandBatchForTypes, n as sdkCourseBookingSettingsSchema, nr as asSiteStyleId, p as createDryRunReport, pt as getDirectImageUrlForSiteScopedPath, r as sdkEventOccurrenceInputSchema, rr as makeBoundaryId, s as eventVisibilitySchema, tr as asPageFlowPresetId, ut as parseAspectRatioValue, v as evaluateSiteCommandExposure, wt as isDisplayMediaKind, xr as bookingQuestionAttachmentSchema, y as getSiteCommandMetadata, zt as FILE_SIZE_LIMITS } from "./sdk-event-upsert-BC_MyWOx.mjs";
3
- import { $n as parseSiteId, An as unsafeAsPassId, At as resolveBookingTimeZoneId, Bt as addIntervalPreservingMonthAnchor, D as parseManagementKey, Dt as parseBookingLocalDate, E as exposeSecret, En as parseCustomerId, Gt as omitZeroAmountFutureRows, Ht as getBookingInstalmentDepositRefundability, It as validateBookingPaymentOptionKinds, J as assertAllowedPublicUrl, Jn as unsafeAsCheckoutLineId, Jt as scheduleBookingReasonCodes, Kt as splitAmountWithRemainderInFirst, Lt as isLiveOrderInstalmentPlanStatus, Mn as parseDatedOfferingCapacityHoldId, On as parseMembershipId, Qn as parseApiKeyId, R as parseMailingListProviderScope, Rt as isSettleableFlexibleBalanceContractStatus, T as createSecret, Tn as unsafeAsStaffMemberId, Vt as clampConfiguredAmount, Wt as getBookingInstalmentProtectedDepositAmountCents, Xn as parsePageId, Xt as resolveFlexibleBalanceInitialPaymentCents, Yn as parseEditorSessionGeneration, Yt as resolveFlexibleBalanceDueAt, _n as unsafeAsPositiveCents, a as resolveEventCatalogue, ar as unsafeAsEventInstanceId, bn as assertNever, c as areConfiguredBookingVerticalConfigsEqual, cn as fromArray, cr as unsafeAsOccurrenceId, d as parseVerticalPresetId, dn as isNonNegativeWholeCents$1, dr as ok, er as parseUserId, et as locationValueSchema, f as resolveSiteVerticalBookingConfig, fn as parseNonNegativeCents, g as SURFACE_EVENT_PRESET_VALUES, gn as unsafeAsNonNegativeCents, hn as toNonNegativeCents, ir as parseRetiredCourseId, it as publicLocationSchema, jn as parseDatedOfferingCapacityHoldAuditRef, l as canonicalizeConfiguredBookingVerticalConfig, lr as unsafeAsPricingOptionId, m as EVENT_PRESET_VALUES, mn as toCents, n as committedWriteProofSchema, or as unsafeAsEventOfferingId, p as DEFAULT_EVENT_TYPE_PRESETS, pn as parsePositiveCents, qt as businessCancellationRefusalCodes, rr as parseEventSeriesId, sr as unsafeAsEventSeriesId, st as trimmedStringOrNull, t as OFFLINE_PAYMENT_METHODS, u as parseVerticalId, ur as err, ut as formatDate, v as getPublicReadCachePolicy, wn as unsafeAsAppointmentResourceId, y as publicReadFreshnessSeconds, yn as parseCurrencyCode, z as parseFooterCompositionV1, zt as isSettleableOrderInstalmentPlanStatus } from "./src-CevC_tvx.mjs";
4
- import { n as CliSdkPeerError, t as loadConfigFile } from "./load-config-D32BDh2g.mjs";
2
+ import { $n as headerStyleIdValues, A as footerPreferencesSchema, Cr as makeBoundaryId, Dt as resolveMediaIdentifier, Ir as createSiteCommandSiteRef, It as FILE_SIZE_LIMITS, Jn as asHeaderLayoutId, Kn as SUPPORTED_LOADER_ENDPOINTS, Lt as MAX_MANAGEMENT_MEDIA_UPLOAD_BYTES, Mt as getMimeType, Nn as RESOLVED_INTERNAL_LINK_ENTITY_TYPES, Or as createCommandRef, Ot as slugifyMediaIdentifier, Pt as normalizeAmbiguousStoragePathForSite, Qn as headerLayoutIdValues, R as footerModeSchema, Sn as eventBookingOfferIntentSchema, Sr as asSiteStyleId, St as mediaTypeDiscriminants, U as themeSchema, Un as ICON_PICKER_PRESETS, Xt as buttonStyleSelectionSchema, Yn as asHeaderStyleId, Zn as footerLookIdValues, _r as asDesignBoundaryId, b as getSiteCommandMetadata, bt as PUBLIC_FILE_FIELD_KINDS, fr as asAppearancePresetId, gr as asDesignBlockId, h as parseAndPlanCommandBatchForTypes, j as headerPreferencesSchema, jt as getExtensionForMimeType, kr as createContentEntryRef, l as resolvePageUpsertSeo, m as createDryRunReport, n as sdkCourseBookingSettingsSchema, p as stableStringify, qn as asFooterLookId, r as sdkEventOccurrenceInputSchema, rr as SYSTEM_BLOCK_KINDS, s as eventVisibilitySchema, st as parseAspectRatioValue, ut as getDirectImageUrlForSiteScopedPath, v as evaluateSiteCommandBatchExposure, w as entryIdentifierForCommand, wr as bookingQuestionAttachmentSchema, wt as buildMediaIdentifierFromFilename, xn as require_dist, xr as asPageFlowPresetId, xt as isDisplayMediaKind, y as evaluateSiteCommandExposure, zr as slugPart } from "./sdk-event-upsert-BMYgDeSe.mjs";
3
+ import { $t as businessCancellationRefusalCodes, C as isPublicReadEndpoint, Cn as unsafeAsNonNegativeCents, Dn as assertNever, En as parseCurrencyCode, Fn as parseMembershipId, G as parseFooterCompositionV1, Gt as isSettleableOrderInstalmentPlanStatus, Ht as validateBookingPaymentOptionKinds, It as resolveBookingTimeZoneId, Jt as getBookingInstalmentDepositRefundability, Kt as addIntervalPreservingMonthAnchor, Ln as unsafeAsPassId, M as exposeSecret, Mn as unsafeAsStaffMemberId, N as parseManagementKey, Nn as parseCustomerId, Nt as parseBookingLocalDate, Qt as splitAmountWithRemainderInFirst, Rn as parseDatedOfferingCapacityHoldAuditRef, S as getPublicReadCachePolicy, Sn as toNonNegativeCents, Ut as isLiveOrderInstalmentPlanStatus, W as parseMailingListProviderScope, Wt as isSettleableFlexibleBalanceContractStatus, Xt as getBookingInstalmentProtectedDepositAmountCents, Zt as omitZeroAmountFutureRows, _r as unsafeAsPricingOptionId, ar as parseApiKeyId, b as PUBLIC_AVAILABILITY_FRESHNESS_SECONDS, bn as parsePositiveCents, c as resolveEventCatalogue, d as canonicalizeConfiguredBookingVerticalConfig, dr as parseRetiredCourseId, en as scheduleBookingReasonCodes, et as assertAllowedPublicUrl, f as parseVerticalId, g as EVENT_PRESET_VALUES, gr as unsafeAsOccurrenceId, gt as formatDate, h as DEFAULT_EVENT_TYPE_PRESETS, hn as fromArray, hr as unsafeAsEventSeriesId, j as createSecret, jn as unsafeAsAppointmentResourceId, m as resolveSiteVerticalBookingConfig, mr as unsafeAsEventOfferingId, n as OFFLINE_PAYMENT_METHODS, nn as resolveFlexibleBalanceInitialPaymentCents, nr as parseEditorSessionGeneration, or as parseSiteId, ot as locationValueSchema, p as parseVerticalPresetId, pr as unsafeAsEventInstanceId, pt as trimmedStringOrNull, qt as clampConfiguredAmount, r as committedWriteProofSchema, rr as parsePageId, sr as parseUserId, tn as resolveFlexibleBalanceDueAt, tr as unsafeAsCheckoutLineId, u as areConfiguredBookingVerticalConfigsEqual, ur as parseEventSeriesId, ut as publicLocationSchema, v as SURFACE_EVENT_PRESET_VALUES, vn as isNonNegativeWholeCents$1, vr as err, w as publicReadFreshnessSeconds, wn as unsafeAsPositiveCents, x as PUBLIC_CONTENT_FRESHNESS_SECONDS, xn as toCents, yn as parseNonNegativeCents, yr as ok, zn as parseDatedOfferingCapacityHoldId } from "./src-BXMUcFYN.mjs";
4
+ import { n as CliSdkPeerError, t as loadConfigFile } from "./load-config-CMeJVHDQ.mjs";
5
5
  import { Command } from "commander";
6
6
  import { safeParse, z } from "zod";
7
7
  import { AsyncLocalStorage } from "node:async_hooks";
@@ -814,6 +814,12 @@ const PREVIEW_BLOCKED_REASONS = [
814
814
  "policy_disallows",
815
815
  "no_refundable_payment_link",
816
816
  "nothing_remaining_to_refund",
817
+ "nothing_owed",
818
+ "no_card_payments",
819
+ "no_email",
820
+ "payment_link_unavailable",
821
+ "waive_needs_whole_order",
822
+ "payment_amount_too_high",
817
823
  "invalid_refund_amount",
818
824
  "invalid_refund_context",
819
825
  "site_credit_unavailable",
@@ -952,6 +958,64 @@ function pageCommitReasonFromTag(tag) {
952
958
  return result.success ? result.data : null;
953
959
  }
954
960
 
961
+ //#endregion
962
+ //#region ../api/src/defineEndpointDefinitions.ts
963
+ /**
964
+ * Validates extracted endpoint descriptors while preserving each literal path,
965
+ * method, and parameter contract for the typed URL builders.
966
+ */
967
+ function defineEndpointDefinitions(definitions) {
968
+ return definitions;
969
+ }
970
+
971
+ //#endregion
972
+ //#region ../api/src/apiEndpointTypes.ts
973
+ function allowedDemoMutationPolicy() {
974
+ return {
975
+ classification: "allowed",
976
+ publicMessage: ""
977
+ };
978
+ }
979
+ function blockedDemoMutationPolicy(classification, publicMessage) {
980
+ if (publicMessage.trim() === "") {
981
+ throw new Error(`Demo mutation policy ${classification} requires publicMessage.`);
982
+ }
983
+ return {
984
+ classification,
985
+ publicMessage
986
+ };
987
+ }
988
+
989
+ //#endregion
990
+ //#region ../api/src/pageSectionLooks.ts
991
+ const PAGE_SECTION_LOOK_ENDPOINT_DEFINITIONS = defineEndpointDefinitions({
992
+ setPageSectionLook: {
993
+ path: "/sites/{siteId}/page-sections/look",
994
+ method: "POST",
995
+ auth: "user",
996
+ responseKind: "json",
997
+ demoMutation: allowedDemoMutationPolicy(),
998
+ errors: [
999
+ "validation:invalid_input",
1000
+ "resource:not_found",
1001
+ "resource:conflict",
1002
+ "server:internal_error"
1003
+ ]
1004
+ },
1005
+ getPageSectionOnPage: {
1006
+ path: "/sites/{siteId}/page-sections/{sectionId}/pages/{pageSurfaceId}",
1007
+ method: "GET",
1008
+ auth: "user",
1009
+ responseKind: "json",
1010
+ errors: [
1011
+ "validation:invalid_input",
1012
+ "auth:forbidden",
1013
+ "resource:not_found",
1014
+ "server:internal_error"
1015
+ ]
1016
+ }
1017
+ });
1018
+
955
1019
  //#endregion
956
1020
  //#region ../api/src/pageJournalEndpoints.ts
957
1021
  const PAGE_JOURNAL_ENDPOINT_DEFINITIONS = {
@@ -1039,24 +1103,6 @@ const PAGE_JOURNAL_ENDPOINT_DEFINITIONS = {
1039
1103
  }
1040
1104
  };
1041
1105
 
1042
- //#endregion
1043
- //#region ../api/src/apiEndpointTypes.ts
1044
- function allowedDemoMutationPolicy() {
1045
- return {
1046
- classification: "allowed",
1047
- publicMessage: ""
1048
- };
1049
- }
1050
- function blockedDemoMutationPolicy(classification, publicMessage) {
1051
- if (publicMessage.trim() === "") {
1052
- throw new Error(`Demo mutation policy ${classification} requires publicMessage.`);
1053
- }
1054
- return {
1055
- classification,
1056
- publicMessage
1057
- };
1058
- }
1059
-
1060
1106
  //#endregion
1061
1107
  //#region ../api/src/demoMutationPolicies.ts
1062
1108
  const DEMO_MUTATION_BLOCKED_HIDDEN = blockedDemoMutationPolicy("blocked-hidden", "This action is not available in demo sites.");
@@ -1064,16 +1110,6 @@ const DEMO_MUTATION_BLOCKED_DISABLED = blockedDemoMutationPolicy("blocked-disabl
1064
1110
  const DEMO_MUTATION_INTERNAL_ONLY = blockedDemoMutationPolicy("internal-only", "This internal operation is not available in demo sites.");
1065
1111
  const DEMO_MUTATION_ALLOWED = allowedDemoMutationPolicy();
1066
1112
 
1067
- //#endregion
1068
- //#region ../api/src/defineEndpointDefinitions.ts
1069
- /**
1070
- * Validates extracted endpoint descriptors while preserving each literal path,
1071
- * method, and parameter contract for the typed URL builders.
1072
- */
1073
- function defineEndpointDefinitions(definitions) {
1074
- return definitions;
1075
- }
1076
-
1077
1113
  //#endregion
1078
1114
  //#region ../api/src/bookingAttentionEndpointDefinitions.ts
1079
1115
  const BOOKING_ATTENTION_ENDPOINT_DEFINITIONS = defineEndpointDefinitions({
@@ -1538,18 +1574,22 @@ function normalizeSiteCacheId(id) {
1538
1574
  const parsed = parseSiteId(id);
1539
1575
  return parsed.ok ? parsed.value : id;
1540
1576
  }
1541
- /** Memory caches follow the same public-read policy as HTTP and batch readers. */
1542
- function buildPublicReadMemoryCacheTags(endpoint, params) {
1543
- const policy = getPublicReadCachePolicy(endpoint);
1544
- if (policy.kind === "live") return [];
1545
- const templates = {
1546
- published_content: TAG_TEMPLATES.siteRoutableContent,
1547
- public_team_members: TAG_TEMPLATES.publicTeamMembers,
1548
- public_products: TAG_TEMPLATES.publicShop,
1549
- site_forms: TAG_TEMPLATES.siteForms
1550
- };
1577
+ const PUBLIC_READ_TAG_TEMPLATES = {
1578
+ published_content: TAG_TEMPLATES.siteRoutableContent,
1579
+ public_team_members: TAG_TEMPLATES.publicTeamMembers,
1580
+ public_products: TAG_TEMPLATES.publicProducts,
1581
+ public_events: TAG_TEMPLATES.publicEvents,
1582
+ public_event_filters: TAG_TEMPLATES.publicEventFilters,
1583
+ public_passes: TAG_TEMPLATES.publicPasses,
1584
+ public_memberships: TAG_TEMPLATES.publicMemberships,
1585
+ public_booking_services: TAG_TEMPLATES.publicBookingServices,
1586
+ public_booking_availability: TAG_TEMPLATES.publicBookingAvailability,
1587
+ site_forms: TAG_TEMPLATES.siteForms
1588
+ };
1589
+ /** Fetch dependencies apply even to reads forbidden from memory/fallback reuse. */
1590
+ function buildPublicReadFetchTags(endpoint, params) {
1551
1591
  return buildCacheReadTags([
1552
- ...policy.tags.map((kind) => templates[kind]),
1592
+ ...getPublicReadCachePolicy(endpoint).fetchTags.map((kind) => PUBLIC_READ_TAG_TEMPLATES[kind]),
1553
1593
  ...endpoint === "checkRedirect" ? [
1554
1594
  TAG_TEMPLATES.siteRedirects,
1555
1595
  TAG_TEMPLATES.siteBySlug,
@@ -1558,6 +1598,20 @@ function buildPublicReadMemoryCacheTags(endpoint, params) {
1558
1598
  ...endpoint === "getPublicFormById" ? [TAG_TEMPLATES.formById] : []
1559
1599
  ], params);
1560
1600
  }
1601
+ /** Memory/fallback eligibility remains independent of fetch dependencies. */
1602
+ function buildPublicReadMemoryCacheTags(endpoint, params) {
1603
+ return getPublicReadCachePolicy(endpoint).kind === "live" ? [] : buildPublicReadFetchTags(endpoint, params);
1604
+ }
1605
+ /** A transport batch inherits every dependency and its shortest freshness budget. */
1606
+ function buildPublicReadFetchPolicy(siteId, reads) {
1607
+ return {
1608
+ tags: normalizeRevalidateTags(reads.flatMap(({ endpoint, params }) => isPublicReadEndpoint(endpoint) ? buildPublicReadFetchTags(endpoint, {
1609
+ ...params,
1610
+ siteId
1611
+ }) : buildCacheReadTags([], { siteId }))),
1612
+ revalidate: Math.min(PUBLIC_CONTENT_FRESHNESS_SECONDS, ...reads.map(({ endpoint }) => isPublicReadEndpoint(endpoint) ? publicReadFreshnessSeconds(endpoint) : PUBLIC_AVAILABILITY_FRESHNESS_SECONDS))
1613
+ };
1614
+ }
1561
1615
 
1562
1616
  //#endregion
1563
1617
  //#region ../api/src/sdkEntryReadEndpoints.ts
@@ -1629,6 +1683,363 @@ const GUARDED_CONTENT_REPLAY_ENDPOINT_DEFINITIONS = defineEndpointDefinitions({
1629
1683
  }
1630
1684
  });
1631
1685
 
1686
+ //#endregion
1687
+ //#region ../api/src/clientArrangementEndpoints.ts
1688
+ const localDate = z.iso.date();
1689
+ const weekday = z.union([
1690
+ z.literal(0),
1691
+ z.literal(1),
1692
+ z.literal(2),
1693
+ z.literal(3),
1694
+ z.literal(4),
1695
+ z.literal(5),
1696
+ z.literal(6)
1697
+ ]);
1698
+ const arrangementCadenceSchema = z.discriminatedUnion("kind", [z.object({
1699
+ kind: z.literal("weekly"),
1700
+ everyWeeks: z.union([z.literal(1), z.literal(2)]),
1701
+ weekday
1702
+ }).strict(), z.object({
1703
+ kind: z.literal("monthly"),
1704
+ weekday,
1705
+ nth: z.union([
1706
+ z.literal(1),
1707
+ z.literal(2),
1708
+ z.literal(3),
1709
+ z.literal(4),
1710
+ z.literal("last")
1711
+ ])
1712
+ }).strict()]);
1713
+ const arrangementEndSchema = z.discriminatedUnion("kind", [
1714
+ z.object({ kind: z.literal("open") }).strict(),
1715
+ z.object({
1716
+ kind: z.literal("on_date"),
1717
+ lastDate: localDate
1718
+ }).strict(),
1719
+ z.object({
1720
+ kind: z.literal("after_sessions"),
1721
+ sessions: z.number().int().min(1).max(1e4)
1722
+ }).strict()
1723
+ ]);
1724
+ const arrangementPaymentSchema = z.discriminatedUnion("kind", [
1725
+ z.object({
1726
+ kind: z.literal("package"),
1727
+ customerPassId: z.string().uuid()
1728
+ }).strict(),
1729
+ z.object({ kind: z.literal("owed") }).strict(),
1730
+ z.object({
1731
+ kind: z.literal("payment_link"),
1732
+ sendOffsetMinutes: z.number().int().min(1).max(525600)
1733
+ }).strict()
1734
+ ]);
1735
+ const arrangementScheduleSchema = z.object({
1736
+ effectiveFrom: localDate,
1737
+ cadence: arrangementCadenceSchema,
1738
+ localStart: z.string().regex(/^([01]\d|2[0-3]):[0-5]\d$/)
1739
+ }).strict();
1740
+ const recordedReturn = { recordedReturn: z.literal("staff_confirmed").optional() };
1741
+ const operation = {
1742
+ operationId: z.string().uuid(),
1743
+ emailClient: z.boolean().default(true)
1744
+ };
1745
+ const createClientArrangementSchema = z.object({
1746
+ ...operation,
1747
+ customerId: z.string().uuid(),
1748
+ resourceId: z.string().uuid(),
1749
+ serviceId: z.string().uuid(),
1750
+ timezone: z.string().min(1),
1751
+ holdsTime: z.boolean(),
1752
+ end: arrangementEndSchema,
1753
+ payment: arrangementPaymentSchema,
1754
+ schedule: arrangementScheduleSchema,
1755
+ bookAhead: z.number().int().min(0).max(52),
1756
+ bookShortfallAsOwed: z.boolean().default(false)
1757
+ }).strict();
1758
+ /** The UI selects the next N dates from get.dates, then retains this body for retry. */
1759
+ const bookNextArrangementSchema = z.object({
1760
+ ...operation,
1761
+ occurrenceDates: z.array(localDate).min(1).max(52).refine((values) => new Set(values).size === values.length, "Choose each date once."),
1762
+ bookShortfallAsOwed: z.boolean().default(false)
1763
+ }).strict();
1764
+ const arrangementAwaySchema = z.object({
1765
+ ...operation,
1766
+ ...recordedReturn,
1767
+ from: localDate,
1768
+ backOn: localDate
1769
+ }).strict().refine((value) => value.backOn > value.from, "Choose a return date after the first day away.");
1770
+ const arrangementChangeFromSchema = z.object({
1771
+ ...operation,
1772
+ schedule: arrangementScheduleSchema
1773
+ }).strict();
1774
+ const arrangementOneWeekSchema = z.object({
1775
+ ...operation,
1776
+ occurrenceDate: localDate,
1777
+ startAt: z.iso.datetime({ offset: true }),
1778
+ endAt: z.iso.datetime({ offset: true }),
1779
+ bookShortfallAsOwed: z.boolean().default(false)
1780
+ }).strict().refine((value) => Date.parse(value.endAt) > Date.parse(value.startAt), "Choose an end after the start.");
1781
+ const arrangementEndRequestSchema = z.object({
1782
+ ...operation,
1783
+ ...recordedReturn,
1784
+ lastDate: localDate
1785
+ }).strict();
1786
+ const arrangementEditSchema = z.object({
1787
+ ...operation,
1788
+ serviceId: z.string().uuid(),
1789
+ holdsTime: z.boolean(),
1790
+ payment: arrangementPaymentSchema
1791
+ }).strict();
1792
+ const previewClientArrangementSchema = z.discriminatedUnion("kind", [
1793
+ z.object({
1794
+ kind: z.literal("create"),
1795
+ request: createClientArrangementSchema
1796
+ }).strict(),
1797
+ z.object({
1798
+ kind: z.literal("book_next"),
1799
+ arrangementId: z.string().uuid(),
1800
+ request: bookNextArrangementSchema
1801
+ }).strict(),
1802
+ z.object({
1803
+ kind: z.literal("away"),
1804
+ arrangementId: z.string().uuid(),
1805
+ request: arrangementAwaySchema
1806
+ }).strict(),
1807
+ z.object({
1808
+ kind: z.literal("change_from"),
1809
+ arrangementId: z.string().uuid(),
1810
+ request: arrangementChangeFromSchema
1811
+ }).strict(),
1812
+ z.object({
1813
+ kind: z.literal("one_week"),
1814
+ arrangementId: z.string().uuid(),
1815
+ request: arrangementOneWeekSchema
1816
+ }).strict(),
1817
+ z.object({
1818
+ kind: z.literal("end"),
1819
+ arrangementId: z.string().uuid(),
1820
+ request: arrangementEndRequestSchema
1821
+ }).strict()
1822
+ ]);
1823
+ const arrangementTimeOffChoiceSchema = z.discriminatedUnion("kind", [
1824
+ z.object({ kind: z.literal("later") }).strict(),
1825
+ z.object({
1826
+ kind: z.literal("cancel"),
1827
+ recordedReturn: z.enum(["staff_confirmed", "not_confirmed"])
1828
+ }).strict(),
1829
+ z.object({
1830
+ kind: z.literal("move"),
1831
+ startAt: z.iso.datetime({ offset: true }),
1832
+ endAt: z.iso.datetime({ offset: true })
1833
+ }).strict(),
1834
+ z.object({
1835
+ kind: z.literal("hand_over"),
1836
+ resourceId: z.string().uuid(),
1837
+ startAt: z.iso.datetime({ offset: true }),
1838
+ endAt: z.iso.datetime({ offset: true })
1839
+ }).strict()
1840
+ ]);
1841
+ const arrangementTimeOffSchema = z.object({
1842
+ ...operation,
1843
+ confirmation: z.string().optional(),
1844
+ resourceId: z.string().uuid(),
1845
+ startsAt: z.iso.datetime({ offset: true }),
1846
+ endsAt: z.iso.datetime({ offset: true }),
1847
+ reason: z.string().nullable(),
1848
+ deferredAppointmentIds: z.array(z.string().uuid()).max(200).optional(),
1849
+ selections: z.array(z.object({
1850
+ arrangementId: z.string().uuid(),
1851
+ appointmentId: z.string().uuid(),
1852
+ choice: arrangementTimeOffChoiceSchema
1853
+ }).strict()).max(200)
1854
+ }).strict().refine((value) => Date.parse(value.endsAt) > Date.parse(value.startsAt), "Choose an end after the start.").refine((value) => new Set(value.selections.map((row) => row.appointmentId)).size === value.selections.length, "Choose each session once.");
1855
+ /** A single local date, for the arrangement move/handover picker. */
1856
+ const arrangementAvailableSlotsSchema = z.object({
1857
+ appointmentId: z.string().uuid(),
1858
+ resourceId: z.string().uuid().optional(),
1859
+ date: localDate
1860
+ }).strict();
1861
+ /** Validate retained operation outcomes when they cross the JSON storage boundary. */
1862
+ const arrangementDateResultSchema = z.intersection(z.object({ occurrenceDate: localDate }), z.union([
1863
+ z.object({
1864
+ outcome: z.enum(["booked", "already_booked"]),
1865
+ appointmentId: z.string(),
1866
+ startAt: z.string(),
1867
+ endAt: z.string(),
1868
+ payment: z.discriminatedUnion("kind", [
1869
+ z.object({
1870
+ kind: z.literal("package"),
1871
+ customerPassId: z.string()
1872
+ }),
1873
+ z.object({ kind: z.literal("owed") }),
1874
+ z.object({
1875
+ kind: z.literal("payment_link"),
1876
+ scheduledSendAt: z.string()
1877
+ })
1878
+ ])
1879
+ }),
1880
+ z.object({
1881
+ outcome: z.literal("moved"),
1882
+ previousStartAt: z.string(),
1883
+ previousEndAt: z.string(),
1884
+ appointmentId: z.string(),
1885
+ startAt: z.string(),
1886
+ endAt: z.string(),
1887
+ trainer: z.object({
1888
+ resourceId: z.string(),
1889
+ name: z.string().nullable()
1890
+ }),
1891
+ payment: z.discriminatedUnion("kind", [
1892
+ z.object({
1893
+ kind: z.literal("package"),
1894
+ customerPassId: z.string()
1895
+ }),
1896
+ z.object({ kind: z.literal("owed") }),
1897
+ z.object({
1898
+ kind: z.literal("payment_link"),
1899
+ scheduledSendAt: z.string()
1900
+ })
1901
+ ])
1902
+ }),
1903
+ z.object({
1904
+ outcome: z.literal("cancelled"),
1905
+ appointmentId: z.string(),
1906
+ startAt: z.string(),
1907
+ endAt: z.string(),
1908
+ settlement: z.enum([
1909
+ "package_returned",
1910
+ "refunded",
1911
+ "refunded_in_person",
1912
+ "nothing_owed"
1913
+ ]),
1914
+ refundAmountCents: z.number().nullable(),
1915
+ refundCurrency: z.string().nullable(),
1916
+ refundDestinations: z.object({
1917
+ cardCents: z.number().nonnegative(),
1918
+ directCents: z.number().nonnegative(),
1919
+ creditCents: z.number().nonnegative()
1920
+ })
1921
+ }),
1922
+ z.intersection(z.object({
1923
+ outcome: z.literal("refused"),
1924
+ appointmentId: z.string().optional()
1925
+ }), z.discriminatedUnion("code", [
1926
+ z.object({ code: z.enum([
1927
+ "package_shortfall",
1928
+ "not_available",
1929
+ "needs_recorded_return",
1930
+ "client_not_found"
1931
+ ]) }),
1932
+ z.object({
1933
+ code: z.literal("clash"),
1934
+ customerFirstName: z.string().nullable()
1935
+ }),
1936
+ z.object({
1937
+ code: z.literal("command_failed"),
1938
+ detail: z.string().nullable()
1939
+ })
1940
+ ]))
1941
+ ]));
1942
+ const errors = [
1943
+ "validation:invalid_input",
1944
+ "auth:forbidden",
1945
+ "resource:not_found",
1946
+ "resource:conflict",
1947
+ "server:internal_error"
1948
+ ];
1949
+ const CLIENT_ARRANGEMENT_ENDPOINT_DEFINITIONS = defineEndpointDefinitions({
1950
+ getArrangementAvailableSlots: {
1951
+ path: "/sites/{siteId}/bookings/client-arrangements/{arrangementId}/available-slots",
1952
+ method: "POST",
1953
+ auth: "user",
1954
+ responseKind: "json",
1955
+ errors
1956
+ },
1957
+ previewArrangementTimeOff: {
1958
+ path: "/sites/{siteId}/bookings/client-arrangements/time-off/preview",
1959
+ method: "POST",
1960
+ auth: "user",
1961
+ responseKind: "json",
1962
+ errors
1963
+ },
1964
+ applyArrangementTimeOff: {
1965
+ path: "/sites/{siteId}/bookings/client-arrangements/time-off",
1966
+ method: "POST",
1967
+ auth: "user",
1968
+ responseKind: "json",
1969
+ errors
1970
+ },
1971
+ previewClientArrangement: {
1972
+ path: "/sites/{siteId}/bookings/client-arrangements/preview",
1973
+ method: "POST",
1974
+ auth: "user",
1975
+ responseKind: "json",
1976
+ errors
1977
+ },
1978
+ listClientArrangements: {
1979
+ path: "/sites/{siteId}/bookings/client-arrangements",
1980
+ method: "GET",
1981
+ auth: "user",
1982
+ responseKind: "json",
1983
+ errors
1984
+ },
1985
+ getClientArrangement: {
1986
+ path: "/sites/{siteId}/bookings/client-arrangements/{arrangementId}",
1987
+ method: "GET",
1988
+ auth: "user",
1989
+ responseKind: "json",
1990
+ errors
1991
+ },
1992
+ createClientArrangement: {
1993
+ path: "/sites/{siteId}/bookings/client-arrangements",
1994
+ method: "POST",
1995
+ auth: "user",
1996
+ responseKind: "json",
1997
+ errors
1998
+ },
1999
+ bookNextArrangement: {
2000
+ path: "/sites/{siteId}/bookings/client-arrangements/{arrangementId}/book-next",
2001
+ method: "POST",
2002
+ auth: "user",
2003
+ responseKind: "json",
2004
+ errors
2005
+ },
2006
+ markArrangementAway: {
2007
+ path: "/sites/{siteId}/bookings/client-arrangements/{arrangementId}/away",
2008
+ method: "POST",
2009
+ auth: "user",
2010
+ responseKind: "json",
2011
+ errors
2012
+ },
2013
+ changeArrangementFrom: {
2014
+ path: "/sites/{siteId}/bookings/client-arrangements/{arrangementId}/change-from",
2015
+ method: "POST",
2016
+ auth: "user",
2017
+ responseKind: "json",
2018
+ errors
2019
+ },
2020
+ changeArrangementOneWeek: {
2021
+ path: "/sites/{siteId}/bookings/client-arrangements/{arrangementId}/one-week",
2022
+ method: "POST",
2023
+ auth: "user",
2024
+ responseKind: "json",
2025
+ errors
2026
+ },
2027
+ endClientArrangement: {
2028
+ path: "/sites/{siteId}/bookings/client-arrangements/{arrangementId}/end",
2029
+ method: "POST",
2030
+ auth: "user",
2031
+ responseKind: "json",
2032
+ errors
2033
+ },
2034
+ editClientArrangement: {
2035
+ path: "/sites/{siteId}/bookings/client-arrangements/{arrangementId}",
2036
+ method: "PUT",
2037
+ auth: "user",
2038
+ responseKind: "json",
2039
+ errors
2040
+ }
2041
+ });
2042
+
1632
2043
  //#endregion
1633
2044
  //#region ../api/src/appointmentRequestEndpointDefinitions.ts
1634
2045
  const APPOINTMENT_REQUEST_ENDPOINT_DEFINITIONS = defineEndpointDefinitions({
@@ -1750,6 +2161,7 @@ const APPOINTMENT_SERVICE_CATEGORY_ENDPOINT_DEFINITIONS = defineEndpointDefiniti
1750
2161
  const APPOINTMENT_ENDPOINT_DEFINITIONS = defineEndpointDefinitions({
1751
2162
  ...APPOINTMENT_SERVICE_CATEGORY_ENDPOINT_DEFINITIONS,
1752
2163
  ...APPOINTMENT_REQUEST_ENDPOINT_DEFINITIONS,
2164
+ ...CLIENT_ARRANGEMENT_ENDPOINT_DEFINITIONS,
1753
2165
  listAppointmentResources: {
1754
2166
  path: "/sites/{siteId}/bookings/resources",
1755
2167
  method: "GET",
@@ -1805,15 +2217,8 @@ const APPOINTMENT_ENDPOINT_DEFINITIONS = defineEndpointDefinitions({
1805
2217
  responseKind: "json",
1806
2218
  errors: ["resource:not_found", "server:internal_error"]
1807
2219
  },
1808
- listAppointmentReservations: {
1809
- path: "/sites/{siteId}/bookings/appointment-reservations",
1810
- method: "GET",
1811
- auth: "user",
1812
- responseKind: "json",
1813
- errors: []
1814
- },
1815
- createAppointmentReservation: {
1816
- path: "/sites/{siteId}/bookings/appointment-reservations",
2220
+ createTeamMemberProfile: {
2221
+ path: "/sites/{siteId}/bookings/resources/{resourceId}/profile",
1817
2222
  method: "POST",
1818
2223
  auth: "user",
1819
2224
  responseKind: "json",
@@ -1824,92 +2229,36 @@ const APPOINTMENT_ENDPOINT_DEFINITIONS = defineEndpointDefinitions({
1824
2229
  "server:internal_error"
1825
2230
  ]
1826
2231
  },
1827
- getAppointmentReservation: {
1828
- path: "/sites/{siteId}/bookings/appointment-reservations/{reservationId}",
2232
+ resolveTeamMemberProfileEditorOwner: {
2233
+ path: "/sites/{siteId}/bookings/profile-editor/{entryId}/owner",
1829
2234
  method: "GET",
1830
2235
  auth: "user",
1831
2236
  responseKind: "json",
1832
- errors: ["resource:not_found", "server:internal_error"]
1833
- },
1834
- updateAppointmentReservation: {
1835
- path: "/sites/{siteId}/bookings/appointment-reservations/{reservationId}",
1836
- method: "PUT",
1837
- auth: "user",
1838
- responseKind: "json",
1839
- errors: [
1840
- "validation:invalid_input",
1841
- "resource:not_found",
1842
- "resource:conflict",
1843
- "server:internal_error"
1844
- ]
1845
- },
1846
- pauseAppointmentReservation: {
1847
- path: "/sites/{siteId}/bookings/appointment-reservations/{reservationId}/pause",
1848
- method: "POST",
1849
- auth: "user",
1850
- responseKind: "json",
1851
- errors: [
1852
- "resource:not_found",
1853
- "resource:conflict",
1854
- "server:internal_error"
1855
- ]
1856
- },
1857
- resumeAppointmentReservation: {
1858
- path: "/sites/{siteId}/bookings/appointment-reservations/{reservationId}/resume",
1859
- method: "POST",
1860
- auth: "user",
1861
- responseKind: "json",
1862
- errors: [
1863
- "resource:not_found",
1864
- "resource:conflict",
1865
- "server:internal_error"
1866
- ]
1867
- },
1868
- endAppointmentReservation: {
1869
- path: "/sites/{siteId}/bookings/appointment-reservations/{reservationId}/end",
1870
- method: "POST",
1871
- auth: "user",
1872
- responseKind: "json",
1873
- errors: [
1874
- "validation:invalid_input",
1875
- "resource:not_found",
1876
- "resource:conflict",
1877
- "server:internal_error"
1878
- ]
1879
- },
1880
- previewAppointmentReservationRun: {
1881
- path: "/sites/{siteId}/bookings/appointment-reservations/{reservationId}/run-preview",
1882
- method: "POST",
1883
- auth: "user",
1884
- responseKind: "json",
1885
2237
  errors: [
1886
- "validation:invalid_input",
2238
+ "auth:forbidden",
1887
2239
  "resource:not_found",
1888
- "resource:conflict",
1889
2240
  "server:internal_error"
1890
2241
  ]
1891
2242
  },
1892
- createAppointmentReservationRun: {
1893
- path: "/sites/{siteId}/bookings/appointment-reservations/{reservationId}/runs",
1894
- method: "POST",
2243
+ getTeamMemberProfileContent: {
2244
+ path: "/sites/{siteId}/bookings/resources/{resourceId}/profile/{entryId}",
2245
+ method: "GET",
1895
2246
  auth: "user",
1896
2247
  responseKind: "json",
1897
2248
  errors: [
1898
- "validation:invalid_input",
2249
+ "auth:forbidden",
1899
2250
  "resource:not_found",
1900
- "resource:conflict",
1901
2251
  "server:internal_error"
1902
2252
  ]
1903
2253
  },
1904
- createTeamMemberProfile: {
1905
- path: "/sites/{siteId}/bookings/resources/{resourceId}/profile",
1906
- method: "POST",
2254
+ listTeamMemberProfileContentSlots: {
2255
+ path: "/sites/{siteId}/bookings/resources/{resourceId}/profile/{entryId}/slots",
2256
+ method: "GET",
1907
2257
  auth: "user",
1908
2258
  responseKind: "json",
1909
2259
  errors: [
1910
- "validation:invalid_input",
2260
+ "auth:forbidden",
1911
2261
  "resource:not_found",
1912
- "resource:conflict",
1913
2262
  "server:internal_error"
1914
2263
  ]
1915
2264
  },
@@ -2997,8 +3346,8 @@ const NEWSLETTER_ENDPOINT_DEFINITIONS = defineEndpointDefinitions({
2997
3346
  tags: [TAG_TEMPLATES.site, TAG_TEMPLATES.siteNewsletter],
2998
3347
  errors: []
2999
3348
  },
3000
- renderNewsletterCampaignDraft: {
3001
- path: "/sites/{siteId}/newsletter/campaigns/{campaignId}/render-draft",
3349
+ resolveNewsletterCampaignDraft: {
3350
+ path: "/sites/{siteId}/newsletter/campaigns/{campaignId}/resolve-draft",
3002
3351
  method: "POST",
3003
3352
  auth: "user",
3004
3353
  responseKind: "json",
@@ -3215,6 +3564,54 @@ const SDK_APPOINTMENT_SERVICE_ENDPOINT_DEFINITIONS = defineEndpointDefinitions({
3215
3564
  }
3216
3565
  });
3217
3566
 
3567
+ //#endregion
3568
+ //#region ../api/src/sdkPageSectionEndpointDefinitions.ts
3569
+ const SDK_PAGE_SECTION_ENDPOINT_DEFINITIONS = defineEndpointDefinitions({
3570
+ sdkListPageSections: {
3571
+ path: "/sdk/{siteId}/page-sections",
3572
+ method: "GET",
3573
+ auth: "service",
3574
+ responseKind: "json",
3575
+ errors: ["server:internal_error"]
3576
+ },
3577
+ sdkPreparePageSectionChange: {
3578
+ path: "/sdk/{siteId}/page-sections/prepare",
3579
+ method: "POST",
3580
+ auth: "service",
3581
+ responseKind: "json",
3582
+ errors: [
3583
+ "validation:invalid_input",
3584
+ "resource:not_found",
3585
+ "resource:conflict",
3586
+ "server:internal_error"
3587
+ ]
3588
+ },
3589
+ sdkApplyPageSectionChange: {
3590
+ path: "/sdk/{siteId}/page-sections/apply",
3591
+ method: "POST",
3592
+ auth: "service",
3593
+ responseKind: "json",
3594
+ errors: [
3595
+ "validation:invalid_input",
3596
+ "resource:not_found",
3597
+ "resource:conflict",
3598
+ "server:internal_error"
3599
+ ]
3600
+ },
3601
+ changePageSections: {
3602
+ path: "/sites/{siteId}/page-sections/changes",
3603
+ method: "POST",
3604
+ auth: "user",
3605
+ responseKind: "json",
3606
+ demoMutation: allowedDemoMutationPolicy(),
3607
+ errors: [
3608
+ "validation:invalid_input",
3609
+ "auth:forbidden",
3610
+ "server:internal_error"
3611
+ ]
3612
+ }
3613
+ });
3614
+
3218
3615
  //#endregion
3219
3616
  //#region ../api/src/sdkPageDesignEndpointDefinitions.ts
3220
3617
  /**
@@ -4698,21 +5095,6 @@ function mapLineSettlementError(error) {
4698
5095
  }
4699
5096
  }
4700
5097
 
4701
- //#endregion
4702
- //#region ../commerce/src/purchase/checkoutStripeFinalizationPlanning.ts
4703
- function planCheckoutStripeSessionRecordUpdates(options) {
4704
- const record = (target) => ({
4705
- target,
4706
- orderId: options.orderId,
4707
- sessionId: options.sessionId
4708
- });
4709
- switch (options.paymentPlanKind) {
4710
- case "stripe": return [];
4711
- case "instalment_plan": return [record("order_payment_plan")];
4712
- case "flexible_balance": return [record("flexible_balance_contract")];
4713
- }
4714
- }
4715
-
4716
5098
  //#endregion
4717
5099
  //#region ../commerce/src/purchase/checkoutStripeSessionPlanning.ts
4718
5100
  function planCheckoutStripeSessionRequest(options) {
@@ -4901,6 +5283,13 @@ function planFirstPaymentLineItem(options) {
4901
5283
  quantity: 1
4902
5284
  }]);
4903
5285
  }
5286
+ /** Client-set prices always include VAT, independently of connected-account defaults. */
5287
+ function inclusivePriceData(price) {
5288
+ return {
5289
+ ...price,
5290
+ tax_behavior: "inclusive"
5291
+ };
5292
+ }
4904
5293
 
4905
5294
  //#endregion
4906
5295
  //#region ../commerce/src/purchase/checkoutSessionMetadata.ts
@@ -4980,18 +5369,13 @@ function failedDecision(options) {
4980
5369
  remainingRefundableCents: options.input.remainingRefundableCents
4981
5370
  };
4982
5371
  }
5372
+ /** Check order matters: identity, saved result, pending/held capacity, then amount. */
4983
5373
  function planCanonicalRefundRequest(input) {
4984
5374
  const requestedAmountCents = requestedAmountForPlan(input);
5375
+ return idempotencyConflict(input) ?? (input.existingByIdempotency ? existingRefundOutcome(input, input.existingByIdempotency) : null) ?? pendingRefundOutcome(input) ?? heldRefundConflict(input, requestedAmountCents) ?? refundAmountOutcome(input, requestedAmountCents);
5376
+ }
5377
+ function idempotencyConflict(input) {
4985
5378
  const existingByIdempotency = input.existingByIdempotency;
4986
- if (requestedAmountCents <= 0) {
4987
- return failedDecision({
4988
- input,
4989
- errorCode: "already_refunded",
4990
- errorMessage: "No refundable amount remaining for this purchase.",
4991
- refund: existingByIdempotency,
4992
- amountCents: requestedAmountCents
4993
- });
4994
- }
4995
5379
  if (existingByIdempotency && input.requestedAmountCents != null && existingByIdempotency.amountCents !== input.requestedAmountCents) {
4996
5380
  return failedDecision({
4997
5381
  input,
@@ -5010,15 +5394,10 @@ function planCanonicalRefundRequest(input) {
5010
5394
  amountCents: existingByIdempotency.amountCents
5011
5395
  });
5012
5396
  }
5013
- if (input.requireFullRemainingRefund && requestedAmountCents !== input.remainingRefundableCents) {
5014
- return failedDecision({
5015
- input,
5016
- errorCode: "pass_revoke_requires_full_refund",
5017
- errorMessage: "Pass revocation is only allowed when refunding the full remaining amount",
5018
- amountCents: requestedAmountCents
5019
- });
5020
- }
5021
- if (existingByIdempotency?.status === "succeeded") {
5397
+ return null;
5398
+ }
5399
+ function existingRefundOutcome(input, existingByIdempotency) {
5400
+ if (existingByIdempotency.status === "succeeded") {
5022
5401
  return {
5023
5402
  kind: "existing_succeeded",
5024
5403
  refund: existingByIdempotency,
@@ -5026,30 +5405,15 @@ function planCanonicalRefundRequest(input) {
5026
5405
  remainingRefundableCents: input.remainingRefundableCents
5027
5406
  };
5028
5407
  }
5029
- if (existingByIdempotency?.status === "pending") {
5030
- if (!existingByIdempotency.isStale) {
5031
- return failedDecision({
5032
- input,
5033
- errorCode: "refund_in_progress",
5034
- errorMessage: "A refund is already being processed for this idempotency key",
5035
- refund: existingByIdempotency,
5036
- amountCents: existingByIdempotency.amountCents
5037
- });
5038
- }
5039
- return {
5040
- kind: "resume_pending",
5041
- refund: existingByIdempotency,
5042
- requestedAmountCents: existingByIdempotency.amountCents
5043
- };
5044
- }
5045
- if (existingByIdempotency?.status === "reconciliation_needed") {
5408
+ if (existingByIdempotency.status === "pending") return pendingIdempotentRefundOutcome(input, existingByIdempotency);
5409
+ if (existingByIdempotency.status === "reconciliation_needed") {
5046
5410
  return {
5047
5411
  kind: "resume_pending",
5048
5412
  refund: existingByIdempotency,
5049
5413
  requestedAmountCents: existingByIdempotency.amountCents
5050
5414
  };
5051
5415
  }
5052
- if (existingByIdempotency?.status === "failed") {
5416
+ if (existingByIdempotency.status === "failed") {
5053
5417
  return failedDecision({
5054
5418
  input,
5055
5419
  errorCode: "refund_failed",
@@ -5058,6 +5422,23 @@ function planCanonicalRefundRequest(input) {
5058
5422
  amountCents: existingByIdempotency.amountCents
5059
5423
  });
5060
5424
  }
5425
+ return null;
5426
+ }
5427
+ function pendingIdempotentRefundOutcome(input, refund) {
5428
+ if (!refund.isStale) return failedDecision({
5429
+ input,
5430
+ errorCode: "refund_in_progress",
5431
+ errorMessage: "A refund is already being processed for this idempotency key",
5432
+ refund,
5433
+ amountCents: refund.amountCents
5434
+ });
5435
+ return {
5436
+ kind: "resume_pending",
5437
+ refund,
5438
+ requestedAmountCents: refund.amountCents
5439
+ };
5440
+ }
5441
+ function pendingRefundOutcome(input) {
5061
5442
  if (input.latestPending) {
5062
5443
  if (!input.latestPending.isStale) {
5063
5444
  return failedDecision({
@@ -5074,6 +5455,37 @@ function planCanonicalRefundRequest(input) {
5074
5455
  requestedAmountCents: input.latestPending.amountCents
5075
5456
  };
5076
5457
  }
5458
+ return null;
5459
+ }
5460
+ function heldRefundConflict(input, requestedAmountCents) {
5461
+ if (input.heldCents > 0 && (input.requestedAmountCents === undefined || requestedAmountCents > input.remainingRefundableCents || input.requireFullRemainingRefund)) {
5462
+ return failedDecision({
5463
+ input,
5464
+ errorCode: "refund_in_progress",
5465
+ errorMessage: "A refund is already being processed for this purchase",
5466
+ amountCents: requestedAmountCents
5467
+ });
5468
+ }
5469
+ return null;
5470
+ }
5471
+ function refundAmountOutcome(input, requestedAmountCents) {
5472
+ if (requestedAmountCents <= 0) {
5473
+ return failedDecision({
5474
+ input,
5475
+ errorCode: "already_refunded",
5476
+ errorMessage: "No refundable amount remaining for this purchase.",
5477
+ refund: input.existingByIdempotency,
5478
+ amountCents: requestedAmountCents
5479
+ });
5480
+ }
5481
+ if (input.requireFullRemainingRefund && requestedAmountCents !== input.remainingRefundableCents) {
5482
+ return failedDecision({
5483
+ input,
5484
+ errorCode: "pass_revoke_requires_full_refund",
5485
+ errorMessage: "Pass revocation is only allowed when refunding the full remaining amount",
5486
+ amountCents: requestedAmountCents
5487
+ });
5488
+ }
5077
5489
  if (requestedAmountCents > input.remainingRefundableCents) {
5078
5490
  return failedDecision({
5079
5491
  input,
@@ -6285,6 +6697,7 @@ function planItem(item, input) {
6285
6697
  warnings: [],
6286
6698
  actions: [{
6287
6699
  kind: "send_appointment_confirmation",
6700
+ orderId: item.orderId,
6288
6701
  appointmentId: item.appointmentId
6289
6702
  }]
6290
6703
  } : {
@@ -7309,13 +7722,6 @@ function planUnappliedOrderPaymentReceiptAllocations(input) {
7309
7722
  return attributedCents === input.amountCents ? ok(allocations) : err({ kind: "allocation_invariant_failed" });
7310
7723
  }
7311
7724
 
7312
- //#endregion
7313
- //#region ../commerce/src/purchase/pendingCheckoutSessionClaim.ts
7314
- const PENDING_CHECKOUT_SESSION_PREFIX = "pending_checkout:";
7315
- function isPendingOrderCheckoutSessionClaim(stripeCheckoutSessionId) {
7316
- return typeof stripeCheckoutSessionId === "string" && stripeCheckoutSessionId.startsWith(PENDING_CHECKOUT_SESSION_PREFIX);
7317
- }
7318
-
7319
7725
  //#endregion
7320
7726
  //#region ../commerce/src/purchase/orderPaymentLinkPlanning.ts
7321
7727
  function buildOrderPaymentAdminProjection(facts) {
@@ -7385,7 +7791,7 @@ function resolvePaymentLinkAvailabilityFromFacts(input) {
7385
7791
  if (!input.stripeConnected) {
7386
7792
  return unavailable("stripe_not_connected", "Online payment is not available for this site.", 409);
7387
7793
  }
7388
- if (isPendingOrderCheckoutSessionClaim(input.stripeCheckoutSessionId)) {
7794
+ if (input.hasLiveCheckoutAttempt) {
7389
7795
  return unavailable("checkout_in_progress", "An online payment checkout is already in progress for this order.", 409);
7390
7796
  }
7391
7797
  return { kind: "available" };
@@ -7789,6 +8195,18 @@ function summarizePriorRefundsByRail(refunds, orderItemIds) {
7789
8195
  creditCents: unsafeAsNonNegativeCents(totalForRail("credit"))
7790
8196
  });
7791
8197
  }
8198
+ /** Select policy funding once, retaining the recorded source even for site-credit returns. */
8199
+ function planBookingRefundFunding(input) {
8200
+ const funding = input.allowProtectedDepositOverride ? input.funding : input.policyFunding ?? input.funding;
8201
+ const sourceAllocation = planRefundDestinationAllocation(funding, input.amountCents, "original_payment");
8202
+ return {
8203
+ allocation: sourceAllocation.map((line) => ({
8204
+ ...line,
8205
+ destination: input.method === "site_credit" ? "credit" : line.destination
8206
+ })),
8207
+ recordedAmountCents: sourceAllocation.filter((line) => line.destination === "direct").reduce((sum, line) => sum + line.amountCents, 0)
8208
+ };
8209
+ }
7792
8210
  /** One receipt allocation owns rounding for both the confirmation and execution. */
7793
8211
  function planRefundDestinationAllocation(funding, amountCents, method) {
7794
8212
  const eligible = funding.filter((line) => line.remainingCents > 0);
@@ -8561,14 +8979,6 @@ const PUBLIC_BOOKING_AVAILABILITY_ENDPOINT_DEFINITIONS = defineEndpointDefinitio
8561
8979
  auth: "public",
8562
8980
  responseKind: "json"
8563
8981
  },
8564
- getPublicBookingServiceBySlug: {
8565
- path: "/public/bookings/services/by-slug/{slug}",
8566
- method: "GET",
8567
- revalidate: publicReadFreshnessSeconds("getPublicBookingService"),
8568
- tags: [TAG_TEMPLATES.publicBookingServices],
8569
- auth: "public",
8570
- responseKind: "json"
8571
- },
8572
8982
  getPublicBookingResourcesReference: {
8573
8983
  path: "/public/bookings/resources/reference",
8574
8984
  method: "GET",
@@ -8850,6 +9260,18 @@ const EVENT_MANAGEMENT_ENDPOINT_DEFINITIONS = defineEndpointDefinitions({
8850
9260
  "server:internal_error"
8851
9261
  ]
8852
9262
  },
9263
+ previewWholeSeriesRunCancellation: {
9264
+ path: "/sites/{siteId}/bookings/events/{eventId}/runs/{runId}/cancellation",
9265
+ method: "GET",
9266
+ tags: ["site-{siteId}", "event-series-{siteId}"],
9267
+ auth: "user",
9268
+ responseKind: "json",
9269
+ errors: [
9270
+ "auth:forbidden",
9271
+ "resource:not_found",
9272
+ "server:internal_error"
9273
+ ]
9274
+ },
8853
9275
  cancelWholeSeriesRun: {
8854
9276
  path: "/sites/{siteId}/bookings/events/{eventId}/runs/{runId}/cancellation",
8855
9277
  method: "POST",
@@ -9164,7 +9586,7 @@ const PUBLIC_READ_ENDPOINT_DEFINITIONS = defineEndpointDefinitions({
9164
9586
  path: "/sites",
9165
9587
  method: "GET",
9166
9588
  errors: [],
9167
- revalidate: 900,
9589
+ revalidate: PUBLIC_CONTENT_FRESHNESS_SECONDS,
9168
9590
  tags: [
9169
9591
  TAG_TEMPLATES.siteById,
9170
9592
  TAG_TEMPLATES.siteBySlug,
@@ -9380,6 +9802,20 @@ const BILLING_ENDPOINT_DEFINITIONS = defineEndpointDefinitions({
9380
9802
  responseKind: "json",
9381
9803
  errors: []
9382
9804
  },
9805
+ previewPlanChange: {
9806
+ path: "/billing/plan/preview",
9807
+ method: "POST",
9808
+ tags: ["billing"],
9809
+ auth: "user",
9810
+ responseKind: "json",
9811
+ errors: [
9812
+ "validation:invalid_input",
9813
+ "auth:unauthenticated",
9814
+ "resource:conflict",
9815
+ "server:internal_error",
9816
+ "external:service_error"
9817
+ ]
9818
+ },
9383
9819
  changePlan: {
9384
9820
  path: "/billing/plan/change",
9385
9821
  method: "POST",
@@ -9939,6 +10375,7 @@ const clientErrorReportSchema = z.object({
9939
10375
  //#endregion
9940
10376
  //#region ../api/src/endpoints.ts
9941
10377
  const ENDPOINT_DEFINITIONS = {
10378
+ ...PAGE_SECTION_LOOK_ENDPOINT_DEFINITIONS,
9942
10379
  ...PAGE_JOURNAL_ENDPOINT_DEFINITIONS,
9943
10380
  ...PREVIEW_AUTH_ENDPOINT_DEFINITIONS,
9944
10381
  ...SITE_LIFECYCLE_ENDPOINT_DEFINITIONS,
@@ -10594,14 +11031,6 @@ const ENDPOINT_DEFINITIONS = {
10594
11031
  auth: "user",
10595
11032
  responseKind: "json"
10596
11033
  },
10597
- applyContentTemplateAddon: {
10598
- editLease: "unleased-editor",
10599
- path: "/sites/{siteId}/content/types/{type}/template/addons",
10600
- method: "POST",
10601
- tags: ["site-{siteId}", "content-template-{siteId}-{type}"],
10602
- auth: "user",
10603
- responseKind: "json"
10604
- },
10605
11034
  updateContentTemplateBlockBindings: {
10606
11035
  editLease: "unleased-editor",
10607
11036
  path: "/sites/{siteId}/content/types/{type}/template/blocks/{blockId}/bindings",
@@ -11366,6 +11795,20 @@ const ENDPOINT_DEFINITIONS = {
11366
11795
  auth: "user",
11367
11796
  responseKind: "json"
11368
11797
  },
11798
+ reconnectDomain: {
11799
+ path: "/domains/{domainId}/reconnect",
11800
+ method: "POST",
11801
+ errors: [
11802
+ "resource:not_found",
11803
+ "auth:forbidden",
11804
+ "resource:conflict",
11805
+ "billing:payment_required",
11806
+ "external:service_error"
11807
+ ],
11808
+ tags: ["domains", "domain-{domainId}"],
11809
+ auth: "user",
11810
+ responseKind: "json"
11811
+ },
11369
11812
  removeDomain: {
11370
11813
  path: "/domains/{domainId}",
11371
11814
  method: "DELETE",
@@ -12525,6 +12968,7 @@ const ENDPOINT_DEFINITIONS = {
12525
12968
  ]
12526
12969
  },
12527
12970
  getContentByPath: {
12971
+ revalidate: PUBLIC_CONTENT_FRESHNESS_SECONDS,
12528
12972
  path: "/sites/{siteId}/pages",
12529
12973
  method: "GET",
12530
12974
  tags: [TAG_TEMPLATES.siteRoutableContent],
@@ -12980,7 +13424,6 @@ const ENDPOINT_DEFINITIONS = {
12980
13424
  getGeneratedIconRenderAssets: {
12981
13425
  path: "/public/sites/{siteId}/generated-icon-assets",
12982
13426
  method: "POST",
12983
- tags: [TAG_TEMPLATES.siteRoutableContent],
12984
13427
  auth: "public",
12985
13428
  responseKind: "json",
12986
13429
  errors: []
@@ -13819,6 +14262,70 @@ const ENDPOINT_DEFINITIONS = {
13819
14262
  "server:internal_error"
13820
14263
  ]
13821
14264
  },
14265
+ endCustomerMembershipNow: {
14266
+ path: "/sites/{siteId}/bookings/customer-memberships/{customerMembershipId}/end",
14267
+ method: "POST",
14268
+ tags: [
14269
+ "site-{siteId}",
14270
+ "bookings",
14271
+ "customer-membership-{customerMembershipId}"
14272
+ ],
14273
+ auth: "user",
14274
+ responseKind: "json",
14275
+ errors: [
14276
+ "validation:invalid_input",
14277
+ "resource:not_found",
14278
+ "server:internal_error"
14279
+ ]
14280
+ },
14281
+ resumeCustomerMembership: {
14282
+ path: "/sites/{siteId}/bookings/customer-memberships/{customerMembershipId}/resume",
14283
+ method: "POST",
14284
+ tags: [
14285
+ "site-{siteId}",
14286
+ "bookings",
14287
+ "customer-membership-{customerMembershipId}"
14288
+ ],
14289
+ auth: "user",
14290
+ responseKind: "json",
14291
+ errors: [
14292
+ "validation:invalid_input",
14293
+ "resource:not_found",
14294
+ "server:internal_error"
14295
+ ]
14296
+ },
14297
+ finishCustomerMembershipChange: {
14298
+ path: "/sites/{siteId}/bookings/customer-memberships/{customerMembershipId}/finish",
14299
+ method: "POST",
14300
+ tags: [
14301
+ "site-{siteId}",
14302
+ "bookings",
14303
+ "customer-membership-{customerMembershipId}"
14304
+ ],
14305
+ auth: "user",
14306
+ responseKind: "json",
14307
+ errors: [
14308
+ "validation:invalid_input",
14309
+ "resource:not_found",
14310
+ "server:internal_error"
14311
+ ]
14312
+ },
14313
+ correctCustomerMembershipDates: {
14314
+ path: "/sites/{siteId}/bookings/customer-memberships/{customerMembershipId}",
14315
+ method: "PATCH",
14316
+ tags: [
14317
+ "site-{siteId}",
14318
+ "bookings",
14319
+ "customer-membership-{customerMembershipId}"
14320
+ ],
14321
+ auth: "user",
14322
+ responseKind: "json",
14323
+ errors: [
14324
+ "validation:invalid_input",
14325
+ "resource:not_found",
14326
+ "server:internal_error"
14327
+ ]
14328
+ },
13822
14329
  refundCustomerMembershipPayment: {
13823
14330
  path: "/sites/{siteId}/bookings/customer-memberships/{customerMembershipId}/refund",
13824
14331
  method: "POST",
@@ -14272,6 +14779,30 @@ const ENDPOINT_DEFINITIONS = {
14272
14779
  auth: "user",
14273
14780
  responseKind: "blob"
14274
14781
  },
14782
+ exportMoneyRefundsCsv: {
14783
+ path: "/sites/{siteId}/bookings/money/refunds/export.csv",
14784
+ method: "GET",
14785
+ tags: [
14786
+ "site-{siteId}",
14787
+ "bookings",
14788
+ "money-report-{siteId}"
14789
+ ],
14790
+ errors: [],
14791
+ auth: "user",
14792
+ responseKind: "blob"
14793
+ },
14794
+ exportMoneyHeldForCustomersCsv: {
14795
+ path: "/sites/{siteId}/bookings/money/held-for-customers/export.csv",
14796
+ method: "GET",
14797
+ tags: [
14798
+ "site-{siteId}",
14799
+ "bookings",
14800
+ "money-report-{siteId}"
14801
+ ],
14802
+ errors: [],
14803
+ auth: "user",
14804
+ responseKind: "blob"
14805
+ },
14275
14806
  listBookingActivity: {
14276
14807
  path: "/sites/{siteId}/bookings/activity",
14277
14808
  method: "GET",
@@ -14860,6 +15391,7 @@ const ENDPOINT_DEFINITIONS = {
14860
15391
  responseKind: "json"
14861
15392
  },
14862
15393
  ...SDK_APPOINTMENT_SERVICE_ENDPOINT_DEFINITIONS,
15394
+ ...SDK_PAGE_SECTION_ENDPOINT_DEFINITIONS,
14863
15395
  sdkUpsertEventCategory: {
14864
15396
  path: "/sdk/{siteId}/event-categories",
14865
15397
  method: "POST",
@@ -14992,6 +15524,13 @@ const ENDPOINT_DEFINITIONS = {
14992
15524
  auth: "public",
14993
15525
  responseKind: "json"
14994
15526
  },
15527
+ portalGetRegularSessions: {
15528
+ path: "/portal/appointments/regular-sessions",
15529
+ method: "GET",
15530
+ auth: "public",
15531
+ responseKind: "json",
15532
+ errors: ["server:internal_error"]
15533
+ },
14995
15534
  portalGetAppointments: {
14996
15535
  path: "/portal/appointments",
14997
15536
  method: "GET",
@@ -15206,6 +15745,13 @@ const ENDPOINT_DEFINITIONS = {
15206
15745
  auth: "public",
15207
15746
  responseKind: "json"
15208
15747
  },
15748
+ portalResumeMembership: {
15749
+ path: "/portal/memberships/{customerMembershipId}/resume",
15750
+ method: "POST",
15751
+ auth: "public",
15752
+ responseKind: "json",
15753
+ errors: []
15754
+ },
15209
15755
  portalSendMagicLink: {
15210
15756
  path: "/portal/auth/send-magic-link",
15211
15757
  method: "POST",
@@ -15389,10 +15935,74 @@ const operationIdSchema = z.uuid();
15389
15935
  function commandHeaders(endpoint, headers, operationId) {
15390
15936
  const result = new Headers(headers);
15391
15937
  const method = API_ENDPOINTS[endpoint].method;
15392
- if (method !== "GET" && !result.has(OPERATION_ID_HEADER)) result.set(OPERATION_ID_HEADER, operationId);
15938
+ const readPost = endpoint === "batchBlockLoaders" || endpoint === "getGeneratedIconRenderAssets";
15939
+ if (method !== "GET" && !readPost && !result.has(OPERATION_ID_HEADER)) result.set(OPERATION_ID_HEADER, operationId);
15393
15940
  return result;
15394
15941
  }
15395
15942
 
15943
+ //#endregion
15944
+ //#region ../api/src/common/billingPlanChange.ts
15945
+ const accessBlockedSchema = z.object({
15946
+ kind: z.literal("access_blocked"),
15947
+ sites: z.array(z.object({
15948
+ siteId: z.string().uuid(),
15949
+ siteName: z.string(),
15950
+ reasons: z.array(z.enum([
15951
+ "website_collaboration_exceeds_target",
15952
+ "operational_access_not_supported",
15953
+ "multiple_active_staff"
15954
+ ]))
15955
+ }))
15956
+ });
15957
+ /** Why a plan change was refused: team access to remove first, or a preview too old to charge from. */
15958
+ const billingPlanChangeFailureSchema = z.discriminatedUnion("kind", [accessBlockedSchema, z.object({ kind: z.literal("preview_expired") })]);
15959
+ /**
15960
+ * The figures a plan change was confirmed from: the preview's proration date
15961
+ * and the monthly price it showed. The server refuses the change as
15962
+ * `preview_expired` when the date is too old or the price it works out now is
15963
+ * different, so an owner is never charged from figures they didn't see.
15964
+ */
15965
+ const planChangeQuoteSchema = z.object({
15966
+ prorationDate: z.number().int().positive(),
15967
+ monthlyPricePence: z.number().int().nonnegative()
15968
+ });
15969
+
15970
+ //#endregion
15971
+ //#region ../api/src/common/billingReturn.ts
15972
+ /**
15973
+ * Where an owner came from when a dashboard prompt sent them to Billing, so the
15974
+ * page can lead with the plan they came for and, after checkout, offer the way
15975
+ * back. It's a closed set rather than a URL, so a link can't be turned into an
15976
+ * open redirect. Launch keeps its own checkout continuation; this is only the
15977
+ * "Back to…" convenience.
15978
+ */
15979
+ const BILLING_RETURN_PAGES = [
15980
+ "site_team",
15981
+ "site_domains",
15982
+ "site_media",
15983
+ "site_home",
15984
+ "launch"
15985
+ ];
15986
+ const billingReturnSchema = z.object({
15987
+ page: z.enum(BILLING_RETURN_PAGES),
15988
+ siteId: z.string().uuid()
15989
+ });
15990
+ /** `site_team:<site uuid>`, the form a `from` query parameter carries. */
15991
+ function serializeBillingReturn(value) {
15992
+ return `${value.page}:${value.siteId}`;
15993
+ }
15994
+ /** Anything that isn't exactly one known page and a uuid is ignored. */
15995
+ function parseBillingReturn(raw) {
15996
+ if (!raw) return null;
15997
+ const separator = raw.indexOf(":");
15998
+ if (separator < 0) return null;
15999
+ const parsed = billingReturnSchema.safeParse({
16000
+ page: raw.slice(0, separator),
16001
+ siteId: raw.slice(separator + 1)
16002
+ });
16003
+ return parsed.success ? parsed.data : null;
16004
+ }
16005
+
15396
16006
  //#endregion
15397
16007
  //#region ../api/src/bookingVerticals.ts
15398
16008
  /**
@@ -15780,6 +16390,15 @@ const pageDesignBoundaryTreatmentSchema = z.discriminatedUnion("kind", [
15780
16390
  ]),
15781
16391
  echo: z.literal(true).optional()
15782
16392
  }).strict(),
16393
+ z.object({
16394
+ kind: z.literal("arc-edge"),
16395
+ height: z.enum([
16396
+ "compact",
16397
+ "medium",
16398
+ "large"
16399
+ ]),
16400
+ echo: z.literal(true).optional()
16401
+ }).strict(),
15783
16402
  z.object({
15784
16403
  kind: z.literal("angle-edge"),
15785
16404
  height: z.enum([
@@ -16026,6 +16645,13 @@ const mediaUsageLocationSchema = z.discriminatedUnion("kind", [
16026
16645
  surfaceSlotId: identifierSchema,
16027
16646
  slotKey: identifierSchema
16028
16647
  }),
16648
+ z.object({
16649
+ kind: z.literal("pageSurfaceContent"),
16650
+ siteId: identifierSchema,
16651
+ pageSurfaceId: identifierSchema,
16652
+ pageTitle: z.string().nullable(),
16653
+ stage: z.enum(["draft", "published"])
16654
+ }),
16029
16655
  z.object({
16030
16656
  kind: z.literal("contentEntry"),
16031
16657
  siteId: identifierSchema,
@@ -16177,7 +16803,7 @@ const sdkNavigationLinkInputSchema = navigationLinkInputSchema;
16177
16803
  */
16178
16804
  function losslessValidatedSchema(schema) {
16179
16805
  return z.unknown().superRefine((value, ctx) => {
16180
- const parsed = schema.safeParse(value);
16806
+ const parsed = z.safeParse(schema, value);
16181
16807
  if (parsed.success) return;
16182
16808
  for (const issue of parsed.error.issues) {
16183
16809
  ctx.addIssue({
@@ -16192,7 +16818,7 @@ function losslessValidatedSchema(schema) {
16192
16818
  const sdkThemeWireSchema = losslessValidatedSchema(themeSchema);
16193
16819
  /** Explicitly cross from the lossless wire model into Riverbank's canonical theme. */
16194
16820
  function normalizeSdkThemeWire(theme) {
16195
- return themeSchema.parse(theme);
16821
+ return z.parse(themeSchema, theme);
16196
16822
  }
16197
16823
 
16198
16824
  //#endregion
@@ -16451,7 +17077,7 @@ const sdkPullFormsResponseSchema = z.object({
16451
17077
  meta: sdkPullMetaSchema
16452
17078
  });
16453
17079
  const sdkPullThemeResponseSchema = z.object({
16454
- theme: sdkThemeWireSchema.nullable(),
17080
+ theme: z.nullable(sdkThemeWireSchema),
16455
17081
  themeId: sdkIdentifierSchema$1.nullable(),
16456
17082
  selectionId: sdkIdentifierSchema$1.nullable(),
16457
17083
  selectionVersion: z.number().int().nonnegative(),
@@ -16580,6 +17206,7 @@ const BOOKING_SETTINGS_SECTION_KEYS = {
16580
17206
  "eventDestinationPolicy"
16581
17207
  ],
16582
17208
  appointments: [
17209
+ "serviceDestinationPolicy",
16583
17210
  "appointmentReminderOverrides",
16584
17211
  "appointmentDefaultMinLeadMinutes",
16585
17212
  "appointmentDefaultMaxBookingNoticeMinutes",
@@ -16733,14 +17360,17 @@ const DEFAULT_EVENT_DESTINATION_POLICY = {
16733
17360
  function isEventDestinationMode(value) {
16734
17361
  return eventDestinationModeValues.some((mode) => mode === value);
16735
17362
  }
16736
- function resolveEventDestinationMode(input) {
17363
+ const DEFAULT_SERVICE_DESTINATION_POLICY = { defaultMode: "system-managed" };
17364
+ /** Full service pages are configurable only on a managed website. */
17365
+ function canConfigureServicePages(environment) {
17366
+ return environment.publicExperience !== "hosted_booking" && !environment.isSdkSite;
17367
+ }
17368
+ /** The single page-mode decision for events and services. */
17369
+ function resolveSubjectDestinationMode(input) {
17370
+ if (input.subject === "service") return canConfigureServicePages(input) ? (input.policy ?? DEFAULT_SERVICE_DESTINATION_POLICY).defaultMode : "system-managed";
16737
17371
  const policy = input.policy ?? DEFAULT_EVENT_DESTINATION_POLICY;
16738
- if (input.preset) {
16739
- const presetOverride = policy.presetOverrides[input.preset];
16740
- if (presetOverride) return presetOverride;
16741
- }
16742
- if (input.publicExperience === "hosted_booking") return "system-managed";
16743
- return policy.defaultMode;
17372
+ const override = input.preset ? policy.presetOverrides[input.preset] : undefined;
17373
+ return override ?? (input.publicExperience === "hosted_booking" ? "system-managed" : policy.defaultMode);
16744
17374
  }
16745
17375
  function macadamiaDefaultEventDestinationPolicy(selectedPresets) {
16746
17376
  const presetOverrides = {};
@@ -17051,6 +17681,7 @@ function completeBookingSettingsForSectionUpdate(settings) {
17051
17681
  defaultMode: "cms-managed",
17052
17682
  presetOverrides: {}
17053
17683
  },
17684
+ serviceDestinationPolicy: settings.serviceDestinationPolicy ?? DEFAULT_SERVICE_DESTINATION_POLICY,
17054
17685
  eventTypeBookingDefaults: settings.eventTypeBookingDefaults ?? {}
17055
17686
  };
17056
17687
  }
@@ -18087,7 +18718,7 @@ const uiSchema = z.object({
18087
18718
  allowDirectInput: z.boolean().optional(),
18088
18719
  pattern: z.string().optional(),
18089
18720
  placeholder: z.string().optional(),
18090
- visibleWhen: visibleWhenSchema.optional(),
18721
+ visibleWhen: z.optional(visibleWhenSchema),
18091
18722
  modalConfig: z.object({
18092
18723
  buttonLabel: z.string().optional(),
18093
18724
  description: z.string().optional(),
@@ -18698,13 +19329,13 @@ const nodeSchema = z.object({
18698
19329
  type: z.string().min(1, "Node type is required"),
18699
19330
  key: z.string().optional(),
18700
19331
  props: nodePropsSchema.optional(),
18701
- children: z.lazy(() => nodeSchema.array().default([])).optional(),
19332
+ children: z.lazy(() => z.array(nodeSchema).default([])).optional(),
18702
19333
  $bind: bindingSchema.optional(),
18703
19334
  $repeat: repeatSchema.optional(),
18704
19335
  $when: conditionSchema.optional(),
18705
19336
  $scopes: dataScopeSchema.array().optional()
18706
19337
  });
18707
- const nodeTreeSchema = nodeSchema.array().or(nodeSchema);
19338
+ const nodeTreeSchema = z.union([z.array(nodeSchema), nodeSchema]);
18708
19339
  const NodeSchema = nodeSchema;
18709
19340
  const NodeTreeSchema = nodeTreeSchema;
18710
19341
 
@@ -18959,14 +19590,14 @@ const sdkCustomBlockInputSchema = z.object({
18959
19590
  category: blockCategoryEnum,
18960
19591
  icon: z.string().optional(),
18961
19592
  tags: z.array(z.string()).optional(),
18962
- fields: fieldDefinitionInputSchema.array().min(1),
19593
+ fields: z.array(fieldDefinitionInputSchema).min(1),
18963
19594
  dataLoaders: sdkDataLoadersSchema,
18964
- layout: NodeSchema.optional(),
19595
+ layout: z.optional(NodeSchema),
18965
19596
  ...sdkBlockPresentationShape,
18966
19597
  ...blockSectionDeclarationShape
18967
19598
  }).superRefine(validateManifestLookField).superRefine(validateSdkBlockDeclaration);
18968
19599
  const sdkBlockFieldExtensionInputSchema = z.object({
18969
- fields: fieldDefinitionInputSchema.array().min(1),
19600
+ fields: z.array(fieldDefinitionInputSchema).min(1),
18970
19601
  ...blockSectionDeclarationShape
18971
19602
  }).superRefine(validateManifestLookField);
18972
19603
  const sdkBlockFieldExtensionsInputSchema = z.record(z.string().min(1), sdkBlockFieldExtensionInputSchema);
@@ -20051,13 +20682,13 @@ var InvocationEnvelope = class {
20051
20682
  errors: []
20052
20683
  };
20053
20684
  }
20054
- const errors = this.errors.length > 0 ? this.errors : [{ message: "Command failed." }];
20685
+ const errors$1 = this.errors.length > 0 ? this.errors : [{ message: "Command failed." }];
20055
20686
  return {
20056
20687
  ok: false,
20057
20688
  command,
20058
20689
  result: this.resultValue,
20059
20690
  warnings: this.warnings,
20060
- errors
20691
+ errors: errors$1
20061
20692
  };
20062
20693
  }
20063
20694
  /** Emit the single envelope. Idempotent: subsequent calls are no-ops. */
@@ -20468,8 +21099,8 @@ function formatError(error, ctx) {
20468
21099
  /**
20469
21100
  * Format validation errors for display
20470
21101
  */
20471
- function formatValidationErrors(errors) {
20472
- return errors.map((e) => ` - ${e.path}: ${e.message}`).join("\n");
21102
+ function formatValidationErrors(errors$1) {
21103
+ return errors$1.map((e) => ` - ${e.path}: ${e.message}`).join("\n");
20473
21104
  }
20474
21105
  function formatDiff(items) {
20475
21106
  const lines = [];
@@ -22357,79 +22988,109 @@ function createApiResponseTransport(getHeaders = () => ({}), baseUrl, { sdkVersi
22357
22988
  return fetchPromise;
22358
22989
  };
22359
22990
  }
22360
- function buildApiRequestPlan(input) {
22361
- const { endpoint, body, params, headers = {}, baseUrl } = input;
22362
- const options = input.options ?? {};
22363
- let url = buildEndpointURL(baseUrl, endpoint);
22991
+ const batchReadPolicyBodySchema = z.object({ requests: z.array(z.object({
22992
+ endpoint: z.string(),
22993
+ params: z.record(z.string(), z.unknown()).optional()
22994
+ })) });
22995
+ /** Unclassified items fall back to the short budget and site tags inside the policy. */
22996
+ function resolveBatchReadFetchPolicy(params, body) {
22997
+ if (params?.stage === "preview" || typeof params?.siteId !== "string") return null;
22998
+ const parsed = batchReadPolicyBodySchema.safeParse(body);
22999
+ if (!parsed.success) return null;
23000
+ return buildPublicReadFetchPolicy(params.siteId, parsed.data.requests);
23001
+ }
23002
+ function batchReadRequestOptions(params, body, options) {
23003
+ if (options.cache === "no-store") return options;
23004
+ const policy = resolveBatchReadFetchPolicy(params, body);
23005
+ if (!policy) return {
23006
+ ...options,
23007
+ cache: "no-store"
23008
+ };
23009
+ const next = options.next ?? {};
23010
+ const revalidate = typeof next.revalidate === "number" ? Math.min(next.revalidate, policy.revalidate) : policy.revalidate;
23011
+ return {
23012
+ ...options,
23013
+ next: {
23014
+ ...next,
23015
+ tags: normalizeRevalidateTags([...next.tags ?? [], ...policy.tags]),
23016
+ revalidate
23017
+ }
23018
+ };
23019
+ }
23020
+ /** Shared public request policy applies to every transport caller, including the SDK. */
23021
+ function publicReadRequestOptions(endpoint, params, body, options) {
23022
+ if (endpoint === "batchBlockLoaders") return batchReadRequestOptions(params, body, options);
23023
+ const preview = params?.preview === true || params?.preview === "true";
23024
+ return endpoint === "getContentByPath" && preview ? {
23025
+ ...options,
23026
+ cache: "no-store"
23027
+ } : options;
23028
+ }
23029
+ function assertResolvedEndpointPath(endpoint, url) {
23030
+ const tokens = [...url.match(/\{[^}]+\}/g) ?? [], ...url.match(/(^|\/):([A-Za-z][A-Za-z0-9_]*)\b/g) ?? []];
23031
+ const missing = [...new Set(tokens.map((token) => token.startsWith("{") ? token.slice(1, -1) : token.replace(/^\//, "").slice(1)))];
23032
+ if (missing.length) throw new Error(`Missing required path params for endpoint ${String(endpoint)}: ${missing.join(", ")}`);
23033
+ }
23034
+ /** Path/query decisions are shared by all request plans, without retaining mutable URL state. */
23035
+ function resolveRequestUrl(input) {
23036
+ const { endpoint, baseUrl, params, body, isGetOrHead } = input;
22364
23037
  const originalPath = API_ENDPOINTS[endpoint].path;
22365
- const unusedParams = {};
22366
- if (params) {
22367
- Object.entries(params).forEach(([key, value]) => {
22368
- const bracePlaceholder = `{${key}}`;
22369
- const colonPlaceholder = `:${key}`;
22370
- if (originalPath.includes(bracePlaceholder) || originalPath.includes(colonPlaceholder)) {
22371
- const stringValue = serializePathParam(endpoint, key, value);
22372
- url = url.replace(bracePlaceholder, stringValue);
22373
- url = url.replace(colonPlaceholder, stringValue);
22374
- } else {
22375
- unusedParams[key] = value;
22376
- }
22377
- });
22378
- }
22379
- const unresolvedPathParams = [...url.match(/\{[^}]+\}/g) ?? [], ...url.match(/(^|\/):([A-Za-z][A-Za-z0-9_]*)\b/g) ?? []];
22380
- if (unresolvedPathParams.length > 0) {
22381
- const missingParams = Array.from(new Set(unresolvedPathParams.map((token) => {
22382
- if (token.startsWith("{") && token.endsWith("}")) {
22383
- return token.slice(1, -1);
22384
- }
22385
- return token.replace(/^\//, "").slice(1);
22386
- })));
22387
- throw new Error(`Missing required path params for endpoint ${String(endpoint)}: ${missingParams.join(", ")}`);
23038
+ const isPathParam = (key) => originalPath.includes(`{${key}}`) || originalPath.includes(`:${key}`);
23039
+ const entries = Object.entries(params ?? {});
23040
+ const path$3 = entries.filter(([key]) => isPathParam(key)).reduce((url, [key, value]) => {
23041
+ const encoded = serializePathParam(endpoint, key, value);
23042
+ return url.replace(`{${key}}`, encoded).replace(`:${key}`, encoded);
23043
+ }, buildEndpointURL(baseUrl, endpoint));
23044
+ assertResolvedEndpointPath(endpoint, path$3);
23045
+ const query = new URLSearchParams();
23046
+ entries.filter(([key]) => !isPathParam(key)).forEach(([key, value]) => appendQueryParam(query, key, value));
23047
+ if (isGetOrHead && typeof body === "object" && body !== null && !isFormDataBody(body)) {
23048
+ Object.entries(body).forEach(([key, value]) => appendQueryParam(query, key, value));
22388
23049
  }
23050
+ const suffix = query.toString();
23051
+ return suffix ? `${path$3}${path$3.includes("?") ? "&" : "?"}${suffix}` : path$3;
23052
+ }
23053
+ /** Explicit no-store wins; a request may add read tags without declaring mutation effects. */
23054
+ function resolveRequestNextOptions(endpoint, params, options, isGetOrHead) {
23055
+ const config = API_ENDPOINTS[endpoint];
23056
+ const { revalidate: requested, ...next } = options.next ?? {};
23057
+ const defaultRevalidate = isGetOrHead && "revalidate" in config ? config.revalidate : undefined;
23058
+ const revalidate = options.cache === "no-store" ? undefined : requested ?? defaultRevalidate;
23059
+ return {
23060
+ ...next,
23061
+ ...revalidate === undefined ? {} : { revalidate },
23062
+ ..."tags" in config && Array.isArray(config.tags) ? { tags: buildCacheReadTags([...next.tags ?? [], ...config.tags], params) } : {}
23063
+ };
23064
+ }
23065
+ function buildApiRequestPlan(input) {
23066
+ const { endpoint, body, params, headers = {}, baseUrl } = input;
23067
+ const options = publicReadRequestOptions(endpoint, params, body, input.options ?? {});
22389
23068
  const endpointConfig = API_ENDPOINTS[endpoint];
22390
23069
  const method = endpointConfig.method;
22391
23070
  const isGetOrHead = method === "GET" || method === "HEAD";
22392
- const queryParams = new URLSearchParams();
22393
- Object.entries(unusedParams).forEach(([key, value]) => {
22394
- appendQueryParam(queryParams, key, value);
22395
- });
22396
- if (isGetOrHead && typeof body === "object" && body !== null && !isFormDataBody(body)) {
22397
- Object.entries(body).forEach(([key, value]) => {
22398
- appendQueryParam(queryParams, key, value);
22399
- });
22400
- }
22401
- const queryString = queryParams.toString();
22402
- if (queryString) {
22403
- url += (url.includes("?") ? "&" : "?") + queryString;
22404
- }
22405
23071
  const formDataBody = isFormDataBody(body) ? body : undefined;
22406
- const optionsNext = options?.next;
22407
- const nextOptions = { ...optionsNext ?? {} };
22408
- const cacheIsNoStore = options?.cache === "no-store";
22409
- if (cacheIsNoStore) {
22410
- delete nextOptions.revalidate;
22411
- } else if (isGetOrHead && nextOptions.revalidate === undefined && "revalidate" in endpointConfig && typeof endpointConfig.revalidate === "number") {
22412
- nextOptions.revalidate = endpointConfig.revalidate;
22413
- }
22414
- if ("tags" in endpointConfig && Array.isArray(endpointConfig.tags)) {
22415
- nextOptions.tags = buildCacheReadTags([...nextOptions.tags ?? [], ...endpointConfig.tags], params);
22416
- }
22417
- const init = {
22418
- method,
22419
- ...options,
22420
- credentials: "same-origin",
22421
- body: isGetOrHead || body == null ? undefined : formDataBody ?? JSON.stringify(body),
22422
- headers: buildRequestHeaders({
22423
- optionsHeaders: options.headers,
22424
- authHeaders: headers,
22425
- sdkVersion: input.sdkVersion,
22426
- includeJsonContentType: !isGetOrHead && !formDataBody
22427
- }),
22428
- ...Object.keys(nextOptions).length > 0 ? { next: nextOptions } : {}
22429
- };
23072
+ const next = resolveRequestNextOptions(endpoint, params, options, isGetOrHead);
22430
23073
  return {
22431
- url,
22432
- init,
23074
+ url: resolveRequestUrl({
23075
+ endpoint,
23076
+ baseUrl,
23077
+ params,
23078
+ body,
23079
+ isGetOrHead
23080
+ }),
23081
+ init: {
23082
+ method,
23083
+ ...options,
23084
+ credentials: "same-origin",
23085
+ next,
23086
+ body: isGetOrHead || body == null ? undefined : formDataBody ?? JSON.stringify(body),
23087
+ headers: buildRequestHeaders({
23088
+ optionsHeaders: options.headers,
23089
+ authHeaders: headers,
23090
+ sdkVersion: input.sdkVersion,
23091
+ includeJsonContentType: !isGetOrHead && !formDataBody
23092
+ })
23093
+ },
22433
23094
  ...!isGetOrHead && "tags" in endpointConfig && Array.isArray(endpointConfig.tags) ? { cacheInvalidationTags: endpointConfig.tags.map((tag) => tag) } : {}
22434
23095
  };
22435
23096
  }
@@ -22495,14 +23156,6 @@ function isAppointmentServiceLocationType(value) {
22495
23156
  return value === "virtual" || value === "in_person" || value === "hybrid";
22496
23157
  }
22497
23158
 
22498
- //#endregion
22499
- //#region ../api/src/bookingOperations.ts
22500
- const APPOINTMENT_RESERVATION_STATUS_VALUES = [
22501
- "active",
22502
- "paused",
22503
- "ended"
22504
- ];
22505
-
22506
23159
  //#endregion
22507
23160
  //#region ../api/src/wholeSeriesRuns.ts
22508
23161
  const DELETE_EVENT_OFFERING_CONFLICT_REASONS = [
@@ -22569,6 +23222,7 @@ const BOOKING_ACTIVITY_TYPE_VALUES = [
22569
23222
  "membership_started",
22570
23223
  "membership_paused",
22571
23224
  "membership_cancelled",
23225
+ "appointment_refund",
22572
23226
  "event_refund",
22573
23227
  "pass_refund",
22574
23228
  "membership_refund",
@@ -22624,6 +23278,13 @@ const BOOKING_QUESTION_ANSWER_EXPORT_SCOPE_VALUES = [
22624
23278
  BOOKING_QUESTION_ANSWER_EXPORT_SCOPES.appointments,
22625
23279
  BOOKING_QUESTION_ANSWER_EXPORT_SCOPES.eventSeries
22626
23280
  ];
23281
+ /** Periods shared by appointment list, export and dashboard URL contracts. */
23282
+ const APPOINTMENT_LIST_PERIODS = [
23283
+ "upcoming",
23284
+ "past",
23285
+ "all",
23286
+ "no_shows"
23287
+ ];
22627
23288
 
22628
23289
  //#endregion
22629
23290
  //#region ../api/src/bookingPeople.ts
@@ -23020,7 +23681,7 @@ function pushConfigFailure(error, timeoutMs, requestInfo) {
23020
23681
  return managementTransportError(error, timeoutMs, requestInfo);
23021
23682
  }
23022
23683
  function validatePushConfig(rawConfig) {
23023
- const parsed = riverbankSiteConfigSchema.safeParse(rawConfig);
23684
+ const parsed = z.safeParse(riverbankSiteConfigSchema, rawConfig);
23024
23685
  if (!parsed.success) {
23025
23686
  const issues = parsed.error.issues.map((issue) => `${issue.path.join(".")}: ${issue.message}`).join("; ");
23026
23687
  throw new Error(`Invalid config: ${issues}`);
@@ -23050,12 +23711,12 @@ function analyzePushConfigResponse(response, dryRun) {
23050
23711
  sync: null,
23051
23712
  warnings: []
23052
23713
  };
23053
- const errors = collectPushConfigSyncErrors(sync);
23054
- if (errors.length > 0 || sync.success === false) return {
23714
+ const errors$1 = collectPushConfigSyncErrors(sync);
23715
+ if (errors$1.length > 0 || sync.success === false) return {
23055
23716
  success: false,
23056
23717
  kind: "sync-errors",
23057
23718
  sync,
23058
- errors
23719
+ errors: errors$1
23059
23720
  };
23060
23721
  return {
23061
23722
  success: true,
@@ -24079,7 +24740,7 @@ function getDefaultStaffCapabilities(surfaces) {
24079
24740
  return ["appointments"];
24080
24741
  }
24081
24742
  const managedDomainAddOnPricingSnapshotSchema = z.object({
24082
- formulaVersion: z.literal("managed-domain-overage-v1"),
24743
+ formulaVersion: z.literal("managed-domain-overage-v2"),
24083
24744
  conversionRule: z.literal("usd-to-gbp-1-to-1-v1"),
24084
24745
  registrarAnnualCost: z.number().nonnegative(),
24085
24746
  registrarCurrency: z.literal("USD"),
@@ -24645,8 +25306,25 @@ const websiteSurfaceIds = [
24645
25306
  "site.performance"
24646
25307
  ];
24647
25308
  const websiteSurfaceIdSet = new Set(websiteSurfaceIds);
24648
- /** Home, and a booking page's Appearance, stay ahead of the Website group. */
24649
- const leadingSurfaceIdSet = new Set(["site.overview", "site.appearance"]);
25309
+ /**
25310
+ * A booking page has no website to manage, so it gets its own order: the
25311
+ * screens people use most days first, then the page itself. Its photos are
25312
+ * reached from Your page rather than the nav.
25313
+ */
25314
+ const bookingPageSurfaceOrder = [
25315
+ "site.overview",
25316
+ "site.bookings",
25317
+ "site.shop",
25318
+ "site.money",
25319
+ "site.appearance",
25320
+ "site.newsletter",
25321
+ "site.performance",
25322
+ "site.settings"
25323
+ ];
25324
+ const bookingPageLabels = {
25325
+ "site.overview": "Home",
25326
+ "site.appearance": "Your page"
25327
+ };
24650
25328
  function isFeatureEnabled$1(ctx, flag) {
24651
25329
  if (flag === "websiteEditingVisible") {
24652
25330
  return ctx.websiteEditingVisible !== false;
@@ -24657,41 +25335,57 @@ function isDemoSiteNavSurfaceVisible(mode, surfaceId) {
24657
25335
  return !isDemoDashboardUiRestricted(mode) || !hiddenDemoSiteNavIds.has(surfaceId);
24658
25336
  }
24659
25337
  function shouldGroupWebsiteLinks(input) {
24660
- return input.bookingsVisible === true && (input.websiteLinks.length >= 2 || input.websiteLinks.length >= 1 && input.otherLinks.length >= 1);
25338
+ return input.bookingsVisible && (input.websiteLinks.length >= 2 || input.websiteLinks.length >= 1 && input.otherLinks.length >= 1);
24661
25339
  }
24662
25340
  function buildDashboardSiteNavPlan(ctx) {
24663
25341
  const visibility = extractSdkDashboardNavVisibilityConfigForRole(ctx.sdkConfig, "siteNav", ctx.role);
24664
- const links = DASHBOARD_SITE_NAV_DESCRIPTORS.filter((entry) => isFeatureEnabled$1(ctx, entry.featureFlag)).filter((entry) => isDemoSiteNavSurfaceVisible(ctx.demoUiMode ?? "standard", entry.id)).filter((entry) => isNavItemVisible({
25342
+ const visible = DASHBOARD_SITE_NAV_DESCRIPTORS.filter((entry) => isFeatureEnabled$1(ctx, entry.featureFlag)).filter((entry) => isDemoSiteNavSurfaceVisible(ctx.demoUiMode ?? "standard", entry.id)).filter((entry) => isNavItemVisible({
24665
25343
  id: entry.id,
24666
25344
  role: ctx.role ?? null,
24667
25345
  stage: entry.stage,
24668
25346
  minRole: entry.minRole ?? null,
24669
25347
  config: visibility
24670
- })).map((entry) => ({
25348
+ }));
25349
+ return ctx.publicExperience === "hosted_booking" ? arrangeBookingPageNav(visible) : arrangeWebsiteNav(visible, ctx.bookingsVisible === true);
25350
+ }
25351
+ function arrangeBookingPageNav(visible) {
25352
+ return bookingPageSurfaceOrder.flatMap((id) => {
25353
+ const entry = visible.find((candidate) => candidate.id === id);
25354
+ return entry ? [{
25355
+ kind: "link",
25356
+ id,
25357
+ label: bookingPageLabels[id] ?? entry.label
25358
+ }] : [];
25359
+ });
25360
+ }
25361
+ /** Website tools sit in one group beside bookings, so neither crowds the other. */
25362
+ function arrangeWebsiteNav(visible, bookingsVisible) {
25363
+ const links = visible.map((entry) => ({
24671
25364
  kind: "link",
24672
25365
  id: entry.id,
24673
- label: entry.id === "site.overview" && ctx.publicExperience === "hosted_booking" ? "Home" : entry.label
25366
+ label: entry.label
24674
25367
  }));
24675
25368
  const websiteLinks = links.filter((link$1) => websiteSurfaceIdSet.has(link$1.id));
24676
25369
  const otherLinks = links.filter((link$1) => !websiteSurfaceIdSet.has(link$1.id));
24677
25370
  if (!shouldGroupWebsiteLinks({
24678
- bookingsVisible: ctx.bookingsVisible,
25371
+ bookingsVisible,
24679
25372
  websiteLinks,
24680
25373
  otherLinks
24681
25374
  })) {
24682
25375
  return links;
24683
25376
  }
24684
- const leading = links.filter((link$1) => leadingSurfaceIdSet.has(link$1.id));
24685
- const rest = otherLinks.filter((link$1) => !leadingSurfaceIdSet.has(link$1.id));
25377
+ const [overview, ...rest] = otherLinks;
25378
+ const leading = overview?.id === "site.overview" ? [overview] : [];
25379
+ const trailing = overview?.id === "site.overview" ? rest : otherLinks;
24686
25380
  return [
24687
25381
  ...leading,
24688
- ...websiteLinks.length > 0 ? [{
25382
+ {
24689
25383
  kind: "group",
24690
25384
  id: "site.website",
24691
25385
  label: "Website",
24692
25386
  items: websiteLinks
24693
- }] : [],
24694
- ...rest
25387
+ },
25388
+ ...trailing
24695
25389
  ];
24696
25390
  }
24697
25391
 
@@ -25211,10 +25905,9 @@ function buildDashboardSettingsNavPlan(ctx) {
25211
25905
  function buildDashboardTeamMemberNavPlan(ctx) {
25212
25906
  const ownResourceId = getOwnAppointmentResourceId(ctx.staffScope);
25213
25907
  return [
25214
- ...hasAppointmentStaffAccess(ctx.staffScope) ? buildAppointmentStaffNavPlan(ownResourceId) : [],
25215
- ...ownResourceId ? [{
25216
- id: "team.calendarSync",
25217
- label: "My Calendar Sync",
25908
+ ...hasAppointmentStaffAccess(ctx.staffScope) ? buildAppointmentStaffNavPlan(ownResourceId) : ownResourceId ? [{
25909
+ id: "team.availability",
25910
+ label: "My Hours and Calendars",
25218
25911
  destination: {
25219
25912
  kind: "appointment_resource_calendar",
25220
25913
  resourceId: ownResourceId
@@ -25245,7 +25938,7 @@ function buildAppointmentStaffNavPlan(resourceId) {
25245
25938
  destination: { kind: "appointments_calendar" }
25246
25939
  }, {
25247
25940
  id: "team.availability",
25248
- label: "My Availability",
25941
+ label: "My Hours and Calendars",
25249
25942
  destination: resourceId ? {
25250
25943
  kind: "appointment_resource_availability",
25251
25944
  resourceId
@@ -25715,6 +26408,7 @@ function buildDashboardBookingsNavPlan(modules, ctx, catalogue) {
25715
26408
  label: "Events",
25716
26409
  items: modules.events ? [
25717
26410
  ...buildEventNavItems(catalogue),
26411
+ ...buildPageSectionsNavItems(ctx),
25718
26412
  {
25719
26413
  label: "Venues",
25720
26414
  destination: { kind: "venues" },
@@ -25990,7 +26684,7 @@ function buildStaffAppointmentsNavGroup(ownResourceId) {
25990
26684
  }];
25991
26685
  if (ownResourceId) {
25992
26686
  appointmentItems.push({
25993
- label: "My Availability",
26687
+ label: "My Hours and Calendars",
25994
26688
  destination: {
25995
26689
  kind: "appointment_resource_availability",
25996
26690
  resourceId: ownResourceId
@@ -25999,15 +26693,7 @@ function buildStaffAppointmentsNavGroup(ownResourceId) {
25999
26693
  "availability",
26000
26694
  "schedule",
26001
26695
  "hours",
26002
- "time slots"
26003
- ]
26004
- }, {
26005
- label: "My Calendars",
26006
- destination: {
26007
- kind: "appointment_resource_calendar",
26008
- resourceId: ownResourceId
26009
- },
26010
- keywords: [
26696
+ "time slots",
26011
26697
  "calendar sync",
26012
26698
  "google calendar",
26013
26699
  "external calendar",
@@ -26066,6 +26752,23 @@ function buildEventNavItems(catalogue) {
26066
26752
  }] : []
26067
26753
  ];
26068
26754
  }
26755
+ /** Owners, admins and editors set up the sections every event page has. */
26756
+ function buildPageSectionsNavItems(ctx) {
26757
+ if (!ctx.pageSectionsAvailable || ctx.role === null) return [];
26758
+ if (SITE_ROLE_PERMISSION_LEVEL[ctx.role] < SITE_ROLE_PERMISSION_LEVEL.editor) return [];
26759
+ return [{
26760
+ label: "Page sections",
26761
+ destination: { kind: "events_page_sections" },
26762
+ keywords: [
26763
+ "page sections",
26764
+ "event page",
26765
+ "what to bring",
26766
+ "sections",
26767
+ "event template",
26768
+ "faq"
26769
+ ]
26770
+ }];
26771
+ }
26069
26772
  function buildEventSeriesPresetNavItem(entry) {
26070
26773
  return {
26071
26774
  label: entry.pluralLabel,
@@ -27678,24 +28381,24 @@ const collectLocalMediaReferences = (content) => {
27678
28381
  const mediaReferences = [];
27679
28382
  const richTextReferences = [];
27680
28383
  const warnings = [];
27681
- const errors = [];
28384
+ const errors$1 = [];
27682
28385
  const locationsByIdentifier = new Map();
27683
28386
  walkLocalContentMedia(content, (value, location) => {
27684
28387
  const rawIdentifier = typeof value.identifier === "string" ? value.identifier : "";
27685
28388
  const hasLegacyRef = Boolean(value.assetId || value.storagePath || value.src);
27686
28389
  if (!rawIdentifier) {
27687
28390
  if (hasLegacyRef) {
27688
- errors.push(`Media reference at ${location} is missing identifier.`);
28391
+ errors$1.push(`Media reference at ${location} is missing identifier.`);
27689
28392
  }
27690
28393
  return;
27691
28394
  }
27692
28395
  if (/[./\\]/.test(rawIdentifier)) {
27693
- errors.push(`Media identifier "${rawIdentifier}" at ${location} must not include an extension.`);
28396
+ errors$1.push(`Media identifier "${rawIdentifier}" at ${location} must not include an extension.`);
27694
28397
  return;
27695
28398
  }
27696
28399
  const normalized = normalizeMediaIdentifierInput(rawIdentifier);
27697
28400
  if (!normalized) {
27698
- errors.push(`Media identifier "${rawIdentifier}" at ${location} is invalid.`);
28401
+ errors$1.push(`Media identifier "${rawIdentifier}" at ${location} is invalid.`);
27699
28402
  return;
27700
28403
  }
27701
28404
  if (normalized !== rawIdentifier) {
@@ -27718,17 +28421,17 @@ const collectLocalMediaReferences = (content) => {
27718
28421
  const rawSrc = typeof attrs.src === "string" ? attrs.src : "";
27719
28422
  if (!rawIdentifier) {
27720
28423
  if (rawSrc) {
27721
- errors.push(`Rich text image at ${node.location} is missing identifier.`);
28424
+ errors$1.push(`Rich text image at ${node.location} is missing identifier.`);
27722
28425
  }
27723
28426
  continue;
27724
28427
  }
27725
28428
  if (/[./\\]/.test(rawIdentifier)) {
27726
- errors.push(`Rich text image identifier "${rawIdentifier}" at ${node.location} must not include an extension.`);
28429
+ errors$1.push(`Rich text image identifier "${rawIdentifier}" at ${node.location} must not include an extension.`);
27727
28430
  continue;
27728
28431
  }
27729
28432
  const normalized = normalizeMediaIdentifierInput(rawIdentifier);
27730
28433
  if (!normalized) {
27731
- errors.push(`Rich text image identifier "${rawIdentifier}" at ${node.location} is invalid.`);
28434
+ errors$1.push(`Rich text image identifier "${rawIdentifier}" at ${node.location} is invalid.`);
27732
28435
  continue;
27733
28436
  }
27734
28437
  if (normalized !== rawIdentifier) {
@@ -27750,7 +28453,7 @@ const collectLocalMediaReferences = (content) => {
27750
28453
  mediaReferences,
27751
28454
  richTextReferences,
27752
28455
  warnings,
27753
- errors,
28456
+ errors: errors$1,
27754
28457
  locationsByIdentifier
27755
28458
  };
27756
28459
  };
@@ -27759,8 +28462,8 @@ const buildLocationNote = (locationsByIdentifier, identifier) => {
27759
28462
  return locations?.length ? ` Referenced at: ${locations.join(", ")}.` : "";
27760
28463
  };
27761
28464
  const locationsForIdentifier = (locationsByIdentifier, identifier) => locationsByIdentifier.get(identifier) ?? [];
27762
- const operationPriority = (operation) => {
27763
- switch (operation.kind) {
28465
+ const operationPriority = (operation$1) => {
28466
+ switch (operation$1.kind) {
27764
28467
  case "upload": return 0;
27765
28468
  case "conflict":
27766
28469
  case "missing_local_file":
@@ -28293,7 +28996,7 @@ const chooseRichTextIdentifierBase = (location, src) => {
28293
28996
  //#region src/media/push-preparation-reads.ts
28294
28997
  const readMediaManifestAndLocalFiles = async (options) => {
28295
28998
  const manifest = options.manifest ?? await readMediaManifest(options.contentDir);
28296
- const errors = [];
28999
+ const errors$1 = [];
28297
29000
  const localFiles = new Map();
28298
29001
  for (const identifier of options.identifiers) {
28299
29002
  try {
@@ -28301,14 +29004,14 @@ const readMediaManifestAndLocalFiles = async (options) => {
28301
29004
  localFiles.set(identifier, localFile);
28302
29005
  } catch (error) {
28303
29006
  const message = error instanceof Error ? error.message : String(error);
28304
- errors.push(`Failed to load media file for "${identifier}": ${message}`);
29007
+ errors$1.push(`Failed to load media file for "${identifier}": ${message}`);
28305
29008
  localFiles.set(identifier, null);
28306
29009
  }
28307
29010
  }
28308
29011
  return {
28309
29012
  manifest,
28310
29013
  localFiles,
28311
- errors
29014
+ errors: errors$1
28312
29015
  };
28313
29016
  };
28314
29017
  const resolveMediaAssets = async (client, identifiers) => {
@@ -28442,7 +29145,7 @@ const normalizeRichTextIdentifiers = (options) => {
28442
29145
  const planRichTextImageImports = (options) => {
28443
29146
  const operations = [];
28444
29147
  const warnings = [];
28445
- const errors = options.imports.failures.map((failure) => `Failed to import rich text image @ ${failure.location}: ${failure.error}`);
29148
+ const errors$1 = options.imports.failures.map((failure) => `Failed to import rich text image @ ${failure.location}: ${failure.error}`);
28446
29149
  const preparedIdentifiers = new Set();
28447
29150
  const locationsByIdentifier = new Map();
28448
29151
  const checksumAssetsByChecksum = new Map();
@@ -28450,7 +29153,7 @@ const planRichTextImageImports = (options) => {
28450
29153
  content: options.content,
28451
29154
  existingIdentifiers: options.existingIdentifiers,
28452
29155
  warnings,
28453
- errors,
29156
+ errors: errors$1,
28454
29157
  locationsByIdentifier
28455
29158
  });
28456
29159
  for (const imported of options.imports.successful) {
@@ -28492,7 +29195,7 @@ const planRichTextImageImports = (options) => {
28492
29195
  }
28493
29196
  return {
28494
29197
  operations,
28495
- errors,
29198
+ errors: errors$1,
28496
29199
  warnings,
28497
29200
  preparedIdentifiers,
28498
29201
  locationsByIdentifier,
@@ -28599,9 +29302,9 @@ const assetsForPushMediaPlan = (options) => {
28599
29302
  observationsByAssetId.set(asset.id, asset);
28600
29303
  }
28601
29304
  }
28602
- for (const operation of options.operations) {
28603
- if (operation.kind === "unchanged" || operation.kind === "reused") {
28604
- addAsset(assetsByIdentifier, operation.identifier, operation.asset);
29305
+ for (const operation$1 of options.operations) {
29306
+ if (operation$1.kind === "unchanged" || operation$1.kind === "reused") {
29307
+ addAsset(assetsByIdentifier, operation$1.identifier, operation$1.asset);
28605
29308
  continue;
28606
29309
  }
28607
29310
  }
@@ -28643,7 +29346,7 @@ const appendClassification = (options) => {
28643
29346
  const selectPushReferences = (options) => {
28644
29347
  const collected = collectLocalMediaReferences(options.content);
28645
29348
  const warnings = [...options.richTextPlan.warnings, ...collected.warnings];
28646
- const errors = [...options.richTextPlan.errors, ...collected.errors];
29349
+ const errors$1 = [...options.richTextPlan.errors, ...collected.errors];
28647
29350
  const locationsByIdentifier = new Map();
28648
29351
  mergeRichTextLocations(locationsByIdentifier, options.richTextPlan.locationsByIdentifier);
28649
29352
  mergeRichTextLocations(locationsByIdentifier, collected.locationsByIdentifier);
@@ -28665,7 +29368,7 @@ const selectPushReferences = (options) => {
28665
29368
  identifiers,
28666
29369
  locationsByIdentifier,
28667
29370
  warnings,
28668
- errors,
29371
+ errors: errors$1,
28669
29372
  summary: emptyPushSummary(references.length, identifiers.length)
28670
29373
  };
28671
29374
  };
@@ -28675,7 +29378,7 @@ const prepareLocalReferenceOperations = async (options) => {
28675
29378
  identifiers: options.selection.identifiers,
28676
29379
  manifest: options.manifest
28677
29380
  });
28678
- const errors = [...loaded.errors];
29381
+ const errors$1 = [...loaded.errors];
28679
29382
  const warnings = [];
28680
29383
  const resolved = await resolveMediaAssets(options.prepare.client, options.selection.identifiers);
28681
29384
  const initialAssets = initialAssetMap(resolved.assetsByIdentifier);
@@ -28706,15 +29409,15 @@ const prepareLocalReferenceOperations = async (options) => {
28706
29409
  classification,
28707
29410
  manifest: options.manifest,
28708
29411
  operations,
28709
- errors,
29412
+ errors: errors$1,
28710
29413
  warnings
28711
29414
  });
28712
29415
  }
28713
29416
  const sortedOperations = sortOperations(operations);
28714
29417
  const localChecksums = localFileChecksums(options.selection.identifiers, loaded.localFiles);
28715
- for (const operation of sortedOperations) {
28716
- if ("file" in operation && operation.file) {
28717
- localChecksums.set(operation.identifier, operation.file.checksum);
29418
+ for (const operation$1 of sortedOperations) {
29419
+ if ("file" in operation$1 && operation$1.file) {
29420
+ localChecksums.set(operation$1.identifier, operation$1.file.checksum);
28718
29421
  }
28719
29422
  }
28720
29423
  const checksumAssetsByChecksum = new Map(options.richTextPlan.checksumAssetsByChecksum);
@@ -28723,7 +29426,7 @@ const prepareLocalReferenceOperations = async (options) => {
28723
29426
  }
28724
29427
  return {
28725
29428
  operations: sortedOperations,
28726
- errors,
29429
+ errors: errors$1,
28727
29430
  warnings,
28728
29431
  mediaReadSet: buildMediaReadSet({
28729
29432
  identifiers: options.selection.identifiers,
@@ -28894,10 +29597,10 @@ const makeReport = (params) => {
28894
29597
  missingIdentifiers
28895
29598
  };
28896
29599
  };
28897
- const reportForOperation = (operation, status, targetEnv, message, failureKind, rawError) => {
28898
- const file = "file" in operation ? operation.file : undefined;
29600
+ const reportForOperation = (operation$1, status, targetEnv, message, failureKind, rawError) => {
29601
+ const file = "file" in operation$1 ? operation$1.file : undefined;
28899
29602
  return {
28900
- identifier: operation.identifier,
29603
+ identifier: operation$1.identifier,
28901
29604
  status,
28902
29605
  targetEnv,
28903
29606
  ...file ? {
@@ -28905,40 +29608,40 @@ const reportForOperation = (operation, status, targetEnv, message, failureKind,
28905
29608
  sizeBytes: file.dataLength,
28906
29609
  mimeType: file.mimeType
28907
29610
  } : {},
28908
- locations: operation.locations,
29611
+ locations: operation$1.locations,
28909
29612
  message,
28910
29613
  failureKind,
28911
29614
  rawError
28912
29615
  };
28913
29616
  };
28914
- const applySimpleMediaOperation = (operation, state, targetEnv) => {
28915
- switch (operation.kind) {
29617
+ const applySimpleMediaOperation = (operation$1, state, targetEnv) => {
29618
+ switch (operation$1.kind) {
28916
29619
  case "unchanged":
28917
- state.assetsByIdentifier.set(operation.identifier, operation.asset);
29620
+ state.assetsByIdentifier.set(operation$1.identifier, operation$1.asset);
28918
29621
  state.summary.resolved += 1;
28919
- state.reportItems.push(reportForOperation(operation, "resolved", targetEnv));
29622
+ state.reportItems.push(reportForOperation(operation$1, "resolved", targetEnv));
28920
29623
  return;
28921
29624
  case "reused":
28922
- state.assetsByIdentifier.set(operation.identifier, operation.asset);
29625
+ state.assetsByIdentifier.set(operation$1.identifier, operation$1.asset);
28923
29626
  state.summary.resolved += 1;
28924
29627
  state.summary.reused += 1;
28925
- state.reportItems.push(reportForOperation(operation, "reused", targetEnv, "Reused existing CMS asset with matching identifier and checksum."));
29628
+ state.reportItems.push(reportForOperation(operation$1, "reused", targetEnv, "Reused existing CMS asset with matching identifier and checksum."));
28926
29629
  return;
28927
29630
  case "skipped":
28928
29631
  state.summary.skipped += 1;
28929
- state.reportItems.push(reportForOperation(operation, "skipped", targetEnv, operation.message));
29632
+ state.reportItems.push(reportForOperation(operation$1, "skipped", targetEnv, operation$1.message));
28930
29633
  return;
28931
29634
  case "missing_local_file":
28932
- state.reportItems.push(reportForOperation(operation, "missing_local_file", targetEnv, operation.message));
29635
+ state.reportItems.push(reportForOperation(operation$1, "missing_local_file", targetEnv, operation$1.message));
28933
29636
  return;
28934
29637
  case "conflict":
28935
- state.reportItems.push(reportForOperation(operation, "failed", targetEnv, operation.message, "unknown"));
29638
+ state.reportItems.push(reportForOperation(operation$1, "failed", targetEnv, operation$1.message, "unknown"));
28936
29639
  return;
28937
- default: return assertNever(operation);
29640
+ default: return assertNever(operation$1);
28938
29641
  }
28939
29642
  };
28940
- const applyUpload = async (operation, context, state) => {
28941
- const pendingItem = reportForOperation(operation, "pending_upload", context.targetEnv);
29643
+ const applyUpload = async (operation$1, context, state) => {
29644
+ const pendingItem = reportForOperation(operation$1, "pending_upload", context.targetEnv);
28942
29645
  if (context.dryRun) {
28943
29646
  state.summary.pendingUploads += 1;
28944
29647
  state.reportItems.push(pendingItem);
@@ -28950,15 +29653,15 @@ const applyUpload = async (operation, context, state) => {
28950
29653
  });
28951
29654
  try {
28952
29655
  const result = await context.client.media.upload({
28953
- data: Buffer.from(operation.file.dataBase64, "base64"),
28954
- filename: operation.file.filename,
28955
- contentType: operation.file.mimeType,
28956
- identifier: operation.identifier
29656
+ data: Buffer.from(operation$1.file.dataBase64, "base64"),
29657
+ filename: operation$1.file.filename,
29658
+ contentType: operation$1.file.mimeType,
29659
+ identifier: operation$1.identifier
28957
29660
  });
28958
- state.uploadedIdentifiers.push(operation.identifier);
29661
+ state.uploadedIdentifiers.push(operation$1.identifier);
28959
29662
  if (result.status === "created") state.summary.uploaded += 1;
28960
29663
  state.summary.resolved += 1;
28961
- const uploadedItem = reportForOperation(operation, "uploaded", context.targetEnv, result.status === "created" ? "Uploaded local media file." : "CMS reported media already exists.");
29664
+ const uploadedItem = reportForOperation(operation$1, "uploaded", context.targetEnv, result.status === "created" ? "Uploaded local media file." : "CMS reported media already exists.");
28962
29665
  state.reportItems.push(uploadedItem);
28963
29666
  context.onEvent?.({
28964
29667
  type: "upload_succeeded",
@@ -28966,28 +29669,28 @@ const applyUpload = async (operation, context, state) => {
28966
29669
  });
28967
29670
  } catch (error) {
28968
29671
  const message = rawErrorMessage$1(error);
28969
- const failedItem = reportForOperation(operation, "failed", context.targetEnv, `Failed to upload "${operation.identifier}": ${message}`, classifyLocalMediaUploadFailure(error), message);
29672
+ const failedItem = reportForOperation(operation$1, "failed", context.targetEnv, `Failed to upload "${operation$1.identifier}": ${message}`, classifyLocalMediaUploadFailure(error), message);
28970
29673
  state.reportItems.push(failedItem);
28971
- state.errors.push(`Failed to upload "${operation.identifier}" (${operation.file.filename}, ${operation.file.mimeType}): ${message}`);
29674
+ state.errors.push(`Failed to upload "${operation$1.identifier}" (${operation$1.file.filename}, ${operation$1.file.mimeType}): ${message}`);
28972
29675
  context.onEvent?.({
28973
29676
  type: "upload_failed",
28974
29677
  item: failedItem
28975
29678
  });
28976
29679
  }
28977
29680
  };
28978
- const applyMediaOperation = async (operation, context, state) => {
28979
- switch (operation.kind) {
29681
+ const applyMediaOperation = async (operation$1, context, state) => {
29682
+ switch (operation$1.kind) {
28980
29683
  case "unchanged":
28981
29684
  case "reused":
28982
29685
  case "skipped":
28983
29686
  case "missing_local_file":
28984
29687
  case "conflict":
28985
- applySimpleMediaOperation(operation, state, context.targetEnv);
29688
+ applySimpleMediaOperation(operation$1, state, context.targetEnv);
28986
29689
  return;
28987
29690
  case "upload":
28988
- await applyUpload(operation, context, state);
29691
+ await applyUpload(operation$1, context, state);
28989
29692
  return;
28990
- default: return assertNever(operation);
29693
+ default: return assertNever(operation$1);
28991
29694
  }
28992
29695
  };
28993
29696
  const createApplyState = (plan) => ({
@@ -28998,8 +29701,8 @@ const createApplyState = (plan) => ({
28998
29701
  uploadedIdentifiers: []
28999
29702
  });
29000
29703
  const applyMediaOperations = async (operations, context, state) => {
29001
- for (const operation of operations) {
29002
- await applyMediaOperation(operation, context, state);
29704
+ for (const operation$1 of operations) {
29705
+ await applyMediaOperation(operation$1, context, state);
29003
29706
  }
29004
29707
  };
29005
29708
  const resolveUploadedAssets = async (state, client, dryRun) => {
@@ -29016,9 +29719,9 @@ const resolveUploadedAssets = async (state, client, dryRun) => {
29016
29719
  };
29017
29720
  const fileByIdentifier = (operations) => {
29018
29721
  const files = new Map();
29019
- for (const operation of operations) {
29020
- if ("file" in operation && !files.has(operation.identifier)) {
29021
- files.set(operation.identifier, operation.file);
29722
+ for (const operation$1 of operations) {
29723
+ if ("file" in operation$1 && !files.has(operation$1.identifier)) {
29724
+ files.set(operation$1.identifier, operation$1.file);
29022
29725
  }
29023
29726
  }
29024
29727
  return files;
@@ -30951,12 +31654,12 @@ const CREATE_UPDATE_OPERATIONS = [{
30951
31654
  marker: "~"
30952
31655
  }];
30953
31656
  function appendOperationSections$1(lines, category, diffs, operations, formatItem, formatDetails) {
30954
- for (const operation of operations) {
30955
- const matchingDiffs = diffs.filter((diff) => diff.type === operation.type);
31657
+ for (const operation$1 of operations) {
31658
+ const matchingDiffs = diffs.filter((diff) => diff.type === operation$1.type);
30956
31659
  if (matchingDiffs.length === 0) continue;
30957
- lines.push(`\n${category} (${operation.label}):`);
31660
+ lines.push(`\n${category} (${operation$1.label}):`);
30958
31661
  for (const diff of matchingDiffs) {
30959
- lines.push(` ${operation.marker} ${formatItem(diff)}`);
31662
+ lines.push(` ${operation$1.marker} ${formatItem(diff)}`);
30960
31663
  if (formatDetails) lines.push(...formatDetails(diff));
30961
31664
  }
30962
31665
  }
@@ -31229,11 +31932,11 @@ const CREATE_UPDATE_DELETE_DETAIL_OPERATIONS = [...CREATE_UPDATE_DETAIL_OPERATIO
31229
31932
  marker: "-"
31230
31933
  }];
31231
31934
  function appendOperationSections(lines, category, diffs, operations, formatItem) {
31232
- for (const operation of operations) {
31233
- const matchingDiffs = diffs.filter((diff) => diff.type === operation.type);
31935
+ for (const operation$1 of operations) {
31936
+ const matchingDiffs = diffs.filter((diff) => diff.type === operation$1.type);
31234
31937
  if (matchingDiffs.length === 0) continue;
31235
- lines.push(`\n${category} (${operation.label}):`);
31236
- for (const diff of matchingDiffs) lines.push(` ${operation.marker} ${formatItem(diff)}`);
31938
+ lines.push(`\n${category} (${operation$1.label}):`);
31939
+ for (const diff of matchingDiffs) lines.push(` ${operation$1.marker} ${formatItem(diff)}`);
31237
31940
  }
31238
31941
  }
31239
31942
  function formatIdentifierDetail(identifier, changes) {
@@ -31868,8 +32571,8 @@ function createCliCommandBatchRef(input) {
31868
32571
  slugPart(input.siteId) || "unnamed"
31869
32572
  ].join(":");
31870
32573
  }
31871
- function formatSiteCommandValidationErrors(errors) {
31872
- return errors.map((error) => error.message).join("\n");
32574
+ function formatSiteCommandValidationErrors(errors$1) {
32575
+ return errors$1.map((error) => error.message).join("\n");
31873
32576
  }
31874
32577
  function isRecord(value) {
31875
32578
  return Boolean(value && typeof value === "object" && !Array.isArray(value));
@@ -31939,7 +32642,7 @@ function planCliCommandBatchForTypes(input) {
31939
32642
  const exposure = batch.commands.length === 0 ? null : evaluateCliBatchExposure(batch, input.exposure ?? "sdk_cli", input.targetEnv);
31940
32643
  if (exposure !== null && exposure.kind !== "allowed") {
31941
32644
  const commandIndex = exposure.commandType === null ? 0 : batch.commands.findIndex((command) => command.type === exposure.commandType && (exposure.commandRef === null || command.ref === exposure.commandRef));
31942
- const errors = [{
32645
+ const errors$1 = [{
31943
32646
  code: "invalid_command_payload",
31944
32647
  commandIndex: Math.max(commandIndex, 0),
31945
32648
  commandType: exposure.commandType,
@@ -31948,7 +32651,7 @@ function planCliCommandBatchForTypes(input) {
31948
32651
  }];
31949
32652
  return err({
31950
32653
  code: "command_validation_failed",
31951
- errors,
32654
+ errors: errors$1,
31952
32655
  message: exposure.message
31953
32656
  });
31954
32657
  }