@declarion/react 0.2.5 → 0.2.7

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.
@@ -636,7 +636,64 @@ var K = (e, t = {}) => ({ size: n = 14, cls: r = "", style: i = {} }) => /* @__P
636
636
  cy: "12",
637
637
  r: "9"
638
638
  }), /* @__PURE__ */ V("path", { d: "m5.6 5.6 12.8 12.8" })] })),
639
- "trash-2": K(/* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V("path", { d: "M4 7h16M9 7V4h6v3M6 7l1 13a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2l1-13" }), /* @__PURE__ */ V("path", { d: "M10 11v6M14 11v6" })] }))
639
+ "trash-2": K(/* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V("path", { d: "M4 7h16M9 7V4h6v3M6 7l1 13a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2l1-13" }), /* @__PURE__ */ V("path", { d: "M10 11v6M14 11v6" })] })),
640
+ "shopping-cart": K(/* @__PURE__ */ H(B, { children: [
641
+ /* @__PURE__ */ V("circle", {
642
+ cx: "9",
643
+ cy: "20",
644
+ r: "1.5"
645
+ }),
646
+ /* @__PURE__ */ V("circle", {
647
+ cx: "18",
648
+ cy: "20",
649
+ r: "1.5"
650
+ }),
651
+ /* @__PURE__ */ V("path", { d: "M2 3h3l3 12h10l3-8H7" })
652
+ ] })),
653
+ "credit-card": K(/* @__PURE__ */ H(B, { children: [
654
+ /* @__PURE__ */ V("rect", {
655
+ x: "3",
656
+ y: "5",
657
+ width: "18",
658
+ height: "14",
659
+ rx: "2"
660
+ }),
661
+ /* @__PURE__ */ V("path", { d: "M3 10h18" }),
662
+ /* @__PURE__ */ V("path", { d: "M7 15h4" })
663
+ ] })),
664
+ package: K(/* @__PURE__ */ H(B, { children: [
665
+ /* @__PURE__ */ V("path", { d: "M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z" }),
666
+ /* @__PURE__ */ V("path", { d: "m3.3 7 8.7 5 8.7-5" }),
667
+ /* @__PURE__ */ V("path", { d: "M12 22V12" })
668
+ ] })),
669
+ boxes: K(/* @__PURE__ */ H(B, { children: [
670
+ /* @__PURE__ */ V("path", { d: "M7.5 7.5 3 10v5l4.5 2.5L12 15v-5z" }),
671
+ /* @__PURE__ */ V("path", { d: "M16.5 7.5 12 10v5l4.5 2.5L21 15v-5z" }),
672
+ /* @__PURE__ */ V("path", { d: "M12 2.5 7.5 5v5L12 12.5 16.5 10V5z" })
673
+ ] })),
674
+ tags: K(/* @__PURE__ */ H(B, { children: [
675
+ /* @__PURE__ */ V("path", { d: "M4 4h7l9 9-7 7-9-9z" }),
676
+ /* @__PURE__ */ V("path", { d: "M8 8h.01" }),
677
+ /* @__PURE__ */ V("path", { d: "M13 4h2l6 6" })
678
+ ] })),
679
+ "wallet-cards": K(/* @__PURE__ */ H(B, { children: [
680
+ /* @__PURE__ */ V("rect", {
681
+ x: "3",
682
+ y: "7",
683
+ width: "18",
684
+ height: "13",
685
+ rx: "2"
686
+ }),
687
+ /* @__PURE__ */ V("path", { d: "M16 11h5v5h-5a2.5 2.5 0 0 1 0-5z" }),
688
+ /* @__PURE__ */ V("path", { d: "M5 7V5a2 2 0 0 1 2-2h10v4" })
689
+ ] })),
690
+ "receipt-text": K(/* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V("path", { d: "M6 3h12v18l-3-2-3 2-3-2-3 2z" }), /* @__PURE__ */ V("path", { d: "M9 8h6M9 12h6M9 16h4" })] })),
691
+ "badge-dollar-sign": K(/* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V("circle", {
692
+ cx: "12",
693
+ cy: "12",
694
+ r: "9"
695
+ }), /* @__PURE__ */ V("path", { d: "M12 6v12M15 9.5c-.7-.8-1.7-1.2-3-1.2-1.6 0-2.7.8-2.7 2s1 1.7 2.7 2.1c1.8.4 3 .9 3 2.3S13.8 17 12 17c-1.4 0-2.6-.5-3.4-1.4" })] })),
696
+ "undo-2": K(/* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V("path", { d: "M9 14 4 9l5-5" }), /* @__PURE__ */ V("path", { d: "M4 9h10a6 6 0 1 1 0 12h-2" })] }))
640
697
  }, J = j(function({ kind: e = "default", size: t = "sm", icon: n, iconRight: r, children: i, onClick: a, active: o, danger: s, style: c, disabled: l, type: u = "button", title: d, ...f }, p) {
641
698
  let m = {
642
699
  display: "inline-flex",
@@ -1496,12 +1553,21 @@ function Ae({ value: e, onChange: t, placeholder: n, rows: r = 4, fill: i, id: a
1496
1553
  }
1497
1554
  });
1498
1555
  }
1499
- function je({ value: e, options: t, onChange: n, placeholder: r = "Select...", ...i }) {
1500
- let [a, o] = R(!1), s = L(null), c = t.find((t) => t.value === e);
1556
+ var je = 20, Me = 100;
1557
+ function Ne(e) {
1558
+ return typeof e.label == "string" || typeof e.label == "number" ? String(e.label) : e.value;
1559
+ }
1560
+ function Pe({ value: e, options: t, onChange: n, placeholder: r = "Select...", ...i }) {
1561
+ let [a, o] = R(!1), [s, c] = R(""), l = L(null), u = t.find((t) => t.value === e), d = t.length > je, f = I(() => {
1562
+ let e = s.trim().toLowerCase();
1563
+ return e ? t.filter((t) => Ne(t).toLowerCase().includes(e)).slice(0, Me) : t.slice(0, Me);
1564
+ }, [t, s]);
1501
1565
  return /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ H("button", {
1502
1566
  type: "button",
1503
- ref: s,
1504
- onClick: () => o(!a),
1567
+ ref: l,
1568
+ onClick: () => {
1569
+ o(!a), a || c("");
1570
+ },
1505
1571
  ...i,
1506
1572
  style: {
1507
1573
  ...ke,
@@ -1511,7 +1577,7 @@ function je({ value: e, options: t, onChange: n, placeholder: r = "Select...", .
1511
1577
  textAlign: "left",
1512
1578
  cursor: "pointer",
1513
1579
  ...i.style,
1514
- color: c ? "var(--text)" : "var(--text-placeholder)"
1580
+ color: u ? "var(--text)" : "var(--text-placeholder)"
1515
1581
  },
1516
1582
  children: [/* @__PURE__ */ V("span", {
1517
1583
  style: {
@@ -1521,27 +1587,57 @@ function je({ value: e, options: t, onChange: n, placeholder: r = "Select...", .
1521
1587
  overflow: "hidden",
1522
1588
  textOverflow: "ellipsis"
1523
1589
  },
1524
- children: c ? c.label : r
1590
+ children: u ? u.label : r
1525
1591
  }), /* @__PURE__ */ V(q.down, {
1526
1592
  size: 12,
1527
1593
  cls: "",
1528
1594
  style: { color: "var(--text-3)" }
1529
1595
  })]
1530
- }), /* @__PURE__ */ V(le, {
1596
+ }), /* @__PURE__ */ H(le, {
1531
1597
  open: a,
1532
- anchor: s.current,
1598
+ anchor: l.current,
1533
1599
  onClose: () => o(!1),
1534
- width: s.current?.offsetWidth,
1535
- children: t.map((t) => /* @__PURE__ */ V(Te, {
1536
- onClick: () => {
1537
- n(t.value), o(!1);
1538
- },
1539
- active: t.value === e,
1540
- children: t.label
1541
- }, t.value))
1600
+ width: l.current?.offsetWidth,
1601
+ style: {
1602
+ maxHeight: "min(360px, calc(100vh - 24px))",
1603
+ overflowY: "auto"
1604
+ },
1605
+ children: [
1606
+ d && /* @__PURE__ */ V("div", {
1607
+ style: {
1608
+ padding: 6,
1609
+ position: "sticky",
1610
+ top: -4,
1611
+ background: "var(--surface)",
1612
+ zIndex: 1
1613
+ },
1614
+ children: /* @__PURE__ */ V(Z, {
1615
+ value: s,
1616
+ onChange: c,
1617
+ placeholder: "Search…",
1618
+ prefix: /* @__PURE__ */ V(q.search, { size: 12 }),
1619
+ autoFocus: !0
1620
+ })
1621
+ }),
1622
+ f.map((t) => /* @__PURE__ */ V(Te, {
1623
+ onClick: () => {
1624
+ n(t.value), o(!1);
1625
+ },
1626
+ active: t.value === e,
1627
+ children: t.label
1628
+ }, t.value)),
1629
+ f.length === 0 && /* @__PURE__ */ V("div", {
1630
+ style: {
1631
+ padding: "8px 10px",
1632
+ fontSize: 12.5,
1633
+ color: "var(--text-3)"
1634
+ },
1635
+ children: "No matches"
1636
+ })
1637
+ ]
1542
1638
  })] });
1543
1639
  }
1544
- function Me({ value: e, onChange: t }) {
1640
+ function Fe({ value: e, onChange: t }) {
1545
1641
  return /* @__PURE__ */ V(Z, {
1546
1642
  value: e || "",
1547
1643
  onChange: t,
@@ -1549,26 +1645,26 @@ function Me({ value: e, onChange: t }) {
1549
1645
  prefix: /* @__PURE__ */ V(q.calendar, { size: 13 })
1550
1646
  });
1551
1647
  }
1552
- function Ne(e) {
1648
+ function Ie(e) {
1553
1649
  if (!e) return 0;
1554
1650
  let t = 0;
1555
1651
  return e.length >= 8 && t++, e.length >= 12 && t++, /[A-Z]/.test(e) && /[a-z]/.test(e) && t++, /\d/.test(e) && t++, /[^A-Za-z0-9]/.test(e) && t++, Math.min(4, t);
1556
1652
  }
1557
- var Pe = [
1653
+ var Le = [
1558
1654
  "Too short",
1559
1655
  "Weak",
1560
1656
  "Fair",
1561
1657
  "Good",
1562
1658
  "Strong"
1563
- ], Fe = [
1659
+ ], Re = [
1564
1660
  "var(--danger)",
1565
1661
  "var(--danger)",
1566
1662
  "var(--warning, #B45309)",
1567
1663
  "var(--accent)",
1568
1664
  "var(--success, #3FBF8F)"
1569
1665
  ];
1570
- function Ie({ value: e, onChange: t, placeholder: n = "Enter password", showStrength: r, id: i, name: a, ariaRequired: o }) {
1571
- let [s, c] = R(!1), l = e || "", u = Ne(l);
1666
+ function ze({ value: e, onChange: t, placeholder: n = "Enter password", showStrength: r, id: i, name: a, ariaRequired: o }) {
1667
+ let [s, c] = R(!1), l = e || "", u = Ie(l);
1572
1668
  return /* @__PURE__ */ H("div", { children: [/* @__PURE__ */ V(Z, {
1573
1669
  id: i,
1574
1670
  name: a,
@@ -1613,7 +1709,7 @@ function Ie({ value: e, onChange: t, placeholder: n = "Enter password", showStre
1613
1709
  flex: 1,
1614
1710
  height: 3,
1615
1711
  borderRadius: 999,
1616
- background: e < u ? Fe[u] : "var(--surface-3)",
1712
+ background: e < u ? Re[u] : "var(--surface-3)",
1617
1713
  transition: "background .15s"
1618
1714
  } }, e))
1619
1715
  }), /* @__PURE__ */ V("span", {
@@ -1623,11 +1719,11 @@ function Ie({ value: e, onChange: t, placeholder: n = "Enter password", showStre
1623
1719
  minWidth: 54,
1624
1720
  textAlign: "right"
1625
1721
  },
1626
- children: l ? Pe[u] : ""
1722
+ children: l ? Le[u] : ""
1627
1723
  })]
1628
1724
  })] });
1629
1725
  }
1630
- function Le({ value: e = [], onChange: t }) {
1726
+ function Be({ value: e = [], onChange: t }) {
1631
1727
  let [n, r] = R("");
1632
1728
  return /* @__PURE__ */ H("div", {
1633
1729
  style: {
@@ -1663,7 +1759,7 @@ function Le({ value: e = [], onChange: t }) {
1663
1759
  })]
1664
1760
  });
1665
1761
  }
1666
- function Re({ value: e, onChange: t }) {
1762
+ function Ve({ value: e, onChange: t }) {
1667
1763
  return /* @__PURE__ */ H("div", {
1668
1764
  style: {
1669
1765
  border: "1px solid var(--border)",
@@ -1722,7 +1818,7 @@ function Re({ value: e, onChange: t }) {
1722
1818
  })]
1723
1819
  });
1724
1820
  }
1725
- function ze({ value: e, entity: t = "company", onChange: n, items: r = [], id: i, ariaLabelledby: a, ariaRequired: o }) {
1821
+ function He({ value: e, entity: t = "company", onChange: n, items: r = [], id: i, ariaLabelledby: a, ariaRequired: o }) {
1726
1822
  let [s, c] = R(!1), l = L(null);
1727
1823
  return /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ H("button", {
1728
1824
  type: "button",
@@ -1788,7 +1884,7 @@ function ze({ value: e, entity: t = "company", onChange: n, items: r = [], id: i
1788
1884
  }, e.id))]
1789
1885
  })] });
1790
1886
  }
1791
- function Be({ label: e, children: t, mono: n, wide: r, empty: i }) {
1887
+ function Ue({ label: e, children: t, mono: n, wide: r, empty: i }) {
1792
1888
  return /* @__PURE__ */ H("div", {
1793
1889
  style: {
1794
1890
  display: "flex",
@@ -1821,7 +1917,7 @@ function Be({ label: e, children: t, mono: n, wide: r, empty: i }) {
1821
1917
  })]
1822
1918
  });
1823
1919
  }
