@fileflow/sdk 0.1.20 → 0.1.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,49 +1,49 @@
1
- import { jsx as c, jsxs as w, Fragment as re } from "react/jsx-runtime";
2
- import * as xe from "react";
3
- import pt, { useCallback as Ne, useState as q, useMemo as be, useEffect as Oe } from "react";
4
- import { h as b, j as mt, k as ht, X as ae, m as U, U as Qe, n as Pe, T as _e, q as vt, p as ke, o as Te, t as wt, d as Ct, V as Be, g as te, S as ce, L as ge } from "./index-EFXXxSbj.mjs";
1
+ import { jsx as c, jsxs as w, Fragment as ee } from "react/jsx-runtime";
2
+ import * as _e from "react";
3
+ import vt, { useCallback as Pe, useState as j, useMemo as Be, useEffect as Ke } from "react";
4
+ import { h as T, j as wt, k as Ct, X as ce, m as W, U as Ze, n as ke, T as Fe, q as yt, p as Ee, o as qe, t as St, d as Rt, V as je, g as re, S as pe, L as ae } from "./index-DJ8UbzFt.mjs";
5
5
  /**
6
6
  * @license lucide-react v0.563.0 - ISC
7
7
  *
8
8
  * This source code is licensed under the ISC license.
9
9
  * See the LICENSE file in the root directory of this source tree.
10
10
  */
11
- const St = [
11
+ const xt = [
12
12
  ["path", { d: "M5 12h14", key: "1ays0h" }],
13
13
  ["path", { d: "m12 5 7 7-7 7", key: "xquz4c" }]
14
- ], yt = b("arrow-right", St);
14
+ ], _t = T("arrow-right", xt);
15
15
  /**
16
16
  * @license lucide-react v0.563.0 - ISC
17
17
  *
18
18
  * This source code is licensed under the ISC license.
19
19
  * See the LICENSE file in the root directory of this source tree.
20
20
  */
21
- const Rt = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]], xt = b("check", Rt);
21
+ const Ft = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]], It = T("check", Ft);
22
22
  /**
23
23
  * @license lucide-react v0.563.0 - ISC
24
24
  *
25
25
  * This source code is licensed under the ISC license.
26
26
  * See the LICENSE file in the root directory of this source tree.
27
27
  */
28
- const _t = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], Ft = b("chevron-left", _t);
28
+ const $t = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], Nt = T("chevron-left", $t);
29
29
  /**
30
30
  * @license lucide-react v0.563.0 - ISC
31
31
  *
32
32
  * This source code is licensed under the ISC license.
33
33
  * See the LICENSE file in the root directory of this source tree.
34
34
  */
35
- const $t = [
35
+ const Mt = [
36
36
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
37
37
  ["path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3", key: "1u773s" }],
38
38
  ["path", { d: "M12 17h.01", key: "p32p05" }]
39
- ], It = b("circle-question-mark", $t);
39
+ ], Vt = T("circle-question-mark", Mt);
40
40
  /**
41
41
  * @license lucide-react v0.563.0 - ISC
42
42
  *
43
43
  * This source code is licensed under the ISC license.
44
44
  * See the LICENSE file in the root directory of this source tree.
45
45
  */
