@riverbankcms/sdk 0.82.0 → 0.84.1

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 (206) hide show
  1. package/README.md +16 -0
  2. package/dist/{PreviewEditorSidebar-LHGK6RIO.mjs → PreviewEditorSidebar-X7RLMEI6.mjs} +330 -11
  3. package/dist/{PreviewEditorUI-AXZG2SDC.mjs → PreviewEditorUI-CT67N4O3.mjs} +3 -3
  4. package/dist/SdkPreviewModeRuntime-EIMQ3S2V.mjs +8 -0
  5. package/dist/_dts/ai/src/contracts/proposals.d.ts +200 -0
  6. package/dist/_dts/api/src/blocks.d.ts +36 -0
  7. package/dist/_dts/api/src/contentRuntime.d.ts +46 -0
  8. package/dist/_dts/api/src/endpoints.d.ts +40 -0
  9. package/dist/_dts/api/src/index.d.ts +2 -2
  10. package/dist/_dts/api/src/sdk-event-pricing.d.ts +61 -0
  11. package/dist/_dts/api/src/sdk-event-schedule.d.ts +52 -0
  12. package/dist/_dts/api/src/sdk-event-upsert.d.ts +50 -0
  13. package/dist/_dts/api/src/sdkContracts.d.ts +67 -33
  14. package/dist/_dts/api/src/shared-contracts.d.ts +13 -0
  15. package/dist/_dts/api/src/sitePlatformEndpoints.d.ts +22 -36
  16. package/dist/_dts/api/src/siteRuntimeEndpoints.d.ts +46 -1
  17. package/dist/_dts/block-form/src/backend/useBackendWatch.d.ts +6 -1
  18. package/dist/_dts/block-form/src/utils/evaluateVisibility.d.ts +3 -2
  19. package/dist/_dts/block-form/src/utils/visibleWhen.d.ts +7 -0
  20. package/dist/_dts/blocks/src/PageRenderer.d.ts +11 -0
  21. package/dist/_dts/blocks/src/bindings/index.d.ts +1 -1
  22. package/dist/_dts/blocks/src/client/site-chrome.d.ts +1 -1
  23. package/dist/_dts/blocks/src/client.d.ts +4 -0
  24. package/dist/_dts/blocks/src/contracts/proof-block-islands.d.ts +16 -4
  25. package/dist/_dts/blocks/src/system/blocks/appointment-booking.d.ts +288 -2016
  26. package/dist/_dts/blocks/src/system/blocks/blog-listing.d.ts +288 -2016
  27. package/dist/_dts/blocks/src/system/blocks/cart.d.ts +288 -2016
  28. package/dist/_dts/blocks/src/system/blocks/checkout.d.ts +288 -2016
  29. package/dist/_dts/blocks/src/system/blocks/collection.d.ts +288 -2016
  30. package/dist/_dts/blocks/src/system/blocks/contact-newsletter.d.ts +171 -0
  31. package/dist/_dts/blocks/src/system/blocks/faq.d.ts +288 -2016
  32. package/dist/_dts/blocks/src/system/blocks/gifting.d.ts +288 -2016
  33. package/dist/_dts/blocks/src/system/blocks/hero.d.ts +3 -2
  34. package/dist/_dts/blocks/src/system/blocks/index.d.ts +1 -0
  35. package/dist/_dts/blocks/src/system/blocks/location-map.d.ts +1 -7
  36. package/dist/_dts/blocks/src/system/blocks/media-text.d.ts +2534 -151
  37. package/dist/_dts/blocks/src/system/blocks/product-detail.d.ts +288 -2016
  38. package/dist/_dts/blocks/src/system/blocks/product-list.d.ts +288 -2016
  39. package/dist/_dts/blocks/src/system/blocks/shop.d.ts +288 -2016
  40. package/dist/_dts/blocks/src/system/blocks/site-header.d.ts +36 -3
  41. package/dist/_dts/blocks/src/system/blocks/team-members.d.ts +2 -2
  42. package/dist/_dts/blocks/src/system/constants/blockKinds.d.ts +1 -1
  43. package/dist/_dts/blocks/src/system/fields/aspectRatio.d.ts +4 -1
  44. package/dist/_dts/blocks/src/system/fields/imageShape.d.ts +30 -0
  45. package/dist/_dts/blocks/src/system/fragments/library/heroLayoutControls.d.ts +25 -0
  46. package/dist/_dts/blocks/src/system/manifest/schema.d.ts +35 -161
  47. package/dist/_dts/blocks/src/system/runtime/components/registry.client.d.ts +24 -6
  48. package/dist/_dts/blocks/src/system/runtime/components/runtime-backed-blocks.d.ts +12 -3
  49. package/dist/_dts/blocks/src/system/runtime/hooks/useHeadlessEventRegistrationFlow.d.ts +33 -0
  50. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/EventRegistrationWizard.d.ts +0 -2
  51. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/constants.d.ts +1 -0
  52. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/event-registration.headless.contract.d.ts +275 -0
  53. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/event-registration.headless.override.d.ts +10 -0
  54. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/event-registration.headless.planning.d.ts +22 -0
  55. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/event-registration.headless.state.d.ts +3 -0
  56. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationSubmit.d.ts +20 -1
  57. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationWizard.d.ts +13 -4
  58. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/utils.d.ts +1 -1
  59. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration.interactive.d.ts +28 -6
  60. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/pricing.d.ts +14 -0
  61. package/dist/_dts/content-editor/src/controller/EntryControllerProvider.d.ts +1 -1
  62. package/dist/_dts/content-editor/src/controller/buildBlockPublishedBaselines.d.ts +1 -1
  63. package/dist/_dts/content-editor/src/controller/seedDraftBaselinesFromBlocks.d.ts +1 -1
  64. package/dist/_dts/content-editor/src/controller/useBlocksList.d.ts +1 -1
  65. package/dist/_dts/content-editor/src/controller/useInvalidBlockRecovery.d.ts +1 -1
  66. package/dist/_dts/content-editor/src/primitives/PreviewRichTextEditor.d.ts +2 -1
  67. package/dist/_dts/content-editor/src/primitives/PreviewTextEditor.d.ts +1 -0
  68. package/dist/_dts/content-model/src/entry-slots/index.d.ts +1 -0
  69. package/dist/_dts/content-model/src/entry-slots/types.d.ts +356 -0
  70. package/dist/_dts/content-model/src/index.d.ts +1 -0
  71. package/dist/_dts/content-model/src/templates/defaults.d.ts +7 -0
  72. package/dist/_dts/db/src/generated/supabase/database.types.d.ts +100 -5
  73. package/dist/_dts/editor-blocks/src/BlockEditor.d.ts +6 -1
  74. package/dist/_dts/editor-blocks/src/BlockForm.d.ts +7 -5
  75. package/dist/_dts/editor-blocks/src/block-editor/hooks/useBlockCreation.d.ts +3 -2
  76. package/dist/_dts/editor-blocks/src/block-editor/hooks/useBlockDuplication.d.ts +3 -2
  77. package/dist/_dts/editor-blocks/src/block-editor/hooks/useBlockReorder.d.ts +3 -2
  78. package/dist/_dts/editor-blocks/src/block-editor/owner.d.ts +27 -0
  79. package/dist/_dts/editor-blocks/src/index.d.ts +1 -0
  80. package/dist/_dts/media-core/src/assetsInUseSummary.d.ts +8 -0
  81. package/dist/_dts/media-core/src/mediaUsageProjection.d.ts +37 -3
  82. package/dist/_dts/preview-next/src/client/blocks/pageDesignRuntimePreview.d.ts +4 -2
  83. package/dist/_dts/preview-next/src/client/blocks/previewProjection/runtimeContentDecoration.d.ts +2 -2
  84. package/dist/_dts/preview-next/src/client/preview/EntryEditorPanel.d.ts +3 -1
  85. package/dist/_dts/preview-next/src/client/preview/EntrySlotBlockEditorPanel.d.ts +19 -0
  86. package/dist/_dts/preview-next/src/client/preview/SiteChromeCustomizeButton.d.ts +8 -0
  87. package/dist/_dts/preview-next/src/client/preview/SiteChromeCustomizeContext.d.ts +4 -1
  88. package/dist/_dts/preview-next/src/client/preview/StyleConfigurator.state.d.ts +1 -1
  89. package/dist/_dts/preview-next/src/client/preview/linkedEntryEditEvents.d.ts +9 -0
  90. package/dist/_dts/preview-next/src/client/preview/previewCustomizeControls.d.ts +9 -8
  91. package/dist/_dts/preview-next/src/client/preview/siteChromeLookRows.d.ts +10 -1
  92. package/dist/_dts/preview-next/src/client/preview/siteChromeQuickControlHistoryState.d.ts +5 -1
  93. package/dist/_dts/sdk/src/bookings/index.d.ts +5 -4
  94. package/dist/_dts/sdk/src/bookings/types.d.ts +2 -2
  95. package/dist/_dts/sdk/src/cli/content/reader.d.ts +9 -8
  96. package/dist/_dts/sdk/src/cli/content/writer.d.ts +6 -1
  97. package/dist/_dts/sdk/src/cli/helpers.d.ts +10 -5
  98. package/dist/_dts/sdk/src/cli/merge-remote/entryLocal.d.ts +2 -2
  99. package/dist/_dts/sdk/src/cli/merge-remote/entryMerge.d.ts +2 -1
  100. package/dist/_dts/sdk/src/cli/merge-remote/entrySnapshots.d.ts +2 -2
  101. package/dist/_dts/sdk/src/client/management/index.d.ts +1 -1
  102. package/dist/_dts/sdk/src/client/management/types.d.ts +40 -10
  103. package/dist/_dts/sdk/src/config/field-definitions.d.ts +13 -7
  104. package/dist/_dts/sdk/src/contracts/system-block-content.d.ts +26 -3
  105. package/dist/_dts/sdk/src/public-api/contracts.d.ts +13 -0
  106. package/dist/_dts/sdk/src/rendering/blocks-page-renderer.d.ts +1 -0
  107. package/dist/_dts/sdk/src/rendering/components/pageShared.d.ts +6 -1
  108. package/dist/_dts/sdk/src/rendering/overrides.d.ts +6 -1
  109. package/dist/_dts/sdk/src/types/block-kinds.d.ts +1 -1
  110. package/dist/_dts/sdk/src/version.d.ts +1 -1
  111. package/dist/_dts/site-commands/src/commands.d.ts +15 -0
  112. package/dist/_dts/theme-core/src/accordions/types.d.ts +1 -1
  113. package/dist/_dts/theme-core/src/buttons/personalities/index.d.ts +11 -0
  114. package/dist/_dts/theme-core/src/buttons/personalities/ornate-ritual.d.ts +16 -0
  115. package/dist/_dts/theme-core/src/buttons/personalities/types.d.ts +1 -1
  116. package/dist/_dts/theme-core/src/buttons/types.d.ts +3 -3
  117. package/dist/_dts/theme-core/src/cards/types.d.ts +15 -15
  118. package/dist/_dts/theme-core/src/generated/containerResponsiveThemeCss.d.ts +1 -1
  119. package/dist/_dts/theme-core/src/inputs/types.d.ts +1 -1
  120. package/dist/_dts/theme-core/src/mock-themes/all.d.ts +33 -33
  121. package/dist/_dts/theme-core/src/palette/variants/index.d.ts +15 -0
  122. package/dist/_dts/theme-core/src/palette/variants/warm-dark.d.ts +16 -0
  123. package/dist/_dts/theme-core/src/schema.d.ts +30 -25
  124. package/dist/_dts/theme-core/src/site-styles/backgroundAppearance.d.ts +2 -2
  125. package/dist/_dts/theme-core/src/site-styles/curatedSiteStyles.d.ts +141 -1
  126. package/dist/_dts/theme-core/src/site-styles/designState.d.ts +2 -0
  127. package/dist/_dts/theme-core/src/site-styles/footerLooks.d.ts +110 -5
  128. package/dist/_dts/theme-core/src/site-styles/generatedSchemas.d.ts +4 -2
  129. package/dist/_dts/theme-core/src/site-styles/previewCompiler.d.ts +1 -1
  130. package/dist/_dts/theme-core/src/site-styles/runtimeCompiler.d.ts +5 -1
  131. package/dist/_dts/theme-core/src/site-styles/tokenRecipes.d.ts +1 -1
  132. package/dist/_dts/theme-core/src/site-styles/types.d.ts +1 -1
  133. package/dist/_dts/theme-core/src/site-styles/typographyPresets.d.ts +16 -1
  134. package/dist/_dts/theme-core/src/siteChromePlanning.d.ts +1 -0
  135. package/dist/_dts/theme-core/src/utils/colorStyles.d.ts +6 -6
  136. package/dist/{chunk-2BUMISSH.mjs → chunk-3LXFQS7T.mjs} +1 -1
  137. package/dist/{chunk-FIREV57T.mjs → chunk-LBBPD2IW.mjs} +40 -0
  138. package/dist/{chunk-XQR6THQJ.mjs → chunk-O62NDCTI.mjs} +3390 -1331
  139. package/dist/{chunk-6FWNF3DJ.mjs → chunk-QRKJDWT7.mjs} +158 -20
  140. package/dist/{chunk-HKB6XVIP.mjs → chunk-RCTJAZSK.mjs} +2 -2
  141. package/dist/{chunk-G35HOQEN.mjs → chunk-X5ZCSU6F.mjs} +132 -46
  142. package/dist/cli/index.mjs +2925 -577
  143. package/dist/cli/init-docs/content/agents-section.md +5 -0
  144. package/dist/cli/init-docs/content/cli-reference.md +13 -0
  145. package/dist/cli/init-docs/content/content-management.md +31 -0
  146. package/dist/cli/init-docs/content/getting-started.md +14 -0
  147. package/dist/cli/init-docs/content/workflow-add-block.md +3 -1
  148. package/dist/cli/init-docs/content/workflow-agent-safe-sync.md +81 -0
  149. package/dist/cli/init-docs/content/workflow-create-page.md +13 -3
  150. package/dist/cli/init-docs/content/workflow-custom-block.md +9 -0
  151. package/dist/cli/init-docs/content/workflow-templates.md +107 -2
  152. package/dist/client/{accordion-G34C45TW.mjs → accordion-2UZPBMYM.mjs} +2 -2
  153. package/dist/client/{bookingForm-BLBVKSAQ.mjs → bookingForm-DYXT6YB6.mjs} +5 -5
  154. package/dist/client/bookings.mjs +3477 -186
  155. package/dist/client/{carousel-7ZVTBRMD.mjs → carousel-QH77HR6X.mjs} +3 -3
  156. package/dist/client/{cart-Q6S6LZUO.mjs → cart-X4YK4FTW.mjs} +6 -6
  157. package/dist/client/{checkout-5QJLDE4I.mjs → checkout-OM2BEPWD.mjs} +6 -6
  158. package/dist/client/{chunk-ZF4XEWDM.mjs → chunk-3DTWLTXM.mjs} +1 -1
  159. package/dist/client/{chunk-5PQH4Y75.mjs → chunk-4OXKTA3D.mjs} +2 -2
  160. package/dist/client/{chunk-WJFHDTYF.mjs → chunk-52CGCQ7B.mjs} +5 -5
  161. package/dist/client/{chunk-CHAB5ACD.mjs → chunk-7UCLJ5SP.mjs} +2 -2
  162. package/dist/client/{chunk-U2EW7RSR.mjs → chunk-F5VRX5Y6.mjs} +1 -1
  163. package/dist/client/{chunk-SBBSMFFG.mjs → chunk-SYIJ5JO2.mjs} +1 -1
  164. package/dist/client/{chunk-EQKYMX4N.mjs → chunk-UHDWIXVR.mjs} +180 -157
  165. package/dist/client/{chunk-RJHTCTCZ.mjs → chunk-VGDBVNOO.mjs} +429 -15
  166. package/dist/client/{chunk-S3MKFGOG.mjs → chunk-ZE5G642V.mjs} +1 -1
  167. package/dist/client/{chunk-CSZGLBYR.mjs → chunk-ZKUO52W3.mjs} +1 -1
  168. package/dist/client/client.mjs +2685 -847
  169. package/dist/client/{courseRegistration-VUG2JJDB.mjs → courseRegistration-YBOGURTA.mjs} +5 -5
  170. package/dist/client/{eventCalendar-E7D2LD4N.mjs → eventCalendar-K4QJVCMD.mjs} +7 -7
  171. package/dist/client/{eventCombined-FUZ2Z3CS.mjs → eventCombined-MTXGMTCZ.mjs} +7 -7
  172. package/dist/client/{eventDetails-QRITJAOW.mjs → eventDetails-3PC4NL3U.mjs} +7 -7
  173. package/dist/client/{eventListing-INMQMJZ5.mjs → eventListing-TFJET6DN.mjs} +7 -7
  174. package/dist/client/{eventRegistration-TOOJD4WU.mjs → eventRegistration-QGPBGJTW.mjs} +7 -7
  175. package/dist/client/{form-BOWN7ZNQ.mjs → form-MDKR4FNB.mjs} +2 -2
  176. package/dist/client/{headerSection-HFQNZOUU.mjs → headerSection-Y5TMR3TW.mjs} +3 -3
  177. package/dist/client/hooks.mjs +2077 -546
  178. package/dist/client/{locationMap-VUZGC7Y5.mjs → locationMap-RH2LG7FZ.mjs} +2 -2
  179. package/dist/client/{newsletterForm-X2XQTPCB.mjs → newsletterForm-ZR5UDGBT.mjs} +2 -2
  180. package/dist/client/{productDetail-TA7D2G2B.mjs → productDetail-OIGDR4YE.mjs} +6 -6
  181. package/dist/client/{productList-AZOLOZKM.mjs → productList-4MA5S2CX.mjs} +6 -6
  182. package/dist/client/rendering/client.mjs +2560 -1205
  183. package/dist/client/rendering/islands.mjs +19 -19
  184. package/dist/client/rendering.mjs +2932 -1021
  185. package/dist/client/{shop-ZDLO7IIG.mjs → shop-WXSYV5QO.mjs} +6 -6
  186. package/dist/preview-next/before-render.mjs +40 -0
  187. package/dist/preview-next/client/runtime.mjs +5 -5
  188. package/dist/preview-next/middleware.mjs +40 -0
  189. package/dist/{sdk-runtime-CTWKNBDQ.mjs → sdk-runtime-7HJYPRWQ.mjs} +6 -6
  190. package/dist/server/components.mjs +2232 -534
  191. package/dist/server/config-validation.mjs +2068 -536
  192. package/dist/server/config.mjs +2068 -536
  193. package/dist/server/data.mjs +2077 -546
  194. package/dist/server/index.mjs +42 -1
  195. package/dist/server/next.mjs +2345 -574
  196. package/dist/server/page-converter.mjs +2684 -1220
  197. package/dist/server/prebuild.mjs +1 -1
  198. package/dist/server/rendering/server.mjs +2244 -546
  199. package/dist/server/rendering.mjs +2323 -552
  200. package/dist/server/routing.mjs +2012 -420
  201. package/dist/server/server.mjs +2153 -549
  202. package/dist/server/theme-bridge.mjs +1180 -101
  203. package/dist/server/theme.mjs +92 -1
  204. package/dist/styles/index.css +292 -36
  205. package/package.json +1 -1
  206. package/dist/SdkPreviewModeRuntime-RNVRHFFR.mjs +0 -8
