@umriss-ui/table 0.40.4 → 0.41.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,10 +1,10 @@
1
1
  "use client";
2
2
  import "./table.css";
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";
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 Ce } from "react";
4
+ import { DEFAULT_FORMATS as Cn, treeModel as rn, useVirtual as Oo, useFormats as xe, useWording as ie, Checkbox as We, DateRangePicker as Eo, FormField as vt, NumberInput as yt, separatorsOf as Mo, Tooltip as tt, Popover as it, Button as Q, TagGroup as An, Tag as Pt, Menu as Nn, MenuItem as nt, MenuSeparator as Lo, ControlSizeProvider as Tn, Select as Rn, VisuallyHidden as Oe, DatePicker as Fo, Input as On, announce as Bo, usePortalTarget as Do, IconButton as Po, AngleGlyph as Vo, useDensityFor as Io, assess as $o, verdictWeight as _t, allBranches as zo, duplicateKey as Ko } from "@umriss-ui/core";
5
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 Ko(e) {
7
+ function Go(e) {
8
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);
@@ -35,8 +35,8 @@ function Mn(e, t) {
35
35
  }
36
36
  return "empty";
37
37
  }
38
- const Pt = (e, t) => t ?? e === "number";
39
- function Ve(e, t, n, o) {
38
+ const Vt = (e, t) => t ?? e === "number";
39
+ function Pe(e, t, n, o) {
40
40
  switch (lt(e)) {
41
41
  case "text":
42
42
  return e;
@@ -54,9 +54,9 @@ function Ve(e, t, n, o) {
54
54
  return null;
55
55
  }
56
56
  }
57
- function kt(e, t) {
57
+ function xt(e, t) {
58
58
  if (!se(e)) {
59
- if (t) return kt(t(e));
59
+ if (t) return xt(t(e));
60
60
  switch (lt(e)) {
61
61
  case "text":
62
62
  return e;
@@ -88,12 +88,12 @@ function It(e, t) {
88
88
  }
89
89
  }
90
90
  }
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;
91
+ const $t = "absent", Se = (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
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
- if (o === "distinct") return new Set(n.map(Ce)).size;
96
+ if (o === "distinct") return new Set(n.map(Se)).size;
97
97
  const r = n.filter((u) => sn(u) !== void 0);
98
98
  if (r.length === 0) return;
99
99
  const s = r.map((u) => sn(u)), i = r[0] instanceof Date, l = (u) => i ? new Date(u) : u;
@@ -121,22 +121,22 @@ function pt(e, t, n) {
121
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 Go(e, t) {
125
- const n = t.compareText ?? xn.compareText, o = (r, s, i) => {
124
+ function jo(e, t) {
125
+ const n = t.compareText ?? Cn.compareText, o = (r, s, i) => {
126
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), x = Ce(v);
131
- let y = a.get(x);
130
+ const v = c.value(g), C = Se(v);
131
+ let y = a.get(C);
132
132
  y || (y = {
133
- path: JSON.stringify([...i, x]),
133
+ path: JSON.stringify([...i, C]),
134
134
  value: se(v) ? void 0 : v,
135
135
  level: s,
136
136
  rows: [],
137
137
  groups: [],
138
138
  aggregates: {}
139
- }, a.set(x, y), l.set(y, [...i, x])), y.rows.push(g);
139
+ }, a.set(C, y), l.set(y, [...i, C])), y.rows.push(g);
140
140
  }
141
141
  for (const g of a.values())
142
142
  for (const v of t.aggregates ?? []) g.aggregates[v.id] = zt(v, g.rows);
@@ -144,8 +144,8 @@ function Go(e, t) {
144
144
  (g) => g.column === c.id || t.aggregates?.some((v) => v.id === g.column)
145
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 x of g.rows) {
148
- const y = c.order(x);
147
+ for (const C of g.rows) {
148
+ const y = c.order(C);
149
149
  He(y) !== void 0 && (v === void 0 || pt(y, v, n) < 0) && (v = y);
150
150
  }
151
151
  return v;
@@ -155,8 +155,8 @@ function Go(e, t) {
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 x = m(g), y = m(v), _ = pt(x, y, n);
159
- return He(x) === void 0 || He(y) === void 0 ? _ : _ * d;
158
+ const C = m(g), y = m(v), _ = pt(C, y, n);
159
+ return He(C) === void 0 || He(y) === void 0 ? _ : _ * d;
160
160
  });
161
161
  for (const g of w)
162
162
  g.groups = o(g.rows, s + 1, l.get(g));
@@ -164,27 +164,27 @@ function Go(e, t) {
164
164
  };
165
165
  return o(e, 0, []);
166
166
  }
167
- function jo(e, t) {
167
+ function Ho(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 Ho = (e) => (t) => {
174
+ const Wo = (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 Wo(e) {
179
+ function qo(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 qo(e, t, n, o) {
183
+ function Yo(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 } = Wo(t);
187
+ const { week: r, year: s } = qo(t);
188
188
  return o.calendarWeek(r, s);
189
189
  }
190
190
  return n.date(t);
@@ -201,16 +201,16 @@ function Ln(e, t) {
201
201
  };
202
202
  return o(e, []), n;
203
203
  }
204
- function Yo(e, t, n) {
204
+ function Uo(e, t, n) {
205
205
  const o = [0];
206
206
  if (n > 0)
207
207
  for (let l = 0; l += Math.max(1, n - (e[l]?.parents.length ?? 0)), !(l >= e.length); )
208
208
  o.push(l);
209
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 };
210
+ return { lines: Bn(i), page: s, pageCount: r };
211
211
  }
212
212
  const Fn = (e) => e.flatMap((t) => t.kind === "row" ? [t.row] : []);
213
- function Dn(e) {
213
+ function Bn(e) {
214
214
  const t = e[0];
215
215
  if (!t) return [...e];
216
216
  const n = t.parents.map((r, s) => ({
@@ -221,28 +221,28 @@ function Dn(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 Bn(e, t) {
224
+ function Dn(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 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) {
230
+ const Be = (e) => e == null || typeof e == "number" && Number.isNaN(e), Jo = (e, t) => typeof e == "number" && typeof t == "number" ? e - t : Cn.compareText(String(e), String(t));
231
+ function Pn(e, t, n) {
232
232
  const o = (t ?? "").trim().toLowerCase(), r = e.filter((i) => i.searchable && i.value), s = (i) => !o || r.some((l) => {
233
233
  const c = l.value(i);
234
- return !De(c) && String(c).toLowerCase().includes(o);
234
+ return !Be(c) && String(c).toLowerCase().includes(o);
235
235
  });
236
236
  return { term: o, matches: (i) => s(i) && (n ? n(i) : !0) };
237
237
  }
238
- function Pn(e, t) {
238
+ function Vn(e, t) {
239
239
  const n = Array.isArray(t) ? t : t ? [t] : [], o = [], r = n.map((i) => {
240
240
  const l = e.find((b) => b.id === i.column);
241
241
  if (!l || !l.compare && !l.value) return null;
242
242
  const c = i.direction === "asc" ? 1 : -1, a = l.compare, u = l.value, d = o.length;
243
243
  return o.push(u), u ? (b, p) => {
244
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;
245
+ return Be(m) || Be(w) ? Be(m) === Be(w) ? 0 : Be(m) ? 1 : -1 : (a ? a(b.row, p.row) : Jo(m, w)) * c;
246
246
  } : (b, p) => a(b.row, p.row) * c;
247
247
  }).filter((i) => i !== null);
248
248
  return { levels: n, sorted: (i) => (
@@ -257,16 +257,16 @@ function Pn(e, t) {
257
257
  ) };
258
258
  }
259
259
  function In(e, t, n) {
260
- const { matches: o } = Vn(t, n.search, n.filter), { levels: r, sorted: s } = Pn(t, n.sort);
260
+ const { matches: o } = Pn(t, n.search, n.filter), { levels: r, sorted: s } = Vn(t, n.sort);
261
261
  return { filtered: s(e.filter(o)), levels: r };
262
262
  }
263
263
  function $n(e, t, n) {
264
- return Go(e, { levels: n.levels, aggregates: n.aggregates, compareText: n.compareText, sort: t });
264
+ return jo(e, { levels: n.levels, aggregates: n.aggregates, compareText: n.compareText, sort: t });
265
265
  }
266
- function St(e, t, n, o) {
267
- const { page: r = 1, pageSize: s, hidden: i, order: l } = t, c = Ct(e, i, l);
266
+ function kt(e, t, n, o) {
267
+ const { page: r = 1, pageSize: s, hidden: i, order: l } = t, c = St(e, i, l);
268
268
  if (o) {
269
- const b = Yo(o.lines, r, s ?? 0);
269
+ const b = Uo(o.lines, r, s ?? 0);
270
270
  return {
271
271
  columns: c,
272
272
  filtered: n,
@@ -289,14 +289,14 @@ function St(e, t, n, o) {
289
289
  columnCount: c.length
290
290
  };
291
291
  }
292
- const Ct = (e, t, n) => {
293
- const o = Bn(e, n);
292
+ const St = (e, t, n) => {
293
+ const o = Dn(e, n);
294
294
  return t?.length ? o.filter((r) => r.hideable === !1 || !t.includes(r.id)) : o;
295
295
  };
296
296
  function zn(e, t, n) {
297
297
  const { page: o = 1, pageSize: r, hidden: s, order: i } = n;
298
298
  if (n.server) {
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);
299
+ const u = St(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],
@@ -307,21 +307,21 @@ function zn(e, t, n) {
307
307
  };
308
308
  }
309
309
  if (n.tree) {
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));
310
+ const { term: u, matches: d } = Pn(t, n.search, n.filter), { sorted: b } = Vn(t, n.sort);
311
+ return Xo(e, n.tree, b, u || n.filter ? d : void 0, St(t, s, i));
312
312
  }
313
313
  const { filtered: l, levels: c } = In(e, t, n);
314
- if (!n.grouping?.levels.length) return St(t, n, l);
314
+ if (!n.grouping?.levels.length) return kt(t, n, l);
315
315
  const a = $n(l, c, n.grouping);
316
- return St(t, n, l, { groups: a, lines: Ln(a, n.grouping.folded) });
316
+ return kt(t, n, l, { groups: a, lines: Ln(a, n.grouping.folded) });
317
317
  }
318
- function Jo(e, t, n, o, r) {
318
+ function Xo(e, t, n, o, r) {
319
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
322
  if (!l.has(v)) {
323
- const x = t.children(v);
324
- l.set(v, x && i(x));
323
+ const C = t.children(v);
324
+ l.set(v, C && i(C));
325
325
  }
326
326
  return l.get(v);
327
327
  },
@@ -330,10 +330,10 @@ function Jo(e, t, n, o, r) {
330
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
331
  let p = 0;
332
332
  const m = (v) => {
333
- for (const x of v) {
333
+ for (const C of v) {
334
334
  p++;
335
- const y = c.children(x);
336
- y && (b.add(t.key(x)), m(y));
335
+ const y = c.children(C);
336
+ y && (b.add(t.key(C)), m(y));
337
337
  }
338
338
  };
339
339
  m(a);
@@ -352,7 +352,7 @@ function Jo(e, t, n, o, r) {
352
352
  columnCount: r.length
353
353
  };
354
354
  }
355
- function xt(e) {
355
+ function Ct(e) {
356
356
  const t = {};
357
357
  for (const n of e) n.width !== void 0 && (t[n.id] = n.width);
358
358
  return t;
@@ -362,74 +362,74 @@ function Kn(e, t, n) {
362
362
  const o = e.lines.slice(t, n);
363
363
  return { ...e, visibleLines: o, visible: Fn(o) };
364
364
  }
365
- function Xo(e, t, n) {
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(
365
+ function Qo(e, t, n) {
366
+ const { rowKey: o, filter: r, defaultSort: s = null, initialView: i, virtual: l, grouping: c, server: a, tree: u } = n, d = (V) => V?.sort?.length ? [...V.sort] : s ? Array.isArray(s) ? [...s] : [s] : [], b = (V) => V?.widths ? { ...V.widths } : Ct(t), [p, m] = I(i?.search ?? ""), [w, g] = I(() => d(i)), [v, C] = I(i?.page ?? 1), [y, _] = I(
367
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(
368
+ ), [k, S] = I([]), [A, L] = I(i?.hidden ?? []), [x, O] = I(i?.order ?? []), [M, R] = I(() => b(i)), E = (V) => {
369
+ m(V.search ?? ""), g(d(V)), C(V.page ?? 1), _(V.pageSize ?? n.pageSize ?? 10), L(V.hidden ?? []), O(V.order ?? []), R(b(V));
370
+ }, D = l || u ? 0 : y, $ = !a && !u, P = H(
371
371
  () => $ ? In(e, t, { search: p, filter: r, sort: w }) : null,
372
372
  [$, e, t, p, r, w]
373
373
  ), K = c?.levels.length ? c : void 0, Y = H(
374
- () => V && K ? $n(V.filtered, V.levels, K) : void 0,
374
+ () => P && K ? $n(P.filtered, P.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
- [V, K?.levels, K?.aggregates, K?.compareText]
377
+ [P, K?.levels, K?.aggregates, K?.compareText]
378
378
  ), ce = H(
379
379
  () => Y && K ? Ln(Y, K.folded) : void 0,
380
380
  // eslint-disable-next-line react-hooks/exhaustive-deps
381
381
  [Y, K?.folded]
382
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, {
383
+ () => P ? kt(t, { page: v, pageSize: D, hidden: A, order: x }, P.filtered, Y && ce ? { groups: Y, lines: ce } : void 0) : zn(e, t, { search: p, filter: r, sort: w, page: v, pageSize: D, hidden: A, order: x, grouping: c, server: a, tree: u }),
384
+ [P, Y, ce, t, v, D, A, x, e, p, r, w, c, a, u]
385
+ ), [ne, de] = I(36), le = Oo(l ? (j.lines ?? j.shown ?? j.filtered).length : 0, {
386
386
  rowHeight: l ? ne : 0,
387
387
  overscan: typeof l == "object" ? l.overscan : void 0
388
388
  }), ee = H(
389
389
  () => l ? Kn(j, le.from, le.to) : j,
390
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) => {
391
+ ), oe = ee.visibleLines, W = ee.visible, ge = H(() => j.filtered.map(o), [j.filtered, o]), F = Go(ge), ae = fe((V) => {
392
+ m(V), C(1);
393
+ }, []), Ae = fe((V) => {
394
+ _(V), C(1);
395
+ }, []), ue = fe((V, J = !1) => {
396
396
  g((te) => {
397
- const me = te.find((we) => we.column === P);
397
+ const me = te.find((we) => we.column === V);
398
398
  if (!J) {
399
399
  const we = te.length === 1 && me?.direction === "asc" ? "desc" : "asc";
400
- return [{ column: P, direction: we }];
400
+ return [{ column: V, direction: we }];
401
401
  }
402
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
- C(
408
- (J) => J.includes(P) ? J.filter((te) => te !== P) : [...J, P]
403
+ (we) => we.column === V ? { column: V, direction: "desc" } : we
404
+ ) : te.filter((we) => we.column !== V) : [...te, { column: V, direction: "asc" }];
405
+ }), C(1);
406
+ }, []), Ne = fe((V) => {
407
+ S(
408
+ (J) => J.includes(V) ? J.filter((te) => te !== V) : [...J, V]
409
409
  );
410
- }, []), Me = fe((P) => {
410
+ }, []), Me = fe((V) => {
411
411
  L(
412
- (J) => J.includes(P) ? J.filter((te) => te !== P) : [...J, P]
412
+ (J) => J.includes(V) ? J.filter((te) => te !== V) : [...J, V]
413
413
  );
414
- }, []), pe = fe((P, J) => {
414
+ }, []), pe = fe((V, J) => {
415
415
  R((te) => {
416
416
  if (J === void 0) {
417
- if (!(P in te)) return te;
417
+ if (!(V in te)) return te;
418
418
  const me = { ...te };
419
- return delete me[P], me;
419
+ return delete me[V], me;
420
420
  }
421
- return { ...te, [P]: J };
421
+ return { ...te, [V]: J };
422
422
  });
423
- }, []), U = n.pageSize ?? 10, Se = H(() => xt(t), [t]), Le = H(() => {
424
- const P = {};
423
+ }, []), U = n.pageSize ?? 10, ke = H(() => Ct(t), [t]), Le = H(() => {
424
+ const V = {};
425
425
  for (const [J, te] of Object.entries(M))
426
- Se[J] !== te && (P[J] = te);
427
- return P;
428
- }, [M, Se]), Ie = H(
426
+ ke[J] !== te && (V[J] = te);
427
+ return V;
428
+ }, [M, ke]), Ie = H(
429
429
  () => s ? Array.isArray(s) ? s : [s] : [],
430
430
  [s]
431
431
  ), Fe = w.length === Ie.length && w.every(
432
- (P, J) => P.column === Ie[J]?.column && P.direction === Ie[J]?.direction
432
+ (V, J) => V.column === Ie[J]?.column && V.direction === Ie[J]?.direction
433
433
  ), Je = H(
434
434
  () => ({
435
435
  ...p ? { search: p } : {},
@@ -440,7 +440,7 @@ function Xo(e, t, n) {
440
440
  ...!l && j.page > 1 ? { page: j.page } : {},
441
441
  ...!l && y !== U ? { pageSize: y } : {},
442
442
  ...A.length ? { hidden: A } : {},
443
- ...k.length ? { order: k } : {},
443
+ ...x.length ? { order: x } : {},
444
444
  ...Object.keys(Le).length ? { widths: Le } : {}
445
445
  }),
446
446
  [
@@ -452,7 +452,7 @@ function Xo(e, t, n) {
452
452
  y,
453
453
  U,
454
454
  A,
455
- k,
455
+ x,
456
456
  Le
457
457
  ]
458
458
  );
@@ -469,57 +469,57 @@ function Xo(e, t, n) {
469
469
  setSearch: ae,
470
470
  sort: w,
471
471
  toggleSort: ue,
472
- setPage: x,
472
+ setPage: C,
473
473
  pageSize: y,
474
474
  setPageSize: Ae,
475
- expanded: S,
475
+ expanded: k,
476
476
  toggleRow: Ne,
477
477
  hidden: A,
478
478
  toggleColumn: Me,
479
- order: k,
479
+ order: x,
480
480
  setOrder: O,
481
481
  widths: M,
482
482
  setWidth: pe,
483
483
  selection: F
484
484
  };
485
485
  }
486
- function Qo(e, t) {
486
+ function Zo(e, t) {
487
487
  return [
488
488
  ...e.filter((n) => t[n.id] === "start"),
489
489
  ...e.filter((n) => t[n.id] === void 0),
490
490
  ...e.filter((n) => t[n.id] === "end")
491
491
  ];
492
492
  }
493
- function Zo(e, t) {
493
+ function er(e, t) {
494
494
  const n = {};
495
495
  for (const o of e) o.pin && (n[o.id] = o.pin);
496
496
  return t !== void 0 && !n[t] && (n[t] = "start"), n;
497
497
  }
498
- function er(e, t, n) {
498
+ function tr(e, t, n) {
499
499
  const o = { ...e };
500
500
  return n ? o[t] = n : delete o[t], o;
501
501
  }
502
- const tr = (e, t) => Object.keys(e).length === Object.keys(t).length && Object.entries(e).every(([n, o]) => t[n] === o);
503
- function nr(e, t, n) {
502
+ const nr = (e, t) => Object.keys(e).length === Object.keys(t).length && Object.entries(e).every(([n, o]) => t[n] === o);
503
+ function or(e, t, n) {
504
504
  if (!e) return;
505
505
  const o = n.size === 0 ? e : Object.fromEntries(Object.entries(e).filter(([r]) => n.has(r)));
506
- return tr(o, t) ? void 0 : o;
506
+ return nr(o, t) ? void 0 : o;
507
507
  }
508
- function or(e, t, n = t) {
508
+ function rr(e, t, n = t) {
509
509
  if (n < e.start) return { side: "start", at: t, edge: n === e.start - 1 };
510
510
  const o = e.count - e.end;
511
511
  if (e.end > 0 && t >= o) return { side: "end", at: e.count - 1 - n, edge: t === o };
512
512
  }
513
- const rr = 256;
514
- function sr(e, t, n) {
515
- const o = n - Math.min(n / 2, rr);
513
+ const sr = 256;
514
+ function ir(e, t, n) {
515
+ const o = n - Math.min(n / 2, sr);
516
516
  return n <= 0 || e + t <= o ? { start: !0, end: !0 } : e > 0 && e <= o ? { start: !0, end: !1 } : { start: !1, end: t > 0 && t <= o };
517
517
  }
518
- const ir = (e) => JSON.stringify([e.search, e.conditions, e.sort, e.page, e.pageSize]), lr = (e) => JSON.stringify(
518
+ const lr = (e) => JSON.stringify([e.search, e.conditions, e.sort, e.page, e.pageSize]), ar = (e) => JSON.stringify(
519
519
  { ...e, hidden: mt(e.hidden), folded: mt(e.folded), branches: mt(e.branches) },
520
520
  (t, n) => n && typeof n == "object" && !Array.isArray(n) ? Object.fromEntries(Object.entries(n).sort(([o], [r]) => o < r ? -1 : o > r ? 1 : 0)) : n
521
521
  ), mt = (e) => e === void 0 ? void 0 : [...e].sort();
522
- function ar(e, t) {
522
+ function cr(e, t) {
523
523
  if (t.size === 0) return e;
524
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 : {
@@ -532,138 +532,141 @@ function ar(e, t) {
532
532
  ...s && Object.keys(s).length ? { widths: s } : {}
533
533
  };
534
534
  }
535
- function cr() {
536
- const e = import.meta;
537
- return typeof e.env?.DEV == "boolean" ? e.env.DEV : typeof process < "u" && process?.env ? process.env.NODE_ENV !== "production" : !1;
535
+ function dr() {
536
+ try {
537
+ return process.env.NODE_ENV !== "production";
538
+ } catch {
539
+ return !1;
540
+ }
538
541
  }
539
- const Gt = cr(), ln = /* @__PURE__ */ new Set();
542
+ const Gt = dr(), ln = /* @__PURE__ */ new Set();
540
543
  function X(e, t) {
541
544
  !Gt || ln.has(e) || (ln.add(e), console.warn(`@umriss-ui/table: ${t}`));
542
545
  }
543
- const dr = "_frame_1fs8c_11 _text_18806_22", ur = "_children_1fs8c_24", fr = "_scroll_1fs8c_33 _scroll_18806_96", hr = "_footerTarget_1fs8c_62", gr = "_table_1fs8c_76", pr = "_th_1fs8c_88 _ring_18806_125", mr = "_sticky_1fs8c_108", wr = "_td_1fs8c_128", br = "_rowHeader_1fs8c_142", vr = "_compact_1fs8c_163 _dense_18806_38", yr = "_numeric_1fs8c_194", _r = "_value_1fs8c_214", kr = "_valueText_1fs8c_224", Sr = "_sized_1fs8c_228", Cr = "_cutTip_1fs8c_245 _text_18806_22", xr = "_absent_1fs8c_287", Ar = "_striped_1fs8c_291", Nr = "_pinned_1fs8c_316", Tr = "_pinStartEdge_1fs8c_332", Rr = "_pinEndEdge_1fs8c_333", Or = "_sortButton_1fs8c_363 _ring_18806_125", Er = "_sortIndicator_1fs8c_388", Mr = "_sortArrow_1fs8c_395", Lr = "_sortArrowDesc_1fs8c_399", Fr = "_sortActive_1fs8c_407", Dr = "_sortRank_1fs8c_413", Br = "_thFlex_1fs8c_421", Vr = "_headLine_1fs8c_441", Pr = "_headLabel_1fs8c_464", Ir = "_footerKind_1fs8c_480", $r = "_emptyCell_1fs8c_498", zr = "_emptyTitle_1fs8c_520", Kr = "_skeleton_1fs8c_529", Gr = "_toolbar_1fs8c_561 _text_18806_22", jr = "_toolbarGroup_1fs8c_577", Hr = "_toolbarGroupIdle_1fs8c_593", Wr = "_searchGrow_1fs8c_600", qr = "_toolbarMd_1fs8c_610", Yr = "_toolbarInfo_1fs8c_614", Ur = "_pagination_1fs8c_620 _text_18806_22", Jr = "_paginationControls_1fs8c_633", Xr = "_pageSize_1fs8c_640", Qr = "_pageSteps_1fs8c_648", Zr = "_paginationStatus_1fs8c_654", es = "_filterButton_1fs8c_663 _ring_18806_125", ts = "_filterActive_1fs8c_690", ns = "_filterPanel_1fs8c_695", os = "_filterContent_1fs8c_709 _scroll_18806_96", rs = "_filterFooter_1fs8c_720", ss = "_filterLabel_1fs8c_734", is = "_filterValue_1fs8c_744", ls = "_filteredCount_1fs8c_750", as = "_rangeFields_1fs8c_761", cs = "_rangePeriod_1fs8c_771", ds = "_conditions_1fs8c_777", us = "_conditionButton_1fs8c_783", fs = "_condition_1fs8c_777", hs = "_columnsPanel_1fs8c_808", gs = "_columnsList_1fs8c_817", ps = "_columnsEntry_1fs8c_826", ms = "_move_1fs8c_838", ws = "_pinOn_1fs8c_876", bs = "_groupingChoice_1fs8c_886", vs = "_groupingHeading_1fs8c_894", ys = "_groupingOptions_1fs8c_903", _s = "_groupingOption_1fs8c_903 _ring_18806_125", ks = "_groupingLevel_1fs8c_946", Ss = "_groupingTag_1fs8c_951", Cs = "_groupingTrigger_1fs8c_958", xs = "_groupingPrefix_1fs8c_964", As = "_groupingPath_1fs8c_969", Ns = "_groupingSeparator_1fs8c_973", Ts = "_groupHeader_1fs8c_990", Rs = "_spanCell_1fs8c_1033", Os = "_groupFolded_1fs8c_1114", Es = "_spanValue_1fs8c_1118", Ms = "_groupLabel_1fs8c_1119", Ls = "_spanText_1fs8c_1132", Fs = "_groupValue_1fs8c_1133", Ds = "_groupCount_1fs8c_1140", Bs = "_continued_1fs8c_1154", Vs = "_spanSelect_1fs8c_1185", Ps = "_treeCell_1fs8c_1201", Is = "_treeText_1fs8c_1209", $s = "_foldSlot_1fs8c_1213", zs = "_treeRow_1fs8c_1223", Ks = "_branchRow_1fs8c_1227", Gs = "_detailCell_1fs8c_1239", js = "_pathRow_1fs8c_1245", Hs = "_fold_1fs8c_1213", Ws = "_foldClosed_1fs8c_1286", qs = "_foldedCount_1fs8c_1296", Ys = "_shareHost_1fs8c_1304", Us = "_shareBar_1fs8c_1311", Js = "_expander_1fs8c_1323", Xs = "_expanderOpen_1fs8c_1358", Qs = "_detailRow_1fs8c_1362", Zs = "_treeDetail_1fs8c_1371", ei = "_treeDetailRail_1fs8c_1376", ti = "_actionsCell_1fs8c_1391", ni = "_actions_1fs8c_1391", oi = "_decision_1fs8c_1410", ri = "_reserve_1fs8c_1429", si = "_grip_1fs8c_1439", ii = "_virtualBody_1fs8c_1480", li = "_virtualRow_1fs8c_1496", ai = "_fillerRow_1fs8c_1520", ci = "_grid_1fs8c_1533", di = "_editing_1fs8c_1549", ui = "_editingValue_1fs8c_1553", fi = "_editor_1fs8c_1559", hi = "_editorField_1fs8c_1572", gi = "_draftButtons_1fs8c_1604", pi = "_held_1fs8c_1612", mi = "_deleteAsk_1fs8c_1616", wi = "_newRowBar_1fs8c_1623", bi = "_draftMessage_1fs8c_1630", vi = "_editorMessage_1fs8c_1655", yi = "_control_1fs8c_304", _i = "_empty_1fs8c_498", ki = "_toned_1fs8c_1416", h = {
544
- frame: dr,
545
- children: ur,
546
- scroll: fr,
547
- footerTarget: hr,
548
- table: gr,
549
- th: pr,
550
- sticky: mr,
551
- td: wr,
552
- rowHeader: br,
553
- compact: vr,
554
- numeric: yr,
555
- value: _r,
546
+ const ur = "_frame_1lxch_11 _text_18806_22", fr = "_children_1lxch_24", hr = "_scroll_1lxch_33 _scroll_18806_96", gr = "_footerTarget_1lxch_62", pr = "_table_1lxch_76", mr = "_th_1lxch_88 _ring_18806_125", wr = "_sticky_1lxch_108", br = "_td_1lxch_128", vr = "_rowHeader_1lxch_142", yr = "_compact_1lxch_163 _dense_18806_38", _r = "_numeric_1lxch_194", xr = "_value_1lxch_214", kr = "_valueText_1lxch_224", Sr = "_sized_1lxch_228", Cr = "_cutTip_1lxch_245 _text_18806_22", Ar = "_absent_1lxch_287", Nr = "_striped_1lxch_291", Tr = "_pinned_1lxch_316", Rr = "_pinStartEdge_1lxch_332", Or = "_pinEndEdge_1lxch_333", Er = "_sortButton_1lxch_363 _ring_18806_125", Mr = "_sortIndicator_1lxch_388", Lr = "_sortArrow_1lxch_395", Fr = "_sortArrowDesc_1lxch_399", Br = "_sortActive_1lxch_407", Dr = "_sortRank_1lxch_413", Pr = "_thFlex_1lxch_421", Vr = "_headLine_1lxch_441", Ir = "_headLabel_1lxch_464", $r = "_footerKind_1lxch_480", zr = "_emptyCell_1lxch_498", Kr = "_emptyTitle_1lxch_520", Gr = "_skeleton_1lxch_529", jr = "_toolbar_1lxch_561 _text_18806_22", Hr = "_toolbarGroup_1lxch_577", Wr = "_toolbarGroupIdle_1lxch_593", qr = "_searchGrow_1lxch_600", Yr = "_toolbarMd_1lxch_610", Ur = "_toolbarInfo_1lxch_614", Jr = "_pagination_1lxch_620 _text_18806_22", Xr = "_paginationControls_1lxch_633", Qr = "_pageSize_1lxch_640", Zr = "_pageSteps_1lxch_648", es = "_paginationStatus_1lxch_654", ts = "_filterButton_1lxch_663 _ring_18806_125", ns = "_filterActive_1lxch_690", os = "_filterPanel_1lxch_695", rs = "_filterContent_1lxch_709 _scroll_18806_96", ss = "_filterFooter_1lxch_720", is = "_filterLabel_1lxch_734", ls = "_filterValue_1lxch_744", as = "_filteredCount_1lxch_750", cs = "_rangeFields_1lxch_761", ds = "_rangePeriod_1lxch_771", us = "_conditions_1lxch_777", fs = "_conditionButton_1lxch_783", hs = "_condition_1lxch_777", gs = "_columnsPanel_1lxch_808", ps = "_columnsList_1lxch_817", ms = "_columnsEntry_1lxch_826", ws = "_move_1lxch_838", bs = "_pinOn_1lxch_876", vs = "_groupingChoice_1lxch_886", ys = "_groupingHeading_1lxch_894", _s = "_groupingOptions_1lxch_903", xs = "_groupingOption_1lxch_903 _ring_18806_125", ks = "_groupingLevel_1lxch_946", Ss = "_groupingTag_1lxch_951", Cs = "_groupingTrigger_1lxch_958", As = "_groupingPrefix_1lxch_964", Ns = "_groupingPath_1lxch_969", Ts = "_groupingSeparator_1lxch_973", Rs = "_groupHeader_1lxch_990", Os = "_spanCell_1lxch_1033", Es = "_groupFolded_1lxch_1114", Ms = "_spanValue_1lxch_1118", Ls = "_groupLabel_1lxch_1119", Fs = "_spanText_1lxch_1132", Bs = "_groupValue_1lxch_1133", Ds = "_groupCount_1lxch_1140", Ps = "_continued_1lxch_1154", Vs = "_spanSelect_1lxch_1185", Is = "_treeCell_1lxch_1201", $s = "_treeText_1lxch_1209", zs = "_foldSlot_1lxch_1213", Ks = "_treeRow_1lxch_1223", Gs = "_branchRow_1lxch_1227", js = "_detailCell_1lxch_1239", Hs = "_pathRow_1lxch_1245", Ws = "_fold_1lxch_1213", qs = "_foldClosed_1lxch_1286", Ys = "_foldedCount_1lxch_1296", Us = "_shareHost_1lxch_1304", Js = "_shareBar_1lxch_1311", Xs = "_expander_1lxch_1323", Qs = "_expanderOpen_1lxch_1358", Zs = "_detailRow_1lxch_1362", ei = "_treeDetail_1lxch_1371", ti = "_treeDetailRail_1lxch_1376", ni = "_actionsCell_1lxch_1391", oi = "_actions_1lxch_1391", ri = "_decision_1lxch_1410", si = "_reserve_1lxch_1429", ii = "_grip_1lxch_1439", li = "_virtualBody_1lxch_1480", ai = "_virtualRow_1lxch_1496", ci = "_fillerRow_1lxch_1520", di = "_grid_1lxch_1533", ui = "_editing_1lxch_1549", fi = "_editingValue_1lxch_1553", hi = "_editor_1lxch_1559", gi = "_editorField_1lxch_1572", pi = "_draftButtons_1lxch_1604", mi = "_held_1lxch_1612", wi = "_deleteAsk_1lxch_1616", bi = "_newRowBar_1lxch_1623", vi = "_draftMessage_1lxch_1630", yi = "_editorMessage_1lxch_1655", _i = "_control_1lxch_304", xi = "_empty_1lxch_498", ki = "_toned_1lxch_1416", h = {
547
+ frame: ur,
548
+ children: fr,
549
+ scroll: hr,
550
+ footerTarget: gr,
551
+ table: pr,
552
+ th: mr,
553
+ sticky: wr,
554
+ td: br,
555
+ rowHeader: vr,
556
+ compact: yr,
557
+ numeric: _r,
558
+ value: xr,
556
559
  valueText: kr,
557
560
  sized: Sr,
558
561
  cutTip: Cr,
559
- absent: xr,
560
- striped: Ar,
561
- pinned: Nr,
562
- pinStartEdge: Tr,
563
- pinEndEdge: Rr,
564
- sortButton: Or,
565
- sortIndicator: Er,
566
- sortArrow: Mr,
567
- sortArrowDesc: Lr,
568
- sortActive: Fr,
562
+ absent: Ar,
563
+ striped: Nr,
564
+ pinned: Tr,
565
+ pinStartEdge: Rr,
566
+ pinEndEdge: Or,
567
+ sortButton: Er,
568
+ sortIndicator: Mr,
569
+ sortArrow: Lr,
570
+ sortArrowDesc: Fr,
571
+ sortActive: Br,
569
572
  sortRank: Dr,
570
- thFlex: Br,
573
+ thFlex: Pr,
571
574
  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
- toolbarInfo: Yr,
583
- pagination: Ur,
584
- paginationControls: Jr,
585
- pageSize: Xr,
586
- pageSteps: Qr,
587
- paginationStatus: Zr,
588
- filterButton: es,
589
- filterActive: ts,
590
- filterPanel: ns,
591
- filterContent: os,
592
- filterFooter: rs,
593
- filterLabel: ss,
594
- filterValue: is,
595
- filteredCount: ls,
596
- rangeFields: as,
597
- rangePeriod: cs,
598
- conditions: ds,
599
- conditionButton: us,
600
- condition: fs,
601
- columnsPanel: hs,
602
- columnsList: gs,
603
- columnsEntry: ps,
604
- move: ms,
605
- pinOn: ws,
606
- groupingChoice: bs,
607
- groupingHeading: vs,
608
- groupingOptions: ys,
609
- groupingOption: _s,
575
+ headLabel: Ir,
576
+ footerKind: $r,
577
+ emptyCell: zr,
578
+ emptyTitle: Kr,
579
+ skeleton: Gr,
580
+ toolbar: jr,
581
+ toolbarGroup: Hr,
582
+ toolbarGroupIdle: Wr,
583
+ searchGrow: qr,
584
+ toolbarMd: Yr,
585
+ toolbarInfo: Ur,
586
+ pagination: Jr,
587
+ paginationControls: Xr,
588
+ pageSize: Qr,
589
+ pageSteps: Zr,
590
+ paginationStatus: es,
591
+ filterButton: ts,
592
+ filterActive: ns,
593
+ filterPanel: os,
594
+ filterContent: rs,
595
+ filterFooter: ss,
596
+ filterLabel: is,
597
+ filterValue: ls,
598
+ filteredCount: as,
599
+ rangeFields: cs,
600
+ rangePeriod: ds,
601
+ conditions: us,
602
+ conditionButton: fs,
603
+ condition: hs,
604
+ columnsPanel: gs,
605
+ columnsList: ps,
606
+ columnsEntry: ms,
607
+ move: ws,
608
+ pinOn: bs,
609
+ groupingChoice: vs,
610
+ groupingHeading: ys,
611
+ groupingOptions: _s,
612
+ groupingOption: xs,
610
613
  groupingLevel: ks,
611
614
  groupingTag: Ss,
612
615
  groupingTrigger: Cs,
613
- groupingPrefix: xs,
614
- groupingPath: As,
615
- groupingSeparator: Ns,
616
- groupHeader: Ts,
617
- spanCell: Rs,
618
- groupFolded: Os,
619
- spanValue: Es,
620
- groupLabel: Ms,
621
- spanText: Ls,
622
- groupValue: Fs,
616
+ groupingPrefix: As,
617
+ groupingPath: Ns,
618
+ groupingSeparator: Ts,
619
+ groupHeader: Rs,
620
+ spanCell: Os,
621
+ groupFolded: Es,
622
+ spanValue: Ms,
623
+ groupLabel: Ls,
624
+ spanText: Fs,
625
+ groupValue: Bs,
623
626
  groupCount: Ds,
624
- continued: Bs,
627
+ continued: Ps,
625
628
  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
- shareHost: Ys,
637
- shareBar: Us,
638
- expander: Js,
639
- expanderOpen: Xs,
640
- detailRow: Qs,
641
- treeDetail: Zs,
642
- treeDetailRail: ei,
643
- actionsCell: ti,
644
- actions: ni,
645
- decision: oi,
646
- reserve: ri,
647
- grip: si,
648
- virtualBody: ii,
649
- virtualRow: li,
650
- fillerRow: ai,
651
- grid: ci,
652
- editing: di,
653
- editingValue: ui,
654
- editor: fi,
655
- editorField: hi,
656
- draftButtons: gi,
657
- held: pi,
658
- deleteAsk: mi,
659
- newRowBar: wi,
660
- draftMessage: bi,
661
- editorMessage: vi,
662
- control: yi,
663
- empty: _i,
629
+ treeCell: Is,
630
+ treeText: $s,
631
+ foldSlot: zs,
632
+ treeRow: Ks,
633
+ branchRow: Gs,
634
+ detailCell: js,
635
+ pathRow: Hs,
636
+ fold: Ws,
637
+ foldClosed: qs,
638
+ foldedCount: Ys,
639
+ shareHost: Us,
640
+ shareBar: Js,
641
+ expander: Xs,
642
+ expanderOpen: Qs,
643
+ detailRow: Zs,
644
+ treeDetail: ei,
645
+ treeDetailRail: ti,
646
+ actionsCell: ni,
647
+ actions: oi,
648
+ decision: ri,
649
+ reserve: si,
650
+ grip: ii,
651
+ virtualBody: li,
652
+ virtualRow: ai,
653
+ fillerRow: ci,
654
+ grid: di,
655
+ editing: ui,
656
+ editingValue: fi,
657
+ editor: hi,
658
+ editorField: gi,
659
+ draftButtons: pi,
660
+ held: mi,
661
+ deleteAsk: wi,
662
+ newRowBar: bi,
663
+ draftMessage: vi,
664
+ editorMessage: yi,
665
+ control: _i,
666
+ empty: xi,
664
667
  toned: ki
665
668
  };
666
- function Pa(e) {
669
+ function Ia(e) {
667
670
  return e;
668
671
  }
669
672
  const qe = /* @__PURE__ */ new WeakMap();
@@ -672,7 +675,7 @@ function Gn(e, t) {
672
675
  }
673
676
  const Si = (e) => qe.has(e);
674
677
  function Ee(e) {
675
- return e === "list" ? Ni : e === "range" ? Di : typeof e == "object" && e !== null ? e : void 0;
678
+ return e === "list" ? Ti : e === "range" ? Di : typeof e == "object" && e !== null ? e : void 0;
676
679
  }
677
680
  function jn(e, t) {
678
681
  if (t == null) return "empty";
@@ -682,7 +685,7 @@ function jn(e, t) {
682
685
  function Ci(e, t, n) {
683
686
  return se(t) ? qe.get(e)?.absentMatches(n) ?? !1 : e.matches(t, n);
684
687
  }
685
- function xi(e, t, n) {
688
+ function Ai(e, t, n) {
686
689
  const o = qe.get(e);
687
690
  return o ? o.describeIn(t, n) : e.describe(t);
688
691
  }
@@ -707,23 +710,23 @@ function At(e, t, n) {
707
710
  const cn = /* @__PURE__ */ new WeakMap();
708
711
  function Nt(e) {
709
712
  let t = cn.get(e);
710
- return t || (t = new Set(e.map(Ce)), cn.set(e, t)), t;
713
+ return t || (t = new Set(e.map(Se)), cn.set(e, t)), t;
711
714
  }
712
- const Tt = (e, t) => se(e) ? t.wording.cellAbsentValue : Ve(e, t.format, t.formats, t.wording) ?? String(e);
713
- function Ai({
715
+ const Tt = (e, t) => se(e) ? t.wording.cellAbsentValue : Pe(e, t.format, t.formats, t.wording) ?? String(e);
716
+ function Ni({
714
717
  condition: e,
715
718
  setCondition: t,
716
719
  values: n,
717
720
  absentOccurs: o = !1,
718
721
  format: r
719
722
  }) {
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 }));
723
+ const s = xe(), i = ie(), l = H(() => e ?? [], [e]), c = H(() => {
724
+ const d = { formats: s, wording: i, format: r }, b = n.map((g) => ({ key: Se(g), text: Tt(g, d), value: g }));
722
725
  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 }] : [];
726
+ const p = new Set(b.map((g) => g.key)), m = l.filter((g) => !se(g) && !p.has(Se(g))).map((g) => ({ key: Se(g), text: Tt(g, d), value: g })), w = o || l.some(se) ? [{ key: $t, text: i.cellAbsentValue, value: null }] : [];
724
727
  return [...b, ...m, ...w];
725
728
  }, [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];
729
+ const b = a.has(d.key) ? l.filter((p) => Se(p) !== d.key) : [...l, d.value];
727
730
  t(b.length > 0 ? b : null);
728
731
  };
729
732
  return /* @__PURE__ */ f("div", { className: h.filterContent, children: c.map((d) => /* @__PURE__ */ f(
@@ -736,10 +739,10 @@ function Ai({
736
739
  d.key
737
740
  )) });
738
741
  }
739
- const Ni = /* @__PURE__ */ Gn(
742
+ const Ti = /* @__PURE__ */ Gn(
740
743
  {
741
- matches: (e, t) => Nt(t).has(Ce(e)),
742
- Input: Ai,
744
+ matches: (e, t) => Nt(t).has(Se(e)),
745
+ Input: Ni,
743
746
  describe: (e) => e.map((t) => se(t) ? "–" : String(t)).join(", ")
744
747
  },
745
748
  {
@@ -755,9 +758,9 @@ const Ni = /* @__PURE__ */ Gn(
755
758
  return `${n.slice(0, 2).join(", ")} ${t.wording.moreValues(o, t.formats.count(o))}`;
756
759
  }
757
760
  }
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
- function Mi({ condition: e, setCondition: t }) {
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
+ ), Ri = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()).getTime(), Oi = (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()), Ei = (e) => ye(e) ? Ri(e) : De(e) ? e : void 0, Mi = (e) => ye(e) ? { value: Oi(e), open: !0 } : De(e) ? { value: e, open: !1 } : void 0, Qe = (e, t) => ye(e) ? t.formats.date(e) : Pe(e, t.format, t.formats, t.wording) ?? String(e);
762
+ function Li({ condition: e, setCondition: t }) {
763
+ const n = ie(), [o, r] = I(null), s = o !== null, i = o ? o.from : De(e?.from) ? e.from : null, l = o ? o.to : De(e?.to) ? e.to : null, c = (a, u) => {
761
764
  const d = { from: i, to: l, [a]: u };
762
765
  if (d.from !== null && d.to !== null && d.from > d.to) {
763
766
  r(d);
@@ -777,10 +780,10 @@ function Mi({ condition: e, setCondition: t }) {
777
780
  /* @__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
781
  ] });
779
782
  }
780
- function Li({ condition: e, setCondition: t }) {
783
+ function Fi({ condition: e, setCondition: t }) {
781
784
  const n = ye(e?.from) && ye(e?.to) ? { from: e.from, to: e.to } : null;
782
785
  return /* @__PURE__ */ f("div", { className: h.rangePeriod, children: /* @__PURE__ */ f(
783
- Oo,
786
+ Eo,
784
787
  {
785
788
  size: "sm",
786
789
  clearable: !0,
@@ -789,23 +792,23 @@ function Li({ condition: e, setCondition: t }) {
789
792
  }
790
793
  ) });
791
794
  }
792
- function Fi(e) {
793
- return e.kind === "date" ? /* @__PURE__ */ f(Li, { ...e }) : /* @__PURE__ */ f(Mi, { ...e });
795
+ function Bi(e) {
796
+ return e.kind === "date" ? /* @__PURE__ */ f(Fi, { ...e }) : /* @__PURE__ */ f(Li, { ...e });
794
797
  }
795
798
  const Di = /* @__PURE__ */ Gn(
796
799
  {
797
800
  matches: (e, t) => {
798
- const n = ye(e) ? e.getTime() : Be(e) ? e : void 0;
801
+ const n = ye(e) ? e.getTime() : De(e) ? e : void 0;
799
802
  if (n === void 0) return !1;
800
- const o = Oi(t.from), r = Ei(t.to);
803
+ const o = Ei(t.from), r = Mi(t.to);
801
804
  return !(o !== void 0 && n < o || r !== void 0 && (r.open ? n >= r.value : n > r.value));
802
805
  },
803
- Input: Fi,
806
+ Input: Bi,
804
807
  describe: (e) => [e.from, e.to].map((t) => t === void 0 ? "" : String(t)).join("–")
805
808
  },
806
809
  {
807
810
  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 || Be(o) || ye(o))
811
+ ([n, o]) => (n === "from" || n === "to") && (o === void 0 || De(o) || ye(o))
809
812
  ),
810
813
  isEmpty: (e) => e.from === void 0 && e.to === void 0,
811
814
  absentMatches: () => !1,
@@ -875,13 +878,13 @@ const dn = (e) => JSON.stringify([
875
878
  /* Whether a column edits, and how - not its editor or its check, which
876
879
  are new functions on every render and are read when an edit starts. */
877
880
  typeof e.edit == "function" ? "ƒ" : e.edit
878
- ]), Bi = (e, t) => e?.[t], un = (e, t) => {
881
+ ]), Pi = (e, t) => e?.[t], un = (e, t) => {
879
882
  const n = {
880
883
  key: e,
881
884
  spec: t,
882
885
  read: (o) => {
883
886
  const r = n.spec.value;
884
- return typeof r == "string" ? Bi(o, r) : r(o);
887
+ return typeof r == "string" ? Pi(o, r) : r(o);
885
888
  }
886
889
  };
887
890
  return n;
@@ -987,7 +990,7 @@ class Vi {
987
990
  }
988
991
  /** What the columns of this pass declare. */
989
992
  declaredPins() {
990
- return Zo(
993
+ return er(
991
994
  this.orderedColumns().map((t) => ({ id: t.spec.id, pin: t.spec.pin })),
992
995
  this.stickyRowHeader ? this.rowHeader()?.spec.id : void 0
993
996
  );
@@ -999,7 +1002,7 @@ class Vi {
999
1002
  /** The columns with the pinned blocks at either end - the one place where
1000
1003
  that is decided, for screen, column menu and export. */
1001
1004
  inPinOrder(t) {
1002
- return Qo(t, this.pins());
1005
+ return Zo(t, this.pins());
1003
1006
  }
1004
1007
  /** The columns in JSX order, the first one per id. */
1005
1008
  orderedColumns() {
@@ -1095,10 +1098,10 @@ class Vi {
1095
1098
  const a = l.read(c);
1096
1099
  if (a == null) return;
1097
1100
  const { ownGroupValue: u, group: d } = l.spec;
1098
- return u ? u(a) : d ? Ho(d)(a) : a;
1101
+ return u ? u(a) : d ? Wo(d)(a) : a;
1099
1102
  },
1100
1103
  /* A value of one's own is a name; its groups stand by what they hold. */
1101
- order: l.spec.ownGroupValue ? (c) => kt(l.read(c), l.spec.ownSortValue) : void 0
1104
+ order: l.spec.ownGroupValue ? (c) => xt(l.read(c), l.spec.ownSortValue) : void 0
1102
1105
  })), i = this.orderedColumns().filter((l) => l.spec.aggregate !== void 0).map(
1103
1106
  (l) => ({
1104
1107
  id: l.spec.id,
@@ -1144,7 +1147,7 @@ class Vi {
1144
1147
  if (this.modelCache?.key === r && this.modelCache.rows === t && this.modelCache.formats === n)
1145
1148
  return this.modelCache.columns;
1146
1149
  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);
1150
+ const { spec: l } = i, c = this.kindOf(i, t), a = this.isSortable(i, t), u = l.searchable ?? c === "text", d = (b) => xt(i.read(b), l.ownSortValue);
1148
1151
  return {
1149
1152
  id: l.id,
1150
1153
  label: l.label,
@@ -1277,33 +1280,33 @@ class Vi {
1277
1280
  this.actions.entries.delete(t) && this.structure++;
1278
1281
  }
1279
1282
  }
1280
- const Wn = /* @__PURE__ */ new WeakMap(), Pi = (e, t) => {
1283
+ const Wn = /* @__PURE__ */ new WeakMap(), Ii = (e, t) => {
1281
1284
  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
- const o = t.value?.(e);
1285
- return o == null ? "" : Un(Yn(o, n), n.separator);
1286
- }, Jn = (e, t, n) => [
1287
- t.map((o) => Un(o.label ?? o.id, n.separator)).join(n.separator),
1288
- ...e.map((o) => t.map((r) => Ki(o, r, n)).join(n.separator))
1285
+ }, $i = (e) => typeof e == "function" || typeof e == "object" && e !== null ? Wn.get(e) : void 0, B = (...e) => e.filter(Boolean).join(" "), qn = { separator: ",", decimal: ".", yes: "yes", no: "no" }, zi = `\r
1286
+ `, Ki = "\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, Jn = (e, t) => t && /^[=+\-@\t\r]/.test(e) ? `'${e}` : e, Gi = (e, t, n, o) => {
1287
+ const r = t.value?.(e);
1288
+ return r == null ? "" : Un(typeof r == "string" ? Jn(r, o) : Yn(r, n), n.separator);
1289
+ }, Xn = (e, t, n, o) => [
1290
+ t.map((r) => Un(Jn(r.label ?? r.id, o), n.separator)).join(n.separator),
1291
+ ...e.map((r) => t.map((s) => Gi(r, s, n, o)).join(n.separator))
1289
1292
  ];
1290
1293
  function hn(e, t, n = qn) {
1291
- return zi + Jn(e, t, n).join($i);
1294
+ return Ki + Xn(e, t, n, !0).join(zi);
1292
1295
  }
1293
- function Gi(e, t, n = qn) {
1294
- return Jn(e, t, { ...n, separator: " " }).join(`
1296
+ function ji(e, t, n = qn) {
1297
+ return Xn(e, t, { ...n, separator: " " }, !1).join(`
1295
1298
  `);
1296
1299
  }
1297
- function Xn(e) {
1300
+ function Qn(e) {
1298
1301
  const t = new Map(e.orderedColumns().map((o) => [o.spec.id, o])), n = e.projection().columns.map((o) => t.get(o.id)).filter((o) => o !== void 0);
1299
1302
  return e.inPinOrder(n.map((o) => ({ id: o.spec.id, e: o }))).map(({ e: o }) => o);
1300
1303
  }
1301
- function Qn(e) {
1304
+ function Zn(e) {
1302
1305
  e.setSearch("");
1303
1306
  for (const t of Object.keys(e.filter)) e.setFilter(t, null);
1304
1307
  }
1305
1308
  function jt(e, t) {
1306
- const { decimal: n } = Eo(e);
1309
+ const { decimal: n } = Mo(e);
1307
1310
  return {
1308
1311
  separator: n === "," ? ";" : ",",
1309
1312
  decimal: n,
@@ -1311,8 +1314,8 @@ function jt(e, t) {
1311
1314
  no: t.booleanNo.toLocaleLowerCase()
1312
1315
  };
1313
1316
  }
1314
- function Zn(e, t) {
1315
- return Xn(e).filter((n) => e.kindOf(n, t) !== "other" || n.spec.ownExportValue).map(
1317
+ function eo(e, t) {
1318
+ return Qn(e).filter((n) => e.kindOf(n, t) !== "other" || n.spec.ownExportValue).map(
1316
1319
  (n) => ({
1317
1320
  id: n.spec.id,
1318
1321
  label: n.spec.label,
@@ -1320,32 +1323,32 @@ function Zn(e, t) {
1320
1323
  })
1321
1324
  );
1322
1325
  }
1323
- function ji(e, t, n, o) {
1326
+ function Hi(e, t, n, o) {
1324
1327
  const r = e.hook;
1325
1328
  if (!r) return "";
1326
- const s = Zn(e, r.rows), i = jt(n, o), { exported: l, filtered: c } = e.projection();
1329
+ const s = eo(e, r.rows), i = jt(n, o), { exported: l, filtered: c } = e.projection();
1327
1330
  if (!l) return hn(c, s, i);
1328
1331
  const a = new Map(l.map((d) => [d.node, d.level + 1])), u = { id: "#level", label: t, value: (d) => a.get(d) };
1329
1332
  return hn(l.map((d) => d.node), [u, ...s], i);
1330
1333
  }
1331
- function eo(e) {
1334
+ function to(e) {
1332
1335
  const t = e.hook;
1333
1336
  if (!t) return [];
1334
1337
  const { exported: n, filtered: o } = e.projection(), r = n ? n.map((s) => s.node) : o;
1335
1338
  return t.selectedRows ?? r.filter((s) => t.publicSnapshot.selection.isSelected(t.rowKey(s)));
1336
1339
  }
1337
- function to(e, t, n) {
1338
- const o = e.hook, r = eo(e);
1339
- return !o || r.length === 0 ? "" : Gi(r, Zn(e, o.rows), jt(t, n));
1340
+ function no(e, t, n) {
1341
+ const o = e.hook, r = to(e);
1342
+ return !o || r.length === 0 ? "" : ji(r, eo(e, o.rows), jt(t, n));
1340
1343
  }
1341
- function Hi(e, t, n, o) {
1342
- return no(e, e.read(t), n, o);
1344
+ function Wi(e, t, n, o) {
1345
+ return oo(e, e.read(t), n, o);
1343
1346
  }
1344
- function no(e, t, n, o) {
1347
+ function oo(e, t, n, o) {
1345
1348
  const r = It(t, e.spec.ownExportValue);
1346
1349
  return r === void 0 ? "" : Yn(r, jt(n, o));
1347
1350
  }
1348
- function oo({
1351
+ function ro({
1349
1352
  entry: e,
1350
1353
  registry: t,
1351
1354
  hook: n,
@@ -1356,15 +1359,15 @@ function oo({
1356
1359
  setOpen: l,
1357
1360
  panelId: c
1358
1361
  }) {
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(
1362
+ const a = ie(), u = xe(), { id: d, label: b, format: p } = e.spec, { filterOptions: m } = n, w = m?.(d), { values: g, absent: v } = H(
1360
1363
  () => w ? At(w, (A) => A, u) : At(n.admitted, e.read, u),
1361
1364
  [w, n.admitted, e, u]
1362
- ), x = Ee(e.spec.filter);
1365
+ ), C = Ee(e.spec.filter);
1363
1366
  if (n.publicSnapshot.server && !w && e.spec.filter === "list" && X(
1364
1367
  `server-filter-options:${d}`,
1365
1368
  `The list filter of "${d}" offers only the values of the page in server mode; \`filterOptions\` gives it the server's.`
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 = () => {
1369
+ ), !C) return null;
1370
+ const y = n.publicSnapshot, _ = C.Input, k = Si(C) ? { absentOccurs: v, format: p, kind: t.kindOf(e, n.rows) } : {}, S = () => {
1368
1371
  l(!1), (s ?? o).current?.focus();
1369
1372
  };
1370
1373
  return /* @__PURE__ */ T(
@@ -1386,18 +1389,18 @@ function oo({
1386
1389
  setCondition: (A) => y.setFilter(d, A),
1387
1390
  values: g,
1388
1391
  column: { id: d, label: b },
1389
- ...S
1392
+ ...k
1390
1393
  }
1391
1394
  ),
1392
1395
  /* @__PURE__ */ T("div", { className: h.filterFooter, children: [
1393
1396
  /* @__PURE__ */ f(Q, { size: "sm", variant: "ghost", onClick: () => y.setFilter(d, null), children: a.filterReset }),
1394
- /* @__PURE__ */ f(Q, { size: "sm", onClick: C, children: a.filterDone })
1397
+ /* @__PURE__ */ f(Q, { size: "sm", onClick: S, children: a.filterDone })
1395
1398
  ] })
1396
1399
  ]
1397
1400
  }
1398
1401
  );
1399
1402
  }
1400
- function Wi({
1403
+ function qi({
1401
1404
  entry: e,
1402
1405
  registry: t,
1403
1406
  hook: n
@@ -1408,7 +1411,7 @@ function Wi({
1408
1411
  "button",
1409
1412
  {
1410
1413
  type: "button",
1411
- className: D(h.filterButton, u && h.filterActive),
1414
+ className: B(h.filterButton, u && h.filterActive),
1412
1415
  "aria-label": o.filterColumn(a),
1413
1416
  "aria-haspopup": "dialog",
1414
1417
  "aria-expanded": r,
@@ -1430,7 +1433,7 @@ function Wi({
1430
1433
  }
1431
1434
  ) }),
1432
1435
  /* @__PURE__ */ f(
1433
- oo,
1436
+ ro,
1434
1437
  {
1435
1438
  entry: e,
1436
1439
  registry: t,
@@ -1444,18 +1447,18 @@ function Wi({
1444
1447
  )
1445
1448
  ] });
1446
1449
  }
1447
- function qi({ registry: e, hook: t }) {
1448
- const n = ie(), o = ke(), r = Object.entries(t.publicSnapshot.filter).flatMap(([s, i]) => {
1450
+ function Yi({ registry: e, hook: t }) {
1451
+ const n = ie(), o = xe(), r = Object.entries(t.publicSnapshot.filter).flatMap(([s, i]) => {
1449
1452
  const l = t.rowFilters.get(s);
1450
1453
  if (l) return l.describe ? [{ id: s, rowFilter: l, text: l.describe(i) }] : [];
1451
1454
  const c = e.columnById(s), a = c ? Ee(c.spec.filter) : void 0;
1452
1455
  if (!c || !a) return [];
1453
1456
  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, i, u) }];
1457
+ return [{ id: s, entry: c, text: Ai(a, i, u) }];
1455
1458
  });
1456
1459
  return r.length === 0 ? null : /* @__PURE__ */ f(An, { "aria-label": n.conditions, className: h.conditions, children: r.map(
1457
1460
  (s) => "rowFilter" in s ? /* @__PURE__ */ T(
1458
- Vt,
1461
+ Pt,
1459
1462
  {
1460
1463
  className: h.condition,
1461
1464
  onRemove: () => t.publicSnapshot.setFilter(s.id, null),
@@ -1466,10 +1469,10 @@ function qi({ registry: e, hook: t }) {
1466
1469
  ]
1467
1470
  },
1468
1471
  s.id
1469
- ) : /* @__PURE__ */ f(Yi, { entry: s.entry, text: s.text, registry: e, hook: t }, s.id)
1472
+ ) : /* @__PURE__ */ f(Ui, { entry: s.entry, text: s.text, registry: e, hook: t }, s.id)
1470
1473
  ) });
1471
1474
  }
1472
- function Yi({
1475
+ function Ui({
1473
1476
  entry: e,
1474
1477
  text: t,
1475
1478
  registry: n,
@@ -1478,7 +1481,7 @@ function Yi({
1478
1481
  const r = ie(), [s, i] = I(!1), l = q(null), c = q(null), a = be(), { id: u, label: d } = e.spec;
1479
1482
  return /* @__PURE__ */ T(re, { children: [
1480
1483
  /* @__PURE__ */ f(
1481
- Vt,
1484
+ Pt,
1482
1485
  {
1483
1486
  ref: l,
1484
1487
  className: h.condition,
@@ -1504,7 +1507,7 @@ function Yi({
1504
1507
  }
1505
1508
  ),
1506
1509
  /* @__PURE__ */ f(
1507
- oo,
1510
+ ro,
1508
1511
  {
1509
1512
  entry: e,
1510
1513
  registry: n,
@@ -1519,8 +1522,8 @@ function Yi({
1519
1522
  )
1520
1523
  ] });
1521
1524
  }
1522
- const Ui = (e, t, n) => e.groupingEntries(t.rows).find((o) => o.spec.id === n)?.spec.label ?? n;
1523
- function Ji({ registry: e, hook: t }) {
1525
+ const Ji = (e, t, n) => e.groupingEntries(t.rows).find((o) => o.spec.id === n)?.spec.label ?? n;
1526
+ function Xi({ registry: e, hook: t }) {
1524
1527
  const n = ie(), o = e.groupingEntries(t.rows);
1525
1528
  if (o.length === 0) return null;
1526
1529
  const { grouping: r, setGrouping: s } = t.publicSnapshot;
@@ -1547,26 +1550,26 @@ function Ji({ registry: e, hook: t }) {
1547
1550
  }) })
1548
1551
  ] });
1549
1552
  }
1550
- function Xi({ registry: e, hook: t }) {
1553
+ function Qi({ registry: e, hook: t }) {
1551
1554
  const n = ie();
1552
1555
  if (!e.tree) return null;
1553
1556
  const o = t.publicSnapshot;
1554
- return /* @__PURE__ */ T("div", { className: D(h.groupingChoice, h.groupingOptions), children: [
1557
+ return /* @__PURE__ */ T("div", { className: B(h.groupingChoice, h.groupingOptions), children: [
1555
1558
  /* @__PURE__ */ f("button", { type: "button", className: h.groupingOption, onClick: o.unfoldAllBranches, children: n.unfoldAll }),
1556
1559
  /* @__PURE__ */ f("button", { type: "button", className: h.groupingOption, onClick: o.foldAllBranches, children: n.foldAll })
1557
1560
  ] });
1558
1561
  }
1559
- function Qi({ registry: e, hook: t }) {
1562
+ function Zi({ registry: e, hook: t }) {
1560
1563
  const n = ie(), o = t.publicSnapshot, { grouping: r } = o;
1561
1564
  if (r.length === 0) return null;
1562
- const s = r.map((i) => Ui(e, t, i));
1565
+ const s = r.map((i) => Ji(e, t, i));
1563
1566
  return (
1564
1567
  /* In a tag group, as the conditions stand: the tag is one stop, its button
1565
1568
  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(Vt, { onRemove: () => o.setGrouping([]), removeLabel: n.removeGrouping, children: /* @__PURE__ */ T(
1569
+ /* @__PURE__ */ f(An, { "aria-label": n.groupedBy, className: h.groupingTag, children: /* @__PURE__ */ f(Pt, { onRemove: () => o.setGrouping([]), removeLabel: n.removeGrouping, children: /* @__PURE__ */ T(
1567
1570
  Nn,
1568
1571
  {
1569
- trigger: /* @__PURE__ */ T("button", { type: "button", className: D(h.conditionButton, h.groupingTrigger), children: [
1572
+ trigger: /* @__PURE__ */ T("button", { type: "button", className: B(h.conditionButton, h.groupingTrigger), children: [
1570
1573
  /* @__PURE__ */ f("span", { className: h.groupingPrefix, children: n.groupedBy }),
1571
1574
  s.map((i, l) => /* @__PURE__ */ T("span", { className: h.groupingPath, children: [
1572
1575
  l > 0 && /* @__PURE__ */ f("span", { className: h.groupingSeparator, "aria-hidden": "true", children: "›" }),
@@ -1575,7 +1578,7 @@ function Qi({ registry: e, hook: t }) {
1575
1578
  ] }),
1576
1579
  children: [
1577
1580
  r.map((i, l) => /* @__PURE__ */ f(nt, { onSelect: () => o.setGrouping(r.filter((c) => c !== i)), children: n.removeGroupingLevel(s[l]) }, i)),
1578
- /* @__PURE__ */ f(Mo, {}),
1581
+ /* @__PURE__ */ f(Lo, {}),
1579
1582
  /* @__PURE__ */ f(nt, { onSelect: o.unfoldAll, children: n.unfoldAll }),
1580
1583
  /* @__PURE__ */ f(nt, { onSelect: o.foldAll, children: n.foldAll })
1581
1584
  ]
@@ -1583,37 +1586,37 @@ function Qi({ registry: e, hook: t }) {
1583
1586
  ) }) })
1584
1587
  );
1585
1588
  }
1586
- const ro = /* @__PURE__ */ rt("sm");
1589
+ const so = /* @__PURE__ */ rt("sm");
1587
1590
  function at(e) {
1588
- const t = _e(ro);
1591
+ const t = _e(so);
1589
1592
  return e ?? t;
1590
1593
  }
1591
- function so({ registry: e }) {
1594
+ function io({ registry: e }) {
1592
1595
  const t = ie(), n = at();
1593
1596
  return /* @__PURE__ */ f(Q, { size: n, variant: "secondary", onClick: () => e.addRow?.(), children: t.newRow });
1594
1597
  }
1595
- function io({
1598
+ function lo({
1596
1599
  registry: e,
1597
1600
  className: t,
1598
1601
  children: n,
1599
1602
  own: o = !1,
1600
1603
  size: r = "sm"
1601
1604
  }) {
1602
- const s = ie(), i = ke(), l = e?.hook ?? null;
1605
+ const s = ie(), i = xe(), l = e?.hook ?? null;
1603
1606
  let c = null, a = null;
1604
1607
  if (e && l) {
1605
1608
  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
1609
  c = /* @__PURE__ */ T(re, { children: [
1607
- /* @__PURE__ */ f(Qi, { registry: e, hook: l }),
1608
- /* @__PURE__ */ f(qi, { registry: e, hook: l })
1610
+ /* @__PURE__ */ f(Zi, { registry: e, hook: l }),
1611
+ /* @__PURE__ */ f(Yi, { registry: e, hook: l })
1609
1612
  ] });
1610
1613
  const m = !d && b.length === 0 && !e.rowAdding;
1611
- a = /* @__PURE__ */ T("div", { className: D(h.toolbarGroup, m && h.toolbarGroupIdle), children: [
1614
+ a = /* @__PURE__ */ T("div", { className: B(h.toolbarGroup, m && h.toolbarGroupIdle), children: [
1612
1615
  /* @__PURE__ */ f("span", { role: "status", className: h.filteredCount, children: d ? u.server ? (
1613
1616
  /* The server counts the matches only; a total beside them would be a second request. */
1614
1617
  s.entries(u.rowCount, i.count(u.rowCount))
1615
1618
  ) : s.filteredOfTotal(i.count(u.filtered.length), i.count(l.tableState.total ?? l.admitted.length)) : "" }),
1616
- d && /* @__PURE__ */ f(Q, { size: r, variant: "ghost", onClick: () => Qn(u), children: s.resetAll }),
1619
+ d && /* @__PURE__ */ f(Q, { size: r, variant: "ghost", onClick: () => Zn(u), children: s.resetAll }),
1617
1620
  b.length > 0 && /* @__PURE__ */ T(re, { children: [
1618
1621
  /* @__PURE__ */ f("span", { className: h.toolbarInfo, children: s.selectedCount(b.length, i.count(b.length)) }),
1619
1622
  p.map(({ key: w, spec: g }) => /* @__PURE__ */ f(
@@ -1627,10 +1630,10 @@ function io({
1627
1630
  w
1628
1631
  ))
1629
1632
  ] }),
1630
- e.rowAdding && /* @__PURE__ */ f(so, { registry: e })
1633
+ e.rowAdding && /* @__PURE__ */ f(io, { registry: e })
1631
1634
  ] });
1632
1635
  }
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: [
1636
+ return /* @__PURE__ */ f(so, { value: r, children: /* @__PURE__ */ f(Tn, { size: r, children: /* @__PURE__ */ T("div", { className: B(h.toolbar, r === "md" && h.toolbarMd, t), children: [
1634
1637
  /* @__PURE__ */ T("div", { className: h.toolbarGroup, children: [
1635
1638
  n,
1636
1639
  c
@@ -1638,19 +1641,19 @@ function io({
1638
1641
  a
1639
1642
  ] }) }) });
1640
1643
  }
1641
- const Rt = /* @__PURE__ */ rt(null), Zi = () => () => {
1644
+ const Rt = /* @__PURE__ */ rt(null), el = () => () => {
1642
1645
  }, gn = () => 0;
1643
1646
  function Ye(e) {
1644
- const t = _e(Rt), n = e ? Ii(e.Table) ?? null : t?.registry ?? null;
1647
+ const t = _e(Rt), n = e ? $i(e.Table) ?? null : t?.registry ?? null;
1645
1648
  st(
1646
- n ? n.subscribe : Zi,
1649
+ n ? n.subscribe : el,
1647
1650
  n ? n.bodyVersion : gn,
1648
1651
  n ? n.bodyVersion : gn
1649
1652
  );
1650
1653
  const o = n?.hook?.publicSnapshot;
1651
1654
  return !n || !o ? null : { registry: n, snapshot: o, inside: !e && t !== null, footerTarget: e ? null : t?.footerTarget ?? null };
1652
1655
  }
1653
- function el(e, t) {
1656
+ function tl(e, t) {
1654
1657
  const n = /* @__PURE__ */ new Map();
1655
1658
  for (const [o, r] of t) {
1656
1659
  const s = e.get(o);
@@ -1658,38 +1661,38 @@ function el(e, t) {
1658
1661
  }
1659
1662
  return n;
1660
1663
  }
1661
- function lo(e, t) {
1664
+ function ao(e, t) {
1662
1665
  const n = getComputedStyle(e).getPropertyValue(t).trim(), o = Number.parseFloat(n);
1663
1666
  return Number.isFinite(o) ? n.endsWith("ms") ? o : o * 1e3 : 0;
1664
1667
  }
1665
- const tl = (e) => {
1668
+ const nl = (e) => {
1666
1669
  const t = /* @__PURE__ */ new Map(), n = e.getBoundingClientRect().top;
1667
1670
  for (const o of Array.from(e.querySelectorAll("tbody > tr[data-motion]")))
1668
1671
  t.set(o.dataset.motion, o.getBoundingClientRect().top - n);
1669
1672
  return t;
1670
1673
  };
1671
- function nl(e, t) {
1674
+ function ol(e, t) {
1672
1675
  const n = q(null);
1673
1676
  Z(() => {
1674
1677
  const o = e.current;
1675
1678
  if (!o) return;
1676
- const r = tl(o), s = n.current;
1679
+ const r = nl(o), s = n.current;
1677
1680
  if (n.current = { trigger: t, positions: r }, !s || s.trigger === t) return;
1678
- const i = lo(o, "--u-duration-medium");
1681
+ const i = ao(o, "--u-duration-medium");
1679
1682
  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);
1683
+ const l = getComputedStyle(o).getPropertyValue("--u-ease-out").trim() || "ease-out", c = tl(s.positions, r);
1681
1684
  for (const a of Array.from(o.querySelectorAll("tbody > tr[data-motion]"))) {
1682
1685
  const u = a.dataset.motion, d = c.get(u);
1683
1686
  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
1687
  }
1685
1688
  });
1686
1689
  }
1687
- function ol(e, t, n) {
1690
+ function rl(e, t, n) {
1688
1691
  const o = q(t);
1689
1692
  Z(() => {
1690
1693
  const r = e.current, s = o.current;
1691
1694
  if (o.current = t, !r || s === t || typeof r.animate != "function") return;
1692
- const i = lo(r, "--u-duration-medium");
1695
+ const i = ao(r, "--u-duration-medium");
1693
1696
  if (i === 0) return;
1694
1697
  const l = performance.now();
1695
1698
  let c = requestAnimationFrame(function a(u) {
@@ -1701,8 +1704,8 @@ function ol(e, t, n) {
1701
1704
  };
1702
1705
  }, [e, t, n]);
1703
1706
  }
1704
- const rl = (e) => e.controls + (e.span ? 1 : 0) + e.aggregates.length + (e.actions ? 1 : 0);
1705
- function ao(e) {
1707
+ const sl = (e) => e.controls + (e.span ? 1 : 0) + e.aggregates.length + (e.actions ? 1 : 0);
1708
+ function co(e) {
1706
1709
  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
1710
  return {
1708
1711
  lead: a,
@@ -1711,14 +1714,14 @@ function ao(e) {
1711
1714
  };
1712
1715
  }
1713
1716
  function bt(e, t) {
1714
- const n = rl(t);
1717
+ const n = sl(t);
1715
1718
  if (e === "cells") return Array.from({ length: n }, () => 1);
1716
1719
  if (e === "whole") return [n];
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] : [];
1720
+ const { lead: o, labelColumns: r, countColumns: s } = co(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
1721
  return e === "header" ? [...i, (t.span ? 1 : 0) + r, ...c(r), ...l] : [...i, 1, ...s > 0 ? [s] : [], ...c(s), ...l];
1719
1722
  }
1720
1723
  const Ue = (e) => `row:${e}`;
1721
- function sl({ layout: e, body: t, rowKey: n, expanded: o, foot: r }) {
1724
+ function il({ layout: e, body: t, rowKey: n, expanded: o, foot: r }) {
1722
1725
  const s = bt("cells", e), i = bt("whole", e), l = [{ key: "head", cells: s, at: -1 }], c = (a, u) => {
1723
1726
  const d = n(a);
1724
1727
  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 });
@@ -1727,7 +1730,7 @@ function sl({ layout: e, body: t, rowKey: n, expanded: o, foot: r }) {
1727
1730
  a.kind === "row" ? c(a.row, u) : l.push({ key: `${a.kind}:${a.group.path}`, cells: bt(a.kind, e), at: u });
1728
1731
  }), l.length === 1 && l.push({ key: "empty", cells: i, at: -1 }), r && l.push({ key: "foot", cells: s, at: -1 }), l;
1729
1732
  }
1730
- function co(e, t) {
1733
+ function uo(e, t) {
1731
1734
  let n = 0;
1732
1735
  for (let o = 0; o < e.length; o++) {
1733
1736
  const r = n + e[o];
@@ -1737,10 +1740,10 @@ function co(e, t) {
1737
1740
  return { index: 0, start: 0 };
1738
1741
  }
1739
1742
  const je = (e, t) => e.slice(0, t).reduce((n, o) => n + o, 0);
1740
- function il(e, t, n, o) {
1743
+ function ll(e, t, n, o) {
1741
1744
  const r = e.length - 1, s = e[t.line];
1742
1745
  if (!s) return t;
1743
- const { index: i } = co(s.cells, t.column), l = (c) => ({ line: Math.max(0, Math.min(r, c)), column: t.column });
1746
+ const { index: i } = uo(s.cells, t.column), l = (c) => ({ line: Math.max(0, Math.min(r, c)), column: t.column });
1744
1747
  switch (n) {
1745
1748
  case "left":
1746
1749
  return i > 0 ? { line: t.line, column: je(s.cells, i - 1) } : t;
@@ -1764,8 +1767,8 @@ function il(e, t, n, o) {
1764
1767
  return { line: r, column: je(e[r].cells, e[r].cells.length - 1) };
1765
1768
  }
1766
1769
  }
1767
- function ll(e, t, n, o) {
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);
1770
+ function al(e, t, n, o) {
1771
+ 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 === uo(e[t.line].cells, t.column).start);
1769
1772
  return (n ? r.slice(0, Math.max(0, s)).reverse() : r.slice(s + 1)).find(o) ?? null;
1770
1773
  }
1771
1774
  function pn(e, t, n) {
@@ -1773,7 +1776,7 @@ function pn(e, t, n) {
1773
1776
  return o >= 0 ? o : Math.max(0, Math.min(e.length - 1, n));
1774
1777
  }
1775
1778
  const he = "new";
1776
- class al {
1779
+ class cl {
1777
1780
  wish = null;
1778
1781
  /** `open`: the editor, with its list or calendar open - a click asked for it. */
1779
1782
  want(t) {
@@ -1785,63 +1788,63 @@ class al {
1785
1788
  return n && (this.wish = null), n;
1786
1789
  }
1787
1790
  }
1788
- function cl() {
1789
- const [e, t] = I({ active: null, widget: !1, editing: null }), [n] = I(() => new al());
1791
+ function dl() {
1792
+ const [e, t] = I({ active: null, widget: !1, editing: null }), [n] = I(() => new cl());
1790
1793
  return { state: e, setState: t, focus: n };
1791
1794
  }
1792
1795
  const mn = (e) => e?.spec.edit !== void 0;
1793
- function uo(e, t) {
1796
+ function fo(e, t) {
1794
1797
  const n = (o) => se(o) || o === "" ? null : o instanceof Date ? o.getTime() : o;
1795
1798
  return Object.is(n(e), n(t));
1796
1799
  }
1797
- function dl(e) {
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
- const O = n[k.line];
1800
+ function ul(e) {
1801
+ 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((x) => x.key), p = t.state.editing, m = (x) => x === he ? p?.fresh : n.find((O) => O.key === x)?.row, w = (x) => {
1802
+ const O = n[x.line];
1800
1803
  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), 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
+ }, g = (x) => w(x) !== null && mn(r(o[x.column] ?? "")), v = () => o.map(r).filter(mn), C = (x, O, M = !1) => {
1805
+ const R = n[x.line], E = r(o[x.column] ?? ""), D = l ? Object.fromEntries(v().map(($) => [$.spec.id, $.read(R.row)])) : {};
1806
+ D[E.spec.id] = O === void 0 ? E.read(R.row) : O, t.focus.want(M ? "open" : "editor"), d(($) => ({
1804
1807
  ...$,
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 }
1808
+ active: { line: R.key, column: E.spec.id, lineIndex: x.line, columnIndex: x.column },
1809
+ editing: { line: R.key, column: E.spec.id, row: l, drafts: D, errors: {}, refused: !1 }
1807
1810
  }));
1808
- }, y = (k = {}, O = !0) => {
1811
+ }, y = (x = {}, O = !0) => {
1809
1812
  if (!p) return !0;
1810
- const M = { ...p.drafts, ...k }, R = m(p.line);
1813
+ const M = { ...p.drafts, ...x }, R = m(p.line);
1811
1814
  if (R === void 0)
1812
- return d((V) => ({ ...V, editing: null })), !0;
1815
+ return d((P) => ({ ...P, editing: null })), !0;
1813
1816
  const E = {};
1814
- for (const [V, K] of Object.entries(M)) {
1815
- const Y = r(V)?.spec.validate?.(K, R);
1816
- Y && (E[V] = Y);
1817
+ for (const [P, K] of Object.entries(M)) {
1818
+ const Y = r(P)?.spec.validate?.(K, R);
1819
+ Y && (E[P] = Y);
1817
1820
  }
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
+ const D = Object.keys(M).find((P) => E[P] !== void 0);
1822
+ if (D !== void 0) {
1823
+ const P = p.row ? D : p.column;
1821
1824
  return O && t.focus.want("editor"), d((K) => ({
1822
1825
  ...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 }
1826
+ active: { line: p.line, column: P, lineIndex: Math.max(0, b.indexOf(p.line)), columnIndex: o.indexOf(P) },
1827
+ editing: K.editing && { ...K.editing, column: P, drafts: M, errors: E, refused: !1 }
1825
1828
  })), !1;
1826
1829
  }
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
- }, _ = (k, O) => y({ [k]: O }), S = () => {
1830
- t.focus.want("cell"), d((k) => ({ ...k, editing: null }));
1831
- }, C = () => {
1832
- t.focus.want("editor"), d((k) => k.editing ? { ...k, editing: { ...k.editing, refused: !0 } } : k);
1830
+ const $ = Object.keys(M).filter((P) => !fo(M[P], r(P)?.read(R)));
1831
+ return p.line === he ? a?.({ values: M }) : p.row ? $.length > 0 && c?.({ rowKey: s(R), changes: Object.fromEntries($.map((P) => [P, M[P]])), row: R }) : $.length > 0 && i?.({ rowKey: s(R), columnId: p.column, value: M[p.column], row: R }), O && t.focus.want("cell"), d((P) => ({ ...P, editing: null })), !0;
1832
+ }, _ = (x, O) => y({ [x]: O }), k = () => {
1833
+ t.focus.want("cell"), d((x) => ({ ...x, editing: null }));
1834
+ }, S = () => {
1835
+ t.focus.want("editor"), d((x) => x.editing ? { ...x, editing: { ...x.editing, refused: !0 } } : x);
1833
1836
  };
1834
- return { rowAt: w, editable: g, startEdit: x, save: y, commit: _, discard: S, refuse: C, setDraft: (k, O) => d((M) => {
1837
+ return { rowAt: w, editable: g, startEdit: C, save: y, commit: _, discard: k, refuse: S, setDraft: (x, O) => d((M) => {
1835
1838
  if (!M.editing) return M;
1836
1839
  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
+ if (R[x] !== void 0) {
1841
+ const E = r(x)?.spec.validate?.(O, m(M.editing.line));
1842
+ E ? R[x] = E : delete R[x];
1840
1843
  }
1841
- return { ...M, editing: { ...M.editing, drafts: { ...M.editing.drafts, [k]: O }, errors: R, refused: !1 } };
1844
+ return { ...M, editing: { ...M.editing, drafts: { ...M.editing.drafts, [x]: O }, errors: R, refused: !1 } };
1842
1845
  }), addRow: () => {
1843
- if (p && (p.row || !y())) return C();
1844
- const k = v(), O = k[0];
1846
+ if (p && (p.row || !y())) return S();
1847
+ const x = v(), O = x[0];
1845
1848
  if (!O) return;
1846
1849
  const M = u?.() ?? {};
1847
1850
  t.focus.want("editor"), d((R) => ({
@@ -1853,7 +1856,7 @@ function dl(e) {
1853
1856
  column: O.spec.id,
1854
1857
  row: !0,
1855
1858
  /* What `newRow` leaves out is empty - `null`, as an emptied field says it. */
1856
- drafts: Object.fromEntries(k.map((E) => [E.spec.id, E.read(M) ?? null])),
1859
+ drafts: Object.fromEntries(x.map((E) => [E.spec.id, E.read(M) ?? null])),
1857
1860
  errors: {},
1858
1861
  refused: !1,
1859
1862
  fresh: M
@@ -1876,7 +1879,7 @@ function qt(e, t) {
1876
1879
  const { start: s, end: i } = Wt(o).find((l) => l.cell === n);
1877
1880
  return { cell: n, line: r, column: s, end: i };
1878
1881
  }
1879
- const ul = {
1882
+ const fl = {
1880
1883
  ArrowLeft: "left",
1881
1884
  ArrowRight: "right",
1882
1885
  ArrowUp: "up",
@@ -1886,26 +1889,26 @@ const ul = {
1886
1889
  PageUp: "pageUp",
1887
1890
  PageDown: "pageDown"
1888
1891
  };
1889
- function fl(e, t) {
1892
+ function hl(e, t) {
1890
1893
  const n = e.parentElement?.getBoundingClientRect().height ?? 0, o = t.parentElement, r = Math.min(o?.clientHeight || window.innerHeight, window.innerHeight);
1891
1894
  return n > 0 ? Math.max(1, Math.floor(r / n) - 1) : 10;
1892
1895
  }
1893
- function fo(e, t) {
1896
+ function ho(e, t) {
1894
1897
  return t && t.line === e.line && t.columnIndex >= e.column && t.columnIndex < e.end ? t.columnIndex : e.column;
1895
1898
  }
1896
- function hl({ grid: e, lines: t, ids: n, virtual: o }, r, s) {
1899
+ function gl({ grid: e, lines: t, ids: n, virtual: o }, r, s) {
1897
1900
  const i = t[s.line];
1898
1901
  if (!i) return;
1899
1902
  e.setState((a) => ({ ...a, widget: !1, active: { line: i.key, column: n[s.column] ?? "", lineIndex: s.line, columnIndex: s.column } }));
1900
1903
  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
1904
  c ? c.focus({ preventScroll: i.key === "head" }) : (e.focus.want("cell"), o && i.at >= 0 && o.showRow(i.at));
1902
1905
  }
1903
- function gl(e, t, n) {
1906
+ function pl(e, t, n) {
1904
1907
  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
1908
  if (n.defaultPrevented) return;
1906
1909
  const g = qt(w, n.target);
1907
1910
  if (!g) return;
1908
- const v = { line: p.indexOf(g.line), column: fo(g, o.state.active) };
1911
+ const v = { line: p.indexOf(g.line), column: ho(g, o.state.active) };
1909
1912
  if (v.line < 0) return;
1910
1913
  if (m?.row && m.line === g.line) {
1911
1914
  n.key === "Escape" ? (n.preventDefault(), b()) : n.key === "Enter" && !(n.target instanceof HTMLButtonElement) && (n.preventDefault(), d());
@@ -1917,7 +1920,7 @@ function gl(e, t, n) {
1917
1920
  else if (n.key === "Enter" && !(n.target instanceof HTMLButtonElement))
1918
1921
  n.preventDefault(), d();
1919
1922
  else if (n.key === "Tab") {
1920
- const y = ll(r, v, n.shiftKey, a), _ = d();
1923
+ const y = al(r, v, n.shiftKey, a), _ = d();
1921
1924
  if ((y || !_) && n.preventDefault(), !_) return;
1922
1925
  y ? u(y) : o.focus.want(null);
1923
1926
  }
@@ -1928,9 +1931,9 @@ function gl(e, t, n) {
1928
1931
  return;
1929
1932
  }
1930
1933
  if (n.altKey || n.metaKey) return;
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
+ const C = n.ctrlKey ? { Home: "first", End: "last" }[n.key] : fl[n.key];
1935
+ if (C) {
1936
+ n.preventDefault(), gl(e, w, ll(r, v, C, hl(g.cell, w)));
1934
1937
  return;
1935
1938
  }
1936
1939
  if (!n.ctrlKey) {
@@ -1954,14 +1957,14 @@ function gl(e, t, n) {
1954
1957
  }
1955
1958
  }
1956
1959
  }
1957
- function pl({ grid: e, lines: t }, { editable: n, startEdit: o }, r) {
1960
+ function ml({ grid: e, lines: t }, { editable: n, startEdit: o }, r) {
1958
1961
  if (r.button !== 0 || e.state.editing) return;
1959
1962
  const s = qt(r.currentTarget, r.target);
1960
1963
  if (!s || r.target.closest(Ht) !== s.cell) return;
1961
1964
  const i = { line: t.findIndex((l) => l.key === s.line), column: s.column };
1962
1965
  i.line >= 0 && n(i) && o(i, void 0, !0);
1963
1966
  }
1964
- function ml({ grid: e, lines: t, ids: n }, { save: o, refuse: r }, s) {
1967
+ function wl({ grid: e, lines: t, ids: n }, { save: o, refuse: r }, s) {
1965
1968
  const i = e.state.editing, l = qt(s.currentTarget, s.target);
1966
1969
  if (!l) return;
1967
1970
  const c = t.findIndex((u) => u.key === l.line), a = n[l.column] ?? "";
@@ -1973,7 +1976,7 @@ function ml({ grid: e, lines: t, ids: n }, { save: o, refuse: r }, s) {
1973
1976
  return;
1974
1977
  }
1975
1978
  e.focus.want(null), e.setState((u) => {
1976
- const d = fo(l, u.active);
1979
+ const d = ho(l, u.active);
1977
1980
  return {
1978
1981
  ...u,
1979
1982
  widget: s.target !== l.cell,
@@ -1981,11 +1984,11 @@ function ml({ grid: e, lines: t, ids: n }, { save: o, refuse: r }, s) {
1981
1984
  };
1982
1985
  });
1983
1986
  }
1984
- function wl({ grid: e }, t) {
1987
+ function bl({ grid: e }, t) {
1985
1988
  t.currentTarget.contains(t.relatedTarget) || e.setState((n) => n.widget ? { ...n, widget: !1 } : n);
1986
1989
  }
1987
- function bl(e) {
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 = {
1990
+ function vl(e) {
1991
+ const { grid: t, rowKey: n, onRowDelete: o } = e, r = ul(e), { save: s, discard: i, commit: l, setDraft: c, editable: a, addRow: u } = r, d = {
1989
1992
  editing: t.state.editing,
1990
1993
  setDraft: c,
1991
1994
  commit: l,
@@ -1994,23 +1997,23 @@ function bl(e) {
1994
1997
  remove: o && ((m) => o({ rowKey: n(m), row: m }))
1995
1998
  }, b = t.state.editing, p = b && !b.row ? () => void s({}, !1) : void 0;
1996
1999
  return {
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),
2000
+ onKeyDown: (m) => pl(e, r, m),
2001
+ onClick: (m) => ml(e, r, m),
2002
+ onFocus: (m) => wl(e, r, m),
2003
+ onBlur: (m) => bl(e, m),
2001
2004
  context: d,
2002
2005
  editable: a,
2003
2006
  addRow: u,
2004
2007
  outside: p
2005
2008
  };
2006
2009
  }
2007
- const Pe = /* @__PURE__ */ rt(null);
2008
- function vl(e, t) {
2009
- const n = _e(Pe), o = n?.editing;
2010
+ const Ve = /* @__PURE__ */ rt(null);
2011
+ function yl(e, t) {
2012
+ const n = _e(Ve), o = n?.editing;
2010
2013
  return o && o.line === e && t in o.drafts ? n : null;
2011
2014
  }
2012
2015
  const Ke = "data-grid-tabindex";
2013
- function yl(e, t) {
2016
+ function _l(e, t) {
2014
2017
  if (t && !e.hasAttribute(Ke))
2015
2018
  e.setAttribute(Ke, e.getAttribute("tabindex") ?? ""), e.tabIndex = -1;
2016
2019
  else if (!t && e.hasAttribute(Ke)) {
@@ -2018,7 +2021,7 @@ function yl(e, t) {
2018
2021
  n === "" ? e.removeAttribute("tabindex") : e.setAttribute("tabindex", n), e.removeAttribute(Ke);
2019
2022
  }
2020
2023
  }
2021
- function _l({
2024
+ function xl({
2022
2025
  table: e,
2023
2026
  grid: t,
2024
2027
  lines: n,
@@ -2031,7 +2034,7 @@ function _l({
2031
2034
  i.current = s;
2032
2035
  });
2033
2036
  const l = s !== void 0;
2034
- return xe(() => {
2037
+ return Ce(() => {
2035
2038
  const c = e.current;
2036
2039
  if (!l || !c) return;
2037
2040
  const a = (u) => {
@@ -2046,26 +2049,26 @@ function _l({
2046
2049
  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
2050
  let w = null, g = null;
2048
2051
  for (const y of Array.from(c.querySelectorAll("tr[data-grid-line]"))) {
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
- const O = d?.row === !0 && d.line === _ || C === w && (u || d !== null && d.line === _);
2054
- for (const M of Array.from(C.querySelectorAll(Ht))) yl(M, !O);
2052
+ const _ = y.dataset.gridLine, k = Wt(y);
2053
+ for (const { cell: S, start: A, end: L } of k) {
2054
+ const x = b.column >= A && b.column < L || S === k.at(-1).cell && b.column >= L;
2055
+ x && _ === p && (w = S), x && g === null && _ !== "head" && (g = S), S.tabIndex = -1, r && _ !== "head" && !r({ line: m.get(_) ?? -1, column: A }) ? S.setAttribute("aria-readonly", "true") : S.removeAttribute("aria-readonly");
2056
+ const O = d?.row === !0 && d.line === _ || S === w && (u || d !== null && d.line === _);
2057
+ for (const M of Array.from(S.querySelectorAll(Ht))) _l(M, !O);
2055
2058
  }
2056
2059
  }
2057
2060
  const v = w ?? g ?? c.querySelector("tr[data-grid-line] > *");
2058
2061
  v && !(d?.row && v.parentElement?.dataset.gridLine === d.line) && (v.tabIndex = 0);
2059
- const x = t.focus.take(w !== null);
2060
- if (x === "editor" || x === "open") {
2062
+ const C = t.focus.take(w !== null);
2063
+ if (C === "editor" || C === "open") {
2061
2064
  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), x === "open" && y instanceof HTMLSelectElement)
2065
+ if (y?.focus(), y instanceof HTMLInputElement && y.type === "text" && y.setSelectionRange(y.value.length, y.value.length), C === "open" && y instanceof HTMLSelectElement)
2063
2066
  try {
2064
2067
  y.showPicker();
2065
2068
  } catch {
2066
2069
  }
2067
- else x === "open" && y instanceof HTMLButtonElement && y.click();
2068
- } else x === "cell" && w?.focus();
2070
+ else C === "open" && y instanceof HTMLButtonElement && y.click();
2071
+ } else C === "cell" && w?.focus();
2069
2072
  }), null;
2070
2073
  }
2071
2074
  function kl(e, t, n) {
@@ -2079,7 +2082,7 @@ function kl(e, t, n) {
2079
2082
  } : { line: Math.min(1, t.length - 1), column: 0 };
2080
2083
  }
2081
2084
  function Sl({ entry: e, row: t, rowName: n, grid: o }) {
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);
2085
+ const r = xe(), 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
2086
  let p;
2084
2087
  if (typeof i.edit == "function")
2085
2088
  p = i.edit({
@@ -2093,9 +2096,9 @@ function Sl({ entry: e, row: t, rowName: n, grid: o }) {
2093
2096
  else if (i.edit === "number")
2094
2097
  p = /* @__PURE__ */ f(yt, { size: "sm", value: typeof a == "number" ? a : null, onChange: d });
2095
2098
  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) });
2099
+ p = /* @__PURE__ */ f(Fo, { size: "sm", value: a instanceof Date ? a : null, onChange: (m) => l.row ? d(m) : o.commit(c, m) });
2097
2100
  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));
2101
+ const m = i.editOptions ?? At(o.hook.admitted, e.read, r).values, w = m.findIndex((g) => fo(g, a));
2099
2102
  p = /* @__PURE__ */ T(Rn, { size: "sm", value: w < 0 ? "" : String(w), onChange: (g) => d(m[Number(g.target.value)]), children: [
2100
2103
  w < 0 && /* @__PURE__ */ f("option", { value: "" }),
2101
2104
  m.map((g, v) => /* @__PURE__ */ f("option", { value: v, children: g instanceof Date ? r.date(g) : String(g) }, v))
@@ -2108,13 +2111,13 @@ function Sl({ entry: e, row: t, rowName: n, grid: o }) {
2108
2111
  }, anchorRef: s, restoreFocus: !1, offset: 4, className: h.editorMessage, children: /* @__PURE__ */ f("span", { "aria-hidden": "true", children: u }) })
2109
2112
  ] });
2110
2113
  }
2111
- function ho({ wording: e }) {
2114
+ function go({ wording: e }) {
2112
2115
  return /* @__PURE__ */ T(re, { children: [
2113
2116
  /* @__PURE__ */ f("span", { "aria-hidden": "true", className: h.absent, children: "—" }),
2114
2117
  /* @__PURE__ */ f(Oe, { children: e.cellAbsentValue })
2115
2118
  ] });
2116
2119
  }
2117
- const Cl = { sum: "Σ", avg: "⌀", min: "min", max: "max" }, xl = (e, t) => ({
2120
+ const Cl = { sum: "Σ", avg: "⌀", min: "min", max: "max" }, Al = (e, t) => ({
2118
2121
  sum: t.footerSum,
2119
2122
  avg: t.footerAverage,
2120
2123
  min: t.footerMinimum,
@@ -2123,7 +2126,7 @@ const Cl = { sum: "Σ", avg: "⌀", min: "min", max: "max" }, xl = (e, t) => ({
2123
2126
  count: t.footerCount,
2124
2127
  distinct: t.footerDistinct
2125
2128
  })[e] ?? t.footerAggregate, wn = /* @__PURE__ */ new WeakMap();
2126
- function go(e, t, n) {
2129
+ function po(e, t, n) {
2127
2130
  const o = e.spec.aggregate;
2128
2131
  let r = wn.get(t);
2129
2132
  r || wn.set(t, r = /* @__PURE__ */ new Map());
@@ -2134,7 +2137,7 @@ function go(e, t, n) {
2134
2137
  if ((o === "sum" || o === "avg") && typeof c == "number")
2135
2138
  for (const b of t) {
2136
2139
  const p = e.read(b);
2137
- Al(p) && (a = Math.max(a, Nl(p)));
2140
+ Nl(p) && (a = Math.max(a, Tl(p)));
2138
2141
  }
2139
2142
  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
2143
  return r.set(e, d), d;
@@ -2149,12 +2152,12 @@ function Ot({
2149
2152
  }) {
2150
2153
  const { aggregate: i, format: l, presentation: c } = e.spec;
2151
2154
  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);
2155
+ const a = typeof i == "function" ? "own" : i, { value: u, places: d } = po(e, t, s), b = (w) => Pe(w, l, n, o);
2153
2156
  let p;
2154
- if (se(u)) p = /* @__PURE__ */ f(ho, { wording: o });
2157
+ if (se(u)) p = /* @__PURE__ */ f(go, { wording: o });
2155
2158
  else if ((a === "sum" || a === "avg") && l === void 0 && typeof u == "number")
2156
2159
  p = n.number(u, Math.min(10, a === "avg" ? d + 1 : d));
2157
- else if (a === "range" && l === "date" && Tl(u)) {
2160
+ else if (a === "range" && l === "date" && Rl(u)) {
2158
2161
  const [w, g] = u;
2159
2162
  p = w.getTime() === g.getTime() ? n.date(w) : o.rangeFromTo(n.dateShort(w), n.dateShort(g));
2160
2163
  } else if (a === "count" || a === "distinct") p = n.count(u);
@@ -2166,26 +2169,26 @@ function Ot({
2166
2169
  return /* @__PURE__ */ T(re, { children: [
2167
2170
  r && m && /* @__PURE__ */ f("span", { "aria-hidden": "true", className: h.footerKind, children: m }),
2168
2171
  r && /* @__PURE__ */ T(Oe, { children: [
2169
- xl(a, o),
2172
+ Al(a, o),
2170
2173
  " "
2171
2174
  ] }),
2172
2175
  p
2173
2176
  ] });
2174
2177
  }
2175
- const Al = (e) => typeof e == "number" && Number.isFinite(e), Nl = (e) => {
2178
+ const Nl = (e) => typeof e == "number" && Number.isFinite(e), Tl = (e) => {
2176
2179
  const [t = "", n = "0"] = e.toExponential().split("e");
2177
2180
  return Math.max(0, (t.split(".")[1]?.length ?? 0) - Number(n));
2178
- }, Tl = ([e, t]) => e instanceof Date && t instanceof Date && e.getFullYear() === t.getFullYear();
2179
- function po(e, t, n) {
2180
- return e.spec.aggregate ? go(e, t, n).numeric : !1;
2181
+ }, Rl = ([e, t]) => e instanceof Date && t instanceof Date && e.getFullYear() === t.getFullYear();
2182
+ function mo(e, t, n) {
2183
+ return e.spec.aggregate ? po(e, t, n).numeric : !1;
2181
2184
  }
2182
- const mo = {};
2185
+ const wo = {};
2183
2186
  function ct(e, t, n = t) {
2184
- const o = or(e, t, n);
2185
- if (!o) return mo;
2187
+ const o = rr(e, t, n);
2188
+ if (!o) return wo;
2186
2189
  const r = o.side === "start";
2187
2190
  return {
2188
- className: D(h.pinned, o.edge && (r ? h.pinStartEdge : h.pinEndEdge)),
2191
+ className: B(h.pinned, o.edge && (r ? h.pinStartEdge : h.pinEndEdge)),
2189
2192
  /* The scroll area keeps a padding as wide as the block for the browser's
2190
2193
  scroll into view; a pinned cell lies inside it and would scroll the
2191
2194
  table back to its start when focused. Its target is shifted out of the
@@ -2204,9 +2207,9 @@ function ct(e, t, n = t) {
2204
2207
  function dt(e, t, n, o) {
2205
2208
  if (t === void 0) return o.groupNoValue;
2206
2209
  const r = e?.spec;
2207
- if (r?.group && t instanceof Date) return qo(r.group, t, n, o);
2210
+ if (r?.group && t instanceof Date) return Yo(r.group, t, n, o);
2208
2211
  const s = r?.ownGroupValue ? void 0 : r?.format;
2209
- return Ve(t, s, n, o) ?? String(t);
2212
+ return Pe(t, s, n, o) ?? String(t);
2210
2213
  }
2211
2214
  function Et({ entry: e, group: t, formats: n, wording: o }) {
2212
2215
  const r = e?.spec;
@@ -2242,7 +2245,7 @@ function Mt({
2242
2245
  "button",
2243
2246
  {
2244
2247
  type: "button",
2245
- className: D(h.fold, !o && h.foldClosed),
2248
+ className: B(h.fold, !o && h.foldClosed),
2246
2249
  "data-fold-path": e.path,
2247
2250
  "aria-expanded": o,
2248
2251
  "aria-label": o ? i.foldGroup(l, c) : i.unfoldGroup(l, c),
@@ -2251,13 +2254,13 @@ function Mt({
2251
2254
  if (!d.altKey) return a();
2252
2255
  bn(e, o, r);
2253
2256
  },
2254
- children: /* @__PURE__ */ f(wo, {})
2257
+ children: /* @__PURE__ */ f(bo, {})
2255
2258
  }
2256
2259
  );
2257
2260
  }
2258
- function Rl({ value: e, formats: t }) {
2261
+ function Ol({ value: e, formats: t }) {
2259
2262
  const n = q(null);
2260
- return ol(n, e, t.count), /* @__PURE__ */ f("span", { ref: n, className: h.groupCount, children: t.count(e) });
2263
+ return rl(n, e, t.count), /* @__PURE__ */ f("span", { ref: n, className: h.groupCount, children: t.count(e) });
2261
2264
  }
2262
2265
  function Lt({ group: e, entry: t, hook: n, formats: o, wording: r }) {
2263
2266
  const { selection: s } = n.publicSnapshot, i = e.rows.map(n.rowKey), l = i.filter((a) => s.isSelected(a)).length, c = l === i.length;
@@ -2282,7 +2285,7 @@ function bn(e, t, n) {
2282
2285
  for (const i of r)
2283
2286
  o.folded.includes(i.path) !== t && o.toggleFold(i.path);
2284
2287
  }
2285
- function Ol({
2288
+ function El({
2286
2289
  line: e,
2287
2290
  entry: t,
2288
2291
  selectable: n,
@@ -2292,7 +2295,7 @@ function Ol({
2292
2295
  wording: i
2293
2296
  }) {
2294
2297
  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: [
2298
+ return /* @__PURE__ */ f("td", { className: B(h.td, h.spanCell, o.className), style: o.style, children: e.first && /* @__PURE__ */ T("span", { className: h.spanValue, children: [
2296
2299
  n && /* @__PURE__ */ f("span", { className: h.spanSelect, children: /* @__PURE__ */ f(Lt, { group: l, entry: t, hook: r, formats: s, wording: i }) }),
2297
2300
  /* @__PURE__ */ f(Mt, { group: l, parent: e.parents.at(-1), entry: t, open: !0, hook: r, formats: s, wording: i }),
2298
2301
  /* @__PURE__ */ T("span", { className: h.spanText, title: dt(t, l.value, s, i), children: [
@@ -2302,7 +2305,7 @@ function Ol({
2302
2305
  /* @__PURE__ */ f("span", { className: h.groupCount, children: s.count(l.rows.length) })
2303
2306
  ] }) });
2304
2307
  }
2305
- function El({
2308
+ function Ml({
2306
2309
  line: e,
2307
2310
  index: t,
2308
2311
  absolute: n,
@@ -2321,97 +2324,97 @@ function El({
2321
2324
  wording: w,
2322
2325
  grid: g
2323
2326
  }) {
2324
- const { group: v } = e, x = e.kind === "header", y = x && !p.publicSnapshot.folded.includes(v.path), { lead: _, labelColumns: S, countColumns: C } = ao({
2327
+ const { group: v } = e, C = e.kind === "header", y = C && !p.publicSnapshot.folded.includes(v.path), { lead: _, labelColumns: k, countColumns: S } = co({
2325
2328
  controls: i,
2326
2329
  span: o !== void 0,
2327
- aggregates: s.map((B) => B.spec.aggregate !== void 0),
2330
+ aggregates: s.map((D) => D.spec.aggregate !== void 0),
2328
2331
  actions: a,
2329
2332
  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: [
2333
+ }), A = s.slice(_), L = i + (o ? 1 : 0), x = (D, $ = D) => ct(l, D, $), O = (D) => _ - D > 0 && /* @__PURE__ */ f("td", { className: h.td, colSpan: _ - D }), M = s.find((D) => D.spec.aggregate === "sum" && D.spec.share !== !1), R = n !== void 0, E = /* @__PURE__ */ T("span", { className: h.groupLabel, children: [
2331
2334
  /* @__PURE__ */ f(Mt, { group: v, parent: e.parents.at(-1), entry: r, open: y, hook: p, formats: m, wording: w }),
2332
2335
  /* @__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 })
2336
+ /* @__PURE__ */ f(Ol, { value: v.rows.length, formats: m }),
2337
+ C && e.continued && /* @__PURE__ */ f("span", { className: h.continued, children: w.groupContinued })
2335
2338
  ] });
2336
2339
  return /* @__PURE__ */ T(
2337
2340
  "tr",
2338
2341
  {
2339
- className: D(x ? h.groupHeader : h.groupFolded, R && h.virtualRow),
2342
+ className: B(C ? h.groupHeader : h.groupFolded, R && h.virtualRow),
2340
2343
  "data-line": e.kind,
2341
2344
  "data-level": v.level,
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
+ "data-motion": n !== void 0 || !(C && e.continued) ? `${e.kind}:${v.path}` : void 0,
2346
+ "data-continued": C && e.continued ? "" : void 0,
2347
+ "data-group-first": C ? void 0 : "",
2345
2348
  "data-group": v.path,
2346
2349
  "data-grid-line": g ? `${e.kind}:${v.path}` : void 0,
2347
2350
  "data-row": R ? n : void 0,
2348
2351
  "aria-rowindex": R ? n + 2 : void 0,
2349
2352
  "data-index": t,
2350
- style: x ? { "--u-header-level": v.level } : void 0,
2351
- "aria-level": x ? v.level + 1 : b,
2353
+ style: C ? { "--u-header-level": v.level } : void 0,
2354
+ "aria-level": C ? v.level + 1 : b,
2352
2355
  "aria-expanded": y,
2353
2356
  "aria-posinset": d.indexOf(v) + 1 || void 0,
2354
2357
  "aria-setsize": d.length || void 0,
2355
2358
  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: [
2359
+ Array.from({ length: i }, (D, $) => /* @__PURE__ */ f("td", { className: B(h.td, h.control, x($).className), style: x($).style, children: $ === 0 && c && C && /* @__PURE__ */ f(Lt, { group: v, entry: r, hook: p, formats: m, wording: w }) }, `c${$}`)),
2360
+ C ? /* @__PURE__ */ T(re, { children: [
2358
2361
  /* @__PURE__ */ f(
2359
2362
  "td",
2360
2363
  {
2361
- className: D(h.td, k(i, L + S - 1).className),
2362
- colSpan: (o ? 1 : 0) + S,
2364
+ className: B(h.td, x(i, L + k - 1).className),
2365
+ colSpan: (o ? 1 : 0) + k,
2363
2366
  style: {
2364
- ...k(i, L + S - 1).style,
2367
+ ...x(i, L + k - 1).style,
2365
2368
  paddingLeft: `calc(var(--u-space-3) + ${v.level * 20}px)`
2366
2369
  },
2367
2370
  children: E
2368
2371
  }
2369
2372
  ),
2370
- O(S)
2373
+ O(k)
2371
2374
  ] }) : /* @__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: [
2375
+ /* @__PURE__ */ f("td", { className: B(h.td, h.spanCell, x(i).className), style: x(i).style, children: /* @__PURE__ */ T("span", { className: h.spanValue, children: [
2373
2376
  c && /* @__PURE__ */ f("span", { className: h.spanSelect, children: /* @__PURE__ */ f(Lt, { group: v, entry: o, hook: p, formats: m, wording: w }) }),
2374
2377
  /* @__PURE__ */ f(Mt, { group: v, parent: e.parents.at(-1), entry: o, open: !1, hook: p, formats: m, wording: w }),
2375
2378
  /* @__PURE__ */ f("span", { className: h.spanText, children: /* @__PURE__ */ f(Et, { entry: o, group: v, formats: m, wording: w }) }),
2376
2379
  /* @__PURE__ */ f("span", { className: h.groupCount, children: m.count(v.rows.length) })
2377
2380
  ] }) }),
2378
- C > 0 && /* @__PURE__ */ f(
2381
+ S > 0 && /* @__PURE__ */ f(
2379
2382
  "td",
2380
2383
  {
2381
- className: D(h.td, h.foldedCount, k(L, L + C - 1).className),
2382
- style: k(L, L + C - 1).style,
2383
- colSpan: C,
2384
+ className: B(h.td, h.foldedCount, x(L, L + S - 1).className),
2385
+ style: x(L, L + S - 1).style,
2386
+ colSpan: S,
2384
2387
  children: w.entries(v.rows.length, m.count(v.rows.length))
2385
2388
  }
2386
2389
  ),
2387
- O(C)
2390
+ O(S)
2388
2391
  ] }),
2389
- A.map((B, $) => /* @__PURE__ */ f(
2390
- Ll,
2392
+ A.map((D, $) => /* @__PURE__ */ f(
2393
+ Fl,
2391
2394
  {
2392
- pin: k(L + _ + $),
2393
- entry: B,
2395
+ pin: x(L + _ + $),
2396
+ entry: D,
2394
2397
  group: v,
2395
- share: x && B === M,
2398
+ share: C && D === M,
2396
2399
  total: u,
2397
2400
  formats: m,
2398
2401
  wording: w
2399
2402
  },
2400
- B.key
2403
+ D.key
2401
2404
  )),
2402
- a && /* @__PURE__ */ f("td", { className: D(h.td, k(l.count - 1).className), style: k(l.count - 1).style })
2405
+ a && /* @__PURE__ */ f("td", { className: B(h.td, x(l.count - 1).className), style: x(l.count - 1).style })
2403
2406
  ]
2404
2407
  }
2405
2408
  );
2406
2409
  }
2407
2410
  const vn = /* @__PURE__ */ new WeakMap();
2408
- function Ml(e, t) {
2411
+ function Ll(e, t) {
2409
2412
  let n = vn.get(t);
2410
2413
  n || vn.set(t, n = /* @__PURE__ */ new Map());
2411
2414
  let o = n.get(e);
2412
2415
  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
2416
  }
2414
- function Ll({
2417
+ function Fl({
2415
2418
  entry: e,
2416
2419
  pin: t,
2417
2420
  group: n,
@@ -2421,34 +2424,34 @@ function Ll({
2421
2424
  wording: i
2422
2425
  }) {
2423
2426
  const { spec: l } = e;
2424
- if (!l.aggregate) return /* @__PURE__ */ f("td", { className: D(h.td, t.className), style: t.style });
2427
+ if (!l.aggregate) return /* @__PURE__ */ f("td", { className: B(h.td, t.className), style: t.style });
2425
2428
  let c = null;
2426
2429
  if (o && l.aggregate === "sum" && l.share !== !1) {
2427
- const a = Ml(e, r), u = n.aggregates[l.id];
2430
+ const a = Ll(e, r), u = n.aggregates[l.id];
2428
2431
  if (typeof a == "number" && a > 0 && typeof u == "number" && u > 0) {
2429
2432
  const d = Math.min(1, u / a);
2430
2433
  c = /* @__PURE__ */ f("span", { className: h.shareBar, style: { width: `${Math.max(2, Math.round(d * 64))}px` }, "aria-hidden": "true" });
2431
2434
  }
2432
2435
  }
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: [
2436
+ return /* @__PURE__ */ f("td", { className: B(h.td, mo(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
2437
  /* @__PURE__ */ f(Ot, { entry: e, rows: n.rows, known: { value: n.aggregates[l.id] }, formats: s, wording: i }),
2435
2438
  c
2436
2439
  ] }) : /* @__PURE__ */ f(Ot, { entry: e, rows: n.rows, known: { value: n.aggregates[l.id] }, formats: s, wording: i }) });
2437
2440
  }
2438
- function wo() {
2441
+ function bo() {
2439
2442
  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" }) });
2440
2443
  }
2441
- function bo(e, t, n, o, r) {
2444
+ function vo(e, t, n, o, r) {
2442
2445
  const s = e.detail?.presentation(n);
2443
2446
  if (s == null || s === !1) return null;
2444
2447
  const i = r !== void 0 && r.branch && !r.empty;
2445
2448
  return { content: s, open: i ? t.branches.includes(o) : t.expanded.includes(o) };
2446
2449
  }
2447
- function Fl(e, t, n, o, r) {
2450
+ function Bl(e, t, n, o, r) {
2448
2451
  const s = /* @__PURE__ */ new Set([...t.expanded, ...t.branches]), i = /* @__PURE__ */ new Set();
2449
2452
  for (const l of n) {
2450
2453
  const c = o(l);
2451
- s.has(c) && bo(e, t, l, c, r?.entry(l))?.open && i.add(c);
2454
+ s.has(c) && vo(e, t, l, c, r?.entry(l))?.open && i.add(c);
2452
2455
  }
2453
2456
  return i;
2454
2457
  }
@@ -2474,18 +2477,18 @@ function Dl({
2474
2477
  }
2475
2478
  }
2476
2479
  };
2477
- return /* @__PURE__ */ T("span", { className: h.treeCell, style: { "--tree-level": t.level }, children: [
2480
+ return /* @__PURE__ */ T("span", { className: h.treeCell, style: { "--_table-tree-level": t.level }, children: [
2478
2481
  l ? /* @__PURE__ */ f(
2479
2482
  "button",
2480
2483
  {
2481
2484
  type: "button",
2482
- className: D(h.fold, !c && h.foldClosed),
2485
+ className: B(h.fold, !c && h.foldClosed),
2483
2486
  "data-branch-key": t.key,
2484
2487
  "aria-expanded": c,
2485
2488
  "aria-label": c ? r.foldBranch(o) : r.unfoldBranch(o),
2486
2489
  onKeyDown: u,
2487
2490
  onClick: (d) => d.altKey ? e.siblings(t.key, !c) : a(!c),
2488
- children: /* @__PURE__ */ f(wo, {})
2491
+ children: /* @__PURE__ */ f(bo, {})
2489
2492
  }
2490
2493
  ) : /* @__PURE__ */ f("span", { className: h.foldSlot }),
2491
2494
  /* @__PURE__ */ T("span", { className: h.treeText, children: [
@@ -2494,7 +2497,7 @@ function Dl({
2494
2497
  ] })
2495
2498
  ] });
2496
2499
  }
2497
- function Bl(e, t, n, o) {
2500
+ function Pl(e, t, n, o) {
2498
2501
  const r = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Set(), l = [];
2499
2502
  return e.forEach((c, a) => {
2500
2503
  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);
@@ -2524,25 +2527,25 @@ function Vl({
2524
2527
  layout: o,
2525
2528
  grid: r
2526
2529
  }) {
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({
2530
+ 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: C, footerShown: y } = o, _ = l ? il({
2528
2531
  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 },
2532
+ body: i ? { rows: [] } : d ? { lines: u ? a.lines : d } : { rows: u ? a.shown ?? a.filtered : C },
2530
2533
  rowKey: t.rowKey,
2531
- expanded: o.detail ? Fl(e, c, a.shown ?? a.filtered, t.rowKey, o.tree) : /* @__PURE__ */ new Set(),
2534
+ expanded: o.detail ? Bl(e, c, a.shown ?? a.filtered, t.rowKey, o.tree) : /* @__PURE__ */ new Set(),
2532
2535
  foot: y
2533
- }) : [], S = r.state.editing?.line === he ? r.state.editing : null;
2534
- S && _[0] && _.splice(1, 0, { key: he, cells: _[0].cells, at: -1, row: S.fresh });
2535
- const C = [
2536
+ }) : [], k = r.state.editing?.line === he ? r.state.editing : null;
2537
+ k && _[0] && _.splice(1, 0, { key: he, cells: _[0].cells, at: -1, row: k.fresh });
2538
+ const S = [
2536
2539
  ...s ? ["#select"] : [],
2537
2540
  ...m ? ["#detail"] : [],
2538
2541
  ...b ? ["#span"] : [],
2539
2542
  ...p.map((L) => L.spec.id),
2540
2543
  ...g ? ["#actions"] : []
2541
- ], A = l ? bl({
2544
+ ], A = l ? vl({
2542
2545
  grid: r,
2543
2546
  lines: _,
2544
- ids: C,
2545
- columnById: (L) => p.find((k) => k.spec.id === L),
2547
+ ids: S,
2548
+ columnById: (L) => p.find((x) => x.spec.id === L),
2546
2549
  rowKey: t.rowKey,
2547
2550
  virtual: u,
2548
2551
  onCellEdit: n.onCellEdit,
@@ -2553,14 +2556,14 @@ function Vl({
2553
2556
  onRowDelete: n.onRowDelete,
2554
2557
  select: s ? (L) => c.selection.toggle(t.rowKey(L)) : void 0
2555
2558
  }) : void 0;
2556
- return { lines: _, fresh: S, ids: C, events: A };
2559
+ return { lines: _, fresh: k, ids: S, events: A };
2557
2560
  }
2558
- function Pl(e) {
2561
+ function Il(e) {
2559
2562
  for (const t of e) t.removeAttribute("data-copied");
2560
2563
  document.body.offsetWidth;
2561
2564
  for (const t of e) t.setAttribute("data-copied", "");
2562
2565
  }
2563
- function Il({
2566
+ function $l({
2564
2567
  registry: e,
2565
2568
  hook: t,
2566
2569
  grid: n,
@@ -2572,38 +2575,38 @@ function Il({
2572
2575
  tableElement: c
2573
2576
  }) {
2574
2577
  return (a) => {
2575
- const u = (A) => Fo(A, c());
2578
+ const u = (A) => Bo(A, c());
2576
2579
  if (a.defaultPrevented || a.altKey || a.shiftKey || a.ctrlKey === a.metaKey || a.key.toLowerCase() !== "c") return;
2577
2580
  const { target: d, currentTarget: b } = a;
2578
2581
  if (!(d instanceof Element)) return;
2579
2582
  const p = d.closest("td, th"), m = p?.dataset.editing, w = d.closest("input, textarea, select, [contenteditable]:not([contenteditable='false'])");
2580
2583
  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
- if (S)
2584
- v = w instanceof HTMLInputElement || w instanceof HTMLTextAreaElement ? w.value : no(S, n.state.editing?.drafts[S.spec.id], i, l), x = l.copiedCell;
2584
+ let v = "", C = "", y = p ? [p] : [];
2585
+ const _ = to(e), k = m === void 0 ? void 0 : s.find((A) => A.spec.id === m);
2586
+ if (k)
2587
+ v = w instanceof HTMLInputElement || w instanceof HTMLTextAreaElement ? w.value : oo(k, n.state.editing?.drafts[k.spec.id], i, l), C = l.copiedCell;
2585
2588
  else if (_.length > 0) {
2586
- v = to(e, i, l), x = l.copiedRows(_.length, i.count(_.length));
2589
+ v = no(e, i, l), C = l.copiedRows(_.length, i.count(_.length));
2587
2590
  const A = new Set(_.map((L) => t.rowKey(L)));
2588
2591
  y = Array.from(b.querySelectorAll("tr[data-motion]")).filter((L) => A.has(L.dataset.motion)).flatMap((L) => Array.from(L.children));
2589
2592
  } else if (o && n.state.active) {
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
- if (!k || k.row === void 0 || k.key !== Ue(t.rowKey(k.row)) || !O) return;
2593
+ const { line: A, column: L } = n.state.active, x = r.find((R) => R.key === A), O = s.find((R) => R.spec.id === L);
2594
+ if (!x || x.row === void 0 || x.key !== Ue(t.rowKey(x.row)) || !O) return;
2592
2595
  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;
2596
+ M && (y = [M]), v = Wi(O, x.row, i, l), C = l.copiedCell;
2594
2597
  } else return;
2595
2598
  a.preventDefault();
2596
- const C = (A) => {
2599
+ const S = (A) => {
2597
2600
  X("copy-failed", `The clipboard refused the copy (${String(A)}). It needs a secure context and a focused document.`), u(l.copyFailed);
2598
2601
  };
2599
2602
  Promise.resolve().then(() => navigator.clipboard.writeText(v)).then(() => {
2600
- Pl(y), u(x);
2601
- }, C);
2603
+ Il(y), u(C);
2604
+ }, S);
2602
2605
  };
2603
2606
  }
2604
- function $l({ table: e }) {
2607
+ function zl({ table: e }) {
2605
2608
  const [t, n] = I(null), o = Do(), r = q(null);
2606
- xe(() => {
2609
+ Ce(() => {
2607
2610
  const i = e.current;
2608
2611
  if (!i) return;
2609
2612
  let l;
@@ -2613,8 +2616,8 @@ function $l({ table: e }) {
2613
2616
  clearTimeout(l);
2614
2617
  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
2618
  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);
2619
+ const C = i.closest("dialog") ?? o() ?? document.body;
2620
+ l = setTimeout(() => n({ text: v.textContent ?? "", cell: w.getBoundingClientRect(), target: C }), m);
2618
2621
  }, u = (p) => a(p.target, 300), d = (p) => a(p.target, 0), b = (p) => {
2619
2622
  p.key === "Escape" && c();
2620
2623
  };
@@ -2646,32 +2649,32 @@ function Ft(e, t) {
2646
2649
  const n = e.scrollWidth - e.clientWidth;
2647
2650
  e.toggleAttribute("data-beyond-start", !t.start && e.scrollLeft > 0.5), e.toggleAttribute("data-beyond-end", !t.end && e.scrollLeft < n - 0.5);
2648
2651
  }
2649
- function vo(e) {
2652
+ function yo(e) {
2650
2653
  const t = e.scrollWidth - e.clientWidth;
2651
2654
  e.toggleAttribute("data-under-start", e.scrollLeft > 0.5), e.toggleAttribute("data-under-end", e.scrollLeft < t - 0.5);
2652
2655
  }
2653
- function yo(e) {
2656
+ function _o(e) {
2654
2657
  for (const t of Array.from(e.querySelectorAll("tbody > tr[data-line='header']"))) {
2655
2658
  const n = t.cells[t.cells.length - 1], o = !!n && n.getBoundingClientRect().top > t.getBoundingClientRect().top + 0.5;
2656
2659
  t.toggleAttribute("data-stuck", o);
2657
2660
  }
2658
2661
  }
2659
- function zl(e, t) {
2662
+ function Kl(e, t) {
2660
2663
  const n = t.state.editing?.line;
2661
2664
  Z(() => {
2662
2665
  const o = e.hook;
2663
2666
  !o || n === void 0 || n === he || o.rows.some((r) => Ue(o.rowKey(r)) === n) || t.setState((r) => ({ ...r, editing: null }));
2664
2667
  });
2665
2668
  }
2666
- function Kl(e, t) {
2669
+ function Gl(e, t) {
2667
2670
  Z(() => {
2668
2671
  const n = e.current;
2669
2672
  if (n?.parentElement && !t && n.parentElement.style.removeProperty("scroll-padding-top"), !n || !t) return;
2670
2673
  const o = n.tHead?.getBoundingClientRect().height ?? 0, r = n.querySelector("tr[data-line='header']")?.getBoundingClientRect().height ?? 0;
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);
2674
+ 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 && _o(n.parentElement);
2672
2675
  });
2673
2676
  }
2674
- function Gl(e, t) {
2677
+ function jl(e, t) {
2675
2678
  Z(() => {
2676
2679
  const n = e.takeFocusBeforeFold(), o = t.current;
2677
2680
  if (!n || !o || n.table !== o || n.element.isConnected) return;
@@ -2682,7 +2685,7 @@ function Gl(e, t) {
2682
2685
  }
2683
2686
  });
2684
2687
  }
2685
- function jl(e, t, n) {
2688
+ function Hl(e, t, n) {
2686
2689
  const o = q(null);
2687
2690
  Z(() => {
2688
2691
  const r = t.current?.tBodies[0];
@@ -2696,13 +2699,13 @@ function jl(e, t, n) {
2696
2699
  s && i?.cells.length === s.length && Array.from(i.cells).forEach((l, c) => l.style.width = `${s[c]}px`);
2697
2700
  });
2698
2701
  }
2699
- function Hl(e) {
2700
- xe(() => {
2702
+ function Wl(e) {
2703
+ Ce(() => {
2701
2704
  const t = e.current;
2702
2705
  if (!(!Gt || !t)) {
2703
2706
  for (const n of Array.from(t.querySelectorAll(`tbody .${h.value}`))) {
2704
2707
  if (n.scrollHeight <= n.clientHeight + 1) continue;
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}`;
2708
+ 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}`;
2706
2709
  X(
2707
2710
  `taller-than-a-row:${s}`,
2708
2711
  `a value in "${s}" is taller than a row and is cut at its edge. A row's height never follows what it shows (ADR-0042): draw it with a small control, or show it whole in the row's detail.`
@@ -2718,23 +2721,23 @@ function Hl(e) {
2718
2721
  }
2719
2722
  });
2720
2723
  }
2721
- function Wl(e, t) {
2724
+ function ql(e, t) {
2722
2725
  Z(() => {
2723
- const n = t.current?.tHead?.rows[0]?.getBoundingClientRect().height;
2726
+ const n = t.current?.tHead?.rows?.[0]?.getBoundingClientRect().height;
2724
2727
  n && e.hook?.tableState.virtual && e.hook.tableState.setPitch(n);
2725
2728
  });
2726
2729
  }
2727
2730
  const Yt = (e, t) => e ? t : void 0;
2728
- function ql({
2731
+ function Yl({
2729
2732
  registry: e,
2730
2733
  hook: t,
2731
2734
  props: n,
2732
2735
  drafting: o,
2733
2736
  sticking: r
2734
2737
  }) {
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,
2738
+ const { selectable: s = !1, loading: i = !1, grid: l = !1 } = n, c = t.publicSnapshot, a = e.projection(), u = e.rowHeader(), d = Qn(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) : [], C = (oe) => v.find((W) => W.spec.id === oe), y = g && w.length > 1 ? C(w.at(-1)) : void 0, _ = g ? d.filter((oe) => !w.includes(oe.spec.id)) : d, k = a.entries, S = k ? Pl(k, t, c, _[0]) : void 0, A = b !== null && !k, L = (s ? 1 : 0) + (A ? 1 : 0), x = 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 = x + _.length + (R ? 1 : 0), D = e.pins(), $ = _.filter((oe) => D[oe.spec.id] === "start").length, P = _.filter((oe) => D[oe.spec.id] === "end").length, K = y !== void 0 && D[y.spec.id] === "start", Y = p.length > 0 || n.onRowDelete !== void 0 || o, ce = e.actionsPinned() ? Y : o && M, j = {
2739
+ start: $ > 0 || K ? x + $ : 0,
2740
+ end: P > 0 ? P + (R ? 1 : 0) : R && ce ? 1 : 0,
2738
2741
  count: E
2739
2742
  }, ne = {
2740
2743
  start: r.start ? j.start : 0,
@@ -2750,19 +2753,19 @@ function ql({
2750
2753
  virtual: m,
2751
2754
  grouping: w,
2752
2755
  lines: g,
2753
- entryOf: x,
2756
+ entryOf: C,
2754
2757
  spanEntry: y,
2755
2758
  dataColumns: _,
2756
- entries: S,
2757
- tree: C,
2759
+ entries: k,
2760
+ tree: S,
2758
2761
  expanderColumn: A,
2759
2762
  controlColumns: L,
2760
- leading: k,
2763
+ leading: x,
2761
2764
  rowMode: O,
2762
2765
  rowTools: M,
2763
2766
  trailing: R,
2764
2767
  columnCount: E,
2765
- pins: B,
2768
+ pins: D,
2766
2769
  pinned: j,
2767
2770
  blocks: ne,
2768
2771
  rows: de,
@@ -2770,7 +2773,7 @@ function ql({
2770
2773
  restricted: ee
2771
2774
  };
2772
2775
  }
2773
- const Yl = 2;
2776
+ const Ul = 2;
2774
2777
  function yn({
2775
2778
  actions: e,
2776
2779
  row: t,
@@ -2778,8 +2781,8 @@ function yn({
2778
2781
  wording: o,
2779
2782
  line: r
2780
2783
  }) {
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);
2782
- xe(() => {
2784
+ const s = _e(Ve), 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);
2785
+ Ce(() => {
2783
2786
  c ? b.current?.focus() : u.current && d.current?.focus(), u.current = c;
2784
2787
  }, [c]);
2785
2788
  const p = (w) => {
@@ -2793,7 +2796,7 @@ function yn({
2793
2796
  }, children: o.deleteRow }),
2794
2797
  /* @__PURE__ */ f(Q, { ref: b, size: "sm", variant: "ghost", "aria-label": o.rowAction(o.keepRow, n), onClick: () => a(!1), children: o.keepRow })
2795
2798
  ] }) : /* @__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: [
2799
+ return e.length <= Ul ? /* @__PURE__ */ T("div", { className: B(h.actions, c && h.decision), children: [
2797
2800
  !c && e.map(({ key: w, spec: g }) => /* @__PURE__ */ f(
2798
2801
  Q,
2799
2802
  {
@@ -2806,21 +2809,21 @@ function yn({
2806
2809
  w
2807
2810
  )),
2808
2811
  m
2809
- ] }) : /* @__PURE__ */ T("div", { className: D(h.actions, c && h.decision), children: [
2812
+ ] }) : /* @__PURE__ */ T("div", { className: B(h.actions, c && h.decision), children: [
2810
2813
  !c && /* @__PURE__ */ f(
2811
2814
  Nn,
2812
2815
  {
2813
2816
  align: "end",
2814
- trigger: /* @__PURE__ */ f(Bo, { size: "sm", variant: "ghost", "aria-label": o.rowActionsMenu(n), children: "⋯" }),
2817
+ trigger: /* @__PURE__ */ f(Po, { size: "sm", variant: "ghost", "aria-label": o.rowActionsMenu(n), children: "⋯" }),
2815
2818
  children: e.map(({ key: w, spec: g }) => /* @__PURE__ */ f(nt, { tone: g.tone, onSelect: () => p(g), children: g.label }, w))
2816
2819
  }
2817
2820
  ),
2818
2821
  m
2819
2822
  ] });
2820
2823
  }
2821
- function Ul({ name: e, wording: t }) {
2822
- const n = _e(Pe), o = q(null);
2823
- return /* @__PURE__ */ T("div", { ref: o, className: D(h.actions, h.decision, h.draftButtons), children: [
2824
+ function Jl({ name: e, wording: t }) {
2825
+ const n = _e(Ve), o = q(null);
2826
+ return /* @__PURE__ */ T("div", { ref: o, className: B(h.actions, h.decision, h.draftButtons), children: [
2824
2827
  /* @__PURE__ */ f(Q, { className: h.toned, size: "sm", variant: "primary", "aria-label": t.rowAction(t.saveRow, e), onClick: n.save, children: t.saveRow }),
2825
2828
  /* @__PURE__ */ f(Q, { size: "sm", variant: "ghost", "aria-label": t.rowAction(t.discardRow, e), onClick: n.discard, children: t.discardRow }),
2826
2829
  /* @__PURE__ */ f(
@@ -2838,12 +2841,12 @@ function Ul({ name: e, wording: t }) {
2838
2841
  )
2839
2842
  ] });
2840
2843
  }
2841
- function Jl({ columns: e, rightAligned: t = [], rows: n = 4 }) {
2844
+ function Xl({ columns: e, rightAligned: t = [], rows: n = 4 }) {
2842
2845
  const o = [72, 48, 60, 40, 56, 64];
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)) });
2846
+ 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: B(h.td, t[l] && h.numeric), children: /* @__PURE__ */ f("span", { className: h.skeleton, style: { width: `${o[(s + l) % o.length]}%` } }) }, l)) }, s)) });
2844
2847
  }
2845
- const _o = /* @__PURE__ */ rt(0);
2846
- function Dt({ height: e, colSpan: t }) {
2848
+ const xo = /* @__PURE__ */ rt(0);
2849
+ function Bt({ height: e, colSpan: t }) {
2847
2850
  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 } }) });
2848
2851
  }
2849
2852
  function ko({
@@ -2872,18 +2875,18 @@ function ko({
2872
2875
  const m = p.target.closest("[data-row]");
2873
2876
  m && a(Number(m.dataset.row));
2874
2877
  },
2875
- children: /* @__PURE__ */ T(_o, { value: d, children: [
2876
- /* @__PURE__ */ f(Dt, { height: r, colSpan: t }),
2878
+ children: /* @__PURE__ */ T(xo, { value: d, children: [
2879
+ /* @__PURE__ */ f(Bt, { height: r, colSpan: t }),
2877
2880
  n,
2878
- /* @__PURE__ */ f(Dt, { height: s, colSpan: t })
2881
+ /* @__PURE__ */ f(Bt, { height: s, colSpan: t })
2879
2882
  ] })
2880
2883
  }
2881
2884
  );
2882
2885
  }
2883
- function Xl(e, t, n, o, r) {
2886
+ function Ql(e, t, n, o, r) {
2884
2887
  if (!t) return n.rowKey(e);
2885
2888
  const s = t.read(e);
2886
- return se(s) ? r.cellAbsentValue : Ve(s, t.spec.format, o, r) ?? n.rowKey(e);
2889
+ return se(s) ? r.cellAbsentValue : Pe(s, t.spec.format, o, r) ?? n.rowKey(e);
2887
2890
  }
2888
2891
  function So({
2889
2892
  row: e,
@@ -2904,28 +2907,28 @@ function So({
2904
2907
  line: w,
2905
2908
  tree: g,
2906
2909
  spanEntry: v,
2907
- grid: x,
2910
+ grid: C,
2908
2911
  trailing: y,
2909
2912
  fresh: _ = !1
2910
2913
  }) {
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;
2914
+ const k = _e(xo), S = r.publicSnapshot, A = _ ? he : r.rowKey(e), L = _ ? m.newRow : Ql(e, i, r, p, m), x = _ ? he : Ue(A), O = _e(Ve)?.editing, M = O?.row === !0 && O.line === x, R = o.detail, E = _ ? void 0 : g?.entry(e), D = _ ? null : vo(o, S, e, A, E), $ = D !== null, P = D?.open ?? !1, K = D?.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
2915
  return /* @__PURE__ */ T(re, { children: [
2913
2916
  /* @__PURE__ */ T(
2914
2917
  "tr",
2915
2918
  {
2916
2919
  ...j,
2917
- className: D(
2920
+ className: B(
2918
2921
  ce,
2919
2922
  ne && h.virtualRow,
2920
2923
  E && h.treeRow,
2921
2924
  ge && h.branchRow,
2922
2925
  E?.pathOnly && h.pathRow
2923
2926
  ),
2924
- "data-before-root": E && !V && g?.beforeRoot(A) ? "" : void 0,
2927
+ "data-before-root": E && !P && g?.beforeRoot(A) ? "" : void 0,
2925
2928
  "data-row": ne ? n : void 0,
2926
2929
  "data-line": w ? "row" : void 0,
2927
2930
  "data-motion": A,
2928
- "data-selected": l && C.selection.isSelected(A) ? "" : void 0,
2931
+ "data-selected": l && S.selection.isSelected(A) ? "" : void 0,
2929
2932
  "data-group-first": w?.first ? "" : void 0,
2930
2933
  "data-group": de?.path,
2931
2934
  "aria-level": w ? w.parents.length + 1 : E ? E.level + 1 : void 0,
@@ -2933,35 +2936,35 @@ function So({
2933
2936
  "aria-setsize": de ? de.rows.length : E?.siblings,
2934
2937
  "aria-expanded": ge ? E.expanded : void 0,
2935
2938
  "data-branch": ge ? E.expanded ? "open" : "closed" : void 0,
2936
- tabIndex: ne && !x ? n === S ? 0 : -1 : void 0,
2937
- "data-grid-line": x ? k : void 0,
2939
+ tabIndex: ne && !C ? n === k ? 0 : -1 : void 0,
2940
+ "data-grid-line": C ? x : void 0,
2938
2941
  "data-draft": M ? "" : void 0,
2939
2942
  "data-even": ne && n % 2 === 1 ? "" : void 0,
2940
2943
  "aria-rowindex": ne ? n + 2 : void 0,
2941
2944
  children: [
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(
2945
+ _ && Array.from({ length: ee + (v ? 1 : 0) }, (F, ae) => /* @__PURE__ */ f("td", { className: B(h.td, ae < ee && h.control, W(ae).className), style: W(ae).style }, ae)),
2946
+ !_ && l && /* @__PURE__ */ f("td", { className: B(h.td, h.control, W(0).className), style: W(0).style, children: /* @__PURE__ */ f(
2944
2947
  We,
2945
2948
  {
2946
2949
  "aria-label": m.selectRow(L),
2947
- checked: C.selection.isSelected(A),
2948
- onChange: () => C.selection.toggle(A)
2950
+ checked: S.selection.isSelected(A),
2951
+ onChange: () => S.selection.toggle(A)
2949
2952
  }
2950
2953
  ) }),
2951
- !_ && le && /* @__PURE__ */ f("td", { className: D(h.td, h.control, W(ee - 1).className), style: W(ee - 1).style, children: $ && /* @__PURE__ */ f(
2954
+ !_ && le && /* @__PURE__ */ f("td", { className: B(h.td, h.control, W(ee - 1).className), style: W(ee - 1).style, children: $ && /* @__PURE__ */ f(
2952
2955
  "button",
2953
2956
  {
2954
2957
  type: "button",
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),
2958
+ "aria-expanded": P,
2959
+ "aria-controls": P ? Y : void 0,
2960
+ "aria-label": P ? m.collapseRowNamed(L) : m.expandRowNamed(L),
2961
+ className: B(h.expander, P && h.expanderOpen),
2962
+ onClick: () => S.toggleRow(A),
2960
2963
  children: /* @__PURE__ */ f(Vo, {})
2961
2964
  }
2962
2965
  ) }),
2963
2966
  w && w.span && /* @__PURE__ */ f(
2964
- Ol,
2967
+ El,
2965
2968
  {
2966
2969
  line: { ...w, span: w.span },
2967
2970
  entry: v,
@@ -2973,7 +2976,7 @@ function So({
2973
2976
  }
2974
2977
  ),
2975
2978
  s.map((F, ae) => /* @__PURE__ */ f(
2976
- ea,
2979
+ ta,
2977
2980
  {
2978
2981
  entry: F,
2979
2982
  row: e,
@@ -2981,34 +2984,34 @@ function So({
2981
2984
  pin: W(oe + ae),
2982
2985
  formats: p,
2983
2986
  wording: m,
2984
- line: k,
2987
+ line: x,
2985
2988
  rowName: L,
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
2989
+ width: S.widths[F.spec.id],
2990
+ tree: E && F === g?.column ? { setup: g, entry: E, detail: $ && !ge ? { open: P, toggle: () => S.toggleRow(A) } : void 0 } : void 0
2988
2991
  },
2989
2992
  F.key
2990
2993
  )),
2991
2994
  y && /* @__PURE__ */ f(
2992
- Ql,
2995
+ Zl,
2993
2996
  {
2994
2997
  draft: M,
2995
2998
  actions: _ ? [] : c,
2996
2999
  row: e,
2997
3000
  name: L,
2998
3001
  wording: m,
2999
- line: k,
3002
+ line: x,
3000
3003
  pin: W(u - 1)
3001
3004
  }
3002
3005
  )
3003
3006
  ]
3004
3007
  }
3005
3008
  ),
3006
- V && /* @__PURE__ */ f(
3007
- Zl,
3009
+ P && /* @__PURE__ */ f(
3010
+ ea,
3008
3011
  {
3009
3012
  id: Y,
3010
3013
  group: de?.path,
3011
- gridLine: x ? `detail:${A}` : void 0,
3014
+ gridLine: C ? `detail:${A}` : void 0,
3012
3015
  beforeRoot: E && g?.beforeRoot(A) ? "" : void 0,
3013
3016
  colSpan: u,
3014
3017
  entry: E,
@@ -3017,7 +3020,7 @@ function So({
3017
3020
  )
3018
3021
  ] });
3019
3022
  }
3020
- function Ql({
3023
+ function Zl({
3021
3024
  draft: e,
3022
3025
  actions: t,
3023
3026
  row: n,
@@ -3026,12 +3029,12 @@ function Ql({
3026
3029
  line: s,
3027
3030
  pin: i
3028
3031
  }) {
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: [
3030
- /* @__PURE__ */ f(Ul, { name: o, wording: r }),
3032
+ return /* @__PURE__ */ f("td", { className: B(h.td, h.actionsCell, i.className, e && h.editing), style: i.style, children: e ? /* @__PURE__ */ T(re, { children: [
3033
+ /* @__PURE__ */ f(Jl, { name: o, wording: r }),
3031
3034
  /* @__PURE__ */ f("span", { className: h.held, "aria-hidden": "true", children: /* @__PURE__ */ f(yn, { actions: t, row: n, name: o, wording: r, line: s }) })
3032
3035
  ] }) : /* @__PURE__ */ f(yn, { actions: t, row: n, name: o, wording: r, line: s }) });
3033
3036
  }
3034
- function Zl({
3037
+ function ea({
3035
3038
  id: e,
3036
3039
  group: t,
3037
3040
  gridLine: n,
@@ -3044,13 +3047,13 @@ function Zl({
3044
3047
  "td",
3045
3048
  {
3046
3049
  colSpan: r,
3047
- className: D(h.detailCell, s && h.treeDetail),
3048
- style: s ? { "--tree-level": s.level } : void 0,
3050
+ className: B(h.detailCell, s && h.treeDetail),
3051
+ style: s ? { "--_table-tree-level": s.level } : void 0,
3049
3052
  children: s ? /* @__PURE__ */ f("div", { className: h.treeDetailRail, children: i }) : i
3050
3053
  }
3051
3054
  ) });
3052
3055
  }
3053
- function ea({
3056
+ function ta({
3054
3057
  entry: e,
3055
3058
  row: t,
3056
3059
  kind: n,
@@ -3062,25 +3065,25 @@ function ea({
3062
3065
  tree: c,
3063
3066
  width: a
3064
3067
  }) {
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";
3068
+ const { spec: u } = e, d = e.read(t), b = Vt(n, u.rightAligned), p = yl(i, u.id), w = !(_e(Ve) !== null) || u.edit === void 0 ? void 0 : u.edit === "text" || u.edit === "number" ? "type" : "pick";
3066
3069
  let g;
3067
- se(d) ? g = /* @__PURE__ */ f(ho, { wording: s }) : u.presentation ? g = u.presentation(d, t) : g = Ve(d, u.format, r, s);
3070
+ se(d) ? g = /* @__PURE__ */ f(go, { wording: s }) : u.presentation ? g = u.presentation(d, t) : g = Pe(d, u.format, r, s);
3068
3071
  const v = typeof g == "string";
3069
3072
  g = /* @__PURE__ */ f(
3070
3073
  "div",
3071
3074
  {
3072
- className: D(h.value, v && h.valueText, a !== void 0 && h.sized, p && h.editingValue),
3073
- style: a !== void 0 ? { "--_width": `${a}px` } : void 0,
3075
+ className: B(h.value, v && h.valueText, a !== void 0 && h.sized, p && h.editingValue),
3076
+ style: a !== void 0 ? { "--_table-width": `${a}px` } : void 0,
3074
3077
  "aria-hidden": p ? !0 : void 0,
3075
3078
  children: g
3076
3079
  }
3077
3080
  ), c && (g = /* @__PURE__ */ f(Dl, { ...c, name: l, wording: s, children: g }));
3078
- const x = u.rowHeader ? "th" : "td";
3081
+ const C = u.rowHeader ? "th" : "td";
3079
3082
  return /* @__PURE__ */ T(
3080
- x,
3083
+ C,
3081
3084
  {
3082
3085
  scope: u.rowHeader ? "row" : void 0,
3083
- className: D(h.td, b && h.numeric, u.rowHeader && h.rowHeader, o.className, p && h.editing),
3086
+ className: B(h.td, b && h.numeric, u.rowHeader && h.rowHeader, o.className, p && h.editing),
3084
3087
  style: o.style,
3085
3088
  "data-edit": w,
3086
3089
  "data-editing": p ? u.id : void 0,
@@ -3091,7 +3094,7 @@ function ea({
3091
3094
  }
3092
3095
  );
3093
3096
  }
3094
- function Bt(e, t, n, o, r) {
3097
+ function Dt(e, t, n, o, r) {
3095
3098
  const { registry: s, hook: i, layout: l } = e;
3096
3099
  return /* @__PURE__ */ f(
3097
3100
  So,
@@ -3120,7 +3123,7 @@ function Bt(e, t, n, o, r) {
3120
3123
  i.rowKey(t)
3121
3124
  );
3122
3125
  }
3123
- function ta(e, t) {
3126
+ function na(e, t) {
3124
3127
  const { registry: n, hook: o, layout: r } = e;
3125
3128
  return /* @__PURE__ */ f("tbody", { children: /* @__PURE__ */ f(
3126
3129
  So,
@@ -3149,38 +3152,38 @@ function ta(e, t) {
3149
3152
  he
3150
3153
  ) });
3151
3154
  }
3152
- function na(e) {
3155
+ function oa(e) {
3153
3156
  const { registry: t, hook: n, layout: o } = e;
3154
3157
  return /* @__PURE__ */ f("tbody", { children: /* @__PURE__ */ f(
3155
- Jl,
3158
+ Xl,
3156
3159
  {
3157
3160
  columns: o.columnCount,
3158
3161
  rows: e.pageSize ? e.heldLines || e.pageSize : void 0,
3159
3162
  rightAligned: [
3160
3163
  ...Array.from({ length: o.controlColumns + (o.spanEntry ? 1 : 0) }, () => !1),
3161
- ...o.dataColumns.map((r) => Pt(t.kindOf(r, n.rows), r.spec.rightAligned))
3164
+ ...o.dataColumns.map((r) => Vt(t.kindOf(r, n.rows), r.spec.rightAligned))
3162
3165
  ]
3163
3166
  }
3164
3167
  ) });
3165
3168
  }
3166
- function oa(e) {
3169
+ function ra(e) {
3167
3170
  const { hook: t, layout: n, wording: o } = e, { snapshot: r } = n;
3168
3171
  return /* @__PURE__ */ f("tbody", { children: /* @__PURE__ */ f("tr", { "data-grid-line": Yt(e.gridMode, "empty"), children: /* @__PURE__ */ f(
3169
3172
  "td",
3170
3173
  {
3171
3174
  colSpan: n.columnCount,
3172
3175
  className: h.emptyCell,
3173
- style: e.pageSize && e.heldLines ? { height: `calc(var(--_pitch) * ${e.heldLines})`, verticalAlign: "top" } : void 0,
3176
+ style: e.pageSize && e.heldLines ? { height: `calc(var(--_table-pitch) * ${e.heldLines})`, verticalAlign: "top" } : void 0,
3174
3177
  children: /* @__PURE__ */ f("div", { className: h.empty, children: (r.server || t.admitted.length > 0) && n.restricted ? /* @__PURE__ */ T(re, { children: [
3175
3178
  /* @__PURE__ */ f("p", { className: h.emptyTitle, children: o.nothingMatchesFilters }),
3176
- /* @__PURE__ */ f(Q, { size: "sm", variant: "ghost", onClick: () => Qn(r), children: o.resetAll })
3179
+ /* @__PURE__ */ f(Q, { size: "sm", variant: "ghost", onClick: () => Zn(r), children: o.resetAll })
3177
3180
  ] }) : e.empty ?? /* @__PURE__ */ f("p", { className: h.emptyTitle, children: o.noEntries }) })
3178
3181
  }
3179
3182
  ) }) });
3180
3183
  }
3181
- function ra(e, t) {
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(
3183
- El,
3184
+ function sa(e, t) {
3185
+ const { hook: n, layout: o, wording: r, formats: s } = e, { virtual: i, grouping: l, projection: c } = o, a = i ? Bn(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(
3186
+ Ml,
3184
3187
  {
3185
3188
  line: m,
3186
3189
  index: g,
@@ -3203,7 +3206,7 @@ function ra(e, t) {
3203
3206
  w
3204
3207
  ), p = (m, w) => {
3205
3208
  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(
3209
+ return g < 0 ? m.kind === "row" ? null : b(m, `${m.kind}:${m.group.path}:repeated`, w, void 0) : m.kind === "row" ? Dt(e, m.row, g, v, m) : b(
3207
3210
  m,
3208
3211
  `${m.kind}:${m.group.path}${m.kind === "header" && m.continued ? ":continued" : ""}`,
3209
3212
  g,
@@ -3222,17 +3225,17 @@ function ra(e, t) {
3222
3225
  e.filler
3223
3226
  ] });
3224
3227
  }
3225
- function sa(e, t, n, o) {
3226
- return n && t > 0 && t < e ? /* @__PURE__ */ f(Dt, { height: `calc(var(--_pitch) * ${e - t})`, colSpan: o }) : null;
3228
+ function ia(e, t, n, o) {
3229
+ return n && t > 0 && t < e ? /* @__PURE__ */ f(Bt, { height: `calc(var(--_table-pitch) * ${e - t})`, colSpan: o }) : null;
3227
3230
  }
3228
- function ia(e, t, n) {
3231
+ function la(e, t, n) {
3229
3232
  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)) }),
3233
+ return t && !n ? { body: oa(e), empty: !1 } : l.filtered.length === 0 ? { body: ra(e), empty: !0 } : s ? { body: sa(e, s), empty: !1 } : r ? {
3234
+ body: /* @__PURE__ */ f(ko, { virtual: r, colSpan: o.columnCount, children: i.map((c, a) => Dt(e, c, a, r.from + a)) }),
3232
3235
  empty: !1
3233
3236
  } : {
3234
3237
  body: /* @__PURE__ */ T("tbody", { children: [
3235
- i.map((c, a) => Bt(e, c, a, a)),
3238
+ i.map((c, a) => Dt(e, c, a, a)),
3236
3239
  e.filler
3237
3240
  ] }),
3238
3241
  empty: !1
@@ -3244,54 +3247,54 @@ function _n({
3244
3247
  hook: n,
3245
3248
  pin: o
3246
3249
  }) {
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) => {
3248
- S.stopPropagation(), S.preventDefault();
3249
- const C = S.currentTarget, A = C.closest("th");
3250
+ const { spec: r } = e, s = n.publicSnapshot, i = t.kindOf(e, n.rows), l = Vt(i, r.rightAligned), c = t.isSortable(e, n.rows), a = r.id, u = s.sort.findIndex((k) => k.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 = (k) => {
3251
+ k.stopPropagation(), k.preventDefault();
3252
+ const S = k.currentTarget, A = S.closest("th");
3250
3253
  if (!A) return;
3251
- const L = S.clientX, k = A.getBoundingClientRect().width, O = S.pointerId;
3252
- C.setPointerCapture(O);
3254
+ const L = k.clientX, x = A.getBoundingClientRect().width, O = k.pointerId;
3255
+ S.setPointerCapture(O);
3253
3256
  const M = (E) => {
3254
- E.pointerId === O && s.setWidth(a, Math.max(m, k + (E.clientX - L)));
3257
+ E.pointerId === O && s.setWidth(a, Math.max(m, x + (E.clientX - L)));
3255
3258
  }, R = (E) => {
3256
- E.pointerId === O && (C.removeEventListener("pointermove", M), C.removeEventListener("pointerup", R), C.removeEventListener("pointercancel", R), C.hasPointerCapture(O) && C.releasePointerCapture(O));
3259
+ E.pointerId === O && (S.removeEventListener("pointermove", M), S.removeEventListener("pointerup", R), S.removeEventListener("pointercancel", R), S.hasPointerCapture(O) && S.releasePointerCapture(O));
3257
3260
  };
3258
- C.addEventListener("pointermove", M), C.addEventListener("pointerup", R), C.addEventListener("pointercancel", R);
3259
- }, g = (S) => {
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";
3261
+ S.addEventListener("pointermove", M), S.addEventListener("pointerup", R), S.addEventListener("pointercancel", R);
3262
+ }, g = (k) => {
3263
+ const S = k?.parentElement, A = k?.closest("table");
3264
+ if (!k || !S || !A) return;
3265
+ const L = Array.from(S.children).indexOf(k), x = S.children.length, O = { cell: k.style.width, table: A.style.width };
3266
+ k.style.width = "", A.style.width = "auto";
3264
3267
  let M = 0;
3265
3268
  for (const R of Array.from(A.rows)) {
3266
- if (R.cells.length !== k) continue;
3269
+ if (R.cells.length !== x) continue;
3267
3270
  const E = R.cells[L];
3268
3271
  if (!E) continue;
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);
3272
+ const D = E.querySelector(`.${h.value}`), $ = getComputedStyle(E), P = (parseFloat($.paddingLeft) || 0) + (parseFloat($.paddingRight) || 0), K = E.querySelector(`.${h.headLabel}`), Y = K ? K.scrollWidth - K.clientWidth : 0;
3273
+ M = Math.max(M, E.scrollWidth + Y, D ? D.scrollWidth + P : 0);
3271
3274
  }
3272
- S.style.width = O.cell, A.style.width = O.table, M > 0 && s.setWidth(a, Math.max(m, M + 1));
3273
- }, v = (S) => {
3274
- if (!r.resizable || !S.altKey) return;
3275
- const C = S.key === "ArrowRight", A = S.key === "ArrowLeft", L = S.key === "Home";
3276
- if (!C && !A && !L) return;
3277
- S.preventDefault();
3278
- const k = S.currentTarget;
3275
+ k.style.width = O.cell, A.style.width = O.table, M > 0 && s.setWidth(a, Math.max(m, M + 1));
3276
+ }, v = (k) => {
3277
+ if (!r.resizable || !k.altKey) return;
3278
+ const S = k.key === "ArrowRight", A = k.key === "ArrowLeft", L = k.key === "Home";
3279
+ if (!S && !A && !L) return;
3280
+ k.preventDefault();
3281
+ const x = k.currentTarget;
3279
3282
  if (L) {
3280
- g(k);
3283
+ g(x);
3281
3284
  return;
3282
3285
  }
3283
- const O = k.getBoundingClientRect().width, M = S.shiftKey ? 32 : 8;
3284
- s.setWidth(a, Math.max(m, O + (C ? M : -M)));
3285
- }, x = c ? /* @__PURE__ */ T(
3286
+ const O = x.getBoundingClientRect().width, M = k.shiftKey ? 32 : 8;
3287
+ s.setWidth(a, Math.max(m, O + (S ? M : -M)));
3288
+ }, C = c ? /* @__PURE__ */ T(
3286
3289
  "button",
3287
3290
  {
3288
3291
  type: "button",
3289
- className: D(h.sortButton, h.headLine),
3290
- onClick: (S) => s.toggleSort(a, S.shiftKey || S.metaKey),
3292
+ className: B(h.sortButton, h.headLine),
3293
+ onClick: (k) => s.toggleSort(a, k.shiftKey || k.metaKey),
3291
3294
  children: [
3292
3295
  /* @__PURE__ */ f("span", { className: h.headLabel, children: r.label }),
3293
3296
  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" }) }) : (
3297
+ /* @__PURE__ */ f("span", { className: B(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: B(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" }) }) : (
3295
3298
  /* Drawn in the nominal box and set in the 12 pixels the indicator
3296
3299
  takes, so that the head does not move. */
3297
3300
  /* @__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" }) })
@@ -3307,25 +3310,25 @@ function _n({
3307
3310
  "aria-sort": c ? y : void 0,
3308
3311
  tabIndex: r.resizable && !c ? 0 : void 0,
3309
3312
  onKeyDown: v,
3310
- className: D(h.th, l && h.numeric, p !== void 0 && h.sized, o.className),
3313
+ className: B(h.th, l && h.numeric, p !== void 0 && h.sized, o.className),
3311
3314
  style: {
3312
3315
  ...p !== void 0 ? { width: p } : {},
3313
3316
  ...o.style
3314
3317
  },
3315
3318
  children: [
3316
3319
  _ ? /* @__PURE__ */ T("span", { className: h.thFlex, children: [
3317
- x,
3318
- /* @__PURE__ */ f(Wi, { entry: e, registry: t, hook: n })
3319
- ] }) : x,
3320
+ C,
3321
+ /* @__PURE__ */ f(qi, { entry: e, registry: t, hook: n })
3322
+ ] }) : C,
3320
3323
  r.resizable && /* @__PURE__ */ f(
3321
3324
  "span",
3322
3325
  {
3323
3326
  role: "presentation",
3324
3327
  className: h.grip,
3325
3328
  onPointerDown: w,
3326
- onClick: (S) => S.stopPropagation(),
3327
- onDoubleClick: (S) => {
3328
- S.stopPropagation(), g(S.currentTarget.closest("th"));
3329
+ onClick: (k) => k.stopPropagation(),
3330
+ onDoubleClick: (k) => {
3331
+ k.stopPropagation(), g(k.currentTarget.closest("th"));
3329
3332
  }
3330
3333
  }
3331
3334
  )
@@ -3333,16 +3336,16 @@ function _n({
3333
3336
  }
3334
3337
  );
3335
3338
  }
3336
- function la({
3339
+ function aa({
3337
3340
  registry: e,
3338
3341
  hook: t,
3339
3342
  layout: n,
3340
3343
  props: o,
3341
3344
  wording: r
3342
3345
  }) {
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);
3346
+ 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: C } = n, y = (_, k = _) => ct(C, _, k);
3344
3347
  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(
3348
+ s && /* @__PURE__ */ f("th", { scope: "col", className: B(h.th, h.control, y(0).className), style: y(0).style, children: /* @__PURE__ */ f(
3346
3349
  We,
3347
3350
  {
3348
3351
  "aria-label": l.server ? r.selectAllOnPage : r.selectAllRows,
@@ -3354,26 +3357,26 @@ function la({
3354
3357
  d && /* @__PURE__ */ f(
3355
3358
  "td",
3356
3359
  {
3357
- className: D(h.th, h.control, y(b - 1).className),
3360
+ className: B(h.th, h.control, y(b - 1).className),
3358
3361
  style: y(b - 1).style
3359
3362
  }
3360
3363
  ),
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)),
3364
+ 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: B(h.th, y(b).className), style: y(b).style, children: a.spec.label })),
3365
+ u.map((_, k) => /* @__PURE__ */ f(_n, { entry: _, registry: e, hook: t, pin: y(p + k) }, _.key)),
3363
3366
  g && /* @__PURE__ */ T(
3364
3367
  "th",
3365
3368
  {
3366
3369
  scope: "col",
3367
- className: D(h.th, h.actionsCell, y(v - 1).className),
3370
+ className: B(h.th, h.actionsCell, y(v - 1).className),
3368
3371
  style: y(v - 1).style,
3369
3372
  children: [
3370
3373
  /* @__PURE__ */ f(Oe, { children: r.rowActions }),
3371
3374
  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: [
3375
+ (m || o.onRowAdd) && /* @__PURE__ */ T("span", { className: B(h.actions, h.decision), children: [
3373
3376
  /* @__PURE__ */ f(Q, { tabIndex: -1, size: "sm", children: r.saveRow }),
3374
3377
  /* @__PURE__ */ f(Q, { tabIndex: -1, size: "sm", children: r.discardRow })
3375
3378
  ] }),
3376
- o.onRowDelete && /* @__PURE__ */ T("span", { className: D(h.actions, h.decision), children: [
3379
+ o.onRowDelete && /* @__PURE__ */ T("span", { className: B(h.actions, h.decision), children: [
3377
3380
  /* @__PURE__ */ f("span", { className: h.deleteAsk, children: r.deleteRowAsk }),
3378
3381
  /* @__PURE__ */ f(Q, { tabIndex: -1, size: "sm", children: r.deleteRow }),
3379
3382
  /* @__PURE__ */ f(Q, { tabIndex: -1, size: "sm", children: r.keepRow })
@@ -3384,7 +3387,7 @@ function la({
3384
3387
  )
3385
3388
  ] }) });
3386
3389
  }
3387
- function aa({
3390
+ function ca({
3388
3391
  layout: e,
3389
3392
  gridMode: t,
3390
3393
  formats: n,
@@ -3392,10 +3395,10 @@ function aa({
3392
3395
  }) {
3393
3396
  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
3397
  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 }),
3398
+ Array.from({ length: c }, (m, w) => /* @__PURE__ */ f("td", { className: B(h.td, h.control, p(w).className), style: p(w).style }, w)),
3399
+ i && /* @__PURE__ */ f("td", { className: B(h.td, p(c).className), style: p(c).style }),
3397
3400
  l.map((m, w) => /* @__PURE__ */ f(
3398
- ca,
3401
+ da,
3399
3402
  {
3400
3403
  entry: m,
3401
3404
  rows: r.roots ?? r.filtered,
@@ -3406,23 +3409,23 @@ function aa({
3406
3409
  },
3407
3410
  m.key
3408
3411
  )),
3409
- u && /* @__PURE__ */ f("td", { className: D(h.td, p(d - 1).className), style: p(d - 1).style })
3412
+ u && /* @__PURE__ */ f("td", { className: B(h.td, p(d - 1).className), style: p(d - 1).style })
3410
3413
  ] }) });
3411
3414
  }
3412
- function ca({
3415
+ function da({
3413
3416
  entry: e,
3414
3417
  rows: t,
3415
3418
  formats: n,
3416
3419
  wording: o,
3417
- pin: r = mo,
3420
+ pin: r = wo,
3418
3421
  topLevel: s = !1
3419
3422
  }) {
3420
- if (!e.spec.aggregate) return /* @__PURE__ */ f("td", { className: D(h.td, r.className), style: r.style });
3423
+ if (!e.spec.aggregate) return /* @__PURE__ */ f("td", { className: B(h.td, r.className), style: r.style });
3421
3424
  const i = typeof e.spec.aggregate == "function" ? "own" : e.spec.aggregate;
3422
3425
  return /* @__PURE__ */ T(
3423
3426
  "td",
3424
3427
  {
3425
- className: D(h.td, po(e, t) && h.numeric, r.className),
3428
+ className: B(h.td, mo(e, t) && h.numeric, r.className),
3426
3429
  style: r.style,
3427
3430
  "data-footer": i,
3428
3431
  title: s ? o.footerTopLevel : void 0,
@@ -3433,7 +3436,7 @@ function ca({
3433
3436
  }
3434
3437
  );
3435
3438
  }
3436
- function da({
3439
+ function ua({
3437
3440
  table: e,
3438
3441
  blocks: t,
3439
3442
  onSticking: n,
@@ -3445,7 +3448,7 @@ function da({
3445
3448
  }), l = () => {
3446
3449
  const c = e.current, a = c?.parentElement;
3447
3450
  if (!c || !a || (a.style.removeProperty("scroll-padding-left"), a.style.removeProperty("scroll-padding-right"), !r && !s)) return;
3448
- const u = Array.from(c.tHead?.rows[0]?.cells ?? []);
3451
+ const u = Array.from(c.tHead?.rows?.[0]?.cells ?? []);
3449
3452
  let d = 0;
3450
3453
  for (let g = 0; g < r; g++)
3451
3454
  c.style.setProperty(`--u-table-pin-start-${g}`, `${d}px`), d += u[g]?.getBoundingClientRect().width ?? 0;
@@ -3456,18 +3459,18 @@ function da({
3456
3459
  i.current.key !== p && (i.current = { key: p, sticking: i.current.sticking });
3457
3460
  const m = i.current;
3458
3461
  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);
3462
+ const w = ir(m.start ?? d, m.end ?? b, a.clientWidth);
3463
+ 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`), yo(a);
3461
3464
  };
3462
- return Z(l), xe(() => {
3465
+ return Z(l), Ce(() => {
3463
3466
  const c = e.current;
3464
3467
  if (!c || !r && !s || typeof ResizeObserver > "u") return;
3465
- const a = new ResizeObserver(l), u = Array.from(c.tHead?.rows[0]?.cells ?? []);
3468
+ const a = new ResizeObserver(l), u = Array.from(c.tHead?.rows?.[0]?.cells ?? []);
3466
3469
  for (const d of [...u.slice(0, r), ...u.slice(u.length - s)]) a.observe(d);
3467
3470
  return c.parentElement && a.observe(c.parentElement), () => a.disconnect();
3468
3471
  }, [e, r, s, t.count, o]), null;
3469
3472
  }
3470
- function ua({ table: e }) {
3473
+ function fa({ table: e }) {
3471
3474
  return Z(() => {
3472
3475
  const t = e.current?.parentElement;
3473
3476
  if (!t) return;
@@ -3477,20 +3480,20 @@ function ua({ table: e }) {
3477
3480
  return o.observe(t), () => o.disconnect();
3478
3481
  }, [e]), null;
3479
3482
  }
3480
- function fa({ table: e, blocks: t }) {
3483
+ function ha({ table: e, blocks: t }) {
3481
3484
  const n = q(t);
3482
3485
  return Z(() => {
3483
3486
  n.current = t;
3484
3487
  const o = e.current?.parentElement;
3485
3488
  o && Ft(o, t);
3486
- }), xe(() => {
3489
+ }), Ce(() => {
3487
3490
  const o = e.current, r = o?.parentElement;
3488
3491
  if (!o || !r || typeof ResizeObserver > "u") return;
3489
3492
  const s = new ResizeObserver(() => Ft(r, n.current));
3490
3493
  return s.observe(r), s.observe(o), () => s.disconnect();
3491
3494
  }, [e]), null;
3492
3495
  }
3493
- function ha({ registry: e, props: t }) {
3496
+ function ga({ registry: e, props: t }) {
3494
3497
  const {
3495
3498
  selectable: n = !1,
3496
3499
  stickyHeader: o = !1,
@@ -3504,20 +3507,20 @@ function ha({ registry: e, props: t }) {
3504
3507
  grid: d = !1
3505
3508
  } = t;
3506
3509
  st(e.subscribe, e.bodyVersion, e.bodyVersion);
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);
3509
- const C = e.hook && !e.hook.tableState.virtual ? e.hook.publicSnapshot : null;
3510
- nl(g, C ? `${C.grouping.join("|")}#${C.folded.join("|")}` : "");
3510
+ const b = ie(), p = xe(), m = Io(s, "regular"), w = be(), g = q(null), [v, C] = I(0), y = dl(), [_, k] = I({ start: !0, end: !0 });
3511
+ Kl(e, y), Gl(g, o), jl(e, g), Hl(e, g, c), Wl(g), ql(e, g);
3512
+ const S = e.hook && !e.hook.tableState.virtual ? e.hook.publicSnapshot : null;
3513
+ ol(g, S ? `${S.grouping.join("|")}#${S.folded.join("|")}` : "");
3511
3514
  const A = e.hook;
3512
3515
  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 });
3516
+ const L = y.state.editing?.row === !0, x = Yl({ registry: e, hook: A, props: t, drafting: L, sticking: _ }), { snapshot: O, projection: M, virtual: R, lines: E, entries: D, grouping: $, dataColumns: P, columnCount: K, pins: Y, pinned: ce, blocks: j, rows: ne, footerShown: de } = x, { lines: le, fresh: ee, ids: oe, events: W } = Vl({ registry: e, hook: A, props: t, layout: x, grid: y }), ge = $l({ registry: e, hook: A, grid: y, gridMode: d, gridLines: le, dataColumns: P, formats: p, wording: b, tableElement: () => g.current });
3514
3517
  e.setAddRow(W?.addRow ?? null);
3515
3518
  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);
3519
+ Ae > v && C(Ae);
3517
3520
  const ue = Math.min(Math.max(Ae, v, O.pageCount > 1 ? F : 0), F), Ne = c && ae > 0, Me = {
3518
3521
  registry: e,
3519
3522
  hook: A,
3520
- layout: k,
3523
+ layout: x,
3521
3524
  selectable: n,
3522
3525
  gridMode: d,
3523
3526
  empty: l,
@@ -3527,15 +3530,15 @@ function ha({ registry: e, props: t }) {
3527
3530
  wording: b,
3528
3531
  pageSize: F,
3529
3532
  heldLines: ue,
3530
- filler: sa(ue, ae, F, K)
3531
- }, pe = ia(Me, c, Ne);
3533
+ filler: ia(ue, ae, F, K)
3534
+ }, pe = la(Me, c, Ne);
3532
3535
  return /* @__PURE__ */ T(re, { children: [
3533
3536
  /* @__PURE__ */ T(
3534
3537
  "div",
3535
3538
  {
3536
3539
  ref: R?.scrollRef,
3537
3540
  onScroll: (U) => {
3538
- R?.onScroll(), E && o && yo(U.currentTarget), (j.start || j.end) && vo(U.currentTarget), Ft(U.currentTarget, j);
3541
+ R?.onScroll(), E && o && _o(U.currentTarget), (j.start || j.end) && yo(U.currentTarget), Ft(U.currentTarget, j);
3539
3542
  },
3540
3543
  onKeyDown: ge,
3541
3544
  onAnimationEnd: (U) => U.target.removeAttribute("data-copied"),
@@ -3546,8 +3549,8 @@ function ha({ registry: e, props: t }) {
3546
3549
  "table",
3547
3550
  {
3548
3551
  ref: g,
3549
- role: E || B ? "treegrid" : d ? "grid" : void 0,
3550
- "aria-readonly": d && !V.some((U) => U.spec.edit !== void 0) ? !0 : void 0,
3552
+ role: E || D ? "treegrid" : d ? "grid" : void 0,
3553
+ "aria-readonly": d && !P.some((U) => U.spec.edit !== void 0) ? !0 : void 0,
3551
3554
  onKeyDown: W?.onKeyDown,
3552
3555
  onFocus: W?.onFocus,
3553
3556
  onClick: W?.onClick,
@@ -3558,7 +3561,7 @@ function ha({ registry: e, props: t }) {
3558
3561
  "aria-rowcount": R ? (M.lines ?? M.shown ?? M.filtered).length + 1 + (de ? 1 : 0) : void 0,
3559
3562
  "aria-busy": c || void 0,
3560
3563
  "data-stale": Ne || void 0,
3561
- className: D(
3564
+ className: B(
3562
3565
  h.table,
3563
3566
  m === "compact" && h.compact,
3564
3567
  o && h.sticky,
@@ -3566,45 +3569,45 @@ function ha({ registry: e, props: t }) {
3566
3569
  d && h.grid
3567
3570
  ),
3568
3571
  children: [
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),
3572
+ /* @__PURE__ */ f(aa, { registry: e, hook: A, layout: x, props: t, wording: b }),
3573
+ /* @__PURE__ */ T(Ve, { value: W ? { ...W.context, hook: A, wording: b } : null, children: [
3574
+ ee && na(Me, ee),
3572
3575
  pe.body
3573
3576
  ] }),
3574
- de && /* @__PURE__ */ f(aa, { layout: k, gridMode: d, formats: p, wording: b })
3577
+ de && /* @__PURE__ */ f(ca, { layout: x, gridMode: d, formats: p, wording: b })
3575
3578
  ]
3576
3579
  }
3577
3580
  ) }),
3578
- pe.empty && /* @__PURE__ */ f(ua, { table: g }),
3579
- /* @__PURE__ */ f(fa, { table: g, blocks: j }),
3580
- /* @__PURE__ */ f($l, { table: g }),
3581
+ pe.empty && /* @__PURE__ */ f(fa, { table: g }),
3582
+ /* @__PURE__ */ f(ha, { table: g, blocks: j }),
3583
+ /* @__PURE__ */ f(zl, { table: g }),
3581
3584
  /* @__PURE__ */ f(
3582
- da,
3585
+ ua,
3583
3586
  {
3584
3587
  table: g,
3585
3588
  blocks: ce,
3586
- onSticking: (U) => S((Se) => Se.start === U.start && Se.end === U.end ? Se : U),
3587
- pinnedKeys: V.filter((U) => Y[U.spec.id]).map((U) => U.key).join("|")
3589
+ onSticking: (U) => k((ke) => ke.start === U.start && ke.end === U.end ? ke : U),
3590
+ pinnedKeys: P.filter((U) => Y[U.spec.id]).map((U) => U.key).join("|")
3588
3591
  }
3589
3592
  ),
3590
3593
  d && /* @__PURE__ */ f(
3591
- _l,
3594
+ xl,
3592
3595
  {
3593
3596
  table: g,
3594
3597
  grid: y,
3595
3598
  lines: le,
3596
3599
  ids: oe,
3597
- editable: V.some((U) => U.spec.edit !== void 0) ? W?.editable : void 0,
3600
+ editable: P.some((U) => U.spec.edit !== void 0) ? W?.editable : void 0,
3598
3601
  outside: W?.outside
3599
3602
  }
3600
3603
  )
3601
3604
  ]
3602
3605
  }
3603
3606
  ),
3604
- e.rowAdding && !e.showsToolbar() && /* @__PURE__ */ f("div", { className: h.newRowBar, children: /* @__PURE__ */ f(so, { registry: e }) })
3607
+ e.rowAdding && !e.showsToolbar() && /* @__PURE__ */ f("div", { className: h.newRowBar, children: /* @__PURE__ */ f(io, { registry: e }) })
3605
3608
  ] });
3606
3609
  }
3607
- function ga(e) {
3610
+ function pa(e) {
3608
3611
  const t = typeof e.value == "string" ? e.value : void 0;
3609
3612
  let n = e.id ?? t;
3610
3613
  return n === void 0 && (X(`without-id:${e.label}`, `The column "${e.label}" has a computed value but no id. Its label serves as the id.`), n = e.label), e.children !== void 0 && typeof e.children != "function" && X(`children:${n}`, `The children of the column "${n}" are not a function and are passed over.`), {
@@ -3644,9 +3647,9 @@ function Ge(e, t, n, o, r) {
3644
3647
  o(), r && e.checkOrder(), e.commit();
3645
3648
  });
3646
3649
  }
3647
- function pa(e) {
3650
+ function ma(e) {
3648
3651
  function t(c) {
3649
- const a = be(), u = _e(Rt), d = ga(c);
3652
+ const a = be(), u = _e(Rt), d = pa(c);
3650
3653
  return e.registerColumn(a, d), Ge(e, a, () => e.removeColumn(a), () => {
3651
3654
  e.ensureColumn(a, d);
3652
3655
  }, !0), Gt && u && u.registry !== e && X(
@@ -3699,47 +3702,47 @@ function pa(e) {
3699
3702
  e.children = a.current, e.checkOrder(), e.commit();
3700
3703
  });
3701
3704
  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: [
3705
+ return /* @__PURE__ */ f(Rt, { value: b, children: /* @__PURE__ */ T("div", { className: B(h.frame, c.className), children: [
3703
3706
  /* @__PURE__ */ f("div", { ref: a, className: h.children, children: c.children }),
3704
- /* @__PURE__ */ f(ma, { registry: e }),
3705
- /* @__PURE__ */ f(ha, { registry: e, props: c }),
3707
+ /* @__PURE__ */ f(wa, { registry: e }),
3708
+ /* @__PURE__ */ f(ga, { registry: e, props: c }),
3706
3709
  /* @__PURE__ */ f("div", { ref: d, className: h.footerTarget })
3707
3710
  ] }) });
3708
3711
  }
3709
3712
  const l = { Table: i, Column: t, RowDetail: n, RowActions: o, Action: r, GroupBy: s };
3710
- return Pi(i, e), l;
3713
+ return Ii(i, e), l;
3711
3714
  }
3712
- function ma({ registry: e }) {
3713
- return st(e.subscribe, e.bodyVersion, e.bodyVersion), !e.hook || !e.needsOwnToolbar() ? null : /* @__PURE__ */ f(io, { registry: e, own: !0 });
3715
+ function wa({ registry: e }) {
3716
+ return st(e.subscribe, e.bodyVersion, e.bodyVersion), !e.hook || !e.needsOwnToolbar() ? null : /* @__PURE__ */ f(lo, { registry: e, own: !0 });
3714
3717
  }
3715
- const wa = "_verdict_1mxfd_6", ba = "_glyph_1mxfd_13", va = "_value_1mxfd_23", ya = "_excess_1mxfd_28", Ze = {
3716
- verdict: wa,
3717
- glyph: ba,
3718
- value: va,
3719
- excess: ya
3720
- }, kn = (e, t, n) => t === "percent" ? n.percent(e) : t === "count" ? n.count(e) : n.number(e, typeof t == "object" ? t.decimals : void 0), _a = (e, t) => e === "alarm" ? t.verdictAlarm : e === "warning" ? t.verdictWarning : e === "unknown" ? t.verdictUnknown : t.verdictOk, ka = {
3718
+ const ba = "_verdict_1mxfd_6", va = "_glyph_1mxfd_13", ya = "_value_1mxfd_23", _a = "_excess_1mxfd_28", Ze = {
3719
+ verdict: ba,
3720
+ glyph: va,
3721
+ value: ya,
3722
+ excess: _a
3723
+ }, xn = (e, t, n) => t === "percent" ? n.percent(e) : t === "count" ? n.count(e) : n.number(e, typeof t == "object" ? t.decimals : void 0), xa = (e, t) => e === "alarm" ? t.verdictAlarm : e === "warning" ? t.verdictWarning : e === "unknown" ? t.verdictUnknown : t.verdictOk, ka = {
3721
3724
  ok: "✓",
3722
3725
  unknown: "?",
3723
3726
  warning: "▲",
3724
3727
  alarm: "■"
3725
3728
  };
3726
3729
  function Sa({ reading: e, format: t }) {
3727
- const n = ke(), o = ie(), { measured: r, assessment: s } = e, i = _a(s.verdict, o);
3730
+ const n = xe(), o = ie(), { measured: r, assessment: s } = e, i = xa(s.verdict, o);
3728
3731
  return /* @__PURE__ */ T("span", { className: Ze.verdict, "data-verdict": s.verdict, title: i, children: [
3729
3732
  /* @__PURE__ */ f("span", { "aria-hidden": "true", className: Ze.glyph, children: ka[s.verdict] }),
3730
- /* @__PURE__ */ f("span", { className: Ze.value, children: r === null ? o.statAbsentValue : kn(r, t, n) }),
3733
+ /* @__PURE__ */ f("span", { className: Ze.value, children: r === null ? o.statAbsentValue : xn(r, t, n) }),
3731
3734
  s.excess !== void 0 && /* @__PURE__ */ T("span", { className: Ze.excess, children: [
3732
3735
  "+",
3733
- kn(s.excess, t, n)
3736
+ xn(s.excess, t, n)
3734
3737
  ] }),
3735
3738
  /* @__PURE__ */ f(Oe, { children: i })
3736
3739
  ] });
3737
3740
  }
3738
- const Ca = (e) => e.measured, xa = (e) => e.reduce(
3741
+ const Ca = (e) => e.measured, Aa = (e) => e.reduce(
3739
3742
  (t, n) => !t || _t(n.assessment.verdict) > _t(t.assessment.verdict) ? n : t,
3740
3743
  void 0
3741
3744
  );
3742
- function Aa(e) {
3745
+ function Na(e) {
3743
3746
  return function({ id: n, value: o, label: r, limits: s, format: i, sortBy: l = "verdict", width: c, resizable: a, pin: u, aggregate: d }) {
3744
3747
  const b = JSON.stringify(s), p = H(() => {
3745
3748
  const w = JSON.parse(b);
@@ -3747,7 +3750,7 @@ function Aa(e) {
3747
3750
  const v = typeof o == "string" ? g?.[o] : o(g);
3748
3751
  return {
3749
3752
  measured: typeof v == "number" && Number.isFinite(v) ? v : null,
3750
- assessment: Io(v, w)
3753
+ assessment: $o(v, w)
3751
3754
  };
3752
3755
  };
3753
3756
  }, [o, b]), m = fe(
@@ -3766,23 +3769,23 @@ function Aa(e) {
3766
3769
  value: p,
3767
3770
  sortValue: m,
3768
3771
  exportValue: Ca,
3769
- aggregate: d === "worst" ? xa : void 0,
3772
+ aggregate: d === "worst" ? Aa : void 0,
3770
3773
  children: (w) => /* @__PURE__ */ f(Sa, { reading: w, format: i })
3771
3774
  }
3772
3775
  );
3773
3776
  };
3774
3777
  }
3775
- const Na = [], Co = (e) => X(
3778
+ const Ta = [], Co = (e) => X(
3776
3779
  `condition-foreign:${e}`,
3777
3780
  `The condition for "${e}" is not of the kind of its filter and is passed over.`
3778
3781
  );
3779
- function xo(e, t, n) {
3782
+ function Ao(e, t, n) {
3780
3783
  const o = e.columnById(t), r = o ? Ee(o.spec.filter) : void 0;
3781
3784
  if (!r) return !1;
3782
3785
  const s = jn(r, n);
3783
3786
  return s === "foreign" && Co(t), s === "effective";
3784
3787
  }
3785
- function Ta(e, t, n) {
3788
+ function Ra(e, t, n) {
3786
3789
  if (e.length === 0) return;
3787
3790
  let o = -1, r = [];
3788
3791
  return (s) => {
@@ -3795,7 +3798,7 @@ function Ta(e, t, n) {
3795
3798
  continue;
3796
3799
  }
3797
3800
  const a = t.columnById(i);
3798
- a && xo(t, i, l) && r.push((u) => {
3801
+ a && Ao(t, i, l) && r.push((u) => {
3799
3802
  const d = Ee(a.spec.filter);
3800
3803
  return !d || Ci(d, a.read(u), l);
3801
3804
  });
@@ -3804,25 +3807,25 @@ function Ta(e, t, n) {
3804
3807
  return r.every((i) => i(s));
3805
3808
  };
3806
3809
  }
3807
- function Ra(e) {
3810
+ function Oa(e) {
3808
3811
  const [t, n] = I({ fn: e });
3809
3812
  return ot(t.fn, e) ? t.fn : (n({ fn: e }), e);
3810
3813
  }
3811
- function Oa(e, t) {
3814
+ function Ea(e, t) {
3812
3815
  const n = H(() => t ? e.filter((i) => t(i)) : e, [e, t]), [o, r] = I(n);
3813
3816
  if (!t) return e;
3814
3817
  const s = o === n || o.length === n.length && o.every((i, l) => i === n[l]);
3815
3818
  return s || r(n), s ? o : n;
3816
3819
  }
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]);
3818
- function Sn(e) {
3820
+ const et = (e) => e === void 0 ? [] : typeof e == "string" ? [e] : [...e], Ma = (e, t) => e.length === t.length && e.every((n, o) => n === t[o]);
3821
+ function kn(e) {
3819
3822
  const t = [], n = (o) => {
3820
3823
  for (const r of o)
3821
3824
  t.push(r.path), n(r.groups);
3822
3825
  };
3823
3826
  return n(e ?? []), t;
3824
3827
  }
3825
- function Ma(e, t, n) {
3828
+ function La(e, t, n) {
3826
3829
  const o = [], r = (s, i) => {
3827
3830
  if (!(i >= n))
3828
3831
  for (const l of s) {
@@ -3832,59 +3835,59 @@ function Ma(e, t, n) {
3832
3835
  };
3833
3836
  return r(e, 0), o;
3834
3837
  }
3835
- const Cn = (e, t) => e.size === t.size && [...e].every((n) => t.has(n));
3836
- function La(e, t) {
3837
- return { ...xt(e), ...t };
3838
+ const Sn = (e, t) => e.size === t.size && [...e].every((n) => t.has(n));
3839
+ function Fa(e, t) {
3840
+ return { ...Ct(e), ...t };
3838
3841
  }
3839
- function Ia(e, t) {
3842
+ function $a(e, t) {
3840
3843
  const [n] = I(() => new Vi()), [o] = I(() => {
3841
- const N = pa(n);
3842
- return { ...N, VerdictColumn: Aa(N.Column) };
3844
+ const N = ma(n);
3845
+ return { ...N, VerdictColumn: Na(N.Column) };
3843
3846
  });
3844
3847
  st(n.subscribe, n.structureVersion, n.structureVersion);
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]);
3848
+ const r = xe(), 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]);
3846
3849
  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."));
3847
- const [b, p] = I(() => Object.entries(c?.conditions ?? {})), m = t.rowFilters ?? Na, w = m.map((N) => N.id).join("\0"), g = H(
3850
+ const [b, p] = I(() => Object.entries(c?.conditions ?? {})), m = t.rowFilters ?? Ta, w = m.map((N) => N.id).join("\0"), g = H(
3848
3851
  () => new Map(m.map((N) => [N.id, N])),
3849
3852
  // eslint-disable-next-line react-hooks/exhaustive-deps -- the filters by their ids; they are defined outside the component
3850
3853
  [w]
3851
3854
  );
3852
3855
  for (const N of m)
3853
3856
  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.`);
3854
- const v = H(() => Ta(b, n, g), [b, n, g]), x = t.preFilter, y = Oa(i, a ? void 0 : x), [_, S] = I(
3857
+ const v = H(() => Ra(b, n, g), [b, n, g]), C = t.preFilter, y = Ea(i, a ? void 0 : C), [_, k] = I(
3855
3858
  () => c?.grouping ? [...c.grouping] : et(t.defaultGrouping)
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;
3859
+ ), [S, A] = I(() => c?.folded ?? []), [L, x] = I(() => c?.pinned ? { ...c.pinned } : null), O = Oa(t.rowKey), M = t.server ? void 0 : t.childRows, R = M !== void 0;
3857
3860
  n.setTree(R);
3858
3861
  const E = q({ children: M, key: O });
3859
3862
  Z(() => {
3860
3863
  E.current = { children: M, key: O };
3861
3864
  });
3862
- const [B] = I(() => ({
3865
+ const [D] = I(() => ({
3863
3866
  key: (N) => E.current.key(N),
3864
3867
  children: (N) => E.current.children?.(N),
3865
3868
  label: () => ""
3866
3869
  })), [$] = I(() => {
3867
3870
  const N = t.server ? void 0 : t.defaultBranches;
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)) : [];
3871
+ return !R || N === void 0 ? [] : typeof N == "number" ? La(i, D, N) : [...N];
3872
+ }), [P, K] = I(() => c?.branches ?? $), Y = H(() => R ? new Set(zo(i, D)) : /* @__PURE__ */ new Set(), [R, i, D]), ce = R ? P.filter((N) => Y.has(N)) : [];
3870
3873
  H(() => {
3871
3874
  if (!R) return;
3872
- const N = zo(i, B);
3875
+ const N = Ko(i, D);
3873
3876
  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.`);
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(
3877
+ }, [R, i, D]), 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.");
3878
+ 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(S), [S]), ee = ne.length ? n.groupingModel(ne, i) : null, oe = H(
3876
3879
  () => ee && ee.levels.length ? { ...ee, folded: le, compareText: r.compareText } : void 0,
3877
3880
  // eslint-disable-next-line react-hooks/exhaustive-deps -- the model's identity carries the ids and the columns
3878
3881
  [ee, le, r.compareText, de]
3879
3882
  ), W = ce.join("\0"), ge = H(
3880
- () => R ? { key: O, children: B.children, open: new Set(ce), admit: x } : void 0,
3883
+ () => R ? { key: O, children: D.children, open: new Set(ce), admit: C } : void 0,
3881
3884
  /* ponytail: the pre-filter is read through the roots it admits - a new
3882
3885
  pre-filter that only drops children takes hold with the next change of
3883
3886
  rows or branches. Compare its admitted children, as useAdmitted does
3884
3887
  the roots, if a caller needs that live. */
3885
3888
  // eslint-disable-next-line react-hooks/exhaustive-deps -- the open keys by value; the rows the pre-filter admits stand for it
3886
- [R, W, y, B]
3887
- ), F = Xo(y, l, {
3889
+ [R, W, y, D]
3890
+ ), F = Qo(y, l, {
3888
3891
  rowKey: O,
3889
3892
  pageSize: t.pageSize,
3890
3893
  defaultSort: t.defaultSort,
@@ -3929,26 +3932,26 @@ function Ia(e, t) {
3929
3932
  },
3930
3933
  [n, ae, g]
3931
3934
  ), ue = new Set(n.orderedColumns().map((N) => N.spec.id)), [Ne, Me] = I(() => /* @__PURE__ */ new Set());
3932
- if (!Cn(Ne, ue)) {
3935
+ if (!Sn(Ne, ue)) {
3933
3936
  const N = new Set([...Ne].filter((G) => !ue.has(G)));
3934
3937
  Me(ue);
3935
3938
  const z = (G) => N.has(G) && !g.has(G);
3936
3939
  b.some(([G]) => z(G)) && p((G) => G.filter(([ze]) => !z(ze)));
3937
3940
  }
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 = {
3939
- ...Se,
3940
- ...Ea(ne, Ie) ? {} : { grouping: ne },
3941
+ const pe = ue.size === 0 ? b : b.filter(([N, z]) => g.has(N) || Ao(n, N, z)), U = cr(F.view, ue), ke = 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 ? Ho(F.groups, S) : j ? [] : [...S], Je = n.declaredPins(), V = or(L, Je, ue), J = {
3942
+ ...ke,
3943
+ ...Ma(ne, Ie) ? {} : { grouping: ne },
3941
3944
  ...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);
3946
- }, No = (N) => {
3947
- S([...N]), ae(1);
3945
+ ...V ? { pinned: V } : {},
3946
+ ...R && !Sn(new Set(ce), new Set($.filter((N) => Y.has(N)))) ? { branches: ce } : {}
3947
+ }, te = (N, z) => x((G) => tr(G ?? n.declaredPins(), N, z)), [me, we] = I(0), No = (N) => {
3948
+ F.restart(N), p(Object.entries(N.conditions ?? {})), k(N.grouping ? [...N.grouping] : et(t.defaultGrouping)), A(N.folded ?? []), x(N.pinned ? { ...N.pinned } : null), K(N.branches ?? $), we((z) => z + 1);
3948
3949
  }, 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);
3951
- xe(() => {
3950
+ k([...N]), ae(1);
3951
+ }, Ro = (N) => {
3952
+ kn(F.groups).includes(N) && (n.noteFocusBeforeFold(), A((z) => z.includes(N) ? z.filter((G) => G !== N) : [...z, N]));
3953
+ }, Jt = !a && !!t.virtual, ut = !R && n.paginates() || Jt, ft = t.selection ?? F.selection, Xe = ar(J), Xt = q(Xe), Qt = q(0);
3954
+ Ce(() => {
3952
3955
  const N = Qt.current !== me;
3953
3956
  Qt.current = me, Xt.current !== Xe && (Xt.current = Xe, N || t.onViewChange?.(J));
3954
3957
  }, [Xe, me]);
@@ -3958,8 +3961,8 @@ function Ia(e, t) {
3958
3961
  sort: Le,
3959
3962
  page: F.page,
3960
3963
  pageSize: F.pageSize
3961
- }, ht = a ? ir(Zt) : "", en = q(null);
3962
- xe(() => {
3964
+ }, ht = a ? lr(Zt) : "", en = q(null);
3965
+ Ce(() => {
3963
3966
  !a || en.current === ht || (en.current = ht, t.onRequest?.(Zt));
3964
3967
  }, [ht]);
3965
3968
  const [$e] = I(() => /* @__PURE__ */ new Map());
@@ -3993,7 +3996,7 @@ function Ia(e, t) {
3993
3996
  setOrder: F.setOrder,
3994
3997
  pinned: L ?? Je,
3995
3998
  setPin: te,
3996
- widths: La(l, F.widths),
3999
+ widths: Fa(l, F.widths),
3997
4000
  setWidth: F.setWidth,
3998
4001
  expanded: F.expanded,
3999
4002
  toggleRow: F.toggleRow,
@@ -4003,12 +4006,12 @@ function Ia(e, t) {
4003
4006
  selection: ft,
4004
4007
  view: J,
4005
4008
  grouping: ne,
4006
- setGrouping: No,
4007
- setView: Ao,
4009
+ setGrouping: To,
4010
+ setView: No,
4008
4011
  folded: Fe,
4009
- toggleFold: To,
4012
+ toggleFold: Ro,
4010
4013
  foldAll: () => {
4011
- n.noteFocusBeforeFold(), A(Sn(F.groups));
4014
+ n.noteFocusBeforeFold(), A(kn(F.groups));
4012
4015
  },
4013
4016
  unfoldAll: () => {
4014
4017
  n.noteFocusBeforeFold(), A([]);
@@ -4019,8 +4022,8 @@ function Ia(e, t) {
4019
4022
  },
4020
4023
  unfoldAllBranches: () => K([...Y]),
4021
4024
  foldAllBranches: () => K([]),
4022
- asCsv: () => ji(n, s.levelColumn, r, s),
4023
- selectionAsText: () => to(n, r, s),
4025
+ asCsv: () => Hi(n, s.levelColumn, r, s),
4026
+ selectionAsText: () => no(n, r, s),
4024
4027
  virtual: Jt,
4025
4028
  rowCount: a ? u : F.filtered.length,
4026
4029
  server: a
@@ -4043,7 +4046,7 @@ function Ia(e, t) {
4043
4046
  rowFilters: g
4044
4047
  }), { ...nn, ...o };
4045
4048
  }
4046
- function $a(e) {
4049
+ function za(e) {
4047
4050
  return e;
4048
4051
  }
4049
4052
  function Ut(e, t) {
@@ -4055,13 +4058,13 @@ function Ut(e, t) {
4055
4058
  };
4056
4059
  }, [e, t, n]);
4057
4060
  }
4058
- function za({ children: e, className: t, size: n = "sm", of: o }) {
4061
+ function Ka({ children: e, className: t, size: n = "sm", of: o }) {
4059
4062
  const r = Ye(o);
4060
4063
  Ut(r?.registry, "toolbar");
4061
4064
  const s = r?.registry;
4062
- return /* @__PURE__ */ f(io, { registry: s ?? null, className: t, size: n, children: e });
4065
+ return /* @__PURE__ */ f(lo, { registry: s ?? null, className: t, size: n, children: e });
4063
4066
  }
4064
- function Ka({ placeholder: e, "aria-label": t, className: n, size: o, grow: r, of: s }) {
4067
+ function Ga({ placeholder: e, "aria-label": t, className: n, size: o, grow: r, of: s }) {
4065
4068
  const i = Ye(s), l = at(o), c = ie();
4066
4069
  if (Ut(i?.registry, "search"), !i) return null;
4067
4070
  const { snapshot: a } = i;
@@ -4070,7 +4073,7 @@ function Ka({ placeholder: e, "aria-label": t, className: n, size: o, grow: r, o
4070
4073
  {
4071
4074
  size: l,
4072
4075
  type: "search",
4073
- className: D(r && h.searchGrow, n),
4076
+ className: B(r && h.searchGrow, n),
4074
4077
  value: a.search,
4075
4078
  onChange: (u) => a.setSearch(u.target.value),
4076
4079
  clearable: !0,
@@ -4080,40 +4083,40 @@ function Ka({ placeholder: e, "aria-label": t, className: n, size: o, grow: r, o
4080
4083
  }
4081
4084
  );
4082
4085
  }
4083
- function Ga({ size: e, of: t }) {
4086
+ function ja({ size: e, of: t }) {
4084
4087
  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
4088
  if (Z(() => {
4086
4089
  if (!u || !c.current) return;
4087
4090
  const _ = Array.from(c.current.children).find(
4088
4091
  (A) => A.dataset.column === u.id
4089
- ), S = _?.querySelector(u.key), C = u.otherwise ? _?.querySelector(u.otherwise) : void 0;
4090
- (S && !S.disabled ? S : C)?.focus();
4092
+ ), k = _?.querySelector(u.key), S = u.otherwise ? _?.querySelector(u.otherwise) : void 0;
4093
+ (k && !k.disabled ? k : S)?.focus();
4091
4094
  }, [u]), !n) return null;
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) => {
4093
- const C = w[_ + S];
4094
- return C !== void 0 && g[C.id] === g[w[_].id];
4095
- }, x = (_, S) => {
4096
- const C = w.map((O) => O.id), A = _ + S;
4097
- if (!v(_, S)) return;
4098
- [C[_], C[A]] = [C[A], C[_]], p.setOrder(C);
4099
- const [L, k] = S < 0 ? ["forward", "backward"] : ["backward", "forward"];
4100
- d({ id: w[_].id, key: `[data-direction="${L}"]`, otherwise: `[data-direction="${k}"]` });
4101
- }, y = (_, S, C) => {
4102
- const A = g[_] === C;
4103
- return /* @__PURE__ */ f(tt, { content: A ? r.unpinHint : C === "start" ? r.pinToStartHint : r.pinToEndHint, children: /* @__PURE__ */ f(
4095
+ const { registry: b, snapshot: p } = n, m = b.hook, w = b.inPinOrder(Dn(b.modelColumns(m.rows, m.formats), p.order)), g = b.pins(), v = (_, k) => {
4096
+ const S = w[_ + k];
4097
+ return S !== void 0 && g[S.id] === g[w[_].id];
4098
+ }, C = (_, k) => {
4099
+ const S = w.map((O) => O.id), A = _ + k;
4100
+ if (!v(_, k)) return;
4101
+ [S[_], S[A]] = [S[A], S[_]], p.setOrder(S);
4102
+ const [L, x] = k < 0 ? ["forward", "backward"] : ["backward", "forward"];
4103
+ d({ id: w[_].id, key: `[data-direction="${L}"]`, otherwise: `[data-direction="${x}"]` });
4104
+ }, y = (_, k, S) => {
4105
+ const A = g[_] === S;
4106
+ return /* @__PURE__ */ f(tt, { content: A ? r.unpinHint : S === "start" ? r.pinToStartHint : r.pinToEndHint, children: /* @__PURE__ */ f(
4104
4107
  "button",
4105
4108
  {
4106
4109
  type: "button",
4107
- className: D(h.move, A && h.pinOn),
4108
- "data-pin": C,
4109
- "aria-label": A ? r.unpinColumn(S) : C === "start" ? r.pinColumnToStart(S) : r.pinColumnToEnd(S),
4110
+ className: B(h.move, A && h.pinOn),
4111
+ "data-pin": S,
4112
+ "aria-label": A ? r.unpinColumn(k) : S === "start" ? r.pinColumnToStart(k) : r.pinColumnToEnd(k),
4110
4113
  onClick: () => {
4111
- p.setPin(_, A ? null : C), d({ id: _, key: `[data-pin="${C}"]` });
4114
+ p.setPin(_, A ? null : S), d({ id: _, key: `[data-pin="${S}"]` });
4112
4115
  },
4113
4116
  children: /* @__PURE__ */ f("svg", { viewBox: "0 0 10 10", width: "10", height: "10", "aria-hidden": "true", children: /* @__PURE__ */ f(
4114
4117
  "path",
4115
4118
  {
4116
- d: C === "start" ? "M2 1.5v7M8.5 5H4.5M6 3.5 4.5 5 6 6.5" : "M8 1.5v7M1.5 5h4M4 3.5 5.5 5 4 6.5",
4119
+ d: S === "start" ? "M2 1.5v7M8.5 5H4.5M6 3.5 4.5 5 6 6.5" : "M8 1.5v7M1.5 5h4M4 3.5 5.5 5 4 6.5",
4117
4120
  fill: "none",
4118
4121
  stroke: "currentColor",
4119
4122
  strokeWidth: "1.4",
@@ -4149,13 +4152,13 @@ function Ga({ size: e, of: t }) {
4149
4152
  id: a,
4150
4153
  className: h.columnsPanel,
4151
4154
  children: [
4152
- /* @__PURE__ */ f("ul", { ref: c, className: h.columnsList, "aria-label": r.arrangeColumns, children: w.map((_, S) => {
4153
- const C = _.label ?? _.id;
4155
+ /* @__PURE__ */ f("ul", { ref: c, className: h.columnsList, "aria-label": r.arrangeColumns, children: w.map((_, k) => {
4156
+ const S = _.label ?? _.id;
4154
4157
  return /* @__PURE__ */ T("li", { className: h.columnsEntry, "data-column": _.id, children: [
4155
4158
  /* @__PURE__ */ f(
4156
4159
  We,
4157
4160
  {
4158
- label: C,
4161
+ label: S,
4159
4162
  checked: !p.hidden.includes(_.id),
4160
4163
  disabled: _.hideable === !1,
4161
4164
  onChange: () => p.toggleColumn(_.id)
@@ -4167,9 +4170,9 @@ function Ga({ size: e, of: t }) {
4167
4170
  type: "button",
4168
4171
  className: h.move,
4169
4172
  "data-direction": "forward",
4170
- "aria-label": r.columnForward(C),
4171
- disabled: !v(S, -1),
4172
- onClick: () => x(S, -1),
4173
+ "aria-label": r.columnForward(S),
4174
+ disabled: !v(k, -1),
4175
+ onClick: () => C(k, -1),
4173
4176
  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" }) })
4174
4177
  }
4175
4178
  ) }),
@@ -4179,24 +4182,24 @@ function Ga({ size: e, of: t }) {
4179
4182
  type: "button",
4180
4183
  className: h.move,
4181
4184
  "data-direction": "backward",
4182
- "aria-label": r.columnBackward(C),
4183
- disabled: !v(S, 1),
4184
- onClick: () => x(S, 1),
4185
+ "aria-label": r.columnBackward(S),
4186
+ disabled: !v(k, 1),
4187
+ onClick: () => C(k, 1),
4185
4188
  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" }) })
4186
4189
  }
4187
4190
  ) }),
4188
- y(_.id, C, "start"),
4189
- y(_.id, C, "end")
4191
+ y(_.id, S, "start"),
4192
+ y(_.id, S, "end")
4190
4193
  ] }, _.id);
4191
4194
  }) }),
4192
- /* @__PURE__ */ f(Ji, { registry: b, hook: m }),
4193
- /* @__PURE__ */ f(Xi, { registry: b, hook: m })
4195
+ /* @__PURE__ */ f(Xi, { registry: b, hook: m }),
4196
+ /* @__PURE__ */ f(Qi, { registry: b, hook: m })
4194
4197
  ]
4195
4198
  }
4196
4199
  )
4197
4200
  ] });
4198
4201
  }
4199
- function ja({ filename: e, onExport: t, size: n, of: o }) {
4202
+ function Ha({ filename: e, onExport: t, size: n, of: o }) {
4200
4203
  const r = Ye(o), s = at(n), i = ie();
4201
4204
  if (!r) return null;
4202
4205
  const { snapshot: l } = r;
@@ -4210,10 +4213,10 @@ function ja({ filename: e, onExport: t, size: n, of: o }) {
4210
4213
  d.href = u, d.download = e ?? i.exportFileName, d.click(), setTimeout(() => URL.revokeObjectURL(u), 1e4);
4211
4214
  }, children: l.server ? i.exportPageLabel : i.exportLabel });
4212
4215
  }
4213
- function Ha({ pageSizes: e = [10, 25, 50], className: t, of: n }) {
4214
- const o = Ye(n), r = ie(), s = ke();
4216
+ function Wa({ pageSizes: e = [10, 25, 50], className: t, of: n }) {
4217
+ const o = Ye(n), r = ie(), s = xe();
4215
4218
  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;
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: [
4219
+ 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: B(h.pagination, t), children: [
4217
4220
  /* @__PURE__ */ f("span", { children: r.entries(l, s.count(l)) }),
4218
4221
  /* @__PURE__ */ T("div", { className: h.paginationControls, children: [
4219
4222
  /* @__PURE__ */ T("label", { className: h.pageSize, children: [
@@ -4242,18 +4245,18 @@ function Ha({ pageSizes: e = [10, 25, 50], className: t, of: n }) {
4242
4245
  ] });
4243
4246
  return o.inside ? o.footerTarget ? En(a, o.footerTarget) : null : a;
4244
4247
  }
4245
- function Wa(e) {
4248
+ function qa(e) {
4246
4249
  return e;
4247
4250
  }
4248
4251
  export {
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
4252
+ ja as ColumnMenu,
4253
+ Ha as Export,
4254
+ Wa as Pagination,
4255
+ Ga as Search,
4256
+ Ka as Toolbar,
4257
+ za as column,
4258
+ Ia as columnFilter,
4259
+ qa as rowFilter,
4260
+ $a as useTable,
4261
+ Go as useTableSelection
4259
4262
  };