@almadar/ui 5.122.14 → 5.124.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/dist/{TraitProvider-YkK6tXDw.d.cts → TraitProvider-Ch79cUcb.d.cts} +6 -1
  2. package/dist/{TraitProvider-YkK6tXDw.d.ts → TraitProvider-Ch79cUcb.d.ts} +6 -1
  3. package/dist/{UserContext-bziZwgFL.d.cts → UserContext-BKckAUv7.d.cts} +5 -5
  4. package/dist/{UserContext-bziZwgFL.d.ts → UserContext-BKckAUv7.d.ts} +5 -5
  5. package/dist/avl/index.cjs +354 -234
  6. package/dist/avl/index.js +356 -236
  7. package/dist/components/index.cjs +273 -198
  8. package/dist/components/index.d.cts +18 -12
  9. package/dist/components/index.d.ts +18 -12
  10. package/dist/components/index.js +273 -198
  11. package/dist/context/index.cjs +34 -66
  12. package/dist/context/index.d.cts +1 -1
  13. package/dist/context/index.d.ts +1 -1
  14. package/dist/context/index.js +34 -66
  15. package/dist/hooks/index.cjs +8 -0
  16. package/dist/hooks/index.js +8 -0
  17. package/dist/lib/drawable/three/index.cjs +6 -0
  18. package/dist/lib/drawable/three/index.js +6 -0
  19. package/dist/marketing/index.cjs +7 -0
  20. package/dist/marketing/index.js +7 -0
  21. package/dist/providers/index.cjs +343 -217
  22. package/dist/providers/index.d.cts +6 -6
  23. package/dist/providers/index.d.ts +6 -6
  24. package/dist/providers/index.js +343 -217
  25. package/dist/runtime/index.cjs +347 -227
  26. package/dist/runtime/index.d.cts +4 -2
  27. package/dist/runtime/index.d.ts +4 -2
  28. package/dist/runtime/index.js +349 -229
  29. package/package.json +8 -7
  30. package/themes/_contract.md +2 -0
  31. package/themes/almadar-website.css +3 -3
  32. package/themes/almadar.css +4 -4
  33. package/themes/bloomberg-dense.css +2 -2
  34. package/themes/clay.css +417 -0
  35. package/themes/corporate.css +411 -0
  36. package/themes/game-adventure.css +3 -3
  37. package/themes/game-rpg.css +2 -2
  38. package/themes/game-sci-fi.css +1 -1
  39. package/themes/game-ui-pack.css +2 -2
  40. package/themes/gazette.css +2 -2
  41. package/themes/glass.css +428 -0
  42. package/themes/index.css +9 -13
  43. package/themes/kiosk.css +5 -5
  44. package/themes/linear-clean.css +1 -1
  45. package/themes/minimalist.css +2 -2
  46. package/themes/neon.css +3 -3
  47. package/themes/notion-editorial.css +1 -1
  48. package/themes/prism.css +3 -3
  49. package/themes/retro.css +410 -0
  50. package/themes/terminal.css +1 -1
  51. package/themes/trait-wars.css +8 -8
  52. package/themes/wireframe.css +2 -2
  53. package/themes/arctic.css +0 -235
  54. package/themes/copper.css +0 -235
  55. package/themes/ember.css +0 -238
  56. package/themes/forest.css +0 -238
  57. package/themes/lavender.css +0 -233
  58. package/themes/midnight.css +0 -234
  59. package/themes/ocean.css +0 -238
  60. package/themes/rose.css +0 -233
  61. package/themes/sand.css +0 -234
  62. package/themes/slate.css +0 -233
  63. package/themes/sunset.css +0 -238
