@nivaro/react 0.3.113 → 0.3.114

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,115 +1,115 @@
1
- import { jsxs as i, Fragment as Q, jsx as t } from "react/jsx-runtime";
2
- import { Search as nt, Pin as st, ChevronDown as it, Inbox as dt, ChevronsUpDown as le, ChevronUp as ct, X as ne, Check as ot, CalendarDays as pt } from "lucide-react";
3
- import bt, { useMemo as Ve, useRef as ae, useState as $, useEffect as K, useLayoutEffect as ht } from "react";
4
- import { parseDateFilter as Ae, describeDateFilter as mt, DATE_FILTER_OPS as ut, formatDateFilter as xt } from "../lib/date-filter.js";
5
- import { parseNumberFilter as Le, describeNumberFilter as ft, NUMBER_FILTER_OPS as yt, formatNumberFilter as gt } from "../lib/number-filter.js";
1
+ import { jsxs as d, Fragment as Z, jsx as t } from "react/jsx-runtime";
2
+ import { Search as st, Pin as it, ChevronDown as dt, Inbox as ct, ChevronsUpDown as ie, ChevronUp as ot, X as de, Check as bt, CalendarDays as pt } from "lucide-react";
3
+ import ht, { useMemo as Ve, useRef as se, useState as z, useEffect as G, useLayoutEffect as mt } from "react";
4
+ import { parseDateFilter as Le, describeDateFilter as ut, DATE_FILTER_OPS as xt, formatDateFilter as ft } from "../lib/date-filter.js";
5
+ import { parseNumberFilter as We, describeNumberFilter as yt, NUMBER_FILTER_OPS as gt, formatNumberFilter as kt } from "../lib/number-filter.js";
6
6
  import { fitPins as vt } from "../lib/table-pins.js";
7
- import { cn as m, formatNumber as ge } from "../lib/utils.js";
8
- import { CellCopyLayer as kt } from "./CellCopyLayer.js";
9
- import { EmptyState as Nt } from "./EmptyState.js";
10
- import { HScrollProxy as wt } from "./HScrollProxy.js";
11
- import { TableSkeletonRows as _t } from "./Skeletons.js";
12
- import { Button as te } from "./ui/button.js";
13
- import { Checkbox as Fe } from "./ui/checkbox.js";
14
- import { Command as Ot, CommandInput as St, CommandList as $t, CommandEmpty as zt, CommandItem as Ct } from "./ui/command.js";
15
- import { Input as F } from "./ui/input.js";
16
- import { Popover as se, PopoverTrigger as ie, PopoverContent as de } from "./ui/popover.js";
17
- import { Select as Tt, SelectTrigger as Et, SelectValue as Mt, SelectContent as jt, SelectItem as We } from "./ui/select.js";
18
- import { Table as qe, TableHeader as Be, TableRow as H, TableHead as X, TableBody as Ue, TableCell as re } from "./ui/table.js";
7
+ import { cn as h, formatNumber as ve } from "../lib/utils.js";
8
+ import { CellCopyLayer as Nt } from "./CellCopyLayer.js";
9
+ import { EmptyState as wt } from "./EmptyState.js";
10
+ import { HScrollProxy as _t } from "./HScrollProxy.js";
11
+ import { TableSkeletonRows as Ot } from "./Skeletons.js";
12
+ import { Button as le } from "./ui/button.js";
13
+ import { Checkbox as qe } from "./ui/checkbox.js";
14
+ import { Command as $t, CommandInput as zt, CommandList as St, CommandEmpty as Mt, CommandItem as Tt } from "./ui/command.js";
15
+ import { Input as B } from "./ui/input.js";
16
+ import { Popover as ce, PopoverTrigger as oe, PopoverContent as be } from "./ui/popover.js";
17
+ import { Select as Et, SelectTrigger as Ct, SelectValue as jt, SelectContent as At, SelectItem as Fe } from "./ui/select.js";
18
+ import { Table as Be, TableHeader as Ue, TableRow as Q, TableHead as Y, TableBody as De, TableCell as ne } from "./ui/table.js";
19
19
  const Vt = [1, 2, 3, 4, 5, 6, 7, 8];
