@almadar/ui 4.48.0 → 4.50.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/avl/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { 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,192 @@ 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
+ items,
24872
+ layout
24873
+ } = args;
24874
+ const enabled = Boolean(dragGroup || accepts || sortable);
24875
+ const eventBus = useEventBus();
24876
+ const parentRoot = React93__default.useContext(RootCtx);
24877
+ const isRoot = enabled && parentRoot === null;
24878
+ const [localOrder, setLocalOrder] = React93__default.useState(null);
24879
+ const orderedItems = localOrder ?? items;
24880
+ React93__default.useEffect(() => {
24881
+ setLocalOrder(null);
24882
+ }, [items]);
24883
+ const itemIds = React93__default.useMemo(
24884
+ () => orderedItems.map((it, idx) => {
24885
+ const raw = it[dndItemIdField];
24886
+ return raw ?? `__idx_${idx}`;
24887
+ }),
24888
+ [orderedItems, dndItemIdField]
24889
+ );
24890
+ const zonesRef = React93__default.useRef(/* @__PURE__ */ new Map());
24891
+ const registerZone = React93__default.useCallback((zoneId2, meta2) => {
24892
+ zonesRef.current.set(zoneId2, meta2);
24893
+ }, []);
24894
+ const unregisterZone = React93__default.useCallback((zoneId2) => {
24895
+ zonesRef.current.delete(zoneId2);
24896
+ }, []);
24897
+ const zoneId = React93__default.useId();
24898
+ const ownGroup = dragGroup ?? accepts ?? zoneId;
24899
+ const meta = React93__default.useMemo(
24900
+ () => ({ group: ownGroup, dropEvent, reorderEvent, itemIds }),
24901
+ [ownGroup, dropEvent, reorderEvent, itemIds]
24902
+ );
24903
+ React93__default.useEffect(() => {
24904
+ const target = isRoot ? null : parentRoot;
24905
+ if (!target) {
24906
+ zonesRef.current.set(zoneId, meta);
24907
+ return () => zonesRef.current.delete(zoneId);
24908
+ }
24909
+ target.registerZone(zoneId, meta);
24910
+ return () => target.unregisterZone(zoneId);
24911
+ }, [parentRoot, isRoot, zoneId, meta]);
24912
+ const sensors = useSensors(
24913
+ useSensor(PointerSensor, { activationConstraint: { distance: 5 } }),
24914
+ useSensor(KeyboardSensor, { coordinateGetter: sortableKeyboardCoordinates })
24915
+ );
24916
+ const findZoneByItem = React93__default.useCallback(
24917
+ (id) => {
24918
+ for (const z of zonesRef.current.values()) {
24919
+ if (z.itemIds.includes(id)) return z;
24920
+ }
24921
+ return void 0;
24922
+ },
24923
+ []
24924
+ );
24925
+ const findZoneByGroup = React93__default.useCallback(
24926
+ (group) => {
24927
+ for (const z of zonesRef.current.values()) {
24928
+ if (z.group === group) return z;
24929
+ }
24930
+ return void 0;
24931
+ },
24932
+ []
24933
+ );
24934
+ const handleDragEnd = React93__default.useCallback(
24935
+ (event) => {
24936
+ const { active, over } = event;
24937
+ if (!over) return;
24938
+ const sourceZone = findZoneByItem(active.id);
24939
+ const overData = over.data?.current;
24940
+ const targetGroup = overData?.dndGroup;
24941
+ if (!sourceZone || !targetGroup) return;
24942
+ const targetZone = findZoneByGroup(targetGroup);
24943
+ if (!targetZone) return;
24944
+ if (sourceZone.group !== targetZone.group) {
24945
+ if (targetZone.dropEvent) {
24946
+ const newIndex2 = targetZone.itemIds.indexOf(over.id);
24947
+ eventBus.emit(targetZone.dropEvent, {
24948
+ id: String(active.id),
24949
+ sourceGroup: sourceZone.group,
24950
+ targetGroup: targetZone.group,
24951
+ newIndex: newIndex2 === -1 ? targetZone.itemIds.length : newIndex2
24952
+ });
24953
+ }
24954
+ return;
24955
+ }
24956
+ const oldIndex = sourceZone.itemIds.indexOf(active.id);
24957
+ const newIndex = sourceZone.itemIds.indexOf(over.id);
24958
+ if (oldIndex === -1 || newIndex === -1 || oldIndex === newIndex) return;
24959
+ if (sourceZone.group === ownGroup) {
24960
+ const reordered = arrayMove(orderedItems, oldIndex, newIndex);
24961
+ setLocalOrder(reordered);
24962
+ }
24963
+ if (sourceZone.reorderEvent) {
24964
+ eventBus.emit(sourceZone.reorderEvent, {
24965
+ id: String(active.id),
24966
+ oldIndex,
24967
+ newIndex
24968
+ });
24969
+ }
24970
+ },
24971
+ [orderedItems, ownGroup, findZoneByItem, findZoneByGroup, eventBus]
24972
+ );
24973
+ const SortableItem = React93__default.useCallback(
24974
+ ({ id, children }) => {
24975
+ const {
24976
+ attributes,
24977
+ listeners: listeners6,
24978
+ setNodeRef,
24979
+ transform,
24980
+ transition,
24981
+ isDragging
24982
+ } = useSortable({ id, data: { dndGroup: ownGroup } });
24983
+ const style = {
24984
+ transform: CSS.Transform.toString(transform),
24985
+ transition,
24986
+ opacity: isDragging ? 0.4 : 1,
24987
+ cursor: enabled ? "grab" : void 0
24988
+ };
24989
+ return /* @__PURE__ */ jsx(
24990
+ Box,
24991
+ {
24992
+ className: "touch-none",
24993
+ ref: setNodeRef,
24994
+ style,
24995
+ ...attributes,
24996
+ ...listeners6,
24997
+ children
24998
+ }
24999
+ );
25000
+ },
25001
+ [ownGroup, enabled]
25002
+ );
25003
+ const DropZoneShell = ({ children }) => {
25004
+ const { setNodeRef, isOver } = useDroppable({
25005
+ id: `dnd-zone-${zoneId}`,
25006
+ data: { dndGroup: ownGroup }
25007
+ });
25008
+ return /* @__PURE__ */ jsx(
25009
+ Box,
25010
+ {
25011
+ ref: setNodeRef,
25012
+ className: isOver ? "ring-2 ring-primary ring-offset-2 rounded-lg" : void 0,
25013
+ children
25014
+ }
25015
+ );
25016
+ };
25017
+ const rootContextValue = React93__default.useMemo(
25018
+ () => ({ registerZone, unregisterZone }),
25019
+ [registerZone, unregisterZone]
25020
+ );
25021
+ const wrapContainer = React93__default.useCallback(
25022
+ (children) => {
25023
+ if (!enabled) return children;
25024
+ const strategy = layout === "grid" ? rectSortingStrategy : verticalListSortingStrategy;
25025
+ const inner = /* @__PURE__ */ jsx(DropZoneShell, { children: /* @__PURE__ */ jsx(SortableContext, { items: itemIds, strategy, children }) });
25026
+ if (isRoot) {
25027
+ return /* @__PURE__ */ jsx(RootCtx.Provider, { value: rootContextValue, children: /* @__PURE__ */ jsx(DndContext, { sensors, collisionDetection: closestCenter, onDragEnd: handleDragEnd, children: inner }) });
25028
+ }
25029
+ return inner;
25030
+ },
25031
+ [enabled, layout, sensors, handleDragEnd, itemIds, isRoot, rootContextValue]
25032
+ );
25033
+ return {
25034
+ enabled,
25035
+ wrapContainer,
25036
+ SortableItem,
25037
+ orderedItems
25038
+ };
25039
+ }
25040
+ var RootCtx;
25041
+ var init_useDataDnd = __esm({
25042
+ "components/molecules/useDataDnd.tsx"() {
25043
+ "use client";
25044
+ init_useEventBus();
25045
+ init_Box();
25046
+ RootCtx = React93__default.createContext(null);
25047
+ }
25048
+ });
24860
25049
  function fieldLabel2(key) {
24861
25050
  return key.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/[_-]/g, " ").replace(/\b\w/g, (c) => c.toUpperCase());
24862
25051
  }