@@ -1164,6 +1164,7 @@ var init_Button = __esm({
1164
1164
  "button",
1165
1165
  {
1166
1166
  ref,
1167
+ type: "button",
1167
1168
  disabled: disabled || isLoading,
1168
1169
  className: cn(
1169
1170
  "relative inline-flex items-center justify-center gap-2",
@@ -1257,6 +1258,11 @@ var init_Typography = __esm({
1257
1258
  inherit: "text-inherit"
1258
1259
  };
1259
1260
  weightStyles = {
1261
+ // Neutral: an atom default of "none" must not override the variant's baked
1262
+ // weight (C-PATTERN-ENUM-BLOCKS-NEUTRAL-OVERRIDE — `variant={h2}` rendered
1263
+ // tiny because the ui-typography atom's `weight: light`/`size: xs` defaults
1264
+ // clobbered every variant).
1265
+ none: "",
1260
1266
  light: "font-light",
1261
1267
  normal: "font-normal",
1262
1268
  medium: "font-medium",
@@ -1282,6 +1288,7 @@ var init_Typography = __esm({
1282
1288
  label: "span"
1283
1289
  };
1284
1290
  typographySizeStyles = {
1291
+ none: "",
1285
1292
  xs: "text-xs",
1286
1293
  sm: "text-sm",
1287
1294
  md: "text-base",
@@ -4691,15 +4698,15 @@ var init_TextHighlight = __esm({
4691
4698
  const typeStyles = {
4692
4699
  question: cn(
4693
4700
  // Blue border for questions
4694
- "bg-card border-b-2 border-primary-600",
4701
+ "bg-card border-b-2 border-primary",
4695
4702
  "hover:bg-muted",
4696
- isActive && "bg-primary-100 ring-2 ring-primary-600"
4703
+ isActive && "bg-primary/10 ring-2 ring-primary"
4697
4704
  ),
4698
4705
  note: cn(
4699
4706
  // Yellow border for notes
4700
- "bg-card border-b-2 border-amber-500",
4707
+ "bg-card border-b-2 border-warning",
4701
4708
  "hover:bg-muted",
4702
- isActive && "bg-amber-100 ring-2 ring-amber-500"
4709
+ isActive && "bg-warning/10 ring-2 ring-warning"
4703
4710
  )
4704
4711
  };
4705
4712
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -5045,7 +5052,7 @@ function DayCell({
5045
5052
  {
5046
5053
  className: cn(
5047
5054
  "p-2 text-center cursor-pointer hover:bg-muted transition-colors",
5048
- isToday && "bg-blue-500/10",
5055
+ isToday && "bg-primary/10",
5049
5056
  className
5050
5057
  ),
5051
5058
  onClick: handleClick,
@@ -5056,7 +5063,7 @@ function DayCell({
5056
5063
  variant: "small",
5057
5064
  className: cn(
5058
5065
  "font-medium",
5059
- isToday ? "text-blue-600" : "text-muted-foreground"
5066
+ isToday ? "text-primary" : "text-muted-foreground"
5060
5067
  ),
5061
5068
  children: dayAbbr
5062
5069
  }
@@ -5068,7 +5075,7 @@ function DayCell({
5068
5075
  rounded: "full",
5069
5076
  className: cn(
5070
5077
  "h-8 w-8 mx-auto items-center justify-center",
5071
- isToday && "bg-blue-600 text-white"
5078
+ isToday && "bg-primary text-primary-foreground"
5072
5079
  ),
5073
5080
  children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body", className: "font-semibold", children: safeDate.getDate() })
5074
5081
  }
@@ -12573,19 +12580,19 @@ var init_ActivationBlock = __esm({
12573
12580
  "div",
12574
12581
  {
12575
12582
  className: cn(
12576
- "bg-indigo-50 dark:bg-indigo-900/20 border-2 border-indigo-200 dark:border-indigo-800 rounded-lg p-5 mb-6",
12583
+ "bg-primary/10 border-2 border-primary rounded-lg p-5 mb-6",
12577
12584
  className
12578
12585
  ),
12579
12586
  children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-3", children: [
12580
- /* @__PURE__ */ jsxRuntime.jsx(LucideIcons2.Lightbulb, { className: "text-indigo-600 dark:text-indigo-400 flex-shrink-0 mt-1", size: 24 }),
12587
+ /* @__PURE__ */ jsxRuntime.jsx(LucideIcons2.Lightbulb, { className: "text-primary flex-shrink-0 mt-1", size: 24 }),
12581
12588
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1", children: [
12582
- /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "font-semibold text-indigo-900 dark:text-indigo-100 mb-2", children: "Before You Begin..." }),
12583
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-700 dark:text-gray-300 mb-3 text-sm md:text-base", children: question }),
12589
+ /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "font-semibold text-primary mb-2", children: "Before You Begin..." }),
12590
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-foreground mb-3 text-sm md:text-base", children: question }),
12584
12591
  isExpanded ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
12585
12592
  /* @__PURE__ */ jsxRuntime.jsx(
12586
12593
  "textarea",
12587
12594
  {
12588
- className: "w-full p-3 border border-indigo-300 dark:border-indigo-700 rounded-md bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 focus:ring-2 focus:ring-indigo-500 focus:border-transparent text-sm",
12595
+ className: "w-full p-3 border border-input rounded-md bg-card text-foreground focus:ring-2 focus:ring-ring focus:border-transparent text-sm",
12589
12596
  placeholder: "Jot down your thoughts...",
12590
12597
  value: response,
12591
12598
  onChange: (e) => setResponse(e.target.value),
@@ -12597,7 +12604,7 @@ var init_ActivationBlock = __esm({
12597
12604
  "button",
12598
12605
  {
12599
12606
  onClick: handleSubmit,
12600
- className: "px-4 py-2 bg-indigo-600 text-white rounded-md hover:bg-indigo-700 text-sm font-medium transition-colors",
12607
+ className: "px-4 py-2 bg-primary text-primary-foreground rounded-md hover:bg-primary-hover text-sm font-medium transition-colors",
12601
12608
  children: "Continue to Lesson \u2192"
12602
12609
  }
12603
12610
  ),
@@ -12608,7 +12615,7 @@ var init_ActivationBlock = __esm({
12608
12615
  emit(`UI:${saveEvent}`, { response: "" });
12609
12616
  setIsExpanded(false);
12610
12617
  },
12611
- className: "px-4 py-2 text-indigo-600 dark:text-indigo-400 hover:underline text-sm",
12618
+ className: "px-4 py-2 text-primary hover:underline text-sm",
12612
12619
  children: "Skip for now"
12613
12620
  }
12614
12621
  )
@@ -12617,7 +12624,7 @@ var init_ActivationBlock = __esm({
12617
12624
  "button",
12618
12625
  {
12619
12626
  onClick: () => setIsExpanded(true),
12620
- className: "text-sm text-indigo-600 dark:text-indigo-400 hover:underline font-medium",
12627
+ className: "text-sm text-primary hover:underline font-medium",
12621
12628
  children: "\u2713 Answered \xB7 Edit response"
12622
12629
  }
12623
12630
  )
@@ -13121,7 +13128,7 @@ var init_AuthLayout = __esm({
13121
13128
  VStack,
13122
13129
  {
13123
13130
  className: cn(
13124
- "hidden lg:flex lg:w-1/2 bg-primary-600 relative overflow-hidden",
13131
+ "hidden lg:flex lg:w-1/2 bg-primary relative overflow-hidden",
13125
13132
  "justify-between p-12"
13126
13133
  ),
13127
13134
  style: backgroundImage ? {
@@ -13130,7 +13137,7 @@ var init_AuthLayout = __esm({
13130
13137
  } : void 0,
13131
13138
  gap: "none",
13132
13139
  children: [
13133
- /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "absolute inset-0 bg-gradient-to-br from-primary-600/90 to-primary-800/90" }),
13140
+ /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "absolute inset-0 bg-gradient-to-br from-primary/90 to-primary-hover/90" }),
13134
13141
  /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "relative z-10", children: /* @__PURE__ */ jsxRuntime.jsxs(reactRouterDom.Link, { to: "/", className: "flex items-center gap-3", children: [
13135
13142
  logo || /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "w-10 h-10 bg-[var(--color-card)]/20 rounded-xl flex items-center justify-center backdrop-blur", children: /* @__PURE__ */ jsxRuntime.jsx(
13136
13143
  Typography,
@@ -13215,7 +13222,7 @@ var init_AuthLayout = __esm({
13215
13222
  ),
13216
13223
  children: /* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "w-full max-w-md", children: [
13217
13224
  /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "lg:hidden mb-8 text-center", children: /* @__PURE__ */ jsxRuntime.jsxs(reactRouterDom.Link, { to: "/", className: "inline-flex items-center gap-3", children: [
13218
- logo || /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "w-12 h-12 bg-primary-600 rounded-xl flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(
13225
+ logo || /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "w-12 h-12 bg-primary rounded-xl flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(
13219
13226
  Typography,
13220
13227
  {
13221
13228
  variant: "body1",
@@ -15206,7 +15213,7 @@ var init_CodeBlock = __esm({
15206
15213
  {
15207
15214
  justify: "between",
15208
15215
  align: "center",
15209
- className: "px-3 py-2 bg-[var(--color-card)] rounded-t-lg border-b border-gray-700",
15216
+ className: "px-3 py-2 bg-[var(--color-card)] rounded-t-lg border-b border-border",
15210
15217
  children: [
15211
15218
  showLanguageBadge && /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "default", size: "sm", children: language }),
15212
15219
  effectiveCopy && /* @__PURE__ */ jsxRuntime.jsx(
@@ -15215,9 +15222,9 @@ var init_CodeBlock = __esm({
15215
15222
  variant: "ghost",
15216
15223
  size: "sm",
15217
15224
  onClick: handleCopy,
15218
- className: "opacity-0 group-hover:opacity-100 focus:opacity-100 transition-opacity text-muted-foreground hover:text-white",
15225
+ className: "opacity-0 group-hover:opacity-100 focus:opacity-100 transition-opacity text-muted-foreground hover:text-foreground",
15219
15226
  "aria-label": t("common.copy"),
15220
- children: copied ? /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "check", className: "w-4 h-4 text-green-400" }) : /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "copy", className: "w-4 h-4" })
15227
+ children: copied ? /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "check", className: "w-4 h-4 text-success" }) : /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "copy", className: "w-4 h-4" })
15221
15228
  }
15222
15229
  )
15223
15230
  ]
@@ -15585,12 +15592,12 @@ var init_BloomQuizBlock = __esm({
15585
15592
  init_useEventBus();
15586
15593
  init_cn();
15587
15594
  BLOOM_CONFIG = {
15588
- remember: { color: "bg-gray-500", bgColor: "bg-gray-50 dark:bg-gray-900/30", label: "Remember" },
15589
- understand: { color: "bg-blue-500", bgColor: "bg-blue-50 dark:bg-blue-900/30", label: "Understand" },
15590
- apply: { color: "bg-green-500", bgColor: "bg-green-50 dark:bg-green-900/30", label: "Apply" },
15591
- analyze: { color: "bg-yellow-500", bgColor: "bg-yellow-50 dark:bg-yellow-900/30", label: "Analyze" },
15592
- evaluate: { color: "bg-orange-500", bgColor: "bg-orange-50 dark:bg-orange-900/30", label: "Evaluate" },
15593
- create: { color: "bg-purple-500", bgColor: "bg-purple-50 dark:bg-purple-900/30", label: "Create" }
15595
+ remember: { color: "bg-secondary text-secondary-foreground", bgColor: "bg-muted", label: "Remember" },
15596
+ understand: { color: "bg-info text-info-foreground", bgColor: "bg-info/10", label: "Understand" },
15597
+ apply: { color: "bg-success text-success-foreground", bgColor: "bg-success/10", label: "Apply" },
15598
+ analyze: { color: "bg-warning text-warning-foreground", bgColor: "bg-warning/10", label: "Analyze" },
15599
+ evaluate: { color: "bg-accent text-accent-foreground", bgColor: "bg-accent/10", label: "Evaluate" },
15600
+ create: { color: "bg-primary text-primary-foreground", bgColor: "bg-primary/10", label: "Create" }
15594
15601
  };
15595
15602
  BloomQuizBlock = ({
15596
15603
  level,
@@ -15616,22 +15623,22 @@ var init_BloomQuizBlock = __esm({
15616
15623
  "div",
15617
15624
  {
15618
15625
  className: cn(
15619
- "rounded-lg border border-indigo-100 dark:border-indigo-800 p-4 my-4 transition-all",
15626
+ "rounded-lg border border-primary p-4 my-4 transition-all",
15620
15627
  config.bgColor,
15621
15628
  className
15622
15629
  ),
15623
15630
  children: [
15624
15631
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between mb-3", children: [
15625
15632
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [
15626
- index !== void 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-gray-500 dark:text-gray-400 font-medium text-sm", children: [
15633
+ index !== void 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-muted-foreground font-medium text-sm", children: [
15627
15634
  "Question ",
15628
15635
  index + 1
15629
15636
  ] }),
15630
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn(config.color, "text-white text-xs px-2 py-1 rounded-full font-medium"), children: config.label })
15637
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn(config.color, "text-xs px-2 py-1 rounded-full font-medium"), children: config.label })
15631
15638
  ] }),
15632
- isAnswered && /* @__PURE__ */ jsxRuntime.jsx(LucideIcons2.CheckCircle, { className: "text-green-600 dark:text-green-400 flex-shrink-0", size: 20 })
15639
+ isAnswered && /* @__PURE__ */ jsxRuntime.jsx(LucideIcons2.CheckCircle, { className: "text-success flex-shrink-0", size: 20 })
15633
15640
  ] }),
15634
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-semibold text-indigo-900 dark:text-indigo-200 mb-3 space-y-2", children: questionSegments.map(
15641
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-semibold text-primary mb-3 space-y-2", children: questionSegments.map(
15635
15642
  (segment, idx) => segment.type === "markdown" ? /* @__PURE__ */ jsxRuntime.jsx(MarkdownContent, { content: segment.content }, `q-md-${idx}`) : /* @__PURE__ */ jsxRuntime.jsx(
15636
15643
  CodeBlock,
15637
15644
  {
@@ -15645,13 +15652,13 @@ var init_BloomQuizBlock = __esm({
15645
15652
  "button",
15646
15653
  {
15647
15654
  type: "button",
15648
- className: "inline-flex items-center rounded-md bg-indigo-600 dark:bg-indigo-500 px-3 py-1.5 text-sm font-medium text-white hover:bg-indigo-700 dark:hover:bg-indigo-600 transition-colors",
15655
+ className: "inline-flex items-center rounded-md bg-primary px-3 py-1.5 text-sm font-medium text-primary-foreground hover:bg-primary-hover transition-colors",
15649
15656
  onClick: handleReveal,
15650
15657
  children: revealed ? "Hide Answer" : "Reveal Answer"
15651
15658
  }
15652
15659
  ),
15653
- revealed && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-lg bg-white/80 dark:bg-gray-800/80 p-3 text-sm text-slate-800 dark:text-gray-200 shadow-sm border border-indigo-100 dark:border-indigo-800 mt-3 space-y-2", children: [
15654
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs text-gray-600 dark:text-gray-400 mb-1 font-medium uppercase tracking-wide", children: "Answer:" }),
15660
+ revealed && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-lg bg-card/80 p-3 text-sm text-foreground shadow-sm border border-primary mt-3 space-y-2", children: [
15661
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs text-muted-foreground mb-1 font-medium uppercase tracking-wide", children: "Answer:" }),
15655
15662
  answerSegments.map(
15656
15663
  (segment, idx) => segment.type === "markdown" ? /* @__PURE__ */ jsxRuntime.jsx(MarkdownContent, { content: segment.content }, `a-md-${idx}`) : /* @__PURE__ */ jsxRuntime.jsx(
15657
15664
  CodeBlock,
@@ -15925,12 +15932,12 @@ var init_QuizBlock = __esm({
15925
15932
  }) => {
15926
15933
  const { t } = hooks.useTranslate();
15927
15934
  const [revealed, setRevealed] = React84.useState(false);
15928
- return /* @__PURE__ */ jsxRuntime.jsx(Card2, { className: cn("my-4 border-blue-200 dark:border-blue-800", className), children: /* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "sm", className: "p-4", children: [
15935
+ return /* @__PURE__ */ jsxRuntime.jsx(Card2, { className: cn("my-4 border-primary", className), children: /* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "sm", className: "p-4", children: [
15929
15936
  /* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "sm", align: "start", children: [
15930
- /* @__PURE__ */ jsxRuntime.jsx(Icon, { icon: LucideIcons2.HelpCircle, size: "sm", className: "text-blue-500 mt-0.5 shrink-0" }),
15937
+ /* @__PURE__ */ jsxRuntime.jsx(Icon, { icon: LucideIcons2.HelpCircle, size: "sm", className: "text-primary mt-0.5 shrink-0" }),
15931
15938
  /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body", className: "font-medium", children: question })
15932
15939
  ] }),
15933
- revealed ? /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "pl-7 pt-2 border-t border-gray-200 dark:border-gray-700", children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body", className: "text-foreground", children: answer }) }) : null,
15940
+ revealed ? /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "pl-7 pt-2 border-t border-border", children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body", className: "text-foreground", children: answer }) }) : null,
15934
15941
  /* @__PURE__ */ jsxRuntime.jsx(
15935
15942
  Button,
15936
15943
  {
@@ -17842,7 +17849,7 @@ var init_BookTableOfContents = __esm({
17842
17849
  className: cn(
17843
17850
  "justify-start text-left w-full",
17844
17851
  direction === "rtl" && "text-right",
17845
- isCurrent && "bg-blue-50 dark:bg-blue-950 text-blue-600 dark:text-blue-400"
17852
+ isCurrent && "bg-primary/10 text-primary"
17846
17853
  ),
17847
17854
  children: /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "truncate", children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body", children: String(chapter.title ?? "") }) })
17848
17855
  },
@@ -19090,7 +19097,7 @@ function CalendarGrid({
19090
19097
  border: true,
19091
19098
  className: cn(
19092
19099
  "cursor-pointer hover:shadow-sm transition-shadow text-xs truncate",
19093
- color ? color : "bg-blue-500/15 border-blue-500/30 text-blue-600"
19100
+ color ? color : "bg-primary/10 border-primary/30 text-primary"
19094
19101
  ),
19095
19102
  onClick: (e) => handleEventClick(event, e),
19096
19103
  children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "truncate font-medium", children: event.title })
@@ -19188,7 +19195,7 @@ function CalendarGrid({
19188
19195
  onClick: () => handleSlotClick(day, time),
19189
19196
  className: cn(
19190
19197
  "border-l border-border",
19191
- isToday && "bg-blue-50/30"
19198
+ isToday && "bg-primary/10"
19192
19199
  ),
19193
19200
  ...longPressEvent ? {
19194
19201
  onPointerDown: () => startLongPress(day, time),
@@ -21204,31 +21211,31 @@ var init_CodeRunnerPanel = __esm({
21204
21211
  }
21205
21212
  )
21206
21213
  ] }),
21207
- hasOutput && /* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "rounded-lg border border-gray-700 bg-[#0d0d0d] overflow-hidden", children: [
21214
+ hasOutput && /* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "rounded-lg border border-border bg-foreground overflow-hidden", children: [
21208
21215
  /* @__PURE__ */ jsxRuntime.jsxs(
21209
21216
  HStack,
21210
21217
  {
21211
21218
  gap: "sm",
21212
21219
  align: "center",
21213
- className: "px-3 py-2 bg-gray-800 border-b border-gray-700",
21220
+ className: "px-3 py-2 bg-card border-b border-border",
21214
21221
  children: [
21215
- /* @__PURE__ */ jsxRuntime.jsx(LucideIcons2.Terminal, { size: 16, className: "text-gray-400" }),
21216
- /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-gray-300 font-medium", children: "Output" })
21222
+ /* @__PURE__ */ jsxRuntime.jsx(LucideIcons2.Terminal, { size: 16, className: "text-muted-foreground" }),
21223
+ /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-foreground font-medium", children: "Output" })
21217
21224
  ]
21218
21225
  }
21219
21226
  ),
21220
- /* @__PURE__ */ jsxRuntime.jsx(VStack, { gap: "none", className: "p-3 font-mono text-sm", children: error ? /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-red-400 whitespace-pre-wrap", children: error }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
21221
- output?.stdout ? /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-gray-200 whitespace-pre-wrap", children: output.stdout }) : null,
21222
- output?.stderr ? /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-red-400 whitespace-pre-wrap", children: output.stderr }) : null,
21223
- !output?.stdout && !output?.stderr ? /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-gray-500 italic", children: "No output" }) : null,
21224
- output && output.testResults.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "mt-3 pt-3 border-t border-gray-700 space-y-2", children: output.testResults.map((test, index) => /* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "sm", align: "start", className: "text-xs", children: [
21225
- test.passed ? /* @__PURE__ */ jsxRuntime.jsx(LucideIcons2.CheckCircle, { size: 14, className: "text-green-400 mt-0.5" }) : /* @__PURE__ */ jsxRuntime.jsx(LucideIcons2.XCircle, { size: 14, className: "text-red-400 mt-0.5" }),
21227
+ /* @__PURE__ */ jsxRuntime.jsx(VStack, { gap: "none", className: "p-3 font-mono text-sm", children: error ? /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-error whitespace-pre-wrap", children: error }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
21228
+ output?.stdout ? /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-background whitespace-pre-wrap", children: output.stdout }) : null,
21229
+ output?.stderr ? /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-error whitespace-pre-wrap", children: output.stderr }) : null,
21230
+ !output?.stdout && !output?.stderr ? /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-background italic", children: "No output" }) : null,
21231
+ output && output.testResults.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "mt-3 pt-3 border-t border-border space-y-2", children: output.testResults.map((test, index) => /* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "sm", align: "start", className: "text-xs", children: [
21232
+ test.passed ? /* @__PURE__ */ jsxRuntime.jsx(LucideIcons2.CheckCircle, { size: 14, className: "text-success mt-0.5" }) : /* @__PURE__ */ jsxRuntime.jsx(LucideIcons2.XCircle, { size: 14, className: "text-error mt-0.5" }),
21226
21233
  /* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "xs", className: "flex-1", children: [
21227
21234
  /* @__PURE__ */ jsxRuntime.jsxs(
21228
21235
  Typography,
21229
21236
  {
21230
21237
  variant: "small",
21231
- className: test.passed ? "text-green-400" : "text-red-400",
21238
+ className: test.passed ? "text-success" : "text-error",
21232
21239
  children: [
21233
21240
  "Test ",
21234
21241
  index + 1,
@@ -21237,15 +21244,15 @@ var init_CodeRunnerPanel = __esm({
21237
21244
  ]
21238
21245
  }
21239
21246
  ),
21240
- /* @__PURE__ */ jsxRuntime.jsxs(Typography, { variant: "small", className: "text-gray-400", children: [
21247
+ /* @__PURE__ */ jsxRuntime.jsxs(Typography, { variant: "small", className: "text-background", children: [
21241
21248
  "Input: ",
21242
21249
  test.input
21243
21250
  ] }),
21244
- /* @__PURE__ */ jsxRuntime.jsxs(Typography, { variant: "small", className: "text-gray-400", children: [
21251
+ /* @__PURE__ */ jsxRuntime.jsxs(Typography, { variant: "small", className: "text-background", children: [
21245
21252
  "Expected: ",
21246
21253
  test.expectedOutput
21247
21254
  ] }),
21248
- /* @__PURE__ */ jsxRuntime.jsxs(Typography, { variant: "small", className: "text-gray-400", children: [
21255
+ /* @__PURE__ */ jsxRuntime.jsxs(Typography, { variant: "small", className: "text-background", children: [
21249
21256
  "Actual: ",
21250
21257
  test.actualOutput
21251
21258
  ] })
@@ -21430,14 +21437,14 @@ var init_ConnectionBlock = __esm({
21430
21437
  "div",
21431
21438
  {
21432
21439
  className: cn(
21433
- "bg-emerald-50 dark:bg-emerald-900/20 border-l-4 border-emerald-500 rounded-r-lg p-5 mb-6",
21440
+ "bg-success/10 border-l-4 border-success rounded-r-lg p-5 mb-6",
21434
21441
  className
21435
21442
  ),
21436
21443
  children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-3", children: [
21437
- /* @__PURE__ */ jsxRuntime.jsx(LucideIcons2.Link2, { className: "text-emerald-600 dark:text-emerald-400 flex-shrink-0 mt-1", size: 20 }),
21444
+ /* @__PURE__ */ jsxRuntime.jsx(LucideIcons2.Link2, { className: "text-success flex-shrink-0 mt-1", size: 20 }),
21438
21445
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1", children: [
21439
- /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "font-semibold text-emerald-900 dark:text-emerald-100 mb-2", children: "Building On What You Know" }),
21440
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "prose dark:prose-invert prose-sm max-w-none text-gray-700 dark:text-gray-300", children: /* @__PURE__ */ jsxRuntime.jsx(MarkdownContent, { content }) })
21446
+ /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "font-semibold text-success mb-2", children: "Building On What You Know" }),
21447
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "prose dark:prose-invert prose-sm max-w-none text-foreground", children: /* @__PURE__ */ jsxRuntime.jsx(MarkdownContent, { content }) })
21441
21448
  ] })
21442
21449
  ] })
21443
21450
  }
@@ -21524,7 +21531,7 @@ function CounterStandard({
21524
21531
  variant: "h1",
21525
21532
  className: cn(
21526
21533
  sizeStyles8[size].display,
21527
- "font-bold tabular-nums text-primary-600"
21534
+ "font-bold tabular-nums text-primary"
21528
21535
  ),
21529
21536
  children: resolved.count
21530
21537
  }
@@ -21597,7 +21604,7 @@ function CounterFull({
21597
21604
  variant: "h1",
21598
21605
  className: cn(
21599
21606
  sizeStyles8[size].display,
21600
- "font-bold tabular-nums text-primary-600"
21607
+ "font-bold tabular-nums text-primary"
21601
21608
  ),
21602
21609
  children: resolved.count
21603
21610
  }
@@ -21858,11 +21865,11 @@ var init_DashboardLayout = __esm({
21858
21865
  className: "h-16 px-4 border-b border-border dark:border-border",
21859
21866
  children: [
21860
21867
  /* @__PURE__ */ jsxRuntime.jsxs(reactRouterDom.Link, { to: "/", className: "flex items-center gap-2", children: [
21861
- logo || /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "w-8 h-8 bg-primary-600 rounded-lg flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(
21868
+ logo || /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "w-8 h-8 bg-primary rounded-lg flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(
21862
21869
  Typography,
21863
21870
  {
21864
21871
  variant: "small",
21865
- className: "text-white font-bold text-sm",
21872
+ className: "text-primary-foreground font-bold text-sm",
21866
21873
  as: "span",
21867
21874
  children: appName.charAt(0).toUpperCase()
21868
21875
  }
@@ -21941,11 +21948,11 @@ var init_DashboardLayout = __esm({
21941
21948
  className: "hidden @md/dashboard:flex items-center gap-1 overflow-x-auto",
21942
21949
  children: [
21943
21950
  /* @__PURE__ */ jsxRuntime.jsxs(reactRouterDom.Link, { to: "/", className: "flex items-center gap-2 mr-3 shrink-0", children: [
21944
- logo || /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "w-7 h-7 bg-primary-600 rounded-lg flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(
21951
+ logo || /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "w-7 h-7 bg-primary rounded-lg flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(
21945
21952
  Typography,
21946
21953
  {
21947
21954
  variant: "small",
21948
- className: "text-white font-bold text-xs",
21955
+ className: "text-primary-foreground font-bold text-xs",
21949
21956
  as: "span",
21950
21957
  children: appName.charAt(0).toUpperCase()
21951
21958
  }
@@ -22005,8 +22012,8 @@ var init_DashboardLayout = __esm({
22005
22012
  {
22006
22013
  as: "span",
22007
22014
  className: cn(
22008
- "absolute -top-0.5 -right-0.5 min-w-[18px] h-[18px] px-1 rounded-full text-xs font-semibold text-white flex items-center justify-center",
22009
- action.variant === "danger" ? "bg-error" : action.variant === "primary" ? "bg-primary" : "bg-foreground"
22015
+ "absolute -top-0.5 -right-0.5 min-w-[18px] h-[18px] px-1 rounded-full text-xs font-semibold flex items-center justify-center",
22016
+ action.variant === "danger" ? "bg-error text-error-foreground" : action.variant === "primary" ? "bg-primary text-primary-foreground" : "bg-foreground text-background"
22010
22017
  ),
22011
22018
  children: action.badge
22012
22019
  }
@@ -22028,7 +22035,7 @@ var init_DashboardLayout = __esm({
22028
22035
  Box,
22029
22036
  {
22030
22037
  as: "span",
22031
- className: "absolute -top-0.5 -right-0.5 min-w-[18px] h-[18px] px-1 bg-error rounded-full text-xs font-semibold text-white flex items-center justify-center",
22038
+ className: "absolute -top-0.5 -right-0.5 min-w-[18px] h-[18px] px-1 bg-error rounded-full text-xs font-semibold text-error-foreground flex items-center justify-center",
22032
22039
  children: unreadCount > 99 ? "99+" : unreadCount
22033
22040
  }
22034
22041
  )
@@ -22311,7 +22318,7 @@ function SubMenu({
22311
22318
  ),
22312
22319
  children: [
22313
22320
  item.icon && (typeof item.icon === "string" ? /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: item.icon, size: "sm", className: "flex-shrink-0" }) : /* @__PURE__ */ jsxRuntime.jsx(Icon, { icon: item.icon, size: "sm", className: "flex-shrink-0" })),
22314
- /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: cn("flex-1", isDanger && "text-red-600"), children: item.label }),
22321
+ /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: cn("flex-1", isDanger && "text-error"), children: item.label }),
22315
22322
  item.badge !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-auto text-xs font-medium", children: item.badge })
22316
22323
  ]
22317
22324
  },
@@ -22368,7 +22375,7 @@ function MenuItemRow({
22368
22375
  Typography,
22369
22376
  {
22370
22377
  variant: "small",
22371
- className: cn("flex-1", isDanger && "text-red-600"),
22378
+ className: cn("flex-1", isDanger && "text-error"),
22372
22379
  children: item.label
22373
22380
  }
22374
22381
  ),
@@ -23136,14 +23143,25 @@ function DataGrid({
23136
23143
  const bodyFields = fieldDefs.filter((f3) => f3 !== titleField && !badgeFields.includes(f3));
23137
23144
  const primaryActions = actionDefs.filter((a) => a.variant !== "danger");
23138
23145
  const dangerActions = actionDefs.filter((a) => a.variant === "danger");
23139
- const handleActionClick = (action, itemData) => (e) => {
23140
- e.stopPropagation();
23146
+ const fireAction = (action, itemData) => {
23147
+ if (action.navigatesTo) {
23148
+ const url = action.navigatesTo.replace(
23149
+ /\{\{row\.(\w+(?:\.\w+)*)\}\}/g,
23150
+ (_, field) => String(itemData[field] ?? "")
23151
+ );
23152
+ eventBus.emit("UI:NAVIGATE", { url, row: itemData });
23153
+ return;
23154
+ }
23141
23155
  const payload = {
23142
23156
  id: itemData.id,
23143
23157
  row: itemData
23144
23158
  };
23145
23159
  eventBus.emit(`UI:${action.event}`, payload);
23146
23160
  };
23161
+ const handleActionClick = (action, itemData) => (e) => {
23162
+ e.stopPropagation();
23163
+ fireAction(action, itemData);
23164
+ };
23147
23165
  const hasRenderProp = typeof children === "function";
23148
23166
  React84.useEffect(() => {
23149
23167
  if (data.length > 0 && !hasRenderProp && fieldDefs.length === 0) {
@@ -23210,13 +23228,46 @@ function DataGrid({
23210
23228
  const wrapDnd = (node) => dnd.isZone ? /* @__PURE__ */ jsxRuntime.jsx(dnd.SortableItem, { id: dndId, children: node }, dndId) : node;
23211
23229
  if (hasRenderProp) {
23212
23230
  return wrapDnd(
23213
- /* @__PURE__ */ jsxRuntime.jsx(
23231
+ /* @__PURE__ */ jsxRuntime.jsxs(
23214
23232
  Box,
23215
23233
  {
23216
23234
  "data-entity-row": true,
23217
23235
  "data-entity-id": id,
23218
23236
  className: cn(isSelected && "ring-2 ring-primary rounded-lg"),
23219
- children: children(itemData, index)
23237
+ children: [
23238
+ children(itemData, index),
23239
+ actionDefs.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "px-4 py-3 border-t border-border", children: /* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "sm", className: "justify-end", children: [
23240
+ (maxInlineActions != null ? actionDefs.slice(0, maxInlineActions) : actionDefs).map((action, idx) => /* @__PURE__ */ jsxRuntime.jsxs(
23241
+ Button,
23242
+ {
23243
+ variant: action.variant === "primary" ? "primary" : "ghost",
23244
+ size: "sm",
23245
+ onClick: handleActionClick(action, itemData),
23246
+ "data-testid": `action-${action.event}`,
23247
+ "data-row-id": String(itemData.id),
23248
+ className: action.variant === "danger" ? "text-error hover:text-error hover:bg-error/10" : void 0,
23249
+ children: [
23250
+ action.icon && renderIconInput(action.icon, { size: "xs", className: "mr-1" }),
23251
+ action.label
23252
+ ]
23253
+ },
23254
+ idx
23255
+ )),
23256
+ maxInlineActions != null && actionDefs.length > maxInlineActions && /* @__PURE__ */ jsxRuntime.jsx(
23257
+ Menu,
23258
+ {
23259
+ position: "bottom-end",
23260
+ trigger: /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "ghost", size: "sm", "aria-label": t("common.actions"), "data-testid": "action-overflow", children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "more-horizontal", size: "xs" }) }),
23261
+ items: actionDefs.slice(maxInlineActions).map((action) => ({
23262
+ label: action.label,
23263
+ icon: action.icon,
23264
+ event: action.event,
23265
+ onClick: () => fireAction(action, itemData)
23266
+ }))
23267
+ }
23268
+ )
23269
+ ] }) })
23270
+ ]
23220
23271
  },
23221
23272
  id
23222
23273
  )
@@ -23353,10 +23404,7 @@ function DataGrid({
23353
23404
  label: action.label,
23354
23405
  icon: action.icon,
23355
23406
  event: action.event,
23356
- onClick: () => eventBus.emit(`UI:${action.event}`, {
23357
- id: itemData.id,
23358
- row: itemData
23359
- })
23407
+ onClick: () => fireAction(action, itemData)
23360
23408
  }))
23361
23409
  }
23362
23410
  )
@@ -24240,7 +24288,9 @@ var init_FilterGroup = __esm({
24240
24288
  showIcon = true,
24241
24289
  query,
24242
24290
  isLoading,
24243
- look = "toolbar"
24291
+ look = "toolbar",
24292
+ event,
24293
+ clearEvent
24244
24294
  }) => {
24245
24295
  const { t } = hooks.useTranslate();
24246
24296
  const eventBus = useEventBus();
@@ -24277,14 +24327,18 @@ var init_FilterGroup = __esm({
24277
24327
  queryState.setFilter(field, value === "all" ? null : value);
24278
24328
  }
24279
24329
  onFilterChange?.(field, value === "all" ? null : value);
24280
- eventBus.emit("UI:FILTER", {
24330
+ const payload = {
24281
24331
  entity,
24282
24332
  field,
24283
24333
  value: value === "all" || value === null ? "" : value,
24284
24334
  query
24285
- });
24335
+ };
24336
+ if (event && event !== "FILTER") {
24337
+ eventBus.emit(`UI:${event}`, payload);
24338
+ }
24339
+ eventBus.emit("UI:FILTER", payload);
24286
24340
  },
24287
- [onFilterChange, queryState, eventBus, entity, query]
24341
+ [onFilterChange, queryState, eventBus, entity, query, event]
24288
24342
  );
24289
24343
  const handleClearAll = React84.useCallback(() => {
24290
24344
  setSelectedValues({});
@@ -24292,8 +24346,11 @@ var init_FilterGroup = __esm({
24292
24346
  queryState.clearFilters();
24293
24347
  }
24294
24348
  onClearAll?.();
24349
+ if (clearEvent && clearEvent !== "CLEAR_FILTERS") {
24350
+ eventBus.emit(`UI:${clearEvent}`, { entity, query });
24351
+ }
24295
24352
  eventBus.emit("UI:CLEAR_FILTERS", { entity, query });
24296
- }, [onClearAll, queryState, eventBus, entity, query]);
24353
+ }, [onClearAll, queryState, eventBus, entity, query, clearEvent]);
24297
24354
  const activeFilterCount = Object.keys(selectedValues).length;
24298
24355
  if (variant === "pills") {
24299
24356
  return /* @__PURE__ */ jsxRuntime.jsxs(
@@ -25274,8 +25331,8 @@ var init_RelationSelect = __esm({
25274
25331
  disabled,
25275
25332
  className: cn(
25276
25333
  "w-full justify-between font-normal",
25277
- error && "border-red-300 focus:border-red-500 focus:ring-red-500",
25278
- isOpen && "ring-2 ring-primary-500 border-primary-500"
25334
+ error && "border-error/50 focus:border-error focus:ring-error",
25335
+ isOpen && "ring-2 ring-primary border-primary"
25279
25336
  ),
25280
25337
  children: [
25281
25338
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -25355,7 +25412,7 @@ var init_RelationSelect = __esm({
25355
25412
  paddingY: "sm",
25356
25413
  className: cn(
25357
25414
  "text-left text-sm hover:bg-muted focus:outline-none focus:bg-muted",
25358
- option.value === value && "bg-primary-50 text-primary-700",
25415
+ option.value === value && "bg-primary/10 text-primary",
25359
25416
  option.disabled && "opacity-50 cursor-not-allowed"
25360
25417
  ),
25361
25418
  onClick: () => handleSelect(option),
@@ -25421,7 +25478,7 @@ var init_SearchInput = __esm({
25421
25478
  queryState.setSearch(newValue);
25422
25479
  }
25423
25480
  onSearch?.(newValue);
25424
- if (event) {
25481
+ if (event && event !== "SEARCH") {
25425
25482
  eventBus.emit(`UI:${event}`, { searchTerm: newValue, entity });
25426
25483
  }
25427
25484
  if (event || entity || query) {
@@ -25512,7 +25569,7 @@ var init_SidePanel = __esm({
25512
25569
  showOverlay && /* @__PURE__ */ jsxRuntime.jsx(Presence, { show: isOpen, animation: "overlay", children: /* @__PURE__ */ jsxRuntime.jsx(
25513
25570
  Box,
25514
25571
  {
25515
- className: "fixed inset-0 bg-white/80 backdrop-blur-sm z-40 lg:hidden",
25572
+ className: "fixed inset-0 bg-background/80 backdrop-blur-sm z-40 lg:hidden",
25516
25573
  onClick: handleClose
25517
25574
  }
25518
25575
  ) }),
@@ -25879,7 +25936,7 @@ var init_WizardNavigation = __esm({
25879
25936
  /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "chevron-left", size: "sm" }),
25880
25937
  resolvedBackLabel
25881
25938
  ] }) : /* @__PURE__ */ jsxRuntime.jsx(Box, {}),
25882
- /* @__PURE__ */ jsxRuntime.jsx(HStack, { align: "center", gap: "sm", children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "caption", className: "text-neutral-500", children: t("wizard.stepOf", { current: String(currentStep + 1), total: String(totalSteps) }) }) }),
25939
+ /* @__PURE__ */ jsxRuntime.jsx(HStack, { align: "center", gap: "sm", children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "caption", className: "text-muted-foreground", children: t("wizard.stepOf", { current: String(currentStep + 1), total: String(totalSteps) }) }) }),
25883
25940
  isLastStep && showComplete ? /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "primary", onClick: handleComplete, disabled: !isValid, children: resolvedCompleteLabel }) : showNext ? /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "primary", onClick: handleNext, disabled: !isValid, children: [
25884
25941
  resolvedNextLabel,
25885
25942
  /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "chevron-right", size: "sm" })
@@ -28036,6 +28093,7 @@ var init_Lightbox = __esm({
28036
28093
  {
28037
28094
  className: cn(
28038
28095
  "fixed inset-0 z-50 flex items-center justify-center",
28096
+ // eslint-disable-next-line almadar/no-hardcoded-colors -- media overlay: lightbox scrim behind images
28039
28097
  "bg-black bg-opacity-90",
28040
28098
  className
28041
28099
  ),
@@ -28058,7 +28116,7 @@ var init_Lightbox = __esm({
28058
28116
  "p-2 rounded-full",
28059
28117
  "text-[var(--color-foreground)] bg-[var(--color-card)]",
28060
28118
  "hover:bg-opacity-70 transition-opacity",
28061
- "focus:outline-none focus:ring-2 focus:ring-white"
28119
+ "focus:outline-none focus:ring-2 focus:ring-ring"
28062
28120
  ),
28063
28121
  "aria-label": t("aria.closeModal"),
28064
28122
  children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "x", className: "w-6 h-6" })
@@ -28077,7 +28135,7 @@ var init_Lightbox = __esm({
28077
28135
  "p-2 rounded-full",
28078
28136
  "text-[var(--color-foreground)] bg-[var(--color-card)]",
28079
28137
  "hover:bg-opacity-70 transition-opacity",
28080
- "focus:outline-none focus:ring-2 focus:ring-white"
28138
+ "focus:outline-none focus:ring-2 focus:ring-ring"
28081
28139
  ),
28082
28140
  "aria-label": t("aria.previousImage"),
28083
28141
  children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "chevron-left", className: "w-8 h-8" })
@@ -28114,7 +28172,7 @@ var init_Lightbox = __esm({
28114
28172
  "p-2 rounded-full",
28115
28173
  "text-[var(--color-foreground)] bg-[var(--color-card)]",
28116
28174
  "hover:bg-opacity-70 transition-opacity",
28117
- "focus:outline-none focus:ring-2 focus:ring-white"
28175
+ "focus:outline-none focus:ring-2 focus:ring-ring"
28118
28176
  ),
28119
28177
  "aria-label": t("aria.nextImage"),
28120
28178
  children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "chevron-right", className: "w-8 h-8" })
@@ -31187,6 +31245,7 @@ var init_QrScanner = __esm({
31187
31245
  overflow: "hidden",
31188
31246
  rounded: "sm",
31189
31247
  className: cn(
31248
+ // eslint-disable-next-line almadar/no-hardcoded-colors -- media overlay: always over a dark scrim
31190
31249
  "bg-black",
31191
31250
  "aspect-square w-full max-w-md",
31192
31251
  className
@@ -31251,7 +31310,9 @@ var init_QrScanner = __esm({
31251
31310
  type: "button",
31252
31311
  onClick: togglePause,
31253
31312
  className: cn(
31313
+ // eslint-disable-next-line almadar/no-hardcoded-colors -- media overlay: always over a dark scrim
31254
31314
  "rounded-full bg-black bg-opacity-60 p-2 text-white",
31315
+ // eslint-disable-next-line almadar/no-hardcoded-colors -- media overlay: always over a dark scrim
31255
31316
  "hover:bg-opacity-80 focus:outline-none focus:ring-2 focus:ring-white"
31256
31317
  ),
31257
31318
  "aria-label": isPaused ? t("qrScanner.resumeScanning") : t("qrScanner.pauseScanning"),
@@ -31264,7 +31325,9 @@ var init_QrScanner = __esm({
31264
31325
  type: "button",
31265
31326
  onClick: toggleFacing,
31266
31327
  className: cn(
31328
+ // eslint-disable-next-line almadar/no-hardcoded-colors -- media overlay: always over a dark scrim
31267
31329
  "rounded-full bg-black bg-opacity-60 p-2 text-white",
31330
+ // eslint-disable-next-line almadar/no-hardcoded-colors -- media overlay: always over a dark scrim
31268
31331
  "hover:bg-opacity-80 focus:outline-none focus:ring-2 focus:ring-white"
31269
31332
  ),
31270
31333
  "aria-label": currentFacing === "environment" ? t("qrScanner.switchToFrontCamera") : t("qrScanner.switchToRearCamera"),
@@ -31277,7 +31340,9 @@ var init_QrScanner = __esm({
31277
31340
  type: "button",
31278
31341
  onClick: handleMockScan,
31279
31342
  className: cn(
31343
+ // eslint-disable-next-line almadar/no-hardcoded-colors -- media overlay: always over a dark scrim
31280
31344
  "rounded-full bg-black bg-opacity-60 px-3 py-2 text-xs text-white",
31345
+ // eslint-disable-next-line almadar/no-hardcoded-colors -- media overlay: always over a dark scrim
31281
31346
  "hover:bg-opacity-80 focus:outline-none focus:ring-2 focus:ring-white"
31282
31347
  ),
31283
31348
  "aria-label": t("aria.mockScanDev"),
@@ -34013,10 +34078,10 @@ var init_ModuleCard = __esm({
34013
34078
  init_avl_atom_types();
34014
34079
  init_MiniStateMachine();
34015
34080
  PERSISTENCE_BORDER = {
34016
- persistent: "border-l-[3px] border-l-blue-500 border-solid",
34017
- runtime: "border-l-[3px] border-l-blue-500 border-dashed",
34018
- singleton: "border-l-[3px] border-l-blue-500 border-double",
34019
- instance: "border-l-[3px] border-l-blue-500 border-dotted"
34081
+ persistent: "border-l-[3px] border-l-primary border-solid",
34082
+ runtime: "border-l-[3px] border-l-primary border-dashed",
34083
+ singleton: "border-l-[3px] border-l-primary border-double",
34084
+ instance: "border-l-[3px] border-l-primary border-dotted"
34020
34085
  };
34021
34086
  PERSISTENCE_ICON = {
34022
34087
  persistent: "\u26C1",
@@ -34046,8 +34111,8 @@ var init_ModuleCard = __esm({
34046
34111
  className: "rounded-lg border border-[var(--color-border)] bg-[var(--color-card)] shadow-sm overflow-hidden",
34047
34112
  style: { minWidth: 280, maxWidth: 400 },
34048
34113
  children: [
34049
- /* @__PURE__ */ jsxRuntime.jsx(react.Handle, { type: "target", position: react.Position.Left, className: "!w-2.5 !h-2.5 !bg-orange-400" }),
34050
- /* @__PURE__ */ jsxRuntime.jsx(react.Handle, { type: "source", position: react.Position.Right, className: "!w-2.5 !h-2.5 !bg-orange-400" }),
34114
+ /* @__PURE__ */ jsxRuntime.jsx(react.Handle, { type: "target", position: react.Position.Left, className: "!w-2.5 !h-2.5 !bg-warning" }),
34115
+ /* @__PURE__ */ jsxRuntime.jsx(react.Handle, { type: "source", position: react.Position.Right, className: "!w-2.5 !h-2.5 !bg-warning" }),
34051
34116
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-3 py-2 border-b border-[var(--color-border)]", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-base font-bold text-[var(--color-foreground)]", children: orbitalName }) }),
34052
34117
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `px-3 py-2 border-b border-[var(--color-border)] ${PERSISTENCE_BORDER[persistence] ?? ""}`, children: [
34053
34118
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1.5 mb-1.5", children: [
@@ -36503,19 +36568,19 @@ var init_ReflectionBlock = __esm({
36503
36568
  "div",
36504
36569
  {
36505
36570
  className: cn(
36506
- "my-6 border-l-4 border-amber-400 bg-amber-50 dark:bg-amber-900/20 rounded-r-lg p-4",
36571
+ "my-6 border-l-4 border-warning bg-warning/10 rounded-r-lg p-4",
36507
36572
  className
36508
36573
  ),
36509
36574
  children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-3", children: [
36510
- /* @__PURE__ */ jsxRuntime.jsx(LucideIcons2.PauseCircle, { className: "text-amber-600 dark:text-amber-400 flex-shrink-0 mt-1", size: 20 }),
36575
+ /* @__PURE__ */ jsxRuntime.jsx(LucideIcons2.PauseCircle, { className: "text-warning flex-shrink-0 mt-1", size: 20 }),
36511
36576
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1", children: [
36512
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-medium text-amber-900 dark:text-amber-100 mb-2", children: "Pause & Reflect" }),
36513
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-700 dark:text-gray-300 text-sm mb-3", children: prompt }),
36577
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-medium text-warning mb-2", children: "Pause & Reflect" }),
36578
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-foreground text-sm mb-3", children: prompt }),
36514
36579
  isExpanded ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
36515
36580
  /* @__PURE__ */ jsxRuntime.jsx(
36516
36581
  "textarea",
36517
36582
  {
36518
- className: "w-full p-2 border border-amber-300 dark:border-amber-700 rounded text-sm bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 focus:ring-2 focus:ring-amber-500 focus:border-transparent",
36583
+ className: "w-full p-2 border border-input rounded text-sm bg-card text-foreground focus:ring-2 focus:ring-ring focus:border-transparent",
36519
36584
  placeholder: "Your thoughts...",
36520
36585
  value: note,
36521
36586
  onChange: (e) => setNote(e.target.value),
@@ -36526,7 +36591,7 @@ var init_ReflectionBlock = __esm({
36526
36591
  "button",
36527
36592
  {
36528
36593
  onClick: handleSave,
36529
- className: "mt-2 text-sm px-3 py-1 bg-amber-600 text-white rounded hover:bg-amber-700 transition-colors",
36594
+ className: "mt-2 text-sm px-3 py-1 bg-warning text-warning-foreground rounded hover:opacity-90 transition-colors",
36530
36595
  children: "Save & Continue"
36531
36596
  }
36532
36597
  )
@@ -36534,7 +36599,7 @@ var init_ReflectionBlock = __esm({
36534
36599
  "button",
36535
36600
  {
36536
36601
  onClick: () => setIsExpanded(true),
36537
- className: "text-sm text-amber-600 dark:text-amber-400 hover:underline",
36602
+ className: "text-sm text-warning hover:underline",
36538
36603
  children: savedNote ? "\u2713 Answered \xB7 Edit" : "Answer this question"
36539
36604
  }
36540
36605
  )
@@ -36820,7 +36885,7 @@ function DataTable({
36820
36885
  )),
36821
36886
  rowActions && /* @__PURE__ */ jsxRuntime.jsx("th", { className: "w-12 px-4 py-3" })
36822
36887
  ] }) }),
36823
- /* @__PURE__ */ jsxRuntime.jsx("tbody", { className: "divide-y divide-gray-200 dark:divide-gray-700", children: isLoading ? /* @__PURE__ */ jsxRuntime.jsx("tr", { children: /* @__PURE__ */ jsxRuntime.jsx(
36888
+ /* @__PURE__ */ jsxRuntime.jsx("tbody", { className: "divide-y divide-border", children: isLoading ? /* @__PURE__ */ jsxRuntime.jsx("tr", { children: /* @__PURE__ */ jsxRuntime.jsx(
36824
36889
  "td",
36825
36890
  {
36826
36891
  colSpan: normalizedColumns.length + (selectable ? 1 : 0) + (rowActions ? 1 : 0),
@@ -37191,7 +37256,7 @@ var init_DetailPanel = __esm({
37191
37256
  };
37192
37257
  const effectiveFieldNames = isFieldDefArray(propFields) ? normalizeFieldDefs(propFields) : fieldNames;
37193
37258
  const fieldTypeMap = isFieldDefArray(propFields) ? buildFieldTypeMap(propFields) : {};
37194
- React84.useCallback(
37259
+ const handleActionClick = React84.useCallback(
37195
37260
  (action, data2) => {
37196
37261
  if (action.navigatesTo) {
37197
37262
  const url = action.navigatesTo.replace(
@@ -37383,8 +37448,9 @@ var init_DetailPanel = __esm({
37383
37448
  {
37384
37449
  variant: action.variant || "secondary",
37385
37450
  size: "sm",
37386
- action: action.event,
37451
+ action: action.navigatesTo ? void 0 : action.event,
37387
37452
  actionPayload: { row: normalizedData },
37453
+ onClick: action.navigatesTo ? () => handleActionClick(action, normalizedData) : void 0,
37388
37454
  icon: action.icon,
37389
37455
  "data-testid": action.event ? `action-${action.event}` : void 0,
37390
37456
  "data-row-id": normalizedData?.id !== void 0 ? String(normalizedData.id) : void 0,
@@ -39427,8 +39493,9 @@ var init_MediaGallery = __esm({
39427
39493
  )
39428
39494
  }
39429
39495
  ),
39430
- item.caption && /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "absolute bottom-0 left-0 right-0 p-2 bg-gradient-to-t from-black/60 to-transparent", children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "caption", className: "text-white truncate", children: item.caption }) }),
39431
- selectable && isSelected && /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "absolute top-2 right-2 w-5 h-5 rounded-full bg-primary flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "caption", className: "text-white text-xs", children: "\u2713" }) })
39496
+ item.caption && // eslint-disable-next-line almadar/no-hardcoded-colors -- media overlay: caption scrim over image
39497
+ /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "absolute bottom-0 left-0 right-0 p-2 bg-gradient-to-t from-black/60 to-transparent", children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "caption", className: "text-white truncate", children: item.caption }) }),
39498
+ selectable && isSelected && /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "absolute top-2 right-2 w-5 h-5 rounded-full bg-primary flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "caption", className: "text-primary-foreground text-xs", children: "\u2713" }) })
39432
39499
  ]
39433
39500
  },
39434
39501
  item.id
@@ -39457,7 +39524,7 @@ var init_MediaGallery = __esm({
39457
39524
  size: "sm",
39458
39525
  icon: LucideIcons2.X,
39459
39526
  action: "LIGHTBOX_CLOSE",
39460
- className: "text-white hover:bg-white/20"
39527
+ className: "text-foreground hover:bg-muted/50"
39461
39528
  }
39462
39529
  ) }),
39463
39530
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -39468,7 +39535,7 @@ var init_MediaGallery = __esm({
39468
39535
  className: "max-w-full max-h-[80vh] object-contain rounded-md"
39469
39536
  }
39470
39537
  ),
39471
- lightboxItem.caption && /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body", className: "text-white mt-3 text-center", children: lightboxItem.caption })
39538
+ lightboxItem.caption && /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body", className: "text-foreground mt-3 text-center", children: lightboxItem.caption })
39472
39539
  ]
39473
39540
  }
39474
39541
  )
@@ -39910,7 +39977,7 @@ function WalkMinimap() {
39910
39977
  {
39911
39978
  variant,
39912
39979
  size: "sm",
39913
- className: `flex-shrink-0 text-[9px] ${isActive ? "ring-1 ring-cyan-400" : ""}`,
39980
+ className: `flex-shrink-0 text-[9px] ${isActive ? "ring-1 ring-info" : ""}`,
39914
39981
  children: [
39915
39982
  isDone ? "\u2713" : isActive ? "\u25CF" : "\u25CB",
39916
39983
  " ",
@@ -40051,13 +40118,13 @@ function WalkMinimap() {
40051
40118
  })
40052
40119
  ] }) }),
40053
40120
  /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "px-2 py-1 border-t border-border", children: /* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "sm", className: "items-center justify-between", children: [
40054
- /* @__PURE__ */ jsxRuntime.jsxs(Typography, { variant: "caption", className: "text-xs font-mono text-green-500", children: [
40121
+ /* @__PURE__ */ jsxRuntime.jsxs(Typography, { variant: "caption", className: "text-xs font-mono text-success", children: [
40055
40122
  "Engine: ",
40056
40123
  engineCount,
40057
40124
  "/",
40058
40125
  totalTransitions
40059
40126
  ] }),
40060
- domCount > 0 && /* @__PURE__ */ jsxRuntime.jsxs(Typography, { variant: "caption", className: "text-xs font-mono text-cyan-500", children: [
40127
+ domCount > 0 && /* @__PURE__ */ jsxRuntime.jsxs(Typography, { variant: "caption", className: "text-xs font-mono text-info", children: [
40061
40128
  "DOM: ",
40062
40129
  domCount
40063
40130
  ] }),
@@ -40090,13 +40157,13 @@ function TraitsTab({ traits: traits2 }) {
40090
40157
  const accordionItems = traits2.map((trait) => ({
40091
40158
  id: trait.id,
40092
40159
  header: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 w-full", children: [
40093
- /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body", weight: "semibold", className: "text-purple-600 dark:text-purple-400", children: trait.name }),
40160
+ /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body", weight: "semibold", className: "text-primary", children: trait.name }),
40094
40161
  /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "success", size: "sm", children: trait.currentState }),
40095
- /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-gray-500 ml-auto", children: t("debug.transitionsCount", { count: trait.transitionCount }) })
40162
+ /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-muted-foreground ml-auto", children: t("debug.transitionsCount", { count: trait.transitionCount }) })
40096
40163
  ] }),
40097
40164
  content: /* @__PURE__ */ jsxRuntime.jsxs(Stack, { gap: "sm", children: [
40098
40165
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
40099
- /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", weight: "medium", className: "text-gray-500 mb-2", children: t("debug.states") }),
40166
+ /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", weight: "medium", className: "text-muted-foreground mb-2", children: t("debug.states") }),
40100
40167
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap gap-1", children: trait.states.map((state) => /* @__PURE__ */ jsxRuntime.jsx(
40101
40168
  Badge,
40102
40169
  {
@@ -40108,18 +40175,18 @@ function TraitsTab({ traits: traits2 }) {
40108
40175
  )) })
40109
40176
  ] }),
40110
40177
  trait.transitions.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
40111
- /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", weight: "medium", className: "text-gray-500 mb-2", children: t("debug.transitions") }),
40178
+ /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", weight: "medium", className: "text-muted-foreground mb-2", children: t("debug.transitions") }),
40112
40179
  /* @__PURE__ */ jsxRuntime.jsx(Stack, { gap: "xs", children: trait.transitions.map((t2, i) => /* @__PURE__ */ jsxRuntime.jsxs(Typography, { variant: "small", className: "font-mono", children: [
40113
40180
  t2.from,
40114
40181
  " \u2192 ",
40115
40182
  t2.to,
40116
40183
  " ",
40117
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-gray-500", children: [
40184
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-muted-foreground", children: [
40118
40185
  "(",
40119
40186
  t2.event,
40120
40187
  ")"
40121
40188
  ] }),
40122
- t2.guard && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-amber-500", children: [
40189
+ t2.guard && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-warning", children: [
40123
40190
  " [",
40124
40191
  t2.guard,
40125
40192
  "]"
@@ -40127,7 +40194,7 @@ function TraitsTab({ traits: traits2 }) {
40127
40194
  ] }, i)) })
40128
40195
  ] }),
40129
40196
  trait.guards.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
40130
- /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", weight: "medium", className: "text-gray-500 mb-2", children: t("debug.guards") }),
40197
+ /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", weight: "medium", className: "text-muted-foreground mb-2", children: t("debug.guards") }),
40131
40198
  /* @__PURE__ */ jsxRuntime.jsx(Stack, { gap: "xs", children: trait.guards.map((g, i) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
40132
40199
  /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", children: g.name }),
40133
40200
  /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: g.lastResult === true ? "success" : g.lastResult === false ? "danger" : "default", size: "sm", children: g.lastResult === void 0 ? "?" : g.lastResult ? "\u2713" : "\u2717" })
@@ -40170,11 +40237,11 @@ function TicksTab({ ticks: ticks2 }) {
40170
40237
  };
40171
40238
  const TickCard = ({ tick, active }) => /* @__PURE__ */ jsxRuntime.jsxs(Card, { className: `p-3 ${!active ? "opacity-50" : ""}`, children: [
40172
40239
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 mb-2", children: [
40173
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: `w-2 h-2 rounded-full ${active ? "bg-green-500" : "bg-gray-400"}` }),
40174
- /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body", weight: "semibold", className: "text-amber-600 dark:text-amber-400", children: tick.name }),
40175
- /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-gray-500", children: tick.traitName })
40240
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: `w-2 h-2 rounded-full ${active ? "bg-success" : "bg-muted-foreground"}` }),
40241
+ /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body", weight: "semibold", className: "text-warning", children: tick.name }),
40242
+ /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-muted-foreground", children: tick.traitName })
40176
40243
  ] }),
40177
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-3 text-xs text-gray-500", children: [
40244
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-3 text-xs text-muted-foreground", children: [
40178
40245
  /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
40179
40246
  tick.interval,
40180
40247
  "ms"
@@ -40197,7 +40264,7 @@ function TicksTab({ ticks: ticks2 }) {
40197
40264
  ] });
40198
40265
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "debug-tab debug-tab--ticks", children: [
40199
40266
  activeTicks.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-4", children: [
40200
- /* @__PURE__ */ jsxRuntime.jsxs(Typography, { variant: "small", weight: "medium", className: "text-gray-500 mb-2", children: [
40267
+ /* @__PURE__ */ jsxRuntime.jsxs(Typography, { variant: "small", weight: "medium", className: "text-muted-foreground mb-2", children: [
40201
40268
  "Active (",
40202
40269
  activeTicks.length,
40203
40270
  ")"
@@ -40205,7 +40272,7 @@ function TicksTab({ ticks: ticks2 }) {
40205
40272
  /* @__PURE__ */ jsxRuntime.jsx(Stack, { gap: "sm", children: activeTicks.map((tick) => /* @__PURE__ */ jsxRuntime.jsx(TickCard, { tick, active: true }, tick.id)) })
40206
40273
  ] }),
40207
40274
  inactiveTicks.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
40208
- /* @__PURE__ */ jsxRuntime.jsxs(Typography, { variant: "small", weight: "medium", className: "text-gray-400 mb-2", children: [
40275
+ /* @__PURE__ */ jsxRuntime.jsxs(Typography, { variant: "small", weight: "medium", className: "text-muted-foreground mb-2", children: [
40209
40276
  "Inactive (",
40210
40277
  inactiveTicks.length,
40211
40278
  ")"
@@ -40253,33 +40320,33 @@ function EntitiesTab({ snapshot }) {
40253
40320
  id: `singleton-${name}`,
40254
40321
  header: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
40255
40322
  /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "primary", size: "sm", children: t("debug.singleton") }),
40256
- /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body", weight: "semibold", className: "text-sky-600 dark:text-sky-400", children: name })
40323
+ /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body", weight: "semibold", className: "text-info", children: name })
40257
40324
  ] }),
40258
- content: /* @__PURE__ */ jsxRuntime.jsx("pre", { className: "text-xs text-gray-600 dark:text-gray-400 bg-gray-50 dark:bg-gray-800 p-2 rounded overflow-auto max-h-40", children: JSON.stringify(data, null, 2) })
40325
+ content: /* @__PURE__ */ jsxRuntime.jsx("pre", { className: "text-xs text-muted-foreground bg-muted p-2 rounded overflow-auto max-h-40", children: JSON.stringify(data, null, 2) })
40259
40326
  }));
40260
40327
  const runtimeItems = runtimeEntities.slice(0, 20).map((entity) => ({
40261
40328
  id: entity.id,
40262
40329
  header: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
40263
- /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body", weight: "semibold", className: "text-sky-600 dark:text-sky-400", children: entity.type }),
40264
- /* @__PURE__ */ jsxRuntime.jsxs(Typography, { variant: "small", className: "text-gray-500", children: [
40330
+ /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body", weight: "semibold", className: "text-info", children: entity.type }),
40331
+ /* @__PURE__ */ jsxRuntime.jsxs(Typography, { variant: "small", className: "text-muted-foreground", children: [
40265
40332
  "#",
40266
40333
  entity.id.slice(0, 8)
40267
40334
  ] })
40268
40335
  ] }),
40269
- content: /* @__PURE__ */ jsxRuntime.jsx("pre", { className: "text-xs text-gray-600 dark:text-gray-400 bg-gray-50 dark:bg-gray-800 p-2 rounded overflow-auto max-h-40", children: JSON.stringify(entity.data, null, 2) })
40336
+ content: /* @__PURE__ */ jsxRuntime.jsx("pre", { className: "text-xs text-muted-foreground bg-muted p-2 rounded overflow-auto max-h-40", children: JSON.stringify(entity.data, null, 2) })
40270
40337
  }));
40271
40338
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "debug-tab debug-tab--entities", children: [
40272
40339
  singletonItems.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-4", children: [
40273
- /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", weight: "medium", className: "text-gray-500 mb-2", children: t("debug.singletonsCount", { count: singletonItems.length }) }),
40340
+ /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", weight: "medium", className: "text-muted-foreground mb-2", children: t("debug.singletonsCount", { count: singletonItems.length }) }),
40274
40341
  /* @__PURE__ */ jsxRuntime.jsx(Accordion, { items: singletonItems, multiple: true })
40275
40342
  ] }),
40276
40343
  runtimeItems.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-4", children: [
40277
- /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", weight: "medium", className: "text-gray-500 mb-2", children: t("debug.runtimeCount", { count: runtimeEntities.length }) }),
40344
+ /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", weight: "medium", className: "text-muted-foreground mb-2", children: t("debug.runtimeCount", { count: runtimeEntities.length }) }),
40278
40345
  /* @__PURE__ */ jsxRuntime.jsx(Accordion, { items: runtimeItems, multiple: true }),
40279
- runtimeEntities.length > 20 && /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-gray-400 text-center mt-2", children: t("debug.moreEntities", { count: runtimeEntities.length - 20 }) })
40346
+ runtimeEntities.length > 20 && /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-muted-foreground text-center mt-2", children: t("debug.moreEntities", { count: runtimeEntities.length - 20 }) })
40280
40347
  ] }),
40281
40348
  persistentEntries.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
40282
- /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", weight: "medium", className: "text-gray-500 mb-2", children: t("debug.persistent") }),
40349
+ /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", weight: "medium", className: "text-muted-foreground mb-2", children: t("debug.persistent") }),
40283
40350
  /* @__PURE__ */ jsxRuntime.jsx(Stack, { gap: "xs", children: persistentEntries.map(([type, info]) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between py-1", children: [
40284
40351
  /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", children: type }),
40285
40352
  /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: info.loaded ? "success" : "default", size: "sm", children: info.loaded ? t("debug.loadedCount", { count: info.count }) : t("debug.notLoaded") })
@@ -40364,7 +40431,7 @@ function EventFlowTab({ events: events2 }) {
40364
40431
  );
40365
40432
  })
40366
40433
  ] }),
40367
- /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "flex items-center gap-1 text-xs text-gray-500 ml-auto cursor-pointer", children: [
40434
+ /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "flex items-center gap-1 text-xs text-muted-foreground ml-auto cursor-pointer", children: [
40368
40435
  /* @__PURE__ */ jsxRuntime.jsx(
40369
40436
  Checkbox,
40370
40437
  {
@@ -40379,18 +40446,18 @@ function EventFlowTab({ events: events2 }) {
40379
40446
  "div",
40380
40447
  {
40381
40448
  ref: containerRef,
40382
- className: "max-h-64 overflow-y-auto space-y-1 bg-gray-50 dark:bg-gray-800 rounded p-2",
40449
+ className: "max-h-64 overflow-y-auto space-y-1 bg-muted rounded p-2",
40383
40450
  children: filteredEvents.slice(-100).map((event) => {
40384
40451
  const { variant, icon } = TYPE_BADGES[event.type] || { variant: "default", icon: "\u2022" };
40385
40452
  return /* @__PURE__ */ jsxRuntime.jsxs(
40386
40453
  "div",
40387
40454
  {
40388
- className: "flex items-start gap-2 text-xs py-1 hover:bg-gray-100 dark:hover:bg-gray-700 rounded px-1",
40455
+ className: "flex items-start gap-2 text-xs py-1 hover:bg-muted/50 rounded px-1",
40389
40456
  children: [
40390
- /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-gray-400 font-mono min-w-[65px]", children: formatTime2(event.timestamp) }),
40457
+ /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-muted-foreground font-mono min-w-[65px]", children: formatTime2(event.timestamp) }),
40391
40458
  /* @__PURE__ */ jsxRuntime.jsx("span", { children: icon }),
40392
40459
  /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant, size: "sm", className: "min-w-[60px] justify-center", children: event.source }),
40393
- /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-gray-600 dark:text-gray-400", children: event.message })
40460
+ /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-muted-foreground", children: event.message })
40394
40461
  ]
40395
40462
  },
40396
40463
  event.id
@@ -40454,21 +40521,21 @@ function GuardsPanel({ guards }) {
40454
40521
  id: guard.id,
40455
40522
  header: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 w-full", children: [
40456
40523
  /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: guard.result ? "success" : "danger", size: "sm", children: guard.result ? "\u2713" : "\u2717" }),
40457
- /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body", weight: "semibold", className: "text-amber-600 dark:text-amber-400", children: guard.guardName }),
40458
- /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-gray-500", children: guard.context.type === "transition" ? `${guard.context.transitionFrom} \u2192 ${guard.context.transitionTo}` : guard.context.tickName }),
40459
- /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-gray-400 ml-auto", children: formatTime2(guard.timestamp) })
40524
+ /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body", weight: "semibold", className: "text-warning", children: guard.guardName }),
40525
+ /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-muted-foreground", children: guard.context.type === "transition" ? `${guard.context.transitionFrom} \u2192 ${guard.context.transitionTo}` : guard.context.tickName }),
40526
+ /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-muted-foreground ml-auto", children: formatTime2(guard.timestamp) })
40460
40527
  ] }),
40461
40528
  content: /* @__PURE__ */ jsxRuntime.jsxs(Stack, { gap: "sm", children: [
40462
40529
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
40463
- /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", weight: "medium", className: "text-gray-500", children: t("debug.expression") }),
40464
- /* @__PURE__ */ jsxRuntime.jsx("code", { className: "block mt-1 text-xs text-amber-600 dark:text-amber-400 bg-amber-50 dark:bg-amber-900/20 px-2 py-1 rounded", children: guard.expression })
40530
+ /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", weight: "medium", className: "text-muted-foreground", children: t("debug.expression") }),
40531
+ /* @__PURE__ */ jsxRuntime.jsx("code", { className: "block mt-1 text-xs text-warning bg-warning/10 px-2 py-1 rounded", children: guard.expression })
40465
40532
  ] }),
40466
40533
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
40467
- /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", weight: "medium", className: "text-gray-500", children: t("debug.inputs") }),
40468
- /* @__PURE__ */ jsxRuntime.jsx("pre", { className: "mt-1 text-xs text-gray-600 dark:text-gray-400 bg-gray-50 dark:bg-gray-800 p-2 rounded overflow-auto max-h-24", children: JSON.stringify(guard.inputs, null, 2) })
40534
+ /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", weight: "medium", className: "text-muted-foreground", children: t("debug.inputs") }),
40535
+ /* @__PURE__ */ jsxRuntime.jsx("pre", { className: "mt-1 text-xs text-muted-foreground bg-muted p-2 rounded overflow-auto max-h-24", children: JSON.stringify(guard.inputs, null, 2) })
40469
40536
  ] }),
40470
40537
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
40471
- /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", weight: "medium", className: "text-gray-500", children: t("debug.trait") }),
40538
+ /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", weight: "medium", className: "text-muted-foreground", children: t("debug.trait") }),
40472
40539
  /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", children: guard.context.traitName })
40473
40540
  ] })
40474
40541
  ] })
@@ -40524,7 +40591,7 @@ function VerificationTab({ checks, summary }) {
40524
40591
  (a, b) => (sortOrder[a.status] ?? 4) - (sortOrder[b.status] ?? 4)
40525
40592
  );
40526
40593
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "debug-tab debug-tab--verification", children: [
40527
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 mb-3 p-2 bg-gray-50 dark:bg-gray-800 rounded", children: [
40594
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 mb-3 p-2 bg-muted rounded", children: [
40528
40595
  /* @__PURE__ */ jsxRuntime.jsxs(Badge, { variant: "success", size: "sm", children: [
40529
40596
  summary.passed,
40530
40597
  " passed"
@@ -40541,7 +40608,7 @@ function VerificationTab({ checks, summary }) {
40541
40608
  summary.pending,
40542
40609
  " pending"
40543
40610
  ] }),
40544
- /* @__PURE__ */ jsxRuntime.jsxs(Typography, { variant: "small", className: "text-gray-500 ml-auto", children: [
40611
+ /* @__PURE__ */ jsxRuntime.jsxs(Typography, { variant: "small", className: "text-muted-foreground ml-auto", children: [
40545
40612
  summary.totalChecks,
40546
40613
  " total checks"
40547
40614
  ] })
@@ -40551,12 +40618,12 @@ function VerificationTab({ checks, summary }) {
40551
40618
  return /* @__PURE__ */ jsxRuntime.jsxs(
40552
40619
  "div",
40553
40620
  {
40554
- className: "flex items-start gap-2 p-2 rounded hover:bg-gray-50 dark:hover:bg-gray-800",
40621
+ className: "flex items-start gap-2 p-2 rounded hover:bg-muted/50",
40555
40622
  children: [
40556
40623
  /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: config.variant, size: "sm", className: "min-w-[20px] justify-center mt-0.5", children: config.icon }),
40557
40624
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 min-w-0", children: [
40558
40625
  /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "break-words", children: check.label }),
40559
- check.details && /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-gray-500 break-words", children: check.details })
40626
+ check.details && /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-muted-foreground break-words", children: check.details })
40560
40627
  ] }),
40561
40628
  /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-muted-foreground font-mono text-xs shrink-0", children: new Date(check.updatedAt).toLocaleTimeString("en-US", {
40562
40629
  hour12: false,
@@ -40591,10 +40658,10 @@ var init_VerificationTab = __esm({
40591
40658
  function EffectBadge({ effect }) {
40592
40659
  const variant = EFFECT_STATUS_VARIANT[effect.status] || "default";
40593
40660
  const icon = effect.status === "executed" ? "\u2713" : effect.status === "failed" ? "\u2717" : "-";
40594
- return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "inline-flex items-center gap-1 text-xs font-mono bg-gray-100 dark:bg-gray-700 rounded px-1.5 py-0.5", children: [
40661
+ return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "inline-flex items-center gap-1 text-xs font-mono bg-muted rounded px-1.5 py-0.5", children: [
40595
40662
  /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant, size: "sm", className: "!text-[9px] !px-1 !py-0", children: icon }),
40596
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-gray-600 dark:text-gray-400", children: effect.type }),
40597
- effect.error && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-red-500 truncate max-w-[120px]", title: effect.error, children: effect.error })
40663
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: effect.type }),
40664
+ effect.error && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-error truncate max-w-[120px]", title: effect.error, children: effect.error })
40598
40665
  ] });
40599
40666
  }
40600
40667
  function TransitionTimeline({ transitions }) {
@@ -40629,8 +40696,8 @@ function TransitionTimeline({ transitions }) {
40629
40696
  const sorted = [...transitions].reverse();
40630
40697
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "debug-tab debug-tab--timeline", children: [
40631
40698
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between mb-2", children: [
40632
- /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-gray-500", children: t("debug.transitionsRecorded", { count: transitions.length }) }),
40633
- /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "flex items-center gap-1 text-xs text-gray-500 cursor-pointer", children: [
40699
+ /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-muted-foreground", children: t("debug.transitionsRecorded", { count: transitions.length }) }),
40700
+ /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "flex items-center gap-1 text-xs text-muted-foreground cursor-pointer", children: [
40634
40701
  /* @__PURE__ */ jsxRuntime.jsx(
40635
40702
  Checkbox,
40636
40703
  {
@@ -40655,22 +40722,22 @@ function TransitionTimeline({ transitions }) {
40655
40722
  {
40656
40723
  className: `
40657
40724
  relative pl-6 pb-3 border-l-2 cursor-pointer
40658
- hover:bg-gray-50 dark:hover:bg-gray-800 rounded-r
40659
- ${hasFailedEffects ? "border-red-300 dark:border-red-700" : "border-gray-200 dark:border-gray-700"}
40725
+ hover:bg-muted/50 rounded-r
40726
+ ${hasFailedEffects ? "border-error" : "border-border"}
40660
40727
  `,
40661
40728
  onClick: () => setExpandedId(isExpanded ? null : trace.id),
40662
40729
  children: [
40663
40730
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: `
40664
40731
  absolute left-[-5px] top-1 w-2 h-2 rounded-full
40665
- ${hasFailedEffects ? "bg-red-500" : allPassed ? "bg-green-500" : "bg-gray-400"}
40732
+ ${hasFailedEffects ? "bg-error" : allPassed ? "bg-success" : "bg-muted-foreground"}
40666
40733
  ` }),
40667
40734
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 text-xs py-1 px-2", children: [
40668
- /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-gray-400 font-mono min-w-[65px]", children: formatTime2(trace.timestamp) }),
40735
+ /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-muted-foreground font-mono min-w-[65px]", children: formatTime2(trace.timestamp) }),
40669
40736
  /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "primary", size: "sm", className: "min-w-[60px] justify-center", children: trace.traitName }),
40670
- /* @__PURE__ */ jsxRuntime.jsxs(Typography, { variant: "small", className: "font-mono text-gray-600 dark:text-gray-400", children: [
40737
+ /* @__PURE__ */ jsxRuntime.jsxs(Typography, { variant: "small", className: "font-mono text-muted-foreground", children: [
40671
40738
  trace.from,
40672
40739
  " ",
40673
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-gray-400", children: "\u2192" }),
40740
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground/50", children: "\u2192" }),
40674
40741
  " ",
40675
40742
  trace.to
40676
40743
  ] }),
@@ -40687,9 +40754,9 @@ function TransitionTimeline({ transitions }) {
40687
40754
  ]
40688
40755
  }
40689
40756
  ),
40690
- /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-gray-400 ml-auto", children: t("debug.effectsCount", { count: trace.effects.length }) })
40757
+ /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-muted-foreground ml-auto", children: t("debug.effectsCount", { count: trace.effects.length }) })
40691
40758
  ] }),
40692
- isExpanded && trace.effects.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ml-2 mt-1 mb-2 pl-2 border-l border-gray-200 dark:border-gray-700 space-y-1", children: trace.effects.map((effect, eIdx) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1", children: [
40759
+ isExpanded && trace.effects.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ml-2 mt-1 mb-2 pl-2 border-l border-border space-y-1", children: trace.effects.map((effect, eIdx) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1", children: [
40693
40760
  /* @__PURE__ */ jsxRuntime.jsx(EffectBadge, { effect }),
40694
40761
  effect.args.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-muted-foreground font-mono text-xs truncate max-w-[200px]", children: JSON.stringify(effect.args) }),
40695
40762
  effect.durationMs !== void 0 && /* @__PURE__ */ jsxRuntime.jsxs(Typography, { variant: "small", className: "text-muted-foreground text-xs", children: [
@@ -40723,8 +40790,8 @@ var init_TransitionTimeline = __esm({
40723
40790
  }
40724
40791
  });
40725
40792
  function StatRow({ label, value, variant }) {
40726
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between py-1.5 border-b border-gray-100 dark:border-gray-800 last:border-b-0", children: [
40727
- /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-gray-500", children: label }),
40793
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between py-1.5 border-b border-border last:border-b-0", children: [
40794
+ /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-muted-foreground", children: label }),
40728
40795
  variant ? /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant, size: "sm", children: String(value) }) : /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", weight: "semibold", className: "font-mono", children: String(value) })
40729
40796
  ] });
40730
40797
  }
@@ -40753,7 +40820,7 @@ function ServerBridgeTab({ bridge }) {
40753
40820
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "debug-tab debug-tab--bridge", children: /* @__PURE__ */ jsxRuntime.jsxs(Stack, { gap: "sm", children: [
40754
40821
  /* @__PURE__ */ jsxRuntime.jsxs(Card, { className: "p-3", children: [
40755
40822
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 mb-3", children: [
40756
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: `w-3 h-3 rounded-full ${bridge.connected ? "bg-green-500 animate-pulse" : "bg-red-500"}` }),
40823
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: `w-3 h-3 rounded-full ${bridge.connected ? "bg-success animate-pulse" : "bg-error"}` }),
40757
40824
  /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "h6", children: bridge.connected ? t("debug.connected") : t("debug.disconnected") })
40758
40825
  ] }),
40759
40826
  /* @__PURE__ */ jsxRuntime.jsxs(Stack, { gap: "xs", children: [
@@ -40788,11 +40855,11 @@ function ServerBridgeTab({ bridge }) {
40788
40855
  )
40789
40856
  ] })
40790
40857
  ] }),
40791
- bridge.lastError && /* @__PURE__ */ jsxRuntime.jsxs(Card, { className: "p-3 border-red-200 dark:border-red-800 bg-red-50 dark:bg-red-950", children: [
40792
- /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", weight: "semibold", className: "text-red-600 dark:text-red-400 mb-1", children: t("debug.lastError") }),
40793
- /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-red-500 font-mono break-all", children: bridge.lastError })
40858
+ bridge.lastError && /* @__PURE__ */ jsxRuntime.jsxs(Card, { className: "p-3 border-error/30 bg-error/10", children: [
40859
+ /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", weight: "semibold", className: "text-error mb-1", children: t("debug.lastError") }),
40860
+ /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-error font-mono break-all", children: bridge.lastError })
40794
40861
  ] }),
40795
- bridge.connected && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-center py-2", children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-gray-400", children: t("debug.totalEventsProcessed", { count: bridge.eventsForwarded + bridge.eventsReceived }) }) })
40862
+ bridge.connected && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-center py-2", children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-muted-foreground", children: t("debug.totalEventsProcessed", { count: bridge.eventsForwarded + bridge.eventsReceived }) }) })
40796
40863
  ] }) });
40797
40864
  }
40798
40865
  var init_ServerBridgeTab = __esm({
@@ -40918,7 +40985,7 @@ function EventDispatcherTab({ traits: traits2, schema }) {
40918
40985
  };
40919
40986
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "debug-tab debug-tab--dispatch", children: [
40920
40987
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-3", children: [
40921
- /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", weight: "medium", className: "text-gray-500 mb-1", children: t("debug.activeStates") }),
40988
+ /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", weight: "medium", className: "text-muted-foreground mb-1", children: t("debug.activeStates") }),
40922
40989
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap gap-1", children: traits2.map((trait) => /* @__PURE__ */ jsxRuntime.jsxs(Badge, { variant: "success", size: "sm", children: [
40923
40990
  trait.name,
40924
40991
  ": ",
@@ -40926,8 +40993,8 @@ function EventDispatcherTab({ traits: traits2, schema }) {
40926
40993
  ] }, trait.id)) })
40927
40994
  ] }),
40928
40995
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-3", children: [
40929
- /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", weight: "medium", className: "text-gray-500 mb-1", children: t("debug.availableEvents") }),
40930
- availableEvents.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-gray-400 italic", children: t("debug.noTransitionsFromState") }) : /* @__PURE__ */ jsxRuntime.jsx(Stack, { gap: "xs", children: availableEvents.map(({ event, transitions }) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
40996
+ /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", weight: "medium", className: "text-muted-foreground mb-1", children: t("debug.availableEvents") }),
40997
+ availableEvents.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-muted-foreground italic", children: t("debug.noTransitionsFromState") }) : /* @__PURE__ */ jsxRuntime.jsx(Stack, { gap: "xs", children: availableEvents.map(({ event, transitions }) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
40931
40998
  /* @__PURE__ */ jsxRuntime.jsx(
40932
40999
  Button,
40933
41000
  {
@@ -40938,22 +41005,22 @@ function EventDispatcherTab({ traits: traits2, schema }) {
40938
41005
  children: event
40939
41006
  }
40940
41007
  ),
40941
- /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-gray-500", children: transitions.map((t2) => `${t2.from} -> ${t2.to}`).join(", ") }),
41008
+ /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-muted-foreground", children: transitions.map((t2) => `${t2.from} -> ${t2.to}`).join(", ") }),
40942
41009
  transitions.some((tr) => tr.guard) && /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "warning", size: "sm", children: t("debug.guarded") })
40943
41010
  ] }, event)) })
40944
41011
  ] }),
40945
41012
  unavailableEvents.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-3", children: [
40946
- /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", weight: "medium", className: "text-gray-500 mb-1", children: t("debug.otherEvents") }),
41013
+ /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", weight: "medium", className: "text-muted-foreground mb-1", children: t("debug.otherEvents") }),
40947
41014
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap gap-1", children: unavailableEvents.map((event) => /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "default", size: "sm", className: "opacity-50", children: event }, event)) })
40948
41015
  ] }),
40949
41016
  log13.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
40950
- /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", weight: "medium", className: "text-gray-500 mb-1", children: t("debug.recentTransitions") }),
41017
+ /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", weight: "medium", className: "text-muted-foreground mb-1", children: t("debug.recentTransitions") }),
40951
41018
  /* @__PURE__ */ jsxRuntime.jsx(Stack, { gap: "xs", children: log13.map((entry, i) => /* @__PURE__ */ jsxRuntime.jsxs(Typography, { variant: "small", className: "font-mono text-xs", children: [
40952
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-purple-400", children: entry.traitName }),
41019
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-primary", children: entry.traitName }),
40953
41020
  " ",
40954
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-gray-500", children: entry.from }),
41021
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: entry.from }),
40955
41022
  " -> ",
40956
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-green-400", children: entry.to })
41023
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-success", children: entry.to })
40957
41024
  ] }, i)) })
40958
41025
  ] })
40959
41026
  ] });
@@ -40979,21 +41046,21 @@ var init_RuntimeDebugger = __esm({
40979
41046
  function ServerResponseRow({ sr }) {
40980
41047
  const { t } = hooks.useTranslate();
40981
41048
  const entityEntries = Object.entries(sr.dataEntities);
40982
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ml-4 pl-2 border-l border-purple-500/30 py-0.5 text-xs font-mono", children: [
41049
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ml-4 pl-2 border-l border-primary py-0.5 text-xs font-mono", children: [
40983
41050
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
40984
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: sr.success ? "text-green-600 dark:text-green-400" : "text-red-600 dark:text-red-400", children: [
41051
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: sr.success ? "text-success" : "text-error", children: [
40985
41052
  sr.success ? "\u2713" : "\u2717",
40986
41053
  " ",
40987
41054
  t("debug.server")
40988
41055
  ] }),
40989
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-purple-600 dark:text-purple-300", children: sr.orbitalName }),
40990
- sr.clientEffects > 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "px-1 rounded bg-purple-500/15 text-purple-600 dark:text-purple-300", children: t("debug.clientEffectsCount", { count: sr.clientEffects }) }),
40991
- sr.emittedEvents.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "px-1 rounded bg-blue-500/15 text-blue-300", children: [
41056
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-primary", children: sr.orbitalName }),
41057
+ sr.clientEffects > 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "px-1 rounded bg-primary/10 text-primary", children: t("debug.clientEffectsCount", { count: sr.clientEffects }) }),
41058
+ sr.emittedEvents.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "px-1 rounded bg-primary/10 text-primary", children: [
40992
41059
  t("debug.emitLabel"),
40993
41060
  " ",
40994
41061
  sr.emittedEvents.join(", ")
40995
41062
  ] }),
