@riverbankcms/sdk 0.125.0 → 0.126.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/README.md +3 -1
  2. package/dist/{PreviewEditorSidebar-BezDOtQ7.mjs → PreviewEditorSidebar-DcYJxTgc.mjs} +67 -266
  3. package/dist/{PreviewEditorUI-CgSqmfo2.mjs → PreviewEditorUI-Ctt1yTJr.mjs} +3 -3
  4. package/dist/{PreviewQueryProvider-BH-3-jSj.mjs → PreviewQueryProvider-DgFDIwvK.mjs} +1 -1
  5. package/dist/{SdkPreviewModeRuntime-Co3AHfj0.mjs → SdkPreviewModeRuntime-CvW1vdQ4.mjs} +27 -27
  6. package/dist/{SiteChromeCustomizeContext-BHF-KANn.mjs → SiteChromeCustomizeContext-C87qlKWw.mjs} +412 -1301
  7. package/dist/_dts/ai/src/contracts/proposals.d.ts +1354 -202
  8. package/dist/_dts/api/src/common/envelope.d.ts +1 -1
  9. package/dist/_dts/api/src/contentRuntime.d.ts +0 -2
  10. package/dist/_dts/api/src/endpoints.d.ts +0 -7
  11. package/dist/_dts/api/src/sdk-event-upsert.d.ts +42 -0
  12. package/dist/_dts/api/src/sdkContracts.d.ts +11 -9
  13. package/dist/_dts/api/src/siteOperations.d.ts +18 -1
  14. package/dist/_dts/api/src/siteRuntimeEndpoints.d.ts +1 -14
  15. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationStripeReturn.d.ts +15 -2
  16. package/dist/_dts/db/src/generated/supabase/database.types.d.ts +182 -19
  17. package/dist/_dts/preview-next/src/client/preview/PreviewEditorSidebar.d.ts +1 -2
  18. package/dist/_dts/preview-next/src/client/preview/PreviewShell.d.ts +2 -3
  19. package/dist/_dts/preview-next/src/client/preview/PreviewShellLayout.d.ts +1 -2
  20. package/dist/_dts/preview-next/src/client/preview/SiteChromeCustomizeContext.d.ts +3 -12
  21. package/dist/_dts/preview-next/src/client/preview/StyleConfigurator.d.ts +3 -13
  22. package/dist/_dts/preview-next/src/client/preview/StyleConfigurator.state.d.ts +8 -100
  23. package/dist/_dts/preview-next/src/client/preview/siteStylePreviewPlanner.d.ts +1 -4
  24. package/dist/_dts/preview-next/src/client/preview/styleConfiguratorApplyPayload.d.ts +1 -15
  25. package/dist/_dts/preview-next/src/client/preview/styleConfiguratorSnapshot.d.ts +11 -21
  26. package/dist/_dts/sdk/src/cli/commands/event.d.ts +2 -2
  27. package/dist/_dts/sdk/src/cli/commands/eventOccurrenceSchedule.d.ts +12 -0
  28. package/dist/_dts/sdk/src/cli/commands/push/pushAllExtras.d.ts +6 -0
  29. package/dist/_dts/sdk/src/cli/commands/style.d.ts +1 -1
  30. package/dist/_dts/sdk/src/cli/content/legacyEventScheduleShapeError.d.ts +5 -0
  31. package/dist/_dts/sdk/src/cli/content/localEventSchedule.d.ts +17 -0
  32. package/dist/_dts/sdk/src/cli/content/reader.d.ts +5 -10
  33. package/dist/_dts/sdk/src/cli/migrations/events.d.ts +1 -1
  34. package/dist/_dts/sdk/src/cli/site-commands/eventScheduleCompiler.d.ts +24 -0
  35. package/dist/_dts/sdk/src/client/management/http.d.ts +1 -1
  36. package/dist/_dts/sdk/src/client/management/types.d.ts +3 -28
  37. package/dist/_dts/sdk/src/config/index.d.ts +1 -1
  38. package/dist/_dts/sdk/src/public-api/contracts.d.ts +5 -20
  39. package/dist/_dts/sdk/src/rendering/index.d.ts +1 -1
  40. package/dist/_dts/sdk/src/version.d.ts +1 -1
  41. package/dist/_dts/site-commands/src/commandContract.d.ts +33 -5
  42. package/dist/_dts/site-commands/src/commandDomain.d.ts +2 -2
  43. package/dist/_dts/site-commands/src/commands.d.ts +38 -9
  44. package/dist/_dts/site-commands/src/siteStyleCommandSchema.d.ts +28 -1
  45. package/dist/_dts/site-commands/src/siteStyleSelectionSchemaBuilder.d.ts +4 -4
  46. package/dist/_dts/theme-core/src/palette/concretePalette.d.ts +20 -0
  47. package/dist/_dts/theme-core/src/palette/curated/index.d.ts +2 -17
  48. package/dist/_dts/theme-core/src/palette/index.d.ts +1 -6
  49. package/dist/_dts/theme-core/src/palette/schema.d.ts +39 -0
  50. package/dist/_dts/theme-core/src/schema.d.ts +38 -26
  51. package/dist/_dts/theme-core/src/site-styles/previewCompiler.d.ts +4 -6
  52. package/dist/_dts/theme-core/src/site-styles/runtimeCompiler.d.ts +5 -6
  53. package/dist/cli/index.mjs +612 -522
  54. package/dist/cli/init-docs/content/cli-reference.md +6 -3
  55. package/dist/cli/init-docs/content/content-management.md +24 -13
  56. package/dist/client/{DiscountCodeDisclosure-CyPpekBp.mjs → DiscountCodeDisclosure-DS0AuFWW.mjs} +1 -1
  57. package/dist/client/{EventCombined.client-zywit-60.mjs → EventCombined.client-DtMxLr7q.mjs} +2 -2
  58. package/dist/client/{EventListing.client-J2nLhkKT.mjs → EventListing.client-BdLSRNg1.mjs} +2 -2
  59. package/dist/client/{LeafletStaticMap-CSubXWt6.mjs → LeafletStaticMap-BrpC6vsT.mjs} +1 -1
  60. package/dist/client/{MagicLinkForm-DDLIfiq9.mjs → MagicLinkForm-Bt3IuLMy.mjs} +1 -1
  61. package/dist/client/{StepIndicator-DE8EvHIp.mjs → StepIndicator-CBYPFVoy.mjs} +2 -2
  62. package/dist/client/{accordion-Ct5T5NiA.mjs → accordion-BqqwPJWM.mjs} +1 -1
  63. package/dist/client/{bookingForm-DMxtLPxw.mjs → bookingForm-SneP3yxC.mjs} +5 -6
  64. package/dist/client/bookings.mjs +190 -24
  65. package/dist/client/{carousel--FMqgvob.mjs → carousel-BTIR9L3I.mjs} +1 -1
  66. package/dist/client/{cart-BKX1bWiU.mjs → cart-bqiqd8SX.mjs} +3 -3
  67. package/dist/client/{checkout-B_jxi4WW.mjs → checkout-WbTFV5v4.mjs} +3 -3
  68. package/dist/client/client.mjs +156 -220
  69. package/dist/client/{courseRegistration-DH4MlkRD.mjs → courseRegistration-BcemLAdN.mjs} +6 -7
  70. package/dist/client/{eventCalendar-BQILwAcL.mjs → eventCalendar-CsxIw0V_.mjs} +4 -4
  71. package/dist/client/{eventCombined-DFFW_Vmo.mjs → eventCombined-B6XMoHfa.mjs} +2 -2
  72. package/dist/client/{eventDetails-B045CTSJ.mjs → eventDetails-BJaoPPfo.mjs} +3 -3
  73. package/dist/client/{eventListing-BDMYNVzS.mjs → eventListing-DgwdYHRT.mjs} +2 -2
  74. package/dist/client/{eventRegistration-CQ2-BSnB.mjs → eventRegistration-C0O3folu.mjs} +30 -22
  75. package/dist/client/{form-DJKuyZgN.mjs → form-Bk9txGFt.mjs} +1 -1
  76. package/dist/client/{headerSection-DeTjfiDo.mjs → headerSection-yIBt0yTv.mjs} +2 -2
  77. package/dist/client/hooks.mjs +50 -102
  78. package/dist/client/{locationMap-i2wDA8gB.mjs → locationMap-C-3KIpv-.mjs} +2 -2
  79. package/dist/client/{newsletterForm-DKiueauk.mjs → newsletterForm-CzB8g8h2.mjs} +1 -1
  80. package/dist/client/{pricing-C01J3Epx.mjs → pricing-C1QeDes_.mjs} +1 -1
  81. package/dist/client/{productDetail-Dfc1sZaX.mjs → productDetail-w7SBp5uc.mjs} +3 -3
  82. package/dist/client/{productList-BXbvXWTF.mjs → productList-D0tGKHGf.mjs} +3 -3
  83. package/dist/client/{propsDecoder-CIR5DQ1l.mjs → propsDecoder-Bcin2DB3.mjs} +167 -11
  84. package/dist/client/rendering/client.mjs +219 -276
  85. package/dist/client/rendering/islands.mjs +18 -18
  86. package/dist/client/rendering.mjs +128 -185
  87. package/dist/client/{useDiscountCodeUi-Bcyh4508.mjs → scrollToBlock-h-o_STf_.mjs} +18 -2
  88. package/dist/client/{shop-BbNwPKM-.mjs → shop-BGzmL8O_.mjs} +5 -6
  89. package/dist/client/{shop-commerce-XO-XMFEt.mjs → shop-commerce-lX8QxjX-.mjs} +4 -4
  90. package/dist/client/{shop-commerce-store-Byh6OUGK.mjs → shop-commerce-store-CEurARtu.mjs} +1 -1
  91. package/dist/client/{shopShared-Bbq39mwr.mjs → shopShared-DXxH8xxw.mjs} +2 -2
  92. package/dist/client/{useEventFilters-C8OOJ3el.mjs → useEventFilters-B591g9vd.mjs} +2 -2
  93. package/dist/client/{usePolling-CyJVo9kF.mjs → usePolling-BvnChV4m.mjs} +2 -2
  94. package/dist/preview-next/before-render.mjs +0 -7
  95. package/dist/preview-next/client/runtime.mjs +4 -4
  96. package/dist/preview-next/middleware.mjs +0 -7
  97. package/dist/{previewAuthStore-CJX21dGi.mjs → previewAuthStore-Dev9CdG9.mjs} +0 -7
  98. package/dist/{sdk-runtime-BGhyuE-E.mjs → sdk-runtime-M__i3Jce.mjs} +2 -2
  99. package/dist/{separator-BFs-Kmv5.mjs → separator-VSlnI9bc.mjs} +1 -1
  100. package/dist/server/components.mjs +87 -139
  101. package/dist/server/config-validation.mjs +50 -102
  102. package/dist/server/config.mjs +50 -102
  103. package/dist/server/data.mjs +50 -102
  104. package/dist/server/index.mjs +1 -8
  105. package/dist/server/next.mjs +91 -150
  106. package/dist/server/page-converter.mjs +50 -102
  107. package/dist/server/prebuild.mjs +1 -1
  108. package/dist/server/rendering/server.mjs +50 -102
  109. package/dist/server/rendering.mjs +88 -140
  110. package/dist/server/routing.mjs +71 -147
  111. package/dist/server/server.mjs +51 -110
  112. package/dist/server/theme-bridge.mjs +172 -162
  113. package/dist/server/theme.mjs +167 -11
  114. package/package.json +1 -1
  115. package/dist/_dts/theme-core/src/palette/editorState.d.ts +0 -75
  116. package/dist/_dts/theme-core/src/palette/libraryModel.d.ts +0 -64
  117. package/dist/_dts/theme-core/src/palette/persistenceReadSource.d.ts +0 -81
  118. package/dist/_dts/theme-core/src/palette/resolveSelection.d.ts +0 -75
  119. package/dist/_dts/theme-core/src/palette/selection.d.ts +0 -74
  120. package/dist/_dts/theme-core/src/palette/sitePalettePersistence.d.ts +0 -34
  121. package/dist/client/scrollToBlock-C86BYkyV.mjs +0 -17