@@ -24920,14 +25109,31 @@ function DataGrid({
24920
25109
  hasMore,
24921
25110
  children,
24922
25111
  pageSize = 0,
24923
- renderItem: schemaRenderItem
25112
+ renderItem: schemaRenderItem,
25113
+ dragGroup,
25114
+ accepts,
25115
+ sortable,
25116
+ dropEvent,
25117
+ reorderEvent,
25118
+ dndItemIdField
24924
25119
  }) {
24925
25120
  const eventBus = useEventBus();
24926
25121
  const { t } = useTranslate();
24927
25122
  const [selectedIds, setSelectedIds] = useState(/* @__PURE__ */ new Set());
24928
25123
  const [visibleCount, setVisibleCount] = useState(pageSize || Infinity);
24929
25124
  const fieldDefs = fields ?? columns ?? [];
24930
- const allData = Array.isArray(entity) ? entity : entity ? [entity] : [];
25125
+ const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
25126
+ const dnd = useDataDnd({
25127
+ items: allDataRaw,
25128
+ layout: "grid",
25129
+ dragGroup,
25130
+ accepts,
25131
+ sortable,
25132
+ dropEvent,
25133
+ reorderEvent,
25134
+ dndItemIdField
25135
+ });
25136
+ const allData = dnd.orderedItems;
24931
25137
  const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
24932
25138
  const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
24933
25139
  const toggleSelection = useCallback((id) => {
@@ -24999,203 +25205,205 @@ function DataGrid({
24999
25205
  const allIds = data.map((item, i) => item.id || String(i));
25000
25206
  const allSelected = allIds.length > 0 && allIds.every((id) => selectedIds.has(id));
25001
25207
  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: [
25208
+ const idFieldName = dndItemIdField ?? "id";
25209
+ return dnd.wrapContainer(
25210
+ /* @__PURE__ */ jsxs(VStack, { gap: "sm", children: [
25211
+ selectable && someSelected && /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: "items-center px-2 py-2 bg-muted rounded-sm", children: [
25212
+ /* @__PURE__ */ jsx(
25213
+ "input",
25214
+ {
25215
+ type: "checkbox",
25216
+ checked: allSelected,
25217
+ onChange: toggleAll,
25218
+ className: "w-4 h-4 accent-primary",
25219
+ "aria-label": "Select all"
25220
+ }
25221
+ ),
25222
+ /* @__PURE__ */ jsxs(Typography, { variant: "caption", className: "font-semibold", children: [
25223
+ selectedIds.size,
25224
+ " ",
25225
+ t("common.selected") || "selected"
25226
+ ] })
25227
+ ] }),
25004
25228
  /* @__PURE__ */ jsx(
25005
- "input",
25229
+ Box,
25006
25230
  {
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(
25036
- "bg-card rounded-lg",
25037
- "border border-border",
25038
- "shadow-sm hover:shadow-lg",
25039
- "hover:border-primary transition-all",
25040
- "p-4",
25041
- isSelected && "ring-2 ring-primary border-primary"
25042
- ),
25043
- children: children(itemData, index)
25044
- },
25045
- id
25046
- );
25047
- }
25048
- const titleValue = getNestedValue(itemData, titleField?.name ?? "");
25049
- return /* @__PURE__ */ jsxs(
25050
- Box,
25051
- {
25052
- "data-entity-row": true,
25053
- "data-entity-id": id,
25054
- className: cn(
25055
- "bg-card rounded-lg",
25056
- "border border-border",
25057
- "shadow-sm hover:shadow-lg",
25058
- "hover:border-primary transition-all",
25059
- "flex flex-col",
25060
- isSelected && "ring-2 ring-primary border-primary"
25061
- ),
25062
- children: [
25063
- imageField && (() => {
25064
- const imgUrl = getNestedValue(itemData, imageField);
25065
- if (!imgUrl || typeof imgUrl !== "string") return null;
25066
- return /* @__PURE__ */ jsx(Box, { className: "w-full aspect-video overflow-hidden rounded-t-lg", children: /* @__PURE__ */ jsx(
25067
- "img",
25068
- {
25069
- src: imgUrl,
25070
- alt: titleValue !== void 0 ? String(titleValue) : "",
25071
- className: "w-full h-full object-cover",
25072
- loading: "lazy"
25073
- }
25074
- ) });
25075
- })(),
25076
- /* @__PURE__ */ jsx(Box, { className: "p-4 pb-0", children: /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: "justify-between items-start", children: [
25077
- selectable && /* @__PURE__ */ jsx(
25078
- "input",
25079
- {
25080
- type: "checkbox",
25081
- checked: isSelected,
25082
- onChange: () => toggleSelection(id),
25083
- onClick: (e) => e.stopPropagation(),
25084
- className: "w-4 h-4 mt-1 flex-shrink-0 accent-primary",
25085
- "aria-label": `Select ${titleValue !== void 0 ? String(titleValue) : "item"}`
25086
- }
25231
+ className: cn("grid", gapStyles6[gap], colsClass, className),
25232
+ style: gridTemplateColumns ? { gridTemplateColumns } : void 0,
25233
+ children: data.map((item, index) => {
25234
+ const itemData = item;
25235
+ const id = itemData.id || String(index);
25236
+ const isSelected = selectedIds.has(id);
25237
+ const dndId = itemData[idFieldName] ?? `__idx_${index}`;
25238
+ const wrapDnd = (node) => dnd.enabled ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: dndId, children: node }) : node;
25239
+ if (hasRenderProp) {
25240
+ return wrapDnd(
25241
+ /* @__PURE__ */ jsx(
25242
+ Box,
25243
+ {
25244
+ "data-entity-row": true,
25245
+ "data-entity-id": id,
25246
+ className: cn(isSelected && "ring-2 ring-primary rounded-lg"),
25247
+ children: children(itemData, index)
25248
+ },
25249
+ id
25250
+ )
25251
+ );
25252
+ }
25253
+ const titleValue = getNestedValue(itemData, titleField?.name ?? "");
25254
+ return wrapDnd(
25255
+ /* @__PURE__ */ jsxs(
25256
+ Box,
25257
+ {
25258
+ "data-entity-row": true,
25259
+ "data-entity-id": id,
25260
+ className: cn(
25261
+ "bg-card rounded-lg",
25262
+ "border border-border",
25263
+ "shadow-sm hover:shadow-lg",
25264
+ "hover:border-primary transition-all",
25265
+ "flex flex-col",
25266
+ isSelected && "ring-2 ring-primary border-primary"
25087
25267
  ),
25088
- /* @__PURE__ */ jsxs(VStack, { gap: "xs", className: "flex-1 min-w-0", children: [
25089
- titleValue !== void 0 && titleValue !== null && /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
25090
- titleField?.icon && /* @__PURE__ */ jsx(Icon, { name: titleField.icon, size: "sm", className: "text-primary flex-shrink-0" }),
25091
- /* @__PURE__ */ jsx(
25092
- Typography,
25268
+ children: [
25269
+ imageField && (() => {
25270
+ const imgUrl = getNestedValue(itemData, imageField);
25271
+ if (!imgUrl || typeof imgUrl !== "string") return null;
25272
+ return /* @__PURE__ */ jsx(Box, { className: "w-full aspect-video overflow-hidden rounded-t-lg", children: /* @__PURE__ */ jsx(
25273
+ "img",
25093
25274
  {
25094
- variant: titleField?.variant === "h3" ? "h3" : "h4",
25095
- className: "font-semibold truncate",
25096
- children: String(titleValue)
25275
+ src: imgUrl,
25276
+ alt: titleValue !== void 0 ? String(titleValue) : "",
25277
+ className: "w-full h-full object-cover",
25278
+ loading: "lazy"
25097
25279
  }
25098
- )
25099
- ] }),
25100
- badgeFields.length > 0 && /* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-wrap", children: badgeFields.map((field) => {
25101
- const val = getNestedValue(itemData, field.name);
25102
- if (val === void 0 || val === null) return null;
25103
- return /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
25104
- field.icon && /* @__PURE__ */ jsx(Icon, { name: field.icon, size: "xs" }),
25105
- /* @__PURE__ */ jsx(Badge, { variant: resolveBadgeVariant(field, String(val)), children: String(val) })
25106
- ] }, field.name);
25107
- }) })
25108
- ] }),
25109
- dangerActions.length > 0 && /* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-shrink-0", children: dangerActions.map((action, idx) => /* @__PURE__ */ jsxs(
25110
- Button,
25111
- {
25112
- variant: "ghost",
25113
- size: "sm",
25114
- onClick: handleActionClick(action, itemData),
25115
- "data-testid": `action-${action.event}`,
25116
- "data-row-id": String(itemData.id),
25117
- className: "text-error hover:text-error hover:bg-error/10 px-2",
25118
- children: [
25119
- action.icon && /* @__PURE__ */ jsx(Icon, { name: action.icon, size: "xs" }),
25120
- action.label
25121
- ]
25122
- },
25123
- idx
25124
- )) })
25125
- ] }) }),
25126
- bodyFields.length > 0 && /* @__PURE__ */ jsx(Box, { className: "px-4 py-3 flex-1", children: /* @__PURE__ */ jsx(VStack, { gap: "xs", children: bodyFields.map((field) => {
25127
- const value = getNestedValue(itemData, field.name);
25128
- if (value === void 0 || value === null || value === "") return null;
25129
- if (field.format === "boolean") {
25130
- return /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: "justify-between items-center", children: [
25131
- /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
25132
- field.icon && /* @__PURE__ */ jsx(Icon, { name: field.icon, size: "xs", className: "text-muted-foreground" }),
25133
- /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", children: field.label ?? fieldLabel2(field.name) })
25280
+ ) });
25281
+ })(),
25282
+ /* @__PURE__ */ jsx(Box, { className: "p-4 pb-0", children: /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: "justify-between items-start", children: [
25283
+ selectable && /* @__PURE__ */ jsx(
25284
+ "input",
25285
+ {
25286
+ type: "checkbox",
25287
+ checked: isSelected,
25288
+ onChange: () => toggleSelection(id),
25289
+ onClick: (e) => e.stopPropagation(),
25290
+ className: "w-4 h-4 mt-1 flex-shrink-0 accent-primary",
25291
+ "aria-label": `Select ${titleValue !== void 0 ? String(titleValue) : "item"}`
25292
+ }
25293
+ ),
25294
+ /* @__PURE__ */ jsxs(VStack, { gap: "xs", className: "flex-1 min-w-0", children: [
25295
+ titleValue !== void 0 && titleValue !== null && /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
25296
+ titleField?.icon && /* @__PURE__ */ jsx(Icon, { name: titleField.icon, size: "sm", className: "text-primary flex-shrink-0" }),
25297
+ /* @__PURE__ */ jsx(
25298
+ Typography,
25299
+ {
25300
+ variant: titleField?.variant === "h3" ? "h3" : "h4",
25301
+ className: "font-semibold truncate",
25302
+ children: String(titleValue)
25303
+ }
25304
+ )
25305
+ ] }),
25306
+ badgeFields.length > 0 && /* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-wrap", children: badgeFields.map((field) => {
25307
+ const val = getNestedValue(itemData, field.name);
25308
+ if (val === void 0 || val === null) return null;
25309
+ return /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
25310
+ field.icon && /* @__PURE__ */ jsx(Icon, { name: field.icon, size: "xs" }),
25311
+ /* @__PURE__ */ jsx(Badge, { variant: resolveBadgeVariant(field, String(val)), children: String(val) })
25312
+ ] }, field.name);
25313
+ }) })
25134
25314
  ] }),
25135
- /* @__PURE__ */ jsx(Badge, { variant: value ? "success" : "neutral", children: value ? t("common.yes") || "Yes" : t("common.no") || "No" })
25136
- ] }, field.name);
25137
- }
25138
- return /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: "justify-between items-center", children: [
25139
- /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
25140
- field.icon && /* @__PURE__ */ jsx(Icon, { name: field.icon, size: "xs", className: "text-muted-foreground" }),
25141
- /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", children: field.label ?? fieldLabel2(field.name) })
25142
- ] }),
25143
- /* @__PURE__ */ jsx(
25144
- Typography,
25145
- {
25146
- variant: field.variant === "caption" ? "caption" : "small",
25147
- className: "text-right truncate max-w-[60%]",
25148
- children: formatValue(value, field.format)
25315
+ dangerActions.length > 0 && /* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-shrink-0", children: dangerActions.map((action, idx) => /* @__PURE__ */ jsxs(
25316
+ Button,
25317
+ {
25318
+ variant: "ghost",
25319
+ size: "sm",
25320
+ onClick: handleActionClick(action, itemData),
25321
+ "data-testid": `action-${action.event}`,
25322
+ "data-row-id": String(itemData.id),
25323
+ className: "text-error hover:text-error hover:bg-error/10 px-2",
25324
+ children: [
25325
+ action.icon && /* @__PURE__ */ jsx(Icon, { name: action.icon, size: "xs" }),
25326
+ action.label
25327
+ ]
25328
+ },
25329
+ idx
25330
+ )) })
25331
+ ] }) }),
25332
+ bodyFields.length > 0 && /* @__PURE__ */ jsx(Box, { className: "px-4 py-3 flex-1", children: /* @__PURE__ */ jsx(VStack, { gap: "xs", children: bodyFields.map((field) => {
25333
+ const value = getNestedValue(itemData, field.name);
25334
+ if (value === void 0 || value === null || value === "") return null;
25335
+ if (field.format === "boolean") {
25336
+ return /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: "justify-between items-center", children: [
25337
+ /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
25338
+ field.icon && /* @__PURE__ */ jsx(Icon, { name: field.icon, size: "xs", className: "text-muted-foreground" }),
25339
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", children: field.label ?? fieldLabel2(field.name) })
25340
+ ] }),
25341
+ /* @__PURE__ */ jsx(Badge, { variant: value ? "success" : "neutral", children: value ? t("common.yes") || "Yes" : t("common.no") || "No" })
25342
+ ] }, field.name);
25149
25343
  }
25150
- )
25151
- ] }, field.name);
25152
- }) }) }),
25153
- 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(
25154
- Button,
25155
- {
25156
- variant: action.variant === "primary" ? "primary" : "ghost",
25157
- size: "sm",
25158
- onClick: handleActionClick(action, itemData),
25159
- "data-testid": `action-${action.event}`,
25160
- "data-row-id": String(itemData.id),
25161
- children: [
25162
- action.icon && /* @__PURE__ */ jsx(Icon, { name: action.icon, size: "xs", className: "mr-1" }),
25163
- action.label
25164
- ]
25165
- },
25166
- idx
25167
- )) }) })
25168
- ]
25169
- },
25170
- id
25171
- );
25172
- })
25173
- }
25174
- ),
25175
- hasMoreLocal && /* @__PURE__ */ jsx(Box, { className: "flex justify-center py-3", children: /* @__PURE__ */ jsxs(
25176
- Button,
25177
- {
25178
- variant: "ghost",
25179
- size: "sm",
25180
- onClick: () => setVisibleCount((prev) => prev + (pageSize || 5)),
25181
- children: [
25182
- /* @__PURE__ */ jsx(Icon, { name: "chevron-down", size: "xs", className: "mr-1" }),
25183
- t("common.showMore"),
25184
- " (",
25185
- allData.length - visibleCount,
25186
- " remaining)"
25187
- ]
25188
- }
25189
- ) }),
25190
- infiniteScroll && loadMoreEvent && /* @__PURE__ */ jsx(
25191
- InfiniteScrollSentinel,
25192
- {
25193
- loadMoreEvent,
25194
- isLoading,
25195
- hasMore
25196
- }
25197
- )
25198
- ] });
25344
+ return /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: "justify-between items-center", children: [
25345
+ /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
25346
+ field.icon && /* @__PURE__ */ jsx(Icon, { name: field.icon, size: "xs", className: "text-muted-foreground" }),
25347
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", children: field.label ?? fieldLabel2(field.name) })
25348
+ ] }),
25349
+ /* @__PURE__ */ jsx(
25350
+ Typography,
25351
+ {
25352
+ variant: field.variant === "caption" ? "caption" : "small",
25353
+ className: "text-right truncate max-w-[60%]",
25354
+ children: formatValue(value, field.format)
25355
+ }
25356
+ )
25357
+ ] }, field.name);
25358
+ }) }) }),
25359
+ 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(
25360
+ Button,
25361
+ {
25362
+ variant: action.variant === "primary" ? "primary" : "ghost",
25363
+ size: "sm",
25364
+ onClick: handleActionClick(action, itemData),
25365
+ "data-testid": `action-${action.event}`,
25366
+ "data-row-id": String(itemData.id),
25367
+ children: [
25368
+ action.icon && /* @__PURE__ */ jsx(Icon, { name: action.icon, size: "xs", className: "mr-1" }),
25369
+ action.label
25370
+ ]
25371
+ },
25372
+ idx
25373
+ )) }) })
25374
+ ]
25375
+ },
25376
+ id
25377
+ )
25378
+ );
25379
+ })
25380
+ }
25381
+ ),
25382
+ hasMoreLocal && /* @__PURE__ */ jsx(Box, { className: "flex justify-center py-3", children: /* @__PURE__ */ jsxs(
25383
+ Button,
25384
+ {
25385
+ variant: "ghost",
25386
+ size: "sm",
25387
+ onClick: () => setVisibleCount((prev) => prev + (pageSize || 5)),
25388
+ children: [
25389
+ /* @__PURE__ */ jsx(Icon, { name: "chevron-down", size: "xs", className: "mr-1" }),
25390
+ t("common.showMore"),
25391
+ " (",
25392
+ allData.length - visibleCount,
25393
+ " remaining)"
25394
+ ]
25395
+ }
25396
+ ) }),
25397
+ infiniteScroll && loadMoreEvent && /* @__PURE__ */ jsx(
25398
+ InfiniteScrollSentinel,
25399
+ {
25400
+ loadMoreEvent,
25401
+ isLoading,
25402
+ hasMore
25403
+ }
25404
+ )
25405
+ ] })
25406
+ );
25199
25407
  }