1824
- function Ve({ value: e, onChange: t, type: n = "text", options: r }) {
1920
+ function We({ value: e, onChange: t, type: n = "text", options: r }) {
1825
1921
  let [i, a] = R(!1), [o, s] = R(e), c = () => {
1826
1922
  t && o !== void 0 && t(o), a(!1);
1827
1923
  }, l = () => {
@@ -1836,7 +1932,7 @@ function Ve({ value: e, onChange: t, type: n = "text", options: r }) {
1836
1932
  onKeyDown: (e) => {
1837
1933
  e.key === "Enter" && c(), e.key === "Escape" && l();
1838
1934
  },
1839
- children: [n === "select" ? /* @__PURE__ */ V(je, {
1935
+ children: [n === "select" ? /* @__PURE__ */ V(Pe, {
1840
1936
  value: o,
1841
1937
  options: r || [],
1842
1938
  onChange: (e) => {
@@ -1890,7 +1986,7 @@ function Ve({ value: e, onChange: t, type: n = "text", options: r }) {
1890
1986
  }
1891
1987
  //#endregion
1892
1988
  //#region src/types/ordmap.ts
1893
- var He = class e {
1989
+ var Ge = class e {
1894
1990
  #e;
1895
1991
  #t;
1896
1992
  constructor(e) {
@@ -1934,18 +2030,18 @@ var He = class e {
1934
2030
  function Q(e, t = "en") {
1935
2031
  return e ? e[t] ?? Object.values(e)[0] ?? "" : "";
1936
2032
  }
1937
- var Ue = "$display";
1938
- function We(e, t) {
2033
+ var Ke = "$display";
2034
+ function qe(e, t) {
1939
2035
  if (!e) return;
1940
- let n = e[Ue];
2036
+ let n = e[Ke];
1941
2037
  if (typeof n == "string" && n !== "") return n;
1942
2038
  let r = t?.display?.display_field;
1943
2039
  if (!r) return;
1944
2040
  let i = e[r];
1945
2041
  if (i != null) return typeof i == "object" && !Array.isArray(i) ? Q(i) || void 0 : String(i);
1946
2042
  }
1947
- function Ge(e, t, n) {
1948
- let r = e[Ue];
2043
+ function Je(e, t, n) {
2044
+ let r = e[Ke];
1949
2045
  if (typeof r == "string" && r !== "") return r;
1950
2046
  if (t) {
1951
2047
  let r = e[t];
@@ -1953,11 +2049,11 @@ function Ge(e, t, n) {
1953
2049
  }
1954
2050
  return n;
1955
2051
  }
1956
- function Ke(e) {
2052
+ function Ye(e) {
1957
2053
  let t = e.replace(/\/+$/, "").split("/").map((e) => e.startsWith(":") ? "[^/]+" : e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
1958
2054
  return RegExp("^" + t.join("/") + "$");
1959
2055
  }
1960
- function qe(e) {
2056
+ function Xe(e) {
1961
2057
  let t = (() => {
1962
2058
  try {
1963
2059
  return decodeURIComponent(e);
@@ -1967,17 +2063,17 @@ function qe(e) {
1967
2063
  })().split("-")[0];
1968
2064
  return t.length > 8 ? t.slice(0, 8) : t;
1969
2065
  }
1970
- function Je(e, t, n) {
2066
+ function Ze(e, t, n) {
1971
2067
  if (!t) return;
1972
2068
  let r = e.replace(/\/+$/, "") || "/", i;
1973
2069
  for (let e of Object.values(t)) {
1974
- if (!e.route || !Ke(e.route).test(r)) continue;
2070
+ if (!e.route || !Ye(e.route).test(r)) continue;
1975
2071
  let t = e.route.includes("/:"), a = Q(e.display?.name);
1976
2072
  if (!a && t && n && e.entity) {
1977
2073
  let t = Q(n[e.entity]?.display?.name);
1978
2074
  if (t) {
1979
2075
  let e = r.slice(r.lastIndexOf("/") + 1);
1980
- a = e ? `${t} ${qe(e)}` : t;
2076
+ a = e ? `${t} ${Xe(e)}` : t;
1981
2077
  }
1982
2078
  }
1983
2079
  if (!a) continue;
@@ -1990,7 +2086,7 @@ function Je(e, t, n) {
1990
2086
  }
1991
2087
  return i;
1992
2088
  }
1993
- function Ye(e, t, n) {
2089
+ function Qe(e, t, n) {
1994
2090
  let r = Q(e.display?.name);
1995
2091
  if (r) return r;
1996
2092
  if (e.type === "ref" && e.ref?.entity && n) {
@@ -2002,7 +2098,7 @@ function Ye(e, t, n) {
2002
2098
  }
2003
2099
  return t;
2004
2100
  }
2005
- function Xe(e) {
2101
+ function $e(e) {
2006
2102
  let t = e.name, n = e.display ? {
2007
2103
  ...e.display,
2008
2104
  name: e.display.name ?? t
@@ -2015,29 +2111,29 @@ function Xe(e) {
2015
2111
  structure: e.structure
2016
2112
  };
2017
2113
  }
2018
- function Ze(e, t) {
2114
+ function et(e, t) {
2019
2115
  return !e || e.readonly ? !1 : e.mutations?.[t] ?? !0;
2020
2116
  }
2021
- function Qe(e) {
2117
+ function tt(e) {
2022
2118
  if (e.primary_key && e.primary_key.length > 0) return e.primary_key;
2023
2119
  for (let [t, n] of e.fields) if (n.primary) return [t];
2024
2120
  return ["id"];
2025
2121
  }
2026
- function $e(e, t) {
2027
- let n = Qe(e), r = {};
2122
+ function nt(e, t) {
2123
+ let n = tt(e), r = {};
2028
2124
  for (let e of n) r[e] = String(t[e] ?? "");
2029
2125
  return r;
2030
2126
  }
2031
- function et(e) {
2127
+ function rt(e) {
2032
2128
  return e.length === 1 ? e[0] : JSON.stringify(e);
2033
2129
  }
2034
- function tt(e) {
2035
- return et(Object.values(e));
2130
+ function it(e) {
2131
+ return rt(Object.values(e));
2036
2132
  }
2037
- function nt(e, t) {
2038
- return et(Qe(e).map((e) => t[e] ?? ""));
2133
+ function at(e, t) {
2134
+ return rt(tt(e).map((e) => t[e] ?? ""));
2039
2135
  }
2040
- function rt(e, t) {
2136
+ function ot(e, t) {
2041
2137
  if (t <= 1) return [e];
2042
2138
  try {
2043
2139
  let n = JSON.parse(e);
@@ -2047,64 +2143,64 @@ function rt(e, t) {
2047
2143
  }
2048
2144
  return null;
2049
2145
  }
2050
- function it(e, t, n) {
2146
+ function st(e, t, n) {
2051
2147
  if (e?.detail_screen === "none") return null;
2052
2148
  let r = e?.detail_screen ?? t?.detail_screen;
2053
2149
  return r ? n?.[r]?.route ?? null : null;
2054
2150
  }
2055
- function at(e, t, n, r) {
2151
+ function ct(e, t, n, r) {
2056
2152
  if (!t) return null;
2057
- let i = it(e, n, r);
2153
+ let i = st(e, n, r);
2058
2154
  return i ? i.replace(":id", encodeURIComponent(t)) : null;
2059
2155
  }
2060
- function ot(e, t, n, r) {
2061
- return !t || Qe(t).some((e) => !r[e]) ? null : at(e, nt(t, r), t, n);
2156
+ function lt(e, t, n, r) {
2157
+ return !t || tt(t).some((e) => !r[e]) ? null : ct(e, at(t, r), t, n);
2062
2158
  }
2063
- function st(e, t, n, r) {
2064
- return t ? ot(e, t, n, $e(t, r)) : null;
2159
+ function ut(e, t, n, r) {
2160
+ return t ? lt(e, t, n, nt(t, r)) : null;
2065
2161
  }
2066
- function ct(e) {
2067
- return Qe(e).length > 1;
2162
+ function dt(e) {
2163
+ return tt(e).length > 1;
2068
2164
  }
2069
2165
  //#endregion
2070
2166
  //#region src/api/schema.ts
2071
- function lt(e) {
2167
+ function ft(e) {
2072
2168
  return {
2073
2169
  ...e,
2074
- params: e.params ? He.fromObject(e.params) : void 0
2170
+ params: e.params ? Ge.fromObject(e.params) : void 0
2075
2171
  };
2076
2172
  }
2077
- function ut(e) {
2173
+ function pt(e) {
2078
2174
  return {
2079
2175
  ...e,
2080
- resolved_params: e.resolved_params ? He.fromObject(e.resolved_params) : void 0
2176
+ resolved_params: e.resolved_params ? Ge.fromObject(e.resolved_params) : void 0
2081
2177
  };
2082
2178
  }
2083
- function dt(e) {
2179
+ function mt(e) {
2084
2180
  let t = {};
2085
- if (e.handlers) for (let [n, r] of Object.entries(e.handlers)) t[n] = lt(r);
2181
+ if (e.handlers) for (let [n, r] of Object.entries(e.handlers)) t[n] = ft(r);
2086
2182
  let n = {};
2087
- if (e.actions) for (let [t, r] of Object.entries(e.actions)) n[t] = ut(r);
2183
+ if (e.actions) for (let [t, r] of Object.entries(e.actions)) n[t] = pt(r);
2088
2184
  return {
2089
2185
  ...e,
2090
- fields: He.fromObject(e.fields),
2091
- files: e.files ? He.fromObject(e.files) : void 0,
2186
+ fields: Ge.fromObject(e.fields),
2187
+ files: e.files ? Ge.fromObject(e.files) : void 0,
2092
2188
  handlers: e.handlers ? t : void 0,
2093
2189
  actions: e.actions ? n : void 0
2094
2190
  };
2095
2191
  }
2096
- function ft(e) {
2192
+ function ht(e) {
2097
2193
  let t = {};
2098
- if (e.entities) for (let [n, r] of Object.entries(e.entities)) t[n] = dt(r);
2194
+ if (e.entities) for (let [n, r] of Object.entries(e.entities)) t[n] = mt(r);
2099
2195
  let n = {};
2100
2196
  if (e.structures) for (let [t, r] of Object.entries(e.structures)) n[t] = {
2101
2197
  ...r,
2102
- fields: He.fromObject(r.fields)
2198
+ fields: Ge.fromObject(r.fields)
2103
2199
  };
2104
2200
  let r = {};
2105
- if (e.handlers) for (let [t, n] of Object.entries(e.handlers)) r[t] = lt(n);
2201
+ if (e.handlers) for (let [t, n] of Object.entries(e.handlers)) r[t] = ft(n);
2106
2202
  let i = {};
2107
- if (e.actions) for (let [t, n] of Object.entries(e.actions)) i[t] = ut(n);
2203
+ if (e.actions) for (let [t, n] of Object.entries(e.actions)) i[t] = pt(n);
2108
2204
  return {
2109
2205
  ...e,
2110
2206
  entities: t,
@@ -2113,22 +2209,22 @@ function ft(e) {
2113
2209
  actions: i
2114
2210
  };
2115
2211
  }
2116
- async function pt() {
2117
- return ft(await e("/api/schema"));
2212
+ async function gt() {
2213
+ return ht(await e("/api/schema"));
2118
2214
  }
2119
2215
  //#endregion
2120
2216
  //#region src/api/auth.ts
2121
- async function mt() {
2217
+ async function _t() {
2122
2218
  return n("auth.check_setup");
2123
2219
  }
2124
- async function ht(e, t) {
2220
+ async function vt(e, t) {
2125
2221
  let r = await n("auth.login", {
2126
2222
  email: e,
2127
2223
  password: t
2128
2224
  });
2129
2225
  return f(r.expires_at), r;
2130
2226
  }
2131
- async function gt(e, t, r) {
2227
+ async function yt(e, t, r) {
2132
2228
  let i = await n("auth.signup", {
2133
2229
  email: e,
2134
2230
  password: t,
@@ -2136,42 +2232,42 @@ async function gt(e, t, r) {
2136
2232
  });
2137
2233
  return f(i.expires_at), i;
2138
2234
  }
2139
- async function _t() {
2235
+ async function bt() {
2140
2236
  return n("auth.me");
2141
2237
  }
2142
- async function vt() {
2238
+ async function xt() {
2143
2239
  return (await n("auth.list_tenants")).tenants;
2144
2240
  }
2145
- async function yt(e) {
2241
+ async function St(e) {
2146
2242
  let t = await n("auth.switch_tenant", { tenant_id: e });
2147
2243
  return f(t.expires_at), t;
2148
2244
  }
2149
- async function bt() {
2245
+ async function Ct() {
2150
2246
  await n("auth.logout");
2151
2247
  }
2152
- async function xt(e) {
2248
+ async function wt(e) {
2153
2249
  return (await n("sso_provider.list", e ? { tenant_code: e } : {})).providers;
2154
2250
  }
2155
- function St(e, t, n) {
2251
+ function Tt(e, t, n) {
2156
2252
  let r = new URLSearchParams();
2157
2253
  t && r.set("tenant", t), n && r.set("redirect", n);
2158
2254
  let i = r.toString();
2159
2255
  return `/api/auth/sso/authorize/${encodeURIComponent(e)}${i ? `?${i}` : ""}`;
2160
2256
  }
2161
- async function Ct(e, t, r) {
2257
+ async function Et(e, t, r) {
2162
2258
  let i = {
2163
2259
  target_user_id: e,
2164
2260
  reason: t
2165
2261
  };
2166
2262
  return r != null && (i.duration_minutes = r), n("impersonation.start", i);
2167
2263
  }
2168
- async function wt() {
2264
+ async function Dt() {
2169
2265
  return n("impersonation.stop");
2170
2266
  }
2171
- async function Tt(e) {
2267
+ async function Ot(e) {
2172
2268
  await n("impersonation.revoke", { session_id: e });
2173
2269
  }
2174
- async function Et(e, t) {
2270
+ async function kt(e, t) {
2175
2271
  await n("auth.change_password", {
2176
2272
  current_password: e,
2177
2273
  new_password: t
@@ -2179,7 +2275,7 @@ async function Et(e, t) {
2179
2275
  }
2180
2276
  //#endregion
2181
2277
  //#region src/stores/auth.ts
2182
- var Dt = W((e) => ({
2278
+ var At = W((e) => ({
2183
2279
  user: null,
2184
2280
  isAuthenticated: !1,
2185
2281
  isLoading: !0,
@@ -2187,9 +2283,9 @@ var Dt = W((e) => ({
2187
2283
  tenants: [],
2188
2284
  initialize: async () => {
2189
2285
  try {
2190
- let t = await _t(), n = t.tenant ?? null, r = [];
2286
+ let t = await bt(), n = t.tenant ?? null, r = [];
2191
2287
  try {
2192
- r = await vt();
2288
+ r = await xt();
2193
2289
  } catch {}
2194
2290
  e({
2195
2291
  user: t,
@@ -2208,7 +2304,7 @@ var Dt = W((e) => ({
2208
2304
  },
2209
2305
  refreshMe: async () => {
2210
2306
  try {
2211
- let t = await _t();
2307
+ let t = await bt();
2212
2308
  e({
2213
2309
  user: t,
2214
2310
  activeTenant: t.tenant ?? null
@@ -2232,7 +2328,7 @@ var Dt = W((e) => ({
2232
2328
  logout: async () => {
2233
2329
  t();
2234
2330
  try {
2235
- await bt();
2331
+ await Ct();
2236
2332
  } catch {}
2237
2333
  e({
2238
2334
  user: null,
@@ -2244,18 +2340,18 @@ var Dt = W((e) => ({
2244
2340
  }));
2245
2341
  //#endregion
2246
2342
  //#region src/hooks/useSchema.ts
2247
- function Ot() {
2248
- let e = Dt((e) => e.isAuthenticated);
2343
+ function jt() {
2344
+ let e = At((e) => e.isAuthenticated);
2249
2345
  return z({
2250
2346
  queryKey: ["schema", e],
2251
- queryFn: pt,
2347
+ queryFn: gt,
2252
2348
  staleTime: Infinity,
2253
2349
  enabled: e
2254
2350
  });
2255
2351
  }
2256
2352
  //#endregion
2257
2353
  //#region src/stores/appearance.ts
2258
- var kt = {
2354
+ var Mt = {
2259
2355
  theme: "light",
2260
2356
  accent: "violet",
2261
2357
  density: "compact",
@@ -2268,26 +2364,26 @@ var kt = {
2268
2364
  aiSurface: "both",
2269
2365
  faviconSource: "google",
2270
2366
  toastPosition: "bottom-right"
2271
- }, At = ["light", "dark"], jt = [
2367
+ }, Nt = ["light", "dark"], Pt = [
2272
2368
  "violet",
2273
2369
  "blue",
2274
2370
  "teal",
2275
2371
  "amber",
2276
2372
  "rose"
2277
- ], Mt = [
2373
+ ], Ft = [
2278
2374
  "compact",
2279
2375
  "comfortable",
2280
2376
  "cozy"
2281
- ], Nt = ["wide", "collapsed"], Pt = ["top", "bottom"], Ft = [
2377
+ ], It = ["wide", "collapsed"], Lt = ["top", "bottom"], Rt = [
2282
2378
  "command",
2283
2379
  "panel",
2284
2380
  "both",
2285
2381
  "off"
2286
- ], It = [
2382
+ ], zt = [
2287
2383
  "google",
2288
2384
  "direct",
2289
2385
  "none"
2290
- ], Lt = [
2386
+ ], Bt = [
2291
2387
  "top-left",
2292
2388
  "top-center",
2293
2389
  "top-right",
@@ -2295,48 +2391,48 @@ var kt = {
2295
2391
  "bottom-center",
2296
2392
  "bottom-right"
2297
2393
  ];
2298
- function Rt(e, t) {
2394
+ function Vt(e, t) {
2299
2395
  return typeof t == "string" && e.includes(t) ? t : void 0;
2300
2396
  }
2301
- function zt(e) {
2302
- let t = {}, n = Rt(At, e.theme);
2397
+ function Ht(e) {
2398
+ let t = {}, n = Vt(Nt, e.theme);
2303
2399
  n && (t.theme = n);
2304
- let r = Rt(jt, e.accent);
2400
+ let r = Vt(Pt, e.accent);
2305
2401
  r && (t.accent = r);
2306
- let i = Rt(Mt, e.density);
2402
+ let i = Vt(Ft, e.density);
2307
2403
  i && (t.density = i);
2308
- let a = Rt(Nt, e.sidebar);
2404
+ let a = Vt(It, e.sidebar);
2309
2405
  a && (t.sidebar = a);
2310
- let o = Rt(Pt, e.tabsPosition);
2406
+ let o = Vt(Lt, e.tabsPosition);
2311
2407
  o && (t.tabsPosition = o);
2312
- let s = Rt(Ft, e.aiSurface);
2408
+ let s = Vt(Rt, e.aiSurface);
2313
2409
  s && (t.aiSurface = s);
2314
- let c = Rt(It, e.faviconSource);
2410
+ let c = Vt(zt, e.faviconSource);
2315
2411
  c && (t.faviconSource = c);
2316
- let l = Rt(Lt, e.toastPosition);
2412
+ let l = Vt(Bt, e.toastPosition);
2317
2413
  return l && (t.toastPosition = l), typeof e.tabsMaxOpen == "number" && e.tabsMaxOpen > 0 && (t.tabsMaxOpen = e.tabsMaxOpen), typeof e.radius == "number" && e.radius >= 0 && e.radius <= 32 && (t.radius = e.radius), typeof e.zebra == "boolean" && (t.zebra = e.zebra), typeof e.tabsPersist == "boolean" && (t.tabsPersist = e.tabsPersist), t;
2318
2414
  }
2319
- var Bt = "declarion-appearance";
2320
- function Vt() {
2415
+ var Ut = "declarion-appearance";
2416
+ function Wt() {
2321
2417
  if (typeof window > "u") return null;
2322
2418
  try {
2323
- let e = localStorage.getItem(Bt);
2419
+ let e = localStorage.getItem(Ut);
2324
2420
  return e ? JSON.parse(e) : null;
2325
2421
  } catch {
2326
2422
  return null;
2327
2423
  }
2328
2424
  }
2329
- function Ht(e) {
2425
+ function Gt(e) {
2330
2426
  if (!(typeof window > "u")) try {
2331
- localStorage.setItem(Bt, JSON.stringify(e));
2427
+ localStorage.setItem(Ut, JSON.stringify(e));
2332
2428
  } catch {}
2333
2429
  }
2334
- function Ut(e) {
2430
+ function Kt(e) {
2335
2431
  if (typeof document > "u") return;
2336
2432
  let t = document.documentElement;
2337
2433
  t.dataset.theme = e.theme, t.dataset.accent = e.accent, t.dataset.density = e.density, t.dataset.sidebar = e.sidebar, t.dataset.tabbar = e.tabsPosition, t.dataset.zebra = e.zebra ? "on" : "off", t.dataset.ai = e.aiSurface, t.style.setProperty("--radius-md", `${e.radius}px`), t.style.setProperty("--radius-lg", `${e.radius + 3}px`);
2338
2434
  }
2339
- var Wt = {
2435
+ var qt = {
2340
2436
  ui_theme: "theme",
2341
2437
  ui_accent: "accent",
2342
2438
  ui_density: "density",
@@ -2349,54 +2445,54 @@ var Wt = {
2349
2445
  ui_ai_surface: "aiSurface",
2350
2446
  ui_favicon_source: "faviconSource",
2351
2447
  ui_toast_position: "toastPosition"
2352
- }, Gt = Vt(), Kt = Gt ? new Set(Object.keys(Gt)) : /* @__PURE__ */ new Set(), qt = {
2353
- ...kt,
2354
- ...Gt ? zt(Gt) : {}
2448
+ }, Jt = Wt(), Yt = Jt ? new Set(Object.keys(Jt)) : /* @__PURE__ */ new Set(), Xt = {
2449
+ ...Mt,
2450
+ ...Jt ? Ht(Jt) : {}
2355
2451
  };
2356
- typeof window < "u" && Ut(qt);
2357
- var Jt = W((e, t) => ({
2358
- ...qt,
2452
+ typeof window < "u" && Kt(Xt);
2453
+ var Zt = W((e, t) => ({
2454
+ ...Xt,
2359
2455
  set: (n, r) => {
2360
- let i = zt({ [n]: r });
2456
+ let i = Ht({ [n]: r });
2361
2457
  if (i[n] === void 0) return;
2362
2458
  let a = {
2363
2459
  ...t(),
2364
2460
  ...i
2365
2461
  };
2366
- Ut(a), Ht(a), Kt.add(n), e(i);
2462
+ Kt(a), Gt(a), Yt.add(n), e(i);
2367
2463
  },
2368
2464
  setMany: (n) => {
2369
- let r = zt(n);
2465
+ let r = Ht(n);
2370
2466
  if (!Object.keys(r).length) return;
2371
2467
  let i = {
2372
2468
  ...t(),
2373
2469
  ...r
2374
2470
  };
2375
- Ut(i), Ht(i);
2376
- for (let e of Object.keys(r)) Kt.add(e);
2471
+ Kt(i), Gt(i);
2472
+ for (let e of Object.keys(r)) Yt.add(e);
2377
2473
  e(r);
2378
2474
  },
2379
2475
  hydrateFromParams: (t) => {
2380
2476
  let n = {};
2381
- for (let [e, r] of Object.entries(Wt)) Kt.has(r) || t[e] !== void 0 && (n[r] = t[e]);
2382
- let r = zt(n);
2383
- Object.keys(r).length && (Ut({
2384
- ...Jt.getState(),
2477
+ for (let [e, r] of Object.entries(qt)) Yt.has(r) || t[e] !== void 0 && (n[r] = t[e]);
2478
+ let r = Ht(n);
2479
+ Object.keys(r).length && (Kt({
2480
+ ...Zt.getState(),
2385
2481
  ...r
2386
2482
  }), e(r));
2387
2483
  }
2388
2484
  }));
2389
2485
  //#endregion
2390
2486
  //#region src/lib/utils.ts
2391
- function Yt(...e) {
2487
+ function Qt(...e) {
2392
2488
  return G(te(e));
2393
2489
  }
2394
- function Xt(e) {
2490
+ function $t(e) {
2395
2491
  return e.metaKey || e.ctrlKey || e.shiftKey || e.altKey || e.button !== 0;
2396
2492
  }
2397
2493
  //#endregion
2398
2494
  //#region src/components/shared/DynamicIcon.tsx
2399
- function Zt({ name: e, size: t, className: n, style: r }) {
2495
+ function en({ name: e, size: t, className: n, style: r }) {
2400
2496
  return /* @__PURE__ */ V(q[e] ?? q.folder, {
2401
2497
  size: typeof t == "number" ? t : typeof t == "string" ? parseFloat(t) : void 0,
2402
2498
  cls: n,
@@ -2405,61 +2501,61 @@ function Zt({ name: e, size: t, className: n, style: r }) {
2405
2501
  }
2406
2502
  //#endregion
2407
2503
  //#region src/components/shared/Markdown.tsx
2408
- var Qt = M(() => import("./MarkdownRenderer-Dl3GDuY9.js").then((e) => ({ default: e.MarkdownRenderer })));
2409
- function $t() {
2504
+ var tn = M(() => import("./MarkdownRenderer-Dl3GDuY9.js").then((e) => ({ default: e.MarkdownRenderer })));
2505
+ function nn() {
2410
2506
  return /* @__PURE__ */ V("div", { className: "h-4 w-2/3 rounded bg-muted animate-pulse" });
2411
2507
  }
2412
- function en(e) {
2508
+ function rn(e) {
2413
2509
  return /* @__PURE__ */ V(A, {
2414
- fallback: /* @__PURE__ */ V($t, {}),
2415
- children: /* @__PURE__ */ V(Qt, { ...e })
2510
+ fallback: /* @__PURE__ */ V(nn, {}),
2511
+ children: /* @__PURE__ */ V(tn, { ...e })
2416
2512
  });
2417
2513
  }
2418
2514
  //#endregion
2419
2515
  //#region src/api/data.ts
2420
- function tn(e, t) {
2516
+ function an(e, t) {
2421
2517
  let n = new URL(`/api/data/${e}`, window.location.origin);
2422
2518
  if (t.page && n.searchParams.set("page", String(t.page)), t.per_page && n.searchParams.set("per_page", String(t.per_page)), t.sort && n.searchParams.set("sort", t.sort), t.search && n.searchParams.set("search", t.search), t.filters && t.filters.length > 0 && n.searchParams.set("filters", JSON.stringify(t.filters)), t.include_deleted && n.searchParams.set("include_deleted", "true"), t.expand) for (let e of t.expand) n.searchParams.append("expand", e);
2423
2519
  return t.select && t.select.length > 0 && n.searchParams.set("select", t.select.join(",")), t.screen && n.searchParams.set("screen", t.screen), t.preview && n.searchParams.set("preview", "true"), t.count && n.searchParams.set("count", t.count), n.pathname + n.search;
2424
2520
  }
2425
- async function nn(t, n = {}, r = {}) {
2426
- return e(tn(t, n), { signal: r.signal });
2521
+ async function on(t, n = {}, r = {}) {
2522
+ return e(an(t, n), { signal: r.signal });
2427
2523
  }
2428
- async function rn(t, n) {
2524
+ async function sn(t, n) {
2429
2525
  let r = new URLSearchParams();
2430
2526
  if (typeof n == "string") r.set("id", n);
2431
2527
  else for (let [e, t] of Object.entries(n)) r.set(e, t);
2432
2528
  return e(`/api/data/${t}?${r.toString()}`);
2433
2529
  }
2434
- async function an(t, n) {
2530
+ async function cn(t, n) {
2435
2531
  return { data: (await e(`/api/data/${t}`, {
2436
2532
  method: "POST",
2437
2533
  body: JSON.stringify([n])
2438
2534
  }))[0] };
2439
2535
  }
2440
- async function on(e, t, n) {
2536
+ async function ln(e, t, n) {
2441
2537
  let r = typeof t == "string" ? { id: t } : t;
2442
- return { data: ((await mn(`${e}.__update`, { items: [{
2538
+ return { data: ((await _n(`${e}.__update`, { items: [{
2443
2539
  ...r,
2444
2540
  ...n
2445
2541
  }] })).result?.rows ?? [])[0] };
2446
2542
  }
2447
- async function sn(e, t) {
2448
- let n = typeof t == "string" ? t : cn(t);
2449
- await mn(`${e}.__delete`, pn(void 0, [n]));
2543
+ async function un(e, t) {
2544
+ let n = typeof t == "string" ? t : dn(t);
2545
+ await _n(`${e}.__delete`, gn(void 0, [n]));
2450
2546
  }
2451
- function cn(e) {
2547
+ function dn(e) {
2452
2548
  let t = Object.values(e);
2453
2549
  return t.length === 1 ? t[0] : t.join("");
2454
2550
  }
2455
- async function ln(t, n) {
2551
+ async function fn(t, n) {
2456
2552
  let r = typeof n == "string" ? { id: n } : n;
2457
2553
  await e(`/api/data/${t}/restore`, {
2458
2554
  method: "POST",
2459
2555
  body: JSON.stringify([r])
2460
2556
  });
2461
2557
  }
2462
- async function un(e, t) {
2558
+ async function pn(e, t) {
2463
2559
  let n = await S(`/api/data/${e}/export`, {
2464
2560
  method: "POST",
2465
2561
  body: JSON.stringify(t)
@@ -2469,7 +2565,7 @@ async function un(e, t) {
2469
2565
  filename: n.filename
2470
2566
  };
2471
2567
  }
2472
- var dn = class extends Error {
2568
+ var mn = class extends Error {
2473
2569
  status;
2474
2570
  response;
2475
2571
  constructor(e, t) {
@@ -2477,36 +2573,36 @@ var dn = class extends Error {
2477
2573
  super(n || "Action failed"), this.name = "ActionBatchError", this.status = e, this.response = t;
2478
2574
  }
2479
2575
  };
2480
- function fn(e) {
2576
+ function hn(e) {
2481
2577
  if (!e || typeof e != "object") return !1;
2482
2578
  let t = e;
2483
2579
  return typeof t.status == "string" && Array.isArray(t.errors);
2484
2580
  }
2485
- function pn(e, t) {
2581
+ function gn(e, t) {
2486
2582
  let n = { ...e ?? {} };
2487
2583
  if ("_ids" in n) throw Error("handler param \"_ids\" collides with reserved key");
2488
2584
  return t !== void 0 && (n._ids = t), n;
2489
2585
  }
2490
- async function mn(t, n) {
2586
+ async function _n(t, n) {
2491
2587
  try {
2492
2588
  return await e(`/api/actions/${t}`, {
2493
2589
  method: "POST",
2494
2590
  body: JSON.stringify(n)
2495
2591
  });
2496
2592
  } catch (e) {
2497
- throw e instanceof r && fn(e.raw) ? new dn(e.status, e.raw) : e;
2593
+ throw e instanceof r && hn(e.raw) ? new mn(e.status, e.raw) : e;
2498
2594
  }
2499
2595
  }
2500
- async function hn(t, n) {
2596
+ async function vn(t, n) {
2501
2597
  let r = new URLSearchParams();
2502
2598
  return r.set("ids", n.join(",")), e(`/api/associations/${t}?${r.toString()}`);
2503
2599
  }
2504
2600
  //#endregion
2505
2601
  //#region src/types/fieldType.ts
2506
- var gn = /* @__PURE__ */ "bool.bytes.date.decimal.email.enum.float.int.int_array.json.multilang.multilang_text.password.phone.ref.rich_text.secret.string.string_array.structure.tags.text.time.timestamp.url.uuid.uuid_array".split(".");
2602
+ var yn = /* @__PURE__ */ "bool.bytes.date.decimal.email.enum.float.int.int_array.json.multilang.multilang_text.password.phone.ref.rich_text.secret.string.string_array.structure.tags.text.time.timestamp.url.uuid.uuid_array".split(".");
2507
2603
  //#endregion
2508
2604
  //#region src/components/shared/CopyButton.tsx
2509
- function _n({ value: e, title: t, size: n = "icon" }) {
2605
+ function bn({ value: e, title: t, size: n = "icon" }) {
2510
2606
  let [r, i] = R(!1), a = N(async (t) => {
2511
2607
  t.stopPropagation(), t.preventDefault();
2512
2608
  try {
@@ -2525,7 +2621,7 @@ function _n({ value: e, title: t, size: n = "icon" }) {
2525
2621
  }
2526
2622
  //#endregion
2527
2623
  //#region src/components/fields/StringField.tsx
2528
- function vn({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a }) {
2624
+ function xn({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a }) {
2529
2625
  if (r === "display") {
2530
2626
  let t = String(n ?? "");
2531
2627
  return e.copyable && t ? /* @__PURE__ */ H("span", {
@@ -2537,7 +2633,7 @@ function vn({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
2537
2633
  children: [/* @__PURE__ */ V("span", {
2538
2634
  style: { fontSize: 12.5 },
2539
2635
  children: t
2540
- }), /* @__PURE__ */ V(_n, {
2636
+ }), /* @__PURE__ */ V(bn, {
2541
2637
  value: t,
2542
2638
  size: "sm"
2543
2639
  })]
@@ -2559,7 +2655,7 @@ function vn({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
2559
2655
  }
2560
2656
  //#endregion
2561
2657
  //#region src/components/fields/TextField.tsx
2562
- function yn({ field: e, fieldName: t, value: n, mode: r, onChange: i, fill: a, compact: o, fieldId: s }) {
2658
+ function Sn({ field: e, fieldName: t, value: n, mode: r, onChange: i, fill: a, compact: o, fieldId: s }) {
2563
2659
  let c = e.display?.widget;
2564
2660
  if (r === "display") {
2565
2661
  let t = String(n ?? "");
@@ -2570,7 +2666,7 @@ function yn({ field: e, fieldName: t, value: n, mode: r, onChange: i, fill: a, c
2570
2666
  },
2571
2667
  children: "—"
2572
2668
  });
2573
- let r = c === "markdown" ? /* @__PURE__ */ V(en, { content: t }) : c === "code" ? /* @__PURE__ */ V("pre", {
2669
+ let r = c === "markdown" ? /* @__PURE__ */ V(rn, { content: t }) : c === "code" ? /* @__PURE__ */ V("pre", {
2574
2670
  className: "mono",
2575
2671
  style: {
2576
2672
  fontSize: 12,
@@ -2602,7 +2698,7 @@ function yn({ field: e, fieldName: t, value: n, mode: r, onChange: i, fill: a, c
2602
2698
  top: 0,
2603
2699
  right: 0
2604
2700
  },
2605
- children: /* @__PURE__ */ V(_n, {
2701
+ children: /* @__PURE__ */ V(bn, {
2606
2702
  value: t,
2607
2703
  size: "sm"
2608
2704
  })
@@ -2629,8 +2725,8 @@ function yn({ field: e, fieldName: t, value: n, mode: r, onChange: i, fill: a, c
2629
2725
  }
2630
2726
  //#endregion
2631
2727
  //#region src/components/fields/EnumField.tsx
2632
- var bn = "__declarion_enum_null__";
2633
- function xn({ field: e, value: t, mode: n, onChange: r, fieldId: i, labelId: a }) {
2728
+ var Cn = "__declarion_enum_null__";
2729
+ function wn({ field: e, value: t, mode: n, onChange: r, fieldId: i, labelId: a }) {
2634
2730
  let o = e.values ?? [], s = o.find((e) => e.code === t);
2635
2731
  if (n === "display") return s ? /* @__PURE__ */ V(X, {
2636
2732
  tone: s.color ?? "slate",
@@ -2643,26 +2739,26 @@ function xn({ field: e, value: t, mode: n, onChange: r, fieldId: i, labelId: a }
2643
2739
  },
2644
2740
  children: "—"
2645
2741
  });
2646
- let c = !e.required, l = t != null && t !== "" ? String(t) : bn, u = [...c ? [{
2647
- value: bn,
2742
+ let c = !e.required, l = t != null && t !== "" ? String(t) : Cn, u = [...c ? [{
2743
+ value: Cn,
2648
2744
  label: "— None —"
2649
2745
  }] : [], ...o.map((e) => ({
2650
2746
  value: e.code,
2651
2747
  label: Q(e.name) || e.code
2652
2748
  }))];
2653
- return /* @__PURE__ */ V(je, {
2749
+ return /* @__PURE__ */ V(Pe, {
2654
2750
  id: i,
2655
2751
  "aria-labelledby": a,
2656
2752
  "aria-required": e.required || void 0,
2657
2753
  value: l,
2658
2754
  options: u,
2659
- onChange: (e) => r?.(e === bn ? null : e),
2755
+ onChange: (e) => r?.(e === Cn ? null : e),
2660
2756
  placeholder: "Select…"
2661
2757
  });
2662
2758
  }
2663
2759
  //#endregion
2664
2760
  //#region src/components/fields/EmailField.tsx
2665
- function Sn({ field: e, fieldName: t, value: n, onChange: r, fieldId: i }) {
2761
+ function Tn({ field: e, fieldName: t, value: n, onChange: r, fieldId: i }) {
2666
2762
  return /* @__PURE__ */ V(Z, {
2667
2763
  id: i,
2668
2764
  name: t,
@@ -2674,7 +2770,7 @@ function Sn({ field: e, fieldName: t, value: n, onChange: r, fieldId: i }) {
2674
2770
  }
2675
2771
  //#endregion
2676
2772
  //#region src/components/fields/UrlField.tsx
2677
- function Cn({ field: e, fieldName: t, value: n, onChange: r, fieldId: i }) {
2773
+ function En({ field: e, fieldName: t, value: n, onChange: r, fieldId: i }) {
2678
2774
  return /* @__PURE__ */ V(Z, {
2679
2775
  id: i,
2680
2776
  name: t,
@@ -2687,7 +2783,7 @@ function Cn({ field: e, fieldName: t, value: n, onChange: r, fieldId: i }) {
2687
2783
  }
2688
2784
  //#endregion
2689
2785
  //#region src/components/fields/PhoneField.tsx
2690
- function wn({ field: e, fieldName: t, value: n, onChange: r, fieldId: i }) {
2786
+ function Dn({ field: e, fieldName: t, value: n, onChange: r, fieldId: i }) {
2691
2787
  return /* @__PURE__ */ V(Z, {
2692
2788
  id: i,
2693
2789
  name: t,
@@ -2700,10 +2796,10 @@ function wn({ field: e, fieldName: t, value: n, onChange: r, fieldId: i }) {
2700
2796
  }
2701
2797
  //#endregion
2702
2798
  //#region src/lib/timestamp.ts
2703
- function Tn(e = /* @__PURE__ */ new Date()) {
2799
+ function On(e = /* @__PURE__ */ new Date()) {
2704
2800
  return ie(e);
2705
2801
  }
2706
- function En(e) {
2802
+ function kn(e) {
2707
2803
  let t = e.match(/([+-]\d{2}:\d{2})$/), n = e.endsWith("Z");
2708
2804
  if (t || n) {
2709
2805
  let r = new Date(e);
@@ -2736,7 +2832,7 @@ function En(e) {
2736
2832
  timeStyle: "short"
2737
2833
  }).format(r);
2738
2834
  }
2739
- function Dn(e, t = /* @__PURE__ */ new Date()) {
2835
+ function An(e, t = /* @__PURE__ */ new Date()) {
2740
2836
  if (e == null || e === "") return {
2741
2837
  text: "—",
2742
2838
  absolute: ""
@@ -2749,7 +2845,7 @@ function Dn(e, t = /* @__PURE__ */ new Date()) {
2749
2845
  absolute: t
2750
2846
  };
2751
2847
  }
2752
- let r = En(typeof e == "string" ? e : n.toISOString()), i = t.getTime() - n.getTime();
2848
+ let r = kn(typeof e == "string" ? e : n.toISOString()), i = t.getTime() - n.getTime();
2753
2849
  return Math.abs(i) > 720 * 60 * 60 * 1e3 ? {
2754
2850
  text: ie(n, { representation: "date" }),
2755
2851
  absolute: r
@@ -2760,7 +2856,7 @@ function Dn(e, t = /* @__PURE__ */ new Date()) {
2760
2856
  }
2761
2857
  //#endregion
2762
2858
  //#region src/components/fields/TimestampField.tsx
2763
- function On(e, t) {
2859
+ function jn(e, t) {
2764
2860
  if (t) {
2765
2861
  let t = /* @__PURE__ */ new Date(e + "T00:00:00");
2766
2862
  return isNaN(t.getTime()) ? e : new Intl.DateTimeFormat(void 0, {
@@ -2806,7 +2902,7 @@ function On(e, t) {
2806
2902
  minute: "2-digit"
2807
2903
  }).format(i);
2808
2904
  }
2809
- function kn(e, t) {
2905
+ function Mn(e, t) {
2810
2906
  if (t) {
2811
2907
  let t = /* @__PURE__ */ new Date(e + "T00:00:00");
2812
2908
  return isNaN(t.getTime()) ? e : new Intl.DateTimeFormat(void 0, {
@@ -2824,14 +2920,14 @@ function kn(e, t) {
2824
2920
  minute: "2-digit"
2825
2921
  }).format(n);
2826
2922
  }
2827
- function An(e) {
2923
+ function Nn(e) {
2828
2924
  if (e.endsWith("Z")) return "UTC";
2829
2925
  let t = e.match(/([+-]\d{2}:\d{2})$/);
2830
2926
  if (!t) return null;
2831
2927
  let n = t[1].charAt(0), r = parseInt(t[1].substring(1, 3), 10), i = parseInt(t[1].substring(4, 6), 10);
2832
2928
  return r === 0 && i === 0 ? "UTC" : `UTC${n}${r}${i > 0 ? `:${String(i).padStart(2, "0")}` : ""}`;
2833
2929
  }
2834
- function jn(e, t) {
2930
+ function Pn(e, t) {
2835
2931
  let n = e.match(/([+-]\d{2}:\d{2})$/), r = e.endsWith("Z"), i = new Date(e);
2836
2932
  if (isNaN(i.getTime())) return "";
2837
2933
  if (r) {
@@ -2844,13 +2940,13 @@ function jn(e, t) {
2844
2940
  }
2845
2941
  return t ? e.slice(0, 10) : e.slice(0, 16);
2846
2942
  }
2847
- function Mn(e, t) {
2943
+ function Fn(e, t) {
2848
2944
  let n = new Date(e);
2849
2945
  if (isNaN(n.getTime())) return "";
2850
2946
  let r = n.getFullYear(), i = String(n.getMonth() + 1).padStart(2, "0"), a = String(n.getDate()).padStart(2, "0");
2851
2947
  return t ? `${r}-${i}-${a}` : `${r}-${i}-${a}T${String(n.getHours()).padStart(2, "0")}:${String(n.getMinutes()).padStart(2, "0")}`;
2852
2948
  }
2853
- function Nn({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a }) {
2949
+ function In({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a }) {
2854
2950
  let o = e.type === "date", s = !!e.timezone;
2855
2951
  if (r === "display") {
2856
2952
  if (!n) return /* @__PURE__ */ V("span", {
@@ -2860,7 +2956,7 @@ function Nn({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
2860
2956
  },
2861
2957
  children: "—"
2862
2958
  });
2863
- let e = String(n), t = s ? On(e, o) : kn(e, o), r = s && !o ? An(e) : null;
2959
+ let e = String(n), t = s ? jn(e, o) : Mn(e, o), r = s && !o ? Nn(e) : null;
2864
2960
  return /* @__PURE__ */ H("span", {
2865
2961
  style: { fontSize: 12.5 },
2866
2962
  children: [t, r && /* @__PURE__ */ V("span", {
@@ -2872,7 +2968,7 @@ function Nn({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
2872
2968
  })]
2873
2969
  });
2874
2970
  }
2875
- let c = n ? s ? jn(String(n), o) : Mn(String(n), o) : "";
2971
+ let c = n ? s ? Pn(String(n), o) : Fn(String(n), o) : "";
2876
2972
  return /* @__PURE__ */ V(Z, {
2877
2973
  id: a,
2878
2974
  name: t,
@@ -2893,13 +2989,13 @@ function Nn({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
2893
2989
  i?.(e);
2894
2990
  return;
2895
2991
  }
2896
- i?.(Tn(t));
2992
+ i?.(On(t));
2897
2993
  }
2898
2994
  });
2899
2995
  }
2900
2996
  //#endregion
2901
2997
  //#region src/components/fields/BoolField.tsx
2902
- function Pn({ value: e, mode: t, onChange: n, fieldId: r, labelId: i }) {
2998
+ function Ln({ value: e, mode: t, onChange: n, fieldId: r, labelId: i }) {
2903
2999
  let a = !!e;
2904
3000
  return t === "display" ? /* @__PURE__ */ H("span", {
2905
3001
  style: {
@@ -2924,7 +3020,7 @@ function Pn({ value: e, mode: t, onChange: n, fieldId: r, labelId: i }) {
2924
3020
  }
2925
3021
  //#endregion
2926
3022
  //#region src/components/fields/NumberField.tsx
2927
- function Fn(e) {
3023
+ function Rn(e) {
2928
3024
  let t = e.trim();
2929
3025
  if (t === "" || t === "-") return t;
2930
3026
  let n = t.startsWith("-"), [r, i] = (n ? t.slice(1) : t).split("."), a;
@@ -2936,8 +3032,8 @@ function Fn(e) {
2936
3032
  let o = n ? `-${a}` : a;
2937
3033
  return i !== void 0 && (o += `.${i}`), o;
2938
3034
  }
2939
- var In = new Intl.NumberFormat();
2940
- function Ln({ field: e, fieldName: t, value: n, mode: r, onChange: i, record: a, fieldId: o }) {
3035
+ var zn = new Intl.NumberFormat();
3036
+ function Bn({ field: e, fieldName: t, value: n, mode: r, onChange: i, record: a, fieldId: o }) {
2941
3037
  let s = e.display?.widget === "money", c = e.type === "decimal" || s, l = a?.$units?.[t], u = !l && e.unit ? e.unit.display || e.unit.storage : void 0, d = l || (u && !u.startsWith("$") ? u : void 0);
2942
3038
  if (r === "display") {
2943
3039
  if (n == null) return /* @__PURE__ */ V("span", {
@@ -2948,10 +3044,10 @@ function Ln({ field: e, fieldName: t, value: n, mode: r, onChange: i, record: a,
2948
3044
  children: "—"
2949
3045
  });
2950
3046
  let e;
2951
- if (c && typeof n == "string") e = Fn(n);
3047
+ if (c && typeof n == "string") e = Rn(n);
2952
3048
  else {
2953
3049
  let t = Number(n);
2954
- e = isNaN(t) ? null : In.format(t);
3050
+ e = isNaN(t) ? null : zn.format(t);
2955
3051
  }
2956
3052
  return e == null ? /* @__PURE__ */ V("span", {
2957
3053
  style: { fontSize: 12.5 },
@@ -2996,7 +3092,7 @@ function Ln({ field: e, fieldName: t, value: n, mode: r, onChange: i, record: a,
2996
3092
  }
2997
3093
  //#endregion
2998
3094
  //#region src/hooks/useEntityData.ts
2999
- function Rn(e, t) {
3095
+ function Vn(e, t) {
3000
3096
  let n = {
3001
3097
  ...t,
3002
3098
  count: "window"
@@ -3007,12 +3103,12 @@ function Rn(e, t) {
3007
3103
  e,
3008
3104
  n
3009
3105
  ],
3010
- queryFn: ({ signal: t }) => nn(e, n, { signal: t }),
3106
+ queryFn: ({ signal: t }) => on(e, n, { signal: t }),
3011
3107
  enabled: !!e,
3012
3108
  placeholderData: (t, n) => n?.queryKey?.[1] === e ? t : void 0
3013
3109
  });
3014
3110
  }
3015
- function zn(e, t) {
3111
+ function Hn(e, t) {
3016
3112
  let n = {
3017
3113
  ...t,
3018
3114
  count: "only",
@@ -3028,7 +3124,7 @@ function zn(e, t) {
3028
3124
  e,
3029
3125
  n
3030
3126
  ],
3031
- queryFn: ({ signal: t }) => nn(e, n, { signal: t }),
3127
+ queryFn: ({ signal: t }) => on(e, n, { signal: t }),
3032
3128
  enabled: !!e,
3033
3129
  retry: 1,
3034
3130
  staleTime: 3e4,
@@ -3037,14 +3133,14 @@ function zn(e, t) {
3037
3133
  }
3038
3134
  //#endregion
3039
3135
  //#region src/hooks/useEntity.ts
3040
- function Bn(e) {
3041
- let { data: t } = Ot();
3136
+ function Un(e) {
3137
+ let { data: t } = jt();
3042
3138
  if (!(!t || !e)) return t.entities[e];
3043
3139
  }
3044
3140
  //#endregion
3045
3141
  //#region src/components/fields/RefField.tsx
3046
- function Vn({ field: e, value: t, mode: n, onChange: r, refs: i, fieldId: a, labelId: o }) {
3047
- let s = e.ref?.entity, c = Bn(s), l = e.display?.ref_display_field ?? e.ref?.display?.field ?? c?.display?.display_field, u = I(() => c ? [...c.fields].find(([, e]) => e.primary)?.[0] ?? "id" : "id", [c]), { data: d, isLoading: f } = Rn(n === "edit" ? s : void 0, {
3142
+ function Wn({ field: e, value: t, mode: n, onChange: r, refs: i, fieldId: a, labelId: o }) {
3143
+ let s = e.ref?.entity, c = Un(s), l = e.display?.ref_display_field ?? e.ref?.display?.field ?? c?.display?.display_field, u = I(() => c ? [...c.fields].find(([, e]) => e.primary)?.[0] ?? "id" : "id", [c]), { data: d, isLoading: f } = Vn(n === "edit" ? s : void 0, {
3048
3144
  per_page: 200,
3049
3145
  sort: l ? `${l}:asc` : void 0
3050
3146
  }), p = I(() => d?.data ?? [], [d?.data]), m = I(() => {
@@ -3054,12 +3150,12 @@ function Vn({ field: e, value: t, mode: n, onChange: r, refs: i, fieldId: a, lab
3054
3150
  let t = i[s];
3055
3151
  if (t) {
3056
3152
  let n = t[e];
3057
- if (n) return Ge(n, l, e);
3153
+ if (n) return Je(n, l, e);
3058
3154
  }
3059
3155
  }
3060
3156
  if (p.length > 0) {
3061
3157
  let n = p.find((t) => String(t[u]) === e);
3062
- if (n) return Ge(n, l, String(t));
3158
+ if (n) return Je(n, l, String(t));
3063
3159
  }
3064
3160
  return e;
3065
3161
  }, [
@@ -3091,11 +3187,11 @@ function Vn({ field: e, value: t, mode: n, onChange: r, refs: i, fieldId: a, lab
3091
3187
  let t = String(e[u]);
3092
3188
  return {
3093
3189
  value: t,
3094
- label: Ge(e, l, t)
3190
+ label: Je(e, l, t)
3095
3191
  };
3096
3192
  })
3097
3193
  ];
3098
- return /* @__PURE__ */ V(je, {
3194
+ return /* @__PURE__ */ V(Pe, {
3099
3195
  id: a,
3100
3196
  "aria-labelledby": o,
3101
3197
  "aria-required": e.required || void 0,
@@ -3107,29 +3203,29 @@ function Vn({ field: e, value: t, mode: n, onChange: r, refs: i, fieldId: a, lab
3107
3203
  }
3108
3204
  //#endregion
3109
3205
  //#region src/components/fields/JsonField.tsx
3110
- var Hn = M(() => import("./JsonEditor-CexL5HXN.js").then((e) => ({ default: e.JsonEditor })));
3111
- function Un() {
3206
+ var Gn = M(() => import("./JsonEditor-CexL5HXN.js").then((e) => ({ default: e.JsonEditor })));
3207
+ function Kn() {
3112
3208
  return /* @__PURE__ */ V("div", { className: "h-20 rounded-md border border-border bg-muted animate-pulse" });
3113
3209
  }
3114
- function Wn(e) {
3210
+ function qn(e) {
3115
3211
  return e == null ? !0 : typeof e == "string" ? e.trim() === "" : Array.isArray(e) ? e.length === 0 : typeof e == "object" ? Object.keys(e).length === 0 : !1;
3116
3212
  }
3117
- function Gn({ value: e, mode: t, onChange: n, fieldId: r }) {
3118
- return t === "display" ? Wn(e) ? /* @__PURE__ */ V("span", {
3213
+ function Jn({ value: e, mode: t, onChange: n, fieldId: r }) {
3214
+ return t === "display" ? qn(e) ? /* @__PURE__ */ V("span", {
3119
3215
  style: {
3120
3216
  fontSize: 12.5,
3121
3217
  color: "var(--text-4)"
3122
3218
  },
3123
3219
  children: "—"
3124
3220
  }) : /* @__PURE__ */ V(A, {
3125
- fallback: /* @__PURE__ */ V(Un, {}),
3126
- children: /* @__PURE__ */ V(Hn, {
3221
+ fallback: /* @__PURE__ */ V(Kn, {}),
3222
+ children: /* @__PURE__ */ V(Gn, {
3127
3223
  value: e,
3128
3224
  readOnly: !0
3129
3225
  })
3130
3226
  }) : /* @__PURE__ */ V(A, {
3131
- fallback: /* @__PURE__ */ V(Un, {}),
3132
- children: /* @__PURE__ */ V(Hn, {
3227
+ fallback: /* @__PURE__ */ V(Kn, {}),
3228
+ children: /* @__PURE__ */ V(Gn, {
3133
3229
  value: e,
3134
3230
  onChange: n,
3135
3231
  id: r
@@ -3138,14 +3234,14 @@ function Gn({ value: e, mode: t, onChange: n, fieldId: r }) {
3138
3234
  }
3139
3235
  //#endregion
3140
3236
  //#region src/components/fields/MultilangField.tsx
3141
- function Kn(e) {
3237
+ function Yn(e) {
3142
3238
  return e == null ? {} : typeof e == "object" && !Array.isArray(e) ? e : typeof e == "string" ? { en: e } : {};
3143
3239
  }
3144
- function qn({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a }) {
3145
- let { data: o } = Ot(), s = o?.languages?.length ? o.languages : [{
3240
+ function Xn({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a }) {
3241
+ let { data: o } = jt(), s = o?.languages?.length ? o.languages : [{
3146
3242
  code: "en",
3147
3243
  name: { en: "English" }
3148
- }], c = Kn(n);
3244
+ }], c = Yn(n);
3149
3245
  if (r === "display") return /* @__PURE__ */ V("span", {
3150
3246
  style: { fontSize: 12.5 },
3151
3247
  children: Object.values(c)[0] ?? "—"
@@ -3201,14 +3297,14 @@ function qn({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
3201
3297
  }
3202
3298
  //#endregion
3203
3299
  //#region src/components/fields/MultilangTextField.tsx
3204
- function Jn(e) {
3300
+ function Zn(e) {
3205
3301
  return e == null ? {} : typeof e == "object" && !Array.isArray(e) ? e : typeof e == "string" ? { en: e } : {};
3206
3302
  }
3207
- function Yn({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a }) {
3208
- let { data: o } = Ot(), s = o?.languages?.length ? o.languages : [{
3303
+ function Qn({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a }) {
3304
+ let { data: o } = jt(), s = o?.languages?.length ? o.languages : [{
3209
3305
  code: "en",
3210
3306
  name: { en: "English" }
3211
- }], c = Jn(n);
3307
+ }], c = Zn(n);
3212
3308
  if (r === "display") return /* @__PURE__ */ V("p", {
3213
3309
  style: {
3214
3310
  fontSize: 12.5,
@@ -3264,25 +3360,25 @@ function Yn({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
3264
3360
  }
3265
3361
  //#endregion
3266
3362
  //#region src/components/fields/StructureField.tsx
3267
- function Xn(e) {
3268
- let { field: t, value: n, mode: r, onChange: i, locale: a, fieldId: o } = e, { data: s } = Ot(), c = t.structure ? s?.structures?.[t.structure] : void 0;
3269
- return c ? t.array ? /* @__PURE__ */ V(Qn, {
3363
+ function $n(e) {
3364
+ let { field: t, value: n, mode: r, onChange: i, locale: a, fieldId: o } = e, { data: s } = jt(), c = t.structure ? s?.structures?.[t.structure] : void 0;
3365
+ return c ? t.array ? /* @__PURE__ */ V(tr, {
3270
3366
  structDef: c,
3271
3367
  value: n,
3272
3368
  mode: r,
3273
3369
  onChange: i,
3274
3370
  locale: a,
3275
3371
  fieldId: o
3276
- }) : /* @__PURE__ */ V(Zn, {
3372
+ }) : /* @__PURE__ */ V(er, {
3277
3373
  structDef: c,
3278
3374
  value: n,
3279
3375
  mode: r,
3280
3376
  onChange: i,
3281
3377
  locale: a,
3282
3378
  fieldId: o
3283
- }) : /* @__PURE__ */ V(Gn, { ...e });
3379
+ }) : /* @__PURE__ */ V(Jn, { ...e });
3284
3380
  }
3285
- function Zn({ structDef: e, value: t, mode: n, onChange: r, locale: i, fieldId: a }) {
3381
+ function er({ structDef: e, value: t, mode: n, onChange: r, locale: i, fieldId: a }) {
3286
3382
  let o = typeof t == "object" && t && !Array.isArray(t) ? t : {}, s = e.fields.names(), c = {
3287
3383
  display: "flex",
3288
3384
  flexDirection: "column",
@@ -3318,13 +3414,13 @@ function Zn({ structDef: e, value: t, mode: n, onChange: r, locale: i, fieldId:
3318
3414
  minWidth: 0,
3319
3415
  flex: 1
3320
3416
  },
3321
- children: n.type === "structure" && n.structure ? /* @__PURE__ */ V(Xn, {
3417
+ children: n.type === "structure" && n.structure ? /* @__PURE__ */ V($n, {
3322
3418
  field: n,
3323
3419
  fieldName: t,
3324
3420
  value: r,
3325
3421
  mode: "display",
3326
3422
  locale: i
3327
- }) : Ba({
3423
+ }) : Wa({
3328
3424
  field: n,
3329
3425
  fieldName: t,
3330
3426
  value: r,
@@ -3362,14 +3458,14 @@ function Zn({ structDef: e, value: t, mode: n, onChange: r, locale: i, fieldId:
3362
3458
  children: [/* @__PURE__ */ V(Oe, {
3363
3459
  required: n.required,
3364
3460
  children: n.display ? Q(n.display.name) : t
3365
- }), n.type === "structure" && n.structure ? /* @__PURE__ */ V(Xn, {
3461
+ }), n.type === "structure" && n.structure ? /* @__PURE__ */ V($n, {
3366
3462
  field: n,
3367
3463
  fieldName: t,
3368
3464
  value: o[t],
3369
3465
  mode: "edit",
3370
3466
  onChange: l(t),
3371
3467
  locale: i
3372
- }) : Ba({
3468
+ }) : Wa({
3373
3469
  field: n,
3374
3470
  fieldName: t,
3375
3471
  value: o[t],
@@ -3381,7 +3477,7 @@ function Zn({ structDef: e, value: t, mode: n, onChange: r, locale: i, fieldId:
3381
3477
  })
3382
3478
  });
3383
3479
  }
3384
- function Qn({ structDef: e, value: t, mode: n, onChange: r, locale: i, fieldId: a }) {
3480
+ function tr({ structDef: e, value: t, mode: n, onChange: r, locale: i, fieldId: a }) {
3385
3481
  let o = Array.isArray(t) ? t : [];
3386
3482
  if (n === "display") return o.length === 0 ? /* @__PURE__ */ V("span", {
3387
3483
  style: {
@@ -3395,7 +3491,7 @@ function Qn({ structDef: e, value: t, mode: n, onChange: r, locale: i, fieldId:
3395
3491
  flexDirection: "column",
3396
3492
  gap: 8
3397
3493
  },
3398
- children: o.map((t, n) => /* @__PURE__ */ V(Zn, {
3494
+ children: o.map((t, n) => /* @__PURE__ */ V(er, {
3399
3495
  structDef: e,
3400
3496
  value: t,
3401
3497
  mode: "display",
@@ -3421,7 +3517,7 @@ function Qn({ structDef: e, value: t, mode: n, onChange: r, locale: i, fieldId:
3421
3517
  role: "group",
3422
3518
  children: [o.map((t, n) => /* @__PURE__ */ H("div", {
3423
3519
  style: { position: "relative" },
3424
- children: [/* @__PURE__ */ V(Zn, {
3520
+ children: [/* @__PURE__ */ V(er, {
3425
3521
  structDef: e,
3426
3522
  value: t,
3427
3523
  mode: "edit",
@@ -3449,16 +3545,16 @@ function Qn({ structDef: e, value: t, mode: n, onChange: r, locale: i, fieldId:
3449
3545
  }
3450
3546
  //#endregion
3451
3547
  //#region src/components/fields/SecretField.tsx
3452
- var $n = "[SET]";
3453
- function er({ field: e, fieldName: t, value: n, mode: r, onChange: i, record: a, fieldId: o }) {
3454
- let [s, c] = R(""), l = a !== void 0, u = n === $n || typeof n == "string" && n !== "";
3548
+ var nr = "[SET]";
3549
+ function rr({ field: e, fieldName: t, value: n, mode: r, onChange: i, record: a, fieldId: o }) {
3550
+ let [s, c] = R(""), l = a !== void 0, u = n === nr || typeof n == "string" && n !== "";
3455
3551
  return r === "display" ? u ? /* @__PURE__ */ V("span", {
3456
3552
  className: "mono",
3457
3553
  style: {
3458
3554
  fontSize: 12.5,
3459
3555
  color: "var(--text-3)"
3460
3556
  },
3461
- children: $n
3557
+ children: nr
3462
3558
  }) : /* @__PURE__ */ V("span", {
3463
3559
  style: {
3464
3560
  fontSize: 12.5,
@@ -3466,29 +3562,29 @@ function er({ field: e, fieldName: t, value: n, mode: r, onChange: i, record: a,
3466
3562
  fontStyle: "italic"
3467
3563
  },
3468
3564
  children: "Not set"
3469
- }) : /* @__PURE__ */ V(Ie, {
3565
+ }) : /* @__PURE__ */ V(ze, {
3470
3566
  id: o,
3471
3567
  name: t,
3472
3568
  ariaRequired: e.required,
3473
3569
  value: s,
3474
3570
  onChange: (e) => {
3475
- c(e), l && e === "" ? i?.(u ? $n : "") : i?.(e);
3571
+ c(e), l && e === "" ? i?.(u ? nr : "") : i?.(e);
3476
3572
  },
3477
3573
  placeholder: l ? "Leave blank to keep existing value" : "Enter value"
3478
3574
  });
3479
3575
  }
3480
3576
  //#endregion
3481
3577
  //#region src/components/fields/PasswordField.tsx
3482
- var tr = "[SET]";
3483
- function nr({ field: e, fieldName: t, value: n, mode: r, onChange: i, record: a, fieldId: o }) {
3484
- let [s, c] = R(""), l = a !== void 0, u = n === tr || typeof n == "string" && n !== "";
3578
+ var ir = "[SET]";
3579
+ function ar({ field: e, fieldName: t, value: n, mode: r, onChange: i, record: a, fieldId: o }) {
3580
+ let [s, c] = R(""), l = a !== void 0, u = n === ir || typeof n == "string" && n !== "";
3485
3581
  return r === "display" ? u ? /* @__PURE__ */ V("span", {
3486
3582
  className: "mono",
3487
3583
  style: {
3488
3584
  fontSize: 12.5,
3489
3585
  color: "var(--text-3)"
3490
3586
  },
3491
- children: tr
3587
+ children: ir
3492
3588
  }) : /* @__PURE__ */ V("span", {
3493
3589
  style: {
3494
3590
  fontSize: 12.5,
@@ -3496,24 +3592,24 @@ function nr({ field: e, fieldName: t, value: n, mode: r, onChange: i, record: a,
3496
3592
  fontStyle: "italic"
3497
3593
  },
3498
3594
  children: "Not set"
3499
- }) : /* @__PURE__ */ V(Ie, {
3595
+ }) : /* @__PURE__ */ V(ze, {
3500
3596
  id: o,
3501
3597
  name: t,
3502
3598
  ariaRequired: e.required,
3503
3599
  value: s,
3504
3600
  onChange: (e) => {
3505
- c(e), l && e === "" ? i?.(u ? tr : "") : i?.(e);
3601
+ c(e), l && e === "" ? i?.(u ? ir : "") : i?.(e);
3506
3602
  },
3507
3603
  placeholder: l ? "Leave blank to keep existing value" : "Enter password"
3508
3604
  });
3509
3605
  }
3510
3606
  //#endregion
3511
3607
  //#region src/components/fields/StringArrayField.tsx
3512
- function rr(e) {
3608
+ function or(e) {
3513
3609
  return Array.isArray(e) ? e.filter((e) => e != null).map(String) : [];
3514
3610
  }
3515
- function ir({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a }) {
3516
- let o = rr(n), [s, c] = R("");
3611
+ function sr({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a }) {
3612
+ let o = or(n), [s, c] = R("");
3517
3613
  if (r === "display") return o.length === 0 ? /* @__PURE__ */ V("span", {
3518
3614
  style: {
3519
3615
  fontSize: 12.5,
@@ -3582,11 +3678,11 @@ function ir({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
3582
3678
  }
3583
3679
  //#endregion
3584
3680
  //#region src/components/fields/IntArrayField.tsx
3585
- function ar(e) {
3681
+ function cr(e) {
3586
3682
  return Array.isArray(e) ? e.filter((e) => e != null).map(Number).filter((e) => !isNaN(e)) : [];
3587
3683
  }
3588
- function or({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a }) {
3589
- let o = ar(n), [s, c] = R("");
3684
+ function lr({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a }) {
3685
+ let o = cr(n), [s, c] = R("");
3590
3686
  if (r === "display") return o.length === 0 ? /* @__PURE__ */ V("span", {
3591
3687
  style: {
3592
3688
  fontSize: 12.5,
@@ -3658,38 +3754,38 @@ function or({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
3658
3754
  }
3659
3755
  //#endregion
3660
3756
  //#region src/components/file-widgets/registry.ts
3661
- var sr = /* @__PURE__ */ new Map();
3662
- function cr(e, t) {
3663
- sr.set(e, t);
3757
+ var ur = /* @__PURE__ */ new Map();
3758
+ function dr(e, t) {
3759
+ ur.set(e, t);
3664
3760
  }
3665
- function lr(e) {
3666
- return sr.get(e);
3761
+ function fr(e) {
3762
+ return ur.get(e);
3667
3763
  }
3668
- function ur(e) {
3669
- return sr.has(e);
3764
+ function pr(e) {
3765
+ return ur.has(e);
3670
3766
  }
3671
3767
  //#endregion
3672
3768
  //#region src/components/file-widgets/cropper.ts
3673
- var dr = async ({ file: e }) => ({
3769
+ var mr = async ({ file: e }) => ({
3674
3770
  blob: e,
3675
3771
  filename: e.name
3676
- }), fr = dr;
3677
- function pr(e) {
3678
- fr = e ?? dr;
3772
+ }), hr = mr;
3773
+ function gr(e) {
3774
+ hr = e ?? mr;
3679
3775
  }
3680
- function mr() {
3681
- return fr;
3776
+ function _r() {
3777
+ return hr;
3682
3778
  }
3683
3779
  //#endregion
3684
3780
  //#region src/components/file-widgets/ImageWidget.tsx
3685
- function hr(e, t) {
3781
+ function vr(e, t) {
3686
3782
  return s(e, t);
3687
3783
  }
3688
- function gr(e) {
3784
+ function yr(e) {
3689
3785
  let t = e.trim().split(/\s+/).filter(Boolean);
3690
3786
  return t.length === 0 ? "?" : t.length === 1 ? t[0].slice(0, 2).toUpperCase() : (t[0][0] + t[1][0]).toUpperCase();
3691
3787
  }
3692
- function _r(e) {
3788
+ function br(e) {
3693
3789
  let { field: t, fieldName: n, value: r, onChange: o, mode: s, alt: f, disabled: p, visual: _, uploadFieldCode: v, uploadSlotCode: y } = e, S = h(r), [C, w] = R("idle"), [T, E] = R(null), [D, O] = R(null), [k, A] = R(null), [j, M] = R(!1), F = L(null), z = L(!1), B = L(null), { register: U, unregister: W, isDraft: te } = g();
3694
3790
  P(() => () => {
3695
3791
  F.current && F.current.abort();
@@ -3707,9 +3803,9 @@ function _r(e) {
3707
3803
  }
3708
3804
  let c = r;
3709
3805
  if (t.display?.crop_on_upload) try {
3710
- let { blob: e, filename: n } = await mr()({
3806
+ let { blob: e, filename: n } = await _r()({
3711
3807
  file: r,
3712
- aspectRatio: xr(t.display.aspect_ratio)
3808
+ aspectRatio: wr(t.display.aspect_ratio)
3713
3809
  });
3714
3810
  c = new File([e], n, { type: e.type || r.type });
3715
3811
  } catch (e) {
@@ -3807,10 +3903,10 @@ function _r(e) {
3807
3903
  }, [p, re]), oe = N((e) => {
3808
3904
  let t = e.target.files?.[0];
3809
3905
  e.target.value = "", t && re(t);
3810
- }, [re]), se = _.aspectRatio ?? br(_.shape, t.display?.aspect_ratio), ce = m(S), le = {
3906
+ }, [re]), se = _.aspectRatio ?? Cr(_.shape, t.display?.aspect_ratio), ce = m(S), le = {
3811
3907
  aspectRatio: se,
3812
3908
  width: _.width ?? (_.shape === "wide" ? "100%" : "120px")
3813
- }, ue = !!S, de = hr(S, t.display?.listable_thumbnail), fe = c(S, t.display?.listable_thumbnail), pe = d(S?.id, fe, de), me = s === "display", he = N((e) => {
3909
+ }, ue = !!S, de = vr(S, t.display?.listable_thumbnail), fe = c(S, t.display?.listable_thumbnail), pe = d(S?.id, fe, de), me = s === "display", he = N((e) => {
3814
3910
  e.stopPropagation(), M((e) => !e);
3815
3911
  }, []), ge = N((e) => {
3816
3912
  if (!S || !j) return;
@@ -3826,22 +3922,22 @@ function _r(e) {
3826
3922
  o
3827
3923
  ]);
3828
3924
  return me ? /* @__PURE__ */ V("div", {
3829
- className: vr(_.shape, !1),
3925
+ className: xr(_.shape, !1),
3830
3926
  style: le,
3831
3927
  "aria-label": G,
3832
3928
  children: ue && pe ? /* @__PURE__ */ V("img", {
3833
3929
  src: pe,
3834
3930
  alt: G,
3835
- className: yr(_.shape),
3931
+ className: Sr(_.shape),
3836
3932
  style: { objectPosition: b(ce) },
3837
3933
  loading: "lazy"
3838
- }) : /* @__PURE__ */ V(Sr, {
3934
+ }) : /* @__PURE__ */ V(Tr, {
3839
3935
  shape: _.shape,
3840
3936
  label: G,
3841
3937
  placeholder: t.display?.placeholder
3842
3938
  })
3843
3939
  }) : /* @__PURE__ */ H("div", {
3844
- className: vr(_.shape, !p),
3940
+ className: xr(_.shape, !p),
3845
3941
  style: le,
3846
3942
  tabIndex: p ? -1 : 0,
3847
3943
  role: "button",
@@ -3867,15 +3963,15 @@ function _r(e) {
3867
3963
  ue && pe ? /* @__PURE__ */ V("img", {
3868
3964
  src: pe,
3869
3965
  alt: G,
3870
- className: yr(_.shape),
3966
+ className: Sr(_.shape),
3871
3967
  style: { objectPosition: b(ce) },
3872
3968
  loading: "lazy"
3873
- }) : C === "uploading" ? null : /* @__PURE__ */ V(Sr, {
3969
+ }) : C === "uploading" ? null : /* @__PURE__ */ V(Tr, {
3874
3970
  shape: _.shape,
3875
3971
  label: G,
3876
3972
  placeholder: t.display?.placeholder
3877
3973
  }),
3878
- C === "uploading" && /* @__PURE__ */ V(Cr, { pct: T?.pct ?? 0 }),
3974
+ C === "uploading" && /* @__PURE__ */ V(Er, { pct: T?.pct ?? 0 }),
3879
3975
  k && /* @__PURE__ */ V("span", {
3880
3976
  className: "absolute right-1 top-1 h-2 w-2 rounded-full bg-warning",
3881
3977
  "aria-hidden": "true",
@@ -3946,32 +4042,32 @@ function _r(e) {
3946
4042
  ]
3947
4043
  });
3948
4044
  }
3949
- function vr(e, t) {
4045
+ function xr(e, t) {
3950
4046
  return [
3951
4047
  "relative overflow-hidden border border-border bg-surface-2",
3952
4048
  e === "circle" ? "rounded-full" : "rounded-md",
3953
4049
  t ? "cursor-pointer focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent" : ""
3954
4050
  ].filter(Boolean).join(" ");
3955
4051
  }
3956
- function yr(e) {
4052
+ function Sr(e) {
3957
4053
  return "h-full w-full object-cover";
3958
4054
  }
3959
- function br(e, t) {
4055
+ function Cr(e, t) {
3960
4056
  return t ? t.replace(":", " / ") : e === "wide" ? "16 / 9" : "1 / 1";
3961
4057
  }
3962
- function xr(e) {
4058
+ function wr(e) {
3963
4059
  if (!e) return;
3964
4060
  let t = e.replace(/\s/g, "").match(/^(\d+(?:\.\d+)?)[:/](\d+(?:\.\d+)?)$/);
3965
4061
  if (!t) return;
3966
4062
  let n = Number(t[1]), r = Number(t[2]);
3967
4063
  if (!(!n || !r)) return n / r;
3968
4064
  }
3969
- function Sr({ shape: e, label: t, placeholder: n }) {
4065
+ function Tr({ shape: e, label: t, placeholder: n }) {
3970
4066
  return n === "initials" ? /* @__PURE__ */ V("div", {
3971
4067
  className: "flex h-full w-full items-center justify-center bg-surface-3 text-text-3",
3972
4068
  children: /* @__PURE__ */ V("span", {
3973
4069
  className: e === "circle" ? "text-lg font-medium" : "text-base font-medium",
3974
- children: gr(t)
4070
+ children: yr(t)
3975
4071
  })
3976
4072
  }) : /* @__PURE__ */ V("div", {
3977
4073
  className: "flex h-full w-full items-center justify-center bg-surface-3 text-text-4",
@@ -3981,7 +4077,7 @@ function Sr({ shape: e, label: t, placeholder: n }) {
3981
4077
  })
3982
4078
  });
3983
4079
  }
3984
- function Cr({ pct: e }) {
4080
+ function Er({ pct: e }) {
3985
4081
  let t = 2 * Math.PI * 18, n = t - Math.max(0, Math.min(100, e)) / 100 * t;
3986
4082
  return /* @__PURE__ */ H("div", {
3987
4083
  className: "absolute inset-0 flex items-center justify-center bg-black/30",
@@ -4025,49 +4121,49 @@ function Cr({ pct: e }) {
4025
4121
  }
4026
4122
  //#endregion
4027
4123
  //#region src/components/file-widgets/SquareImage.tsx
4028
- function wr(e) {
4029
- return /* @__PURE__ */ V(_r, {
4124
+ function Dr(e) {
4125
+ return /* @__PURE__ */ V(br, {
4030
4126
  ...e,
4031
4127
  visual: { shape: "square" }
4032
4128
  });
4033
4129
  }
4034
4130
  //#endregion
4035
4131
  //#region src/components/file-widgets/CircleImage.tsx
4036
- function Tr(e) {
4037
- return /* @__PURE__ */ V(_r, {
4132
+ function Or(e) {
4133
+ return /* @__PURE__ */ V(br, {
4038
4134
  ...e,
4039
4135
  visual: { shape: "circle" }
4040
4136
  });
4041
4137
  }
4042
4138
  //#endregion
4043
4139
  //#region src/components/file-widgets/WideBanner.tsx
4044
- function Er(e) {
4045
- return /* @__PURE__ */ V(_r, {
4140
+ function kr(e) {
4141
+ return /* @__PURE__ */ V(br, {
4046
4142
  ...e,
4047
4143
  visual: { shape: "wide" }
4048
4144
  });
4049
4145
  }
4050
4146
  //#endregion
4051
4147
  //#region src/components/file-widgets/GridLazy.tsx
4052
- var Dr = M(() => import("./Grid-pE2-dvug.js").then((e) => ({ default: e.Grid })));
4053
- function Or() {
4148
+ var Ar = M(() => import("./Grid-pE2-dvug.js").then((e) => ({ default: e.Grid })));
4149
+ function jr() {
4054
4150
  return /* @__PURE__ */ V("div", { className: "h-24 w-full rounded-md bg-muted animate-pulse" });
4055
4151
  }
4056
- function kr(e) {
4152
+ function Mr(e) {
4057
4153
  return /* @__PURE__ */ V(A, {
4058
- fallback: /* @__PURE__ */ V(Or, {}),
4059
- children: /* @__PURE__ */ V(Dr, { ...e })
4154
+ fallback: /* @__PURE__ */ V(jr, {}),
4155
+ children: /* @__PURE__ */ V(Ar, { ...e })
4060
4156
  });
4061
4157
  }
4062
4158
  //#endregion
4063
4159
  //#region src/components/file-widgets/DocumentCard.tsx
4064
- function Ar({ contentType: e }) {
4160
+ function Nr({ contentType: e }) {
4065
4161
  return /* @__PURE__ */ V("div", {
4066
4162
  className: "flex h-16 w-16 flex-none items-center justify-center rounded-md border border-border bg-surface-3 text-xs font-medium text-muted-foreground",
4067
4163
  children: e ? e.includes("pdf") ? "PDF" : e.includes("word") ? "DOC" : e.includes("sheet") || e.includes("excel") ? "XLS" : e.startsWith("image/") ? "IMG" : e.split("/")[1]?.slice(0, 4).toUpperCase() ?? "FILE" : "FILE"
4068
4164
  });
4069
4165
  }
4070
- function jr(e) {
4166
+ function Pr(e) {
4071
4167
  let { field: t, fieldName: n, value: r, onChange: s, mode: c, disabled: l, uploadFieldCode: u, uploadSlotCode: d } = e, f = h(r), [m, y] = R("idle"), [b, S] = R(null), [w, T] = R(null), [E, D] = R(!1), [O, k] = R(f?.filename ?? ""), A = L(null), j = L(!1), M = L(null), { register: F, unregister: I, isDraft: z } = g(), { open: U } = v();
4072
4168
  P(() => () => {
4073
4169
  A.current && A.current.abort();
@@ -4180,7 +4276,7 @@ function jr(e) {
4180
4276
  "data-testid": `file-widget-${n}`,
4181
4277
  className: "flex items-center gap-3 rounded-md border border-dashed border-border bg-surface p-3",
4182
4278
  children: [
4183
- /* @__PURE__ */ V(Ar, {}),
4279
+ /* @__PURE__ */ V(Nr, {}),
4184
4280
  /* @__PURE__ */ H("div", {
4185
4281
  className: "flex flex-col gap-1",
4186
4282
  children: [/* @__PURE__ */ V("span", {
@@ -4215,7 +4311,7 @@ function jr(e) {
4215
4311
  "aria-busy": m === "uploading" || void 0,
4216
4312
  "aria-invalid": m === "error" || void 0,
4217
4313
  children: [
4218
- /* @__PURE__ */ V(Ar, { contentType: f?.content_type }),
4314
+ /* @__PURE__ */ V(Nr, { contentType: f?.content_type }),
4219
4315
  /* @__PURE__ */ H("div", {
4220
4316
  className: "flex min-w-0 flex-1 flex-col gap-1",
4221
4317
  children: [
@@ -4244,7 +4340,7 @@ function jr(e) {
4244
4340
  children: [
4245
4341
  f && /* @__PURE__ */ V("span", { children: C(f.size_bytes) }),
4246
4342
  f?.page_count != null && /* @__PURE__ */ H("span", { children: [f.page_count, " pages"] }),
4247
- f?.uploaded_at && /* @__PURE__ */ V("span", { children: Mr(f.uploaded_at) }),
4343
+ f?.uploaded_at && /* @__PURE__ */ V("span", { children: Fr(f.uploaded_at) }),
4248
4344
  f?.uploaded_by && /* @__PURE__ */ H("span", { children: ["by ", f.uploaded_by] }),
4249
4345
  f?.version?.number != null && /* @__PURE__ */ H("span", {
4250
4346
  "data-testid": "version-badge",
@@ -4325,16 +4421,16 @@ function jr(e) {
4325
4421
  ]
4326
4422
  });
4327
4423
  }
4328
- function Mr(e) {
4424
+ function Fr(e) {
4329
4425
  let t = new Date(e);
4330
4426
  return isNaN(t.getTime()) ? e : t.toISOString().slice(0, 10);
4331
4427
  }
4332
4428
  //#endregion
4333
4429
  //#region src/components/file-widgets/FileList.tsx
4334
- function Nr(e) {
4430
+ function Ir(e) {
4335
4431
  return e ? (e.split("/")[1] ?? e).toUpperCase().slice(0, 6) : "";
4336
4432
  }
4337
- function Pr(e) {
4433
+ function Lr(e) {
4338
4434
  let { field: t, fieldName: n, value: r, onChange: o, mode: s, disabled: c } = e, l = y(r), [u, d] = R([]), { register: f, unregister: m, isDraft: h } = g(), _ = L(l);
4339
4435
  _.current = l;
4340
4436
  let b = L(null), S = L(/* @__PURE__ */ new Set()), w = L([]);
@@ -4454,7 +4550,7 @@ function Pr(e) {
4454
4550
  children: [
4455
4551
  /* @__PURE__ */ V("span", {
4456
4552
  className: "flex-none rounded-sm border border-border bg-surface-3 px-1.5 py-0.5 text-[10px] text-muted-foreground",
4457
- children: Nr(e.content_type)
4553
+ children: Ir(e.content_type)
4458
4554
  }),
4459
4555
  /* @__PURE__ */ V("button", {
4460
4556
  type: "button",
@@ -4539,16 +4635,16 @@ function Pr(e) {
4539
4635
  }
4540
4636
  //#endregion
4541
4637
  //#region src/components/file-widgets/LabeledSlots.tsx
4542
- function Fr(e) {
4638
+ function Rr(e) {
4543
4639
  return !e || Array.isArray(e) || typeof e != "object" ? {} : e;
4544
4640
  }
4545
- function Ir(e) {
4641
+ function zr(e) {
4546
4642
  return e.split("_").filter(Boolean).map((e) => e.slice(0, 1).toUpperCase() + e.slice(1)).join(" ");
4547
4643
  }
4548
- function Lr(e, t) {
4644
+ function Br(e, t) {
4549
4645
  return t?.content_type?.startsWith("image/") ? !0 : (e?.accepts ?? []).some((e) => e === "image/*" || e.startsWith("image/"));
4550
4646
  }
4551
- function Rr(e, t, n, r) {
4647
+ function Vr(e, t, n, r) {
4552
4648
  return {
4553
4649
  ...e,
4554
4650
  name: `${e.name}.${t}`,
@@ -4558,14 +4654,14 @@ function Rr(e, t, n, r) {
4558
4654
  slots: void 0,
4559
4655
  display: {
4560
4656
  ...e.display ?? { widget: "document_card" },
4561
- widget: Lr(n, r) ? "square_image" : "document_card",
4657
+ widget: Br(n, r) ? "square_image" : "document_card",
4562
4658
  aspect_ratio: n?.aspect_ratio ?? e.display?.aspect_ratio,
4563
- placeholder: e.display?.placeholder ?? Ir(t)
4659
+ placeholder: e.display?.placeholder ?? zr(t)
4564
4660
  }
4565
4661
  };
4566
4662
  }
4567
- function zr(e) {
4568
- let { field: t, fieldName: n, entityCode: r, value: i, onChange: a, mode: o, disabled: s } = e, c = Object.entries(t.slots ?? {}), l = Fr(i);
4663
+ function Hr(e) {
4664
+ let { field: t, fieldName: n, entityCode: r, value: i, onChange: a, mode: o, disabled: s } = e, c = Object.entries(t.slots ?? {}), l = Rr(i);
4569
4665
  return c.length === 0 ? /* @__PURE__ */ V("span", {
4570
4666
  className: "text-sm text-muted-foreground",
4571
4667
  children: "No slots configured"
@@ -4575,7 +4671,7 @@ function zr(e) {
4575
4671
  gap: 12
4576
4672
  },
4577
4673
  children: c.map(([e, i]) => {
4578
- let c = l[e] ?? null, u = Rr(t, e, i, c), d = u.display?.widget ?? "document_card", f = lr(d);
4674
+ let c = l[e] ?? null, u = Vr(t, e, i, c), d = u.display?.widget ?? "document_card", f = fr(d);
4579
4675
  return f ? /* @__PURE__ */ H("div", {
4580
4676
  style: {
4581
4677
  display: "grid",
@@ -4587,7 +4683,7 @@ function zr(e) {
4587
4683
  fontWeight: 600,
4588
4684
  color: "var(--text-2)"
4589
4685
  },
4590
- children: Ir(e)
4686
+ children: zr(e)
4591
4687
  }), /* @__PURE__ */ V(f, {
4592
4688
  field: u,
4593
4689
  fieldName: e,
@@ -4615,7 +4711,7 @@ function zr(e) {
4615
4711
  fontWeight: 600,
4616
4712
  color: "var(--text-2)"
4617
4713
  },
4618
- children: Ir(e)
4714
+ children: zr(e)
4619
4715
  }), /* @__PURE__ */ V("span", {
4620
4716
  className: "text-sm text-muted-foreground",
4621
4717
  children: `Unknown file widget: ${d}`
@@ -4626,43 +4722,43 @@ function zr(e) {
4626
4722
  }
4627
4723
  //#endregion
4628
4724
  //#region src/components/file-widgets/builtins.ts
4629
- var Br = !1;
4630
- function Vr() {
4631
- Br ||= (cr("square_image", wr), cr("circle_image", Tr), cr("wide_banner", Er), cr("grid", kr), cr("document_card", jr), cr("file_list", Pr), cr("labeled_slots", zr), !0);
4725
+ var Ur = !1;
4726
+ function Wr() {
4727
+ Ur ||= (dr("square_image", Dr), dr("circle_image", Or), dr("wide_banner", kr), dr("grid", Mr), dr("document_card", Pr), dr("file_list", Lr), dr("labeled_slots", Hr), !0);
4632
4728
  }
4633
4729
  //#endregion
4634
4730
  //#region src/components/file-widgets/host.tsx
4635
- Vr();
4636
- function Hr(e, t) {
4731
+ Wr();
4732
+ function Gr(e, t) {
4637
4733
  return e.files?.get(t);
4638
4734
  }
4639
- function Ur(e, t) {
4735
+ function Kr(e, t) {
4640
4736
  return Object.prototype.hasOwnProperty.call(e, t) ? e[t] ?? null : e.$files?.[t] ?? null;
4641
4737
  }
4642
- function Wr(e, t, n) {
4643
- if (Hr(e, n)) return Ur(t, n);
4738
+ function qr(e, t, n) {
4739
+ if (Gr(e, n)) return Kr(t, n);
4644
4740
  let r = e.fields.get(n);
4645
- return r?.type === "rich_text" && r.files?.mode === "rich_text_inline" ? k(t[n], Ur(t, n)) : t[n];
4741
+ return r?.type === "rich_text" && r.files?.mode === "rich_text_inline" ? k(t[n], Kr(t, n)) : t[n];
4646
4742
  }
4647
- function Gr(e, t, n) {
4743
+ function Jr(e, t, n) {
4648
4744
  let r = e.fields.get(t);
4649
4745
  return r?.type === "rich_text" && r.files?.mode === "rich_text_inline" ? T(n) : n;
4650
4746
  }
4651
- function Kr(e, t, n) {
4652
- let r = Hr(e, t);
4747
+ function Yr(e, t, n) {
4748
+ let r = Gr(e, t);
4653
4749
  if (r) return r.name || t;
4654
4750
  let i = e.fields.get(t);
4655
- return i ? Ye(i, t, n) : t;
4751
+ return i ? Qe(i, t, n) : t;
4656
4752
  }
4657
- function qr(e) {
4658
- let { entity: t, entityCode: n, fieldName: r, record: i, mode: a, onChange: o, refs: s, disabled: c, surface: l, entities: u, screens: d, navigate: f, locale: p, fieldId: m, labelId: h } = e, g = Hr(t, r);
4753
+ function Xr(e) {
4754
+ let { entity: t, entityCode: n, fieldName: r, record: i, mode: a, onChange: o, refs: s, disabled: c, surface: l, entities: u, screens: d, navigate: f, locale: p, fieldId: m, labelId: h } = e, g = Gr(t, r);
4659
4755
  if (g) {
4660
- let e = g.display?.widget ?? "", t = lr(e);
4756
+ let e = g.display?.widget ?? "", t = fr(e);
4661
4757
  return t ? /* @__PURE__ */ V(t, {
4662
4758
  field: g,
4663
4759
  fieldName: r,
4664
4760
  entityCode: n,
4665
- value: Ur(i, r),
4761
+ value: Kr(i, r),
4666
4762
  mode: a,
4667
4763
  onChange: o,
4668
4764
  disabled: c,
@@ -4673,11 +4769,11 @@ function qr(e) {
4673
4769
  });
4674
4770
  }
4675
4771
  let _ = t.fields.get(r);
4676
- return _ ? Ba({
4772
+ return _ ? Wa({
4677
4773
  field: _,
4678
4774
  entityCode: n,
4679
4775
  fieldName: r,
4680
- value: Wr(t, i, r),
4776
+ value: qr(t, i, r),
4681
4777
  mode: a,
4682
4778
  onChange: o,
4683
4779
  record: i,
@@ -4694,80 +4790,80 @@ function qr(e) {
4694
4790
  }
4695
4791
  //#endregion
4696
4792
  //#region src/components/file-widgets/payload.ts
4697
- function Jr(e) {
4793
+ function Zr(e) {
4698
4794
  return !e || Array.isArray(e) ? null : e;
4699
4795
  }
4700
- function Yr(e) {
4796
+ function Qr(e) {
4701
4797
  return Array.isArray(e) ? e : [];
4702
4798
  }
4703
- function Xr(e) {
4799
+ function $r(e) {
4704
4800
  return !e || Array.isArray(e) || typeof e != "object" ? {} : e;
4705
4801
  }
4706
- function Zr(e, t) {
4707
- return e.mode === "array" ? Yr(t) : e.mode === "named_map" ? Xr(t) : Jr(t);
4802
+ function ei(e, t) {
4803
+ return e.mode === "array" ? Qr(t) : e.mode === "named_map" ? $r(t) : Zr(t);
4708
4804
  }
4709
- function Qr(e, t, n, r) {
4805
+ function ti(e, t, n, r) {
4710
4806
  let i = {
4711
4807
  file_id: e.id,
4712
4808
  filename: e.filename
4713
4809
  };
4714
4810
  return r && (i.slot = r), n && (i.position = t), e.metadata !== void 0 && (i.metadata = e.metadata), i;
4715
4811
  }
4716
- function $r(e, t) {
4812
+ function ni(e, t) {
4717
4813
  if (e.mode === "array") {
4718
- let e = Yr(t);
4719
- return e.length === 0 ? { clear: !0 } : { set: e.map((e, t) => Qr(e, t, !0)) };
4814
+ let e = Qr(t);
4815
+ return e.length === 0 ? { clear: !0 } : { set: e.map((e, t) => ti(e, t, !0)) };
4720
4816
  }
4721
4817
  if (e.mode === "named_map") {
4722
- let e = Xr(t), n = Object.entries(e).filter(([, e]) => e != null).map(([e, t]) => Qr(t, 0, !1, e));
4818
+ let e = $r(t), n = Object.entries(e).filter(([, e]) => e != null).map(([e, t]) => ti(t, 0, !1, e));
4723
4819
  return n.length === 0 ? { clear: !0 } : { set: n };
4724
4820
  }
4725
- let n = Jr(t);
4726
- return n ? { set: [Qr(n, 0, !0)] } : { clear: !0 };
4821
+ let n = Zr(t);
4822
+ return n ? { set: [ti(n, 0, !0)] } : { clear: !0 };
4727
4823
  }
4728
- function ei(e) {
4824
+ function ri(e) {
4729
4825
  return JSON.stringify(e);
4730
4826
  }
4731
- function ti(e) {
4827
+ function ii(e) {
4732
4828
  let { entity: t, formData: n, record: r, isNew: i } = e, a = {};
4733
4829
  for (let e of t.files?.names() ?? []) {
4734
4830
  if (!Object.prototype.hasOwnProperty.call(n, e)) continue;
4735
- let o = Hr(t, e);
4831
+ let o = Gr(t, e);
4736
4832
  if (!o) continue;
4737
- let s = Zr(o, n[e]);
4833
+ let s = ei(o, n[e]);
4738
4834
  if (i) {
4739
- if (o.mode === "array" ? Yr(s).length === 0 : o.mode === "named_map" ? Object.values(Xr(s)).every((e) => e == null) : Jr(s) == null) continue;
4740
- a[e] = $r(o, s);
4835
+ if (o.mode === "array" ? Qr(s).length === 0 : o.mode === "named_map" ? Object.values($r(s)).every((e) => e == null) : Zr(s) == null) continue;
4836
+ a[e] = ni(o, s);
4741
4837
  continue;
4742
4838
  }
4743
- let c = Zr(o, r ? Ur(r, e) : null), l = $r(o, s), u = $r(o, c);
4744
- ei(l) !== ei(u) && (a[e] = l);
4839
+ let c = ei(o, r ? Kr(r, e) : null), l = ni(o, s), u = ni(o, c);
4840
+ ri(l) !== ri(u) && (a[e] = l);
4745
4841
  }
4746
4842
  let o = t.fields;
4747
4843
  if (!o) return a;
4748
4844
  for (let e of o.names()) {
4749
4845
  let s = o.get(e)?.files;
4750
4846
  if (!s || s.mode !== "rich_text_inline" || !Object.prototype.hasOwnProperty.call(n, e)) continue;
4751
- let c = ri(s, n[e]);
4847
+ let c = oi(s, n[e]);
4752
4848
  if (i) {
4753
4849
  if (c.clear) continue;
4754
4850
  a[e] = c;
4755
4851
  continue;
4756
4852
  }
4757
- let l = ri(s, r ? Wr({
4853
+ let l = oi(s, r ? qr({
4758
4854
  ...t,
4759
4855
  fields: o
4760
4856
  }, r, e) : null);
4761
- ei(c) !== ei(l) && (a[e] = c);
4857
+ ri(c) !== ri(l) && (a[e] = c);
4762
4858
  }
4763
4859
  return a;
4764
4860
  }
4765
- function ni(e) {
4861
+ function ai(e) {
4766
4862
  let t = [];
4767
4863
  for (let n of Object.values(e)) for (let e of n.set ?? []) t.push(e.file_id);
4768
4864
  return t;
4769
4865
  }
4770
- function ri(e, t) {
4866
+ function oi(e, t) {
4771
4867
  if (e.mode !== "rich_text_inline") return { clear: !0 };
4772
4868
  let n = D(T(t));
4773
4869
  return n.length === 0 ? { clear: !0 } : { set: n.map((e, t) => ({
@@ -4777,10 +4873,10 @@ function ri(e, t) {
4777
4873
  }
4778
4874
  //#endregion
4779
4875
  //#region src/components/file-widgets/index.ts
4780
- Vr();
4876
+ Wr();
4781
4877
  //#endregion
4782
4878
  //#region src/components/fields/RichTextField.tsx
4783
- function ii(e) {
4879
+ function si(e) {
4784
4880
  let { field: t, entityCode: n, fieldName: r, value: o, mode: s, onChange: c, record: l, compact: u, fieldId: d } = e, f = L(null), p = L(null), m = L(/* @__PURE__ */ new Map()), h = L(/* @__PURE__ */ new Set()), [_, v] = R(0), [y, b] = R(null), { register: S, unregister: C } = g(), T = l?.$files?.[r], A = I(() => k(o, T), [T, o]), j = A.markdown, M = t.files?.accepts, N = t.files?.max_size_bytes, P = (e, t = A.files) => {
4785
4881
  let n = new Set(D(e)), r = [];
4786
4882
  for (let e of h.current) n.has(e) || r.push(e);
@@ -4829,15 +4925,15 @@ function ii(e) {
4829
4925
  fieldCode: r
4830
4926
  }), i = e.type.startsWith("image/") ? URL.createObjectURL(e) : void 0;
4831
4927
  i && m.current.set(t.id, i);
4832
- let c = oi(t, i);
4928
+ let c = li(t, i);
4833
4929
  if (S(t.id, () => x(t.id)), h.current.add(t.id), o.length === 1) {
4834
- let e = ai(s.markdown, w(c));
4930
+ let e = ci(s.markdown, w(c));
4835
4931
  F(s, e, c), s = E({
4836
4932
  markdown: `${s.markdown}${e}`,
4837
4933
  files: s.files
4838
4934
  }, c);
4839
4935
  } else {
4840
- let e = ai(s.markdown, w(c));
4936
+ let e = ci(s.markdown, w(c));
4841
4937
  s = E({
4842
4938
  markdown: `${s.markdown}${e}`,
4843
4939
  files: s.files
@@ -4850,7 +4946,7 @@ function ii(e) {
4850
4946
  }
4851
4947
  }
4852
4948
  };
4853
- return s === "display" ? j ? /* @__PURE__ */ V(en, {
4949
+ return s === "display" ? j ? /* @__PURE__ */ V(rn, {
4854
4950
  content: j,
4855
4951
  files: A.files
4856
4952
  }) : /* @__PURE__ */ V("span", {
@@ -4965,7 +5061,7 @@ function ii(e) {
4965
5061
  marginBottom: 8
4966
5062
  },
4967
5063
  children: "Preview"
4968
- }), j ? /* @__PURE__ */ V(en, {
5064
+ }), j ? /* @__PURE__ */ V(rn, {
4969
5065
  content: j,
4970
5066
  files: A.files
4971
5067
  }) : /* @__PURE__ */ V("span", {
@@ -4979,10 +5075,10 @@ function ii(e) {
4979
5075
  ]
4980
5076
  });
4981
5077
  }
4982
- function ai(e, t) {
5078
+ function ci(e, t) {
4983
5079
  return e ? e.endsWith("\n\n") ? t : e.endsWith("\n") ? `\n${t}` : `\n\n${t}` : `${t}\n`;
4984
5080
  }
4985
- function oi(e, t) {
5081
+ function li(e, t) {
4986
5082
  return {
4987
5083
  id: e.id,
4988
5084
  filename: e.filename,
@@ -4997,7 +5093,7 @@ function oi(e, t) {
4997
5093
  }
4998
5094
  //#endregion
4999
5095
  //#region src/components/fields/cells/factories/text.ts
5000
- var si = () => (e) => {
5096
+ var ui = () => (e) => {
5001
5097
  if (e == null || e === "") return "—";
5002
5098
  if (typeof e == "object") try {
5003
5099
  return JSON.stringify(e);
@@ -5005,8 +5101,8 @@ var si = () => (e) => {
5005
5101
  return String(e);
5006
5102
  }
5007
5103
  return String(e);
5008
- }, ci = (e) => {
5009
- let { field: t, fieldName: n, locale: r = "en" } = e, i = li(t, n, r);
5104
+ }, di = (e) => {
5105
+ let { field: t, fieldName: n, locale: r = "en" } = e, i = fi(t, n, r);
5010
5106
  return (e) => {
5011
5107
  if (e == null) return "—";
5012
5108
  let t = !!e;
@@ -5017,7 +5113,7 @@ var si = () => (e) => {
5017
5113
  });
5018
5114
  };
5019
5115
  };
5020
- function li(e, t, n) {
5116
+ function fi(e, t, n) {
5021
5117
  if (e.display?.bool_labels) return {
5022
5118
  trueLabel: Q(e.display.bool_labels.true, n) || "Yes",
5023
5119
  falseLabel: Q(e.display.bool_labels.false, n) || "No"
@@ -5038,14 +5134,14 @@ function li(e, t, n) {
5038
5134
  };
5039
5135
  }
5040
5136
  if (t.startsWith("is_")) {
5041
- let e = ui(t.slice(3));
5137
+ let e = pi(t.slice(3));
5042
5138
  return {
5043
5139
  trueLabel: e,
5044
5140
  falseLabel: `Not ${e}`
5045
5141
  };
5046
5142
  }
5047
5143
  if (t.startsWith("has_")) {
5048
- let e = ui(t.slice(4));
5144
+ let e = pi(t.slice(4));
5049
5145
  return {
5050
5146
  trueLabel: e,
5051
5147
  falseLabel: `No ${e}`
@@ -5056,12 +5152,12 @@ function li(e, t, n) {
5056
5152
  falseLabel: "No"
5057
5153
  };
5058
5154
  }
5059
- function ui(e) {
5155
+ function pi(e) {
5060
5156
  return e.split("_").map((e) => e && e[0].toUpperCase() + e.slice(1)).join(" ");
5061
5157
  }
5062
5158
  //#endregion
5063
5159
  //#region src/components/fields/cells/factories/badge.tsx
5064
- var di = new Set([
5160
+ var mi = new Set([
5065
5161
  "indigo",
5066
5162
  "emerald",
5067
5163
  "amber",
@@ -5071,17 +5167,17 @@ var di = new Set([
5071
5167
  "slate",
5072
5168
  "teal"
5073
5169
  ]);
5074
- function fi(e) {
5075
- return e && di.has(e) ? e : "slate";
5170
+ function hi(e) {
5171
+ return e && mi.has(e) ? e : "slate";
5076
5172
  }
5077
- var pi = (e) => {
5173
+ var gi = (e) => {
5078
5174
  let { field: t, locale: n = "en" } = e, r = /* @__PURE__ */ new Map();
5079
5175
  if (t.values) for (let e of t.values) r.set(e.code, {
5080
- tone: fi(e.color),
5176
+ tone: hi(e.color),
5081
5177
  label: Q(e.name, n) || e.code
5082
5178
  });
5083
5179
  if (t.display?.value_map) for (let [e, i] of Object.entries(t.display.value_map)) {
5084
- let t = r.get(e), a = i.color ? fi(i.color) : t?.tone ?? "slate", o = (i.label ? Q(i.label, n) : "") || t?.label || e;
5180
+ let t = r.get(e), a = i.color ? hi(i.color) : t?.tone ?? "slate", o = (i.label ? Q(i.label, n) : "") || t?.label || e;
5085
5181
  r.set(e, {
5086
5182
  tone: a,
5087
5183
  label: o
@@ -5096,7 +5192,7 @@ var pi = (e) => {
5096
5192
  children: n?.label ?? t
5097
5193
  });
5098
5194
  };
5099
- }, mi = new Set([
5195
+ }, _i = new Set([
5100
5196
  "indigo",
5101
5197
  "emerald",
5102
5198
  "amber",
@@ -5106,13 +5202,13 @@ var pi = (e) => {
5106
5202
  "slate",
5107
5203
  "teal"
5108
5204
  ]);
5109
- function hi(e) {
5110
- return e && mi.has(e) ? e : "slate";
5205
+ function vi(e) {
5206
+ return e && _i.has(e) ? e : "slate";
5111
5207
  }
5112
- var gi = (e) => {
5208
+ var yi = (e) => {
5113
5209
  let { entity: t, locale: n = "en" } = e, r = /* @__PURE__ */ new Map();
5114
5210
  if (t?.status_groups) for (let e of Object.values(t.status_groups)) for (let t of e.statuses) r.set(t.code, {
5115
- tone: hi(t.color),
5211
+ tone: vi(t.color),
5116
5212
  label: Q(t.name, n) || t.code
5117
5213
  });
5118
5214
  return (e) => {
@@ -5124,7 +5220,7 @@ var gi = (e) => {
5124
5220
  children: n?.label ?? t
5125
5221
  });
5126
5222
  };
5127
- }, _i = new Set([
5223
+ }, bi = new Set([
5128
5224
  "indigo",
5129
5225
  "emerald",
5130
5226
  "amber",
@@ -5134,14 +5230,14 @@ var gi = (e) => {
5134
5230
  "slate",
5135
5231
  "teal"
5136
5232
  ]);
5137
- function vi(e) {
5138
- return e && _i.has(e) ? e : null;
5233
+ function xi(e) {
5234
+ return e && bi.has(e) ? e : null;
5139
5235
  }
5140
- var yi = (e) => {
5236
+ var Si = (e) => {
5141
5237
  let { field: t, locale: n = "en" } = e, r = /* @__PURE__ */ new Map();
5142
5238
  if (t.display?.value_map) for (let [e, i] of Object.entries(t.display.value_map)) r.set(e, {
5143
5239
  label: i.label && Q(i.label, n) || e,
5144
- tone: vi(i.color)
5240
+ tone: xi(i.color)
5145
5241
  });
5146
5242
  return (e) => !Array.isArray(e) || e.length === 0 ? "—" : /* @__PURE__ */ V("span", {
5147
5243
  style: {
@@ -5158,23 +5254,23 @@ var yi = (e) => {
5158
5254
  }, `${n}-${t}`) : /* @__PURE__ */ V(_e, { children: i?.label ?? n }, `${n}-${t}`);
5159
5255
  })
5160
5256
  });
5161
- }, bi = () => (e) => {
5257
+ }, Ci = () => (e) => {
5162
5258
  if (e == null || e === "") return "—";
5163
- let { text: t, absolute: n } = Dn(typeof e == "string" ? e : String(e));
5259
+ let { text: t, absolute: n } = An(typeof e == "string" ? e : String(e));
5164
5260
  return /* @__PURE__ */ V("span", {
5165
5261
  title: n,
5166
5262
  children: t
5167
5263
  });
5168
- }, xi = () => (e) => e == null || e === "" ? "—" : En(typeof e == "string" ? e : String(e)), Si = 60 * 1e3, Ci = 300 * 1e3, wi = () => (e) => {
5264
+ }, wi = () => (e) => e == null || e === "" ? "—" : kn(typeof e == "string" ? e : String(e)), Ti = 60 * 1e3, Ei = 300 * 1e3, Di = () => (e) => {
5169
5265
  if (e == null || e === "") return "—";
5170
5266
  let t = typeof e == "string" ? e : String(e), n = new Date(t);
5171
5267
  if (isNaN(n.getTime())) return t;
5172
- let r = En(t), i = Date.now() - n.getTime();
5268
+ let r = kn(t), i = Date.now() - n.getTime();
5173
5269
  if (i <= 0) return /* @__PURE__ */ H("span", {
5174
5270
  title: r,
5175
5271
  children: ["in ", ne(n, /* @__PURE__ */ new Date(), { addSuffix: !1 })]
5176
5272
  });
5177
- if (i <= Si) return /* @__PURE__ */ V("span", {
5273
+ if (i <= Ti) return /* @__PURE__ */ V("span", {
5178
5274
  title: r,
5179
5275
  children: /* @__PURE__ */ V(X, {
5180
5276
  tone: "slate",
@@ -5186,36 +5282,48 @@ var yi = (e) => {
5186
5282
  return /* @__PURE__ */ V("span", {
5187
5283
  title: r,
5188
5284
  children: /* @__PURE__ */ H(X, {
5189
- tone: i <= Ci ? "amber" : "rose",
5285
+ tone: i <= Ei ? "amber" : "rose",
5190
5286
  size: "xs",
5191
5287
  children: ["overdue ", a]
5192
5288
  })
5193
5289
  });
5194
- }, Ti = (e) => {
5195
- let { field: t, locale: n = "en" } = e, r = t.display?.currency || "USD", i = Ei(typeof t.scale == "number" ? t.scale : 2, 0, 6), a = new Intl.NumberFormat(n, {
5196
- style: "currency",
5197
- currency: r,
5198
- minimumFractionDigits: i,
5199
- maximumFractionDigits: i
5200
- });
5201
- return (e) => {
5290
+ }, Oi = (e) => {
5291
+ let { field: t, locale: n = "en" } = e, r = t.display?.currency || "USD", i = t.display?.currency_field, a = ki(t.display?.currency_display), o = Ai(typeof t.scale == "number" ? t.scale : 2, 0, 6), s = /* @__PURE__ */ new Map();
5292
+ return (e, t = {}) => {
5202
5293
  if (e == null || e === "") return "—";
5203
- let t = typeof e == "number" ? e : Number(e);
5204
- return Number.isFinite(t) ? a.format(t) : String(e);
5294
+ let c = typeof e == "number" ? e : Number(e);
5295
+ if (!Number.isFinite(c)) return String(e);
5296
+ let l = i ? t[i] : void 0, u = typeof l == "string" && l !== "" ? l : r, d = `${n}:${u}:${a}:${o}`, f = s.get(d);
5297
+ return f || (f = new Intl.NumberFormat(n, {
5298
+ style: "currency",
5299
+ currency: u,
5300
+ currencyDisplay: a,
5301
+ minimumFractionDigits: o,
5302
+ maximumFractionDigits: o
5303
+ }), s.set(d, f)), f.format(c);
5205
5304
  };
5206
5305
  };
5207
- function Ei(e, t, n) {
5306
+ function ki(e) {
5307
+ switch (e) {
5308
+ case "narrow_symbol": return "narrowSymbol";
5309
+ case "code":
5310
+ case "name":
5311
+ case "symbol": return e;
5312
+ default: return "symbol";
5313
+ }
5314
+ }
5315
+ function Ai(e, t, n) {
5208
5316
  return e < t ? t : e > n ? n : e;
5209
5317
  }
5210
5318
  //#endregion
5211
5319
  //#region src/components/fields/cells/factories/refLink.tsx
5212
- var Di = (e) => {
5320
+ var ji = (e) => {
5213
5321
  let { field: t, entities: n, screens: r, refs: i, navigate: a, surface: o } = e, s = t.ref?.entity, c = s ? n?.[s] : void 0, l = typeof i == "function" ? i : () => i, u = o === "detail", d = c?.display?.icon, f = t.display?.ref_display_field ?? t.ref?.display?.field ?? c?.display?.display_field, p = c?.detail_screen, m = (p ? r?.[p] : void 0)?.route, h = (e) => (t) => {
5214
- t.stopPropagation(), !Xt(t) && (t.preventDefault(), a?.(e));
5322
+ t.stopPropagation(), !$t(t) && (t.preventDefault(), a?.(e));
5215
5323
  };
5216
5324
  return (e, t) => {
5217
5325
  if (e == null || e === "") return "—";
5218
- let n = String(e), r = Oi(n, s, l(), f), i = m ? m.replace(":id", encodeURIComponent(n)) : void 0;
5326
+ let n = String(e), r = Mi(n, s, l(), f), i = m ? m.replace(":id", encodeURIComponent(n)) : void 0;
5219
5327
  if (u) {
5220
5328
  let e = /* @__PURE__ */ H(B, { children: [d && /* @__PURE__ */ V("span", {
5221
5329
  style: {
@@ -5223,7 +5331,7 @@ var Di = (e) => {
5223
5331
  display: "flex",
5224
5332
  flexShrink: 0
5225
5333
  },
5226
- children: /* @__PURE__ */ V(Zt, {
5334
+ children: /* @__PURE__ */ V(en, {
5227
5335
  name: d,
5228
5336
  size: 13
5229
5337
  })
@@ -5273,29 +5381,29 @@ var Di = (e) => {
5273
5381
  }) : r;
5274
5382
  };
5275
5383
  };
5276
- function Oi(e, t, n, r) {
5384
+ function Mi(e, t, n, r) {
5277
5385
  let i = t && n ? n[t]?.[e] : void 0;
5278
- return i ? Ge(i, r, e) : e;
5386
+ return i ? Je(i, r, e) : e;
5279
5387
  }
5280
5388
  //#endregion
5281
5389
  //#region src/components/fields/cells/factories/url-helpers.ts
5282
- var ki = /^(https?|ftps?|ssh|mailto|tel):/i, Ai = /^(info|name|tech|site|cloud|online|store|shop|blog|space|world|link|live|page|zone|life|team|work|host|land|news|wiki|mobi|coop|aero|asia)$/i;
5283
- function ji(e) {
5284
- return /^[a-z]{2,3}$/i.test(e) || Ai.test(e);
5390
+ var Ni = /^(https?|ftps?|ssh|mailto|tel):/i, Pi = /^(info|name|tech|site|cloud|online|store|shop|blog|space|world|link|live|page|zone|life|team|work|host|land|news|wiki|mobi|coop|aero|asia)$/i;
5391
+ function Fi(e) {
5392
+ return /^[a-z]{2,3}$/i.test(e) || Pi.test(e);
5285
5393
  }
5286
- function Mi(e) {
5394
+ function Ii(e) {
5287
5395
  if (!e.includes(".")) return !1;
5288
5396
  let t = e.split(".");
5289
5397
  if (t.length < 3) return !0;
5290
5398
  let n = t[0].toLowerCase();
5291
- return /^(com|org|net|edu|gov)$/.test(n) ? !1 : /^(io|app|dev)$/.test(n) ? ji(t[t.length - 1]) : !0;
5399
+ return /^(com|org|net|edu|gov)$/.test(n) ? !1 : /^(io|app|dev)$/.test(n) ? Fi(t[t.length - 1]) : !0;
5292
5400
  }
5293
- function Ni(e) {
5294
- if (ki.test(e)) return e;
5401
+ function Li(e) {
5402
+ if (Ni.test(e)) return e;
5295
5403
  let t = e.match(/^([a-z][a-z0-9+.-]*):/i);
5296
5404
  if (t) {
5297
5405
  let n = t[1], r = e.slice(t[0].length);
5298
- if (/^\d+([/?#]|$)/.test(r) && Mi(n)) {
5406
+ if (/^\d+([/?#]|$)/.test(r) && Ii(n)) {
5299
5407
  let t = parseInt(r, 10);
5300
5408
  if (t >= 1 && t <= 65535) return `https://${e}`;
5301
5409
  }
@@ -5303,14 +5411,14 @@ function Ni(e) {
5303
5411
  }
5304
5412
  return `https://${e}`;
5305
5413
  }
5306
- function Pi(e) {
5414
+ function Ri(e) {
5307
5415
  try {
5308
5416
  return new URL(e).hostname.replace(/^www\./i, "") || null;
5309
5417
  } catch {
5310
5418
  return null;
5311
5419
  }
5312
5420
  }
5313
- function Fi(e, t) {
5421
+ function zi(e, t) {
5314
5422
  if (t !== "linkedin.com") return null;
5315
5423
  try {
5316
5424
  let t = new URL(e).pathname.match(/^\/(in|company|school)\/([^/]+)/i);
@@ -5318,7 +5426,7 @@ function Fi(e, t) {
5318
5426
  } catch {}
5319
5427
  return null;
5320
5428
  }
5321
- function Ii(e) {
5429
+ function Bi(e) {
5322
5430
  try {
5323
5431
  return new URL(e), !0;
5324
5432
  } catch {
@@ -5327,7 +5435,7 @@ function Ii(e) {
5327
5435
  }
5328
5436
  //#endregion
5329
5437
  //#region src/components/fields/cells/factories/host-icons.tsx
5330
- function Li(e, t = "0 0 24 24") {
5438
+ function Vi(e, t = "0 0 24 24") {
5331
5439
  return (n) => /* @__PURE__ */ V("svg", {
5332
5440
  width: 16,
5333
5441
  height: 16,
@@ -5343,11 +5451,11 @@ function Li(e, t = "0 0 24 24") {
5343
5451
  children: e
5344
5452
  });
5345
5453
  }
5346
- var Ri = Li(/* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V("circle", {
5454
+ var Hi = Vi(/* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V("circle", {
5347
5455
  cx: "12",
5348
5456
  cy: "12",
5349
5457
  r: "9"
5350
- }), /* @__PURE__ */ V("path", { d: "M3 12h18M12 3c3 3 3 15 0 18-3-3-3-15 0-18" })] })), zi = (e) => /* @__PURE__ */ V("svg", {
5458
+ }), /* @__PURE__ */ V("path", { d: "M3 12h18M12 3c3 3 3 15 0 18-3-3-3-15 0-18" })] })), Ui = (e) => /* @__PURE__ */ V("svg", {
5351
5459
  width: 16,
5352
5460
  height: 16,
5353
5461
  viewBox: "0 0 24 24",
@@ -5356,7 +5464,7 @@ var Ri = Li(/* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V("circle", {
5356
5464
  style: { flexShrink: 0 },
5357
5465
  ...e,
5358
5466
  children: /* @__PURE__ */ V("path", { d: "M20.45 20.45h-3.55v-5.57c0-1.33-.02-3.04-1.85-3.04-1.85 0-2.13 1.45-2.13 2.94v5.67H9.36V9h3.41v1.56h.05c.48-.9 1.64-1.85 3.37-1.85 3.6 0 4.27 2.37 4.27 5.46v6.28zM5.34 7.43a2.06 2.06 0 1 1 0-4.12 2.06 2.06 0 0 1 0 4.12zM7.12 20.45H3.56V9h3.56v11.45zM22.22 0H1.77C.79 0 0 .77 0 1.72v20.56C0 23.23.79 24 1.77 24h20.45c.98 0 1.78-.77 1.78-1.72V1.72C24 .77 23.2 0 22.22 0z" })
5359
- }), Bi = (e) => /* @__PURE__ */ V("svg", {
5467
+ }), Wi = (e) => /* @__PURE__ */ V("svg", {
5360
5468
  width: 16,
5361
5469
  height: 16,
5362
5470
  viewBox: "0 0 24 24",
@@ -5365,7 +5473,7 @@ var Ri = Li(/* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V("circle", {
5365
5473
  style: { flexShrink: 0 },
5366
5474
  ...e,
5367
5475
  children: /* @__PURE__ */ V("path", { d: "M12 .5a11.5 11.5 0 0 0-3.64 22.41c.58.1.79-.25.79-.56 0-.27-.01-1-.02-1.96-3.21.7-3.89-1.55-3.89-1.55-.52-1.34-1.28-1.7-1.28-1.7-1.05-.72.08-.7.08-.7 1.16.08 1.77 1.2 1.77 1.2 1.03 1.77 2.71 1.26 3.37.96.1-.75.4-1.26.73-1.55-2.56-.29-5.26-1.28-5.26-5.71 0-1.26.45-2.3 1.19-3.11-.12-.29-.52-1.46.11-3.05 0 0 .97-.31 3.18 1.19a11.05 11.05 0 0 1 5.79 0c2.21-1.5 3.18-1.19 3.18-1.19.63 1.59.23 2.76.11 3.05.74.81 1.19 1.85 1.19 3.11 0 4.44-2.71 5.42-5.29 5.7.41.36.78 1.07.78 2.16 0 1.56-.01 2.81-.01 3.19 0 .31.21.68.8.56A11.5 11.5 0 0 0 12 .5z" })
5368
- }), Vi = (e) => /* @__PURE__ */ V("svg", {
5476
+ }), Gi = (e) => /* @__PURE__ */ V("svg", {
5369
5477
  width: 16,
5370
5478
  height: 16,
5371
5479
  viewBox: "0 0 24 24",
@@ -5374,7 +5482,7 @@ var Ri = Li(/* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V("circle", {
5374
5482
  style: { flexShrink: 0 },
5375
5483
  ...e,
5376
5484
  children: /* @__PURE__ */ V("path", { d: "M18.244 2H21.5l-7.62 8.71L23 22h-7.05l-5.52-7.21L4.07 22H.81l8.18-9.34L1 2h7.22l5 6.59L18.244 2zm-2.47 18h1.95L7.32 4h-2.1l10.55 16z" })
5377
- }), Hi = (e) => /* @__PURE__ */ V("svg", {
5485
+ }), Ki = (e) => /* @__PURE__ */ V("svg", {
5378
5486
  width: 16,
5379
5487
  height: 16,
5380
5488
  viewBox: "0 0 24 24",
@@ -5383,7 +5491,7 @@ var Ri = Li(/* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V("circle", {
5383
5491
  style: { flexShrink: 0 },
5384
5492
  ...e,
5385
5493
  children: /* @__PURE__ */ V("path", { d: "M23.5 6.2a3 3 0 0 0-2.1-2.1C19.5 3.6 12 3.6 12 3.6s-7.5 0-9.4.5A3 3 0 0 0 .5 6.2C0 8.1 0 12 0 12s0 3.9.5 5.8a3 3 0 0 0 2.1 2.1c1.9.5 9.4.5 9.4.5s7.5 0 9.4-.5a3 3 0 0 0 2.1-2.1c.5-1.9.5-5.8.5-5.8s0-3.9-.5-5.8zM9.6 15.6V8.4l6.2 3.6-6.2 3.6z" })
5386
- }), Ui = (e) => /* @__PURE__ */ V("svg", {
5494
+ }), qi = (e) => /* @__PURE__ */ V("svg", {
5387
5495
  width: 16,
5388
5496
  height: 16,
5389
5497
  viewBox: "0 0 24 24",
@@ -5392,7 +5500,7 @@ var Ri = Li(/* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V("circle", {
5392
5500
  style: { flexShrink: 0 },
5393
5501
  ...e,
5394
5502
  children: /* @__PURE__ */ V("path", { d: "M24 5.45v13.1A1.45 1.45 0 0 1 22.55 20H19.5V9.27L12 14.7 4.5 9.27V20H1.45A1.45 1.45 0 0 1 0 18.55V5.45A1.45 1.45 0 0 1 1.45 4h.5l10.05 7.27L22.05 4h.5A1.45 1.45 0 0 1 24 5.45z" })
5395
- }), Wi = (e) => /* @__PURE__ */ H("svg", {
5503
+ }), Ji = (e) => /* @__PURE__ */ H("svg", {
5396
5504
  width: 16,
5397
5505
  height: 16,
5398
5506
  viewBox: "0 0 24 24",
@@ -5417,7 +5525,7 @@ var Ri = Li(/* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V("circle", {
5417
5525
  d: "M15.17 18.96a2.52 2.52 0 1 1-2.52 2.52v-2.52h2.52zm0-1.27a2.52 2.52 0 1 1 0-5.04h6.31a2.52 2.52 0 1 1 0 5.04h-6.31z"
5418
5526
  })
5419
5527
  ]
5420
- }), Gi = (e) => /* @__PURE__ */ V("svg", {
5528
+ }), Yi = (e) => /* @__PURE__ */ V("svg", {
5421
5529
  width: 16,
5422
5530
  height: 16,
5423
5531
  viewBox: "0 0 24 24",
@@ -5426,39 +5534,39 @@ var Ri = Li(/* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V("circle", {
5426
5534
  style: { flexShrink: 0 },
5427
5535
  ...e,
5428
5536
  children: /* @__PURE__ */ V("path", { d: "M4.46 3.83 14.94 3a3.7 3.7 0 0 1 2.5.62l3 2.16a1.4 1.4 0 0 1 .56 1.31v13.06a1.7 1.7 0 0 1-1.66 1.7l-12.5.78a2.4 2.4 0 0 1-1.85-.62L2.5 19.7a1.7 1.7 0 0 1-.5-1.2V5.16c0-.74.6-1.27 1.46-1.33l1-.01zm.46 1.86c-.31 0-.46.16-.46.47v12.25c0 .31.16.47.46.47l11.62-.7c.31 0 .46-.16.46-.47V6c0-.32-.16-.47-.46-.47L4.92 5.7zm5.57 2.32c.16 0 .31.16.31.31v.46l3.7.23c.31 0 .46.16.46.47v8.32c0 .31-.16.47-.46.47l-3.7.23c-.31 0-.46-.16-.46-.47V8.78c0-.16.15-.32.15-.46l-.04-.31z" })
5429
- }), Ki = {
5430
- "linkedin.com": zi,
5431
- "github.com": Bi,
5432
- "x.com": Vi,
5433
- "twitter.com": Vi,
5434
- "youtube.com": Hi,
5435
- "youtu.be": Hi,
5436
- "gmail.com": Ui,
5437
- "mail.google.com": Ui,
5438
- "slack.com": Wi,
5439
- "notion.so": Gi,
5440
- "notion.com": Gi
5537
+ }), Xi = {
5538
+ "linkedin.com": Ui,
5539
+ "github.com": Wi,
5540
+ "x.com": Gi,
5541
+ "twitter.com": Gi,
5542
+ "youtube.com": Ki,
5543
+ "youtu.be": Ki,
5544
+ "gmail.com": qi,
5545
+ "mail.google.com": qi,
5546
+ "slack.com": Ji,
5547
+ "notion.so": Yi,
5548
+ "notion.com": Yi
5441
5549
  };
5442
- function qi(e, t) {
5550
+ function Zi(e, t) {
5443
5551
  return !e || t === "none" ? null : t === "google" ? `https://www.google.com/s2/favicons?domain=${encodeURIComponent(e)}&sz=32` : `https://${e}/favicon.ico`;
5444
5552
  }
5445
- var Ji = {
5553
+ var Qi = {
5446
5554
  width: 16,
5447
5555
  height: 16,
5448
5556
  flexShrink: 0,
5449
5557
  objectFit: "contain"
5450
5558
  };
5451
- function Yi({ domain: e }) {
5452
- let t = Jt((e) => e.faviconSource), n = e ? e.toLowerCase() : "", r = n ? Ki[n] : void 0;
5559
+ function $i({ domain: e }) {
5560
+ let t = Zt((e) => e.faviconSource), n = e ? e.toLowerCase() : "", r = n ? Xi[n] : void 0;
5453
5561
  if (r) return /* @__PURE__ */ V(r, {});
5454
- let i = qi(n, t);
5455
- return i ? /* @__PURE__ */ V(Xi, { src: i }) : /* @__PURE__ */ V(Ri, {});
5562
+ let i = Zi(n, t);
5563
+ return i ? /* @__PURE__ */ V(ea, { src: i }) : /* @__PURE__ */ V(Hi, {});
5456
5564
  }
5457
- function Xi({ src: e }) {
5565
+ function ea({ src: e }) {
5458
5566
  let [t, n] = R(!1);
5459
5567
  return P(() => {
5460
5568
  n(!1);
5461
- }, [e]), t ? /* @__PURE__ */ V(Ri, {}) : /* @__PURE__ */ V("img", {
5569
+ }, [e]), t ? /* @__PURE__ */ V(Hi, {}) : /* @__PURE__ */ V("img", {
5462
5570
  src: e,
5463
5571
  alt: "",
5464
5572
  width: 16,
@@ -5466,7 +5574,7 @@ function Xi({ src: e }) {
5466
5574
  loading: "lazy",
5467
5575
  decoding: "async",
5468
5576
  referrerPolicy: "no-referrer",
5469
- style: Ji,
5577
+ style: Qi,
5470
5578
  onError: () => n(!0)
5471
5579
  });
5472
5580
  }
@@ -5476,72 +5584,72 @@ var $ = /* @__PURE__ */ V("span", {
5476
5584
  color: "var(--text-4)"
5477
5585
  },
5478
5586
  children: "—"
5479
- }), Zi = {
5587
+ }), ta = {
5480
5588
  display: "inline-flex",
5481
5589
  alignItems: "center",
5482
5590
  gap: 4,
5483
5591
  fontSize: 12.5,
5484
5592
  color: "var(--accent)",
5485
5593
  textDecoration: "none"
5486
- }, Qi = { fontSize: 12.5 }, $i = () => (e) => {
5594
+ }, na = { fontSize: 12.5 }, ra = () => (e) => {
5487
5595
  let t = e == null ? "" : String(e);
5488
5596
  if (!t) return $;
5489
- let n = Ni(t);
5490
- if (n == null || !Ii(n)) return /* @__PURE__ */ V("span", {
5491
- style: Qi,
5597
+ let n = Li(t);
5598
+ if (n == null || !Bi(n)) return /* @__PURE__ */ V("span", {
5599
+ style: na,
5492
5600
  children: t
5493
5601
  });
5494
- let r = Pi(n), i = Fi(n, r ?? "") ?? r ?? t;
5602
+ let r = Ri(n), i = zi(n, r ?? "") ?? r ?? t;
5495
5603
  return /* @__PURE__ */ H("a", {
5496
5604
  href: n,
5497
5605
  target: "_blank",
5498
5606
  rel: "noopener noreferrer",
5499
5607
  title: t,
5500
5608
  className: "mono",
5501
- style: Zi,
5609
+ style: ta,
5502
5610
  children: [
5503
- /* @__PURE__ */ V(Yi, { domain: r }),
5611
+ /* @__PURE__ */ V($i, { domain: r }),
5504
5612
  i,
5505
5613
  /* @__PURE__ */ V(q.external, { size: 11 })
5506
5614
  ]
5507
5615
  });
5508
- }, ea = {
5616
+ }, ia = {
5509
5617
  fontSize: 12.5,
5510
5618
  color: "var(--accent)",
5511
5619
  textDecoration: "none"
5512
- }, ta = () => (e) => {
5620
+ }, aa = () => (e) => {
5513
5621
  let t = e == null ? "" : String(e);
5514
5622
  return t ? /* @__PURE__ */ V("a", {
5515
5623
  href: `mailto:${t}`,
5516
5624
  className: "mono",
5517
- style: ea,
5625
+ style: ia,
5518
5626
  children: t
5519
5627
  }) : $;
5520
- }, na = {
5628
+ }, oa = {
5521
5629
  fontSize: 12.5,
5522
5630
  color: "var(--accent)",
5523
5631
  textDecoration: "none"
5524
- }, ra = { fontSize: 12.5 }, ia = /^[+()\-.\s\d]+$/, aa = () => (e) => {
5632
+ }, sa = { fontSize: 12.5 }, ca = /^[+()\-.\s\d]+$/, la = () => (e) => {
5525
5633
  let t = e == null ? "" : String(e);
5526
5634
  if (!t) return $;
5527
5635
  let n = t.trim();
5528
- return ia.test(n) ? /* @__PURE__ */ V("a", {
5636
+ return ca.test(n) ? /* @__PURE__ */ V("a", {
5529
5637
  href: `tel:${n.replace(/\s+/g, "")}`,
5530
5638
  className: "mono",
5531
- style: na,
5639
+ style: oa,
5532
5640
  children: t
5533
5641
  }) : /* @__PURE__ */ V("span", {
5534
- style: ra,
5642
+ style: sa,
5535
5643
  children: t
5536
5644
  });
5537
- }, oa = {
5645
+ }, ua = {
5538
5646
  fontSize: 12.5,
5539
5647
  fontVariantNumeric: "tabular-nums"
5540
- }, sa = {
5648
+ }, da = {
5541
5649
  color: "var(--text-3)",
5542
5650
  marginLeft: 4
5543
- }, ca = { fontSize: 12.5 };
5544
- function la(e, t) {
5651
+ }, fa = { fontSize: 12.5 };
5652
+ function pa(e, t) {
5545
5653
  let n = e.trim();
5546
5654
  if (n === "" || n === "-") return n;
5547
5655
  let r = n.startsWith("-"), [i, a] = (r ? n.slice(1) : n).split("."), o;
@@ -5553,45 +5661,45 @@ function la(e, t) {
5553
5661
  let s = r ? `-${o}` : o;
5554
5662
  return a !== void 0 && (s += `.${a}`), s;
5555
5663
  }
5556
- var ua = (e) => {
5664
+ var ma = (e) => {
5557
5665
  let { field: t, fieldName: n, locale: r = "en" } = e, i = new Intl.NumberFormat(r), a = t.type === "decimal", o = t.unit ? t.unit.display || t.unit.storage : void 0;
5558
5666
  return (e, t) => {
5559
5667
  if (e == null) return $;
5560
5668
  let r = t.$units?.[n] || (o && !o.startsWith("$") ? o : void 0), s;
5561
- if (a && typeof e == "string") s = la(e, i);
5669
+ if (a && typeof e == "string") s = pa(e, i);
5562
5670
  else {
5563
5671
  let t = typeof e == "number" ? e : Number(e);
5564
5672
  s = Number.isFinite(t) ? i.format(t) : null;
5565
5673
  }
5566
5674
  return s == null ? /* @__PURE__ */ V("span", {
5567
- style: ca,
5675
+ style: fa,
5568
5676
  children: "—"
5569
5677
  }) : /* @__PURE__ */ H("span", {
5570
5678
  className: "num",
5571
- style: oa,
5679
+ style: ua,
5572
5680
  children: [s, r && /* @__PURE__ */ V("span", {
5573
- style: sa,
5681
+ style: da,
5574
5682
  children: r
5575
5683
  })]
5576
5684
  });
5577
5685
  };
5578
- }, da = { fontSize: 12.5 }, fa = () => (e) => e == null || e === "" ? $ : /* @__PURE__ */ V("code", {
5686
+ }, ha = { fontSize: 12.5 }, ga = () => (e) => e == null || e === "" ? $ : /* @__PURE__ */ V("code", {
5579
5687
  className: "mono",
5580
- style: da,
5688
+ style: ha,
5581
5689
  children: String(e)
5582
- }), pa = {
5690
+ }), _a = {
5583
5691
  display: "inline-flex",
5584
5692
  alignItems: "center",
5585
5693
  gap: 4,
5586
5694
  fontSize: 12.5,
5587
5695
  color: "var(--accent)",
5588
5696
  textDecoration: "none"
5589
- }, ma = { fontSize: 12.5 }, ha = () => (e) => {
5697
+ }, va = { fontSize: 12.5 }, ya = () => (e) => {
5590
5698
  let t = e == null ? "" : String(e);
5591
5699
  if (!t) return $;
5592
- let n = Ni(t);
5593
- return n == null || !Ii(n) ? /* @__PURE__ */ V("span", {
5594
- style: ma,
5700
+ let n = Li(t);
5701
+ return n == null || !Bi(n) ? /* @__PURE__ */ V("span", {
5702
+ style: va,
5595
5703
  children: t
5596
5704
  }) : /* @__PURE__ */ H("a", {
5597
5705
  href: n,
@@ -5599,21 +5707,21 @@ var ua = (e) => {
5599
5707
  rel: "noopener noreferrer",
5600
5708
  title: t,
5601
5709
  className: "mono",
5602
- style: pa,
5710
+ style: _a,
5603
5711
  children: [t, /* @__PURE__ */ V(q.external, { size: 11 })]
5604
5712
  });
5605
- }, ga = 400, _a = 2e3;
5606
- function va(e) {
5607
- return Math.max(1, Math.min(typeof e == "number" && Number.isFinite(e) ? Math.floor(e) : ga, _a));
5713
+ }, ba = 400, xa = 2e3;
5714
+ function Sa(e) {
5715
+ return Math.max(1, Math.min(typeof e == "number" && Number.isFinite(e) ? Math.floor(e) : ba, xa));
5608
5716
  }
5609
- function ya(e, t) {
5717
+ function Ca(e, t) {
5610
5718
  return e.length <= t ? e : `${e.slice(0, t)}...`;
5611
5719
  }
5612
- function ba(e, t, n, r = 0) {
5720
+ function wa(e, t, n, r = 0) {
5613
5721
  if (e == null || e === "") return "";
5614
- if (typeof e == "string") return ya(e, t);
5722
+ if (typeof e == "string") return Ca(e, t);
5615
5723
  if (typeof e == "number" || typeof e == "boolean") return String(e);
5616
- if (typeof e != "object") return ya(String(e), t);
5724
+ if (typeof e != "object") return Ca(String(e), t);
5617
5725
  if (n.has(e)) return "[Circular]";
5618
5726
  if (r >= 3) return Array.isArray(e) ? "[...]" : "{...}";
5619
5727
  n.add(e);
@@ -5624,30 +5732,30 @@ function ba(e, t, n, r = 0) {
5624
5732
  a.push(a.length > 1 ? ",..." : "...");
5625
5733
  break;
5626
5734
  }
5627
- let f = ba(c, d, n, r + 1);
5735
+ let f = wa(c, d, n, r + 1);
5628
5736
  if (a.push(u, f), a.join("").length >= t) {
5629
5737
  a.push(",...");
5630
5738
  break;
5631
5739
  }
5632
5740
  }
5633
- return a.push(i), n.delete(e), ya(a.join(""), t);
5741
+ return a.push(i), n.delete(e), Ca(a.join(""), t);
5634
5742
  }
5635
- function xa(e, t) {
5636
- return ba(e, t, /* @__PURE__ */ new WeakSet());
5743
+ function Ta(e, t) {
5744
+ return wa(e, t, /* @__PURE__ */ new WeakSet());
5637
5745
  }
5638
- var Sa = (e) => {
5639
- let t = e.surface ?? "detail", n = va(e.field.display?.list_preview?.max_chars);
5746
+ var Ea = (e) => {
5747
+ let t = e.surface ?? "detail", n = Sa(e.field.display?.list_preview?.max_chars);
5640
5748
  return (r) => {
5641
- if (Wn(r)) return $;
5749
+ if (qn(r)) return $;
5642
5750
  if (t === "list") {
5643
- let e = xa(r, n);
5751
+ let e = Ta(r, n);
5644
5752
  return /* @__PURE__ */ V("span", {
5645
5753
  className: "font-mono text-xs text-muted-foreground",
5646
5754
  title: e,
5647
5755
  children: e
5648
5756
  });
5649
5757
  }
5650
- return /* @__PURE__ */ V(Gn, {
5758
+ return /* @__PURE__ */ V(Jn, {
5651
5759
  field: e.field,
5652
5760
  fieldName: e.fieldName,
5653
5761
  value: r,
@@ -5655,7 +5763,7 @@ var Sa = (e) => {
5655
5763
  locale: e.locale
5656
5764
  });
5657
5765
  };
5658
- }, Ca = [
5766
+ }, Da = [
5659
5767
  {
5660
5768
  pattern: /```[^\n]*\n?([\s\S]*?)```/g,
5661
5769
  replacement: "$1"
@@ -5718,13 +5826,13 @@ var Sa = (e) => {
5718
5826
  replacement: ""
5719
5827
  }
5720
5828
  ];
5721
- function wa(e) {
5829
+ function Oa(e) {
5722
5830
  if (!e) return {
5723
5831
  text: "",
5724
5832
  isPlain: !0
5725
5833
  };
5726
5834
  let t = e, n = !1;
5727
- for (let e of Ca) {
5835
+ for (let e of Da) {
5728
5836
  let r = t.replace(e.pattern, e.replacement);
5729
5837
  r !== t && e.structural !== !1 && (n = !0), t = r;
5730
5838
  }
@@ -5735,123 +5843,123 @@ function wa(e) {
5735
5843
  }
5736
5844
  //#endregion
5737
5845
  //#region src/components/fields/cells/factories/markdown.tsx
5738
- function Ta(e) {
5739
- return /* @__PURE__ */ V(en, { content: e });
5846
+ function ka(e) {
5847
+ return /* @__PURE__ */ V(rn, { content: e });
5740
5848
  }
5741
- var Ea = (e) => {
5849
+ var Aa = (e) => {
5742
5850
  let t = e.surface === "list";
5743
5851
  return (e) => {
5744
5852
  let n = e == null ? "" : String(e);
5745
5853
  if (!n) return $;
5746
- if (!t) return Ta(n);
5747
- let { text: r, isPlain: i } = wa(n);
5854
+ if (!t) return ka(n);
5855
+ let { text: r, isPlain: i } = Oa(n);
5748
5856
  return i ? /* @__PURE__ */ V("span", {
5749
5857
  title: r,
5750
5858
  children: r
5751
5859
  }) : /* @__PURE__ */ V(ge, {
5752
- content: Ta(n),
5860
+ content: ka(n),
5753
5861
  children: /* @__PURE__ */ V("span", {
5754
5862
  title: r,
5755
5863
  children: r
5756
5864
  })
5757
5865
  });
5758
5866
  };
5759
- }, Da = "[SET]", Oa = {
5867
+ }, ja = "[SET]", Ma = {
5760
5868
  fontSize: 12.5,
5761
5869
  color: "var(--text-3)"
5762
- }, ka = {
5870
+ }, Na = {
5763
5871
  fontSize: 12.5,
5764
5872
  color: "var(--text-4)",
5765
5873
  fontStyle: "italic"
5766
- }, Aa = () => (e) => e === Da || typeof e == "string" && e !== "" ? /* @__PURE__ */ V("span", {
5874
+ }, Pa = () => (e) => e === ja || typeof e == "string" && e !== "" ? /* @__PURE__ */ V("span", {
5767
5875
  className: "mono",
5768
- style: Oa,
5769
- children: Da
5876
+ style: Ma,
5877
+ children: ja
5770
5878
  }) : /* @__PURE__ */ V("span", {
5771
- style: ka,
5879
+ style: Na,
5772
5880
  children: "Not set"
5773
5881
  });
5774
5882
  //#endregion
5775
5883
  //#region src/components/fields/cells/factories/richTextPreview.tsx
5776
- function ja(e, t) {
5777
- return /* @__PURE__ */ V(en, {
5884
+ function Fa(e, t) {
5885
+ return /* @__PURE__ */ V(rn, {
5778
5886
  content: e,
5779
5887
  files: t
5780
5888
  });
5781
5889
  }
5782
- var Ma = (e) => {
5890
+ var Ia = (e) => {
5783
5891
  let { fieldName: t } = e, n = e.surface === "list";
5784
5892
  return (e, r) => {
5785
5893
  let i = r?.$files?.[t], a = k(e, i);
5786
5894
  if (!a.markdown) return $;
5787
- if (!n) return ja(a.markdown, a.files);
5788
- let { text: o, isPlain: s } = wa(a.markdown);
5895
+ if (!n) return Fa(a.markdown, a.files);
5896
+ let { text: o, isPlain: s } = Oa(a.markdown);
5789
5897
  return s ? /* @__PURE__ */ V("span", {
5790
5898
  title: o,
5791
5899
  children: o
5792
5900
  }) : /* @__PURE__ */ V(ge, {
5793
- content: ja(a.markdown, a.files),
5901
+ content: Fa(a.markdown, a.files),
5794
5902
  children: /* @__PURE__ */ V("span", {
5795
5903
  title: o,
5796
5904
  children: o
5797
5905
  })
5798
5906
  });
5799
5907
  };
5800
- }, Na = { fontSize: 12.5 }, Pa = {
5908
+ }, La = { fontSize: 12.5 }, Ra = {
5801
5909
  fontSize: 12.5,
5802
5910
  whiteSpace: "pre-wrap",
5803
5911
  margin: 0
5804
5912
  };
5805
- function Fa(e) {
5913
+ function za(e) {
5806
5914
  return e == null ? {} : typeof e == "object" && !Array.isArray(e) ? e : typeof e == "string" ? { en: e } : {};
5807
5915
  }
5808
- function Ia(e, t) {
5916
+ function Ba(e, t) {
5809
5917
  if (t && typeof e[t] == "string" && e[t] !== "") return [t, e[t]];
5810
5918
  for (let [t, n] of Object.entries(e)) if (typeof n == "string" && n !== "") return [t, n];
5811
5919
  return null;
5812
5920
  }
5813
5921
  //#endregion
5814
5922
  //#region src/components/fields/cells/registry.ts
5815
- var La = {
5816
- text: si,
5817
- bool_pill: ci,
5818
- badge: pi,
5819
- status_pill: gi,
5820
- tag_list: yi,
5821
- time_ago: bi,
5822
- timestamp_full: xi,
5823
- next_run: wi,
5824
- money: Ti,
5825
- ref_link: Di,
5826
- url: $i,
5827
- email: ta,
5828
- phone: aa,
5829
- number: ua,
5830
- code: fa,
5831
- link: ha,
5832
- json: Sa,
5833
- markdown: Ea,
5834
- password_mask: Aa,
5835
- rich_text_preview: Ma,
5923
+ var Va = {
5924
+ text: ui,
5925
+ bool_pill: di,
5926
+ badge: gi,
5927
+ status_pill: yi,
5928
+ tag_list: Si,
5929
+ time_ago: Ci,
5930
+ timestamp_full: wi,
5931
+ next_run: Di,
5932
+ money: Oi,
5933
+ ref_link: ji,
5934
+ url: ra,
5935
+ email: aa,
5936
+ phone: la,
5937
+ number: ma,
5938
+ code: ga,
5939
+ link: ya,
5940
+ json: Ea,
5941
+ markdown: Aa,
5942
+ password_mask: Pa,
5943
+ rich_text_preview: Ia,
5836
5944
  multilang_inline: (e) => {
5837
5945
  let { field: t, locale: n } = e, r = t.type === "multilang_text";
5838
5946
  return (e) => {
5839
- let t = Ia(Fa(e), n);
5947
+ let t = Ba(za(e), n);
5840
5948
  if (!t) return r ? /* @__PURE__ */ V("p", {
5841
- style: Pa,
5949
+ style: Ra,
5842
5950
  children: "—"
5843
5951
  }) : /* @__PURE__ */ V("span", {
5844
- style: Na,
5952
+ style: La,
5845
5953
  children: "—"
5846
5954
  });
5847
5955
  let [i, a] = t;
5848
5956
  return r ? /* @__PURE__ */ V("p", {
5849
- style: Pa,
5957
+ style: Ra,
5850
5958
  lang: i,
5851
5959
  dir: "auto",
5852
5960
  children: a
5853
5961
  }) : /* @__PURE__ */ V("span", {
5854
- style: Na,
5962
+ style: La,
5855
5963
  lang: i,
5856
5964
  dir: "auto",
5857
5965
  children: a
@@ -5859,53 +5967,53 @@ var La = {
5859
5967
  };
5860
5968
  }
5861
5969
  };
5862
- Object.keys(La).sort();
5863
- function Ra(e) {
5864
- let t = e.field.display?.widget ?? "text", n = La[t];
5970
+ Object.keys(Va).sort();
5971
+ function Ha(e) {
5972
+ let t = e.field.display?.widget ?? "text", n = Va[t];
5865
5973
  if (!n) throw Error(`resolveCellRenderer: no factory registered for widget "${t}" (field "${e.fieldName}"). The engine must stamp a smart default at YAML-load time; an unknown widget here indicates an out-of-sync allow-list.`);
5866
5974
  return n(e);
5867
5975
  }
5868
5976
  //#endregion
5869
5977
  //#region src/components/fields/index.tsx
5870
- var za = {
5871
- string: vn,
5872
- text: yn,
5873
- rich_text: ii,
5874
- int: Ln,
5875
- float: Ln,
5876
- decimal: Ln,
5877
- bool: Pn,
5878
- timestamp: Nn,
5879
- date: Nn,
5880
- time: Nn,
5881
- enum: xn,
5882
- email: Sn,
5883
- url: Cn,
5884
- phone: wn,
5885
- uuid: vn,
5886
- bytes: vn,
5887
- ref: Vn,
5888
- json: Gn,
5889
- tags: vn,
5890
- string_array: ir,
5891
- int_array: or,
5892
- uuid_array: ir,
5893
- multilang: qn,
5894
- multilang_text: Yn,
5895
- structure: Xn,
5896
- secret: er,
5897
- password: nr
5978
+ var Ua = {
5979
+ string: xn,
5980
+ text: Sn,
5981
+ rich_text: si,
5982
+ int: Bn,
5983
+ float: Bn,
5984
+ decimal: Bn,
5985
+ bool: Ln,
5986
+ timestamp: In,
5987
+ date: In,
5988
+ time: In,
5989
+ enum: wn,
5990
+ email: Tn,
5991
+ url: En,
5992
+ phone: Dn,
5993
+ uuid: xn,
5994
+ bytes: xn,
5995
+ ref: Wn,
5996
+ json: Jn,
5997
+ tags: xn,
5998
+ string_array: sr,
5999
+ int_array: lr,
6000
+ uuid_array: sr,
6001
+ multilang: Xn,
6002
+ multilang_text: Qn,
6003
+ structure: $n,
6004
+ secret: rr,
6005
+ password: ar
5898
6006
  };
5899
- for (let e of gn) if (!za[e]) throw Error(`editRegistry: missing entry for FieldType "${e}". The TS union (types/fieldType.ts) and editRegistry must stay in sync with golang/internal/engine/types.go.`);
5900
- function Ba(e) {
5901
- if (e.field.type === "json" && e.field.structure) return /* @__PURE__ */ V(Xn, { ...e });
6007
+ for (let e of yn) if (!Ua[e]) throw Error(`editRegistry: missing entry for FieldType "${e}". The TS union (types/fieldType.ts) and editRegistry must stay in sync with golang/internal/engine/types.go.`);
6008
+ function Wa(e) {
6009
+ if (e.field.type === "json" && e.field.structure) return /* @__PURE__ */ V($n, { ...e });
5902
6010
  if (e.mode === "edit") {
5903
- let t = za[e.field.type];
6011
+ let t = Ua[e.field.type];
5904
6012
  if (!t) throw Error(`renderField: no edit-mode renderer for FieldType "${e.field.type}" (field "${e.fieldName}"). editRegistry must be total over FieldType; check types/fieldType.ts and components/fields/index.tsx.`);
5905
6013
  return /* @__PURE__ */ V(t, { ...e });
5906
6014
  }
5907
6015
  if (!e.field.display?.widget) throw Error(`renderField: display mode requires a non-empty field.display.widget (field "${e.fieldName}", type "${e.field.type}"). The engine must stamp a smart default; an empty widget here means the field bypassed ResolveDefaultWidgets.`);
5908
- return Ra({
6016
+ return Ha({
5909
6017
  field: e.field,
5910
6018
  fieldName: e.fieldName,
5911
6019
  surface: e.surface ?? "detail",
@@ -5919,26 +6027,26 @@ function Ba(e) {
5919
6027
  }
5920
6028
  //#endregion
5921
6029
  //#region src/hooks/useUserLocale.ts
5922
- var Va = "en";
5923
- function Ha() {
6030
+ var Ga = "en";
6031
+ function Ka() {
5924
6032
  if (typeof navigator > "u") return;
5925
6033
  let e = navigator.language;
5926
6034
  if (e) return e.split("-")[0] || void 0;
5927
6035
  }
5928
- function Ua() {
5929
- let e = Dt((e) => e.user), { data: t } = Ot(), n = e?.language;
6036
+ function qa() {
6037
+ let e = At((e) => e.user), { data: t } = jt(), n = e?.language;
5930
6038
  if (n && n.trim()) return n;
5931
6039
  let r = t?.languages?.[0]?.code;
5932
- return r && r.trim() ? r : Ha() || Va;
6040
+ return r && r.trim() ? r : Ka() || Ga;
5933
6041
  }
5934
6042
  //#endregion
5935
6043
  //#region src/components/primitives/dataTableStyles.ts
5936
- var Wa = {
6044
+ var Ja = {
5937
6045
  width: "100%",
5938
6046
  fontSize: 12.5,
5939
6047
  borderCollapse: "separate",
5940
6048
  borderSpacing: 0
5941
- }, Ga = {
6049
+ }, Ya = {
5942
6050
  height: 30,
5943
6051
  padding: "0 12px",
5944
6052
  textAlign: "left",
@@ -5946,13 +6054,13 @@ var Wa = {
5946
6054
  fontSize: 11,
5947
6055
  color: "var(--text-3)",
5948
6056
  borderBottom: "1px solid var(--divider)"
5949
- }, Ka = {
6057
+ }, Xa = {
5950
6058
  padding: "6px 12px",
5951
6059
  borderBottom: "1px solid var(--divider)",
5952
6060
  color: "var(--text-2)",
5953
6061
  verticalAlign: "middle"
5954
6062
  };
5955
6063
  //#endregion
5956
- export { wt as $, ae as $t, an as A, ze as At, en as B, Ce as Bt, zn as C, Je as Ct, _n as D, Re as Dt, Tn as E, Oe as Et, rn as F, Be as Ft, Jt as G, le as Gt, Yt as H, ye as Ht, nn as I, De as It, Et as J, oe as Jt, Ot as K, ce as Kt, hn as L, Ee as Lt, cn as M, Le as Mt, mn as N, Ae as Nt, dn as O, Ie as Ot, un as P, Z as Pt, Ct as Q, q as Qt, ln as R, Te as Rt, Bn as S, it as St, En as T, Me as Tt, Xt as U, _e as Ut, Zt as V, Se as Vt, Ut as W, ge as Wt, _t as X, Y as Xt, mt as Y, X as Yt, Tt as Z, J as Zt, mr as _, et as _t, Ba as a, yt as at, ur as b, tt as bt, ni as c, ot as ct, qr as d, $e as dt, xt as et, Kr as f, Ye as ft, wr as g, Q as gt, Tr as h, ct as ht, Ua as i, St as it, sn as j, je as jt, pn as k, Ve as kt, Hr as l, st as lt, Er as m, Qe as mt, Ga as n, ht as nt, Ra as o, Ue as ot, Gr as p, We as pt, Dt as q, se as qt, Wa as r, gt as rt, ti as s, at as st, Ka as t, vt as tt, Wr as u, Ze as ut, pr as v, rt as vt, Rn as w, He as wt, cr as x, Xe as xt, lr as y, nt as yt, on as z, we as zt };
6064
+ export { Dt as $, ae as $t, cn as A, He as At, rn as B, Ce as Bt, Hn as C, Ze as Ct, bn as D, Ve as Dt, On as E, Oe as Et, sn as F, Ue as Ft, Zt as G, le as Gt, Qt as H, ye as Ht, on as I, De as It, kt as J, oe as Jt, jt as K, ce as Kt, vn as L, Ee as Lt, dn as M, Be as Mt, _n as N, Ae as Nt, mn as O, ze as Ot, pn as P, Z as Pt, Et as Q, q as Qt, fn as R, Te as Rt, Un as S, st as St, kn as T, Fe as Tt, $t as U, _e as Ut, en as V, Se as Vt, Kt as W, ge as Wt, bt as X, Y as Xt, _t as Y, X as Yt, Ot as Z, J as Zt, _r as _, rt as _t, Wa as a, St as at, pr as b, it as bt, ai as c, lt as ct, Xr as d, nt as dt, wt as et, Yr as f, Qe as ft, Dr as g, Q as gt, Or as h, dt as ht, qa as i, Tt as it, un as j, Pe as jt, gn as k, We as kt, Gr as l, ut as lt, kr as m, tt as mt, Ya as n, vt as nt, Ha as o, Ke as ot, Jr as p, qe as pt, At as q, se as qt, Ja as r, yt as rt, ii as s, ct as st, Xa as t, xt as tt, qr as u, et as ut, gr as v, ot as vt, Vn as w, Ge as wt, dr as x, $e as xt, fr as y, at as yt, ln as z, we as zt };
5957
6065
 
5958
- //# sourceMappingURL=dataTableStyles-B40JEa-3.js.map
6066
+ //# sourceMappingURL=dataTableStyles-4q9A0Djy.js.map