20
- function ke(r) {
21
- var s;
22
- return r == null || typeof r == "boolean" ? "" : typeof r == "string" || typeof r == "number" ? String(r) : Array.isArray(r) ? r.map(ke).join("") : typeof r == "object" && "props" in r ? ke((s = r.props) == null ? void 0 : s.children) : "";
20
+ function we(r) {
21
+ var i;
22
+ return r == null || typeof r == "boolean" ? "" : typeof r == "string" || typeof r == "number" ? String(r) : Array.isArray(r) ? r.map(we).join("") : typeof r == "object" && "props" in r ? we((i = r.props) == null ? void 0 : i.children) : "";
23
23
  }
24
- function At(r) {
25
- const s = ke(r.header).replace(/\s+/g, " ").trim();
26
- if (s) return s;
24
+ function Lt(r) {
25
+ const i = we(r.header).replace(/\s+/g, " ").trim();
26
+ if (i) return i;
27
27
  const c = (r.key.split(".").pop() ?? r.key).replace(/_/g, " ").trim();
28
28
  return c ? c[0].toUpperCase() + c.slice(1) : r.key;
29
29
  }
30
- function Ne(r) {
30
+ function _e(r) {
31
31
  return r.startsWith("-") ? r.slice(1) : r;
32
32
  }
33
- function we(r) {
33
+ function Oe(r) {
34
34
  return r ? r.startsWith("-") ? "desc" : "asc" : null;
35
35
  }
36
- function Lt(r, s) {
37
- const o = Ne(r), c = we(r);
38
- return o !== s || !r ? s : c === "asc" ? `-${s}` : "";
36
+ function Wt(r, i) {
37
+ const o = _e(r), c = Oe(r);
38
+ return o !== i || !r ? i : c === "asc" ? `-${i}` : "";
39
39
  }
40
- function Ft(r, s) {
41
- const o = s.trim().toLowerCase().split(/\s+/).filter(Boolean);
40
+ function qt(r, i) {
41
+ const o = i.trim().toLowerCase().split(/\s+/).filter(Boolean);
42
42
  if (o.length === 0) return 1;
43
43
  const c = r.toLowerCase();
44
- return o.every((h) => c.includes(h)) ? 1 : 0;
44
+ return o.every((m) => c.includes(m)) ? 1 : 0;
45
45
  }
46
- function Wt(r, s) {
47
- return !r || Ne(r) !== s ? "none" : we(r) === "desc" ? "descending" : "ascending";
46
+ function Ft(r, i) {
47
+ return !r || _e(r) !== i ? "none" : Oe(r) === "desc" ? "descending" : "ascending";
48
48
  }
49
- function ve(r) {
49
+ function Ne(r) {
50
50
  return typeof r == "string" || typeof r == "number";
51
51
  }
52
- function De({ field: r, sort: s }) {
53
- const o = Ne(s), c = we(s);
54
- return o !== r || !s ? /* @__PURE__ */ t(le, { className: "ml-1 inline h-3 w-3 shrink-0 text-slate-300" }) : /* @__PURE__ */ t(
55
- ct,
52
+ function Je({ field: r, sort: i }) {
53
+ const o = _e(i), c = Oe(i);
54
+ return o !== r || !i ? /* @__PURE__ */ t(ie, { className: "ml-1 inline h-3 w-3 shrink-0 text-slate-300" }) : /* @__PURE__ */ t(
55
+ ot,
56
56
  {
57
- className: m(
57
+ className: h(
58
58
  "ml-1 inline h-3 w-3 shrink-0 text-nvr-cyan transition-transform duration-200",
59
59
  c === "desc" && "rotate-180"
60
60
  )
61
61
  }
62
62
  );
63
63
  }
64
- function qt({
64
+ function Bt({
65
65
  def: r,
66
- value: s,
66
+ value: i,
67
67
  onChange: o
68
68
  }) {
69
- const [c, h] = $(!1), [l, p] = $(""), [y, g] = $([]), [v, u] = $(!1), [b, N] = $({}), a = ae(0), z = !!r.loadOptions, w = Array.isArray(s) ? s : s === "" ? [] : [s];
70
- K(() => {
71
- if (!z || !c) return;
69
+ const [c, m] = z(!1), [n, b] = z(""), [g, k] = z([]), [v, u] = z(!1), [p, _] = z({}), a = se(0), S = !!r.loadOptions, O = Array.isArray(i) ? i : i === "" ? [] : [i];
70
+ G(() => {
71
+ if (!S || !c) return;
72
72
  const x = ++a.current;
73
73
  u(!0);
74
- const C = setTimeout(
74
+ const T = setTimeout(
75
75
  () => {
76
- var M;
77
- (M = r.loadOptions) == null || M.call(r, l).then((V) => {
78
- a.current === x && g(V);
76
+ var C;
77
+ (C = r.loadOptions) == null || C.call(r, n).then((W) => {
78
+ a.current === x && k(W);
79
79
  }).catch(() => {
80
- a.current === x && g([]);
80
+ a.current === x && k([]);
81
81
  }).finally(() => {
82
82
  a.current === x && u(!1);
83
83
  });
84
84
  },
85
- l ? 250 : 0
85
+ n ? 250 : 0
86
86
  );
87
- return () => clearTimeout(C);
88
- }, [l, c, z]);
89
- const Y = z ? y : r.options ?? [], P = (x) => {
90
- var C, M;
91
- return ((C = Y.find((V) => V.value === x)) == null ? void 0 : C.label) ?? ((M = (r.options ?? []).find((V) => V.value === x)) == null ? void 0 : M.label) ?? b[x] ?? x;
92
- }, E = w.length === 0 ? null : w.length === 1 ? P(w[0]) : `${P(w[0])} +${w.length - 1}`;
93
- return /* @__PURE__ */ i(
94
- se,
87
+ return () => clearTimeout(T);
88
+ }, [n, c, S]);
89
+ const I = S ? g : r.options ?? [], ee = (x) => {
90
+ var T, C;
91
+ return ((T = I.find((W) => W.value === x)) == null ? void 0 : T.label) ?? ((C = (r.options ?? []).find((W) => W.value === x)) == null ? void 0 : C.label) ?? p[x] ?? x;
92
+ }, E = O.length === 0 ? null : O.length === 1 ? ee(O[0]) : `${ee(O[0])} +${O.length - 1}`;
93
+ return /* @__PURE__ */ d(
94
+ ce,
95
95
  {
96
96
  open: c,
97
97
  onOpenChange: (x) => {
98
- h(x), x || p("");
98
+ m(x), x || b("");
99
99
  },
100
100
  children: [
101
- /* @__PURE__ */ t(ie, { asChild: !0, children: /* @__PURE__ */ i(
101
+ /* @__PURE__ */ t(oe, { asChild: !0, children: /* @__PURE__ */ d(
102
102
  "button",
103
103
  {
104
104
  type: "button",
105
- className: m(
105
+ className: h(
106
106
  "flex h-8 w-40 items-center justify-between rounded-md border border-slate-200 bg-slate-50 px-2.5 text-[13px] dark:border-border dark:bg-muted/40",
107
107
  E ? "text-slate-800 dark:text-foreground" : "text-slate-500"
108
108
  ),
109
109
  children: [
110
110
  /* @__PURE__ */ t("span", { className: "truncate", children: E ?? r.placeholder }),
111
- /* @__PURE__ */ i("span", { className: "ml-1 flex shrink-0 items-center gap-0.5", children: [
112
- w.length > 0 && // biome-ignore lint/a11y/useKeyWithClickEvents: auxiliary clear affordance; Esc + reselect cover keyboard
111
+ /* @__PURE__ */ d("span", { className: "ml-1 flex shrink-0 items-center gap-0.5", children: [
112
+ O.length > 0 && // biome-ignore lint/a11y/useKeyWithClickEvents: auxiliary clear affordance; Esc + reselect cover keyboard
113
113
  /* @__PURE__ */ t(
114
114
  "span",
115
115
  {
@@ -120,40 +120,40 @@ function qt({
120
120
  x.stopPropagation(), o(r.multi ? [] : "");
121
121
  },
122
122
  className: "rounded p-0.5 text-slate-400 hover:text-slate-600",
123
- children: /* @__PURE__ */ t(ne, { className: "h-3 w-3" })
123
+ children: /* @__PURE__ */ t(de, { className: "h-3 w-3" })
124
124
  }
125
125
  ),
126
- /* @__PURE__ */ t(le, { className: "h-3 w-3 text-slate-400" })
126
+ /* @__PURE__ */ t(ie, { className: "h-3 w-3 text-slate-400" })
127
127
  ] })
128
128
  ]
129
129
  }
130
130
  ) }),
131
- /* @__PURE__ */ t(de, { className: "w-[240px] p-0", align: "start", children: /* @__PURE__ */ i(Ot, { shouldFilter: !z, filter: Ft, children: [
131
+ /* @__PURE__ */ t(be, { className: "w-[240px] p-0", align: "start", children: /* @__PURE__ */ d($t, { shouldFilter: !S, filter: qt, children: [
132
132
  /* @__PURE__ */ t(
133
- St,
133
+ zt,
134
134
  {
135
135
  placeholder: "Search…",
136
136
  className: "h-8 text-[12px]",
137
- value: l,
138
- onValueChange: p
137
+ value: n,
138
+ onValueChange: b
139
139
  }
140
140
  ),
141
- /* @__PURE__ */ i($t, { children: [
142
- /* @__PURE__ */ t(zt, { className: "py-3 text-center text-[12px] text-slate-400", children: v ? "Searching…" : "No results" }),
143
- Y.map((x) => {
144
- const C = w.includes(x.value);
145
- return /* @__PURE__ */ i(
146
- Ct,
141
+ /* @__PURE__ */ d(St, { children: [
142
+ /* @__PURE__ */ t(Mt, { className: "py-3 text-center text-[12px] text-slate-400", children: v ? "Searching…" : "No results" }),
143
+ I.map((x) => {
144
+ const T = O.includes(x.value);
145
+ return /* @__PURE__ */ d(
146
+ Tt,
147
147
  {
148
- value: z ? x.value : x.label,
148
+ value: S ? x.value : x.label,
149
149
  onSelect: () => {
150
- N((M) => ({ ...M, [x.value]: x.label })), r.multi ? o(
151
- C ? w.filter((M) => M !== x.value) : [...w, x.value]
152
- ) : (o(C ? "" : x.value), h(!1));
150
+ _((C) => ({ ...C, [x.value]: x.label })), r.multi ? o(
151
+ T ? O.filter((C) => C !== x.value) : [...O, x.value]
152
+ ) : (o(T ? "" : x.value), m(!1));
153
153
  },
154
154
  className: "text-[12px]",
155
155
  children: [
156
- /* @__PURE__ */ t(ot, { className: m("mr-2 h-3 w-3", C ? "opacity-100" : "opacity-0") }),
156
+ /* @__PURE__ */ t(bt, { className: h("mr-2 h-3 w-3", T ? "opacity-100" : "opacity-0") }),
157
157
  x.label
158
158
  ]
159
159
  },
@@ -166,31 +166,31 @@ function qt({
166
166
  }
167
167
  );
168
168
  }
169
- function Bt({
169
+ function Ut({
170
170
  value: r,
171
- placeholder: s,
171
+ placeholder: i,
172
172
  onChange: o
173
173
  }) {
174
- const [c, h] = $(!1), l = Ae(r), [p, y] = $((l == null ? void 0 : l.op) ?? "on"), [g, v] = $((l == null ? void 0 : l.from) ?? ""), [u, b] = $((l == null ? void 0 : l.to) ?? "");
175
- K(() => {
174
+ const [c, m] = z(!1), n = Le(r), [b, g] = z((n == null ? void 0 : n.op) ?? "on"), [k, v] = z((n == null ? void 0 : n.from) ?? ""), [u, p] = z((n == null ? void 0 : n.to) ?? "");
175
+ G(() => {
176
176
  if (!c) return;
177
- const a = Ae(r);
178
- y((a == null ? void 0 : a.op) ?? "on"), v((a == null ? void 0 : a.from) ?? ""), b((a == null ? void 0 : a.to) ?? "");
177
+ const a = Le(r);
178
+ g((a == null ? void 0 : a.op) ?? "on"), v((a == null ? void 0 : a.from) ?? ""), p((a == null ? void 0 : a.to) ?? "");
179
179
  }, [c, r]);
180
- const N = (a, z, w) => {
181
- z && (o(xt({ op: a, from: z, to: w || z })), (a !== "between" || w) && h(!1));
180
+ const _ = (a, S, O) => {
181
+ S && (o(ft({ op: a, from: S, to: O || S })), (a !== "between" || O) && m(!1));
182
182
  };
183
- return /* @__PURE__ */ i(se, { open: c, onOpenChange: h, children: [
184
- /* @__PURE__ */ t(ie, { asChild: !0, children: /* @__PURE__ */ i(
183
+ return /* @__PURE__ */ d(ce, { open: c, onOpenChange: m, children: [
184
+ /* @__PURE__ */ t(oe, { asChild: !0, children: /* @__PURE__ */ d(
185
185
  "button",
186
186
  {
187
187
  type: "button",
188
188
  "data-date-filter": !0,
189
189
  className: "flex h-8 w-full items-center justify-between gap-1 rounded-md border border-slate-200 bg-slate-50 px-2 text-left text-[12px] dark:border-border dark:bg-muted",
190
190
  children: [
191
- /* @__PURE__ */ t("span", { className: m("truncate", !l && "text-slate-500 dark:text-muted-foreground"), children: l ? mt(l) : s }),
192
- l ? /* @__PURE__ */ t(
193
- ne,
191
+ /* @__PURE__ */ t("span", { className: h("truncate", !n && "text-slate-500 dark:text-muted-foreground"), children: n ? ut(n) : i }),
192
+ n ? /* @__PURE__ */ t(
193
+ de,
194
194
  {
195
195
  className: "h-3 w-3 shrink-0 text-slate-400 hover:text-slate-700",
196
196
  onClick: (a) => {
@@ -201,37 +201,37 @@ function Bt({
201
201
  ]
202
202
  }
203
203
  ) }),
204
- /* @__PURE__ */ i(de, { align: "start", className: "w-[248px] space-y-2 p-2", children: [
205
- /* @__PURE__ */ t("div", { className: "grid grid-cols-3 gap-1", children: ut.map((a) => /* @__PURE__ */ t(
204
+ /* @__PURE__ */ d(be, { align: "start", className: "w-[248px] space-y-2 p-2", children: [
205
+ /* @__PURE__ */ t("div", { className: "grid grid-cols-3 gap-1", children: xt.map((a) => /* @__PURE__ */ t(
206
206
  "button",
207
207
  {
208
208
  type: "button",
209
209
  "data-date-op": a.op,
210
- "aria-pressed": p === a.op,
210
+ "aria-pressed": b === a.op,
211
211
  onClick: () => {
212
- y(a.op), g && N(a.op, g, u);
212
+ g(a.op), k && _(a.op, k, u);
213
213
  },
214
- className: m(
214
+ className: h(
215
215
  "rounded border px-1 py-1 text-[11px] leading-tight transition-colors",
216
- p === a.op ? "border-nvr-cyan/40 bg-nvr-cyan/10 font-medium" : "border-slate-200 text-slate-600 hover:bg-muted dark:border-border dark:text-muted-foreground"
216
+ b === a.op ? "border-nvr-cyan/40 bg-nvr-cyan/10 font-medium" : "border-slate-200 text-slate-600 hover:bg-muted dark:border-border dark:text-muted-foreground"
217
217
  ),
218
218
  children: a.label
219
219
  },
220
220
  a.op
221
221
  )) }),
222
- /* @__PURE__ */ i("div", { className: "flex items-center gap-1", children: [
222
+ /* @__PURE__ */ d("div", { className: "flex items-center gap-1", children: [
223
223
  /* @__PURE__ */ t(
224
224
  "input",
225
225
  {
226
226
  type: "date",
227
- value: g,
227
+ value: k,
228
228
  onChange: (a) => {
229
- v(a.target.value), p !== "between" && N(p, a.target.value, "");
229
+ v(a.target.value), b !== "between" && _(b, a.target.value, "");
230
230
  },
231
231
  className: "h-7 flex-1 rounded border border-slate-200 bg-background px-1 text-[12px] dark:border-border"
232
232
  }
233
233
  ),
234
- p === "between" && /* @__PURE__ */ i(Q, { children: [
234
+ b === "between" && /* @__PURE__ */ d(Z, { children: [
235
235
  /* @__PURE__ */ t("span", { className: "text-[11px] text-slate-400", children: "to" }),
236
236
  /* @__PURE__ */ t(
237
237
  "input",
@@ -239,7 +239,7 @@ function Bt({
239
239
  type: "date",
240
240
  value: u,
241
241
  onChange: (a) => {
242
- b(a.target.value), N("between", g, a.target.value);
242
+ p(a.target.value), _("between", k, a.target.value);
243
243
  },
244
244
  className: "h-7 flex-1 rounded border border-slate-200 bg-background px-1 text-[12px] dark:border-border"
245
245
  }
@@ -249,15 +249,15 @@ function Bt({
249
249
  ] })
250
250
  ] });
251
251
  }
252
- function Ut({
252
+ function Dt({
253
253
  value: r,
254
- placeholder: s,
254
+ placeholder: i,
255
255
  unit: o,
256
256
  onChange: c
257
257
  }) {
258
- const [h, l] = $(!1), [p, y] = r.split(":"), g = o ?? "", v = p && y ? `${p}–${y}${g}` : p ? `${p}${g}+` : y ? `≤ ${y}${g}` : s, u = (b, N) => c(b === "" && N === "" ? null : `${b}:${N}`);
259
- return /* @__PURE__ */ i(se, { open: h, onOpenChange: l, children: [
260
- /* @__PURE__ */ t(ie, { asChild: !0, children: /* @__PURE__ */ i(
258
+ const [m, n] = z(!1), [b, g] = r.split(":"), k = o ?? "", v = b && g ? `${b}–${g}${k}` : b ? `${b}${k}+` : g ? `≤ ${g}${k}` : i, u = (p, _) => c(p === "" && _ === "" ? null : `${p}:${_}`);
259
+ return /* @__PURE__ */ d(ce, { open: m, onOpenChange: n, children: [
260
+ /* @__PURE__ */ t(oe, { asChild: !0, children: /* @__PURE__ */ d(
261
261
  "button",
262
262
  {
263
263
  type: "button",
@@ -267,45 +267,45 @@ function Ut({
267
267
  /* @__PURE__ */ t(
268
268
  "span",
269
269
  {
270
- className: m("truncate", !p && !y && "text-slate-500 dark:text-muted-foreground"),
270
+ className: h("truncate", !b && !g && "text-slate-500 dark:text-muted-foreground"),
271
271
  children: v
272
272
  }
273
273
  ),
274
- p || y ? /* @__PURE__ */ t(
275
- ne,
274
+ b || g ? /* @__PURE__ */ t(
275
+ de,
276
276
  {
277
277
  className: "h-3 w-3 shrink-0 text-slate-400 hover:text-slate-700",
278
- onClick: (b) => {
279
- b.stopPropagation(), c(null);
278
+ onClick: (p) => {
279
+ p.stopPropagation(), c(null);
280
280
  }
281
281
  }
282
- ) : /* @__PURE__ */ t(le, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" })
282
+ ) : /* @__PURE__ */ t(ie, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" })
283
283
  ]
284
284
  }
285
285
  ) }),
286
- /* @__PURE__ */ i(de, { align: "start", className: "w-[200px] p-2", children: [
287
- /* @__PURE__ */ t("p", { className: "pb-1 text-[10px] font-semibold uppercase tracking-wide text-slate-400", children: s }),
288
- /* @__PURE__ */ i("div", { className: "flex items-center gap-1", children: [
286
+ /* @__PURE__ */ d(be, { align: "start", className: "w-[200px] p-2", children: [
287
+ /* @__PURE__ */ t("p", { className: "pb-1 text-[10px] font-semibold uppercase tracking-wide text-slate-400", children: i }),
288
+ /* @__PURE__ */ d("div", { className: "flex items-center gap-1", children: [
289
289
  /* @__PURE__ */ t(
290
- F,
290
+ B,
291
291
  {
292
292
  type: "number",
293
- "aria-label": `Minimum ${s}`,
293
+ "aria-label": `Minimum ${i}`,
294
294
  placeholder: "Min",
295
- value: p ?? "",
296
- onChange: (b) => u(b.target.value, y ?? ""),
295
+ value: b ?? "",
296
+ onChange: (p) => u(p.target.value, g ?? ""),
297
297
  className: "h-7 text-[12px]"
298
298
  }
299
299
  ),
300
300
  /* @__PURE__ */ t("span", { className: "text-[11px] text-slate-400", children: "–" }),
301
301
  /* @__PURE__ */ t(
302
- F,
302
+ B,
303
303
  {
304
304
  type: "number",
305
- "aria-label": `Maximum ${s}`,
305
+ "aria-label": `Maximum ${i}`,
306
306
  placeholder: "Max",
307
- value: y ?? "",
308
- onChange: (b) => u(p ?? "", b.target.value),
307
+ value: g ?? "",
308
+ onChange: (p) => u(b ?? "", p.target.value),
309
309
  className: "h-7 text-[12px]"
310
310
  }
311
311
  )
@@ -313,80 +313,80 @@ function Ut({
313
313
  ] })
314
314
  ] });
315
315
  }
316
- function Dt({
316
+ function Jt({
317
317
  value: r,
318
- placeholder: s,
318
+ placeholder: i,
319
319
  onChange: o
320
320
  }) {
321
- const [c, h] = $(!1), l = Le(r), [p, y] = $((l == null ? void 0 : l.op) ?? "eq"), [g, v] = $(l ? String(l.a) : ""), [u, b] = $((l == null ? void 0 : l.b) != null ? String(l.b) : "");
322
- K(() => {
321
+ const [c, m] = z(!1), n = We(r), [b, g] = z((n == null ? void 0 : n.op) ?? "eq"), [k, v] = z(n ? String(n.a) : ""), [u, p] = z((n == null ? void 0 : n.b) != null ? String(n.b) : "");
322
+ G(() => {
323
323
  if (!c) return;
324
- const a = Le(r);
325
- y((a == null ? void 0 : a.op) ?? "eq"), v(a ? String(a.a) : ""), b((a == null ? void 0 : a.b) != null ? String(a.b) : "");
324
+ const a = We(r);
325
+ g((a == null ? void 0 : a.op) ?? "eq"), v(a ? String(a.a) : ""), p((a == null ? void 0 : a.b) != null ? String(a.b) : "");
326
326
  }, [c, r]);
327
- const N = (a, z, w) => {
328
- z === "" || Number.isNaN(Number(z)) || a === "between" && (w === "" || Number.isNaN(Number(w))) || o(gt({ op: a, a: Number(z), b: w === "" ? void 0 : Number(w) }));
327
+ const _ = (a, S, O) => {
328
+ S === "" || Number.isNaN(Number(S)) || a === "between" && (O === "" || Number.isNaN(Number(O))) || o(kt({ op: a, a: Number(S), b: O === "" ? void 0 : Number(O) }));
329
329
  };
330
- return /* @__PURE__ */ i(se, { open: c, onOpenChange: h, children: [
331
- /* @__PURE__ */ t(ie, { asChild: !0, children: /* @__PURE__ */ i(
330
+ return /* @__PURE__ */ d(ce, { open: c, onOpenChange: m, children: [
331
+ /* @__PURE__ */ t(oe, { asChild: !0, children: /* @__PURE__ */ d(
332
332
  "button",
333
333
  {
334
334
  type: "button",
335
335
  "data-number-filter": !0,
336
336
  className: "flex h-8 w-full items-center justify-between gap-1 rounded-md border border-slate-200 bg-slate-50 px-2 text-left text-[12px] dark:border-border dark:bg-muted",
337
337
  children: [
338
- /* @__PURE__ */ t("span", { className: m("truncate", !l && "text-slate-500 dark:text-muted-foreground"), children: l ? ft(l) : s }),
339
- l ? /* @__PURE__ */ t(
340
- ne,
338
+ /* @__PURE__ */ t("span", { className: h("truncate", !n && "text-slate-500 dark:text-muted-foreground"), children: n ? yt(n) : i }),
339
+ n ? /* @__PURE__ */ t(
340
+ de,
341
341
  {
342
342
  className: "h-3 w-3 shrink-0 text-slate-400 hover:text-slate-700",
343
343
  onClick: (a) => {
344
344
  a.stopPropagation(), o(null);
345
345
  }
346
346
  }
347
- ) : /* @__PURE__ */ t(le, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" })
347
+ ) : /* @__PURE__ */ t(ie, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" })
348
348
  ]
349
349
  }
350
350
  ) }),
351
- /* @__PURE__ */ i(de, { align: "start", className: "w-[220px] space-y-2 p-2", children: [
352
- /* @__PURE__ */ t("div", { className: "grid grid-cols-4 gap-1", children: yt.map((a) => /* @__PURE__ */ t(
351
+ /* @__PURE__ */ d(be, { align: "start", className: "w-[220px] space-y-2 p-2", children: [
352
+ /* @__PURE__ */ t("div", { className: "grid grid-cols-4 gap-1", children: gt.map((a) => /* @__PURE__ */ t(
353
353
  "button",
354
354
  {
355
355
  type: "button",
356
356
  "data-number-op": a.op,
357
- "aria-pressed": p === a.op,
357
+ "aria-pressed": b === a.op,
358
358
  onClick: () => {
359
- y(a.op), N(a.op, g, u);
359
+ g(a.op), _(a.op, k, u);
360
360
  },
361
- className: m(
361
+ className: h(
362
362
  "rounded border px-1 py-1 text-[11px] transition-colors",
363
- p === a.op ? "border-nvr-cyan/40 bg-nvr-cyan/10 font-medium" : "border-slate-200 text-slate-600 hover:bg-muted dark:border-border dark:text-muted-foreground"
363
+ b === a.op ? "border-nvr-cyan/40 bg-nvr-cyan/10 font-medium" : "border-slate-200 text-slate-600 hover:bg-muted dark:border-border dark:text-muted-foreground"
364
364
  ),
365
365
  children: a.symbol
366
366
  },
367
367
  a.op
368
368
  )) }),
369
- /* @__PURE__ */ i("div", { className: "flex items-center gap-1", children: [
369
+ /* @__PURE__ */ d("div", { className: "flex items-center gap-1", children: [
370
370
  /* @__PURE__ */ t(
371
- F,
371
+ B,
372
372
  {
373
373
  type: "number",
374
- value: g,
374
+ value: k,
375
375
  onChange: (a) => {
376
- v(a.target.value), N(p, a.target.value, u);
376
+ v(a.target.value), _(b, a.target.value, u);
377
377
  },
378
378
  className: "h-7 text-[12px]"
379
379
  }
380
380
  ),
381
- p === "between" && /* @__PURE__ */ i(Q, { children: [
381
+ b === "between" && /* @__PURE__ */ d(Z, { children: [
382
382
  /* @__PURE__ */ t("span", { className: "text-[11px] text-slate-400", children: "–" }),
383
383
  /* @__PURE__ */ t(
384
- F,
384
+ B,
385
385
  {
386
386
  type: "number",
387
387
  value: u,
388
388
  onChange: (a) => {
389
- b(a.target.value), N(p, g, a.target.value);
389
+ p(a.target.value), _(b, k, a.target.value);
390
390
  },
391
391
  className: "h-7 text-[12px]"
392
392
  }
@@ -396,21 +396,21 @@ function Dt({
396
396
  ] })
397
397
  ] });
398
398
  }
399
- function Je({
399
+ function He({
400
400
  def: r,
401
- value: s,
401
+ value: i,
402
402
  onChange: o,
403
403
  layout: c = "inline"
404
404
  }) {
405
- const h = c === "stacked", l = c === "cell", p = typeof s == "string" ? s : "", y = h || l ? "w-full" : "w-40", g = l ? "h-7 text-[12px]" : "text-[13px]";
405
+ const m = c === "stacked", n = c === "cell", b = typeof i == "string" ? i : "", g = m || n ? "w-full" : "w-40", k = n ? "h-7 text-[12px]" : "text-[13px]";
406
406
  let v;
407
407
  if (r.type === "text")
408
408
  v = /* @__PURE__ */ t(
409
- F,
409
+ B,
410
410
  {
411
- className: m("h-8 border-slate-200 bg-slate-50", g, y),
411
+ className: h("h-8 border-slate-200 bg-slate-50", k, g),
412
412
  placeholder: r.placeholder,
413
- value: p,
413
+ value: b,
414
414
  onChange: (u) => o(u.target.value)
415
415
  }
416
416
  );
@@ -418,85 +418,85 @@ function Je({
418
418
  v = /* @__PURE__ */ t(
419
419
  "div",
420
420
  {
421
- className: m(
422
- (h || l) && "[&>button]:w-full",
423
- l && "[&>button]:h-7 [&>button]:min-w-[88px] [&>button]:px-1.5 [&>button]:text-[12px]"
421
+ className: h(
422
+ (m || n) && "[&>button]:w-full",
423
+ n && "[&>button]:h-7 [&>button]:min-w-[88px] [&>button]:px-1.5 [&>button]:text-[12px]"
424
424
  ),
425
- children: /* @__PURE__ */ t(qt, { def: r, value: s, onChange: o })
425
+ children: /* @__PURE__ */ t(Bt, { def: r, value: i, onChange: o })
426
426
  }
427
427
  );
428
428
  else if (r.type === "date")
429
- v = /* @__PURE__ */ t("div", { className: m(l && "[&>div>button]:h-7 [&>div>button]:text-[12px]", y), children: /* @__PURE__ */ t(
430
- Bt,
429
+ v = /* @__PURE__ */ t("div", { className: h(n && "[&>div>button]:h-7 [&>div>button]:text-[12px]", g), children: /* @__PURE__ */ t(
430
+ Ut,
431
431
  {
432
- value: p,
432
+ value: b,
433
433
  placeholder: r.placeholder,
434
434
  onChange: (u) => o(u ?? "")
435
435
  }
436
436
  ) });
437
437
  else if (r.type === "number")
438
- v = /* @__PURE__ */ t("div", { className: m(l && "[&>div>button]:h-7 [&>div>button]:text-[12px]", y), children: /* @__PURE__ */ t(
439
- Dt,
438
+ v = /* @__PURE__ */ t("div", { className: h(n && "[&>div>button]:h-7 [&>div>button]:text-[12px]", g), children: /* @__PURE__ */ t(
439
+ Jt,
440
440
  {
441
- value: p,
441
+ value: b,
442
442
  placeholder: r.placeholder,
443
443
  onChange: (u) => o(u ?? "")
444
444
  }
445
445
  ) });
446
- else if (r.type === "range" && l)
446
+ else if (r.type === "range" && n)
447
447
  v = /* @__PURE__ */ t("div", { className: "[&>div>button]:h-7 [&>div>button]:text-[12px] w-full", children: /* @__PURE__ */ t(
448
- Ut,
448
+ Dt,
449
449
  {
450
- value: p,
450
+ value: b,
451
451
  placeholder: r.placeholder,
452
452
  unit: r.range_unit,
453
453
  onChange: (u) => o(u ?? "")
454
454
  }
455
455
  ) });
456
456
  else if (r.type === "range") {
457
- const [u, b] = p.split(":");
458
- v = /* @__PURE__ */ i("div", { className: "flex items-center gap-1", children: [
457
+ const [u, p] = b.split(":");
458
+ v = /* @__PURE__ */ d("div", { className: "flex items-center gap-1", children: [
459
459
  /* @__PURE__ */ t(
460
- F,
460
+ B,
461
461
  {
462
462
  type: "number",
463
- className: m(
463
+ className: h(
464
464
  "h-8 border-slate-200 bg-slate-50",
465
- g,
466
- h || l ? "w-full min-w-[48px]" : "w-20"
465
+ k,
466
+ m || n ? "w-full min-w-[48px]" : "w-20"
467
467
  ),
468
468
  placeholder: "Min",
469
469
  value: u ?? "",
470
- onChange: (N) => o(`${N.target.value}:${b ?? ""}`)
470
+ onChange: (_) => o(`${_.target.value}:${p ?? ""}`)
471
471
  }
472
472
  ),
473
473
  /* @__PURE__ */ t("span", { className: "text-[12px] text-slate-400", children: "–" }),
474
474
  /* @__PURE__ */ t(
475
- F,
475
+ B,
476
476
  {
477
477
  type: "number",
478
- className: m(
478
+ className: h(
479
479
  "h-8 border-slate-200 bg-slate-50",
480
- g,
481
- h || l ? "w-full min-w-[48px]" : "w-20"
480
+ k,
481
+ m || n ? "w-full min-w-[48px]" : "w-20"
482
482
  ),
483
483
  placeholder: "Max",
484
- value: b ?? "",
485
- onChange: (N) => o(`${u ?? ""}:${N.target.value}`)
484
+ value: p ?? "",
485
+ onChange: (_) => o(`${u ?? ""}:${_.target.value}`)
486
486
  }
487
487
  )
488
488
  ] });
489
489
  } else
490
- v = /* @__PURE__ */ i(Tt, { value: p === "" ? "__all__" : p, onValueChange: (b) => o(b === "__all__" ? "" : b), children: [
491
- /* @__PURE__ */ t(Et, { className: m("h-8 border-slate-200 bg-slate-50", g, y), children: /* @__PURE__ */ t(Mt, { placeholder: r.placeholder }) }),
492
- /* @__PURE__ */ i(jt, { children: [
493
- /* @__PURE__ */ t(We, { value: "__all__", children: r.placeholder }),
494
- (r.options ?? []).filter((b) => b.value !== "").map((b) => /* @__PURE__ */ t(We, { value: b.value, children: b.label }, b.value))
490
+ v = /* @__PURE__ */ d(Et, { value: b === "" ? "__all__" : b, onValueChange: (p) => o(p === "__all__" ? "" : p), children: [
491
+ /* @__PURE__ */ t(Ct, { className: h("h-8 border-slate-200 bg-slate-50", k, g), children: /* @__PURE__ */ t(jt, { placeholder: r.placeholder }) }),
492
+ /* @__PURE__ */ d(At, { children: [
493
+ /* @__PURE__ */ t(Fe, { value: "__all__", children: r.placeholder }),
494
+ (r.options ?? []).filter((p) => p.value !== "").map((p) => /* @__PURE__ */ t(Fe, { value: p.value, children: p.label }, p.value))
495
495
  ] })
496
496
  ] });
497
- return h ? /* @__PURE__ */ i("div", { className: "space-y-1", children: [
498
- /* @__PURE__ */ i("span", { className: "flex items-center gap-1.5 text-[11px] font-medium text-slate-500 dark:text-muted-foreground", children: [
499
- Jt(r),
497
+ return m ? /* @__PURE__ */ d("div", { className: "space-y-1", children: [
498
+ /* @__PURE__ */ d("span", { className: "flex items-center gap-1.5 text-[11px] font-medium text-slate-500 dark:text-muted-foreground", children: [
499
+ Ht(r),
500
500
  r.restricted && /* @__PURE__ */ t(
501
501
  "span",
502
502
  {
@@ -514,234 +514,235 @@ function Je({
514
514
  className: "[&_button]:!border-amber-400 [&_input]:!border-amber-400 dark:[&_button]:!border-amber-500/60 dark:[&_input]:!border-amber-500/60",
515
515
  children: v
516
516
  }
517
- ) : /* @__PURE__ */ t(Q, { children: v });
517
+ ) : /* @__PURE__ */ t(Z, { children: v });
518
518
  }
519
- function Jt(r) {
519
+ function Ht(r) {
520
520
  return r.placeholder.replace(/^Search\s+/i, "").replace(/[…]|\.{3}$/g, "");
521
521
  }
522
- function dr(r, s) {
522
+ function cr(r, i) {
523
523
  const o = (c) => {
524
- var h, l;
525
- return ((l = (h = r.options) == null ? void 0 : h.find((p) => p.value === c)) == null ? void 0 : l.label) ?? c;
524
+ var m, n;
525
+ return ((n = (m = r.options) == null ? void 0 : m.find((b) => b.value === c)) == null ? void 0 : n.label) ?? c;
526
526
  };
527
- if (Array.isArray(s)) {
528
- const c = s.map(o);
527
+ if (Array.isArray(i)) {
528
+ const c = i.map(o);
529
529
  return c.slice(0, 2).join(", ") + (c.length > 2 ? ` +${c.length - 2}` : "");
530
530
  }
531
531
  if (r.type === "range") {
532
- const [c, h] = s.split(":");
533
- return [c && `≥${c}`, h && `≤${h}`].filter(Boolean).join(" ");
532
+ const [c, m] = i.split(":");
533
+ return [c && `≥${c}`, m && `≤${m}`].filter(Boolean).join(" ");
534
534
  }
535
- return o(s);
535
+ return o(i);
536
536
  }
537
- function cr({
537
+ function or({
538
538
  columns: r,
539
- rows: s,
539
+ rows: i,
540
540
  rowKey: o,
541
541
  total: c,
542
- page: h,
543
- limit: l = 25,
544
- isLoading: p,
545
- isError: y,
546
- errorMessage: g,
542
+ page: m,
543
+ limit: n = 25,
544
+ isLoading: b,
545
+ isError: g,
546
+ errorMessage: k,
547
547
  onRetry: v,
548
548
  sort: u = "",
549
- onSortChange: b,
550
- onPageChange: N,
549
+ onSortChange: p,
550
+ onPageChange: _,
551
551
  onRowClick: a,
552
- onRowContextMenu: z,
553
- searchValue: w,
554
- onSearchChange: Y,
555
- searchPlaceholder: P = "Search…",
552
+ onRowContextMenu: S,
553
+ searchValue: O,
554
+ onSearchChange: I,
555
+ searchPlaceholder: ee = "Search…",
556
556
  filterDefs: E,
557
557
  filterValues: x = {},
558
- onFilterChange: C,
559
- toolbarRight: M,
560
- emptyMessage: V = "No records found.",
561
- minBodyHeight: U,
562
- fillHeight: ce = !1,
563
- footer: Re,
564
- hideFilterRow: He = !1,
565
- nowrapCells: Xe = !1,
566
- density: oe = "comfortable",
567
- pinFirstColumn: L = !1,
568
- columnPins: f,
569
- onColumnPinChange: pe,
570
- columnFilterRow: Qe = !1,
571
- hScrollProxy: _e = !1,
572
- selectedIds: j,
573
- onSelectionChange: T,
574
- rowClassName: be,
575
- rowDragProps: he,
576
- rowTitle: me,
577
- enterKey: Ye,
578
- rowGroups: A,
579
- collapsedGroups: D,
580
- onToggleGroup: ue,
581
- onRowFocus: J,
582
- activeRowKey: G,
583
- rowAriaLabel: xe
558
+ onFilterChange: T,
559
+ toolbarRight: C,
560
+ emptyMessage: W = "No records found.",
561
+ minBodyHeight: D,
562
+ fillHeight: pe = !1,
563
+ footer: Xe,
564
+ hideFilterRow: Qe = !1,
565
+ nowrapCells: Ye = !1,
566
+ density: he = "comfortable",
567
+ pinFirstColumn: j = !1,
568
+ columnPins: y,
569
+ onColumnPinChange: me,
570
+ columnFilterRow: Ze = !1,
571
+ hScrollProxy: $e = !1,
572
+ selectedIds: A,
573
+ onSelectionChange: M,
574
+ rowClassName: ue,
575
+ rowDragProps: xe,
576
+ rowTitle: fe,
577
+ enterKey: Ie,
578
+ rowGroups: V,
579
+ collapsedGroups: J,
580
+ onToggleGroup: ye,
581
+ onRowFocus: H,
582
+ activeRowKey: te,
583
+ rowAriaLabel: ge,
584
+ totalsRow: R
584
585
  }) {
585
- const ee = Math.ceil(c / l), Ze = (h - 1) * l + 1, Ie = Math.min(h * l, c), Oe = !He && E && E.length > 0, Ke = w !== void 0 || Oe || M !== void 0, Se = (e) => {
586
- !e.sortable || !b || b(Lt(u, e.key));
587
- }, S = f !== void 0, W = Ve(() => {
588
- if (!S || !f) return r;
589
- const e = r.filter((O) => f[O.key] === "left"), n = r.filter((O) => f[O.key] === "right"), d = r.filter((O) => !f[O.key]);
590
- return [...e, ...d, ...n];
591
- }, [r, f, S]), $e = ae({}), Z = ae(null), ze = ae(null), Ce = !p && (A ? A.length === 0 : s.length === 0), [Te, Pe] = $(null);
592
- K(() => {
593
- const e = Z.current;
594
- if (!Ce || !e) return;
595
- const n = () => Pe(e.clientWidth);
596
- if (n(), typeof ResizeObserver > "u") return;
597
- const d = new ResizeObserver(n);
598
- return d.observe(e), () => d.disconnect();
599
- }, [Ce]);
600
- const [Ee, Ge] = $({}), [, et] = $(0);
601
- K(() => {
602
- const e = Z.current;
603
- if (!S || !e || typeof ResizeObserver > "u") return;
604
- const n = new ResizeObserver(() => et(e.clientWidth));
605
- return n.observe(e), () => n.disconnect();
606
- }, [S, p]), ht(() => {
607
- var R, je;
608
- if (!S || !f) return;
609
- const e = (_) => {
610
- var B;
611
- return ((B = $e.current[_]) == null ? void 0 : B.getBoundingClientRect().width) ?? 120;
612
- }, n = T ? ((R = ze.current) == null ? void 0 : R.getBoundingClientRect().width) ?? 40 : 0, { left: d, right: O } = vt(
613
- W.filter((_) => f[_.key] === "left").map((_) => _.key),
614
- W.filter((_) => f[_.key] === "right").map((_) => _.key),
586
+ const re = Math.ceil(c / n), Re = (m - 1) * n + 1, Ke = Math.min(m * n, c), ze = !Qe && E && E.length > 0, Pe = O !== void 0 || ze || C !== void 0, Se = (e) => {
587
+ !e.sortable || !p || p(Wt(u, e.key));
588
+ }, N = y !== void 0, q = Ve(() => {
589
+ if (!N || !y) return r;
590
+ const e = r.filter((w) => y[w.key] === "left"), l = r.filter((w) => y[w.key] === "right"), s = r.filter((w) => !y[w.key]);
591
+ return [...e, ...s, ...l];
592
+ }, [r, y, N]), Me = se({}), K = se(null), Te = se(null), Ee = !b && (V ? V.length === 0 : i.length === 0), [Ce, Ge] = z(null);
593
+ G(() => {
594
+ const e = K.current;
595
+ if (!Ee || !e) return;
596
+ const l = () => Ge(e.clientWidth);
597
+ if (l(), typeof ResizeObserver > "u") return;
598
+ const s = new ResizeObserver(l);
599
+ return s.observe(e), () => s.disconnect();
600
+ }, [Ee]);
601
+ const [P, et] = z({}), [, tt] = z(0);
602
+ G(() => {
603
+ const e = K.current;
604
+ if (!N || !e || typeof ResizeObserver > "u") return;
605
+ const l = new ResizeObserver(() => tt(e.clientWidth));
606
+ return l.observe(e), () => l.disconnect();
607
+ }, [N, b]), mt(() => {
608
+ var X, Ae;
609
+ if (!N || !y) return;
610
+ const e = ($) => {
611
+ var U;
612
+ return ((U = Me.current[$]) == null ? void 0 : U.getBoundingClientRect().width) ?? 120;
613
+ }, l = M ? ((X = Te.current) == null ? void 0 : X.getBoundingClientRect().width) ?? 40 : 0, { left: s, right: w } = vt(
614
+ q.filter(($) => y[$.key] === "left").map(($) => $.key),
615
+ q.filter(($) => y[$.key] === "right").map(($) => $.key),
615
616
  e,
616
- n,
617
- ((je = Z.current) == null ? void 0 : je.clientWidth) ?? 0
618
- ), q = {};
619
- let I = n;
620
- d.forEach((_, B) => {
621
- q[_] = { side: "left", offset: Math.floor(I), seam: B === d.length - 1 }, I += e(_);
617
+ l,
618
+ ((Ae = K.current) == null ? void 0 : Ae.clientWidth) ?? 0
619
+ ), L = {};
620
+ let F = l;
621
+ s.forEach(($, U) => {
622
+ L[$] = { side: "left", offset: Math.floor(F), seam: U === s.length - 1 }, F += e($);
622
623
  });
623
- let k = 0;
624
- for (let _ = O.length - 1; _ >= 0; _--) {
625
- const B = O[_];
626
- q[B] = { side: "right", offset: Math.floor(k), seam: _ === 0 }, k += e(B);
624
+ let f = 0;
625
+ for (let $ = w.length - 1; $ >= 0; $--) {
626
+ const U = w[$];
627
+ L[U] = { side: "right", offset: Math.floor(f), seam: $ === 0 }, f += e(U);
627
628
  }
628
- Ge((_) => JSON.stringify(_) === JSON.stringify(q) ? _ : q);
629
+ et(($) => JSON.stringify($) === JSON.stringify(L) ? $ : L);
629
630
  });
630
- const fe = (e) => {
631
- const n = Ee[e];
632
- if (!(!S || !n))
633
- return n.side === "left" ? { left: n.offset } : { right: n.offset };
634
- }, ye = (e, n) => {
635
- const d = Ee[e];
636
- if (!(!S || !d))
637
- return m(
631
+ const ae = (e) => {
632
+ const l = P[e];
633
+ if (!(!N || !l))
634
+ return l.side === "left" ? { left: l.offset } : { right: l.offset };
635
+ }, ke = (e, l) => {
636
+ const s = P[e];
637
+ if (!(!N || !s))
638
+ return h(
638
639
  // dt-pinned: pinned headers offset via inline style (not left-0), so the
639
640
  // fillHeight wrapper's z variants need a CLASS to elevate them above the
640
641
  // other header cells — same-z siblings paint in DOM order and a later
641
642
  // header scrolls OVER the pinned one otherwise.
642
- n ? "dt-pinned sticky z-[2]" : "sticky z-[1] bg-inherit",
643
- d.side === "left" && d.seam && "border-r border-slate-200 dark:border-border",
644
- d.side === "right" && d.seam && "border-l border-slate-200 dark:border-border"
643
+ l ? "dt-pinned sticky z-[2]" : "sticky z-[1] bg-inherit",
644
+ s.side === "left" && s.seam && "border-r border-slate-200 dark:border-border",
645
+ s.side === "right" && s.seam && "border-l border-slate-200 dark:border-border"
645
646
  );
646
- }, tt = (e) => {
647
- if (!pe) return;
648
- const n = (f == null ? void 0 : f[e]) ?? null;
649
- pe(e, n === null ? "left" : n === "left" ? "right" : null);
650
- }, rt = Ve(() => {
647
+ }, rt = (e) => {
648
+ if (!me) return;
649
+ const l = (y == null ? void 0 : y[e]) ?? null;
650
+ me(e, l === null ? "left" : l === "left" ? "right" : null);
651
+ }, at = Ve(() => {
651
652
  const e = /* @__PURE__ */ new Map();
652
- for (const n of E ?? []) e.set(n.key, n);
653
+ for (const l of E ?? []) e.set(l.key, l);
653
654
  return e;
654
- }, [E]), at = Qe && ((E == null ? void 0 : E.length) ?? 0) > 0, lt = (() => {
655
- if (!J) return null;
656
- const e = A ? A.flatMap((d) => D != null && D.has(d.key) ? [] : d.rows) : s, n = (d, O) => o ? o(d, O) : String(O);
657
- return G && e.some((d, O) => n(d, O) === G) ? G : e.length > 0 ? n(e[0], 0) : null;
658
- })(), Me = (e, n) => {
659
- const d = o ? o(e, n) : String(n), O = (j == null ? void 0 : j.includes(d)) ?? !1, q = !!J, I = q && d === lt;
660
- return /* @__PURE__ */ i(
661
- H,
655
+ }, [E]), lt = Ze && ((E == null ? void 0 : E.length) ?? 0) > 0, nt = (() => {
656
+ if (!H) return null;
657
+ const e = V ? V.flatMap((s) => J != null && J.has(s.key) ? [] : s.rows) : i, l = (s, w) => o ? o(s, w) : String(w);
658
+ return te && e.some((s, w) => l(s, w) === te) ? te : e.length > 0 ? l(e[0], 0) : null;
659
+ })(), je = (e, l) => {
660
+ const s = o ? o(e, l) : String(l), w = (A == null ? void 0 : A.includes(s)) ?? !1, L = !!H, F = L && s === nt;
661
+ return /* @__PURE__ */ d(
662
+ Q,
662
663
  {
663
- ...he == null ? void 0 : he(e),
664
- className: m(
664
+ ...xe == null ? void 0 : xe(e),
665
+ className: h(
665
666
  // NAMED group: queue cells already use bare `group-hover:` against
666
667
  // their own local group, and claiming the unnamed one here would
667
668
  // make those reveal on row hover instead.
668
669
  "group/row nvr-row-enter border-slate-100 transition-colors duration-150",
669
- J && "focus-visible:outline focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-nvr-cyan",
670
- (L || S) && "bg-white dark:bg-card",
671
- a && (L || S ? "cursor-pointer hover:bg-slate-50 dark:hover:bg-muted" : "cursor-pointer hover:bg-slate-50/80"),
672
- be == null ? void 0 : be(e),
670
+ H && "focus-visible:outline focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-nvr-cyan",
671
+ (j || N) && "bg-white dark:bg-card",
672
+ a && (j || N ? "cursor-pointer hover:bg-slate-50 dark:hover:bg-muted" : "cursor-pointer hover:bg-slate-50/80"),
673
+ ue == null ? void 0 : ue(e),
673
674
  // Pinned sticky cells use bg-inherit, so a selected row's bg must be
674
675
  // OPAQUE or horizontally-scrolled content bleeds through the pinned
675
676
  // column. bg-nvr-cyan/5 is semi-transparent — use an opaque equivalent
676
677
  // (5% nvr-cyan #00ceff over white / card) when pinning.
677
- O && (L || S ? "bg-[#f2fdff] dark:bg-[#20303a]" : "bg-nvr-cyan/5")
678
+ w && (j || N ? "bg-[#f2fdff] dark:bg-[#20303a]" : "bg-nvr-cyan/5")
678
679
  ),
679
- style: { animationDelay: `${Math.min(n, 14) * 16}ms` },
680
- "data-row-key": d,
681
- title: me == null ? void 0 : me(e),
680
+ style: { animationDelay: `${Math.min(l, 14) * 16}ms` },
681
+ "data-row-key": s,
682
+ title: fe == null ? void 0 : fe(e),
682
683
  onClick: () => a == null ? void 0 : a(e),
683
- onContextMenu: z ? (k) => z(e, k) : void 0,
684
- ...q ? {
685
- tabIndex: I ? 0 : -1,
686
- "aria-current": I && G === d ? "true" : void 0,
687
- "aria-label": xe == null ? void 0 : xe(e),
688
- onFocus: (k) => {
689
- k.target === k.currentTarget && (J == null || J(e));
684
+ onContextMenu: S ? (f) => S(e, f) : void 0,
685
+ ...L ? {
686
+ tabIndex: F ? 0 : -1,
687
+ "aria-current": F && te === s ? "true" : void 0,
688
+ "aria-label": ge == null ? void 0 : ge(e),
689
+ onFocus: (f) => {
690
+ f.target === f.currentTarget && (H == null || H(e));
690
691
  },
691
- onKeyDown: (k) => {
692
- k.key !== "Enter" || k.target !== k.currentTarget || !a || (k.preventDefault(), a(e));
692
+ onKeyDown: (f) => {
693
+ f.key !== "Enter" || f.target !== f.currentTarget || !a || (f.preventDefault(), a(e));
693
694
  }
694
695
  } : {},
695
696
  children: [
696
- T && /* @__PURE__ */ t(
697
- re,
697
+ M && /* @__PURE__ */ t(
698
+ ne,
698
699
  {
699
- className: m(
700
+ className: h(
700
701
  "w-9 px-3",
701
- oe === "compact" ? "py-1" : "py-2",
702
- (L || S) && "sticky left-0 z-[1] min-w-[40px] bg-inherit"
702
+ he === "compact" ? "py-1" : "py-2",
703
+ (j || N) && "sticky left-0 z-[1] min-w-[40px] bg-inherit"
703
704
  ),
704
- onClick: (k) => {
705
- k.stopPropagation(), T(O ? (j == null ? void 0 : j.filter((R) => R !== d)) ?? [] : [...j ?? [], d]);
705
+ onClick: (f) => {
706
+ f.stopPropagation(), M(w ? (A == null ? void 0 : A.filter((X) => X !== s)) ?? [] : [...A ?? [], s]);
706
707
  },
707
- children: /* @__PURE__ */ t(Fe, { checked: O, "aria-label": "Select row" })
708
+ children: /* @__PURE__ */ t(qe, { checked: w, "aria-label": "Select row" })
708
709
  }
709
710
  ),
710
- W.map((k, R) => /* @__PURE__ */ t(
711
- re,
711
+ q.map((f, X) => /* @__PURE__ */ t(
712
+ ne,
712
713
  {
713
- style: fe(k.key),
714
- className: m(
714
+ style: ae(f.key),
715
+ className: h(
715
716
  "px-3",
716
- oe === "compact" ? "py-1" : "py-2",
717
- Xe && "whitespace-nowrap",
718
- !S && L && R === 0 && m(
717
+ he === "compact" ? "py-1" : "py-2",
718
+ Ye && "whitespace-nowrap",
719
+ !N && j && X === 0 && h(
719
720
  "sticky z-[1] border-r border-slate-100 bg-inherit dark:border-border",
720
- T ? "left-[39px]" : "left-0"
721
+ M ? "left-[39px]" : "left-0"
721
722
  ),
722
- ye(k.key, !1),
723
- k.className
723
+ ke(f.key, !1),
724
+ f.className
724
725
  ),
725
- children: k.render ? k.render(e, n) : String(e[k.key] ?? "—")
726
+ children: f.render ? f.render(e, l) : String(e[f.key] ?? "—")
726
727
  },
727
- k.key
728
+ f.key
728
729
  ))
729
730
  ]
730
731
  },
731
- d
732
+ s
732
733
  );
733
734
  };
734
- return /* @__PURE__ */ i(Q, { children: [
735
- /* @__PURE__ */ t(kt, {}),
736
- y && g && /* @__PURE__ */ i(
735
+ return /* @__PURE__ */ d(Z, { children: [
736
+ /* @__PURE__ */ t(Nt, {}),
737
+ g && k && /* @__PURE__ */ d(
737
738
  "div",
738
739
  {
739
740
  role: "alert",
740
741
  className: "mb-4 flex flex-wrap items-center gap-x-3 gap-y-1 rounded-md border border-red-200 bg-red-50 px-4 py-2.5 text-[13px] text-red-700 dark:border-red-500/30 dark:bg-red-500/10 dark:text-red-300",
741
742
  children: [
742
- /* @__PURE__ */ i("span", { children: [
743
- g,
744
- s.length > 0 && " Showing the last list that loaded."
743
+ /* @__PURE__ */ d("span", { children: [
744
+ k,
745
+ i.length > 0 && " Showing the last list that loaded."
745
746
  ] }),
746
747
  v && /* @__PURE__ */ t(
747
748
  "button",
@@ -755,40 +756,40 @@ function cr({
755
756
  ]
756
757
  }
757
758
  ),
758
- /* @__PURE__ */ i(
759
+ /* @__PURE__ */ d(
759
760
  "div",
760
761
  {
761
- className: m(
762
+ className: h(
762
763
  "overflow-hidden rounded-lg border border-slate-200 bg-white",
763
- ce && "flex h-full min-h-0 flex-col"
764
+ pe && "flex h-full min-h-0 flex-col"
764
765
  ),
765
766
  children: [
766
- Ke && /* @__PURE__ */ i("div", { className: "flex flex-wrap items-center gap-2 border-b border-slate-100 px-3 py-2.5", children: [
767
- Y !== void 0 && /* @__PURE__ */ i("div", { className: "relative min-w-0 max-w-full", children: [
768
- /* @__PURE__ */ t(nt, { className: "absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400" }),
767
+ Pe && /* @__PURE__ */ d("div", { className: "flex flex-wrap items-center gap-2 border-b border-slate-100 px-3 py-2.5", children: [
768
+ I !== void 0 && /* @__PURE__ */ d("div", { className: "relative min-w-0 max-w-full", children: [
769
+ /* @__PURE__ */ t(st, { className: "absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400" }),
769
770
  /* @__PURE__ */ t(
770
- F,
771
+ B,
771
772
  {
772
773
  className: "h-8 w-56 max-w-full border-slate-200 bg-slate-50 pl-8 text-[13px]",
773
- placeholder: P,
774
- value: w ?? "",
775
- onChange: (e) => Y(e.target.value)
774
+ placeholder: ee,
775
+ value: O ?? "",
776
+ onChange: (e) => I(e.target.value)
776
777
  }
777
778
  )
778
779
  ] }),
779
- Oe && (E == null ? void 0 : E.map((e) => /* @__PURE__ */ t(
780
- Je,
780
+ ze && (E == null ? void 0 : E.map((e) => /* @__PURE__ */ t(
781
+ He,
781
782
  {
782
783
  def: e,
783
784
  value: x[e.key] ?? "",
784
- onChange: (n) => C == null ? void 0 : C(e.key, n)
785
+ onChange: (l) => T == null ? void 0 : T(e.key, l)
785
786
  },
786
787
  e.key
787
788
  ))),
788
789
  /* @__PURE__ */ t("div", { className: "flex-1" }),
789
- M
790
+ C
790
791
  ] }),
791
- p ? (
792
+ b ? (
792
793
  // #3229 — the real header (same labels, h-9) over rows with the real cell padding
793
794
  // and line height for this density, in the body's real minimum height: the table
794
795
  // keeps its shape when the rows land.
@@ -797,15 +798,15 @@ function cr({
797
798
  {
798
799
  "data-skeleton": "table",
799
800
  "aria-busy": "true",
800
- className: m(ce && "min-h-0 flex-1 overflow-hidden"),
801
- style: U ? { minHeight: U } : void 0,
802
- children: /* @__PURE__ */ i(qe, { className: "border-separate border-spacing-0", children: [
803
- /* @__PURE__ */ t(Be, { children: /* @__PURE__ */ i(H, { className: "border-b border-slate-200 hover:bg-transparent", children: [
804
- T && /* @__PURE__ */ t(X, { className: "h-9 w-9 border-b border-slate-200 bg-slate-50 px-3 py-0 dark:border-border dark:bg-muted" }),
805
- W.map((e) => /* @__PURE__ */ t(
806
- X,
801
+ className: h(pe && "min-h-0 flex-1 overflow-hidden"),
802
+ style: D ? { minHeight: D } : void 0,
803
+ children: /* @__PURE__ */ d(Be, { className: "border-separate border-spacing-0", children: [
804
+ /* @__PURE__ */ t(Ue, { children: /* @__PURE__ */ d(Q, { className: "border-b border-slate-200 hover:bg-transparent", children: [
805
+ M && /* @__PURE__ */ t(Y, { className: "h-9 w-9 border-b border-slate-200 bg-slate-50 px-3 py-0 dark:border-border dark:bg-muted" }),
806
+ q.map((e) => /* @__PURE__ */ t(
807
+ Y,
807
808
  {
808
- className: m(
809
+ className: h(
809
810
  "h-9 whitespace-nowrap border-b border-slate-200 bg-slate-50 px-3 py-0 text-[11px] font-medium text-slate-500 dark:border-border dark:bg-muted",
810
811
  e.headerClassName
811
812
  ),
@@ -814,59 +815,59 @@ function cr({
814
815
  e.key
815
816
  ))
816
817
  ] }) }),
817
- /* @__PURE__ */ t(Ue, { children: /* @__PURE__ */ t(
818
- _t,
818
+ /* @__PURE__ */ t(De, { children: /* @__PURE__ */ t(
819
+ Ot,
819
820
  {
820
- columns: W.map((e) => ({ key: e.key })),
821
- rows: Math.min(Math.max(l ?? Vt.length, 1), 15),
821
+ columns: q.map((e) => ({ key: e.key })),
822
+ rows: Math.min(Math.max(n ?? Vt.length, 1), 15),
822
823
  rowClassName: "",
823
- cellClassName: m("px-3", oe === "compact" ? "py-1" : "py-2"),
824
- leadingCells: T ? 1 : 0
824
+ cellClassName: h("px-3", he === "compact" ? "py-1" : "py-2"),
825
+ leadingCells: M ? 1 : 0
825
826
  }
826
827
  ) })
827
828
  ] })
828
829
  }
829
830
  )
830
- ) : /* @__PURE__ */ i(Q, { children: [
831
+ ) : /* @__PURE__ */ d(Z, { children: [
831
832
  /* @__PURE__ */ t(
832
833
  "div",
833
834
  {
834
- ref: Z,
835
- className: m(
836
- _e && "overflow-x-hidden [&>div]:overflow-visible",
835
+ ref: K,
836
+ className: h(
837
+ $e && "overflow-x-hidden [&>div]:overflow-visible",
837
838
  // Bounded mode: rows scroll here under a sticky header. Header
838
839
  // cells sit above pinned body cells (z-[1/2]); the pinned
839
840
  // header corner (left-0) tops the other header cells so
840
841
  // horizontal scroll cannot bleed through it.
841
- ce && "min-h-0 flex-1 overflow-y-auto [&_thead_th]:sticky [&_thead_th]:top-0 [&_thead_th]:z-[5] [&_thead_th.left-0]:z-[6] [&_thead_th.dt-pinned]:z-[6]"
842
+ pe && "min-h-0 flex-1 overflow-y-auto [&_thead_th]:sticky [&_thead_th]:top-0 [&_thead_th]:z-[5] [&_thead_th.left-0]:z-[6] [&_thead_th.dt-pinned]:z-[6]"
842
843
  ),
843
- style: U ? { minHeight: U } : void 0,
844
- children: /* @__PURE__ */ i(
845
- qe,
844
+ style: D ? { minHeight: D } : void 0,
845
+ children: /* @__PURE__ */ d(
846
+ Be,
846
847
  {
847
848
  "data-copy-cells": "",
848
849
  className: "border-separate border-spacing-0 [&>tbody>tr.border-b:not(:last-child)>td]:border-b [&>tbody>tr.border-b:not(:last-child)>td]:[border-bottom-color:inherit] [&>thead>tr.border-b>th]:border-b [&>thead>tr.border-b>th]:[border-bottom-color:inherit]",
849
850
  children: [
850
- /* @__PURE__ */ i(Be, { children: [
851
- /* @__PURE__ */ i(H, { className: "border-b border-slate-200 hover:bg-transparent", children: [
852
- T && /* @__PURE__ */ t(
853
- X,
851
+ /* @__PURE__ */ d(Ue, { children: [
852
+ /* @__PURE__ */ d(Q, { className: "border-b border-slate-200 hover:bg-transparent", children: [
853
+ M && /* @__PURE__ */ t(
854
+ Y,
854
855
  {
855
- ref: ze,
856
- className: m(
856
+ ref: Te,
857
+ className: h(
857
858
  "h-9 w-9 bg-slate-50 px-3 py-0",
858
- (L || S) && "sticky left-0 z-[2] min-w-[40px]"
859
+ (j || N) && "sticky left-0 z-[2] min-w-[40px]"
859
860
  ),
860
861
  children: /* @__PURE__ */ t(
861
- Fe,
862
+ qe,
862
863
  {
863
- checked: s.length > 0 && s.every((e, n) => {
864
- const d = o ? o(e, n) : String(n);
865
- return j == null ? void 0 : j.includes(d);
864
+ checked: i.length > 0 && i.every((e, l) => {
865
+ const s = o ? o(e, l) : String(l);
866
+ return A == null ? void 0 : A.includes(s);
866
867
  }),
867
868
  onCheckedChange: (e) => {
868
- T(
869
- e ? s.map((n, d) => o ? o(n, d) : String(d)) : []
869
+ M(
870
+ e ? i.map((l, s) => o ? o(l, s) : String(s)) : []
870
871
  );
871
872
  },
872
873
  "aria-label": "Select all"
@@ -874,32 +875,32 @@ function cr({
874
875
  )
875
876
  }
876
877
  ),
877
- W.map((e, n) => /* @__PURE__ */ t(
878
- X,
878
+ q.map((e, l) => /* @__PURE__ */ t(
879
+ Y,
879
880
  {
880
- ref: (d) => {
881
- $e.current[e.key] = d;
881
+ ref: (s) => {
882
+ Me.current[e.key] = s;
882
883
  },
883
- style: fe(e.key),
884
- className: m(
885
- "group/th h-9 whitespace-nowrap bg-slate-50 px-3 py-0 text-[11px] font-medium text-slate-500",
886
- e.sortable && b && "cursor-pointer select-none hover:text-slate-600",
887
- !S && L && n === 0 && m(
884
+ style: ae(e.key),
885
+ className: h(
886
+ "group/th group/hcell h-9 whitespace-nowrap bg-slate-50 px-3 py-0 text-[11px] font-medium text-slate-500",
887
+ e.sortable && p && "cursor-pointer select-none hover:text-slate-600",
888
+ !N && j && l === 0 && h(
888
889
  "sticky z-[2] border-r border-slate-200 dark:border-border",
889
- T ? "left-[39px]" : "left-0"
890
+ M ? "left-[39px]" : "left-0"
890
891
  ),
891
- S && "bg-slate-50 dark:bg-muted",
892
- ye(e.key, !0),
892
+ N && "bg-slate-50 dark:bg-muted",
893
+ ke(e.key, !0),
893
894
  e.headerClassName
894
895
  ),
895
896
  onClick: () => Se(e),
896
- "aria-sort": e.sortable && b ? Wt(u, e.key) : void 0,
897
- tabIndex: e.sortable && b && !ve(e.header) ? 0 : void 0,
898
- onKeyDown: e.sortable && b && !ve(e.header) ? (d) => {
899
- d.target === d.currentTarget && (d.key === "Enter" || d.key === " ") && (d.preventDefault(), Se(e));
897
+ "aria-sort": e.sortable && p ? Ft(u, e.key) : void 0,
898
+ tabIndex: e.sortable && p && !Ne(e.header) ? 0 : void 0,
899
+ onKeyDown: e.sortable && p && !Ne(e.header) ? (s) => {
900
+ s.target === s.currentTarget && (s.key === "Enter" || s.key === " ") && (s.preventDefault(), Se(e));
900
901
  } : void 0,
901
- children: /* @__PURE__ */ i("span", { className: "inline-flex items-center", children: [
902
- e.sortable && b && ve(e.header) ? /* @__PURE__ */ i(
902
+ children: /* @__PURE__ */ d("span", { className: "inline-flex items-center", children: [
903
+ e.sortable && p && Ne(e.header) ? /* @__PURE__ */ d(
903
904
  "button",
904
905
  {
905
906
  type: "button",
@@ -907,69 +908,70 @@ function cr({
907
908
  "data-dt-sort": e.key,
908
909
  children: [
909
910
  e.header,
910
- /* @__PURE__ */ t(De, { field: e.key, sort: u })
911
+ /* @__PURE__ */ t(Je, { field: e.key, sort: u })
911
912
  ]
912
913
  }
913
- ) : /* @__PURE__ */ i(Q, { children: [
914
+ ) : /* @__PURE__ */ d(Z, { children: [
914
915
  e.header,
915
- e.sortable && b && /* @__PURE__ */ t(De, { field: e.key, sort: u })
916
+ e.sortable && p && /* @__PURE__ */ t(Je, { field: e.key, sort: u })
916
917
  ] }),
917
- S && pe && e.key !== "claim" && /* @__PURE__ */ t(
918
+ N && me && e.key !== "claim" && /* @__PURE__ */ t(
918
919
  "button",
919
920
  {
920
921
  type: "button",
921
- onClick: (d) => {
922
- d.stopPropagation(), tt(e.key);
922
+ onClick: (s) => {
923
+ s.stopPropagation(), rt(e.key);
923
924
  },
924
- "aria-label": `Pin column ${At(e)}`,
925
- title: (f == null ? void 0 : f[e.key]) === "left" ? "Pinned left — click to pin right" : (f == null ? void 0 : f[e.key]) === "right" ? "Pinned right — click to unpin" : "Pin column",
926
- className: m(
925
+ "aria-label": `Pin column ${Lt(e)}`,
926
+ title: (y == null ? void 0 : y[e.key]) === "left" ? "Pinned left — click to pin right" : (y == null ? void 0 : y[e.key]) === "right" ? "Pinned right — click to unpin" : "Pin column",
927
+ className: h(
927
928
  "ml-1 rounded p-0.5 transition-opacity",
928
- f != null && f[e.key] ? "text-nvr-cyan opacity-100" : "text-slate-300 opacity-0 hover:text-slate-500 group-hover/th:opacity-100"
929
+ y != null && y[e.key] ? "text-nvr-cyan opacity-100" : "text-slate-300 opacity-0 hover:text-slate-500 group-hover/th:opacity-100"
929
930
  ),
930
931
  children: /* @__PURE__ */ t(
931
- st,
932
+ it,
932
933
  {
933
- className: m(
934
+ className: h(
934
935
  "h-3 w-3",
935
- (f == null ? void 0 : f[e.key]) === "right" && "rotate-90"
936
+ (y == null ? void 0 : y[e.key]) === "right" && "rotate-90"
936
937
  )
937
938
  }
938
939
  )
939
940
  }
940
- )
941
+ ),
942
+ e.headerMenu
941
943
  ] })
942
944
  },
943
945
  e.key
944
946
  ))
945
947
  ] }),
946
- at && /* @__PURE__ */ i(H, { className: "border-b border-slate-200 hover:bg-transparent", children: [
947
- T && /* @__PURE__ */ t(
948
- X,
948
+ lt && /* @__PURE__ */ d(Q, { className: "border-b border-slate-200 hover:bg-transparent", children: [
949
+ M && /* @__PURE__ */ t(
950
+ Y,
949
951
  {
950
- className: m(
952
+ className: h(
951
953
  "h-9 w-9 bg-slate-50 px-3 py-1",
952
- (L || S) && "sticky left-0 z-[2] min-w-[40px]"
954
+ (j || N) && "sticky left-0 z-[2] min-w-[40px]"
953
955
  )
954
956
  }
955
957
  ),
956
- W.map((e) => {
957
- const n = rt.get(e.key);
958
+ q.map((e) => {
959
+ const l = at.get(e.key);
958
960
  return /* @__PURE__ */ t(
959
- X,
961
+ Y,
960
962
  {
961
- style: fe(e.key),
962
- className: m(
963
+ style: ae(e.key),
964
+ className: h(
963
965
  "h-9 bg-slate-50 px-1.5 py-1 align-middle",
964
- S && "bg-slate-50 dark:bg-muted",
965
- ye(e.key, !0)
966
+ N && "bg-slate-50 dark:bg-muted",
967
+ ke(e.key, !0)
966
968
  ),
967
- children: n && C ? /* @__PURE__ */ t(
968
- Je,
969
+ children: l && T ? /* @__PURE__ */ t(
970
+ He,
969
971
  {
970
- def: n,
971
- value: x[n.key] ?? "",
972
- onChange: (d) => C(n.key, d),
972
+ def: l,
973
+ value: x[l.key] ?? "",
974
+ onChange: (s) => T(l.key, s),
973
975
  layout: "cell"
974
976
  }
975
977
  ) : null
@@ -979,27 +981,27 @@ function cr({
979
981
  })
980
982
  ] })
981
983
  ] }),
982
- /* @__PURE__ */ i(Ue, { className: "tabular-nums", children: [
983
- A ? A.map((e) => {
984
- const n = (D == null ? void 0 : D.has(e.key)) ?? !1;
985
- return /* @__PURE__ */ i(bt.Fragment, { children: [
984
+ /* @__PURE__ */ d(De, { className: "tabular-nums", children: [
985
+ V ? V.map((e) => {
986
+ const l = (J == null ? void 0 : J.has(e.key)) ?? !1;
987
+ return /* @__PURE__ */ d(ht.Fragment, { children: [
986
988
  /* @__PURE__ */ t(
987
- H,
989
+ Q,
988
990
  {
989
991
  className: "nvr-row-enter cursor-pointer border-slate-200 bg-slate-50/80 transition-colors hover:bg-slate-100/80 dark:bg-muted/40",
990
- onClick: () => ue == null ? void 0 : ue(e.key),
992
+ onClick: () => ye == null ? void 0 : ye(e.key),
991
993
  children: /* @__PURE__ */ t(
992
- re,
994
+ ne,
993
995
  {
994
- colSpan: r.length + (T ? 1 : 0),
996
+ colSpan: r.length + (M ? 1 : 0),
995
997
  className: "px-3 py-1.5",
996
- children: /* @__PURE__ */ i("span", { className: "flex items-center gap-1.5 text-[12px] font-medium text-slate-600 dark:text-foreground", children: [
998
+ children: /* @__PURE__ */ d("span", { className: "flex items-center gap-1.5 text-[12px] font-medium text-slate-600 dark:text-foreground", children: [
997
999
  /* @__PURE__ */ t(
998
- it,
1000
+ dt,
999
1001
  {
1000
- className: m(
1002
+ className: h(
1001
1003
  "h-3.5 w-3.5 text-slate-400 transition-transform duration-200",
1002
- n && "-rotate-90"
1004
+ l && "-rotate-90"
1003
1005
  )
1004
1006
  }
1005
1007
  ),
@@ -1009,92 +1011,129 @@ function cr({
1009
1011
  )
1010
1012
  }
1011
1013
  ),
1012
- !n && e.rows.map((d, O) => Me(d, O))
1014
+ !l && e.rows.map((s, w) => je(s, w))
1013
1015
  ] }, e.key);
1014
- }) : s.map((e, n) => Me(e, n)),
1015
- (A ? A.length === 0 : s.length === 0) && /* @__PURE__ */ t(H, { children: /* @__PURE__ */ t(
1016
- re,
1016
+ }) : i.map((e, l) => je(e, l)),
1017
+ (V ? V.length === 0 : i.length === 0) && /* @__PURE__ */ t(Q, { children: /* @__PURE__ */ t(
1018
+ ne,
1017
1019
  {
1018
- colSpan: r.length + (T ? 1 : 0),
1020
+ colSpan: r.length + (M ? 1 : 0),
1019
1021
  className: "nvr-fade-in p-0 text-center align-middle text-[13px] text-slate-400",
1020
- style: U ? { height: Math.max(96, U - 56) } : void 0,
1022
+ style: D ? { height: Math.max(96, D - 56) } : void 0,
1021
1023
  children: /* @__PURE__ */ t(
1022
1024
  "div",
1023
1025
  {
1024
1026
  className: "sticky left-0 py-12",
1025
- style: Te ? { width: Te } : void 0,
1027
+ style: Ce ? { width: Ce } : void 0,
1026
1028
  "data-table-empty": !0,
1027
- children: typeof V == "string" ? /* @__PURE__ */ t(Nt, { icon: dt, title: V }) : V
1029
+ children: typeof W == "string" ? /* @__PURE__ */ t(wt, { icon: ct, title: W }) : W
1028
1030
  }
1029
1031
  )
1030
1032
  }
1031
1033
  ) })
1032
- ] }, Ye)
1034
+ ] }, Ie),
1035
+ R && !V && i.length > 0 && // Sticky per cell (not per row): a pinned cell sticks left/right AND bottom.
1036
+ /* @__PURE__ */ t("tfoot", { className: "text-[12px] tabular-nums", "data-dt-totals": !0, children: /* @__PURE__ */ d("tr", { children: [
1037
+ M && /* @__PURE__ */ t(
1038
+ "td",
1039
+ {
1040
+ className: h(
1041
+ "sticky bottom-0 z-[3] border-t-2 border-slate-200 bg-slate-50 px-3 py-1.5 dark:border-border dark:bg-muted",
1042
+ (j || N) && "left-0 z-[4]"
1043
+ )
1044
+ }
1045
+ ),
1046
+ (() => {
1047
+ const e = q.findIndex(
1048
+ (l) => R.cells[l.key] == null
1049
+ );
1050
+ return q.map((l, s) => {
1051
+ var F, f;
1052
+ const w = N && !!P[l.key], L = R.cells[l.key];
1053
+ return /* @__PURE__ */ t(
1054
+ "td",
1055
+ {
1056
+ style: ae(l.key),
1057
+ "data-dt-total-cell": L != null ? l.key : void 0,
1058
+ className: h(
1059
+ "sticky bottom-0 z-[3] whitespace-nowrap border-t-2 border-slate-200 bg-slate-50 px-3 py-1.5 font-medium dark:border-border dark:bg-muted",
1060
+ w && "z-[4]",
1061
+ w && ((F = P[l.key]) == null ? void 0 : F.seam) && (((f = P[l.key]) == null ? void 0 : f.side) === "left" ? "border-r" : "border-l"),
1062
+ !N && j && s === 0 && "z-[4]",
1063
+ !N && j && s === 0 && (M ? "left-[39px]" : "left-0")
1064
+ ),
1065
+ children: L ?? (s === e && R.label != null ? R.label : null)
1066
+ },
1067
+ l.key
1068
+ );
1069
+ });
1070
+ })()
1071
+ ] }) })
1033
1072
  ]
1034
1073
  }
1035
1074
  )
1036
1075
  }
1037
1076
  ),
1038
- _e && /* @__PURE__ */ t(wt, { scrollerRef: Z }),
1039
- Re,
1040
- !A && c > l && /* @__PURE__ */ i("div", { className: "flex items-center justify-between border-t border-slate-100 px-4 py-2.5", children: [
1041
- /* @__PURE__ */ i("p", { className: "text-[12px] text-slate-400", children: [
1042
- ge(Ze),
1077
+ $e && /* @__PURE__ */ t(_t, { scrollerRef: K }),
1078
+ Xe,
1079
+ !V && c > n && /* @__PURE__ */ d("div", { className: "flex items-center justify-between border-t border-slate-100 px-4 py-2.5", children: [
1080
+ /* @__PURE__ */ d("p", { className: "text-[12px] text-slate-400", children: [
1081
+ ve(Re),
1043
1082
  "–",
1044
- ge(Ie),
1083
+ ve(Ke),
1045
1084
  " of ",
1046
- ge(c),
1085
+ ve(c),
1047
1086
  " records"
1048
1087
  ] }),
1049
- /* @__PURE__ */ i("div", { className: "flex items-center gap-1", children: [
1088
+ /* @__PURE__ */ d("div", { className: "flex items-center gap-1", children: [
1050
1089
  /* @__PURE__ */ t(
1051
- te,
1090
+ le,
1052
1091
  {
1053
1092
  variant: "ghost",
1054
1093
  size: "sm",
1055
1094
  className: "h-7 px-2 text-[12px] text-slate-600",
1056
- disabled: h <= 1,
1057
- onClick: () => N(1),
1095
+ disabled: m <= 1,
1096
+ onClick: () => _(1),
1058
1097
  "aria-label": "First page",
1059
1098
  "data-tip": "First page",
1060
1099
  children: "«"
1061
1100
  }
1062
1101
  ),
1063
1102
  /* @__PURE__ */ t(
1064
- te,
1103
+ le,
1065
1104
  {
1066
1105
  variant: "ghost",
1067
1106
  size: "sm",
1068
1107
  className: "h-7 px-2.5 text-[12px] text-slate-600",
1069
- disabled: h <= 1,
1070
- onClick: () => N(h - 1),
1108
+ disabled: m <= 1,
1109
+ onClick: () => _(m - 1),
1071
1110
  children: "← Prev"
1072
1111
  }
1073
1112
  ),
1074
- /* @__PURE__ */ i("span", { className: "px-2 text-[12px] text-slate-400", children: [
1075
- h,
1113
+ /* @__PURE__ */ d("span", { className: "px-2 text-[12px] text-slate-400", children: [
1114
+ m,
1076
1115
  " / ",
1077
- ee
1116
+ re
1078
1117
  ] }),
1079
1118
  /* @__PURE__ */ t(
1080
- te,
1119
+ le,
1081
1120
  {
1082
1121
  variant: "ghost",
1083
1122
  size: "sm",
1084
1123
  className: "h-7 px-2.5 text-[12px] text-slate-600",
1085
- disabled: h >= ee,
1086
- onClick: () => N(h + 1),
1124
+ disabled: m >= re,
1125
+ onClick: () => _(m + 1),
1087
1126
  children: "Next →"
1088
1127
  }
1089
1128
  ),
1090
1129
  /* @__PURE__ */ t(
1091
- te,
1130
+ le,
1092
1131
  {
1093
1132
  variant: "ghost",
1094
1133
  size: "sm",
1095
1134
  className: "h-7 px-2 text-[12px] text-slate-600",
1096
- disabled: h >= ee,
1097
- onClick: () => N(ee),
1135
+ disabled: m >= re,
1136
+ onClick: () => _(re),
1098
1137
  "aria-label": "Last page",
1099
1138
  "data-tip": "Last page",
1100
1139
  children: "»"
@@ -1109,11 +1148,11 @@ function cr({
1109
1148
  ] });
1110
1149
  }
1111
1150
  export {
1112
- cr as DataTable,
1113
- Je as FilterControl,
1114
- Wt as ariaSortFor,
1115
- Ft as containsFilter,
1116
- Jt as filterDefLabel,
1117
- dr as filterValueDisplay,
1118
- At as pinColumnName
1151
+ or as DataTable,
1152
+ He as FilterControl,
1153
+ Ft as ariaSortFor,
1154
+ qt as containsFilter,
1155
+ Ht as filterDefLabel,
1156
+ cr as filterValueDisplay,
1157
+ Lt as pinColumnName
1119
1158
  };