25200
25408
  var dataGridLog, BADGE_VARIANTS, gapStyles6;
25201
25409
  var init_DataGrid = __esm({
@@ -25212,6 +25420,7 @@ var init_DataGrid = __esm({
25212
25420
  init_Button();
25213
25421
  init_Icon();
25214
25422
  init_InfiniteScrollSentinel();
25423
+ init_useDataDnd();
25215
25424
  dataGridLog = createLogger("almadar:ui:data-grid");
25216
25425
  BADGE_VARIANTS = /* @__PURE__ */ new Set([
25217
25426
  "default",
@@ -25306,17 +25515,34 @@ function DataList({
25306
25515
  hasMore,
25307
25516
  children,
25308
25517
  pageSize = 5,
25309
- renderItem: schemaRenderItem
25518
+ renderItem: schemaRenderItem,
25519
+ dragGroup,
25520
+ accepts,
25521
+ sortable: sortableProp,
25522
+ dropEvent,
25523
+ reorderEvent: dndReorderEvent,
25524
+ dndItemIdField
25310
25525
  }) {
25311
25526
  const eventBus = useEventBus();
25312
25527
  const { t } = useTranslate();
25313
- const [visibleCount, setVisibleCount] = React147__default.useState(pageSize || Infinity);
25528
+ const [visibleCount, setVisibleCount] = React93__default.useState(pageSize || Infinity);
25314
25529
  const fieldDefs = fields ?? columns ?? [];
25315
- const allData = Array.isArray(entity) ? entity : entity ? [entity] : [];
25530
+ const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
25531
+ const dnd = useDataDnd({
25532
+ items: allDataRaw,
25533
+ layout: "list",
25534
+ dragGroup,
25535
+ accepts,
25536
+ sortable: sortableProp,
25537
+ dropEvent,
25538
+ reorderEvent: dndReorderEvent,
25539
+ dndItemIdField
25540
+ });
25541
+ const allData = dnd.orderedItems;
25316
25542
  const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
25317
25543
  const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
25318
25544
  const hasRenderProp = typeof children === "function";
25319
- React147__default.useEffect(() => {
25545
+ React93__default.useEffect(() => {
25320
25546
  const renderItemTypeOf = typeof schemaRenderItem;
25321
25547
  const childrenTypeOf = typeof children;
25322
25548
  if (data.length > 0 && !hasRenderProp) {
@@ -25372,7 +25598,7 @@ function DataList({
25372
25598
  const items2 = data.map((item) => item);
25373
25599
  const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
25374
25600
  const contentField = titleField?.name ?? fieldDefs[0]?.name ?? "";
25375
- return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React147__default.Fragment, { children: [
25601
+ return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
25376
25602
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
25377
25603
  group.items.map((itemData, index) => {
25378
25604
  const id = itemData.id || `${gi}-${index}`;
@@ -25420,10 +25646,50 @@ function DataList({
25420
25646
  }
25421
25647
  const items = data.map((item) => item);
25422
25648
  const groups = groupBy ? groupData(items, groupBy) : [{ label: "", items }];
25649
+ const idFieldName = dndItemIdField ?? "id";
25423
25650
  const renderItem = (itemData, index, isLast) => {
25651
+ const dndId = itemData[idFieldName] ?? `__idx_${index}`;
25652
+ const wrapDnd = (node) => dnd.enabled ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: dndId, children: node }) : node;
25424
25653
  if (hasRenderProp) {
25425
25654
  const id2 = itemData.id || String(index);
25426
- return /* @__PURE__ */ jsxs(Box, { "data-entity-row": true, "data-entity-id": id2, children: [
25655
+ return wrapDnd(
25656
+ /* @__PURE__ */ jsxs(Box, { "data-entity-row": true, "data-entity-id": id2, children: [
25657
+ /* @__PURE__ */ jsxs(Box, { className: "group flex items-stretch gap-2", children: [
25658
+ /* @__PURE__ */ jsx(Box, { className: "flex-1 min-w-0", children: children(itemData, index) }),
25659
+ itemActions && itemActions.length > 0 && /* @__PURE__ */ jsx(
25660
+ HStack,
25661
+ {
25662
+ gap: "xs",
25663
+ className: "flex-shrink-0",
25664
+ children: itemActions.map((action, idx) => /* @__PURE__ */ jsxs(
25665
+ Button,
25666
+ {
25667
+ variant: action.variant ?? "ghost",
25668
+ size: "sm",
25669
+ onClick: handleActionClick(action, itemData),
25670
+ "data-testid": `action-${action.event}`,
25671
+ "data-row-id": String(itemData.id),
25672
+ className: cn(
25673
+ action.variant === "danger" && "text-error hover:bg-error/10"
25674
+ ),
25675
+ children: [
25676
+ action.icon && /* @__PURE__ */ jsx(Icon, { name: action.icon, size: "xs", className: "mr-1" }),
25677
+ action.label
25678
+ ]
25679
+ },
25680
+ idx
25681
+ ))
25682
+ }
25683
+ )
25684
+ ] }),
25685
+ isCard && !isLast && /* @__PURE__ */ jsx(Box, { className: "mx-6 border-b border-border/40" })
25686
+ ] }, id2)
25687
+ );
25688
+ }
25689
+ const id = itemData.id || String(index);
25690
+ const titleValue = getNestedValue(itemData, titleField?.name ?? "");
25691
+ return wrapDnd(
25692
+ /* @__PURE__ */ jsxs(Box, { "data-entity-row": true, "data-entity-id": id, children: [
25427
25693
  /* @__PURE__ */ jsxs(
25428
25694
  Box,
25429
25695
  {
@@ -25434,166 +25700,124 @@ function DataList({
25434
25700
  !isCard && !isCompact && "rounded-lg border border-transparent hover:border-border"
25435
25701
  ),
25436
25702
  children: [
25437
- /* @__PURE__ */ jsx(Box, { className: "flex-1 min-w-0", children: children(itemData, index) }),
25438
- itemActions && itemActions.length > 0 && /* @__PURE__ */ jsx(
25439
- HStack,
25440
- {
25441
- gap: "xs",
25442
- className: "flex-shrink-0",
25443
- children: itemActions.map((action, idx) => /* @__PURE__ */ jsxs(
25444
- Button,
25703
+ /* @__PURE__ */ jsxs(Box, { className: "flex-1 min-w-0", children: [
25704
+ /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: "items-center", children: [
25705
+ titleField?.icon && /* @__PURE__ */ jsx(
25706
+ Icon,
25445
25707
  {
25446
- variant: action.variant ?? "ghost",
25447
- size: "sm",
25448
- onClick: handleActionClick(action, itemData),
25449
- "data-testid": `action-${action.event}`,
25450
- "data-row-id": String(itemData.id),
25451
- className: cn(
25452
- action.variant === "danger" && "text-error hover:bg-error/10"
25453
- ),
25454
- children: [
25455
- action.icon && /* @__PURE__ */ jsx(Icon, { name: action.icon, size: "xs", className: "mr-1" }),
25456
- action.label
25457
- ]
25458
- },
25459
- idx
25460
- ))
25461
- }
25462
- )
25708
+ name: titleField.icon,
25709
+ size: isCompact ? "xs" : "sm",
25710
+ className: "text-primary flex-shrink-0"
25711
+ }
25712
+ ),
25713
+ titleValue !== void 0 && titleValue !== null && /* @__PURE__ */ jsx(
25714
+ Typography,
25715
+ {
25716
+ variant: titleField?.variant === "h3" ? "h3" : "h4",
25717
+ className: cn("font-semibold truncate flex-1", isCompact && "text-sm"),
25718
+ children: String(titleValue)
25719
+ }
25720
+ ),
25721
+ badgeFields.map((field) => {
25722
+ const val = getNestedValue(itemData, field.name);
25723
+ if (val === void 0 || val === null) return null;
25724
+ return /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center flex-shrink-0", children: [
25725
+ field.icon && /* @__PURE__ */ jsx(Icon, { name: field.icon, size: "xs" }),
25726
+ /* @__PURE__ */ jsx(Badge, { variant: statusVariant3(String(val)), children: String(val) })
25727
+ ] }, field.name);
25728
+ })
25729
+ ] }),
25730
+ bodyFields.length > 0 && !isCompact && /* @__PURE__ */ jsx(HStack, { gap: "md", className: "mt-1.5 flex-wrap", children: bodyFields.map((field) => {
25731
+ const value = getNestedValue(itemData, field.name);
25732
+ if (value === void 0 || value === null || value === "") return null;
25733
+ return /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
25734
+ field.icon && /* @__PURE__ */ jsx(Icon, { name: field.icon, size: "xs", className: "text-muted-foreground" }),
25735
+ /* @__PURE__ */ jsxs(Typography, { variant: "caption", color: "secondary", children: [
25736
+ field.label ?? fieldLabel3(field.name),
25737
+ ":"
25738
+ ] }),
25739
+ /* @__PURE__ */ jsx(Typography, { variant: "small", children: formatValue2(value, field.format) })
25740
+ ] }, field.name);
25741
+ }) }),
25742
+ progressFields.map((field) => {
25743
+ const value = getNestedValue(itemData, field.name);
25744
+ if (typeof value !== "number") return null;
25745
+ return /* @__PURE__ */ jsxs(Box, { className: "mt-2 max-w-xs", children: [
25746
+ /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center mb-1", children: [
25747
+ field.icon && /* @__PURE__ */ jsx(Icon, { name: field.icon, size: "xs", className: "text-muted-foreground" }),
25748
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", children: field.label ?? fieldLabel3(field.name) })
25749
+ ] }),
25750
+ /* @__PURE__ */ jsx(ProgressBar, { value, max: 100 })
25751
+ ] }, field.name);
25752
+ })
25753
+ ] }),
25754
+ itemActions && itemActions.length > 0 && /* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-shrink-0", children: itemActions.map((action, idx) => /* @__PURE__ */ jsxs(
25755
+ Button,
25756
+ {
25757
+ variant: action.variant ?? "ghost",
25758
+ size: "sm",
25759
+ onClick: handleActionClick(action, itemData),
25760
+ "data-testid": `action-${action.event}`,
25761
+ "data-row-id": String(itemData.id),
25762
+ className: cn(
25763
+ action.variant === "danger" && "text-error hover:bg-error/10"
25764
+ ),
25765
+ children: [
25766
+ action.icon && /* @__PURE__ */ jsx(Icon, { name: action.icon, size: "xs", className: "mr-1" }),
25767
+ action.label
25768
+ ]
25769
+ },
25770
+ idx
25771
+ )) })
25463
25772
  ]
25464
25773
  }
25465
25774
  ),
25466
25775
  isCard && !isLast && /* @__PURE__ */ jsx(Box, { className: "mx-6 border-b border-border/40" })
25467
- ] }, id2);
25468
- }
25469
- const id = itemData.id || String(index);
25470
- const titleValue = getNestedValue(itemData, titleField?.name ?? "");
25471
- return /* @__PURE__ */ jsxs(Box, { "data-entity-row": true, "data-entity-id": id, children: [
25472
- /* @__PURE__ */ jsxs(
25473
- Box,
25474
- {
25475
- className: cn(
25476
- "group flex items-center gap-4 transition-all duration-200",
25477
- isCompact ? "px-4 py-2" : "px-6 py-4",
25478
- "hover:bg-muted/80",
25479
- !isCard && !isCompact && "rounded-lg border border-transparent hover:border-border"
25480
- ),
25481
- children: [
25482
- /* @__PURE__ */ jsxs(Box, { className: "flex-1 min-w-0", children: [
25483
- /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: "items-center", children: [
25484
- titleField?.icon && /* @__PURE__ */ jsx(
25485
- Icon,
25486
- {
25487
- name: titleField.icon,
25488
- size: isCompact ? "xs" : "sm",
25489
- className: "text-primary flex-shrink-0"
25490
- }
25491
- ),
25492
- titleValue !== void 0 && titleValue !== null && /* @__PURE__ */ jsx(
25493
- Typography,
25494
- {
25495
- variant: titleField?.variant === "h3" ? "h3" : "h4",
25496
- className: cn("font-semibold truncate flex-1", isCompact && "text-sm"),
25497
- children: String(titleValue)
25498
- }
25499
- ),
25500
- badgeFields.map((field) => {
25501
- const val = getNestedValue(itemData, field.name);
25502
- if (val === void 0 || val === null) return null;
25503
- return /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center flex-shrink-0", children: [
25504
- field.icon && /* @__PURE__ */ jsx(Icon, { name: field.icon, size: "xs" }),
25505
- /* @__PURE__ */ jsx(Badge, { variant: statusVariant3(String(val)), children: String(val) })
25506
- ] }, field.name);
25507
- })
25508
- ] }),
25509
- bodyFields.length > 0 && !isCompact && /* @__PURE__ */ jsx(HStack, { gap: "md", className: "mt-1.5 flex-wrap", children: bodyFields.map((field) => {
25510
- const value = getNestedValue(itemData, field.name);
25511
- if (value === void 0 || value === null || value === "") return null;
25512
- return /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
25513
- field.icon && /* @__PURE__ */ jsx(Icon, { name: field.icon, size: "xs", className: "text-muted-foreground" }),
25514
- /* @__PURE__ */ jsxs(Typography, { variant: "caption", color: "secondary", children: [
25515
- field.label ?? fieldLabel3(field.name),
25516
- ":"
25517
- ] }),
25518
- /* @__PURE__ */ jsx(Typography, { variant: "small", children: formatValue2(value, field.format) })
25519
- ] }, field.name);
25520
- }) }),
25521
- progressFields.map((field) => {
25522
- const value = getNestedValue(itemData, field.name);
25523
- if (typeof value !== "number") return null;
25524
- return /* @__PURE__ */ jsxs(Box, { className: "mt-2 max-w-xs", children: [
25525
- /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center mb-1", children: [
25526
- field.icon && /* @__PURE__ */ jsx(Icon, { name: field.icon, size: "xs", className: "text-muted-foreground" }),
25527
- /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", children: field.label ?? fieldLabel3(field.name) })
25528
- ] }),
25529
- /* @__PURE__ */ jsx(ProgressBar, { value, max: 100 })
25530
- ] }, field.name);
25531
- })
25532
- ] }),
25533
- itemActions && itemActions.length > 0 && /* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-shrink-0", children: itemActions.map((action, idx) => /* @__PURE__ */ jsxs(
25534
- Button,
25535
- {
25536
- variant: action.variant ?? "ghost",
25537
- size: "sm",
25538
- onClick: handleActionClick(action, itemData),
25539
- "data-testid": `action-${action.event}`,
25540
- "data-row-id": String(itemData.id),
25541
- className: cn(
25542
- action.variant === "danger" && "text-error hover:bg-error/10"
25543
- ),
25544
- children: [
25545
- action.icon && /* @__PURE__ */ jsx(Icon, { name: action.icon, size: "xs", className: "mr-1" }),
25546
- action.label
25547
- ]
25548
- },
25549
- idx
25550
- )) })
25551
- ]
25552
- }
25553
- ),
25554
- isCard && !isLast && /* @__PURE__ */ jsx(Box, { className: "mx-6 border-b border-border/40" })
25555
- ] }, id);
25776
+ ] }, id)
25777
+ );
25556
25778
  };
