@riverbankcms/sdk 0.60.9 → 0.60.11

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.
@@ -2091,6 +2091,15 @@ var init_augmentManifest = __esm({
2091
2091
 
2092
2092
  // ../theme-core/src/buttons/types.ts
2093
2093
  import { z as z11 } from "zod";
2094
+ function isVariantRole(value) {
2095
+ return VARIANT_ROLES.includes(value);
2096
+ }
2097
+ function asSpecialVariantId(value) {
2098
+ if (value.length === 0) {
2099
+ throw new Error("SpecialVariantId must be a non-empty string");
2100
+ }
2101
+ return value;
2102
+ }
2094
2103
  var VARIANT_ROLES, DEFAULT_VARIANT_ALIAS_ID, cornerStyleSchema, shadowSizeSchema, textTransformSchema, fontWeightSchema, buttonTypographySchema, letterSpacingSchema, hoverTransformSchema, hoverColorSchema, buttonPaddingPresetSchema, gradientStyleSchema, gradientSharpnessSchema, prioritySchema, variantRoleSchema, buttonSizeNameSchema, PADDING_TOKEN_PATTERN, paddingShorthandSchema, buttonSizeConfigSchema, buttonSizesSchema, buttonGlobalSettingsSchema, gradientDirectionSchema, buttonBackgroundSchema, effectApplicationSchema, buttonBorderSchema, variantShadowSchema, variantEffectsSchema, variantSizeOverridesSchema, buttonVariantSchema, buttonSystemSchema;
2095
2104
  var init_types2 = __esm({
2096
2105
  "../theme-core/src/buttons/types.ts"() {
@@ -2877,6 +2886,48 @@ var init_personalities = __esm({
2877
2886
  }
2878
2887
  });
2879
2888
 
2889
+ // ../theme-core/src/buttons/classNames.ts
2890
+ function parseThemeButtonVariantId(value) {
2891
+ const normalized = value?.trim() ?? "";
2892
+ if (normalized.length === 0) {
2893
+ return null;
2894
+ }
2895
+ if (normalized === DEFAULT_VARIANT_ALIAS_ID) {
2896
+ return DEFAULT_VARIANT_ALIAS_ID;
2897
+ }
2898
+ return isVariantRole(normalized) ? normalized : asSpecialVariantId(normalized);
2899
+ }
2900
+ function themeButtonVariantClassNames(variant) {
2901
+ if (variant === DEFAULT_VARIANT_ALIAS_ID) {
2902
+ return [variant];
2903
+ }
2904
+ return [variant, `button-${variant}`];
2905
+ }
2906
+ function themeButtonSizeClassName(size) {
2907
+ return `btn-${size}`;
2908
+ }
2909
+ function themeButtonSelector(variant, size) {
2910
+ const baseSelector = `.${variant}`;
2911
+ if (!size) {
2912
+ return baseSelector;
2913
+ }
2914
+ return `${baseSelector}.${themeButtonSizeClassName(size)}`;
2915
+ }
2916
+ function themeButtonClassName(spec) {
2917
+ const classes = [
2918
+ ...themeButtonVariantClassNames(spec.variant),
2919
+ themeButtonSizeClassName(spec.size),
2920
+ spec.extraClassName
2921
+ ];
2922
+ return classes.filter(Boolean).join(" ");
2923
+ }
2924
+ var init_classNames = __esm({
2925
+ "../theme-core/src/buttons/classNames.ts"() {
2926
+ "use strict";
2927
+ init_types2();
2928
+ }
2929
+ });
2930
+
2880
2931
  // ../theme-core/src/tokens/resolver.ts
2881
2932
  var TokenResolver;
2882
2933
  var init_resolver = __esm({
@@ -4550,17 +4601,25 @@ function resolveAliasSource(enabled) {
4550
4601
  }
4551
4602
  function variantChunks(variant, global, themeSizes, themeId, tokens, theme) {
4552
4603
  const out = [];
4553
- out.push(variantBaseRule(variant, global, themeId, tokens, theme));
4554
- const hoverBg = variantHoverBackgroundRule(variant, global, themeId, tokens);
4604
+ const variantId = parseButtonVariantIdForCss(variant.id);
4605
+ out.push(variantBaseRule(variant, variantId, global, themeId, tokens, theme));
4606
+ const hoverBg = variantHoverBackgroundRule(variant, variantId, global, themeId, tokens);
4555
4607
  if (hoverBg) out.push(hoverBg);
4556
4608
  const effects = variantEffectsCss(variant, themeId, tokens, theme);
4557
4609
  if (effects) out.push({ raw: effects });
4558
- out.push(...variantDisabledRules(variant, themeId));
4559
- out.push(...variantSizeRules(variant, themeSizes, themeId));
4610
+ out.push(...variantDisabledRules(variantId, themeId));
4611
+ out.push(...variantSizeRules(variant, variantId, themeSizes, themeId));
4560
4612
  return out;
4561
4613
  }
4562
- function variantBaseRule(variant, global, themeId, tokens, theme) {
4563
- const selector = `:where([data-theme-scope="${themeId}"]) .${variant.id}`;
4614
+ function parseButtonVariantIdForCss(value) {
4615
+ const variantId = parseThemeButtonVariantId(value);
4616
+ if (!variantId) {
4617
+ throw new Error("Button variant id must be a non-empty string");
4618
+ }
4619
+ return variantId;
4620
+ }
4621
+ function variantBaseRule(variant, variantId, global, themeId, tokens, theme) {
4622
+ const selector = `:where([data-theme-scope="${themeId}"]) ${themeButtonSelector(variantId)}`;
4564
4623
  const decls = [];
4565
4624
  decls.push(["font-weight", String(global.fontWeight)]);
4566
4625
  decls.push(["font-family", resolveFontFamily(global)]);
@@ -4593,13 +4652,13 @@ function variantBaseRule(variant, global, themeId, tokens, theme) {
4593
4652
  }
4594
4653
  return rule(selector, decls);
4595
4654
  }
4596
- function variantHoverBackgroundRule(variant, global, themeId, tokens) {
4655
+ function variantHoverBackgroundRule(variant, variantId, global, themeId, tokens) {
4597
4656
  let hoverToken = variant.hoverBackgroundToken;
4598
4657
  if (!hoverToken && global.hoverColor === "token" && global.hoverColorToken) {
4599
4658
  hoverToken = global.hoverColorToken;
4600
4659
  }
4601
4660
  if (!hoverToken) return null;
4602
- return rule(`:where([data-theme-scope="${themeId}"]) .${variant.id}:hover`, [
4661
+ return rule(`:where([data-theme-scope="${themeId}"]) ${themeButtonSelector(variantId)}:hover`, [
4603
4662
  ["background-color", tokens.getColor(hoverToken)]
4604
4663
  ]);
4605
4664
  }
@@ -4619,8 +4678,8 @@ function variantEffectsCss(variant, themeId, tokens, theme) {
4619
4678
  theme
4620
4679
  });
4621
4680
  }
4622
- function variantDisabledRules(variant, themeId) {
4623
- const base = `:where([data-theme-scope="${themeId}"]) .${variant.id}:disabled`;
4681
+ function variantDisabledRules(variantId, themeId) {
4682
+ const base = `:where([data-theme-scope="${themeId}"]) ${themeButtonSelector(variantId)}:disabled`;
4624
4683
  const disabledSelectors = [base, `${base}:hover`, `${base}:active`, `${base}:focus`];
4625
4684
  const pseudoSelectors = [`${base}::before`, `${base}::after`];
4626
4685
  return [
@@ -4638,12 +4697,12 @@ function variantDisabledRules(variant, themeId) {
4638
4697
  ])
4639
4698
  ];
4640
4699
  }
4641
- function variantSizeRules(variant, themeSizes, themeId) {
4700
+ function variantSizeRules(variant, variantId, themeSizes, themeId) {
4642
4701
  const borderWidth = variant.border ? BORDER_WIDTH_MAP[variant.border.widthClass] || "1px" : "0px";
4643
4702
  const rules = [];
4644
4703
  for (const sizeName of BUTTON_SIZE_NAMES) {
4645
4704
  const config = resolveSizeConfig(variant, sizeName, themeSizes);
4646
- const selector = `:where([data-theme-scope="${themeId}"]) .${variant.id}.btn-${sizeName}`;
4705
+ const selector = `:where([data-theme-scope="${themeId}"]) ${themeButtonSelector(variantId, sizeName)}`;
4647
4706
  const decls = [];
4648
4707
  for (const decl of paddingDeclarations(config.padding, borderWidth)) decls.push(decl);
4649
4708
  if (config.fontSize) {
@@ -4706,6 +4765,7 @@ var init_generateButtonCss = __esm({
4706
4765
  "../theme-core/src/buttons/generateButtonCss.ts"() {
4707
4766
  "use strict";
4708
4767
  init_types2();
4768
+ init_classNames();
4709
4769
  init_resolver();
4710
4770
  init_generateEffectsCSS();
4711
4771
  init_constants();
@@ -4752,6 +4812,7 @@ var init_buttons = __esm({
4752
4812
  "../theme-core/src/buttons/index.ts"() {
4753
4813
  "use strict";
4754
4814
  init_types2();
4815
+ init_classNames();
4755
4816
  init_generateButtonCss();
4756
4817
  init_generateDefaultButtonSystem();
4757
4818
  init_constants();
@@ -14838,19 +14899,6 @@ var init_EventCardIcons = __esm({
14838
14899
  }
14839
14900
  });
14840
14901
 
14841
- // ../blocks/src/system/runtime/shared/themedButtonClass.ts
14842
- function themedButtonClass(spec) {
14843
- const { variant, size, extraClassName } = spec;
14844
- const normalizedVariant = variant.trim();
14845
- const variantClasses = normalizedVariant ? [normalizedVariant, `button-${normalizedVariant}`] : [];
14846
- return [...variantClasses, `btn-${size}`, extraClassName].filter(Boolean).join(" ");
14847
- }
14848
- var init_themedButtonClass = __esm({
14849
- "../blocks/src/system/runtime/shared/themedButtonClass.ts"() {
14850
- "use strict";
14851
- }
14852
- });
14853
-
14854
14902
  // ../blocks/src/system/runtime/nodes/events/shared/EventCard.tsx
14855
14903
  import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
14856
14904
  function formatCapacityText(event, options) {
@@ -14898,7 +14946,7 @@ var init_EventCard = __esm({
14898
14946
  init_EventCardIcons();
14899
14947
  init_eventCapacity();
14900
14948
  init_utils();
14901
- init_themedButtonClass();
14949
+ init_buttons();
14902
14950
  EventCard = ({
14903
14951
  event,
14904
14952
  cardVariant = "default",
@@ -14924,7 +14972,7 @@ var init_EventCard = __esm({
14924
14972
  const isSoldOut = cta.hidden;
14925
14973
  const { available: spotsLeft } = getEventAvailability(event);
14926
14974
  const cardClass = `card-${cardVariant}`;
14927
- const buttonClass = themedButtonClass({ variant: buttonVariant, size: "md" });
14975
+ const buttonClass = themeButtonClassName({ variant: buttonVariant, size: "md" });
14928
14976
  const title = event.title;
14929
14977
  const summary = event.presentation?.summary ?? event.description;
14930
14978
  const image = event.presentation?.image ?? null;
@@ -15006,7 +15054,7 @@ var init_EventCompactRow = __esm({
15006
15054
  "use strict";
15007
15055
  init_utils();
15008
15056
  init_EventCardIcons();
15009
- init_themedButtonClass();
15057
+ init_buttons();
15010
15058
  EventCompactRow = ({
15011
15059
  event,
15012
15060
  buttonVariant = "primary",
@@ -15018,7 +15066,7 @@ var init_EventCompactRow = __esm({
15018
15066
  const price = formatEventPrice(event);
15019
15067
  const teacherLine = formatEventTeacherLine(event);
15020
15068
  const cta = resolveEventCta(event, buttonText);
15021
- const buttonClass = themedButtonClass({ variant: buttonVariant, size: "sm" });
15069
+ const buttonClass = themeButtonClassName({ variant: buttonVariant, size: "sm" });
15022
15070
  return /* @__PURE__ */ jsxs3("div", { className: "event-compact-row", children: [
15023
15071
  /* @__PURE__ */ jsxs3("div", { className: "event-compact-row-content", children: [
15024
15072
  /* @__PURE__ */ jsxs3("div", { className: "event-compact-row-top", children: [
@@ -19318,11 +19366,12 @@ var init_basic = __esm({
19318
19366
  }
19319
19367
  return null;
19320
19368
  }
19321
- const resolvedVariantId = typeof variantId === "string" ? variantId.trim() : "";
19322
- const normalizedVariantId = resolvedVariantId === DEFAULT_VARIANT_ALIAS_ID ? "" : resolvedVariantId;
19323
- const variantClasses = normalizedVariantId ? [normalizedVariantId, `button-${normalizedVariantId}`] : [];
19324
- const sizeClass = `btn-${size}`;
19325
- const combinedClassName = [...variantClasses, sizeClass, className].filter(Boolean).join(" ");
19369
+ const resolvedVariantId = parseThemeButtonVariantId(variantId);
19370
+ const combinedClassName = resolvedVariantId ? themeButtonClassName({
19371
+ variant: resolvedVariantId,
19372
+ size,
19373
+ extraClassName: className
19374
+ }) : className;
19326
19375
  if (resolvedHref) {
19327
19376
  return /* @__PURE__ */ jsx15(
19328
19377
  "a",
@@ -20275,7 +20324,7 @@ function FileDownloadNode({
20275
20324
  {
20276
20325
  href,
20277
20326
  download: filename,
20278
- className: themedButtonClass({
20327
+ className: themeButtonClassName({
20279
20328
  variant,
20280
20329
  size: "md",
20281
20330
  extraClassName: "rb-inline-flex rb-shrink-0 rb-items-center rb-justify-center rb-gap-2"
@@ -20295,7 +20344,7 @@ var init_file_download = __esm({
20295
20344
  init_lucide_react();
20296
20345
  init_colorStyles();
20297
20346
  init_media();
20298
- init_themedButtonClass();
20347
+ init_buttons();
20299
20348
  init_media2();
20300
20349
  FILE_DOWNLOAD_BUTTON_VARIANTS = ["primary", "secondary", "outline", "link"];
20301
20350
  }
@@ -22527,7 +22576,7 @@ var init_EventSpotlight = __esm({
22527
22576
  "../blocks/src/system/runtime/nodes/events/EventSpotlight.tsx"() {
22528
22577
  "use strict";
22529
22578
  init_shared5();
22530
- init_themedButtonClass();
22579
+ init_buttons();
22531
22580
  EventSpotlight = ({
22532
22581
  events,
22533
22582
  layout = "grid",
@@ -22549,7 +22598,7 @@ var init_EventSpotlight = __esm({
22549
22598
  }
22550
22599
  const containerClass = getContainerClass(layout, columns);
22551
22600
  const cardOrientation = getCardOrientation(layout);
22552
- const buttonClass = themedButtonClass({ variant: buttonVariant, size: "md" });
22601
+ const buttonClass = themeButtonClassName({ variant: buttonVariant, size: "md" });
22553
22602
  return /* @__PURE__ */ jsxs19("div", { className: `event-spotlight-section ${className || ""}`, "data-block": "event-spotlight", children: [
22554
22603
  /* @__PURE__ */ jsx32("div", { className: `event-spotlight ${containerClass}`, children: normalizedEvents.map((event) => /* @__PURE__ */ jsx32(
22555
22604
  EventCard,
@@ -23078,7 +23127,16 @@ var init_view3 = __esm({
23078
23127
  import { Fragment as Fragment5, jsx as jsx36, jsxs as jsxs22 } from "react/jsx-runtime";
23079
23128
  function renderServerPendingAction(label, soldOut) {
23080
23129
  return /* @__PURE__ */ jsxs22(Fragment5, { children: [
23081
- /* @__PURE__ */ jsx36("button", { type: "button", className: "default", disabled: true, "aria-disabled": "true", children: soldOut ? "Sold out" : label }),
23130
+ /* @__PURE__ */ jsx36(
23131
+ "button",
23132
+ {
23133
+ type: "button",
23134
+ className: themeButtonClassName({ variant: "default", size: "md" }),
23135
+ disabled: true,
23136
+ "aria-disabled": "true",
23137
+ children: soldOut ? "Sold out" : label
23138
+ }
23139
+ ),
23082
23140
  !soldOut ? /* @__PURE__ */ jsx36("p", { className: "rb-caption status-muted", children: "Cart actions become interactive after page load." }) : null
23083
23141
  ] });
23084
23142
  }
@@ -23098,7 +23156,14 @@ function ProductListServerContent(props2) {
23098
23156
  ),
23099
23157
  actions: /* @__PURE__ */ jsxs22(Fragment5, { children: [
23100
23158
  renderServerPendingAction(card.actionLabel, card.soldOut),
23101
- card.path ? /* @__PURE__ */ jsx36("a", { href: card.path, className: "secondary btn-sm", children: "View details" }) : null
23159
+ card.path ? /* @__PURE__ */ jsx36(
23160
+ "a",
23161
+ {
23162
+ href: card.path,
23163
+ className: themeButtonClassName({ variant: "secondary", size: "sm" }),
23164
+ children: "View details"
23165
+ }
23166
+ ) : null
23102
23167
  ] })
23103
23168
  },
23104
23169
  card.productId
@@ -23141,6 +23206,7 @@ function CheckoutServerContent(props2) {
23141
23206
  var init_shop_commerce_server = __esm({
23142
23207
  "../blocks/src/system/runtime/nodes/shop-commerce.server.tsx"() {
23143
23208
  "use strict";
23209
+ init_buttons();
23144
23210
  init_RichText();
23145
23211
  init_carousel_server();
23146
23212
  init_richText_coerce();
@@ -23689,7 +23755,7 @@ function renderCalendarGrid(display) {
23689
23755
  "button",
23690
23756
  {
23691
23757
  type: "button",
23692
- className: themedButtonClass({
23758
+ className: themeButtonClassName({
23693
23759
  variant: display.buttonVariant,
23694
23760
  size: "sm"
23695
23761
  }),
@@ -23775,7 +23841,7 @@ function renderTimetableSsr(display) {
23775
23841
  "button",
23776
23842
  {
23777
23843
  type: "button",
23778
- className: themedButtonClass({
23844
+ className: themeButtonClassName({
23779
23845
  variant: display.buttonVariant,
23780
23846
  size: "sm"
23781
23847
  }),
@@ -23903,7 +23969,7 @@ var init_EventCalendar_server = __esm({
23903
23969
  init_renderEventListItem();
23904
23970
  init_utils();
23905
23971
  init_timetableModel();
23906
- init_themedButtonClass();
23972
+ init_buttons();
23907
23973
  EventCalendarSSR = (props2) => {
23908
23974
  const islandProps = buildEventCalendarInteractiveIslandProps(props2);
23909
23975
  const display = islandProps.render.display;
@@ -24034,7 +24100,7 @@ var init_form_server = __esm({
24034
24100
  "use strict";
24035
24101
  init_clsx();
24036
24102
  init_ssr();
24037
- init_themedButtonClass();
24103
+ init_buttons();
24038
24104
  init_form_interactive();
24039
24105
  FormNodeSSR = ({
24040
24106
  blockId,
@@ -24172,7 +24238,7 @@ var init_form_server = __esm({
24172
24238
  "button",
24173
24239
  {
24174
24240
  type: "submit",
24175
- className: themedButtonClass({
24241
+ className: themeButtonClassName({
24176
24242
  variant: "primary",
24177
24243
  size: "md",
24178
24244
  extraClassName: "rb-w-full rb-sm-w-auto"
@@ -24265,7 +24331,7 @@ function NewsletterFormSSR({
24265
24331
  "button",
24266
24332
  {
24267
24333
  type: "submit",
24268
- className: themedButtonClass({ variant: "primary", size: "md" }),
24334
+ className: themeButtonClassName({ variant: "primary", size: "md" }),
24269
24335
  children: display.buttonLabel
24270
24336
  }
24271
24337
  ) })
@@ -24282,7 +24348,7 @@ var init_newsletter_form_server = __esm({
24282
24348
  "use strict";
24283
24349
  init_clsx();
24284
24350
  init_ssr();
24285
- init_themedButtonClass();
24351
+ init_buttons();
24286
24352
  init_newsletter_form_interactive();
24287
24353
  newsletter_form_server_default = NewsletterFormSSR;
24288
24354
  }
@@ -24413,7 +24479,16 @@ function ShopSSR({
24413
24479
  PassCardView,
24414
24480
  {
24415
24481
  display: pass,
24416
- action: /* @__PURE__ */ jsx49("button", { type: "button", className: "default", disabled: true, "aria-disabled": "true", children: pass.actionLabel })
24482
+ action: /* @__PURE__ */ jsx49(
24483
+ "button",
24484
+ {
24485
+ type: "button",
24486
+ className: themeButtonClassName({ variant: "default", size: "md" }),
24487
+ disabled: true,
24488
+ "aria-disabled": "true",
24489
+ children: pass.actionLabel
24490
+ }
24491
+ )
24417
24492
  },
24418
24493
  pass.id
24419
24494
  )),
@@ -24421,7 +24496,16 @@ function ShopSSR({
24421
24496
  MembershipCardView,
24422
24497
  {
24423
24498
  display: membership,
24424
- action: /* @__PURE__ */ jsx49("button", { type: "button", className: "default", disabled: true, "aria-disabled": "true", children: membership.actionLabel })
24499
+ action: /* @__PURE__ */ jsx49(
24500
+ "button",
24501
+ {
24502
+ type: "button",
24503
+ className: themeButtonClassName({ variant: "default", size: "md" }),
24504
+ disabled: true,
24505
+ "aria-disabled": "true",
24506
+ children: membership.actionLabel
24507
+ }
24508
+ )
24425
24509
  },
24426
24510
  membership.id
24427
24511
  ))
@@ -24436,6 +24520,7 @@ var shop_server_default;
24436
24520
  var init_shop_server = __esm({
24437
24521
  "../blocks/src/system/runtime/nodes/shop.server.tsx"() {
24438
24522
  "use strict";
24523
+ init_buttons();
24439
24524
  init_ssr();
24440
24525
  init_view3();
24441
24526
  init_shop_interactive();
@@ -38017,6 +38102,92 @@ function encodePublicProductCategorySelector2(selector) {
38017
38102
  };
38018
38103
  }
38019
38104
  }
38105
+ function isRecord4(value) {
38106
+ return typeof value === "object" && value !== null;
38107
+ }
38108
+ function isJsonResponseContentType(contentType) {
38109
+ if (!contentType) return false;
38110
+ const mimeType = contentType.split(";", 1)[0]?.trim().toLowerCase() ?? "";
38111
+ return mimeType === "application/json" || mimeType.endsWith("+json");
38112
+ }
38113
+ function getResponseContentType(response) {
38114
+ return response.headers.get("content-type");
38115
+ }
38116
+ async function parseJsonBody(response) {
38117
+ const rawText = await response.text();
38118
+ if (rawText.trim().length === 0) {
38119
+ return { kind: "empty-body" };
38120
+ }
38121
+ try {
38122
+ return { kind: "success", value: JSON.parse(rawText) };
38123
+ } catch {
38124
+ return { kind: "invalid-json" };
38125
+ }
38126
+ }
38127
+ function getBlockApiErrorDetails(data) {
38128
+ if (!isRecord4(data)) {
38129
+ return {};
38130
+ }
38131
+ const nestedError = isRecord4(data.error) ? data.error : void 0;
38132
+ const message = typeof nestedError?.message === "string" ? nestedError.message : typeof data.message === "string" ? data.message : void 0;
38133
+ const code = typeof nestedError?.code === "string" ? nestedError.code : typeof data.code === "string" ? data.code : void 0;
38134
+ return { message, code };
38135
+ }
38136
+ function buildUnexpectedJsonResponseMessage(parseResult) {
38137
+ switch (parseResult.kind) {
38138
+ case "empty-body":
38139
+ return "Expected JSON response body but received an empty response";
38140
+ case "invalid-json":
38141
+ return "Expected JSON response but received invalid JSON";
38142
+ }
38143
+ }
38144
+ async function extractErrorDetails(response) {
38145
+ const contentType = getResponseContentType(response);
38146
+ const fallbackMessage = `Request failed: ${response.statusText}`;
38147
+ if (!isJsonResponseContentType(contentType)) {
38148
+ return {
38149
+ message: `${fallbackMessage} (received ${contentType ?? "unknown content type"})`
38150
+ };
38151
+ }
38152
+ const parseResult = await parseJsonBody(response);
38153
+ switch (parseResult.kind) {
38154
+ case "success": {
38155
+ const details = getBlockApiErrorDetails(parseResult.value);
38156
+ return {
38157
+ message: details.message ?? fallbackMessage,
38158
+ code: details.code
38159
+ };
38160
+ }
38161
+ case "invalid-json":
38162
+ return {
38163
+ message: `${fallbackMessage} (received invalid JSON)`
38164
+ };
38165
+ case "empty-body":
38166
+ return {
38167
+ message: `${fallbackMessage} (received an empty response)`
38168
+ };
38169
+ }
38170
+ }
38171
+ async function parseJsonApiResponse(response) {
38172
+ if (response.status === 204 || response.status === 205) {
38173
+ return void 0;
38174
+ }
38175
+ const contentType = getResponseContentType(response);
38176
+ if (!isJsonResponseContentType(contentType)) {
38177
+ throw new BlockApiError(
38178
+ `Expected JSON response but received ${contentType ?? "unknown content type"}`,
38179
+ response.status
38180
+ );
38181
+ }
38182
+ const parseResult = await parseJsonBody(response);
38183
+ if (parseResult.kind !== "success") {
38184
+ throw new BlockApiError(
38185
+ buildUnexpectedJsonResponseMessage(parseResult),
38186
+ response.status
38187
+ );
38188
+ }
38189
+ return parseResult.value;
38190
+ }
38020
38191
  function getAuthHeaders2(auth) {
38021
38192
  switch (auth.type) {
38022
38193
  case "api-key":
@@ -38073,21 +38244,10 @@ function createBlockApi(config) {
38073
38244
  const doFetch = async () => {
38074
38245
  const response = await fetch(url, fetchOptions);
38075
38246
  if (!response.ok) {
38076
- let errorMessage = `Request failed: ${response.statusText}`;
38077
- let errorCode;
38078
- try {
38079
- const errorData = await response.json();
38080
- if (typeof errorData.error?.message === "string") {
38081
- errorMessage = errorData.error.message;
38082
- } else if (typeof errorData.message === "string") {
38083
- errorMessage = errorData.message;
38084
- }
38085
- errorCode = errorData.error?.code || errorData.code;
38086
- } catch {
38087
- }
38088
- throw new BlockApiError(errorMessage, response.status, errorCode);
38247
+ const details = await extractErrorDetails(response);
38248
+ throw new BlockApiError(details.message, response.status, details.code);
38089
38249
  }
38090
- const json = await response.json();
38250
+ const json = await parseJsonApiResponse(response);
38091
38251
  if (isApiSuccessResponse(json)) {
38092
38252
  return json.data;
38093
38253
  }
@@ -41943,7 +42103,7 @@ function MultiStepForm({
41943
42103
  type: "button",
41944
42104
  onClick: goToPrevious,
41945
42105
  disabled: !canGoBack,
41946
- className: "outline btn-md",
42106
+ className: themeButtonClassName({ variant: "outline", size: "md" }),
41947
42107
  children: backButtonLabel
41948
42108
  }
41949
42109
  ),
@@ -41953,7 +42113,11 @@ function MultiStepForm({
41953
42113
  type: "button",
41954
42114
  onClick: goToNext,
41955
42115
  disabled: !canGoNext,
41956
- className: "primary btn-md rb-flex-1",
42116
+ className: themeButtonClassName({
42117
+ variant: "primary",
42118
+ size: "md",
42119
+ extraClassName: "rb-flex-1"
42120
+ }),
41957
42121
  children: [
41958
42122
  (isValidating || isSubmitting) && /* @__PURE__ */ jsx58(
41959
42123
  SpinnerNode,
@@ -42069,6 +42233,7 @@ var init_MultiStepForm = __esm({
42069
42233
  "../blocks/src/system/runtime/components/multi-step/MultiStepForm.tsx"() {
42070
42234
  "use strict";
42071
42235
  "use client";
42236
+ init_buttons();
42072
42237
  init_MultiStepContext();
42073
42238
  init_useMultiStep();
42074
42239
  init_spinner2();
@@ -43331,7 +43496,10 @@ function PaymentOptionSelectionStep({
43331
43496
  "button",
43332
43497
  {
43333
43498
  type: "button",
43334
- className: isSelected ? "primary btn-md" : "outline btn-md",
43499
+ className: themeButtonClassName({
43500
+ variant: isSelected ? "primary" : "outline",
43501
+ size: "md"
43502
+ }),
43335
43503
  style: paymentOptionLayoutStyle,
43336
43504
  onClick: () => updateData({
43337
43505
  selectedAppointmentPackageId: appointmentPackage.customerPassId,
@@ -43380,7 +43548,10 @@ function PaymentOptionSelectionStep({
43380
43548
  "button",
43381
43549
  {
43382
43550
  type: "button",
43383
- className: isSelected ? "primary btn-md" : "outline btn-md",
43551
+ className: themeButtonClassName({
43552
+ variant: isSelected ? "primary" : "outline",
43553
+ size: "md"
43554
+ }),
43384
43555
  style: paymentOptionLayoutStyle,
43385
43556
  onClick: () => updateData({
43386
43557
  selectedAppointmentPackageId: void 0,
@@ -43409,6 +43580,7 @@ var init_PaymentOptionSelectionStep = __esm({
43409
43580
  "../blocks/src/system/runtime/components/booking/PaymentOptionSelectionStep.tsx"() {
43410
43581
  "use strict";
43411
43582
  "use client";
43583
+ init_buttons();
43412
43584
  init_api();
43413
43585
  init_MultiStepContext();
43414
43586
  init_booking_form_state();
@@ -45041,6 +45213,7 @@ var init_booking_form_client = __esm({
45041
45213
  init_noop();
45042
45214
  init_client2();
45043
45215
  init_src3();
45216
+ init_buttons();
45044
45217
  init_api();
45045
45218
  init_MultiStepForm();
45046
45219
  init_SuccessMessage();
@@ -45277,7 +45450,7 @@ var init_booking_form_client = __esm({
45277
45450
  "button",
45278
45451
  {
45279
45452
  type: "button",
45280
- className: "secondary btn-sm",
45453
+ className: themeButtonClassName({ variant: "secondary", size: "sm" }),
45281
45454
  onClick: clearFeedback,
45282
45455
  children: "Dismiss"
45283
45456
  }
@@ -46652,7 +46825,7 @@ var init_PaymentSelectionStep = __esm({
46652
46825
  init_lucide_react();
46653
46826
  init_utils3();
46654
46827
  init_spinner2();
46655
- init_themedButtonClass();
46828
+ init_buttons();
46656
46829
  init_CheckIcon2();
46657
46830
  init_SelectableOptionCard();
46658
46831
  PaymentSelectionStep = ({
@@ -46753,7 +46926,7 @@ var init_PaymentSelectionStep = __esm({
46753
46926
  "button",
46754
46927
  {
46755
46928
  type: "button",
46756
- className: themedButtonClass({ variant: "primary", size: "md" }),
46929
+ className: themeButtonClassName({ variant: "primary", size: "md" }),
46757
46930
  disabled: !email.trim(),
46758
46931
  onClick: onRequestLogin,
46759
46932
  children: "Email me a login link"
@@ -48400,7 +48573,7 @@ function MagicLinkForm({
48400
48573
  "button",
48401
48574
  {
48402
48575
  type: "button",
48403
- className: classPrefix === "cp" ? "secondary" : `${classPrefix}-modal-btn ${classPrefix}-modal-btn--secondary`,
48576
+ className: classPrefix === "cp" ? themeButtonClassName({ variant: "secondary", size: "md" }) : `${classPrefix}-modal-btn ${classPrefix}-modal-btn--secondary`,
48404
48577
  onClick: handleReset,
48405
48578
  children: "Try a different email"
48406
48579
  }
@@ -48428,7 +48601,7 @@ function MagicLinkForm({
48428
48601
  "button",
48429
48602
  {
48430
48603
  type: "submit",
48431
- className: classPrefix === "cp" ? "primary" : `${classPrefix}-modal-btn`,
48604
+ className: classPrefix === "cp" ? themeButtonClassName({ variant: "primary", size: "md" }) : `${classPrefix}-modal-btn`,
48432
48605
  disabled: !email.trim() || loading,
48433
48606
  children: loading ? "Sending..." : buttonText
48434
48607
  }
@@ -48439,6 +48612,7 @@ var init_MagicLinkForm = __esm({
48439
48612
  "../blocks/src/system/runtime/nodes/shared/MagicLinkForm.tsx"() {
48440
48613
  "use strict";
48441
48614
  "use client";
48615
+ init_buttons();
48442
48616
  init_api();
48443
48617
  }
48444
48618
  });
@@ -48464,7 +48638,7 @@ function EventRegistrationWizard(props2) {
48464
48638
  } = props2;
48465
48639
  const maxTicketsNum = parseInt(maxTickets, 10) || 5;
48466
48640
  const showSpamProtection = spamProtectionEnabled ?? isSpamProtectionEnabled();
48467
- const buttonClass = themedButtonClass({ variant: buttonVariant, size: "md" });
48641
+ const buttonClass = themeButtonClassName({ variant: buttonVariant, size: "md" });
48468
48642
  const wizard = useEventRegistrationWizard({
48469
48643
  anchorId: EVENT_REGISTRATION_ANCHOR_ID,
48470
48644
  occurrenceContext: occurrenceContext ?? null,
@@ -48601,7 +48775,7 @@ var init_EventRegistrationWizard = __esm({
48601
48775
  init_useEventRegistrationWizard();
48602
48776
  init_MagicLinkForm();
48603
48777
  init_spinner2();
48604
- init_themedButtonClass();
48778
+ init_buttons();
48605
48779
  init_event_registration3();
48606
48780
  EVENT_REGISTRATION_ANCHOR_ID = "event-registration";
48607
48781
  EVENT_PORTAL_AUTH_COPY = {
@@ -49047,7 +49221,7 @@ function ErrorStep2({
49047
49221
  buttonVariant = "primary",
49048
49222
  onRetry
49049
49223
  }) {
49050
- const buttonClass = themedButtonClass({ variant: buttonVariant, size: "md" });
49224
+ const buttonClass = themeButtonClassName({ variant: buttonVariant, size: "md" });
49051
49225
  return /* @__PURE__ */ jsxs77("div", { className: "cr-error", role: "alert", children: [
49052
49226
  /* @__PURE__ */ jsx106(StateIcon, { variant: "error", children: /* @__PURE__ */ jsx106(CrossIcon, {}) }),
49053
49227
  /* @__PURE__ */ jsx106("h3", { className: "cr-error__title", children: "Enrollment Failed" }),
@@ -49059,7 +49233,7 @@ var init_ErrorStep2 = __esm({
49059
49233
  "../blocks/src/system/runtime/nodes/course-registration/ErrorStep.tsx"() {
49060
49234
  "use strict";
49061
49235
  init_shared7();
49062
- init_themedButtonClass();
49236
+ init_buttons();
49063
49237
  }
49064
49238
  });
49065
49239
 
@@ -49071,7 +49245,7 @@ function VerifyingTimeoutStep2({
49071
49245
  onCheckAgain,
49072
49246
  supportEmail
49073
49247
  }) {
49074
- const buttonClass = themedButtonClass({ variant: buttonVariant, size: "md" });
49248
+ const buttonClass = themeButtonClassName({ variant: buttonVariant, size: "md" });
49075
49249
  return /* @__PURE__ */ jsxs78("div", { className: "cr-error", role: "alert", children: [
49076
49250
  /* @__PURE__ */ jsx107(StateIcon, { variant: "warning", children: /* @__PURE__ */ jsx107(ClockIcon, {}) }),
49077
49251
  /* @__PURE__ */ jsx107("h3", { className: "cr-error__title", children: "Payment Verification Taking Longer" }),
@@ -49088,7 +49262,7 @@ var init_VerifyingTimeoutStep2 = __esm({
49088
49262
  "../blocks/src/system/runtime/nodes/course-registration/VerifyingTimeoutStep.tsx"() {
49089
49263
  "use strict";
49090
49264
  init_shared7();
49091
- init_themedButtonClass();
49265
+ init_buttons();
49092
49266
  }
49093
49267
  });
49094
49268
 
@@ -49100,7 +49274,7 @@ function PaymentFailedStep2({
49100
49274
  buttonVariant = "primary",
49101
49275
  onRetry
49102
49276
  }) {
49103
- const buttonClass = themedButtonClass({ variant: buttonVariant, size: "md" });
49277
+ const buttonClass = themeButtonClassName({ variant: buttonVariant, size: "md" });
49104
49278
  return /* @__PURE__ */ jsxs79("div", { className: "cr-payment-failed", role: "alert", children: [
49105
49279
  /* @__PURE__ */ jsx108(StateIcon, { variant: "error", children: /* @__PURE__ */ jsx108(CrossIcon, {}) }),
49106
49280
  /* @__PURE__ */ jsx108("h3", { className: "cr-payment-failed__title", children: "Payment Failed" }),
@@ -49112,7 +49286,7 @@ var init_PaymentFailedStep2 = __esm({
49112
49286
  "../blocks/src/system/runtime/nodes/course-registration/PaymentFailedStep.tsx"() {
49113
49287
  "use strict";
49114
49288
  init_shared7();
49115
- init_themedButtonClass();
49289
+ init_buttons();
49116
49290
  }
49117
49291
  });
49118
49292
 
@@ -50114,7 +50288,7 @@ function CourseRegistrationWizard(props2) {
50114
50288
  handleRetry,
50115
50289
  handleBookingModeChange
50116
50290
  } = useCourseRegistrationWizard(props2);
50117
- const buttonClass = themedButtonClass({ variant: buttonVariant, size: "md" });
50291
+ const buttonClass = themeButtonClassName({ variant: buttonVariant, size: "md" });
50118
50292
  if (scopedCourses.length === 0) {
50119
50293
  return /* @__PURE__ */ jsx112(
50120
50294
  "div",
@@ -50524,7 +50698,7 @@ var init_CourseRegistrationWizard = __esm({
50524
50698
  init_PaymentFailedStep2();
50525
50699
  init_VerifyingTimeoutStep2();
50526
50700
  init_spinner2();
50527
- init_themedButtonClass();
50701
+ init_buttons();
50528
50702
  }
50529
50703
  });
50530
50704
 
@@ -51258,7 +51432,11 @@ function PassesMembershipsController({ render }) {
51258
51432
  "button",
51259
51433
  {
51260
51434
  type: "button",
51261
- className: "secondary btn-sm shop__return-dismiss",
51435
+ className: themeButtonClassName({
51436
+ variant: "secondary",
51437
+ size: "sm",
51438
+ extraClassName: "shop__return-dismiss"
51439
+ }),
51262
51440
  onClick: () => dispatch({ type: "clearReturnNotice" }),
51263
51441
  children: "Dismiss"
51264
51442
  }
@@ -51275,7 +51453,11 @@ function PassesMembershipsController({ render }) {
51275
51453
  "button",
51276
51454
  {
51277
51455
  type: "button",
51278
- className: "default shop__cta",
51456
+ className: themeButtonClassName({
51457
+ variant: "default",
51458
+ size: "md",
51459
+ extraClassName: "shop__cta"
51460
+ }),
51279
51461
  onClick: () => handleBuyPass(pass),
51280
51462
  children: passDisplay.actionLabel
51281
51463
  }
@@ -51302,7 +51484,11 @@ function PassesMembershipsController({ render }) {
51302
51484
  "button",
51303
51485
  {
51304
51486
  type: "button",
51305
- className: "default shop__cta",
51487
+ className: themeButtonClassName({
51488
+ variant: "default",
51489
+ size: "md",
51490
+ extraClassName: "shop__cta"
51491
+ }),
51306
51492
  onClick: () => handleSubscribe(membership),
51307
51493
  children: membershipDisplay.actionLabel
51308
51494
  }
@@ -51346,12 +51532,20 @@ function PassesMembershipsController({ render }) {
51346
51532
  ] }) : null
51347
51533
  ] }),
51348
51534
  /* @__PURE__ */ jsxs87(ActionRow, { className: "shop__modal-warning-actions", children: [
51349
- /* @__PURE__ */ jsx118("button", { type: "button", className: "secondary", onClick: closeCheckout, children: "Cancel" }),
51350
51535
  /* @__PURE__ */ jsx118(
51351
51536
  "button",
51352
51537
  {
51353
51538
  type: "button",
51354
- className: "default",
51539
+ className: themeButtonClassName({ variant: "secondary", size: "md" }),
51540
+ onClick: closeCheckout,
51541
+ children: "Cancel"
51542
+ }
51543
+ ),
51544
+ /* @__PURE__ */ jsx118(
51545
+ "button",
51546
+ {
51547
+ type: "button",
51548
+ className: themeButtonClassName({ variant: "default", size: "md" }),
51355
51549
  onClick: handleConfirmDuplicate,
51356
51550
  disabled: checkout2.submitting,
51357
51551
  children: checkout2.submitting ? "Processing..." : "Subscribe Anyway"
@@ -51394,8 +51588,25 @@ function PassesMembershipsController({ render }) {
51394
51588
  ] }),
51395
51589
  checkout2.formError ? /* @__PURE__ */ jsx118("p", { className: "shop__modal-error", role: "alert", children: checkout2.formError }) : null,
51396
51590
  /* @__PURE__ */ jsxs87(ActionRow, { className: "shop__modal-actions", children: [
51397
- /* @__PURE__ */ jsx118("button", { type: "button", className: "secondary", onClick: closeCheckout, disabled: checkout2.submitting, children: "Cancel" }),
51398
- /* @__PURE__ */ jsx118("button", { type: "submit", className: "default", disabled: checkout2.submitting, children: checkout2.submitting ? "Processing..." : "Continue to Payment" })
51591
+ /* @__PURE__ */ jsx118(
51592
+ "button",
51593
+ {
51594
+ type: "button",
51595
+ className: themeButtonClassName({ variant: "secondary", size: "md" }),
51596
+ onClick: closeCheckout,
51597
+ disabled: checkout2.submitting,
51598
+ children: "Cancel"
51599
+ }
51600
+ ),
51601
+ /* @__PURE__ */ jsx118(
51602
+ "button",
51603
+ {
51604
+ type: "submit",
51605
+ className: themeButtonClassName({ variant: "default", size: "md" }),
51606
+ disabled: checkout2.submitting,
51607
+ children: checkout2.submitting ? "Processing..." : "Continue to Payment"
51608
+ }
51609
+ )
51399
51610
  ] })
51400
51611
  ] })
51401
51612
  ] })
@@ -51408,6 +51619,7 @@ var init_shop_client = __esm({
51408
51619
  "../blocks/src/system/runtime/nodes/shop.client.tsx"() {
51409
51620
  "use strict";
51410
51621
  "use client";
51622
+ init_buttons();
51411
51623
  init_api();
51412
51624
  init_ModalShell();
51413
51625
  init_shared7();
@@ -51622,7 +51834,7 @@ var init_embla_carousel_autoplay_esm = __esm({
51622
51834
  function isObject(subject) {
51623
51835
  return Object.prototype.toString.call(subject) === "[object Object]";
51624
51836
  }
51625
- function isRecord4(subject) {
51837
+ function isRecord5(subject) {
51626
51838
  return isObject(subject) || Array.isArray(subject);
51627
51839
  }
51628
51840
  function canUseDOM() {
@@ -51639,7 +51851,7 @@ function areOptionsEqual(optionsA, optionsB) {
51639
51851
  const valueA = optionsA[key];
51640
51852
  const valueB = optionsB[key];
51641
51853
  if (typeof valueA === "function") return `${valueA}` === `${valueB}`;
51642
- if (!isRecord4(valueA) || !isRecord4(valueB)) return valueA === valueB;
51854
+ if (!isRecord5(valueA) || !isRecord5(valueB)) return valueA === valueB;
51643
51855
  return areOptionsEqual(valueA, valueB);
51644
51856
  });
51645
51857
  }
@@ -53733,7 +53945,7 @@ function ProductListController(props2) {
53733
53945
  "button",
53734
53946
  {
53735
53947
  type: "button",
53736
- className: "default",
53948
+ className: themeButtonClassName({ variant: "default", size: "md" }),
53737
53949
  onClick: () => {
53738
53950
  const product = props2.render.hydration.products.find((candidate) => candidate.id === card.productId);
53739
53951
  if (!product) return;
@@ -53749,7 +53961,14 @@ function ProductListController(props2) {
53749
53961
  children: card.soldOut ? "Sold out" : card.actionLabel
53750
53962
  }
53751
53963
  ),
53752
- card.path ? /* @__PURE__ */ jsx120("a", { href: card.path, className: "secondary btn-sm", children: "View details" }) : null
53964
+ card.path ? /* @__PURE__ */ jsx120(
53965
+ "a",
53966
+ {
53967
+ href: card.path,
53968
+ className: themeButtonClassName({ variant: "secondary", size: "sm" }),
53969
+ children: "View details"
53970
+ }
53971
+ ) : null
53753
53972
  ] }),
53754
53973
  feedback: /* @__PURE__ */ jsx120(
53755
53974
  ShopAddFeedback,
@@ -53815,7 +54034,7 @@ function ProductDetailController(props2) {
53815
54034
  "button",
53816
54035
  {
53817
54036
  type: "button",
53818
- className: "default",
54037
+ className: themeButtonClassName({ variant: "default", size: "md" }),
53819
54038
  disabled: display.soldOut,
53820
54039
  onClick: () => {
53821
54040
  if (!selectedProduct) return;
@@ -53865,15 +54084,31 @@ function CartController(props2) {
53865
54084
  onChange: item.quantityEditable ? (event) => cart2.updateQuantity(item.key, Number(event.target.value)) : void 0
53866
54085
  }
53867
54086
  ),
53868
- /* @__PURE__ */ jsx120("button", { type: "button", className: "secondary btn-sm", onClick: () => cart2.removeItem(item.key), children: "Remove" })
54087
+ /* @__PURE__ */ jsx120(
54088
+ "button",
54089
+ {
54090
+ type: "button",
54091
+ className: themeButtonClassName({ variant: "secondary", size: "sm" }),
54092
+ onClick: () => cart2.removeItem(item.key),
54093
+ children: "Remove"
54094
+ }
54095
+ )
53869
54096
  ] }),
53870
54097
  footerActions: /* @__PURE__ */ jsxs89(Fragment21, { children: [
53871
- /* @__PURE__ */ jsx120("button", { type: "button", className: "secondary btn-sm", onClick: () => cart2.clear(), children: display.clearButtonText }),
53872
54098
  /* @__PURE__ */ jsx120(
53873
54099
  "button",
53874
54100
  {
53875
54101
  type: "button",
53876
- className: "default",
54102
+ className: themeButtonClassName({ variant: "secondary", size: "sm" }),
54103
+ onClick: () => cart2.clear(),
54104
+ children: display.clearButtonText
54105
+ }
54106
+ ),
54107
+ /* @__PURE__ */ jsx120(
54108
+ "button",
54109
+ {
54110
+ type: "button",
54111
+ className: themeButtonClassName({ variant: "default", size: "md" }),
53877
54112
  onClick: () => {
53878
54113
  window.location.href = resolveDedicatedCheckoutPath(window.location.pathname);
53879
54114
  },
@@ -53979,7 +54214,15 @@ function CheckoutController(props2) {
53979
54214
  )
53980
54215
  ] }),
53981
54216
  state.feedback.tag === "error" ? /* @__PURE__ */ jsx120("p", { className: "rb-caption status-muted", children: state.feedback.message }) : null,
53982
- /* @__PURE__ */ jsx120("button", { type: "submit", className: "default", disabled: state.submission === "submitting", children: state.submission === "submitting" ? "Loading\u2026" : display.submitButtonText })
54217
+ /* @__PURE__ */ jsx120(
54218
+ "button",
54219
+ {
54220
+ type: "submit",
54221
+ className: themeButtonClassName({ variant: "default", size: "md" }),
54222
+ disabled: state.submission === "submitting",
54223
+ children: state.submission === "submitting" ? "Loading\u2026" : display.submitButtonText
54224
+ }
54225
+ )
53983
54226
  ] })
53984
54227
  }
53985
54228
  );
@@ -53989,6 +54232,7 @@ var init_shop_commerce = __esm({
53989
54232
  "../blocks/src/system/runtime/nodes/shop-commerce.tsx"() {
53990
54233
  "use strict";
53991
54234
  "use client";
54235
+ init_buttons();
53992
54236
  init_api();
53993
54237
  init_RichText();
53994
54238
  init_carousel_client();
@@ -54099,7 +54343,7 @@ function HeaderCartDrawerItems(props2) {
54099
54343
  "button",
54100
54344
  {
54101
54345
  type: "button",
54102
- className: "secondary btn-sm",
54346
+ className: themeButtonClassName({ variant: "secondary", size: "sm" }),
54103
54347
  onClick: () => props2.cart.removeItem(item.key),
54104
54348
  children: "Remove"
54105
54349
  }
@@ -54192,7 +54436,7 @@ function HeaderCartDrawer(props2) {
54192
54436
  "button",
54193
54437
  {
54194
54438
  type: "button",
54195
- className: "secondary",
54439
+ className: themeButtonClassName({ variant: "secondary", size: "md" }),
54196
54440
  onClick: () => props2.cart.clear(),
54197
54441
  disabled: display.state === "empty",
54198
54442
  children: display.clearButtonText
@@ -54201,12 +54445,20 @@ function HeaderCartDrawer(props2) {
54201
54445
  props2.checkoutHref && display.state === "ready" ? /* @__PURE__ */ jsx125(
54202
54446
  "a",
54203
54447
  {
54204
- className: "default",
54448
+ className: themeButtonClassName({ variant: "default", size: "md" }),
54205
54449
  href: props2.checkoutHref,
54206
54450
  onClick: props2.onClose,
54207
54451
  children: display.checkoutButtonText
54208
54452
  }
54209
- ) : /* @__PURE__ */ jsx125("button", { type: "button", className: "default", disabled: true, children: display.checkoutButtonText })
54453
+ ) : /* @__PURE__ */ jsx125(
54454
+ "button",
54455
+ {
54456
+ type: "button",
54457
+ className: themeButtonClassName({ variant: "default", size: "md" }),
54458
+ disabled: true,
54459
+ children: display.checkoutButtonText
54460
+ }
54461
+ )
54210
54462
  ] })
54211
54463
  ]
54212
54464
  }
@@ -54219,6 +54471,7 @@ var init_HeaderCartDrawer = __esm({
54219
54471
  "../blocks/src/system/runtime/header/HeaderCartDrawer.tsx"() {
54220
54472
  "use strict";
54221
54473
  "use client";
54474
+ init_buttons();
54222
54475
  init_display();
54223
54476
  init_ModalShell();
54224
54477
  }
@@ -54914,7 +55167,7 @@ var init_EventPaginatedListView_client = __esm({
54914
55167
  init_EventCompactRow();
54915
55168
  init_EmptyState();
54916
55169
  init_EventListing_view();
54917
- init_themedButtonClass();
55170
+ init_buttons();
54918
55171
  EventPaginatedListView = ({
54919
55172
  filters,
54920
55173
  display,
@@ -54957,7 +55210,7 @@ var init_EventPaginatedListView_client = __esm({
54957
55210
  {
54958
55211
  type: "button",
54959
55212
  onClick: loadMore,
54960
- className: themedButtonClass({
55213
+ className: themeButtonClassName({
54961
55214
  variant: display.buttonVariant,
54962
55215
  size: "md"
54963
55216
  }),
@@ -54971,7 +55224,7 @@ var init_EventPaginatedListView_client = __esm({
54971
55224
  type: "button",
54972
55225
  onClick: loadMore,
54973
55226
  disabled: loading,
54974
- className: themedButtonClass({
55227
+ className: themeButtonClassName({
54975
55228
  variant: display.buttonVariant,
54976
55229
  size: "md",
54977
55230
  extraClassName: loading ? "rb-opacity-50 rb-cursor-wait" : null
@@ -54983,7 +55236,7 @@ var init_EventPaginatedListView_client = __esm({
54983
55236
  "a",
54984
55237
  {
54985
55238
  href: seeAllUrl,
54986
- className: themedButtonClass({
55239
+ className: themeButtonClassName({
54987
55240
  variant: display.buttonVariant,
54988
55241
  size: "md"
54989
55242
  }),
@@ -56333,7 +56586,7 @@ var init_EventCombined_client = __esm({
56333
56586
  init_EventModalContext();
56334
56587
  init_EventModals();
56335
56588
  init_utils();
56336
- init_themedButtonClass();
56589
+ init_buttons();
56337
56590
  EventCombinedClient = ({
56338
56591
  events: initialEvents,
56339
56592
  siteId,
@@ -56659,7 +56912,7 @@ var init_EventCombined_client = __esm({
56659
56912
  {
56660
56913
  type: "button",
56661
56914
  onClick: goToToday,
56662
- className: themedButtonClass({ variant: buttonVariant, size: "sm" }),
56915
+ className: themeButtonClassName({ variant: buttonVariant, size: "sm" }),
56663
56916
  children: "Today"
56664
56917
  }
56665
56918
  )
@@ -56976,7 +57229,7 @@ var init_EventCalendar_client = __esm({
56976
57229
  init_EventModalContext();
56977
57230
  init_EventModals();
56978
57231
  init_WeekTimetableView();
56979
- init_themedButtonClass();
57232
+ init_buttons();
56980
57233
  EventCalendarClient = ({
56981
57234
  render
56982
57235
  }) => {
@@ -57265,7 +57518,7 @@ var init_EventCalendar_client = __esm({
57265
57518
  {
57266
57519
  type: "button",
57267
57520
  onClick: onToday,
57268
- className: themedButtonClass({
57521
+ className: themeButtonClassName({
57269
57522
  variant: display.buttonVariant,
57270
57523
  size: "sm"
57271
57524
  }),
@@ -57281,7 +57534,7 @@ var init_EventCalendar_client = __esm({
57281
57534
  {
57282
57535
  type: "button",
57283
57536
  onClick: onToday,
57284
- className: themedButtonClass({
57537
+ className: themeButtonClassName({
57285
57538
  variant: display.buttonVariant,
57286
57539
  size: "sm"
57287
57540
  }),
@@ -57379,7 +57632,7 @@ var init_form_client = __esm({
57379
57632
  init_client2();
57380
57633
  init_src3();
57381
57634
  init_useFormSubmission();
57382
- init_themedButtonClass();
57635
+ init_buttons();
57383
57636
  FormNodeClient = ({
57384
57637
  render
57385
57638
  }) => {
@@ -57521,7 +57774,7 @@ var init_form_client = __esm({
57521
57774
  "button",
57522
57775
  {
57523
57776
  type: "submit",
57524
- className: themedButtonClass({
57777
+ className: themeButtonClassName({
57525
57778
  variant: "primary",
57526
57779
  size: "md",
57527
57780
  extraClassName: "rb-w-full rb-sm-w-auto"
@@ -57648,7 +57901,7 @@ function NewsletterFormClient({
57648
57901
  "button",
57649
57902
  {
57650
57903
  type: "submit",
57651
- className: themedButtonClass({ variant: "primary", size: "md" }),
57904
+ className: themeButtonClassName({ variant: "primary", size: "md" }),
57652
57905
  disabled: isSubmitting,
57653
57906
  children: isSubmitting ? "Subscribing..." : render.display.buttonLabel
57654
57907
  }
@@ -57666,7 +57919,7 @@ var init_newsletter_form_client = __esm({
57666
57919
  init_client2();
57667
57920
  init_src3();
57668
57921
  init_api();
57669
- init_themedButtonClass();
57922
+ init_buttons();
57670
57923
  }
57671
57924
  });
57672
57925
 
@@ -65542,6 +65795,9 @@ function validationContext(options = {}) {
65542
65795
  allowIncomplete: isDraft || (options.allowIncomplete ?? false)
65543
65796
  };
65544
65797
  }
65798
+ function formatFieldPath(path) {
65799
+ return path.map((segment) => String(segment)).join(".");
65800
+ }
65545
65801
  function fieldIssueToMessage(issue2) {
65546
65802
  switch (issue2.kind) {
65547
65803
  case "required":
@@ -65765,7 +66021,7 @@ function normalizeRepeaterItems(plan, value, ctx) {
65765
66021
  return normalizeObjectChildren(fields3, itemRecord, ctx);
65766
66022
  });
65767
66023
  }
65768
- function normalizeNumberInput(value, allowNull) {
66024
+ function normalizeNumberInput(value, _allowNull) {
65769
66025
  if (value === "") return void 0;
65770
66026
  if (typeof value === "string" && value.trim() !== "") return Number(value);
65771
66027
  return value;
@@ -65897,7 +66153,7 @@ function validateRepeaterItem(plan, item, index, ctx) {
65897
66153
  const fields3 = plan.repeatedItemVariants ? plan.repeatedItemVariants.find((variant) => variant.typeId === itemType)?.fields : plan.repeatedItemPlan;
65898
66154
  if (!fields3) return [];
65899
66155
  return fields3.flatMap((childPlan) => {
65900
- const indexedPlan = withIndexedPath(childPlan, plan.path, index);
66156
+ const indexedPlan = materializeRepeaterItemPlan(childPlan, plan.path, index);
65901
66157
  return validateNormalizedFieldValue(indexedPlan, item[childPlan.fieldId], ctx);
65902
66158
  });
65903
66159
  }
@@ -65909,12 +66165,58 @@ function validateGroupPlan(plan, value, ctx) {
65909
66165
  function childValidationContext(plan, ctx) {
65910
66166
  return plan.allowNullChildren ? { ...ctx, allowNull: true } : ctx;
65911
66167
  }
65912
- function withIndexedPath(plan, parentPath, index) {
65913
- const suffix = plan.path.slice(parentPath.length + 1);
65914
- return {
65915
- ...plan,
65916
- path: [...parentPath, index, plan.fieldId, ...suffix]
65917
- };
66168
+ function materializeRepeaterItemPlan(plan, parentPath, index) {
66169
+ return rebaseFieldPlanPath(plan, [...parentPath, 0], [...parentPath, index]);
66170
+ }
66171
+ function rebaseFieldPlanPath(plan, fromPrefix, toPrefix) {
66172
+ const path = rebaseFieldPath(plan.path, fromPrefix, toPrefix);
66173
+ switch (plan.kind) {
66174
+ case "group":
66175
+ return {
66176
+ ...plan,
66177
+ path,
66178
+ children: plan.children.map((childPlan) => rebaseFieldPlanPath(childPlan, fromPrefix, toPrefix))
66179
+ };
66180
+ case "repeater":
66181
+ return {
66182
+ ...plan,
66183
+ path,
66184
+ ...plan.repeatedItemVariants ? {
66185
+ repeatedItemVariants: plan.repeatedItemVariants.map((variant) => ({
66186
+ ...variant,
66187
+ fields: variant.fields.map((fieldPlan) => rebaseFieldPlanPath(fieldPlan, fromPrefix, toPrefix))
66188
+ }))
66189
+ } : {},
66190
+ ...plan.repeatedItemPlan ? {
66191
+ repeatedItemPlan: plan.repeatedItemPlan.map(
66192
+ (fieldPlan) => rebaseFieldPlanPath(fieldPlan, fromPrefix, toPrefix)
66193
+ )
66194
+ } : {}
66195
+ };
66196
+ case "string":
66197
+ case "number":
66198
+ case "boolean":
66199
+ case "richText":
66200
+ case "media":
66201
+ case "link":
66202
+ case "select":
66203
+ case "passthrough":
66204
+ return {
66205
+ ...plan,
66206
+ path
66207
+ };
66208
+ default:
66209
+ return assertNever4(plan);
66210
+ }
66211
+ }
66212
+ function rebaseFieldPath(path, fromPrefix, toPrefix) {
66213
+ if (!startsWithFieldPath(path, fromPrefix)) {
66214
+ throw new Error(`Cannot rebase field path ${formatFieldPath(path)} from ${formatFieldPath(fromPrefix)}`);
66215
+ }
66216
+ return [...toPrefix, ...path.slice(fromPrefix.length)];
66217
+ }
66218
+ function startsWithFieldPath(path, prefix) {
66219
+ return prefix.every((segment, index) => path[index] === segment);
65918
66220
  }
65919
66221
  function issue(plan, kind, extra) {
65920
66222
  return {
@@ -76323,13 +76625,13 @@ function hydrateValue(value, context) {
76323
76625
  return isUnchanged ? value : resolvedItems;
76324
76626
  }
76325
76627
  if (isRecord3(value)) {
76326
- if (isInternalLink2(value)) {
76628
+ if (isInternalLink(value)) {
76327
76629
  return hydrateInternalLink(value, context.routes);
76328
76630
  }
76329
- if (isPageLink2(value)) {
76631
+ if (isPageLink(value)) {
76330
76632
  return hydratePageLink(value, context);
76331
76633
  }
76332
- if (isEntryLink2(value)) {
76634
+ if (isEntryLink(value)) {
76333
76635
  return hydrateEntryLink(value, context);
76334
76636
  }
76335
76637
  const resolvedEntries = Object.entries(value).map(([key, entry]) => [key, hydrateValue(entry, context)]);
@@ -76359,7 +76661,7 @@ function hydrateInternalLink(link2, routes) {
76359
76661
  }
76360
76662
  return Object.keys(updates).length > 0 ? { ...link2, ...updates } : link2;
76361
76663
  }
76362
- function isInternalLink2(value) {
76664
+ function isInternalLink(value) {
76363
76665
  if (value.kind !== "internal") {
76364
76666
  return false;
76365
76667
  }
@@ -76368,7 +76670,7 @@ function isInternalLink2(value) {
76368
76670
  }
76369
76671
  return true;
76370
76672
  }
76371
- function isPageLink2(value) {
76673
+ function isPageLink(value) {
76372
76674
  if (value.kind !== "page") {
76373
76675
  return false;
76374
76676
  }
@@ -76384,7 +76686,7 @@ function hydratePageLink(link2, context) {
76384
76686
  }
76385
76687
  return { ...link2, href: resolved.href, routeId: resolved.routeId };
76386
76688
  }
76387
- function isEntryLink2(value) {
76689
+ function isEntryLink(value) {
76388
76690
  if (value.kind !== "entry") {
76389
76691
  return false;
76390
76692
  }
@@ -78572,6 +78874,9 @@ function normalizeLoaderParams(endpoint, params, context) {
78572
78874
  init_media2();
78573
78875
  init_colorStyles();
78574
78876
 
78877
+ // ../api/src/navigation/linkValue.ts
78878
+ init_src();
78879
+
78575
78880
  // ../api/src/aiPlayground.ts
78576
78881
  import { z as z66 } from "zod";
78577
78882
  var Rfc6902PatchOp = z66.discriminatedUnion("op", [
@@ -79797,7 +80102,7 @@ var SimpleCache = class {
79797
80102
  };
79798
80103
 
79799
80104
  // src/version.ts
79800
- var SDK_VERSION = "0.60.9";
80105
+ var SDK_VERSION = "0.60.11";
79801
80106
 
79802
80107
  // src/client/error.ts
79803
80108
  var RiverbankApiError = class _RiverbankApiError extends Error {