@almadar/ui 5.123.0 → 5.125.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 +332 -275
  6. package/dist/avl/index.js +334 -277
  7. package/dist/components/index.cjs +284 -248
  8. package/dist/components/index.d.cts +4 -3
  9. package/dist/components/index.d.ts +4 -3
  10. package/dist/components/index.js +284 -248
  11. package/dist/context/index.cjs +25 -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 +25 -66
  15. package/dist/{offline-executor-aRuNznZx.d.cts → offline-executor-Qz4b6GpF.d.cts} +19 -1
  16. package/dist/{offline-executor-aRuNznZx.d.ts → offline-executor-Qz4b6GpF.d.ts} +19 -1
  17. package/dist/providers/index.cjs +395 -275
  18. package/dist/providers/index.d.cts +6 -6
  19. package/dist/providers/index.d.ts +6 -6
  20. package/dist/providers/index.js +394 -276
  21. package/dist/renderer/index.cjs +8 -0
  22. package/dist/renderer/index.d.cts +2 -2
  23. package/dist/renderer/index.d.ts +2 -2
  24. package/dist/renderer/index.js +1 -1
  25. package/dist/runtime/index.cjs +325 -268
  26. package/dist/runtime/index.d.cts +4 -2
  27. package/dist/runtime/index.d.ts +4 -2
  28. package/dist/runtime/index.js +327 -270
  29. package/package.json +13 -11
  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
