@ai-matrx/design-system 0.18.3 → 0.18.4

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 (50) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +22 -0
  3. package/dist/content-transfer.cjs +8 -2
  4. package/dist/content-transfer.cjs.map +1 -1
  5. package/dist/content-transfer.d.cts +2 -0
  6. package/dist/content-transfer.d.ts +2 -0
  7. package/dist/content-transfer.js +8 -2
  8. package/dist/content-transfer.js.map +1 -1
  9. package/dist/data-table/copy-helpers.d.cts +1 -1
  10. package/dist/data-table/copy-helpers.d.ts +1 -1
  11. package/dist/data-table/data-row-inspector.cjs +8 -2
  12. package/dist/data-table/data-row-inspector.cjs.map +1 -1
  13. package/dist/data-table/data-row-inspector.js +8 -2
  14. package/dist/data-table/data-row-inspector.js.map +1 -1
  15. package/dist/data-table/data-row-window.cjs +8 -2
  16. package/dist/data-table/data-row-window.cjs.map +1 -1
  17. package/dist/data-table/data-row-window.js +8 -2
  18. package/dist/data-table/data-row-window.js.map +1 -1
  19. package/dist/data-table/filter-engine.d.cts +1 -1
  20. package/dist/data-table/filter-engine.d.ts +1 -1
  21. package/dist/data-table/index.cjs +1041 -930
  22. package/dist/data-table/index.cjs.map +1 -1
  23. package/dist/data-table/index.d.cts +23 -3
  24. package/dist/data-table/index.d.ts +23 -3
  25. package/dist/data-table/index.js +1041 -930
  26. package/dist/data-table/index.js.map +1 -1
  27. package/dist/data-table/infer-filter.d.cts +1 -1
  28. package/dist/data-table/infer-filter.d.ts +1 -1
  29. package/dist/data-table/layered-filters.d.cts +1 -1
  30. package/dist/data-table/layered-filters.d.ts +1 -1
  31. package/dist/data-table/pagination.cjs +2 -2
  32. package/dist/data-table/pagination.cjs.map +1 -1
  33. package/dist/data-table/pagination.js +2 -2
  34. package/dist/data-table/pagination.js.map +1 -1
  35. package/dist/data-table/query-control.d.cts +1 -1
  36. package/dist/data-table/query-control.d.ts +1 -1
  37. package/dist/data-table/types.cjs.map +1 -1
  38. package/dist/data-table/types.d.cts +1 -1
  39. package/dist/data-table/types.d.ts +1 -1
  40. package/dist/data-table/url-state.d.cts +1 -1
  41. package/dist/data-table/url-state.d.ts +1 -1
  42. package/dist/data-table/xlsx.d.cts +1 -1
  43. package/dist/data-table/xlsx.d.ts +1 -1
  44. package/dist/index.cjs +2 -2
  45. package/dist/index.cjs.map +1 -1
  46. package/dist/index.js +2 -2
  47. package/dist/index.js.map +1 -1
  48. package/dist/{types-CD4xGL5Z.d.cts → types-Bx9SfdJM.d.cts} +2 -0
  49. package/dist/{types-BhSkeZQ_.d.ts → types-DyByb6tW.d.ts} +2 -0
  50. package/package.json +1 -1
@@ -1102,7 +1102,7 @@ import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
1102
1102
  var Select = SelectPrimitive.Root;
1103
1103
  var SelectValue = SelectPrimitive.Value;
1104
1104
  var selectTriggerVariants = cva2(
1105
- "flex w-full items-center justify-between whitespace-nowrap rounded-md border border-border bg-card text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground transition-colors hover:bg-accent hover:border-accent-foreground/20 focus:outline-none focus:ring-1 focus:ring-primary/30 focus:border-primary/40 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
1105
+ "flex w-full items-center justify-between gap-2 whitespace-nowrap rounded-md border border-border bg-card text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground transition-colors hover:bg-accent hover:border-accent-foreground/20 focus:outline-none focus:ring-1 focus:ring-primary/30 focus:border-primary/40 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:min-w-0 [&>span]:line-clamp-1",
1106
1106
  {
1107
1107
  variants: {
1108
1108
  size: {
@@ -1124,7 +1124,7 @@ var SelectTrigger = React6.forwardRef(({ className, children, hideArrow = false,
1124
1124
  ...props,
1125
1125
  children: [
1126
1126
  children,
1127
- !hideArrow && /* @__PURE__ */ jsx9(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx9(RadixChevronDownIcon, { className: "h-4 w-4 opacity-50" }) })
1127
+ !hideArrow && /* @__PURE__ */ jsx9(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx9(RadixChevronDownIcon, { className: "h-4 w-4 shrink-0 opacity-50" }) })
1128
1128
  ]
1129
1129
  }
1130
1130
  ));
@@ -1255,6 +1255,86 @@ function Skeleton({ className, animated = true, ...props }) {
1255
1255
  );
1256
1256
  }
1257
1257
 
1258
+ // src/data-table/TableTitleRow.tsx
1259
+ import { jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
1260
+ function TableTitleRow({
1261
+ title,
1262
+ headingLevel = 2,
1263
+ context,
1264
+ count,
1265
+ search,
1266
+ actions,
1267
+ children,
1268
+ className
1269
+ }) {
1270
+ const Heading = headingLevel === 1 ? "h1" : "h2";
1271
+ return /* @__PURE__ */ jsxs7(
1272
+ "div",
1273
+ {
1274
+ "data-matrx-table-toolbar": true,
1275
+ className: cn(
1276
+ "flex min-w-0 shrink-0 flex-wrap items-center gap-2",
1277
+ className
1278
+ ),
1279
+ children: [
1280
+ title ? /* @__PURE__ */ jsx11(Heading, { className: "min-w-0 break-words text-sm font-semibold", children: title }) : null,
1281
+ context,
1282
+ count ? /* @__PURE__ */ jsx11(
1283
+ "span",
1284
+ {
1285
+ className: "shrink-0 rounded-md bg-muted px-2 py-0.5 text-xs tabular-nums",
1286
+ "aria-label": `${count.value.toLocaleString()} ${count.label}`,
1287
+ children: count.value.toLocaleString()
1288
+ }
1289
+ ) : null,
1290
+ search ? /* @__PURE__ */ jsx11(
1291
+ "div",
1292
+ {
1293
+ "data-matrx-table-title-search": true,
1294
+ className: "order-last w-full min-w-0 sm:order-none sm:w-auto sm:max-w-md sm:flex-1",
1295
+ children: search
1296
+ }
1297
+ ) : null,
1298
+ children,
1299
+ actions ? /* @__PURE__ */ jsx11(
1300
+ "div",
1301
+ {
1302
+ "data-matrx-table-actions": true,
1303
+ className: "ml-auto flex min-w-0 flex-wrap items-center gap-2",
1304
+ children: actions
1305
+ }
1306
+ ) : null
1307
+ ]
1308
+ }
1309
+ );
1310
+ }
1311
+
1312
+ // src/tooltip.tsx
1313
+ import * as TooltipPrimitive from "@radix-ui/react-tooltip";
1314
+ import * as React7 from "react";
1315
+ import { jsx as jsx12 } from "react/jsx-runtime";
1316
+ var TooltipProvider = TooltipPrimitive.Provider;
1317
+ var Tooltip = TooltipPrimitive.Root;
1318
+ var TooltipTrigger = TooltipPrimitive.Trigger;
1319
+ var TooltipContent = React7.forwardRef(({ className, sideOffset = 4, container, animated = true, ...props }, ref) => {
1320
+ const resolved = usePortalContainer(container);
1321
+ return /* @__PURE__ */ jsx12(TooltipPrimitive.Portal, { container: resolved ?? null, children: /* @__PURE__ */ jsx12(
1322
+ TooltipPrimitive.Content,
1323
+ {
1324
+ ref,
1325
+ "data-slot": "tooltip-content",
1326
+ sideOffset,
1327
+ className: cn(
1328
+ "z-[10001] overflow-hidden rounded-md border border-border bg-popover px-3 py-1.5 text-xs text-popover-foreground shadow-md",
1329
+ animated && MOTION_POPPER,
1330
+ className
1331
+ ),
1332
+ ...props
1333
+ }
1334
+ ) });
1335
+ });
1336
+ TooltipContent.displayName = TooltipPrimitive.Content.displayName;
1337
+
1258
1338
  // src/data-table/useScrollPagination.ts
1259
1339
  import { useEffect, useRef, useState } from "react";
1260
1340
  var DEFAULT_THRESHOLD_PX = 96;
@@ -1466,31 +1546,31 @@ function useScrollPagination({
1466
1546
  import * as DialogPrimitive from "@radix-ui/react-dialog";
1467
1547
  import * as VisuallyHidden from "@radix-ui/react-visually-hidden";
1468
1548
  import { treeContainsComponent as treeContainsComponent2 } from "@ai-matrx/kit/react-tree";
1469
- import * as React9 from "react";
1549
+ import * as React10 from "react";
1470
1550
 
1471
1551
  // src/radix-dialog-modal-context.tsx
1472
- import * as React7 from "react";
1473
- import { jsx as jsx11 } from "react/jsx-runtime";
1552
+ import * as React8 from "react";
1553
+ import { jsx as jsx13 } from "react/jsx-runtime";
1474
1554
  var CONTEXT_SLOT2 = /* @__PURE__ */ Symbol.for("ai-matrx.design-system.dialog-modal-context");
1475
1555
  var contextRegistry2 = globalThis;
1476
- var RadixDialogModalContext = contextRegistry2[CONTEXT_SLOT2] ??= React7.createContext(true);
1556
+ var RadixDialogModalContext = contextRegistry2[CONTEXT_SLOT2] ??= React8.createContext(true);
1477
1557
  function RadixDialogModalProvider({
1478
1558
  children,
1479
1559
  modal
1480
1560
  }) {
1481
- return /* @__PURE__ */ jsx11(RadixDialogModalContext.Provider, { value: modal, children });
1561
+ return /* @__PURE__ */ jsx13(RadixDialogModalContext.Provider, { value: modal, children });
1482
1562
  }
1483
1563
  function useRadixDialogModal() {
1484
- return React7.useContext(RadixDialogModalContext);
1564
+ return React8.useContext(RadixDialogModalContext);
1485
1565
  }
1486
1566
 
1487
1567
  // src/use-is-mobile.ts
1488
- import * as React8 from "react";
1568
+ import * as React9 from "react";
1489
1569
  var MOBILE_BREAKPOINT = 768;
1490
1570
  function useIsMobile() {
1491
- const [isMobile, setIsMobile] = React8.useState(false);
1492
- const [hasMounted, setHasMounted] = React8.useState(false);
1493
- React8.useEffect(() => {
1571
+ const [isMobile, setIsMobile] = React9.useState(false);
1572
+ const [hasMounted, setHasMounted] = React9.useState(false);
1573
+ React9.useEffect(() => {
1494
1574
  setHasMounted(true);
1495
1575
  const onChange = () => {
1496
1576
  setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
@@ -1510,13 +1590,13 @@ function useIsMobile() {
1510
1590
  }
1511
1591
 
1512
1592
  // src/dialog.tsx
1513
- import { jsx as jsx12, jsxs as jsxs7 } from "react/jsx-runtime";
1593
+ import { jsx as jsx14, jsxs as jsxs8 } from "react/jsx-runtime";
1514
1594
  var Dialog = ({
1515
1595
  children,
1516
1596
  ...props
1517
1597
  }) => {
1518
1598
  const modal = props.modal ?? true;
1519
- return /* @__PURE__ */ jsx12(RadixDialogModalProvider, { modal, children: /* @__PURE__ */ jsx12(DialogPrimitive.Root, { ...props, modal, children }) });
1599
+ return /* @__PURE__ */ jsx14(RadixDialogModalProvider, { modal, children: /* @__PURE__ */ jsx14(DialogPrimitive.Root, { ...props, modal, children }) });
1520
1600
  };
1521
1601
  Dialog.displayName = "Dialog";
1522
1602
  var DialogPortal = ({
@@ -1524,13 +1604,13 @@ var DialogPortal = ({
1524
1604
  ...props
1525
1605
  }) => {
1526
1606
  const resolved = usePortalContainer(container);
1527
- return /* @__PURE__ */ jsx12(DialogPrimitive.Portal, { container: resolved ?? null, ...props });
1607
+ return /* @__PURE__ */ jsx14(DialogPrimitive.Portal, { container: resolved ?? null, ...props });
1528
1608
  };
1529
1609
  DialogPortal.displayName = "DialogPortal";
1530
1610
  var CONTEXT_SLOT3 = /* @__PURE__ */ Symbol.for("ai-matrx.design-system.dialog-container-context");
1531
1611
  var contextRegistry3 = globalThis;
1532
- var DialogContainerContext = contextRegistry3[CONTEXT_SLOT3] ??= React9.createContext(null);
1533
- var DialogOverlay = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx12(
1612
+ var DialogContainerContext = contextRegistry3[CONTEXT_SLOT3] ??= React10.createContext(null);
1613
+ var DialogOverlay = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx14(
1534
1614
  DialogPrimitive.Overlay,
1535
1615
  {
1536
1616
  ref,
@@ -1546,9 +1626,9 @@ var DialogOverlay = React9.forwardRef(({ className, ...props }, ref) => /* @__PU
1546
1626
  }
1547
1627
  ));
1548
1628
  DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
1549
- var DialogContentPrimitive = React9.forwardRef((props, ref) => {
1629
+ var DialogContentPrimitive = React10.forwardRef((props, ref) => {
1550
1630
  const isModal = useRadixDialogModal();
1551
- return /* @__PURE__ */ jsx12(
1631
+ return /* @__PURE__ */ jsx14(
1552
1632
  DialogPrimitive.Content,
1553
1633
  {
1554
1634
  ...props,
@@ -1561,7 +1641,7 @@ DialogContentPrimitive.displayName = "DialogContentPrimitive";
1561
1641
  var DIALOG_DESKTOP_CLASSES = "matrx-dialog-card fixed inset-0 z-[10000] m-auto grid h-fit min-w-0 w-full max-w-lg gap-4 max-h-[85dvh] overflow-y-auto overscroll-contain [--dialog-pad:1.5rem] overflow-x-clip border bg-background p-6 shadow-lg [overflow-wrap:anywhere] [&>*]:min-w-0 [&>*]:max-w-full sm:rounded-lg";
1562
1642
  var DIALOG_MOBILE_SHEET_CLASSES = "matrx-mobile-sheet matrx-dialog-card fixed inset-x-0 bottom-0 left-0 right-0 top-auto z-[10000] flex min-w-0 flex-col w-full max-w-full max-h-[90dvh] gap-4 [--dialog-pad:1rem] overflow-x-clip border-t bg-background p-4 pb-safe shadow-lg [overflow-wrap:anywhere] [&>*]:min-w-0 [&>*]:max-w-full rounded-t-2xl rounded-b-none overflow-y-auto overscroll-contain";
1563
1643
  var DIALOG_MOBILE_SHEET_OVERRIDE = "inset-x-0 bottom-0 left-0 right-0 top-auto translate-none w-full max-w-full max-h-[90dvh] rounded-b-none rounded-t-2xl overflow-y-auto";
1564
- var DialogContent = React9.forwardRef(
1644
+ var DialogContent = React10.forwardRef(
1565
1645
  ({
1566
1646
  className,
1567
1647
  children,
@@ -1575,10 +1655,10 @@ var DialogContent = React9.forwardRef(
1575
1655
  const isModal = useRadixDialogModal();
1576
1656
  const injectedContainer = usePortalContainer(container);
1577
1657
  const asSheet = mobileSheet && isMobile;
1578
- const [containerEl, setContainerEl] = React9.useState(
1658
+ const [containerEl, setContainerEl] = React10.useState(
1579
1659
  null
1580
1660
  );
1581
- const mergedRef = React9.useCallback(
1661
+ const mergedRef = React10.useCallback(
1582
1662
  (node) => {
1583
1663
  setContainerEl(node);
1584
1664
  if (typeof ref === "function") ref(node);
@@ -1589,9 +1669,9 @@ var DialogContent = React9.forwardRef(
1589
1669
  );
1590
1670
  const hasTitle = treeContainsComponent2(children, DialogTitle) || treeContainsComponent2(children, DialogPrimitive.Title);
1591
1671
  const hasDescription = treeContainsComponent2(children, DialogDescription) || treeContainsComponent2(children, DialogPrimitive.Description);
1592
- return /* @__PURE__ */ jsxs7(DialogPortal, { container, children: [
1593
- isModal ? /* @__PURE__ */ jsx12(DialogOverlay, {}) : null,
1594
- /* @__PURE__ */ jsxs7(
1672
+ return /* @__PURE__ */ jsxs8(DialogPortal, { container, children: [
1673
+ isModal ? /* @__PURE__ */ jsx14(DialogOverlay, {}) : null,
1674
+ /* @__PURE__ */ jsxs8(
1595
1675
  DialogContentPrimitive,
1596
1676
  {
1597
1677
  ref: mergedRef,
@@ -1610,23 +1690,23 @@ var DialogContent = React9.forwardRef(
1610
1690
  ...hasDescription ? {} : { "aria-describedby": void 0 },
1611
1691
  ...props,
1612
1692
  children: [
1613
- hasTitle ? null : /* @__PURE__ */ jsx12(VisuallyHidden.Root, { children: /* @__PURE__ */ jsx12(DialogPrimitive.Title, { children: "Dialog" }) }),
1614
- /* @__PURE__ */ jsx12(DialogContainerContext.Provider, { value: containerEl, children: /* @__PURE__ */ jsx12(
1693
+ hasTitle ? null : /* @__PURE__ */ jsx14(VisuallyHidden.Root, { children: /* @__PURE__ */ jsx14(DialogPrimitive.Title, { children: "Dialog" }) }),
1694
+ /* @__PURE__ */ jsx14(DialogContainerContext.Provider, { value: containerEl, children: /* @__PURE__ */ jsx14(
1615
1695
  PortalContainerProvider,
1616
1696
  {
1617
1697
  container: containerEl ?? injectedContainer ?? null,
1618
1698
  children
1619
1699
  }
1620
1700
  ) }),
1621
- showCloseButton ? /* @__PURE__ */ jsxs7(
1701
+ showCloseButton ? /* @__PURE__ */ jsxs8(
1622
1702
  DialogPrimitive.Close,
1623
1703
  {
1624
1704
  "data-slot": "dialog-close",
1625
1705
  "aria-label": "Close",
1626
1706
  className: "absolute right-2 top-4 flex h-11 w-11 items-center justify-center rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground sm:right-4 lg:h-10 lg:w-10",
1627
1707
  children: [
1628
- /* @__PURE__ */ jsx12(XIcon, { className: "h-4 w-4" }),
1629
- /* @__PURE__ */ jsx12("span", { className: "sr-only", children: "Close" })
1708
+ /* @__PURE__ */ jsx14(XIcon, { className: "h-4 w-4" }),
1709
+ /* @__PURE__ */ jsx14("span", { className: "sr-only", children: "Close" })
1630
1710
  ]
1631
1711
  }
1632
1712
  ) : null
@@ -1640,7 +1720,7 @@ DialogContent.displayName = DialogPrimitive.Content.displayName;
1640
1720
  var DialogHeader = ({
1641
1721
  className,
1642
1722
  ...props
1643
- }) => /* @__PURE__ */ jsx12(
1723
+ }) => /* @__PURE__ */ jsx14(
1644
1724
  "div",
1645
1725
  {
1646
1726
  "data-slot": "dialog-header",
@@ -1657,7 +1737,7 @@ DialogHeader.displayName = "DialogHeader";
1657
1737
  var DialogFooter = ({
1658
1738
  className,
1659
1739
  ...props
1660
- }) => /* @__PURE__ */ jsx12(
1740
+ }) => /* @__PURE__ */ jsx14(
1661
1741
  "div",
1662
1742
  {
1663
1743
  "data-slot": "dialog-footer",
@@ -1689,7 +1769,7 @@ var DialogFooter = ({
1689
1769
  }
1690
1770
  );
1691
1771
  DialogFooter.displayName = "DialogFooter";
1692
- var DialogTitle = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx12(
1772
+ var DialogTitle = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx14(
1693
1773
  DialogPrimitive.Title,
1694
1774
  {
1695
1775
  ref,
@@ -1699,7 +1779,7 @@ var DialogTitle = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE
1699
1779
  }
1700
1780
  ));
1701
1781
  DialogTitle.displayName = DialogPrimitive.Title.displayName;
1702
- var DialogDescription = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx12(
1782
+ var DialogDescription = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx14(
1703
1783
  DialogPrimitive.Description,
1704
1784
  {
1705
1785
  ref,
@@ -1714,11 +1794,11 @@ DialogDescription.displayName = DialogPrimitive.Description.displayName;
1714
1794
  import * as SheetPrimitive from "@radix-ui/react-dialog";
1715
1795
  import { treeContainsComponent as treeContainsComponent3 } from "@ai-matrx/kit/react-tree";
1716
1796
  import { cva as cva3 } from "class-variance-authority";
1717
- import * as React10 from "react";
1718
- import { jsx as jsx13, jsxs as jsxs8 } from "react/jsx-runtime";
1719
- var SheetContentBase = React10.forwardRef(({ ...props }, ref) => {
1797
+ import * as React11 from "react";
1798
+ import { jsx as jsx15, jsxs as jsxs9 } from "react/jsx-runtime";
1799
+ var SheetContentBase = React11.forwardRef(({ ...props }, ref) => {
1720
1800
  const isModal = useRadixDialogModal();
1721
- return /* @__PURE__ */ jsx13(
1801
+ return /* @__PURE__ */ jsx15(
1722
1802
  SheetPrimitive.Content,
1723
1803
  {
1724
1804
  ...props,
@@ -1728,13 +1808,13 @@ var SheetContentBase = React10.forwardRef(({ ...props }, ref) => {
1728
1808
  );
1729
1809
  });
1730
1810
  SheetContentBase.displayName = "SheetContentBase";
1731
- var Sheet = React10.forwardRef(({ children, ...props }, _ref) => {
1811
+ var Sheet = React11.forwardRef(({ children, ...props }, _ref) => {
1732
1812
  const modal = props.modal ?? true;
1733
- return /* @__PURE__ */ jsx13(RadixDialogModalProvider, { modal, children: /* @__PURE__ */ jsx13(SheetPrimitive.Root, { ...props, modal, children }) });
1813
+ return /* @__PURE__ */ jsx15(RadixDialogModalProvider, { modal, children: /* @__PURE__ */ jsx15(SheetPrimitive.Root, { ...props, modal, children }) });
1734
1814
  });
1735
1815
  Sheet.displayName = "Sheet";
1736
1816
  var SheetPortal = SheetPrimitive.Portal;
1737
- var SheetOverlay = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx13(
1817
+ var SheetOverlay = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx15(
1738
1818
  SheetPrimitive.Overlay,
1739
1819
  {
1740
1820
  className: cn(
@@ -1771,7 +1851,7 @@ var sheetVariants = cva3(
1771
1851
  }
1772
1852
  }
1773
1853
  );
1774
- var SheetDescription = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx13(
1854
+ var SheetDescription = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx15(
1775
1855
  SheetPrimitive.Description,
1776
1856
  {
1777
1857
  ref,
@@ -1780,7 +1860,7 @@ var SheetDescription = React10.forwardRef(({ className, ...props }, ref) => /* @
1780
1860
  }
1781
1861
  ));
1782
1862
  SheetDescription.displayName = SheetPrimitive.Description.displayName;
1783
- var SheetContent = React10.forwardRef(
1863
+ var SheetContent = React11.forwardRef(
1784
1864
  ({
1785
1865
  side = "right",
1786
1866
  className,
@@ -1792,9 +1872,9 @@ var SheetContent = React10.forwardRef(
1792
1872
  ...props
1793
1873
  }, ref) => {
1794
1874
  const hasDescription = treeContainsComponent3(children, SheetDescription) || treeContainsComponent3(children, SheetPrimitive.Description);
1795
- return /* @__PURE__ */ jsxs8(SheetPortal, { children: [
1796
- !hideOverlay && /* @__PURE__ */ jsx13(SheetOverlay, { className: overlayClassName }),
1797
- /* @__PURE__ */ jsxs8(
1875
+ return /* @__PURE__ */ jsxs9(SheetPortal, { children: [
1876
+ !hideOverlay && /* @__PURE__ */ jsx15(SheetOverlay, { className: overlayClassName }),
1877
+ /* @__PURE__ */ jsxs9(
1798
1878
  SheetContentBase,
1799
1879
  {
1800
1880
  ref,
@@ -1806,9 +1886,9 @@ var SheetContent = React10.forwardRef(
1806
1886
  ...hasDescription ? {} : { "aria-describedby": void 0 },
1807
1887
  ...props,
1808
1888
  children: [
1809
- !hideCloseButton && /* @__PURE__ */ jsxs8(SheetPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary", children: [
1810
- /* @__PURE__ */ jsx13(Cross2Icon, { className: "h-4 w-4" }),
1811
- /* @__PURE__ */ jsx13("span", { className: "sr-only", children: "Close" })
1889
+ !hideCloseButton && /* @__PURE__ */ jsxs9(SheetPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary", children: [
1890
+ /* @__PURE__ */ jsx15(Cross2Icon, { className: "h-4 w-4" }),
1891
+ /* @__PURE__ */ jsx15("span", { className: "sr-only", children: "Close" })
1812
1892
  ] }),
1813
1893
  children
1814
1894
  ]
@@ -1821,7 +1901,7 @@ SheetContent.displayName = SheetPrimitive.Content.displayName;
1821
1901
  var SheetHeader = ({
1822
1902
  className,
1823
1903
  ...props
1824
- }) => /* @__PURE__ */ jsx13(
1904
+ }) => /* @__PURE__ */ jsx15(
1825
1905
  "div",
1826
1906
  {
1827
1907
  className: cn(
@@ -1835,7 +1915,7 @@ SheetHeader.displayName = "SheetHeader";
1835
1915
  var SheetFooter = ({
1836
1916
  className,
1837
1917
  ...props
1838
- }) => /* @__PURE__ */ jsx13(
1918
+ }) => /* @__PURE__ */ jsx15(
1839
1919
  "div",
1840
1920
  {
1841
1921
  "data-slot": "sheet-footer",
@@ -1847,7 +1927,7 @@ var SheetFooter = ({
1847
1927
  }
1848
1928
  );
1849
1929
  SheetFooter.displayName = "SheetFooter";
1850
- var SheetTitle = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx13(
1930
+ var SheetTitle = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx15(
1851
1931
  SheetPrimitive.Title,
1852
1932
  {
1853
1933
  ref,
@@ -1858,33 +1938,33 @@ var SheetTitle = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE
1858
1938
  SheetTitle.displayName = SheetPrimitive.Title.displayName;
1859
1939
 
1860
1940
  // src/data-table/default-host.tsx
1861
- import { jsx as jsx14, jsxs as jsxs9 } from "react/jsx-runtime";
1941
+ import { jsx as jsx16, jsxs as jsxs10 } from "react/jsx-runtime";
1862
1942
  function DefaultTableLink(props) {
1863
- return /* @__PURE__ */ jsx14("a", { ...props });
1943
+ return /* @__PURE__ */ jsx16("a", { ...props });
1864
1944
  }
1865
1945
  function DefaultTableSidePanel({ title, titleNode, description, defaultWidth = 480, onClose, headerActions, children }) {
1866
- return /* @__PURE__ */ jsx14(Sheet, { open: true, onOpenChange: (open) => {
1946
+ return /* @__PURE__ */ jsx16(Sheet, { open: true, onOpenChange: (open) => {
1867
1947
  if (!open) onClose();
1868
- }, children: /* @__PURE__ */ jsxs9(SheetContent, { side: "right", className: "flex h-full flex-col", style: { width: `min(${defaultWidth}px, 100vw)` }, children: [
1869
- /* @__PURE__ */ jsxs9(SheetHeader, { children: [
1870
- /* @__PURE__ */ jsx14(SheetTitle, { children: titleNode ?? title }),
1871
- description ? /* @__PURE__ */ jsx14(SheetDescription, { children: description }) : null,
1948
+ }, children: /* @__PURE__ */ jsxs10(SheetContent, { side: "right", className: "flex h-full flex-col", style: { width: `min(${defaultWidth}px, 100vw)` }, children: [
1949
+ /* @__PURE__ */ jsxs10(SheetHeader, { children: [
1950
+ /* @__PURE__ */ jsx16(SheetTitle, { children: titleNode ?? title }),
1951
+ description ? /* @__PURE__ */ jsx16(SheetDescription, { children: description }) : null,
1872
1952
  headerActions
1873
1953
  ] }),
1874
- /* @__PURE__ */ jsx14("div", { className: "min-h-0 flex-1 overflow-auto", children })
1954
+ /* @__PURE__ */ jsx16("div", { className: "min-h-0 flex-1 overflow-auto", children })
1875
1955
  ] }) });
1876
1956
  }
1877
1957
  function DefaultTableWindow({ title, onClose, width = 720, height = 560, actionsRight, sidebar, children }) {
1878
- return /* @__PURE__ */ jsx14(Dialog, { open: true, onOpenChange: (open) => {
1958
+ return /* @__PURE__ */ jsx16(Dialog, { open: true, onOpenChange: (open) => {
1879
1959
  if (!open) onClose();
1880
- }, children: /* @__PURE__ */ jsxs9(DialogContent, { className: "flex flex-col overflow-hidden", style: { width: `min(${width}px, calc(100vw - 2rem))`, height: `min(${height}px, 85dvh)` }, children: [
1881
- /* @__PURE__ */ jsxs9(DialogHeader, { children: [
1882
- /* @__PURE__ */ jsx14(DialogTitle, { children: title }),
1960
+ }, children: /* @__PURE__ */ jsxs10(DialogContent, { className: "flex flex-col overflow-hidden", style: { width: `min(${width}px, calc(100vw - 2rem))`, height: `min(${height}px, 85dvh)` }, children: [
1961
+ /* @__PURE__ */ jsxs10(DialogHeader, { children: [
1962
+ /* @__PURE__ */ jsx16(DialogTitle, { children: title }),
1883
1963
  actionsRight
1884
1964
  ] }),
1885
- /* @__PURE__ */ jsxs9("div", { className: "flex min-h-0 flex-1", children: [
1886
- sidebar ? /* @__PURE__ */ jsx14("aside", { className: "shrink-0 border-r pr-2", children: sidebar }) : null,
1887
- /* @__PURE__ */ jsx14("div", { className: "min-h-0 min-w-0 flex-1 overflow-auto", children })
1965
+ /* @__PURE__ */ jsxs10("div", { className: "flex min-h-0 flex-1", children: [
1966
+ sidebar ? /* @__PURE__ */ jsx16("aside", { className: "shrink-0 border-r pr-2", children: sidebar }) : null,
1967
+ /* @__PURE__ */ jsx16("div", { className: "min-h-0 min-w-0 flex-1 overflow-auto", children })
1888
1968
  ] })
1889
1969
  ] }) });
1890
1970
  }
@@ -1894,19 +1974,19 @@ import { useState as useState4 } from "react";
1894
1974
 
1895
1975
  // src/data-table/host.tsx
1896
1976
  import { createContext as createContext4, useContext as useContext4 } from "react";
1897
- import { jsx as jsx15 } from "react/jsx-runtime";
1977
+ import { jsx as jsx17 } from "react/jsx-runtime";
1898
1978
  var HOST_SLOT = /* @__PURE__ */ Symbol.for("ai-matrx.design-system.table-host-context");
1899
1979
  var hostRegistry = globalThis;
1900
1980
  var HostContext = hostRegistry[HOST_SLOT] ??= createContext4({});
1901
1981
  function MatrxDataTableProvider({ value, children }) {
1902
- return /* @__PURE__ */ jsx15(HostContext.Provider, { value, children });
1982
+ return /* @__PURE__ */ jsx17(HostContext.Provider, { value, children });
1903
1983
  }
1904
1984
  function useMatrxDataTableHost() {
1905
1985
  return useContext4(HostContext);
1906
1986
  }
1907
1987
 
1908
1988
  // src/data-table/useTableNotice.tsx
1909
- import { jsx as jsx16, jsxs as jsxs10 } from "react/jsx-runtime";
1989
+ import { jsx as jsx18, jsxs as jsxs11 } from "react/jsx-runtime";
1910
1990
  function useTableNotice() {
1911
1991
  const host = useMatrxDataTableHost();
1912
1992
  const [message, setMessage] = useState4(null);
@@ -1920,15 +2000,15 @@ function useTableNotice() {
1920
2000
  else setMessage({ text, error: true });
1921
2001
  }
1922
2002
  };
1923
- const notice = message ? /* @__PURE__ */ jsxs10("span", { role: message.error ? "alert" : "status", className: message.error ? "text-xs text-destructive" : "text-xs text-muted-foreground", children: [
2003
+ const notice = message ? /* @__PURE__ */ jsxs11("span", { role: message.error ? "alert" : "status", className: message.error ? "text-xs text-destructive" : "text-xs text-muted-foreground", children: [
1924
2004
  message.text,
1925
- /* @__PURE__ */ jsx16("button", { type: "button", "aria-label": "Dismiss notification", className: "ml-2 underline", onClick: () => setMessage(null), children: "Dismiss" })
2005
+ /* @__PURE__ */ jsx18("button", { type: "button", "aria-label": "Dismiss notification", className: "ml-2 underline", onClick: () => setMessage(null), children: "Dismiss" })
1926
2006
  ] }) : null;
1927
2007
  return { notify, notice };
1928
2008
  }
1929
2009
 
1930
2010
  // src/data-table/pagination.tsx
1931
- import { Fragment, jsx as jsx17, jsxs as jsxs11 } from "react/jsx-runtime";
2011
+ import { Fragment, jsx as jsx19, jsxs as jsxs12 } from "react/jsx-runtime";
1932
2012
  function GenericTablePagination({
1933
2013
  totalItems,
1934
2014
  itemsPerPage,
@@ -1987,8 +2067,8 @@ function GenericTablePagination({
1987
2067
  className,
1988
2068
  containerClassName
1989
2069
  );
1990
- return /* @__PURE__ */ jsxs11("div", { "data-matrx-table-footer": true, className: containerClass, children: [
1991
- showItemsPerPageSelect && /* @__PURE__ */ jsx17(
2070
+ return /* @__PURE__ */ jsxs12("div", { "data-matrx-table-footer": true, className: containerClass, children: [
2071
+ showItemsPerPageSelect && /* @__PURE__ */ jsx19(
1992
2072
  "div",
1993
2073
  {
1994
2074
  className: cn(
@@ -1996,13 +2076,13 @@ function GenericTablePagination({
1996
2076
  !compact && "sm:p-1",
1997
2077
  selectContainerClassName
1998
2078
  ),
1999
- children: /* @__PURE__ */ jsxs11(
2079
+ children: /* @__PURE__ */ jsxs12(
2000
2080
  Select,
2001
2081
  {
2002
2082
  value: itemsPerPage.toString(),
2003
2083
  onValueChange: (value) => onItemsPerPageChange(parseInt(value)),
2004
2084
  children: [
2005
- /* @__PURE__ */ jsx17(
2085
+ /* @__PURE__ */ jsx19(
2006
2086
  SelectTrigger,
2007
2087
  {
2008
2088
  "aria-label": "Rows per page",
@@ -2010,31 +2090,31 @@ function GenericTablePagination({
2010
2090
  "focus:ring-0",
2011
2091
  compact ? "relative isolate h-11 w-14 border-0 bg-transparent px-2 text-xs before:absolute before:inset-x-1 before:inset-y-1.5 before:z-0 before:rounded-md before:border before:border-border before:bg-card before:content-[''] hover:before:bg-accent [&>*]:relative [&>*]:z-10 lg:h-7 lg:min-h-7 lg:w-16 lg:border lg:border-input lg:bg-background lg:px-2 lg:before:hidden" : "h-8 w-[3.75rem] text-xs sm:w-36 sm:text-sm"
2012
2092
  ),
2013
- children: /* @__PURE__ */ jsx17(SelectValue, { placeholder: itemsPerPage.toString() })
2093
+ children: /* @__PURE__ */ jsx19(SelectValue, { placeholder: itemsPerPage.toString() })
2014
2094
  }
2015
2095
  ),
2016
- /* @__PURE__ */ jsxs11(SelectContent, { children: [
2017
- availablePageSizes.map((size) => /* @__PURE__ */ jsx17(SelectItem, { value: size.toString(), children: size }, size)),
2018
- showAllOption ? /* @__PURE__ */ jsx17(SelectItem, { value: allValue.toString(), children: allOptionLabel }) : null
2096
+ /* @__PURE__ */ jsxs12(SelectContent, { children: [
2097
+ availablePageSizes.map((size) => /* @__PURE__ */ jsx19(SelectItem, { value: size.toString(), children: size }, size)),
2098
+ showAllOption ? /* @__PURE__ */ jsx19(SelectItem, { value: allValue.toString(), children: allOptionLabel }) : null
2019
2099
  ] })
2020
2100
  ]
2021
2101
  }
2022
2102
  )
2023
2103
  }
2024
2104
  ),
2025
- /* @__PURE__ */ jsx17(
2105
+ /* @__PURE__ */ jsx19(
2026
2106
  "div",
2027
2107
  {
2028
2108
  className: cn("flex min-w-0 justify-center", infoContainerClassName),
2029
- children: showPageInfo && !hideEntriesInfo && /* @__PURE__ */ jsxs11(Fragment, { children: [
2030
- /* @__PURE__ */ jsxs11("span", { className: "truncate text-[10px] tabular-nums text-muted-foreground sm:hidden", children: [
2109
+ children: showPageInfo && !hideEntriesInfo && /* @__PURE__ */ jsxs12(Fragment, { children: [
2110
+ /* @__PURE__ */ jsxs12("span", { className: "truncate text-[10px] tabular-nums text-muted-foreground sm:hidden", children: [
2031
2111
  startItem,
2032
2112
  "-",
2033
2113
  endItem,
2034
2114
  " / ",
2035
2115
  totalItems
2036
2116
  ] }),
2037
- /* @__PURE__ */ jsx17(
2117
+ /* @__PURE__ */ jsx19(
2038
2118
  "span",
2039
2119
  {
2040
2120
  className: `hidden whitespace-nowrap ${compact ? "text-xs" : "text-sm"} text-muted-foreground sm:inline`,
@@ -2044,7 +2124,7 @@ function GenericTablePagination({
2044
2124
  ] })
2045
2125
  }
2046
2126
  ),
2047
- showPageControls && /* @__PURE__ */ jsxs11(
2127
+ showPageControls && /* @__PURE__ */ jsxs12(
2048
2128
  "div",
2049
2129
  {
2050
2130
  className: cn(
@@ -2053,7 +2133,7 @@ function GenericTablePagination({
2053
2133
  controlsContainerClassName
2054
2134
  ),
2055
2135
  children: [
2056
- /* @__PURE__ */ jsx17(
2136
+ /* @__PURE__ */ jsx19(
2057
2137
  Button,
2058
2138
  {
2059
2139
  variant: "outline",
@@ -2067,10 +2147,10 @@ function GenericTablePagination({
2067
2147
  compact ? compactButtonClass : "h-8 w-8 p-0",
2068
2148
  navButtonClassName
2069
2149
  ),
2070
- children: /* @__PURE__ */ jsx17(ChevronsLeft, { className: compact ? "h-3.5 w-3.5" : "h-4 w-4" })
2150
+ children: /* @__PURE__ */ jsx19(ChevronsLeft, { className: compact ? "h-3.5 w-3.5" : "h-4 w-4" })
2071
2151
  }
2072
2152
  ),
2073
- /* @__PURE__ */ jsx17(
2153
+ /* @__PURE__ */ jsx19(
2074
2154
  Button,
2075
2155
  {
2076
2156
  variant: "outline",
@@ -2083,10 +2163,10 @@ function GenericTablePagination({
2083
2163
  compact ? compactButtonClass : "h-8 w-8 p-0",
2084
2164
  navButtonClassName
2085
2165
  ),
2086
- children: /* @__PURE__ */ jsx17(ChevronLeft, { className: compact ? "h-3.5 w-3.5" : "h-4 w-4" })
2166
+ children: /* @__PURE__ */ jsx19(ChevronLeft, { className: compact ? "h-3.5 w-3.5" : "h-4 w-4" })
2087
2167
  }
2088
2168
  ),
2089
- getPageNumbers(3).map((page) => /* @__PURE__ */ jsx17(
2169
+ getPageNumbers(3).map((page) => /* @__PURE__ */ jsx19(
2090
2170
  Button,
2091
2171
  {
2092
2172
  variant: currentPage === page ? "default" : "outline",
@@ -2101,11 +2181,11 @@ function GenericTablePagination({
2101
2181
  compact && page === currentPage && compactActiveButtonClass,
2102
2182
  page === currentPage ? pageActiveButtonClassName : pageButtonClassName
2103
2183
  ),
2104
- children: /* @__PURE__ */ jsx17("span", { className: "relative z-10", children: page })
2184
+ children: /* @__PURE__ */ jsx19("span", { className: "relative z-10", children: page })
2105
2185
  },
2106
2186
  `mobile-${page}`
2107
2187
  )),
2108
- getPageNumbers().map((page) => /* @__PURE__ */ jsx17(
2188
+ getPageNumbers().map((page) => /* @__PURE__ */ jsx19(
2109
2189
  Button,
2110
2190
  {
2111
2191
  variant: currentPage === page ? "default" : "outline",
@@ -2119,11 +2199,11 @@ function GenericTablePagination({
2119
2199
  compact && page === currentPage && compactActiveButtonClass,
2120
2200
  currentPage === page ? pageActiveButtonClassName : pageButtonClassName
2121
2201
  ),
2122
- children: /* @__PURE__ */ jsx17("span", { className: "relative z-10", children: page })
2202
+ children: /* @__PURE__ */ jsx19("span", { className: "relative z-10", children: page })
2123
2203
  },
2124
2204
  `desktop-${page}`
2125
2205
  )),
2126
- /* @__PURE__ */ jsx17(
2206
+ /* @__PURE__ */ jsx19(
2127
2207
  Button,
2128
2208
  {
2129
2209
  variant: "outline",
@@ -2136,10 +2216,10 @@ function GenericTablePagination({
2136
2216
  compact ? compactButtonClass : "h-8 w-8 p-0",
2137
2217
  navButtonClassName
2138
2218
  ),
2139
- children: /* @__PURE__ */ jsx17(ChevronRight, { className: compact ? "h-3.5 w-3.5" : "h-4 w-4" })
2219
+ children: /* @__PURE__ */ jsx19(ChevronRight, { className: compact ? "h-3.5 w-3.5" : "h-4 w-4" })
2140
2220
  }
2141
2221
  ),
2142
- /* @__PURE__ */ jsx17(
2222
+ /* @__PURE__ */ jsx19(
2143
2223
  Button,
2144
2224
  {
2145
2225
  variant: "outline",
@@ -2153,7 +2233,7 @@ function GenericTablePagination({
2153
2233
  compact ? compactButtonClass : "h-8 w-8 p-0",
2154
2234
  navButtonClassName
2155
2235
  ),
2156
- children: /* @__PURE__ */ jsx17(ChevronsRight, { className: compact ? "h-3.5 w-3.5" : "h-4 w-4" })
2236
+ children: /* @__PURE__ */ jsx19(ChevronsRight, { className: compact ? "h-3.5 w-3.5" : "h-4 w-4" })
2157
2237
  }
2158
2238
  )
2159
2239
  ]
@@ -2163,7 +2243,7 @@ function GenericTablePagination({
2163
2243
  }
2164
2244
 
2165
2245
  // src/content-transfer/matrx-copy.tsx
2166
- import * as React13 from "react";
2246
+ import * as React14 from "react";
2167
2247
  import {
2168
2248
  buildAgentPayload,
2169
2249
  createBrowserTransport as createBrowserTransport2,
@@ -2173,7 +2253,7 @@ import {
2173
2253
  } from "@ai-matrx/kit/content-transfer";
2174
2254
 
2175
2255
  // src/content-transfer/index.tsx
2176
- import * as React12 from "react";
2256
+ import * as React13 from "react";
2177
2257
  import {
2178
2258
  applySectionSelection,
2179
2259
  applyTransferLimits,
@@ -2198,14 +2278,14 @@ import {
2198
2278
 
2199
2279
  // src/dropdown-menu.tsx
2200
2280
  import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
2201
- import * as React11 from "react";
2202
- import { jsx as jsx18, jsxs as jsxs12 } from "react/jsx-runtime";
2281
+ import * as React12 from "react";
2282
+ import { jsx as jsx20, jsxs as jsxs13 } from "react/jsx-runtime";
2203
2283
  var DropdownMenu = DropdownMenuPrimitive.Root;
2204
2284
  var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
2205
2285
  var MENU_SURFACE_CLASS = "z-[10001] min-w-[8rem] max-h-[var(--radix-dropdown-menu-content-available-height)] overflow-y-auto overflow-x-hidden overscroll-contain rounded-md border bg-popover p-1 text-popover-foreground";
2206
2286
  var MENU_ITEM_CLASS = "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50";
2207
2287
  var MENU_INDICATOR_ITEM_CLASS = "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50";
2208
- var DropdownMenuSubTrigger = React11.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs12(
2288
+ var DropdownMenuSubTrigger = React12.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs13(
2209
2289
  DropdownMenuPrimitive.SubTrigger,
2210
2290
  {
2211
2291
  ref,
@@ -2218,12 +2298,12 @@ var DropdownMenuSubTrigger = React11.forwardRef(({ className, inset, children, .
2218
2298
  ...props,
2219
2299
  children: [
2220
2300
  children,
2221
- /* @__PURE__ */ jsx18(RadixChevronRightIcon, { className: "ml-auto h-4 w-4" })
2301
+ /* @__PURE__ */ jsx20(RadixChevronRightIcon, { className: "ml-auto h-4 w-4" })
2222
2302
  ]
2223
2303
  }
2224
2304
  ));
2225
2305
  DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
2226
- var DropdownMenuSubContent = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx18(
2306
+ var DropdownMenuSubContent = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx20(
2227
2307
  DropdownMenuPrimitive.SubContent,
2228
2308
  {
2229
2309
  ref,
@@ -2233,9 +2313,9 @@ var DropdownMenuSubContent = React11.forwardRef(({ className, ...props }, ref) =
2233
2313
  }
2234
2314
  ));
2235
2315
  DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
2236
- var DropdownMenuContent = React11.forwardRef(({ className, sideOffset = 4, container, ...props }, ref) => {
2316
+ var DropdownMenuContent = React12.forwardRef(({ className, sideOffset = 4, container, ...props }, ref) => {
2237
2317
  const portalContainer = usePortalContainer(container);
2238
- return /* @__PURE__ */ jsx18(DropdownMenuPrimitive.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx18(
2318
+ return /* @__PURE__ */ jsx20(DropdownMenuPrimitive.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx20(
2239
2319
  DropdownMenuPrimitive.Content,
2240
2320
  {
2241
2321
  ref,
@@ -2252,7 +2332,7 @@ var DropdownMenuContent = React11.forwardRef(({ className, sideOffset = 4, conta
2252
2332
  ) });
2253
2333
  });
2254
2334
  DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
2255
- var DropdownMenuItem = React11.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx18(
2335
+ var DropdownMenuItem = React12.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx20(
2256
2336
  DropdownMenuPrimitive.Item,
2257
2337
  {
2258
2338
  ref,
@@ -2262,7 +2342,7 @@ var DropdownMenuItem = React11.forwardRef(({ className, inset, ...props }, ref)
2262
2342
  }
2263
2343
  ));
2264
2344
  DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
2265
- var DropdownMenuCheckboxItem = React11.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs12(
2345
+ var DropdownMenuCheckboxItem = React12.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs13(
2266
2346
  DropdownMenuPrimitive.CheckboxItem,
2267
2347
  {
2268
2348
  ref,
@@ -2270,13 +2350,13 @@ var DropdownMenuCheckboxItem = React11.forwardRef(({ className, children, ...pro
2270
2350
  className: cn(MENU_INDICATOR_ITEM_CLASS, className),
2271
2351
  ...props,
2272
2352
  children: [
2273
- /* @__PURE__ */ jsx18("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx18(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx18(CheckIcon, { className: "h-4 w-4" }) }) }),
2353
+ /* @__PURE__ */ jsx20("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx20(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx20(CheckIcon, { className: "h-4 w-4" }) }) }),
2274
2354
  children
2275
2355
  ]
2276
2356
  }
2277
2357
  ));
2278
2358
  DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
2279
- var DropdownMenuRadioItem = React11.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs12(
2359
+ var DropdownMenuRadioItem = React12.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs13(
2280
2360
  DropdownMenuPrimitive.RadioItem,
2281
2361
  {
2282
2362
  ref,
@@ -2284,13 +2364,13 @@ var DropdownMenuRadioItem = React11.forwardRef(({ className, children, ...props
2284
2364
  className: cn(MENU_INDICATOR_ITEM_CLASS, className),
2285
2365
  ...props,
2286
2366
  children: [
2287
- /* @__PURE__ */ jsx18("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx18(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx18(DotFilledIcon, { className: "h-4 w-4 fill-current" }) }) }),
2367
+ /* @__PURE__ */ jsx20("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx20(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx20(DotFilledIcon, { className: "h-4 w-4 fill-current" }) }) }),
2288
2368
  children
2289
2369
  ]
2290
2370
  }
2291
2371
  ));
2292
2372
  DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
2293
- var DropdownMenuLabel = React11.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx18(
2373
+ var DropdownMenuLabel = React12.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx20(
2294
2374
  DropdownMenuPrimitive.Label,
2295
2375
  {
2296
2376
  ref,
@@ -2300,7 +2380,7 @@ var DropdownMenuLabel = React11.forwardRef(({ className, inset, ...props }, ref)
2300
2380
  }
2301
2381
  ));
2302
2382
  DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
2303
- var DropdownMenuSeparator = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx18(
2383
+ var DropdownMenuSeparator = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx20(
2304
2384
  DropdownMenuPrimitive.Separator,
2305
2385
  {
2306
2386
  ref,
@@ -2313,7 +2393,7 @@ DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
2313
2393
  var DropdownMenuShortcut = ({
2314
2394
  className,
2315
2395
  ...props
2316
- }) => /* @__PURE__ */ jsx18(
2396
+ }) => /* @__PURE__ */ jsx20(
2317
2397
  "span",
2318
2398
  {
2319
2399
  "data-slot": "dropdown-menu-shortcut",
@@ -2324,23 +2404,23 @@ var DropdownMenuShortcut = ({
2324
2404
  DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
2325
2405
 
2326
2406
  // src/content-transfer/index.tsx
2327
- import { Fragment as Fragment2, jsx as jsx19, jsxs as jsxs13 } from "react/jsx-runtime";
2407
+ import { Fragment as Fragment2, jsx as jsx21, jsxs as jsxs14 } from "react/jsx-runtime";
2328
2408
  function AlchemyGlyph(props) {
2329
- return /* @__PURE__ */ jsxs13("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", ...props, children: [
2330
- /* @__PURE__ */ jsx19("path", { d: "M4.5 5.5h8v11h-8z" }),
2331
- /* @__PURE__ */ jsx19("path", { d: "M8.5 9.5h8v9h-8z" }),
2332
- /* @__PURE__ */ jsx19("path", { d: "m18.5 3 .65 1.85L21 5.5l-1.85.65L18.5 8l-.65-1.85L16 5.5l1.85-.65z" })
2409
+ return /* @__PURE__ */ jsxs14("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", ...props, children: [
2410
+ /* @__PURE__ */ jsx21("path", { d: "M4.5 5.5h8v11h-8z" }),
2411
+ /* @__PURE__ */ jsx21("path", { d: "M8.5 9.5h8v9h-8z" }),
2412
+ /* @__PURE__ */ jsx21("path", { d: "m18.5 3 .65 1.85L21 5.5l-1.85.65L18.5 8l-.65-1.85L16 5.5l1.85-.65z" })
2333
2413
  ] });
2334
2414
  }
2335
- var CapabilityContext = React12.createContext({});
2336
- var useContentTransferCapabilities = () => React12.useContext(CapabilityContext);
2337
- var SurfaceContext = React12.createContext(null);
2415
+ var CapabilityContext = React13.createContext({});
2416
+ var useContentTransferCapabilities = () => React13.useContext(CapabilityContext);
2417
+ var SurfaceContext = React13.createContext(null);
2338
2418
  function MenuPresentation({ label, hint, icon: Icon3 }) {
2339
- return /* @__PURE__ */ jsxs13(Fragment2, { children: [
2340
- Icon3 ? /* @__PURE__ */ jsx19(Icon3, { className: "matrx-alchemy-menu-icon" }) : null,
2341
- /* @__PURE__ */ jsxs13("span", { children: [
2419
+ return /* @__PURE__ */ jsxs14(Fragment2, { children: [
2420
+ Icon3 ? /* @__PURE__ */ jsx21(Icon3, { className: "matrx-alchemy-menu-icon" }) : null,
2421
+ /* @__PURE__ */ jsxs14("span", { children: [
2342
2422
  label,
2343
- hint ? /* @__PURE__ */ jsx19("small", { className: "matrx-alchemy-menu-hint", children: hint }) : null
2423
+ hint ? /* @__PURE__ */ jsx21("small", { className: "matrx-alchemy-menu-hint", children: hint }) : null
2344
2424
  ] })
2345
2425
  ] });
2346
2426
  }
@@ -2380,10 +2460,10 @@ function snapshotContent(snapshot) {
2380
2460
  return JSON.stringify({ sourceId, label, payload, coverage, unsavedChanges, omissions, sections, limits });
2381
2461
  }
2382
2462
  function useFence() {
2383
- const mounted = React12.useRef(true);
2384
- const nextId = React12.useRef(0);
2385
- const active = React12.useRef(/* @__PURE__ */ new Set());
2386
- React12.useEffect(() => {
2463
+ const mounted = React13.useRef(true);
2464
+ const nextId = React13.useRef(0);
2465
+ const active = React13.useRef(/* @__PURE__ */ new Set());
2466
+ React13.useEffect(() => {
2387
2467
  mounted.current = true;
2388
2468
  return () => {
2389
2469
  mounted.current = false;
@@ -2392,14 +2472,14 @@ function useFence() {
2392
2472
  active.current.clear();
2393
2473
  };
2394
2474
  }, []);
2395
- const begin = React12.useCallback(() => {
2475
+ const begin = React13.useCallback(() => {
2396
2476
  const controller = new AbortController();
2397
2477
  active.current.add(controller);
2398
2478
  return { controller, id: ++nextId.current };
2399
2479
  }, []);
2400
- const finish = React12.useCallback((controller) => active.current.delete(controller), []);
2401
- const valid = React12.useCallback((id, controller) => mounted.current && !controller.signal.aborted && nextId.current === id, []);
2402
- const abortAll = React12.useCallback(() => {
2480
+ const finish = React13.useCallback((controller) => active.current.delete(controller), []);
2481
+ const valid = React13.useCallback((id, controller) => mounted.current && !controller.signal.aborted && nextId.current === id, []);
2482
+ const abortAll = React13.useCallback(() => {
2403
2483
  nextId.current += 1;
2404
2484
  active.current.forEach((c) => c.abort());
2405
2485
  active.current.clear();
@@ -2428,43 +2508,43 @@ async function buildArtifact(draft, format, label) {
2428
2508
  return serialize(draft, format, { spreadsheetSafe: format === "csv" || format === "tsv", filename: `${filenameFor(label)}.${extension}` });
2429
2509
  }
2430
2510
  function ContentTransferMenu(props) {
2431
- const inherited = React12.useContext(CapabilityContext);
2511
+ const inherited = React13.useContext(CapabilityContext);
2432
2512
  const identityKey = props.capabilities?.identityKey ?? inherited.identityKey;
2433
- return /* @__PURE__ */ jsx19(ContentTransferMenuSession, { ...props }, identityKey ?? "anonymous");
2513
+ return /* @__PURE__ */ jsx21(ContentTransferMenuSession, { ...props }, identityKey ?? "anonymous");
2434
2514
  }
2435
2515
  function ContentTransferMenuSession({ source, surface, label, projection, sections, preferences, table, formatSources, variants = EMPTY_VARIANTS, actions = [], capabilities: local, disabled, enabled = true, className, stopPropagation = true, hide = [], controllerRef }) {
2436
- const triggerRef = React12.useRef(null);
2437
- const inherited = React12.useContext(CapabilityContext);
2438
- const nearestSurface = React12.useContext(SurfaceContext);
2516
+ const triggerRef = React13.useRef(null);
2517
+ const inherited = React13.useContext(CapabilityContext);
2518
+ const nearestSurface = React13.useContext(SurfaceContext);
2439
2519
  const fence = useFence();
2440
- const [menuCapture, setMenuCapture] = React12.useState(null);
2441
- const [menuStatus, setMenuStatus] = React12.useState("idle");
2442
- const [workspaces, setWorkspaces] = React12.useState({});
2443
- const [workspaceKey, setWorkspaceKey] = React12.useState(null);
2444
- const [workspaceOpen, setWorkspaceOpen] = React12.useState(false);
2445
- const workspaceCaptures = React12.useRef(/* @__PURE__ */ new Map());
2446
- const externalWorkspaceKeys = React12.useRef(/* @__PURE__ */ new Set());
2447
- const [notice, setNotice] = React12.useState(null);
2448
- const scopes = React12.useMemo(() => table?.availableScopes ?? ["target"], [table]);
2520
+ const [menuCapture, setMenuCapture] = React13.useState(null);
2521
+ const [menuStatus, setMenuStatus] = React13.useState("idle");
2522
+ const [workspaces, setWorkspaces] = React13.useState({});
2523
+ const [workspaceKey, setWorkspaceKey] = React13.useState(null);
2524
+ const [workspaceOpen, setWorkspaceOpen] = React13.useState(false);
2525
+ const workspaceCaptures = React13.useRef(/* @__PURE__ */ new Map());
2526
+ const externalWorkspaceKeys = React13.useRef(/* @__PURE__ */ new Set());
2527
+ const [notice, setNotice] = React13.useState(null);
2528
+ const scopes = React13.useMemo(() => table?.availableScopes ?? ["target"], [table]);
2449
2529
  const initialScope = table?.initialScope ?? "target";
2450
2530
  if (!scopes.includes(initialScope)) throw new Error("Alchemy initialScope must be included in availableScopes.");
2451
2531
  const primary = surface ?? source ?? nearestSurface;
2452
2532
  const sourceLabel = label ?? (surface?.surfaceName ?? (source && "label" in source ? source.label : nearestSurface?.surfaceName) ?? "content");
2453
2533
  const primaryWorkspaceKey = `primary:${materialIdentity(primary)}`;
2454
2534
  const nearestWorkspaceKey = source && !surface && nearestSurface ? `surface:${materialIdentity(nearestSurface)}` : null;
2455
- const variantWorkspaceKeys = React12.useMemo(() => new Map(variants.map((variant) => [variant.id, `variant:${variant.id}:${materialIdentity(variant.source)}`])), [variants]);
2535
+ const variantWorkspaceKeys = React13.useMemo(() => new Map(variants.map((variant) => [variant.id, `variant:${variant.id}:${materialIdentity(variant.source)}`])), [variants]);
2456
2536
  const transport = local?.transport ?? inherited.transport ?? createBrowserTransport();
2457
2537
  const ai = local?.ai ?? inherited.ai;
2458
- const providerPreferences = React12.useMemo(() => resolveTransferPreferences(inherited.preferences, local?.preferences), [inherited.preferences, local?.preferences]);
2459
- const adapters = React12.useMemo(() => resolveTransferRegistry(BUILT_INS, inherited.formats ?? [], local?.formats ?? []).filter((x) => "build" in x), [inherited.formats, local?.formats]);
2460
- const registeredActions = React12.useMemo(() => resolveTransferRegistry(inherited.actions ?? [], local?.actions ?? [], actions), [actions, inherited.actions, local?.actions]);
2461
- React12.useMemo(() => resolveTransferRegistry(variants), [variants]);
2462
- const report = React12.useCallback((result) => {
2538
+ const providerPreferences = React13.useMemo(() => resolveTransferPreferences(inherited.preferences, local?.preferences), [inherited.preferences, local?.preferences]);
2539
+ const adapters = React13.useMemo(() => resolveTransferRegistry(BUILT_INS, inherited.formats ?? [], local?.formats ?? []).filter((x) => "build" in x), [inherited.formats, local?.formats]);
2540
+ const registeredActions = React13.useMemo(() => resolveTransferRegistry(inherited.actions ?? [], local?.actions ?? [], actions), [actions, inherited.actions, local?.actions]);
2541
+ React13.useMemo(() => resolveTransferRegistry(variants), [variants]);
2542
+ const report = React13.useCallback((result) => {
2463
2543
  inherited.onOutcome?.(result);
2464
2544
  local?.onOutcome?.(result);
2465
2545
  setNotice(outcomeMessage(result));
2466
2546
  }, [inherited, local]);
2467
- React12.useEffect(() => {
2547
+ React13.useEffect(() => {
2468
2548
  const valid = /* @__PURE__ */ new Set([primaryWorkspaceKey, ...nearestWorkspaceKey ? [nearestWorkspaceKey] : [], ...variantWorkspaceKeys.values(), ...externalWorkspaceKeys.current]);
2469
2549
  setWorkspaces((current) => Object.fromEntries(Object.entries(current).filter(([key]) => valid.has(key))));
2470
2550
  for (const key of workspaceCaptures.current.keys()) if (!valid.has(key)) workspaceCaptures.current.delete(key);
@@ -2473,7 +2553,7 @@ function ContentTransferMenuSession({ source, surface, label, projection, sectio
2473
2553
  setWorkspaceOpen(false);
2474
2554
  }
2475
2555
  }, [nearestWorkspaceKey, primaryWorkspaceKey, variantWorkspaceKeys, workspaceKey]);
2476
- const captureOne = React12.useCallback(async (material, scope, signal, applyMenuProjection = false, collectPages = true) => {
2556
+ const captureOne = React13.useCallback(async (material, scope, signal, applyMenuProjection = false, collectPages = true) => {
2477
2557
  if (!material) throw new Error("Alchemy needs a source or a mounted transfer surface.");
2478
2558
  let sourceMaterial;
2479
2559
  if ("instanceId" in material) {
@@ -2507,14 +2587,14 @@ function ContentTransferMenuSession({ source, surface, label, projection, sectio
2507
2587
  if (result.snapshot.payload.kind !== "rows") throw new Error("All-matching export requires tabular content.");
2508
2588
  return { snapshot: projectSnapshot({ ...result.snapshot, payload: { kind: "rows", rows: collected.rows, columns: result.snapshot.payload.columns }, coverage: collected.coverage, omissions: [...collected.omissions] }, { rules: [] }), allMatching: result.allMatching, ...collected.error ? { collectionError: collected.error.message } : {} };
2509
2589
  }, [preferences, projection, providerPreferences, sections, sourceLabel]);
2510
- const capturePrimary = React12.useCallback((scope, signal) => captureOne(primary, scope, signal, true), [captureOne, primary]);
2590
+ const capturePrimary = React13.useCallback((scope, signal) => captureOne(primary, scope, signal, true), [captureOne, primary]);
2511
2591
  workspaceCaptures.current.set(primaryWorkspaceKey, capturePrimary);
2512
2592
  if (nearestWorkspaceKey && nearestSurface) workspaceCaptures.current.set(nearestWorkspaceKey, (scope, signal) => captureOne(nearestSurface, scope, signal, true));
2513
2593
  for (const variant of variants) {
2514
2594
  const key = variantWorkspaceKeys.get(variant.id);
2515
2595
  workspaceCaptures.current.set(key, (scope, signal) => captureOne(variant.source, scope, signal, true));
2516
2596
  }
2517
- const preflight = React12.useCallback(async () => {
2597
+ const preflight = React13.useCallback(async () => {
2518
2598
  const { controller, id } = fence.begin();
2519
2599
  setMenuCapture(null);
2520
2600
  setMenuStatus("loading");
@@ -2533,7 +2613,7 @@ function ContentTransferMenuSession({ source, surface, label, projection, sectio
2533
2613
  fence.finish(controller);
2534
2614
  }
2535
2615
  }, [captureOne, fence, initialScope, primary]);
2536
- const transfer = React12.useCallback(async (format, download, alternate) => {
2616
+ const transfer = React13.useCallback(async (format, download, alternate) => {
2537
2617
  const { controller, id } = fence.begin();
2538
2618
  try {
2539
2619
  const explicit = alternate?.source ?? (typeof format === "string" && format !== "xlsx" ? formatSources?.[format] : void 0);
@@ -2558,7 +2638,7 @@ function ContentTransferMenuSession({ source, surface, label, projection, sectio
2558
2638
  fence.finish(controller);
2559
2639
  }
2560
2640
  }, [captureOne, capturePrimary, fence, formatSources, initialScope, preferences, providerPreferences, report, transport]);
2561
- const openWorkspace = React12.useCallback(
2641
+ const openWorkspace = React13.useCallback(
2562
2642
  async (key = primaryWorkspaceKey, variant) => {
2563
2643
  const variantMaterial = variant && "kind" in variant.source ? {
2564
2644
  id: `variant:${key}`,
@@ -2669,7 +2749,7 @@ function ContentTransferMenuSession({ source, surface, label, projection, sectio
2669
2749
  workspaces
2670
2750
  ]
2671
2751
  );
2672
- React12.useImperativeHandle(controllerRef, () => ({
2752
+ React13.useImperativeHandle(controllerRef, () => ({
2673
2753
  focusTrigger: () => triggerRef.current?.focus(),
2674
2754
  prepare: async (requestedSource, options) => {
2675
2755
  const requestedLabel = options?.label ?? ("label" in requestedSource ? requestedSource.label : "content");
@@ -2678,7 +2758,7 @@ function ContentTransferMenuSession({ source, surface, label, projection, sectio
2678
2758
  await openWorkspace(requestedKey, { source: requestedSource, label: requestedLabel });
2679
2759
  }
2680
2760
  }), [openWorkspace]);
2681
- const runAction = React12.useCallback(async (action) => {
2761
+ const runAction = React13.useCallback(async (action) => {
2682
2762
  const { controller, id } = fence.begin();
2683
2763
  try {
2684
2764
  const actionSource = action.source;
@@ -2696,52 +2776,52 @@ function ContentTransferMenuSession({ source, surface, label, projection, sectio
2696
2776
  }, [captureOne, capturePrimary, fence, initialScope, preferences, providerPreferences, report]);
2697
2777
  if (!enabled) return null;
2698
2778
  const payload = menuCapture?.snapshot.payload ?? (source && "kind" in source ? source : void 0);
2699
- const quickVariants = (section) => variants.filter((v) => v.copyLabel && (v.section ?? "ai") === section).map((v) => /* @__PURE__ */ jsx19(DropdownMenuItem, { "aria-label": v.ariaLabel, onSelect: () => void transfer("markdown", false, v), children: /* @__PURE__ */ jsx19(MenuPresentation, { ...v, label: v.copyLabel }) }, `copy:${v.id}`));
2779
+ const quickVariants = (section) => variants.filter((v) => v.copyLabel && (v.section ?? "ai") === section).map((v) => /* @__PURE__ */ jsx21(DropdownMenuItem, { "aria-label": v.ariaLabel, onSelect: () => void transfer("markdown", false, v), children: /* @__PURE__ */ jsx21(MenuPresentation, { ...v, label: v.copyLabel }) }, `copy:${v.id}`));
2700
2780
  const visibleCopies = COPIES.filter((f) => Boolean(formatSources?.[f]) || !["csv", "tsv"].includes(f) || payload?.kind === "rows");
2701
2781
  const visibleDownloads = DOWNLOADS.filter((f) => f !== "xlsx" && Boolean(formatSources?.[f]) || !["csv", "tsv", "xlsx"].includes(f) || payload?.kind === "rows");
2702
2782
  const visibleAdapters = menuCapture ? adapters.filter((a) => a.supports(menuCapture.snapshot.payload)) : [];
2703
2783
  const visibleActions = menuCapture ? registeredActions.filter((a) => a.supports(menuCapture.snapshot)) : [];
2704
- return /* @__PURE__ */ jsxs13("span", { className: cn("matrx-alchemy", className), onClick: stopPropagation ? (event) => event.stopPropagation() : void 0, children: [
2705
- /* @__PURE__ */ jsxs13(DropdownMenu, { onOpenChange: (open) => {
2784
+ return /* @__PURE__ */ jsxs14("span", { className: cn("matrx-alchemy", className), onClick: stopPropagation ? (event) => event.stopPropagation() : void 0, children: [
2785
+ /* @__PURE__ */ jsxs14(DropdownMenu, { onOpenChange: (open) => {
2706
2786
  if (open) void preflight();
2707
2787
  }, children: [
2708
- /* @__PURE__ */ jsx19(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx19("button", { ref: triggerRef, type: "button", className: "matrx-alchemy-trigger", disabled, "aria-label": `Copy, transform or export ${sourceLabel}`, title: "Alchemy \u2014 copy, transform, export", children: /* @__PURE__ */ jsx19(AlchemyGlyph, {}) }) }),
2709
- /* @__PURE__ */ jsxs13(DropdownMenuContent, { align: "end", className: "matrx-alchemy-menu", children: [
2710
- menuStatus === "loading" ? /* @__PURE__ */ jsx19(DropdownMenuItem, { disabled: true, children: "Inspecting content\u2026" }) : menuStatus !== "idle" ? /* @__PURE__ */ jsx19(DropdownMenuItem, { disabled: true, children: menuStatus }) : null,
2711
- !hide.includes("copy") ? /* @__PURE__ */ jsxs13(Fragment2, { children: [
2712
- /* @__PURE__ */ jsx19(DropdownMenuLabel, { children: "Copy" }),
2788
+ /* @__PURE__ */ jsx21(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx21("button", { ref: triggerRef, type: "button", className: "matrx-alchemy-trigger", disabled, "aria-label": `Copy, transform or export ${sourceLabel}`, title: "Alchemy \u2014 copy, transform, export", children: /* @__PURE__ */ jsx21(AlchemyGlyph, {}) }) }),
2789
+ /* @__PURE__ */ jsxs14(DropdownMenuContent, { align: "end", className: "matrx-alchemy-menu", children: [
2790
+ menuStatus === "loading" ? /* @__PURE__ */ jsx21(DropdownMenuItem, { disabled: true, children: "Inspecting content\u2026" }) : menuStatus !== "idle" ? /* @__PURE__ */ jsx21(DropdownMenuItem, { disabled: true, children: menuStatus }) : null,
2791
+ !hide.includes("copy") ? /* @__PURE__ */ jsxs14(Fragment2, { children: [
2792
+ /* @__PURE__ */ jsx21(DropdownMenuLabel, { children: "Copy" }),
2713
2793
  quickVariants("copy"),
2714
- visibleCopies.map((format) => /* @__PURE__ */ jsx19(DropdownMenuItem, { onSelect: () => void transfer(format, false), children: format === "plain" ? "Copy" : `Copy ${LABEL[format]}` }, format)),
2715
- visibleAdapters.map((adapter) => /* @__PURE__ */ jsxs13(DropdownMenuItem, { onSelect: () => void transfer(adapter, false), children: [
2794
+ visibleCopies.map((format) => /* @__PURE__ */ jsx21(DropdownMenuItem, { onSelect: () => void transfer(format, false), children: format === "plain" ? "Copy" : `Copy ${LABEL[format]}` }, format)),
2795
+ visibleAdapters.map((adapter) => /* @__PURE__ */ jsxs14(DropdownMenuItem, { onSelect: () => void transfer(adapter, false), children: [
2716
2796
  "Copy ",
2717
2797
  adapter.label
2718
2798
  ] }, adapter.id))
2719
2799
  ] }) : null,
2720
- !hide.includes("prepare") ? /* @__PURE__ */ jsxs13(Fragment2, { children: [
2721
- /* @__PURE__ */ jsx19(DropdownMenuSeparator, {}),
2800
+ !hide.includes("prepare") ? /* @__PURE__ */ jsxs14(Fragment2, { children: [
2801
+ /* @__PURE__ */ jsx21(DropdownMenuSeparator, {}),
2722
2802
  quickVariants("ai"),
2723
- /* @__PURE__ */ jsx19(DropdownMenuItem, { onSelect: () => void openWorkspace(), children: "Prepare for AI\u2026" }),
2724
- nearestWorkspaceKey && nearestSurface ? /* @__PURE__ */ jsx19(DropdownMenuItem, { onSelect: () => void openWorkspace(nearestWorkspaceKey, { source: nearestSurface, label: nearestSurface.surfaceName }), children: "Prepare this surface\u2026" }) : null,
2725
- variants.map((variant) => /* @__PURE__ */ jsx19(DropdownMenuItem, { onSelect: () => void openWorkspace(variantWorkspaceKeys.get(variant.id), variant), children: /* @__PURE__ */ jsx19(MenuPresentation, { ...variant, label: `Prepare ${variant.label}\u2026` }) }, variant.id))
2803
+ /* @__PURE__ */ jsx21(DropdownMenuItem, { onSelect: () => void openWorkspace(), children: "Prepare for AI\u2026" }),
2804
+ nearestWorkspaceKey && nearestSurface ? /* @__PURE__ */ jsx21(DropdownMenuItem, { onSelect: () => void openWorkspace(nearestWorkspaceKey, { source: nearestSurface, label: nearestSurface.surfaceName }), children: "Prepare this surface\u2026" }) : null,
2805
+ variants.map((variant) => /* @__PURE__ */ jsx21(DropdownMenuItem, { onSelect: () => void openWorkspace(variantWorkspaceKeys.get(variant.id), variant), children: /* @__PURE__ */ jsx21(MenuPresentation, { ...variant, label: `Prepare ${variant.label}\u2026` }) }, variant.id))
2726
2806
  ] }) : null,
2727
- !hide.includes("download") ? /* @__PURE__ */ jsxs13(Fragment2, { children: [
2728
- /* @__PURE__ */ jsx19(DropdownMenuSeparator, {}),
2729
- /* @__PURE__ */ jsx19(DropdownMenuLabel, { children: "Download" }),
2730
- visibleDownloads.map((format) => /* @__PURE__ */ jsxs13(DropdownMenuItem, { onSelect: () => void transfer(format, true), children: [
2807
+ !hide.includes("download") ? /* @__PURE__ */ jsxs14(Fragment2, { children: [
2808
+ /* @__PURE__ */ jsx21(DropdownMenuSeparator, {}),
2809
+ /* @__PURE__ */ jsx21(DropdownMenuLabel, { children: "Download" }),
2810
+ visibleDownloads.map((format) => /* @__PURE__ */ jsxs14(DropdownMenuItem, { onSelect: () => void transfer(format, true), children: [
2731
2811
  "Download ",
2732
2812
  LABEL[format]
2733
2813
  ] }, format)),
2734
- visibleAdapters.map((adapter) => /* @__PURE__ */ jsxs13(DropdownMenuItem, { onSelect: () => void transfer(adapter, true), children: [
2814
+ visibleAdapters.map((adapter) => /* @__PURE__ */ jsxs14(DropdownMenuItem, { onSelect: () => void transfer(adapter, true), children: [
2735
2815
  "Download ",
2736
2816
  adapter.label
2737
2817
  ] }, `download:${adapter.id}`))
2738
2818
  ] }) : null,
2739
- visibleActions.length ? /* @__PURE__ */ jsx19(DropdownMenuSeparator, {}) : null,
2740
- visibleActions.map((action) => /* @__PURE__ */ jsx19(DropdownMenuItem, { "aria-label": action.ariaLabel, onSelect: () => void runAction(action), children: /* @__PURE__ */ jsx19(MenuPresentation, { ...action, label: action.label }) }, action.id))
2819
+ visibleActions.length ? /* @__PURE__ */ jsx21(DropdownMenuSeparator, {}) : null,
2820
+ visibleActions.map((action) => /* @__PURE__ */ jsx21(DropdownMenuItem, { "aria-label": action.ariaLabel, onSelect: () => void runAction(action), children: /* @__PURE__ */ jsx21(MenuPresentation, { ...action, label: action.label }) }, action.id))
2741
2821
  ] })
2742
2822
  ] }),
2743
- notice ? /* @__PURE__ */ jsx19("span", { className: "matrx-alchemy-notice", role: "status", children: notice }) : null,
2744
- Object.values(workspaces).map((saved) => /* @__PURE__ */ jsx19(PreparationWorkspace, { restoreFocus: () => triggerRef.current?.focus(), open: workspaceOpen && workspaceKey === saved.key, state: saved, scopes, onClose: () => setWorkspaceOpen(false), onChange: (next) => setWorkspaces((current) => ({ ...current, [saved.key]: next })), transport, adapters, captureScope: workspaceCaptures.current.get(saved.key) ?? capturePrimary, ...ai ? { ai } : {}, onOutcome: report }, saved.key))
2823
+ notice ? /* @__PURE__ */ jsx21("span", { className: "matrx-alchemy-notice", role: "status", children: notice }) : null,
2824
+ Object.values(workspaces).map((saved) => /* @__PURE__ */ jsx21(PreparationWorkspace, { restoreFocus: () => triggerRef.current?.focus(), open: workspaceOpen && workspaceKey === saved.key, state: saved, scopes, onClose: () => setWorkspaceOpen(false), onChange: (next) => setWorkspaces((current) => ({ ...current, [saved.key]: next })), transport, adapters, captureScope: workspaceCaptures.current.get(saved.key) ?? capturePrimary, ...ai ? { ai } : {}, onOutcome: report }, saved.key))
2745
2825
  ] });
2746
2826
  }
2747
2827
  function initialControls(state) {
@@ -2795,28 +2875,28 @@ function preview(draft, format) {
2795
2875
  }
2796
2876
  function PreparationWorkspace({ restoreFocus, open, state, scopes, onClose, onChange, transport, ai, adapters, onOutcome, captureScope }) {
2797
2877
  const fence = useFence();
2798
- const latest = React12.useRef(state);
2878
+ const latest = React13.useRef(state);
2799
2879
  latest.current = state;
2800
- const aiSession = React12.useRef(void 0);
2880
+ const aiSession = React13.useRef(void 0);
2801
2881
  if (!aiSession.current && ai) aiSession.current = ai.fork?.() ?? ai;
2802
- const [controls, setControls] = React12.useState(() => initialControls(state));
2803
- const [controlsHistory, setControlsHistory] = React12.useState([]);
2804
- const [pendingControls, setPendingControls] = React12.useState(null);
2882
+ const [controls, setControls] = React13.useState(() => initialControls(state));
2883
+ const [controlsHistory, setControlsHistory] = React13.useState([]);
2884
+ const [pendingControls, setPendingControls] = React13.useState(null);
2805
2885
  const requestedFormat = state.preferences.initialFormat;
2806
- const [format, setFormat] = React12.useState(() => isBuiltInFormat(requestedFormat) ? supportsBuiltIn(requestedFormat, state.draft.payload) ? requestedFormat : "plain" : adapters.some((adapter) => adapter.id === requestedFormat && adapter.supports(state.draft.payload)) ? requestedFormat : "plain");
2807
- const [buffer, setBuffer] = React12.useState(() => isBuiltInFormat(format) ? preview(state.draft, format) : "Preparing format preview\u2026");
2808
- const [bufferError, setBufferError] = React12.useState(null);
2809
- const [formatError, setFormatError] = React12.useState(null);
2810
- const [preparedArtifact, setPreparedArtifact] = React12.useState(null);
2811
- const [instruction, setInstruction] = React12.useState("");
2812
- const [busy, setBusy] = React12.useState(null);
2813
- const [aiFailed, setAiFailed] = React12.useState(false);
2814
- React12.useEffect(() => {
2886
+ const [format, setFormat] = React13.useState(() => isBuiltInFormat(requestedFormat) ? supportsBuiltIn(requestedFormat, state.draft.payload) ? requestedFormat : "plain" : adapters.some((adapter) => adapter.id === requestedFormat && adapter.supports(state.draft.payload)) ? requestedFormat : "plain");
2887
+ const [buffer, setBuffer] = React13.useState(() => isBuiltInFormat(format) ? preview(state.draft, format) : "Preparing format preview\u2026");
2888
+ const [bufferError, setBufferError] = React13.useState(null);
2889
+ const [formatError, setFormatError] = React13.useState(null);
2890
+ const [preparedArtifact, setPreparedArtifact] = React13.useState(null);
2891
+ const [instruction, setInstruction] = React13.useState("");
2892
+ const [busy, setBusy] = React13.useState(null);
2893
+ const [aiFailed, setAiFailed] = React13.useState(false);
2894
+ React13.useEffect(() => {
2815
2895
  setAiFailed(false);
2816
2896
  }, [state.snapshot.id, state.draft.revision]);
2817
- const activeAi = React12.useRef(null);
2818
- const activeCapture = React12.useRef(null);
2819
- React12.useEffect(() => {
2897
+ const activeAi = React13.useRef(null);
2898
+ const activeCapture = React13.useRef(null);
2899
+ React13.useEffect(() => {
2820
2900
  if (bufferError) return;
2821
2901
  const adapter = adapters.find((candidate) => candidate.id === format);
2822
2902
  const controller = new AbortController();
@@ -2836,7 +2916,7 @@ function PreparationWorkspace({ restoreFocus, open, state, scopes, onClose, onCh
2836
2916
  });
2837
2917
  return () => controller.abort();
2838
2918
  }, [adapters, bufferError, format, state.draft, state.snapshot.id]);
2839
- const close = React12.useCallback(() => {
2919
+ const close = React13.useCallback(() => {
2840
2920
  activeAi.current?.abort();
2841
2921
  activeCapture.current?.abort();
2842
2922
  activeAi.current = null;
@@ -2965,8 +3045,8 @@ function PreparationWorkspace({ restoreFocus, open, state, scopes, onClose, onCh
2965
3045
  if (fence.valid(id, controller)) setBusy(null);
2966
3046
  }
2967
3047
  };
2968
- const [deliveryNotice, setDeliveryNotice] = React12.useState(null);
2969
- React12.useEffect(() => {
3048
+ const [deliveryNotice, setDeliveryNotice] = React13.useState(null);
3049
+ React13.useEffect(() => {
2970
3050
  setDeliveryNotice(null);
2971
3051
  }, [state.draft.revision]);
2972
3052
  const reportDelivery = (outcome) => {
@@ -2998,40 +3078,40 @@ function PreparationWorkspace({ restoreFocus, open, state, scopes, onClose, onCh
2998
3078
  const workspaceAdapters = adapters.filter((adapter) => adapter.supports(state.draft.payload));
2999
3079
  const displayedOmissions = preparedArtifact?.omissions ?? state.draft.omissions;
3000
3080
  const limitText = Object.entries(state.preferences.limits).filter(([, value]) => value != null).map(([key, value]) => `${key.replace(/^max/, "max ")} ${Number(value).toLocaleString()}`).join(" \xB7 ");
3001
- return /* @__PURE__ */ jsx19(Dialog, { open, onOpenChange: (next) => {
3081
+ return /* @__PURE__ */ jsx21(Dialog, { open, onOpenChange: (next) => {
3002
3082
  if (!next) close();
3003
- }, children: /* @__PURE__ */ jsxs13(DialogContent, { onCloseAutoFocus: (event) => {
3083
+ }, children: /* @__PURE__ */ jsxs14(DialogContent, { onCloseAutoFocus: (event) => {
3004
3084
  event.preventDefault();
3005
3085
  restoreFocus();
3006
3086
  }, className: "matrx-alchemy-workspace max-w-5xl", "aria-busy": busy !== null, children: [
3007
- /* @__PURE__ */ jsxs13(DialogHeader, { children: [
3008
- /* @__PURE__ */ jsxs13(DialogTitle, { children: [
3087
+ /* @__PURE__ */ jsxs14(DialogHeader, { children: [
3088
+ /* @__PURE__ */ jsxs14(DialogTitle, { children: [
3009
3089
  "Prepare ",
3010
3090
  state.snapshot.label
3011
3091
  ] }),
3012
- /* @__PURE__ */ jsxs13(DialogDescription, { children: [
3092
+ /* @__PURE__ */ jsxs14(DialogDescription, { children: [
3013
3093
  "Captured ",
3014
3094
  state.snapshot.unsavedChanges ? "from your unsaved draft" : "as an immutable snapshot",
3015
3095
  ". Your source is never edited."
3016
3096
  ] })
3017
3097
  ] }),
3018
- /* @__PURE__ */ jsxs13("div", { className: "matrx-alchemy-workspace-grid", children: [
3019
- /* @__PURE__ */ jsxs13("section", { className: "matrx-alchemy-main", children: [
3020
- /* @__PURE__ */ jsxs13("div", { className: "matrx-alchemy-toolbar", children: [
3021
- scopes.length > 1 ? /* @__PURE__ */ jsxs13("label", { children: [
3098
+ /* @__PURE__ */ jsxs14("div", { className: "matrx-alchemy-workspace-grid", children: [
3099
+ /* @__PURE__ */ jsxs14("section", { className: "matrx-alchemy-main", children: [
3100
+ /* @__PURE__ */ jsxs14("div", { className: "matrx-alchemy-toolbar", children: [
3101
+ scopes.length > 1 ? /* @__PURE__ */ jsxs14("label", { children: [
3022
3102
  "Scope",
3023
- /* @__PURE__ */ jsx19("select", { "aria-label": "Transfer scope", value: state.scope, disabled: busy !== null, onChange: (e) => void requestCapture(e.target.value), children: scopes.map((scope) => /* @__PURE__ */ jsx19("option", { value: scope, children: SCOPE_LABEL[scope] }, scope)) })
3103
+ /* @__PURE__ */ jsx21("select", { "aria-label": "Transfer scope", value: state.scope, disabled: busy !== null, onChange: (e) => void requestCapture(e.target.value), children: scopes.map((scope) => /* @__PURE__ */ jsx21("option", { value: scope, children: SCOPE_LABEL[scope] }, scope)) })
3024
3104
  ] }) : null,
3025
- /* @__PURE__ */ jsxs13("label", { children: [
3105
+ /* @__PURE__ */ jsxs14("label", { children: [
3026
3106
  "Detail",
3027
- /* @__PURE__ */ jsxs13("select", { "aria-label": "Detail preset", value: controls.preset, onChange: (e) => changeControls({ ...controls, preset: e.target.value }), children: [
3028
- /* @__PURE__ */ jsx19("option", { value: "full", children: "Full" }),
3029
- /* @__PURE__ */ jsx19("option", { value: "compact", children: "Compact" }),
3030
- /* @__PURE__ */ jsx19("option", { value: "brief", children: "Brief" }),
3031
- /* @__PURE__ */ jsx19("option", { value: "custom", children: "Custom" })
3107
+ /* @__PURE__ */ jsxs14("select", { "aria-label": "Detail preset", value: controls.preset, onChange: (e) => changeControls({ ...controls, preset: e.target.value }), children: [
3108
+ /* @__PURE__ */ jsx21("option", { value: "full", children: "Full" }),
3109
+ /* @__PURE__ */ jsx21("option", { value: "compact", children: "Compact" }),
3110
+ /* @__PURE__ */ jsx21("option", { value: "brief", children: "Brief" }),
3111
+ /* @__PURE__ */ jsx21("option", { value: "custom", children: "Custom" })
3032
3112
  ] })
3033
3113
  ] }),
3034
- /* @__PURE__ */ jsx19(Button, { type: "button", size: "sm", variant: "outline", disabled: !state.draft.history?.length && !controlsHistory.length || busy !== null, onClick: () => {
3114
+ /* @__PURE__ */ jsx21(Button, { type: "button", size: "sm", variant: "outline", disabled: !state.draft.history?.length && !controlsHistory.length || busy !== null, onClick: () => {
3035
3115
  setBufferError(null);
3036
3116
  if (controlsHistory.length) {
3037
3117
  const next = controlsHistory[controlsHistory.length - 1];
@@ -3040,7 +3120,7 @@ function PreparationWorkspace({ restoreFocus, open, state, scopes, onClose, onCh
3040
3120
  onChange({ ...state, draft: rebuild(state, next), error: void 0 });
3041
3121
  } else onChange({ ...state, draft: undoDraft(state.draft), error: void 0 });
3042
3122
  }, children: "Undo" }),
3043
- /* @__PURE__ */ jsx19(Button, { type: "button", size: "sm", variant: "outline", disabled: busy !== null, onClick: () => {
3123
+ /* @__PURE__ */ jsx21(Button, { type: "button", size: "sm", variant: "outline", disabled: busy !== null, onClick: () => {
3044
3124
  const next = initialControls(state);
3045
3125
  setControls(next);
3046
3126
  setControlsHistory([]);
@@ -3048,43 +3128,43 @@ function PreparationWorkspace({ restoreFocus, open, state, scopes, onClose, onCh
3048
3128
  setBufferError(null);
3049
3129
  onChange({ ...state, draft: rebuild(state, next), error: void 0 });
3050
3130
  }, children: "Reset" }),
3051
- /* @__PURE__ */ jsx19(Button, { type: "button", size: "sm", variant: "outline", disabled: busy !== null, onClick: () => void requestCapture(state.scope), children: "Refresh source" })
3131
+ /* @__PURE__ */ jsx21(Button, { type: "button", size: "sm", variant: "outline", disabled: busy !== null, onClick: () => void requestCapture(state.scope), children: "Refresh source" })
3052
3132
  ] }),
3053
- controls.preset === "custom" && (state.draft.payload.kind === "json" || state.draft.payload.kind === "registered") ? /* @__PURE__ */ jsxs13("fieldset", { className: "matrx-alchemy-options", children: [
3054
- /* @__PURE__ */ jsx19("legend", { children: "JSON limits" }),
3055
- [["maxDepth", "Maximum depth"], ["maxStringChars", "Maximum string characters"], ["maxArrayItems", "Maximum array items"]].map(([key, text]) => /* @__PURE__ */ jsxs13("label", { children: [
3133
+ controls.preset === "custom" && (state.draft.payload.kind === "json" || state.draft.payload.kind === "registered") ? /* @__PURE__ */ jsxs14("fieldset", { className: "matrx-alchemy-options", children: [
3134
+ /* @__PURE__ */ jsx21("legend", { children: "JSON limits" }),
3135
+ [["maxDepth", "Maximum depth"], ["maxStringChars", "Maximum string characters"], ["maxArrayItems", "Maximum array items"]].map(([key, text]) => /* @__PURE__ */ jsxs14("label", { children: [
3056
3136
  text,
3057
- /* @__PURE__ */ jsx19("input", { type: "number", min: "0", value: controls[key] ?? "", onChange: (e) => changeControls({ ...controls, [key]: Number.isNaN(e.target.valueAsNumber) ? null : e.target.valueAsNumber }) })
3137
+ /* @__PURE__ */ jsx21("input", { type: "number", min: "0", value: controls[key] ?? "", onChange: (e) => changeControls({ ...controls, [key]: Number.isNaN(e.target.valueAsNumber) ? null : e.target.valueAsNumber }) })
3058
3138
  ] }, key))
3059
3139
  ] }) : null,
3060
- rows ? /* @__PURE__ */ jsx19(RowControls, { rows, controls, change: changeControls }) : null,
3061
- state.snapshot.sections.length ? /* @__PURE__ */ jsxs13("fieldset", { className: "matrx-alchemy-options", children: [
3062
- /* @__PURE__ */ jsx19("legend", { children: "Sections" }),
3063
- state.snapshot.sections.map((section) => /* @__PURE__ */ jsxs13("label", { children: [
3064
- /* @__PURE__ */ jsx19("input", { type: "checkbox", checked: controls.sections.includes(section.id), onChange: (e) => changeControls({ ...controls, sections: e.target.checked ? [...controls.sections, section.id] : controls.sections.filter((id) => id !== section.id) }) }),
3140
+ rows ? /* @__PURE__ */ jsx21(RowControls, { rows, controls, change: changeControls }) : null,
3141
+ state.snapshot.sections.length ? /* @__PURE__ */ jsxs14("fieldset", { className: "matrx-alchemy-options", children: [
3142
+ /* @__PURE__ */ jsx21("legend", { children: "Sections" }),
3143
+ state.snapshot.sections.map((section) => /* @__PURE__ */ jsxs14("label", { children: [
3144
+ /* @__PURE__ */ jsx21("input", { type: "checkbox", checked: controls.sections.includes(section.id), onChange: (e) => changeControls({ ...controls, sections: e.target.checked ? [...controls.sections, section.id] : controls.sections.filter((id) => id !== section.id) }) }),
3065
3145
  " ",
3066
3146
  section.label
3067
3147
  ] }, section.id))
3068
3148
  ] }) : null,
3069
- /* @__PURE__ */ jsxs13("div", { className: "matrx-alchemy-coverage", children: [
3070
- /* @__PURE__ */ jsxs13("span", { children: [
3149
+ /* @__PURE__ */ jsxs14("div", { className: "matrx-alchemy-coverage", children: [
3150
+ /* @__PURE__ */ jsxs14("span", { children: [
3071
3151
  state.snapshot.coverage.included.toLocaleString(),
3072
3152
  " included",
3073
3153
  state.snapshot.coverage.total == null ? "" : ` of ${state.snapshot.coverage.total.toLocaleString()}`,
3074
3154
  " \xB7 ",
3075
3155
  state.snapshot.coverage.status
3076
3156
  ] }),
3077
- state.snapshot.coverage.reason ? /* @__PURE__ */ jsx19("span", { children: state.snapshot.coverage.reason }) : null,
3078
- limitText ? /* @__PURE__ */ jsxs13("span", { children: [
3157
+ state.snapshot.coverage.reason ? /* @__PURE__ */ jsx21("span", { children: state.snapshot.coverage.reason }) : null,
3158
+ limitText ? /* @__PURE__ */ jsxs14("span", { children: [
3079
3159
  "Limits: ",
3080
3160
  limitText
3081
3161
  ] }) : null,
3082
- displayedOmissions.length ? /* @__PURE__ */ jsxs13("details", { children: [
3083
- /* @__PURE__ */ jsxs13("summary", { children: [
3162
+ displayedOmissions.length ? /* @__PURE__ */ jsxs14("details", { children: [
3163
+ /* @__PURE__ */ jsxs14("summary", { children: [
3084
3164
  displayedOmissions.length,
3085
3165
  " omissions or adjustments"
3086
3166
  ] }),
3087
- /* @__PURE__ */ jsx19("ul", { children: displayedOmissions.map((o, i) => /* @__PURE__ */ jsxs13("li", { children: [
3167
+ /* @__PURE__ */ jsx21("ul", { children: displayedOmissions.map((o, i) => /* @__PURE__ */ jsxs14("li", { children: [
3088
3168
  o.path || "/",
3089
3169
  ": ",
3090
3170
  o.reason,
@@ -3092,115 +3172,115 @@ function PreparationWorkspace({ restoreFocus, open, state, scopes, onClose, onCh
3092
3172
  ] }, `${o.path}-${o.reason}-${i}`)) })
3093
3173
  ] }) : null
3094
3174
  ] }),
3095
- /* @__PURE__ */ jsxs13("label", { className: "matrx-alchemy-preview-label", children: [
3175
+ /* @__PURE__ */ jsxs14("label", { className: "matrx-alchemy-preview-label", children: [
3096
3176
  "Output format",
3097
- /* @__PURE__ */ jsxs13("select", { "aria-label": "Output format", value: format, onChange: (e) => setFormat(e.target.value), children: [
3098
- formats.map((f) => /* @__PURE__ */ jsx19("option", { value: f, children: LABEL[f] }, f)),
3099
- state.draft.payload.kind === "rows" ? /* @__PURE__ */ jsx19("option", { value: "xlsx", children: "Excel workbook" }) : null,
3100
- workspaceAdapters.map((adapter) => /* @__PURE__ */ jsx19("option", { value: adapter.id, children: adapter.label }, adapter.id))
3177
+ /* @__PURE__ */ jsxs14("select", { "aria-label": "Output format", value: format, onChange: (e) => setFormat(e.target.value), children: [
3178
+ formats.map((f) => /* @__PURE__ */ jsx21("option", { value: f, children: LABEL[f] }, f)),
3179
+ state.draft.payload.kind === "rows" ? /* @__PURE__ */ jsx21("option", { value: "xlsx", children: "Excel workbook" }) : null,
3180
+ workspaceAdapters.map((adapter) => /* @__PURE__ */ jsx21("option", { value: adapter.id, children: adapter.label }, adapter.id))
3101
3181
  ] })
3102
3182
  ] }),
3103
- /* @__PURE__ */ jsx19("textarea", { className: "matrx-alchemy-preview", "aria-label": "Prepared output", "aria-invalid": bufferError ? true : void 0, "aria-describedby": bufferError ? "alchemy-buffer-error" : void 0, value: buffer, onChange: (e) => editBuffer(e.target.value) }),
3104
- bufferError ? /* @__PURE__ */ jsx19("p", { id: "alchemy-buffer-error", role: "alert", className: "matrx-alchemy-error", children: bufferError }) : null,
3105
- formatError ? /* @__PURE__ */ jsx19("p", { role: "alert", className: "matrx-alchemy-error", children: formatError }) : null,
3106
- bufferError ? /* @__PURE__ */ jsx19(Button, { type: "button", variant: "outline", disabled: busy !== null, onClick: () => {
3183
+ /* @__PURE__ */ jsx21("textarea", { className: "matrx-alchemy-preview", "aria-label": "Prepared output", "aria-invalid": bufferError ? true : void 0, "aria-describedby": bufferError ? "alchemy-buffer-error" : void 0, value: buffer, onChange: (e) => editBuffer(e.target.value) }),
3184
+ bufferError ? /* @__PURE__ */ jsx21("p", { id: "alchemy-buffer-error", role: "alert", className: "matrx-alchemy-error", children: bufferError }) : null,
3185
+ formatError ? /* @__PURE__ */ jsx21("p", { role: "alert", className: "matrx-alchemy-error", children: formatError }) : null,
3186
+ bufferError ? /* @__PURE__ */ jsx21(Button, { type: "button", variant: "outline", disabled: busy !== null, onClick: () => {
3107
3187
  const fallback = editDraft(state.draft, { kind: "text", text: buffer });
3108
3188
  setBufferError(null);
3109
3189
  onChange({ ...state, draft: fallback, error: void 0 });
3110
3190
  setFormat("plain");
3111
3191
  }, children: "Use invalid JSON as plain text" }) : null
3112
3192
  ] }),
3113
- ai || busy === "capture" || state.error ? /* @__PURE__ */ jsxs13("aside", { children: [
3114
- ai ? /* @__PURE__ */ jsxs13(Fragment2, { children: [
3115
- /* @__PURE__ */ jsxs13("label", { children: [
3193
+ ai || busy === "capture" || state.error ? /* @__PURE__ */ jsxs14("aside", { children: [
3194
+ ai ? /* @__PURE__ */ jsxs14(Fragment2, { children: [
3195
+ /* @__PURE__ */ jsxs14("label", { children: [
3116
3196
  "AI instruction",
3117
- /* @__PURE__ */ jsx19("textarea", { value: instruction, onChange: (e) => setInstruction(e.target.value), placeholder: "Tell AI how to prepare this content" })
3197
+ /* @__PURE__ */ jsx21("textarea", { value: instruction, onChange: (e) => setInstruction(e.target.value), placeholder: "Tell AI how to prepare this content" })
3118
3198
  ] }),
3119
- /* @__PURE__ */ jsx19(Button, { type: "button", variant: "outline", disabled: !aiSession.current || !instruction.trim() || busy !== null || !aiSession.current.supports(state.snapshot), onClick: () => void runAi(false), children: "Generate preview" }),
3120
- busy === "ai" ? /* @__PURE__ */ jsx19(Button, { type: "button", variant: "outline", onClick: () => void cancelAi(), children: aiSession.current?.cancel ? "Cancel AI" : "Stop waiting" }) : null
3199
+ /* @__PURE__ */ jsx21(Button, { type: "button", variant: "outline", disabled: !aiSession.current || !instruction.trim() || busy !== null || !aiSession.current.supports(state.snapshot), onClick: () => void runAi(false), children: "Generate preview" }),
3200
+ busy === "ai" ? /* @__PURE__ */ jsx21(Button, { type: "button", variant: "outline", onClick: () => void cancelAi(), children: aiSession.current?.cancel ? "Cancel AI" : "Stop waiting" }) : null
3121
3201
  ] }) : null,
3122
- busy === "capture" ? /* @__PURE__ */ jsx19(Button, { type: "button", variant: "outline", onClick: () => {
3202
+ busy === "capture" ? /* @__PURE__ */ jsx21(Button, { type: "button", variant: "outline", onClick: () => {
3123
3203
  activeCapture.current?.abort();
3124
3204
  activeCapture.current = null;
3125
3205
  setBusy(null);
3126
3206
  }, children: "Stop loading rows" }) : null,
3127
- ai && aiFailed && aiSession.current?.recover && busy !== "ai" ? /* @__PURE__ */ jsx19(Button, { type: "button", variant: "outline", onClick: () => void runAi(true), children: aiFailed ? "Retry or rejoin AI run" : "Rejoin AI run" }) : null,
3128
- ai ? /* @__PURE__ */ jsx19("p", { className: "matrx-alchemy-meta", children: "AI creates a preview. It never copies automatically. Closing detaches this view without cancelling server work." }) : null,
3129
- state.error ? /* @__PURE__ */ jsx19("p", { role: "alert", className: "matrx-alchemy-error", children: state.error }) : null
3207
+ ai && aiFailed && aiSession.current?.recover && busy !== "ai" ? /* @__PURE__ */ jsx21(Button, { type: "button", variant: "outline", onClick: () => void runAi(true), children: aiFailed ? "Retry or rejoin AI run" : "Rejoin AI run" }) : null,
3208
+ ai ? /* @__PURE__ */ jsx21("p", { className: "matrx-alchemy-meta", children: "AI creates a preview. It never copies automatically. Closing detaches this view without cancelling server work." }) : null,
3209
+ state.error ? /* @__PURE__ */ jsx21("p", { role: "alert", className: "matrx-alchemy-error", children: state.error }) : null
3130
3210
  ] }) : null
3131
3211
  ] }),
3132
- pendingControls ? /* @__PURE__ */ jsxs13("div", { className: "matrx-alchemy-decision", role: "alert", children: [
3133
- /* @__PURE__ */ jsx19("p", { children: "This control would replace your manual edit." }),
3134
- /* @__PURE__ */ jsx19(Button, { type: "button", variant: "outline", onClick: () => setPendingControls(null), children: "Keep edited draft" }),
3135
- /* @__PURE__ */ jsx19(Button, { type: "button", onClick: applyPendingControls, children: "Rebuild from source" })
3212
+ pendingControls ? /* @__PURE__ */ jsxs14("div", { className: "matrx-alchemy-decision", role: "alert", children: [
3213
+ /* @__PURE__ */ jsx21("p", { children: "This control would replace your manual edit." }),
3214
+ /* @__PURE__ */ jsx21(Button, { type: "button", variant: "outline", onClick: () => setPendingControls(null), children: "Keep edited draft" }),
3215
+ /* @__PURE__ */ jsx21(Button, { type: "button", onClick: applyPendingControls, children: "Rebuild from source" })
3136
3216
  ] }) : null,
3137
- state.sourceStale ? /* @__PURE__ */ jsx19("p", { role: "alert", className: "matrx-alchemy-decision", children: "The source changed since this draft. Use Refresh source to review the latest data." }) : null,
3138
- state.pending ? /* @__PURE__ */ jsxs13("div", { className: "matrx-alchemy-decision", role: "alert", children: [
3139
- /* @__PURE__ */ jsx19("p", { children: "A fresh source snapshot is ready." }),
3140
- /* @__PURE__ */ jsx19(Button, { type: "button", variant: "outline", onClick: () => resolveCapture("keep"), children: "Keep current snapshot and draft" }),
3141
- /* @__PURE__ */ jsx19(Button, { type: "button", onClick: () => resolveCapture("regenerate"), children: "Regenerate from fresh source" })
3217
+ state.sourceStale ? /* @__PURE__ */ jsx21("p", { role: "alert", className: "matrx-alchemy-decision", children: "The source changed since this draft. Use Refresh source to review the latest data." }) : null,
3218
+ state.pending ? /* @__PURE__ */ jsxs14("div", { className: "matrx-alchemy-decision", role: "alert", children: [
3219
+ /* @__PURE__ */ jsx21("p", { children: "A fresh source snapshot is ready." }),
3220
+ /* @__PURE__ */ jsx21(Button, { type: "button", variant: "outline", onClick: () => resolveCapture("keep"), children: "Keep current snapshot and draft" }),
3221
+ /* @__PURE__ */ jsx21(Button, { type: "button", onClick: () => resolveCapture("regenerate"), children: "Regenerate from fresh source" })
3142
3222
  ] }) : null,
3143
- deliveryNotice ? /* @__PURE__ */ jsx19("p", { role: "status", className: "matrx-alchemy-meta", children: deliveryNotice }) : null,
3144
- /* @__PURE__ */ jsxs13(DialogFooter, { children: [
3145
- /* @__PURE__ */ jsxs13("span", { className: "matrx-alchemy-meta", children: [
3223
+ deliveryNotice ? /* @__PURE__ */ jsx21("p", { role: "status", className: "matrx-alchemy-meta", children: deliveryNotice }) : null,
3224
+ /* @__PURE__ */ jsxs14(DialogFooter, { children: [
3225
+ /* @__PURE__ */ jsxs14("span", { className: "matrx-alchemy-meta", children: [
3146
3226
  buffer.length.toLocaleString(),
3147
3227
  " characters \xB7 ~",
3148
3228
  estimateTokens(buffer).toLocaleString(),
3149
3229
  " tokens"
3150
3230
  ] }),
3151
- /* @__PURE__ */ jsx19(Button, { type: "button", variant: "outline", onClick: close, children: "Close" }),
3152
- /* @__PURE__ */ jsx19(Button, { type: "button", variant: "outline", disabled: busy !== null || Boolean(bufferError || formatError) || !preparedArtifact, onClick: () => void deliver(true), children: "Download prepared output" }),
3153
- /* @__PURE__ */ jsx19(Button, { type: "button", disabled: busy !== null || Boolean(bufferError || formatError) || !preparedArtifact, onClick: () => void deliver(false), children: "Copy prepared output" })
3231
+ /* @__PURE__ */ jsx21(Button, { type: "button", variant: "outline", onClick: close, children: "Close" }),
3232
+ /* @__PURE__ */ jsx21(Button, { type: "button", variant: "outline", disabled: busy !== null || Boolean(bufferError || formatError) || !preparedArtifact, onClick: () => void deliver(true), children: "Download prepared output" }),
3233
+ /* @__PURE__ */ jsx21(Button, { type: "button", disabled: busy !== null || Boolean(bufferError || formatError) || !preparedArtifact, onClick: () => void deliver(false), children: "Copy prepared output" })
3154
3234
  ] })
3155
3235
  ] }) });
3156
3236
  }
3157
3237
  function RowControls({ rows, controls, change }) {
3158
- return /* @__PURE__ */ jsxs13(Fragment2, { children: [
3159
- /* @__PURE__ */ jsxs13("div", { className: "matrx-alchemy-toolbar", children: [
3160
- /* @__PURE__ */ jsxs13("label", { children: [
3238
+ return /* @__PURE__ */ jsxs14(Fragment2, { children: [
3239
+ /* @__PURE__ */ jsxs14("div", { className: "matrx-alchemy-toolbar", children: [
3240
+ /* @__PURE__ */ jsxs14("label", { children: [
3161
3241
  "Search",
3162
- /* @__PURE__ */ jsx19("input", { value: controls.search, onChange: (e) => change({ ...controls, search: e.target.value }) })
3242
+ /* @__PURE__ */ jsx21("input", { value: controls.search, onChange: (e) => change({ ...controls, search: e.target.value }) })
3163
3243
  ] }),
3164
- /* @__PURE__ */ jsxs13("label", { children: [
3244
+ /* @__PURE__ */ jsxs14("label", { children: [
3165
3245
  "Sort",
3166
- /* @__PURE__ */ jsxs13("select", { value: controls.sort, onChange: (e) => change({ ...controls, sort: e.target.value }), children: [
3167
- /* @__PURE__ */ jsx19("option", { value: "", children: "None" }),
3168
- rows.columns.map((column) => /* @__PURE__ */ jsx19("option", { value: column.id, children: column.label }, column.id))
3246
+ /* @__PURE__ */ jsxs14("select", { value: controls.sort, onChange: (e) => change({ ...controls, sort: e.target.value }), children: [
3247
+ /* @__PURE__ */ jsx21("option", { value: "", children: "None" }),
3248
+ rows.columns.map((column) => /* @__PURE__ */ jsx21("option", { value: column.id, children: column.label }, column.id))
3169
3249
  ] })
3170
3250
  ] }),
3171
- /* @__PURE__ */ jsxs13("label", { children: [
3251
+ /* @__PURE__ */ jsxs14("label", { children: [
3172
3252
  "Direction",
3173
- /* @__PURE__ */ jsxs13("select", { value: controls.direction, disabled: !controls.sort, onChange: (e) => change({ ...controls, direction: e.target.value }), children: [
3174
- /* @__PURE__ */ jsx19("option", { value: "asc", children: "Ascending" }),
3175
- /* @__PURE__ */ jsx19("option", { value: "desc", children: "Descending" })
3253
+ /* @__PURE__ */ jsxs14("select", { value: controls.direction, disabled: !controls.sort, onChange: (e) => change({ ...controls, direction: e.target.value }), children: [
3254
+ /* @__PURE__ */ jsx21("option", { value: "asc", children: "Ascending" }),
3255
+ /* @__PURE__ */ jsx21("option", { value: "desc", children: "Descending" })
3176
3256
  ] })
3177
3257
  ] }),
3178
- /* @__PURE__ */ jsxs13("label", { children: [
3258
+ /* @__PURE__ */ jsxs14("label", { children: [
3179
3259
  "Top rows",
3180
- /* @__PURE__ */ jsx19("input", { type: "number", min: "0", value: controls.top ?? "", onChange: (e) => change({ ...controls, top: Number.isNaN(e.target.valueAsNumber) ? null : e.target.valueAsNumber }) })
3260
+ /* @__PURE__ */ jsx21("input", { type: "number", min: "0", value: controls.top ?? "", onChange: (e) => change({ ...controls, top: Number.isNaN(e.target.valueAsNumber) ? null : e.target.valueAsNumber }) })
3181
3261
  ] })
3182
3262
  ] }),
3183
- /* @__PURE__ */ jsxs13("fieldset", { className: "matrx-alchemy-options", children: [
3184
- /* @__PURE__ */ jsx19("legend", { children: "Columns and filters" }),
3185
- rows.columns.map((column) => /* @__PURE__ */ jsxs13("div", { className: "matrx-alchemy-column", children: [
3186
- /* @__PURE__ */ jsxs13("label", { children: [
3187
- /* @__PURE__ */ jsx19("input", { type: "checkbox", checked: controls.visibleColumns.includes(column.id), onChange: (e) => change({ ...controls, visibleColumns: e.target.checked ? [...controls.visibleColumns, column.id] : controls.visibleColumns.filter((id) => id !== column.id) }) }),
3263
+ /* @__PURE__ */ jsxs14("fieldset", { className: "matrx-alchemy-options", children: [
3264
+ /* @__PURE__ */ jsx21("legend", { children: "Columns and filters" }),
3265
+ rows.columns.map((column) => /* @__PURE__ */ jsxs14("div", { className: "matrx-alchemy-column", children: [
3266
+ /* @__PURE__ */ jsxs14("label", { children: [
3267
+ /* @__PURE__ */ jsx21("input", { type: "checkbox", checked: controls.visibleColumns.includes(column.id), onChange: (e) => change({ ...controls, visibleColumns: e.target.checked ? [...controls.visibleColumns, column.id] : controls.visibleColumns.filter((id) => id !== column.id) }) }),
3188
3268
  " ",
3189
3269
  column.label
3190
3270
  ] }),
3191
- /* @__PURE__ */ jsx19("input", { "aria-label": `Filter ${column.label}`, placeholder: "Filter", value: controls.filters[column.id] ?? "", onChange: (e) => change({ ...controls, filters: { ...controls.filters, [column.id]: e.target.value } }) })
3271
+ /* @__PURE__ */ jsx21("input", { "aria-label": `Filter ${column.label}`, placeholder: "Filter", value: controls.filters[column.id] ?? "", onChange: (e) => change({ ...controls, filters: { ...controls.filters, [column.id]: e.target.value } }) })
3192
3272
  ] }, column.id))
3193
3273
  ] }),
3194
- /* @__PURE__ */ jsxs13("fieldset", { className: "matrx-alchemy-options", children: [
3195
- /* @__PURE__ */ jsx19("legend", { children: "Rows" }),
3196
- /* @__PURE__ */ jsxs13("label", { children: [
3197
- /* @__PURE__ */ jsx19("input", { type: "checkbox", checked: controls.selectedOnly, onChange: (e) => change({ ...controls, selectedOnly: e.target.checked }) }),
3274
+ /* @__PURE__ */ jsxs14("fieldset", { className: "matrx-alchemy-options", children: [
3275
+ /* @__PURE__ */ jsx21("legend", { children: "Rows" }),
3276
+ /* @__PURE__ */ jsxs14("label", { children: [
3277
+ /* @__PURE__ */ jsx21("input", { type: "checkbox", checked: controls.selectedOnly, onChange: (e) => change({ ...controls, selectedOnly: e.target.checked }) }),
3198
3278
  " Only selected rows"
3199
3279
  ] }),
3200
- /* @__PURE__ */ jsx19("div", { className: "matrx-alchemy-row-list", children: rows.rows.map((row, index) => {
3280
+ /* @__PURE__ */ jsx21("div", { className: "matrx-alchemy-row-list", children: rows.rows.map((row, index) => {
3201
3281
  const summary = rows.columns.filter((column) => column.visible).slice(0, 2).map((column) => String(readTransferCell(row, column) ?? "")).filter(Boolean).join(" \xB7 ");
3202
- return /* @__PURE__ */ jsxs13("label", { children: [
3203
- /* @__PURE__ */ jsx19("input", { type: "checkbox", checked: controls.selectedIndices.includes(index), onChange: (e) => change({ ...controls, selectedIndices: e.target.checked ? [...controls.selectedIndices, index] : controls.selectedIndices.filter((value) => value !== index) }) }),
3282
+ return /* @__PURE__ */ jsxs14("label", { children: [
3283
+ /* @__PURE__ */ jsx21("input", { type: "checkbox", checked: controls.selectedIndices.includes(index), onChange: (e) => change({ ...controls, selectedIndices: e.target.checked ? [...controls.selectedIndices, index] : controls.selectedIndices.filter((value) => value !== index) }) }),
3204
3284
  " Row ",
3205
3285
  index + 1,
3206
3286
  summary ? ` \u2014 ${summary}` : ""
@@ -3211,7 +3291,7 @@ function RowControls({ rows, controls, change }) {
3211
3291
  }
3212
3292
 
3213
3293
  // src/content-transfer/matrx-copy.tsx
3214
- import { Fragment as Fragment3, jsx as jsx20, jsxs as jsxs14 } from "react/jsx-runtime";
3294
+ import { Fragment as Fragment3, jsx as jsx22, jsxs as jsxs15 } from "react/jsx-runtime";
3215
3295
  var resolve = (value) => typeof value === "function" ? value() : value;
3216
3296
  var asPayload = (value) => ({
3217
3297
  kind: "markdown",
@@ -3241,6 +3321,7 @@ var actionDone = (message) => ({
3241
3321
  mimeTypes: [],
3242
3322
  message
3243
3323
  });
3324
+ var isSafeFilename = (filename) => filename === filename.trim() && filename.length > 0 && !/^\.+$/.test(filename) && !/[\\/\x00-\x1F\x7F]/.test(filename);
3244
3325
  var sourceFor = (id, label, build) => ({
3245
3326
  id,
3246
3327
  label,
@@ -3253,7 +3334,7 @@ var sourceFor = (id, label, build) => ({
3253
3334
  });
3254
3335
  function MatrxCopyMenu(props) {
3255
3336
  const inherited = useContentTransferCapabilities();
3256
- return /* @__PURE__ */ jsx20(
3337
+ return /* @__PURE__ */ jsx22(
3257
3338
  MatrxCopyMenuSession,
3258
3339
  {
3259
3340
  ...props
@@ -3265,12 +3346,12 @@ function MatrxCopyMenu(props) {
3265
3346
  );
3266
3347
  }
3267
3348
  function MatrxCopyMenuSession(props) {
3268
- const instance = React13.useId();
3269
- const controller = React13.useRef(null);
3349
+ const instance = React14.useId();
3350
+ const controller = React14.useRef(null);
3270
3351
  const capabilities = useContentTransferCapabilities();
3271
3352
  const transport = capabilities.transport ?? createBrowserTransport2();
3272
- const [modal, setModal] = React13.useState(null);
3273
- const [configuration, setConfiguration] = React13.useState(null);
3353
+ const [modal, setModal] = React14.useState(null);
3354
+ const [configuration, setConfiguration] = React14.useState(null);
3274
3355
  const copyVisible = !props.hide?.includes("copy");
3275
3356
  const aiVisible = !props.hide?.includes("ai");
3276
3357
  const exportVisible = !props.hide?.includes("export");
@@ -3389,7 +3470,8 @@ function MatrxCopyMenuSession(props) {
3389
3470
  value: {
3390
3471
  bytes: Array.from(bytes),
3391
3472
  mime: file.mime,
3392
- extension: file.extension
3473
+ extension: file.extension,
3474
+ ...file.filename !== void 0 ? { filename: file.filename } : {}
3393
3475
  }
3394
3476
  };
3395
3477
  },
@@ -3406,12 +3488,16 @@ function MatrxCopyMenuSession(props) {
3406
3488
  (byte) => typeof byte !== "number" || !Number.isInteger(byte) || byte < 0 || byte > 255
3407
3489
  ))
3408
3490
  throw new Error(`${item.label} did not capture a valid file.`);
3491
+ if (value.filename !== void 0 && (typeof value.filename !== "string" || !isSafeFilename(value.filename)))
3492
+ throw new Error(
3493
+ `${item.label} has an unsafe filename. Use a nonempty basename without leading or trailing whitespace, dots only, path separators, or control characters.`
3494
+ );
3409
3495
  if (draft.omissions.some((omission) => omission.reason !== "duplicate"))
3410
3496
  throw new Error(
3411
3497
  "This custom file exceeds the configured export limits or contains excluded content. Use a standard format or revise the source options."
3412
3498
  );
3413
3499
  const bytes = new Uint8Array(value.bytes);
3414
- const filename = `${props.label.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "") || "export"}.${value.extension.replace(/[^a-zA-Z0-9.-]/g, "") || "bin"}`;
3500
+ const filename = typeof value.filename === "string" ? value.filename : `${props.label.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "") || "export"}.${value.extension.replace(/[^a-zA-Z0-9.-]/g, "") || "bin"}`;
3415
3501
  return transport.download(
3416
3502
  sealTransferArtifact2({
3417
3503
  snapshotId: snapshot.id,
@@ -3440,8 +3526,8 @@ function MatrxCopyMenuSession(props) {
3440
3526
  const source = (props.primarySource === "table" ? table : void 0) ?? json ?? table ?? structuredAgent ?? human ?? builderVariants[0]?.source;
3441
3527
  if (!source && !actions.length) return null;
3442
3528
  const target = source ?? make("actions", () => ({ kind: "text", text: props.label }));
3443
- return /* @__PURE__ */ jsxs14(Fragment3, { children: [
3444
- /* @__PURE__ */ jsx20(
3529
+ return /* @__PURE__ */ jsxs15(Fragment3, { children: [
3530
+ /* @__PURE__ */ jsx22(
3445
3531
  ContentTransferMenu,
3446
3532
  {
3447
3533
  source: target,
@@ -3474,7 +3560,7 @@ function MatrxCopyMenuSession(props) {
3474
3560
  if (!open) setModal(null);
3475
3561
  }
3476
3562
  }),
3477
- configuration ? /* @__PURE__ */ jsx20(
3563
+ configuration ? /* @__PURE__ */ jsx22(
3478
3564
  SourceConfiguration,
3479
3565
  {
3480
3566
  restoreFocus: () => controller.current?.focusTrigger(),
@@ -3501,14 +3587,14 @@ function SourceConfiguration({
3501
3587
  onPrepare
3502
3588
  }) {
3503
3589
  const custom = configuration.custom;
3504
- const handingOff = React13.useRef(false);
3590
+ const handingOff = React14.useRef(false);
3505
3591
  const groomer = configuration.groomer;
3506
- const [values, setValues] = React13.useState(
3592
+ const [values, setValues] = React14.useState(
3507
3593
  () => Object.fromEntries(
3508
3594
  custom?.options.map((option) => [option.key, option.default]) ?? []
3509
3595
  )
3510
3596
  );
3511
- const [sections, setSections] = React13.useState(
3597
+ const [sections, setSections] = React14.useState(
3512
3598
  () => Object.fromEntries(
3513
3599
  groomer?.sections.map((section) => [
3514
3600
  section.id,
@@ -3516,8 +3602,8 @@ function SourceConfiguration({
3516
3602
  ]) ?? []
3517
3603
  )
3518
3604
  );
3519
- const [error, setError] = React13.useState(null);
3520
- const [busy, setBusy] = React13.useState(false);
3605
+ const [error, setError] = React14.useState(null);
3606
+ const [busy, setBusy] = React14.useState(false);
3521
3607
  const title = custom?.dialogTitle ?? groomer?.label ?? "Customize source";
3522
3608
  let prepared = null;
3523
3609
  let buildError = null;
@@ -3554,14 +3640,14 @@ function SourceConfiguration({
3554
3640
  } catch (cause) {
3555
3641
  buildError = cause instanceof Error ? cause.message : "Could not prepare this source.";
3556
3642
  }
3557
- return /* @__PURE__ */ jsx20(
3643
+ return /* @__PURE__ */ jsx22(
3558
3644
  Dialog,
3559
3645
  {
3560
3646
  open: true,
3561
3647
  onOpenChange: (open) => {
3562
3648
  if (!open && !busy) onClose();
3563
3649
  },
3564
- children: /* @__PURE__ */ jsxs14(
3650
+ children: /* @__PURE__ */ jsxs15(
3565
3651
  DialogContent,
3566
3652
  {
3567
3653
  onCloseAutoFocus: (event) => {
@@ -3570,22 +3656,22 @@ function SourceConfiguration({
3570
3656
  },
3571
3657
  className: "matrx-alchemy-workspace",
3572
3658
  children: [
3573
- /* @__PURE__ */ jsxs14(DialogHeader, { children: [
3574
- /* @__PURE__ */ jsx20(DialogTitle, { children: title }),
3575
- /* @__PURE__ */ jsx20(DialogDescription, { children: custom?.dialogDescription ?? "Choose the source detail, then prepare, edit, summarize, copy or export it in Alchemy." })
3659
+ /* @__PURE__ */ jsxs15(DialogHeader, { children: [
3660
+ /* @__PURE__ */ jsx22(DialogTitle, { children: title }),
3661
+ /* @__PURE__ */ jsx22(DialogDescription, { children: custom?.dialogDescription ?? "Choose the source detail, then prepare, edit, summarize, copy or export it in Alchemy." })
3576
3662
  ] }),
3577
- /* @__PURE__ */ jsxs14("div", { className: "matrx-alchemy-main matrx-alchemy-toolbar", children: [
3578
- custom?.options.map((option) => /* @__PURE__ */ jsxs14("label", { children: [
3663
+ /* @__PURE__ */ jsxs15("div", { className: "matrx-alchemy-main matrx-alchemy-toolbar", children: [
3664
+ custom?.options.map((option) => /* @__PURE__ */ jsxs15("label", { children: [
3579
3665
  option.label,
3580
- "hint" in option && option.hint ? /* @__PURE__ */ jsx20("small", { children: option.hint }) : null,
3581
- option.kind === "toggle" ? /* @__PURE__ */ jsx20(
3666
+ "hint" in option && option.hint ? /* @__PURE__ */ jsx22("small", { children: option.hint }) : null,
3667
+ option.kind === "toggle" ? /* @__PURE__ */ jsx22(
3582
3668
  "input",
3583
3669
  {
3584
3670
  type: "checkbox",
3585
3671
  checked: Boolean(values[option.key]),
3586
3672
  onChange: (event) => setValues({ ...values, [option.key]: event.target.checked })
3587
3673
  }
3588
- ) : option.kind === "preset" ? /* @__PURE__ */ jsx20(
3674
+ ) : option.kind === "preset" ? /* @__PURE__ */ jsx22(
3589
3675
  "select",
3590
3676
  {
3591
3677
  value: Number(values[option.key]),
@@ -3593,10 +3679,10 @@ function SourceConfiguration({
3593
3679
  ...values,
3594
3680
  [option.key]: Number(event.target.value)
3595
3681
  }),
3596
- children: option.options.map((choice) => /* @__PURE__ */ jsx20("option", { value: choice.value, children: choice.label }, choice.value))
3682
+ children: option.options.map((choice) => /* @__PURE__ */ jsx22("option", { value: choice.value, children: choice.label }, choice.value))
3597
3683
  }
3598
- ) : option.kind === "slider" ? /* @__PURE__ */ jsxs14(Fragment3, { children: [
3599
- /* @__PURE__ */ jsx20(
3684
+ ) : option.kind === "slider" ? /* @__PURE__ */ jsxs15(Fragment3, { children: [
3685
+ /* @__PURE__ */ jsx22(
3600
3686
  "input",
3601
3687
  {
3602
3688
  type: "range",
@@ -3610,9 +3696,9 @@ function SourceConfiguration({
3610
3696
  })
3611
3697
  }
3612
3698
  ),
3613
- /* @__PURE__ */ jsx20("span", { children: option.formatValue(Number(values[option.key])) })
3614
- ] }) : /* @__PURE__ */ jsxs14(Fragment3, { children: [
3615
- /* @__PURE__ */ jsx20(
3699
+ /* @__PURE__ */ jsx22("span", { children: option.formatValue(Number(values[option.key])) })
3700
+ ] }) : /* @__PURE__ */ jsxs15(Fragment3, { children: [
3701
+ /* @__PURE__ */ jsx22(
3616
3702
  "input",
3617
3703
  {
3618
3704
  type: "number",
@@ -3625,7 +3711,7 @@ function SourceConfiguration({
3625
3711
  })
3626
3712
  }
3627
3713
  ),
3628
- option.presets?.map((preset) => /* @__PURE__ */ jsx20(
3714
+ option.presets?.map((preset) => /* @__PURE__ */ jsx22(
3629
3715
  Button,
3630
3716
  {
3631
3717
  type: "button",
@@ -3637,8 +3723,8 @@ function SourceConfiguration({
3637
3723
  ))
3638
3724
  ] })
3639
3725
  ] }, option.key)),
3640
- groomer ? /* @__PURE__ */ jsxs14(Fragment3, { children: [
3641
- /* @__PURE__ */ jsx20("div", { children: ["full", "compact", "brief"].map((level) => /* @__PURE__ */ jsx20(
3726
+ groomer ? /* @__PURE__ */ jsxs15(Fragment3, { children: [
3727
+ /* @__PURE__ */ jsx22("div", { children: ["full", "compact", "brief"].map((level) => /* @__PURE__ */ jsx22(
3642
3728
  Button,
3643
3729
  {
3644
3730
  type: "button",
@@ -3655,9 +3741,9 @@ function SourceConfiguration({
3655
3741
  },
3656
3742
  level
3657
3743
  )) }),
3658
- groomer.sections.map((section) => /* @__PURE__ */ jsxs14("label", { children: [
3744
+ groomer.sections.map((section) => /* @__PURE__ */ jsxs15("label", { children: [
3659
3745
  section.title,
3660
- /* @__PURE__ */ jsxs14(
3746
+ /* @__PURE__ */ jsxs15(
3661
3747
  "select",
3662
3748
  {
3663
3749
  value: sections[section.id],
@@ -3666,25 +3752,25 @@ function SourceConfiguration({
3666
3752
  [section.id]: event.target.value
3667
3753
  }),
3668
3754
  children: [
3669
- ["full", "compact", "brief"].map((level) => /* @__PURE__ */ jsx20("option", { value: level, children: section.levelLabels?.[level] ?? level }, level)),
3670
- section.cuttable ? /* @__PURE__ */ jsx20("option", { value: "off", children: "Exclude" }) : null
3755
+ ["full", "compact", "brief"].map((level) => /* @__PURE__ */ jsx22("option", { value: level, children: section.levelLabels?.[level] ?? level }, level)),
3756
+ section.cuttable ? /* @__PURE__ */ jsx22("option", { value: "off", children: "Exclude" }) : null
3671
3757
  ]
3672
3758
  }
3673
3759
  ),
3674
- section.description ? /* @__PURE__ */ jsx20("span", { children: section.description }) : null
3760
+ section.description ? /* @__PURE__ */ jsx22("span", { children: section.description }) : null
3675
3761
  ] }, section.id))
3676
3762
  ] }) : null
3677
3763
  ] }),
3678
- /* @__PURE__ */ jsxs14("p", { children: [
3764
+ /* @__PURE__ */ jsxs15("p", { children: [
3679
3765
  text.length.toLocaleString(),
3680
3766
  " characters \xB7 approximately",
3681
3767
  " ",
3682
3768
  Math.ceil(text.length / 4).toLocaleString(),
3683
3769
  " tokens"
3684
3770
  ] }),
3685
- error || buildError ? /* @__PURE__ */ jsx20("p", { role: "alert", children: error ?? buildError }) : null,
3686
- /* @__PURE__ */ jsxs14(DialogFooter, { children: [
3687
- /* @__PURE__ */ jsx20(
3771
+ error || buildError ? /* @__PURE__ */ jsx22("p", { role: "alert", children: error ?? buildError }) : null,
3772
+ /* @__PURE__ */ jsxs15(DialogFooter, { children: [
3773
+ /* @__PURE__ */ jsx22(
3688
3774
  Button,
3689
3775
  {
3690
3776
  type: "button",
@@ -3694,7 +3780,7 @@ function SourceConfiguration({
3694
3780
  children: "Cancel"
3695
3781
  }
3696
3782
  ),
3697
- /* @__PURE__ */ jsx20(
3783
+ /* @__PURE__ */ jsx22(
3698
3784
  Button,
3699
3785
  {
3700
3786
  type: "button",
@@ -3754,12 +3840,12 @@ ${JSON.stringify(value.data, null, 2)}
3754
3840
  }
3755
3841
 
3756
3842
  // src/data-table/copy.tsx
3757
- import { jsx as jsx21 } from "react/jsx-runtime";
3843
+ import { jsx as jsx23 } from "react/jsx-runtime";
3758
3844
  function CopyButtons(props) {
3759
3845
  const { CopyControls } = useMatrxDataTableHost();
3760
3846
  const copyProps = props.export?.sheetRows ? { ...props, primarySource: "table" } : props;
3761
- if (CopyControls) return /* @__PURE__ */ jsx21(CopyControls, { ...copyProps });
3762
- return /* @__PURE__ */ jsx21(MatrxCopyMenu, { ...copyProps });
3847
+ if (CopyControls) return /* @__PURE__ */ jsx23(CopyControls, { ...copyProps });
3848
+ return /* @__PURE__ */ jsx23(MatrxCopyMenu, { ...copyProps });
3763
3849
  }
3764
3850
  function jsonExportItem(build, label) {
3765
3851
  return { id: "json", label, build: () => ({ content: JSON.stringify(build(), null, 2), extension: "json", mime: "application/json" }) };
@@ -3863,7 +3949,7 @@ function buildViewHuman(config, visible, columns) {
3863
3949
  }
3864
3950
 
3865
3951
  // src/data-table/CopySubset.tsx
3866
- import { jsx as jsx22, jsxs as jsxs15 } from "react/jsx-runtime";
3952
+ import { jsx as jsx24, jsxs as jsxs16 } from "react/jsx-runtime";
3867
3953
  function CopySubsetDialog({ source, onClose }) {
3868
3954
  const [rows] = useState7(() => [...source.rows]);
3869
3955
  const [hidden, setHidden] = useState7(() => new Set(source.columns.filter((c) => c.hidden).map((c) => c.id)));
@@ -3884,14 +3970,14 @@ function CopySubsetDialog({ source, onClose }) {
3884
3970
  } catch (raw) {
3885
3971
  buildError = raw instanceof Error ? raw.message : String(raw);
3886
3972
  }
3887
- return /* @__PURE__ */ jsx22(Dialog, { open: true, onOpenChange: (open) => {
3973
+ return /* @__PURE__ */ jsx24(Dialog, { open: true, onOpenChange: (open) => {
3888
3974
  if (!open) onClose();
3889
- }, children: /* @__PURE__ */ jsxs15(DialogContent, { className: "flex h-[80dvh] max-w-5xl flex-col overflow-hidden", children: [
3890
- /* @__PURE__ */ jsx22(DialogHeader, { children: /* @__PURE__ */ jsx22(DialogTitle, { children: "Filter & sort before copying" }) }),
3891
- /* @__PURE__ */ jsxs15("fieldset", { className: "max-h-24 shrink-0 overflow-auto text-xs", children: [
3892
- /* @__PURE__ */ jsx22("legend", { children: "Visible columns" }),
3893
- source.columns.map((column) => /* @__PURE__ */ jsxs15("label", { className: "mr-3 inline-flex items-center gap-1", children: [
3894
- /* @__PURE__ */ jsx22("input", { type: "checkbox", checked: !hidden.has(column.id), onChange: () => setHidden((current) => {
3975
+ }, children: /* @__PURE__ */ jsxs16(DialogContent, { className: "flex h-[80dvh] max-w-5xl flex-col overflow-hidden", children: [
3976
+ /* @__PURE__ */ jsx24(DialogHeader, { children: /* @__PURE__ */ jsx24(DialogTitle, { children: "Filter & sort before copying" }) }),
3977
+ /* @__PURE__ */ jsxs16("fieldset", { className: "max-h-24 shrink-0 overflow-auto text-xs", children: [
3978
+ /* @__PURE__ */ jsx24("legend", { children: "Visible columns" }),
3979
+ source.columns.map((column) => /* @__PURE__ */ jsxs16("label", { className: "mr-3 inline-flex items-center gap-1", children: [
3980
+ /* @__PURE__ */ jsx24("input", { type: "checkbox", checked: !hidden.has(column.id), onChange: () => setHidden((current) => {
3895
3981
  const next = new Set(current);
3896
3982
  next.has(column.id) ? next.delete(column.id) : next.add(column.id);
3897
3983
  return next;
@@ -3899,20 +3985,20 @@ function CopySubsetDialog({ source, onClose }) {
3899
3985
  column.header
3900
3986
  ] }, column.id))
3901
3987
  ] }),
3902
- columns.length ? /* @__PURE__ */ jsx22("div", { className: "min-h-0 flex-1", children: /* @__PURE__ */ jsx22(MatrxDataTable, { data: rows, columns, getRowId: source.getRowId, query: { mode: "controlled-local", state: query, onStateChange: setQuery }, selection: { selectedIds, onSelectedIdsChange: setSelectedIds }, detail: { enabled: false }, window: { enabled: false }, toolbar: { searchMatch: {} } }) }) : /* @__PURE__ */ jsx22("p", { children: "Show at least one column to copy." }),
3903
- buildError ? /* @__PURE__ */ jsx22("p", { role: "alert", className: "text-destructive", children: buildError }) : null,
3988
+ columns.length ? /* @__PURE__ */ jsx24("div", { className: "min-h-0 flex-1", children: /* @__PURE__ */ jsx24(MatrxDataTable, { data: rows, columns, getRowId: source.getRowId, query: { mode: "controlled-local", state: query, onStateChange: setQuery }, selection: { selectedIds, onSelectedIdsChange: setSelectedIds }, detail: { enabled: false }, window: { enabled: false }, toolbar: { searchMatch: {} } }) }) : /* @__PURE__ */ jsx24("p", { children: "Show at least one column to copy." }),
3989
+ buildError ? /* @__PURE__ */ jsx24("p", { role: "alert", className: "text-destructive", children: buildError }) : null,
3904
3990
  notice,
3905
- /* @__PURE__ */ jsxs15(DialogFooter, { children: [
3906
- /* @__PURE__ */ jsxs15("label", { className: "flex items-center gap-2 text-sm", children: [
3991
+ /* @__PURE__ */ jsxs16(DialogFooter, { children: [
3992
+ /* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-2 text-sm", children: [
3907
3993
  "Format",
3908
- /* @__PURE__ */ jsxs15("select", { "aria-label": "Copy format", value: format, onChange: (event) => setFormat(event.target.value), children: [
3909
- /* @__PURE__ */ jsx22("option", { value: "ai", children: "For AI" }),
3910
- /* @__PURE__ */ jsx22("option", { value: "markdown", children: "Markdown" }),
3911
- /* @__PURE__ */ jsx22("option", { value: "csv", children: "CSV" }),
3912
- /* @__PURE__ */ jsx22("option", { value: "json", children: "JSON" })
3994
+ /* @__PURE__ */ jsxs16("select", { "aria-label": "Copy format", value: format, onChange: (event) => setFormat(event.target.value), children: [
3995
+ /* @__PURE__ */ jsx24("option", { value: "ai", children: "For AI" }),
3996
+ /* @__PURE__ */ jsx24("option", { value: "markdown", children: "Markdown" }),
3997
+ /* @__PURE__ */ jsx24("option", { value: "csv", children: "CSV" }),
3998
+ /* @__PURE__ */ jsx24("option", { value: "json", children: "JSON" })
3913
3999
  ] })
3914
4000
  ] }),
3915
- /* @__PURE__ */ jsxs15("span", { role: "status", className: "text-xs", children: [
4001
+ /* @__PURE__ */ jsxs16("span", { role: "status", className: "text-xs", children: [
3916
4002
  shaped.length,
3917
4003
  " of ",
3918
4004
  rows.length,
@@ -3922,13 +4008,13 @@ function CopySubsetDialog({ source, onClose }) {
3922
4008
  text.length.toLocaleString(),
3923
4009
  " characters"
3924
4010
  ] }),
3925
- /* @__PURE__ */ jsx22(Button, { type: "button", variant: "outline", onClick: onClose, children: "Close" }),
3926
- /* @__PURE__ */ jsx22(Button, { type: "button", disabled: buildError !== null || !columns.length || !shaped.length, onClick: () => void clipboard.copyText(text, `${source.label} copied`), children: "Copy subset" })
4011
+ /* @__PURE__ */ jsx24(Button, { type: "button", variant: "outline", onClick: onClose, children: "Close" }),
4012
+ /* @__PURE__ */ jsx24(Button, { type: "button", disabled: buildError !== null || !columns.length || !shaped.length, onClick: () => void clipboard.copyText(text, `${source.label} copied`), children: "Copy subset" })
3927
4013
  ] })
3928
4014
  ] }) });
3929
4015
  }
3930
4016
  function useCopySubsetVariant() {
3931
- return (getSource) => ({ id: "copy-subset", label: "Filter & sort before copying\u2026", section: "ai", modal: ({ open, onOpenChange }) => open ? /* @__PURE__ */ jsx22(CopySubsetDialog, { source: getSource(), onClose: () => onOpenChange(false) }) : null });
4017
+ return (getSource) => ({ id: "copy-subset", label: "Filter & sort before copying\u2026", section: "ai", modal: ({ open, onOpenChange }) => open ? /* @__PURE__ */ jsx24(CopySubsetDialog, { source: getSource(), onClose: () => onOpenChange(false) }) : null });
3932
4018
  }
3933
4019
 
3934
4020
  // src/data-table/clipping.ts
@@ -4141,11 +4227,11 @@ import { useDraggable } from "@dnd-kit/core";
4141
4227
 
4142
4228
  // src/popover.tsx
4143
4229
  import * as PopoverPrimitive from "@radix-ui/react-popover";
4144
- import * as React14 from "react";
4145
- import { jsx as jsx23 } from "react/jsx-runtime";
4230
+ import * as React15 from "react";
4231
+ import { jsx as jsx25 } from "react/jsx-runtime";
4146
4232
  var Popover = PopoverPrimitive.Root;
4147
4233
  var PopoverTrigger = PopoverPrimitive.Trigger;
4148
- var PopoverContent = React14.forwardRef(
4234
+ var PopoverContent = React15.forwardRef(
4149
4235
  ({
4150
4236
  className,
4151
4237
  align = "center",
@@ -4155,7 +4241,7 @@ var PopoverContent = React14.forwardRef(
4155
4241
  ...props
4156
4242
  }, ref) => {
4157
4243
  const portalContainer = usePortalContainer(container);
4158
- return /* @__PURE__ */ jsx23(PopoverPrimitive.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx23(
4244
+ return /* @__PURE__ */ jsx25(PopoverPrimitive.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx25(
4159
4245
  PopoverPrimitive.Content,
4160
4246
  {
4161
4247
  ref,
@@ -4182,9 +4268,9 @@ PopoverContent.displayName = PopoverPrimitive.Content.displayName;
4182
4268
  // src/command.tsx
4183
4269
  import * as DialogPrimitive2 from "@radix-ui/react-dialog";
4184
4270
  import { Command as CommandPrimitive } from "cmdk";
4185
- import * as React15 from "react";
4186
- import { jsx as jsx24, jsxs as jsxs16 } from "react/jsx-runtime";
4187
- var Command = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx24(
4271
+ import * as React16 from "react";
4272
+ import { jsx as jsx26, jsxs as jsxs17 } from "react/jsx-runtime";
4273
+ var Command = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx26(
4188
4274
  CommandPrimitive,
4189
4275
  {
4190
4276
  ref,
@@ -4199,12 +4285,12 @@ Command.displayName = CommandPrimitive.displayName;
4199
4285
  var DIALOG_DESKTOP_CLASSES2 = `fixed left-[50%] top-[50%] z-[10000] grid min-w-0 w-full max-w-lg ${CENTERED_DIALOG} gap-4 overflow-x-clip border bg-background p-6 shadow-lg [overflow-wrap:anywhere] [&>*]:min-w-0 [&>*]:max-w-full sm:rounded-lg`;
4200
4286
  var DIALOG_MOBILE_SHEET_CLASSES2 = "fixed inset-x-0 bottom-0 left-0 right-0 top-auto z-[10000] flex min-w-0 flex-col w-full max-w-full max-h-[90dvh] translate-x-0 translate-y-0 gap-4 overflow-x-clip border-t bg-background p-4 pb-safe shadow-lg [overflow-wrap:anywhere] [&>*]:min-w-0 [&>*]:max-w-full rounded-t-2xl rounded-b-none overflow-y-auto overscroll-contain";
4201
4287
  var DIALOG_MOBILE_SHEET_OVERRIDE2 = "inset-x-0 bottom-0 left-0 right-0 top-auto translate-x-0 translate-y-0 w-full max-w-full max-h-[90dvh] rounded-b-none rounded-t-2xl overflow-y-auto";
4202
- var CommandDialogContent = React15.forwardRef(({ className, children, container, ...props }, ref) => {
4288
+ var CommandDialogContent = React16.forwardRef(({ className, children, container, ...props }, ref) => {
4203
4289
  const isMobile = useIsMobile();
4204
4290
  const isModal = useRadixDialogModal();
4205
4291
  const portalContainer = usePortalContainer(container);
4206
- return /* @__PURE__ */ jsxs16(DialogPrimitive2.Portal, { container: portalContainer, children: [
4207
- isModal ? /* @__PURE__ */ jsx24(
4292
+ return /* @__PURE__ */ jsxs17(DialogPrimitive2.Portal, { container: portalContainer, children: [
4293
+ isModal ? /* @__PURE__ */ jsx26(
4208
4294
  DialogPrimitive2.Overlay,
4209
4295
  {
4210
4296
  className: cn(
@@ -4213,7 +4299,7 @@ var CommandDialogContent = React15.forwardRef(({ className, children, container,
4213
4299
  )
4214
4300
  }
4215
4301
  ) : null,
4216
- /* @__PURE__ */ jsxs16(
4302
+ /* @__PURE__ */ jsxs17(
4217
4303
  DialogPrimitive2.Content,
4218
4304
  {
4219
4305
  ref,
@@ -4229,9 +4315,9 @@ var CommandDialogContent = React15.forwardRef(({ className, children, container,
4229
4315
  ...props,
4230
4316
  children: [
4231
4317
  children,
4232
- /* @__PURE__ */ jsxs16(DialogPrimitive2.Close, { className: "absolute right-2 top-4 flex h-10 w-10 items-center justify-center rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground sm:right-4", children: [
4233
- /* @__PURE__ */ jsx24(XIcon, { className: "h-4 w-4" }),
4234
- /* @__PURE__ */ jsx24("span", { className: "sr-only", children: "Close" })
4318
+ /* @__PURE__ */ jsxs17(DialogPrimitive2.Close, { className: "absolute right-2 top-4 flex h-10 w-10 items-center justify-center rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground sm:right-4", children: [
4319
+ /* @__PURE__ */ jsx26(XIcon, { className: "h-4 w-4" }),
4320
+ /* @__PURE__ */ jsx26("span", { className: "sr-only", children: "Close" })
4235
4321
  ] })
4236
4322
  ]
4237
4323
  }
@@ -4239,9 +4325,9 @@ var CommandDialogContent = React15.forwardRef(({ className, children, container,
4239
4325
  ] });
4240
4326
  });
4241
4327
  CommandDialogContent.displayName = "CommandDialogContent";
4242
- var CommandInput = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxs16("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [
4243
- /* @__PURE__ */ jsx24(MagnifyingGlassIcon, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
4244
- /* @__PURE__ */ jsx24(
4328
+ var CommandInput = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxs17("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [
4329
+ /* @__PURE__ */ jsx26(MagnifyingGlassIcon, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
4330
+ /* @__PURE__ */ jsx26(
4245
4331
  CommandPrimitive.Input,
4246
4332
  {
4247
4333
  ref,
@@ -4254,7 +4340,7 @@ var CommandInput = React15.forwardRef(({ className, ...props }, ref) => /* @__PU
4254
4340
  )
4255
4341
  ] }));
4256
4342
  CommandInput.displayName = CommandPrimitive.Input.displayName;
4257
- var CommandList = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx24(
4343
+ var CommandList = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx26(
4258
4344
  CommandPrimitive.List,
4259
4345
  {
4260
4346
  ref,
@@ -4263,7 +4349,7 @@ var CommandList = React15.forwardRef(({ className, ...props }, ref) => /* @__PUR
4263
4349
  }
4264
4350
  ));
4265
4351
  CommandList.displayName = CommandPrimitive.List.displayName;
4266
- var CommandEmpty = React15.forwardRef((props, ref) => /* @__PURE__ */ jsx24(
4352
+ var CommandEmpty = React16.forwardRef((props, ref) => /* @__PURE__ */ jsx26(
4267
4353
  CommandPrimitive.Empty,
4268
4354
  {
4269
4355
  ref,
@@ -4272,7 +4358,7 @@ var CommandEmpty = React15.forwardRef((props, ref) => /* @__PURE__ */ jsx24(
4272
4358
  }
4273
4359
  ));
4274
4360
  CommandEmpty.displayName = CommandPrimitive.Empty.displayName;
4275
- var CommandGroup = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx24(
4361
+ var CommandGroup = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx26(
4276
4362
  CommandPrimitive.Group,
4277
4363
  {
4278
4364
  ref,
@@ -4284,7 +4370,7 @@ var CommandGroup = React15.forwardRef(({ className, ...props }, ref) => /* @__PU
4284
4370
  }
4285
4371
  ));
4286
4372
  CommandGroup.displayName = CommandPrimitive.Group.displayName;
4287
- var CommandSeparator = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx24(
4373
+ var CommandSeparator = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx26(
4288
4374
  CommandPrimitive.Separator,
4289
4375
  {
4290
4376
  ref,
@@ -4293,7 +4379,7 @@ var CommandSeparator = React15.forwardRef(({ className, ...props }, ref) => /* @
4293
4379
  }
4294
4380
  ));
4295
4381
  CommandSeparator.displayName = CommandPrimitive.Separator.displayName;
4296
- var CommandItem = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx24(
4382
+ var CommandItem = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx26(
4297
4383
  CommandPrimitive.Item,
4298
4384
  {
4299
4385
  ref,
@@ -4309,7 +4395,7 @@ var CommandShortcut = ({
4309
4395
  className,
4310
4396
  ...props
4311
4397
  }) => {
4312
- return /* @__PURE__ */ jsx24(
4398
+ return /* @__PURE__ */ jsx26(
4313
4399
  "span",
4314
4400
  {
4315
4401
  className: cn(
@@ -4324,7 +4410,7 @@ CommandShortcut.displayName = "CommandShortcut";
4324
4410
 
4325
4411
  // src/data-table/ColumnHeaderCell.tsx
4326
4412
  init_filter_engine();
4327
- import { Fragment as Fragment4, jsx as jsx25, jsxs as jsxs17 } from "react/jsx-runtime";
4413
+ import { Fragment as Fragment4, jsx as jsx27, jsxs as jsxs18 } from "react/jsx-runtime";
4328
4414
  function ColumnHeaderCell({
4329
4415
  label,
4330
4416
  labelText,
@@ -4394,7 +4480,7 @@ function ColumnHeaderCell({
4394
4480
  else onFilterChange(next);
4395
4481
  };
4396
4482
  const menuLabel = labelText ? `Sort or filter ${labelText}` : "Sort or filter column";
4397
- const menuContent = /* @__PURE__ */ jsxs17(
4483
+ const menuContent = /* @__PURE__ */ jsxs18(
4398
4484
  PopoverContent,
4399
4485
  {
4400
4486
  align: "start",
@@ -4411,9 +4497,9 @@ function ColumnHeaderCell({
4411
4497
  input.focus();
4412
4498
  },
4413
4499
  children: [
4414
- sortable ? /* @__PURE__ */ jsxs17(Fragment4, { children: [
4415
- /* @__PURE__ */ jsxs17("div", { className: "flex flex-col gap-0.5 pb-2", children: [
4416
- /* @__PURE__ */ jsxs17(
4500
+ sortable ? /* @__PURE__ */ jsxs18(Fragment4, { children: [
4501
+ /* @__PURE__ */ jsxs18("div", { className: "flex flex-col gap-0.5 pb-2", children: [
4502
+ /* @__PURE__ */ jsxs18(
4417
4503
  Button,
4418
4504
  {
4419
4505
  variant: isSorted && sortDirection === "asc" ? "secondary" : "ghost",
@@ -4421,12 +4507,12 @@ function ColumnHeaderCell({
4421
4507
  className: "h-8 justify-start gap-2 px-2 text-xs font-normal",
4422
4508
  onClick: onSortAsc,
4423
4509
  children: [
4424
- /* @__PURE__ */ jsx25(ArrowUp, { className: "h-3.5 w-3.5" }),
4510
+ /* @__PURE__ */ jsx27(ArrowUp, { className: "h-3.5 w-3.5" }),
4425
4511
  "Sort ascending"
4426
4512
  ]
4427
4513
  }
4428
4514
  ),
4429
- /* @__PURE__ */ jsxs17(
4515
+ /* @__PURE__ */ jsxs18(
4430
4516
  Button,
4431
4517
  {
4432
4518
  variant: isSorted && sortDirection === "desc" ? "secondary" : "ghost",
@@ -4434,12 +4520,12 @@ function ColumnHeaderCell({
4434
4520
  className: "h-8 justify-start gap-2 px-2 text-xs font-normal",
4435
4521
  onClick: onSortDesc,
4436
4522
  children: [
4437
- /* @__PURE__ */ jsx25(ArrowDown, { className: "h-3.5 w-3.5" }),
4523
+ /* @__PURE__ */ jsx27(ArrowDown, { className: "h-3.5 w-3.5" }),
4438
4524
  "Sort descending"
4439
4525
  ]
4440
4526
  }
4441
4527
  ),
4442
- isSorted ? /* @__PURE__ */ jsxs17(
4528
+ isSorted ? /* @__PURE__ */ jsxs18(
4443
4529
  Button,
4444
4530
  {
4445
4531
  variant: "ghost",
@@ -4447,15 +4533,15 @@ function ColumnHeaderCell({
4447
4533
  className: "h-8 justify-start gap-2 px-2 text-xs font-normal text-muted-foreground",
4448
4534
  onClick: onClearSort,
4449
4535
  children: [
4450
- /* @__PURE__ */ jsx25(ListX, { className: "h-3.5 w-3.5" }),
4536
+ /* @__PURE__ */ jsx27(ListX, { className: "h-3.5 w-3.5" }),
4451
4537
  "Clear sort"
4452
4538
  ]
4453
4539
  }
4454
4540
  ) : null
4455
4541
  ] }),
4456
- filterKind ? /* @__PURE__ */ jsx25("div", { className: "mb-2 h-px bg-border" }) : null
4542
+ filterKind ? /* @__PURE__ */ jsx27("div", { className: "mb-2 h-px bg-border" }) : null
4457
4543
  ] }) : null,
4458
- filterKind ? /* @__PURE__ */ jsx25(
4544
+ filterKind ? /* @__PURE__ */ jsx27(
4459
4545
  FilterBody,
4460
4546
  {
4461
4547
  kind: filterKind,
@@ -4470,10 +4556,10 @@ function ColumnHeaderCell({
4470
4556
  allowNullModes
4471
4557
  }
4472
4558
  ) : null,
4473
- filterKind && visibleFilter && allowNegation ? /* @__PURE__ */ jsxs17("div", { className: "mt-2 border-t border-border pt-2", children: [
4474
- /* @__PURE__ */ jsx25("p", { className: "mb-1 text-[11px] font-medium uppercase tracking-wider text-muted-foreground", children: "Match mode" }),
4475
- /* @__PURE__ */ jsxs17("div", { className: "grid grid-cols-2 gap-1 rounded-md border p-0.5", children: [
4476
- /* @__PURE__ */ jsx25(
4559
+ filterKind && visibleFilter && allowNegation ? /* @__PURE__ */ jsxs18("div", { className: "mt-2 border-t border-border pt-2", children: [
4560
+ /* @__PURE__ */ jsx27("p", { className: "mb-1 text-[11px] font-medium uppercase tracking-wider text-muted-foreground", children: "Match mode" }),
4561
+ /* @__PURE__ */ jsxs18("div", { className: "grid grid-cols-2 gap-1 rounded-md border p-0.5", children: [
4562
+ /* @__PURE__ */ jsx27(
4477
4563
  "button",
4478
4564
  {
4479
4565
  type: "button",
@@ -4486,7 +4572,7 @@ function ColumnHeaderCell({
4486
4572
  children: "Include"
4487
4573
  }
4488
4574
  ),
4489
- /* @__PURE__ */ jsx25(
4575
+ /* @__PURE__ */ jsx27(
4490
4576
  "button",
4491
4577
  {
4492
4578
  type: "button",
@@ -4501,11 +4587,11 @@ function ColumnHeaderCell({
4501
4587
  )
4502
4588
  ] })
4503
4589
  ] }) : null,
4504
- filterKind && deferredFilter ? /* @__PURE__ */ jsxs17("div", { className: "mt-2 border-t border-border pt-2", children: [
4505
- filterFooterHint ? /* @__PURE__ */ jsx25("div", { className: "mb-2 text-xs text-muted-foreground", children: filterFooterHint }) : null,
4506
- /* @__PURE__ */ jsxs17("div", { className: "flex justify-end gap-2", children: [
4507
- filterShowCancel ? /* @__PURE__ */ jsx25(Button, { type: "button", variant: "ghost", size: "sm", onClick: cancelFilter, children: "Cancel" }) : null,
4508
- /* @__PURE__ */ jsx25(Button, { type: "button", size: "sm", onClick: applyFilter, children: filterApplyLabel ?? "Apply" })
4590
+ filterKind && deferredFilter ? /* @__PURE__ */ jsxs18("div", { className: "mt-2 border-t border-border pt-2", children: [
4591
+ filterFooterHint ? /* @__PURE__ */ jsx27("div", { className: "mb-2 text-xs text-muted-foreground", children: filterFooterHint }) : null,
4592
+ /* @__PURE__ */ jsxs18("div", { className: "flex justify-end gap-2", children: [
4593
+ filterShowCancel ? /* @__PURE__ */ jsx27(Button, { type: "button", variant: "ghost", size: "sm", onClick: cancelFilter, children: "Cancel" }) : null,
4594
+ /* @__PURE__ */ jsx27(Button, { type: "button", size: "sm", onClick: applyFilter, children: filterApplyLabel ?? "Apply" })
4509
4595
  ] })
4510
4596
  ] }) : null
4511
4597
  ]
@@ -4514,9 +4600,9 @@ function ColumnHeaderCell({
4514
4600
  if (compact) {
4515
4601
  if (!sortable && !filterKind) {
4516
4602
  if (!reorderEnabled) {
4517
- return /* @__PURE__ */ jsx25("div", { className: cn("flex items-center justify-center", className), children: label });
4603
+ return /* @__PURE__ */ jsx27("div", { className: cn("flex items-center justify-center", className), children: label });
4518
4604
  }
4519
- return /* @__PURE__ */ jsx25("div", { className: cn("flex items-center justify-center", className), children: /* @__PURE__ */ jsx25(
4605
+ return /* @__PURE__ */ jsx27("div", { className: cn("flex items-center justify-center", className), children: /* @__PURE__ */ jsx27(
4520
4606
  "button",
4521
4607
  {
4522
4608
  type: "button",
@@ -4529,7 +4615,7 @@ function ColumnHeaderCell({
4529
4615
  }
4530
4616
  ) });
4531
4617
  }
4532
- return /* @__PURE__ */ jsx25(
4618
+ return /* @__PURE__ */ jsx27(
4533
4619
  "div",
4534
4620
  {
4535
4621
  className: cn(
@@ -4537,8 +4623,8 @@ function ColumnHeaderCell({
4537
4623
  align === "right" ? "justify-end" : "justify-center",
4538
4624
  className
4539
4625
  ),
4540
- children: /* @__PURE__ */ jsxs17(Popover, { open: filterOpen, onOpenChange: setFilterOpen, children: [
4541
- /* @__PURE__ */ jsx25(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs17(
4626
+ children: /* @__PURE__ */ jsxs18(Popover, { open: filterOpen, onOpenChange: setFilterOpen, children: [
4627
+ /* @__PURE__ */ jsx27(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs18(
4542
4628
  "button",
4543
4629
  {
4544
4630
  type: "button",
@@ -4555,8 +4641,8 @@ function ColumnHeaderCell({
4555
4641
  ),
4556
4642
  children: [
4557
4643
  label,
4558
- isSorted ? sortDirection === "asc" ? /* @__PURE__ */ jsx25(ArrowUp, { className: "absolute -top-1 right-0 h-2 w-2 text-primary" }) : /* @__PURE__ */ jsx25(ArrowDown, { className: "absolute -top-1 right-0 h-2 w-2 text-primary" }) : null,
4559
- filterActive ? /* @__PURE__ */ jsx25(
4644
+ isSorted ? sortDirection === "asc" ? /* @__PURE__ */ jsx27(ArrowUp, { className: "absolute -top-1 right-0 h-2 w-2 text-primary" }) : /* @__PURE__ */ jsx27(ArrowDown, { className: "absolute -top-1 right-0 h-2 w-2 text-primary" }) : null,
4645
+ filterActive ? /* @__PURE__ */ jsx27(
4560
4646
  "span",
4561
4647
  {
4562
4648
  "aria-hidden": true,
@@ -4571,7 +4657,7 @@ function ColumnHeaderCell({
4571
4657
  }
4572
4658
  );
4573
4659
  }
4574
- return /* @__PURE__ */ jsxs17(
4660
+ return /* @__PURE__ */ jsxs18(
4575
4661
  "div",
4576
4662
  {
4577
4663
  className: cn(
@@ -4581,7 +4667,7 @@ function ColumnHeaderCell({
4581
4667
  className
4582
4668
  ),
4583
4669
  children: [
4584
- sortable ? /* @__PURE__ */ jsxs17(
4670
+ sortable ? /* @__PURE__ */ jsxs18(
4585
4671
  "button",
4586
4672
  {
4587
4673
  type: "button",
@@ -4593,11 +4679,11 @@ function ColumnHeaderCell({
4593
4679
  isSorted ? "text-foreground" : "text-muted-foreground hover:text-foreground"
4594
4680
  ),
4595
4681
  children: [
4596
- /* @__PURE__ */ jsx25("span", { className: "truncate", children: label }),
4597
- isSorted ? sortDirection === "asc" ? /* @__PURE__ */ jsx25(ArrowUp, { className: "h-3 w-3 shrink-0 text-primary" }) : /* @__PURE__ */ jsx25(ArrowDown, { className: "h-3 w-3 shrink-0 text-primary" }) : /* @__PURE__ */ jsx25(ArrowUpDown, { className: "h-3 w-3 shrink-0 opacity-40" })
4682
+ /* @__PURE__ */ jsx27("span", { className: "truncate", children: label }),
4683
+ isSorted ? sortDirection === "asc" ? /* @__PURE__ */ jsx27(ArrowUp, { className: "h-3 w-3 shrink-0 text-primary" }) : /* @__PURE__ */ jsx27(ArrowDown, { className: "h-3 w-3 shrink-0 text-primary" }) : /* @__PURE__ */ jsx27(ArrowUpDown, { className: "h-3 w-3 shrink-0 opacity-40" })
4598
4684
  ]
4599
4685
  }
4600
- ) : reorderEnabled ? /* @__PURE__ */ jsx25(
4686
+ ) : reorderEnabled ? /* @__PURE__ */ jsx27(
4601
4687
  "button",
4602
4688
  {
4603
4689
  type: "button",
@@ -4608,10 +4694,10 @@ function ColumnHeaderCell({
4608
4694
  ),
4609
4695
  children: label
4610
4696
  }
4611
- ) : /* @__PURE__ */ jsx25("span", { className: "truncate text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: label }),
4612
- filterKind ? /* @__PURE__ */ jsxs17("div", { className: "inline-flex items-center", children: [
4613
- /* @__PURE__ */ jsxs17(Popover, { open: filterOpen, onOpenChange: setFilterOpen, children: [
4614
- /* @__PURE__ */ jsx25(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx25(
4697
+ ) : /* @__PURE__ */ jsx27("span", { className: "truncate text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: label }),
4698
+ filterKind ? /* @__PURE__ */ jsxs18("div", { className: "inline-flex items-center", children: [
4699
+ /* @__PURE__ */ jsxs18(Popover, { open: filterOpen, onOpenChange: setFilterOpen, children: [
4700
+ /* @__PURE__ */ jsx27(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx27(
4615
4701
  "button",
4616
4702
  {
4617
4703
  type: "button",
@@ -4622,7 +4708,7 @@ function ColumnHeaderCell({
4622
4708
  "rounded p-0.5 transition-colors",
4623
4709
  filterActive ? "text-primary hover:text-primary/80" : "text-muted-foreground/40 hover:text-muted-foreground"
4624
4710
  ),
4625
- children: /* @__PURE__ */ jsx25(
4711
+ children: /* @__PURE__ */ jsx27(
4626
4712
  ListFilter,
4627
4713
  {
4628
4714
  className: cn("h-3 w-3", filterActive && "fill-primary/20")
@@ -4632,7 +4718,7 @@ function ColumnHeaderCell({
4632
4718
  ) }),
4633
4719
  menuContent
4634
4720
  ] }),
4635
- filterActive ? /* @__PURE__ */ jsx25(
4721
+ filterActive ? /* @__PURE__ */ jsx27(
4636
4722
  "button",
4637
4723
  {
4638
4724
  type: "button",
@@ -4643,7 +4729,7 @@ function ColumnHeaderCell({
4643
4729
  onFilterChange(void 0);
4644
4730
  },
4645
4731
  className: "rounded p-0.5 text-primary hover:bg-muted hover:text-foreground",
4646
- children: /* @__PURE__ */ jsx25(X, { className: "h-3 w-3" })
4732
+ children: /* @__PURE__ */ jsx27(X, { className: "h-3 w-3" })
4647
4733
  }
4648
4734
  ) : null
4649
4735
  ] }) : null
@@ -4669,14 +4755,14 @@ function FilterBody({
4669
4755
  onChange({ kind: "text", value: "", mode: next });
4670
4756
  }
4671
4757
  };
4672
- return /* @__PURE__ */ jsxs17("div", { className: "space-y-1.5 px-1", children: [
4673
- /* @__PURE__ */ jsx25("p", { className: "text-[11px] font-medium uppercase tracking-wider text-muted-foreground", children: "Filter" }),
4674
- /* @__PURE__ */ jsx25("div", { className: "flex gap-1", children: [
4758
+ return /* @__PURE__ */ jsxs18("div", { className: "space-y-1.5 px-1", children: [
4759
+ /* @__PURE__ */ jsx27("p", { className: "text-[11px] font-medium uppercase tracking-wider text-muted-foreground", children: "Filter" }),
4760
+ /* @__PURE__ */ jsx27("div", { className: "flex gap-1", children: [
4675
4761
  ["contains", "Contains"],
4676
4762
  ["empty", "(empty)"],
4677
4763
  ["not_empty", "(not empty)"],
4678
4764
  ...allowNullModes ? [["null", "(null)"], ["not_null", "(not null)"]] : []
4679
- ].map(([m, label]) => /* @__PURE__ */ jsx25(
4765
+ ].map(([m, label]) => /* @__PURE__ */ jsx27(
4680
4766
  "button",
4681
4767
  {
4682
4768
  type: "button",
@@ -4690,8 +4776,8 @@ function FilterBody({
4690
4776
  },
4691
4777
  m
4692
4778
  )) }),
4693
- mode === "contains" && /* @__PURE__ */ jsxs17("div", { className: "relative", children: [
4694
- /* @__PURE__ */ jsx25(
4779
+ mode === "contains" && /* @__PURE__ */ jsxs18("div", { className: "relative", children: [
4780
+ /* @__PURE__ */ jsx27(
4695
4781
  Input,
4696
4782
  {
4697
4783
  "data-matrx-filter-autofocus": true,
@@ -4704,14 +4790,14 @@ function FilterBody({
4704
4790
  style: { fontSize: "16px" }
4705
4791
  }
4706
4792
  ),
4707
- text ? /* @__PURE__ */ jsx25(
4793
+ text ? /* @__PURE__ */ jsx27(
4708
4794
  "button",
4709
4795
  {
4710
4796
  type: "button",
4711
4797
  "aria-label": "Clear filter text",
4712
4798
  className: "absolute right-1.5 top-1/2 -translate-y-1/2 rounded p-0.5 text-muted-foreground hover:text-foreground",
4713
4799
  onClick: () => onChange(void 0),
4714
- children: /* @__PURE__ */ jsx25(X, { className: "h-3.5 w-3.5" })
4800
+ children: /* @__PURE__ */ jsx27(X, { className: "h-3.5 w-3.5" })
4715
4801
  }
4716
4802
  ) : null
4717
4803
  ] })
@@ -4719,7 +4805,7 @@ function FilterBody({
4719
4805
  }
4720
4806
  if (kind === "select") {
4721
4807
  const selected = value?.kind === "select" ? value.values ?? (value.value && value.value !== "__all__" ? [value.value] : []) : [];
4722
- return /* @__PURE__ */ jsx25(
4808
+ return /* @__PURE__ */ jsx27(
4723
4809
  SearchableSelectFilter,
4724
4810
  {
4725
4811
  selected,
@@ -4731,9 +4817,9 @@ function FilterBody({
4731
4817
  }
4732
4818
  if (kind === "boolean") {
4733
4819
  const current = value?.kind === "boolean" ? value.value : "__all__";
4734
- return /* @__PURE__ */ jsxs17("div", { className: "space-y-1.5 px-1", children: [
4735
- /* @__PURE__ */ jsx25("p", { className: "text-[11px] font-medium uppercase tracking-wider text-muted-foreground", children: "Filter" }),
4736
- /* @__PURE__ */ jsxs17(
4820
+ return /* @__PURE__ */ jsxs18("div", { className: "space-y-1.5 px-1", children: [
4821
+ /* @__PURE__ */ jsx27("p", { className: "text-[11px] font-medium uppercase tracking-wider text-muted-foreground", children: "Filter" }),
4822
+ /* @__PURE__ */ jsxs18(
4737
4823
  Select,
4738
4824
  {
4739
4825
  value: current === "__all__" ? "__all__" : current ? "true" : "false",
@@ -4742,18 +4828,18 @@ function FilterBody({
4742
4828
  else onChange({ kind: "boolean", value: v === "true" });
4743
4829
  },
4744
4830
  children: [
4745
- /* @__PURE__ */ jsx25(SelectTrigger, { className: "h-8 text-xs", children: /* @__PURE__ */ jsx25(SelectValue, {}) }),
4746
- /* @__PURE__ */ jsxs17(SelectContent, { children: [
4747
- /* @__PURE__ */ jsx25(SelectItem, { value: "__all__", children: "All" }),
4748
- /* @__PURE__ */ jsx25(SelectItem, { value: "true", children: "Yes" }),
4749
- /* @__PURE__ */ jsx25(SelectItem, { value: "false", children: "No" })
4831
+ /* @__PURE__ */ jsx27(SelectTrigger, { className: "h-8 text-xs", children: /* @__PURE__ */ jsx27(SelectValue, {}) }),
4832
+ /* @__PURE__ */ jsxs18(SelectContent, { children: [
4833
+ /* @__PURE__ */ jsx27(SelectItem, { value: "__all__", children: "All" }),
4834
+ /* @__PURE__ */ jsx27(SelectItem, { value: "true", children: "Yes" }),
4835
+ /* @__PURE__ */ jsx27(SelectItem, { value: "false", children: "No" })
4750
4836
  ] })
4751
4837
  ]
4752
4838
  }
4753
4839
  )
4754
4840
  ] });
4755
4841
  }
4756
- return /* @__PURE__ */ jsx25(NumberFilterBody, { value, onChange });
4842
+ return /* @__PURE__ */ jsx27(NumberFilterBody, { value, onChange });
4757
4843
  }
4758
4844
  function SearchableSelectFilter({
4759
4845
  selected,
@@ -4781,13 +4867,13 @@ function SearchableSelectFilter({
4781
4867
  next.length === 0 ? void 0 : { kind: "select", value: next[0] ?? "", values: next }
4782
4868
  );
4783
4869
  };
4784
- return /* @__PURE__ */ jsxs17("div", { className: "space-y-1 px-0", children: [
4785
- /* @__PURE__ */ jsxs17("div", { className: "flex items-center justify-between px-1 pb-1", children: [
4786
- /* @__PURE__ */ jsxs17("p", { className: "text-[11px] font-medium uppercase tracking-wider text-muted-foreground", children: [
4870
+ return /* @__PURE__ */ jsxs18("div", { className: "space-y-1 px-0", children: [
4871
+ /* @__PURE__ */ jsxs18("div", { className: "flex items-center justify-between px-1 pb-1", children: [
4872
+ /* @__PURE__ */ jsxs18("p", { className: "text-[11px] font-medium uppercase tracking-wider text-muted-foreground", children: [
4787
4873
  "Filter",
4788
4874
  selected.length > 1 ? ` (any of ${selected.length})` : ""
4789
4875
  ] }),
4790
- selected.length > 0 ? /* @__PURE__ */ jsx25(
4876
+ selected.length > 0 ? /* @__PURE__ */ jsx27(
4791
4877
  "button",
4792
4878
  {
4793
4879
  type: "button",
@@ -4797,8 +4883,8 @@ function SearchableSelectFilter({
4797
4883
  }
4798
4884
  ) : null
4799
4885
  ] }),
4800
- /* @__PURE__ */ jsxs17(Command, { className: "rounded-md border border-border", shouldFilter: false, children: [
4801
- /* @__PURE__ */ jsx25(
4886
+ /* @__PURE__ */ jsxs18(Command, { className: "rounded-md border border-border", shouldFilter: false, children: [
4887
+ /* @__PURE__ */ jsx27(
4802
4888
  CommandInput,
4803
4889
  {
4804
4890
  "data-matrx-filter-autofocus": true,
@@ -4808,10 +4894,10 @@ function SearchableSelectFilter({
4808
4894
  className: "h-8 text-sm"
4809
4895
  }
4810
4896
  ),
4811
- /* @__PURE__ */ jsxs17(CommandList, { className: "max-h-48", children: [
4812
- /* @__PURE__ */ jsx25(CommandEmpty, { className: "py-3 text-xs text-muted-foreground", children: "No matches" }),
4813
- /* @__PURE__ */ jsxs17(CommandGroup, { children: [
4814
- /* @__PURE__ */ jsx25(
4897
+ /* @__PURE__ */ jsxs18(CommandList, { className: "max-h-48", children: [
4898
+ /* @__PURE__ */ jsx27(CommandEmpty, { className: "py-3 text-xs text-muted-foreground", children: "No matches" }),
4899
+ /* @__PURE__ */ jsxs18(CommandGroup, { children: [
4900
+ /* @__PURE__ */ jsx27(
4815
4901
  CommandItem,
4816
4902
  {
4817
4903
  value: "__all__",
@@ -4822,7 +4908,7 @@ function SearchableSelectFilter({
4822
4908
  ),
4823
4909
  filtered.map((o) => {
4824
4910
  const active = selected.includes(o.value);
4825
- return /* @__PURE__ */ jsxs17(
4911
+ return /* @__PURE__ */ jsxs18(
4826
4912
  CommandItem,
4827
4913
  {
4828
4914
  value: o.value,
@@ -4832,7 +4918,7 @@ function SearchableSelectFilter({
4832
4918
  active && "bg-accent text-accent-foreground"
4833
4919
  ),
4834
4920
  children: [
4835
- /* @__PURE__ */ jsx25(
4921
+ /* @__PURE__ */ jsx27(
4836
4922
  "span",
4837
4923
  {
4838
4924
  className: cn(
@@ -4840,7 +4926,7 @@ function SearchableSelectFilter({
4840
4926
  single ? "rounded-full" : "rounded-sm",
4841
4927
  active ? "border-primary bg-primary text-primary-foreground" : "border-muted-foreground/40"
4842
4928
  ),
4843
- children: active && /* @__PURE__ */ jsx25(Check, { className: "h-2.5 w-2.5" })
4929
+ children: active && /* @__PURE__ */ jsx27(Check, { className: "h-2.5 w-2.5" })
4844
4930
  }
4845
4931
  ),
4846
4932
  o.label
@@ -4871,10 +4957,10 @@ function NumberFilterBody({
4871
4957
  }
4872
4958
  onChange({ kind: "number", min: nextMin, max: nextMax });
4873
4959
  };
4874
- return /* @__PURE__ */ jsxs17("div", { className: "space-y-1.5 px-1", children: [
4875
- /* @__PURE__ */ jsxs17("div", { className: "flex items-center justify-between", children: [
4876
- /* @__PURE__ */ jsx25("p", { className: "text-[11px] font-medium uppercase tracking-wider text-muted-foreground", children: "Range" }),
4877
- (min !== void 0 || max !== void 0) && /* @__PURE__ */ jsx25(
4960
+ return /* @__PURE__ */ jsxs18("div", { className: "space-y-1.5 px-1", children: [
4961
+ /* @__PURE__ */ jsxs18("div", { className: "flex items-center justify-between", children: [
4962
+ /* @__PURE__ */ jsx27("p", { className: "text-[11px] font-medium uppercase tracking-wider text-muted-foreground", children: "Range" }),
4963
+ (min !== void 0 || max !== void 0) && /* @__PURE__ */ jsx27(
4878
4964
  "button",
4879
4965
  {
4880
4966
  type: "button",
@@ -4888,8 +4974,8 @@ function NumberFilterBody({
4888
4974
  }
4889
4975
  )
4890
4976
  ] }),
4891
- /* @__PURE__ */ jsxs17("div", { className: "flex items-center gap-1.5", children: [
4892
- /* @__PURE__ */ jsx25(
4977
+ /* @__PURE__ */ jsxs18("div", { className: "flex items-center gap-1.5", children: [
4978
+ /* @__PURE__ */ jsx27(
4893
4979
  Input,
4894
4980
  {
4895
4981
  "data-matrx-filter-autofocus": true,
@@ -4904,8 +4990,8 @@ function NumberFilterBody({
4904
4990
  style: { fontSize: "16px" }
4905
4991
  }
4906
4992
  ),
4907
- /* @__PURE__ */ jsx25("span", { className: "text-xs text-muted-foreground", children: "\u2013" }),
4908
- /* @__PURE__ */ jsx25(
4993
+ /* @__PURE__ */ jsx27("span", { className: "text-xs text-muted-foreground", children: "\u2013" }),
4994
+ /* @__PURE__ */ jsx27(
4909
4995
  Input,
4910
4996
  {
4911
4997
  value: maxText,
@@ -4932,7 +5018,7 @@ function parseOptionalNumber(raw) {
4932
5018
  import { useEffect as useEffect7, useMemo as useMemo4, useState as useState10 } from "react";
4933
5019
  import { useDndMonitor, useDraggable as useDraggable2, useDroppable } from "@dnd-kit/core";
4934
5020
  init_filter_engine();
4935
- import { jsx as jsx26, jsxs as jsxs18 } from "react/jsx-runtime";
5021
+ import { jsx as jsx28, jsxs as jsxs19 } from "react/jsx-runtime";
4936
5022
  function ColumnManager({
4937
5023
  open,
4938
5024
  onOpenChange,
@@ -5006,18 +5092,18 @@ function ColumnManager({
5006
5092
  if (target) moveTo(dragged, String(target));
5007
5093
  }
5008
5094
  });
5009
- return /* @__PURE__ */ jsx26(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxs18(DialogContent, { className: "max-w-md", children: [
5010
- /* @__PURE__ */ jsxs18(DialogHeader, { children: [
5011
- /* @__PURE__ */ jsx26(DialogTitle, { children: "Columns" }),
5012
- /* @__PURE__ */ jsx26(DialogDescription, { children: "Choose the columns to show and set their order." })
5095
+ return /* @__PURE__ */ jsx28(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxs19(DialogContent, { className: "max-w-md", children: [
5096
+ /* @__PURE__ */ jsxs19(DialogHeader, { children: [
5097
+ /* @__PURE__ */ jsx28(DialogTitle, { children: "Columns" }),
5098
+ /* @__PURE__ */ jsx28(DialogDescription, { children: "Choose the columns to show and set their order." })
5013
5099
  ] }),
5014
- /* @__PURE__ */ jsx26("div", { className: "max-h-[55dvh] divide-y overflow-y-auto rounded-md border", children: draftOrder.map((id, index) => {
5100
+ /* @__PURE__ */ jsx28("div", { className: "max-h-[55dvh] divide-y overflow-y-auto rounded-md border", children: draftOrder.map((id, index) => {
5015
5101
  const column = byId.get(id);
5016
5102
  if (!column) return null;
5017
5103
  const label = typeof column.header === "string" ? column.header : id;
5018
5104
  const hideable = column.hideable !== false;
5019
5105
  const visible = !draftHidden.has(id);
5020
- return /* @__PURE__ */ jsxs18(
5106
+ return /* @__PURE__ */ jsxs19(
5021
5107
  ColumnManagerDropTarget,
5022
5108
  {
5023
5109
  id,
@@ -5027,8 +5113,8 @@ function ColumnManager({
5027
5113
  dropTarget === id && draggedColumnId !== id && "border-t-2 border-primary"
5028
5114
  ),
5029
5115
  children: [
5030
- /* @__PURE__ */ jsx26(ColumnManagerDragHandle, { id, label }),
5031
- /* @__PURE__ */ jsx26(
5116
+ /* @__PURE__ */ jsx28(ColumnManagerDragHandle, { id, label }),
5117
+ /* @__PURE__ */ jsx28(
5032
5118
  Checkbox,
5033
5119
  {
5034
5120
  checked: visible,
@@ -5045,8 +5131,8 @@ function ColumnManager({
5045
5131
  }
5046
5132
  }
5047
5133
  ),
5048
- /* @__PURE__ */ jsx26("span", { className: "min-w-0 flex-1 truncate text-sm", children: label }),
5049
- /* @__PURE__ */ jsx26(
5134
+ /* @__PURE__ */ jsx28("span", { className: "min-w-0 flex-1 truncate text-sm", children: label }),
5135
+ /* @__PURE__ */ jsx28(
5050
5136
  Button,
5051
5137
  {
5052
5138
  type: "button",
@@ -5056,10 +5142,10 @@ function ColumnManager({
5056
5142
  "aria-label": `Move ${label} earlier`,
5057
5143
  disabled: index === 0,
5058
5144
  onClick: () => move(id, -1),
5059
- children: /* @__PURE__ */ jsx26(ArrowUp, { className: "h-4 w-4" })
5145
+ children: /* @__PURE__ */ jsx28(ArrowUp, { className: "h-4 w-4" })
5060
5146
  }
5061
5147
  ),
5062
- /* @__PURE__ */ jsx26(
5148
+ /* @__PURE__ */ jsx28(
5063
5149
  Button,
5064
5150
  {
5065
5151
  type: "button",
@@ -5069,7 +5155,7 @@ function ColumnManager({
5069
5155
  "aria-label": `Move ${label} later`,
5070
5156
  disabled: index === draftOrder.length - 1,
5071
5157
  onClick: () => move(id, 1),
5072
- children: /* @__PURE__ */ jsx26(ArrowDown, { className: "h-4 w-4" })
5158
+ children: /* @__PURE__ */ jsx28(ArrowDown, { className: "h-4 w-4" })
5073
5159
  }
5074
5160
  )
5075
5161
  ]
@@ -5077,9 +5163,9 @@ function ColumnManager({
5077
5163
  id
5078
5164
  );
5079
5165
  }) }),
5080
- /* @__PURE__ */ jsxs18(DialogFooter, { children: [
5081
- /* @__PURE__ */ jsx26(Button, { type: "button", variant: "outline", onClick: () => onOpenChange(false), children: "Cancel" }),
5082
- /* @__PURE__ */ jsx26(
5166
+ /* @__PURE__ */ jsxs19(DialogFooter, { children: [
5167
+ /* @__PURE__ */ jsx28(Button, { type: "button", variant: "outline", onClick: () => onOpenChange(false), children: "Cancel" }),
5168
+ /* @__PURE__ */ jsx28(
5083
5169
  Button,
5084
5170
  {
5085
5171
  type: "button",
@@ -5102,14 +5188,14 @@ function ColumnManagerDropTarget({
5102
5188
  id: `matrx-column-manager:${id}`,
5103
5189
  data: { matrxDragKind: "column-manager", columnId: id }
5104
5190
  });
5105
- return /* @__PURE__ */ jsx26("div", { ref: setNodeRef, "data-matrx-column-manager-drop-target": id, className, children });
5191
+ return /* @__PURE__ */ jsx28("div", { ref: setNodeRef, "data-matrx-column-manager-drop-target": id, className, children });
5106
5192
  }
5107
5193
  function ColumnManagerDragHandle({ id, label }) {
5108
5194
  const { attributes, listeners, setNodeRef } = useDraggable2({
5109
5195
  id: `matrx-column-manager:${id}`,
5110
5196
  data: { matrxDragKind: "column-manager", columnId: id }
5111
5197
  });
5112
- return /* @__PURE__ */ jsx26(
5198
+ return /* @__PURE__ */ jsx28(
5113
5199
  "button",
5114
5200
  {
5115
5201
  ref: setNodeRef,
@@ -5119,7 +5205,7 @@ function ColumnManagerDragHandle({ id, label }) {
5119
5205
  title: `Drag to reorder ${label}`,
5120
5206
  ...attributes,
5121
5207
  ...listeners,
5122
- children: /* @__PURE__ */ jsx26(GripVertical, { className: "h-4 w-4" })
5208
+ children: /* @__PURE__ */ jsx28(GripVertical, { className: "h-4 w-4" })
5123
5209
  }
5124
5210
  );
5125
5211
  }
@@ -5130,35 +5216,7 @@ import {
5130
5216
  useRef as useRef5,
5131
5217
  useState as useState11
5132
5218
  } from "react";
5133
-
5134
- // src/tooltip.tsx
5135
- import * as TooltipPrimitive from "@radix-ui/react-tooltip";
5136
- import * as React16 from "react";
5137
- import { jsx as jsx27 } from "react/jsx-runtime";
5138
- var TooltipProvider = TooltipPrimitive.Provider;
5139
- var Tooltip = TooltipPrimitive.Root;
5140
- var TooltipTrigger = TooltipPrimitive.Trigger;
5141
- var TooltipContent = React16.forwardRef(({ className, sideOffset = 4, container, animated = true, ...props }, ref) => {
5142
- const resolved = usePortalContainer(container);
5143
- return /* @__PURE__ */ jsx27(TooltipPrimitive.Portal, { container: resolved ?? null, children: /* @__PURE__ */ jsx27(
5144
- TooltipPrimitive.Content,
5145
- {
5146
- ref,
5147
- "data-slot": "tooltip-content",
5148
- sideOffset,
5149
- className: cn(
5150
- "z-[10001] overflow-hidden rounded-md border border-border bg-popover px-3 py-1.5 text-xs text-popover-foreground shadow-md",
5151
- animated && MOTION_POPPER,
5152
- className
5153
- ),
5154
- ...props
5155
- }
5156
- ) });
5157
- });
5158
- TooltipContent.displayName = TooltipPrimitive.Content.displayName;
5159
-
5160
- // src/data-table/MatrxUuidCell.tsx
5161
- import { jsx as jsx28, jsxs as jsxs19 } from "react/jsx-runtime";
5219
+ import { jsx as jsx29, jsxs as jsxs20 } from "react/jsx-runtime";
5162
5220
  var SHORT_LEN = 8;
5163
5221
  function shortUuid(id, len = SHORT_LEN) {
5164
5222
  return id.slice(0, len);
@@ -5208,7 +5266,7 @@ function MatrxUuidCell({
5208
5266
  []
5209
5267
  );
5210
5268
  if (!value) {
5211
- return /* @__PURE__ */ jsx28("span", { className: "text-muted-foreground/40", children: "\u2014" });
5269
+ return /* @__PURE__ */ jsx29("span", { className: "text-muted-foreground/40", children: "\u2014" });
5212
5270
  }
5213
5271
  const doors = token ? resolveEntityDoors?.(token, value, href) ?? null : null;
5214
5272
  const resolvedHref = doors?.href ?? href ?? null;
@@ -5251,13 +5309,13 @@ function MatrxUuidCell({
5251
5309
  };
5252
5310
  const idNode = (() => {
5253
5311
  if (forbidden) {
5254
- return /* @__PURE__ */ jsxs19("span", { className: "inline-flex min-w-0 items-center gap-1 font-mono text-xs text-muted-foreground/70 tabular-nums", children: [
5255
- /* @__PURE__ */ jsx28("span", { className: "min-w-0 truncate", children: display }),
5256
- /* @__PURE__ */ jsx28(ShieldOff, { className: "h-3 w-3 shrink-0 opacity-60", "aria-hidden": true })
5312
+ return /* @__PURE__ */ jsxs20("span", { className: "inline-flex min-w-0 items-center gap-1 font-mono text-xs text-muted-foreground/70 tabular-nums", children: [
5313
+ /* @__PURE__ */ jsx29("span", { className: "min-w-0 truncate", children: display }),
5314
+ /* @__PURE__ */ jsx29(ShieldOff, { className: "h-3 w-3 shrink-0 opacity-60", "aria-hidden": true })
5257
5315
  ] });
5258
5316
  }
5259
5317
  if (onOpen) {
5260
- return /* @__PURE__ */ jsxs19(
5318
+ return /* @__PURE__ */ jsxs20(
5261
5319
  "button",
5262
5320
  {
5263
5321
  type: "button",
@@ -5266,14 +5324,14 @@ function MatrxUuidCell({
5266
5324
  disabled: opening,
5267
5325
  className: "inline-flex min-w-0 items-center gap-1 font-mono text-xs text-sky-600 hover:underline dark:text-sky-400 disabled:opacity-60",
5268
5326
  children: [
5269
- /* @__PURE__ */ jsx28("span", { className: "min-w-0 truncate tabular-nums", children: display }),
5270
- /* @__PURE__ */ jsx28(PanelRight, { className: "h-3 w-3 shrink-0 opacity-50" })
5327
+ /* @__PURE__ */ jsx29("span", { className: "min-w-0 truncate tabular-nums", children: display }),
5328
+ /* @__PURE__ */ jsx29(PanelRight, { className: "h-3 w-3 shrink-0 opacity-50" })
5271
5329
  ]
5272
5330
  }
5273
5331
  );
5274
5332
  }
5275
5333
  if (resolvedHref) {
5276
- return /* @__PURE__ */ jsxs19(
5334
+ return /* @__PURE__ */ jsxs20(
5277
5335
  "a",
5278
5336
  {
5279
5337
  href: resolvedHref,
@@ -5283,15 +5341,15 @@ function MatrxUuidCell({
5283
5341
  onClick: stop,
5284
5342
  className: "inline-flex min-w-0 items-center gap-1 font-mono text-xs text-sky-600 hover:underline dark:text-sky-400",
5285
5343
  children: [
5286
- /* @__PURE__ */ jsx28("span", { className: "min-w-0 truncate tabular-nums", children: display }),
5287
- /* @__PURE__ */ jsx28(ExternalLink, { className: "h-3 w-3 shrink-0 opacity-50" })
5344
+ /* @__PURE__ */ jsx29("span", { className: "min-w-0 truncate tabular-nums", children: display }),
5345
+ /* @__PURE__ */ jsx29(ExternalLink, { className: "h-3 w-3 shrink-0 opacity-50" })
5288
5346
  ]
5289
5347
  }
5290
5348
  );
5291
5349
  }
5292
- return /* @__PURE__ */ jsx28("span", { className: "min-w-0 truncate font-mono text-xs text-muted-foreground tabular-nums select-all", children: display });
5350
+ return /* @__PURE__ */ jsx29("span", { className: "min-w-0 truncate font-mono text-xs text-muted-foreground tabular-nums select-all", children: display });
5293
5351
  })();
5294
- return /* @__PURE__ */ jsxs19(
5352
+ return /* @__PURE__ */ jsxs20(
5295
5353
  "span",
5296
5354
  {
5297
5355
  "data-matrx-cell-control": true,
@@ -5301,11 +5359,11 @@ function MatrxUuidCell({
5301
5359
  ),
5302
5360
  onClick: stop,
5303
5361
  children: [
5304
- /* @__PURE__ */ jsx28(TooltipProvider, { delayDuration: 200, children: /* @__PURE__ */ jsxs19(Tooltip, { children: [
5305
- /* @__PURE__ */ jsx28(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx28("span", { className: "inline-flex min-w-0 max-w-full items-center", children: idNode }) }),
5306
- /* @__PURE__ */ jsx28(TooltipContent, { side: "top", className: "max-w-sm break-all font-mono", children: forbidden ? `No access \xB7 ${tip}` : tip })
5362
+ /* @__PURE__ */ jsx29(TooltipProvider, { delayDuration: 200, children: /* @__PURE__ */ jsxs20(Tooltip, { children: [
5363
+ /* @__PURE__ */ jsx29(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx29("span", { className: "inline-flex min-w-0 max-w-full items-center", children: idNode }) }),
5364
+ /* @__PURE__ */ jsx29(TooltipContent, { side: "top", className: "max-w-sm break-all font-mono", children: forbidden ? `No access \xB7 ${tip}` : tip })
5307
5365
  ] }) }),
5308
- /* @__PURE__ */ jsx28(
5366
+ /* @__PURE__ */ jsx29(
5309
5367
  "button",
5310
5368
  {
5311
5369
  type: "button",
@@ -5316,10 +5374,10 @@ function MatrxUuidCell({
5316
5374
  "inline-flex h-4 w-4 shrink-0 items-center justify-center rounded text-muted-foreground transition-colors hover:text-foreground focus:outline-none",
5317
5375
  copied && "text-primary"
5318
5376
  ),
5319
- children: copied ? /* @__PURE__ */ jsx28(Check, { className: "h-3 w-3" }) : /* @__PURE__ */ jsx28(Copy, { className: "h-3 w-3" })
5377
+ children: copied ? /* @__PURE__ */ jsx29(Check, { className: "h-3 w-3" }) : /* @__PURE__ */ jsx29(Copy, { className: "h-3 w-3" })
5320
5378
  }
5321
5379
  ),
5322
- canPeek ? /* @__PURE__ */ jsx28(
5380
+ canPeek ? /* @__PURE__ */ jsx29(
5323
5381
  "button",
5324
5382
  {
5325
5383
  type: "button",
@@ -5330,10 +5388,10 @@ function MatrxUuidCell({
5330
5388
  "aria-label": `Quick look at ${label ?? "record"}`,
5331
5389
  title: `Quick look at ${label ?? "record"}`,
5332
5390
  className: "inline-flex h-4 w-4 shrink-0 items-center justify-center rounded text-muted-foreground transition-colors hover:text-foreground focus:outline-none",
5333
- children: /* @__PURE__ */ jsx28(Lightbulb, { className: "h-3 w-3" })
5391
+ children: /* @__PURE__ */ jsx29(Lightbulb, { className: "h-3 w-3" })
5334
5392
  }
5335
5393
  ) : null,
5336
- onOpen && resolvedHref && !forbidden ? /* @__PURE__ */ jsx28(
5394
+ onOpen && resolvedHref && !forbidden ? /* @__PURE__ */ jsx29(
5337
5395
  "a",
5338
5396
  {
5339
5397
  href: resolvedHref,
@@ -5343,12 +5401,12 @@ function MatrxUuidCell({
5343
5401
  "aria-label": `Open ${label ?? "record"} in a new tab`,
5344
5402
  title: `Open ${label ?? "record"} in a new tab`,
5345
5403
  className: "inline-flex h-4 w-4 shrink-0 items-center justify-center rounded text-muted-foreground transition-colors hover:text-foreground focus:outline-none",
5346
- children: /* @__PURE__ */ jsx28(ExternalLink, { className: "h-3 w-3" })
5404
+ children: /* @__PURE__ */ jsx29(ExternalLink, { className: "h-3 w-3" })
5347
5405
  }
5348
5406
  ) : null,
5349
5407
  trailing,
5350
5408
  notice,
5351
- canPeek && peekOpen && ResourcePeek ? /* @__PURE__ */ jsx28(
5409
+ canPeek && peekOpen && ResourcePeek ? /* @__PURE__ */ jsx29(
5352
5410
  ResourcePeek,
5353
5411
  {
5354
5412
  kind: doors?.peekKind ?? token ?? "record",
@@ -5371,7 +5429,7 @@ function tokenFromColumnName(name) {
5371
5429
  }
5372
5430
 
5373
5431
  // src/data-table/DataRowInspector.tsx
5374
- import { jsx as jsx29, jsxs as jsxs20 } from "react/jsx-runtime";
5432
+ import { jsx as jsx30, jsxs as jsxs21 } from "react/jsx-runtime";
5375
5433
  var noFieldToken = () => null;
5376
5434
  function formatValue(value) {
5377
5435
  if (value == null) return "\u2014";
@@ -5400,7 +5458,7 @@ function DataRowInspector({
5400
5458
  tokenForField = noFieldToken
5401
5459
  }) {
5402
5460
  const entries = isPlainObject(row) ? Object.entries(row) : [["value", row]];
5403
- const fieldButtons = (key, value) => fieldCopy ? /* @__PURE__ */ jsx29("div", { className: "absolute right-1 top-1 opacity-0 transition-opacity focus-within:opacity-100 group-hover/field:opacity-100", children: /* @__PURE__ */ jsx29(
5461
+ const fieldButtons = (key, value) => fieldCopy ? /* @__PURE__ */ jsx30("div", { className: "absolute right-1 top-1 opacity-0 transition-opacity focus-within:opacity-100 group-hover/field:opacity-100", children: /* @__PURE__ */ jsx30(
5404
5462
  CopyButtons,
5405
5463
  {
5406
5464
  size: "xs",
@@ -5415,21 +5473,21 @@ function DataRowInspector({
5415
5473
  })
5416
5474
  }
5417
5475
  ) }) : null;
5418
- return /* @__PURE__ */ jsxs20(
5476
+ return /* @__PURE__ */ jsxs21(
5419
5477
  "div",
5420
5478
  {
5421
5479
  className: cn("flex h-full min-h-0 flex-col overflow-hidden", className),
5422
5480
  children: [
5423
- title ? /* @__PURE__ */ jsx29("div", { className: "shrink-0 border-b border-border px-3 py-2 text-sm font-medium", children: title }) : null,
5424
- /* @__PURE__ */ jsx29("div", { className: "min-h-0 flex-1 overflow-auto p-3", children: /* @__PURE__ */ jsx29("dl", { className: "space-y-2", children: entries.map(([key, value]) => {
5481
+ title ? /* @__PURE__ */ jsx30("div", { className: "shrink-0 border-b border-border px-3 py-2 text-sm font-medium", children: title }) : null,
5482
+ /* @__PURE__ */ jsx30("div", { className: "min-h-0 flex-1 overflow-auto p-3", children: /* @__PURE__ */ jsx30("dl", { className: "space-y-2", children: entries.map(([key, value]) => {
5425
5483
  if (isUuidValue(value)) {
5426
- return /* @__PURE__ */ jsxs20(
5484
+ return /* @__PURE__ */ jsxs21(
5427
5485
  "div",
5428
5486
  {
5429
5487
  className: "group/field relative grid grid-cols-[minmax(7rem,9rem)_1fr] gap-2 rounded-md border border-border/60 bg-muted/20 px-2.5 py-2",
5430
5488
  children: [
5431
- /* @__PURE__ */ jsx29("dt", { className: "truncate text-[11px] font-medium uppercase tracking-wide text-muted-foreground", children: key }),
5432
- /* @__PURE__ */ jsx29("dd", { className: "min-w-0", children: /* @__PURE__ */ jsx29(
5489
+ /* @__PURE__ */ jsx30("dt", { className: "truncate text-[11px] font-medium uppercase tracking-wide text-muted-foreground", children: key }),
5490
+ /* @__PURE__ */ jsx30("dd", { className: "min-w-0", children: /* @__PURE__ */ jsx30(
5433
5491
  MatrxUuidCell,
5434
5492
  {
5435
5493
  value,
@@ -5444,13 +5502,13 @@ function DataRowInspector({
5444
5502
  }
5445
5503
  const formatted = formatValue(value);
5446
5504
  const multiline = formatted.includes("\n") || formatted.length > 80;
5447
- return /* @__PURE__ */ jsxs20(
5505
+ return /* @__PURE__ */ jsxs21(
5448
5506
  "div",
5449
5507
  {
5450
5508
  className: "group/field relative grid grid-cols-[minmax(7rem,9rem)_1fr] gap-2 rounded-md border border-border/60 bg-muted/20 py-2 pl-2.5 pr-12",
5451
5509
  children: [
5452
- /* @__PURE__ */ jsx29("dt", { className: "truncate text-[11px] font-medium uppercase tracking-wide text-muted-foreground", children: key }),
5453
- /* @__PURE__ */ jsx29(
5510
+ /* @__PURE__ */ jsx30("dt", { className: "truncate text-[11px] font-medium uppercase tracking-wide text-muted-foreground", children: key }),
5511
+ /* @__PURE__ */ jsx30(
5454
5512
  "dd",
5455
5513
  {
5456
5514
  className: cn(
@@ -5473,7 +5531,7 @@ function DataRowInspector({
5473
5531
 
5474
5532
  // src/data-table/DataRowWindow.tsx
5475
5533
  import { useEffect as useEffect9, useState as useState12 } from "react";
5476
- import { jsx as jsx30, jsxs as jsxs21 } from "react/jsx-runtime";
5534
+ import { jsx as jsx31, jsxs as jsxs22 } from "react/jsx-runtime";
5477
5535
  function DataRowWindow({
5478
5536
  isOpen,
5479
5537
  onClose,
@@ -5499,9 +5557,9 @@ function DataRowWindow({
5499
5557
  setTab(defaultTab ?? (hasEdit ? "edit" : "view"));
5500
5558
  }, [isOpen, windowId, hasEdit, defaultTab]);
5501
5559
  if (!isOpen) return null;
5502
- const viewBody = viewContent ?? /* @__PURE__ */ jsx30(DataRowInspector, { row });
5503
- const body = children ?? /* @__PURE__ */ jsx30("div", { className: "flex h-full min-h-0 flex-1 flex-col overflow-hidden", children: hasTabs ? tab === "edit" ? /* @__PURE__ */ jsx30("div", { className: "min-h-0 flex-1 overflow-y-auto", children: editContent }) : /* @__PURE__ */ jsx30("div", { className: "min-h-0 flex-1 overflow-y-auto", children: viewBody }) : /* @__PURE__ */ jsx30("div", { className: "min-h-0 flex-1 overflow-y-auto", children: viewBody }) });
5504
- return /* @__PURE__ */ jsx30(
5560
+ const viewBody = viewContent ?? /* @__PURE__ */ jsx31(DataRowInspector, { row });
5561
+ const body = children ?? /* @__PURE__ */ jsx31("div", { className: "flex h-full min-h-0 flex-1 flex-col overflow-hidden", children: hasTabs ? tab === "edit" ? /* @__PURE__ */ jsx31("div", { className: "min-h-0 flex-1 overflow-y-auto", children: editContent }) : /* @__PURE__ */ jsx31("div", { className: "min-h-0 flex-1 overflow-y-auto", children: viewBody }) : /* @__PURE__ */ jsx31("div", { className: "min-h-0 flex-1 overflow-y-auto", children: viewBody }) });
5562
+ return /* @__PURE__ */ jsx31(
5505
5563
  WindowPanel,
5506
5564
  {
5507
5565
  id: windowId,
@@ -5515,26 +5573,26 @@ function DataRowWindow({
5515
5573
  bodyClassName: "flex min-h-0 flex-1 flex-col overflow-hidden p-0",
5516
5574
  sidebarDefaultSize: 140,
5517
5575
  sidebarMinSize: 110,
5518
- sidebar: hasTabs ? /* @__PURE__ */ jsxs21(
5576
+ sidebar: hasTabs ? /* @__PURE__ */ jsxs22(
5519
5577
  "nav",
5520
5578
  {
5521
5579
  "aria-label": "Row window tabs",
5522
5580
  className: "flex h-full flex-col gap-0.5 overflow-y-auto p-1.5",
5523
5581
  children: [
5524
- /* @__PURE__ */ jsx30(
5582
+ /* @__PURE__ */ jsx31(
5525
5583
  TabButton,
5526
5584
  {
5527
5585
  active: tab === "view",
5528
- icon: /* @__PURE__ */ jsx30(Eye, { className: "h-4 w-4 shrink-0" }),
5586
+ icon: /* @__PURE__ */ jsx31(Eye, { className: "h-4 w-4 shrink-0" }),
5529
5587
  label: "View",
5530
5588
  onClick: () => setTab("view")
5531
5589
  }
5532
5590
  ),
5533
- /* @__PURE__ */ jsx30(
5591
+ /* @__PURE__ */ jsx31(
5534
5592
  TabButton,
5535
5593
  {
5536
5594
  active: tab === "edit",
5537
- icon: /* @__PURE__ */ jsx30(Pencil, { className: "h-4 w-4 shrink-0" }),
5595
+ icon: /* @__PURE__ */ jsx31(Pencil, { className: "h-4 w-4 shrink-0" }),
5538
5596
  label: "Edit",
5539
5597
  onClick: () => setTab("edit")
5540
5598
  }
@@ -5552,7 +5610,7 @@ function TabButton({
5552
5610
  label,
5553
5611
  onClick
5554
5612
  }) {
5555
- return /* @__PURE__ */ jsxs21(
5613
+ return /* @__PURE__ */ jsxs22(
5556
5614
  "button",
5557
5615
  {
5558
5616
  type: "button",
@@ -5565,14 +5623,14 @@ function TabButton({
5565
5623
  ),
5566
5624
  children: [
5567
5625
  icon,
5568
- /* @__PURE__ */ jsx30("span", { className: "min-w-0 flex-1 truncate", children: label })
5626
+ /* @__PURE__ */ jsx31("span", { className: "min-w-0 flex-1 truncate", children: label })
5569
5627
  ]
5570
5628
  }
5571
5629
  );
5572
5630
  }
5573
5631
 
5574
5632
  // src/data-table/DirtySavePill.tsx
5575
- import { jsx as jsx31, jsxs as jsxs22 } from "react/jsx-runtime";
5633
+ import { jsx as jsx32, jsxs as jsxs23 } from "react/jsx-runtime";
5576
5634
  function DirtySavePill({
5577
5635
  changeCount,
5578
5636
  saving,
@@ -5581,20 +5639,20 @@ function DirtySavePill({
5581
5639
  className
5582
5640
  }) {
5583
5641
  if (changeCount <= 0) return null;
5584
- return /* @__PURE__ */ jsx31(
5642
+ return /* @__PURE__ */ jsx32(
5585
5643
  "div",
5586
5644
  {
5587
5645
  className: cn(
5588
5646
  "pointer-events-none fixed inset-x-0 bottom-6 z-50 flex justify-center pb-safe",
5589
5647
  className
5590
5648
  ),
5591
- children: /* @__PURE__ */ jsxs22("div", { className: "pointer-events-auto flex items-center gap-2 rounded-full border border-border bg-card px-3 py-1.5 shadow-lg elevation-2", children: [
5592
- /* @__PURE__ */ jsxs22("span", { className: "px-1 text-xs font-medium text-muted-foreground", children: [
5649
+ children: /* @__PURE__ */ jsxs23("div", { className: "pointer-events-auto flex items-center gap-2 rounded-full border border-border bg-card px-3 py-1.5 shadow-lg elevation-2", children: [
5650
+ /* @__PURE__ */ jsxs23("span", { className: "px-1 text-xs font-medium text-muted-foreground", children: [
5593
5651
  changeCount,
5594
5652
  " unsaved change",
5595
5653
  changeCount === 1 ? "" : "s"
5596
5654
  ] }),
5597
- /* @__PURE__ */ jsxs22(
5655
+ /* @__PURE__ */ jsxs23(
5598
5656
  Button,
5599
5657
  {
5600
5658
  type: "button",
@@ -5604,12 +5662,12 @@ function DirtySavePill({
5604
5662
  disabled: saving,
5605
5663
  onClick: onCancel,
5606
5664
  children: [
5607
- /* @__PURE__ */ jsx31(X, { className: "h-3.5 w-3.5" }),
5665
+ /* @__PURE__ */ jsx32(X, { className: "h-3.5 w-3.5" }),
5608
5666
  "Cancel"
5609
5667
  ]
5610
5668
  }
5611
5669
  ),
5612
- /* @__PURE__ */ jsxs22(
5670
+ /* @__PURE__ */ jsxs23(
5613
5671
  Button,
5614
5672
  {
5615
5673
  type: "button",
@@ -5618,7 +5676,7 @@ function DirtySavePill({
5618
5676
  disabled: saving,
5619
5677
  onClick: onSave,
5620
5678
  children: [
5621
- saving ? /* @__PURE__ */ jsx31(Loader2, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ jsx31(Save, { className: "h-3.5 w-3.5" }),
5679
+ saving ? /* @__PURE__ */ jsx32(Loader2, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ jsx32(Save, { className: "h-3.5 w-3.5" }),
5622
5680
  "Save"
5623
5681
  ]
5624
5682
  }
@@ -5631,7 +5689,7 @@ function DirtySavePill({
5631
5689
  // src/data-table/EditableTableCell.tsx
5632
5690
  import { useState as useState13 } from "react";
5633
5691
  init_filter_engine();
5634
- import { jsx as jsx32, jsxs as jsxs23 } from "react/jsx-runtime";
5692
+ import { jsx as jsx33, jsxs as jsxs24 } from "react/jsx-runtime";
5635
5693
  function CellEditShell({
5636
5694
  href,
5637
5695
  display,
@@ -5640,8 +5698,8 @@ function CellEditShell({
5640
5698
  editButton
5641
5699
  }) {
5642
5700
  const { Link: HostLink } = useMatrxDataTableHost();
5643
- const Link = HostLink ?? ((props) => /* @__PURE__ */ jsx32("a", { ...props }));
5644
- return /* @__PURE__ */ jsxs23(
5701
+ const Link = HostLink ?? ((props) => /* @__PURE__ */ jsx33("a", { ...props }));
5702
+ return /* @__PURE__ */ jsxs24(
5645
5703
  "span",
5646
5704
  {
5647
5705
  className: cn(
@@ -5653,7 +5711,7 @@ function CellEditShell({
5653
5711
  className
5654
5712
  ),
5655
5713
  children: [
5656
- href ? /* @__PURE__ */ jsx32(
5714
+ href ? /* @__PURE__ */ jsx33(
5657
5715
  Link,
5658
5716
  {
5659
5717
  href,
@@ -5661,7 +5719,7 @@ function CellEditShell({
5661
5719
  className: "min-w-0 flex-1 overflow-hidden truncate rounded outline-none focus-visible:ring-2 focus-visible:ring-ring",
5662
5720
  children: display
5663
5721
  }
5664
- ) : /* @__PURE__ */ jsx32("span", { className: "block min-w-0 flex-1 overflow-hidden", children: display }),
5722
+ ) : /* @__PURE__ */ jsx33("span", { className: "block min-w-0 flex-1 overflow-hidden", children: display }),
5665
5723
  editButton
5666
5724
  ]
5667
5725
  }
@@ -5682,7 +5740,7 @@ function EditableTableCell({
5682
5740
  const [open, setOpen] = useState13(false);
5683
5741
  const usePencil = Boolean(href) || editTrigger === "pencil";
5684
5742
  if (editType === "string") {
5685
- return /* @__PURE__ */ jsx32(
5743
+ return /* @__PURE__ */ jsx33(
5686
5744
  InlineStringEditor,
5687
5745
  {
5688
5746
  value: stringifyCellValue(value),
@@ -5695,15 +5753,15 @@ function EditableTableCell({
5695
5753
  }
5696
5754
  );
5697
5755
  }
5698
- return /* @__PURE__ */ jsxs23(Popover, { open, onOpenChange: setOpen, children: [
5699
- usePencil ? /* @__PURE__ */ jsx32(
5756
+ return /* @__PURE__ */ jsxs24(Popover, { open, onOpenChange: setOpen, children: [
5757
+ usePencil ? /* @__PURE__ */ jsx33(
5700
5758
  CellEditShell,
5701
5759
  {
5702
5760
  ...href === void 0 ? {} : { href },
5703
5761
  display,
5704
5762
  ...dirty === void 0 ? {} : { dirty },
5705
5763
  ...className === void 0 ? {} : { className },
5706
- editButton: /* @__PURE__ */ jsx32(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx32(
5764
+ editButton: /* @__PURE__ */ jsx33(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx33(
5707
5765
  "button",
5708
5766
  {
5709
5767
  type: "button",
@@ -5711,11 +5769,11 @@ function EditableTableCell({
5711
5769
  title: "Edit",
5712
5770
  onClick: (e) => e.stopPropagation(),
5713
5771
  className: CELL_PENCIL_CLASS,
5714
- children: /* @__PURE__ */ jsx32(Pencil, { className: "h-3 w-3" })
5772
+ children: /* @__PURE__ */ jsx33(Pencil, { className: "h-3 w-3" })
5715
5773
  }
5716
5774
  ) })
5717
5775
  }
5718
- ) : /* @__PURE__ */ jsx32(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs23(
5776
+ ) : /* @__PURE__ */ jsx33(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs24(
5719
5777
  "button",
5720
5778
  {
5721
5779
  type: "button",
@@ -5727,18 +5785,18 @@ function EditableTableCell({
5727
5785
  ),
5728
5786
  title: "Edit",
5729
5787
  children: [
5730
- /* @__PURE__ */ jsx32("span", { className: "min-w-0 flex-1 overflow-hidden", children: display }),
5731
- editType === "select" ? /* @__PURE__ */ jsx32(ChevronDown, { className: "h-3 w-3 shrink-0 text-muted-foreground/70 transition-colors group-hover/cell-select:text-foreground" }) : null
5788
+ /* @__PURE__ */ jsx33("span", { className: "min-w-0 flex-1 overflow-hidden", children: display }),
5789
+ editType === "select" ? /* @__PURE__ */ jsx33(ChevronDown, { className: "h-3 w-3 shrink-0 text-muted-foreground/70 transition-colors group-hover/cell-select:text-foreground" }) : null
5732
5790
  ]
5733
5791
  }
5734
5792
  ) }),
5735
- /* @__PURE__ */ jsx32(
5793
+ /* @__PURE__ */ jsx33(
5736
5794
  PopoverContent,
5737
5795
  {
5738
5796
  align: "start",
5739
5797
  className: "w-56 p-2",
5740
5798
  onClick: (e) => e.stopPropagation(),
5741
- children: /* @__PURE__ */ jsx32(
5799
+ children: /* @__PURE__ */ jsx33(
5742
5800
  TypedEditor,
5743
5801
  {
5744
5802
  editType,
@@ -5768,14 +5826,14 @@ function InlineStringEditor({
5768
5826
  const [draft, setDraft] = useState13(value);
5769
5827
  if (!editing) {
5770
5828
  if (usePencil) {
5771
- return /* @__PURE__ */ jsx32(
5829
+ return /* @__PURE__ */ jsx33(
5772
5830
  CellEditShell,
5773
5831
  {
5774
5832
  ...href === void 0 ? {} : { href },
5775
5833
  display,
5776
5834
  ...dirty === void 0 ? {} : { dirty },
5777
5835
  ...className === void 0 ? {} : { className },
5778
- editButton: /* @__PURE__ */ jsx32(
5836
+ editButton: /* @__PURE__ */ jsx33(
5779
5837
  "button",
5780
5838
  {
5781
5839
  type: "button",
@@ -5787,13 +5845,13 @@ function InlineStringEditor({
5787
5845
  setEditing(true);
5788
5846
  },
5789
5847
  className: CELL_PENCIL_CLASS,
5790
- children: /* @__PURE__ */ jsx32(Pencil, { className: "h-3 w-3" })
5848
+ children: /* @__PURE__ */ jsx33(Pencil, { className: "h-3 w-3" })
5791
5849
  }
5792
5850
  )
5793
5851
  }
5794
5852
  );
5795
5853
  }
5796
- return /* @__PURE__ */ jsx32(
5854
+ return /* @__PURE__ */ jsx33(
5797
5855
  "button",
5798
5856
  {
5799
5857
  type: "button",
@@ -5812,7 +5870,7 @@ function InlineStringEditor({
5812
5870
  }
5813
5871
  );
5814
5872
  }
5815
- return /* @__PURE__ */ jsx32(
5873
+ return /* @__PURE__ */ jsx33(
5816
5874
  Input,
5817
5875
  {
5818
5876
  autoFocus: true,
@@ -5848,9 +5906,9 @@ function TypedEditor({
5848
5906
  }) {
5849
5907
  if (editType === "boolean") {
5850
5908
  const checked = Boolean(value);
5851
- return /* @__PURE__ */ jsxs23("div", { className: "flex items-center justify-between gap-2", children: [
5852
- /* @__PURE__ */ jsx32("span", { className: "text-xs font-medium", children: "Value" }),
5853
- /* @__PURE__ */ jsx32(
5909
+ return /* @__PURE__ */ jsxs24("div", { className: "flex items-center justify-between gap-2", children: [
5910
+ /* @__PURE__ */ jsx33("span", { className: "text-xs font-medium", children: "Value" }),
5911
+ /* @__PURE__ */ jsx33(
5854
5912
  Checkbox,
5855
5913
  {
5856
5914
  checked,
@@ -5860,7 +5918,7 @@ function TypedEditor({
5860
5918
  ] });
5861
5919
  }
5862
5920
  if (editType === "number") {
5863
- return /* @__PURE__ */ jsx32(
5921
+ return /* @__PURE__ */ jsx33(
5864
5922
  NumberEditor,
5865
5923
  {
5866
5924
  value: typeof value === "number" ? value : Number(value) || 0,
@@ -5870,7 +5928,7 @@ function TypedEditor({
5870
5928
  );
5871
5929
  }
5872
5930
  if (editType === "tags") {
5873
- return /* @__PURE__ */ jsx32(
5931
+ return /* @__PURE__ */ jsx33(
5874
5932
  TagsEditor,
5875
5933
  {
5876
5934
  value: Array.isArray(value) ? value.map(String) : [],
@@ -5881,19 +5939,19 @@ function TypedEditor({
5881
5939
  );
5882
5940
  }
5883
5941
  if (editType === "select") {
5884
- return /* @__PURE__ */ jsxs23(
5942
+ return /* @__PURE__ */ jsxs24(
5885
5943
  Select,
5886
5944
  {
5887
5945
  value: stringifyCellValue(value),
5888
5946
  onValueChange: (v) => onCommit(v),
5889
5947
  children: [
5890
- /* @__PURE__ */ jsx32(SelectTrigger, { className: "h-8 text-xs", children: /* @__PURE__ */ jsx32(SelectValue, {}) }),
5891
- /* @__PURE__ */ jsx32(SelectContent, { children: editOptions.map((o) => /* @__PURE__ */ jsx32(SelectItem, { value: o.value, children: o.label }, o.value)) })
5948
+ /* @__PURE__ */ jsx33(SelectTrigger, { className: "h-8 text-xs", children: /* @__PURE__ */ jsx33(SelectValue, {}) }),
5949
+ /* @__PURE__ */ jsx33(SelectContent, { children: editOptions.map((o) => /* @__PURE__ */ jsx33(SelectItem, { value: o.value, children: o.label }, o.value)) })
5892
5950
  ]
5893
5951
  }
5894
5952
  );
5895
5953
  }
5896
- return /* @__PURE__ */ jsx32(
5954
+ return /* @__PURE__ */ jsx33(
5897
5955
  Input,
5898
5956
  {
5899
5957
  type: "date",
@@ -5923,10 +5981,10 @@ function TagsEditor({
5923
5981
  const matches = suggestions.filter(
5924
5982
  (s) => !tags.includes(s.value) && s.value !== "__none__" && (!draft || s.label.toLowerCase().includes(draft.trim().toLowerCase()))
5925
5983
  ).slice(0, 6);
5926
- return /* @__PURE__ */ jsxs23("div", { className: "space-y-2", onClick: (e) => e.stopPropagation(), children: [
5927
- /* @__PURE__ */ jsxs23("div", { className: "flex flex-wrap gap-1", children: [
5928
- tags.length === 0 && /* @__PURE__ */ jsx32("span", { className: "text-xs text-muted-foreground", children: "No tags" }),
5929
- tags.map((tag) => /* @__PURE__ */ jsxs23(
5984
+ return /* @__PURE__ */ jsxs24("div", { className: "space-y-2", onClick: (e) => e.stopPropagation(), children: [
5985
+ /* @__PURE__ */ jsxs24("div", { className: "flex flex-wrap gap-1", children: [
5986
+ tags.length === 0 && /* @__PURE__ */ jsx33("span", { className: "text-xs text-muted-foreground", children: "No tags" }),
5987
+ tags.map((tag) => /* @__PURE__ */ jsxs24(
5930
5988
  "button",
5931
5989
  {
5932
5990
  type: "button",
@@ -5935,13 +5993,13 @@ function TagsEditor({
5935
5993
  title: `Remove ${tag}`,
5936
5994
  children: [
5937
5995
  tag,
5938
- /* @__PURE__ */ jsx32(X, { className: "h-2.5 w-2.5" })
5996
+ /* @__PURE__ */ jsx33(X, { className: "h-2.5 w-2.5" })
5939
5997
  ]
5940
5998
  },
5941
5999
  tag
5942
6000
  ))
5943
6001
  ] }),
5944
- /* @__PURE__ */ jsx32(
6002
+ /* @__PURE__ */ jsx33(
5945
6003
  Input,
5946
6004
  {
5947
6005
  autoFocus: true,
@@ -5962,7 +6020,7 @@ function TagsEditor({
5962
6020
  className: "h-8 text-xs"
5963
6021
  }
5964
6022
  ),
5965
- matches.length > 0 && /* @__PURE__ */ jsx32("div", { className: "flex flex-wrap gap-1", children: matches.map((s) => /* @__PURE__ */ jsxs23(
6023
+ matches.length > 0 && /* @__PURE__ */ jsx33("div", { className: "flex flex-wrap gap-1", children: matches.map((s) => /* @__PURE__ */ jsxs24(
5966
6024
  "button",
5967
6025
  {
5968
6026
  type: "button",
@@ -5975,8 +6033,8 @@ function TagsEditor({
5975
6033
  },
5976
6034
  s.value
5977
6035
  )) }),
5978
- /* @__PURE__ */ jsxs23("div", { className: "flex justify-end gap-1 pt-1", children: [
5979
- /* @__PURE__ */ jsx32(
6036
+ /* @__PURE__ */ jsxs24("div", { className: "flex justify-end gap-1 pt-1", children: [
6037
+ /* @__PURE__ */ jsx33(
5980
6038
  Button,
5981
6039
  {
5982
6040
  size: "sm",
@@ -5984,17 +6042,17 @@ function TagsEditor({
5984
6042
  className: "h-7 px-2",
5985
6043
  "aria-label": "Cancel edit",
5986
6044
  onClick: onCancel,
5987
- children: /* @__PURE__ */ jsx32(X, { className: "h-3.5 w-3.5" })
6045
+ children: /* @__PURE__ */ jsx33(X, { className: "h-3.5 w-3.5" })
5988
6046
  }
5989
6047
  ),
5990
- /* @__PURE__ */ jsx32(
6048
+ /* @__PURE__ */ jsx33(
5991
6049
  Button,
5992
6050
  {
5993
6051
  size: "sm",
5994
6052
  className: "h-7 px-2",
5995
6053
  "aria-label": "Apply tags",
5996
6054
  onClick: () => onCommit(tags),
5997
- children: /* @__PURE__ */ jsx32(Check, { className: "h-3.5 w-3.5" })
6055
+ children: /* @__PURE__ */ jsx33(Check, { className: "h-3.5 w-3.5" })
5998
6056
  }
5999
6057
  )
6000
6058
  ] })
@@ -6006,8 +6064,8 @@ function NumberEditor({
6006
6064
  onCancel
6007
6065
  }) {
6008
6066
  const [draft, setDraft] = useState13(String(value));
6009
- return /* @__PURE__ */ jsxs23("div", { className: "flex flex-col gap-2", children: [
6010
- /* @__PURE__ */ jsx32(
6067
+ return /* @__PURE__ */ jsxs24("div", { className: "flex flex-col gap-2", children: [
6068
+ /* @__PURE__ */ jsx33(
6011
6069
  Input,
6012
6070
  {
6013
6071
  autoFocus: true,
@@ -6024,8 +6082,8 @@ function NumberEditor({
6024
6082
  }
6025
6083
  }
6026
6084
  ),
6027
- /* @__PURE__ */ jsxs23("div", { className: "flex justify-end gap-1", children: [
6028
- /* @__PURE__ */ jsx32(
6085
+ /* @__PURE__ */ jsxs24("div", { className: "flex justify-end gap-1", children: [
6086
+ /* @__PURE__ */ jsx33(
6029
6087
  Button,
6030
6088
  {
6031
6089
  type: "button",
@@ -6034,10 +6092,10 @@ function NumberEditor({
6034
6092
  className: "h-7",
6035
6093
  "aria-label": "Cancel edit",
6036
6094
  onClick: onCancel,
6037
- children: /* @__PURE__ */ jsx32(X, { className: "h-3.5 w-3.5" })
6095
+ children: /* @__PURE__ */ jsx33(X, { className: "h-3.5 w-3.5" })
6038
6096
  }
6039
6097
  ),
6040
- /* @__PURE__ */ jsx32(
6098
+ /* @__PURE__ */ jsx33(
6041
6099
  Button,
6042
6100
  {
6043
6101
  type: "button",
@@ -6048,7 +6106,7 @@ function NumberEditor({
6048
6106
  const n = Number(draft);
6049
6107
  if (Number.isFinite(n)) onCommit(n);
6050
6108
  },
6051
- children: /* @__PURE__ */ jsx32(Check, { className: "h-3.5 w-3.5" })
6109
+ children: /* @__PURE__ */ jsx33(Check, { className: "h-3.5 w-3.5" })
6052
6110
  }
6053
6111
  )
6054
6112
  ] })
@@ -6056,24 +6114,24 @@ function NumberEditor({
6056
6114
  }
6057
6115
 
6058
6116
  // src/data-table/ToolbarFacets.tsx
6059
- import { jsx as jsx33, jsxs as jsxs24 } from "react/jsx-runtime";
6117
+ import { jsx as jsx34, jsxs as jsxs25 } from "react/jsx-runtime";
6060
6118
  function ToolbarFacets({ facets }) {
6061
6119
  if (facets.length === 0) return null;
6062
- return /* @__PURE__ */ jsx33("div", { className: "flex flex-wrap items-center gap-2", children: facets.map((facet) => {
6120
+ return /* @__PURE__ */ jsx34("div", { className: "flex flex-wrap items-center gap-2", children: facets.map((facet) => {
6063
6121
  if (facet.type === "custom") {
6064
- return /* @__PURE__ */ jsx33("div", { children: facet.render() }, facet.id);
6122
+ return /* @__PURE__ */ jsx34("div", { children: facet.render() }, facet.id);
6065
6123
  }
6066
6124
  const defaultValue = facet.defaultValue ?? facet.options[0]?.value ?? "";
6067
6125
  const isNonDefault = facet.value !== defaultValue;
6068
- return /* @__PURE__ */ jsxs24(
6126
+ return /* @__PURE__ */ jsxs25(
6069
6127
  "div",
6070
6128
  {
6071
6129
  className: "flex flex-wrap items-center gap-1.5 max-sm:grid max-sm:w-full max-sm:grid-cols-3",
6072
6130
  children: [
6073
- facet.label ? /* @__PURE__ */ jsx33("span", { className: "mr-0.5 text-[11px] font-medium uppercase tracking-wide text-muted-foreground", children: facet.label }) : null,
6131
+ facet.label ? /* @__PURE__ */ jsx34("span", { className: "mr-0.5 text-[11px] font-medium uppercase tracking-wide text-muted-foreground", children: facet.label }) : null,
6074
6132
  facet.options.map((opt) => {
6075
6133
  const active = facet.value === opt.value;
6076
- return /* @__PURE__ */ jsxs24(
6134
+ return /* @__PURE__ */ jsxs25(
6077
6135
  Button,
6078
6136
  {
6079
6137
  type: "button",
@@ -6087,7 +6145,7 @@ function ToolbarFacets({ facets }) {
6087
6145
  children: [
6088
6146
  opt.icon,
6089
6147
  opt.label,
6090
- active && isNonDefault ? /* @__PURE__ */ jsx33(
6148
+ active && isNonDefault ? /* @__PURE__ */ jsx34(
6091
6149
  "span",
6092
6150
  {
6093
6151
  role: "button",
@@ -6106,7 +6164,7 @@ function ToolbarFacets({ facets }) {
6106
6164
  facet.onChange(defaultValue);
6107
6165
  }
6108
6166
  },
6109
- children: /* @__PURE__ */ jsx33(X, { className: "h-3 w-3" })
6167
+ children: /* @__PURE__ */ jsx34(X, { className: "h-3 w-3" })
6110
6168
  }
6111
6169
  ) : null
6112
6170
  ]
@@ -6132,7 +6190,7 @@ function resetToolbarFacets(facets) {
6132
6190
  // src/data-table/LayeredFilterBuilder.tsx
6133
6191
  import { useState as useState14 } from "react";
6134
6192
  init_layered_filters();
6135
- import { Fragment as Fragment5, jsx as jsx34, jsxs as jsxs25 } from "react/jsx-runtime";
6193
+ import { Fragment as Fragment5, jsx as jsx35, jsxs as jsxs26 } from "react/jsx-runtime";
6136
6194
  function moveRule(rules, from, to) {
6137
6195
  if (from === to || to < 0 || to >= rules.length) return [...rules];
6138
6196
  const next = [...rules];
@@ -6178,8 +6236,8 @@ function LayeredFilterBuilder({
6178
6236
  const reorder = (from, to) => {
6179
6237
  onChange(moveRule(rules, from, to));
6180
6238
  };
6181
- return /* @__PURE__ */ jsxs25("div", { className: "flex min-w-0 flex-wrap items-center gap-1", children: [
6182
- /* @__PURE__ */ jsxs25(
6239
+ return /* @__PURE__ */ jsxs26("div", { className: "flex min-w-0 flex-wrap items-center gap-1", children: [
6240
+ /* @__PURE__ */ jsxs26(
6183
6241
  Popover,
6184
6242
  {
6185
6243
  open,
@@ -6191,7 +6249,7 @@ function LayeredFilterBuilder({
6191
6249
  }
6192
6250
  },
6193
6251
  children: [
6194
- /* @__PURE__ */ jsx34(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs25(
6252
+ /* @__PURE__ */ jsx35(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs26(
6195
6253
  Button,
6196
6254
  {
6197
6255
  type: "button",
@@ -6200,25 +6258,25 @@ function LayeredFilterBuilder({
6200
6258
  className: "h-8 gap-1.5 px-2 text-xs",
6201
6259
  "aria-label": label,
6202
6260
  children: [
6203
- /* @__PURE__ */ jsx34(SlidersHorizontal, { className: "h-3.5 w-3.5" }),
6204
- /* @__PURE__ */ jsx34("span", { className: "hidden sm:inline", children: rules.length > 0 ? `${rules.length} layers` : "Advanced" }),
6205
- rules.length > 0 ? /* @__PURE__ */ jsx34("span", { className: "sm:hidden", children: rules.length }) : null
6261
+ /* @__PURE__ */ jsx35(SlidersHorizontal, { className: "h-3.5 w-3.5" }),
6262
+ /* @__PURE__ */ jsx35("span", { className: "hidden sm:inline", children: rules.length > 0 ? `${rules.length} layers` : "Advanced" }),
6263
+ rules.length > 0 ? /* @__PURE__ */ jsx35("span", { className: "sm:hidden", children: rules.length }) : null
6206
6264
  ]
6207
6265
  }
6208
6266
  ) }),
6209
- /* @__PURE__ */ jsxs25(
6267
+ /* @__PURE__ */ jsxs26(
6210
6268
  PopoverContent,
6211
6269
  {
6212
6270
  align: "start",
6213
6271
  sideOffset: 6,
6214
6272
  className: "w-[min(46rem,calc(100vw-1rem))] p-0",
6215
6273
  children: [
6216
- /* @__PURE__ */ jsxs25("div", { className: "flex items-start justify-between gap-3 border-b border-border px-3 py-2.5", children: [
6217
- /* @__PURE__ */ jsxs25("div", { children: [
6218
- /* @__PURE__ */ jsx34("p", { className: "text-sm font-semibold text-foreground", children: "Narrow these results" }),
6219
- /* @__PURE__ */ jsx34("p", { className: "text-xs text-muted-foreground", children: "Every layer must match. Drag layers to put them in the order that makes sense to you." })
6274
+ /* @__PURE__ */ jsxs26("div", { className: "flex items-start justify-between gap-3 border-b border-border px-3 py-2.5", children: [
6275
+ /* @__PURE__ */ jsxs26("div", { children: [
6276
+ /* @__PURE__ */ jsx35("p", { className: "text-sm font-semibold text-foreground", children: "Narrow these results" }),
6277
+ /* @__PURE__ */ jsx35("p", { className: "text-xs text-muted-foreground", children: "Every layer must match. Drag layers to put them in the order that makes sense to you." })
6220
6278
  ] }),
6221
- rules.length > 0 ? /* @__PURE__ */ jsx34(
6279
+ rules.length > 0 ? /* @__PURE__ */ jsx35(
6222
6280
  Button,
6223
6281
  {
6224
6282
  type: "button",
@@ -6230,10 +6288,10 @@ function LayeredFilterBuilder({
6230
6288
  }
6231
6289
  ) : null
6232
6290
  ] }),
6233
- /* @__PURE__ */ jsx34("div", { className: "max-h-[min(28rem,65dvh)] space-y-1.5 overflow-y-auto p-2.5 scrollbar-thin", children: rules.length === 0 ? /* @__PURE__ */ jsxs25("div", { className: "rounded-md border border-dashed border-border px-3 py-5 text-center", children: [
6234
- /* @__PURE__ */ jsx34("p", { className: "text-sm font-medium text-foreground", children: "Start with one simple layer" }),
6235
- /* @__PURE__ */ jsx34("p", { className: "mt-1 text-xs text-muted-foreground", children: "For example: Keyword contains ITAD, then Keyword doesn't have the word \u201Cwhat\u201D." })
6236
- ] }) : rules.map((rule, index) => /* @__PURE__ */ jsx34(
6291
+ /* @__PURE__ */ jsx35("div", { className: "max-h-[min(28rem,65dvh)] space-y-1.5 overflow-y-auto p-2.5 scrollbar-thin", children: rules.length === 0 ? /* @__PURE__ */ jsxs26("div", { className: "rounded-md border border-dashed border-border px-3 py-5 text-center", children: [
6292
+ /* @__PURE__ */ jsx35("p", { className: "text-sm font-medium text-foreground", children: "Start with one simple layer" }),
6293
+ /* @__PURE__ */ jsx35("p", { className: "mt-1 text-xs text-muted-foreground", children: "For example: Keyword contains ITAD, then Keyword doesn't have the word \u201Cwhat\u201D." })
6294
+ ] }) : rules.map((rule, index) => /* @__PURE__ */ jsx35(
6237
6295
  LayeredRuleRow,
6238
6296
  {
6239
6297
  index,
@@ -6253,9 +6311,9 @@ function LayeredFilterBuilder({
6253
6311
  },
6254
6312
  rule.id
6255
6313
  )) }),
6256
- /* @__PURE__ */ jsxs25("div", { className: "flex items-center justify-between gap-2 border-t border-border px-3 py-2", children: [
6257
- /* @__PURE__ */ jsx34("p", { className: "text-[11px] text-muted-foreground", children: "The regular search still works and is applied before these layers." }),
6258
- /* @__PURE__ */ jsxs25(
6314
+ /* @__PURE__ */ jsxs26("div", { className: "flex items-center justify-between gap-2 border-t border-border px-3 py-2", children: [
6315
+ /* @__PURE__ */ jsx35("p", { className: "text-[11px] text-muted-foreground", children: "The regular search still works and is applied before these layers." }),
6316
+ /* @__PURE__ */ jsxs26(
6259
6317
  Button,
6260
6318
  {
6261
6319
  type: "button",
@@ -6265,7 +6323,7 @@ function LayeredFilterBuilder({
6265
6323
  disabled: rules.length >= maxRules,
6266
6324
  onClick: addRule,
6267
6325
  children: [
6268
- /* @__PURE__ */ jsx34(Plus, { className: "h-3.5 w-3.5" }),
6326
+ /* @__PURE__ */ jsx35(Plus, { className: "h-3.5 w-3.5" }),
6269
6327
  " Add layer"
6270
6328
  ]
6271
6329
  }
@@ -6277,7 +6335,7 @@ function LayeredFilterBuilder({
6277
6335
  ]
6278
6336
  }
6279
6337
  ),
6280
- rules.map((rule, index) => /* @__PURE__ */ jsxs25(
6338
+ rules.map((rule, index) => /* @__PURE__ */ jsxs26(
6281
6339
  "span",
6282
6340
  {
6283
6341
  className: cn(
@@ -6285,7 +6343,7 @@ function LayeredFilterBuilder({
6285
6343
  isCompleteLayeredFilterRule(rule) ? "border-border bg-muted/50 text-foreground" : "border-dashed border-warning/50 bg-warning/10 text-warning"
6286
6344
  ),
6287
6345
  children: [
6288
- /* @__PURE__ */ jsxs25(
6346
+ /* @__PURE__ */ jsxs26(
6289
6347
  "button",
6290
6348
  {
6291
6349
  type: "button",
@@ -6293,19 +6351,19 @@ function LayeredFilterBuilder({
6293
6351
  onClick: () => setOpen(true),
6294
6352
  title: isCompleteLayeredFilterRule(rule) ? layeredFilterRuleSummary(rule, fields) : `Layer ${index + 1} needs a value`,
6295
6353
  children: [
6296
- /* @__PURE__ */ jsx34("span", { className: "mr-1 text-muted-foreground", children: index + 1 }),
6354
+ /* @__PURE__ */ jsx35("span", { className: "mr-1 text-muted-foreground", children: index + 1 }),
6297
6355
  isCompleteLayeredFilterRule(rule) ? layeredFilterRuleSummary(rule, fields) : "Choose a value"
6298
6356
  ]
6299
6357
  }
6300
6358
  ),
6301
- /* @__PURE__ */ jsx34(
6359
+ /* @__PURE__ */ jsx35(
6302
6360
  "button",
6303
6361
  {
6304
6362
  type: "button",
6305
6363
  className: "shrink-0 rounded-full p-0.5 text-muted-foreground hover:bg-muted hover:text-foreground",
6306
6364
  "aria-label": `Remove filter layer ${index + 1}`,
6307
6365
  onClick: () => removeRule(index),
6308
- children: /* @__PURE__ */ jsx34(X, { className: "h-3 w-3" })
6366
+ children: /* @__PURE__ */ jsx35(X, { className: "h-3 w-3" })
6309
6367
  }
6310
6368
  )
6311
6369
  ]
@@ -6335,7 +6393,7 @@ function LayeredRuleRow({
6335
6393
  event.preventDefault();
6336
6394
  onKeyboardMove(event.key === "ArrowUp" ? -1 : 1);
6337
6395
  };
6338
- return /* @__PURE__ */ jsxs25(
6396
+ return /* @__PURE__ */ jsxs26(
6339
6397
  "div",
6340
6398
  {
6341
6399
  className: cn(
@@ -6348,7 +6406,7 @@ function LayeredRuleRow({
6348
6406
  onDrop(index);
6349
6407
  },
6350
6408
  children: [
6351
- /* @__PURE__ */ jsx34(
6409
+ /* @__PURE__ */ jsx35(
6352
6410
  "button",
6353
6411
  {
6354
6412
  type: "button",
@@ -6362,10 +6420,10 @@ function LayeredRuleRow({
6362
6420
  },
6363
6421
  onDragEnd,
6364
6422
  onKeyDown: handleMoveKey,
6365
- children: /* @__PURE__ */ jsx34(GripVertical, { className: "h-3.5 w-3.5" })
6423
+ children: /* @__PURE__ */ jsx35(GripVertical, { className: "h-3.5 w-3.5" })
6366
6424
  }
6367
6425
  ),
6368
- /* @__PURE__ */ jsxs25(
6426
+ /* @__PURE__ */ jsxs26(
6369
6427
  Select,
6370
6428
  {
6371
6429
  value: field.id,
@@ -6383,16 +6441,16 @@ function LayeredRuleRow({
6383
6441
  });
6384
6442
  },
6385
6443
  children: [
6386
- /* @__PURE__ */ jsx34(
6444
+ /* @__PURE__ */ jsx35(
6387
6445
  SelectTrigger,
6388
6446
  {
6389
6447
  size: "sm",
6390
6448
  className: "h-7 w-full text-xs max-sm:col-span-1",
6391
6449
  "aria-label": `Filter layer ${index + 1} field`,
6392
- children: /* @__PURE__ */ jsx34(SelectValue, {})
6450
+ children: /* @__PURE__ */ jsx35(SelectValue, {})
6393
6451
  }
6394
6452
  ),
6395
- /* @__PURE__ */ jsx34(SelectContent, { children: fields.map((candidate) => /* @__PURE__ */ jsx34(
6453
+ /* @__PURE__ */ jsx35(SelectContent, { children: fields.map((candidate) => /* @__PURE__ */ jsx35(
6396
6454
  SelectItem,
6397
6455
  {
6398
6456
  value: candidate.id,
@@ -6404,7 +6462,7 @@ function LayeredRuleRow({
6404
6462
  ]
6405
6463
  }
6406
6464
  ),
6407
- /* @__PURE__ */ jsxs25(
6465
+ /* @__PURE__ */ jsxs26(
6408
6466
  Select,
6409
6467
  {
6410
6468
  value: rule.operator,
@@ -6416,35 +6474,35 @@ function LayeredRuleRow({
6416
6474
  });
6417
6475
  },
6418
6476
  children: [
6419
- /* @__PURE__ */ jsx34(
6477
+ /* @__PURE__ */ jsx35(
6420
6478
  SelectTrigger,
6421
6479
  {
6422
6480
  size: "sm",
6423
6481
  className: "h-7 w-full text-xs max-sm:col-start-2",
6424
6482
  "aria-label": `Filter layer ${index + 1} operator`,
6425
- children: /* @__PURE__ */ jsx34(SelectValue, {})
6483
+ children: /* @__PURE__ */ jsx35(SelectValue, {})
6426
6484
  }
6427
6485
  ),
6428
- /* @__PURE__ */ jsx34(SelectContent, { children: operators.map((operator) => /* @__PURE__ */ jsx34(SelectItem, { value: operator, className: "text-xs", children: LAYERED_FILTER_OPERATOR_LABELS[operator] }, operator)) })
6486
+ /* @__PURE__ */ jsx35(SelectContent, { children: operators.map((operator) => /* @__PURE__ */ jsx35(SelectItem, { value: operator, className: "text-xs", children: LAYERED_FILTER_OPERATOR_LABELS[operator] }, operator)) })
6429
6487
  ]
6430
6488
  }
6431
6489
  ),
6432
- /* @__PURE__ */ jsx34("div", { className: "min-w-0 max-sm:col-span-3 max-sm:col-start-1", children: !needsValue ? /* @__PURE__ */ jsx34("span", { className: "flex h-7 items-center px-2 text-xs text-muted-foreground", children: "No value needed" }) : field.kind === "select" ? /* @__PURE__ */ jsxs25(
6490
+ /* @__PURE__ */ jsx35("div", { className: "min-w-0 max-sm:col-span-3 max-sm:col-start-1", children: !needsValue ? /* @__PURE__ */ jsx35("span", { className: "flex h-7 items-center px-2 text-xs text-muted-foreground", children: "No value needed" }) : field.kind === "select" ? /* @__PURE__ */ jsxs26(
6433
6491
  Select,
6434
6492
  {
6435
6493
  value: rule.value,
6436
6494
  onValueChange: (value) => onChange({ value }),
6437
6495
  children: [
6438
- /* @__PURE__ */ jsx34(
6496
+ /* @__PURE__ */ jsx35(
6439
6497
  SelectTrigger,
6440
6498
  {
6441
6499
  size: "sm",
6442
6500
  className: "h-7 w-full text-xs",
6443
6501
  "aria-label": `Filter layer ${index + 1} value`,
6444
- children: /* @__PURE__ */ jsx34(SelectValue, {})
6502
+ children: /* @__PURE__ */ jsx35(SelectValue, {})
6445
6503
  }
6446
6504
  ),
6447
- /* @__PURE__ */ jsx34(SelectContent, { children: field.options.map((option) => /* @__PURE__ */ jsx34(
6505
+ /* @__PURE__ */ jsx35(SelectContent, { children: field.options.map((option) => /* @__PURE__ */ jsx35(
6448
6506
  SelectItem,
6449
6507
  {
6450
6508
  value: option.value,
@@ -6455,8 +6513,8 @@ function LayeredRuleRow({
6455
6513
  )) })
6456
6514
  ]
6457
6515
  }
6458
- ) : /* @__PURE__ */ jsxs25("div", { className: "flex items-center gap-1", children: [
6459
- /* @__PURE__ */ jsx34(
6516
+ ) : /* @__PURE__ */ jsxs26("div", { className: "flex items-center gap-1", children: [
6517
+ /* @__PURE__ */ jsx35(
6460
6518
  Input,
6461
6519
  {
6462
6520
  value: rule.value,
@@ -6467,9 +6525,9 @@ function LayeredRuleRow({
6467
6525
  "aria-label": `Filter layer ${index + 1} value`
6468
6526
  }
6469
6527
  ),
6470
- rule.operator === "between" ? /* @__PURE__ */ jsxs25(Fragment5, { children: [
6471
- /* @__PURE__ */ jsx34("span", { className: "text-[11px] text-muted-foreground", children: "and" }),
6472
- /* @__PURE__ */ jsx34(
6528
+ rule.operator === "between" ? /* @__PURE__ */ jsxs26(Fragment5, { children: [
6529
+ /* @__PURE__ */ jsx35("span", { className: "text-[11px] text-muted-foreground", children: "and" }),
6530
+ /* @__PURE__ */ jsx35(
6473
6531
  Input,
6474
6532
  {
6475
6533
  value: rule.valueTo ?? "",
@@ -6482,7 +6540,7 @@ function LayeredRuleRow({
6482
6540
  )
6483
6541
  ] }) : null
6484
6542
  ] }) }),
6485
- /* @__PURE__ */ jsx34(
6543
+ /* @__PURE__ */ jsx35(
6486
6544
  Button,
6487
6545
  {
6488
6546
  type: "button",
@@ -6491,7 +6549,7 @@ function LayeredRuleRow({
6491
6549
  className: "h-7 w-7 p-0 text-muted-foreground hover:text-destructive max-sm:col-start-3 max-sm:row-start-1",
6492
6550
  "aria-label": `Remove filter layer ${index + 1}`,
6493
6551
  onClick: onRemove,
6494
- children: /* @__PURE__ */ jsx34(Trash2, { className: "h-3.5 w-3.5" })
6552
+ children: /* @__PURE__ */ jsx35(Trash2, { className: "h-3.5 w-3.5" })
6495
6553
  }
6496
6554
  )
6497
6555
  ]
@@ -6595,7 +6653,7 @@ function safeQueryPage(requestedPage, totalItems, pageSize) {
6595
6653
  }
6596
6654
 
6597
6655
  // src/data-table/MatrxDataTable.tsx
6598
- import { Fragment as Fragment7, jsx as jsx35, jsxs as jsxs26 } from "react/jsx-runtime";
6656
+ import { Fragment as Fragment7, jsx as jsx36, jsxs as jsxs27 } from "react/jsx-runtime";
6599
6657
  function hasSameRowReferences(previous, next) {
6600
6658
  return previous.length === next.length && previous.every((row, index) => row === next[index]);
6601
6659
  }
@@ -6623,7 +6681,7 @@ function TableRowCopyControl({
6623
6681
  size,
6624
6682
  sourceId
6625
6683
  }) {
6626
- return /* @__PURE__ */ jsx35(
6684
+ return /* @__PURE__ */ jsx36(
6627
6685
  CopyButtons,
6628
6686
  {
6629
6687
  size,
@@ -6645,8 +6703,8 @@ function isStringArray(value) {
6645
6703
  }
6646
6704
  var activeUrlTableIds = /* @__PURE__ */ new Set();
6647
6705
  function MatrxDataTable(props) {
6648
- if (!props.urlState) return /* @__PURE__ */ jsx35(MatrxDataTableCore, { ...props });
6649
- return /* @__PURE__ */ jsx35(MatrxDataTableWithUrlState, { ...props, urlState: props.urlState });
6706
+ if (!props.urlState) return /* @__PURE__ */ jsx36(MatrxDataTableCore, { ...props });
6707
+ return /* @__PURE__ */ jsx36(MatrxDataTableWithUrlState, { ...props, urlState: props.urlState });
6650
6708
  }
6651
6709
  function MatrxDataTableWithUrlState({
6652
6710
  urlState,
@@ -6701,7 +6759,7 @@ function MatrxDataTableWithUrlState({
6701
6759
  props.selection?.onSelectedIdsChange(ids);
6702
6760
  }
6703
6761
  } : props.selection;
6704
- return /* @__PURE__ */ jsx35(
6762
+ return /* @__PURE__ */ jsx36(
6705
6763
  MatrxDataTableCore,
6706
6764
  {
6707
6765
  ...props,
@@ -7648,7 +7706,7 @@ function MatrxDataTableCore({
7648
7706
  }
7649
7707
  } : facet
7650
7708
  ) : toolbar?.facets;
7651
- return /* @__PURE__ */ jsxs26(
7709
+ return /* @__PURE__ */ jsxs27(
7652
7710
  DndContext,
7653
7711
  {
7654
7712
  sensors: hierarchySensors,
@@ -7721,7 +7779,7 @@ function MatrxDataTableCore({
7721
7779
  commitColumnState(order, effectiveHiddenColumnIds);
7722
7780
  },
7723
7781
  children: [
7724
- /* @__PURE__ */ jsxs26(
7782
+ /* @__PURE__ */ jsxs27(
7725
7783
  "div",
7726
7784
  {
7727
7785
  ref: rootRef,
@@ -7739,70 +7797,72 @@ function MatrxDataTableCore({
7739
7797
  ),
7740
7798
  children: [
7741
7799
  notice,
7742
- !hideToolbar && (showSearch || toolbar?.anyOf || toolbar?.layeredFilters || toolbar?.facets && toolbar.facets.length > 0 || toolbar?.leading || toolbar?.actions || hasActiveFilters || showToolbarCopy || columns.length > 0) && /* @__PURE__ */ jsxs26(
7743
- "div",
7800
+ !hideToolbar && (toolbar?.title || showSearch || toolbar?.anyOf || toolbar?.layeredFilters || toolbar?.facets && toolbar.facets.length > 0 || toolbar?.leading || toolbar?.actions || hasActiveFilters || showToolbarCopy || columns.length > 0) && /* @__PURE__ */ jsx36(TooltipProvider, { children: /* @__PURE__ */ jsxs27(
7801
+ TableTitleRow,
7744
7802
  {
7745
- "data-matrx-table-toolbar": true,
7746
- className: "flex shrink-0 flex-nowrap items-center gap-2 sm:flex-wrap",
7747
- children: [
7748
- showSearch ? /* @__PURE__ */ jsxs26(
7749
- "div",
7750
- {
7751
- "data-matrx-table-search": true,
7752
- className: cn(
7753
- "flex min-w-0 flex-1 sm:w-full sm:flex-none",
7754
- toolbar?.searchMatch ? "sm:max-w-md" : "sm:max-w-xs"
7755
- ),
7756
- children: [
7757
- /* @__PURE__ */ jsxs26("div", { className: "relative min-w-0 flex-1", children: [
7758
- /* @__PURE__ */ jsx35(Search, { className: "absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" }),
7759
- /* @__PURE__ */ jsx35(
7760
- Input,
7761
- {
7762
- value: searchValue,
7763
- onChange: (e) => setSearchValue(e.target.value),
7764
- placeholder: toolbar?.searchPlaceholder ?? "Search\u2026",
7765
- className: cn(
7766
- "h-8 pl-7 pr-7 text-sm",
7767
- toolbar?.searchMatch && "rounded-r-none"
7768
- ),
7769
- style: { fontSize: "16px" }
7770
- }
7771
- ),
7772
- searchValue ? /* @__PURE__ */ jsx35(
7803
+ ...toolbar?.title === void 0 ? {} : { title: toolbar.title },
7804
+ search: showSearch ? /* @__PURE__ */ jsxs27(
7805
+ "div",
7806
+ {
7807
+ "data-matrx-table-search": true,
7808
+ className: cn(
7809
+ "flex min-w-0 flex-1 sm:w-full sm:flex-none",
7810
+ toolbar?.searchMatch ? "sm:max-w-md" : "sm:max-w-xs"
7811
+ ),
7812
+ children: [
7813
+ /* @__PURE__ */ jsxs27("div", { className: "relative min-w-0 flex-1", children: [
7814
+ /* @__PURE__ */ jsx36(Search, { className: "absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" }),
7815
+ /* @__PURE__ */ jsx36(
7816
+ Input,
7817
+ {
7818
+ value: searchValue,
7819
+ onChange: (e) => setSearchValue(e.target.value),
7820
+ placeholder: toolbar?.searchPlaceholder ?? "Search\u2026",
7821
+ className: cn(
7822
+ "h-8 pl-7 pr-7 text-sm",
7823
+ toolbar?.searchMatch && "rounded-r-none"
7824
+ ),
7825
+ style: { fontSize: "16px" }
7826
+ }
7827
+ ),
7828
+ searchValue ? /* @__PURE__ */ jsxs27(Tooltip, { children: [
7829
+ /* @__PURE__ */ jsx36(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx36(
7773
7830
  "button",
7774
7831
  {
7775
7832
  type: "button",
7776
7833
  "aria-label": "Clear search",
7777
7834
  className: "absolute right-1.5 top-1/2 -translate-y-1/2 rounded p-0.5 text-muted-foreground hover:text-foreground",
7778
7835
  onClick: () => setSearchValue(""),
7779
- children: /* @__PURE__ */ jsx35(X, { className: "h-3.5 w-3.5" })
7836
+ children: /* @__PURE__ */ jsx36(X, { className: "h-3.5 w-3.5" })
7780
7837
  }
7781
- ) : null
7782
- ] }),
7783
- toolbar?.searchMatch ? /* @__PURE__ */ jsxs26(
7784
- Button,
7785
- {
7786
- type: "button",
7787
- variant: searchMatchMode === "whole_words" ? "secondary" : "outline",
7788
- size: "sm",
7789
- className: "h-8 shrink-0 gap-1 rounded-l-none border-l-0 px-2 text-xs",
7790
- "aria-pressed": searchMatchMode === "whole_words",
7791
- "aria-label": `Search match: ${searchMatchMode === "whole_words" ? "whole words" : "contains text"}`,
7792
- title: searchMatchMode === "whole_words" ? "Whole words \u2014 click to match text anywhere" : "Contains text \u2014 click to require whole words",
7793
- onClick: () => setSearchMatchMode(
7794
- searchMatchMode === "whole_words" ? "contains" : "whole_words"
7795
- ),
7796
- children: [
7797
- /* @__PURE__ */ jsx35(WholeWord, { className: "h-3.5 w-3.5" }),
7798
- searchMatchMode === "whole_words" ? "Whole words" : "Contains"
7799
- ]
7800
- }
7801
- ) : null
7802
- ]
7803
- }
7804
- ) : null,
7805
- toolbar?.layeredFilters ? /* @__PURE__ */ jsx35(
7838
+ ) }),
7839
+ /* @__PURE__ */ jsx36(TooltipContent, { children: "Clear search" })
7840
+ ] }) : null
7841
+ ] }),
7842
+ toolbar?.searchMatch ? /* @__PURE__ */ jsxs27(
7843
+ Button,
7844
+ {
7845
+ type: "button",
7846
+ variant: searchMatchMode === "whole_words" ? "secondary" : "outline",
7847
+ size: "sm",
7848
+ className: "h-8 shrink-0 gap-1 rounded-l-none border-l-0 px-2 text-xs",
7849
+ "aria-pressed": searchMatchMode === "whole_words",
7850
+ "aria-label": `Search match: ${searchMatchMode === "whole_words" ? "whole words" : "contains text"}`,
7851
+ title: searchMatchMode === "whole_words" ? "Whole words \u2014 click to match text anywhere" : "Contains text \u2014 click to require whole words",
7852
+ onClick: () => setSearchMatchMode(
7853
+ searchMatchMode === "whole_words" ? "contains" : "whole_words"
7854
+ ),
7855
+ children: [
7856
+ /* @__PURE__ */ jsx36(WholeWord, { className: "h-3.5 w-3.5" }),
7857
+ searchMatchMode === "whole_words" ? "Whole words" : "Contains"
7858
+ ]
7859
+ }
7860
+ ) : null
7861
+ ]
7862
+ }
7863
+ ) : null,
7864
+ children: [
7865
+ toolbar?.layeredFilters ? /* @__PURE__ */ jsx36(
7806
7866
  LayeredFilterBuilder,
7807
7867
  {
7808
7868
  fields: toolbar.layeredFilters.fields,
@@ -7812,9 +7872,9 @@ function MatrxDataTableCore({
7812
7872
  label: toolbar.layeredFilters.label
7813
7873
  }
7814
7874
  ) : null,
7815
- toolbar?.anyOf ? /* @__PURE__ */ jsxs26("div", { className: "relative w-full max-w-xs", children: [
7816
- /* @__PURE__ */ jsx35(Search, { className: "absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" }),
7817
- /* @__PURE__ */ jsx35(
7875
+ toolbar?.anyOf ? /* @__PURE__ */ jsxs27("div", { className: "relative w-full max-w-xs", children: [
7876
+ /* @__PURE__ */ jsx36(Search, { className: "absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" }),
7877
+ /* @__PURE__ */ jsx36(
7818
7878
  Input,
7819
7879
  {
7820
7880
  value: anyOfValue,
@@ -7824,57 +7884,64 @@ function MatrxDataTableCore({
7824
7884
  style: { fontSize: "16px" }
7825
7885
  }
7826
7886
  ),
7827
- anyOfValue ? /* @__PURE__ */ jsx35(
7828
- "button",
7829
- {
7830
- type: "button",
7831
- "aria-label": "Clear match-any search",
7832
- className: "absolute right-1.5 top-1/2 -translate-y-1/2 rounded p-0.5 text-muted-foreground hover:text-foreground",
7833
- onClick: () => setAnyOfValue(""),
7834
- children: /* @__PURE__ */ jsx35(X, { className: "h-3.5 w-3.5" })
7835
- }
7836
- ) : null
7887
+ anyOfValue ? /* @__PURE__ */ jsxs27(Tooltip, { children: [
7888
+ /* @__PURE__ */ jsx36(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx36(
7889
+ "button",
7890
+ {
7891
+ type: "button",
7892
+ "aria-label": "Clear match-any search",
7893
+ className: "absolute right-1.5 top-1/2 -translate-y-1/2 rounded p-0.5 text-muted-foreground hover:text-foreground",
7894
+ onClick: () => setAnyOfValue(""),
7895
+ children: /* @__PURE__ */ jsx36(X, { className: "h-3.5 w-3.5" })
7896
+ }
7897
+ ) }),
7898
+ /* @__PURE__ */ jsx36(TooltipContent, { children: "Clear match-any search" })
7899
+ ] }) : null
7837
7900
  ] }) : null,
7838
- renderedFacets ? /* @__PURE__ */ jsx35(ToolbarFacets, { facets: renderedFacets }) : null,
7901
+ renderedFacets ? /* @__PURE__ */ jsx36(ToolbarFacets, { facets: renderedFacets }) : null,
7839
7902
  toolbar?.leading,
7840
- /* @__PURE__ */ jsxs26(
7903
+ /* @__PURE__ */ jsxs27(
7841
7904
  "div",
7842
7905
  {
7843
7906
  "data-matrx-table-actions": true,
7844
- className: "ml-auto flex shrink-0 flex-nowrap items-center gap-2 sm:flex-wrap",
7907
+ className: "ml-auto flex min-w-0 flex-wrap items-center gap-2",
7845
7908
  children: [
7846
- sourceTotal !== void 0 ? /* @__PURE__ */ jsxs26(
7909
+ sourceTotal !== void 0 ? /* @__PURE__ */ jsxs27(
7847
7910
  "span",
7848
7911
  {
7849
7912
  "data-matrx-table-source-total": true,
7850
7913
  className: "text-xs tabular-nums text-muted-foreground",
7851
7914
  children: [
7852
7915
  data.length.toLocaleString(),
7853
- " loaded of ",
7916
+ " loaded of",
7917
+ " ",
7854
7918
  Math.max(0, sourceTotal).toLocaleString(),
7855
- " \xB7 ",
7919
+ " \xB7",
7920
+ " ",
7856
7921
  processed.length.toLocaleString(),
7857
7922
  " matched"
7858
7923
  ]
7859
7924
  }
7860
7925
  ) : null,
7861
- hasActiveFilters ? /* @__PURE__ */ jsxs26(
7862
- Button,
7863
- {
7864
- type: "button",
7865
- variant: "ghost",
7866
- size: "sm",
7867
- className: "h-7 gap-1 px-2 text-xs text-muted-foreground",
7868
- onClick: clearAllFilters,
7869
- "aria-label": "Clear all filters",
7870
- title: "Clear all filters",
7871
- children: [
7872
- /* @__PURE__ */ jsx35(Eraser, { className: "h-3.5 w-3.5" }),
7873
- /* @__PURE__ */ jsx35("span", { className: "max-sm:sr-only", children: "Clear all" })
7874
- ]
7875
- }
7876
- ) : null,
7877
- showToolbarCopy && copy ? /* @__PURE__ */ jsx35(
7926
+ hasActiveFilters ? /* @__PURE__ */ jsxs27(Tooltip, { children: [
7927
+ /* @__PURE__ */ jsx36(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs27(
7928
+ Button,
7929
+ {
7930
+ type: "button",
7931
+ variant: "ghost",
7932
+ size: "sm",
7933
+ className: "h-7 gap-1 px-2 text-xs text-muted-foreground",
7934
+ onClick: clearAllFilters,
7935
+ "aria-label": "Clear all filters",
7936
+ children: [
7937
+ /* @__PURE__ */ jsx36(Eraser, { className: "h-3.5 w-3.5" }),
7938
+ /* @__PURE__ */ jsx36("span", { className: "max-sm:sr-only", children: "Clear all" })
7939
+ ]
7940
+ }
7941
+ ) }),
7942
+ /* @__PURE__ */ jsx36(TooltipContent, { children: "Clear search and filters; keep columns and sort" })
7943
+ ] }) : null,
7944
+ showToolbarCopy && copy ? /* @__PURE__ */ jsx36(
7878
7945
  CopyButtons,
7879
7946
  {
7880
7947
  size: "icon",
@@ -7905,10 +7972,7 @@ function MatrxDataTableCore({
7905
7972
  id: "csv",
7906
7973
  label: "CSV (current view)",
7907
7974
  build: () => ({
7908
- content: rowsToCsvFromColumns(
7909
- processed,
7910
- visibleColumns
7911
- ),
7975
+ content: rowsToCsvFromColumns(processed, visibleColumns),
7912
7976
  extension: "csv",
7913
7977
  mime: "text/csv"
7914
7978
  })
@@ -7930,41 +7994,43 @@ function MatrxDataTableCore({
7930
7994
  }
7931
7995
  }
7932
7996
  ) : null,
7933
- columns.length > 0 ? /* @__PURE__ */ jsxs26(
7934
- Button,
7935
- {
7936
- type: "button",
7937
- variant: "ghost",
7938
- size: "icon",
7939
- "aria-label": "Columns",
7940
- title: "Show, hide, or reorder columns",
7941
- className: "h-8 w-8",
7942
- onClick: () => setColumnManagerOpen(true),
7943
- children: [
7944
- /* @__PURE__ */ jsx35(SlidersHorizontal, { className: "h-4 w-4" }),
7945
- effectiveHiddenColumnIds.size > 0 ? /* @__PURE__ */ jsxs26("span", { className: "sr-only", children: [
7946
- effectiveHiddenColumnIds.size,
7947
- " hidden"
7948
- ] }) : null
7949
- ]
7950
- }
7951
- ) : null,
7997
+ columns.length > 0 ? /* @__PURE__ */ jsxs27(Tooltip, { children: [
7998
+ /* @__PURE__ */ jsx36(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs27(
7999
+ Button,
8000
+ {
8001
+ type: "button",
8002
+ variant: "ghost",
8003
+ size: "icon",
8004
+ "aria-label": "Columns",
8005
+ className: "h-8 w-8",
8006
+ onClick: () => setColumnManagerOpen(true),
8007
+ children: [
8008
+ /* @__PURE__ */ jsx36(SlidersHorizontal, { className: "h-4 w-4" }),
8009
+ effectiveHiddenColumnIds.size > 0 ? /* @__PURE__ */ jsxs27("span", { className: "sr-only", children: [
8010
+ effectiveHiddenColumnIds.size,
8011
+ " hidden"
8012
+ ] }) : null
8013
+ ]
8014
+ }
8015
+ ) }),
8016
+ /* @__PURE__ */ jsx36(TooltipContent, { children: "Show, hide, or reorder columns" })
8017
+ ] }) : null,
7952
8018
  toolbar?.actions
7953
8019
  ]
7954
8020
  }
7955
8021
  )
7956
8022
  ]
7957
8023
  }
7958
- ),
7959
- selection && selectionCount > 0 ? /* @__PURE__ */ jsxs26("div", { className: "flex shrink-0 flex-wrap items-center gap-2 rounded-md border border-primary/30 bg-primary/5 px-2 py-1.5", children: [
7960
- /* @__PURE__ */ jsxs26("span", { className: "text-xs font-medium text-foreground", children: [
8024
+ ) }),
8025
+ selection && selectionCount > 0 ? /* @__PURE__ */ jsxs27("div", { className: "flex shrink-0 flex-wrap items-center gap-2 rounded-md border border-primary/30 bg-primary/5 px-2 py-1.5", children: [
8026
+ /* @__PURE__ */ jsxs27("span", { className: "text-xs font-medium text-foreground", children: [
7961
8027
  selectionCount.toLocaleString(),
7962
8028
  " ",
7963
8029
  selectionNoun,
7964
8030
  selectionCount === 1 ? "" : "s",
7965
8031
  " selected"
7966
8032
  ] }),
7967
- /* @__PURE__ */ jsxs26(
8033
+ /* @__PURE__ */ jsxs27(
7968
8034
  Button,
7969
8035
  {
7970
8036
  type: "button",
@@ -7976,13 +8042,13 @@ function MatrxDataTableCore({
7976
8042
  selection.onSelectedIdsChange([]);
7977
8043
  },
7978
8044
  children: [
7979
- /* @__PURE__ */ jsx35(X, { className: "h-3.5 w-3.5" }),
8045
+ /* @__PURE__ */ jsx36(X, { className: "h-3.5 w-3.5" }),
7980
8046
  "Clear"
7981
8047
  ]
7982
8048
  }
7983
8049
  ),
7984
- /* @__PURE__ */ jsxs26("div", { className: "ml-auto flex flex-wrap items-center gap-1.5", children: [
7985
- copy && selectedRows.length > 0 ? /* @__PURE__ */ jsx35(
8050
+ /* @__PURE__ */ jsxs27("div", { className: "ml-auto flex flex-wrap items-center gap-1.5", children: [
8051
+ copy && selectedRows.length > 0 ? /* @__PURE__ */ jsx36(
7986
8052
  CopyButtons,
7987
8053
  {
7988
8054
  size: "icon",
@@ -8038,9 +8104,9 @@ function MatrxDataTableCore({
8038
8104
  selection.actions?.(selectedRows, selection.selectedIds)
8039
8105
  ] })
8040
8106
  ] }) : null,
8041
- /* @__PURE__ */ jsxs26("div", { className: "flex min-h-0 flex-1 flex-col", children: [
8042
- /* @__PURE__ */ jsxs26("div", { className: "relative min-h-0 flex-1", children: [
8043
- mobileCards ? /* @__PURE__ */ jsxs26(
8107
+ /* @__PURE__ */ jsxs27("div", { className: "flex min-h-0 flex-1 flex-col", children: [
8108
+ /* @__PURE__ */ jsxs27("div", { className: "relative min-h-0 flex-1", children: [
8109
+ mobileCards ? /* @__PURE__ */ jsxs27(
8044
8110
  "div",
8045
8111
  {
8046
8112
  ref: cardsScrollRef,
@@ -8052,33 +8118,33 @@ function MatrxDataTableCore({
8052
8118
  mobileCardsClass
8053
8119
  ),
8054
8120
  children: [
8055
- isFetching && !isLoading && appendQuery === null ? /* @__PURE__ */ jsxs26(
8121
+ isFetching && !isLoading && appendQuery === null ? /* @__PURE__ */ jsxs27(
8056
8122
  "div",
8057
8123
  {
8058
8124
  role: "status",
8059
8125
  className: "h-0.5 shrink-0 overflow-hidden rounded-full bg-primary/15",
8060
8126
  children: [
8061
- /* @__PURE__ */ jsx35("div", { className: "h-full w-full animate-pulse bg-primary" }),
8062
- /* @__PURE__ */ jsx35("span", { className: "sr-only", children: "Refreshing table data" })
8127
+ /* @__PURE__ */ jsx36("div", { className: "h-full w-full animate-pulse bg-primary" }),
8128
+ /* @__PURE__ */ jsx36("span", { className: "sr-only", children: "Refreshing table data" })
8063
8129
  ]
8064
8130
  }
8065
8131
  ) : null,
8066
- isLoading ? Array.from({ length: 4 }).map((_, index) => /* @__PURE__ */ jsx35(
8132
+ isLoading ? Array.from({ length: 4 }).map((_, index) => /* @__PURE__ */ jsx36(
8067
8133
  Skeleton,
8068
8134
  {
8069
8135
  className: "h-52 w-full shrink-0 rounded-lg"
8070
8136
  },
8071
8137
  `mobile-card-sk-${index}`
8072
- )) : paginated.length === 0 ? /* @__PURE__ */ jsx35("div", { className: "flex min-h-48 flex-1 items-center justify-center px-4 py-12 text-center", children: /* @__PURE__ */ jsxs26("div", { className: "flex max-w-sm flex-col items-center gap-2", children: [
8138
+ )) : paginated.length === 0 ? /* @__PURE__ */ jsx36("div", { className: "flex min-h-48 flex-1 items-center justify-center px-4 py-12 text-center", children: /* @__PURE__ */ jsxs27("div", { className: "flex max-w-sm flex-col items-center gap-2", children: [
8073
8139
  emptyState?.icon,
8074
- /* @__PURE__ */ jsx35("p", { className: "text-sm font-medium text-foreground", children: emptyState?.title ?? "No rows" }),
8075
- emptyState?.description ? /* @__PURE__ */ jsx35("p", { className: "text-xs text-muted-foreground", children: emptyState.description }) : null,
8140
+ /* @__PURE__ */ jsx36("p", { className: "text-sm font-medium text-foreground", children: emptyState?.title ?? "No rows" }),
8141
+ emptyState?.description ? /* @__PURE__ */ jsx36("p", { className: "text-xs text-muted-foreground", children: emptyState.description }) : null,
8076
8142
  emptyState?.action
8077
8143
  ] }) }) : paginated.map((row, index) => {
8078
8144
  const id = getRowId(row);
8079
8145
  const displayRow = applyRowEdits(row, edits[id]);
8080
8146
  const selectable = selection?.isRowSelectable?.(row) ?? Boolean(selection);
8081
- return /* @__PURE__ */ jsx35(Fragment6, { children: mobileCards(displayRow, index, {
8147
+ return /* @__PURE__ */ jsx36(Fragment6, { children: mobileCards(displayRow, index, {
8082
8148
  selected: selectedIdSet.has(id),
8083
8149
  selectable,
8084
8150
  onSelectedChange: (nextSelected) => {
@@ -8090,13 +8156,13 @@ function MatrxDataTableCore({
8090
8156
  else next.delete(id);
8091
8157
  setSelectedIds(next);
8092
8158
  },
8093
- actions: showRowCopy || rowActions ? /* @__PURE__ */ jsxs26(
8159
+ actions: showRowCopy || rowActions ? /* @__PURE__ */ jsxs27(
8094
8160
  "div",
8095
8161
  {
8096
8162
  className: "inline-flex items-center gap-1",
8097
8163
  onClick: (event) => event.stopPropagation(),
8098
8164
  children: [
8099
- showRowCopy && copy ? /* @__PURE__ */ jsx35(
8165
+ showRowCopy && copy ? /* @__PURE__ */ jsx36(
8100
8166
  TableRowCopyControl,
8101
8167
  {
8102
8168
  size: "xs",
@@ -8118,7 +8184,7 @@ function MatrxDataTableCore({
8118
8184
  ) : null
8119
8185
  }) }, id);
8120
8186
  }),
8121
- appendQuery !== null && isFetching && !isLoading ? /* @__PURE__ */ jsxs26(
8187
+ appendQuery !== null && isFetching && !isLoading ? /* @__PURE__ */ jsxs27(
8122
8188
  "div",
8123
8189
  {
8124
8190
  "data-matrx-table-append-loading-card": true,
@@ -8126,7 +8192,7 @@ function MatrxDataTableCore({
8126
8192
  "aria-live": "polite",
8127
8193
  className: "sticky bottom-0 z-20 flex h-16 w-full max-w-[100cqw] shrink-0 items-center justify-center gap-2 rounded-md border border-border bg-card/95 px-3 text-sm font-medium text-foreground shadow-sm backdrop-blur-sm",
8128
8194
  children: [
8129
- /* @__PURE__ */ jsx35(
8195
+ /* @__PURE__ */ jsx36(
8130
8196
  Loader2,
8131
8197
  {
8132
8198
  "aria-hidden": "true",
@@ -8140,7 +8206,7 @@ function MatrxDataTableCore({
8140
8206
  ]
8141
8207
  }
8142
8208
  ) : null,
8143
- /* @__PURE__ */ jsxs26(
8209
+ /* @__PURE__ */ jsxs27(
8144
8210
  "div",
8145
8211
  {
8146
8212
  ref: scrollRef,
@@ -8155,34 +8221,34 @@ function MatrxDataTableCore({
8155
8221
  tableClassName
8156
8222
  ),
8157
8223
  children: [
8158
- hierarchy && draggedRow ? /* @__PURE__ */ jsx35(
8224
+ hierarchy && draggedRow ? /* @__PURE__ */ jsx36(
8159
8225
  HierarchyRootDropTarget,
8160
8226
  {
8161
8227
  label: hierarchy.rootDropLabel ?? "Drop here to move to the top level",
8162
8228
  draggedLabel: hierarchy.itemLabel?.(draggedRow) ?? "Moving row"
8163
8229
  }
8164
8230
  ) : null,
8165
- hierarchy && draggedRowId ? /* @__PURE__ */ jsx35(
8231
+ hierarchy && draggedRowId ? /* @__PURE__ */ jsx36(
8166
8232
  HierarchyDragIndicatorLayer,
8167
8233
  {
8168
8234
  scrollRef,
8169
8235
  resolve: resolveHierarchyMove
8170
8236
  }
8171
8237
  ) : null,
8172
- isFetching && !isLoading && appendQuery === null ? /* @__PURE__ */ jsxs26(
8238
+ isFetching && !isLoading && appendQuery === null ? /* @__PURE__ */ jsxs27(
8173
8239
  "div",
8174
8240
  {
8175
8241
  role: "status",
8176
8242
  className: "sticky left-0 top-0 z-20 h-0.5 w-full overflow-hidden bg-primary/15",
8177
8243
  children: [
8178
- /* @__PURE__ */ jsx35("div", { className: "h-full w-full animate-pulse bg-primary" }),
8179
- /* @__PURE__ */ jsx35("span", { className: "sr-only", children: "Refreshing table data" })
8244
+ /* @__PURE__ */ jsx36("div", { className: "h-full w-full animate-pulse bg-primary" }),
8245
+ /* @__PURE__ */ jsx36("span", { className: "sr-only", children: "Refreshing table data" })
8180
8246
  ]
8181
8247
  }
8182
8248
  ) : null,
8183
- /* @__PURE__ */ jsxs26("table", { className: "table w-max min-w-full max-w-none caption-bottom overflow-visible text-sm sm:w-full sm:min-w-0 sm:max-w-full", children: [
8184
- /* @__PURE__ */ jsx35("thead", { className: "sticky top-0 z-10 border-b border-border bg-muted/90 shadow-[0_1px_0_0_var(--border)] backdrop-blur-sm", children: /* @__PURE__ */ jsxs26("tr", { children: [
8185
- selection ? /* @__PURE__ */ jsx35("th", { className: "h-9 w-9 px-2 text-left align-middle", children: /* @__PURE__ */ jsx35(
8249
+ /* @__PURE__ */ jsxs27("table", { className: "table w-max min-w-full max-w-none caption-bottom overflow-visible text-sm sm:w-full sm:min-w-0 sm:max-w-full", children: [
8250
+ /* @__PURE__ */ jsx36("thead", { className: "sticky top-0 z-10 border-b border-border bg-muted/90 shadow-[0_1px_0_0_var(--border)] backdrop-blur-sm", children: /* @__PURE__ */ jsxs27("tr", { children: [
8251
+ selection ? /* @__PURE__ */ jsx36("th", { className: "h-9 w-9 px-2 text-left align-middle", children: /* @__PURE__ */ jsx36(
8186
8252
  Checkbox,
8187
8253
  {
8188
8254
  className: CHECKBOX_TAP_AREA,
@@ -8198,7 +8264,7 @@ function MatrxDataTableCore({
8198
8264
  const isSorted = sort?.id === id;
8199
8265
  const headerLabel = col.label ?? (typeof col.header === "string" ? col.header : id);
8200
8266
  const defaultSortDirection = col.defaultSortDirection ?? "asc";
8201
- return /* @__PURE__ */ jsx35(
8267
+ return /* @__PURE__ */ jsx36(
8202
8268
  "th",
8203
8269
  {
8204
8270
  "aria-sort": isSorted ? sort?.direction === "asc" ? "ascending" : "descending" : void 0,
@@ -8225,7 +8291,7 @@ function MatrxDataTableCore({
8225
8291
  col.align === "right" && "text-right"
8226
8292
  ),
8227
8293
  style: columnWidthVar(col.width),
8228
- children: /* @__PURE__ */ jsx35(ColumnHeaderDropZone, { id, enabled: reorderableColumns, children: /* @__PURE__ */ jsx35(
8294
+ children: /* @__PURE__ */ jsx36(ColumnHeaderDropZone, { id, enabled: reorderableColumns, children: /* @__PURE__ */ jsx36(
8229
8295
  ColumnHeaderCell,
8230
8296
  {
8231
8297
  label: col.header,
@@ -8266,12 +8332,12 @@ function MatrxDataTableCore({
8266
8332
  id
8267
8333
  );
8268
8334
  }),
8269
- showActionsCol && /* @__PURE__ */ jsx35("th", { className: "h-9 w-28 px-2 text-right align-middle text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: "Actions" })
8335
+ showActionsCol && /* @__PURE__ */ jsx36("th", { className: "h-9 w-28 px-2 text-right align-middle text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: "Actions" })
8270
8336
  ] }) }),
8271
- /* @__PURE__ */ jsxs26("tbody", { children: [
8272
- isLoading ? Array.from({ length: 6 }).map((_, i) => /* @__PURE__ */ jsxs26("tr", { className: "border-b border-border/60", children: [
8273
- selection ? /* @__PURE__ */ jsx35("td", { className: "px-2 py-2", children: /* @__PURE__ */ jsx35(Skeleton, { className: "h-3.5 w-3.5" }) }) : null,
8274
- visibleColumns.map((col) => /* @__PURE__ */ jsx35(
8337
+ /* @__PURE__ */ jsxs27("tbody", { children: [
8338
+ isLoading ? Array.from({ length: 6 }).map((_, i) => /* @__PURE__ */ jsxs27("tr", { className: "border-b border-border/60", children: [
8339
+ selection ? /* @__PURE__ */ jsx36("td", { className: "px-2 py-2", children: /* @__PURE__ */ jsx36(Skeleton, { className: "h-3.5 w-3.5" }) }) : null,
8340
+ visibleColumns.map((col) => /* @__PURE__ */ jsx36(
8275
8341
  "td",
8276
8342
  {
8277
8343
  className: cn(
@@ -8279,20 +8345,20 @@ function MatrxDataTableCore({
8279
8345
  col.compact ? "px-1" : "px-2",
8280
8346
  col.mobileHidden && "max-sm:hidden"
8281
8347
  ),
8282
- children: /* @__PURE__ */ jsx35(Skeleton, { className: "h-5 w-full" })
8348
+ children: /* @__PURE__ */ jsx36(Skeleton, { className: "h-5 w-full" })
8283
8349
  },
8284
8350
  columnId(col)
8285
8351
  )),
8286
- showActionsCol && /* @__PURE__ */ jsx35("td", { className: "px-2 py-2", children: /* @__PURE__ */ jsx35(Skeleton, { className: "ml-auto h-5 w-10" }) })
8287
- ] }, `sk-${i}`)) : paginated.length === 0 ? /* @__PURE__ */ jsx35("tr", { children: /* @__PURE__ */ jsx35(
8352
+ showActionsCol && /* @__PURE__ */ jsx36("td", { className: "px-2 py-2", children: /* @__PURE__ */ jsx36(Skeleton, { className: "ml-auto h-5 w-10" }) })
8353
+ ] }, `sk-${i}`)) : paginated.length === 0 ? /* @__PURE__ */ jsx36("tr", { children: /* @__PURE__ */ jsx36(
8288
8354
  "td",
8289
8355
  {
8290
8356
  colSpan: visibleColumns.length + leadingCols + (showActionsCol ? 1 : 0),
8291
8357
  className: "px-4 py-12 text-center",
8292
- children: /* @__PURE__ */ jsxs26("div", { className: "mx-auto flex max-w-sm flex-col items-center gap-2", children: [
8358
+ children: /* @__PURE__ */ jsxs27("div", { className: "mx-auto flex max-w-sm flex-col items-center gap-2", children: [
8293
8359
  emptyState?.icon,
8294
- /* @__PURE__ */ jsx35("p", { className: "text-sm font-medium text-foreground", children: emptyState?.title ?? "No rows" }),
8295
- emptyState?.description ? /* @__PURE__ */ jsx35("p", { className: "text-xs text-muted-foreground", children: emptyState.description }) : null,
8360
+ /* @__PURE__ */ jsx36("p", { className: "text-sm font-medium text-foreground", children: emptyState?.title ?? "No rows" }),
8361
+ emptyState?.description ? /* @__PURE__ */ jsx36("p", { className: "text-xs text-muted-foreground", children: emptyState.description }) : null,
8296
8362
  emptyState?.action
8297
8363
  ] })
8298
8364
  }
@@ -8302,7 +8368,7 @@ function MatrxDataTableCore({
8302
8368
  const rowEdits = edits[id];
8303
8369
  const displayRow = applyRowEdits(row, rowEdits);
8304
8370
  const isChecked = selectedIdSet.has(id);
8305
- const rowNode = /* @__PURE__ */ jsxs26(
8371
+ const rowNode = /* @__PURE__ */ jsxs27(
8306
8372
  "tr",
8307
8373
  {
8308
8374
  "data-row-id": id,
@@ -8325,12 +8391,12 @@ function MatrxDataTableCore({
8325
8391
  zebra && index % 2 === 1 && !isSelected && !isChecked && "sm:bg-muted/20"
8326
8392
  ),
8327
8393
  children: [
8328
- selection ? /* @__PURE__ */ jsx35(
8394
+ selection ? /* @__PURE__ */ jsx36(
8329
8395
  "td",
8330
8396
  {
8331
8397
  className: "px-2 py-1.5 align-middle lg:py-0.5",
8332
8398
  onClick: (e) => e.stopPropagation(),
8333
- children: selection.isRowSelectable?.(row) ?? true ? /* @__PURE__ */ jsx35(
8399
+ children: selection.isRowSelectable?.(row) ?? true ? /* @__PURE__ */ jsx36(
8334
8400
  Checkbox,
8335
8401
  {
8336
8402
  className: CHECKBOX_TAP_AREA,
@@ -8351,7 +8417,7 @@ function MatrxDataTableCore({
8351
8417
  rowEdits && field in rowEdits
8352
8418
  );
8353
8419
  const cellHref = col.href?.(row) ?? void 0;
8354
- return /* @__PURE__ */ jsx35(
8420
+ return /* @__PURE__ */ jsx36(
8355
8421
  "td",
8356
8422
  {
8357
8423
  className: cn(
@@ -8367,14 +8433,14 @@ function MatrxDataTableCore({
8367
8433
  col.align === "right" && "text-right"
8368
8434
  ),
8369
8435
  style: columnWidthVar(col.width),
8370
- children: /* @__PURE__ */ jsxs26(
8436
+ children: /* @__PURE__ */ jsxs27(
8371
8437
  "div",
8372
8438
  {
8373
8439
  className: cn(
8374
8440
  colIdx === 0 && hierarchy && "flex min-w-0 items-center"
8375
8441
  ),
8376
8442
  children: [
8377
- colIdx === 0 && hierarchy ? /* @__PURE__ */ jsx35(
8443
+ colIdx === 0 && hierarchy ? /* @__PURE__ */ jsx36(
8378
8444
  HierarchyDragHandle,
8379
8445
  {
8380
8446
  id,
@@ -8382,12 +8448,12 @@ function MatrxDataTableCore({
8382
8448
  disabled: !(hierarchy.canReparent?.(row) ?? true)
8383
8449
  }
8384
8450
  ) : null,
8385
- /* @__PURE__ */ jsx35(
8451
+ /* @__PURE__ */ jsx36(
8386
8452
  "div",
8387
8453
  {
8388
8454
  "data-matrx-cell-content": true,
8389
8455
  className: "min-w-0 max-w-full flex-1 whitespace-normal break-words [overflow-wrap:anywhere] sm:[&_*]:min-w-0 sm:[&_*]:max-w-full sm:[&_*]:whitespace-normal sm:[&_*]:[overflow-wrap:anywhere] sm:[&_[data-matrx-cell-control]]:w-max sm:[&_[data-matrx-cell-control]]:min-w-max sm:[&_[data-matrx-cell-control]]:max-w-none sm:[&_[data-matrx-cell-control]]:whitespace-nowrap sm:[&_[data-matrx-cell-control]]:[overflow-wrap:normal] sm:[&_[data-matrx-cell-control]_*]:whitespace-nowrap sm:[&_[data-matrx-cell-control]_*]:[overflow-wrap:normal]",
8390
- children: editable && col.editable ? /* @__PURE__ */ jsx35(
8456
+ children: editable && col.editable ? /* @__PURE__ */ jsx36(
8391
8457
  EditableTableCell,
8392
8458
  {
8393
8459
  value: rowEdits && field in rowEdits ? rowEdits[field] : getCellValue(row, col),
@@ -8399,7 +8465,7 @@ function MatrxDataTableCore({
8399
8465
  ...cellHref === void 0 ? {} : { href: cellHref },
8400
8466
  ...col.editTrigger === void 0 ? {} : { editTrigger: col.editTrigger }
8401
8467
  }
8402
- ) : cellHref ? /* @__PURE__ */ jsx35(
8468
+ ) : cellHref ? /* @__PURE__ */ jsx36(
8403
8469
  Link,
8404
8470
  {
8405
8471
  href: cellHref,
@@ -8417,13 +8483,13 @@ function MatrxDataTableCore({
8417
8483
  columnId(col)
8418
8484
  );
8419
8485
  }),
8420
- showActionsCol && /* @__PURE__ */ jsx35("td", { className: "px-2 py-1.5 text-right align-middle lg:py-0.5", children: /* @__PURE__ */ jsxs26(
8486
+ showActionsCol && /* @__PURE__ */ jsx36("td", { className: "px-2 py-1.5 text-right align-middle lg:py-0.5", children: /* @__PURE__ */ jsxs27(
8421
8487
  "div",
8422
8488
  {
8423
8489
  className: "inline-flex items-center justify-end gap-0.5",
8424
8490
  onClick: (e) => e.stopPropagation(),
8425
8491
  children: [
8426
- showRowCopy && copy ? /* @__PURE__ */ jsx35(
8492
+ showRowCopy && copy ? /* @__PURE__ */ jsx36(
8427
8493
  TableRowCopyControl,
8428
8494
  {
8429
8495
  size: "xs",
@@ -8440,7 +8506,7 @@ function MatrxDataTableCore({
8440
8506
  hasPendingEdits: Boolean(rowEdits),
8441
8507
  discardPendingEdits: () => discardRowEdits(id)
8442
8508
  }),
8443
- windowEnabled ? /* @__PURE__ */ jsx35(
8509
+ windowEnabled ? /* @__PURE__ */ jsx36(
8444
8510
  Button,
8445
8511
  {
8446
8512
  type: "button",
@@ -8457,7 +8523,7 @@ function MatrxDataTableCore({
8457
8523
  openWindow(row);
8458
8524
  }
8459
8525
  },
8460
- children: opensWindowOnRowClick ? /* @__PURE__ */ jsx35(PanelRightOpen, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ jsx35(PanelRight, { className: "h-3.5 w-3.5" })
8526
+ children: opensWindowOnRowClick ? /* @__PURE__ */ jsx36(PanelRightOpen, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ jsx36(PanelRight, { className: "h-3.5 w-3.5" })
8461
8527
  }
8462
8528
  ) : null
8463
8529
  ]
@@ -8468,7 +8534,7 @@ function MatrxDataTableCore({
8468
8534
  id
8469
8535
  );
8470
8536
  const wrappedRow = rowWrapper ? rowWrapper(row, rowNode) : rowNode;
8471
- return hierarchy ? /* @__PURE__ */ jsx35(
8537
+ return hierarchy ? /* @__PURE__ */ jsx36(
8472
8538
  HierarchyDroppableRow,
8473
8539
  {
8474
8540
  id,
@@ -8476,21 +8542,21 @@ function MatrxDataTableCore({
8476
8542
  children: wrappedRow
8477
8543
  },
8478
8544
  id
8479
- ) : /* @__PURE__ */ jsx35(Fragment6, { children: wrappedRow }, id);
8545
+ ) : /* @__PURE__ */ jsx36(Fragment6, { children: wrappedRow }, id);
8480
8546
  }),
8481
- appendQuery !== null && isFetching && !isLoading ? /* @__PURE__ */ jsx35("tr", { "data-matrx-table-append-loading-row": true, children: /* @__PURE__ */ jsx35(
8547
+ appendQuery !== null && isFetching && !isLoading ? /* @__PURE__ */ jsx36("tr", { "data-matrx-table-append-loading-row": true, children: /* @__PURE__ */ jsx36(
8482
8548
  "td",
8483
8549
  {
8484
8550
  colSpan: visibleColumns.length + leadingCols + (showActionsCol ? 1 : 0),
8485
8551
  className: "sticky bottom-0 z-20 h-16 border-y border-border bg-card/95 px-0 py-0 text-left shadow-sm backdrop-blur-sm",
8486
- children: /* @__PURE__ */ jsxs26(
8552
+ children: /* @__PURE__ */ jsxs27(
8487
8553
  "div",
8488
8554
  {
8489
8555
  role: "status",
8490
8556
  "aria-live": "polite",
8491
8557
  className: "sticky left-0 flex h-16 w-fit max-w-[100cqw] items-center justify-center gap-2 px-3 text-sm font-medium text-foreground",
8492
8558
  children: [
8493
- /* @__PURE__ */ jsx35(
8559
+ /* @__PURE__ */ jsx36(
8494
8560
  Loader2,
8495
8561
  {
8496
8562
  "aria-hidden": "true",
@@ -8504,9 +8570,9 @@ function MatrxDataTableCore({
8504
8570
  }
8505
8571
  ) }) : null
8506
8572
  ] }),
8507
- footerRows.length > 0 ? /* @__PURE__ */ jsx35("tfoot", { className: "border-t-2 border-border bg-muted/50 font-semibold", children: footerRows.map((row, index) => /* @__PURE__ */ jsxs26("tr", { children: [
8508
- selection ? /* @__PURE__ */ jsx35("td", { className: "px-2 py-2" }) : null,
8509
- visibleColumns.map((column) => /* @__PURE__ */ jsx35(
8573
+ footerRows.length > 0 ? /* @__PURE__ */ jsx36("tfoot", { className: "border-t-2 border-border bg-muted/50 font-semibold", children: footerRows.map((row, index) => /* @__PURE__ */ jsxs27("tr", { children: [
8574
+ selection ? /* @__PURE__ */ jsx36("td", { className: "px-2 py-2" }) : null,
8575
+ visibleColumns.map((column) => /* @__PURE__ */ jsx36(
8510
8576
  "td",
8511
8577
  {
8512
8578
  className: cn(
@@ -8521,13 +8587,13 @@ function MatrxDataTableCore({
8521
8587
  },
8522
8588
  columnId(column)
8523
8589
  )),
8524
- showActionsCol ? /* @__PURE__ */ jsx35("td", { className: "px-2 py-2" }) : null
8590
+ showActionsCol ? /* @__PURE__ */ jsx36("td", { className: "px-2 py-2" }) : null
8525
8591
  ] }, `footer-${index}`)) }) : null
8526
8592
  ] })
8527
8593
  ]
8528
8594
  }
8529
8595
  ),
8530
- scrollHintLeft ? /* @__PURE__ */ jsx35(
8596
+ scrollHintLeft ? /* @__PURE__ */ jsx36(
8531
8597
  Button,
8532
8598
  {
8533
8599
  type: "button",
@@ -8538,10 +8604,10 @@ function MatrxDataTableCore({
8538
8604
  "data-matrx-table-scroll-control": "left",
8539
8605
  className: "absolute left-1.5 top-1/2 z-30 hidden h-11 w-11 -translate-y-1/2 rounded-full border border-glass-edge bg-glass p-0 text-foreground shadow-glass backdrop-blur-glass backdrop-saturate-glass hover:bg-glass-hover active:bg-glass-active sm:inline-flex",
8540
8606
  onClick: () => scrollTableHorizontally("left"),
8541
- children: /* @__PURE__ */ jsx35(ChevronLeft, { className: "h-5 w-5" })
8607
+ children: /* @__PURE__ */ jsx36(ChevronLeft, { className: "h-5 w-5" })
8542
8608
  }
8543
8609
  ) : null,
8544
- scrollHintRight ? /* @__PURE__ */ jsx35(
8610
+ scrollHintRight ? /* @__PURE__ */ jsx36(
8545
8611
  Button,
8546
8612
  {
8547
8613
  type: "button",
@@ -8552,24 +8618,24 @@ function MatrxDataTableCore({
8552
8618
  "data-matrx-table-scroll-control": "right",
8553
8619
  className: "absolute right-1.5 top-1/2 z-30 hidden h-11 w-11 -translate-y-1/2 rounded-full border border-glass-edge bg-glass p-0 text-foreground shadow-glass backdrop-blur-glass backdrop-saturate-glass hover:bg-glass-hover active:bg-glass-active sm:inline-flex",
8554
8620
  onClick: () => scrollTableHorizontally("right"),
8555
- children: /* @__PURE__ */ jsx35(ChevronRight, { className: "h-5 w-5" })
8621
+ children: /* @__PURE__ */ jsx36(ChevronRight, { className: "h-5 w-5" })
8556
8622
  }
8557
8623
  ) : null
8558
8624
  ] }),
8559
- appendQuery ? /* @__PURE__ */ jsxs26(
8625
+ appendQuery ? /* @__PURE__ */ jsxs27(
8560
8626
  "div",
8561
8627
  {
8562
8628
  "data-matrx-table-footer": true,
8563
- className: "flex min-h-16 shrink-0 items-center justify-between gap-3 border-t border-border px-3 py-2",
8629
+ className: "flex min-h-16 shrink-0 flex-wrap items-center justify-between gap-3 border-t border-border px-3 py-2",
8564
8630
  "aria-busy": isLoading || isFetching,
8565
8631
  children: [
8566
- /* @__PURE__ */ jsxs26(
8632
+ /* @__PURE__ */ jsxs27(
8567
8633
  "div",
8568
8634
  {
8569
8635
  ...isFetching && !isLoading ? {} : { role: "status", "aria-live": "polite" },
8570
- className: "flex min-w-0 flex-1 items-center gap-2 text-xs text-muted-foreground",
8636
+ className: "flex w-full min-w-0 flex-none items-center gap-2 text-xs text-muted-foreground sm:w-auto sm:flex-1",
8571
8637
  children: [
8572
- isLoading ? /* @__PURE__ */ jsx35(
8638
+ isLoading ? /* @__PURE__ */ jsx36(
8573
8639
  Loader2,
8574
8640
  {
8575
8641
  "data-matrx-table-append-loader": true,
@@ -8577,24 +8643,48 @@ function MatrxDataTableCore({
8577
8643
  className: "h-5 w-5 shrink-0 animate-spin text-primary motion-reduce:animate-none"
8578
8644
  }
8579
8645
  ) : null,
8580
- /* @__PURE__ */ jsxs26("div", { className: "min-w-0", children: [
8581
- /* @__PURE__ */ jsx35("p", { className: "break-words font-medium text-foreground", children: isLoading ? "Loading rows\u2026" : `${data.length.toLocaleString()} loaded${appendQuery.pagination.totalItems === void 0 ? "" : ` of ${appendQuery.pagination.totalItems.toLocaleString()}`}` }),
8582
- appendQuery.pagination.sourceUntil ? /* @__PURE__ */ jsxs26("p", { children: [
8583
- "Source fixed through ",
8646
+ /* @__PURE__ */ jsxs27("div", { className: "min-w-0", children: [
8647
+ /* @__PURE__ */ jsx36("p", { className: "break-words font-medium text-foreground", children: isLoading ? "Loading rows\u2026" : `${data.length.toLocaleString()} loaded${appendQuery.pagination.totalItems === void 0 ? "" : ` of ${appendQuery.pagination.totalItems.toLocaleString()}`}` }),
8648
+ appendQuery.pagination.sourceUntil ? /* @__PURE__ */ jsxs27("p", { children: [
8649
+ "Source fixed through",
8650
+ " ",
8584
8651
  new Date(appendQuery.pagination.sourceUntil).toLocaleString(),
8585
8652
  "."
8586
8653
  ] }) : null,
8587
- !isLoading && !isFetching && !appendQuery.pagination.loadAll?.isLoading && !scrollPagination.error && !appendQuery.pagination.hasNextPage && appendQuery.pagination.totalItems !== void 0 && data.length === appendQuery.pagination.totalItems ? /* @__PURE__ */ jsx35("p", { children: "All source rows are loaded." }) : appendUsesLocalProcessing ? /* @__PURE__ */ jsx35("p", { children: "Local search and filters cover loaded rows." }) : null,
8588
- scrollPagination.error ? /* @__PURE__ */ jsx35("p", { role: "alert", className: "break-words text-destructive", children: scrollPagination.error.message }) : null
8654
+ !isLoading && !isFetching && !appendQuery.pagination.loadAll?.isLoading && !scrollPagination.error && !appendQuery.pagination.hasNextPage && appendQuery.pagination.totalItems !== void 0 && data.length === appendQuery.pagination.totalItems ? /* @__PURE__ */ jsx36("p", { children: "All source rows are loaded." }) : appendUsesLocalProcessing ? /* @__PURE__ */ jsx36("p", { children: "Local search and filters cover loaded rows." }) : null,
8655
+ scrollPagination.error ? /* @__PURE__ */ jsx36("p", { role: "alert", className: "break-words text-destructive", children: scrollPagination.error.message }) : null
8589
8656
  ] })
8590
8657
  ]
8591
8658
  }
8592
8659
  ),
8593
- appendQuery.pagination.sourcePageSize ? /* @__PURE__ */ jsxs26(Select, { value: String(appendQuery.pagination.sourcePageSize.value), onValueChange: (value) => appendQuery.pagination.sourcePageSize?.onChange(Number(value)), children: [
8594
- /* @__PURE__ */ jsx35(SelectTrigger, { "aria-label": "Rows per load", className: "h-8 w-24 text-xs", disabled: isLoading || isFetching || appendQuery.pagination.loadAll?.isLoading, children: /* @__PURE__ */ jsx35(SelectValue, {}) }),
8595
- /* @__PURE__ */ jsx35(SelectContent, { children: appendQuery.pagination.sourcePageSize.options.map((size) => /* @__PURE__ */ jsx35(SelectItem, { value: String(size), children: size }, size)) })
8596
- ] }) : null,
8597
- appendQuery.pagination.loadAll?.isLoading ? /* @__PURE__ */ jsx35(Button, { type: "button", variant: "outline", onClick: appendQuery.pagination.loadAll.stop, children: "Stop loading" }) : scrollPagination.error ? /* @__PURE__ */ jsx35(
8660
+ appendQuery.pagination.sourcePageSize ? /* @__PURE__ */ jsxs27(
8661
+ Select,
8662
+ {
8663
+ value: String(appendQuery.pagination.sourcePageSize.value),
8664
+ onValueChange: (value) => appendQuery.pagination.sourcePageSize?.onChange(Number(value)),
8665
+ children: [
8666
+ /* @__PURE__ */ jsx36(
8667
+ SelectTrigger,
8668
+ {
8669
+ "aria-label": "Rows per load",
8670
+ className: "h-8 w-20 shrink-0 text-xs sm:w-24",
8671
+ disabled: isLoading || isFetching || appendQuery.pagination.loadAll?.isLoading,
8672
+ children: /* @__PURE__ */ jsx36(SelectValue, {})
8673
+ }
8674
+ ),
8675
+ /* @__PURE__ */ jsx36(SelectContent, { children: appendQuery.pagination.sourcePageSize.options.map((size) => /* @__PURE__ */ jsx36(SelectItem, { value: String(size), children: size }, size)) })
8676
+ ]
8677
+ }
8678
+ ) : null,
8679
+ appendQuery.pagination.loadAll?.isLoading ? /* @__PURE__ */ jsx36(
8680
+ Button,
8681
+ {
8682
+ type: "button",
8683
+ variant: "outline",
8684
+ onClick: appendQuery.pagination.loadAll.stop,
8685
+ children: "Stop loading"
8686
+ }
8687
+ ) : scrollPagination.error ? /* @__PURE__ */ jsx36(
8598
8688
  Button,
8599
8689
  {
8600
8690
  type: "button",
@@ -8602,13 +8692,33 @@ function MatrxDataTableCore({
8602
8692
  onClick: appendQuery.pagination.retrySource ?? (appendQuery.pagination.hasNextPage ? appendQuery.pagination.loadNextPage : appendQuery.pagination.refresh),
8603
8693
  children: appendQuery.pagination.retrySource ? "Retry source" : appendQuery.pagination.hasNextPage ? "Retry" : "Reload rows"
8604
8694
  }
8605
- ) : appendQuery.pagination.hasNextPage || scrollPagination.error ? /* @__PURE__ */ jsxs26("div", { className: "flex gap-1", children: [
8606
- /* @__PURE__ */ jsx35(Button, { type: "button", variant: "outline", disabled: isLoading || isFetching, onClick: () => void scrollPagination.requestNextPage(), children: "Load more" }),
8607
- appendQuery.pagination.loadAll ? /* @__PURE__ */ jsx35(Button, { type: "button", variant: "ghost", disabled: isLoading || isFetching, onClick: appendQuery.pagination.loadAll.request, children: "Load all" }) : null
8608
- ] }) : !isLoading && appendQuery.pagination.totalItems !== void 0 && data.length === appendQuery.pagination.totalItems ? /* @__PURE__ */ jsx35("span", { className: "text-xs text-muted-foreground", children: "All rows loaded" }) : null
8695
+ ) : appendQuery.pagination.hasNextPage || scrollPagination.error ? /* @__PURE__ */ jsxs27("div", { className: "flex flex-wrap gap-1", children: [
8696
+ /* @__PURE__ */ jsx36(
8697
+ Button,
8698
+ {
8699
+ type: "button",
8700
+ size: "sm",
8701
+ variant: "outline",
8702
+ disabled: isLoading || isFetching,
8703
+ onClick: () => void scrollPagination.requestNextPage(),
8704
+ children: "Load more"
8705
+ }
8706
+ ),
8707
+ appendQuery.pagination.loadAll ? /* @__PURE__ */ jsx36(
8708
+ Button,
8709
+ {
8710
+ type: "button",
8711
+ size: "sm",
8712
+ variant: "ghost",
8713
+ disabled: isLoading || isFetching,
8714
+ onClick: appendQuery.pagination.loadAll.request,
8715
+ children: "Load all"
8716
+ }
8717
+ ) : null
8718
+ ] }) : !isLoading && appendQuery.pagination.totalItems !== void 0 && data.length === appendQuery.pagination.totalItems ? /* @__PURE__ */ jsx36("span", { className: "text-xs text-muted-foreground", children: "All rows loaded" }) : null
8609
8719
  ]
8610
8720
  }
8611
- ) : !hidePagination && totalItems > 0 ? /* @__PURE__ */ jsx35("div", { className: "shrink-0", children: /* @__PURE__ */ jsx35(
8721
+ ) : !hidePagination && totalItems > 0 ? /* @__PURE__ */ jsx36("div", { className: "shrink-0", children: /* @__PURE__ */ jsx36(
8612
8722
  GenericTablePagination,
8613
8723
  {
8614
8724
  totalItems,
@@ -8628,7 +8738,7 @@ function MatrxDataTableCore({
8628
8738
  }
8629
8739
  ) }) : null
8630
8740
  ] }),
8631
- /* @__PURE__ */ jsx35(
8741
+ /* @__PURE__ */ jsx36(
8632
8742
  ColumnManager,
8633
8743
  {
8634
8744
  open: columnManagerOpen,
@@ -8639,7 +8749,7 @@ function MatrxDataTableCore({
8639
8749
  onApply: commitColumnState
8640
8750
  }
8641
8751
  ),
8642
- detailEnabled && selectedRow ? /* @__PURE__ */ jsx35(
8752
+ detailEnabled && selectedRow ? /* @__PURE__ */ jsx36(
8643
8753
  SidePanelSurface,
8644
8754
  {
8645
8755
  title: resolveStringTitle(
@@ -8650,8 +8760,8 @@ function MatrxDataTableCore({
8650
8760
  description: detail?.description?.(selectedRow),
8651
8761
  onClose: () => setSelectedId(null),
8652
8762
  defaultWidth: detail?.defaultWidth ?? 480,
8653
- headerActions: /* @__PURE__ */ jsxs26("div", { className: "flex items-center gap-1", children: [
8654
- copy && showRowCopy ? /* @__PURE__ */ jsx35(
8763
+ headerActions: /* @__PURE__ */ jsxs27("div", { className: "flex items-center gap-1", children: [
8764
+ copy && showRowCopy ? /* @__PURE__ */ jsx36(
8655
8765
  TableRowCopyControl,
8656
8766
  {
8657
8767
  size: "icon",
@@ -8661,7 +8771,7 @@ function MatrxDataTableCore({
8661
8771
  }
8662
8772
  ) : null,
8663
8773
  detail?.headerActions?.(selectedRow),
8664
- windowEnabled ? /* @__PURE__ */ jsx35(
8774
+ windowEnabled ? /* @__PURE__ */ jsx36(
8665
8775
  Button,
8666
8776
  {
8667
8777
  type: "button",
@@ -8671,7 +8781,7 @@ function MatrxDataTableCore({
8671
8781
  "aria-label": "Open in window",
8672
8782
  title: "Open in window",
8673
8783
  onClick: () => openWindow(selectedRow),
8674
- children: /* @__PURE__ */ jsx35(PanelRight, { className: "h-3.5 w-3.5" })
8784
+ children: /* @__PURE__ */ jsx36(PanelRight, { className: "h-3.5 w-3.5" })
8675
8785
  }
8676
8786
  ) : null
8677
8787
  ] }),
@@ -8683,7 +8793,7 @@ function MatrxDataTableCore({
8683
8793
  // fixes the whole class at once — a custom body that already
8684
8794
  // scrolls (`h-full` + `overflow-y-auto` root) still resolves to
8685
8795
  // this container's height, so no second scrollbar appears.
8686
- /* @__PURE__ */ jsx35("div", { className: "h-full min-h-0 overflow-y-auto", children: detail.render(selectedRow, {
8796
+ /* @__PURE__ */ jsx36("div", { className: "h-full min-h-0 overflow-y-auto", children: detail.render(selectedRow, {
8687
8797
  closeDetail: () => setSelectedId(null),
8688
8798
  openDetail: () => openDetail(selectedRow),
8689
8799
  openWindow: () => openWindow(selectedRow),
@@ -8691,7 +8801,7 @@ function MatrxDataTableCore({
8691
8801
  hasPendingEdits: Boolean(edits[getRowId(selectedRow)]),
8692
8802
  discardPendingEdits: () => discardRowEdits(getRowId(selectedRow))
8693
8803
  }) })
8694
- ) : /* @__PURE__ */ jsx35(
8804
+ ) : /* @__PURE__ */ jsx36(
8695
8805
  DataRowInspector,
8696
8806
  {
8697
8807
  row: selectedRow,
@@ -8703,7 +8813,7 @@ function MatrxDataTableCore({
8703
8813
  )
8704
8814
  }
8705
8815
  ) : null,
8706
- windowRow ? /* @__PURE__ */ jsx35(
8816
+ windowRow ? /* @__PURE__ */ jsx36(
8707
8817
  DataRowWindow,
8708
8818
  {
8709
8819
  isOpen: true,
@@ -8714,8 +8824,8 @@ function MatrxDataTableCore({
8714
8824
  height: windowConfig?.height,
8715
8825
  windowId: `matrx-data-row-${urlState?.id ?? "local"}-${getRowId(windowRow)}`,
8716
8826
  defaultTab: windowConfig?.defaultTab,
8717
- headerActions: /* @__PURE__ */ jsxs26("div", { className: "flex items-center gap-1", children: [
8718
- opensWindowOnRowClick && detailEnabled ? /* @__PURE__ */ jsx35(
8827
+ headerActions: /* @__PURE__ */ jsxs27("div", { className: "flex items-center gap-1", children: [
8828
+ opensWindowOnRowClick && detailEnabled ? /* @__PURE__ */ jsx36(
8719
8829
  Button,
8720
8830
  {
8721
8831
  type: "button",
@@ -8728,10 +8838,10 @@ function MatrxDataTableCore({
8728
8838
  closeWindow();
8729
8839
  openDetail(windowRow);
8730
8840
  },
8731
- children: /* @__PURE__ */ jsx35(PanelRightOpen, { className: "h-3.5 w-3.5" })
8841
+ children: /* @__PURE__ */ jsx36(PanelRightOpen, { className: "h-3.5 w-3.5" })
8732
8842
  }
8733
8843
  ) : null,
8734
- copy ? /* @__PURE__ */ jsx35(
8844
+ copy ? /* @__PURE__ */ jsx36(
8735
8845
  TableRowCopyControl,
8736
8846
  {
8737
8847
  size: "icon",
@@ -8748,7 +8858,7 @@ function MatrxDataTableCore({
8748
8858
  closeWindow,
8749
8859
  hasPendingEdits: Boolean(edits[getRowId(windowRow)]),
8750
8860
  discardPendingEdits: () => discardRowEdits(getRowId(windowRow))
8751
- }) ?? (copy ? /* @__PURE__ */ jsx35(
8861
+ }) ?? (copy ? /* @__PURE__ */ jsx36(
8752
8862
  DataRowInspector,
8753
8863
  {
8754
8864
  row: windowRow,
@@ -8783,15 +8893,15 @@ function MatrxDataTableCore({
8783
8893
  })
8784
8894
  }
8785
8895
  ) : null,
8786
- editEnabled ? /* @__PURE__ */ jsxs26(Fragment7, { children: [
8787
- foreignDrafts.length > 0 ? /* @__PURE__ */ jsxs26(
8896
+ editEnabled ? /* @__PURE__ */ jsxs27(Fragment7, { children: [
8897
+ foreignDrafts.length > 0 ? /* @__PURE__ */ jsxs27(
8788
8898
  "div",
8789
8899
  {
8790
8900
  "data-matrx-foreign-drafts": true,
8791
8901
  className: "fixed inset-x-3 bottom-20 z-50 flex flex-wrap items-center justify-center gap-2 rounded-lg border border-amber-500/40 bg-card px-3 py-2 text-xs shadow-lg sm:inset-x-auto sm:left-1/2 sm:-translate-x-1/2 sm:flex-nowrap",
8792
8902
  children: [
8793
- /* @__PURE__ */ jsx35("span", { children: "Unsaved edits from previous results" }),
8794
- /* @__PURE__ */ jsx35(
8903
+ /* @__PURE__ */ jsx36("span", { children: "Unsaved edits from previous results" }),
8904
+ /* @__PURE__ */ jsx36(
8795
8905
  CopyButtons,
8796
8906
  {
8797
8907
  size: "xs",
@@ -8800,11 +8910,11 @@ function MatrxDataTableCore({
8800
8910
  json: () => foreignDraftPayload
8801
8911
  }
8802
8912
  ),
8803
- /* @__PURE__ */ jsx35(Button, { type: "button", size: "sm", variant: "ghost", className: "h-7 text-xs text-destructive", onClick: () => setConfirmForeignDraftDiscard(true), children: "Discard drafts" })
8913
+ /* @__PURE__ */ jsx36(Button, { type: "button", size: "sm", variant: "ghost", className: "h-7 text-xs text-destructive", onClick: () => setConfirmForeignDraftDiscard(true), children: "Discard drafts" })
8804
8914
  ]
8805
8915
  }
8806
8916
  ) : null,
8807
- /* @__PURE__ */ jsx35(
8917
+ /* @__PURE__ */ jsx36(
8808
8918
  ConfirmDialog,
8809
8919
  {
8810
8920
  open: confirmForeignDraftDiscard,
@@ -8824,7 +8934,7 @@ function MatrxDataTableCore({
8824
8934
  }
8825
8935
  }
8826
8936
  ),
8827
- /* @__PURE__ */ jsx35(
8937
+ /* @__PURE__ */ jsx36(
8828
8938
  DirtySavePill,
8829
8939
  {
8830
8940
  changeCount,
@@ -8837,11 +8947,11 @@ function MatrxDataTableCore({
8837
8947
  ]
8838
8948
  }
8839
8949
  ),
8840
- /* @__PURE__ */ jsx35(DragOverlay, { children: draggedRow ? (
8950
+ /* @__PURE__ */ jsx36(DragOverlay, { children: draggedRow ? (
8841
8951
  // w-max: the overlay inherits the ACTIVE node's size, and the active
8842
8952
  // node is the 16px grip handle — without it the label wraps to one
8843
8953
  // character per line.
8844
- /* @__PURE__ */ jsx35("div", { className: "w-max max-w-xs truncate rounded border border-border bg-card px-2.5 py-1.5 text-sm font-medium text-foreground shadow-md", children: hierarchy?.itemLabel?.(draggedRow) ?? "Moving row" })
8954
+ /* @__PURE__ */ jsx36("div", { className: "w-max max-w-xs truncate rounded border border-border bg-card px-2.5 py-1.5 text-sm font-medium text-foreground shadow-md", children: hierarchy?.itemLabel?.(draggedRow) ?? "Moving row" })
8845
8955
  ) : null })
8846
8956
  ]
8847
8957
  }
@@ -8856,7 +8966,7 @@ function HierarchyDragHandle({
8856
8966
  id,
8857
8967
  disabled
8858
8968
  });
8859
- return /* @__PURE__ */ jsx35(
8969
+ return /* @__PURE__ */ jsx36(
8860
8970
  "button",
8861
8971
  {
8862
8972
  ref: setNodeRef,
@@ -8868,7 +8978,7 @@ function HierarchyDragHandle({
8868
8978
  onClick: (event) => event.stopPropagation(),
8869
8979
  ...attributes,
8870
8980
  ...listeners,
8871
- children: /* @__PURE__ */ jsx35(GripVertical, { className: "h-3.5 w-3.5" })
8981
+ children: /* @__PURE__ */ jsx36(GripVertical, { className: "h-3.5 w-3.5" })
8872
8982
  }
8873
8983
  );
8874
8984
  }
@@ -8877,7 +8987,7 @@ function HierarchyRootDropTarget({
8877
8987
  draggedLabel
8878
8988
  }) {
8879
8989
  const { isOver, setNodeRef } = useDroppable2({ id: "__root__" });
8880
- return /* @__PURE__ */ jsxs26(
8990
+ return /* @__PURE__ */ jsxs27(
8881
8991
  "div",
8882
8992
  {
8883
8993
  ref: setNodeRef,
@@ -8887,8 +8997,8 @@ function HierarchyRootDropTarget({
8887
8997
  isOver && "border-solid bg-primary/20 shadow-md shadow-primary/25"
8888
8998
  ),
8889
8999
  children: [
8890
- /* @__PURE__ */ jsx35("span", { className: "truncate", children: draggedLabel }),
8891
- /* @__PURE__ */ jsx35("span", { className: "text-primary/75", children: label })
9000
+ /* @__PURE__ */ jsx36("span", { className: "truncate", children: draggedLabel }),
9001
+ /* @__PURE__ */ jsx36("span", { className: "text-primary/75", children: label })
8892
9002
  ]
8893
9003
  }
8894
9004
  );
@@ -8937,7 +9047,7 @@ function HierarchyDragIndicatorLayer({
8937
9047
  const { preview: preview2 } = indicator;
8938
9048
  const indent = indicator.left + 10 + preview2.depth * 12;
8939
9049
  if (preview2.position === "inside") {
8940
- return /* @__PURE__ */ jsx35(
9050
+ return /* @__PURE__ */ jsx36(
8941
9051
  "div",
8942
9052
  {
8943
9053
  "aria-hidden": "true",
@@ -8949,7 +9059,7 @@ function HierarchyDragIndicatorLayer({
8949
9059
  width: Math.max(0, indicator.width - 4),
8950
9060
  height: indicator.height
8951
9061
  },
8952
- children: /* @__PURE__ */ jsxs26(
9062
+ children: /* @__PURE__ */ jsxs27(
8953
9063
  "span",
8954
9064
  {
8955
9065
  className: "absolute top-1/2 -translate-y-1/2 whitespace-nowrap rounded bg-card/95 px-1.5 py-0.5 text-[10px] font-medium text-primary",
@@ -8964,7 +9074,7 @@ function HierarchyDragIndicatorLayer({
8964
9074
  );
8965
9075
  }
8966
9076
  const lineTop = preview2.position === "before" ? indicator.top - 1 : indicator.top + indicator.height - 1;
8967
- return /* @__PURE__ */ jsx35(
9077
+ return /* @__PURE__ */ jsx36(
8968
9078
  "div",
8969
9079
  {
8970
9080
  "aria-hidden": "true",
@@ -8975,9 +9085,9 @@ function HierarchyDragIndicatorLayer({
8975
9085
  left: indent,
8976
9086
  width: Math.max(0, indicator.left + indicator.width - indent - 8)
8977
9087
  },
8978
- children: /* @__PURE__ */ jsxs26("div", { className: "relative h-0.5 rounded-full bg-primary", children: [
8979
- /* @__PURE__ */ jsx35("span", { className: "absolute -left-1 top-1/2 h-2 w-2 -translate-y-1/2 rounded-full border-2 border-primary bg-card" }),
8980
- /* @__PURE__ */ jsxs26(
9088
+ children: /* @__PURE__ */ jsxs27("div", { className: "relative h-0.5 rounded-full bg-primary", children: [
9089
+ /* @__PURE__ */ jsx36("span", { className: "absolute -left-1 top-1/2 h-2 w-2 -translate-y-1/2 rounded-full border-2 border-primary bg-card" }),
9090
+ /* @__PURE__ */ jsxs27(
8981
9091
  "span",
8982
9092
  {
8983
9093
  className: cn(
@@ -9018,7 +9128,7 @@ function ColumnHeaderDropZone({
9018
9128
  disabled: !enabled,
9019
9129
  data: { matrxDragKind: "column-header", columnId: id }
9020
9130
  });
9021
- return /* @__PURE__ */ jsx35("div", { ref: setNodeRef, className: "flex min-w-0 items-center", children });
9131
+ return /* @__PURE__ */ jsx36("div", { ref: setNodeRef, className: "flex min-w-0 items-center", children });
9022
9132
  }
9023
9133
  function columnWidthVar(width) {
9024
9134
  if (width === void 0) return void 0;
@@ -9034,7 +9144,7 @@ function renderCell(row, col, index) {
9034
9144
  if (asUuid && typeof raw === "string") {
9035
9145
  const forbidden = typeof col.fk?.forbidden === "function" ? col.fk.forbidden(raw, row) : Boolean(col.fk?.forbidden);
9036
9146
  const declaredToken = typeof col.fk?.token === "function" ? col.fk.token(row) : col.fk?.token;
9037
- return /* @__PURE__ */ jsx35(
9147
+ return /* @__PURE__ */ jsx36(
9038
9148
  MatrxUuidCell,
9039
9149
  {
9040
9150
  value: raw,
@@ -9046,7 +9156,7 @@ function renderCell(row, col, index) {
9046
9156
  }
9047
9157
  );
9048
9158
  }
9049
- return /* @__PURE__ */ jsx35("span", { className: "text-sm text-foreground", children: stringifyCellValue(raw) || "\u2014" });
9159
+ return /* @__PURE__ */ jsx36("span", { className: "text-sm text-foreground", children: stringifyCellValue(raw) || "\u2014" });
9050
9160
  }
9051
9161
  function defaultRowTitle(row, columns) {
9052
9162
  for (const col of columns) {
@@ -9070,6 +9180,7 @@ export {
9070
9180
  MatrxDataTable,
9071
9181
  MatrxDataTableProvider,
9072
9182
  MatrxUuidCell,
9183
+ TableTitleRow,
9073
9184
  buildRowAgentInput,
9074
9185
  buildViewAgentInput,
9075
9186
  buildViewHuman,