@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.
@@ -100647,6 +100647,9 @@ function validationContext(options = {}) {
100647
100647
  allowIncomplete: isDraft || (options.allowIncomplete ?? false)
100648
100648
  };
100649
100649
  }
100650
+ function formatFieldPath(path) {
100651
+ return path.map((segment) => String(segment)).join(".");
100652
+ }
100650
100653
  function fieldIssueToMessage(issue2) {
100651
100654
  switch (issue2.kind) {
100652
100655
  case "required":
@@ -100870,7 +100873,7 @@ function normalizeRepeaterItems(plan, value, ctx) {
100870
100873
  return normalizeObjectChildren(fields3, itemRecord, ctx);
100871
100874
  });
100872
100875
  }
100873
- function normalizeNumberInput(value, allowNull) {
100876
+ function normalizeNumberInput(value, _allowNull) {
100874
100877
  if (value === "") return void 0;
100875
100878
  if (typeof value === "string" && value.trim() !== "") return Number(value);
100876
100879
  return value;
@@ -101002,7 +101005,7 @@ function validateRepeaterItem(plan, item, index2, ctx) {
101002
101005
  const fields3 = plan.repeatedItemVariants ? plan.repeatedItemVariants.find((variant) => variant.typeId === itemType)?.fields : plan.repeatedItemPlan;
101003
101006
  if (!fields3) return [];
101004
101007
  return fields3.flatMap((childPlan) => {
101005
- const indexedPlan = withIndexedPath(childPlan, plan.path, index2);
101008
+ const indexedPlan = materializeRepeaterItemPlan(childPlan, plan.path, index2);
101006
101009
  return validateNormalizedFieldValue(indexedPlan, item[childPlan.fieldId], ctx);
101007
101010
  });
101008
101011
  }
@@ -101014,12 +101017,58 @@ function validateGroupPlan(plan, value, ctx) {
101014
101017
  function childValidationContext(plan, ctx) {
101015
101018
  return plan.allowNullChildren ? { ...ctx, allowNull: true } : ctx;
101016
101019
  }
101017
- function withIndexedPath(plan, parentPath, index2) {
101018
- const suffix = plan.path.slice(parentPath.length + 1);
101019
- return {
101020
- ...plan,
101021
- path: [...parentPath, index2, plan.fieldId, ...suffix]
101022
- };
101020
+ function materializeRepeaterItemPlan(plan, parentPath, index2) {
101021
+ return rebaseFieldPlanPath(plan, [...parentPath, 0], [...parentPath, index2]);
101022
+ }
101023
+ function rebaseFieldPlanPath(plan, fromPrefix, toPrefix) {
101024
+ const path = rebaseFieldPath(plan.path, fromPrefix, toPrefix);
101025
+ switch (plan.kind) {
101026
+ case "group":
101027
+ return {
101028
+ ...plan,
101029
+ path,
101030
+ children: plan.children.map((childPlan) => rebaseFieldPlanPath(childPlan, fromPrefix, toPrefix))
101031
+ };
101032
+ case "repeater":
101033
+ return {
101034
+ ...plan,
101035
+ path,
101036
+ ...plan.repeatedItemVariants ? {
101037
+ repeatedItemVariants: plan.repeatedItemVariants.map((variant) => ({
101038
+ ...variant,
101039
+ fields: variant.fields.map((fieldPlan) => rebaseFieldPlanPath(fieldPlan, fromPrefix, toPrefix))
101040
+ }))
101041
+ } : {},
101042
+ ...plan.repeatedItemPlan ? {
101043
+ repeatedItemPlan: plan.repeatedItemPlan.map(
101044
+ (fieldPlan) => rebaseFieldPlanPath(fieldPlan, fromPrefix, toPrefix)
101045
+ )
101046
+ } : {}
101047
+ };
101048
+ case "string":
101049
+ case "number":
101050
+ case "boolean":
101051
+ case "richText":
101052
+ case "media":
101053
+ case "link":
101054
+ case "select":
101055
+ case "passthrough":
101056
+ return {
101057
+ ...plan,
101058
+ path
101059
+ };
101060
+ default:
101061
+ return assertNever5(plan);
101062
+ }
101063
+ }
101064
+ function rebaseFieldPath(path, fromPrefix, toPrefix) {
101065
+ if (!startsWithFieldPath(path, fromPrefix)) {
101066
+ throw new Error(`Cannot rebase field path ${formatFieldPath(path)} from ${formatFieldPath(fromPrefix)}`);
101067
+ }
101068
+ return [...toPrefix, ...path.slice(fromPrefix.length)];
101069
+ }
101070
+ function startsWithFieldPath(path, prefix) {
101071
+ return prefix.every((segment, index2) => path[index2] === segment);
101023
101072
  }
101024
101073
  function issue(plan, kind, extra) {
101025
101074
  return {
@@ -101628,6 +101677,15 @@ var init_curatedChoices = __esm({
101628
101677
  "../theme-core/src/site-styles/curatedChoices.ts"() {
101629
101678
  }
101630
101679
  });
101680
+ function isVariantRole(value) {
101681
+ return VARIANT_ROLES.includes(value);
101682
+ }
101683
+ function asSpecialVariantId(value) {
101684
+ if (value.length === 0) {
101685
+ throw new Error("SpecialVariantId must be a non-empty string");
101686
+ }
101687
+ return value;
101688
+ }
101631
101689
  var VARIANT_ROLES, DEFAULT_VARIANT_ALIAS_ID, cornerStyleSchema, shadowSizeSchema, textTransformSchema, fontWeightSchema, buttonTypographySchema, letterSpacingSchema, hoverTransformSchema, hoverColorSchema, buttonPaddingPresetSchema, gradientStyleSchema, gradientSharpnessSchema, prioritySchema, buttonSizeNameSchema, PADDING_TOKEN_PATTERN, paddingShorthandSchema, buttonSizeConfigSchema, buttonSizesSchema, buttonGlobalSettingsSchema, gradientDirectionSchema, buttonBackgroundSchema, effectApplicationSchema, buttonBorderSchema, variantShadowSchema, variantEffectsSchema, variantSizeOverridesSchema, buttonVariantSchema, buttonSystemSchema;
101632
101690
  var init_types6 = __esm({
101633
101691
  "../theme-core/src/buttons/types.ts"() {
@@ -102451,6 +102509,47 @@ var init_media = __esm({
102451
102509
  }
102452
102510
  });
102453
102511
 
102512
+ // ../theme-core/src/buttons/classNames.ts
102513
+ function parseThemeButtonVariantId(value) {
102514
+ const normalized = value?.trim() ?? "";
102515
+ if (normalized.length === 0) {
102516
+ return null;
102517
+ }
102518
+ if (normalized === DEFAULT_VARIANT_ALIAS_ID) {
102519
+ return DEFAULT_VARIANT_ALIAS_ID;
102520
+ }
102521
+ return isVariantRole(normalized) ? normalized : asSpecialVariantId(normalized);
102522
+ }
102523
+ function themeButtonVariantClassNames(variant) {
102524
+ if (variant === DEFAULT_VARIANT_ALIAS_ID) {
102525
+ return [variant];
102526
+ }
102527
+ return [variant, `button-${variant}`];
102528
+ }
102529
+ function themeButtonSizeClassName(size4) {
102530
+ return `btn-${size4}`;
102531
+ }
102532
+ function themeButtonSelector(variant, size4) {
102533
+ const baseSelector = `.${variant}`;
102534
+ if (!size4) {
102535
+ return baseSelector;
102536
+ }
102537
+ return `${baseSelector}.${themeButtonSizeClassName(size4)}`;
102538
+ }
102539
+ function themeButtonClassName(spec) {
102540
+ const classes = [
102541
+ ...themeButtonVariantClassNames(spec.variant),
102542
+ themeButtonSizeClassName(spec.size),
102543
+ spec.extraClassName
102544
+ ];
102545
+ return classes.filter(Boolean).join(" ");
102546
+ }
102547
+ var init_classNames = __esm({
102548
+ "../theme-core/src/buttons/classNames.ts"() {
102549
+ init_types6();
102550
+ }
102551
+ });
102552
+
102454
102553
  // ../theme-core/src/tokens/resolver.ts
102455
102554
  var TokenResolver;
102456
102555
  var init_resolver = __esm({
@@ -104103,17 +104202,25 @@ function resolveAliasSource(enabled) {
104103
104202
  }
104104
104203
  function variantChunks(variant, global2, themeSizes, themeId, tokens, theme) {
104105
104204
  const out = [];
104106
- out.push(variantBaseRule(variant, global2, themeId, tokens, theme));
104107
- const hoverBg = variantHoverBackgroundRule(variant, global2, themeId, tokens);
104205
+ const variantId = parseButtonVariantIdForCss(variant.id);
104206
+ out.push(variantBaseRule(variant, variantId, global2, themeId, tokens, theme));
104207
+ const hoverBg = variantHoverBackgroundRule(variant, variantId, global2, themeId, tokens);
104108
104208
  if (hoverBg) out.push(hoverBg);
104109
104209
  const effects = variantEffectsCss(variant, themeId, tokens, theme);
104110
104210
  if (effects) out.push({ raw: effects });
104111
- out.push(...variantDisabledRules(variant, themeId));
104112
- out.push(...variantSizeRules(variant, themeSizes, themeId));
104211
+ out.push(...variantDisabledRules(variantId, themeId));
104212
+ out.push(...variantSizeRules(variant, variantId, themeSizes, themeId));
104113
104213
  return out;
104114
104214
  }
104115
- function variantBaseRule(variant, global2, themeId, tokens, theme) {
104116
- const selector = `:where([data-theme-scope="${themeId}"]) .${variant.id}`;
104215
+ function parseButtonVariantIdForCss(value) {
104216
+ const variantId = parseThemeButtonVariantId(value);
104217
+ if (!variantId) {
104218
+ throw new Error("Button variant id must be a non-empty string");
104219
+ }
104220
+ return variantId;
104221
+ }
104222
+ function variantBaseRule(variant, variantId, global2, themeId, tokens, theme) {
104223
+ const selector = `:where([data-theme-scope="${themeId}"]) ${themeButtonSelector(variantId)}`;
104117
104224
  const decls = [];
104118
104225
  decls.push(["font-weight", String(global2.fontWeight)]);
104119
104226
  decls.push(["font-family", resolveFontFamily(global2)]);
@@ -104146,13 +104253,13 @@ function variantBaseRule(variant, global2, themeId, tokens, theme) {
104146
104253
  }
104147
104254
  return rule(selector, decls);
104148
104255
  }
104149
- function variantHoverBackgroundRule(variant, global2, themeId, tokens) {
104256
+ function variantHoverBackgroundRule(variant, variantId, global2, themeId, tokens) {
104150
104257
  let hoverToken = variant.hoverBackgroundToken;
104151
104258
  if (!hoverToken && global2.hoverColor === "token" && global2.hoverColorToken) {
104152
104259
  hoverToken = global2.hoverColorToken;
104153
104260
  }
104154
104261
  if (!hoverToken) return null;
104155
- return rule(`:where([data-theme-scope="${themeId}"]) .${variant.id}:hover`, [
104262
+ return rule(`:where([data-theme-scope="${themeId}"]) ${themeButtonSelector(variantId)}:hover`, [
104156
104263
  ["background-color", tokens.getColor(hoverToken)]
104157
104264
  ]);
104158
104265
  }
@@ -104172,8 +104279,8 @@ function variantEffectsCss(variant, themeId, tokens, theme) {
104172
104279
  theme
104173
104280
  });
104174
104281
  }
104175
- function variantDisabledRules(variant, themeId) {
104176
- const base2 = `:where([data-theme-scope="${themeId}"]) .${variant.id}:disabled`;
104282
+ function variantDisabledRules(variantId, themeId) {
104283
+ const base2 = `:where([data-theme-scope="${themeId}"]) ${themeButtonSelector(variantId)}:disabled`;
104177
104284
  const disabledSelectors = [base2, `${base2}:hover`, `${base2}:active`, `${base2}:focus`];
104178
104285
  const pseudoSelectors = [`${base2}::before`, `${base2}::after`];
104179
104286
  return [
@@ -104191,12 +104298,12 @@ function variantDisabledRules(variant, themeId) {
104191
104298
  ])
104192
104299
  ];
104193
104300
  }
104194
- function variantSizeRules(variant, themeSizes, themeId) {
104301
+ function variantSizeRules(variant, variantId, themeSizes, themeId) {
104195
104302
  const borderWidth = variant.border ? BORDER_WIDTH_MAP[variant.border.widthClass] || "1px" : "0px";
104196
104303
  const rules = [];
104197
104304
  for (const sizeName of BUTTON_SIZE_NAMES) {
104198
104305
  const config = resolveSizeConfig(variant, sizeName, themeSizes);
104199
- const selector = `:where([data-theme-scope="${themeId}"]) .${variant.id}.btn-${sizeName}`;
104306
+ const selector = `:where([data-theme-scope="${themeId}"]) ${themeButtonSelector(variantId, sizeName)}`;
104200
104307
  const decls = [];
104201
104308
  for (const decl of paddingDeclarations(config.padding, borderWidth)) decls.push(decl);
104202
104309
  if (config.fontSize) {
@@ -104258,6 +104365,7 @@ var BUTTON_SIZE_NAMES, LETTER_SPACING_MAP, STRUCTURAL_DECLARATIONS;
104258
104365
  var init_generateButtonCss = __esm({
104259
104366
  "../theme-core/src/buttons/generateButtonCss.ts"() {
104260
104367
  init_types6();
104368
+ init_classNames();
104261
104369
  init_resolver();
104262
104370
  init_generateEffectsCSS();
104263
104371
  init_constants4();
@@ -104300,6 +104408,7 @@ var init_core = __esm({
104300
104408
  var init_buttons = __esm({
104301
104409
  "../theme-core/src/buttons/index.ts"() {
104302
104410
  init_types6();
104411
+ init_classNames();
104303
104412
  init_generateButtonCss();
104304
104413
  init_generateDefaultButtonSystem();
104305
104414
  init_constants4();
@@ -121058,18 +121167,6 @@ var init_EventCardIcons = __esm({
121058
121167
  "../blocks/src/system/runtime/nodes/events/shared/EventCardIcons.tsx"() {
121059
121168
  }
121060
121169
  });
121061
-
121062
- // ../blocks/src/system/runtime/shared/themedButtonClass.ts
121063
- function themedButtonClass(spec) {
121064
- const { variant, size: size4, extraClassName } = spec;
121065
- const normalizedVariant = variant.trim();
121066
- const variantClasses = normalizedVariant ? [normalizedVariant, `button-${normalizedVariant}`] : [];
121067
- return [...variantClasses, `btn-${size4}`, extraClassName].filter(Boolean).join(" ");
121068
- }
121069
- var init_themedButtonClass = __esm({
121070
- "../blocks/src/system/runtime/shared/themedButtonClass.ts"() {
121071
- }
121072
- });
121073
121170
  function formatCapacityText(event, options) {
121074
121171
  if (event.capacity == null) return null;
121075
121172
  if (options.isSoldOut) return "Sold out";
@@ -121114,7 +121211,7 @@ var init_EventCard = __esm({
121114
121211
  init_EventCardIcons();
121115
121212
  init_eventCapacity();
121116
121213
  init_utils7();
121117
- init_themedButtonClass();
121214
+ init_buttons();
121118
121215
  EventCard = ({
121119
121216
  event,
121120
121217
  cardVariant = "default",
@@ -121140,7 +121237,7 @@ var init_EventCard = __esm({
121140
121237
  const isSoldOut = cta.hidden;
121141
121238
  const { available: spotsLeft } = getEventAvailability(event);
121142
121239
  const cardClass = `card-${cardVariant}`;
121143
- const buttonClass = themedButtonClass({ variant: buttonVariant, size: "md" });
121240
+ const buttonClass = themeButtonClassName({ variant: buttonVariant, size: "md" });
121144
121241
  const title = event.title;
121145
121242
  const summary = event.presentation?.summary ?? event.description;
121146
121243
  const image = event.presentation?.image ?? null;
@@ -121218,7 +121315,7 @@ var init_EventCompactRow = __esm({
121218
121315
  "../blocks/src/system/runtime/nodes/events/shared/EventCompactRow.tsx"() {
121219
121316
  init_utils7();
121220
121317
  init_EventCardIcons();
121221
- init_themedButtonClass();
121318
+ init_buttons();
121222
121319
  EventCompactRow = ({
121223
121320
  event,
121224
121321
  buttonVariant = "primary",
@@ -121230,7 +121327,7 @@ var init_EventCompactRow = __esm({
121230
121327
  const price = formatEventPrice(event);
121231
121328
  const teacherLine = formatEventTeacherLine(event);
121232
121329
  const cta = resolveEventCta(event, buttonText);
121233
- const buttonClass = themedButtonClass({ variant: buttonVariant, size: "sm" });
121330
+ const buttonClass = themeButtonClassName({ variant: buttonVariant, size: "sm" });
121234
121331
  return /* @__PURE__ */ jsxs("div", { className: "event-compact-row", children: [
121235
121332
  /* @__PURE__ */ jsxs("div", { className: "event-compact-row-content", children: [
121236
121333
  /* @__PURE__ */ jsxs("div", { className: "event-compact-row-top", children: [
@@ -128440,11 +128537,12 @@ var init_basic = __esm({
128440
128537
  }
128441
128538
  return null;
128442
128539
  }
128443
- const resolvedVariantId = typeof variantId === "string" ? variantId.trim() : "";
128444
- const normalizedVariantId = resolvedVariantId === DEFAULT_VARIANT_ALIAS_ID ? "" : resolvedVariantId;
128445
- const variantClasses = normalizedVariantId ? [normalizedVariantId, `button-${normalizedVariantId}`] : [];
128446
- const sizeClass = `btn-${size4}`;
128447
- const combinedClassName = [...variantClasses, sizeClass, className].filter(Boolean).join(" ");
128540
+ const resolvedVariantId = parseThemeButtonVariantId(variantId);
128541
+ const combinedClassName = resolvedVariantId ? themeButtonClassName({
128542
+ variant: resolvedVariantId,
128543
+ size: size4,
128544
+ extraClassName: className
128545
+ }) : className;
128448
128546
  if (resolvedHref) {
128449
128547
  return /* @__PURE__ */ jsx(
128450
128548
  "a",
@@ -128664,7 +128762,7 @@ function FileDownloadNode({
128664
128762
  {
128665
128763
  href,
128666
128764
  download: filename,
128667
- className: themedButtonClass({
128765
+ className: themeButtonClassName({
128668
128766
  variant,
128669
128767
  size: "md",
128670
128768
  extraClassName: "rb-inline-flex rb-shrink-0 rb-items-center rb-justify-center rb-gap-2"
@@ -128683,7 +128781,7 @@ var init_file_download2 = __esm({
128683
128781
  init_lucide_react();
128684
128782
  init_colorStyles();
128685
128783
  init_media3();
128686
- init_themedButtonClass();
128784
+ init_buttons();
128687
128785
  init_media4();
128688
128786
  FILE_DOWNLOAD_BUTTON_VARIANTS = ["primary", "secondary", "outline", "link"];
128689
128787
  }
@@ -130827,7 +130925,7 @@ var EventSpotlight;
130827
130925
  var init_EventSpotlight = __esm({
130828
130926
  "../blocks/src/system/runtime/nodes/events/EventSpotlight.tsx"() {
130829
130927
  init_shared7();
130830
- init_themedButtonClass();
130928
+ init_buttons();
130831
130929
  EventSpotlight = ({
130832
130930
  events: events2,
130833
130931
  layout = "grid",
@@ -130849,7 +130947,7 @@ var init_EventSpotlight = __esm({
130849
130947
  }
130850
130948
  const containerClass = getContainerClass(layout, columns);
130851
130949
  const cardOrientation = getCardOrientation(layout);
130852
- const buttonClass = themedButtonClass({ variant: buttonVariant, size: "md" });
130950
+ const buttonClass = themeButtonClassName({ variant: buttonVariant, size: "md" });
130853
130951
  return /* @__PURE__ */ jsxs("div", { className: `event-spotlight-section ${className || ""}`, "data-block": "event-spotlight", children: [
130854
130952
  /* @__PURE__ */ jsx("div", { className: `event-spotlight ${containerClass}`, children: normalizedEvents.map((event) => /* @__PURE__ */ jsx(
130855
130953
  EventCard,
@@ -131343,7 +131441,16 @@ var init_view4 = __esm({
131343
131441
  });
131344
131442
  function renderServerPendingAction(label, soldOut) {
131345
131443
  return /* @__PURE__ */ jsxs(Fragment, { children: [
131346
- /* @__PURE__ */ jsx("button", { type: "button", className: "default", disabled: true, "aria-disabled": "true", children: soldOut ? "Sold out" : label }),
131444
+ /* @__PURE__ */ jsx(
131445
+ "button",
131446
+ {
131447
+ type: "button",
131448
+ className: themeButtonClassName({ variant: "default", size: "md" }),
131449
+ disabled: true,
131450
+ "aria-disabled": "true",
131451
+ children: soldOut ? "Sold out" : label
131452
+ }
131453
+ ),
131347
131454
  !soldOut ? /* @__PURE__ */ jsx("p", { className: "rb-caption status-muted", children: "Cart actions become interactive after page load." }) : null
131348
131455
  ] });
131349
131456
  }
@@ -131363,7 +131470,14 @@ function ProductListServerContent(props2) {
131363
131470
  ),
131364
131471
  actions: /* @__PURE__ */ jsxs(Fragment, { children: [
131365
131472
  renderServerPendingAction(card.actionLabel, card.soldOut),
131366
- card.path ? /* @__PURE__ */ jsx("a", { href: card.path, className: "secondary btn-sm", children: "View details" }) : null
131473
+ card.path ? /* @__PURE__ */ jsx(
131474
+ "a",
131475
+ {
131476
+ href: card.path,
131477
+ className: themeButtonClassName({ variant: "secondary", size: "sm" }),
131478
+ children: "View details"
131479
+ }
131480
+ ) : null
131367
131481
  ] })
131368
131482
  },
131369
131483
  card.productId
@@ -131405,6 +131519,7 @@ function CheckoutServerContent(props2) {
131405
131519
  }
131406
131520
  var init_shop_commerce_server = __esm({
131407
131521
  "../blocks/src/system/runtime/nodes/shop-commerce.server.tsx"() {
131522
+ init_buttons();
131408
131523
  init_RichText();
131409
131524
  init_carousel_server();
131410
131525
  init_richText_coerce();
@@ -131929,7 +132044,7 @@ function renderCalendarGrid(display) {
131929
132044
  "button",
131930
132045
  {
131931
132046
  type: "button",
131932
- className: themedButtonClass({
132047
+ className: themeButtonClassName({
131933
132048
  variant: display.buttonVariant,
131934
132049
  size: "sm"
131935
132050
  }),
@@ -132015,7 +132130,7 @@ function renderTimetableSsr(display) {
132015
132130
  "button",
132016
132131
  {
132017
132132
  type: "button",
132018
- className: themedButtonClass({
132133
+ className: themeButtonClassName({
132019
132134
  variant: display.buttonVariant,
132020
132135
  size: "sm"
132021
132136
  }),
@@ -132142,7 +132257,7 @@ var init_EventCalendar_server = __esm({
132142
132257
  init_renderEventListItem();
132143
132258
  init_utils7();
132144
132259
  init_timetableModel();
132145
- init_themedButtonClass();
132260
+ init_buttons();
132146
132261
  EventCalendarSSR = (props2) => {
132147
132262
  const islandProps = buildEventCalendarInteractiveIslandProps(props2);
132148
132263
  const display = islandProps.render.display;
@@ -132261,7 +132376,7 @@ var init_form_server = __esm({
132261
132376
  "../blocks/src/system/runtime/nodes/form.server.tsx"() {
132262
132377
  init_clsx();
132263
132378
  init_ssr();
132264
- init_themedButtonClass();
132379
+ init_buttons();
132265
132380
  init_form_interactive();
132266
132381
  FormNodeSSR = ({
132267
132382
  blockId,
@@ -132399,7 +132514,7 @@ var init_form_server = __esm({
132399
132514
  "button",
132400
132515
  {
132401
132516
  type: "submit",
132402
- className: themedButtonClass({
132517
+ className: themeButtonClassName({
132403
132518
  variant: "primary",
132404
132519
  size: "md",
132405
132520
  extraClassName: "rb-w-full rb-sm-w-auto"
@@ -132489,7 +132604,7 @@ function NewsletterFormSSR({
132489
132604
  "button",
132490
132605
  {
132491
132606
  type: "submit",
132492
- className: themedButtonClass({ variant: "primary", size: "md" }),
132607
+ className: themeButtonClassName({ variant: "primary", size: "md" }),
132493
132608
  children: display.buttonLabel
132494
132609
  }
132495
132610
  ) })
@@ -132505,7 +132620,7 @@ var init_newsletter_form_server = __esm({
132505
132620
  "../blocks/src/system/runtime/nodes/newsletter-form.server.tsx"() {
132506
132621
  init_clsx();
132507
132622
  init_ssr();
132508
- init_themedButtonClass();
132623
+ init_buttons();
132509
132624
  init_newsletter_form_interactive();
132510
132625
  newsletter_form_server_default = NewsletterFormSSR;
132511
132626
  }
@@ -132625,7 +132740,16 @@ function ShopSSR({
132625
132740
  PassCardView,
132626
132741
  {
132627
132742
  display: pass,
132628
- action: /* @__PURE__ */ jsx("button", { type: "button", className: "default", disabled: true, "aria-disabled": "true", children: pass.actionLabel })
132743
+ action: /* @__PURE__ */ jsx(
132744
+ "button",
132745
+ {
132746
+ type: "button",
132747
+ className: themeButtonClassName({ variant: "default", size: "md" }),
132748
+ disabled: true,
132749
+ "aria-disabled": "true",
132750
+ children: pass.actionLabel
132751
+ }
132752
+ )
132629
132753
  },
132630
132754
  pass.id
132631
132755
  )),
@@ -132633,7 +132757,16 @@ function ShopSSR({
132633
132757
  MembershipCardView,
132634
132758
  {
132635
132759
  display: membership,
132636
- action: /* @__PURE__ */ jsx("button", { type: "button", className: "default", disabled: true, "aria-disabled": "true", children: membership.actionLabel })
132760
+ action: /* @__PURE__ */ jsx(
132761
+ "button",
132762
+ {
132763
+ type: "button",
132764
+ className: themeButtonClassName({ variant: "default", size: "md" }),
132765
+ disabled: true,
132766
+ "aria-disabled": "true",
132767
+ children: membership.actionLabel
132768
+ }
132769
+ )
132637
132770
  },
132638
132771
  membership.id
132639
132772
  ))
@@ -132647,6 +132780,7 @@ function ShopSSR({
132647
132780
  var shop_server_default;
132648
132781
  var init_shop_server = __esm({
132649
132782
  "../blocks/src/system/runtime/nodes/shop.server.tsx"() {
132783
+ init_buttons();
132650
132784
  init_ssr();
132651
132785
  init_view4();
132652
132786
  init_shop_interactive();
@@ -155913,6 +156047,92 @@ function encodePublicProductCategorySelector(selector) {
155913
156047
  };
155914
156048
  }
155915
156049
  }
156050
+ function isRecord8(value) {
156051
+ return typeof value === "object" && value !== null;
156052
+ }
156053
+ function isJsonResponseContentType(contentType) {
156054
+ if (!contentType) return false;
156055
+ const mimeType = contentType.split(";", 1)[0]?.trim().toLowerCase() ?? "";
156056
+ return mimeType === "application/json" || mimeType.endsWith("+json");
156057
+ }
156058
+ function getResponseContentType(response) {
156059
+ return response.headers.get("content-type");
156060
+ }
156061
+ async function parseJsonBody(response) {
156062
+ const rawText = await response.text();
156063
+ if (rawText.trim().length === 0) {
156064
+ return { kind: "empty-body" };
156065
+ }
156066
+ try {
156067
+ return { kind: "success", value: JSON.parse(rawText) };
156068
+ } catch {
156069
+ return { kind: "invalid-json" };
156070
+ }
156071
+ }
156072
+ function getBlockApiErrorDetails(data) {
156073
+ if (!isRecord8(data)) {
156074
+ return {};
156075
+ }
156076
+ const nestedError = isRecord8(data.error) ? data.error : void 0;
156077
+ const message2 = typeof nestedError?.message === "string" ? nestedError.message : typeof data.message === "string" ? data.message : void 0;
156078
+ const code = typeof nestedError?.code === "string" ? nestedError.code : typeof data.code === "string" ? data.code : void 0;
156079
+ return { message: message2, code };
156080
+ }
156081
+ function buildUnexpectedJsonResponseMessage(parseResult) {
156082
+ switch (parseResult.kind) {
156083
+ case "empty-body":
156084
+ return "Expected JSON response body but received an empty response";
156085
+ case "invalid-json":
156086
+ return "Expected JSON response but received invalid JSON";
156087
+ }
156088
+ }
156089
+ async function extractErrorDetails(response) {
156090
+ const contentType = getResponseContentType(response);
156091
+ const fallbackMessage = `Request failed: ${response.statusText}`;
156092
+ if (!isJsonResponseContentType(contentType)) {
156093
+ return {
156094
+ message: `${fallbackMessage} (received ${contentType ?? "unknown content type"})`
156095
+ };
156096
+ }
156097
+ const parseResult = await parseJsonBody(response);
156098
+ switch (parseResult.kind) {
156099
+ case "success": {
156100
+ const details = getBlockApiErrorDetails(parseResult.value);
156101
+ return {
156102
+ message: details.message ?? fallbackMessage,
156103
+ code: details.code
156104
+ };
156105
+ }
156106
+ case "invalid-json":
156107
+ return {
156108
+ message: `${fallbackMessage} (received invalid JSON)`
156109
+ };
156110
+ case "empty-body":
156111
+ return {
156112
+ message: `${fallbackMessage} (received an empty response)`
156113
+ };
156114
+ }
156115
+ }
156116
+ async function parseJsonApiResponse(response) {
156117
+ if (response.status === 204 || response.status === 205) {
156118
+ return void 0;
156119
+ }
156120
+ const contentType = getResponseContentType(response);
156121
+ if (!isJsonResponseContentType(contentType)) {
156122
+ throw new BlockApiError(
156123
+ `Expected JSON response but received ${contentType ?? "unknown content type"}`,
156124
+ response.status
156125
+ );
156126
+ }
156127
+ const parseResult = await parseJsonBody(response);
156128
+ if (parseResult.kind !== "success") {
156129
+ throw new BlockApiError(
156130
+ buildUnexpectedJsonResponseMessage(parseResult),
156131
+ response.status
156132
+ );
156133
+ }
156134
+ return parseResult.value;
156135
+ }
155916
156136
  function getAuthHeaders2(auth) {
155917
156137
  switch (auth.type) {
155918
156138
  case "api-key":
@@ -155969,21 +156189,10 @@ function createBlockApi(config) {
155969
156189
  const doFetch = async () => {
155970
156190
  const response = await fetch(url, fetchOptions);
155971
156191
  if (!response.ok) {
155972
- let errorMessage3 = `Request failed: ${response.statusText}`;
155973
- let errorCode;
155974
- try {
155975
- const errorData = await response.json();
155976
- if (typeof errorData.error?.message === "string") {
155977
- errorMessage3 = errorData.error.message;
155978
- } else if (typeof errorData.message === "string") {
155979
- errorMessage3 = errorData.message;
155980
- }
155981
- errorCode = errorData.error?.code || errorData.code;
155982
- } catch {
155983
- }
155984
- throw new BlockApiError(errorMessage3, response.status, errorCode);
156192
+ const details = await extractErrorDetails(response);
156193
+ throw new BlockApiError(details.message, response.status, details.code);
155985
156194
  }
155986
- const json = await response.json();
156195
+ const json = await parseJsonApiResponse(response);
155987
156196
  if (isApiSuccessResponse(json)) {
155988
156197
  return json.data;
155989
156198
  }
@@ -159805,7 +160014,7 @@ function MultiStepForm({
159805
160014
  type: "button",
159806
160015
  onClick: goToPrevious,
159807
160016
  disabled: !canGoBack,
159808
- className: "outline btn-md",
160017
+ className: themeButtonClassName({ variant: "outline", size: "md" }),
159809
160018
  children: backButtonLabel
159810
160019
  }
159811
160020
  ),
@@ -159815,7 +160024,11 @@ function MultiStepForm({
159815
160024
  type: "button",
159816
160025
  onClick: goToNext,
159817
160026
  disabled: !canGoNext,
159818
- className: "primary btn-md rb-flex-1",
160027
+ className: themeButtonClassName({
160028
+ variant: "primary",
160029
+ size: "md",
160030
+ extraClassName: "rb-flex-1"
160031
+ }),
159819
160032
  children: [
159820
160033
  (isValidating || isSubmitting) && /* @__PURE__ */ jsx(
159821
160034
  SpinnerNode,
@@ -159930,6 +160143,7 @@ function ProgressIndicator({
159930
160143
  var init_MultiStepForm = __esm({
159931
160144
  "../blocks/src/system/runtime/components/multi-step/MultiStepForm.tsx"() {
159932
160145
  "use client";
160146
+ init_buttons();
159933
160147
  init_MultiStepContext();
159934
160148
  init_useMultiStep();
159935
160149
  init_spinner2();
@@ -161143,7 +161357,10 @@ function PaymentOptionSelectionStep({
161143
161357
  "button",
161144
161358
  {
161145
161359
  type: "button",
161146
- className: isSelected ? "primary btn-md" : "outline btn-md",
161360
+ className: themeButtonClassName({
161361
+ variant: isSelected ? "primary" : "outline",
161362
+ size: "md"
161363
+ }),
161147
161364
  style: paymentOptionLayoutStyle,
161148
161365
  onClick: () => updateData({
161149
161366
  selectedAppointmentPackageId: appointmentPackage.customerPassId,
@@ -161192,7 +161409,10 @@ function PaymentOptionSelectionStep({
161192
161409
  "button",
161193
161410
  {
161194
161411
  type: "button",
161195
- className: isSelected ? "primary btn-md" : "outline btn-md",
161412
+ className: themeButtonClassName({
161413
+ variant: isSelected ? "primary" : "outline",
161414
+ size: "md"
161415
+ }),
161196
161416
  style: paymentOptionLayoutStyle,
161197
161417
  onClick: () => updateData({
161198
161418
  selectedAppointmentPackageId: void 0,
@@ -161220,6 +161440,7 @@ var paymentOptionLayoutStyle, summaryStackStyle;
161220
161440
  var init_PaymentOptionSelectionStep = __esm({
161221
161441
  "../blocks/src/system/runtime/components/booking/PaymentOptionSelectionStep.tsx"() {
161222
161442
  "use client";
161443
+ init_buttons();
161223
161444
  init_api();
161224
161445
  init_MultiStepContext();
161225
161446
  init_booking_form_state();
@@ -162762,6 +162983,7 @@ var init_booking_form_client = __esm({
162762
162983
  init_noop();
162763
162984
  init_client2();
162764
162985
  init_src8();
162986
+ init_buttons();
162765
162987
  init_api();
162766
162988
  init_MultiStepForm();
162767
162989
  init_SuccessMessage();
@@ -162999,7 +163221,7 @@ var init_booking_form_client = __esm({
162999
163221
  "button",
163000
163222
  {
163001
163223
  type: "button",
163002
- className: "secondary btn-sm",
163224
+ className: themeButtonClassName({ variant: "secondary", size: "sm" }),
163003
163225
  onClick: clearFeedback,
163004
163226
  children: "Dismiss"
163005
163227
  }
@@ -164329,7 +164551,7 @@ var init_PaymentSelectionStep = __esm({
164329
164551
  init_lucide_react();
164330
164552
  init_utils12();
164331
164553
  init_spinner2();
164332
- init_themedButtonClass();
164554
+ init_buttons();
164333
164555
  init_CheckIcon2();
164334
164556
  init_SelectableOptionCard();
164335
164557
  PaymentSelectionStep = ({
@@ -164430,7 +164652,7 @@ var init_PaymentSelectionStep = __esm({
164430
164652
  "button",
164431
164653
  {
164432
164654
  type: "button",
164433
- className: themedButtonClass({ variant: "primary", size: "md" }),
164655
+ className: themeButtonClassName({ variant: "primary", size: "md" }),
164434
164656
  disabled: !email.trim(),
164435
164657
  onClick: onRequestLogin,
164436
164658
  children: "Email me a login link"
@@ -166020,7 +166242,7 @@ function MagicLinkForm({
166020
166242
  "button",
166021
166243
  {
166022
166244
  type: "button",
166023
- className: classPrefix === "cp" ? "secondary" : `${classPrefix}-modal-btn ${classPrefix}-modal-btn--secondary`,
166245
+ className: classPrefix === "cp" ? themeButtonClassName({ variant: "secondary", size: "md" }) : `${classPrefix}-modal-btn ${classPrefix}-modal-btn--secondary`,
166024
166246
  onClick: handleReset,
166025
166247
  children: "Try a different email"
166026
166248
  }
@@ -166048,7 +166270,7 @@ function MagicLinkForm({
166048
166270
  "button",
166049
166271
  {
166050
166272
  type: "submit",
166051
- className: classPrefix === "cp" ? "primary" : `${classPrefix}-modal-btn`,
166273
+ className: classPrefix === "cp" ? themeButtonClassName({ variant: "primary", size: "md" }) : `${classPrefix}-modal-btn`,
166052
166274
  disabled: !email.trim() || loading,
166053
166275
  children: loading ? "Sending..." : buttonText
166054
166276
  }
@@ -166058,6 +166280,7 @@ function MagicLinkForm({
166058
166280
  var init_MagicLinkForm = __esm({
166059
166281
  "../blocks/src/system/runtime/nodes/shared/MagicLinkForm.tsx"() {
166060
166282
  "use client";
166283
+ init_buttons();
166061
166284
  init_api();
166062
166285
  }
166063
166286
  });
@@ -166079,7 +166302,7 @@ function EventRegistrationWizard(props2) {
166079
166302
  } = props2;
166080
166303
  const maxTicketsNum = parseInt(maxTickets, 10) || 5;
166081
166304
  const showSpamProtection = spamProtectionEnabled ?? isSpamProtectionEnabled();
166082
- const buttonClass = themedButtonClass({ variant: buttonVariant, size: "md" });
166305
+ const buttonClass = themeButtonClassName({ variant: buttonVariant, size: "md" });
166083
166306
  const wizard = useEventRegistrationWizard({
166084
166307
  anchorId: EVENT_REGISTRATION_ANCHOR_ID,
166085
166308
  occurrenceContext: occurrenceContext ?? null,
@@ -166215,7 +166438,7 @@ var init_EventRegistrationWizard = __esm({
166215
166438
  init_useEventRegistrationWizard();
166216
166439
  init_MagicLinkForm();
166217
166440
  init_spinner2();
166218
- init_themedButtonClass();
166441
+ init_buttons();
166219
166442
  init_event_registration3();
166220
166443
  EVENT_REGISTRATION_ANCHOR_ID = "event-registration";
166221
166444
  EVENT_PORTAL_AUTH_COPY = {
@@ -166625,7 +166848,7 @@ function ErrorStep2({
166625
166848
  buttonVariant = "primary",
166626
166849
  onRetry
166627
166850
  }) {
166628
- const buttonClass = themedButtonClass({ variant: buttonVariant, size: "md" });
166851
+ const buttonClass = themeButtonClassName({ variant: buttonVariant, size: "md" });
166629
166852
  return /* @__PURE__ */ jsxs("div", { className: "cr-error", role: "alert", children: [
166630
166853
  /* @__PURE__ */ jsx(StateIcon, { variant: "error", children: /* @__PURE__ */ jsx(CrossIcon, {}) }),
166631
166854
  /* @__PURE__ */ jsx("h3", { className: "cr-error__title", children: "Enrollment Failed" }),
@@ -166636,7 +166859,7 @@ function ErrorStep2({
166636
166859
  var init_ErrorStep2 = __esm({
166637
166860
  "../blocks/src/system/runtime/nodes/course-registration/ErrorStep.tsx"() {
166638
166861
  init_shared9();
166639
- init_themedButtonClass();
166862
+ init_buttons();
166640
166863
  }
166641
166864
  });
166642
166865
  function VerifyingTimeoutStep2({
@@ -166645,7 +166868,7 @@ function VerifyingTimeoutStep2({
166645
166868
  onCheckAgain,
166646
166869
  supportEmail
166647
166870
  }) {
166648
- const buttonClass = themedButtonClass({ variant: buttonVariant, size: "md" });
166871
+ const buttonClass = themeButtonClassName({ variant: buttonVariant, size: "md" });
166649
166872
  return /* @__PURE__ */ jsxs("div", { className: "cr-error", role: "alert", children: [
166650
166873
  /* @__PURE__ */ jsx(StateIcon, { variant: "warning", children: /* @__PURE__ */ jsx(ClockIcon, {}) }),
166651
166874
  /* @__PURE__ */ jsx("h3", { className: "cr-error__title", children: "Payment Verification Taking Longer" }),
@@ -166661,7 +166884,7 @@ function VerifyingTimeoutStep2({
166661
166884
  var init_VerifyingTimeoutStep2 = __esm({
166662
166885
  "../blocks/src/system/runtime/nodes/course-registration/VerifyingTimeoutStep.tsx"() {
166663
166886
  init_shared9();
166664
- init_themedButtonClass();
166887
+ init_buttons();
166665
166888
  }
166666
166889
  });
166667
166890
  function PaymentFailedStep2({
@@ -166670,7 +166893,7 @@ function PaymentFailedStep2({
166670
166893
  buttonVariant = "primary",
166671
166894
  onRetry
166672
166895
  }) {
166673
- const buttonClass = themedButtonClass({ variant: buttonVariant, size: "md" });
166896
+ const buttonClass = themeButtonClassName({ variant: buttonVariant, size: "md" });
166674
166897
  return /* @__PURE__ */ jsxs("div", { className: "cr-payment-failed", role: "alert", children: [
166675
166898
  /* @__PURE__ */ jsx(StateIcon, { variant: "error", children: /* @__PURE__ */ jsx(CrossIcon, {}) }),
166676
166899
  /* @__PURE__ */ jsx("h3", { className: "cr-payment-failed__title", children: "Payment Failed" }),
@@ -166681,7 +166904,7 @@ function PaymentFailedStep2({
166681
166904
  var init_PaymentFailedStep2 = __esm({
166682
166905
  "../blocks/src/system/runtime/nodes/course-registration/PaymentFailedStep.tsx"() {
166683
166906
  init_shared9();
166684
- init_themedButtonClass();
166907
+ init_buttons();
166685
166908
  }
166686
166909
  });
166687
166910
  function WaitlistStep({ message: message2, position }) {
@@ -167657,7 +167880,7 @@ function CourseRegistrationWizard(props2) {
167657
167880
  handleRetry,
167658
167881
  handleBookingModeChange
167659
167882
  } = useCourseRegistrationWizard(props2);
167660
- const buttonClass = themedButtonClass({ variant: buttonVariant, size: "md" });
167883
+ const buttonClass = themeButtonClassName({ variant: buttonVariant, size: "md" });
167661
167884
  if (scopedCourses.length === 0) {
167662
167885
  return /* @__PURE__ */ jsx(
167663
167886
  "div",
@@ -168066,7 +168289,7 @@ var init_CourseRegistrationWizard = __esm({
168066
168289
  init_PaymentFailedStep2();
168067
168290
  init_VerifyingTimeoutStep2();
168068
168291
  init_spinner2();
168069
- init_themedButtonClass();
168292
+ init_buttons();
168070
168293
  }
168071
168294
  });
168072
168295
  function toCourseRegistrationClientProps(props2) {
@@ -168769,7 +168992,11 @@ function PassesMembershipsController({ render }) {
168769
168992
  "button",
168770
168993
  {
168771
168994
  type: "button",
168772
- className: "secondary btn-sm shop__return-dismiss",
168995
+ className: themeButtonClassName({
168996
+ variant: "secondary",
168997
+ size: "sm",
168998
+ extraClassName: "shop__return-dismiss"
168999
+ }),
168773
169000
  onClick: () => dispatch({ type: "clearReturnNotice" }),
168774
169001
  children: "Dismiss"
168775
169002
  }
@@ -168786,7 +169013,11 @@ function PassesMembershipsController({ render }) {
168786
169013
  "button",
168787
169014
  {
168788
169015
  type: "button",
168789
- className: "default shop__cta",
169016
+ className: themeButtonClassName({
169017
+ variant: "default",
169018
+ size: "md",
169019
+ extraClassName: "shop__cta"
169020
+ }),
168790
169021
  onClick: () => handleBuyPass(pass),
168791
169022
  children: passDisplay.actionLabel
168792
169023
  }
@@ -168813,7 +169044,11 @@ function PassesMembershipsController({ render }) {
168813
169044
  "button",
168814
169045
  {
168815
169046
  type: "button",
168816
- className: "default shop__cta",
169047
+ className: themeButtonClassName({
169048
+ variant: "default",
169049
+ size: "md",
169050
+ extraClassName: "shop__cta"
169051
+ }),
168817
169052
  onClick: () => handleSubscribe(membership),
168818
169053
  children: membershipDisplay.actionLabel
168819
169054
  }
@@ -168857,12 +169092,20 @@ function PassesMembershipsController({ render }) {
168857
169092
  ] }) : null
168858
169093
  ] }),
168859
169094
  /* @__PURE__ */ jsxs(ActionRow, { className: "shop__modal-warning-actions", children: [
168860
- /* @__PURE__ */ jsx("button", { type: "button", className: "secondary", onClick: closeCheckout, children: "Cancel" }),
168861
169095
  /* @__PURE__ */ jsx(
168862
169096
  "button",
168863
169097
  {
168864
169098
  type: "button",
168865
- className: "default",
169099
+ className: themeButtonClassName({ variant: "secondary", size: "md" }),
169100
+ onClick: closeCheckout,
169101
+ children: "Cancel"
169102
+ }
169103
+ ),
169104
+ /* @__PURE__ */ jsx(
169105
+ "button",
169106
+ {
169107
+ type: "button",
169108
+ className: themeButtonClassName({ variant: "default", size: "md" }),
168866
169109
  onClick: handleConfirmDuplicate,
168867
169110
  disabled: checkout2.submitting,
168868
169111
  children: checkout2.submitting ? "Processing..." : "Subscribe Anyway"
@@ -168905,8 +169148,25 @@ function PassesMembershipsController({ render }) {
168905
169148
  ] }),
168906
169149
  checkout2.formError ? /* @__PURE__ */ jsx("p", { className: "shop__modal-error", role: "alert", children: checkout2.formError }) : null,
168907
169150
  /* @__PURE__ */ jsxs(ActionRow, { className: "shop__modal-actions", children: [
168908
- /* @__PURE__ */ jsx("button", { type: "button", className: "secondary", onClick: closeCheckout, disabled: checkout2.submitting, children: "Cancel" }),
168909
- /* @__PURE__ */ jsx("button", { type: "submit", className: "default", disabled: checkout2.submitting, children: checkout2.submitting ? "Processing..." : "Continue to Payment" })
169151
+ /* @__PURE__ */ jsx(
169152
+ "button",
169153
+ {
169154
+ type: "button",
169155
+ className: themeButtonClassName({ variant: "secondary", size: "md" }),
169156
+ onClick: closeCheckout,
169157
+ disabled: checkout2.submitting,
169158
+ children: "Cancel"
169159
+ }
169160
+ ),
169161
+ /* @__PURE__ */ jsx(
169162
+ "button",
169163
+ {
169164
+ type: "submit",
169165
+ className: themeButtonClassName({ variant: "default", size: "md" }),
169166
+ disabled: checkout2.submitting,
169167
+ children: checkout2.submitting ? "Processing..." : "Continue to Payment"
169168
+ }
169169
+ )
168910
169170
  ] })
168911
169171
  ] })
168912
169172
  ] })
@@ -168918,6 +169178,7 @@ var SHOP_ANCHOR_ID;
168918
169178
  var init_shop_client = __esm({
168919
169179
  "../blocks/src/system/runtime/nodes/shop.client.tsx"() {
168920
169180
  "use client";
169181
+ init_buttons();
168921
169182
  init_api();
168922
169183
  init_ModalShell();
168923
169184
  init_shared9();
@@ -169514,7 +169775,7 @@ function ProductListController(props2) {
169514
169775
  "button",
169515
169776
  {
169516
169777
  type: "button",
169517
- className: "default",
169778
+ className: themeButtonClassName({ variant: "default", size: "md" }),
169518
169779
  onClick: () => {
169519
169780
  const product = props2.render.hydration.products.find((candidate) => candidate.id === card.productId);
169520
169781
  if (!product) return;
@@ -169530,7 +169791,14 @@ function ProductListController(props2) {
169530
169791
  children: card.soldOut ? "Sold out" : card.actionLabel
169531
169792
  }
169532
169793
  ),
169533
- card.path ? /* @__PURE__ */ jsx("a", { href: card.path, className: "secondary btn-sm", children: "View details" }) : null
169794
+ card.path ? /* @__PURE__ */ jsx(
169795
+ "a",
169796
+ {
169797
+ href: card.path,
169798
+ className: themeButtonClassName({ variant: "secondary", size: "sm" }),
169799
+ children: "View details"
169800
+ }
169801
+ ) : null
169534
169802
  ] }),
169535
169803
  feedback: /* @__PURE__ */ jsx(
169536
169804
  ShopAddFeedback,
@@ -169596,7 +169864,7 @@ function ProductDetailController(props2) {
169596
169864
  "button",
169597
169865
  {
169598
169866
  type: "button",
169599
- className: "default",
169867
+ className: themeButtonClassName({ variant: "default", size: "md" }),
169600
169868
  disabled: display.soldOut,
169601
169869
  onClick: () => {
169602
169870
  if (!selectedProduct) return;
@@ -169646,15 +169914,31 @@ function CartController(props2) {
169646
169914
  onChange: item.quantityEditable ? (event) => cart2.updateQuantity(item.key, Number(event.target.value)) : void 0
169647
169915
  }
169648
169916
  ),
169649
- /* @__PURE__ */ jsx("button", { type: "button", className: "secondary btn-sm", onClick: () => cart2.removeItem(item.key), children: "Remove" })
169917
+ /* @__PURE__ */ jsx(
169918
+ "button",
169919
+ {
169920
+ type: "button",
169921
+ className: themeButtonClassName({ variant: "secondary", size: "sm" }),
169922
+ onClick: () => cart2.removeItem(item.key),
169923
+ children: "Remove"
169924
+ }
169925
+ )
169650
169926
  ] }),
169651
169927
  footerActions: /* @__PURE__ */ jsxs(Fragment, { children: [
169652
- /* @__PURE__ */ jsx("button", { type: "button", className: "secondary btn-sm", onClick: () => cart2.clear(), children: display.clearButtonText }),
169653
169928
  /* @__PURE__ */ jsx(
169654
169929
  "button",
169655
169930
  {
169656
169931
  type: "button",
169657
- className: "default",
169932
+ className: themeButtonClassName({ variant: "secondary", size: "sm" }),
169933
+ onClick: () => cart2.clear(),
169934
+ children: display.clearButtonText
169935
+ }
169936
+ ),
169937
+ /* @__PURE__ */ jsx(
169938
+ "button",
169939
+ {
169940
+ type: "button",
169941
+ className: themeButtonClassName({ variant: "default", size: "md" }),
169658
169942
  onClick: () => {
169659
169943
  window.location.href = resolveDedicatedCheckoutPath(window.location.pathname);
169660
169944
  },
@@ -169760,7 +170044,15 @@ function CheckoutController(props2) {
169760
170044
  )
169761
170045
  ] }),
169762
170046
  state.feedback.tag === "error" ? /* @__PURE__ */ jsx("p", { className: "rb-caption status-muted", children: state.feedback.message }) : null,
169763
- /* @__PURE__ */ jsx("button", { type: "submit", className: "default", disabled: state.submission === "submitting", children: state.submission === "submitting" ? "Loading\u2026" : display.submitButtonText })
170047
+ /* @__PURE__ */ jsx(
170048
+ "button",
170049
+ {
170050
+ type: "submit",
170051
+ className: themeButtonClassName({ variant: "default", size: "md" }),
170052
+ disabled: state.submission === "submitting",
170053
+ children: state.submission === "submitting" ? "Loading\u2026" : display.submitButtonText
170054
+ }
170055
+ )
169764
170056
  ] })
169765
170057
  }
169766
170058
  );
@@ -169769,6 +170061,7 @@ var CHECKOUT_ANCHOR_ID;
169769
170061
  var init_shop_commerce = __esm({
169770
170062
  "../blocks/src/system/runtime/nodes/shop-commerce.tsx"() {
169771
170063
  "use client";
170064
+ init_buttons();
169772
170065
  init_api();
169773
170066
  init_RichText();
169774
170067
  init_carousel_client();
@@ -170372,7 +170665,7 @@ function HeaderCartDrawerItems(props2) {
170372
170665
  "button",
170373
170666
  {
170374
170667
  type: "button",
170375
- className: "secondary btn-sm",
170668
+ className: themeButtonClassName({ variant: "secondary", size: "sm" }),
170376
170669
  onClick: () => props2.cart.removeItem(item.key),
170377
170670
  children: "Remove"
170378
170671
  }
@@ -170465,7 +170758,7 @@ function HeaderCartDrawer(props2) {
170465
170758
  "button",
170466
170759
  {
170467
170760
  type: "button",
170468
- className: "secondary",
170761
+ className: themeButtonClassName({ variant: "secondary", size: "md" }),
170469
170762
  onClick: () => props2.cart.clear(),
170470
170763
  disabled: display.state === "empty",
170471
170764
  children: display.clearButtonText
@@ -170474,12 +170767,20 @@ function HeaderCartDrawer(props2) {
170474
170767
  props2.checkoutHref && display.state === "ready" ? /* @__PURE__ */ jsx(
170475
170768
  "a",
170476
170769
  {
170477
- className: "default",
170770
+ className: themeButtonClassName({ variant: "default", size: "md" }),
170478
170771
  href: props2.checkoutHref,
170479
170772
  onClick: props2.onClose,
170480
170773
  children: display.checkoutButtonText
170481
170774
  }
170482
- ) : /* @__PURE__ */ jsx("button", { type: "button", className: "default", disabled: true, children: display.checkoutButtonText })
170775
+ ) : /* @__PURE__ */ jsx(
170776
+ "button",
170777
+ {
170778
+ type: "button",
170779
+ className: themeButtonClassName({ variant: "default", size: "md" }),
170780
+ disabled: true,
170781
+ children: display.checkoutButtonText
170782
+ }
170783
+ )
170483
170784
  ] })
170484
170785
  ]
170485
170786
  }
@@ -170491,6 +170792,7 @@ function HeaderCartDrawer(props2) {
170491
170792
  var init_HeaderCartDrawer = __esm({
170492
170793
  "../blocks/src/system/runtime/header/HeaderCartDrawer.tsx"() {
170493
170794
  "use client";
170795
+ init_buttons();
170494
170796
  init_display();
170495
170797
  init_ModalShell();
170496
170798
  }
@@ -171233,7 +171535,7 @@ var init_EventPaginatedListView_client = __esm({
171233
171535
  init_EventCompactRow();
171234
171536
  init_EmptyState();
171235
171537
  init_EventListing_view();
171236
- init_themedButtonClass();
171538
+ init_buttons();
171237
171539
  EventPaginatedListView = ({
171238
171540
  filters,
171239
171541
  display,
@@ -171276,7 +171578,7 @@ var init_EventPaginatedListView_client = __esm({
171276
171578
  {
171277
171579
  type: "button",
171278
171580
  onClick: loadMore,
171279
- className: themedButtonClass({
171581
+ className: themeButtonClassName({
171280
171582
  variant: display.buttonVariant,
171281
171583
  size: "md"
171282
171584
  }),
@@ -171290,7 +171592,7 @@ var init_EventPaginatedListView_client = __esm({
171290
171592
  type: "button",
171291
171593
  onClick: loadMore,
171292
171594
  disabled: loading,
171293
- className: themedButtonClass({
171595
+ className: themeButtonClassName({
171294
171596
  variant: display.buttonVariant,
171295
171597
  size: "md",
171296
171598
  extraClassName: loading ? "rb-opacity-50 rb-cursor-wait" : null
@@ -171302,7 +171604,7 @@ var init_EventPaginatedListView_client = __esm({
171302
171604
  "a",
171303
171605
  {
171304
171606
  href: seeAllUrl,
171305
- className: themedButtonClass({
171607
+ className: themeButtonClassName({
171306
171608
  variant: display.buttonVariant,
171307
171609
  size: "md"
171308
171610
  }),
@@ -172596,7 +172898,7 @@ var init_EventCombined_client = __esm({
172596
172898
  init_EventModalContext();
172597
172899
  init_EventModals();
172598
172900
  init_utils7();
172599
- init_themedButtonClass();
172901
+ init_buttons();
172600
172902
  EventCombinedClient = ({
172601
172903
  events: initialEvents,
172602
172904
  siteId,
@@ -172922,7 +173224,7 @@ var init_EventCombined_client = __esm({
172922
173224
  {
172923
173225
  type: "button",
172924
173226
  onClick: goToToday,
172925
- className: themedButtonClass({ variant: buttonVariant, size: "sm" }),
173227
+ className: themeButtonClassName({ variant: buttonVariant, size: "sm" }),
172926
173228
  children: "Today"
172927
173229
  }
172928
173230
  )
@@ -173229,7 +173531,7 @@ var init_EventCalendar_client = __esm({
173229
173531
  init_EventModalContext();
173230
173532
  init_EventModals();
173231
173533
  init_WeekTimetableView();
173232
- init_themedButtonClass();
173534
+ init_buttons();
173233
173535
  EventCalendarClient = ({
173234
173536
  render
173235
173537
  }) => {
@@ -173518,7 +173820,7 @@ var init_EventCalendar_client = __esm({
173518
173820
  {
173519
173821
  type: "button",
173520
173822
  onClick: onToday,
173521
- className: themedButtonClass({
173823
+ className: themeButtonClassName({
173522
173824
  variant: display.buttonVariant,
173523
173825
  size: "sm"
173524
173826
  }),
@@ -173534,7 +173836,7 @@ var init_EventCalendar_client = __esm({
173534
173836
  {
173535
173837
  type: "button",
173536
173838
  onClick: onToday,
173537
- className: themedButtonClass({
173839
+ className: themeButtonClassName({
173538
173840
  variant: display.buttonVariant,
173539
173841
  size: "sm"
173540
173842
  }),
@@ -173621,7 +173923,7 @@ var init_form_client = __esm({
173621
173923
  init_client2();
173622
173924
  init_src8();
173623
173925
  init_useFormSubmission();
173624
- init_themedButtonClass();
173926
+ init_buttons();
173625
173927
  FormNodeClient = ({
173626
173928
  render
173627
173929
  }) => {
@@ -173763,7 +174065,7 @@ var init_form_client = __esm({
173763
174065
  "button",
173764
174066
  {
173765
174067
  type: "submit",
173766
- className: themedButtonClass({
174068
+ className: themeButtonClassName({
173767
174069
  variant: "primary",
173768
174070
  size: "md",
173769
174071
  extraClassName: "rb-w-full rb-sm-w-auto"
@@ -173983,7 +174285,7 @@ function NewsletterFormClient({
173983
174285
  "button",
173984
174286
  {
173985
174287
  type: "submit",
173986
- className: themedButtonClass({ variant: "primary", size: "md" }),
174288
+ className: themeButtonClassName({ variant: "primary", size: "md" }),
173987
174289
  disabled: isSubmitting,
173988
174290
  children: isSubmitting ? "Subscribing..." : render.display.buttonLabel
173989
174291
  }
@@ -174001,11 +174303,11 @@ var init_newsletter_form_client = __esm({
174001
174303
  init_client2();
174002
174304
  init_src8();
174003
174305
  init_api();
174004
- init_themedButtonClass();
174306
+ init_buttons();
174005
174307
  newsletter_form_client_default = NewsletterFormClient;
174006
174308
  }
174007
174309
  });
174008
- function isRecord8(value) {
174310
+ function isRecord9(value) {
174009
174311
  return typeof value === "object" && value !== null;
174010
174312
  }
174011
174313
  function buildRenderFromLooseProps(runtime, mode, props2) {
@@ -174024,14 +174326,14 @@ function withRuntimeBackedEnvelope(source, runtime, render) {
174024
174326
  function normalizeLegacyInteractiveRenderProps(runtime, mode, props2) {
174025
174327
  const source = props2;
174026
174328
  const render = props2["render"];
174027
- if (!isRecord8(render)) {
174329
+ if (!isRecord9(render)) {
174028
174330
  return withRuntimeBackedEnvelope(
174029
174331
  source,
174030
174332
  runtime,
174031
174333
  buildRenderFromLooseProps(runtime, mode, props2)
174032
174334
  );
174033
174335
  }
174034
- if (isRecord8(render["hydration"])) {
174336
+ if (isRecord9(render["hydration"])) {
174035
174337
  return withRuntimeBackedEnvelope(
174036
174338
  source,
174037
174339
  runtime,
@@ -174041,7 +174343,7 @@ function normalizeLegacyInteractiveRenderProps(runtime, mode, props2) {
174041
174343
  }
174042
174344
  );
174043
174345
  }
174044
- if (!isRecord8(render["display"])) {
174346
+ if (!isRecord9(render["display"])) {
174045
174347
  return withRuntimeBackedEnvelope(
174046
174348
  source,
174047
174349
  runtime,
@@ -189145,7 +189447,7 @@ var init_MediaEditor = __esm({
189145
189447
  });
189146
189448
 
189147
189449
  // ../media-storage-api/dist/index.mjs
189148
- function isRecord9(value) {
189450
+ function isRecord10(value) {
189149
189451
  return typeof value === "object" && value !== null;
189150
189452
  }
189151
189453
  function createCachedMediaRepo(baseRepo, options) {
@@ -189268,7 +189570,7 @@ var init_dist91 = __esm({
189268
189570
  return payload;
189269
189571
  };
189270
189572
  extractErrorMessage = (body) => {
189271
- if (!isRecord9(body)) {
189573
+ if (!isRecord10(body)) {
189272
189574
  return typeof body === "string" && body.trim().length > 0 ? body : null;
189273
189575
  }
189274
189576
  const directKeys = ["error", "message", "detail", "reason"];
@@ -189284,7 +189586,7 @@ var init_dist91 = __esm({
189284
189586
  if (typeof entry === "string" && entry.trim().length > 0) {
189285
189587
  return entry;
189286
189588
  }
189287
- if (isRecord9(entry) && typeof entry.message === "string" && entry.message.trim().length > 0) {
189589
+ if (isRecord10(entry) && typeof entry.message === "string" && entry.message.trim().length > 0) {
189288
189590
  return entry.message;
189289
189591
  }
189290
189592
  }
@@ -189292,7 +189594,7 @@ var init_dist91 = __esm({
189292
189594
  const errors = body.errors;
189293
189595
  if (Array.isArray(errors)) {
189294
189596
  for (const entry of errors) {
189295
- if (isRecord9(entry) && typeof entry.message === "string" && entry.message.trim().length > 0) {
189597
+ if (isRecord10(entry) && typeof entry.message === "string" && entry.message.trim().length > 0) {
189296
189598
  return entry.message;
189297
189599
  }
189298
189600
  }
@@ -193531,6 +193833,14 @@ var init_routableLink = __esm({
193531
193833
  }
193532
193834
  });
193533
193835
 
193836
+ // ../api/src/navigation/linkValue.ts
193837
+ var init_linkValue = __esm({
193838
+ "../api/src/navigation/linkValue.ts"() {
193839
+ init_src3();
193840
+ init_routableLink();
193841
+ }
193842
+ });
193843
+
193534
193844
  // ../api/src/navigation/matcher.ts
193535
193845
  var init_matcher = __esm({
193536
193846
  "../api/src/navigation/matcher.ts"() {
@@ -193545,6 +193855,7 @@ var init_navigation2 = __esm({
193545
193855
  init_navigationMenuValidation();
193546
193856
  init_linkResolver();
193547
193857
  init_routableLink();
193858
+ init_linkValue();
193548
193859
  init_matcher();
193549
193860
  }
193550
193861
  });
@@ -202121,8 +202432,8 @@ init_matcher();
202121
202432
  // ../api/src/navigation/visibility.ts
202122
202433
  init_isRecord();
202123
202434
 
202124
- // ../api/src/navigation/linkValue.ts
202125
- init_routableLink();
202435
+ // ../api/src/index.ts
202436
+ init_linkValue();
202126
202437
 
202127
202438
  // ../api/src/redirects.ts
202128
202439
  init_envelope();
@@ -203012,7 +203323,7 @@ function blockIdForRuntimePatch(action) {
203012
203323
  }
203013
203324
  function currentLocalBlockContent(uiStore, targetBlockId) {
203014
203325
  const current = uiStore.getState().drafts.getCurrentValues(asEditorBlockId(targetBlockId));
203015
- return isRecord10(current) ? current : null;
203326
+ return isRecord11(current) ? current : null;
203016
203327
  }
203017
203328
  function replaceLocalBlockContentWithoutHistory(uiStore, targetBlockId, nextContent) {
203018
203329
  const editorBlockId = asEditorBlockId(targetBlockId);
@@ -203031,7 +203342,7 @@ function replaceLocalBlockContentWithoutHistory(uiStore, targetBlockId, nextCont
203031
203342
  }
203032
203343
  });
203033
203344
  }
203034
- function isRecord10(value) {
203345
+ function isRecord11(value) {
203035
203346
  return Boolean(value) && typeof value === "object" && !Array.isArray(value);
203036
203347
  }
203037
203348
 
@@ -203605,25 +203916,25 @@ var INITIAL_ONBOARDING_CONFIRMATION_STATE = {
203605
203916
  resendFeedback: null,
203606
203917
  statusLoadFailed: false
203607
203918
  };
203608
- function isRecord11(value) {
203919
+ function isRecord12(value) {
203609
203920
  return value !== null && typeof value === "object";
203610
203921
  }
203611
203922
  function getErrorMessageFromEnvelope(payload, fallback2) {
203612
- const error = isRecord11(payload) ? payload.error : null;
203613
- const message2 = isRecord11(error) ? error.message : null;
203923
+ const error = isRecord12(payload) ? payload.error : null;
203924
+ const message2 = isRecord12(error) ? error.message : null;
203614
203925
  return typeof message2 === "string" && message2.trim().length > 0 ? message2 : fallback2;
203615
203926
  }
203616
203927
  function isLaunchReadiness(value) {
203617
- return isRecord11(value) && Array.isArray(value.requirements) && typeof value.pendingRequiredCount === "number" && typeof value.pendingRecommendedCount === "number" && typeof value.pendingOptionalCount === "number" && isRecord11(value.goLiveDecision) && (value.goLiveDecision.kind === "allowed" || value.goLiveDecision.kind === "blocked");
203928
+ return isRecord12(value) && Array.isArray(value.requirements) && typeof value.pendingRequiredCount === "number" && typeof value.pendingRecommendedCount === "number" && typeof value.pendingOptionalCount === "number" && isRecord12(value.goLiveDecision) && (value.goLiveDecision.kind === "allowed" || value.goLiveDecision.kind === "blocked");
203618
203929
  }
203619
203930
  function isOnboardingPreviewStatusResponse(value) {
203620
- return isRecord11(value) && typeof value.dashboardUnlocked === "boolean" && typeof value.requiresEmailConfirmation === "boolean" && isLaunchReadiness(value.launchReadiness);
203931
+ return isRecord12(value) && typeof value.dashboardUnlocked === "boolean" && typeof value.requiresEmailConfirmation === "boolean" && isLaunchReadiness(value.launchReadiness);
203621
203932
  }
203622
203933
  function isResendOnboardingPreviewConfirmationResponse(value) {
203623
- return isRecord11(value) && (value.result === "resent" || value.result === "already_confirmed") && typeof value.dashboardUnlocked === "boolean" && typeof value.requiresEmailConfirmation === "boolean" && isLaunchReadiness(value.launchReadiness);
203934
+ return isRecord12(value) && (value.result === "resent" || value.result === "already_confirmed") && typeof value.dashboardUnlocked === "boolean" && typeof value.requiresEmailConfirmation === "boolean" && isLaunchReadiness(value.launchReadiness);
203624
203935
  }
203625
203936
  function getSuccessData(payload, isData) {
203626
- if (!isRecord11(payload) || payload.success !== true || !isData(payload.data)) {
203937
+ if (!isRecord12(payload) || payload.success !== true || !isData(payload.data)) {
203627
203938
  return null;
203628
203939
  }
203629
203940
  return payload.data;
@@ -204714,11 +205025,11 @@ init_src3();
204714
205025
  // ../preview-next/src/client/utils/path.ts
204715
205026
  var PATH_SEPARATOR_REGEX3 = /\./g;
204716
205027
  var BRACKET_ACCESS_REGEX3 = /\[([^\]]+)\]/g;
204717
- function isRecord12(value) {
205028
+ function isRecord13(value) {
204718
205029
  return typeof value === "object" && value !== null && !Array.isArray(value);
204719
205030
  }
204720
205031
  function isPathContainer2(value) {
204721
- return Array.isArray(value) || isRecord12(value);
205032
+ return Array.isArray(value) || isRecord13(value);
204722
205033
  }
204723
205034
  function createPathContainer2(nextIsIndex) {
204724
205035
  return nextIsIndex ? [] : {};
@@ -205013,7 +205324,7 @@ init_src11();
205013
205324
  init_lucide_react();
205014
205325
 
205015
205326
  // ../preview-next/src/client/blocks/isRecord.ts
205016
- function isRecord13(value) {
205327
+ function isRecord14(value) {
205017
205328
  return Boolean(value) && typeof value === "object" && !Array.isArray(value);
205018
205329
  }
205019
205330
 
@@ -205225,7 +205536,7 @@ function BlockToolbar({
205225
205536
  return;
205226
205537
  }
205227
205538
  if (!outcome.response.content) return;
205228
- const savedContent = isRecord13(outcome.response.content.data) ? outcome.response.content.data : null;
205539
+ const savedContent = isRecord14(outcome.response.content.data) ? outcome.response.content.data : null;
205229
205540
  const editorBlockId = asEditorBlockId(input.action.blockId);
205230
205541
  const currentContent = uiStore.getState().drafts.getCurrentValues(editorBlockId);
205231
205542
  if (jsonValuesEqual(currentContent, savedContent)) {
@@ -205375,8 +205686,8 @@ function jsonValuesEqual(left, right) {
205375
205686
  if (!Array.isArray(left) || !Array.isArray(right) || left.length !== right.length) return false;
205376
205687
  return left.every((value, index2) => jsonValuesEqual(value, right[index2]));
205377
205688
  }
205378
- if (isRecord13(left) || isRecord13(right)) {
205379
- if (!isRecord13(left) || !isRecord13(right)) return false;
205689
+ if (isRecord14(left) || isRecord14(right)) {
205690
+ if (!isRecord14(left) || !isRecord14(right)) return false;
205380
205691
  const leftKeys = Object.keys(left);
205381
205692
  const rightKeys = Object.keys(right);
205382
205693
  if (leftKeys.length !== rightKeys.length) return false;
@@ -205408,13 +205719,13 @@ function findFirstFieldPath(fields3, data, prefix) {
205408
205719
  }
205409
205720
  const nextPrefix = [...prefix, field.id];
205410
205721
  if (field.type === "group") {
205411
- const groupValue = isRecord13(data) ? data[field.id] : void 0;
205722
+ const groupValue = isRecord14(data) ? data[field.id] : void 0;
205412
205723
  const nested = findFirstFieldPath(field.schema.fields, groupValue, nextPrefix);
205413
205724
  if (nested) return nested;
205414
205725
  continue;
205415
205726
  }
205416
205727
  if (field.type === "repeater" && field.schema) {
205417
- const collection = isRecord13(data) ? data[field.id] : void 0;
205728
+ const collection = isRecord14(data) ? data[field.id] : void 0;
205418
205729
  const items = Array.isArray(collection) ? collection : [];
205419
205730
  if (items.length > 0) {
205420
205731
  const firstItem = items[0];
@@ -205684,7 +205995,7 @@ function applyPageDesignRuntimeFieldsToBlockItems(blockItems, source) {
205684
205995
  const fields3 = blockId ? fieldsByBlockId.get(blockId) : void 0;
205685
205996
  return {
205686
205997
  ...block,
205687
- content: applyCompiledRuntimeFieldsToContent(isRecord14(block.content) ? block.content : {}, fields3)
205998
+ content: applyCompiledRuntimeFieldsToContent(isRecord15(block.content) ? block.content : {}, fields3)
205688
205999
  };
205689
206000
  });
205690
206001
  }
@@ -205703,7 +206014,7 @@ function resolveRuntimePreviewSource(pageDesignState) {
205703
206014
  function designBlockIdFromBlockItem(block) {
205704
206015
  return typeof block.id === "string" && block.id.length > 0 ? asDesignBlockId(block.id) : null;
205705
206016
  }
205706
- function isRecord14(value) {
206017
+ function isRecord15(value) {
205707
206018
  return typeof value === "object" && value !== null && !Array.isArray(value);
205708
206019
  }
205709
206020
  function EditablePageRenderer(props2) {