@almadar/ui 5.25.0 → 5.26.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.
Files changed (53) hide show
  1. package/dist/avl/index.cjs +2071 -2859
  2. package/dist/avl/index.js +1020 -1808
  3. package/dist/components/core/atoms/FlipContainer.d.ts +4 -4
  4. package/dist/components/core/atoms/Icon.d.ts +4 -2
  5. package/dist/components/core/atoms/ProgressBar.d.ts +1 -1
  6. package/dist/components/core/atoms/Typography.d.ts +0 -18
  7. package/dist/components/core/atoms/index.d.ts +1 -1
  8. package/dist/components/core/atoms/types.d.ts +6 -0
  9. package/dist/components/core/molecules/ArrayEditor.d.ts +15 -0
  10. package/dist/components/core/molecules/Carousel.d.ts +8 -2
  11. package/dist/components/core/molecules/Container.d.ts +4 -4
  12. package/dist/components/core/molecules/DateRangeSelector.d.ts +3 -4
  13. package/dist/components/core/molecules/DocSidebar.d.ts +4 -4
  14. package/dist/components/core/molecules/EdgeDecoration.d.ts +3 -2
  15. package/dist/components/core/molecules/Flex.d.ts +4 -4
  16. package/dist/components/core/molecules/FlipCard.d.ts +3 -4
  17. package/dist/components/core/molecules/GradientDivider.d.ts +3 -2
  18. package/dist/components/core/molecules/MapEditor.d.ts +16 -0
  19. package/dist/components/core/molecules/ObjectEditor.d.ts +15 -0
  20. package/dist/components/core/molecules/SidePanel.d.ts +4 -4
  21. package/dist/components/core/molecules/SortableList.d.ts +4 -5
  22. package/dist/components/core/molecules/ViolationAlert.d.ts +4 -9
  23. package/dist/components/core/molecules/index.d.ts +4 -3
  24. package/dist/components/core/molecules/markdown/CodeBlock.d.ts +44 -2
  25. package/dist/components/core/organisms/ComponentPatterns.d.ts +0 -3
  26. package/dist/components/game/atoms/DialogueBubble.d.ts +2 -1
  27. package/dist/components/game/atoms/ResourceCounter.d.ts +3 -2
  28. package/dist/components/game/atoms/Sprite.d.ts +2 -2
  29. package/dist/components/game/atoms/StateIndicator.d.ts +4 -5
  30. package/dist/components/game/atoms/StatusEffect.d.ts +2 -3
  31. package/dist/components/game/molecules/ActionButtons.d.ts +6 -0
  32. package/dist/components/game/molecules/GameHud.d.ts +2 -3
  33. package/dist/components/game/molecules/StatBadge.d.ts +6 -0
  34. package/dist/components/game/organisms/puzzles/state-architect/StateJsonView.d.ts +16 -0
  35. package/dist/components/game/organisms/puzzles/state-architect/index.d.ts +2 -2
  36. package/dist/components/index.cjs +2527 -2302
  37. package/dist/components/index.js +1638 -1413
  38. package/dist/docs/index.cjs +6014 -4606
  39. package/dist/docs/index.css +1252 -0
  40. package/dist/docs/index.d.cts +108 -16
  41. package/dist/docs/index.d.ts +2 -2
  42. package/dist/docs/index.js +5970 -4567
  43. package/dist/marketing/index.cjs +36 -13
  44. package/dist/marketing/index.d.cts +30 -20
  45. package/dist/marketing/index.js +36 -13
  46. package/dist/providers/index.cjs +1891 -2679
  47. package/dist/providers/index.js +990 -1778
  48. package/dist/runtime/index.cjs +1931 -2719
  49. package/dist/runtime/index.js +994 -1782
  50. package/package.json +1 -1
  51. package/dist/components/core/molecules/CodeViewer.d.ts +0 -70
  52. package/dist/components/core/molecules/DocCodeBlock.d.ts +0 -14
  53. package/dist/components/game/organisms/puzzles/state-architect/CodeView.d.ts +0 -24
@@ -1,5 +1,5 @@
1
- import * as React89 from 'react';
2
- import React89__default, { createContext, useContext, useMemo, useRef, useEffect, useCallback, Suspense, useState, useLayoutEffect, lazy, useId, useSyncExternalStore } from 'react';
1
+ import * as React85 from 'react';
2
+ import React85__default, { createContext, useContext, useMemo, useRef, useEffect, useCallback, Suspense, useState, useLayoutEffect, lazy, useId, useSyncExternalStore } from 'react';
3
3
  import { createLogger, isLogLevelEnabled } from '@almadar/logger';
4
4
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
5
5
  import { EventBusContext, useTraitScope, TraitScopeProvider } from '@almadar/ui/providers';