@@ -1,7 +1,7 @@
1
- import { normalizeCarouselProps, CarouselNodeClient } from './chunk-5PQH4Y75.mjs';
1
+ import { normalizeCarouselProps, CarouselNodeClient } from './chunk-4OXKTA3D.mjs';
2
2
  import { mountReactIsland } from './chunk-N7PBWBWQ.mjs';
3
- import { defineIslandPropsDecoder } from './chunk-RJHTCTCZ.mjs';
4
- import './chunk-S3MKFGOG.mjs';
3
+ import { defineIslandPropsDecoder } from './chunk-VGDBVNOO.mjs';
4
+ import './chunk-ZE5G642V.mjs';
5
5
  import { jsx } from 'react/jsx-runtime';
6
6
 
7
7
  var decode = defineIslandPropsDecoder("carousel");
@@ -1,16 +1,16 @@
1
- import { mountShopBlockIsland, CartClient } from './chunk-WJFHDTYF.mjs';
2
- import './chunk-U2EW7RSR.mjs';
3
- import './chunk-5PQH4Y75.mjs';
1
+ import { mountShopBlockIsland, CartClient } from './chunk-52CGCQ7B.mjs';
2
+ import './chunk-F5VRX5Y6.mjs';
3
+ import './chunk-4OXKTA3D.mjs';
4
4
  import './chunk-I2MMZO53.mjs';