@@ -4623,15 +4623,15 @@ var init_TextHighlight = __esm({
4623
4623
  const typeStyles = {
4624
4624
  question: cn(
4625
4625
  // Blue border for questions
4626
- "bg-card border-b-2 border-primary-600",
4626
+ "bg-card border-b-2 border-primary",
4627
4627
  "hover:bg-muted",
4628
- isActive && "bg-primary-100 ring-2 ring-primary-600"
4628
+ isActive && "bg-primary/10 ring-2 ring-primary"
4629
4629
  ),
4630
4630
  note: cn(
4631
4631
  // Yellow border for notes
4632
- "bg-card border-b-2 border-amber-500",
4632
+ "bg-card border-b-2 border-warning",
4633
4633
  "hover:bg-muted",
4634
- isActive && "bg-amber-100 ring-2 ring-amber-500"
4634
+ isActive && "bg-warning/10 ring-2 ring-warning"
4635
4635
  )
4636
4636
  };
4637
4637
  return /* @__PURE__ */ jsx(
@@ -4977,7 +4977,7 @@ function DayCell({
4977
4977
  {
4978
4978
  className: cn(
4979
4979
  "p-2 text-center cursor-pointer hover:bg-muted transition-colors",
4980
- isToday && "bg-blue-500/10",
4980
+ isToday && "bg-primary/10",
4981
4981
  className
4982
4982
  ),
4983
4983
  onClick: handleClick,
@@ -4988,7 +4988,7 @@ function DayCell({
4988
4988
  variant: "small",
4989
4989
  className: cn(
4990
4990
  "font-medium",
4991
- isToday ? "text-blue-600" : "text-muted-foreground"
4991
+ isToday ? "text-primary" : "text-muted-foreground"
4992
4992
  ),
4993
4993
  children: dayAbbr
4994
4994
  }
@@ -5000,7 +5000,7 @@ function DayCell({
5000
5000
  rounded: "full",
5001
5001
  className: cn(
5002
5002
  "h-8 w-8 mx-auto items-center justify-center",
5003
- isToday && "bg-blue-600 text-white"
5003
+ isToday && "bg-primary text-primary-foreground"
5004
5004
  ),
5005
5005
  children: /* @__PURE__ */ jsx(Typography, { variant: "body", className: "font-semibold", children: safeDate.getDate() })
5006
5006
  }
@@ -12505,19 +12505,19 @@ var init_ActivationBlock = __esm({
12505
12505
  "div",
12506
12506
  {
12507
12507
  className: cn(
12508
- "bg-indigo-50 dark:bg-indigo-900/20 border-2 border-indigo-200 dark:border-indigo-800 rounded-lg p-5 mb-6",
12508
+ "bg-primary/10 border-2 border-primary rounded-lg p-5 mb-6",
12509
12509
  className
12510
12510
  ),
12511
12511
  children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
12512
- /* @__PURE__ */ jsx(Lightbulb, { className: "text-indigo-600 dark:text-indigo-400 flex-shrink-0 mt-1", size: 24 }),
12512
+ /* @__PURE__ */ jsx(Lightbulb, { className: "text-primary flex-shrink-0 mt-1", size: 24 }),
12513
12513
  /* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
12514
- /* @__PURE__ */ jsx("h4", { className: "font-semibold text-indigo-900 dark:text-indigo-100 mb-2", children: "Before You Begin..." }),
12515
- /* @__PURE__ */ jsx("p", { className: "text-gray-700 dark:text-gray-300 mb-3 text-sm md:text-base", children: question }),
12514
+ /* @__PURE__ */ jsx("h4", { className: "font-semibold text-primary mb-2", children: "Before You Begin..." }),
12515
+ /* @__PURE__ */ jsx("p", { className: "text-foreground mb-3 text-sm md:text-base", children: question }),
12516
12516
  isExpanded ? /* @__PURE__ */ jsxs(Fragment, { children: [
12517
12517
  /* @__PURE__ */ jsx(
12518
12518
  "textarea",
12519
12519
  {
12520
- 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",
12520
+ 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",
12521
12521
  placeholder: "Jot down your thoughts...",
12522
12522
  value: response,
12523
12523
  onChange: (e) => setResponse(e.target.value),
@@ -12529,7 +12529,7 @@ var init_ActivationBlock = __esm({
12529
12529
  "button",
12530
12530
  {
12531
12531
  onClick: handleSubmit,
12532
- className: "px-4 py-2 bg-indigo-600 text-white rounded-md hover:bg-indigo-700 text-sm font-medium transition-colors",
12532
+ className: "px-4 py-2 bg-primary text-primary-foreground rounded-md hover:bg-primary-hover text-sm font-medium transition-colors",
12533
12533
  children: "Continue to Lesson \u2192"
12534
12534
  }
12535
12535
  ),
@@ -12540,7 +12540,7 @@ var init_ActivationBlock = __esm({
12540
12540
  emit(`UI:${saveEvent}`, { response: "" });
12541
12541
  setIsExpanded(false);
12542
12542
  },
12543
- className: "px-4 py-2 text-indigo-600 dark:text-indigo-400 hover:underline text-sm",
12543
+ className: "px-4 py-2 text-primary hover:underline text-sm",
12544
12544
  children: "Skip for now"
12545
12545
  }
12546
12546
  )
@@ -12549,7 +12549,7 @@ var init_ActivationBlock = __esm({
12549
12549
  "button",
12550
12550
  {
12551
12551
  onClick: () => setIsExpanded(true),
12552
- className: "text-sm text-indigo-600 dark:text-indigo-400 hover:underline font-medium",
12552
+ className: "text-sm text-primary hover:underline font-medium",
12553
12553
  children: "\u2713 Answered \xB7 Edit response"
12554
12554
  }
12555
12555
  )
@@ -13053,7 +13053,7 @@ var init_AuthLayout = __esm({
13053
13053
  VStack,
13054
13054
  {
13055
13055
  className: cn(
13056
- "hidden lg:flex lg:w-1/2 bg-primary-600 relative overflow-hidden",
13056
+ "hidden lg:flex lg:w-1/2 bg-primary relative overflow-hidden",
13057
13057
  "justify-between p-12"
13058
13058
  ),
13059
13059
  style: backgroundImage ? {
@@ -13062,7 +13062,7 @@ var init_AuthLayout = __esm({
13062
13062
  } : void 0,
13063
13063
  gap: "none",
13064
13064
  children: [
13065
- /* @__PURE__ */ jsx(Box, { className: "absolute inset-0 bg-gradient-to-br from-primary-600/90 to-primary-800/90" }),
13065
+ /* @__PURE__ */ jsx(Box, { className: "absolute inset-0 bg-gradient-to-br from-primary/90 to-primary-hover/90" }),
13066
13066
  /* @__PURE__ */ jsx(Box, { className: "relative z-10", children: /* @__PURE__ */ jsxs(Link, { to: "/", className: "flex items-center gap-3", children: [
13067
13067
  logo || /* @__PURE__ */ jsx(Box, { className: "w-10 h-10 bg-[var(--color-card)]/20 rounded-xl flex items-center justify-center backdrop-blur", children: /* @__PURE__ */ jsx(
13068
13068
  Typography,
@@ -13147,7 +13147,7 @@ var init_AuthLayout = __esm({
13147
13147
  ),
13148
13148
  children: /* @__PURE__ */ jsxs(Box, { className: "w-full max-w-md", children: [
13149
13149
  /* @__PURE__ */ jsx(Box, { className: "lg:hidden mb-8 text-center", children: /* @__PURE__ */ jsxs(Link, { to: "/", className: "inline-flex items-center gap-3", children: [
13150
- logo || /* @__PURE__ */ jsx(Box, { className: "w-12 h-12 bg-primary-600 rounded-xl flex items-center justify-center", children: /* @__PURE__ */ jsx(
13150
+ logo || /* @__PURE__ */ jsx(Box, { className: "w-12 h-12 bg-primary rounded-xl flex items-center justify-center", children: /* @__PURE__ */ jsx(
13151
13151
  Typography,
13152
13152
  {
13153
13153
  variant: "body1",
@@ -15138,7 +15138,7 @@ var init_CodeBlock = __esm({
15138
15138
  {
15139
15139
  justify: "between",
15140
15140
  align: "center",
15141
- className: "px-3 py-2 bg-[var(--color-card)] rounded-t-lg border-b border-gray-700",
15141
+ className: "px-3 py-2 bg-[var(--color-card)] rounded-t-lg border-b border-border",
15142
15142
  children: [
15143
15143
  showLanguageBadge && /* @__PURE__ */ jsx(Badge, { variant: "default", size: "sm", children: language }),
15144
15144
  effectiveCopy && /* @__PURE__ */ jsx(
@@ -15147,9 +15147,9 @@ var init_CodeBlock = __esm({
15147
15147
  variant: "ghost",
15148
15148
  size: "sm",
15149
15149
  onClick: handleCopy,
15150
- className: "opacity-0 group-hover:opacity-100 focus:opacity-100 transition-opacity text-muted-foreground hover:text-white",
15150
+ className: "opacity-0 group-hover:opacity-100 focus:opacity-100 transition-opacity text-muted-foreground hover:text-foreground",
15151
15151
  "aria-label": t("common.copy"),
15152
- children: copied ? /* @__PURE__ */ jsx(Icon, { name: "check", className: "w-4 h-4 text-green-400" }) : /* @__PURE__ */ jsx(Icon, { name: "copy", className: "w-4 h-4" })
15152
+ children: copied ? /* @__PURE__ */ jsx(Icon, { name: "check", className: "w-4 h-4 text-success" }) : /* @__PURE__ */ jsx(Icon, { name: "copy", className: "w-4 h-4" })
15153
15153
  }
15154
15154
  )
15155
15155
  ]
@@ -15517,12 +15517,12 @@ var init_BloomQuizBlock = __esm({
15517
15517
  init_useEventBus();
15518
15518
  init_cn();
15519
15519
  BLOOM_CONFIG = {
15520
- remember: { color: "bg-gray-500", bgColor: "bg-gray-50 dark:bg-gray-900/30", label: "Remember" },
15521
- understand: { color: "bg-blue-500", bgColor: "bg-blue-50 dark:bg-blue-900/30", label: "Understand" },
15522
- apply: { color: "bg-green-500", bgColor: "bg-green-50 dark:bg-green-900/30", label: "Apply" },
15523
- analyze: { color: "bg-yellow-500", bgColor: "bg-yellow-50 dark:bg-yellow-900/30", label: "Analyze" },
15524
- evaluate: { color: "bg-orange-500", bgColor: "bg-orange-50 dark:bg-orange-900/30", label: "Evaluate" },
15525
- create: { color: "bg-purple-500", bgColor: "bg-purple-50 dark:bg-purple-900/30", label: "Create" }
15520
+ remember: { color: "bg-secondary text-secondary-foreground", bgColor: "bg-muted", label: "Remember" },
15521
+ understand: { color: "bg-info text-info-foreground", bgColor: "bg-info/10", label: "Understand" },
15522
+ apply: { color: "bg-success text-success-foreground", bgColor: "bg-success/10", label: "Apply" },
15523
+ analyze: { color: "bg-warning text-warning-foreground", bgColor: "bg-warning/10", label: "Analyze" },
15524
+ evaluate: { color: "bg-accent text-accent-foreground", bgColor: "bg-accent/10", label: "Evaluate" },
15525
+ create: { color: "bg-primary text-primary-foreground", bgColor: "bg-primary/10", label: "Create" }
15526
15526
  };
15527
15527
  BloomQuizBlock = ({
15528
15528
  level,
@@ -15548,22 +15548,22 @@ var init_BloomQuizBlock = __esm({
15548
15548
  "div",
15549
15549
  {
15550
15550
  className: cn(
15551
- "rounded-lg border border-indigo-100 dark:border-indigo-800 p-4 my-4 transition-all",
15551
+ "rounded-lg border border-primary p-4 my-4 transition-all",
15552
15552
  config.bgColor,
15553
15553
  className
15554
15554
  ),
15555
15555
  children: [
15556
15556
  /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-3", children: [
15557
15557
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [
15558
- index !== void 0 && /* @__PURE__ */ jsxs("span", { className: "text-gray-500 dark:text-gray-400 font-medium text-sm", children: [
15558
+ index !== void 0 && /* @__PURE__ */ jsxs("span", { className: "text-muted-foreground font-medium text-sm", children: [
15559
15559
  "Question ",
15560
15560
  index + 1
15561
15561
  ] }),
15562
- /* @__PURE__ */ jsx("span", { className: cn(config.color, "text-white text-xs px-2 py-1 rounded-full font-medium"), children: config.label })
15562
+ /* @__PURE__ */ jsx("span", { className: cn(config.color, "text-xs px-2 py-1 rounded-full font-medium"), children: config.label })
15563
15563
  ] }),
15564
- isAnswered && /* @__PURE__ */ jsx(CheckCircle, { className: "text-green-600 dark:text-green-400 flex-shrink-0", size: 20 })
15564
+ isAnswered && /* @__PURE__ */ jsx(CheckCircle, { className: "text-success flex-shrink-0", size: 20 })
15565
15565
  ] }),
15566
- /* @__PURE__ */ jsx("div", { className: "font-semibold text-indigo-900 dark:text-indigo-200 mb-3 space-y-2", children: questionSegments.map(
15566
+ /* @__PURE__ */ jsx("div", { className: "font-semibold text-primary mb-3 space-y-2", children: questionSegments.map(
15567
15567
  (segment, idx) => segment.type === "markdown" ? /* @__PURE__ */ jsx(MarkdownContent, { content: segment.content }, `q-md-${idx}`) : /* @__PURE__ */ jsx(
15568
15568
  CodeBlock,
15569
15569
  {
@@ -15577,13 +15577,13 @@ var init_BloomQuizBlock = __esm({
15577
15577
  "button",
15578
15578
  {
15579
15579
  type: "button",
15580
- 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",
15580
+ 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",
15581
15581
  onClick: handleReveal,
15582
15582
  children: revealed ? "Hide Answer" : "Reveal Answer"
15583
15583
  }
15584
15584
  ),
15585
- revealed && /* @__PURE__ */ 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: [
15586
- /* @__PURE__ */ jsx("div", { className: "text-xs text-gray-600 dark:text-gray-400 mb-1 font-medium uppercase tracking-wide", children: "Answer:" }),
15585
+ revealed && /* @__PURE__ */ 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: [
15586
+ /* @__PURE__ */ jsx("div", { className: "text-xs text-muted-foreground mb-1 font-medium uppercase tracking-wide", children: "Answer:" }),
15587
15587
  answerSegments.map(
15588
15588
  (segment, idx) => segment.type === "markdown" ? /* @__PURE__ */ jsx(MarkdownContent, { content: segment.content }, `a-md-${idx}`) : /* @__PURE__ */ jsx(
15589
15589
  CodeBlock,
@@ -15857,12 +15857,12 @@ var init_QuizBlock = __esm({
15857
15857
  }) => {
15858
15858
  const { t } = useTranslate();
15859
15859
  const [revealed, setRevealed] = useState(false);
15860
- return /* @__PURE__ */ jsx(Card2, { className: cn("my-4 border-blue-200 dark:border-blue-800", className), children: /* @__PURE__ */ jsxs(VStack, { gap: "sm", className: "p-4", children: [
15860
+ return /* @__PURE__ */ jsx(Card2, { className: cn("my-4 border-primary", className), children: /* @__PURE__ */ jsxs(VStack, { gap: "sm", className: "p-4", children: [
15861
15861
  /* @__PURE__ */ jsxs(HStack, { gap: "sm", align: "start", children: [
15862
- /* @__PURE__ */ jsx(Icon, { icon: HelpCircle, size: "sm", className: "text-blue-500 mt-0.5 shrink-0" }),
15862
+ /* @__PURE__ */ jsx(Icon, { icon: HelpCircle, size: "sm", className: "text-primary mt-0.5 shrink-0" }),
15863
15863
  /* @__PURE__ */ jsx(Typography, { variant: "body", className: "font-medium", children: question })
15864
15864
  ] }),
15865
- revealed ? /* @__PURE__ */ jsx(Box, { className: "pl-7 pt-2 border-t border-gray-200 dark:border-gray-700", children: /* @__PURE__ */ jsx(Typography, { variant: "body", className: "text-foreground", children: answer }) }) : null,
15865
+ revealed ? /* @__PURE__ */ jsx(Box, { className: "pl-7 pt-2 border-t border-border", children: /* @__PURE__ */ jsx(Typography, { variant: "body", className: "text-foreground", children: answer }) }) : null,
15866
15866
  /* @__PURE__ */ jsx(
15867
15867
  Button,
15868
15868
  {
@@ -17774,7 +17774,7 @@ var init_BookTableOfContents = __esm({
17774
17774
  className: cn(
17775
17775
  "justify-start text-left w-full",
17776
17776
  direction === "rtl" && "text-right",
17777
- isCurrent && "bg-blue-50 dark:bg-blue-950 text-blue-600 dark:text-blue-400"
17777
+ isCurrent && "bg-primary/10 text-primary"
17778
17778
  ),
17779
17779
  children: /* @__PURE__ */ jsx(Box, { className: "truncate", children: /* @__PURE__ */ jsx(Typography, { variant: "body", children: String(chapter.title ?? "") }) })
17780
17780
  },
@@ -19022,7 +19022,7 @@ function CalendarGrid({
19022
19022
  border: true,
19023
19023
  className: cn(
19024
19024
  "cursor-pointer hover:shadow-sm transition-shadow text-xs truncate",
19025
- color ? color : "bg-blue-500/15 border-blue-500/30 text-blue-600"
19025
+ color ? color : "bg-primary/10 border-primary/30 text-primary"
19026
19026
  ),
19027
19027
  onClick: (e) => handleEventClick(event, e),
19028
19028
  children: /* @__PURE__ */ jsx(Typography, { variant: "small", className: "truncate font-medium", children: event.title })
@@ -19120,7 +19120,7 @@ function CalendarGrid({
19120
19120
  onClick: () => handleSlotClick(day, time),
19121
19121
  className: cn(
19122
19122
  "border-l border-border",
19123
- isToday && "bg-blue-50/30"
19123
+ isToday && "bg-primary/10"
19124
19124
  ),
19125
19125
  ...longPressEvent ? {
19126
19126
  onPointerDown: () => startLongPress(day, time),
@@ -21136,31 +21136,31 @@ var init_CodeRunnerPanel = __esm({
21136
21136
  }
21137
21137
  )
21138
21138
  ] }),
21139
- hasOutput && /* @__PURE__ */ jsxs(Box, { className: "rounded-lg border border-gray-700 bg-[#0d0d0d] overflow-hidden", children: [
21139
+ hasOutput && /* @__PURE__ */ jsxs(Box, { className: "rounded-lg border border-border bg-foreground overflow-hidden", children: [
21140
21140
  /* @__PURE__ */ jsxs(
21141
21141
  HStack,
21142
21142
  {
21143
21143
  gap: "sm",
21144
21144
  align: "center",
21145
- className: "px-3 py-2 bg-gray-800 border-b border-gray-700",
21145
+ className: "px-3 py-2 bg-card border-b border-border",
21146
21146
  children: [
21147
- /* @__PURE__ */ jsx(Terminal, { size: 16, className: "text-gray-400" }),
21148
- /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-gray-300 font-medium", children: "Output" })
21147
+ /* @__PURE__ */ jsx(Terminal, { size: 16, className: "text-muted-foreground" }),
21148
+ /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-foreground font-medium", children: "Output" })
21149
21149
  ]
21150
21150
  }
21151
21151
  ),
21152
- /* @__PURE__ */ jsx(VStack, { gap: "none", className: "p-3 font-mono text-sm", children: error ? /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-red-400 whitespace-pre-wrap", children: error }) : /* @__PURE__ */ jsxs(Fragment, { children: [
21153
- output?.stdout ? /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-gray-200 whitespace-pre-wrap", children: output.stdout }) : null,
21154
- output?.stderr ? /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-red-400 whitespace-pre-wrap", children: output.stderr }) : null,
21155
- !output?.stdout && !output?.stderr ? /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-gray-500 italic", children: "No output" }) : null,
21156
- output && output.testResults.length > 0 && /* @__PURE__ */ jsx(Box, { className: "mt-3 pt-3 border-t border-gray-700 space-y-2", children: output.testResults.map((test, index) => /* @__PURE__ */ jsxs(HStack, { gap: "sm", align: "start", className: "text-xs", children: [
21157
- test.passed ? /* @__PURE__ */ jsx(CheckCircle, { size: 14, className: "text-green-400 mt-0.5" }) : /* @__PURE__ */ jsx(XCircle, { size: 14, className: "text-red-400 mt-0.5" }),
21152
+ /* @__PURE__ */ jsx(VStack, { gap: "none", className: "p-3 font-mono text-sm", children: error ? /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-error whitespace-pre-wrap", children: error }) : /* @__PURE__ */ jsxs(Fragment, { children: [
21153
+ output?.stdout ? /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-background whitespace-pre-wrap", children: output.stdout }) : null,
21154
+ output?.stderr ? /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-error whitespace-pre-wrap", children: output.stderr }) : null,
21155
+ !output?.stdout && !output?.stderr ? /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-background italic", children: "No output" }) : null,
21156
+ output && output.testResults.length > 0 && /* @__PURE__ */ jsx(Box, { className: "mt-3 pt-3 border-t border-border space-y-2", children: output.testResults.map((test, index) => /* @__PURE__ */ jsxs(HStack, { gap: "sm", align: "start", className: "text-xs", children: [
21157
+ test.passed ? /* @__PURE__ */ jsx(CheckCircle, { size: 14, className: "text-success mt-0.5" }) : /* @__PURE__ */ jsx(XCircle, { size: 14, className: "text-error mt-0.5" }),
21158
21158
  /* @__PURE__ */ jsxs(VStack, { gap: "xs", className: "flex-1", children: [
21159
21159
  /* @__PURE__ */ jsxs(
21160
21160
  Typography,
21161
21161
  {
21162
21162
  variant: "small",
21163
- className: test.passed ? "text-green-400" : "text-red-400",
21163
+ className: test.passed ? "text-success" : "text-error",
21164
21164
  children: [
21165
21165
  "Test ",
21166
21166
  index + 1,
@@ -21169,15 +21169,15 @@ var init_CodeRunnerPanel = __esm({
21169
21169
  ]
21170
21170
  }
21171
21171
  ),
21172
- /* @__PURE__ */ jsxs(Typography, { variant: "small", className: "text-gray-400", children: [
21172
+ /* @__PURE__ */ jsxs(Typography, { variant: "small", className: "text-background", children: [
21173
21173
  "Input: ",
21174
21174
  test.input
21175
21175
  ] }),
21176
- /* @__PURE__ */ jsxs(Typography, { variant: "small", className: "text-gray-400", children: [
21176
+ /* @__PURE__ */ jsxs(Typography, { variant: "small", className: "text-background", children: [
21177
21177
  "Expected: ",
21178
21178
  test.expectedOutput
21179
21179
  ] }),
21180
- /* @__PURE__ */ jsxs(Typography, { variant: "small", className: "text-gray-400", children: [
21180
+ /* @__PURE__ */ jsxs(Typography, { variant: "small", className: "text-background", children: [
21181
21181
  "Actual: ",
21182
21182
  test.actualOutput
21183
21183
  ] })
@@ -21362,14 +21362,14 @@ var init_ConnectionBlock = __esm({
21362
21362
  "div",
21363
21363
  {
21364
21364
  className: cn(
21365
- "bg-emerald-50 dark:bg-emerald-900/20 border-l-4 border-emerald-500 rounded-r-lg p-5 mb-6",
21365
+ "bg-success/10 border-l-4 border-success rounded-r-lg p-5 mb-6",
21366
21366
  className
21367
21367
  ),
21368
21368
  children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
21369
- /* @__PURE__ */ jsx(Link2, { className: "text-emerald-600 dark:text-emerald-400 flex-shrink-0 mt-1", size: 20 }),
21369
+ /* @__PURE__ */ jsx(Link2, { className: "text-success flex-shrink-0 mt-1", size: 20 }),
21370
21370
  /* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
21371
- /* @__PURE__ */ jsx("h4", { className: "font-semibold text-emerald-900 dark:text-emerald-100 mb-2", children: "Building On What You Know" }),
21372
- /* @__PURE__ */ jsx("div", { className: "prose dark:prose-invert prose-sm max-w-none text-gray-700 dark:text-gray-300", children: /* @__PURE__ */ jsx(MarkdownContent, { content }) })
21371
+ /* @__PURE__ */ jsx("h4", { className: "font-semibold text-success mb-2", children: "Building On What You Know" }),
21372
+ /* @__PURE__ */ jsx("div", { className: "prose dark:prose-invert prose-sm max-w-none text-foreground", children: /* @__PURE__ */ jsx(MarkdownContent, { content }) })
21373
21373
  ] })
21374
21374
  ] })
21375
21375
  }
@@ -21456,7 +21456,7 @@ function CounterStandard({
21456
21456
  variant: "h1",
21457
21457
  className: cn(
21458
21458
  sizeStyles8[size].display,
21459
- "font-bold tabular-nums text-primary-600"
21459
+ "font-bold tabular-nums text-primary"
21460
21460
  ),
21461
21461
  children: resolved.count
21462
21462
  }
@@ -21529,7 +21529,7 @@ function CounterFull({
21529
21529
  variant: "h1",
21530
21530
  className: cn(
21531
21531
  sizeStyles8[size].display,
21532
- "font-bold tabular-nums text-primary-600"
21532
+ "font-bold tabular-nums text-primary"
21533
21533
  ),
21534
21534
  children: resolved.count
21535
21535
  }
@@ -21790,11 +21790,11 @@ var init_DashboardLayout = __esm({
21790
21790
  className: "h-16 px-4 border-b border-border dark:border-border",
21791
21791
  children: [
21792
21792
  /* @__PURE__ */ jsxs(Link, { to: "/", className: "flex items-center gap-2", children: [
21793
- logo || /* @__PURE__ */ jsx(Box, { className: "w-8 h-8 bg-primary-600 rounded-lg flex items-center justify-center", children: /* @__PURE__ */ jsx(
21793
+ logo || /* @__PURE__ */ jsx(Box, { className: "w-8 h-8 bg-primary rounded-lg flex items-center justify-center", children: /* @__PURE__ */ jsx(
21794
21794
  Typography,
21795
21795
  {
21796
21796
  variant: "small",
21797
- className: "text-white font-bold text-sm",
21797
+ className: "text-primary-foreground font-bold text-sm",
21798
21798
  as: "span",
21799
21799
  children: appName.charAt(0).toUpperCase()
21800
21800
  }
@@ -21873,11 +21873,11 @@ var init_DashboardLayout = __esm({
21873
21873
  className: "hidden @md/dashboard:flex items-center gap-1 overflow-x-auto",
21874
21874
  children: [
21875
21875
  /* @__PURE__ */ jsxs(Link, { to: "/", className: "flex items-center gap-2 mr-3 shrink-0", children: [
21876
- logo || /* @__PURE__ */ jsx(Box, { className: "w-7 h-7 bg-primary-600 rounded-lg flex items-center justify-center", children: /* @__PURE__ */ jsx(
21876
+ logo || /* @__PURE__ */ jsx(Box, { className: "w-7 h-7 bg-primary rounded-lg flex items-center justify-center", children: /* @__PURE__ */ jsx(
21877
21877
  Typography,
21878
21878
  {
21879
21879
  variant: "small",
21880
- className: "text-white font-bold text-xs",
21880
+ className: "text-primary-foreground font-bold text-xs",
21881
21881
  as: "span",
21882
21882
  children: appName.charAt(0).toUpperCase()
21883
21883
  }
@@ -21937,8 +21937,8 @@ var init_DashboardLayout = __esm({
21937
21937
  {
21938
21938
  as: "span",
21939
21939
  className: cn(
21940
- "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",
21941
- action.variant === "danger" ? "bg-error" : action.variant === "primary" ? "bg-primary" : "bg-foreground"
21940
+ "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",
21941
+ action.variant === "danger" ? "bg-error text-error-foreground" : action.variant === "primary" ? "bg-primary text-primary-foreground" : "bg-foreground text-background"
21942
21942
  ),
21943
21943
  children: action.badge
21944
21944
  }
@@ -21960,7 +21960,7 @@ var init_DashboardLayout = __esm({
21960
21960
  Box,
21961
21961
  {
21962
21962
  as: "span",
21963
- 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",
21963
+ 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",
21964
21964
  children: unreadCount > 99 ? "99+" : unreadCount
21965
21965
  }
21966
21966
  )
@@ -22243,7 +22243,7 @@ function SubMenu({
22243
22243
  ),
22244
22244
  children: [
22245
22245
  item.icon && (typeof item.icon === "string" ? /* @__PURE__ */ jsx(Icon, { name: item.icon, size: "sm", className: "flex-shrink-0" }) : /* @__PURE__ */ jsx(Icon, { icon: item.icon, size: "sm", className: "flex-shrink-0" })),
22246
- /* @__PURE__ */ jsx(Typography, { variant: "small", className: cn("flex-1", isDanger && "text-red-600"), children: item.label }),
22246
+ /* @__PURE__ */ jsx(Typography, { variant: "small", className: cn("flex-1", isDanger && "text-error"), children: item.label }),
22247
22247
  item.badge !== void 0 && /* @__PURE__ */ jsx("span", { className: "ml-auto text-xs font-medium", children: item.badge })
22248
22248
  ]
22249
22249
  },
@@ -22300,7 +22300,7 @@ function MenuItemRow({
22300
22300
  Typography,
22301
22301
  {
22302
22302
  variant: "small",
22303
- className: cn("flex-1", isDanger && "text-red-600"),
22303
+ className: cn("flex-1", isDanger && "text-error"),
22304
22304
  children: item.label
22305
22305
  }
22306
22306
  ),
@@ -23068,20 +23068,24 @@ function DataGrid({
23068
23068
  const bodyFields = fieldDefs.filter((f3) => f3 !== titleField && !badgeFields.includes(f3));
23069
23069
  const primaryActions = actionDefs.filter((a) => a.variant !== "danger");
23070
23070
  const dangerActions = actionDefs.filter((a) => a.variant === "danger");
23071
- const handleActionClick = (action, itemData) => (e) => {
23072
- e.stopPropagation();
23073
- const payload = {
23074
- id: itemData.id,
23075
- row: itemData
23076
- };
23077
- eventBus.emit(`UI:${action.event}`, payload);
23071
+ const fireAction = (action, itemData) => {
23078
23072
  if (action.navigatesTo) {
23079
23073
  const url = action.navigatesTo.replace(
23080
23074
  /\{\{row\.(\w+(?:\.\w+)*)\}\}/g,
23081
23075
  (_, field) => String(itemData[field] ?? "")
23082
23076
  );
23083
- eventBus.emit("UI:NAVIGATE", { url });
23077
+ eventBus.emit("UI:NAVIGATE", { url, row: itemData });
23078
+ return;
23084
23079
  }
23080
+ const payload = {
23081
+ id: itemData.id,
23082
+ row: itemData
23083
+ };
23084
+ eventBus.emit(`UI:${action.event}`, payload);
23085
+ };
23086
+ const handleActionClick = (action, itemData) => (e) => {
23087
+ e.stopPropagation();
23088
+ fireAction(action, itemData);
23085
23089
  };
23086
23090
  const hasRenderProp = typeof children === "function";
23087
23091
  useEffect(() => {
@@ -23183,10 +23187,7 @@ function DataGrid({
23183
23187
  label: action.label,
23184
23188
  icon: action.icon,
23185
23189
  event: action.event,
23186
- onClick: () => eventBus.emit(`UI:${action.event}`, {
23187
- id: itemData.id,
23188
- row: itemData
23189
- })
23190
+ onClick: () => fireAction(action, itemData)
23190
23191
  }))
23191
23192
  }
23192
23193
  )
@@ -23239,13 +23240,13 @@ function DataGrid({
23239
23240
  }
23240
23241
  ),
23241
23242
  /* @__PURE__ */ jsxs(VStack, { gap: "xs", className: "flex-1 min-w-0", children: [
23242
- titleValue !== void 0 && titleValue !== null && /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
23243
+ titleValue !== void 0 && titleValue !== null && /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center min-w-0", children: [
23243
23244
  titleField?.icon && renderIconInput(titleField.icon, { size: "sm", className: "text-primary flex-shrink-0" }),
23244
23245
  /* @__PURE__ */ jsx(
23245
23246
  Typography,
23246
23247
  {
23247
23248
  variant: titleField?.variant === "h3" ? "h3" : "h4",
23248
- className: "font-semibold truncate",
23249
+ className: "font-semibold truncate min-w-0",
23249
23250
  children: String(titleValue)
23250
23251
  }
23251
23252
  )
@@ -23303,7 +23304,7 @@ function DataGrid({
23303
23304
  )
23304
23305
  ] }, field.name);
23305
23306
  }) }) }),
23306
- primaryActions.length > 0 && /* @__PURE__ */ jsx(Box, { className: "px-4 py-3 mt-auto border-t border-border", children: /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: "justify-end", children: [
23307
+ primaryActions.length > 0 && /* @__PURE__ */ jsx(Box, { className: "px-4 py-3 mt-auto border-t border-border", children: /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: "justify-end flex-wrap", children: [
23307
23308
  (maxInlineActions != null ? primaryActions.slice(0, maxInlineActions) : primaryActions).map((action, idx) => /* @__PURE__ */ jsxs(
23308
23309
  Button,
23309
23310
  {
@@ -23328,10 +23329,7 @@ function DataGrid({
23328
23329
  label: action.label,
23329
23330
  icon: action.icon,
23330
23331
  event: action.event,
23331
- onClick: () => eventBus.emit(`UI:${action.event}`, {
23332
- id: itemData.id,
23333
- row: itemData
23334
- })
23332
+ onClick: () => fireAction(action, itemData)
23335
23333
  }))
23336
23334
  }
23337
23335
  )
@@ -25258,8 +25256,8 @@ var init_RelationSelect = __esm({
25258
25256
  disabled,
25259
25257
  className: cn(
25260
25258
  "w-full justify-between font-normal",
25261
- error && "border-red-300 focus:border-red-500 focus:ring-red-500",
25262
- isOpen && "ring-2 ring-primary-500 border-primary-500"
25259
+ error && "border-error/50 focus:border-error focus:ring-error",
25260
+ isOpen && "ring-2 ring-primary border-primary"
25263
25261
  ),
25264
25262
  children: [
25265
25263
  /* @__PURE__ */ jsx(
@@ -25339,7 +25337,7 @@ var init_RelationSelect = __esm({
25339
25337
  paddingY: "sm",
25340
25338
  className: cn(
25341
25339
  "text-left text-sm hover:bg-muted focus:outline-none focus:bg-muted",
25342
- option.value === value && "bg-primary-50 text-primary-700",
25340
+ option.value === value && "bg-primary/10 text-primary",
25343
25341
  option.disabled && "opacity-50 cursor-not-allowed"
25344
25342
  ),
25345
25343
  onClick: () => handleSelect(option),
@@ -25496,7 +25494,7 @@ var init_SidePanel = __esm({
25496
25494
  showOverlay && /* @__PURE__ */ jsx(Presence, { show: isOpen, animation: "overlay", children: /* @__PURE__ */ jsx(
25497
25495
  Box,
25498
25496
  {
25499
- className: "fixed inset-0 bg-white/80 backdrop-blur-sm z-40 lg:hidden",
25497
+ className: "fixed inset-0 bg-background/80 backdrop-blur-sm z-40 lg:hidden",
25500
25498
  onClick: handleClose
25501
25499
  }
25502
25500
  ) }),
@@ -25863,7 +25861,7 @@ var init_WizardNavigation = __esm({
25863
25861
  /* @__PURE__ */ jsx(Icon, { name: "chevron-left", size: "sm" }),
25864
25862
  resolvedBackLabel
25865
25863
  ] }) : /* @__PURE__ */ jsx(Box, {}),
25866
- /* @__PURE__ */ jsx(HStack, { align: "center", gap: "sm", children: /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-neutral-500", children: t("wizard.stepOf", { current: String(currentStep + 1), total: String(totalSteps) }) }) }),
25864
+ /* @__PURE__ */ jsx(HStack, { align: "center", gap: "sm", children: /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-muted-foreground", children: t("wizard.stepOf", { current: String(currentStep + 1), total: String(totalSteps) }) }) }),
25867
25865
  isLastStep && showComplete ? /* @__PURE__ */ jsx(Button, { variant: "primary", onClick: handleComplete, disabled: !isValid, children: resolvedCompleteLabel }) : showNext ? /* @__PURE__ */ jsxs(Button, { variant: "primary", onClick: handleNext, disabled: !isValid, children: [
25868
25866
  resolvedNextLabel,
25869
25867
  /* @__PURE__ */ jsx(Icon, { name: "chevron-right", size: "sm" })
@@ -28020,6 +28018,7 @@ var init_Lightbox = __esm({
28020
28018
  {
28021
28019
  className: cn(
28022
28020
  "fixed inset-0 z-50 flex items-center justify-center",
28021
+ // eslint-disable-next-line almadar/no-hardcoded-colors -- media overlay: lightbox scrim behind images
28023
28022
  "bg-black bg-opacity-90",
28024
28023
  className
28025
28024
  ),
@@ -28042,7 +28041,7 @@ var init_Lightbox = __esm({
28042
28041
  "p-2 rounded-full",
28043
28042
  "text-[var(--color-foreground)] bg-[var(--color-card)]",
28044
28043
  "hover:bg-opacity-70 transition-opacity",
28045
- "focus:outline-none focus:ring-2 focus:ring-white"
28044
+ "focus:outline-none focus:ring-2 focus:ring-ring"
28046
28045
  ),
28047
28046
  "aria-label": t("aria.closeModal"),
28048
28047
  children: /* @__PURE__ */ jsx(Icon, { name: "x", className: "w-6 h-6" })
@@ -28061,7 +28060,7 @@ var init_Lightbox = __esm({
28061
28060
  "p-2 rounded-full",
28062
28061
  "text-[var(--color-foreground)] bg-[var(--color-card)]",
28063
28062
  "hover:bg-opacity-70 transition-opacity",
28064
- "focus:outline-none focus:ring-2 focus:ring-white"
28063
+ "focus:outline-none focus:ring-2 focus:ring-ring"
28065
28064
  ),
28066
28065
  "aria-label": t("aria.previousImage"),
28067
28066
  children: /* @__PURE__ */ jsx(Icon, { name: "chevron-left", className: "w-8 h-8" })
@@ -28098,7 +28097,7 @@ var init_Lightbox = __esm({
28098
28097
  "p-2 rounded-full",
28099
28098
  "text-[var(--color-foreground)] bg-[var(--color-card)]",
28100
28099
  "hover:bg-opacity-70 transition-opacity",
28101
- "focus:outline-none focus:ring-2 focus:ring-white"
28100
+ "focus:outline-none focus:ring-2 focus:ring-ring"
28102
28101
  ),
28103
28102
  "aria-label": t("aria.nextImage"),
28104
28103
  children: /* @__PURE__ */ jsx(Icon, { name: "chevron-right", className: "w-8 h-8" })
@@ -28318,7 +28317,7 @@ function TableView({
28318
28317
  col.key
28319
28318
  );
28320
28319
  }),
28321
- hasActions && /* @__PURE__ */ jsx(Box, { "aria-hidden": true })
28320
+ hasActions && /* @__PURE__ */ jsx(Box, { "aria-hidden": true, className: "sticky right-0 bg-[var(--color-surface-subtle)]" })
28322
28321
  ]
28323
28322
  }
28324
28323
  );
@@ -28362,41 +28361,54 @@ function TableView({
28362
28361
  }
28363
28362
  return /* @__PURE__ */ jsx(Box, { role: "cell", className: cellBase, children: /* @__PURE__ */ jsx("span", { className: "truncate", children: formatCell(raw, col.format) }) }, col.key);
28364
28363
  }),
28365
- itemActions && itemActions.length > 0 && /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "justify-end flex-shrink-0 opacity-60 group-hover:opacity-100 transition-opacity", children: [
28366
- (maxInlineActions != null ? itemActions.slice(0, maxInlineActions) : itemActions).map((action, i) => /* @__PURE__ */ jsxs(
28367
- Button,
28368
- {
28369
- variant: action.variant ?? "ghost",
28370
- size: "sm",
28371
- onClick: handleActionClick(action, row),
28372
- "data-testid": `action-${action.event}`,
28373
- "data-row-id": String(row.id),
28374
- className: cn(action.variant === "danger" && "text-error hover:bg-error/10"),
28375
- children: [
28376
- action.icon && renderIconInput3(action.icon, { size: "xs", className: "mr-1" }),
28377
- action.label
28378
- ]
28379
- },
28380
- i
28381
- )),
28382
- maxInlineActions != null && itemActions.length > maxInlineActions && /* @__PURE__ */ jsx(
28383
- Menu,
28384
- {
28385
- position: "bottom-end",
28386
- trigger: /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", "aria-label": t("common.actions"), "data-testid": "action-overflow", children: /* @__PURE__ */ jsx(Icon, { name: "more-horizontal", size: "xs" }) }),
28387
- items: itemActions.slice(maxInlineActions).map((action) => ({
28388
- label: action.label,
28389
- icon: action.icon,
28390
- event: action.event,
28391
- variant: action.variant === "danger" ? "danger" : "default",
28392
- onClick: () => eventBus.emit(`UI:${action.event}`, {
28393
- id: row.id,
28394
- row
28395
- })
28396
- }))
28397
- }
28398
- )
28399
- ] })
28364
+ itemActions && itemActions.length > 0 && /* @__PURE__ */ jsxs(
28365
+ HStack,
28366
+ {
28367
+ gap: "xs",
28368
+ className: cn(
28369
+ // Pinned: the fixed column tracks routinely overflow the caller's
28370
+ // scroll container, which used to leave the actions off-screen.
28371
+ // Opaque so scrolled cells pass underneath it.
28372
+ "justify-end flex-shrink-0 sticky right-0 z-[1] transition-colors",
28373
+ lk.striped && index % 2 === 1 ? "bg-[var(--color-surface-subtle)]" : "bg-[var(--color-card)] group-hover:bg-[var(--color-surface-subtle)]"
28374
+ ),
28375
+ children: [
28376
+ (maxInlineActions != null ? itemActions.slice(0, maxInlineActions) : itemActions).map((action, i) => /* @__PURE__ */ jsxs(
28377
+ Button,
28378
+ {
28379
+ variant: action.variant ?? "ghost",
28380
+ size: "sm",
28381
+ onClick: handleActionClick(action, row),
28382
+ "data-testid": `action-${action.event}`,
28383
+ "data-row-id": String(row.id),
28384
+ className: cn(action.variant === "danger" && "text-error hover:bg-error/10"),
28385
+ children: [
28386
+ action.icon && renderIconInput3(action.icon, { size: "xs", className: "mr-1" }),
28387
+ action.label
28388
+ ]
28389
+ },
28390
+ i
28391
+ )),
28392
+ maxInlineActions != null && itemActions.length > maxInlineActions && /* @__PURE__ */ jsx(
28393
+ Menu,
28394
+ {
28395
+ position: "bottom-end",
28396
+ trigger: /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", "aria-label": t("common.actions"), "data-testid": "action-overflow", children: /* @__PURE__ */ jsx(Icon, { name: "more-horizontal", size: "xs" }) }),
28397
+ items: itemActions.slice(maxInlineActions).map((action) => ({
28398
+ label: action.label,
28399
+ icon: action.icon,
28400
+ event: action.event,
28401
+ variant: action.variant === "danger" ? "danger" : "default",
28402
+ onClick: () => eventBus.emit(`UI:${action.event}`, {
28403
+ id: row.id,
28404
+ row
28405
+ })
28406
+ }))
28407
+ }
28408
+ )
28409
+ ]
28410
+ }
28411
+ )
28400
28412
  ]
28401
28413
  }
28402
28414
  );
@@ -31171,6 +31183,7 @@ var init_QrScanner = __esm({
31171
31183
  overflow: "hidden",
31172
31184
  rounded: "sm",
31173
31185
  className: cn(
31186
+ // eslint-disable-next-line almadar/no-hardcoded-colors -- media overlay: always over a dark scrim
31174
31187
  "bg-black",
31175
31188
  "aspect-square w-full max-w-md",
31176
31189
  className
@@ -31235,7 +31248,9 @@ var init_QrScanner = __esm({
31235
31248
  type: "button",
31236
31249
  onClick: togglePause,
31237
31250
  className: cn(
31251
+ // eslint-disable-next-line almadar/no-hardcoded-colors -- media overlay: always over a dark scrim
31238
31252
  "rounded-full bg-black bg-opacity-60 p-2 text-white",
31253
+ // eslint-disable-next-line almadar/no-hardcoded-colors -- media overlay: always over a dark scrim
31239
31254
  "hover:bg-opacity-80 focus:outline-none focus:ring-2 focus:ring-white"
31240
31255
  ),
31241
31256
  "aria-label": isPaused ? t("qrScanner.resumeScanning") : t("qrScanner.pauseScanning"),
@@ -31248,7 +31263,9 @@ var init_QrScanner = __esm({
31248
31263
  type: "button",
31249
31264
  onClick: toggleFacing,
31250
31265
  className: cn(
31266
+ // eslint-disable-next-line almadar/no-hardcoded-colors -- media overlay: always over a dark scrim
31251
31267
  "rounded-full bg-black bg-opacity-60 p-2 text-white",
31268
+ // eslint-disable-next-line almadar/no-hardcoded-colors -- media overlay: always over a dark scrim
31252
31269
  "hover:bg-opacity-80 focus:outline-none focus:ring-2 focus:ring-white"
31253
31270
  ),
31254
31271
  "aria-label": currentFacing === "environment" ? t("qrScanner.switchToFrontCamera") : t("qrScanner.switchToRearCamera"),
@@ -31261,7 +31278,9 @@ var init_QrScanner = __esm({
31261
31278
  type: "button",
31262
31279
  onClick: handleMockScan,
31263
31280
  className: cn(
31281
+ // eslint-disable-next-line almadar/no-hardcoded-colors -- media overlay: always over a dark scrim
31264
31282
  "rounded-full bg-black bg-opacity-60 px-3 py-2 text-xs text-white",
31283
+ // eslint-disable-next-line almadar/no-hardcoded-colors -- media overlay: always over a dark scrim
31265
31284
  "hover:bg-opacity-80 focus:outline-none focus:ring-2 focus:ring-white"
31266
31285
  ),
31267
31286
  "aria-label": t("aria.mockScanDev"),
@@ -33997,10 +34016,10 @@ var init_ModuleCard = __esm({
33997
34016
  init_avl_atom_types();
33998
34017
  init_MiniStateMachine();
33999
34018
  PERSISTENCE_BORDER = {
34000
- persistent: "border-l-[3px] border-l-blue-500 border-solid",
34001
- runtime: "border-l-[3px] border-l-blue-500 border-dashed",
34002
- singleton: "border-l-[3px] border-l-blue-500 border-double",
34003
- instance: "border-l-[3px] border-l-blue-500 border-dotted"
34019
+ persistent: "border-l-[3px] border-l-primary border-solid",
34020
+ runtime: "border-l-[3px] border-l-primary border-dashed",
34021
+ singleton: "border-l-[3px] border-l-primary border-double",
34022
+ instance: "border-l-[3px] border-l-primary border-dotted"
34004
34023
  };
34005
34024
  PERSISTENCE_ICON = {
34006
34025
  persistent: "\u26C1",
@@ -34030,8 +34049,8 @@ var init_ModuleCard = __esm({
34030
34049
  className: "rounded-lg border border-[var(--color-border)] bg-[var(--color-card)] shadow-sm overflow-hidden",
34031
34050
  style: { minWidth: 280, maxWidth: 400 },
34032
34051
  children: [
34033
- /* @__PURE__ */ jsx(Handle, { type: "target", position: Position.Left, className: "!w-2.5 !h-2.5 !bg-orange-400" }),
34034
- /* @__PURE__ */ jsx(Handle, { type: "source", position: Position.Right, className: "!w-2.5 !h-2.5 !bg-orange-400" }),
34052
+ /* @__PURE__ */ jsx(Handle, { type: "target", position: Position.Left, className: "!w-2.5 !h-2.5 !bg-warning" }),
34053
+ /* @__PURE__ */ jsx(Handle, { type: "source", position: Position.Right, className: "!w-2.5 !h-2.5 !bg-warning" }),
34035
34054
  /* @__PURE__ */ jsx("div", { className: "px-3 py-2 border-b border-[var(--color-border)]", children: /* @__PURE__ */ jsx("span", { className: "text-base font-bold text-[var(--color-foreground)]", children: orbitalName }) }),
34036
34055
  /* @__PURE__ */ jsxs("div", { className: `px-3 py-2 border-b border-[var(--color-border)] ${PERSISTENCE_BORDER[persistence] ?? ""}`, children: [
34037
34056
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5 mb-1.5", children: [
@@ -36487,19 +36506,19 @@ var init_ReflectionBlock = __esm({
36487
36506
  "div",
36488
36507
  {
36489
36508
  className: cn(
36490
- "my-6 border-l-4 border-amber-400 bg-amber-50 dark:bg-amber-900/20 rounded-r-lg p-4",
36509
+ "my-6 border-l-4 border-warning bg-warning/10 rounded-r-lg p-4",
36491
36510
  className
36492
36511
  ),
36493
36512
  children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
36494
- /* @__PURE__ */ jsx(PauseCircle, { className: "text-amber-600 dark:text-amber-400 flex-shrink-0 mt-1", size: 20 }),
36513
+ /* @__PURE__ */ jsx(PauseCircle, { className: "text-warning flex-shrink-0 mt-1", size: 20 }),
36495
36514
  /* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
36496
- /* @__PURE__ */ jsx("div", { className: "font-medium text-amber-900 dark:text-amber-100 mb-2", children: "Pause & Reflect" }),
36497
- /* @__PURE__ */ jsx("p", { className: "text-gray-700 dark:text-gray-300 text-sm mb-3", children: prompt }),
36515
+ /* @__PURE__ */ jsx("div", { className: "font-medium text-warning mb-2", children: "Pause & Reflect" }),
36516
+ /* @__PURE__ */ jsx("p", { className: "text-foreground text-sm mb-3", children: prompt }),
36498
36517
  isExpanded ? /* @__PURE__ */ jsxs(Fragment, { children: [
36499
36518
  /* @__PURE__ */ jsx(
36500
36519
  "textarea",
36501
36520
  {
36502
- 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",
36521
+ className: "w-full p-2 border border-input rounded text-sm bg-card text-foreground focus:ring-2 focus:ring-ring focus:border-transparent",
36503
36522
  placeholder: "Your thoughts...",
36504
36523
  value: note,
36505
36524
  onChange: (e) => setNote(e.target.value),
@@ -36510,7 +36529,7 @@ var init_ReflectionBlock = __esm({
36510
36529
  "button",
36511
36530
  {
36512
36531
  onClick: handleSave,
36513
- className: "mt-2 text-sm px-3 py-1 bg-amber-600 text-white rounded hover:bg-amber-700 transition-colors",
36532
+ className: "mt-2 text-sm px-3 py-1 bg-warning text-warning-foreground rounded hover:opacity-90 transition-colors",
36514
36533
  children: "Save & Continue"
36515
36534
  }
36516
36535
  )
@@ -36518,7 +36537,7 @@ var init_ReflectionBlock = __esm({
36518
36537
  "button",
36519
36538
  {
36520
36539
  onClick: () => setIsExpanded(true),
36521
- className: "text-sm text-amber-600 dark:text-amber-400 hover:underline",
36540
+ className: "text-sm text-warning hover:underline",
36522
36541
  children: savedNote ? "\u2713 Answered \xB7 Edit" : "Answer this question"
36523
36542
  }
36524
36543
  )
@@ -36804,7 +36823,7 @@ function DataTable({
36804
36823
  )),
36805
36824
  rowActions && /* @__PURE__ */ jsx("th", { className: "w-12 px-4 py-3" })
36806
36825
  ] }) }),
36807
- /* @__PURE__ */ jsx("tbody", { className: "divide-y divide-gray-200 dark:divide-gray-700", children: isLoading ? /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx(
36826
+ /* @__PURE__ */ jsx("tbody", { className: "divide-y divide-border", children: isLoading ? /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx(
36808
36827
  "td",
36809
36828
  {
36810
36829
  colSpan: normalizedColumns.length + (selectable ? 1 : 0) + (rowActions ? 1 : 0),
@@ -37124,6 +37143,16 @@ function normalizeFieldDefs(fields) {
37124
37143
  return String(f3);
37125
37144
  });
37126
37145
  }
37146
+ function buildFieldLabelMap(fields) {
37147
+ const map = {};
37148
+ if (!fields) return map;
37149
+ for (const f3 of fields) {
37150
+ if (typeof f3 === "object" && "key" in f3 && f3.header !== void 0 && f3.header !== "") {
37151
+ map[f3.key] = f3.header;
37152
+ }
37153
+ }
37154
+ return map;
37155
+ }
37127
37156
  function buildFieldTypeMap(fields) {
37128
37157
  const map = {};
37129
37158
  if (!fields) return map;
@@ -37175,7 +37204,9 @@ var init_DetailPanel = __esm({
37175
37204
  };
37176
37205
  const effectiveFieldNames = isFieldDefArray(propFields) ? normalizeFieldDefs(propFields) : fieldNames;
37177
37206
  const fieldTypeMap = isFieldDefArray(propFields) ? buildFieldTypeMap(propFields) : {};
37178
- useCallback(
37207
+ const fieldLabelMap = isFieldDefArray(propFields) ? buildFieldLabelMap(propFields) : {};
37208
+ const labelFor = (field) => fieldLabelMap[field] ?? formatFieldLabel(field);
37209
+ const handleActionClick = useCallback(
37179
37210
  (action, data2) => {
37180
37211
  if (action.navigatesTo) {
37181
37212
  const url = action.navigatesTo.replace(
@@ -37210,7 +37241,7 @@ var init_DetailPanel = __esm({
37210
37241
  if (typeof field === "string") {
37211
37242
  const value = getNestedValue(normalizedData, field);
37212
37243
  return {
37213
- label: formatFieldLabel(field),
37244
+ label: labelFor(field),
37214
37245
  value: formatFieldValue(value, field),
37215
37246
  icon: getFieldIcon(field)
37216
37247
  };
@@ -37221,7 +37252,10 @@ var init_DetailPanel = __esm({
37221
37252
  }
37222
37253
  if (normalizedData && effectiveFieldNames) {
37223
37254
  const primaryField = effectiveFieldNames[0];
37224
- if (!title && primaryField && normalizedData[primaryField]) {
37255
+ const titleDerivedFromPrimary = Boolean(
37256
+ !title && primaryField && normalizedData[primaryField]
37257
+ );
37258
+ if (titleDerivedFromPrimary) {
37225
37259
  title = String(normalizedData[primaryField]);
37226
37260
  }
37227
37261
  const statusFields = effectiveFieldNames.filter(
@@ -37240,16 +37274,16 @@ var init_DetailPanel = __esm({
37240
37274
  (f3) => f3.toLowerCase().includes("description") || f3.toLowerCase().includes("note")
37241
37275
  );
37242
37276
  const otherFields = effectiveFieldNames.filter(
37243
- (f3) => f3 !== primaryField && !statusFields.includes(f3) && !progressFields.includes(f3) && !metricFields.includes(f3) && !dateFields.includes(f3) && !descriptionFields.includes(f3)
37277
+ (f3) => (!titleDerivedFromPrimary || f3 !== primaryField) && !statusFields.includes(f3) && !progressFields.includes(f3) && !metricFields.includes(f3) && !dateFields.includes(f3) && !descriptionFields.includes(f3)
37244
37278
  );
37245
37279
  sections = [];
37246
37280
  if (statusFields.length > 0 || otherFields.length > 0) {
37247
37281
  const overviewFields = [];
37248
- [...statusFields, ...otherFields.slice(0, 3)].forEach((field) => {
37282
+ [...statusFields, ...otherFields].forEach((field) => {
37249
37283
  const value = getNestedValue(normalizedData, field);
37250
37284
  if (value !== void 0 && value !== null) {
37251
37285
  overviewFields.push({
37252
- label: formatFieldLabel(field),
37286
+ label: labelFor(field),
37253
37287
  value: renderRichFieldValue(value, field, fieldTypeMap[field]),
37254
37288
  icon: getFieldIcon(field)
37255
37289
  });
@@ -37265,7 +37299,7 @@ var init_DetailPanel = __esm({
37265
37299
  const value = getNestedValue(normalizedData, field);
37266
37300
  if (value !== void 0 && value !== null) {
37267
37301
  metricsFields.push({
37268
- label: formatFieldLabel(field),
37302
+ label: labelFor(field),
37269
37303
  value: renderRichFieldValue(value, field, fieldTypeMap[field]),
37270
37304
  icon: getFieldIcon(field)
37271
37305
  });
@@ -37281,7 +37315,7 @@ var init_DetailPanel = __esm({
37281
37315
  const value = getNestedValue(normalizedData, field);
37282
37316
  if (value !== void 0 && value !== null) {
37283
37317
  timelineFields.push({
37284
- label: formatFieldLabel(field),
37318
+ label: labelFor(field),
37285
37319
  value: renderRichFieldValue(value, field, fieldTypeMap[field]),
37286
37320
  icon: getFieldIcon(field)
37287
37321
  });
@@ -37297,7 +37331,7 @@ var init_DetailPanel = __esm({
37297
37331
  const value = getNestedValue(normalizedData, field);
37298
37332
  if (value !== void 0 && value !== null) {
37299
37333
  descFields.push({
37300
- label: formatFieldLabel(field),
37334
+ label: labelFor(field),
37301
37335
  value: renderRichFieldValue(value, field, fieldTypeMap[field]),
37302
37336
  icon: getFieldIcon(field)
37303
37337
  });
@@ -37345,7 +37379,7 @@ var init_DetailPanel = __esm({
37345
37379
  if (typeof field === "string") {
37346
37380
  const value = normalizedData ? getNestedValue(normalizedData, field) : void 0;
37347
37381
  allFields.push({
37348
- label: formatFieldLabel(field),
37382
+ label: labelFor(field),
37349
37383
  value: renderRichFieldValue(value, field, fieldTypeMap[field]),
37350
37384
  icon: getFieldIcon(field)
37351
37385
  });
@@ -37367,8 +37401,9 @@ var init_DetailPanel = __esm({
37367
37401
  {
37368
37402
  variant: action.variant || "secondary",
37369
37403
  size: "sm",
37370
- action: action.event,
37404
+ action: action.navigatesTo ? void 0 : action.event,
37371
37405
  actionPayload: { row: normalizedData },
37406
+ onClick: action.navigatesTo ? () => handleActionClick(action, normalizedData) : void 0,
37372
37407
  icon: action.icon,
37373
37408
  "data-testid": action.event ? `action-${action.event}` : void 0,
37374
37409
  "data-row-id": normalizedData?.id !== void 0 ? String(normalizedData.id) : void 0,
@@ -39411,8 +39446,9 @@ var init_MediaGallery = __esm({
39411
39446
  )
39412
39447
  }
39413
39448
  ),
39414
- item.caption && /* @__PURE__ */ jsx(Box, { className: "absolute bottom-0 left-0 right-0 p-2 bg-gradient-to-t from-black/60 to-transparent", children: /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-white truncate", children: item.caption }) }),
39415
- selectable && isSelected && /* @__PURE__ */ jsx(Box, { className: "absolute top-2 right-2 w-5 h-5 rounded-full bg-primary flex items-center justify-center", children: /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-white text-xs", children: "\u2713" }) })
39449
+ item.caption && // eslint-disable-next-line almadar/no-hardcoded-colors -- media overlay: caption scrim over image
39450
+ /* @__PURE__ */ jsx(Box, { className: "absolute bottom-0 left-0 right-0 p-2 bg-gradient-to-t from-black/60 to-transparent", children: /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-white truncate", children: item.caption }) }),
39451
+ selectable && isSelected && /* @__PURE__ */ jsx(Box, { className: "absolute top-2 right-2 w-5 h-5 rounded-full bg-primary flex items-center justify-center", children: /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-primary-foreground text-xs", children: "\u2713" }) })
39416
39452
  ]
39417
39453
  },
39418
39454
  item.id
@@ -39441,7 +39477,7 @@ var init_MediaGallery = __esm({
39441
39477
  size: "sm",
39442
39478
  icon: X,
39443
39479
  action: "LIGHTBOX_CLOSE",
39444
- className: "text-white hover:bg-white/20"
39480
+ className: "text-foreground hover:bg-muted/50"
39445
39481
  }
39446
39482
  ) }),
39447
39483
  /* @__PURE__ */ jsx(
@@ -39452,7 +39488,7 @@ var init_MediaGallery = __esm({
39452
39488
  className: "max-w-full max-h-[80vh] object-contain rounded-md"
39453
39489
  }
39454
39490
  ),
39455
- lightboxItem.caption && /* @__PURE__ */ jsx(Typography, { variant: "body", className: "text-white mt-3 text-center", children: lightboxItem.caption })
39491
+ lightboxItem.caption && /* @__PURE__ */ jsx(Typography, { variant: "body", className: "text-foreground mt-3 text-center", children: lightboxItem.caption })
39456
39492
  ]
39457
39493
  }
39458
39494
  )
@@ -39894,7 +39930,7 @@ function WalkMinimap() {
39894
39930
  {
39895
39931
  variant,
39896
39932
  size: "sm",
39897
- className: `flex-shrink-0 text-[9px] ${isActive ? "ring-1 ring-cyan-400" : ""}`,
39933
+ className: `flex-shrink-0 text-[9px] ${isActive ? "ring-1 ring-info" : ""}`,
39898
39934
  children: [
39899
39935
  isDone ? "\u2713" : isActive ? "\u25CF" : "\u25CB",
39900
39936
  " ",
@@ -40035,13 +40071,13 @@ function WalkMinimap() {
40035
40071
  })
40036
40072
  ] }) }),
40037
40073
  /* @__PURE__ */ jsx(Box, { className: "px-2 py-1 border-t border-border", children: /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: "items-center justify-between", children: [
40038
- /* @__PURE__ */ jsxs(Typography, { variant: "caption", className: "text-xs font-mono text-green-500", children: [
40074
+ /* @__PURE__ */ jsxs(Typography, { variant: "caption", className: "text-xs font-mono text-success", children: [
40039
40075
  "Engine: ",
40040
40076
  engineCount,
40041
40077
  "/",
40042
40078
  totalTransitions
40043
40079
  ] }),
40044
- domCount > 0 && /* @__PURE__ */ jsxs(Typography, { variant: "caption", className: "text-xs font-mono text-cyan-500", children: [
40080
+ domCount > 0 && /* @__PURE__ */ jsxs(Typography, { variant: "caption", className: "text-xs font-mono text-info", children: [
40045
40081
  "DOM: ",
40046
40082
  domCount
40047
40083
  ] }),
@@ -40074,13 +40110,13 @@ function TraitsTab({ traits: traits2 }) {
40074
40110
  const accordionItems = traits2.map((trait) => ({
40075
40111
  id: trait.id,
40076
40112
  header: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 w-full", children: [
40077
- /* @__PURE__ */ jsx(Typography, { variant: "body", weight: "semibold", className: "text-purple-600 dark:text-purple-400", children: trait.name }),
40113
+ /* @__PURE__ */ jsx(Typography, { variant: "body", weight: "semibold", className: "text-primary", children: trait.name }),
40078
40114
  /* @__PURE__ */ jsx(Badge, { variant: "success", size: "sm", children: trait.currentState }),
40079
- /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-gray-500 ml-auto", children: t("debug.transitionsCount", { count: trait.transitionCount }) })
40115
+ /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground ml-auto", children: t("debug.transitionsCount", { count: trait.transitionCount }) })
40080
40116
  ] }),
40081
40117
  content: /* @__PURE__ */ jsxs(Stack, { gap: "sm", children: [
40082
40118
  /* @__PURE__ */ jsxs("div", { children: [
40083
- /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-gray-500 mb-2", children: t("debug.states") }),
40119
+ /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-muted-foreground mb-2", children: t("debug.states") }),
40084
40120
  /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1", children: trait.states.map((state) => /* @__PURE__ */ jsx(
40085
40121
  Badge,
40086
40122
  {
@@ -40092,18 +40128,18 @@ function TraitsTab({ traits: traits2 }) {
40092
40128
  )) })
40093
40129
  ] }),
40094
40130
  trait.transitions.length > 0 && /* @__PURE__ */ jsxs("div", { children: [
40095
- /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-gray-500 mb-2", children: t("debug.transitions") }),
40131
+ /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-muted-foreground mb-2", children: t("debug.transitions") }),
40096
40132
  /* @__PURE__ */ jsx(Stack, { gap: "xs", children: trait.transitions.map((t2, i) => /* @__PURE__ */ jsxs(Typography, { variant: "small", className: "font-mono", children: [
40097
40133
  t2.from,
40098
40134
  " \u2192 ",
40099
40135
  t2.to,
40100
40136
  " ",
40101
- /* @__PURE__ */ jsxs("span", { className: "text-gray-500", children: [
40137
+ /* @__PURE__ */ jsxs("span", { className: "text-muted-foreground", children: [
40102
40138
  "(",
40103
40139
  t2.event,
40104
40140
  ")"
40105
40141
  ] }),
40106
- t2.guard && /* @__PURE__ */ jsxs("span", { className: "text-amber-500", children: [
40142
+ t2.guard && /* @__PURE__ */ jsxs("span", { className: "text-warning", children: [
40107
40143
  " [",
40108
40144
  t2.guard,
40109
40145
  "]"
@@ -40111,7 +40147,7 @@ function TraitsTab({ traits: traits2 }) {
40111
40147
  ] }, i)) })
40112
40148
  ] }),
40113
40149
  trait.guards.length > 0 && /* @__PURE__ */ jsxs("div", { children: [
40114
- /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-gray-500 mb-2", children: t("debug.guards") }),
40150
+ /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-muted-foreground mb-2", children: t("debug.guards") }),
40115
40151
  /* @__PURE__ */ jsx(Stack, { gap: "xs", children: trait.guards.map((g, i) => /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
40116
40152
  /* @__PURE__ */ jsx(Typography, { variant: "small", children: g.name }),
40117
40153
  /* @__PURE__ */ jsx(Badge, { variant: g.lastResult === true ? "success" : g.lastResult === false ? "danger" : "default", size: "sm", children: g.lastResult === void 0 ? "?" : g.lastResult ? "\u2713" : "\u2717" })
@@ -40154,11 +40190,11 @@ function TicksTab({ ticks: ticks2 }) {
40154
40190
  };
40155
40191
  const TickCard = ({ tick, active }) => /* @__PURE__ */ jsxs(Card, { className: `p-3 ${!active ? "opacity-50" : ""}`, children: [
40156
40192
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 mb-2", children: [
40157
- /* @__PURE__ */ jsx("span", { className: `w-2 h-2 rounded-full ${active ? "bg-green-500" : "bg-gray-400"}` }),
40158
- /* @__PURE__ */ jsx(Typography, { variant: "body", weight: "semibold", className: "text-amber-600 dark:text-amber-400", children: tick.name }),
40159
- /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-gray-500", children: tick.traitName })
40193
+ /* @__PURE__ */ jsx("span", { className: `w-2 h-2 rounded-full ${active ? "bg-success" : "bg-muted-foreground"}` }),
40194
+ /* @__PURE__ */ jsx(Typography, { variant: "body", weight: "semibold", className: "text-warning", children: tick.name }),
40195
+ /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground", children: tick.traitName })
40160
40196
  ] }),
40161
- /* @__PURE__ */ jsxs("div", { className: "flex gap-3 text-xs text-gray-500", children: [
40197
+ /* @__PURE__ */ jsxs("div", { className: "flex gap-3 text-xs text-muted-foreground", children: [
40162
40198
  /* @__PURE__ */ jsxs("span", { children: [
40163
40199
  tick.interval,
40164
40200
  "ms"
@@ -40181,7 +40217,7 @@ function TicksTab({ ticks: ticks2 }) {
40181
40217
  ] });
40182
40218
  return /* @__PURE__ */ jsxs("div", { className: "debug-tab debug-tab--ticks", children: [
40183
40219
  activeTicks.length > 0 && /* @__PURE__ */ jsxs("div", { className: "mb-4", children: [
40184
- /* @__PURE__ */ jsxs(Typography, { variant: "small", weight: "medium", className: "text-gray-500 mb-2", children: [
40220
+ /* @__PURE__ */ jsxs(Typography, { variant: "small", weight: "medium", className: "text-muted-foreground mb-2", children: [
40185
40221
  "Active (",
40186
40222
  activeTicks.length,
40187
40223
  ")"
@@ -40189,7 +40225,7 @@ function TicksTab({ ticks: ticks2 }) {
40189
40225
  /* @__PURE__ */ jsx(Stack, { gap: "sm", children: activeTicks.map((tick) => /* @__PURE__ */ jsx(TickCard, { tick, active: true }, tick.id)) })
40190
40226
  ] }),
40191
40227
  inactiveTicks.length > 0 && /* @__PURE__ */ jsxs("div", { children: [
40192
- /* @__PURE__ */ jsxs(Typography, { variant: "small", weight: "medium", className: "text-gray-400 mb-2", children: [
40228
+ /* @__PURE__ */ jsxs(Typography, { variant: "small", weight: "medium", className: "text-muted-foreground mb-2", children: [
40193
40229
  "Inactive (",
40194
40230
  inactiveTicks.length,
40195
40231
  ")"
@@ -40237,33 +40273,33 @@ function EntitiesTab({ snapshot }) {
40237
40273
  id: `singleton-${name}`,
40238
40274
  header: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
40239
40275
  /* @__PURE__ */ jsx(Badge, { variant: "primary", size: "sm", children: t("debug.singleton") }),
40240
- /* @__PURE__ */ jsx(Typography, { variant: "body", weight: "semibold", className: "text-sky-600 dark:text-sky-400", children: name })
40276
+ /* @__PURE__ */ jsx(Typography, { variant: "body", weight: "semibold", className: "text-info", children: name })
40241
40277
  ] }),
40242
- content: /* @__PURE__ */ 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) })
40278
+ content: /* @__PURE__ */ jsx("pre", { className: "text-xs text-muted-foreground bg-muted p-2 rounded overflow-auto max-h-40", children: JSON.stringify(data, null, 2) })
40243
40279
  }));
40244
40280
  const runtimeItems = runtimeEntities.slice(0, 20).map((entity) => ({
40245
40281
  id: entity.id,
40246
40282
  header: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
40247
- /* @__PURE__ */ jsx(Typography, { variant: "body", weight: "semibold", className: "text-sky-600 dark:text-sky-400", children: entity.type }),
40248
- /* @__PURE__ */ jsxs(Typography, { variant: "small", className: "text-gray-500", children: [
40283
+ /* @__PURE__ */ jsx(Typography, { variant: "body", weight: "semibold", className: "text-info", children: entity.type }),
40284
+ /* @__PURE__ */ jsxs(Typography, { variant: "small", className: "text-muted-foreground", children: [
40249
40285
  "#",
40250
40286
  entity.id.slice(0, 8)
40251
40287
  ] })
40252
40288
  ] }),
40253
- content: /* @__PURE__ */ 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) })
40289
+ content: /* @__PURE__ */ 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) })
40254
40290
  }));
40255
40291
  return /* @__PURE__ */ jsxs("div", { className: "debug-tab debug-tab--entities", children: [
40256
40292
  singletonItems.length > 0 && /* @__PURE__ */ jsxs("div", { className: "mb-4", children: [
40257
- /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-gray-500 mb-2", children: t("debug.singletonsCount", { count: singletonItems.length }) }),
40293
+ /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-muted-foreground mb-2", children: t("debug.singletonsCount", { count: singletonItems.length }) }),
40258
40294
  /* @__PURE__ */ jsx(Accordion, { items: singletonItems, multiple: true })
40259
40295
  ] }),
40260
40296
  runtimeItems.length > 0 && /* @__PURE__ */ jsxs("div", { className: "mb-4", children: [
40261
- /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-gray-500 mb-2", children: t("debug.runtimeCount", { count: runtimeEntities.length }) }),
40297
+ /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-muted-foreground mb-2", children: t("debug.runtimeCount", { count: runtimeEntities.length }) }),
40262
40298
  /* @__PURE__ */ jsx(Accordion, { items: runtimeItems, multiple: true }),
40263
- runtimeEntities.length > 20 && /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-gray-400 text-center mt-2", children: t("debug.moreEntities", { count: runtimeEntities.length - 20 }) })
40299
+ runtimeEntities.length > 20 && /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground text-center mt-2", children: t("debug.moreEntities", { count: runtimeEntities.length - 20 }) })
40264
40300
  ] }),
40265
40301
  persistentEntries.length > 0 && /* @__PURE__ */ jsxs("div", { children: [
40266
- /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-gray-500 mb-2", children: t("debug.persistent") }),
40302
+ /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-muted-foreground mb-2", children: t("debug.persistent") }),
40267
40303
  /* @__PURE__ */ jsx(Stack, { gap: "xs", children: persistentEntries.map(([type, info]) => /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between py-1", children: [
40268
40304
  /* @__PURE__ */ jsx(Typography, { variant: "small", children: type }),
40269
40305
  /* @__PURE__ */ jsx(Badge, { variant: info.loaded ? "success" : "default", size: "sm", children: info.loaded ? t("debug.loadedCount", { count: info.count }) : t("debug.notLoaded") })
@@ -40348,7 +40384,7 @@ function EventFlowTab({ events: events2 }) {
40348
40384
  );
40349
40385
  })
40350
40386
  ] }),
40351
- /* @__PURE__ */ jsxs("label", { className: "flex items-center gap-1 text-xs text-gray-500 ml-auto cursor-pointer", children: [
40387
+ /* @__PURE__ */ jsxs("label", { className: "flex items-center gap-1 text-xs text-muted-foreground ml-auto cursor-pointer", children: [
40352
40388
  /* @__PURE__ */ jsx(
40353
40389
  Checkbox,
40354
40390
  {
@@ -40363,18 +40399,18 @@ function EventFlowTab({ events: events2 }) {
40363
40399
  "div",
40364
40400
  {
40365
40401
  ref: containerRef,
40366
- className: "max-h-64 overflow-y-auto space-y-1 bg-gray-50 dark:bg-gray-800 rounded p-2",
40402
+ className: "max-h-64 overflow-y-auto space-y-1 bg-muted rounded p-2",
40367
40403
  children: filteredEvents.slice(-100).map((event) => {
40368
40404
  const { variant, icon } = TYPE_BADGES[event.type] || { variant: "default", icon: "\u2022" };
40369
40405
  return /* @__PURE__ */ jsxs(
40370
40406
  "div",
40371
40407
  {
40372
- className: "flex items-start gap-2 text-xs py-1 hover:bg-gray-100 dark:hover:bg-gray-700 rounded px-1",
40408
+ className: "flex items-start gap-2 text-xs py-1 hover:bg-muted/50 rounded px-1",
40373
40409
  children: [
40374
- /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-gray-400 font-mono min-w-[65px]", children: formatTime2(event.timestamp) }),
40410
+ /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground font-mono min-w-[65px]", children: formatTime2(event.timestamp) }),
40375
40411
  /* @__PURE__ */ jsx("span", { children: icon }),
40376
40412
  /* @__PURE__ */ jsx(Badge, { variant, size: "sm", className: "min-w-[60px] justify-center", children: event.source }),
40377
- /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-gray-600 dark:text-gray-400", children: event.message })
40413
+ /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground", children: event.message })
40378
40414
  ]
40379
40415
  },
40380
40416
  event.id
@@ -40438,21 +40474,21 @@ function GuardsPanel({ guards }) {
40438
40474
  id: guard.id,
40439
40475
  header: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 w-full", children: [
40440
40476
  /* @__PURE__ */ jsx(Badge, { variant: guard.result ? "success" : "danger", size: "sm", children: guard.result ? "\u2713" : "\u2717" }),
40441
- /* @__PURE__ */ jsx(Typography, { variant: "body", weight: "semibold", className: "text-amber-600 dark:text-amber-400", children: guard.guardName }),
40442
- /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-gray-500", children: guard.context.type === "transition" ? `${guard.context.transitionFrom} \u2192 ${guard.context.transitionTo}` : guard.context.tickName }),
40443
- /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-gray-400 ml-auto", children: formatTime2(guard.timestamp) })
40477
+ /* @__PURE__ */ jsx(Typography, { variant: "body", weight: "semibold", className: "text-warning", children: guard.guardName }),
40478
+ /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground", children: guard.context.type === "transition" ? `${guard.context.transitionFrom} \u2192 ${guard.context.transitionTo}` : guard.context.tickName }),
40479
+ /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground ml-auto", children: formatTime2(guard.timestamp) })
40444
40480
  ] }),
40445
40481
  content: /* @__PURE__ */ jsxs(Stack, { gap: "sm", children: [
40446
40482
  /* @__PURE__ */ jsxs("div", { children: [
40447
- /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-gray-500", children: t("debug.expression") }),
40448
- /* @__PURE__ */ 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 })
40483
+ /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-muted-foreground", children: t("debug.expression") }),
40484
+ /* @__PURE__ */ jsx("code", { className: "block mt-1 text-xs text-warning bg-warning/10 px-2 py-1 rounded", children: guard.expression })
40449
40485
  ] }),
40450
40486
  /* @__PURE__ */ jsxs("div", { children: [
40451
- /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-gray-500", children: t("debug.inputs") }),
40452
- /* @__PURE__ */ 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) })
40487
+ /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-muted-foreground", children: t("debug.inputs") }),
40488
+ /* @__PURE__ */ 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) })
40453
40489
  ] }),
40454
40490
  /* @__PURE__ */ jsxs("div", { children: [
40455
- /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-gray-500", children: t("debug.trait") }),
40491
+ /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-muted-foreground", children: t("debug.trait") }),
40456
40492
  /* @__PURE__ */ jsx(Typography, { variant: "small", children: guard.context.traitName })
40457
40493
  ] })
40458
40494
  ] })
@@ -40508,7 +40544,7 @@ function VerificationTab({ checks, summary }) {
40508
40544
  (a, b) => (sortOrder[a.status] ?? 4) - (sortOrder[b.status] ?? 4)
40509
40545
  );
40510
40546
  return /* @__PURE__ */ jsxs("div", { className: "debug-tab debug-tab--verification", children: [
40511
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 mb-3 p-2 bg-gray-50 dark:bg-gray-800 rounded", children: [
40547
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 mb-3 p-2 bg-muted rounded", children: [
40512
40548
  /* @__PURE__ */ jsxs(Badge, { variant: "success", size: "sm", children: [
40513
40549
  summary.passed,
40514
40550
  " passed"
@@ -40525,7 +40561,7 @@ function VerificationTab({ checks, summary }) {
40525
40561
  summary.pending,
40526
40562
  " pending"
40527
40563
  ] }),
40528
- /* @__PURE__ */ jsxs(Typography, { variant: "small", className: "text-gray-500 ml-auto", children: [
40564
+ /* @__PURE__ */ jsxs(Typography, { variant: "small", className: "text-muted-foreground ml-auto", children: [
40529
40565
  summary.totalChecks,
40530
40566
  " total checks"
40531
40567
  ] })
@@ -40535,12 +40571,12 @@ function VerificationTab({ checks, summary }) {
40535
40571
  return /* @__PURE__ */ jsxs(
40536
40572
  "div",
40537
40573
  {
40538
- className: "flex items-start gap-2 p-2 rounded hover:bg-gray-50 dark:hover:bg-gray-800",
40574
+ className: "flex items-start gap-2 p-2 rounded hover:bg-muted/50",
40539
40575
  children: [
40540
40576
  /* @__PURE__ */ jsx(Badge, { variant: config.variant, size: "sm", className: "min-w-[20px] justify-center mt-0.5", children: config.icon }),
40541
40577
  /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
40542
40578
  /* @__PURE__ */ jsx(Typography, { variant: "small", className: "break-words", children: check.label }),
40543
- check.details && /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-gray-500 break-words", children: check.details })
40579
+ check.details && /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground break-words", children: check.details })
40544
40580
  ] }),
40545
40581
  /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground font-mono text-xs shrink-0", children: new Date(check.updatedAt).toLocaleTimeString("en-US", {
40546
40582
  hour12: false,
@@ -40575,10 +40611,10 @@ var init_VerificationTab = __esm({
40575
40611
  function EffectBadge({ effect }) {
40576
40612
  const variant = EFFECT_STATUS_VARIANT[effect.status] || "default";
40577
40613
  const icon = effect.status === "executed" ? "\u2713" : effect.status === "failed" ? "\u2717" : "-";
40578
- return /* @__PURE__ */ 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: [
40614
+ return /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1 text-xs font-mono bg-muted rounded px-1.5 py-0.5", children: [
40579
40615
  /* @__PURE__ */ jsx(Badge, { variant, size: "sm", className: "!text-[9px] !px-1 !py-0", children: icon }),
40580
- /* @__PURE__ */ jsx("span", { className: "text-gray-600 dark:text-gray-400", children: effect.type }),
40581
- effect.error && /* @__PURE__ */ jsx("span", { className: "text-red-500 truncate max-w-[120px]", title: effect.error, children: effect.error })
40616
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: effect.type }),
40617
+ effect.error && /* @__PURE__ */ jsx("span", { className: "text-error truncate max-w-[120px]", title: effect.error, children: effect.error })
40582
40618
  ] });
40583
40619
  }
40584
40620
  function TransitionTimeline({ transitions }) {
@@ -40613,8 +40649,8 @@ function TransitionTimeline({ transitions }) {
40613
40649
  const sorted = [...transitions].reverse();
40614
40650
  return /* @__PURE__ */ jsxs("div", { className: "debug-tab debug-tab--timeline", children: [
40615
40651
  /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-2", children: [
40616
- /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-gray-500", children: t("debug.transitionsRecorded", { count: transitions.length }) }),
40617
- /* @__PURE__ */ jsxs("label", { className: "flex items-center gap-1 text-xs text-gray-500 cursor-pointer", children: [
40652
+ /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground", children: t("debug.transitionsRecorded", { count: transitions.length }) }),
40653
+ /* @__PURE__ */ jsxs("label", { className: "flex items-center gap-1 text-xs text-muted-foreground cursor-pointer", children: [
40618
40654
  /* @__PURE__ */ jsx(
40619
40655
  Checkbox,
40620
40656
  {
@@ -40639,22 +40675,22 @@ function TransitionTimeline({ transitions }) {
40639
40675
  {
40640
40676
  className: `
40641
40677
  relative pl-6 pb-3 border-l-2 cursor-pointer
40642
- hover:bg-gray-50 dark:hover:bg-gray-800 rounded-r
40643
- ${hasFailedEffects ? "border-red-300 dark:border-red-700" : "border-gray-200 dark:border-gray-700"}
40678
+ hover:bg-muted/50 rounded-r
40679
+ ${hasFailedEffects ? "border-error" : "border-border"}
40644
40680
  `,
40645
40681
  onClick: () => setExpandedId(isExpanded ? null : trace.id),
40646
40682
  children: [
40647
40683
  /* @__PURE__ */ jsx("div", { className: `
40648
40684
  absolute left-[-5px] top-1 w-2 h-2 rounded-full
40649
- ${hasFailedEffects ? "bg-red-500" : allPassed ? "bg-green-500" : "bg-gray-400"}
40685
+ ${hasFailedEffects ? "bg-error" : allPassed ? "bg-success" : "bg-muted-foreground"}
40650
40686
  ` }),
40651
40687
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-xs py-1 px-2", children: [
40652
- /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-gray-400 font-mono min-w-[65px]", children: formatTime2(trace.timestamp) }),
40688
+ /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground font-mono min-w-[65px]", children: formatTime2(trace.timestamp) }),
40653
40689
  /* @__PURE__ */ jsx(Badge, { variant: "primary", size: "sm", className: "min-w-[60px] justify-center", children: trace.traitName }),
40654
- /* @__PURE__ */ jsxs(Typography, { variant: "small", className: "font-mono text-gray-600 dark:text-gray-400", children: [
40690
+ /* @__PURE__ */ jsxs(Typography, { variant: "small", className: "font-mono text-muted-foreground", children: [
40655
40691
  trace.from,
40656
40692
  " ",
40657
- /* @__PURE__ */ jsx("span", { className: "text-gray-400", children: "\u2192" }),
40693
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground/50", children: "\u2192" }),
40658
40694
  " ",
40659
40695
  trace.to
40660
40696
  ] }),
@@ -40671,9 +40707,9 @@ function TransitionTimeline({ transitions }) {
40671
40707
  ]
40672
40708
  }
40673
40709
  ),
40674
- /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-gray-400 ml-auto", children: t("debug.effectsCount", { count: trace.effects.length }) })
40710
+ /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground ml-auto", children: t("debug.effectsCount", { count: trace.effects.length }) })
40675
40711
  ] }),
40676
- isExpanded && trace.effects.length > 0 && /* @__PURE__ */ 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__ */ jsxs("div", { className: "flex items-center gap-1", children: [
40712
+ isExpanded && trace.effects.length > 0 && /* @__PURE__ */ 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__ */ jsxs("div", { className: "flex items-center gap-1", children: [
40677
40713
  /* @__PURE__ */ jsx(EffectBadge, { effect }),
40678
40714
  effect.args.length > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground font-mono text-xs truncate max-w-[200px]", children: JSON.stringify(effect.args) }),
40679
40715
  effect.durationMs !== void 0 && /* @__PURE__ */ jsxs(Typography, { variant: "small", className: "text-muted-foreground text-xs", children: [
@@ -40707,8 +40743,8 @@ var init_TransitionTimeline = __esm({
40707
40743
  }
40708
40744
  });
40709
40745
  function StatRow({ label, value, variant }) {
40710
- return /* @__PURE__ */ 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: [
40711
- /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-gray-500", children: label }),
40746
+ return /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between py-1.5 border-b border-border last:border-b-0", children: [
40747
+ /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground", children: label }),
40712
40748
  variant ? /* @__PURE__ */ jsx(Badge, { variant, size: "sm", children: String(value) }) : /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "semibold", className: "font-mono", children: String(value) })
40713
40749
  ] });
40714
40750
  }
@@ -40737,7 +40773,7 @@ function ServerBridgeTab({ bridge }) {
40737
40773
  return /* @__PURE__ */ jsx("div", { className: "debug-tab debug-tab--bridge", children: /* @__PURE__ */ jsxs(Stack, { gap: "sm", children: [
40738
40774
  /* @__PURE__ */ jsxs(Card, { className: "p-3", children: [
40739
40775
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 mb-3", children: [
40740
- /* @__PURE__ */ jsx("div", { className: `w-3 h-3 rounded-full ${bridge.connected ? "bg-green-500 animate-pulse" : "bg-red-500"}` }),
40776
+ /* @__PURE__ */ jsx("div", { className: `w-3 h-3 rounded-full ${bridge.connected ? "bg-success animate-pulse" : "bg-error"}` }),
40741
40777
  /* @__PURE__ */ jsx(Typography, { variant: "h6", children: bridge.connected ? t("debug.connected") : t("debug.disconnected") })
40742
40778
  ] }),
40743
40779
  /* @__PURE__ */ jsxs(Stack, { gap: "xs", children: [
@@ -40772,11 +40808,11 @@ function ServerBridgeTab({ bridge }) {
40772
40808
  )
40773
40809
  ] })
40774
40810
  ] }),
40775
- bridge.lastError && /* @__PURE__ */ jsxs(Card, { className: "p-3 border-red-200 dark:border-red-800 bg-red-50 dark:bg-red-950", children: [
40776
- /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "semibold", className: "text-red-600 dark:text-red-400 mb-1", children: t("debug.lastError") }),
40777
- /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-red-500 font-mono break-all", children: bridge.lastError })
40811
+ bridge.lastError && /* @__PURE__ */ jsxs(Card, { className: "p-3 border-error/30 bg-error/10", children: [
40812
+ /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "semibold", className: "text-error mb-1", children: t("debug.lastError") }),
40813
+ /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-error font-mono break-all", children: bridge.lastError })
40778
40814
  ] }),
40779
- bridge.connected && /* @__PURE__ */ jsx("div", { className: "text-center py-2", children: /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-gray-400", children: t("debug.totalEventsProcessed", { count: bridge.eventsForwarded + bridge.eventsReceived }) }) })
40815
+ bridge.connected && /* @__PURE__ */ jsx("div", { className: "text-center py-2", children: /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground", children: t("debug.totalEventsProcessed", { count: bridge.eventsForwarded + bridge.eventsReceived }) }) })
40780
40816
  ] }) });
40781
40817
  }
40782
40818
  var init_ServerBridgeTab = __esm({
@@ -40902,7 +40938,7 @@ function EventDispatcherTab({ traits: traits2, schema }) {
40902
40938
  };
40903
40939
  return /* @__PURE__ */ jsxs("div", { className: "debug-tab debug-tab--dispatch", children: [
40904
40940
  /* @__PURE__ */ jsxs("div", { className: "mb-3", children: [
40905
- /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-gray-500 mb-1", children: t("debug.activeStates") }),
40941
+ /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-muted-foreground mb-1", children: t("debug.activeStates") }),
40906
40942
  /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1", children: traits2.map((trait) => /* @__PURE__ */ jsxs(Badge, { variant: "success", size: "sm", children: [
40907
40943
  trait.name,
40908
40944
  ": ",
@@ -40910,8 +40946,8 @@ function EventDispatcherTab({ traits: traits2, schema }) {
40910
40946
  ] }, trait.id)) })
40911
40947
  ] }),
40912
40948
  /* @__PURE__ */ jsxs("div", { className: "mb-3", children: [
40913
- /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-gray-500 mb-1", children: t("debug.availableEvents") }),
40914
- availableEvents.length === 0 ? /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-gray-400 italic", children: t("debug.noTransitionsFromState") }) : /* @__PURE__ */ jsx(Stack, { gap: "xs", children: availableEvents.map(({ event, transitions }) => /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
40949
+ /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-muted-foreground mb-1", children: t("debug.availableEvents") }),
40950
+ availableEvents.length === 0 ? /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground italic", children: t("debug.noTransitionsFromState") }) : /* @__PURE__ */ jsx(Stack, { gap: "xs", children: availableEvents.map(({ event, transitions }) => /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
40915
40951
  /* @__PURE__ */ jsx(
40916
40952
  Button,
40917
40953
  {
@@ -40922,22 +40958,22 @@ function EventDispatcherTab({ traits: traits2, schema }) {
40922
40958
  children: event
40923
40959
  }
40924
40960
  ),
40925
- /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-gray-500", children: transitions.map((t2) => `${t2.from} -> ${t2.to}`).join(", ") }),
40961
+ /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground", children: transitions.map((t2) => `${t2.from} -> ${t2.to}`).join(", ") }),
40926
40962
  transitions.some((tr) => tr.guard) && /* @__PURE__ */ jsx(Badge, { variant: "warning", size: "sm", children: t("debug.guarded") })
40927
40963
  ] }, event)) })
40928
40964
  ] }),
40929
40965
  unavailableEvents.length > 0 && /* @__PURE__ */ jsxs("div", { className: "mb-3", children: [
40930
- /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-gray-500 mb-1", children: t("debug.otherEvents") }),
40966
+ /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-muted-foreground mb-1", children: t("debug.otherEvents") }),
40931
40967
  /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1", children: unavailableEvents.map((event) => /* @__PURE__ */ jsx(Badge, { variant: "default", size: "sm", className: "opacity-50", children: event }, event)) })
40932
40968
  ] }),
40933
40969
  log13.length > 0 && /* @__PURE__ */ jsxs("div", { children: [
40934
- /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-gray-500 mb-1", children: t("debug.recentTransitions") }),
40970
+ /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-muted-foreground mb-1", children: t("debug.recentTransitions") }),
40935
40971
  /* @__PURE__ */ jsx(Stack, { gap: "xs", children: log13.map((entry, i) => /* @__PURE__ */ jsxs(Typography, { variant: "small", className: "font-mono text-xs", children: [
40936
- /* @__PURE__ */ jsx("span", { className: "text-purple-400", children: entry.traitName }),
40972
+ /* @__PURE__ */ jsx("span", { className: "text-primary", children: entry.traitName }),
40937
40973
  " ",
40938
- /* @__PURE__ */ jsx("span", { className: "text-gray-500", children: entry.from }),
40974
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: entry.from }),
40939
40975
  " -> ",
40940
- /* @__PURE__ */ jsx("span", { className: "text-green-400", children: entry.to })
40976
+ /* @__PURE__ */ jsx("span", { className: "text-success", children: entry.to })
40941
40977
  ] }, i)) })
40942
40978
  ] })
40943
40979
  ] });
@@ -40963,21 +40999,21 @@ var init_RuntimeDebugger = __esm({
40963
40999
  function ServerResponseRow({ sr }) {
40964
41000
  const { t } = useTranslate();
40965
41001
  const entityEntries = Object.entries(sr.dataEntities);
40966
- return /* @__PURE__ */ jsxs("div", { className: "ml-4 pl-2 border-l border-purple-500/30 py-0.5 text-xs font-mono", children: [
41002
+ return /* @__PURE__ */ jsxs("div", { className: "ml-4 pl-2 border-l border-primary py-0.5 text-xs font-mono", children: [
40967
41003
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
40968
- /* @__PURE__ */ jsxs("span", { className: sr.success ? "text-green-600 dark:text-green-400" : "text-red-600 dark:text-red-400", children: [
41004
+ /* @__PURE__ */ jsxs("span", { className: sr.success ? "text-success" : "text-error", children: [
40969
41005
  sr.success ? "\u2713" : "\u2717",
40970
41006
  " ",
40971
41007
  t("debug.server")
40972
41008
  ] }),
40973
- /* @__PURE__ */ jsx("span", { className: "text-purple-600 dark:text-purple-300", children: sr.orbitalName }),
40974
- sr.clientEffects > 0 && /* @__PURE__ */ jsx("span", { className: "px-1 rounded bg-purple-500/15 text-purple-600 dark:text-purple-300", children: t("debug.clientEffectsCount", { count: sr.clientEffects }) }),
40975
- sr.emittedEvents.length > 0 && /* @__PURE__ */ jsxs("span", { className: "px-1 rounded bg-blue-500/15 text-blue-300", children: [
41009
+ /* @__PURE__ */ jsx("span", { className: "text-primary", children: sr.orbitalName }),
41010
+ sr.clientEffects > 0 && /* @__PURE__ */ jsx("span", { className: "px-1 rounded bg-primary/10 text-primary", children: t("debug.clientEffectsCount", { count: sr.clientEffects }) }),
41011
+ sr.emittedEvents.length > 0 && /* @__PURE__ */ jsxs("span", { className: "px-1 rounded bg-primary/10 text-primary", children: [
40976
41012
  t("debug.emitLabel"),
40977
41013
  " ",
40978
41014
  sr.emittedEvents.join(", ")
40979
41015
  ] }),
40980
- sr.error && /* @__PURE__ */ jsx("span", { className: "px-1 rounded bg-red-500/15 text-red-600 dark:text-red-400 truncate max-w-[300px]", children: sr.error })
41016
+ sr.error && /* @__PURE__ */ jsx("span", { className: "px-1 rounded bg-error/10 text-error truncate max-w-[300px]", children: sr.error })
40981
41017
  ] }),
40982
41018
  entityEntries.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1 mt-0.5", children: entityEntries.map(([name, count]) => /* @__PURE__ */ jsxs("span", { className: "px-1 rounded bg-[var(--color-card)] text-foreground", children: [
40983
41019
  name,
@@ -40993,9 +41029,9 @@ function TransitionRow({ trace }) {
40993
41029
  if (isServerEntry && trace.serverResponse) {
40994
41030
  return /* @__PURE__ */ jsxs("div", { className: "py-0.5 border-b border-border last:border-0", children: [
40995
41031
  /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2 text-xs font-mono", children: [
40996
- /* @__PURE__ */ jsx("span", { className: "mt-1.5 w-1.5 h-1.5 rounded-full flex-shrink-0 bg-purple-500" }),
41032
+ /* @__PURE__ */ jsx("span", { className: "mt-1.5 w-1.5 h-1.5 rounded-full flex-shrink-0 bg-primary" }),
40997
41033
  /* @__PURE__ */ jsx(Badge, { variant: "warning", size: "sm", className: "flex-shrink-0", children: trace.event }),
40998
- /* @__PURE__ */ jsx("span", { className: "text-purple-600 dark:text-purple-400 flex-shrink-0", children: t("debug.serverResponse") })
41034
+ /* @__PURE__ */ jsx("span", { className: "text-primary flex-shrink-0", children: t("debug.serverResponse") })
40999
41035
  ] }),
41000
41036
  /* @__PURE__ */ jsx(ServerResponseRow, { sr: trace.serverResponse })
41001
41037
  ] });
@@ -41004,7 +41040,7 @@ function TransitionRow({ trace }) {
41004
41040
  /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2 text-xs font-mono", children: [
41005
41041
  /* @__PURE__ */ jsx("span", { className: cn(
41006
41042
  "mt-1.5 w-1.5 h-1.5 rounded-full flex-shrink-0",
41007
- hasFailedEffects ? "bg-red-500" : "bg-green-500"
41043
+ hasFailedEffects ? "bg-error" : "bg-success"
41008
41044
  ) }),
41009
41045
  /* @__PURE__ */ jsx(Badge, { variant: "info", size: "sm", className: "flex-shrink-0", children: trace.event }),
41010
41046
  /* @__PURE__ */ jsx("span", { className: "text-foreground flex-shrink-0", children: trace.traitName }),
@@ -41018,7 +41054,7 @@ function TransitionRow({ trace }) {
41018
41054
  ] }),
41019
41055
  trace.effects.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1 ml-6 mt-0.5", children: trace.effects.map((eff, i) => /* @__PURE__ */ jsxs("span", { className: cn(
41020
41056
  "px-1 rounded text-xs",
41021
- 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"
41057
+ eff.status === "executed" ? "bg-success/10 text-success" : eff.status === "failed" ? "bg-error/10 text-error" : "bg-warning/10 text-warning"
41022
41058
  ), children: [
41023
41059
  eff.status === "executed" ? "\u2713" : eff.status === "failed" ? "\u2717" : "-",
41024
41060
  " ",
@@ -41052,7 +41088,7 @@ function VerifyModePanel({
41052
41088
  {
41053
41089
  className: cn(
41054
41090
  "runtime-debugger runtime-debugger--verify",
41055
- "flex flex-col bg-[var(--color-card)] text-[var(--color-foreground)] border-t-2 border-cyan-500",
41091
+ "flex flex-col bg-[var(--color-card)] text-[var(--color-foreground)] border-t-2 border-accent",
41056
41092
  hudBottom ? "" : "fixed bottom-0 left-0 right-0",
41057
41093
  className
41058
41094
  ),
@@ -41073,8 +41109,8 @@ function VerifyModePanel({
41073
41109
  /* @__PURE__ */ jsx("span", { className: "text-foreground/50 w-3", "aria-hidden": true, children: expanded ? "\u25BE" : "\u25B8" }),
41074
41110
  /* @__PURE__ */ jsx(Badge, { variant: failedChecks > 0 ? "danger" : "success", size: "sm", children: failedChecks > 0 ? t("debug.failCount", { count: failedChecks }) : t("debug.ok") }),
41075
41111
  /* @__PURE__ */ jsx("span", { className: "text-foreground/70", children: t("debug.localCount", { count: localCount }) }),
41076
- /* @__PURE__ */ jsx("span", { className: "text-purple-600 dark:text-purple-400", children: t("debug.serverCount", { count: serverCount }) }),
41077
- traitStates && /* @__PURE__ */ jsx("span", { className: "text-cyan-600 dark:text-cyan-400 truncate max-w-[400px]", children: traitStates }),
41112
+ /* @__PURE__ */ jsx("span", { className: "text-primary", children: t("debug.serverCount", { count: serverCount }) }),
41113
+ traitStates && /* @__PURE__ */ jsx("span", { className: "text-accent truncate max-w-[400px]", children: traitStates }),
41078
41114
  !expanded && transitions.length > 0 && /* @__PURE__ */ jsx("span", { className: "ml-auto text-foreground/50", children: t("debug.transitionsCount", { count: transitions.length }) })
41079
41115
  ]
41080
41116
  }
@@ -41269,7 +41305,7 @@ function RuntimeDebugger({
41269
41305
  title: t("debug.openDebugger"),
41270
41306
  children: failedChecks > 0 ? /* @__PURE__ */ jsxs("span", { className: "relative", children: [
41271
41307
  /* @__PURE__ */ jsx("span", { children: "V" }),
41272
- /* @__PURE__ */ jsx("span", { className: "absolute -top-1 -right-2 w-2 h-2 bg-red-500 rounded-full" })
41308
+ /* @__PURE__ */ jsx("span", { className: "absolute -top-1 -right-2 w-2 h-2 bg-error rounded-full" })
41273
41309
  ] }) : /* @__PURE__ */ jsx("span", { children: "V" })
41274
41310
  }
41275
41311
  ) : /* @__PURE__ */ jsxs(Card, { className: "runtime-debugger__panel", children: [
@@ -41357,7 +41393,7 @@ var init_SegmentRenderer = __esm({
41357
41393
  "div",
41358
41394
  {
41359
41395
  className: cn(
41360
- "border border-gray-200 dark:border-gray-700 rounded-lg p-2 md:p-4 overflow-x-auto space-y-6",
41396
+ "border border-border rounded-lg p-2 md:p-4 overflow-x-auto space-y-6",
41361
41397
  containerClassName,
41362
41398
  className
41363
41399
  ),
@@ -45453,6 +45489,28 @@ function extractRouteParams2(pattern, path) {
45453
45489
  function pathMatches2(pattern, path) {
45454
45490
  return matchPath2(pattern, path) !== null;
45455
45491
  }
45492
+ function comparePathSpecificity2(a, b) {
45493
+ const aParts = a.split("/").filter(Boolean);
45494
+ const bParts = b.split("/").filter(Boolean);
45495
+ const shared = Math.min(aParts.length, bParts.length);
45496
+ for (let i = 0; i < shared; i++) {
45497
+ const aParam = aParts[i].startsWith(":");
45498
+ const bParam = bParts[i].startsWith(":");
45499
+ if (aParam !== bParam) return aParam ? 1 : -1;
45500
+ }
45501
+ return 0;
45502
+ }
45503
+ function matchPathAmong2(candidates, path, pathOf) {
45504
+ const routed = candidates.filter((candidate) => Boolean(pathOf(candidate)));
45505
+ const ranked = [...routed].sort(
45506
+ (a, b) => comparePathSpecificity2(pathOf(a), pathOf(b))
45507
+ );
45508
+ for (const candidate of ranked) {
45509
+ const params = matchPath2(pathOf(candidate), path);
45510
+ if (params !== null) return { candidate, params };
45511
+ }
45512
+ return null;
45513
+ }
45456
45514
  function isInlineOrbital(orbital) {
45457
45515
  return "name" in orbital && typeof orbital.name === "string";
45458
45516
  }
@@ -45461,21 +45519,22 @@ function isInlinePage(page) {
45461
45519
  }
45462
45520
  function findPageByPath2(schema, path) {
45463
45521
  if (!schema.orbitals) return null;
45522
+ const candidates = [];
45464
45523
  for (const orbital of schema.orbitals) {
45465
45524
  if (!isInlineOrbital(orbital)) continue;
45466
45525
  if (!orbital.pages) continue;
45467
45526
  for (const pageRef of orbital.pages) {
45468
45527
  if (!isInlinePage(pageRef)) continue;
45469
- const page = pageRef;
45470
- const pagePath = page.path;
45471
- if (!pagePath) continue;
45472
- const params = matchPath2(pagePath, path);
45473
- if (params !== null) {
45474
- return { page, params, orbitalName: orbital.name };
45475
- }
45528
+ candidates.push({ page: pageRef, orbitalName: orbital.name });
45476
45529
  }
45477
45530
  }
45478
- return null;
45531
+ const hit = matchPathAmong2(candidates, path, (entry) => entry.page.path);
45532
+ if (!hit) return null;
45533
+ return {
45534
+ page: hit.candidate.page,
45535
+ params: hit.params,
45536
+ orbitalName: hit.candidate.orbitalName
45537
+ };
45479
45538
  }
45480
45539
  function findPageByName2(schema, pageName) {
45481
45540
  if (!schema.orbitals) return null;
@@ -45654,6 +45713,66 @@ function useNavigationId2() {
45654
45713
  init_useEventBus();
45655
45714
  var xOrbitalLog = createLogger("almadar:runtime:cross-orbital");
45656
45715
  var serverBridgeLog = createLogger("almadar:ui:server-bridge");
45716
+ function reEmitServerEvent(eventBus, emitted, origin) {
45717
+ const evTrait = emitted.source?.trait;
45718
+ if (!evTrait) {
45719
+ xOrbitalLog.warn("emit:dropped-no-source", { event: emitted.event, origin });
45720
+ return;
45721
+ }
45722
+ const key = emitted.source?.orbital ? `UI:${emitted.source.orbital}.${evTrait}.${emitted.event}` : `UI:${evTrait}.${emitted.event}`;
45723
+ xOrbitalLog.info("emit:rebroadcast", {
45724
+ busKey: key,
45725
+ sourceOrbital: emitted.source?.orbital,
45726
+ sourceTrait: evTrait,
45727
+ origin
45728
+ });
45729
+ eventBus.emit(key, emitted.payload);
45730
+ }
45731
+ function isBusPushEnvelope(value) {
45732
+ return value.type === "bus" && typeof value.event === "string";
45733
+ }
45734
+ var tabClientId;
45735
+ function getTabClientId() {
45736
+ if (tabClientId === void 0) tabClientId = crypto.randomUUID();
45737
+ return tabClientId;
45738
+ }
45739
+ var pushChannels = /* @__PURE__ */ new Map();
45740
+ function acquirePushChannel(url, subscriber) {
45741
+ let channel = pushChannels.get(url);
45742
+ if (channel === void 0) {
45743
+ const source = new EventSource(url);
45744
+ const created = { source, subscribers: /* @__PURE__ */ new Set() };
45745
+ source.onmessage = (ev) => {
45746
+ let parsed;
45747
+ try {
45748
+ parsed = JSON.parse(ev.data);
45749
+ } catch (err) {
45750
+ serverBridgeLog.warn("push:parse-failed", { error: err instanceof Error ? err.message : String(err) });
45751
+ return;
45752
+ }
45753
+ if (!isBusPushEnvelope(parsed)) return;
45754
+ for (const sub of created.subscribers) sub(parsed);
45755
+ };
45756
+ source.onerror = () => {
45757
+ serverBridgeLog.warn("push:connection-error", { url });
45758
+ };
45759
+ pushChannels.set(url, created);
45760
+ channel = created;
45761
+ }
45762
+ channel.subscribers.add(subscriber);
45763
+ return () => {
45764
+ channel.subscribers.delete(subscriber);
45765
+ if (channel.subscribers.size === 0) {
45766
+ channel.source.close();
45767
+ pushChannels.delete(url);
45768
+ }
45769
+ };
45770
+ }
45771
+ function deriveEventsUrl(serverUrl) {
45772
+ const trimmed = serverUrl.replace(/\/+$/, "");
45773
+ const apiRoot = trimmed.replace(/\/[^/]*$/, "");
45774
+ return `${apiRoot}/events`;
45775
+ }
45657
45776
  function createHttpTransport(serverUrl) {
45658
45777
  return {
45659
45778
  register: async (schema) => {
@@ -45680,11 +45799,12 @@ function createHttpTransport(serverUrl) {
45680
45799
  } catch {
45681
45800
  }
45682
45801
  },
45683
- sendEvent: async (orbitalName, event, payload) => {
45802
+ sendEvent: async (orbitalName, event, payload, clientId) => {
45803
+ const body = { event, payload, clientId };
45684
45804
  const res = await fetch(`${serverUrl}/${orbitalName}/events`, {
45685
45805
  method: "POST",
45686
45806
  headers: { "Content-Type": "application/json" },
45687
- body: JSON.stringify({ event, payload })
45807
+ body: JSON.stringify(body)
45688
45808
  });
45689
45809
  return res.json();
45690
45810
  }
@@ -45729,7 +45849,7 @@ function ServerBridgeProvider({
45729
45849
  const emptyMeta = { success: false, clientEffects: 0, dataEntities: {}, emittedEvents: [] };
45730
45850
  if (!connected) return { effects: [], meta: emptyMeta };
45731
45851
  try {
45732
- const result = await transport.sendEvent(orbitalName, event, payload);
45852
+ const result = await transport.sendEvent(orbitalName, event, payload, getTabClientId());
45733
45853
  const effects = [];
45734
45854
  const responseData = result.data || {};
45735
45855
  const dataEntities = {};
@@ -45774,22 +45894,7 @@ function ServerBridgeProvider({
45774
45894
  }
45775
45895
  if (result.emittedEvents) {
45776
45896
  for (const emitted of result.emittedEvents) {
45777
- const evTrait = emitted.source?.trait;
45778
- if (!evTrait) {
45779
- xOrbitalLog.warn("emit:dropped-no-source", {
45780
- event: emitted.event,
45781
- dispatchOrbital: orbitalName
45782
- });
45783
- continue;
45784
- }
45785
- const key = emitted.source?.orbital ? `UI:${emitted.source.orbital}.${evTrait}.${emitted.event}` : `UI:${evTrait}.${emitted.event}`;
45786
- xOrbitalLog.info("emit:rebroadcast", {
45787
- busKey: key,
45788
- sourceOrbital: emitted.source?.orbital,
45789
- sourceTrait: evTrait,
45790
- dispatchOrbital: orbitalName
45791
- });
45792
- eventBus.emit(key, emitted.payload);
45897
+ reEmitServerEvent(eventBus, emitted, orbitalName);
45793
45898
  }
45794
45899
  }
45795
45900
  } else if (result.error) {
@@ -45831,6 +45936,19 @@ function ServerBridgeProvider({
45831
45936
  unregisterSchema();
45832
45937
  };
45833
45938
  }, [schema, registerSchema, unregisterSchema]);
45939
+ useEffect(() => {
45940
+ if (!serverUrl) return;
45941
+ if (typeof EventSource === "undefined") return;
45942
+ const url = `${deriveEventsUrl(serverUrl)}?clientId=${encodeURIComponent(getTabClientId())}`;
45943
+ return acquirePushChannel(url, (parsed) => {
45944
+ serverBridgeLog.debug("push:received", {
45945
+ event: parsed.event,
45946
+ sourceOrbital: parsed.source?.orbital,
45947
+ sourceTrait: parsed.source?.trait
45948
+ });
45949
+ reEmitServerEvent(eventBus, parsed, "push");
45950
+ });
45951
+ }, [serverUrl, eventBus]);
45834
45952
  return /* @__PURE__ */ jsx(ServerBridgeContext.Provider, { value: { connected, sendEvent }, children });
45835
45953
  }
45836
45954
  var log12 = createLogger("almadar:ui:trait-provider");
@@ -46010,4 +46128,4 @@ function GameAudioProvider2({
46010
46128
  }
46011
46129
  GameAudioProvider2.displayName = "GameAudioProvider";
46012
46130
 
46013
- export { ANONYMOUS_USER, CurrentPagePathContext, CurrentPagePathProvider, EntitySchemaProvider, EventBusContext2 as EventBusContext, EventBusProvider, GameAudioContext2 as GameAudioContext, GameAudioProvider2 as GameAudioProvider, NavigationProvider2 as NavigationProvider, OfflineModeProvider, OrbitalProvider, OrbitalThemeProvider, SelectionContext, SelectionProvider, ServerBridgeProvider, TraitContext, TraitProvider, TraitScopeProvider3 as TraitScopeProvider, UserContext, UserProvider, VerificationProvider, extractRouteParams2 as extractRouteParams, findPageByName2 as findPageByName, findPageByPath2 as findPageByPath, getAllPages2 as getAllPages, getDefaultPage2 as getDefaultPage, matchPath2 as matchPath, pathMatches2 as pathMatches, useActivePage2 as useActivePage, useCurrentPagePath2 as useCurrentPagePath, useEntitySchema, useEntitySchemaOptional6 as useEntitySchemaOptional, useGameAudioContext2 as useGameAudioContext, useGameAudioContextOptional2 as useGameAudioContextOptional, useHasPermission, useHasRole, useInitPayload2 as useInitPayload, useNavigateTo2 as useNavigateTo, useNavigation2 as useNavigation, useNavigationId2 as useNavigationId, useNavigationState2 as useNavigationState, useOfflineMode, useOptionalOfflineMode, useSelection, useSelectionOptional, useServerBridge, useTrait, useTraitContext, useTraitScope, useTraitScopeChain2 as useTraitScopeChain, useUser, useUserForEvaluation };
46131
+ export { ANONYMOUS_USER, CurrentPagePathContext, CurrentPagePathProvider, EntitySchemaProvider, EventBusContext2 as EventBusContext, EventBusProvider, GameAudioContext2 as GameAudioContext, GameAudioProvider2 as GameAudioProvider, NavigationProvider2 as NavigationProvider, OfflineModeProvider, OrbitalProvider, OrbitalThemeProvider, SelectionContext, SelectionProvider, ServerBridgeProvider, TraitContext, TraitProvider, TraitScopeProvider3 as TraitScopeProvider, UserContext, UserProvider, VerificationProvider, comparePathSpecificity2 as comparePathSpecificity, extractRouteParams2 as extractRouteParams, findPageByName2 as findPageByName, findPageByPath2 as findPageByPath, getAllPages2 as getAllPages, getDefaultPage2 as getDefaultPage, matchPath2 as matchPath, matchPathAmong2 as matchPathAmong, pathMatches2 as pathMatches, useActivePage2 as useActivePage, useCurrentPagePath2 as useCurrentPagePath, useEntitySchema, useEntitySchemaOptional6 as useEntitySchemaOptional, useGameAudioContext2 as useGameAudioContext, useGameAudioContextOptional2 as useGameAudioContextOptional, useHasPermission, useHasRole, useInitPayload2 as useInitPayload, useNavigateTo2 as useNavigateTo, useNavigation2 as useNavigation, useNavigationId2 as useNavigationId, useNavigationState2 as useNavigationState, useOfflineMode, useOptionalOfflineMode, useSelection, useSelectionOptional, useServerBridge, useTrait, useTraitContext, useTraitScope, useTraitScopeChain2 as useTraitScopeChain, useUser, useUserForEvaluation };