@@ -2172,6 +2172,185 @@ var init_media$2 = __esmMin((() => {
2172
2172
  });
2173
2173
  }));
2174
2174
  //#endregion
2175
+ //#region ../theme-core/src/palette/colors.ts
2176
+ function normalizePaletteHex(value) {
2177
+ if (!NORMALIZABLE_HEX_REGEX.test(value)) return null;
2178
+ const normalized = value.toLowerCase();
2179
+ if (normalized.length === 7) return normalized;
2180
+ const triplet = normalized.slice(1);
2181
+ const red = triplet.charAt(0);
2182
+ const green = triplet.charAt(1);
2183
+ const blue = triplet.charAt(2);
2184
+ return `#${red}${red}${green}${green}${blue}${blue}`;
2185
+ }
2186
+ function paletteColorsFromEntries(entries) {
2187
+ const values = {};
2188
+ for (const entry of entries) {
2189
+ const parsedRole = paletteTokenNameSchema.safeParse(entry.name);
2190
+ if (!parsedRole.success) return {
2191
+ ok: false,
2192
+ error: {
2193
+ kind: "unknown-role",
2194
+ role: entry.name
2195
+ }
2196
+ };
2197
+ const role = parsedRole.data;
2198
+ if (values[role] !== void 0) return {
2199
+ ok: false,
2200
+ error: {
2201
+ kind: "duplicate-role",
2202
+ role
2203
+ }
2204
+ };
2205
+ const hex = normalizePaletteHex(entry.hex);
2206
+ if (!hex) return {
2207
+ ok: false,
2208
+ error: {
2209
+ kind: "invalid-color",
2210
+ role,
2211
+ value: entry.hex
2212
+ }
2213
+ };
2214
+ values[role] = hex;
2215
+ }
2216
+ const missing = PALETTE_TOKEN_NAMES.filter((role) => values[role] === void 0);
2217
+ if (missing.length > 0) return {
2218
+ ok: false,
2219
+ error: {
2220
+ kind: "missing-roles",
2221
+ roles: missing
2222
+ }
2223
+ };
2224
+ return {
2225
+ ok: true,
2226
+ colors: paletteColorsSchema.parse(values)
2227
+ };
2228
+ }
2229
+ function requirePaletteColorsFromEntries(entries) {
2230
+ const result = paletteColorsFromEntries(entries);
2231
+ if (result.ok) return result.colors;
2232
+ throw new Error(`Invalid complete palette: ${result.error.kind}`);
2233
+ }
2234
+ function paletteColorEntries(colors) {
2235
+ return THEME_PALETTE_COLOR_ORDER.map((name) => ({
2236
+ name,
2237
+ hex: colors[name]
2238
+ }));
2239
+ }
2240
+ function paletteColorFingerprint(colors) {
2241
+ return PALETTE_TOKEN_NAMES.map((name) => `${name}:${colors[name]}`).join("|");
2242
+ }
2243
+ function canonicalPaletteHashInput(colors, mode) {
2244
+ return `${mode}|${paletteColorFingerprint(colors)}`;
2245
+ }
2246
+ /**
2247
+ * The shared TypeScript/SQL protocol. Do not reorder roles: the order comes
2248
+ * from PALETTE_TOKEN_NAMES through canonicalPaletteHashInput.
2249
+ */
2250
+ function paletteValueKey(colors, mode) {
2251
+ return `${PALETTE_VALUE_KEY_PREFIX}${canonicalPaletteHashInput(colors, mode)}`;
2252
+ }
2253
+ /** Parses only the exact v1 canonical form emitted by paletteValueKey. */
2254
+ function parsePaletteValueKey(value) {
2255
+ if (typeof value !== "string" || !value.startsWith(PALETTE_VALUE_KEY_PREFIX)) return null;
2256
+ const [rawMode, ...rawRoles] = value.slice(PALETTE_VALUE_KEY_PREFIX.length).split("|");
2257
+ const mode = paletteModeSchema.safeParse(rawMode);
2258
+ if (!mode.success || rawRoles.length !== PALETTE_TOKEN_NAMES.length) return null;
2259
+ const colors = paletteColorsFromEntries(rawRoles.map((roleValue) => {
2260
+ const separator = roleValue.indexOf(":");
2261
+ return separator === -1 ? {
2262
+ name: "",
2263
+ hex: ""
2264
+ } : {
2265
+ name: roleValue.slice(0, separator),
2266
+ hex: roleValue.slice(separator + 1)
2267
+ };
2268
+ }));
2269
+ if (!colors.ok || paletteValueKey(colors.colors, mode.data) !== value) return null;
2270
+ return value;
2271
+ }
2272
+ var HEX_COLOR_REGEX, NORMALIZABLE_HEX_REGEX, THEME_PALETTE_COLOR_ORDER, hexColorSchema, paletteModeSchema, PALETTE_VALUE_KEY_PREFIX, paletteColorsSchema, paletteValueKeySchema;
2273
+ var init_colors = __esmMin((() => {
2274
+ init_themeColorTokens();
2275
+ HEX_COLOR_REGEX = /^#[0-9a-f]{6}$/;
2276
+ NORMALIZABLE_HEX_REGEX = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;
2277
+ THEME_PALETTE_COLOR_ORDER = [
2278
+ "primary",
2279
+ "secondary",
2280
+ "accent",
2281
+ "success",
2282
+ "warning",
2283
+ "destructive",
2284
+ "background",
2285
+ "surface",
2286
+ "surfaceAlt",
2287
+ "muted",
2288
+ "text",
2289
+ "primaryForeground",
2290
+ "border"
2291
+ ];
2292
+ hexColorSchema = z$1.string().regex(HEX_COLOR_REGEX, "Hex must be #RRGGBB (lowercase)").transform((value) => value);
2293
+ paletteModeSchema = z$1.enum(["light", "dark"]);
2294
+ PALETTE_VALUE_KEY_PREFIX = "palette-value:v1|";
2295
+ z$1.string().regex(/^[0-9a-f]{64}$/, "Palette hash must be a lowercase SHA-256 value").transform((value) => value);
2296
+ paletteColorsSchema = z$1.object({
2297
+ primary: hexColorSchema,
2298
+ primaryForeground: hexColorSchema,
2299
+ secondary: hexColorSchema,
2300
+ accent: hexColorSchema,
2301
+ success: hexColorSchema,
2302
+ warning: hexColorSchema,
2303
+ destructive: hexColorSchema,
2304
+ background: hexColorSchema,
2305
+ surface: hexColorSchema,
2306
+ surfaceAlt: hexColorSchema,
2307
+ muted: hexColorSchema,
2308
+ text: hexColorSchema,
2309
+ border: hexColorSchema
2310
+ }).strict().transform((value) => value);
2311
+ paletteValueKeySchema = z$1.string().transform((value, ctx) => {
2312
+ const parsed = parsePaletteValueKey(value);
2313
+ if (parsed) return parsed;
2314
+ ctx.addIssue({
2315
+ code: "custom",
2316
+ message: "Invalid canonical palette value key"
2317
+ });
2318
+ return z$1.NEVER;
2319
+ });
2320
+ }));
2321
+ //#endregion
2322
+ //#region ../theme-core/src/palette/schema.ts
2323
+ var colourHexString, paletteColorSchema, paletteMetaSchema, paletteSchema;
2324
+ var init_schema$3 = __esmMin((() => {
2325
+ init_colors();
2326
+ colourHexString = z$1.string().regex(/^#([0-9A-Fa-f]{3}){1,2}$/);
2327
+ paletteColorSchema = z$1.object({
2328
+ name: z$1.string().min(1),
2329
+ hex: colourHexString
2330
+ });
2331
+ paletteMetaSchema = z$1.object({ mode: z$1.enum(["light", "dark"]) });
2332
+ paletteSchema = z$1.object({
2333
+ colors: z$1.array(paletteColorSchema),
2334
+ meta: paletteMetaSchema
2335
+ }).transform((palette, ctx) => {
2336
+ const colors = paletteColorsFromEntries(palette.colors);
2337
+ if (!colors.ok) {
2338
+ ctx.addIssue({
2339
+ code: "custom",
2340
+ message: `Invalid complete palette: ${colors.error.kind}`
2341
+ });
2342
+ return z$1.NEVER;
2343
+ }
2344
+ return {
2345
+ colors: paletteColorEntries(colors.colors).map(({ name, hex }) => ({
2346
+ name: String(name),
2347
+ hex: String(hex)
2348
+ })),
2349
+ meta: palette.meta
2350
+ };
2351
+ });
2352
+ }));
2353
+ //#endregion
2175
2354
  //#region ../theme-core/src/cards/types.ts
2176
2355
  function isCardVariantRole(value) {
2177
2356
  return typeof value === "string" && cardVariantRoleValues.includes(value);
@@ -3221,9 +3400,10 @@ function normaliseHeaderNavFontRole(header) {
3221
3400
  navFontRole: navTypography
3222
3401
  } : rest;
3223
3402
  }
3224
- var axesSchema, colourHexString, paletteColorSchema, paletteMetaSchema, paletteSchema, typographyStyleSchema, bodyTypographyStyleSchema, headingSizeSchema, headingTypographyOverridesSchema, headingTypographyStyleSchema, proseLinkUnderlineStyleSchema, proseLinkUnderlineThicknessSchema, proseLinkUnderlineOffsetSchema, proseLinkStyleSchema, semanticSpacingSchema, boxRoundedSchema, boxBackgroundOverlaySchema, boxBackgroundSchema, noHeadingDecorationSchema, visibleHeadingDecorationSchema, headingDecorationSchema, headingDecorationOverrideSchema, accordionIconTreatmentSchema, sectionStylesOverrideSchema, containerStylesOverrideSchema, cardBorderOverrideSchema, cardStylesOverrideSchema, blockStyleOverridesSchema, blockThemeOverrideSchema, typographyScaleSchema, eyebrowTypographyStyleSchema, typographySchema, spaceSchema, corners, shadow, border, motion, inputStyle$1, headerVariant, headerPositioning, headerNavStyle, navFontWeight, headerMaxWidth, headerBarFrame, headerContainerSchema, headerBorderSchema, logoStyleSchema, headerLogoTextSchema, navEffectsSchema, dropdownStyleSchema, headerCtaGapSchema, headerCtaTreatmentSchema, navContainerSchema, headerBackgroundSchema, headerSchema, footerVariant, footerMaxWidth, footerMode, footerNavLayoutMode, footerNavLayoutAlign, footerSpacing, footerLogoPlacement, footerLogoSize, footerLogoMaxHeight, footerBottomTextLinkStyleSchema, footerBottomBarSchema, footerNavLayoutSchema, footerLogoSchema, footerSchema, containerPaddingPresetSchema, layoutSchema, heroTypographySizeSchema, heroTypographyLineHeightSchema, heroResponsiveTypographySchema, heroTypographySchema, heroSchema, bodyTextIntroTypographySizeSchema, bodyTextSchema, gradientsSchema, testimonialQuoteTreatmentSchema, themeSchema;
3403
+ var axesSchema, typographyStyleSchema, bodyTypographyStyleSchema, headingSizeSchema, headingTypographyOverridesSchema, headingTypographyStyleSchema, proseLinkUnderlineStyleSchema, proseLinkUnderlineThicknessSchema, proseLinkUnderlineOffsetSchema, proseLinkStyleSchema, semanticSpacingSchema, boxRoundedSchema, boxBackgroundOverlaySchema, boxBackgroundSchema, noHeadingDecorationSchema, visibleHeadingDecorationSchema, headingDecorationSchema, headingDecorationOverrideSchema, accordionIconTreatmentSchema, sectionStylesOverrideSchema, containerStylesOverrideSchema, cardBorderOverrideSchema, cardStylesOverrideSchema, blockStyleOverridesSchema, blockThemeOverrideSchema, typographyScaleSchema, eyebrowTypographyStyleSchema, typographySchema, spaceSchema, corners, shadow, border, motion, inputStyle$1, headerVariant, headerPositioning, headerNavStyle, navFontWeight, headerMaxWidth, headerBarFrame, headerContainerSchema, headerBorderSchema, logoStyleSchema, headerLogoTextSchema, navEffectsSchema, dropdownStyleSchema, headerCtaGapSchema, headerCtaTreatmentSchema, navContainerSchema, headerBackgroundSchema, headerSchema, footerVariant, footerMaxWidth, footerMode, footerNavLayoutMode, footerNavLayoutAlign, footerSpacing, footerLogoPlacement, footerLogoSize, footerLogoMaxHeight, footerBottomTextLinkStyleSchema, footerBottomBarSchema, footerNavLayoutSchema, footerLogoSchema, footerSchema, containerPaddingPresetSchema, layoutSchema, heroTypographySizeSchema, heroTypographyLineHeightSchema, heroResponsiveTypographySchema, heroTypographySchema, heroSchema, bodyTextIntroTypographySizeSchema, bodyTextSchema, gradientsSchema, testimonialQuoteTreatmentSchema, themeSchema;
3225
3404
  var init_schema$2 = __esmMin((() => {
3226
3405
  init_media$2();
3406
+ init_schema$3();
3227
3407
  init_buttons();
3228
3408
  init_cards();
3229
3409
  init_types$13();
@@ -3266,16 +3446,6 @@ var init_schema$2 = __esmMin((() => {
3266
3446
  "expressive"
3267
3447
  ])
3268
3448
  });
3269
- colourHexString = z$1.string().regex(/^#([0-9A-Fa-f]{3}){1,2}$/);
3270
- paletteColorSchema = z$1.object({
3271
- name: z$1.string().min(1),
3272
- hex: colourHexString
3273
- });
3274
- paletteMetaSchema = z$1.object({ mode: z$1.enum(["light", "dark"]) });
3275
- paletteSchema = z$1.object({
3276
- colors: z$1.array(paletteColorSchema),
3277
- meta: paletteMetaSchema
3278
- });
3279
3449
  typographyStyleSchema = z$1.object({
3280
3450
  family: z$1.string().min(1),
3281
3451
  weight: z$1.enum([
@@ -4398,7 +4568,7 @@ function selectionBranch(styleId, parameters) {
4398
4568
  }).strict();
4399
4569
  }
4400
4570
  var BUTTON_STYLE_IDS, quietArrowParametersSchema, emptyParametersSchema$1, buttonStyleSelectionWireSchema, buttonStyleSelectionSchema;
4401
- var init_selection$1 = __esmMin((() => {
4571
+ var init_selection = __esmMin((() => {
4402
4572
  BUTTON_STYLE_IDS = [
4403
4573
  "soft-pill",
4404
4574
  "earth-pill",
@@ -4437,7 +4607,7 @@ var quietArrowRecipe;
4437
4607
  var init_quietArrow = __esmMin((() => {
4438
4608
  init_domain();
4439
4609
  init_types$15();
4440
- init_selection$1();
4610
+ init_selection();
4441
4611
  quietArrowRecipe = defineButtonStyleRecipe({
4442
4612
  id: "quiet-arrow",
4443
4613
  accessibilityLabel: "Wide uppercase buttons with trailing arrows",
@@ -5903,7 +6073,7 @@ function defaultButtonStyleSelectionFor(styleId) {
5903
6073
  var buttonStyleRecipes, recipesById, registeredIds;
5904
6074
  var init_registry$1 = __esmMin((() => {
5905
6075
  init_domain();
5906
- init_selection$1();
6076
+ init_selection();
5907
6077
  init_quietArrow();
5908
6078
  init_staticRecipes();
5909
6079
  buttonStyleRecipes = [
@@ -5929,7 +6099,7 @@ var init_registry$1 = __esmMin((() => {
5929
6099
  var init_styles = __esmMin((() => {
5930
6100
  init_domain();
5931
6101
  init_registry$1();
5932
- init_selection$1();
6102
+ init_selection();
5933
6103
  }));
5934
6104
  function presetCategory(recipe) {
5935
6105
  switch (recipe.tags.era) {
@@ -20613,134 +20783,12 @@ var init_browser = __esmMin((() => {
20613
20783
  var init_extractPalette = __esmMin((() => {
20614
20784
  init_browser();
20615
20785
  }));
20616
- //#endregion
20617
- //#region ../theme-core/src/palette/colors.ts
20618
- function normalizePaletteHex(value) {
20619
- if (!NORMALIZABLE_HEX_REGEX.test(value)) return null;
20620
- const normalized = value.toLowerCase();
20621
- if (normalized.length === 7) return normalized;
20622
- const triplet = normalized.slice(1);
20623
- const red = triplet.charAt(0);
20624
- const green = triplet.charAt(1);
20625
- const blue = triplet.charAt(2);
20626
- return `#${red}${red}${green}${green}${blue}${blue}`;
20627
- }
20628
- function paletteColorsFromEntries(entries) {
20629
- const values = {};
20630
- for (const entry of entries) {
20631
- const parsedRole = paletteTokenNameSchema.safeParse(entry.name);
20632
- if (!parsedRole.success) return {
20633
- ok: false,
20634
- error: {
20635
- kind: "unknown-role",
20636
- role: entry.name
20637
- }
20638
- };
20639
- const role = parsedRole.data;
20640
- if (values[role] !== void 0) return {
20641
- ok: false,
20642
- error: {
20643
- kind: "duplicate-role",
20644
- role
20645
- }
20646
- };
20647
- const hex = normalizePaletteHex(entry.hex);
20648
- if (!hex) return {
20649
- ok: false,
20650
- error: {
20651
- kind: "invalid-color",
20652
- role,
20653
- value: entry.hex
20654
- }
20655
- };
20656
- values[role] = hex;
20657
- }
20658
- const missing = PALETTE_TOKEN_NAMES.filter((role) => values[role] === void 0);
20659
- if (missing.length > 0) return {
20660
- ok: false,
20661
- error: {
20662
- kind: "missing-roles",
20663
- roles: missing
20664
- }
20665
- };
20666
- return {
20667
- ok: true,
20668
- colors: paletteColorsSchema.parse(values)
20669
- };
20670
- }
20671
- function requirePaletteColorsFromEntries(entries) {
20672
- const result = paletteColorsFromEntries(entries);
20673
- if (result.ok) return result.colors;
20674
- throw new Error(`Invalid complete palette: ${result.error.kind}`);
20675
- }
20676
- function paletteColorFingerprint(colors) {
20677
- return PALETTE_TOKEN_NAMES.map((name) => `${name}:${colors[name]}`).join("|");
20678
- }
20679
- function canonicalPaletteHashInput(colors, mode) {
20680
- return `${mode}|${paletteColorFingerprint(colors)}`;
20681
- }
20682
- /**
20683
- * The shared TypeScript/SQL protocol. Do not reorder roles: the order comes
20684
- * from PALETTE_TOKEN_NAMES through canonicalPaletteHashInput.
20685
- */
20686
- function paletteValueKey(colors, mode) {
20687
- return `${PALETTE_VALUE_KEY_PREFIX}${canonicalPaletteHashInput(colors, mode)}`;
20688
- }
20689
- /** Parses only the exact v1 canonical form emitted by paletteValueKey. */
20690
- function parsePaletteValueKey(value) {
20691
- if (typeof value !== "string" || !value.startsWith(PALETTE_VALUE_KEY_PREFIX)) return null;
20692
- const [rawMode, ...rawRoles] = value.slice(PALETTE_VALUE_KEY_PREFIX.length).split("|");
20693
- const mode = paletteModeSchema.safeParse(rawMode);
20694
- if (!mode.success || rawRoles.length !== PALETTE_TOKEN_NAMES.length) return null;
20695
- const colors = paletteColorsFromEntries(rawRoles.map((roleValue) => {
20696
- const separator = roleValue.indexOf(":");
20697
- return separator === -1 ? {
20698
- name: "",
20699
- hex: ""
20700
- } : {
20701
- name: roleValue.slice(0, separator),
20702
- hex: roleValue.slice(separator + 1)
20703
- };
20704
- }));
20705
- if (!colors.ok || paletteValueKey(colors.colors, mode.data) !== value) return null;
20706
- return value;
20707
- }
20708
- var HEX_COLOR_REGEX, NORMALIZABLE_HEX_REGEX, hexColorSchema, paletteModeSchema, PALETTE_VALUE_KEY_PREFIX, paletteColorsSchema, paletteValueKeySchema;
20709
- var init_colors = __esmMin((() => {
20710
- init_themeColorTokens();
20711
- HEX_COLOR_REGEX = /^#[0-9a-f]{6}$/;
20712
- NORMALIZABLE_HEX_REGEX = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;
20713
- hexColorSchema = z$1.string().regex(HEX_COLOR_REGEX, "Hex must be #RRGGBB (lowercase)").transform((value) => value);
20714
- paletteModeSchema = z$1.enum(["light", "dark"]);
20715
- PALETTE_VALUE_KEY_PREFIX = "palette-value:v1|";
20716
- z$1.string().regex(/^[0-9a-f]{64}$/, "Palette hash must be a lowercase SHA-256 value").transform((value) => value);
20717
- paletteColorsSchema = z$1.object({
20718
- primary: hexColorSchema,
20719
- primaryForeground: hexColorSchema,
20720
- secondary: hexColorSchema,
20721
- accent: hexColorSchema,
20722
- success: hexColorSchema,
20723
- warning: hexColorSchema,
20724
- destructive: hexColorSchema,
20725
- background: hexColorSchema,
20726
- surface: hexColorSchema,
20727
- surfaceAlt: hexColorSchema,
20728
- muted: hexColorSchema,
20729
- text: hexColorSchema,
20730
- border: hexColorSchema
20731
- }).strict().transform((value) => value);
20732
- paletteValueKeySchema = z$1.string().transform((value, ctx) => {
20733
- const parsed = parsePaletteValueKey(value);
20734
- if (parsed) return parsed;
20735
- ctx.addIssue({
20736
- code: "custom",
20737
- message: "Invalid canonical palette value key"
20738
- });
20739
- return z$1.NEVER;
20740
- });
20786
+ var init_concretePalette = __esmMin((() => {
20787
+ init_colors();
20788
+ }));
20789
+ var init_fromVibrant = __esmMin((() => {
20790
+ init_utils$5();
20741
20791
  }));
20742
- var init_editorState = __esmMin((() => {}));
20743
- var init_libraryModel = __esmMin((() => {}));
20744
20792
  //#endregion
20745
20793
  //#region ../theme-core/src/site-styles/styleTags.ts
20746
20794
  var STYLE_AXIS_VALUES, styleTagsSchema;
@@ -22030,22 +22078,12 @@ var init_warm_dark = __esmMin((() => {
22030
22078
  }));
22031
22079
  //#endregion
22032
22080
  //#region ../theme-core/src/palette/curated/index.ts
22033
- /**
22034
- * Curated palette library.
22035
- *
22036
- * Authoring keys are readable source aliases. Value keys are derived from the
22037
- * complete mode and semantic colours and are the only curated identity used at
22038
- * persistence and runtime boundaries.
22039
- */
22040
22081
  function admitCuratedPaletteDefinition(definition) {
22041
22082
  return {
22042
22083
  ...definition,
22043
22084
  valueKey: definition.valueKey
22044
22085
  };
22045
22086
  }
22046
- function findCuratedPalette(valueKey) {
22047
- return curatedPalettesByValueKey.get(valueKey);
22048
- }
22049
22087
  function findCuratedPaletteByAuthoringKey(authoringKey) {
22050
22088
  return curatedPalettesByAuthoringKey.get(authoringKey);
22051
22089
  }
@@ -22054,9 +22092,8 @@ function requireCuratedPaletteValueKey(authoringKey) {
22054
22092
  if (!palette) throw new Error(`Unknown curated palette authoring key "${authoringKey}"`);
22055
22093
  return palette.valueKey;
22056
22094
  }
22057
- var curatedPalettes, curatedPalettesByValueKey, curatedPalettesByAuthoringKey, knownCuratedPaletteValueKeySchema;
22095
+ var curatedPalettes, curatedPalettesByAuthoringKey;
22058
22096
  var init_curated = __esmMin((() => {
22059
- init_colors();
22060
22097
  init_brand_led();
22061
22098
  init_high_contrast();
22062
22099
  init_soft_natural();
@@ -22083,107 +22120,8 @@ var init_curated = __esmMin((() => {
22083
22120
  admitCuratedPaletteDefinition(warmDarkEmber),
22084
22121
  admitCuratedPaletteDefinition(warmDarkKirtanGold)
22085
22122
  ];
22086
- curatedPalettesByValueKey = new Map(curatedPalettes.map((palette) => [palette.valueKey, palette]));
22123
+ new Map(curatedPalettes.map((palette) => [palette.valueKey, palette]));
22087
22124
  curatedPalettesByAuthoringKey = new Map(curatedPalettes.map((palette) => [palette.authoringKey, palette]));
22088
- knownCuratedPaletteValueKeySchema = z$1.string().transform((value, ctx) => {
22089
- const valueKey = parsePaletteValueKey(value);
22090
- if (!valueKey) {
22091
- ctx.addIssue({
22092
- code: "custom",
22093
- message: "Invalid canonical palette value key"
22094
- });
22095
- return z$1.NEVER;
22096
- }
22097
- const palette = findCuratedPalette(valueKey);
22098
- if (!palette) {
22099
- ctx.addIssue({
22100
- code: "custom",
22101
- message: "Unknown curated palette value key"
22102
- });
22103
- return z$1.NEVER;
22104
- }
22105
- return palette.valueKey;
22106
- });
22107
- }));
22108
- var init_resolveSelection = __esmMin((() => {
22109
- init_curated();
22110
- })), sitePaletteIdSchema, sitePaletteVersionSchema, paletteSelectionSchema, onboardingPaletteOriginSchema, curatedForkPaletteOriginSchema, manualPaletteOriginSchema, legacyCustomizedPaletteOriginSchema, sitePaletteOriginSchema, editorSitePaletteOriginSchema;
22111
- var init_selection = __esmMin((() => {
22112
- init_colors();
22113
- init_curated();
22114
- sitePaletteIdSchema = z$1.string().uuid().transform((value) => value);
22115
- sitePaletteVersionSchema = z$1.number().int().nonnegative().transform((value) => value);
22116
- paletteSelectionSchema = z$1.discriminatedUnion("kind", [z$1.object({
22117
- kind: z$1.literal("curated"),
22118
- valueKey: knownCuratedPaletteValueKeySchema
22119
- }), z$1.object({
22120
- kind: z$1.literal("site"),
22121
- paletteId: sitePaletteIdSchema
22122
- })]);
22123
- onboardingPaletteOriginSchema = z$1.object({
22124
- kind: z$1.literal("onboarding"),
22125
- sourceKey: z$1.string().min(1).nullable()
22126
- });
22127
- curatedForkPaletteOriginSchema = z$1.object({
22128
- kind: z$1.literal("curated-fork"),
22129
- sourceValueKey: paletteValueKeySchema
22130
- });
22131
- manualPaletteOriginSchema = z$1.object({ kind: z$1.literal("manual") });
22132
- legacyCustomizedPaletteOriginSchema = z$1.object({
22133
- kind: z$1.literal("legacy-customized"),
22134
- sourceKey: z$1.string().min(1).nullable()
22135
- });
22136
- sitePaletteOriginSchema = z$1.discriminatedUnion("kind", [
22137
- onboardingPaletteOriginSchema,
22138
- curatedForkPaletteOriginSchema,
22139
- manualPaletteOriginSchema,
22140
- legacyCustomizedPaletteOriginSchema
22141
- ]);
22142
- editorSitePaletteOriginSchema = z$1.discriminatedUnion("kind", [z$1.object({
22143
- kind: z$1.literal("curated-fork"),
22144
- sourceValueKey: knownCuratedPaletteValueKeySchema
22145
- }), manualPaletteOriginSchema]);
22146
- z$1.object({
22147
- id: sitePaletteIdSchema,
22148
- colors: paletteColorsSchema,
22149
- mode: paletteModeSchema,
22150
- origin: sitePaletteOriginSchema,
22151
- version: sitePaletteVersionSchema
22152
- });
22153
- z$1.discriminatedUnion("kind", [
22154
- z$1.object({ kind: z$1.literal("preserve") }),
22155
- z$1.object({
22156
- kind: z$1.literal("select"),
22157
- selection: paletteSelectionSchema
22158
- }),
22159
- z$1.object({
22160
- kind: z$1.literal("create-site"),
22161
- colors: paletteColorsSchema,
22162
- mode: paletteModeSchema,
22163
- origin: editorSitePaletteOriginSchema
22164
- }),
22165
- z$1.object({
22166
- kind: z$1.literal("update-site"),
22167
- paletteId: sitePaletteIdSchema,
22168
- expectedVersion: sitePaletteVersionSchema,
22169
- colors: paletteColorsSchema,
22170
- mode: paletteModeSchema
22171
- })
22172
- ]);
22173
- }));
22174
- var init_persistenceReadSource = __esmMin((() => {
22175
- init_curated();
22176
- init_colors();
22177
- init_resolveSelection();
22178
- init_selection();
22179
- }));
22180
- var init_sitePalettePersistence = __esmMin((() => {
22181
- init_curated();
22182
- init_colors();
22183
- init_selection();
22184
- }));
22185
- var init_fromVibrant = __esmMin((() => {
22186
- init_utils$5();
22187
22125
  })), init_palette$1 = __esmMin((() => {
22188
22126
  init_all();
22189
22127
  init_classifyColor();
@@ -22196,12 +22134,7 @@ var init_fromVibrant = __esmMin((() => {
22196
22134
  init_paletteAccess();
22197
22135
  init_extractPalette();
22198
22136
  init_colors();
22199
- init_editorState();
22200
- init_libraryModel();
22201
- init_persistenceReadSource();
22202
- init_resolveSelection();
22203
- init_selection();
22204
- init_sitePalettePersistence();
22137
+ init_concretePalette();
22205
22138
  init_fromVibrant();
22206
22139
  init_suggestRecipes();
22207
22140
  init_allRecipes();
@@ -24788,7 +24721,6 @@ var init_runtimeCompiler = __esmMin((() => {
24788
24721
  init_modern_minimal();
24789
24722
  init_expandPalette();
24790
24723
  init_styles();
24791
- init_colors();
24792
24724
  init_designState();
24793
24725
  init_types$9();
24794
24726
  init_accessibleSurfaces();
@@ -26651,7 +26583,7 @@ var init_siteStyleThemeCompiler = __esmMin((() => {
26651
26583
  init_curatedSiteStyles();
26652
26584
  init_runtimeCompiler();
26653
26585
  init_curated();
26654
- init_resolveSelection();
26586
+ init_concretePalette();
26655
26587
  }));
26656
26588
  var init_previewCustomization = __esmMin((() => {
26657
26589
  init_types$9();
@@ -26661,7 +26593,7 @@ var init_previewCompiler = __esmMin((() => {
26661
26593
  init_onColor();
26662
26594
  init_tokens();
26663
26595
  init_curated();
26664
- init_resolveSelection();
26596
+ init_concretePalette();
26665
26597
  init_curatedSiteStyles();
26666
26598
  init_resolver();
26667
26599
  init_types$9();
@@ -102821,15 +102753,20 @@ var init_usePaymentVerification = __esmMin((() => {
102821
102753
  //#endregion
102822
102754
  //#region ../blocks/src/system/runtime/nodes/event-registration/useEventRegistrationStripeReturn.ts
102823
102755
  function useEventRegistrationStripeReturn(options) {
102756
+ return useEventRegistrationStripeReturnWithDeps(options, eventRegistrationStripeReturnDeps);
102757
+ }
102758
+ function useEventRegistrationStripeReturnWithDeps(options, deps) {
102824
102759
  const { api, events, occurrenceId, pendingAttendeeId, setErrorMessage, setFormData, setPaymentSelection, setPendingAttendeeId, setRegistrationResult, setSelectedEvent, setSelectedAttendanceMode, setTicketSelections, setStep, setTicketsCount, step } = options;
102825
- const verification = usePaymentVerification(useMemo(() => step === "verifying-payment" && pendingAttendeeId ? { transactionId: pendingAttendeeId } : null, [step, pendingAttendeeId]));
102760
+ const verificationConfig = useMemo(() => step === "verifying-payment" && pendingAttendeeId ? { transactionId: pendingAttendeeId } : null, [step, pendingAttendeeId]);
102761
+ const verification = deps.usePaymentVerification(verificationConfig);
102826
102762
  useEffect(() => {
102827
- cleanupStaleRegistrations();
102828
- const registrationStatus = consumeSearchParam("registration");
102829
- if (!registrationStatus) return;
102763
+ deps.cleanupStaleRegistrations();
102764
+ const registrationStatus = deps.consumeSearchParam("registration");
102765
+ if (registrationStatus !== "cancelled" && registrationStatus !== "success") return;
102766
+ deps.scrollToBlock(EVENT_REGISTRATION_ANCHOR_ID);
102830
102767
  const siteId = api.config.siteId;
102831
102768
  if (!siteId) return;
102832
- const pending = getPendingRegistration(siteId, occurrenceId || void 0);
102769
+ const pending = deps.getPendingRegistration(siteId, occurrenceId || void 0);
102833
102770
  if (!pending) return;
102834
102771
  setFormData(pending.formData);
102835
102772
  setTicketSelections(pending.ticketSelections);
@@ -102849,7 +102786,7 @@ function useEventRegistrationStripeReturn(options) {
102849
102786
  useEffect(() => {
102850
102787
  if (verification.status === "completed") {
102851
102788
  const siteId = api.config.siteId;
102852
- if (siteId && occurrenceId) clearPendingRegistration(siteId, occurrenceId);
102789
+ if (siteId && occurrenceId) deps.clearPendingRegistration(siteId, occurrenceId);
102853
102790
  setRegistrationResult({ status: "confirmed" });
102854
102791
  setStep("success");
102855
102792
  } else if (verification.status === "failed") {
@@ -102869,11 +102806,21 @@ function useEventRegistrationStripeReturn(options) {
102869
102806
  ]);
102870
102807
  return verification;
102871
102808
  }
102809
+ var eventRegistrationStripeReturnDeps;
102872
102810
  var init_useEventRegistrationStripeReturn = __esmMin((() => {
102873
102811
  init_usePaymentVerification();
102874
102812
  init_shared();
102813
+ init_constants();
102875
102814
  init_sessionStorage();
102876
102815
  init_ticketSelectionLines();
102816
+ eventRegistrationStripeReturnDeps = {
102817
+ usePaymentVerification,
102818
+ consumeSearchParam,
102819
+ scrollToBlock,
102820
+ cleanupStaleRegistrations,
102821
+ clearPendingRegistration,
102822
+ getPendingRegistration
102823
+ };
102877
102824
  }));
102878
102825
  //#endregion
102879
102826
  //#region ../blocks/src/system/runtime/nodes/event-registration/useEventRegistrationSubmit.ts
@@ -102965,13 +102912,7 @@ function useEventRegistrationSubmitWithDeps(options, deps) {
102965
102912
  if (!result.alreadyRegistered && result.status === "confirmed" && result.pendingPayment && (method === "stripe" || method === "pass_bundle" || method === "membership_bundle")) {
102966
102913
  options.setPendingAttendeeId(result.attendeeId);
102967
102914
  options.setStep("redirecting");
102968
- const currentUrl = new URL(window.location.href);
102969
- const successParams = new URLSearchParams(currentUrl.search);
102970
- successParams.set("registration", "success");
102971
- const successUrl = `${currentUrl.origin}${currentUrl.pathname}?${successParams.toString()}${currentUrl.hash}`;
102972
- const cancelParams = new URLSearchParams(currentUrl.search);
102973
- cancelParams.set("registration", "cancelled");
102974
- const cancelUrl = `${currentUrl.origin}${currentUrl.pathname}?${cancelParams.toString()}${currentUrl.hash}`;
102915
+ const { successUrl, cancelUrl } = buildCheckoutReturnUrls("registration", EVENT_REGISTRATION_ANCHOR_ID);
102975
102916
  const checkoutType = method === "pass_bundle" ? "pass_bundle" : method === "membership_bundle" ? "membership_bundle" : "event";
102976
102917
  const checkoutResult = await options.api.createEventCheckout({
102977
102918
  attendeeId: result.attendeeId,
@@ -103036,6 +102977,8 @@ function useEventRegistrationSubmitWithDeps(options, deps) {
103036
102977
  }
103037
102978
  var eventRegistrationSubmitDeps;
103038
102979
  var init_useEventRegistrationSubmit = __esmMin((() => {
102980
+ init_shared();
102981
+ init_constants();
103039
102982
  init_sessionStorage();
103040
102983
  init_ticketSelectionLines();
103041
102984
  eventRegistrationSubmitDeps = { savePendingRegistration };