@almadar/ui 4.49.0 → 4.50.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.
package/dist/avl/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { jsx, jsxs, 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 React147 from 'react';
4
- import React147__default, { createContext, useState, useEffect, useMemo, useContext, useRef, useCallback, Suspense, useLayoutEffect, Profiler, useReducer, lazy, useId, forwardRef, useImperativeHandle, Component } from 'react';
3
+ import * as React93 from 'react';
4
+ import React93__default, { createContext, useState, useEffect, useMemo, useContext, useRef, useCallback, Suspense, useLayoutEffect, Profiler, useReducer, lazy, useId, forwardRef, useImperativeHandle, Component } from 'react';
5
5
  import { createLogger, isLogLevelEnabled } from '@almadar/logger';
6
6
  import ELK from 'elkjs/lib/elk.bundled.js';
7
7
  import { MarkerType, Handle, Position, getBezierPath, EdgeLabelRenderer, BaseEdge, ReactFlowProvider, useNodesState, useEdgesState, useReactFlow, ReactFlow, Controls, Background, BackgroundVariant } from '@xyflow/react';
@@ -34,6 +34,9 @@ import langToml from 'react-syntax-highlighter/dist/esm/languages/prism/toml.js'
34
34
  import langGo from 'react-syntax-highlighter/dist/esm/languages/prism/go.js';
35
35
  import langGraphql from 'react-syntax-highlighter/dist/esm/languages/prism/graphql.js';
36
36
  import { FieldTypeSchema, isInlineTrait, isEntityCall, schemaToIR, getPage, isCircuitEvent } from '@almadar/core';
37
+ import { useSensors, useSensor, PointerSensor, KeyboardSensor, DndContext, closestCenter, useDroppable } from '@dnd-kit/core';
38
+ import { sortableKeyboardCoordinates, arrayMove, useSortable, SortableContext, rectSortingStrategy, verticalListSortingStrategy } from '@dnd-kit/sortable';
39
+ import { CSS } from '@dnd-kit/utilities';
37
40
  import { useThree, useFrame, Canvas } from '@react-three/fiber';
38
41
  import * as THREE6 from 'three';
39
42
  import { Vector3, QuadraticBezierCurve3, MathUtils, Quaternion } from 'three';
@@ -3723,7 +3726,7 @@ var init_Box = __esm({
3723
3726
  fixed: "fixed",
3724
3727
  sticky: "sticky"
3725
3728
  };
3726
- Box = React147__default.forwardRef(
3729
+ Box = React93__default.forwardRef(
3727
3730
  ({
3728
3731
  padding,
3729
3732
  paddingX,
@@ -4736,7 +4739,7 @@ var init_MiniStateMachine = __esm({
4736
4739
  const x = 2 + i * (NODE_W + GAP + ARROW_W + GAP);
4737
4740
  const tc = transitionCounts[s.name] ?? 0;
4738
4741
  const role = getStateRole(s.name, s.isInitial, s.isTerminal, tc, maxTC);
4739
- return /* @__PURE__ */ jsxs(React147__default.Fragment, { children: [
4742
+ return /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
4740
4743
  /* @__PURE__ */ jsx(
4741
4744
  AvlState,
4742
4745
  {
@@ -6198,7 +6201,7 @@ function resolveIconProp(value, sizeClass) {
6198
6201
  const IconComp = value;
6199
6202
  return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
6200
6203
  }
6201
- if (React147__default.isValidElement(value)) {
6204
+ if (React93__default.isValidElement(value)) {
6202
6205
  return value;
6203
6206
  }
6204
6207
  if (typeof value === "object" && value !== null && "render" in value) {
@@ -6274,7 +6277,7 @@ var init_Button = __esm({
6274
6277
  md: "h-4 w-4",
6275
6278
  lg: "h-5 w-5"
6276
6279
  };
6277
- Button = React147__default.forwardRef(
6280
+ Button = React93__default.forwardRef(
6278
6281
  ({
6279
6282
  className,
6280
6283
  variant = "primary",
@@ -6377,7 +6380,7 @@ var init_Badge = __esm({
6377
6380
  md: "px-2.5 py-1 text-sm",
6378
6381
  lg: "px-3 py-1.5 text-base"
6379
6382
  };
6380
- Badge = React147__default.forwardRef(
6383
+ Badge = React93__default.forwardRef(
6381
6384
  ({ className, variant = "default", size = "sm", amount, label, icon, children, ...props }, ref) => {
6382
6385
  const iconSizes3 = { sm: "w-3 h-3", md: "w-3.5 h-3.5", lg: "w-4 h-4" };
6383
6386
  const resolvedIcon = typeof icon === "string" ? (() => {
@@ -6671,7 +6674,7 @@ var init_SvgFlow = __esm({
6671
6674
  opacity = 1,
6672
6675
  className
6673
6676
  }) => {
6674
- const markerId = React147__default.useMemo(() => {
6677
+ const markerId = React93__default.useMemo(() => {
6675
6678
  flowIdCounter += 1;
6676
6679
  return `almadar-flow-arrow-${flowIdCounter}`;
6677
6680
  }, []);
@@ -7214,7 +7217,7 @@ var init_SvgRing = __esm({
7214
7217
  className,
7215
7218
  label
7216
7219
  }) => {
7217
- const gradientId = React147__default.useMemo(() => {
7220
+ const gradientId = React93__default.useMemo(() => {
7218
7221
  ringIdCounter += 1;
7219
7222
  return `almadar-ring-glow-${ringIdCounter}`;
7220
7223
  }, []);
@@ -7375,7 +7378,7 @@ var Input;
7375
7378
  var init_Input = __esm({
7376
7379
  "components/atoms/Input.tsx"() {
7377
7380
  init_cn();
7378
- Input = React147__default.forwardRef(
7381
+ Input = React93__default.forwardRef(
7379
7382
  ({
7380
7383
  className,
7381
7384
  inputType,
@@ -7493,7 +7496,7 @@ var Label;
7493
7496
  var init_Label = __esm({
7494
7497
  "components/atoms/Label.tsx"() {
7495
7498
  init_cn();
7496
- Label = React147__default.forwardRef(
7499
+ Label = React93__default.forwardRef(
7497
7500
  ({ className, required, children, ...props }, ref) => {
7498
7501
  return /* @__PURE__ */ jsxs(
7499
7502
  "label",
@@ -7519,7 +7522,7 @@ var Textarea;
7519
7522
  var init_Textarea = __esm({
7520
7523
  "components/atoms/Textarea.tsx"() {
7521
7524
  init_cn();
7522
- Textarea = React147__default.forwardRef(
7525
+ Textarea = React93__default.forwardRef(
7523
7526
  ({ className, error, ...props }, ref) => {
7524
7527
  return /* @__PURE__ */ jsx(
7525
7528
  "textarea",
@@ -7548,7 +7551,7 @@ var Select;
7548
7551
  var init_Select = __esm({
7549
7552
  "components/atoms/Select.tsx"() {
7550
7553
  init_cn();
7551
- Select = React147__default.forwardRef(
7554
+ Select = React93__default.forwardRef(
7552
7555
  ({ className, options, placeholder, error, ...props }, ref) => {
7553
7556
  return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
7554
7557
  /* @__PURE__ */ jsxs(
@@ -7590,7 +7593,7 @@ var Checkbox;
7590
7593
  var init_Checkbox = __esm({
7591
7594
  "components/atoms/Checkbox.tsx"() {
7592
7595
  init_cn();
7593
- Checkbox = React147__default.forwardRef(
7596
+ Checkbox = React93__default.forwardRef(
7594
7597
  ({ className, label, id, ...props }, ref) => {
7595
7598
  const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
7596
7599
  return /* @__PURE__ */ jsxs("div", { className: "flex items-center", children: [
@@ -7672,7 +7675,7 @@ var init_Card = __esm({
7672
7675
  md: "shadow",
7673
7676
  lg: "shadow-lg"
7674
7677
  };
7675
- Card = React147__default.forwardRef(
7678
+ Card = React93__default.forwardRef(
7676
7679
  ({
7677
7680
  className,
7678
7681
  variant = "bordered",
@@ -7708,9 +7711,9 @@ var init_Card = __esm({
7708
7711
  }
7709
7712
  );
7710
7713
  Card.displayName = "Card";
7711
- CardHeader = React147__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
7714
+ CardHeader = React93__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
7712
7715
  CardHeader.displayName = "CardHeader";
7713
- CardTitle = React147__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
7716
+ CardTitle = React93__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
7714
7717
  "h3",
7715
7718
  {
7716
7719
  ref,
@@ -7723,11 +7726,11 @@ var init_Card = __esm({
7723
7726
  }
7724
7727
  ));
7725
7728
  CardTitle.displayName = "CardTitle";
7726
- CardContent = React147__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
7729
+ CardContent = React93__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
7727
7730
  CardContent.displayName = "CardContent";
7728
7731
  CardBody = CardContent;
7729
7732
  CardBody.displayName = "CardBody";
7730
- CardFooter = React147__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
7733
+ CardFooter = React93__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
7731
7734
  "div",
7732
7735
  {
7733
7736
  ref,
@@ -7782,7 +7785,7 @@ var init_FilterPill = __esm({
7782
7785
  md: "w-3.5 h-3.5",
7783
7786
  lg: "w-4 h-4"
7784
7787
  };
7785
- FilterPill = React147__default.forwardRef(
7788
+ FilterPill = React93__default.forwardRef(
7786
7789
  ({
7787
7790
  className,
7788
7791
  variant = "default",
@@ -7861,7 +7864,7 @@ var init_Spinner = __esm({
7861
7864
  md: "h-6 w-6",
7862
7865
  lg: "h-8 w-8"
7863
7866
  };
7864
- Spinner = React147__default.forwardRef(
7867
+ Spinner = React93__default.forwardRef(
7865
7868
  ({ className, size = "md", ...props }, ref) => {
7866
7869
  return /* @__PURE__ */ jsx(
7867
7870
  "div",
@@ -8309,7 +8312,7 @@ var Radio;
8309
8312
  var init_Radio = __esm({
8310
8313
  "components/atoms/Radio.tsx"() {
8311
8314
  init_cn();
8312
- Radio = React147__default.forwardRef(
8315
+ Radio = React93__default.forwardRef(
8313
8316
  ({
8314
8317
  label,
8315
8318
  helperText,
@@ -8420,7 +8423,7 @@ var init_Switch = __esm({
8420
8423
  "components/atoms/Switch.tsx"() {
8421
8424
  "use client";
8422
8425
  init_cn();
8423
- Switch = React147.forwardRef(
8426
+ Switch = React93.forwardRef(
8424
8427
  ({
8425
8428
  checked,
8426
8429
  defaultChecked = false,
@@ -8431,10 +8434,10 @@ var init_Switch = __esm({
8431
8434
  name,
8432
8435
  className
8433
8436
  }, ref) => {
8434
- const [isChecked, setIsChecked] = React147.useState(
8437
+ const [isChecked, setIsChecked] = React93.useState(
8435
8438
  checked !== void 0 ? checked : defaultChecked
8436
8439
  );
8437
- React147.useEffect(() => {
8440
+ React93.useEffect(() => {
8438
8441
  if (checked !== void 0) {
8439
8442
  setIsChecked(checked);
8440
8443
  }
@@ -8768,8 +8771,8 @@ var init_LawReferenceTooltip = __esm({
8768
8771
  position = "top",
8769
8772
  className
8770
8773
  }) => {
8771
- const [isVisible, setIsVisible] = React147__default.useState(false);
8772
- const timeoutRef = React147__default.useRef(null);
8774
+ const [isVisible, setIsVisible] = React93__default.useState(false);
8775
+ const timeoutRef = React93__default.useRef(null);
8773
8776
  const handleMouseEnter = () => {
8774
8777
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
8775
8778
  timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
@@ -8778,7 +8781,7 @@ var init_LawReferenceTooltip = __esm({
8778
8781
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
8779
8782
  setIsVisible(false);
8780
8783
  };
8781
- React147__default.useEffect(() => {
8784
+ React93__default.useEffect(() => {
8782
8785
  return () => {
8783
8786
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
8784
8787
  };
@@ -8988,7 +8991,7 @@ var init_StatusDot = __esm({
8988
8991
  md: "w-2.5 h-2.5",
8989
8992
  lg: "w-3 h-3"
8990
8993
  };
8991
- StatusDot = React147__default.forwardRef(
8994
+ StatusDot = React93__default.forwardRef(
8992
8995
  ({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
8993
8996
  return /* @__PURE__ */ jsx(
8994
8997
  "span",
@@ -9041,7 +9044,7 @@ var init_TrendIndicator = __esm({
9041
9044
  down: TrendingDown,
9042
9045
  flat: ArrowRight
9043
9046
  };
9044
- TrendIndicator = React147__default.forwardRef(
9047
+ TrendIndicator = React93__default.forwardRef(
9045
9048
  ({
9046
9049
  className,
9047
9050
  value,
@@ -9108,7 +9111,7 @@ var init_RangeSlider = __esm({
9108
9111
  md: "w-4 h-4",
9109
9112
  lg: "w-5 h-5"
9110
9113
  };
9111
- RangeSlider = React147__default.forwardRef(
9114
+ RangeSlider = React93__default.forwardRef(
9112
9115
  ({
9113
9116
  className,
9114
9117
  min = 0,
@@ -9676,7 +9679,7 @@ var init_ContentSection = __esm({
9676
9679
  md: "py-16",
9677
9680
  lg: "py-24"
9678
9681
  };
9679
- ContentSection = React147__default.forwardRef(
9682
+ ContentSection = React93__default.forwardRef(
9680
9683
  ({ children, background = "default", padding = "lg", id, className }, ref) => {
9681
9684
  return /* @__PURE__ */ jsx(
9682
9685
  Box,
@@ -10210,7 +10213,7 @@ var init_AnimatedReveal = __esm({
10210
10213
  "scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
10211
10214
  "none": {}
10212
10215
  };
10213
- AnimatedReveal = React147__default.forwardRef(
10216
+ AnimatedReveal = React93__default.forwardRef(
10214
10217
  ({
10215
10218
  trigger = "scroll",
10216
10219
  animation = "fade-up",
@@ -10370,7 +10373,7 @@ var init_AnimatedGraphic = __esm({
10370
10373
  "components/atoms/AnimatedGraphic.tsx"() {
10371
10374
  "use client";
10372
10375
  init_cn();
10373
- AnimatedGraphic = React147__default.forwardRef(
10376
+ AnimatedGraphic = React93__default.forwardRef(
10374
10377
  ({
10375
10378
  src,
10376
10379
  svgContent,
@@ -10393,7 +10396,7 @@ var init_AnimatedGraphic = __esm({
10393
10396
  const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
10394
10397
  const resolvedSvg = svgContent ?? fetchedSvg;
10395
10398
  const prevAnimateRef = useRef(animate);
10396
- const setRef = React147__default.useCallback(
10399
+ const setRef = React93__default.useCallback(
10397
10400
  (node) => {
10398
10401
  containerRef.current = node;
10399
10402
  if (typeof ref === "function") ref(node);
@@ -10620,9 +10623,9 @@ function ScoreDisplay({
10620
10623
  ...rest
10621
10624
  }) {
10622
10625
  const resolvedValue = typeof value === "number" && !Number.isNaN(value) ? value : typeof rest.score === "number" && !Number.isNaN(rest.score) ? rest.score : 0;
10623
- const [displayValue, setDisplayValue] = React147.useState(resolvedValue);
10624
- const [isAnimating, setIsAnimating] = React147.useState(false);
10625
- React147.useEffect(() => {
10626
+ const [displayValue, setDisplayValue] = React93.useState(resolvedValue);
10627
+ const [isAnimating, setIsAnimating] = React93.useState(false);
10628
+ React93.useEffect(() => {
10626
10629
  if (!animated || displayValue === resolvedValue) {
10627
10630
  setDisplayValue(resolvedValue);
10628
10631
  return;
@@ -10692,9 +10695,9 @@ function ControlButton({
10692
10695
  className
10693
10696
  }) {
10694
10697
  const eventBus = useEventBus();
10695
- const [isPressed, setIsPressed] = React147.useState(false);
10698
+ const [isPressed, setIsPressed] = React93.useState(false);
10696
10699
  const actualPressed = pressed ?? isPressed;
10697
- const handlePointerDown = React147.useCallback(
10700
+ const handlePointerDown = React93.useCallback(
10698
10701
  (e) => {
10699
10702
  e.preventDefault();
10700
10703
  if (disabled) return;
@@ -10704,7 +10707,7 @@ function ControlButton({
10704
10707
  },
10705
10708
  [disabled, pressEvent, eventBus, onPress]
10706
10709
  );
10707
- const handlePointerUp = React147.useCallback(
10710
+ const handlePointerUp = React93.useCallback(
10708
10711
  (e) => {
10709
10712
  e.preventDefault();
10710
10713
  if (disabled) return;
@@ -10714,7 +10717,7 @@ function ControlButton({
10714
10717
  },
10715
10718
  [disabled, releaseEvent, eventBus, onRelease]
10716
10719
  );
10717
- const handlePointerLeave = React147.useCallback(
10720
+ const handlePointerLeave = React93.useCallback(
10718
10721
  (e) => {
10719
10722
  if (isPressed) {
10720
10723
  setIsPressed(false);
@@ -11620,9 +11623,9 @@ function MiniMap({
11620
11623
  viewportRect,
11621
11624
  className
11622
11625
  }) {
11623
- const canvasRef = React147.useRef(null);
11624
- const frameRef = React147.useRef(0);
11625
- React147.useEffect(() => {
11626
+ const canvasRef = React93.useRef(null);
11627
+ const frameRef = React93.useRef(0);
11628
+ React93.useEffect(() => {
11626
11629
  const canvas = canvasRef.current;
11627
11630
  if (!canvas) return;
11628
11631
  const ctx = canvas.getContext("2d");
@@ -11916,7 +11919,7 @@ var init_ErrorBoundary = __esm({
11916
11919
  "use client";
11917
11920
  init_cn();
11918
11921
  init_ErrorState();
11919
- ErrorBoundary = class extends React147__default.Component {
11922
+ ErrorBoundary = class extends React93__default.Component {
11920
11923
  constructor(props) {
11921
11924
  super(props);
11922
11925
  __publicField(this, "reset", () => {
@@ -12991,8 +12994,8 @@ var init_Tooltip = __esm({
12991
12994
  if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
12992
12995
  };
12993
12996
  }, []);
12994
- const triggerElement = React147__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
12995
- const trigger = React147__default.cloneElement(triggerElement, {
12997
+ const triggerElement = React93__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
12998
+ const trigger = React93__default.cloneElement(triggerElement, {
12996
12999
  ref: triggerRef,
12997
13000
  onMouseEnter: handleMouseEnter,
12998
13001
  onMouseLeave: handleMouseLeave,
@@ -13113,8 +13116,8 @@ var init_Popover = __esm({
13113
13116
  onMouseEnter: handleOpen,
13114
13117
  onMouseLeave: handleClose
13115
13118
  };
13116
- const childElement = React147__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
13117
- const triggerElement = React147__default.cloneElement(
13119
+ const childElement = React93__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
13120
+ const triggerElement = React93__default.cloneElement(
13118
13121
  childElement,
13119
13122
  {
13120
13123
  ref: triggerRef,
@@ -13231,8 +13234,8 @@ var init_Menu = __esm({
13231
13234
  "bottom-start": "top-full left-0 mt-2",
13232
13235
  "bottom-end": "top-full right-0 mt-2"
13233
13236
  };
13234
- const triggerChild = React147__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx("span", { children: trigger });
13235
- const triggerElement = React147__default.cloneElement(
13237
+ const triggerChild = React93__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx("span", { children: trigger });
13238
+ const triggerElement = React93__default.cloneElement(
13236
13239
  triggerChild,
13237
13240
  {
13238
13241
  ref: triggerRef,
@@ -13648,7 +13651,7 @@ var init_MapView = __esm({
13648
13651
  shadowSize: [41, 41]
13649
13652
  });
13650
13653
  L.Marker.prototype.options.icon = defaultIcon;
13651
- const { useEffect: useEffect87, useRef: useRef87, useCallback: useCallback127, useState: useState121 } = React147__default;
13654
+ const { useEffect: useEffect87, useRef: useRef87, useCallback: useCallback127, useState: useState121 } = React93__default;
13652
13655
  const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
13653
13656
  const { useEventBus: useEventBus3 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
13654
13657
  function MapUpdater({ centerLat, centerLng, zoom }) {
@@ -13894,7 +13897,7 @@ function InputPattern({
13894
13897
  fieldName
13895
13898
  }) {
13896
13899
  const { emit } = useEventBus();
13897
- const [localValue, setLocalValue] = React147__default.useState(value);
13900
+ const [localValue, setLocalValue] = React93__default.useState(value);
13898
13901
  const handleChange = (e) => {
13899
13902
  setLocalValue(e.target.value);
13900
13903
  if (onChange) {
@@ -13932,7 +13935,7 @@ function TextareaPattern({
13932
13935
  fieldName
13933
13936
  }) {
13934
13937
  const { emit } = useEventBus();
13935
- const [localValue, setLocalValue] = React147__default.useState(value);
13938
+ const [localValue, setLocalValue] = React93__default.useState(value);
13936
13939
  const handleChange = (e) => {
13937
13940
  setLocalValue(e.target.value);
13938
13941
  if (onChange) {
@@ -13964,7 +13967,7 @@ function SelectPattern({
13964
13967
  fieldName
13965
13968
  }) {
13966
13969
  const { emit } = useEventBus();
13967
- const [localValue, setLocalValue] = React147__default.useState(value);
13970
+ const [localValue, setLocalValue] = React93__default.useState(value);
13968
13971
  const handleChange = (e) => {
13969
13972
  setLocalValue(e.target.value);
13970
13973
  if (onChange) {
@@ -13993,7 +13996,7 @@ function CheckboxPattern({
13993
13996
  className
13994
13997
  }) {
13995
13998
  const { emit } = useEventBus();
13996
- const [localChecked, setLocalChecked] = React147__default.useState(checked);
13999
+ const [localChecked, setLocalChecked] = React93__default.useState(checked);
13997
14000
  const handleChange = (e) => {
13998
14001
  setLocalChecked(e.target.checked);
13999
14002
  if (onChange) {
@@ -14224,8 +14227,8 @@ function ActionButtons({
14224
14227
  disabled
14225
14228
  }) {
14226
14229
  const eventBus = useEventBus();
14227
- const [activeButtons, setActiveButtons] = React147.useState(/* @__PURE__ */ new Set());
14228
- const handlePress = React147.useCallback(
14230
+ const [activeButtons, setActiveButtons] = React93.useState(/* @__PURE__ */ new Set());
14231
+ const handlePress = React93.useCallback(
14229
14232
  (id) => {
14230
14233
  setActiveButtons((prev) => new Set(prev).add(id));
14231
14234
  if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
@@ -14233,7 +14236,7 @@ function ActionButtons({
14233
14236
  },
14234
14237
  [actionEvent, eventBus, onAction]
14235
14238
  );
14236
- const handleRelease = React147.useCallback(
14239
+ const handleRelease = React93.useCallback(
14237
14240
  (id) => {
14238
14241
  setActiveButtons((prev) => {
14239
14242
  const next = new Set(prev);
@@ -16297,7 +16300,7 @@ var init_MarkdownContent = __esm({
16297
16300
  init_Box();
16298
16301
  init_useTranslate();
16299
16302
  init_cn();
16300
- MarkdownContent = React147__default.memo(
16303
+ MarkdownContent = React93__default.memo(
16301
16304
  ({ content, direction, className }) => {
16302
16305
  const { t: _t } = useTranslate();
16303
16306
  const safeContent = typeof content === "string" ? content : String(content ?? "");
@@ -16515,7 +16518,7 @@ var init_CodeBlock = __esm({
16515
16518
  log8 = createLogger("almadar:ui:markdown-code");
16516
16519
  LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
16517
16520
  HIDDEN_LINE_NUMBERS = { display: "none" };
16518
- CodeBlock = React147__default.memo(
16521
+ CodeBlock = React93__default.memo(
16519
16522
  ({
16520
16523
  code: rawCode,
16521
16524
  language = "text",
@@ -17824,7 +17827,7 @@ var init_StateMachineView = __esm({
17824
17827
  style: { top: title ? 30 : 0 },
17825
17828
  children: [
17826
17829
  entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
17827
- states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React147__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
17830
+ states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React93__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
17828
17831
  StateNode,
17829
17832
  {
17830
17833
  state,
@@ -24268,7 +24271,7 @@ function CraftingRecipe({
24268
24271
  className
24269
24272
  }) {
24270
24273
  const eventBus = useEventBus();
24271
- const handleCraft = React147.useCallback(() => {
24274
+ const handleCraft = React93.useCallback(() => {
24272
24275
  onCraft?.();
24273
24276
  if (craftEvent) {
24274
24277
  eventBus.emit(craftEvent, { output: output.label });
@@ -24285,7 +24288,7 @@ function CraftingRecipe({
24285
24288
  children: [
24286
24289
  /* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-wrap items-center", children: inputs.map((ingredient, index) => {
24287
24290
  const hasSufficient = ingredient.available >= ingredient.required;
24288
- return /* @__PURE__ */ jsxs(React147.Fragment, { children: [
24291
+ return /* @__PURE__ */ jsxs(React93.Fragment, { children: [
24289
24292
  /* @__PURE__ */ jsx(Box, { className: "relative", children: /* @__PURE__ */ jsx(
24290
24293
  ItemSlot,
24291
24294
  {
@@ -24348,8 +24351,8 @@ function DPad({
24348
24351
  }) {
24349
24352
  const eventBus = useEventBus();
24350
24353
  const sizes = sizeMap15[size];
24351
- const [activeDirections, setActiveDirections] = React147.useState(/* @__PURE__ */ new Set());
24352
- const handlePress = React147.useCallback(
24354
+ const [activeDirections, setActiveDirections] = React93.useState(/* @__PURE__ */ new Set());
24355
+ const handlePress = React93.useCallback(
24353
24356
  (direction) => {
24354
24357
  setActiveDirections((prev) => new Set(prev).add(direction));
24355
24358
  if (directionEvent) eventBus.emit(`UI:${directionEvent}`, { direction, pressed: true });
@@ -24357,7 +24360,7 @@ function DPad({
24357
24360
  },
24358
24361
  [directionEvent, eventBus, onDirection]
24359
24362
  );
24360
- const handleRelease = React147.useCallback(
24363
+ const handleRelease = React93.useCallback(
24361
24364
  (direction) => {
24362
24365
  setActiveDirections((prev) => {
24363
24366
  const next = new Set(prev);
@@ -24857,6 +24860,199 @@ var init_DashboardLayout = __esm({
24857
24860
  NavLink.displayName = "NavLink";
24858
24861
  }
24859
24862
  });
24863
+ function useDataDnd(args) {
24864
+ const {
24865
+ dragGroup,
24866
+ accepts,
24867
+ sortable,
24868
+ dropEvent,
24869
+ reorderEvent,
24870
+ dndItemIdField = "id",
24871
+ dndRoot,
24872
+ items,
24873
+ layout
24874
+ } = args;
24875
+ const isZone = Boolean(dragGroup || accepts || sortable);
24876
+ const enabled = isZone || Boolean(dndRoot);
24877
+ const eventBus = useEventBus();
24878
+ const parentRoot = React93__default.useContext(RootCtx);
24879
+ const isRoot = enabled && parentRoot === null;
24880
+ const [localOrder, setLocalOrder] = React93__default.useState(null);
24881
+ const orderedItems = localOrder ?? items;
24882
+ React93__default.useEffect(() => {
24883
+ setLocalOrder(null);
24884
+ }, [items]);
24885
+ const itemIds = React93__default.useMemo(
24886
+ () => orderedItems.map((it, idx) => {
24887
+ const raw = it[dndItemIdField];
24888
+ return raw ?? `__idx_${idx}`;
24889
+ }),
24890
+ [orderedItems, dndItemIdField]
24891
+ );
24892
+ const zonesRef = React93__default.useRef(/* @__PURE__ */ new Map());
24893
+ const registerZone = React93__default.useCallback((zoneId2, meta2) => {
24894
+ zonesRef.current.set(zoneId2, meta2);
24895
+ }, []);
24896
+ const unregisterZone = React93__default.useCallback((zoneId2) => {
24897
+ zonesRef.current.delete(zoneId2);
24898
+ }, []);
24899
+ const zoneId = React93__default.useId();
24900
+ const ownGroup = dragGroup ?? accepts ?? zoneId;
24901
+ const meta = React93__default.useMemo(
24902
+ () => ({ group: ownGroup, dropEvent, reorderEvent, itemIds }),
24903
+ [ownGroup, dropEvent, reorderEvent, itemIds]
24904
+ );
24905
+ React93__default.useEffect(() => {
24906
+ const target = isRoot ? null : parentRoot;
24907
+ if (!target) {
24908
+ zonesRef.current.set(zoneId, meta);
24909
+ return () => zonesRef.current.delete(zoneId);
24910
+ }
24911
+ target.registerZone(zoneId, meta);
24912
+ return () => target.unregisterZone(zoneId);
24913
+ }, [parentRoot, isRoot, zoneId, meta]);
24914
+ const sensors = useSensors(
24915
+ useSensor(PointerSensor, { activationConstraint: { distance: 5 } }),
24916
+ useSensor(KeyboardSensor, { coordinateGetter: sortableKeyboardCoordinates })
24917
+ );
24918
+ const findZoneByItem = React93__default.useCallback(
24919
+ (id) => {
24920
+ for (const z of zonesRef.current.values()) {
24921
+ if (z.itemIds.includes(id)) return z;
24922
+ }
24923
+ return void 0;
24924
+ },
24925
+ []
24926
+ );
24927
+ const findZoneByGroup = React93__default.useCallback(
24928
+ (group) => {
24929
+ for (const z of zonesRef.current.values()) {
24930
+ if (z.group === group) return z;
24931
+ }
24932
+ return void 0;
24933
+ },
24934
+ []
24935
+ );
24936
+ const handleDragEnd = React93__default.useCallback(
24937
+ (event) => {
24938
+ const { active, over } = event;
24939
+ if (!over) return;
24940
+ const sourceZone = findZoneByItem(active.id);
24941
+ const overData = over.data?.current;
24942
+ const targetGroup = overData?.dndGroup;
24943
+ if (!sourceZone || !targetGroup) return;
24944
+ const targetZone = findZoneByGroup(targetGroup);
24945
+ if (!targetZone) return;
24946
+ if (sourceZone.group !== targetZone.group) {
24947
+ if (targetZone.dropEvent) {
24948
+ const newIndex2 = targetZone.itemIds.indexOf(over.id);
24949
+ eventBus.emit(targetZone.dropEvent, {
24950
+ id: String(active.id),
24951
+ sourceGroup: sourceZone.group,
24952
+ targetGroup: targetZone.group,
24953
+ newIndex: newIndex2 === -1 ? targetZone.itemIds.length : newIndex2
24954
+ });
24955
+ }
24956
+ return;
24957
+ }
24958
+ const oldIndex = sourceZone.itemIds.indexOf(active.id);
24959
+ const newIndex = sourceZone.itemIds.indexOf(over.id);
24960
+ if (oldIndex === -1 || newIndex === -1 || oldIndex === newIndex) return;
24961
+ if (sourceZone.group === ownGroup) {
24962
+ const reordered = arrayMove(orderedItems, oldIndex, newIndex);
24963
+ setLocalOrder(reordered);
24964
+ }
24965
+ if (sourceZone.reorderEvent) {
24966
+ eventBus.emit(sourceZone.reorderEvent, {
24967
+ id: String(active.id),
24968
+ oldIndex,
24969
+ newIndex
24970
+ });
24971
+ }
24972
+ },
24973
+ [orderedItems, ownGroup, findZoneByItem, findZoneByGroup, eventBus]
24974
+ );
24975
+ const SortableItem = React93__default.useCallback(
24976
+ ({ id, children }) => {
24977
+ const {
24978
+ attributes,
24979
+ listeners: listeners6,
24980
+ setNodeRef,
24981
+ transform,
24982
+ transition,
24983
+ isDragging
24984
+ } = useSortable({ id, data: { dndGroup: ownGroup } });
24985
+ const style = {
24986
+ transform: CSS.Transform.toString(transform),
24987
+ transition,
24988
+ opacity: isDragging ? 0.4 : 1,
24989
+ cursor: enabled ? "grab" : void 0
24990
+ };
24991
+ return /* @__PURE__ */ jsx(
24992
+ Box,
24993
+ {
24994
+ className: "touch-none",
24995
+ ref: setNodeRef,
24996
+ style,
24997
+ ...attributes,
24998
+ ...listeners6,
24999
+ children
25000
+ }
25001
+ );
25002
+ },
25003
+ [ownGroup, enabled]
25004
+ );
25005
+ const DropZoneShell = ({ children }) => {
25006
+ const { setNodeRef, isOver } = useDroppable({
25007
+ id: `dnd-zone-${zoneId}`,
25008
+ data: { dndGroup: ownGroup }
25009
+ });
25010
+ return /* @__PURE__ */ jsx(
25011
+ Box,
25012
+ {
25013
+ ref: setNodeRef,
25014
+ "data-dnd-zone": ownGroup,
25015
+ className: isOver ? "ring-2 ring-primary ring-offset-2 rounded-lg transition-all min-h-[3rem]" : "min-h-[3rem] rounded-lg transition-all",
25016
+ children
25017
+ }
25018
+ );
25019
+ };
25020
+ const rootContextValue = React93__default.useMemo(
25021
+ () => ({ registerZone, unregisterZone }),
25022
+ [registerZone, unregisterZone]
25023
+ );
25024
+ const wrapContainer = React93__default.useCallback(
25025
+ (children) => {
25026
+ if (!enabled) return children;
25027
+ const strategy = layout === "grid" ? rectSortingStrategy : verticalListSortingStrategy;
25028
+ if (!isZone) {
25029
+ if (!isRoot) return children;
25030
+ return /* @__PURE__ */ jsx(RootCtx.Provider, { value: rootContextValue, children: /* @__PURE__ */ jsx(DndContext, { sensors, collisionDetection: closestCenter, onDragEnd: handleDragEnd, children }) });
25031
+ }
25032
+ const inner = /* @__PURE__ */ jsx(DropZoneShell, { children: /* @__PURE__ */ jsx(SortableContext, { items: itemIds, strategy, children }) });
25033
+ if (isRoot) {
25034
+ return /* @__PURE__ */ jsx(RootCtx.Provider, { value: rootContextValue, children: /* @__PURE__ */ jsx(DndContext, { sensors, collisionDetection: closestCenter, onDragEnd: handleDragEnd, children: inner }) });
25035
+ }
25036
+ return inner;
25037
+ },
25038
+ [enabled, isZone, layout, sensors, handleDragEnd, itemIds, isRoot, rootContextValue]
25039
+ );
25040
+ return {
25041
+ enabled,
25042
+ wrapContainer,
25043
+ SortableItem,
25044
+ orderedItems
25045
+ };
25046
+ }
25047
+ var RootCtx;
25048
+ var init_useDataDnd = __esm({
25049
+ "components/molecules/useDataDnd.tsx"() {
25050
+ "use client";
25051
+ init_useEventBus();
25052
+ init_Box();
25053
+ RootCtx = React93__default.createContext(null);
25054
+ }
25055
+ });
24860
25056
  function fieldLabel2(key) {
24861
25057
  return key.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/[_-]/g, " ").replace(/\b\w/g, (c) => c.toUpperCase());
24862
25058
  }
@@ -24920,14 +25116,33 @@ function DataGrid({
24920
25116
  hasMore,
24921
25117
  children,
24922
25118
  pageSize = 0,
24923
- renderItem: schemaRenderItem
25119
+ renderItem: schemaRenderItem,
25120
+ dragGroup,
25121
+ accepts,
25122
+ sortable,
25123
+ dropEvent,
25124
+ reorderEvent,
25125
+ dndItemIdField,
25126
+ dndRoot
24924
25127
  }) {
24925
25128
  const eventBus = useEventBus();
24926
25129
  const { t } = useTranslate();
24927
25130
  const [selectedIds, setSelectedIds] = useState(/* @__PURE__ */ new Set());
24928
25131
  const [visibleCount, setVisibleCount] = useState(pageSize || Infinity);
24929
25132
  const fieldDefs = fields ?? columns ?? [];
24930
- const allData = Array.isArray(entity) ? entity : entity ? [entity] : [];
25133
+ const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
25134
+ const dnd = useDataDnd({
25135
+ items: allDataRaw,
25136
+ layout: "grid",
25137
+ dragGroup,
25138
+ accepts,
25139
+ sortable,
25140
+ dropEvent,
25141
+ reorderEvent,
25142
+ dndItemIdField,
25143
+ dndRoot
25144
+ });
25145
+ const allData = dnd.orderedItems;
24931
25146
  const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
24932
25147
  const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
24933
25148
  const toggleSelection = useCallback((id) => {
@@ -24999,196 +25214,205 @@ function DataGrid({
24999
25214
  const allIds = data.map((item, i) => item.id || String(i));
25000
25215
  const allSelected = allIds.length > 0 && allIds.every((id) => selectedIds.has(id));
25001
25216
  const someSelected = selectedIds.size > 0;
25002
- return /* @__PURE__ */ jsxs(VStack, { gap: "sm", children: [
25003
- selectable && someSelected && /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: "items-center px-2 py-2 bg-muted rounded-sm", children: [
25217
+ const idFieldName = dndItemIdField ?? "id";
25218
+ return dnd.wrapContainer(
25219
+ /* @__PURE__ */ jsxs(VStack, { gap: "sm", children: [
25220
+ selectable && someSelected && /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: "items-center px-2 py-2 bg-muted rounded-sm", children: [
25221
+ /* @__PURE__ */ jsx(
25222
+ "input",
25223
+ {
25224
+ type: "checkbox",
25225
+ checked: allSelected,
25226
+ onChange: toggleAll,
25227
+ className: "w-4 h-4 accent-primary",
25228
+ "aria-label": "Select all"
25229
+ }
25230
+ ),
25231
+ /* @__PURE__ */ jsxs(Typography, { variant: "caption", className: "font-semibold", children: [
25232
+ selectedIds.size,
25233
+ " ",
25234
+ t("common.selected") || "selected"
25235
+ ] })
25236
+ ] }),
25004
25237
  /* @__PURE__ */ jsx(
25005
- "input",
25238
+ Box,
25006
25239
  {
25007
- type: "checkbox",
25008
- checked: allSelected,
25009
- onChange: toggleAll,
25010
- className: "w-4 h-4 accent-primary",
25011
- "aria-label": "Select all"
25012
- }
25013
- ),
25014
- /* @__PURE__ */ jsxs(Typography, { variant: "caption", className: "font-semibold", children: [
25015
- selectedIds.size,
25016
- " ",
25017
- t("common.selected") || "selected"
25018
- ] })
25019
- ] }),
25020
- /* @__PURE__ */ jsx(
25021
- Box,
25022
- {
25023
- className: cn("grid", gapStyles6[gap], colsClass, className),
25024
- style: gridTemplateColumns ? { gridTemplateColumns } : void 0,
25025
- children: data.map((item, index) => {
25026
- const itemData = item;
25027
- const id = itemData.id || String(index);
25028
- const isSelected = selectedIds.has(id);
25029
- if (hasRenderProp) {
25030
- return /* @__PURE__ */ jsx(
25031
- Box,
25032
- {
25033
- "data-entity-row": true,
25034
- "data-entity-id": id,
25035
- className: cn(isSelected && "ring-2 ring-primary rounded-lg"),
25036
- children: children(itemData, index)
25037
- },
25038
- id
25039
- );
25040
- }
25041
- const titleValue = getNestedValue(itemData, titleField?.name ?? "");
25042
- return /* @__PURE__ */ jsxs(
25043
- Box,
25044
- {
25045
- "data-entity-row": true,
25046
- "data-entity-id": id,
25047
- className: cn(
25048
- "bg-card rounded-lg",
25049
- "border border-border",
25050
- "shadow-sm hover:shadow-lg",
25051
- "hover:border-primary transition-all",
25052
- "flex flex-col",
25053
- isSelected && "ring-2 ring-primary border-primary"
25054
- ),
25055
- children: [
25056
- imageField && (() => {
25057
- const imgUrl = getNestedValue(itemData, imageField);
25058
- if (!imgUrl || typeof imgUrl !== "string") return null;
25059
- return /* @__PURE__ */ jsx(Box, { className: "w-full aspect-video overflow-hidden rounded-t-lg", children: /* @__PURE__ */ jsx(
25060
- "img",
25061
- {
25062
- src: imgUrl,
25063
- alt: titleValue !== void 0 ? String(titleValue) : "",
25064
- className: "w-full h-full object-cover",
25065
- loading: "lazy"
25066
- }
25067
- ) });
25068
- })(),
25069
- /* @__PURE__ */ jsx(Box, { className: "p-4 pb-0", children: /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: "justify-between items-start", children: [
25070
- selectable && /* @__PURE__ */ jsx(
25071
- "input",
25072
- {
25073
- type: "checkbox",
25074
- checked: isSelected,
25075
- onChange: () => toggleSelection(id),
25076
- onClick: (e) => e.stopPropagation(),
25077
- className: "w-4 h-4 mt-1 flex-shrink-0 accent-primary",
25078
- "aria-label": `Select ${titleValue !== void 0 ? String(titleValue) : "item"}`
25079
- }
25240
+ className: cn("grid", gapStyles6[gap], colsClass, className),
25241
+ style: gridTemplateColumns ? { gridTemplateColumns } : void 0,
25242
+ children: data.map((item, index) => {
25243
+ const itemData = item;
25244
+ const id = itemData.id || String(index);
25245
+ const isSelected = selectedIds.has(id);
25246
+ const dndId = itemData[idFieldName] ?? `__idx_${index}`;
25247
+ const wrapDnd = (node) => dnd.enabled ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: dndId, children: node }) : node;
25248
+ if (hasRenderProp) {
25249
+ return wrapDnd(
25250
+ /* @__PURE__ */ jsx(
25251
+ Box,
25252
+ {
25253
+ "data-entity-row": true,
25254
+ "data-entity-id": id,
25255
+ className: cn(isSelected && "ring-2 ring-primary rounded-lg"),
25256
+ children: children(itemData, index)
25257
+ },
25258
+ id
25259
+ )
25260
+ );
25261
+ }
25262
+ const titleValue = getNestedValue(itemData, titleField?.name ?? "");
25263
+ return wrapDnd(
25264
+ /* @__PURE__ */ jsxs(
25265
+ Box,
25266
+ {
25267
+ "data-entity-row": true,
25268
+ "data-entity-id": id,
25269
+ className: cn(
25270
+ "bg-card rounded-lg",
25271
+ "border border-border",
25272
+ "shadow-sm hover:shadow-lg",
25273
+ "hover:border-primary transition-all",
25274
+ "flex flex-col",
25275
+ isSelected && "ring-2 ring-primary border-primary"
25080
25276
  ),
25081
- /* @__PURE__ */ jsxs(VStack, { gap: "xs", className: "flex-1 min-w-0", children: [
25082
- titleValue !== void 0 && titleValue !== null && /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
25083
- titleField?.icon && /* @__PURE__ */ jsx(Icon, { name: titleField.icon, size: "sm", className: "text-primary flex-shrink-0" }),
25084
- /* @__PURE__ */ jsx(
25085
- Typography,
25277
+ children: [
25278
+ imageField && (() => {
25279
+ const imgUrl = getNestedValue(itemData, imageField);
25280
+ if (!imgUrl || typeof imgUrl !== "string") return null;
25281
+ return /* @__PURE__ */ jsx(Box, { className: "w-full aspect-video overflow-hidden rounded-t-lg", children: /* @__PURE__ */ jsx(
25282
+ "img",
25086
25283
  {
25087
- variant: titleField?.variant === "h3" ? "h3" : "h4",
25088
- className: "font-semibold truncate",
25089
- children: String(titleValue)
25284
+ src: imgUrl,
25285
+ alt: titleValue !== void 0 ? String(titleValue) : "",
25286
+ className: "w-full h-full object-cover",
25287
+ loading: "lazy"
25090
25288
  }
25091
- )
25092
- ] }),
25093
- badgeFields.length > 0 && /* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-wrap", children: badgeFields.map((field) => {
25094
- const val = getNestedValue(itemData, field.name);
25095
- if (val === void 0 || val === null) return null;
25096
- return /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
25097
- field.icon && /* @__PURE__ */ jsx(Icon, { name: field.icon, size: "xs" }),
25098
- /* @__PURE__ */ jsx(Badge, { variant: resolveBadgeVariant(field, String(val)), children: String(val) })
25099
- ] }, field.name);
25100
- }) })
25101
- ] }),
25102
- dangerActions.length > 0 && /* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-shrink-0", children: dangerActions.map((action, idx) => /* @__PURE__ */ jsxs(
25103
- Button,
25104
- {
25105
- variant: "ghost",
25106
- size: "sm",
25107
- onClick: handleActionClick(action, itemData),
25108
- "data-testid": `action-${action.event}`,
25109
- "data-row-id": String(itemData.id),
25110
- className: "text-error hover:text-error hover:bg-error/10 px-2",
25111
- children: [
25112
- action.icon && /* @__PURE__ */ jsx(Icon, { name: action.icon, size: "xs" }),
25113
- action.label
25114
- ]
25115
- },
25116
- idx
25117
- )) })
25118
- ] }) }),
25119
- bodyFields.length > 0 && /* @__PURE__ */ jsx(Box, { className: "px-4 py-3 flex-1", children: /* @__PURE__ */ jsx(VStack, { gap: "xs", children: bodyFields.map((field) => {
25120
- const value = getNestedValue(itemData, field.name);
25121
- if (value === void 0 || value === null || value === "") return null;
25122
- if (field.format === "boolean") {
25123
- return /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: "justify-between items-center", children: [
25124
- /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
25125
- field.icon && /* @__PURE__ */ jsx(Icon, { name: field.icon, size: "xs", className: "text-muted-foreground" }),
25126
- /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", children: field.label ?? fieldLabel2(field.name) })
25289
+ ) });
25290
+ })(),
25291
+ /* @__PURE__ */ jsx(Box, { className: "p-4 pb-0", children: /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: "justify-between items-start", children: [
25292
+ selectable && /* @__PURE__ */ jsx(
25293
+ "input",
25294
+ {
25295
+ type: "checkbox",
25296
+ checked: isSelected,
25297
+ onChange: () => toggleSelection(id),
25298
+ onClick: (e) => e.stopPropagation(),
25299
+ className: "w-4 h-4 mt-1 flex-shrink-0 accent-primary",
25300
+ "aria-label": `Select ${titleValue !== void 0 ? String(titleValue) : "item"}`
25301
+ }
25302
+ ),
25303
+ /* @__PURE__ */ jsxs(VStack, { gap: "xs", className: "flex-1 min-w-0", children: [
25304
+ titleValue !== void 0 && titleValue !== null && /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
25305
+ titleField?.icon && /* @__PURE__ */ jsx(Icon, { name: titleField.icon, size: "sm", className: "text-primary flex-shrink-0" }),
25306
+ /* @__PURE__ */ jsx(
25307
+ Typography,
25308
+ {
25309
+ variant: titleField?.variant === "h3" ? "h3" : "h4",
25310
+ className: "font-semibold truncate",
25311
+ children: String(titleValue)
25312
+ }
25313
+ )
25314
+ ] }),
25315
+ badgeFields.length > 0 && /* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-wrap", children: badgeFields.map((field) => {
25316
+ const val = getNestedValue(itemData, field.name);
25317
+ if (val === void 0 || val === null) return null;
25318
+ return /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
25319
+ field.icon && /* @__PURE__ */ jsx(Icon, { name: field.icon, size: "xs" }),
25320
+ /* @__PURE__ */ jsx(Badge, { variant: resolveBadgeVariant(field, String(val)), children: String(val) })
25321
+ ] }, field.name);
25322
+ }) })
25127
25323
  ] }),
25128
- /* @__PURE__ */ jsx(Badge, { variant: value ? "success" : "neutral", children: value ? t("common.yes") || "Yes" : t("common.no") || "No" })
25129
- ] }, field.name);
25130
- }
25131
- return /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: "justify-between items-center", children: [
25132
- /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
25133
- field.icon && /* @__PURE__ */ jsx(Icon, { name: field.icon, size: "xs", className: "text-muted-foreground" }),
25134
- /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", children: field.label ?? fieldLabel2(field.name) })
25135
- ] }),
25136
- /* @__PURE__ */ jsx(
25137
- Typography,
25138
- {
25139
- variant: field.variant === "caption" ? "caption" : "small",
25140
- className: "text-right truncate max-w-[60%]",
25141
- children: formatValue(value, field.format)
25324
+ dangerActions.length > 0 && /* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-shrink-0", children: dangerActions.map((action, idx) => /* @__PURE__ */ jsxs(
25325
+ Button,
25326
+ {
25327
+ variant: "ghost",
25328
+ size: "sm",
25329
+ onClick: handleActionClick(action, itemData),
25330
+ "data-testid": `action-${action.event}`,
25331
+ "data-row-id": String(itemData.id),
25332
+ className: "text-error hover:text-error hover:bg-error/10 px-2",
25333
+ children: [
25334
+ action.icon && /* @__PURE__ */ jsx(Icon, { name: action.icon, size: "xs" }),
25335
+ action.label
25336
+ ]
25337
+ },
25338
+ idx
25339
+ )) })
25340
+ ] }) }),
25341
+ bodyFields.length > 0 && /* @__PURE__ */ jsx(Box, { className: "px-4 py-3 flex-1", children: /* @__PURE__ */ jsx(VStack, { gap: "xs", children: bodyFields.map((field) => {
25342
+ const value = getNestedValue(itemData, field.name);
25343
+ if (value === void 0 || value === null || value === "") return null;
25344
+ if (field.format === "boolean") {
25345
+ return /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: "justify-between items-center", children: [
25346
+ /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
25347
+ field.icon && /* @__PURE__ */ jsx(Icon, { name: field.icon, size: "xs", className: "text-muted-foreground" }),
25348
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", children: field.label ?? fieldLabel2(field.name) })
25349
+ ] }),
25350
+ /* @__PURE__ */ jsx(Badge, { variant: value ? "success" : "neutral", children: value ? t("common.yes") || "Yes" : t("common.no") || "No" })
25351
+ ] }, field.name);
25142
25352
  }
25143
- )
25144
- ] }, field.name);
25145
- }) }) }),
25146
- primaryActions.length > 0 && /* @__PURE__ */ jsx(Box, { className: "px-4 py-3 mt-auto border-t border-border", children: /* @__PURE__ */ jsx(HStack, { gap: "sm", className: "justify-end", children: primaryActions.map((action, idx) => /* @__PURE__ */ jsxs(
25147
- Button,
25148
- {
25149
- variant: action.variant === "primary" ? "primary" : "ghost",
25150
- size: "sm",
25151
- onClick: handleActionClick(action, itemData),
25152
- "data-testid": `action-${action.event}`,
25153
- "data-row-id": String(itemData.id),
25154
- children: [
25155
- action.icon && /* @__PURE__ */ jsx(Icon, { name: action.icon, size: "xs", className: "mr-1" }),
25156
- action.label
25157
- ]
25158
- },
25159
- idx
25160
- )) }) })
25161
- ]
25162
- },
25163
- id
25164
- );
25165
- })
25166
- }
25167
- ),
25168
- hasMoreLocal && /* @__PURE__ */ jsx(Box, { className: "flex justify-center py-3", children: /* @__PURE__ */ jsxs(
25169
- Button,
25170
- {
25171
- variant: "ghost",
25172
- size: "sm",
25173
- onClick: () => setVisibleCount((prev) => prev + (pageSize || 5)),
25174
- children: [
25175
- /* @__PURE__ */ jsx(Icon, { name: "chevron-down", size: "xs", className: "mr-1" }),
25176
- t("common.showMore"),
25177
- " (",
25178
- allData.length - visibleCount,
25179
- " remaining)"
25180
- ]
25181
- }
25182
- ) }),
25183
- infiniteScroll && loadMoreEvent && /* @__PURE__ */ jsx(
25184
- InfiniteScrollSentinel,
25185
- {
25186
- loadMoreEvent,
25187
- isLoading,
25188
- hasMore
25189
- }
25190
- )
25191
- ] });
25353
+ return /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: "justify-between items-center", children: [
25354
+ /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
25355
+ field.icon && /* @__PURE__ */ jsx(Icon, { name: field.icon, size: "xs", className: "text-muted-foreground" }),
25356
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", children: field.label ?? fieldLabel2(field.name) })
25357
+ ] }),
25358
+ /* @__PURE__ */ jsx(
25359
+ Typography,
25360
+ {
25361
+ variant: field.variant === "caption" ? "caption" : "small",
25362
+ className: "text-right truncate max-w-[60%]",
25363
+ children: formatValue(value, field.format)
25364
+ }
25365
+ )
25366
+ ] }, field.name);
25367
+ }) }) }),
25368
+ primaryActions.length > 0 && /* @__PURE__ */ jsx(Box, { className: "px-4 py-3 mt-auto border-t border-border", children: /* @__PURE__ */ jsx(HStack, { gap: "sm", className: "justify-end", children: primaryActions.map((action, idx) => /* @__PURE__ */ jsxs(
25369
+ Button,
25370
+ {
25371
+ variant: action.variant === "primary" ? "primary" : "ghost",
25372
+ size: "sm",
25373
+ onClick: handleActionClick(action, itemData),
25374
+ "data-testid": `action-${action.event}`,
25375
+ "data-row-id": String(itemData.id),
25376
+ children: [
25377
+ action.icon && /* @__PURE__ */ jsx(Icon, { name: action.icon, size: "xs", className: "mr-1" }),
25378
+ action.label
25379
+ ]
25380
+ },
25381
+ idx
25382
+ )) }) })
25383
+ ]
25384
+ },
25385
+ id
25386
+ )
25387
+ );
25388
+ })
25389
+ }
25390
+ ),
25391
+ hasMoreLocal && /* @__PURE__ */ jsx(Box, { className: "flex justify-center py-3", children: /* @__PURE__ */ jsxs(
25392
+ Button,
25393
+ {
25394
+ variant: "ghost",
25395
+ size: "sm",
25396
+ onClick: () => setVisibleCount((prev) => prev + (pageSize || 5)),
25397
+ children: [
25398
+ /* @__PURE__ */ jsx(Icon, { name: "chevron-down", size: "xs", className: "mr-1" }),
25399
+ t("common.showMore"),
25400
+ " (",
25401
+ allData.length - visibleCount,
25402
+ " remaining)"
25403
+ ]
25404
+ }
25405
+ ) }),
25406
+ infiniteScroll && loadMoreEvent && /* @__PURE__ */ jsx(
25407
+ InfiniteScrollSentinel,
25408
+ {
25409
+ loadMoreEvent,
25410
+ isLoading,
25411
+ hasMore
25412
+ }
25413
+ )
25414
+ ] })
25415
+ );
25192
25416
  }
25193
25417
  var dataGridLog, BADGE_VARIANTS, gapStyles6;
25194
25418
  var init_DataGrid = __esm({
@@ -25205,6 +25429,7 @@ var init_DataGrid = __esm({
25205
25429
  init_Button();
25206
25430
  init_Icon();
25207
25431
  init_InfiniteScrollSentinel();
25432
+ init_useDataDnd();
25208
25433
  dataGridLog = createLogger("almadar:ui:data-grid");
25209
25434
  BADGE_VARIANTS = /* @__PURE__ */ new Set([
25210
25435
  "default",
@@ -25299,17 +25524,36 @@ function DataList({
25299
25524
  hasMore,
25300
25525
  children,
25301
25526
  pageSize = 5,
25302
- renderItem: schemaRenderItem
25527
+ renderItem: schemaRenderItem,
25528
+ dragGroup,
25529
+ accepts,
25530
+ sortable: sortableProp,
25531
+ dropEvent,
25532
+ reorderEvent: dndReorderEvent,
25533
+ dndItemIdField,
25534
+ dndRoot
25303
25535
  }) {
25304
25536
  const eventBus = useEventBus();
25305
25537
  const { t } = useTranslate();
25306
- const [visibleCount, setVisibleCount] = React147__default.useState(pageSize || Infinity);
25538
+ const [visibleCount, setVisibleCount] = React93__default.useState(pageSize || Infinity);
25307
25539
  const fieldDefs = fields ?? columns ?? [];
25308
- const allData = Array.isArray(entity) ? entity : entity ? [entity] : [];
25540
+ const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
25541
+ const dnd = useDataDnd({
25542
+ items: allDataRaw,
25543
+ layout: "list",
25544
+ dragGroup,
25545
+ accepts,
25546
+ sortable: sortableProp,
25547
+ dropEvent,
25548
+ reorderEvent: dndReorderEvent,
25549
+ dndItemIdField,
25550
+ dndRoot
25551
+ });
25552
+ const allData = dnd.orderedItems;
25309
25553
  const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
25310
25554
  const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
25311
25555
  const hasRenderProp = typeof children === "function";
25312
- React147__default.useEffect(() => {
25556
+ React93__default.useEffect(() => {
25313
25557
  const renderItemTypeOf = typeof schemaRenderItem;
25314
25558
  const childrenTypeOf = typeof children;
25315
25559
  if (data.length > 0 && !hasRenderProp) {
@@ -25365,7 +25609,7 @@ function DataList({
25365
25609
  const items2 = data.map((item) => item);
25366
25610
  const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
25367
25611
  const contentField = titleField?.name ?? fieldDefs[0]?.name ?? "";
25368
- return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React147__default.Fragment, { children: [
25612
+ return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
25369
25613
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
25370
25614
  group.items.map((itemData, index) => {
25371
25615
  const id = itemData.id || `${gi}-${index}`;
@@ -25413,18 +25657,112 @@ function DataList({
25413
25657
  }
25414
25658
  const items = data.map((item) => item);
25415
25659
  const groups = groupBy ? groupData(items, groupBy) : [{ label: "", items }];
25660
+ const idFieldName = dndItemIdField ?? "id";
25416
25661
  const renderItem = (itemData, index, isLast) => {
25662
+ const dndId = itemData[idFieldName] ?? `__idx_${index}`;
25663
+ const wrapDnd = (node) => dnd.enabled ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: dndId, children: node }) : node;
25417
25664
  if (hasRenderProp) {
25418
25665
  const id2 = itemData.id || String(index);
25419
- return /* @__PURE__ */ jsxs(Box, { "data-entity-row": true, "data-entity-id": id2, children: [
25420
- /* @__PURE__ */ jsxs(Box, { className: "group flex items-stretch gap-2", children: [
25421
- /* @__PURE__ */ jsx(Box, { className: "flex-1 min-w-0", children: children(itemData, index) }),
25422
- itemActions && itemActions.length > 0 && /* @__PURE__ */ jsx(
25423
- HStack,
25424
- {
25425
- gap: "xs",
25426
- className: "flex-shrink-0",
25427
- children: itemActions.map((action, idx) => /* @__PURE__ */ jsxs(
25666
+ return wrapDnd(
25667
+ /* @__PURE__ */ jsxs(Box, { "data-entity-row": true, "data-entity-id": id2, children: [
25668
+ /* @__PURE__ */ jsxs(Box, { className: "group flex items-stretch gap-2", children: [
25669
+ /* @__PURE__ */ jsx(Box, { className: "flex-1 min-w-0", children: children(itemData, index) }),
25670
+ itemActions && itemActions.length > 0 && /* @__PURE__ */ jsx(
25671
+ HStack,
25672
+ {
25673
+ gap: "xs",
25674
+ className: "flex-shrink-0",
25675
+ children: itemActions.map((action, idx) => /* @__PURE__ */ jsxs(
25676
+ Button,
25677
+ {
25678
+ variant: action.variant ?? "ghost",
25679
+ size: "sm",
25680
+ onClick: handleActionClick(action, itemData),
25681
+ "data-testid": `action-${action.event}`,
25682
+ "data-row-id": String(itemData.id),
25683
+ className: cn(
25684
+ action.variant === "danger" && "text-error hover:bg-error/10"
25685
+ ),
25686
+ children: [
25687
+ action.icon && /* @__PURE__ */ jsx(Icon, { name: action.icon, size: "xs", className: "mr-1" }),
25688
+ action.label
25689
+ ]
25690
+ },
25691
+ idx
25692
+ ))
25693
+ }
25694
+ )
25695
+ ] }),
25696
+ isCard && !isLast && /* @__PURE__ */ jsx(Box, { className: "mx-6 border-b border-border/40" })
25697
+ ] }, id2)
25698
+ );
25699
+ }
25700
+ const id = itemData.id || String(index);
25701
+ const titleValue = getNestedValue(itemData, titleField?.name ?? "");
25702
+ return wrapDnd(
25703
+ /* @__PURE__ */ jsxs(Box, { "data-entity-row": true, "data-entity-id": id, children: [
25704
+ /* @__PURE__ */ jsxs(
25705
+ Box,
25706
+ {
25707
+ className: cn(
25708
+ "group flex items-center gap-4 transition-all duration-200",
25709
+ isCompact ? "px-4 py-2" : "px-6 py-4",
25710
+ "hover:bg-muted/80",
25711
+ !isCard && !isCompact && "rounded-lg border border-transparent hover:border-border"
25712
+ ),
25713
+ children: [
25714
+ /* @__PURE__ */ jsxs(Box, { className: "flex-1 min-w-0", children: [
25715
+ /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: "items-center", children: [
25716
+ titleField?.icon && /* @__PURE__ */ jsx(
25717
+ Icon,
25718
+ {
25719
+ name: titleField.icon,
25720
+ size: isCompact ? "xs" : "sm",
25721
+ className: "text-primary flex-shrink-0"
25722
+ }
25723
+ ),
25724
+ titleValue !== void 0 && titleValue !== null && /* @__PURE__ */ jsx(
25725
+ Typography,
25726
+ {
25727
+ variant: titleField?.variant === "h3" ? "h3" : "h4",
25728
+ className: cn("font-semibold truncate flex-1", isCompact && "text-sm"),
25729
+ children: String(titleValue)
25730
+ }
25731
+ ),
25732
+ badgeFields.map((field) => {
25733
+ const val = getNestedValue(itemData, field.name);
25734
+ if (val === void 0 || val === null) return null;
25735
+ return /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center flex-shrink-0", children: [
25736
+ field.icon && /* @__PURE__ */ jsx(Icon, { name: field.icon, size: "xs" }),
25737
+ /* @__PURE__ */ jsx(Badge, { variant: statusVariant3(String(val)), children: String(val) })
25738
+ ] }, field.name);
25739
+ })
25740
+ ] }),
25741
+ bodyFields.length > 0 && !isCompact && /* @__PURE__ */ jsx(HStack, { gap: "md", className: "mt-1.5 flex-wrap", children: bodyFields.map((field) => {
25742
+ const value = getNestedValue(itemData, field.name);
25743
+ if (value === void 0 || value === null || value === "") return null;
25744
+ return /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
25745
+ field.icon && /* @__PURE__ */ jsx(Icon, { name: field.icon, size: "xs", className: "text-muted-foreground" }),
25746
+ /* @__PURE__ */ jsxs(Typography, { variant: "caption", color: "secondary", children: [
25747
+ field.label ?? fieldLabel3(field.name),
25748
+ ":"
25749
+ ] }),
25750
+ /* @__PURE__ */ jsx(Typography, { variant: "small", children: formatValue2(value, field.format) })
25751
+ ] }, field.name);
25752
+ }) }),
25753
+ progressFields.map((field) => {
25754
+ const value = getNestedValue(itemData, field.name);
25755
+ if (typeof value !== "number") return null;
25756
+ return /* @__PURE__ */ jsxs(Box, { className: "mt-2 max-w-xs", children: [
25757
+ /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center mb-1", children: [
25758
+ field.icon && /* @__PURE__ */ jsx(Icon, { name: field.icon, size: "xs", className: "text-muted-foreground" }),
25759
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", children: field.label ?? fieldLabel3(field.name) })
25760
+ ] }),
25761
+ /* @__PURE__ */ jsx(ProgressBar, { value, max: 100 })
25762
+ ] }, field.name);
25763
+ })
25764
+ ] }),
25765
+ itemActions && itemActions.length > 0 && /* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-shrink-0", children: itemActions.map((action, idx) => /* @__PURE__ */ jsxs(
25428
25766
  Button,
25429
25767
  {
25430
25768
  variant: action.variant ?? "ghost",
@@ -25441,141 +25779,56 @@ function DataList({
25441
25779
  ]
25442
25780
  },
25443
25781
  idx
25444
- ))
25445
- }
25446
- )
25447
- ] }),
25782
+ )) })
25783
+ ]
25784
+ }
25785
+ ),
25448
25786
  isCard && !isLast && /* @__PURE__ */ jsx(Box, { className: "mx-6 border-b border-border/40" })
25449
- ] }, id2);
25450
- }
25451
- const id = itemData.id || String(index);
25452
- const titleValue = getNestedValue(itemData, titleField?.name ?? "");
25453
- return /* @__PURE__ */ jsxs(Box, { "data-entity-row": true, "data-entity-id": id, children: [
25454
- /* @__PURE__ */ jsxs(
25455
- Box,
25456
- {
25457
- className: cn(
25458
- "group flex items-center gap-4 transition-all duration-200",
25459
- isCompact ? "px-4 py-2" : "px-6 py-4",
25460
- "hover:bg-muted/80",
25461
- !isCard && !isCompact && "rounded-lg border border-transparent hover:border-border"
25462
- ),
25463
- children: [
25464
- /* @__PURE__ */ jsxs(Box, { className: "flex-1 min-w-0", children: [
25465
- /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: "items-center", children: [
25466
- titleField?.icon && /* @__PURE__ */ jsx(
25467
- Icon,
25468
- {
25469
- name: titleField.icon,
25470
- size: isCompact ? "xs" : "sm",
25471
- className: "text-primary flex-shrink-0"
25472
- }
25473
- ),
25474
- titleValue !== void 0 && titleValue !== null && /* @__PURE__ */ jsx(
25475
- Typography,
25476
- {
25477
- variant: titleField?.variant === "h3" ? "h3" : "h4",
25478
- className: cn("font-semibold truncate flex-1", isCompact && "text-sm"),
25479
- children: String(titleValue)
25480
- }
25481
- ),
25482
- badgeFields.map((field) => {
25483
- const val = getNestedValue(itemData, field.name);
25484
- if (val === void 0 || val === null) return null;
25485
- return /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center flex-shrink-0", children: [
25486
- field.icon && /* @__PURE__ */ jsx(Icon, { name: field.icon, size: "xs" }),
25487
- /* @__PURE__ */ jsx(Badge, { variant: statusVariant3(String(val)), children: String(val) })
25488
- ] }, field.name);
25489
- })
25490
- ] }),
25491
- bodyFields.length > 0 && !isCompact && /* @__PURE__ */ jsx(HStack, { gap: "md", className: "mt-1.5 flex-wrap", children: bodyFields.map((field) => {
25492
- const value = getNestedValue(itemData, field.name);
25493
- if (value === void 0 || value === null || value === "") return null;
25494
- return /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
25495
- field.icon && /* @__PURE__ */ jsx(Icon, { name: field.icon, size: "xs", className: "text-muted-foreground" }),
25496
- /* @__PURE__ */ jsxs(Typography, { variant: "caption", color: "secondary", children: [
25497
- field.label ?? fieldLabel3(field.name),
25498
- ":"
25499
- ] }),
25500
- /* @__PURE__ */ jsx(Typography, { variant: "small", children: formatValue2(value, field.format) })
25501
- ] }, field.name);
25502
- }) }),
25503
- progressFields.map((field) => {
25504
- const value = getNestedValue(itemData, field.name);
25505
- if (typeof value !== "number") return null;
25506
- return /* @__PURE__ */ jsxs(Box, { className: "mt-2 max-w-xs", children: [
25507
- /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center mb-1", children: [
25508
- field.icon && /* @__PURE__ */ jsx(Icon, { name: field.icon, size: "xs", className: "text-muted-foreground" }),
25509
- /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", children: field.label ?? fieldLabel3(field.name) })
25510
- ] }),
25511
- /* @__PURE__ */ jsx(ProgressBar, { value, max: 100 })
25512
- ] }, field.name);
25513
- })
25514
- ] }),
25515
- itemActions && itemActions.length > 0 && /* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-shrink-0", children: itemActions.map((action, idx) => /* @__PURE__ */ jsxs(
25516
- Button,
25517
- {
25518
- variant: action.variant ?? "ghost",
25519
- size: "sm",
25520
- onClick: handleActionClick(action, itemData),
25521
- "data-testid": `action-${action.event}`,
25522
- "data-row-id": String(itemData.id),
25523
- className: cn(
25524
- action.variant === "danger" && "text-error hover:bg-error/10"
25525
- ),
25526
- children: [
25527
- action.icon && /* @__PURE__ */ jsx(Icon, { name: action.icon, size: "xs", className: "mr-1" }),
25528
- action.label
25529
- ]
25530
- },
25531
- idx
25532
- )) })
25533
- ]
25534
- }
25535
- ),
25536
- isCard && !isLast && /* @__PURE__ */ jsx(Box, { className: "mx-6 border-b border-border/40" })
25537
- ] }, id);
25787
+ ] }, id)
25788
+ );
25538
25789
  };
25539
- return /* @__PURE__ */ jsxs(
25540
- Box,
25541
- {
25542
- className: cn(
25543
- isCard && "bg-card rounded-xl border border-border shadow-lg overflow-hidden",
25544
- !isCard && gapClass,
25545
- className
25546
- ),
25547
- children: [
25548
- groups.map((group, gi) => /* @__PURE__ */ jsxs(React147__default.Fragment, { children: [
25549
- group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
25550
- group.items.map(
25551
- (itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
25790
+ return dnd.wrapContainer(
25791
+ /* @__PURE__ */ jsxs(
25792
+ Box,
25793
+ {
25794
+ className: cn(
25795
+ isCard && "bg-card rounded-xl border border-border shadow-lg overflow-hidden",
25796
+ !isCard && gapClass,
25797
+ className
25798
+ ),
25799
+ children: [
25800
+ groups.map((group, gi) => /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
25801
+ group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
25802
+ group.items.map(
25803
+ (itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
25804
+ )
25805
+ ] }, gi)),
25806
+ hasMoreLocal && /* @__PURE__ */ jsx(Box, { className: "flex justify-center py-3", children: /* @__PURE__ */ jsxs(
25807
+ Button,
25808
+ {
25809
+ variant: "ghost",
25810
+ size: "sm",
25811
+ onClick: () => setVisibleCount((prev) => prev + (pageSize || 5)),
25812
+ children: [
25813
+ /* @__PURE__ */ jsx(Icon, { name: "chevron-down", size: "xs", className: "mr-1" }),
25814
+ t("common.showMore"),
25815
+ " (",
25816
+ allData.length - visibleCount,
25817
+ " remaining)"
25818
+ ]
25819
+ }
25820
+ ) }),
25821
+ infiniteScroll && loadMoreEvent && /* @__PURE__ */ jsx(
25822
+ InfiniteScrollSentinel,
25823
+ {
25824
+ loadMoreEvent,
25825
+ isLoading,
25826
+ hasMore
25827
+ }
25552
25828
  )
25553
- ] }, gi)),
25554
- hasMoreLocal && /* @__PURE__ */ jsx(Box, { className: "flex justify-center py-3", children: /* @__PURE__ */ jsxs(
25555
- Button,
25556
- {
25557
- variant: "ghost",
25558
- size: "sm",
25559
- onClick: () => setVisibleCount((prev) => prev + (pageSize || 5)),
25560
- children: [
25561
- /* @__PURE__ */ jsx(Icon, { name: "chevron-down", size: "xs", className: "mr-1" }),
25562
- t("common.showMore"),
25563
- " (",
25564
- allData.length - visibleCount,
25565
- " remaining)"
25566
- ]
25567
- }
25568
- ) }),
25569
- infiniteScroll && loadMoreEvent && /* @__PURE__ */ jsx(
25570
- InfiniteScrollSentinel,
25571
- {
25572
- loadMoreEvent,
25573
- isLoading,
25574
- hasMore
25575
- }
25576
- )
25577
- ]
25578
- }
25829
+ ]
25830
+ }
25831
+ )
25579
25832
  );
25580
25833
  }
25581
25834
  var dataListLog;
@@ -25595,6 +25848,7 @@ var init_DataList = __esm({
25595
25848
  init_ProgressBar();
25596
25849
  init_Divider();
25597
25850
  init_InfiniteScrollSentinel();
25851
+ init_useDataDnd();
25598
25852
  dataListLog = createLogger("almadar:ui:data-list");
25599
25853
  DataList.displayName = "DataList";
25600
25854
  }
@@ -26845,7 +27099,7 @@ var init_WizardProgress = __esm({
26845
27099
  children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
26846
27100
  const isActive = index === currentStep;
26847
27101
  const isCompleted = index < currentStep;
26848
- return /* @__PURE__ */ jsxs(React147__default.Fragment, { children: [
27102
+ return /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
26849
27103
  /* @__PURE__ */ jsx(
26850
27104
  "button",
26851
27105
  {
@@ -27756,7 +28010,7 @@ function InventoryGrid({
27756
28010
  const eventBus = useEventBus();
27757
28011
  const slotCount = totalSlots ?? items.length;
27758
28012
  const emptySlotCount = Math.max(0, slotCount - items.length);
27759
- const handleSelect = React147.useCallback(
28013
+ const handleSelect = React93.useCallback(
27760
28014
  (id) => {
27761
28015
  onSelect?.(id);
27762
28016
  if (selectEvent) {
@@ -27969,15 +28223,15 @@ function GameCanvas2D({
27969
28223
  fps = 60,
27970
28224
  className
27971
28225
  }) {
27972
- const canvasRef = React147.useRef(null);
27973
- const rafRef = React147.useRef(0);
27974
- const frameRef = React147.useRef(0);
27975
- const lastTimeRef = React147.useRef(0);
27976
- const onDrawRef = React147.useRef(onDraw);
28226
+ const canvasRef = React93.useRef(null);
28227
+ const rafRef = React93.useRef(0);
28228
+ const frameRef = React93.useRef(0);
28229
+ const lastTimeRef = React93.useRef(0);
28230
+ const onDrawRef = React93.useRef(onDraw);
27977
28231
  onDrawRef.current = onDraw;
27978
- const onTickRef = React147.useRef(onTick);
28232
+ const onTickRef = React93.useRef(onTick);
27979
28233
  onTickRef.current = onTick;
27980
- React147.useEffect(() => {
28234
+ React93.useEffect(() => {
27981
28235
  const canvas = canvasRef.current;
27982
28236
  if (!canvas) return;
27983
28237
  const ctx = canvas.getContext("2d");
@@ -28266,7 +28520,7 @@ function TurnPanel({
28266
28520
  className
28267
28521
  }) {
28268
28522
  const eventBus = useEventBus();
28269
- const handleAction = React147.useCallback(
28523
+ const handleAction = React93.useCallback(
28270
28524
  (event) => {
28271
28525
  if (event) {
28272
28526
  eventBus.emit(event, { turn: currentTurn, phase, activeTeam });
@@ -28412,7 +28666,7 @@ function UnitCommandBar({
28412
28666
  className
28413
28667
  }) {
28414
28668
  const eventBus = useEventBus();
28415
- const handleCommand = React147.useCallback(
28669
+ const handleCommand = React93.useCallback(
28416
28670
  (event) => {
28417
28671
  if (event) {
28418
28672
  eventBus.emit(event, { unitId: selectedUnitId });
@@ -28897,7 +29151,7 @@ function GameMenu({
28897
29151
  } catch {
28898
29152
  }
28899
29153
  const eventBus = eventBusProp || eventBusFromHook;
28900
- const handleOptionClick = React147.useCallback(
29154
+ const handleOptionClick = React93.useCallback(
28901
29155
  (option) => {
28902
29156
  if (option.event && eventBus) {
28903
29157
  eventBus.emit(`UI:${option.event}`, { option });
@@ -29011,7 +29265,7 @@ function GameOverScreen({
29011
29265
  } catch {
29012
29266
  }
29013
29267
  const eventBus = eventBusProp || eventBusFromHook;
29014
- const handleActionClick = React147.useCallback(
29268
+ const handleActionClick = React93.useCallback(
29015
29269
  (action) => {
29016
29270
  if (action.event && eventBus) {
29017
29271
  eventBus.emit(`UI:${action.event}`, { action });
@@ -31638,7 +31892,7 @@ var init_StepFlow = __esm({
31638
31892
  className
31639
31893
  }) => {
31640
31894
  if (orientation === "vertical") {
31641
- return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React147__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
31895
+ 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: [
31642
31896
  /* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
31643
31897
  /* @__PURE__ */ jsx(StepCircle, { step, index }),
31644
31898
  showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
@@ -31649,7 +31903,7 @@ var init_StepFlow = __esm({
31649
31903
  ] })
31650
31904
  ] }) }, index)) });
31651
31905
  }
31652
- 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(React147__default.Fragment, { children: [
31906
+ 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: [
31653
31907
  /* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
31654
31908
  /* @__PURE__ */ jsx(StepCircle, { step, index }),
31655
31909
  /* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
@@ -32531,7 +32785,7 @@ var init_LikertScale = __esm({
32531
32785
  md: "text-base",
32532
32786
  lg: "text-lg"
32533
32787
  };
32534
- LikertScale = React147__default.forwardRef(
32788
+ LikertScale = React93__default.forwardRef(
32535
32789
  ({
32536
32790
  question,
32537
32791
  options = DEFAULT_LIKERT_OPTIONS,
@@ -32543,7 +32797,7 @@ var init_LikertScale = __esm({
32543
32797
  variant = "radios",
32544
32798
  className
32545
32799
  }, ref) => {
32546
- const groupId = React147__default.useId();
32800
+ const groupId = React93__default.useId();
32547
32801
  const eventBus = useEventBus();
32548
32802
  const handleSelect = useCallback(
32549
32803
  (next) => {
@@ -34769,7 +35023,7 @@ var init_DocBreadcrumb = __esm({
34769
35023
  "aria-label": "Breadcrumb",
34770
35024
  children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
34771
35025
  const isLast = idx === items.length - 1;
34772
- return /* @__PURE__ */ jsxs(React147__default.Fragment, { children: [
35026
+ return /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
34773
35027
  idx > 0 && /* @__PURE__ */ jsx(
34774
35028
  Icon,
34775
35029
  {
@@ -36633,7 +36887,7 @@ var init_DocumentViewer = __esm({
36633
36887
  }
36634
36888
  });
36635
36889
  function extractTitle(children) {
36636
- if (!React147__default.isValidElement(children)) return void 0;
36890
+ if (!React93__default.isValidElement(children)) return void 0;
36637
36891
  const props = children.props;
36638
36892
  if (typeof props.title === "string") {
36639
36893
  return props.title;
@@ -36688,7 +36942,7 @@ function LinearView({
36688
36942
  /* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
36689
36943
  const isDone = i < currentIdx;
36690
36944
  const isCurrent = i === currentIdx;
36691
- return /* @__PURE__ */ jsxs(React147__default.Fragment, { children: [
36945
+ return /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
36692
36946
  i > 0 && /* @__PURE__ */ jsx(
36693
36947
  Typography,
36694
36948
  {
@@ -37588,12 +37842,12 @@ var init_Form = __esm({
37588
37842
  const isSchemaEntity = isOrbitalEntitySchema(entity);
37589
37843
  const resolvedEntity = isSchemaEntity ? entity : void 0;
37590
37844
  const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
37591
- const normalizedInitialData = React147__default.useMemo(() => {
37845
+ const normalizedInitialData = React93__default.useMemo(() => {
37592
37846
  const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
37593
37847
  const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
37594
37848
  return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
37595
37849
  }, [entity, initialData]);
37596
- const entityDerivedFields = React147__default.useMemo(() => {
37850
+ const entityDerivedFields = React93__default.useMemo(() => {
37597
37851
  if (fields && fields.length > 0) return void 0;
37598
37852
  if (!resolvedEntity) return void 0;
37599
37853
  return resolvedEntity.fields.map(
@@ -37612,16 +37866,16 @@ var init_Form = __esm({
37612
37866
  const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
37613
37867
  const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
37614
37868
  const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
37615
- const [formData, setFormData] = React147__default.useState(
37869
+ const [formData, setFormData] = React93__default.useState(
37616
37870
  normalizedInitialData
37617
37871
  );
37618
- const [collapsedSections, setCollapsedSections] = React147__default.useState(
37872
+ const [collapsedSections, setCollapsedSections] = React93__default.useState(
37619
37873
  /* @__PURE__ */ new Set()
37620
37874
  );
37621
- const [submitError, setSubmitError] = React147__default.useState(null);
37622
- const formRef = React147__default.useRef(null);
37875
+ const [submitError, setSubmitError] = React93__default.useState(null);
37876
+ const formRef = React93__default.useRef(null);
37623
37877
  const formMode = props.mode;
37624
- const mountedRef = React147__default.useRef(false);
37878
+ const mountedRef = React93__default.useRef(false);
37625
37879
  if (!mountedRef.current) {
37626
37880
  mountedRef.current = true;
37627
37881
  debug("forms", "mount", {
@@ -37634,7 +37888,7 @@ var init_Form = __esm({
37634
37888
  });
37635
37889
  }
37636
37890
  const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
37637
- const evalContext = React147__default.useMemo(
37891
+ const evalContext = React93__default.useMemo(
37638
37892
  () => ({
37639
37893
  formValues: formData,
37640
37894
  globalVariables: externalContext?.globalVariables ?? {},
@@ -37643,7 +37897,7 @@ var init_Form = __esm({
37643
37897
  }),
37644
37898
  [formData, externalContext]
37645
37899
  );
37646
- React147__default.useEffect(() => {
37900
+ React93__default.useEffect(() => {
37647
37901
  debug("forms", "initialData-sync", {
37648
37902
  mode: formMode,
37649
37903
  normalizedInitialData,
@@ -37654,7 +37908,7 @@ var init_Form = __esm({
37654
37908
  setFormData(normalizedInitialData);
37655
37909
  }
37656
37910
  }, [normalizedInitialData]);
37657
- const processCalculations = React147__default.useCallback(
37911
+ const processCalculations = React93__default.useCallback(
37658
37912
  (changedFieldId, newFormData) => {
37659
37913
  if (!hiddenCalculations.length) return;
37660
37914
  const context = {
@@ -37679,7 +37933,7 @@ var init_Form = __esm({
37679
37933
  },
37680
37934
  [hiddenCalculations, externalContext, eventBus]
37681
37935
  );
37682
- const checkViolations = React147__default.useCallback(
37936
+ const checkViolations = React93__default.useCallback(
37683
37937
  (changedFieldId, newFormData) => {
37684
37938
  if (!violationTriggers.length) return;
37685
37939
  const context = {
@@ -37717,7 +37971,7 @@ var init_Form = __esm({
37717
37971
  processCalculations(name, newFormData);
37718
37972
  checkViolations(name, newFormData);
37719
37973
  };
37720
- const isFieldVisible = React147__default.useCallback(
37974
+ const isFieldVisible = React93__default.useCallback(
37721
37975
  (fieldName) => {
37722
37976
  const condition = conditionalFields[fieldName];
37723
37977
  if (!condition) return true;
@@ -37725,7 +37979,7 @@ var init_Form = __esm({
37725
37979
  },
37726
37980
  [conditionalFields, evalContext]
37727
37981
  );
37728
- const isSectionVisible = React147__default.useCallback(
37982
+ const isSectionVisible = React93__default.useCallback(
37729
37983
  (section) => {
37730
37984
  if (!section.condition) return true;
37731
37985
  return Boolean(evaluateFormExpression(section.condition, evalContext));
@@ -37801,7 +38055,7 @@ var init_Form = __esm({
37801
38055
  eventBus.emit(`UI:${onCancel}`);
37802
38056
  }
37803
38057
  };
37804
- const renderField = React147__default.useCallback(
38058
+ const renderField = React93__default.useCallback(
37805
38059
  (field) => {
37806
38060
  const fieldName = field.name || field.field;
37807
38061
  if (!fieldName) return null;
@@ -37822,7 +38076,7 @@ var init_Form = __esm({
37822
38076
  [formData, isFieldVisible, relationsData, relationsLoading, isLoading]
37823
38077
  );
37824
38078
  const effectiveFields = entityDerivedFields ?? fields;
37825
- const normalizedFields = React147__default.useMemo(() => {
38079
+ const normalizedFields = React93__default.useMemo(() => {
37826
38080
  if (!effectiveFields || effectiveFields.length === 0) return [];
37827
38081
  return effectiveFields.map((field) => {
37828
38082
  if (typeof field === "string") {
@@ -37844,7 +38098,7 @@ var init_Form = __esm({
37844
38098
  return field;
37845
38099
  });
37846
38100
  }, [effectiveFields, resolvedEntity]);
37847
- const schemaFields = React147__default.useMemo(() => {
38101
+ const schemaFields = React93__default.useMemo(() => {
37848
38102
  if (normalizedFields.length === 0) return null;
37849
38103
  if (isDebugEnabled()) {
37850
38104
  debugGroup(`Form: ${entityName || "unknown"}`);
@@ -37854,7 +38108,7 @@ var init_Form = __esm({
37854
38108
  }
37855
38109
  return normalizedFields.map(renderField).filter(Boolean);
37856
38110
  }, [normalizedFields, renderField, entityName, conditionalFields]);
37857
- const sectionElements = React147__default.useMemo(() => {
38111
+ const sectionElements = React93__default.useMemo(() => {
37858
38112
  if (!sections || sections.length === 0) return null;
37859
38113
  return sections.map((section) => {
37860
38114
  if (!isSectionVisible(section)) {
@@ -39580,7 +39834,7 @@ var init_List = __esm({
39580
39834
  if (entity && typeof entity === "object" && "id" in entity) return [entity];
39581
39835
  return [];
39582
39836
  }, [entity]);
39583
- const getItemActions = React147__default.useCallback(
39837
+ const getItemActions = React93__default.useCallback(
39584
39838
  (item) => {
39585
39839
  if (!itemActions) return [];
39586
39840
  if (typeof itemActions === "function") {
@@ -40053,7 +40307,7 @@ var init_MediaGallery = __esm({
40053
40307
  [selectable, selectedItems, selectionEvent, eventBus]
40054
40308
  );
40055
40309
  const entityData = Array.isArray(entity) ? entity : [];
40056
- const items = React147__default.useMemo(() => {
40310
+ const items = React93__default.useMemo(() => {
40057
40311
  if (propItems) return propItems;
40058
40312
  if (entityData.length === 0) return [];
40059
40313
  return entityData.map((record, idx) => ({
@@ -40217,7 +40471,7 @@ var init_MediaGallery = __esm({
40217
40471
  }
40218
40472
  });
40219
40473
  function extractTitle2(children) {
40220
- if (!React147__default.isValidElement(children)) return void 0;
40474
+ if (!React93__default.isValidElement(children)) return void 0;
40221
40475
  const props = children.props;
40222
40476
  if (typeof props.title === "string") {
40223
40477
  return props.title;
@@ -40930,7 +41184,7 @@ var init_PageHeader = __esm({
40930
41184
  info: "bg-info/10 text-info"
40931
41185
  };
40932
41186
  return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
40933
- 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(React147__default.Fragment, { children: [
41187
+ 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: [
40934
41188
  idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
40935
41189
  crumb.href ? /* @__PURE__ */ jsx(
40936
41190
  "a",
@@ -41245,7 +41499,7 @@ var init_debugRegistry = __esm({
41245
41499
  }
41246
41500
  });
41247
41501
  function useDebugData() {
41248
- const [data, setData] = React147.useState(() => ({
41502
+ const [data, setData] = React93.useState(() => ({
41249
41503
  traits: [],
41250
41504
  ticks: [],
41251
41505
  guards: [],
@@ -41259,7 +41513,7 @@ function useDebugData() {
41259
41513
  },
41260
41514
  lastUpdate: Date.now()
41261
41515
  }));
41262
- React147.useEffect(() => {
41516
+ React93.useEffect(() => {
41263
41517
  const updateData = () => {
41264
41518
  setData({
41265
41519
  traits: getAllTraits(),
@@ -41368,12 +41622,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
41368
41622
  return positions;
41369
41623
  }
41370
41624
  function WalkMinimap() {
41371
- const [walkStep, setWalkStep] = React147.useState(null);
41372
- const [traits2, setTraits] = React147.useState([]);
41373
- const [coveredEdges, setCoveredEdges] = React147.useState([]);
41374
- const [completedTraits, setCompletedTraits] = React147.useState(/* @__PURE__ */ new Set());
41375
- const prevTraitRef = React147.useRef(null);
41376
- React147.useEffect(() => {
41625
+ const [walkStep, setWalkStep] = React93.useState(null);
41626
+ const [traits2, setTraits] = React93.useState([]);
41627
+ const [coveredEdges, setCoveredEdges] = React93.useState([]);
41628
+ const [completedTraits, setCompletedTraits] = React93.useState(/* @__PURE__ */ new Set());
41629
+ const prevTraitRef = React93.useRef(null);
41630
+ React93.useEffect(() => {
41377
41631
  const interval = setInterval(() => {
41378
41632
  const w = window;
41379
41633
  const step = w.__orbitalWalkStep;
@@ -41820,15 +42074,15 @@ var init_EntitiesTab = __esm({
41820
42074
  }
41821
42075
  });
41822
42076
  function EventFlowTab({ events: events2 }) {
41823
- const [filter, setFilter] = React147.useState("all");
41824
- const containerRef = React147.useRef(null);
41825
- const [autoScroll, setAutoScroll] = React147.useState(true);
41826
- React147.useEffect(() => {
42077
+ const [filter, setFilter] = React93.useState("all");
42078
+ const containerRef = React93.useRef(null);
42079
+ const [autoScroll, setAutoScroll] = React93.useState(true);
42080
+ React93.useEffect(() => {
41827
42081
  if (autoScroll && containerRef.current) {
41828
42082
  containerRef.current.scrollTop = containerRef.current.scrollHeight;
41829
42083
  }
41830
42084
  }, [events2.length, autoScroll]);
41831
- const filteredEvents = React147.useMemo(() => {
42085
+ const filteredEvents = React93.useMemo(() => {
41832
42086
  if (filter === "all") return events2;
41833
42087
  return events2.filter((e) => e.type === filter);
41834
42088
  }, [events2, filter]);
@@ -41947,7 +42201,7 @@ var init_EventFlowTab = __esm({
41947
42201
  }
41948
42202
  });
41949
42203
  function GuardsPanel({ guards }) {
41950
- const [filter, setFilter] = React147.useState("all");
42204
+ const [filter, setFilter] = React93.useState("all");
41951
42205
  if (guards.length === 0) {
41952
42206
  return /* @__PURE__ */ jsx(
41953
42207
  EmptyState,
@@ -41960,7 +42214,7 @@ function GuardsPanel({ guards }) {
41960
42214
  }
41961
42215
  const passedCount = guards.filter((g) => g.result).length;
41962
42216
  const failedCount = guards.length - passedCount;
41963
- const filteredGuards = React147.useMemo(() => {
42217
+ const filteredGuards = React93.useMemo(() => {
41964
42218
  if (filter === "all") return guards;
41965
42219
  if (filter === "passed") return guards.filter((g) => g.result);
41966
42220
  return guards.filter((g) => !g.result);
@@ -42121,10 +42375,10 @@ function EffectBadge({ effect }) {
42121
42375
  ] });
42122
42376
  }
42123
42377
  function TransitionTimeline({ transitions }) {
42124
- const containerRef = React147.useRef(null);
42125
- const [autoScroll, setAutoScroll] = React147.useState(true);
42126
- const [expandedId, setExpandedId] = React147.useState(null);
42127
- React147.useEffect(() => {
42378
+ const containerRef = React93.useRef(null);
42379
+ const [autoScroll, setAutoScroll] = React93.useState(true);
42380
+ const [expandedId, setExpandedId] = React93.useState(null);
42381
+ React93.useEffect(() => {
42128
42382
  if (autoScroll && containerRef.current) {
42129
42383
  containerRef.current.scrollTop = containerRef.current.scrollHeight;
42130
42384
  }
@@ -42410,9 +42664,9 @@ function getAllEvents(traits2) {
42410
42664
  }
42411
42665
  function EventDispatcherTab({ traits: traits2, schema }) {
42412
42666
  const eventBus = useEventBus();
42413
- const [log19, setLog] = React147.useState([]);
42414
- const prevStatesRef = React147.useRef(/* @__PURE__ */ new Map());
42415
- React147.useEffect(() => {
42667
+ const [log19, setLog] = React93.useState([]);
42668
+ const prevStatesRef = React93.useRef(/* @__PURE__ */ new Map());
42669
+ React93.useEffect(() => {
42416
42670
  for (const trait of traits2) {
42417
42671
  const prev = prevStatesRef.current.get(trait.id);
42418
42672
  if (prev && prev !== trait.currentState) {
@@ -42582,10 +42836,10 @@ function VerifyModePanel({
42582
42836
  serverCount,
42583
42837
  localCount
42584
42838
  }) {
42585
- const [expanded, setExpanded] = React147.useState(true);
42586
- const scrollRef = React147.useRef(null);
42587
- const prevCountRef = React147.useRef(0);
42588
- React147.useEffect(() => {
42839
+ const [expanded, setExpanded] = React93.useState(true);
42840
+ const scrollRef = React93.useRef(null);
42841
+ const prevCountRef = React93.useRef(0);
42842
+ React93.useEffect(() => {
42589
42843
  if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
42590
42844
  scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
42591
42845
  }
@@ -42651,10 +42905,10 @@ function RuntimeDebugger({
42651
42905
  defaultTab,
42652
42906
  schema
42653
42907
  }) {
42654
- const [isCollapsed, setIsCollapsed] = React147.useState(mode === "verify" ? true : defaultCollapsed);
42655
- const [isVisible, setIsVisible] = React147.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
42908
+ const [isCollapsed, setIsCollapsed] = React93.useState(mode === "verify" ? true : defaultCollapsed);
42909
+ const [isVisible, setIsVisible] = React93.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
42656
42910
  const debugData = useDebugData();
42657
- React147.useEffect(() => {
42911
+ React93.useEffect(() => {
42658
42912
  if (mode === "inline") return;
42659
42913
  return onDebugToggle((enabled) => {
42660
42914
  setIsVisible(enabled);
@@ -42663,7 +42917,7 @@ function RuntimeDebugger({
42663
42917
  }
42664
42918
  });
42665
42919
  }, [mode]);
42666
- React147.useEffect(() => {
42920
+ React93.useEffect(() => {
42667
42921
  if (mode === "inline") return;
42668
42922
  const handleKeyDown = (e) => {
42669
42923
  if (e.key === "`" && isVisible) {
@@ -43212,7 +43466,7 @@ function SequenceBar({
43212
43466
  onSlotRemove(index);
43213
43467
  }, [onSlotRemove, playing]);
43214
43468
  const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
43215
- return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React147__default.Fragment, { children: [
43469
+ return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
43216
43470
  i > 0 && /* @__PURE__ */ jsx(
43217
43471
  Typography,
43218
43472
  {
@@ -44613,7 +44867,7 @@ var init_StatCard = __esm({
44613
44867
  const labelToUse = propLabel ?? propTitle;
44614
44868
  const eventBus = useEventBus();
44615
44869
  const { t } = useTranslate();
44616
- const handleActionClick = React147__default.useCallback(() => {
44870
+ const handleActionClick = React93__default.useCallback(() => {
44617
44871
  if (action?.event) {
44618
44872
  eventBus.emit(`UI:${action.event}`, {});
44619
44873
  }
@@ -44624,7 +44878,7 @@ var init_StatCard = __esm({
44624
44878
  const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
44625
44879
  const isLoading = externalLoading ?? false;
44626
44880
  const error = externalError;
44627
- const computeMetricValue = React147__default.useCallback(
44881
+ const computeMetricValue = React93__default.useCallback(
44628
44882
  (metric, items) => {
44629
44883
  if (metric.value !== void 0) {
44630
44884
  return metric.value;
@@ -44663,7 +44917,7 @@ var init_StatCard = __esm({
44663
44917
  },
44664
44918
  []
44665
44919
  );
44666
- const schemaStats = React147__default.useMemo(() => {
44920
+ const schemaStats = React93__default.useMemo(() => {
44667
44921
  if (!metrics || metrics.length === 0) return null;
44668
44922
  return metrics.map((metric) => ({
44669
44923
  label: metric.label,
@@ -44671,7 +44925,7 @@ var init_StatCard = __esm({
44671
44925
  format: metric.format
44672
44926
  }));
44673
44927
  }, [metrics, data, computeMetricValue]);
44674
- const calculatedTrend = React147__default.useMemo(() => {
44928
+ const calculatedTrend = React93__default.useMemo(() => {
44675
44929
  if (manualTrend !== void 0) return manualTrend;
44676
44930
  if (previousValue === void 0 || currentValue === void 0)
44677
44931
  return void 0;
@@ -45807,7 +46061,7 @@ var init_Timeline = __esm({
45807
46061
  }) => {
45808
46062
  const { t } = useTranslate();
45809
46063
  const entityData = Array.isArray(entity) ? entity : [];
45810
- const items = React147__default.useMemo(() => {
46064
+ const items = React93__default.useMemo(() => {
45811
46065
  if (propItems) return propItems;
45812
46066
  if (entityData.length === 0) return [];
45813
46067
  return entityData.map((record, idx) => {
@@ -45914,7 +46168,7 @@ var init_Timeline = __esm({
45914
46168
  }
45915
46169
  });
45916
46170
  function extractToastProps(children) {
45917
- if (!React147__default.isValidElement(children)) {
46171
+ if (!React93__default.isValidElement(children)) {
45918
46172
  if (typeof children === "string") {
45919
46173
  return { message: children };
45920
46174
  }
@@ -45952,7 +46206,7 @@ var init_ToastSlot = __esm({
45952
46206
  eventBus.emit("UI:CLOSE");
45953
46207
  };
45954
46208
  if (!isVisible) return null;
45955
- const isCustomContent = React147__default.isValidElement(children) && !message;
46209
+ const isCustomContent = React93__default.isValidElement(children) && !message;
45956
46210
  return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
45957
46211
  Toast,
45958
46212
  {
@@ -46221,7 +46475,7 @@ var init_WizardContainer = __esm({
46221
46475
  const isCompleted = index < currentStep;
46222
46476
  const stepKey = step.id ?? step.tabId ?? `step-${index}`;
46223
46477
  const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
46224
- return /* @__PURE__ */ jsxs(React147__default.Fragment, { children: [
46478
+ return /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
46225
46479
  /* @__PURE__ */ jsx(
46226
46480
  Button,
46227
46481
  {
@@ -48414,7 +48668,7 @@ function UnitRenderer({
48414
48668
  onAnimationStateChange,
48415
48669
  animationSpeed = 1
48416
48670
  }) {
48417
- const handleUnitClick = React147__default.useCallback(
48671
+ const handleUnitClick = React93__default.useCallback(
48418
48672
  (unit) => {
48419
48673
  onUnitClick?.(unit);
48420
48674
  },
@@ -51610,7 +51864,7 @@ var init_Avl3DViewer = __esm({
51610
51864
  const handleTraitClick = useCallback((name) => {
51611
51865
  dispatch({ type: "ZOOM_INTO_TRAIT", trait: name, targetPosition: { x: 0, y: 0 } });
51612
51866
  }, []);
51613
- const [highlightedTrait, setHighlightedTrait] = React147__default.useState(null);
51867
+ const [highlightedTrait, setHighlightedTrait] = React93__default.useState(null);
51614
51868
  const handleTransitionClick = useCallback((index) => {
51615
51869
  dispatch({ type: "ZOOM_INTO_TRANSITION", transitionIndex: index, targetPosition: { x: 0, y: 0 } });
51616
51870
  }, []);
@@ -51697,7 +51951,7 @@ var init_Avl3DViewer = __esm({
51697
51951
  gap: "xs",
51698
51952
  align: "center",
51699
51953
  className: "absolute top-2 left-2 z-10 bg-surface/80 backdrop-blur rounded-md px-3 py-1.5",
51700
- children: breadcrumbs.map((crumb, i) => /* @__PURE__ */ jsxs(React147__default.Fragment, { children: [
51954
+ children: breadcrumbs.map((crumb, i) => /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
51701
51955
  i > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", className: "mx-1", children: "/" }),
51702
51956
  i < breadcrumbs.length - 1 ? /* @__PURE__ */ jsx(
51703
51957
  Box,
@@ -52075,12 +52329,12 @@ var init_three = __esm({
52075
52329
  }
52076
52330
  });
52077
52331
  function lazyThree(name, loader) {
52078
- const Lazy = React147__default.lazy(() => loader().then((m) => ({ default: m[name] })));
52332
+ const Lazy = React93__default.lazy(() => loader().then((m) => ({ default: m[name] })));
52079
52333
  function ThreeWrapper(props) {
52080
- return React147__default.createElement(
52081
- React147__default.Suspense,
52334
+ return React93__default.createElement(
52335
+ React93__default.Suspense,
52082
52336
  { fallback: null },
52083
- React147__default.createElement(Lazy, props)
52337
+ React93__default.createElement(Lazy, props)
52084
52338
  );
52085
52339
  }
52086
52340
  ThreeWrapper.displayName = `Lazy(${name})`;
@@ -52684,7 +52938,7 @@ function SuspenseConfigProvider({
52684
52938
  config,
52685
52939
  children
52686
52940
  }) {
52687
- return React147__default.createElement(
52941
+ return React93__default.createElement(
52688
52942
  SuspenseConfigContext.Provider,
52689
52943
  { value: config },
52690
52944
  children
@@ -53167,7 +53421,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
53167
53421
  const key = `${parentId}-${index}-trait:${traitName}`;
53168
53422
  return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
53169
53423
  }
53170
- return /* @__PURE__ */ jsx(React147__default.Fragment, { children: child }, `${parentId}-${index}`);
53424
+ return /* @__PURE__ */ jsx(React93__default.Fragment, { children: child }, `${parentId}-${index}`);
53171
53425
  }
53172
53426
  if (!child || typeof child !== "object") return null;
53173
53427
  const childId = `${parentId}-${index}`;
@@ -53204,14 +53458,14 @@ function isPatternConfig(value) {
53204
53458
  if (value === null || value === void 0) return false;
53205
53459
  if (typeof value !== "object") return false;
53206
53460
  if (Array.isArray(value)) return false;
53207
- if (React147__default.isValidElement(value)) return false;
53461
+ if (React93__default.isValidElement(value)) return false;
53208
53462
  if (value instanceof Date) return false;
53209
53463
  if (typeof value === "function") return false;
53210
53464
  const record = value;
53211
53465
  return "type" in record && typeof record.type === "string";
53212
53466
  }
53213
53467
  function isPlainConfigObject(value) {
53214
- if (React147__default.isValidElement(value)) return false;
53468
+ if (React93__default.isValidElement(value)) return false;
53215
53469
  if (value instanceof Date) return false;
53216
53470
  const proto = Object.getPrototypeOf(value);
53217
53471
  return proto === Object.prototype || proto === null;
@@ -53666,7 +53920,7 @@ var AvlTransition = ({
53666
53920
  opacity = 1,
53667
53921
  className
53668
53922
  }) => {
53669
- const ids = React147__default.useMemo(() => {
53923
+ const ids = React93__default.useMemo(() => {
53670
53924
  avlTransitionId += 1;
53671
53925
  return { arrow: `avl-tr-${avlTransitionId}-arrow` };
53672
53926
  }, []);
@@ -54227,7 +54481,7 @@ var AvlStateMachine = ({
54227
54481
  color = "var(--color-primary)",
54228
54482
  animated = false
54229
54483
  }) => {
54230
- const ids = React147__default.useMemo(() => {
54484
+ const ids = React93__default.useMemo(() => {
54231
54485
  avlSmId += 1;
54232
54486
  const base = `avl-sm-${avlSmId}`;
54233
54487
  return { glow: `${base}-glow`, grad: `${base}-grad` };
@@ -54426,7 +54680,7 @@ var AvlOrbitalUnit = ({
54426
54680
  color = "var(--color-primary)",
54427
54681
  animated = false
54428
54682
  }) => {
54429
- const ids = React147__default.useMemo(() => {
54683
+ const ids = React93__default.useMemo(() => {
54430
54684
  avlOuId += 1;
54431
54685
  const base = `avl-ou-${avlOuId}`;
54432
54686
  return { glow: `${base}-glow`, grad: `${base}-grad` };
@@ -54522,7 +54776,7 @@ var AvlClosedCircuit = ({
54522
54776
  color = "var(--color-primary)",
54523
54777
  animated = false
54524
54778
  }) => {
54525
- const ids = React147__default.useMemo(() => {
54779
+ const ids = React93__default.useMemo(() => {
54526
54780
  avlCcId += 1;
54527
54781
  const base = `avl-cc-${avlCcId}`;
54528
54782
  return { glow: `${base}-glow`, grad: `${base}-grad`, arrow: `${base}-arrow` };
@@ -54677,7 +54931,7 @@ var AvlEmitListen = ({
54677
54931
  color = "var(--color-primary)",
54678
54932
  animated = false
54679
54933
  }) => {
54680
- const ids = React147__default.useMemo(() => {
54934
+ const ids = React93__default.useMemo(() => {
54681
54935
  avlElId += 1;
54682
54936
  const base = `avl-el-${avlElId}`;
54683
54937
  return { arrow: `${base}-arrow`, grad: `${base}-grad` };
@@ -54950,7 +55204,7 @@ function renderNode(node, color, glowId) {
54950
55204
  const baseR = node.type === "operator" ? 20 : 16;
54951
55205
  const r2 = Math.max(baseR, labelLen * 3.5 + 6);
54952
55206
  const nc = nodeColor(node.type, color);
54953
- return /* @__PURE__ */ jsxs(React147__default.Fragment, { children: [
55207
+ return /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
54954
55208
  node.children.map((child, i) => {
54955
55209
  const childR = Math.max(
54956
55210
  child.type === "operator" ? 20 : 16,
@@ -55007,7 +55261,7 @@ var AvlExprTree = ({
55007
55261
  className,
55008
55262
  color = "var(--color-primary)"
55009
55263
  }) => {
55010
- const ids = React147__default.useMemo(() => {
55264
+ const ids = React93__default.useMemo(() => {
55011
55265
  avlEtId += 1;
55012
55266
  return { glow: `avl-et-${avlEtId}-glow` };
55013
55267
  }, []);
@@ -55570,7 +55824,7 @@ var SystemNode = ({ data }) => {
55570
55824
  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) => {
55571
55825
  const tc = transitionCounts[s.name] ?? 0;
55572
55826
  const role = getStateRole(s.name, s.isInitial, s.isTerminal, tc, maxTC);
55573
- return /* @__PURE__ */ jsxs(React147__default.Fragment, { children: [
55827
+ return /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
55574
55828
  /* @__PURE__ */ jsx(AvlState, { x: i * 14 + 1, y: 1, width: 10, height: 8, name: "", role, isInitial: s.isInitial, isTerminal: s.isTerminal }),
55575
55829
  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 })
55576
55830
  ] }, s.name);
@@ -56814,7 +57068,7 @@ function resolveLambdaBindings(body, argName, arg) {
56814
57068
  if (Array.isArray(body)) {
56815
57069
  return body.map((b) => resolveLambdaBindings(b, argName, arg));
56816
57070
  }
56817
- if (body !== null && typeof body === "object" && !React147__default.isValidElement(body) && !(body instanceof Date) && typeof body !== "function") {
57071
+ if (body !== null && typeof body === "object" && !React93__default.isValidElement(body) && !(body instanceof Date) && typeof body !== "function") {
56818
57072
  const out = {};
56819
57073
  for (const [k, v] of Object.entries(body)) {
56820
57074
  out[k] = resolveLambdaBindings(v, argName, arg);
@@ -56833,7 +57087,7 @@ function getSlotContentRenderer2() {
56833
57087
  function makeLambdaFn(argName, lambdaBody, callerKey) {
56834
57088
  return (item, index) => {
56835
57089
  const resolvedBody = resolveLambdaBindings(lambdaBody, argName, item);
56836
- if (resolvedBody === null || typeof resolvedBody !== "object" || Array.isArray(resolvedBody) || typeof resolvedBody === "function" || React147__default.isValidElement(resolvedBody) || resolvedBody instanceof Date) {
57090
+ if (resolvedBody === null || typeof resolvedBody !== "object" || Array.isArray(resolvedBody) || typeof resolvedBody === "function" || React93__default.isValidElement(resolvedBody) || resolvedBody instanceof Date) {
56837
57091
  return null;
56838
57092
  }
56839
57093
  const record = resolvedBody;
@@ -56851,7 +57105,7 @@ function makeLambdaFn(argName, lambdaBody, callerKey) {
56851
57105
  props: childProps,
56852
57106
  priority: 0
56853
57107
  };
56854
- return React147__default.createElement(SlotContentRenderer2, { content: childContent });
57108
+ return React93__default.createElement(SlotContentRenderer2, { content: childContent });
56855
57109
  };
56856
57110
  }
56857
57111
  function convertNode(node, callerKey) {
@@ -56870,7 +57124,7 @@ function convertNode(node, callerKey) {
56870
57124
  });
56871
57125
  return anyChanged ? mapped : node;
56872
57126
  }
56873
- if (typeof node === "object" && !React147__default.isValidElement(node) && !(node instanceof Date)) {
57127
+ if (typeof node === "object" && !React93__default.isValidElement(node) && !(node instanceof Date)) {
56874
57128
  return convertObjectProps(node);
56875
57129
  }
56876
57130
  return node;
@@ -58968,7 +59222,7 @@ var OrbPreviewNodeInner = (props) => {
58968
59222
  }
58969
59223
  );
58970
59224
  };
58971
- var OrbPreviewNode = React147__default.memo(OrbPreviewNodeInner);
59225
+ var OrbPreviewNode = React93__default.memo(OrbPreviewNodeInner);
58972
59226
  OrbPreviewNode.displayName = "OrbPreviewNode";
58973
59227
  orbPreviewLog.debug("export-resolved", () => ({
58974
59228
  type: typeof OrbPreviewNode,
@@ -59073,7 +59327,7 @@ var EventFlowEdgeInner = (props) => {
59073
59327
  ) })
59074
59328
  ] });
59075
59329
  };
59076
- var EventFlowEdge = React147__default.memo(EventFlowEdgeInner);
59330
+ var EventFlowEdge = React93__default.memo(EventFlowEdgeInner);
59077
59331
  EventFlowEdge.displayName = "EventFlowEdge";
59078
59332
 
59079
59333
  // components/molecules/avl/BehaviorComposeNode.tsx
@@ -59220,7 +59474,7 @@ var BehaviorComposeNodeInner = (props) => {
59220
59474
  }
59221
59475
  );
59222
59476
  };
59223
- var BehaviorComposeNode = React147__default.memo(BehaviorComposeNodeInner);
59477
+ var BehaviorComposeNode = React93__default.memo(BehaviorComposeNodeInner);
59224
59478
  BehaviorComposeNode.displayName = "BehaviorComposeNode";
59225
59479
 
59226
59480
  // components/molecules/avl/avl-behavior-compose-converter.ts
@@ -60183,7 +60437,7 @@ var ZoomBreadcrumb = ({
60183
60437
  if (eventName && band === "detail") {
60184
60438
  segments.push({ icon: "\u26A1", label: eventName });
60185
60439
  }
60186
- 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(React147__default.Fragment, { children: [
60440
+ 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(React93__default.Fragment, { children: [
60187
60441
  i > 0 && /* @__PURE__ */ jsx("span", { className: "opacity-40", children: ">" }),
60188
60442
  /* @__PURE__ */ jsx("span", { className: "opacity-60", children: seg.icon }),
60189
60443
  /* @__PURE__ */ jsx("span", { children: seg.label })
@@ -60662,7 +60916,7 @@ var EventWireOverlay = ({
60662
60916
  containerW,
60663
60917
  containerH
60664
60918
  }) => {
60665
- const ids = React147__default.useMemo(() => {
60919
+ const ids = React93__default.useMemo(() => {
60666
60920
  avlOczWireId += 1;
60667
60921
  return { arrow: `avl-ocz-wire-${avlOczWireId}-arrow` };
60668
60922
  }, []);
@@ -61021,7 +61275,7 @@ var AvlOrbitalsCosmicZoom = ({
61021
61275
  borderRadius: 6,
61022
61276
  border: `1px solid ${color}`
61023
61277
  },
61024
- children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", children: breadcrumbs.map((crumb, i) => /* @__PURE__ */ jsxs(React147__default.Fragment, { children: [
61278
+ children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", children: breadcrumbs.map((crumb, i) => /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
61025
61279
  i > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", style: { opacity: 0.5, color }, children: "/" }),
61026
61280
  i < breadcrumbs.length - 1 ? /* @__PURE__ */ jsx(
61027
61281
  Box,