@@ -657,7 +657,7 @@ var init_Box = __esm({
657
657
  fixed: "fixed",
658
658
  sticky: "sticky"
659
659
  };
660
- Box = React89__default.forwardRef(
660
+ Box = React85__default.forwardRef(
661
661
  ({
662
662
  padding,
663
663
  paddingX,
@@ -707,7 +707,7 @@ var init_Box = __esm({
707
707
  onMouseLeave?.(e);
708
708
  }, [hoverEvent, eventBus, onMouseLeave]);
709
709
  const isClickable = action || onClick;
710
- return React89__default.createElement(
710
+ return React85__default.createElement(
711
711
  Component,
712
712
  {
713
713
  ref,
@@ -1446,12 +1446,20 @@ function doResolve(name) {
1446
1446
  if (asIs && typeof asIs === "object") return asIs;
1447
1447
  return LucideIcons2.HelpCircle;
1448
1448
  }
1449
- var iconAliases, resolvedCache, sizeClasses, animationClasses, Icon;
1449
+ var colorTokenClasses, iconAliases, resolvedCache, sizeClasses, animationClasses, Icon;
1450
1450
  var init_Icon = __esm({
1451
1451
  "components/core/atoms/Icon.tsx"() {
1452
1452
  "use client";
1453
1453
  init_cn();
1454
1454
  init_iconFamily();
1455
+ colorTokenClasses = {
1456
+ primary: "text-primary",
1457
+ secondary: "text-secondary",
1458
+ success: "text-success",
1459
+ warning: "text-warning",
1460
+ error: "text-error",
1461
+ muted: "text-muted-foreground"
1462
+ };
1455
1463
  iconAliases = {
1456
1464
  "close": LucideIcons2.X,
1457
1465
  "trash": LucideIcons2.Trash2,
@@ -1490,7 +1498,7 @@ var init_Icon = __esm({
1490
1498
  const directIcon = typeof icon === "string" ? void 0 : icon;
1491
1499
  const effectiveName = typeof icon === "string" ? icon : name;
1492
1500
  const family = useIconFamily();
1493
- const RenderedComponent = React89__default.useMemo(() => {
1501
+ const RenderedComponent = React85__default.useMemo(() => {
1494
1502
  if (directIcon) return null;
1495
1503
  return effectiveName ? resolveIconForFamily(effectiveName, family) : null;
1496
1504
  }, [directIcon, effectiveName, family]);
@@ -1499,10 +1507,11 @@ var init_Icon = __esm({
1499
1507
  ...effectiveStrokeWidth === void 0 ? { strokeWidth: "var(--icon-stroke-width, 2)" } : {},
1500
1508
  ...style
1501
1509
  };
1510
+ const resolvedColor = color ? color in colorTokenClasses ? colorTokenClasses[color] : color : "text-current";
1502
1511
  const composedClassName = cn(
1503
1512
  sizeClasses[size],
1504
1513
  animationClasses[animation],
1505
- color ? color : "text-current",
1514
+ resolvedColor,
1506
1515
  className
1507
1516
  );
1508
1517
  if (directIcon) {
@@ -1548,7 +1557,7 @@ function resolveIconProp(value, sizeClass) {
1548
1557
  const IconComp = value;
1549
1558
  return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
1550
1559
  }
1551
- if (React89__default.isValidElement(value)) {
1560
+ if (React85__default.isValidElement(value)) {
1552
1561
  return value;
1553
1562
  }
1554
1563
  if (typeof value === "object" && value !== null && "render" in value) {
@@ -1624,7 +1633,7 @@ var init_Button = __esm({
1624
1633
  md: "h-icon-default w-icon-default",
1625
1634
  lg: "h-icon-default w-icon-default"
1626
1635
  };
1627
- Button = React89__default.forwardRef(
1636
+ Button = React85__default.forwardRef(
1628
1637
  ({
1629
1638
  className,
1630
1639
  variant = "primary",
@@ -1689,7 +1698,7 @@ var Dialog;
1689
1698
  var init_Dialog = __esm({
1690
1699
  "components/core/atoms/Dialog.tsx"() {
1691
1700
  init_cn();
1692
- Dialog = React89__default.forwardRef(
1701
+ Dialog = React85__default.forwardRef(
1693
1702
  ({
1694
1703
  role = "dialog",
1695
1704
  "aria-modal": ariaModal = true,
@@ -1715,11 +1724,9 @@ var init_Dialog = __esm({
1715
1724
  // components/core/atoms/Typography.tsx
1716
1725
  var Typography_exports = {};
1717
1726
  __export(Typography_exports, {
1718
- Heading: () => Heading,
1719
- Text: () => Text,
1720
1727
  Typography: () => Typography
1721
1728
  });
1722
- var variantStyles2, colorStyles, weightStyles, defaultElements, typographySizeStyles, overflowStyles2, Typography, sizeStyles2, Heading, Text;
1729
+ var variantStyles2, colorStyles, weightStyles, defaultElements, typographySizeStyles, overflowStyles2, Typography;
1723
1730
  var init_Typography = __esm({
1724
1731
  "components/core/atoms/Typography.tsx"() {
1725
1732
  init_cn();
@@ -1830,83 +1837,6 @@ var init_Typography = __esm({
1830
1837
  );
1831
1838
  };
1832
1839
  Typography.displayName = "Typography";
1833
- sizeStyles2 = {
1834
- xs: "text-xs",
1835
- sm: "text-sm",
1836
- md: "text-base",
1837
- lg: "text-lg",
1838
- xl: "text-xl",
1839
- "2xl": "text-2xl",
1840
- "3xl": "text-3xl"
1841
- };
1842
- Heading = ({
1843
- level = 2,
1844
- size,
1845
- className,
1846
- ...props
1847
- }) => {
1848
- const variant = `h${level}`;
1849
- const sizeClass = size ? sizeStyles2[size] : void 0;
1850
- return /* @__PURE__ */ jsx(
1851
- Typography,
1852
- {
1853
- variant,
1854
- className: cn(sizeClass, className),
1855
- ...props
1856
- }
1857
- );
1858
- };
1859
- Heading.displayName = "Heading";
1860
- Text = ({
1861
- variant = "body",
1862
- ...props
1863
- }) => {
1864
- return /* @__PURE__ */ jsx(
1865
- Typography,
1866
- {
1867
- variant,
1868
- ...props
1869
- }
1870
- );
1871
- };
1872
- Text.displayName = "Text";
1873
- }
1874
- });
1875
- var Overlay;
1876
- var init_Overlay = __esm({
1877
- "components/core/atoms/Overlay.tsx"() {
1878
- "use client";
1879
- init_cn();
1880
- init_useEventBus();
1881
- Overlay = ({
1882
- isVisible = true,
1883
- onClick,
1884
- className,
1885
- blur = false,
1886
- action
1887
- }) => {
1888
- const eventBus = useEventBus();
1889
- if (!isVisible) return null;
1890
- const handleClick = (e) => {
1891
- if (action) {
1892
- eventBus.emit(`UI:${action}`, {});
1893
- }
1894
- onClick?.(e);
1895
- };
1896
- return /* @__PURE__ */ jsx(
1897
- "div",
1898
- {
1899
- className: cn(
1900
- "fixed inset-0 z-40",
1901
- blur && "backdrop-blur-sm",
1902
- className
1903
- ),
1904
- style: { backgroundColor: "rgba(0, 0, 0, 0.6)" },
1905
- onClick: action || onClick ? handleClick : void 0,
1906
- "aria-hidden": "true"
1907
- }
1908
- );
1909
- };
1910
1840
  }
1911
1841
  });
1912
1842
  var sizeClasses2, minWidthClasses, lookStyles, Modal;
@@ -1917,7 +1847,6 @@ var init_Modal = __esm({
1917
1847
  init_Button();
1918
1848
  init_Dialog();
1919
1849
  init_Typography();
1920
- init_Overlay();
1921
1850
  init_cn();
1922
1851
  init_useEventBus();
1923
1852
  sizeClasses2 = {
@@ -2007,130 +1936,160 @@ var init_Modal = __esm({
2007
1936
  }
2008
1937
  };
2009
1938
  return createPortal(
2010
- /* @__PURE__ */ jsxs(Fragment, { children: [
2011
- /* @__PURE__ */ jsx(
2012
- Overlay,
2013
- {
2014
- isVisible: isOpen,
2015
- onClick: handleOverlayClick,
2016
- className: "z-[1000]"
2017
- }
2018
- ),
2019
- /* @__PURE__ */ jsx(
2020
- Box,
2021
- {
2022
- className: cn(
2023
- "fixed inset-0 z-[1001] pointer-events-none",
2024
- "flex items-start justify-center px-4 pb-4 pt-[10vh]",
2025
- "max-sm:items-stretch max-sm:p-0 max-sm:pt-0"
2026
- ),
2027
- children: /* @__PURE__ */ jsxs(
2028
- Dialog,
2029
- {
2030
- ref: modalRef,
2031
- open: true,
2032
- className: cn(
2033
- // Reset browser-default dialog chrome — we own styling. `static`
2034
- // overrides the user-agent `position: absolute` so the parent
2035
- // flex container's `justify-center` actually centers the dialog
2036
- // (without this, the dialog drops out of flex flow and `m-0`
2037
- // kills the user-agent's `margin: auto` centering, pinning the
2038
- // dialog to top-left).
2039
- "static m-0 p-0 border-0 bg-transparent",
2040
- // Pre-existing dialog frame
2041
- "pointer-events-auto w-full flex flex-col bg-surface border shadow-elevation-dialog rounded-container",
2042
- // Desktop sizing + viewport-aware floor.
2043
- sizeClasses2[size],
2044
- minWidthClasses[size],
2045
- "max-h-[80vh]",
2046
- // Mobile: take the entire screen. Override desktop max-w cap,
2047
- // full height, no rounded corners, no min-width.
2048
- "max-sm:max-w-none max-sm:max-h-none max-sm:w-full max-sm:h-full max-sm:rounded-none",
2049
- lookStyles[look],
2050
- className
1939
+ /* @__PURE__ */ jsx(
1940
+ "div",
1941
+ {
1942
+ className: cn(
1943
+ "fixed inset-0 z-[1000]",
1944
+ "flex items-start justify-center px-4 pb-4 pt-[10vh]",
1945
+ "max-sm:items-stretch max-sm:p-0 max-sm:pt-0"
1946
+ ),
1947
+ style: { backgroundColor: "rgba(0, 0, 0, 0.6)" },
1948
+ onClick: handleOverlayClick,
1949
+ "aria-hidden": "true",
1950
+ children: /* @__PURE__ */ jsxs(
1951
+ Dialog,
1952
+ {
1953
+ ref: modalRef,
1954
+ open: true,
1955
+ className: cn(
1956
+ // Reset browser-default dialog chrome — we own styling. `static`
1957
+ // overrides the user-agent `position: absolute` so the parent
1958
+ // flex container's `justify-center` actually centers the dialog
1959
+ // (without this, the dialog drops out of flex flow and `m-0`
1960
+ // kills the user-agent's `margin: auto` centering, pinning the
1961
+ // dialog to top-left).
1962
+ "static m-0 p-0 border-0 bg-transparent",
1963
+ // Pre-existing dialog frame
1964
+ "pointer-events-auto w-full flex flex-col bg-surface border shadow-elevation-dialog rounded-container",
1965
+ // Desktop sizing + viewport-aware floor.
1966
+ sizeClasses2[size],
1967
+ minWidthClasses[size],
1968
+ "max-h-[80vh]",
1969
+ // Mobile: take the entire screen. Override desktop max-w cap,
1970
+ // full height, no rounded corners, no min-width.
1971
+ "max-sm:max-w-none max-sm:max-h-none max-sm:w-full max-sm:h-full max-sm:rounded-none",
1972
+ lookStyles[look],
1973
+ className
1974
+ ),
1975
+ style: dragY > 0 ? {
1976
+ transform: `translateY(${dragY}px)`,
1977
+ transition: isDragging.current ? "none" : "transform 200ms ease-out"
1978
+ } : void 0,
1979
+ ...title && { "aria-labelledby": "modal-title" },
1980
+ children: [
1981
+ /* @__PURE__ */ jsx(
1982
+ Box,
1983
+ {
1984
+ className: "hidden max-sm:flex justify-center py-2 cursor-grab active:cursor-grabbing touch-none",
1985
+ onPointerDown: (e) => {
1986
+ if (!swipeDownToClose) return;
1987
+ dragStartY.current = e.clientY;
1988
+ isDragging.current = true;
1989
+ e.target.setPointerCapture(e.pointerId);
1990
+ },
1991
+ onPointerMove: (e) => {
1992
+ if (!isDragging.current) return;
1993
+ const dy = Math.max(0, e.clientY - dragStartY.current);
1994
+ setDragY(dy);
1995
+ },
1996
+ onPointerUp: () => {
1997
+ if (!isDragging.current) return;
1998
+ isDragging.current = false;
1999
+ if (dragY > 100) {
2000
+ handleClose();
2001
+ }
2002
+ setDragY(0);
2003
+ },
2004
+ onPointerCancel: () => {
2005
+ isDragging.current = false;
2006
+ setDragY(0);
2007
+ },
2008
+ children: /* @__PURE__ */ jsx(Box, { className: "w-10 h-1 rounded-full bg-border" })
2009
+ }
2051
2010
  ),
2052
- style: dragY > 0 ? {
2053
- transform: `translateY(${dragY}px)`,
2054
- transition: isDragging.current ? "none" : "transform 200ms ease-out"
2055
- } : void 0,
2056
- ...title && { "aria-labelledby": "modal-title" },
2057
- children: [
2058
- /* @__PURE__ */ jsx(
2059
- Box,
2060
- {
2061
- className: "hidden max-sm:flex justify-center py-2 cursor-grab active:cursor-grabbing touch-none",
2062
- onPointerDown: (e) => {
2063
- if (!swipeDownToClose) return;
2064
- dragStartY.current = e.clientY;
2065
- isDragging.current = true;
2066
- e.target.setPointerCapture(e.pointerId);
2067
- },
2068
- onPointerMove: (e) => {
2069
- if (!isDragging.current) return;
2070
- const dy = Math.max(0, e.clientY - dragStartY.current);
2071
- setDragY(dy);
2072
- },
2073
- onPointerUp: () => {
2074
- if (!isDragging.current) return;
2075
- isDragging.current = false;
2076
- if (dragY > 100) {
2077
- handleClose();
2011
+ (title || showCloseButton) && /* @__PURE__ */ jsxs(
2012
+ Box,
2013
+ {
2014
+ className: cn(
2015
+ "px-6 py-4 flex items-center justify-between",
2016
+ "border-b-[length:var(--border-width)] border-border"
2017
+ ),
2018
+ children: [
2019
+ title && /* @__PURE__ */ jsx(Typography, { variant: "h4", as: "h2", id: "modal-title", children: title }),
2020
+ showCloseButton && /* @__PURE__ */ jsx(
2021
+ Button,
2022
+ {
2023
+ variant: "ghost",
2024
+ size: "sm",
2025
+ icon: "x",
2026
+ onClick: handleClose,
2027
+ "data-event": "CLOSE",
2028
+ "aria-label": t("aria.closeModal")
2078
2029
  }
2079
- setDragY(0);
2080
- },
2081
- onPointerCancel: () => {
2082
- isDragging.current = false;
2083
- setDragY(0);
2084
- },
2085
- children: /* @__PURE__ */ jsx(Box, { className: "w-10 h-1 rounded-full bg-border" })
2086
- }
2087
- ),
2088
- (title || showCloseButton) && /* @__PURE__ */ jsxs(
2089
- Box,
2090
- {
2091
- className: cn(
2092
- "px-6 py-4 flex items-center justify-between",
2093
- "border-b-[length:var(--border-width)] border-border"
2094
- ),
2095
- children: [
2096
- title && /* @__PURE__ */ jsx(Typography, { variant: "h4", as: "h2", id: "modal-title", children: title }),
2097
- showCloseButton && /* @__PURE__ */ jsx(
2098
- Button,
2099
- {
2100
- variant: "ghost",
2101
- size: "sm",
2102
- icon: "x",
2103
- onClick: handleClose,
2104
- "data-event": "CLOSE",
2105
- "aria-label": t("aria.closeModal")
2106
- }
2107
- )
2108
- ]
2109
- }
2110
- ),
2111
- /* @__PURE__ */ jsx(Box, { className: "flex-1 overflow-y-auto p-6", children }),
2112
- footer && /* @__PURE__ */ jsx(
2113
- Box,
2114
- {
2115
- className: cn(
2116
- "px-6 py-4 bg-muted",
2117
- "border-t-[length:var(--border-width)] border-border"
2118
- ),
2119
- children: footer
2120
- }
2121
- )
2122
- ]
2123
- }
2124
- )
2125
- }
2126
- )
2127
- ] }),
2030
+ )
2031
+ ]
2032
+ }
2033
+ ),
2034
+ /* @__PURE__ */ jsx(Box, { className: "flex-1 overflow-y-auto p-6", children }),
2035
+ footer && /* @__PURE__ */ jsx(
2036
+ Box,
2037
+ {
2038
+ className: cn(
2039
+ "px-6 py-4 bg-muted",
2040
+ "border-t-[length:var(--border-width)] border-border"
2041
+ ),
2042
+ children: footer
2043
+ }
2044
+ )
2045
+ ]
2046
+ }
2047
+ )
2048
+ }
2049
+ ),
2128
2050
  document.body
2129
2051
  );
2130
2052
  };
2131
2053
  Modal.displayName = "Modal";
2132
2054
  }
2133
2055
  });
2056
+ var Overlay;
2057
+ var init_Overlay = __esm({
2058
+ "components/core/atoms/Overlay.tsx"() {
2059
+ "use client";
2060
+ init_cn();
2061
+ init_useEventBus();
2062
+ Overlay = ({
2063
+ isVisible = true,
2064
+ onClick,
2065
+ className,
2066
+ blur = false,
2067
+ action
2068
+ }) => {
2069
+ const eventBus = useEventBus();
2070
+ if (!isVisible) return null;
2071
+ const handleClick = (e) => {
2072
+ if (action) {
2073
+ eventBus.emit(`UI:${action}`, {});
2074
+ }
2075
+ onClick?.(e);
2076
+ };
2077
+ return /* @__PURE__ */ jsx(
2078
+ "div",
2079
+ {
2080
+ className: cn(
2081
+ "fixed inset-0 z-40",
2082
+ blur && "backdrop-blur-sm",
2083
+ className
2084
+ ),
2085
+ style: { backgroundColor: "rgba(0, 0, 0, 0.6)" },
2086
+ onClick: action || onClick ? handleClick : void 0,
2087
+ "aria-hidden": "true"
2088
+ }
2089
+ );
2090
+ };
2091
+ }
2092
+ });
2134
2093
  var sizeWidths, Drawer;
2135
2094
  var init_Drawer = __esm({
2136
2095
  "components/core/molecules/Drawer.tsx"() {
@@ -2311,7 +2270,7 @@ var init_Drawer = __esm({
2311
2270
  Drawer.displayName = "Drawer";
2312
2271
  }
2313
2272
  });
2314
- var variantStyles3, sizeStyles3, Badge;
2273
+ var variantStyles3, sizeStyles2, Badge;
2315
2274
  var init_Badge = __esm({
2316
2275
  "components/core/atoms/Badge.tsx"() {
2317
2276
  init_cn();
@@ -2348,12 +2307,12 @@ var init_Badge = __esm({
2348
2307
  "border-[length:var(--border-width-thin)] border-border"
2349
2308
  ].join(" ")
2350
2309
  };
2351
- sizeStyles3 = {
2310
+ sizeStyles2 = {
2352
2311
  sm: "px-2 py-0.5 text-xs",
2353
2312
  md: "px-2.5 py-1 text-sm",
2354
2313
  lg: "px-3 py-1.5 text-base"
2355
2314
  };
2356
- Badge = React89__default.forwardRef(
2315
+ Badge = React85__default.forwardRef(
2357
2316
  ({ className, variant = "default", size = "sm", amount, label, icon, children, onRemove, removeLabel, ...props }, ref) => {
2358
2317
  const iconSizes3 = {
2359
2318
  sm: "h-icon-default w-icon-default",
@@ -2368,7 +2327,7 @@ var init_Badge = __esm({
2368
2327
  className: cn(
2369
2328
  "inline-flex items-center gap-1 font-bold rounded-sm",
2370
2329
  variantStyles3[variant],
2371
- sizeStyles3[size],
2330
+ sizeStyles2[size],
2372
2331
  onRemove && "pr-1",
2373
2332
  className
2374
2333
  ),
@@ -2669,7 +2628,7 @@ var init_SvgFlow = __esm({
2669
2628
  opacity = 1,
2670
2629
  className
2671
2630
  }) => {
2672
- const markerId = React89__default.useMemo(() => {
2631
+ const markerId = React85__default.useMemo(() => {
2673
2632
  flowIdCounter += 1;
2674
2633
  return `almadar-flow-arrow-${flowIdCounter}`;
2675
2634
  }, []);
@@ -3212,7 +3171,7 @@ var init_SvgRing = __esm({
3212
3171
  className,
3213
3172
  label
3214
3173
  }) => {
3215
- const gradientId = React89__default.useMemo(() => {
3174
+ const gradientId = React85__default.useMemo(() => {
3216
3175
  ringIdCounter += 1;
3217
3176
  return `almadar-ring-glow-${ringIdCounter}`;
3218
3177
  }, []);
@@ -3374,7 +3333,7 @@ var init_Input = __esm({
3374
3333
  "components/core/atoms/Input.tsx"() {
3375
3334
  init_cn();
3376
3335
  init_Icon();
3377
- Input = React89__default.forwardRef(
3336
+ Input = React85__default.forwardRef(
3378
3337
  ({
3379
3338
  className,
3380
3339
  inputType,
@@ -3495,7 +3454,7 @@ var Label;
3495
3454
  var init_Label = __esm({
3496
3455
  "components/core/atoms/Label.tsx"() {
3497
3456
  init_cn();
3498
- Label = React89__default.forwardRef(
3457
+ Label = React85__default.forwardRef(
3499
3458
  ({ className, required, children, ...props }, ref) => {
3500
3459
  return /* @__PURE__ */ jsxs(
3501
3460
  "label",
@@ -3521,7 +3480,7 @@ var Textarea;
3521
3480
  var init_Textarea = __esm({
3522
3481
  "components/core/atoms/Textarea.tsx"() {
3523
3482
  init_cn();
3524
- Textarea = React89__default.forwardRef(
3483
+ Textarea = React85__default.forwardRef(
3525
3484
  ({ className, error, ...props }, ref) => {
3526
3485
  return /* @__PURE__ */ jsx(
3527
3486
  "textarea",
@@ -3551,7 +3510,7 @@ var init_Select = __esm({
3551
3510
  "components/core/atoms/Select.tsx"() {
3552
3511
  init_cn();
3553
3512
  init_Icon();
3554
- Select = React89__default.forwardRef(
3513
+ Select = React85__default.forwardRef(
3555
3514
  ({ className, options, placeholder, error, ...props }, ref) => {
3556
3515
  return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
3557
3516
  /* @__PURE__ */ jsxs(
@@ -3593,7 +3552,7 @@ var Checkbox;
3593
3552
  var init_Checkbox = __esm({
3594
3553
  "components/core/atoms/Checkbox.tsx"() {
3595
3554
  init_cn();
3596
- Checkbox = React89__default.forwardRef(
3555
+ Checkbox = React85__default.forwardRef(
3597
3556
  ({ className, label, id, ...props }, ref) => {
3598
3557
  const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
3599
3558
  return /* @__PURE__ */ jsxs("div", { className: "flex items-center", children: [
@@ -3684,7 +3643,7 @@ var init_Card = __esm({
3684
3643
  chip: "shadow-none rounded-pill border-[length:var(--border-width)] border-border",
3685
3644
  "tile-image-first": "p-0 overflow-hidden"
3686
3645
  };
3687
- Card = React89__default.forwardRef(
3646
+ Card = React85__default.forwardRef(
3688
3647
  ({
3689
3648
  className,
3690
3649
  variant = "bordered",
@@ -3722,9 +3681,9 @@ var init_Card = __esm({
3722
3681
  }
3723
3682
  );
3724
3683
  Card.displayName = "Card";
3725
- CardHeader = React89__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
3684
+ CardHeader = React85__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
3726
3685
  CardHeader.displayName = "CardHeader";
3727
- CardTitle = React89__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
3686
+ CardTitle = React85__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
3728
3687
  "h3",
3729
3688
  {
3730
3689
  ref,
@@ -3737,11 +3696,11 @@ var init_Card = __esm({
3737
3696
  }
3738
3697
  ));
3739
3698
  CardTitle.displayName = "CardTitle";
3740
- CardContent = React89__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
3699
+ CardContent = React85__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
3741
3700
  CardContent.displayName = "CardContent";
3742
3701
  CardBody = CardContent;
3743
3702
  CardBody.displayName = "CardBody";
3744
- CardFooter = React89__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
3703
+ CardFooter = React85__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
3745
3704
  "div",
3746
3705
  {
3747
3706
  ref,
@@ -3752,7 +3711,7 @@ var init_Card = __esm({
3752
3711
  CardFooter.displayName = "CardFooter";
3753
3712
  }
3754
3713
  });
3755
- var variantStyles5, sizeStyles4, iconSizes, FilterPill;
3714
+ var variantStyles5, sizeStyles3, iconSizes, FilterPill;
3756
3715
  var init_FilterPill = __esm({
3757
3716
  "components/core/atoms/FilterPill.tsx"() {
3758
3717
  init_cn();
@@ -3786,7 +3745,7 @@ var init_FilterPill = __esm({
3786
3745
  "border-[length:var(--border-width-thin)] border-border"
3787
3746
  ].join(" ")
3788
3747
  };
3789
- sizeStyles4 = {
3748
+ sizeStyles3 = {
3790
3749
  sm: "px-2 py-0.5 text-xs",
3791
3750
  md: "px-2.5 py-1 text-sm",
3792
3751
  lg: "px-3 py-1.5 text-base"
@@ -3796,7 +3755,7 @@ var init_FilterPill = __esm({
3796
3755
  md: "w-3.5 h-3.5",
3797
3756
  lg: "w-4 h-4"
3798
3757
  };
3799
- FilterPill = React89__default.forwardRef(
3758
+ FilterPill = React85__default.forwardRef(
3800
3759
  ({
3801
3760
  className,
3802
3761
  variant = "default",
@@ -3830,7 +3789,7 @@ var init_FilterPill = __esm({
3830
3789
  className: cn(
3831
3790
  "inline-flex items-center gap-1 font-bold rounded-pill",
3832
3791
  variantStyles5[variant],
3833
- sizeStyles4[size],
3792
+ sizeStyles3[size],
3834
3793
  (onClick || clickEvent) && "cursor-pointer",
3835
3794
  className
3836
3795
  ),
@@ -3862,18 +3821,18 @@ var init_FilterPill = __esm({
3862
3821
  FilterPill.displayName = "FilterPill";
3863
3822
  }
3864
3823
  });
3865
- var sizeStyles5, Spinner;
3824
+ var sizeStyles4, Spinner;
3866
3825
  var init_Spinner = __esm({
3867
3826
  "components/core/atoms/Spinner.tsx"() {
3868
3827
  init_cn();
3869
3828
  init_Icon();
3870
- sizeStyles5 = {
3829
+ sizeStyles4 = {
3871
3830
  xs: "h-3 w-3",
3872
3831
  sm: "h-icon-default w-icon-default",
3873
3832
  md: "h-6 w-6",
3874
3833
  lg: "h-8 w-8"
3875
3834
  };
3876
- Spinner = React89__default.forwardRef(
3835
+ Spinner = React85__default.forwardRef(
3877
3836
  ({ className, size = "md", ...props }, ref) => {
3878
3837
  return /* @__PURE__ */ jsx(
3879
3838
  "div",
@@ -3881,7 +3840,7 @@ var init_Spinner = __esm({
3881
3840
  ref,
3882
3841
  className: cn("text-foreground", className),
3883
3842
  ...props,
3884
- children: /* @__PURE__ */ jsx(Icon, { name: "loader", className: cn("animate-spin", sizeStyles5[size]) })
3843
+ children: /* @__PURE__ */ jsx(Icon, { name: "loader", className: cn("animate-spin", sizeStyles4[size]) })
3885
3844
  }
3886
3845
  );
3887
3846
  }
@@ -3952,13 +3911,12 @@ var init_Avatar = __esm({
3952
3911
  actionPayload
3953
3912
  }) => {
3954
3913
  const eventBus = useEventBus();
3955
- const [imgFailed, setImgFailed] = React89__default.useState(false);
3956
- React89__default.useEffect(() => {
3914
+ const [imgFailed, setImgFailed] = React85__default.useState(false);
3915
+ React85__default.useEffect(() => {
3957
3916
  setImgFailed(false);
3958
3917
  }, [src]);
3959
3918
  const initials = providedInitials ?? (name ? generateInitials(name) : void 0);
3960
3919
  const IconComponent = typeof iconProp === "string" ? resolveIcon(iconProp) : iconProp;
3961
- const hasImage = !!src && !imgFailed;
3962
3920
  const hasIcon = !!IconComponent;
3963
3921
  const hasInitials = !!initials && !(hasIcon && !providedInitials);
3964
3922
  const getInitialsBackground = () => "bg-primary text-primary-foreground";
@@ -3984,15 +3942,13 @@ var init_Avatar = __esm({
3984
3942
  onClick: isClickable ? handleClick : void 0,
3985
3943
  role: isClickable ? "button" : void 0,
3986
3944
  tabIndex: isClickable ? 0 : void 0,
3987
- children: hasImage ? /* @__PURE__ */ jsx(
3945
+ children: src && !imgFailed ? /* @__PURE__ */ jsx(
3988
3946
  "img",
3989
3947
  {
3990
3948
  src,
3991
3949
  alt: alt || "Avatar",
3992
3950
  className: "w-full h-full object-cover",
3993
- onError: () => {
3994
- setImgFailed(true);
3995
- }
3951
+ onError: () => setImgFailed(true)
3996
3952
  }
3997
3953
  ) : hasInitials ? /* @__PURE__ */ jsx(
3998
3954
  "div",
@@ -4173,6 +4129,7 @@ var init_ProgressBar = __esm({
4173
4129
  primary: "bg-primary",
4174
4130
  success: "bg-success",
4175
4131
  warning: "bg-warning",
4132
+ error: "bg-error",
4176
4133
  danger: "bg-error"
4177
4134
  };
4178
4135
  circularSizeClasses = {
@@ -4338,7 +4295,7 @@ var init_Radio = __esm({
4338
4295
  md: "w-2.5 h-2.5",
4339
4296
  lg: "w-3 h-3"
4340
4297
  };
4341
- Radio = React89__default.forwardRef(
4298
+ Radio = React85__default.forwardRef(
4342
4299
  ({
4343
4300
  label,
4344
4301
  helperText,
@@ -4355,12 +4312,12 @@ var init_Radio = __esm({
4355
4312
  onChange,
4356
4313
  ...props
4357
4314
  }, ref) => {
4358
- const reactId = React89__default.useId();
4315
+ const reactId = React85__default.useId();
4359
4316
  const baseId = id || `radio-${reactId}`;
4360
4317
  const hasError = !!error;
4361
4318
  const eventBus = useEventBus();
4362
- const [selected, setSelected] = React89__default.useState(value);
4363
- React89__default.useEffect(() => {
4319
+ const [selected, setSelected] = React85__default.useState(value);
4320
+ React85__default.useEffect(() => {
4364
4321
  if (value !== void 0) setSelected(value);
4365
4322
  }, [value]);
4366
4323
  const pick = (next, e) => {
@@ -4542,7 +4499,7 @@ var init_Switch = __esm({
4542
4499
  "components/core/atoms/Switch.tsx"() {
4543
4500
  "use client";
4544
4501
  init_cn();
4545
- Switch = React89.forwardRef(
4502
+ Switch = React85.forwardRef(
4546
4503
  ({
4547
4504
  checked,
4548
4505
  defaultChecked = false,
@@ -4553,10 +4510,10 @@ var init_Switch = __esm({
4553
4510
  name,
4554
4511
  className
4555
4512
  }, ref) => {
4556
- const [isChecked, setIsChecked] = React89.useState(
4513
+ const [isChecked, setIsChecked] = React85.useState(
4557
4514
  checked !== void 0 ? checked : defaultChecked
4558
4515
  );
4559
- React89.useEffect(() => {
4516
+ React85.useEffect(() => {
4560
4517
  if (checked !== void 0) {
4561
4518
  setIsChecked(checked);
4562
4519
  }
@@ -4912,7 +4869,7 @@ var Aside;
4912
4869
  var init_Aside = __esm({
4913
4870
  "components/core/atoms/Aside.tsx"() {
4914
4871
  init_cn();
4915
- Aside = React89__default.forwardRef(
4872
+ Aside = React85__default.forwardRef(
4916
4873
  ({ className, children, ...rest }, ref) => /* @__PURE__ */ jsx("aside", { ref, className: cn(className), ...rest, children })
4917
4874
  );
4918
4875
  Aside.displayName = "Aside";
@@ -4990,8 +4947,8 @@ var init_LawReferenceTooltip = __esm({
4990
4947
  className
4991
4948
  }) => {
4992
4949
  const { t } = useTranslate();
4993
- const [isVisible, setIsVisible] = React89__default.useState(false);
4994
- const timeoutRef = React89__default.useRef(null);
4950
+ const [isVisible, setIsVisible] = React85__default.useState(false);
4951
+ const timeoutRef = React85__default.useRef(null);
4995
4952
  const handleMouseEnter = () => {
4996
4953
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
4997
4954
  timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
@@ -5000,7 +4957,7 @@ var init_LawReferenceTooltip = __esm({
5000
4957
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
5001
4958
  setIsVisible(false);
5002
4959
  };
5003
- React89__default.useEffect(() => {
4960
+ React85__default.useEffect(() => {
5004
4961
  return () => {
5005
4962
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
5006
4963
  };
@@ -5185,7 +5142,7 @@ var init_TimeSlotCell = __esm({
5185
5142
  TimeSlotCell.displayName = "TimeSlotCell";
5186
5143
  }
5187
5144
  });
5188
- var statusColors, pulseRingColors, sizeStyles6, StatusDot;
5145
+ var statusColors, pulseRingColors, sizeStyles5, StatusDot;
5189
5146
  var init_StatusDot = __esm({
5190
5147
  "components/core/atoms/StatusDot.tsx"() {
5191
5148
  init_cn();
@@ -5205,12 +5162,12 @@ var init_StatusDot = __esm({
5205
5162
  warning: "ring-warning",
5206
5163
  critical: "ring-error"
5207
5164
  };
5208
- sizeStyles6 = {
5165
+ sizeStyles5 = {
5209
5166
  sm: "w-2 h-2",
5210
5167
  md: "w-2.5 h-2.5",
5211
5168
  lg: "w-3 h-3"
5212
5169
  };
5213
- StatusDot = React89__default.forwardRef(
5170
+ StatusDot = React85__default.forwardRef(
5214
5171
  ({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
5215
5172
  return /* @__PURE__ */ jsx(
5216
5173
  "span",
@@ -5219,7 +5176,7 @@ var init_StatusDot = __esm({
5219
5176
  className: cn(
5220
5177
  "inline-block rounded-full flex-shrink-0",
5221
5178
  statusColors[status],
5222
- sizeStyles6[size],
5179
+ sizeStyles5[size],
5223
5180
  pulse && [
5224
5181
  "animate-pulse",
5225
5182
  "ring-2 ring-offset-1",
@@ -5249,12 +5206,12 @@ function resolveColor(dir, invert) {
5249
5206
  const isGood = invert ? !isPositive : isPositive;
5250
5207
  return isGood ? "text-success" : "text-error";
5251
5208
  }
5252
- var sizeStyles7, iconNameMap, TrendIndicator;
5209
+ var sizeStyles6, iconNameMap, TrendIndicator;
5253
5210
  var init_TrendIndicator = __esm({
5254
5211
  "components/core/atoms/TrendIndicator.tsx"() {
5255
5212
  init_Icon();
5256
5213
  init_cn();
5257
- sizeStyles7 = {
5214
+ sizeStyles6 = {
5258
5215
  sm: { icon: "w-3 h-3", text: "text-xs" },
5259
5216
  md: { icon: "w-4 h-4", text: "text-sm" },
5260
5217
  lg: { icon: "w-5 h-5", text: "text-base" }
@@ -5264,7 +5221,7 @@ var init_TrendIndicator = __esm({
5264
5221
  down: "trending-down",
5265
5222
  flat: "arrow-right"
5266
5223
  };
5267
- TrendIndicator = React89__default.forwardRef(
5224
+ TrendIndicator = React85__default.forwardRef(
5268
5225
  ({
5269
5226
  className,
5270
5227
  value,
@@ -5278,7 +5235,7 @@ var init_TrendIndicator = __esm({
5278
5235
  const dir = resolveDirection(value, direction);
5279
5236
  const colorClass = resolveColor(dir, invert);
5280
5237
  const iconName = iconNameMap[dir];
5281
- const styles = sizeStyles7[size];
5238
+ const styles = sizeStyles6[size];
5282
5239
  const formattedValue = value !== void 0 ? `${value > 0 ? "+" : ""}${value}%` : void 0;
5283
5240
  const ariaLabel = label ?? (formattedValue ? `${dir} ${formattedValue}` : dir);
5284
5241
  return /* @__PURE__ */ jsxs(
@@ -5331,7 +5288,7 @@ var init_RangeSlider = __esm({
5331
5288
  md: "w-4 h-4",
5332
5289
  lg: "w-5 h-5"
5333
5290
  };
5334
- RangeSlider = React89__default.forwardRef(
5291
+ RangeSlider = React85__default.forwardRef(
5335
5292
  ({
5336
5293
  className,
5337
5294
  min = 0,
@@ -5839,7 +5796,7 @@ var init_ContentSection = __esm({
5839
5796
  md: "py-16",
5840
5797
  lg: "py-24"
5841
5798
  };
5842
- ContentSection = React89__default.forwardRef(
5799
+ ContentSection = React85__default.forwardRef(
5843
5800
  ({ children, background = "default", padding = "lg", id, className }, ref) => {
5844
5801
  return /* @__PURE__ */ jsx(
5845
5802
  Box,
@@ -6373,7 +6330,7 @@ var init_AnimatedReveal = __esm({
6373
6330
  "scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
6374
6331
  "none": {}
6375
6332
  };
6376
- AnimatedReveal = React89__default.forwardRef(
6333
+ AnimatedReveal = React85__default.forwardRef(
6377
6334
  ({
6378
6335
  trigger = "scroll",
6379
6336
  animation = "fade-up",
@@ -6533,7 +6490,7 @@ var init_AnimatedGraphic = __esm({
6533
6490
  "components/marketing/atoms/AnimatedGraphic.tsx"() {
6534
6491
  "use client";
6535
6492
  init_cn();
6536
- AnimatedGraphic = React89__default.forwardRef(
6493
+ AnimatedGraphic = React85__default.forwardRef(
6537
6494
  ({
6538
6495
  src,
6539
6496
  svgContent,
@@ -6556,7 +6513,7 @@ var init_AnimatedGraphic = __esm({
6556
6513
  const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
6557
6514
  const resolvedSvg = svgContent ?? fetchedSvg;
6558
6515
  const prevAnimateRef = useRef(animate);
6559
- const setRef = React89__default.useCallback(
6516
+ const setRef = React85__default.useCallback(
6560
6517
  (node) => {
6561
6518
  containerRef.current = node;
6562
6519
  if (typeof ref === "function") ref(node);
@@ -6781,9 +6738,9 @@ function ScoreDisplay({
6781
6738
  ...rest
6782
6739
  }) {
6783
6740
  const resolvedValue = typeof value === "number" && !Number.isNaN(value) ? value : typeof rest.score === "number" && !Number.isNaN(rest.score) ? rest.score : 0;
6784
- const [displayValue, setDisplayValue] = React89.useState(resolvedValue);
6785
- const [isAnimating, setIsAnimating] = React89.useState(false);
6786
- React89.useEffect(() => {
6741
+ const [displayValue, setDisplayValue] = React85.useState(resolvedValue);
6742
+ const [isAnimating, setIsAnimating] = React85.useState(false);
6743
+ React85.useEffect(() => {
6787
6744
  if (!animated || displayValue === resolvedValue) {
6788
6745
  setDisplayValue(resolvedValue);
6789
6746
  return;
@@ -6853,9 +6810,9 @@ function ControlButton({
6853
6810
  className
6854
6811
  }) {
6855
6812
  const eventBus = useEventBus();
6856
- const [isPressed, setIsPressed] = React89.useState(false);
6813
+ const [isPressed, setIsPressed] = React85.useState(false);
6857
6814
  const actualPressed = pressed ?? isPressed;
6858
- const handlePointerDown = React89.useCallback(
6815
+ const handlePointerDown = React85.useCallback(
6859
6816
  (e) => {
6860
6817
  e.preventDefault();
6861
6818
  if (disabled) return;
@@ -6865,7 +6822,7 @@ function ControlButton({
6865
6822
  },
6866
6823
  [disabled, pressEvent, eventBus, onPress]
6867
6824
  );
6868
- const handlePointerUp = React89.useCallback(
6825
+ const handlePointerUp = React85.useCallback(
6869
6826
  (e) => {
6870
6827
  e.preventDefault();
6871
6828
  if (disabled) return;
@@ -6875,7 +6832,7 @@ function ControlButton({
6875
6832
  },
6876
6833
  [disabled, releaseEvent, eventBus, onRelease]
6877
6834
  );
6878
- const handlePointerLeave = React89.useCallback(
6835
+ const handlePointerLeave = React85.useCallback(
6879
6836
  (e) => {
6880
6837
  if (isPressed) {
6881
6838
  setIsPressed(false);
@@ -6943,7 +6900,7 @@ var init_ControlButton = __esm({
6943
6900
  }
6944
6901
  });
6945
6902
  function Sprite({
6946
- spritesheet,
6903
+ spritesheet = "https://almadar-kflow-assets.web.app/shared/isometric-blocks/Spritesheet/allTiles_sheet.png",
6947
6904
  frameWidth,
6948
6905
  frameHeight,
6949
6906
  frame,
@@ -7146,7 +7103,7 @@ function ResourceCounter({
7146
7103
  children: [
7147
7104
  icon && /* @__PURE__ */ jsx("span", { className: cn("flex-shrink-0", sizes.icon), children: icon }),
7148
7105
  /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: label }),
7149
- /* @__PURE__ */ jsxs("span", { className: cn("font-bold tabular-nums", color), children: [
7106
+ /* @__PURE__ */ jsxs("span", { className: cn("font-bold tabular-nums", color && (color in colorTokenClasses2 ? colorTokenClasses2[color] : color)), children: [
7150
7107
  value,
7151
7108
  max != null && /* @__PURE__ */ jsxs("span", { className: "text-muted-foreground", children: [
7152
7109
  "/",
@@ -7157,10 +7114,18 @@ function ResourceCounter({
7157
7114
  }
7158
7115
  );
7159
7116
  }
7160
- var sizeMap5;
7117
+ var colorTokenClasses2, sizeMap5;
7161
7118
  var init_ResourceCounter = __esm({
7162
7119
  "components/game/atoms/ResourceCounter.tsx"() {
7163
7120
  init_cn();
7121
+ colorTokenClasses2 = {
7122
+ primary: "text-primary",
7123
+ secondary: "text-secondary",
7124
+ success: "text-success",
7125
+ warning: "text-warning",
7126
+ error: "text-error",
7127
+ muted: "text-muted-foreground"
7128
+ };
7164
7129
  sizeMap5 = {
7165
7130
  sm: { wrapper: "text-xs gap-1 px-1.5 py-0.5", icon: "text-sm" },
7166
7131
  md: { wrapper: "text-sm gap-1.5 px-2 py-1", icon: "text-base" },
@@ -7364,14 +7329,20 @@ function XPBar({
7364
7329
  }) {
7365
7330
  const sizes = sizeMap9[size];
7366
7331
  const percentage = max > 0 ? Math.max(0, Math.min(100, current / max * 100)) : 0;
7367
- const [fillWidth, setFillWidth] = React89.useState(animated ? 0 : percentage);
7368
- React89.useEffect(() => {
7332
+ const [fillWidth, setFillWidth] = React85.useState(animated ? 0 : percentage);
7333
+ React85.useEffect(() => {
7369
7334
  if (!animated) {
7370
7335
  setFillWidth(percentage);
7371
7336
  return;
7372
7337
  }
7373
- const frame = requestAnimationFrame(() => setFillWidth(percentage));
7374
- return () => cancelAnimationFrame(frame);
7338
+ let frame2;
7339
+ const frame1 = requestAnimationFrame(() => {
7340
+ frame2 = requestAnimationFrame(() => setFillWidth(percentage));
7341
+ });
7342
+ return () => {
7343
+ cancelAnimationFrame(frame1);
7344
+ cancelAnimationFrame(frame2);
7345
+ };
7375
7346
  }, [animated, percentage]);
7376
7347
  return /* @__PURE__ */ jsxs("div", { className: cn("flex items-center gap-2", className), children: [
7377
7348
  level != null && /* @__PURE__ */ jsxs(
@@ -7409,7 +7380,7 @@ function XPBar({
7409
7380
  )
7410
7381
  }
7411
7382
  ),
7412
- showLabel && /* @__PURE__ */ jsxs("span", { className: cn("text-muted-foreground tabular-nums", sizes.text), children: [
7383
+ showLabel && /* @__PURE__ */ jsxs("span", { className: cn("text-foreground/70 tabular-nums", sizes.text), children: [
7413
7384
  current,
7414
7385
  " / ",
7415
7386
  max,
@@ -7527,7 +7498,7 @@ function StatusEffect({
7527
7498
  ),
7528
7499
  title: label,
7529
7500
  children: [
7530
- /* @__PURE__ */ jsx("span", { className: cn("flex items-center justify-center", sizes.icon), children: icon }),
7501
+ /* @__PURE__ */ jsx("span", { className: cn("flex items-center justify-center", sizes.icon), children: /* @__PURE__ */ jsx(Icon, { name: icon, size: "sm" }) }),
7531
7502
  duration !== void 0 && /* @__PURE__ */ jsx(
7532
7503
  "span",
7533
7504
  {
@@ -7558,6 +7529,7 @@ var sizeMap11, variantStyles7;
7558
7529
  var init_StatusEffect = __esm({
7559
7530
  "components/game/atoms/StatusEffect.tsx"() {
7560
7531
  init_cn();
7532
+ init_Icon();
7561
7533
  sizeMap11 = {
7562
7534
  sm: { container: "w-8 h-8", icon: "text-sm", badge: "text-xs -top-1 -right-1 w-4 h-4", timer: "text-[9px]" },
7563
7535
  md: { container: "w-10 h-10", icon: "text-base", badge: "text-xs -top-1 -right-1 w-5 h-5", timer: "text-xs" },
@@ -7623,7 +7595,7 @@ var init_DamageNumber = __esm({
7623
7595
  function DialogueBubble({
7624
7596
  speaker,
7625
7597
  text,
7626
- portrait,
7598
+ portrait = "https://almadar-kflow-assets.web.app/shared/characters/archetypes/00_base_model.png",
7627
7599
  position = "bottom",
7628
7600
  className
7629
7601
  }) {
@@ -7791,9 +7763,9 @@ function MiniMap({
7791
7763
  viewportRect,
7792
7764
  className
7793
7765
  }) {
7794
- const canvasRef = React89.useRef(null);
7795
- const frameRef = React89.useRef(0);
7796
- React89.useEffect(() => {
7766
+ const canvasRef = React85.useRef(null);
7767
+ const frameRef = React85.useRef(0);
7768
+ React85.useEffect(() => {
7797
7769
  const canvas = canvasRef.current;
7798
7770
  if (!canvas) return;
7799
7771
  const ctx = canvas.getContext("2d");
@@ -7967,7 +7939,7 @@ var init_ErrorBoundary = __esm({
7967
7939
  }
7968
7940
  );
7969
7941
  };
7970
- ErrorBoundary = class extends React89__default.Component {
7942
+ ErrorBoundary = class extends React85__default.Component {
7971
7943
  constructor(props) {
7972
7944
  super(props);
7973
7945
  __publicField(this, "reset", () => {
@@ -8598,11 +8570,11 @@ var init_wrapCallbackForEvent = __esm({
8598
8570
  "runtime/wrapCallbackForEvent.ts"() {
8599
8571
  }
8600
8572
  });
8601
- var sizeStyles8, paddingStyles3, Container;
8573
+ var sizeStyles7, paddingStyles3, Container;
8602
8574
  var init_Container = __esm({
8603
8575
  "components/core/molecules/Container.tsx"() {
8604
8576
  init_cn();
8605
- sizeStyles8 = {
8577
+ sizeStyles7 = {
8606
8578
  xs: "max-w-xs",
8607
8579
  // 320px
8608
8580
  sm: "max-w-screen-sm",
@@ -8640,7 +8612,7 @@ var init_Container = __esm({
8640
8612
  {
8641
8613
  className: cn(
8642
8614
  "w-full",
8643
- sizeStyles8[resolvedSize],
8615
+ sizeStyles7[resolvedSize],
8644
8616
  paddingStyles3[padding],
8645
8617
  center && "mx-auto",
8646
8618
  className
@@ -9402,7 +9374,7 @@ var init_Tooltip = __esm({
9402
9374
  setIsVisible(false);
9403
9375
  }, hideDelay);
9404
9376
  };
9405
- useEffect(() => {
9377
+ useLayoutEffect(() => {
9406
9378
  if (isVisible) {
9407
9379
  updatePosition();
9408
9380
  }
@@ -9413,8 +9385,8 @@ var init_Tooltip = __esm({
9413
9385
  if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
9414
9386
  };
9415
9387
  }, []);
9416
- const triggerElement = React89__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
9417
- const trigger = React89__default.cloneElement(triggerElement, {
9388
+ const triggerElement = React85__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
9389
+ const trigger = React85__default.cloneElement(triggerElement, {
9418
9390
  ref: triggerRef,
9419
9391
  onMouseEnter: handleMouseEnter,
9420
9392
  onMouseLeave: handleMouseLeave,
@@ -9561,8 +9533,8 @@ var init_Popover = __esm({
9561
9533
  onMouseEnter: handleOpen,
9562
9534
  onMouseLeave: handleClose
9563
9535
  };
9564
- const childElement = React89__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
9565
- const triggerElement = React89__default.cloneElement(
9536
+ const childElement = React85__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
9537
+ const triggerElement = React85__default.cloneElement(
9566
9538
  childElement,
9567
9539
  {
9568
9540
  ref: triggerRef,
@@ -9578,7 +9550,10 @@ var init_Popover = __esm({
9578
9550
  "bg-card border-2 border-border shadow-elevation-popover",
9579
9551
  className
9580
9552
  ),
9581
- style: computePopoverStyle(position, triggerRect, popoverWidth),
9553
+ style: {
9554
+ ...computePopoverStyle(position, triggerRect, popoverWidth),
9555
+ ...popoverWidth === 0 ? { visibility: "hidden" } : void 0
9556
+ },
9582
9557
  role: "dialog",
9583
9558
  onMouseEnter: trigger === "hover" ? handleOpen : void 0,
9584
9559
  onMouseLeave: trigger === "hover" ? handleClose : void 0,
@@ -9688,8 +9663,8 @@ var init_Menu = __esm({
9688
9663
  };
9689
9664
  const effectivePosition = direction === "rtl" ? rtlMirror[position] ?? position : position;
9690
9665
  const subMenuSideClass = direction === "rtl" ? "right-full mr-2" : "left-full ml-2";
9691
- const triggerChild = React89__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
9692
- const triggerElement = React89__default.cloneElement(
9666
+ const triggerChild = React85__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
9667
+ const triggerElement = React85__default.cloneElement(
9693
9668
  triggerChild,
9694
9669
  {
9695
9670
  ref: triggerRef,
@@ -10096,12 +10071,12 @@ var init_MapView = __esm({
10096
10071
  shadowSize: [41, 41]
10097
10072
  });
10098
10073
  L.Marker.prototype.options.icon = defaultIcon;
10099
- const { useEffect: useEffect71, useRef: useRef67, useCallback: useCallback116, useState: useState102 } = React89__default;
10074
+ const { useEffect: useEffect71, useRef: useRef66, useCallback: useCallback112, useState: useState99 } = React85__default;
10100
10075
  const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
10101
10076
  const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
10102
10077
  function MapUpdater({ centerLat, centerLng, zoom }) {
10103
10078
  const map = useMap();
10104
- const prevRef = useRef67({ centerLat, centerLng, zoom });
10079
+ const prevRef = useRef66({ centerLat, centerLng, zoom });
10105
10080
  useEffect71(() => {
10106
10081
  const prev = prevRef.current;
10107
10082
  if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
@@ -10141,8 +10116,8 @@ var init_MapView = __esm({
10141
10116
  showAttribution = true
10142
10117
  }) {
10143
10118
  const eventBus = useEventBus2();
10144
- const [clickedPosition, setClickedPosition] = useState102(null);
10145
- const handleMapClick = useCallback116((lat, lng) => {
10119
+ const [clickedPosition, setClickedPosition] = useState99(null);
10120
+ const handleMapClick = useCallback112((lat, lng) => {
10146
10121
  if (showClickedPin) {
10147
10122
  setClickedPosition({ lat, lng });
10148
10123
  }
@@ -10151,7 +10126,7 @@ var init_MapView = __esm({
10151
10126
  eventBus.emit(`UI:${mapClickEvent}`, { latitude: lat, longitude: lng });
10152
10127
  }
10153
10128
  }, [onMapClick, mapClickEvent, eventBus, showClickedPin]);
10154
- const handleMarkerClick = useCallback116((marker) => {
10129
+ const handleMarkerClick = useCallback112((marker) => {
10155
10130
  onMarkerClick?.(marker);
10156
10131
  if (markerClickEvent) {
10157
10132
  eventBus.emit(`UI:${markerClickEvent}`, { ...marker });
@@ -10160,7 +10135,7 @@ var init_MapView = __esm({
10160
10135
  return /* @__PURE__ */ jsx(
10161
10136
  Box,
10162
10137
  {
10163
- className: cn("relative isolate w-full overflow-hidden rounded-lg", className),
10138
+ className: cn("relative isolate z-0 w-full overflow-hidden rounded-lg", className),
10164
10139
  style: { height },
10165
10140
  "data-testid": "map-view",
10166
10141
  children: /* @__PURE__ */ jsxs(
@@ -10342,7 +10317,7 @@ function InputPattern({
10342
10317
  fieldName
10343
10318
  }) {
10344
10319
  const { emit } = useEventBus();
10345
- const [localValue, setLocalValue] = React89__default.useState(value);
10320
+ const [localValue, setLocalValue] = React85__default.useState(value);
10346
10321
  const handleChange = (e) => {
10347
10322
  setLocalValue(e.target.value);
10348
10323
  if (onChange) {
@@ -10380,7 +10355,7 @@ function TextareaPattern({
10380
10355
  fieldName
10381
10356
  }) {
10382
10357
  const { emit } = useEventBus();
10383
- const [localValue, setLocalValue] = React89__default.useState(value);
10358
+ const [localValue, setLocalValue] = React85__default.useState(value);
10384
10359
  const handleChange = (e) => {
10385
10360
  setLocalValue(e.target.value);
10386
10361
  if (onChange) {
@@ -10412,7 +10387,7 @@ function SelectPattern({
10412
10387
  fieldName
10413
10388
  }) {
10414
10389
  const { emit } = useEventBus();
10415
- const [localValue, setLocalValue] = React89__default.useState(value);
10390
+ const [localValue, setLocalValue] = React85__default.useState(value);
10416
10391
  const handleChange = (e) => {
10417
10392
  setLocalValue(e.target.value);
10418
10393
  if (onChange) {
@@ -10441,7 +10416,7 @@ function CheckboxPattern({
10441
10416
  className
10442
10417
  }) {
10443
10418
  const { emit } = useEventBus();
10444
- const [localChecked, setLocalChecked] = React89__default.useState(checked);
10419
+ const [localChecked, setLocalChecked] = React85__default.useState(checked);
10445
10420
  const handleChange = (e) => {
10446
10421
  setLocalChecked(e.target.checked);
10447
10422
  if (onChange) {
@@ -10629,6 +10604,7 @@ var init_ComponentPatterns = __esm({
10629
10604
  init_ProgressBar();
10630
10605
  init_Card();
10631
10606
  init_Typography();
10607
+ init_cn();
10632
10608
  init_Alert();
10633
10609
  init_Tooltip();
10634
10610
  init_Popover();
@@ -10672,8 +10648,8 @@ function ActionButtons({
10672
10648
  disabled
10673
10649
  }) {
10674
10650
  const eventBus = useEventBus();
10675
- const [activeButtons, setActiveButtons] = React89.useState(/* @__PURE__ */ new Set());
10676
- const handlePress = React89.useCallback(
10651
+ const [activeButtons, setActiveButtons] = React85.useState(/* @__PURE__ */ new Set());
10652
+ const handlePress = React85.useCallback(
10677
10653
  (id) => {
10678
10654
  setActiveButtons((prev) => new Set(prev).add(id));
10679
10655
  if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
@@ -10681,7 +10657,7 @@ function ActionButtons({
10681
10657
  },
10682
10658
  [actionEvent, eventBus, onAction]
10683
10659
  );
10684
- const handleRelease = React89.useCallback(
10660
+ const handleRelease = React85.useCallback(
10685
10661
  (id) => {
10686
10662
  setActiveButtons((prev) => {
10687
10663
  const next = new Set(prev);
@@ -10962,259 +10938,6 @@ var init_AnimatedCounter = __esm({
10962
10938
  AnimatedCounter.displayName = "AnimatedCounter";
10963
10939
  }
10964
10940
  });
10965
- var ALL_CATEGORY, GridPicker;
10966
- var init_GridPicker = __esm({
10967
- "components/core/molecules/GridPicker.tsx"() {
10968
- "use client";
10969
- init_cn();
10970
- init_Input();
10971
- init_Badge();
10972
- init_Stack();
10973
- ALL_CATEGORY = "__all__";
10974
- GridPicker = ({
10975
- items,
10976
- value,
10977
- onChange,
10978
- categories,
10979
- searchPlaceholder,
10980
- renderThumbnail,
10981
- cellSize = 32,
10982
- className
10983
- }) => {
10984
- const [search, setSearch] = useState("");
10985
- const [activeCategory, setActiveCategory] = useState(ALL_CATEGORY);
10986
- const gridRef = useRef(null);
10987
- const categoryChips = useMemo(() => {
10988
- if (categories !== void 0) return categories;
10989
- const seen = [];
10990
- for (const item of items) {
10991
- if (!seen.includes(item.category)) seen.push(item.category);
10992
- }
10993
- return seen;
10994
- }, [categories, items]);
10995
- const filtered = useMemo(() => {
10996
- const needle = search.trim().toLowerCase();
10997
- return items.filter((item) => {
10998
- const matchesCategory = activeCategory === ALL_CATEGORY || item.category === activeCategory;
10999
- const matchesSearch = needle === "" || item.label.toLowerCase().includes(needle);
11000
- return matchesCategory && matchesSearch;
11001
- });
11002
- }, [items, search, activeCategory]);
11003
- const select = useCallback(
11004
- (item) => {
11005
- onChange(item.id);
11006
- },
11007
- [onChange]
11008
- );
11009
- const handleKeyDown = useCallback(
11010
- (e, index) => {
11011
- const cells = gridRef.current?.querySelectorAll(
11012
- "[data-gridpicker-cell]"
11013
- );
11014
- if (cells === void 0 || cells.length === 0) return;
11015
- const columns = (() => {
11016
- const grid = gridRef.current;
11017
- if (grid === null) return 1;
11018
- const style = window.getComputedStyle(grid);
11019
- const cols = style.gridTemplateColumns.split(" ").filter(Boolean).length;
11020
- return cols > 0 ? cols : 1;
11021
- })();
11022
- let next = -1;
11023
- if (e.key === "ArrowRight") next = index + 1;
11024
- else if (e.key === "ArrowLeft") next = index - 1;
11025
- else if (e.key === "ArrowDown") next = index + columns;
11026
- else if (e.key === "ArrowUp") next = index - columns;
11027
- else if (e.key === "Enter" || e.key === " ") {
11028
- e.preventDefault();
11029
- select(filtered[index]);
11030
- return;
11031
- } else {
11032
- return;
11033
- }
11034
- e.preventDefault();
11035
- if (next >= 0 && next < cells.length) {
11036
- cells[next].focus();
11037
- }
11038
- },
11039
- [filtered, select]
11040
- );
11041
- return /* @__PURE__ */ jsxs(VStack, { gap: "sm", className: cn("w-full", className), children: [
11042
- /* @__PURE__ */ jsx(
11043
- Input,
11044
- {
11045
- type: "search",
11046
- icon: "search",
11047
- value: search,
11048
- placeholder: searchPlaceholder,
11049
- clearable: true,
11050
- onClear: () => setSearch(""),
11051
- onChange: (e) => setSearch(e.target.value)
11052
- }
11053
- ),
11054
- categoryChips.length > 0 && /* @__PURE__ */ jsxs(HStack, { gap: "xs", wrap: true, children: [
11055
- /* @__PURE__ */ jsx(
11056
- Badge,
11057
- {
11058
- variant: activeCategory === ALL_CATEGORY ? "primary" : "neutral",
11059
- size: "sm",
11060
- role: "button",
11061
- tabIndex: 0,
11062
- "aria-pressed": activeCategory === ALL_CATEGORY,
11063
- className: "cursor-pointer",
11064
- onClick: () => setActiveCategory(ALL_CATEGORY),
11065
- onKeyDown: (e) => {
11066
- if (e.key === "Enter" || e.key === " ") {
11067
- e.preventDefault();
11068
- setActiveCategory(ALL_CATEGORY);
11069
- }
11070
- },
11071
- children: "All"
11072
- }
11073
- ),
11074
- categoryChips.map((category) => /* @__PURE__ */ jsx(
11075
- Badge,
11076
- {
11077
- variant: activeCategory === category ? "primary" : "neutral",
11078
- size: "sm",
11079
- role: "button",
11080
- tabIndex: 0,
11081
- "aria-pressed": activeCategory === category,
11082
- className: "cursor-pointer",
11083
- onClick: () => setActiveCategory(category),
11084
- onKeyDown: (e) => {
11085
- if (e.key === "Enter" || e.key === " ") {
11086
- e.preventDefault();
11087
- setActiveCategory(category);
11088
- }
11089
- },
11090
- children: category
11091
- },
11092
- category
11093
- ))
11094
- ] }),
11095
- /* @__PURE__ */ jsx(
11096
- "div",
11097
- {
11098
- ref: gridRef,
11099
- role: "listbox",
11100
- className: "grid gap-1 overflow-y-auto max-h-64 p-1",
11101
- style: {
11102
- gridTemplateColumns: `repeat(auto-fill, minmax(${cellSize}px, 1fr))`
11103
- },
11104
- children: filtered.map((item, index) => {
11105
- const selected = item.id === value;
11106
- return /* @__PURE__ */ jsx(
11107
- "button",
11108
- {
11109
- type: "button",
11110
- role: "option",
11111
- "aria-selected": selected,
11112
- "aria-label": item.label,
11113
- title: item.label,
11114
- "data-gridpicker-cell": true,
11115
- tabIndex: selected || value === void 0 && index === 0 ? 0 : -1,
11116
- onClick: () => select(item),
11117
- onKeyDown: (e) => handleKeyDown(e, index),
11118
- className: cn(
11119
- "flex items-center justify-center rounded-sm",
11120
- "transition-colors hover:bg-muted",
11121
- "focus:outline-none focus:ring-1 focus:ring-ring",
11122
- selected && "bg-primary/10 ring-1 ring-primary"
11123
- ),
11124
- style: { width: cellSize, height: cellSize },
11125
- children: renderThumbnail(item)
11126
- },
11127
- item.id
11128
- );
11129
- })
11130
- }
11131
- )
11132
- ] });
11133
- };
11134
- GridPicker.displayName = "GridPicker";
11135
- }
11136
- });
11137
- function iconForKind(kind) {
11138
- if (kind === "audio") return "music";
11139
- if (kind === "model") return "box";
11140
- return "file";
11141
- }
11142
- var THUMB_PX, IMAGE_KINDS, AssetPicker;
11143
- var init_AssetPicker = __esm({
11144
- "components/core/molecules/AssetPicker.tsx"() {
11145
- "use client";
11146
- init_GridPicker();
11147
- init_Icon();
11148
- THUMB_PX = 32;
11149
- IMAGE_KINDS = /* @__PURE__ */ new Set([
11150
- "image",
11151
- "spritesheet",
11152
- "scene",
11153
- "portrait"
11154
- ]);
11155
- AssetPicker = ({
11156
- assets,
11157
- value,
11158
- onChange,
11159
- className
11160
- }) => {
11161
- const byUrl = useMemo(() => {
11162
- const map = /* @__PURE__ */ new Map();
11163
- for (const entry of assets) map.set(entry.url, entry);
11164
- return map;
11165
- }, [assets]);
11166
- const items = useMemo(
11167
- () => assets.map((entry) => ({
11168
- id: entry.url,
11169
- label: entry.name,
11170
- category: entry.category
11171
- })),
11172
- [assets]
11173
- );
11174
- const categories = useMemo(() => {
11175
- const seen = [];
11176
- for (const entry of assets) {
11177
- if (!seen.includes(entry.category)) seen.push(entry.category);
11178
- }
11179
- return seen;
11180
- }, [assets]);
11181
- const renderThumbnail = useCallback(
11182
- (item) => {
11183
- const entry = byUrl.get(item.id);
11184
- if (entry === void 0) return null;
11185
- if (IMAGE_KINDS.has(entry.kind)) {
11186
- return /* @__PURE__ */ jsx(
11187
- "img",
11188
- {
11189
- src: entry.thumbnailUrl ?? entry.url,
11190
- alt: entry.name,
11191
- loading: "lazy",
11192
- width: THUMB_PX,
11193
- height: THUMB_PX,
11194
- style: { width: THUMB_PX, height: THUMB_PX, objectFit: "cover" }
11195
- }
11196
- );
11197
- }
11198
- return /* @__PURE__ */ jsx(Icon, { name: iconForKind(entry.kind), size: "sm" });
11199
- },
11200
- [byUrl]
11201
- );
11202
- return /* @__PURE__ */ jsx(
11203
- GridPicker,
11204
- {
11205
- items,
11206
- value,
11207
- onChange,
11208
- categories,
11209
- renderThumbnail,
11210
- cellSize: THUMB_PX,
11211
- className
11212
- }
11213
- );
11214
- };
11215
- AssetPicker.displayName = "AssetPicker";
11216
- }
11217
- });
11218
10941
  var AuthLayout;
11219
10942
  var init_AuthLayout = __esm({
11220
10943
  "components/marketing/templates/AuthLayout.tsx"() {
@@ -13915,6 +13638,263 @@ var init_katex_min = __esm({
13915
13638
  "node_modules/katex/dist/katex.min.css"() {
13916
13639
  }
13917
13640
  });
13641
+ var Tabs;
13642
+ var init_Tabs = __esm({
13643
+ "components/core/molecules/Tabs.tsx"() {
13644
+ "use client";
13645
+ init_Icon();
13646
+ init_Badge();
13647
+ init_Typography();
13648
+ init_Box();
13649
+ init_cn();
13650
+ init_useEventBus();
13651
+ Tabs = ({
13652
+ items,
13653
+ tabs,
13654
+ defaultActiveTab,
13655
+ activeTab: controlledActiveTab,
13656
+ onTabChange,
13657
+ tabChangeEvent,
13658
+ variant = "default",
13659
+ orientation = "horizontal",
13660
+ className
13661
+ }) => {
13662
+ const rawItems = items ?? tabs ?? [];
13663
+ const safeItems = rawItems.map(({ id, value, ...rest }) => ({
13664
+ ...rest,
13665
+ id: id || value || ""
13666
+ }));
13667
+ const eventBus = useEventBus();
13668
+ const { t } = useTranslate();
13669
+ const initialActive = safeItems.find((item) => item.active)?.id;
13670
+ const [internalActiveTab, setInternalActiveTab] = useState(
13671
+ defaultActiveTab || initialActive || safeItems[0]?.id || ""
13672
+ );
13673
+ const activeTab = controlledActiveTab !== void 0 ? controlledActiveTab : internalActiveTab;
13674
+ const tabRefs = useRef({});
13675
+ const handleTabChange = (tabId, tabEvent) => {
13676
+ if (controlledActiveTab === void 0) {
13677
+ setInternalActiveTab(tabId);
13678
+ }
13679
+ onTabChange?.(tabId);
13680
+ if (tabChangeEvent) {
13681
+ eventBus.emit(`UI:${tabChangeEvent}`, { tabId });
13682
+ }
13683
+ if (tabEvent) {
13684
+ eventBus.emit(`UI:${tabEvent}`, { tabId });
13685
+ }
13686
+ };
13687
+ const handleKeyDown = (e, index) => {
13688
+ if (e.key === "ArrowLeft" || e.key === "ArrowRight") {
13689
+ e.preventDefault();
13690
+ const direction = e.key === "ArrowLeft" ? -1 : 1;
13691
+ const nextIndex = (index + direction + safeItems.length) % safeItems.length;
13692
+ const nextTab = safeItems[nextIndex];
13693
+ if (nextTab && !nextTab.disabled) {
13694
+ handleTabChange(nextTab.id);
13695
+ tabRefs.current[nextTab.id]?.focus();
13696
+ }
13697
+ } else if (e.key === "Home" || e.key === "End") {
13698
+ e.preventDefault();
13699
+ const targetIndex = e.key === "Home" ? 0 : safeItems.length - 1;
13700
+ const targetTab = safeItems[targetIndex];
13701
+ if (targetTab && !targetTab.disabled) {
13702
+ handleTabChange(targetTab.id);
13703
+ tabRefs.current[targetTab.id]?.focus();
13704
+ }
13705
+ }
13706
+ };
13707
+ const activeTabContent = safeItems.find((item) => item.id === activeTab)?.content;
13708
+ if (safeItems.length === 0) {
13709
+ return /* @__PURE__ */ jsx(Box, { className: cn("w-full", className), children: /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", className: "py-4", children: t("empty.noItems") }) });
13710
+ }
13711
+ const variantClasses2 = {
13712
+ default: [
13713
+ "border-b-[length:var(--border-width)] border-transparent",
13714
+ "hover:border-muted-foreground",
13715
+ "data-[active=true]:border-primary"
13716
+ ].join(" "),
13717
+ pills: [
13718
+ "rounded-sm",
13719
+ "data-[active=true]:bg-primary",
13720
+ "data-[active=true]:text-primary-foreground"
13721
+ ].join(" "),
13722
+ underline: [
13723
+ "border-b-[length:var(--border-width)] border-transparent",
13724
+ "data-[active=true]:border-primary"
13725
+ ].join(" ")
13726
+ };
13727
+ return /* @__PURE__ */ jsxs(Box, { className: cn("w-full", className), children: [
13728
+ /* @__PURE__ */ jsx(
13729
+ Box,
13730
+ {
13731
+ role: "tablist",
13732
+ className: cn(
13733
+ "flex",
13734
+ // Horizontal tab strip becomes a horizontally-scrollable lane
13735
+ // below its container width — phones with many tabs scroll
13736
+ // instead of clipping. `snap-x` snaps to each tab; the
13737
+ // scrollbar is hidden for a cleaner affordance (the swipe
13738
+ // gesture is the discoverability cue).
13739
+ orientation === "horizontal" ? "flex-row border-b-[length:var(--border-width)] border-border overflow-x-auto snap-x snap-mandatory [&::-webkit-scrollbar]:hidden" : "flex-col border-r-[length:var(--border-width)] border-border",
13740
+ variant === "pills" && "gap-1 p-1 bg-muted border-0 rounded-md",
13741
+ variant === "underline" && orientation === "vertical" && "border-b-0"
13742
+ ),
13743
+ children: safeItems.map((item, index) => {
13744
+ const isActive = item.id === activeTab;
13745
+ const isDisabled = item.disabled;
13746
+ return /* @__PURE__ */ jsxs(
13747
+ Box,
13748
+ {
13749
+ as: "button",
13750
+ ref: (el) => {
13751
+ tabRefs.current[item.id] = el;
13752
+ },
13753
+ role: "tab",
13754
+ "aria-selected": isActive,
13755
+ "aria-controls": `tabpanel-${item.id}`,
13756
+ "aria-disabled": isDisabled,
13757
+ onClick: () => !isDisabled && handleTabChange(item.id, item.event),
13758
+ onKeyDown: (e) => handleKeyDown(e, index),
13759
+ "data-active": isActive,
13760
+ className: cn(
13761
+ "flex items-center gap-2 px-4 py-2 text-sm font-medium transition-all whitespace-nowrap",
13762
+ orientation === "horizontal" && "snap-start shrink-0",
13763
+ "focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
13764
+ isDisabled && "opacity-50 cursor-not-allowed",
13765
+ variantClasses2[variant],
13766
+ isActive ? variant === "pills" ? "text-primary-foreground font-bold" : "text-foreground font-bold" : "text-muted-foreground hover:text-foreground"
13767
+ ),
13768
+ children: [
13769
+ item.icon && (typeof item.icon === "string" ? /* @__PURE__ */ jsx(Icon, { name: item.icon, size: "sm" }) : /* @__PURE__ */ jsx(Icon, { icon: item.icon, size: "sm" })),
13770
+ /* @__PURE__ */ jsx(Typography, { variant: "small", weight: isActive ? "semibold" : "normal", className: "!text-inherit", children: item.label }),
13771
+ item.badge !== void 0 && /* @__PURE__ */ jsx(Badge, { variant: "default", size: "sm", children: item.badge })
13772
+ ]
13773
+ },
13774
+ item.id
13775
+ );
13776
+ })
13777
+ }
13778
+ ),
13779
+ activeTabContent !== void 0 && activeTabContent !== null && /* @__PURE__ */ jsx(
13780
+ Box,
13781
+ {
13782
+ role: "tabpanel",
13783
+ id: `tabpanel-${activeTab}`,
13784
+ "aria-labelledby": `tab-${activeTab}`,
13785
+ className: "mt-4",
13786
+ children: activeTabContent
13787
+ }
13788
+ )
13789
+ ] });
13790
+ };
13791
+ Tabs.displayName = "Tabs";
13792
+ }
13793
+ });
13794
+ var ICON_NAME_ALIASES, lookStyles3, EmptyState;
13795
+ var init_EmptyState = __esm({
13796
+ "components/core/molecules/EmptyState.tsx"() {
13797
+ "use client";
13798
+ init_cn();
13799
+ init_atoms2();
13800
+ init_Box();
13801
+ init_Icon();
13802
+ init_Stack();
13803
+ init_Typography();
13804
+ init_useEventBus();
13805
+ ICON_NAME_ALIASES = {
13806
+ check: "check-circle",
13807
+ error: "x-circle",
13808
+ warning: "alert-circle"
13809
+ };
13810
+ lookStyles3 = {
13811
+ "icon-only": "",
13812
+ illustrated: "[&_svg]:w-32 [&_svg]:h-32",
13813
+ "text-only": "[&_svg]:hidden",
13814
+ mascot: "[&_svg]:w-24 [&_svg]:h-24 [&_svg]:rounded-pill"
13815
+ };
13816
+ EmptyState = ({
13817
+ icon,
13818
+ title,
13819
+ message,
13820
+ description,
13821
+ actionLabel,
13822
+ onAction,
13823
+ className,
13824
+ destructive,
13825
+ variant,
13826
+ actionEvent,
13827
+ look = "icon-only"
13828
+ }) => {
13829
+ const eventBus = useEventBus();
13830
+ const { t } = useTranslate();
13831
+ const handleAction = () => {
13832
+ if (actionEvent) eventBus.emit(`UI:${actionEvent}`, {});
13833
+ onAction?.();
13834
+ };
13835
+ const iconName = typeof icon === "string" ? ICON_NAME_ALIASES[icon] ?? icon : void 0;
13836
+ const iconComponent = typeof icon === "function" ? icon : void 0;
13837
+ const hasIcon = Boolean(iconName || iconComponent);
13838
+ const isDestructive = destructive || variant === "error";
13839
+ const isSuccess = variant === "success";
13840
+ const displayText = title || message || t("empty.noItems");
13841
+ return /* @__PURE__ */ jsxs(
13842
+ VStack,
13843
+ {
13844
+ align: "center",
13845
+ className: cn(
13846
+ "justify-center py-12 text-center",
13847
+ lookStyles3[look],
13848
+ className
13849
+ ),
13850
+ children: [
13851
+ hasIcon && /* @__PURE__ */ jsx(
13852
+ Box,
13853
+ {
13854
+ className: cn(
13855
+ "mb-4 rounded-full p-3",
13856
+ isDestructive ? "bg-error/10" : isSuccess ? "bg-success/10" : "bg-muted"
13857
+ ),
13858
+ children: /* @__PURE__ */ jsx(
13859
+ Icon,
13860
+ {
13861
+ ...iconName ? { name: iconName } : { icon: iconComponent },
13862
+ className: cn(
13863
+ "h-8 w-8",
13864
+ isDestructive ? "text-error" : isSuccess ? "text-success" : "text-muted-foreground"
13865
+ )
13866
+ }
13867
+ )
13868
+ }
13869
+ ),
13870
+ /* @__PURE__ */ jsx(
13871
+ Typography,
13872
+ {
13873
+ variant: "h3",
13874
+ className: cn(
13875
+ "text-lg font-medium",
13876
+ isDestructive ? "text-error" : isSuccess ? "text-success" : "text-foreground"
13877
+ ),
13878
+ children: displayText
13879
+ }
13880
+ ),
13881
+ description && /* @__PURE__ */ jsx(Typography, { variant: "small", className: "mt-1 text-muted-foreground max-w-sm", children: description }),
13882
+ actionLabel && (onAction || actionEvent) && /* @__PURE__ */ jsx(
13883
+ Button,
13884
+ {
13885
+ className: "mt-4",
13886
+ variant: isDestructive ? "danger" : "primary",
13887
+ onClick: handleAction,
13888
+ children: actionLabel
13889
+ }
13890
+ )
13891
+ ]
13892
+ }
13893
+ );
13894
+ };
13895
+ EmptyState.displayName = "EmptyState";
13896
+ }
13897
+ });
13918
13898
  function computeFoldRegions(code) {
13919
13899
  const lines = code.split("\n");
13920
13900
  const regions = [];
@@ -13952,9 +13932,32 @@ function computeFoldRegions(code) {
13952
13932
  function toCodeLanguage(value) {
13953
13933
  return value && CODE_LANGUAGE_SET.has(value) ? value : "text";
13954
13934
  }
13955
- var orbStyleOverrides, orbStyle, loloStyleOverrides, loloStyle, log8, CODE_LANGUAGES, CODE_LANGUAGE_SET, LINE_PROPS_FN, HIDDEN_LINE_NUMBERS, CodeBlock;
13935
+ function generateDiff(oldVal, newVal) {
13936
+ const oldLines = oldVal.split("\n");
13937
+ const newLines = newVal.split("\n");
13938
+ const diff = [];
13939
+ const maxLen = Math.max(oldLines.length, newLines.length);
13940
+ for (let i = 0; i < maxLen; i++) {
13941
+ const oldLine = oldLines[i];
13942
+ const newLine = newLines[i];
13943
+ if (oldLine === newLine) {
13944
+ diff.push({ type: "context", content: oldLine ?? "", lineNumber: i + 1 });
13945
+ } else {
13946
+ if (oldLine !== void 0) diff.push({ type: "remove", content: oldLine, lineNumber: i + 1 });
13947
+ if (newLine !== void 0) diff.push({ type: "add", content: newLine, lineNumber: i + 1 });
13948
+ }
13949
+ }
13950
+ return diff;
13951
+ }
13952
+ var orbStyleOverrides, orbStyle, loloStyleOverrides, loloStyle, log8, CODE_LANGUAGES, CODE_LANGUAGE_SET, DIFF_STYLES, LINE_PROPS_FN, HIDDEN_LINE_NUMBERS, CodeBlock;
13956
13953
  var init_CodeBlock = __esm({
13957
13954
  "components/core/molecules/markdown/CodeBlock.tsx"() {
13955
+ init_cn();
13956
+ init_atoms2();
13957
+ init_Tabs();
13958
+ init_LoadingState();
13959
+ init_ErrorState();
13960
+ init_EmptyState();
13958
13961
  init_Box();
13959
13962
  init_Button();
13960
13963
  init_Badge();
@@ -14061,9 +14064,14 @@ var init_CodeBlock = __esm({
14061
14064
  "lolo"
14062
14065
  ];
14063
14066
  CODE_LANGUAGE_SET = new Set(CODE_LANGUAGES);
14067
+ DIFF_STYLES = {
14068
+ add: { bg: "bg-success/10", prefix: "+", text: "text-success" },
14069
+ remove: { bg: "bg-error/10", prefix: "-", text: "text-error" },
14070
+ context: { bg: "", prefix: " ", text: "text-foreground" }
14071
+ };
14064
14072
  LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
14065
14073
  HIDDEN_LINE_NUMBERS = { display: "none" };
14066
- CodeBlock = React89__default.memo(
14074
+ CodeBlock = React85__default.memo(
14067
14075
  ({
14068
14076
  code: rawCode,
14069
14077
  language = "text",
@@ -14074,7 +14082,20 @@ var init_CodeBlock = __esm({
14074
14082
  className,
14075
14083
  editable = false,
14076
14084
  onChange,
14077
- errorLines
14085
+ errorLines,
14086
+ // viewer props
14087
+ title,
14088
+ mode = "code",
14089
+ diff: propDiff,
14090
+ oldValue,
14091
+ newValue,
14092
+ showLineNumbers = false,
14093
+ wordWrap = false,
14094
+ files,
14095
+ actions,
14096
+ isLoading = false,
14097
+ error,
14098
+ showCopy
14078
14099
  }) => {
14079
14100
  const code = typeof rawCode === "string" ? rawCode : String(rawCode ?? "");
14080
14101
  const isOrb = language === "orb";
@@ -14086,6 +14107,20 @@ var init_CodeBlock = __esm({
14086
14107
  const codeRef = useRef(null);
14087
14108
  const savedScrollLeftRef = useRef(0);
14088
14109
  const [copied, setCopied] = useState(false);
14110
+ const [wrap, setWrap] = useState(wordWrap);
14111
+ const [activeFileIndex, setActiveFileIndex] = useState(0);
14112
+ const activeFile = files?.[activeFileIndex];
14113
+ const activeCode = activeFile?.code ?? code;
14114
+ const activeLanguage = activeFile?.language ?? language;
14115
+ const diffLines = useMemo(() => {
14116
+ if (propDiff) return propDiff;
14117
+ if (mode === "diff" && oldValue !== void 0 && newValue !== void 0) {
14118
+ return generateDiff(oldValue, newValue);
14119
+ }
14120
+ return null;
14121
+ }, [propDiff, mode, oldValue, newValue]);
14122
+ const isViewerMode = !!(title || files || showLineNumbers || diffLines || mode === "diff" || actions);
14123
+ const effectiveCopy = showCopy ?? showCopyButton;
14089
14124
  const [editableValue, setEditableValue] = useState(code);
14090
14125
  const [editableTextareaKey, setEditableTextareaKey] = useState(0);
14091
14126
  const lastPropCodeRef = useRef(code);
@@ -14256,13 +14291,13 @@ var init_CodeBlock = __esm({
14256
14291
  }, [language, code]);
14257
14292
  const handleCopy = async () => {
14258
14293
  try {
14259
- await navigator.clipboard.writeText(code);
14294
+ await navigator.clipboard.writeText(activeCode);
14260
14295
  setCopied(true);
14261
- eventBus.emit("UI:COPY_CODE", { language, success: true });
14296
+ eventBus.emit("UI:COPY_CODE", { language: activeLanguage, success: true });
14262
14297
  setTimeout(() => setCopied(false), 2e3);
14263
14298
  } catch (err) {
14264
14299
  log8.error("Failed to copy code", { error: err instanceof Error ? err : String(err) });
14265
- eventBus.emit("UI:COPY_CODE", { language, success: false });
14300
+ eventBus.emit("UI:COPY_CODE", { language: activeLanguage, success: false });
14266
14301
  }
14267
14302
  };
14268
14303
  const handleSelectionCopy = useCallback((e) => {
@@ -14315,11 +14350,134 @@ var init_CodeBlock = __esm({
14315
14350
  }
14316
14351
  });
14317
14352
  }
14318
- const full = code.split("\n").slice(a, endLine + 1).join("\n");
14353
+ const full = activeCode.split("\n").slice(a, endLine + 1).join("\n");
14319
14354
  e.clipboardData.setData("text/plain", full);
14320
14355
  e.preventDefault();
14321
14356
  }, [code]);
14322
- const hasHeader = showLanguageBadge || showCopyButton;
14357
+ if (isLoading) {
14358
+ return /* @__PURE__ */ jsx(LoadingState, { message: t("common.loading"), className });
14359
+ }
14360
+ if (error) {
14361
+ return /* @__PURE__ */ jsx(ErrorState, { title: t("display.codeViewerError"), message: error.message, className });
14362
+ }
14363
+ if (isViewerMode && !activeCode && !diffLines) {
14364
+ return /* @__PURE__ */ jsx(EmptyState, { icon: Code, title: t("display.noCode"), description: "No code to display.", className });
14365
+ }
14366
+ if (isViewerMode) {
14367
+ const tabItems = files?.map((file, idx) => ({
14368
+ id: `file-${idx}`,
14369
+ label: file.label,
14370
+ content: null
14371
+ }));
14372
+ const lines = activeCode.split("\n");
14373
+ return /* @__PURE__ */ jsx(Card, { className: cn("overflow-hidden", className), children: /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column" }, children: [
14374
+ tabItems && tabItems.length > 1 && /* @__PURE__ */ jsx(Box, { className: "border-b border-border", children: /* @__PURE__ */ jsx(
14375
+ Tabs,
14376
+ {
14377
+ tabs: tabItems,
14378
+ activeTab: `file-${activeFileIndex}`,
14379
+ onTabChange: (id) => {
14380
+ const idx = parseInt(id.replace("file-", ""), 10);
14381
+ setActiveFileIndex(idx);
14382
+ }
14383
+ }
14384
+ ) }),
14385
+ /* @__PURE__ */ jsxs(
14386
+ HStack,
14387
+ {
14388
+ gap: "sm",
14389
+ align: "center",
14390
+ justify: "between",
14391
+ className: "px-4 py-2 border-b border-border bg-muted/30",
14392
+ children: [
14393
+ /* @__PURE__ */ jsxs(HStack, { gap: "sm", align: "center", children: [
14394
+ /* @__PURE__ */ jsx(Icon, { icon: mode === "diff" ? FileText : Code, size: "sm", className: "text-muted-foreground" }),
14395
+ title && /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "truncate", children: title }),
14396
+ activeLanguage && activeLanguage !== "text" && /* @__PURE__ */ jsx(Badge, { variant: "default", children: activeLanguage })
14397
+ ] }),
14398
+ /* @__PURE__ */ jsxs(HStack, { gap: "xs", align: "center", children: [
14399
+ /* @__PURE__ */ jsx(
14400
+ Button,
14401
+ {
14402
+ variant: "ghost",
14403
+ size: "sm",
14404
+ icon: WrapText,
14405
+ onClick: () => setWrap(!wrap),
14406
+ className: cn(wrap && "text-primary")
14407
+ }
14408
+ ),
14409
+ effectiveCopy && /* @__PURE__ */ jsx(
14410
+ Button,
14411
+ {
14412
+ variant: "ghost",
14413
+ size: "sm",
14414
+ icon: copied ? Check : Copy,
14415
+ onClick: handleCopy,
14416
+ className: cn(copied && "text-success")
14417
+ }
14418
+ ),
14419
+ actions?.map((action, idx) => /* @__PURE__ */ jsx(
14420
+ Badge,
14421
+ {
14422
+ variant: "default",
14423
+ className: "cursor-pointer hover:opacity-80 transition-opacity",
14424
+ onClick: () => {
14425
+ if (action.event) eventBus.emit(`UI:${action.event}`, {});
14426
+ },
14427
+ children: action.label
14428
+ },
14429
+ idx
14430
+ ))
14431
+ ] })
14432
+ ]
14433
+ }
14434
+ ),
14435
+ /* @__PURE__ */ jsx(Box, { className: "overflow-auto bg-muted/20", style: { maxHeight }, children: diffLines ? /* @__PURE__ */ jsx("div", { style: { display: "flex", flexDirection: "column" }, className: "font-mono text-xs", children: diffLines.map((line, idx) => {
14436
+ const style = DIFF_STYLES[line.type];
14437
+ return /* @__PURE__ */ jsxs(HStack, { gap: "none", align: "start", className: cn(style.bg, "px-4 py-0.5"), children: [
14438
+ showLineNumbers && /* @__PURE__ */ jsx(
14439
+ Typography,
14440
+ {
14441
+ variant: "caption",
14442
+ color: "secondary",
14443
+ className: "w-8 text-right mr-3 select-none tabular-nums flex-shrink-0",
14444
+ children: line.lineNumber ?? ""
14445
+ }
14446
+ ),
14447
+ /* @__PURE__ */ jsxs(
14448
+ Typography,
14449
+ {
14450
+ variant: "caption",
14451
+ className: cn("font-mono flex-1 min-w-0", style.text, wrap ? "whitespace-pre-wrap break-all" : "whitespace-pre"),
14452
+ children: [
14453
+ /* @__PURE__ */ jsx(Box, { as: "span", className: "select-none opacity-50 mr-2", children: style.prefix }),
14454
+ line.content
14455
+ ]
14456
+ }
14457
+ )
14458
+ ] }, idx);
14459
+ }) }) : /* @__PURE__ */ jsx("div", { style: { display: "flex", flexDirection: "column" }, className: "font-mono text-xs", children: lines.map((line, idx) => /* @__PURE__ */ jsxs(HStack, { gap: "none", align: "start", className: "px-4 py-0.5 hover:bg-muted/50", children: [
14460
+ showLineNumbers && /* @__PURE__ */ jsx(
14461
+ Typography,
14462
+ {
14463
+ variant: "caption",
14464
+ color: "secondary",
14465
+ className: "w-8 text-right mr-4 select-none tabular-nums flex-shrink-0",
14466
+ children: idx + 1
14467
+ }
14468
+ ),
14469
+ /* @__PURE__ */ jsx(
14470
+ Typography,
14471
+ {
14472
+ variant: "caption",
14473
+ className: cn("font-mono flex-1 min-w-0", wrap ? "whitespace-pre-wrap break-all" : "whitespace-pre"),
14474
+ children: line || " "
14475
+ }
14476
+ )
14477
+ ] }, idx)) }) })
14478
+ ] }) });
14479
+ }
14480
+ const hasHeader = showLanguageBadge || effectiveCopy;
14323
14481
  return /* @__PURE__ */ jsxs(Box, { className: `relative group ${className || ""}`, style: { display: "flex", flexDirection: "column", height: "100%" }, children: [
14324
14482
  hasHeader && /* @__PURE__ */ jsxs(
14325
14483
  HStack,
@@ -14329,7 +14487,7 @@ var init_CodeBlock = __esm({
14329
14487
  className: "px-3 py-2 bg-[var(--color-card)] rounded-t-lg border-b border-gray-700",
14330
14488
  children: [
14331
14489
  showLanguageBadge && /* @__PURE__ */ jsx(Badge, { variant: "default", size: "sm", children: language }),
14332
- showCopyButton && /* @__PURE__ */ jsx(
14490
+ effectiveCopy && /* @__PURE__ */ jsx(
14333
14491
  Button,
14334
14492
  {
14335
14493
  variant: "ghost",
@@ -14488,7 +14646,7 @@ var init_CodeBlock = __esm({
14488
14646
  )
14489
14647
  ] });
14490
14648
  },
14491
- (prev, next) => prev.language === next.language && prev.code === next.code && prev.showCopyButton === next.showCopyButton && prev.maxHeight === next.maxHeight && prev.foldable === next.foldable && prev.editable === next.editable && prev.onChange === next.onChange && prev.errorLines === next.errorLines
14649
+ (prev, next) => prev.language === next.language && prev.code === next.code && prev.showCopyButton === next.showCopyButton && prev.showCopy === next.showCopy && prev.maxHeight === next.maxHeight && prev.foldable === next.foldable && prev.editable === next.editable && prev.onChange === next.onChange && prev.errorLines === next.errorLines && prev.mode === next.mode && prev.title === next.title && prev.diff === next.diff && prev.files === next.files && prev.actions === next.actions && prev.isLoading === next.isLoading && prev.error === next.error
14492
14650
  );
14493
14651
  CodeBlock.displayName = "CodeBlock";
14494
14652
  }
@@ -14500,7 +14658,7 @@ var init_MarkdownContent = __esm({
14500
14658
  init_Box();
14501
14659
  init_CodeBlock();
14502
14660
  init_cn();
14503
- MarkdownContent = React89__default.memo(
14661
+ MarkdownContent = React85__default.memo(
14504
14662
  ({ content, direction, className }) => {
14505
14663
  const { t: _t } = useTranslate();
14506
14664
  const safeContent = typeof content === "string" ? content : String(content ?? "");
@@ -15596,7 +15754,7 @@ var init_StateMachineView = __esm({
15596
15754
  style: { top: title ? 30 : 0 },
15597
15755
  children: [
15598
15756
  entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
15599
- states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React89__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
15757
+ states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React85__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
15600
15758
  StateNode,
15601
15759
  {
15602
15760
  state,
@@ -16745,110 +16903,6 @@ var init_BookTableOfContents = __esm({
16745
16903
  BookTableOfContents.displayName = "BookTableOfContents";
16746
16904
  }
16747
16905
  });
16748
- var ICON_NAME_ALIASES, lookStyles3, EmptyState;
16749
- var init_EmptyState = __esm({
16750
- "components/core/molecules/EmptyState.tsx"() {
16751
- "use client";
16752
- init_cn();
16753
- init_atoms2();
16754
- init_Box();
16755
- init_Icon();
16756
- init_Stack();
16757
- init_Typography();
16758
- init_useEventBus();
16759
- ICON_NAME_ALIASES = {
16760
- check: "check-circle",
16761
- error: "x-circle",
16762
- warning: "alert-circle"
16763
- };
16764
- lookStyles3 = {
16765
- "icon-only": "",
16766
- illustrated: "[&_svg]:w-32 [&_svg]:h-32",
16767
- "text-only": "[&_svg]:hidden",
16768
- mascot: "[&_svg]:w-24 [&_svg]:h-24 [&_svg]:rounded-pill"
16769
- };
16770
- EmptyState = ({
16771
- icon,
16772
- title,
16773
- message,
16774
- description,
16775
- actionLabel,
16776
- onAction,
16777
- className,
16778
- destructive,
16779
- variant,
16780
- actionEvent,
16781
- look = "icon-only"
16782
- }) => {
16783
- const eventBus = useEventBus();
16784
- const { t } = useTranslate();
16785
- const handleAction = () => {
16786
- if (actionEvent) eventBus.emit(`UI:${actionEvent}`, {});
16787
- onAction?.();
16788
- };
16789
- const iconName = typeof icon === "string" ? ICON_NAME_ALIASES[icon] ?? icon : void 0;
16790
- const iconComponent = typeof icon === "function" ? icon : void 0;
16791
- const hasIcon = Boolean(iconName || iconComponent);
16792
- const isDestructive = destructive || variant === "error";
16793
- const isSuccess = variant === "success";
16794
- const displayText = title || message || t("empty.noItems");
16795
- return /* @__PURE__ */ jsxs(
16796
- VStack,
16797
- {
16798
- align: "center",
16799
- className: cn(
16800
- "justify-center py-12 text-center",
16801
- lookStyles3[look],
16802
- className
16803
- ),
16804
- children: [
16805
- hasIcon && /* @__PURE__ */ jsx(
16806
- Box,
16807
- {
16808
- className: cn(
16809
- "mb-4 rounded-full p-3",
16810
- isDestructive ? "bg-error/10" : isSuccess ? "bg-success/10" : "bg-muted"
16811
- ),
16812
- children: /* @__PURE__ */ jsx(
16813
- Icon,
16814
- {
16815
- ...iconName ? { name: iconName } : { icon: iconComponent },
16816
- className: cn(
16817
- "h-8 w-8",
16818
- isDestructive ? "text-error" : isSuccess ? "text-success" : "text-muted-foreground"
16819
- )
16820
- }
16821
- )
16822
- }
16823
- ),
16824
- /* @__PURE__ */ jsx(
16825
- Typography,
16826
- {
16827
- variant: "h3",
16828
- className: cn(
16829
- "text-lg font-medium",
16830
- isDestructive ? "text-error" : isSuccess ? "text-success" : "text-foreground"
16831
- ),
16832
- children: displayText
16833
- }
16834
- ),
16835
- description && /* @__PURE__ */ jsx(Typography, { variant: "small", className: "mt-1 text-muted-foreground max-w-sm", children: description }),
16836
- actionLabel && (onAction || actionEvent) && /* @__PURE__ */ jsx(
16837
- Button,
16838
- {
16839
- className: "mt-4",
16840
- variant: isDestructive ? "danger" : "primary",
16841
- onClick: handleAction,
16842
- children: actionLabel
16843
- }
16844
- )
16845
- ]
16846
- }
16847
- );
16848
- };
16849
- EmptyState.displayName = "EmptyState";
16850
- }
16851
- });
16852
16906
 
16853
16907
  // components/core/organisms/book/types.ts
16854
16908
  function resolveFieldMap(fieldMap) {
@@ -17201,7 +17255,7 @@ var init_Grid = __esm({
17201
17255
  as: Component = "div"
17202
17256
  }) => {
17203
17257
  const mergedStyle = rows2 ? { gridTemplateRows: `repeat(${rows2}, minmax(0, 1fr))`, ...style } : style;
17204
- return React89__default.createElement(
17258
+ return React85__default.createElement(
17205
17259
  Component,
17206
17260
  {
17207
17261
  className: cn(
@@ -21644,449 +21698,6 @@ var init_ClassifierBoard = __esm({
21644
21698
  ClassifierBoard.displayName = "ClassifierBoard";
21645
21699
  }
21646
21700
  });
21647
- function CodeView({
21648
- data,
21649
- label,
21650
- defaultExpanded = false,
21651
- className
21652
- }) {
21653
- const { t } = useTranslate();
21654
- const [expanded, setExpanded] = useState(defaultExpanded);
21655
- const jsonString = JSON.stringify(data, null, 2);
21656
- return /* @__PURE__ */ jsxs(VStack, { className: cn("rounded-lg border border-border overflow-hidden", className), gap: "none", children: [
21657
- /* @__PURE__ */ jsxs(HStack, { className: "items-center justify-between p-2 bg-muted", gap: "sm", children: [
21658
- /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-muted-foreground font-medium", children: label ?? t("stateArchitect.viewCode") }),
21659
- /* @__PURE__ */ jsx(Button, { variant: "ghost", onClick: () => setExpanded(!expanded), className: "text-xs", children: expanded ? t("stateArchitect.hideJson") : t("stateArchitect.showJson") })
21660
- ] }),
21661
- expanded && /* @__PURE__ */ jsx(Box, { className: "p-3 bg-background overflow-x-auto", children: /* @__PURE__ */ jsx(
21662
- Typography,
21663
- {
21664
- variant: "caption",
21665
- className: "text-foreground font-mono whitespace-pre text-xs leading-relaxed block",
21666
- children: jsonString
21667
- }
21668
- ) })
21669
- ] });
21670
- }
21671
- var init_CodeView = __esm({
21672
- "components/game/organisms/puzzles/state-architect/CodeView.tsx"() {
21673
- init_atoms2();
21674
- init_cn();
21675
- CodeView.displayName = "CodeView";
21676
- }
21677
- });
21678
- var Tabs;
21679
- var init_Tabs = __esm({
21680
- "components/core/molecules/Tabs.tsx"() {
21681
- "use client";
21682
- init_Icon();
21683
- init_Badge();
21684
- init_Typography();
21685
- init_Box();
21686
- init_cn();
21687
- init_useEventBus();
21688
- Tabs = ({
21689
- items,
21690
- tabs,
21691
- defaultActiveTab,
21692
- activeTab: controlledActiveTab,
21693
- onTabChange,
21694
- tabChangeEvent,
21695
- variant = "default",
21696
- orientation = "horizontal",
21697
- className
21698
- }) => {
21699
- const rawItems = items ?? tabs ?? [];
21700
- const safeItems = rawItems.map(({ id, value, ...rest }) => ({
21701
- ...rest,
21702
- id: id || value || ""
21703
- }));
21704
- const eventBus = useEventBus();
21705
- const { t } = useTranslate();
21706
- const initialActive = safeItems.find((item) => item.active)?.id;
21707
- const [internalActiveTab, setInternalActiveTab] = useState(
21708
- defaultActiveTab || initialActive || safeItems[0]?.id || ""
21709
- );
21710
- const activeTab = controlledActiveTab !== void 0 ? controlledActiveTab : internalActiveTab;
21711
- const tabRefs = useRef({});
21712
- const handleTabChange = (tabId, tabEvent) => {
21713
- if (controlledActiveTab === void 0) {
21714
- setInternalActiveTab(tabId);
21715
- }
21716
- onTabChange?.(tabId);
21717
- if (tabChangeEvent) {
21718
- eventBus.emit(`UI:${tabChangeEvent}`, { tabId });
21719
- }
21720
- if (tabEvent) {
21721
- eventBus.emit(`UI:${tabEvent}`, { tabId });
21722
- }
21723
- };
21724
- const handleKeyDown = (e, index) => {
21725
- if (e.key === "ArrowLeft" || e.key === "ArrowRight") {
21726
- e.preventDefault();
21727
- const direction = e.key === "ArrowLeft" ? -1 : 1;
21728
- const nextIndex = (index + direction + safeItems.length) % safeItems.length;
21729
- const nextTab = safeItems[nextIndex];
21730
- if (nextTab && !nextTab.disabled) {
21731
- handleTabChange(nextTab.id);
21732
- tabRefs.current[nextTab.id]?.focus();
21733
- }
21734
- } else if (e.key === "Home" || e.key === "End") {
21735
- e.preventDefault();
21736
- const targetIndex = e.key === "Home" ? 0 : safeItems.length - 1;
21737
- const targetTab = safeItems[targetIndex];
21738
- if (targetTab && !targetTab.disabled) {
21739
- handleTabChange(targetTab.id);
21740
- tabRefs.current[targetTab.id]?.focus();
21741
- }
21742
- }
21743
- };
21744
- const activeTabContent = safeItems.find((item) => item.id === activeTab)?.content;
21745
- if (safeItems.length === 0) {
21746
- return /* @__PURE__ */ jsx(Box, { className: cn("w-full", className), children: /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", className: "py-4", children: t("empty.noItems") }) });
21747
- }
21748
- const variantClasses2 = {
21749
- default: [
21750
- "border-b-[length:var(--border-width)] border-transparent",
21751
- "hover:border-muted-foreground",
21752
- "data-[active=true]:border-primary"
21753
- ].join(" "),
21754
- pills: [
21755
- "rounded-sm",
21756
- "data-[active=true]:bg-primary",
21757
- "data-[active=true]:text-primary-foreground"
21758
- ].join(" "),
21759
- underline: [
21760
- "border-b-[length:var(--border-width)] border-transparent",
21761
- "data-[active=true]:border-primary"
21762
- ].join(" ")
21763
- };
21764
- return /* @__PURE__ */ jsxs(Box, { className: cn("w-full", className), children: [
21765
- /* @__PURE__ */ jsx(
21766
- Box,
21767
- {
21768
- role: "tablist",
21769
- className: cn(
21770
- "flex",
21771
- // Horizontal tab strip becomes a horizontally-scrollable lane
21772
- // below its container width — phones with many tabs scroll
21773
- // instead of clipping. `snap-x` snaps to each tab; the
21774
- // scrollbar is hidden for a cleaner affordance (the swipe
21775
- // gesture is the discoverability cue).
21776
- orientation === "horizontal" ? "flex-row border-b-[length:var(--border-width)] border-border overflow-x-auto snap-x snap-mandatory [&::-webkit-scrollbar]:hidden" : "flex-col border-r-[length:var(--border-width)] border-border",
21777
- variant === "pills" && "gap-1 p-1 bg-muted border-0 rounded-md",
21778
- variant === "underline" && orientation === "vertical" && "border-b-0"
21779
- ),
21780
- children: safeItems.map((item, index) => {
21781
- const isActive = item.id === activeTab;
21782
- const isDisabled = item.disabled;
21783
- return /* @__PURE__ */ jsxs(
21784
- Box,
21785
- {
21786
- as: "button",
21787
- ref: (el) => {
21788
- tabRefs.current[item.id] = el;
21789
- },
21790
- role: "tab",
21791
- "aria-selected": isActive,
21792
- "aria-controls": `tabpanel-${item.id}`,
21793
- "aria-disabled": isDisabled,
21794
- onClick: () => !isDisabled && handleTabChange(item.id, item.event),
21795
- onKeyDown: (e) => handleKeyDown(e, index),
21796
- "data-active": isActive,
21797
- className: cn(
21798
- "flex items-center gap-2 px-4 py-2 text-sm font-medium transition-all whitespace-nowrap",
21799
- orientation === "horizontal" && "snap-start shrink-0",
21800
- "focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
21801
- isDisabled && "opacity-50 cursor-not-allowed",
21802
- variantClasses2[variant],
21803
- isActive ? variant === "pills" ? "text-primary-foreground font-bold" : "text-foreground font-bold" : "text-muted-foreground hover:text-foreground"
21804
- ),
21805
- children: [
21806
- item.icon && (typeof item.icon === "string" ? /* @__PURE__ */ jsx(Icon, { name: item.icon, size: "sm" }) : /* @__PURE__ */ jsx(Icon, { icon: item.icon, size: "sm" })),
21807
- /* @__PURE__ */ jsx(Typography, { variant: "small", weight: isActive ? "semibold" : "normal", className: "!text-inherit", children: item.label }),
21808
- item.badge !== void 0 && /* @__PURE__ */ jsx(Badge, { variant: "default", size: "sm", children: item.badge })
21809
- ]
21810
- },
21811
- item.id
21812
- );
21813
- })
21814
- }
21815
- ),
21816
- activeTabContent !== void 0 && activeTabContent !== null && /* @__PURE__ */ jsx(
21817
- Box,
21818
- {
21819
- role: "tabpanel",
21820
- id: `tabpanel-${activeTab}`,
21821
- "aria-labelledby": `tab-${activeTab}`,
21822
- className: "mt-4",
21823
- children: activeTabContent
21824
- }
21825
- )
21826
- ] });
21827
- };
21828
- Tabs.displayName = "Tabs";
21829
- }
21830
- });
21831
- function generateDiff(oldVal, newVal) {
21832
- const oldLines = oldVal.split("\n");
21833
- const newLines = newVal.split("\n");
21834
- const diff = [];
21835
- const maxLen = Math.max(oldLines.length, newLines.length);
21836
- for (let i = 0; i < maxLen; i++) {
21837
- const oldLine = oldLines[i];
21838
- const newLine = newLines[i];
21839
- if (oldLine === newLine) {
21840
- diff.push({ type: "context", content: oldLine ?? "", lineNumber: i + 1 });
21841
- } else {
21842
- if (oldLine !== void 0) {
21843
- diff.push({ type: "remove", content: oldLine, lineNumber: i + 1 });
21844
- }
21845
- if (newLine !== void 0) {
21846
- diff.push({ type: "add", content: newLine, lineNumber: i + 1 });
21847
- }
21848
- }
21849
- }
21850
- return diff;
21851
- }
21852
- var DIFF_STYLES, CodeViewer;
21853
- var init_CodeViewer = __esm({
21854
- "components/core/molecules/CodeViewer.tsx"() {
21855
- "use client";
21856
- init_cn();
21857
- init_atoms2();
21858
- init_Stack();
21859
- init_LoadingState();
21860
- init_ErrorState();
21861
- init_EmptyState();
21862
- init_Tabs();
21863
- init_useEventBus();
21864
- DIFF_STYLES = {
21865
- add: {
21866
- bg: "bg-success/10",
21867
- prefix: "+",
21868
- text: "text-success"
21869
- },
21870
- remove: {
21871
- bg: "bg-error/10",
21872
- prefix: "-",
21873
- text: "text-error"
21874
- },
21875
- context: {
21876
- bg: "",
21877
- prefix: " ",
21878
- text: "text-foreground"
21879
- }
21880
- };
21881
- CodeViewer = ({
21882
- title,
21883
- code,
21884
- language,
21885
- diff: propDiff,
21886
- oldValue,
21887
- newValue,
21888
- mode = "code",
21889
- showLineNumbers = true,
21890
- showCopy = true,
21891
- wordWrap = false,
21892
- maxHeight = 500,
21893
- files,
21894
- actions,
21895
- entity,
21896
- isLoading = false,
21897
- error,
21898
- className
21899
- }) => {
21900
- const eventBus = useEventBus();
21901
- const { t } = useTranslate();
21902
- const [copied, setCopied] = useState(false);
21903
- const [wrap, setWrap] = useState(wordWrap);
21904
- const [activeFileIndex, setActiveFileIndex] = useState(0);
21905
- const handleAction = useCallback(
21906
- (action) => {
21907
- if (action.event) {
21908
- eventBus.emit(`UI:${action.event}`, {});
21909
- }
21910
- },
21911
- [eventBus]
21912
- );
21913
- const activeFile = files?.[activeFileIndex];
21914
- const activeCode = activeFile?.code ?? code ?? "";
21915
- const activeLanguage = activeFile?.language ?? language ?? "text";
21916
- const lines = useMemo(() => activeCode.split("\n"), [activeCode]);
21917
- const diffLines = useMemo(() => {
21918
- if (propDiff) return propDiff;
21919
- if (mode === "diff" && oldValue !== void 0 && newValue !== void 0) {
21920
- return generateDiff(oldValue, newValue);
21921
- }
21922
- return null;
21923
- }, [propDiff, mode, oldValue, newValue]);
21924
- const handleCopy = useCallback(async () => {
21925
- try {
21926
- await navigator.clipboard.writeText(activeCode);
21927
- setCopied(true);
21928
- eventBus.emit("UI:CODE_COPY", { language: activeLanguage });
21929
- setTimeout(() => setCopied(false), 2e3);
21930
- } catch {
21931
- }
21932
- }, [activeCode, eventBus, activeLanguage]);
21933
- const tabItems = files?.map((file, idx) => ({
21934
- id: `file-${idx}`,
21935
- label: file.label,
21936
- content: null
21937
- }));
21938
- if (isLoading) {
21939
- return /* @__PURE__ */ jsx(LoadingState, { message: t("common.loading"), className });
21940
- }
21941
- if (error) {
21942
- return /* @__PURE__ */ jsx(
21943
- ErrorState,
21944
- {
21945
- title: t("display.codeViewerError"),
21946
- message: error.message,
21947
- className
21948
- }
21949
- );
21950
- }
21951
- if (!activeCode && !diffLines) {
21952
- return /* @__PURE__ */ jsx(
21953
- EmptyState,
21954
- {
21955
- icon: Code,
21956
- title: t("display.noCode"),
21957
- description: "No code to display.",
21958
- className
21959
- }
21960
- );
21961
- }
21962
- return /* @__PURE__ */ jsx(Card, { className: cn("overflow-hidden", className), children: /* @__PURE__ */ jsxs(VStack, { gap: "none", children: [
21963
- tabItems && tabItems.length > 1 && /* @__PURE__ */ jsx(Box, { className: "border-b border-border", children: /* @__PURE__ */ jsx(
21964
- Tabs,
21965
- {
21966
- tabs: tabItems,
21967
- activeTab: `file-${activeFileIndex}`,
21968
- onTabChange: (id) => {
21969
- const idx = parseInt(id.replace("file-", ""), 10);
21970
- setActiveFileIndex(idx);
21971
- }
21972
- }
21973
- ) }),
21974
- /* @__PURE__ */ jsxs(
21975
- HStack,
21976
- {
21977
- gap: "sm",
21978
- align: "center",
21979
- justify: "between",
21980
- className: "px-4 py-2 border-b border-border bg-muted/30",
21981
- children: [
21982
- /* @__PURE__ */ jsxs(HStack, { gap: "sm", align: "center", children: [
21983
- /* @__PURE__ */ jsx(Icon, { icon: mode === "diff" ? FileText : Code, size: "sm", className: "text-muted-foreground" }),
21984
- title && /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "truncate", children: title }),
21985
- activeLanguage && activeLanguage !== "text" && /* @__PURE__ */ jsx(Badge, { variant: "default", children: activeLanguage })
21986
- ] }),
21987
- /* @__PURE__ */ jsxs(HStack, { gap: "xs", align: "center", children: [
21988
- /* @__PURE__ */ jsx(
21989
- Button,
21990
- {
21991
- variant: "ghost",
21992
- size: "sm",
21993
- icon: WrapText,
21994
- onClick: () => setWrap(!wrap),
21995
- className: cn(wrap && "text-primary")
21996
- }
21997
- ),
21998
- showCopy && /* @__PURE__ */ jsx(
21999
- Button,
22000
- {
22001
- variant: "ghost",
22002
- size: "sm",
22003
- icon: copied ? Check : Copy,
22004
- onClick: handleCopy,
22005
- className: cn(copied && "text-success")
22006
- }
22007
- ),
22008
- actions?.map((action, idx) => /* @__PURE__ */ jsx(
22009
- Badge,
22010
- {
22011
- variant: "default",
22012
- className: "cursor-pointer hover:opacity-80 transition-opacity",
22013
- onClick: () => handleAction(action),
22014
- children: action.label
22015
- },
22016
- idx
22017
- ))
22018
- ] })
22019
- ]
22020
- }
22021
- ),
22022
- /* @__PURE__ */ jsx(
22023
- Box,
22024
- {
22025
- className: "overflow-auto bg-muted/20",
22026
- style: { maxHeight },
22027
- children: diffLines ? (
22028
- /* Diff mode */
22029
- /* @__PURE__ */ jsx(VStack, { gap: "none", className: "font-mono text-xs", children: diffLines.map((line, idx) => {
22030
- const style = DIFF_STYLES[line.type];
22031
- return /* @__PURE__ */ jsxs(HStack, { gap: "none", align: "start", className: cn(style.bg, "px-4 py-0.5"), children: [
22032
- showLineNumbers && /* @__PURE__ */ jsx(
22033
- Typography,
22034
- {
22035
- variant: "caption",
22036
- color: "secondary",
22037
- className: "w-8 text-right mr-3 select-none tabular-nums flex-shrink-0",
22038
- children: line.lineNumber ?? ""
22039
- }
22040
- ),
22041
- /* @__PURE__ */ jsxs(
22042
- Typography,
22043
- {
22044
- variant: "caption",
22045
- className: cn(
22046
- "font-mono flex-1 min-w-0",
22047
- style.text,
22048
- wrap ? "whitespace-pre-wrap break-all" : "whitespace-pre"
22049
- ),
22050
- children: [
22051
- /* @__PURE__ */ jsx(Box, { as: "span", className: "select-none opacity-50 mr-2", children: style.prefix }),
22052
- line.content
22053
- ]
22054
- }
22055
- )
22056
- ] }, idx);
22057
- }) })
22058
- ) : (
22059
- /* Code mode */
22060
- /* @__PURE__ */ jsx(VStack, { gap: "none", className: "font-mono text-xs", children: lines.map((line, idx) => /* @__PURE__ */ jsxs(HStack, { gap: "none", align: "start", className: "px-4 py-0.5 hover:bg-muted/50", children: [
22061
- showLineNumbers && /* @__PURE__ */ jsx(
22062
- Typography,
22063
- {
22064
- variant: "caption",
22065
- color: "secondary",
22066
- className: "w-8 text-right mr-4 select-none tabular-nums flex-shrink-0",
22067
- children: idx + 1
22068
- }
22069
- ),
22070
- /* @__PURE__ */ jsx(
22071
- Typography,
22072
- {
22073
- variant: "caption",
22074
- className: cn(
22075
- "font-mono flex-1 min-w-0",
22076
- wrap ? "whitespace-pre-wrap break-all" : "whitespace-pre"
22077
- ),
22078
- children: line || " "
22079
- }
22080
- )
22081
- ] }, idx)) })
22082
- )
22083
- }
22084
- )
22085
- ] }) });
22086
- };
22087
- CodeViewer.displayName = "CodeViewer";
22088
- }
22089
- });
22090
21701
  function CombatLog({
22091
21702
  events: events2,
22092
21703
  maxVisible = 50,
@@ -22351,7 +21962,7 @@ function CounterMinimal({
22351
21962
  Button,
22352
21963
  {
22353
21964
  variant: "secondary",
22354
- size: sizeStyles9[size].button,
21965
+ size: sizeStyles8[size].button,
22355
21966
  onClick: onDecrement,
22356
21967
  disabled: resolved.decrementDisabled,
22357
21968
  icon: "minus",
@@ -22363,7 +21974,7 @@ function CounterMinimal({
22363
21974
  {
22364
21975
  variant: "h1",
22365
21976
  className: cn(
22366
- sizeStyles9[size].display,
21977
+ sizeStyles8[size].display,
22367
21978
  "font-bold tabular-nums min-w-[3ch] text-center"
22368
21979
  ),
22369
21980
  children: resolved.count
@@ -22373,7 +21984,7 @@ function CounterMinimal({
22373
21984
  Button,
22374
21985
  {
22375
21986
  variant: "secondary",
22376
- size: sizeStyles9[size].button,
21987
+ size: sizeStyles8[size].button,
22377
21988
  onClick: onIncrement,
22378
21989
  disabled: resolved.incrementDisabled,
22379
21990
  icon: "plus",
@@ -22408,7 +22019,7 @@ function CounterStandard({
22408
22019
  {
22409
22020
  variant: "h1",
22410
22021
  className: cn(
22411
- sizeStyles9[size].display,
22022
+ sizeStyles8[size].display,
22412
22023
  "font-bold tabular-nums text-primary-600"
22413
22024
  ),
22414
22025
  children: resolved.count
@@ -22419,7 +22030,7 @@ function CounterStandard({
22419
22030
  Button,
22420
22031
  {
22421
22032
  variant: "secondary",
22422
- size: sizeStyles9[size].button,
22033
+ size: sizeStyles8[size].button,
22423
22034
  onClick: onDecrement,
22424
22035
  disabled: resolved.decrementDisabled,
22425
22036
  icon: "minus"
@@ -22429,7 +22040,7 @@ function CounterStandard({
22429
22040
  Button,
22430
22041
  {
22431
22042
  variant: "primary",
22432
- size: sizeStyles9[size].button,
22043
+ size: sizeStyles8[size].button,
22433
22044
  onClick: onIncrement,
22434
22045
  disabled: resolved.incrementDisabled,
22435
22046
  icon: "plus"
@@ -22475,7 +22086,7 @@ function CounterFull({
22475
22086
  {
22476
22087
  variant: "h1",
22477
22088
  className: cn(
22478
- sizeStyles9[size].display,
22089
+ sizeStyles8[size].display,
22479
22090
  "font-bold tabular-nums text-primary-600"
22480
22091
  ),
22481
22092
  children: resolved.count
@@ -22488,7 +22099,7 @@ function CounterFull({
22488
22099
  Button,
22489
22100
  {
22490
22101
  variant: "secondary",
22491
- size: sizeStyles9[size].button,
22102
+ size: sizeStyles8[size].button,
22492
22103
  onClick: onDecrement,
22493
22104
  disabled: resolved.decrementDisabled,
22494
22105
  icon: "minus",
@@ -22499,7 +22110,7 @@ function CounterFull({
22499
22110
  Button,
22500
22111
  {
22501
22112
  variant: "primary",
22502
- size: sizeStyles9[size].button,
22113
+ size: sizeStyles8[size].button,
22503
22114
  onClick: onIncrement,
22504
22115
  disabled: resolved.incrementDisabled,
22505
22116
  icon: "plus",
@@ -22519,7 +22130,7 @@ function CounterFull({
22519
22130
  )
22520
22131
  ] }) });
22521
22132
  }
22522
- var sizeStyles9, CounterTemplate;
22133
+ var sizeStyles8, CounterTemplate;
22523
22134
  var init_CounterTemplate = __esm({
22524
22135
  "components/core/templates/CounterTemplate.tsx"() {
22525
22136
  init_cn();
@@ -22527,7 +22138,7 @@ var init_CounterTemplate = __esm({
22527
22138
  init_Stack();
22528
22139
  init_Typography();
22529
22140
  init_Button();
22530
- sizeStyles9 = {
22141
+ sizeStyles8 = {
22531
22142
  sm: { display: "text-4xl", button: "sm" },
22532
22143
  md: { display: "text-6xl", button: "md" },
22533
22144
  lg: { display: "text-8xl", button: "lg" }
@@ -22561,7 +22172,7 @@ function CraftingRecipe({
22561
22172
  className
22562
22173
  }) {
22563
22174
  const eventBus = useEventBus();
22564
- const handleCraft = React89.useCallback(() => {
22175
+ const handleCraft = React85.useCallback(() => {
22565
22176
  onCraft?.();
22566
22177
  if (craftEvent) {
22567
22178
  eventBus.emit(craftEvent, { output: output.label });
@@ -22578,7 +22189,7 @@ function CraftingRecipe({
22578
22189
  children: [
22579
22190
  /* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-wrap items-center", children: inputs.map((ingredient, index) => {
22580
22191
  const hasSufficient = ingredient.available >= ingredient.required;
22581
- return /* @__PURE__ */ jsxs(React89.Fragment, { children: [
22192
+ return /* @__PURE__ */ jsxs(React85.Fragment, { children: [
22582
22193
  /* @__PURE__ */ jsx(Box, { className: "relative", children: /* @__PURE__ */ jsx(
22583
22194
  ItemSlot,
22584
22195
  {
@@ -22641,8 +22252,8 @@ function DPad({
22641
22252
  }) {
22642
22253
  const eventBus = useEventBus();
22643
22254
  const sizes = sizeMap15[size];
22644
- const [activeDirections, setActiveDirections] = React89.useState(/* @__PURE__ */ new Set());
22645
- const handlePress = React89.useCallback(
22255
+ const [activeDirections, setActiveDirections] = React85.useState(/* @__PURE__ */ new Set());
22256
+ const handlePress = React85.useCallback(
22646
22257
  (direction) => {
22647
22258
  setActiveDirections((prev) => new Set(prev).add(direction));
22648
22259
  if (directionEvent) eventBus.emit(`UI:${directionEvent}`, { direction, pressed: true });
@@ -22650,7 +22261,7 @@ function DPad({
22650
22261
  },
22651
22262
  [directionEvent, eventBus, onDirection]
22652
22263
  );
22653
- const handleRelease = React89.useCallback(
22264
+ const handleRelease = React85.useCallback(
22654
22265
  (direction) => {
22655
22266
  setActiveDirections((prev) => {
22656
22267
  const next = new Set(prev);
@@ -23336,14 +22947,14 @@ function useDataDnd(args) {
23336
22947
  const isZone = Boolean(dragGroup || accepts || sortable);
23337
22948
  const enabled = isZone || Boolean(dndRoot);
23338
22949
  const eventBus = useEventBus();
23339
- const parentRoot = React89__default.useContext(RootCtx);
22950
+ const parentRoot = React85__default.useContext(RootCtx);
23340
22951
  const isRoot = enabled && parentRoot === null;
23341
- const zoneId = React89__default.useId();
22952
+ const zoneId = React85__default.useId();
23342
22953
  const ownGroup = dragGroup ?? accepts ?? zoneId;
23343
- const [optimisticOrders, setOptimisticOrders] = React89__default.useState(() => /* @__PURE__ */ new Map());
23344
- const optimisticOrdersRef = React89__default.useRef(optimisticOrders);
22954
+ const [optimisticOrders, setOptimisticOrders] = React85__default.useState(() => /* @__PURE__ */ new Map());
22955
+ const optimisticOrdersRef = React85__default.useRef(optimisticOrders);
23345
22956
  optimisticOrdersRef.current = optimisticOrders;
23346
- const clearOptimisticOrder = React89__default.useCallback((group) => {
22957
+ const clearOptimisticOrder = React85__default.useCallback((group) => {
23347
22958
  setOptimisticOrders((prev) => {
23348
22959
  if (!prev.has(group)) return prev;
23349
22960
  const next = new Map(prev);
@@ -23368,7 +22979,7 @@ function useDataDnd(args) {
23368
22979
  const raw = it[dndItemIdField];
23369
22980
  return String(raw ?? `__idx_${idx}`);
23370
22981
  }).join("|");
23371
- const itemIds = React89__default.useMemo(
22982
+ const itemIds = React85__default.useMemo(
23372
22983
  () => orderedItems.map((it, idx) => {
23373
22984
  const raw = it[dndItemIdField];
23374
22985
  return raw ?? `__idx_${idx}`;
@@ -23376,7 +22987,7 @@ function useDataDnd(args) {
23376
22987
  [itemIdsSignature]
23377
22988
  );
23378
22989
  const itemsContentSig = items.map((it, idx) => String(it[dndItemIdField] ?? `__${idx}`)).join("|");
23379
- React89__default.useEffect(() => {
22990
+ React85__default.useEffect(() => {
23380
22991
  const root = isRoot ? null : parentRoot;
23381
22992
  if (root) {
23382
22993
  root.clearOptimisticOrder(ownGroup);
@@ -23384,20 +22995,20 @@ function useDataDnd(args) {
23384
22995
  clearOptimisticOrder(ownGroup);
23385
22996
  }
23386
22997
  }, [itemsContentSig, ownGroup]);
23387
- const zonesRef = React89__default.useRef(/* @__PURE__ */ new Map());
23388
- const registerZone = React89__default.useCallback((zoneId2, meta2) => {
22998
+ const zonesRef = React85__default.useRef(/* @__PURE__ */ new Map());
22999
+ const registerZone = React85__default.useCallback((zoneId2, meta2) => {
23389
23000
  zonesRef.current.set(zoneId2, meta2);
23390
23001
  }, []);
23391
- const unregisterZone = React89__default.useCallback((zoneId2) => {
23002
+ const unregisterZone = React85__default.useCallback((zoneId2) => {
23392
23003
  zonesRef.current.delete(zoneId2);
23393
23004
  }, []);
23394
- const [activeDrag, setActiveDrag] = React89__default.useState(null);
23395
- const [overZoneGroup, setOverZoneGroup] = React89__default.useState(null);
23396
- const meta = React89__default.useMemo(
23005
+ const [activeDrag, setActiveDrag] = React85__default.useState(null);
23006
+ const [overZoneGroup, setOverZoneGroup] = React85__default.useState(null);
23007
+ const meta = React85__default.useMemo(
23397
23008
  () => ({ group: ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, rawItems: items, idField: dndItemIdField }),
23398
23009
  [ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, items, dndItemIdField]
23399
23010
  );
23400
- React89__default.useEffect(() => {
23011
+ React85__default.useEffect(() => {
23401
23012
  const target = isRoot ? null : parentRoot;
23402
23013
  if (!target) {
23403
23014
  zonesRef.current.set(zoneId, meta);
@@ -23416,7 +23027,7 @@ function useDataDnd(args) {
23416
23027
  }, [parentRoot, isRoot, zoneId, meta]);
23417
23028
  const sensors = useAlmadarDndSensors(true);
23418
23029
  const collisionDetection = almadarDndCollisionDetection;
23419
- const findZoneByItem = React89__default.useCallback(
23030
+ const findZoneByItem = React85__default.useCallback(
23420
23031
  (id) => {
23421
23032
  for (const z of zonesRef.current.values()) {
23422
23033
  if (z.itemIds.includes(id)) return z;
@@ -23425,7 +23036,7 @@ function useDataDnd(args) {
23425
23036
  },
23426
23037
  []
23427
23038
  );
23428
- React89__default.useCallback(
23039
+ React85__default.useCallback(
23429
23040
  (group) => {
23430
23041
  for (const z of zonesRef.current.values()) {
23431
23042
  if (z.group === group) return z;
@@ -23434,7 +23045,7 @@ function useDataDnd(args) {
23434
23045
  },
23435
23046
  []
23436
23047
  );
23437
- const handleDragEnd = React89__default.useCallback(
23048
+ const handleDragEnd = React85__default.useCallback(
23438
23049
  (event) => {
23439
23050
  const { active, over } = event;
23440
23051
  const activeIdStr = String(active.id);
@@ -23525,8 +23136,8 @@ function useDataDnd(args) {
23525
23136
  },
23526
23137
  [eventBus]
23527
23138
  );
23528
- const sortableData = React89__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
23529
- const SortableItem = React89__default.useCallback(
23139
+ const sortableData = React85__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
23140
+ const SortableItem = React85__default.useCallback(
23530
23141
  ({ id, children }) => {
23531
23142
  const {
23532
23143
  attributes,
@@ -23566,7 +23177,7 @@ function useDataDnd(args) {
23566
23177
  id: droppableId,
23567
23178
  data: sortableData
23568
23179
  });
23569
- const ctx = React89__default.useContext(RootCtx);
23180
+ const ctx = React85__default.useContext(RootCtx);
23570
23181
  const activeDrag2 = ctx?.activeDrag ?? null;
23571
23182
  const overZoneGroup2 = ctx?.overZoneGroup ?? null;
23572
23183
  const isThisZoneOver = overZoneGroup2 === ownGroup;
@@ -23581,7 +23192,7 @@ function useDataDnd(args) {
23581
23192
  showForeignPlaceholder,
23582
23193
  ctxAvailable: ctx != null
23583
23194
  });
23584
- React89__default.useEffect(() => {
23195
+ React85__default.useEffect(() => {
23585
23196
  dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
23586
23197
  }, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
23587
23198
  return /* @__PURE__ */ jsx(
@@ -23595,11 +23206,11 @@ function useDataDnd(args) {
23595
23206
  }
23596
23207
  );
23597
23208
  };
23598
- const rootContextValue = React89__default.useMemo(
23209
+ const rootContextValue = React85__default.useMemo(
23599
23210
  () => ({ registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder }),
23600
23211
  [registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder]
23601
23212
  );
23602
- const handleDragStart = React89__default.useCallback((event) => {
23213
+ const handleDragStart = React85__default.useCallback((event) => {
23603
23214
  const sourceZone = findZoneByItem(event.active.id);
23604
23215
  const rect = event.active.rect.current.initial;
23605
23216
  const height = rect?.height && rect.height > 0 ? rect.height : 64;
@@ -23618,7 +23229,7 @@ function useDataDnd(args) {
23618
23229
  isRoot
23619
23230
  });
23620
23231
  }, [findZoneByItem, isRoot, zoneId]);
23621
- const handleDragOver = React89__default.useCallback((event) => {
23232
+ const handleDragOver = React85__default.useCallback((event) => {
23622
23233
  const { active, over } = event;
23623
23234
  const overData = over?.data?.current;
23624
23235
  const overGroup = overData?.dndGroup ?? null;
@@ -23688,7 +23299,7 @@ function useDataDnd(args) {
23688
23299
  return next;
23689
23300
  });
23690
23301
  }, []);
23691
- const handleDragCancel = React89__default.useCallback((event) => {
23302
+ const handleDragCancel = React85__default.useCallback((event) => {
23692
23303
  setActiveDrag(null);
23693
23304
  setOverZoneGroup(null);
23694
23305
  dndLog.warn("dragCancel", {
@@ -23696,12 +23307,12 @@ function useDataDnd(args) {
23696
23307
  reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
23697
23308
  });
23698
23309
  }, []);
23699
- const handleDragEndWithCleanup = React89__default.useCallback((event) => {
23310
+ const handleDragEndWithCleanup = React85__default.useCallback((event) => {
23700
23311
  handleDragEnd(event);
23701
23312
  setActiveDrag(null);
23702
23313
  setOverZoneGroup(null);
23703
23314
  }, [handleDragEnd]);
23704
- const wrapContainer = React89__default.useCallback(
23315
+ const wrapContainer = React85__default.useCallback(
23705
23316
  (children) => {
23706
23317
  if (!enabled) return children;
23707
23318
  const strategy = layout === "grid" ? rectSortingStrategy : verticalListSortingStrategy;
@@ -23755,7 +23366,7 @@ var init_useDataDnd = __esm({
23755
23366
  init_useAlmadarDndCollision();
23756
23367
  init_Box();
23757
23368
  dndLog = createLogger("almadar:ui:dnd");
23758
- RootCtx = React89__default.createContext(null);
23369
+ RootCtx = React85__default.createContext(null);
23759
23370
  }
23760
23371
  });
23761
23372
  function fieldLabel2(key) {
@@ -24275,7 +23886,7 @@ function DataList({
24275
23886
  }) {
24276
23887
  const eventBus = useEventBus();
24277
23888
  const { t } = useTranslate();
24278
- const [visibleCount, setVisibleCount] = React89__default.useState(pageSize || Infinity);
23889
+ const [visibleCount, setVisibleCount] = React85__default.useState(pageSize || Infinity);
24279
23890
  const fieldDefs = fields ?? columns ?? [];
24280
23891
  const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
24281
23892
  const dnd = useDataDnd({
@@ -24294,7 +23905,7 @@ function DataList({
24294
23905
  const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
24295
23906
  const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
24296
23907
  const hasRenderProp = typeof children === "function";
24297
- React89__default.useEffect(() => {
23908
+ React85__default.useEffect(() => {
24298
23909
  const renderItemTypeOf = typeof schemaRenderItem;
24299
23910
  const childrenTypeOf = typeof children;
24300
23911
  if (data.length > 0 && !hasRenderProp) {
@@ -24399,7 +24010,7 @@ function DataList({
24399
24010
  const items2 = data.map((item) => item);
24400
24011
  const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
24401
24012
  const contentField = titleField?.name ?? fieldDefs[0]?.name ?? "";
24402
- return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React89__default.Fragment, { children: [
24013
+ return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React85__default.Fragment, { children: [
24403
24014
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
24404
24015
  group.items.map((itemData, index) => {
24405
24016
  const id = itemData.id || `${gi}-${index}`;
@@ -24547,7 +24158,7 @@ function DataList({
24547
24158
  className
24548
24159
  ),
24549
24160
  children: [
24550
- groups.map((group, gi) => /* @__PURE__ */ jsxs(React89__default.Fragment, { children: [
24161
+ groups.map((group, gi) => /* @__PURE__ */ jsxs(React85__default.Fragment, { children: [
24551
24162
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
24552
24163
  group.items.map(
24553
24164
  (itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
@@ -25921,7 +25532,7 @@ var init_WizardProgress = __esm({
25921
25532
  children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
25922
25533
  const isActive = index === currentStep;
25923
25534
  const isCompleted = index < currentStep;
25924
- return /* @__PURE__ */ jsxs(React89__default.Fragment, { children: [
25535
+ return /* @__PURE__ */ jsxs(React85__default.Fragment, { children: [
25925
25536
  /* @__PURE__ */ jsx(
25926
25537
  "button",
25927
25538
  {
@@ -26438,8 +26049,9 @@ var init_FormSectionHeader = __esm({
26438
26049
  Box,
26439
26050
  {
26440
26051
  className: cn(
26441
- "px-4 py-3 bg-muted rounded-t-lg border-b-2 border-border border-l-4 border-l-primary",
26442
- isClickable && "cursor-pointer hover:bg-[var(--color-surface-hover)] transition-colors",
26052
+ "px-5 py-4 bg-muted/60 rounded-lg",
26053
+ "border border-border border-l-4 border-l-primary",
26054
+ isClickable && "cursor-pointer hover:bg-muted transition-colors",
26443
26055
  className
26444
26056
  ),
26445
26057
  onClick: isClickable ? onToggle : void 0,
@@ -26450,7 +26062,7 @@ var init_FormSectionHeader = __esm({
26450
26062
  {
26451
26063
  name: icon,
26452
26064
  size: "md",
26453
- className: "text-primary"
26065
+ className: "text-primary shrink-0"
26454
26066
  }
26455
26067
  ),
26456
26068
  statusIcon && /* @__PURE__ */ jsx(
@@ -26458,12 +26070,15 @@ var init_FormSectionHeader = __esm({
26458
26070
  {
26459
26071
  name: statusIcon,
26460
26072
  size: "md",
26461
- className: hasErrors ? "text-error" : "text-success"
26073
+ className: cn(
26074
+ "shrink-0",
26075
+ hasErrors ? "text-error" : "text-success"
26076
+ )
26462
26077
  }
26463
26078
  ),
26464
26079
  /* @__PURE__ */ jsxs(Box, { className: "space-y-0.5", children: [
26465
- /* @__PURE__ */ jsx(Typography, { variant: "subheading", weight: "semibold", children: title }),
26466
- subtitle && /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", children: subtitle })
26080
+ /* @__PURE__ */ jsx(Typography, { variant: "subheading", weight: "semibold", className: "text-foreground", children: title }),
26081
+ subtitle && /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", className: "leading-snug", children: subtitle })
26467
26082
  ] })
26468
26083
  ] }),
26469
26084
  /* @__PURE__ */ jsxs(HStack, { gap: "sm", align: "center", children: [
@@ -26472,9 +26087,9 @@ var init_FormSectionHeader = __esm({
26472
26087
  Icon,
26473
26088
  {
26474
26089
  name: "chevron-down",
26475
- size: "md",
26090
+ size: "sm",
26476
26091
  className: cn(
26477
- "text-muted-foreground transition-transform",
26092
+ "text-muted-foreground transition-transform duration-200 shrink-0",
26478
26093
  isCollapsed && "-rotate-90"
26479
26094
  )
26480
26095
  }
@@ -26532,50 +26147,6 @@ var init_FlipCard = __esm({
26532
26147
  FlipCard.displayName = "FlipCard";
26533
26148
  }
26534
26149
  });
26535
- function pascalToKebab(name) {
26536
- return name.replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/([A-Z])([A-Z][a-z])/g, "$1-$2").toLowerCase();
26537
- }
26538
- function kebabToPascal3(name) {
26539
- return name.split("-").map((part) => /^\d+$/.test(part) ? part : part.charAt(0).toUpperCase() + part.slice(1)).join("");
26540
- }
26541
- var ICON_ITEMS, IconPicker;
26542
- var init_IconPicker = __esm({
26543
- "components/core/molecules/IconPicker.tsx"() {
26544
- "use client";
26545
- init_Icon();
26546
- init_GridPicker();
26547
- ICON_ITEMS = (() => {
26548
- const items = [];
26549
- for (const [exportName, candidate] of Object.entries(LucideIcons2)) {
26550
- if (!/^[A-Z]/.test(exportName)) continue;
26551
- if (exportName.endsWith("Icon")) continue;
26552
- if (exportName.startsWith("Lucide")) continue;
26553
- const isComponent = candidate !== null && (typeof candidate === "object" || typeof candidate === "function") && "$$typeof" in candidate;
26554
- if (!isComponent) continue;
26555
- const kebab = pascalToKebab(exportName);
26556
- if (kebabToPascal3(kebab) !== exportName) continue;
26557
- items.push({ id: kebab, label: kebab, category: "icons" });
26558
- }
26559
- return items;
26560
- })();
26561
- IconPicker = ({ value, onChange, className }) => {
26562
- const items = useMemo(() => ICON_ITEMS, []);
26563
- return /* @__PURE__ */ jsx(
26564
- GridPicker,
26565
- {
26566
- items,
26567
- value,
26568
- onChange,
26569
- searchPlaceholder: "Search icons\u2026",
26570
- renderThumbnail: (it) => /* @__PURE__ */ jsx(Icon, { name: it.id }),
26571
- cellSize: 32,
26572
- className
26573
- }
26574
- );
26575
- };
26576
- IconPicker.displayName = "IconPicker";
26577
- }
26578
- });
26579
26150
  function toISODate(d) {
26580
26151
  return d.toISOString().slice(0, 10);
26581
26152
  }
@@ -27020,7 +26591,7 @@ function InventoryGrid({
27020
26591
  const eventBus = useEventBus();
27021
26592
  const slotCount = totalSlots ?? items.length;
27022
26593
  const emptySlotCount = Math.max(0, slotCount - items.length);
27023
- const handleSelect = React89.useCallback(
26594
+ const handleSelect = React85.useCallback(
27024
26595
  (id) => {
27025
26596
  onSelect?.(id);
27026
26597
  if (selectEvent) {
@@ -27237,31 +26808,31 @@ function GameCanvas2D({
27237
26808
  assetBaseUrl = "",
27238
26809
  className
27239
26810
  }) {
27240
- const canvasRef = React89.useRef(null);
27241
- const rafRef = React89.useRef(0);
27242
- const frameRef = React89.useRef(0);
27243
- const lastTimeRef = React89.useRef(0);
27244
- const imageCache = React89.useRef(/* @__PURE__ */ new Map());
26811
+ const canvasRef = React85.useRef(null);
26812
+ const rafRef = React85.useRef(0);
26813
+ const frameRef = React85.useRef(0);
26814
+ const lastTimeRef = React85.useRef(0);
26815
+ const imageCache = React85.useRef(/* @__PURE__ */ new Map());
27245
26816
  const emit = useEmitEvent();
27246
- const onDrawRef = React89.useRef(onDraw);
26817
+ const onDrawRef = React85.useRef(onDraw);
27247
26818
  onDrawRef.current = onDraw;
27248
- const onTickRef = React89.useRef(onTick);
26819
+ const onTickRef = React85.useRef(onTick);
27249
26820
  onTickRef.current = onTick;
27250
- const tickEventRef = React89.useRef(tickEvent);
26821
+ const tickEventRef = React85.useRef(tickEvent);
27251
26822
  tickEventRef.current = tickEvent;
27252
- const drawEventRef = React89.useRef(drawEvent);
26823
+ const drawEventRef = React85.useRef(drawEvent);
27253
26824
  drawEventRef.current = drawEvent;
27254
- const emitRef = React89.useRef(emit);
26825
+ const emitRef = React85.useRef(emit);
27255
26826
  emitRef.current = emit;
27256
- const assetBaseUrlRef = React89.useRef(assetBaseUrl);
26827
+ const assetBaseUrlRef = React85.useRef(assetBaseUrl);
27257
26828
  assetBaseUrlRef.current = assetBaseUrl;
27258
- const backgroundImageRef = React89.useRef(backgroundImage);
26829
+ const backgroundImageRef = React85.useRef(backgroundImage);
27259
26830
  backgroundImageRef.current = backgroundImage;
27260
- const widthRef = React89.useRef(width);
26831
+ const widthRef = React85.useRef(width);
27261
26832
  widthRef.current = width;
27262
- const heightRef = React89.useRef(height);
26833
+ const heightRef = React85.useRef(height);
27263
26834
  heightRef.current = height;
27264
- const loadImage = React89.useCallback((url) => {
26835
+ const loadImage = React85.useCallback((url) => {
27265
26836
  const fullUrl = url.startsWith("http") ? url : `${assetBaseUrlRef.current}${url}`;
27266
26837
  const cached = imageCache.current.get(fullUrl);
27267
26838
  if (cached?.complete && cached.naturalWidth > 0) return cached;
@@ -27273,7 +26844,7 @@ function GameCanvas2D({
27273
26844
  }
27274
26845
  return null;
27275
26846
  }, []);
27276
- React89.useEffect(() => {
26847
+ React85.useEffect(() => {
27277
26848
  const canvas = canvasRef.current;
27278
26849
  if (!canvas) return;
27279
26850
  const ctx = canvas.getContext("2d");
@@ -27576,7 +27147,7 @@ function TurnPanel({
27576
27147
  className
27577
27148
  }) {
27578
27149
  const eventBus = useEventBus();
27579
- const handleAction = React89.useCallback(
27150
+ const handleAction = React85.useCallback(
27580
27151
  (event) => {
27581
27152
  if (event) {
27582
27153
  eventBus.emit(event, { turn: currentTurn, phase, activeTeam });
@@ -27722,7 +27293,7 @@ function UnitCommandBar({
27722
27293
  className
27723
27294
  }) {
27724
27295
  const eventBus = useEventBus();
27725
- const handleCommand = React89.useCallback(
27296
+ const handleCommand = React85.useCallback(
27726
27297
  (event) => {
27727
27298
  if (event) {
27728
27299
  eventBus.emit(event, { unitId: selectedUnitId });
@@ -28207,7 +27778,7 @@ function GameMenu({
28207
27778
  } catch {
28208
27779
  }
28209
27780
  const eventBus = eventBusProp || eventBusFromHook;
28210
- const handleOptionClick = React89.useCallback(
27781
+ const handleOptionClick = React85.useCallback(
28211
27782
  (option) => {
28212
27783
  if (option.event && eventBus) {
28213
27784
  eventBus.emit(`UI:${option.event}`, { option });
@@ -28321,7 +27892,7 @@ function GameOverScreen({
28321
27892
  } catch {
28322
27893
  }
28323
27894
  const eventBus = eventBusProp || eventBusFromHook;
28324
- const handleActionClick = React89.useCallback(
27895
+ const handleActionClick = React85.useCallback(
28325
27896
  (action) => {
28326
27897
  if (action.event && eventBus) {
28327
27898
  eventBus.emit(`UI:${action.event}`, { action });
@@ -29032,14 +28603,14 @@ function useSafeEventBus5() {
29032
28603
  } };
29033
28604
  }
29034
28605
  }
29035
- var sizeStyles10, LONG_PRESS_DELAY, LONG_PRESS_INTERVAL, NumberStepper;
28606
+ var sizeStyles9, LONG_PRESS_DELAY, LONG_PRESS_INTERVAL, NumberStepper;
29036
28607
  var init_NumberStepper = __esm({
29037
28608
  "components/core/molecules/NumberStepper.tsx"() {
29038
28609
  "use client";
29039
28610
  init_cn();
29040
28611
  init_Icon();
29041
28612
  init_useEventBus();
29042
- sizeStyles10 = {
28613
+ sizeStyles9 = {
29043
28614
  sm: {
29044
28615
  button: "w-7 h-7",
29045
28616
  text: "text-sm min-w-[2rem]",
@@ -29077,7 +28648,7 @@ var init_NumberStepper = __esm({
29077
28648
  const timeoutRef = useRef(null);
29078
28649
  const isAtMin = min !== void 0 && value <= min;
29079
28650
  const isAtMax = max !== void 0 && value >= max;
29080
- const styles = sizeStyles10[size];
28651
+ const styles = sizeStyles9[size];
29081
28652
  const emitChange = useCallback(
29082
28653
  (newValue) => {
29083
28654
  const clamped = Math.round(newValue / step) * step;
@@ -29218,14 +28789,14 @@ function useSafeEventBus6() {
29218
28789
  } };
29219
28790
  }
29220
28791
  }
29221
- var sizeStyles11, StarRating;
28792
+ var sizeStyles10, StarRating;
29222
28793
  var init_StarRating = __esm({
29223
28794
  "components/core/molecules/StarRating.tsx"() {
29224
28795
  "use client";
29225
28796
  init_cn();
29226
28797
  init_Icon();
29227
28798
  init_useEventBus();
29228
- sizeStyles11 = {
28799
+ sizeStyles10 = {
29229
28800
  sm: { star: "w-4 h-4", gap: "gap-0.5" },
29230
28801
  md: { star: "w-6 h-6", gap: "gap-1" },
29231
28802
  lg: { star: "w-8 h-8", gap: "gap-1.5" }
@@ -29244,7 +28815,7 @@ var init_StarRating = __esm({
29244
28815
  }) => {
29245
28816
  const [hoverValue, setHoverValue] = useState(null);
29246
28817
  const eventBus = useSafeEventBus6();
29247
- const styles = sizeStyles11[size];
28818
+ const styles = sizeStyles10[size];
29248
28819
  const displayValue = hoverValue ?? value;
29249
28820
  const emitChange = useCallback(
29250
28821
  (newValue) => {
@@ -29315,7 +28886,7 @@ var init_StarRating = __esm({
29315
28886
  name: "star",
29316
28887
  className: cn(
29317
28888
  styles.star,
29318
- "text-muted-foreground",
28889
+ "text-foreground/30",
29319
28890
  "transition-colors duration-100"
29320
28891
  ),
29321
28892
  strokeWidth: 1.5
@@ -29798,8 +29369,8 @@ function TableView({
29798
29369
  }) {
29799
29370
  const eventBus = useEventBus();
29800
29371
  const { t } = useTranslate();
29801
- const [visibleCount, setVisibleCount] = React89__default.useState(pageSize > 0 ? pageSize : Infinity);
29802
- const [localSelected, setLocalSelected] = React89__default.useState(/* @__PURE__ */ new Set());
29372
+ const [visibleCount, setVisibleCount] = React85__default.useState(pageSize > 0 ? pageSize : Infinity);
29373
+ const [localSelected, setLocalSelected] = React85__default.useState(/* @__PURE__ */ new Set());
29803
29374
  const colDefs = columns ?? fields ?? [];
29804
29375
  const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
29805
29376
  const dnd = useDataDnd({
@@ -29994,12 +29565,12 @@ function TableView({
29994
29565
  ]
29995
29566
  }
29996
29567
  );
29997
- return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React89__default.Fragment, { children: rowInner }, id);
29568
+ return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React85__default.Fragment, { children: rowInner }, id);
29998
29569
  };
29999
29570
  const items = data.map((row) => row);
30000
29571
  const groups = groupBy ? groupData2(items, groupBy) : [{ label: "", items }];
30001
29572
  let runningIndex = 0;
30002
- const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React89__default.Fragment, { children: [
29573
+ const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React85__default.Fragment, { children: [
30003
29574
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-3" : "mt-0" }),
30004
29575
  group.items.map((row) => renderRow(row, runningIndex++))
30005
29576
  ] }, gi)) });
@@ -31351,7 +30922,7 @@ var init_StepFlow = __esm({
31351
30922
  className
31352
30923
  }) => {
31353
30924
  if (orientation === "vertical") {
31354
- return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React89__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
30925
+ return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React85__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
31355
30926
  /* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
31356
30927
  /* @__PURE__ */ jsx(StepCircle, { step, index }),
31357
30928
  showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
@@ -31362,7 +30933,7 @@ var init_StepFlow = __esm({
31362
30933
  ] })
31363
30934
  ] }) }, index)) });
31364
30935
  }
31365
- 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(React89__default.Fragment, { children: [
30936
+ 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(React85__default.Fragment, { children: [
31366
30937
  /* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
31367
30938
  /* @__PURE__ */ jsx(StepCircle, { step, index }),
31368
30939
  /* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
@@ -32117,11 +31688,19 @@ function LatticeSVG({
32117
31688
  function f2(n) {
32118
31689
  return n.toFixed(2);
32119
31690
  }
32120
- var VARIANT_MAP2, EdgeDecoration;
31691
+ var colorTokenVars, VARIANT_MAP2, EdgeDecoration;
32121
31692
  var init_EdgeDecoration = __esm({
32122
31693
  "components/core/molecules/EdgeDecoration.tsx"() {
32123
31694
  "use client";
32124
31695
  init_cn();
31696
+ colorTokenVars = {
31697
+ primary: "var(--color-primary)",
31698
+ secondary: "var(--color-secondary)",
31699
+ success: "var(--color-success)",
31700
+ warning: "var(--color-warning)",
31701
+ error: "var(--color-error)",
31702
+ muted: "var(--color-muted)"
31703
+ };
32125
31704
  VARIANT_MAP2 = {
32126
31705
  arch: ArchSVG,
32127
31706
  vine: VineSVG,
@@ -32131,13 +31710,14 @@ var init_EdgeDecoration = __esm({
32131
31710
  variant = "arch",
32132
31711
  side = "both",
32133
31712
  opacity = 0.15,
32134
- color = "var(--color-primary)",
31713
+ color = "primary",
32135
31714
  strokeWidth = 0.5,
32136
31715
  width = 15,
32137
31716
  className
32138
31717
  }) => {
32139
31718
  const id = useId();
32140
31719
  const Variant = VARIANT_MAP2[variant];
31720
+ const resolvedColor = color in colorTokenVars ? colorTokenVars[color] : color;
32141
31721
  const sides = side === "both" ? ["left", "right"] : [side];
32142
31722
  return /* @__PURE__ */ jsx(Fragment, { children: sides.map((s) => /* @__PURE__ */ jsx(
32143
31723
  "svg",
@@ -32160,7 +31740,7 @@ var init_EdgeDecoration = __esm({
32160
31740
  facing: s,
32161
31741
  w: 200,
32162
31742
  h: 600,
32163
- color,
31743
+ color: resolvedColor,
32164
31744
  strokeWidth
32165
31745
  }
32166
31746
  )
@@ -32171,14 +31751,14 @@ var init_EdgeDecoration = __esm({
32171
31751
  EdgeDecoration.displayName = "EdgeDecoration";
32172
31752
  }
32173
31753
  });
32174
- var sizeStyles12, VoteStack;
31754
+ var sizeStyles11, VoteStack;
32175
31755
  var init_VoteStack = __esm({
32176
31756
  "components/core/molecules/VoteStack.tsx"() {
32177
31757
  "use client";
32178
31758
  init_cn();
32179
31759
  init_Icon();
32180
31760
  init_useEventBus();
32181
- sizeStyles12 = {
31761
+ sizeStyles11 = {
32182
31762
  sm: {
32183
31763
  button: "w-7 h-7",
32184
31764
  text: "text-sm min-w-[2rem]",
@@ -32206,7 +31786,7 @@ var init_VoteStack = __esm({
32206
31786
  className,
32207
31787
  label
32208
31788
  }) => {
32209
- const styles = sizeStyles12[size];
31789
+ const styles = sizeStyles11[size];
32210
31790
  const isUp = userVote === "up";
32211
31791
  const isDown = userVote === "down";
32212
31792
  const eventBus = useEventBus();
@@ -32338,7 +31918,7 @@ var init_LikertScale = __esm({
32338
31918
  md: "text-base",
32339
31919
  lg: "text-lg"
32340
31920
  };
32341
- LikertScale = React89__default.forwardRef(
31921
+ LikertScale = React85__default.forwardRef(
32342
31922
  ({
32343
31923
  question,
32344
31924
  options = DEFAULT_LIKERT_OPTIONS,
@@ -32350,7 +31930,7 @@ var init_LikertScale = __esm({
32350
31930
  variant = "radios",
32351
31931
  className
32352
31932
  }, ref) => {
32353
- const groupId = React89__default.useId();
31933
+ const groupId = React85__default.useId();
32354
31934
  const eventBus = useEventBus();
32355
31935
  const handleSelect = useCallback(
32356
31936
  (next) => {
@@ -32474,7 +32054,7 @@ var init_LikertScale = __esm({
32474
32054
  LikertScale.displayName = "LikertScale";
32475
32055
  }
32476
32056
  });
32477
- var DEFAULT_MATRIX_COLUMNS, sizeStyles13, MatrixQuestion;
32057
+ var DEFAULT_MATRIX_COLUMNS, sizeStyles12, MatrixQuestion;
32478
32058
  var init_MatrixQuestion = __esm({
32479
32059
  "components/core/molecules/MatrixQuestion.tsx"() {
32480
32060
  "use client";
@@ -32490,7 +32070,7 @@ var init_MatrixQuestion = __esm({
32490
32070
  { value: 4, label: "Agree" },
32491
32071
  { value: 5, label: "Strongly Agree" }
32492
32072
  ];
32493
- sizeStyles13 = {
32073
+ sizeStyles12 = {
32494
32074
  sm: {
32495
32075
  cell: "px-2 py-1.5 text-xs",
32496
32076
  radio: "sm",
@@ -32513,7 +32093,7 @@ var init_MatrixQuestion = __esm({
32513
32093
  size = "md",
32514
32094
  className
32515
32095
  }) => {
32516
- const styles = sizeStyles13[size];
32096
+ const styles = sizeStyles12[size];
32517
32097
  const safeRows = rows2 ?? [];
32518
32098
  const safeValues = values ?? {};
32519
32099
  const eventBus = useEventBus();
@@ -33500,7 +33080,6 @@ function BlockRow({
33500
33080
  onUpdate,
33501
33081
  onDelete,
33502
33082
  onDuplicate,
33503
- onInsertAfter,
33504
33083
  onChangeType
33505
33084
  }) {
33506
33085
  const { t } = useTranslate();
@@ -33776,34 +33355,16 @@ function BlockRow({
33776
33355
  "data-block-id": block.id,
33777
33356
  "data-block-type": block.type,
33778
33357
  children: [
33779
- !readOnly && showAffordances && /* @__PURE__ */ jsxs(Box, { className: "flex w-12 shrink-0 items-center gap-0.5 pt-1", children: [
33780
- /* @__PURE__ */ jsx(
33781
- Button,
33782
- {
33783
- type: "button",
33784
- variant: "ghost",
33785
- "aria-label": t("richBlockEditor.insertParagraphBelow"),
33786
- className: cn(
33787
- "inline-flex h-6 w-6 items-center justify-center rounded-sm p-0 gap-0",
33788
- "text-muted-foreground hover:bg-muted hover:text-foreground",
33789
- "opacity-0 group-hover:opacity-100 focus-visible:opacity-100",
33790
- "transition-opacity"
33791
- ),
33792
- onClick: () => onInsertAfter("paragraph"),
33793
- children: /* @__PURE__ */ jsx(Icon, { name: "plus", className: "w-3.5 h-3.5" })
33794
- }
33795
- ),
33796
- /* @__PURE__ */ jsx(
33797
- BlockMenu,
33798
- {
33799
- block,
33800
- readOnly,
33801
- onDelete,
33802
- onDuplicate,
33803
- onChangeType
33804
- }
33805
- )
33806
- ] }),
33358
+ !readOnly && showAffordances && /* @__PURE__ */ jsx(Box, { className: "flex w-8 shrink-0 items-center pt-1", children: /* @__PURE__ */ jsx(
33359
+ BlockMenu,
33360
+ {
33361
+ block,
33362
+ readOnly,
33363
+ onDelete,
33364
+ onDuplicate,
33365
+ onChangeType
33366
+ }
33367
+ ) }),
33807
33368
  /* @__PURE__ */ jsx(Box, { className: "min-w-0 flex-1", children: renderBody() })
33808
33369
  ]
33809
33370
  }
@@ -33926,12 +33487,6 @@ var init_RichBlockEditor = __esm({
33926
33487
  },
33927
33488
  [blocks, commit]
33928
33489
  );
33929
- const handleInsertAfter = useCallback(
33930
- (id, type) => {
33931
- commit(insertAfter(blocks, id, createBlock(type)));
33932
- },
33933
- [blocks, commit]
33934
- );
33935
33490
  const handleChangeType = useCallback(
33936
33491
  (id, type) => {
33937
33492
  commit(
@@ -33988,7 +33543,6 @@ var init_RichBlockEditor = __esm({
33988
33543
  onUpdate: (updater) => handleUpdate(block.id, updater),
33989
33544
  onDelete: () => handleDelete(block.id),
33990
33545
  onDuplicate: () => handleDuplicate(block.id),
33991
- onInsertAfter: (type) => handleInsertAfter(block.id, type),
33992
33546
  onChangeType: (type) => handleChangeType(block.id, type)
33993
33547
  },
33994
33548
  block.id
@@ -34658,7 +34212,7 @@ var init_DocBreadcrumb = __esm({
34658
34212
  "aria-label": t("aria.breadcrumb"),
34659
34213
  children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
34660
34214
  const isLast = idx === items.length - 1;
34661
- return /* @__PURE__ */ jsxs(React89__default.Fragment, { children: [
34215
+ return /* @__PURE__ */ jsxs(React85__default.Fragment, { children: [
34662
34216
  idx > 0 && /* @__PURE__ */ jsx(
34663
34217
  Icon,
34664
34218
  {
@@ -34705,108 +34259,6 @@ var init_DocBreadcrumb = __esm({
34705
34259
  DocBreadcrumb.displayName = "DocBreadcrumb";
34706
34260
  }
34707
34261
  });
34708
- function DocCodeBlock({
34709
- code,
34710
- language,
34711
- title,
34712
- showLineNumbers = false,
34713
- className
34714
- }) {
34715
- const [copied, setCopied] = useState(false);
34716
- const handleCopy = useCallback(() => {
34717
- void navigator.clipboard.writeText(code).then(() => {
34718
- setCopied(true);
34719
- setTimeout(() => setCopied(false), 2e3);
34720
- });
34721
- }, [code]);
34722
- const lines = code.split("\n");
34723
- return /* @__PURE__ */ jsxs(
34724
- Box,
34725
- {
34726
- className: cn(
34727
- "rounded-container border border-border overflow-hidden",
34728
- className
34729
- ),
34730
- position: "relative",
34731
- children: [
34732
- title ? /* @__PURE__ */ jsxs(
34733
- HStack,
34734
- {
34735
- align: "center",
34736
- justify: "between",
34737
- className: "bg-muted px-4 py-2 border-b border-border",
34738
- children: [
34739
- /* @__PURE__ */ jsxs(HStack, { align: "center", gap: "sm", children: [
34740
- /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", children: title }),
34741
- language ? /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", children: language }) : null
34742
- ] }),
34743
- /* @__PURE__ */ jsx(
34744
- Button,
34745
- {
34746
- variant: "ghost",
34747
- size: "sm",
34748
- onClick: handleCopy,
34749
- leftIcon: copied ? "check" : "copy",
34750
- children: copied ? "Copied!" : "Copy"
34751
- }
34752
- )
34753
- ]
34754
- }
34755
- ) : null,
34756
- !title ? /* @__PURE__ */ jsx(Box, { position: "absolute", className: "top-2 right-2 z-10", children: /* @__PURE__ */ jsx(
34757
- Button,
34758
- {
34759
- variant: "ghost",
34760
- size: "sm",
34761
- onClick: handleCopy,
34762
- leftIcon: copied ? "check" : "copy",
34763
- children: copied ? "Copied!" : "Copy"
34764
- }
34765
- ) }) : null,
34766
- /* @__PURE__ */ jsxs(HStack, { gap: "none", className: "bg-foreground overflow-x-auto", children: [
34767
- showLineNumbers ? /* @__PURE__ */ jsx(
34768
- Box,
34769
- {
34770
- className: "py-4 pl-4 pr-3 select-none border-r border-border flex-shrink-0",
34771
- children: lines.map((_, i) => /* @__PURE__ */ jsx(
34772
- Typography,
34773
- {
34774
- variant: "caption",
34775
- color: "muted",
34776
- className: "block font-mono text-right leading-6",
34777
- as: "span",
34778
- children: i + 1
34779
- },
34780
- i
34781
- ))
34782
- }
34783
- ) : null,
34784
- /* @__PURE__ */ jsx(
34785
- Box,
34786
- {
34787
- as: "pre",
34788
- className: cn(
34789
- "p-4 font-mono text-sm text-background leading-6 flex-1 min-w-0",
34790
- !title && "pr-24"
34791
- ),
34792
- children: /* @__PURE__ */ jsx(Box, { as: "code", className: "whitespace-pre", children: code })
34793
- }
34794
- )
34795
- ] })
34796
- ]
34797
- }
34798
- );
34799
- }
34800
- var init_DocCodeBlock = __esm({
34801
- "components/core/molecules/DocCodeBlock.tsx"() {
34802
- "use client";
34803
- init_cn();
34804
- init_Box();
34805
- init_Stack();
34806
- init_Typography();
34807
- init_Button();
34808
- }
34809
- });
34810
34262
  function DocPagination({ prev, next, className }) {
34811
34263
  if (!prev && !next) return null;
34812
34264
  return /* @__PURE__ */ jsxs(
@@ -35243,17 +34695,25 @@ var init_DocTOC = __esm({
35243
34695
  DocTOC.displayName = "DocTOC";
35244
34696
  }
35245
34697
  });
35246
- var GradientDivider;
34698
+ var colorTokenVars2, GradientDivider;
35247
34699
  var init_GradientDivider = __esm({
35248
34700
  "components/core/molecules/GradientDivider.tsx"() {
35249
34701
  "use client";
35250
34702
  init_cn();
35251
34703
  init_Box();
34704
+ colorTokenVars2 = {
34705
+ primary: "var(--color-primary)",
34706
+ secondary: "var(--color-secondary)",
34707
+ success: "var(--color-success)",
34708
+ warning: "var(--color-warning)",
34709
+ error: "var(--color-error)",
34710
+ muted: "var(--color-muted)"
34711
+ };
35252
34712
  GradientDivider = ({
35253
34713
  color,
35254
34714
  className
35255
34715
  }) => {
35256
- const centerColor = color ?? "var(--color-primary)";
34716
+ const centerColor = color ? color in colorTokenVars2 ? colorTokenVars2[color] : color : "var(--color-primary)";
35257
34717
  return /* @__PURE__ */ jsx(
35258
34718
  Box,
35259
34719
  {
@@ -35622,7 +35082,7 @@ var init_MiniStateMachine = __esm({
35622
35082
  const x = 2 + i * (NODE_W + GAP + ARROW_W + GAP);
35623
35083
  const tc = transitionCounts[s.name] ?? 0;
35624
35084
  const role = getStateRole(s.name, s.isInitial, s.isTerminal, tc, maxTC);
35625
- return /* @__PURE__ */ jsxs(React89__default.Fragment, { children: [
35085
+ return /* @__PURE__ */ jsxs(React85__default.Fragment, { children: [
35626
35086
  /* @__PURE__ */ jsx(
35627
35087
  AvlState,
35628
35088
  {
@@ -35826,7 +35286,7 @@ var init_PageHeader = __esm({
35826
35286
  info: "bg-info/10 text-info"
35827
35287
  };
35828
35288
  return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
35829
- 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(React89__default.Fragment, { children: [
35289
+ 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(React85__default.Fragment, { children: [
35830
35290
  idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
35831
35291
  crumb.href ? /* @__PURE__ */ jsx(
35832
35292
  "a",
@@ -35913,271 +35373,6 @@ var init_PageHeader = __esm({
35913
35373
  PageHeader.displayName = "PageHeader";
35914
35374
  }
35915
35375
  });
35916
- var FormSection, FormLayout, FormActions;
35917
- var init_FormSection = __esm({
35918
- "components/core/molecules/FormSection.tsx"() {
35919
- "use client";
35920
- init_cn();
35921
- init_atoms2();
35922
- init_Box();
35923
- init_Typography();
35924
- init_Button();
35925
- init_Stack();
35926
- init_Icon();
35927
- init_useEventBus();
35928
- FormSection = ({
35929
- title,
35930
- description,
35931
- children,
35932
- collapsible = false,
35933
- defaultCollapsed = false,
35934
- card = false,
35935
- columns = 1,
35936
- className
35937
- }) => {
35938
- const [collapsed, setCollapsed] = React89__default.useState(defaultCollapsed);
35939
- const { t } = useTranslate();
35940
- const eventBus = useEventBus();
35941
- const gridClass = {
35942
- 1: "grid-cols-1",
35943
- 2: "grid-cols-1 md:grid-cols-2",
35944
- 3: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3"
35945
- }[columns];
35946
- React89__default.useCallback(() => {
35947
- if (collapsible) {
35948
- setCollapsed((prev) => !prev);
35949
- eventBus.emit("UI:TOGGLE_COLLAPSE", { collapsed: !collapsed });
35950
- }
35951
- }, [collapsible, collapsed, eventBus]);
35952
- const content = /* @__PURE__ */ jsxs(Fragment, { children: [
35953
- (title || description) && /* @__PURE__ */ jsxs(VStack, { gap: "xs", className: "mb-4", children: [
35954
- title && /* @__PURE__ */ jsxs(
35955
- HStack,
35956
- {
35957
- justify: "between",
35958
- align: "center",
35959
- className: cn(collapsible && "cursor-pointer"),
35960
- action: collapsible ? "TOGGLE_COLLAPSE" : void 0,
35961
- children: [
35962
- /* @__PURE__ */ jsx(Typography, { variant: "h3", weight: "semibold", children: title }),
35963
- collapsible && /* @__PURE__ */ jsx(
35964
- Button,
35965
- {
35966
- variant: "ghost",
35967
- size: "sm",
35968
- action: "TOGGLE_COLLAPSE",
35969
- children: /* @__PURE__ */ jsx(
35970
- Icon,
35971
- {
35972
- icon: ChevronDown,
35973
- size: "sm",
35974
- className: cn(
35975
- "text-muted-foreground transition-transform",
35976
- collapsed && "rotate-180"
35977
- )
35978
- }
35979
- )
35980
- }
35981
- )
35982
- ]
35983
- }
35984
- ),
35985
- description && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "secondary", children: description })
35986
- ] }),
35987
- (!collapsible || !collapsed) && /* @__PURE__ */ jsx(Box, { className: cn("grid gap-4", gridClass), children })
35988
- ] });
35989
- if (card) {
35990
- return /* @__PURE__ */ jsx(Card, { className: cn("p-6", className), children: content });
35991
- }
35992
- return /* @__PURE__ */ jsx(Box, { className, children: content });
35993
- };
35994
- FormSection.displayName = "FormSection";
35995
- FormLayout = ({
35996
- children,
35997
- dividers = true,
35998
- className
35999
- }) => {
36000
- return /* @__PURE__ */ jsx(
36001
- VStack,
36002
- {
36003
- gap: "lg",
36004
- className: cn(
36005
- dividers && "[&>*+*]:pt-8 [&>*+*]:border-t [&>*+*]:border-border",
36006
- className
36007
- ),
36008
- children
36009
- }
36010
- );
36011
- };
36012
- FormLayout.displayName = "FormLayout";
36013
- FormActions = ({
36014
- children,
36015
- sticky = false,
36016
- align = "right",
36017
- className
36018
- }) => {
36019
- const alignClass2 = {
36020
- left: "justify-start",
36021
- right: "justify-end",
36022
- between: "justify-between",
36023
- center: "justify-center"
36024
- }[align];
36025
- return /* @__PURE__ */ jsx(
36026
- HStack,
36027
- {
36028
- gap: "sm",
36029
- align: "center",
36030
- className: cn(
36031
- "pt-6 border-t border-border",
36032
- alignClass2,
36033
- sticky && "sticky bottom-0 bg-card py-4 -mx-6 px-6 shadow-[0_-4px_6px_-1px_rgb(0,0,0,0.05)]",
36034
- className
36035
- ),
36036
- children
36037
- }
36038
- );
36039
- };
36040
- FormActions.displayName = "FormActions";
36041
- }
36042
- });
36043
- function currentValue(decl, override) {
36044
- return override !== void 0 ? override : decl.default;
36045
- }
36046
- function TextLikeControl({
36047
- field,
36048
- numeric,
36049
- value,
36050
- onCommit
36051
- }) {
36052
- const initial = value === void 0 || value === null ? "" : String(value);
36053
- const [draft, setDraft] = React89__default.useState(initial);
36054
- React89__default.useEffect(() => setDraft(initial), [initial]);
36055
- const commit = () => {
36056
- if (numeric) {
36057
- const n = draft.trim() === "" ? 0 : Number(draft);
36058
- onCommit(field, Number.isNaN(n) ? 0 : n);
36059
- } else {
36060
- onCommit(field, draft);
36061
- }
36062
- };
36063
- return /* @__PURE__ */ jsx(
36064
- Input,
36065
- {
36066
- inputType: numeric ? "number" : "text",
36067
- value: draft,
36068
- onChange: (e) => setDraft(e.target.value),
36069
- onBlur: commit,
36070
- onKeyDown: (e) => {
36071
- if (e.key === "Enter") commit();
36072
- }
36073
- }
36074
- );
36075
- }
36076
- function FieldControl({
36077
- name,
36078
- decl,
36079
- value,
36080
- onChange,
36081
- assets
36082
- }) {
36083
- let control;
36084
- const stringValue = typeof value === "string" ? value : void 0;
36085
- if (decl.type === "icon") {
36086
- control = /* @__PURE__ */ jsx(IconPicker, { value: stringValue, onChange: (icon) => onChange(name, icon) });
36087
- } else if (decl.type === "asset") {
36088
- control = /* @__PURE__ */ jsx(
36089
- AssetPicker,
36090
- {
36091
- assets: assets ?? [],
36092
- value: stringValue,
36093
- onChange: (url) => onChange(name, url)
36094
- }
36095
- );
36096
- } else if (decl.type === "boolean") {
36097
- control = /* @__PURE__ */ jsx(Switch, { checked: value === true, onChange: (c) => onChange(name, c) });
36098
- } else if (decl.type === "string" && decl.values !== void 0 && decl.values.length > 0) {
36099
- control = /* @__PURE__ */ jsx(
36100
- Select,
36101
- {
36102
- options: decl.values.map((v) => ({ value: v, label: v })),
36103
- value: typeof value === "string" ? value : "",
36104
- onChange: (e) => onChange(name, e.target.value)
36105
- }
36106
- );
36107
- } else if (decl.type === "number") {
36108
- control = /* @__PURE__ */ jsx(TextLikeControl, { field: name, numeric: true, value, onCommit: onChange });
36109
- } else if (decl.type === "string") {
36110
- control = /* @__PURE__ */ jsx(TextLikeControl, { field: name, numeric: false, value, onCommit: onChange });
36111
- } else {
36112
- control = /* @__PURE__ */ jsxs(Typography, { variant: "caption", color: "muted", children: [
36113
- decl.type,
36114
- " \u2014 edit in source"
36115
- ] });
36116
- }
36117
- return /* @__PURE__ */ jsxs(VStack, { gap: "xs", children: [
36118
- /* @__PURE__ */ jsx(Typography, { variant: "label", children: decl.label ?? name }),
36119
- control,
36120
- decl.description !== void 0 && decl.description !== "" && /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", children: decl.description })
36121
- ] });
36122
- }
36123
- var TIER_ORDER, PropertyInspector;
36124
- var init_PropertyInspector = __esm({
36125
- "components/core/molecules/PropertyInspector.tsx"() {
36126
- "use client";
36127
- init_cn();
36128
- init_Stack();
36129
- init_Typography();
36130
- init_Button();
36131
- init_Switch();
36132
- init_Select();
36133
- init_Input();
36134
- init_FormSection();
36135
- init_IconPicker();
36136
- init_AssetPicker();
36137
- TIER_ORDER = ["presentation", "domain", "policy", "infra", "internal"];
36138
- PropertyInspector = ({
36139
- config,
36140
- values,
36141
- onChange,
36142
- onReset,
36143
- title,
36144
- className,
36145
- assets
36146
- }) => {
36147
- const fields = Object.entries(config);
36148
- const byTier = /* @__PURE__ */ new Map();
36149
- for (const [name, decl] of fields) {
36150
- const tier = decl.tier ?? "presentation";
36151
- const arr = byTier.get(tier) ?? [];
36152
- arr.push([name, decl]);
36153
- byTier.set(tier, arr);
36154
- }
36155
- const tiers = [...byTier.keys()].sort((a, b) => {
36156
- const ia = TIER_ORDER.indexOf(a);
36157
- const ib = TIER_ORDER.indexOf(b);
36158
- return (ia === -1 ? 99 : ia) - (ib === -1 ? 99 : ib);
36159
- });
36160
- return /* @__PURE__ */ jsxs(VStack, { gap: "sm", className: cn("w-full", className), children: [
36161
- /* @__PURE__ */ jsxs(HStack, { justify: "between", align: "center", children: [
36162
- /* @__PURE__ */ jsx(Typography, { variant: "caption", weight: "bold", children: title ?? "Config" }),
36163
- onReset !== void 0 && /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", icon: "rotate-ccw", label: "Reset", onClick: onReset })
36164
- ] }),
36165
- fields.length === 0 && /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", children: "No configurable properties." }),
36166
- tiers.map((tier) => /* @__PURE__ */ jsx(FormSection, { title: tier, collapsible: true, defaultCollapsed: tier !== "presentation", children: /* @__PURE__ */ jsx(VStack, { gap: "sm", children: byTier.get(tier)?.map(([name, decl]) => /* @__PURE__ */ jsx(
36167
- FieldControl,
36168
- {
36169
- name,
36170
- decl,
36171
- value: currentValue(decl, values?.[name]),
36172
- onChange,
36173
- assets
36174
- },
36175
- name
36176
- )) }) }, tier))
36177
- ] });
36178
- };
36179
- }
36180
- });
36181
35376
  var lookStyles8, Header;
36182
35377
  var init_Header = __esm({
36183
35378
  "components/core/molecules/Header.tsx"() {
@@ -36828,7 +36023,7 @@ var init_WizardContainer = __esm({
36828
36023
  const isCompleted = index < currentStep;
36829
36024
  const stepKey = step.id ?? step.tabId ?? `step-${index}`;
36830
36025
  const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
36831
- return /* @__PURE__ */ jsxs(React89__default.Fragment, { children: [
36026
+ return /* @__PURE__ */ jsxs(React85__default.Fragment, { children: [
36832
36027
  /* @__PURE__ */ jsx(
36833
36028
  Button,
36834
36029
  {
@@ -39113,7 +38308,7 @@ var init_DetailPanel = __esm({
39113
38308
  }
39114
38309
  });
39115
38310
  function extractTitle(children) {
39116
- if (!React89__default.isValidElement(children)) return void 0;
38311
+ if (!React85__default.isValidElement(children)) return void 0;
39117
38312
  const props = children.props;
39118
38313
  if (typeof props.title === "string") {
39119
38314
  return props.title;
@@ -39168,7 +38363,7 @@ function LinearView({
39168
38363
  /* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
39169
38364
  const isDone = i < currentIdx;
39170
38365
  const isCurrent = i === currentIdx;
39171
- return /* @__PURE__ */ jsxs(React89__default.Fragment, { children: [
38366
+ return /* @__PURE__ */ jsxs(React85__default.Fragment, { children: [
39172
38367
  i > 0 && /* @__PURE__ */ jsx(
39173
38368
  Typography,
39174
38369
  {
@@ -40126,12 +39321,12 @@ var init_Form = __esm({
40126
39321
  const isSchemaEntity = isOrbitalEntitySchema(entity);
40127
39322
  const resolvedEntity = isSchemaEntity ? entity : void 0;
40128
39323
  const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
40129
- const normalizedInitialData = React89__default.useMemo(() => {
39324
+ const normalizedInitialData = React85__default.useMemo(() => {
40130
39325
  const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
40131
39326
  const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
40132
39327
  return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
40133
39328
  }, [entity, initialData]);
40134
- const entityDerivedFields = React89__default.useMemo(() => {
39329
+ const entityDerivedFields = React85__default.useMemo(() => {
40135
39330
  if (fields && fields.length > 0) return void 0;
40136
39331
  if (!resolvedEntity) return void 0;
40137
39332
  return resolvedEntity.fields.map(
@@ -40151,16 +39346,16 @@ var init_Form = __esm({
40151
39346
  const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
40152
39347
  const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
40153
39348
  const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
40154
- const [formData, setFormData] = React89__default.useState(
39349
+ const [formData, setFormData] = React85__default.useState(
40155
39350
  normalizedInitialData
40156
39351
  );
40157
- const [collapsedSections, setCollapsedSections] = React89__default.useState(
39352
+ const [collapsedSections, setCollapsedSections] = React85__default.useState(
40158
39353
  /* @__PURE__ */ new Set()
40159
39354
  );
40160
- const [submitError, setSubmitError] = React89__default.useState(null);
40161
- const formRef = React89__default.useRef(null);
39355
+ const [submitError, setSubmitError] = React85__default.useState(null);
39356
+ const formRef = React85__default.useRef(null);
40162
39357
  const formMode = props.mode;
40163
- const mountedRef = React89__default.useRef(false);
39358
+ const mountedRef = React85__default.useRef(false);
40164
39359
  if (!mountedRef.current) {
40165
39360
  mountedRef.current = true;
40166
39361
  debug("forms", "mount", {
@@ -40173,7 +39368,7 @@ var init_Form = __esm({
40173
39368
  });
40174
39369
  }
40175
39370
  const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
40176
- const evalContext = React89__default.useMemo(
39371
+ const evalContext = React85__default.useMemo(
40177
39372
  () => ({
40178
39373
  formValues: formData,
40179
39374
  globalVariables: externalContext?.globalVariables ?? {},
@@ -40182,7 +39377,7 @@ var init_Form = __esm({
40182
39377
  }),
40183
39378
  [formData, externalContext]
40184
39379
  );
40185
- React89__default.useEffect(() => {
39380
+ React85__default.useEffect(() => {
40186
39381
  debug("forms", "initialData-sync", {
40187
39382
  mode: formMode,
40188
39383
  normalizedInitialData,
@@ -40193,7 +39388,7 @@ var init_Form = __esm({
40193
39388
  setFormData(normalizedInitialData);
40194
39389
  }
40195
39390
  }, [normalizedInitialData]);
40196
- const processCalculations = React89__default.useCallback(
39391
+ const processCalculations = React85__default.useCallback(
40197
39392
  (changedFieldId, newFormData) => {
40198
39393
  if (!hiddenCalculations.length) return;
40199
39394
  const context = {
@@ -40218,7 +39413,7 @@ var init_Form = __esm({
40218
39413
  },
40219
39414
  [hiddenCalculations, externalContext, eventBus]
40220
39415
  );
40221
- const checkViolations = React89__default.useCallback(
39416
+ const checkViolations = React85__default.useCallback(
40222
39417
  (changedFieldId, newFormData) => {
40223
39418
  if (!violationTriggers.length) return;
40224
39419
  const context = {
@@ -40256,7 +39451,7 @@ var init_Form = __esm({
40256
39451
  processCalculations(name, newFormData);
40257
39452
  checkViolations(name, newFormData);
40258
39453
  };
40259
- const isFieldVisible = React89__default.useCallback(
39454
+ const isFieldVisible = React85__default.useCallback(
40260
39455
  (fieldName) => {
40261
39456
  const condition = conditionalFields[fieldName];
40262
39457
  if (!condition) return true;
@@ -40264,7 +39459,7 @@ var init_Form = __esm({
40264
39459
  },
40265
39460
  [conditionalFields, evalContext]
40266
39461
  );
40267
- const isSectionVisible = React89__default.useCallback(
39462
+ const isSectionVisible = React85__default.useCallback(
40268
39463
  (section) => {
40269
39464
  if (!section.condition) return true;
40270
39465
  return Boolean(evaluateFormExpression(section.condition, evalContext));
@@ -40340,7 +39535,7 @@ var init_Form = __esm({
40340
39535
  eventBus.emit(`UI:${onCancel}`);
40341
39536
  }
40342
39537
  };
40343
- const renderField = React89__default.useCallback(
39538
+ const renderField = React85__default.useCallback(
40344
39539
  (field) => {
40345
39540
  const fieldName = field.name || field.field;
40346
39541
  if (!fieldName) return null;
@@ -40349,19 +39544,19 @@ var init_Form = __esm({
40349
39544
  }
40350
39545
  const inputType = determineInputType(field);
40351
39546
  const label = field.label || fieldName.charAt(0).toUpperCase() + fieldName.slice(1).replace(/([A-Z])/g, " $1");
40352
- const currentValue2 = formData[fieldName] ?? field.defaultValue ?? "";
39547
+ const currentValue = formData[fieldName] ?? field.defaultValue ?? "";
40353
39548
  return /* @__PURE__ */ jsxs(VStack, { gap: "xs", "data-field": fieldName, children: [
40354
39549
  inputType !== "checkbox" && /* @__PURE__ */ jsxs(Typography, { as: "label", variant: "label", weight: "bold", children: [
40355
39550
  label,
40356
39551
  field.required && /* @__PURE__ */ jsx(Typography, { as: "span", color: "error", className: "ml-1", children: "*" })
40357
39552
  ] }),
40358
- renderFieldInput(field, fieldName, inputType, currentValue2, label)
39553
+ renderFieldInput(field, fieldName, inputType, currentValue, label)
40359
39554
  ] }, fieldName);
40360
39555
  },
40361
39556
  [formData, isFieldVisible, relationsData, relationsLoading, isLoading]
40362
39557
  );
40363
39558
  const effectiveFields = entityDerivedFields ?? fields;
40364
- const normalizedFields = React89__default.useMemo(() => {
39559
+ const normalizedFields = React85__default.useMemo(() => {
40365
39560
  if (!effectiveFields || effectiveFields.length === 0) return [];
40366
39561
  return effectiveFields.map((field) => {
40367
39562
  if (typeof field === "string") {
@@ -40384,7 +39579,7 @@ var init_Form = __esm({
40384
39579
  return field;
40385
39580
  });
40386
39581
  }, [effectiveFields, resolvedEntity]);
40387
- const schemaFields = React89__default.useMemo(() => {
39582
+ const schemaFields = React85__default.useMemo(() => {
40388
39583
  if (normalizedFields.length === 0) return null;
40389
39584
  if (isDebugEnabled()) {
40390
39585
  debugGroup(`Form: ${entityName || "unknown"}`);
@@ -40394,7 +39589,7 @@ var init_Form = __esm({
40394
39589
  }
40395
39590
  return normalizedFields.map(renderField).filter(Boolean);
40396
39591
  }, [normalizedFields, renderField, entityName, conditionalFields]);
40397
- const sectionElements = React89__default.useMemo(() => {
39592
+ const sectionElements = React85__default.useMemo(() => {
40398
39593
  if (!sections || sections.length === 0) return null;
40399
39594
  return sections.map((section) => {
40400
39595
  if (!isSectionVisible(section)) {
@@ -40430,7 +39625,7 @@ var init_Form = __esm({
40430
39625
  ] }, section.id);
40431
39626
  }).filter(Boolean);
40432
39627
  }, [sections, isSectionVisible, collapsedSections, renderField, gap]);
40433
- function renderFieldInput(field, fieldName, inputType, currentValue2, label) {
39628
+ function renderFieldInput(field, fieldName, inputType, currentValue, label) {
40434
39629
  const commonProps = {
40435
39630
  id: fieldName,
40436
39631
  name: fieldName,
@@ -40447,7 +39642,7 @@ var init_Form = __esm({
40447
39642
  {
40448
39643
  ...commonProps,
40449
39644
  label: label + (field.required ? " *" : ""),
40450
- checked: Boolean(currentValue2),
39645
+ checked: Boolean(currentValue),
40451
39646
  onChange: (e) => handleChange(fieldName, e.target.checked)
40452
39647
  }
40453
39648
  );
@@ -40456,7 +39651,7 @@ var init_Form = __esm({
40456
39651
  Textarea,
40457
39652
  {
40458
39653
  ...commonProps,
40459
- value: String(currentValue2),
39654
+ value: String(currentValue),
40460
39655
  onChange: (e) => handleChange(fieldName, e.target.value),
40461
39656
  minLength: field.min,
40462
39657
  maxLength: field.max
@@ -40469,7 +39664,7 @@ var init_Form = __esm({
40469
39664
  {
40470
39665
  ...commonProps,
40471
39666
  options,
40472
- value: String(currentValue2),
39667
+ value: String(currentValue),
40473
39668
  onChange: (e) => handleChange(fieldName, e.target.value),
40474
39669
  placeholder: field.placeholder || `Select ${label}...`
40475
39670
  }
@@ -40482,7 +39677,7 @@ var init_Form = __esm({
40482
39677
  RelationSelect,
40483
39678
  {
40484
39679
  ...commonProps,
40485
- value: currentValue2 ? String(currentValue2) : void 0,
39680
+ value: currentValue ? String(currentValue) : void 0,
40486
39681
  onChange: (value) => handleChange(fieldName, value),
40487
39682
  options: relationOptions,
40488
39683
  isLoading: relationLoading,
@@ -40498,7 +39693,7 @@ var init_Form = __esm({
40498
39693
  {
40499
39694
  ...commonProps,
40500
39695
  type: "number",
40501
- value: currentValue2 !== void 0 && currentValue2 !== "" ? String(currentValue2) : "",
39696
+ value: currentValue !== void 0 && currentValue !== "" ? String(currentValue) : "",
40502
39697
  onChange: (e) => handleChange(
40503
39698
  fieldName,
40504
39699
  e.target.value ? Number(e.target.value) : void 0
@@ -40513,7 +39708,7 @@ var init_Form = __esm({
40513
39708
  {
40514
39709
  ...commonProps,
40515
39710
  type: "date",
40516
- value: formatDateValue(currentValue2),
39711
+ value: formatDateValue(currentValue),
40517
39712
  onChange: (e) => handleChange(fieldName, e.target.value)
40518
39713
  }
40519
39714
  );
@@ -40523,7 +39718,7 @@ var init_Form = __esm({
40523
39718
  {
40524
39719
  ...commonProps,
40525
39720
  type: "datetime-local",
40526
- value: formatDateTimeValue(currentValue2),
39721
+ value: formatDateTimeValue(currentValue),
40527
39722
  onChange: (e) => handleChange(fieldName, e.target.value)
40528
39723
  }
40529
39724
  );
@@ -40533,7 +39728,7 @@ var init_Form = __esm({
40533
39728
  {
40534
39729
  ...commonProps,
40535
39730
  type: "email",
40536
- value: String(currentValue2),
39731
+ value: String(currentValue),
40537
39732
  onChange: (e) => handleChange(fieldName, e.target.value),
40538
39733
  minLength: field.min,
40539
39734
  maxLength: field.max
@@ -40545,7 +39740,7 @@ var init_Form = __esm({
40545
39740
  {
40546
39741
  ...commonProps,
40547
39742
  type: "url",
40548
- value: String(currentValue2),
39743
+ value: String(currentValue),
40549
39744
  onChange: (e) => handleChange(fieldName, e.target.value),
40550
39745
  minLength: field.min,
40551
39746
  maxLength: field.max
@@ -40557,7 +39752,7 @@ var init_Form = __esm({
40557
39752
  {
40558
39753
  ...commonProps,
40559
39754
  type: "password",
40560
- value: String(currentValue2),
39755
+ value: String(currentValue),
40561
39756
  onChange: (e) => handleChange(fieldName, e.target.value),
40562
39757
  minLength: field.min,
40563
39758
  maxLength: field.max
@@ -40570,7 +39765,7 @@ var init_Form = __esm({
40570
39765
  {
40571
39766
  ...commonProps,
40572
39767
  type: "text",
40573
- value: String(currentValue2),
39768
+ value: String(currentValue),
40574
39769
  onChange: (e) => handleChange(fieldName, e.target.value),
40575
39770
  minLength: field.min,
40576
39771
  maxLength: field.max
@@ -41669,7 +40864,7 @@ var init_List = __esm({
41669
40864
  if (entity && typeof entity === "object" && "id" in entity) return [entity];
41670
40865
  return [];
41671
40866
  }, [entity]);
41672
- const getItemActions = React89__default.useCallback(
40867
+ const getItemActions = React85__default.useCallback(
41673
40868
  (item) => {
41674
40869
  if (!itemActions) return [];
41675
40870
  if (typeof itemActions === "function") {
@@ -42145,7 +41340,7 @@ var init_MediaGallery = __esm({
42145
41340
  [selectable, selectedItems, selectionEvent, eventBus]
42146
41341
  );
42147
41342
  const entityData = Array.isArray(entity) ? entity : [];
42148
- const items = React89__default.useMemo(() => {
41343
+ const items = React85__default.useMemo(() => {
42149
41344
  if (propItems) return propItems;
42150
41345
  if (entityData.length === 0) return [];
42151
41346
  return entityData.map((record, idx) => ({
@@ -42306,7 +41501,7 @@ var init_MediaGallery = __esm({
42306
41501
  }
42307
41502
  });
42308
41503
  function extractTitle2(children) {
42309
- if (!React89__default.isValidElement(children)) return void 0;
41504
+ if (!React85__default.isValidElement(children)) return void 0;
42310
41505
  const props = children.props;
42311
41506
  if (typeof props.title === "string") {
42312
41507
  return props.title;
@@ -42718,7 +41913,7 @@ var init_debugRegistry = __esm({
42718
41913
  }
42719
41914
  });
42720
41915
  function useDebugData() {
42721
- const [data, setData] = React89.useState(() => ({
41916
+ const [data, setData] = React85.useState(() => ({
42722
41917
  traits: [],
42723
41918
  ticks: [],
42724
41919
  guards: [],
@@ -42732,7 +41927,7 @@ function useDebugData() {
42732
41927
  },
42733
41928
  lastUpdate: Date.now()
42734
41929
  }));
42735
- React89.useEffect(() => {
41930
+ React85.useEffect(() => {
42736
41931
  const updateData = () => {
42737
41932
  setData({
42738
41933
  traits: getAllTraits(),
@@ -42841,12 +42036,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
42841
42036
  return positions;
42842
42037
  }
42843
42038
  function WalkMinimap() {
42844
- const [walkStep, setWalkStep] = React89.useState(null);
42845
- const [traits2, setTraits] = React89.useState([]);
42846
- const [coveredEdges, setCoveredEdges] = React89.useState([]);
42847
- const [completedTraits, setCompletedTraits] = React89.useState(/* @__PURE__ */ new Set());
42848
- const prevTraitRef = React89.useRef(null);
42849
- React89.useEffect(() => {
42039
+ const [walkStep, setWalkStep] = React85.useState(null);
42040
+ const [traits2, setTraits] = React85.useState([]);
42041
+ const [coveredEdges, setCoveredEdges] = React85.useState([]);
42042
+ const [completedTraits, setCompletedTraits] = React85.useState(/* @__PURE__ */ new Set());
42043
+ const prevTraitRef = React85.useRef(null);
42044
+ React85.useEffect(() => {
42850
42045
  const interval = setInterval(() => {
42851
42046
  const w = window;
42852
42047
  const step = w.__orbitalWalkStep;
@@ -43282,15 +42477,15 @@ var init_EntitiesTab = __esm({
43282
42477
  });
43283
42478
  function EventFlowTab({ events: events2 }) {
43284
42479
  const { t } = useTranslate();
43285
- const [filter, setFilter] = React89.useState("all");
43286
- const containerRef = React89.useRef(null);
43287
- const [autoScroll, setAutoScroll] = React89.useState(true);
43288
- React89.useEffect(() => {
42480
+ const [filter, setFilter] = React85.useState("all");
42481
+ const containerRef = React85.useRef(null);
42482
+ const [autoScroll, setAutoScroll] = React85.useState(true);
42483
+ React85.useEffect(() => {
43289
42484
  if (autoScroll && containerRef.current) {
43290
42485
  containerRef.current.scrollTop = containerRef.current.scrollHeight;
43291
42486
  }
43292
42487
  }, [events2.length, autoScroll]);
43293
- const filteredEvents = React89.useMemo(() => {
42488
+ const filteredEvents = React85.useMemo(() => {
43294
42489
  if (filter === "all") return events2;
43295
42490
  return events2.filter((e) => e.type === filter);
43296
42491
  }, [events2, filter]);
@@ -43406,7 +42601,7 @@ var init_EventFlowTab = __esm({
43406
42601
  });
43407
42602
  function GuardsPanel({ guards }) {
43408
42603
  const { t } = useTranslate();
43409
- const [filter, setFilter] = React89.useState("all");
42604
+ const [filter, setFilter] = React85.useState("all");
43410
42605
  if (guards.length === 0) {
43411
42606
  return /* @__PURE__ */ jsx(
43412
42607
  EmptyState,
@@ -43419,7 +42614,7 @@ function GuardsPanel({ guards }) {
43419
42614
  }
43420
42615
  const passedCount = guards.filter((g) => g.result).length;
43421
42616
  const failedCount = guards.length - passedCount;
43422
- const filteredGuards = React89.useMemo(() => {
42617
+ const filteredGuards = React85.useMemo(() => {
43423
42618
  if (filter === "all") return guards;
43424
42619
  if (filter === "passed") return guards.filter((g) => g.result);
43425
42620
  return guards.filter((g) => !g.result);
@@ -43582,10 +42777,10 @@ function EffectBadge({ effect }) {
43582
42777
  }
43583
42778
  function TransitionTimeline({ transitions }) {
43584
42779
  const { t } = useTranslate();
43585
- const containerRef = React89.useRef(null);
43586
- const [autoScroll, setAutoScroll] = React89.useState(true);
43587
- const [expandedId, setExpandedId] = React89.useState(null);
43588
- React89.useEffect(() => {
42780
+ const containerRef = React85.useRef(null);
42781
+ const [autoScroll, setAutoScroll] = React85.useState(true);
42782
+ const [expandedId, setExpandedId] = React85.useState(null);
42783
+ React85.useEffect(() => {
43589
42784
  if (autoScroll && containerRef.current) {
43590
42785
  containerRef.current.scrollTop = containerRef.current.scrollHeight;
43591
42786
  }
@@ -43865,9 +43060,9 @@ function getAllEvents(traits2) {
43865
43060
  function EventDispatcherTab({ traits: traits2, schema }) {
43866
43061
  const eventBus = useEventBus();
43867
43062
  const { t } = useTranslate();
43868
- const [log12, setLog] = React89.useState([]);
43869
- const prevStatesRef = React89.useRef(/* @__PURE__ */ new Map());
43870
- React89.useEffect(() => {
43063
+ const [log12, setLog] = React85.useState([]);
43064
+ const prevStatesRef = React85.useRef(/* @__PURE__ */ new Map());
43065
+ React85.useEffect(() => {
43871
43066
  for (const trait of traits2) {
43872
43067
  const prev = prevStatesRef.current.get(trait.id);
43873
43068
  if (prev && prev !== trait.currentState) {
@@ -44036,10 +43231,10 @@ function VerifyModePanel({
44036
43231
  localCount
44037
43232
  }) {
44038
43233
  const { t } = useTranslate();
44039
- const [expanded, setExpanded] = React89.useState(true);
44040
- const scrollRef = React89.useRef(null);
44041
- const prevCountRef = React89.useRef(0);
44042
- React89.useEffect(() => {
43234
+ const [expanded, setExpanded] = React85.useState(true);
43235
+ const scrollRef = React85.useRef(null);
43236
+ const prevCountRef = React85.useRef(0);
43237
+ React85.useEffect(() => {
44043
43238
  if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
44044
43239
  scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
44045
43240
  }
@@ -44096,10 +43291,10 @@ function RuntimeDebugger({
44096
43291
  schema
44097
43292
  }) {
44098
43293
  const { t } = useTranslate();
44099
- const [isCollapsed, setIsCollapsed] = React89.useState(mode === "verify" ? true : defaultCollapsed);
44100
- const [isVisible, setIsVisible] = React89.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
43294
+ const [isCollapsed, setIsCollapsed] = React85.useState(mode === "verify" ? true : defaultCollapsed);
43295
+ const [isVisible, setIsVisible] = React85.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
44101
43296
  const debugData = useDebugData();
44102
- React89.useEffect(() => {
43297
+ React85.useEffect(() => {
44103
43298
  if (mode === "inline") return;
44104
43299
  return onDebugToggle((enabled) => {
44105
43300
  setIsVisible(enabled);
@@ -44108,7 +43303,7 @@ function RuntimeDebugger({
44108
43303
  }
44109
43304
  });
44110
43305
  }, [mode]);
44111
- React89.useEffect(() => {
43306
+ React85.useEffect(() => {
44112
43307
  if (mode === "inline") return;
44113
43308
  const handleKeyDown = (e) => {
44114
43309
  if (e.key === "`" && isVisible) {
@@ -44557,7 +43752,7 @@ function SequenceBar({
44557
43752
  onSlotRemove(index);
44558
43753
  }, [onSlotRemove, playing]);
44559
43754
  const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
44560
- return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React89__default.Fragment, { children: [
43755
+ return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React85__default.Fragment, { children: [
44561
43756
  i > 0 && /* @__PURE__ */ jsx(
44562
43757
  Typography,
44563
43758
  {
@@ -45515,7 +44710,7 @@ var init_StatCard = __esm({
45515
44710
  title: propTitle,
45516
44711
  value: propValue,
45517
44712
  previousValue,
45518
- currentValue: currentValue2,
44713
+ currentValue,
45519
44714
  trend: manualTrend,
45520
44715
  trendDirection: manualDirection,
45521
44716
  invertTrend = false,
@@ -45536,7 +44731,7 @@ var init_StatCard = __esm({
45536
44731
  const labelToUse = propLabel ?? propTitle;
45537
44732
  const eventBus = useEventBus();
45538
44733
  const { t } = useTranslate();
45539
- const handleActionClick = React89__default.useCallback(() => {
44734
+ const handleActionClick = React85__default.useCallback(() => {
45540
44735
  if (action?.event) {
45541
44736
  eventBus.emit(`UI:${action.event}`, {});
45542
44737
  }
@@ -45547,7 +44742,7 @@ var init_StatCard = __esm({
45547
44742
  const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
45548
44743
  const isLoading = externalLoading ?? false;
45549
44744
  const error = externalError;
45550
- const computeMetricValue = React89__default.useCallback(
44745
+ const computeMetricValue = React85__default.useCallback(
45551
44746
  (metric, items) => {
45552
44747
  if (metric.value !== void 0) {
45553
44748
  return metric.value;
@@ -45586,7 +44781,7 @@ var init_StatCard = __esm({
45586
44781
  },
45587
44782
  []
45588
44783
  );
45589
- const schemaStats = React89__default.useMemo(() => {
44784
+ const schemaStats = React85__default.useMemo(() => {
45590
44785
  if (!metrics || metrics.length === 0) return null;
45591
44786
  return metrics.map((metric) => ({
45592
44787
  label: metric.label,
@@ -45594,13 +44789,13 @@ var init_StatCard = __esm({
45594
44789
  format: metric.format
45595
44790
  }));
45596
44791
  }, [metrics, data, computeMetricValue]);
45597
- const calculatedTrend = React89__default.useMemo(() => {
44792
+ const calculatedTrend = React85__default.useMemo(() => {
45598
44793
  if (manualTrend !== void 0) return manualTrend;
45599
- if (previousValue === void 0 || currentValue2 === void 0)
44794
+ if (previousValue === void 0 || currentValue === void 0)
45600
44795
  return void 0;
45601
- if (previousValue === 0) return currentValue2 > 0 ? 100 : 0;
45602
- return (currentValue2 - previousValue) / previousValue * 100;
45603
- }, [manualTrend, previousValue, currentValue2]);
44796
+ if (previousValue === 0) return currentValue > 0 ? 100 : 0;
44797
+ return (currentValue - previousValue) / previousValue * 100;
44798
+ }, [manualTrend, previousValue, currentValue]);
45604
44799
  if (schemaStats && schemaStats.length > 1) {
45605
44800
  if (isLoading) {
45606
44801
  return /* @__PURE__ */ jsx(
@@ -45875,6 +45070,37 @@ var init_VariablePanel = __esm({
45875
45070
  VariablePanel.displayName = "VariablePanel";
45876
45071
  }
45877
45072
  });
45073
+ function StateJsonView({
45074
+ data,
45075
+ label,
45076
+ defaultExpanded = false,
45077
+ className
45078
+ }) {
45079
+ const { t } = useTranslate();
45080
+ const [expanded, setExpanded] = useState(defaultExpanded);
45081
+ const jsonString = JSON.stringify(data, null, 2);
45082
+ return /* @__PURE__ */ jsxs(VStack, { className: cn("rounded-lg border border-border overflow-hidden", className), gap: "none", children: [
45083
+ /* @__PURE__ */ jsxs(HStack, { className: "items-center justify-between p-2 bg-muted", gap: "sm", children: [
45084
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-muted-foreground font-medium", children: label ?? t("stateArchitect.viewCode") }),
45085
+ /* @__PURE__ */ jsx(Button, { variant: "ghost", onClick: () => setExpanded(!expanded), className: "text-xs", children: expanded ? t("stateArchitect.hideJson") : t("stateArchitect.showJson") })
45086
+ ] }),
45087
+ expanded && /* @__PURE__ */ jsx(Box, { className: "p-3 bg-background overflow-x-auto", children: /* @__PURE__ */ jsx(
45088
+ Typography,
45089
+ {
45090
+ variant: "caption",
45091
+ className: "text-foreground font-mono whitespace-pre text-xs leading-relaxed block",
45092
+ children: jsonString
45093
+ }
45094
+ ) })
45095
+ ] });
45096
+ }
45097
+ var init_StateJsonView = __esm({
45098
+ "components/game/organisms/puzzles/state-architect/StateJsonView.tsx"() {
45099
+ init_atoms2();
45100
+ init_cn();
45101
+ StateJsonView.displayName = "StateJsonView";
45102
+ }
45103
+ });
45878
45104
  function layoutStates(states, width, height) {
45879
45105
  const cx = width / 2;
45880
45106
  const cy = height / 2;
@@ -46166,7 +45392,7 @@ function StateArchitectBoard({
46166
45392
  !r.passed && /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-error", children: t("stateArchitect.gotState", { state: r.actualState }) })
46167
45393
  ] }, i))
46168
45394
  ] }),
46169
- resolved.showCodeView !== false && /* @__PURE__ */ jsx(CodeView, { data: codeData, label: "View Code" })
45395
+ resolved.showCodeView !== false && /* @__PURE__ */ jsx(StateJsonView, { data: codeData, label: "View Code" })
46170
45396
  ] })
46171
45397
  ] }),
46172
45398
  playState === "success" && /* @__PURE__ */ jsx(Box, { className: "p-4 rounded-container bg-success/20 border border-success text-center", children: /* @__PURE__ */ jsx(Typography, { variant: "h5", className: "text-success", children: str(resolved.successMessage) || t("stateArchitect.allPassed") }) }),
@@ -46203,7 +45429,7 @@ var init_StateArchitectBoard = __esm({
46203
45429
  init_StateNode();
46204
45430
  init_TransitionArrow();
46205
45431
  init_VariablePanel();
46206
- init_CodeView();
45432
+ init_StateJsonView();
46207
45433
  init_boardEntity();
46208
45434
  ENCOURAGEMENT_KEYS3 = [
46209
45435
  "puzzle.tryAgain1",
@@ -46528,7 +45754,7 @@ var init_Timeline = __esm({
46528
45754
  }) => {
46529
45755
  const { t } = useTranslate();
46530
45756
  const entityData = Array.isArray(entity) ? entity : [];
46531
- const items = React89__default.useMemo(() => {
45757
+ const items = React85__default.useMemo(() => {
46532
45758
  if (propItems) return propItems;
46533
45759
  if (entityData.length === 0) return [];
46534
45760
  return entityData.map((record, idx) => {
@@ -46635,7 +45861,7 @@ var init_Timeline = __esm({
46635
45861
  }
46636
45862
  });
46637
45863
  function extractToastProps(children) {
46638
- if (!React89__default.isValidElement(children)) {
45864
+ if (!React85__default.isValidElement(children)) {
46639
45865
  if (typeof children === "string") {
46640
45866
  return { message: children };
46641
45867
  }
@@ -46673,7 +45899,7 @@ var init_ToastSlot = __esm({
46673
45899
  eventBus.emit("UI:CLOSE");
46674
45900
  };
46675
45901
  if (!isVisible) return null;
46676
- const isCustomContent = React89__default.isValidElement(children) && !message;
45902
+ const isCustomContent = React85__default.isValidElement(children) && !message;
46677
45903
  return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
46678
45904
  Toast,
46679
45905
  {
@@ -47183,12 +46409,12 @@ var init_WorldMapTemplate = __esm({
47183
46409
  }
47184
46410
  });
47185
46411
  function lazyThree(name, loader) {
47186
- const Lazy = React89__default.lazy(() => loader().then((m) => ({ default: m[name] })));
46412
+ const Lazy = React85__default.lazy(() => loader().then((m) => ({ default: m[name] })));
47187
46413
  function ThreeWrapper(props) {
47188
- return React89__default.createElement(
47189
- React89__default.Suspense,
46414
+ return React85__default.createElement(
46415
+ React85__default.Suspense,
47190
46416
  { fallback: null },
47191
- React89__default.createElement(Lazy, props)
46417
+ React85__default.createElement(Lazy, props)
47192
46418
  );
47193
46419
  }
47194
46420
  ThreeWrapper.displayName = `Lazy(${name})`;
@@ -47208,7 +46434,6 @@ var init_component_registry_generated = __esm({
47208
46434
  init_AnimatedReveal();
47209
46435
  init_ArticleSection();
47210
46436
  init_Aside();
47211
- init_AssetPicker();
47212
46437
  init_AuthLayout();
47213
46438
  init_BattleBoard();
47214
46439
  init_BattleTemplate();
@@ -47237,8 +46462,6 @@ var init_component_registry_generated = __esm({
47237
46462
  init_ChoiceButton();
47238
46463
  init_ClassifierBoard();
47239
46464
  init_CodeBlock();
47240
- init_CodeView();
47241
- init_CodeViewer();
47242
46465
  init_CombatLog();
47243
46466
  init_ComboCounter();
47244
46467
  init_CommunityLinks();
@@ -47266,7 +46489,6 @@ var init_component_registry_generated = __esm({
47266
46489
  init_DialogueBox();
47267
46490
  init_DialogueBubble();
47268
46491
  init_DocBreadcrumb();
47269
- init_DocCodeBlock();
47270
46492
  init_DocPagination();
47271
46493
  init_DocSearch();
47272
46494
  init_DocSidebar();
@@ -47308,13 +46530,11 @@ var init_component_registry_generated = __esm({
47308
46530
  init_GradientDivider();
47309
46531
  init_GraphCanvas();
47310
46532
  init_GraphView();
47311
- init_GridPicker();
47312
46533
  init_Header();
47313
46534
  init_HealthBar();
47314
46535
  init_HealthPanel();
47315
46536
  init_HeroOrganism();
47316
46537
  init_HeroSection();
47317
- init_IconPicker();
47318
46538
  init_InfiniteScrollSentinel();
47319
46539
  init_InputGroup();
47320
46540
  init_InstallBox();
@@ -47359,7 +46579,6 @@ var init_component_registry_generated = __esm({
47359
46579
  init_PricingOrganism();
47360
46580
  init_PricingPageTemplate();
47361
46581
  init_ProgressDots();
47362
- init_PropertyInspector();
47363
46582
  init_PullQuote();
47364
46583
  init_PullToRefresh();
47365
46584
  init_QrScanner();
@@ -47483,7 +46702,6 @@ var init_component_registry_generated = __esm({
47483
46702
  "AnimatedReveal": AnimatedReveal,
47484
46703
  "ArticleSection": ArticleSection,
47485
46704
  "Aside": Aside,
47486
- "AssetPicker": AssetPicker,
47487
46705
  "AuthLayout": AuthLayout,
47488
46706
  "Avatar": AvatarPattern,
47489
46707
  "AvatarPattern": AvatarPattern,
@@ -47525,8 +46743,6 @@ var init_component_registry_generated = __esm({
47525
46743
  "ChoiceButton": ChoiceButton,
47526
46744
  "ClassifierBoard": ClassifierBoard,
47527
46745
  "CodeBlock": CodeBlock,
47528
- "CodeView": CodeView,
47529
- "CodeViewer": CodeViewer,
47530
46746
  "CombatLog": CombatLog,
47531
46747
  "ComboCounter": ComboCounter,
47532
46748
  "CommunityLinks": CommunityLinks,
@@ -47558,7 +46774,6 @@ var init_component_registry_generated = __esm({
47558
46774
  "Divider": DividerPattern,
47559
46775
  "DividerPattern": DividerPattern,
47560
46776
  "DocBreadcrumb": DocBreadcrumb,
47561
- "DocCodeBlock": DocCodeBlock,
47562
46777
  "DocPagination": DocPagination,
47563
46778
  "DocSearch": DocSearch,
47564
46779
  "DocSidebar": DocSidebar,
@@ -47603,7 +46818,6 @@ var init_component_registry_generated = __esm({
47603
46818
  "GraphView": GraphView,
47604
46819
  "Grid": GridPattern,
47605
46820
  "GridPattern": GridPattern,
47606
- "GridPicker": GridPicker,
47607
46821
  "HStack": HStackPattern,
47608
46822
  "HStackPattern": HStackPattern,
47609
46823
  "Header": Header,
@@ -47613,7 +46827,6 @@ var init_component_registry_generated = __esm({
47613
46827
  "HeroSection": HeroSection,
47614
46828
  "Icon": IconPattern,
47615
46829
  "IconPattern": IconPattern,
47616
- "IconPicker": IconPicker,
47617
46830
  "InfiniteScrollSentinel": InfiniteScrollSentinel,
47618
46831
  "Input": InputPattern,
47619
46832
  "InputGroup": InputGroup,
@@ -47670,7 +46883,6 @@ var init_component_registry_generated = __esm({
47670
46883
  "ProgressBar": ProgressBarPattern,
47671
46884
  "ProgressBarPattern": ProgressBarPattern,
47672
46885
  "ProgressDots": ProgressDots,
47673
- "PropertyInspector": PropertyInspector,
47674
46886
  "PullQuote": PullQuote,
47675
46887
  "PullToRefresh": PullToRefresh,
47676
46888
  "QrScanner": QrScanner,
@@ -47812,7 +47024,7 @@ function SuspenseConfigProvider({
47812
47024
  config,
47813
47025
  children
47814
47026
  }) {
47815
- return React89__default.createElement(
47027
+ return React85__default.createElement(
47816
47028
  SuspenseConfigContext.Provider,
47817
47029
  { value: config },
47818
47030
  children
@@ -48302,7 +47514,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
48302
47514
  const key = `${parentId}-${index}-trait:${traitName}`;
48303
47515
  return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
48304
47516
  }
48305
- return /* @__PURE__ */ jsx(React89__default.Fragment, { children: child }, `${parentId}-${index}`);
47517
+ return /* @__PURE__ */ jsx(React85__default.Fragment, { children: child }, `${parentId}-${index}`);
48306
47518
  }
48307
47519
  if (!child || typeof child !== "object") return null;
48308
47520
  const childId = `${parentId}-${index}`;
@@ -48342,14 +47554,14 @@ function isPatternConfig(value) {
48342
47554
  if (value === null || value === void 0) return false;
48343
47555
  if (typeof value !== "object") return false;
48344
47556
  if (Array.isArray(value)) return false;
48345
- if (React89__default.isValidElement(value)) return false;
47557
+ if (React85__default.isValidElement(value)) return false;
48346
47558
  if (value instanceof Date) return false;
48347
47559
  if (typeof value === "function") return false;
48348
47560
  const record = value;
48349
47561
  return "type" in record && typeof record.type === "string";
48350
47562
  }
48351
47563
  function isPlainConfigObject(value) {
48352
- if (React89__default.isValidElement(value)) return false;
47564
+ if (React85__default.isValidElement(value)) return false;
48353
47565
  if (value instanceof Date) return false;
48354
47566
  const proto = Object.getPrototypeOf(value);
48355
47567
  return proto === Object.prototype || proto === null;