5
5
  import './chunk-ZFHRN6W2.mjs';
6
6
  import './chunk-L4J5Y62O.mjs';
7
- import './chunk-CHAB5ACD.mjs';
7
+ import './chunk-7UCLJ5SP.mjs';
8
8
  import './chunk-3DCJ45Z2.mjs';
9
9
  import './chunk-DVNUDUVT.mjs';
10
10
  import './chunk-UDNSI5PY.mjs';
11
11
  import './chunk-N7PBWBWQ.mjs';
12
- import { defineIslandPropsDecoder } from './chunk-RJHTCTCZ.mjs';
13
- import './chunk-S3MKFGOG.mjs';
12
+ import { defineIslandPropsDecoder } from './chunk-VGDBVNOO.mjs';
13
+ import './chunk-ZE5G642V.mjs';
14
14
 
15
15
  // src/rendering/islands/enhancers/cart.tsx
16
16
  var decode = defineIslandPropsDecoder("cart");
@@ -1,16 +1,16 @@
1
- import { mountShopBlockIsland, CheckoutClient } from './chunk-WJFHDTYF.mjs';
2
- import './chunk-U2EW7RSR.mjs';
3
- import './chunk-5PQH4Y75.mjs';
1
+ import { mountShopBlockIsland, CheckoutClient } from './chunk-52CGCQ7B.mjs';
2
+ import './chunk-F5VRX5Y6.mjs';
3
+ import './chunk-4OXKTA3D.mjs';
4
4
  import './chunk-I2MMZO53.mjs';
