@almadar/ui 5.25.1 → 5.26.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/dist/avl/index.cjs +2210 -2295
  2. package/dist/avl/index.js +1159 -1244
  3. package/dist/components/core/atoms/FlipContainer.d.ts +4 -4
  4. package/dist/components/core/atoms/Icon.d.ts +4 -2
  5. package/dist/components/core/atoms/ProgressBar.d.ts +1 -1
  6. package/dist/components/core/atoms/svg/SvgBranch.d.ts +6 -2
  7. package/dist/components/core/atoms/svg/SvgConnection.d.ts +8 -4
  8. package/dist/components/core/atoms/svg/SvgFlow.d.ts +5 -1
  9. package/dist/components/core/atoms/svg/SvgGrid.d.ts +6 -2
  10. package/dist/components/core/atoms/svg/SvgLobe.d.ts +6 -2
  11. package/dist/components/core/atoms/svg/SvgMesh.d.ts +6 -2
  12. package/dist/components/core/atoms/svg/SvgMorph.d.ts +6 -2
  13. package/dist/components/core/atoms/svg/SvgNode.d.ts +6 -2
  14. package/dist/components/core/atoms/svg/SvgPulse.d.ts +6 -2
  15. package/dist/components/core/atoms/svg/SvgRing.d.ts +6 -2
  16. package/dist/components/core/atoms/svg/SvgShield.d.ts +6 -2
  17. package/dist/components/core/atoms/svg/SvgStack.d.ts +6 -2
  18. package/dist/components/core/atoms/types.d.ts +6 -0
  19. package/dist/components/core/molecules/ArrayEditor.d.ts +15 -0
  20. package/dist/components/core/molecules/Carousel.d.ts +8 -2
  21. package/dist/components/core/molecules/Container.d.ts +4 -4
  22. package/dist/components/core/molecules/DateRangeSelector.d.ts +3 -4
  23. package/dist/components/core/molecules/DocSidebar.d.ts +4 -4
  24. package/dist/components/core/molecules/EdgeDecoration.d.ts +3 -2
  25. package/dist/components/core/molecules/Flex.d.ts +4 -4
  26. package/dist/components/core/molecules/FlipCard.d.ts +3 -4
  27. package/dist/components/core/molecules/GradientDivider.d.ts +3 -2
  28. package/dist/components/core/molecules/MapEditor.d.ts +16 -0
  29. package/dist/components/core/molecules/ObjectEditor.d.ts +15 -0
  30. package/dist/components/core/molecules/SidePanel.d.ts +4 -4
  31. package/dist/components/core/molecules/SortableList.d.ts +4 -5
  32. package/dist/components/core/molecules/ViolationAlert.d.ts +4 -9
  33. package/dist/components/core/molecules/index.d.ts +4 -3
  34. package/dist/components/core/molecules/markdown/CodeBlock.d.ts +44 -2
  35. package/dist/components/core/molecules/markdown/MarkdownContent.d.ts +2 -2
  36. package/dist/components/game/atoms/ResourceCounter.d.ts +3 -2
  37. package/dist/components/game/atoms/StateIndicator.d.ts +4 -5
  38. package/dist/components/game/atoms/StatusEffect.d.ts +2 -3
  39. package/dist/components/game/molecules/ActionButtons.d.ts +6 -0
  40. package/dist/components/game/molecules/GameHud.d.ts +2 -3
  41. package/dist/components/game/molecules/StatBadge.d.ts +6 -0
  42. package/dist/components/game/organisms/puzzles/state-architect/StateJsonView.d.ts +16 -0
  43. package/dist/components/game/organisms/puzzles/state-architect/index.d.ts +2 -2
  44. package/dist/components/index.cjs +2458 -2092
  45. package/dist/components/index.js +1558 -1192
  46. package/dist/docs/index.cjs +6021 -4606
  47. package/dist/docs/index.css +1252 -0
  48. package/dist/docs/index.d.cts +108 -16
  49. package/dist/docs/index.d.ts +2 -2
  50. package/dist/docs/index.js +5977 -4567
  51. package/dist/hooks/index.cjs +9 -2
  52. package/dist/hooks/index.js +9 -2
  53. package/dist/marketing/index.cjs +32 -9
  54. package/dist/marketing/index.d.cts +30 -20
  55. package/dist/marketing/index.js +32 -9
  56. package/dist/providers/index.cjs +2035 -2120
  57. package/dist/providers/index.js +1134 -1219
  58. package/dist/runtime/index.cjs +2075 -2160
  59. package/dist/runtime/index.js +1138 -1223
  60. package/package.json +1 -1
  61. package/dist/components/core/molecules/CodeViewer.d.ts +0 -70
  62. package/dist/components/core/molecules/DocCodeBlock.d.ts +0 -14
  63. package/dist/components/game/organisms/puzzles/state-architect/CodeView.d.ts +0 -24
package/dist/avl/index.js CHANGED
@@ -1,13 +1,13 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
- import * as React95 from 'react';
3
- import React95__default, { createContext, useState, useMemo, useRef, useEffect, useContext, useCallback, Suspense, useLayoutEffect, Profiler, useReducer, useSyncExternalStore, lazy, useId } from 'react';
2
+ import * as React93 from 'react';
3
+ import React93__default, { createContext, useState, useMemo, useRef, useEffect, useContext, useCallback, Suspense, useLayoutEffect, Profiler, useReducer, useSyncExternalStore, lazy, useId } from 'react';
4
4
  import { OrbitalProvider, EventBusContext, useTraitScope, VerificationProvider, TraitScopeProvider } from '@almadar/ui/providers';
5
5
  import { createLogger, isLogLevelEnabled } from '@almadar/logger';
6
6
  import ELK from 'elkjs/lib/elk.bundled.js';
7
7
  import { MarkerType, useReactFlow, Handle, Position, getBezierPath, EdgeLabelRenderer, useNodeId, ReactFlowProvider, BaseEdge, useNodesState, useEdgesState, ReactFlow, Controls, Background, BackgroundVariant } from '@xyflow/react';
8
8
  import { useTranslate, useEventBus as useEventBus$1 } from '@almadar/ui/hooks';
9
9
  import * as LucideIcons2 from 'lucide-react';
10
- import { Loader2, X, List, Printer, ChevronRight, ChevronLeft, GitBranch, Pencil, Eye, Plus, ArrowRight, Trash, Code, FileText, WrapText, Check, Copy, AlertTriangle, Trash2, ZoomOut, ZoomIn, Download, RotateCcw, Menu as Menu$1, Package, Calendar, MoreHorizontal, Image as Image$1, Upload, ArrowLeft, HelpCircle, Search, Type, Heading1, Heading2, Heading3, ListOrdered, Quote, Minus, Eraser, TrendingUp, TrendingDown, AlertCircle, Circle, Clock, CheckCircle2, CheckCircle, XCircle, Play, Pause, SkipForward, Bug, Send, ChevronUp, ChevronDown, Wrench, Tag, User, DollarSign, Zap, Sword, Move, Heart, Shield } from 'lucide-react';
10
+ import { Loader2, X, Code, FileText, WrapText, Check, Copy, List, Printer, ChevronRight, ChevronLeft, GitBranch, Pencil, Eye, Plus, ArrowRight, Trash, AlertTriangle, Trash2, ZoomOut, ZoomIn, Download, RotateCcw, Menu as Menu$1, Package, Calendar, MoreHorizontal, Image as Image$1, Upload, ArrowLeft, HelpCircle, Search, Type, Heading1, Heading2, Heading3, ListOrdered, Quote, Minus, Eraser, TrendingUp, TrendingDown, AlertCircle, Circle, Clock, CheckCircle2, CheckCircle, XCircle, Play, Pause, SkipForward, Bug, Send, ChevronUp, ChevronDown, Wrench, Tag, User, DollarSign, Zap, Sword, Move, Heart, Shield } from 'lucide-react';
11
11
  import * as PhosphorIcons from '@phosphor-icons/react';
12
12
  import * as TablerIcons from '@tabler/icons-react';
13
13
  import * as FaIcons from 'react-icons/fa';