25557
- return /* @__PURE__ */ jsxs(
25558
- Box,
25559
- {
25560
- className: cn(
25561
- isCard && "bg-card rounded-xl border border-border shadow-lg overflow-hidden",
25562
- !isCard && gapClass,
25563
- className
25564
- ),
25565
- children: [
25566
- groups.map((group, gi) => /* @__PURE__ */ jsxs(React147__default.Fragment, { children: [
25567
- group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
25568
- group.items.map(
25569
- (itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
25779
+ return dnd.wrapContainer(
25780
+ /* @__PURE__ */ jsxs(
25781
+ Box,
25782
+ {
25783
+ className: cn(
25784
+ isCard && "bg-card rounded-xl border border-border shadow-lg overflow-hidden",
25785
+ !isCard && gapClass,
25786
+ className
25787
+ ),
25788
+ children: [
25789
+ groups.map((group, gi) => /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
25790
+ group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
25791
+ group.items.map(
25792
+ (itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
25793
+ )
25794
+ ] }, gi)),
25795
+ hasMoreLocal && /* @__PURE__ */ jsx(Box, { className: "flex justify-center py-3", children: /* @__PURE__ */ jsxs(
25796
+ Button,
25797
+ {
25798
+ variant: "ghost",
25799
+ size: "sm",
25800
+ onClick: () => setVisibleCount((prev) => prev + (pageSize || 5)),
25801
+ children: [
25802
+ /* @__PURE__ */ jsx(Icon, { name: "chevron-down", size: "xs", className: "mr-1" }),
25803
+ t("common.showMore"),
25804
+ " (",
25805
+ allData.length - visibleCount,
25806
+ " remaining)"
25807
+ ]
25808
+ }
25809
+ ) }),
25810
+ infiniteScroll && loadMoreEvent && /* @__PURE__ */ jsx(
25811
+ InfiniteScrollSentinel,
25812
+ {
25813
+ loadMoreEvent,
25814
+ isLoading,
25815
+ hasMore
25816
+ }
25570
25817
  )
25571
- ] }, gi)),
25572
- hasMoreLocal && /* @__PURE__ */ jsx(Box, { className: "flex justify-center py-3", children: /* @__PURE__ */ jsxs(
25573
- Button,
25574
- {
25575
- variant: "ghost",
25576
- size: "sm",
25577
- onClick: () => setVisibleCount((prev) => prev + (pageSize || 5)),
25578
- children: [
25579
- /* @__PURE__ */ jsx(Icon, { name: "chevron-down", size: "xs", className: "mr-1" }),
25580
- t("common.showMore"),
25581
- " (",
25582
- allData.length - visibleCount,
25583
- " remaining)"
25584
- ]
25585
- }
25586
- ) }),
25587
- infiniteScroll && loadMoreEvent && /* @__PURE__ */ jsx(
25588
- InfiniteScrollSentinel,
25589
- {
25590
- loadMoreEvent,
25591
- isLoading,
25592
- hasMore
25593
- }
25594
- )
25595
- ]
25596
- }
25818
+ ]
25819
+ }
25820
+ )
25597
25821
  );
25598
25822
  }