5
5
  import './chunk-ZFHRN6W2.mjs';
6
6
  import './chunk-L4J5Y62O.mjs';
7
- import './chunk-CHAB5ACD.mjs';
7
+ import './chunk-7UCLJ5SP.mjs';
8
8
  import './chunk-3DCJ45Z2.mjs';
9
9
  import './chunk-DVNUDUVT.mjs';
10
10
  import './chunk-UDNSI5PY.mjs';
11
11
  import './chunk-N7PBWBWQ.mjs';
12
- import { defineIslandPropsDecoder } from './chunk-RJHTCTCZ.mjs';
13
- import './chunk-S3MKFGOG.mjs';
12
+ import { defineIslandPropsDecoder } from './chunk-VGDBVNOO.mjs';
13
+ import './chunk-ZE5G642V.mjs';
14
14
 
15
15
  // src/rendering/islands/enhancers/checkout.tsx
16
16
  var decode = defineIslandPropsDecoder("checkout");
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { useBlockApi, BlockApiError } from './chunk-UDNSI5PY.mjs';
3
- import { themeButtonClassName } from './chunk-RJHTCTCZ.mjs';
3
+ import { themeButtonClassName } from './chunk-VGDBVNOO.mjs';
4
4
  import { useState, useSyncExternalStore, useEffect } from 'react';
5
5
  import { jsxs, jsx } from 'react/jsx-runtime';
6
6
 
@@ -1,6 +1,6 @@
1
1
  "use client";
2
- import { ChevronLeft, ChevronRight } from './chunk-RJHTCTCZ.mjs';
3
- import { clsx_default } from './chunk-S3MKFGOG.mjs';
2
+ import { ChevronLeft, ChevronRight } from './chunk-VGDBVNOO.mjs';
3
+ import { clsx_default } from './chunk-ZE5G642V.mjs';
4
4
  import React, { useRef, useState, useCallback, useEffect } from 'react';
5
5
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
6
6
 
@@ -1,15 +1,15 @@
1
1
  "use client";
2
- import { addPassToCommerceCart, useCommerceCart } from './chunk-U2EW7RSR.mjs';
3
- import { CarouselNodeClient } from './chunk-5PQH4Y75.mjs';
2
+ import { addPassToCommerceCart, useCommerceCart } from './chunk-F5VRX5Y6.mjs';
3
+ import { CarouselNodeClient } from './chunk-4OXKTA3D.mjs';
4
4
  import { isRecord } from './chunk-I2MMZO53.mjs';
5
5
  import { useDiscountCodeUi } from './chunk-ZFHRN6W2.mjs';
6
6
  import { buildRouteIslandApiConfig } from './chunk-L4J5Y62O.mjs';
7
- import { createBodyThemePortalRoot, consumeSearchParams, scrollToBlock, TerminalPanel, StateIcon, CheckIcon, CrossIcon, ActionRow, DiscountCodeDisclosure, consumeSearchParam, buildCheckoutReturnUrls } from './chunk-CHAB5ACD.mjs';
7
+ import { createBodyThemePortalRoot, consumeSearchParams, scrollToBlock, TerminalPanel, StateIcon, CheckIcon, CrossIcon, ActionRow, DiscountCodeDisclosure, consumeSearchParam, buildCheckoutReturnUrls } from './chunk-7UCLJ5SP.mjs';
8
8
  import { ModalShell, resolveDedicatedCheckoutPath } from './chunk-DVNUDUVT.mjs';
9
9
  import { useBlockApi, FeedbackMessage, BlockApiProvider } from './chunk-UDNSI5PY.mjs';
10
10
  import { mountReactIsland } from './chunk-N7PBWBWQ.mjs';
11
- import { themeButtonClassName, formatCommercePrice, formatInterval, getShopDisplayForItems, deriveCommerceCheckoutState, buildProductDetailDisplay, productItemKey, buildProductCartItem, buildProductCardDisplay, assertNever11, reportWorkflowError, clearWorkflowFeedback } from './chunk-RJHTCTCZ.mjs';
12
- import { assertNever, ok, err, getCurrentResolveImageUrlContext, resolveImageUrlWithContext, ImagePresets } from './chunk-S3MKFGOG.mjs';
11
+ import { themeButtonClassName, formatCommercePrice, formatInterval, getShopDisplayForItems, deriveCommerceCheckoutState, buildProductDetailDisplay, productItemKey, buildProductCartItem, buildProductCardDisplay, assertNever11, reportWorkflowError, clearWorkflowFeedback } from './chunk-VGDBVNOO.mjs';
12
+ import { assertNever, ok, err, getCurrentResolveImageUrlContext, resolveImageUrlWithContext, ImagePresets } from './chunk-ZE5G642V.mjs';
13
13
  import * as React3 from 'react';
14
14
  import React3__default, { useState, useRef, useCallback, useEffect } from 'react';
15
15
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
@@ -1,6 +1,6 @@
1
1
  import { FeedbackMessage } from './chunk-UDNSI5PY.mjs';
2
- import { themeButtonClassName } from './chunk-RJHTCTCZ.mjs';
3
- import { clsx_default } from './chunk-S3MKFGOG.mjs';
2
+ import { themeButtonClassName } from './chunk-VGDBVNOO.mjs';
3
+ import { clsx_default } from './chunk-ZE5G642V.mjs';
4
4
  import { useId } from 'react';
5
5
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
6
6
 
@@ -1,4 +1,4 @@
1
- import { EMPTY_COMMERCE_CART_STATE, parseStoredCommerceCartState, reduceCommerceCart, buildPassCartItem } from './chunk-RJHTCTCZ.mjs';
1
+ import { EMPTY_COMMERCE_CART_STATE, parseStoredCommerceCartState, reduceCommerceCart, buildPassCartItem } from './chunk-VGDBVNOO.mjs';
2
2
  import * as React from 'react';
3
3
 
4
4
  var EMPTY_STATE = EMPTY_COMMERCE_CART_STATE;
@@ -1,4 +1,4 @@
1
- import { clsx_default } from './chunk-S3MKFGOG.mjs';
1
+ import { clsx_default } from './chunk-ZE5G642V.mjs';
2
2
  import { jsxs, jsx } from 'react/jsx-runtime';
3
3
 
