@almadar/ui 4.31.0 → 4.33.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/avl/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
2
2
  import { OrbitControls as OrbitControls$1, Grid as Grid$1, Stars, Sparkles, Html, RoundedBox } from '@react-three/drei';
3
- import * as React118 from 'react';
4
- import React118__default, { createContext, useContext, useRef, useState, useCallback, useMemo, useEffect, Suspense, useLayoutEffect, useReducer, lazy, useId, forwardRef, useImperativeHandle, Component } from 'react';
3
+ import * as React119 from 'react';
4
+ import React119__default, { createContext, useContext, useRef, useState, useCallback, useMemo, useEffect, Suspense, useLayoutEffect, useReducer, lazy, useId, forwardRef, useImperativeHandle, Component } from 'react';
5
5
  import * as LucideIcons from 'lucide-react';
6
6
  import { Loader2, ChevronDown, X, Check, Copy, AlertTriangle, Info, AlertCircle, CheckCircle, List, Printer, ChevronRight, ChevronLeft, Code, FileText, WrapText, Trash2, Menu as Menu$1, Search, Bell, LogOut, ZoomOut, ZoomIn, Download, FileQuestion, Inbox, XCircle, Filter, Plus, Pause, Play, RotateCcw, Package, Calendar, Pencil, Eye, MoreHorizontal, Image as Image$1, Upload, Minus, ArrowLeft, HelpCircle, ChevronUp, Eraser, Star, TrendingUp, TrendingDown, ArrowUp, ArrowDown, MoreVertical, Sun, Moon, Circle, Clock, CheckCircle2, ArrowRight, FileWarning, SkipForward, Bug, Send, Wrench, User, Tag, DollarSign, Zap, Sword, Move, Heart, Shield } from 'lucide-react';
7
7
  import { evaluate, createMinimalContext } from '@almadar/evaluator';