@@ -3467,7 +3467,7 @@ var init_Box = __esm({
3467
3467
  fixed: "fixed",
3468
3468
  sticky: "sticky"
3469
3469
  };
3470
- Box = React95__default.forwardRef(
3470
+ Box = React93__default.forwardRef(
3471
3471
  ({
3472
3472
  padding,
3473
3473
  paddingX,
@@ -3517,7 +3517,7 @@ var init_Box = __esm({
3517
3517
  onMouseLeave?.(e);
3518
3518
  }, [hoverEvent, eventBus, onMouseLeave]);
3519
3519
  const isClickable = action || onClick;
3520
- return React95__default.createElement(
3520
+ return React93__default.createElement(
3521
3521
  Component,
3522
3522
  {
3523
3523
  ref,
@@ -4107,7 +4107,7 @@ var init_MiniStateMachine = __esm({
4107
4107
  const x = 2 + i * (NODE_W + GAP + ARROW_W + GAP);
4108
4108
  const tc = transitionCounts[s.name] ?? 0;
4109
4109
  const role = getStateRole(s.name, s.isInitial, s.isTerminal, tc, maxTC);
4110
- return /* @__PURE__ */ jsxs(React95__default.Fragment, { children: [
4110
+ return /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
4111
4111
  /* @__PURE__ */ jsx(
4112
4112
  AvlState,
4113
4113
  {
@@ -5126,12 +5126,20 @@ function doResolve(name) {
5126
5126
  if (asIs && typeof asIs === "object") return asIs;
5127
5127
  return LucideIcons2.HelpCircle;
5128
5128
  }
5129
- var iconAliases, resolvedCache, sizeClasses, animationClasses, Icon;
5129
+ var colorTokenClasses, iconAliases, resolvedCache, sizeClasses, animationClasses, Icon;
5130
5130
  var init_Icon = __esm({
5131
5131
  "components/core/atoms/Icon.tsx"() {
5132
5132
  "use client";
5133
5133
  init_cn();
5134
5134
  init_iconFamily();
5135
+ colorTokenClasses = {
5136
+ primary: "text-primary",
5137
+ secondary: "text-secondary",
5138
+ success: "text-success",
5139
+ warning: "text-warning",
5140
+ error: "text-error",
5141
+ muted: "text-muted-foreground"
5142
+ };
5135
5143
  iconAliases = {
5136
5144
  "close": LucideIcons2.X,
5137
5145
  "trash": LucideIcons2.Trash2,
@@ -5170,7 +5178,7 @@ var init_Icon = __esm({
5170
5178
  const directIcon = typeof icon === "string" ? void 0 : icon;
5171
5179
  const effectiveName = typeof icon === "string" ? icon : name;
5172
5180
  const family = useIconFamily();
5173
- const RenderedComponent = React95__default.useMemo(() => {
5181
+ const RenderedComponent = React93__default.useMemo(() => {
5174
5182
  if (directIcon) return null;
5175
5183
  return effectiveName ? resolveIconForFamily(effectiveName, family) : null;
5176
5184
  }, [directIcon, effectiveName, family]);
@@ -5179,10 +5187,11 @@ var init_Icon = __esm({
5179
5187
  ...effectiveStrokeWidth === void 0 ? { strokeWidth: "var(--icon-stroke-width, 2)" } : {},
5180
5188
  ...style
5181
5189
  };
5190
+ const resolvedColor = color ? color in colorTokenClasses ? colorTokenClasses[color] : color : "text-current";
5182
5191
  const composedClassName = cn(
5183
5192
  sizeClasses[size],
5184
5193
  animationClasses[animation],
5185
- color ? color : "text-current",
5194
+ resolvedColor,
5186
5195
  className
5187
5196
  );
5188
5197
  if (directIcon) {
@@ -5228,7 +5237,7 @@ function resolveIconProp(value, sizeClass) {
5228
5237
  const IconComp = value;
5229
5238
  return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
5230
5239
  }
5231
- if (React95__default.isValidElement(value)) {
5240
+ if (React93__default.isValidElement(value)) {
5232
5241
  return value;
5233
5242
  }
5234
5243
  if (typeof value === "object" && value !== null && "render" in value) {
@@ -5304,7 +5313,7 @@ var init_Button = __esm({
5304
5313
  md: "h-icon-default w-icon-default",
5305
5314
  lg: "h-icon-default w-icon-default"
5306
5315
  };
5307
- Button = React95__default.forwardRef(
5316
+ Button = React93__default.forwardRef(
5308
5317
  ({
5309
5318
  className,
5310
5319
  variant = "primary",
@@ -5369,7 +5378,7 @@ var Dialog;
5369
5378
  var init_Dialog = __esm({
5370
5379
  "components/core/atoms/Dialog.tsx"() {
5371
5380
  init_cn();
5372
- Dialog = React95__default.forwardRef(
5381
+ Dialog = React93__default.forwardRef(
5373
5382
  ({
5374
5383
  role = "dialog",
5375
5384
  "aria-modal": ariaModal = true,
@@ -5391,43 +5400,6 @@ var init_Dialog = __esm({
5391
5400
  Dialog.displayName = "Dialog";
5392
5401
  }
5393
5402
  });
5394
- var Overlay;
5395
- var init_Overlay = __esm({
5396
- "components/core/atoms/Overlay.tsx"() {
5397
- "use client";
5398
- init_cn();
5399
- init_useEventBus();
5400
- Overlay = ({
5401
- isVisible = true,
5402
- onClick,
5403
- className,
5404
- blur = false,
5405
- action
5406
- }) => {
5407
- const eventBus = useEventBus();
5408
- if (!isVisible) return null;
5409
- const handleClick = (e) => {
5410
- if (action) {
5411
- eventBus.emit(`UI:${action}`, {});
5412
- }
5413
- onClick?.(e);
5414
- };
5415
- return /* @__PURE__ */ jsx(
5416
- "div",
5417
- {
5418
- className: cn(
5419
- "fixed inset-0 z-40",
5420
- blur && "backdrop-blur-sm",
5421
- className
5422
- ),
5423
- style: { backgroundColor: "rgba(0, 0, 0, 0.6)" },
5424
- onClick: action || onClick ? handleClick : void 0,
5425
- "aria-hidden": "true"
5426
- }
5427
- );
5428
- };
5429
- }
5430
- });
5431
5403
  var sizeClasses2, minWidthClasses, lookStyles, Modal;
5432
5404
  var init_Modal = __esm({
5433
5405
  "components/core/molecules/Modal.tsx"() {
@@ -5436,7 +5408,6 @@ var init_Modal = __esm({
5436
5408
  init_Button();
5437
5409
  init_Dialog();
5438
5410
  init_Typography();
5439
- init_Overlay();
5440
5411
  init_cn();
5441
5412
  init_useEventBus();
5442
5413
  sizeClasses2 = {
@@ -5526,130 +5497,160 @@ var init_Modal = __esm({
5526
5497
  }
5527
5498
  };
5528
5499
  return createPortal(
5529
- /* @__PURE__ */ jsxs(Fragment, { children: [
5530
- /* @__PURE__ */ jsx(
5531
- Overlay,
5532
- {
5533
- isVisible: isOpen,
5534
- onClick: handleOverlayClick,
5535
- className: "z-[1000]"
5536
- }
5537
- ),
5538
- /* @__PURE__ */ jsx(
5539
- Box,
5540
- {
5541
- className: cn(
5542
- "fixed inset-0 z-[1001] pointer-events-none",
5543
- "flex items-start justify-center px-4 pb-4 pt-[10vh]",
5544
- "max-sm:items-stretch max-sm:p-0 max-sm:pt-0"
5545
- ),
5546
- children: /* @__PURE__ */ jsxs(
5547
- Dialog,
5548
- {
5549
- ref: modalRef,
5550
- open: true,
5551
- className: cn(
5552
- // Reset browser-default dialog chrome — we own styling. `static`
5553
- // overrides the user-agent `position: absolute` so the parent
5554
- // flex container's `justify-center` actually centers the dialog
5555
- // (without this, the dialog drops out of flex flow and `m-0`
5556
- // kills the user-agent's `margin: auto` centering, pinning the
5557
- // dialog to top-left).
5558
- "static m-0 p-0 border-0 bg-transparent",
5559
- // Pre-existing dialog frame
5560
- "pointer-events-auto w-full flex flex-col bg-surface border shadow-elevation-dialog rounded-container",
5561
- // Desktop sizing + viewport-aware floor.
5562
- sizeClasses2[size],
5563
- minWidthClasses[size],
5564
- "max-h-[80vh]",
5565
- // Mobile: take the entire screen. Override desktop max-w cap,
5566
- // full height, no rounded corners, no min-width.
5567
- "max-sm:max-w-none max-sm:max-h-none max-sm:w-full max-sm:h-full max-sm:rounded-none",
5568
- lookStyles[look],
5569
- className
5500
+ /* @__PURE__ */ jsx(
5501
+ "div",
5502
+ {
5503
+ className: cn(
5504
+ "fixed inset-0 z-[1000]",
5505
+ "flex items-start justify-center px-4 pb-4 pt-[10vh]",
5506
+ "max-sm:items-stretch max-sm:p-0 max-sm:pt-0"
5507
+ ),
5508
+ style: { backgroundColor: "rgba(0, 0, 0, 0.6)" },
5509
+ onClick: handleOverlayClick,
5510
+ "aria-hidden": "true",
5511
+ children: /* @__PURE__ */ jsxs(
5512
+ Dialog,
5513
+ {
5514
+ ref: modalRef,
5515
+ open: true,
5516
+ className: cn(
5517
+ // Reset browser-default dialog chrome — we own styling. `static`
5518
+ // overrides the user-agent `position: absolute` so the parent
5519
+ // flex container's `justify-center` actually centers the dialog
5520
+ // (without this, the dialog drops out of flex flow and `m-0`
5521
+ // kills the user-agent's `margin: auto` centering, pinning the
5522
+ // dialog to top-left).
5523
+ "static m-0 p-0 border-0 bg-transparent",
5524
+ // Pre-existing dialog frame
5525
+ "pointer-events-auto w-full flex flex-col bg-surface border shadow-elevation-dialog rounded-container",
5526
+ // Desktop sizing + viewport-aware floor.
5527
+ sizeClasses2[size],
5528
+ minWidthClasses[size],
5529
+ "max-h-[80vh]",
5530
+ // Mobile: take the entire screen. Override desktop max-w cap,
5531
+ // full height, no rounded corners, no min-width.
5532
+ "max-sm:max-w-none max-sm:max-h-none max-sm:w-full max-sm:h-full max-sm:rounded-none",
5533
+ lookStyles[look],
5534
+ className
5535
+ ),
5536
+ style: dragY > 0 ? {
5537
+ transform: `translateY(${dragY}px)`,
5538
+ transition: isDragging.current ? "none" : "transform 200ms ease-out"
5539
+ } : void 0,
5540
+ ...title && { "aria-labelledby": "modal-title" },
5541
+ children: [
5542
+ /* @__PURE__ */ jsx(
5543
+ Box,
5544
+ {
5545
+ className: "hidden max-sm:flex justify-center py-2 cursor-grab active:cursor-grabbing touch-none",
5546
+ onPointerDown: (e) => {
5547
+ if (!swipeDownToClose) return;
5548
+ dragStartY.current = e.clientY;
5549
+ isDragging.current = true;
5550
+ e.target.setPointerCapture(e.pointerId);
5551
+ },
5552
+ onPointerMove: (e) => {
5553
+ if (!isDragging.current) return;
5554
+ const dy = Math.max(0, e.clientY - dragStartY.current);
5555
+ setDragY(dy);
5556
+ },
5557
+ onPointerUp: () => {
5558
+ if (!isDragging.current) return;
5559
+ isDragging.current = false;
5560
+ if (dragY > 100) {
5561
+ handleClose();
5562
+ }
5563
+ setDragY(0);
5564
+ },
5565
+ onPointerCancel: () => {
5566
+ isDragging.current = false;
5567
+ setDragY(0);
5568
+ },
5569
+ children: /* @__PURE__ */ jsx(Box, { className: "w-10 h-1 rounded-full bg-border" })
5570
+ }
5570
5571
  ),
5571
- style: dragY > 0 ? {
5572
- transform: `translateY(${dragY}px)`,
5573
- transition: isDragging.current ? "none" : "transform 200ms ease-out"
5574
- } : void 0,
5575
- ...title && { "aria-labelledby": "modal-title" },
5576
- children: [
5577
- /* @__PURE__ */ jsx(
5578
- Box,
5579
- {
5580
- className: "hidden max-sm:flex justify-center py-2 cursor-grab active:cursor-grabbing touch-none",
5581
- onPointerDown: (e) => {
5582
- if (!swipeDownToClose) return;
5583
- dragStartY.current = e.clientY;
5584
- isDragging.current = true;
5585
- e.target.setPointerCapture(e.pointerId);
5586
- },
5587
- onPointerMove: (e) => {
5588
- if (!isDragging.current) return;
5589
- const dy = Math.max(0, e.clientY - dragStartY.current);
5590
- setDragY(dy);
5591
- },
5592
- onPointerUp: () => {
5593
- if (!isDragging.current) return;
5594
- isDragging.current = false;
5595
- if (dragY > 100) {
5596
- handleClose();
5572
+ (title || showCloseButton) && /* @__PURE__ */ jsxs(
5573
+ Box,
5574
+ {
5575
+ className: cn(
5576
+ "px-6 py-4 flex items-center justify-between",
5577
+ "border-b-[length:var(--border-width)] border-border"
5578
+ ),
5579
+ children: [
5580
+ title && /* @__PURE__ */ jsx(Typography, { variant: "h4", as: "h2", id: "modal-title", children: title }),
5581
+ showCloseButton && /* @__PURE__ */ jsx(
5582
+ Button,
5583
+ {
5584
+ variant: "ghost",
5585
+ size: "sm",
5586
+ icon: "x",
5587
+ onClick: handleClose,
5588
+ "data-event": "CLOSE",
5589
+ "aria-label": t("aria.closeModal")
5597
5590
  }
5598
- setDragY(0);
5599
- },
5600
- onPointerCancel: () => {
5601
- isDragging.current = false;
5602
- setDragY(0);
5603
- },
5604
- children: /* @__PURE__ */ jsx(Box, { className: "w-10 h-1 rounded-full bg-border" })
5605
- }
5606
- ),
5607
- (title || showCloseButton) && /* @__PURE__ */ jsxs(
5608
- Box,
5609
- {
5610
- className: cn(
5611
- "px-6 py-4 flex items-center justify-between",
5612
- "border-b-[length:var(--border-width)] border-border"
5613
- ),
5614
- children: [
5615
- title && /* @__PURE__ */ jsx(Typography, { variant: "h4", as: "h2", id: "modal-title", children: title }),
5616
- showCloseButton && /* @__PURE__ */ jsx(
5617
- Button,
5618
- {
5619
- variant: "ghost",
5620
- size: "sm",
5621
- icon: "x",
5622
- onClick: handleClose,
5623
- "data-event": "CLOSE",
5624
- "aria-label": t("aria.closeModal")
5625
- }
5626
- )
5627
- ]
5628
- }
5629
- ),
5630
- /* @__PURE__ */ jsx(Box, { className: "flex-1 overflow-y-auto p-6", children }),
5631
- footer && /* @__PURE__ */ jsx(
5632
- Box,
5633
- {
5634
- className: cn(
5635
- "px-6 py-4 bg-muted",
5636
- "border-t-[length:var(--border-width)] border-border"
5637
- ),
5638
- children: footer
5639
- }
5640
- )
5641
- ]
5642
- }
5643
- )
5644
- }
5645
- )
5646
- ] }),
5591
+ )
5592
+ ]
5593
+ }
5594
+ ),
5595
+ /* @__PURE__ */ jsx(Box, { className: "flex-1 overflow-y-auto p-6", children }),
5596
+ footer && /* @__PURE__ */ jsx(
5597
+ Box,
5598
+ {
5599
+ className: cn(
5600
+ "px-6 py-4 bg-muted",
5601
+ "border-t-[length:var(--border-width)] border-border"
5602
+ ),
5603
+ children: footer
5604
+ }
5605
+ )
5606
+ ]
5607
+ }
5608
+ )
5609
+ }
5610
+ ),
5647
5611
  document.body
5648
5612
  );
5649
5613
  };
5650
5614
  Modal.displayName = "Modal";
5651
5615
  }
5652
5616
  });
5617
+ var Overlay;
5618
+ var init_Overlay = __esm({
5619
+ "components/core/atoms/Overlay.tsx"() {
5620
+ "use client";
5621
+ init_cn();
5622
+ init_useEventBus();
5623
+ Overlay = ({
5624
+ isVisible = true,
5625
+ onClick,
5626
+ className,
5627
+ blur = false,
5628
+ action
5629
+ }) => {
5630
+ const eventBus = useEventBus();
5631
+ if (!isVisible) return null;
5632
+ const handleClick = (e) => {
5633
+ if (action) {
5634
+ eventBus.emit(`UI:${action}`, {});
5635
+ }
5636
+ onClick?.(e);
5637
+ };
5638
+ return /* @__PURE__ */ jsx(
5639
+ "div",
5640
+ {
5641
+ className: cn(
5642
+ "fixed inset-0 z-40",
5643
+ blur && "backdrop-blur-sm",
5644
+ className
5645
+ ),
5646
+ style: { backgroundColor: "rgba(0, 0, 0, 0.6)" },
5647
+ onClick: action || onClick ? handleClick : void 0,
5648
+ "aria-hidden": "true"
5649
+ }
5650
+ );
5651
+ };
5652
+ }
5653
+ });
5653
5654
  var sizeWidths, Drawer;
5654
5655
  var init_Drawer = __esm({
5655
5656
  "components/core/molecules/Drawer.tsx"() {
@@ -5872,7 +5873,7 @@ var init_Badge = __esm({
5872
5873
  md: "px-2.5 py-1 text-sm",
5873
5874
  lg: "px-3 py-1.5 text-base"
5874
5875
  };
5875
- Badge = React95__default.forwardRef(
5876
+ Badge = React93__default.forwardRef(
5876
5877
  ({ className, variant = "default", size = "sm", amount, label, icon, children, onRemove, removeLabel, ...props }, ref) => {
5877
5878
  const iconSizes3 = {
5878
5879
  sm: "h-icon-default w-icon-default",
@@ -6093,18 +6094,22 @@ var init_SvgBranch = __esm({
6093
6094
  "components/core/atoms/svg/SvgBranch.tsx"() {
6094
6095
  "use client";
6095
6096
  SvgBranch = ({
6096
- x,
6097
- y,
6097
+ x = 5,
6098
+ y = 50,
6098
6099
  variant = "fork",
6099
6100
  branches = 2,
6100
6101
  size = 1,
6101
6102
  color = "var(--color-primary)",
6102
6103
  opacity = 1,
6103
- className
6104
+ className,
6105
+ asRoot = true,
6106
+ width = 100,
6107
+ height = 100
6104
6108
  }) => {
6109
+ let inner;
6105
6110
  if (variant === "diamond") {
6106
6111
  const points = buildDiamondPoints(x, y, size);
6107
- return /* @__PURE__ */ jsx("g", { className, opacity, children: /* @__PURE__ */ jsx(
6112
+ inner = /* @__PURE__ */ jsx("g", { className, opacity, children: /* @__PURE__ */ jsx(
6108
6113
  "polygon",
6109
6114
  {
6110
6115
  points,
@@ -6114,23 +6119,28 @@ var init_SvgBranch = __esm({
6114
6119
  strokeLinejoin: "round"
6115
6120
  }
6116
6121
  ) });
6122
+ } else {
6123
+ const paths = variant === "fork" ? buildForkPaths(x, y, branches, size) : buildMergePaths(x, y, branches, size);
6124
+ inner = /* @__PURE__ */ jsxs("g", { className, opacity, children: [
6125
+ paths.map((d, i) => /* @__PURE__ */ jsx(
6126
+ "path",
6127
+ {
6128
+ d,
6129
+ fill: "none",
6130
+ stroke: color,
6131
+ strokeWidth: 2,
6132
+ strokeLinecap: "round"
6133
+ },
6134
+ i
6135
+ )),
6136
+ variant === "fork" && /* @__PURE__ */ jsx("circle", { cx: x + 30 * size, cy: y, r: 3, fill: color }),
6137
+ variant === "merge" && /* @__PURE__ */ jsx("circle", { cx: x + 30 * size, cy: y, r: 3, fill: color })
6138
+ ] });
6117
6139
  }
6118
- const paths = variant === "fork" ? buildForkPaths(x, y, branches, size) : buildMergePaths(x, y, branches, size);
6119
- return /* @__PURE__ */ jsxs("g", { className, opacity, children: [
6120
- paths.map((d, i) => /* @__PURE__ */ jsx(
6121
- "path",
6122
- {
6123
- d,
6124
- fill: "none",
6125
- stroke: color,
6126
- strokeWidth: 2,
6127
- strokeLinecap: "round"
6128
- },
6129
- i
6130
- )),
6131
- variant === "fork" && /* @__PURE__ */ jsx("circle", { cx: x + 30 * size, cy: y, r: 3, fill: color }),
6132
- variant === "merge" && /* @__PURE__ */ jsx("circle", { cx: x + 30 * size, cy: y, r: 3, fill: color })
6133
- ] });
6140
+ if (asRoot) {
6141
+ return /* @__PURE__ */ jsx("svg", { viewBox: `0 0 ${width} ${height}`, width, height, children: inner });
6142
+ }
6143
+ return /* @__PURE__ */ jsx(Fragment, { children: inner });
6134
6144
  };
6135
6145
  SvgBranch.displayName = "SvgBranch";
6136
6146
  }
@@ -6140,20 +6150,23 @@ var init_SvgConnection = __esm({
6140
6150
  "components/core/atoms/svg/SvgConnection.tsx"() {
6141
6151
  "use client";
6142
6152
  SvgConnection = ({
6143
- x1,
6144
- y1,
6145
- x2,
6146
- y2,
6153
+ x1 = 10,
6154
+ y1 = 50,
6155
+ x2 = 90,
6156
+ y2 = 50,
6147
6157
  variant = "solid",
6148
6158
  color = "var(--color-primary)",
6149
6159
  strokeWidth = 1.5,
6150
6160
  opacity = 1,
6151
- className
6161
+ className,
6162
+ asRoot = true,
6163
+ width = 100,
6164
+ height = 100
6152
6165
  }) => {
6153
6166
  const dashProps = variant === "solid" ? {} : {
6154
6167
  strokeDasharray: "8 6"
6155
6168
  };
6156
- return /* @__PURE__ */ jsx(
6169
+ const inner = /* @__PURE__ */ jsx(
6157
6170
  "line",
6158
6171
  {
6159
6172
  className: [
@@ -6171,24 +6184,32 @@ var init_SvgConnection = __esm({
6171
6184
  ...dashProps
6172
6185
  }
6173
6186
  );
6187
+ if (asRoot) {
6188
+ return /* @__PURE__ */ jsx("svg", { viewBox: `0 0 ${width} ${height}`, width, height, children: inner });
6189
+ }
6190
+ return inner;
6174
6191
  };
6175
6192
  SvgConnection.displayName = "SvgConnection";
6176
6193
  }
6177
6194
  });
6178
- var flowIdCounter, SvgFlow;
6195
+ var flowIdCounter, DEFAULT_POINTS, SvgFlow;
6179
6196
  var init_SvgFlow = __esm({
6180
6197
  "components/core/atoms/svg/SvgFlow.tsx"() {
6181
6198
  "use client";
6182
6199
  flowIdCounter = 0;
6200
+ DEFAULT_POINTS = [[10, 50], [50, 20], [90, 50]];
6183
6201
  SvgFlow = ({
6184
- points,
6202
+ points = DEFAULT_POINTS,
6185
6203
  color = "var(--color-primary)",
6186
6204
  strokeWidth = 1.5,
6187
6205
  animated = false,
6188
6206
  opacity = 1,
6189
- className
6207
+ className,
6208
+ asRoot = true,
6209
+ width = 100,
6210
+ height = 100
6190
6211
  }) => {
6191
- const markerId = React95__default.useMemo(() => {
6212
+ const markerId = React93__default.useMemo(() => {
6192
6213
  flowIdCounter += 1;
6193
6214
  return `almadar-flow-arrow-${flowIdCounter}`;
6194
6215
  }, []);
@@ -6196,7 +6217,7 @@ var init_SvgFlow = __esm({
6196
6217
  return null;
6197
6218
  }
6198
6219
  const pathData = points.map((pt, i) => `${i === 0 ? "M" : "L"}${pt[0]},${pt[1]}`).join(" ");
6199
- return /* @__PURE__ */ jsxs("g", { className, opacity, children: [
6220
+ const inner = /* @__PURE__ */ jsxs("g", { className, opacity, children: [
6200
6221
  /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx(
6201
6222
  "marker",
6202
6223
  {
@@ -6225,6 +6246,10 @@ var init_SvgFlow = __esm({
6225
6246
  }
6226
6247
  )
6227
6248
  ] });
6249
+ if (asRoot) {
6250
+ return /* @__PURE__ */ jsx("svg", { viewBox: `0 0 ${width} ${height}`, width, height, children: inner });
6251
+ }
6252
+ return inner;
6228
6253
  };
6229
6254
  SvgFlow.displayName = "SvgFlow";
6230
6255
  }
@@ -6234,8 +6259,8 @@ var init_SvgGrid = __esm({
6234
6259
  "components/core/atoms/svg/SvgGrid.tsx"() {
6235
6260
  "use client";
6236
6261
  SvgGrid = ({
6237
- x,
6238
- y,
6262
+ x = 10,
6263
+ y = 10,
6239
6264
  cols = 4,
6240
6265
  rows: rows2 = 3,
6241
6266
  spacing = 20,
@@ -6243,10 +6268,13 @@ var init_SvgGrid = __esm({
6243
6268
  color = "var(--color-primary)",
6244
6269
  opacity = 1,
6245
6270
  className,
6246
- highlights = []
6271
+ highlights = [],
6272
+ asRoot = true,
6273
+ width = 100,
6274
+ height = 100
6247
6275
  }) => {
6248
6276
  const highlightSet = new Set(highlights);
6249
- return /* @__PURE__ */ jsx("g", { className, opacity, children: Array.from({ length: rows2 }).map(
6277
+ const inner = /* @__PURE__ */ jsx("g", { className, opacity, children: Array.from({ length: rows2 }).map(
6250
6278
  (_, row) => Array.from({ length: cols }).map((_2, col) => {
6251
6279
  const index = row * cols + col;
6252
6280
  const isHighlighted = highlightSet.has(index);
@@ -6265,6 +6293,10 @@ var init_SvgGrid = __esm({
6265
6293
  );
6266
6294
  })
6267
6295
  ) });
6296
+ if (asRoot) {
6297
+ return /* @__PURE__ */ jsx("svg", { viewBox: `0 0 ${width} ${height}`, width, height, children: inner });
6298
+ }
6299
+ return inner;
6268
6300
  };
6269
6301
  SvgGrid.displayName = "SvgGrid";
6270
6302
  }
@@ -6274,15 +6306,18 @@ var init_SvgLobe = __esm({
6274
6306
  "components/core/atoms/svg/SvgLobe.tsx"() {
6275
6307
  "use client";
6276
6308
  SvgLobe = ({
6277
- cx,
6278
- cy,
6309
+ cx = 50,
6310
+ cy = 50,
6279
6311
  rx = 14,
6280
6312
  ry = 20,
6281
6313
  rotation = 0,
6282
6314
  shells = 2,
6283
6315
  color = "var(--color-primary)",
6284
6316
  opacity = 1,
6285
- className
6317
+ className,
6318
+ asRoot = true,
6319
+ width = 100,
6320
+ height = 100
6286
6321
  }) => {
6287
6322
  const clampedShells = Math.max(1, Math.min(3, shells));
6288
6323
  const renderShell = (shellIndex) => {
@@ -6317,7 +6352,7 @@ var init_SvgLobe = __esm({
6317
6352
  )
6318
6353
  ] }, shellIndex);
6319
6354
  };
6320
- return /* @__PURE__ */ jsx(
6355
+ const inner = /* @__PURE__ */ jsx(
6321
6356
  "g",
6322
6357
  {
6323
6358
  className,
@@ -6326,6 +6361,10 @@ var init_SvgLobe = __esm({
6326
6361
  children: Array.from({ length: clampedShells }, (_, i) => renderShell(i))
6327
6362
  }
6328
6363
  );
6364
+ if (asRoot) {
6365
+ return /* @__PURE__ */ jsx("svg", { viewBox: `0 0 ${width} ${height}`, width, height, children: inner });
6366
+ }
6367
+ return inner;
6329
6368
  };
6330
6369
  SvgLobe.displayName = "SvgLobe";
6331
6370
  }
@@ -6354,18 +6393,21 @@ var init_SvgMesh = __esm({
6354
6393
  "components/core/atoms/svg/SvgMesh.tsx"() {
6355
6394
  "use client";
6356
6395
  SvgMesh = ({
6357
- cx,
6358
- cy,
6396
+ cx = 60,
6397
+ cy = 60,
6359
6398
  nodes = 6,
6360
6399
  radius = 50,
6361
6400
  color = "var(--color-primary)",
6362
6401
  connectionDensity = 0.5,
6363
6402
  opacity = 1,
6364
- className
6403
+ className,
6404
+ asRoot = true,
6405
+ width = 120,
6406
+ height = 120
6365
6407
  }) => {
6366
6408
  const positions = getNodePositions(cx, cy, nodes, radius);
6367
6409
  const connections = getConnections(nodes, connectionDensity);
6368
- return /* @__PURE__ */ jsxs("g", { className, opacity, children: [
6410
+ const inner = /* @__PURE__ */ jsxs("g", { className, opacity, children: [
6369
6411
  connections.map(([a, b]) => /* @__PURE__ */ jsx(
6370
6412
  "line",
6371
6413
  {
@@ -6390,6 +6432,10 @@ var init_SvgMesh = __esm({
6390
6432
  i
6391
6433
  ))
6392
6434
  ] });
6435
+ if (asRoot) {
6436
+ return /* @__PURE__ */ jsx("svg", { viewBox: `0 0 ${width} ${height}`, width, height, children: inner });
6437
+ }
6438
+ return inner;
6393
6439
  };
6394
6440
  SvgMesh.displayName = "SvgMesh";
6395
6441
  }
@@ -6531,74 +6577,82 @@ var init_SvgMorph = __esm({
6531
6577
  };
6532
6578
  FlowArrow.displayName = "FlowArrow";
6533
6579
  SvgMorph = ({
6534
- x,
6535
- y,
6580
+ x = 5,
6581
+ y = 10,
6536
6582
  size = 1,
6537
6583
  variant = "generic",
6538
6584
  color = "var(--color-primary)",
6539
6585
  opacity = 1,
6540
- className
6586
+ className,
6587
+ asRoot = true,
6588
+ width = 130,
6589
+ height = 50
6541
6590
  }) => {
6542
6591
  const gap = 40 * size;
6543
6592
  const midY = y + 10 * size;
6593
+ let inner;
6544
6594
  if (variant === "text-to-code") {
6545
6595
  const leftEnd = x + 30 * size;
6546
6596
  const rightStart = leftEnd + gap;
6547
- return /* @__PURE__ */ jsxs("g", { className, opacity, children: [
6597
+ inner = /* @__PURE__ */ jsxs("g", { className, opacity, children: [
6548
6598
  /* @__PURE__ */ jsx(TextLines, { x, y, scale: size, color }),
6549
6599
  /* @__PURE__ */ jsx(FlowArrow, { x1: leftEnd, y: midY, x2: rightStart, scale: size, color }),
6550
6600
  /* @__PURE__ */ jsx(CodeBrackets, { x: rightStart, y, scale: size, color })
6551
6601
  ] });
6552
- }
6553
- if (variant === "code-to-app") {
6602
+ } else if (variant === "code-to-app") {
6554
6603
  const leftEnd = x + 26 * size;
6555
6604
  const rightStart = leftEnd + gap;
6556
- return /* @__PURE__ */ jsxs("g", { className, opacity, children: [
6605
+ inner = /* @__PURE__ */ jsxs("g", { className, opacity, children: [
6557
6606
  /* @__PURE__ */ jsx(CodeBrackets, { x, y, scale: size, color }),
6558
6607
  /* @__PURE__ */ jsx(FlowArrow, { x1: leftEnd, y: midY, x2: rightStart, scale: size, color }),
6559
6608
  /* @__PURE__ */ jsx(AppRect, { x: rightStart, y, scale: size, color })
6560
6609
  ] });
6610
+ } else {
6611
+ const circleR = 10 * size;
6612
+ const circleX = x + circleR;
6613
+ const squareStart = x + circleR * 2 + gap;
6614
+ const squareSize = circleR * 2;
6615
+ inner = /* @__PURE__ */ jsxs("g", { className, opacity, children: [
6616
+ /* @__PURE__ */ jsx(
6617
+ "circle",
6618
+ {
6619
+ cx: circleX,
6620
+ cy: midY,
6621
+ r: circleR,
6622
+ fill: "none",
6623
+ stroke: color,
6624
+ strokeWidth: 2 * size
6625
+ }
6626
+ ),
6627
+ /* @__PURE__ */ jsx(
6628
+ FlowArrow,
6629
+ {
6630
+ x1: circleX + circleR + 2 * size,
6631
+ y: midY,
6632
+ x2: squareStart,
6633
+ scale: size,
6634
+ color
6635
+ }
6636
+ ),
6637
+ /* @__PURE__ */ jsx(
6638
+ "rect",
6639
+ {
6640
+ x: squareStart,
6641
+ y: midY - circleR,
6642
+ width: squareSize,
6643
+ height: squareSize,
6644
+ rx: 3 * size,
6645
+ fill: "none",
6646
+ stroke: color,
6647
+ strokeWidth: 2 * size
6648
+ }
6649
+ )
6650
+ ] });
6561
6651
  }
6562
- const circleR = 10 * size;
6563
- const circleX = x + circleR;
6564
- const squareStart = x + circleR * 2 + gap;
6565
- const squareSize = circleR * 2;
6566
- return /* @__PURE__ */ jsxs("g", { className, opacity, children: [
6567
- /* @__PURE__ */ jsx(
6568
- "circle",
6569
- {
6570
- cx: circleX,
6571
- cy: midY,
6572
- r: circleR,
6573
- fill: "none",
6574
- stroke: color,
6575
- strokeWidth: 2 * size
6576
- }
6577
- ),
6578
- /* @__PURE__ */ jsx(
6579
- FlowArrow,
6580
- {
6581
- x1: circleX + circleR + 2 * size,
6582
- y: midY,
6583
- x2: squareStart,
6584
- scale: size,
6585
- color
6586
- }
6587
- ),
6588
- /* @__PURE__ */ jsx(
6589
- "rect",
6590
- {
6591
- x: squareStart,
6592
- y: midY - circleR,
6593
- width: squareSize,
6594
- height: squareSize,
6595
- rx: 3 * size,
6596
- fill: "none",
6597
- stroke: color,
6598
- strokeWidth: 2 * size
6599
- }
6600
- )
6601
- ] });
6652
+ if (asRoot) {
6653
+ return /* @__PURE__ */ jsx("svg", { viewBox: `0 0 ${width} ${height}`, width, height, children: inner });
6654
+ }
6655
+ return /* @__PURE__ */ jsx(Fragment, { children: inner });
6602
6656
  };
6603
6657
  SvgMorph.displayName = "SvgMorph";
6604
6658
  }
@@ -6608,16 +6662,19 @@ var init_SvgNode = __esm({
6608
6662
  "components/core/atoms/svg/SvgNode.tsx"() {
6609
6663
  "use client";
6610
6664
  SvgNode = ({
6611
- x,
6612
- y,
6665
+ x = 50,
6666
+ y = 50,
6613
6667
  r: r2 = 6,
6614
6668
  variant = "filled",
6615
6669
  color = "var(--color-primary)",
6616
6670
  opacity = 1,
6617
6671
  className,
6618
- label
6672
+ label,
6673
+ asRoot = true,
6674
+ width = 100,
6675
+ height = 100
6619
6676
  }) => {
6620
- return /* @__PURE__ */ jsxs("g", { className, opacity, children: [
6677
+ const inner = /* @__PURE__ */ jsxs("g", { className, opacity, children: [
6621
6678
  variant === "pulse" && /* @__PURE__ */ jsx(
6622
6679
  "circle",
6623
6680
  {
@@ -6655,6 +6712,10 @@ var init_SvgNode = __esm({
6655
6712
  }
6656
6713
  )
6657
6714
  ] });
6715
+ if (asRoot) {
6716
+ return /* @__PURE__ */ jsx("svg", { viewBox: `0 0 ${width} ${height}`, width, height, children: inner });
6717
+ }
6718
+ return inner;
6658
6719
  };
6659
6720
  SvgNode.displayName = "SvgNode";
6660
6721
  }
@@ -6676,16 +6737,19 @@ var init_SvgPulse = __esm({
6676
6737
  }
6677
6738
  `;
6678
6739
  SvgPulse = ({
6679
- cx,
6680
- cy,
6740
+ cx = 70,
6741
+ cy = 70,
6681
6742
  rings = 3,
6682
6743
  maxRadius = 60,
6683
6744
  color = "var(--color-primary)",
6684
6745
  animated = true,
6685
6746
  opacity = 1,
6686
- className
6747
+ className,
6748
+ asRoot = true,
6749
+ width = 140,
6750
+ height = 140
6687
6751
  }) => {
6688
- return /* @__PURE__ */ jsxs("g", { className, opacity, children: [
6752
+ const inner = /* @__PURE__ */ jsxs("g", { className, opacity, children: [
6689
6753
  animated && /* @__PURE__ */ jsx("style", { children: PULSE_KEYFRAMES }),
6690
6754
  Array.from({ length: rings }).map((_, i) => {
6691
6755
  const ringRadius = (i + 1) / rings * maxRadius;
@@ -6711,6 +6775,10 @@ var init_SvgPulse = __esm({
6711
6775
  }),
6712
6776
  /* @__PURE__ */ jsx("circle", { cx, cy, r: 3, fill: color })
6713
6777
  ] });
6778
+ if (asRoot) {
6779
+ return /* @__PURE__ */ jsx("svg", { viewBox: `0 0 ${width} ${height}`, width, height, children: inner });
6780
+ }
6781
+ return inner;
6714
6782
  };
6715
6783
  SvgPulse.displayName = "SvgPulse";
6716
6784
  }
@@ -6721,21 +6789,24 @@ var init_SvgRing = __esm({
6721
6789
  "use client";
6722
6790
  ringIdCounter = 0;
6723
6791
  SvgRing = ({
6724
- cx,
6725
- cy,
6792
+ cx = 50,
6793
+ cy = 50,
6726
6794
  r: r2 = 40,
6727
6795
  variant = "solid",
6728
6796
  color = "var(--color-primary)",
6729
6797
  strokeWidth = 1.5,
6730
6798
  opacity = 1,
6731
6799
  className,
6732
- label
6800
+ label,
6801
+ asRoot = true,
6802
+ width = 100,
6803
+ height = 100
6733
6804
  }) => {
6734
- const gradientId = React95__default.useMemo(() => {
6805
+ const gradientId = React93__default.useMemo(() => {
6735
6806
  ringIdCounter += 1;
6736
6807
  return `almadar-ring-glow-${ringIdCounter}`;
6737
6808
  }, []);
6738
- return /* @__PURE__ */ jsxs("g", { className, opacity, children: [
6809
+ const inner = /* @__PURE__ */ jsxs("g", { className, opacity, children: [
6739
6810
  variant === "glow" && /* @__PURE__ */ jsxs(Fragment, { children: [
6740
6811
  /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs("radialGradient", { id: gradientId, cx: "50%", cy: "50%", r: "50%", children: [
6741
6812
  /* @__PURE__ */ jsx("stop", { offset: "0%", stopColor: color, stopOpacity: 0.15 }),
@@ -6768,6 +6839,10 @@ var init_SvgRing = __esm({
6768
6839
  }
6769
6840
  )
6770
6841
  ] });
6842
+ if (asRoot) {
6843
+ return /* @__PURE__ */ jsx("svg", { viewBox: `0 0 ${width} ${height}`, width, height, children: inner });
6844
+ }
6845
+ return inner;
6771
6846
  };
6772
6847
  SvgRing.displayName = "SvgRing";
6773
6848
  }
@@ -6779,15 +6854,18 @@ var init_SvgShield = __esm({
6779
6854
  SHIELD_PATH = "M15,2 C15,2 5,5 2,6 C2,6 2,18 5,24 C8,30 15,34 15,34 C15,34 22,30 25,24 C28,18 28,6 28,6 C25,5 15,2 15,2 Z";
6780
6855
  CHECK_PATH = "M10,18 L14,22 L21,13";
6781
6856
  SvgShield = ({
6782
- x,
6783
- y,
6857
+ x = 50,
6858
+ y = 50,
6784
6859
  size = 1,
6785
6860
  variant = "outline",
6786
6861
  color = "var(--color-primary)",
6787
6862
  opacity = 1,
6788
- className
6863
+ className,
6864
+ asRoot = true,
6865
+ width = 100,
6866
+ height = 100
6789
6867
  }) => {
6790
- return /* @__PURE__ */ jsxs(
6868
+ const inner = /* @__PURE__ */ jsxs(
6791
6869
  "g",
6792
6870
  {
6793
6871
  className,
@@ -6818,6 +6896,10 @@ var init_SvgShield = __esm({
6818
6896
  ]
6819
6897
  }
6820
6898
  );
6899
+ if (asRoot) {
6900
+ return /* @__PURE__ */ jsx("svg", { viewBox: `0 0 ${width} ${height}`, width, height, children: inner });
6901
+ }
6902
+ return inner;
6821
6903
  };
6822
6904
  SvgShield.displayName = "SvgShield";
6823
6905
  }
@@ -6827,20 +6909,23 @@ var init_SvgStack = __esm({
6827
6909
  "components/core/atoms/svg/SvgStack.tsx"() {
6828
6910
  "use client";
6829
6911
  SvgStack = ({
6830
- x,
6831
- y,
6912
+ x = 10,
6913
+ y = 40,
6832
6914
  layers: rawLayers = 3,
6833
6915
  width = 60,
6834
6916
  height = 40,
6835
6917
  color = "var(--color-primary)",
6836
6918
  opacity = 1,
6837
6919
  className,
6838
- labels
6920
+ labels,
6921
+ asRoot = true,
6922
+ svgWidth = 90,
6923
+ svgHeight = 80
6839
6924
  }) => {
6840
6925
  const layers = Math.max(2, Math.min(4, rawLayers));
6841
6926
  const verticalOffset = 8;
6842
6927
  const horizontalOffset = 4;
6843
- return /* @__PURE__ */ jsx("g", { className, opacity, children: Array.from({ length: layers }).map((_, i) => {
6928
+ const inner = /* @__PURE__ */ jsx("g", { className, opacity, children: Array.from({ length: layers }).map((_, i) => {
6844
6929
  const layerIndex = layers - 1 - i;
6845
6930
  const layerX = x + layerIndex * horizontalOffset;
6846
6931
  const layerY = y - layerIndex * verticalOffset;
@@ -6878,6 +6963,10 @@ var init_SvgStack = __esm({
6878
6963
  )
6879
6964
  ] }, layerIndex);
6880
6965
  }) });
6966
+ if (asRoot) {
6967
+ return /* @__PURE__ */ jsx("svg", { viewBox: `0 0 ${svgWidth} ${svgHeight}`, width: svgWidth, height: svgHeight, children: inner });
6968
+ }
6969
+ return inner;
6881
6970
  };
6882
6971
  SvgStack.displayName = "SvgStack";
6883
6972
  }
@@ -6893,7 +6982,7 @@ var init_Input = __esm({
6893
6982
  "components/core/atoms/Input.tsx"() {
6894
6983
  init_cn();
6895
6984
  init_Icon();
6896
- Input = React95__default.forwardRef(
6985
+ Input = React93__default.forwardRef(
6897
6986
  ({
6898
6987
  className,
6899
6988
  inputType,
@@ -7014,7 +7103,7 @@ var Label;
7014
7103
  var init_Label = __esm({
7015
7104
  "components/core/atoms/Label.tsx"() {
7016
7105
  init_cn();
7017
- Label = React95__default.forwardRef(
7106
+ Label = React93__default.forwardRef(
7018
7107
  ({ className, required, children, ...props }, ref) => {
7019
7108
  return /* @__PURE__ */ jsxs(
7020
7109
  "label",
@@ -7040,7 +7129,7 @@ var Textarea;
7040
7129
  var init_Textarea = __esm({
7041
7130
  "components/core/atoms/Textarea.tsx"() {
7042
7131
  init_cn();
7043
- Textarea = React95__default.forwardRef(
7132
+ Textarea = React93__default.forwardRef(
7044
7133
  ({ className, error, ...props }, ref) => {
7045
7134
  return /* @__PURE__ */ jsx(
7046
7135
  "textarea",
@@ -7070,7 +7159,7 @@ var init_Select = __esm({
7070
7159
  "components/core/atoms/Select.tsx"() {
7071
7160
  init_cn();
7072
7161
  init_Icon();
7073
- Select = React95__default.forwardRef(
7162
+ Select = React93__default.forwardRef(
7074
7163
  ({ className, options, placeholder, error, ...props }, ref) => {
7075
7164
  return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
7076
7165
  /* @__PURE__ */ jsxs(
@@ -7112,7 +7201,7 @@ var Checkbox;
7112
7201
  var init_Checkbox = __esm({
7113
7202
  "components/core/atoms/Checkbox.tsx"() {
7114
7203
  init_cn();
7115
- Checkbox = React95__default.forwardRef(
7204
+ Checkbox = React93__default.forwardRef(
7116
7205
  ({ className, label, id, ...props }, ref) => {
7117
7206
  const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
7118
7207
  return /* @__PURE__ */ jsxs("div", { className: "flex items-center", children: [
@@ -7203,7 +7292,7 @@ var init_Card = __esm({
7203
7292
  chip: "shadow-none rounded-pill border-[length:var(--border-width)] border-border",
7204
7293
  "tile-image-first": "p-0 overflow-hidden"
7205
7294
  };
7206
- Card = React95__default.forwardRef(
7295
+ Card = React93__default.forwardRef(
7207
7296
  ({
7208
7297
  className,
7209
7298
  variant = "bordered",
@@ -7241,9 +7330,9 @@ var init_Card = __esm({
7241
7330
  }
7242
7331
  );
7243
7332
  Card.displayName = "Card";
7244
- CardHeader = React95__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
7333
+ CardHeader = React93__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
7245
7334
  CardHeader.displayName = "CardHeader";
7246
- CardTitle = React95__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
7335
+ CardTitle = React93__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
7247
7336
  "h3",
7248
7337
  {
7249
7338
  ref,
@@ -7256,11 +7345,11 @@ var init_Card = __esm({
7256
7345
  }
7257
7346
  ));
7258
7347
  CardTitle.displayName = "CardTitle";
7259
- CardContent = React95__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
7348
+ CardContent = React93__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
7260
7349
  CardContent.displayName = "CardContent";
7261
7350
  CardBody = CardContent;
7262
7351
  CardBody.displayName = "CardBody";
7263
- CardFooter = React95__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
7352
+ CardFooter = React93__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
7264
7353
  "div",
7265
7354
  {
7266
7355
  ref,
@@ -7315,7 +7404,7 @@ var init_FilterPill = __esm({
7315
7404
  md: "w-3.5 h-3.5",
7316
7405
  lg: "w-4 h-4"
7317
7406
  };
7318
- FilterPill = React95__default.forwardRef(
7407
+ FilterPill = React93__default.forwardRef(
7319
7408
  ({
7320
7409
  className,
7321
7410
  variant = "default",
@@ -7392,7 +7481,7 @@ var init_Spinner = __esm({
7392
7481
  md: "h-6 w-6",
7393
7482
  lg: "h-8 w-8"
7394
7483
  };
7395
- Spinner = React95__default.forwardRef(
7484
+ Spinner = React93__default.forwardRef(
7396
7485
  ({ className, size = "md", ...props }, ref) => {
7397
7486
  return /* @__PURE__ */ jsx(
7398
7487
  "div",
@@ -7471,13 +7560,12 @@ var init_Avatar = __esm({
7471
7560
  actionPayload
7472
7561
  }) => {
7473
7562
  const eventBus = useEventBus();
7474
- const [imgFailed, setImgFailed] = React95__default.useState(false);
7475
- React95__default.useEffect(() => {
7563
+ const [imgFailed, setImgFailed] = React93__default.useState(false);
7564
+ React93__default.useEffect(() => {
7476
7565
  setImgFailed(false);
7477
7566
  }, [src]);
7478
7567
  const initials = providedInitials ?? (name ? generateInitials(name) : void 0);
7479
7568
  const IconComponent = typeof iconProp === "string" ? resolveIcon(iconProp) : iconProp;
7480
- const hasImage = !!src && !imgFailed;
7481
7569
  const hasIcon = !!IconComponent;
7482
7570
  const hasInitials = !!initials && !(hasIcon && !providedInitials);
7483
7571
  const getInitialsBackground = () => "bg-primary text-primary-foreground";
@@ -7503,15 +7591,13 @@ var init_Avatar = __esm({
7503
7591
  onClick: isClickable ? handleClick : void 0,
7504
7592
  role: isClickable ? "button" : void 0,
7505
7593
  tabIndex: isClickable ? 0 : void 0,
7506
- children: hasImage ? /* @__PURE__ */ jsx(
7594
+ children: src && !imgFailed ? /* @__PURE__ */ jsx(
7507
7595
  "img",
7508
7596
  {
7509
7597
  src,
7510
7598
  alt: alt || "Avatar",
7511
7599
  className: "w-full h-full object-cover",
7512
- onError: () => {
7513
- setImgFailed(true);
7514
- }
7600
+ onError: () => setImgFailed(true)
7515
7601
  }
7516
7602
  ) : hasInitials ? /* @__PURE__ */ jsx(
7517
7603
  "div",
@@ -7692,6 +7778,7 @@ var init_ProgressBar = __esm({
7692
7778
  primary: "bg-primary",
7693
7779
  success: "bg-success",
7694
7780
  warning: "bg-warning",
7781
+ error: "bg-error",
7695
7782
  danger: "bg-error"
7696
7783
  };
7697
7784
  circularSizeClasses = {
@@ -7716,10 +7803,11 @@ var init_ProgressBar = __esm({
7716
7803
  const effectiveColor = color ?? variant;
7717
7804
  const effectiveShowPercentage = showPercentage || showLabel;
7718
7805
  if (progressType === "linear") {
7806
+ const showHeader = label || effectiveShowPercentage;
7719
7807
  return /* @__PURE__ */ jsxs("div", { className: cn("w-full", className), children: [
7720
- label && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-1.5", children: [
7721
- /* @__PURE__ */ jsx("span", { className: "text-sm font-bold text-foreground", children: label }),
7722
- effectiveShowPercentage && /* @__PURE__ */ jsxs("span", { className: "text-sm text-foreground font-medium", children: [
7808
+ showHeader && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-1.5", children: [
7809
+ label && /* @__PURE__ */ jsx("span", { className: "text-sm font-bold text-foreground", children: label }),
7810
+ effectiveShowPercentage && /* @__PURE__ */ jsxs("span", { className: cn("text-sm text-foreground font-medium", !label && "ml-auto"), children: [
7723
7811
  Math.round(percentage),
7724
7812
  "%"
7725
7813
  ] })
@@ -7804,10 +7892,11 @@ var init_ProgressBar = __esm({
7804
7892
  const stepValue = max / steps;
7805
7893
  const activeSteps = Math.floor(value / stepValue);
7806
7894
  const partialStep = value % stepValue / stepValue;
7895
+ const showStepHeader = label || effectiveShowPercentage;
7807
7896
  return /* @__PURE__ */ jsxs("div", { className: cn("w-full", className), children: [
7808
- label && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-2", children: [
7809
- /* @__PURE__ */ jsx("span", { className: "text-sm font-medium text-foreground", children: label }),
7810
- effectiveShowPercentage && /* @__PURE__ */ jsxs("span", { className: "text-sm text-muted-foreground", children: [
7897
+ showStepHeader && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-2", children: [
7898
+ label && /* @__PURE__ */ jsx("span", { className: "text-sm font-medium text-foreground", children: label }),
7899
+ effectiveShowPercentage && /* @__PURE__ */ jsxs("span", { className: cn("text-sm text-muted-foreground", !label && "ml-auto"), children: [
7811
7900
  Math.round(percentage),
7812
7901
  "%"
7813
7902
  ] })
@@ -7857,7 +7946,7 @@ var init_Radio = __esm({
7857
7946
  md: "w-2.5 h-2.5",
7858
7947
  lg: "w-3 h-3"
7859
7948
  };
7860
- Radio = React95__default.forwardRef(
7949
+ Radio = React93__default.forwardRef(
7861
7950
  ({
7862
7951
  label,
7863
7952
  helperText,
@@ -7874,12 +7963,12 @@ var init_Radio = __esm({
7874
7963
  onChange,
7875
7964
  ...props
7876
7965
  }, ref) => {
7877
- const reactId = React95__default.useId();
7966
+ const reactId = React93__default.useId();
7878
7967
  const baseId = id || `radio-${reactId}`;
7879
7968
  const hasError = !!error;
7880
7969
  const eventBus = useEventBus();
7881
- const [selected, setSelected] = React95__default.useState(value);
7882
- React95__default.useEffect(() => {
7970
+ const [selected, setSelected] = React93__default.useState(value);
7971
+ React93__default.useEffect(() => {
7883
7972
  if (value !== void 0) setSelected(value);
7884
7973
  }, [value]);
7885
7974
  const pick = (next, e) => {
@@ -8061,7 +8150,7 @@ var init_Switch = __esm({
8061
8150
  "components/core/atoms/Switch.tsx"() {
8062
8151
  "use client";
8063
8152
  init_cn();
8064
- Switch = React95.forwardRef(
8153
+ Switch = React93.forwardRef(
8065
8154
  ({
8066
8155
  checked,
8067
8156
  defaultChecked = false,
@@ -8072,10 +8161,10 @@ var init_Switch = __esm({
8072
8161
  name,
8073
8162
  className
8074
8163
  }, ref) => {
8075
- const [isChecked, setIsChecked] = React95.useState(
8164
+ const [isChecked, setIsChecked] = React93.useState(
8076
8165
  checked !== void 0 ? checked : defaultChecked
8077
8166
  );
8078
- React95.useEffect(() => {
8167
+ React93.useEffect(() => {
8079
8168
  if (checked !== void 0) {
8080
8169
  setIsChecked(checked);
8081
8170
  }
@@ -8520,7 +8609,7 @@ var Aside;
8520
8609
  var init_Aside = __esm({
8521
8610
  "components/core/atoms/Aside.tsx"() {
8522
8611
  init_cn();
8523
- Aside = React95__default.forwardRef(
8612
+ Aside = React93__default.forwardRef(
8524
8613
  ({ className, children, ...rest }, ref) => /* @__PURE__ */ jsx("aside", { ref, className: cn(className), ...rest, children })
8525
8614
  );
8526
8615
  Aside.displayName = "Aside";
@@ -8598,8 +8687,8 @@ var init_LawReferenceTooltip = __esm({
8598
8687
  className
8599
8688
  }) => {
8600
8689
  const { t } = useTranslate();
8601
- const [isVisible, setIsVisible] = React95__default.useState(false);
8602
- const timeoutRef = React95__default.useRef(null);
8690
+ const [isVisible, setIsVisible] = React93__default.useState(false);
8691
+ const timeoutRef = React93__default.useRef(null);
8603
8692
  const handleMouseEnter = () => {
8604
8693
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
8605
8694
  timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
@@ -8608,7 +8697,7 @@ var init_LawReferenceTooltip = __esm({
8608
8697
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
8609
8698
  setIsVisible(false);
8610
8699
  };
8611
- React95__default.useEffect(() => {
8700
+ React93__default.useEffect(() => {
8612
8701
  return () => {
8613
8702
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
8614
8703
  };
@@ -8818,7 +8907,7 @@ var init_StatusDot = __esm({
8818
8907
  md: "w-2.5 h-2.5",
8819
8908
  lg: "w-3 h-3"
8820
8909
  };
8821
- StatusDot = React95__default.forwardRef(
8910
+ StatusDot = React93__default.forwardRef(
8822
8911
  ({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
8823
8912
  return /* @__PURE__ */ jsx(
8824
8913
  "span",
@@ -8872,7 +8961,7 @@ var init_TrendIndicator = __esm({
8872
8961
  down: "trending-down",
8873
8962
  flat: "arrow-right"
8874
8963
  };
8875
- TrendIndicator = React95__default.forwardRef(
8964
+ TrendIndicator = React93__default.forwardRef(
8876
8965
  ({
8877
8966
  className,
8878
8967
  value,
@@ -8939,7 +9028,7 @@ var init_RangeSlider = __esm({
8939
9028
  md: "w-4 h-4",
8940
9029
  lg: "w-5 h-5"
8941
9030
  };
8942
- RangeSlider = React95__default.forwardRef(
9031
+ RangeSlider = React93__default.forwardRef(
8943
9032
  ({
8944
9033
  className,
8945
9034
  min = 0,
@@ -9447,7 +9536,7 @@ var init_ContentSection = __esm({
9447
9536
  md: "py-16",
9448
9537
  lg: "py-24"
9449
9538
  };
9450
- ContentSection = React95__default.forwardRef(
9539
+ ContentSection = React93__default.forwardRef(
9451
9540
  ({ children, background = "default", padding = "lg", id, className }, ref) => {
9452
9541
  return /* @__PURE__ */ jsx(
9453
9542
  Box,
@@ -9981,7 +10070,7 @@ var init_AnimatedReveal = __esm({
9981
10070
  "scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
9982
10071
  "none": {}
9983
10072
  };
9984
- AnimatedReveal = React95__default.forwardRef(
10073
+ AnimatedReveal = React93__default.forwardRef(
9985
10074
  ({
9986
10075
  trigger = "scroll",
9987
10076
  animation = "fade-up",
@@ -10141,7 +10230,7 @@ var init_AnimatedGraphic = __esm({
10141
10230
  "components/marketing/atoms/AnimatedGraphic.tsx"() {
10142
10231
  "use client";
10143
10232
  init_cn();
10144
- AnimatedGraphic = React95__default.forwardRef(
10233
+ AnimatedGraphic = React93__default.forwardRef(
10145
10234
  ({
10146
10235
  src,
10147
10236
  svgContent,
@@ -10164,7 +10253,7 @@ var init_AnimatedGraphic = __esm({
10164
10253
  const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
10165
10254
  const resolvedSvg = svgContent ?? fetchedSvg;
10166
10255
  const prevAnimateRef = useRef(animate);
10167
- const setRef = React95__default.useCallback(
10256
+ const setRef = React93__default.useCallback(
10168
10257
  (node) => {
10169
10258
  containerRef.current = node;
10170
10259
  if (typeof ref === "function") ref(node);
@@ -10389,9 +10478,9 @@ function ScoreDisplay({
10389
10478
  ...rest
10390
10479
  }) {
10391
10480
  const resolvedValue = typeof value === "number" && !Number.isNaN(value) ? value : typeof rest.score === "number" && !Number.isNaN(rest.score) ? rest.score : 0;
10392
- const [displayValue, setDisplayValue] = React95.useState(resolvedValue);
10393
- const [isAnimating, setIsAnimating] = React95.useState(false);
10394
- React95.useEffect(() => {
10481
+ const [displayValue, setDisplayValue] = React93.useState(resolvedValue);
10482
+ const [isAnimating, setIsAnimating] = React93.useState(false);
10483
+ React93.useEffect(() => {
10395
10484
  if (!animated || displayValue === resolvedValue) {
10396
10485
  setDisplayValue(resolvedValue);
10397
10486
  return;
@@ -10461,9 +10550,9 @@ function ControlButton({
10461
10550
  className
10462
10551
  }) {
10463
10552
  const eventBus = useEventBus();
10464
- const [isPressed, setIsPressed] = React95.useState(false);
10553
+ const [isPressed, setIsPressed] = React93.useState(false);
10465
10554
  const actualPressed = pressed ?? isPressed;
10466
- const handlePointerDown = React95.useCallback(
10555
+ const handlePointerDown = React93.useCallback(
10467
10556
  (e) => {
10468
10557
  e.preventDefault();
10469
10558
  if (disabled) return;
@@ -10473,7 +10562,7 @@ function ControlButton({
10473
10562
  },
10474
10563
  [disabled, pressEvent, eventBus, onPress]
10475
10564
  );
10476
- const handlePointerUp = React95.useCallback(
10565
+ const handlePointerUp = React93.useCallback(
10477
10566
  (e) => {
10478
10567
  e.preventDefault();
10479
10568
  if (disabled) return;
@@ -10483,7 +10572,7 @@ function ControlButton({
10483
10572
  },
10484
10573
  [disabled, releaseEvent, eventBus, onRelease]
10485
10574
  );
10486
- const handlePointerLeave = React95.useCallback(
10575
+ const handlePointerLeave = React93.useCallback(
10487
10576
  (e) => {
10488
10577
  if (isPressed) {
10489
10578
  setIsPressed(false);
@@ -10754,7 +10843,7 @@ function ResourceCounter({
10754
10843
  children: [
10755
10844
  icon && /* @__PURE__ */ jsx("span", { className: cn("flex-shrink-0", sizes.icon), children: icon }),
10756
10845
  /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: label }),
10757
- /* @__PURE__ */ jsxs("span", { className: cn("font-bold tabular-nums", color), children: [
10846
+ /* @__PURE__ */ jsxs("span", { className: cn("font-bold tabular-nums", color && (color in colorTokenClasses2 ? colorTokenClasses2[color] : color)), children: [
10758
10847
  value,
10759
10848
  max != null && /* @__PURE__ */ jsxs("span", { className: "text-muted-foreground", children: [
10760
10849
  "/",
@@ -10765,10 +10854,18 @@ function ResourceCounter({
10765
10854
  }
10766
10855
  );
10767
10856
  }
10768
- var sizeMap5;
10857
+ var colorTokenClasses2, sizeMap5;
10769
10858
  var init_ResourceCounter = __esm({
10770
10859
  "components/game/atoms/ResourceCounter.tsx"() {
10771
10860
  init_cn();
10861
+ colorTokenClasses2 = {
10862
+ primary: "text-primary",
10863
+ secondary: "text-secondary",
10864
+ success: "text-success",
10865
+ warning: "text-warning",
10866
+ error: "text-error",
10867
+ muted: "text-muted-foreground"
10868
+ };
10772
10869
  sizeMap5 = {
10773
10870
  sm: { wrapper: "text-xs gap-1 px-1.5 py-0.5", icon: "text-sm" },
10774
10871
  md: { wrapper: "text-sm gap-1.5 px-2 py-1", icon: "text-base" },
@@ -10972,14 +11069,20 @@ function XPBar({
10972
11069
  }) {
10973
11070
  const sizes = sizeMap9[size];
10974
11071
  const percentage = max > 0 ? Math.max(0, Math.min(100, current / max * 100)) : 0;
10975
- const [fillWidth, setFillWidth] = React95.useState(animated ? 0 : percentage);
10976
- React95.useEffect(() => {
11072
+ const [fillWidth, setFillWidth] = React93.useState(animated ? 0 : percentage);
11073
+ React93.useEffect(() => {
10977
11074
  if (!animated) {
10978
11075
  setFillWidth(percentage);
10979
11076
  return;
10980
11077
  }
10981
- const frame = requestAnimationFrame(() => setFillWidth(percentage));
10982
- return () => cancelAnimationFrame(frame);
11078
+ let frame2;
11079
+ const frame1 = requestAnimationFrame(() => {
11080
+ frame2 = requestAnimationFrame(() => setFillWidth(percentage));
11081
+ });
11082
+ return () => {
11083
+ cancelAnimationFrame(frame1);
11084
+ cancelAnimationFrame(frame2);
11085
+ };
10983
11086
  }, [animated, percentage]);
10984
11087
  return /* @__PURE__ */ jsxs("div", { className: cn("flex items-center gap-2", className), children: [
10985
11088
  level != null && /* @__PURE__ */ jsxs(
@@ -11017,7 +11120,7 @@ function XPBar({
11017
11120
  )
11018
11121
  }
11019
11122
  ),
11020
- showLabel && /* @__PURE__ */ jsxs("span", { className: cn("text-muted-foreground tabular-nums", sizes.text), children: [
11123
+ showLabel && /* @__PURE__ */ jsxs("span", { className: cn("text-foreground/70 tabular-nums", sizes.text), children: [
11021
11124
  current,
11022
11125
  " / ",
11023
11126
  max,
@@ -11135,7 +11238,7 @@ function StatusEffect({
11135
11238
  ),
11136
11239
  title: label,
11137
11240
  children: [
11138
- /* @__PURE__ */ jsx("span", { className: cn("flex items-center justify-center", sizes.icon), children: icon }),
11241
+ /* @__PURE__ */ jsx("span", { className: cn("flex items-center justify-center", sizes.icon), children: /* @__PURE__ */ jsx(Icon, { name: icon, size: "sm" }) }),
11139
11242
  duration !== void 0 && /* @__PURE__ */ jsx(
11140
11243
  "span",
11141
11244
  {
@@ -11166,6 +11269,7 @@ var sizeMap11, variantStyles7;
11166
11269
  var init_StatusEffect = __esm({
11167
11270
  "components/game/atoms/StatusEffect.tsx"() {
11168
11271
  init_cn();
11272
+ init_Icon();
11169
11273
  sizeMap11 = {
11170
11274
  sm: { container: "w-8 h-8", icon: "text-sm", badge: "text-xs -top-1 -right-1 w-4 h-4", timer: "text-[9px]" },
11171
11275
  md: { container: "w-10 h-10", icon: "text-base", badge: "text-xs -top-1 -right-1 w-5 h-5", timer: "text-xs" },
@@ -11399,9 +11503,9 @@ function MiniMap({
11399
11503
  viewportRect,
11400
11504
  className
11401
11505
  }) {
11402
- const canvasRef = React95.useRef(null);
11403
- const frameRef = React95.useRef(0);
11404
- React95.useEffect(() => {
11506
+ const canvasRef = React93.useRef(null);
11507
+ const frameRef = React93.useRef(0);
11508
+ React93.useEffect(() => {
11405
11509
  const canvas = canvasRef.current;
11406
11510
  if (!canvas) return;
11407
11511
  const ctx = canvas.getContext("2d");
@@ -11575,7 +11679,7 @@ var init_ErrorBoundary = __esm({
11575
11679
  }
11576
11680
  );
11577
11681
  };
11578
- ErrorBoundary = class extends React95__default.Component {
11682
+ ErrorBoundary = class extends React93__default.Component {
11579
11683
  constructor(props) {
11580
11684
  super(props);
11581
11685
  __publicField(this, "reset", () => {
@@ -12654,7 +12758,7 @@ var init_Tooltip = __esm({
12654
12758
  setIsVisible(false);
12655
12759
  }, hideDelay);
12656
12760
  };
12657
- useEffect(() => {
12761
+ useLayoutEffect(() => {
12658
12762
  if (isVisible) {
12659
12763
  updatePosition();
12660
12764
  }
@@ -12665,8 +12769,8 @@ var init_Tooltip = __esm({
12665
12769
  if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
12666
12770
  };
12667
12771
  }, []);
12668
- const triggerElement = React95__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
12669
- const trigger = React95__default.cloneElement(triggerElement, {
12772
+ const triggerElement = React93__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
12773
+ const trigger = React93__default.cloneElement(triggerElement, {
12670
12774
  ref: triggerRef,
12671
12775
  onMouseEnter: handleMouseEnter,
12672
12776
  onMouseLeave: handleMouseLeave,
@@ -12813,8 +12917,8 @@ var init_Popover = __esm({
12813
12917
  onMouseEnter: handleOpen,
12814
12918
  onMouseLeave: handleClose
12815
12919
  };
12816
- const childElement = React95__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
12817
- const triggerElement = React95__default.cloneElement(
12920
+ const childElement = React93__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
12921
+ const triggerElement = React93__default.cloneElement(
12818
12922
  childElement,
12819
12923
  {
12820
12924
  ref: triggerRef,
@@ -12830,7 +12934,10 @@ var init_Popover = __esm({
12830
12934
  "bg-card border-2 border-border shadow-elevation-popover",
12831
12935
  className
12832
12936
  ),
12833
- style: computePopoverStyle(position, triggerRect, popoverWidth),
12937
+ style: {
12938
+ ...computePopoverStyle(position, triggerRect, popoverWidth),
12939
+ ...popoverWidth === 0 ? { visibility: "hidden" } : void 0
12940
+ },
12834
12941
  role: "dialog",
12835
12942
  onMouseEnter: trigger === "hover" ? handleOpen : void 0,
12836
12943
  onMouseLeave: trigger === "hover" ? handleClose : void 0,
@@ -12940,8 +13047,8 @@ var init_Menu = __esm({
12940
13047
  };
12941
13048
  const effectivePosition = direction === "rtl" ? rtlMirror[position] ?? position : position;
12942
13049
  const subMenuSideClass = direction === "rtl" ? "right-full mr-2" : "left-full ml-2";
12943
- const triggerChild = React95__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
12944
- const triggerElement = React95__default.cloneElement(
13050
+ const triggerChild = React93__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
13051
+ const triggerElement = React93__default.cloneElement(
12945
13052
  triggerChild,
12946
13053
  {
12947
13054
  ref: triggerRef,
@@ -13348,7 +13455,7 @@ var init_MapView = __esm({
13348
13455
  shadowSize: [41, 41]
13349
13456
  });
13350
13457
  L.Marker.prototype.options.icon = defaultIcon;
13351
- const { useEffect: useEffect76, useRef: useRef68, useCallback: useCallback120, useState: useState112 } = React95__default;
13458
+ const { useEffect: useEffect76, useRef: useRef68, useCallback: useCallback118, useState: useState110 } = React93__default;
13352
13459
  const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
13353
13460
  const { useEventBus: useEventBus3 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
13354
13461
  function MapUpdater({ centerLat, centerLng, zoom }) {
@@ -13393,8 +13500,8 @@ var init_MapView = __esm({
13393
13500
  showAttribution = true
13394
13501
  }) {
13395
13502
  const eventBus = useEventBus3();
13396
- const [clickedPosition, setClickedPosition] = useState112(null);
13397
- const handleMapClick = useCallback120((lat, lng) => {
13503
+ const [clickedPosition, setClickedPosition] = useState110(null);
13504
+ const handleMapClick = useCallback118((lat, lng) => {
13398
13505
  if (showClickedPin) {
13399
13506
  setClickedPosition({ lat, lng });
13400
13507
  }
@@ -13403,7 +13510,7 @@ var init_MapView = __esm({
13403
13510
  eventBus.emit(`UI:${mapClickEvent}`, { latitude: lat, longitude: lng });
13404
13511
  }
13405
13512
  }, [onMapClick, mapClickEvent, eventBus, showClickedPin]);
13406
- const handleMarkerClick = useCallback120((marker) => {
13513
+ const handleMarkerClick = useCallback118((marker) => {
13407
13514
  onMarkerClick?.(marker);
13408
13515
  if (markerClickEvent) {
13409
13516
  eventBus.emit(`UI:${markerClickEvent}`, { ...marker });
@@ -13412,7 +13519,7 @@ var init_MapView = __esm({
13412
13519
  return /* @__PURE__ */ jsx(
13413
13520
  Box,
13414
13521
  {
13415
- className: cn("relative isolate w-full overflow-hidden rounded-lg", className),
13522
+ className: cn("relative isolate z-0 w-full overflow-hidden rounded-lg", className),
13416
13523
  style: { height },
13417
13524
  "data-testid": "map-view",
13418
13525
  children: /* @__PURE__ */ jsxs(
@@ -13594,7 +13701,7 @@ function InputPattern({
13594
13701
  fieldName
13595
13702
  }) {
13596
13703
  const { emit } = useEventBus();
13597
- const [localValue, setLocalValue] = React95__default.useState(value);
13704
+ const [localValue, setLocalValue] = React93__default.useState(value);
13598
13705
  const handleChange = (e) => {
13599
13706
  setLocalValue(e.target.value);
13600
13707
  if (onChange) {
@@ -13632,7 +13739,7 @@ function TextareaPattern({
13632
13739
  fieldName
13633
13740
  }) {
13634
13741
  const { emit } = useEventBus();
13635
- const [localValue, setLocalValue] = React95__default.useState(value);
13742
+ const [localValue, setLocalValue] = React93__default.useState(value);
13636
13743
  const handleChange = (e) => {
13637
13744
  setLocalValue(e.target.value);
13638
13745
  if (onChange) {
@@ -13664,7 +13771,7 @@ function SelectPattern({
13664
13771
  fieldName
13665
13772
  }) {
13666
13773
  const { emit } = useEventBus();
13667
- const [localValue, setLocalValue] = React95__default.useState(value);
13774
+ const [localValue, setLocalValue] = React93__default.useState(value);
13668
13775
  const handleChange = (e) => {
13669
13776
  setLocalValue(e.target.value);
13670
13777
  if (onChange) {
@@ -13693,7 +13800,7 @@ function CheckboxPattern({
13693
13800
  className
13694
13801
  }) {
13695
13802
  const { emit } = useEventBus();
13696
- const [localChecked, setLocalChecked] = React95__default.useState(checked);
13803
+ const [localChecked, setLocalChecked] = React93__default.useState(checked);
13697
13804
  const handleChange = (e) => {
13698
13805
  setLocalChecked(e.target.checked);
13699
13806
  if (onChange) {
@@ -13925,8 +14032,8 @@ function ActionButtons({
13925
14032
  disabled
13926
14033
  }) {
13927
14034
  const eventBus = useEventBus();
13928
- const [activeButtons, setActiveButtons] = React95.useState(/* @__PURE__ */ new Set());
13929
- const handlePress = React95.useCallback(
14035
+ const [activeButtons, setActiveButtons] = React93.useState(/* @__PURE__ */ new Set());
14036
+ const handlePress = React93.useCallback(
13930
14037
  (id) => {
13931
14038
  setActiveButtons((prev) => new Set(prev).add(id));
13932
14039
  if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
@@ -13934,7 +14041,7 @@ function ActionButtons({
13934
14041
  },
13935
14042
  [actionEvent, eventBus, onAction]
13936
14043
  );
13937
- const handleRelease = React95.useCallback(
14044
+ const handleRelease = React93.useCallback(
13938
14045
  (id) => {
13939
14046
  setActiveButtons((prev) => {
13940
14047
  const next = new Set(prev);
@@ -14224,7 +14331,7 @@ var init_AuthLayout = __esm({
14224
14331
  init_Stack();
14225
14332
  init_Typography();
14226
14333
  AuthLayout = ({
14227
- appName = "{{APP_TITLE}}",
14334
+ appName = "My App",
14228
14335
  logo,
14229
14336
  backgroundImage,
14230
14337
  showBranding = true,
@@ -16098,6 +16205,263 @@ var init_katex_min = __esm({
16098
16205
  "node_modules/katex/dist/katex.min.css"() {
16099
16206
  }
16100
16207
  });
16208
+ var Tabs;
16209
+ var init_Tabs = __esm({
16210
+ "components/core/molecules/Tabs.tsx"() {
16211
+ "use client";
16212
+ init_Icon();
16213
+ init_Badge();
16214
+ init_Typography();
16215
+ init_Box();
16216
+ init_cn();
16217
+ init_useEventBus();
16218
+ Tabs = ({
16219
+ items,
16220
+ tabs,
16221
+ defaultActiveTab,
16222
+ activeTab: controlledActiveTab,
16223
+ onTabChange,
16224
+ tabChangeEvent,
16225
+ variant = "default",
16226
+ orientation = "horizontal",
16227
+ className
16228
+ }) => {
16229
+ const rawItems = items ?? tabs ?? [];
16230
+ const safeItems = rawItems.map(({ id, value, ...rest }) => ({
16231
+ ...rest,
16232
+ id: id || value || ""
16233
+ }));
16234
+ const eventBus = useEventBus();
16235
+ const { t } = useTranslate();
16236
+ const initialActive = safeItems.find((item) => item.active)?.id;
16237
+ const [internalActiveTab, setInternalActiveTab] = useState(
16238
+ defaultActiveTab || initialActive || safeItems[0]?.id || ""
16239
+ );
16240
+ const activeTab = controlledActiveTab !== void 0 ? controlledActiveTab : internalActiveTab;
16241
+ const tabRefs = useRef({});
16242
+ const handleTabChange = (tabId, tabEvent) => {
16243
+ if (controlledActiveTab === void 0) {
16244
+ setInternalActiveTab(tabId);
16245
+ }
16246
+ onTabChange?.(tabId);
16247
+ if (tabChangeEvent) {
16248
+ eventBus.emit(`UI:${tabChangeEvent}`, { tabId });
16249
+ }
16250
+ if (tabEvent) {
16251
+ eventBus.emit(`UI:${tabEvent}`, { tabId });
16252
+ }
16253
+ };
16254
+ const handleKeyDown = (e, index) => {
16255
+ if (e.key === "ArrowLeft" || e.key === "ArrowRight") {
16256
+ e.preventDefault();
16257
+ const direction = e.key === "ArrowLeft" ? -1 : 1;
16258
+ const nextIndex = (index + direction + safeItems.length) % safeItems.length;
16259
+ const nextTab = safeItems[nextIndex];
16260
+ if (nextTab && !nextTab.disabled) {
16261
+ handleTabChange(nextTab.id);
16262
+ tabRefs.current[nextTab.id]?.focus();
16263
+ }
16264
+ } else if (e.key === "Home" || e.key === "End") {
16265
+ e.preventDefault();
16266
+ const targetIndex = e.key === "Home" ? 0 : safeItems.length - 1;
16267
+ const targetTab = safeItems[targetIndex];
16268
+ if (targetTab && !targetTab.disabled) {
16269
+ handleTabChange(targetTab.id);
16270
+ tabRefs.current[targetTab.id]?.focus();
16271
+ }
16272
+ }
16273
+ };
16274
+ const activeTabContent = safeItems.find((item) => item.id === activeTab)?.content;
16275
+ if (safeItems.length === 0) {
16276
+ return /* @__PURE__ */ jsx(Box, { className: cn("w-full", className), children: /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", className: "py-4", children: t("empty.noItems") }) });
16277
+ }
16278
+ const variantClasses2 = {
16279
+ default: [
16280
+ "border-b-[length:var(--border-width)] border-transparent",
16281
+ "hover:border-muted-foreground",
16282
+ "data-[active=true]:border-primary"
16283
+ ].join(" "),
16284
+ pills: [
16285
+ "rounded-sm",
16286
+ "data-[active=true]:bg-primary",
16287
+ "data-[active=true]:text-primary-foreground"
16288
+ ].join(" "),
16289
+ underline: [
16290
+ "border-b-[length:var(--border-width)] border-transparent",
16291
+ "data-[active=true]:border-primary"
16292
+ ].join(" ")
16293
+ };
16294
+ return /* @__PURE__ */ jsxs(Box, { className: cn("w-full", className), children: [
16295
+ /* @__PURE__ */ jsx(
16296
+ Box,
16297
+ {
16298
+ role: "tablist",
16299
+ className: cn(
16300
+ "flex",
16301
+ // Horizontal tab strip becomes a horizontally-scrollable lane
16302
+ // below its container width — phones with many tabs scroll
16303
+ // instead of clipping. `snap-x` snaps to each tab; the
16304
+ // scrollbar is hidden for a cleaner affordance (the swipe
16305
+ // gesture is the discoverability cue).
16306
+ orientation === "horizontal" ? "flex-row border-b-[length:var(--border-width)] border-border overflow-x-auto snap-x snap-mandatory [&::-webkit-scrollbar]:hidden" : "flex-col border-r-[length:var(--border-width)] border-border",
16307
+ variant === "pills" && "gap-1 p-1 bg-muted border-0 rounded-md",
16308
+ variant === "underline" && orientation === "vertical" && "border-b-0"
16309
+ ),
16310
+ children: safeItems.map((item, index) => {
16311
+ const isActive = item.id === activeTab;
16312
+ const isDisabled = item.disabled;
16313
+ return /* @__PURE__ */ jsxs(
16314
+ Box,
16315
+ {
16316
+ as: "button",
16317
+ ref: (el) => {
16318
+ tabRefs.current[item.id] = el;
16319
+ },
16320
+ role: "tab",
16321
+ "aria-selected": isActive,
16322
+ "aria-controls": `tabpanel-${item.id}`,
16323
+ "aria-disabled": isDisabled,
16324
+ onClick: () => !isDisabled && handleTabChange(item.id, item.event),
16325
+ onKeyDown: (e) => handleKeyDown(e, index),
16326
+ "data-active": isActive,
16327
+ className: cn(
16328
+ "flex items-center gap-2 px-4 py-2 text-sm font-medium transition-all whitespace-nowrap",
16329
+ orientation === "horizontal" && "snap-start shrink-0",
16330
+ "focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
16331
+ isDisabled && "opacity-50 cursor-not-allowed",
16332
+ variantClasses2[variant],
16333
+ isActive ? variant === "pills" ? "text-primary-foreground font-bold" : "text-foreground font-bold" : "text-muted-foreground hover:text-foreground"
16334
+ ),
16335
+ children: [
16336
+ item.icon && (typeof item.icon === "string" ? /* @__PURE__ */ jsx(Icon, { name: item.icon, size: "sm" }) : /* @__PURE__ */ jsx(Icon, { icon: item.icon, size: "sm" })),
16337
+ /* @__PURE__ */ jsx(Typography, { variant: "small", weight: isActive ? "semibold" : "normal", className: "!text-inherit", children: item.label }),
16338
+ item.badge !== void 0 && /* @__PURE__ */ jsx(Badge, { variant: "default", size: "sm", children: item.badge })
16339
+ ]
16340
+ },
16341
+ item.id
16342
+ );
16343
+ })
16344
+ }
16345
+ ),
16346
+ activeTabContent !== void 0 && activeTabContent !== null && /* @__PURE__ */ jsx(
16347
+ Box,
16348
+ {
16349
+ role: "tabpanel",
16350
+ id: `tabpanel-${activeTab}`,
16351
+ "aria-labelledby": `tab-${activeTab}`,
16352
+ className: "mt-4",
16353
+ children: activeTabContent
16354
+ }
16355
+ )
16356
+ ] });
16357
+ };
16358
+ Tabs.displayName = "Tabs";
16359
+ }
16360
+ });
16361
+ var ICON_NAME_ALIASES, lookStyles3, EmptyState;
16362
+ var init_EmptyState = __esm({
16363
+ "components/core/molecules/EmptyState.tsx"() {
16364
+ "use client";
16365
+ init_cn();
16366
+ init_atoms2();
16367
+ init_Box();
16368
+ init_Icon();
16369
+ init_Stack();
16370
+ init_Typography();
16371
+ init_useEventBus();
16372
+ ICON_NAME_ALIASES = {
16373
+ check: "check-circle",
16374
+ error: "x-circle",
16375
+ warning: "alert-circle"
16376
+ };
16377
+ lookStyles3 = {
16378
+ "icon-only": "",
16379
+ illustrated: "[&_svg]:w-32 [&_svg]:h-32",
16380
+ "text-only": "[&_svg]:hidden",
16381
+ mascot: "[&_svg]:w-24 [&_svg]:h-24 [&_svg]:rounded-pill"
16382
+ };
16383
+ EmptyState = ({
16384
+ icon,
16385
+ title,
16386
+ message,
16387
+ description,
16388
+ actionLabel,
16389
+ onAction,
16390
+ className,
16391
+ destructive,
16392
+ variant,
16393
+ actionEvent,
16394
+ look = "icon-only"
16395
+ }) => {
16396
+ const eventBus = useEventBus();
16397
+ const { t } = useTranslate();
16398
+ const handleAction = () => {
16399
+ if (actionEvent) eventBus.emit(`UI:${actionEvent}`, {});
16400
+ onAction?.();
16401
+ };
16402
+ const iconName = typeof icon === "string" ? ICON_NAME_ALIASES[icon] ?? icon : void 0;
16403
+ const iconComponent = typeof icon === "function" ? icon : void 0;
16404
+ const hasIcon = Boolean(iconName || iconComponent);
16405
+ const isDestructive = destructive || variant === "error";
16406
+ const isSuccess = variant === "success";
16407
+ const displayText = title || message || t("empty.noItems");
16408
+ return /* @__PURE__ */ jsxs(
16409
+ VStack,
16410
+ {
16411
+ align: "center",
16412
+ className: cn(
16413
+ "justify-center py-12 text-center",
16414
+ lookStyles3[look],
16415
+ className
16416
+ ),
16417
+ children: [
16418
+ hasIcon && /* @__PURE__ */ jsx(
16419
+ Box,
16420
+ {
16421
+ className: cn(
16422
+ "mb-4 rounded-full p-3",
16423
+ isDestructive ? "bg-error/10" : isSuccess ? "bg-success/10" : "bg-muted"
16424
+ ),
16425
+ children: /* @__PURE__ */ jsx(
16426
+ Icon,
16427
+ {
16428
+ ...iconName ? { name: iconName } : { icon: iconComponent },
16429
+ className: cn(
16430
+ "h-8 w-8",
16431
+ isDestructive ? "text-error" : isSuccess ? "text-success" : "text-muted-foreground"
16432
+ )
16433
+ }
16434
+ )
16435
+ }
16436
+ ),
16437
+ /* @__PURE__ */ jsx(
16438
+ Typography,
16439
+ {
16440
+ variant: "h3",
16441
+ className: cn(
16442
+ "text-lg font-medium",
16443
+ isDestructive ? "text-error" : isSuccess ? "text-success" : "text-foreground"
16444
+ ),
16445
+ children: displayText
16446
+ }
16447
+ ),
16448
+ description && /* @__PURE__ */ jsx(Typography, { variant: "small", className: "mt-1 text-muted-foreground max-w-sm", children: description }),
16449
+ actionLabel && (onAction || actionEvent) && /* @__PURE__ */ jsx(
16450
+ Button,
16451
+ {
16452
+ className: "mt-4",
16453
+ variant: isDestructive ? "danger" : "primary",
16454
+ onClick: handleAction,
16455
+ children: actionLabel
16456
+ }
16457
+ )
16458
+ ]
16459
+ }
16460
+ );
16461
+ };
16462
+ EmptyState.displayName = "EmptyState";
16463
+ }
16464
+ });
16101
16465
  function computeFoldRegions(code) {
16102
16466
  const lines = code.split("\n");
16103
16467
  const regions = [];
@@ -16135,9 +16499,32 @@ function computeFoldRegions(code) {
16135
16499
  function toCodeLanguage(value) {
16136
16500
  return value && CODE_LANGUAGE_SET.has(value) ? value : "text";
16137
16501
  }
16138
- var orbStyleOverrides, orbStyle, loloStyleOverrides, loloStyle, log6, CODE_LANGUAGES, CODE_LANGUAGE_SET, LINE_PROPS_FN, HIDDEN_LINE_NUMBERS, CodeBlock;
16502
+ function generateDiff(oldVal, newVal) {
16503
+ const oldLines = oldVal.split("\n");
16504
+ const newLines = newVal.split("\n");
16505
+ const diff = [];
16506
+ const maxLen = Math.max(oldLines.length, newLines.length);
16507
+ for (let i = 0; i < maxLen; i++) {
16508
+ const oldLine = oldLines[i];
16509
+ const newLine = newLines[i];
16510
+ if (oldLine === newLine) {
16511
+ diff.push({ type: "context", content: oldLine ?? "", lineNumber: i + 1 });
16512
+ } else {
16513
+ if (oldLine !== void 0) diff.push({ type: "remove", content: oldLine, lineNumber: i + 1 });
16514
+ if (newLine !== void 0) diff.push({ type: "add", content: newLine, lineNumber: i + 1 });
16515
+ }
16516
+ }
16517
+ return diff;
16518
+ }
16519
+ var orbStyleOverrides, orbStyle, loloStyleOverrides, loloStyle, log6, CODE_LANGUAGES, CODE_LANGUAGE_SET, DIFF_STYLES, LINE_PROPS_FN, HIDDEN_LINE_NUMBERS, CodeBlock;
16139
16520
  var init_CodeBlock = __esm({
16140
16521
  "components/core/molecules/markdown/CodeBlock.tsx"() {
16522
+ init_cn();
16523
+ init_atoms2();
16524
+ init_Tabs();
16525
+ init_LoadingState();
16526
+ init_ErrorState();
16527
+ init_EmptyState();
16141
16528
  init_Box();
16142
16529
  init_Button();
16143
16530
  init_Badge();
@@ -16244,9 +16631,14 @@ var init_CodeBlock = __esm({
16244
16631
  "lolo"
16245
16632
  ];
16246
16633
  CODE_LANGUAGE_SET = new Set(CODE_LANGUAGES);
16634
+ DIFF_STYLES = {
16635
+ add: { bg: "bg-success/10", prefix: "+", text: "text-success" },
16636
+ remove: { bg: "bg-error/10", prefix: "-", text: "text-error" },
16637
+ context: { bg: "", prefix: " ", text: "text-foreground" }
16638
+ };
16247
16639
  LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
16248
16640
  HIDDEN_LINE_NUMBERS = { display: "none" };
16249
- CodeBlock = React95__default.memo(
16641
+ CodeBlock = React93__default.memo(
16250
16642
  ({
16251
16643
  code: rawCode,
16252
16644
  language = "text",
@@ -16257,7 +16649,20 @@ var init_CodeBlock = __esm({
16257
16649
  className,
16258
16650
  editable = false,
16259
16651
  onChange,
16260
- errorLines
16652
+ errorLines,
16653
+ // viewer props
16654
+ title,
16655
+ mode = "code",
16656
+ diff: propDiff,
16657
+ oldValue,
16658
+ newValue,
16659
+ showLineNumbers = false,
16660
+ wordWrap = false,
16661
+ files,
16662
+ actions,
16663
+ isLoading = false,
16664
+ error,
16665
+ showCopy
16261
16666
  }) => {
16262
16667
  const code = typeof rawCode === "string" ? rawCode : String(rawCode ?? "");
16263
16668
  const isOrb = language === "orb";
@@ -16269,6 +16674,20 @@ var init_CodeBlock = __esm({
16269
16674
  const codeRef = useRef(null);
16270
16675
  const savedScrollLeftRef = useRef(0);
16271
16676
  const [copied, setCopied] = useState(false);
16677
+ const [wrap, setWrap] = useState(wordWrap);
16678
+ const [activeFileIndex, setActiveFileIndex] = useState(0);
16679
+ const activeFile = files?.[activeFileIndex];
16680
+ const activeCode = activeFile?.code ?? code;
16681
+ const activeLanguage = activeFile?.language ?? language;
16682
+ const diffLines = useMemo(() => {
16683
+ if (propDiff) return propDiff;
16684
+ if (mode === "diff" && oldValue !== void 0 && newValue !== void 0) {
16685
+ return generateDiff(oldValue, newValue);
16686
+ }
16687
+ return null;
16688
+ }, [propDiff, mode, oldValue, newValue]);
16689
+ const isViewerMode = !!(title || files || showLineNumbers || diffLines || mode === "diff" || actions);
16690
+ const effectiveCopy = showCopy ?? showCopyButton;
16272
16691
  const [editableValue, setEditableValue] = useState(code);
16273
16692
  const [editableTextareaKey, setEditableTextareaKey] = useState(0);
16274
16693
  const lastPropCodeRef = useRef(code);
@@ -16439,13 +16858,13 @@ var init_CodeBlock = __esm({
16439
16858
  }, [language, code]);
16440
16859
  const handleCopy = async () => {
16441
16860
  try {
16442
- await navigator.clipboard.writeText(code);
16861
+ await navigator.clipboard.writeText(activeCode);
16443
16862
  setCopied(true);
16444
- eventBus.emit("UI:COPY_CODE", { language, success: true });
16863
+ eventBus.emit("UI:COPY_CODE", { language: activeLanguage, success: true });
16445
16864
  setTimeout(() => setCopied(false), 2e3);
16446
16865
  } catch (err) {
16447
16866
  log6.error("Failed to copy code", { error: err instanceof Error ? err : String(err) });
16448
- eventBus.emit("UI:COPY_CODE", { language, success: false });
16867
+ eventBus.emit("UI:COPY_CODE", { language: activeLanguage, success: false });
16449
16868
  }
16450
16869
  };
16451
16870
  const handleSelectionCopy = useCallback((e) => {
@@ -16498,11 +16917,134 @@ var init_CodeBlock = __esm({
16498
16917
  }
16499
16918
  });
16500
16919
  }
16501
- const full = code.split("\n").slice(a, endLine + 1).join("\n");
16920
+ const full = activeCode.split("\n").slice(a, endLine + 1).join("\n");
16502
16921
  e.clipboardData.setData("text/plain", full);
16503
16922
  e.preventDefault();
16504
16923
  }, [code]);
16505
- const hasHeader = showLanguageBadge || showCopyButton;
16924
+ if (isLoading) {
16925
+ return /* @__PURE__ */ jsx(LoadingState, { message: t("common.loading"), className });
16926
+ }
16927
+ if (error) {
16928
+ return /* @__PURE__ */ jsx(ErrorState, { title: t("display.codeViewerError"), message: error.message, className });
16929
+ }
16930
+ if (isViewerMode && !activeCode && !diffLines) {
16931
+ return /* @__PURE__ */ jsx(EmptyState, { icon: Code, title: t("display.noCode"), description: "No code to display.", className });
16932
+ }
16933
+ if (isViewerMode) {
16934
+ const tabItems = files?.map((file, idx) => ({
16935
+ id: `file-${idx}`,
16936
+ label: file.label,
16937
+ content: null
16938
+ }));
16939
+ const lines = activeCode.split("\n");
16940
+ return /* @__PURE__ */ jsx(Card, { className: cn("overflow-hidden", className), children: /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column" }, children: [
16941
+ tabItems && tabItems.length > 1 && /* @__PURE__ */ jsx(Box, { className: "border-b border-border", children: /* @__PURE__ */ jsx(
16942
+ Tabs,
16943
+ {
16944
+ tabs: tabItems,
16945
+ activeTab: `file-${activeFileIndex}`,
16946
+ onTabChange: (id) => {
16947
+ const idx = parseInt(id.replace("file-", ""), 10);
16948
+ setActiveFileIndex(idx);
16949
+ }
16950
+ }
16951
+ ) }),
16952
+ /* @__PURE__ */ jsxs(
16953
+ HStack,
16954
+ {
16955
+ gap: "sm",
16956
+ align: "center",
16957
+ justify: "between",
16958
+ className: "px-4 py-2 border-b border-border bg-muted/30",
16959
+ children: [
16960
+ /* @__PURE__ */ jsxs(HStack, { gap: "sm", align: "center", children: [
16961
+ /* @__PURE__ */ jsx(Icon, { icon: mode === "diff" ? FileText : Code, size: "sm", className: "text-muted-foreground" }),
16962
+ title && /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "truncate", children: title }),
16963
+ activeLanguage && activeLanguage !== "text" && /* @__PURE__ */ jsx(Badge, { variant: "default", children: activeLanguage })
16964
+ ] }),
16965
+ /* @__PURE__ */ jsxs(HStack, { gap: "xs", align: "center", children: [
16966
+ /* @__PURE__ */ jsx(
16967
+ Button,
16968
+ {
16969
+ variant: "ghost",
16970
+ size: "sm",
16971
+ icon: WrapText,
16972
+ onClick: () => setWrap(!wrap),
16973
+ className: cn(wrap && "text-primary")
16974
+ }
16975
+ ),
16976
+ effectiveCopy && /* @__PURE__ */ jsx(
16977
+ Button,
16978
+ {
16979
+ variant: "ghost",
16980
+ size: "sm",
16981
+ icon: copied ? Check : Copy,
16982
+ onClick: handleCopy,
16983
+ className: cn(copied && "text-success")
16984
+ }
16985
+ ),
16986
+ actions?.map((action, idx) => /* @__PURE__ */ jsx(
16987
+ Badge,
16988
+ {
16989
+ variant: "default",
16990
+ className: "cursor-pointer hover:opacity-80 transition-opacity",
16991
+ onClick: () => {
16992
+ if (action.event) eventBus.emit(`UI:${action.event}`, {});
16993
+ },
16994
+ children: action.label
16995
+ },
16996
+ idx
16997
+ ))
16998
+ ] })
16999
+ ]
17000
+ }
17001
+ ),
17002
+ /* @__PURE__ */ jsx(Box, { className: "overflow-auto bg-muted/20", style: { maxHeight }, children: diffLines ? /* @__PURE__ */ jsx("div", { style: { display: "flex", flexDirection: "column" }, className: "font-mono text-xs", children: diffLines.map((line, idx) => {
17003
+ const style = DIFF_STYLES[line.type];
17004
+ return /* @__PURE__ */ jsxs(HStack, { gap: "none", align: "start", className: cn(style.bg, "px-4 py-0.5"), children: [
17005
+ showLineNumbers && /* @__PURE__ */ jsx(
17006
+ Typography,
17007
+ {
17008
+ variant: "caption",
17009
+ color: "secondary",
17010
+ className: "w-8 text-right mr-3 select-none tabular-nums flex-shrink-0",
17011
+ children: line.lineNumber ?? ""
17012
+ }
17013
+ ),
17014
+ /* @__PURE__ */ jsxs(
17015
+ Typography,
17016
+ {
17017
+ variant: "caption",
17018
+ className: cn("font-mono flex-1 min-w-0", style.text, wrap ? "whitespace-pre-wrap break-all" : "whitespace-pre"),
17019
+ children: [
17020
+ /* @__PURE__ */ jsx(Box, { as: "span", className: "select-none opacity-50 mr-2", children: style.prefix }),
17021
+ line.content
17022
+ ]
17023
+ }
17024
+ )
17025
+ ] }, idx);
17026
+ }) }) : /* @__PURE__ */ jsx("div", { style: { display: "flex", flexDirection: "column" }, className: "font-mono text-xs", children: lines.map((line, idx) => /* @__PURE__ */ jsxs(HStack, { gap: "none", align: "start", className: "px-4 py-0.5 hover:bg-muted/50", children: [
17027
+ showLineNumbers && /* @__PURE__ */ jsx(
17028
+ Typography,
17029
+ {
17030
+ variant: "caption",
17031
+ color: "secondary",
17032
+ className: "w-8 text-right mr-4 select-none tabular-nums flex-shrink-0",
17033
+ children: idx + 1
17034
+ }
17035
+ ),
17036
+ /* @__PURE__ */ jsx(
17037
+ Typography,
17038
+ {
17039
+ variant: "caption",
17040
+ className: cn("font-mono flex-1 min-w-0", wrap ? "whitespace-pre-wrap break-all" : "whitespace-pre"),
17041
+ children: line || " "
17042
+ }
17043
+ )
17044
+ ] }, idx)) }) })
17045
+ ] }) });
17046
+ }
17047
+ const hasHeader = showLanguageBadge || effectiveCopy;
16506
17048
  return /* @__PURE__ */ jsxs(Box, { className: `relative group ${className || ""}`, style: { display: "flex", flexDirection: "column", height: "100%" }, children: [
16507
17049
  hasHeader && /* @__PURE__ */ jsxs(
16508
17050
  HStack,
@@ -16512,7 +17054,7 @@ var init_CodeBlock = __esm({
16512
17054
  className: "px-3 py-2 bg-[var(--color-card)] rounded-t-lg border-b border-gray-700",
16513
17055
  children: [
16514
17056
  showLanguageBadge && /* @__PURE__ */ jsx(Badge, { variant: "default", size: "sm", children: language }),
16515
- showCopyButton && /* @__PURE__ */ jsx(
17057
+ effectiveCopy && /* @__PURE__ */ jsx(
16516
17058
  Button,
16517
17059
  {
16518
17060
  variant: "ghost",
@@ -16671,7 +17213,7 @@ var init_CodeBlock = __esm({
16671
17213
  )
16672
17214
  ] });
16673
17215
  },
16674
- (prev, next) => prev.language === next.language && prev.code === next.code && prev.showCopyButton === next.showCopyButton && prev.maxHeight === next.maxHeight && prev.foldable === next.foldable && prev.editable === next.editable && prev.onChange === next.onChange && prev.errorLines === next.errorLines
17216
+ (prev, next) => prev.language === next.language && prev.code === next.code && prev.showCopyButton === next.showCopyButton && prev.showCopy === next.showCopy && prev.maxHeight === next.maxHeight && prev.foldable === next.foldable && prev.editable === next.editable && prev.onChange === next.onChange && prev.errorLines === next.errorLines && prev.mode === next.mode && prev.title === next.title && prev.diff === next.diff && prev.files === next.files && prev.actions === next.actions && prev.isLoading === next.isLoading && prev.error === next.error
16675
17217
  );
16676
17218
  CodeBlock.displayName = "CodeBlock";
16677
17219
  }
@@ -16683,8 +17225,8 @@ var init_MarkdownContent = __esm({
16683
17225
  init_Box();
16684
17226
  init_CodeBlock();
16685
17227
  init_cn();
16686
- MarkdownContent = React95__default.memo(
16687
- ({ content, direction, className }) => {
17228
+ MarkdownContent = React93__default.memo(
17229
+ ({ content, direction = "ltr", className }) => {
16688
17230
  const { t: _t } = useTranslate();
16689
17231
  const safeContent = typeof content === "string" ? content : String(content ?? "");
16690
17232
  return /* @__PURE__ */ jsx(
@@ -17779,7 +18321,7 @@ var init_StateMachineView = __esm({
17779
18321
  style: { top: title ? 30 : 0 },
17780
18322
  children: [
17781
18323
  entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
17782
- states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React95__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
18324
+ states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React93__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
17783
18325
  StateNode,
17784
18326
  {
17785
18327
  state,
@@ -18928,110 +19470,6 @@ var init_BookTableOfContents = __esm({
18928
19470
  BookTableOfContents.displayName = "BookTableOfContents";
18929
19471
  }
18930
19472
  });
18931
- var ICON_NAME_ALIASES, lookStyles3, EmptyState;
18932
- var init_EmptyState = __esm({
18933
- "components/core/molecules/EmptyState.tsx"() {
18934
- "use client";
18935
- init_cn();
18936
- init_atoms2();
18937
- init_Box();
18938
- init_Icon();
18939
- init_Stack();
18940
- init_Typography();
18941
- init_useEventBus();
18942
- ICON_NAME_ALIASES = {
18943
- check: "check-circle",
18944
- error: "x-circle",
18945
- warning: "alert-circle"
18946
- };
18947
- lookStyles3 = {
18948
- "icon-only": "",
18949
- illustrated: "[&_svg]:w-32 [&_svg]:h-32",
18950
- "text-only": "[&_svg]:hidden",
18951
- mascot: "[&_svg]:w-24 [&_svg]:h-24 [&_svg]:rounded-pill"
18952
- };
18953
- EmptyState = ({
18954
- icon,
18955
- title,
18956
- message,
18957
- description,
18958
- actionLabel,
18959
- onAction,
18960
- className,
18961
- destructive,
18962
- variant,
18963
- actionEvent,
18964
- look = "icon-only"
18965
- }) => {
18966
- const eventBus = useEventBus();
18967
- const { t } = useTranslate();
18968
- const handleAction = () => {
18969
- if (actionEvent) eventBus.emit(`UI:${actionEvent}`, {});
18970
- onAction?.();
18971
- };
18972
- const iconName = typeof icon === "string" ? ICON_NAME_ALIASES[icon] ?? icon : void 0;
18973
- const iconComponent = typeof icon === "function" ? icon : void 0;
18974
- const hasIcon = Boolean(iconName || iconComponent);
18975
- const isDestructive = destructive || variant === "error";
18976
- const isSuccess = variant === "success";
18977
- const displayText = title || message || t("empty.noItems");
18978
- return /* @__PURE__ */ jsxs(
18979
- VStack,
18980
- {
18981
- align: "center",
18982
- className: cn(
18983
- "justify-center py-12 text-center",
18984
- lookStyles3[look],
18985
- className
18986
- ),
18987
- children: [
18988
- hasIcon && /* @__PURE__ */ jsx(
18989
- Box,
18990
- {
18991
- className: cn(
18992
- "mb-4 rounded-full p-3",
18993
- isDestructive ? "bg-error/10" : isSuccess ? "bg-success/10" : "bg-muted"
18994
- ),
18995
- children: /* @__PURE__ */ jsx(
18996
- Icon,
18997
- {
18998
- ...iconName ? { name: iconName } : { icon: iconComponent },
18999
- className: cn(
19000
- "h-8 w-8",
19001
- isDestructive ? "text-error" : isSuccess ? "text-success" : "text-muted-foreground"
19002
- )
19003
- }
19004
- )
19005
- }
19006
- ),
19007
- /* @__PURE__ */ jsx(
19008
- Typography,
19009
- {
19010
- variant: "h3",
19011
- className: cn(
19012
- "text-lg font-medium",
19013
- isDestructive ? "text-error" : isSuccess ? "text-success" : "text-foreground"
19014
- ),
19015
- children: displayText
19016
- }
19017
- ),
19018
- description && /* @__PURE__ */ jsx(Typography, { variant: "small", className: "mt-1 text-muted-foreground max-w-sm", children: description }),
19019
- actionLabel && (onAction || actionEvent) && /* @__PURE__ */ jsx(
19020
- Button,
19021
- {
19022
- className: "mt-4",
19023
- variant: isDestructive ? "danger" : "primary",
19024
- onClick: handleAction,
19025
- children: actionLabel
19026
- }
19027
- )
19028
- ]
19029
- }
19030
- );
19031
- };
19032
- EmptyState.displayName = "EmptyState";
19033
- }
19034
- });
19035
19473
 
19036
19474
  // components/core/organisms/book/types.ts
19037
19475
  function resolveFieldMap(fieldMap) {
@@ -19384,7 +19822,7 @@ var init_Grid = __esm({
19384
19822
  as: Component = "div"
19385
19823
  }) => {
19386
19824
  const mergedStyle = rows2 ? { gridTemplateRows: `repeat(${rows2}, minmax(0, 1fr))`, ...style } : style;
19387
- return React95__default.createElement(
19825
+ return React93__default.createElement(
19388
19826
  Component,
19389
19827
  {
19390
19828
  className: cn(
@@ -23827,449 +24265,6 @@ var init_ClassifierBoard = __esm({
23827
24265
  ClassifierBoard.displayName = "ClassifierBoard";
23828
24266
  }
23829
24267
  });
23830
- function CodeView({
23831
- data,
23832
- label,
23833
- defaultExpanded = false,
23834
- className
23835
- }) {
23836
- const { t } = useTranslate();
23837
- const [expanded, setExpanded] = useState(defaultExpanded);
23838
- const jsonString = JSON.stringify(data, null, 2);
23839
- return /* @__PURE__ */ jsxs(VStack, { className: cn("rounded-lg border border-border overflow-hidden", className), gap: "none", children: [
23840
- /* @__PURE__ */ jsxs(HStack, { className: "items-center justify-between p-2 bg-muted", gap: "sm", children: [
23841
- /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-muted-foreground font-medium", children: label ?? t("stateArchitect.viewCode") }),
23842
- /* @__PURE__ */ jsx(Button, { variant: "ghost", onClick: () => setExpanded(!expanded), className: "text-xs", children: expanded ? t("stateArchitect.hideJson") : t("stateArchitect.showJson") })
23843
- ] }),
23844
- expanded && /* @__PURE__ */ jsx(Box, { className: "p-3 bg-background overflow-x-auto", children: /* @__PURE__ */ jsx(
23845
- Typography,
23846
- {
23847
- variant: "caption",
23848
- className: "text-foreground font-mono whitespace-pre text-xs leading-relaxed block",
23849
- children: jsonString
23850
- }
23851
- ) })
23852
- ] });
23853
- }
23854
- var init_CodeView = __esm({
23855
- "components/game/organisms/puzzles/state-architect/CodeView.tsx"() {
23856
- init_atoms2();
23857
- init_cn();
23858
- CodeView.displayName = "CodeView";
23859
- }
23860
- });
23861
- var Tabs;
23862
- var init_Tabs = __esm({
23863
- "components/core/molecules/Tabs.tsx"() {
23864
- "use client";
23865
- init_Icon();
23866
- init_Badge();
23867
- init_Typography();
23868
- init_Box();
23869
- init_cn();
23870
- init_useEventBus();
23871
- Tabs = ({
23872
- items,
23873
- tabs,
23874
- defaultActiveTab,
23875
- activeTab: controlledActiveTab,
23876
- onTabChange,
23877
- tabChangeEvent,
23878
- variant = "default",
23879
- orientation = "horizontal",
23880
- className
23881
- }) => {
23882
- const rawItems = items ?? tabs ?? [];
23883
- const safeItems = rawItems.map(({ id, value, ...rest }) => ({
23884
- ...rest,
23885
- id: id || value || ""
23886
- }));
23887
- const eventBus = useEventBus();
23888
- const { t } = useTranslate();
23889
- const initialActive = safeItems.find((item) => item.active)?.id;
23890
- const [internalActiveTab, setInternalActiveTab] = useState(
23891
- defaultActiveTab || initialActive || safeItems[0]?.id || ""
23892
- );
23893
- const activeTab = controlledActiveTab !== void 0 ? controlledActiveTab : internalActiveTab;
23894
- const tabRefs = useRef({});
23895
- const handleTabChange = (tabId, tabEvent) => {
23896
- if (controlledActiveTab === void 0) {
23897
- setInternalActiveTab(tabId);
23898
- }
23899
- onTabChange?.(tabId);
23900
- if (tabChangeEvent) {
23901
- eventBus.emit(`UI:${tabChangeEvent}`, { tabId });
23902
- }
23903
- if (tabEvent) {
23904
- eventBus.emit(`UI:${tabEvent}`, { tabId });
23905
- }
23906
- };
23907
- const handleKeyDown = (e, index) => {
23908
- if (e.key === "ArrowLeft" || e.key === "ArrowRight") {
23909
- e.preventDefault();
23910
- const direction = e.key === "ArrowLeft" ? -1 : 1;
23911
- const nextIndex = (index + direction + safeItems.length) % safeItems.length;
23912
- const nextTab = safeItems[nextIndex];
23913
- if (nextTab && !nextTab.disabled) {
23914
- handleTabChange(nextTab.id);
23915
- tabRefs.current[nextTab.id]?.focus();
23916
- }
23917
- } else if (e.key === "Home" || e.key === "End") {
23918
- e.preventDefault();
23919
- const targetIndex = e.key === "Home" ? 0 : safeItems.length - 1;
23920
- const targetTab = safeItems[targetIndex];
23921
- if (targetTab && !targetTab.disabled) {
23922
- handleTabChange(targetTab.id);
23923
- tabRefs.current[targetTab.id]?.focus();
23924
- }
23925
- }
23926
- };
23927
- const activeTabContent = safeItems.find((item) => item.id === activeTab)?.content;
23928
- if (safeItems.length === 0) {
23929
- return /* @__PURE__ */ jsx(Box, { className: cn("w-full", className), children: /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", className: "py-4", children: t("empty.noItems") }) });
23930
- }
23931
- const variantClasses2 = {
23932
- default: [
23933
- "border-b-[length:var(--border-width)] border-transparent",
23934
- "hover:border-muted-foreground",
23935
- "data-[active=true]:border-primary"
23936
- ].join(" "),
23937
- pills: [
23938
- "rounded-sm",
23939
- "data-[active=true]:bg-primary",
23940
- "data-[active=true]:text-primary-foreground"
23941
- ].join(" "),
23942
- underline: [
23943
- "border-b-[length:var(--border-width)] border-transparent",
23944
- "data-[active=true]:border-primary"
23945
- ].join(" ")
23946
- };
23947
- return /* @__PURE__ */ jsxs(Box, { className: cn("w-full", className), children: [
23948
- /* @__PURE__ */ jsx(
23949
- Box,
23950
- {
23951
- role: "tablist",
23952
- className: cn(
23953
- "flex",
23954
- // Horizontal tab strip becomes a horizontally-scrollable lane
23955
- // below its container width — phones with many tabs scroll
23956
- // instead of clipping. `snap-x` snaps to each tab; the
23957
- // scrollbar is hidden for a cleaner affordance (the swipe
23958
- // gesture is the discoverability cue).
23959
- orientation === "horizontal" ? "flex-row border-b-[length:var(--border-width)] border-border overflow-x-auto snap-x snap-mandatory [&::-webkit-scrollbar]:hidden" : "flex-col border-r-[length:var(--border-width)] border-border",
23960
- variant === "pills" && "gap-1 p-1 bg-muted border-0 rounded-md",
23961
- variant === "underline" && orientation === "vertical" && "border-b-0"
23962
- ),
23963
- children: safeItems.map((item, index) => {
23964
- const isActive = item.id === activeTab;
23965
- const isDisabled = item.disabled;
23966
- return /* @__PURE__ */ jsxs(
23967
- Box,
23968
- {
23969
- as: "button",
23970
- ref: (el) => {
23971
- tabRefs.current[item.id] = el;
23972
- },
23973
- role: "tab",
23974
- "aria-selected": isActive,
23975
- "aria-controls": `tabpanel-${item.id}`,
23976
- "aria-disabled": isDisabled,
23977
- onClick: () => !isDisabled && handleTabChange(item.id, item.event),
23978
- onKeyDown: (e) => handleKeyDown(e, index),
23979
- "data-active": isActive,
23980
- className: cn(
23981
- "flex items-center gap-2 px-4 py-2 text-sm font-medium transition-all whitespace-nowrap",
23982
- orientation === "horizontal" && "snap-start shrink-0",
23983
- "focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
23984
- isDisabled && "opacity-50 cursor-not-allowed",
23985
- variantClasses2[variant],
23986
- isActive ? variant === "pills" ? "text-primary-foreground font-bold" : "text-foreground font-bold" : "text-muted-foreground hover:text-foreground"
23987
- ),
23988
- children: [
23989
- item.icon && (typeof item.icon === "string" ? /* @__PURE__ */ jsx(Icon, { name: item.icon, size: "sm" }) : /* @__PURE__ */ jsx(Icon, { icon: item.icon, size: "sm" })),
23990
- /* @__PURE__ */ jsx(Typography, { variant: "small", weight: isActive ? "semibold" : "normal", className: "!text-inherit", children: item.label }),
23991
- item.badge !== void 0 && /* @__PURE__ */ jsx(Badge, { variant: "default", size: "sm", children: item.badge })
23992
- ]
23993
- },
23994
- item.id
23995
- );
23996
- })
23997
- }
23998
- ),
23999
- activeTabContent !== void 0 && activeTabContent !== null && /* @__PURE__ */ jsx(
24000
- Box,
24001
- {
24002
- role: "tabpanel",
24003
- id: `tabpanel-${activeTab}`,
24004
- "aria-labelledby": `tab-${activeTab}`,
24005
- className: "mt-4",
24006
- children: activeTabContent
24007
- }
24008
- )
24009
- ] });
24010
- };
24011
- Tabs.displayName = "Tabs";
24012
- }
24013
- });
24014
- function generateDiff(oldVal, newVal) {
24015
- const oldLines = oldVal.split("\n");
24016
- const newLines = newVal.split("\n");
24017
- const diff = [];
24018
- const maxLen = Math.max(oldLines.length, newLines.length);
24019
- for (let i = 0; i < maxLen; i++) {
24020
- const oldLine = oldLines[i];
24021
- const newLine = newLines[i];
24022
- if (oldLine === newLine) {
24023
- diff.push({ type: "context", content: oldLine ?? "", lineNumber: i + 1 });
24024
- } else {
24025
- if (oldLine !== void 0) {
24026
- diff.push({ type: "remove", content: oldLine, lineNumber: i + 1 });
24027
- }
24028
- if (newLine !== void 0) {
24029
- diff.push({ type: "add", content: newLine, lineNumber: i + 1 });
24030
- }
24031
- }
24032
- }
24033
- return diff;
24034
- }
24035
- var DIFF_STYLES, CodeViewer;
24036
- var init_CodeViewer = __esm({
24037
- "components/core/molecules/CodeViewer.tsx"() {
24038
- "use client";
24039
- init_cn();
24040
- init_atoms2();
24041
- init_Stack();
24042
- init_LoadingState();
24043
- init_ErrorState();
24044
- init_EmptyState();
24045
- init_Tabs();
24046
- init_useEventBus();
24047
- DIFF_STYLES = {
24048
- add: {
24049
- bg: "bg-success/10",
24050
- prefix: "+",
24051
- text: "text-success"
24052
- },
24053
- remove: {
24054
- bg: "bg-error/10",
24055
- prefix: "-",
24056
- text: "text-error"
24057
- },
24058
- context: {
24059
- bg: "",
24060
- prefix: " ",
24061
- text: "text-foreground"
24062
- }
24063
- };
24064
- CodeViewer = ({
24065
- title,
24066
- code,
24067
- language,
24068
- diff: propDiff,
24069
- oldValue,
24070
- newValue,
24071
- mode = "code",
24072
- showLineNumbers = true,
24073
- showCopy = true,
24074
- wordWrap = false,
24075
- maxHeight = 500,
24076
- files,
24077
- actions,
24078
- entity,
24079
- isLoading = false,
24080
- error,
24081
- className
24082
- }) => {
24083
- const eventBus = useEventBus();
24084
- const { t } = useTranslate();
24085
- const [copied, setCopied] = useState(false);
24086
- const [wrap, setWrap] = useState(wordWrap);
24087
- const [activeFileIndex, setActiveFileIndex] = useState(0);
24088
- const handleAction = useCallback(
24089
- (action) => {
24090
- if (action.event) {
24091
- eventBus.emit(`UI:${action.event}`, {});
24092
- }
24093
- },
24094
- [eventBus]
24095
- );
24096
- const activeFile = files?.[activeFileIndex];
24097
- const activeCode = activeFile?.code ?? code ?? "";
24098
- const activeLanguage = activeFile?.language ?? language ?? "text";
24099
- const lines = useMemo(() => activeCode.split("\n"), [activeCode]);
24100
- const diffLines = useMemo(() => {
24101
- if (propDiff) return propDiff;
24102
- if (mode === "diff" && oldValue !== void 0 && newValue !== void 0) {
24103
- return generateDiff(oldValue, newValue);
24104
- }
24105
- return null;
24106
- }, [propDiff, mode, oldValue, newValue]);
24107
- const handleCopy = useCallback(async () => {
24108
- try {
24109
- await navigator.clipboard.writeText(activeCode);
24110
- setCopied(true);
24111
- eventBus.emit("UI:CODE_COPY", { language: activeLanguage });
24112
- setTimeout(() => setCopied(false), 2e3);
24113
- } catch {
24114
- }
24115
- }, [activeCode, eventBus, activeLanguage]);
24116
- const tabItems = files?.map((file, idx) => ({
24117
- id: `file-${idx}`,
24118
- label: file.label,
24119
- content: null
24120
- }));
24121
- if (isLoading) {
24122
- return /* @__PURE__ */ jsx(LoadingState, { message: t("common.loading"), className });
24123
- }
24124
- if (error) {
24125
- return /* @__PURE__ */ jsx(
24126
- ErrorState,
24127
- {
24128
- title: t("display.codeViewerError"),
24129
- message: error.message,
24130
- className
24131
- }
24132
- );
24133
- }
24134
- if (!activeCode && !diffLines) {
24135
- return /* @__PURE__ */ jsx(
24136
- EmptyState,
24137
- {
24138
- icon: Code,
24139
- title: t("display.noCode"),
24140
- description: "No code to display.",
24141
- className
24142
- }
24143
- );
24144
- }
24145
- return /* @__PURE__ */ jsx(Card, { className: cn("overflow-hidden", className), children: /* @__PURE__ */ jsxs(VStack, { gap: "none", children: [
24146
- tabItems && tabItems.length > 1 && /* @__PURE__ */ jsx(Box, { className: "border-b border-border", children: /* @__PURE__ */ jsx(
24147
- Tabs,
24148
- {
24149
- tabs: tabItems,
24150
- activeTab: `file-${activeFileIndex}`,
24151
- onTabChange: (id) => {
24152
- const idx = parseInt(id.replace("file-", ""), 10);
24153
- setActiveFileIndex(idx);
24154
- }
24155
- }
24156
- ) }),
24157
- /* @__PURE__ */ jsxs(
24158
- HStack,
24159
- {
24160
- gap: "sm",
24161
- align: "center",
24162
- justify: "between",
24163
- className: "px-4 py-2 border-b border-border bg-muted/30",
24164
- children: [
24165
- /* @__PURE__ */ jsxs(HStack, { gap: "sm", align: "center", children: [
24166
- /* @__PURE__ */ jsx(Icon, { icon: mode === "diff" ? FileText : Code, size: "sm", className: "text-muted-foreground" }),
24167
- title && /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "truncate", children: title }),
24168
- activeLanguage && activeLanguage !== "text" && /* @__PURE__ */ jsx(Badge, { variant: "default", children: activeLanguage })
24169
- ] }),
24170
- /* @__PURE__ */ jsxs(HStack, { gap: "xs", align: "center", children: [
24171
- /* @__PURE__ */ jsx(
24172
- Button,
24173
- {
24174
- variant: "ghost",
24175
- size: "sm",
24176
- icon: WrapText,
24177
- onClick: () => setWrap(!wrap),
24178
- className: cn(wrap && "text-primary")
24179
- }
24180
- ),
24181
- showCopy && /* @__PURE__ */ jsx(
24182
- Button,
24183
- {
24184
- variant: "ghost",
24185
- size: "sm",
24186
- icon: copied ? Check : Copy,
24187
- onClick: handleCopy,
24188
- className: cn(copied && "text-success")
24189
- }
24190
- ),
24191
- actions?.map((action, idx) => /* @__PURE__ */ jsx(
24192
- Badge,
24193
- {
24194
- variant: "default",
24195
- className: "cursor-pointer hover:opacity-80 transition-opacity",
24196
- onClick: () => handleAction(action),
24197
- children: action.label
24198
- },
24199
- idx
24200
- ))
24201
- ] })
24202
- ]
24203
- }
24204
- ),
24205
- /* @__PURE__ */ jsx(
24206
- Box,
24207
- {
24208
- className: "overflow-auto bg-muted/20",
24209
- style: { maxHeight },
24210
- children: diffLines ? (
24211
- /* Diff mode */
24212
- /* @__PURE__ */ jsx(VStack, { gap: "none", className: "font-mono text-xs", children: diffLines.map((line, idx) => {
24213
- const style = DIFF_STYLES[line.type];
24214
- return /* @__PURE__ */ jsxs(HStack, { gap: "none", align: "start", className: cn(style.bg, "px-4 py-0.5"), children: [
24215
- showLineNumbers && /* @__PURE__ */ jsx(
24216
- Typography,
24217
- {
24218
- variant: "caption",
24219
- color: "secondary",
24220
- className: "w-8 text-right mr-3 select-none tabular-nums flex-shrink-0",
24221
- children: line.lineNumber ?? ""
24222
- }
24223
- ),
24224
- /* @__PURE__ */ jsxs(
24225
- Typography,
24226
- {
24227
- variant: "caption",
24228
- className: cn(
24229
- "font-mono flex-1 min-w-0",
24230
- style.text,
24231
- wrap ? "whitespace-pre-wrap break-all" : "whitespace-pre"
24232
- ),
24233
- children: [
24234
- /* @__PURE__ */ jsx(Box, { as: "span", className: "select-none opacity-50 mr-2", children: style.prefix }),
24235
- line.content
24236
- ]
24237
- }
24238
- )
24239
- ] }, idx);
24240
- }) })
24241
- ) : (
24242
- /* Code mode */
24243
- /* @__PURE__ */ jsx(VStack, { gap: "none", className: "font-mono text-xs", children: lines.map((line, idx) => /* @__PURE__ */ jsxs(HStack, { gap: "none", align: "start", className: "px-4 py-0.5 hover:bg-muted/50", children: [
24244
- showLineNumbers && /* @__PURE__ */ jsx(
24245
- Typography,
24246
- {
24247
- variant: "caption",
24248
- color: "secondary",
24249
- className: "w-8 text-right mr-4 select-none tabular-nums flex-shrink-0",
24250
- children: idx + 1
24251
- }
24252
- ),
24253
- /* @__PURE__ */ jsx(
24254
- Typography,
24255
- {
24256
- variant: "caption",
24257
- className: cn(
24258
- "font-mono flex-1 min-w-0",
24259
- wrap ? "whitespace-pre-wrap break-all" : "whitespace-pre"
24260
- ),
24261
- children: line || " "
24262
- }
24263
- )
24264
- ] }, idx)) })
24265
- )
24266
- }
24267
- )
24268
- ] }) });
24269
- };
24270
- CodeViewer.displayName = "CodeViewer";
24271
- }
24272
- });
24273
24268
  function CombatLog({
24274
24269
  events: events2,
24275
24270
  maxVisible = 50,
@@ -24744,7 +24739,7 @@ function CraftingRecipe({
24744
24739
  className
24745
24740
  }) {
24746
24741
  const eventBus = useEventBus();
24747
- const handleCraft = React95.useCallback(() => {
24742
+ const handleCraft = React93.useCallback(() => {
24748
24743
  onCraft?.();
24749
24744
  if (craftEvent) {
24750
24745
  eventBus.emit(craftEvent, { output: output.label });
@@ -24761,7 +24756,7 @@ function CraftingRecipe({
24761
24756
  children: [
24762
24757
  /* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-wrap items-center", children: inputs.map((ingredient, index) => {
24763
24758
  const hasSufficient = ingredient.available >= ingredient.required;
24764
- return /* @__PURE__ */ jsxs(React95.Fragment, { children: [
24759
+ return /* @__PURE__ */ jsxs(React93.Fragment, { children: [
24765
24760
  /* @__PURE__ */ jsx(Box, { className: "relative", children: /* @__PURE__ */ jsx(
24766
24761
  ItemSlot,
24767
24762
  {
@@ -24824,8 +24819,8 @@ function DPad({
24824
24819
  }) {
24825
24820
  const eventBus = useEventBus();
24826
24821
  const sizes = sizeMap15[size];
24827
- const [activeDirections, setActiveDirections] = React95.useState(/* @__PURE__ */ new Set());
24828
- const handlePress = React95.useCallback(
24822
+ const [activeDirections, setActiveDirections] = React93.useState(/* @__PURE__ */ new Set());
24823
+ const handlePress = React93.useCallback(
24829
24824
  (direction) => {
24830
24825
  setActiveDirections((prev) => new Set(prev).add(direction));
24831
24826
  if (directionEvent) eventBus.emit(`UI:${directionEvent}`, { direction, pressed: true });
@@ -24833,7 +24828,7 @@ function DPad({
24833
24828
  },
24834
24829
  [directionEvent, eventBus, onDirection]
24835
24830
  );
24836
- const handleRelease = React95.useCallback(
24831
+ const handleRelease = React93.useCallback(
24837
24832
  (direction) => {
24838
24833
  setActiveDirections((prev) => {
24839
24834
  const next = new Set(prev);
@@ -25519,14 +25514,14 @@ function useDataDnd(args) {
25519
25514
  const isZone = Boolean(dragGroup || accepts || sortable);
25520
25515
  const enabled = isZone || Boolean(dndRoot);
25521
25516
  const eventBus = useEventBus();
25522
- const parentRoot = React95__default.useContext(RootCtx);
25517
+ const parentRoot = React93__default.useContext(RootCtx);
25523
25518
  const isRoot = enabled && parentRoot === null;
25524
- const zoneId = React95__default.useId();
25519
+ const zoneId = React93__default.useId();
25525
25520
  const ownGroup = dragGroup ?? accepts ?? zoneId;
25526
- const [optimisticOrders, setOptimisticOrders] = React95__default.useState(() => /* @__PURE__ */ new Map());
25527
- const optimisticOrdersRef = React95__default.useRef(optimisticOrders);
25521
+ const [optimisticOrders, setOptimisticOrders] = React93__default.useState(() => /* @__PURE__ */ new Map());
25522
+ const optimisticOrdersRef = React93__default.useRef(optimisticOrders);
25528
25523
  optimisticOrdersRef.current = optimisticOrders;
25529
- const clearOptimisticOrder = React95__default.useCallback((group) => {
25524
+ const clearOptimisticOrder = React93__default.useCallback((group) => {
25530
25525
  setOptimisticOrders((prev) => {
25531
25526
  if (!prev.has(group)) return prev;
25532
25527
  const next = new Map(prev);
@@ -25551,7 +25546,7 @@ function useDataDnd(args) {
25551
25546
  const raw = it[dndItemIdField];
25552
25547
  return String(raw ?? `__idx_${idx}`);
25553
25548
  }).join("|");
25554
- const itemIds = React95__default.useMemo(
25549
+ const itemIds = React93__default.useMemo(
25555
25550
  () => orderedItems.map((it, idx) => {
25556
25551
  const raw = it[dndItemIdField];
25557
25552
  return raw ?? `__idx_${idx}`;
@@ -25559,7 +25554,7 @@ function useDataDnd(args) {
25559
25554
  [itemIdsSignature]
25560
25555
  );
25561
25556
  const itemsContentSig = items.map((it, idx) => String(it[dndItemIdField] ?? `__${idx}`)).join("|");
25562
- React95__default.useEffect(() => {
25557
+ React93__default.useEffect(() => {
25563
25558
  const root = isRoot ? null : parentRoot;
25564
25559
  if (root) {
25565
25560
  root.clearOptimisticOrder(ownGroup);
@@ -25567,20 +25562,20 @@ function useDataDnd(args) {
25567
25562
  clearOptimisticOrder(ownGroup);
25568
25563
  }
25569
25564
  }, [itemsContentSig, ownGroup]);
25570
- const zonesRef = React95__default.useRef(/* @__PURE__ */ new Map());
25571
- const registerZone = React95__default.useCallback((zoneId2, meta2) => {
25565
+ const zonesRef = React93__default.useRef(/* @__PURE__ */ new Map());
25566
+ const registerZone = React93__default.useCallback((zoneId2, meta2) => {
25572
25567
  zonesRef.current.set(zoneId2, meta2);
25573
25568
  }, []);
25574
- const unregisterZone = React95__default.useCallback((zoneId2) => {
25569
+ const unregisterZone = React93__default.useCallback((zoneId2) => {
25575
25570
  zonesRef.current.delete(zoneId2);
25576
25571
  }, []);
25577
- const [activeDrag, setActiveDrag] = React95__default.useState(null);
25578
- const [overZoneGroup, setOverZoneGroup] = React95__default.useState(null);
25579
- const meta = React95__default.useMemo(
25572
+ const [activeDrag, setActiveDrag] = React93__default.useState(null);
25573
+ const [overZoneGroup, setOverZoneGroup] = React93__default.useState(null);
25574
+ const meta = React93__default.useMemo(
25580
25575
  () => ({ group: ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, rawItems: items, idField: dndItemIdField }),
25581
25576
  [ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, items, dndItemIdField]
25582
25577
  );
25583
- React95__default.useEffect(() => {
25578
+ React93__default.useEffect(() => {
25584
25579
  const target = isRoot ? null : parentRoot;
25585
25580
  if (!target) {
25586
25581
  zonesRef.current.set(zoneId, meta);
@@ -25599,7 +25594,7 @@ function useDataDnd(args) {
25599
25594
  }, [parentRoot, isRoot, zoneId, meta]);
25600
25595
  const sensors = useAlmadarDndSensors(true);
25601
25596
  const collisionDetection = almadarDndCollisionDetection;
25602
- const findZoneByItem = React95__default.useCallback(
25597
+ const findZoneByItem = React93__default.useCallback(
25603
25598
  (id) => {
25604
25599
  for (const z of zonesRef.current.values()) {
25605
25600
  if (z.itemIds.includes(id)) return z;
@@ -25608,7 +25603,7 @@ function useDataDnd(args) {
25608
25603
  },
25609
25604
  []
25610
25605
  );
25611
- React95__default.useCallback(
25606
+ React93__default.useCallback(
25612
25607
  (group) => {
25613
25608
  for (const z of zonesRef.current.values()) {
25614
25609
  if (z.group === group) return z;
@@ -25617,7 +25612,7 @@ function useDataDnd(args) {
25617
25612
  },
25618
25613
  []
25619
25614
  );
25620
- const handleDragEnd = React95__default.useCallback(
25615
+ const handleDragEnd = React93__default.useCallback(
25621
25616
  (event) => {
25622
25617
  const { active, over } = event;
25623
25618
  const activeIdStr = String(active.id);
@@ -25708,8 +25703,8 @@ function useDataDnd(args) {
25708
25703
  },
25709
25704
  [eventBus]
25710
25705
  );
25711
- const sortableData = React95__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
25712
- const SortableItem = React95__default.useCallback(
25706
+ const sortableData = React93__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
25707
+ const SortableItem = React93__default.useCallback(
25713
25708
  ({ id, children }) => {
25714
25709
  const {
25715
25710
  attributes,
@@ -25749,7 +25744,7 @@ function useDataDnd(args) {
25749
25744
  id: droppableId,
25750
25745
  data: sortableData
25751
25746
  });
25752
- const ctx = React95__default.useContext(RootCtx);
25747
+ const ctx = React93__default.useContext(RootCtx);
25753
25748
  const activeDrag2 = ctx?.activeDrag ?? null;
25754
25749
  const overZoneGroup2 = ctx?.overZoneGroup ?? null;
25755
25750
  const isThisZoneOver = overZoneGroup2 === ownGroup;
@@ -25764,7 +25759,7 @@ function useDataDnd(args) {
25764
25759
  showForeignPlaceholder,
25765
25760
  ctxAvailable: ctx != null
25766
25761
  });
25767
- React95__default.useEffect(() => {
25762
+ React93__default.useEffect(() => {
25768
25763
  dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
25769
25764
  }, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
25770
25765
  return /* @__PURE__ */ jsx(
@@ -25778,11 +25773,11 @@ function useDataDnd(args) {
25778
25773
  }
25779
25774
  );
25780
25775
  };
25781
- const rootContextValue = React95__default.useMemo(
25776
+ const rootContextValue = React93__default.useMemo(
25782
25777
  () => ({ registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder }),
25783
25778
  [registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder]
25784
25779
  );
25785
- const handleDragStart = React95__default.useCallback((event) => {
25780
+ const handleDragStart = React93__default.useCallback((event) => {
25786
25781
  const sourceZone = findZoneByItem(event.active.id);
25787
25782
  const rect = event.active.rect.current.initial;
25788
25783
  const height = rect?.height && rect.height > 0 ? rect.height : 64;
@@ -25801,7 +25796,7 @@ function useDataDnd(args) {
25801
25796
  isRoot
25802
25797
  });
25803
25798
  }, [findZoneByItem, isRoot, zoneId]);
25804
- const handleDragOver = React95__default.useCallback((event) => {
25799
+ const handleDragOver = React93__default.useCallback((event) => {
25805
25800
  const { active, over } = event;
25806
25801
  const overData = over?.data?.current;
25807
25802
  const overGroup = overData?.dndGroup ?? null;
@@ -25871,7 +25866,7 @@ function useDataDnd(args) {
25871
25866
  return next;
25872
25867
  });
25873
25868
  }, []);
25874
- const handleDragCancel = React95__default.useCallback((event) => {
25869
+ const handleDragCancel = React93__default.useCallback((event) => {
25875
25870
  setActiveDrag(null);
25876
25871
  setOverZoneGroup(null);
25877
25872
  dndLog.warn("dragCancel", {
@@ -25879,12 +25874,12 @@ function useDataDnd(args) {
25879
25874
  reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
25880
25875
  });
25881
25876
  }, []);
25882
- const handleDragEndWithCleanup = React95__default.useCallback((event) => {
25877
+ const handleDragEndWithCleanup = React93__default.useCallback((event) => {
25883
25878
  handleDragEnd(event);
25884
25879
  setActiveDrag(null);
25885
25880
  setOverZoneGroup(null);
25886
25881
  }, [handleDragEnd]);
25887
- const wrapContainer = React95__default.useCallback(
25882
+ const wrapContainer = React93__default.useCallback(
25888
25883
  (children) => {
25889
25884
  if (!enabled) return children;
25890
25885
  const strategy = layout === "grid" ? rectSortingStrategy : verticalListSortingStrategy;
@@ -25938,7 +25933,7 @@ var init_useDataDnd = __esm({
25938
25933
  init_useAlmadarDndCollision();
25939
25934
  init_Box();
25940
25935
  dndLog = createLogger("almadar:ui:dnd");
25941
- RootCtx = React95__default.createContext(null);
25936
+ RootCtx = React93__default.createContext(null);
25942
25937
  }
25943
25938
  });
25944
25939
  function fieldLabel2(key) {
@@ -26458,7 +26453,7 @@ function DataList({
26458
26453
  }) {
26459
26454
  const eventBus = useEventBus();
26460
26455
  const { t } = useTranslate();
26461
- const [visibleCount, setVisibleCount] = React95__default.useState(pageSize || Infinity);
26456
+ const [visibleCount, setVisibleCount] = React93__default.useState(pageSize || Infinity);
26462
26457
  const fieldDefs = fields ?? columns ?? [];
26463
26458
  const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
26464
26459
  const dnd = useDataDnd({
@@ -26477,7 +26472,7 @@ function DataList({
26477
26472
  const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
26478
26473
  const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
26479
26474
  const hasRenderProp = typeof children === "function";
26480
- React95__default.useEffect(() => {
26475
+ React93__default.useEffect(() => {
26481
26476
  const renderItemTypeOf = typeof schemaRenderItem;
26482
26477
  const childrenTypeOf = typeof children;
26483
26478
  if (data.length > 0 && !hasRenderProp) {
@@ -26582,7 +26577,7 @@ function DataList({
26582
26577
  const items2 = data.map((item) => item);
26583
26578
  const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
26584
26579
  const contentField = titleField?.name ?? fieldDefs[0]?.name ?? "";
26585
- return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React95__default.Fragment, { children: [
26580
+ return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
26586
26581
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
26587
26582
  group.items.map((itemData, index) => {
26588
26583
  const id = itemData.id || `${gi}-${index}`;
@@ -26730,7 +26725,7 @@ function DataList({
26730
26725
  className
26731
26726
  ),
26732
26727
  children: [
26733
- groups.map((group, gi) => /* @__PURE__ */ jsxs(React95__default.Fragment, { children: [
26728
+ groups.map((group, gi) => /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
26734
26729
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
26735
26730
  group.items.map(
26736
26731
  (itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
@@ -28104,7 +28099,7 @@ var init_WizardProgress = __esm({
28104
28099
  children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
28105
28100
  const isActive = index === currentStep;
28106
28101
  const isCompleted = index < currentStep;
28107
- return /* @__PURE__ */ jsxs(React95__default.Fragment, { children: [
28102
+ return /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
28108
28103
  /* @__PURE__ */ jsx(
28109
28104
  "button",
28110
28105
  {
@@ -28621,8 +28616,9 @@ var init_FormSectionHeader = __esm({
28621
28616
  Box,
28622
28617
  {
28623
28618
  className: cn(
28624
- "px-4 py-3 bg-muted rounded-t-lg border-b-2 border-border border-l-4 border-l-primary",
28625
- isClickable && "cursor-pointer hover:bg-[var(--color-surface-hover)] transition-colors",
28619
+ "px-5 py-4 bg-muted/60 rounded-lg",
28620
+ "border border-border border-l-4 border-l-primary",
28621
+ isClickable && "cursor-pointer hover:bg-muted transition-colors",
28626
28622
  className
28627
28623
  ),
28628
28624
  onClick: isClickable ? onToggle : void 0,
@@ -28633,7 +28629,7 @@ var init_FormSectionHeader = __esm({
28633
28629
  {
28634
28630
  name: icon,
28635
28631
  size: "md",
28636
- className: "text-primary"
28632
+ className: "text-primary shrink-0"
28637
28633
  }
28638
28634
  ),
28639
28635
  statusIcon && /* @__PURE__ */ jsx(
@@ -28641,12 +28637,15 @@ var init_FormSectionHeader = __esm({
28641
28637
  {
28642
28638
  name: statusIcon,
28643
28639
  size: "md",
28644
- className: hasErrors ? "text-error" : "text-success"
28640
+ className: cn(
28641
+ "shrink-0",
28642
+ hasErrors ? "text-error" : "text-success"
28643
+ )
28645
28644
  }
28646
28645
  ),
28647
28646
  /* @__PURE__ */ jsxs(Box, { className: "space-y-0.5", children: [
28648
- /* @__PURE__ */ jsx(Typography, { variant: "subheading", weight: "semibold", children: title }),
28649
- subtitle && /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", children: subtitle })
28647
+ /* @__PURE__ */ jsx(Typography, { variant: "subheading", weight: "semibold", className: "text-foreground", children: title }),
28648
+ subtitle && /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", className: "leading-snug", children: subtitle })
28650
28649
  ] })
28651
28650
  ] }),
28652
28651
  /* @__PURE__ */ jsxs(HStack, { gap: "sm", align: "center", children: [
@@ -28655,9 +28654,9 @@ var init_FormSectionHeader = __esm({
28655
28654
  Icon,
28656
28655
  {
28657
28656
  name: "chevron-down",
28658
- size: "md",
28657
+ size: "sm",
28659
28658
  className: cn(
28660
- "text-muted-foreground transition-transform",
28659
+ "text-muted-foreground transition-transform duration-200 shrink-0",
28661
28660
  isCollapsed && "-rotate-90"
28662
28661
  )
28663
28662
  }
@@ -29159,7 +29158,7 @@ function InventoryGrid({
29159
29158
  const eventBus = useEventBus();
29160
29159
  const slotCount = totalSlots ?? items.length;
29161
29160
  const emptySlotCount = Math.max(0, slotCount - items.length);
29162
- const handleSelect = React95.useCallback(
29161
+ const handleSelect = React93.useCallback(
29163
29162
  (id) => {
29164
29163
  onSelect?.(id);
29165
29164
  if (selectEvent) {
@@ -29376,31 +29375,31 @@ function GameCanvas2D({
29376
29375
  assetBaseUrl = "",
29377
29376
  className
29378
29377
  }) {
29379
- const canvasRef = React95.useRef(null);
29380
- const rafRef = React95.useRef(0);
29381
- const frameRef = React95.useRef(0);
29382
- const lastTimeRef = React95.useRef(0);
29383
- const imageCache = React95.useRef(/* @__PURE__ */ new Map());
29378
+ const canvasRef = React93.useRef(null);
29379
+ const rafRef = React93.useRef(0);
29380
+ const frameRef = React93.useRef(0);
29381
+ const lastTimeRef = React93.useRef(0);
29382
+ const imageCache = React93.useRef(/* @__PURE__ */ new Map());
29384
29383
  const emit = useEmitEvent();
29385
- const onDrawRef = React95.useRef(onDraw);
29384
+ const onDrawRef = React93.useRef(onDraw);
29386
29385
  onDrawRef.current = onDraw;
29387
- const onTickRef = React95.useRef(onTick);
29386
+ const onTickRef = React93.useRef(onTick);
29388
29387
  onTickRef.current = onTick;
29389
- const tickEventRef = React95.useRef(tickEvent);
29388
+ const tickEventRef = React93.useRef(tickEvent);
29390
29389
  tickEventRef.current = tickEvent;
29391
- const drawEventRef = React95.useRef(drawEvent);
29390
+ const drawEventRef = React93.useRef(drawEvent);
29392
29391
  drawEventRef.current = drawEvent;
29393
- const emitRef = React95.useRef(emit);
29392
+ const emitRef = React93.useRef(emit);
29394
29393
  emitRef.current = emit;
29395
- const assetBaseUrlRef = React95.useRef(assetBaseUrl);
29394
+ const assetBaseUrlRef = React93.useRef(assetBaseUrl);
29396
29395
  assetBaseUrlRef.current = assetBaseUrl;
29397
- const backgroundImageRef = React95.useRef(backgroundImage);
29396
+ const backgroundImageRef = React93.useRef(backgroundImage);
29398
29397
  backgroundImageRef.current = backgroundImage;
29399
- const widthRef = React95.useRef(width);
29398
+ const widthRef = React93.useRef(width);
29400
29399
  widthRef.current = width;
29401
- const heightRef = React95.useRef(height);
29400
+ const heightRef = React93.useRef(height);
29402
29401
  heightRef.current = height;
29403
- const loadImage = React95.useCallback((url) => {
29402
+ const loadImage = React93.useCallback((url) => {
29404
29403
  const fullUrl = url.startsWith("http") ? url : `${assetBaseUrlRef.current}${url}`;
29405
29404
  const cached = imageCache.current.get(fullUrl);
29406
29405
  if (cached?.complete && cached.naturalWidth > 0) return cached;
@@ -29412,7 +29411,7 @@ function GameCanvas2D({
29412
29411
  }
29413
29412
  return null;
29414
29413
  }, []);
29415
- React95.useEffect(() => {
29414
+ React93.useEffect(() => {
29416
29415
  const canvas = canvasRef.current;
29417
29416
  if (!canvas) return;
29418
29417
  const ctx = canvas.getContext("2d");
@@ -29715,7 +29714,7 @@ function TurnPanel({
29715
29714
  className
29716
29715
  }) {
29717
29716
  const eventBus = useEventBus();
29718
- const handleAction = React95.useCallback(
29717
+ const handleAction = React93.useCallback(
29719
29718
  (event) => {
29720
29719
  if (event) {
29721
29720
  eventBus.emit(event, { turn: currentTurn, phase, activeTeam });
@@ -29861,7 +29860,7 @@ function UnitCommandBar({
29861
29860
  className
29862
29861
  }) {
29863
29862
  const eventBus = useEventBus();
29864
- const handleCommand = React95.useCallback(
29863
+ const handleCommand = React93.useCallback(
29865
29864
  (event) => {
29866
29865
  if (event) {
29867
29866
  eventBus.emit(event, { unitId: selectedUnitId });
@@ -30346,7 +30345,7 @@ function GameMenu({
30346
30345
  } catch {
30347
30346
  }
30348
30347
  const eventBus = eventBusProp || eventBusFromHook;
30349
- const handleOptionClick = React95.useCallback(
30348
+ const handleOptionClick = React93.useCallback(
30350
30349
  (option) => {
30351
30350
  if (option.event && eventBus) {
30352
30351
  eventBus.emit(`UI:${option.event}`, { option });
@@ -30460,7 +30459,7 @@ function GameOverScreen({
30460
30459
  } catch {
30461
30460
  }
30462
30461
  const eventBus = eventBusProp || eventBusFromHook;
30463
- const handleActionClick = React95.useCallback(
30462
+ const handleActionClick = React93.useCallback(
30464
30463
  (action) => {
30465
30464
  if (action.event && eventBus) {
30466
30465
  eventBus.emit(`UI:${action.event}`, { action });
@@ -31454,7 +31453,7 @@ var init_StarRating = __esm({
31454
31453
  name: "star",
31455
31454
  className: cn(
31456
31455
  styles.star,
31457
- "text-muted-foreground",
31456
+ "text-foreground/30",
31458
31457
  "transition-colors duration-100"
31459
31458
  ),
31460
31459
  strokeWidth: 1.5
@@ -31937,8 +31936,8 @@ function TableView({
31937
31936
  }) {
31938
31937
  const eventBus = useEventBus();
31939
31938
  const { t } = useTranslate();
31940
- const [visibleCount, setVisibleCount] = React95__default.useState(pageSize > 0 ? pageSize : Infinity);
31941
- const [localSelected, setLocalSelected] = React95__default.useState(/* @__PURE__ */ new Set());
31939
+ const [visibleCount, setVisibleCount] = React93__default.useState(pageSize > 0 ? pageSize : Infinity);
31940
+ const [localSelected, setLocalSelected] = React93__default.useState(/* @__PURE__ */ new Set());
31942
31941
  const colDefs = columns ?? fields ?? [];
31943
31942
  const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
31944
31943
  const dnd = useDataDnd({
@@ -32133,12 +32132,12 @@ function TableView({
32133
32132
  ]
32134
32133
  }
32135
32134
  );
32136
- return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React95__default.Fragment, { children: rowInner }, id);
32135
+ return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React93__default.Fragment, { children: rowInner }, id);
32137
32136
  };
32138
32137
  const items = data.map((row) => row);
32139
32138
  const groups = groupBy ? groupData2(items, groupBy) : [{ label: "", items }];
32140
32139
  let runningIndex = 0;
32141
- const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React95__default.Fragment, { children: [
32140
+ const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
32142
32141
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-3" : "mt-0" }),
32143
32142
  group.items.map((row) => renderRow(row, runningIndex++))
32144
32143
  ] }, gi)) });
@@ -33490,7 +33489,7 @@ var init_StepFlow = __esm({
33490
33489
  className
33491
33490
  }) => {
33492
33491
  if (orientation === "vertical") {
33493
- return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React95__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
33492
+ return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React93__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
33494
33493
  /* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
33495
33494
  /* @__PURE__ */ jsx(StepCircle, { step, index }),
33496
33495
  showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
@@ -33501,7 +33500,7 @@ var init_StepFlow = __esm({
33501
33500
  ] })
33502
33501
  ] }) }, index)) });
33503
33502
  }
33504
- return /* @__PURE__ */ jsx(Box, { className: cn("w-full flex flex-col md:flex-row items-start gap-0", className), children: steps.map((step, index) => /* @__PURE__ */ jsxs(React95__default.Fragment, { children: [
33503
+ return /* @__PURE__ */ jsx(Box, { className: cn("w-full flex flex-col md:flex-row items-start gap-0", className), children: steps.map((step, index) => /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
33505
33504
  /* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
33506
33505
  /* @__PURE__ */ jsx(StepCircle, { step, index }),
33507
33506
  /* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
@@ -34256,11 +34255,19 @@ function LatticeSVG({
34256
34255
  function f2(n) {
34257
34256
  return n.toFixed(2);
34258
34257
  }
34259
- var VARIANT_MAP2, EdgeDecoration;
34258
+ var colorTokenVars, VARIANT_MAP2, EdgeDecoration;
34260
34259
  var init_EdgeDecoration = __esm({
34261
34260
  "components/core/molecules/EdgeDecoration.tsx"() {
34262
34261
  "use client";
34263
34262
  init_cn();
34263
+ colorTokenVars = {
34264
+ primary: "var(--color-primary)",
34265
+ secondary: "var(--color-secondary)",
34266
+ success: "var(--color-success)",
34267
+ warning: "var(--color-warning)",
34268
+ error: "var(--color-error)",
34269
+ muted: "var(--color-muted)"
34270
+ };
34264
34271
  VARIANT_MAP2 = {
34265
34272
  arch: ArchSVG,
34266
34273
  vine: VineSVG,
@@ -34270,13 +34277,14 @@ var init_EdgeDecoration = __esm({
34270
34277
  variant = "arch",
34271
34278
  side = "both",
34272
34279
  opacity = 0.15,
34273
- color = "var(--color-primary)",
34280
+ color = "primary",
34274
34281
  strokeWidth = 0.5,
34275
34282
  width = 15,
34276
34283
  className
34277
34284
  }) => {
34278
34285
  const id = useId();
34279
34286
  const Variant = VARIANT_MAP2[variant];
34287
+ const resolvedColor = color in colorTokenVars ? colorTokenVars[color] : color;
34280
34288
  const sides = side === "both" ? ["left", "right"] : [side];
34281
34289
  return /* @__PURE__ */ jsx(Fragment, { children: sides.map((s) => /* @__PURE__ */ jsx(
34282
34290
  "svg",
@@ -34299,7 +34307,7 @@ var init_EdgeDecoration = __esm({
34299
34307
  facing: s,
34300
34308
  w: 200,
34301
34309
  h: 600,
34302
- color,
34310
+ color: resolvedColor,
34303
34311
  strokeWidth
34304
34312
  }
34305
34313
  )
@@ -34477,7 +34485,7 @@ var init_LikertScale = __esm({
34477
34485
  md: "text-base",
34478
34486
  lg: "text-lg"
34479
34487
  };
34480
- LikertScale = React95__default.forwardRef(
34488
+ LikertScale = React93__default.forwardRef(
34481
34489
  ({
34482
34490
  question,
34483
34491
  options = DEFAULT_LIKERT_OPTIONS,
@@ -34489,7 +34497,7 @@ var init_LikertScale = __esm({
34489
34497
  variant = "radios",
34490
34498
  className
34491
34499
  }, ref) => {
34492
- const groupId = React95__default.useId();
34500
+ const groupId = React93__default.useId();
34493
34501
  const eventBus = useEventBus();
34494
34502
  const handleSelect = useCallback(
34495
34503
  (next) => {
@@ -35639,7 +35647,6 @@ function BlockRow({
35639
35647
  onUpdate,
35640
35648
  onDelete,
35641
35649
  onDuplicate,
35642
- onInsertAfter,
35643
35650
  onChangeType
35644
35651
  }) {
35645
35652
  const { t } = useTranslate();
@@ -35915,34 +35922,16 @@ function BlockRow({
35915
35922
  "data-block-id": block.id,
35916
35923
  "data-block-type": block.type,
35917
35924
  children: [
35918
- !readOnly && showAffordances && /* @__PURE__ */ jsxs(Box, { className: "flex w-12 shrink-0 items-center gap-0.5 pt-1", children: [
35919
- /* @__PURE__ */ jsx(
35920
- Button,
35921
- {
35922
- type: "button",
35923
- variant: "ghost",
35924
- "aria-label": t("richBlockEditor.insertParagraphBelow"),
35925
- className: cn(
35926
- "inline-flex h-6 w-6 items-center justify-center rounded-sm p-0 gap-0",
35927
- "text-muted-foreground hover:bg-muted hover:text-foreground",
35928
- "opacity-0 group-hover:opacity-100 focus-visible:opacity-100",
35929
- "transition-opacity"
35930
- ),
35931
- onClick: () => onInsertAfter("paragraph"),
35932
- children: /* @__PURE__ */ jsx(Icon, { name: "plus", className: "w-3.5 h-3.5" })
35933
- }
35934
- ),
35935
- /* @__PURE__ */ jsx(
35936
- BlockMenu,
35937
- {
35938
- block,
35939
- readOnly,
35940
- onDelete,
35941
- onDuplicate,
35942
- onChangeType
35943
- }
35944
- )
35945
- ] }),
35925
+ !readOnly && showAffordances && /* @__PURE__ */ jsx(Box, { className: "flex w-8 shrink-0 items-center pt-1", children: /* @__PURE__ */ jsx(
35926
+ BlockMenu,
35927
+ {
35928
+ block,
35929
+ readOnly,
35930
+ onDelete,
35931
+ onDuplicate,
35932
+ onChangeType
35933
+ }
35934
+ ) }),
35946
35935
  /* @__PURE__ */ jsx(Box, { className: "min-w-0 flex-1", children: renderBody() })
35947
35936
  ]
35948
35937
  }
@@ -36065,12 +36054,6 @@ var init_RichBlockEditor = __esm({
36065
36054
  },
36066
36055
  [blocks, commit]
36067
36056
  );
36068
- const handleInsertAfter = useCallback(
36069
- (id, type) => {
36070
- commit(insertAfter(blocks, id, createBlock(type)));
36071
- },
36072
- [blocks, commit]
36073
- );
36074
36057
  const handleChangeType = useCallback(
36075
36058
  (id, type) => {
36076
36059
  commit(
@@ -36127,7 +36110,6 @@ var init_RichBlockEditor = __esm({
36127
36110
  onUpdate: (updater) => handleUpdate(block.id, updater),
36128
36111
  onDelete: () => handleDelete(block.id),
36129
36112
  onDuplicate: () => handleDuplicate(block.id),
36130
- onInsertAfter: (type) => handleInsertAfter(block.id, type),
36131
36113
  onChangeType: (type) => handleChangeType(block.id, type)
36132
36114
  },
36133
36115
  block.id
@@ -36797,7 +36779,7 @@ var init_DocBreadcrumb = __esm({
36797
36779
  "aria-label": t("aria.breadcrumb"),
36798
36780
  children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
36799
36781
  const isLast = idx === items.length - 1;
36800
- return /* @__PURE__ */ jsxs(React95__default.Fragment, { children: [
36782
+ return /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
36801
36783
  idx > 0 && /* @__PURE__ */ jsx(
36802
36784
  Icon,
36803
36785
  {
@@ -36844,108 +36826,6 @@ var init_DocBreadcrumb = __esm({
36844
36826
  DocBreadcrumb.displayName = "DocBreadcrumb";
36845
36827
  }
36846
36828
  });
36847
- function DocCodeBlock({
36848
- code,
36849
- language,
36850
- title,
36851
- showLineNumbers = false,
36852
- className
36853
- }) {
36854
- const [copied, setCopied] = useState(false);
36855
- const handleCopy = useCallback(() => {
36856
- void navigator.clipboard.writeText(code).then(() => {
36857
- setCopied(true);
36858
- setTimeout(() => setCopied(false), 2e3);
36859
- });
36860
- }, [code]);
36861
- const lines = code.split("\n");
36862
- return /* @__PURE__ */ jsxs(
36863
- Box,
36864
- {
36865
- className: cn(
36866
- "rounded-container border border-border overflow-hidden",
36867
- className
36868
- ),
36869
- position: "relative",
36870
- children: [
36871
- title ? /* @__PURE__ */ jsxs(
36872
- HStack,
36873
- {
36874
- align: "center",
36875
- justify: "between",
36876
- className: "bg-muted px-4 py-2 border-b border-border",
36877
- children: [
36878
- /* @__PURE__ */ jsxs(HStack, { align: "center", gap: "sm", children: [
36879
- /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", children: title }),
36880
- language ? /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", children: language }) : null
36881
- ] }),
36882
- /* @__PURE__ */ jsx(
36883
- Button,
36884
- {
36885
- variant: "ghost",
36886
- size: "sm",
36887
- onClick: handleCopy,
36888
- leftIcon: copied ? "check" : "copy",
36889
- children: copied ? "Copied!" : "Copy"
36890
- }
36891
- )
36892
- ]
36893
- }
36894
- ) : null,
36895
- !title ? /* @__PURE__ */ jsx(Box, { position: "absolute", className: "top-2 right-2 z-10", children: /* @__PURE__ */ jsx(
36896
- Button,
36897
- {
36898
- variant: "ghost",
36899
- size: "sm",
36900
- onClick: handleCopy,
36901
- leftIcon: copied ? "check" : "copy",
36902
- children: copied ? "Copied!" : "Copy"
36903
- }
36904
- ) }) : null,
36905
- /* @__PURE__ */ jsxs(HStack, { gap: "none", className: "bg-foreground overflow-x-auto", children: [
36906
- showLineNumbers ? /* @__PURE__ */ jsx(
36907
- Box,
36908
- {
36909
- className: "py-4 pl-4 pr-3 select-none border-r border-border flex-shrink-0",
36910
- children: lines.map((_, i) => /* @__PURE__ */ jsx(
36911
- Typography,
36912
- {
36913
- variant: "caption",
36914
- color: "muted",
36915
- className: "block font-mono text-right leading-6",
36916
- as: "span",
36917
- children: i + 1
36918
- },
36919
- i
36920
- ))
36921
- }
36922
- ) : null,
36923
- /* @__PURE__ */ jsx(
36924
- Box,
36925
- {
36926
- as: "pre",
36927
- className: cn(
36928
- "p-4 font-mono text-sm text-background leading-6 flex-1 min-w-0",
36929
- !title && "pr-24"
36930
- ),
36931
- children: /* @__PURE__ */ jsx(Box, { as: "code", className: "whitespace-pre", children: code })
36932
- }
36933
- )
36934
- ] })
36935
- ]
36936
- }
36937
- );
36938
- }
36939
- var init_DocCodeBlock = __esm({
36940
- "components/core/molecules/DocCodeBlock.tsx"() {
36941
- "use client";
36942
- init_cn();
36943
- init_Box();
36944
- init_Stack();
36945
- init_Typography();
36946
- init_Button();
36947
- }
36948
- });
36949
36829
  function DocPagination({ prev, next, className }) {
36950
36830
  if (!prev && !next) return null;
36951
36831
  return /* @__PURE__ */ jsxs(
@@ -37382,17 +37262,25 @@ var init_DocTOC = __esm({
37382
37262
  DocTOC.displayName = "DocTOC";
37383
37263
  }
37384
37264
  });
37385
- var GradientDivider;
37265
+ var colorTokenVars2, GradientDivider;
37386
37266
  var init_GradientDivider = __esm({
37387
37267
  "components/core/molecules/GradientDivider.tsx"() {
37388
37268
  "use client";
37389
37269
  init_cn();
37390
37270
  init_Box();
37271
+ colorTokenVars2 = {
37272
+ primary: "var(--color-primary)",
37273
+ secondary: "var(--color-secondary)",
37274
+ success: "var(--color-success)",
37275
+ warning: "var(--color-warning)",
37276
+ error: "var(--color-error)",
37277
+ muted: "var(--color-muted)"
37278
+ };
37391
37279
  GradientDivider = ({
37392
37280
  color,
37393
37281
  className
37394
37282
  }) => {
37395
- const centerColor = color ?? "var(--color-primary)";
37283
+ const centerColor = color ? color in colorTokenVars2 ? colorTokenVars2[color] : color : "var(--color-primary)";
37396
37284
  return /* @__PURE__ */ jsx(
37397
37285
  Box,
37398
37286
  {
@@ -37556,7 +37444,7 @@ var init_PageHeader = __esm({
37556
37444
  info: "bg-info/10 text-info"
37557
37445
  };
37558
37446
  return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
37559
- breadcrumbs && breadcrumbs.length > 0 && /* @__PURE__ */ jsx(Box, { as: "nav", className: "mb-4", children: /* @__PURE__ */ jsx(Box, { as: "ol", className: "flex items-center gap-2 text-sm", children: breadcrumbs.map((crumb, idx) => /* @__PURE__ */ jsxs(React95__default.Fragment, { children: [
37447
+ breadcrumbs && breadcrumbs.length > 0 && /* @__PURE__ */ jsx(Box, { as: "nav", className: "mb-4", children: /* @__PURE__ */ jsx(Box, { as: "ol", className: "flex items-center gap-2 text-sm", children: breadcrumbs.map((crumb, idx) => /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
37560
37448
  idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
37561
37449
  crumb.href ? /* @__PURE__ */ jsx(
37562
37450
  "a",
@@ -38293,7 +38181,7 @@ var init_WizardContainer = __esm({
38293
38181
  const isCompleted = index < currentStep;
38294
38182
  const stepKey = step.id ?? step.tabId ?? `step-${index}`;
38295
38183
  const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
38296
- return /* @__PURE__ */ jsxs(React95__default.Fragment, { children: [
38184
+ return /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
38297
38185
  /* @__PURE__ */ jsx(
38298
38186
  Button,
38299
38187
  {
@@ -40578,7 +40466,7 @@ var init_DetailPanel = __esm({
40578
40466
  }
40579
40467
  });
40580
40468
  function extractTitle(children) {
40581
- if (!React95__default.isValidElement(children)) return void 0;
40469
+ if (!React93__default.isValidElement(children)) return void 0;
40582
40470
  const props = children.props;
40583
40471
  if (typeof props.title === "string") {
40584
40472
  return props.title;
@@ -40633,7 +40521,7 @@ function LinearView({
40633
40521
  /* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
40634
40522
  const isDone = i < currentIdx;
40635
40523
  const isCurrent = i === currentIdx;
40636
- return /* @__PURE__ */ jsxs(React95__default.Fragment, { children: [
40524
+ return /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
40637
40525
  i > 0 && /* @__PURE__ */ jsx(
40638
40526
  Typography,
40639
40527
  {
@@ -41591,12 +41479,12 @@ var init_Form = __esm({
41591
41479
  const isSchemaEntity = isOrbitalEntitySchema(entity);
41592
41480
  const resolvedEntity = isSchemaEntity ? entity : void 0;
41593
41481
  const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
41594
- const normalizedInitialData = React95__default.useMemo(() => {
41482
+ const normalizedInitialData = React93__default.useMemo(() => {
41595
41483
  const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
41596
41484
  const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
41597
41485
  return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
41598
41486
  }, [entity, initialData]);
41599
- const entityDerivedFields = React95__default.useMemo(() => {
41487
+ const entityDerivedFields = React93__default.useMemo(() => {
41600
41488
  if (fields && fields.length > 0) return void 0;
41601
41489
  if (!resolvedEntity) return void 0;
41602
41490
  return resolvedEntity.fields.map(
@@ -41616,16 +41504,16 @@ var init_Form = __esm({
41616
41504
  const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
41617
41505
  const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
41618
41506
  const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
41619
- const [formData, setFormData] = React95__default.useState(
41507
+ const [formData, setFormData] = React93__default.useState(
41620
41508
  normalizedInitialData
41621
41509
  );
41622
- const [collapsedSections, setCollapsedSections] = React95__default.useState(
41510
+ const [collapsedSections, setCollapsedSections] = React93__default.useState(
41623
41511
  /* @__PURE__ */ new Set()
41624
41512
  );
41625
- const [submitError, setSubmitError] = React95__default.useState(null);
41626
- const formRef = React95__default.useRef(null);
41513
+ const [submitError, setSubmitError] = React93__default.useState(null);
41514
+ const formRef = React93__default.useRef(null);
41627
41515
  const formMode = props.mode;
41628
- const mountedRef = React95__default.useRef(false);
41516
+ const mountedRef = React93__default.useRef(false);
41629
41517
  if (!mountedRef.current) {
41630
41518
  mountedRef.current = true;
41631
41519
  debug("forms", "mount", {
@@ -41638,7 +41526,7 @@ var init_Form = __esm({
41638
41526
  });
41639
41527
  }
41640
41528
  const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
41641
- const evalContext = React95__default.useMemo(
41529
+ const evalContext = React93__default.useMemo(
41642
41530
  () => ({
41643
41531
  formValues: formData,
41644
41532
  globalVariables: externalContext?.globalVariables ?? {},
@@ -41647,7 +41535,7 @@ var init_Form = __esm({
41647
41535
  }),
41648
41536
  [formData, externalContext]
41649
41537
  );
41650
- React95__default.useEffect(() => {
41538
+ React93__default.useEffect(() => {
41651
41539
  debug("forms", "initialData-sync", {
41652
41540
  mode: formMode,
41653
41541
  normalizedInitialData,
@@ -41658,7 +41546,7 @@ var init_Form = __esm({
41658
41546
  setFormData(normalizedInitialData);
41659
41547
  }
41660
41548
  }, [normalizedInitialData]);
41661
- const processCalculations = React95__default.useCallback(
41549
+ const processCalculations = React93__default.useCallback(
41662
41550
  (changedFieldId, newFormData) => {
41663
41551
  if (!hiddenCalculations.length) return;
41664
41552
  const context = {
@@ -41683,7 +41571,7 @@ var init_Form = __esm({
41683
41571
  },
41684
41572
  [hiddenCalculations, externalContext, eventBus]
41685
41573
  );
41686
- const checkViolations = React95__default.useCallback(
41574
+ const checkViolations = React93__default.useCallback(
41687
41575
  (changedFieldId, newFormData) => {
41688
41576
  if (!violationTriggers.length) return;
41689
41577
  const context = {
@@ -41721,7 +41609,7 @@ var init_Form = __esm({
41721
41609
  processCalculations(name, newFormData);
41722
41610
  checkViolations(name, newFormData);
41723
41611
  };
41724
- const isFieldVisible = React95__default.useCallback(
41612
+ const isFieldVisible = React93__default.useCallback(
41725
41613
  (fieldName) => {
41726
41614
  const condition = conditionalFields[fieldName];
41727
41615
  if (!condition) return true;
@@ -41729,7 +41617,7 @@ var init_Form = __esm({
41729
41617
  },
41730
41618
  [conditionalFields, evalContext]
41731
41619
  );
41732
- const isSectionVisible = React95__default.useCallback(
41620
+ const isSectionVisible = React93__default.useCallback(
41733
41621
  (section) => {
41734
41622
  if (!section.condition) return true;
41735
41623
  return Boolean(evaluateFormExpression(section.condition, evalContext));
@@ -41805,7 +41693,7 @@ var init_Form = __esm({
41805
41693
  eventBus.emit(`UI:${onCancel}`);
41806
41694
  }
41807
41695
  };
41808
- const renderField = React95__default.useCallback(
41696
+ const renderField = React93__default.useCallback(
41809
41697
  (field) => {
41810
41698
  const fieldName = field.name || field.field;
41811
41699
  if (!fieldName) return null;
@@ -41826,7 +41714,7 @@ var init_Form = __esm({
41826
41714
  [formData, isFieldVisible, relationsData, relationsLoading, isLoading]
41827
41715
  );
41828
41716
  const effectiveFields = entityDerivedFields ?? fields;
41829
- const normalizedFields = React95__default.useMemo(() => {
41717
+ const normalizedFields = React93__default.useMemo(() => {
41830
41718
  if (!effectiveFields || effectiveFields.length === 0) return [];
41831
41719
  return effectiveFields.map((field) => {
41832
41720
  if (typeof field === "string") {
@@ -41849,7 +41737,7 @@ var init_Form = __esm({
41849
41737
  return field;
41850
41738
  });
41851
41739
  }, [effectiveFields, resolvedEntity]);
41852
- const schemaFields = React95__default.useMemo(() => {
41740
+ const schemaFields = React93__default.useMemo(() => {
41853
41741
  if (normalizedFields.length === 0) return null;
41854
41742
  if (isDebugEnabled()) {
41855
41743
  debugGroup(`Form: ${entityName || "unknown"}`);
@@ -41859,7 +41747,7 @@ var init_Form = __esm({
41859
41747
  }
41860
41748
  return normalizedFields.map(renderField).filter(Boolean);
41861
41749
  }, [normalizedFields, renderField, entityName, conditionalFields]);
41862
- const sectionElements = React95__default.useMemo(() => {
41750
+ const sectionElements = React93__default.useMemo(() => {
41863
41751
  if (!sections || sections.length === 0) return null;
41864
41752
  return sections.map((section) => {
41865
41753
  if (!isSectionVisible(section)) {
@@ -43134,7 +43022,7 @@ var init_List = __esm({
43134
43022
  if (entity && typeof entity === "object" && "id" in entity) return [entity];
43135
43023
  return [];
43136
43024
  }, [entity]);
43137
- const getItemActions = React95__default.useCallback(
43025
+ const getItemActions = React93__default.useCallback(
43138
43026
  (item) => {
43139
43027
  if (!itemActions) return [];
43140
43028
  if (typeof itemActions === "function") {
@@ -43610,7 +43498,7 @@ var init_MediaGallery = __esm({
43610
43498
  [selectable, selectedItems, selectionEvent, eventBus]
43611
43499
  );
43612
43500
  const entityData = Array.isArray(entity) ? entity : [];
43613
- const items = React95__default.useMemo(() => {
43501
+ const items = React93__default.useMemo(() => {
43614
43502
  if (propItems) return propItems;
43615
43503
  if (entityData.length === 0) return [];
43616
43504
  return entityData.map((record, idx) => ({
@@ -43771,7 +43659,7 @@ var init_MediaGallery = __esm({
43771
43659
  }
43772
43660
  });
43773
43661
  function extractTitle2(children) {
43774
- if (!React95__default.isValidElement(children)) return void 0;
43662
+ if (!React93__default.isValidElement(children)) return void 0;
43775
43663
  const props = children.props;
43776
43664
  if (typeof props.title === "string") {
43777
43665
  return props.title;
@@ -44202,7 +44090,7 @@ var init_debugRegistry = __esm({
44202
44090
  }
44203
44091
  });
44204
44092
  function useDebugData() {
44205
- const [data, setData] = React95.useState(() => ({
44093
+ const [data, setData] = React93.useState(() => ({
44206
44094
  traits: [],
44207
44095
  ticks: [],
44208
44096
  guards: [],
@@ -44216,7 +44104,7 @@ function useDebugData() {
44216
44104
  },
44217
44105
  lastUpdate: Date.now()
44218
44106
  }));
44219
- React95.useEffect(() => {
44107
+ React93.useEffect(() => {
44220
44108
  const updateData = () => {
44221
44109
  setData({
44222
44110
  traits: getAllTraits(),
@@ -44325,12 +44213,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
44325
44213
  return positions;
44326
44214
  }
44327
44215
  function WalkMinimap() {
44328
- const [walkStep, setWalkStep] = React95.useState(null);
44329
- const [traits2, setTraits] = React95.useState([]);
44330
- const [coveredEdges, setCoveredEdges] = React95.useState([]);
44331
- const [completedTraits, setCompletedTraits] = React95.useState(/* @__PURE__ */ new Set());
44332
- const prevTraitRef = React95.useRef(null);
44333
- React95.useEffect(() => {
44216
+ const [walkStep, setWalkStep] = React93.useState(null);
44217
+ const [traits2, setTraits] = React93.useState([]);
44218
+ const [coveredEdges, setCoveredEdges] = React93.useState([]);
44219
+ const [completedTraits, setCompletedTraits] = React93.useState(/* @__PURE__ */ new Set());
44220
+ const prevTraitRef = React93.useRef(null);
44221
+ React93.useEffect(() => {
44334
44222
  const interval = setInterval(() => {
44335
44223
  const w = window;
44336
44224
  const step = w.__orbitalWalkStep;
@@ -44766,15 +44654,15 @@ var init_EntitiesTab = __esm({
44766
44654
  });
44767
44655
  function EventFlowTab({ events: events2 }) {
44768
44656
  const { t } = useTranslate();
44769
- const [filter, setFilter] = React95.useState("all");
44770
- const containerRef = React95.useRef(null);
44771
- const [autoScroll, setAutoScroll] = React95.useState(true);
44772
- React95.useEffect(() => {
44657
+ const [filter, setFilter] = React93.useState("all");
44658
+ const containerRef = React93.useRef(null);
44659
+ const [autoScroll, setAutoScroll] = React93.useState(true);
44660
+ React93.useEffect(() => {
44773
44661
  if (autoScroll && containerRef.current) {
44774
44662
  containerRef.current.scrollTop = containerRef.current.scrollHeight;
44775
44663
  }
44776
44664
  }, [events2.length, autoScroll]);
44777
- const filteredEvents = React95.useMemo(() => {
44665
+ const filteredEvents = React93.useMemo(() => {
44778
44666
  if (filter === "all") return events2;
44779
44667
  return events2.filter((e) => e.type === filter);
44780
44668
  }, [events2, filter]);
@@ -44890,7 +44778,7 @@ var init_EventFlowTab = __esm({
44890
44778
  });
44891
44779
  function GuardsPanel({ guards }) {
44892
44780
  const { t } = useTranslate();
44893
- const [filter, setFilter] = React95.useState("all");
44781
+ const [filter, setFilter] = React93.useState("all");
44894
44782
  if (guards.length === 0) {
44895
44783
  return /* @__PURE__ */ jsx(
44896
44784
  EmptyState,
@@ -44903,7 +44791,7 @@ function GuardsPanel({ guards }) {
44903
44791
  }
44904
44792
  const passedCount = guards.filter((g) => g.result).length;
44905
44793
  const failedCount = guards.length - passedCount;
44906
- const filteredGuards = React95.useMemo(() => {
44794
+ const filteredGuards = React93.useMemo(() => {
44907
44795
  if (filter === "all") return guards;
44908
44796
  if (filter === "passed") return guards.filter((g) => g.result);
44909
44797
  return guards.filter((g) => !g.result);
@@ -45066,10 +44954,10 @@ function EffectBadge({ effect }) {
45066
44954
  }
45067
44955
  function TransitionTimeline({ transitions }) {
45068
44956
  const { t } = useTranslate();
45069
- const containerRef = React95.useRef(null);
45070
- const [autoScroll, setAutoScroll] = React95.useState(true);
45071
- const [expandedId, setExpandedId] = React95.useState(null);
45072
- React95.useEffect(() => {
44957
+ const containerRef = React93.useRef(null);
44958
+ const [autoScroll, setAutoScroll] = React93.useState(true);
44959
+ const [expandedId, setExpandedId] = React93.useState(null);
44960
+ React93.useEffect(() => {
45073
44961
  if (autoScroll && containerRef.current) {
45074
44962
  containerRef.current.scrollTop = containerRef.current.scrollHeight;
45075
44963
  }
@@ -45349,9 +45237,9 @@ function getAllEvents(traits2) {
45349
45237
  function EventDispatcherTab({ traits: traits2, schema }) {
45350
45238
  const eventBus = useEventBus();
45351
45239
  const { t } = useTranslate();
45352
- const [log13, setLog] = React95.useState([]);
45353
- const prevStatesRef = React95.useRef(/* @__PURE__ */ new Map());
45354
- React95.useEffect(() => {
45240
+ const [log13, setLog] = React93.useState([]);
45241
+ const prevStatesRef = React93.useRef(/* @__PURE__ */ new Map());
45242
+ React93.useEffect(() => {
45355
45243
  for (const trait of traits2) {
45356
45244
  const prev = prevStatesRef.current.get(trait.id);
45357
45245
  if (prev && prev !== trait.currentState) {
@@ -45520,10 +45408,10 @@ function VerifyModePanel({
45520
45408
  localCount
45521
45409
  }) {
45522
45410
  const { t } = useTranslate();
45523
- const [expanded, setExpanded] = React95.useState(true);
45524
- const scrollRef = React95.useRef(null);
45525
- const prevCountRef = React95.useRef(0);
45526
- React95.useEffect(() => {
45411
+ const [expanded, setExpanded] = React93.useState(true);
45412
+ const scrollRef = React93.useRef(null);
45413
+ const prevCountRef = React93.useRef(0);
45414
+ React93.useEffect(() => {
45527
45415
  if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
45528
45416
  scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
45529
45417
  }
@@ -45580,10 +45468,10 @@ function RuntimeDebugger({
45580
45468
  schema
45581
45469
  }) {
45582
45470
  const { t } = useTranslate();
45583
- const [isCollapsed, setIsCollapsed] = React95.useState(mode === "verify" ? true : defaultCollapsed);
45584
- const [isVisible, setIsVisible] = React95.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
45471
+ const [isCollapsed, setIsCollapsed] = React93.useState(mode === "verify" ? true : defaultCollapsed);
45472
+ const [isVisible, setIsVisible] = React93.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
45585
45473
  const debugData = useDebugData();
45586
- React95.useEffect(() => {
45474
+ React93.useEffect(() => {
45587
45475
  if (mode === "inline") return;
45588
45476
  return onDebugToggle((enabled) => {
45589
45477
  setIsVisible(enabled);
@@ -45592,7 +45480,7 @@ function RuntimeDebugger({
45592
45480
  }
45593
45481
  });
45594
45482
  }, [mode]);
45595
- React95.useEffect(() => {
45483
+ React93.useEffect(() => {
45596
45484
  if (mode === "inline") return;
45597
45485
  const handleKeyDown = (e) => {
45598
45486
  if (e.key === "`" && isVisible) {
@@ -46041,7 +45929,7 @@ function SequenceBar({
46041
45929
  onSlotRemove(index);
46042
45930
  }, [onSlotRemove, playing]);
46043
45931
  const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
46044
- return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React95__default.Fragment, { children: [
45932
+ return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
46045
45933
  i > 0 && /* @__PURE__ */ jsx(
46046
45934
  Typography,
46047
45935
  {
@@ -47020,7 +46908,7 @@ var init_StatCard = __esm({
47020
46908
  const labelToUse = propLabel ?? propTitle;
47021
46909
  const eventBus = useEventBus();
47022
46910
  const { t } = useTranslate();
47023
- const handleActionClick = React95__default.useCallback(() => {
46911
+ const handleActionClick = React93__default.useCallback(() => {
47024
46912
  if (action?.event) {
47025
46913
  eventBus.emit(`UI:${action.event}`, {});
47026
46914
  }
@@ -47031,7 +46919,7 @@ var init_StatCard = __esm({
47031
46919
  const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
47032
46920
  const isLoading = externalLoading ?? false;
47033
46921
  const error = externalError;
47034
- const computeMetricValue = React95__default.useCallback(
46922
+ const computeMetricValue = React93__default.useCallback(
47035
46923
  (metric, items) => {
47036
46924
  if (metric.value !== void 0) {
47037
46925
  return metric.value;
@@ -47070,7 +46958,7 @@ var init_StatCard = __esm({
47070
46958
  },
47071
46959
  []
47072
46960
  );
47073
- const schemaStats = React95__default.useMemo(() => {
46961
+ const schemaStats = React93__default.useMemo(() => {
47074
46962
  if (!metrics || metrics.length === 0) return null;
47075
46963
  return metrics.map((metric) => ({
47076
46964
  label: metric.label,
@@ -47078,7 +46966,7 @@ var init_StatCard = __esm({
47078
46966
  format: metric.format
47079
46967
  }));
47080
46968
  }, [metrics, data, computeMetricValue]);
47081
- const calculatedTrend = React95__default.useMemo(() => {
46969
+ const calculatedTrend = React93__default.useMemo(() => {
47082
46970
  if (manualTrend !== void 0) return manualTrend;
47083
46971
  if (previousValue === void 0 || currentValue === void 0)
47084
46972
  return void 0;
@@ -47359,6 +47247,37 @@ var init_VariablePanel = __esm({
47359
47247
  VariablePanel.displayName = "VariablePanel";
47360
47248
  }
47361
47249
  });
47250
+ function StateJsonView({
47251
+ data,
47252
+ label,
47253
+ defaultExpanded = false,
47254
+ className
47255
+ }) {
47256
+ const { t } = useTranslate();
47257
+ const [expanded, setExpanded] = useState(defaultExpanded);
47258
+ const jsonString = JSON.stringify(data, null, 2);
47259
+ return /* @__PURE__ */ jsxs(VStack, { className: cn("rounded-lg border border-border overflow-hidden", className), gap: "none", children: [
47260
+ /* @__PURE__ */ jsxs(HStack, { className: "items-center justify-between p-2 bg-muted", gap: "sm", children: [
47261
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-muted-foreground font-medium", children: label ?? t("stateArchitect.viewCode") }),
47262
+ /* @__PURE__ */ jsx(Button, { variant: "ghost", onClick: () => setExpanded(!expanded), className: "text-xs", children: expanded ? t("stateArchitect.hideJson") : t("stateArchitect.showJson") })
47263
+ ] }),
47264
+ expanded && /* @__PURE__ */ jsx(Box, { className: "p-3 bg-background overflow-x-auto", children: /* @__PURE__ */ jsx(
47265
+ Typography,
47266
+ {
47267
+ variant: "caption",
47268
+ className: "text-foreground font-mono whitespace-pre text-xs leading-relaxed block",
47269
+ children: jsonString
47270
+ }
47271
+ ) })
47272
+ ] });
47273
+ }
47274
+ var init_StateJsonView = __esm({
47275
+ "components/game/organisms/puzzles/state-architect/StateJsonView.tsx"() {
47276
+ init_atoms2();
47277
+ init_cn();
47278
+ StateJsonView.displayName = "StateJsonView";
47279
+ }
47280
+ });
47362
47281
  function layoutStates(states, width, height) {
47363
47282
  const cx = width / 2;
47364
47283
  const cy = height / 2;
@@ -47650,7 +47569,7 @@ function StateArchitectBoard({
47650
47569
  !r2.passed && /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-error", children: t("stateArchitect.gotState", { state: r2.actualState }) })
47651
47570
  ] }, i))
47652
47571
  ] }),
47653
- resolved.showCodeView !== false && /* @__PURE__ */ jsx(CodeView, { data: codeData, label: "View Code" })
47572
+ resolved.showCodeView !== false && /* @__PURE__ */ jsx(StateJsonView, { data: codeData, label: "View Code" })
47654
47573
  ] })
47655
47574
  ] }),
47656
47575
  playState === "success" && /* @__PURE__ */ jsx(Box, { className: "p-4 rounded-container bg-success/20 border border-success text-center", children: /* @__PURE__ */ jsx(Typography, { variant: "h5", className: "text-success", children: str(resolved.successMessage) || t("stateArchitect.allPassed") }) }),
@@ -47687,7 +47606,7 @@ var init_StateArchitectBoard = __esm({
47687
47606
  init_StateNode();
47688
47607
  init_TransitionArrow();
47689
47608
  init_VariablePanel();
47690
- init_CodeView();
47609
+ init_StateJsonView();
47691
47610
  init_boardEntity();
47692
47611
  ENCOURAGEMENT_KEYS3 = [
47693
47612
  "puzzle.tryAgain1",
@@ -48012,7 +47931,7 @@ var init_Timeline = __esm({
48012
47931
  }) => {
48013
47932
  const { t } = useTranslate();
48014
47933
  const entityData = Array.isArray(entity) ? entity : [];
48015
- const items = React95__default.useMemo(() => {
47934
+ const items = React93__default.useMemo(() => {
48016
47935
  if (propItems) return propItems;
48017
47936
  if (entityData.length === 0) return [];
48018
47937
  return entityData.map((record, idx) => {
@@ -48119,7 +48038,7 @@ var init_Timeline = __esm({
48119
48038
  }
48120
48039
  });
48121
48040
  function extractToastProps(children) {
48122
- if (!React95__default.isValidElement(children)) {
48041
+ if (!React93__default.isValidElement(children)) {
48123
48042
  if (typeof children === "string") {
48124
48043
  return { message: children };
48125
48044
  }
@@ -48157,7 +48076,7 @@ var init_ToastSlot = __esm({
48157
48076
  eventBus.emit("UI:CLOSE");
48158
48077
  };
48159
48078
  if (!isVisible) return null;
48160
- const isCustomContent = React95__default.isValidElement(children) && !message;
48079
+ const isCustomContent = React93__default.isValidElement(children) && !message;
48161
48080
  return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
48162
48081
  Toast,
48163
48082
  {
@@ -48667,12 +48586,12 @@ var init_WorldMapTemplate = __esm({
48667
48586
  }
48668
48587
  });
48669
48588
  function lazyThree(name, loader) {
48670
- const Lazy = React95__default.lazy(() => loader().then((m) => ({ default: m[name] })));
48589
+ const Lazy = React93__default.lazy(() => loader().then((m) => ({ default: m[name] })));
48671
48590
  function ThreeWrapper(props) {
48672
- return React95__default.createElement(
48673
- React95__default.Suspense,
48591
+ return React93__default.createElement(
48592
+ React93__default.Suspense,
48674
48593
  { fallback: null },
48675
- React95__default.createElement(Lazy, props)
48594
+ React93__default.createElement(Lazy, props)
48676
48595
  );
48677
48596
  }
48678
48597
  ThreeWrapper.displayName = `Lazy(${name})`;
@@ -48720,8 +48639,6 @@ var init_component_registry_generated = __esm({
48720
48639
  init_ChoiceButton();
48721
48640
  init_ClassifierBoard();
48722
48641
  init_CodeBlock();
48723
- init_CodeView();
48724
- init_CodeViewer();
48725
48642
  init_CombatLog();
48726
48643
  init_ComboCounter();
48727
48644
  init_CommunityLinks();
@@ -48749,7 +48666,6 @@ var init_component_registry_generated = __esm({
48749
48666
  init_DialogueBox();
48750
48667
  init_DialogueBubble();
48751
48668
  init_DocBreadcrumb();
48752
- init_DocCodeBlock();
48753
48669
  init_DocPagination();
48754
48670
  init_DocSearch();
48755
48671
  init_DocSidebar();
@@ -48887,6 +48803,7 @@ var init_component_registry_generated = __esm({
48887
48803
  init_StatDisplay();
48888
48804
  init_StateArchitectBoard();
48889
48805
  init_StateIndicator();
48806
+ init_StateJsonView();
48890
48807
  init_StateMachineView();
48891
48808
  init_StateNode();
48892
48809
  init_StatsGrid();
@@ -49004,8 +48921,6 @@ var init_component_registry_generated = __esm({
49004
48921
  "ChoiceButton": ChoiceButton,
49005
48922
  "ClassifierBoard": ClassifierBoard,
49006
48923
  "CodeBlock": CodeBlock,
49007
- "CodeView": CodeView,
49008
- "CodeViewer": CodeViewer,
49009
48924
  "CombatLog": CombatLog,
49010
48925
  "ComboCounter": ComboCounter,
49011
48926
  "CommunityLinks": CommunityLinks,
@@ -49037,7 +48952,6 @@ var init_component_registry_generated = __esm({
49037
48952
  "Divider": DividerPattern,
49038
48953
  "DividerPattern": DividerPattern,
49039
48954
  "DocBreadcrumb": DocBreadcrumb,
49040
- "DocCodeBlock": DocCodeBlock,
49041
48955
  "DocPagination": DocPagination,
49042
48956
  "DocSearch": DocSearch,
49043
48957
  "DocSidebar": DocSidebar,
@@ -49204,6 +49118,7 @@ var init_component_registry_generated = __esm({
49204
49118
  "StatDisplay": StatDisplay,
49205
49119
  "StateArchitectBoard": StateArchitectBoard,
49206
49120
  "StateIndicator": StateIndicator,
49121
+ "StateJsonView": StateJsonView,
49207
49122
  "StateMachineView": StateMachineView,
49208
49123
  "StateNode": StateNode2,
49209
49124
  "StatsGrid": StatsGrid,
@@ -49288,7 +49203,7 @@ function SuspenseConfigProvider({
49288
49203
  config,
49289
49204
  children
49290
49205
  }) {
49291
- return React95__default.createElement(
49206
+ return React93__default.createElement(
49292
49207
  SuspenseConfigContext.Provider,
49293
49208
  { value: config },
49294
49209
  children
@@ -49778,7 +49693,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
49778
49693
  const key = `${parentId}-${index}-trait:${traitName}`;
49779
49694
  return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
49780
49695
  }
49781
- return /* @__PURE__ */ jsx(React95__default.Fragment, { children: child }, `${parentId}-${index}`);
49696
+ return /* @__PURE__ */ jsx(React93__default.Fragment, { children: child }, `${parentId}-${index}`);
49782
49697
  }
49783
49698
  if (!child || typeof child !== "object") return null;
49784
49699
  const childId = `${parentId}-${index}`;
@@ -49818,14 +49733,14 @@ function isPatternConfig(value) {
49818
49733
  if (value === null || value === void 0) return false;
49819
49734
  if (typeof value !== "object") return false;
49820
49735
  if (Array.isArray(value)) return false;
49821
- if (React95__default.isValidElement(value)) return false;
49736
+ if (React93__default.isValidElement(value)) return false;
49822
49737
  if (value instanceof Date) return false;
49823
49738
  if (typeof value === "function") return false;
49824
49739
  const record = value;
49825
49740
  return "type" in record && typeof record.type === "string";
49826
49741
  }
49827
49742
  function isPlainConfigObject(value) {
49828
- if (React95__default.isValidElement(value)) return false;
49743
+ if (React93__default.isValidElement(value)) return false;
49829
49744
  if (value instanceof Date) return false;
49830
49745
  const proto = Object.getPrototypeOf(value);
49831
49746
  return proto === Object.prototype || proto === null;
@@ -50314,7 +50229,7 @@ var AvlTransition = ({
50314
50229
  opacity = 1,
50315
50230
  className
50316
50231
  }) => {
50317
- const ids = React95__default.useMemo(() => {
50232
+ const ids = React93__default.useMemo(() => {
50318
50233
  avlTransitionId += 1;
50319
50234
  return { arrow: `avl-tr-${avlTransitionId}-arrow` };
50320
50235
  }, []);
@@ -50875,7 +50790,7 @@ var AvlStateMachine = ({
50875
50790
  color = "var(--color-primary)",
50876
50791
  animated = false
50877
50792
  }) => {
50878
- const ids = React95__default.useMemo(() => {
50793
+ const ids = React93__default.useMemo(() => {
50879
50794
  avlSmId += 1;
50880
50795
  const base = `avl-sm-${avlSmId}`;
50881
50796
  return { glow: `${base}-glow`, grad: `${base}-grad` };
@@ -51074,7 +50989,7 @@ var AvlOrbitalUnit = ({
51074
50989
  color = "var(--color-primary)",
51075
50990
  animated = false
51076
50991
  }) => {
51077
- const ids = React95__default.useMemo(() => {
50992
+ const ids = React93__default.useMemo(() => {
51078
50993
  avlOuId += 1;
51079
50994
  const base = `avl-ou-${avlOuId}`;
51080
50995
  return { glow: `${base}-glow`, grad: `${base}-grad` };
@@ -51170,7 +51085,7 @@ var AvlClosedCircuit = ({
51170
51085
  color = "var(--color-primary)",
51171
51086
  animated = false
51172
51087
  }) => {
51173
- const ids = React95__default.useMemo(() => {
51088
+ const ids = React93__default.useMemo(() => {
51174
51089
  avlCcId += 1;
51175
51090
  const base = `avl-cc-${avlCcId}`;
51176
51091
  return { glow: `${base}-glow`, grad: `${base}-grad`, arrow: `${base}-arrow` };
@@ -51325,7 +51240,7 @@ var AvlEmitListen = ({
51325
51240
  color = "var(--color-primary)",
51326
51241
  animated = false
51327
51242
  }) => {
51328
- const ids = React95__default.useMemo(() => {
51243
+ const ids = React93__default.useMemo(() => {
51329
51244
  avlElId += 1;
51330
51245
  const base = `avl-el-${avlElId}`;
51331
51246
  return { arrow: `${base}-arrow`, grad: `${base}-grad` };
@@ -51599,7 +51514,7 @@ function renderNode(node, color, glowId) {
51599
51514
  const baseR = node.type === "operator" ? 20 : 16;
51600
51515
  const r2 = Math.max(baseR, labelLen * 3.5 + 6);
51601
51516
  const nc = nodeColor(node.type, color);
51602
- return /* @__PURE__ */ jsxs(React95__default.Fragment, { children: [
51517
+ return /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
51603
51518
  node.children.map((child, i) => {
51604
51519
  const childR = Math.max(
51605
51520
  child.type === "operator" ? 20 : 16,
@@ -51656,7 +51571,7 @@ var AvlExprTree = ({
51656
51571
  className,
51657
51572
  color = "var(--color-primary)"
51658
51573
  }) => {
51659
- const ids = React95__default.useMemo(() => {
51574
+ const ids = React93__default.useMemo(() => {
51660
51575
  avlEtId += 1;
51661
51576
  return { glow: `avl-et-${avlEtId}-glow` };
51662
51577
  }, []);
@@ -52480,7 +52395,7 @@ var SystemNode = ({ data }) => {
52480
52395
  stateChain.length > 0 && /* @__PURE__ */ jsx("svg", { width: stateChain.length * 14 + 2, height: 10, viewBox: `0 0 ${stateChain.length * 14 + 2} 10`, children: stateChain.map((s, i) => {
52481
52396
  const tc = transitionCounts[s.name] ?? 0;
52482
52397
  const role = getStateRole(s.name, s.isInitial, s.isTerminal, tc, maxTC);
52483
- return /* @__PURE__ */ jsxs(React95__default.Fragment, { children: [
52398
+ return /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
52484
52399
  /* @__PURE__ */ jsx(AvlState, { x: i * 14 + 1, y: 1, width: 10, height: 8, name: "", role, isInitial: s.isInitial, isTerminal: s.isTerminal }),
52485
52400
  i < stateChain.length - 1 && /* @__PURE__ */ jsx("line", { x1: i * 14 + 12, y1: 5, x2: i * 14 + 15, y2: 5, stroke: "var(--color-border)", strokeWidth: 0.5 })
52486
52401
  ] }, s.name);
@@ -53632,7 +53547,7 @@ function resolveLambdaBindings(body, params, item, index) {
53632
53547
  if (Array.isArray(body)) {
53633
53548
  return body.map((b) => recur(b));
53634
53549
  }
53635
- if (body !== null && typeof body === "object" && !React95__default.isValidElement(body) && !(body instanceof Date) && typeof body !== "function") {
53550
+ if (body !== null && typeof body === "object" && !React93__default.isValidElement(body) && !(body instanceof Date) && typeof body !== "function") {
53636
53551
  const out = {};
53637
53552
  for (const [k, v] of Object.entries(body)) {
53638
53553
  out[k] = recur(v);
@@ -53651,7 +53566,7 @@ function getSlotContentRenderer2() {
53651
53566
  function makeLambdaFn(params, lambdaBody, callerKey) {
53652
53567
  return (item, index) => {
53653
53568
  const resolvedBody = resolveLambdaBindings(lambdaBody, params, item, index);
53654
- if (resolvedBody === null || typeof resolvedBody !== "object" || Array.isArray(resolvedBody) || typeof resolvedBody === "function" || React95__default.isValidElement(resolvedBody) || resolvedBody instanceof Date) {
53569
+ if (resolvedBody === null || typeof resolvedBody !== "object" || Array.isArray(resolvedBody) || typeof resolvedBody === "function" || React93__default.isValidElement(resolvedBody) || resolvedBody instanceof Date) {
53655
53570
  return null;
53656
53571
  }
53657
53572
  const record = resolvedBody;
@@ -53670,7 +53585,7 @@ function makeLambdaFn(params, lambdaBody, callerKey) {
53670
53585
  props: childProps,
53671
53586
  priority: 0
53672
53587
  };
53673
- return React95__default.createElement(SlotContentRenderer2, { content: childContent });
53588
+ return React93__default.createElement(SlotContentRenderer2, { content: childContent });
53674
53589
  };
53675
53590
  }
53676
53591
  function convertNode(node, callerKey) {
@@ -53689,7 +53604,7 @@ function convertNode(node, callerKey) {
53689
53604
  });
53690
53605
  return anyChanged ? mapped : node;
53691
53606
  }
53692
- if (typeof node === "object" && !React95__default.isValidElement(node) && !(node instanceof Date)) {
53607
+ if (typeof node === "object" && !React93__default.isValidElement(node) && !(node instanceof Date)) {
53693
53608
  return convertObjectProps(node);
53694
53609
  }
53695
53610
  return node;
@@ -55702,8 +55617,8 @@ function CanvasDndProvider({
55702
55617
  }) {
55703
55618
  const eventBus = useEventBus();
55704
55619
  const sensors = useAlmadarDndSensors(false);
55705
- const [activePayload, setActivePayload] = React95__default.useState(null);
55706
- const handleDragStart = React95__default.useCallback((e) => {
55620
+ const [activePayload, setActivePayload] = React93__default.useState(null);
55621
+ const handleDragStart = React93__default.useCallback((e) => {
55707
55622
  const data = e.active.data.current;
55708
55623
  const payload = data?.payload;
55709
55624
  if (payload) {
@@ -55714,7 +55629,7 @@ function CanvasDndProvider({
55714
55629
  log11.warn("dragStart:missing-payload", { id: e.active.id });
55715
55630
  }
55716
55631
  }, [eventBus]);
55717
- const handleDragEnd = React95__default.useCallback((e) => {
55632
+ const handleDragEnd = React93__default.useCallback((e) => {
55718
55633
  setActivePayload(null);
55719
55634
  const activeData = e.active.data.current;
55720
55635
  const payload = activeData?.payload;
@@ -55743,7 +55658,7 @@ function CanvasDndProvider({
55743
55658
  const suppressed = onDrop ? onDrop(drop) === true : false;
55744
55659
  if (!suppressed) defaultEmit(eventBus, drop);
55745
55660
  }, [eventBus, onDrop]);
55746
- const handleDragCancel = React95__default.useCallback(() => {
55661
+ const handleDragCancel = React93__default.useCallback(() => {
55747
55662
  setActivePayload(null);
55748
55663
  log11.info("dragCancel");
55749
55664
  }, []);
@@ -56497,7 +56412,7 @@ var OrbPreviewNodeInner = (props) => {
56497
56412
  }
56498
56413
  );
56499
56414
  };
56500
- var OrbPreviewNode = React95__default.memo(OrbPreviewNodeInner);
56415
+ var OrbPreviewNode = React93__default.memo(OrbPreviewNodeInner);
56501
56416
  OrbPreviewNode.displayName = "OrbPreviewNode";
56502
56417
  orbPreviewLog.debug("export-resolved", () => ({
56503
56418
  type: typeof OrbPreviewNode,
@@ -56602,7 +56517,7 @@ var EventFlowEdgeInner = (props) => {
56602
56517
  ) })
56603
56518
  ] });
56604
56519
  };
56605
- var EventFlowEdge = React95__default.memo(EventFlowEdgeInner);
56520
+ var EventFlowEdge = React93__default.memo(EventFlowEdgeInner);
56606
56521
  EventFlowEdge.displayName = "EventFlowEdge";
56607
56522
 
56608
56523
  // components/avl/molecules/BehaviorComposeNode.tsx
@@ -56749,7 +56664,7 @@ var BehaviorComposeNodeInner = (props) => {
56749
56664
  }
56750
56665
  );
56751
56666
  };
56752
- var BehaviorComposeNode = React95__default.memo(BehaviorComposeNodeInner);
56667
+ var BehaviorComposeNode = React93__default.memo(BehaviorComposeNodeInner);
56753
56668
  BehaviorComposeNode.displayName = "BehaviorComposeNode";
56754
56669
 
56755
56670
  // components/avl/molecules/avl-behavior-compose-converter.ts
@@ -57761,7 +57676,7 @@ var TraitCardNodeInner = (props) => {
57761
57676
  }
57762
57677
  );
57763
57678
  };
57764
- var TraitCardNode = React95__default.memo(TraitCardNodeInner);
57679
+ var TraitCardNode = React93__default.memo(TraitCardNodeInner);
57765
57680
  TraitCardNode.displayName = "TraitCardNode";
57766
57681
 
57767
57682
  // components/avl/organisms/FlowCanvas.tsx
@@ -57834,7 +57749,7 @@ function FlowCanvasInner({
57834
57749
  initialOrbital
57835
57750
  );
57836
57751
  const [expandedBehaviorAlias, setExpandedBehaviorAlias] = useState(void 0);
57837
- const screenSizeUserOverrideRef = React95__default.useRef(false);
57752
+ const screenSizeUserOverrideRef = React93__default.useRef(false);
57838
57753
  const [screenSize, setScreenSize] = useState(
57839
57754
  () => typeof window === "undefined" ? "laptop" : detectScreenSize(window.innerWidth)
57840
57755
  );
@@ -58218,7 +58133,7 @@ var ZoomBreadcrumb = ({
58218
58133
  if (eventName && band === "detail") {
58219
58134
  segments.push({ icon: "\u26A1", label: eventName });
58220
58135
  }
58221
- return /* @__PURE__ */ jsx("div", { className: "absolute top-2 left-2 z-10 flex items-center gap-1 px-2 py-1 rounded-md bg-card/90 border border-border text-xs text-muted-foreground backdrop-blur-sm", children: segments.map((seg, i) => /* @__PURE__ */ jsxs(React95__default.Fragment, { children: [
58136
+ return /* @__PURE__ */ jsx("div", { className: "absolute top-2 left-2 z-10 flex items-center gap-1 px-2 py-1 rounded-md bg-card/90 border border-border text-xs text-muted-foreground backdrop-blur-sm", children: segments.map((seg, i) => /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
58222
58137
  i > 0 && /* @__PURE__ */ jsx("span", { className: "opacity-40", children: ">" }),
58223
58138
  /* @__PURE__ */ jsx("span", { className: "opacity-60", children: seg.icon }),
58224
58139
  /* @__PURE__ */ jsx("span", { children: seg.label })
@@ -58559,7 +58474,7 @@ var EventWireOverlay = ({
58559
58474
  containerW,
58560
58475
  containerH
58561
58476
  }) => {
58562
- const ids = React95__default.useMemo(() => {
58477
+ const ids = React93__default.useMemo(() => {
58563
58478
  avlOczWireId += 1;
58564
58479
  return { arrow: `avl-ocz-wire-${avlOczWireId}-arrow` };
58565
58480
  }, []);
@@ -58926,7 +58841,7 @@ var AvlOrbitalsCosmicZoom = ({
58926
58841
  borderRadius: 6,
58927
58842
  border: `1px solid ${color}`
58928
58843
  },
58929
- children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", children: breadcrumbs.map((crumb, i) => /* @__PURE__ */ jsxs(React95__default.Fragment, { children: [
58844
+ children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", children: breadcrumbs.map((crumb, i) => /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
58930
58845
  i > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", style: { opacity: 0.5, color }, children: "/" }),
58931
58846
  i < breadcrumbs.length - 1 ? /* @__PURE__ */ jsx(
58932
58847
  Box,