25599
25823
  var dataListLog;
@@ -25613,6 +25837,7 @@ var init_DataList = __esm({
25613
25837
  init_ProgressBar();
25614
25838
  init_Divider();
25615
25839
  init_InfiniteScrollSentinel();
25840
+ init_useDataDnd();
25616
25841
  dataListLog = createLogger("almadar:ui:data-list");
25617
25842
  DataList.displayName = "DataList";
25618
25843
  }
@@ -26863,7 +27088,7 @@ var init_WizardProgress = __esm({
26863
27088
  children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
26864
27089
  const isActive = index === currentStep;
26865
27090
  const isCompleted = index < currentStep;
26866
- return /* @__PURE__ */ jsxs(React147__default.Fragment, { children: [
27091
+ return /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
26867
27092
  /* @__PURE__ */ jsx(
26868
27093
  "button",
26869
27094
  {
@@ -27774,7 +27999,7 @@ function InventoryGrid({
27774
27999
  const eventBus = useEventBus();
27775
28000
  const slotCount = totalSlots ?? items.length;
27776
28001
  const emptySlotCount = Math.max(0, slotCount - items.length);
27777
- const handleSelect = React147.useCallback(
28002
+ const handleSelect = React93.useCallback(
27778
28003
  (id) => {
27779
28004
  onSelect?.(id);
27780
28005
  if (selectEvent) {
@@ -27987,15 +28212,15 @@ function GameCanvas2D({
27987
28212
  fps = 60,
27988
28213
  className
27989
28214
  }) {
27990
- const canvasRef = React147.useRef(null);
27991
- const rafRef = React147.useRef(0);
27992
- const frameRef = React147.useRef(0);
27993
- const lastTimeRef = React147.useRef(0);
27994
- const onDrawRef = React147.useRef(onDraw);
28215
+ const canvasRef = React93.useRef(null);
28216
+ const rafRef = React93.useRef(0);
28217
+ const frameRef = React93.useRef(0);
28218
+ const lastTimeRef = React93.useRef(0);
28219
+ const onDrawRef = React93.useRef(onDraw);
27995
28220
  onDrawRef.current = onDraw;
27996
- const onTickRef = React147.useRef(onTick);
28221
+ const onTickRef = React93.useRef(onTick);
27997
28222
  onTickRef.current = onTick;
27998
- React147.useEffect(() => {
28223
+ React93.useEffect(() => {
27999
28224
  const canvas = canvasRef.current;
28000
28225
  if (!canvas) return;
28001
28226
  const ctx = canvas.getContext("2d");
@@ -28284,7 +28509,7 @@ function TurnPanel({
28284
28509
  className
28285
28510
  }) {
28286
28511
  const eventBus = useEventBus();
28287
- const handleAction = React147.useCallback(
28512
+ const handleAction = React93.useCallback(
28288
28513
  (event) => {
28289
28514
  if (event) {
28290
28515
  eventBus.emit(event, { turn: currentTurn, phase, activeTeam });
@@ -28430,7 +28655,7 @@ function UnitCommandBar({
28430
28655
  className
28431
28656
  }) {
28432
28657
  const eventBus = useEventBus();
28433
- const handleCommand = React147.useCallback(
28658
+ const handleCommand = React93.useCallback(
28434
28659
  (event) => {
28435
28660
  if (event) {
28436
28661
  eventBus.emit(event, { unitId: selectedUnitId });
@@ -28915,7 +29140,7 @@ function GameMenu({
28915
29140
  } catch {
28916
29141
  }
28917
29142
  const eventBus = eventBusProp || eventBusFromHook;
28918
- const handleOptionClick = React147.useCallback(
29143
+ const handleOptionClick = React93.useCallback(
28919
29144
  (option) => {
28920
29145
  if (option.event && eventBus) {
28921
29146
  eventBus.emit(`UI:${option.event}`, { option });
@@ -29029,7 +29254,7 @@ function GameOverScreen({
29029
29254
  } catch {
29030
29255
  }
29031
29256
  const eventBus = eventBusProp || eventBusFromHook;
29032
- const handleActionClick = React147.useCallback(
29257
+ const handleActionClick = React93.useCallback(
29033
29258
  (action) => {
29034
29259
  if (action.event && eventBus) {
29035
29260
  eventBus.emit(`UI:${action.event}`, { action });
@@ -31656,7 +31881,7 @@ var init_StepFlow = __esm({
31656
31881
  className
31657
31882
  }) => {
31658
31883
  if (orientation === "vertical") {
31659
- 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: [
31884
+ 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: [
31660
31885
  /* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
31661
31886
  /* @__PURE__ */ jsx(StepCircle, { step, index }),
31662
31887
  showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
@@ -31667,7 +31892,7 @@ var init_StepFlow = __esm({
31667
31892
  ] })
31668
31893
  ] }) }, index)) });
31669
31894
  }
31670
- 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: [
31895
+ 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: [
31671
31896
  /* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
31672
31897
  /* @__PURE__ */ jsx(StepCircle, { step, index }),
31673
31898
  /* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
@@ -32549,7 +32774,7 @@ var init_LikertScale = __esm({
32549
32774
  md: "text-base",
32550
32775
  lg: "text-lg"
32551
32776
  };
32552
- LikertScale = React147__default.forwardRef(
32777
+ LikertScale = React93__default.forwardRef(
32553
32778
  ({
32554
32779
  question,
32555
32780
  options = DEFAULT_LIKERT_OPTIONS,
@@ -32561,7 +32786,7 @@ var init_LikertScale = __esm({
32561
32786
  variant = "radios",
32562
32787
  className
32563
32788
  }, ref) => {
32564
- const groupId = React147__default.useId();
32789
+ const groupId = React93__default.useId();
32565
32790
  const eventBus = useEventBus();
32566
32791
  const handleSelect = useCallback(
32567
32792
  (next) => {
@@ -34787,7 +35012,7 @@ var init_DocBreadcrumb = __esm({
34787
35012
  "aria-label": "Breadcrumb",
34788
35013
  children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
34789
35014
  const isLast = idx === items.length - 1;
34790
- return /* @__PURE__ */ jsxs(React147__default.Fragment, { children: [
35015
+ return /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
34791
35016
  idx > 0 && /* @__PURE__ */ jsx(
34792
35017
  Icon,
34793
35018
  {
@@ -36651,7 +36876,7 @@ var init_DocumentViewer = __esm({
36651
36876
  }
36652
36877
  });
36653
36878
  function extractTitle(children) {
36654
- if (!React147__default.isValidElement(children)) return void 0;
36879
+ if (!React93__default.isValidElement(children)) return void 0;
36655
36880
  const props = children.props;
36656
36881
  if (typeof props.title === "string") {
36657
36882
  return props.title;
@@ -36706,7 +36931,7 @@ function LinearView({
36706
36931
  /* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
36707
36932
  const isDone = i < currentIdx;
36708
36933
  const isCurrent = i === currentIdx;
36709
- return /* @__PURE__ */ jsxs(React147__default.Fragment, { children: [
36934
+ return /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
36710
36935
  i > 0 && /* @__PURE__ */ jsx(
36711
36936
  Typography,
36712
36937
  {
@@ -37606,12 +37831,12 @@ var init_Form = __esm({
37606
37831
  const isSchemaEntity = isOrbitalEntitySchema(entity);
37607
37832
  const resolvedEntity = isSchemaEntity ? entity : void 0;
37608
37833
  const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
37609
- const normalizedInitialData = React147__default.useMemo(() => {
37834
+ const normalizedInitialData = React93__default.useMemo(() => {
37610
37835
  const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
37611
37836
  const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
37612
37837
  return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
37613
37838
  }, [entity, initialData]);
37614
- const entityDerivedFields = React147__default.useMemo(() => {
37839
+ const entityDerivedFields = React93__default.useMemo(() => {
37615
37840
  if (fields && fields.length > 0) return void 0;
37616
37841
  if (!resolvedEntity) return void 0;
37617
37842
  return resolvedEntity.fields.map(
@@ -37630,16 +37855,16 @@ var init_Form = __esm({
37630
37855
  const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
37631
37856
  const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
37632
37857
  const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
37633
- const [formData, setFormData] = React147__default.useState(
37858
+ const [formData, setFormData] = React93__default.useState(
37634
37859
  normalizedInitialData
37635
37860
  );
37636
- const [collapsedSections, setCollapsedSections] = React147__default.useState(
37861
+ const [collapsedSections, setCollapsedSections] = React93__default.useState(
37637
37862
  /* @__PURE__ */ new Set()
37638
37863
  );
37639
- const [submitError, setSubmitError] = React147__default.useState(null);
37640
- const formRef = React147__default.useRef(null);
37864
+ const [submitError, setSubmitError] = React93__default.useState(null);
37865
+ const formRef = React93__default.useRef(null);
37641
37866
  const formMode = props.mode;
37642
- const mountedRef = React147__default.useRef(false);
37867
+ const mountedRef = React93__default.useRef(false);
37643
37868
  if (!mountedRef.current) {
37644
37869
  mountedRef.current = true;
37645
37870
  debug("forms", "mount", {
@@ -37652,7 +37877,7 @@ var init_Form = __esm({
37652
37877
  });
37653
37878
  }
37654
37879
  const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
37655
- const evalContext = React147__default.useMemo(
37880
+ const evalContext = React93__default.useMemo(
37656
37881
  () => ({
37657
37882
  formValues: formData,
37658
37883
  globalVariables: externalContext?.globalVariables ?? {},
@@ -37661,7 +37886,7 @@ var init_Form = __esm({
37661
37886
  }),
37662
37887
  [formData, externalContext]
37663
37888
  );
37664
- React147__default.useEffect(() => {
37889
+ React93__default.useEffect(() => {
37665
37890
  debug("forms", "initialData-sync", {
37666
37891
  mode: formMode,
37667
37892
  normalizedInitialData,
@@ -37672,7 +37897,7 @@ var init_Form = __esm({
37672
37897
  setFormData(normalizedInitialData);
37673
37898
  }
37674
37899
  }, [normalizedInitialData]);
37675
- const processCalculations = React147__default.useCallback(
37900
+ const processCalculations = React93__default.useCallback(
37676
37901
  (changedFieldId, newFormData) => {
37677
37902
  if (!hiddenCalculations.length) return;
37678
37903
  const context = {
@@ -37697,7 +37922,7 @@ var init_Form = __esm({
37697
37922
  },
37698
37923
  [hiddenCalculations, externalContext, eventBus]
37699
37924
  );
37700
- const checkViolations = React147__default.useCallback(
37925
+ const checkViolations = React93__default.useCallback(
37701
37926
  (changedFieldId, newFormData) => {
37702
37927
  if (!violationTriggers.length) return;
37703
37928
  const context = {
@@ -37735,7 +37960,7 @@ var init_Form = __esm({
37735
37960
  processCalculations(name, newFormData);
37736
37961
  checkViolations(name, newFormData);
37737
37962
  };
37738
- const isFieldVisible = React147__default.useCallback(
37963
+ const isFieldVisible = React93__default.useCallback(
37739
37964
  (fieldName) => {
37740
37965
  const condition = conditionalFields[fieldName];
37741
37966
  if (!condition) return true;
@@ -37743,7 +37968,7 @@ var init_Form = __esm({
37743
37968
  },
37744
37969
  [conditionalFields, evalContext]
37745
37970
  );
37746
- const isSectionVisible = React147__default.useCallback(
37971
+ const isSectionVisible = React93__default.useCallback(
37747
37972
  (section) => {
37748
37973
  if (!section.condition) return true;
37749
37974
  return Boolean(evaluateFormExpression(section.condition, evalContext));
@@ -37819,7 +38044,7 @@ var init_Form = __esm({
37819
38044
  eventBus.emit(`UI:${onCancel}`);
37820
38045
  }
37821
38046
  };
37822
- const renderField = React147__default.useCallback(
38047
+ const renderField = React93__default.useCallback(
37823
38048
  (field) => {
37824
38049
  const fieldName = field.name || field.field;
37825
38050
  if (!fieldName) return null;
@@ -37840,7 +38065,7 @@ var init_Form = __esm({
37840
38065
  [formData, isFieldVisible, relationsData, relationsLoading, isLoading]
37841
38066
  );
37842
38067
  const effectiveFields = entityDerivedFields ?? fields;
37843
- const normalizedFields = React147__default.useMemo(() => {
38068
+ const normalizedFields = React93__default.useMemo(() => {
37844
38069
  if (!effectiveFields || effectiveFields.length === 0) return [];
37845
38070
  return effectiveFields.map((field) => {
37846
38071
  if (typeof field === "string") {
@@ -37862,7 +38087,7 @@ var init_Form = __esm({
37862
38087
  return field;
37863
38088
  });
37864
38089
  }, [effectiveFields, resolvedEntity]);
37865
- const schemaFields = React147__default.useMemo(() => {
38090
+ const schemaFields = React93__default.useMemo(() => {
37866
38091
  if (normalizedFields.length === 0) return null;
37867
38092
  if (isDebugEnabled()) {
37868
38093
  debugGroup(`Form: ${entityName || "unknown"}`);
@@ -37872,7 +38097,7 @@ var init_Form = __esm({
37872
38097
  }
37873
38098
  return normalizedFields.map(renderField).filter(Boolean);
37874
38099
  }, [normalizedFields, renderField, entityName, conditionalFields]);
37875
- const sectionElements = React147__default.useMemo(() => {
38100
+ const sectionElements = React93__default.useMemo(() => {
37876
38101
  if (!sections || sections.length === 0) return null;
37877
38102
  return sections.map((section) => {
37878
38103
  if (!isSectionVisible(section)) {
@@ -39598,7 +39823,7 @@ var init_List = __esm({
39598
39823
  if (entity && typeof entity === "object" && "id" in entity) return [entity];
39599
39824
  return [];
39600
39825
  }, [entity]);
39601
- const getItemActions = React147__default.useCallback(
39826
+ const getItemActions = React93__default.useCallback(
39602
39827
  (item) => {
39603
39828
  if (!itemActions) return [];
39604
39829
  if (typeof itemActions === "function") {
@@ -40071,7 +40296,7 @@ var init_MediaGallery = __esm({
40071
40296
  [selectable, selectedItems, selectionEvent, eventBus]
40072
40297
  );
40073
40298
  const entityData = Array.isArray(entity) ? entity : [];
40074
- const items = React147__default.useMemo(() => {
40299
+ const items = React93__default.useMemo(() => {
40075
40300
  if (propItems) return propItems;
40076
40301
  if (entityData.length === 0) return [];
40077
40302
  return entityData.map((record, idx) => ({
@@ -40235,7 +40460,7 @@ var init_MediaGallery = __esm({
40235
40460
  }
40236
40461
  });
40237
40462
  function extractTitle2(children) {
40238
- if (!React147__default.isValidElement(children)) return void 0;
40463
+ if (!React93__default.isValidElement(children)) return void 0;
40239
40464
  const props = children.props;
40240
40465
  if (typeof props.title === "string") {
40241
40466
  return props.title;
@@ -40948,7 +41173,7 @@ var init_PageHeader = __esm({
40948
41173
  info: "bg-info/10 text-info"
40949
41174
  };
40950
41175
  return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
40951
- 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: [
41176
+ 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: [
40952
41177
  idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
40953
41178
  crumb.href ? /* @__PURE__ */ jsx(
40954
41179
  "a",
@@ -41263,7 +41488,7 @@ var init_debugRegistry = __esm({
41263
41488
  }
41264
41489
  });
41265
41490
  function useDebugData() {
41266
- const [data, setData] = React147.useState(() => ({
41491
+ const [data, setData] = React93.useState(() => ({
41267
41492
  traits: [],
41268
41493
  ticks: [],
41269
41494
  guards: [],
@@ -41277,7 +41502,7 @@ function useDebugData() {
41277
41502
  },
41278
41503
  lastUpdate: Date.now()
41279
41504
  }));
41280
- React147.useEffect(() => {
41505
+ React93.useEffect(() => {
41281
41506
  const updateData = () => {
41282
41507
  setData({
41283
41508
  traits: getAllTraits(),
@@ -41386,12 +41611,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
41386
41611
  return positions;
41387
41612
  }
41388
41613
  function WalkMinimap() {
41389
- const [walkStep, setWalkStep] = React147.useState(null);
41390
- const [traits2, setTraits] = React147.useState([]);
41391
- const [coveredEdges, setCoveredEdges] = React147.useState([]);
41392
- const [completedTraits, setCompletedTraits] = React147.useState(/* @__PURE__ */ new Set());
41393
- const prevTraitRef = React147.useRef(null);
41394
- React147.useEffect(() => {
41614
+ const [walkStep, setWalkStep] = React93.useState(null);
41615
+ const [traits2, setTraits] = React93.useState([]);
41616
+ const [coveredEdges, setCoveredEdges] = React93.useState([]);
41617
+ const [completedTraits, setCompletedTraits] = React93.useState(/* @__PURE__ */ new Set());
41618
+ const prevTraitRef = React93.useRef(null);
41619
+ React93.useEffect(() => {
41395
41620
  const interval = setInterval(() => {
41396
41621
  const w = window;
41397
41622
  const step = w.__orbitalWalkStep;
@@ -41838,15 +42063,15 @@ var init_EntitiesTab = __esm({
41838
42063
  }
41839
42064
  });
41840
42065
  function EventFlowTab({ events: events2 }) {
41841
- const [filter, setFilter] = React147.useState("all");
41842
- const containerRef = React147.useRef(null);
41843
- const [autoScroll, setAutoScroll] = React147.useState(true);
41844
- React147.useEffect(() => {
42066
+ const [filter, setFilter] = React93.useState("all");
42067
+ const containerRef = React93.useRef(null);
42068
+ const [autoScroll, setAutoScroll] = React93.useState(true);
42069
+ React93.useEffect(() => {
41845
42070
  if (autoScroll && containerRef.current) {
41846
42071
  containerRef.current.scrollTop = containerRef.current.scrollHeight;
41847
42072
  }
41848
42073
  }, [events2.length, autoScroll]);
41849
- const filteredEvents = React147.useMemo(() => {
42074
+ const filteredEvents = React93.useMemo(() => {
41850
42075
  if (filter === "all") return events2;
41851
42076
  return events2.filter((e) => e.type === filter);
41852
42077
  }, [events2, filter]);
@@ -41965,7 +42190,7 @@ var init_EventFlowTab = __esm({
41965
42190
  }
41966
42191
  });
41967
42192
  function GuardsPanel({ guards }) {
41968
- const [filter, setFilter] = React147.useState("all");
42193
+ const [filter, setFilter] = React93.useState("all");
41969
42194
  if (guards.length === 0) {
41970
42195
  return /* @__PURE__ */ jsx(
41971
42196
  EmptyState,
@@ -41978,7 +42203,7 @@ function GuardsPanel({ guards }) {
41978
42203
  }
41979
42204
  const passedCount = guards.filter((g) => g.result).length;
41980
42205
  const failedCount = guards.length - passedCount;
41981
- const filteredGuards = React147.useMemo(() => {
42206
+ const filteredGuards = React93.useMemo(() => {
41982
42207
  if (filter === "all") return guards;
41983
42208
  if (filter === "passed") return guards.filter((g) => g.result);
41984
42209
  return guards.filter((g) => !g.result);
@@ -42139,10 +42364,10 @@ function EffectBadge({ effect }) {
42139
42364
  ] });
42140
42365
  }
42141
42366
  function TransitionTimeline({ transitions }) {
42142
- const containerRef = React147.useRef(null);
42143
- const [autoScroll, setAutoScroll] = React147.useState(true);
42144
- const [expandedId, setExpandedId] = React147.useState(null);
42145
- React147.useEffect(() => {
42367
+ const containerRef = React93.useRef(null);
42368
+ const [autoScroll, setAutoScroll] = React93.useState(true);
42369
+ const [expandedId, setExpandedId] = React93.useState(null);
42370
+ React93.useEffect(() => {
42146
42371
  if (autoScroll && containerRef.current) {
42147
42372
  containerRef.current.scrollTop = containerRef.current.scrollHeight;
42148
42373
  }
@@ -42428,9 +42653,9 @@ function getAllEvents(traits2) {
42428
42653
  }
42429
42654
  function EventDispatcherTab({ traits: traits2, schema }) {
42430
42655
  const eventBus = useEventBus();
42431
- const [log19, setLog] = React147.useState([]);
42432
- const prevStatesRef = React147.useRef(/* @__PURE__ */ new Map());
42433
- React147.useEffect(() => {
42656
+ const [log19, setLog] = React93.useState([]);
42657
+ const prevStatesRef = React93.useRef(/* @__PURE__ */ new Map());
42658
+ React93.useEffect(() => {
42434
42659
  for (const trait of traits2) {
42435
42660
  const prev = prevStatesRef.current.get(trait.id);
42436
42661
  if (prev && prev !== trait.currentState) {
@@ -42600,10 +42825,10 @@ function VerifyModePanel({
42600
42825
  serverCount,
42601
42826
  localCount
42602
42827
  }) {
42603
- const [expanded, setExpanded] = React147.useState(true);
42604
- const scrollRef = React147.useRef(null);
42605
- const prevCountRef = React147.useRef(0);
42606
- React147.useEffect(() => {
42828
+ const [expanded, setExpanded] = React93.useState(true);
42829
+ const scrollRef = React93.useRef(null);
42830
+ const prevCountRef = React93.useRef(0);
42831
+ React93.useEffect(() => {
42607
42832
  if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
42608
42833
  scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
42609
42834
  }
@@ -42669,10 +42894,10 @@ function RuntimeDebugger({
42669
42894
  defaultTab,
42670
42895
  schema
42671
42896
  }) {
42672
- const [isCollapsed, setIsCollapsed] = React147.useState(mode === "verify" ? true : defaultCollapsed);
42673
- const [isVisible, setIsVisible] = React147.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
42897
+ const [isCollapsed, setIsCollapsed] = React93.useState(mode === "verify" ? true : defaultCollapsed);
42898
+ const [isVisible, setIsVisible] = React93.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
42674
42899
  const debugData = useDebugData();
42675
- React147.useEffect(() => {
42900
+ React93.useEffect(() => {
42676
42901
  if (mode === "inline") return;
42677
42902
  return onDebugToggle((enabled) => {
42678
42903
  setIsVisible(enabled);
@@ -42681,7 +42906,7 @@ function RuntimeDebugger({
42681
42906
  }
42682
42907
  });
42683
42908
  }, [mode]);
42684
- React147.useEffect(() => {
42909
+ React93.useEffect(() => {
42685
42910
  if (mode === "inline") return;
42686
42911
  const handleKeyDown = (e) => {
42687
42912
  if (e.key === "`" && isVisible) {
@@ -43230,7 +43455,7 @@ function SequenceBar({
43230
43455
  onSlotRemove(index);
43231
43456
  }, [onSlotRemove, playing]);
43232
43457
  const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
43233
- return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React147__default.Fragment, { children: [
43458
+ return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
43234
43459
  i > 0 && /* @__PURE__ */ jsx(
43235
43460
  Typography,
43236
43461
  {
@@ -44631,7 +44856,7 @@ var init_StatCard = __esm({
44631
44856
  const labelToUse = propLabel ?? propTitle;
44632
44857
  const eventBus = useEventBus();
44633
44858
  const { t } = useTranslate();
44634
- const handleActionClick = React147__default.useCallback(() => {
44859
+ const handleActionClick = React93__default.useCallback(() => {
44635
44860
  if (action?.event) {
44636
44861
  eventBus.emit(`UI:${action.event}`, {});
44637
44862
  }
@@ -44642,7 +44867,7 @@ var init_StatCard = __esm({
44642
44867
  const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
44643
44868
  const isLoading = externalLoading ?? false;
44644
44869
  const error = externalError;
44645
- const computeMetricValue = React147__default.useCallback(
44870
+ const computeMetricValue = React93__default.useCallback(
44646
44871
  (metric, items) => {
44647
44872
  if (metric.value !== void 0) {
44648
44873
  return metric.value;
@@ -44681,7 +44906,7 @@ var init_StatCard = __esm({
44681
44906
  },
44682
44907
  []
44683
44908
  );
44684
- const schemaStats = React147__default.useMemo(() => {
44909
+ const schemaStats = React93__default.useMemo(() => {
44685
44910
  if (!metrics || metrics.length === 0) return null;
44686
44911
  return metrics.map((metric) => ({
44687
44912
  label: metric.label,
@@ -44689,7 +44914,7 @@ var init_StatCard = __esm({
44689
44914
  format: metric.format
44690
44915
  }));
44691
44916
  }, [metrics, data, computeMetricValue]);
44692
- const calculatedTrend = React147__default.useMemo(() => {
44917
+ const calculatedTrend = React93__default.useMemo(() => {
44693
44918
  if (manualTrend !== void 0) return manualTrend;
44694
44919
  if (previousValue === void 0 || currentValue === void 0)
44695
44920
  return void 0;
@@ -45825,7 +46050,7 @@ var init_Timeline = __esm({
45825
46050
  }) => {
45826
46051
  const { t } = useTranslate();
45827
46052
  const entityData = Array.isArray(entity) ? entity : [];
45828
- const items = React147__default.useMemo(() => {
46053
+ const items = React93__default.useMemo(() => {
45829
46054
  if (propItems) return propItems;
45830
46055
  if (entityData.length === 0) return [];
45831
46056
  return entityData.map((record, idx) => {
@@ -45932,7 +46157,7 @@ var init_Timeline = __esm({
45932
46157
  }
45933
46158
  });
45934
46159
  function extractToastProps(children) {
45935
- if (!React147__default.isValidElement(children)) {
46160
+ if (!React93__default.isValidElement(children)) {
45936
46161
  if (typeof children === "string") {
45937
46162
  return { message: children };
45938
46163
  }
@@ -45970,7 +46195,7 @@ var init_ToastSlot = __esm({
45970
46195
  eventBus.emit("UI:CLOSE");
45971
46196
  };
45972
46197
  if (!isVisible) return null;
45973
- const isCustomContent = React147__default.isValidElement(children) && !message;
46198
+ const isCustomContent = React93__default.isValidElement(children) && !message;
45974
46199
  return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
45975
46200
  Toast,
45976
46201
  {
@@ -46239,7 +46464,7 @@ var init_WizardContainer = __esm({
46239
46464
  const isCompleted = index < currentStep;
46240
46465
  const stepKey = step.id ?? step.tabId ?? `step-${index}`;
46241
46466
  const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
46242
- return /* @__PURE__ */ jsxs(React147__default.Fragment, { children: [
46467
+ return /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
46243
46468
  /* @__PURE__ */ jsx(
46244
46469
  Button,
46245
46470
  {
@@ -48432,7 +48657,7 @@ function UnitRenderer({
48432
48657
  onAnimationStateChange,
48433
48658
  animationSpeed = 1
48434
48659
  }) {
48435
- const handleUnitClick = React147__default.useCallback(
48660
+ const handleUnitClick = React93__default.useCallback(
48436
48661
  (unit) => {
48437
48662
  onUnitClick?.(unit);
48438
48663
  },
@@ -51628,7 +51853,7 @@ var init_Avl3DViewer = __esm({
51628
51853
  const handleTraitClick = useCallback((name) => {
51629
51854
  dispatch({ type: "ZOOM_INTO_TRAIT", trait: name, targetPosition: { x: 0, y: 0 } });
51630
51855
  }, []);
51631
- const [highlightedTrait, setHighlightedTrait] = React147__default.useState(null);
51856
+ const [highlightedTrait, setHighlightedTrait] = React93__default.useState(null);
51632
51857
  const handleTransitionClick = useCallback((index) => {
51633
51858
  dispatch({ type: "ZOOM_INTO_TRANSITION", transitionIndex: index, targetPosition: { x: 0, y: 0 } });
51634
51859
  }, []);
@@ -51715,7 +51940,7 @@ var init_Avl3DViewer = __esm({
51715
51940
  gap: "xs",
51716
51941
  align: "center",
51717
51942
  className: "absolute top-2 left-2 z-10 bg-surface/80 backdrop-blur rounded-md px-3 py-1.5",
51718
- children: breadcrumbs.map((crumb, i) => /* @__PURE__ */ jsxs(React147__default.Fragment, { children: [
51943
+ children: breadcrumbs.map((crumb, i) => /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
51719
51944
  i > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", className: "mx-1", children: "/" }),
51720
51945
  i < breadcrumbs.length - 1 ? /* @__PURE__ */ jsx(
51721
51946
  Box,
@@ -52093,12 +52318,12 @@ var init_three = __esm({
52093
52318
  }
52094
52319
  });
52095
52320
  function lazyThree(name, loader) {
52096
- const Lazy = React147__default.lazy(() => loader().then((m) => ({ default: m[name] })));
52321
+ const Lazy = React93__default.lazy(() => loader().then((m) => ({ default: m[name] })));
52097
52322
  function ThreeWrapper(props) {
52098
- return React147__default.createElement(
52099
- React147__default.Suspense,
52323
+ return React93__default.createElement(
52324
+ React93__default.Suspense,
52100
52325
  { fallback: null },
52101
- React147__default.createElement(Lazy, props)
52326
+ React93__default.createElement(Lazy, props)
52102
52327
  );
52103
52328
  }
52104
52329
  ThreeWrapper.displayName = `Lazy(${name})`;
@@ -52702,7 +52927,7 @@ function SuspenseConfigProvider({
52702
52927
  config,
52703
52928
  children
52704
52929
  }) {
52705
- return React147__default.createElement(
52930
+ return React93__default.createElement(
52706
52931
  SuspenseConfigContext.Provider,
52707
52932
  { value: config },
52708
52933
  children
@@ -53185,7 +53410,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
53185
53410
  const key = `${parentId}-${index}-trait:${traitName}`;
53186
53411
  return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
53187
53412
  }
53188
- return /* @__PURE__ */ jsx(React147__default.Fragment, { children: child }, `${parentId}-${index}`);
53413
+ return /* @__PURE__ */ jsx(React93__default.Fragment, { children: child }, `${parentId}-${index}`);
53189
53414
  }
53190
53415
  if (!child || typeof child !== "object") return null;
53191
53416
  const childId = `${parentId}-${index}`;
@@ -53222,14 +53447,14 @@ function isPatternConfig(value) {
53222
53447
  if (value === null || value === void 0) return false;
53223
53448
  if (typeof value !== "object") return false;
53224
53449
  if (Array.isArray(value)) return false;
53225
- if (React147__default.isValidElement(value)) return false;
53450
+ if (React93__default.isValidElement(value)) return false;
53226
53451
  if (value instanceof Date) return false;
53227
53452
  if (typeof value === "function") return false;
53228
53453
  const record = value;
53229
53454
  return "type" in record && typeof record.type === "string";
53230
53455
  }
53231
53456
  function isPlainConfigObject(value) {
53232
- if (React147__default.isValidElement(value)) return false;
53457
+ if (React93__default.isValidElement(value)) return false;
53233
53458
  if (value instanceof Date) return false;
53234
53459
  const proto = Object.getPrototypeOf(value);
53235
53460
  return proto === Object.prototype || proto === null;
@@ -53684,7 +53909,7 @@ var AvlTransition = ({
53684
53909
  opacity = 1,
53685
53910
  className
53686
53911
  }) => {
53687
- const ids = React147__default.useMemo(() => {
53912
+ const ids = React93__default.useMemo(() => {
53688
53913
  avlTransitionId += 1;
53689
53914
  return { arrow: `avl-tr-${avlTransitionId}-arrow` };
53690
53915
  }, []);
@@ -54245,7 +54470,7 @@ var AvlStateMachine = ({
54245
54470
  color = "var(--color-primary)",
54246
54471
  animated = false
54247
54472
  }) => {
54248
- const ids = React147__default.useMemo(() => {
54473
+ const ids = React93__default.useMemo(() => {
54249
54474
  avlSmId += 1;
54250
54475
  const base = `avl-sm-${avlSmId}`;
54251
54476
  return { glow: `${base}-glow`, grad: `${base}-grad` };
@@ -54444,7 +54669,7 @@ var AvlOrbitalUnit = ({
54444
54669
  color = "var(--color-primary)",
54445
54670
  animated = false
54446
54671
  }) => {
54447
- const ids = React147__default.useMemo(() => {
54672
+ const ids = React93__default.useMemo(() => {
54448
54673
  avlOuId += 1;
54449
54674
  const base = `avl-ou-${avlOuId}`;
54450
54675
  return { glow: `${base}-glow`, grad: `${base}-grad` };
@@ -54540,7 +54765,7 @@ var AvlClosedCircuit = ({
54540
54765
  color = "var(--color-primary)",
54541
54766
  animated = false
54542
54767
  }) => {
54543
- const ids = React147__default.useMemo(() => {
54768
+ const ids = React93__default.useMemo(() => {
54544
54769
  avlCcId += 1;
54545
54770
  const base = `avl-cc-${avlCcId}`;
54546
54771
  return { glow: `${base}-glow`, grad: `${base}-grad`, arrow: `${base}-arrow` };
@@ -54695,7 +54920,7 @@ var AvlEmitListen = ({
54695
54920
  color = "var(--color-primary)",
54696
54921
  animated = false
54697
54922
  }) => {
54698
- const ids = React147__default.useMemo(() => {
54923
+ const ids = React93__default.useMemo(() => {
54699
54924
  avlElId += 1;
54700
54925
  const base = `avl-el-${avlElId}`;
54701
54926
  return { arrow: `${base}-arrow`, grad: `${base}-grad` };
@@ -54968,7 +55193,7 @@ function renderNode(node, color, glowId) {
54968
55193
  const baseR = node.type === "operator" ? 20 : 16;
54969
55194
  const r2 = Math.max(baseR, labelLen * 3.5 + 6);
54970
55195
  const nc = nodeColor(node.type, color);
54971
- return /* @__PURE__ */ jsxs(React147__default.Fragment, { children: [
55196
+ return /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
54972
55197
  node.children.map((child, i) => {
54973
55198
  const childR = Math.max(
54974
55199
  child.type === "operator" ? 20 : 16,
@@ -55025,7 +55250,7 @@ var AvlExprTree = ({
55025
55250
  className,
55026
55251
  color = "var(--color-primary)"
55027
55252
  }) => {
55028
- const ids = React147__default.useMemo(() => {
55253
+ const ids = React93__default.useMemo(() => {
55029
55254
  avlEtId += 1;
55030
55255
  return { glow: `avl-et-${avlEtId}-glow` };
55031
55256
  }, []);
@@ -55588,7 +55813,7 @@ var SystemNode = ({ data }) => {
55588
55813
  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) => {
55589
55814
  const tc = transitionCounts[s.name] ?? 0;
55590
55815
  const role = getStateRole(s.name, s.isInitial, s.isTerminal, tc, maxTC);
55591
- return /* @__PURE__ */ jsxs(React147__default.Fragment, { children: [
55816
+ return /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
55592
55817
  /* @__PURE__ */ jsx(AvlState, { x: i * 14 + 1, y: 1, width: 10, height: 8, name: "", role, isInitial: s.isInitial, isTerminal: s.isTerminal }),
55593
55818
  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 })
55594
55819
  ] }, s.name);
@@ -56832,7 +57057,7 @@ function resolveLambdaBindings(body, argName, arg) {
56832
57057
  if (Array.isArray(body)) {
56833
57058
  return body.map((b) => resolveLambdaBindings(b, argName, arg));
56834
57059
  }
56835
- if (body !== null && typeof body === "object" && !React147__default.isValidElement(body) && !(body instanceof Date) && typeof body !== "function") {
57060
+ if (body !== null && typeof body === "object" && !React93__default.isValidElement(body) && !(body instanceof Date) && typeof body !== "function") {
56836
57061
  const out = {};
56837
57062
  for (const [k, v] of Object.entries(body)) {
56838
57063
  out[k] = resolveLambdaBindings(v, argName, arg);
@@ -56851,7 +57076,7 @@ function getSlotContentRenderer2() {
56851
57076
  function makeLambdaFn(argName, lambdaBody, callerKey) {
56852
57077
  return (item, index) => {
56853
57078
  const resolvedBody = resolveLambdaBindings(lambdaBody, argName, item);
56854
- if (resolvedBody === null || typeof resolvedBody !== "object" || Array.isArray(resolvedBody) || typeof resolvedBody === "function" || React147__default.isValidElement(resolvedBody) || resolvedBody instanceof Date) {
57079
+ if (resolvedBody === null || typeof resolvedBody !== "object" || Array.isArray(resolvedBody) || typeof resolvedBody === "function" || React93__default.isValidElement(resolvedBody) || resolvedBody instanceof Date) {
56855
57080
  return null;
56856
57081
  }
56857
57082
  const record = resolvedBody;
@@ -56869,7 +57094,7 @@ function makeLambdaFn(argName, lambdaBody, callerKey) {
56869
57094
  props: childProps,
56870
57095
  priority: 0
56871
57096
  };
56872
- return React147__default.createElement(SlotContentRenderer2, { content: childContent });
57097
+ return React93__default.createElement(SlotContentRenderer2, { content: childContent });
56873
57098
  };
56874
57099
  }
56875
57100
  function convertNode(node, callerKey) {
@@ -56888,7 +57113,7 @@ function convertNode(node, callerKey) {
56888
57113
  });
56889
57114
  return anyChanged ? mapped : node;
56890
57115
  }
56891
- if (typeof node === "object" && !React147__default.isValidElement(node) && !(node instanceof Date)) {
57116
+ if (typeof node === "object" && !React93__default.isValidElement(node) && !(node instanceof Date)) {
56892
57117
  return convertObjectProps(node);
56893
57118
  }
56894
57119
  return node;
@@ -58986,7 +59211,7 @@ var OrbPreviewNodeInner = (props) => {
58986
59211
  }
58987
59212
  );
58988
59213
  };
58989
- var OrbPreviewNode = React147__default.memo(OrbPreviewNodeInner);
59214
+ var OrbPreviewNode = React93__default.memo(OrbPreviewNodeInner);
58990
59215
  OrbPreviewNode.displayName = "OrbPreviewNode";
58991
59216
  orbPreviewLog.debug("export-resolved", () => ({
58992
59217
  type: typeof OrbPreviewNode,
@@ -59091,7 +59316,7 @@ var EventFlowEdgeInner = (props) => {
59091
59316
  ) })
59092
59317
  ] });
59093
59318
  };
59094
- var EventFlowEdge = React147__default.memo(EventFlowEdgeInner);
59319
+ var EventFlowEdge = React93__default.memo(EventFlowEdgeInner);
59095
59320
  EventFlowEdge.displayName = "EventFlowEdge";
59096
59321
 
59097
59322
  // components/molecules/avl/BehaviorComposeNode.tsx
@@ -59238,7 +59463,7 @@ var BehaviorComposeNodeInner = (props) => {
59238
59463
  }
59239
59464
  );
59240
59465
  };
59241
- var BehaviorComposeNode = React147__default.memo(BehaviorComposeNodeInner);
59466
+ var BehaviorComposeNode = React93__default.memo(BehaviorComposeNodeInner);
59242
59467
  BehaviorComposeNode.displayName = "BehaviorComposeNode";
59243
59468
 
59244
59469
  // components/molecules/avl/avl-behavior-compose-converter.ts
@@ -60201,7 +60426,7 @@ var ZoomBreadcrumb = ({
60201
60426
  if (eventName && band === "detail") {
60202
60427
  segments.push({ icon: "\u26A1", label: eventName });
60203
60428
  }
60204
- 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: [
60429
+ 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: [
60205
60430
  i > 0 && /* @__PURE__ */ jsx("span", { className: "opacity-40", children: ">" }),
60206
60431
  /* @__PURE__ */ jsx("span", { className: "opacity-60", children: seg.icon }),
60207
60432
  /* @__PURE__ */ jsx("span", { children: seg.label })
@@ -60680,7 +60905,7 @@ var EventWireOverlay = ({
60680
60905
  containerW,
60681
60906
  containerH
60682
60907
  }) => {
60683
- const ids = React147__default.useMemo(() => {
60908
+ const ids = React93__default.useMemo(() => {
60684
60909
  avlOczWireId += 1;
60685
60910
  return { arrow: `avl-ocz-wire-${avlOczWireId}-arrow` };
60686
60911
  }, []);
@@ -61039,7 +61264,7 @@ var AvlOrbitalsCosmicZoom = ({
61039
61264
  borderRadius: 6,
61040
61265
  border: `1px solid ${color}`
61041
61266
  },
61042
- children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", children: breadcrumbs.map((crumb, i) => /* @__PURE__ */ jsxs(React147__default.Fragment, { children: [
61267
+ children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", children: breadcrumbs.map((crumb, i) => /* @__PURE__ */ jsxs(React93__default.Fragment, { children: [
61043
61268
  i > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", style: { opacity: 0.5, color }, children: "/" }),
61044
61269
  i < breadcrumbs.length - 1 ? /* @__PURE__ */ jsx(
61045
61270
  Box,