@riverbankcms/sdk 0.84.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 (78) hide show
  1. package/dist/{PreviewEditorSidebar-HML67UDA.mjs → PreviewEditorSidebar-X7RLMEI6.mjs} +2 -2
  2. package/dist/{PreviewEditorUI-I4BQUU6K.mjs → PreviewEditorUI-CT67N4O3.mjs} +2 -2
  3. package/dist/SdkPreviewModeRuntime-EIMQ3S2V.mjs +8 -0
  4. package/dist/_dts/blocks/src/contracts/proof-block-islands.d.ts +4 -4
  5. package/dist/_dts/blocks/src/system/runtime/components/registry.client.d.ts +6 -6
  6. package/dist/_dts/blocks/src/system/runtime/components/runtime-backed-blocks.d.ts +3 -3
  7. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/EventRegistrationWizard.d.ts +0 -2
  8. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/constants.d.ts +1 -0
  9. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/event-registration.headless.contract.d.ts +275 -0
  10. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/event-registration.headless.override.d.ts +10 -0
  11. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/event-registration.headless.planning.d.ts +22 -0
  12. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/event-registration.headless.state.d.ts +3 -303
  13. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationWizard.d.ts +9 -1
  14. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration.interactive.d.ts +8 -6
  15. package/dist/_dts/editor-blocks/src/BlockForm.d.ts +6 -4
  16. package/dist/_dts/sdk/src/version.d.ts +1 -1
  17. package/dist/{chunk-MSHZO4SL.mjs → chunk-O62NDCTI.mjs} +268 -186
  18. package/dist/{chunk-HFMGVJCE.mjs → chunk-QRKJDWT7.mjs} +5 -5
  19. package/dist/{chunk-6X2OVO3S.mjs → chunk-RCTJAZSK.mjs} +1 -1
  20. package/dist/{chunk-5E33VO6J.mjs → chunk-X5ZCSU6F.mjs} +1 -1
  21. package/dist/cli/index.mjs +323 -35
  22. package/dist/cli/init-docs/content/agents-section.md +5 -0
  23. package/dist/cli/init-docs/content/cli-reference.md +13 -0
  24. package/dist/cli/init-docs/content/content-management.md +31 -0
  25. package/dist/cli/init-docs/content/getting-started.md +12 -0
  26. package/dist/cli/init-docs/content/workflow-add-block.md +3 -1
  27. package/dist/cli/init-docs/content/workflow-agent-safe-sync.md +81 -0
  28. package/dist/cli/init-docs/content/workflow-create-page.md +13 -3
  29. package/dist/cli/init-docs/content/workflow-custom-block.md +9 -0
  30. package/dist/cli/init-docs/content/workflow-templates.md +14 -0
  31. package/dist/client/{accordion-ESY65T56.mjs → accordion-2UZPBMYM.mjs} +1 -1
  32. package/dist/client/{bookingForm-JRFNZUHD.mjs → bookingForm-DYXT6YB6.mjs} +3 -3
  33. package/dist/client/bookings.mjs +155 -134
  34. package/dist/client/{carousel-CPR5VWIP.mjs → carousel-QH77HR6X.mjs} +2 -2
  35. package/dist/client/{cart-ZUX5BA7O.mjs → cart-X4YK4FTW.mjs} +5 -5
  36. package/dist/client/{checkout-RULGBADZ.mjs → checkout-OM2BEPWD.mjs} +5 -5
  37. package/dist/client/{chunk-BT6AEIKN.mjs → chunk-3DTWLTXM.mjs} +1 -1
  38. package/dist/client/{chunk-JWEYB4V6.mjs → chunk-4OXKTA3D.mjs} +1 -1
  39. package/dist/client/{chunk-URQCZD5W.mjs → chunk-52CGCQ7B.mjs} +4 -4
  40. package/dist/client/{chunk-52I7BGEK.mjs → chunk-7UCLJ5SP.mjs} +1 -1
  41. package/dist/client/{chunk-Z5OBQ5I4.mjs → chunk-F5VRX5Y6.mjs} +1 -1
  42. package/dist/client/{chunk-RDJFCPY3.mjs → chunk-UHDWIXVR.mjs} +31 -115
  43. package/dist/client/{chunk-HXPWP5EN.mjs → chunk-VGDBVNOO.mjs} +175 -14
  44. package/dist/client/{chunk-5ZEAZ33K.mjs → chunk-ZKUO52W3.mjs} +1 -1
  45. package/dist/client/client.mjs +337 -217
  46. package/dist/client/{courseRegistration-QTUDC35T.mjs → courseRegistration-YBOGURTA.mjs} +3 -3
  47. package/dist/client/{eventCalendar-Q7NS4XLD.mjs → eventCalendar-K4QJVCMD.mjs} +5 -5
  48. package/dist/client/{eventCombined-QAO7VUO5.mjs → eventCombined-MTXGMTCZ.mjs} +5 -5
  49. package/dist/client/{eventDetails-WTNNU6Q3.mjs → eventDetails-3PC4NL3U.mjs} +5 -5
  50. package/dist/client/{eventListing-5TA2ELDT.mjs → eventListing-TFJET6DN.mjs} +5 -5
  51. package/dist/client/{eventRegistration-M6USZGRF.mjs → eventRegistration-QGPBGJTW.mjs} +5 -5
  52. package/dist/client/{form-DGVGXLMH.mjs → form-MDKR4FNB.mjs} +1 -1
  53. package/dist/client/{headerSection-O2AGMPCU.mjs → headerSection-Y5TMR3TW.mjs} +2 -2
  54. package/dist/client/hooks.mjs +315 -35
  55. package/dist/client/{locationMap-EJRNRIKJ.mjs → locationMap-RH2LG7FZ.mjs} +1 -1
  56. package/dist/client/{newsletterForm-7NTC2DTR.mjs → newsletterForm-ZR5UDGBT.mjs} +1 -1
  57. package/dist/client/{productDetail-HH4LP53D.mjs → productDetail-OIGDR4YE.mjs} +5 -5
  58. package/dist/client/{productList-YVHYM2AF.mjs → productList-4MA5S2CX.mjs} +5 -5
  59. package/dist/client/rendering/client.mjs +310 -190
  60. package/dist/client/rendering/islands.mjs +18 -18
  61. package/dist/client/rendering.mjs +310 -190
  62. package/dist/client/{shop-UIFX7XRK.mjs → shop-WXSYV5QO.mjs} +5 -5
  63. package/dist/preview-next/client/runtime.mjs +3 -3
  64. package/dist/{sdk-runtime-ZENAOYMN.mjs → sdk-runtime-7HJYPRWQ.mjs} +4 -4
  65. package/dist/server/components.mjs +188 -61
  66. package/dist/server/config-validation.mjs +313 -33
  67. package/dist/server/config.mjs +313 -33
  68. package/dist/server/data.mjs +315 -35
  69. package/dist/server/index.mjs +1 -1
  70. package/dist/server/next.mjs +189 -62
  71. package/dist/server/page-converter.mjs +315 -35
  72. package/dist/server/prebuild.mjs +1 -1
  73. package/dist/server/rendering/server.mjs +188 -61
  74. package/dist/server/rendering.mjs +188 -61
  75. package/dist/server/routing.mjs +334 -34
  76. package/dist/server/server.mjs +322 -42
  77. package/package.json +1 -1
  78. package/dist/SdkPreviewModeRuntime-MCKMVDTK.mjs +0 -8