4
4
  function resolveColorStyle(color) {
@@ -1,16 +1,16 @@
1
1
  "use client";
2
2
  import { LeafletStaticMap } from './chunk-XSV6KW4D.mjs';
3
- import { MagicLinkForm, useWaitlistClaim } from './chunk-ZF4XEWDM.mjs';
4
- import { usePolling } from './chunk-CSZGLBYR.mjs';
5
- import { SpinnerNode } from './chunk-SBBSMFFG.mjs';
3
+ import { MagicLinkForm, useWaitlistClaim } from './chunk-3DTWLTXM.mjs';
4
+ import { usePolling } from './chunk-ZKUO52W3.mjs';
5
+ import { SpinnerNode } from './chunk-SYIJ5JO2.mjs';
6
6
  import { useDiscountCodeUi } from './chunk-ZFHRN6W2.mjs';
7
- import { createBodyThemePortalRoot, TabBarFragment, logoutPortal, StepIndicator, DiscountCodeDisclosure, TerminalPanel, StateIcon, formatPrice, CrossIcon, ClockIcon, consumeSearchParam, LoggedInAsUser, CheckIcon } from './chunk-CHAB5ACD.mjs';
7
+ import { createBodyThemePortalRoot, TabBarFragment, logoutPortal, StepIndicator, DiscountCodeDisclosure, TerminalPanel, StateIcon, formatPrice, CrossIcon, ClockIcon, consumeSearchParam, LoggedInAsUser, CheckIcon } from './chunk-7UCLJ5SP.mjs';
8
8
  import { getFieldValidationControlProps, FieldValidationMessage } from './chunk-3DCJ45Z2.mjs';
9
9
  import { ModalShell } from './chunk-DVNUDUVT.mjs';
10
10
  import { isSpamProtectionEnabled, AltchaWidget, getChallengeUrl } from './chunk-GFSQNTRW.mjs';
11
11
  import { useBlockApi, FeedbackMessage } from './chunk-UDNSI5PY.mjs';
12
- import { buildEventRuntimeFilters, buildEventCalendarListingRender, groupEventsByDate, getOrderedDayNames, formatDateKey, getEventRuntimeFiltersKey, themeButtonClassName, normalizeCsvIds, normalizeOptionalId, normalizeEventBlockKind, normalizeCsvString, EventCompactRow, EmptyState, getContainerClass, getCardOrientation, isToday, MAX_EVENTS_PER_DAY, formatTime, resolveCoursePricingState, formatEventPrice, formatEventDateParts, DateTimeTile, EventCard, buildCalendarViewport, shiftCalendarAnchorDate, addMonths, getThreeMonthRange, buildTimetableModel, formatDate, isEventContentType, formatCoursePriceAmount, formatCoursePriceDisplay, MONTH_NAMES, getEventAvailability, formatEventTeacherLine, CreditCard, Ticket, Star, Sparkles, assertNever11 } from './chunk-RJHTCTCZ.mjs';
13
- import { publicEventPricingType, getBookingLocalDateKey, toScheduledBookingDateTime, toBookingTimeZone, publicEventPricingCurrency, formatBookingDateTime, publicEventPricingMode, publicEventScalarPrice, publicEventTicketTypes, formatBookingDate, formatBookingTime } from './chunk-S3MKFGOG.mjs';
12
+ import { buildEventRuntimeFilters, buildEventCalendarListingRender, groupEventsByDate, getOrderedDayNames, formatDateKey, getEventRuntimeFiltersKey, themeButtonClassName, normalizeCsvIds, normalizeOptionalId, normalizeEventBlockKind, normalizeCsvString, EventCompactRow, EmptyState, getContainerClass, getCardOrientation, isToday, MAX_EVENTS_PER_DAY, formatTime, WIZARD_STEPS, getWizardStepsForContext, getStepNumber, resolveCoursePricingState, resolveRuntimeEventPricing, formatEventPrice, formatEventDateParts, DateTimeTile, EventCard, buildCalendarViewport, shiftCalendarAnchorDate, addMonths, getThreeMonthRange, buildTimetableModel, formatDate, toRegistrationEvents, isEventContentType, findPreSelectedEvent, resolveRegistrationTarget, findEventByOccurrenceId, resolveEventRequiresPayment, resolveDiscountContext, formatCoursePriceAmount, formatCoursePriceDisplay, MONTH_NAMES, getEventAvailability, formatEventTeacherLine, CreditCard, Ticket, Star, Sparkles, assertNever11 } from './chunk-VGDBVNOO.mjs';
13
+ import { publicEventPricingType, getBookingLocalDateKey, toScheduledBookingDateTime, toBookingTimeZone, publicEventPricingCurrency, formatBookingDateTime, publicEventPricingMode, publicEventScalarPrice, publicEventTicketTypes, formatBookingDate, formatBookingTime } from './chunk-ZE5G642V.mjs';
14
14
  import React9, { createContext, useId, useMemo, useState, useRef, useEffect, useCallback, useContext, useReducer } from 'react';
15
15
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
16
16
 
@@ -18,25 +18,6 @@ function StepIndicator2(props) {
18
18
  return /* @__PURE__ */ jsx(StepIndicator, { ...props, classPrefix: "er" });
19
19
  }
20
20
 
21
- // ../blocks/src/system/runtime/nodes/event-registration/wizardSteps.ts
22
- var WIZARD_STEPS = [
23
- "select-event",
24
- "select-tickets",
25
- "enter-details",
26
- "select-payment"
27
- ];
28
- function getWizardStepsForContext(hasPreSelectedContext, needsPaymentStep) {
29
- const baseSteps = hasPreSelectedContext ? ["select-tickets", "enter-details"] : ["select-event", "select-tickets", "enter-details"];
30
- if (!needsPaymentStep) {
31
- return baseSteps;
32
- }
33
- return [...baseSteps, "select-payment"];
34
- }
35
- function getStepNumber(step, wizardSteps) {
36
- const index = wizardSteps.indexOf(step);
37
- return index >= 0 ? index + 1 : 1;
38
- }
39
-
40
21
  // ../blocks/src/system/runtime/nodes/event-registration/registrationStateMachine.ts
41
22
  function createInitialRegistrationFlowState(hasPreSelectedContext) {
42
23
  return {
@@ -190,6 +171,83 @@ function requiresPaymentStep(params) {
190
171
  return !isEntitlementSelection(params.paymentSelection);
191
172
  }
192
173
 
174
+ // ../blocks/src/system/runtime/nodes/event-registration/event-registration.headless.contract.ts
175
+ var DEFAULT_EVENT_REGISTRATION_MAX_TICKETS = 5;
176
+
177
+ // ../blocks/src/system/runtime/nodes/event-registration/event-registration.headless.planning.ts
178
+ function getRegistrableStatuses(isPreview) {
179
+ return isPreview ? ["active", "draft"] : ["active"];
180
+ }
181
+ function normalizeEventRegistrationMaxTickets(value) {
182
+ if (typeof value === "number" && Number.isFinite(value) && value > 0) {
183
+ return Math.floor(value);
184
+ }
185
+ if (typeof value === "string") {
186
+ const parsed = Number.parseInt(value, 10);
187
+ return Number.isFinite(parsed) && parsed > 0 ? parsed : DEFAULT_EVENT_REGISTRATION_MAX_TICKETS;
188
+ }
189
+ return DEFAULT_EVENT_REGISTRATION_MAX_TICKETS;
190
+ }
191
+ function resolveEventRegistrationSubmitPlan(input) {
192
+ const selection = input.paymentSelection.method ? input.paymentSelection : void 0;
193
+ if (input.canJoinWaitlist) {
194
+ return { ok: true, args: withOptionalSelection({ method: "free" }, selection) };
195
+ }
196
+ switch (input.paymentSelection.method) {
197
+ case "pass":
198
+ return input.paymentSelection.passId ? {
199
+ ok: true,
200
+ args: withOptionalSelection(
201
+ { method: "pass", passId: input.paymentSelection.passId },
202
+ selection
203
+ )
204
+ } : missingPaymentSelection();
205
+ case "membership":
206
+ return input.paymentSelection.membershipId ? {
207
+ ok: true,
208
+ args: withOptionalSelection(
209
+ { method: "membership", membershipId: input.paymentSelection.membershipId },
210
+ selection
211
+ )
212
+ } : missingPaymentSelection();
213
+ case "free":
214
+ return { ok: true, args: withOptionalSelection({ method: "free" }, selection) };
215
+ case null:
216
+ return input.eventRequiresPayment ? missingPaymentSelection() : { ok: true, args: { method: "free" } };
217
+ case "pass_bundle":
218
+ return input.paymentSelection.bundlePassId ? {
219
+ ok: true,
220
+ args: withOptionalSelection(
221
+ { method: "pass_bundle", passId: input.paymentSelection.bundlePassId },
222
+ selection
223
+ )
224
+ } : missingPaymentSelection();
225
+ case "membership_bundle":
226
+ return input.paymentSelection.bundleMembershipId ? {
227
+ ok: true,
228
+ args: withOptionalSelection(
229
+ {
230
+ method: "membership_bundle",
231
+ membershipId: input.paymentSelection.bundleMembershipId
232
+ },
233
+ selection
234
+ )
235
+ } : missingPaymentSelection();
236
+ case "stripe":
237
+ return { ok: true, args: withOptionalSelection({ method: "stripe" }, selection) };
238
+ }
239
+ }
240
+ function withOptionalSelection(args, selection) {
241
+ return selection ? { ...args, selection } : args;
242
+ }
243
+ function missingPaymentSelection() {
244
+ return {
245
+ ok: false,
246
+ reason: "payment-selection-required",
247
+ message: "Select a payment option to continue."
248
+ };
249
+ }
250
+
193
251
  // ../blocks/src/system/runtime/nodes/event-registration/utils.ts
194
252
  var DEFAULT_EVENT_CURRENCY = "usd";
195
253
  function formatDate2(isoTimestamp, options) {
@@ -281,7 +339,7 @@ function getTicketTypeAvailabilityLabel(ticketType) {
281
339
  }
282
340
  function getVisibleTicketTypes(input) {
283
341
  const eligibilityTicketTypes = input.eligibility?.ticketTypes;
284
- const eventTicketTypes = input.event ? publicEventTicketTypes(input.event.pricing) : [];
342
+ const eventTicketTypes = input.event ? publicEventTicketTypes(resolveRuntimeEventPricing(input.event)) : [];
285
343
  const source = eligibilityTicketTypes && eligibilityTicketTypes.length > 0 ? eligibilityTicketTypes : eventTicketTypes;
286
344
  return source.filter(
287
345
  (ticketType) => ticketType.isActive && (!input.selectedAttendanceMode || (ticketType.attendanceScope ?? "both") === "both" || (ticketType.attendanceScope ?? "both") === input.selectedAttendanceMode)
@@ -848,8 +906,9 @@ var TicketSelectionStep = ({
848
906
  const waitlistEnabled = selectedModeAvailability?.waitlistEnabled ?? event?.waitlistEnabled ?? false;
849
907
  const isSoldOut = availableSpots === 0;
850
908
  const canJoinWaitlist = isSoldOut && waitlistEnabled === true;
851
- const eventPricingMode = event ? publicEventPricingMode(event.pricing) : void 0;
852
- const eventPricingCurrency = event ? publicEventPricingCurrency(event.pricing) : null;
909
+ const eventPricing = event ? resolveRuntimeEventPricing(event) : null;
910
+ const eventPricingMode = eventPricing ? publicEventPricingMode(eventPricing) : void 0;
911
+ const eventPricingCurrency = eventPricing ? publicEventPricingCurrency(eventPricing) : null;
853
912
  const usesTicketTypes = eventPricingMode === "ticket_types" && !canJoinWaitlist;
854
913
  const visibleTicketTypes = usesTicketTypes ? getVisibleTicketTypes({
855
914
  event,
@@ -1796,18 +1855,8 @@ function EventRegistrationWizardActions(props) {
1796
1855
  }
1797
1856
  case "select-payment": {
1798
1857
  const { status, canContinue, buttonText } = wizard.paymentStepState;
1799
- const selection = wizard.paymentSelection;
1800
1858
  const handlePaymentContinue = () => {
1801
- if (!selection.method) return;
1802
- if (selection.method === "free") {
1803
- void wizard.handlePaymentSelect("free");
1804
- return;
1805
- }
1806
- void wizard.handlePaymentSelect(
1807
- selection.method,
1808
- selection.passId ?? selection.bundlePassId,
1809
- selection.membershipId ?? selection.bundleMembershipId
1810
- );
1859
+ void wizard.handlePaymentSelect();
1811
1860
  };
1812
1861
  return /* @__PURE__ */ jsxs("div", { className: "er-actions", children: [
1813
1862
  /* @__PURE__ */ jsx("button", { type: "button", onClick: () => wizard.setStep("enter-details"), className: "er-back-btn", children: "\u2190 Back" }),
@@ -2025,9 +2074,15 @@ function useEventRegistrationStripeReturn(options) {
2025
2074
 
2026
2075
  // ../blocks/src/system/runtime/nodes/event-registration/useEventRegistrationSubmit.ts
2027
2076
  function useEventRegistrationSubmit(options) {
2028
- return async (method, passId, membershipId, selection) => {
2077
+ return async (method, passId, membershipId, selection, submitOptions) => {
2029
2078
  const submitOccurrenceId = options.registrationTarget?.occurrenceId;
2030
- if (!submitOccurrenceId) return;
2079
+ if (!submitOccurrenceId) {
2080
+ return {
2081
+ ok: false,
2082
+ reason: "missing-target",
2083
+ message: "Select an event to continue."
2084
+ };
2085
+ }
2031
2086
  options.setStep("submitting");
2032
2087
  try {
2033
2088
  const isBundle = method === "pass_bundle" || method === "membership_bundle";
@@ -2095,7 +2150,7 @@ function useEventRegistrationSubmit(options) {
2095
2150
  if (checkoutResult.bypassed) {
2096
2151
  options.setRegistrationResult({ status: "confirmed" });
2097
2152
  options.setStep("success");
2098
- return;
2153
+ return { ok: true, outcome: { kind: "completed" } };
2099
2154
  }
2100
2155
  if (!checkoutResult.checkoutUrl) {
2101
2156
  throw new Error("Checkout URL missing");
@@ -2112,8 +2167,17 @@ function useEventRegistrationSubmit(options) {
2112
2167
  paymentSelection: selectionSnapshot
2113
2168
  });
2114
2169
  }
2170
+ if (submitOptions?.redirect === "manual") {
2171
+ return {
2172
+ ok: true,
2173
+ outcome: {
2174
+ kind: "checkout_redirect",
2175
+ checkoutUrl: checkoutResult.checkoutUrl
2176
+ }
2177
+ };
2178
+ }
2115
2179
  window.location.href = checkoutResult.checkoutUrl;
2116
- return;
2180
+ return { ok: true, outcome: { kind: "checkout_redirect", checkoutUrl: checkoutResult.checkoutUrl } };
2117
2181
  }
2118
2182
  if (result.alreadyRegistered) {
2119
2183
  const title = result.status === "waitlist" ? "Already waitlisted" : "Already registered";
@@ -2135,95 +2199,20 @@ function useEventRegistrationSubmit(options) {
2135
2199
  options.setRegistrationResult({ status: result.status });
2136
2200
  }
2137
2201
  options.setStep("success");
2202
+ return { ok: true, outcome: { kind: "completed" } };
2138
2203
  } catch (error) {
2139
- options.setErrorMessage(error instanceof Error ? error.message : "Registration failed");
2204
+ const message = error instanceof Error ? error.message : "Registration failed";
2205
+ options.setErrorMessage(message);
2140
2206
  options.setStep("error");
2207
+ return {
2208
+ ok: false,
2209
+ reason: "submission-failed",
2210
+ message
2211
+ };
2141
2212
  }
2142
2213
  };
2143
2214
  }
2144
2215
 
2145
- // ../blocks/src/system/runtime/nodes/event-registration/registrationDerivations.ts
2146
- function eventMatchesOccurrenceId(event, occurrenceId) {
2147
- return event.registrationOccurrenceId === occurrenceId || event.publicEventId === occurrenceId;
2148
- }
2149
- function findEventByOccurrenceId(events, occurrenceId) {
2150
- return events.find((event) => eventMatchesOccurrenceId(event, occurrenceId)) ?? null;
2151
- }
2152
- function findPreSelectedEvent(input) {
2153
- const occurrenceContext = input.occurrenceContext;
2154
- if (!occurrenceContext) {
2155
- return null;
2156
- }
2157
- const contextDate = getBookingLocalDateKey(toScheduledBookingDateTime({
2158
- startsAt: occurrenceContext.startsAt,
2159
- timeZone: occurrenceContext.timeZone
2160
- }));
2161
- return input.scopedEvents.find(
2162
- (event) => eventMatchesOccurrenceId(event, occurrenceContext.id) || getBookingLocalDateKey(toScheduledBookingDateTime({
2163
- startsAt: event.startsAt,
2164
- timeZone: event.timeZone
2165
- })) === contextDate
2166
- ) ?? null;
2167
- }
2168
- function resolveRegistrationTarget(input) {
2169
- const occurrenceId = input.occurrenceContext?.id ?? input.selectedEvent?.registrationOccurrenceId ?? null;
2170
- if (!occurrenceId) {
2171
- return null;
2172
- }
2173
- return {
2174
- occurrenceId,
2175
- selectedEventId: input.selectedEvent?.publicEventId ?? null
2176
- };
2177
- }
2178
- function resolveEventRequiresPayment(input) {
2179
- if (input.eligibility) {
2180
- return input.eligibility.requiresPayment;
2181
- }
2182
- if (input.selectedTicketType) {
2183
- return input.selectedTicketType.priceAmount > 0;
2184
- }
2185
- if (!input.event) {
2186
- return false;
2187
- }
2188
- return publicEventPricingType(input.event.pricing) !== "free";
2189
- }
2190
- function resolveDiscountContext(input) {
2191
- const selection = input.paymentSelection.method ? input.paymentSelection : null;
2192
- if (!input.event) {
2193
- return null;
2194
- }
2195
- if (selection?.method === "pass_bundle" && selection.bundlePassId) {
2196
- return { type: "pass", passId: selection.bundlePassId };
2197
- }
2198
- if (selection?.method === "membership_bundle" && selection.bundleMembershipId) {
2199
- return { type: "membership", membershipId: selection.bundleMembershipId };
2200
- }
2201
- if (!input.eventRequiresPayment) {
2202
- return null;
2203
- }
2204
- if (selection?.method && selection.method !== "stripe") {
2205
- return null;
2206
- }
2207
- return {
2208
- type: "event",
2209
- eventSeriesId: input.event.seriesId,
2210
- eventCategoryId: input.event.eventCategory?.id ?? null,
2211
- ticketsCount: input.ticketsCount
2212
- };
2213
- }
2214
-
2215
- // ../blocks/src/system/runtime/nodes/event-registration/registrationEventAdapter.ts
2216
- function toRegistrationEvent(event) {
2217
- return {
2218
- ...event,
2219
- publicEventId: event.id,
2220
- registrationOccurrenceId: event.occurrenceId
2221
- };
2222
- }
2223
- function toRegistrationEvents(events) {
2224
- return events.map(toRegistrationEvent);
2225
- }
2226
-
2227
2216
  // ../blocks/src/system/runtime/nodes/event-registration/useEventRegistrationWizard.ts
2228
2217
  function useEventRegistrationWizard(options) {
2229
2218
  const api = useBlockApi();
@@ -2442,7 +2431,7 @@ function useEventRegistrationWizard(options) {
2442
2431
  );
2443
2432
  const ticketTypeSelectionRequired = useMemo(() => {
2444
2433
  const event = selectedEvent ?? preSelectedEvent;
2445
- if (!event || publicEventPricingMode(event.pricing) !== "ticket_types") {
2434
+ if (!event || publicEventPricingMode(resolveRuntimeEventPricing(event)) !== "ticket_types") {
2446
2435
  return false;
2447
2436
  }
2448
2437
  if ((event.deliveryMode ?? "in_person") === "hybrid" && !selectedAttendanceMode) {
@@ -2457,7 +2446,7 @@ function useEventRegistrationWizard(options) {
2457
2446
  );
2458
2447
  useEffect(() => {
2459
2448
  const event = selectedEvent ?? preSelectedEvent;
2460
- if (!event || publicEventPricingMode(event.pricing) !== "ticket_types") {
2449
+ if (!event || publicEventPricingMode(resolveRuntimeEventPricing(event)) !== "ticket_types") {
2461
2450
  if (selectedTicketTypeId !== null) {
2462
2451
  setSelectedTicketTypeId(null);
2463
2452
  }
@@ -2517,43 +2506,72 @@ function useEventRegistrationWizard(options) {
2517
2506
  );
2518
2507
  const handleDetailsComplete = async () => {
2519
2508
  if (ticketTypeSelectionRequired && !hasValidSelectedTicketType) {
2520
- setErrorMessage("Select a ticket type to continue.");
2509
+ const message = "Select a ticket type to continue.";
2510
+ setErrorMessage(message);
2521
2511
  setStep("error");
2522
- return;
2512
+ return { ok: false, reason: "blocked", message };
2523
2513
  }
2524
2514
  if (!validateForm()) {
2525
2515
  setGuestSectionShake(true);
2526
- return;
2516
+ return {
2517
+ ok: false,
2518
+ reason: "validation-failed",
2519
+ message: "Check the highlighted fields and try again."
2520
+ };
2527
2521
  }
2528
2522
  if (waitlistClaim.claim === null && eligibility?.isFull && !eligibility.canJoinWaitlist) {
2529
- setErrorMessage("This event is sold out.");
2523
+ const message = "This event is sold out.";
2524
+ setErrorMessage(message);
2530
2525
  setStep("error");
2531
- return;
2526
+ return { ok: false, reason: "blocked", message };
2532
2527
  }
2533
- if (eligibility?.canJoinWaitlist) {
2534
- await handleSubmit("free", void 0, void 0, paymentSelection.method ? paymentSelection : void 0);
2535
- return;
2528
+ const shouldCollectPayment = !eligibility?.canJoinWaitlist && requiresPaymentStep({ eventRequiresPayment, paymentSelection });
2529
+ if (shouldCollectPayment) {
2530
+ setStep("select-payment");
2531
+ return { ok: true, outcome: "payment-step" };
2536
2532
  }
2537
- if (paymentSelection.method === "pass" && paymentSelection.passId) {
2538
- await handleSubmit("pass", paymentSelection.passId, void 0, paymentSelection);
2539
- return;
2533
+ const submitPlan = resolveEventRegistrationSubmitPlan({
2534
+ paymentSelection,
2535
+ eventRequiresPayment,
2536
+ canJoinWaitlist: eligibility?.canJoinWaitlist
2537
+ });
2538
+ if (!submitPlan.ok) {
2539
+ setErrorMessage(submitPlan.message);
2540
+ setStep("error");
2541
+ return { ok: false, reason: "blocked", message: submitPlan.message };
2540
2542
  }
2541
- if (paymentSelection.method === "membership" && paymentSelection.membershipId) {
2542
- await handleSubmit("membership", void 0, paymentSelection.membershipId, paymentSelection);
2543
- return;
2543
+ const submitResult = await handleSubmit(
2544
+ submitPlan.args.method,
2545
+ submitPlan.args.passId,
2546
+ submitPlan.args.membershipId,
2547
+ submitPlan.args.selection
2548
+ );
2549
+ if (!submitResult.ok) {
2550
+ return {
2551
+ ok: false,
2552
+ reason: submitResult.reason === "submission-failed" ? "submission-failed" : "blocked",
2553
+ message: submitResult.message
2554
+ };
2544
2555
  }
2545
- if (paymentSelection.method === "free" || !eventRequiresPayment) {
2546
- await handleSubmit("free", void 0, void 0, paymentSelection.method ? paymentSelection : void 0);
2556
+ return { ok: true, outcome: "submitted" };
2557
+ };
2558
+ const handlePaymentSelect = async () => {
2559
+ const submitPlan = resolveEventRegistrationSubmitPlan({
2560
+ paymentSelection,
2561
+ eventRequiresPayment,
2562
+ canJoinWaitlist: eligibility?.canJoinWaitlist
2563
+ });
2564
+ if (!submitPlan.ok) {
2565
+ setErrorMessage(submitPlan.message);
2566
+ setStep("error");
2547
2567
  return;
2548
2568
  }
2549
- if (requiresPaymentStep({ eventRequiresPayment: true, paymentSelection })) {
2550
- setStep("select-payment");
2551
- } else {
2552
- await handleSubmit("stripe", void 0, void 0, paymentSelection.method ? paymentSelection : void 0);
2553
- }
2554
- };
2555
- const handlePaymentSelect = async (method, passId, membershipId) => {
2556
- await handleSubmit(method, passId, membershipId, paymentSelection.method ? paymentSelection : void 0);
2569
+ await handleSubmit(
2570
+ submitPlan.args.method,
2571
+ submitPlan.args.passId,
2572
+ submitPlan.args.membershipId,
2573
+ submitPlan.args.selection
2574
+ );
2557
2575
  };
2558
2576
  const handleUseCardInsteadOfPass = () => {
2559
2577
  dispatchFlow({ type: "use-card-instead-of-pass" });
@@ -2577,7 +2595,7 @@ function useEventRegistrationWizard(options) {
2577
2595
  const discountSubtotalCents = useMemo(() => {
2578
2596
  if (discountContext?.type !== "event") return void 0;
2579
2597
  const event = selectedEvent ?? preSelectedEvent;
2580
- const eventPriceCents = selectedTicketType?.priceAmount ?? eligibility?.price ?? (event ? publicEventScalarPrice(event.pricing) : null) ?? 0;
2598
+ const eventPriceCents = selectedTicketType?.priceAmount ?? eligibility?.price ?? (event ? publicEventScalarPrice(resolveRuntimeEventPricing(event)) : null) ?? 0;
2581
2599
  return Math.max(0, eventPriceCents * ticketsCount);
2582
2600
  }, [discountContext, selectedTicketType, eligibility, selectedEvent, preSelectedEvent, ticketsCount]);
2583
2601
  const discountUi = useDiscountCodeUi({ api, discountContext, subtotalCents: discountSubtotalCents });
@@ -2665,6 +2683,7 @@ function useEventRegistrationWizard(options) {
2665
2683
  altchaSolution,
2666
2684
  setAltchaSolution,
2667
2685
  portalAuthState,
2686
+ portalProfile,
2668
2687
  showMagicLinkModal,
2669
2688
  setShowMagicLinkModal,
2670
2689
  handleLogout,
@@ -2679,6 +2698,7 @@ function useEventRegistrationWizard(options) {
2679
2698
  eligibilityError,
2680
2699
  existingRegistration: existingRegistrationResult.registration,
2681
2700
  existingRegistrationLoading: existingRegistrationResult.isLoading,
2701
+ existingRegistrationState: existingRegistrationResult.state,
2682
2702
  hasEligibility,
2683
2703
  hasMembershipEligibility,
2684
2704
  requireGuestDetails,
@@ -2702,6 +2722,8 @@ function useEventRegistrationWizard(options) {
2702
2722
  handleRetry
2703
2723
  };
2704
2724
  }
2725
+
2726
+ // ../blocks/src/system/runtime/nodes/event-registration/constants.ts
2705
2727
  var EVENT_REGISTRATION_ANCHOR_ID = "event-registration";
2706
2728
  var EVENT_PORTAL_AUTH_COPY = {
2707
2729
  membership: {
@@ -2737,7 +2759,7 @@ function EventRegistrationWizard(props) {
2737
2759
  spamProtectionEnabled,
2738
2760
  supportEmail
2739
2761
  } = props;
2740
- const maxTicketsNum = parseInt(maxTickets, 10) || 5;
2762
+ const maxTicketsNum = normalizeEventRegistrationMaxTickets(maxTickets);
2741
2763
  const showSpamProtection = spamProtectionEnabled ?? isSpamProtectionEnabled();
2742
2764
  const buttonClass = themeButtonClassName({ variant: buttonVariant, size: "md" });
2743
2765
  const wizard = useEventRegistrationWizard({
@@ -2750,7 +2772,7 @@ function EventRegistrationWizard(props) {
2750
2772
  if (wizard.scopedEvents.length === 0 && !wizard.occurrenceContext) {
2751
2773
  return /* @__PURE__ */ jsx("div", { id: EVENT_REGISTRATION_ANCHOR_ID, className: `event-registration ${className || ""}`, "data-block": "event-registration", children: /* @__PURE__ */ jsx("div", { className: "er-empty", children: /* @__PURE__ */ jsx("p", { className: "er-empty__text", children: "No events available for registration." }) }) });
2752
2774
  }
2753
- const allowedStatuses = wizard.api.config.isPreview ? ["active", "draft"] : ["active"];
2775
+ const allowedStatuses = getRegistrableStatuses(wizard.api.config.isPreview);
2754
2776
  const hasRegistrableEvents = wizard.scopedEvents.some((event) => !event.status || allowedStatuses.includes(event.status));
2755
2777
  if (!hasRegistrableEvents && !wizard.occurrenceContext) {
2756
2778
  return /* @__PURE__ */ jsx("div", { id: EVENT_REGISTRATION_ANCHOR_ID, className: `event-registration ${className || ""}`, "data-block": "event-registration", children: /* @__PURE__ */ jsx("div", { className: "er-empty", children: /* @__PURE__ */ jsx("p", { className: "er-empty__text", children: "Registration is not currently available for this event." }) }) });
@@ -3085,8 +3107,9 @@ function EventDetailsView({
3085
3107
  priceCents: selected.course.priceCents,
3086
3108
  currency: selected.course.currency
3087
3109
  }) : null;
3088
- const eventPricingType = publicEventPricingType(selected.pricing);
3089
- const eventPricingCurrency = publicEventPricingCurrency(selected.pricing) ?? "USD";
3110
+ const eventPricing = resolveRuntimeEventPricing(selected);
3111
+ const eventPricingType = publicEventPricingType(eventPricing);
3112
+ const eventPricingCurrency = publicEventPricingCurrency(eventPricing) ?? "USD";
3090
3113
  const isPaid = eventPricingType === "paid";
3091
3114
  const shouldShowCoursePricing = showCost && !isDropIn && coursePricing !== null;
3092
3115
  const shouldShowEventCost = showCost && isPaid && !isDropIn && coursePricing === null;