@umriss-ui/table 0.35.0 → 0.36.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/table.js CHANGED
@@ -1,28 +1,28 @@
1
1
  "use client";
2
2
  import "./table.css";
3
- import { useState as P, useCallback as fe, useMemo as j, useRef as W, useId as be, useContext as _e, createContext as rt, useSyncExternalStore as st, useLayoutEffect as te, useEffect as xe } from "react";
4
- import { DEFAULT_FORMATS as xn, treeModel as rn, useVirtual as To, useFormats as ke, useWording as ie, Checkbox as He, DateRangePicker as Oo, FormField as vt, NumberInput as yt, separatorsOf as Eo, Tooltip as tt, Popover as it, Button as Q, TagGroup as An, Tag as Bt, Menu as Nn, MenuItem as nt, MenuSeparator as Mo, ControlSizeProvider as Rn, Select as Tn, VisuallyHidden as Oe, DatePicker as Lo, Input as On, announce as qo, usePortalTarget as Fo, IconButton as Do, AngleGlyph as Bo, useDensityFor as Vo, assess as Po, verdictWeight as _t, allBranches as Io, duplicateKey as $o } from "@umriss-ui/core";
5
- import { jsx as f, jsxs as R, Fragment as re } from "react/jsx-runtime";
3
+ import { useState as I, useCallback as fe, useMemo as H, useRef as q, useId as be, useContext as _e, createContext as rt, useSyncExternalStore as st, useLayoutEffect as Z, useEffect as xe } from "react";
4
+ import { DEFAULT_FORMATS as xn, treeModel as rn, useVirtual as Ro, useFormats as ke, useWording as ie, Checkbox as We, DateRangePicker as Oo, FormField as vt, NumberInput as yt, separatorsOf as Eo, Tooltip as tt, Popover as it, Button as Q, TagGroup as An, Tag as Vt, Menu as Nn, MenuItem as nt, MenuSeparator as Mo, ControlSizeProvider as Tn, Select as Rn, VisuallyHidden as Oe, DatePicker as Lo, Input as On, announce as Fo, usePortalTarget as Do, IconButton as Bo, AngleGlyph as Vo, useDensityFor as Po, assess as Io, verdictWeight as _t, allBranches as $o, duplicateKey as zo } from "@umriss-ui/core";
5
+ import { jsx as f, jsxs as T, Fragment as re } from "react/jsx-runtime";
6
6
  import { createPortal as En } from "react-dom";
