@almadar/ui 5.135.0 → 5.137.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.
@@ -1,9 +1,9 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
- import * as React74 from 'react';
3
- import React74__default, { createContext, useContext, useMemo, useRef, useEffect, useCallback, useState, useLayoutEffect, Suspense, useSyncExternalStore, lazy, useId } from 'react';
2
+ import * as React75 from 'react';
3
+ import React75__default, { createContext, useContext, useMemo, useRef, useEffect, useCallback, useState, useLayoutEffect, Suspense, useSyncExternalStore, lazy, useId } from 'react';
4
4
  import { clsx } from 'clsx';
5
5
  import { twMerge } from 'tailwind-merge';
6
- import { EventBusContext, useTraitScopeChain, useCurrentPagePath, useGameAudioContextOptional, useEntitySchemaOptional, TraitScopeProvider } from '@almadar/ui/providers';
6
+ import { EventBusContext, useTraitScopeChain, useCurrentPagePath, useGameAudioContextOptional, useEntitySchemaOptional, useEntityBindingSnapshot, useTraitScope, TraitScopeProvider } from '@almadar/ui/providers';
7
7
  export { GameAudioContext, GameAudioProvider, useGameAudioContext } from '@almadar/ui/providers';
8
8
  import { createLogger, isLogLevelEnabled } from '@almadar/logger';
9
9
  import * as LucideIcons2 from 'lucide-react';