@@ -26990,6 +26990,26 @@ var occurrenceContextSchema = z44.object({
26990
26990
  // ../blocks/src/system/runtime/nodes/event-registration.interactive.ts
26991
26991
  import { z as z46 } from "zod";
26992
26992
 
26993
+ // ../blocks/src/system/constants/events.ts
26994
+ var EVENT_CONTENT_TYPE_SLUGS = ["event", "events"];
26995
+ var eventCalendarDisplayModeValues = ["combined", "month", "week", "list", "timetable"];
26996
+ var eventCalendarListLayoutValues = ["stack", "grid", "compact"];
26997
+ var eventCalendarListLayoutOptions = [
26998
+ { id: "stack", label: "Stack" },
26999
+ { id: "grid", label: "Grid" },
27000
+ { id: "compact", label: "Compact" }
27001
+ ];
27002
+ function isEventCalendarDisplayMode(value) {
27003
+ return typeof value === "string" && eventCalendarDisplayModeValues.includes(value);
27004
+ }
27005
+ function isEventCalendarListLayout(value) {
27006
+ return typeof value === "string" && eventCalendarListLayoutValues.includes(value);
27007
+ }
27008
+ function isEventContentType(slug) {
27009
+ if (!slug) return false;
27010
+ return EVENT_CONTENT_TYPE_SLUGS.includes(slug);
27011
+ }
27012
+
26993
27013
  // ../blocks/src/system/runtime/nodes/events/shared/pricing.ts
26994
27014
  var DEFAULT_EVENT_CURRENCY = "USD";
26995
27015
  function resolveRuntimeEventPricing(event) {
@@ -27112,23 +27132,6 @@ function readAmount(value) {
27112
27132
 
27113
27133
  // ../blocks/src/system/runtime/nodes/shared/contract-schemas.ts
27114
27134
  import { z as z45 } from "zod";
27115
-
27116
- // ../blocks/src/system/constants/events.ts
27117
- var eventCalendarDisplayModeValues = ["combined", "month", "week", "list", "timetable"];
27118
- var eventCalendarListLayoutValues = ["stack", "grid", "compact"];
27119
- var eventCalendarListLayoutOptions = [
27120
- { id: "stack", label: "Stack" },
27121
- { id: "grid", label: "Grid" },
27122
- { id: "compact", label: "Compact" }
27123
- ];
27124
- function isEventCalendarDisplayMode(value) {
27125
- return typeof value === "string" && eventCalendarDisplayModeValues.includes(value);
27126
- }
27127
- function isEventCalendarListLayout(value) {
27128
- return typeof value === "string" && eventCalendarListLayoutValues.includes(value);
27129
- }
27130
-
27131
- // ../blocks/src/system/runtime/nodes/shared/contract-schemas.ts
27132
27135
  var previewStageSchema = z45.enum(["preview", "published"]);
27133
27136
  var registrationButtonVariantSchema = z45.enum(["primary", "secondary", "outline"]);
27134
27137
  var eventButtonVariantSchema = z45.enum(["primary", "secondary", "outline", "link"]);
@@ -27139,13 +27142,64 @@ var weekStartSchema = z45.enum(["sunday", "monday"]);
27139
27142
  var filterAutoShowSchema = z45.enum(["auto", "always", "never"]);
27140
27143
  var calendarTabViewsSchema = z45.enum(["both", "month", "week"]);
27141
27144
 
27145
+ // ../blocks/src/system/runtime/nodes/event-registration/wizardSteps.ts
27146
+ function getWizardStepsForContext(hasPreSelectedContext, needsPaymentStep) {
27147
+ const baseSteps = hasPreSelectedContext ? ["select-tickets", "enter-details"] : ["select-event", "select-tickets", "enter-details"];
27148
+ if (!needsPaymentStep) {
27149
+ return baseSteps;
27150
+ }
27151
+ return [...baseSteps, "select-payment"];
27152
+ }
27153
+
27154
+ // ../blocks/src/system/runtime/nodes/event-registration/registrationDerivations.ts
27155
+ function eventMatchesOccurrenceId(event, occurrenceId) {
27156
+ return event.registrationOccurrenceId === occurrenceId || event.publicEventId === occurrenceId;
27157
+ }
27158
+ function findPreSelectedEvent(input) {
27159
+ const occurrenceContext = input.occurrenceContext;
27160
+ if (!occurrenceContext) {
27161
+ return null;
27162
+ }
27163
+ const contextDate = getBookingLocalDateKey(toScheduledBookingDateTime({
27164
+ startsAt: occurrenceContext.startsAt,
27165
+ timeZone: occurrenceContext.timeZone
27166
+ }));
27167
+ return input.scopedEvents.find(
27168
+ (event) => eventMatchesOccurrenceId(event, occurrenceContext.id) || getBookingLocalDateKey(toScheduledBookingDateTime({
27169
+ startsAt: event.startsAt,
27170
+ timeZone: event.timeZone
27171
+ })) === contextDate
27172
+ ) ?? null;
27173
+ }
27174
+ function resolveEventRequiresPayment(input) {
27175
+ if (input.eligibility) {
27176
+ return input.eligibility.requiresPayment;
27177
+ }
27178
+ if (input.selectedTicketType) {
27179
+ return input.selectedTicketType.priceAmount > 0;
27180
+ }
27181
+ if (!input.event) {
27182
+ return false;
27183
+ }
27184
+ return publicEventPricingType(resolveRuntimeEventPricing(input.event)) !== "free";
27185
+ }
27186
+
27187
+ // ../blocks/src/system/runtime/nodes/event-registration/registrationEventAdapter.ts
27188
+ function toRegistrationEvent(event) {
27189
+ return {
27190
+ ...event,
27191
+ pricing: resolveRuntimeEventPricing(event),
27192
+ publicEventId: event.id,
27193
+ registrationOccurrenceId: event.occurrenceId
27194
+ };
27195
+ }
27196
+ function toRegistrationEvents(events) {
27197
+ return events.map(toRegistrationEvent);
27198
+ }
27199
+
27142
27200
  // ../blocks/src/system/runtime/nodes/event-registration.interactive.ts
27143
27201
  var EVENT_REGISTRATION_GENERIC_SHELL_STEP_LABELS = ["Date", "Tickets", "Details"];
27144
- var [
27145
- eventRegistrationGenericDateStepLabel,
27146
- eventRegistrationGenericTicketsStepLabel,
27147
- eventRegistrationGenericDetailsStepLabel
27148
- ] = EVENT_REGISTRATION_GENERIC_SHELL_STEP_LABELS;
27202
+ var EVENT_REGISTRATION_SHELL_STEP_LABELS = ["Event", "Date", "Tickets", "Details", "Payment"];
27149
27203
  var contentEntrySchema = z46.object({
27150
27204
  id: z46.string(),
27151
27205
  slug: z46.string(),
@@ -27181,11 +27235,7 @@ var eventRegistrationDisplaySchema = z46.object({
27181
27235
  className: z46.string().nullable(),
27182
27236
  titleText: z46.string(),
27183
27237
  bodyText: z46.string(),
27184
- stepLabels: z46.tuple([
27185
- z46.literal(eventRegistrationGenericDateStepLabel),
27186
- z46.literal(eventRegistrationGenericTicketsStepLabel),
27187
- z46.literal(eventRegistrationGenericDetailsStepLabel)
27188
- ]),
27238
+ stepLabels: z46.array(z46.enum(EVENT_REGISTRATION_SHELL_STEP_LABELS)).min(1),
27189
27239
  summaryButtonText: z46.string()
27190
27240
  });
27191
27241
  var eventRegistrationHydrationSchema = z46.object({
@@ -27220,16 +27270,81 @@ var eventRegistrationIslandMetaKeys = defineInteractiveIslandMetaKeys(
27220
27270
  "stage"
27221
27271
  );
27222
27272
  function buildEventRegistrationDisplay(source) {
27273
+ const stepLabels = buildEventRegistrationShellStepLabels(source);
27223
27274
  return {
27224
27275
  kind: "event-registration",
27225
27276
  state: "generic-shell",
27226
27277
  className: source.className ?? null,
27227
27278
  titleText: "Event registration",
27228
- bodyText: "Preparing dates, tickets, and booking details.",
27229
- stepLabels: EVENT_REGISTRATION_GENERIC_SHELL_STEP_LABELS,
27279
+ bodyText: buildEventRegistrationShellBodyText(stepLabels),
27280
+ stepLabels,
27230
27281
  summaryButtonText: source.buttonText?.trim() || "Register"
27231
27282
  };
27232
27283
  }
27284
+ function buildEventRegistrationShellStepLabels(source) {
27285
+ const scopedEvents = scopeEventRegistrationEvents(source);
27286
+ if (scopedEvents.length === 0) {
27287
+ return EVENT_REGISTRATION_GENERIC_SHELL_STEP_LABELS;
27288
+ }
27289
+ const preSelectedEvent = findPreSelectedEvent({
27290
+ scopedEvents,
27291
+ occurrenceContext: source.occurrenceContext
27292
+ });
27293
+ const hasPreSelectedContext = Boolean(source.occurrenceContext || preSelectedEvent);
27294
+ const needsPaymentStep = hasPreSelectedContext && preSelectedEvent ? resolveEventRequiresPayment({
27295
+ eligibility: null,
27296
+ selectedTicketType: null,
27297
+ event: preSelectedEvent
27298
+ }) : false;
27299
+ return getWizardStepsForContext(hasPreSelectedContext, needsPaymentStep).map((step) => shellLabelForRegistrationStep(step, scopedEvents));
27300
+ }
27301
+ function scopeEventRegistrationEvents(source) {
27302
+ const events = toRegistrationEvents(source.events ?? []);
27303
+ if (source.occurrenceContext?.seriesId) {
27304
+ return events.filter((event) => event.seriesId === source.occurrenceContext?.seriesId);
27305
+ }
27306
+ const entrySlug = source.contentEntry?.slug;
27307
+ const entryContentType = source.contentEntry?.contentTypeSlug;
27308
+ if (entrySlug && entryContentType && isEventContentType(entryContentType)) {
27309
+ return events.filter((event) => event.slug === entrySlug);
27310
+ }
27311
+ return events;
27312
+ }
27313
+ function shellLabelForRegistrationStep(step, events) {
27314
+ switch (step) {
27315
+ case "select-event":
27316
+ return isDateSelection(events) ? "Date" : "Event";
27317
+ case "select-tickets":
27318
+ return "Tickets";
27319
+ case "enter-details":
27320
+ return "Details";
27321
+ case "select-payment":
27322
+ return "Payment";
27323
+ case "error":
27324
+ case "success":
27325
+ case "submitting":
27326
+ case "redirecting":
27327
+ case "verifying-payment":
27328
+ case "verifying-timeout":
27329
+ case "payment-failed":
27330
+ return "Details";
27331
+ }
27332
+ }
27333
+ function isDateSelection(events) {
27334
+ const firstSeriesId = events[0]?.seriesId;
27335
+ return Boolean(
27336
+ events.length > 1 && firstSeriesId && events.every((event) => event.seriesId === firstSeriesId)
27337
+ );
27338
+ }
27339
+ function buildEventRegistrationShellBodyText(stepLabels) {
27340
+ if (stepLabels.includes("Payment")) {
27341
+ return "Preparing tickets, details, and payment options.";
27342
+ }
27343
+ if (stepLabels[0] === "Tickets") {
27344
+ return "Preparing tickets and booking details.";
27345
+ }
27346
+ return "Preparing dates, tickets, and booking details.";
27347
+ }
27233
27348
  var eventRegistrationBlockRuntime = defineClientOwnedBlockRuntime({
27234
27349
  kind: "client-owned",
27235
27350
  contracts: {
@@ -42577,6 +42692,9 @@ var EventListingSSR = (props2) => {
42577
42692
  ] });
42578
42693
  };
42579
42694
 
42695
+ // ../blocks/src/system/runtime/nodes/event-registration/constants.ts
42696
+ var EVENT_REGISTRATION_ANCHOR_ID = "event-registration";
42697
+
42580
42698
  // ../blocks/src/system/runtime/nodes/event-registration.server.tsx
42581
42699
  import { jsx as jsx48, jsxs as jsxs34 } from "react/jsx-runtime";
42582
42700
  function cx(...classes) {
@@ -42645,42 +42763,51 @@ function EventRegistrationSSR({
42645
42763
  function EventRegistrationShell({
42646
42764
  display
42647
42765
  }) {
42648
- return /* @__PURE__ */ jsx48("div", { className: "er-container er-registration-shell", "aria-busy": "true", role: "status", children: /* @__PURE__ */ jsxs34("div", { className: "er-payment-layout er-payment-layout--no-sidebar", children: [
42649
- /* @__PURE__ */ jsxs34("div", { className: "er-payment-layout-main", children: [
42650
- /* @__PURE__ */ jsx48("div", { className: "er-steps-nav er-registration-shell__steps", "aria-hidden": "true", children: /* @__PURE__ */ jsx48("ol", { className: "er-steps", children: display.stepLabels.map((label, index) => {
42651
- const isActive = index === 0;
42652
- return /* @__PURE__ */ jsxs34("li", { className: "er-step", children: [
42653
- /* @__PURE__ */ jsx48("span", { className: cx("er-step-circle", isActive && "er-step-circle--active"), children: index + 1 }),
42654
- /* @__PURE__ */ jsx48("span", { className: cx("er-step-label", isActive && "er-step-label--active"), children: label }),
42655
- index < display.stepLabels.length - 1 ? /* @__PURE__ */ jsx48("span", { className: "er-step-connector" }) : null
42656
- ] }, label);
42657
- }) }) }),
42658
- /* @__PURE__ */ jsxs34("div", { className: "er-stack", children: [
42659
- /* @__PURE__ */ jsxs34("div", { children: [
42660
- /* @__PURE__ */ jsx48("p", { className: "er-registration-shell__eyebrow", children: "Registration" }),
42661
- /* @__PURE__ */ jsx48("h3", { className: "er-title er-registration-shell__title", children: display.titleText }),
42662
- /* @__PURE__ */ jsx48("p", { className: "er-text er-text--muted er-registration-shell__copy", children: display.bodyText })
42766
+ return /* @__PURE__ */ jsx48(
42767
+ "div",
42768
+ {
42769
+ id: EVENT_REGISTRATION_ANCHOR_ID,
42770
+ className: "er-container er-registration-shell",
42771
+ "aria-busy": "true",
42772
+ role: "status",
42773
+ children: /* @__PURE__ */ jsxs34("div", { className: "er-payment-layout er-payment-layout--no-sidebar", children: [
42774
+ /* @__PURE__ */ jsxs34("div", { className: "er-payment-layout-main", children: [
42775
+ /* @__PURE__ */ jsx48("div", { className: "er-steps-nav er-registration-shell__steps", "aria-hidden": "true", children: /* @__PURE__ */ jsx48("ol", { className: "er-steps", children: display.stepLabels.map((label, index) => {
42776
+ const isActive = index === 0;
42777
+ return /* @__PURE__ */ jsxs34("li", { className: "er-step", children: [
42778
+ /* @__PURE__ */ jsx48("span", { className: cx("er-step-circle", isActive && "er-step-circle--active"), children: index + 1 }),
42779
+ /* @__PURE__ */ jsx48("span", { className: cx("er-step-label", isActive && "er-step-label--active"), children: label }),
42780
+ index < display.stepLabels.length - 1 ? /* @__PURE__ */ jsx48("span", { className: "er-step-connector" }) : null
42781
+ ] }, label);
42782
+ }) }) }),
42783
+ /* @__PURE__ */ jsxs34("div", { className: "er-stack", children: [
42784
+ /* @__PURE__ */ jsxs34("div", { children: [
42785
+ /* @__PURE__ */ jsx48("p", { className: "er-registration-shell__eyebrow", children: "Registration" }),
42786
+ /* @__PURE__ */ jsx48("h3", { className: "er-title er-registration-shell__title", children: display.titleText }),
42787
+ /* @__PURE__ */ jsx48("p", { className: "er-text er-text--muted er-registration-shell__copy", children: display.bodyText })
42788
+ ] }),
42789
+ /* @__PURE__ */ jsxs34("div", { className: "er-event-grid er-registration-shell__cards", "aria-hidden": "true", children: [
42790
+ /* @__PURE__ */ jsxs34("div", { className: "er-event-card er-registration-shell__card", children: [
42791
+ /* @__PURE__ */ jsx48("div", { className: "er-registration-shell__line er-registration-shell__line--lg" }),
42792
+ /* @__PURE__ */ jsx48("div", { className: "er-registration-shell__line er-registration-shell__line--sm" })
42793
+ ] }),
42794
+ /* @__PURE__ */ jsxs34("div", { className: "er-event-card er-registration-shell__card", children: [
42795
+ /* @__PURE__ */ jsx48("div", { className: "er-registration-shell__line er-registration-shell__line--md" }),
42796
+ /* @__PURE__ */ jsx48("div", { className: "er-registration-shell__line er-registration-shell__line--xs" })
42797
+ ] })
42798
+ ] })
42799
+ ] })
42663
42800
  ] }),
42664
- /* @__PURE__ */ jsxs34("div", { className: "er-event-grid er-registration-shell__cards", "aria-hidden": "true", children: [
42665
- /* @__PURE__ */ jsxs34("div", { className: "er-event-card er-registration-shell__card", children: [
42666
- /* @__PURE__ */ jsx48("div", { className: "er-registration-shell__line er-registration-shell__line--lg" }),
42667
- /* @__PURE__ */ jsx48("div", { className: "er-registration-shell__line er-registration-shell__line--sm" })
42668
- ] }),
42669
- /* @__PURE__ */ jsxs34("div", { className: "er-event-card er-registration-shell__card", children: [
42801
+ /* @__PURE__ */ jsx48("div", { className: "er-payment-layout-footer", children: /* @__PURE__ */ jsxs34("div", { className: "er-summary-bar er-registration-shell__summary", "aria-hidden": "true", children: [
42802
+ /* @__PURE__ */ jsxs34("div", { className: "er-summary-bar-info", children: [
42670
42803
  /* @__PURE__ */ jsx48("div", { className: "er-registration-shell__line er-registration-shell__line--md" }),
42671
42804
  /* @__PURE__ */ jsx48("div", { className: "er-registration-shell__line er-registration-shell__line--xs" })
42672
- ] })
42673
- ] })
42805
+ ] }),
42806
+ /* @__PURE__ */ jsx48("div", { className: "er-registration-shell__button-placeholder", children: display.summaryButtonText })
42807
+ ] }) })
42674
42808
  ] })
42675
- ] }),
42676
- /* @__PURE__ */ jsx48("div", { className: "er-payment-layout-footer", children: /* @__PURE__ */ jsxs34("div", { className: "er-summary-bar er-registration-shell__summary", "aria-hidden": "true", children: [
42677
- /* @__PURE__ */ jsxs34("div", { className: "er-summary-bar-info", children: [
42678
- /* @__PURE__ */ jsx48("div", { className: "er-registration-shell__line er-registration-shell__line--md" }),
42679
- /* @__PURE__ */ jsx48("div", { className: "er-registration-shell__line er-registration-shell__line--xs" })
42680
- ] }),
42681
- /* @__PURE__ */ jsx48("div", { className: "er-registration-shell__button-placeholder", children: display.summaryButtonText })
42682
- ] }) })
42683
- ] }) });
42809
+ }
42810
+ );
42684
42811
  }
42685
42812
  var event_registration_server_default = EventRegistrationSSR;
42686
42813
 
@@ -26993,6 +26993,26 @@ var occurrenceContextSchema = z44.object({
26993
26993
  // ../blocks/src/system/runtime/nodes/event-registration.interactive.ts
26994
26994
  import { z as z46 } from "zod";
26995
26995
 
26996
+ // ../blocks/src/system/constants/events.ts
26997
+ var EVENT_CONTENT_TYPE_SLUGS = ["event", "events"];
26998
+ var eventCalendarDisplayModeValues = ["combined", "month", "week", "list", "timetable"];
26999
+ var eventCalendarListLayoutValues = ["stack", "grid", "compact"];
27000
+ var eventCalendarListLayoutOptions = [
27001
+ { id: "stack", label: "Stack" },
27002
+ { id: "grid", label: "Grid" },
27003
+ { id: "compact", label: "Compact" }
27004
+ ];
27005
+ function isEventCalendarDisplayMode(value) {
27006
+ return typeof value === "string" && eventCalendarDisplayModeValues.includes(value);
27007
+ }
27008
+ function isEventCalendarListLayout(value) {
27009
+ return typeof value === "string" && eventCalendarListLayoutValues.includes(value);
27010
+ }
27011
+ function isEventContentType(slug) {
27012
+ if (!slug) return false;
27013
+ return EVENT_CONTENT_TYPE_SLUGS.includes(slug);
27014
+ }
27015
+
26996
27016
  // ../blocks/src/system/runtime/nodes/events/shared/pricing.ts
26997
27017
  var DEFAULT_EVENT_CURRENCY = "USD";
26998
27018
  function resolveRuntimeEventPricing(event) {
@@ -27115,23 +27135,6 @@ function readAmount(value) {
27115
27135
 
27116
27136
  // ../blocks/src/system/runtime/nodes/shared/contract-schemas.ts
27117
27137
  import { z as z45 } from "zod";
27118
-
27119
- // ../blocks/src/system/constants/events.ts
27120
- var eventCalendarDisplayModeValues = ["combined", "month", "week", "list", "timetable"];
27121
- var eventCalendarListLayoutValues = ["stack", "grid", "compact"];
27122
- var eventCalendarListLayoutOptions = [
27123
- { id: "stack", label: "Stack" },
27124
- { id: "grid", label: "Grid" },
27125
- { id: "compact", label: "Compact" }
27126
- ];
27127
- function isEventCalendarDisplayMode(value) {
27128
- return typeof value === "string" && eventCalendarDisplayModeValues.includes(value);
27129
- }
27130
- function isEventCalendarListLayout(value) {
27131
- return typeof value === "string" && eventCalendarListLayoutValues.includes(value);
27132
- }
27133
-
27134
- // ../blocks/src/system/runtime/nodes/shared/contract-schemas.ts
27135
27138
  var previewStageSchema = z45.enum(["preview", "published"]);
27136
27139
  var registrationButtonVariantSchema = z45.enum(["primary", "secondary", "outline"]);
27137
27140
  var eventButtonVariantSchema = z45.enum(["primary", "secondary", "outline", "link"]);
@@ -27142,13 +27145,64 @@ var weekStartSchema = z45.enum(["sunday", "monday"]);
27142
27145
  var filterAutoShowSchema = z45.enum(["auto", "always", "never"]);
27143
27146
  var calendarTabViewsSchema = z45.enum(["both", "month", "week"]);
27144
27147
 
27148
+ // ../blocks/src/system/runtime/nodes/event-registration/wizardSteps.ts
27149
+ function getWizardStepsForContext(hasPreSelectedContext, needsPaymentStep) {
27150
+ const baseSteps = hasPreSelectedContext ? ["select-tickets", "enter-details"] : ["select-event", "select-tickets", "enter-details"];
27151
+ if (!needsPaymentStep) {
27152
+ return baseSteps;
27153
+ }
27154
+ return [...baseSteps, "select-payment"];
27155
+ }
27156
+
27157
+ // ../blocks/src/system/runtime/nodes/event-registration/registrationDerivations.ts
27158
+ function eventMatchesOccurrenceId(event, occurrenceId) {
27159
+ return event.registrationOccurrenceId === occurrenceId || event.publicEventId === occurrenceId;
27160
+ }
27161
+ function findPreSelectedEvent(input) {
27162
+ const occurrenceContext = input.occurrenceContext;
27163
+ if (!occurrenceContext) {
27164
+ return null;
27165
+ }
27166
+ const contextDate = getBookingLocalDateKey(toScheduledBookingDateTime({
27167
+ startsAt: occurrenceContext.startsAt,
27168
+ timeZone: occurrenceContext.timeZone
27169
+ }));
27170
+ return input.scopedEvents.find(
27171
+ (event) => eventMatchesOccurrenceId(event, occurrenceContext.id) || getBookingLocalDateKey(toScheduledBookingDateTime({
27172
+ startsAt: event.startsAt,
27173
+ timeZone: event.timeZone
27174
+ })) === contextDate
27175
+ ) ?? null;
27176
+ }
27177
+ function resolveEventRequiresPayment(input) {
27178
+ if (input.eligibility) {
27179
+ return input.eligibility.requiresPayment;
27180
+ }
27181
+ if (input.selectedTicketType) {
27182
+ return input.selectedTicketType.priceAmount > 0;
27183
+ }
27184
+ if (!input.event) {
27185
+ return false;
27186
+ }
27187
+ return publicEventPricingType(resolveRuntimeEventPricing(input.event)) !== "free";
27188
+ }
27189
+
27190
+ // ../blocks/src/system/runtime/nodes/event-registration/registrationEventAdapter.ts
27191
+ function toRegistrationEvent(event) {
27192
+ return {
27193
+ ...event,
27194
+ pricing: resolveRuntimeEventPricing(event),
27195
+ publicEventId: event.id,
27196
+ registrationOccurrenceId: event.occurrenceId
27197
+ };
27198
+ }
27199
+ function toRegistrationEvents(events) {
27200
+ return events.map(toRegistrationEvent);
27201
+ }
27202
+
27145
27203
  // ../blocks/src/system/runtime/nodes/event-registration.interactive.ts
27146
27204
  var EVENT_REGISTRATION_GENERIC_SHELL_STEP_LABELS = ["Date", "Tickets", "Details"];
27147
- var [
27148
- eventRegistrationGenericDateStepLabel,
27149
- eventRegistrationGenericTicketsStepLabel,
27150
- eventRegistrationGenericDetailsStepLabel
27151
- ] = EVENT_REGISTRATION_GENERIC_SHELL_STEP_LABELS;
27205
+ var EVENT_REGISTRATION_SHELL_STEP_LABELS = ["Event", "Date", "Tickets", "Details", "Payment"];
27152
27206
  var contentEntrySchema = z46.object({
27153
27207
  id: z46.string(),
27154
27208
  slug: z46.string(),
@@ -27184,11 +27238,7 @@ var eventRegistrationDisplaySchema = z46.object({
27184
27238
  className: z46.string().nullable(),
27185
27239
  titleText: z46.string(),
27186
27240
  bodyText: z46.string(),
27187
- stepLabels: z46.tuple([
27188
- z46.literal(eventRegistrationGenericDateStepLabel),
27189
- z46.literal(eventRegistrationGenericTicketsStepLabel),
27190
- z46.literal(eventRegistrationGenericDetailsStepLabel)
27191
- ]),
27241
+ stepLabels: z46.array(z46.enum(EVENT_REGISTRATION_SHELL_STEP_LABELS)).min(1),
27192
27242
  summaryButtonText: z46.string()
27193
27243
  });
27194
27244
  var eventRegistrationHydrationSchema = z46.object({
@@ -27223,16 +27273,81 @@ var eventRegistrationIslandMetaKeys = defineInteractiveIslandMetaKeys(
27223
27273
  "stage"
27224
27274
  );
27225
27275
  function buildEventRegistrationDisplay(source) {
27276
+ const stepLabels = buildEventRegistrationShellStepLabels(source);
27226
27277
  return {
27227
27278
  kind: "event-registration",
27228
27279
  state: "generic-shell",
27229
27280
  className: source.className ?? null,
27230
27281
  titleText: "Event registration",
27231
- bodyText: "Preparing dates, tickets, and booking details.",
27232
- stepLabels: EVENT_REGISTRATION_GENERIC_SHELL_STEP_LABELS,
27282
+ bodyText: buildEventRegistrationShellBodyText(stepLabels),
27283
+ stepLabels,
27233
27284
  summaryButtonText: source.buttonText?.trim() || "Register"
27234
27285
  };
27235
27286
  }
27287
+ function buildEventRegistrationShellStepLabels(source) {
27288
+ const scopedEvents = scopeEventRegistrationEvents(source);
27289
+ if (scopedEvents.length === 0) {
27290
+ return EVENT_REGISTRATION_GENERIC_SHELL_STEP_LABELS;
27291
+ }
27292
+ const preSelectedEvent = findPreSelectedEvent({
27293
+ scopedEvents,
27294
+ occurrenceContext: source.occurrenceContext
27295
+ });
27296
+ const hasPreSelectedContext = Boolean(source.occurrenceContext || preSelectedEvent);
27297
+ const needsPaymentStep = hasPreSelectedContext && preSelectedEvent ? resolveEventRequiresPayment({
27298
+ eligibility: null,
27299
+ selectedTicketType: null,
27300
+ event: preSelectedEvent
27301
+ }) : false;
27302
+ return getWizardStepsForContext(hasPreSelectedContext, needsPaymentStep).map((step) => shellLabelForRegistrationStep(step, scopedEvents));
27303
+ }
27304
+ function scopeEventRegistrationEvents(source) {
27305
+ const events = toRegistrationEvents(source.events ?? []);
27306
+ if (source.occurrenceContext?.seriesId) {
27307
+ return events.filter((event) => event.seriesId === source.occurrenceContext?.seriesId);
27308
+ }
27309
+ const entrySlug = source.contentEntry?.slug;
27310
+ const entryContentType = source.contentEntry?.contentTypeSlug;
27311
+ if (entrySlug && entryContentType && isEventContentType(entryContentType)) {
27312
+ return events.filter((event) => event.slug === entrySlug);
27313
+ }
27314
+ return events;
27315
+ }
27316
+ function shellLabelForRegistrationStep(step, events) {
27317
+ switch (step) {
27318
+ case "select-event":
27319
+ return isDateSelection(events) ? "Date" : "Event";
27320
+ case "select-tickets":
27321
+ return "Tickets";
27322
+ case "enter-details":
27323
+ return "Details";
27324
+ case "select-payment":
27325
+ return "Payment";
27326
+ case "error":
27327
+ case "success":
27328
+ case "submitting":
27329
+ case "redirecting":
27330
+ case "verifying-payment":
27331
+ case "verifying-timeout":
27332
+ case "payment-failed":
27333
+ return "Details";
27334
+ }
27335
+ }
27336
+ function isDateSelection(events) {
27337
+ const firstSeriesId = events[0]?.seriesId;
27338
+ return Boolean(
27339
+ events.length > 1 && firstSeriesId && events.every((event) => event.seriesId === firstSeriesId)
27340
+ );
27341
+ }
27342
+ function buildEventRegistrationShellBodyText(stepLabels) {
27343
+ if (stepLabels.includes("Payment")) {
27344
+ return "Preparing tickets, details, and payment options.";
27345
+ }
27346
+ if (stepLabels[0] === "Tickets") {
27347
+ return "Preparing tickets and booking details.";
27348
+ }
27349
+ return "Preparing dates, tickets, and booking details.";
27350
+ }
27236
27351
  var eventRegistrationBlockRuntime = defineClientOwnedBlockRuntime({
27237
27352
  kind: "client-owned",
27238
27353
  contracts: {
@@ -42583,6 +42698,9 @@ var EventListingSSR = (props2) => {
42583
42698
  ] });
42584
42699
  };
42585
42700
 
42701
+ // ../blocks/src/system/runtime/nodes/event-registration/constants.ts
42702
+ var EVENT_REGISTRATION_ANCHOR_ID = "event-registration";
42703
+
42586
42704
  // ../blocks/src/system/runtime/nodes/event-registration.server.tsx
42587
42705
  import { jsx as jsx48, jsxs as jsxs34 } from "react/jsx-runtime";
42588
42706
  function cx(...classes) {
@@ -42651,42 +42769,51 @@ function EventRegistrationSSR({
42651
42769
  function EventRegistrationShell({
42652
42770
  display
42653
42771
  }) {
42654
- return /* @__PURE__ */ jsx48("div", { className: "er-container er-registration-shell", "aria-busy": "true", role: "status", children: /* @__PURE__ */ jsxs34("div", { className: "er-payment-layout er-payment-layout--no-sidebar", children: [
42655
- /* @__PURE__ */ jsxs34("div", { className: "er-payment-layout-main", children: [
42656
- /* @__PURE__ */ jsx48("div", { className: "er-steps-nav er-registration-shell__steps", "aria-hidden": "true", children: /* @__PURE__ */ jsx48("ol", { className: "er-steps", children: display.stepLabels.map((label, index) => {
42657
- const isActive = index === 0;
42658
- return /* @__PURE__ */ jsxs34("li", { className: "er-step", children: [
42659
- /* @__PURE__ */ jsx48("span", { className: cx("er-step-circle", isActive && "er-step-circle--active"), children: index + 1 }),
42660
- /* @__PURE__ */ jsx48("span", { className: cx("er-step-label", isActive && "er-step-label--active"), children: label }),
42661
- index < display.stepLabels.length - 1 ? /* @__PURE__ */ jsx48("span", { className: "er-step-connector" }) : null
42662
- ] }, label);
42663
- }) }) }),
42664
- /* @__PURE__ */ jsxs34("div", { className: "er-stack", children: [
42665
- /* @__PURE__ */ jsxs34("div", { children: [
42666
- /* @__PURE__ */ jsx48("p", { className: "er-registration-shell__eyebrow", children: "Registration" }),
42667
- /* @__PURE__ */ jsx48("h3", { className: "er-title er-registration-shell__title", children: display.titleText }),
42668
- /* @__PURE__ */ jsx48("p", { className: "er-text er-text--muted er-registration-shell__copy", children: display.bodyText })
42772
+ return /* @__PURE__ */ jsx48(
42773
+ "div",
42774
+ {
42775
+ id: EVENT_REGISTRATION_ANCHOR_ID,
42776
+ className: "er-container er-registration-shell",
42777
+ "aria-busy": "true",
42778
+ role: "status",
42779
+ children: /* @__PURE__ */ jsxs34("div", { className: "er-payment-layout er-payment-layout--no-sidebar", children: [
42780
+ /* @__PURE__ */ jsxs34("div", { className: "er-payment-layout-main", children: [
42781
+ /* @__PURE__ */ jsx48("div", { className: "er-steps-nav er-registration-shell__steps", "aria-hidden": "true", children: /* @__PURE__ */ jsx48("ol", { className: "er-steps", children: display.stepLabels.map((label, index) => {
42782
+ const isActive = index === 0;
42783
+ return /* @__PURE__ */ jsxs34("li", { className: "er-step", children: [
42784
+ /* @__PURE__ */ jsx48("span", { className: cx("er-step-circle", isActive && "er-step-circle--active"), children: index + 1 }),
42785
+ /* @__PURE__ */ jsx48("span", { className: cx("er-step-label", isActive && "er-step-label--active"), children: label }),
42786
+ index < display.stepLabels.length - 1 ? /* @__PURE__ */ jsx48("span", { className: "er-step-connector" }) : null
42787
+ ] }, label);
42788
+ }) }) }),
42789
+ /* @__PURE__ */ jsxs34("div", { className: "er-stack", children: [
42790
+ /* @__PURE__ */ jsxs34("div", { children: [
42791
+ /* @__PURE__ */ jsx48("p", { className: "er-registration-shell__eyebrow", children: "Registration" }),
42792
+ /* @__PURE__ */ jsx48("h3", { className: "er-title er-registration-shell__title", children: display.titleText }),
42793
+ /* @__PURE__ */ jsx48("p", { className: "er-text er-text--muted er-registration-shell__copy", children: display.bodyText })
42794
+ ] }),
42795
+ /* @__PURE__ */ jsxs34("div", { className: "er-event-grid er-registration-shell__cards", "aria-hidden": "true", children: [
42796
+ /* @__PURE__ */ jsxs34("div", { className: "er-event-card er-registration-shell__card", children: [
42797
+ /* @__PURE__ */ jsx48("div", { className: "er-registration-shell__line er-registration-shell__line--lg" }),
42798
+ /* @__PURE__ */ jsx48("div", { className: "er-registration-shell__line er-registration-shell__line--sm" })
42799
+ ] }),
42800
+ /* @__PURE__ */ jsxs34("div", { className: "er-event-card er-registration-shell__card", children: [
42801
+ /* @__PURE__ */ jsx48("div", { className: "er-registration-shell__line er-registration-shell__line--md" }),
42802
+ /* @__PURE__ */ jsx48("div", { className: "er-registration-shell__line er-registration-shell__line--xs" })
42803
+ ] })
42804
+ ] })
42805
+ ] })
42669
42806
  ] }),
42670
- /* @__PURE__ */ jsxs34("div", { className: "er-event-grid er-registration-shell__cards", "aria-hidden": "true", children: [
42671
- /* @__PURE__ */ jsxs34("div", { className: "er-event-card er-registration-shell__card", children: [
42672
- /* @__PURE__ */ jsx48("div", { className: "er-registration-shell__line er-registration-shell__line--lg" }),
42673
- /* @__PURE__ */ jsx48("div", { className: "er-registration-shell__line er-registration-shell__line--sm" })
42674
- ] }),
42675
- /* @__PURE__ */ jsxs34("div", { className: "er-event-card er-registration-shell__card", children: [
42807
+ /* @__PURE__ */ jsx48("div", { className: "er-payment-layout-footer", children: /* @__PURE__ */ jsxs34("div", { className: "er-summary-bar er-registration-shell__summary", "aria-hidden": "true", children: [
42808
+ /* @__PURE__ */ jsxs34("div", { className: "er-summary-bar-info", children: [
42676
42809
  /* @__PURE__ */ jsx48("div", { className: "er-registration-shell__line er-registration-shell__line--md" }),
42677
42810
  /* @__PURE__ */ jsx48("div", { className: "er-registration-shell__line er-registration-shell__line--xs" })
42678
- ] })
42679
- ] })
42811
+ ] }),
42812
+ /* @__PURE__ */ jsx48("div", { className: "er-registration-shell__button-placeholder", children: display.summaryButtonText })
42813
+ ] }) })
42680
42814
  ] })
42681
- ] }),
42682
- /* @__PURE__ */ jsx48("div", { className: "er-payment-layout-footer", children: /* @__PURE__ */ jsxs34("div", { className: "er-summary-bar er-registration-shell__summary", "aria-hidden": "true", children: [
42683
- /* @__PURE__ */ jsxs34("div", { className: "er-summary-bar-info", children: [
42684
- /* @__PURE__ */ jsx48("div", { className: "er-registration-shell__line er-registration-shell__line--md" }),
42685
- /* @__PURE__ */ jsx48("div", { className: "er-registration-shell__line er-registration-shell__line--xs" })
42686
- ] }),
42687
- /* @__PURE__ */ jsx48("div", { className: "er-registration-shell__button-placeholder", children: display.summaryButtonText })
42688
- ] }) })
42689
- ] }) });
42815
+ }
42816
+ );
42690
42817
  }
42691
42818
  var event_registration_server_default = EventRegistrationSSR;
42692
42819