40996
- sr.error && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "px-1 rounded bg-red-500/15 text-red-600 dark:text-red-400 truncate max-w-[300px]", children: sr.error })
41063
+ sr.error && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "px-1 rounded bg-error/10 text-error truncate max-w-[300px]", children: sr.error })
40997
41064
  ] }),
40998
41065
  entityEntries.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap gap-1 mt-0.5", children: entityEntries.map(([name, count]) => /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "px-1 rounded bg-[var(--color-card)] text-foreground", children: [
40999
41066
  name,
@@ -41009,9 +41076,9 @@ function TransitionRow({ trace }) {
41009
41076
  if (isServerEntry && trace.serverResponse) {
41010
41077
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "py-0.5 border-b border-border last:border-0", children: [
41011
41078
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-2 text-xs font-mono", children: [
41012
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mt-1.5 w-1.5 h-1.5 rounded-full flex-shrink-0 bg-purple-500" }),
41079
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mt-1.5 w-1.5 h-1.5 rounded-full flex-shrink-0 bg-primary" }),
41013
41080
  /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "warning", size: "sm", className: "flex-shrink-0", children: trace.event }),
41014
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-purple-600 dark:text-purple-400 flex-shrink-0", children: t("debug.serverResponse") })
41081
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-primary flex-shrink-0", children: t("debug.serverResponse") })
41015
41082
  ] }),