@@ -11,6 +11,8 @@ import { X, List, Printer, ChevronRight, ChevronLeft, RotateCcw, Play, Terminal,
11
11
  import { useTranslate } from '@almadar/ui/hooks';
12
12
  import { useUISlots, useTheme } from '@almadar/ui/context';
13
13
  import { evaluate, createMinimalContext } from '@almadar/evaluator';
14
+ import { createContextFromBindings, interpolateValue } from '@almadar/runtime';
15
+ import { mergeEntityFrame, isInlineTrait, isRenderBindingMarker } from '@almadar/core';
14
16
  import { createPortal } from 'react-dom';
15
17
  import { wrapCallbackForEvent } from '@almadar/runtime/ui';
16
18
  import { Link, Outlet, useLocation } from 'react-router-dom';
@@ -68,10 +70,10 @@ import ReactMarkdown from 'react-markdown';
68
70
  import remarkGfm from 'remark-gfm';
69
71
  import remarkMath from 'remark-math';
70
72
  import rehypeKatex from 'rehype-katex';
71
- import { mergeEntityFrame, isInlineTrait } from '@almadar/core';
72
73
  import { DndContext, useSensors, useSensor, PointerSensor, KeyboardSensor, useDroppable, pointerWithin, rectIntersection, closestCorners } from '@dnd-kit/core';
73
74
  import { useSortable, arrayMove, sortableKeyboardCoordinates, SortableContext, rectSortingStrategy, verticalListSortingStrategy } from '@dnd-kit/sortable';
74
75
  import { CSS } from '@dnd-kit/utilities';
76
+ import { ordered, lib } from 'emojilib';
75
77
  import { useNodeId, ReactFlowProvider, Handle, Position } from '@xyflow/react';
76
78
  import { forceSimulation, forceLink, forceManyBody, forceCollide, forceX, forceY } from 'd3-force';
77
79
  import { isDrawHostPattern, getPatternDefinition as getPatternDefinition$1, getComponentForPattern as getComponentForPattern$1 } from '@almadar/core/patterns';
@@ -260,7 +262,7 @@ var init_SvgFlow = __esm({
260
262
  width = 100,
261
263
  height = 100
262
264
  }) => {
263
- const markerId = React74__default.useMemo(() => {
265
+ const markerId = React75__default.useMemo(() => {
264
266
  flowIdCounter += 1;
265
267
  return `almadar-flow-arrow-${flowIdCounter}`;
266
268
  }, []);
@@ -853,7 +855,7 @@ var init_SvgRing = __esm({
853
855
  width = 100,
854
856
  height = 100
855
857
  }) => {
856
- const gradientId = React74__default.useMemo(() => {
858
+ const gradientId = React75__default.useMemo(() => {
857
859
  ringIdCounter += 1;
858
860
  return `almadar-ring-glow-${ringIdCounter}`;
859
861
  }, []);
@@ -1395,7 +1397,7 @@ var init_Icon = __esm({
1395
1397
  const effectiveName = typeof icon === "string" && icon !== "" ? icon : name;
1396
1398
  const effectiveStrokeWidth = strokeWidth != null && strokeWidth > 0 ? strokeWidth : void 0;
1397
1399
  const family = useIconFamily();
1398
- const RenderedComponent = React74__default.useMemo(() => {
1400
+ const RenderedComponent = React75__default.useMemo(() => {
1399
1401
  if (directIcon) return null;
1400
1402
  return effectiveName ? resolveIconForFamily(effectiveName) : null;
1401
1403
  }, [directIcon, effectiveName, family]);
@@ -1457,9 +1459,13 @@ function getAtlas(url, onReady) {
1457
1459
  onReady();
1458
1460
  }).catch(() => {
1459
1461
  atlasCache.set(url, null);
1462
+ onReady();
1460
1463
  });
1461
1464
  return void 0;
1462
1465
  }
1466
+ function atlasFailed(url) {
1467
+ return atlasCache.get(url) === null;
1468
+ }
1463
1469
  function subRectFor(atlas, sprite) {
1464
1470
  if (isTilesheet(atlas)) {
1465
1471
  let col;
@@ -1515,7 +1521,7 @@ var init_atlasSlice = __esm({
1515
1521
  }
1516
1522
  });
1517
1523
  function useAtlasSliceDataUrl(asset) {
1518
- const [, bump] = React74.useReducer((x) => x + 1, 0);
1524
+ const [, bump] = React75.useReducer((x) => x + 1, 0);
1519
1525
  if (!isAtlasAsset(asset)) return void 0;
1520
1526
  const key = `${asset.atlas}#${asset.sprite}`;
1521
1527
  const cached = sliceDataUrlCache.get(key);
@@ -1578,13 +1584,13 @@ function AtlasImage({
1578
1584
  style,
1579
1585
  "aria-hidden": ariaHidden
1580
1586
  }) {
1581
- const [, bump] = React74.useReducer((x) => x + 1, 0);
1582
- const canvasRef = React74.useRef(null);
1587
+ const [, bump] = React75.useReducer((x) => x + 1, 0);
1588
+ const canvasRef = React75.useRef(null);
1583
1589
  const sliced = isAtlasAsset(asset);
1584
1590
  const atlas = sliced ? getAtlas(asset.atlas, bump) : void 0;
1585
1591
  const img = sliced && asset?.url ? getSheetImage(asset.url, bump) : null;
1586
1592
  const rect = sliced && atlas ? subRectFor(atlas, asset.sprite) : null;
1587
- React74.useEffect(() => {
1593
+ React75.useEffect(() => {
1588
1594
  const canvas = canvasRef.current;
1589
1595
  if (!canvas || !img || !rect) return;
1590
1596
  canvas.width = rect.sw;
@@ -1660,7 +1666,7 @@ function resolveIconProp(value, sizeClass) {
1660
1666
  const IconComp = value;
1661
1667
  return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
1662
1668
  }
1663
- if (React74__default.isValidElement(value)) {
1669
+ if (React75__default.isValidElement(value)) {
1664
1670
  return value;
1665
1671
  }
1666
1672
  if (typeof value === "object" && value !== null && isIconLike(value)) {
@@ -1737,7 +1743,7 @@ var init_Button = __esm({
1737
1743
  md: "h-icon-default w-icon-default",
1738
1744
  lg: "h-icon-default w-icon-default"
1739
1745
  };
1740
- Button = React74__default.forwardRef(
1746
+ Button = React75__default.forwardRef(
1741
1747
  ({
1742
1748
  className,
1743
1749
  variant = "primary",
@@ -1809,7 +1815,7 @@ var init_Input = __esm({
1809
1815
  init_cn();
1810
1816
  init_Icon();
1811
1817
  init_useEventBus();
1812
- Input = React74__default.forwardRef(
1818
+ Input = React75__default.forwardRef(
1813
1819
  ({
1814
1820
  className,
1815
1821
  inputType,
@@ -1832,6 +1838,20 @@ var init_Input = __esm({
1832
1838
  const { t } = useTranslate();
1833
1839
  const eventBus = useEventBus();
1834
1840
  const type = inputType || htmlType || "text";
1841
+ const isDeclarative = typeof onChange === "string";
1842
+ const [localValue, setLocalValue] = React75__default.useState(value);
1843
+ const pendingEchoRef = React75__default.useRef(/* @__PURE__ */ new Set());
1844
+ React75__default.useEffect(() => {
1845
+ if (!isDeclarative) return;
1846
+ const incoming = value == null ? "" : String(value);
1847
+ if (pendingEchoRef.current.has(incoming)) {
1848
+ pendingEchoRef.current.delete(incoming);
1849
+ return;
1850
+ }
1851
+ pendingEchoRef.current.clear();
1852
+ setLocalValue(value);
1853
+ }, [value, isDeclarative]);
1854
+ const displayValue = isDeclarative ? localValue : value;
1835
1855
  const resolveIconNode = (i, cls) => {
1836
1856
  if (!i) return null;
1837
1857
  if (typeof i === "string") return /* @__PURE__ */ jsx(Icon, { name: i, className: cls });
@@ -1841,7 +1861,7 @@ var init_Input = __esm({
1841
1861
  const iconCls = "h-icon-default w-icon-default";
1842
1862
  const IconComponent = typeof iconProp === "string" ? resolveIcon(iconProp) : iconProp;
1843
1863
  const resolvedLeftIcon = (leftIcon ? resolveIconNode(leftIcon, iconCls) : null) || IconComponent && /* @__PURE__ */ jsx(IconComponent, { className: iconCls });
1844
- const showClearButton = clearable && value && String(value).length > 0;
1864
+ const showClearButton = clearable && displayValue && String(displayValue).length > 0;
1845
1865
  const isMultiline = type === "textarea";
1846
1866
  const baseClassName = cn(
1847
1867
  "block w-full rounded-sm transition-all duration-fast",
@@ -1860,6 +1880,10 @@ var init_Input = __esm({
1860
1880
  if (typeof onChange === "string") {
1861
1881
  const target = e.target;
1862
1882
  const payload = type === "checkbox" ? { checked: target.checked } : { value: target.value };
1883
+ if (type !== "checkbox") {
1884
+ pendingEchoRef.current.add(target.value);
1885
+ setLocalValue(target.value);
1886
+ }
1863
1887
  eventBus.emit(`UI:${onChange}`, payload);
1864
1888
  } else {
1865
1889
  onChange?.(e);
@@ -1890,7 +1914,7 @@ var init_Input = __esm({
1890
1914
  "select",
1891
1915
  {
1892
1916
  ref,
1893
- value,
1917
+ value: displayValue,
1894
1918
  onChange: handleChange,
1895
1919
  className: cn(baseClassName, "appearance-none pr-10", className),
1896
1920
  ...props,
@@ -1910,7 +1934,7 @@ var init_Input = __esm({
1910
1934
  "textarea",
1911
1935
  {
1912
1936
  ref,
1913
- value,
1937
+ value: displayValue,
1914
1938
  onChange: handleChange,
1915
1939
  rows: rows2,
1916
1940
  className: baseClassName,
@@ -1949,7 +1973,7 @@ var init_Input = __esm({
1949
1973
  {
1950
1974
  ref,
1951
1975
  type,
1952
- value,
1976
+ value: displayValue,
1953
1977
  onChange: handleChange,
1954
1978
  onKeyDown: handleKeyDown,
1955
1979
  className: baseClassName,
@@ -1977,7 +2001,7 @@ var Label;
1977
2001
  var init_Label = __esm({
1978
2002
  "components/core/atoms/Label.tsx"() {
1979
2003
  init_cn();
1980
- Label = React74__default.forwardRef(
2004
+ Label = React75__default.forwardRef(
1981
2005
  ({ className, required, children, ...props }, ref) => {
1982
2006
  return /* @__PURE__ */ jsxs(
1983
2007
  "label",
@@ -2004,7 +2028,7 @@ var init_Textarea = __esm({
2004
2028
  "components/core/atoms/Textarea.tsx"() {
2005
2029
  init_cn();
2006
2030
  init_useEventBus();
2007
- Textarea = React74__default.forwardRef(
2031
+ Textarea = React75__default.forwardRef(
2008
2032
  ({ className, error, onChange, ...props }, ref) => {
2009
2033
  const eventBus = useEventBus();
2010
2034
  const handleChange = (e) => {
@@ -2243,7 +2267,7 @@ var init_Select = __esm({
2243
2267
  init_cn();
2244
2268
  init_Icon();
2245
2269
  init_useEventBus();
2246
- Select = React74__default.forwardRef(
2270
+ Select = React75__default.forwardRef(
2247
2271
  (props, _ref) => {
2248
2272
  const { multiple, searchable, clearable } = props;
2249
2273
  if (multiple || searchable || clearable) {
@@ -2260,7 +2284,7 @@ var init_Checkbox = __esm({
2260
2284
  "components/core/atoms/Checkbox.tsx"() {
2261
2285
  init_cn();
2262
2286
  init_useEventBus();
2263
- Checkbox = React74__default.forwardRef(
2287
+ Checkbox = React75__default.forwardRef(
2264
2288
  ({ className, label, id, onChange, ...props }, ref) => {
2265
2289
  const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
2266
2290
  const eventBus = useEventBus();
@@ -2314,7 +2338,7 @@ var init_Spinner = __esm({
2314
2338
  md: "h-6 w-6",
2315
2339
  lg: "h-8 w-8"
2316
2340
  };
2317
- Spinner = React74__default.forwardRef(
2341
+ Spinner = React75__default.forwardRef(
2318
2342
  ({ className, size = "md", overlay, ...props }, ref) => {
2319
2343
  if (overlay) {
2320
2344
  return /* @__PURE__ */ jsx(
@@ -2404,7 +2428,7 @@ var init_Card = __esm({
2404
2428
  chip: "shadow-none rounded-pill border-[length:var(--border-width)] border-border",
2405
2429
  "tile-image-first": "p-0 overflow-hidden"
2406
2430
  };
2407
- Card = React74__default.forwardRef(
2431
+ Card = React75__default.forwardRef(
2408
2432
  ({
2409
2433
  className,
2410
2434
  variant = "bordered",
@@ -2453,9 +2477,9 @@ var init_Card = __esm({
2453
2477
  }
2454
2478
  );
2455
2479
  Card.displayName = "Card";
2456
- CardHeader = React74__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
2480
+ CardHeader = React75__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
2457
2481
  CardHeader.displayName = "CardHeader";
2458
- CardTitle = React74__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
2482
+ CardTitle = React75__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
2459
2483
  "h3",
2460
2484
  {
2461
2485
  ref,
@@ -2468,11 +2492,11 @@ var init_Card = __esm({
2468
2492
  }
2469
2493
  ));
2470
2494
  CardTitle.displayName = "CardTitle";
2471
- CardContent = React74__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
2495
+ CardContent = React75__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
2472
2496
  CardContent.displayName = "CardContent";
2473
2497
  CardBody = CardContent;
2474
2498
  CardBody.displayName = "CardBody";
2475
- CardFooter = React74__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
2499
+ CardFooter = React75__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
2476
2500
  "div",
2477
2501
  {
2478
2502
  ref,
@@ -2526,7 +2550,7 @@ var init_Badge = __esm({
2526
2550
  md: "px-2.5 py-1 text-sm",
2527
2551
  lg: "px-3 py-1.5 text-base"
2528
2552
  };
2529
- Badge = React74__default.forwardRef(
2553
+ Badge = React75__default.forwardRef(
2530
2554
  ({ className, variant = "default", size = "sm", amount, label, icon, iconAsset, children, onRemove, removeLabel, ...props }, ref) => {
2531
2555
  const iconSizes3 = {
2532
2556
  sm: "h-icon-default w-icon-default",
@@ -2654,7 +2678,7 @@ var init_FilterPill = __esm({
2654
2678
  md: "w-3.5 h-3.5",
2655
2679
  lg: "w-4 h-4"
2656
2680
  };
2657
- FilterPill = React74__default.forwardRef(
2681
+ FilterPill = React75__default.forwardRef(
2658
2682
  ({
2659
2683
  className,
2660
2684
  variant = "default",
@@ -2783,8 +2807,8 @@ var init_Avatar = __esm({
2783
2807
  actionPayload
2784
2808
  }) => {
2785
2809
  const eventBus = useEventBus();
2786
- const [imgFailed, setImgFailed] = React74__default.useState(false);
2787
- React74__default.useEffect(() => {
2810
+ const [imgFailed, setImgFailed] = React75__default.useState(false);
2811
+ React75__default.useEffect(() => {
2788
2812
  setImgFailed(false);
2789
2813
  }, [src]);
2790
2814
  const initials = providedInitials ?? (name ? generateInitials(name) : void 0);
@@ -3036,7 +3060,7 @@ var init_Box = __esm({
3036
3060
  fixed: "fixed",
3037
3061
  sticky: "sticky"
3038
3062
  };
3039
- Box = React74__default.forwardRef(
3063
+ Box = React75__default.forwardRef(
3040
3064
  ({
3041
3065
  padding,
3042
3066
  paddingX,
@@ -3101,7 +3125,7 @@ var init_Box = __esm({
3101
3125
  onPointerDown?.(e);
3102
3126
  }, [hoverEvent, tapReveal, triggerProps, onPointerDown]);
3103
3127
  const isClickable = action || onClick;
3104
- return React74__default.createElement(
3128
+ return React75__default.createElement(
3105
3129
  Component,
3106
3130
  {
3107
3131
  ref,
@@ -3155,7 +3179,7 @@ var init_Center = __esm({
3155
3179
  as: Component = "div"
3156
3180
  }) => {
3157
3181
  const mergedStyle = minHeight ? { minHeight, ...style } : style;
3158
- return React74__default.createElement(Component, {
3182
+ return React75__default.createElement(Component, {
3159
3183
  className: cn(
3160
3184
  inline ? "inline-flex" : "flex",
3161
3185
  horizontal && "justify-center",
@@ -3423,7 +3447,7 @@ var init_Radio = __esm({
3423
3447
  md: "w-2.5 h-2.5",
3424
3448
  lg: "w-3 h-3"
3425
3449
  };
3426
- Radio = React74__default.forwardRef(
3450
+ Radio = React75__default.forwardRef(
3427
3451
  ({
3428
3452
  label,
3429
3453
  helperText,
@@ -3440,12 +3464,12 @@ var init_Radio = __esm({
3440
3464
  onChange,
3441
3465
  ...props
3442
3466
  }, ref) => {
3443
- const reactId = React74__default.useId();
3467
+ const reactId = React75__default.useId();
3444
3468
  const baseId = id || `radio-${reactId}`;
3445
3469
  const hasError = !!error;
3446
3470
  const eventBus = useEventBus();
3447
- const [selected, setSelected] = React74__default.useState(value);
3448
- React74__default.useEffect(() => {
3471
+ const [selected, setSelected] = React75__default.useState(value);
3472
+ React75__default.useEffect(() => {
3449
3473
  if (value !== void 0) setSelected(value);
3450
3474
  }, [value]);
3451
3475
  const pick = (next, e) => {
@@ -3627,7 +3651,7 @@ var init_Switch = __esm({
3627
3651
  "components/core/atoms/Switch.tsx"() {
3628
3652
  "use client";
3629
3653
  init_cn();
3630
- Switch = React74.forwardRef(
3654
+ Switch = React75.forwardRef(
3631
3655
  ({
3632
3656
  checked,
3633
3657
  defaultChecked = false,
@@ -3638,10 +3662,10 @@ var init_Switch = __esm({
3638
3662
  name,
3639
3663
  className
3640
3664
  }, ref) => {
3641
- const [isChecked, setIsChecked] = React74.useState(
3665
+ const [isChecked, setIsChecked] = React75.useState(
3642
3666
  checked !== void 0 ? checked : defaultChecked
3643
3667
  );
3644
- React74.useEffect(() => {
3668
+ React75.useEffect(() => {
3645
3669
  if (checked !== void 0) {
3646
3670
  setIsChecked(checked);
3647
3671
  }
@@ -3804,7 +3828,7 @@ var init_Stack = __esm({
3804
3828
  };
3805
3829
  const isHorizontal = direction === "horizontal";
3806
3830
  const directionClass = responsive && isHorizontal ? reverse ? "flex-col-reverse md:flex-row-reverse" : "flex-col md:flex-row" : isHorizontal ? reverse ? "flex-row-reverse" : "flex-row" : reverse ? "flex-col-reverse" : "flex-col";
3807
- return React74__default.createElement(
3831
+ return React75__default.createElement(
3808
3832
  Component,
3809
3833
  {
3810
3834
  className: cn(
@@ -4093,7 +4117,7 @@ var init_Typography = __esm({
4093
4117
  if (format !== void 0 && format !== "none" && (typeof body === "string" || typeof body === "number" || body instanceof Date)) {
4094
4118
  body = formatValue(body, format);
4095
4119
  }
4096
- return React74__default.createElement(
4120
+ return React75__default.createElement(
4097
4121
  Component,
4098
4122
  {
4099
4123
  id,
@@ -4327,7 +4351,7 @@ var Dialog;
4327
4351
  var init_Dialog = __esm({
4328
4352
  "components/core/atoms/Dialog.tsx"() {
4329
4353
  init_cn();
4330
- Dialog = React74__default.forwardRef(
4354
+ Dialog = React75__default.forwardRef(
4331
4355
  ({
4332
4356
  role = "dialog",
4333
4357
  "aria-modal": ariaModal = true,
@@ -4353,7 +4377,7 @@ var Aside;
4353
4377
  var init_Aside = __esm({
4354
4378
  "components/core/atoms/Aside.tsx"() {
4355
4379
  init_cn();
4356
- Aside = React74__default.forwardRef(
4380
+ Aside = React75__default.forwardRef(
4357
4381
  ({ className, children, ...rest }, ref) => /* @__PURE__ */ jsx("aside", { ref, className: cn(className), ...rest, children })
4358
4382
  );
4359
4383
  Aside.displayName = "Aside";
@@ -4432,9 +4456,9 @@ var init_LawReferenceTooltip = __esm({
4432
4456
  className
4433
4457
  }) => {
4434
4458
  const { t } = useTranslate();
4435
- const [isVisible, setIsVisible] = React74__default.useState(false);
4436
- const timeoutRef = React74__default.useRef(null);
4437
- const triggerRef = React74__default.useRef(null);
4459
+ const [isVisible, setIsVisible] = React75__default.useState(false);
4460
+ const timeoutRef = React75__default.useRef(null);
4461
+ const triggerRef = React75__default.useRef(null);
4438
4462
  const handleMouseEnter = () => {
4439
4463
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
4440
4464
  timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
@@ -4445,7 +4469,7 @@ var init_LawReferenceTooltip = __esm({
4445
4469
  };
4446
4470
  const { revealed, triggerProps } = useTapReveal({ refs: [triggerRef] });
4447
4471
  const open = isVisible || revealed;
4448
- React74__default.useEffect(() => {
4472
+ React75__default.useEffect(() => {
4449
4473
  return () => {
4450
4474
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
4451
4475
  };
@@ -4655,7 +4679,7 @@ var init_StatusDot = __esm({
4655
4679
  md: "w-2.5 h-2.5",
4656
4680
  lg: "w-3 h-3"
4657
4681
  };
4658
- StatusDot = React74__default.forwardRef(
4682
+ StatusDot = React75__default.forwardRef(
4659
4683
  ({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
4660
4684
  return /* @__PURE__ */ jsx(
4661
4685
  "span",
@@ -4709,7 +4733,7 @@ var init_TrendIndicator = __esm({
4709
4733
  down: "trending-down",
4710
4734
  flat: "arrow-right"
4711
4735
  };
4712
- TrendIndicator = React74__default.forwardRef(
4736
+ TrendIndicator = React75__default.forwardRef(
4713
4737
  ({
4714
4738
  className,
4715
4739
  value,
@@ -4778,7 +4802,7 @@ var init_RangeSlider = __esm({
4778
4802
  md: "w-4 h-4",
4779
4803
  lg: "w-5 h-5"
4780
4804
  };
4781
- RangeSlider = React74__default.forwardRef(
4805
+ RangeSlider = React75__default.forwardRef(
4782
4806
  ({
4783
4807
  className,
4784
4808
  min = 0,
@@ -5389,7 +5413,7 @@ var init_ContentSection = __esm({
5389
5413
  md: "py-16",
5390
5414
  lg: "py-24"
5391
5415
  };
5392
- ContentSection = React74__default.forwardRef(
5416
+ ContentSection = React75__default.forwardRef(
5393
5417
  ({ children, background = "default", padding = "lg", id, className }, ref) => {
5394
5418
  return /* @__PURE__ */ jsx(
5395
5419
  Box,
@@ -5923,7 +5947,7 @@ var init_AnimatedReveal = __esm({
5923
5947
  "scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
5924
5948
  "none": {}
5925
5949
  };
5926
- AnimatedReveal = React74__default.forwardRef(
5950
+ AnimatedReveal = React75__default.forwardRef(
5927
5951
  ({
5928
5952
  trigger = "scroll",
5929
5953
  animation = "fade-up",
@@ -6083,7 +6107,7 @@ var init_AnimatedGraphic = __esm({
6083
6107
  "components/marketing/atoms/AnimatedGraphic.tsx"() {
6084
6108
  "use client";
6085
6109
  init_cn();
6086
- AnimatedGraphic = React74__default.forwardRef(
6110
+ AnimatedGraphic = React75__default.forwardRef(
6087
6111
  ({
6088
6112
  src,
6089
6113
  svgContent,
@@ -6106,7 +6130,7 @@ var init_AnimatedGraphic = __esm({
6106
6130
  const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
6107
6131
  const resolvedSvg = svgContent ?? fetchedSvg;
6108
6132
  const prevAnimateRef = useRef(animate);
6109
- const setRef = React74__default.useCallback(
6133
+ const setRef = React75__default.useCallback(
6110
6134
  (node) => {
6111
6135
  containerRef.current = node;
6112
6136
  if (typeof ref === "function") ref(node);
@@ -6195,6 +6219,75 @@ var init_AnimatedGraphic = __esm({
6195
6219
  AnimatedGraphic.displayName = "AnimatedGraphic";
6196
6220
  }
6197
6221
  });
6222
+ function resolveMarkerExpression(expression, entity, config, state) {
6223
+ const ctx = createContextFromBindings({
6224
+ entity,
6225
+ payload: {},
6226
+ state,
6227
+ ...config !== void 0 ? { config } : {}
6228
+ });
6229
+ return interpolateValue(expression, ctx);
6230
+ }
6231
+ function isPlainObject(value) {
6232
+ if (value === null || value === void 0 || typeof value !== "object") return false;
6233
+ if (Array.isArray(value)) return false;
6234
+ if (React75__default.isValidElement(value)) return false;
6235
+ if (value instanceof Date) return false;
6236
+ if (typeof value === "function") return false;
6237
+ return true;
6238
+ }
6239
+ function walkValue(value, scopeTrait, entity, config, state) {
6240
+ if (isRenderBindingMarker(value)) {
6241
+ return { resolved: resolveMarkerExpression(value.expression, entity, config, state), changed: true };
6242
+ }
6243
+ if (Array.isArray(value)) {
6244
+ const out = [];
6245
+ let changed = false;
6246
+ for (const item of value) {
6247
+ const element = item;
6248
+ const wasMarker = isRenderBindingMarker(element);
6249
+ const { resolved, changed: itemChanged } = walkValue(element, scopeTrait, entity, config, state);
6250
+ if (wasMarker && Array.isArray(resolved)) {
6251
+ out.push(...resolved);
6252
+ changed = true;
6253
+ continue;
6254
+ }
6255
+ out.push(resolved);
6256
+ if (itemChanged) changed = true;
6257
+ }
6258
+ return changed ? { resolved: out, changed: true } : { resolved: value, changed: false };
6259
+ }
6260
+ if (isPlainObject(value)) {
6261
+ const sourceTrait = value._sourceTrait;
6262
+ if (typeof sourceTrait === "string" && sourceTrait !== scopeTrait) {
6263
+ return { resolved: value, changed: false };
6264
+ }
6265
+ const out = {};
6266
+ let changed = false;
6267
+ for (const [key, item] of Object.entries(value)) {
6268
+ const { resolved, changed: itemChanged } = walkValue(item, scopeTrait, entity, config, state);
6269
+ out[key] = resolved;
6270
+ if (itemChanged) changed = true;
6271
+ }
6272
+ return changed ? { resolved: out, changed: true } : { resolved: value, changed: false };
6273
+ }
6274
+ return { resolved: value, changed: false };
6275
+ }
6276
+ function resolveRenderBindingMarkers(props, scopeTrait, entity, config, state) {
6277
+ const out = {};
6278
+ let changed = false;
6279
+ for (const [key, value] of Object.entries(props)) {
6280
+ const { resolved, changed: propChanged } = walkValue(value, scopeTrait, entity, config, state);
6281
+ out[key] = resolved;
6282
+ if (propChanged) changed = true;
6283
+ }
6284
+ return changed ? out : props;
6285
+ }
6286
+ var init_resolve_render_bindings = __esm({
6287
+ "lib/resolve-render-bindings.ts"() {
6288
+ "use client";
6289
+ }
6290
+ });
6198
6291
  var sizeClasses6, minWidthClasses, lookStyles2, Modal;
6199
6292
  var init_Modal = __esm({
6200
6293
  "components/core/molecules/Modal.tsx"() {
@@ -6782,7 +6875,7 @@ var init_ErrorBoundary = __esm({
6782
6875
  }
6783
6876
  );
6784
6877
  };
6785
- ErrorBoundary = class extends React74__default.Component {
6878
+ ErrorBoundary = class extends React75__default.Component {
6786
6879
  constructor(props) {
6787
6880
  super(props);
6788
6881
  __publicField(this, "reset", () => {
@@ -7065,7 +7158,7 @@ var init_Container = __esm({
7065
7158
  as: Component = "div"
7066
7159
  }) => {
7067
7160
  const resolvedSize = maxWidth ?? size ?? "lg";
7068
- return React74__default.createElement(
7161
+ return React75__default.createElement(
7069
7162
  Component,
7070
7163
  {
7071
7164
  className: cn(
@@ -10429,7 +10522,7 @@ var init_CodeBlock = __esm({
10429
10522
  DIFF_STYLE_FALLBACK = { bg: "", prefix: " ", text: "text-foreground" };
10430
10523
  LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
10431
10524
  HIDDEN_LINE_NUMBERS = { display: "none" };
10432
- CodeBlock = React74__default.memo(
10525
+ CodeBlock = React75__default.memo(
10433
10526
  ({
10434
10527
  code: rawCode,
10435
10528
  language = "text",
@@ -11017,7 +11110,7 @@ var init_MarkdownContent = __esm({
11017
11110
  init_Box();
11018
11111
  init_CodeBlock();
11019
11112
  init_cn();
11020
- MarkdownContent = React74__default.memo(
11113
+ MarkdownContent = React75__default.memo(
11021
11114
  ({ content, direction = "ltr", className }) => {
11022
11115
  const { t: _t } = useTranslate();
11023
11116
  const safeContent = typeof content === "string" ? content : String(content ?? "");
@@ -12344,7 +12437,7 @@ var init_StateMachineView = __esm({
12344
12437
  style: { top: title ? 30 : 0 },
12345
12438
  children: [
12346
12439
  entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
12347
- states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React74__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
12440
+ states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React75__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
12348
12441
  StateNode,
12349
12442
  {
12350
12443
  state,
@@ -14921,12 +15014,13 @@ function MiniMap({
14921
15014
  tileAssets,
14922
15015
  unitAssets
14923
15016
  }) {
14924
- const canvasRef = React74.useRef(null);
14925
- const imgCacheRef = React74.useRef(/* @__PURE__ */ new Map());
15017
+ const canvasRef = React75.useRef(null);
15018
+ const imgCacheRef = React75.useRef(/* @__PURE__ */ new Map());
14926
15019
  function loadImg(url) {
14927
15020
  const cached = imgCacheRef.current.get(url);
14928
15021
  if (cached) return cached.complete ? cached : null;
14929
15022
  const img = new Image();
15023
+ img.crossOrigin = "anonymous";
14930
15024
  img.src = url;
14931
15025
  img.onload = () => {
14932
15026
  const canvas = canvasRef.current;
@@ -14937,7 +15031,7 @@ function MiniMap({
14937
15031
  imgCacheRef.current.set(url, img);
14938
15032
  return null;
14939
15033
  }
14940
- React74.useEffect(() => {
15034
+ React75.useEffect(() => {
14941
15035
  const canvas = canvasRef.current;
14942
15036
  if (!canvas) return;
14943
15037
  const ctx = canvas.getContext("2d");
@@ -15287,7 +15381,7 @@ function useCamera(initial) {
15287
15381
  const handleWheel = useCallback((e, drawFn) => {
15288
15382
  e.preventDefault();
15289
15383
  const zoomDelta = e.deltaY > 0 ? 0.9 : 1.1;
15290
- cameraRef.current.zoom = Math.max(0.5, Math.min(3, cameraRef.current.zoom * zoomDelta));
15384
+ cameraRef.current.zoom = Math.max(MIN_ZOOM, Math.min(MAX_ZOOM, cameraRef.current.zoom * zoomDelta));
15291
15385
  drawFn?.();
15292
15386
  }, []);
15293
15387
  const handlePointerDown = useCallback((e) => {
@@ -15308,7 +15402,7 @@ function useCamera(initial) {
15308
15402
  const zoomAtPoint = useCallback((factor, centerX, centerY, viewportSize, drawFn) => {
15309
15403
  const cam = cameraRef.current;
15310
15404
  const oldZoom = cam.zoom;
15311
- const newZoom = Math.max(0.5, Math.min(3, oldZoom * factor));
15405
+ const newZoom = Math.max(MIN_ZOOM, Math.min(MAX_ZOOM, oldZoom * factor));
15312
15406
  if (newZoom === oldZoom) {
15313
15407
  drawFn?.();
15314
15408
  return;
@@ -15360,9 +15454,12 @@ function useCamera(initial) {
15360
15454
  lerpToTarget
15361
15455
  };
15362
15456
  }
15457
+ var MIN_ZOOM, MAX_ZOOM;
15363
15458
  var init_useCamera = __esm({
15364
15459
  "hooks/useCamera.ts"() {
15365
15460
  "use client";
15461
+ MIN_ZOOM = 0.05;
15462
+ MAX_ZOOM = 10;
15366
15463
  }
15367
15464
  });
15368
15465
  function localPoint(canvas, clientX, clientY) {
@@ -15483,6 +15580,7 @@ function getOrLoadImage(url, onReady) {
15483
15580
  return null;
15484
15581
  }
15485
15582
  const img = new Image();
15583
+ img.crossOrigin = "anonymous";
15486
15584
  const entry = { img, status: "pending", onReady };
15487
15585
  cache.set(url, entry);
15488
15586
  updateAssetStatus(url, "pending");
@@ -15494,10 +15592,14 @@ function getOrLoadImage(url, onReady) {
15494
15592
  img.onerror = () => {
15495
15593
  entry.status = "failed";
15496
15594
  updateAssetStatus(url, "failed");
15595
+ entry.onReady?.();
15497
15596
  };
15498
15597
  img.src = url;
15499
15598
  return null;
15500
15599
  }
15600
+ function getImageStatus(url) {
15601
+ return cache.get(url)?.status;
15602
+ }
15501
15603
  var cache;
15502
15604
  var init_imageCache = __esm({
15503
15605
  "lib/imageCache.ts"() {
@@ -15635,39 +15737,39 @@ var init_webPainter2d = __esm({
15635
15737
  });
15636
15738
 
15637
15739
  // lib/isometric.ts
15638
- function isoToScreen(tileX, tileY, scale, baseOffsetX, layout = "isometric") {
15639
- const scaledTileWidth = TILE_WIDTH * scale;
15640
- const scaledFloorHeight = FLOOR_HEIGHT * scale;
15740
+ function isoToScreen(tileX, tileY, cellWidth, baseOffsetX, layout = "isometric") {
15741
+ const w = cellWidth;
15742
+ const fh = cellWidth / 2;
15641
15743
  if (layout === "hex") {
15642
- const screenX2 = tileX * scaledTileWidth + (tileY & 1) * (scaledTileWidth / 2) + baseOffsetX;
15643
- const screenY2 = tileY * (scaledFloorHeight * 0.75);
15744
+ const screenX2 = tileX * w + (tileY & 1) * (w / 2) + baseOffsetX;
15745
+ const screenY2 = tileY * (fh * 0.75);
15644
15746
  return { x: screenX2, y: screenY2 };
15645
15747
  }
15646
15748
  if (layout === "flat") {
15647
- const screenX2 = tileX * scaledTileWidth + baseOffsetX;
15648
- const screenY2 = tileY * scaledTileWidth;
15749
+ const screenX2 = tileX * w + baseOffsetX;
15750
+ const screenY2 = tileY * w;
15649
15751
  return { x: screenX2, y: screenY2 };
15650
15752
  }
15651
- const screenX = (tileX - tileY) * (scaledTileWidth / 2) + baseOffsetX;
15652
- const screenY = (tileX + tileY) * (scaledFloorHeight / 2);
15753
+ const screenX = (tileX - tileY) * (w / 2) + baseOffsetX;
15754
+ const screenY = (tileX + tileY) * (fh / 2);
15653
15755
  return { x: screenX, y: screenY };
15654
15756
  }
15655
- function screenToIso(screenX, screenY, scale, baseOffsetX, layout = "isometric") {
15656
- const scaledTileWidth = TILE_WIDTH * scale;
15657
- const scaledFloorHeight = FLOOR_HEIGHT * scale;
15757
+ function screenToIso(screenX, screenY, cellWidth, baseOffsetX, layout = "isometric") {
15758
+ const w = cellWidth;
15759
+ const fh = cellWidth / 2;
15658
15760
  if (layout === "hex") {
15659
- const row = Math.round(screenY / (scaledFloorHeight * 0.75));
15660
- const col = Math.round((screenX - (row & 1) * (scaledTileWidth / 2) - baseOffsetX) / scaledTileWidth);
15761
+ const row = Math.round(screenY / (fh * 0.75));
15762
+ const col = Math.round((screenX - (row & 1) * (w / 2) - baseOffsetX) / w);
15661
15763
  return { x: col, y: row };
15662
15764
  }
15663
15765
  if (layout === "flat") {
15664
- const col = Math.round((screenX - baseOffsetX) / scaledTileWidth);
15665
- const row = Math.round(screenY / scaledTileWidth);
15766
+ const col = Math.round((screenX - baseOffsetX) / w);
15767
+ const row = Math.round(screenY / w);
15666
15768
  return { x: col, y: row };
15667
15769
  }
15668
15770
  const adjustedX = screenX - baseOffsetX;
15669
- const tileX = (adjustedX / (scaledTileWidth / 2) + screenY / (scaledFloorHeight / 2)) / 2;
15670
- const tileY = (screenY / (scaledFloorHeight / 2) - adjustedX / (scaledTileWidth / 2)) / 2;
15771
+ const tileX = (adjustedX / (w / 2) + screenY / (fh / 2)) / 2;
15772
+ const tileY = (screenY / (fh / 2) - adjustedX / (w / 2)) / 2;
15671
15773
  return { x: Math.round(tileX), y: Math.round(tileY) };
15672
15774
  }
15673
15775
  var TILE_WIDTH, TILE_HEIGHT, FLOOR_HEIGHT, DIAMOND_TOP_Y, FEATURE_COLORS, BACKGROUND_FALLBACK_COLOR, MINIMAP_TERRAIN_COLORS;
@@ -15698,12 +15800,13 @@ var init_isometric = __esm({
15698
15800
 
15699
15801
  // lib/drawable/projector.ts
15700
15802
  function create2DProjector(opts) {
15701
- const { scale, baseOffsetX, layout } = opts;
15702
- const tileWidth = layout === "free" ? 1 : TILE_WIDTH * scale;
15703
- const floorHeight = layout === "free" ? 1 : FLOOR_HEIGHT * scale;
15704
- const diamondTopY = layout === "free" ? 0 : (opts.diamondTopY ?? DIAMOND_TOP_Y) * scale;
15803
+ const { baseOffsetX, layout } = opts;
15804
+ const tw = opts.tileWidth ?? TILE_WIDTH;
15805
+ const tileWidth = layout === "free" ? 1 : tw;
15806
+ const floorHeight = layout === "free" ? 1 : tw / 2;
15807
+ const diamondTopY = layout === "free" ? 0 : opts.diamondTopY ?? tw * (DIAMOND_TOP_Y / TILE_WIDTH);
15705
15808
  const squareGrid = layout === "flat" || layout === "free";
15706
- const project = (pos) => layout === "free" ? { x: pos.x, y: pos.y } : isoToScreen(pos.x, pos.y, scale, baseOffsetX, layout);
15809
+ const project = (pos) => layout === "free" ? { x: pos.x, y: pos.y } : isoToScreen(pos.x, pos.y, tw, baseOffsetX, layout);
15707
15810
  const anchorPoint = (pos, anchor) => {
15708
15811
  const base = project(pos);
15709
15812
  if (anchor === "top-left") return base;
@@ -15734,7 +15837,7 @@ function create2DProjector(opts) {
15734
15837
  { x: base.x, y: topY + floorHeight / 2 }
15735
15838
  ];
15736
15839
  };
15737
- return { project, anchorPoint, cellPath, tileWidth, floorHeight, diamondTopY, scale, squareGrid };
15840
+ return { project, anchorPoint, cellPath, tileWidth, floorHeight, diamondTopY, squareGrid, worldPixelDirect: layout === "free" };
15738
15841
  }
15739
15842
  var init_projector = __esm({
15740
15843
  "lib/drawable/projector.ts"() {
@@ -15750,32 +15853,67 @@ var init_contract = __esm({
15750
15853
  "lib/drawable/contract.ts"() {
15751
15854
  }
15752
15855
  });
15753
-
15754
- // components/game/atoms/DrawSprite.tsx
15856
+ function warnMissingOnce(reason, node) {
15857
+ const key = `${reason}:${node.asset.url}:${String(node.asset.atlas)}:${String(node.asset.sprite)}`;
15858
+ if (loggedMissing.has(key)) return;
15859
+ loggedMissing.add(key);
15860
+ spriteLog.warn("draw-sprite asset unresolvable \u2014 painting fallback square", { reason, url: node.asset.url, atlas: node.asset.atlas, sprite: node.asset.sprite });
15861
+ }
15862
+ function paintFallbackSquare(painter, node, dctx, reason) {
15863
+ warnMissingOnce(reason, node);
15864
+ const tw = dctx.projector.tileWidth;
15865
+ const natural = dctx.projector.worldPixelDirect ? FALLBACK_WORLD_PX : tw;
15866
+ const w = node.width !== void 0 ? node.width * tw : natural;
15867
+ const h = node.height !== void 0 ? node.height * tw : natural;
15868
+ const anchor = node.anchor ?? "top-left";
15869
+ const p = dctx.projector.anchorPoint(node.position, anchor);
15870
+ const dx = anchor === "top-left" ? p.x : p.x - w / 2;
15871
+ const dy = anchor === "ground" ? p.y - h : anchor === "center" ? p.y - h / 2 : p.y;
15872
+ painter.save();
15873
+ if (node.opacity !== void 0 && node.opacity !== 1) painter.setAlpha(node.opacity);
15874
+ painter.fillRect(dx, dy, w, h, "#9b8f7f");
15875
+ painter.strokeRect(dx, dy, w, h, "#5e564b", Math.max(1, tw / 32));
15876
+ painter.restore();
15877
+ }
15755
15878
  function DrawSprite(_props) {
15756
15879
  return null;
15757
15880
  }
15758
- var paintSprite;
15881
+ var spriteLog, loggedMissing, FALLBACK_WORLD_PX, paintSprite;
15759
15882
  var init_DrawSprite = __esm({
15760
15883
  "components/game/atoms/DrawSprite.tsx"() {
15761
15884
  "use client";
15762
15885
  init_atlasSlice();
15886
+ init_imageCache();
15763
15887
  init_contract();
15888
+ spriteLog = createLogger("almadar:ui:draw-sprite");
15889
+ loggedMissing = /* @__PURE__ */ new Set();
15890
+ FALLBACK_WORLD_PX = 32;
15764
15891
  paintSprite = (painter, node, dctx) => {
15765
15892
  if (!node.asset?.url || !isValidScenePos(node.position)) return;
15766
15893
  const tex = painter.resolveTexture(node.asset.url);
15767
- if (!tex) return;
15894
+ if (!tex) {
15895
+ if (getImageStatus(node.asset.url) === "failed") paintFallbackSquare(painter, node, dctx, "texture-failed");
15896
+ return;
15897
+ }
15768
15898
  let src = typeof node.frame === "object" ? node.frame : void 0;
15769
15899
  if (!src && isAtlasAsset(node.asset)) {
15770
15900
  const atlas = getAtlas(node.asset.atlas, dctx.invalidate);
15771
- if (!atlas) return;
15901
+ if (!atlas) {
15902
+ if (atlasFailed(node.asset.atlas)) paintFallbackSquare(painter, node, dctx, "atlas-failed");
15903
+ return;
15904
+ }
15772
15905
  const r = subRectFor(atlas, node.asset.sprite);
15773
- if (!r) return;
15906
+ if (!r) {
15907
+ paintFallbackSquare(painter, node, dctx, "sprite-missing");
15908
+ return;
15909
+ }
15774
15910
  src = { x: r.sx, y: r.sy, w: r.sw, h: r.sh };
15775
15911
  }
15776
15912
  const tw = dctx.projector.tileWidth;
15777
- const w = node.width !== void 0 ? node.width * tw : src ? src.w : tex.width;
15778
- const h = node.height !== void 0 ? node.height * tw : src ? src.h : tex.height;
15913
+ const fallbackW = dctx.projector.worldPixelDirect ? src ? src.w : tex.width : tw;
15914
+ const fallbackH = dctx.projector.worldPixelDirect ? src ? src.h : tex.height : tw;
15915
+ const w = node.width !== void 0 ? node.width * tw : fallbackW;
15916
+ const h = node.height !== void 0 ? node.height * tw : fallbackH;
15779
15917
  const anchor = node.anchor ?? "top-left";
15780
15918
  const p = dctx.projector.anchorPoint(node.position, anchor);
15781
15919
  const dx = anchor === "top-left" ? p.x : p.x - w / 2;
@@ -16041,6 +16179,8 @@ function Canvas2D({
16041
16179
  keyUpMap,
16042
16180
  camera = "pan-zoom",
16043
16181
  scale = 0.4,
16182
+ tileWidth,
16183
+ fit = false,
16044
16184
  showMinimap = true,
16045
16185
  followTarget,
16046
16186
  cameraPos,
@@ -16083,9 +16223,32 @@ function Canvas2D({
16083
16223
  observer2.observe(el);
16084
16224
  return () => observer2.disconnect();
16085
16225
  }, []);
16086
- const scaledTileWidth = TILE_WIDTH * scale;
16087
- const scaledFloorHeight = FLOOR_HEIGHT * scale;
16088
- const scaledDiamondTopY = DIAMOND_TOP_Y * scale;
16226
+ const [atlasVersion, setAtlasVersion] = useState(0);
16227
+ const bumpAtlas = useCallback(() => setAtlasVersion((v) => v + 1), []);
16228
+ const detectedTileWidth = useMemo(() => {
16229
+ for (const n of drawables ?? []) {
16230
+ const refs = [];
16231
+ if (n.type === "draw-sprite") refs.push(n.asset);
16232
+ else if (n.type === "draw-sprite-layer") for (const it of n.items) refs.push(it.asset);
16233
+ for (const a of refs) {
16234
+ if (a && isAtlasAsset(a) && a.atlas) {
16235
+ const atlas = getAtlas(a.atlas, bumpAtlas);
16236
+ if (atlas) {
16237
+ if ("tileWidth" in atlas) return atlas.tileWidth;
16238
+ if ("subTextures" in atlas) {
16239
+ const first = Object.values(atlas.subTextures)[0];
16240
+ if (first && typeof first.width === "number") return first.width;
16241
+ }
16242
+ }
16243
+ }
16244
+ }
16245
+ }
16246
+ return void 0;
16247
+ }, [drawables, atlasVersion]);
16248
+ const nativeTileW = tileWidth ?? detectedTileWidth ?? TILE_WIDTH;
16249
+ const scaledTileWidth = nativeTileW;
16250
+ const scaledFloorHeight = nativeTileW / 2;
16251
+ const scaledDiamondTopY = nativeTileW * (DIAMOND_TOP_Y / TILE_WIDTH);
16089
16252
  const drawnItems = useMemo(() => collectDrawnItems(drawables ?? []), [drawables]);
16090
16253
  const scenePositions = useMemo(() => drawnItems.map((i) => i.pos), [drawnItems]);
16091
16254
  const hitIndex = useMemo(() => buildHitIndex(drawnItems), [drawnItems]);
@@ -16099,18 +16262,45 @@ function Canvas2D({
16099
16262
  }
16100
16263
  return { width: maxX + 1, height: maxY + 1 };
16101
16264
  }, [scenePositions]);
16265
+ const defaultGridFocus = useMemo(() => {
16266
+ if (isFree || projection === "side") return void 0;
16267
+ if (gridExtent.width < 2 || gridExtent.height < 2) return void 0;
16268
+ return { x: (gridExtent.width - 1) / 2, y: (gridExtent.height - 1) / 2 };
16269
+ }, [isFree, projection, gridExtent]);
16102
16270
  const baseOffsetX = useMemo(() => {
16103
16271
  if (isFree || projection === "flat" || projection === "side") return 0;
16104
16272
  return (gridExtent.height - 1) * (scaledTileWidth / 2);
16105
16273
  }, [isFree, projection, gridExtent.height, scaledTileWidth]);
16274
+ const effectiveZoom = useMemo(() => {
16275
+ if (isFree || projection === "side") return scale;
16276
+ if (!fit) {
16277
+ const z2 = TILE_WIDTH * scale * scale / nativeTileW;
16278
+ return Number.isFinite(z2) && z2 > 0 ? z2 : scale;
16279
+ }
16280
+ if (!viewportSize.width || gridExtent.width < 2 || gridExtent.height < 2) return scale;
16281
+ let boardW;
16282
+ let boardH;
16283
+ if (projection === "flat") {
16284
+ boardW = gridExtent.width * nativeTileW;
16285
+ boardH = gridExtent.height * nativeTileW;
16286
+ } else if (projection === "hex") {
16287
+ boardW = (gridExtent.width + 0.5) * nativeTileW;
16288
+ boardH = gridExtent.height * (nativeTileW / 2) * 0.75 + nativeTileW / 2;
16289
+ } else {
16290
+ boardW = (gridExtent.width + gridExtent.height) * (nativeTileW / 2);
16291
+ boardH = (gridExtent.width + gridExtent.height) * (nativeTileW / 4);
16292
+ }
16293
+ const z = Math.min(viewportSize.width * 0.85 / boardW, viewportSize.height * 0.85 / boardH);
16294
+ return Number.isFinite(z) && z > 0 ? z : scale;
16295
+ }, [isFree, projection, fit, viewportSize, gridExtent, nativeTileW, scale]);
16106
16296
  const projector = useMemo(
16107
- () => create2DProjector({ scale, baseOffsetX, layout }),
16108
- [scale, baseOffsetX, layout]
16297
+ () => create2DProjector({ tileWidth: nativeTileW, baseOffsetX, layout }),
16298
+ [nativeTileW, baseOffsetX, layout]
16109
16299
  );
16110
16300
  const unproject = useCallback((screenX, screenY) => {
16111
16301
  if (projection === "free" || projection === "side") return { x: Math.round(screenX), y: Math.round(screenY) };
16112
- return screenToIso(screenX, screenY, scale, baseOffsetX, projection);
16113
- }, [projection, scale, baseOffsetX]);
16302
+ return screenToIso(screenX, screenY, nativeTileW, baseOffsetX, projection);
16303
+ }, [projection, nativeTileW, baseOffsetX]);
16114
16304
  const bgUrls = useMemo(() => backgroundImage ? [backgroundImage.url] : [], [backgroundImage]);
16115
16305
  const { getImage, pendingCount: _imagePendingCount } = useImageCache(bgUrls);
16116
16306
  useEffect(() => {
@@ -16137,9 +16327,7 @@ function Canvas2D({
16137
16327
  zoomAtPoint,
16138
16328
  screenToWorld,
16139
16329
  lerpToTarget
16140
- } = useCamera({ zoom: scale });
16141
- const [atlasVersion, setAtlasVersion] = useState(0);
16142
- const bumpAtlas = useCallback(() => setAtlasVersion((v) => v + 1), []);
16330
+ } = useCamera({ zoom: effectiveZoom });
16143
16331
  const miniMapTiles = useMemo(() => {
16144
16332
  if (!showMinimap) return [];
16145
16333
  const color = MINIMAP_TERRAIN_COLORS.default;
@@ -16183,10 +16371,13 @@ function Canvas2D({
16183
16371
  }
16184
16372
  if (!drawables || drawables.length === 0) return;
16185
16373
  const cam = cameraRef.current;
16186
- if (cameraPos && dragDistance() === 0) {
16187
- const p = projector.anchorPoint(cameraPos, "center");
16188
- cam.x = p.x - viewportSize.width / 2;
16189
- cam.y = p.y - viewportSize.height / 2;
16374
+ if (camera !== "follow" && dragDistance() === 0) {
16375
+ const focus = cameraPos ?? defaultGridFocus;
16376
+ if (focus) {
16377
+ const p = projector.anchorPoint(focus, "center");
16378
+ cam.x = p.x - viewportSize.width / 2;
16379
+ cam.y = p.y - viewportSize.height / 2;
16380
+ }
16190
16381
  }
16191
16382
  const containerRect = containerRef.current?.getBoundingClientRect();
16192
16383
  const canvasRect = canvas.getBoundingClientRect();
@@ -16199,7 +16390,7 @@ function Canvas2D({
16199
16390
  const dctx = { projector, time: 0, invalidate: bumpAtlas };
16200
16391
  for (const node of drawables) paintDrawable(painter, node, dctx);
16201
16392
  painter.restore();
16202
- }, [viewportSize, backgroundImage, bgColor, drawables, projector, cameraRef, bumpAtlas, getImage]);
16393
+ }, [viewportSize, backgroundImage, bgColor, drawables, projector, cameraRef, bumpAtlas, getImage, cameraPos, defaultGridFocus, camera, dragDistance]);
16203
16394
  useEffect(() => {
16204
16395
  if (camera !== "follow" || !followTarget) return;
16205
16396
  const p = projector.anchorPoint(followTarget, "center");
@@ -16214,6 +16405,13 @@ function Canvas2D({
16214
16405
  useEffect(() => {
16215
16406
  draw();
16216
16407
  }, [_imagePendingCount, draw]);
16408
+ const userZoomedRef = useRef(false);
16409
+ useEffect(() => {
16410
+ if (userZoomedRef.current) return;
16411
+ if (cameraRef.current.zoom === effectiveZoom) return;
16412
+ cameraRef.current.zoom = effectiveZoom;
16413
+ draw();
16414
+ }, [effectiveZoom, cameraRef, draw]);
16217
16415
  useEffect(() => {
16218
16416
  draw();
16219
16417
  }, [atlasVersion, draw]);
@@ -16270,7 +16468,9 @@ function Canvas2D({
16270
16468
  if (tileLeaveEvent) eventBus.emit(`UI:${tileLeaveEvent}`, {});
16271
16469
  }, [handleMouseLeave, tileLeaveEvent, eventBus]);
16272
16470
  const applyZoom = useCallback((factor, centerX, centerY) => {
16273
- if (enableCamera) zoomAtPoint(factor, centerX, centerY, viewportSize, () => draw());
16471
+ if (!enableCamera) return;
16472
+ userZoomedRef.current = true;
16473
+ zoomAtPoint(factor, centerX, centerY, viewportSize, () => draw());
16274
16474
  }, [enableCamera, zoomAtPoint, viewportSize, draw]);
16275
16475
  const applyPanDelta = useCallback((dx, dy) => {
16276
16476
  if (enableCamera) panBy(dx, dy, () => draw());
@@ -16455,6 +16655,8 @@ function Canvas({
16455
16655
  isLoading,
16456
16656
  unitScale,
16457
16657
  showMinimap,
16658
+ fit,
16659
+ tileWidth,
16458
16660
  backgroundImage,
16459
16661
  backgroundColor,
16460
16662
  worldWidth,
@@ -16512,6 +16714,8 @@ function Canvas({
16512
16714
  projection,
16513
16715
  camera: to2DCamera(camera?.mode),
16514
16716
  ...zoom !== void 0 ? { scale: zoom } : {},
16717
+ ...fit !== void 0 ? { fit } : {},
16718
+ ...tileWidth !== void 0 ? { tileWidth } : {},
16515
16719
  ...camera?.target !== void 0 ? { followTarget: camera.target } : {},
16516
16720
  ...camera?.pos !== void 0 ? { cameraPos: camera.pos } : {},
16517
16721
  showMinimap,
@@ -18805,9 +19009,9 @@ function ControlButton({
18805
19009
  className
18806
19010
  }) {
18807
19011
  const eventBus = useEventBus();
18808
- const [isPressed, setIsPressed] = React74.useState(false);
19012
+ const [isPressed, setIsPressed] = React75.useState(false);
18809
19013
  const actualPressed = pressed ?? isPressed;
18810
- const handlePointerDown = React74.useCallback(
19014
+ const handlePointerDown = React75.useCallback(
18811
19015
  (e) => {
18812
19016
  e.preventDefault();
18813
19017
  if (disabled) return;
@@ -18817,7 +19021,7 @@ function ControlButton({
18817
19021
  },
18818
19022
  [disabled, pressEvent, eventBus, onPress]
18819
19023
  );
18820
- const handlePointerUp = React74.useCallback(
19024
+ const handlePointerUp = React75.useCallback(
18821
19025
  (e) => {
18822
19026
  e.preventDefault();
18823
19027
  if (disabled) return;
@@ -18827,7 +19031,7 @@ function ControlButton({
18827
19031
  },
18828
19032
  [disabled, releaseEvent, eventBus, onRelease]
18829
19033
  );
18830
- const handlePointerLeave = React74.useCallback(
19034
+ const handlePointerLeave = React75.useCallback(
18831
19035
  (e) => {
18832
19036
  if (isPressed) {
18833
19037
  setIsPressed(false);
@@ -18915,8 +19119,8 @@ function ControlGrid({
18915
19119
  className
18916
19120
  }) {
18917
19121
  const eventBus = useEventBus();
18918
- const [active, setActive] = React74.useState(/* @__PURE__ */ new Set());
18919
- const handlePress = React74.useCallback(
19122
+ const [active, setActive] = React75.useState(/* @__PURE__ */ new Set());
19123
+ const handlePress = React75.useCallback(
18920
19124
  (id) => {
18921
19125
  setActive((prev) => new Set(prev).add(id));
18922
19126
  if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
@@ -18930,7 +19134,7 @@ function ControlGrid({
18930
19134
  },
18931
19135
  [kind, actionEvent, directionEvent, directionEvents, eventBus, onAction, onDirection]
18932
19136
  );
18933
- const handleRelease = React74.useCallback(
19137
+ const handleRelease = React75.useCallback(
18934
19138
  (id) => {
18935
19139
  setActive((prev) => {
18936
19140
  const next = new Set(prev);
@@ -20168,8 +20372,8 @@ var init_Menu = __esm({
20168
20372
  "bottom-end": "bottom-start"
20169
20373
  };
20170
20374
  const effectivePosition = direction === "rtl" ? rtlMirror[position] ?? position : position;
20171
- const triggerChild = React74__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
20172
- const triggerElement = React74__default.cloneElement(
20375
+ const triggerChild = React75__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
20376
+ const triggerElement = React75__default.cloneElement(
20173
20377
  triggerChild,
20174
20378
  {
20175
20379
  ref: triggerRef,
@@ -20264,14 +20468,14 @@ function useDataDnd(args) {
20264
20468
  const isZone = Boolean(dragGroup || accepts || sortable);
20265
20469
  const enabled = isZone || Boolean(dndRoot);
20266
20470
  const eventBus = useEventBus();
20267
- const parentRoot = React74__default.useContext(RootCtx);
20471
+ const parentRoot = React75__default.useContext(RootCtx);
20268
20472
  const isRoot = enabled && parentRoot === null;
20269
- const zoneId = React74__default.useId();
20473
+ const zoneId = React75__default.useId();
20270
20474
  const ownGroup = dragGroup ?? accepts ?? zoneId;
20271
- const [optimisticOrders, setOptimisticOrders] = React74__default.useState(() => /* @__PURE__ */ new Map());
20272
- const optimisticOrdersRef = React74__default.useRef(optimisticOrders);
20475
+ const [optimisticOrders, setOptimisticOrders] = React75__default.useState(() => /* @__PURE__ */ new Map());
20476
+ const optimisticOrdersRef = React75__default.useRef(optimisticOrders);
20273
20477
  optimisticOrdersRef.current = optimisticOrders;
20274
- const clearOptimisticOrder = React74__default.useCallback((group) => {
20478
+ const clearOptimisticOrder = React75__default.useCallback((group) => {
20275
20479
  setOptimisticOrders((prev) => {
20276
20480
  if (!prev.has(group)) return prev;
20277
20481
  const next = new Map(prev);
@@ -20296,7 +20500,7 @@ function useDataDnd(args) {
20296
20500
  const raw = it[dndItemIdField];
20297
20501
  return raw != null ? String(raw) : `__idx_${idx}`;
20298
20502
  }).join("|");
20299
- const itemIds = React74__default.useMemo(
20503
+ const itemIds = React75__default.useMemo(
20300
20504
  () => orderedItems.map((it, idx) => {
20301
20505
  const raw = it[dndItemIdField];
20302
20506
  return raw != null ? String(raw) : `__idx_${idx}`;
@@ -20307,7 +20511,7 @@ function useDataDnd(args) {
20307
20511
  const raw = it[dndItemIdField];
20308
20512
  return raw != null ? String(raw) : `__${idx}`;
20309
20513
  }).join("|");
20310
- React74__default.useEffect(() => {
20514
+ React75__default.useEffect(() => {
20311
20515
  const root = isRoot ? null : parentRoot;
20312
20516
  if (root) {
20313
20517
  root.clearOptimisticOrder(ownGroup);
@@ -20315,20 +20519,20 @@ function useDataDnd(args) {
20315
20519
  clearOptimisticOrder(ownGroup);
20316
20520
  }
20317
20521
  }, [itemsContentSig, ownGroup]);
20318
- const zonesRef = React74__default.useRef(/* @__PURE__ */ new Map());
20319
- const registerZone = React74__default.useCallback((zoneId2, meta2) => {
20522
+ const zonesRef = React75__default.useRef(/* @__PURE__ */ new Map());
20523
+ const registerZone = React75__default.useCallback((zoneId2, meta2) => {
20320
20524
  zonesRef.current.set(zoneId2, meta2);
20321
20525
  }, []);
20322
- const unregisterZone = React74__default.useCallback((zoneId2) => {
20526
+ const unregisterZone = React75__default.useCallback((zoneId2) => {
20323
20527
  zonesRef.current.delete(zoneId2);
20324
20528
  }, []);
20325
- const [activeDrag, setActiveDrag] = React74__default.useState(null);
20326
- const [overZoneGroup, setOverZoneGroup] = React74__default.useState(null);
20327
- const meta = React74__default.useMemo(
20529
+ const [activeDrag, setActiveDrag] = React75__default.useState(null);
20530
+ const [overZoneGroup, setOverZoneGroup] = React75__default.useState(null);
20531
+ const meta = React75__default.useMemo(
20328
20532
  () => ({ group: ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, rawItems: items, idField: dndItemIdField }),
20329
20533
  [ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, items, dndItemIdField]
20330
20534
  );
20331
- React74__default.useEffect(() => {
20535
+ React75__default.useEffect(() => {
20332
20536
  const target = isRoot ? null : parentRoot;
20333
20537
  if (!target) {
20334
20538
  zonesRef.current.set(zoneId, meta);
@@ -20347,7 +20551,7 @@ function useDataDnd(args) {
20347
20551
  }, [parentRoot, isRoot, zoneId, meta]);
20348
20552
  const sensors = useAlmadarDndSensors(true);
20349
20553
  const collisionDetection = almadarDndCollisionDetection;
20350
- const findZoneByItem = React74__default.useCallback(
20554
+ const findZoneByItem = React75__default.useCallback(
20351
20555
  (id) => {
20352
20556
  for (const z of zonesRef.current.values()) {
20353
20557
  if (z.itemIds.includes(id)) return z;
@@ -20356,7 +20560,7 @@ function useDataDnd(args) {
20356
20560
  },
20357
20561
  []
20358
20562
  );
20359
- React74__default.useCallback(
20563
+ React75__default.useCallback(
20360
20564
  (group) => {
20361
20565
  for (const z of zonesRef.current.values()) {
20362
20566
  if (z.group === group) return z;
@@ -20365,7 +20569,7 @@ function useDataDnd(args) {
20365
20569
  },
20366
20570
  []
20367
20571
  );
20368
- const handleDragEnd = React74__default.useCallback(
20572
+ const handleDragEnd = React75__default.useCallback(
20369
20573
  (event) => {
20370
20574
  const { active, over } = event;
20371
20575
  const activeIdStr = String(active.id);
@@ -20456,8 +20660,8 @@ function useDataDnd(args) {
20456
20660
  },
20457
20661
  [eventBus]
20458
20662
  );
20459
- const sortableData = React74__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
20460
- const SortableItem = React74__default.useCallback(
20663
+ const sortableData = React75__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
20664
+ const SortableItem = React75__default.useCallback(
20461
20665
  ({ id, children }) => {
20462
20666
  const {
20463
20667
  attributes,
@@ -20497,7 +20701,7 @@ function useDataDnd(args) {
20497
20701
  id: droppableId,
20498
20702
  data: sortableData
20499
20703
  });
20500
- const ctx = React74__default.useContext(RootCtx);
20704
+ const ctx = React75__default.useContext(RootCtx);
20501
20705
  const activeDrag2 = ctx?.activeDrag ?? null;
20502
20706
  const overZoneGroup2 = ctx?.overZoneGroup ?? null;
20503
20707
  const isThisZoneOver = overZoneGroup2 === ownGroup;
@@ -20512,7 +20716,7 @@ function useDataDnd(args) {
20512
20716
  showForeignPlaceholder,
20513
20717
  ctxAvailable: ctx != null
20514
20718
  });
20515
- React74__default.useEffect(() => {
20719
+ React75__default.useEffect(() => {
20516
20720
  dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
20517
20721
  }, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
20518
20722
  return /* @__PURE__ */ jsx(
@@ -20526,11 +20730,11 @@ function useDataDnd(args) {
20526
20730
  }
20527
20731
  );
20528
20732
  };
20529
- const rootContextValue = React74__default.useMemo(
20733
+ const rootContextValue = React75__default.useMemo(
20530
20734
  () => ({ registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder }),
20531
20735
  [registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder]
20532
20736
  );
20533
- const handleDragStart = React74__default.useCallback((event) => {
20737
+ const handleDragStart = React75__default.useCallback((event) => {
20534
20738
  const sourceZone = findZoneByItem(event.active.id);
20535
20739
  const rect = event.active.rect.current.initial;
20536
20740
  const height = rect?.height && rect.height > 0 ? rect.height : 64;
@@ -20549,7 +20753,7 @@ function useDataDnd(args) {
20549
20753
  isRoot
20550
20754
  });
20551
20755
  }, [findZoneByItem, isRoot, zoneId]);
20552
- const handleDragOver = React74__default.useCallback((event) => {
20756
+ const handleDragOver = React75__default.useCallback((event) => {
20553
20757
  const { active, over } = event;
20554
20758
  const overData = over?.data?.current;
20555
20759
  const overGroup = overData?.dndGroup ?? null;
@@ -20619,7 +20823,7 @@ function useDataDnd(args) {
20619
20823
  return next;
20620
20824
  });
20621
20825
  }, []);
20622
- const handleDragCancel = React74__default.useCallback((event) => {
20826
+ const handleDragCancel = React75__default.useCallback((event) => {
20623
20827
  setActiveDrag(null);
20624
20828
  setOverZoneGroup(null);
20625
20829
  dndLog.warn("dragCancel", {
@@ -20627,12 +20831,12 @@ function useDataDnd(args) {
20627
20831
  reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
20628
20832
  });
20629
20833
  }, []);
20630
- const handleDragEndWithCleanup = React74__default.useCallback((event) => {
20834
+ const handleDragEndWithCleanup = React75__default.useCallback((event) => {
20631
20835
  handleDragEnd(event);
20632
20836
  setActiveDrag(null);
20633
20837
  setOverZoneGroup(null);
20634
20838
  }, [handleDragEnd]);
20635
- const wrapContainer = React74__default.useCallback(
20839
+ const wrapContainer = React75__default.useCallback(
20636
20840
  (children) => {
20637
20841
  if (!enabled) return children;
20638
20842
  const strategy = layout === "grid" ? rectSortingStrategy : verticalListSortingStrategy;
@@ -20686,7 +20890,7 @@ var init_useDataDnd = __esm({
20686
20890
  init_useAlmadarDndCollision();
20687
20891
  init_Box();
20688
20892
  dndLog = createLogger("almadar:ui:dnd");
20689
- RootCtx = React74__default.createContext(null);
20893
+ RootCtx = React75__default.createContext(null);
20690
20894
  }
20691
20895
  });
20692
20896
  function renderIconInput(icon, props) {
@@ -21228,7 +21432,7 @@ function DataList({
21228
21432
  }) {
21229
21433
  const eventBus = useEventBus();
21230
21434
  const { t } = useTranslate();
21231
- const [visibleCount, setVisibleCount] = React74__default.useState(pageSize || Infinity);
21435
+ const [visibleCount, setVisibleCount] = React75__default.useState(pageSize || Infinity);
21232
21436
  const fieldDefs = fields ?? columns ?? [];
21233
21437
  const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
21234
21438
  const dnd = useDataDnd({
@@ -21244,14 +21448,14 @@ function DataList({
21244
21448
  dndRoot
21245
21449
  });
21246
21450
  const orderedData = dnd.orderedItems;
21247
- const allData = React74__default.useMemo(
21451
+ const allData = React75__default.useMemo(
21248
21452
  () => sortRows(orderedData, sortBy, sortDirection),
21249
21453
  [orderedData, sortBy, sortDirection]
21250
21454
  );
21251
21455
  const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
21252
21456
  const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
21253
21457
  const hasRenderProp = typeof children === "function";
21254
- React74__default.useEffect(() => {
21458
+ React75__default.useEffect(() => {
21255
21459
  const renderItemTypeOf = typeof schemaRenderItem;
21256
21460
  const childrenTypeOf = typeof children;
21257
21461
  if (data.length > 0 && !hasRenderProp) {
@@ -21366,7 +21570,7 @@ function DataList({
21366
21570
  return v === void 0 || v === null || v === "" ? raw : String(v);
21367
21571
  };
21368
21572
  return /* @__PURE__ */ jsxs(VStack, { gap: "sm", className: cn("py-2", className), children: [
21369
- groups2.map((group, gi) => /* @__PURE__ */ jsxs(React74__default.Fragment, { children: [
21573
+ groups2.map((group, gi) => /* @__PURE__ */ jsxs(React75__default.Fragment, { children: [
21370
21574
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
21371
21575
  group.items.map((itemData, index) => {
21372
21576
  const id = itemData.id || `${gi}-${index}`;
@@ -21402,7 +21606,11 @@ function DataList({
21402
21606
  metaFields.length > 0 && /* @__PURE__ */ jsx(HStack, { gap: "xs", className: "mt-1 flex-wrap", children: metaFields.map((f3) => {
21403
21607
  const v = getNestedValue(itemData, f3.name);
21404
21608
  if (v === void 0 || v === null || v === "") return null;
21405
- return f3.variant === "badge" ? /* @__PURE__ */ jsx(Badge, { variant: statusVariant3(String(v)), children: String(v) }, f3.name) : /* @__PURE__ */ jsx(
21609
+ return f3.variant === "badge" ? (
21610
+ // `format` applies here too — a boolean field badged
21611
+ // without it renders the raw "false" instead of "No".
21612
+ /* @__PURE__ */ jsx(Badge, { variant: statusVariant3(String(v)), children: formatValue2(v, f3.format) }, f3.name)
21613
+ ) : /* @__PURE__ */ jsx(
21406
21614
  Typography,
21407
21615
  {
21408
21616
  variant: "caption",
@@ -21514,7 +21722,7 @@ function DataList({
21514
21722
  if (val === void 0 || val === null) return null;
21515
21723
  return /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center flex-shrink-0", children: [
21516
21724
  field.icon && renderIconInput2(field.icon, { size: "xs" }),
21517
- /* @__PURE__ */ jsx(Badge, { variant: statusVariant3(String(val)), children: String(val) })
21725
+ /* @__PURE__ */ jsx(Badge, { variant: statusVariant3(String(val)), children: formatValue2(val, field.format) })
21518
21726
  ] }, field.name);
21519
21727
  })
21520
21728
  ] }),
@@ -21561,7 +21769,7 @@ function DataList({
21561
21769
  className
21562
21770
  ),
21563
21771
  children: [
21564
- groups.map((group, gi) => /* @__PURE__ */ jsxs(React74__default.Fragment, { children: [
21772
+ groups.map((group, gi) => /* @__PURE__ */ jsxs(React75__default.Fragment, { children: [
21565
21773
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
21566
21774
  group.items.map(
21567
21775
  (itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
@@ -21670,8 +21878,8 @@ function ScalarControl({
21670
21878
  }
21671
21879
  const numeric = typeof value === "number";
21672
21880
  const initial = value === null ? "" : String(value);
21673
- const [draft, setDraft] = React74__default.useState(initial);
21674
- React74__default.useEffect(() => setDraft(initial), [initial]);
21881
+ const [draft, setDraft] = React75__default.useState(initial);
21882
+ React75__default.useEffect(() => setDraft(initial), [initial]);
21675
21883
  const commit = () => {
21676
21884
  if (numeric) {
21677
21885
  const n = draft.trim() === "" ? 0 : Number(draft);
@@ -21739,8 +21947,8 @@ function Row({
21739
21947
  onRemove,
21740
21948
  readonly
21741
21949
  }) {
21742
- const [keyDraft, setKeyDraft] = React74__default.useState(rowKey);
21743
- React74__default.useEffect(() => setKeyDraft(rowKey), [rowKey]);
21950
+ const [keyDraft, setKeyDraft] = React75__default.useState(rowKey);
21951
+ React75__default.useEffect(() => setKeyDraft(rowKey), [rowKey]);
21744
21952
  const container = isObj(value) || isArr(value);
21745
21953
  return /* @__PURE__ */ jsxs(VStack, { gap: "none", className: "group w-max min-w-full", children: [
21746
21954
  /* @__PURE__ */ jsxs(HStack, { gap: "xs", align: "center", className: "py-0.5 w-max", children: [
@@ -21783,7 +21991,7 @@ function ContainerNode({
21783
21991
  depth,
21784
21992
  readonly
21785
21993
  }) {
21786
- const [open, setOpen] = React74__default.useState(depth < 2);
21994
+ const [open, setOpen] = React75__default.useState(depth < 2);
21787
21995
  const array = isArr(value);
21788
21996
  const entries = array ? value.map((v, i) => [String(i), v]) : Object.entries(value);
21789
21997
  const setObjValue = (key, next) => {
@@ -21925,7 +22133,7 @@ var init_FormSection = __esm({
21925
22133
  columns = 1,
21926
22134
  className
21927
22135
  }) => {
21928
- const [collapsed, setCollapsed] = React74__default.useState(defaultCollapsed);
22136
+ const [collapsed, setCollapsed] = React75__default.useState(defaultCollapsed);
21929
22137
  const { t } = useTranslate();
21930
22138
  const eventBus = useEventBus();
21931
22139
  const gridClass = {
@@ -21933,7 +22141,7 @@ var init_FormSection = __esm({
21933
22141
  2: "grid-cols-1 md:grid-cols-2",
21934
22142
  3: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3"
21935
22143
  }[columns];
21936
- React74__default.useCallback(() => {
22144
+ React75__default.useCallback(() => {
21937
22145
  if (collapsible) {
21938
22146
  setCollapsed((prev) => !prev);
21939
22147
  eventBus.emit("UI:TOGGLE_COLLAPSE", { collapsed: !collapsed });
@@ -22065,7 +22273,7 @@ var init_GridPicker = __esm({
22065
22273
  const needle = search.trim().toLowerCase();
22066
22274
  return items.filter((item) => {
22067
22275
  const matchesCategory = activeCategory === ALL_CATEGORY || item.category === activeCategory;
22068
- const matchesSearch = needle === "" || item.label.toLowerCase().includes(needle);
22276
+ const matchesSearch = needle === "" || item.label.toLowerCase().includes(needle) || item.keywords !== void 0 && item.keywords.some((k) => k.toLowerCase().includes(needle));
22069
22277
  return matchesCategory && matchesSearch;
22070
22278
  });
22071
22279
  }, [items, search, activeCategory]);
@@ -22341,8 +22549,8 @@ function TextLikeControl({
22341
22549
  onCommit
22342
22550
  }) {
22343
22551
  const initial = value === void 0 || value === null ? "" : String(value);
22344
- const [draft, setDraft] = React74__default.useState(initial);
22345
- React74__default.useEffect(() => setDraft(initial), [initial]);
22552
+ const [draft, setDraft] = React75__default.useState(initial);
22553
+ React75__default.useEffect(() => setDraft(initial), [initial]);
22346
22554
  const commit = () => {
22347
22555
  if (numeric) {
22348
22556
  const n = draft.trim() === "" ? 0 : Number(draft);
@@ -22527,14 +22735,14 @@ var init_NodeSlotEditor = __esm({
22527
22735
  isObj2 = (v) => v !== null && v !== void 0 && typeof v === "object" && !Array.isArray(v);
22528
22736
  NodeSlotEditor = ({ value, onChange, className }) => {
22529
22737
  const { type, props, wasArray } = normalize(value);
22530
- const patterns = React74__default.useMemo(() => {
22738
+ const patterns = React75__default.useMemo(() => {
22531
22739
  try {
22532
22740
  return [...getKnownPatterns()].sort();
22533
22741
  } catch {
22534
22742
  return [];
22535
22743
  }
22536
22744
  }, []);
22537
- const options = React74__default.useMemo(
22745
+ const options = React75__default.useMemo(
22538
22746
  () => [{ value: "", label: "\u2014 none \u2014" }, ...patterns.map((p) => ({ value: p, label: p }))],
22539
22747
  [patterns]
22540
22748
  );
@@ -22546,7 +22754,7 @@ var init_NodeSlotEditor = __esm({
22546
22754
  const pattern = { type: nextType, ...nextProps };
22547
22755
  onChange(wasArray || value === void 0 ? [pattern] : pattern);
22548
22756
  };
22549
- const schemaEntries = React74__default.useMemo(() => {
22757
+ const schemaEntries = React75__default.useMemo(() => {
22550
22758
  if (!type) return [];
22551
22759
  const def = getPatternDefinition(type);
22552
22760
  if (!def?.propsSchema) return [];
@@ -23367,7 +23575,7 @@ var init_Flex = __esm({
23367
23575
  flexStyle.flexBasis = typeof basis === "number" ? `${basis}px` : basis;
23368
23576
  }
23369
23577
  }
23370
- return React74__default.createElement(Component, {
23578
+ return React75__default.createElement(Component, {
23371
23579
  className: cn(
23372
23580
  inline ? "inline-flex" : "flex",
23373
23581
  directionStyles[direction],
@@ -23486,7 +23694,7 @@ var init_Grid = __esm({
23486
23694
  as: Component = "div"
23487
23695
  }) => {
23488
23696
  const mergedStyle = rows2 ? { gridTemplateRows: `repeat(${rows2}, minmax(0, 1fr))`, ...style } : style;
23489
- return React74__default.createElement(
23697
+ return React75__default.createElement(
23490
23698
  Component,
23491
23699
  {
23492
23700
  className: cn(
@@ -23623,9 +23831,16 @@ var init_Popover = __esm({
23623
23831
  position = "bottom",
23624
23832
  trigger = "click",
23625
23833
  showArrow = true,
23834
+ open,
23835
+ onOpenChange,
23626
23836
  className
23627
23837
  }) => {
23628
- const [isOpen, setIsOpen] = useState(false);
23838
+ const [uncontrolledOpen, setUncontrolledOpen] = useState(false);
23839
+ const isOpen = open !== void 0 ? open : uncontrolledOpen;
23840
+ const setIsOpen = (next) => {
23841
+ if (open === void 0) setUncontrolledOpen(next);
23842
+ onOpenChange?.(next);
23843
+ };
23629
23844
  const [triggerRect, setTriggerRect] = useState(null);
23630
23845
  const [popoverWidth, setPopoverWidth] = useState(0);
23631
23846
  const triggerRef = useRef(null);
@@ -23658,6 +23873,23 @@ var init_Popover = __esm({
23658
23873
  updatePosition();
23659
23874
  }
23660
23875
  }, [isOpen]);
23876
+ useEffect(() => {
23877
+ if (!isOpen) return;
23878
+ let raf = 0;
23879
+ let lastTop = Number.NaN;
23880
+ let lastLeft = Number.NaN;
23881
+ const track = () => {
23882
+ const rect = triggerRef.current?.getBoundingClientRect();
23883
+ if (rect && (rect.top !== lastTop || rect.left !== lastLeft)) {
23884
+ lastTop = rect.top;
23885
+ lastLeft = rect.left;
23886
+ updatePosition();
23887
+ }
23888
+ raf = requestAnimationFrame(track);
23889
+ };
23890
+ raf = requestAnimationFrame(track);
23891
+ return () => cancelAnimationFrame(raf);
23892
+ }, [isOpen]);
23661
23893
  useEffect(() => {
23662
23894
  if (!mounted) setPopoverWidth(0);
23663
23895
  }, [mounted]);
@@ -23694,9 +23926,9 @@ var init_Popover = __esm({
23694
23926
  onMouseLeave: handleClose,
23695
23927
  onPointerDown: tapTriggerProps.onPointerDown
23696
23928
  };
23697
- const childElement = React74__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
23929
+ const childElement = React75__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
23698
23930
  const childPointerDown = childElement.props.onPointerDown;
23699
- const triggerElement = React74__default.cloneElement(
23931
+ const triggerElement = React75__default.cloneElement(
23700
23932
  childElement,
23701
23933
  {
23702
23934
  ref: triggerRef,
@@ -24555,9 +24787,9 @@ var init_Tooltip = __esm({
24555
24787
  if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
24556
24788
  };
24557
24789
  }, []);
24558
- const triggerElement = React74__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
24790
+ const triggerElement = React75__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
24559
24791
  const childPointerDown = triggerElement.props.onPointerDown;
24560
- const trigger = React74__default.cloneElement(triggerElement, {
24792
+ const trigger = React75__default.cloneElement(triggerElement, {
24561
24793
  ref: triggerRef,
24562
24794
  onMouseEnter: handleMouseEnter,
24563
24795
  onMouseLeave: handleMouseLeave,
@@ -24647,7 +24879,7 @@ var init_WizardProgress = __esm({
24647
24879
  children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
24648
24880
  const isActive = index === currentStep;
24649
24881
  const isCompleted = index < currentStep;
24650
- return /* @__PURE__ */ jsxs(React74__default.Fragment, { children: [
24882
+ return /* @__PURE__ */ jsxs(React75__default.Fragment, { children: [
24651
24883
  /* @__PURE__ */ jsx(
24652
24884
  "button",
24653
24885
  {
@@ -25256,6 +25488,80 @@ var init_FlipCard = __esm({
25256
25488
  FlipCard.displayName = "FlipCard";
25257
25489
  }
25258
25490
  });
25491
+ var EMOJI_ITEMS, EmojiPicker;
25492
+ var init_EmojiPicker = __esm({
25493
+ "components/core/molecules/EmojiPicker.tsx"() {
25494
+ "use client";
25495
+ init_useEventBus();
25496
+ init_Button();
25497
+ init_GridPicker();
25498
+ init_Popover();
25499
+ EMOJI_ITEMS = (() => {
25500
+ const items = [];
25501
+ for (const name of ordered) {
25502
+ const entry = lib[name];
25503
+ if (entry === void 0 || entry.char === null || entry.char === "") continue;
25504
+ items.push({
25505
+ id: entry.char,
25506
+ label: name.replace(/_/g, " "),
25507
+ category: entry.category.replace(/_/g, " "),
25508
+ keywords: entry.keywords
25509
+ });
25510
+ }
25511
+ return items;
25512
+ })();
25513
+ EmojiPicker = ({
25514
+ pickEvent,
25515
+ position = "top",
25516
+ triggerIcon = "smile",
25517
+ triggerLabel = "Add emoji",
25518
+ className
25519
+ }) => {
25520
+ const eventBus = useEventBus();
25521
+ const [open, setOpen] = useState(false);
25522
+ const handlePick = (glyph) => {
25523
+ if (pickEvent !== void 0) {
25524
+ const payload = { emoji: glyph };
25525
+ eventBus.emit(`UI:${pickEvent}`, payload);
25526
+ }
25527
+ setOpen(false);
25528
+ };
25529
+ return /* @__PURE__ */ jsx(
25530
+ Popover,
25531
+ {
25532
+ position,
25533
+ trigger: "click",
25534
+ showArrow: false,
25535
+ open,
25536
+ onOpenChange: setOpen,
25537
+ content: /* @__PURE__ */ jsx(
25538
+ GridPicker,
25539
+ {
25540
+ items: EMOJI_ITEMS,
25541
+ onChange: handlePick,
25542
+ searchPlaceholder: "Search emoji\u2026",
25543
+ renderThumbnail: (item) => /* @__PURE__ */ jsx("span", { className: "text-xl leading-none", "aria-hidden": "true", children: item.id }),
25544
+ cellSize: 32,
25545
+ className: "w-80"
25546
+ }
25547
+ ),
25548
+ children: /* @__PURE__ */ jsx(
25549
+ Button,
25550
+ {
25551
+ variant: "ghost",
25552
+ icon: triggerIcon,
25553
+ "aria-label": triggerLabel,
25554
+ title: triggerLabel,
25555
+ className,
25556
+ "data-testid": "emoji-picker-trigger"
25557
+ }
25558
+ )
25559
+ }
25560
+ );
25561
+ };
25562
+ EmojiPicker.displayName = "EmojiPicker";
25563
+ }
25564
+ });
25259
25565
  function toISODate(d) {
25260
25566
  return d.toISOString().slice(0, 10);
25261
25567
  }
@@ -26384,7 +26690,7 @@ function GameMenu({
26384
26690
  }) {
26385
26691
  const resolvedOptions = (options?.length ? options : void 0) ?? (menuItems?.length ? menuItems : void 0) ?? DEFAULT_MENU_OPTIONS;
26386
26692
  const eventBus = useEventBus();
26387
- const handleOptionClick = React74.useCallback(
26693
+ const handleOptionClick = React75.useCallback(
26388
26694
  (option) => {
26389
26695
  if (option.event) {
26390
26696
  eventBus.emit(`UI:${option.event}`, { option });
@@ -26620,7 +26926,7 @@ function StateGraph({
26620
26926
  }) {
26621
26927
  const eventBus = useEventBus();
26622
26928
  const nodes = states ?? [];
26623
- const positions = React74.useMemo(() => layoutStates(nodes, width, height), [nodes, width, height]);
26929
+ const positions = React75.useMemo(() => layoutStates(nodes, width, height), [nodes, width, height]);
26624
26930
  return /* @__PURE__ */ jsxs(
26625
26931
  Box,
26626
26932
  {
@@ -27157,7 +27463,7 @@ function LinearView({
27157
27463
  /* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
27158
27464
  const isDone = i < currentIdx;
27159
27465
  const isCurrent = i === currentIdx;
27160
- return /* @__PURE__ */ jsxs(React74__default.Fragment, { children: [
27466
+ return /* @__PURE__ */ jsxs(React75__default.Fragment, { children: [
27161
27467
  i > 0 && /* @__PURE__ */ jsx(
27162
27468
  Typography,
27163
27469
  {
@@ -27790,7 +28096,7 @@ function SequenceBar({
27790
28096
  else onSlotRemove?.(index);
27791
28097
  }, [emit, slotRemoveEvent, onSlotRemove, playing]);
27792
28098
  const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
27793
- return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React74__default.Fragment, { children: [
28099
+ return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React75__default.Fragment, { children: [
27794
28100
  i > 0 && /* @__PURE__ */ jsx(
27795
28101
  Typography,
27796
28102
  {
@@ -28770,7 +29076,7 @@ var init_MapView = __esm({
28770
29076
  shadowSize: [41, 41]
28771
29077
  });
28772
29078
  L.Marker.prototype.options.icon = defaultIcon;
28773
- const { useEffect: useEffect65, useRef: useRef63, useCallback: useCallback106, useState: useState102 } = React74__default;
29079
+ const { useEffect: useEffect65, useRef: useRef63, useCallback: useCallback106, useState: useState103 } = React75__default;
28774
29080
  const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
28775
29081
  const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
28776
29082
  function MapUpdater({ centerLat, centerLng, zoom }) {
@@ -28815,7 +29121,7 @@ var init_MapView = __esm({
28815
29121
  showAttribution = true
28816
29122
  }) {
28817
29123
  const eventBus = useEventBus2();
28818
- const [clickedPosition, setClickedPosition] = useState102(null);
29124
+ const [clickedPosition, setClickedPosition] = useState103(null);
28819
29125
  const handleMapClick = useCallback106((lat, lng) => {
28820
29126
  if (showClickedPin) {
28821
29127
  setClickedPosition({ lat, lng });
@@ -29660,6 +29966,7 @@ function TableView({
29660
29966
  fields,
29661
29967
  itemActions,
29662
29968
  maxInlineActions,
29969
+ itemClickEvent,
29663
29970
  selectable = false,
29664
29971
  selectEvent,
29665
29972
  selectedIds,
@@ -29687,8 +29994,8 @@ function TableView({
29687
29994
  }) {
29688
29995
  const eventBus = useEventBus();
29689
29996
  const { t } = useTranslate();
29690
- const [visibleCount, setVisibleCount] = React74__default.useState(pageSize > 0 ? pageSize : Infinity);
29691
- const [localSelected, setLocalSelected] = React74__default.useState(/* @__PURE__ */ new Set());
29997
+ const [visibleCount, setVisibleCount] = React75__default.useState(pageSize > 0 ? pageSize : Infinity);
29998
+ const [localSelected, setLocalSelected] = React75__default.useState(/* @__PURE__ */ new Set());
29692
29999
  const colDefs = (Array.isArray(columns) ? columns : void 0) ?? (Array.isArray(fields) ? fields : void 0) ?? [];
29693
30000
  const actionDefs = Array.isArray(itemActions) ? itemActions : [];
29694
30001
  const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
@@ -29704,13 +30011,13 @@ function TableView({
29704
30011
  dndItemIdField,
29705
30012
  dndRoot
29706
30013
  });
29707
- const ordered = dnd.orderedItems;
29708
- const data = pageSize > 0 ? ordered.slice(0, visibleCount) : ordered;
29709
- const hasMore = pageSize > 0 && visibleCount < ordered.length;
30014
+ const ordered2 = dnd.orderedItems;
30015
+ const data = pageSize > 0 ? ordered2.slice(0, visibleCount) : ordered2;
30016
+ const hasMore = pageSize > 0 && visibleCount < ordered2.length;
29710
30017
  const hasRenderProp = typeof children === "function";
29711
30018
  const idField = dndItemIdField ?? "id";
29712
30019
  const isCoarsePointer = useMediaQuery("(pointer: coarse)");
29713
- React74__default.useEffect(() => {
30020
+ React75__default.useEffect(() => {
29714
30021
  tableViewLog.debug("render", {
29715
30022
  rowCount: data.length,
29716
30023
  colCount: colDefs.length,
@@ -29759,7 +30066,15 @@ function TableView({
29759
30066
  };
29760
30067
  eventBus.emit(`UI:${action.event}`, payload);
29761
30068
  };
29762
- const colFloors = React74__default.useMemo(
30069
+ const handleRowClick = (row) => () => {
30070
+ if (!itemClickEvent) return;
30071
+ const payload = {
30072
+ id: row.id,
30073
+ row
30074
+ };
30075
+ eventBus.emit(`UI:${itemClickEvent}`, payload);
30076
+ };
30077
+ const colFloors = React75__default.useMemo(
29763
30078
  () => colDefs.map((col) => {
29764
30079
  const longest = data.reduce((widest, row) => {
29765
30080
  const cell = formatCell(asFieldValue(getNestedValue(row, col.field ?? col.key)), col.format);
@@ -29835,10 +30150,12 @@ function TableView({
29835
30150
  role: "row",
29836
30151
  "data-entity-row": true,
29837
30152
  "data-entity-id": id,
30153
+ onClick: itemClickEvent ? handleRowClick(row) : void 0,
29838
30154
  style: !hasRenderProp ? { gridTemplateColumns } : void 0,
29839
30155
  className: cn(
29840
30156
  "group items-center gap-3 transition-colors duration-fast",
29841
30157
  hasRenderProp ? "flex" : "grid",
30158
+ itemClickEvent && "cursor-pointer",
29842
30159
  lk.rowPad,
29843
30160
  lk.divider && "border-b border-[var(--color-border)]",
29844
30161
  lk.striped && index % 2 === 1 && "bg-[var(--color-surface-subtle)]",
@@ -29846,7 +30163,7 @@ function TableView({
29846
30163
  look === "bordered" && "[&>*]:border-r [&>*]:border-[var(--color-border)] [&>*:last-child]:border-r-0"
29847
30164
  ),
29848
30165
  children: [
29849
- selectable && /* @__PURE__ */ jsx(Box, { className: "flex items-center", children: /* @__PURE__ */ jsx(
30166
+ selectable && /* @__PURE__ */ jsx(Box, { className: "flex items-center", onClick: itemClickEvent ? (e) => e.stopPropagation() : void 0, children: /* @__PURE__ */ jsx(
29850
30167
  Checkbox,
29851
30168
  {
29852
30169
  checked: selected.has(id),
@@ -29871,6 +30188,7 @@ function TableView({
29871
30188
  HStack,
29872
30189
  {
29873
30190
  gap: "xs",
30191
+ onClick: itemClickEvent ? (e) => e.stopPropagation() : void 0,
29874
30192
  className: cn(
29875
30193
  // Pinned: the fixed column tracks routinely overflow the caller's
29876
30194
  // scroll container, which used to leave the actions off-screen.
@@ -29918,12 +30236,12 @@ function TableView({
29918
30236
  ]
29919
30237
  }
29920
30238
  );
29921
- return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React74__default.Fragment, { children: rowInner }, id);
30239
+ return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React75__default.Fragment, { children: rowInner }, id);
29922
30240
  };
29923
30241
  const items = Array.from(data);
29924
30242
  const groups = groupBy ? groupData2(items, groupBy) : [{ label: "", items }];
29925
30243
  let runningIndex = 0;
29926
- const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React74__default.Fragment, { children: [
30244
+ const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React75__default.Fragment, { children: [
29927
30245
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-3" : "mt-0" }),
29928
30246
  group.items.map((row) => renderRow(row, runningIndex++))
29929
30247
  ] }, gi)) });
@@ -29940,7 +30258,7 @@ function TableView({
29940
30258
  /* @__PURE__ */ jsx(Icon, { name: "chevron-down", size: "xs", className: "mr-1" }),
29941
30259
  t("common.showMore"),
29942
30260
  " (",
29943
- t("common.remaining", { count: ordered.length - visibleCount }),
30261
+ t("common.remaining", { count: ordered2.length - visibleCount }),
29944
30262
  ")"
29945
30263
  ] }) })
29946
30264
  ]
@@ -31286,7 +31604,7 @@ var init_StepFlow = __esm({
31286
31604
  className
31287
31605
  }) => {
31288
31606
  if (orientation === "vertical") {
31289
- return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React74__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
31607
+ return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React75__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
31290
31608
  /* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
31291
31609
  /* @__PURE__ */ jsx(StepCircle, { step, index }),
31292
31610
  showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
@@ -31297,7 +31615,7 @@ var init_StepFlow = __esm({
31297
31615
  ] })
31298
31616
  ] }) }, index)) });
31299
31617
  }
31300
- 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(React74__default.Fragment, { children: [
31618
+ 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(React75__default.Fragment, { children: [
31301
31619
  /* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
31302
31620
  /* @__PURE__ */ jsx(StepCircle, { step, index }),
31303
31621
  /* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
@@ -32287,7 +32605,7 @@ var init_LikertScale = __esm({
32287
32605
  md: "text-base",
32288
32606
  lg: "text-lg"
32289
32607
  };
32290
- LikertScale = React74__default.forwardRef(
32608
+ LikertScale = React75__default.forwardRef(
32291
32609
  ({
32292
32610
  question,
32293
32611
  options = DEFAULT_LIKERT_OPTIONS,
@@ -32299,7 +32617,7 @@ var init_LikertScale = __esm({
32299
32617
  variant = "radios",
32300
32618
  className
32301
32619
  }, ref) => {
32302
- const groupId = React74__default.useId();
32620
+ const groupId = React75__default.useId();
32303
32621
  const eventBus = useEventBus();
32304
32622
  const handleSelect = useCallback(
32305
32623
  (next) => {
@@ -34588,7 +34906,7 @@ var init_DocBreadcrumb = __esm({
34588
34906
  "aria-label": t("aria.breadcrumb"),
34589
34907
  children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
34590
34908
  const isLast = idx === items.length - 1;
34591
- return /* @__PURE__ */ jsxs(React74__default.Fragment, { children: [
34909
+ return /* @__PURE__ */ jsxs(React75__default.Fragment, { children: [
34592
34910
  idx > 0 && /* @__PURE__ */ jsx(
34593
34911
  Icon,
34594
34912
  {
@@ -35457,7 +35775,7 @@ var init_MiniStateMachine = __esm({
35457
35775
  const x = 2 + i * (NODE_W + GAP2 + ARROW_W + GAP2);
35458
35776
  const tc = transitionCounts[s.name] ?? 0;
35459
35777
  const role = getStateRole(s.name, s.isInitial ?? void 0, s.isTerminal ?? void 0, tc, maxTC);
35460
- return /* @__PURE__ */ jsxs(React74__default.Fragment, { children: [
35778
+ return /* @__PURE__ */ jsxs(React75__default.Fragment, { children: [
35461
35779
  /* @__PURE__ */ jsx(
35462
35780
  AvlState,
35463
35781
  {
@@ -35661,7 +35979,7 @@ var init_PageHeader = __esm({
35661
35979
  info: "bg-info/10 text-info"
35662
35980
  };
35663
35981
  return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
35664
- 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(React74__default.Fragment, { children: [
35982
+ 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(React75__default.Fragment, { children: [
35665
35983
  idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
35666
35984
  crumb.href ? /* @__PURE__ */ jsx(
35667
35985
  "a",
@@ -36019,7 +36337,7 @@ var init_Section = __esm({
36019
36337
  as: Component = "section"
36020
36338
  }) => {
36021
36339
  const hasHeader = title || description || action;
36022
- return React74__default.createElement(
36340
+ return React75__default.createElement(
36023
36341
  Component,
36024
36342
  {
36025
36343
  className: cn(
@@ -36393,7 +36711,7 @@ var init_WizardContainer = __esm({
36393
36711
  const isCompleted = index < currentStep;
36394
36712
  const stepKey = step.id ?? step.tabId ?? `step-${index}`;
36395
36713
  const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
36396
- return /* @__PURE__ */ jsxs(React74__default.Fragment, { children: [
36714
+ return /* @__PURE__ */ jsxs(React75__default.Fragment, { children: [
36397
36715
  /* @__PURE__ */ jsx(
36398
36716
  Button,
36399
36717
  {
@@ -38180,7 +38498,7 @@ var init_ImportPreviewTree = __esm({
38180
38498
  const renderUnit = (unit, childrenByParent, depth) => {
38181
38499
  const summary = fieldSummary(unit);
38182
38500
  const children = childrenByParent.get(unit.ref) ?? [];
38183
- return /* @__PURE__ */ jsxs(React74__default.Fragment, { children: [
38501
+ return /* @__PURE__ */ jsxs(React75__default.Fragment, { children: [
38184
38502
  /* @__PURE__ */ jsxs(
38185
38503
  Box,
38186
38504
  {
@@ -38277,7 +38595,7 @@ var init_ImportProgress = __esm({
38277
38595
  PIPELINE.map((key, index) => {
38278
38596
  const isComplete = index < currentIndex;
38279
38597
  const isActive = index === currentIndex;
38280
- return /* @__PURE__ */ jsxs(React74__default.Fragment, { children: [
38598
+ return /* @__PURE__ */ jsxs(React75__default.Fragment, { children: [
38281
38599
  index > 0 ? /* @__PURE__ */ jsx(Box, { className: "h-px w-4 bg-border" }) : null,
38282
38600
  /* @__PURE__ */ jsxs(Box, { className: "flex items-center gap-1", "data-testid": `import-progress-step-${key}`, children: [
38283
38601
  /* @__PURE__ */ jsx(
@@ -38543,6 +38861,7 @@ var init_molecules2 = __esm({
38543
38861
  init_GridPicker();
38544
38862
  init_AssetPicker();
38545
38863
  init_IconPicker();
38864
+ init_EmojiPicker();
38546
38865
  init_DateRangePicker();
38547
38866
  init_DateRangeSelector();
38548
38867
  init_ChartLegend();
@@ -39611,7 +39930,7 @@ var init_DrawGroup = __esm({
39611
39930
  }
39612
39931
  });
39613
39932
  function extractTitle(children) {
39614
- if (!React74__default.isValidElement(children)) return void 0;
39933
+ if (!React75__default.isValidElement(children)) return void 0;
39615
39934
  const props = children.props;
39616
39935
  if (typeof props.title === "string") {
39617
39936
  return props.title;
@@ -39961,12 +40280,12 @@ var init_Form = __esm({
39961
40280
  const isSchemaEntity = isOrbitalEntitySchema(entity);
39962
40281
  const resolvedEntity = isSchemaEntity ? entity : void 0;
39963
40282
  const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
39964
- const normalizedInitialData = React74__default.useMemo(() => {
40283
+ const normalizedInitialData = React75__default.useMemo(() => {
39965
40284
  const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
39966
40285
  const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
39967
40286
  return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
39968
40287
  }, [entity, initialData]);
39969
- const entityDerivedFields = React74__default.useMemo(() => {
40288
+ const entityDerivedFields = React75__default.useMemo(() => {
39970
40289
  if (fields && fields.length > 0) return void 0;
39971
40290
  if (!resolvedEntity) return void 0;
39972
40291
  return resolvedEntity.fields.map(
@@ -39987,16 +40306,16 @@ var init_Form = __esm({
39987
40306
  const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
39988
40307
  const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
39989
40308
  const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
39990
- const [formData, setFormData] = React74__default.useState(
40309
+ const [formData, setFormData] = React75__default.useState(
39991
40310
  normalizedInitialData
39992
40311
  );
39993
- const [collapsedSections, setCollapsedSections] = React74__default.useState(
40312
+ const [collapsedSections, setCollapsedSections] = React75__default.useState(
39994
40313
  /* @__PURE__ */ new Set()
39995
40314
  );
39996
- const [submitError, setSubmitError] = React74__default.useState(null);
39997
- const formRef = React74__default.useRef(null);
40315
+ const [submitError, setSubmitError] = React75__default.useState(null);
40316
+ const formRef = React75__default.useRef(null);
39998
40317
  const formMode = props.mode;
39999
- const mountedRef = React74__default.useRef(false);
40318
+ const mountedRef = React75__default.useRef(false);
40000
40319
  if (!mountedRef.current) {
40001
40320
  mountedRef.current = true;
40002
40321
  debug("forms", "mount", {
@@ -40009,7 +40328,7 @@ var init_Form = __esm({
40009
40328
  });
40010
40329
  }
40011
40330
  const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
40012
- const evalContext = React74__default.useMemo(
40331
+ const evalContext = React75__default.useMemo(
40013
40332
  () => ({
40014
40333
  formValues: formData,
40015
40334
  globalVariables: externalContext?.globalVariables ?? {},
@@ -40018,7 +40337,7 @@ var init_Form = __esm({
40018
40337
  }),
40019
40338
  [formData, externalContext]
40020
40339
  );
40021
- React74__default.useEffect(() => {
40340
+ React75__default.useEffect(() => {
40022
40341
  debug("forms", "initialData-sync", {
40023
40342
  mode: formMode,
40024
40343
  normalizedInitialData,
@@ -40029,7 +40348,7 @@ var init_Form = __esm({
40029
40348
  setFormData(normalizedInitialData);
40030
40349
  }
40031
40350
  }, [normalizedInitialData]);
40032
- const processCalculations = React74__default.useCallback(
40351
+ const processCalculations = React75__default.useCallback(
40033
40352
  (changedFieldId, newFormData) => {
40034
40353
  if (!hiddenCalculations.length) return;
40035
40354
  const context = {
@@ -40054,7 +40373,7 @@ var init_Form = __esm({
40054
40373
  },
40055
40374
  [hiddenCalculations, externalContext, eventBus]
40056
40375
  );
40057
- const checkViolations = React74__default.useCallback(
40376
+ const checkViolations = React75__default.useCallback(
40058
40377
  (changedFieldId, newFormData) => {
40059
40378
  if (!violationTriggers.length) return;
40060
40379
  const context = {
@@ -40092,7 +40411,7 @@ var init_Form = __esm({
40092
40411
  processCalculations(name, newFormData);
40093
40412
  checkViolations(name, newFormData);
40094
40413
  };
40095
- const isFieldVisible = React74__default.useCallback(
40414
+ const isFieldVisible = React75__default.useCallback(
40096
40415
  (fieldName) => {
40097
40416
  const condition = conditionalFields[fieldName];
40098
40417
  if (!condition) return true;
@@ -40100,7 +40419,7 @@ var init_Form = __esm({
40100
40419
  },
40101
40420
  [conditionalFields, evalContext]
40102
40421
  );
40103
- const isSectionVisible = React74__default.useCallback(
40422
+ const isSectionVisible = React75__default.useCallback(
40104
40423
  (section) => {
40105
40424
  if (!section.condition) return true;
40106
40425
  return Boolean(evaluateFormExpression(section.condition, evalContext));
@@ -40176,7 +40495,7 @@ var init_Form = __esm({
40176
40495
  eventBus.emit(`UI:${onCancel}`);
40177
40496
  }
40178
40497
  };
40179
- const renderField = React74__default.useCallback(
40498
+ const renderField = React75__default.useCallback(
40180
40499
  (field) => {
40181
40500
  const fieldName = field.name || field.field;
40182
40501
  if (!fieldName) return null;
@@ -40197,7 +40516,7 @@ var init_Form = __esm({
40197
40516
  [formData, isFieldVisible, relationsData, relationsLoading, isLoading]
40198
40517
  );
40199
40518
  const effectiveFields = entityDerivedFields ?? fields;
40200
- const normalizedFields = React74__default.useMemo(() => {
40519
+ const normalizedFields = React75__default.useMemo(() => {
40201
40520
  if (!effectiveFields || effectiveFields.length === 0) return [];
40202
40521
  return effectiveFields.map((field) => {
40203
40522
  if (typeof field === "string") {
@@ -40221,7 +40540,7 @@ var init_Form = __esm({
40221
40540
  return field;
40222
40541
  });
40223
40542
  }, [effectiveFields, resolvedEntity]);
40224
- const schemaFields = React74__default.useMemo(() => {
40543
+ const schemaFields = React75__default.useMemo(() => {
40225
40544
  if (normalizedFields.length === 0) return null;
40226
40545
  if (isDebugEnabled()) {
40227
40546
  debugGroup(`Form: ${entityName || "unknown"}`);
@@ -40231,7 +40550,7 @@ var init_Form = __esm({
40231
40550
  }
40232
40551
  return normalizedFields.map(renderField).filter(Boolean);
40233
40552
  }, [normalizedFields, renderField, entityName, conditionalFields]);
40234
- const sectionElements = React74__default.useMemo(() => {
40553
+ const sectionElements = React75__default.useMemo(() => {
40235
40554
  if (!sections || sections.length === 0) return null;
40236
40555
  return sections.map((section) => {
40237
40556
  if (!isSectionVisible(section)) {
@@ -40957,7 +41276,7 @@ var init_List = __esm({
40957
41276
  if (entity && typeof entity === "object" && "id" in entity) return [entity];
40958
41277
  return [];
40959
41278
  }, [entity]);
40960
- const getItemActions = React74__default.useCallback(
41279
+ const getItemActions = React75__default.useCallback(
40961
41280
  (item) => {
40962
41281
  if (!itemActions) return [];
40963
41282
  if (typeof itemActions === "function") {
@@ -41438,7 +41757,7 @@ var init_MediaGallery = __esm({
41438
41757
  [selectable, selectedItems, selectionEvent, eventBus]
41439
41758
  );
41440
41759
  const entityData = Array.isArray(entity) ? entity : [];
41441
- const items = React74__default.useMemo(() => {
41760
+ const items = React75__default.useMemo(() => {
41442
41761
  if (propItems && propItems.length > 0) return propItems;
41443
41762
  if (entityData.length === 0) return [];
41444
41763
  return entityData.map((record, idx) => {
@@ -41603,7 +41922,7 @@ var init_MediaGallery = __esm({
41603
41922
  }
41604
41923
  });
41605
41924
  function extractTitle2(children) {
41606
- if (!React74__default.isValidElement(children)) return void 0;
41925
+ if (!React75__default.isValidElement(children)) return void 0;
41607
41926
  const props = children.props;
41608
41927
  if (typeof props.title === "string") {
41609
41928
  return props.title;
@@ -41858,7 +42177,7 @@ var init_debugRegistry = __esm({
41858
42177
  }
41859
42178
  });
41860
42179
  function useDebugData() {
41861
- const [data, setData] = React74.useState(() => ({
42180
+ const [data, setData] = React75.useState(() => ({
41862
42181
  traits: [],
41863
42182
  ticks: [],
41864
42183
  guards: [],
@@ -41872,7 +42191,7 @@ function useDebugData() {
41872
42191
  },
41873
42192
  lastUpdate: Date.now()
41874
42193
  }));
41875
- React74.useEffect(() => {
42194
+ React75.useEffect(() => {
41876
42195
  const updateData = () => {
41877
42196
  setData({
41878
42197
  traits: getAllTraits(),
@@ -41981,12 +42300,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
41981
42300
  return positions;
41982
42301
  }
41983
42302
  function WalkMinimap() {
41984
- const [walkStep, setWalkStep] = React74.useState(null);
41985
- const [traits2, setTraits] = React74.useState([]);
41986
- const [coveredEdges, setCoveredEdges] = React74.useState([]);
41987
- const [completedTraits, setCompletedTraits] = React74.useState(/* @__PURE__ */ new Set());
41988
- const prevTraitRef = React74.useRef(null);
41989
- React74.useEffect(() => {
42303
+ const [walkStep, setWalkStep] = React75.useState(null);
42304
+ const [traits2, setTraits] = React75.useState([]);
42305
+ const [coveredEdges, setCoveredEdges] = React75.useState([]);
42306
+ const [completedTraits, setCompletedTraits] = React75.useState(/* @__PURE__ */ new Set());
42307
+ const prevTraitRef = React75.useRef(null);
42308
+ React75.useEffect(() => {
41990
42309
  const interval = setInterval(() => {
41991
42310
  const w = window;
41992
42311
  const step = w.__orbitalWalkStep;
@@ -42422,15 +42741,15 @@ var init_EntitiesTab = __esm({
42422
42741
  });
42423
42742
  function EventFlowTab({ events: events2 }) {
42424
42743
  const { t } = useTranslate();
42425
- const [filter, setFilter] = React74.useState("all");
42426
- const containerRef = React74.useRef(null);
42427
- const [autoScroll, setAutoScroll] = React74.useState(true);
42428
- React74.useEffect(() => {
42744
+ const [filter, setFilter] = React75.useState("all");
42745
+ const containerRef = React75.useRef(null);
42746
+ const [autoScroll, setAutoScroll] = React75.useState(true);
42747
+ React75.useEffect(() => {
42429
42748
  if (autoScroll && containerRef.current) {
42430
42749
  containerRef.current.scrollTop = containerRef.current.scrollHeight;
42431
42750
  }
42432
42751
  }, [events2.length, autoScroll]);
42433
- const filteredEvents = React74.useMemo(() => {
42752
+ const filteredEvents = React75.useMemo(() => {
42434
42753
  if (filter === "all") return events2;
42435
42754
  return events2.filter((e) => e.type === filter);
42436
42755
  }, [events2, filter]);
@@ -42546,7 +42865,7 @@ var init_EventFlowTab = __esm({
42546
42865
  });
42547
42866
  function GuardsPanel({ guards }) {
42548
42867
  const { t } = useTranslate();
42549
- const [filter, setFilter] = React74.useState("all");
42868
+ const [filter, setFilter] = React75.useState("all");
42550
42869
  if (guards.length === 0) {
42551
42870
  return /* @__PURE__ */ jsx(
42552
42871
  EmptyState,
@@ -42559,7 +42878,7 @@ function GuardsPanel({ guards }) {
42559
42878
  }
42560
42879
  const passedCount = guards.filter((g) => g.result).length;
42561
42880
  const failedCount = guards.length - passedCount;
42562
- const filteredGuards = React74.useMemo(() => {
42881
+ const filteredGuards = React75.useMemo(() => {
42563
42882
  if (filter === "all") return guards;
42564
42883
  if (filter === "passed") return guards.filter((g) => g.result);
42565
42884
  return guards.filter((g) => !g.result);
@@ -42722,10 +43041,10 @@ function EffectBadge({ effect }) {
42722
43041
  }
42723
43042
  function TransitionTimeline({ transitions }) {
42724
43043
  const { t } = useTranslate();
42725
- const containerRef = React74.useRef(null);
42726
- const [autoScroll, setAutoScroll] = React74.useState(true);
42727
- const [expandedId, setExpandedId] = React74.useState(null);
42728
- React74.useEffect(() => {
43044
+ const containerRef = React75.useRef(null);
43045
+ const [autoScroll, setAutoScroll] = React75.useState(true);
43046
+ const [expandedId, setExpandedId] = React75.useState(null);
43047
+ React75.useEffect(() => {
42729
43048
  if (autoScroll && containerRef.current) {
42730
43049
  containerRef.current.scrollTop = containerRef.current.scrollHeight;
42731
43050
  }
@@ -43005,9 +43324,9 @@ function getAllEvents(traits2) {
43005
43324
  function EventDispatcherTab({ traits: traits2, schema }) {
43006
43325
  const eventBus = useEventBus();
43007
43326
  const { t } = useTranslate();
43008
- const [log19, setLog] = React74.useState([]);
43009
- const prevStatesRef = React74.useRef(/* @__PURE__ */ new Map());
43010
- React74.useEffect(() => {
43327
+ const [log19, setLog] = React75.useState([]);
43328
+ const prevStatesRef = React75.useRef(/* @__PURE__ */ new Map());
43329
+ React75.useEffect(() => {
43011
43330
  for (const trait of traits2) {
43012
43331
  const prev = prevStatesRef.current.get(trait.id);
43013
43332
  if (prev && prev !== trait.currentState) {
@@ -43176,10 +43495,10 @@ function VerifyModePanel({
43176
43495
  localCount
43177
43496
  }) {
43178
43497
  const { t } = useTranslate();
43179
- const [expanded, setExpanded] = React74.useState(true);
43180
- const scrollRef = React74.useRef(null);
43181
- const prevCountRef = React74.useRef(0);
43182
- React74.useEffect(() => {
43498
+ const [expanded, setExpanded] = React75.useState(true);
43499
+ const scrollRef = React75.useRef(null);
43500
+ const prevCountRef = React75.useRef(0);
43501
+ React75.useEffect(() => {
43183
43502
  if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
43184
43503
  scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
43185
43504
  }
@@ -43236,10 +43555,10 @@ function RuntimeDebugger({
43236
43555
  schema
43237
43556
  }) {
43238
43557
  const { t } = useTranslate();
43239
- const [isCollapsed, setIsCollapsed] = React74.useState(mode === "verify" ? true : defaultCollapsed);
43240
- const [isVisible, setIsVisible] = React74.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
43558
+ const [isCollapsed, setIsCollapsed] = React75.useState(mode === "verify" ? true : defaultCollapsed);
43559
+ const [isVisible, setIsVisible] = React75.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
43241
43560
  const debugData = useDebugData();
43242
- React74.useEffect(() => {
43561
+ React75.useEffect(() => {
43243
43562
  if (mode === "inline") return;
43244
43563
  return onDebugToggle((enabled) => {
43245
43564
  setIsVisible(enabled);
@@ -43248,7 +43567,7 @@ function RuntimeDebugger({
43248
43567
  }
43249
43568
  });
43250
43569
  }, [mode]);
43251
- React74.useEffect(() => {
43570
+ React75.useEffect(() => {
43252
43571
  if (mode === "inline") return;
43253
43572
  const handleKeyDown = (e) => {
43254
43573
  if (e.key === "`" && isVisible) {
@@ -43768,7 +44087,7 @@ var init_StatCard = __esm({
43768
44087
  const labelToUse = propLabel ?? propTitle;
43769
44088
  const eventBus = useEventBus();
43770
44089
  const { t } = useTranslate();
43771
- const handleActionClick = React74__default.useCallback(() => {
44090
+ const handleActionClick = React75__default.useCallback(() => {
43772
44091
  if (action?.event) {
43773
44092
  eventBus.emit(`UI:${action.event}`, {});
43774
44093
  }
@@ -43779,7 +44098,7 @@ var init_StatCard = __esm({
43779
44098
  const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
43780
44099
  const isLoading = externalLoading ?? false;
43781
44100
  const error = externalError;
43782
- const computeMetricValue = React74__default.useCallback(
44101
+ const computeMetricValue = React75__default.useCallback(
43783
44102
  (metric, items) => {
43784
44103
  if (metric.value !== void 0) {
43785
44104
  return metric.value;
@@ -43818,7 +44137,7 @@ var init_StatCard = __esm({
43818
44137
  },
43819
44138
  []
43820
44139
  );
43821
- const schemaStats = React74__default.useMemo(() => {
44140
+ const schemaStats = React75__default.useMemo(() => {
43822
44141
  if (!metrics || metrics.length === 0) return null;
43823
44142
  return metrics.map((metric) => ({
43824
44143
  label: metric.label,
@@ -43826,7 +44145,7 @@ var init_StatCard = __esm({
43826
44145
  format: metric.format
43827
44146
  }));
43828
44147
  }, [metrics, data, computeMetricValue]);
43829
- const calculatedTrend = React74__default.useMemo(() => {
44148
+ const calculatedTrend = React75__default.useMemo(() => {
43830
44149
  if (manualTrend !== void 0) return manualTrend;
43831
44150
  if (previousValue === void 0 || currentValue2 === void 0)
43832
44151
  return void 0;
@@ -44466,8 +44785,8 @@ var init_SubagentTracePanel = __esm({
44466
44785
  ] });
44467
44786
  };
44468
44787
  InlineActivityStream = ({ activities, autoScroll = true, className }) => {
44469
- const endRef = React74__default.useRef(null);
44470
- React74__default.useEffect(() => {
44788
+ const endRef = React75__default.useRef(null);
44789
+ React75__default.useEffect(() => {
44471
44790
  if (!autoScroll) return;
44472
44791
  endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
44473
44792
  }, [activities.length, autoScroll]);
@@ -44561,7 +44880,7 @@ var init_SubagentTracePanel = __esm({
44561
44880
  };
44562
44881
  SubagentRichCard = ({ subagent }) => {
44563
44882
  const { t } = useTranslate();
44564
- const activities = React74__default.useMemo(
44883
+ const activities = React75__default.useMemo(
44565
44884
  () => subagentMessagesToActivities(subagent.messages),
44566
44885
  [subagent.messages]
44567
44886
  );
@@ -44638,8 +44957,8 @@ var init_SubagentTracePanel = __esm({
44638
44957
  ] });
44639
44958
  };
44640
44959
  CoordinatorConversation = ({ messages, autoScroll = true, className }) => {
44641
- const endRef = React74__default.useRef(null);
44642
- React74__default.useEffect(() => {
44960
+ const endRef = React75__default.useRef(null);
44961
+ React75__default.useEffect(() => {
44643
44962
  if (!autoScroll) return;
44644
44963
  endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
44645
44964
  }, [messages.length, autoScroll]);
@@ -45074,7 +45393,7 @@ var init_Timeline = __esm({
45074
45393
  }) => {
45075
45394
  const { t } = useTranslate();
45076
45395
  const entityData = entity ?? [];
45077
- const items = React74__default.useMemo(() => {
45396
+ const items = React75__default.useMemo(() => {
45078
45397
  if (propItems) return propItems;
45079
45398
  if (entityData.length === 0) return [];
45080
45399
  return entityData.map((record, idx) => {
@@ -45176,7 +45495,7 @@ var init_Timeline = __esm({
45176
45495
  }
45177
45496
  });
45178
45497
  function extractToastProps(children) {
45179
- if (!React74__default.isValidElement(children)) {
45498
+ if (!React75__default.isValidElement(children)) {
45180
45499
  if (typeof children === "string") {
45181
45500
  return { message: children };
45182
45501
  }
@@ -45218,7 +45537,7 @@ var init_ToastSlot = __esm({
45218
45537
  eventBus.emit(`${prefix}CLOSE`);
45219
45538
  };
45220
45539
  if (!isVisible) return null;
45221
- const isCustomContent = React74__default.isValidElement(children) && !message;
45540
+ const isCustomContent = React75__default.isValidElement(children) && !message;
45222
45541
  return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
45223
45542
  Toast,
45224
45543
  {
@@ -45323,6 +45642,7 @@ var init_component_registry_generated = __esm({
45323
45642
  init_Drawer();
45324
45643
  init_DrawerSlot();
45325
45644
  init_EdgeDecoration();
45645
+ init_EmojiPicker();
45326
45646
  init_EmptyState();
45327
45647
  init_ErrorBoundary();
45328
45648
  init_ErrorState();
@@ -45590,6 +45910,7 @@ var init_component_registry_generated = __esm({
45590
45910
  "Drawer": Drawer,
45591
45911
  "DrawerSlot": DrawerSlot,
45592
45912
  "EdgeDecoration": EdgeDecoration,
45913
+ "EmojiPicker": EmojiPicker,
45593
45914
  "EmptyState": EmptyState,
45594
45915
  "ErrorBoundary": ErrorBoundary,
45595
45916
  "ErrorState": ErrorState,
@@ -45789,7 +46110,7 @@ function SuspenseConfigProvider({
45789
46110
  config,
45790
46111
  children
45791
46112
  }) {
45792
- return React74__default.createElement(
46113
+ return React75__default.createElement(
45793
46114
  SuspenseConfigContext.Provider,
45794
46115
  { value: config },
45795
46116
  children
@@ -45831,7 +46152,7 @@ function enrichFormFields(fields, entityDef) {
45831
46152
  }
45832
46153
  return { name: field, label: humanizeFieldName(field) };
45833
46154
  }
45834
- if (field && typeof field === "object" && !Array.isArray(field) && !React74__default.isValidElement(field) && !(field instanceof Date)) {
46155
+ if (field && typeof field === "object" && !Array.isArray(field) && !React75__default.isValidElement(field) && !(field instanceof Date)) {
45835
46156
  const obj = field;
45836
46157
  const fieldName = typeof obj.name === "string" ? obj.name : typeof obj.field === "string" ? obj.field : void 0;
45837
46158
  if (!fieldName) return field;
@@ -46017,7 +46338,19 @@ function UISlotComponent({
46017
46338
  const suspenseConfig = useContext(SuspenseConfigContext);
46018
46339
  const contained = useContext(SlotContainedContext);
46019
46340
  const schemaCtx = useEntitySchemaOptional();
46020
- const content = slots[slot];
46341
+ const rawContent = slots[slot];
46342
+ const binding = useEntityBindingSnapshot(rawContent?.sourceTrait);
46343
+ const content = useMemo(() => {
46344
+ if (!rawContent) return rawContent;
46345
+ const resolvedProps = resolveRenderBindingMarkers(
46346
+ rawContent.props,
46347
+ rawContent.sourceTrait,
46348
+ binding.entity,
46349
+ binding.config,
46350
+ binding.state
46351
+ );
46352
+ return resolvedProps === rawContent.props ? rawContent : { ...rawContent, props: resolvedProps };
46353
+ }, [rawContent, binding.entity, binding.config, binding.state]);
46021
46354
  if (children !== void 0) {
46022
46355
  if (pattern === "clear") {
46023
46356
  return null;
@@ -46291,7 +46624,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
46291
46624
  const key = `${parentId}-${index}-trait:${traitName}`;
46292
46625
  return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
46293
46626
  }
46294
- return /* @__PURE__ */ jsx(React74__default.Fragment, { children: child }, `${parentId}-${index}`);
46627
+ return /* @__PURE__ */ jsx(React75__default.Fragment, { children: child }, `${parentId}-${index}`);
46295
46628
  }
46296
46629
  if (!child || typeof child !== "object") return null;
46297
46630
  const childId = `${parentId}-${index}`;
@@ -46348,19 +46681,20 @@ function isPatternConfig(value) {
46348
46681
  if (value === null || value === void 0) return false;
46349
46682
  if (typeof value !== "object") return false;
46350
46683
  if (Array.isArray(value)) return false;
46351
- if (React74__default.isValidElement(value)) return false;
46684
+ if (React75__default.isValidElement(value)) return false;
46352
46685
  if (value instanceof Date) return false;
46353
46686
  if (typeof value === "function") return false;
46354
46687
  const record = value;
46355
46688
  return "type" in record && typeof record.type === "string" && getComponentForPattern$1(record.type) !== null;
46356
46689
  }
46357
46690
  function isPlainConfigObject(value) {
46358
- if (React74__default.isValidElement(value)) return false;
46691
+ if (React75__default.isValidElement(value)) return false;
46359
46692
  if (value instanceof Date) return false;
46360
46693
  const proto = Object.getPrototypeOf(value);
46361
46694
  return proto === Object.prototype || proto === null;
46362
46695
  }
46363
46696
  function substituteTraitRefsDeep(value, pathKey) {
46697
+ if (isRenderBindingMarker(value)) return value;
46364
46698
  if (typeof value === "string") {
46365
46699
  const match = TRAIT_BINDING_RE.exec(value);
46366
46700
  if (match) {
@@ -46433,7 +46767,14 @@ function SlotContentRenderer({
46433
46767
  onDismiss,
46434
46768
  patternPath
46435
46769
  }) {
46436
- const entityProp = content.props.entity;
46770
+ const ambientScope = useTraitScope();
46771
+ const bindingTrait = content.sourceTrait ?? ambientScope?.trait;
46772
+ const binding = useEntityBindingSnapshot(bindingTrait);
46773
+ const liveProps = useMemo(
46774
+ () => resolveRenderBindingMarkers(content.props, bindingTrait, binding.entity, binding.config, binding.state),
46775
+ [content.props, bindingTrait, binding.entity, binding.config, binding.state]
46776
+ );
46777
+ const entityProp = liveProps.entity;
46437
46778
  if (content.pattern === "form-section") {
46438
46779
  slotLog.debug("SlotContentRenderer:form-section-render", {
46439
46780
  contentId: content.id,
@@ -46464,7 +46805,7 @@ function SlotContentRenderer({
46464
46805
  const orbitalName = schemaCtx && content.sourceTrait !== void 0 ? schemaCtx.orbitalsByTrait.get(content.sourceTrait) : void 0;
46465
46806
  const PatternComponent = getComponentForPattern(content.pattern);
46466
46807
  if (PatternComponent) {
46467
- const childrenConfig = content.props.children;
46808
+ const childrenConfig = liveProps.children;
46468
46809
  const isSingleChild = typeof childrenConfig === "string" || typeof childrenConfig === "object" && childrenConfig !== null && !Array.isArray(childrenConfig) && "type" in childrenConfig;
46469
46810
  const hasChildren = PATTERNS_WITH_CHILDREN.has(content.pattern) || Array.isArray(childrenConfig) && childrenConfig.length > 0 || isSingleChild;
46470
46811
  const isDrawHost = isDrawHostPattern(content.pattern);
@@ -46475,15 +46816,15 @@ function SlotContentRenderer({
46475
46816
  fromState: content.fromState,
46476
46817
  entity: content.entity
46477
46818
  }) : void 0;
46478
- const incomingChildren = content.props.children;
46819
+ const incomingChildren = liveProps.children;
46479
46820
  const childrenIsRenderFn = typeof incomingChildren === "function";
46480
- const { children: _childrenConfig, ...restPropsNoChildren } = content.props;
46821
+ const { children: _childrenConfig, ...restPropsNoChildren } = liveProps;
46481
46822
  const restProps = childrenIsRenderFn ? { ...restPropsNoChildren, children: incomingChildren } : restPropsNoChildren;
46482
46823
  const nodeSlotOverrides = {};
46483
46824
  for (const slotKey of CONTENT_NODE_SLOTS) {
46484
46825
  const slotVal = restProps[slotKey];
46485
46826
  if (slotVal === void 0 || slotVal === null) continue;
46486
- if (React74__default.isValidElement(slotVal) || typeof slotVal === "string" || typeof slotVal === "number" || typeof slotVal === "boolean") continue;
46827
+ if (React75__default.isValidElement(slotVal) || typeof slotVal === "string" || typeof slotVal === "number" || typeof slotVal === "boolean") continue;
46487
46828
  const typelessChildren = !Array.isArray(slotVal) && typeof slotVal === "object" && !("type" in slotVal) && Array.isArray(slotVal.children) ? slotVal.children : void 0;
46488
46829
  if (typelessChildren !== void 0 || Array.isArray(slotVal) || typeof slotVal === "object" && "type" in slotVal) {
46489
46830
  nodeSlotOverrides[slotKey] = renderPatternChildren(
@@ -46537,7 +46878,7 @@ function SlotContentRenderer({
46537
46878
  const resolvedItems = Array.isArray(entityVal) && entityVal[0] !== "fn" ? entityVal : null;
46538
46879
  if (resolvedItems && resolvedItems.length > 0 && !finalProps.fields && !finalProps.columns) {
46539
46880
  const sample = resolvedItems[0];
46540
- if (sample && typeof sample === "object" && !Array.isArray(sample) && !React74__default.isValidElement(sample) && !(sample instanceof Date)) {
46881
+ if (sample && typeof sample === "object" && !Array.isArray(sample) && !React75__default.isValidElement(sample) && !(sample instanceof Date)) {
46541
46882
  const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
46542
46883
  finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
46543
46884
  }
@@ -46586,7 +46927,7 @@ function SlotContentRenderer({
46586
46927
  "data-orb-path": patternPath ?? "root",
46587
46928
  "data-orb-pattern": content.pattern,
46588
46929
  "data-orb-orbital": orbitalName,
46589
- children: content.props.children ?? /* @__PURE__ */ jsxs(Box, { className: "p-4 text-sm text-muted-foreground border border-dashed border-border rounded", children: [
46930
+ children: liveProps.children ?? /* @__PURE__ */ jsxs(Box, { className: "p-4 text-sm text-muted-foreground border border-dashed border-border rounded", children: [
46590
46931
  "Unknown pattern: ",
46591
46932
  content.pattern,
46592
46933
  content.sourceTrait && /* @__PURE__ */ jsxs(Typography, { variant: "small", className: "ml-2", children: [
@@ -46658,6 +46999,7 @@ var scopeWrapLog, TRAIT_BINDING_RE, SuspenseConfigContext, SlotContainedContext,
46658
46999
  var init_UISlotRenderer = __esm({
46659
47000
  "components/core/organisms/UISlotRenderer.tsx"() {
46660
47001
  "use client";
47002
+ init_resolve_render_bindings();
46661
47003
  init_Modal();
46662
47004
  init_Drawer();
46663
47005
  init_Toast();
@@ -49194,4 +49536,4 @@ function useGitHubBranches(owner, repo, enabled = true) {
49194
49536
  });
49195
49537
  }
49196
49538
 
49197
- export { ALL_PRESETS, ALMADAR_DND_MIME, AR_BOOK_FIELDS, AboutPageTemplate, Accordion, Card2 as ActionCard, ActionPalette, ActionTile, ActivationBlock, Alert, AlgorithmCanvas, AnimatedCounter, AnimatedGraphic, AnimatedReveal, ArticleSection, Aside, AssetPicker, AtlasImage, AtlasPanel, AuthLayout, Avatar, Badge, BehaviorView, BiologyCanvas, BloomQuizBlock, BookChapterView, BookCoverPage, BookNavBar, BookTableOfContents, BookViewer, Box, BranchingLogicBuilder, Breadcrumb, Button, ButtonGroup, CTABanner, CalendarGrid, Canvas, Canvas2D, Card, CardBody, CardContent, CardFooter, CardGrid, CardHeader, CardTitle, Carousel, CaseStudyCard, CaseStudyOrganism, Center, Chart, ChartLegend, ChatBar, Checkbox, ChemistryCanvas, ChoiceButton, Coachmark, CodeBlock, CodeRunnerPanel, CollapsibleSection, CommunityLinks, ConditionalWrapper, ConfettiEffect, ConfirmDialog, ConnectionBlock, Container, ContentRenderer, ContentSection, ControlButton, ControlGrid, CounterTemplate, DEFAULT_LIKERT_OPTIONS, DEFAULT_MATRIX_COLUMNS, DEFAULT_SLOTS, DIAMOND_TOP_Y, DashboardGrid, DashboardLayout, DataGrid, DataList, DataTable, DateRangePicker, DateRangeSelector, DayCell, DetailPanel, Dialog, DialogueBubble, Divider, DocBreadcrumb, DocPagination, DocSearch, DocSidebar, DocTOC, DocumentViewer, StateMachineView as DomStateMachineVisualizer, Drawer, DrawerSlot, ELEMENT_SELECTED_EVENT, EdgeDecoration, EditorCheckbox, EditorSelect, EditorSlider, EditorTextInput, EditorToolbar, EmptyState, EntityDisplayEvents, ErrorBoundary, ErrorState, FEATURE_COLORS, FEATURE_TYPES, FLOOR_HEIGHT, FeatureCard, FeatureDetailPageTemplate, FeatureGrid, FeatureGridOrganism, FileTree, FilterGroup, FilterPill, Flex, FlipCard, FlipContainer, FloatingActionButton, Form, FormActions, FormField, FormLayout, FormSection, FormSectionHeader, GameAudioToggle, GameHud, GameIcon, GameMenu, GameShell, GenericAppTemplate, GeometricPattern, GradientDivider, GraphCanvas, GraphView, Grid, GridPicker, HStack, Header, HealthBar, HeroOrganism, HeroSection, I18nProvider, IDENTITY_BOOK_FIELDS, Icon, IconPicker, ImportPreviewTree, ImportProgress, ImportSourcePicker, InfiniteScrollSentinel, Input, InputGroup, InstallBox, JazariStateMachine, JsonTreeEditor, Label, LandingPageTemplate, LawReferenceTooltip, LearningCanvas, Lightbox, LikertScale, LineChart2 as LineChart, List3 as List, LoadingState, MapView, MarkdownContent, MarketingFooter, MarketingStatCard, MasterDetail, MasterDetailLayout, MathCanvas, MatrixQuestion, MediaGallery, Menu, Meter, Modal, ModalSlot, ModuleCard, Navigation, NodeSlotEditor, NotifyListener, NumberStepper, OnboardingSpotlight, OptionConstraintGroup, StateMachineView as OrbitalStateMachineView, OrbitalVisualization, Overlay, PageHeader, PageTransition, Pagination, PatternTile, PhysicsCanvas, Popover, PositionedCanvas, Presence, PricingCard, PricingGrid, PricingOrganism, PricingPageTemplate, ProgressBar, ProgressDots, PropertyInspector, PullQuote, PullToRefresh, QrScanner, QuizBlock, Radio, RangeSlider, ReflectionBlock, RelationSelect, RepeatableFormSection, ReplyTree, RichBlockEditor, RuntimeDebugger, SHEET_COLUMNS, SPRITE_SHEET_LAYOUT, ScaledDiagram, ScoreDisplay, SearchInput, Section, SectionHeader, SegmentRenderer, Select, SequenceBar, ServiceCatalog, SharedEntityStoreContext, ShowcaseCard, ShowcaseOrganism, SidePanel, Sidebar, SignaturePad, SimpleGrid, Skeleton, SlotContentRenderer, SocialProof, SortableList, Spacer, Sparkline, Spinner, Split, SplitPane, SplitSection, Stack, StarRating, StatBadge, StatCard, StatDisplay, StateGraph, StateJsonView, StateMachineView, StateNode2 as StateNode, StatsGrid, StatsOrganism, StatusBar, StatusDot, StepFlow, StepFlowOrganism, SubagentTracePanel, SvgBranch, SvgConnection, SvgFlow, SvgGrid, SvgLobe, SvgMesh, SvgMorph, SvgNode, SvgPulse, SvgRing, SvgShield, SvgStack, SwipeableRow, Switch, TERRAIN_COLORS, TILE_HEIGHT, TILE_WIDTH, TabbedContainer, TableView, Tabs, TagCloud, TagInput, TeamCard, TeamOrganism, TerrainPalette, TextHighlight, Textarea, ThemeToggle, TimeSlotCell, Timeline, TimerDisplay, Toast, ToastSlot, Tooltip, TraitFrame, TraitSlot, TraitStateViewer, TransitionArrow, TrendIndicator, TypewriterText, Typography, UISlotComponent, UISlotRenderer, UploadDropZone, VStack, VersionDiff, ViolationAlert, VoteStack, WizardContainer, WizardNavigation, WizardProgress, boardEntity, bool, calculateAttackTargets, calculateValidMoves, cn, createInitialGameState, createSharedEntityStore, createTranslate, createUnitAnimationState, getCurrentFrame, getTileDimensions, inferDirection, isoToScreen, makeAsset, makeAssetMap, mapBookData, num, objAvailableActions, objAvailableEvents, objCurrentState, objIcon, objId, objMaxRules, objName, objRules, objStates, parseEditFocus, parseLessonSegments, parseMarkdownWithCodeBlocks, parseQueryBinding, pendulum, projectileMotion, registerCodeLanguageLoader, resolveFieldMap, resolveFrame, resolveSheetDirection, rows, runTickFrame, screenToIso, springOscillator, str, tickAnimationState, toCodeLanguage, transitionAnimation, unitHealth, unitPosition, unitTeam, useAgentChat, useAnchorRect, useAtlasSliceDataUrl, useAuthContext, useCamera, useCanvasGestures, useCompile, useConnectGitHub, useDeepAgentGeneration, useDisconnectGitHub, useDragReorder, useDraggable, useDropZone, useEmitEvent, useEventBus, useEventListener, useExtensions, useFileEditor, useFileSystem, useGameAudio, useGitHubBranches, useGitHubRepo, useGitHubRepos, useGitHubStatus, useImageCache, useInfiniteScroll, useLongPress, useMediaQuery, useOrbitalHistory, usePresence, usePreview, usePullToRefresh, useQuerySingleton, useRenderInterpolation, useSharedEntitySnapshot, useSharedEntityStore, useSharedEntityStoreContext, useSwipeGesture, useTapReveal, useTraitListens, useTranslate114 as useTranslate, useUIEvents, useUISlotManager, useUnitSpriteAtlas, useValidation, vec2 };
49539
+ export { ALL_PRESETS, ALMADAR_DND_MIME, AR_BOOK_FIELDS, AboutPageTemplate, Accordion, Card2 as ActionCard, ActionPalette, ActionTile, ActivationBlock, Alert, AlgorithmCanvas, AnimatedCounter, AnimatedGraphic, AnimatedReveal, ArticleSection, Aside, AssetPicker, AtlasImage, AtlasPanel, AuthLayout, Avatar, Badge, BehaviorView, BiologyCanvas, BloomQuizBlock, BookChapterView, BookCoverPage, BookNavBar, BookTableOfContents, BookViewer, Box, BranchingLogicBuilder, Breadcrumb, Button, ButtonGroup, CTABanner, CalendarGrid, Canvas, Canvas2D, Card, CardBody, CardContent, CardFooter, CardGrid, CardHeader, CardTitle, Carousel, CaseStudyCard, CaseStudyOrganism, Center, Chart, ChartLegend, ChatBar, Checkbox, ChemistryCanvas, ChoiceButton, Coachmark, CodeBlock, CodeRunnerPanel, CollapsibleSection, CommunityLinks, ConditionalWrapper, ConfettiEffect, ConfirmDialog, ConnectionBlock, Container, ContentRenderer, ContentSection, ControlButton, ControlGrid, CounterTemplate, DEFAULT_LIKERT_OPTIONS, DEFAULT_MATRIX_COLUMNS, DEFAULT_SLOTS, DIAMOND_TOP_Y, DashboardGrid, DashboardLayout, DataGrid, DataList, DataTable, DateRangePicker, DateRangeSelector, DayCell, DetailPanel, Dialog, DialogueBubble, Divider, DocBreadcrumb, DocPagination, DocSearch, DocSidebar, DocTOC, DocumentViewer, StateMachineView as DomStateMachineVisualizer, Drawer, DrawerSlot, ELEMENT_SELECTED_EVENT, EdgeDecoration, EditorCheckbox, EditorSelect, EditorSlider, EditorTextInput, EditorToolbar, EmojiPicker, EmptyState, EntityDisplayEvents, ErrorBoundary, ErrorState, FEATURE_COLORS, FEATURE_TYPES, FLOOR_HEIGHT, FeatureCard, FeatureDetailPageTemplate, FeatureGrid, FeatureGridOrganism, FileTree, FilterGroup, FilterPill, Flex, FlipCard, FlipContainer, FloatingActionButton, Form, FormActions, FormField, FormLayout, FormSection, FormSectionHeader, GameAudioToggle, GameHud, GameIcon, GameMenu, GameShell, GenericAppTemplate, GeometricPattern, GradientDivider, GraphCanvas, GraphView, Grid, GridPicker, HStack, Header, HealthBar, HeroOrganism, HeroSection, I18nProvider, IDENTITY_BOOK_FIELDS, Icon, IconPicker, ImportPreviewTree, ImportProgress, ImportSourcePicker, InfiniteScrollSentinel, Input, InputGroup, InstallBox, JazariStateMachine, JsonTreeEditor, Label, LandingPageTemplate, LawReferenceTooltip, LearningCanvas, Lightbox, LikertScale, LineChart2 as LineChart, List3 as List, LoadingState, MapView, MarkdownContent, MarketingFooter, MarketingStatCard, MasterDetail, MasterDetailLayout, MathCanvas, MatrixQuestion, MediaGallery, Menu, Meter, Modal, ModalSlot, ModuleCard, Navigation, NodeSlotEditor, NotifyListener, NumberStepper, OnboardingSpotlight, OptionConstraintGroup, StateMachineView as OrbitalStateMachineView, OrbitalVisualization, Overlay, PageHeader, PageTransition, Pagination, PatternTile, PhysicsCanvas, Popover, PositionedCanvas, Presence, PricingCard, PricingGrid, PricingOrganism, PricingPageTemplate, ProgressBar, ProgressDots, PropertyInspector, PullQuote, PullToRefresh, QrScanner, QuizBlock, Radio, RangeSlider, ReflectionBlock, RelationSelect, RepeatableFormSection, ReplyTree, RichBlockEditor, RuntimeDebugger, SHEET_COLUMNS, SPRITE_SHEET_LAYOUT, ScaledDiagram, ScoreDisplay, SearchInput, Section, SectionHeader, SegmentRenderer, Select, SequenceBar, ServiceCatalog, SharedEntityStoreContext, ShowcaseCard, ShowcaseOrganism, SidePanel, Sidebar, SignaturePad, SimpleGrid, Skeleton, SlotContentRenderer, SocialProof, SortableList, Spacer, Sparkline, Spinner, Split, SplitPane, SplitSection, Stack, StarRating, StatBadge, StatCard, StatDisplay, StateGraph, StateJsonView, StateMachineView, StateNode2 as StateNode, StatsGrid, StatsOrganism, StatusBar, StatusDot, StepFlow, StepFlowOrganism, SubagentTracePanel, SvgBranch, SvgConnection, SvgFlow, SvgGrid, SvgLobe, SvgMesh, SvgMorph, SvgNode, SvgPulse, SvgRing, SvgShield, SvgStack, SwipeableRow, Switch, TERRAIN_COLORS, TILE_HEIGHT, TILE_WIDTH, TabbedContainer, TableView, Tabs, TagCloud, TagInput, TeamCard, TeamOrganism, TerrainPalette, TextHighlight, Textarea, ThemeToggle, TimeSlotCell, Timeline, TimerDisplay, Toast, ToastSlot, Tooltip, TraitFrame, TraitSlot, TraitStateViewer, TransitionArrow, TrendIndicator, TypewriterText, Typography, UISlotComponent, UISlotRenderer, UploadDropZone, VStack, VersionDiff, ViolationAlert, VoteStack, WizardContainer, WizardNavigation, WizardProgress, boardEntity, bool, calculateAttackTargets, calculateValidMoves, cn, createInitialGameState, createSharedEntityStore, createTranslate, createUnitAnimationState, getCurrentFrame, getTileDimensions, inferDirection, isoToScreen, makeAsset, makeAssetMap, mapBookData, num, objAvailableActions, objAvailableEvents, objCurrentState, objIcon, objId, objMaxRules, objName, objRules, objStates, parseEditFocus, parseLessonSegments, parseMarkdownWithCodeBlocks, parseQueryBinding, pendulum, projectileMotion, registerCodeLanguageLoader, resolveFieldMap, resolveFrame, resolveSheetDirection, rows, runTickFrame, screenToIso, springOscillator, str, tickAnimationState, toCodeLanguage, transitionAnimation, unitHealth, unitPosition, unitTeam, useAgentChat, useAnchorRect, useAtlasSliceDataUrl, useAuthContext, useCamera, useCanvasGestures, useCompile, useConnectGitHub, useDeepAgentGeneration, useDisconnectGitHub, useDragReorder, useDraggable, useDropZone, useEmitEvent, useEventBus, useEventListener, useExtensions, useFileEditor, useFileSystem, useGameAudio, useGitHubBranches, useGitHubRepo, useGitHubRepos, useGitHubStatus, useImageCache, useInfiniteScroll, useLongPress, useMediaQuery, useOrbitalHistory, usePresence, usePreview, usePullToRefresh, useQuerySingleton, useRenderInterpolation, useSharedEntitySnapshot, useSharedEntityStore, useSharedEntityStoreContext, useSwipeGesture, useTapReveal, useTraitListens, useTranslate114 as useTranslate, useUIEvents, useUISlotManager, useUnitSpriteAtlas, useValidation, vec2 };