@@ -3336,7 +3336,7 @@ var init_Box = __esm({
3336
3336
  fixed: "fixed",
3337
3337
  sticky: "sticky"
3338
3338
  };
3339
- Box = React118__default.forwardRef(
3339
+ Box = React119__default.forwardRef(
3340
3340
  ({
3341
3341
  padding,
3342
3342
  paddingX,
@@ -5067,7 +5067,7 @@ function resolveIconProp(value, sizeClass) {
5067
5067
  const IconComp = value;
5068
5068
  return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
5069
5069
  }
5070
- if (React118__default.isValidElement(value)) {
5070
+ if (React119__default.isValidElement(value)) {
5071
5071
  return value;
5072
5072
  }
5073
5073
  if (typeof value === "object" && value !== null && "render" in value) {
@@ -5143,7 +5143,7 @@ var init_Button = __esm({
5143
5143
  md: "h-4 w-4",
5144
5144
  lg: "h-5 w-5"
5145
5145
  };
5146
- Button = React118__default.forwardRef(
5146
+ Button = React119__default.forwardRef(
5147
5147
  ({
5148
5148
  className,
5149
5149
  variant = "primary",
@@ -5246,7 +5246,7 @@ var init_Badge = __esm({
5246
5246
  md: "px-2.5 py-1 text-sm",
5247
5247
  lg: "px-3 py-1.5 text-base"
5248
5248
  };
5249
- Badge = React118__default.forwardRef(
5249
+ Badge = React119__default.forwardRef(
5250
5250
  ({ className, variant = "default", size = "sm", amount, label, icon, children, ...props }, ref) => {
5251
5251
  const iconSizes2 = { sm: "w-3 h-3", md: "w-3.5 h-3.5", lg: "w-4 h-4" };
5252
5252
  const resolvedIcon = typeof icon === "string" ? (() => {
@@ -5406,7 +5406,7 @@ var Input;
5406
5406
  var init_Input = __esm({
5407
5407
  "components/atoms/Input.tsx"() {
5408
5408
  init_cn();
5409
- Input = React118__default.forwardRef(
5409
+ Input = React119__default.forwardRef(
5410
5410
  ({
5411
5411
  className,
5412
5412
  inputType,
@@ -5524,7 +5524,7 @@ var Label;
5524
5524
  var init_Label = __esm({
5525
5525
  "components/atoms/Label.tsx"() {
5526
5526
  init_cn();
5527
- Label = React118__default.forwardRef(
5527
+ Label = React119__default.forwardRef(
5528
5528
  ({ className, required, children, ...props }, ref) => {
5529
5529
  return /* @__PURE__ */ jsxs(
5530
5530
  "label",
@@ -5550,7 +5550,7 @@ var Textarea;
5550
5550
  var init_Textarea = __esm({
5551
5551
  "components/atoms/Textarea.tsx"() {
5552
5552
  init_cn();
5553
- Textarea = React118__default.forwardRef(
5553
+ Textarea = React119__default.forwardRef(
5554
5554
  ({ className, error, ...props }, ref) => {
5555
5555
  return /* @__PURE__ */ jsx(
5556
5556
  "textarea",
@@ -5579,7 +5579,7 @@ var Select;
5579
5579
  var init_Select = __esm({
5580
5580
  "components/atoms/Select.tsx"() {
5581
5581
  init_cn();
5582
- Select = React118__default.forwardRef(
5582
+ Select = React119__default.forwardRef(
5583
5583
  ({ className, options, placeholder, error, ...props }, ref) => {
5584
5584
  return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
5585
5585
  /* @__PURE__ */ jsxs(
@@ -5621,7 +5621,7 @@ var Checkbox;
5621
5621
  var init_Checkbox = __esm({
5622
5622
  "components/atoms/Checkbox.tsx"() {
5623
5623
  init_cn();
5624
- Checkbox = React118__default.forwardRef(
5624
+ Checkbox = React119__default.forwardRef(
5625
5625
  ({ className, label, id, ...props }, ref) => {
5626
5626
  const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
5627
5627
  return /* @__PURE__ */ jsxs("div", { className: "flex items-center", children: [
@@ -5703,7 +5703,7 @@ var init_Card = __esm({
5703
5703
  md: "shadow",
5704
5704
  lg: "shadow-lg"
5705
5705
  };
5706
- Card = React118__default.forwardRef(
5706
+ Card = React119__default.forwardRef(
5707
5707
  ({
5708
5708
  className,
5709
5709
  variant = "bordered",
@@ -5739,9 +5739,9 @@ var init_Card = __esm({
5739
5739
  }
5740
5740
  );
5741
5741
  Card.displayName = "Card";
5742
- CardHeader = React118__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
5742
+ CardHeader = React119__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
5743
5743
  CardHeader.displayName = "CardHeader";
5744
- CardTitle = React118__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
5744
+ CardTitle = React119__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
5745
5745
  "h3",
5746
5746
  {
5747
5747
  ref,
@@ -5754,11 +5754,11 @@ var init_Card = __esm({
5754
5754
  }
5755
5755
  ));
5756
5756
  CardTitle.displayName = "CardTitle";
5757
- CardContent = React118__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
5757
+ CardContent = React119__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
5758
5758
  CardContent.displayName = "CardContent";
5759
5759
  CardBody = CardContent;
5760
5760
  CardBody.displayName = "CardBody";
5761
- CardFooter = React118__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
5761
+ CardFooter = React119__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
5762
5762
  "div",
5763
5763
  {
5764
5764
  ref,
@@ -5779,7 +5779,7 @@ var init_Spinner = __esm({
5779
5779
  md: "h-6 w-6",
5780
5780
  lg: "h-8 w-8"
5781
5781
  };
5782
- Spinner = React118__default.forwardRef(
5782
+ Spinner = React119__default.forwardRef(
5783
5783
  ({ className, size = "md", ...props }, ref) => {
5784
5784
  return /* @__PURE__ */ jsx(
5785
5785
  "div",
@@ -6227,7 +6227,7 @@ var Radio;
6227
6227
  var init_Radio = __esm({
6228
6228
  "components/atoms/Radio.tsx"() {
6229
6229
  init_cn();
6230
- Radio = React118__default.forwardRef(
6230
+ Radio = React119__default.forwardRef(
6231
6231
  ({
6232
6232
  label,
6233
6233
  helperText,
@@ -6338,7 +6338,7 @@ var init_Switch = __esm({
6338
6338
  "components/atoms/Switch.tsx"() {
6339
6339
  "use client";
6340
6340
  init_cn();
6341
- Switch = React118.forwardRef(
6341
+ Switch = React119.forwardRef(
6342
6342
  ({
6343
6343
  checked,
6344
6344
  defaultChecked = false,
@@ -6349,10 +6349,10 @@ var init_Switch = __esm({
6349
6349
  name,
6350
6350
  className
6351
6351
  }, ref) => {
6352
- const [isChecked, setIsChecked] = React118.useState(
6352
+ const [isChecked, setIsChecked] = React119.useState(
6353
6353
  checked !== void 0 ? checked : defaultChecked
6354
6354
  );
6355
- React118.useEffect(() => {
6355
+ React119.useEffect(() => {
6356
6356
  if (checked !== void 0) {
6357
6357
  setIsChecked(checked);
6358
6358
  }
@@ -6686,8 +6686,8 @@ var init_LawReferenceTooltip = __esm({
6686
6686
  position = "top",
6687
6687
  className
6688
6688
  }) => {
6689
- const [isVisible, setIsVisible] = React118__default.useState(false);
6690
- const timeoutRef = React118__default.useRef(null);
6689
+ const [isVisible, setIsVisible] = React119__default.useState(false);
6690
+ const timeoutRef = React119__default.useRef(null);
6691
6691
  const handleMouseEnter = () => {
6692
6692
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
6693
6693
  timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
@@ -6696,7 +6696,7 @@ var init_LawReferenceTooltip = __esm({
6696
6696
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
6697
6697
  setIsVisible(false);
6698
6698
  };
6699
- React118__default.useEffect(() => {
6699
+ React119__default.useEffect(() => {
6700
6700
  return () => {
6701
6701
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
6702
6702
  };
@@ -6906,7 +6906,7 @@ var init_StatusDot = __esm({
6906
6906
  md: "w-2.5 h-2.5",
6907
6907
  lg: "w-3 h-3"
6908
6908
  };
6909
- StatusDot = React118__default.forwardRef(
6909
+ StatusDot = React119__default.forwardRef(
6910
6910
  ({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
6911
6911
  return /* @__PURE__ */ jsx(
6912
6912
  "span",
@@ -6959,7 +6959,7 @@ var init_TrendIndicator = __esm({
6959
6959
  down: TrendingDown,
6960
6960
  flat: ArrowRight
6961
6961
  };
6962
- TrendIndicator = React118__default.forwardRef(
6962
+ TrendIndicator = React119__default.forwardRef(
6963
6963
  ({
6964
6964
  className,
6965
6965
  value,
@@ -7026,7 +7026,7 @@ var init_RangeSlider = __esm({
7026
7026
  md: "w-4 h-4",
7027
7027
  lg: "w-5 h-5"
7028
7028
  };
7029
- RangeSlider = React118__default.forwardRef(
7029
+ RangeSlider = React119__default.forwardRef(
7030
7030
  ({
7031
7031
  className,
7032
7032
  min = 0,
@@ -7673,9 +7673,9 @@ function ScoreDisplay({
7673
7673
  ...rest
7674
7674
  }) {
7675
7675
  const resolvedValue = typeof value === "number" && !Number.isNaN(value) ? value : typeof rest.score === "number" && !Number.isNaN(rest.score) ? rest.score : 0;
7676
- const [displayValue, setDisplayValue] = React118.useState(resolvedValue);
7677
- const [isAnimating, setIsAnimating] = React118.useState(false);
7678
- React118.useEffect(() => {
7676
+ const [displayValue, setDisplayValue] = React119.useState(resolvedValue);
7677
+ const [isAnimating, setIsAnimating] = React119.useState(false);
7678
+ React119.useEffect(() => {
7679
7679
  if (!animated || displayValue === resolvedValue) {
7680
7680
  setDisplayValue(resolvedValue);
7681
7681
  return;
@@ -7745,9 +7745,9 @@ function ControlButton({
7745
7745
  className
7746
7746
  }) {
7747
7747
  const eventBus = useEventBus();
7748
- const [isPressed, setIsPressed] = React118.useState(false);
7748
+ const [isPressed, setIsPressed] = React119.useState(false);
7749
7749
  const actualPressed = pressed ?? isPressed;
7750
- const handlePointerDown = React118.useCallback(
7750
+ const handlePointerDown = React119.useCallback(
7751
7751
  (e) => {
7752
7752
  e.preventDefault();
7753
7753
  if (disabled) return;
@@ -7757,7 +7757,7 @@ function ControlButton({
7757
7757
  },
7758
7758
  [disabled, pressEvent, eventBus, onPress]
7759
7759
  );
7760
- const handlePointerUp = React118.useCallback(
7760
+ const handlePointerUp = React119.useCallback(
7761
7761
  (e) => {
7762
7762
  e.preventDefault();
7763
7763
  if (disabled) return;
@@ -7767,7 +7767,7 @@ function ControlButton({
7767
7767
  },
7768
7768
  [disabled, releaseEvent, eventBus, onRelease]
7769
7769
  );
7770
- const handlePointerLeave = React118.useCallback(
7770
+ const handlePointerLeave = React119.useCallback(
7771
7771
  (e) => {
7772
7772
  if (isPressed) {
7773
7773
  setIsPressed(false);
@@ -8665,9 +8665,9 @@ function MiniMap({
8665
8665
  viewportRect,
8666
8666
  className
8667
8667
  }) {
8668
- const canvasRef = React118.useRef(null);
8669
- const frameRef = React118.useRef(0);
8670
- React118.useEffect(() => {
8668
+ const canvasRef = React119.useRef(null);
8669
+ const frameRef = React119.useRef(0);
8670
+ React119.useEffect(() => {
8671
8671
  const canvas = canvasRef.current;
8672
8672
  if (!canvas) return;
8673
8673
  const ctx = canvas.getContext("2d");
@@ -8960,7 +8960,7 @@ var init_ErrorBoundary = __esm({
8960
8960
  "use client";
8961
8961
  init_cn();
8962
8962
  init_ErrorState();
8963
- ErrorBoundary = class extends React118__default.Component {
8963
+ ErrorBoundary = class extends React119__default.Component {
8964
8964
  constructor(props) {
8965
8965
  super(props);
8966
8966
  __publicField(this, "reset", () => {
@@ -9407,8 +9407,8 @@ var init_Tooltip = __esm({
9407
9407
  if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
9408
9408
  };
9409
9409
  }, []);
9410
- const triggerElement = React118__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
9411
- const trigger = React118__default.cloneElement(triggerElement, {
9410
+ const triggerElement = React119__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
9411
+ const trigger = React119__default.cloneElement(triggerElement, {
9412
9412
  ref: triggerRef,
9413
9413
  onMouseEnter: handleMouseEnter,
9414
9414
  onMouseLeave: handleMouseLeave,
@@ -9529,8 +9529,8 @@ var init_Popover = __esm({
9529
9529
  onMouseEnter: handleOpen,
9530
9530
  onMouseLeave: handleClose
9531
9531
  };
9532
- const childElement = React118__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
9533
- const triggerElement = React118__default.cloneElement(
9532
+ const childElement = React119__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
9533
+ const triggerElement = React119__default.cloneElement(
9534
9534
  childElement,
9535
9535
  {
9536
9536
  ref: triggerRef,
@@ -9647,8 +9647,8 @@ var init_Menu = __esm({
9647
9647
  "bottom-start": "top-full left-0 mt-2",
9648
9648
  "bottom-end": "top-full right-0 mt-2"
9649
9649
  };
9650
- const triggerChild = React118__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx("span", { children: trigger });
9651
- const triggerElement = React118__default.cloneElement(
9650
+ const triggerChild = React119__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx("span", { children: trigger });
9651
+ const triggerElement = React119__default.cloneElement(
9652
9652
  triggerChild,
9653
9653
  {
9654
9654
  ref: triggerRef,
@@ -10167,7 +10167,7 @@ var init_MapView = __esm({
10167
10167
  shadowSize: [41, 41]
10168
10168
  });
10169
10169
  L.Marker.prototype.options.icon = defaultIcon;
10170
- const { useEffect: useEffect81, useRef: useRef81, useCallback: useCallback105, useState: useState107 } = React118__default;
10170
+ const { useEffect: useEffect81, useRef: useRef81, useCallback: useCallback105, useState: useState107 } = React119__default;
10171
10171
  const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
10172
10172
  const { useEventBus: useEventBus3 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
10173
10173
  function MapUpdater({ centerLat, centerLng, zoom }) {
@@ -10398,7 +10398,7 @@ function InputPattern({
10398
10398
  fieldName
10399
10399
  }) {
10400
10400
  const { emit } = useEventBus();
10401
- const [localValue, setLocalValue] = React118__default.useState(value);
10401
+ const [localValue, setLocalValue] = React119__default.useState(value);
10402
10402
  const handleChange = (e) => {
10403
10403
  setLocalValue(e.target.value);
10404
10404
  if (onChange) {
@@ -10436,7 +10436,7 @@ function TextareaPattern({
10436
10436
  fieldName
10437
10437
  }) {
10438
10438
  const { emit } = useEventBus();
10439
- const [localValue, setLocalValue] = React118__default.useState(value);
10439
+ const [localValue, setLocalValue] = React119__default.useState(value);
10440
10440
  const handleChange = (e) => {
10441
10441
  setLocalValue(e.target.value);
10442
10442
  if (onChange) {
@@ -10468,7 +10468,7 @@ function SelectPattern({
10468
10468
  fieldName
10469
10469
  }) {
10470
10470
  const { emit } = useEventBus();
10471
- const [localValue, setLocalValue] = React118__default.useState(value);
10471
+ const [localValue, setLocalValue] = React119__default.useState(value);
10472
10472
  const handleChange = (e) => {
10473
10473
  setLocalValue(e.target.value);
10474
10474
  if (onChange) {
@@ -10497,7 +10497,7 @@ function CheckboxPattern({
10497
10497
  className
10498
10498
  }) {
10499
10499
  const { emit } = useEventBus();
10500
- const [localChecked, setLocalChecked] = React118__default.useState(checked);
10500
+ const [localChecked, setLocalChecked] = React119__default.useState(checked);
10501
10501
  const handleChange = (e) => {
10502
10502
  setLocalChecked(e.target.checked);
10503
10503
  if (onChange) {
@@ -10728,8 +10728,8 @@ function ActionButtons({
10728
10728
  disabled
10729
10729
  }) {
10730
10730
  const eventBus = useEventBus();
10731
- const [activeButtons, setActiveButtons] = React118.useState(/* @__PURE__ */ new Set());
10732
- const handlePress = React118.useCallback(
10731
+ const [activeButtons, setActiveButtons] = React119.useState(/* @__PURE__ */ new Set());
10732
+ const handlePress = React119.useCallback(
10733
10733
  (id) => {
10734
10734
  setActiveButtons((prev) => new Set(prev).add(id));
10735
10735
  if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
@@ -10737,7 +10737,7 @@ function ActionButtons({
10737
10737
  },
10738
10738
  [actionEvent, eventBus, onAction]
10739
10739
  );
10740
- const handleRelease = React118.useCallback(
10740
+ const handleRelease = React119.useCallback(
10741
10741
  (id) => {
10742
10742
  setActiveButtons((prev) => {
10743
10743
  const next = new Set(prev);
@@ -12804,7 +12804,7 @@ var init_MarkdownContent = __esm({
12804
12804
  init_Box();
12805
12805
  init_useTranslate();
12806
12806
  init_cn();
12807
- MarkdownContent = React118__default.memo(
12807
+ MarkdownContent = React119__default.memo(
12808
12808
  ({ content, direction, className }) => {
12809
12809
  const { t: _t } = useTranslate();
12810
12810
  const safeContent = typeof content === "string" ? content : String(content ?? "");
@@ -13021,7 +13021,7 @@ var init_CodeBlock = __esm({
13021
13021
  loloStyle = { ...dark, ...loloStyleOverrides };
13022
13022
  LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
13023
13023
  HIDDEN_LINE_NUMBERS = { display: "none" };
13024
- CodeBlock = React118__default.memo(
13024
+ CodeBlock = React119__default.memo(
13025
13025
  ({
13026
13026
  code: rawCode,
13027
13027
  language = "text",
@@ -14330,7 +14330,7 @@ var init_StateMachineView = __esm({
14330
14330
  style: { top: title ? 30 : 0 },
14331
14331
  children: [
14332
14332
  entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
14333
- states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React118__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
14333
+ states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React119__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
14334
14334
  StateNode,
14335
14335
  {
14336
14336
  state,
@@ -20117,7 +20117,7 @@ function CraftingRecipe({
20117
20117
  className
20118
20118
  }) {
20119
20119
  const eventBus = useEventBus();
20120
- const handleCraft = React118.useCallback(() => {
20120
+ const handleCraft = React119.useCallback(() => {
20121
20121
  onCraft?.();
20122
20122
  if (craftEvent) {
20123
20123
  eventBus.emit(craftEvent, { output: output.label });
@@ -20134,7 +20134,7 @@ function CraftingRecipe({
20134
20134
  children: [
20135
20135
  /* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-wrap items-center", children: inputs.map((ingredient, index) => {
20136
20136
  const hasSufficient = ingredient.available >= ingredient.required;
20137
- return /* @__PURE__ */ jsxs(React118.Fragment, { children: [
20137
+ return /* @__PURE__ */ jsxs(React119.Fragment, { children: [
20138
20138
  /* @__PURE__ */ jsx(Box, { className: "relative", children: /* @__PURE__ */ jsx(
20139
20139
  ItemSlot,
20140
20140
  {
@@ -20428,8 +20428,8 @@ function DPad({
20428
20428
  }) {
20429
20429
  const eventBus = useEventBus();
20430
20430
  const sizes = sizeMap15[size];
20431
- const [activeDirections, setActiveDirections] = React118.useState(/* @__PURE__ */ new Set());
20432
- const handlePress = React118.useCallback(
20431
+ const [activeDirections, setActiveDirections] = React119.useState(/* @__PURE__ */ new Set());
20432
+ const handlePress = React119.useCallback(
20433
20433
  (direction) => {
20434
20434
  setActiveDirections((prev) => new Set(prev).add(direction));
20435
20435
  if (directionEvent) eventBus.emit(`UI:${directionEvent}`, { direction, pressed: true });
@@ -20437,7 +20437,7 @@ function DPad({
20437
20437
  },
20438
20438
  [directionEvent, eventBus, onDirection]
20439
20439
  );
20440
- const handleRelease = React118.useCallback(
20440
+ const handleRelease = React119.useCallback(
20441
20441
  (direction) => {
20442
20442
  setActiveDirections((prev) => {
20443
20443
  const next = new Set(prev);
@@ -20569,6 +20569,19 @@ var init_useAuthContext = __esm({
20569
20569
  "hooks/useAuthContext.ts"() {
20570
20570
  }
20571
20571
  });
20572
+ var CurrentPagePathContext, CurrentPagePathProvider, useCurrentPagePath;
20573
+ var init_CurrentPagePathContext = __esm({
20574
+ "context/CurrentPagePathContext.tsx"() {
20575
+ "use client";
20576
+ CurrentPagePathContext = createContext(void 0);
20577
+ CurrentPagePathProvider = ({
20578
+ value,
20579
+ children
20580
+ }) => /* @__PURE__ */ jsx(CurrentPagePathContext.Provider, { value, children });
20581
+ CurrentPagePathProvider.displayName = "CurrentPagePathProvider";
20582
+ useCurrentPagePath = () => useContext(CurrentPagePathContext);
20583
+ }
20584
+ });
20572
20585
  var DashboardLayout, NavLink;
20573
20586
  var init_DashboardLayout = __esm({
20574
20587
  "components/templates/DashboardLayout.tsx"() {
@@ -20582,6 +20595,7 @@ var init_DashboardLayout = __esm({
20582
20595
  init_useAuthContext();
20583
20596
  init_useEventBus();
20584
20597
  init_useTranslate();
20598
+ init_CurrentPagePathContext();
20585
20599
  DashboardLayout = ({
20586
20600
  appName = "{{APP_TITLE}}",
20587
20601
  logo,
@@ -20598,6 +20612,7 @@ var init_DashboardLayout = __esm({
20598
20612
  showThemeToggle = true,
20599
20613
  sidebarFooter,
20600
20614
  onSignOut: onSignOutProp,
20615
+ currentPath,
20601
20616
  children
20602
20617
  }) => {
20603
20618
  const eventBus = useEventBus();
@@ -20618,259 +20633,271 @@ var init_DashboardLayout = __esm({
20618
20633
  const [sidebarOpen, setSidebarOpen] = useState(false);
20619
20634
  const [userMenuOpen, setUserMenuOpen] = useState(false);
20620
20635
  const location = useLocation();
20636
+ const ctxPagePath = useCurrentPagePath();
20637
+ const activePath = currentPath ?? ctxPagePath ?? location.pathname;
20621
20638
  const { signOut: authSignOut } = useAuthContext();
20622
20639
  const user = userProp || (null);
20623
20640
  const { t } = useTranslate();
20624
20641
  const handleSignOut = onSignOutProp || authSignOut;
20625
- return /* @__PURE__ */ jsxs(Box, { className: "min-h-screen bg-background dark:bg-background", children: [
20626
- sidebarOpen && /* @__PURE__ */ jsx(
20627
- Box,
20628
- {
20629
- className: "fixed inset-0 bg-foreground/50 dark:bg-foreground/70 z-20 lg:hidden",
20630
- onClick: () => setSidebarOpen(false)
20631
- }
20632
- ),
20633
- /* @__PURE__ */ jsxs(
20634
- Box,
20635
- {
20636
- as: "aside",
20637
- className: cn(
20638
- "fixed inset-y-0 left-0 z-30 w-64 bg-card dark:bg-card border-r border-border dark:border-border",
20639
- "transform transition-transform duration-200 ease-in-out lg:translate-x-0",
20640
- sidebarOpen ? "translate-x-0" : "-translate-x-full"
20642
+ return /* @__PURE__ */ jsxs(
20643
+ HStack,
20644
+ {
20645
+ gap: "none",
20646
+ className: "min-h-screen w-full bg-background dark:bg-background items-stretch",
20647
+ children: [
20648
+ sidebarOpen && /* @__PURE__ */ jsx(
20649
+ Box,
20650
+ {
20651
+ className: "fixed inset-0 bg-foreground/50 dark:bg-foreground/70 z-20 lg:hidden",
20652
+ onClick: () => setSidebarOpen(false)
20653
+ }
20641
20654
  ),
20642
- children: [
20643
- /* @__PURE__ */ jsxs(
20644
- HStack,
20645
- {
20646
- align: "center",
20647
- justify: "between",
20648
- className: "h-16 px-4 border-b border-border dark:border-border",
20649
- children: [
20650
- /* @__PURE__ */ jsxs(Link, { to: "/", className: "flex items-center gap-2", children: [
20651
- logo || /* @__PURE__ */ jsx(Box, { className: "w-8 h-8 bg-primary-600 rounded-lg flex items-center justify-center", children: /* @__PURE__ */ jsx(
20652
- Typography,
20653
- {
20654
- variant: "small",
20655
- className: "text-white font-bold text-sm",
20656
- as: "span",
20657
- children: appName.charAt(0).toUpperCase()
20658
- }
20659
- ) }),
20660
- /* @__PURE__ */ jsx(
20661
- Typography,
20662
- {
20663
- variant: "label",
20664
- className: "font-semibold text-foreground dark:text-foreground",
20665
- as: "span",
20666
- children: appName
20667
- }
20668
- )
20669
- ] }),
20670
- /* @__PURE__ */ jsx(
20671
- Button,
20672
- {
20673
- variant: "ghost",
20674
- className: "lg:hidden p-2 rounded-md hover:bg-muted dark:hover:bg-muted text-muted-foreground dark:text-muted-foreground",
20675
- onClick: () => setSidebarOpen(false),
20676
- children: /* @__PURE__ */ jsx(X, { className: "h-5 w-5" })
20677
- }
20678
- )
20679
- ]
20680
- }
20681
- ),
20682
- /* @__PURE__ */ jsx(
20683
- VStack,
20684
- {
20685
- as: "nav",
20686
- gap: "none",
20687
- className: "flex-1 px-3 py-4 space-y-1 overflow-y-auto",
20688
- children: navItems.map((item) => /* @__PURE__ */ jsx(
20689
- NavLink,
20655
+ /* @__PURE__ */ jsxs(
20656
+ Box,
20657
+ {
20658
+ as: "aside",
20659
+ className: cn(
20660
+ "z-30 w-64 flex-shrink-0 bg-card dark:bg-card border-r border-border dark:border-border",
20661
+ "fixed inset-y-0 left-0 lg:static lg:translate-x-0 lg:h-auto",
20662
+ "transform transition-transform duration-200 ease-in-out",
20663
+ "flex flex-col",
20664
+ sidebarOpen ? "translate-x-0" : "-translate-x-full"
20665
+ ),
20666
+ children: [
20667
+ /* @__PURE__ */ jsxs(
20668
+ HStack,
20690
20669
  {
20691
- item,
20692
- currentPath: location.pathname
20693
- },
20694
- item.href
20695
- ))
20696
- }
20697
- ),
20698
- sidebarFooter && /* @__PURE__ */ jsx(Box, { className: "p-4 border-t border-border dark:border-border", children: sidebarFooter })
20699
- ]
20700
- }
20701
- ),
20702
- /* @__PURE__ */ jsxs(Box, { className: "lg:pl-64", children: [
20703
- /* @__PURE__ */ jsx(
20704
- Box,
20705
- {
20706
- as: "header",
20707
- className: "sticky top-0 z-20 h-16 bg-card dark:bg-card border-b border-border dark:border-border",
20708
- children: /* @__PURE__ */ jsxs(
20709
- HStack,
20710
- {
20711
- align: "center",
20712
- justify: "between",
20713
- className: "h-full px-4 gap-4",
20714
- children: [
20715
- /* @__PURE__ */ jsx(
20716
- Button,
20717
- {
20718
- variant: "ghost",
20719
- className: "lg:hidden p-2 rounded-md hover:bg-muted dark:hover:bg-muted text-muted-foreground dark:text-muted-foreground touch-manipulation min-h-[44px] min-w-[44px] flex items-center justify-center",
20720
- onClick: () => setSidebarOpen(true),
20721
- "aria-label": "Open sidebar",
20722
- children: /* @__PURE__ */ jsx(Menu$1, { className: "h-5 w-5" })
20723
- }
20724
- ),
20725
- searchEnabled && /* @__PURE__ */ jsx(Box, { className: "hidden sm:block flex-1 max-w-md", children: /* @__PURE__ */ jsxs(Box, { className: "relative", children: [
20726
- /* @__PURE__ */ jsx(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground dark:text-muted-foreground" }),
20727
- /* @__PURE__ */ jsx(
20728
- Input,
20729
- {
20730
- type: "search",
20731
- placeholder: t("common.search"),
20732
- className: "pl-10 w-full",
20733
- onKeyDown: (e) => {
20734
- if (e.key === "Enter") {
20735
- handleSearchSubmit(e.target.value);
20670
+ align: "center",
20671
+ justify: "between",
20672
+ className: "h-16 px-4 border-b border-border dark:border-border",
20673
+ children: [
20674
+ /* @__PURE__ */ jsxs(Link, { to: "/", className: "flex items-center gap-2", children: [
20675
+ logo || /* @__PURE__ */ jsx(Box, { className: "w-8 h-8 bg-primary-600 rounded-lg flex items-center justify-center", children: /* @__PURE__ */ jsx(
20676
+ Typography,
20677
+ {
20678
+ variant: "small",
20679
+ className: "text-white font-bold text-sm",
20680
+ as: "span",
20681
+ children: appName.charAt(0).toUpperCase()
20682
+ }
20683
+ ) }),
20684
+ /* @__PURE__ */ jsx(
20685
+ Typography,
20686
+ {
20687
+ variant: "label",
20688
+ className: "font-semibold text-foreground dark:text-foreground",
20689
+ as: "span",
20690
+ children: appName
20736
20691
  }
20692
+ )
20693
+ ] }),
20694
+ /* @__PURE__ */ jsx(
20695
+ Button,
20696
+ {
20697
+ variant: "ghost",
20698
+ className: "lg:hidden p-2 rounded-md hover:bg-muted dark:hover:bg-muted text-muted-foreground dark:text-muted-foreground",
20699
+ onClick: () => setSidebarOpen(false),
20700
+ children: /* @__PURE__ */ jsx(X, { className: "h-5 w-5" })
20737
20701
  }
20738
- }
20739
- )
20740
- ] }) }),
20741
- /* @__PURE__ */ jsxs(HStack, { align: "center", gap: "xs", children: [
20742
- headerActions,
20743
- showThemeToggle && /* @__PURE__ */ jsx(ThemeToggle, {}),
20744
- topBarActions.map((action, idx) => /* @__PURE__ */ jsxs(
20745
- Button,
20702
+ )
20703
+ ]
20704
+ }
20705
+ ),
20706
+ /* @__PURE__ */ jsx(
20707
+ VStack,
20708
+ {
20709
+ as: "nav",
20710
+ gap: "none",
20711
+ className: "flex-1 px-3 py-4 space-y-1 overflow-y-auto",
20712
+ children: navItems.map((item) => /* @__PURE__ */ jsx(
20713
+ NavLink,
20746
20714
  {
20747
- variant: "ghost",
20748
- className: "relative p-2 rounded-full hover:bg-muted dark:hover:bg-muted",
20749
- onClick: () => handleTopBarActionClick(action.event),
20750
- "aria-label": action.label ?? action.icon,
20751
- children: [
20752
- /* @__PURE__ */ jsx(Icon, { name: action.icon, className: "h-5 w-5 text-muted-foreground dark:text-muted-foreground" }),
20753
- action.badge !== void 0 && action.badge !== null && action.badge !== 0 && action.badge !== "" && /* @__PURE__ */ jsx(
20754
- Box,
20755
- {
20756
- as: "span",
20757
- className: cn(
20758
- "absolute -top-0.5 -right-0.5 min-w-[18px] h-[18px] px-1 rounded-full text-[10px] font-semibold text-white flex items-center justify-center",
20759
- action.variant === "danger" ? "bg-error" : action.variant === "primary" ? "bg-primary" : "bg-foreground"
20760
- ),
20761
- children: action.badge
20762
- }
20763
- )
20764
- ]
20715
+ item,
20716
+ currentPath: activePath
20765
20717
  },
20766
- `${action.event}-${idx}`
20767
- )),
20768
- notificationsEnabled && /* @__PURE__ */ jsxs(
20769
- Button,
20770
- {
20771
- variant: "ghost",
20772
- className: "relative p-2 rounded-full hover:bg-muted dark:hover:bg-muted",
20773
- onClick: handleNotificationClick,
20774
- "aria-label": t("common.notifications"),
20775
- children: [
20776
- /* @__PURE__ */ jsx(Bell, { className: "h-5 w-5 text-muted-foreground dark:text-muted-foreground" }),
20777
- unreadCount > 0 && /* @__PURE__ */ jsx(
20778
- Box,
20779
- {
20780
- as: "span",
20781
- className: "absolute -top-0.5 -right-0.5 min-w-[18px] h-[18px] px-1 bg-error rounded-full text-[10px] font-semibold text-white flex items-center justify-center",
20782
- children: unreadCount > 99 ? "99+" : unreadCount
20783
- }
20784
- )
20785
- ]
20786
- }
20787
- ),
20788
- user && /* @__PURE__ */ jsxs(Box, { className: "relative", children: [
20789
- /* @__PURE__ */ jsxs(
20718
+ item.href
20719
+ ))
20720
+ }
20721
+ ),
20722
+ sidebarFooter && /* @__PURE__ */ jsx(Box, { className: "p-4 border-t border-border dark:border-border", children: sidebarFooter })
20723
+ ]
20724
+ }
20725
+ ),
20726
+ /* @__PURE__ */ jsxs(VStack, { gap: "none", className: "flex-1 min-w-0 min-h-screen", children: [
20727
+ /* @__PURE__ */ jsx(
20728
+ Box,
20729
+ {
20730
+ as: "header",
20731
+ className: "sticky top-0 z-20 h-16 bg-card dark:bg-card border-b border-border dark:border-border",
20732
+ children: /* @__PURE__ */ jsxs(
20733
+ HStack,
20734
+ {
20735
+ align: "center",
20736
+ justify: "between",
20737
+ className: "h-full px-3 sm:px-4 gap-2 sm:gap-4",
20738
+ children: [
20739
+ /* @__PURE__ */ jsx(
20790
20740
  Button,
20791
20741
  {
20792
20742
  variant: "ghost",
20793
- className: "flex items-center gap-2 p-2 rounded-lg hover:bg-muted dark:hover:bg-muted",
20794
- onClick: () => setUserMenuOpen(!userMenuOpen),
20795
- children: [
20796
- /* @__PURE__ */ jsx(
20797
- Avatar,
20798
- {
20799
- src: user.avatar,
20800
- alt: user.name,
20801
- initials: user.name.split(" ").map((n) => n[0]).join("").substring(0, 2),
20802
- size: "sm"
20803
- }
20804
- ),
20805
- /* @__PURE__ */ jsx(
20806
- Typography,
20807
- {
20808
- variant: "small",
20809
- className: "hidden sm:block text-sm font-medium text-foreground dark:text-foreground",
20810
- as: "span",
20811
- children: user.name
20812
- }
20813
- ),
20814
- /* @__PURE__ */ jsx(ChevronDown, { className: "hidden sm:block h-4 w-4 text-muted-foreground dark:text-muted-foreground" })
20815
- ]
20743
+ className: "lg:hidden p-2 rounded-md hover:bg-muted dark:hover:bg-muted text-muted-foreground dark:text-muted-foreground touch-manipulation min-h-[44px] min-w-[44px] flex items-center justify-center",
20744
+ onClick: () => setSidebarOpen(true),
20745
+ "aria-label": "Open sidebar",
20746
+ children: /* @__PURE__ */ jsx(Menu$1, { className: "h-5 w-5" })
20816
20747
  }
20817
20748
  ),
20818
- userMenuOpen && /* @__PURE__ */ jsxs(Fragment, { children: [
20749
+ searchEnabled && /* @__PURE__ */ jsx(Box, { className: "hidden sm:block flex-1 min-w-0 xl:max-w-md", children: /* @__PURE__ */ jsxs(Box, { className: "relative", children: [
20750
+ /* @__PURE__ */ jsx(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground dark:text-muted-foreground" }),
20819
20751
  /* @__PURE__ */ jsx(
20820
- Box,
20752
+ Input,
20821
20753
  {
20822
- className: "fixed inset-0 z-20",
20823
- onClick: () => setUserMenuOpen(false)
20754
+ type: "search",
20755
+ placeholder: t("common.search"),
20756
+ className: "pl-10 w-full",
20757
+ onKeyDown: (e) => {
20758
+ if (e.key === "Enter") {
20759
+ handleSearchSubmit(e.target.value);
20760
+ }
20761
+ }
20762
+ }
20763
+ )
20764
+ ] }) }),
20765
+ !searchEnabled && /* @__PURE__ */ jsx(Box, { className: "flex-1" }),
20766
+ /* @__PURE__ */ jsxs(HStack, { align: "center", gap: "xs", children: [
20767
+ headerActions,
20768
+ showThemeToggle && /* @__PURE__ */ jsx(ThemeToggle, {}),
20769
+ topBarActions.map((action, idx) => /* @__PURE__ */ jsxs(
20770
+ Button,
20771
+ {
20772
+ variant: "ghost",
20773
+ className: "relative p-2 rounded-full hover:bg-muted dark:hover:bg-muted",
20774
+ onClick: () => handleTopBarActionClick(action.event),
20775
+ "aria-label": action.label ?? action.icon,
20776
+ children: [
20777
+ /* @__PURE__ */ jsx(Icon, { name: action.icon, className: "h-5 w-5 text-muted-foreground dark:text-muted-foreground" }),
20778
+ action.badge !== void 0 && action.badge !== null && action.badge !== 0 && action.badge !== "" && /* @__PURE__ */ jsx(
20779
+ Box,
20780
+ {
20781
+ as: "span",
20782
+ className: cn(
20783
+ "absolute -top-0.5 -right-0.5 min-w-[18px] h-[18px] px-1 rounded-full text-[10px] font-semibold text-white flex items-center justify-center",
20784
+ action.variant === "danger" ? "bg-error" : action.variant === "primary" ? "bg-primary" : "bg-foreground"
20785
+ ),
20786
+ children: action.badge
20787
+ }
20788
+ )
20789
+ ]
20790
+ },
20791
+ `${action.event}-${idx}`
20792
+ )),
20793
+ notificationsEnabled && /* @__PURE__ */ jsxs(
20794
+ Button,
20795
+ {
20796
+ variant: "ghost",
20797
+ className: "relative p-2 rounded-full hover:bg-muted dark:hover:bg-muted",
20798
+ onClick: handleNotificationClick,
20799
+ "aria-label": t("common.notifications"),
20800
+ children: [
20801
+ /* @__PURE__ */ jsx(Bell, { className: "h-5 w-5 text-muted-foreground dark:text-muted-foreground" }),
20802
+ unreadCount > 0 && /* @__PURE__ */ jsx(
20803
+ Box,
20804
+ {
20805
+ as: "span",
20806
+ className: "absolute -top-0.5 -right-0.5 min-w-[18px] h-[18px] px-1 bg-error rounded-full text-[10px] font-semibold text-white flex items-center justify-center",
20807
+ children: unreadCount > 99 ? "99+" : unreadCount
20808
+ }
20809
+ )
20810
+ ]
20824
20811
  }
20825
20812
  ),
20826
- /* @__PURE__ */ jsxs(Box, { className: "absolute right-0 mt-2 w-48 bg-card dark:bg-card rounded-lg shadow-lg border border-border dark:border-border py-1 z-30", children: [
20827
- /* @__PURE__ */ jsxs(Box, { className: "px-4 py-2 border-b border-border dark:border-border", children: [
20828
- /* @__PURE__ */ jsx(
20829
- Typography,
20830
- {
20831
- variant: "small",
20832
- className: "text-sm font-medium text-foreground dark:text-foreground",
20833
- as: "p",
20834
- children: user.name
20835
- }
20836
- ),
20837
- /* @__PURE__ */ jsx(
20838
- Typography,
20839
- {
20840
- variant: "caption",
20841
- className: "text-xs text-muted-foreground dark:text-muted-foreground",
20842
- as: "p",
20843
- children: user.email
20844
- }
20845
- )
20846
- ] }),
20813
+ user && /* @__PURE__ */ jsxs(Box, { className: "relative", children: [
20847
20814
  /* @__PURE__ */ jsxs(
20848
20815
  Button,
20849
20816
  {
20850
20817
  variant: "ghost",
20851
- onClick: () => {
20852
- setUserMenuOpen(false);
20853
- handleSignOut?.();
20854
- },
20855
- className: "w-full flex items-center gap-2 px-4 py-2 text-sm text-error dark:text-error hover:bg-error/10 dark:hover:bg-error/20",
20818
+ className: "flex items-center gap-2 p-2 rounded-lg hover:bg-muted dark:hover:bg-muted",
20819
+ onClick: () => setUserMenuOpen(!userMenuOpen),
20856
20820
  children: [
20857
- /* @__PURE__ */ jsx(LogOut, { className: "h-4 w-4" }),
20858
- t("auth.signOut")
20821
+ /* @__PURE__ */ jsx(
20822
+ Avatar,
20823
+ {
20824
+ src: user.avatar,
20825
+ alt: user.name,
20826
+ initials: user.name.split(" ").map((n) => n[0]).join("").substring(0, 2),
20827
+ size: "sm"
20828
+ }
20829
+ ),
20830
+ /* @__PURE__ */ jsx(
20831
+ Typography,
20832
+ {
20833
+ variant: "small",
20834
+ className: "hidden sm:block text-sm font-medium text-foreground dark:text-foreground",
20835
+ as: "span",
20836
+ children: user.name
20837
+ }
20838
+ ),
20839
+ /* @__PURE__ */ jsx(ChevronDown, { className: "hidden sm:block h-4 w-4 text-muted-foreground dark:text-muted-foreground" })
20859
20840
  ]
20860
20841
  }
20861
- )
20842
+ ),
20843
+ userMenuOpen && /* @__PURE__ */ jsxs(Fragment, { children: [
20844
+ /* @__PURE__ */ jsx(
20845
+ Box,
20846
+ {
20847
+ className: "fixed inset-0 z-20",
20848
+ onClick: () => setUserMenuOpen(false)
20849
+ }
20850
+ ),
20851
+ /* @__PURE__ */ jsxs(Box, { className: "absolute right-0 mt-2 w-48 bg-card dark:bg-card rounded-lg shadow-lg border border-border dark:border-border py-1 z-30", children: [
20852
+ /* @__PURE__ */ jsxs(Box, { className: "px-4 py-2 border-b border-border dark:border-border", children: [
20853
+ /* @__PURE__ */ jsx(
20854
+ Typography,
20855
+ {
20856
+ variant: "small",
20857
+ className: "text-sm font-medium text-foreground dark:text-foreground",
20858
+ as: "p",
20859
+ children: user.name
20860
+ }
20861
+ ),
20862
+ /* @__PURE__ */ jsx(
20863
+ Typography,
20864
+ {
20865
+ variant: "caption",
20866
+ className: "text-xs text-muted-foreground dark:text-muted-foreground",
20867
+ as: "p",
20868
+ children: user.email
20869
+ }
20870
+ )
20871
+ ] }),
20872
+ /* @__PURE__ */ jsxs(
20873
+ Button,
20874
+ {
20875
+ variant: "ghost",
20876
+ onClick: () => {
20877
+ setUserMenuOpen(false);
20878
+ handleSignOut?.();
20879
+ },
20880
+ className: "w-full flex items-center gap-2 px-4 py-2 text-sm text-error dark:text-error hover:bg-error/10 dark:hover:bg-error/20",
20881
+ children: [
20882
+ /* @__PURE__ */ jsx(LogOut, { className: "h-4 w-4" }),
20883
+ t("auth.signOut")
20884
+ ]
20885
+ }
20886
+ )
20887
+ ] })
20888
+ ] })
20862
20889
  ] })
20863
20890
  ] })
20864
- ] })
20865
- ] })
20866
- ]
20891
+ ]
20892
+ }
20893
+ )
20867
20894
  }
20868
- )
20869
- }
20870
- ),
20871
- /* @__PURE__ */ jsx(Box, { as: "main", className: "p-4 sm:p-6", children })
20872
- ] })
20873
- ] });
20895
+ ),
20896
+ /* @__PURE__ */ jsx(Box, { as: "main", className: "flex-1 p-3 sm:p-4 md:p-6", children })
20897
+ ] })
20898
+ ]
20899
+ }
20900
+ );
20874
20901
  };
20875
20902
  DashboardLayout.displayName = "DashboardLayout";
20876
20903
  NavLink = ({
@@ -21364,13 +21391,13 @@ function DataList({
21364
21391
  }) {
21365
21392
  const eventBus = useEventBus();
21366
21393
  const { t } = useTranslate();
21367
- const [visibleCount, setVisibleCount] = React118__default.useState(pageSize || Infinity);
21394
+ const [visibleCount, setVisibleCount] = React119__default.useState(pageSize || Infinity);
21368
21395
  const fieldDefs = fields ?? columns ?? [];
21369
21396
  const allData = Array.isArray(entity) ? entity : entity ? [entity] : [];
21370
21397
  const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
21371
21398
  const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
21372
21399
  const hasRenderProp = typeof children === "function";
21373
- React118__default.useEffect(() => {
21400
+ React119__default.useEffect(() => {
21374
21401
  const renderItemTypeOf = typeof schemaRenderItem;
21375
21402
  const childrenTypeOf = typeof children;
21376
21403
  if (data.length > 0 && !hasRenderProp) {
@@ -21426,7 +21453,7 @@ function DataList({
21426
21453
  const items2 = data.map((item) => item);
21427
21454
  const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
21428
21455
  const contentField = titleField?.name ?? fieldDefs[0]?.name ?? "";
21429
- return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React118__default.Fragment, { children: [
21456
+ return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React119__default.Fragment, { children: [
21430
21457
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
21431
21458
  group.items.map((itemData, index) => {
21432
21459
  const id = itemData.id || `${gi}-${index}`;
@@ -21617,7 +21644,7 @@ function DataList({
21617
21644
  className
21618
21645
  ),
21619
21646
  children: [
21620
- groups.map((group, gi) => /* @__PURE__ */ jsxs(React118__default.Fragment, { children: [
21647
+ groups.map((group, gi) => /* @__PURE__ */ jsxs(React119__default.Fragment, { children: [
21621
21648
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
21622
21649
  group.items.map(
21623
21650
  (itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
@@ -22764,7 +22791,7 @@ var init_WizardProgress = __esm({
22764
22791
  children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
22765
22792
  const isActive = index === currentStep;
22766
22793
  const isCompleted = index < currentStep;
22767
- return /* @__PURE__ */ jsxs(React118__default.Fragment, { children: [
22794
+ return /* @__PURE__ */ jsxs(React119__default.Fragment, { children: [
22768
22795
  /* @__PURE__ */ jsx(
22769
22796
  "button",
22770
22797
  {
@@ -23675,7 +23702,7 @@ function InventoryGrid({
23675
23702
  const eventBus = useEventBus();
23676
23703
  const slotCount = totalSlots ?? items.length;
23677
23704
  const emptySlotCount = Math.max(0, slotCount - items.length);
23678
- const handleSelect = React118.useCallback(
23705
+ const handleSelect = React119.useCallback(
23679
23706
  (id) => {
23680
23707
  onSelect?.(id);
23681
23708
  if (selectEvent) {
@@ -23888,15 +23915,15 @@ function GameCanvas2D({
23888
23915
  fps = 60,
23889
23916
  className
23890
23917
  }) {
23891
- const canvasRef = React118.useRef(null);
23892
- const rafRef = React118.useRef(0);
23893
- const frameRef = React118.useRef(0);
23894
- const lastTimeRef = React118.useRef(0);
23895
- const onDrawRef = React118.useRef(onDraw);
23918
+ const canvasRef = React119.useRef(null);
23919
+ const rafRef = React119.useRef(0);
23920
+ const frameRef = React119.useRef(0);
23921
+ const lastTimeRef = React119.useRef(0);
23922
+ const onDrawRef = React119.useRef(onDraw);
23896
23923
  onDrawRef.current = onDraw;
23897
- const onTickRef = React118.useRef(onTick);
23924
+ const onTickRef = React119.useRef(onTick);
23898
23925
  onTickRef.current = onTick;
23899
- React118.useEffect(() => {
23926
+ React119.useEffect(() => {
23900
23927
  const canvas = canvasRef.current;
23901
23928
  if (!canvas) return;
23902
23929
  const ctx = canvas.getContext("2d");
@@ -24185,7 +24212,7 @@ function TurnPanel({
24185
24212
  className
24186
24213
  }) {
24187
24214
  const eventBus = useEventBus();
24188
- const handleAction = React118.useCallback(
24215
+ const handleAction = React119.useCallback(
24189
24216
  (event) => {
24190
24217
  if (event) {
24191
24218
  eventBus.emit(event, { turn: currentTurn, phase, activeTeam });
@@ -24331,7 +24358,7 @@ function UnitCommandBar({
24331
24358
  className
24332
24359
  }) {
24333
24360
  const eventBus = useEventBus();
24334
- const handleCommand = React118.useCallback(
24361
+ const handleCommand = React119.useCallback(
24335
24362
  (event) => {
24336
24363
  if (event) {
24337
24364
  eventBus.emit(event, { unitId: selectedUnitId });
@@ -24816,7 +24843,7 @@ function GameMenu({
24816
24843
  } catch {
24817
24844
  }
24818
24845
  const eventBus = eventBusProp || eventBusFromHook;
24819
- const handleOptionClick = React118.useCallback(
24846
+ const handleOptionClick = React119.useCallback(
24820
24847
  (option) => {
24821
24848
  if (option.event && eventBus) {
24822
24849
  eventBus.emit(`UI:${option.event}`, { option });
@@ -24930,7 +24957,7 @@ function GameOverScreen({
24930
24957
  } catch {
24931
24958
  }
24932
24959
  const eventBus = eventBusProp || eventBusFromHook;
24933
- const handleActionClick = React118.useCallback(
24960
+ const handleActionClick = React119.useCallback(
24934
24961
  (action) => {
24935
24962
  if (action.event && eventBus) {
24936
24963
  eventBus.emit(`UI:${action.event}`, { action });
@@ -28419,7 +28446,7 @@ var init_DocumentViewer = __esm({
28419
28446
  }
28420
28447
  });
28421
28448
  function extractTitle(children) {
28422
- if (!React118__default.isValidElement(children)) return void 0;
28449
+ if (!React119__default.isValidElement(children)) return void 0;
28423
28450
  const props = children.props;
28424
28451
  if (typeof props.title === "string") {
28425
28452
  return props.title;
@@ -28474,7 +28501,7 @@ function LinearView({
28474
28501
  /* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
28475
28502
  const isDone = i < currentIdx;
28476
28503
  const isCurrent = i === currentIdx;
28477
- return /* @__PURE__ */ jsxs(React118__default.Fragment, { children: [
28504
+ return /* @__PURE__ */ jsxs(React119__default.Fragment, { children: [
28478
28505
  i > 0 && /* @__PURE__ */ jsx(
28479
28506
  Typography,
28480
28507
  {
@@ -29258,12 +29285,12 @@ var init_Form = __esm({
29258
29285
  const isSchemaEntity = isOrbitalEntitySchema(entity);
29259
29286
  const resolvedEntity = isSchemaEntity ? entity : void 0;
29260
29287
  const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
29261
- const normalizedInitialData = React118__default.useMemo(() => {
29288
+ const normalizedInitialData = React119__default.useMemo(() => {
29262
29289
  const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
29263
29290
  const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
29264
29291
  return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
29265
29292
  }, [entity, initialData]);
29266
- const entityDerivedFields = React118__default.useMemo(() => {
29293
+ const entityDerivedFields = React119__default.useMemo(() => {
29267
29294
  if (fields && fields.length > 0) return void 0;
29268
29295
  if (!resolvedEntity) return void 0;
29269
29296
  return resolvedEntity.fields.map(
@@ -29282,16 +29309,16 @@ var init_Form = __esm({
29282
29309
  const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
29283
29310
  const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
29284
29311
  const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
29285
- const [formData, setFormData] = React118__default.useState(
29312
+ const [formData, setFormData] = React119__default.useState(
29286
29313
  normalizedInitialData
29287
29314
  );
29288
- const [collapsedSections, setCollapsedSections] = React118__default.useState(
29315
+ const [collapsedSections, setCollapsedSections] = React119__default.useState(
29289
29316
  /* @__PURE__ */ new Set()
29290
29317
  );
29291
- const [submitError, setSubmitError] = React118__default.useState(null);
29292
- const formRef = React118__default.useRef(null);
29318
+ const [submitError, setSubmitError] = React119__default.useState(null);
29319
+ const formRef = React119__default.useRef(null);
29293
29320
  const formMode = props.mode;
29294
- const mountedRef = React118__default.useRef(false);
29321
+ const mountedRef = React119__default.useRef(false);
29295
29322
  if (!mountedRef.current) {
29296
29323
  mountedRef.current = true;
29297
29324
  debug("forms", "mount", {
@@ -29304,7 +29331,7 @@ var init_Form = __esm({
29304
29331
  });
29305
29332
  }
29306
29333
  const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
29307
- const evalContext = React118__default.useMemo(
29334
+ const evalContext = React119__default.useMemo(
29308
29335
  () => ({
29309
29336
  formValues: formData,
29310
29337
  globalVariables: externalContext?.globalVariables ?? {},
@@ -29313,7 +29340,7 @@ var init_Form = __esm({
29313
29340
  }),
29314
29341
  [formData, externalContext]
29315
29342
  );
29316
- React118__default.useEffect(() => {
29343
+ React119__default.useEffect(() => {
29317
29344
  debug("forms", "initialData-sync", {
29318
29345
  mode: formMode,
29319
29346
  normalizedInitialData,
@@ -29324,7 +29351,7 @@ var init_Form = __esm({
29324
29351
  setFormData(normalizedInitialData);
29325
29352
  }
29326
29353
  }, [normalizedInitialData]);
29327
- const processCalculations = React118__default.useCallback(
29354
+ const processCalculations = React119__default.useCallback(
29328
29355
  (changedFieldId, newFormData) => {
29329
29356
  if (!hiddenCalculations.length) return;
29330
29357
  const context = {
@@ -29349,7 +29376,7 @@ var init_Form = __esm({
29349
29376
  },
29350
29377
  [hiddenCalculations, externalContext, eventBus]
29351
29378
  );
29352
- const checkViolations = React118__default.useCallback(
29379
+ const checkViolations = React119__default.useCallback(
29353
29380
  (changedFieldId, newFormData) => {
29354
29381
  if (!violationTriggers.length) return;
29355
29382
  const context = {
@@ -29387,7 +29414,7 @@ var init_Form = __esm({
29387
29414
  processCalculations(name, newFormData);
29388
29415
  checkViolations(name, newFormData);
29389
29416
  };
29390
- const isFieldVisible = React118__default.useCallback(
29417
+ const isFieldVisible = React119__default.useCallback(
29391
29418
  (fieldName) => {
29392
29419
  const condition = conditionalFields[fieldName];
29393
29420
  if (!condition) return true;
@@ -29395,7 +29422,7 @@ var init_Form = __esm({
29395
29422
  },
29396
29423
  [conditionalFields, evalContext]
29397
29424
  );
29398
- const isSectionVisible = React118__default.useCallback(
29425
+ const isSectionVisible = React119__default.useCallback(
29399
29426
  (section) => {
29400
29427
  if (!section.condition) return true;
29401
29428
  return Boolean(evaluateFormExpression(section.condition, evalContext));
@@ -29471,7 +29498,7 @@ var init_Form = __esm({
29471
29498
  eventBus.emit(`UI:${onCancel}`);
29472
29499
  }
29473
29500
  };
29474
- const renderField = React118__default.useCallback(
29501
+ const renderField = React119__default.useCallback(
29475
29502
  (field) => {
29476
29503
  const fieldName = field.name || field.field;
29477
29504
  if (!fieldName) return null;
@@ -29492,7 +29519,7 @@ var init_Form = __esm({
29492
29519
  [formData, isFieldVisible, relationsData, relationsLoading, isLoading]
29493
29520
  );
29494
29521
  const effectiveFields = entityDerivedFields ?? fields;
29495
- const normalizedFields = React118__default.useMemo(() => {
29522
+ const normalizedFields = React119__default.useMemo(() => {
29496
29523
  if (!effectiveFields || effectiveFields.length === 0) return [];
29497
29524
  return effectiveFields.map((field) => {
29498
29525
  if (typeof field === "string") {
@@ -29514,7 +29541,7 @@ var init_Form = __esm({
29514
29541
  return field;
29515
29542
  });
29516
29543
  }, [effectiveFields, resolvedEntity]);
29517
- const schemaFields = React118__default.useMemo(() => {
29544
+ const schemaFields = React119__default.useMemo(() => {
29518
29545
  if (normalizedFields.length === 0) return null;
29519
29546
  if (isDebugEnabled()) {
29520
29547
  debugGroup(`Form: ${entityName || "unknown"}`);
@@ -29524,7 +29551,7 @@ var init_Form = __esm({
29524
29551
  }
29525
29552
  return normalizedFields.map(renderField).filter(Boolean);
29526
29553
  }, [normalizedFields, renderField, entityName, conditionalFields]);
29527
- const sectionElements = React118__default.useMemo(() => {
29554
+ const sectionElements = React119__default.useMemo(() => {
29528
29555
  if (!sections || sections.length === 0) return null;
29529
29556
  return sections.map((section) => {
29530
29557
  if (!isSectionVisible(section)) {
@@ -31056,7 +31083,7 @@ var init_List = __esm({
31056
31083
  if (entity && typeof entity === "object" && "id" in entity) return [entity];
31057
31084
  return [];
31058
31085
  }, [entity]);
31059
- const getItemActions = React118__default.useCallback(
31086
+ const getItemActions = React119__default.useCallback(
31060
31087
  (item) => {
31061
31088
  if (!itemActions) return [];
31062
31089
  if (typeof itemActions === "function") {
@@ -31493,7 +31520,7 @@ var init_MediaGallery = __esm({
31493
31520
  [selectable, selectedItems, selectionEvent, eventBus]
31494
31521
  );
31495
31522
  const entityData = Array.isArray(entity) ? entity : [];
31496
- const items = React118__default.useMemo(() => {
31523
+ const items = React119__default.useMemo(() => {
31497
31524
  if (propItems) return propItems;
31498
31525
  if (entityData.length === 0) return [];
31499
31526
  return entityData.map((record, idx) => ({
@@ -31657,7 +31684,7 @@ var init_MediaGallery = __esm({
31657
31684
  }
31658
31685
  });
31659
31686
  function extractTitle2(children) {
31660
- if (!React118__default.isValidElement(children)) return void 0;
31687
+ if (!React119__default.isValidElement(children)) return void 0;
31661
31688
  const props = children.props;
31662
31689
  if (typeof props.title === "string") {
31663
31690
  return props.title;
@@ -32370,7 +32397,7 @@ var init_PageHeader = __esm({
32370
32397
  info: "bg-info/10 text-info"
32371
32398
  };
32372
32399
  return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
32373
- 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(React118__default.Fragment, { children: [
32400
+ 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(React119__default.Fragment, { children: [
32374
32401
  idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
32375
32402
  crumb.href ? /* @__PURE__ */ jsx(
32376
32403
  "a",
@@ -32563,7 +32590,7 @@ var init_debugRegistry = __esm({
32563
32590
  }
32564
32591
  });
32565
32592
  function useDebugData() {
32566
- const [data, setData] = React118.useState(() => ({
32593
+ const [data, setData] = React119.useState(() => ({
32567
32594
  traits: [],
32568
32595
  ticks: [],
32569
32596
  guards: [],
@@ -32577,7 +32604,7 @@ function useDebugData() {
32577
32604
  },
32578
32605
  lastUpdate: Date.now()
32579
32606
  }));
32580
- React118.useEffect(() => {
32607
+ React119.useEffect(() => {
32581
32608
  const updateData = () => {
32582
32609
  setData({
32583
32610
  traits: getAllTraits(),
@@ -32686,12 +32713,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
32686
32713
  return positions;
32687
32714
  }
32688
32715
  function WalkMinimap() {
32689
- const [walkStep, setWalkStep] = React118.useState(null);
32690
- const [traits2, setTraits] = React118.useState([]);
32691
- const [coveredEdges, setCoveredEdges] = React118.useState([]);
32692
- const [completedTraits, setCompletedTraits] = React118.useState(/* @__PURE__ */ new Set());
32693
- const prevTraitRef = React118.useRef(null);
32694
- React118.useEffect(() => {
32716
+ const [walkStep, setWalkStep] = React119.useState(null);
32717
+ const [traits2, setTraits] = React119.useState([]);
32718
+ const [coveredEdges, setCoveredEdges] = React119.useState([]);
32719
+ const [completedTraits, setCompletedTraits] = React119.useState(/* @__PURE__ */ new Set());
32720
+ const prevTraitRef = React119.useRef(null);
32721
+ React119.useEffect(() => {
32695
32722
  const interval = setInterval(() => {
32696
32723
  const w = window;
32697
32724
  const step = w.__orbitalWalkStep;
@@ -33138,15 +33165,15 @@ var init_EntitiesTab = __esm({
33138
33165
  }
33139
33166
  });
33140
33167
  function EventFlowTab({ events: events2 }) {
33141
- const [filter, setFilter] = React118.useState("all");
33142
- const containerRef = React118.useRef(null);
33143
- const [autoScroll, setAutoScroll] = React118.useState(true);
33144
- React118.useEffect(() => {
33168
+ const [filter, setFilter] = React119.useState("all");
33169
+ const containerRef = React119.useRef(null);
33170
+ const [autoScroll, setAutoScroll] = React119.useState(true);
33171
+ React119.useEffect(() => {
33145
33172
  if (autoScroll && containerRef.current) {
33146
33173
  containerRef.current.scrollTop = containerRef.current.scrollHeight;
33147
33174
  }
33148
33175
  }, [events2.length, autoScroll]);
33149
- const filteredEvents = React118.useMemo(() => {
33176
+ const filteredEvents = React119.useMemo(() => {
33150
33177
  if (filter === "all") return events2;
33151
33178
  return events2.filter((e) => e.type === filter);
33152
33179
  }, [events2, filter]);
@@ -33265,7 +33292,7 @@ var init_EventFlowTab = __esm({
33265
33292
  }
33266
33293
  });
33267
33294
  function GuardsPanel({ guards }) {
33268
- const [filter, setFilter] = React118.useState("all");
33295
+ const [filter, setFilter] = React119.useState("all");
33269
33296
  if (guards.length === 0) {
33270
33297
  return /* @__PURE__ */ jsx(
33271
33298
  EmptyState,
@@ -33278,7 +33305,7 @@ function GuardsPanel({ guards }) {
33278
33305
  }
33279
33306
  const passedCount = guards.filter((g) => g.result).length;
33280
33307
  const failedCount = guards.length - passedCount;
33281
- const filteredGuards = React118.useMemo(() => {
33308
+ const filteredGuards = React119.useMemo(() => {
33282
33309
  if (filter === "all") return guards;
33283
33310
  if (filter === "passed") return guards.filter((g) => g.result);
33284
33311
  return guards.filter((g) => !g.result);
@@ -33439,10 +33466,10 @@ function EffectBadge({ effect }) {
33439
33466
  ] });
33440
33467
  }
33441
33468
  function TransitionTimeline({ transitions }) {
33442
- const containerRef = React118.useRef(null);
33443
- const [autoScroll, setAutoScroll] = React118.useState(true);
33444
- const [expandedId, setExpandedId] = React118.useState(null);
33445
- React118.useEffect(() => {
33469
+ const containerRef = React119.useRef(null);
33470
+ const [autoScroll, setAutoScroll] = React119.useState(true);
33471
+ const [expandedId, setExpandedId] = React119.useState(null);
33472
+ React119.useEffect(() => {
33446
33473
  if (autoScroll && containerRef.current) {
33447
33474
  containerRef.current.scrollTop = containerRef.current.scrollHeight;
33448
33475
  }
@@ -33728,9 +33755,9 @@ function getAllEvents(traits2) {
33728
33755
  }
33729
33756
  function EventDispatcherTab({ traits: traits2, schema }) {
33730
33757
  const eventBus = useEventBus();
33731
- const [log4, setLog] = React118.useState([]);
33732
- const prevStatesRef = React118.useRef(/* @__PURE__ */ new Map());
33733
- React118.useEffect(() => {
33758
+ const [log4, setLog] = React119.useState([]);
33759
+ const prevStatesRef = React119.useRef(/* @__PURE__ */ new Map());
33760
+ React119.useEffect(() => {
33734
33761
  for (const trait of traits2) {
33735
33762
  const prev = prevStatesRef.current.get(trait.id);
33736
33763
  if (prev && prev !== trait.currentState) {
@@ -33900,10 +33927,10 @@ function VerifyModePanel({
33900
33927
  serverCount,
33901
33928
  localCount
33902
33929
  }) {
33903
- const [expanded, setExpanded] = React118.useState(true);
33904
- const scrollRef = React118.useRef(null);
33905
- const prevCountRef = React118.useRef(0);
33906
- React118.useEffect(() => {
33930
+ const [expanded, setExpanded] = React119.useState(true);
33931
+ const scrollRef = React119.useRef(null);
33932
+ const prevCountRef = React119.useRef(0);
33933
+ React119.useEffect(() => {
33907
33934
  if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
33908
33935
  scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
33909
33936
  }
@@ -33969,10 +33996,10 @@ function RuntimeDebugger({
33969
33996
  defaultTab,
33970
33997
  schema
33971
33998
  }) {
33972
- const [isCollapsed, setIsCollapsed] = React118.useState(mode === "verify" ? true : defaultCollapsed);
33973
- const [isVisible, setIsVisible] = React118.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
33999
+ const [isCollapsed, setIsCollapsed] = React119.useState(mode === "verify" ? true : defaultCollapsed);
34000
+ const [isVisible, setIsVisible] = React119.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
33974
34001
  const debugData = useDebugData();
33975
- React118.useEffect(() => {
34002
+ React119.useEffect(() => {
33976
34003
  if (mode === "inline") return;
33977
34004
  return onDebugToggle((enabled) => {
33978
34005
  setIsVisible(enabled);
@@ -33981,7 +34008,7 @@ function RuntimeDebugger({
33981
34008
  }
33982
34009
  });
33983
34010
  }, [mode]);
33984
- React118.useEffect(() => {
34011
+ React119.useEffect(() => {
33985
34012
  if (mode === "inline") return;
33986
34013
  const handleKeyDown = (e) => {
33987
34014
  if (e.key === "`" && isVisible) {
@@ -34530,7 +34557,7 @@ function SequenceBar({
34530
34557
  onSlotRemove(index);
34531
34558
  }, [onSlotRemove, playing]);
34532
34559
  const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
34533
- return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React118__default.Fragment, { children: [
34560
+ return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React119__default.Fragment, { children: [
34534
34561
  i > 0 && /* @__PURE__ */ jsx(
34535
34562
  Typography,
34536
34563
  {
@@ -35875,7 +35902,7 @@ var init_StatCard = __esm({
35875
35902
  const labelToUse = propLabel ?? propTitle;
35876
35903
  const eventBus = useEventBus();
35877
35904
  const { t } = useTranslate();
35878
- const handleActionClick = React118__default.useCallback(() => {
35905
+ const handleActionClick = React119__default.useCallback(() => {
35879
35906
  if (action?.event) {
35880
35907
  eventBus.emit(`UI:${action.event}`, {});
35881
35908
  }
@@ -35886,7 +35913,7 @@ var init_StatCard = __esm({
35886
35913
  const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
35887
35914
  const isLoading = externalLoading ?? false;
35888
35915
  const error = externalError;
35889
- const computeMetricValue = React118__default.useCallback(
35916
+ const computeMetricValue = React119__default.useCallback(
35890
35917
  (metric, items) => {
35891
35918
  if (metric.value !== void 0) {
35892
35919
  return metric.value;
@@ -35925,7 +35952,7 @@ var init_StatCard = __esm({
35925
35952
  },
35926
35953
  []
35927
35954
  );
35928
- const schemaStats = React118__default.useMemo(() => {
35955
+ const schemaStats = React119__default.useMemo(() => {
35929
35956
  if (!metrics || metrics.length === 0) return null;
35930
35957
  return metrics.map((metric) => ({
35931
35958
  label: metric.label,
@@ -35933,7 +35960,7 @@ var init_StatCard = __esm({
35933
35960
  format: metric.format
35934
35961
  }));
35935
35962
  }, [metrics, data, computeMetricValue]);
35936
- const calculatedTrend = React118__default.useMemo(() => {
35963
+ const calculatedTrend = React119__default.useMemo(() => {
35937
35964
  if (manualTrend !== void 0) return manualTrend;
35938
35965
  if (previousValue === void 0 || currentValue === void 0)
35939
35966
  return void 0;
@@ -36917,7 +36944,7 @@ var init_Timeline = __esm({
36917
36944
  }) => {
36918
36945
  const { t } = useTranslate();
36919
36946
  const entityData = Array.isArray(entity) ? entity : [];
36920
- const items = React118__default.useMemo(() => {
36947
+ const items = React119__default.useMemo(() => {
36921
36948
  if (propItems) return propItems;
36922
36949
  if (entityData.length === 0) return [];
36923
36950
  return entityData.map((record, idx) => {
@@ -37024,7 +37051,7 @@ var init_Timeline = __esm({
37024
37051
  }
37025
37052
  });
37026
37053
  function extractToastProps(children) {
37027
- if (!React118__default.isValidElement(children)) {
37054
+ if (!React119__default.isValidElement(children)) {
37028
37055
  if (typeof children === "string") {
37029
37056
  return { message: children };
37030
37057
  }
@@ -37062,7 +37089,7 @@ var init_ToastSlot = __esm({
37062
37089
  eventBus.emit("UI:CLOSE");
37063
37090
  };
37064
37091
  if (!isVisible) return null;
37065
- const isCustomContent = React118__default.isValidElement(children) && !message;
37092
+ const isCustomContent = React119__default.isValidElement(children) && !message;
37066
37093
  return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
37067
37094
  Toast,
37068
37095
  {
@@ -37331,7 +37358,7 @@ var init_WizardContainer = __esm({
37331
37358
  const isCompleted = index < currentStep;
37332
37359
  const stepKey = step.id ?? step.tabId ?? `step-${index}`;
37333
37360
  const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
37334
- return /* @__PURE__ */ jsxs(React118__default.Fragment, { children: [
37361
+ return /* @__PURE__ */ jsxs(React119__default.Fragment, { children: [
37335
37362
  /* @__PURE__ */ jsx(
37336
37363
  Button,
37337
37364
  {
@@ -39520,7 +39547,7 @@ function UnitRenderer({
39520
39547
  onAnimationStateChange,
39521
39548
  animationSpeed = 1
39522
39549
  }) {
39523
- const handleUnitClick = React118__default.useCallback(
39550
+ const handleUnitClick = React119__default.useCallback(
39524
39551
  (unit) => {
39525
39552
  onUnitClick?.(unit);
39526
39553
  },
@@ -42714,7 +42741,7 @@ var init_Avl3DViewer = __esm({
42714
42741
  const handleTraitClick = useCallback((name) => {
42715
42742
  dispatch({ type: "ZOOM_INTO_TRAIT", trait: name, targetPosition: { x: 0, y: 0 } });
42716
42743
  }, []);
42717
- const [highlightedTrait, setHighlightedTrait] = React118__default.useState(null);
42744
+ const [highlightedTrait, setHighlightedTrait] = React119__default.useState(null);
42718
42745
  const handleTransitionClick = useCallback((index) => {
42719
42746
  dispatch({ type: "ZOOM_INTO_TRANSITION", transitionIndex: index, targetPosition: { x: 0, y: 0 } });
42720
42747
  }, []);
@@ -42801,7 +42828,7 @@ var init_Avl3DViewer = __esm({
42801
42828
  gap: "xs",
42802
42829
  align: "center",
42803
42830
  className: "absolute top-2 left-2 z-10 bg-surface/80 backdrop-blur rounded-md px-3 py-1.5",
42804
- children: breadcrumbs.map((crumb, i) => /* @__PURE__ */ jsxs(React118__default.Fragment, { children: [
42831
+ children: breadcrumbs.map((crumb, i) => /* @__PURE__ */ jsxs(React119__default.Fragment, { children: [
42805
42832
  i > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", className: "mx-1", children: "/" }),
42806
42833
  i < breadcrumbs.length - 1 ? /* @__PURE__ */ jsx(
42807
42834
  Box,
@@ -43179,12 +43206,12 @@ var init_three = __esm({
43179
43206
  }
43180
43207
  });
43181
43208
  function lazyThree(name, loader) {
43182
- const Lazy = React118__default.lazy(() => loader().then((m) => ({ default: m[name] })));
43209
+ const Lazy = React119__default.lazy(() => loader().then((m) => ({ default: m[name] })));
43183
43210
  function ThreeWrapper(props) {
43184
- return React118__default.createElement(
43185
- React118__default.Suspense,
43211
+ return React119__default.createElement(
43212
+ React119__default.Suspense,
43186
43213
  { fallback: null },
43187
- React118__default.createElement(Lazy, props)
43214
+ React119__default.createElement(Lazy, props)
43188
43215
  );
43189
43216
  }
43190
43217
  ThreeWrapper.displayName = `Lazy(${name})`;
@@ -43672,7 +43699,7 @@ function SuspenseConfigProvider({
43672
43699
  config,
43673
43700
  children
43674
43701
  }) {
43675
- return React118__default.createElement(
43702
+ return React119__default.createElement(
43676
43703
  SuspenseConfigContext.Provider,
43677
43704
  { value: config },
43678
43705
  children
@@ -44155,7 +44182,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
44155
44182
  const key = `${parentId}-${index}-trait:${traitName}`;
44156
44183
  return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
44157
44184
  }
44158
- return /* @__PURE__ */ jsx(React118__default.Fragment, { children: child }, `${parentId}-${index}`);
44185
+ return /* @__PURE__ */ jsx(React119__default.Fragment, { children: child }, `${parentId}-${index}`);
44159
44186
  }
44160
44187
  if (!child || typeof child !== "object") return null;
44161
44188
  const childId = `${parentId}-${index}`;
@@ -44192,14 +44219,14 @@ function isPatternConfig(value) {
44192
44219
  if (value === null || value === void 0) return false;
44193
44220
  if (typeof value !== "object") return false;
44194
44221
  if (Array.isArray(value)) return false;
44195
- if (React118__default.isValidElement(value)) return false;
44222
+ if (React119__default.isValidElement(value)) return false;
44196
44223
  if (value instanceof Date) return false;
44197
44224
  if (typeof value === "function") return false;
44198
44225
  const record = value;
44199
44226
  return "type" in record && typeof record.type === "string";
44200
44227
  }
44201
44228
  function isPlainConfigObject(value) {
44202
- if (React118__default.isValidElement(value)) return false;
44229
+ if (React119__default.isValidElement(value)) return false;
44203
44230
  if (value instanceof Date) return false;
44204
44231
  const proto = Object.getPrototypeOf(value);
44205
44232
  return proto === Object.prototype || proto === null;
@@ -44860,7 +44887,7 @@ var AvlTransition = ({
44860
44887
  opacity = 1,
44861
44888
  className
44862
44889
  }) => {
44863
- const ids = React118__default.useMemo(() => {
44890
+ const ids = React119__default.useMemo(() => {
44864
44891
  avlTransitionId += 1;
44865
44892
  return { arrow: `avl-tr-${avlTransitionId}-arrow` };
44866
44893
  }, []);
@@ -45621,7 +45648,7 @@ var AvlStateMachine = ({
45621
45648
  color = "var(--color-primary)",
45622
45649
  animated = false
45623
45650
  }) => {
45624
- const ids = React118__default.useMemo(() => {
45651
+ const ids = React119__default.useMemo(() => {
45625
45652
  avlSmId += 1;
45626
45653
  const base = `avl-sm-${avlSmId}`;
45627
45654
  return { glow: `${base}-glow`, grad: `${base}-grad` };
@@ -45816,7 +45843,7 @@ var AvlOrbitalUnit = ({
45816
45843
  color = "var(--color-primary)",
45817
45844
  animated = false
45818
45845
  }) => {
45819
- const ids = React118__default.useMemo(() => {
45846
+ const ids = React119__default.useMemo(() => {
45820
45847
  avlOuId += 1;
45821
45848
  const base = `avl-ou-${avlOuId}`;
45822
45849
  return { glow: `${base}-glow`, grad: `${base}-grad` };
@@ -45908,7 +45935,7 @@ var AvlClosedCircuit = ({
45908
45935
  color = "var(--color-primary)",
45909
45936
  animated = false
45910
45937
  }) => {
45911
- const ids = React118__default.useMemo(() => {
45938
+ const ids = React119__default.useMemo(() => {
45912
45939
  avlCcId += 1;
45913
45940
  const base = `avl-cc-${avlCcId}`;
45914
45941
  return { glow: `${base}-glow`, grad: `${base}-grad`, arrow: `${base}-arrow` };
@@ -46061,7 +46088,7 @@ var AvlEmitListen = ({
46061
46088
  color = "var(--color-primary)",
46062
46089
  animated = false
46063
46090
  }) => {
46064
- const ids = React118__default.useMemo(() => {
46091
+ const ids = React119__default.useMemo(() => {
46065
46092
  avlElId += 1;
46066
46093
  const base = `avl-el-${avlElId}`;
46067
46094
  return { arrow: `${base}-arrow`, grad: `${base}-grad` };
@@ -46334,7 +46361,7 @@ function renderNode(node, color, glowId) {
46334
46361
  const baseR = node.type === "operator" ? 20 : 16;
46335
46362
  const r2 = Math.max(baseR, labelLen * 3.5 + 6);
46336
46363
  const nc = nodeColor(node.type, color);
46337
- return /* @__PURE__ */ jsxs(React118__default.Fragment, { children: [
46364
+ return /* @__PURE__ */ jsxs(React119__default.Fragment, { children: [
46338
46365
  node.children.map((child, i) => {
46339
46366
  const childR = Math.max(
46340
46367
  child.type === "operator" ? 20 : 16,
@@ -46391,7 +46418,7 @@ var AvlExprTree = ({
46391
46418
  className,
46392
46419
  color = "var(--color-primary)"
46393
46420
  }) => {
46394
- const ids = React118__default.useMemo(() => {
46421
+ const ids = React119__default.useMemo(() => {
46395
46422
  avlEtId += 1;
46396
46423
  return { glow: `avl-et-${avlEtId}-glow` };
46397
46424
  }, []);
@@ -47365,7 +47392,7 @@ var SystemNode = ({ data }) => {
47365
47392
  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) => {
47366
47393
  const tc = transitionCounts[s.name] ?? 0;
47367
47394
  const role = getStateRole(s.name, s.isInitial, s.isTerminal, tc, maxTC);
47368
- return /* @__PURE__ */ jsxs(React118__default.Fragment, { children: [
47395
+ return /* @__PURE__ */ jsxs(React119__default.Fragment, { children: [
47369
47396
  /* @__PURE__ */ jsx(AvlState, { x: i * 14 + 1, y: 1, width: 10, height: 8, name: "", role, isInitial: s.isInitial, isTerminal: s.isTerminal }),
47370
47397
  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 })
47371
47398
  ] }, s.name);
@@ -47405,7 +47432,7 @@ var MiniStateMachine = ({ data, className }) => {
47405
47432
  const x = 2 + i * (NODE_W + GAP + ARROW_W + GAP);
47406
47433
  const tc = transitionCounts[s.name] ?? 0;
47407
47434
  const role = getStateRole(s.name, s.isInitial, s.isTerminal, tc, maxTC);
47408
- return /* @__PURE__ */ jsxs(React118__default.Fragment, { children: [
47435
+ return /* @__PURE__ */ jsxs(React119__default.Fragment, { children: [
47409
47436
  /* @__PURE__ */ jsx(
47410
47437
  AvlState,
47411
47438
  {
@@ -48867,7 +48894,7 @@ function resolveLambdaBindings(body, argName, arg) {
48867
48894
  if (Array.isArray(body)) {
48868
48895
  return body.map((b) => resolveLambdaBindings(b, argName, arg));
48869
48896
  }
48870
- if (body !== null && typeof body === "object" && !React118__default.isValidElement(body) && !(body instanceof Date) && typeof body !== "function") {
48897
+ if (body !== null && typeof body === "object" && !React119__default.isValidElement(body) && !(body instanceof Date) && typeof body !== "function") {
48871
48898
  const out = {};
48872
48899
  for (const [k, v] of Object.entries(body)) {
48873
48900
  out[k] = resolveLambdaBindings(v, argName, arg);
@@ -48886,7 +48913,7 @@ function getSlotContentRenderer2() {
48886
48913
  function makeLambdaFn(argName, lambdaBody, callerKey) {
48887
48914
  return (item, index) => {
48888
48915
  const resolvedBody = resolveLambdaBindings(lambdaBody, argName, item);
48889
- if (resolvedBody === null || typeof resolvedBody !== "object" || Array.isArray(resolvedBody) || typeof resolvedBody === "function" || React118__default.isValidElement(resolvedBody) || resolvedBody instanceof Date) {
48916
+ if (resolvedBody === null || typeof resolvedBody !== "object" || Array.isArray(resolvedBody) || typeof resolvedBody === "function" || React119__default.isValidElement(resolvedBody) || resolvedBody instanceof Date) {
48890
48917
  return null;
48891
48918
  }
48892
48919
  const record = resolvedBody;
@@ -48904,7 +48931,7 @@ function makeLambdaFn(argName, lambdaBody, callerKey) {
48904
48931
  props: childProps,
48905
48932
  priority: 0
48906
48933
  };
48907
- return React118__default.createElement(SlotContentRenderer2, { content: childContent });
48934
+ return React119__default.createElement(SlotContentRenderer2, { content: childContent });
48908
48935
  };
48909
48936
  }
48910
48937
  function convertNode(node, callerKey) {
@@ -48923,7 +48950,7 @@ function convertNode(node, callerKey) {
48923
48950
  });
48924
48951
  return anyChanged ? mapped : node;
48925
48952
  }
48926
- if (typeof node === "object" && !React118__default.isValidElement(node) && !(node instanceof Date)) {
48953
+ if (typeof node === "object" && !React119__default.isValidElement(node) && !(node instanceof Date)) {
48927
48954
  return convertObjectProps(node);
48928
48955
  }
48929
48956
  return node;
@@ -50909,7 +50936,7 @@ var OrbPreviewNodeInner = (props) => {
50909
50936
  }
50910
50937
  );
50911
50938
  };
50912
- var OrbPreviewNode = React118__default.memo(OrbPreviewNodeInner);
50939
+ var OrbPreviewNode = React119__default.memo(OrbPreviewNodeInner);
50913
50940
  OrbPreviewNode.displayName = "OrbPreviewNode";
50914
50941
  var EventFlowEdgeInner = (props) => {
50915
50942
  const {
@@ -50986,7 +51013,7 @@ var EventFlowEdgeInner = (props) => {
50986
51013
  ) })
50987
51014
  ] });
50988
51015
  };
50989
- var EventFlowEdge = React118__default.memo(EventFlowEdgeInner);
51016
+ var EventFlowEdge = React119__default.memo(EventFlowEdgeInner);
50990
51017
  EventFlowEdge.displayName = "EventFlowEdge";
50991
51018
 
50992
51019
  // components/molecules/avl/BehaviorComposeNode.tsx
@@ -51125,7 +51152,7 @@ var BehaviorComposeNodeInner = (props) => {
51125
51152
  }
51126
51153
  );
51127
51154
  };
51128
- var BehaviorComposeNode = React118__default.memo(BehaviorComposeNodeInner);
51155
+ var BehaviorComposeNode = React119__default.memo(BehaviorComposeNodeInner);
51129
51156
  BehaviorComposeNode.displayName = "BehaviorComposeNode";
51130
51157
 
51131
51158
  // components/molecules/avl/avl-behavior-compose-converter.ts
@@ -52057,7 +52084,7 @@ var ZoomBreadcrumb = ({
52057
52084
  if (eventName && band === "detail") {
52058
52085
  segments.push({ icon: "\u26A1", label: eventName });
52059
52086
  }
52060
- 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-[11px] text-muted-foreground backdrop-blur-sm", children: segments.map((seg, i) => /* @__PURE__ */ jsxs(React118__default.Fragment, { children: [
52087
+ 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-[11px] text-muted-foreground backdrop-blur-sm", children: segments.map((seg, i) => /* @__PURE__ */ jsxs(React119__default.Fragment, { children: [
52061
52088
  i > 0 && /* @__PURE__ */ jsx("span", { className: "opacity-40", children: ">" }),
52062
52089
  /* @__PURE__ */ jsx("span", { className: "opacity-60", children: seg.icon }),
52063
52090
  /* @__PURE__ */ jsx("span", { children: seg.label })
@@ -52516,7 +52543,7 @@ var EventWireOverlay = ({
52516
52543
  containerW,
52517
52544
  containerH
52518
52545
  }) => {
52519
- const ids = React118__default.useMemo(() => {
52546
+ const ids = React119__default.useMemo(() => {
52520
52547
  avlOczWireId += 1;
52521
52548
  return { arrow: `avl-ocz-wire-${avlOczWireId}-arrow` };
52522
52549
  }, []);
@@ -52834,7 +52861,7 @@ var AvlOrbitalsCosmicZoom = ({
52834
52861
  borderRadius: 6,
52835
52862
  border: `1px solid ${color}`
52836
52863
  },
52837
- children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", children: breadcrumbs.map((crumb, i) => /* @__PURE__ */ jsxs(React118__default.Fragment, { children: [
52864
+ children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", children: breadcrumbs.map((crumb, i) => /* @__PURE__ */ jsxs(React119__default.Fragment, { children: [
52838
52865
  i > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", style: { opacity: 0.5, color }, children: "/" }),
52839
52866
  i < breadcrumbs.length - 1 ? /* @__PURE__ */ jsx(
52840
52867
  Box,