41016
41083
  /* @__PURE__ */ jsxRuntime.jsx(ServerResponseRow, { sr: trace.serverResponse })
41017
41084
  ] });
@@ -41020,7 +41087,7 @@ function TransitionRow({ trace }) {
41020
41087
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-2 text-xs font-mono", children: [
41021
41088
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn(
41022
41089
  "mt-1.5 w-1.5 h-1.5 rounded-full flex-shrink-0",
41023
- hasFailedEffects ? "bg-red-500" : "bg-green-500"
41090
+ hasFailedEffects ? "bg-error" : "bg-success"
41024
41091
  ) }),
41025
41092
  /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "info", size: "sm", className: "flex-shrink-0", children: trace.event }),
41026
41093
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-foreground flex-shrink-0", children: trace.traitName }),
@@ -41034,7 +41101,7 @@ function TransitionRow({ trace }) {
41034
41101
  ] }),
41035
41102
  trace.effects.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap gap-1 ml-6 mt-0.5", children: trace.effects.map((eff, i) => /* @__PURE__ */ jsxRuntime.jsxs("span", { className: cn(
41036
41103
  "px-1 rounded text-xs",
41037
- eff.status === "executed" ? "bg-green-500/15 text-green-600 dark:text-green-400" : eff.status === "failed" ? "bg-red-500/15 text-red-600 dark:text-red-400" : "bg-yellow-500/15 text-yellow-600 dark:text-yellow-400"
41104
+ eff.status === "executed" ? "bg-success/10 text-success" : eff.status === "failed" ? "bg-error/10 text-error" : "bg-warning/10 text-warning"
41038
41105
  ), children: [
41039
41106
  eff.status === "executed" ? "\u2713" : eff.status === "failed" ? "\u2717" : "-",
41040
41107
  " ",
@@ -41068,7 +41135,7 @@ function VerifyModePanel({
41068
41135
  {
41069
41136
  className: cn(
41070
41137
  "runtime-debugger runtime-debugger--verify",
41071
- "flex flex-col bg-[var(--color-card)] text-[var(--color-foreground)] border-t-2 border-cyan-500",
41138
+ "flex flex-col bg-[var(--color-card)] text-[var(--color-foreground)] border-t-2 border-accent",
41072
41139
  hudBottom ? "" : "fixed bottom-0 left-0 right-0",
41073
41140
  className
41074
41141
  ),
@@ -41089,8 +41156,8 @@ function VerifyModePanel({
41089
41156
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-foreground/50 w-3", "aria-hidden": true, children: expanded ? "\u25BE" : "\u25B8" }),
41090
41157
  /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: failedChecks > 0 ? "danger" : "success", size: "sm", children: failedChecks > 0 ? t("debug.failCount", { count: failedChecks }) : t("debug.ok") }),
41091
41158
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-foreground/70", children: t("debug.localCount", { count: localCount }) }),
41092
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-purple-600 dark:text-purple-400", children: t("debug.serverCount", { count: serverCount }) }),
41093
- traitStates && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-cyan-600 dark:text-cyan-400 truncate max-w-[400px]", children: traitStates }),
41159
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-primary", children: t("debug.serverCount", { count: serverCount }) }),
41160
+ traitStates && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-accent truncate max-w-[400px]", children: traitStates }),
41094
41161
  !expanded && transitions.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-auto text-foreground/50", children: t("debug.transitionsCount", { count: transitions.length }) })
41095
41162
  ]
41096
41163
  }
@@ -41285,7 +41352,7 @@ function RuntimeDebugger({
41285
41352
  title: t("debug.openDebugger"),
41286
41353
  children: failedChecks > 0 ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "relative", children: [
41287
41354
  /* @__PURE__ */ jsxRuntime.jsx("span", { children: "V" }),
41288
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute -top-1 -right-2 w-2 h-2 bg-red-500 rounded-full" })
41355
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute -top-1 -right-2 w-2 h-2 bg-error rounded-full" })
41289
41356
  ] }) : /* @__PURE__ */ jsxRuntime.jsx("span", { children: "V" })
41290
41357
  }
41291
41358
  ) : /* @__PURE__ */ jsxRuntime.jsxs(Card, { className: "runtime-debugger__panel", children: [
@@ -41373,7 +41440,7 @@ var init_SegmentRenderer = __esm({
41373
41440
  "div",
41374
41441
  {
41375
41442
  className: cn(
41376
- "border border-gray-200 dark:border-gray-700 rounded-lg p-2 md:p-4 overflow-x-auto space-y-6",
41443
+ "border border-border rounded-lg p-2 md:p-4 overflow-x-auto space-y-6",
41377
41444
  containerClassName,
41378
41445
  className
41379
41446
  ),
@@ -45670,6 +45737,66 @@ function useNavigationId2() {
45670
45737
  init_useEventBus();
45671
45738
  var xOrbitalLog = logger.createLogger("almadar:runtime:cross-orbital");
45672
45739
  var serverBridgeLog = logger.createLogger("almadar:ui:server-bridge");
45740
+ function reEmitServerEvent(eventBus, emitted, origin) {
45741
+ const evTrait = emitted.source?.trait;
45742
+ if (!evTrait) {
45743
+ xOrbitalLog.warn("emit:dropped-no-source", { event: emitted.event, origin });
45744
+ return;
45745
+ }
45746
+ const key = emitted.source?.orbital ? `UI:${emitted.source.orbital}.${evTrait}.${emitted.event}` : `UI:${evTrait}.${emitted.event}`;
45747
+ xOrbitalLog.info("emit:rebroadcast", {
45748
+ busKey: key,
45749
+ sourceOrbital: emitted.source?.orbital,
45750
+ sourceTrait: evTrait,
45751
+ origin
45752
+ });
45753
+ eventBus.emit(key, emitted.payload);
45754
+ }
45755
+ function isBusPushEnvelope(value) {
45756
+ return value.type === "bus" && typeof value.event === "string";
45757
+ }
45758
+ var tabClientId;
45759
+ function getTabClientId() {
45760
+ if (tabClientId === void 0) tabClientId = crypto.randomUUID();
45761
+ return tabClientId;
45762
+ }
45763
+ var pushChannels = /* @__PURE__ */ new Map();
45764
+ function acquirePushChannel(url, subscriber) {
45765
+ let channel = pushChannels.get(url);
45766
+ if (channel === void 0) {
45767
+ const source = new EventSource(url);
45768
+ const created = { source, subscribers: /* @__PURE__ */ new Set() };
45769
+ source.onmessage = (ev) => {
45770
+ let parsed;
45771
+ try {
45772
+ parsed = JSON.parse(ev.data);
45773
+ } catch (err) {
45774
+ serverBridgeLog.warn("push:parse-failed", { error: err instanceof Error ? err.message : String(err) });
45775
+ return;
45776
+ }
45777
+ if (!isBusPushEnvelope(parsed)) return;
45778
+ for (const sub of created.subscribers) sub(parsed);
45779
+ };
45780
+ source.onerror = () => {
45781
+ serverBridgeLog.warn("push:connection-error", { url });
45782
+ };
45783
+ pushChannels.set(url, created);
45784
+ channel = created;
45785
+ }
45786
+ channel.subscribers.add(subscriber);
45787
+ return () => {
45788
+ channel.subscribers.delete(subscriber);
45789
+ if (channel.subscribers.size === 0) {
45790
+ channel.source.close();
45791
+ pushChannels.delete(url);
45792
+ }
45793
+ };
45794
+ }
45795
+ function deriveEventsUrl(serverUrl) {
45796
+ const trimmed = serverUrl.replace(/\/+$/, "");
45797
+ const apiRoot = trimmed.replace(/\/[^/]*$/, "");
45798
+ return `${apiRoot}/events`;
45799
+ }
45673
45800
  function createHttpTransport(serverUrl) {
45674
45801
  return {
45675
45802
  register: async (schema) => {
@@ -45696,11 +45823,12 @@ function createHttpTransport(serverUrl) {
45696
45823
  } catch {
45697
45824
  }
45698
45825
  },
45699
- sendEvent: async (orbitalName, event, payload) => {
45826
+ sendEvent: async (orbitalName, event, payload, clientId) => {
45827
+ const body = { event, payload, clientId };
45700
45828
  const res = await fetch(`${serverUrl}/${orbitalName}/events`, {
45701
45829
  method: "POST",
45702
45830
  headers: { "Content-Type": "application/json" },
45703
- body: JSON.stringify({ event, payload })
45831
+ body: JSON.stringify(body)
45704
45832
  });
45705
45833
  return res.json();
45706
45834
  }
@@ -45745,7 +45873,7 @@ function ServerBridgeProvider({
45745
45873
  const emptyMeta = { success: false, clientEffects: 0, dataEntities: {}, emittedEvents: [] };
45746
45874
  if (!connected) return { effects: [], meta: emptyMeta };
45747
45875
  try {
45748
- const result = await transport.sendEvent(orbitalName, event, payload);
45876
+ const result = await transport.sendEvent(orbitalName, event, payload, getTabClientId());
45749
45877
  const effects = [];
45750
45878
  const responseData = result.data || {};
45751
45879
  const dataEntities = {};
@@ -45790,22 +45918,7 @@ function ServerBridgeProvider({
45790
45918
  }
45791
45919
  if (result.emittedEvents) {
45792
45920
  for (const emitted of result.emittedEvents) {
45793
- const evTrait = emitted.source?.trait;
45794
- if (!evTrait) {
45795
- xOrbitalLog.warn("emit:dropped-no-source", {
45796
- event: emitted.event,
45797
- dispatchOrbital: orbitalName
45798
- });
45799
- continue;
45800
- }
45801
- const key = emitted.source?.orbital ? `UI:${emitted.source.orbital}.${evTrait}.${emitted.event}` : `UI:${evTrait}.${emitted.event}`;
45802
- xOrbitalLog.info("emit:rebroadcast", {
45803
- busKey: key,
45804
- sourceOrbital: emitted.source?.orbital,
45805
- sourceTrait: evTrait,
45806
- dispatchOrbital: orbitalName
45807
- });
45808
- eventBus.emit(key, emitted.payload);
45921
+ reEmitServerEvent(eventBus, emitted, orbitalName);
45809
45922
  }
45810
45923
  }
45811
45924
  } else if (result.error) {
@@ -45847,6 +45960,19 @@ function ServerBridgeProvider({
45847
45960
  unregisterSchema();
45848
45961
  };
45849
45962
  }, [schema, registerSchema, unregisterSchema]);
45963
+ React84.useEffect(() => {
45964
+ if (!serverUrl) return;
45965
+ if (typeof EventSource === "undefined") return;
45966
+ const url = `${deriveEventsUrl(serverUrl)}?clientId=${encodeURIComponent(getTabClientId())}`;
45967
+ return acquirePushChannel(url, (parsed) => {
45968
+ serverBridgeLog.debug("push:received", {
45969
+ event: parsed.event,
45970
+ sourceOrbital: parsed.source?.orbital,
45971
+ sourceTrait: parsed.source?.trait
45972
+ });
45973
+ reEmitServerEvent(eventBus, parsed, "push");
45974
+ });
45975
+ }, [serverUrl, eventBus]);
45850
45976
  return /* @__PURE__ */ jsxRuntime.jsx(ServerBridgeContext.Provider, { value: { connected, sendEvent }, children });
45851
45977
  }
45852
45978
  var log12 = logger.createLogger("almadar:ui:trait-provider");