7
- function zo(e) {
8
- const [t, n] = P(/* @__PURE__ */ new Set()), o = fe((a) => t.has(a), [t]), r = fe((a) => {
7
+ function Ko(e) {
8
+ const [t, n] = I(/* @__PURE__ */ new Set()), o = fe((a) => t.has(a), [t]), r = fe((a) => {
9
9
  n((u) => {
10
10
  const d = new Set(u);
11
11
  return d.has(a) ? d.delete(a) : d.add(a), d;
12
12
  });
13
- }, []), s = j(
13
+ }, []), s = H(
14
14
  () => e.length > 0 && e.every((a) => t.has(a)),
15
15
  [e, t]
16
- ), l = j(
16
+ ), i = H(
17
17
  () => !s && e.some((a) => t.has(a)),
18
18
  [e, t, s]
19
- ), i = fe(() => {
19
+ ), l = fe(() => {
20
20
  n((a) => {
21
21
  const u = new Set(a);
22
- return e.length > 0 && e.every((m) => u.has(m)) ? e.forEach((m) => u.delete(m)) : e.forEach((m) => u.add(m)), u;
22
+ return e.length > 0 && e.every((b) => u.has(b)) ? e.forEach((b) => u.delete(b)) : e.forEach((b) => u.add(b)), u;
23
23
  });
24
24
  }, [e]), c = fe(() => n(/* @__PURE__ */ new Set()), []);
25
- return { selected: t, isSelected: o, toggle: r, toggleAll: i, clear: c, allSelected: s, someSelected: l, count: t.size };
25
+ return { selected: t, isSelected: o, toggle: r, toggleAll: l, clear: c, allSelected: s, someSelected: i, count: t.size };
26
26
  }
27
27
  const se = (e) => e == null || typeof e == "number" && Number.isNaN(e);
28
28
  function lt(e) {
@@ -35,8 +35,8 @@ function Mn(e, t) {
35
35
  }
36
36
  return "empty";
37
37
  }
38
- const Vt = (e, t) => t ?? e === "number";
39
- function Be(e, t, n, o) {
38
+ const Pt = (e, t) => t ?? e === "number";
39
+ function Ve(e, t, n, o) {
40
40
  switch (lt(e)) {
41
41
  case "text":
42
42
  return e;
@@ -71,9 +71,9 @@ function kt(e, t) {
71
71
  }
72
72
  }
73
73
  }
74
- function Pt(e, t) {
74
+ function It(e, t) {
75
75
  if (!se(e)) {
76
- if (t) return Pt(t(e));
76
+ if (t) return It(t(e));
77
77
  switch (lt(e)) {
78
78
  case "text":
79
79
  return e;
@@ -88,15 +88,15 @@ function Pt(e, t) {
88
88
  }
89
89
  }
90
90
  }
91
- const It = "absent", Ce = (e) => se(e) ? It : e instanceof Date ? `value:${e.getTime()}` : `value:${String(e)}`, sn = (e) => e instanceof Date ? e.getTime() : typeof e == "number" && !Number.isNaN(e) ? e : void 0;
92
- function $t(e, t) {
91
+ const $t = "absent", Ce = (e) => se(e) ? $t : e instanceof Date ? `value:${e.getTime()}` : `value:${String(e)}`, sn = (e) => e instanceof Date ? e.getTime() : typeof e == "number" && !Number.isNaN(e) ? e : void 0;
92
+ function zt(e, t) {
93
93
  const n = t.map(e.read).filter((u) => !se(u) && !(u instanceof Date && Number.isNaN(u.getTime()))), o = e.aggregate;
94
94
  if (typeof o == "function") return o(n, t);
95
95
  if (o === "count") return n.length;
96
96
  if (o === "distinct") return new Set(n.map(Ce)).size;
97
97
  const r = n.filter((u) => sn(u) !== void 0);
98
98
  if (r.length === 0) return;
99
- const s = r.map((u) => sn(u)), l = r[0] instanceof Date, i = (u) => l ? new Date(u) : u;
99
+ const s = r.map((u) => sn(u)), i = r[0] instanceof Date, l = (u) => i ? new Date(u) : u;
100
100
  let c = 1 / 0, a = -1 / 0;
101
101
  for (const u of s)
102
102
  u < c && (c = u), u > a && (a = u);
@@ -106,97 +106,97 @@ function $t(e, t) {
106
106
  case "avg":
107
107
  return s.reduce((u, d) => u + d, 0) / s.length;
108
108
  case "min":
109
- return i(c);
109
+ return l(c);
110
110
  case "max":
111
- return i(a);
111
+ return l(a);
112
112
  case "range":
113
- return [i(c), i(a)];
113
+ return [l(c), l(a)];
114
114
  }
115
115
  }
116
- const zt = 3, je = (e) => {
116
+ const Kt = 3, He = (e) => {
117
117
  if (!se(e))
118
118
  return e instanceof Date ? e.getTime() : typeof e == "boolean" ? e ? 1 : 0 : typeof e == "number" ? e : String(e);
119
119
  };
120
120
  function pt(e, t, n) {
121
- const o = je(e), r = je(t);
121
+ const o = He(e), r = He(t);
122
122
  return o === void 0 || r === void 0 ? o === r ? 0 : o === void 0 ? 1 : -1 : typeof o == "number" && typeof r == "number" ? o - r : n(String(o), String(r));
123
123
  }
124
- function Ko(e, t) {
125
- const n = t.compareText ?? xn.compareText, o = (r, s, l) => {
126
- const i = /* @__PURE__ */ new Map(), c = t.levels[s];
124
+ function Go(e, t) {
125
+ const n = t.compareText ?? xn.compareText, o = (r, s, i) => {
126
+ const l = /* @__PURE__ */ new Map(), c = t.levels[s];
127
127
  if (!c) return [];
128
128
  const a = /* @__PURE__ */ new Map();
129
129
  for (const g of r) {
130
- const v = c.value(g), A = Ce(v);
131
- let y = a.get(A);
130
+ const v = c.value(g), x = Ce(v);
131
+ let y = a.get(x);
132
132
  y || (y = {
133
- path: JSON.stringify([...l, A]),
133
+ path: JSON.stringify([...i, x]),
134
134
  value: se(v) ? void 0 : v,
135
135
  level: s,
136
136
  rows: [],
137
137
  groups: [],
138
138
  aggregates: {}
139
- }, a.set(A, y), i.set(y, [...l, A])), y.rows.push(g);
139
+ }, a.set(x, y), l.set(y, [...i, x])), y.rows.push(g);
140
140
  }
141
141
  for (const g of a.values())
142
- for (const v of t.aggregates ?? []) g.aggregates[v.id] = $t(v, g.rows);
142
+ for (const v of t.aggregates ?? []) g.aggregates[v.id] = zt(v, g.rows);
143
143
  const u = t.sort?.find(
144
144
  (g) => g.column === c.id || t.aggregates?.some((v) => v.id === g.column)
145
- ), d = u?.direction === "desc" ? -1 : 1, m = u !== void 0 && u.column !== c.id ? u.column : void 0, b = (g) => {
145
+ ), d = u?.direction === "desc" ? -1 : 1, b = u !== void 0 && u.column !== c.id ? u.column : void 0, p = (g) => {
146
146
  let v;
147
- for (const A of g.rows) {
148
- const y = c.order(A);
149
- je(y) !== void 0 && (v === void 0 || pt(y, v, n) < 0) && (v = y);
147
+ for (const x of g.rows) {
148
+ const y = c.order(x);
149
+ He(y) !== void 0 && (v === void 0 || pt(y, v, n) < 0) && (v = y);
150
150
  }
151
151
  return v;
152
- }, p = (g) => {
153
- if (m === void 0) return c.order ? b(g) : g.value;
154
- const v = g.aggregates[m];
152
+ }, m = (g) => {
153
+ if (b === void 0) return c.order ? p(g) : g.value;
154
+ const v = g.aggregates[b];
155
155
  return Array.isArray(v) ? v[0] : v;
156
156
  }, w = [...a.values()].sort((g, v) => {
157
157
  if (g.value === void 0 || v.value === void 0) return pt(g.value, v.value, n);
158
- const A = p(g), y = p(v), _ = pt(A, y, n);
159
- return je(A) === void 0 || je(y) === void 0 ? _ : _ * d;
158
+ const x = m(g), y = m(v), _ = pt(x, y, n);
159
+ return He(x) === void 0 || He(y) === void 0 ? _ : _ * d;
160
160
  });
161
161
  for (const g of w)
162
- g.groups = o(g.rows, s + 1, i.get(g));
162
+ g.groups = o(g.rows, s + 1, l.get(g));
163
163
  return w;
164
164
  };
165
165
  return o(e, 0, []);
166
166
  }
167
- function Go(e, t) {
167
+ function jo(e, t) {
168
168
  const n = /* @__PURE__ */ new Set(), o = (r) => {
169
169
  for (const s of r)
170
170
  n.add(s.path), o(s.groups);
171
171
  };
172
172
  return o(e), t.filter((r) => n.has(r));
173
173
  }
174
- const jo = (e) => (t) => {
174
+ const Ho = (e) => (t) => {
175
175
  if (!(t instanceof Date) || Number.isNaN(t.getTime())) return;
176
176
  const n = t.getFullYear(), o = t.getMonth(), r = t.getDate();
177
177
  return e === "year" ? new Date(n, 0, 1) : e === "month" ? new Date(n, o, 1) : e === "week" ? new Date(n, o, r - (t.getDay() + 6) % 7) : new Date(n, o, r);
178
178
  };
179
- function Ho(e) {
179
+ function Wo(e) {
180
180
  const t = new Date(e.getFullYear(), e.getMonth(), e.getDate() + 3 - (e.getDay() + 6) % 7), n = new Date(t.getFullYear(), 0, 4);
181
181
  return { week: 1 + Math.round((t.getTime() - n.getTime()) / 864e5 / 7 - ((n.getDay() + 6) % 7 - 3) / 7), year: t.getFullYear() };
182
182
  }
183
- function Wo(e, t, n, o) {
183
+ function qo(e, t, n, o) {
184
184
  if (e === "year") return String(t.getFullYear());
185
185
  if (e === "month") return n.month(t);
186
186
  if (e === "week") {
187
- const { week: r, year: s } = Ho(t);
187
+ const { week: r, year: s } = Wo(t);
188
188
  return o.calendarWeek(r, s);
189
189
  }
190
190
  return n.date(t);
191
191
  }
192
192
  function Ln(e, t) {
193
193
  const n = [], o = (r, s) => {
194
- for (const l of r) {
195
- const i = t.has(l.path);
196
- if (l.groups.length === 0 && l.level === 0) {
197
- if (n.push({ kind: "header", group: l, parents: s, continued: !1 }), !i)
198
- for (const c of l.rows) n.push({ kind: "row", row: c, parents: [l], span: void 0, first: !1, continued: !1 });
199
- } else l.groups.length > 0 ? (n.push({ kind: "header", group: l, parents: s, continued: !1 }), i || o(l.groups, [...s, l])) : i ? n.push({ kind: "folded", group: l, parents: s }) : l.rows.forEach((c, a) => n.push({ kind: "row", row: c, parents: s, span: l, first: a === 0, continued: !1 }));
194
+ for (const i of r) {
195
+ const l = t.has(i.path);
196
+ if (i.groups.length === 0 && i.level === 0) {
197
+ if (n.push({ kind: "header", group: i, parents: s, continued: !1 }), !l)
198
+ for (const c of i.rows) n.push({ kind: "row", row: c, parents: [i], span: void 0, first: !1, continued: !1 });
199
+ } else i.groups.length > 0 ? (n.push({ kind: "header", group: i, parents: s, continued: !1 }), l || o(i.groups, [...s, i])) : l ? n.push({ kind: "folded", group: i, parents: s }) : i.rows.forEach((c, a) => n.push({ kind: "row", row: c, parents: s, span: i, first: a === 0, continued: !1 }));
200
200
  }
201
201
  };
202
202
  return o(e, []), n;
@@ -204,13 +204,13 @@ function Ln(e, t) {
204
204
  function Yo(e, t, n) {
205
205
  const o = [0];
206
206
  if (n > 0)
207
- for (let i = 0; i += Math.max(1, n - (e[i]?.parents.length ?? 0)), !(i >= e.length); )
208
- o.push(i);
209
- const r = o.length, s = Math.min(Math.max(1, t), r), l = n > 0 ? e.slice(o[s - 1], o[s] ?? e.length) : [...e];
210
- return { lines: Fn(l), page: s, pageCount: r };
207
+ for (let l = 0; l += Math.max(1, n - (e[l]?.parents.length ?? 0)), !(l >= e.length); )
208
+ o.push(l);
209
+ const r = o.length, s = Math.min(Math.max(1, t), r), i = n > 0 ? e.slice(o[s - 1], o[s] ?? e.length) : [...e];
210
+ return { lines: Dn(i), page: s, pageCount: r };
211
211
  }
212
- const qn = (e) => e.flatMap((t) => t.kind === "row" ? [t.row] : []);
213
- function Fn(e) {
212
+ const Fn = (e) => e.flatMap((t) => t.kind === "row" ? [t.row] : []);
213
+ function Dn(e) {
214
214
  const t = e[0];
215
215
  if (!t) return [...e];
216
216
  const n = t.parents.map((r, s) => ({
@@ -221,61 +221,61 @@ function Fn(e) {
221
221
  })), o = t.kind === "row" && t.span && !t.first ? { ...t, first: !0, continued: !0 } : t;
222
222
  return [...n, o, ...e.slice(1)];
223
223
  }
224
- function Dn(e, t) {
224
+ function Bn(e, t) {
225
225
  return t?.length ? [
226
226
  ...t.map((n) => e.find((o) => o.id === n)).filter((n) => n !== void 0),
227
227
  ...e.filter((n) => !t.includes(n.id))
228
228
  ] : e;
229
229
  }
230
- const Fe = (e) => e == null || typeof e == "number" && Number.isNaN(e), Uo = (e, t) => typeof e == "number" && typeof t == "number" ? e - t : xn.compareText(String(e), String(t));
231
- function Bn(e, t, n) {
232
- const o = (t ?? "").trim().toLowerCase(), r = e.filter((l) => l.searchable && l.value), s = (l) => !o || r.some((i) => {
233
- const c = i.value(l);
234
- return !Fe(c) && String(c).toLowerCase().includes(o);
230
+ const De = (e) => e == null || typeof e == "number" && Number.isNaN(e), Uo = (e, t) => typeof e == "number" && typeof t == "number" ? e - t : xn.compareText(String(e), String(t));
231
+ function Vn(e, t, n) {
232
+ const o = (t ?? "").trim().toLowerCase(), r = e.filter((i) => i.searchable && i.value), s = (i) => !o || r.some((l) => {
233
+ const c = l.value(i);
234
+ return !De(c) && String(c).toLowerCase().includes(o);
235
235
  });
236
- return { term: o, matches: (l) => s(l) && (n ? n(l) : !0) };
237
- }
238
- function Vn(e, t) {
239
- const n = Array.isArray(t) ? t : t ? [t] : [], o = [], r = n.map((l) => {
240
- const i = e.find((m) => m.id === l.column);
241
- if (!i || !i.compare && !i.value) return null;
242
- const c = l.direction === "asc" ? 1 : -1, a = i.compare, u = i.value, d = o.length;
243
- return o.push(u), u ? (m, b) => {
244
- const p = m.keys[d], w = b.keys[d];
245
- return Fe(p) || Fe(w) ? Fe(p) === Fe(w) ? 0 : Fe(p) ? 1 : -1 : (a ? a(m.row, b.row) : Uo(p, w)) * c;
246
- } : (m, b) => a(m.row, b.row) * c;
247
- }).filter((l) => l !== null);
248
- return { levels: n, sorted: (l) => (
236
+ return { term: o, matches: (i) => s(i) && (n ? n(i) : !0) };
237
+ }
238
+ function Pn(e, t) {
239
+ const n = Array.isArray(t) ? t : t ? [t] : [], o = [], r = n.map((i) => {
240
+ const l = e.find((b) => b.id === i.column);
241
+ if (!l || !l.compare && !l.value) return null;
242
+ const c = i.direction === "asc" ? 1 : -1, a = l.compare, u = l.value, d = o.length;
243
+ return o.push(u), u ? (b, p) => {
244
+ const m = b.keys[d], w = p.keys[d];
245
+ return De(m) || De(w) ? De(m) === De(w) ? 0 : De(m) ? 1 : -1 : (a ? a(b.row, p.row) : Uo(m, w)) * c;
246
+ } : (b, p) => a(b.row, p.row) * c;
247
+ }).filter((i) => i !== null);
248
+ return { levels: n, sorted: (i) => (
249
249
  // Array#sort is stable (ES2019), equal values keep their order.
250
- r.length === 0 ? [...l] : l.map((i) => ({ row: i, keys: o.map((c) => c?.(i)) })).sort((i, c) => {
250
+ r.length === 0 ? [...i] : i.map((l) => ({ row: l, keys: o.map((c) => c?.(l)) })).sort((l, c) => {
251
251
  for (const a of r) {
252
- const u = a(i, c);
252
+ const u = a(l, c);
253
253
  if (u !== 0) return u;
254
254
  }
255
255
  return 0;
256
- }).map((i) => i.row)
256
+ }).map((l) => l.row)
257
257
  ) };
258
258
  }
259
- function Pn(e, t, n) {
260
- const { matches: o } = Bn(t, n.search, n.filter), { levels: r, sorted: s } = Vn(t, n.sort);
259
+ function In(e, t, n) {
260
+ const { matches: o } = Vn(t, n.search, n.filter), { levels: r, sorted: s } = Pn(t, n.sort);
261
261
  return { filtered: s(e.filter(o)), levels: r };
262
262
  }
263
- function In(e, t, n) {
264
- return Ko(e, { levels: n.levels, aggregates: n.aggregates, compareText: n.compareText, sort: t });
263
+ function $n(e, t, n) {
264
+ return Go(e, { levels: n.levels, aggregates: n.aggregates, compareText: n.compareText, sort: t });
265
265
  }
266
266
  function St(e, t, n, o) {
267
- const { page: r = 1, pageSize: s, hidden: l, order: i } = t, c = Ct(e, l, i);
267
+ const { page: r = 1, pageSize: s, hidden: i, order: l } = t, c = Ct(e, i, l);
268
268
  if (o) {
269
- const m = Yo(o.lines, r, s ?? 0);
269
+ const b = Yo(o.lines, r, s ?? 0);
270
270
  return {
271
271
  columns: c,
272
272
  filtered: n,
273
- visible: qn(m.lines),
273
+ visible: Fn(b.lines),
274
274
  groups: o.groups,
275
275
  lines: o.lines,
276
- visibleLines: m.lines,
277
- page: m.page,
278
- pageCount: m.pageCount,
276
+ visibleLines: b.lines,
277
+ page: b.page,
278
+ pageCount: b.pageCount,
279
279
  columnCount: c.length
280
280
  };
281
281
  }
@@ -290,54 +290,54 @@ function St(e, t, n, o) {
290
290
  };
291
291
  }
292
292
  const Ct = (e, t, n) => {
293
- const o = Dn(e, n);
293
+ const o = Bn(e, n);
294
294
  return t?.length ? o.filter((r) => r.hideable === !1 || !t.includes(r.id)) : o;
295
295
  };
296
- function $n(e, t, n) {
297
- const { page: o = 1, pageSize: r, hidden: s, order: l } = n;
296
+ function zn(e, t, n) {
297
+ const { page: o = 1, pageSize: r, hidden: s, order: i } = n;
298
298
  if (n.server) {
299
- const u = Ct(t, s, l), { rowCount: d } = n.server, m = r && r > 0 ? r : Math.max(d, 1), b = Math.max(1, Math.ceil(d / m)), p = d > 0 ? Math.min(Math.max(1, o), b) : Math.max(1, o);
299
+ const u = Ct(t, s, i), { rowCount: d } = n.server, b = r && r > 0 ? r : Math.max(d, 1), p = Math.max(1, Math.ceil(d / b)), m = d > 0 ? Math.min(Math.max(1, o), p) : Math.max(1, o);
300
300
  return {
301
301
  columns: u,
302
302
  filtered: [...e],
303
303
  visible: [...e],
304
- page: p,
305
- pageCount: b,
304
+ page: m,
305
+ pageCount: p,
306
306
  columnCount: u.length
307
307
  };
308
308
  }
309
309
  if (n.tree) {
310
- const { term: u, matches: d } = Bn(t, n.search, n.filter), { sorted: m } = Vn(t, n.sort);
311
- return Jo(e, n.tree, m, u || n.filter ? d : void 0, Ct(t, s, l));
310
+ const { term: u, matches: d } = Vn(t, n.search, n.filter), { sorted: b } = Pn(t, n.sort);
311
+ return Jo(e, n.tree, b, u || n.filter ? d : void 0, Ct(t, s, i));
312
312
  }
313
- const { filtered: i, levels: c } = Pn(e, t, n);
314
- if (!n.grouping?.levels.length) return St(t, n, i);
315
- const a = In(i, c, n.grouping);
316
- return St(t, n, i, { groups: a, lines: Ln(a, n.grouping.folded) });
313
+ const { filtered: l, levels: c } = In(e, t, n);
314
+ if (!n.grouping?.levels.length) return St(t, n, l);
315
+ const a = $n(l, c, n.grouping);
316
+ return St(t, n, l, { groups: a, lines: Ln(a, n.grouping.folded) });
317
317
  }
318
318
  function Jo(e, t, n, o, r) {
319
- const { admit: s } = t, l = (v) => n(s ? v.filter(s) : v), i = /* @__PURE__ */ new Map(), c = {
319
+ const { admit: s } = t, i = (v) => n(s ? v.filter(s) : v), l = /* @__PURE__ */ new Map(), c = {
320
320
  key: t.key,
321
321
  children: (v) => {
322
- if (!i.has(v)) {
323
- const A = t.children(v);
324
- i.set(v, A && l(A));
322
+ if (!l.has(v)) {
323
+ const x = t.children(v);
324
+ l.set(v, x && i(x));
325
325
  }
326
- return i.get(v);
326
+ return l.get(v);
327
327
  },
328
328
  label: () => "",
329
329
  matches: o
330
- }, a = l(e), u = { expanded: t.open, checked: /* @__PURE__ */ new Set(), active: null, anchor: null, search: "" }, d = rn(a, c, u), m = /* @__PURE__ */ new Set();
331
- let b = 0;
332
- const p = (v) => {
333
- for (const A of v) {
334
- b++;
335
- const y = c.children(A);
336
- y && (m.add(t.key(A)), p(y));
330
+ }, a = i(e), u = { expanded: t.open, checked: /* @__PURE__ */ new Set(), active: null, anchor: null, search: "" }, d = rn(a, c, u), b = /* @__PURE__ */ new Set();
331
+ let p = 0;
332
+ const m = (v) => {
333
+ for (const x of v) {
334
+ p++;
335
+ const y = c.children(x);
336
+ y && (b.add(t.key(x)), m(y));
337
337
  }
338
338
  };
339
- p(a);
340
- const w = rn(a, c, { ...u, expanded: m }), g = d.map((v) => v.node);
339
+ m(a);
340
+ const w = rn(a, c, { ...u, expanded: b }), g = d.map((v) => v.node);
341
341
  return {
342
342
  columns: r,
343
343
  filtered: w.filter((v) => v.matches).map((v) => v.node),
@@ -346,7 +346,7 @@ function Jo(e, t, n, o, r) {
346
346
  shown: g,
347
347
  roots: w.filter((v) => v.level === 0).map((v) => v.node),
348
348
  exported: w.filter((v) => v.matches || v.pathOnly),
349
- total: b,
349
+ total: p,
350
350
  page: 1,
351
351
  pageCount: 1,
352
352
  columnCount: r.length
@@ -357,130 +357,130 @@ function xt(e) {
357
357
  for (const n of e) n.width !== void 0 && (t[n.id] = n.width);
358
358
  return t;
359
359
  }
360
- function zn(e, t, n) {
360
+ function Kn(e, t, n) {
361
361
  if (!e.lines) return { ...e, visible: (e.shown ?? e.filtered).slice(t, n) };
362
362
  const o = e.lines.slice(t, n);
363
- return { ...e, visibleLines: o, visible: qn(o) };
363
+ return { ...e, visibleLines: o, visible: Fn(o) };
364
364
  }
365
365
  function Xo(e, t, n) {
366
- const { rowKey: o, filter: r, defaultSort: s = null, initialView: l, virtual: i, grouping: c, server: a, tree: u } = n, d = (V) => V?.sort?.length ? [...V.sort] : s ? Array.isArray(s) ? [...s] : [s] : [], m = (V) => V?.widths ? { ...V.widths } : xt(t), [b, p] = P(l?.search ?? ""), [w, g] = P(() => d(l)), [v, A] = P(l?.page ?? 1), [y, _] = P(
367
- l?.pageSize ?? n.pageSize ?? 10
368
- ), [S, C] = P([]), [x, L] = P(l?.hidden ?? []), [k, O] = P(l?.order ?? []), [M, T] = P(() => m(l)), E = (V) => {
369
- p(V.search ?? ""), g(d(V)), A(V.page ?? 1), _(V.pageSize ?? n.pageSize ?? 10), L(V.hidden ?? []), O(V.order ?? []), T(m(V));
370
- }, D = i || u ? 0 : y, I = !a && !u, B = j(
371
- () => I ? Pn(e, t, { search: b, filter: r, sort: w }) : null,
372
- [I, e, t, b, r, w]
373
- ), z = c?.levels.length ? c : void 0, Y = j(
374
- () => B && z ? In(B.filtered, B.levels, z) : void 0,
366
+ const { rowKey: o, filter: r, defaultSort: s = null, initialView: i, virtual: l, grouping: c, server: a, tree: u } = n, d = (P) => P?.sort?.length ? [...P.sort] : s ? Array.isArray(s) ? [...s] : [s] : [], b = (P) => P?.widths ? { ...P.widths } : xt(t), [p, m] = I(i?.search ?? ""), [w, g] = I(() => d(i)), [v, x] = I(i?.page ?? 1), [y, _] = I(
367
+ i?.pageSize ?? n.pageSize ?? 10
368
+ ), [S, C] = I([]), [A, L] = I(i?.hidden ?? []), [k, O] = I(i?.order ?? []), [M, R] = I(() => b(i)), E = (P) => {
369
+ m(P.search ?? ""), g(d(P)), x(P.page ?? 1), _(P.pageSize ?? n.pageSize ?? 10), L(P.hidden ?? []), O(P.order ?? []), R(b(P));
370
+ }, B = l || u ? 0 : y, $ = !a && !u, V = H(
371
+ () => $ ? In(e, t, { search: p, filter: r, sort: w }) : null,
372
+ [$, e, t, p, r, w]
373
+ ), K = c?.levels.length ? c : void 0, Y = H(
374
+ () => V && K ? $n(V.filtered, V.levels, K) : void 0,
375
375
  // The fold is not an input of the grouping: it only chooses lines.
376
376
  // eslint-disable-next-line react-hooks/exhaustive-deps
377
- [B, z?.levels, z?.aggregates, z?.compareText]
378
- ), ce = j(
379
- () => Y && z ? Ln(Y, z.folded) : void 0,
377
+ [V, K?.levels, K?.aggregates, K?.compareText]
378
+ ), ce = H(
379
+ () => Y && K ? Ln(Y, K.folded) : void 0,
380
380
  // eslint-disable-next-line react-hooks/exhaustive-deps
381
- [Y, z?.folded]
382
- ), G = j(
383
- () => B ? St(t, { page: v, pageSize: D, hidden: x, order: k }, B.filtered, Y && ce ? { groups: Y, lines: ce } : void 0) : $n(e, t, { search: b, filter: r, sort: w, page: v, pageSize: D, hidden: x, order: k, grouping: c, server: a, tree: u }),
384
- [B, Y, ce, t, v, D, x, k, e, b, r, w, c, a, u]
385
- ), [ne, de] = P(36), le = To(i ? (G.lines ?? G.shown ?? G.filtered).length : 0, {
386
- rowHeight: i ? ne : 0,
387
- overscan: typeof i == "object" ? i.overscan : void 0
388
- }), Z = j(
389
- () => i ? zn(G, le.from, le.to) : G,
390
- [i, G, le.from, le.to]
391
- ), oe = Z.visibleLines, H = Z.visible, ge = j(() => G.filtered.map(o), [G.filtered, o]), q = zo(ge), ae = fe((V) => {
392
- p(V), A(1);
393
- }, []), Ae = fe((V) => {
394
- _(V), A(1);
395
- }, []), ue = fe((V, J = !1) => {
396
- g((ee) => {
397
- const me = ee.find((we) => we.column === V);
381
+ [Y, K?.folded]
382
+ ), j = H(
383
+ () => V ? St(t, { page: v, pageSize: B, hidden: A, order: k }, V.filtered, Y && ce ? { groups: Y, lines: ce } : void 0) : zn(e, t, { search: p, filter: r, sort: w, page: v, pageSize: B, hidden: A, order: k, grouping: c, server: a, tree: u }),
384
+ [V, Y, ce, t, v, B, A, k, e, p, r, w, c, a, u]
385
+ ), [ne, de] = I(36), le = Ro(l ? (j.lines ?? j.shown ?? j.filtered).length : 0, {
386
+ rowHeight: l ? ne : 0,
387
+ overscan: typeof l == "object" ? l.overscan : void 0
388
+ }), ee = H(
389
+ () => l ? Kn(j, le.from, le.to) : j,
390
+ [l, j, le.from, le.to]
391
+ ), oe = ee.visibleLines, W = ee.visible, ge = H(() => j.filtered.map(o), [j.filtered, o]), F = Ko(ge), ae = fe((P) => {
392
+ m(P), x(1);
393
+ }, []), Ae = fe((P) => {
394
+ _(P), x(1);
395
+ }, []), ue = fe((P, J = !1) => {
396
+ g((te) => {
397
+ const me = te.find((we) => we.column === P);
398
398
  if (!J) {
399
- const we = ee.length === 1 && me?.direction === "asc" ? "desc" : "asc";
400
- return [{ column: V, direction: we }];
399
+ const we = te.length === 1 && me?.direction === "asc" ? "desc" : "asc";
400
+ return [{ column: P, direction: we }];
401
401
  }
402
- return me ? me.direction === "asc" ? ee.map(
403
- (we) => we.column === V ? { column: V, direction: "desc" } : we
404
- ) : ee.filter((we) => we.column !== V) : [...ee, { column: V, direction: "asc" }];
405
- }), A(1);
406
- }, []), Ne = fe((V) => {
402
+ return me ? me.direction === "asc" ? te.map(
403
+ (we) => we.column === P ? { column: P, direction: "desc" } : we
404
+ ) : te.filter((we) => we.column !== P) : [...te, { column: P, direction: "asc" }];
405
+ }), x(1);
406
+ }, []), Ne = fe((P) => {
407
407
  C(
408
- (J) => J.includes(V) ? J.filter((ee) => ee !== V) : [...J, V]
408
+ (J) => J.includes(P) ? J.filter((te) => te !== P) : [...J, P]
409
409
  );
410
- }, []), Me = fe((V) => {
410
+ }, []), Me = fe((P) => {
411
411
  L(
412
- (J) => J.includes(V) ? J.filter((ee) => ee !== V) : [...J, V]
412
+ (J) => J.includes(P) ? J.filter((te) => te !== P) : [...J, P]
413
413
  );
414
- }, []), pe = fe((V, J) => {
415
- T((ee) => {
414
+ }, []), pe = fe((P, J) => {
415
+ R((te) => {
416
416
  if (J === void 0) {
417
- if (!(V in ee)) return ee;
418
- const me = { ...ee };
419
- return delete me[V], me;
417
+ if (!(P in te)) return te;
418
+ const me = { ...te };
419
+ return delete me[P], me;
420
420
  }
421
- return { ...ee, [V]: J };
421
+ return { ...te, [P]: J };
422
422
  });
423
- }, []), U = n.pageSize ?? 10, Se = j(() => xt(t), [t]), Le = j(() => {
424
- const V = {};
425
- for (const [J, ee] of Object.entries(M))
426
- Se[J] !== ee && (V[J] = ee);
427
- return V;
428
- }, [M, Se]), Pe = j(
423
+ }, []), U = n.pageSize ?? 10, Se = H(() => xt(t), [t]), Le = H(() => {
424
+ const P = {};
425
+ for (const [J, te] of Object.entries(M))
426
+ Se[J] !== te && (P[J] = te);
427
+ return P;
428
+ }, [M, Se]), Ie = H(
429
429
  () => s ? Array.isArray(s) ? s : [s] : [],
430
430
  [s]
431
- ), qe = w.length === Pe.length && w.every(
432
- (V, J) => V.column === Pe[J]?.column && V.direction === Pe[J]?.direction
433
- ), Je = j(
431
+ ), Fe = w.length === Ie.length && w.every(
432
+ (P, J) => P.column === Ie[J]?.column && P.direction === Ie[J]?.direction
433
+ ), Je = H(
434
434
  () => ({
435
- ...b ? { search: b } : {},
436
- ...w.length && !qe ? { sort: w } : {},
435
+ ...p ? { search: p } : {},
436
+ ...w.length && !Fe ? { sort: w } : {},
437
437
  /* Without paging there is no page a view could carry - a page three in
438
438
  the view of a virtualised table would be a promise nobody redeems on
439
439
  opening. */
440
- ...!i && G.page > 1 ? { page: G.page } : {},
441
- ...!i && y !== U ? { pageSize: y } : {},
442
- ...x.length ? { hidden: x } : {},
440
+ ...!l && j.page > 1 ? { page: j.page } : {},
441
+ ...!l && y !== U ? { pageSize: y } : {},
442
+ ...A.length ? { hidden: A } : {},
443
443
  ...k.length ? { order: k } : {},
444
444
  ...Object.keys(Le).length ? { widths: Le } : {}
445
445
  }),
446
446
  [
447
- i,
448
- b,
447
+ l,
448
+ p,
449
449
  w,
450
- qe,
451
- G.page,
450
+ Fe,
451
+ j.page,
452
452
  y,
453
453
  U,
454
- x,
454
+ A,
455
455
  k,
456
456
  Le
457
457
  ]
458
458
  );
459
459
  return {
460
- ...G,
461
- visible: H,
460
+ ...j,
461
+ visible: W,
462
462
  visibleLines: oe,
463
- virtual: i ? le : void 0,
463
+ virtual: l ? le : void 0,
464
464
  setPitch: de,
465
465
  server: a,
466
466
  restart: E,
467
467
  view: Je,
468
- search: b,
468
+ search: p,
469
469
  setSearch: ae,
470
470
  sort: w,
471
471
  toggleSort: ue,
472
- setPage: A,
472
+ setPage: x,
473
473
  pageSize: y,
474
474
  setPageSize: Ae,
475
475
  expanded: S,
476
476
  toggleRow: Ne,
477
- hidden: x,
477
+ hidden: A,
478
478
  toggleColumn: Me,
479
479
  order: k,
480
480
  setOrder: O,
481
481
  widths: M,
482
482
  setWidth: pe,
483
- selection: q
483
+ selection: F
484
484
  };
485
485
  }
486
486
  function Qo(e, t) {
@@ -521,7 +521,7 @@ const ir = (e) => JSON.stringify([e.search, e.conditions, e.sort, e.page, e.page
521
521
  ), mt = (e) => e === void 0 ? void 0 : [...e].sort();
522
522
  function ar(e, t) {
523
523
  if (t.size === 0) return e;
524
- const n = e.sort?.filter((i) => t.has(i.column)), o = e.hidden?.filter((i) => t.has(i)), r = e.order?.filter((i) => t.has(i)), s = e.widths ? Object.fromEntries(Object.entries(e.widths).filter(([i]) => t.has(i))) : void 0;
524
+ const n = e.sort?.filter((l) => t.has(l.column)), o = e.hidden?.filter((l) => t.has(l)), r = e.order?.filter((l) => t.has(l)), s = e.widths ? Object.fromEntries(Object.entries(e.widths).filter(([l]) => t.has(l))) : void 0;
525
525
  return n?.length === e.sort?.length && o?.length === e.hidden?.length && r?.length === e.order?.length && Object.keys(s ?? {}).length === Object.keys(e.widths ?? {}).length ? e : {
526
526
  ...e.search ? { search: e.search } : {},
527
527
  ...e.page ? { page: e.page } : {},
@@ -536,11 +536,11 @@ function cr() {
536
536
  const e = import.meta;
537
537
  return typeof e.env?.DEV == "boolean" ? e.env.DEV : typeof process < "u" && process?.env ? process.env.NODE_ENV !== "production" : !1;
538
538
  }
539
- const Kt = cr(), ln = /* @__PURE__ */ new Set();
539
+ const Gt = cr(), ln = /* @__PURE__ */ new Set();
540
540
  function X(e, t) {
541
- !Kt || ln.has(e) || (ln.add(e), console.warn(`@umriss-ui/table: ${t}`));
541
+ !Gt || ln.has(e) || (ln.add(e), console.warn(`@umriss-ui/table: ${t}`));
542
542
  }
543
- const dr = "_frame_1qr16_11 _text_18806_22", ur = "_children_1qr16_24", fr = "_scroll_1qr16_33 _scroll_18806_96", hr = "_footerTarget_1qr16_62", gr = "_table_1qr16_74", pr = "_th_1qr16_86 _ring_18806_125", mr = "_sticky_1qr16_103", wr = "_td_1qr16_111", br = "_rowHeader_1qr16_125", vr = "_compact_1qr16_146 _dense_18806_38", yr = "_numeric_1qr16_177", _r = "_value_1qr16_197", kr = "_valueText_1qr16_207", Sr = "_sized_1qr16_211", Cr = "_cutTip_1qr16_228 _text_18806_22", xr = "_absent_1qr16_260", Ar = "_striped_1qr16_264", Nr = "_pinned_1qr16_289", Rr = "_pinStartEdge_1qr16_305", Tr = "_pinEndEdge_1qr16_306", Or = "_sortButton_1qr16_336 _ring_18806_125", Er = "_sortIndicator_1qr16_361", Mr = "_sortArrow_1qr16_368", Lr = "_sortArrowDesc_1qr16_372", qr = "_sortActive_1qr16_380", Fr = "_sortRank_1qr16_386", Dr = "_thFlex_1qr16_394", Br = "_headLine_1qr16_414", Vr = "_headLabel_1qr16_437", Pr = "_footerKind_1qr16_453", Ir = "_emptyCell_1qr16_471", $r = "_emptyTitle_1qr16_493", zr = "_skeleton_1qr16_502", Kr = "_toolbar_1qr16_534 _text_18806_22", Gr = "_toolbarGroup_1qr16_550", jr = "_toolbarGroupIdle_1qr16_566", Hr = "_searchGrow_1qr16_573", Wr = "_toolbarMd_1qr16_583", Yr = "_toolbarInfo_1qr16_587", Ur = "_pagination_1qr16_593 _text_18806_22", Jr = "_paginationControls_1qr16_606", Xr = "_pageSize_1qr16_613", Qr = "_pageSteps_1qr16_621", Zr = "_paginationStatus_1qr16_627", es = "_filterButton_1qr16_636 _ring_18806_125", ts = "_filterActive_1qr16_663", ns = "_filterPanel_1qr16_668", os = "_filterContent_1qr16_682 _scroll_18806_96", rs = "_filterFooter_1qr16_693", ss = "_filterLabel_1qr16_707", is = "_filterValue_1qr16_717", ls = "_filteredCount_1qr16_723", as = "_rangeFields_1qr16_734", cs = "_rangePeriod_1qr16_744", ds = "_conditions_1qr16_750", us = "_conditionButton_1qr16_756", fs = "_condition_1qr16_750", hs = "_columnsPanel_1qr16_781", gs = "_columnsList_1qr16_790", ps = "_columnsEntry_1qr16_799", ms = "_move_1qr16_811", ws = "_pinOn_1qr16_849", bs = "_groupingChoice_1qr16_859", vs = "_groupingHeading_1qr16_867", ys = "_groupingOptions_1qr16_876", _s = "_groupingOption_1qr16_876 _ring_18806_125", ks = "_groupingLevel_1qr16_919", Ss = "_groupingTag_1qr16_924", Cs = "_groupingTrigger_1qr16_931", xs = "_groupingPrefix_1qr16_937", As = "_groupingPath_1qr16_942", Ns = "_groupingSeparator_1qr16_946", Rs = "_groupHeader_1qr16_963", Ts = "_spanCell_1qr16_1006", Os = "_groupFolded_1qr16_1087", Es = "_spanValue_1qr16_1091", Ms = "_groupLabel_1qr16_1092", Ls = "_spanText_1qr16_1105", qs = "_groupValue_1qr16_1106", Fs = "_groupCount_1qr16_1113", Ds = "_continued_1qr16_1127", Bs = "_spanSelect_1qr16_1158", Vs = "_treeCell_1qr16_1174", Ps = "_treeText_1qr16_1182", Is = "_foldSlot_1qr16_1186", $s = "_treeRow_1qr16_1196", zs = "_branchRow_1qr16_1200", Ks = "_detailCell_1qr16_1212", Gs = "_pathRow_1qr16_1218", js = "_fold_1qr16_1186", Hs = "_foldClosed_1qr16_1259", Ws = "_foldedCount_1qr16_1269", Ys = "_shareHost_1qr16_1277", Us = "_shareBar_1qr16_1284", Js = "_expander_1qr16_1296", Xs = "_expanderOpen_1qr16_1331", Qs = "_detailRow_1qr16_1335", Zs = "_treeDetail_1qr16_1344", ei = "_treeDetailRail_1qr16_1349", ti = "_actionsCell_1qr16_1364", ni = "_actions_1qr16_1364", oi = "_decision_1qr16_1383", ri = "_reserve_1qr16_1402", si = "_grip_1qr16_1412", ii = "_virtualBody_1qr16_1453", li = "_virtualRow_1qr16_1469", ai = "_fillerRow_1qr16_1493", ci = "_grid_1qr16_1506", di = "_editing_1qr16_1522", ui = "_editingValue_1qr16_1526", fi = "_editor_1qr16_1532", hi = "_editorField_1qr16_1545", gi = "_draftButtons_1qr16_1577", pi = "_held_1qr16_1585", mi = "_deleteAsk_1qr16_1589", wi = "_newRowBar_1qr16_1596", bi = "_draftMessage_1qr16_1603", vi = "_editorMessage_1qr16_1628", yi = "_control_1qr16_277", _i = "_empty_1qr16_471", ki = "_toned_1qr16_1389", h = {
543
+ const dr = "_frame_12rhl_11 _text_18806_22", ur = "_children_12rhl_24", fr = "_scroll_12rhl_33 _scroll_18806_96", hr = "_footerTarget_12rhl_62", gr = "_table_12rhl_74", pr = "_th_12rhl_86 _ring_18806_125", mr = "_sticky_12rhl_103", wr = "_td_12rhl_111", br = "_rowHeader_12rhl_125", vr = "_compact_12rhl_146 _dense_18806_38", yr = "_numeric_12rhl_177", _r = "_value_12rhl_197", kr = "_valueText_12rhl_207", Sr = "_sized_12rhl_211", Cr = "_cutTip_12rhl_228 _text_18806_22", xr = "_absent_12rhl_270", Ar = "_striped_12rhl_274", Nr = "_pinned_12rhl_299", Tr = "_pinStartEdge_12rhl_315", Rr = "_pinEndEdge_12rhl_316", Or = "_sortButton_12rhl_346 _ring_18806_125", Er = "_sortIndicator_12rhl_371", Mr = "_sortArrow_12rhl_378", Lr = "_sortArrowDesc_12rhl_382", Fr = "_sortActive_12rhl_390", Dr = "_sortRank_12rhl_396", Br = "_thFlex_12rhl_404", Vr = "_headLine_12rhl_424", Pr = "_headLabel_12rhl_447", Ir = "_footerKind_12rhl_463", $r = "_emptyCell_12rhl_481", zr = "_emptyTitle_12rhl_503", Kr = "_skeleton_12rhl_512", Gr = "_toolbar_12rhl_544 _text_18806_22", jr = "_toolbarGroup_12rhl_560", Hr = "_toolbarGroupIdle_12rhl_576", Wr = "_searchGrow_12rhl_583", qr = "_toolbarMd_12rhl_593", Yr = "_toolbarInfo_12rhl_597", Ur = "_pagination_12rhl_603 _text_18806_22", Jr = "_paginationControls_12rhl_616", Xr = "_pageSize_12rhl_623", Qr = "_pageSteps_12rhl_631", Zr = "_paginationStatus_12rhl_637", es = "_filterButton_12rhl_646 _ring_18806_125", ts = "_filterActive_12rhl_673", ns = "_filterPanel_12rhl_678", os = "_filterContent_12rhl_692 _scroll_18806_96", rs = "_filterFooter_12rhl_703", ss = "_filterLabel_12rhl_717", is = "_filterValue_12rhl_727", ls = "_filteredCount_12rhl_733", as = "_rangeFields_12rhl_744", cs = "_rangePeriod_12rhl_754", ds = "_conditions_12rhl_760", us = "_conditionButton_12rhl_766", fs = "_condition_12rhl_760", hs = "_columnsPanel_12rhl_791", gs = "_columnsList_12rhl_800", ps = "_columnsEntry_12rhl_809", ms = "_move_12rhl_821", ws = "_pinOn_12rhl_859", bs = "_groupingChoice_12rhl_869", vs = "_groupingHeading_12rhl_877", ys = "_groupingOptions_12rhl_886", _s = "_groupingOption_12rhl_886 _ring_18806_125", ks = "_groupingLevel_12rhl_929", Ss = "_groupingTag_12rhl_934", Cs = "_groupingTrigger_12rhl_941", xs = "_groupingPrefix_12rhl_947", As = "_groupingPath_12rhl_952", Ns = "_groupingSeparator_12rhl_956", Ts = "_groupHeader_12rhl_973", Rs = "_spanCell_12rhl_1016", Os = "_groupFolded_12rhl_1097", Es = "_spanValue_12rhl_1101", Ms = "_groupLabel_12rhl_1102", Ls = "_spanText_12rhl_1115", Fs = "_groupValue_12rhl_1116", Ds = "_groupCount_12rhl_1123", Bs = "_continued_12rhl_1137", Vs = "_spanSelect_12rhl_1168", Ps = "_treeCell_12rhl_1184", Is = "_treeText_12rhl_1192", $s = "_foldSlot_12rhl_1196", zs = "_treeRow_12rhl_1206", Ks = "_branchRow_12rhl_1210", Gs = "_detailCell_12rhl_1222", js = "_pathRow_12rhl_1228", Hs = "_fold_12rhl_1196", Ws = "_foldClosed_12rhl_1269", qs = "_foldedCount_12rhl_1279", Ys = "_shareHost_12rhl_1287", Us = "_shareBar_12rhl_1294", Js = "_expander_12rhl_1306", Xs = "_expanderOpen_12rhl_1341", Qs = "_detailRow_12rhl_1345", Zs = "_treeDetail_12rhl_1354", ei = "_treeDetailRail_12rhl_1359", ti = "_actionsCell_12rhl_1374", ni = "_actions_12rhl_1374", oi = "_decision_12rhl_1393", ri = "_reserve_12rhl_1412", si = "_grip_12rhl_1422", ii = "_virtualBody_12rhl_1463", li = "_virtualRow_12rhl_1479", ai = "_fillerRow_12rhl_1503", ci = "_grid_12rhl_1516", di = "_editing_12rhl_1532", ui = "_editingValue_12rhl_1536", fi = "_editor_12rhl_1542", hi = "_editorField_12rhl_1555", gi = "_draftButtons_12rhl_1587", pi = "_held_12rhl_1595", mi = "_deleteAsk_12rhl_1599", wi = "_newRowBar_12rhl_1606", bi = "_draftMessage_12rhl_1613", vi = "_editorMessage_12rhl_1638", yi = "_control_12rhl_287", _i = "_empty_12rhl_481", ki = "_toned_12rhl_1399", h = {
544
544
  frame: dr,
545
545
  children: ur,
546
546
  scroll: fr,
@@ -559,26 +559,26 @@ const dr = "_frame_1qr16_11 _text_18806_22", ur = "_children_1qr16_24", fr = "_s
559
559
  absent: xr,
560
560
  striped: Ar,
561
561
  pinned: Nr,
562
- pinStartEdge: Rr,
563
- pinEndEdge: Tr,
562
+ pinStartEdge: Tr,
563
+ pinEndEdge: Rr,
564
564
  sortButton: Or,
565
565
  sortIndicator: Er,
566
566
  sortArrow: Mr,
567
567
  sortArrowDesc: Lr,
568
- sortActive: qr,
569
- sortRank: Fr,
570
- thFlex: Dr,
571
- headLine: Br,
572
- headLabel: Vr,
573
- footerKind: Pr,
574
- emptyCell: Ir,
575
- emptyTitle: $r,
576
- skeleton: zr,
577
- toolbar: Kr,
578
- toolbarGroup: Gr,
579
- toolbarGroupIdle: jr,
580
- searchGrow: Hr,
581
- toolbarMd: Wr,
568
+ sortActive: Fr,
569
+ sortRank: Dr,
570
+ thFlex: Br,
571
+ headLine: Vr,
572
+ headLabel: Pr,
573
+ footerKind: Ir,
574
+ emptyCell: $r,
575
+ emptyTitle: zr,
576
+ skeleton: Kr,
577
+ toolbar: Gr,
578
+ toolbarGroup: jr,
579
+ toolbarGroupIdle: Hr,
580
+ searchGrow: Wr,
581
+ toolbarMd: qr,
582
582
  toolbarInfo: Yr,
583
583
  pagination: Ur,
584
584
  paginationControls: Jr,
@@ -613,26 +613,26 @@ const dr = "_frame_1qr16_11 _text_18806_22", ur = "_children_1qr16_24", fr = "_s
613
613
  groupingPrefix: xs,
614
614
  groupingPath: As,
615
615
  groupingSeparator: Ns,
616
- groupHeader: Rs,
617
- spanCell: Ts,
616
+ groupHeader: Ts,
617
+ spanCell: Rs,
618
618
  groupFolded: Os,
619
619
  spanValue: Es,
620
620
  groupLabel: Ms,
621
621
  spanText: Ls,
622
- groupValue: qs,
623
- groupCount: Fs,
624
- continued: Ds,
625
- spanSelect: Bs,
626
- treeCell: Vs,
627
- treeText: Ps,
628
- foldSlot: Is,
629
- treeRow: $s,
630
- branchRow: zs,
631
- detailCell: Ks,
632
- pathRow: Gs,
633
- fold: js,
634
- foldClosed: Hs,
635
- foldedCount: Ws,
622
+ groupValue: Fs,
623
+ groupCount: Ds,
624
+ continued: Bs,
625
+ spanSelect: Vs,
626
+ treeCell: Ps,
627
+ treeText: Is,
628
+ foldSlot: $s,
629
+ treeRow: zs,
630
+ branchRow: Ks,
631
+ detailCell: Gs,
632
+ pathRow: js,
633
+ fold: Hs,
634
+ foldClosed: Ws,
635
+ foldedCount: qs,
636
636
  shareHost: Ys,
637
637
  shareBar: Us,
638
638
  expander: Js,
@@ -663,53 +663,53 @@ const dr = "_frame_1qr16_11 _text_18806_22", ur = "_children_1qr16_24", fr = "_s
663
663
  empty: _i,
664
664
  toned: ki
665
665
  };
666
- function Va(e) {
666
+ function Pa(e) {
667
667
  return e;
668
668
  }
669
- const We = /* @__PURE__ */ new WeakMap();
670
- function Kn(e, t) {
671
- return We.set(e, t), e;
669
+ const qe = /* @__PURE__ */ new WeakMap();
670
+ function Gn(e, t) {
671
+ return qe.set(e, t), e;
672
672
  }
673
- const Si = (e) => We.has(e);
673
+ const Si = (e) => qe.has(e);
674
674
  function Ee(e) {
675
- return e === "list" ? Ni : e === "range" ? Fi : typeof e == "object" && e !== null ? e : void 0;
675
+ return e === "list" ? Ni : e === "range" ? Di : typeof e == "object" && e !== null ? e : void 0;
676
676
  }
677
- function Gn(e, t) {
677
+ function jn(e, t) {
678
678
  if (t == null) return "empty";
679
- const n = We.get(e);
679
+ const n = qe.get(e);
680
680
  return n ? n.isCondition(t) ? n.isEmpty(t) ? "empty" : "effective" : "foreign" : "effective";
681
681
  }
682
682
  function Ci(e, t, n) {
683
- return se(t) ? We.get(e)?.absentMatches(n) ?? !1 : e.matches(t, n);
683
+ return se(t) ? qe.get(e)?.absentMatches(n) ?? !1 : e.matches(t, n);
684
684
  }
685
685
  function xi(e, t, n) {
686
- const o = We.get(e);
686
+ const o = qe.get(e);
687
687
  return o ? o.describeIn(t, n) : e.describe(t);
688
688
  }
689
- const an = (e) => e instanceof Date ? e.getTime() : typeof e == "number" ? e : void 0, jn = (e) => (t, n) => {
689
+ const an = (e) => e instanceof Date ? e.getTime() : typeof e == "number" ? e : void 0, Hn = (e) => (t, n) => {
690
690
  const o = an(t.value), r = an(n.value);
691
691
  return o !== void 0 && r !== void 0 ? o - r : e.compareText(t.text, n.text);
692
692
  };
693
693
  function At(e, t, n) {
694
694
  const o = /* @__PURE__ */ new Map();
695
695
  let r = !1;
696
- for (const l of e) {
697
- const i = t(l);
698
- if (se(i)) {
696
+ for (const i of e) {
697
+ const l = t(i);
698
+ if (se(l)) {
699
699
  r = !0;
700
700
  continue;
701
701
  }
702
- const c = i instanceof Date ? `date:${i.getTime()}` : typeof i == "object" || typeof i == "function" ? i : `${typeof i}:${String(i)}`;
703
- o.has(c) || o.set(c, i);
702
+ const c = l instanceof Date ? `date:${l.getTime()}` : typeof l == "object" || typeof l == "function" ? l : `${typeof l}:${String(l)}`;
703
+ o.has(c) || o.set(c, l);
704
704
  }
705
- return { values: [...o.values()].map((l) => ({ value: l, text: String(l) })).sort(jn(n)).map(({ value: l }) => l), absent: r };
705
+ return { values: [...o.values()].map((i) => ({ value: i, text: String(i) })).sort(Hn(n)).map(({ value: i }) => i), absent: r };
706
706
  }
707
707
  const cn = /* @__PURE__ */ new WeakMap();
708
708
  function Nt(e) {
709
709
  let t = cn.get(e);
710
710
  return t || (t = new Set(e.map(Ce)), cn.set(e, t)), t;
711
711
  }
712
- const Rt = (e, t) => se(e) ? t.wording.cellAbsentValue : Be(e, t.format, t.formats, t.wording) ?? String(e);
712
+ const Tt = (e, t) => se(e) ? t.wording.cellAbsentValue : Ve(e, t.format, t.formats, t.wording) ?? String(e);
713
713
  function Ai({
714
714
  condition: e,
715
715
  setCondition: t,
@@ -717,17 +717,17 @@ function Ai({
717
717
  absentOccurs: o = !1,
718
718
  format: r
719
719
  }) {
720
- const s = ke(), l = ie(), i = j(() => e ?? [], [e]), c = j(() => {
721
- const d = { formats: s, wording: l, format: r }, m = n.map((g) => ({ key: Ce(g), text: Rt(g, d), value: g }));
722
- m.sort(jn(s));
723
- const b = new Set(m.map((g) => g.key)), p = i.filter((g) => !se(g) && !b.has(Ce(g))).map((g) => ({ key: Ce(g), text: Rt(g, d), value: g })), w = o || i.some(se) ? [{ key: It, text: l.cellAbsentValue, value: null }] : [];
724
- return [...m, ...p, ...w];
725
- }, [n, i, o, r, s, l]), a = Nt(i), u = (d) => {
726
- const m = a.has(d.key) ? i.filter((b) => Ce(b) !== d.key) : [...i, d.value];
727
- t(m.length > 0 ? m : null);
720
+ const s = ke(), i = ie(), l = H(() => e ?? [], [e]), c = H(() => {
721
+ const d = { formats: s, wording: i, format: r }, b = n.map((g) => ({ key: Ce(g), text: Tt(g, d), value: g }));
722
+ b.sort(Hn(s));
723
+ const p = new Set(b.map((g) => g.key)), m = l.filter((g) => !se(g) && !p.has(Ce(g))).map((g) => ({ key: Ce(g), text: Tt(g, d), value: g })), w = o || l.some(se) ? [{ key: $t, text: i.cellAbsentValue, value: null }] : [];
724
+ return [...b, ...m, ...w];
725
+ }, [n, l, o, r, s, i]), a = Nt(l), u = (d) => {
726
+ const b = a.has(d.key) ? l.filter((p) => Ce(p) !== d.key) : [...l, d.value];
727
+ t(b.length > 0 ? b : null);
728
728
  };
729
729
  return /* @__PURE__ */ f("div", { className: h.filterContent, children: c.map((d) => /* @__PURE__ */ f(
730
- He,
730
+ We,
731
731
  {
732
732
  label: d.text,
733
733
  checked: a.has(d.key),
@@ -736,7 +736,7 @@ function Ai({
736
736
  d.key
737
737
  )) });
738
738
  }
739
- const Ni = /* @__PURE__ */ Kn(
739
+ const Ni = /* @__PURE__ */ Gn(
740
740
  {
741
741
  matches: (e, t) => Nt(t).has(Ce(e)),
742
742
  Input: Ai,
@@ -745,20 +745,20 @@ const Ni = /* @__PURE__ */ Kn(
745
745
  {
746
746
  isCondition: (e) => Array.isArray(e),
747
747
  isEmpty: (e) => e.length === 0,
748
- absentMatches: (e) => Nt(e).has(It),
748
+ absentMatches: (e) => Nt(e).has($t),
749
749
  /* From three values on the first two and how many more: a condition is one
750
750
  line in the table toolbar, not a list. */
751
751
  describeIn: (e, t) => {
752
- const n = e.map((r) => Rt(r, t));
752
+ const n = e.map((r) => Tt(r, t));
753
753
  if (n.length <= 2) return n.join(", ");
754
754
  const o = n.length - 2;
755
755
  return `${n.slice(0, 2).join(", ")} ${t.wording.moreValues(o, t.formats.count(o))}`;
756
756
  }
757
757
  }
758
- ), Ri = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()).getTime(), Ti = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate() + 1).getTime(), De = (e) => typeof e == "number" && Number.isFinite(e), ye = (e) => e instanceof Date && !Number.isNaN(e.getTime()), Oi = (e) => ye(e) ? Ri(e) : De(e) ? e : void 0, Ei = (e) => ye(e) ? { value: Ti(e), open: !0 } : De(e) ? { value: e, open: !1 } : void 0, Qe = (e, t) => ye(e) ? t.formats.date(e) : Be(e, t.format, t.formats, t.wording) ?? String(e);
758
+ ), Ti = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()).getTime(), Ri = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate() + 1).getTime(), Be = (e) => typeof e == "number" && Number.isFinite(e), ye = (e) => e instanceof Date && !Number.isNaN(e.getTime()), Oi = (e) => ye(e) ? Ti(e) : Be(e) ? e : void 0, Ei = (e) => ye(e) ? { value: Ri(e), open: !0 } : Be(e) ? { value: e, open: !1 } : void 0, Qe = (e, t) => ye(e) ? t.formats.date(e) : Ve(e, t.format, t.formats, t.wording) ?? String(e);
759
759
  function Mi({ condition: e, setCondition: t }) {
760
- const n = ie(), [o, r] = P(null), s = o !== null, l = o ? o.from : De(e?.from) ? e.from : null, i = o ? o.to : De(e?.to) ? e.to : null, c = (a, u) => {
761
- const d = { from: l, to: i, [a]: u };
760
+ const n = ie(), [o, r] = I(null), s = o !== null, i = o ? o.from : Be(e?.from) ? e.from : null, l = o ? o.to : Be(e?.to) ? e.to : null, c = (a, u) => {
761
+ const d = { from: i, to: l, [a]: u };
762
762
  if (d.from !== null && d.to !== null && d.from > d.to) {
763
763
  r(d);
764
764
  return;
@@ -772,9 +772,9 @@ function Mi({ condition: e, setCondition: t }) {
772
772
  ...d.to !== null ? { to: d.to } : {}
773
773
  });
774
774
  };
775
- return /* @__PURE__ */ R("div", { className: h.rangeFields, children: [
776
- /* @__PURE__ */ f(vt, { label: n.filterFrom, children: /* @__PURE__ */ f(yt, { size: "sm", value: l, invalid: s, onChange: (a) => c("from", a) }) }),
777
- /* @__PURE__ */ f(vt, { label: n.filterTo, error: s ? n.rangeInvalid : void 0, children: /* @__PURE__ */ f(yt, { size: "sm", value: i, onChange: (a) => c("to", a) }) })
775
+ return /* @__PURE__ */ T("div", { className: h.rangeFields, children: [
776
+ /* @__PURE__ */ f(vt, { label: n.filterFrom, children: /* @__PURE__ */ f(yt, { size: "sm", value: i, invalid: s, onChange: (a) => c("from", a) }) }),
777
+ /* @__PURE__ */ f(vt, { label: n.filterTo, error: s ? n.rangeInvalid : void 0, children: /* @__PURE__ */ f(yt, { size: "sm", value: l, onChange: (a) => c("to", a) }) })
778
778
  ] });
779
779
  }
780
780
  function Li({ condition: e, setCondition: t }) {
@@ -789,23 +789,23 @@ function Li({ condition: e, setCondition: t }) {
789
789
  }
790
790
  ) });
791
791
  }
792
- function qi(e) {
792
+ function Fi(e) {
793
793
  return e.kind === "date" ? /* @__PURE__ */ f(Li, { ...e }) : /* @__PURE__ */ f(Mi, { ...e });
794
794
  }
795
- const Fi = /* @__PURE__ */ Kn(
795
+ const Di = /* @__PURE__ */ Gn(
796
796
  {
797
797
  matches: (e, t) => {
798
- const n = ye(e) ? e.getTime() : De(e) ? e : void 0;
798
+ const n = ye(e) ? e.getTime() : Be(e) ? e : void 0;
799
799
  if (n === void 0) return !1;
800
800
  const o = Oi(t.from), r = Ei(t.to);
801
801
  return !(o !== void 0 && n < o || r !== void 0 && (r.open ? n >= r.value : n > r.value));
802
802
  },
803
- Input: qi,
803
+ Input: Fi,
804
804
  describe: (e) => [e.from, e.to].map((t) => t === void 0 ? "" : String(t)).join("–")
805
805
  },
806
806
  {
807
807
  isCondition: (e) => typeof e != "object" || e === null || Array.isArray(e) || e instanceof Date ? !1 : Object.entries(e).every(
808
- ([n, o]) => (n === "from" || n === "to") && (o === void 0 || De(o) || ye(o))
808
+ ([n, o]) => (n === "from" || n === "to") && (o === void 0 || Be(o) || ye(o))
809
809
  ),
810
810
  isEmpty: (e) => e.from === void 0 && e.to === void 0,
811
811
  absentMatches: () => !1,
@@ -875,13 +875,13 @@ const dn = (e) => JSON.stringify([
875
875
  /* Whether a column edits, and how - not its editor or its check, which
876
876
  are new functions on every render and are read when an edit starts. */
877
877
  typeof e.edit == "function" ? "ƒ" : e.edit
878
- ]), Di = (e, t) => e?.[t], un = (e, t) => {
878
+ ]), Bi = (e, t) => e?.[t], un = (e, t) => {
879
879
  const n = {
880
880
  key: e,
881
881
  spec: t,
882
882
  read: (o) => {
883
883
  const r = n.spec.value;
884
- return typeof r == "string" ? Di(o, r) : r(o);
884
+ return typeof r == "string" ? Bi(o, r) : r(o);
885
885
  }
886
886
  };
887
887
  return n;
@@ -896,7 +896,7 @@ function fn(e, t) {
896
896
  const n = ot(e.value, t.value) ? e.value : t.value, o = ot(e.ownSortValue, t.ownSortValue) ? e.ownSortValue : t.ownSortValue, r = ot(e.ownGroupValue, t.ownGroupValue) ? e.ownGroupValue : t.ownGroupValue;
897
897
  return n === t.value && o === t.ownSortValue && r === t.ownGroupValue ? t : { ...t, value: n, ownSortValue: o, ownGroupValue: r };
898
898
  }
899
- class Bi {
899
+ class Vi {
900
900
  columns = new wt("data-umriss-column");
901
901
  actions = new wt("data-umriss-action");
902
902
  /** The group keys: values to group by that are no column. */
@@ -1081,7 +1081,7 @@ class Bi {
1081
1081
  each once. */
1082
1082
  effectiveGrouping(t, n) {
1083
1083
  const o = new Set(this.groupingEntries(n).map((r) => r.spec.id));
1084
- return [...new Set(t)].filter((r) => o.has(r)).slice(0, zt);
1084
+ return [...new Set(t)].filter((r) => o.has(r)).slice(0, Kt);
1085
1085
  }
1086
1086
  groupingCache = null;
1087
1087
  /** The levels and aggregates for the model - the same identity as long as
@@ -1089,26 +1089,26 @@ class Bi {
1089
1089
  groupingModel(t, n) {
1090
1090
  const o = [t.join("|"), this.structure, this.values].join(":");
1091
1091
  if (this.groupingCache?.key === o) return this.groupingCache;
1092
- const r = this.groupingEntries(n), s = t.map((i) => r.find((c) => c.spec.id === i)).filter((i) => i !== void 0).map((i) => ({
1093
- id: i.spec.id,
1092
+ const r = this.groupingEntries(n), s = t.map((l) => r.find((c) => c.spec.id === l)).filter((l) => l !== void 0).map((l) => ({
1093
+ id: l.spec.id,
1094
1094
  value: (c) => {
1095
- const a = i.read(c);
1095
+ const a = l.read(c);
1096
1096
  if (a == null) return;
1097
- const { ownGroupValue: u, group: d } = i.spec;
1098
- return u ? u(a) : d ? jo(d)(a) : a;
1097
+ const { ownGroupValue: u, group: d } = l.spec;
1098
+ return u ? u(a) : d ? Ho(d)(a) : a;
1099
1099
  },
1100
1100
  /* A value of one's own is a name; its groups stand by what they hold. */
1101
- order: i.spec.ownGroupValue ? (c) => kt(i.read(c), i.spec.ownSortValue) : void 0
1102
- })), l = this.orderedColumns().filter((i) => i.spec.aggregate !== void 0).map(
1103
- (i) => ({
1104
- id: i.spec.id,
1105
- read: i.read,
1101
+ order: l.spec.ownGroupValue ? (c) => kt(l.read(c), l.spec.ownSortValue) : void 0
1102
+ })), i = this.orderedColumns().filter((l) => l.spec.aggregate !== void 0).map(
1103
+ (l) => ({
1104
+ id: l.spec.id,
1105
+ read: l.read,
1106
1106
  /* Read with the latest spec on every call: an aggregate of one's own
1107
1107
  written in the call is a new function on every render. */
1108
- aggregate: typeof i.spec.aggregate == "function" ? (c, a) => i.spec.aggregate(c, a) : i.spec.aggregate
1108
+ aggregate: typeof l.spec.aggregate == "function" ? (c, a) => l.spec.aggregate(c, a) : l.spec.aggregate
1109
1109
  })
1110
1110
  );
1111
- return this.groupingCache = { key: o, levels: s, aggregates: l }, this.groupingCache;
1111
+ return this.groupingCache = { key: o, levels: s, aggregates: i }, this.groupingCache;
1112
1112
  }
1113
1113
  /** The grouping for the body's own pass: resolved against the columns of
1114
1114
  this pass, so that even the first frame stands grouped. */
@@ -1140,22 +1140,22 @@ class Bi {
1140
1140
  that the model reads - that is how the body recognises whether it may take
1141
1141
  over the hook's calculation. */
1142
1142
  modelColumns(t, n) {
1143
- const o = this.orderedColumns(), r = [this.structure, this.values, o.map((l) => l.key).join("|")].join(":");
1143
+ const o = this.orderedColumns(), r = [this.structure, this.values, o.map((i) => i.key).join("|")].join(":");
1144
1144
  if (this.modelCache?.key === r && this.modelCache.rows === t && this.modelCache.formats === n)
1145
1145
  return this.modelCache.columns;
1146
- const s = o.map((l) => {
1147
- const { spec: i } = l, c = this.kindOf(l, t), a = this.isSortable(l, t), u = i.searchable ?? c === "text", d = (m) => kt(l.read(m), i.ownSortValue);
1146
+ const s = o.map((i) => {
1147
+ const { spec: l } = i, c = this.kindOf(i, t), a = this.isSortable(i, t), u = l.searchable ?? c === "text", d = (b) => kt(i.read(b), l.ownSortValue);
1148
1148
  return {
1149
- id: i.id,
1150
- label: i.label,
1149
+ id: l.id,
1150
+ label: l.label,
1151
1151
  value: a || u ? d : void 0,
1152
1152
  /* Text sorts with the provider's comparison, not with the built-in
1153
1153
  German one (spec, the table of defaults). */
1154
- compare: c === "text" && !i.ownSortValue ? (m, b) => n.compareText(String(d(m)), String(d(b))) : void 0,
1154
+ compare: c === "text" && !l.ownSortValue ? (b, p) => n.compareText(String(d(b)), String(d(p))) : void 0,
1155
1155
  searchable: u,
1156
- hideable: !i.rowHeader,
1157
- resizable: i.resizable,
1158
- width: i.width
1156
+ hideable: !l.rowHeader,
1157
+ resizable: l.resizable,
1158
+ width: l.width
1159
1159
  };
1160
1160
  });
1161
1161
  return this.modelCache = { key: r, rows: t, formats: n, columns: s }, s;
@@ -1189,8 +1189,8 @@ class Bi {
1189
1189
  grouping: this.groupingFor(t),
1190
1190
  server: o.server,
1191
1191
  tree: t.tree
1192
- }, s = $n(t.admitted, n, r), l = o.virtual ? zn(s, o.virtual.from, o.virtual.to) : s;
1193
- return this.projectionCache = { hook: t, columns: n, projection: l }, l;
1192
+ }, s = zn(t.admitted, n, r), i = o.virtual ? Kn(s, o.virtual.from, o.virtual.to) : s;
1193
+ return this.projectionCache = { hook: t, columns: n, projection: i }, i;
1194
1194
  }
1195
1195
  /* --- The hook's snapshot ---------------------------------------------------------- */
1196
1196
  /** The hook deposits its snapshot during the render. Idempotent for the same
@@ -1277,20 +1277,20 @@ class Bi {
1277
1277
  this.actions.entries.delete(t) && this.structure++;
1278
1278
  }
1279
1279
  }
1280
- const Hn = /* @__PURE__ */ new WeakMap(), Vi = (e, t) => {
1281
- Hn.set(e, t);
1282
- }, Pi = (e) => typeof e == "function" || typeof e == "object" && e !== null ? Hn.get(e) : void 0, F = (...e) => e.filter(Boolean).join(" "), Wn = { separator: ",", decimal: ".", yes: "yes", no: "no" }, Ii = `\r
1283
- `, $i = "\uFEFF", Yn = (e, t) => typeof e == "number" ? String(e).replace(".", t.decimal) : typeof e == "boolean" ? e ? t.yes : t.no : e, Un = (e, t) => e.includes(t) || /["\r\n]/.test(e) ? `"${e.replace(/"/g, '""')}"` : e, zi = (e, t, n) => {
1280
+ const Wn = /* @__PURE__ */ new WeakMap(), Pi = (e, t) => {
1281
+ Wn.set(e, t);
1282
+ }, Ii = (e) => typeof e == "function" || typeof e == "object" && e !== null ? Wn.get(e) : void 0, D = (...e) => e.filter(Boolean).join(" "), qn = { separator: ",", decimal: ".", yes: "yes", no: "no" }, $i = `\r
1283
+ `, zi = "\uFEFF", Yn = (e, t) => typeof e == "number" ? String(e).replace(".", t.decimal) : typeof e == "boolean" ? e ? t.yes : t.no : e, Un = (e, t) => e.includes(t) || /["\r\n]/.test(e) ? `"${e.replace(/"/g, '""')}"` : e, Ki = (e, t, n) => {
1284
1284
  const o = t.value?.(e);
1285
1285
  return o == null ? "" : Un(Yn(o, n), n.separator);
1286
1286
  }, Jn = (e, t, n) => [
1287
1287
  t.map((o) => Un(o.label ?? o.id, n.separator)).join(n.separator),
1288
- ...e.map((o) => t.map((r) => zi(o, r, n)).join(n.separator))
1288
+ ...e.map((o) => t.map((r) => Ki(o, r, n)).join(n.separator))
1289
1289
  ];
1290
- function hn(e, t, n = Wn) {
1291
- return $i + Jn(e, t, n).join(Ii);
1290
+ function hn(e, t, n = qn) {
1291
+ return zi + Jn(e, t, n).join($i);
1292
1292
  }
1293
- function Ki(e, t, n = Wn) {
1293
+ function Gi(e, t, n = qn) {
1294
1294
  return Jn(e, t, { ...n, separator: " " }).join(`
1295
1295
  `);
1296
1296
  }
@@ -1302,7 +1302,7 @@ function Qn(e) {
1302
1302
  e.setSearch("");
1303
1303
  for (const t of Object.keys(e.filter)) e.setFilter(t, null);
1304
1304
  }
1305
- function Gt(e, t) {
1305
+ function jt(e, t) {
1306
1306
  const { decimal: n } = Eo(e);
1307
1307
  return {
1308
1308
  separator: n === "," ? ";" : ",",
@@ -1316,17 +1316,17 @@ function Zn(e, t) {
1316
1316
  (n) => ({
1317
1317
  id: n.spec.id,
1318
1318
  label: n.spec.label,
1319
- value: (o) => Pt(n.read(o), n.spec.ownExportValue)
1319
+ value: (o) => It(n.read(o), n.spec.ownExportValue)
1320
1320
  })
1321
1321
  );
1322
1322
  }
1323
- function Gi(e, t, n, o) {
1323
+ function ji(e, t, n, o) {
1324
1324
  const r = e.hook;
1325
1325
  if (!r) return "";
1326
- const s = Zn(e, r.rows), l = Gt(n, o), { exported: i, filtered: c } = e.projection();
1327
- if (!i) return hn(c, s, l);
1328
- const a = new Map(i.map((d) => [d.node, d.level + 1])), u = { id: "#level", label: t, value: (d) => a.get(d) };
1329
- return hn(i.map((d) => d.node), [u, ...s], l);
1326
+ const s = Zn(e, r.rows), i = jt(n, o), { exported: l, filtered: c } = e.projection();
1327
+ if (!l) return hn(c, s, i);
1328
+ const a = new Map(l.map((d) => [d.node, d.level + 1])), u = { id: "#level", label: t, value: (d) => a.get(d) };
1329
+ return hn(l.map((d) => d.node), [u, ...s], i);
1330
1330
  }
1331
1331
  function eo(e) {
1332
1332
  const t = e.hook;
@@ -1336,14 +1336,14 @@ function eo(e) {
1336
1336
  }
1337
1337
  function to(e, t, n) {
1338
1338
  const o = e.hook, r = eo(e);
1339
- return !o || r.length === 0 ? "" : Ki(r, Zn(e, o.rows), Gt(t, n));
1339
+ return !o || r.length === 0 ? "" : Gi(r, Zn(e, o.rows), jt(t, n));
1340
1340
  }
1341
- function ji(e, t, n, o) {
1341
+ function Hi(e, t, n, o) {
1342
1342
  return no(e, e.read(t), n, o);
1343
1343
  }
1344
1344
  function no(e, t, n, o) {
1345
- const r = Pt(t, e.spec.ownExportValue);
1346
- return r === void 0 ? "" : Yn(r, Gt(n, o));
1345
+ const r = It(t, e.spec.ownExportValue);
1346
+ return r === void 0 ? "" : Yn(r, jt(n, o));
1347
1347
  }
1348
1348
  function oo({
1349
1349
  entry: e,
@@ -1352,30 +1352,30 @@ function oo({
1352
1352
  anchor: o,
1353
1353
  align: r,
1354
1354
  focus: s,
1355
- open: l,
1356
- setOpen: i,
1355
+ open: i,
1356
+ setOpen: l,
1357
1357
  panelId: c
1358
1358
  }) {
1359
- const a = ie(), u = ke(), { id: d, label: m, format: b } = e.spec, { filterOptions: p } = n, w = p?.(d), { values: g, absent: v } = j(
1360
- () => w ? At(w, (x) => x, u) : At(n.admitted, e.read, u),
1359
+ const a = ie(), u = ke(), { id: d, label: b, format: p } = e.spec, { filterOptions: m } = n, w = m?.(d), { values: g, absent: v } = H(
1360
+ () => w ? At(w, (A) => A, u) : At(n.admitted, e.read, u),
1361
1361
  [w, n.admitted, e, u]
1362
- ), A = Ee(e.spec.filter);
1362
+ ), x = Ee(e.spec.filter);
1363
1363
  if (n.publicSnapshot.server && !w && e.spec.filter === "list" && X(
1364
1364
  `server-filter-options:${d}`,
1365
1365
  `The list filter of "${d}" offers only the values of the page in server mode; \`filterOptions\` gives it the server's.`
1366
- ), !A) return null;
1367
- const y = n.publicSnapshot, _ = A.Input, S = Si(A) ? { absentOccurs: v, format: b, kind: t.kindOf(e, n.rows) } : {}, C = () => {
1368
- i(!1), (s ?? o).current?.focus();
1366
+ ), !x) return null;
1367
+ const y = n.publicSnapshot, _ = x.Input, S = Si(x) ? { absentOccurs: v, format: p, kind: t.kindOf(e, n.rows) } : {}, C = () => {
1368
+ l(!1), (s ?? o).current?.focus();
1369
1369
  };
1370
- return /* @__PURE__ */ R(
1370
+ return /* @__PURE__ */ T(
1371
1371
  it,
1372
1372
  {
1373
- open: l,
1374
- onOpenChange: i,
1373
+ open: i,
1374
+ onOpenChange: l,
1375
1375
  anchorRef: o,
1376
1376
  align: r,
1377
1377
  role: "dialog",
1378
- ariaLabel: a.filterColumn(m),
1378
+ ariaLabel: a.filterColumn(b),
1379
1379
  id: c,
1380
1380
  className: h.filterPanel,
1381
1381
  children: [
@@ -1383,13 +1383,13 @@ function oo({
1383
1383
  _,
1384
1384
  {
1385
1385
  condition: y.filter[d] ?? null,
1386
- setCondition: (x) => y.setFilter(d, x),
1386
+ setCondition: (A) => y.setFilter(d, A),
1387
1387
  values: g,
1388
- column: { id: d, label: m },
1388
+ column: { id: d, label: b },
1389
1389
  ...S
1390
1390
  }
1391
1391
  ),
1392
- /* @__PURE__ */ R("div", { className: h.filterFooter, children: [
1392
+ /* @__PURE__ */ T("div", { className: h.filterFooter, children: [
1393
1393
  /* @__PURE__ */ f(Q, { size: "sm", variant: "ghost", onClick: () => y.setFilter(d, null), children: a.filterReset }),
1394
1394
  /* @__PURE__ */ f(Q, { size: "sm", onClick: C, children: a.filterDone })
1395
1395
  ] })
@@ -1397,24 +1397,24 @@ function oo({
1397
1397
  }
1398
1398
  );
1399
1399
  }
1400
- function Hi({
1400
+ function Wi({
1401
1401
  entry: e,
1402
1402
  registry: t,
1403
1403
  hook: n
1404
1404
  }) {
1405
- const o = ie(), [r, s] = P(!1), l = W(null), i = be(), { id: c, label: a } = e.spec, u = c in n.publicSnapshot.filter;
1406
- return /* @__PURE__ */ R(re, { children: [
1405
+ const o = ie(), [r, s] = I(!1), i = q(null), l = be(), { id: c, label: a } = e.spec, u = c in n.publicSnapshot.filter;
1406
+ return /* @__PURE__ */ T(re, { children: [
1407
1407
  /* @__PURE__ */ f(tt, { content: o.filterHint, children: /* @__PURE__ */ f(
1408
1408
  "button",
1409
1409
  {
1410
1410
  type: "button",
1411
- className: F(h.filterButton, u && h.filterActive),
1411
+ className: D(h.filterButton, u && h.filterActive),
1412
1412
  "aria-label": o.filterColumn(a),
1413
1413
  "aria-haspopup": "dialog",
1414
1414
  "aria-expanded": r,
1415
- "aria-controls": r ? i : void 0,
1415
+ "aria-controls": r ? l : void 0,
1416
1416
  onClick: (d) => {
1417
- l.current = d.currentTarget, s(!r);
1417
+ i.current = d.currentTarget, s(!r);
1418
1418
  },
1419
1419
  children: /* @__PURE__ */ f("svg", { viewBox: "0 0 14 14", width: "13", height: "13", "aria-hidden": "true", children: /* @__PURE__ */ f(
1420
1420
  "path",
@@ -1435,27 +1435,27 @@ function Hi({
1435
1435
  entry: e,
1436
1436
  registry: t,
1437
1437
  hook: n,
1438
- anchor: l,
1438
+ anchor: i,
1439
1439
  align: "end",
1440
1440
  open: r,
1441
1441
  setOpen: s,
1442
- panelId: i
1442
+ panelId: l
1443
1443
  }
1444
1444
  )
1445
1445
  ] });
1446
1446
  }
1447
- function Wi({ registry: e, hook: t }) {
1448
- const n = ie(), o = ke(), r = Object.entries(t.publicSnapshot.filter).flatMap(([s, l]) => {
1449
- const i = t.rowFilters.get(s);
1450
- if (i) return i.describe ? [{ id: s, rowFilter: i, text: i.describe(l) }] : [];
1447
+ function qi({ registry: e, hook: t }) {
1448
+ const n = ie(), o = ke(), r = Object.entries(t.publicSnapshot.filter).flatMap(([s, i]) => {
1449
+ const l = t.rowFilters.get(s);
1450
+ if (l) return l.describe ? [{ id: s, rowFilter: l, text: l.describe(i) }] : [];
1451
1451
  const c = e.columnById(s), a = c ? Ee(c.spec.filter) : void 0;
1452
1452
  if (!c || !a) return [];
1453
1453
  const u = { formats: o, wording: n, format: c.spec.format, kind: e.kindOf(c, t.rows) };
1454
- return [{ id: s, entry: c, text: xi(a, l, u) }];
1454
+ return [{ id: s, entry: c, text: xi(a, i, u) }];
1455
1455
  });
1456
1456
  return r.length === 0 ? null : /* @__PURE__ */ f(An, { "aria-label": n.conditions, className: h.conditions, children: r.map(
1457
- (s) => "rowFilter" in s ? /* @__PURE__ */ R(
1458
- Bt,
1457
+ (s) => "rowFilter" in s ? /* @__PURE__ */ T(
1458
+ Vt,
1459
1459
  {
1460
1460
  className: h.condition,
1461
1461
  onRemove: () => t.publicSnapshot.setFilter(s.id, null),
@@ -1475,16 +1475,16 @@ function Yi({
1475
1475
  registry: n,
1476
1476
  hook: o
1477
1477
  }) {
1478
- const r = ie(), [s, l] = P(!1), i = W(null), c = W(null), a = be(), { id: u, label: d } = e.spec;
1479
- return /* @__PURE__ */ R(re, { children: [
1478
+ const r = ie(), [s, i] = I(!1), l = q(null), c = q(null), a = be(), { id: u, label: d } = e.spec;
1479
+ return /* @__PURE__ */ T(re, { children: [
1480
1480
  /* @__PURE__ */ f(
1481
- Bt,
1481
+ Vt,
1482
1482
  {
1483
- ref: i,
1483
+ ref: l,
1484
1484
  className: h.condition,
1485
1485
  onRemove: () => o.publicSnapshot.setFilter(u, null),
1486
1486
  removeLabel: r.removeConditionNamed(d, t),
1487
- children: /* @__PURE__ */ R(
1487
+ children: /* @__PURE__ */ T(
1488
1488
  "button",
1489
1489
  {
1490
1490
  ref: c,
@@ -1494,7 +1494,7 @@ function Yi({
1494
1494
  "aria-haspopup": "dialog",
1495
1495
  "aria-expanded": s,
1496
1496
  "aria-controls": s ? a : void 0,
1497
- onClick: () => l(!s),
1497
+ onClick: () => i(!s),
1498
1498
  children: [
1499
1499
  /* @__PURE__ */ f("span", { className: h.filterLabel, children: d }),
1500
1500
  /* @__PURE__ */ f("span", { className: h.filterValue, children: t })
@@ -1509,11 +1509,11 @@ function Yi({
1509
1509
  entry: e,
1510
1510
  registry: n,
1511
1511
  hook: o,
1512
- anchor: i,
1512
+ anchor: l,
1513
1513
  align: "start",
1514
1514
  focus: c,
1515
1515
  open: s,
1516
- setOpen: l,
1516
+ setOpen: i,
1517
1517
  panelId: a
1518
1518
  }
1519
1519
  )
@@ -1524,25 +1524,25 @@ function Ji({ registry: e, hook: t }) {
1524
1524
  const n = ie(), o = e.groupingEntries(t.rows);
1525
1525
  if (o.length === 0) return null;
1526
1526
  const { grouping: r, setGrouping: s } = t.publicSnapshot;
1527
- return /* @__PURE__ */ R("section", { className: h.groupingChoice, "aria-label": n.grouping, children: [
1527
+ return /* @__PURE__ */ T("section", { className: h.groupingChoice, "aria-label": n.grouping, children: [
1528
1528
  /* @__PURE__ */ f("h3", { className: h.groupingHeading, children: n.grouping }),
1529
- /* @__PURE__ */ f("div", { className: h.groupingOptions, children: o.map((l) => {
1530
- const { id: i, label: c } = l.spec, a = r.indexOf(i), u = a !== -1;
1531
- return /* @__PURE__ */ R(
1529
+ /* @__PURE__ */ f("div", { className: h.groupingOptions, children: o.map((i) => {
1530
+ const { id: l, label: c } = i.spec, a = r.indexOf(l), u = a !== -1;
1531
+ return /* @__PURE__ */ T(
1532
1532
  "button",
1533
1533
  {
1534
1534
  type: "button",
1535
1535
  className: h.groupingOption,
1536
1536
  "aria-label": n.groupBy(c),
1537
1537
  "aria-pressed": u,
1538
- disabled: !u && r.length >= zt,
1539
- onClick: () => s(u ? r.filter((d) => d !== i) : [...r, i]),
1538
+ disabled: !u && r.length >= Kt,
1539
+ onClick: () => s(u ? r.filter((d) => d !== l) : [...r, l]),
1540
1540
  children: [
1541
1541
  u && /* @__PURE__ */ f("span", { className: h.groupingLevel, "aria-hidden": "true", children: a + 1 }),
1542
1542
  c
1543
1543
  ]
1544
1544
  },
1545
- i
1545
+ l
1546
1546
  );
1547
1547
  }) })
1548
1548
  ] });
@@ -1551,7 +1551,7 @@ function Xi({ registry: e, hook: t }) {
1551
1551
  const n = ie();
1552
1552
  if (!e.tree) return null;
1553
1553
  const o = t.publicSnapshot;
1554
- return /* @__PURE__ */ R("div", { className: F(h.groupingChoice, h.groupingOptions), children: [
1554
+ return /* @__PURE__ */ T("div", { className: D(h.groupingChoice, h.groupingOptions), children: [
1555
1555
  /* @__PURE__ */ f("button", { type: "button", className: h.groupingOption, onClick: o.unfoldAllBranches, children: n.unfoldAll }),
1556
1556
  /* @__PURE__ */ f("button", { type: "button", className: h.groupingOption, onClick: o.foldAllBranches, children: n.foldAll })
1557
1557
  ] });
@@ -1559,22 +1559,22 @@ function Xi({ registry: e, hook: t }) {
1559
1559
  function Qi({ registry: e, hook: t }) {
1560
1560
  const n = ie(), o = t.publicSnapshot, { grouping: r } = o;
1561
1561
  if (r.length === 0) return null;
1562
- const s = r.map((l) => Ui(e, t, l));
1562
+ const s = r.map((i) => Ui(e, t, i));
1563
1563
  return (
1564
1564
  /* In a tag group, as the conditions stand: the tag is one stop, its button
1565
1565
  the thing one tabs to, and the ring stands on the tag. */
1566
- /* @__PURE__ */ f(An, { "aria-label": n.groupedBy, className: h.groupingTag, children: /* @__PURE__ */ f(Bt, { onRemove: () => o.setGrouping([]), removeLabel: n.removeGrouping, children: /* @__PURE__ */ R(
1566
+ /* @__PURE__ */ f(An, { "aria-label": n.groupedBy, className: h.groupingTag, children: /* @__PURE__ */ f(Vt, { onRemove: () => o.setGrouping([]), removeLabel: n.removeGrouping, children: /* @__PURE__ */ T(
1567
1567
  Nn,
1568
1568
  {
1569
- trigger: /* @__PURE__ */ R("button", { type: "button", className: F(h.conditionButton, h.groupingTrigger), children: [
1569
+ trigger: /* @__PURE__ */ T("button", { type: "button", className: D(h.conditionButton, h.groupingTrigger), children: [
1570
1570
  /* @__PURE__ */ f("span", { className: h.groupingPrefix, children: n.groupedBy }),
1571
- s.map((l, i) => /* @__PURE__ */ R("span", { className: h.groupingPath, children: [
1572
- i > 0 && /* @__PURE__ */ f("span", { className: h.groupingSeparator, "aria-hidden": "true", children: "›" }),
1573
- l
1574
- ] }, r[i]))
1571
+ s.map((i, l) => /* @__PURE__ */ T("span", { className: h.groupingPath, children: [
1572
+ l > 0 && /* @__PURE__ */ f("span", { className: h.groupingSeparator, "aria-hidden": "true", children: "›" }),
1573
+ i
1574
+ ] }, r[l]))
1575
1575
  ] }),
1576
1576
  children: [
1577
- r.map((l, i) => /* @__PURE__ */ f(nt, { onSelect: () => o.setGrouping(r.filter((c) => c !== l)), children: n.removeGroupingLevel(s[i]) }, l)),
1577
+ r.map((i, l) => /* @__PURE__ */ f(nt, { onSelect: () => o.setGrouping(r.filter((c) => c !== i)), children: n.removeGroupingLevel(s[l]) }, i)),
1578
1578
  /* @__PURE__ */ f(Mo, {}),
1579
1579
  /* @__PURE__ */ f(nt, { onSelect: o.unfoldAll, children: n.unfoldAll }),
1580
1580
  /* @__PURE__ */ f(nt, { onSelect: o.foldAll, children: n.foldAll })
@@ -1599,29 +1599,29 @@ function io({
1599
1599
  own: o = !1,
1600
1600
  size: r = "sm"
1601
1601
  }) {
1602
- const s = ie(), l = ke(), i = e?.hook ?? null;
1602
+ const s = ie(), i = ke(), l = e?.hook ?? null;
1603
1603
  let c = null, a = null;
1604
- if (e && i) {
1605
- const u = i.publicSnapshot, d = u.search !== "" || Object.keys(u.filter).length > 0, m = o || u.selection.count === 0 ? [] : i.selectedRows ?? u.filtered.filter((w) => u.selection.isSelected(i.rowKey(w))), b = e.hasRowActions() ? e.actions.ordered().filter((w) => w.spec.bulk) : [];
1606
- c = /* @__PURE__ */ R(re, { children: [
1607
- /* @__PURE__ */ f(Qi, { registry: e, hook: i }),
1608
- /* @__PURE__ */ f(Wi, { registry: e, hook: i })
1604
+ if (e && l) {
1605
+ const u = l.publicSnapshot, d = u.search !== "" || Object.keys(u.filter).length > 0, b = o || u.selection.count === 0 ? [] : l.selectedRows ?? u.filtered.filter((w) => u.selection.isSelected(l.rowKey(w))), p = e.hasRowActions() ? e.actions.ordered().filter((w) => w.spec.bulk) : [];
1606
+ c = /* @__PURE__ */ T(re, { children: [
1607
+ /* @__PURE__ */ f(Qi, { registry: e, hook: l }),
1608
+ /* @__PURE__ */ f(qi, { registry: e, hook: l })
1609
1609
  ] });
1610
- const p = !d && m.length === 0 && !e.rowAdding;
1611
- a = /* @__PURE__ */ R("div", { className: F(h.toolbarGroup, p && h.toolbarGroupIdle), children: [
1610
+ const m = !d && b.length === 0 && !e.rowAdding;
1611
+ a = /* @__PURE__ */ T("div", { className: D(h.toolbarGroup, m && h.toolbarGroupIdle), children: [
1612
1612
  /* @__PURE__ */ f("span", { role: "status", className: h.filteredCount, children: d ? u.server ? (
1613
1613
  /* The server counts the matches only; a total beside them would be a second request. */
1614
- s.entries(u.rowCount, l.count(u.rowCount))
1615
- ) : s.filteredOfTotal(l.count(u.filtered.length), l.count(i.tableState.total ?? i.admitted.length)) : "" }),
1614
+ s.entries(u.rowCount, i.count(u.rowCount))
1615
+ ) : s.filteredOfTotal(i.count(u.filtered.length), i.count(l.tableState.total ?? l.admitted.length)) : "" }),
1616
1616
  d && /* @__PURE__ */ f(Q, { size: r, variant: "ghost", onClick: () => Qn(u), children: s.resetAll }),
1617
- m.length > 0 && /* @__PURE__ */ R(re, { children: [
1618
- /* @__PURE__ */ f("span", { className: h.toolbarInfo, children: s.selectedCount(m.length, l.count(m.length)) }),
1619
- b.map(({ key: w, spec: g }) => /* @__PURE__ */ f(
1617
+ b.length > 0 && /* @__PURE__ */ T(re, { children: [
1618
+ /* @__PURE__ */ f("span", { className: h.toolbarInfo, children: s.selectedCount(b.length, i.count(b.length)) }),
1619
+ p.map(({ key: w, spec: g }) => /* @__PURE__ */ f(
1620
1620
  Q,
1621
1621
  {
1622
1622
  size: r,
1623
1623
  variant: g.tone === "danger" ? "danger" : "secondary",
1624
- onClick: () => g.onSelect(m),
1624
+ onClick: () => g.onSelect(b),
1625
1625
  children: g.label
1626
1626
  },
1627
1627
  w
@@ -1630,18 +1630,18 @@ function io({
1630
1630
  e.rowAdding && /* @__PURE__ */ f(so, { registry: e })
1631
1631
  ] });
1632
1632
  }
1633
- return /* @__PURE__ */ f(ro, { value: r, children: /* @__PURE__ */ f(Rn, { size: r, children: /* @__PURE__ */ R("div", { className: F(h.toolbar, r === "md" && h.toolbarMd, t), children: [
1634
- /* @__PURE__ */ R("div", { className: h.toolbarGroup, children: [
1633
+ return /* @__PURE__ */ f(ro, { value: r, children: /* @__PURE__ */ f(Tn, { size: r, children: /* @__PURE__ */ T("div", { className: D(h.toolbar, r === "md" && h.toolbarMd, t), children: [
1634
+ /* @__PURE__ */ T("div", { className: h.toolbarGroup, children: [
1635
1635
  n,
1636
1636
  c
1637
1637
  ] }),
1638
1638
  a
1639
1639
  ] }) }) });
1640
1640
  }
1641
- const Tt = /* @__PURE__ */ rt(null), Zi = () => () => {
1641
+ const Rt = /* @__PURE__ */ rt(null), Zi = () => () => {
1642
1642
  }, gn = () => 0;
1643
1643
  function Ye(e) {
1644
- const t = _e(Tt), n = e ? Pi(e.Table) ?? null : t?.registry ?? null;
1644
+ const t = _e(Rt), n = e ? Ii(e.Table) ?? null : t?.registry ?? null;
1645
1645
  st(
1646
1646
  n ? n.subscribe : Zi,
1647
1647
  n ? n.bodyVersion : gn,
@@ -1669,32 +1669,32 @@ const tl = (e) => {
1669
1669
  return t;
1670
1670
  };
1671
1671
  function nl(e, t) {
1672
- const n = W(null);
1673
- te(() => {
1672
+ const n = q(null);
1673
+ Z(() => {
1674
1674
  const o = e.current;
1675
1675
  if (!o) return;
1676
1676
  const r = tl(o), s = n.current;
1677
1677
  if (n.current = { trigger: t, positions: r }, !s || s.trigger === t) return;
1678
- const l = lo(o, "--u-duration-medium");
1679
- if (l === 0 || typeof o.animate != "function") return;
1680
- const i = getComputedStyle(o).getPropertyValue("--u-ease-out").trim() || "ease-out", c = el(s.positions, r);
1678
+ const i = lo(o, "--u-duration-medium");
1679
+ if (i === 0 || typeof o.animate != "function") return;
1680
+ const l = getComputedStyle(o).getPropertyValue("--u-ease-out").trim() || "ease-out", c = el(s.positions, r);
1681
1681
  for (const a of Array.from(o.querySelectorAll("tbody > tr[data-motion]"))) {
1682
1682
  const u = a.dataset.motion, d = c.get(u);
1683
- d !== void 0 ? a.animate([{ transform: `translateY(${d}px)` }, { transform: "none" }], { duration: l, easing: i }) : s.positions.has(u) || a.animate([{ opacity: 0, transform: "translateY(-4px)" }, { opacity: 1, transform: "none" }], { duration: l, easing: i });
1683
+ d !== void 0 ? a.animate([{ transform: `translateY(${d}px)` }, { transform: "none" }], { duration: i, easing: l }) : s.positions.has(u) || a.animate([{ opacity: 0, transform: "translateY(-4px)" }, { opacity: 1, transform: "none" }], { duration: i, easing: l });
1684
1684
  }
1685
1685
  });
1686
1686
  }
1687
1687
  function ol(e, t, n) {
1688
- const o = W(t);
1689
- te(() => {
1688
+ const o = q(t);
1689
+ Z(() => {
1690
1690
  const r = e.current, s = o.current;
1691
1691
  if (o.current = t, !r || s === t || typeof r.animate != "function") return;
1692
- const l = lo(r, "--u-duration-medium");
1693
- if (l === 0) return;
1694
- const i = performance.now();
1692
+ const i = lo(r, "--u-duration-medium");
1693
+ if (i === 0) return;
1694
+ const l = performance.now();
1695
1695
  let c = requestAnimationFrame(function a(u) {
1696
- const d = Math.min(1, (u - i) / l), m = 1 - (1 - d) ** 3;
1697
- r.textContent = n(Math.round(s + (t - s) * m)), d < 1 && (c = requestAnimationFrame(a));
1696
+ const d = Math.min(1, (u - l) / i), b = 1 - (1 - d) ** 3;
1697
+ r.textContent = n(Math.round(s + (t - s) * b)), d < 1 && (c = requestAnimationFrame(a));
1698
1698
  });
1699
1699
  return () => {
1700
1700
  cancelAnimationFrame(c), r.textContent = n(t);
@@ -1703,7 +1703,7 @@ function ol(e, t, n) {
1703
1703
  }
1704
1704
  const rl = (e) => e.controls + (e.span ? 1 : 0) + e.aggregates.length + (e.actions ? 1 : 0);
1705
1705
  function ao(e) {
1706
- const { controls: t, span: n, aggregates: o, actions: r, blocks: s } = e, l = o.length, i = o.indexOf(!0), c = s.end > 0 ? s.end - (r ? 1 : 0) : 0, a = Math.max(n || l === 0 ? 0 : 1, Math.min(i === -1 ? l : i, l - c)), u = t + (n ? 1 : 0), d = s.start > 0 ? s.start - u : 0;
1706
+ const { controls: t, span: n, aggregates: o, actions: r, blocks: s } = e, i = o.length, l = o.indexOf(!0), c = s.end > 0 ? s.end - (r ? 1 : 0) : 0, a = Math.max(n || i === 0 ? 0 : 1, Math.min(l === -1 ? i : l, i - c)), u = t + (n ? 1 : 0), d = s.start > 0 ? s.start - u : 0;
1707
1707
  return {
1708
1708
  lead: a,
1709
1709
  labelColumns: s.start > 0 ? Math.min(a, d) : a,
@@ -1714,18 +1714,18 @@ function bt(e, t) {
1714
1714
  const n = rl(t);
1715
1715
  if (e === "cells") return Array.from({ length: n }, () => 1);
1716
1716
  if (e === "whole") return [n];
1717
- const { lead: o, labelColumns: r, countColumns: s } = ao(t), l = Array.from({ length: t.controls }, () => 1), i = Array.from({ length: t.aggregates.length - o + (t.actions ? 1 : 0) }, () => 1), c = (a) => o - a > 0 ? [o - a] : [];
1718
- return e === "header" ? [...l, (t.span ? 1 : 0) + r, ...c(r), ...i] : [...l, 1, ...s > 0 ? [s] : [], ...c(s), ...i];
1717
+ const { lead: o, labelColumns: r, countColumns: s } = ao(t), i = Array.from({ length: t.controls }, () => 1), l = Array.from({ length: t.aggregates.length - o + (t.actions ? 1 : 0) }, () => 1), c = (a) => o - a > 0 ? [o - a] : [];
1718
+ return e === "header" ? [...i, (t.span ? 1 : 0) + r, ...c(r), ...l] : [...i, 1, ...s > 0 ? [s] : [], ...c(s), ...l];
1719
1719
  }
1720
1720
  const Ue = (e) => `row:${e}`;
1721
1721
  function sl({ layout: e, body: t, rowKey: n, expanded: o, foot: r }) {
1722
- const s = bt("cells", e), l = bt("whole", e), i = [{ key: "head", cells: s, at: -1 }], c = (a, u) => {
1722
+ const s = bt("cells", e), i = bt("whole", e), l = [{ key: "head", cells: s, at: -1 }], c = (a, u) => {
1723
1723
  const d = n(a);
1724
- i.push({ key: Ue(d), cells: s, at: u, row: a }), o.has(d) && i.push({ key: `detail:${d}`, cells: l, at: u, row: a });
1724
+ l.push({ key: Ue(d), cells: s, at: u, row: a }), o.has(d) && l.push({ key: `detail:${d}`, cells: i, at: u, row: a });
1725
1725
  };
1726
1726
  return "rows" in t ? t.rows.forEach(c) : t.lines.forEach((a, u) => {
1727
- a.kind === "row" ? c(a.row, u) : i.push({ key: `${a.kind}:${a.group.path}`, cells: bt(a.kind, e), at: u });
1728
- }), i.length === 1 && i.push({ key: "empty", cells: l, at: -1 }), r && i.push({ key: "foot", cells: s, at: -1 }), i;
1727
+ a.kind === "row" ? c(a.row, u) : l.push({ key: `${a.kind}:${a.group.path}`, cells: bt(a.kind, e), at: u });
1728
+ }), l.length === 1 && l.push({ key: "empty", cells: i, at: -1 }), r && l.push({ key: "foot", cells: s, at: -1 }), l;
1729
1729
  }
1730
1730
  function co(e, t) {
1731
1731
  let n = 0;
@@ -1736,36 +1736,36 @@ function co(e, t) {
1736
1736
  }
1737
1737
  return { index: 0, start: 0 };
1738
1738
  }
1739
- const Ge = (e, t) => e.slice(0, t).reduce((n, o) => n + o, 0);
1739
+ const je = (e, t) => e.slice(0, t).reduce((n, o) => n + o, 0);
1740
1740
  function il(e, t, n, o) {
1741
1741
  const r = e.length - 1, s = e[t.line];
1742
1742
  if (!s) return t;
1743
- const { index: l } = co(s.cells, t.column), i = (c) => ({ line: Math.max(0, Math.min(r, c)), column: t.column });
1743
+ const { index: i } = co(s.cells, t.column), l = (c) => ({ line: Math.max(0, Math.min(r, c)), column: t.column });
1744
1744
  switch (n) {
1745
1745
  case "left":
1746
- return l > 0 ? { line: t.line, column: Ge(s.cells, l - 1) } : t;
1746
+ return i > 0 ? { line: t.line, column: je(s.cells, i - 1) } : t;
1747
1747
  case "right":
1748
- return l < s.cells.length - 1 ? { line: t.line, column: Ge(s.cells, l + 1) } : t;
1748
+ return i < s.cells.length - 1 ? { line: t.line, column: je(s.cells, i + 1) } : t;
1749
1749
  case "up":
1750
- return i(t.line - 1);
1750
+ return l(t.line - 1);
1751
1751
  case "down":
1752
- return i(t.line + 1);
1752
+ return l(t.line + 1);
1753
1753
  case "pageUp":
1754
- return i(t.line - Math.max(1, o));
1754
+ return l(t.line - Math.max(1, o));
1755
1755
  case "pageDown":
1756
- return i(t.line + Math.max(1, o));
1756
+ return l(t.line + Math.max(1, o));
1757
1757
  case "lineStart":
1758
1758
  return { line: t.line, column: 0 };
1759
1759
  case "lineEnd":
1760
- return { line: t.line, column: Ge(s.cells, s.cells.length - 1) };
1760
+ return { line: t.line, column: je(s.cells, s.cells.length - 1) };
1761
1761
  case "first":
1762
1762
  return { line: 0, column: 0 };
1763
1763
  case "last":
1764
- return { line: r, column: Ge(e[r].cells, e[r].cells.length - 1) };
1764
+ return { line: r, column: je(e[r].cells, e[r].cells.length - 1) };
1765
1765
  }
1766
1766
  }
1767
1767
  function ll(e, t, n, o) {
1768
- const r = e.flatMap((i, c) => i.cells.map((a, u) => ({ line: c, column: Ge(i.cells, u) }))), s = r.findIndex((i) => i.line === t.line && i.column === co(e[t.line].cells, t.column).start);
1768
+ const r = e.flatMap((l, c) => l.cells.map((a, u) => ({ line: c, column: je(l.cells, u) }))), s = r.findIndex((l) => l.line === t.line && l.column === co(e[t.line].cells, t.column).start);
1769
1769
  return (n ? r.slice(0, Math.max(0, s)).reverse() : r.slice(s + 1)).find(o) ?? null;
1770
1770
  }
1771
1771
  function pn(e, t, n) {
@@ -1786,7 +1786,7 @@ class al {
1786
1786
  }
1787
1787
  }
1788
1788
  function cl() {
1789
- const [e, t] = P({ active: null, widget: !1, editing: null }), [n] = P(() => new al());
1789
+ const [e, t] = I({ active: null, widget: !1, editing: null }), [n] = I(() => new al());
1790
1790
  return { state: e, setState: t, focus: n };
1791
1791
  }
1792
1792
  const mn = (e) => e?.spec.edit !== void 0;
@@ -1795,57 +1795,57 @@ function uo(e, t) {
1795
1795
  return Object.is(n(e), n(t));
1796
1796
  }
1797
1797
  function dl(e) {
1798
- const { grid: t, lines: n, ids: o, columnById: r, rowKey: s, onCellEdit: l, rowMode: i, onRowSave: c, onRowAdd: a, newRow: u } = e, { setState: d } = t, m = n.map((k) => k.key), b = t.state.editing, p = (k) => k === he ? b?.fresh : n.find((O) => O.key === k)?.row, w = (k) => {
1798
+ const { grid: t, lines: n, ids: o, columnById: r, rowKey: s, onCellEdit: i, rowMode: l, onRowSave: c, onRowAdd: a, newRow: u } = e, { setState: d } = t, b = n.map((k) => k.key), p = t.state.editing, m = (k) => k === he ? p?.fresh : n.find((O) => O.key === k)?.row, w = (k) => {
1799
1799
  const O = n[k.line];
1800
1800
  return O?.key === he ? { row: O.row } : O?.row !== void 0 && O.key === Ue(s(O.row)) ? { row: O.row } : null;
1801
- }, g = (k) => w(k) !== null && mn(r(o[k.column] ?? "")), v = () => o.map(r).filter(mn), A = (k, O, M = !1) => {
1802
- const T = n[k.line], E = r(o[k.column] ?? ""), D = i ? Object.fromEntries(v().map((I) => [I.spec.id, I.read(T.row)])) : {};
1803
- D[E.spec.id] = O === void 0 ? E.read(T.row) : O, t.focus.want(M ? "open" : "editor"), d((I) => ({
1804
- ...I,
1805
- active: { line: T.key, column: E.spec.id, lineIndex: k.line, columnIndex: k.column },
1806
- editing: { line: T.key, column: E.spec.id, row: i, drafts: D, errors: {}, refused: !1 }
1801
+ }, g = (k) => w(k) !== null && mn(r(o[k.column] ?? "")), v = () => o.map(r).filter(mn), x = (k, O, M = !1) => {
1802
+ const R = n[k.line], E = r(o[k.column] ?? ""), B = l ? Object.fromEntries(v().map(($) => [$.spec.id, $.read(R.row)])) : {};
1803
+ B[E.spec.id] = O === void 0 ? E.read(R.row) : O, t.focus.want(M ? "open" : "editor"), d(($) => ({
1804
+ ...$,
1805
+ active: { line: R.key, column: E.spec.id, lineIndex: k.line, columnIndex: k.column },
1806
+ editing: { line: R.key, column: E.spec.id, row: l, drafts: B, errors: {}, refused: !1 }
1807
1807
  }));
1808
1808
  }, y = (k = {}, O = !0) => {
1809
- if (!b) return !0;
1810
- const M = { ...b.drafts, ...k }, T = p(b.line);
1811
- if (T === void 0)
1812
- return d((B) => ({ ...B, editing: null })), !0;
1809
+ if (!p) return !0;
1810
+ const M = { ...p.drafts, ...k }, R = m(p.line);
1811
+ if (R === void 0)
1812
+ return d((V) => ({ ...V, editing: null })), !0;
1813
1813
  const E = {};
1814
- for (const [B, z] of Object.entries(M)) {
1815
- const Y = r(B)?.spec.validate?.(z, T);
1816
- Y && (E[B] = Y);
1814
+ for (const [V, K] of Object.entries(M)) {
1815
+ const Y = r(V)?.spec.validate?.(K, R);
1816
+ Y && (E[V] = Y);
1817
1817
  }
1818
- const D = Object.keys(M).find((B) => E[B] !== void 0);
1819
- if (D !== void 0) {
1820
- const B = b.row ? D : b.column;
1821
- return O && t.focus.want("editor"), d((z) => ({
1822
- ...z,
1823
- active: { line: b.line, column: B, lineIndex: Math.max(0, m.indexOf(b.line)), columnIndex: o.indexOf(B) },
1824
- editing: z.editing && { ...z.editing, column: B, drafts: M, errors: E, refused: !1 }
1818
+ const B = Object.keys(M).find((V) => E[V] !== void 0);
1819
+ if (B !== void 0) {
1820
+ const V = p.row ? B : p.column;
1821
+ return O && t.focus.want("editor"), d((K) => ({
1822
+ ...K,
1823
+ active: { line: p.line, column: V, lineIndex: Math.max(0, b.indexOf(p.line)), columnIndex: o.indexOf(V) },
1824
+ editing: K.editing && { ...K.editing, column: V, drafts: M, errors: E, refused: !1 }
1825
1825
  })), !1;
1826
1826
  }
1827
- const I = Object.keys(M).filter((B) => !uo(M[B], r(B)?.read(T)));
1828
- return b.line === he ? a?.({ values: M }) : b.row ? I.length > 0 && c?.({ rowKey: s(T), changes: Object.fromEntries(I.map((B) => [B, M[B]])), row: T }) : I.length > 0 && l?.({ rowKey: s(T), columnId: b.column, value: M[b.column], row: T }), O && t.focus.want("cell"), d((B) => ({ ...B, editing: null })), !0;
1827
+ const $ = Object.keys(M).filter((V) => !uo(M[V], r(V)?.read(R)));
1828
+ return p.line === he ? a?.({ values: M }) : p.row ? $.length > 0 && c?.({ rowKey: s(R), changes: Object.fromEntries($.map((V) => [V, M[V]])), row: R }) : $.length > 0 && i?.({ rowKey: s(R), columnId: p.column, value: M[p.column], row: R }), O && t.focus.want("cell"), d((V) => ({ ...V, editing: null })), !0;
1829
1829
  }, _ = (k, O) => y({ [k]: O }), S = () => {
1830
1830
  t.focus.want("cell"), d((k) => ({ ...k, editing: null }));
1831
1831
  }, C = () => {
1832
1832
  t.focus.want("editor"), d((k) => k.editing ? { ...k, editing: { ...k.editing, refused: !0 } } : k);
1833
1833
  };
1834
- return { rowAt: w, editable: g, startEdit: A, save: y, commit: _, discard: S, refuse: C, setDraft: (k, O) => d((M) => {
1834
+ return { rowAt: w, editable: g, startEdit: x, save: y, commit: _, discard: S, refuse: C, setDraft: (k, O) => d((M) => {
1835
1835
  if (!M.editing) return M;
1836
- const T = { ...M.editing.errors };
1837
- if (T[k] !== void 0) {
1838
- const E = r(k)?.spec.validate?.(O, p(M.editing.line));
1839
- E ? T[k] = E : delete T[k];
1836
+ const R = { ...M.editing.errors };
1837
+ if (R[k] !== void 0) {
1838
+ const E = r(k)?.spec.validate?.(O, m(M.editing.line));
1839
+ E ? R[k] = E : delete R[k];
1840
1840
  }
1841
- return { ...M, editing: { ...M.editing, drafts: { ...M.editing.drafts, [k]: O }, errors: T, refused: !1 } };
1841
+ return { ...M, editing: { ...M.editing, drafts: { ...M.editing.drafts, [k]: O }, errors: R, refused: !1 } };
1842
1842
  }), addRow: () => {
1843
- if (b && (b.row || !y())) return C();
1843
+ if (p && (p.row || !y())) return C();
1844
1844
  const k = v(), O = k[0];
1845
1845
  if (!O) return;
1846
1846
  const M = u?.() ?? {};
1847
- t.focus.want("editor"), d((T) => ({
1848
- ...T,
1847
+ t.focus.want("editor"), d((R) => ({
1848
+ ...R,
1849
1849
  widget: !1,
1850
1850
  active: { line: he, column: O.spec.id, lineIndex: 1, columnIndex: o.indexOf(O.spec.id) },
1851
1851
  editing: {
@@ -1861,20 +1861,20 @@ function dl(e) {
1861
1861
  }));
1862
1862
  } };
1863
1863
  }
1864
- const jt = 'a[href], button, input, select, textarea, [tabindex], [contenteditable="true"]';
1865
- function Ht(e) {
1864
+ const Ht = 'a[href], button, input, select, textarea, [tabindex], [contenteditable="true"]';
1865
+ function Wt(e) {
1866
1866
  let t = 0;
1867
1867
  return Array.from(e.cells).map((n) => {
1868
1868
  const o = { cell: n, start: t, end: t + n.colSpan };
1869
1869
  return t = o.end, o;
1870
1870
  });
1871
1871
  }
1872
- function Wt(e, t) {
1872
+ function qt(e, t) {
1873
1873
  if (!(t instanceof Element)) return null;
1874
1874
  const n = t.closest("td, th"), o = n?.parentElement, r = o?.dataset.gridLine;
1875
1875
  if (!n || !o || r === void 0 || o.closest("table") !== e) return null;
1876
- const { start: s, end: l } = Ht(o).find((i) => i.cell === n);
1877
- return { cell: n, line: r, column: s, end: l };
1876
+ const { start: s, end: i } = Wt(o).find((l) => l.cell === n);
1877
+ return { cell: n, line: r, column: s, end: i };
1878
1878
  }
1879
1879
  const ul = {
1880
1880
  ArrowLeft: "left",
@@ -1894,26 +1894,26 @@ function fo(e, t) {
1894
1894
  return t && t.line === e.line && t.columnIndex >= e.column && t.columnIndex < e.end ? t.columnIndex : e.column;
1895
1895
  }
1896
1896
  function hl({ grid: e, lines: t, ids: n, virtual: o }, r, s) {
1897
- const l = t[s.line];
1898
- if (!l) return;
1899
- e.setState((a) => ({ ...a, widget: !1, active: { line: l.key, column: n[s.column] ?? "", lineIndex: s.line, columnIndex: s.column } }));
1900
- const i = Array.from(r.querySelectorAll("tr[data-grid-line]")).find((a) => a.dataset.gridLine === l.key), c = i ? Ht(i).find((a) => s.column >= a.start && s.column < a.end)?.cell : void 0;
1901
- c ? c.focus({ preventScroll: l.key === "head" }) : (e.focus.want("cell"), o && l.at >= 0 && o.showRow(l.at));
1897
+ const i = t[s.line];
1898
+ if (!i) return;
1899
+ e.setState((a) => ({ ...a, widget: !1, active: { line: i.key, column: n[s.column] ?? "", lineIndex: s.line, columnIndex: s.column } }));
1900
+ const l = Array.from(r.querySelectorAll("tr[data-grid-line]")).find((a) => a.dataset.gridLine === i.key), c = l ? Wt(l).find((a) => s.column >= a.start && s.column < a.end)?.cell : void 0;
1901
+ c ? c.focus({ preventScroll: i.key === "head" }) : (e.focus.want("cell"), o && i.at >= 0 && o.showRow(i.at));
1902
1902
  }
1903
1903
  function gl(e, t, n) {
1904
- const { grid: o, lines: r, ids: s, columnById: l, select: i } = e, { rowAt: c, editable: a, startEdit: u, save: d, discard: m } = t, b = r.map((y) => y.key), p = o.state.editing, w = n.currentTarget;
1904
+ const { grid: o, lines: r, ids: s, columnById: i, select: l } = e, { rowAt: c, editable: a, startEdit: u, save: d, discard: b } = t, p = r.map((y) => y.key), m = o.state.editing, w = n.currentTarget;
1905
1905
  if (n.defaultPrevented) return;
1906
- const g = Wt(w, n.target);
1906
+ const g = qt(w, n.target);
1907
1907
  if (!g) return;
1908
- const v = { line: b.indexOf(g.line), column: fo(g, o.state.active) };
1908
+ const v = { line: p.indexOf(g.line), column: fo(g, o.state.active) };
1909
1909
  if (v.line < 0) return;
1910
- if (p?.row && p.line === g.line) {
1911
- n.key === "Escape" ? (n.preventDefault(), m()) : n.key === "Enter" && !(n.target instanceof HTMLButtonElement) && (n.preventDefault(), d());
1910
+ if (m?.row && m.line === g.line) {
1911
+ n.key === "Escape" ? (n.preventDefault(), b()) : n.key === "Enter" && !(n.target instanceof HTMLButtonElement) && (n.preventDefault(), d());
1912
1912
  return;
1913
1913
  }
1914
- if (p && p.line === g.line && p.column === s[g.column]) {
1914
+ if (m && m.line === g.line && m.column === s[g.column]) {
1915
1915
  if (n.key === "Escape")
1916
- n.preventDefault(), m();
1916
+ n.preventDefault(), b();
1917
1917
  else if (n.key === "Enter" && !(n.target instanceof HTMLButtonElement))
1918
1918
  n.preventDefault(), d();
1919
1919
  else if (n.key === "Tab") {
@@ -1928,15 +1928,15 @@ function gl(e, t, n) {
1928
1928
  return;
1929
1929
  }
1930
1930
  if (n.altKey || n.metaKey) return;
1931
- const A = n.ctrlKey ? { Home: "first", End: "last" }[n.key] : ul[n.key];
1932
- if (A) {
1933
- n.preventDefault(), hl(e, w, il(r, v, A, fl(g.cell, w)));
1931
+ const x = n.ctrlKey ? { Home: "first", End: "last" }[n.key] : ul[n.key];
1932
+ if (x) {
1933
+ n.preventDefault(), hl(e, w, il(r, v, x, fl(g.cell, w)));
1934
1934
  return;
1935
1935
  }
1936
1936
  if (!n.ctrlKey) {
1937
1937
  if (n.key === " ") {
1938
1938
  const y = c(v);
1939
- i && y && g.line !== he && (n.preventDefault(), i(y.row));
1939
+ l && y && g.line !== he && (n.preventDefault(), l(y.row));
1940
1940
  return;
1941
1941
  }
1942
1942
  if (n.key === "Enter" || n.key === "F2") {
@@ -1944,40 +1944,40 @@ function gl(e, t, n) {
1944
1944
  n.preventDefault(), u(v);
1945
1945
  return;
1946
1946
  }
1947
- const y = g.cell.querySelector(jt);
1947
+ const y = g.cell.querySelector(Ht);
1948
1948
  y && (n.preventDefault(), o.setState((_) => ({ ..._, widget: !0 })), y.focus());
1949
1949
  return;
1950
1950
  }
1951
1951
  if (n.key.length === 1 && a(v)) {
1952
- const y = l(s[g.column] ?? "")?.spec.edit;
1952
+ const y = i(s[g.column] ?? "")?.spec.edit;
1953
1953
  n.preventDefault(), u(v, y === "text" ? n.key : y === "number" && /\d/.test(n.key) ? Number(n.key) : void 0);
1954
1954
  }
1955
1955
  }
1956
1956
  }
1957
1957
  function pl({ grid: e, lines: t }, { editable: n, startEdit: o }, r) {
1958
1958
  if (r.button !== 0 || e.state.editing) return;
1959
- const s = Wt(r.currentTarget, r.target);
1960
- if (!s || r.target.closest(jt) !== s.cell) return;
1961
- const l = { line: t.findIndex((i) => i.key === s.line), column: s.column };
1962
- l.line >= 0 && n(l) && o(l, void 0, !0);
1959
+ const s = qt(r.currentTarget, r.target);
1960
+ if (!s || r.target.closest(Ht) !== s.cell) return;
1961
+ const i = { line: t.findIndex((l) => l.key === s.line), column: s.column };
1962
+ i.line >= 0 && n(i) && o(i, void 0, !0);
1963
1963
  }
1964
1964
  function ml({ grid: e, lines: t, ids: n }, { save: o, refuse: r }, s) {
1965
- const l = e.state.editing, i = Wt(s.currentTarget, s.target);
1966
- if (!i) return;
1967
- const c = t.findIndex((u) => u.key === i.line), a = n[i.column] ?? "";
1968
- if (l?.row) {
1969
- if (l.line !== i.line) return r();
1970
- a in l.drafts && a !== l.column && e.setState((u) => ({ ...u, editing: u.editing && { ...u.editing, column: a } }));
1971
- } else if (l && (l.line !== i.line || l.column !== a) && !o()) {
1965
+ const i = e.state.editing, l = qt(s.currentTarget, s.target);
1966
+ if (!l) return;
1967
+ const c = t.findIndex((u) => u.key === l.line), a = n[l.column] ?? "";
1968
+ if (i?.row) {
1969
+ if (i.line !== l.line) return r();
1970
+ a in i.drafts && a !== i.column && e.setState((u) => ({ ...u, editing: u.editing && { ...u.editing, column: a } }));
1971
+ } else if (i && (i.line !== l.line || i.column !== a) && !o()) {
1972
1972
  e.focus.want("editor");
1973
1973
  return;
1974
1974
  }
1975
1975
  e.focus.want(null), e.setState((u) => {
1976
- const d = fo(i, u.active);
1976
+ const d = fo(l, u.active);
1977
1977
  return {
1978
1978
  ...u,
1979
- widget: s.target !== i.cell,
1980
- active: { line: i.line, column: n[d] ?? "", lineIndex: Math.max(0, c), columnIndex: d }
1979
+ widget: s.target !== l.cell,
1980
+ active: { line: l.line, column: n[d] ?? "", lineIndex: Math.max(0, c), columnIndex: d }
1981
1981
  };
1982
1982
  });
1983
1983
  }
@@ -1985,37 +1985,37 @@ function wl({ grid: e }, t) {
1985
1985
  t.currentTarget.contains(t.relatedTarget) || e.setState((n) => n.widget ? { ...n, widget: !1 } : n);
1986
1986
  }
1987
1987
  function bl(e) {
1988
- const { grid: t, rowKey: n, onRowDelete: o } = e, r = dl(e), { save: s, discard: l, commit: i, setDraft: c, editable: a, addRow: u } = r, d = {
1988
+ const { grid: t, rowKey: n, onRowDelete: o } = e, r = dl(e), { save: s, discard: i, commit: l, setDraft: c, editable: a, addRow: u } = r, d = {
1989
1989
  editing: t.state.editing,
1990
1990
  setDraft: c,
1991
- commit: i,
1991
+ commit: l,
1992
1992
  save: () => void s(),
1993
- discard: l,
1994
- remove: o && ((p) => o({ rowKey: n(p), row: p }))
1995
- }, m = t.state.editing, b = m && !m.row ? () => void s({}, !1) : void 0;
1993
+ discard: i,
1994
+ remove: o && ((m) => o({ rowKey: n(m), row: m }))
1995
+ }, b = t.state.editing, p = b && !b.row ? () => void s({}, !1) : void 0;
1996
1996
  return {
1997
- onKeyDown: (p) => gl(e, r, p),
1998
- onClick: (p) => pl(e, r, p),
1999
- onFocus: (p) => ml(e, r, p),
2000
- onBlur: (p) => wl(e, p),
1997
+ onKeyDown: (m) => gl(e, r, m),
1998
+ onClick: (m) => pl(e, r, m),
1999
+ onFocus: (m) => ml(e, r, m),
2000
+ onBlur: (m) => wl(e, m),
2001
2001
  context: d,
2002
2002
  editable: a,
2003
2003
  addRow: u,
2004
- outside: b
2004
+ outside: p
2005
2005
  };
2006
2006
  }
2007
- const Ve = /* @__PURE__ */ rt(null);
2007
+ const Pe = /* @__PURE__ */ rt(null);
2008
2008
  function vl(e, t) {
2009
- const n = _e(Ve), o = n?.editing;
2009
+ const n = _e(Pe), o = n?.editing;
2010
2010
  return o && o.line === e && t in o.drafts ? n : null;
2011
2011
  }
2012
- const ze = "data-grid-tabindex";
2012
+ const Ke = "data-grid-tabindex";
2013
2013
  function yl(e, t) {
2014
- if (t && !e.hasAttribute(ze))
2015
- e.setAttribute(ze, e.getAttribute("tabindex") ?? ""), e.tabIndex = -1;
2016
- else if (!t && e.hasAttribute(ze)) {
2017
- const n = e.getAttribute(ze);
2018
- n === "" ? e.removeAttribute("tabindex") : e.setAttribute("tabindex", n), e.removeAttribute(ze);
2014
+ if (t && !e.hasAttribute(Ke))
2015
+ e.setAttribute(Ke, e.getAttribute("tabindex") ?? ""), e.tabIndex = -1;
2016
+ else if (!t && e.hasAttribute(Ke)) {
2017
+ const n = e.getAttribute(Ke);
2018
+ n === "" ? e.removeAttribute("tabindex") : e.setAttribute("tabindex", n), e.removeAttribute(Ke);
2019
2019
  }
2020
2020
  }
2021
2021
  function _l({
@@ -2026,46 +2026,46 @@ function _l({
2026
2026
  editable: r,
2027
2027
  outside: s
2028
2028
  }) {
2029
- const l = W(s);
2030
- te(() => {
2031
- l.current = s;
2029
+ const i = q(s);
2030
+ Z(() => {
2031
+ i.current = s;
2032
2032
  });
2033
- const i = s !== void 0;
2033
+ const l = s !== void 0;
2034
2034
  return xe(() => {
2035
2035
  const c = e.current;
2036
- if (!i || !c) return;
2036
+ if (!l || !c) return;
2037
2037
  const a = (u) => {
2038
2038
  for (let d = u.target instanceof Element ? u.target : null; d; d = d.parentElement)
2039
2039
  if (d === c || d.id && c.querySelector(`[aria-controls="${CSS.escape(d.id)}"]`)) return;
2040
- l.current?.();
2040
+ i.current?.();
2041
2041
  };
2042
2042
  return document.addEventListener("mousedown", a), () => document.removeEventListener("mousedown", a);
2043
- }, [i, e]), te(() => {
2043
+ }, [l, e]), Z(() => {
2044
2044
  const c = e.current;
2045
2045
  if (!c) return;
2046
- const { active: a, widget: u, editing: d } = t.state, m = kl(a, n, o), b = n[m.line]?.key, p = new Map(n.map((y, _) => [y.key, _]));
2046
+ const { active: a, widget: u, editing: d } = t.state, b = kl(a, n, o), p = n[b.line]?.key, m = new Map(n.map((y, _) => [y.key, _]));
2047
2047
  let w = null, g = null;
2048
2048
  for (const y of Array.from(c.querySelectorAll("tr[data-grid-line]"))) {
2049
- const _ = y.dataset.gridLine, S = Ht(y);
2050
- for (const { cell: C, start: x, end: L } of S) {
2051
- const k = m.column >= x && m.column < L || C === S.at(-1).cell && m.column >= L;
2052
- k && _ === b && (w = C), k && g === null && _ !== "head" && (g = C), C.tabIndex = -1, r && _ !== "head" && !r({ line: p.get(_) ?? -1, column: x }) ? C.setAttribute("aria-readonly", "true") : C.removeAttribute("aria-readonly");
2049
+ const _ = y.dataset.gridLine, S = Wt(y);
2050
+ for (const { cell: C, start: A, end: L } of S) {
2051
+ const k = b.column >= A && b.column < L || C === S.at(-1).cell && b.column >= L;
2052
+ k && _ === p && (w = C), k && g === null && _ !== "head" && (g = C), C.tabIndex = -1, r && _ !== "head" && !r({ line: m.get(_) ?? -1, column: A }) ? C.setAttribute("aria-readonly", "true") : C.removeAttribute("aria-readonly");
2053
2053
  const O = d?.row === !0 && d.line === _ || C === w && (u || d !== null && d.line === _);
2054
- for (const M of Array.from(C.querySelectorAll(jt))) yl(M, !O);
2054
+ for (const M of Array.from(C.querySelectorAll(Ht))) yl(M, !O);
2055
2055
  }
2056
2056
  }
2057
2057
  const v = w ?? g ?? c.querySelector("tr[data-grid-line] > *");
2058
2058
  v && !(d?.row && v.parentElement?.dataset.gridLine === d.line) && (v.tabIndex = 0);
2059
- const A = t.focus.take(w !== null);
2060
- if (A === "editor" || A === "open") {
2059
+ const x = t.focus.take(w !== null);
2060
+ if (x === "editor" || x === "open") {
2061
2061
  const y = w?.querySelector("input, select, textarea, button");
2062
- if (y?.focus(), y instanceof HTMLInputElement && y.type === "text" && y.setSelectionRange(y.value.length, y.value.length), A === "open" && y instanceof HTMLSelectElement)
2062
+ if (y?.focus(), y instanceof HTMLInputElement && y.type === "text" && y.setSelectionRange(y.value.length, y.value.length), x === "open" && y instanceof HTMLSelectElement)
2063
2063
  try {
2064
2064
  y.showPicker();
2065
2065
  } catch {
2066
2066
  }
2067
- else A === "open" && y instanceof HTMLButtonElement && y.click();
2068
- } else A === "cell" && w?.focus();
2067
+ else x === "open" && y instanceof HTMLButtonElement && y.click();
2068
+ } else x === "cell" && w?.focus();
2069
2069
  }), null;
2070
2070
  }
2071
2071
  function kl(e, t, n) {
@@ -2079,37 +2079,37 @@ function kl(e, t, n) {
2079
2079
  } : { line: Math.min(1, t.length - 1), column: 0 };
2080
2080
  }
2081
2081
  function Sl({ entry: e, row: t, rowName: n, grid: o }) {
2082
- const r = ke(), s = W(null), { spec: l } = e, i = o.editing, c = l.id, a = i.drafts[c], u = i.errors[c] ?? null, d = (p) => o.setDraft(c, p), m = o.wording.editCell(l.label, n);
2083
- let b;
2084
- if (typeof l.edit == "function")
2085
- b = l.edit({
2082
+ const r = ke(), s = q(null), { spec: i } = e, l = o.editing, c = i.id, a = l.drafts[c], u = l.errors[c] ?? null, d = (m) => o.setDraft(c, m), b = o.wording.editCell(i.label, n);
2083
+ let p;
2084
+ if (typeof i.edit == "function")
2085
+ p = i.edit({
2086
2086
  value: a,
2087
2087
  onChange: d,
2088
- commit: (p) => o.commit(c, p === void 0 ? a : p),
2088
+ commit: (m) => o.commit(c, m === void 0 ? a : m),
2089
2089
  row: t,
2090
2090
  invalid: u !== null,
2091
- label: m
2091
+ label: b
2092
2092
  });
2093
- else if (l.edit === "number")
2094
- b = /* @__PURE__ */ f(yt, { size: "sm", value: typeof a == "number" ? a : null, onChange: d });
2095
- else if (l.edit === "date")
2096
- b = /* @__PURE__ */ f(Lo, { size: "sm", value: a instanceof Date ? a : null, onChange: (p) => i.row ? d(p) : o.commit(c, p) });
2097
- else if (l.edit === "select") {
2098
- const p = l.editOptions ?? At(o.hook.admitted, e.read, r).values, w = p.findIndex((g) => uo(g, a));
2099
- b = /* @__PURE__ */ R(Tn, { size: "sm", value: w < 0 ? "" : String(w), onChange: (g) => d(p[Number(g.target.value)]), children: [
2093
+ else if (i.edit === "number")
2094
+ p = /* @__PURE__ */ f(yt, { size: "sm", value: typeof a == "number" ? a : null, onChange: d });
2095
+ else if (i.edit === "date")
2096
+ p = /* @__PURE__ */ f(Lo, { size: "sm", value: a instanceof Date ? a : null, onChange: (m) => l.row ? d(m) : o.commit(c, m) });
2097
+ else if (i.edit === "select") {
2098
+ const m = i.editOptions ?? At(o.hook.admitted, e.read, r).values, w = m.findIndex((g) => uo(g, a));
2099
+ p = /* @__PURE__ */ T(Rn, { size: "sm", value: w < 0 ? "" : String(w), onChange: (g) => d(m[Number(g.target.value)]), children: [
2100
2100
  w < 0 && /* @__PURE__ */ f("option", { value: "" }),
2101
- p.map((g, v) => /* @__PURE__ */ f("option", { value: v, children: g instanceof Date ? r.date(g) : String(g) }, v))
2101
+ m.map((g, v) => /* @__PURE__ */ f("option", { value: v, children: g instanceof Date ? r.date(g) : String(g) }, v))
2102
2102
  ] });
2103
2103
  } else
2104
- b = /* @__PURE__ */ f(On, { size: "sm", value: se(a) ? "" : String(a), onChange: (p) => d(p.target.value) });
2105
- return /* @__PURE__ */ R("div", { ref: s, className: h.editor, children: [
2106
- /* @__PURE__ */ f(vt, { className: h.editorField, label: /* @__PURE__ */ f(Oe, { children: m }), error: u ?? void 0, children: b }),
2104
+ p = /* @__PURE__ */ f(On, { size: "sm", value: se(a) ? "" : String(a), onChange: (m) => d(m.target.value) });
2105
+ return /* @__PURE__ */ T("div", { ref: s, className: h.editor, children: [
2106
+ /* @__PURE__ */ f(vt, { className: h.editorField, label: /* @__PURE__ */ f(Oe, { children: b }), error: u ?? void 0, children: p }),
2107
2107
  /* @__PURE__ */ f(it, { open: u !== null, onOpenChange: () => {
2108
2108
  }, anchorRef: s, restoreFocus: !1, offset: 4, className: h.editorMessage, children: /* @__PURE__ */ f("span", { "aria-hidden": "true", children: u }) })
2109
2109
  ] });
2110
2110
  }
2111
2111
  function ho({ wording: e }) {
2112
- return /* @__PURE__ */ R(re, { children: [
2112
+ return /* @__PURE__ */ T(re, { children: [
2113
2113
  /* @__PURE__ */ f("span", { "aria-hidden": "true", className: h.absent, children: "—" }),
2114
2114
  /* @__PURE__ */ f(Oe, { children: e.cellAbsentValue })
2115
2115
  ] });
@@ -2127,16 +2127,16 @@ function go(e, t, n) {
2127
2127
  const o = e.spec.aggregate;
2128
2128
  let r = wn.get(t);
2129
2129
  r || wn.set(t, r = /* @__PURE__ */ new Map());
2130
- const s = r.get(e), l = e.spec.value, i = e.spec.rightAligned;
2131
- if (s && s.spec === o && s.reader === l && s.aligned === i) return s;
2132
- const c = n ? n.value : $t({ id: e.spec.id, read: e.read, aggregate: o }, t);
2130
+ const s = r.get(e), i = e.spec.value, l = e.spec.rightAligned;
2131
+ if (s && s.spec === o && s.reader === i && s.aligned === l) return s;
2132
+ const c = n ? n.value : zt({ id: e.spec.id, read: e.read, aggregate: o }, t);
2133
2133
  let a = 0;
2134
2134
  if ((o === "sum" || o === "avg") && typeof c == "number")
2135
- for (const m of t) {
2136
- const b = e.read(m);
2137
- Al(b) && (a = Math.max(a, Nl(b)));
2135
+ for (const b of t) {
2136
+ const p = e.read(b);
2137
+ Al(p) && (a = Math.max(a, Nl(p)));
2138
2138
  }
2139
- const u = o === "count" || o === "distinct" || (i ?? Mn(t, e.read) === "number"), d = { spec: o, reader: l, aligned: i, value: c, places: a, numeric: u };
2139
+ const u = o === "count" || o === "distinct" || (l ?? Mn(t, e.read) === "number"), d = { spec: o, reader: i, aligned: l, value: c, places: a, numeric: u };
2140
2140
  return r.set(e, d), d;
2141
2141
  }
2142
2142
  function Ot({
@@ -2147,35 +2147,35 @@ function Ot({
2147
2147
  signed: r = !1,
2148
2148
  known: s
2149
2149
  }) {
2150
- const { aggregate: l, format: i, presentation: c } = e.spec;
2151
- if (!l) return null;
2152
- const a = typeof l == "function" ? "own" : l, { value: u, places: d } = go(e, t, s), m = (w) => Be(w, i, n, o);
2153
- let b;
2154
- if (se(u)) b = /* @__PURE__ */ f(ho, { wording: o });
2155
- else if ((a === "sum" || a === "avg") && i === void 0 && typeof u == "number")
2156
- b = n.number(u, Math.min(10, a === "avg" ? d + 1 : d));
2157
- else if (a === "range" && i === "date" && Rl(u)) {
2150
+ const { aggregate: i, format: l, presentation: c } = e.spec;
2151
+ if (!i) return null;
2152
+ const a = typeof i == "function" ? "own" : i, { value: u, places: d } = go(e, t, s), b = (w) => Ve(w, l, n, o);
2153
+ let p;
2154
+ if (se(u)) p = /* @__PURE__ */ f(ho, { wording: o });
2155
+ else if ((a === "sum" || a === "avg") && l === void 0 && typeof u == "number")
2156
+ p = n.number(u, Math.min(10, a === "avg" ? d + 1 : d));
2157
+ else if (a === "range" && l === "date" && Tl(u)) {
2158
2158
  const [w, g] = u;
2159
- b = w.getTime() === g.getTime() ? n.date(w) : o.rangeFromTo(n.dateShort(w), n.dateShort(g));
2160
- } else if (a === "count" || a === "distinct") b = n.count(u);
2159
+ p = w.getTime() === g.getTime() ? n.date(w) : o.rangeFromTo(n.dateShort(w), n.dateShort(g));
2160
+ } else if (a === "count" || a === "distinct") p = n.count(u);
2161
2161
  else if (a === "range") {
2162
2162
  const [w, g] = u;
2163
- b = m(w) === m(g) ? m(w) : o.rangeFromTo(m(w) ?? "", m(g) ?? "");
2164
- } else a === "own" && c ? b = c(u, t[0]) : b = m(u);
2165
- const p = Cl[a];
2166
- return /* @__PURE__ */ R(re, { children: [
2167
- r && p && /* @__PURE__ */ f("span", { "aria-hidden": "true", className: h.footerKind, children: p }),
2168
- r && /* @__PURE__ */ R(Oe, { children: [
2163
+ p = b(w) === b(g) ? b(w) : o.rangeFromTo(b(w) ?? "", b(g) ?? "");
2164
+ } else a === "own" && c ? p = c(u, t[0]) : p = b(u);
2165
+ const m = Cl[a];
2166
+ return /* @__PURE__ */ T(re, { children: [
2167
+ r && m && /* @__PURE__ */ f("span", { "aria-hidden": "true", className: h.footerKind, children: m }),
2168
+ r && /* @__PURE__ */ T(Oe, { children: [
2169
2169
  xl(a, o),
2170
2170
  " "
2171
2171
  ] }),
2172
- b
2172
+ p
2173
2173
  ] });
2174
2174
  }
2175
2175
  const Al = (e) => typeof e == "number" && Number.isFinite(e), Nl = (e) => {
2176
2176
  const [t = "", n = "0"] = e.toExponential().split("e");
2177
2177
  return Math.max(0, (t.split(".")[1]?.length ?? 0) - Number(n));
2178
- }, Rl = ([e, t]) => e instanceof Date && t instanceof Date && e.getFullYear() === t.getFullYear();
2178
+ }, Tl = ([e, t]) => e instanceof Date && t instanceof Date && e.getFullYear() === t.getFullYear();
2179
2179
  function po(e, t, n) {
2180
2180
  return e.spec.aggregate ? go(e, t, n).numeric : !1;
2181
2181
  }
@@ -2185,7 +2185,7 @@ function ct(e, t, n = t) {
2185
2185
  if (!o) return mo;
2186
2186
  const r = o.side === "start";
2187
2187
  return {
2188
- className: F(h.pinned, o.edge && (r ? h.pinStartEdge : h.pinEndEdge)),
2188
+ className: D(h.pinned, o.edge && (r ? h.pinStartEdge : h.pinEndEdge)),
2189
2189
  /* The scroll area keeps a padding as wide as the block for the browser's
2190
2190
  scroll into view; a pinned cell lies inside it and would scroll the
2191
2191
  table back to its start when focused. Its target is shifted out of the
@@ -2204,9 +2204,9 @@ function ct(e, t, n = t) {
2204
2204
  function dt(e, t, n, o) {
2205
2205
  if (t === void 0) return o.groupNoValue;
2206
2206
  const r = e?.spec;
2207
- if (r?.group && t instanceof Date) return Wo(r.group, t, n, o);
2207
+ if (r?.group && t instanceof Date) return qo(r.group, t, n, o);
2208
2208
  const s = r?.ownGroupValue ? void 0 : r?.format;
2209
- return Be(t, s, n, o) ?? String(t);
2209
+ return Ve(t, s, n, o) ?? String(t);
2210
2210
  }
2211
2211
  function Et({ entry: e, group: t, formats: n, wording: o }) {
2212
2212
  const r = e?.spec;
@@ -2219,9 +2219,9 @@ function Mt({
2219
2219
  open: o,
2220
2220
  hook: r,
2221
2221
  formats: s,
2222
- wording: l
2222
+ wording: i
2223
2223
  }) {
2224
- const i = dt(n, e.value, s, l), c = s.count(e.rows.length), a = () => r.publicSnapshot.toggleFold(e.path), u = (d) => {
2224
+ const l = dt(n, e.value, s, i), c = s.count(e.rows.length), a = () => r.publicSnapshot.toggleFold(e.path), u = (d) => {
2225
2225
  if (d.altKey && (d.key === "ArrowLeft" || d.key === "ArrowRight")) {
2226
2226
  d.preventDefault(), bn(e, d.key === "ArrowLeft", r);
2227
2227
  return;
@@ -2231,9 +2231,9 @@ function Mt({
2231
2231
  else if (d.key === "ArrowLeft") {
2232
2232
  if (d.preventDefault(), o) a();
2233
2233
  else if (t) {
2234
- const m = d.currentTarget.closest("table");
2235
- Array.from(m?.querySelectorAll("[data-fold-path]") ?? []).find(
2236
- (p) => p.dataset.foldPath === t.path
2234
+ const b = d.currentTarget.closest("table");
2235
+ Array.from(b?.querySelectorAll("[data-fold-path]") ?? []).find(
2236
+ (m) => m.dataset.foldPath === t.path
2237
2237
  )?.focus();
2238
2238
  }
2239
2239
  }
@@ -2242,10 +2242,10 @@ function Mt({
2242
2242
  "button",
2243
2243
  {
2244
2244
  type: "button",
2245
- className: F(h.fold, !o && h.foldClosed),
2245
+ className: D(h.fold, !o && h.foldClosed),
2246
2246
  "data-fold-path": e.path,
2247
2247
  "aria-expanded": o,
2248
- "aria-label": o ? l.foldGroup(i, c) : l.unfoldGroup(i, c),
2248
+ "aria-label": o ? i.foldGroup(l, c) : i.unfoldGroup(l, c),
2249
2249
  onKeyDown: u,
2250
2250
  onClick: (d) => {
2251
2251
  if (!d.altKey) return a();
@@ -2255,32 +2255,32 @@ function Mt({
2255
2255
  }
2256
2256
  );
2257
2257
  }
2258
- function Tl({ value: e, formats: t }) {
2259
- const n = W(null);
2258
+ function Rl({ value: e, formats: t }) {
2259
+ const n = q(null);
2260
2260
  return ol(n, e, t.count), /* @__PURE__ */ f("span", { ref: n, className: h.groupCount, children: t.count(e) });
2261
2261
  }
2262
2262
  function Lt({ group: e, entry: t, hook: n, formats: o, wording: r }) {
2263
- const { selection: s } = n.publicSnapshot, l = e.rows.map(n.rowKey), i = l.filter((a) => s.isSelected(a)).length, c = i === l.length;
2263
+ const { selection: s } = n.publicSnapshot, i = e.rows.map(n.rowKey), l = i.filter((a) => s.isSelected(a)).length, c = l === i.length;
2264
2264
  return /* @__PURE__ */ f(
2265
- He,
2265
+ We,
2266
2266
  {
2267
2267
  "aria-label": r.selectGroup(dt(t, e.value, o, r)),
2268
2268
  checked: c,
2269
- indeterminate: i > 0 && !c,
2269
+ indeterminate: l > 0 && !c,
2270
2270
  onChange: () => {
2271
- for (const a of l) s.isSelected(a) === c && s.toggle(a);
2271
+ for (const a of i) s.isSelected(a) === c && s.toggle(a);
2272
2272
  }
2273
2273
  }
2274
2274
  );
2275
2275
  }
2276
2276
  function bn(e, t, n) {
2277
- const o = n.publicSnapshot, r = [], s = (l) => {
2278
- for (const i of l)
2279
- i.level === e.level ? r.push(i) : s(i.groups);
2277
+ const o = n.publicSnapshot, r = [], s = (i) => {
2278
+ for (const l of i)
2279
+ l.level === e.level ? r.push(l) : s(l.groups);
2280
2280
  };
2281
2281
  s(n.tableState.groups ?? []);
2282
- for (const l of r)
2283
- o.folded.includes(l.path) !== t && o.toggleFold(l.path);
2282
+ for (const i of r)
2283
+ o.folded.includes(i.path) !== t && o.toggleFold(i.path);
2284
2284
  }
2285
2285
  function Ol({
2286
2286
  line: e,
@@ -2289,17 +2289,17 @@ function Ol({
2289
2289
  pin: o,
2290
2290
  hook: r,
2291
2291
  formats: s,
2292
- wording: l
2292
+ wording: i
2293
2293
  }) {
2294
- const i = e.span;
2295
- return /* @__PURE__ */ f("td", { className: F(h.td, h.spanCell, o.className), style: o.style, children: e.first && /* @__PURE__ */ R("span", { className: h.spanValue, children: [
2296
- n && /* @__PURE__ */ f("span", { className: h.spanSelect, children: /* @__PURE__ */ f(Lt, { group: i, entry: t, hook: r, formats: s, wording: l }) }),
2297
- /* @__PURE__ */ f(Mt, { group: i, parent: e.parents.at(-1), entry: t, open: !0, hook: r, formats: s, wording: l }),
2298
- /* @__PURE__ */ R("span", { className: h.spanText, title: dt(t, i.value, s, l), children: [
2299
- /* @__PURE__ */ f(Et, { entry: t, group: i, formats: s, wording: l }),
2300
- e.continued && /* @__PURE__ */ f("span", { className: h.continued, children: l.groupContinued })
2294
+ const l = e.span;
2295
+ return /* @__PURE__ */ f("td", { className: D(h.td, h.spanCell, o.className), style: o.style, children: e.first && /* @__PURE__ */ T("span", { className: h.spanValue, children: [
2296
+ n && /* @__PURE__ */ f("span", { className: h.spanSelect, children: /* @__PURE__ */ f(Lt, { group: l, entry: t, hook: r, formats: s, wording: i }) }),
2297
+ /* @__PURE__ */ f(Mt, { group: l, parent: e.parents.at(-1), entry: t, open: !0, hook: r, formats: s, wording: i }),
2298
+ /* @__PURE__ */ T("span", { className: h.spanText, title: dt(t, l.value, s, i), children: [
2299
+ /* @__PURE__ */ f(Et, { entry: t, group: l, formats: s, wording: i }),
2300
+ e.continued && /* @__PURE__ */ f("span", { className: h.continued, children: i.groupContinued })
2301
2301
  ] }),
2302
- /* @__PURE__ */ f("span", { className: h.groupCount, children: s.count(i.rows.length) })
2302
+ /* @__PURE__ */ f("span", { className: h.groupCount, children: s.count(l.rows.length) })
2303
2303
  ] }) });
2304
2304
  }
2305
2305
  function El({
@@ -2309,97 +2309,97 @@ function El({
2309
2309
  spanEntry: o,
2310
2310
  levelEntry: r,
2311
2311
  columns: s,
2312
- controlColumns: l,
2313
- blocks: i,
2312
+ controlColumns: i,
2313
+ blocks: l,
2314
2314
  selectable: c,
2315
2315
  hasActions: a,
2316
2316
  total: u,
2317
2317
  siblings: d,
2318
- depth: m,
2319
- hook: b,
2320
- formats: p,
2318
+ depth: b,
2319
+ hook: p,
2320
+ formats: m,
2321
2321
  wording: w,
2322
2322
  grid: g
2323
2323
  }) {
2324
- const { group: v } = e, A = e.kind === "header", y = A && !b.publicSnapshot.folded.includes(v.path), { lead: _, labelColumns: S, countColumns: C } = ao({
2325
- controls: l,
2324
+ const { group: v } = e, x = e.kind === "header", y = x && !p.publicSnapshot.folded.includes(v.path), { lead: _, labelColumns: S, countColumns: C } = ao({
2325
+ controls: i,
2326
2326
  span: o !== void 0,
2327
- aggregates: s.map((D) => D.spec.aggregate !== void 0),
2327
+ aggregates: s.map((B) => B.spec.aggregate !== void 0),
2328
2328
  actions: a,
2329
- blocks: i
2330
- }), x = s.slice(_), L = l + (o ? 1 : 0), k = (D, I = D) => ct(i, D, I), O = (D) => _ - D > 0 && /* @__PURE__ */ f("td", { className: h.td, colSpan: _ - D }), M = s.find((D) => D.spec.aggregate === "sum" && D.spec.share !== !1), T = n !== void 0, E = /* @__PURE__ */ R("span", { className: h.groupLabel, children: [
2331
- /* @__PURE__ */ f(Mt, { group: v, parent: e.parents.at(-1), entry: r, open: y, hook: b, formats: p, wording: w }),
2332
- /* @__PURE__ */ f("span", { className: h.groupValue, children: /* @__PURE__ */ f(Et, { entry: r, group: v, formats: p, wording: w }) }),
2333
- /* @__PURE__ */ f(Tl, { value: v.rows.length, formats: p }),
2334
- A && e.continued && /* @__PURE__ */ f("span", { className: h.continued, children: w.groupContinued })
2329
+ blocks: l
2330
+ }), A = s.slice(_), L = i + (o ? 1 : 0), k = (B, $ = B) => ct(l, B, $), O = (B) => _ - B > 0 && /* @__PURE__ */ f("td", { className: h.td, colSpan: _ - B }), M = s.find((B) => B.spec.aggregate === "sum" && B.spec.share !== !1), R = n !== void 0, E = /* @__PURE__ */ T("span", { className: h.groupLabel, children: [
2331
+ /* @__PURE__ */ f(Mt, { group: v, parent: e.parents.at(-1), entry: r, open: y, hook: p, formats: m, wording: w }),
2332
+ /* @__PURE__ */ f("span", { className: h.groupValue, children: /* @__PURE__ */ f(Et, { entry: r, group: v, formats: m, wording: w }) }),
2333
+ /* @__PURE__ */ f(Rl, { value: v.rows.length, formats: m }),
2334
+ x && e.continued && /* @__PURE__ */ f("span", { className: h.continued, children: w.groupContinued })
2335
2335
  ] });
2336
- return /* @__PURE__ */ R(
2336
+ return /* @__PURE__ */ T(
2337
2337
  "tr",
2338
2338
  {
2339
- className: F(A ? h.groupHeader : h.groupFolded, T && h.virtualRow),
2339
+ className: D(x ? h.groupHeader : h.groupFolded, R && h.virtualRow),
2340
2340
  "data-line": e.kind,
2341
2341
  "data-level": v.level,
2342
- "data-motion": n !== void 0 || !(A && e.continued) ? `${e.kind}:${v.path}` : void 0,
2343
- "data-continued": A && e.continued ? "" : void 0,
2344
- "data-group-first": A ? void 0 : "",
2342
+ "data-motion": n !== void 0 || !(x && e.continued) ? `${e.kind}:${v.path}` : void 0,
2343
+ "data-continued": x && e.continued ? "" : void 0,
2344
+ "data-group-first": x ? void 0 : "",
2345
2345
  "data-group": v.path,
2346
2346
  "data-grid-line": g ? `${e.kind}:${v.path}` : void 0,
2347
- "data-row": T ? n : void 0,
2348
- "aria-rowindex": T ? n + 2 : void 0,
2347
+ "data-row": R ? n : void 0,
2348
+ "aria-rowindex": R ? n + 2 : void 0,
2349
2349
  "data-index": t,
2350
- style: A ? { "--u-header-level": v.level } : void 0,
2351
- "aria-level": A ? v.level + 1 : m,
2350
+ style: x ? { "--u-header-level": v.level } : void 0,
2351
+ "aria-level": x ? v.level + 1 : b,
2352
2352
  "aria-expanded": y,
2353
2353
  "aria-posinset": d.indexOf(v) + 1 || void 0,
2354
2354
  "aria-setsize": d.length || void 0,
2355
2355
  children: [
2356
- Array.from({ length: l }, (D, I) => /* @__PURE__ */ f("td", { className: F(h.td, h.control, k(I).className), style: k(I).style, children: I === 0 && c && A && /* @__PURE__ */ f(Lt, { group: v, entry: r, hook: b, formats: p, wording: w }) }, `c${I}`)),
2357
- A ? /* @__PURE__ */ R(re, { children: [
2356
+ Array.from({ length: i }, (B, $) => /* @__PURE__ */ f("td", { className: D(h.td, h.control, k($).className), style: k($).style, children: $ === 0 && c && x && /* @__PURE__ */ f(Lt, { group: v, entry: r, hook: p, formats: m, wording: w }) }, `c${$}`)),
2357
+ x ? /* @__PURE__ */ T(re, { children: [
2358
2358
  /* @__PURE__ */ f(
2359
2359
  "td",
2360
2360
  {
2361
- className: F(h.td, k(l, L + S - 1).className),
2361
+ className: D(h.td, k(i, L + S - 1).className),
2362
2362
  colSpan: (o ? 1 : 0) + S,
2363
2363
  style: {
2364
- ...k(l, L + S - 1).style,
2364
+ ...k(i, L + S - 1).style,
2365
2365
  paddingLeft: `calc(var(--u-space-3) + ${v.level * 20}px)`
2366
2366
  },
2367
2367
  children: E
2368
2368
  }
2369
2369
  ),
2370
2370
  O(S)
2371
- ] }) : /* @__PURE__ */ R(re, { children: [
2372
- /* @__PURE__ */ f("td", { className: F(h.td, h.spanCell, k(l).className), style: k(l).style, children: /* @__PURE__ */ R("span", { className: h.spanValue, children: [
2373
- c && /* @__PURE__ */ f("span", { className: h.spanSelect, children: /* @__PURE__ */ f(Lt, { group: v, entry: o, hook: b, formats: p, wording: w }) }),
2374
- /* @__PURE__ */ f(Mt, { group: v, parent: e.parents.at(-1), entry: o, open: !1, hook: b, formats: p, wording: w }),
2375
- /* @__PURE__ */ f("span", { className: h.spanText, children: /* @__PURE__ */ f(Et, { entry: o, group: v, formats: p, wording: w }) }),
2376
- /* @__PURE__ */ f("span", { className: h.groupCount, children: p.count(v.rows.length) })
2371
+ ] }) : /* @__PURE__ */ T(re, { children: [
2372
+ /* @__PURE__ */ f("td", { className: D(h.td, h.spanCell, k(i).className), style: k(i).style, children: /* @__PURE__ */ T("span", { className: h.spanValue, children: [
2373
+ c && /* @__PURE__ */ f("span", { className: h.spanSelect, children: /* @__PURE__ */ f(Lt, { group: v, entry: o, hook: p, formats: m, wording: w }) }),
2374
+ /* @__PURE__ */ f(Mt, { group: v, parent: e.parents.at(-1), entry: o, open: !1, hook: p, formats: m, wording: w }),
2375
+ /* @__PURE__ */ f("span", { className: h.spanText, children: /* @__PURE__ */ f(Et, { entry: o, group: v, formats: m, wording: w }) }),
2376
+ /* @__PURE__ */ f("span", { className: h.groupCount, children: m.count(v.rows.length) })
2377
2377
  ] }) }),
2378
2378
  C > 0 && /* @__PURE__ */ f(
2379
2379
  "td",
2380
2380
  {
2381
- className: F(h.td, h.foldedCount, k(L, L + C - 1).className),
2381
+ className: D(h.td, h.foldedCount, k(L, L + C - 1).className),
2382
2382
  style: k(L, L + C - 1).style,
2383
2383
  colSpan: C,
2384
- children: w.entries(v.rows.length, p.count(v.rows.length))
2384
+ children: w.entries(v.rows.length, m.count(v.rows.length))
2385
2385
  }
2386
2386
  ),
2387
2387
  O(C)
2388
2388
  ] }),
2389
- x.map((D, I) => /* @__PURE__ */ f(
2389
+ A.map((B, $) => /* @__PURE__ */ f(
2390
2390
  Ll,
2391
2391
  {
2392
- pin: k(L + _ + I),
2393
- entry: D,
2392
+ pin: k(L + _ + $),
2393
+ entry: B,
2394
2394
  group: v,
2395
- share: A && D === M,
2395
+ share: x && B === M,
2396
2396
  total: u,
2397
- formats: p,
2397
+ formats: m,
2398
2398
  wording: w
2399
2399
  },
2400
- D.key
2400
+ B.key
2401
2401
  )),
2402
- a && /* @__PURE__ */ f("td", { className: F(h.td, k(i.count - 1).className), style: k(i.count - 1).style })
2402
+ a && /* @__PURE__ */ f("td", { className: D(h.td, k(l.count - 1).className), style: k(l.count - 1).style })
2403
2403
  ]
2404
2404
  }
2405
2405
  );
@@ -2409,7 +2409,7 @@ function Ml(e, t) {
2409
2409
  let n = vn.get(t);
2410
2410
  n || vn.set(t, n = /* @__PURE__ */ new Map());
2411
2411
  let o = n.get(e);
2412
- return (!o || o.reader !== e.spec.value) && (o = { reader: e.spec.value, sum: $t({ id: e.spec.id, read: e.read, aggregate: "sum" }, t) }, n.set(e, o)), o.sum;
2412
+ return (!o || o.reader !== e.spec.value) && (o = { reader: e.spec.value, sum: zt({ id: e.spec.id, read: e.read, aggregate: "sum" }, t) }, n.set(e, o)), o.sum;
2413
2413
  }
2414
2414
  function Ll({
2415
2415
  entry: e,
@@ -2418,22 +2418,22 @@ function Ll({
2418
2418
  share: o,
2419
2419
  total: r,
2420
2420
  formats: s,
2421
- wording: l
2421
+ wording: i
2422
2422
  }) {
2423
- const { spec: i } = e;
2424
- if (!i.aggregate) return /* @__PURE__ */ f("td", { className: F(h.td, t.className), style: t.style });
2423
+ const { spec: l } = e;
2424
+ if (!l.aggregate) return /* @__PURE__ */ f("td", { className: D(h.td, t.className), style: t.style });
2425
2425
  let c = null;
2426
- if (o && i.aggregate === "sum" && i.share !== !1) {
2427
- const a = Ml(e, r), u = n.aggregates[i.id];
2426
+ if (o && l.aggregate === "sum" && l.share !== !1) {
2427
+ const a = Ml(e, r), u = n.aggregates[l.id];
2428
2428
  if (typeof a == "number" && a > 0 && typeof u == "number" && u > 0) {
2429
2429
  const d = Math.min(1, u / a);
2430
2430
  c = /* @__PURE__ */ f("span", { className: h.shareBar, style: { width: `${Math.max(2, Math.round(d * 64))}px` }, "aria-hidden": "true" });
2431
2431
  }
2432
2432
  }
2433
- return /* @__PURE__ */ f("td", { className: F(h.td, po(e, n.rows, { value: n.aggregates[i.id] }) && h.numeric, h.aggregateCell, t.className), style: t.style, "data-aggregate": typeof i.aggregate == "function" ? "own" : i.aggregate, children: c ? /* @__PURE__ */ R("span", { className: h.shareHost, children: [
2434
- /* @__PURE__ */ f(Ot, { entry: e, rows: n.rows, known: { value: n.aggregates[i.id] }, formats: s, wording: l }),
2433
+ return /* @__PURE__ */ f("td", { className: D(h.td, po(e, n.rows, { value: n.aggregates[l.id] }) && h.numeric, h.aggregateCell, t.className), style: t.style, "data-aggregate": typeof l.aggregate == "function" ? "own" : l.aggregate, children: c ? /* @__PURE__ */ T("span", { className: h.shareHost, children: [
2434
+ /* @__PURE__ */ f(Ot, { entry: e, rows: n.rows, known: { value: n.aggregates[l.id] }, formats: s, wording: i }),
2435
2435
  c
2436
- ] }) : /* @__PURE__ */ f(Ot, { entry: e, rows: n.rows, known: { value: n.aggregates[i.id] }, formats: s, wording: l }) });
2436
+ ] }) : /* @__PURE__ */ f(Ot, { entry: e, rows: n.rows, known: { value: n.aggregates[l.id] }, formats: s, wording: i }) });
2437
2437
  }
2438
2438
  function wo() {
2439
2439
  return /* @__PURE__ */ f("svg", { viewBox: "0 0 10 10", width: "12", height: "12", "aria-hidden": "true", children: /* @__PURE__ */ f("path", { d: "M2.5 3.75 5 6.25 7.5 3.75", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinecap: "round", strokeLinejoin: "round" }) });
@@ -2441,18 +2441,18 @@ function wo() {
2441
2441
  function bo(e, t, n, o, r) {
2442
2442
  const s = e.detail?.presentation(n);
2443
2443
  if (s == null || s === !1) return null;
2444
- const l = r !== void 0 && r.branch && !r.empty;
2445
- return { content: s, open: l ? t.branches.includes(o) : t.expanded.includes(o) };
2446
- }
2447
- function ql(e, t, n, o, r) {
2448
- const s = /* @__PURE__ */ new Set([...t.expanded, ...t.branches]), l = /* @__PURE__ */ new Set();
2449
- for (const i of n) {
2450
- const c = o(i);
2451
- s.has(c) && bo(e, t, i, c, r?.entry(i))?.open && l.add(c);
2444
+ const i = r !== void 0 && r.branch && !r.empty;
2445
+ return { content: s, open: i ? t.branches.includes(o) : t.expanded.includes(o) };
2446
+ }
2447
+ function Fl(e, t, n, o, r) {
2448
+ const s = /* @__PURE__ */ new Set([...t.expanded, ...t.branches]), i = /* @__PURE__ */ new Set();
2449
+ for (const l of n) {
2450
+ const c = o(l);
2451
+ s.has(c) && bo(e, t, l, c, r?.entry(l))?.open && i.add(c);
2452
2452
  }
2453
- return l;
2453
+ return i;
2454
2454
  }
2455
- function Fl({
2455
+ function Dl({
2456
2456
  setup: e,
2457
2457
  entry: t,
2458
2458
  detail: n,
@@ -2460,8 +2460,8 @@ function Fl({
2460
2460
  wording: r,
2461
2461
  children: s
2462
2462
  }) {
2463
- const l = t.branch && !t.empty, i = l || n !== void 0, c = l && t.expanded || (n?.open ?? !1), a = (d) => {
2464
- l && e.set(t.key, d), n && n.open !== d && n.toggle();
2463
+ const i = t.branch && !t.empty, l = i || n !== void 0, c = i && t.expanded || (n?.open ?? !1), a = (d) => {
2464
+ i && e.set(t.key, d), n && n.open !== d && n.toggle();
2465
2465
  }, u = (d) => {
2466
2466
  if (!(d.key !== "ArrowLeft" && d.key !== "ArrowRight")) {
2467
2467
  if (d.preventDefault(), d.altKey) return e.siblings(t.key, d.key === "ArrowRight");
@@ -2469,17 +2469,17 @@ function Fl({
2469
2469
  c || a(!0);
2470
2470
  else if (c) a(!1);
2471
2471
  else {
2472
- const m = e.parent(t.key), b = d.currentTarget.closest("table");
2473
- Array.from(b?.querySelectorAll("[data-branch-key]") ?? []).find((w) => w.dataset.branchKey === m)?.focus();
2472
+ const b = e.parent(t.key), p = d.currentTarget.closest("table");
2473
+ Array.from(p?.querySelectorAll("[data-branch-key]") ?? []).find((w) => w.dataset.branchKey === b)?.focus();
2474
2474
  }
2475
2475
  }
2476
2476
  };
2477
- return /* @__PURE__ */ R("span", { className: h.treeCell, style: { "--tree-level": t.level }, children: [
2478
- i ? /* @__PURE__ */ f(
2477
+ return /* @__PURE__ */ T("span", { className: h.treeCell, style: { "--tree-level": t.level }, children: [
2478
+ l ? /* @__PURE__ */ f(
2479
2479
  "button",
2480
2480
  {
2481
2481
  type: "button",
2482
- className: F(h.fold, !c && h.foldClosed),
2482
+ className: D(h.fold, !c && h.foldClosed),
2483
2483
  "data-branch-key": t.key,
2484
2484
  "aria-expanded": c,
2485
2485
  "aria-label": c ? r.foldBranch(o) : r.unfoldBranch(o),
@@ -2488,20 +2488,20 @@ function Fl({
2488
2488
  children: /* @__PURE__ */ f(wo, {})
2489
2489
  }
2490
2490
  ) : /* @__PURE__ */ f("span", { className: h.foldSlot }),
2491
- /* @__PURE__ */ R("span", { className: h.treeText, children: [
2491
+ /* @__PURE__ */ T("span", { className: h.treeText, children: [
2492
2492
  s,
2493
2493
  t.pathOnly && /* @__PURE__ */ f(Oe, { children: `, ${r.pathRow}` })
2494
2494
  ] })
2495
2495
  ] });
2496
2496
  }
2497
- function Dl(e, t, n, o) {
2498
- const r = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Set(), i = [];
2497
+ function Bl(e, t, n, o) {
2498
+ const r = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Set(), l = [];
2499
2499
  return e.forEach((c, a) => {
2500
- r.set(c.key, c), i.length = c.level, s.set(c.key, i.at(-1)), i.push(c.key), e[a + 1]?.level === 0 && l.add(c.key);
2500
+ r.set(c.key, c), l.length = c.level, s.set(c.key, l.at(-1)), l.push(c.key), e[a + 1]?.level === 0 && i.add(c.key);
2501
2501
  }), {
2502
2502
  column: o,
2503
2503
  entry: (c) => r.get(t.rowKey(c)),
2504
- beforeRoot: (c) => l.has(c),
2504
+ beforeRoot: (c) => i.has(c),
2505
2505
  parent: (c) => s.get(c),
2506
2506
  /* Against the open branches, not against what is shown: a branch open
2507
2507
  only on the way to a match is not open, and folding it must not
@@ -2517,32 +2517,32 @@ function Dl(e, t, n, o) {
2517
2517
  }
2518
2518
  };
2519
2519
  }
2520
- function Bl({
2520
+ function Vl({
2521
2521
  registry: e,
2522
2522
  hook: t,
2523
2523
  props: n,
2524
2524
  layout: o,
2525
2525
  grid: r
2526
2526
  }) {
2527
- const { selectable: s = !1, loading: l = !1, grid: i = !1 } = n, { snapshot: c, projection: a, virtual: u, lines: d, spanEntry: m, dataColumns: b, expanderColumn: p, controlColumns: w, trailing: g, blocks: v, rows: A, footerShown: y } = o, _ = i ? sl({
2528
- layout: { controls: w, span: m !== void 0, aggregates: b.map((L) => L.spec.aggregate !== void 0), actions: g, blocks: v },
2529
- body: l ? { rows: [] } : d ? { lines: u ? a.lines : d } : { rows: u ? a.shown ?? a.filtered : A },
2527
+ const { selectable: s = !1, loading: i = !1, grid: l = !1 } = n, { snapshot: c, projection: a, virtual: u, lines: d, spanEntry: b, dataColumns: p, expanderColumn: m, controlColumns: w, trailing: g, blocks: v, rows: x, footerShown: y } = o, _ = l ? sl({
2528
+ layout: { controls: w, span: b !== void 0, aggregates: p.map((L) => L.spec.aggregate !== void 0), actions: g, blocks: v },
2529
+ body: i ? { rows: [] } : d ? { lines: u ? a.lines : d } : { rows: u ? a.shown ?? a.filtered : x },
2530
2530
  rowKey: t.rowKey,
2531
- expanded: o.detail ? ql(e, c, a.shown ?? a.filtered, t.rowKey, o.tree) : /* @__PURE__ */ new Set(),
2531
+ expanded: o.detail ? Fl(e, c, a.shown ?? a.filtered, t.rowKey, o.tree) : /* @__PURE__ */ new Set(),
2532
2532
  foot: y
2533
2533
  }) : [], S = r.state.editing?.line === he ? r.state.editing : null;
2534
2534
  S && _[0] && _.splice(1, 0, { key: he, cells: _[0].cells, at: -1, row: S.fresh });
2535
2535
  const C = [
2536
2536
  ...s ? ["#select"] : [],
2537
- ...p ? ["#detail"] : [],
2538
- ...m ? ["#span"] : [],
2539
- ...b.map((L) => L.spec.id),
2537
+ ...m ? ["#detail"] : [],
2538
+ ...b ? ["#span"] : [],
2539
+ ...p.map((L) => L.spec.id),
2540
2540
  ...g ? ["#actions"] : []
2541
- ], x = i ? bl({
2541
+ ], A = l ? bl({
2542
2542
  grid: r,
2543
2543
  lines: _,
2544
2544
  ids: C,
2545
- columnById: (L) => b.find((k) => k.spec.id === L),
2545
+ columnById: (L) => p.find((k) => k.spec.id === L),
2546
2546
  rowKey: t.rowKey,
2547
2547
  virtual: u,
2548
2548
  onCellEdit: n.onCellEdit,
@@ -2553,85 +2553,96 @@ function Bl({
2553
2553
  onRowDelete: n.onRowDelete,
2554
2554
  select: s ? (L) => c.selection.toggle(t.rowKey(L)) : void 0
2555
2555
  }) : void 0;
2556
- return { lines: _, fresh: S, ids: C, events: x };
2556
+ return { lines: _, fresh: S, ids: C, events: A };
2557
2557
  }
2558
- function Vl(e) {
2558
+ function Pl(e) {
2559
2559
  for (const t of e) t.removeAttribute("data-copied");
2560
2560
  document.body.offsetWidth;
2561
2561
  for (const t of e) t.setAttribute("data-copied", "");
2562
2562
  }
2563
- function Pl({
2563
+ function Il({
2564
2564
  registry: e,
2565
2565
  hook: t,
2566
2566
  grid: n,
2567
2567
  gridMode: o,
2568
2568
  gridLines: r,
2569
2569
  dataColumns: s,
2570
- formats: l,
2571
- wording: i,
2570
+ formats: i,
2571
+ wording: l,
2572
2572
  tableElement: c
2573
2573
  }) {
2574
2574
  return (a) => {
2575
- const u = (x) => qo(x, c());
2575
+ const u = (A) => Fo(A, c());
2576
2576
  if (a.defaultPrevented || a.altKey || a.shiftKey || a.ctrlKey === a.metaKey || a.key.toLowerCase() !== "c") return;
2577
- const { target: d, currentTarget: m } = a;
2577
+ const { target: d, currentTarget: b } = a;
2578
2578
  if (!(d instanceof Element)) return;
2579
- const b = d.closest("td, th"), p = b?.dataset.editing, w = d.closest("input, textarea, select, [contenteditable]:not([contenteditable='false'])");
2580
- if (w?.matches("textarea, [contenteditable]:not([contenteditable='false']), input:not([type=checkbox], [type=radio], [type=button], [type=submit], [type=reset], [type=range], [type=color], [type=file], [type=image])") && p === void 0 || window.getSelection()?.toString() || (w instanceof HTMLInputElement || w instanceof HTMLTextAreaElement) && w.selectionStart !== w.selectionEnd) return;
2581
- let v = "", A = "", y = b ? [b] : [];
2582
- const _ = eo(e), S = p === void 0 ? void 0 : s.find((x) => x.spec.id === p);
2579
+ const p = d.closest("td, th"), m = p?.dataset.editing, w = d.closest("input, textarea, select, [contenteditable]:not([contenteditable='false'])");
2580
+ if (w?.matches("textarea, [contenteditable]:not([contenteditable='false']), input:not([type=checkbox], [type=radio], [type=button], [type=submit], [type=reset], [type=range], [type=color], [type=file], [type=image])") && m === void 0 || window.getSelection()?.toString() || (w instanceof HTMLInputElement || w instanceof HTMLTextAreaElement) && w.selectionStart !== w.selectionEnd) return;
2581
+ let v = "", x = "", y = p ? [p] : [];
2582
+ const _ = eo(e), S = m === void 0 ? void 0 : s.find((A) => A.spec.id === m);
2583
2583
  if (S)
2584
- v = w instanceof HTMLInputElement || w instanceof HTMLTextAreaElement ? w.value : no(S, n.state.editing?.drafts[S.spec.id], l, i), A = i.copiedCell;
2584
+ v = w instanceof HTMLInputElement || w instanceof HTMLTextAreaElement ? w.value : no(S, n.state.editing?.drafts[S.spec.id], i, l), x = l.copiedCell;
2585
2585
  else if (_.length > 0) {
2586
- v = to(e, l, i), A = i.copiedRows(_.length, l.count(_.length));
2587
- const x = new Set(_.map((L) => t.rowKey(L)));
2588
- y = Array.from(m.querySelectorAll("tr[data-motion]")).filter((L) => x.has(L.dataset.motion)).flatMap((L) => Array.from(L.children));
2586
+ v = to(e, i, l), x = l.copiedRows(_.length, i.count(_.length));
2587
+ const A = new Set(_.map((L) => t.rowKey(L)));
2588
+ y = Array.from(b.querySelectorAll("tr[data-motion]")).filter((L) => A.has(L.dataset.motion)).flatMap((L) => Array.from(L.children));
2589
2589
  } else if (o && n.state.active) {
2590
- const { line: x, column: L } = n.state.active, k = r.find((T) => T.key === x), O = s.find((T) => T.spec.id === L);
2590
+ const { line: A, column: L } = n.state.active, k = r.find((R) => R.key === A), O = s.find((R) => R.spec.id === L);
2591
2591
  if (!k || k.row === void 0 || k.key !== Ue(t.rowKey(k.row)) || !O) return;
2592
- const M = Array.from(m.querySelectorAll("tr[data-grid-line]")).find((T) => T.dataset.gridLine === x)?.children[n.state.active.columnIndex];
2593
- M && (y = [M]), v = ji(O, k.row, l, i), A = i.copiedCell;
2592
+ const M = Array.from(b.querySelectorAll("tr[data-grid-line]")).find((R) => R.dataset.gridLine === A)?.children[n.state.active.columnIndex];
2593
+ M && (y = [M]), v = Hi(O, k.row, i, l), x = l.copiedCell;
2594
2594
  } else return;
2595
2595
  a.preventDefault();
2596
- const C = (x) => {
2597
- X("copy-failed", `The clipboard refused the copy (${String(x)}). It needs a secure context and a focused document.`), u(i.copyFailed);
2596
+ const C = (A) => {
2597
+ X("copy-failed", `The clipboard refused the copy (${String(A)}). It needs a secure context and a focused document.`), u(l.copyFailed);
2598
2598
  };
2599
2599
  Promise.resolve().then(() => navigator.clipboard.writeText(v)).then(() => {
2600
- Vl(y), u(A);
2600
+ Pl(y), u(x);
2601
2601
  }, C);
2602
2602
  };
2603
2603
  }
2604
- function Il({ table: e }) {
2605
- const [t, n] = P(null), o = Fo(), r = W(null);
2606
- return xe(() => {
2607
- const s = e.current;
2608
- if (!s) return;
2604
+ function $l({ table: e }) {
2605
+ const [t, n] = I(null), o = Do(), r = q(null);
2606
+ xe(() => {
2607
+ const i = e.current;
2608
+ if (!i) return;
2609
2609
  let l;
2610
- const i = () => {
2610
+ const c = () => {
2611
2611
  clearTimeout(l), n(null);
2612
- }, c = (m, b) => {
2612
+ }, a = (p, m) => {
2613
2613
  clearTimeout(l);
2614
- const p = m instanceof Element ? m.closest("td, th") : null, w = m instanceof Element ? m.closest(`.${h.headLine}`) : null, g = w ? w.querySelector(`.${h.headLabel}`) : p?.querySelector(`:scope > .${h.value}, :scope .${h.treeText} > .${h.value}`);
2615
- if (!p || !g || g.childElementCount > 0 || g.scrollWidth <= g.clientWidth + 1) return n(null);
2616
- const v = s.closest("dialog") ?? o() ?? document.body;
2617
- l = setTimeout(() => n({ text: g.textContent ?? "", cell: p.getBoundingClientRect(), target: v }), b);
2618
- }, a = (m) => c(m.target, 300), u = (m) => c(m.target, 0), d = (m) => {
2619
- m.key === "Escape" && i();
2614
+ const w = p instanceof Element ? p.closest("td, th") : null, g = p instanceof Element ? p.closest(`.${h.headLine}`) : null, v = g ? g.querySelector(`.${h.headLabel}`) : w?.querySelector(`:scope > .${h.value}, :scope .${h.treeText} > .${h.value}`);
2615
+ if (!w || !v || v.childElementCount > 0 || v.scrollWidth <= v.clientWidth + 1) return n(null);
2616
+ const x = i.closest("dialog") ?? o() ?? document.body;
2617
+ l = setTimeout(() => n({ text: v.textContent ?? "", cell: w.getBoundingClientRect(), target: x }), m);
2618
+ }, u = (p) => a(p.target, 300), d = (p) => a(p.target, 0), b = (p) => {
2619
+ p.key === "Escape" && c();
2620
2620
  };
2621
- return s.addEventListener("pointerover", a), s.addEventListener("pointerleave", i), s.addEventListener("focusin", u), s.addEventListener("focusout", i), document.addEventListener("keydown", d), window.addEventListener("scroll", i, !0), () => {
2622
- clearTimeout(l), s.removeEventListener("pointerover", a), s.removeEventListener("pointerleave", i), s.removeEventListener("focusin", u), s.removeEventListener("focusout", i), document.removeEventListener("keydown", d), window.removeEventListener("scroll", i, !0);
2621
+ return i.addEventListener("pointerover", u), i.addEventListener("pointerleave", c), i.addEventListener("focusin", d), i.addEventListener("focusout", c), document.addEventListener("keydown", b), window.addEventListener("scroll", c, !0), () => {
2622
+ clearTimeout(l), i.removeEventListener("pointerover", u), i.removeEventListener("pointerleave", c), i.removeEventListener("focusin", d), i.removeEventListener("focusout", c), document.removeEventListener("keydown", b), window.removeEventListener("scroll", c, !0);
2623
2623
  };
2624
- }, [e, o]), te(() => {
2625
- const s = r.current;
2626
- if (!t || !s) return;
2627
- const l = 4, i = t.cell.bottom + l + s.offsetHeight <= window.innerHeight;
2628
- s.style.top = `${i ? t.cell.bottom + l : t.cell.top - l - s.offsetHeight}px`, s.style.left = `${Math.max(8, Math.min(t.cell.left, window.innerWidth - 8 - s.offsetWidth))}px`, s.style.visibility = "";
2624
+ }, [e, o]);
2625
+ const s = !!t && t.target instanceof HTMLDialogElement && "showPopover" in HTMLElement.prototype;
2626
+ return Z(() => {
2627
+ const i = r.current;
2628
+ if (!s || !i?.isConnected) return;
2629
+ let l = !1;
2630
+ try {
2631
+ l = i.matches(":popover-open");
2632
+ } catch {
2633
+ }
2634
+ l || i.showPopover();
2635
+ }), Z(() => {
2636
+ const i = r.current;
2637
+ if (!t || !i) return;
2638
+ const l = 4, c = t.cell.bottom + l + i.offsetHeight <= window.innerHeight;
2639
+ i.style.top = `${c ? t.cell.bottom + l : t.cell.top - l - i.offsetHeight}px`, i.style.left = `${Math.max(8, Math.min(t.cell.left, window.innerWidth - 8 - i.offsetWidth))}px`, i.style.visibility = "";
2629
2640
  }, [t]), t ? En(
2630
- /* @__PURE__ */ f("div", { ref: r, role: "tooltip", className: h.cutTip, style: { visibility: "hidden", top: 0, left: 0 }, children: t.text }),
2641
+ /* @__PURE__ */ f("div", { ref: r, role: "tooltip", popover: s ? "manual" : void 0, className: h.cutTip, style: { visibility: "hidden", top: 0, left: 0 }, children: t.text }),
2631
2642
  t.target
2632
2643
  ) : null;
2633
2644
  }
2634
- function qt(e, t) {
2645
+ function Ft(e, t) {
2635
2646
  const n = e.scrollWidth - e.clientWidth;
2636
2647
  e.toggleAttribute("data-beyond-start", !t.start && e.scrollLeft > 0.5), e.toggleAttribute("data-beyond-end", !t.end && e.scrollLeft < n - 0.5);
2637
2648
  }
@@ -2645,50 +2656,50 @@ function yo(e) {
2645
2656
  t.toggleAttribute("data-stuck", o);
2646
2657
  }
2647
2658
  }
2648
- function $l(e, t) {
2659
+ function zl(e, t) {
2649
2660
  const n = t.state.editing?.line;
2650
- te(() => {
2661
+ Z(() => {
2651
2662
  const o = e.hook;
2652
2663
  !o || n === void 0 || n === he || o.rows.some((r) => Ue(o.rowKey(r)) === n) || t.setState((r) => ({ ...r, editing: null }));
2653
2664
  });
2654
2665
  }
2655
- function zl(e, t) {
2656
- te(() => {
2666
+ function Kl(e, t) {
2667
+ Z(() => {
2657
2668
  const n = e.current;
2658
2669
  if (n?.parentElement && !t && n.parentElement.style.removeProperty("scroll-padding-top"), !n || !t) return;
2659
2670
  const o = n.tHead?.getBoundingClientRect().height ?? 0, r = n.querySelector("tr[data-line='header']")?.getBoundingClientRect().height ?? 0;
2660
2671
  n.style.setProperty("--u-table-head", `${o}px`), n.style.setProperty("--u-table-group-header", `${r}px`), n.parentElement?.style.setProperty("scroll-padding-top", `${o}px`), n.parentElement && yo(n.parentElement);
2661
2672
  });
2662
2673
  }
2663
- function Kl(e, t) {
2664
- te(() => {
2674
+ function Gl(e, t) {
2675
+ Z(() => {
2665
2676
  const n = e.takeFocusBeforeFold(), o = t.current;
2666
2677
  if (!n || !o || n.table !== o || n.element.isConnected) return;
2667
2678
  const r = Array.from(o.querySelectorAll("[data-fold-path]")), s = JSON.parse(n.group);
2668
- for (let l = s.length; l > 0; l--) {
2669
- const i = JSON.stringify(s.slice(0, l)), c = r.find((a) => a.dataset.foldPath === i);
2679
+ for (let i = s.length; i > 0; i--) {
2680
+ const l = JSON.stringify(s.slice(0, i)), c = r.find((a) => a.dataset.foldPath === l);
2670
2681
  if (c) return c.focus();
2671
2682
  }
2672
2683
  });
2673
2684
  }
2674
- function Gl(e, t, n) {
2675
- const o = W(null);
2676
- te(() => {
2685
+ function jl(e, t, n) {
2686
+ const o = q(null);
2687
+ Z(() => {
2677
2688
  const r = t.current?.tBodies[0];
2678
2689
  if (!r || !e.server) return;
2679
2690
  if (!n) {
2680
- const i = r.querySelector(":scope > tr[data-motion]");
2681
- i && (o.current = Array.from(i.cells, (c) => c.getBoundingClientRect().width));
2691
+ const l = r.querySelector(":scope > tr[data-motion]");
2692
+ l && (o.current = Array.from(l.cells, (c) => c.getBoundingClientRect().width));
2682
2693
  return;
2683
2694
  }
2684
- const s = o.current, l = r.rows[0];
2685
- s && l?.cells.length === s.length && Array.from(l.cells).forEach((i, c) => i.style.width = `${s[c]}px`);
2695
+ const s = o.current, i = r.rows[0];
2696
+ s && i?.cells.length === s.length && Array.from(i.cells).forEach((l, c) => l.style.width = `${s[c]}px`);
2686
2697
  });
2687
2698
  }
2688
- function jl(e) {
2699
+ function Hl(e) {
2689
2700
  xe(() => {
2690
2701
  const t = e.current;
2691
- if (!(!Kt || !t)) {
2702
+ if (!(!Gt || !t)) {
2692
2703
  for (const n of Array.from(t.querySelectorAll(`tbody .${h.value}`))) {
2693
2704
  if (n.scrollHeight <= n.clientHeight + 1) continue;
2694
2705
  const o = n.closest("td, th"), r = o?.parentElement ? Array.from(o.parentElement.children).indexOf(o) : -1, s = t.tHead?.rows[0]?.cells[r]?.textContent?.trim() || `column ${r + 1}`;
@@ -2707,56 +2718,56 @@ function jl(e) {
2707
2718
  }
2708
2719
  });
2709
2720
  }
2710
- function Hl(e, t) {
2711
- te(() => {
2721
+ function Wl(e, t) {
2722
+ Z(() => {
2712
2723
  const n = t.current?.tHead?.rows[0]?.getBoundingClientRect().height;
2713
2724
  n && e.hook?.tableState.virtual && e.hook.tableState.setPitch(n);
2714
2725
  });
2715
2726
  }
2716
2727
  const Yt = (e, t) => e ? t : void 0;
2717
- function Wl({
2728
+ function ql({
2718
2729
  registry: e,
2719
2730
  hook: t,
2720
2731
  props: n,
2721
2732
  drafting: o,
2722
2733
  sticking: r
2723
2734
  }) {
2724
- const { selectable: s = !1, loading: l = !1, grid: i = !1 } = n, c = t.publicSnapshot, a = e.projection(), u = e.rowHeader(), d = Xn(e), m = e.detail, b = e.hasRowActions() ? e.actions.ordered() : [], p = t.tableState.virtual, w = c.grouping, g = w.length > 0 ? a.visibleLines : void 0, v = g ? e.groupingEntries(t.rows) : [], A = (oe) => v.find((H) => H.spec.id === oe), y = g && w.length > 1 ? A(w.at(-1)) : void 0, _ = g ? d.filter((oe) => !w.includes(oe.spec.id)) : d, S = a.entries, C = S ? Dl(S, t, c, _[0]) : void 0, x = m !== null && !S, L = (s ? 1 : 0) + (x ? 1 : 0), k = L + (y ? 1 : 0), O = i && n.editMode === "row", M = i && (O || n.onRowAdd !== void 0 || n.onRowDelete !== void 0), T = b.length > 0 || M, E = k + _.length + (T ? 1 : 0), D = e.pins(), I = _.filter((oe) => D[oe.spec.id] === "start").length, B = _.filter((oe) => D[oe.spec.id] === "end").length, z = y !== void 0 && D[y.spec.id] === "start", Y = b.length > 0 || n.onRowDelete !== void 0 || o, ce = e.actionsPinned() ? Y : o && M, G = {
2725
- start: I > 0 || z ? k + I : 0,
2726
- end: B > 0 ? B + (T ? 1 : 0) : T && ce ? 1 : 0,
2735
+ const { selectable: s = !1, loading: i = !1, grid: l = !1 } = n, c = t.publicSnapshot, a = e.projection(), u = e.rowHeader(), d = Xn(e), b = e.detail, p = e.hasRowActions() ? e.actions.ordered() : [], m = t.tableState.virtual, w = c.grouping, g = w.length > 0 ? a.visibleLines : void 0, v = g ? e.groupingEntries(t.rows) : [], x = (oe) => v.find((W) => W.spec.id === oe), y = g && w.length > 1 ? x(w.at(-1)) : void 0, _ = g ? d.filter((oe) => !w.includes(oe.spec.id)) : d, S = a.entries, C = S ? Bl(S, t, c, _[0]) : void 0, A = b !== null && !S, L = (s ? 1 : 0) + (A ? 1 : 0), k = L + (y ? 1 : 0), O = l && n.editMode === "row", M = l && (O || n.onRowAdd !== void 0 || n.onRowDelete !== void 0), R = p.length > 0 || M, E = k + _.length + (R ? 1 : 0), B = e.pins(), $ = _.filter((oe) => B[oe.spec.id] === "start").length, V = _.filter((oe) => B[oe.spec.id] === "end").length, K = y !== void 0 && B[y.spec.id] === "start", Y = p.length > 0 || n.onRowDelete !== void 0 || o, ce = e.actionsPinned() ? Y : o && M, j = {
2736
+ start: $ > 0 || K ? k + $ : 0,
2737
+ end: V > 0 ? V + (R ? 1 : 0) : R && ce ? 1 : 0,
2727
2738
  count: E
2728
2739
  }, ne = {
2729
- start: r.start ? G.start : 0,
2730
- end: r.end || o && M ? G.end : 0,
2740
+ start: r.start ? j.start : 0,
2741
+ end: r.end || o && M ? j.end : 0,
2731
2742
  count: E
2732
- }, de = a.visible, le = !l && !c.server && _.some((oe) => oe.spec.aggregate), Z = c.search !== "" || Object.keys(c.filter).length > 0;
2743
+ }, de = a.visible, le = !i && !c.server && _.some((oe) => oe.spec.aggregate), ee = c.search !== "" || Object.keys(c.filter).length > 0;
2733
2744
  return {
2734
2745
  snapshot: c,
2735
2746
  projection: a,
2736
2747
  header: u,
2737
- detail: m,
2738
- actions: b,
2739
- virtual: p,
2748
+ detail: b,
2749
+ actions: p,
2750
+ virtual: m,
2740
2751
  grouping: w,
2741
2752
  lines: g,
2742
- entryOf: A,
2753
+ entryOf: x,
2743
2754
  spanEntry: y,
2744
2755
  dataColumns: _,
2745
2756
  entries: S,
2746
2757
  tree: C,
2747
- expanderColumn: x,
2758
+ expanderColumn: A,
2748
2759
  controlColumns: L,
2749
2760
  leading: k,
2750
2761
  rowMode: O,
2751
2762
  rowTools: M,
2752
- trailing: T,
2763
+ trailing: R,
2753
2764
  columnCount: E,
2754
- pins: D,
2755
- pinned: G,
2765
+ pins: B,
2766
+ pinned: j,
2756
2767
  blocks: ne,
2757
2768
  rows: de,
2758
2769
  footerShown: le,
2759
- restricted: Z
2770
+ restricted: ee
2760
2771
  };
2761
2772
  }
2762
2773
  const Yl = 2;
@@ -2767,49 +2778,49 @@ function yn({
2767
2778
  wording: o,
2768
2779
  line: r
2769
2780
  }) {
2770
- const s = _e(Ve), l = s?.editing?.row === !0 && s.editing.line !== r, i = s?.remove, [c, a] = P(!1), u = W(!1), d = W(null), m = W(null);
2781
+ const s = _e(Pe), i = s?.editing?.row === !0 && s.editing.line !== r, l = s?.remove, [c, a] = I(!1), u = q(!1), d = q(null), b = q(null);
2771
2782
  xe(() => {
2772
- c ? m.current?.focus() : u.current && d.current?.focus(), u.current = c;
2783
+ c ? b.current?.focus() : u.current && d.current?.focus(), u.current = c;
2773
2784
  }, [c]);
2774
- const b = (w) => {
2775
- if (l) return;
2785
+ const p = (w) => {
2786
+ if (i) return;
2776
2787
  const g = w.onSelect;
2777
2788
  g(w.bulk ? [t] : t);
2778
- }, p = i && (c ? /* @__PURE__ */ R(re, { children: [
2789
+ }, m = l && (c ? /* @__PURE__ */ T(re, { children: [
2779
2790
  /* @__PURE__ */ f("span", { className: h.deleteAsk, children: o.deleteRowAsk }),
2780
2791
  /* @__PURE__ */ f(Q, { className: h.toned, size: "sm", variant: "danger", "aria-label": o.rowAction(o.deleteRow, n), onClick: () => {
2781
- a(!1), i(t);
2792
+ a(!1), l(t);
2782
2793
  }, children: o.deleteRow }),
2783
- /* @__PURE__ */ f(Q, { ref: m, size: "sm", variant: "ghost", "aria-label": o.rowAction(o.keepRow, n), onClick: () => a(!1), children: o.keepRow })
2784
- ] }) : /* @__PURE__ */ f(Q, { ref: d, size: "sm", variant: "ghost", "aria-label": o.rowAction(o.deleteRow, n), onClick: () => !l && a(!0), children: o.deleteRow }));
2785
- return e.length <= Yl ? /* @__PURE__ */ R("div", { className: F(h.actions, c && h.decision), children: [
2794
+ /* @__PURE__ */ f(Q, { ref: b, size: "sm", variant: "ghost", "aria-label": o.rowAction(o.keepRow, n), onClick: () => a(!1), children: o.keepRow })
2795
+ ] }) : /* @__PURE__ */ f(Q, { ref: d, size: "sm", variant: "ghost", "aria-label": o.rowAction(o.deleteRow, n), onClick: () => !i && a(!0), children: o.deleteRow }));
2796
+ return e.length <= Yl ? /* @__PURE__ */ T("div", { className: D(h.actions, c && h.decision), children: [
2786
2797
  !c && e.map(({ key: w, spec: g }) => /* @__PURE__ */ f(
2787
2798
  Q,
2788
2799
  {
2789
2800
  size: "sm",
2790
2801
  variant: "ghost",
2791
2802
  "aria-label": o.rowAction(g.label, n),
2792
- onClick: () => b(g),
2803
+ onClick: () => p(g),
2793
2804
  children: g.label
2794
2805
  },
2795
2806
  w
2796
2807
  )),
2797
- p
2798
- ] }) : /* @__PURE__ */ R("div", { className: F(h.actions, c && h.decision), children: [
2808
+ m
2809
+ ] }) : /* @__PURE__ */ T("div", { className: D(h.actions, c && h.decision), children: [
2799
2810
  !c && /* @__PURE__ */ f(
2800
2811
  Nn,
2801
2812
  {
2802
2813
  align: "end",
2803
- trigger: /* @__PURE__ */ f(Do, { size: "sm", variant: "ghost", "aria-label": o.rowActionsMenu(n), children: "⋯" }),
2804
- children: e.map(({ key: w, spec: g }) => /* @__PURE__ */ f(nt, { tone: g.tone, onSelect: () => b(g), children: g.label }, w))
2814
+ trigger: /* @__PURE__ */ f(Bo, { size: "sm", variant: "ghost", "aria-label": o.rowActionsMenu(n), children: "⋯" }),
2815
+ children: e.map(({ key: w, spec: g }) => /* @__PURE__ */ f(nt, { tone: g.tone, onSelect: () => p(g), children: g.label }, w))
2805
2816
  }
2806
2817
  ),
2807
- p
2818
+ m
2808
2819
  ] });
2809
2820
  }
2810
2821
  function Ul({ name: e, wording: t }) {
2811
- const n = _e(Ve), o = W(null);
2812
- return /* @__PURE__ */ R("div", { ref: o, className: F(h.actions, h.decision, h.draftButtons), children: [
2822
+ const n = _e(Pe), o = q(null);
2823
+ return /* @__PURE__ */ T("div", { ref: o, className: D(h.actions, h.decision, h.draftButtons), children: [
2813
2824
  /* @__PURE__ */ f(Q, { className: h.toned, size: "sm", variant: "primary", "aria-label": t.rowAction(t.saveRow, e), onClick: n.save, children: t.saveRow }),
2814
2825
  /* @__PURE__ */ f(Q, { size: "sm", variant: "ghost", "aria-label": t.rowAction(t.discardRow, e), onClick: n.discard, children: t.discardRow }),
2815
2826
  /* @__PURE__ */ f(
@@ -2829,10 +2840,10 @@ function Ul({ name: e, wording: t }) {
2829
2840
  }
2830
2841
  function Jl({ columns: e, rightAligned: t = [], rows: n = 4 }) {
2831
2842
  const o = [72, 48, 60, 40, 56, 64];
2832
- return /* @__PURE__ */ f(re, { children: Array.from({ length: n }, (r, s) => /* @__PURE__ */ f("tr", { "aria-hidden": "true", children: Array.from({ length: e }, (l, i) => /* @__PURE__ */ f("td", { className: F(h.td, t[i] && h.numeric), children: /* @__PURE__ */ f("span", { className: h.skeleton, style: { width: `${o[(s + i) % o.length]}%` } }) }, i)) }, s)) });
2843
+ return /* @__PURE__ */ f(re, { children: Array.from({ length: n }, (r, s) => /* @__PURE__ */ f("tr", { "aria-hidden": "true", children: Array.from({ length: e }, (i, l) => /* @__PURE__ */ f("td", { className: D(h.td, t[l] && h.numeric), children: /* @__PURE__ */ f("span", { className: h.skeleton, style: { width: `${o[(s + l) % o.length]}%` } }) }, l)) }, s)) });
2833
2844
  }
2834
2845
  const _o = /* @__PURE__ */ rt(0);
2835
- function Ft({ height: e, colSpan: t }) {
2846
+ function Dt({ height: e, colSpan: t }) {
2836
2847
  return typeof e == "number" && e <= 0 ? null : /* @__PURE__ */ f("tr", { "aria-hidden": "true", "data-filler": "", className: h.fillerRow, children: /* @__PURE__ */ f("td", { colSpan: t, style: { height: e } }) });
2837
2848
  }
2838
2849
  function ko({
@@ -2840,31 +2851,31 @@ function ko({
2840
2851
  colSpan: t,
2841
2852
  children: n
2842
2853
  }) {
2843
- const { count: o, fillerBefore: r, fillerAfter: s, showRow: l } = e, i = W(null), [c, a] = P(0), u = (b, p) => {
2844
- i.current = p, a(p), l(p), requestAnimationFrame(() => {
2845
- b.querySelector(`[data-row="${p}"]`)?.focus();
2854
+ const { count: o, fillerBefore: r, fillerAfter: s, showRow: i } = e, l = q(null), [c, a] = I(0), u = (p, m) => {
2855
+ l.current = m, a(m), i(m), requestAnimationFrame(() => {
2856
+ p.querySelector(`[data-row="${m}"]`)?.focus();
2846
2857
  });
2847
- }, d = c >= e.from && c < e.to ? c : e.from, m = (b) => {
2848
- if (b.defaultPrevented || o === 0) return;
2849
- const p = b.target, w = p.closest("[data-row]");
2850
- if (w && p !== w) return;
2851
- const g = w ? Number(w.dataset.row) : i.current ?? -1;
2858
+ }, d = c >= e.from && c < e.to ? c : e.from, b = (p) => {
2859
+ if (p.defaultPrevented || o === 0) return;
2860
+ const m = p.target, w = m.closest("[data-row]");
2861
+ if (w && m !== w) return;
2862
+ const g = w ? Number(w.dataset.row) : l.current ?? -1;
2852
2863
  let v = null;
2853
- b.key === "ArrowDown" ? v = Math.min(o - 1, g + 1) : b.key === "ArrowUp" ? v = Math.max(0, g - 1) : b.key === "Home" ? v = 0 : b.key === "End" && (v = o - 1), !(v === null || v === g) && (b.preventDefault(), u(b.currentTarget, v));
2864
+ p.key === "ArrowDown" ? v = Math.min(o - 1, g + 1) : p.key === "ArrowUp" ? v = Math.max(0, g - 1) : p.key === "Home" ? v = 0 : p.key === "End" && (v = o - 1), !(v === null || v === g) && (p.preventDefault(), u(p.currentTarget, v));
2854
2865
  };
2855
2866
  return /* @__PURE__ */ f(
2856
2867
  "tbody",
2857
2868
  {
2858
2869
  className: h.virtualBody,
2859
- onKeyDown: m,
2860
- onFocus: (b) => {
2861
- const p = b.target.closest("[data-row]");
2862
- p && a(Number(p.dataset.row));
2870
+ onKeyDown: b,
2871
+ onFocus: (p) => {
2872
+ const m = p.target.closest("[data-row]");
2873
+ m && a(Number(m.dataset.row));
2863
2874
  },
2864
- children: /* @__PURE__ */ R(_o, { value: d, children: [
2865
- /* @__PURE__ */ f(Ft, { height: r, colSpan: t }),
2875
+ children: /* @__PURE__ */ T(_o, { value: d, children: [
2876
+ /* @__PURE__ */ f(Dt, { height: r, colSpan: t }),
2866
2877
  n,
2867
- /* @__PURE__ */ f(Ft, { height: s, colSpan: t })
2878
+ /* @__PURE__ */ f(Dt, { height: s, colSpan: t })
2868
2879
  ] })
2869
2880
  }
2870
2881
  );
@@ -2872,7 +2883,7 @@ function ko({
2872
2883
  function Xl(e, t, n, o, r) {
2873
2884
  if (!t) return n.rowKey(e);
2874
2885
  const s = t.read(e);
2875
- return se(s) ? r.cellAbsentValue : Be(s, t.spec.format, o, r) ?? n.rowKey(e);
2886
+ return se(s) ? r.cellAbsentValue : Ve(s, t.spec.format, o, r) ?? n.rowKey(e);
2876
2887
  }
2877
2888
  function So({
2878
2889
  row: e,
@@ -2881,40 +2892,40 @@ function So({
2881
2892
  registry: o,
2882
2893
  hook: r,
2883
2894
  columns: s,
2884
- header: l,
2885
- selectable: i,
2895
+ header: i,
2896
+ selectable: l,
2886
2897
  actions: c,
2887
2898
  blocks: a,
2888
2899
  columnCount: u,
2889
2900
  rowProps: d,
2890
- baseId: m,
2891
- formats: b,
2892
- wording: p,
2901
+ baseId: b,
2902
+ formats: p,
2903
+ wording: m,
2893
2904
  line: w,
2894
2905
  tree: g,
2895
2906
  spanEntry: v,
2896
- grid: A,
2907
+ grid: x,
2897
2908
  trailing: y,
2898
2909
  fresh: _ = !1
2899
2910
  }) {
2900
- const S = _e(_o), C = r.publicSnapshot, x = _ ? he : r.rowKey(e), L = _ ? p.newRow : Xl(e, l, r, b, p), k = _ ? he : Ue(x), O = _e(Ve)?.editing, M = O?.row === !0 && O.line === k, T = o.detail, E = _ ? void 0 : g?.entry(e), D = _ ? null : bo(o, C, e, x, E), I = D !== null, B = D?.open ?? !1, z = D?.content, Y = `${m}-detail-${t}`, { className: ce, ...G } = d?.(e) ?? {}, ne = n !== void 0, de = w ? w.span ?? w.parents.at(-1) : void 0, le = T !== null && !g, Z = (i ? 1 : 0) + (le ? 1 : 0), oe = Z + (v ? 1 : 0), H = (q) => ct(a, q), ge = E !== void 0 && E.branch && !E.empty;
2901
- return /* @__PURE__ */ R(re, { children: [
2902
- /* @__PURE__ */ R(
2911
+ const S = _e(_o), C = r.publicSnapshot, A = _ ? he : r.rowKey(e), L = _ ? m.newRow : Xl(e, i, r, p, m), k = _ ? he : Ue(A), O = _e(Pe)?.editing, M = O?.row === !0 && O.line === k, R = o.detail, E = _ ? void 0 : g?.entry(e), B = _ ? null : bo(o, C, e, A, E), $ = B !== null, V = B?.open ?? !1, K = B?.content, Y = `${b}-detail-${t}`, { className: ce, ...j } = d?.(e) ?? {}, ne = n !== void 0, de = w ? w.span ?? w.parents.at(-1) : void 0, le = R !== null && !g, ee = (l ? 1 : 0) + (le ? 1 : 0), oe = ee + (v ? 1 : 0), W = (F) => ct(a, F), ge = E !== void 0 && E.branch && !E.empty;
2912
+ return /* @__PURE__ */ T(re, { children: [
2913
+ /* @__PURE__ */ T(
2903
2914
  "tr",
2904
2915
  {
2905
- ...G,
2906
- className: F(
2916
+ ...j,
2917
+ className: D(
2907
2918
  ce,
2908
2919
  ne && h.virtualRow,
2909
2920
  E && h.treeRow,
2910
2921
  ge && h.branchRow,
2911
2922
  E?.pathOnly && h.pathRow
2912
2923
  ),
2913
- "data-before-root": E && !B && g?.beforeRoot(x) ? "" : void 0,
2924
+ "data-before-root": E && !V && g?.beforeRoot(A) ? "" : void 0,
2914
2925
  "data-row": ne ? n : void 0,
2915
2926
  "data-line": w ? "row" : void 0,
2916
- "data-motion": x,
2917
- "data-selected": i && C.selection.isSelected(x) ? "" : void 0,
2927
+ "data-motion": A,
2928
+ "data-selected": l && C.selection.isSelected(A) ? "" : void 0,
2918
2929
  "data-group-first": w?.first ? "" : void 0,
2919
2930
  "data-group": de?.path,
2920
2931
  "aria-level": w ? w.parents.length + 1 : E ? E.level + 1 : void 0,
@@ -2922,31 +2933,31 @@ function So({
2922
2933
  "aria-setsize": de ? de.rows.length : E?.siblings,
2923
2934
  "aria-expanded": ge ? E.expanded : void 0,
2924
2935
  "data-branch": ge ? E.expanded ? "open" : "closed" : void 0,
2925
- tabIndex: ne && !A ? n === S ? 0 : -1 : void 0,
2926
- "data-grid-line": A ? k : void 0,
2936
+ tabIndex: ne && !x ? n === S ? 0 : -1 : void 0,
2937
+ "data-grid-line": x ? k : void 0,
2927
2938
  "data-draft": M ? "" : void 0,
2928
2939
  "data-even": ne && n % 2 === 1 ? "" : void 0,
2929
2940
  "aria-rowindex": ne ? n + 2 : void 0,
2930
2941
  children: [
2931
- _ && Array.from({ length: Z + (v ? 1 : 0) }, (q, ae) => /* @__PURE__ */ f("td", { className: F(h.td, ae < Z && h.control, H(ae).className), style: H(ae).style }, ae)),
2932
- !_ && i && /* @__PURE__ */ f("td", { className: F(h.td, h.control, H(0).className), style: H(0).style, children: /* @__PURE__ */ f(
2933
- He,
2942
+ _ && Array.from({ length: ee + (v ? 1 : 0) }, (F, ae) => /* @__PURE__ */ f("td", { className: D(h.td, ae < ee && h.control, W(ae).className), style: W(ae).style }, ae)),
2943
+ !_ && l && /* @__PURE__ */ f("td", { className: D(h.td, h.control, W(0).className), style: W(0).style, children: /* @__PURE__ */ f(
2944
+ We,
2934
2945
  {
2935
- "aria-label": p.selectRow(L),
2936
- checked: C.selection.isSelected(x),
2937
- onChange: () => C.selection.toggle(x)
2946
+ "aria-label": m.selectRow(L),
2947
+ checked: C.selection.isSelected(A),
2948
+ onChange: () => C.selection.toggle(A)
2938
2949
  }
2939
2950
  ) }),
2940
- !_ && le && /* @__PURE__ */ f("td", { className: F(h.td, h.control, H(Z - 1).className), style: H(Z - 1).style, children: I && /* @__PURE__ */ f(
2951
+ !_ && le && /* @__PURE__ */ f("td", { className: D(h.td, h.control, W(ee - 1).className), style: W(ee - 1).style, children: $ && /* @__PURE__ */ f(
2941
2952
  "button",
2942
2953
  {
2943
2954
  type: "button",
2944
- "aria-expanded": B,
2945
- "aria-controls": B ? Y : void 0,
2946
- "aria-label": B ? p.collapseRowNamed(L) : p.expandRowNamed(L),
2947
- className: F(h.expander, B && h.expanderOpen),
2948
- onClick: () => C.toggleRow(x),
2949
- children: /* @__PURE__ */ f(Bo, {})
2955
+ "aria-expanded": V,
2956
+ "aria-controls": V ? Y : void 0,
2957
+ "aria-label": V ? m.collapseRowNamed(L) : m.expandRowNamed(L),
2958
+ className: D(h.expander, V && h.expanderOpen),
2959
+ onClick: () => C.toggleRow(A),
2960
+ children: /* @__PURE__ */ f(Vo, {})
2950
2961
  }
2951
2962
  ) }),
2952
2963
  w && w.span && /* @__PURE__ */ f(
@@ -2954,28 +2965,28 @@ function So({
2954
2965
  {
2955
2966
  line: { ...w, span: w.span },
2956
2967
  entry: v,
2957
- selectable: i,
2958
- pin: H(Z),
2968
+ selectable: l,
2969
+ pin: W(ee),
2959
2970
  hook: r,
2960
- formats: b,
2961
- wording: p
2971
+ formats: p,
2972
+ wording: m
2962
2973
  }
2963
2974
  ),
2964
- s.map((q, ae) => /* @__PURE__ */ f(
2975
+ s.map((F, ae) => /* @__PURE__ */ f(
2965
2976
  ea,
2966
2977
  {
2967
- entry: q,
2978
+ entry: F,
2968
2979
  row: e,
2969
- kind: o.kindOf(q, r.rows),
2970
- pin: H(oe + ae),
2971
- formats: b,
2972
- wording: p,
2980
+ kind: o.kindOf(F, r.rows),
2981
+ pin: W(oe + ae),
2982
+ formats: p,
2983
+ wording: m,
2973
2984
  line: k,
2974
2985
  rowName: L,
2975
- width: C.widths[q.spec.id],
2976
- tree: E && q === g?.column ? { setup: g, entry: E, detail: I && !ge ? { open: B, toggle: () => C.toggleRow(x) } : void 0 } : void 0
2986
+ width: C.widths[F.spec.id],
2987
+ tree: E && F === g?.column ? { setup: g, entry: E, detail: $ && !ge ? { open: V, toggle: () => C.toggleRow(A) } : void 0 } : void 0
2977
2988
  },
2978
- q.key
2989
+ F.key
2979
2990
  )),
2980
2991
  y && /* @__PURE__ */ f(
2981
2992
  Ql,
@@ -2984,24 +2995,24 @@ function So({
2984
2995
  actions: _ ? [] : c,
2985
2996
  row: e,
2986
2997
  name: L,
2987
- wording: p,
2998
+ wording: m,
2988
2999
  line: k,
2989
- pin: H(u - 1)
3000
+ pin: W(u - 1)
2990
3001
  }
2991
3002
  )
2992
3003
  ]
2993
3004
  }
2994
3005
  ),
2995
- B && /* @__PURE__ */ f(
3006
+ V && /* @__PURE__ */ f(
2996
3007
  Zl,
2997
3008
  {
2998
3009
  id: Y,
2999
3010
  group: de?.path,
3000
- gridLine: A ? `detail:${x}` : void 0,
3001
- beforeRoot: E && g?.beforeRoot(x) ? "" : void 0,
3011
+ gridLine: x ? `detail:${A}` : void 0,
3012
+ beforeRoot: E && g?.beforeRoot(A) ? "" : void 0,
3002
3013
  colSpan: u,
3003
3014
  entry: E,
3004
- children: z
3015
+ children: K
3005
3016
  }
3006
3017
  )
3007
3018
  ] });
@@ -3013,9 +3024,9 @@ function Ql({
3013
3024
  name: o,
3014
3025
  wording: r,
3015
3026
  line: s,
3016
- pin: l
3027
+ pin: i
3017
3028
  }) {
3018
- return /* @__PURE__ */ f("td", { className: F(h.td, h.actionsCell, l.className, e && h.editing), style: l.style, children: e ? /* @__PURE__ */ R(re, { children: [
3029
+ return /* @__PURE__ */ f("td", { className: D(h.td, h.actionsCell, i.className, e && h.editing), style: i.style, children: e ? /* @__PURE__ */ T(re, { children: [
3019
3030
  /* @__PURE__ */ f(Ul, { name: o, wording: r }),
3020
3031
  /* @__PURE__ */ f("span", { className: h.held, "aria-hidden": "true", children: /* @__PURE__ */ f(yn, { actions: t, row: n, name: o, wording: r, line: s }) })
3021
3032
  ] }) : /* @__PURE__ */ f(yn, { actions: t, row: n, name: o, wording: r, line: s }) });
@@ -3027,15 +3038,15 @@ function Zl({
3027
3038
  beforeRoot: o,
3028
3039
  colSpan: r,
3029
3040
  entry: s,
3030
- children: l
3041
+ children: i
3031
3042
  }) {
3032
3043
  return /* @__PURE__ */ f("tr", { id: e, className: h.detailRow, "data-group": t, "data-grid-line": n, "data-before-root": o, children: /* @__PURE__ */ f(
3033
3044
  "td",
3034
3045
  {
3035
3046
  colSpan: r,
3036
- className: F(h.detailCell, s && h.treeDetail),
3047
+ className: D(h.detailCell, s && h.treeDetail),
3037
3048
  style: s ? { "--tree-level": s.level } : void 0,
3038
- children: s ? /* @__PURE__ */ f("div", { className: h.treeDetailRail, children: l }) : l
3049
+ children: s ? /* @__PURE__ */ f("div", { className: h.treeDetailRail, children: i }) : i
3039
3050
  }
3040
3051
  ) });
3041
3052
  }
@@ -3046,67 +3057,67 @@ function ea({
3046
3057
  pin: o,
3047
3058
  formats: r,
3048
3059
  wording: s,
3049
- line: l,
3050
- rowName: i,
3060
+ line: i,
3061
+ rowName: l,
3051
3062
  tree: c,
3052
3063
  width: a
3053
3064
  }) {
3054
- const { spec: u } = e, d = e.read(t), m = Vt(n, u.rightAligned), b = vl(l, u.id), w = !(_e(Ve) !== null) || u.edit === void 0 ? void 0 : u.edit === "text" || u.edit === "number" ? "type" : "pick";
3065
+ const { spec: u } = e, d = e.read(t), b = Pt(n, u.rightAligned), p = vl(i, u.id), w = !(_e(Pe) !== null) || u.edit === void 0 ? void 0 : u.edit === "text" || u.edit === "number" ? "type" : "pick";
3055
3066
  let g;
3056
- se(d) ? g = /* @__PURE__ */ f(ho, { wording: s }) : u.presentation ? g = u.presentation(d, t) : g = Be(d, u.format, r, s);
3067
+ se(d) ? g = /* @__PURE__ */ f(ho, { wording: s }) : u.presentation ? g = u.presentation(d, t) : g = Ve(d, u.format, r, s);
3057
3068
  const v = typeof g == "string";
3058
3069
  g = /* @__PURE__ */ f(
3059
3070
  "div",
3060
3071
  {
3061
- className: F(h.value, v && h.valueText, a !== void 0 && h.sized, b && h.editingValue),
3072
+ className: D(h.value, v && h.valueText, a !== void 0 && h.sized, p && h.editingValue),
3062
3073
  style: a !== void 0 ? { "--_width": `${a}px` } : void 0,
3063
- "aria-hidden": b ? !0 : void 0,
3074
+ "aria-hidden": p ? !0 : void 0,
3064
3075
  children: g
3065
3076
  }
3066
- ), c && (g = /* @__PURE__ */ f(Fl, { ...c, name: i, wording: s, children: g }));
3067
- const A = u.rowHeader ? "th" : "td";
3068
- return /* @__PURE__ */ R(
3069
- A,
3077
+ ), c && (g = /* @__PURE__ */ f(Dl, { ...c, name: l, wording: s, children: g }));
3078
+ const x = u.rowHeader ? "th" : "td";
3079
+ return /* @__PURE__ */ T(
3080
+ x,
3070
3081
  {
3071
3082
  scope: u.rowHeader ? "row" : void 0,
3072
- className: F(h.td, m && h.numeric, u.rowHeader && h.rowHeader, o.className, b && h.editing),
3083
+ className: D(h.td, b && h.numeric, u.rowHeader && h.rowHeader, o.className, p && h.editing),
3073
3084
  style: o.style,
3074
3085
  "data-edit": w,
3075
- "data-editing": b ? u.id : void 0,
3086
+ "data-editing": p ? u.id : void 0,
3076
3087
  children: [
3077
- b && /* @__PURE__ */ f(Sl, { entry: e, row: t, rowName: i, grid: b }),
3088
+ p && /* @__PURE__ */ f(Sl, { entry: e, row: t, rowName: l, grid: p }),
3078
3089
  g
3079
3090
  ]
3080
3091
  }
3081
3092
  );
3082
3093
  }
3083
- function Dt(e, t, n, o, r) {
3084
- const { registry: s, hook: l, layout: i } = e;
3094
+ function Bt(e, t, n, o, r) {
3095
+ const { registry: s, hook: i, layout: l } = e;
3085
3096
  return /* @__PURE__ */ f(
3086
3097
  So,
3087
3098
  {
3088
3099
  row: t,
3089
3100
  index: n,
3090
- absolute: i.virtual ? o : void 0,
3101
+ absolute: l.virtual ? o : void 0,
3091
3102
  registry: s,
3092
- hook: l,
3093
- columns: i.dataColumns,
3103
+ hook: i,
3104
+ columns: l.dataColumns,
3094
3105
  line: r,
3095
- tree: i.tree,
3096
- spanEntry: i.spanEntry,
3097
- header: i.header,
3106
+ tree: l.tree,
3107
+ spanEntry: l.spanEntry,
3108
+ header: l.header,
3098
3109
  selectable: e.selectable,
3099
- actions: i.actions,
3100
- trailing: i.trailing,
3101
- blocks: i.blocks,
3102
- columnCount: i.columnCount,
3110
+ actions: l.actions,
3111
+ trailing: l.trailing,
3112
+ blocks: l.blocks,
3113
+ columnCount: l.columnCount,
3103
3114
  rowProps: e.rowProps,
3104
3115
  baseId: e.baseId,
3105
3116
  formats: e.formats,
3106
3117
  wording: e.wording,
3107
3118
  grid: e.gridMode
3108
3119
  },
3109
- l.rowKey(t)
3120
+ i.rowKey(t)
3110
3121
  );
3111
3122
  }
3112
3123
  function ta(e, t) {
@@ -3147,7 +3158,7 @@ function na(e) {
3147
3158
  rows: e.pageSize ? e.heldLines || e.pageSize : void 0,
3148
3159
  rightAligned: [
3149
3160
  ...Array.from({ length: o.controlColumns + (o.spanEntry ? 1 : 0) }, () => !1),
3150
- ...o.dataColumns.map((r) => Vt(t.kindOf(r, n.rows), r.spec.rightAligned))
3161
+ ...o.dataColumns.map((r) => Pt(t.kindOf(r, n.rows), r.spec.rightAligned))
3151
3162
  ]
3152
3163
  }
3153
3164
  ) });
@@ -3160,7 +3171,7 @@ function oa(e) {
3160
3171
  colSpan: n.columnCount,
3161
3172
  className: h.emptyCell,
3162
3173
  style: e.pageSize && e.heldLines ? { height: `calc(var(--_pitch) * ${e.heldLines})`, verticalAlign: "top" } : void 0,
3163
- children: /* @__PURE__ */ f("div", { className: h.empty, children: (r.server || t.admitted.length > 0) && n.restricted ? /* @__PURE__ */ R(re, { children: [
3174
+ children: /* @__PURE__ */ f("div", { className: h.empty, children: (r.server || t.admitted.length > 0) && n.restricted ? /* @__PURE__ */ T(re, { children: [
3164
3175
  /* @__PURE__ */ f("p", { className: h.emptyTitle, children: o.nothingMatchesFilters }),
3165
3176
  /* @__PURE__ */ f(Q, { size: "sm", variant: "ghost", onClick: () => Qn(r), children: o.resetAll })
3166
3177
  ] }) : e.empty ?? /* @__PURE__ */ f("p", { className: h.emptyTitle, children: o.noEntries }) })
@@ -3168,60 +3179,60 @@ function oa(e) {
3168
3179
  ) }) });
3169
3180
  }
3170
3181
  function ra(e, t) {
3171
- const { hook: n, layout: o, wording: r, formats: s } = e, { virtual: l, grouping: i, projection: c } = o, a = l ? Fn(t).map((p) => p.kind === "folded" || !p.continued ? p : { ...p, continued: !1 }) : t, u = a.length - t.length, d = l && l.from > 0 ? l.fillerBefore / l.from : 0, m = (p, w, g, v) => /* @__PURE__ */ f(
3182
+ const { hook: n, layout: o, wording: r, formats: s } = e, { virtual: i, grouping: l, projection: c } = o, a = i ? Dn(t).map((m) => m.kind === "folded" || !m.continued ? m : { ...m, continued: !1 }) : t, u = a.length - t.length, d = i && i.from > 0 ? i.fillerBefore / i.from : 0, b = (m, w, g, v) => /* @__PURE__ */ f(
3172
3183
  El,
3173
3184
  {
3174
- line: p,
3185
+ line: m,
3175
3186
  index: g,
3176
3187
  absolute: v,
3177
3188
  spanEntry: o.spanEntry,
3178
- levelEntry: o.entryOf(i[p.group.level]),
3189
+ levelEntry: o.entryOf(l[m.group.level]),
3179
3190
  columns: o.dataColumns,
3180
3191
  controlColumns: o.controlColumns,
3181
3192
  blocks: o.blocks,
3182
3193
  selectable: e.selectable,
3183
3194
  hasActions: o.trailing,
3184
3195
  total: c.filtered,
3185
- siblings: p.parents.at(-1)?.groups ?? c.groups ?? [],
3186
- depth: i.length,
3196
+ siblings: m.parents.at(-1)?.groups ?? c.groups ?? [],
3197
+ depth: l.length,
3187
3198
  grid: e.gridMode,
3188
3199
  hook: n,
3189
3200
  formats: s,
3190
3201
  wording: r
3191
3202
  },
3192
3203
  w
3193
- ), b = (p, w) => {
3194
- const g = w - u, v = l ? l.from + g : g;
3195
- return g < 0 ? p.kind === "row" ? null : m(p, `${p.kind}:${p.group.path}:repeated`, w, void 0) : p.kind === "row" ? Dt(e, p.row, g, v, p) : m(
3196
- p,
3197
- `${p.kind}:${p.group.path}${p.kind === "header" && p.continued ? ":continued" : ""}`,
3204
+ ), p = (m, w) => {
3205
+ const g = w - u, v = i ? i.from + g : g;
3206
+ return g < 0 ? m.kind === "row" ? null : b(m, `${m.kind}:${m.group.path}:repeated`, w, void 0) : m.kind === "row" ? Bt(e, m.row, g, v, m) : b(
3207
+ m,
3208
+ `${m.kind}:${m.group.path}${m.kind === "header" && m.continued ? ":continued" : ""}`,
3198
3209
  g,
3199
- l ? v : void 0
3210
+ i ? v : void 0
3200
3211
  );
3201
3212
  };
3202
- return l ? /* @__PURE__ */ f(
3213
+ return i ? /* @__PURE__ */ f(
3203
3214
  ko,
3204
3215
  {
3205
- virtual: { ...l, fillerBefore: Math.max(0, l.fillerBefore - u * d) },
3216
+ virtual: { ...i, fillerBefore: Math.max(0, i.fillerBefore - u * d) },
3206
3217
  colSpan: o.columnCount,
3207
- children: a.map(b)
3218
+ children: a.map(p)
3208
3219
  }
3209
- ) : /* @__PURE__ */ R("tbody", { children: [
3210
- t.map(b),
3220
+ ) : /* @__PURE__ */ T("tbody", { children: [
3221
+ t.map(p),
3211
3222
  e.filler
3212
3223
  ] });
3213
3224
  }
3214
3225
  function sa(e, t, n, o) {
3215
- return n && t > 0 && t < e ? /* @__PURE__ */ f(Ft, { height: `calc(var(--_pitch) * ${e - t})`, colSpan: o }) : null;
3226
+ return n && t > 0 && t < e ? /* @__PURE__ */ f(Dt, { height: `calc(var(--_pitch) * ${e - t})`, colSpan: o }) : null;
3216
3227
  }
3217
3228
  function ia(e, t, n) {
3218
- const { layout: o } = e, { virtual: r, lines: s, rows: l, projection: i } = o;
3219
- return t && !n ? { body: na(e), empty: !1 } : i.filtered.length === 0 ? { body: oa(e), empty: !0 } : s ? { body: ra(e, s), empty: !1 } : r ? {
3220
- body: /* @__PURE__ */ f(ko, { virtual: r, colSpan: o.columnCount, children: l.map((c, a) => Dt(e, c, a, r.from + a)) }),
3229
+ const { layout: o } = e, { virtual: r, lines: s, rows: i, projection: l } = o;
3230
+ return t && !n ? { body: na(e), empty: !1 } : l.filtered.length === 0 ? { body: oa(e), empty: !0 } : s ? { body: ra(e, s), empty: !1 } : r ? {
3231
+ body: /* @__PURE__ */ f(ko, { virtual: r, colSpan: o.columnCount, children: i.map((c, a) => Bt(e, c, a, r.from + a)) }),
3221
3232
  empty: !1
3222
3233
  } : {
3223
- body: /* @__PURE__ */ R("tbody", { children: [
3224
- l.map((c, a) => Dt(e, c, a, a)),
3234
+ body: /* @__PURE__ */ T("tbody", { children: [
3235
+ i.map((c, a) => Bt(e, c, a, a)),
3225
3236
  e.filler
3226
3237
  ] }),
3227
3238
  empty: !1
@@ -3233,36 +3244,36 @@ function _n({
3233
3244
  hook: n,
3234
3245
  pin: o
3235
3246
  }) {
3236
- const { spec: r } = e, s = n.publicSnapshot, l = t.kindOf(e, n.rows), i = Vt(l, r.rightAligned), c = t.isSortable(e, n.rows), a = r.id, u = s.sort.findIndex((S) => S.column === a), d = u === -1 ? void 0 : s.sort[u].direction, m = s.sort.length > 1 && u !== -1 ? u + 1 : void 0, b = s.widths[a], p = 48, w = (S) => {
3247
+ const { spec: r } = e, s = n.publicSnapshot, i = t.kindOf(e, n.rows), l = Pt(i, r.rightAligned), c = t.isSortable(e, n.rows), a = r.id, u = s.sort.findIndex((S) => S.column === a), d = u === -1 ? void 0 : s.sort[u].direction, b = s.sort.length > 1 && u !== -1 ? u + 1 : void 0, p = s.widths[a], m = 48, w = (S) => {
3237
3248
  S.stopPropagation(), S.preventDefault();
3238
- const C = S.currentTarget, x = C.closest("th");
3239
- if (!x) return;
3240
- const L = S.clientX, k = x.getBoundingClientRect().width, O = S.pointerId;
3249
+ const C = S.currentTarget, A = C.closest("th");
3250
+ if (!A) return;
3251
+ const L = S.clientX, k = A.getBoundingClientRect().width, O = S.pointerId;
3241
3252
  C.setPointerCapture(O);
3242
3253
  const M = (E) => {
3243
- E.pointerId === O && s.setWidth(a, Math.max(p, k + (E.clientX - L)));
3244
- }, T = (E) => {
3245
- E.pointerId === O && (C.removeEventListener("pointermove", M), C.removeEventListener("pointerup", T), C.removeEventListener("pointercancel", T), C.hasPointerCapture(O) && C.releasePointerCapture(O));
3254
+ E.pointerId === O && s.setWidth(a, Math.max(m, k + (E.clientX - L)));
3255
+ }, R = (E) => {
3256
+ E.pointerId === O && (C.removeEventListener("pointermove", M), C.removeEventListener("pointerup", R), C.removeEventListener("pointercancel", R), C.hasPointerCapture(O) && C.releasePointerCapture(O));
3246
3257
  };
3247
- C.addEventListener("pointermove", M), C.addEventListener("pointerup", T), C.addEventListener("pointercancel", T);
3258
+ C.addEventListener("pointermove", M), C.addEventListener("pointerup", R), C.addEventListener("pointercancel", R);
3248
3259
  }, g = (S) => {
3249
- const C = S?.parentElement, x = S?.closest("table");
3250
- if (!S || !C || !x) return;
3251
- const L = Array.from(C.children).indexOf(S), k = C.children.length, O = { cell: S.style.width, table: x.style.width };
3252
- S.style.width = "", x.style.width = "auto";
3260
+ const C = S?.parentElement, A = S?.closest("table");
3261
+ if (!S || !C || !A) return;
3262
+ const L = Array.from(C.children).indexOf(S), k = C.children.length, O = { cell: S.style.width, table: A.style.width };
3263
+ S.style.width = "", A.style.width = "auto";
3253
3264
  let M = 0;
3254
- for (const T of Array.from(x.rows)) {
3255
- if (T.cells.length !== k) continue;
3256
- const E = T.cells[L];
3265
+ for (const R of Array.from(A.rows)) {
3266
+ if (R.cells.length !== k) continue;
3267
+ const E = R.cells[L];
3257
3268
  if (!E) continue;
3258
- const D = E.querySelector(`.${h.value}`), I = getComputedStyle(E), B = (parseFloat(I.paddingLeft) || 0) + (parseFloat(I.paddingRight) || 0), z = E.querySelector(`.${h.headLabel}`), Y = z ? z.scrollWidth - z.clientWidth : 0;
3259
- M = Math.max(M, E.scrollWidth + Y, D ? D.scrollWidth + B : 0);
3269
+ const B = E.querySelector(`.${h.value}`), $ = getComputedStyle(E), V = (parseFloat($.paddingLeft) || 0) + (parseFloat($.paddingRight) || 0), K = E.querySelector(`.${h.headLabel}`), Y = K ? K.scrollWidth - K.clientWidth : 0;
3270
+ M = Math.max(M, E.scrollWidth + Y, B ? B.scrollWidth + V : 0);
3260
3271
  }
3261
- S.style.width = O.cell, x.style.width = O.table, M > 0 && s.setWidth(a, Math.max(p, M + 1));
3272
+ S.style.width = O.cell, A.style.width = O.table, M > 0 && s.setWidth(a, Math.max(m, M + 1));
3262
3273
  }, v = (S) => {
3263
3274
  if (!r.resizable || !S.altKey) return;
3264
- const C = S.key === "ArrowRight", x = S.key === "ArrowLeft", L = S.key === "Home";
3265
- if (!C && !x && !L) return;
3275
+ const C = S.key === "ArrowRight", A = S.key === "ArrowLeft", L = S.key === "Home";
3276
+ if (!C && !A && !L) return;
3266
3277
  S.preventDefault();
3267
3278
  const k = S.currentTarget;
3268
3279
  if (L) {
@@ -3270,25 +3281,25 @@ function _n({
3270
3281
  return;
3271
3282
  }
3272
3283
  const O = k.getBoundingClientRect().width, M = S.shiftKey ? 32 : 8;
3273
- s.setWidth(a, Math.max(p, O + (C ? M : -M)));
3274
- }, A = c ? /* @__PURE__ */ R(
3284
+ s.setWidth(a, Math.max(m, O + (C ? M : -M)));
3285
+ }, x = c ? /* @__PURE__ */ T(
3275
3286
  "button",
3276
3287
  {
3277
3288
  type: "button",
3278
- className: F(h.sortButton, h.headLine),
3289
+ className: D(h.sortButton, h.headLine),
3279
3290
  onClick: (S) => s.toggleSort(a, S.shiftKey || S.metaKey),
3280
3291
  children: [
3281
3292
  /* @__PURE__ */ f("span", { className: h.headLabel, children: r.label }),
3282
- m !== void 0 && /* @__PURE__ */ f("span", { className: h.sortRank, "aria-hidden": "true", children: m }),
3283
- /* @__PURE__ */ f("span", { className: F(h.sortIndicator, d && h.sortActive), "aria-hidden": "true", children: d ? /* @__PURE__ */ f("svg", { viewBox: "0 0 10 10", width: "10", height: "10", "aria-hidden": "true", className: F(h.sortArrow, d === "desc" && h.sortArrowDesc), children: /* @__PURE__ */ f("path", { d: "M2.2 6.2 5 3.4l2.8 2.8", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinecap: "round", strokeLinejoin: "round" }) }) : (
3293
+ b !== void 0 && /* @__PURE__ */ f("span", { className: h.sortRank, "aria-hidden": "true", children: b }),
3294
+ /* @__PURE__ */ f("span", { className: D(h.sortIndicator, d && h.sortActive), "aria-hidden": "true", children: d ? /* @__PURE__ */ f("svg", { viewBox: "0 0 10 10", width: "10", height: "10", "aria-hidden": "true", className: D(h.sortArrow, d === "desc" && h.sortArrowDesc), children: /* @__PURE__ */ f("path", { d: "M2.2 6.2 5 3.4l2.8 2.8", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinecap: "round", strokeLinejoin: "round" }) }) : (
3284
3295
  /* Drawn in the nominal box and set in the 12 pixels the indicator
3285
3296
  takes, so that the head does not move. */
3286
3297
  /* @__PURE__ */ f("svg", { viewBox: "0 0 10 10", width: "10", height: "12", "aria-hidden": "true", children: /* @__PURE__ */ f("path", { d: "M2.8 3.7 5 1.5l2.2 2.2M2.8 6.3 5 8.5l2.2-2.2", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinecap: "round", strokeLinejoin: "round" }) })
3287
3298
  ) })
3288
3299
  ]
3289
3300
  }
3290
- ) : /* @__PURE__ */ f("span", { className: h.headLine, children: /* @__PURE__ */ f("span", { className: h.headLabel, children: r.label }) }), y = d === "asc" ? "ascending" : d === "desc" ? "descending" : "none", _ = Ee(r.filter) !== void 0 && !(r.filter === "list" && l === "other");
3291
- return /* @__PURE__ */ R(
3301
+ ) : /* @__PURE__ */ f("span", { className: h.headLine, children: /* @__PURE__ */ f("span", { className: h.headLabel, children: r.label }) }), y = d === "asc" ? "ascending" : d === "desc" ? "descending" : "none", _ = Ee(r.filter) !== void 0 && !(r.filter === "list" && i === "other");
3302
+ return /* @__PURE__ */ T(
3292
3303
  "th",
3293
3304
  {
3294
3305
  scope: "col",
@@ -3296,16 +3307,16 @@ function _n({
3296
3307
  "aria-sort": c ? y : void 0,
3297
3308
  tabIndex: r.resizable && !c ? 0 : void 0,
3298
3309
  onKeyDown: v,
3299
- className: F(h.th, i && h.numeric, b !== void 0 && h.sized, o.className),
3310
+ className: D(h.th, l && h.numeric, p !== void 0 && h.sized, o.className),
3300
3311
  style: {
3301
- ...b !== void 0 ? { width: b } : {},
3312
+ ...p !== void 0 ? { width: p } : {},
3302
3313
  ...o.style
3303
3314
  },
3304
3315
  children: [
3305
- _ ? /* @__PURE__ */ R("span", { className: h.thFlex, children: [
3306
- A,
3307
- /* @__PURE__ */ f(Hi, { entry: e, registry: t, hook: n })
3308
- ] }) : A,
3316
+ _ ? /* @__PURE__ */ T("span", { className: h.thFlex, children: [
3317
+ x,
3318
+ /* @__PURE__ */ f(Wi, { entry: e, registry: t, hook: n })
3319
+ ] }) : x,
3309
3320
  r.resizable && /* @__PURE__ */ f(
3310
3321
  "span",
3311
3322
  {
@@ -3329,40 +3340,40 @@ function la({
3329
3340
  props: o,
3330
3341
  wording: r
3331
3342
  }) {
3332
- const { selectable: s = !1, grid: l = !1 } = o, { snapshot: i, virtual: c, spanEntry: a, dataColumns: u, expanderColumn: d, controlColumns: m, leading: b, rowMode: p, rowTools: w, trailing: g, columnCount: v, blocks: A } = n, y = (_, S = _) => ct(A, _, S);
3333
- return /* @__PURE__ */ f("thead", { children: /* @__PURE__ */ R("tr", { "aria-rowindex": c ? 1 : void 0, "data-grid-line": Yt(l, "head"), children: [
3334
- s && /* @__PURE__ */ f("th", { scope: "col", className: F(h.th, h.control, y(0).className), style: y(0).style, children: /* @__PURE__ */ f(
3335
- He,
3343
+ const { selectable: s = !1, grid: i = !1 } = o, { snapshot: l, virtual: c, spanEntry: a, dataColumns: u, expanderColumn: d, controlColumns: b, leading: p, rowMode: m, rowTools: w, trailing: g, columnCount: v, blocks: x } = n, y = (_, S = _) => ct(x, _, S);
3344
+ return /* @__PURE__ */ f("thead", { children: /* @__PURE__ */ T("tr", { "aria-rowindex": c ? 1 : void 0, "data-grid-line": Yt(i, "head"), children: [
3345
+ s && /* @__PURE__ */ f("th", { scope: "col", className: D(h.th, h.control, y(0).className), style: y(0).style, children: /* @__PURE__ */ f(
3346
+ We,
3336
3347
  {
3337
- "aria-label": i.server ? r.selectAllOnPage : r.selectAllRows,
3338
- checked: i.selection.allSelected,
3339
- indeterminate: i.selection.someSelected,
3340
- onChange: i.selection.toggleAll
3348
+ "aria-label": l.server ? r.selectAllOnPage : r.selectAllRows,
3349
+ checked: l.selection.allSelected,
3350
+ indeterminate: l.selection.someSelected,
3351
+ onChange: l.selection.toggleAll
3341
3352
  }
3342
3353
  ) }),
3343
3354
  d && /* @__PURE__ */ f(
3344
3355
  "td",
3345
3356
  {
3346
- className: F(h.th, h.control, y(m - 1).className),
3347
- style: y(m - 1).style
3357
+ className: D(h.th, h.control, y(b - 1).className),
3358
+ style: y(b - 1).style
3348
3359
  }
3349
3360
  ),
3350
- a && (e.columnById(a.spec.id) === a ? /* @__PURE__ */ f(_n, { entry: a, registry: e, hook: t, pin: y(m) }) : /* @__PURE__ */ f("th", { scope: "col", className: F(h.th, y(m).className), style: y(m).style, children: a.spec.label })),
3351
- u.map((_, S) => /* @__PURE__ */ f(_n, { entry: _, registry: e, hook: t, pin: y(b + S) }, _.key)),
3352
- g && /* @__PURE__ */ R(
3361
+ a && (e.columnById(a.spec.id) === a ? /* @__PURE__ */ f(_n, { entry: a, registry: e, hook: t, pin: y(b) }) : /* @__PURE__ */ f("th", { scope: "col", className: D(h.th, y(b).className), style: y(b).style, children: a.spec.label })),
3362
+ u.map((_, S) => /* @__PURE__ */ f(_n, { entry: _, registry: e, hook: t, pin: y(p + S) }, _.key)),
3363
+ g && /* @__PURE__ */ T(
3353
3364
  "th",
3354
3365
  {
3355
3366
  scope: "col",
3356
- className: F(h.th, h.actionsCell, y(v - 1).className),
3367
+ className: D(h.th, h.actionsCell, y(v - 1).className),
3357
3368
  style: y(v - 1).style,
3358
3369
  children: [
3359
3370
  /* @__PURE__ */ f(Oe, { children: r.rowActions }),
3360
- w && /* @__PURE__ */ R("span", { className: h.reserve, "aria-hidden": "true", children: [
3361
- (p || o.onRowAdd) && /* @__PURE__ */ R("span", { className: F(h.actions, h.decision), children: [
3371
+ w && /* @__PURE__ */ T("span", { className: h.reserve, "aria-hidden": "true", children: [
3372
+ (m || o.onRowAdd) && /* @__PURE__ */ T("span", { className: D(h.actions, h.decision), children: [
3362
3373
  /* @__PURE__ */ f(Q, { tabIndex: -1, size: "sm", children: r.saveRow }),
3363
3374
  /* @__PURE__ */ f(Q, { tabIndex: -1, size: "sm", children: r.discardRow })
3364
3375
  ] }),
3365
- o.onRowDelete && /* @__PURE__ */ R("span", { className: F(h.actions, h.decision), children: [
3376
+ o.onRowDelete && /* @__PURE__ */ T("span", { className: D(h.actions, h.decision), children: [
3366
3377
  /* @__PURE__ */ f("span", { className: h.deleteAsk, children: r.deleteRowAsk }),
3367
3378
  /* @__PURE__ */ f(Q, { tabIndex: -1, size: "sm", children: r.deleteRow }),
3368
3379
  /* @__PURE__ */ f(Q, { tabIndex: -1, size: "sm", children: r.keepRow })
@@ -3379,23 +3390,23 @@ function aa({
3379
3390
  formats: n,
3380
3391
  wording: o
3381
3392
  }) {
3382
- const { projection: r, virtual: s, spanEntry: l, dataColumns: i, controlColumns: c, leading: a, trailing: u, columnCount: d, blocks: m } = e, b = (p, w = p) => ct(m, p, w);
3383
- return /* @__PURE__ */ f("tfoot", { children: /* @__PURE__ */ R("tr", { "aria-rowindex": s ? (r.lines ?? r.shown ?? r.filtered).length + 2 : void 0, "data-grid-line": Yt(t, "foot"), children: [
3384
- Array.from({ length: c }, (p, w) => /* @__PURE__ */ f("td", { className: F(h.td, h.control, b(w).className), style: b(w).style }, w)),
3385
- l && /* @__PURE__ */ f("td", { className: F(h.td, b(c).className), style: b(c).style }),
3386
- i.map((p, w) => /* @__PURE__ */ f(
3393
+ const { projection: r, virtual: s, spanEntry: i, dataColumns: l, controlColumns: c, leading: a, trailing: u, columnCount: d, blocks: b } = e, p = (m, w = m) => ct(b, m, w);
3394
+ return /* @__PURE__ */ f("tfoot", { children: /* @__PURE__ */ T("tr", { "aria-rowindex": s ? (r.lines ?? r.shown ?? r.filtered).length + 2 : void 0, "data-grid-line": Yt(t, "foot"), children: [
3395
+ Array.from({ length: c }, (m, w) => /* @__PURE__ */ f("td", { className: D(h.td, h.control, p(w).className), style: p(w).style }, w)),
3396
+ i && /* @__PURE__ */ f("td", { className: D(h.td, p(c).className), style: p(c).style }),
3397
+ l.map((m, w) => /* @__PURE__ */ f(
3387
3398
  ca,
3388
3399
  {
3389
- entry: p,
3400
+ entry: m,
3390
3401
  rows: r.roots ?? r.filtered,
3391
3402
  topLevel: r.roots !== void 0,
3392
3403
  formats: n,
3393
3404
  wording: o,
3394
- pin: b(a + w)
3405
+ pin: p(a + w)
3395
3406
  },
3396
- p.key
3407
+ m.key
3397
3408
  )),
3398
- u && /* @__PURE__ */ f("td", { className: F(h.td, b(d - 1).className), style: b(d - 1).style })
3409
+ u && /* @__PURE__ */ f("td", { className: D(h.td, p(d - 1).className), style: p(d - 1).style })
3399
3410
  ] }) });
3400
3411
  }
3401
3412
  function ca({
@@ -3406,14 +3417,14 @@ function ca({
3406
3417
  pin: r = mo,
3407
3418
  topLevel: s = !1
3408
3419
  }) {
3409
- if (!e.spec.aggregate) return /* @__PURE__ */ f("td", { className: F(h.td, r.className), style: r.style });
3410
- const l = typeof e.spec.aggregate == "function" ? "own" : e.spec.aggregate;
3411
- return /* @__PURE__ */ R(
3420
+ if (!e.spec.aggregate) return /* @__PURE__ */ f("td", { className: D(h.td, r.className), style: r.style });
3421
+ const i = typeof e.spec.aggregate == "function" ? "own" : e.spec.aggregate;
3422
+ return /* @__PURE__ */ T(
3412
3423
  "td",
3413
3424
  {
3414
- className: F(h.td, po(e, t) && h.numeric, r.className),
3425
+ className: D(h.td, po(e, t) && h.numeric, r.className),
3415
3426
  style: r.style,
3416
- "data-footer": l,
3427
+ "data-footer": i,
3417
3428
  title: s ? o.footerTopLevel : void 0,
3418
3429
  children: [
3419
3430
  /* @__PURE__ */ f(Ot, { entry: e, rows: t, formats: n, wording: o, signed: !0 }),
@@ -3428,36 +3439,36 @@ function da({
3428
3439
  onSticking: n,
3429
3440
  pinnedKeys: o
3430
3441
  }) {
3431
- const { start: r, end: s } = t, l = W({
3442
+ const { start: r, end: s } = t, i = q({
3432
3443
  key: "",
3433
3444
  sticking: { start: !0, end: !0 }
3434
- }), i = () => {
3445
+ }), l = () => {
3435
3446
  const c = e.current, a = c?.parentElement;
3436
3447
  if (!c || !a || (a.style.removeProperty("scroll-padding-left"), a.style.removeProperty("scroll-padding-right"), !r && !s)) return;
3437
3448
  const u = Array.from(c.tHead?.rows[0]?.cells ?? []);
3438
3449
  let d = 0;
3439
3450
  for (let g = 0; g < r; g++)
3440
3451
  c.style.setProperty(`--u-table-pin-start-${g}`, `${d}px`), d += u[g]?.getBoundingClientRect().width ?? 0;
3441
- let m = 0;
3452
+ let b = 0;
3442
3453
  for (let g = 0; g < s; g++)
3443
- c.style.setProperty(`--u-table-pin-end-${g}`, `${m}px`), m += u[u.length - 1 - g]?.getBoundingClientRect().width ?? 0;
3444
- const b = `${r}|${s}|${t.count}|${o}`;
3445
- l.current.key !== b && (l.current = { key: b, sticking: l.current.sticking });
3446
- const p = l.current;
3447
- p.sticking.start && (p.start = d), p.sticking.end && (p.end = m);
3448
- const w = sr(p.start ?? d, p.end ?? m, a.clientWidth);
3449
- p.sticking = w, n(w), w.start || (d = 0), w.end || (m = 0), c.style.setProperty("--u-table-pin-start", `${d}px`), c.style.setProperty("--u-table-pin-end", `${m}px`), d && a.style.setProperty("scroll-padding-left", `${d}px`), m && a.style.setProperty("scroll-padding-right", `${m}px`), vo(a);
3454
+ c.style.setProperty(`--u-table-pin-end-${g}`, `${b}px`), b += u[u.length - 1 - g]?.getBoundingClientRect().width ?? 0;
3455
+ const p = `${r}|${s}|${t.count}|${o}`;
3456
+ i.current.key !== p && (i.current = { key: p, sticking: i.current.sticking });
3457
+ const m = i.current;
3458
+ m.sticking.start && (m.start = d), m.sticking.end && (m.end = b);
3459
+ const w = sr(m.start ?? d, m.end ?? b, a.clientWidth);
3460
+ m.sticking = w, n(w), w.start || (d = 0), w.end || (b = 0), c.style.setProperty("--u-table-pin-start", `${d}px`), c.style.setProperty("--u-table-pin-end", `${b}px`), d && a.style.setProperty("scroll-padding-left", `${d}px`), b && a.style.setProperty("scroll-padding-right", `${b}px`), vo(a);
3450
3461
  };
3451
- return te(i), xe(() => {
3462
+ return Z(l), xe(() => {
3452
3463
  const c = e.current;
3453
3464
  if (!c || !r && !s || typeof ResizeObserver > "u") return;
3454
- const a = new ResizeObserver(i), u = Array.from(c.tHead?.rows[0]?.cells ?? []);
3465
+ const a = new ResizeObserver(l), u = Array.from(c.tHead?.rows[0]?.cells ?? []);
3455
3466
  for (const d of [...u.slice(0, r), ...u.slice(u.length - s)]) a.observe(d);
3456
3467
  return c.parentElement && a.observe(c.parentElement), () => a.disconnect();
3457
3468
  }, [e, r, s, t.count, o]), null;
3458
3469
  }
3459
3470
  function ua({ table: e }) {
3460
- return te(() => {
3471
+ return Z(() => {
3461
3472
  const t = e.current?.parentElement;
3462
3473
  if (!t) return;
3463
3474
  const n = () => t.style.setProperty("--u-table-view", `${t.clientWidth}px`);
@@ -3467,15 +3478,15 @@ function ua({ table: e }) {
3467
3478
  }, [e]), null;
3468
3479
  }
3469
3480
  function fa({ table: e, blocks: t }) {
3470
- const n = W(t);
3471
- return te(() => {
3481
+ const n = q(t);
3482
+ return Z(() => {
3472
3483
  n.current = t;
3473
3484
  const o = e.current?.parentElement;
3474
- o && qt(o, t);
3485
+ o && Ft(o, t);
3475
3486
  }), xe(() => {
3476
3487
  const o = e.current, r = o?.parentElement;
3477
3488
  if (!o || !r || typeof ResizeObserver > "u") return;
3478
- const s = new ResizeObserver(() => qt(r, n.current));
3489
+ const s = new ResizeObserver(() => Ft(r, n.current));
3479
3490
  return s.observe(r), s.observe(o), () => s.disconnect();
3480
3491
  }, [e]), null;
3481
3492
  }
@@ -3485,95 +3496,95 @@ function ha({ registry: e, props: t }) {
3485
3496
  stickyHeader: o = !1,
3486
3497
  striped: r = !1,
3487
3498
  density: s,
3488
- maxHeight: l,
3489
- empty: i,
3499
+ maxHeight: i,
3500
+ empty: l,
3490
3501
  loading: c = !1,
3491
3502
  rowProps: a,
3492
3503
  ariaLabel: u,
3493
3504
  grid: d = !1
3494
3505
  } = t;
3495
3506
  st(e.subscribe, e.bodyVersion, e.bodyVersion);
3496
- const m = ie(), b = ke(), p = Vo(s, "regular"), w = be(), g = W(null), [v, A] = P(0), y = cl(), [_, S] = P({ start: !0, end: !0 });
3497
- $l(e, y), zl(g, o), Kl(e, g), Gl(e, g, c), jl(g), Hl(e, g);
3507
+ const b = ie(), p = ke(), m = Po(s, "regular"), w = be(), g = q(null), [v, x] = I(0), y = cl(), [_, S] = I({ start: !0, end: !0 });
3508
+ zl(e, y), Kl(g, o), Gl(e, g), jl(e, g, c), Hl(g), Wl(e, g);
3498
3509
  const C = e.hook && !e.hook.tableState.virtual ? e.hook.publicSnapshot : null;
3499
3510
  nl(g, C ? `${C.grouping.join("|")}#${C.folded.join("|")}` : "");
3500
- const x = e.hook;
3501
- if (!x) return null;
3502
- const L = y.state.editing?.row === !0, k = Wl({ registry: e, hook: x, props: t, drafting: L, sticking: _ }), { snapshot: O, projection: M, virtual: T, lines: E, entries: D, grouping: I, dataColumns: B, columnCount: z, pins: Y, pinned: ce, blocks: G, rows: ne, footerShown: de } = k, { lines: le, fresh: Z, ids: oe, events: H } = Bl({ registry: e, hook: x, props: t, layout: k, grid: y }), ge = Pl({ registry: e, hook: x, grid: y, gridMode: d, gridLines: le, dataColumns: B, formats: b, wording: m, tableElement: () => g.current });
3503
- e.setAddRow(H?.addRow ?? null);
3504
- const q = (e.paginates() || O.server) && !T ? O.pageSize : 0, ae = E ? E.length : ne.length, Ae = q && !c ? Math.min(ae, q) : 0;
3505
- Ae > v && A(Ae);
3506
- const ue = Math.min(Math.max(Ae, v, O.pageCount > 1 ? q : 0), q), Ne = c && ae > 0, Me = {
3511
+ const A = e.hook;
3512
+ if (!A) return null;
3513
+ const L = y.state.editing?.row === !0, k = ql({ registry: e, hook: A, props: t, drafting: L, sticking: _ }), { snapshot: O, projection: M, virtual: R, lines: E, entries: B, grouping: $, dataColumns: V, columnCount: K, pins: Y, pinned: ce, blocks: j, rows: ne, footerShown: de } = k, { lines: le, fresh: ee, ids: oe, events: W } = Vl({ registry: e, hook: A, props: t, layout: k, grid: y }), ge = Il({ registry: e, hook: A, grid: y, gridMode: d, gridLines: le, dataColumns: V, formats: p, wording: b, tableElement: () => g.current });
3514
+ e.setAddRow(W?.addRow ?? null);
3515
+ const F = (e.paginates() || O.server) && !R ? O.pageSize : 0, ae = E ? E.length : ne.length, Ae = F && !c ? Math.min(ae, F) : 0;
3516
+ Ae > v && x(Ae);
3517
+ const ue = Math.min(Math.max(Ae, v, O.pageCount > 1 ? F : 0), F), Ne = c && ae > 0, Me = {
3507
3518
  registry: e,
3508
- hook: x,
3519
+ hook: A,
3509
3520
  layout: k,
3510
3521
  selectable: n,
3511
3522
  gridMode: d,
3512
- empty: i,
3523
+ empty: l,
3513
3524
  rowProps: a,
3514
3525
  baseId: w,
3515
- formats: b,
3516
- wording: m,
3517
- pageSize: q,
3526
+ formats: p,
3527
+ wording: b,
3528
+ pageSize: F,
3518
3529
  heldLines: ue,
3519
- filler: sa(ue, ae, q, z)
3530
+ filler: sa(ue, ae, F, K)
3520
3531
  }, pe = ia(Me, c, Ne);
3521
- return /* @__PURE__ */ R(re, { children: [
3522
- /* @__PURE__ */ R(
3532
+ return /* @__PURE__ */ T(re, { children: [
3533
+ /* @__PURE__ */ T(
3523
3534
  "div",
3524
3535
  {
3525
- ref: T?.scrollRef,
3536
+ ref: R?.scrollRef,
3526
3537
  onScroll: (U) => {
3527
- T?.onScroll(), E && o && yo(U.currentTarget), (G.start || G.end) && vo(U.currentTarget), qt(U.currentTarget, G);
3538
+ R?.onScroll(), E && o && yo(U.currentTarget), (j.start || j.end) && vo(U.currentTarget), Ft(U.currentTarget, j);
3528
3539
  },
3529
3540
  onKeyDown: ge,
3530
3541
  onAnimationEnd: (U) => U.target.removeAttribute("data-copied"),
3531
3542
  className: h.scroll,
3532
- style: l ? { maxHeight: l } : void 0,
3543
+ style: i ? { maxHeight: i } : void 0,
3533
3544
  children: [
3534
- /* @__PURE__ */ f(Rn, { size: "sm", children: /* @__PURE__ */ R(
3545
+ /* @__PURE__ */ f(Tn, { size: "sm", children: /* @__PURE__ */ T(
3535
3546
  "table",
3536
3547
  {
3537
3548
  ref: g,
3538
- role: E || D ? "treegrid" : d ? "grid" : void 0,
3539
- "aria-readonly": d && !B.some((U) => U.spec.edit !== void 0) ? !0 : void 0,
3540
- onKeyDown: H?.onKeyDown,
3541
- onFocus: H?.onFocus,
3542
- onClick: H?.onClick,
3543
- onBlur: H?.onBlur,
3544
- "data-depth": E ? I.length : void 0,
3545
- style: E ? { "--u-header-levels": I.length - 1 } : void 0,
3549
+ role: E || B ? "treegrid" : d ? "grid" : void 0,
3550
+ "aria-readonly": d && !V.some((U) => U.spec.edit !== void 0) ? !0 : void 0,
3551
+ onKeyDown: W?.onKeyDown,
3552
+ onFocus: W?.onFocus,
3553
+ onClick: W?.onClick,
3554
+ onBlur: W?.onBlur,
3555
+ "data-depth": E ? $.length : void 0,
3556
+ style: E ? { "--u-header-levels": $.length - 1 } : void 0,
3546
3557
  "aria-label": u,
3547
- "aria-rowcount": T ? (M.lines ?? M.shown ?? M.filtered).length + 1 + (de ? 1 : 0) : void 0,
3558
+ "aria-rowcount": R ? (M.lines ?? M.shown ?? M.filtered).length + 1 + (de ? 1 : 0) : void 0,
3548
3559
  "aria-busy": c || void 0,
3549
3560
  "data-stale": Ne || void 0,
3550
- className: F(
3561
+ className: D(
3551
3562
  h.table,
3552
- p === "compact" && h.compact,
3563
+ m === "compact" && h.compact,
3553
3564
  o && h.sticky,
3554
3565
  r && h.striped,
3555
3566
  d && h.grid
3556
3567
  ),
3557
3568
  children: [
3558
- /* @__PURE__ */ f(la, { registry: e, hook: x, layout: k, props: t, wording: m }),
3559
- /* @__PURE__ */ R(Ve, { value: H ? { ...H.context, hook: x, wording: m } : null, children: [
3560
- Z && ta(Me, Z),
3569
+ /* @__PURE__ */ f(la, { registry: e, hook: A, layout: k, props: t, wording: b }),
3570
+ /* @__PURE__ */ T(Pe, { value: W ? { ...W.context, hook: A, wording: b } : null, children: [
3571
+ ee && ta(Me, ee),
3561
3572
  pe.body
3562
3573
  ] }),
3563
- de && /* @__PURE__ */ f(aa, { layout: k, gridMode: d, formats: b, wording: m })
3574
+ de && /* @__PURE__ */ f(aa, { layout: k, gridMode: d, formats: p, wording: b })
3564
3575
  ]
3565
3576
  }
3566
3577
  ) }),
3567
3578
  pe.empty && /* @__PURE__ */ f(ua, { table: g }),
3568
- /* @__PURE__ */ f(fa, { table: g, blocks: G }),
3569
- /* @__PURE__ */ f(Il, { table: g }),
3579
+ /* @__PURE__ */ f(fa, { table: g, blocks: j }),
3580
+ /* @__PURE__ */ f($l, { table: g }),
3570
3581
  /* @__PURE__ */ f(
3571
3582
  da,
3572
3583
  {
3573
3584
  table: g,
3574
3585
  blocks: ce,
3575
3586
  onSticking: (U) => S((Se) => Se.start === U.start && Se.end === U.end ? Se : U),
3576
- pinnedKeys: B.filter((U) => Y[U.spec.id]).map((U) => U.key).join("|")
3587
+ pinnedKeys: V.filter((U) => Y[U.spec.id]).map((U) => U.key).join("|")
3577
3588
  }
3578
3589
  ),
3579
3590
  d && /* @__PURE__ */ f(
@@ -3583,8 +3594,8 @@ function ha({ registry: e, props: t }) {
3583
3594
  grid: y,
3584
3595
  lines: le,
3585
3596
  ids: oe,
3586
- editable: B.some((U) => U.spec.edit !== void 0) ? H?.editable : void 0,
3587
- outside: H?.outside
3597
+ editable: V.some((U) => U.spec.edit !== void 0) ? W?.editable : void 0,
3598
+ outside: W?.outside
3588
3599
  }
3589
3600
  )
3590
3601
  ]
@@ -3622,36 +3633,36 @@ function ga(e) {
3622
3633
  validate: e.validate
3623
3634
  };
3624
3635
  }
3625
- function Ke(e, t, n, o, r) {
3626
- te(
3636
+ function Ge(e, t, n, o, r) {
3637
+ Z(
3627
3638
  () => () => {
3628
3639
  n(), e.commit();
3629
3640
  },
3630
3641
  // eslint-disable-next-line react-hooks/exhaustive-deps -- the cleanup runs on unmount only (or a new key), never on a new closure
3631
3642
  [t]
3632
- ), te(() => {
3643
+ ), Z(() => {
3633
3644
  o(), r && e.checkOrder(), e.commit();
3634
3645
  });
3635
3646
  }
3636
3647
  function pa(e) {
3637
3648
  function t(c) {
3638
- const a = be(), u = _e(Tt), d = ga(c);
3639
- return e.registerColumn(a, d), Ke(e, a, () => e.removeColumn(a), () => {
3649
+ const a = be(), u = _e(Rt), d = ga(c);
3650
+ return e.registerColumn(a, d), Ge(e, a, () => e.removeColumn(a), () => {
3640
3651
  e.ensureColumn(a, d);
3641
- }, !0), Kt && u && u.registry !== e && X(
3652
+ }, !0), Gt && u && u.registry !== e && X(
3642
3653
  `foreign:${d.id}`,
3643
3654
  `The column "${d.id}" comes from a different useTable call than the table it stands in. It reads the rows of its own hook.`
3644
3655
  ), /* @__PURE__ */ f("span", { hidden: !0, "data-umriss-column": a });
3645
3656
  }
3646
3657
  function n({ children: c }) {
3647
3658
  const a = be();
3648
- return e.registerDetail(a, c), Ke(e, a, () => e.removeDetail(a), () => {
3659
+ return e.registerDetail(a, c), Ge(e, a, () => e.removeDetail(a), () => {
3649
3660
  e.detail || e.registerDetail(a, c);
3650
3661
  }, !1), null;
3651
3662
  }
3652
3663
  function o({ children: c, pin: a = !0 }) {
3653
3664
  const u = be();
3654
- return e.registerActionGroup(u, a), Ke(e, u, () => e.removeActionGroup(u), () => {
3665
+ return e.registerActionGroup(u, a), Ge(e, u, () => e.removeActionGroup(u), () => {
3655
3666
  e.registerActionGroup(u, a);
3656
3667
  }, !1), /* @__PURE__ */ f(re, { children: c });
3657
3668
  }
@@ -3662,12 +3673,12 @@ function pa(e) {
3662
3673
  tone: c.tone ?? "default",
3663
3674
  onSelect: c.onSelect
3664
3675
  };
3665
- return e.registerAction(a, u), Ke(e, a, () => e.removeAction(a), () => {
3676
+ return e.registerAction(a, u), Ge(e, a, () => e.removeAction(a), () => {
3666
3677
  e.ensureAction(a, u);
3667
3678
  }, !0), /* @__PURE__ */ f("span", { hidden: !0, "data-umriss-action": a });
3668
3679
  }
3669
3680
  function s(c) {
3670
- const a = be(), u = typeof c.value == "string" ? c.value : void 0, m = {
3681
+ const a = be(), u = typeof c.value == "string" ? c.value : void 0, b = {
3671
3682
  id: c.id ?? u ?? c.label,
3672
3683
  label: c.label,
3673
3684
  value: c.value,
@@ -3677,26 +3688,26 @@ function pa(e) {
3677
3688
  group: c.group,
3678
3689
  groupable: !0
3679
3690
  };
3680
- return e.registerGroupKey(a, m), Ke(e, a, () => e.removeGroupKey(a), () => {
3681
- e.ensureGroupKey(a, m);
3691
+ return e.registerGroupKey(a, b), Ge(e, a, () => e.removeGroupKey(a), () => {
3692
+ e.ensureGroupKey(a, b);
3682
3693
  }, !0), /* @__PURE__ */ f("span", { hidden: !0, "data-umriss-groupkey": a });
3683
3694
  }
3684
- function l(c) {
3695
+ function i(c) {
3685
3696
  e.beginPass(), e.setStickyRowHeader(c.stickyRowHeader === !0), e.setTableGroupable(c.groupable !== !1), e.setRowAdding(c.grid === !0 && c.onRowAdd !== void 0), e.server && c.groupable === !0 && X("server-groupable", "`groupable` is passed over in server mode: the groups would be the page's, not the server's.");
3686
- const a = W(null), [u, d] = P(null);
3687
- te(() => {
3697
+ const a = q(null), [u, d] = I(null);
3698
+ Z(() => {
3688
3699
  e.children = a.current, e.checkOrder(), e.commit();
3689
3700
  });
3690
- const m = j(() => ({ registry: e, footerTarget: u }), [u]);
3691
- return /* @__PURE__ */ f(Tt, { value: m, children: /* @__PURE__ */ R("div", { className: F(h.frame, c.className), children: [
3701
+ const b = H(() => ({ registry: e, footerTarget: u }), [u]);
3702
+ return /* @__PURE__ */ f(Rt, { value: b, children: /* @__PURE__ */ T("div", { className: D(h.frame, c.className), children: [
3692
3703
  /* @__PURE__ */ f("div", { ref: a, className: h.children, children: c.children }),
3693
3704
  /* @__PURE__ */ f(ma, { registry: e }),
3694
3705
  /* @__PURE__ */ f(ha, { registry: e, props: c }),
3695
3706
  /* @__PURE__ */ f("div", { ref: d, className: h.footerTarget })
3696
3707
  ] }) });
3697
3708
  }
3698
- const i = { Table: l, Column: t, RowDetail: n, RowActions: o, Action: r, GroupBy: s };
3699
- return Vi(l, e), i;
3709
+ const l = { Table: i, Column: t, RowDetail: n, RowActions: o, Action: r, GroupBy: s };
3710
+ return Pi(i, e), l;
3700
3711
  }
3701
3712
  function ma({ registry: e }) {
3702
3713
  return st(e.subscribe, e.bodyVersion, e.bodyVersion), !e.hook || !e.needsOwnToolbar() ? null : /* @__PURE__ */ f(io, { registry: e, own: !0 });
@@ -3713,15 +3724,15 @@ const wa = "_verdict_1mxfd_6", ba = "_glyph_1mxfd_13", va = "_value_1mxfd_23", y
3713
3724
  alarm: "■"
3714
3725
  };
3715
3726
  function Sa({ reading: e, format: t }) {
3716
- const n = ke(), o = ie(), { measured: r, assessment: s } = e, l = _a(s.verdict, o);
3717
- return /* @__PURE__ */ R("span", { className: Ze.verdict, "data-verdict": s.verdict, title: l, children: [
3727
+ const n = ke(), o = ie(), { measured: r, assessment: s } = e, i = _a(s.verdict, o);
3728
+ return /* @__PURE__ */ T("span", { className: Ze.verdict, "data-verdict": s.verdict, title: i, children: [
3718
3729
  /* @__PURE__ */ f("span", { "aria-hidden": "true", className: Ze.glyph, children: ka[s.verdict] }),
3719
3730
  /* @__PURE__ */ f("span", { className: Ze.value, children: r === null ? o.statAbsentValue : kn(r, t, n) }),
3720
- s.excess !== void 0 && /* @__PURE__ */ R("span", { className: Ze.excess, children: [
3731
+ s.excess !== void 0 && /* @__PURE__ */ T("span", { className: Ze.excess, children: [
3721
3732
  "+",
3722
3733
  kn(s.excess, t, n)
3723
3734
  ] }),
3724
- /* @__PURE__ */ f(Oe, { children: l })
3735
+ /* @__PURE__ */ f(Oe, { children: i })
3725
3736
  ] });
3726
3737
  }
3727
3738
  const Ca = (e) => e.measured, xa = (e) => e.reduce(
@@ -3729,19 +3740,19 @@ const Ca = (e) => e.measured, xa = (e) => e.reduce(
3729
3740
  void 0
3730
3741
  );
3731
3742
  function Aa(e) {
3732
- return function({ id: n, value: o, label: r, limits: s, format: l, sortBy: i = "verdict", width: c, resizable: a, pin: u, aggregate: d }) {
3733
- const m = JSON.stringify(s), b = j(() => {
3734
- const w = JSON.parse(m);
3743
+ return function({ id: n, value: o, label: r, limits: s, format: i, sortBy: l = "verdict", width: c, resizable: a, pin: u, aggregate: d }) {
3744
+ const b = JSON.stringify(s), p = H(() => {
3745
+ const w = JSON.parse(b);
3735
3746
  return (g) => {
3736
3747
  const v = typeof o == "string" ? g?.[o] : o(g);
3737
3748
  return {
3738
3749
  measured: typeof v == "number" && Number.isFinite(v) ? v : null,
3739
- assessment: Po(v, w)
3750
+ assessment: Io(v, w)
3740
3751
  };
3741
3752
  };
3742
- }, [o, m]), p = fe(
3743
- (w) => i === "value" ? w.measured : _t(w.assessment.verdict),
3744
- [i]
3753
+ }, [o, b]), m = fe(
3754
+ (w) => l === "value" ? w.measured : _t(w.assessment.verdict),
3755
+ [l]
3745
3756
  );
3746
3757
  return /* @__PURE__ */ f(
3747
3758
  e,
@@ -3752,11 +3763,11 @@ function Aa(e) {
3752
3763
  width: c,
3753
3764
  resizable: a,
3754
3765
  pin: u,
3755
- value: b,
3756
- sortValue: p,
3766
+ value: p,
3767
+ sortValue: m,
3757
3768
  exportValue: Ca,
3758
3769
  aggregate: d === "worst" ? xa : void 0,
3759
- children: (w) => /* @__PURE__ */ f(Sa, { reading: w, format: l })
3770
+ children: (w) => /* @__PURE__ */ f(Sa, { reading: w, format: i })
3760
3771
  }
3761
3772
  );
3762
3773
  };
@@ -3768,39 +3779,39 @@ const Na = [], Co = (e) => X(
3768
3779
  function xo(e, t, n) {
3769
3780
  const o = e.columnById(t), r = o ? Ee(o.spec.filter) : void 0;
3770
3781
  if (!r) return !1;
3771
- const s = Gn(r, n);
3782
+ const s = jn(r, n);
3772
3783
  return s === "foreign" && Co(t), s === "effective";
3773
3784
  }
3774
- function Ra(e, t, n) {
3785
+ function Ta(e, t, n) {
3775
3786
  if (e.length === 0) return;
3776
3787
  let o = -1, r = [];
3777
3788
  return (s) => {
3778
3789
  if (o !== t.structureVersion()) {
3779
3790
  o = t.structureVersion(), r = [];
3780
- for (const [l, i] of e) {
3781
- const c = n.get(l);
3791
+ for (const [i, l] of e) {
3792
+ const c = n.get(i);
3782
3793
  if (c) {
3783
- r.push((u) => c.matches(u, i));
3794
+ r.push((u) => c.matches(u, l));
3784
3795
  continue;
3785
3796
  }
3786
- const a = t.columnById(l);
3787
- a && xo(t, l, i) && r.push((u) => {
3797
+ const a = t.columnById(i);
3798
+ a && xo(t, i, l) && r.push((u) => {
3788
3799
  const d = Ee(a.spec.filter);
3789
- return !d || Ci(d, a.read(u), i);
3800
+ return !d || Ci(d, a.read(u), l);
3790
3801
  });
3791
3802
  }
3792
3803
  }
3793
- return r.every((l) => l(s));
3804
+ return r.every((i) => i(s));
3794
3805
  };
3795
3806
  }
3796
- function Ta(e) {
3797
- const [t, n] = P({ fn: e });
3807
+ function Ra(e) {
3808
+ const [t, n] = I({ fn: e });
3798
3809
  return ot(t.fn, e) ? t.fn : (n({ fn: e }), e);
3799
3810
  }
3800
3811
  function Oa(e, t) {
3801
- const n = j(() => t ? e.filter((l) => t(l)) : e, [e, t]), [o, r] = P(n);
3812
+ const n = H(() => t ? e.filter((i) => t(i)) : e, [e, t]), [o, r] = I(n);
3802
3813
  if (!t) return e;
3803
- const s = o === n || o.length === n.length && o.every((l, i) => l === n[i]);
3814
+ const s = o === n || o.length === n.length && o.every((i, l) => i === n[l]);
3804
3815
  return s || r(n), s ? o : n;
3805
3816
  }
3806
3817
  const et = (e) => e === void 0 ? [] : typeof e == "string" ? [e] : [...e], Ea = (e, t) => e.length === t.length && e.every((n, o) => n === t[o]);
@@ -3812,11 +3823,11 @@ function Sn(e) {
3812
3823
  return n(e ?? []), t;
3813
3824
  }
3814
3825
  function Ma(e, t, n) {
3815
- const o = [], r = (s, l) => {
3816
- if (!(l >= n))
3817
- for (const i of s) {
3818
- const c = t.children(i);
3819
- c?.length && (o.push(t.key(i)), r(c, l + 1));
3826
+ const o = [], r = (s, i) => {
3827
+ if (!(i >= n))
3828
+ for (const l of s) {
3829
+ const c = t.children(l);
3830
+ c?.length && (o.push(t.key(l)), r(c, i + 1));
3820
3831
  }
3821
3832
  };
3822
3833
  return r(e, 0), o;
@@ -3825,55 +3836,55 @@ const Cn = (e, t) => e.size === t.size && [...e].every((n) => t.has(n));
3825
3836
  function La(e, t) {
3826
3837
  return { ...xt(e), ...t };
3827
3838
  }
3828
- function Pa(e, t) {
3829
- const [n] = P(() => new Bi()), [o] = P(() => {
3839
+ function Ia(e, t) {
3840
+ const [n] = I(() => new Vi()), [o] = I(() => {
3830
3841
  const N = pa(n);
3831
3842
  return { ...N, VerdictColumn: Aa(N.Column) };
3832
3843
  });
3833
3844
  st(n.subscribe, n.structureVersion, n.structureVersion);
3834
- const r = ke(), s = ie(), l = e, i = n.modelColumns(l, r), [c] = P(() => t.initialView), a = t.server === !0, u = t.server ? t.rowCount : 0, d = j(() => a ? { rowCount: u } : void 0, [a, u]);
3845
+ const r = ke(), s = ie(), i = e, l = n.modelColumns(i, r), [c] = I(() => t.initialView), a = t.server === !0, u = t.server ? t.rowCount : 0, d = H(() => a ? { rowCount: u } : void 0, [a, u]);
3835
3846
  n.setServer(a), a && (t.preFilter && X("server-prefilter", "`preFilter` is passed over in server mode: the server decides which rows the table has."), t.virtual && X("server-virtual", "`virtual` is passed over in server mode: the table pages instead."), (t.defaultGrouping !== void 0 || c?.grouping?.length) && X("server-grouping", "A grouping is passed over in server mode: the groups would be the page's, not the server's."));
3836
- const [m, b] = P(() => Object.entries(c?.conditions ?? {})), p = t.rowFilters ?? Na, w = p.map((N) => N.id).join("\0"), g = j(
3837
- () => new Map(p.map((N) => [N.id, N])),
3847
+ const [b, p] = I(() => Object.entries(c?.conditions ?? {})), m = t.rowFilters ?? Na, w = m.map((N) => N.id).join("\0"), g = H(
3848
+ () => new Map(m.map((N) => [N.id, N])),
3838
3849
  // eslint-disable-next-line react-hooks/exhaustive-deps -- the filters by their ids; they are defined outside the component
3839
3850
  [w]
3840
3851
  );
3841
- for (const N of p)
3852
+ for (const N of m)
3842
3853
  n.columnById(N.id) && X(`row-filter-column:${N.id}`, `The row filter "${N.id}" has the id of a column; a condition under that id is the row filter's, and the column's filter cannot hold one of its own.`);
3843
- const v = j(() => Ra(m, n, g), [m, n, g]), A = t.preFilter, y = Oa(l, a ? void 0 : A), [_, S] = P(
3854
+ const v = H(() => Ta(b, n, g), [b, n, g]), x = t.preFilter, y = Oa(i, a ? void 0 : x), [_, S] = I(
3844
3855
  () => c?.grouping ? [...c.grouping] : et(t.defaultGrouping)
3845
- ), [C, x] = P(() => c?.folded ?? []), [L, k] = P(() => c?.pinned ? { ...c.pinned } : null), O = Ta(t.rowKey), M = t.server ? void 0 : t.childRows, T = M !== void 0;
3846
- n.setTree(T);
3847
- const E = W({ children: M, key: O });
3848
- te(() => {
3856
+ ), [C, A] = I(() => c?.folded ?? []), [L, k] = I(() => c?.pinned ? { ...c.pinned } : null), O = Ra(t.rowKey), M = t.server ? void 0 : t.childRows, R = M !== void 0;
3857
+ n.setTree(R);
3858
+ const E = q({ children: M, key: O });
3859
+ Z(() => {
3849
3860
  E.current = { children: M, key: O };
3850
3861
  });
3851
- const [D] = P(() => ({
3862
+ const [B] = I(() => ({
3852
3863
  key: (N) => E.current.key(N),
3853
3864
  children: (N) => E.current.children?.(N),
3854
3865
  label: () => ""
3855
- })), [I] = P(() => {
3866
+ })), [$] = I(() => {
3856
3867
  const N = t.server ? void 0 : t.defaultBranches;
3857
- return !T || N === void 0 ? [] : typeof N == "number" ? Ma(l, D, N) : [...N];
3858
- }), [B, z] = P(() => c?.branches ?? I), Y = j(() => T ? new Set(Io(l, D)) : /* @__PURE__ */ new Set(), [T, l, D]), ce = T ? B.filter((N) => Y.has(N)) : [];
3859
- j(() => {
3860
- if (!T) return;
3861
- const N = $o(l, D);
3868
+ return !R || N === void 0 ? [] : typeof N == "number" ? Ma(i, B, N) : [...N];
3869
+ }), [V, K] = I(() => c?.branches ?? $), Y = H(() => R ? new Set($o(i, B)) : /* @__PURE__ */ new Set(), [R, i, B]), ce = R ? V.filter((N) => Y.has(N)) : [];
3870
+ H(() => {
3871
+ if (!R) return;
3872
+ const N = zo(i, B);
3862
3873
  N !== null && X(`tree-duplicate:${N}`, `The row key "${N}" occurs twice in the tree: its fold and its selection would act on both rows.`);
3863
- }, [T, l, D]), T && (t.defaultGrouping !== void 0 || c?.grouping?.length) && X("tree-grouping", "A grouping is passed over with `childRows`: tree rows and grouping both build levels.");
3864
- const G = n.orderedColumns().length + n.groupKeys.entries.size > 0, ne = a || T ? [] : G ? n.effectiveGrouping(_, l) : _.slice(0, zt), de = ne.join("|"), le = j(() => new Set(C), [C]), Z = ne.length ? n.groupingModel(ne, l) : null, oe = j(
3865
- () => Z && Z.levels.length ? { ...Z, folded: le, compareText: r.compareText } : void 0,
3874
+ }, [R, i, B]), R && (t.defaultGrouping !== void 0 || c?.grouping?.length) && X("tree-grouping", "A grouping is passed over with `childRows`: tree rows and grouping both build levels.");
3875
+ const j = n.orderedColumns().length + n.groupKeys.entries.size > 0, ne = a || R ? [] : j ? n.effectiveGrouping(_, i) : _.slice(0, Kt), de = ne.join("|"), le = H(() => new Set(C), [C]), ee = ne.length ? n.groupingModel(ne, i) : null, oe = H(
3876
+ () => ee && ee.levels.length ? { ...ee, folded: le, compareText: r.compareText } : void 0,
3866
3877
  // eslint-disable-next-line react-hooks/exhaustive-deps -- the model's identity carries the ids and the columns
3867
- [Z, le, r.compareText, de]
3868
- ), H = ce.join("\0"), ge = j(
3869
- () => T ? { key: O, children: D.children, open: new Set(ce), admit: A } : void 0,
3878
+ [ee, le, r.compareText, de]
3879
+ ), W = ce.join("\0"), ge = H(
3880
+ () => R ? { key: O, children: B.children, open: new Set(ce), admit: x } : void 0,
3870
3881
  /* ponytail: the pre-filter is read through the roots it admits - a new
3871
3882
  pre-filter that only drops children takes hold with the next change of
3872
3883
  rows or branches. Compare its admitted children, as useAdmitted does
3873
3884
  the roots, if a caller needs that live. */
3874
3885
  // eslint-disable-next-line react-hooks/exhaustive-deps -- the open keys by value; the rows the pre-filter admits stand for it
3875
- [T, H, y, D]
3876
- ), q = Xo(y, i, {
3886
+ [R, W, y, B]
3887
+ ), F = Xo(y, l, {
3877
3888
  rowKey: O,
3878
3889
  pageSize: t.pageSize,
3879
3890
  defaultSort: t.defaultSort,
@@ -3883,142 +3894,142 @@ function Pa(e, t) {
3883
3894
  grouping: oe,
3884
3895
  server: d,
3885
3896
  tree: ge
3886
- }), { setPage: ae } = q, Ae = fe(
3887
- (N, $) => {
3888
- const K = typeof N == "string" ? N : N.id;
3889
- let $e = $ == null;
3890
- const on = g.has(K);
3897
+ }), { setPage: ae } = F, Ae = fe(
3898
+ (N, z) => {
3899
+ const G = typeof N == "string" ? N : N.id;
3900
+ let ze = z == null;
3901
+ const on = g.has(G);
3891
3902
  if (typeof N != "string" && !on) {
3892
3903
  X(
3893
- `row-filter-unknown:${K}`,
3894
- `The row filter "${K}" is not among the table's \`rowFilters\`; its condition is passed over.`
3904
+ `row-filter-unknown:${G}`,
3905
+ `The row filter "${G}" is not among the table's \`rowFilters\`; its condition is passed over.`
3895
3906
  );
3896
3907
  return;
3897
3908
  }
3898
- if (!$e && !on && n.orderedColumns().length > 0) {
3899
- const ve = n.columnById(K), Re = ve ? Ee(ve.spec.filter) : void 0;
3900
- if (!Re) {
3909
+ if (!ze && !on && n.orderedColumns().length > 0) {
3910
+ const ve = n.columnById(G), Te = ve ? Ee(ve.spec.filter) : void 0;
3911
+ if (!Te) {
3901
3912
  X(
3902
- `condition-without-filter:${K}`,
3903
- ve ? `The column "${K}" has no filter; its condition is passed over.` : `No column is called "${K}"; its condition is passed over.`
3913
+ `condition-without-filter:${G}`,
3914
+ ve ? `The column "${G}" has no filter; its condition is passed over.` : `No column is called "${G}"; its condition is passed over.`
3904
3915
  );
3905
3916
  return;
3906
3917
  }
3907
- const Te = Gn(Re, $);
3908
- if (Te === "foreign") {
3909
- Co(K);
3918
+ const Re = jn(Te, z);
3919
+ if (Re === "foreign") {
3920
+ Co(G);
3910
3921
  return;
3911
3922
  }
3912
- $e = Te === "empty";
3923
+ ze = Re === "empty";
3913
3924
  }
3914
- b((ve) => {
3915
- const Re = ve.findIndex(([Te]) => Te === K);
3916
- return $e ? Re === -1 ? ve : ve.filter((Te, gt) => gt !== Re) : Re === -1 ? [...ve, [K, $]] : ve.map((Te, gt) => gt === Re ? [K, $] : Te);
3925
+ p((ve) => {
3926
+ const Te = ve.findIndex(([Re]) => Re === G);
3927
+ return ze ? Te === -1 ? ve : ve.filter((Re, gt) => gt !== Te) : Te === -1 ? [...ve, [G, z]] : ve.map((Re, gt) => gt === Te ? [G, z] : Re);
3917
3928
  }), ae(1);
3918
3929
  },
3919
3930
  [n, ae, g]
3920
- ), ue = new Set(n.orderedColumns().map((N) => N.spec.id)), [Ne, Me] = P(() => /* @__PURE__ */ new Set());
3931
+ ), ue = new Set(n.orderedColumns().map((N) => N.spec.id)), [Ne, Me] = I(() => /* @__PURE__ */ new Set());
3921
3932
  if (!Cn(Ne, ue)) {
3922
- const N = new Set([...Ne].filter((K) => !ue.has(K)));
3933
+ const N = new Set([...Ne].filter((G) => !ue.has(G)));
3923
3934
  Me(ue);
3924
- const $ = (K) => N.has(K) && !g.has(K);
3925
- m.some(([K]) => $(K)) && b((K) => K.filter(([$e]) => !$($e)));
3935
+ const z = (G) => N.has(G) && !g.has(G);
3936
+ b.some(([G]) => z(G)) && p((G) => G.filter(([ze]) => !z(ze)));
3926
3937
  }
3927
- const pe = ue.size === 0 ? m : m.filter(([N, $]) => g.has(N) || xo(n, N, $)), U = ar(q.view, ue), Se = pe.length > 0 ? { ...U, conditions: Object.fromEntries(pe) } : U, Le = ue.size === 0 ? q.sort : q.sort.filter((N) => ue.has(N.column)), Pe = a || T ? [] : G ? n.effectiveGrouping(et(t.defaultGrouping), l) : et(t.defaultGrouping), qe = q.groups ? Go(q.groups, C) : G ? [] : [...C], Je = n.declaredPins(), V = nr(L, Je, ue), J = {
3938
+ const pe = ue.size === 0 ? b : b.filter(([N, z]) => g.has(N) || xo(n, N, z)), U = ar(F.view, ue), Se = pe.length > 0 ? { ...U, conditions: Object.fromEntries(pe) } : U, Le = ue.size === 0 ? F.sort : F.sort.filter((N) => ue.has(N.column)), Ie = a || R ? [] : j ? n.effectiveGrouping(et(t.defaultGrouping), i) : et(t.defaultGrouping), Fe = F.groups ? jo(F.groups, C) : j ? [] : [...C], Je = n.declaredPins(), P = nr(L, Je, ue), J = {
3928
3939
  ...Se,
3929
- ...Ea(ne, Pe) ? {} : { grouping: ne },
3930
- ...qe.length ? { folded: qe } : {},
3931
- ...V ? { pinned: V } : {},
3932
- ...T && !Cn(new Set(ce), new Set(I.filter((N) => Y.has(N)))) ? { branches: ce } : {}
3933
- }, ee = (N, $) => k((K) => er(K ?? n.declaredPins(), N, $)), [me, we] = P(0), Ao = (N) => {
3934
- q.restart(N), b(Object.entries(N.conditions ?? {})), S(N.grouping ? [...N.grouping] : et(t.defaultGrouping)), x(N.folded ?? []), k(N.pinned ? { ...N.pinned } : null), z(N.branches ?? I), we(($) => $ + 1);
3940
+ ...Ea(ne, Ie) ? {} : { grouping: ne },
3941
+ ...Fe.length ? { folded: Fe } : {},
3942
+ ...P ? { pinned: P } : {},
3943
+ ...R && !Cn(new Set(ce), new Set($.filter((N) => Y.has(N)))) ? { branches: ce } : {}
3944
+ }, te = (N, z) => k((G) => er(G ?? n.declaredPins(), N, z)), [me, we] = I(0), Ao = (N) => {
3945
+ F.restart(N), p(Object.entries(N.conditions ?? {})), S(N.grouping ? [...N.grouping] : et(t.defaultGrouping)), A(N.folded ?? []), k(N.pinned ? { ...N.pinned } : null), K(N.branches ?? $), we((z) => z + 1);
3935
3946
  }, No = (N) => {
3936
3947
  S([...N]), ae(1);
3937
- }, Ro = (N) => {
3938
- Sn(q.groups).includes(N) && (n.noteFocusBeforeFold(), x(($) => $.includes(N) ? $.filter((K) => K !== N) : [...$, N]));
3939
- }, Jt = !a && !!t.virtual, ut = !T && n.paginates() || Jt, ft = t.selection ?? q.selection, Xe = lr(J), Xt = W(Xe), Qt = W(0);
3948
+ }, To = (N) => {
3949
+ Sn(F.groups).includes(N) && (n.noteFocusBeforeFold(), A((z) => z.includes(N) ? z.filter((G) => G !== N) : [...z, N]));
3950
+ }, Jt = !a && !!t.virtual, ut = !R && n.paginates() || Jt, ft = t.selection ?? F.selection, Xe = lr(J), Xt = q(Xe), Qt = q(0);
3940
3951
  xe(() => {
3941
3952
  const N = Qt.current !== me;
3942
3953
  Qt.current = me, Xt.current !== Xe && (Xt.current = Xe, N || t.onViewChange?.(J));
3943
3954
  }, [Xe, me]);
3944
3955
  const Zt = {
3945
- search: q.search,
3956
+ search: F.search,
3946
3957
  conditions: Object.fromEntries(pe),
3947
3958
  sort: Le,
3948
- page: q.page,
3949
- pageSize: q.pageSize
3950
- }, ht = a ? ir(Zt) : "", en = W(null);
3959
+ page: F.page,
3960
+ pageSize: F.pageSize
3961
+ }, ht = a ? ir(Zt) : "", en = q(null);
3951
3962
  xe(() => {
3952
3963
  !a || en.current === ht || (en.current = ht, t.onRequest?.(Zt));
3953
3964
  }, [ht]);
3954
- const [Ie] = P(() => /* @__PURE__ */ new Map());
3965
+ const [$e] = I(() => /* @__PURE__ */ new Map());
3955
3966
  let tn;
3956
3967
  if (a) {
3957
3968
  const N = /* @__PURE__ */ new Set();
3958
- for (const $ of l) {
3959
- const K = O($);
3960
- N.add(K), Ie.set(K, $);
3969
+ for (const z of i) {
3970
+ const G = O(z);
3971
+ N.add(G), $e.set(G, z);
3961
3972
  }
3962
- for (const $ of [...Ie.keys()])
3963
- !N.has($) && !ft.isSelected($) && Ie.delete($);
3964
- tn = [...ft.selected].filter(($) => Ie.has($)).map(($) => Ie.get($));
3973
+ for (const z of [...$e.keys()])
3974
+ !N.has(z) && !ft.isSelected(z) && $e.delete(z);
3975
+ tn = [...ft.selected].filter((z) => $e.has(z)).map((z) => $e.get(z));
3965
3976
  }
3966
3977
  const nn = {
3967
3978
  rows: e,
3968
- filtered: q.filtered,
3969
- visible: ut || T ? q.visible : q.filtered,
3970
- page: ut ? q.page : 1,
3971
- pageCount: ut ? q.pageCount : 1,
3972
- pageSize: q.pageSize,
3973
- setPage: q.setPage,
3974
- setPageSize: q.setPageSize,
3975
- search: q.search,
3976
- setSearch: q.setSearch,
3979
+ filtered: F.filtered,
3980
+ visible: ut || R ? F.visible : F.filtered,
3981
+ page: ut ? F.page : 1,
3982
+ pageCount: ut ? F.pageCount : 1,
3983
+ pageSize: F.pageSize,
3984
+ setPage: F.setPage,
3985
+ setPageSize: F.setPageSize,
3986
+ search: F.search,
3987
+ setSearch: F.setSearch,
3977
3988
  sort: Le,
3978
- toggleSort: q.toggleSort,
3979
- hidden: q.hidden,
3980
- toggleColumn: q.toggleColumn,
3981
- order: q.order,
3982
- setOrder: q.setOrder,
3989
+ toggleSort: F.toggleSort,
3990
+ hidden: F.hidden,
3991
+ toggleColumn: F.toggleColumn,
3992
+ order: F.order,
3993
+ setOrder: F.setOrder,
3983
3994
  pinned: L ?? Je,
3984
- setPin: ee,
3985
- widths: La(i, q.widths),
3986
- setWidth: q.setWidth,
3987
- expanded: q.expanded,
3988
- toggleRow: q.toggleRow,
3995
+ setPin: te,
3996
+ widths: La(l, F.widths),
3997
+ setWidth: F.setWidth,
3998
+ expanded: F.expanded,
3999
+ toggleRow: F.toggleRow,
3989
4000
  filter: Object.fromEntries(pe),
3990
4001
  setFilter: Ae,
3991
- conditionOf: (N) => pe.find(([$]) => $ === N.id)?.[1] ?? null,
4002
+ conditionOf: (N) => pe.find(([z]) => z === N.id)?.[1] ?? null,
3992
4003
  selection: ft,
3993
4004
  view: J,
3994
4005
  grouping: ne,
3995
4006
  setGrouping: No,
3996
4007
  setView: Ao,
3997
- folded: qe,
3998
- toggleFold: Ro,
4008
+ folded: Fe,
4009
+ toggleFold: To,
3999
4010
  foldAll: () => {
4000
- n.noteFocusBeforeFold(), x(Sn(q.groups));
4011
+ n.noteFocusBeforeFold(), A(Sn(F.groups));
4001
4012
  },
4002
4013
  unfoldAll: () => {
4003
- n.noteFocusBeforeFold(), x([]);
4014
+ n.noteFocusBeforeFold(), A([]);
4004
4015
  },
4005
4016
  branches: ce,
4006
4017
  toggleBranch: (N) => {
4007
- Y.has(N) && z(($) => $.includes(N) ? $.filter((K) => K !== N) : [...$, N]);
4018
+ Y.has(N) && K((z) => z.includes(N) ? z.filter((G) => G !== N) : [...z, N]);
4008
4019
  },
4009
- unfoldAllBranches: () => z([...Y]),
4010
- foldAllBranches: () => z([]),
4011
- asCsv: () => Gi(n, s.levelColumn, r, s),
4020
+ unfoldAllBranches: () => K([...Y]),
4021
+ foldAllBranches: () => K([]),
4022
+ asCsv: () => ji(n, s.levelColumn, r, s),
4012
4023
  selectionAsText: () => to(n, r, s),
4013
4024
  virtual: Jt,
4014
- rowCount: a ? u : q.filtered.length,
4025
+ rowCount: a ? u : F.filtered.length,
4015
4026
  server: a
4016
4027
  };
4017
4028
  return n.setHook({
4018
- rows: l,
4029
+ rows: i,
4019
4030
  admitted: y,
4020
- modelColumns: i,
4021
- tableState: q,
4031
+ modelColumns: l,
4032
+ tableState: F,
4022
4033
  filter: v,
4023
4034
  grouping: oe,
4024
4035
  tree: ge,
@@ -4032,34 +4043,34 @@ function Pa(e, t) {
4032
4043
  rowFilters: g
4033
4044
  }), { ...nn, ...o };
4034
4045
  }
4035
- function Ia(e) {
4046
+ function $a(e) {
4036
4047
  return e;
4037
4048
  }
4038
4049
  function Ut(e, t) {
4039
4050
  const n = be();
4040
- e?.register(t, n), te(() => {
4051
+ e?.register(t, n), Z(() => {
4041
4052
  if (e)
4042
4053
  return e.register(t, n), e.commit(), () => {
4043
4054
  e.remove(t, n), e.commit();
4044
4055
  };
4045
4056
  }, [e, t, n]);
4046
4057
  }
4047
- function $a({ children: e, className: t, size: n = "sm", of: o }) {
4058
+ function za({ children: e, className: t, size: n = "sm", of: o }) {
4048
4059
  const r = Ye(o);
4049
4060
  Ut(r?.registry, "toolbar");
4050
4061
  const s = r?.registry;
4051
4062
  return /* @__PURE__ */ f(io, { registry: s ?? null, className: t, size: n, children: e });
4052
4063
  }
4053
- function za({ placeholder: e, "aria-label": t, className: n, size: o, grow: r, of: s }) {
4054
- const l = Ye(s), i = at(o), c = ie();
4055
- if (Ut(l?.registry, "search"), !l) return null;
4056
- const { snapshot: a } = l;
4064
+ function Ka({ placeholder: e, "aria-label": t, className: n, size: o, grow: r, of: s }) {
4065
+ const i = Ye(s), l = at(o), c = ie();
4066
+ if (Ut(i?.registry, "search"), !i) return null;
4067
+ const { snapshot: a } = i;
4057
4068
  return /* @__PURE__ */ f(
4058
4069
  On,
4059
4070
  {
4060
- size: i,
4071
+ size: l,
4061
4072
  type: "search",
4062
- className: F(r && h.searchGrow, n),
4073
+ className: D(r && h.searchGrow, n),
4063
4074
  value: a.search,
4064
4075
  onChange: (u) => a.setSearch(u.target.value),
4065
4076
  clearable: !0,
@@ -4069,35 +4080,35 @@ function za({ placeholder: e, "aria-label": t, className: n, size: o, grow: r, o
4069
4080
  }
4070
4081
  );
4071
4082
  }
4072
- function Ka({ size: e, of: t }) {
4073
- const n = Ye(t), o = at(e), r = ie(), [s, l] = P(!1), i = W(null), c = W(null), a = be(), [u, d] = P(null);
4074
- if (te(() => {
4083
+ function Ga({ size: e, of: t }) {
4084
+ const n = Ye(t), o = at(e), r = ie(), [s, i] = I(!1), l = q(null), c = q(null), a = be(), [u, d] = I(null);
4085
+ if (Z(() => {
4075
4086
  if (!u || !c.current) return;
4076
4087
  const _ = Array.from(c.current.children).find(
4077
- (x) => x.dataset.column === u.id
4088
+ (A) => A.dataset.column === u.id
4078
4089
  ), S = _?.querySelector(u.key), C = u.otherwise ? _?.querySelector(u.otherwise) : void 0;
4079
4090
  (S && !S.disabled ? S : C)?.focus();
4080
4091
  }, [u]), !n) return null;
4081
- const { registry: m, snapshot: b } = n, p = m.hook, w = m.inPinOrder(Dn(m.modelColumns(p.rows, p.formats), b.order)), g = m.pins(), v = (_, S) => {
4092
+ const { registry: b, snapshot: p } = n, m = b.hook, w = b.inPinOrder(Bn(b.modelColumns(m.rows, m.formats), p.order)), g = b.pins(), v = (_, S) => {
4082
4093
  const C = w[_ + S];
4083
4094
  return C !== void 0 && g[C.id] === g[w[_].id];
4084
- }, A = (_, S) => {
4085
- const C = w.map((O) => O.id), x = _ + S;
4095
+ }, x = (_, S) => {
4096
+ const C = w.map((O) => O.id), A = _ + S;
4086
4097
  if (!v(_, S)) return;
4087
- [C[_], C[x]] = [C[x], C[_]], b.setOrder(C);
4098
+ [C[_], C[A]] = [C[A], C[_]], p.setOrder(C);
4088
4099
  const [L, k] = S < 0 ? ["forward", "backward"] : ["backward", "forward"];
4089
4100
  d({ id: w[_].id, key: `[data-direction="${L}"]`, otherwise: `[data-direction="${k}"]` });
4090
4101
  }, y = (_, S, C) => {
4091
- const x = g[_] === C;
4092
- return /* @__PURE__ */ f(tt, { content: x ? r.unpinHint : C === "start" ? r.pinToStartHint : r.pinToEndHint, children: /* @__PURE__ */ f(
4102
+ const A = g[_] === C;
4103
+ return /* @__PURE__ */ f(tt, { content: A ? r.unpinHint : C === "start" ? r.pinToStartHint : r.pinToEndHint, children: /* @__PURE__ */ f(
4093
4104
  "button",
4094
4105
  {
4095
4106
  type: "button",
4096
- className: F(h.move, x && h.pinOn),
4107
+ className: D(h.move, A && h.pinOn),
4097
4108
  "data-pin": C,
4098
- "aria-label": x ? r.unpinColumn(S) : C === "start" ? r.pinColumnToStart(S) : r.pinColumnToEnd(S),
4109
+ "aria-label": A ? r.unpinColumn(S) : C === "start" ? r.pinColumnToStart(S) : r.pinColumnToEnd(S),
4099
4110
  onClick: () => {
4100
- b.setPin(_, x ? null : C), d({ id: _, key: `[data-pin="${C}"]` });
4111
+ p.setPin(_, A ? null : C), d({ id: _, key: `[data-pin="${C}"]` });
4101
4112
  },
4102
4113
  children: /* @__PURE__ */ f("svg", { viewBox: "0 0 10 10", width: "10", height: "10", "aria-hidden": "true", children: /* @__PURE__ */ f(
4103
4114
  "path",
@@ -4113,25 +4124,25 @@ function Ka({ size: e, of: t }) {
4113
4124
  }
4114
4125
  ) });
4115
4126
  };
4116
- return /* @__PURE__ */ R(re, { children: [
4127
+ return /* @__PURE__ */ T(re, { children: [
4117
4128
  /* @__PURE__ */ f(
4118
4129
  Q,
4119
4130
  {
4120
- ref: i,
4131
+ ref: l,
4121
4132
  size: o,
4122
4133
  "aria-haspopup": "dialog",
4123
4134
  "aria-expanded": s,
4124
4135
  "aria-controls": s ? a : void 0,
4125
- onClick: () => l(!s),
4136
+ onClick: () => i(!s),
4126
4137
  children: r.columns
4127
4138
  }
4128
4139
  ),
4129
- /* @__PURE__ */ R(
4140
+ /* @__PURE__ */ T(
4130
4141
  it,
4131
4142
  {
4132
4143
  open: s,
4133
- onOpenChange: l,
4134
- anchorRef: i,
4144
+ onOpenChange: i,
4145
+ anchorRef: l,
4135
4146
  align: "start",
4136
4147
  role: "dialog",
4137
4148
  ariaLabel: r.arrangeColumns,
@@ -4140,14 +4151,14 @@ function Ka({ size: e, of: t }) {
4140
4151
  children: [
4141
4152
  /* @__PURE__ */ f("ul", { ref: c, className: h.columnsList, "aria-label": r.arrangeColumns, children: w.map((_, S) => {
4142
4153
  const C = _.label ?? _.id;
4143
- return /* @__PURE__ */ R("li", { className: h.columnsEntry, "data-column": _.id, children: [
4154
+ return /* @__PURE__ */ T("li", { className: h.columnsEntry, "data-column": _.id, children: [
4144
4155
  /* @__PURE__ */ f(
4145
- He,
4156
+ We,
4146
4157
  {
4147
4158
  label: C,
4148
- checked: !b.hidden.includes(_.id),
4159
+ checked: !p.hidden.includes(_.id),
4149
4160
  disabled: _.hideable === !1,
4150
- onChange: () => b.toggleColumn(_.id)
4161
+ onChange: () => p.toggleColumn(_.id)
4151
4162
  }
4152
4163
  ),
4153
4164
  /* @__PURE__ */ f(tt, { content: r.columnForwardHint, children: /* @__PURE__ */ f(
@@ -4158,7 +4169,7 @@ function Ka({ size: e, of: t }) {
4158
4169
  "data-direction": "forward",
4159
4170
  "aria-label": r.columnForward(C),
4160
4171
  disabled: !v(S, -1),
4161
- onClick: () => A(S, -1),
4172
+ onClick: () => x(S, -1),
4162
4173
  children: /* @__PURE__ */ f("svg", { viewBox: "0 0 10 10", width: "10", height: "10", "aria-hidden": "true", children: /* @__PURE__ */ f("path", { d: "M2 6.5 5 3.5l3 3", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinecap: "round", strokeLinejoin: "round" }) })
4163
4174
  }
4164
4175
  ) }),
@@ -4170,7 +4181,7 @@ function Ka({ size: e, of: t }) {
4170
4181
  "data-direction": "backward",
4171
4182
  "aria-label": r.columnBackward(C),
4172
4183
  disabled: !v(S, 1),
4173
- onClick: () => A(S, 1),
4184
+ onClick: () => x(S, 1),
4174
4185
  children: /* @__PURE__ */ f("svg", { viewBox: "0 0 10 10", width: "10", height: "10", "aria-hidden": "true", children: /* @__PURE__ */ f("path", { d: "M2 3.5 5 6.5l3-3", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinecap: "round", strokeLinejoin: "round" }) })
4175
4186
  }
4176
4187
  ) }),
@@ -4178,71 +4189,71 @@ function Ka({ size: e, of: t }) {
4178
4189
  y(_.id, C, "end")
4179
4190
  ] }, _.id);
4180
4191
  }) }),
4181
- /* @__PURE__ */ f(Ji, { registry: m, hook: p }),
4182
- /* @__PURE__ */ f(Xi, { registry: m, hook: p })
4192
+ /* @__PURE__ */ f(Ji, { registry: b, hook: m }),
4193
+ /* @__PURE__ */ f(Xi, { registry: b, hook: m })
4183
4194
  ]
4184
4195
  }
4185
4196
  )
4186
4197
  ] });
4187
4198
  }
4188
- function Ga({ filename: e, onExport: t, size: n, of: o }) {
4189
- const r = Ye(o), s = at(n), l = ie();
4199
+ function ja({ filename: e, onExport: t, size: n, of: o }) {
4200
+ const r = Ye(o), s = at(n), i = ie();
4190
4201
  if (!r) return null;
4191
- const { snapshot: i } = r;
4202
+ const { snapshot: l } = r;
4192
4203
  return /* @__PURE__ */ f(Q, { size: s, onClick: () => {
4193
- const a = i.asCsv();
4204
+ const a = l.asCsv();
4194
4205
  if (t) {
4195
4206
  t(a);
4196
4207
  return;
4197
4208
  }
4198
4209
  const u = URL.createObjectURL(new Blob([a], { type: "text/csv;charset=utf-8" })), d = document.createElement("a");
4199
- d.href = u, d.download = e ?? l.exportFileName, d.click(), setTimeout(() => URL.revokeObjectURL(u), 1e4);
4200
- }, children: i.server ? l.exportPageLabel : l.exportLabel });
4210
+ d.href = u, d.download = e ?? i.exportFileName, d.click(), setTimeout(() => URL.revokeObjectURL(u), 1e4);
4211
+ }, children: l.server ? i.exportPageLabel : i.exportLabel });
4201
4212
  }
4202
- function ja({ pageSizes: e = [10, 25, 50], className: t, of: n }) {
4213
+ function Ha({ pageSizes: e = [10, 25, 50], className: t, of: n }) {
4203
4214
  const o = Ye(n), r = ie(), s = ke();
4204
4215
  if (Ut(o?.registry, "pagination"), o?.registry.tree && X("tree-pagination", "`Pagination` is passed over with `childRows`: a page cut through a branch tears rows from their parent. A large tree uses `virtual`."), !o || o.snapshot.virtual || o.registry.tree) return null;
4205
- const { snapshot: l } = o, i = l.rowCount, c = e.includes(l.pageSize) ? e : [...e, l.pageSize].sort((u, d) => u - d), a = /* @__PURE__ */ R("nav", { "aria-label": r.pagination, className: F(h.pagination, t), children: [
4206
- /* @__PURE__ */ f("span", { children: r.entries(i, s.count(i)) }),
4207
- /* @__PURE__ */ R("div", { className: h.paginationControls, children: [
4208
- /* @__PURE__ */ R("label", { className: h.pageSize, children: [
4216
+ const { snapshot: i } = o, l = i.rowCount, c = e.includes(i.pageSize) ? e : [...e, i.pageSize].sort((u, d) => u - d), a = /* @__PURE__ */ T("nav", { "aria-label": r.pagination, className: D(h.pagination, t), children: [
4217
+ /* @__PURE__ */ f("span", { children: r.entries(l, s.count(l)) }),
4218
+ /* @__PURE__ */ T("div", { className: h.paginationControls, children: [
4219
+ /* @__PURE__ */ T("label", { className: h.pageSize, children: [
4209
4220
  r.rows,
4210
4221
  /* @__PURE__ */ f(
4211
- Tn,
4222
+ Rn,
4212
4223
  {
4213
4224
  size: "sm",
4214
4225
  chars: Math.max(...c.map((u) => String(u).length)),
4215
- value: l.pageSize,
4216
- onChange: (u) => l.setPageSize(Number(u.target.value)),
4226
+ value: i.pageSize,
4227
+ onChange: (u) => i.setPageSize(Number(u.target.value)),
4217
4228
  "aria-label": r.rowsPerPage,
4218
4229
  children: c.map((u) => /* @__PURE__ */ f("option", { value: u, children: u }, u))
4219
4230
  }
4220
4231
  )
4221
4232
  ] }),
4222
- /* @__PURE__ */ R("span", { className: h.pageSteps, children: [
4223
- /* @__PURE__ */ f("span", { className: h.paginationStatus, children: r.pageOfPages(l.page, l.pageCount, {
4224
- page: s.count(l.page),
4225
- total: s.count(l.pageCount)
4233
+ /* @__PURE__ */ T("span", { className: h.pageSteps, children: [
4234
+ /* @__PURE__ */ f("span", { className: h.paginationStatus, children: r.pageOfPages(i.page, i.pageCount, {
4235
+ page: s.count(i.page),
4236
+ total: s.count(i.pageCount)
4226
4237
  }) }),
4227
- /* @__PURE__ */ f(Q, { size: "sm", disabled: l.page <= 1, onClick: () => l.setPage(l.page - 1), children: r.previousPage }),
4228
- /* @__PURE__ */ f(Q, { size: "sm", disabled: l.page >= l.pageCount, onClick: () => l.setPage(l.page + 1), children: r.nextPage })
4238
+ /* @__PURE__ */ f(Q, { size: "sm", disabled: i.page <= 1, onClick: () => i.setPage(i.page - 1), children: r.previousPage }),
4239
+ /* @__PURE__ */ f(Q, { size: "sm", disabled: i.page >= i.pageCount, onClick: () => i.setPage(i.page + 1), children: r.nextPage })
4229
4240
  ] })
4230
4241
  ] })
4231
4242
  ] });
4232
4243
  return o.inside ? o.footerTarget ? En(a, o.footerTarget) : null : a;
4233
4244
  }
4234
- function Ha(e) {
4245
+ function Wa(e) {
4235
4246
  return e;
4236
4247
  }
4237
4248
  export {
4238
- Ka as ColumnMenu,
4239
- Ga as Export,
4240
- ja as Pagination,
4241
- za as Search,
4242
- $a as Toolbar,
4243
- Ia as column,
4244
- Va as columnFilter,
4245
- Ha as rowFilter,
4246
- Pa as useTable,
4247
- zo as useTableSelection
4249
+ Ga as ColumnMenu,
4250
+ ja as Export,
4251
+ Ha as Pagination,
4252
+ Ka as Search,
4253
+ za as Toolbar,
4254
+ $a as column,
4255
+ Pa as columnFilter,
4256
+ Wa as rowFilter,
4257
+ Ia as useTable,
4258
+ Ko as useTableSelection
4248
4259
  };