46
- const Mt = [
46
+ const Pt = [
47
47
  [
48
48
  "path",
49
49
  {
@@ -52,14 +52,14 @@ const Mt = [
52
52
  }
53
53
  ],
54
54
  ["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
55
- ], Vt = b("eye", Mt);
55
+ ], kt = T("eye", Pt);
56
56
  /**
57
57
  * @license lucide-react v0.563.0 - ISC
58
58
  *
59
59
  * This source code is licensed under the ISC license.
60
60
  * See the LICENSE file in the root directory of this source tree.
61
61
  */
62
- const Nt = [
62
+ const Et = [
63
63
  [
64
64
  "path",
65
65
  {
@@ -72,14 +72,14 @@ const Nt = [
72
72
  ["path", { d: "M14 13h2", key: "un5t4a" }],
73
73
  ["path", { d: "M8 17h2", key: "2yhykz" }],
74
74
  ["path", { d: "M14 17h2", key: "10kma7" }]
75
- ], Pt = b("file-spreadsheet", Nt);
75
+ ], bt = T("file-spreadsheet", Et);
76
76
  /**
77
77
  * @license lucide-react v0.563.0 - ISC
78
78
  *
79
79
  * This source code is licensed under the ISC license.
80
80
  * See the LICENSE file in the root directory of this source tree.
81
81
  */
82
- const kt = [
82
+ const Dt = [
83
83
  [
84
84
  "path",
85
85
  {
@@ -88,26 +88,26 @@ const kt = [
88
88
  }
89
89
  ],
90
90
  ["path", { d: "M14 2v5a1 1 0 0 0 1 1h5", key: "wfsgrz" }]
91
- ], Et = b("file", kt);
91
+ ], Lt = T("file", Dt);
92
92
  /**
93
93
  * @license lucide-react v0.563.0 - ISC
94
94
  *
95
95
  * This source code is licensed under the ISC license.
96
96
  * See the LICENSE file in the root directory of this source tree.
97
97
  */
98
- const Dt = [
98
+ const zt = [
99
99
  ["line", { x1: "6", x2: "6", y1: "3", y2: "15", key: "17qcm7" }],
100
100
  ["circle", { cx: "18", cy: "6", r: "3", key: "1h7g24" }],
101
101
  ["circle", { cx: "6", cy: "18", r: "3", key: "fqmcym" }],
102
102
  ["path", { d: "M18 9a9 9 0 0 1-9 9", key: "n2h4wq" }]
103
- ], Lt = b("git-branch", Dt);
103
+ ], Ht = T("git-branch", zt);
104
104
  /**
105
105
  * @license lucide-react v0.563.0 - ISC
106
106
  *
107
107
  * This source code is licensed under the ISC license.
108
108
  * See the LICENSE file in the root directory of this source tree.
109
109
  */
110
- const zt = [
110
+ const At = [
111
111
  [
112
112
  "path",
113
113
  {
@@ -115,33 +115,33 @@ const zt = [
115
115
  key: "1a8usu"
116
116
  }
117
117
  ]
118
- ], Ht = b("pen", zt);
118
+ ], Gt = T("pen", At);
119
119
  /**
120
120
  * @license lucide-react v0.563.0 - ISC
121
121
  *
122
122
  * This source code is licensed under the ISC license.
123
123
  * See the LICENSE file in the root directory of this source tree.
124
124
  */
125
- const At = [
125
+ const Ot = [
126
126
  [
127
127
  "path",
128
128
  { d: "M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344", key: "2acyp4" }
129
129
  ],
130
130
  ["path", { d: "m9 11 3 3L22 4", key: "1pflzl" }]
131
- ], Gt = b("square-check-big", At);
131
+ ], Tt = T("square-check-big", Ot);
132
132
  /**
133
133
  * @license lucide-react v0.563.0 - ISC
134
134
  *
135
135
  * This source code is licensed under the ISC license.
136
136
  * See the LICENSE file in the root directory of this source tree.
137
137
  */
138
- const bt = [
138
+ const Bt = [
139
139
  ["path", { d: "M10 11v6", key: "nco0om" }],
140
140
  ["path", { d: "M14 11v6", key: "outv1u" }],
141
141
  ["path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6", key: "miytrc" }],
142
142
  ["path", { d: "M3 6h18", key: "d0wm0j" }],
143
143
  ["path", { d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2", key: "e791ji" }]
144
- ], Ot = b("trash-2", bt), Ke = {
144
+ ], Kt = T("trash-2", Bt), Ue = {
145
145
  sessionId: null,
146
146
  status: "idle",
147
147
  step: "upload",
@@ -163,24 +163,24 @@ const bt = [
163
163
  editingCell: null,
164
164
  editedRows: /* @__PURE__ */ new Set()
165
165
  };
166
- function Tt(e, o) {
166
+ function qt(e, r) {
167
167
  const t = [], n = (e == null ? void 0 : e.trim()) || "";
168
- if (o.required && !n)
168
+ if (r.required && !n)
169
169
  return t.push({
170
170
  rowIndex: 0,
171
171
  // will be set by caller
172
- columnKey: o.key,
172
+ columnKey: r.key,
173
173
  value: n,
174
174
  severity: "error",
175
175
  validatorType: "required",
176
- message: `${o.label} is required`
176
+ message: `${r.label} is required`
177
177
  }), t;
178
178
  if (!n) return t;
179
- switch (o.type) {
179
+ switch (r.type) {
180
180
  case "email":
181
181
  /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(n) || t.push({
182
182
  rowIndex: 0,
183
- columnKey: o.key,
183
+ columnKey: r.key,
184
184
  value: n,
185
185
  severity: "error",
186
186
  validatorType: "type",
@@ -190,7 +190,7 @@ function Tt(e, o) {
190
190
  case "url":
191
191
  /^https?:\/\/.+/.test(n) || t.push({
192
192
  rowIndex: 0,
193
- columnKey: o.key,
193
+ columnKey: r.key,
194
194
  value: n,
195
195
  severity: "error",
196
196
  validatorType: "type",
@@ -200,7 +200,7 @@ function Tt(e, o) {
200
200
  case "integer":
201
201
  /^-?\d+$/.test(n) || t.push({
202
202
  rowIndex: 0,
203
- columnKey: o.key,
203
+ columnKey: r.key,
204
204
  value: n,
205
205
  severity: "error",
206
206
  validatorType: "type",
@@ -211,7 +211,7 @@ function Tt(e, o) {
211
211
  case "float":
212
212
  /^-?\d+(\.\d+)?$/.test(n) || t.push({
213
213
  rowIndex: 0,
214
- columnKey: o.key,
214
+ columnKey: r.key,
215
215
  value: n,
216
216
  severity: "error",
217
217
  validatorType: "type",
@@ -221,7 +221,7 @@ function Tt(e, o) {
221
221
  case "phone":
222
222
  n.replace(/\D/g, "").length < 10 && t.push({
223
223
  rowIndex: 0,
224
- columnKey: o.key,
224
+ columnKey: r.key,
225
225
  value: n,
226
226
  severity: "warning",
227
227
  validatorType: "type",
@@ -229,103 +229,103 @@ function Tt(e, o) {
229
229
  });
230
230
  break;
231
231
  }
232
- if (o.validators)
233
- for (const r of o.validators) {
234
- const l = r.severity === "info" ? "warning" : r.severity || "error", i = r.params || {};
235
- switch (r.type) {
232
+ if (r.validators)
233
+ for (const o of r.validators) {
234
+ const l = o.severity === "info" ? "warning" : o.severity || "error", s = o.params || {};
235
+ switch (o.type) {
236
236
  case "minLength": {
237
- const s = i.value ?? 0;
238
- n.length < s && t.push({
237
+ const i = s.value ?? 0;
238
+ n.length < i && t.push({
239
239
  rowIndex: 0,
240
- columnKey: o.key,
240
+ columnKey: r.key,
241
241
  value: n,
242
242
  severity: l,
243
- validatorType: r.type,
244
- message: r.message || `Must be at least ${s} characters`
243
+ validatorType: o.type,
244
+ message: o.message || `Must be at least ${i} characters`
245
245
  });
246
246
  break;
247
247
  }
248
248
  case "maxLength": {
249
- const s = i.value ?? 1 / 0;
250
- n.length > s && t.push({
249
+ const i = s.value ?? 1 / 0;
250
+ n.length > i && t.push({
251
251
  rowIndex: 0,
252
- columnKey: o.key,
252
+ columnKey: r.key,
253
253
  value: n,
254
254
  severity: l,
255
- validatorType: r.type,
256
- message: r.message || `Must be at most ${s} characters`
255
+ validatorType: o.type,
256
+ message: o.message || `Must be at most ${i} characters`
257
257
  });
258
258
  break;
259
259
  }
260
260
  case "min": {
261
- const s = parseFloat(n), u = i.value ?? -1 / 0;
262
- !isNaN(s) && s < u && t.push({
261
+ const i = parseFloat(n), u = s.value ?? -1 / 0;
262
+ !isNaN(i) && i < u && t.push({
263
263
  rowIndex: 0,
264
- columnKey: o.key,
264
+ columnKey: r.key,
265
265
  value: n,
266
266
  severity: l,
267
- validatorType: r.type,
268
- message: r.message || `Must be at least ${u}`
267
+ validatorType: o.type,
268
+ message: o.message || `Must be at least ${u}`
269
269
  });
270
270
  break;
271
271
  }
272
272
  case "max": {
273
- const s = parseFloat(n), u = i.value ?? 1 / 0;
274
- !isNaN(s) && s > u && t.push({
273
+ const i = parseFloat(n), u = s.value ?? 1 / 0;
274
+ !isNaN(i) && i > u && t.push({
275
275
  rowIndex: 0,
276
- columnKey: o.key,
276
+ columnKey: r.key,
277
277
  value: n,
278
278
  severity: l,
279
- validatorType: r.type,
280
- message: r.message || `Must be at most ${u}`
279
+ validatorType: o.type,
280
+ message: o.message || `Must be at most ${u}`
281
281
  });
282
282
  break;
283
283
  }
284
284
  case "pattern": {
285
- const s = i.regex ?? i.pattern ?? ".*";
286
- new RegExp(s).test(n) || t.push({
285
+ const i = s.regex ?? s.pattern ?? ".*";
286
+ new RegExp(i).test(n) || t.push({
287
287
  rowIndex: 0,
288
- columnKey: o.key,
288
+ columnKey: r.key,
289
289
  value: n,
290
290
  severity: l,
291
- validatorType: r.type,
292
- message: r.message || "Format is invalid"
291
+ validatorType: o.type,
292
+ message: o.message || "Format is invalid"
293
293
  });
294
294
  break;
295
295
  }
296
296
  case "enum": {
297
- const s = i.values || [];
298
- s.map((f) => f.toLowerCase()).includes(n.toLowerCase()) || t.push({
297
+ const i = s.values || [];
298
+ i.map((f) => f.toLowerCase()).includes(n.toLowerCase()) || t.push({
299
299
  rowIndex: 0,
300
- columnKey: o.key,
300
+ columnKey: r.key,
301
301
  value: n,
302
302
  severity: l,
303
- validatorType: r.type,
304
- message: r.message || `Must be one of: ${s.slice(0, 5).join(", ")}${s.length > 5 ? "..." : ""}`
303
+ validatorType: o.type,
304
+ message: o.message || `Must be one of: ${i.slice(0, 5).join(", ")}${i.length > 5 ? "..." : ""}`
305
305
  });
306
306
  break;
307
307
  }
308
308
  case "custom": {
309
- const s = i.validatorName;
310
- if (s === "commaSeparatedEnum") {
311
- const u = i.allowedValues || [], f = n.split(",").map((d) => d.trim().toLowerCase()).filter((d) => d), g = u.map((d) => d.toLowerCase()), p = f.filter((d) => !g.includes(d));
309
+ const i = s.validatorName;
310
+ if (i === "commaSeparatedEnum") {
311
+ const u = s.allowedValues || [], f = n.split(",").map((d) => d.trim().toLowerCase()).filter((d) => d), g = u.map((d) => d.toLowerCase()), p = f.filter((d) => !g.includes(d));
312
312
  p.length > 0 && t.push({
313
313
  rowIndex: 0,
314
- columnKey: o.key,
314
+ columnKey: r.key,
315
315
  value: n,
316
316
  severity: l,
317
- validatorType: r.type,
318
- message: r.message || `Invalid values: ${p.join(", ")}. Must be comma-separated values from: ${u.slice(0, 5).join(", ")}${u.length > 5 ? "..." : ""}`
317
+ validatorType: o.type,
318
+ message: o.message || `Invalid values: ${p.join(", ")}. Must be comma-separated values from: ${u.slice(0, 5).join(", ")}${u.length > 5 ? "..." : ""}`
319
319
  });
320
320
  }
321
- if (s === "commaSeparatedEmails") {
321
+ if (i === "commaSeparatedEmails") {
322
322
  const f = n.split(",").map((g) => g.trim()).filter((g) => g).filter((g) => !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(g));
323
323
  f.length > 0 && t.push({
324
324
  rowIndex: 0,
325
- columnKey: o.key,
325
+ columnKey: r.key,
326
326
  value: n,
327
327
  severity: l,
328
- validatorType: r.type,
328
+ validatorType: o.type,
329
329
  message: `Invalid email(s): ${f.join(", ")}`
330
330
  });
331
331
  }
@@ -335,96 +335,96 @@ function Tt(e, o) {
335
335
  }
336
336
  return t;
337
337
  }
338
- function pe(e, o, t) {
338
+ function me(e, r, t) {
339
339
  var C;
340
340
  const n = [];
341
- for (const h of e)
342
- for (const S of t) {
343
- if (!S.targetKey) continue;
344
- const x = o.columns.find((V) => V.key === S.targetKey);
341
+ for (const v of e)
342
+ for (const y of t) {
343
+ if (!y.targetKey) continue;
344
+ const x = r.columns.find((P) => P.key === y.targetKey);
345
345
  if (!x) continue;
346
- const I = h.data[S.targetKey] || h.data[S.sourceColumn] || "", F = Tt(String(I), x);
347
- for (const V of F)
348
- n.push({ ...V, rowIndex: h.rowIndex });
346
+ const $ = v.data[y.targetKey] || v.data[y.sourceColumn] || "", F = qt(String($), x);
347
+ for (const P of F)
348
+ n.push({ ...P, rowIndex: v.rowIndex });
349
349
  }
350
- const r = ((C = o.options) == null ? void 0 : C.uniqueKeys) || [];
351
- for (const h of r) {
352
- const S = t.find((I) => I.targetKey === h);
353
- if (!S) continue;
350
+ const o = ((C = r.options) == null ? void 0 : C.uniqueKeys) || [];
351
+ for (const v of o) {
352
+ const y = t.find(($) => $.targetKey === v);
353
+ if (!y) continue;
354
354
  const x = /* @__PURE__ */ new Map();
355
- for (const I of e) {
356
- const F = String(I.data[h] || I.data[S.sourceColumn] || "").toLowerCase().trim();
355
+ for (const $ of e) {
356
+ const F = String($.data[v] || $.data[y.sourceColumn] || "").toLowerCase().trim();
357
357
  if (!F) continue;
358
- const V = x.get(F) || [];
359
- V.push(I.rowIndex), x.set(F, V);
358
+ const P = x.get(F) || [];
359
+ P.push($.rowIndex), x.set(F, P);
360
360
  }
361
- for (const [I, F] of x.entries())
361
+ for (const [$, F] of x.entries())
362
362
  if (F.length > 1)
363
- for (const V of F.slice(1))
363
+ for (const P of F.slice(1))
364
364
  n.push({
365
- rowIndex: V,
366
- columnKey: h,
367
- value: I,
365
+ rowIndex: P,
366
+ columnKey: v,
367
+ value: $,
368
368
  severity: "warning",
369
369
  validatorType: "unique",
370
- message: `Duplicate ${h} value`
370
+ message: `Duplicate ${v} value`
371
371
  });
372
372
  }
373
373
  const l = /* @__PURE__ */ new Map();
374
- for (const h of n) {
375
- const S = l.get(h.rowIndex) || [];
376
- S.push(h), l.set(h.rowIndex, S);
374
+ for (const v of n) {
375
+ const y = l.get(v.rowIndex) || [];
376
+ y.push(v), l.set(v.rowIndex, y);
377
377
  }
378
- const i = n.filter((h) => h.severity === "error").length, s = n.filter((h) => h.severity === "warning").length, u = n.filter((h) => h.severity === "info").length, f = new Set(n.filter((h) => h.severity === "error").map((h) => h.rowIndex)), g = e.length, p = g - f.size, d = {};
379
- for (const h of n) {
380
- d[h.columnKey] || (d[h.columnKey] = {
381
- columnKey: h.columnKey,
378
+ const s = n.filter((v) => v.severity === "error").length, i = n.filter((v) => v.severity === "warning").length, u = n.filter((v) => v.severity === "info").length, f = new Set(n.filter((v) => v.severity === "error").map((v) => v.rowIndex)), g = e.length, p = g - f.size, d = {};
379
+ for (const v of n) {
380
+ d[v.columnKey] || (d[v.columnKey] = {
381
+ columnKey: v.columnKey,
382
382
  errorCount: 0,
383
383
  warningCount: 0,
384
384
  infoCount: 0,
385
385
  mostCommonError: void 0
386
386
  });
387
- const S = d[h.columnKey];
388
- h.severity === "error" ? S.errorCount++ : h.severity === "warning" ? S.warningCount++ : S.infoCount++, S.mostCommonError || (S.mostCommonError = h.message);
387
+ const y = d[v.columnKey];
388
+ v.severity === "error" ? y.errorCount++ : v.severity === "warning" ? y.warningCount++ : y.infoCount++, y.mostCommonError || (y.mostCommonError = v.message);
389
389
  }
390
390
  const a = {};
391
- for (const h of n)
392
- a[h.validatorType] = (a[h.validatorType] || 0) + 1;
391
+ for (const v of n)
392
+ a[v.validatorType] = (a[v.validatorType] || 0) + 1;
393
393
  const m = [];
394
- for (const h of r) {
395
- const S = t.find((I) => I.targetKey === h);
396
- if (!S) continue;
394
+ for (const v of o) {
395
+ const y = t.find(($) => $.targetKey === v);
396
+ if (!y) continue;
397
397
  const x = /* @__PURE__ */ new Map();
398
- for (const I of e) {
399
- const F = String(I.data[h] || I.data[S.sourceColumn] || "").toLowerCase().trim();
398
+ for (const $ of e) {
399
+ const F = String($.data[v] || $.data[y.sourceColumn] || "").toLowerCase().trim();
400
400
  if (!F) continue;
401
- const V = x.get(F) || [];
402
- V.push(I.rowIndex), x.set(F, V);
401
+ const P = x.get(F) || [];
402
+ P.push($.rowIndex), x.set(F, P);
403
403
  }
404
- for (const [I, F] of x.entries())
405
- F.length > 1 && m.push({ columnKey: h, value: I, rowIndices: F });
404
+ for (const [$, F] of x.entries())
405
+ F.length > 1 && m.push({ columnKey: v, value: $, rowIndices: F });
406
406
  }
407
- const v = {
407
+ const h = {
408
408
  byColumn: d,
409
409
  byType: a,
410
410
  duplicates: m.length > 0 ? m : void 0
411
411
  };
412
412
  return {
413
413
  validationResults: {
414
- isValid: i === 0,
414
+ isValid: s === 0,
415
415
  totalRows: g,
416
416
  validRows: p,
417
- errorCount: i,
418
- warningCount: s,
417
+ errorCount: s,
418
+ warningCount: i,
419
419
  infoCount: u,
420
420
  errors: n,
421
- summary: v
421
+ summary: h
422
422
  },
423
423
  errorsByRow: l
424
424
  };
425
425
  }
426
- const Z = mt((e, o) => ({
427
- ...Ke,
426
+ const te = wt((e, r) => ({
427
+ ...Ue,
428
428
  setSchema: (t) => e({ schema: t }),
429
429
  setSessionId: (t) => e({ sessionId: t }),
430
430
  setFile: (t) => e({
@@ -440,8 +440,8 @@ const Z = mt((e, o) => ({
440
440
  sampleRows: t.sampleRows
441
441
  }),
442
442
  setMappings: (t) => e({ mappings: t }),
443
- updateMapping: (t, n) => e((r) => ({ mappings: r.mappings.map(
444
- (i) => i.sourceColumn === t ? { ...i, targetKey: n, isAutoMapped: !1 } : i
443
+ updateMapping: (t, n) => e((o) => ({ mappings: o.mappings.map(
444
+ (s) => s.sourceColumn === t ? { ...s, targetKey: n, isAutoMapped: !1 } : s
445
445
  ) })),
446
446
  setUnmapped: (t, n) => e({
447
447
  unmappedSource: t,
@@ -449,42 +449,42 @@ const Z = mt((e, o) => ({
449
449
  }),
450
450
  setValidationResults: (t) => {
451
451
  const n = /* @__PURE__ */ new Map();
452
- for (const r of t.errors) {
453
- const l = n.get(r.rowIndex) || [];
454
- l.push(r), n.set(r.rowIndex, l);
452
+ for (const o of t.errors) {
453
+ const l = n.get(o.rowIndex) || [];
454
+ l.push(o), n.set(o.rowIndex, l);
455
455
  }
456
456
  e({ validationResults: t, errorsByRow: n });
457
457
  },
458
458
  revalidate: () => {
459
- const t = o();
459
+ const t = r();
460
460
  if (!t.schema || !t.validationResults) return;
461
- const { validationResults: n, errorsByRow: r } = pe(
461
+ const { validationResults: n, errorsByRow: o } = me(
462
462
  t.rows,
463
463
  t.schema,
464
464
  t.mappings
465
465
  );
466
- e({ validationResults: n, errorsByRow: r });
466
+ e({ validationResults: n, errorsByRow: o });
467
467
  },
468
468
  setStep: (t) => e({ step: t }),
469
469
  nextStep: () => {
470
- const t = ["upload", "mapping", "validation", "review", "complete"], n = t.indexOf(o().step);
470
+ const t = ["upload", "mapping", "validation", "review", "complete"], n = t.indexOf(r().step);
471
471
  n < t.length - 1 && e({ step: t[n + 1] });
472
472
  },
473
473
  previousStep: () => {
474
- const t = ["upload", "mapping", "validation", "review", "complete"], n = t.indexOf(o().step);
474
+ const t = ["upload", "mapping", "validation", "review", "complete"], n = t.indexOf(r().step);
475
475
  n > 0 && e({ step: t[n - 1] });
476
476
  },
477
477
  startEditing: (t, n) => e({
478
478
  editingCell: { rowIndex: t, columnKey: n }
479
479
  }),
480
480
  stopEditing: () => e({ editingCell: null }),
481
- updateCell: (t, n, r) => {
482
- const l = o(), i = [...l.rows], s = i.find((f) => f.rowIndex === t);
483
- s && (s.data = { ...s.data, [n]: String(r) });
481
+ updateCell: (t, n, o) => {
482
+ const l = r(), s = [...l.rows], i = s.find((f) => f.rowIndex === t);
483
+ i && (i.data = { ...i.data, [n]: String(o) });
484
484
  const u = new Set(l.editedRows);
485
- if (u.add(t), e({ rows: i, editedRows: u, editingCell: null }), l.schema && l.validationResults) {
486
- const { validationResults: f, errorsByRow: g } = pe(
487
- i,
485
+ if (u.add(t), e({ rows: s, editedRows: u, editingCell: null }), l.schema && l.validationResults) {
486
+ const { validationResults: f, errorsByRow: g } = me(
487
+ s,
488
488
  l.schema,
489
489
  l.mappings
490
490
  );
@@ -492,68 +492,68 @@ const Z = mt((e, o) => ({
492
492
  }
493
493
  },
494
494
  deleteRow: (t) => {
495
- const n = o(), l = n.rows.filter((i) => i.rowIndex !== t).map((i, s) => ({ ...i, rowIndex: s }));
495
+ const n = r(), l = n.rows.filter((s) => s.rowIndex !== t).map((s, i) => ({ ...s, rowIndex: i }));
496
496
  if (e({
497
497
  rows: l,
498
498
  totalRows: l.length
499
499
  }), n.schema && n.validationResults) {
500
- const { validationResults: i, errorsByRow: s } = pe(
500
+ const { validationResults: s, errorsByRow: i } = me(
501
501
  l,
502
502
  n.schema,
503
503
  n.mappings
504
504
  );
505
- e({ validationResults: i, errorsByRow: s });
505
+ e({ validationResults: s, errorsByRow: i });
506
506
  }
507
507
  },
508
508
  setStatus: (t) => e({ status: t }),
509
509
  setLoading: (t) => e({ isLoading: t }),
510
510
  setError: (t) => e({ error: t }),
511
- reset: () => e(Ke)
512
- })), Bt = ({
511
+ reset: () => e(Ue)
512
+ })), jt = ({
513
513
  onFileSelect: e,
514
- maxSize: o = 50 * 1024 * 1024,
514
+ maxSize: r = 50 * 1024 * 1024,
515
515
  // 50MB
516
516
  acceptedTypes: t = [".csv", ".xlsx", ".xls"]
517
517
  }) => {
518
- const { file: n, fileName: r, fileSize: l, setFile: i, error: s, setError: u, isLoading: f } = Z(), g = Ne(
519
- (C, h) => {
520
- if (h.length > 0) {
518
+ const { file: n, fileName: o, fileSize: l, setFile: s, error: i, setError: u, isLoading: f } = te(), g = Pe(
519
+ (C, v) => {
520
+ if (v.length > 0) {
521
521
  u("Invalid file type or file too large");
522
522
  return;
523
523
  }
524
524
  if (C.length > 0) {
525
- const S = C[0];
526
- i(S), e == null || e(S);
525
+ const y = C[0];
526
+ s(y), e == null || e(y);
527
527
  }
528
528
  },
529
- [e, i, u]
530
- ), { getRootProps: p, getInputProps: d, isDragActive: a } = ht({
529
+ [e, s, u]
530
+ ), { getRootProps: p, getInputProps: d, isDragActive: a } = Ct({
531
531
  onDrop: g,
532
532
  accept: {
533
533
  "text/csv": [".csv"],
534
534
  "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": [".xlsx"],
535
535
  "application/vnd.ms-excel": [".xls"]
536
536
  },
537
- maxSize: o,
537
+ maxSize: r,
538
538
  multiple: !1,
539
539
  disabled: f
540
- }), m = (C) => C < 1024 ? `${C} B` : C < 1024 * 1024 ? `${(C / 1024).toFixed(1)} KB` : `${(C / (1024 * 1024)).toFixed(1)} MB`, v = (C) => {
541
- C.stopPropagation(), Z.getState().reset();
540
+ }), m = (C) => C < 1024 ? `${C} B` : C < 1024 * 1024 ? `${(C / 1024).toFixed(1)} KB` : `${(C / (1024 * 1024)).toFixed(1)} MB`, h = (C) => {
541
+ C.stopPropagation(), te.getState().reset();
542
542
  };
543
543
  return n ? /* @__PURE__ */ c("div", { className: "ff-p-4 ff-rounded-xl ff-border", style: { backgroundColor: "var(--ff-success-light)", borderColor: "var(--ff-success)" }, children: /* @__PURE__ */ w("div", { className: "ff-flex ff-items-center ff-gap-3", children: [
544
- /* @__PURE__ */ c("div", { className: "ff-p-2 ff-rounded-lg", style: { backgroundColor: "rgba(41, 142, 51, 0.15)" }, children: /* @__PURE__ */ c(Et, { className: "ff-w-6 ff-h-6", style: { color: "var(--ff-success)" } }) }),
544
+ /* @__PURE__ */ c("div", { className: "ff-p-2 ff-rounded-lg", style: { backgroundColor: "rgba(41, 142, 51, 0.15)" }, children: /* @__PURE__ */ c(Lt, { className: "ff-w-6 ff-h-6", style: { color: "var(--ff-success)" } }) }),
545
545
  /* @__PURE__ */ w("div", { className: "ff-flex-1 ff-min-w-0", children: [
546
- /* @__PURE__ */ c("p", { className: "ff-font-medium ff-truncate", style: { color: "var(--ff-success-dark)" }, children: r }),
546
+ /* @__PURE__ */ c("p", { className: "ff-font-medium ff-truncate", style: { color: "var(--ff-success-dark)" }, children: o }),
547
547
  /* @__PURE__ */ c("p", { className: "ff-text-sm", style: { color: "var(--ff-success)" }, children: m(l || 0) })
548
548
  ] }),
549
549
  /* @__PURE__ */ c(
550
550
  "button",
551
551
  {
552
- onClick: v,
552
+ onClick: h,
553
553
  className: "ff-p-1.5 ff-rounded-full ff-transition-colors",
554
554
  style: { color: "var(--ff-success)" },
555
555
  "aria-label": "Remove file",
556
- children: /* @__PURE__ */ c(ae, { className: "ff-w-5 ff-h-5" })
556
+ children: /* @__PURE__ */ c(ce, { className: "ff-w-5 ff-h-5" })
557
557
  }
558
558
  )
559
559
  ] }) }) : /* @__PURE__ */ w("div", { className: "ff-space-y-6", children: [
@@ -561,17 +561,17 @@ const Z = mt((e, o) => ({
561
561
  "div",
562
562
  {
563
563
  ...p(),
564
- className: U(
564
+ className: W(
565
565
  "ff-dropzone",
566
566
  a && "ff-dropzone-active",
567
567
  f && "ff-opacity-50 ff-cursor-not-allowed"
568
568
  ),
569
569
  children: [
570
570
  /* @__PURE__ */ c("input", { ...d() }),
571
- /* @__PURE__ */ c("div", { className: "ff-dropzone-icon-wrapper", children: /* @__PURE__ */ c(Qe, { className: "ff-dropzone-icon" }) }),
571
+ /* @__PURE__ */ c("div", { className: "ff-dropzone-icon-wrapper", children: /* @__PURE__ */ c(Ze, { className: "ff-dropzone-icon" }) }),
572
572
  /* @__PURE__ */ c("h3", { className: "ff-dropzone-text", children: a ? "Drop your file here" : "Upload your file" }),
573
573
  /* @__PURE__ */ c("p", { className: "ff-dropzone-hint", children: "Drag and drop or click to select" }),
574
- /* @__PURE__ */ c("label", { className: "ff-inline-block", children: /* @__PURE__ */ c("span", { className: U(
574
+ /* @__PURE__ */ c("label", { className: "ff-inline-block", children: /* @__PURE__ */ c("span", { className: W(
575
575
  "ff-btn ff-btn-primary",
576
576
  f && "ff-opacity-50 ff-cursor-wait"
577
577
  ), children: f ? "Processing..." : "Choose file" }) }),
@@ -579,22 +579,22 @@ const Z = mt((e, o) => ({
579
579
  "Supports ",
580
580
  t.join(", "),
581
581
  " up to ",
582
- m(o)
582
+ m(r)
583
583
  ] })
584
584
  ]
585
585
  }
586
586
  ),
587
- s && /* @__PURE__ */ w("div", { className: "ff-flex ff-items-center ff-gap-2 ff-p-4 ff-rounded-lg ff-text-sm", style: { backgroundColor: "var(--ff-error-light)", color: "var(--ff-error)" }, children: [
588
- /* @__PURE__ */ c(Pe, { className: "ff-w-4 ff-h-4 ff-flex-shrink-0" }),
589
- /* @__PURE__ */ c("p", { children: s })
587
+ i && /* @__PURE__ */ w("div", { className: "ff-flex ff-items-center ff-gap-2 ff-p-4 ff-rounded-lg ff-text-sm", style: { backgroundColor: "var(--ff-error-light)", color: "var(--ff-error)" }, children: [
588
+ /* @__PURE__ */ c(ke, { className: "ff-w-4 ff-h-4 ff-flex-shrink-0" }),
589
+ /* @__PURE__ */ c("p", { children: i })
590
590
  ] })
591
591
  ] });
592
- }, Kt = ({ onMappingChange: e }) => {
593
- const { mappings: o, schema: t, unmappedSource: n, updateMapping: r } = Z(), l = (t == null ? void 0 : t.columns) || [], i = (p, d) => {
592
+ }, Ut = ({ onMappingChange: e }) => {
593
+ const { mappings: r, schema: t, unmappedSource: n, updateMapping: o } = te(), l = (t == null ? void 0 : t.columns) || [], s = (p, d) => {
594
594
  const a = d === "" ? null : d;
595
- r(p, a), e == null || e(p, a);
596
- }, s = (p) => p >= 0.85 ? "var(--ff-success)" : p >= 0.6 ? "var(--ff-warning)" : "var(--ff-error)", u = (p) => p >= 0.85 ? "High" : p >= 0.6 ? "Medium" : "Low", g = new Set(
597
- o.filter((p) => p.targetKey !== null).map((p) => p.targetKey)
595
+ o(p, a), e == null || e(p, a);
596
+ }, i = (p) => p >= 0.85 ? "var(--ff-success)" : p >= 0.6 ? "var(--ff-warning)" : "var(--ff-error)", u = (p) => p >= 0.85 ? "High" : p >= 0.6 ? "Medium" : "Low", g = new Set(
597
+ r.filter((p) => p.targetKey !== null).map((p) => p.targetKey)
598
598
  );
599
599
  return /* @__PURE__ */ w("div", { className: "ff-space-y-4", children: [
600
600
  /* @__PURE__ */ w("div", { className: "ff-mapping-header", children: [
@@ -617,25 +617,25 @@ const Z = mt((e, o) => ({
617
617
  ] })
618
618
  ] })
619
619
  ] }),
620
- /* @__PURE__ */ c("div", { className: "ff-space-y-2", children: o.map((p) => {
620
+ /* @__PURE__ */ c("div", { className: "ff-space-y-2", children: r.map((p) => {
621
621
  l.find((m) => m.key === p.targetKey);
622
622
  const d = p.targetKey !== null, a = p.confidence >= 0.85;
623
623
  return /* @__PURE__ */ w(
624
624
  "div",
625
625
  {
626
- className: U(
626
+ className: W(
627
627
  "ff-mapping-row",
628
628
  d && a && "ff-mapping-row-success",
629
629
  d && !a && "ff-mapping-row-warning"
630
630
  ),
631
631
  children: [
632
632
  /* @__PURE__ */ c("div", { className: "ff-flex-1", children: /* @__PURE__ */ c("div", { className: "ff-mapping-source", children: p.sourceColumn }) }),
633
- /* @__PURE__ */ c("div", { className: "ff-mapping-arrow", children: /* @__PURE__ */ c(yt, { className: "ff-w-5 ff-h-5" }) }),
633
+ /* @__PURE__ */ c("div", { className: "ff-mapping-arrow", children: /* @__PURE__ */ c(_t, { className: "ff-w-5 ff-h-5" }) }),
634
634
  /* @__PURE__ */ c("div", { className: "ff-flex-1 ff-mapping-target", children: /* @__PURE__ */ w(
635
635
  "select",
636
636
  {
637
637
  value: p.targetKey || "",
638
- onChange: (m) => i(p.sourceColumn, m.target.value),
638
+ onChange: (m) => s(p.sourceColumn, m.target.value),
639
639
  className: "ff-input",
640
640
  children: [
641
641
  /* @__PURE__ */ c("option", { value: "", children: "-- Do not import --" }),
@@ -657,8 +657,8 @@ const Z = mt((e, o) => ({
657
657
  ]
658
658
  }
659
659
  ) }),
660
- /* @__PURE__ */ c("div", { className: "ff-mapping-status", children: d ? a ? /* @__PURE__ */ c(xt, { className: "ff-w-5 ff-h-5", style: { color: "var(--ff-success)" } }) : /* @__PURE__ */ c(It, { className: "ff-w-5 ff-h-5", style: { color: "var(--ff-warning)" } }) : /* @__PURE__ */ c("span", { className: "ff-w-5 ff-h-5" }) }),
661
- p.confidence > 0 && /* @__PURE__ */ w("div", { className: "ff-confidence", style: { color: s(p.confidence) }, children: [
660
+ /* @__PURE__ */ c("div", { className: "ff-mapping-status", children: d ? a ? /* @__PURE__ */ c(It, { className: "ff-w-5 ff-h-5", style: { color: "var(--ff-success)" } }) : /* @__PURE__ */ c(Vt, { className: "ff-w-5 ff-h-5", style: { color: "var(--ff-warning)" } }) : /* @__PURE__ */ c("span", { className: "ff-w-5 ff-h-5" }) }),
661
+ p.confidence > 0 && /* @__PURE__ */ w("div", { className: "ff-confidence", style: { color: i(p.confidence) }, children: [
662
662
  /* @__PURE__ */ w("span", { children: [
663
663
  Math.round(p.confidence * 100),
664
664
  "%"
@@ -679,7 +679,7 @@ const Z = mt((e, o) => ({
679
679
  (d) => d.required && !g.has(d.key)
680
680
  );
681
681
  return p.length > 0 ? /* @__PURE__ */ w("div", { className: "ff-flex ff-items-start ff-gap-2 ff-p-4 ff-rounded-lg", style: { backgroundColor: "var(--ff-warning-light)", borderColor: "var(--ff-warning)" }, children: [
682
- /* @__PURE__ */ c(Pe, { className: "ff-w-5 ff-h-5 ff-flex-shrink-0 ff-mt-0.5", style: { color: "var(--ff-warning)" } }),
682
+ /* @__PURE__ */ c(ke, { className: "ff-w-5 ff-h-5 ff-flex-shrink-0 ff-mt-0.5", style: { color: "var(--ff-warning)" } }),
683
683
  /* @__PURE__ */ w("div", { children: [
684
684
  /* @__PURE__ */ c("p", { className: "ff-text-sm ff-font-medium", style: { color: "var(--ff-warning-dark)" }, children: "Required fields not mapped" }),
685
685
  /* @__PURE__ */ c("p", { className: "ff-text-sm ff-mt-1", style: { color: "var(--ff-warning)" }, children: p.map((d) => d.label).join(", ") })
@@ -698,59 +698,59 @@ const Z = mt((e, o) => ({
698
698
  *
699
699
  * @license MIT
700
700
  */
701
- function qt() {
701
+ function Xt() {
702
702
  return {
703
- accessor: (e, o) => typeof e == "function" ? {
704
- ...o,
703
+ accessor: (e, r) => typeof e == "function" ? {
704
+ ...r,
705
705
  accessorFn: e
706
706
  } : {
707
- ...o,
707
+ ...r,
708
708
  accessorKey: e
709
709
  },
710
710
  display: (e) => e,
711
711
  group: (e) => e
712
712
  };
713
713
  }
714
- function j(e, o) {
715
- return typeof e == "function" ? e(o) : e;
714
+ function X(e, r) {
715
+ return typeof e == "function" ? e(r) : e;
716
716
  }
717
- function L(e, o) {
717
+ function L(e, r) {
718
718
  return (t) => {
719
- o.setState((n) => ({
719
+ r.setState((n) => ({
720
720
  ...n,
721
- [e]: j(t, n[e])
721
+ [e]: X(t, n[e])
722
722
  }));
723
723
  };
724
724
  }
725
- function ue(e) {
725
+ function ge(e) {
726
726
  return e instanceof Function;
727
727
  }
728
- function jt(e) {
729
- return Array.isArray(e) && e.every((o) => typeof o == "number");
728
+ function Wt(e) {
729
+ return Array.isArray(e) && e.every((r) => typeof r == "number");
730
730
  }
731
- function Ut(e, o) {
732
- const t = [], n = (r) => {
733
- r.forEach((l) => {
731
+ function Qt(e, r) {
732
+ const t = [], n = (o) => {
733
+ o.forEach((l) => {
734
734
  t.push(l);
735
- const i = o(l);
736
- i != null && i.length && n(i);
735
+ const s = r(l);
736
+ s != null && s.length && n(s);
737
737
  });
738
738
  };
739
739
  return n(e), t;
740
740
  }
741
- function y(e, o, t) {
742
- let n = [], r;
741
+ function S(e, r, t) {
742
+ let n = [], o;
743
743
  return (l) => {
744
- let i;
745
- t.key && t.debug && (i = Date.now());
746
- const s = e(l);
747
- if (!(s.length !== n.length || s.some((g, p) => n[p] !== g)))
748
- return r;
749
- n = s;
744
+ let s;
745
+ t.key && t.debug && (s = Date.now());
746
+ const i = e(l);
747
+ if (!(i.length !== n.length || i.some((g, p) => n[p] !== g)))
748
+ return o;
749
+ n = i;
750
750
  let f;
751
- if (t.key && t.debug && (f = Date.now()), r = o(...s), t == null || t.onChange == null || t.onChange(r), t.key && t.debug && t != null && t.debug()) {
752
- const g = Math.round((Date.now() - i) * 100) / 100, p = Math.round((Date.now() - f) * 100) / 100, d = p / 16, a = (m, v) => {
753
- for (m = String(m); m.length < v; )
751
+ if (t.key && t.debug && (f = Date.now()), o = r(...i), t == null || t.onChange == null || t.onChange(o), t.key && t.debug && t != null && t.debug()) {
752
+ const g = Math.round((Date.now() - s) * 100) / 100, p = Math.round((Date.now() - f) * 100) / 100, d = p / 16, a = (m, h) => {
753
+ for (m = String(m); m.length < h; )
754
754
  m = " " + m;
755
755
  return m;
756
756
  };
@@ -759,73 +759,73 @@ function y(e, o, t) {
759
759
  font-weight: bold;
760
760
  color: hsl(${Math.max(0, Math.min(120 - 120 * d, 120))}deg 100% 31%);`, t == null ? void 0 : t.key);
761
761
  }
762
- return r;
762
+ return o;
763
763
  };
764
764
  }
765
- function R(e, o, t, n) {
765
+ function R(e, r, t, n) {
766
766
  return {
767
767
  debug: () => {
768
- var r;
769
- return (r = e == null ? void 0 : e.debugAll) != null ? r : e[o];
768
+ var o;
769
+ return (o = e == null ? void 0 : e.debugAll) != null ? o : e[r];
770
770
  },
771
771
  key: process.env.NODE_ENV === "development" && t,
772
772
  onChange: n
773
773
  };
774
774
  }
775
- function Xt(e, o, t, n) {
776
- const r = () => {
777
- var i;
778
- return (i = l.getValue()) != null ? i : e.options.renderFallbackValue;
775
+ function Yt(e, r, t, n) {
776
+ const o = () => {
777
+ var s;
778
+ return (s = l.getValue()) != null ? s : e.options.renderFallbackValue;
779
779
  }, l = {
780
- id: `${o.id}_${t.id}`,
781
- row: o,
780
+ id: `${r.id}_${t.id}`,
781
+ row: r,
782
782
  column: t,
783
- getValue: () => o.getValue(n),
784
- renderValue: r,
785
- getContext: y(() => [e, t, o, l], (i, s, u, f) => ({
786
- table: i,
787
- column: s,
783
+ getValue: () => r.getValue(n),
784
+ renderValue: o,
785
+ getContext: S(() => [e, t, r, l], (s, i, u, f) => ({
786
+ table: s,
787
+ column: i,
788
788
  row: u,
789
789
  cell: f,
790
790
  getValue: f.getValue,
791
791
  renderValue: f.renderValue
792
792
  }), R(e.options, "debugCells", "cell.getContext"))
793
793
  };
794
- return e._features.forEach((i) => {
795
- i.createCell == null || i.createCell(l, t, o, e);
794
+ return e._features.forEach((s) => {
795
+ s.createCell == null || s.createCell(l, t, r, e);
796
796
  }, {}), l;
797
797
  }
798
- function Wt(e, o, t, n) {
799
- var r, l;
800
- const s = {
798
+ function Jt(e, r, t, n) {
799
+ var o, l;
800
+ const i = {
801
801
  ...e._getDefaultColumnDef(),
802
- ...o
803
- }, u = s.accessorKey;
804
- let f = (r = (l = s.id) != null ? l : u ? typeof String.prototype.replaceAll == "function" ? u.replaceAll(".", "_") : u.replace(/\./g, "_") : void 0) != null ? r : typeof s.header == "string" ? s.header : void 0, g;
805
- if (s.accessorFn ? g = s.accessorFn : u && (u.includes(".") ? g = (d) => {
802
+ ...r
803
+ }, u = i.accessorKey;
804
+ let f = (o = (l = i.id) != null ? l : u ? typeof String.prototype.replaceAll == "function" ? u.replaceAll(".", "_") : u.replace(/\./g, "_") : void 0) != null ? o : typeof i.header == "string" ? i.header : void 0, g;
805
+ if (i.accessorFn ? g = i.accessorFn : u && (u.includes(".") ? g = (d) => {
806
806
  let a = d;
807
- for (const v of u.split(".")) {
807
+ for (const h of u.split(".")) {
808
808
  var m;
809
- a = (m = a) == null ? void 0 : m[v], process.env.NODE_ENV !== "production" && a === void 0 && console.warn(`"${v}" in deeply nested key "${u}" returned undefined.`);
809
+ a = (m = a) == null ? void 0 : m[h], process.env.NODE_ENV !== "production" && a === void 0 && console.warn(`"${h}" in deeply nested key "${u}" returned undefined.`);
810
810
  }
811
811
  return a;
812
- } : g = (d) => d[s.accessorKey]), !f)
813
- throw process.env.NODE_ENV !== "production" ? new Error(s.accessorFn ? "Columns require an id when using an accessorFn" : "Columns require an id when using a non-string header") : new Error();
812
+ } : g = (d) => d[i.accessorKey]), !f)
813
+ throw process.env.NODE_ENV !== "production" ? new Error(i.accessorFn ? "Columns require an id when using an accessorFn" : "Columns require an id when using a non-string header") : new Error();
814
814
  let p = {
815
815
  id: `${String(f)}`,
816
816
  accessorFn: g,
817
817
  parent: n,
818
818
  depth: t,
819
- columnDef: s,
819
+ columnDef: i,
820
820
  columns: [],
821
- getFlatColumns: y(() => [!0], () => {
821
+ getFlatColumns: S(() => [!0], () => {
822
822
  var d;
823
823
  return [p, ...(d = p.columns) == null ? void 0 : d.flatMap((a) => a.getFlatColumns())];
824
824
  }, R(e.options, "debugColumns", "column.getFlatColumns")),
825
- getLeafColumns: y(() => [e._getOrderColumnsFn()], (d) => {
825
+ getLeafColumns: S(() => [e._getOrderColumnsFn()], (d) => {
826
826
  var a;
827
827
  if ((a = p.columns) != null && a.length) {
828
- let m = p.columns.flatMap((v) => v.getLeafColumns());
828
+ let m = p.columns.flatMap((h) => h.getLeafColumns());
829
829
  return d(m);
830
830
  }
831
831
  return [p];
@@ -836,11 +836,11 @@ function Wt(e, o, t, n) {
836
836
  return p;
837
837
  }
838
838
  const E = "debugHeaders";
839
- function qe(e, o, t) {
839
+ function Xe(e, r, t) {
840
840
  var n;
841
841
  let l = {
842
- id: (n = t.id) != null ? n : o.id,
843
- column: o,
842
+ id: (n = t.id) != null ? n : r.id,
843
+ column: r,
844
844
  index: t.index,
845
845
  isPlaceholder: !!t.isPlaceholder,
846
846
  placeholderId: t.placeholderId,
@@ -850,138 +850,138 @@ function qe(e, o, t) {
850
850
  rowSpan: 0,
851
851
  headerGroup: null,
852
852
  getLeafHeaders: () => {
853
- const i = [], s = (u) => {
854
- u.subHeaders && u.subHeaders.length && u.subHeaders.map(s), i.push(u);
853
+ const s = [], i = (u) => {
854
+ u.subHeaders && u.subHeaders.length && u.subHeaders.map(i), s.push(u);
855
855
  };
856
- return s(l), i;
856
+ return i(l), s;
857
857
  },
858
858
  getContext: () => ({
859
859
  table: e,
860
860
  header: l,
861
- column: o
861
+ column: r
862
862
  })
863
863
  };
864
- return e._features.forEach((i) => {
865
- i.createHeader == null || i.createHeader(l, e);
864
+ return e._features.forEach((s) => {
865
+ s.createHeader == null || s.createHeader(l, e);
866
866
  }), l;
867
867
  }
868
- const Qt = {
868
+ const Zt = {
869
869
  createTable: (e) => {
870
- e.getHeaderGroups = y(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.left, e.getState().columnPinning.right], (o, t, n, r) => {
871
- var l, i;
872
- const s = (l = n == null ? void 0 : n.map((p) => t.find((d) => d.id === p)).filter(Boolean)) != null ? l : [], u = (i = r == null ? void 0 : r.map((p) => t.find((d) => d.id === p)).filter(Boolean)) != null ? i : [], f = t.filter((p) => !(n != null && n.includes(p.id)) && !(r != null && r.includes(p.id)));
873
- return le(o, [...s, ...f, ...u], e);
874
- }, R(e.options, E, "getHeaderGroups")), e.getCenterHeaderGroups = y(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.left, e.getState().columnPinning.right], (o, t, n, r) => (t = t.filter((l) => !(n != null && n.includes(l.id)) && !(r != null && r.includes(l.id))), le(o, t, e, "center")), R(e.options, E, "getCenterHeaderGroups")), e.getLeftHeaderGroups = y(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.left], (o, t, n) => {
875
- var r;
876
- const l = (r = n == null ? void 0 : n.map((i) => t.find((s) => s.id === i)).filter(Boolean)) != null ? r : [];
877
- return le(o, l, e, "left");
878
- }, R(e.options, E, "getLeftHeaderGroups")), e.getRightHeaderGroups = y(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.right], (o, t, n) => {
879
- var r;
880
- const l = (r = n == null ? void 0 : n.map((i) => t.find((s) => s.id === i)).filter(Boolean)) != null ? r : [];
881
- return le(o, l, e, "right");
882
- }, R(e.options, E, "getRightHeaderGroups")), e.getFooterGroups = y(() => [e.getHeaderGroups()], (o) => [...o].reverse(), R(e.options, E, "getFooterGroups")), e.getLeftFooterGroups = y(() => [e.getLeftHeaderGroups()], (o) => [...o].reverse(), R(e.options, E, "getLeftFooterGroups")), e.getCenterFooterGroups = y(() => [e.getCenterHeaderGroups()], (o) => [...o].reverse(), R(e.options, E, "getCenterFooterGroups")), e.getRightFooterGroups = y(() => [e.getRightHeaderGroups()], (o) => [...o].reverse(), R(e.options, E, "getRightFooterGroups")), e.getFlatHeaders = y(() => [e.getHeaderGroups()], (o) => o.map((t) => t.headers).flat(), R(e.options, E, "getFlatHeaders")), e.getLeftFlatHeaders = y(() => [e.getLeftHeaderGroups()], (o) => o.map((t) => t.headers).flat(), R(e.options, E, "getLeftFlatHeaders")), e.getCenterFlatHeaders = y(() => [e.getCenterHeaderGroups()], (o) => o.map((t) => t.headers).flat(), R(e.options, E, "getCenterFlatHeaders")), e.getRightFlatHeaders = y(() => [e.getRightHeaderGroups()], (o) => o.map((t) => t.headers).flat(), R(e.options, E, "getRightFlatHeaders")), e.getCenterLeafHeaders = y(() => [e.getCenterFlatHeaders()], (o) => o.filter((t) => {
870
+ e.getHeaderGroups = S(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.left, e.getState().columnPinning.right], (r, t, n, o) => {
871
+ var l, s;
872
+ const i = (l = n == null ? void 0 : n.map((p) => t.find((d) => d.id === p)).filter(Boolean)) != null ? l : [], u = (s = o == null ? void 0 : o.map((p) => t.find((d) => d.id === p)).filter(Boolean)) != null ? s : [], f = t.filter((p) => !(n != null && n.includes(p.id)) && !(o != null && o.includes(p.id)));
873
+ return ue(r, [...i, ...f, ...u], e);
874
+ }, R(e.options, E, "getHeaderGroups")), e.getCenterHeaderGroups = S(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.left, e.getState().columnPinning.right], (r, t, n, o) => (t = t.filter((l) => !(n != null && n.includes(l.id)) && !(o != null && o.includes(l.id))), ue(r, t, e, "center")), R(e.options, E, "getCenterHeaderGroups")), e.getLeftHeaderGroups = S(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.left], (r, t, n) => {
875
+ var o;
876
+ const l = (o = n == null ? void 0 : n.map((s) => t.find((i) => i.id === s)).filter(Boolean)) != null ? o : [];
877
+ return ue(r, l, e, "left");
878
+ }, R(e.options, E, "getLeftHeaderGroups")), e.getRightHeaderGroups = S(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.right], (r, t, n) => {
879
+ var o;
880
+ const l = (o = n == null ? void 0 : n.map((s) => t.find((i) => i.id === s)).filter(Boolean)) != null ? o : [];
881
+ return ue(r, l, e, "right");
882
+ }, R(e.options, E, "getRightHeaderGroups")), e.getFooterGroups = S(() => [e.getHeaderGroups()], (r) => [...r].reverse(), R(e.options, E, "getFooterGroups")), e.getLeftFooterGroups = S(() => [e.getLeftHeaderGroups()], (r) => [...r].reverse(), R(e.options, E, "getLeftFooterGroups")), e.getCenterFooterGroups = S(() => [e.getCenterHeaderGroups()], (r) => [...r].reverse(), R(e.options, E, "getCenterFooterGroups")), e.getRightFooterGroups = S(() => [e.getRightHeaderGroups()], (r) => [...r].reverse(), R(e.options, E, "getRightFooterGroups")), e.getFlatHeaders = S(() => [e.getHeaderGroups()], (r) => r.map((t) => t.headers).flat(), R(e.options, E, "getFlatHeaders")), e.getLeftFlatHeaders = S(() => [e.getLeftHeaderGroups()], (r) => r.map((t) => t.headers).flat(), R(e.options, E, "getLeftFlatHeaders")), e.getCenterFlatHeaders = S(() => [e.getCenterHeaderGroups()], (r) => r.map((t) => t.headers).flat(), R(e.options, E, "getCenterFlatHeaders")), e.getRightFlatHeaders = S(() => [e.getRightHeaderGroups()], (r) => r.map((t) => t.headers).flat(), R(e.options, E, "getRightFlatHeaders")), e.getCenterLeafHeaders = S(() => [e.getCenterFlatHeaders()], (r) => r.filter((t) => {
883
883
  var n;
884
884
  return !((n = t.subHeaders) != null && n.length);
885
- }), R(e.options, E, "getCenterLeafHeaders")), e.getLeftLeafHeaders = y(() => [e.getLeftFlatHeaders()], (o) => o.filter((t) => {
885
+ }), R(e.options, E, "getCenterLeafHeaders")), e.getLeftLeafHeaders = S(() => [e.getLeftFlatHeaders()], (r) => r.filter((t) => {
886
886
  var n;
887
887
  return !((n = t.subHeaders) != null && n.length);
888
- }), R(e.options, E, "getLeftLeafHeaders")), e.getRightLeafHeaders = y(() => [e.getRightFlatHeaders()], (o) => o.filter((t) => {
888
+ }), R(e.options, E, "getLeftLeafHeaders")), e.getRightLeafHeaders = S(() => [e.getRightFlatHeaders()], (r) => r.filter((t) => {
889
889
  var n;
890
890
  return !((n = t.subHeaders) != null && n.length);
891
- }), R(e.options, E, "getRightLeafHeaders")), e.getLeafHeaders = y(() => [e.getLeftHeaderGroups(), e.getCenterHeaderGroups(), e.getRightHeaderGroups()], (o, t, n) => {
892
- var r, l, i, s, u, f;
893
- return [...(r = (l = o[0]) == null ? void 0 : l.headers) != null ? r : [], ...(i = (s = t[0]) == null ? void 0 : s.headers) != null ? i : [], ...(u = (f = n[0]) == null ? void 0 : f.headers) != null ? u : []].map((g) => g.getLeafHeaders()).flat();
891
+ }), R(e.options, E, "getRightLeafHeaders")), e.getLeafHeaders = S(() => [e.getLeftHeaderGroups(), e.getCenterHeaderGroups(), e.getRightHeaderGroups()], (r, t, n) => {
892
+ var o, l, s, i, u, f;
893
+ return [...(o = (l = r[0]) == null ? void 0 : l.headers) != null ? o : [], ...(s = (i = t[0]) == null ? void 0 : i.headers) != null ? s : [], ...(u = (f = n[0]) == null ? void 0 : f.headers) != null ? u : []].map((g) => g.getLeafHeaders()).flat();
894
894
  }, R(e.options, E, "getLeafHeaders"));
895
895
  }
896
896
  };
897
- function le(e, o, t, n) {
898
- var r, l;
899
- let i = 0;
900
- const s = function(d, a) {
901
- a === void 0 && (a = 1), i = Math.max(i, a), d.filter((m) => m.getIsVisible()).forEach((m) => {
902
- var v;
903
- (v = m.columns) != null && v.length && s(m.columns, a + 1);
897
+ function ue(e, r, t, n) {
898
+ var o, l;
899
+ let s = 0;
900
+ const i = function(d, a) {
901
+ a === void 0 && (a = 1), s = Math.max(s, a), d.filter((m) => m.getIsVisible()).forEach((m) => {
902
+ var h;
903
+ (h = m.columns) != null && h.length && i(m.columns, a + 1);
904
904
  }, 0);
905
905
  };
906
- s(e);
906
+ i(e);
907
907
  let u = [];
908
908
  const f = (d, a) => {
909
909
  const m = {
910
910
  depth: a,
911
911
  id: [n, `${a}`].filter(Boolean).join("_"),
912
912
  headers: []
913
- }, v = [];
913
+ }, h = [];
914
914
  d.forEach((C) => {
915
- const h = [...v].reverse()[0], S = C.column.depth === m.depth;
916
- let x, I = !1;
917
- if (S && C.column.parent ? x = C.column.parent : (x = C.column, I = !0), h && (h == null ? void 0 : h.column) === x)
918
- h.subHeaders.push(C);
915
+ const v = [...h].reverse()[0], y = C.column.depth === m.depth;
916
+ let x, $ = !1;
917
+ if (y && C.column.parent ? x = C.column.parent : (x = C.column, $ = !0), v && (v == null ? void 0 : v.column) === x)
918
+ v.subHeaders.push(C);
919
919
  else {
920
- const F = qe(t, x, {
920
+ const F = Xe(t, x, {
921
921
  id: [n, a, x.id, C == null ? void 0 : C.id].filter(Boolean).join("_"),
922
- isPlaceholder: I,
923
- placeholderId: I ? `${v.filter((V) => V.column === x).length}` : void 0,
922
+ isPlaceholder: $,
923
+ placeholderId: $ ? `${h.filter((P) => P.column === x).length}` : void 0,
924
924
  depth: a,
925
- index: v.length
925
+ index: h.length
926
926
  });
927
- F.subHeaders.push(C), v.push(F);
927
+ F.subHeaders.push(C), h.push(F);
928
928
  }
929
929
  m.headers.push(C), C.headerGroup = m;
930
- }), u.push(m), a > 0 && f(v, a - 1);
931
- }, g = o.map((d, a) => qe(t, d, {
932
- depth: i,
930
+ }), u.push(m), a > 0 && f(h, a - 1);
931
+ }, g = r.map((d, a) => Xe(t, d, {
932
+ depth: s,
933
933
  index: a
934
934
  }));
935
- f(g, i - 1), u.reverse();
935
+ f(g, s - 1), u.reverse();
936
936
  const p = (d) => d.filter((m) => m.column.getIsVisible()).map((m) => {
937
- let v = 0, C = 0, h = [0];
938
- m.subHeaders && m.subHeaders.length ? (h = [], p(m.subHeaders).forEach((x) => {
937
+ let h = 0, C = 0, v = [0];
938
+ m.subHeaders && m.subHeaders.length ? (v = [], p(m.subHeaders).forEach((x) => {
939
939
  let {
940
- colSpan: I,
940
+ colSpan: $,
941
941
  rowSpan: F
942
942
  } = x;
943
- v += I, h.push(F);
944
- })) : v = 1;
945
- const S = Math.min(...h);
946
- return C = C + S, m.colSpan = v, m.rowSpan = C, {
947
- colSpan: v,
943
+ h += $, v.push(F);
944
+ })) : h = 1;
945
+ const y = Math.min(...v);
946
+ return C = C + y, m.colSpan = h, m.rowSpan = C, {
947
+ colSpan: h,
948
948
  rowSpan: C
949
949
  };
950
950
  });
951
- return p((r = (l = u[0]) == null ? void 0 : l.headers) != null ? r : []), u;
951
+ return p((o = (l = u[0]) == null ? void 0 : l.headers) != null ? o : []), u;
952
952
  }
953
- const Ee = (e, o, t, n, r, l, i) => {
954
- let s = {
955
- id: o,
953
+ const be = (e, r, t, n, o, l, s) => {
954
+ let i = {
955
+ id: r,
956
956
  index: n,
957
957
  original: t,
958
- depth: r,
959
- parentId: i,
958
+ depth: o,
959
+ parentId: s,
960
960
  _valuesCache: {},
961
961
  _uniqueValuesCache: {},
962
962
  getValue: (u) => {
963
- if (s._valuesCache.hasOwnProperty(u))
964
- return s._valuesCache[u];
963
+ if (i._valuesCache.hasOwnProperty(u))
964
+ return i._valuesCache[u];
965
965
  const f = e.getColumn(u);
966
966
  if (f != null && f.accessorFn)
967
- return s._valuesCache[u] = f.accessorFn(s.original, n), s._valuesCache[u];
967
+ return i._valuesCache[u] = f.accessorFn(i.original, n), i._valuesCache[u];
968
968
  },
969
969
  getUniqueValues: (u) => {
970
- if (s._uniqueValuesCache.hasOwnProperty(u))
971
- return s._uniqueValuesCache[u];
970
+ if (i._uniqueValuesCache.hasOwnProperty(u))
971
+ return i._uniqueValuesCache[u];
972
972
  const f = e.getColumn(u);
973
973
  if (f != null && f.accessorFn)
974
- return f.columnDef.getUniqueValues ? (s._uniqueValuesCache[u] = f.columnDef.getUniqueValues(s.original, n), s._uniqueValuesCache[u]) : (s._uniqueValuesCache[u] = [s.getValue(u)], s._uniqueValuesCache[u]);
974
+ return f.columnDef.getUniqueValues ? (i._uniqueValuesCache[u] = f.columnDef.getUniqueValues(i.original, n), i._uniqueValuesCache[u]) : (i._uniqueValuesCache[u] = [i.getValue(u)], i._uniqueValuesCache[u]);
975
975
  },
976
976
  renderValue: (u) => {
977
977
  var f;
978
- return (f = s.getValue(u)) != null ? f : e.options.renderFallbackValue;
978
+ return (f = i.getValue(u)) != null ? f : e.options.renderFallbackValue;
979
979
  },
980
980
  subRows: [],
981
- getLeafRows: () => Ut(s.subRows, (u) => u.subRows),
982
- getParentRow: () => s.parentId ? e.getRow(s.parentId, !0) : void 0,
981
+ getLeafRows: () => Qt(i.subRows, (u) => u.subRows),
982
+ getParentRow: () => i.parentId ? e.getRow(i.parentId, !0) : void 0,
983
983
  getParentRows: () => {
984
- let u = [], f = s;
984
+ let u = [], f = i;
985
985
  for (; ; ) {
986
986
  const g = f.getParentRow();
987
987
  if (!g) break;
@@ -989,85 +989,85 @@ const Ee = (e, o, t, n, r, l, i) => {
989
989
  }
990
990
  return u.reverse();
991
991
  },
992
- getAllCells: y(() => [e.getAllLeafColumns()], (u) => u.map((f) => Xt(e, s, f, f.id)), R(e.options, "debugRows", "getAllCells")),
993
- _getAllCellsByColumnId: y(() => [s.getAllCells()], (u) => u.reduce((f, g) => (f[g.column.id] = g, f), {}), R(e.options, "debugRows", "getAllCellsByColumnId"))
992
+ getAllCells: S(() => [e.getAllLeafColumns()], (u) => u.map((f) => Yt(e, i, f, f.id)), R(e.options, "debugRows", "getAllCells")),
993
+ _getAllCellsByColumnId: S(() => [i.getAllCells()], (u) => u.reduce((f, g) => (f[g.column.id] = g, f), {}), R(e.options, "debugRows", "getAllCellsByColumnId"))
994
994
  };
995
995
  for (let u = 0; u < e._features.length; u++) {
996
996
  const f = e._features[u];
997
- f == null || f.createRow == null || f.createRow(s, e);
997
+ f == null || f.createRow == null || f.createRow(i, e);
998
998
  }
999
- return s;
1000
- }, Yt = {
1001
- createColumn: (e, o) => {
1002
- e._getFacetedRowModel = o.options.getFacetedRowModel && o.options.getFacetedRowModel(o, e.id), e.getFacetedRowModel = () => e._getFacetedRowModel ? e._getFacetedRowModel() : o.getPreFilteredRowModel(), e._getFacetedUniqueValues = o.options.getFacetedUniqueValues && o.options.getFacetedUniqueValues(o, e.id), e.getFacetedUniqueValues = () => e._getFacetedUniqueValues ? e._getFacetedUniqueValues() : /* @__PURE__ */ new Map(), e._getFacetedMinMaxValues = o.options.getFacetedMinMaxValues && o.options.getFacetedMinMaxValues(o, e.id), e.getFacetedMinMaxValues = () => {
999
+ return i;
1000
+ }, en = {
1001
+ createColumn: (e, r) => {
1002
+ e._getFacetedRowModel = r.options.getFacetedRowModel && r.options.getFacetedRowModel(r, e.id), e.getFacetedRowModel = () => e._getFacetedRowModel ? e._getFacetedRowModel() : r.getPreFilteredRowModel(), e._getFacetedUniqueValues = r.options.getFacetedUniqueValues && r.options.getFacetedUniqueValues(r, e.id), e.getFacetedUniqueValues = () => e._getFacetedUniqueValues ? e._getFacetedUniqueValues() : /* @__PURE__ */ new Map(), e._getFacetedMinMaxValues = r.options.getFacetedMinMaxValues && r.options.getFacetedMinMaxValues(r, e.id), e.getFacetedMinMaxValues = () => {
1003
1003
  if (e._getFacetedMinMaxValues)
1004
1004
  return e._getFacetedMinMaxValues();
1005
1005
  };
1006
1006
  }
1007
- }, Ye = (e, o, t) => {
1008
- var n, r;
1007
+ }, et = (e, r, t) => {
1008
+ var n, o;
1009
1009
  const l = t == null || (n = t.toString()) == null ? void 0 : n.toLowerCase();
1010
- return !!(!((r = e.getValue(o)) == null || (r = r.toString()) == null || (r = r.toLowerCase()) == null) && r.includes(l));
1010
+ return !!(!((o = e.getValue(r)) == null || (o = o.toString()) == null || (o = o.toLowerCase()) == null) && o.includes(l));
1011
1011
  };
1012
- Ye.autoRemove = (e) => G(e);
1013
- const Je = (e, o, t) => {
1012
+ et.autoRemove = (e) => O(e);
1013
+ const tt = (e, r, t) => {
1014
1014
  var n;
1015
- return !!(!((n = e.getValue(o)) == null || (n = n.toString()) == null) && n.includes(t));
1015
+ return !!(!((n = e.getValue(r)) == null || (n = n.toString()) == null) && n.includes(t));
1016
1016
  };
1017
- Je.autoRemove = (e) => G(e);
1018
- const Ze = (e, o, t) => {
1017
+ tt.autoRemove = (e) => O(e);
1018
+ const nt = (e, r, t) => {
1019
1019
  var n;
1020
- return ((n = e.getValue(o)) == null || (n = n.toString()) == null ? void 0 : n.toLowerCase()) === (t == null ? void 0 : t.toLowerCase());
1020
+ return ((n = e.getValue(r)) == null || (n = n.toString()) == null ? void 0 : n.toLowerCase()) === (t == null ? void 0 : t.toLowerCase());
1021
1021
  };
1022
- Ze.autoRemove = (e) => G(e);
1023
- const et = (e, o, t) => {
1022
+ nt.autoRemove = (e) => O(e);
1023
+ const rt = (e, r, t) => {
1024
1024
  var n;
1025
- return (n = e.getValue(o)) == null ? void 0 : n.includes(t);
1025
+ return (n = e.getValue(r)) == null ? void 0 : n.includes(t);
1026
1026
  };
1027
- et.autoRemove = (e) => G(e);
1028
- const tt = (e, o, t) => !t.some((n) => {
1029
- var r;
1030
- return !((r = e.getValue(o)) != null && r.includes(n));
1027
+ rt.autoRemove = (e) => O(e);
1028
+ const ot = (e, r, t) => !t.some((n) => {
1029
+ var o;
1030
+ return !((o = e.getValue(r)) != null && o.includes(n));
1031
1031
  });
1032
- tt.autoRemove = (e) => G(e) || !(e != null && e.length);
1033
- const nt = (e, o, t) => t.some((n) => {
1034
- var r;
1035
- return (r = e.getValue(o)) == null ? void 0 : r.includes(n);
1032
+ ot.autoRemove = (e) => O(e) || !(e != null && e.length);
1033
+ const lt = (e, r, t) => t.some((n) => {
1034
+ var o;
1035
+ return (o = e.getValue(r)) == null ? void 0 : o.includes(n);
1036
1036
  });
1037
- nt.autoRemove = (e) => G(e) || !(e != null && e.length);
1038
- const ot = (e, o, t) => e.getValue(o) === t;
1039
- ot.autoRemove = (e) => G(e);
1040
- const rt = (e, o, t) => e.getValue(o) == t;
1041
- rt.autoRemove = (e) => G(e);
1042
- const De = (e, o, t) => {
1043
- let [n, r] = t;
1044
- const l = e.getValue(o);
1045
- return l >= n && l <= r;
1037
+ lt.autoRemove = (e) => O(e) || !(e != null && e.length);
1038
+ const st = (e, r, t) => e.getValue(r) === t;
1039
+ st.autoRemove = (e) => O(e);
1040
+ const it = (e, r, t) => e.getValue(r) == t;
1041
+ it.autoRemove = (e) => O(e);
1042
+ const De = (e, r, t) => {
1043
+ let [n, o] = t;
1044
+ const l = e.getValue(r);
1045
+ return l >= n && l <= o;
1046
1046
  };
1047
1047
  De.resolveFilterValue = (e) => {
1048
- let [o, t] = e, n = typeof o != "number" ? parseFloat(o) : o, r = typeof t != "number" ? parseFloat(t) : t, l = o === null || Number.isNaN(n) ? -1 / 0 : n, i = t === null || Number.isNaN(r) ? 1 / 0 : r;
1049
- if (l > i) {
1050
- const s = l;
1051
- l = i, i = s;
1048
+ let [r, t] = e, n = typeof r != "number" ? parseFloat(r) : r, o = typeof t != "number" ? parseFloat(t) : t, l = r === null || Number.isNaN(n) ? -1 / 0 : n, s = t === null || Number.isNaN(o) ? 1 / 0 : o;
1049
+ if (l > s) {
1050
+ const i = l;
1051
+ l = s, s = i;
1052
1052
  }
1053
- return [l, i];
1053
+ return [l, s];
1054
1054
  };
1055
- De.autoRemove = (e) => G(e) || G(e[0]) && G(e[1]);
1056
- const B = {
1057
- includesString: Ye,
1058
- includesStringSensitive: Je,
1059
- equalsString: Ze,
1060
- arrIncludes: et,
1061
- arrIncludesAll: tt,
1062
- arrIncludesSome: nt,
1063
- equals: ot,
1064
- weakEquals: rt,
1055
+ De.autoRemove = (e) => O(e) || O(e[0]) && O(e[1]);
1056
+ const q = {
1057
+ includesString: et,
1058
+ includesStringSensitive: tt,
1059
+ equalsString: nt,
1060
+ arrIncludes: rt,
1061
+ arrIncludesAll: ot,
1062
+ arrIncludesSome: lt,
1063
+ equals: st,
1064
+ weakEquals: it,
1065
1065
  inNumberRange: De
1066
1066
  };
1067
- function G(e) {
1067
+ function O(e) {
1068
1068
  return e == null || e === "";
1069
1069
  }
1070
- const Jt = {
1070
+ const tn = {
1071
1071
  getDefaultColumnDef: () => ({
1072
1072
  filterFn: "auto"
1073
1073
  }),
@@ -1080,35 +1080,35 @@ const Jt = {
1080
1080
  filterFromLeafRows: !1,
1081
1081
  maxLeafRowFilterDepth: 100
1082
1082
  }),
1083
- createColumn: (e, o) => {
1083
+ createColumn: (e, r) => {
1084
1084
  e.getAutoFilterFn = () => {
1085
- const t = o.getCoreRowModel().flatRows[0], n = t == null ? void 0 : t.getValue(e.id);
1086
- return typeof n == "string" ? B.includesString : typeof n == "number" ? B.inNumberRange : typeof n == "boolean" || n !== null && typeof n == "object" ? B.equals : Array.isArray(n) ? B.arrIncludes : B.weakEquals;
1085
+ const t = r.getCoreRowModel().flatRows[0], n = t == null ? void 0 : t.getValue(e.id);
1086
+ return typeof n == "string" ? q.includesString : typeof n == "number" ? q.inNumberRange : typeof n == "boolean" || n !== null && typeof n == "object" ? q.equals : Array.isArray(n) ? q.arrIncludes : q.weakEquals;
1087
1087
  }, e.getFilterFn = () => {
1088
1088
  var t, n;
1089
- return ue(e.columnDef.filterFn) ? e.columnDef.filterFn : e.columnDef.filterFn === "auto" ? e.getAutoFilterFn() : (
1089
+ return ge(e.columnDef.filterFn) ? e.columnDef.filterFn : e.columnDef.filterFn === "auto" ? e.getAutoFilterFn() : (
1090
1090
  // @ts-ignore
1091
- (t = (n = o.options.filterFns) == null ? void 0 : n[e.columnDef.filterFn]) != null ? t : B[e.columnDef.filterFn]
1091
+ (t = (n = r.options.filterFns) == null ? void 0 : n[e.columnDef.filterFn]) != null ? t : q[e.columnDef.filterFn]
1092
1092
  );
1093
1093
  }, e.getCanFilter = () => {
1094
- var t, n, r;
1095
- return ((t = e.columnDef.enableColumnFilter) != null ? t : !0) && ((n = o.options.enableColumnFilters) != null ? n : !0) && ((r = o.options.enableFilters) != null ? r : !0) && !!e.accessorFn;
1094
+ var t, n, o;
1095
+ return ((t = e.columnDef.enableColumnFilter) != null ? t : !0) && ((n = r.options.enableColumnFilters) != null ? n : !0) && ((o = r.options.enableFilters) != null ? o : !0) && !!e.accessorFn;
1096
1096
  }, e.getIsFiltered = () => e.getFilterIndex() > -1, e.getFilterValue = () => {
1097
1097
  var t;
1098
- return (t = o.getState().columnFilters) == null || (t = t.find((n) => n.id === e.id)) == null ? void 0 : t.value;
1098
+ return (t = r.getState().columnFilters) == null || (t = t.find((n) => n.id === e.id)) == null ? void 0 : t.value;
1099
1099
  }, e.getFilterIndex = () => {
1100
1100
  var t, n;
1101
- return (t = (n = o.getState().columnFilters) == null ? void 0 : n.findIndex((r) => r.id === e.id)) != null ? t : -1;
1101
+ return (t = (n = r.getState().columnFilters) == null ? void 0 : n.findIndex((o) => o.id === e.id)) != null ? t : -1;
1102
1102
  }, e.setFilterValue = (t) => {
1103
- o.setColumnFilters((n) => {
1104
- const r = e.getFilterFn(), l = n == null ? void 0 : n.find((g) => g.id === e.id), i = j(t, l ? l.value : void 0);
1105
- if (je(r, i, e)) {
1106
- var s;
1107
- return (s = n == null ? void 0 : n.filter((g) => g.id !== e.id)) != null ? s : [];
1103
+ r.setColumnFilters((n) => {
1104
+ const o = e.getFilterFn(), l = n == null ? void 0 : n.find((g) => g.id === e.id), s = X(t, l ? l.value : void 0);
1105
+ if (We(o, s, e)) {
1106
+ var i;
1107
+ return (i = n == null ? void 0 : n.filter((g) => g.id !== e.id)) != null ? i : [];
1108
1108
  }
1109
1109
  const u = {
1110
1110
  id: e.id,
1111
- value: i
1111
+ value: s
1112
1112
  };
1113
1113
  if (l) {
1114
1114
  var f;
@@ -1118,85 +1118,85 @@ const Jt = {
1118
1118
  });
1119
1119
  };
1120
1120
  },
1121
- createRow: (e, o) => {
1121
+ createRow: (e, r) => {
1122
1122
  e.columnFilters = {}, e.columnFiltersMeta = {};
1123
1123
  },
1124
1124
  createTable: (e) => {
1125
- e.setColumnFilters = (o) => {
1126
- const t = e.getAllLeafColumns(), n = (r) => {
1125
+ e.setColumnFilters = (r) => {
1126
+ const t = e.getAllLeafColumns(), n = (o) => {
1127
1127
  var l;
1128
- return (l = j(o, r)) == null ? void 0 : l.filter((i) => {
1129
- const s = t.find((u) => u.id === i.id);
1130
- if (s) {
1131
- const u = s.getFilterFn();
1132
- if (je(u, i.value, s))
1128
+ return (l = X(r, o)) == null ? void 0 : l.filter((s) => {
1129
+ const i = t.find((u) => u.id === s.id);
1130
+ if (i) {
1131
+ const u = i.getFilterFn();
1132
+ if (We(u, s.value, i))
1133
1133
  return !1;
1134
1134
  }
1135
1135
  return !0;
1136
1136
  });
1137
1137
  };
1138
1138
  e.options.onColumnFiltersChange == null || e.options.onColumnFiltersChange(n);
1139
- }, e.resetColumnFilters = (o) => {
1139
+ }, e.resetColumnFilters = (r) => {
1140
1140
  var t, n;
1141
- e.setColumnFilters(o ? [] : (t = (n = e.initialState) == null ? void 0 : n.columnFilters) != null ? t : []);
1141
+ e.setColumnFilters(r ? [] : (t = (n = e.initialState) == null ? void 0 : n.columnFilters) != null ? t : []);
1142
1142
  }, e.getPreFilteredRowModel = () => e.getCoreRowModel(), e.getFilteredRowModel = () => (!e._getFilteredRowModel && e.options.getFilteredRowModel && (e._getFilteredRowModel = e.options.getFilteredRowModel(e)), e.options.manualFiltering || !e._getFilteredRowModel ? e.getPreFilteredRowModel() : e._getFilteredRowModel());
1143
1143
  }
1144
1144
  };
1145
- function je(e, o, t) {
1146
- return (e && e.autoRemove ? e.autoRemove(o, t) : !1) || typeof o > "u" || typeof o == "string" && !o;
1145
+ function We(e, r, t) {
1146
+ return (e && e.autoRemove ? e.autoRemove(r, t) : !1) || typeof r > "u" || typeof r == "string" && !r;
1147
1147
  }
1148
- const Zt = (e, o, t) => t.reduce((n, r) => {
1149
- const l = r.getValue(e);
1148
+ const nn = (e, r, t) => t.reduce((n, o) => {
1149
+ const l = o.getValue(e);
1150
1150
  return n + (typeof l == "number" ? l : 0);
1151
- }, 0), en = (e, o, t) => {
1151
+ }, 0), rn = (e, r, t) => {
1152
1152
  let n;
1153
- return t.forEach((r) => {
1154
- const l = r.getValue(e);
1153
+ return t.forEach((o) => {
1154
+ const l = o.getValue(e);
1155
1155
  l != null && (n > l || n === void 0 && l >= l) && (n = l);
1156
1156
  }), n;
1157
- }, tn = (e, o, t) => {
1157
+ }, on = (e, r, t) => {
1158
1158
  let n;
1159
- return t.forEach((r) => {
1160
- const l = r.getValue(e);
1159
+ return t.forEach((o) => {
1160
+ const l = o.getValue(e);
1161
1161
  l != null && (n < l || n === void 0 && l >= l) && (n = l);
1162
1162
  }), n;
1163
- }, nn = (e, o, t) => {
1164
- let n, r;
1163
+ }, ln = (e, r, t) => {
1164
+ let n, o;
1165
1165
  return t.forEach((l) => {
1166
- const i = l.getValue(e);
1167
- i != null && (n === void 0 ? i >= i && (n = r = i) : (n > i && (n = i), r < i && (r = i)));
1168
- }), [n, r];
1169
- }, on = (e, o) => {
1166
+ const s = l.getValue(e);
1167
+ s != null && (n === void 0 ? s >= s && (n = o = s) : (n > s && (n = s), o < s && (o = s)));
1168
+ }), [n, o];
1169
+ }, sn = (e, r) => {
1170
1170
  let t = 0, n = 0;
1171
- if (o.forEach((r) => {
1172
- let l = r.getValue(e);
1171
+ if (r.forEach((o) => {
1172
+ let l = o.getValue(e);
1173
1173
  l != null && (l = +l) >= l && (++t, n += l);
1174
1174
  }), t) return n / t;
1175
- }, rn = (e, o) => {
1176
- if (!o.length)
1175
+ }, an = (e, r) => {
1176
+ if (!r.length)
1177
1177
  return;
1178
- const t = o.map((l) => l.getValue(e));
1179
- if (!jt(t))
1178
+ const t = r.map((l) => l.getValue(e));
1179
+ if (!Wt(t))
1180
1180
  return;
1181
1181
  if (t.length === 1)
1182
1182
  return t[0];
1183
- const n = Math.floor(t.length / 2), r = t.sort((l, i) => l - i);
1184
- return t.length % 2 !== 0 ? r[n] : (r[n - 1] + r[n]) / 2;
1185
- }, ln = (e, o) => Array.from(new Set(o.map((t) => t.getValue(e))).values()), sn = (e, o) => new Set(o.map((t) => t.getValue(e))).size, an = (e, o) => o.length, me = {
1186
- sum: Zt,
1187
- min: en,
1188
- max: tn,
1189
- extent: nn,
1190
- mean: on,
1191
- median: rn,
1192
- unique: ln,
1193
- uniqueCount: sn,
1194
- count: an
1195
- }, un = {
1183
+ const n = Math.floor(t.length / 2), o = t.sort((l, s) => l - s);
1184
+ return t.length % 2 !== 0 ? o[n] : (o[n - 1] + o[n]) / 2;
1185
+ }, un = (e, r) => Array.from(new Set(r.map((t) => t.getValue(e))).values()), fn = (e, r) => new Set(r.map((t) => t.getValue(e))).size, dn = (e, r) => r.length, he = {
1186
+ sum: nn,
1187
+ min: rn,
1188
+ max: on,
1189
+ extent: ln,
1190
+ mean: sn,
1191
+ median: an,
1192
+ unique: un,
1193
+ uniqueCount: fn,
1194
+ count: dn
1195
+ }, cn = {
1196
1196
  getDefaultColumnDef: () => ({
1197
1197
  aggregatedCell: (e) => {
1198
- var o, t;
1199
- return (o = (t = e.getValue()) == null || t.toString == null ? void 0 : t.toString()) != null ? o : null;
1198
+ var r, t;
1199
+ return (r = (t = e.getValue()) == null || t.toString == null ? void 0 : t.toString()) != null ? r : null;
1200
1200
  },
1201
1201
  aggregationFn: "auto"
1202
1202
  }),
@@ -1208,64 +1208,64 @@ const Zt = (e, o, t) => t.reduce((n, r) => {
1208
1208
  onGroupingChange: L("grouping", e),
1209
1209
  groupedColumnMode: "reorder"
1210
1210
  }),
1211
- createColumn: (e, o) => {
1211
+ createColumn: (e, r) => {
1212
1212
  e.toggleGrouping = () => {
1213
- o.setGrouping((t) => t != null && t.includes(e.id) ? t.filter((n) => n !== e.id) : [...t ?? [], e.id]);
1213
+ r.setGrouping((t) => t != null && t.includes(e.id) ? t.filter((n) => n !== e.id) : [...t ?? [], e.id]);
1214
1214
  }, e.getCanGroup = () => {
1215
1215
  var t, n;
1216
- return ((t = e.columnDef.enableGrouping) != null ? t : !0) && ((n = o.options.enableGrouping) != null ? n : !0) && (!!e.accessorFn || !!e.columnDef.getGroupingValue);
1216
+ return ((t = e.columnDef.enableGrouping) != null ? t : !0) && ((n = r.options.enableGrouping) != null ? n : !0) && (!!e.accessorFn || !!e.columnDef.getGroupingValue);
1217
1217
  }, e.getIsGrouped = () => {
1218
1218
  var t;
1219
- return (t = o.getState().grouping) == null ? void 0 : t.includes(e.id);
1219
+ return (t = r.getState().grouping) == null ? void 0 : t.includes(e.id);
1220
1220
  }, e.getGroupedIndex = () => {
1221
1221
  var t;
1222
- return (t = o.getState().grouping) == null ? void 0 : t.indexOf(e.id);
1222
+ return (t = r.getState().grouping) == null ? void 0 : t.indexOf(e.id);
1223
1223
  }, e.getToggleGroupingHandler = () => {
1224
1224
  const t = e.getCanGroup();
1225
1225
  return () => {
1226
1226
  t && e.toggleGrouping();
1227
1227
  };
1228
1228
  }, e.getAutoAggregationFn = () => {
1229
- const t = o.getCoreRowModel().flatRows[0], n = t == null ? void 0 : t.getValue(e.id);
1229
+ const t = r.getCoreRowModel().flatRows[0], n = t == null ? void 0 : t.getValue(e.id);
1230
1230
  if (typeof n == "number")
1231
- return me.sum;
1231
+ return he.sum;
1232
1232
  if (Object.prototype.toString.call(n) === "[object Date]")
1233
- return me.extent;
1233
+ return he.extent;
1234
1234
  }, e.getAggregationFn = () => {
1235
1235
  var t, n;
1236
1236
  if (!e)
1237
1237
  throw new Error();
1238
- return ue(e.columnDef.aggregationFn) ? e.columnDef.aggregationFn : e.columnDef.aggregationFn === "auto" ? e.getAutoAggregationFn() : (t = (n = o.options.aggregationFns) == null ? void 0 : n[e.columnDef.aggregationFn]) != null ? t : me[e.columnDef.aggregationFn];
1238
+ return ge(e.columnDef.aggregationFn) ? e.columnDef.aggregationFn : e.columnDef.aggregationFn === "auto" ? e.getAutoAggregationFn() : (t = (n = r.options.aggregationFns) == null ? void 0 : n[e.columnDef.aggregationFn]) != null ? t : he[e.columnDef.aggregationFn];
1239
1239
  };
1240
1240
  },
1241
1241
  createTable: (e) => {
1242
- e.setGrouping = (o) => e.options.onGroupingChange == null ? void 0 : e.options.onGroupingChange(o), e.resetGrouping = (o) => {
1242
+ e.setGrouping = (r) => e.options.onGroupingChange == null ? void 0 : e.options.onGroupingChange(r), e.resetGrouping = (r) => {
1243
1243
  var t, n;
1244
- e.setGrouping(o ? [] : (t = (n = e.initialState) == null ? void 0 : n.grouping) != null ? t : []);
1244
+ e.setGrouping(r ? [] : (t = (n = e.initialState) == null ? void 0 : n.grouping) != null ? t : []);
1245
1245
  }, e.getPreGroupedRowModel = () => e.getFilteredRowModel(), e.getGroupedRowModel = () => (!e._getGroupedRowModel && e.options.getGroupedRowModel && (e._getGroupedRowModel = e.options.getGroupedRowModel(e)), e.options.manualGrouping || !e._getGroupedRowModel ? e.getPreGroupedRowModel() : e._getGroupedRowModel());
1246
1246
  },
1247
- createRow: (e, o) => {
1247
+ createRow: (e, r) => {
1248
1248
  e.getIsGrouped = () => !!e.groupingColumnId, e.getGroupingValue = (t) => {
1249
1249
  if (e._groupingValuesCache.hasOwnProperty(t))
1250
1250
  return e._groupingValuesCache[t];
1251
- const n = o.getColumn(t);
1251
+ const n = r.getColumn(t);
1252
1252
  return n != null && n.columnDef.getGroupingValue ? (e._groupingValuesCache[t] = n.columnDef.getGroupingValue(e.original), e._groupingValuesCache[t]) : e.getValue(t);
1253
1253
  }, e._groupingValuesCache = {};
1254
1254
  },
1255
- createCell: (e, o, t, n) => {
1256
- e.getIsGrouped = () => o.getIsGrouped() && o.id === t.groupingColumnId, e.getIsPlaceholder = () => !e.getIsGrouped() && o.getIsGrouped(), e.getIsAggregated = () => {
1257
- var r;
1258
- return !e.getIsGrouped() && !e.getIsPlaceholder() && !!((r = t.subRows) != null && r.length);
1255
+ createCell: (e, r, t, n) => {
1256
+ e.getIsGrouped = () => r.getIsGrouped() && r.id === t.groupingColumnId, e.getIsPlaceholder = () => !e.getIsGrouped() && r.getIsGrouped(), e.getIsAggregated = () => {
1257
+ var o;
1258
+ return !e.getIsGrouped() && !e.getIsPlaceholder() && !!((o = t.subRows) != null && o.length);
1259
1259
  };
1260
1260
  }
1261
1261
  };
1262
- function fn(e, o, t) {
1263
- if (!(o != null && o.length) || !t)
1262
+ function gn(e, r, t) {
1263
+ if (!(r != null && r.length) || !t)
1264
1264
  return e;
1265
- const n = e.filter((l) => !o.includes(l.id));
1266
- return t === "remove" ? n : [...o.map((l) => e.find((i) => i.id === l)).filter(Boolean), ...n];
1265
+ const n = e.filter((l) => !r.includes(l.id));
1266
+ return t === "remove" ? n : [...r.map((l) => e.find((s) => s.id === l)).filter(Boolean), ...n];
1267
1267
  }
1268
- const dn = {
1268
+ const pn = {
1269
1269
  getInitialState: (e) => ({
1270
1270
  columnOrder: [],
1271
1271
  ...e
@@ -1273,134 +1273,134 @@ const dn = {
1273
1273
  getDefaultOptions: (e) => ({
1274
1274
  onColumnOrderChange: L("columnOrder", e)
1275
1275
  }),
1276
- createColumn: (e, o) => {
1277
- e.getIndex = y((t) => [oe(o, t)], (t) => t.findIndex((n) => n.id === e.id), R(o.options, "debugColumns", "getIndex")), e.getIsFirstColumn = (t) => {
1276
+ createColumn: (e, r) => {
1277
+ e.getIndex = S((t) => [le(r, t)], (t) => t.findIndex((n) => n.id === e.id), R(r.options, "debugColumns", "getIndex")), e.getIsFirstColumn = (t) => {
1278
1278
  var n;
1279
- return ((n = oe(o, t)[0]) == null ? void 0 : n.id) === e.id;
1279
+ return ((n = le(r, t)[0]) == null ? void 0 : n.id) === e.id;
1280
1280
  }, e.getIsLastColumn = (t) => {
1281
1281
  var n;
1282
- const r = oe(o, t);
1283
- return ((n = r[r.length - 1]) == null ? void 0 : n.id) === e.id;
1282
+ const o = le(r, t);
1283
+ return ((n = o[o.length - 1]) == null ? void 0 : n.id) === e.id;
1284
1284
  };
1285
1285
  },
1286
1286
  createTable: (e) => {
1287
- e.setColumnOrder = (o) => e.options.onColumnOrderChange == null ? void 0 : e.options.onColumnOrderChange(o), e.resetColumnOrder = (o) => {
1287
+ e.setColumnOrder = (r) => e.options.onColumnOrderChange == null ? void 0 : e.options.onColumnOrderChange(r), e.resetColumnOrder = (r) => {
1288
1288
  var t;
1289
- e.setColumnOrder(o ? [] : (t = e.initialState.columnOrder) != null ? t : []);
1290
- }, e._getOrderColumnsFn = y(() => [e.getState().columnOrder, e.getState().grouping, e.options.groupedColumnMode], (o, t, n) => (r) => {
1289
+ e.setColumnOrder(r ? [] : (t = e.initialState.columnOrder) != null ? t : []);
1290
+ }, e._getOrderColumnsFn = S(() => [e.getState().columnOrder, e.getState().grouping, e.options.groupedColumnMode], (r, t, n) => (o) => {
1291
1291
  let l = [];
1292
- if (!(o != null && o.length))
1293
- l = r;
1292
+ if (!(r != null && r.length))
1293
+ l = o;
1294
1294
  else {
1295
- const i = [...o], s = [...r];
1296
- for (; s.length && i.length; ) {
1297
- const u = i.shift(), f = s.findIndex((g) => g.id === u);
1298
- f > -1 && l.push(s.splice(f, 1)[0]);
1295
+ const s = [...r], i = [...o];
1296
+ for (; i.length && s.length; ) {
1297
+ const u = s.shift(), f = i.findIndex((g) => g.id === u);
1298
+ f > -1 && l.push(i.splice(f, 1)[0]);
1299
1299
  }
1300
- l = [...l, ...s];
1300
+ l = [...l, ...i];
1301
1301
  }
1302
- return fn(l, t, n);
1302
+ return gn(l, t, n);
1303
1303
  }, R(e.options, "debugTable", "_getOrderColumnsFn"));
1304
1304
  }
1305
- }, he = () => ({
1305
+ }, ve = () => ({
1306
1306
  left: [],
1307
1307
  right: []
1308
- }), cn = {
1308
+ }), mn = {
1309
1309
  getInitialState: (e) => ({
1310
- columnPinning: he(),
1310
+ columnPinning: ve(),
1311
1311
  ...e
1312
1312
  }),
1313
1313
  getDefaultOptions: (e) => ({
1314
1314
  onColumnPinningChange: L("columnPinning", e)
1315
1315
  }),
1316
- createColumn: (e, o) => {
1316
+ createColumn: (e, r) => {
1317
1317
  e.pin = (t) => {
1318
- const n = e.getLeafColumns().map((r) => r.id).filter(Boolean);
1319
- o.setColumnPinning((r) => {
1320
- var l, i;
1318
+ const n = e.getLeafColumns().map((o) => o.id).filter(Boolean);
1319
+ r.setColumnPinning((o) => {
1320
+ var l, s;
1321
1321
  if (t === "right") {
1322
- var s, u;
1322
+ var i, u;
1323
1323
  return {
1324
- left: ((s = r == null ? void 0 : r.left) != null ? s : []).filter((p) => !(n != null && n.includes(p))),
1325
- right: [...((u = r == null ? void 0 : r.right) != null ? u : []).filter((p) => !(n != null && n.includes(p))), ...n]
1324
+ left: ((i = o == null ? void 0 : o.left) != null ? i : []).filter((p) => !(n != null && n.includes(p))),
1325
+ right: [...((u = o == null ? void 0 : o.right) != null ? u : []).filter((p) => !(n != null && n.includes(p))), ...n]
1326
1326
  };
1327
1327
  }
1328
1328
  if (t === "left") {
1329
1329
  var f, g;
1330
1330
  return {
1331
- left: [...((f = r == null ? void 0 : r.left) != null ? f : []).filter((p) => !(n != null && n.includes(p))), ...n],
1332
- right: ((g = r == null ? void 0 : r.right) != null ? g : []).filter((p) => !(n != null && n.includes(p)))
1331
+ left: [...((f = o == null ? void 0 : o.left) != null ? f : []).filter((p) => !(n != null && n.includes(p))), ...n],
1332
+ right: ((g = o == null ? void 0 : o.right) != null ? g : []).filter((p) => !(n != null && n.includes(p)))
1333
1333
  };
1334
1334
  }
1335
1335
  return {
1336
- left: ((l = r == null ? void 0 : r.left) != null ? l : []).filter((p) => !(n != null && n.includes(p))),
1337
- right: ((i = r == null ? void 0 : r.right) != null ? i : []).filter((p) => !(n != null && n.includes(p)))
1336
+ left: ((l = o == null ? void 0 : o.left) != null ? l : []).filter((p) => !(n != null && n.includes(p))),
1337
+ right: ((s = o == null ? void 0 : o.right) != null ? s : []).filter((p) => !(n != null && n.includes(p)))
1338
1338
  };
1339
1339
  });
1340
1340
  }, e.getCanPin = () => e.getLeafColumns().some((n) => {
1341
- var r, l, i;
1342
- return ((r = n.columnDef.enablePinning) != null ? r : !0) && ((l = (i = o.options.enableColumnPinning) != null ? i : o.options.enablePinning) != null ? l : !0);
1341
+ var o, l, s;
1342
+ return ((o = n.columnDef.enablePinning) != null ? o : !0) && ((l = (s = r.options.enableColumnPinning) != null ? s : r.options.enablePinning) != null ? l : !0);
1343
1343
  }), e.getIsPinned = () => {
1344
- const t = e.getLeafColumns().map((s) => s.id), {
1344
+ const t = e.getLeafColumns().map((i) => i.id), {
1345
1345
  left: n,
1346
- right: r
1347
- } = o.getState().columnPinning, l = t.some((s) => n == null ? void 0 : n.includes(s)), i = t.some((s) => r == null ? void 0 : r.includes(s));
1348
- return l ? "left" : i ? "right" : !1;
1346
+ right: o
1347
+ } = r.getState().columnPinning, l = t.some((i) => n == null ? void 0 : n.includes(i)), s = t.some((i) => o == null ? void 0 : o.includes(i));
1348
+ return l ? "left" : s ? "right" : !1;
1349
1349
  }, e.getPinnedIndex = () => {
1350
1350
  var t, n;
1351
- const r = e.getIsPinned();
1352
- return r ? (t = (n = o.getState().columnPinning) == null || (n = n[r]) == null ? void 0 : n.indexOf(e.id)) != null ? t : -1 : 0;
1351
+ const o = e.getIsPinned();
1352
+ return o ? (t = (n = r.getState().columnPinning) == null || (n = n[o]) == null ? void 0 : n.indexOf(e.id)) != null ? t : -1 : 0;
1353
1353
  };
1354
1354
  },
1355
- createRow: (e, o) => {
1356
- e.getCenterVisibleCells = y(() => [e._getAllVisibleCells(), o.getState().columnPinning.left, o.getState().columnPinning.right], (t, n, r) => {
1357
- const l = [...n ?? [], ...r ?? []];
1358
- return t.filter((i) => !l.includes(i.column.id));
1359
- }, R(o.options, "debugRows", "getCenterVisibleCells")), e.getLeftVisibleCells = y(() => [e._getAllVisibleCells(), o.getState().columnPinning.left], (t, n) => (n ?? []).map((l) => t.find((i) => i.column.id === l)).filter(Boolean).map((l) => ({
1355
+ createRow: (e, r) => {
1356
+ e.getCenterVisibleCells = S(() => [e._getAllVisibleCells(), r.getState().columnPinning.left, r.getState().columnPinning.right], (t, n, o) => {
1357
+ const l = [...n ?? [], ...o ?? []];
1358
+ return t.filter((s) => !l.includes(s.column.id));
1359
+ }, R(r.options, "debugRows", "getCenterVisibleCells")), e.getLeftVisibleCells = S(() => [e._getAllVisibleCells(), r.getState().columnPinning.left], (t, n) => (n ?? []).map((l) => t.find((s) => s.column.id === l)).filter(Boolean).map((l) => ({
1360
1360
  ...l,
1361
1361
  position: "left"
1362
- })), R(o.options, "debugRows", "getLeftVisibleCells")), e.getRightVisibleCells = y(() => [e._getAllVisibleCells(), o.getState().columnPinning.right], (t, n) => (n ?? []).map((l) => t.find((i) => i.column.id === l)).filter(Boolean).map((l) => ({
1362
+ })), R(r.options, "debugRows", "getLeftVisibleCells")), e.getRightVisibleCells = S(() => [e._getAllVisibleCells(), r.getState().columnPinning.right], (t, n) => (n ?? []).map((l) => t.find((s) => s.column.id === l)).filter(Boolean).map((l) => ({
1363
1363
  ...l,
1364
1364
  position: "right"
1365
- })), R(o.options, "debugRows", "getRightVisibleCells"));
1365
+ })), R(r.options, "debugRows", "getRightVisibleCells"));
1366
1366
  },
1367
1367
  createTable: (e) => {
1368
- e.setColumnPinning = (o) => e.options.onColumnPinningChange == null ? void 0 : e.options.onColumnPinningChange(o), e.resetColumnPinning = (o) => {
1368
+ e.setColumnPinning = (r) => e.options.onColumnPinningChange == null ? void 0 : e.options.onColumnPinningChange(r), e.resetColumnPinning = (r) => {
1369
1369
  var t, n;
1370
- return e.setColumnPinning(o ? he() : (t = (n = e.initialState) == null ? void 0 : n.columnPinning) != null ? t : he());
1371
- }, e.getIsSomeColumnsPinned = (o) => {
1370
+ return e.setColumnPinning(r ? ve() : (t = (n = e.initialState) == null ? void 0 : n.columnPinning) != null ? t : ve());
1371
+ }, e.getIsSomeColumnsPinned = (r) => {
1372
1372
  var t;
1373
1373
  const n = e.getState().columnPinning;
1374
- if (!o) {
1375
- var r, l;
1376
- return !!((r = n.left) != null && r.length || (l = n.right) != null && l.length);
1374
+ if (!r) {
1375
+ var o, l;
1376
+ return !!((o = n.left) != null && o.length || (l = n.right) != null && l.length);
1377
1377
  }
1378
- return !!((t = n[o]) != null && t.length);
1379
- }, e.getLeftLeafColumns = y(() => [e.getAllLeafColumns(), e.getState().columnPinning.left], (o, t) => (t ?? []).map((n) => o.find((r) => r.id === n)).filter(Boolean), R(e.options, "debugColumns", "getLeftLeafColumns")), e.getRightLeafColumns = y(() => [e.getAllLeafColumns(), e.getState().columnPinning.right], (o, t) => (t ?? []).map((n) => o.find((r) => r.id === n)).filter(Boolean), R(e.options, "debugColumns", "getRightLeafColumns")), e.getCenterLeafColumns = y(() => [e.getAllLeafColumns(), e.getState().columnPinning.left, e.getState().columnPinning.right], (o, t, n) => {
1380
- const r = [...t ?? [], ...n ?? []];
1381
- return o.filter((l) => !r.includes(l.id));
1378
+ return !!((t = n[r]) != null && t.length);
1379
+ }, e.getLeftLeafColumns = S(() => [e.getAllLeafColumns(), e.getState().columnPinning.left], (r, t) => (t ?? []).map((n) => r.find((o) => o.id === n)).filter(Boolean), R(e.options, "debugColumns", "getLeftLeafColumns")), e.getRightLeafColumns = S(() => [e.getAllLeafColumns(), e.getState().columnPinning.right], (r, t) => (t ?? []).map((n) => r.find((o) => o.id === n)).filter(Boolean), R(e.options, "debugColumns", "getRightLeafColumns")), e.getCenterLeafColumns = S(() => [e.getAllLeafColumns(), e.getState().columnPinning.left, e.getState().columnPinning.right], (r, t, n) => {
1380
+ const o = [...t ?? [], ...n ?? []];
1381
+ return r.filter((l) => !o.includes(l.id));
1382
1382
  }, R(e.options, "debugColumns", "getCenterLeafColumns"));
1383
1383
  }
1384
1384
  };
1385
- function gn(e) {
1385
+ function hn(e) {
1386
1386
  return e || (typeof document < "u" ? document : null);
1387
1387
  }
1388
- const ie = {
1388
+ const fe = {
1389
1389
  size: 150,
1390
1390
  minSize: 20,
1391
1391
  maxSize: Number.MAX_SAFE_INTEGER
1392
- }, ve = () => ({
1392
+ }, we = () => ({
1393
1393
  startOffset: null,
1394
1394
  startSize: null,
1395
1395
  deltaOffset: null,
1396
1396
  deltaPercentage: null,
1397
1397
  isResizingColumn: !1,
1398
1398
  columnSizingStart: []
1399
- }), pn = {
1400
- getDefaultColumnDef: () => ie,
1399
+ }), vn = {
1400
+ getDefaultColumnDef: () => fe,
1401
1401
  getInitialState: (e) => ({
1402
1402
  columnSizing: {},
1403
- columnSizingInfo: ve(),
1403
+ columnSizingInfo: we(),
1404
1404
  ...e
1405
1405
  }),
1406
1406
  getDefaultOptions: (e) => ({
@@ -1409,33 +1409,33 @@ const ie = {
1409
1409
  onColumnSizingChange: L("columnSizing", e),
1410
1410
  onColumnSizingInfoChange: L("columnSizingInfo", e)
1411
1411
  }),
1412
- createColumn: (e, o) => {
1412
+ createColumn: (e, r) => {
1413
1413
  e.getSize = () => {
1414
- var t, n, r;
1415
- const l = o.getState().columnSizing[e.id];
1416
- return Math.min(Math.max((t = e.columnDef.minSize) != null ? t : ie.minSize, (n = l ?? e.columnDef.size) != null ? n : ie.size), (r = e.columnDef.maxSize) != null ? r : ie.maxSize);
1417
- }, e.getStart = y((t) => [t, oe(o, t), o.getState().columnSizing], (t, n) => n.slice(0, e.getIndex(t)).reduce((r, l) => r + l.getSize(), 0), R(o.options, "debugColumns", "getStart")), e.getAfter = y((t) => [t, oe(o, t), o.getState().columnSizing], (t, n) => n.slice(e.getIndex(t) + 1).reduce((r, l) => r + l.getSize(), 0), R(o.options, "debugColumns", "getAfter")), e.resetSize = () => {
1418
- o.setColumnSizing((t) => {
1414
+ var t, n, o;
1415
+ const l = r.getState().columnSizing[e.id];
1416
+ return Math.min(Math.max((t = e.columnDef.minSize) != null ? t : fe.minSize, (n = l ?? e.columnDef.size) != null ? n : fe.size), (o = e.columnDef.maxSize) != null ? o : fe.maxSize);
1417
+ }, e.getStart = S((t) => [t, le(r, t), r.getState().columnSizing], (t, n) => n.slice(0, e.getIndex(t)).reduce((o, l) => o + l.getSize(), 0), R(r.options, "debugColumns", "getStart")), e.getAfter = S((t) => [t, le(r, t), r.getState().columnSizing], (t, n) => n.slice(e.getIndex(t) + 1).reduce((o, l) => o + l.getSize(), 0), R(r.options, "debugColumns", "getAfter")), e.resetSize = () => {
1418
+ r.setColumnSizing((t) => {
1419
1419
  let {
1420
1420
  [e.id]: n,
1421
- ...r
1421
+ ...o
1422
1422
  } = t;
1423
- return r;
1423
+ return o;
1424
1424
  });
1425
1425
  }, e.getCanResize = () => {
1426
1426
  var t, n;
1427
- return ((t = e.columnDef.enableResizing) != null ? t : !0) && ((n = o.options.enableColumnResizing) != null ? n : !0);
1428
- }, e.getIsResizing = () => o.getState().columnSizingInfo.isResizingColumn === e.id;
1427
+ return ((t = e.columnDef.enableResizing) != null ? t : !0) && ((n = r.options.enableColumnResizing) != null ? n : !0);
1428
+ }, e.getIsResizing = () => r.getState().columnSizingInfo.isResizingColumn === e.id;
1429
1429
  },
1430
- createHeader: (e, o) => {
1430
+ createHeader: (e, r) => {
1431
1431
  e.getSize = () => {
1432
1432
  let t = 0;
1433
- const n = (r) => {
1434
- if (r.subHeaders.length)
1435
- r.subHeaders.forEach(n);
1433
+ const n = (o) => {
1434
+ if (o.subHeaders.length)
1435
+ o.subHeaders.forEach(n);
1436
1436
  else {
1437
1437
  var l;
1438
- t += (l = r.column.getSize()) != null ? l : 0;
1438
+ t += (l = o.column.getSize()) != null ? l : 0;
1439
1439
  }
1440
1440
  };
1441
1441
  return n(e), t;
@@ -1446,29 +1446,29 @@ const ie = {
1446
1446
  }
1447
1447
  return 0;
1448
1448
  }, e.getResizeHandler = (t) => {
1449
- const n = o.getColumn(e.column.id), r = n == null ? void 0 : n.getCanResize();
1449
+ const n = r.getColumn(e.column.id), o = n == null ? void 0 : n.getCanResize();
1450
1450
  return (l) => {
1451
- if (!n || !r || (l.persist == null || l.persist(), we(l) && l.touches && l.touches.length > 1))
1451
+ if (!n || !o || (l.persist == null || l.persist(), Ce(l) && l.touches && l.touches.length > 1))
1452
1452
  return;
1453
- const i = e.getSize(), s = e ? e.getLeafHeaders().map((h) => [h.column.id, h.column.getSize()]) : [[n.id, n.getSize()]], u = we(l) ? Math.round(l.touches[0].clientX) : l.clientX, f = {}, g = (h, S) => {
1454
- typeof S == "number" && (o.setColumnSizingInfo((x) => {
1455
- var I, F;
1456
- const V = o.options.columnResizeDirection === "rtl" ? -1 : 1, W = (S - ((I = x == null ? void 0 : x.startOffset) != null ? I : 0)) * V, k = Math.max(W / ((F = x == null ? void 0 : x.startSize) != null ? F : 0), -0.999999);
1457
- return x.columnSizingStart.forEach((H) => {
1458
- let [K, O] = H;
1459
- f[K] = Math.round(Math.max(O + O * k, 0) * 100) / 100;
1453
+ const s = e.getSize(), i = e ? e.getLeafHeaders().map((v) => [v.column.id, v.column.getSize()]) : [[n.id, n.getSize()]], u = Ce(l) ? Math.round(l.touches[0].clientX) : l.clientX, f = {}, g = (v, y) => {
1454
+ typeof y == "number" && (r.setColumnSizingInfo((x) => {
1455
+ var $, F;
1456
+ const P = r.options.columnResizeDirection === "rtl" ? -1 : 1, Y = (y - (($ = x == null ? void 0 : x.startOffset) != null ? $ : 0)) * P, k = Math.max(Y / ((F = x == null ? void 0 : x.startSize) != null ? F : 0), -0.999999);
1457
+ return x.columnSizingStart.forEach((G) => {
1458
+ let [K, D] = G;
1459
+ f[K] = Math.round(Math.max(D + D * k, 0) * 100) / 100;
1460
1460
  }), {
1461
1461
  ...x,
1462
- deltaOffset: W,
1462
+ deltaOffset: Y,
1463
1463
  deltaPercentage: k
1464
1464
  };
1465
- }), (o.options.columnResizeMode === "onChange" || h === "end") && o.setColumnSizing((x) => ({
1465
+ }), (r.options.columnResizeMode === "onChange" || v === "end") && r.setColumnSizing((x) => ({
1466
1466
  ...x,
1467
1467
  ...f
1468
1468
  })));
1469
- }, p = (h) => g("move", h), d = (h) => {
1470
- g("end", h), o.setColumnSizingInfo((S) => ({
1471
- ...S,
1469
+ }, p = (v) => g("move", v), d = (v) => {
1470
+ g("end", v), r.setColumnSizingInfo((y) => ({
1471
+ ...y,
1472
1472
  isResizingColumn: !1,
1473
1473
  startOffset: null,
1474
1474
  startSize: null,
@@ -1476,75 +1476,75 @@ const ie = {
1476
1476
  deltaPercentage: null,
1477
1477
  columnSizingStart: []
1478
1478
  }));
1479
- }, a = gn(t), m = {
1480
- moveHandler: (h) => p(h.clientX),
1481
- upHandler: (h) => {
1482
- a == null || a.removeEventListener("mousemove", m.moveHandler), a == null || a.removeEventListener("mouseup", m.upHandler), d(h.clientX);
1479
+ }, a = hn(t), m = {
1480
+ moveHandler: (v) => p(v.clientX),
1481
+ upHandler: (v) => {
1482
+ a == null || a.removeEventListener("mousemove", m.moveHandler), a == null || a.removeEventListener("mouseup", m.upHandler), d(v.clientX);
1483
1483
  }
1484
- }, v = {
1485
- moveHandler: (h) => (h.cancelable && (h.preventDefault(), h.stopPropagation()), p(h.touches[0].clientX), !1),
1486
- upHandler: (h) => {
1487
- var S;
1488
- a == null || a.removeEventListener("touchmove", v.moveHandler), a == null || a.removeEventListener("touchend", v.upHandler), h.cancelable && (h.preventDefault(), h.stopPropagation()), d((S = h.touches[0]) == null ? void 0 : S.clientX);
1484
+ }, h = {
1485
+ moveHandler: (v) => (v.cancelable && (v.preventDefault(), v.stopPropagation()), p(v.touches[0].clientX), !1),
1486
+ upHandler: (v) => {
1487
+ var y;
1488
+ a == null || a.removeEventListener("touchmove", h.moveHandler), a == null || a.removeEventListener("touchend", h.upHandler), v.cancelable && (v.preventDefault(), v.stopPropagation()), d((y = v.touches[0]) == null ? void 0 : y.clientX);
1489
1489
  }
1490
- }, C = mn() ? {
1490
+ }, C = wn() ? {
1491
1491
  passive: !1
1492
1492
  } : !1;
1493
- we(l) ? (a == null || a.addEventListener("touchmove", v.moveHandler, C), a == null || a.addEventListener("touchend", v.upHandler, C)) : (a == null || a.addEventListener("mousemove", m.moveHandler, C), a == null || a.addEventListener("mouseup", m.upHandler, C)), o.setColumnSizingInfo((h) => ({
1494
- ...h,
1493
+ Ce(l) ? (a == null || a.addEventListener("touchmove", h.moveHandler, C), a == null || a.addEventListener("touchend", h.upHandler, C)) : (a == null || a.addEventListener("mousemove", m.moveHandler, C), a == null || a.addEventListener("mouseup", m.upHandler, C)), r.setColumnSizingInfo((v) => ({
1494
+ ...v,
1495
1495
  startOffset: u,
1496
- startSize: i,
1496
+ startSize: s,
1497
1497
  deltaOffset: 0,
1498
1498
  deltaPercentage: 0,
1499
- columnSizingStart: s,
1499
+ columnSizingStart: i,
1500
1500
  isResizingColumn: n.id
1501
1501
  }));
1502
1502
  };
1503
1503
  };
1504
1504
  },
1505
1505
  createTable: (e) => {
1506
- e.setColumnSizing = (o) => e.options.onColumnSizingChange == null ? void 0 : e.options.onColumnSizingChange(o), e.setColumnSizingInfo = (o) => e.options.onColumnSizingInfoChange == null ? void 0 : e.options.onColumnSizingInfoChange(o), e.resetColumnSizing = (o) => {
1506
+ e.setColumnSizing = (r) => e.options.onColumnSizingChange == null ? void 0 : e.options.onColumnSizingChange(r), e.setColumnSizingInfo = (r) => e.options.onColumnSizingInfoChange == null ? void 0 : e.options.onColumnSizingInfoChange(r), e.resetColumnSizing = (r) => {
1507
1507
  var t;
1508
- e.setColumnSizing(o ? {} : (t = e.initialState.columnSizing) != null ? t : {});
1509
- }, e.resetHeaderSizeInfo = (o) => {
1508
+ e.setColumnSizing(r ? {} : (t = e.initialState.columnSizing) != null ? t : {});
1509
+ }, e.resetHeaderSizeInfo = (r) => {
1510
1510
  var t;
1511
- e.setColumnSizingInfo(o ? ve() : (t = e.initialState.columnSizingInfo) != null ? t : ve());
1511
+ e.setColumnSizingInfo(r ? we() : (t = e.initialState.columnSizingInfo) != null ? t : we());
1512
1512
  }, e.getTotalSize = () => {
1513
- var o, t;
1514
- return (o = (t = e.getHeaderGroups()[0]) == null ? void 0 : t.headers.reduce((n, r) => n + r.getSize(), 0)) != null ? o : 0;
1513
+ var r, t;
1514
+ return (r = (t = e.getHeaderGroups()[0]) == null ? void 0 : t.headers.reduce((n, o) => n + o.getSize(), 0)) != null ? r : 0;
1515
1515
  }, e.getLeftTotalSize = () => {
1516
- var o, t;
1517
- return (o = (t = e.getLeftHeaderGroups()[0]) == null ? void 0 : t.headers.reduce((n, r) => n + r.getSize(), 0)) != null ? o : 0;
1516
+ var r, t;
1517
+ return (r = (t = e.getLeftHeaderGroups()[0]) == null ? void 0 : t.headers.reduce((n, o) => n + o.getSize(), 0)) != null ? r : 0;
1518
1518
  }, e.getCenterTotalSize = () => {
1519
- var o, t;
1520
- return (o = (t = e.getCenterHeaderGroups()[0]) == null ? void 0 : t.headers.reduce((n, r) => n + r.getSize(), 0)) != null ? o : 0;
1519
+ var r, t;
1520
+ return (r = (t = e.getCenterHeaderGroups()[0]) == null ? void 0 : t.headers.reduce((n, o) => n + o.getSize(), 0)) != null ? r : 0;
1521
1521
  }, e.getRightTotalSize = () => {
1522
- var o, t;
1523
- return (o = (t = e.getRightHeaderGroups()[0]) == null ? void 0 : t.headers.reduce((n, r) => n + r.getSize(), 0)) != null ? o : 0;
1522
+ var r, t;
1523
+ return (r = (t = e.getRightHeaderGroups()[0]) == null ? void 0 : t.headers.reduce((n, o) => n + o.getSize(), 0)) != null ? r : 0;
1524
1524
  };
1525
1525
  }
1526
1526
  };
1527
- let se = null;
1528
- function mn() {
1529
- if (typeof se == "boolean") return se;
1527
+ let de = null;
1528
+ function wn() {
1529
+ if (typeof de == "boolean") return de;
1530
1530
  let e = !1;
1531
1531
  try {
1532
- const o = {
1532
+ const r = {
1533
1533
  get passive() {
1534
1534
  return e = !0, !1;
1535
1535
  }
1536
1536
  }, t = () => {
1537
1537
  };
1538
- window.addEventListener("test", t, o), window.removeEventListener("test", t);
1538
+ window.addEventListener("test", t, r), window.removeEventListener("test", t);
1539
1539
  } catch {
1540
1540
  e = !1;
1541
1541
  }
1542
- return se = e, se;
1542
+ return de = e, de;
1543
1543
  }
1544
- function we(e) {
1544
+ function Ce(e) {
1545
1545
  return e.type === "touchstart";
1546
1546
  }
1547
- const hn = {
1547
+ const Cn = {
1548
1548
  getInitialState: (e) => ({
1549
1549
  columnVisibility: {},
1550
1550
  ...e
@@ -1552,35 +1552,35 @@ const hn = {
1552
1552
  getDefaultOptions: (e) => ({
1553
1553
  onColumnVisibilityChange: L("columnVisibility", e)
1554
1554
  }),
1555
- createColumn: (e, o) => {
1555
+ createColumn: (e, r) => {
1556
1556
  e.toggleVisibility = (t) => {
1557
- e.getCanHide() && o.setColumnVisibility((n) => ({
1557
+ e.getCanHide() && r.setColumnVisibility((n) => ({
1558
1558
  ...n,
1559
1559
  [e.id]: t ?? !e.getIsVisible()
1560
1560
  }));
1561
1561
  }, e.getIsVisible = () => {
1562
1562
  var t, n;
1563
- const r = e.columns;
1564
- return (t = r.length ? r.some((l) => l.getIsVisible()) : (n = o.getState().columnVisibility) == null ? void 0 : n[e.id]) != null ? t : !0;
1563
+ const o = e.columns;
1564
+ return (t = o.length ? o.some((l) => l.getIsVisible()) : (n = r.getState().columnVisibility) == null ? void 0 : n[e.id]) != null ? t : !0;
1565
1565
  }, e.getCanHide = () => {
1566
1566
  var t, n;
1567
- return ((t = e.columnDef.enableHiding) != null ? t : !0) && ((n = o.options.enableHiding) != null ? n : !0);
1567
+ return ((t = e.columnDef.enableHiding) != null ? t : !0) && ((n = r.options.enableHiding) != null ? n : !0);
1568
1568
  }, e.getToggleVisibilityHandler = () => (t) => {
1569
1569
  e.toggleVisibility == null || e.toggleVisibility(t.target.checked);
1570
1570
  };
1571
1571
  },
1572
- createRow: (e, o) => {
1573
- e._getAllVisibleCells = y(() => [e.getAllCells(), o.getState().columnVisibility], (t) => t.filter((n) => n.column.getIsVisible()), R(o.options, "debugRows", "_getAllVisibleCells")), e.getVisibleCells = y(() => [e.getLeftVisibleCells(), e.getCenterVisibleCells(), e.getRightVisibleCells()], (t, n, r) => [...t, ...n, ...r], R(o.options, "debugRows", "getVisibleCells"));
1572
+ createRow: (e, r) => {
1573
+ e._getAllVisibleCells = S(() => [e.getAllCells(), r.getState().columnVisibility], (t) => t.filter((n) => n.column.getIsVisible()), R(r.options, "debugRows", "_getAllVisibleCells")), e.getVisibleCells = S(() => [e.getLeftVisibleCells(), e.getCenterVisibleCells(), e.getRightVisibleCells()], (t, n, o) => [...t, ...n, ...o], R(r.options, "debugRows", "getVisibleCells"));
1574
1574
  },
1575
1575
  createTable: (e) => {
1576
- const o = (t, n) => y(() => [n(), n().filter((r) => r.getIsVisible()).map((r) => r.id).join("_")], (r) => r.filter((l) => l.getIsVisible == null ? void 0 : l.getIsVisible()), R(e.options, "debugColumns", t));
1577
- e.getVisibleFlatColumns = o("getVisibleFlatColumns", () => e.getAllFlatColumns()), e.getVisibleLeafColumns = o("getVisibleLeafColumns", () => e.getAllLeafColumns()), e.getLeftVisibleLeafColumns = o("getLeftVisibleLeafColumns", () => e.getLeftLeafColumns()), e.getRightVisibleLeafColumns = o("getRightVisibleLeafColumns", () => e.getRightLeafColumns()), e.getCenterVisibleLeafColumns = o("getCenterVisibleLeafColumns", () => e.getCenterLeafColumns()), e.setColumnVisibility = (t) => e.options.onColumnVisibilityChange == null ? void 0 : e.options.onColumnVisibilityChange(t), e.resetColumnVisibility = (t) => {
1576
+ const r = (t, n) => S(() => [n(), n().filter((o) => o.getIsVisible()).map((o) => o.id).join("_")], (o) => o.filter((l) => l.getIsVisible == null ? void 0 : l.getIsVisible()), R(e.options, "debugColumns", t));
1577
+ e.getVisibleFlatColumns = r("getVisibleFlatColumns", () => e.getAllFlatColumns()), e.getVisibleLeafColumns = r("getVisibleLeafColumns", () => e.getAllLeafColumns()), e.getLeftVisibleLeafColumns = r("getLeftVisibleLeafColumns", () => e.getLeftLeafColumns()), e.getRightVisibleLeafColumns = r("getRightVisibleLeafColumns", () => e.getRightLeafColumns()), e.getCenterVisibleLeafColumns = r("getCenterVisibleLeafColumns", () => e.getCenterLeafColumns()), e.setColumnVisibility = (t) => e.options.onColumnVisibilityChange == null ? void 0 : e.options.onColumnVisibilityChange(t), e.resetColumnVisibility = (t) => {
1578
1578
  var n;
1579
1579
  e.setColumnVisibility(t ? {} : (n = e.initialState.columnVisibility) != null ? n : {});
1580
1580
  }, e.toggleAllColumnsVisible = (t) => {
1581
1581
  var n;
1582
- t = (n = t) != null ? n : !e.getIsAllColumnsVisible(), e.setColumnVisibility(e.getAllLeafColumns().reduce((r, l) => ({
1583
- ...r,
1582
+ t = (n = t) != null ? n : !e.getIsAllColumnsVisible(), e.setColumnVisibility(e.getAllLeafColumns().reduce((o, l) => ({
1583
+ ...o,
1584
1584
  [l.id]: t || !(l.getCanHide != null && l.getCanHide())
1585
1585
  }), {}));
1586
1586
  }, e.getIsAllColumnsVisible = () => !e.getAllLeafColumns().some((t) => !(t.getIsVisible != null && t.getIsVisible())), e.getIsSomeColumnsVisible = () => e.getAllLeafColumns().some((t) => t.getIsVisible == null ? void 0 : t.getIsVisible()), e.getToggleAllColumnsVisibilityHandler = () => (t) => {
@@ -1589,17 +1589,17 @@ const hn = {
1589
1589
  };
1590
1590
  }
1591
1591
  };
1592
- function oe(e, o) {
1593
- return o ? o === "center" ? e.getCenterVisibleLeafColumns() : o === "left" ? e.getLeftVisibleLeafColumns() : e.getRightVisibleLeafColumns() : e.getVisibleLeafColumns();
1592
+ function le(e, r) {
1593
+ return r ? r === "center" ? e.getCenterVisibleLeafColumns() : r === "left" ? e.getLeftVisibleLeafColumns() : e.getRightVisibleLeafColumns() : e.getVisibleLeafColumns();
1594
1594
  }
1595
- const vn = {
1595
+ const yn = {
1596
1596
  createTable: (e) => {
1597
1597
  e._getGlobalFacetedRowModel = e.options.getFacetedRowModel && e.options.getFacetedRowModel(e, "__global__"), e.getGlobalFacetedRowModel = () => e.options.manualFiltering || !e._getGlobalFacetedRowModel ? e.getPreFilteredRowModel() : e._getGlobalFacetedRowModel(), e._getGlobalFacetedUniqueValues = e.options.getFacetedUniqueValues && e.options.getFacetedUniqueValues(e, "__global__"), e.getGlobalFacetedUniqueValues = () => e._getGlobalFacetedUniqueValues ? e._getGlobalFacetedUniqueValues() : /* @__PURE__ */ new Map(), e._getGlobalFacetedMinMaxValues = e.options.getFacetedMinMaxValues && e.options.getFacetedMinMaxValues(e, "__global__"), e.getGlobalFacetedMinMaxValues = () => {
1598
1598
  if (e._getGlobalFacetedMinMaxValues)
1599
1599
  return e._getGlobalFacetedMinMaxValues();
1600
1600
  };
1601
1601
  }
1602
- }, wn = {
1602
+ }, Sn = {
1603
1603
  getInitialState: (e) => ({
1604
1604
  globalFilter: void 0,
1605
1605
  ...e
@@ -1607,32 +1607,32 @@ const vn = {
1607
1607
  getDefaultOptions: (e) => ({
1608
1608
  onGlobalFilterChange: L("globalFilter", e),
1609
1609
  globalFilterFn: "auto",
1610
- getColumnCanGlobalFilter: (o) => {
1610
+ getColumnCanGlobalFilter: (r) => {
1611
1611
  var t;
1612
- const n = (t = e.getCoreRowModel().flatRows[0]) == null || (t = t._getAllCellsByColumnId()[o.id]) == null ? void 0 : t.getValue();
1612
+ const n = (t = e.getCoreRowModel().flatRows[0]) == null || (t = t._getAllCellsByColumnId()[r.id]) == null ? void 0 : t.getValue();
1613
1613
  return typeof n == "string" || typeof n == "number";
1614
1614
  }
1615
1615
  }),
1616
- createColumn: (e, o) => {
1616
+ createColumn: (e, r) => {
1617
1617
  e.getCanGlobalFilter = () => {
1618
- var t, n, r, l;
1619
- return ((t = e.columnDef.enableGlobalFilter) != null ? t : !0) && ((n = o.options.enableGlobalFilter) != null ? n : !0) && ((r = o.options.enableFilters) != null ? r : !0) && ((l = o.options.getColumnCanGlobalFilter == null ? void 0 : o.options.getColumnCanGlobalFilter(e)) != null ? l : !0) && !!e.accessorFn;
1618
+ var t, n, o, l;
1619
+ return ((t = e.columnDef.enableGlobalFilter) != null ? t : !0) && ((n = r.options.enableGlobalFilter) != null ? n : !0) && ((o = r.options.enableFilters) != null ? o : !0) && ((l = r.options.getColumnCanGlobalFilter == null ? void 0 : r.options.getColumnCanGlobalFilter(e)) != null ? l : !0) && !!e.accessorFn;
1620
1620
  };
1621
1621
  },
1622
1622
  createTable: (e) => {
1623
- e.getGlobalAutoFilterFn = () => B.includesString, e.getGlobalFilterFn = () => {
1624
- var o, t;
1623
+ e.getGlobalAutoFilterFn = () => q.includesString, e.getGlobalFilterFn = () => {
1624
+ var r, t;
1625
1625
  const {
1626
1626
  globalFilterFn: n
1627
1627
  } = e.options;
1628
- return ue(n) ? n : n === "auto" ? e.getGlobalAutoFilterFn() : (o = (t = e.options.filterFns) == null ? void 0 : t[n]) != null ? o : B[n];
1629
- }, e.setGlobalFilter = (o) => {
1630
- e.options.onGlobalFilterChange == null || e.options.onGlobalFilterChange(o);
1631
- }, e.resetGlobalFilter = (o) => {
1632
- e.setGlobalFilter(o ? void 0 : e.initialState.globalFilter);
1628
+ return ge(n) ? n : n === "auto" ? e.getGlobalAutoFilterFn() : (r = (t = e.options.filterFns) == null ? void 0 : t[n]) != null ? r : q[n];
1629
+ }, e.setGlobalFilter = (r) => {
1630
+ e.options.onGlobalFilterChange == null || e.options.onGlobalFilterChange(r);
1631
+ }, e.resetGlobalFilter = (r) => {
1632
+ e.setGlobalFilter(r ? void 0 : e.initialState.globalFilter);
1633
1633
  };
1634
1634
  }
1635
- }, Cn = {
1635
+ }, Rn = {
1636
1636
  getInitialState: (e) => ({
1637
1637
  expanded: {},
1638
1638
  ...e
@@ -1642,16 +1642,16 @@ const vn = {
1642
1642
  paginateExpandedRows: !0
1643
1643
  }),
1644
1644
  createTable: (e) => {
1645
- let o = !1, t = !1;
1645
+ let r = !1, t = !1;
1646
1646
  e._autoResetExpanded = () => {
1647
- var n, r;
1648
- if (!o) {
1647
+ var n, o;
1648
+ if (!r) {
1649
1649
  e._queue(() => {
1650
- o = !0;
1650
+ r = !0;
1651
1651
  });
1652
1652
  return;
1653
1653
  }
1654
- if ((n = (r = e.options.autoResetAll) != null ? r : e.options.autoResetExpanded) != null ? n : !e.options.manualExpanding) {
1654
+ if ((n = (o = e.options.autoResetAll) != null ? o : e.options.autoResetExpanded) != null ? n : !e.options.manualExpanding) {
1655
1655
  if (t) return;
1656
1656
  t = !0, e._queue(() => {
1657
1657
  e.resetExpanded(), t = !1;
@@ -1660,8 +1660,8 @@ const vn = {
1660
1660
  }, e.setExpanded = (n) => e.options.onExpandedChange == null ? void 0 : e.options.onExpandedChange(n), e.toggleAllRowsExpanded = (n) => {
1661
1661
  n ?? !e.getIsAllRowsExpanded() ? e.setExpanded(!0) : e.setExpanded({});
1662
1662
  }, e.resetExpanded = (n) => {
1663
- var r, l;
1664
- e.setExpanded(n ? {} : (r = (l = e.initialState) == null ? void 0 : l.expanded) != null ? r : {});
1663
+ var o, l;
1664
+ e.setExpanded(n ? {} : (o = (l = e.initialState) == null ? void 0 : l.expanded) != null ? o : {});
1665
1665
  }, e.getCanSomeRowsExpand = () => e.getPrePaginationRowModel().flatRows.some((n) => n.getCanExpand()), e.getToggleAllRowsExpandedHandler = () => (n) => {
1666
1666
  n.persist == null || n.persist(), e.toggleAllRowsExpanded();
1667
1667
  }, e.getIsSomeRowsExpanded = () => {
@@ -1669,48 +1669,48 @@ const vn = {
1669
1669
  return n === !0 || Object.values(n).some(Boolean);
1670
1670
  }, e.getIsAllRowsExpanded = () => {
1671
1671
  const n = e.getState().expanded;
1672
- return typeof n == "boolean" ? n === !0 : !(!Object.keys(n).length || e.getRowModel().flatRows.some((r) => !r.getIsExpanded()));
1672
+ return typeof n == "boolean" ? n === !0 : !(!Object.keys(n).length || e.getRowModel().flatRows.some((o) => !o.getIsExpanded()));
1673
1673
  }, e.getExpandedDepth = () => {
1674
1674
  let n = 0;
1675
1675
  return (e.getState().expanded === !0 ? Object.keys(e.getRowModel().rowsById) : Object.keys(e.getState().expanded)).forEach((l) => {
1676
- const i = l.split(".");
1677
- n = Math.max(n, i.length);
1676
+ const s = l.split(".");
1677
+ n = Math.max(n, s.length);
1678
1678
  }), n;
1679
1679
  }, e.getPreExpandedRowModel = () => e.getSortedRowModel(), e.getExpandedRowModel = () => (!e._getExpandedRowModel && e.options.getExpandedRowModel && (e._getExpandedRowModel = e.options.getExpandedRowModel(e)), e.options.manualExpanding || !e._getExpandedRowModel ? e.getPreExpandedRowModel() : e._getExpandedRowModel());
1680
1680
  },
1681
- createRow: (e, o) => {
1681
+ createRow: (e, r) => {
1682
1682
  e.toggleExpanded = (t) => {
1683
- o.setExpanded((n) => {
1684
- var r;
1683
+ r.setExpanded((n) => {
1684
+ var o;
1685
1685
  const l = n === !0 ? !0 : !!(n != null && n[e.id]);
1686
- let i = {};
1687
- if (n === !0 ? Object.keys(o.getRowModel().rowsById).forEach((s) => {
1688
- i[s] = !0;
1689
- }) : i = n, t = (r = t) != null ? r : !l, !l && t)
1686
+ let s = {};
1687
+ if (n === !0 ? Object.keys(r.getRowModel().rowsById).forEach((i) => {
1688
+ s[i] = !0;
1689
+ }) : s = n, t = (o = t) != null ? o : !l, !l && t)
1690
1690
  return {
1691
- ...i,
1691
+ ...s,
1692
1692
  [e.id]: !0
1693
1693
  };
1694
1694
  if (l && !t) {
1695
1695
  const {
1696
- [e.id]: s,
1696
+ [e.id]: i,
1697
1697
  ...u
1698
- } = i;
1698
+ } = s;
1699
1699
  return u;
1700
1700
  }
1701
1701
  return n;
1702
1702
  });
1703
1703
  }, e.getIsExpanded = () => {
1704
1704
  var t;
1705
- const n = o.getState().expanded;
1706
- return !!((t = o.options.getIsRowExpanded == null ? void 0 : o.options.getIsRowExpanded(e)) != null ? t : n === !0 || n != null && n[e.id]);
1705
+ const n = r.getState().expanded;
1706
+ return !!((t = r.options.getIsRowExpanded == null ? void 0 : r.options.getIsRowExpanded(e)) != null ? t : n === !0 || n != null && n[e.id]);
1707
1707
  }, e.getCanExpand = () => {
1708
- var t, n, r;
1709
- return (t = o.options.getRowCanExpand == null ? void 0 : o.options.getRowCanExpand(e)) != null ? t : ((n = o.options.enableExpanding) != null ? n : !0) && !!((r = e.subRows) != null && r.length);
1708
+ var t, n, o;
1709
+ return (t = r.options.getRowCanExpand == null ? void 0 : r.options.getRowCanExpand(e)) != null ? t : ((n = r.options.enableExpanding) != null ? n : !0) && !!((o = e.subRows) != null && o.length);
1710
1710
  }, e.getIsAllParentsExpanded = () => {
1711
1711
  let t = !0, n = e;
1712
1712
  for (; t && n.parentId; )
1713
- n = o.getRow(n.parentId, !0), t = n.getIsExpanded();
1713
+ n = r.getRow(n.parentId, !0), t = n.getIsExpanded();
1714
1714
  return t;
1715
1715
  }, e.getToggleExpandedHandler = () => {
1716
1716
  const t = e.getCanExpand();
@@ -1719,14 +1719,14 @@ const vn = {
1719
1719
  };
1720
1720
  };
1721
1721
  }
1722
- }, Fe = 0, $e = 10, Ce = () => ({
1723
- pageIndex: Fe,
1722
+ }, Ie = 0, $e = 10, ye = () => ({
1723
+ pageIndex: Ie,
1724
1724
  pageSize: $e
1725
- }), Sn = {
1725
+ }), xn = {
1726
1726
  getInitialState: (e) => ({
1727
1727
  ...e,
1728
1728
  pagination: {
1729
- ...Ce(),
1729
+ ...ye(),
1730
1730
  ...e == null ? void 0 : e.pagination
1731
1731
  }
1732
1732
  }),
@@ -1734,66 +1734,66 @@ const vn = {
1734
1734
  onPaginationChange: L("pagination", e)
1735
1735
  }),
1736
1736
  createTable: (e) => {
1737
- let o = !1, t = !1;
1737
+ let r = !1, t = !1;
1738
1738
  e._autoResetPageIndex = () => {
1739
- var n, r;
1740
- if (!o) {
1739
+ var n, o;
1740
+ if (!r) {
1741
1741
  e._queue(() => {
1742
- o = !0;
1742
+ r = !0;
1743
1743
  });
1744
1744
  return;
1745
1745
  }
1746
- if ((n = (r = e.options.autoResetAll) != null ? r : e.options.autoResetPageIndex) != null ? n : !e.options.manualPagination) {
1746
+ if ((n = (o = e.options.autoResetAll) != null ? o : e.options.autoResetPageIndex) != null ? n : !e.options.manualPagination) {
1747
1747
  if (t) return;
1748
1748
  t = !0, e._queue(() => {
1749
1749
  e.resetPageIndex(), t = !1;
1750
1750
  });
1751
1751
  }
1752
1752
  }, e.setPagination = (n) => {
1753
- const r = (l) => j(n, l);
1754
- return e.options.onPaginationChange == null ? void 0 : e.options.onPaginationChange(r);
1753
+ const o = (l) => X(n, l);
1754
+ return e.options.onPaginationChange == null ? void 0 : e.options.onPaginationChange(o);
1755
1755
  }, e.resetPagination = (n) => {
1756
- var r;
1757
- e.setPagination(n ? Ce() : (r = e.initialState.pagination) != null ? r : Ce());
1756
+ var o;
1757
+ e.setPagination(n ? ye() : (o = e.initialState.pagination) != null ? o : ye());
1758
1758
  }, e.setPageIndex = (n) => {
1759
- e.setPagination((r) => {
1760
- let l = j(n, r.pageIndex);
1761
- const i = typeof e.options.pageCount > "u" || e.options.pageCount === -1 ? Number.MAX_SAFE_INTEGER : e.options.pageCount - 1;
1762
- return l = Math.max(0, Math.min(l, i)), {
1763
- ...r,
1759
+ e.setPagination((o) => {
1760
+ let l = X(n, o.pageIndex);
1761
+ const s = typeof e.options.pageCount > "u" || e.options.pageCount === -1 ? Number.MAX_SAFE_INTEGER : e.options.pageCount - 1;
1762
+ return l = Math.max(0, Math.min(l, s)), {
1763
+ ...o,
1764
1764
  pageIndex: l
1765
1765
  };
1766
1766
  });
1767
1767
  }, e.resetPageIndex = (n) => {
1768
- var r, l;
1769
- e.setPageIndex(n ? Fe : (r = (l = e.initialState) == null || (l = l.pagination) == null ? void 0 : l.pageIndex) != null ? r : Fe);
1768
+ var o, l;
1769
+ e.setPageIndex(n ? Ie : (o = (l = e.initialState) == null || (l = l.pagination) == null ? void 0 : l.pageIndex) != null ? o : Ie);
1770
1770
  }, e.resetPageSize = (n) => {
1771
- var r, l;
1772
- e.setPageSize(n ? $e : (r = (l = e.initialState) == null || (l = l.pagination) == null ? void 0 : l.pageSize) != null ? r : $e);
1771
+ var o, l;
1772
+ e.setPageSize(n ? $e : (o = (l = e.initialState) == null || (l = l.pagination) == null ? void 0 : l.pageSize) != null ? o : $e);
1773
1773
  }, e.setPageSize = (n) => {
1774
- e.setPagination((r) => {
1775
- const l = Math.max(1, j(n, r.pageSize)), i = r.pageSize * r.pageIndex, s = Math.floor(i / l);
1774
+ e.setPagination((o) => {
1775
+ const l = Math.max(1, X(n, o.pageSize)), s = o.pageSize * o.pageIndex, i = Math.floor(s / l);
1776
1776
  return {
1777
- ...r,
1778
- pageIndex: s,
1777
+ ...o,
1778
+ pageIndex: i,
1779
1779
  pageSize: l
1780
1780
  };
1781
1781
  });
1782
- }, e.setPageCount = (n) => e.setPagination((r) => {
1782
+ }, e.setPageCount = (n) => e.setPagination((o) => {
1783
1783
  var l;
1784
- let i = j(n, (l = e.options.pageCount) != null ? l : -1);
1785
- return typeof i == "number" && (i = Math.max(-1, i)), {
1786
- ...r,
1787
- pageCount: i
1784
+ let s = X(n, (l = e.options.pageCount) != null ? l : -1);
1785
+ return typeof s == "number" && (s = Math.max(-1, s)), {
1786
+ ...o,
1787
+ pageCount: s
1788
1788
  };
1789
- }), e.getPageOptions = y(() => [e.getPageCount()], (n) => {
1790
- let r = [];
1791
- return n && n > 0 && (r = [...new Array(n)].fill(null).map((l, i) => i)), r;
1789
+ }), e.getPageOptions = S(() => [e.getPageCount()], (n) => {
1790
+ let o = [];
1791
+ return n && n > 0 && (o = [...new Array(n)].fill(null).map((l, s) => s)), o;
1792
1792
  }, R(e.options, "debugTable", "getPageOptions")), e.getCanPreviousPage = () => e.getState().pagination.pageIndex > 0, e.getCanNextPage = () => {
1793
1793
  const {
1794
1794
  pageIndex: n
1795
- } = e.getState().pagination, r = e.getPageCount();
1796
- return r === -1 ? !0 : r === 0 ? !1 : n < r - 1;
1795
+ } = e.getState().pagination, o = e.getPageCount();
1796
+ return o === -1 ? !0 : o === 0 ? !1 : n < o - 1;
1797
1797
  }, e.previousPage = () => e.setPageIndex((n) => n - 1), e.nextPage = () => e.setPageIndex((n) => n + 1), e.firstPage = () => e.setPageIndex(0), e.lastPage = () => e.setPageIndex(e.getPageCount() - 1), e.getPrePaginationRowModel = () => e.getExpandedRowModel(), e.getPaginationRowModel = () => (!e._getPaginationRowModel && e.options.getPaginationRowModel && (e._getPaginationRowModel = e.options.getPaginationRowModel(e)), e.options.manualPagination || !e._getPaginationRowModel ? e.getPrePaginationRowModel() : e._getPaginationRowModel()), e.getPageCount = () => {
1798
1798
  var n;
1799
1799
  return (n = e.options.pageCount) != null ? n : Math.ceil(e.getRowCount() / e.getState().pagination.pageSize);
@@ -1805,7 +1805,7 @@ const vn = {
1805
1805
  }, Se = () => ({
1806
1806
  top: [],
1807
1807
  bottom: []
1808
- }), yn = {
1808
+ }), _n = {
1809
1809
  getInitialState: (e) => ({
1810
1810
  rowPinning: Se(),
1811
1811
  ...e
@@ -1813,100 +1813,100 @@ const vn = {
1813
1813
  getDefaultOptions: (e) => ({
1814
1814
  onRowPinningChange: L("rowPinning", e)
1815
1815
  }),
1816
- createRow: (e, o) => {
1817
- e.pin = (t, n, r) => {
1816
+ createRow: (e, r) => {
1817
+ e.pin = (t, n, o) => {
1818
1818
  const l = n ? e.getLeafRows().map((u) => {
1819
1819
  let {
1820
1820
  id: f
1821
1821
  } = u;
1822
1822
  return f;
1823
- }) : [], i = r ? e.getParentRows().map((u) => {
1823
+ }) : [], s = o ? e.getParentRows().map((u) => {
1824
1824
  let {
1825
1825
  id: f
1826
1826
  } = u;
1827
1827
  return f;
1828
- }) : [], s = /* @__PURE__ */ new Set([...i, e.id, ...l]);
1829
- o.setRowPinning((u) => {
1828
+ }) : [], i = /* @__PURE__ */ new Set([...s, e.id, ...l]);
1829
+ r.setRowPinning((u) => {
1830
1830
  var f, g;
1831
1831
  if (t === "bottom") {
1832
1832
  var p, d;
1833
1833
  return {
1834
- top: ((p = u == null ? void 0 : u.top) != null ? p : []).filter((v) => !(s != null && s.has(v))),
1835
- bottom: [...((d = u == null ? void 0 : u.bottom) != null ? d : []).filter((v) => !(s != null && s.has(v))), ...Array.from(s)]
1834
+ top: ((p = u == null ? void 0 : u.top) != null ? p : []).filter((h) => !(i != null && i.has(h))),
1835
+ bottom: [...((d = u == null ? void 0 : u.bottom) != null ? d : []).filter((h) => !(i != null && i.has(h))), ...Array.from(i)]
1836
1836
  };
1837
1837
  }
1838
1838
  if (t === "top") {
1839
1839
  var a, m;
1840
1840
  return {
1841
- top: [...((a = u == null ? void 0 : u.top) != null ? a : []).filter((v) => !(s != null && s.has(v))), ...Array.from(s)],
1842
- bottom: ((m = u == null ? void 0 : u.bottom) != null ? m : []).filter((v) => !(s != null && s.has(v)))
1841
+ top: [...((a = u == null ? void 0 : u.top) != null ? a : []).filter((h) => !(i != null && i.has(h))), ...Array.from(i)],
1842
+ bottom: ((m = u == null ? void 0 : u.bottom) != null ? m : []).filter((h) => !(i != null && i.has(h)))
1843
1843
  };
1844
1844
  }
1845
1845
  return {
1846
- top: ((f = u == null ? void 0 : u.top) != null ? f : []).filter((v) => !(s != null && s.has(v))),
1847
- bottom: ((g = u == null ? void 0 : u.bottom) != null ? g : []).filter((v) => !(s != null && s.has(v)))
1846
+ top: ((f = u == null ? void 0 : u.top) != null ? f : []).filter((h) => !(i != null && i.has(h))),
1847
+ bottom: ((g = u == null ? void 0 : u.bottom) != null ? g : []).filter((h) => !(i != null && i.has(h)))
1848
1848
  };
1849
1849
  });
1850
1850
  }, e.getCanPin = () => {
1851
1851
  var t;
1852
1852
  const {
1853
1853
  enableRowPinning: n,
1854
- enablePinning: r
1855
- } = o.options;
1856
- return typeof n == "function" ? n(e) : (t = n ?? r) != null ? t : !0;
1854
+ enablePinning: o
1855
+ } = r.options;
1856
+ return typeof n == "function" ? n(e) : (t = n ?? o) != null ? t : !0;
1857
1857
  }, e.getIsPinned = () => {
1858
1858
  const t = [e.id], {
1859
1859
  top: n,
1860
- bottom: r
1861
- } = o.getState().rowPinning, l = t.some((s) => n == null ? void 0 : n.includes(s)), i = t.some((s) => r == null ? void 0 : r.includes(s));
1862
- return l ? "top" : i ? "bottom" : !1;
1860
+ bottom: o
1861
+ } = r.getState().rowPinning, l = t.some((i) => n == null ? void 0 : n.includes(i)), s = t.some((i) => o == null ? void 0 : o.includes(i));
1862
+ return l ? "top" : s ? "bottom" : !1;
1863
1863
  }, e.getPinnedIndex = () => {
1864
1864
  var t, n;
1865
- const r = e.getIsPinned();
1866
- if (!r) return -1;
1867
- const l = (t = r === "top" ? o.getTopRows() : o.getBottomRows()) == null ? void 0 : t.map((i) => {
1865
+ const o = e.getIsPinned();
1866
+ if (!o) return -1;
1867
+ const l = (t = o === "top" ? r.getTopRows() : r.getBottomRows()) == null ? void 0 : t.map((s) => {
1868
1868
  let {
1869
- id: s
1870
- } = i;
1871
- return s;
1869
+ id: i
1870
+ } = s;
1871
+ return i;
1872
1872
  });
1873
1873
  return (n = l == null ? void 0 : l.indexOf(e.id)) != null ? n : -1;
1874
1874
  };
1875
1875
  },
1876
1876
  createTable: (e) => {
1877
- e.setRowPinning = (o) => e.options.onRowPinningChange == null ? void 0 : e.options.onRowPinningChange(o), e.resetRowPinning = (o) => {
1877
+ e.setRowPinning = (r) => e.options.onRowPinningChange == null ? void 0 : e.options.onRowPinningChange(r), e.resetRowPinning = (r) => {
1878
1878
  var t, n;
1879
- return e.setRowPinning(o ? Se() : (t = (n = e.initialState) == null ? void 0 : n.rowPinning) != null ? t : Se());
1880
- }, e.getIsSomeRowsPinned = (o) => {
1879
+ return e.setRowPinning(r ? Se() : (t = (n = e.initialState) == null ? void 0 : n.rowPinning) != null ? t : Se());
1880
+ }, e.getIsSomeRowsPinned = (r) => {
1881
1881
  var t;
1882
1882
  const n = e.getState().rowPinning;
1883
- if (!o) {
1884
- var r, l;
1885
- return !!((r = n.top) != null && r.length || (l = n.bottom) != null && l.length);
1883
+ if (!r) {
1884
+ var o, l;
1885
+ return !!((o = n.top) != null && o.length || (l = n.bottom) != null && l.length);
1886
1886
  }
1887
- return !!((t = n[o]) != null && t.length);
1888
- }, e._getPinnedRows = (o, t, n) => {
1889
- var r;
1890
- return ((r = e.options.keepPinnedRows) == null || r ? (
1887
+ return !!((t = n[r]) != null && t.length);
1888
+ }, e._getPinnedRows = (r, t, n) => {
1889
+ var o;
1890
+ return ((o = e.options.keepPinnedRows) == null || o ? (
1891
1891
  //get all rows that are pinned even if they would not be otherwise visible
1892
1892
  //account for expanded parent rows, but not pagination or filtering
1893
- (t ?? []).map((i) => {
1894
- const s = e.getRow(i, !0);
1895
- return s.getIsAllParentsExpanded() ? s : null;
1893
+ (t ?? []).map((s) => {
1894
+ const i = e.getRow(s, !0);
1895
+ return i.getIsAllParentsExpanded() ? i : null;
1896
1896
  })
1897
1897
  ) : (
1898
1898
  //else get only visible rows that are pinned
1899
- (t ?? []).map((i) => o.find((s) => s.id === i))
1900
- )).filter(Boolean).map((i) => ({
1901
- ...i,
1899
+ (t ?? []).map((s) => r.find((i) => i.id === s))
1900
+ )).filter(Boolean).map((s) => ({
1901
+ ...s,
1902
1902
  position: n
1903
1903
  }));
1904
- }, e.getTopRows = y(() => [e.getRowModel().rows, e.getState().rowPinning.top], (o, t) => e._getPinnedRows(o, t, "top"), R(e.options, "debugRows", "getTopRows")), e.getBottomRows = y(() => [e.getRowModel().rows, e.getState().rowPinning.bottom], (o, t) => e._getPinnedRows(o, t, "bottom"), R(e.options, "debugRows", "getBottomRows")), e.getCenterRows = y(() => [e.getRowModel().rows, e.getState().rowPinning.top, e.getState().rowPinning.bottom], (o, t, n) => {
1905
- const r = /* @__PURE__ */ new Set([...t ?? [], ...n ?? []]);
1906
- return o.filter((l) => !r.has(l.id));
1904
+ }, e.getTopRows = S(() => [e.getRowModel().rows, e.getState().rowPinning.top], (r, t) => e._getPinnedRows(r, t, "top"), R(e.options, "debugRows", "getTopRows")), e.getBottomRows = S(() => [e.getRowModel().rows, e.getState().rowPinning.bottom], (r, t) => e._getPinnedRows(r, t, "bottom"), R(e.options, "debugRows", "getBottomRows")), e.getCenterRows = S(() => [e.getRowModel().rows, e.getState().rowPinning.top, e.getState().rowPinning.bottom], (r, t, n) => {
1905
+ const o = /* @__PURE__ */ new Set([...t ?? [], ...n ?? []]);
1906
+ return r.filter((l) => !o.has(l.id));
1907
1907
  }, R(e.options, "debugRows", "getCenterRows"));
1908
1908
  }
1909
- }, Rn = {
1909
+ }, Fn = {
1910
1910
  getInitialState: (e) => ({
1911
1911
  rowSelection: {},
1912
1912
  ...e
@@ -1921,120 +1921,120 @@ const vn = {
1921
1921
  // isInclusiveSelectEvent: (e: unknown) => !!e.shiftKey,
1922
1922
  }),
1923
1923
  createTable: (e) => {
1924
- e.setRowSelection = (o) => e.options.onRowSelectionChange == null ? void 0 : e.options.onRowSelectionChange(o), e.resetRowSelection = (o) => {
1924
+ e.setRowSelection = (r) => e.options.onRowSelectionChange == null ? void 0 : e.options.onRowSelectionChange(r), e.resetRowSelection = (r) => {
1925
1925
  var t;
1926
- return e.setRowSelection(o ? {} : (t = e.initialState.rowSelection) != null ? t : {});
1927
- }, e.toggleAllRowsSelected = (o) => {
1926
+ return e.setRowSelection(r ? {} : (t = e.initialState.rowSelection) != null ? t : {});
1927
+ }, e.toggleAllRowsSelected = (r) => {
1928
1928
  e.setRowSelection((t) => {
1929
- o = typeof o < "u" ? o : !e.getIsAllRowsSelected();
1929
+ r = typeof r < "u" ? r : !e.getIsAllRowsSelected();
1930
1930
  const n = {
1931
1931
  ...t
1932
- }, r = e.getPreGroupedRowModel().flatRows;
1933
- return o ? r.forEach((l) => {
1932
+ }, o = e.getPreGroupedRowModel().flatRows;
1933
+ return r ? o.forEach((l) => {
1934
1934
  l.getCanSelect() && (n[l.id] = !0);
1935
- }) : r.forEach((l) => {
1935
+ }) : o.forEach((l) => {
1936
1936
  delete n[l.id];
1937
1937
  }), n;
1938
1938
  });
1939
- }, e.toggleAllPageRowsSelected = (o) => e.setRowSelection((t) => {
1940
- const n = typeof o < "u" ? o : !e.getIsAllPageRowsSelected(), r = {
1939
+ }, e.toggleAllPageRowsSelected = (r) => e.setRowSelection((t) => {
1940
+ const n = typeof r < "u" ? r : !e.getIsAllPageRowsSelected(), o = {
1941
1941
  ...t
1942
1942
  };
1943
1943
  return e.getRowModel().rows.forEach((l) => {
1944
- Ie(r, l.id, n, !0, e);
1945
- }), r;
1946
- }), e.getPreSelectedRowModel = () => e.getCoreRowModel(), e.getSelectedRowModel = y(() => [e.getState().rowSelection, e.getCoreRowModel()], (o, t) => Object.keys(o).length ? ye(e, t) : {
1944
+ Ne(o, l.id, n, !0, e);
1945
+ }), o;
1946
+ }), e.getPreSelectedRowModel = () => e.getCoreRowModel(), e.getSelectedRowModel = S(() => [e.getState().rowSelection, e.getCoreRowModel()], (r, t) => Object.keys(r).length ? Re(e, t) : {
1947
1947
  rows: [],
1948
1948
  flatRows: [],
1949
1949
  rowsById: {}
1950
- }, R(e.options, "debugTable", "getSelectedRowModel")), e.getFilteredSelectedRowModel = y(() => [e.getState().rowSelection, e.getFilteredRowModel()], (o, t) => Object.keys(o).length ? ye(e, t) : {
1950
+ }, R(e.options, "debugTable", "getSelectedRowModel")), e.getFilteredSelectedRowModel = S(() => [e.getState().rowSelection, e.getFilteredRowModel()], (r, t) => Object.keys(r).length ? Re(e, t) : {
1951
1951
  rows: [],
1952
1952
  flatRows: [],
1953
1953
  rowsById: {}
1954
- }, R(e.options, "debugTable", "getFilteredSelectedRowModel")), e.getGroupedSelectedRowModel = y(() => [e.getState().rowSelection, e.getSortedRowModel()], (o, t) => Object.keys(o).length ? ye(e, t) : {
1954
+ }, R(e.options, "debugTable", "getFilteredSelectedRowModel")), e.getGroupedSelectedRowModel = S(() => [e.getState().rowSelection, e.getSortedRowModel()], (r, t) => Object.keys(r).length ? Re(e, t) : {
1955
1955
  rows: [],
1956
1956
  flatRows: [],
1957
1957
  rowsById: {}
1958
1958
  }, R(e.options, "debugTable", "getGroupedSelectedRowModel")), e.getIsAllRowsSelected = () => {
1959
- const o = e.getFilteredRowModel().flatRows, {
1959
+ const r = e.getFilteredRowModel().flatRows, {
1960
1960
  rowSelection: t
1961
1961
  } = e.getState();
1962
- let n = !!(o.length && Object.keys(t).length);
1963
- return n && o.some((r) => r.getCanSelect() && !t[r.id]) && (n = !1), n;
1962
+ let n = !!(r.length && Object.keys(t).length);
1963
+ return n && r.some((o) => o.getCanSelect() && !t[o.id]) && (n = !1), n;
1964
1964
  }, e.getIsAllPageRowsSelected = () => {
1965
- const o = e.getPaginationRowModel().flatRows.filter((r) => r.getCanSelect()), {
1965
+ const r = e.getPaginationRowModel().flatRows.filter((o) => o.getCanSelect()), {
1966
1966
  rowSelection: t
1967
1967
  } = e.getState();
1968
- let n = !!o.length;
1969
- return n && o.some((r) => !t[r.id]) && (n = !1), n;
1968
+ let n = !!r.length;
1969
+ return n && r.some((o) => !t[o.id]) && (n = !1), n;
1970
1970
  }, e.getIsSomeRowsSelected = () => {
1971
- var o;
1972
- const t = Object.keys((o = e.getState().rowSelection) != null ? o : {}).length;
1971
+ var r;
1972
+ const t = Object.keys((r = e.getState().rowSelection) != null ? r : {}).length;
1973
1973
  return t > 0 && t < e.getFilteredRowModel().flatRows.length;
1974
1974
  }, e.getIsSomePageRowsSelected = () => {
1975
- const o = e.getPaginationRowModel().flatRows;
1976
- return e.getIsAllPageRowsSelected() ? !1 : o.filter((t) => t.getCanSelect()).some((t) => t.getIsSelected() || t.getIsSomeSelected());
1977
- }, e.getToggleAllRowsSelectedHandler = () => (o) => {
1978
- e.toggleAllRowsSelected(o.target.checked);
1979
- }, e.getToggleAllPageRowsSelectedHandler = () => (o) => {
1980
- e.toggleAllPageRowsSelected(o.target.checked);
1975
+ const r = e.getPaginationRowModel().flatRows;
1976
+ return e.getIsAllPageRowsSelected() ? !1 : r.filter((t) => t.getCanSelect()).some((t) => t.getIsSelected() || t.getIsSomeSelected());
1977
+ }, e.getToggleAllRowsSelectedHandler = () => (r) => {
1978
+ e.toggleAllRowsSelected(r.target.checked);
1979
+ }, e.getToggleAllPageRowsSelectedHandler = () => (r) => {
1980
+ e.toggleAllPageRowsSelected(r.target.checked);
1981
1981
  };
1982
1982
  },
1983
- createRow: (e, o) => {
1983
+ createRow: (e, r) => {
1984
1984
  e.toggleSelected = (t, n) => {
1985
- const r = e.getIsSelected();
1986
- o.setRowSelection((l) => {
1987
- var i;
1988
- if (t = typeof t < "u" ? t : !r, e.getCanSelect() && r === t)
1985
+ const o = e.getIsSelected();
1986
+ r.setRowSelection((l) => {
1987
+ var s;
1988
+ if (t = typeof t < "u" ? t : !o, e.getCanSelect() && o === t)
1989
1989
  return l;
1990
- const s = {
1990
+ const i = {
1991
1991
  ...l
1992
1992
  };
1993
- return Ie(s, e.id, t, (i = n == null ? void 0 : n.selectChildren) != null ? i : !0, o), s;
1993
+ return Ne(i, e.id, t, (s = n == null ? void 0 : n.selectChildren) != null ? s : !0, r), i;
1994
1994
  });
1995
1995
  }, e.getIsSelected = () => {
1996
1996
  const {
1997
1997
  rowSelection: t
1998
- } = o.getState();
1998
+ } = r.getState();
1999
1999
  return Le(e, t);
2000
2000
  }, e.getIsSomeSelected = () => {
2001
2001
  const {
2002
2002
  rowSelection: t
2003
- } = o.getState();
2003
+ } = r.getState();
2004
2004
  return Me(e, t) === "some";
2005
2005
  }, e.getIsAllSubRowsSelected = () => {
2006
2006
  const {
2007
2007
  rowSelection: t
2008
- } = o.getState();
2008
+ } = r.getState();
2009
2009
  return Me(e, t) === "all";
2010
2010
  }, e.getCanSelect = () => {
2011
2011
  var t;
2012
- return typeof o.options.enableRowSelection == "function" ? o.options.enableRowSelection(e) : (t = o.options.enableRowSelection) != null ? t : !0;
2012
+ return typeof r.options.enableRowSelection == "function" ? r.options.enableRowSelection(e) : (t = r.options.enableRowSelection) != null ? t : !0;
2013
2013
  }, e.getCanSelectSubRows = () => {
2014
2014
  var t;
2015
- return typeof o.options.enableSubRowSelection == "function" ? o.options.enableSubRowSelection(e) : (t = o.options.enableSubRowSelection) != null ? t : !0;
2015
+ return typeof r.options.enableSubRowSelection == "function" ? r.options.enableSubRowSelection(e) : (t = r.options.enableSubRowSelection) != null ? t : !0;
2016
2016
  }, e.getCanMultiSelect = () => {
2017
2017
  var t;
2018
- return typeof o.options.enableMultiRowSelection == "function" ? o.options.enableMultiRowSelection(e) : (t = o.options.enableMultiRowSelection) != null ? t : !0;
2018
+ return typeof r.options.enableMultiRowSelection == "function" ? r.options.enableMultiRowSelection(e) : (t = r.options.enableMultiRowSelection) != null ? t : !0;
2019
2019
  }, e.getToggleSelectedHandler = () => {
2020
2020
  const t = e.getCanSelect();
2021
2021
  return (n) => {
2022
- var r;
2023
- t && e.toggleSelected((r = n.target) == null ? void 0 : r.checked);
2022
+ var o;
2023
+ t && e.toggleSelected((o = n.target) == null ? void 0 : o.checked);
2024
2024
  };
2025
2025
  };
2026
2026
  }
2027
- }, Ie = (e, o, t, n, r) => {
2027
+ }, Ne = (e, r, t, n, o) => {
2028
2028
  var l;
2029
- const i = r.getRow(o, !0);
2030
- t ? (i.getCanMultiSelect() || Object.keys(e).forEach((s) => delete e[s]), i.getCanSelect() && (e[o] = !0)) : delete e[o], n && (l = i.subRows) != null && l.length && i.getCanSelectSubRows() && i.subRows.forEach((s) => Ie(e, s.id, t, n, r));
2029
+ const s = o.getRow(r, !0);
2030
+ t ? (s.getCanMultiSelect() || Object.keys(e).forEach((i) => delete e[i]), s.getCanSelect() && (e[r] = !0)) : delete e[r], n && (l = s.subRows) != null && l.length && s.getCanSelectSubRows() && s.subRows.forEach((i) => Ne(e, i.id, t, n, o));
2031
2031
  };
2032
- function ye(e, o) {
2033
- const t = e.getState().rowSelection, n = [], r = {}, l = function(i, s) {
2034
- return i.map((u) => {
2032
+ function Re(e, r) {
2033
+ const t = e.getState().rowSelection, n = [], o = {}, l = function(s, i) {
2034
+ return s.map((u) => {
2035
2035
  var f;
2036
2036
  const g = Le(u, t);
2037
- if (g && (n.push(u), r[u.id] = u), (f = u.subRows) != null && f.length && (u = {
2037
+ if (g && (n.push(u), o[u.id] = u), (f = u.subRows) != null && f.length && (u = {
2038
2038
  ...u,
2039
2039
  subRows: l(u.subRows)
2040
2040
  }), g)
@@ -2042,64 +2042,64 @@ function ye(e, o) {
2042
2042
  }).filter(Boolean);
2043
2043
  };
2044
2044
  return {
2045
- rows: l(o.rows),
2045
+ rows: l(r.rows),
2046
2046
  flatRows: n,
2047
- rowsById: r
2047
+ rowsById: o
2048
2048
  };
2049
2049
  }
2050
- function Le(e, o) {
2050
+ function Le(e, r) {
2051
2051
  var t;
2052
- return (t = o[e.id]) != null ? t : !1;
2052
+ return (t = r[e.id]) != null ? t : !1;
2053
2053
  }
2054
- function Me(e, o, t) {
2054
+ function Me(e, r, t) {
2055
2055
  var n;
2056
2056
  if (!((n = e.subRows) != null && n.length)) return !1;
2057
- let r = !0, l = !1;
2058
- return e.subRows.forEach((i) => {
2059
- if (!(l && !r) && (i.getCanSelect() && (Le(i, o) ? l = !0 : r = !1), i.subRows && i.subRows.length)) {
2060
- const s = Me(i, o);
2061
- s === "all" ? l = !0 : (s === "some" && (l = !0), r = !1);
2057
+ let o = !0, l = !1;
2058
+ return e.subRows.forEach((s) => {
2059
+ if (!(l && !o) && (s.getCanSelect() && (Le(s, r) ? l = !0 : o = !1), s.subRows && s.subRows.length)) {
2060
+ const i = Me(s, r);
2061
+ i === "all" ? l = !0 : (i === "some" && (l = !0), o = !1);
2062
2062
  }
2063
- }), r ? "all" : l ? "some" : !1;
2063
+ }), o ? "all" : l ? "some" : !1;
2064
2064
  }
2065
- const Ve = /([0-9]+)/gm, xn = (e, o, t) => lt(X(e.getValue(t)).toLowerCase(), X(o.getValue(t)).toLowerCase()), _n = (e, o, t) => lt(X(e.getValue(t)), X(o.getValue(t))), Fn = (e, o, t) => ze(X(e.getValue(t)).toLowerCase(), X(o.getValue(t)).toLowerCase()), $n = (e, o, t) => ze(X(e.getValue(t)), X(o.getValue(t))), In = (e, o, t) => {
2066
- const n = e.getValue(t), r = o.getValue(t);
2067
- return n > r ? 1 : n < r ? -1 : 0;
2068
- }, Mn = (e, o, t) => ze(e.getValue(t), o.getValue(t));
2069
- function ze(e, o) {
2070
- return e === o ? 0 : e > o ? 1 : -1;
2065
+ const Ve = /([0-9]+)/gm, In = (e, r, t) => at(Q(e.getValue(t)).toLowerCase(), Q(r.getValue(t)).toLowerCase()), $n = (e, r, t) => at(Q(e.getValue(t)), Q(r.getValue(t))), Nn = (e, r, t) => ze(Q(e.getValue(t)).toLowerCase(), Q(r.getValue(t)).toLowerCase()), Mn = (e, r, t) => ze(Q(e.getValue(t)), Q(r.getValue(t))), Vn = (e, r, t) => {
2066
+ const n = e.getValue(t), o = r.getValue(t);
2067
+ return n > o ? 1 : n < o ? -1 : 0;
2068
+ }, Pn = (e, r, t) => ze(e.getValue(t), r.getValue(t));
2069
+ function ze(e, r) {
2070
+ return e === r ? 0 : e > r ? 1 : -1;
2071
2071
  }
2072
- function X(e) {
2072
+ function Q(e) {
2073
2073
  return typeof e == "number" ? isNaN(e) || e === 1 / 0 || e === -1 / 0 ? "" : String(e) : typeof e == "string" ? e : "";
2074
2074
  }
2075
- function lt(e, o) {
2076
- const t = e.split(Ve).filter(Boolean), n = o.split(Ve).filter(Boolean);
2075
+ function at(e, r) {
2076
+ const t = e.split(Ve).filter(Boolean), n = r.split(Ve).filter(Boolean);
2077
2077
  for (; t.length && n.length; ) {
2078
- const r = t.shift(), l = n.shift(), i = parseInt(r, 10), s = parseInt(l, 10), u = [i, s].sort();
2078
+ const o = t.shift(), l = n.shift(), s = parseInt(o, 10), i = parseInt(l, 10), u = [s, i].sort();
2079
2079
  if (isNaN(u[0])) {
2080
- if (r > l)
2080
+ if (o > l)
2081
2081
  return 1;
2082
- if (l > r)
2082
+ if (l > o)
2083
2083
  return -1;
2084
2084
  continue;
2085
2085
  }
2086
2086
  if (isNaN(u[1]))
2087
- return isNaN(i) ? -1 : 1;
2088
- if (i > s)
2089
- return 1;
2087
+ return isNaN(s) ? -1 : 1;
2090
2088
  if (s > i)
2089
+ return 1;
2090
+ if (i > s)
2091
2091
  return -1;
2092
2092
  }
2093
2093
  return t.length - n.length;
2094
2094
  }
2095
- const ne = {
2096
- alphanumeric: xn,
2097
- alphanumericCaseSensitive: _n,
2098
- text: Fn,
2099
- textCaseSensitive: $n,
2100
- datetime: In,
2101
- basic: Mn
2102
- }, Vn = {
2095
+ const oe = {
2096
+ alphanumeric: In,
2097
+ alphanumericCaseSensitive: $n,
2098
+ text: Nn,
2099
+ textCaseSensitive: Mn,
2100
+ datetime: Vn,
2101
+ basic: Pn
2102
+ }, kn = {
2103
2103
  getInitialState: (e) => ({
2104
2104
  sorting: [],
2105
2105
  ...e
@@ -2110,43 +2110,43 @@ const ne = {
2110
2110
  }),
2111
2111
  getDefaultOptions: (e) => ({
2112
2112
  onSortingChange: L("sorting", e),
2113
- isMultiSortEvent: (o) => o.shiftKey
2113
+ isMultiSortEvent: (r) => r.shiftKey
2114
2114
  }),
2115
- createColumn: (e, o) => {
2115
+ createColumn: (e, r) => {
2116
2116
  e.getAutoSortingFn = () => {
2117
- const t = o.getFilteredRowModel().flatRows.slice(10);
2117
+ const t = r.getFilteredRowModel().flatRows.slice(10);
2118
2118
  let n = !1;
2119
- for (const r of t) {
2120
- const l = r == null ? void 0 : r.getValue(e.id);
2119
+ for (const o of t) {
2120
+ const l = o == null ? void 0 : o.getValue(e.id);
2121
2121
  if (Object.prototype.toString.call(l) === "[object Date]")
2122
- return ne.datetime;
2122
+ return oe.datetime;
2123
2123
  if (typeof l == "string" && (n = !0, l.split(Ve).length > 1))
2124
- return ne.alphanumeric;
2124
+ return oe.alphanumeric;
2125
2125
  }
2126
- return n ? ne.text : ne.basic;
2126
+ return n ? oe.text : oe.basic;
2127
2127
  }, e.getAutoSortDir = () => {
2128
- const t = o.getFilteredRowModel().flatRows[0];
2128
+ const t = r.getFilteredRowModel().flatRows[0];
2129
2129
  return typeof (t == null ? void 0 : t.getValue(e.id)) == "string" ? "asc" : "desc";
2130
2130
  }, e.getSortingFn = () => {
2131
2131
  var t, n;
2132
2132
  if (!e)
2133
2133
  throw new Error();
2134
- return ue(e.columnDef.sortingFn) ? e.columnDef.sortingFn : e.columnDef.sortingFn === "auto" ? e.getAutoSortingFn() : (t = (n = o.options.sortingFns) == null ? void 0 : n[e.columnDef.sortingFn]) != null ? t : ne[e.columnDef.sortingFn];
2134
+ return ge(e.columnDef.sortingFn) ? e.columnDef.sortingFn : e.columnDef.sortingFn === "auto" ? e.getAutoSortingFn() : (t = (n = r.options.sortingFns) == null ? void 0 : n[e.columnDef.sortingFn]) != null ? t : oe[e.columnDef.sortingFn];
2135
2135
  }, e.toggleSorting = (t, n) => {
2136
- const r = e.getNextSortingOrder(), l = typeof t < "u" && t !== null;
2137
- o.setSorting((i) => {
2138
- const s = i == null ? void 0 : i.find((a) => a.id === e.id), u = i == null ? void 0 : i.findIndex((a) => a.id === e.id);
2139
- let f = [], g, p = l ? t : r === "desc";
2140
- if (i != null && i.length && e.getCanMultiSort() && n ? s ? g = "toggle" : g = "add" : i != null && i.length && u !== i.length - 1 ? g = "replace" : s ? g = "toggle" : g = "replace", g === "toggle" && (l || r || (g = "remove")), g === "add") {
2136
+ const o = e.getNextSortingOrder(), l = typeof t < "u" && t !== null;
2137
+ r.setSorting((s) => {
2138
+ const i = s == null ? void 0 : s.find((a) => a.id === e.id), u = s == null ? void 0 : s.findIndex((a) => a.id === e.id);
2139
+ let f = [], g, p = l ? t : o === "desc";
2140
+ if (s != null && s.length && e.getCanMultiSort() && n ? i ? g = "toggle" : g = "add" : s != null && s.length && u !== s.length - 1 ? g = "replace" : i ? g = "toggle" : g = "replace", g === "toggle" && (l || o || (g = "remove")), g === "add") {
2141
2141
  var d;
2142
- f = [...i, {
2142
+ f = [...s, {
2143
2143
  id: e.id,
2144
2144
  desc: p
2145
- }], f.splice(0, f.length - ((d = o.options.maxMultiSortColCount) != null ? d : Number.MAX_SAFE_INTEGER));
2146
- } else g === "toggle" ? f = i.map((a) => a.id === e.id ? {
2145
+ }], f.splice(0, f.length - ((d = r.options.maxMultiSortColCount) != null ? d : Number.MAX_SAFE_INTEGER));
2146
+ } else g === "toggle" ? f = s.map((a) => a.id === e.id ? {
2147
2147
  ...a,
2148
2148
  desc: p
2149
- } : a) : g === "remove" ? f = i.filter((a) => a.id !== e.id) : f = [{
2149
+ } : a) : g === "remove" ? f = s.filter((a) => a.id !== e.id) : f = [{
2150
2150
  id: e.id,
2151
2151
  desc: p
2152
2152
  }];
@@ -2154,68 +2154,68 @@ const ne = {
2154
2154
  });
2155
2155
  }, e.getFirstSortDir = () => {
2156
2156
  var t, n;
2157
- return ((t = (n = e.columnDef.sortDescFirst) != null ? n : o.options.sortDescFirst) != null ? t : e.getAutoSortDir() === "desc") ? "desc" : "asc";
2157
+ return ((t = (n = e.columnDef.sortDescFirst) != null ? n : r.options.sortDescFirst) != null ? t : e.getAutoSortDir() === "desc") ? "desc" : "asc";
2158
2158
  }, e.getNextSortingOrder = (t) => {
2159
- var n, r;
2160
- const l = e.getFirstSortDir(), i = e.getIsSorted();
2161
- return i ? i !== l && ((n = o.options.enableSortingRemoval) == null || n) && // If enableSortRemove, enable in general
2162
- (!(t && (r = o.options.enableMultiRemove) != null) || r) ? !1 : i === "desc" ? "asc" : "desc" : l;
2159
+ var n, o;
2160
+ const l = e.getFirstSortDir(), s = e.getIsSorted();
2161
+ return s ? s !== l && ((n = r.options.enableSortingRemoval) == null || n) && // If enableSortRemove, enable in general
2162
+ (!(t && (o = r.options.enableMultiRemove) != null) || o) ? !1 : s === "desc" ? "asc" : "desc" : l;
2163
2163
  }, e.getCanSort = () => {
2164
2164
  var t, n;
2165
- return ((t = e.columnDef.enableSorting) != null ? t : !0) && ((n = o.options.enableSorting) != null ? n : !0) && !!e.accessorFn;
2165
+ return ((t = e.columnDef.enableSorting) != null ? t : !0) && ((n = r.options.enableSorting) != null ? n : !0) && !!e.accessorFn;
2166
2166
  }, e.getCanMultiSort = () => {
2167
2167
  var t, n;
2168
- return (t = (n = e.columnDef.enableMultiSort) != null ? n : o.options.enableMultiSort) != null ? t : !!e.accessorFn;
2168
+ return (t = (n = e.columnDef.enableMultiSort) != null ? n : r.options.enableMultiSort) != null ? t : !!e.accessorFn;
2169
2169
  }, e.getIsSorted = () => {
2170
2170
  var t;
2171
- const n = (t = o.getState().sorting) == null ? void 0 : t.find((r) => r.id === e.id);
2171
+ const n = (t = r.getState().sorting) == null ? void 0 : t.find((o) => o.id === e.id);
2172
2172
  return n ? n.desc ? "desc" : "asc" : !1;
2173
2173
  }, e.getSortIndex = () => {
2174
2174
  var t, n;
2175
- return (t = (n = o.getState().sorting) == null ? void 0 : n.findIndex((r) => r.id === e.id)) != null ? t : -1;
2175
+ return (t = (n = r.getState().sorting) == null ? void 0 : n.findIndex((o) => o.id === e.id)) != null ? t : -1;
2176
2176
  }, e.clearSorting = () => {
2177
- o.setSorting((t) => t != null && t.length ? t.filter((n) => n.id !== e.id) : []);
2177
+ r.setSorting((t) => t != null && t.length ? t.filter((n) => n.id !== e.id) : []);
2178
2178
  }, e.getToggleSortingHandler = () => {
2179
2179
  const t = e.getCanSort();
2180
2180
  return (n) => {
2181
- t && (n.persist == null || n.persist(), e.toggleSorting == null || e.toggleSorting(void 0, e.getCanMultiSort() ? o.options.isMultiSortEvent == null ? void 0 : o.options.isMultiSortEvent(n) : !1));
2181
+ t && (n.persist == null || n.persist(), e.toggleSorting == null || e.toggleSorting(void 0, e.getCanMultiSort() ? r.options.isMultiSortEvent == null ? void 0 : r.options.isMultiSortEvent(n) : !1));
2182
2182
  };
2183
2183
  };
2184
2184
  },
2185
2185
  createTable: (e) => {
2186
- e.setSorting = (o) => e.options.onSortingChange == null ? void 0 : e.options.onSortingChange(o), e.resetSorting = (o) => {
2186
+ e.setSorting = (r) => e.options.onSortingChange == null ? void 0 : e.options.onSortingChange(r), e.resetSorting = (r) => {
2187
2187
  var t, n;
2188
- e.setSorting(o ? [] : (t = (n = e.initialState) == null ? void 0 : n.sorting) != null ? t : []);
2188
+ e.setSorting(r ? [] : (t = (n = e.initialState) == null ? void 0 : n.sorting) != null ? t : []);
2189
2189
  }, e.getPreSortedRowModel = () => e.getGroupedRowModel(), e.getSortedRowModel = () => (!e._getSortedRowModel && e.options.getSortedRowModel && (e._getSortedRowModel = e.options.getSortedRowModel(e)), e.options.manualSorting || !e._getSortedRowModel ? e.getPreSortedRowModel() : e._getSortedRowModel());
2190
2190
  }
2191
- }, Nn = [
2192
- Qt,
2193
- hn,
2194
- dn,
2195
- cn,
2196
- Yt,
2197
- Jt,
2198
- vn,
2191
+ }, En = [
2192
+ Zt,
2193
+ Cn,
2194
+ pn,
2195
+ mn,
2196
+ en,
2197
+ tn,
2198
+ yn,
2199
2199
  //depends on ColumnFaceting
2200
- wn,
2200
+ Sn,
2201
2201
  //depends on ColumnFiltering
2202
- Vn,
2203
- un,
2202
+ kn,
2203
+ cn,
2204
2204
  //depends on RowSorting
2205
- Cn,
2206
- Sn,
2207
- yn,
2208
2205
  Rn,
2209
- pn
2206
+ xn,
2207
+ _n,
2208
+ Fn,
2209
+ vn
2210
2210
  ];
2211
- function Pn(e) {
2212
- var o, t;
2211
+ function bn(e) {
2212
+ var r, t;
2213
2213
  process.env.NODE_ENV !== "production" && (e.debugAll || e.debugTable) && console.info("Creating Table Instance...");
2214
- const n = [...Nn, ...(o = e._features) != null ? o : []];
2215
- let r = {
2214
+ const n = [...En, ...(r = e._features) != null ? r : []];
2215
+ let o = {
2216
2216
  _features: n
2217
2217
  };
2218
- const l = r._features.reduce((d, a) => Object.assign(d, a.getDefaultOptions == null ? void 0 : a.getDefaultOptions(r)), {}), i = (d) => r.options.mergeOptions ? r.options.mergeOptions(l, d) : {
2218
+ const l = o._features.reduce((d, a) => Object.assign(d, a.getDefaultOptions == null ? void 0 : a.getDefaultOptions(o)), {}), s = (d) => o.options.mergeOptions ? o.options.mergeOptions(l, d) : {
2219
2219
  ...l,
2220
2220
  ...d
2221
2221
  };
@@ -2223,7 +2223,7 @@ function Pn(e) {
2223
2223
  ...{},
2224
2224
  ...(t = e.initialState) != null ? t : {}
2225
2225
  };
2226
- r._features.forEach((d) => {
2226
+ o._features.forEach((d) => {
2227
2227
  var a;
2228
2228
  u = (a = d.getInitialState == null ? void 0 : d.getInitialState(u)) != null ? a : u;
2229
2229
  });
@@ -2246,213 +2246,213 @@ function Pn(e) {
2246
2246
  })));
2247
2247
  },
2248
2248
  reset: () => {
2249
- r.setState(r.initialState);
2249
+ o.setState(o.initialState);
2250
2250
  },
2251
2251
  setOptions: (d) => {
2252
- const a = j(d, r.options);
2253
- r.options = i(a);
2252
+ const a = X(d, o.options);
2253
+ o.options = s(a);
2254
2254
  },
2255
- getState: () => r.options.state,
2255
+ getState: () => o.options.state,
2256
2256
  setState: (d) => {
2257
- r.options.onStateChange == null || r.options.onStateChange(d);
2257
+ o.options.onStateChange == null || o.options.onStateChange(d);
2258
2258
  },
2259
2259
  _getRowId: (d, a, m) => {
2260
- var v;
2261
- return (v = r.options.getRowId == null ? void 0 : r.options.getRowId(d, a, m)) != null ? v : `${m ? [m.id, a].join(".") : a}`;
2260
+ var h;
2261
+ return (h = o.options.getRowId == null ? void 0 : o.options.getRowId(d, a, m)) != null ? h : `${m ? [m.id, a].join(".") : a}`;
2262
2262
  },
2263
- getCoreRowModel: () => (r._getCoreRowModel || (r._getCoreRowModel = r.options.getCoreRowModel(r)), r._getCoreRowModel()),
2263
+ getCoreRowModel: () => (o._getCoreRowModel || (o._getCoreRowModel = o.options.getCoreRowModel(o)), o._getCoreRowModel()),
2264
2264
  // The final calls start at the bottom of the model,
2265
2265
  // expanded rows, which then work their way up
2266
- getRowModel: () => r.getPaginationRowModel(),
2266
+ getRowModel: () => o.getPaginationRowModel(),
2267
2267
  //in next version, we should just pass in the row model as the optional 2nd arg
2268
2268
  getRow: (d, a) => {
2269
- let m = (a ? r.getPrePaginationRowModel() : r.getRowModel()).rowsById[d];
2270
- if (!m && (m = r.getCoreRowModel().rowsById[d], !m))
2269
+ let m = (a ? o.getPrePaginationRowModel() : o.getRowModel()).rowsById[d];
2270
+ if (!m && (m = o.getCoreRowModel().rowsById[d], !m))
2271
2271
  throw process.env.NODE_ENV !== "production" ? new Error(`getRow could not find row with ID: ${d}`) : new Error();
2272
2272
  return m;
2273
2273
  },
2274
- _getDefaultColumnDef: y(() => [r.options.defaultColumn], (d) => {
2274
+ _getDefaultColumnDef: S(() => [o.options.defaultColumn], (d) => {
2275
2275
  var a;
2276
2276
  return d = (a = d) != null ? a : {}, {
2277
2277
  header: (m) => {
2278
- const v = m.header.column.columnDef;
2279
- return v.accessorKey ? v.accessorKey : v.accessorFn ? v.id : null;
2278
+ const h = m.header.column.columnDef;
2279
+ return h.accessorKey ? h.accessorKey : h.accessorFn ? h.id : null;
2280
2280
  },
2281
2281
  // footer: props => props.header.column.id,
2282
2282
  cell: (m) => {
2283
- var v, C;
2284
- return (v = (C = m.renderValue()) == null || C.toString == null ? void 0 : C.toString()) != null ? v : null;
2283
+ var h, C;
2284
+ return (h = (C = m.renderValue()) == null || C.toString == null ? void 0 : C.toString()) != null ? h : null;
2285
2285
  },
2286
- ...r._features.reduce((m, v) => Object.assign(m, v.getDefaultColumnDef == null ? void 0 : v.getDefaultColumnDef()), {}),
2286
+ ...o._features.reduce((m, h) => Object.assign(m, h.getDefaultColumnDef == null ? void 0 : h.getDefaultColumnDef()), {}),
2287
2287
  ...d
2288
2288
  };
2289
2289
  }, R(e, "debugColumns", "_getDefaultColumnDef")),
2290
- _getColumnDefs: () => r.options.columns,
2291
- getAllColumns: y(() => [r._getColumnDefs()], (d) => {
2292
- const a = function(m, v, C) {
2293
- return C === void 0 && (C = 0), m.map((h) => {
2294
- const S = Wt(r, h, C, v), x = h;
2295
- return S.columns = x.columns ? a(x.columns, S, C + 1) : [], S;
2290
+ _getColumnDefs: () => o.options.columns,
2291
+ getAllColumns: S(() => [o._getColumnDefs()], (d) => {
2292
+ const a = function(m, h, C) {
2293
+ return C === void 0 && (C = 0), m.map((v) => {
2294
+ const y = Jt(o, v, C, h), x = v;
2295
+ return y.columns = x.columns ? a(x.columns, y, C + 1) : [], y;
2296
2296
  });
2297
2297
  };
2298
2298
  return a(d);
2299
2299
  }, R(e, "debugColumns", "getAllColumns")),
2300
- getAllFlatColumns: y(() => [r.getAllColumns()], (d) => d.flatMap((a) => a.getFlatColumns()), R(e, "debugColumns", "getAllFlatColumns")),
2301
- _getAllFlatColumnsById: y(() => [r.getAllFlatColumns()], (d) => d.reduce((a, m) => (a[m.id] = m, a), {}), R(e, "debugColumns", "getAllFlatColumnsById")),
2302
- getAllLeafColumns: y(() => [r.getAllColumns(), r._getOrderColumnsFn()], (d, a) => {
2303
- let m = d.flatMap((v) => v.getLeafColumns());
2300
+ getAllFlatColumns: S(() => [o.getAllColumns()], (d) => d.flatMap((a) => a.getFlatColumns()), R(e, "debugColumns", "getAllFlatColumns")),
2301
+ _getAllFlatColumnsById: S(() => [o.getAllFlatColumns()], (d) => d.reduce((a, m) => (a[m.id] = m, a), {}), R(e, "debugColumns", "getAllFlatColumnsById")),
2302
+ getAllLeafColumns: S(() => [o.getAllColumns(), o._getOrderColumnsFn()], (d, a) => {
2303
+ let m = d.flatMap((h) => h.getLeafColumns());
2304
2304
  return a(m);
2305
2305
  }, R(e, "debugColumns", "getAllLeafColumns")),
2306
2306
  getColumn: (d) => {
2307
- const a = r._getAllFlatColumnsById()[d];
2307
+ const a = o._getAllFlatColumnsById()[d];
2308
2308
  return process.env.NODE_ENV !== "production" && !a && console.error(`[Table] Column with id '${d}' does not exist.`), a;
2309
2309
  }
2310
2310
  };
2311
- Object.assign(r, p);
2312
- for (let d = 0; d < r._features.length; d++) {
2313
- const a = r._features[d];
2314
- a == null || a.createTable == null || a.createTable(r);
2311
+ Object.assign(o, p);
2312
+ for (let d = 0; d < o._features.length; d++) {
2313
+ const a = o._features[d];
2314
+ a == null || a.createTable == null || a.createTable(o);
2315
2315
  }
2316
- return r;
2316
+ return o;
2317
2317
  }
2318
- function kn() {
2319
- return (e) => y(() => [e.options.data], (o) => {
2318
+ function Dn() {
2319
+ return (e) => S(() => [e.options.data], (r) => {
2320
2320
  const t = {
2321
2321
  rows: [],
2322
2322
  flatRows: [],
2323
2323
  rowsById: {}
2324
- }, n = function(r, l, i) {
2324
+ }, n = function(o, l, s) {
2325
2325
  l === void 0 && (l = 0);
2326
- const s = [];
2327
- for (let f = 0; f < r.length; f++) {
2328
- const g = Ee(e, e._getRowId(r[f], f, i), r[f], f, l, void 0, i == null ? void 0 : i.id);
2329
- if (t.flatRows.push(g), t.rowsById[g.id] = g, s.push(g), e.options.getSubRows) {
2326
+ const i = [];
2327
+ for (let f = 0; f < o.length; f++) {
2328
+ const g = be(e, e._getRowId(o[f], f, s), o[f], f, l, void 0, s == null ? void 0 : s.id);
2329
+ if (t.flatRows.push(g), t.rowsById[g.id] = g, i.push(g), e.options.getSubRows) {
2330
2330
  var u;
2331
- g.originalSubRows = e.options.getSubRows(r[f], f), (u = g.originalSubRows) != null && u.length && (g.subRows = n(g.originalSubRows, l + 1, g));
2331
+ g.originalSubRows = e.options.getSubRows(o[f], f), (u = g.originalSubRows) != null && u.length && (g.subRows = n(g.originalSubRows, l + 1, g));
2332
2332
  }
2333
2333
  }
2334
- return s;
2334
+ return i;
2335
2335
  };
2336
- return t.rows = n(o), t;
2336
+ return t.rows = n(r), t;
2337
2337
  }, R(e.options, "debugTable", "getRowModel", () => e._autoResetPageIndex()));
2338
2338
  }
2339
- function En(e) {
2340
- const o = [], t = (n) => {
2341
- var r;
2342
- o.push(n), (r = n.subRows) != null && r.length && n.getIsExpanded() && n.subRows.forEach(t);
2339
+ function Ln(e) {
2340
+ const r = [], t = (n) => {
2341
+ var o;
2342
+ r.push(n), (o = n.subRows) != null && o.length && n.getIsExpanded() && n.subRows.forEach(t);
2343
2343
  };
2344
2344
  return e.rows.forEach(t), {
2345
- rows: o,
2345
+ rows: r,
2346
2346
  flatRows: e.flatRows,
2347
2347
  rowsById: e.rowsById
2348
2348
  };
2349
2349
  }
2350
- function Dn(e, o, t) {
2351
- return t.options.filterFromLeafRows ? Ln(e, o, t) : zn(e, o, t);
2350
+ function zn(e, r, t) {
2351
+ return t.options.filterFromLeafRows ? Hn(e, r, t) : An(e, r, t);
2352
2352
  }
2353
- function Ln(e, o, t) {
2353
+ function Hn(e, r, t) {
2354
2354
  var n;
2355
- const r = [], l = {}, i = (n = t.options.maxLeafRowFilterDepth) != null ? n : 100, s = function(u, f) {
2355
+ const o = [], l = {}, s = (n = t.options.maxLeafRowFilterDepth) != null ? n : 100, i = function(u, f) {
2356
2356
  f === void 0 && (f = 0);
2357
2357
  const g = [];
2358
2358
  for (let d = 0; d < u.length; d++) {
2359
2359
  var p;
2360
2360
  let a = u[d];
2361
- const m = Ee(t, a.id, a.original, a.index, a.depth, void 0, a.parentId);
2362
- if (m.columnFilters = a.columnFilters, (p = a.subRows) != null && p.length && f < i) {
2363
- if (m.subRows = s(a.subRows, f + 1), a = m, o(a) && !m.subRows.length) {
2364
- g.push(a), l[a.id] = a, r.push(a);
2361
+ const m = be(t, a.id, a.original, a.index, a.depth, void 0, a.parentId);
2362
+ if (m.columnFilters = a.columnFilters, (p = a.subRows) != null && p.length && f < s) {
2363
+ if (m.subRows = i(a.subRows, f + 1), a = m, r(a) && !m.subRows.length) {
2364
+ g.push(a), l[a.id] = a, o.push(a);
2365
2365
  continue;
2366
2366
  }
2367
- if (o(a) || m.subRows.length) {
2368
- g.push(a), l[a.id] = a, r.push(a);
2367
+ if (r(a) || m.subRows.length) {
2368
+ g.push(a), l[a.id] = a, o.push(a);
2369
2369
  continue;
2370
2370
  }
2371
2371
  } else
2372
- a = m, o(a) && (g.push(a), l[a.id] = a, r.push(a));
2372
+ a = m, r(a) && (g.push(a), l[a.id] = a, o.push(a));
2373
2373
  }
2374
2374
  return g;
2375
2375
  };
2376
2376
  return {
2377
- rows: s(e),
2378
- flatRows: r,
2377
+ rows: i(e),
2378
+ flatRows: o,
2379
2379
  rowsById: l
2380
2380
  };
2381
2381
  }
2382
- function zn(e, o, t) {
2382
+ function An(e, r, t) {
2383
2383
  var n;
2384
- const r = [], l = {}, i = (n = t.options.maxLeafRowFilterDepth) != null ? n : 100, s = function(u, f) {
2384
+ const o = [], l = {}, s = (n = t.options.maxLeafRowFilterDepth) != null ? n : 100, i = function(u, f) {
2385
2385
  f === void 0 && (f = 0);
2386
2386
  const g = [];
2387
2387
  for (let d = 0; d < u.length; d++) {
2388
2388
  let a = u[d];
2389
- if (o(a)) {
2389
+ if (r(a)) {
2390
2390
  var p;
2391
- if ((p = a.subRows) != null && p.length && f < i) {
2392
- const v = Ee(t, a.id, a.original, a.index, a.depth, void 0, a.parentId);
2393
- v.subRows = s(a.subRows, f + 1), a = v;
2391
+ if ((p = a.subRows) != null && p.length && f < s) {
2392
+ const h = be(t, a.id, a.original, a.index, a.depth, void 0, a.parentId);
2393
+ h.subRows = i(a.subRows, f + 1), a = h;
2394
2394
  }
2395
- g.push(a), r.push(a), l[a.id] = a;
2395
+ g.push(a), o.push(a), l[a.id] = a;
2396
2396
  }
2397
2397
  }
2398
2398
  return g;
2399
2399
  };
2400
2400
  return {
2401
- rows: s(e),
2402
- flatRows: r,
2401
+ rows: i(e),
2402
+ flatRows: o,
2403
2403
  rowsById: l
2404
2404
  };
2405
2405
  }
2406
- function Hn() {
2407
- return (e) => y(() => [e.getPreFilteredRowModel(), e.getState().columnFilters, e.getState().globalFilter], (o, t, n) => {
2408
- if (!o.rows.length || !(t != null && t.length) && !n) {
2409
- for (let d = 0; d < o.flatRows.length; d++)
2410
- o.flatRows[d].columnFilters = {}, o.flatRows[d].columnFiltersMeta = {};
2411
- return o;
2406
+ function Gn() {
2407
+ return (e) => S(() => [e.getPreFilteredRowModel(), e.getState().columnFilters, e.getState().globalFilter], (r, t, n) => {
2408
+ if (!r.rows.length || !(t != null && t.length) && !n) {
2409
+ for (let d = 0; d < r.flatRows.length; d++)
2410
+ r.flatRows[d].columnFilters = {}, r.flatRows[d].columnFiltersMeta = {};
2411
+ return r;
2412
2412
  }
2413
- const r = [], l = [];
2413
+ const o = [], l = [];
2414
2414
  (t ?? []).forEach((d) => {
2415
2415
  var a;
2416
2416
  const m = e.getColumn(d.id);
2417
2417
  if (!m)
2418
2418
  return;
2419
- const v = m.getFilterFn();
2420
- if (!v) {
2419
+ const h = m.getFilterFn();
2420
+ if (!h) {
2421
2421
  process.env.NODE_ENV !== "production" && console.warn(`Could not find a valid 'column.filterFn' for column with the ID: ${m.id}.`);
2422
2422
  return;
2423
2423
  }
2424
- r.push({
2424
+ o.push({
2425
2425
  id: d.id,
2426
- filterFn: v,
2427
- resolvedValue: (a = v.resolveFilterValue == null ? void 0 : v.resolveFilterValue(d.value)) != null ? a : d.value
2426
+ filterFn: h,
2427
+ resolvedValue: (a = h.resolveFilterValue == null ? void 0 : h.resolveFilterValue(d.value)) != null ? a : d.value
2428
2428
  });
2429
2429
  });
2430
- const i = (t ?? []).map((d) => d.id), s = e.getGlobalFilterFn(), u = e.getAllLeafColumns().filter((d) => d.getCanGlobalFilter());
2431
- n && s && u.length && (i.push("__global__"), u.forEach((d) => {
2430
+ const s = (t ?? []).map((d) => d.id), i = e.getGlobalFilterFn(), u = e.getAllLeafColumns().filter((d) => d.getCanGlobalFilter());
2431
+ n && i && u.length && (s.push("__global__"), u.forEach((d) => {
2432
2432
  var a;
2433
2433
  l.push({
2434
2434
  id: d.id,
2435
- filterFn: s,
2436
- resolvedValue: (a = s.resolveFilterValue == null ? void 0 : s.resolveFilterValue(n)) != null ? a : n
2435
+ filterFn: i,
2436
+ resolvedValue: (a = i.resolveFilterValue == null ? void 0 : i.resolveFilterValue(n)) != null ? a : n
2437
2437
  });
2438
2438
  }));
2439
2439
  let f, g;
2440
- for (let d = 0; d < o.flatRows.length; d++) {
2441
- const a = o.flatRows[d];
2442
- if (a.columnFilters = {}, r.length)
2443
- for (let m = 0; m < r.length; m++) {
2444
- f = r[m];
2445
- const v = f.id;
2446
- a.columnFilters[v] = f.filterFn(a, v, f.resolvedValue, (C) => {
2447
- a.columnFiltersMeta[v] = C;
2440
+ for (let d = 0; d < r.flatRows.length; d++) {
2441
+ const a = r.flatRows[d];
2442
+ if (a.columnFilters = {}, o.length)
2443
+ for (let m = 0; m < o.length; m++) {
2444
+ f = o[m];
2445
+ const h = f.id;
2446
+ a.columnFilters[h] = f.filterFn(a, h, f.resolvedValue, (C) => {
2447
+ a.columnFiltersMeta[h] = C;
2448
2448
  });
2449
2449
  }
2450
2450
  if (l.length) {
2451
2451
  for (let m = 0; m < l.length; m++) {
2452
2452
  g = l[m];
2453
- const v = g.id;
2454
- if (g.filterFn(a, v, g.resolvedValue, (C) => {
2455
- a.columnFiltersMeta[v] = C;
2453
+ const h = g.id;
2454
+ if (g.filterFn(a, h, g.resolvedValue, (C) => {
2455
+ a.columnFiltersMeta[h] = C;
2456
2456
  })) {
2457
2457
  a.columnFilters.__global__ = !0;
2458
2458
  break;
@@ -2462,90 +2462,90 @@ function Hn() {
2462
2462
  }
2463
2463
  }
2464
2464
  const p = (d) => {
2465
- for (let a = 0; a < i.length; a++)
2466
- if (d.columnFilters[i[a]] === !1)
2465
+ for (let a = 0; a < s.length; a++)
2466
+ if (d.columnFilters[s[a]] === !1)
2467
2467
  return !1;
2468
2468
  return !0;
2469
2469
  };
2470
- return Dn(o.rows, p, e);
2470
+ return zn(r.rows, p, e);
2471
2471
  }, R(e.options, "debugTable", "getFilteredRowModel", () => e._autoResetPageIndex()));
2472
2472
  }
2473
- function An(e) {
2474
- return (o) => y(() => [o.getState().pagination, o.getPrePaginationRowModel(), o.options.paginateExpandedRows ? void 0 : o.getState().expanded], (t, n) => {
2473
+ function On(e) {
2474
+ return (r) => S(() => [r.getState().pagination, r.getPrePaginationRowModel(), r.options.paginateExpandedRows ? void 0 : r.getState().expanded], (t, n) => {
2475
2475
  if (!n.rows.length)
2476
2476
  return n;
2477
2477
  const {
2478
- pageSize: r,
2478
+ pageSize: o,
2479
2479
  pageIndex: l
2480
2480
  } = t;
2481
2481
  let {
2482
- rows: i,
2483
- flatRows: s,
2482
+ rows: s,
2483
+ flatRows: i,
2484
2484
  rowsById: u
2485
2485
  } = n;
2486
- const f = r * l, g = f + r;
2487
- i = i.slice(f, g);
2486
+ const f = o * l, g = f + o;
2487
+ s = s.slice(f, g);
2488
2488
  let p;
2489
- o.options.paginateExpandedRows ? p = {
2490
- rows: i,
2491
- flatRows: s,
2489
+ r.options.paginateExpandedRows ? p = {
2490
+ rows: s,
2491
+ flatRows: i,
2492
2492
  rowsById: u
2493
- } : p = En({
2494
- rows: i,
2495
- flatRows: s,
2493
+ } : p = Ln({
2494
+ rows: s,
2495
+ flatRows: i,
2496
2496
  rowsById: u
2497
2497
  }), p.flatRows = [];
2498
2498
  const d = (a) => {
2499
2499
  p.flatRows.push(a), a.subRows.length && a.subRows.forEach(d);
2500
2500
  };
2501
2501
  return p.rows.forEach(d), p;
2502
- }, R(o.options, "debugTable", "getPaginationRowModel"));
2502
+ }, R(r.options, "debugTable", "getPaginationRowModel"));
2503
2503
  }
2504
- function Gn() {
2505
- return (e) => y(() => [e.getState().sorting, e.getPreSortedRowModel()], (o, t) => {
2506
- if (!t.rows.length || !(o != null && o.length))
2504
+ function Tn() {
2505
+ return (e) => S(() => [e.getState().sorting, e.getPreSortedRowModel()], (r, t) => {
2506
+ if (!t.rows.length || !(r != null && r.length))
2507
2507
  return t;
2508
- const n = e.getState().sorting, r = [], l = n.filter((u) => {
2508
+ const n = e.getState().sorting, o = [], l = n.filter((u) => {
2509
2509
  var f;
2510
2510
  return (f = e.getColumn(u.id)) == null ? void 0 : f.getCanSort();
2511
- }), i = {};
2511
+ }), s = {};
2512
2512
  l.forEach((u) => {
2513
2513
  const f = e.getColumn(u.id);
2514
- f && (i[u.id] = {
2514
+ f && (s[u.id] = {
2515
2515
  sortUndefined: f.columnDef.sortUndefined,
2516
2516
  invertSorting: f.columnDef.invertSorting,
2517
2517
  sortingFn: f.getSortingFn()
2518
2518
  });
2519
2519
  });
2520
- const s = (u) => {
2520
+ const i = (u) => {
2521
2521
  const f = u.map((g) => ({
2522
2522
  ...g
2523
2523
  }));
2524
2524
  return f.sort((g, p) => {
2525
2525
  for (let a = 0; a < l.length; a += 1) {
2526
2526
  var d;
2527
- const m = l[a], v = i[m.id], C = v.sortUndefined, h = (d = m == null ? void 0 : m.desc) != null ? d : !1;
2528
- let S = 0;
2527
+ const m = l[a], h = s[m.id], C = h.sortUndefined, v = (d = m == null ? void 0 : m.desc) != null ? d : !1;
2528
+ let y = 0;
2529
2529
  if (C) {
2530
- const x = g.getValue(m.id), I = p.getValue(m.id), F = x === void 0, V = I === void 0;
2531
- if (F || V) {
2530
+ const x = g.getValue(m.id), $ = p.getValue(m.id), F = x === void 0, P = $ === void 0;
2531
+ if (F || P) {
2532
2532
  if (C === "first") return F ? -1 : 1;
2533
2533
  if (C === "last") return F ? 1 : -1;
2534
- S = F && V ? 0 : F ? C : -C;
2534
+ y = F && P ? 0 : F ? C : -C;
2535
2535
  }
2536
2536
  }
2537
- if (S === 0 && (S = v.sortingFn(g, p, m.id)), S !== 0)
2538
- return h && (S *= -1), v.invertSorting && (S *= -1), S;
2537
+ if (y === 0 && (y = h.sortingFn(g, p, m.id)), y !== 0)
2538
+ return v && (y *= -1), h.invertSorting && (y *= -1), y;
2539
2539
  }
2540
2540
  return g.index - p.index;
2541
2541
  }), f.forEach((g) => {
2542
2542
  var p;
2543
- r.push(g), (p = g.subRows) != null && p.length && (g.subRows = s(g.subRows));
2543
+ o.push(g), (p = g.subRows) != null && p.length && (g.subRows = i(g.subRows));
2544
2544
  }), f;
2545
2545
  };
2546
2546
  return {
2547
- rows: s(t.rows),
2548
- flatRows: r,
2547
+ rows: i(t.rows),
2548
+ flatRows: o,
2549
2549
  rowsById: t.rowsById
2550
2550
  };
2551
2551
  }, R(e.options, "debugTable", "getSortedRowModel", () => e._autoResetPageIndex()));
@@ -2560,23 +2560,23 @@ function Gn() {
2560
2560
  *
2561
2561
  * @license MIT
2562
2562
  */
2563
- function Ue(e, o) {
2564
- return e ? bn(e) ? /* @__PURE__ */ xe.createElement(e, o) : e : null;
2563
+ function Qe(e, r) {
2564
+ return e ? Bn(e) ? /* @__PURE__ */ _e.createElement(e, r) : e : null;
2565
2565
  }
2566
- function bn(e) {
2567
- return On(e) || typeof e == "function" || Tn(e);
2566
+ function Bn(e) {
2567
+ return Kn(e) || typeof e == "function" || qn(e);
2568
2568
  }
2569
- function On(e) {
2569
+ function Kn(e) {
2570
2570
  return typeof e == "function" && (() => {
2571
- const o = Object.getPrototypeOf(e);
2572
- return o.prototype && o.prototype.isReactComponent;
2571
+ const r = Object.getPrototypeOf(e);
2572
+ return r.prototype && r.prototype.isReactComponent;
2573
2573
  })();
2574
2574
  }
2575
- function Tn(e) {
2575
+ function qn(e) {
2576
2576
  return typeof e == "object" && typeof e.$$typeof == "symbol" && ["react.memo", "react.forward_ref"].includes(e.$$typeof.description);
2577
2577
  }
2578
- function Bn(e) {
2579
- const o = {
2578
+ function jn(e) {
2579
+ const r = {
2580
2580
  state: {},
2581
2581
  // Dummy state
2582
2582
  onStateChange: () => {
@@ -2584,9 +2584,9 @@ function Bn(e) {
2584
2584
  // noop
2585
2585
  renderFallbackValue: null,
2586
2586
  ...e
2587
- }, [t] = xe.useState(() => ({
2588
- current: Pn(o)
2589
- })), [n, r] = xe.useState(() => t.current.initialState);
2587
+ }, [t] = _e.useState(() => ({
2588
+ current: bn(r)
2589
+ })), [n, o] = _e.useState(() => t.current.initialState);
2590
2590
  return t.current.setOptions((l) => ({
2591
2591
  ...l,
2592
2592
  ...e,
@@ -2596,72 +2596,72 @@ function Bn(e) {
2596
2596
  },
2597
2597
  // Similarly, we'll maintain both our internal state and any user-provided
2598
2598
  // state.
2599
- onStateChange: (i) => {
2600
- r(i), e.onStateChange == null || e.onStateChange(i);
2599
+ onStateChange: (s) => {
2600
+ o(s), e.onStateChange == null || e.onStateChange(s);
2601
2601
  }
2602
2602
  })), t.current;
2603
2603
  }
2604
- const Xe = ({
2604
+ const Ye = ({
2605
2605
  editable: e = !0,
2606
- deletable: o = !0,
2606
+ deletable: r = !0,
2607
2607
  pageSize: t = 25,
2608
2608
  onCellEdit: n,
2609
- onRowDelete: r
2609
+ onRowDelete: o
2610
2610
  }) => {
2611
2611
  const {
2612
2612
  rows: l,
2613
- schema: i,
2614
- mappings: s,
2613
+ schema: s,
2614
+ mappings: i,
2615
2615
  errorsByRow: u,
2616
2616
  editingCell: f,
2617
2617
  startEditing: g,
2618
2618
  stopEditing: p,
2619
2619
  updateCell: d,
2620
2620
  deleteRow: a
2621
- } = Z(), [m, v] = q([]), [C, h] = q(""), [S, x] = q(""), I = be(() => s.filter((_) => _.targetKey !== null).map((_) => {
2622
- const $ = i == null ? void 0 : i.columns.find((P) => P.key === _.targetKey);
2621
+ } = te(), [m, h] = j([]), [C, v] = j(""), [y, x] = j(""), $ = Be(() => i.filter((_) => _.targetKey !== null).map((_) => {
2622
+ const I = s == null ? void 0 : s.columns.find((M) => M.key === _.targetKey);
2623
2623
  return {
2624
2624
  sourceColumn: _.sourceColumn,
2625
2625
  targetKey: _.targetKey,
2626
- label: ($ == null ? void 0 : $.label) || _.targetKey,
2627
- type: ($ == null ? void 0 : $.type) || "string"
2626
+ label: (I == null ? void 0 : I.label) || _.targetKey,
2627
+ type: (I == null ? void 0 : I.type) || "string"
2628
2628
  };
2629
- }), [s, i]), F = Ne(
2630
- (_, $) => {
2631
- const P = u.get(_);
2632
- return P == null ? void 0 : P.find((A) => A.columnKey === $);
2629
+ }), [i, s]), F = Pe(
2630
+ (_, I) => {
2631
+ const M = u.get(_);
2632
+ return M == null ? void 0 : M.find((H) => H.columnKey === I);
2633
2633
  },
2634
2634
  [u]
2635
- ), V = (_, $, P) => {
2636
- x(P), g(_, $);
2637
- }, W = () => {
2638
- f && (d(f.rowIndex, f.columnKey, S), n == null || n(f.rowIndex, f.columnKey, S)), p();
2635
+ ), P = (_, I, M) => {
2636
+ x(M), g(_, I);
2637
+ }, Y = () => {
2638
+ f && (d(f.rowIndex, f.columnKey, y), n == null || n(f.rowIndex, f.columnKey, y)), p();
2639
2639
  }, k = () => {
2640
2640
  x(""), p();
2641
- }, H = (_) => {
2642
- a(_), r == null || r(_);
2643
- }, K = qt(), O = be(
2641
+ }, G = (_) => {
2642
+ a(_), o == null || o(_);
2643
+ }, K = Xt(), D = Be(
2644
2644
  () => [
2645
2645
  K.accessor("rowIndex", {
2646
2646
  header: "#",
2647
2647
  size: 60,
2648
2648
  cell: (_) => /* @__PURE__ */ c("span", { className: "ff-font-mono ff-text-xs", style: { color: "var(--ff-text-muted)" }, children: _.getValue() + 1 })
2649
2649
  }),
2650
- ...I.map(
2651
- (_) => K.accessor(($) => $.data[_.targetKey] || $.data[_.sourceColumn], {
2650
+ ...$.map(
2651
+ (_) => K.accessor((I) => I.data[_.targetKey] || I.data[_.sourceColumn], {
2652
2652
  id: _.targetKey,
2653
2653
  header: _.label,
2654
- cell: ($) => {
2655
- const P = $.row.original.rowIndex, A = String($.getValue() ?? ""), D = F(P, _.targetKey);
2656
- return (f == null ? void 0 : f.rowIndex) === P && (f == null ? void 0 : f.columnKey) === _.targetKey ? /* @__PURE__ */ w("div", { className: "ff-flex ff-items-center ff-gap-2 ff-min-w-[280px]", children: [
2654
+ cell: (I) => {
2655
+ const M = I.row.original.rowIndex, H = String(I.getValue() ?? ""), b = F(M, _.targetKey);
2656
+ return (f == null ? void 0 : f.rowIndex) === M && (f == null ? void 0 : f.columnKey) === _.targetKey ? /* @__PURE__ */ w("div", { className: "ff-flex ff-items-center ff-gap-2 ff-min-w-[280px]", children: [
2657
2657
  /* @__PURE__ */ c(
2658
2658
  "input",
2659
2659
  {
2660
2660
  type: "text",
2661
- value: S,
2662
- onChange: (Y) => x(Y.target.value),
2663
- onKeyDown: (Y) => {
2664
- Y.key === "Enter" && W(), Y.key === "Escape" && k();
2661
+ value: y,
2662
+ onChange: (J) => x(J.target.value),
2663
+ onKeyDown: (J) => {
2664
+ J.key === "Enter" && Y(), J.key === "Escape" && k();
2665
2665
  },
2666
2666
  className: "ff-input ff-py-2 ff-px-3 ff-text-sm ff-flex-1 ff-min-w-[160px]",
2667
2667
  autoFocus: !0
@@ -2670,7 +2670,7 @@ const Xe = ({
2670
2670
  /* @__PURE__ */ c(
2671
2671
  "button",
2672
2672
  {
2673
- onClick: W,
2673
+ onClick: Y,
2674
2674
  className: "ff-btn ff-btn-primary ff-btn-sm ff-flex-shrink-0",
2675
2675
  children: "Save"
2676
2676
  }
@@ -2686,26 +2686,26 @@ const Xe = ({
2686
2686
  ] }) : /* @__PURE__ */ w(
2687
2687
  "div",
2688
2688
  {
2689
- className: U(
2689
+ className: W(
2690
2690
  "ff-group ff-flex ff-items-center ff-gap-2",
2691
- (D == null ? void 0 : D.severity) === "error" && "ff-cell-error",
2692
- (D == null ? void 0 : D.severity) === "warning" && "ff-cell-warning"
2691
+ (b == null ? void 0 : b.severity) === "error" && "ff-cell-error",
2692
+ (b == null ? void 0 : b.severity) === "warning" && "ff-cell-warning"
2693
2693
  ),
2694
2694
  children: [
2695
- /* @__PURE__ */ c("span", { className: "ff-flex-1 ff-truncate", children: A || /* @__PURE__ */ c("span", { style: { color: "var(--ff-text-muted)" }, children: "—" }) }),
2696
- D && /* @__PURE__ */ w("div", { className: "ff-relative ff-group/tooltip", children: [
2697
- D.severity === "error" ? /* @__PURE__ */ c(Pe, { className: "ff-w-4 ff-h-4", style: { color: "var(--ff-error)" } }) : /* @__PURE__ */ c(_e, { className: "ff-w-4 ff-h-4", style: { color: "var(--ff-warning)" } }),
2695
+ /* @__PURE__ */ c("span", { className: "ff-flex-1 ff-truncate", children: H || /* @__PURE__ */ c("span", { style: { color: "var(--ff-text-muted)" }, children: "—" }) }),
2696
+ b && /* @__PURE__ */ w("div", { className: "ff-relative ff-group/tooltip", children: [
2697
+ b.severity === "error" ? /* @__PURE__ */ c(ke, { className: "ff-w-4 ff-h-4", style: { color: "var(--ff-error)" } }) : /* @__PURE__ */ c(Fe, { className: "ff-w-4 ff-h-4", style: { color: "var(--ff-warning)" } }),
2698
2698
  /* @__PURE__ */ w("div", { className: "ff-tooltip ff-bottom-full ff-left-1/2 ff-transform ff--translate-x-1/2 ff-mb-2 ff-w-48 group-hover/tooltip:ff-tooltip-visible", children: [
2699
- D.message,
2700
- D.suggestion && /* @__PURE__ */ c("span", { className: "ff-block ff-mt-1", style: { color: "var(--ff-text-muted)" }, children: D.suggestion })
2699
+ b.message,
2700
+ b.suggestion && /* @__PURE__ */ c("span", { className: "ff-block ff-mt-1", style: { color: "var(--ff-text-muted)" }, children: b.suggestion })
2701
2701
  ] })
2702
2702
  ] }),
2703
2703
  e && /* @__PURE__ */ c(
2704
2704
  "button",
2705
2705
  {
2706
- onClick: () => V(P, _.targetKey, A),
2706
+ onClick: () => P(M, _.targetKey, H),
2707
2707
  className: "ff-opacity-0 group-hover:ff-opacity-100 ff-p-1 ff-rounded ff-transition-opacity ff-edit-btn",
2708
- children: /* @__PURE__ */ c(Ht, { className: "ff-w-3 ff-h-3" })
2708
+ children: /* @__PURE__ */ c(Gt, { className: "ff-w-3 ff-h-3" })
2709
2709
  }
2710
2710
  )
2711
2711
  ]
@@ -2715,40 +2715,57 @@ const Xe = ({
2715
2715
  })
2716
2716
  ),
2717
2717
  // Actions column (delete)
2718
- ...o ? [
2718
+ ...r ? [
2719
2719
  K.display({
2720
2720
  id: "actions",
2721
2721
  header: "",
2722
2722
  size: 50,
2723
2723
  cell: (_) => {
2724
- const $ = _.row.original.rowIndex;
2724
+ const I = _.row.original.rowIndex;
2725
2725
  return /* @__PURE__ */ c(
2726
2726
  "button",
2727
2727
  {
2728
- onClick: () => H($),
2729
- className: "ff-delete-btn",
2728
+ onClick: () => G(I),
2730
2729
  title: "Delete row",
2731
- children: /* @__PURE__ */ c(Ot, { className: "ff-w-4 ff-h-4" })
2730
+ style: {
2731
+ display: "flex",
2732
+ alignItems: "center",
2733
+ justifyContent: "center",
2734
+ padding: "6px",
2735
+ borderRadius: "6px",
2736
+ cursor: "pointer",
2737
+ color: "#8e8d89",
2738
+ background: "transparent",
2739
+ border: "none",
2740
+ transition: "color 0.15s, background-color 0.15s"
2741
+ },
2742
+ onMouseEnter: (M) => {
2743
+ M.currentTarget.style.color = "#d43338", M.currentTarget.style.backgroundColor = "#fcdede";
2744
+ },
2745
+ onMouseLeave: (M) => {
2746
+ M.currentTarget.style.color = "#8e8d89", M.currentTarget.style.backgroundColor = "transparent";
2747
+ },
2748
+ children: /* @__PURE__ */ c(Kt, { style: { width: "16px", height: "16px", display: "block" } })
2732
2749
  }
2733
2750
  );
2734
2751
  }
2735
2752
  })
2736
2753
  ] : []
2737
2754
  ],
2738
- [I, f, S, e, o, F, K]
2739
- ), z = Bn({
2755
+ [$, f, y, e, r, F, K]
2756
+ ), z = jn({
2740
2757
  data: l,
2741
- columns: O,
2758
+ columns: D,
2742
2759
  state: {
2743
2760
  sorting: m,
2744
2761
  globalFilter: C
2745
2762
  },
2746
- onSortingChange: v,
2747
- onGlobalFilterChange: h,
2748
- getCoreRowModel: kn(),
2749
- getPaginationRowModel: An(),
2750
- getSortedRowModel: Gn(),
2751
- getFilteredRowModel: Hn(),
2763
+ onSortingChange: h,
2764
+ onGlobalFilterChange: v,
2765
+ getCoreRowModel: Dn(),
2766
+ getPaginationRowModel: On(),
2767
+ getSortedRowModel: Tn(),
2768
+ getFilteredRowModel: Gn(),
2752
2769
  initialState: {
2753
2770
  pagination: {
2754
2771
  pageSize: t
@@ -2762,7 +2779,7 @@ const Xe = ({
2762
2779
  {
2763
2780
  type: "text",
2764
2781
  value: C,
2765
- onChange: (_) => h(_.target.value),
2782
+ onChange: (_) => v(_.target.value),
2766
2783
  placeholder: "Search all columns...",
2767
2784
  className: "ff-input ff-max-w-xs"
2768
2785
  }
@@ -2773,28 +2790,28 @@ const Xe = ({
2773
2790
  ] })
2774
2791
  ] }),
2775
2792
  /* @__PURE__ */ c("div", { className: "ff-table-container ff-max-h-[500px]", children: /* @__PURE__ */ w("table", { className: "ff-table", children: [
2776
- /* @__PURE__ */ c("thead", { children: z.getHeaderGroups().map((_) => /* @__PURE__ */ c("tr", { children: _.headers.map(($) => /* @__PURE__ */ c(
2793
+ /* @__PURE__ */ c("thead", { children: z.getHeaderGroups().map((_) => /* @__PURE__ */ c("tr", { children: _.headers.map((I) => /* @__PURE__ */ c(
2777
2794
  "th",
2778
2795
  {
2779
- style: { width: $.getSize() },
2780
- onClick: $.column.getToggleSortingHandler(),
2781
- className: U(
2782
- $.column.getCanSort() && "ff-cursor-pointer ff-select-none"
2796
+ style: { width: I.getSize() },
2797
+ onClick: I.column.getToggleSortingHandler(),
2798
+ className: W(
2799
+ I.column.getCanSort() && "ff-cursor-pointer ff-select-none"
2783
2800
  ),
2784
2801
  children: /* @__PURE__ */ w("div", { className: "ff-flex ff-items-center ff-gap-1", children: [
2785
- Ue($.column.columnDef.header, $.getContext()),
2786
- $.column.getIsSorted() && /* @__PURE__ */ c("span", { children: $.column.getIsSorted() === "asc" ? "↑" : "↓" })
2802
+ Qe(I.column.columnDef.header, I.getContext()),
2803
+ I.column.getIsSorted() && /* @__PURE__ */ c("span", { children: I.column.getIsSorted() === "asc" ? "↑" : "↓" })
2787
2804
  ] })
2788
2805
  },
2789
- $.id
2806
+ I.id
2790
2807
  )) }, _.id)) }),
2791
2808
  /* @__PURE__ */ c("tbody", { children: z.getRowModel().rows.map((_) => {
2792
- const $ = u.has(_.original.rowIndex);
2809
+ const I = u.has(_.original.rowIndex);
2793
2810
  return /* @__PURE__ */ c(
2794
2811
  "tr",
2795
2812
  {
2796
- className: U($ && "ff-row-error"),
2797
- children: _.getVisibleCells().map((P) => /* @__PURE__ */ c("td", { children: Ue(P.column.columnDef.cell, P.getContext()) }, P.id))
2813
+ className: W(I && "ff-row-error"),
2814
+ children: _.getVisibleCells().map((M) => /* @__PURE__ */ c("td", { children: Qe(M.column.columnDef.cell, M.getContext()) }, M.id))
2798
2815
  },
2799
2816
  _.id
2800
2817
  );
@@ -2815,7 +2832,7 @@ const Xe = ({
2815
2832
  disabled: !z.getCanPreviousPage(),
2816
2833
  className: "ff-btn ff-btn-secondary ff-btn-sm",
2817
2834
  children: [
2818
- /* @__PURE__ */ c(Ft, { className: "ff-w-4 ff-h-4" }),
2835
+ /* @__PURE__ */ c(Nt, { className: "ff-w-4 ff-h-4" }),
2819
2836
  "Previous"
2820
2837
  ]
2821
2838
  }
@@ -2828,20 +2845,20 @@ const Xe = ({
2828
2845
  className: "ff-btn ff-btn-secondary ff-btn-sm",
2829
2846
  children: [
2830
2847
  "Next",
2831
- /* @__PURE__ */ c(vt, { className: "ff-w-4 ff-h-4" })
2848
+ /* @__PURE__ */ c(yt, { className: "ff-w-4 ff-h-4" })
2832
2849
  ]
2833
2850
  }
2834
2851
  )
2835
2852
  ] })
2836
2853
  ] })
2837
2854
  ] });
2838
- }, We = ({
2855
+ }, Je = ({
2839
2856
  showDetails: e = !0
2840
2857
  }) => {
2841
- const { validationResults: o } = Z();
2842
- if (!o)
2858
+ const { validationResults: r } = te();
2859
+ if (!r)
2843
2860
  return null;
2844
- const { isValid: t, totalRows: n, validRows: r, errorCount: l, warningCount: i, infoCount: s, summary: u } = o, f = Math.round(r / n * 100);
2861
+ const { isValid: t, totalRows: n, validRows: o, errorCount: l, warningCount: s, infoCount: i, summary: u } = r, f = Math.round(o / n * 100);
2845
2862
  return /* @__PURE__ */ w("div", { className: "ff-space-y-4", children: [
2846
2863
  /* @__PURE__ */ w(
2847
2864
  "div",
@@ -2852,7 +2869,7 @@ const Xe = ({
2852
2869
  borderColor: t ? "var(--ff-success)" : "var(--ff-error)"
2853
2870
  },
2854
2871
  children: [
2855
- t ? /* @__PURE__ */ c(ke, { className: "ff-w-8 ff-h-8", style: { color: "var(--ff-success)" } }) : /* @__PURE__ */ c(Te, { className: "ff-w-8 ff-h-8", style: { color: "var(--ff-error)" } }),
2872
+ t ? /* @__PURE__ */ c(Ee, { className: "ff-w-8 ff-h-8", style: { color: "var(--ff-success)" } }) : /* @__PURE__ */ c(qe, { className: "ff-w-8 ff-h-8", style: { color: "var(--ff-error)" } }),
2856
2873
  /* @__PURE__ */ w("div", { children: [
2857
2874
  /* @__PURE__ */ c(
2858
2875
  "h3",
@@ -2863,7 +2880,7 @@ const Xe = ({
2863
2880
  }
2864
2881
  ),
2865
2882
  /* @__PURE__ */ w("p", { className: "ff-text-sm", style: { color: t ? "var(--ff-success)" : "var(--ff-error)" }, children: [
2866
- r,
2883
+ o,
2867
2884
  " of ",
2868
2885
  n,
2869
2886
  " rows are valid (",
@@ -2880,7 +2897,7 @@ const Xe = ({
2880
2897
  /* @__PURE__ */ c("p", { className: "ff-text-sm", style: { color: "var(--ff-text-muted)" }, children: "Total Rows" })
2881
2898
  ] }),
2882
2899
  /* @__PURE__ */ w("div", { className: "ff-border ff-rounded-lg ff-p-4 ff-text-center", style: { backgroundColor: "var(--ff-success-light)", borderColor: "var(--ff-success)" }, children: [
2883
- /* @__PURE__ */ c("p", { className: "ff-text-2xl ff-font-bold", style: { color: "var(--ff-success-dark)" }, children: r }),
2900
+ /* @__PURE__ */ c("p", { className: "ff-text-2xl ff-font-bold", style: { color: "var(--ff-success-dark)" }, children: o }),
2884
2901
  /* @__PURE__ */ c("p", { className: "ff-text-sm", style: { color: "var(--ff-success)" }, children: "Valid Rows" })
2885
2902
  ] }),
2886
2903
  /* @__PURE__ */ w("div", { className: "ff-border ff-rounded-lg ff-p-4 ff-text-center", style: { backgroundColor: "var(--ff-error-light)", borderColor: "var(--ff-error)" }, children: [
@@ -2888,7 +2905,7 @@ const Xe = ({
2888
2905
  /* @__PURE__ */ c("p", { className: "ff-text-sm", style: { color: "var(--ff-error)" }, children: "Errors" })
2889
2906
  ] }),
2890
2907
  /* @__PURE__ */ w("div", { className: "ff-border ff-rounded-lg ff-p-4 ff-text-center", style: { backgroundColor: "var(--ff-warning-light)", borderColor: "var(--ff-warning)" }, children: [
2891
- /* @__PURE__ */ c("p", { className: "ff-text-2xl ff-font-bold", style: { color: "var(--ff-warning-dark)" }, children: i }),
2908
+ /* @__PURE__ */ c("p", { className: "ff-text-2xl ff-font-bold", style: { color: "var(--ff-warning-dark)" }, children: s }),
2892
2909
  /* @__PURE__ */ c("p", { className: "ff-text-sm", style: { color: "var(--ff-warning)" }, children: "Warnings" })
2893
2910
  ] })
2894
2911
  ] }),
@@ -2908,13 +2925,13 @@ const Xe = ({
2908
2925
  ] }),
2909
2926
  /* @__PURE__ */ w("div", { className: "ff-flex ff-items-center ff-gap-2 ff-flex-shrink-0", children: [
2910
2927
  p.errorCount > 0 && /* @__PURE__ */ w("span", { className: "ff-badge ff-badge-error ff-whitespace-nowrap", children: [
2911
- /* @__PURE__ */ c(Te, { className: "ff-w-3 ff-h-3 ff-mr-1" }),
2928
+ /* @__PURE__ */ c(qe, { className: "ff-w-3 ff-h-3 ff-mr-1" }),
2912
2929
  p.errorCount,
2913
2930
  " ",
2914
2931
  p.errorCount === 1 ? "error" : "errors"
2915
2932
  ] }),
2916
2933
  p.warningCount > 0 && /* @__PURE__ */ w("span", { className: "ff-badge ff-badge-warning ff-whitespace-nowrap", children: [
2917
- /* @__PURE__ */ c(_e, { className: "ff-w-3 ff-h-3 ff-mr-1" }),
2934
+ /* @__PURE__ */ c(Fe, { className: "ff-w-3 ff-h-3 ff-mr-1" }),
2918
2935
  p.warningCount,
2919
2936
  " ",
2920
2937
  p.warningCount === 1 ? "warning" : "warnings"
@@ -2926,7 +2943,7 @@ const Xe = ({
2926
2943
  )) })
2927
2944
  ] }),
2928
2945
  e && u.duplicates && u.duplicates.length > 0 && /* @__PURE__ */ c("div", { className: "ff-border ff-rounded-lg ff-p-4", style: { backgroundColor: "var(--ff-warning-light)", borderColor: "var(--ff-warning)" }, children: /* @__PURE__ */ w("div", { className: "ff-flex ff-items-start ff-gap-3", children: [
2929
- /* @__PURE__ */ c(_e, { className: "ff-w-5 ff-h-5 ff-flex-shrink-0 ff-mt-0.5", style: { color: "var(--ff-warning)" } }),
2946
+ /* @__PURE__ */ c(Fe, { className: "ff-w-5 ff-h-5 ff-flex-shrink-0 ff-mt-0.5", style: { color: "var(--ff-warning)" } }),
2930
2947
  /* @__PURE__ */ w("div", { children: [
2931
2948
  /* @__PURE__ */ c("h4", { className: "ff-font-medium", style: { color: "var(--ff-warning-dark)" }, children: "Duplicate Values Found" }),
2932
2949
  /* @__PURE__ */ w("ul", { className: "ff-mt-2 ff-space-y-1 ff-text-sm", style: { color: "var(--ff-warning-dark)" }, children: [
@@ -2952,21 +2969,21 @@ const Xe = ({
2952
2969
  ] })
2953
2970
  ] }) })
2954
2971
  ] });
2955
- }, Re = ["upload", "mapping", "validation", "complete"], Kn = [
2956
- { key: "upload", label: "Upload", icon: Qe },
2957
- { key: "mapping", label: "Map Columns", icon: Lt },
2958
- { key: "validation", label: "Validate", icon: Gt },
2959
- { key: "review", label: "Review", icon: Vt },
2960
- { key: "complete", label: "Complete", icon: ke }
2961
- ], Wn = ({
2972
+ }, xe = ["upload", "mapping", "validation", "complete"], Un = [
2973
+ { key: "upload", label: "Upload", icon: Ze },
2974
+ { key: "mapping", label: "Map Columns", icon: Ht },
2975
+ { key: "validation", label: "Validate", icon: Tt },
2976
+ { key: "review", label: "Review", icon: kt },
2977
+ { key: "complete", label: "Complete", icon: Ee }
2978
+ ], Jn = ({
2962
2979
  template: e,
2963
- schema: o,
2980
+ schema: r,
2964
2981
  mode: t = "modal",
2965
2982
  theme: n,
2966
- useShadowDom: r = !1,
2983
+ useShadowDom: o = !1,
2967
2984
  onComplete: l,
2968
- onCancel: i,
2969
- onError: s
2985
+ onCancel: s,
2986
+ onError: i
2970
2987
  }) => {
2971
2988
  const {
2972
2989
  step: u,
@@ -2976,116 +2993,118 @@ const Xe = ({
2976
2993
  validationResults: d,
2977
2994
  isLoading: a,
2978
2995
  error: m,
2979
- setSchema: v,
2996
+ setSchema: h,
2980
2997
  setSessionId: C,
2981
- setParsedData: h,
2982
- setMappings: S,
2998
+ setParsedData: v,
2999
+ setMappings: y,
2983
3000
  setUnmapped: x,
2984
- setValidationResults: I,
3001
+ setValidationResults: $,
2985
3002
  setStep: F,
2986
- nextStep: V,
2987
- previousStep: W,
3003
+ nextStep: P,
3004
+ previousStep: Y,
2988
3005
  setLoading: k,
2989
- setError: H,
3006
+ setError: G,
2990
3007
  reset: K
2991
- } = Z(), [O, z] = q(null), [_, $] = q(null), [P, A] = q(0), [D, Q] = q("");
2992
- Oe(() => {
2993
- if ($(null), e)
2994
- if (wt(e)) {
2995
- const M = Ct(e);
2996
- M ? z(M) : ($(`Failed to load template "${e}"`), s == null || s(new Error(`Failed to load template "${e}"`)));
3008
+ } = te(), [D, z] = j(null), [_, I] = j(null), [M, H] = j(0), [b, U] = j("");
3009
+ Ke(() => {
3010
+ if (I(null), e)
3011
+ if (St(e)) {
3012
+ const N = Rt(e);
3013
+ N ? z(N) : (I(`Failed to load template "${e}"`), i == null || i(new Error(`Failed to load template "${e}"`)));
2997
3014
  } else {
2998
- const M = `Template "${e}" not found. Available templates: ${Be.join(", ")}`;
2999
- $(M), s == null || s(new Error(M));
3015
+ const N = `Template "${e}" not found. Available templates: ${je.join(", ")}`;
3016
+ I(N), i == null || i(new Error(N));
3000
3017
  }
3001
- else if (o)
3002
- z(o);
3018
+ else if (r)
3019
+ z(r);
3003
3020
  else {
3004
- const M = `No template or schema provided. Please specify a template (${Be.join(", ")}) or provide a custom schema.`;
3005
- $(M), s == null || s(new Error(M));
3021
+ const N = `No template or schema provided. Please specify a template (${je.join(", ")}) or provide a custom schema.`;
3022
+ I(N), i == null || i(new Error(N));
3006
3023
  }
3007
- }, [e, o, s]), Oe(() => {
3008
- O && (v(O), Y(O));
3009
- }, [O]);
3010
- const Y = async (M) => {
3024
+ }, [e, r, i]), Ke(() => {
3025
+ D && (h(D), J(D));
3026
+ }, [D]);
3027
+ const J = async (N) => {
3011
3028
  try {
3012
3029
  k(!0);
3013
- const T = await te().createImportSession(M);
3014
- C(T.sessionId);
3015
- } catch (N) {
3016
- const T = N;
3017
- H(T.message), s == null || s(T);
3030
+ const B = await re().createImportSession(N);
3031
+ C(B.sessionId);
3032
+ } catch (V) {
3033
+ const B = V;
3034
+ G(B.message), i == null || i(B);
3018
3035
  } finally {
3019
3036
  k(!1);
3020
3037
  }
3021
- }, it = Ne(async (M) => {
3038
+ }, ut = Pe(async (N) => {
3022
3039
  if (f)
3023
3040
  try {
3024
- k(!0), H(null), A(10), Q("Uploading file...");
3025
- const N = te();
3026
- A(30), Q("Parsing file data...");
3027
- const T = await N.uploadFile(f, M);
3028
- A(60), Q("Processing rows...");
3029
- const Ge = (J, gt) => ({
3030
- rowIndex: J.rowIndex ?? gt,
3031
- data: J.data ?? J,
3032
- rawData: J.rawData ?? Object.values(J.data ?? J)
3041
+ k(!0), G(null), H(10), U("Uploading file...");
3042
+ const V = re();
3043
+ H(30), U("Parsing file data...");
3044
+ const B = await V.uploadFile(f, N);
3045
+ H(60), U("Processing rows...");
3046
+ const Te = (Z, ht) => ({
3047
+ rowIndex: Z.rowIndex ?? ht,
3048
+ data: Z.data ?? Z,
3049
+ rawData: Z.rawData ?? Object.values(Z.data ?? Z)
3033
3050
  });
3034
- h({
3035
- headers: T.data.headers,
3036
- rows: T.data.sampleRows.map(Ge),
3037
- totalRows: T.data.totalRows,
3038
- sampleRows: T.data.sampleRows.map(Ge)
3039
- }), A(80), Q("Matching columns..."), V(), await st(), A(100), Q("Done");
3040
- } catch (N) {
3041
- H(`Failed to process the uploaded file: ${N.message}`);
3051
+ v({
3052
+ headers: B.data.headers,
3053
+ rows: B.data.sampleRows.map(Te),
3054
+ totalRows: B.data.totalRows,
3055
+ sampleRows: B.data.sampleRows.map(Te)
3056
+ }), H(80), U("Matching columns..."), P(), await ft(), H(100), U("Done");
3057
+ } catch (V) {
3058
+ G(`Failed to process the uploaded file: ${V.message}`);
3042
3059
  } finally {
3043
- k(!1), A(0), Q("");
3060
+ k(!1), H(0), U("");
3044
3061
  }
3045
- }, [f]), st = async () => {
3062
+ }, [f]), ft = async () => {
3046
3063
  if (f)
3047
3064
  try {
3048
3065
  k(!0);
3049
- const N = await te().matchColumns(f);
3050
- S(N.mappings), x(N.unmappedSource, N.unmappedTarget);
3051
- } catch (M) {
3052
- H(`Column matching failed: ${M.message}`);
3066
+ const V = await re().matchColumns(f);
3067
+ y(V.mappings), x(V.unmappedSource, V.unmappedTarget);
3068
+ } catch (N) {
3069
+ G(`Column matching failed: ${N.message}`);
3053
3070
  } finally {
3054
3071
  k(!1);
3055
3072
  }
3056
- }, at = async () => {
3073
+ }, dt = async () => {
3057
3074
  if (f)
3058
3075
  try {
3059
- k(!0), H(null);
3060
- const N = await te().validateImport(f);
3061
- I(N.validation), V();
3062
- } catch (M) {
3063
- H(`Validation failed: ${M.message}`);
3076
+ k(!0), G(null);
3077
+ const V = await re().validateImport(f);
3078
+ $(V.validation), P();
3079
+ } catch (N) {
3080
+ G(`Validation failed: ${N.message}`);
3064
3081
  } finally {
3065
3082
  k(!1);
3066
3083
  }
3067
- }, [He, fe] = q(null), ut = async () => {
3084
+ }, [He, se] = j(null), [A, Ae] = j(null), ct = async () => {
3068
3085
  if (f)
3069
3086
  try {
3070
- k(!0), H(null), fe(null);
3071
- const N = await te().completeImport(f, {
3087
+ k(!0), G(null), se(null);
3088
+ const V = await re().completeImport(f, {
3072
3089
  skipInvalidRows: !0,
3073
3090
  acknowledgeWarnings: !0
3074
3091
  });
3075
- F("complete"), l == null || l(N);
3076
- } catch (M) {
3077
- fe(M.message), F("complete");
3092
+ Ae(V), F("complete"), l == null || l(V);
3093
+ } catch (N) {
3094
+ se(N.message), F("complete");
3078
3095
  } finally {
3079
3096
  k(!1);
3080
3097
  }
3081
- }, de = () => {
3082
- K(), i == null || i();
3083
- }, ft = () => Kn.findIndex((M) => M.key === u), dt = () => {
3098
+ }, ie = () => {
3099
+ K(), s == null || s();
3100
+ }, Ge = () => {
3101
+ se(null), Ae(null), H(0), U(""), K(), D && (h(D), J(D));
3102
+ }, gt = () => Un.findIndex((N) => N.key === u), pt = () => {
3084
3103
  switch (u) {
3085
3104
  case "upload":
3086
3105
  return g !== null;
3087
3106
  case "mapping":
3088
- return p.length > 0 && p.some((M) => M.targetKey !== null);
3107
+ return p.length > 0 && p.some((N) => N.targetKey !== null);
3089
3108
  case "validation":
3090
3109
  return d !== null;
3091
3110
  case "review":
@@ -3093,99 +3112,113 @@ const Xe = ({
3093
3112
  default:
3094
3113
  return !1;
3095
3114
  }
3096
- }, ct = async () => {
3115
+ }, mt = async () => {
3097
3116
  switch (u) {
3098
3117
  case "mapping":
3099
- await at();
3118
+ await dt();
3100
3119
  break;
3101
3120
  case "validation":
3102
- V();
3121
+ P();
3103
3122
  break;
3104
3123
  case "review":
3105
- await ut();
3124
+ await ct();
3106
3125
  break;
3107
3126
  default:
3108
- V();
3127
+ P();
3109
3128
  }
3110
3129
  };
3111
3130
  if (_)
3112
- return /* @__PURE__ */ c(ce, { theme: n, useShadowDom: r, children: /* @__PURE__ */ c("div", { className: "ff-container ff-bg-white ff-rounded-xl ff-shadow-xl ff-overflow-hidden ff-p-6", children: /* @__PURE__ */ w("div", { className: "ff-flex ff-flex-col ff-items-center ff-justify-center ff-py-8", children: [
3113
- /* @__PURE__ */ c("div", { className: "ff-w-16 ff-h-16 ff-rounded-full ff-flex ff-items-center ff-justify-center ff-mb-4", style: { backgroundColor: "var(--ff-error-light)" }, children: /* @__PURE__ */ c(ae, { className: "ff-w-10 ff-h-10", style: { color: "var(--ff-error)" } }) }),
3131
+ return /* @__PURE__ */ c(pe, { theme: n, useShadowDom: o, children: /* @__PURE__ */ c("div", { className: "ff-container ff-bg-white ff-rounded-xl ff-shadow-xl ff-overflow-hidden ff-p-6", children: /* @__PURE__ */ w("div", { className: "ff-flex ff-flex-col ff-items-center ff-justify-center ff-py-8", children: [
3132
+ /* @__PURE__ */ c("div", { className: "ff-w-16 ff-h-16 ff-rounded-full ff-flex ff-items-center ff-justify-center ff-mb-4", style: { backgroundColor: "var(--ff-error-light)" }, children: /* @__PURE__ */ c(ce, { className: "ff-w-10 ff-h-10", style: { color: "var(--ff-error)" } }) }),
3114
3133
  /* @__PURE__ */ c("h3", { className: "ff-text-xl ff-font-semibold ff-mb-2", style: { color: "var(--ff-text-primary)" }, children: "Configuration Error" }),
3115
3134
  /* @__PURE__ */ c("p", { className: "ff-text-center ff-max-w-md ff-mb-4", style: { color: "var(--ff-text-muted)" }, children: _ }),
3116
- i && /* @__PURE__ */ c("button", { onClick: de, className: "ff-btn ff-btn-secondary", children: "Close" })
3135
+ s && /* @__PURE__ */ c("button", { onClick: ie, className: "ff-btn ff-btn-secondary", children: "Close" })
3117
3136
  ] }) }) });
3118
- if (!O)
3119
- return /* @__PURE__ */ c(ce, { theme: n, useShadowDom: r, children: /* @__PURE__ */ c("div", { className: "ff-container ff-bg-white ff-rounded-xl ff-shadow-xl ff-overflow-hidden ff-p-6", children: /* @__PURE__ */ w("div", { className: "ff-flex ff-flex-col ff-items-center ff-justify-center ff-py-8", children: [
3120
- /* @__PURE__ */ c(ge, { className: "ff-w-10 ff-h-10 ff-animate-spin ff-mb-4", style: { color: "var(--ff-primary-90)" } }),
3137
+ if (!D)
3138
+ return /* @__PURE__ */ c(pe, { theme: n, useShadowDom: o, children: /* @__PURE__ */ c("div", { className: "ff-container ff-bg-white ff-rounded-xl ff-shadow-xl ff-overflow-hidden ff-p-6", children: /* @__PURE__ */ w("div", { className: "ff-flex ff-flex-col ff-items-center ff-justify-center ff-py-8", children: [
3139
+ /* @__PURE__ */ c(ae, { className: "ff-w-10 ff-h-10 ff-animate-spin ff-mb-4", style: { color: "var(--ff-primary-90)" } }),
3121
3140
  /* @__PURE__ */ c("p", { style: { color: "var(--ff-text-muted)" }, children: "Loading template..." })
3122
3141
  ] }) }) });
3123
- const ee = () => {
3124
- const M = u === "review" ? "validation" : u;
3125
- return Re.indexOf(M);
3126
- }, Ae = /* @__PURE__ */ c(re, { children: /* @__PURE__ */ w("div", { className: t === "embed" ? "ff-container ff-embed" : "ff-container ff-modal", children: [
3142
+ const ne = () => {
3143
+ const N = u === "review" ? "validation" : u;
3144
+ return xe.indexOf(N);
3145
+ }, Oe = /* @__PURE__ */ c(ee, { children: /* @__PURE__ */ w("div", { className: t === "embed" ? "ff-container ff-embed" : "ff-container ff-modal", children: [
3127
3146
  /* @__PURE__ */ w("div", { className: "ff-modal-header", children: [
3128
3147
  /* @__PURE__ */ w("div", { className: "ff-modal-header-left", children: [
3129
3148
  /* @__PURE__ */ w("div", { className: "ff-flex ff-items-center ff-gap-3", children: [
3130
- /* @__PURE__ */ c("div", { className: "ff-modal-icon", children: /* @__PURE__ */ c(Pt, {}) }),
3149
+ /* @__PURE__ */ c("div", { className: "ff-modal-icon", children: /* @__PURE__ */ c(bt, {}) }),
3131
3150
  /* @__PURE__ */ c("h2", { className: "ff-modal-title", children: "Import Data" })
3132
3151
  ] }),
3133
- /* @__PURE__ */ c("div", { className: "ff-steps ff-ml-4", children: Re.map((M, N) => /* @__PURE__ */ w(pt.Fragment, { children: [
3152
+ /* @__PURE__ */ c("div", { className: "ff-steps ff-ml-4", children: xe.map((N, V) => /* @__PURE__ */ w(vt.Fragment, { children: [
3134
3153
  /* @__PURE__ */ c(
3135
3154
  "div",
3136
3155
  {
3137
- className: U(
3156
+ className: W(
3138
3157
  "ff-step",
3139
- ee() === N && "ff-step-active",
3140
- ee() > N && "ff-step-complete",
3141
- ee() < N && "ff-step-pending"
3158
+ ne() === V && "ff-step-active",
3159
+ ne() > V && "ff-step-complete",
3160
+ ne() < V && "ff-step-pending"
3142
3161
  ),
3143
- children: ee() > N ? "✓" : N + 1
3162
+ children: ne() > V ? "✓" : V + 1
3144
3163
  }
3145
3164
  ),
3146
- N < Re.length - 1 && /* @__PURE__ */ c("div", { className: U(
3165
+ V < xe.length - 1 && /* @__PURE__ */ c("div", { className: W(
3147
3166
  "ff-step-connector",
3148
- ee() > N && "ff-step-connector-complete"
3167
+ ne() > V && "ff-step-connector-complete"
3149
3168
  ) })
3150
- ] }, M)) })
3169
+ ] }, N)) })
3151
3170
  ] }),
3152
3171
  /* @__PURE__ */ c(
3153
3172
  "button",
3154
3173
  {
3155
- onClick: de,
3174
+ onClick: ie,
3156
3175
  className: "ff-modal-close",
3157
- children: /* @__PURE__ */ c(ae, { className: "ff-w-5 ff-h-5" })
3176
+ children: /* @__PURE__ */ c(ce, { className: "ff-w-5 ff-h-5" })
3158
3177
  }
3159
3178
  )
3160
3179
  ] }),
3161
3180
  /* @__PURE__ */ w("div", { className: "ff-modal-body", children: [
3162
3181
  m && /* @__PURE__ */ c("div", { className: "ff-mb-4 ff-p-4 ff-border ff-rounded-lg ff-text-sm", style: { backgroundColor: "var(--ff-error-light)", borderColor: "var(--ff-error)", color: "var(--ff-error)" }, children: m }),
3163
- u === "upload" && /* @__PURE__ */ c("div", { className: "ff-py-4", children: /* @__PURE__ */ c("div", { className: "ff-max-w-xl ff-mx-auto", children: a && P > 0 ? /* @__PURE__ */ w("div", { className: "ff-p-8 ff-text-center", children: [
3164
- /* @__PURE__ */ c(ge, { className: "ff-w-10 ff-h-10 ff-animate-spin ff-mx-auto ff-mb-4", style: { color: "var(--ff-primary-90)" } }),
3165
- /* @__PURE__ */ c("p", { className: "ff-font-medium ff-mb-2", style: { color: "var(--ff-text-primary)" }, children: D }),
3182
+ u === "upload" && /* @__PURE__ */ c("div", { className: "ff-py-4", children: /* @__PURE__ */ c("div", { className: "ff-max-w-xl ff-mx-auto", children: a && M > 0 ? /* @__PURE__ */ w("div", { className: "ff-p-8 ff-text-center", children: [
3183
+ /* @__PURE__ */ c(ae, { className: "ff-w-10 ff-h-10 ff-animate-spin ff-mx-auto ff-mb-4", style: { color: "var(--ff-primary-90)" } }),
3184
+ /* @__PURE__ */ c("p", { className: "ff-font-medium ff-mb-2", style: { color: "var(--ff-text-primary)" }, children: b }),
3166
3185
  /* @__PURE__ */ c("div", { className: "ff-progress ff-w-full ff-max-w-xs ff-mx-auto ff-mb-2", children: /* @__PURE__ */ c(
3167
3186
  "div",
3168
3187
  {
3169
3188
  className: "ff-progress-bar",
3170
- style: { width: `${P}%`, transition: "width 0.3s ease" }
3189
+ style: { width: `${M}%`, transition: "width 0.3s ease" }
3171
3190
  }
3172
3191
  ) }),
3173
3192
  /* @__PURE__ */ w("p", { className: "ff-text-sm", style: { color: "var(--ff-text-muted)" }, children: [
3174
- P,
3193
+ M,
3175
3194
  "% complete"
3176
3195
  ] })
3177
- ] }) : /* @__PURE__ */ c(Bt, { onFileSelect: it }) }) }),
3178
- u === "mapping" && /* @__PURE__ */ c(Kt, {}),
3196
+ ] }) : /* @__PURE__ */ c(jt, { onFileSelect: ut }) }) }),
3197
+ u === "mapping" && (a && M > 0 ? /* @__PURE__ */ w("div", { className: "ff-py-12 ff-text-center", children: [
3198
+ /* @__PURE__ */ c(ae, { className: "ff-w-10 ff-h-10 ff-animate-spin ff-mx-auto ff-mb-4", style: { color: "var(--ff-primary-90)" } }),
3199
+ /* @__PURE__ */ c("p", { className: "ff-font-medium ff-mb-3", style: { color: "var(--ff-text-primary)" }, children: b }),
3200
+ /* @__PURE__ */ c("div", { className: "ff-progress ff-w-full ff-max-w-xs ff-mx-auto ff-mb-2", children: /* @__PURE__ */ c(
3201
+ "div",
3202
+ {
3203
+ className: "ff-progress-bar",
3204
+ style: { width: `${M}%`, transition: "width 0.3s ease" }
3205
+ }
3206
+ ) }),
3207
+ /* @__PURE__ */ w("p", { className: "ff-text-sm", style: { color: "var(--ff-text-muted)" }, children: [
3208
+ M,
3209
+ "% complete"
3210
+ ] })
3211
+ ] }) : /* @__PURE__ */ c(Ut, {})),
3179
3212
  u === "validation" && /* @__PURE__ */ w("div", { className: "ff-space-y-6", children: [
3180
- /* @__PURE__ */ c(We, {}),
3181
- /* @__PURE__ */ c(Xe, { editable: !0 })
3213
+ /* @__PURE__ */ c(Je, {}),
3214
+ /* @__PURE__ */ c(Ye, { editable: !0 })
3182
3215
  ] }),
3183
3216
  u === "review" && /* @__PURE__ */ w("div", { className: "ff-space-y-6", children: [
3184
- /* @__PURE__ */ c(We, { showDetails: !1 }),
3185
- /* @__PURE__ */ c(Xe, { editable: !1, pageSize: 10 })
3217
+ /* @__PURE__ */ c(Je, { showDetails: !1 }),
3218
+ /* @__PURE__ */ c(Ye, { editable: !1, pageSize: 10 })
3186
3219
  ] }),
3187
- u === "complete" && /* @__PURE__ */ c("div", { className: "ff-flex ff-flex-col ff-items-center ff-justify-center ff-py-12", children: He ? /* @__PURE__ */ w(re, { children: [
3188
- /* @__PURE__ */ c("div", { className: "ff-w-16 ff-h-16 ff-rounded-full ff-flex ff-items-center ff-justify-center ff-mb-4", style: { backgroundColor: "var(--ff-error-light)" }, children: /* @__PURE__ */ c(ae, { className: "ff-w-10 ff-h-10", style: { color: "var(--ff-error)" } }) }),
3220
+ u === "complete" && /* @__PURE__ */ c("div", { className: "ff-flex ff-flex-col ff-items-center ff-justify-center ff-py-8", children: He ? /* @__PURE__ */ w(ee, { children: [
3221
+ /* @__PURE__ */ c("div", { className: "ff-w-16 ff-h-16 ff-rounded-full ff-flex ff-items-center ff-justify-center ff-mb-4", style: { backgroundColor: "var(--ff-error-light)" }, children: /* @__PURE__ */ c(ce, { className: "ff-w-10 ff-h-10", style: { color: "var(--ff-error)" } }) }),
3189
3222
  /* @__PURE__ */ c("h3", { className: "ff-text-xl ff-font-semibold ff-mb-2", style: { color: "var(--ff-text-primary)" }, children: "Import Failed" }),
3190
3223
  /* @__PURE__ */ c("p", { className: "ff-text-center ff-max-w-md ff-mb-4", style: { color: "var(--ff-text-muted)" }, children: He }),
3191
3224
  /* @__PURE__ */ w("div", { className: "ff-flex ff-gap-3", children: [
@@ -3193,52 +3226,84 @@ const Xe = ({
3193
3226
  "button",
3194
3227
  {
3195
3228
  onClick: () => {
3196
- fe(null), F("review");
3229
+ se(null), F("review");
3197
3230
  },
3198
3231
  className: "ff-btn ff-btn-secondary",
3199
3232
  children: "Back to Review"
3200
3233
  }
3201
3234
  ),
3202
- i && /* @__PURE__ */ c("button", { onClick: de, className: "ff-btn ff-btn-secondary", children: "Close" })
3235
+ s && /* @__PURE__ */ c("button", { onClick: ie, className: "ff-btn ff-btn-secondary", children: "Close" })
3203
3236
  ] })
3204
- ] }) : /* @__PURE__ */ w(re, { children: [
3205
- /* @__PURE__ */ c("div", { className: "ff-w-16 ff-h-16 ff-rounded-full ff-flex ff-items-center ff-justify-center ff-mb-4", style: { backgroundColor: "var(--ff-success-light)" }, children: /* @__PURE__ */ c(ke, { className: "ff-w-10 ff-h-10", style: { color: "var(--ff-success)" } }) }),
3237
+ ] }) : /* @__PURE__ */ w(ee, { children: [
3238
+ /* @__PURE__ */ c("div", { className: "ff-w-20 ff-h-20 ff-rounded-2xl ff-flex ff-items-center ff-justify-center ff-mb-6", style: { backgroundColor: "var(--ff-success-light)" }, children: /* @__PURE__ */ c(Ee, { className: "ff-w-10 ff-h-10", style: { color: "var(--ff-success)" } }) }),
3206
3239
  /* @__PURE__ */ c("h3", { className: "ff-text-xl ff-font-semibold ff-mb-2", style: { color: "var(--ff-text-primary)" }, children: "Import Complete!" }),
3207
- /* @__PURE__ */ c("p", { style: { color: "var(--ff-text-muted)" }, children: "Your data has been successfully imported." })
3240
+ /* @__PURE__ */ c("p", { className: "ff-mb-6", style: { color: "var(--ff-text-muted)" }, children: "Your data has been successfully imported." }),
3241
+ /* @__PURE__ */ w("div", { className: "ff-flex ff-gap-6 ff-mb-6", children: [
3242
+ /* @__PURE__ */ w("div", { className: "ff-text-center ff-px-6 ff-py-3 ff-rounded-xl ff-border", style: { borderColor: "var(--ff-border-light)", backgroundColor: "var(--ff-bg-primary)" }, children: [
3243
+ /* @__PURE__ */ c("p", { className: "ff-text-2xl ff-font-bold", style: { color: "var(--ff-text-primary)" }, children: (A == null ? void 0 : A.totalRows) ?? (d == null ? void 0 : d.totalRows) ?? 0 }),
3244
+ /* @__PURE__ */ c("p", { className: "ff-text-sm", style: { color: "var(--ff-text-muted)" }, children: "Total Rows" })
3245
+ ] }),
3246
+ /* @__PURE__ */ w("div", { className: "ff-text-center ff-px-6 ff-py-3 ff-rounded-xl ff-border", style: { borderColor: "var(--ff-success)", backgroundColor: "var(--ff-success-light)" }, children: [
3247
+ /* @__PURE__ */ c("p", { className: "ff-text-2xl ff-font-bold", style: { color: "var(--ff-success-dark)" }, children: (A == null ? void 0 : A.importedRows) ?? (d == null ? void 0 : d.validRows) ?? 0 }),
3248
+ /* @__PURE__ */ c("p", { className: "ff-text-sm", style: { color: "var(--ff-success)" }, children: "Imported" })
3249
+ ] }),
3250
+ ((A == null ? void 0 : A.skippedRows) ?? 0) > 0 && /* @__PURE__ */ w("div", { className: "ff-text-center ff-px-6 ff-py-3 ff-rounded-xl ff-border", style: { borderColor: "var(--ff-warning)", backgroundColor: "var(--ff-warning-light)" }, children: [
3251
+ /* @__PURE__ */ c("p", { className: "ff-text-2xl ff-font-bold", style: { color: "var(--ff-warning-dark)" }, children: (A == null ? void 0 : A.skippedRows) ?? 0 }),
3252
+ /* @__PURE__ */ c("p", { className: "ff-text-sm", style: { color: "var(--ff-warning)" }, children: "Skipped" })
3253
+ ] }),
3254
+ /* @__PURE__ */ w("div", { className: "ff-text-center ff-px-6 ff-py-3 ff-rounded-xl ff-border", style: { borderColor: "var(--ff-border-light)", backgroundColor: "var(--ff-bg-primary)" }, children: [
3255
+ /* @__PURE__ */ c("p", { className: "ff-text-2xl ff-font-bold", style: { color: "var(--ff-text-primary)" }, children: p.filter((N) => N.targetKey !== null).length }),
3256
+ /* @__PURE__ */ c("p", { className: "ff-text-sm", style: { color: "var(--ff-text-muted)" }, children: "Columns Mapped" })
3257
+ ] })
3258
+ ] }),
3259
+ /* @__PURE__ */ w("div", { className: "ff-flex ff-gap-3", children: [
3260
+ /* @__PURE__ */ c(
3261
+ "button",
3262
+ {
3263
+ onClick: Ge,
3264
+ className: "ff-btn ff-btn-primary",
3265
+ children: "Start New Import"
3266
+ }
3267
+ ),
3268
+ s && /* @__PURE__ */ c("button", { onClick: ie, className: "ff-btn ff-btn-secondary", children: "Close" })
3269
+ ] })
3208
3270
  ] }) })
3209
3271
  ] }),
3210
- u !== "complete" && /* @__PURE__ */ w("div", { className: "ff-modal-footer", children: [
3272
+ /* @__PURE__ */ c("div", { className: "ff-modal-footer", children: u === "complete" ? /* @__PURE__ */ w(ee, { children: [
3273
+ /* @__PURE__ */ c("div", {}),
3274
+ /* @__PURE__ */ c("button", { onClick: Ge, className: "ff-btn ff-btn-primary", children: "Start New Import" })
3275
+ ] }) : /* @__PURE__ */ w(ee, { children: [
3211
3276
  /* @__PURE__ */ c(
3212
3277
  "button",
3213
3278
  {
3214
- onClick: W,
3215
- disabled: ft() === 0 || a,
3216
- className: "ff-btn ff-btn-secondary",
3279
+ onClick: Y,
3280
+ disabled: gt() === 0 || a,
3281
+ className: "ff-btn ff-btn-ghost",
3217
3282
  children: "Back"
3218
3283
  }
3219
3284
  ),
3220
3285
  /* @__PURE__ */ c(
3221
3286
  "button",
3222
3287
  {
3223
- onClick: ct,
3224
- disabled: !dt() || a,
3288
+ onClick: mt,
3289
+ disabled: !pt() || a,
3225
3290
  className: "ff-btn ff-btn-primary",
3226
- children: a ? /* @__PURE__ */ w(re, { children: [
3227
- /* @__PURE__ */ c(ge, { className: "ff-w-4 ff-h-4 ff-animate-spin" }),
3291
+ children: a ? /* @__PURE__ */ w(ee, { children: [
3292
+ /* @__PURE__ */ c(ae, { className: "ff-w-4 ff-h-4 ff-animate-spin" }),
3228
3293
  "Processing..."
3229
3294
  ] }) : u === "review" ? "Complete Import" : "Continue"
3230
3295
  }
3231
3296
  )
3232
- ] })
3297
+ ] }) })
3233
3298
  ] }) });
3234
- return /* @__PURE__ */ c(ce, { theme: n, useShadowDom: r, children: t === "modal" ? /* @__PURE__ */ c("div", { className: "ff-overlay", children: Ae }) : Ae });
3299
+ return /* @__PURE__ */ c(pe, { theme: n, useShadowDom: o, children: t === "modal" ? /* @__PURE__ */ c("div", { className: "ff-overlay", children: Oe }) : Oe });
3235
3300
  };
3236
3301
  export {
3237
- Kt as C,
3238
- Xe as D,
3239
- Bt as F,
3240
- Wn as I,
3241
- We as V,
3242
- Z as u
3302
+ Ut as C,
3303
+ Ye as D,
3304
+ jt as F,
3305
+ Jn as I,
3306
+ Je as V,
3307
+ te as u
3243
3308
  };
3244
- //# sourceMappingURL=ImportWizard-CrUjPf36.mjs.map
3309
+ //# sourceMappingURL=ImportWizard-Dececv65.mjs.map