@fileflow/sdk 0.1.18 → 0.1.19

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,7 +1,7 @@
1
1
  import { jsx as g, jsxs as v, Fragment as oe } from "react/jsx-runtime";
2
2
  import * as Se from "react";
3
- import ut, { useCallback as Me, useState as Y, useMemo as ze, useEffect as Ae } from "react";
4
- import { h as G, j as ft, k as dt, X as se, m as j, U as Xe, n as Ie, T as Re, q as gt, p as Ve, o as Ge, t as ct, d as pt, V as Oe, g as ee, S as de, L as be } from "./index-DnkwOjwi.mjs";
3
+ import ut, { useCallback as Me, useState as Y, useMemo as He, useEffect as Ae } from "react";
4
+ import { h as G, j as ft, k as dt, X as se, m as j, U as Xe, n as Ie, T as Re, q as gt, p as Ve, o as Ge, t as ct, d as pt, V as Oe, g as ee, S as de, L as be } from "./index-oYOmMOWf.mjs";
5
5
  /**
6
6
  * @license lucide-react v0.563.0 - ISC
7
7
  *
@@ -18,7 +18,7 @@ const mt = [
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 vt = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]], wt = G("check", vt);
21
+ const wt = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]], vt = G("check", wt);
22
22
  /**
23
23
  * @license lucide-react v0.563.0 - ISC
24
24
  *
@@ -141,7 +141,7 @@ const Lt = [
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
- ], Ht = G("trash-2", Lt), Be = {
144
+ ], zt = G("trash-2", Lt), Be = {
145
145
  sessionId: null,
146
146
  status: "idle",
147
147
  step: "upload",
@@ -208,54 +208,60 @@ const Lt = [
208
208
  }),
209
209
  stopEditing: () => e({ editingCell: null }),
210
210
  updateCell: (t, n, r) => e((l) => {
211
- const i = [...l.rows], s = i.find((f) => f.rowIndex === t);
212
- s && (s.data = { ...s.data, [n]: String(r) });
213
- const a = new Set(l.editedRows);
214
- return a.add(t), { rows: i, editedRows: a, editingCell: null };
211
+ const i = [...l.rows], a = i.find((f) => f.rowIndex === t);
212
+ a && (a.data = { ...a.data, [n]: String(r) });
213
+ const u = new Set(l.editedRows);
214
+ return u.add(t), { rows: i, editedRows: u, editingCell: null };
215
215
  }),
216
216
  deleteRow: (t) => e((n) => {
217
- const l = n.rows.filter((a) => a.rowIndex !== t).map((a, f) => ({ ...a, rowIndex: f })), i = /* @__PURE__ */ new Map();
218
- n.errorsByRow.forEach((a, f) => {
219
- if (f !== t) {
220
- const p = f > t ? f - 1 : f;
221
- i.set(p, a.map((c) => ({ ...c, rowIndex: p })));
217
+ var h;
218
+ const l = n.rows.filter((w) => w.rowIndex !== t).map((w, C) => ({ ...w, rowIndex: C })), i = /* @__PURE__ */ new Map();
219
+ n.errorsByRow.forEach((w, C) => {
220
+ if (C !== t) {
221
+ const x = C > t ? C - 1 : C;
222
+ i.set(x, w.map((F) => ({ ...F, rowIndex: x })));
222
223
  }
223
224
  });
224
- const s = n.validationResults ? {
225
+ const a = l.length, u = ((h = n.validationResults) == null ? void 0 : h.errors.filter((w) => w.rowIndex !== t).map((w) => ({ ...w, rowIndex: w.rowIndex > t ? w.rowIndex - 1 : w.rowIndex }))) || [], f = u.filter((w) => w.severity === "error").length, p = u.filter((w) => w.severity === "warning").length, c = u.filter((w) => w.severity === "info").length, d = new Set(u.filter((w) => w.severity === "error").map((w) => w.rowIndex)), s = a - d.size, m = n.validationResults ? {
225
226
  ...n.validationResults,
226
- totalRows: n.validationResults.totalRows - 1,
227
- errors: n.validationResults.errors.filter((a) => a.rowIndex !== t).map((a) => ({ ...a, rowIndex: a.rowIndex > t ? a.rowIndex - 1 : a.rowIndex }))
227
+ totalRows: a,
228
+ validRows: s,
229
+ errorCount: f,
230
+ warningCount: p,
231
+ infoCount: c,
232
+ isValid: f === 0,
233
+ errors: u
228
234
  } : null;
229
235
  return {
230
236
  rows: l,
231
237
  totalRows: l.length,
232
238
  errorsByRow: i,
233
- validationResults: s
239
+ validationResults: m
234
240
  };
235
241
  }),
236
242
  setStatus: (t) => e({ status: t }),
237
243
  setLoading: (t) => e({ isLoading: t }),
238
244
  setError: (t) => e({ error: t }),
239
245
  reset: () => e(Be)
240
- })), zt = ({
246
+ })), Ht = ({
241
247
  onFileSelect: e,
242
248
  maxSize: o = 50 * 1024 * 1024,
243
249
  // 50MB
244
250
  acceptedTypes: t = [".csv", ".xlsx", ".xls"]
245
251
  }) => {
246
- const { file: n, fileName: r, fileSize: l, setFile: i, error: s, setError: a, isLoading: f } = J(), p = Me(
247
- (w, R) => {
248
- if (R.length > 0) {
249
- a("Invalid file type or file too large");
252
+ const { file: n, fileName: r, fileSize: l, setFile: i, error: a, setError: u, isLoading: f } = J(), p = Me(
253
+ (w, C) => {
254
+ if (C.length > 0) {
255
+ u("Invalid file type or file too large");
250
256
  return;
251
257
  }
252
258
  if (w.length > 0) {
253
- const _ = w[0];
254
- i(_), e == null || e(_);
259
+ const x = w[0];
260
+ i(x), e == null || e(x);
255
261
  }
256
262
  },
257
- [e, i, a]
258
- ), { getRootProps: c, getInputProps: d, isDragActive: u } = dt({
263
+ [e, i, u]
264
+ ), { getRootProps: c, getInputProps: d, isDragActive: s } = dt({
259
265
  onDrop: p,
260
266
  accept: {
261
267
  "text/csv": [".csv"],
@@ -291,13 +297,13 @@ const Lt = [
291
297
  ...c(),
292
298
  className: j(
293
299
  "ff-dropzone",
294
- u && "ff-dropzone-active",
300
+ s && "ff-dropzone-active",
295
301
  f && "ff-opacity-50 ff-cursor-not-allowed"
296
302
  ),
297
303
  children: [
298
304
  /* @__PURE__ */ g("input", { ...d() }),
299
305
  /* @__PURE__ */ g("div", { className: "ff-dropzone-icon-wrapper", children: /* @__PURE__ */ g(Xe, { className: "ff-dropzone-icon" }) }),
300
- /* @__PURE__ */ g("h3", { className: "ff-dropzone-text", children: u ? "Drop your file here" : "Upload your file" }),
306
+ /* @__PURE__ */ g("h3", { className: "ff-dropzone-text", children: s ? "Drop your file here" : "Upload your file" }),
301
307
  /* @__PURE__ */ g("p", { className: "ff-dropzone-hint", children: "Drag and drop or click to select" }),
302
308
  /* @__PURE__ */ g("label", { className: "ff-inline-block", children: /* @__PURE__ */ g("span", { className: j(
303
309
  "ff-btn ff-btn-primary",
@@ -312,16 +318,16 @@ const Lt = [
312
318
  ]
313
319
  }
314
320
  ),
315
- s && /* @__PURE__ */ v("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: [
321
+ a && /* @__PURE__ */ v("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: [
316
322
  /* @__PURE__ */ g(Ie, { className: "ff-w-4 ff-h-4 ff-flex-shrink-0" }),
317
- /* @__PURE__ */ g("p", { children: s })
323
+ /* @__PURE__ */ g("p", { children: a })
318
324
  ] })
319
325
  ] });
320
326
  }, At = ({ onMappingChange: e }) => {
321
327
  const { mappings: o, schema: t, unmappedSource: n, updateMapping: r } = J(), l = (t == null ? void 0 : t.columns) || [], i = (c, d) => {
322
- const u = d === "" ? null : d;
323
- r(c, u), e == null || e(c, u);
324
- }, s = (c) => c >= 0.85 ? "var(--ff-success)" : c >= 0.6 ? "var(--ff-warning)" : "var(--ff-error)", a = (c) => c >= 0.85 ? "High" : c >= 0.6 ? "Medium" : "Low", p = new Set(
328
+ const s = d === "" ? null : d;
329
+ r(c, s), e == null || e(c, s);
330
+ }, a = (c) => c >= 0.85 ? "var(--ff-success)" : c >= 0.6 ? "var(--ff-warning)" : "var(--ff-error)", u = (c) => c >= 0.85 ? "High" : c >= 0.6 ? "Medium" : "Low", p = new Set(
325
331
  o.filter((c) => c.targetKey !== null).map((c) => c.targetKey)
326
332
  );
327
333
  return /* @__PURE__ */ v("div", { className: "ff-space-y-4", children: [
@@ -347,14 +353,14 @@ const Lt = [
347
353
  ] }),
348
354
  /* @__PURE__ */ g("div", { className: "ff-space-y-2", children: o.map((c) => {
349
355
  l.find((m) => m.key === c.targetKey);
350
- const d = c.targetKey !== null, u = c.confidence >= 0.85;
356
+ const d = c.targetKey !== null, s = c.confidence >= 0.85;
351
357
  return /* @__PURE__ */ v(
352
358
  "div",
353
359
  {
354
360
  className: j(
355
361
  "ff-mapping-row",
356
- d && u && "ff-mapping-row-success",
357
- d && !u && "ff-mapping-row-warning"
362
+ d && s && "ff-mapping-row-success",
363
+ d && !s && "ff-mapping-row-warning"
358
364
  ),
359
365
  children: [
360
366
  /* @__PURE__ */ g("div", { className: "ff-flex-1", children: /* @__PURE__ */ g("div", { className: "ff-mapping-source", children: c.sourceColumn }) }),
@@ -385,15 +391,15 @@ const Lt = [
385
391
  ]
386
392
  }
387
393
  ) }),
388
- /* @__PURE__ */ g("div", { className: "ff-mapping-status", children: d ? u ? /* @__PURE__ */ g(wt, { className: "ff-w-5 ff-h-5", style: { color: "var(--ff-success)" } }) : /* @__PURE__ */ g(yt, { className: "ff-w-5 ff-h-5", style: { color: "var(--ff-warning)" } }) : /* @__PURE__ */ g("span", { className: "ff-w-5 ff-h-5" }) }),
389
- c.confidence > 0 && /* @__PURE__ */ v("div", { className: "ff-confidence", style: { color: s(c.confidence) }, children: [
394
+ /* @__PURE__ */ g("div", { className: "ff-mapping-status", children: d ? s ? /* @__PURE__ */ g(vt, { className: "ff-w-5 ff-h-5", style: { color: "var(--ff-success)" } }) : /* @__PURE__ */ g(yt, { className: "ff-w-5 ff-h-5", style: { color: "var(--ff-warning)" } }) : /* @__PURE__ */ g("span", { className: "ff-w-5 ff-h-5" }) }),
395
+ c.confidence > 0 && /* @__PURE__ */ v("div", { className: "ff-confidence", style: { color: a(c.confidence) }, children: [
390
396
  /* @__PURE__ */ v("span", { children: [
391
397
  Math.round(c.confidence * 100),
392
398
  "%"
393
399
  ] }),
394
400
  /* @__PURE__ */ v("span", { style: { color: "var(--ff-text-muted)" }, children: [
395
401
  "(",
396
- a(c.confidence),
402
+ u(c.confidence),
397
403
  ")"
398
404
  ] })
399
405
  ] })
@@ -466,23 +472,23 @@ function bt(e, o) {
466
472
  };
467
473
  return n(e), t;
468
474
  }
469
- function C(e, o, t) {
475
+ function S(e, o, t) {
470
476
  let n = [], r;
471
477
  return (l) => {
472
478
  let i;
473
479
  t.key && t.debug && (i = Date.now());
474
- const s = e(l);
475
- if (!(s.length !== n.length || s.some((p, c) => n[c] !== p)))
480
+ const a = e(l);
481
+ if (!(a.length !== n.length || a.some((p, c) => n[c] !== p)))
476
482
  return r;
477
- n = s;
483
+ n = a;
478
484
  let f;
479
- 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()) {
480
- const p = Math.round((Date.now() - i) * 100) / 100, c = Math.round((Date.now() - f) * 100) / 100, d = c / 16, u = (m, h) => {
485
+ if (t.key && t.debug && (f = Date.now()), r = o(...a), t == null || t.onChange == null || t.onChange(r), t.key && t.debug && t != null && t.debug()) {
486
+ const p = Math.round((Date.now() - i) * 100) / 100, c = Math.round((Date.now() - f) * 100) / 100, d = c / 16, s = (m, h) => {
481
487
  for (m = String(m); m.length < h; )
482
488
  m = " " + m;
483
489
  return m;
484
490
  };
485
- console.info(`%c⏱ ${u(c, 5)} /${u(p, 5)} ms`, `
491
+ console.info(`%c⏱ ${s(c, 5)} /${s(p, 5)} ms`, `
486
492
  font-size: .6rem;
487
493
  font-weight: bold;
488
494
  color: hsl(${Math.max(0, Math.min(120 - 120 * d, 120))}deg 100% 31%);`, t == null ? void 0 : t.key);
@@ -490,7 +496,7 @@ function C(e, o, t) {
490
496
  return r;
491
497
  };
492
498
  }
493
- function S(e, o, t, n) {
499
+ function R(e, o, t, n) {
494
500
  return {
495
501
  debug: () => {
496
502
  var r;
@@ -510,14 +516,14 @@ function Bt(e, o, t, n) {
510
516
  column: t,
511
517
  getValue: () => o.getValue(n),
512
518
  renderValue: r,
513
- getContext: C(() => [e, t, o, l], (i, s, a, f) => ({
519
+ getContext: S(() => [e, t, o, l], (i, a, u, f) => ({
514
520
  table: i,
515
- column: s,
516
- row: a,
521
+ column: a,
522
+ row: u,
517
523
  cell: f,
518
524
  getValue: f.getValue,
519
525
  renderValue: f.renderValue
520
- }), S(e.options, "debugCells", "cell.getContext"))
526
+ }), R(e.options, "debugCells", "cell.getContext"))
521
527
  };
522
528
  return e._features.forEach((i) => {
523
529
  i.createCell == null || i.createCell(l, t, o, e);
@@ -525,39 +531,39 @@ function Bt(e, o, t, n) {
525
531
  }
526
532
  function Tt(e, o, t, n) {
527
533
  var r, l;
528
- const s = {
534
+ const a = {
529
535
  ...e._getDefaultColumnDef(),
530
536
  ...o
531
- }, a = s.accessorKey;
532
- let f = (r = (l = s.id) != null ? l : a ? typeof String.prototype.replaceAll == "function" ? a.replaceAll(".", "_") : a.replace(/\./g, "_") : void 0) != null ? r : typeof s.header == "string" ? s.header : void 0, p;
533
- if (s.accessorFn ? p = s.accessorFn : a && (a.includes(".") ? p = (d) => {
534
- let u = d;
535
- for (const h of a.split(".")) {
537
+ }, u = a.accessorKey;
538
+ let f = (r = (l = a.id) != null ? l : u ? typeof String.prototype.replaceAll == "function" ? u.replaceAll(".", "_") : u.replace(/\./g, "_") : void 0) != null ? r : typeof a.header == "string" ? a.header : void 0, p;
539
+ if (a.accessorFn ? p = a.accessorFn : u && (u.includes(".") ? p = (d) => {
540
+ let s = d;
541
+ for (const h of u.split(".")) {
536
542
  var m;
537
- u = (m = u) == null ? void 0 : m[h], process.env.NODE_ENV !== "production" && u === void 0 && console.warn(`"${h}" in deeply nested key "${a}" returned undefined.`);
543
+ s = (m = s) == null ? void 0 : m[h], process.env.NODE_ENV !== "production" && s === void 0 && console.warn(`"${h}" in deeply nested key "${u}" returned undefined.`);
538
544
  }
539
- return u;
540
- } : p = (d) => d[s.accessorKey]), !f)
541
- 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();
545
+ return s;
546
+ } : p = (d) => d[a.accessorKey]), !f)
547
+ throw process.env.NODE_ENV !== "production" ? new Error(a.accessorFn ? "Columns require an id when using an accessorFn" : "Columns require an id when using a non-string header") : new Error();
542
548
  let c = {
543
549
  id: `${String(f)}`,
544
550
  accessorFn: p,
545
551
  parent: n,
546
552
  depth: t,
547
- columnDef: s,
553
+ columnDef: a,
548
554
  columns: [],
549
- getFlatColumns: C(() => [!0], () => {
555
+ getFlatColumns: S(() => [!0], () => {
550
556
  var d;
551
- return [c, ...(d = c.columns) == null ? void 0 : d.flatMap((u) => u.getFlatColumns())];
552
- }, S(e.options, "debugColumns", "column.getFlatColumns")),
553
- getLeafColumns: C(() => [e._getOrderColumnsFn()], (d) => {
554
- var u;
555
- if ((u = c.columns) != null && u.length) {
557
+ return [c, ...(d = c.columns) == null ? void 0 : d.flatMap((s) => s.getFlatColumns())];
558
+ }, R(e.options, "debugColumns", "column.getFlatColumns")),
559
+ getLeafColumns: S(() => [e._getOrderColumnsFn()], (d) => {
560
+ var s;
561
+ if ((s = c.columns) != null && s.length) {
556
562
  let m = c.columns.flatMap((h) => h.getLeafColumns());
557
563
  return d(m);
558
564
  }
559
565
  return [c];
560
- }, S(e.options, "debugColumns", "column.getLeafColumns"))
566
+ }, R(e.options, "debugColumns", "column.getLeafColumns"))
561
567
  };
562
568
  for (const d of e._features)
563
569
  d.createColumn == null || d.createColumn(c, e);
@@ -578,10 +584,10 @@ function Te(e, o, t) {
578
584
  rowSpan: 0,
579
585
  headerGroup: null,
580
586
  getLeafHeaders: () => {
581
- const i = [], s = (a) => {
582
- a.subHeaders && a.subHeaders.length && a.subHeaders.map(s), i.push(a);
587
+ const i = [], a = (u) => {
588
+ u.subHeaders && u.subHeaders.length && u.subHeaders.map(a), i.push(u);
583
589
  };
584
- return s(l), i;
590
+ return a(l), i;
585
591
  },
586
592
  getContext: () => ({
587
593
  table: e,
@@ -595,91 +601,91 @@ function Te(e, o, t) {
595
601
  }
596
602
  const qt = {
597
603
  createTable: (e) => {
598
- e.getHeaderGroups = C(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.left, e.getState().columnPinning.right], (o, t, n, r) => {
604
+ e.getHeaderGroups = S(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.left, e.getState().columnPinning.right], (o, t, n, r) => {
599
605
  var l, i;
600
- const s = (l = n == null ? void 0 : n.map((c) => t.find((d) => d.id === c)).filter(Boolean)) != null ? l : [], a = (i = r == null ? void 0 : r.map((c) => t.find((d) => d.id === c)).filter(Boolean)) != null ? i : [], f = t.filter((c) => !(n != null && n.includes(c.id)) && !(r != null && r.includes(c.id)));
601
- return re(o, [...s, ...f, ...a], e);
602
- }, S(e.options, P, "getHeaderGroups")), e.getCenterHeaderGroups = C(() => [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))), re(o, t, e, "center")), S(e.options, P, "getCenterHeaderGroups")), e.getLeftHeaderGroups = C(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.left], (o, t, n) => {
606
+ const a = (l = n == null ? void 0 : n.map((c) => t.find((d) => d.id === c)).filter(Boolean)) != null ? l : [], u = (i = r == null ? void 0 : r.map((c) => t.find((d) => d.id === c)).filter(Boolean)) != null ? i : [], f = t.filter((c) => !(n != null && n.includes(c.id)) && !(r != null && r.includes(c.id)));
607
+ return re(o, [...a, ...f, ...u], e);
608
+ }, R(e.options, P, "getHeaderGroups")), e.getCenterHeaderGroups = S(() => [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))), re(o, t, e, "center")), R(e.options, P, "getCenterHeaderGroups")), e.getLeftHeaderGroups = S(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.left], (o, t, n) => {
603
609
  var r;
604
- const l = (r = n == null ? void 0 : n.map((i) => t.find((s) => s.id === i)).filter(Boolean)) != null ? r : [];
610
+ const l = (r = n == null ? void 0 : n.map((i) => t.find((a) => a.id === i)).filter(Boolean)) != null ? r : [];
605
611
  return re(o, l, e, "left");
606
- }, S(e.options, P, "getLeftHeaderGroups")), e.getRightHeaderGroups = C(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.right], (o, t, n) => {
612
+ }, R(e.options, P, "getLeftHeaderGroups")), e.getRightHeaderGroups = S(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.right], (o, t, n) => {
607
613
  var r;
608
- const l = (r = n == null ? void 0 : n.map((i) => t.find((s) => s.id === i)).filter(Boolean)) != null ? r : [];
614
+ const l = (r = n == null ? void 0 : n.map((i) => t.find((a) => a.id === i)).filter(Boolean)) != null ? r : [];
609
615
  return re(o, l, e, "right");
610
- }, S(e.options, P, "getRightHeaderGroups")), e.getFooterGroups = C(() => [e.getHeaderGroups()], (o) => [...o].reverse(), S(e.options, P, "getFooterGroups")), e.getLeftFooterGroups = C(() => [e.getLeftHeaderGroups()], (o) => [...o].reverse(), S(e.options, P, "getLeftFooterGroups")), e.getCenterFooterGroups = C(() => [e.getCenterHeaderGroups()], (o) => [...o].reverse(), S(e.options, P, "getCenterFooterGroups")), e.getRightFooterGroups = C(() => [e.getRightHeaderGroups()], (o) => [...o].reverse(), S(e.options, P, "getRightFooterGroups")), e.getFlatHeaders = C(() => [e.getHeaderGroups()], (o) => o.map((t) => t.headers).flat(), S(e.options, P, "getFlatHeaders")), e.getLeftFlatHeaders = C(() => [e.getLeftHeaderGroups()], (o) => o.map((t) => t.headers).flat(), S(e.options, P, "getLeftFlatHeaders")), e.getCenterFlatHeaders = C(() => [e.getCenterHeaderGroups()], (o) => o.map((t) => t.headers).flat(), S(e.options, P, "getCenterFlatHeaders")), e.getRightFlatHeaders = C(() => [e.getRightHeaderGroups()], (o) => o.map((t) => t.headers).flat(), S(e.options, P, "getRightFlatHeaders")), e.getCenterLeafHeaders = C(() => [e.getCenterFlatHeaders()], (o) => o.filter((t) => {
616
+ }, R(e.options, P, "getRightHeaderGroups")), e.getFooterGroups = S(() => [e.getHeaderGroups()], (o) => [...o].reverse(), R(e.options, P, "getFooterGroups")), e.getLeftFooterGroups = S(() => [e.getLeftHeaderGroups()], (o) => [...o].reverse(), R(e.options, P, "getLeftFooterGroups")), e.getCenterFooterGroups = S(() => [e.getCenterHeaderGroups()], (o) => [...o].reverse(), R(e.options, P, "getCenterFooterGroups")), e.getRightFooterGroups = S(() => [e.getRightHeaderGroups()], (o) => [...o].reverse(), R(e.options, P, "getRightFooterGroups")), e.getFlatHeaders = S(() => [e.getHeaderGroups()], (o) => o.map((t) => t.headers).flat(), R(e.options, P, "getFlatHeaders")), e.getLeftFlatHeaders = S(() => [e.getLeftHeaderGroups()], (o) => o.map((t) => t.headers).flat(), R(e.options, P, "getLeftFlatHeaders")), e.getCenterFlatHeaders = S(() => [e.getCenterHeaderGroups()], (o) => o.map((t) => t.headers).flat(), R(e.options, P, "getCenterFlatHeaders")), e.getRightFlatHeaders = S(() => [e.getRightHeaderGroups()], (o) => o.map((t) => t.headers).flat(), R(e.options, P, "getRightFlatHeaders")), e.getCenterLeafHeaders = S(() => [e.getCenterFlatHeaders()], (o) => o.filter((t) => {
611
617
  var n;
612
618
  return !((n = t.subHeaders) != null && n.length);
613
- }), S(e.options, P, "getCenterLeafHeaders")), e.getLeftLeafHeaders = C(() => [e.getLeftFlatHeaders()], (o) => o.filter((t) => {
619
+ }), R(e.options, P, "getCenterLeafHeaders")), e.getLeftLeafHeaders = S(() => [e.getLeftFlatHeaders()], (o) => o.filter((t) => {
614
620
  var n;
615
621
  return !((n = t.subHeaders) != null && n.length);
616
- }), S(e.options, P, "getLeftLeafHeaders")), e.getRightLeafHeaders = C(() => [e.getRightFlatHeaders()], (o) => o.filter((t) => {
622
+ }), R(e.options, P, "getLeftLeafHeaders")), e.getRightLeafHeaders = S(() => [e.getRightFlatHeaders()], (o) => o.filter((t) => {
617
623
  var n;
618
624
  return !((n = t.subHeaders) != null && n.length);
619
- }), S(e.options, P, "getRightLeafHeaders")), e.getLeafHeaders = C(() => [e.getLeftHeaderGroups(), e.getCenterHeaderGroups(), e.getRightHeaderGroups()], (o, t, n) => {
620
- var r, l, i, s, a, f;
621
- return [...(r = (l = o[0]) == null ? void 0 : l.headers) != null ? r : [], ...(i = (s = t[0]) == null ? void 0 : s.headers) != null ? i : [], ...(a = (f = n[0]) == null ? void 0 : f.headers) != null ? a : []].map((p) => p.getLeafHeaders()).flat();
622
- }, S(e.options, P, "getLeafHeaders"));
625
+ }), R(e.options, P, "getRightLeafHeaders")), e.getLeafHeaders = S(() => [e.getLeftHeaderGroups(), e.getCenterHeaderGroups(), e.getRightHeaderGroups()], (o, t, n) => {
626
+ var r, l, i, a, u, f;
627
+ return [...(r = (l = o[0]) == null ? void 0 : l.headers) != null ? r : [], ...(i = (a = t[0]) == null ? void 0 : a.headers) != null ? i : [], ...(u = (f = n[0]) == null ? void 0 : f.headers) != null ? u : []].map((p) => p.getLeafHeaders()).flat();
628
+ }, R(e.options, P, "getLeafHeaders"));
623
629
  }
624
630
  };
625
631
  function re(e, o, t, n) {
626
632
  var r, l;
627
633
  let i = 0;
628
- const s = function(d, u) {
629
- u === void 0 && (u = 1), i = Math.max(i, u), d.filter((m) => m.getIsVisible()).forEach((m) => {
634
+ const a = function(d, s) {
635
+ s === void 0 && (s = 1), i = Math.max(i, s), d.filter((m) => m.getIsVisible()).forEach((m) => {
630
636
  var h;
631
- (h = m.columns) != null && h.length && s(m.columns, u + 1);
637
+ (h = m.columns) != null && h.length && a(m.columns, s + 1);
632
638
  }, 0);
633
639
  };
634
- s(e);
635
- let a = [];
636
- const f = (d, u) => {
640
+ a(e);
641
+ let u = [];
642
+ const f = (d, s) => {
637
643
  const m = {
638
- depth: u,
639
- id: [n, `${u}`].filter(Boolean).join("_"),
644
+ depth: s,
645
+ id: [n, `${s}`].filter(Boolean).join("_"),
640
646
  headers: []
641
647
  }, h = [];
642
648
  d.forEach((w) => {
643
- const R = [...h].reverse()[0], _ = w.column.depth === m.depth;
644
- let $, E = !1;
645
- if (_ && w.column.parent ? $ = w.column.parent : ($ = w.column, E = !0), R && (R == null ? void 0 : R.column) === $)
646
- R.subHeaders.push(w);
649
+ const C = [...h].reverse()[0], x = w.column.depth === m.depth;
650
+ let F, E = !1;
651
+ if (x && w.column.parent ? F = w.column.parent : (F = w.column, E = !0), C && (C == null ? void 0 : C.column) === F)
652
+ C.subHeaders.push(w);
647
653
  else {
648
- const I = Te(t, $, {
649
- id: [n, u, $.id, w == null ? void 0 : w.id].filter(Boolean).join("_"),
654
+ const I = Te(t, F, {
655
+ id: [n, s, F.id, w == null ? void 0 : w.id].filter(Boolean).join("_"),
650
656
  isPlaceholder: E,
651
- placeholderId: E ? `${h.filter((D) => D.column === $).length}` : void 0,
652
- depth: u,
657
+ placeholderId: E ? `${h.filter((D) => D.column === F).length}` : void 0,
658
+ depth: s,
653
659
  index: h.length
654
660
  });
655
661
  I.subHeaders.push(w), h.push(I);
656
662
  }
657
663
  m.headers.push(w), w.headerGroup = m;
658
- }), a.push(m), u > 0 && f(h, u - 1);
659
- }, p = o.map((d, u) => Te(t, d, {
664
+ }), u.push(m), s > 0 && f(h, s - 1);
665
+ }, p = o.map((d, s) => Te(t, d, {
660
666
  depth: i,
661
- index: u
667
+ index: s
662
668
  }));
663
- f(p, i - 1), a.reverse();
669
+ f(p, i - 1), u.reverse();
664
670
  const c = (d) => d.filter((m) => m.column.getIsVisible()).map((m) => {
665
- let h = 0, w = 0, R = [0];
666
- m.subHeaders && m.subHeaders.length ? (R = [], c(m.subHeaders).forEach(($) => {
671
+ let h = 0, w = 0, C = [0];
672
+ m.subHeaders && m.subHeaders.length ? (C = [], c(m.subHeaders).forEach((F) => {
667
673
  let {
668
674
  colSpan: E,
669
675
  rowSpan: I
670
- } = $;
671
- h += E, R.push(I);
676
+ } = F;
677
+ h += E, C.push(I);
672
678
  })) : h = 1;
673
- const _ = Math.min(...R);
674
- return w = w + _, m.colSpan = h, m.rowSpan = w, {
679
+ const x = Math.min(...C);
680
+ return w = w + x, m.colSpan = h, m.rowSpan = w, {
675
681
  colSpan: h,
676
682
  rowSpan: w
677
683
  };
678
684
  });
679
- return c((r = (l = a[0]) == null ? void 0 : l.headers) != null ? r : []), a;
685
+ return c((r = (l = u[0]) == null ? void 0 : l.headers) != null ? r : []), u;
680
686
  }
681
687
  const Ne = (e, o, t, n, r, l, i) => {
682
- let s = {
688
+ let a = {
683
689
  id: o,
684
690
  index: n,
685
691
  original: t,
@@ -687,44 +693,44 @@ const Ne = (e, o, t, n, r, l, i) => {
687
693
  parentId: i,
688
694
  _valuesCache: {},
689
695
  _uniqueValuesCache: {},
690
- getValue: (a) => {
691
- if (s._valuesCache.hasOwnProperty(a))
692
- return s._valuesCache[a];
693
- const f = e.getColumn(a);
696
+ getValue: (u) => {
697
+ if (a._valuesCache.hasOwnProperty(u))
698
+ return a._valuesCache[u];
699
+ const f = e.getColumn(u);
694
700
  if (f != null && f.accessorFn)
695
- return s._valuesCache[a] = f.accessorFn(s.original, n), s._valuesCache[a];
701
+ return a._valuesCache[u] = f.accessorFn(a.original, n), a._valuesCache[u];
696
702
  },
697
- getUniqueValues: (a) => {
698
- if (s._uniqueValuesCache.hasOwnProperty(a))
699
- return s._uniqueValuesCache[a];
700
- const f = e.getColumn(a);
703
+ getUniqueValues: (u) => {
704
+ if (a._uniqueValuesCache.hasOwnProperty(u))
705
+ return a._uniqueValuesCache[u];
706
+ const f = e.getColumn(u);
701
707
  if (f != null && f.accessorFn)
702
- return f.columnDef.getUniqueValues ? (s._uniqueValuesCache[a] = f.columnDef.getUniqueValues(s.original, n), s._uniqueValuesCache[a]) : (s._uniqueValuesCache[a] = [s.getValue(a)], s._uniqueValuesCache[a]);
708
+ return f.columnDef.getUniqueValues ? (a._uniqueValuesCache[u] = f.columnDef.getUniqueValues(a.original, n), a._uniqueValuesCache[u]) : (a._uniqueValuesCache[u] = [a.getValue(u)], a._uniqueValuesCache[u]);
703
709
  },
704
- renderValue: (a) => {
710
+ renderValue: (u) => {
705
711
  var f;
706
- return (f = s.getValue(a)) != null ? f : e.options.renderFallbackValue;
712
+ return (f = a.getValue(u)) != null ? f : e.options.renderFallbackValue;
707
713
  },
708
714
  subRows: [],
709
- getLeafRows: () => bt(s.subRows, (a) => a.subRows),
710
- getParentRow: () => s.parentId ? e.getRow(s.parentId, !0) : void 0,
715
+ getLeafRows: () => bt(a.subRows, (u) => u.subRows),
716
+ getParentRow: () => a.parentId ? e.getRow(a.parentId, !0) : void 0,
711
717
  getParentRows: () => {
712
- let a = [], f = s;
718
+ let u = [], f = a;
713
719
  for (; ; ) {
714
720
  const p = f.getParentRow();
715
721
  if (!p) break;
716
- a.push(p), f = p;
722
+ u.push(p), f = p;
717
723
  }
718
- return a.reverse();
724
+ return u.reverse();
719
725
  },
720
- getAllCells: C(() => [e.getAllLeafColumns()], (a) => a.map((f) => Bt(e, s, f, f.id)), S(e.options, "debugRows", "getAllCells")),
721
- _getAllCellsByColumnId: C(() => [s.getAllCells()], (a) => a.reduce((f, p) => (f[p.column.id] = p, f), {}), S(e.options, "debugRows", "getAllCellsByColumnId"))
726
+ getAllCells: S(() => [e.getAllLeafColumns()], (u) => u.map((f) => Bt(e, a, f, f.id)), R(e.options, "debugRows", "getAllCells")),
727
+ _getAllCellsByColumnId: S(() => [a.getAllCells()], (u) => u.reduce((f, p) => (f[p.column.id] = p, f), {}), R(e.options, "debugRows", "getAllCellsByColumnId"))
722
728
  };
723
- for (let a = 0; a < e._features.length; a++) {
724
- const f = e._features[a];
725
- f == null || f.createRow == null || f.createRow(s, e);
729
+ for (let u = 0; u < e._features.length; u++) {
730
+ const f = e._features[u];
731
+ f == null || f.createRow == null || f.createRow(a, e);
726
732
  }
727
- return s;
733
+ return a;
728
734
  }, jt = {
729
735
  createColumn: (e, o) => {
730
736
  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 = () => {
@@ -775,8 +781,8 @@ const Pe = (e, o, t) => {
775
781
  Pe.resolveFilterValue = (e) => {
776
782
  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;
777
783
  if (l > i) {
778
- const s = l;
779
- l = i, i = s;
784
+ const a = l;
785
+ l = i, i = a;
780
786
  }
781
787
  return [l, i];
782
788
  };
@@ -831,18 +837,18 @@ const Ut = {
831
837
  o.setColumnFilters((n) => {
832
838
  const r = e.getFilterFn(), l = n == null ? void 0 : n.find((p) => p.id === e.id), i = q(t, l ? l.value : void 0);
833
839
  if (qe(r, i, e)) {
834
- var s;
835
- return (s = n == null ? void 0 : n.filter((p) => p.id !== e.id)) != null ? s : [];
840
+ var a;
841
+ return (a = n == null ? void 0 : n.filter((p) => p.id !== e.id)) != null ? a : [];
836
842
  }
837
- const a = {
843
+ const u = {
838
844
  id: e.id,
839
845
  value: i
840
846
  };
841
847
  if (l) {
842
848
  var f;
843
- return (f = n == null ? void 0 : n.map((p) => p.id === e.id ? a : p)) != null ? f : [];
849
+ return (f = n == null ? void 0 : n.map((p) => p.id === e.id ? u : p)) != null ? f : [];
844
850
  }
845
- return n != null && n.length ? [...n, a] : [a];
851
+ return n != null && n.length ? [...n, u] : [u];
846
852
  });
847
853
  };
848
854
  },
@@ -854,10 +860,10 @@ const Ut = {
854
860
  const t = e.getAllLeafColumns(), n = (r) => {
855
861
  var l;
856
862
  return (l = q(o, r)) == null ? void 0 : l.filter((i) => {
857
- const s = t.find((a) => a.id === i.id);
858
- if (s) {
859
- const a = s.getFilterFn();
860
- if (qe(a, i.value, s))
863
+ const a = t.find((u) => u.id === i.id);
864
+ if (a) {
865
+ const u = a.getFilterFn();
866
+ if (qe(u, i.value, a))
861
867
  return !1;
862
868
  }
863
869
  return !0;
@@ -1002,7 +1008,7 @@ const rn = {
1002
1008
  onColumnOrderChange: L("columnOrder", e)
1003
1009
  }),
1004
1010
  createColumn: (e, o) => {
1005
- e.getIndex = C((t) => [ne(o, t)], (t) => t.findIndex((n) => n.id === e.id), S(o.options, "debugColumns", "getIndex")), e.getIsFirstColumn = (t) => {
1011
+ e.getIndex = S((t) => [ne(o, t)], (t) => t.findIndex((n) => n.id === e.id), R(o.options, "debugColumns", "getIndex")), e.getIsFirstColumn = (t) => {
1006
1012
  var n;
1007
1013
  return ((n = ne(o, t)[0]) == null ? void 0 : n.id) === e.id;
1008
1014
  }, e.getIsLastColumn = (t) => {
@@ -1015,20 +1021,20 @@ const rn = {
1015
1021
  e.setColumnOrder = (o) => e.options.onColumnOrderChange == null ? void 0 : e.options.onColumnOrderChange(o), e.resetColumnOrder = (o) => {
1016
1022
  var t;
1017
1023
  e.setColumnOrder(o ? [] : (t = e.initialState.columnOrder) != null ? t : []);
1018
- }, e._getOrderColumnsFn = C(() => [e.getState().columnOrder, e.getState().grouping, e.options.groupedColumnMode], (o, t, n) => (r) => {
1024
+ }, e._getOrderColumnsFn = S(() => [e.getState().columnOrder, e.getState().grouping, e.options.groupedColumnMode], (o, t, n) => (r) => {
1019
1025
  let l = [];
1020
1026
  if (!(o != null && o.length))
1021
1027
  l = r;
1022
1028
  else {
1023
- const i = [...o], s = [...r];
1024
- for (; s.length && i.length; ) {
1025
- const a = i.shift(), f = s.findIndex((p) => p.id === a);
1026
- f > -1 && l.push(s.splice(f, 1)[0]);
1029
+ const i = [...o], a = [...r];
1030
+ for (; a.length && i.length; ) {
1031
+ const u = i.shift(), f = a.findIndex((p) => p.id === u);
1032
+ f > -1 && l.push(a.splice(f, 1)[0]);
1027
1033
  }
1028
- l = [...l, ...s];
1034
+ l = [...l, ...a];
1029
1035
  }
1030
1036
  return on(l, t, n);
1031
- }, S(e.options, "debugTable", "_getOrderColumnsFn"));
1037
+ }, R(e.options, "debugTable", "_getOrderColumnsFn"));
1032
1038
  }
1033
1039
  }, ce = () => ({
1034
1040
  left: [],
@@ -1047,10 +1053,10 @@ const rn = {
1047
1053
  o.setColumnPinning((r) => {
1048
1054
  var l, i;
1049
1055
  if (t === "right") {
1050
- var s, a;
1056
+ var a, u;
1051
1057
  return {
1052
- left: ((s = r == null ? void 0 : r.left) != null ? s : []).filter((c) => !(n != null && n.includes(c))),
1053
- right: [...((a = r == null ? void 0 : r.right) != null ? a : []).filter((c) => !(n != null && n.includes(c))), ...n]
1058
+ left: ((a = r == null ? void 0 : r.left) != null ? a : []).filter((c) => !(n != null && n.includes(c))),
1059
+ right: [...((u = r == null ? void 0 : r.right) != null ? u : []).filter((c) => !(n != null && n.includes(c))), ...n]
1054
1060
  };
1055
1061
  }
1056
1062
  if (t === "left") {
@@ -1069,10 +1075,10 @@ const rn = {
1069
1075
  var r, l, i;
1070
1076
  return ((r = n.columnDef.enablePinning) != null ? r : !0) && ((l = (i = o.options.enableColumnPinning) != null ? i : o.options.enablePinning) != null ? l : !0);
1071
1077
  }), e.getIsPinned = () => {
1072
- const t = e.getLeafColumns().map((s) => s.id), {
1078
+ const t = e.getLeafColumns().map((a) => a.id), {
1073
1079
  left: n,
1074
1080
  right: r
1075
- } = 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));
1081
+ } = o.getState().columnPinning, l = t.some((a) => n == null ? void 0 : n.includes(a)), i = t.some((a) => r == null ? void 0 : r.includes(a));
1076
1082
  return l ? "left" : i ? "right" : !1;
1077
1083
  }, e.getPinnedIndex = () => {
1078
1084
  var t, n;
@@ -1081,16 +1087,16 @@ const rn = {
1081
1087
  };
1082
1088
  },
1083
1089
  createRow: (e, o) => {
1084
- e.getCenterVisibleCells = C(() => [e._getAllVisibleCells(), o.getState().columnPinning.left, o.getState().columnPinning.right], (t, n, r) => {
1090
+ e.getCenterVisibleCells = S(() => [e._getAllVisibleCells(), o.getState().columnPinning.left, o.getState().columnPinning.right], (t, n, r) => {
1085
1091
  const l = [...n ?? [], ...r ?? []];
1086
1092
  return t.filter((i) => !l.includes(i.column.id));
1087
- }, S(o.options, "debugRows", "getCenterVisibleCells")), e.getLeftVisibleCells = C(() => [e._getAllVisibleCells(), o.getState().columnPinning.left], (t, n) => (n ?? []).map((l) => t.find((i) => i.column.id === l)).filter(Boolean).map((l) => ({
1093
+ }, R(o.options, "debugRows", "getCenterVisibleCells")), e.getLeftVisibleCells = S(() => [e._getAllVisibleCells(), o.getState().columnPinning.left], (t, n) => (n ?? []).map((l) => t.find((i) => i.column.id === l)).filter(Boolean).map((l) => ({
1088
1094
  ...l,
1089
1095
  position: "left"
1090
- })), S(o.options, "debugRows", "getLeftVisibleCells")), e.getRightVisibleCells = C(() => [e._getAllVisibleCells(), o.getState().columnPinning.right], (t, n) => (n ?? []).map((l) => t.find((i) => i.column.id === l)).filter(Boolean).map((l) => ({
1096
+ })), R(o.options, "debugRows", "getLeftVisibleCells")), e.getRightVisibleCells = S(() => [e._getAllVisibleCells(), o.getState().columnPinning.right], (t, n) => (n ?? []).map((l) => t.find((i) => i.column.id === l)).filter(Boolean).map((l) => ({
1091
1097
  ...l,
1092
1098
  position: "right"
1093
- })), S(o.options, "debugRows", "getRightVisibleCells"));
1099
+ })), R(o.options, "debugRows", "getRightVisibleCells"));
1094
1100
  },
1095
1101
  createTable: (e) => {
1096
1102
  e.setColumnPinning = (o) => e.options.onColumnPinningChange == null ? void 0 : e.options.onColumnPinningChange(o), e.resetColumnPinning = (o) => {
@@ -1104,10 +1110,10 @@ const rn = {
1104
1110
  return !!((r = n.left) != null && r.length || (l = n.right) != null && l.length);
1105
1111
  }
1106
1112
  return !!((t = n[o]) != null && t.length);
1107
- }, e.getLeftLeafColumns = C(() => [e.getAllLeafColumns(), e.getState().columnPinning.left], (o, t) => (t ?? []).map((n) => o.find((r) => r.id === n)).filter(Boolean), S(e.options, "debugColumns", "getLeftLeafColumns")), e.getRightLeafColumns = C(() => [e.getAllLeafColumns(), e.getState().columnPinning.right], (o, t) => (t ?? []).map((n) => o.find((r) => r.id === n)).filter(Boolean), S(e.options, "debugColumns", "getRightLeafColumns")), e.getCenterLeafColumns = C(() => [e.getAllLeafColumns(), e.getState().columnPinning.left, e.getState().columnPinning.right], (o, t, n) => {
1113
+ }, e.getLeftLeafColumns = S(() => [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 = S(() => [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 = S(() => [e.getAllLeafColumns(), e.getState().columnPinning.left, e.getState().columnPinning.right], (o, t, n) => {
1108
1114
  const r = [...t ?? [], ...n ?? []];
1109
1115
  return o.filter((l) => !r.includes(l.id));
1110
- }, S(e.options, "debugColumns", "getCenterLeafColumns"));
1116
+ }, R(e.options, "debugColumns", "getCenterLeafColumns"));
1111
1117
  }
1112
1118
  };
1113
1119
  function sn(e) {
@@ -1142,7 +1148,7 @@ const le = {
1142
1148
  var t, n, r;
1143
1149
  const l = o.getState().columnSizing[e.id];
1144
1150
  return Math.min(Math.max((t = e.columnDef.minSize) != null ? t : le.minSize, (n = l ?? e.columnDef.size) != null ? n : le.size), (r = e.columnDef.maxSize) != null ? r : le.maxSize);
1145
- }, e.getStart = C((t) => [t, ne(o, t), o.getState().columnSizing], (t, n) => n.slice(0, e.getIndex(t)).reduce((r, l) => r + l.getSize(), 0), S(o.options, "debugColumns", "getStart")), e.getAfter = C((t) => [t, ne(o, t), o.getState().columnSizing], (t, n) => n.slice(e.getIndex(t) + 1).reduce((r, l) => r + l.getSize(), 0), S(o.options, "debugColumns", "getAfter")), e.resetSize = () => {
1151
+ }, e.getStart = S((t) => [t, ne(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 = S((t) => [t, ne(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 = () => {
1146
1152
  o.setColumnSizing((t) => {
1147
1153
  let {
1148
1154
  [e.id]: n,
@@ -1178,25 +1184,25 @@ const le = {
1178
1184
  return (l) => {
1179
1185
  if (!n || !r || (l.persist == null || l.persist(), me(l) && l.touches && l.touches.length > 1))
1180
1186
  return;
1181
- const i = e.getSize(), s = e ? e.getLeafHeaders().map((R) => [R.column.id, R.column.getSize()]) : [[n.id, n.getSize()]], a = me(l) ? Math.round(l.touches[0].clientX) : l.clientX, f = {}, p = (R, _) => {
1182
- typeof _ == "number" && (o.setColumnSizingInfo(($) => {
1187
+ const i = e.getSize(), a = e ? e.getLeafHeaders().map((C) => [C.column.id, C.column.getSize()]) : [[n.id, n.getSize()]], u = me(l) ? Math.round(l.touches[0].clientX) : l.clientX, f = {}, p = (C, x) => {
1188
+ typeof x == "number" && (o.setColumnSizingInfo((F) => {
1183
1189
  var E, I;
1184
- const D = o.options.columnResizeDirection === "rtl" ? -1 : 1, K = (_ - ((E = $ == null ? void 0 : $.startOffset) != null ? E : 0)) * D, N = Math.max(K / ((I = $ == null ? void 0 : $.startSize) != null ? I : 0), -0.999999);
1185
- return $.columnSizingStart.forEach((z) => {
1186
- let [T, O] = z;
1190
+ const D = o.options.columnResizeDirection === "rtl" ? -1 : 1, K = (x - ((E = F == null ? void 0 : F.startOffset) != null ? E : 0)) * D, N = Math.max(K / ((I = F == null ? void 0 : F.startSize) != null ? I : 0), -0.999999);
1191
+ return F.columnSizingStart.forEach((H) => {
1192
+ let [T, O] = H;
1187
1193
  f[T] = Math.round(Math.max(O + O * N, 0) * 100) / 100;
1188
1194
  }), {
1189
- ...$,
1195
+ ...F,
1190
1196
  deltaOffset: K,
1191
1197
  deltaPercentage: N
1192
1198
  };
1193
- }), (o.options.columnResizeMode === "onChange" || R === "end") && o.setColumnSizing(($) => ({
1194
- ...$,
1199
+ }), (o.options.columnResizeMode === "onChange" || C === "end") && o.setColumnSizing((F) => ({
1200
+ ...F,
1195
1201
  ...f
1196
1202
  })));
1197
- }, c = (R) => p("move", R), d = (R) => {
1198
- p("end", R), o.setColumnSizingInfo((_) => ({
1199
- ..._,
1203
+ }, c = (C) => p("move", C), d = (C) => {
1204
+ p("end", C), o.setColumnSizingInfo((x) => ({
1205
+ ...x,
1200
1206
  isResizingColumn: !1,
1201
1207
  startOffset: null,
1202
1208
  startSize: null,
@@ -1204,27 +1210,27 @@ const le = {
1204
1210
  deltaPercentage: null,
1205
1211
  columnSizingStart: []
1206
1212
  }));
1207
- }, u = sn(t), m = {
1208
- moveHandler: (R) => c(R.clientX),
1209
- upHandler: (R) => {
1210
- u == null || u.removeEventListener("mousemove", m.moveHandler), u == null || u.removeEventListener("mouseup", m.upHandler), d(R.clientX);
1213
+ }, s = sn(t), m = {
1214
+ moveHandler: (C) => c(C.clientX),
1215
+ upHandler: (C) => {
1216
+ s == null || s.removeEventListener("mousemove", m.moveHandler), s == null || s.removeEventListener("mouseup", m.upHandler), d(C.clientX);
1211
1217
  }
1212
1218
  }, h = {
1213
- moveHandler: (R) => (R.cancelable && (R.preventDefault(), R.stopPropagation()), c(R.touches[0].clientX), !1),
1214
- upHandler: (R) => {
1215
- var _;
1216
- u == null || u.removeEventListener("touchmove", h.moveHandler), u == null || u.removeEventListener("touchend", h.upHandler), R.cancelable && (R.preventDefault(), R.stopPropagation()), d((_ = R.touches[0]) == null ? void 0 : _.clientX);
1219
+ moveHandler: (C) => (C.cancelable && (C.preventDefault(), C.stopPropagation()), c(C.touches[0].clientX), !1),
1220
+ upHandler: (C) => {
1221
+ var x;
1222
+ s == null || s.removeEventListener("touchmove", h.moveHandler), s == null || s.removeEventListener("touchend", h.upHandler), C.cancelable && (C.preventDefault(), C.stopPropagation()), d((x = C.touches[0]) == null ? void 0 : x.clientX);
1217
1223
  }
1218
1224
  }, w = un() ? {
1219
1225
  passive: !1
1220
1226
  } : !1;
1221
- me(l) ? (u == null || u.addEventListener("touchmove", h.moveHandler, w), u == null || u.addEventListener("touchend", h.upHandler, w)) : (u == null || u.addEventListener("mousemove", m.moveHandler, w), u == null || u.addEventListener("mouseup", m.upHandler, w)), o.setColumnSizingInfo((R) => ({
1222
- ...R,
1223
- startOffset: a,
1227
+ me(l) ? (s == null || s.addEventListener("touchmove", h.moveHandler, w), s == null || s.addEventListener("touchend", h.upHandler, w)) : (s == null || s.addEventListener("mousemove", m.moveHandler, w), s == null || s.addEventListener("mouseup", m.upHandler, w)), o.setColumnSizingInfo((C) => ({
1228
+ ...C,
1229
+ startOffset: u,
1224
1230
  startSize: i,
1225
1231
  deltaOffset: 0,
1226
1232
  deltaPercentage: 0,
1227
- columnSizingStart: s,
1233
+ columnSizingStart: a,
1228
1234
  isResizingColumn: n.id
1229
1235
  }));
1230
1236
  };
@@ -1298,10 +1304,10 @@ const fn = {
1298
1304
  };
1299
1305
  },
1300
1306
  createRow: (e, o) => {
1301
- e._getAllVisibleCells = C(() => [e.getAllCells(), o.getState().columnVisibility], (t) => t.filter((n) => n.column.getIsVisible()), S(o.options, "debugRows", "_getAllVisibleCells")), e.getVisibleCells = C(() => [e.getLeftVisibleCells(), e.getCenterVisibleCells(), e.getRightVisibleCells()], (t, n, r) => [...t, ...n, ...r], S(o.options, "debugRows", "getVisibleCells"));
1307
+ e._getAllVisibleCells = S(() => [e.getAllCells(), o.getState().columnVisibility], (t) => t.filter((n) => n.column.getIsVisible()), R(o.options, "debugRows", "_getAllVisibleCells")), e.getVisibleCells = S(() => [e.getLeftVisibleCells(), e.getCenterVisibleCells(), e.getRightVisibleCells()], (t, n, r) => [...t, ...n, ...r], R(o.options, "debugRows", "getVisibleCells"));
1302
1308
  },
1303
1309
  createTable: (e) => {
1304
- const o = (t, n) => C(() => [n(), n().filter((r) => r.getIsVisible()).map((r) => r.id).join("_")], (r) => r.filter((l) => l.getIsVisible == null ? void 0 : l.getIsVisible()), S(e.options, "debugColumns", t));
1310
+ const o = (t, n) => S(() => [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));
1305
1311
  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) => {
1306
1312
  var n;
1307
1313
  e.setColumnVisibility(t ? {} : (n = e.initialState.columnVisibility) != null ? n : {});
@@ -1412,8 +1418,8 @@ const dn = {
1412
1418
  var r;
1413
1419
  const l = n === !0 ? !0 : !!(n != null && n[e.id]);
1414
1420
  let i = {};
1415
- if (n === !0 ? Object.keys(o.getRowModel().rowsById).forEach((s) => {
1416
- i[s] = !0;
1421
+ if (n === !0 ? Object.keys(o.getRowModel().rowsById).forEach((a) => {
1422
+ i[a] = !0;
1417
1423
  }) : i = n, t = (r = t) != null ? r : !l, !l && t)
1418
1424
  return {
1419
1425
  ...i,
@@ -1421,10 +1427,10 @@ const dn = {
1421
1427
  };
1422
1428
  if (l && !t) {
1423
1429
  const {
1424
- [e.id]: s,
1425
- ...a
1430
+ [e.id]: a,
1431
+ ...u
1426
1432
  } = i;
1427
- return a;
1433
+ return u;
1428
1434
  }
1429
1435
  return n;
1430
1436
  });
@@ -1500,10 +1506,10 @@ const dn = {
1500
1506
  e.setPageSize(n ? xe : (r = (l = e.initialState) == null || (l = l.pagination) == null ? void 0 : l.pageSize) != null ? r : xe);
1501
1507
  }, e.setPageSize = (n) => {
1502
1508
  e.setPagination((r) => {
1503
- const l = Math.max(1, q(n, r.pageSize)), i = r.pageSize * r.pageIndex, s = Math.floor(i / l);
1509
+ const l = Math.max(1, q(n, r.pageSize)), i = r.pageSize * r.pageIndex, a = Math.floor(i / l);
1504
1510
  return {
1505
1511
  ...r,
1506
- pageIndex: s,
1512
+ pageIndex: a,
1507
1513
  pageSize: l
1508
1514
  };
1509
1515
  });
@@ -1514,10 +1520,10 @@ const dn = {
1514
1520
  ...r,
1515
1521
  pageCount: i
1516
1522
  };
1517
- }), e.getPageOptions = C(() => [e.getPageCount()], (n) => {
1523
+ }), e.getPageOptions = S(() => [e.getPageCount()], (n) => {
1518
1524
  let r = [];
1519
1525
  return n && n > 0 && (r = [...new Array(n)].fill(null).map((l, i) => i)), r;
1520
- }, S(e.options, "debugTable", "getPageOptions")), e.getCanPreviousPage = () => e.getState().pagination.pageIndex > 0, e.getCanNextPage = () => {
1526
+ }, R(e.options, "debugTable", "getPageOptions")), e.getCanPreviousPage = () => e.getState().pagination.pageIndex > 0, e.getCanNextPage = () => {
1521
1527
  const {
1522
1528
  pageIndex: n
1523
1529
  } = e.getState().pagination, r = e.getPageCount();
@@ -1530,12 +1536,12 @@ const dn = {
1530
1536
  return (n = e.options.rowCount) != null ? n : e.getPrePaginationRowModel().rows.length;
1531
1537
  };
1532
1538
  }
1533
- }, ve = () => ({
1539
+ }, we = () => ({
1534
1540
  top: [],
1535
1541
  bottom: []
1536
1542
  }), mn = {
1537
1543
  getInitialState: (e) => ({
1538
- rowPinning: ve(),
1544
+ rowPinning: we(),
1539
1545
  ...e
1540
1546
  }),
1541
1547
  getDefaultOptions: (e) => ({
@@ -1543,36 +1549,36 @@ const dn = {
1543
1549
  }),
1544
1550
  createRow: (e, o) => {
1545
1551
  e.pin = (t, n, r) => {
1546
- const l = n ? e.getLeafRows().map((a) => {
1552
+ const l = n ? e.getLeafRows().map((u) => {
1547
1553
  let {
1548
1554
  id: f
1549
- } = a;
1555
+ } = u;
1550
1556
  return f;
1551
- }) : [], i = r ? e.getParentRows().map((a) => {
1557
+ }) : [], i = r ? e.getParentRows().map((u) => {
1552
1558
  let {
1553
1559
  id: f
1554
- } = a;
1560
+ } = u;
1555
1561
  return f;
1556
- }) : [], s = /* @__PURE__ */ new Set([...i, e.id, ...l]);
1557
- o.setRowPinning((a) => {
1562
+ }) : [], a = /* @__PURE__ */ new Set([...i, e.id, ...l]);
1563
+ o.setRowPinning((u) => {
1558
1564
  var f, p;
1559
1565
  if (t === "bottom") {
1560
1566
  var c, d;
1561
1567
  return {
1562
- top: ((c = a == null ? void 0 : a.top) != null ? c : []).filter((h) => !(s != null && s.has(h))),
1563
- bottom: [...((d = a == null ? void 0 : a.bottom) != null ? d : []).filter((h) => !(s != null && s.has(h))), ...Array.from(s)]
1568
+ top: ((c = u == null ? void 0 : u.top) != null ? c : []).filter((h) => !(a != null && a.has(h))),
1569
+ bottom: [...((d = u == null ? void 0 : u.bottom) != null ? d : []).filter((h) => !(a != null && a.has(h))), ...Array.from(a)]
1564
1570
  };
1565
1571
  }
1566
1572
  if (t === "top") {
1567
- var u, m;
1573
+ var s, m;
1568
1574
  return {
1569
- top: [...((u = a == null ? void 0 : a.top) != null ? u : []).filter((h) => !(s != null && s.has(h))), ...Array.from(s)],
1570
- bottom: ((m = a == null ? void 0 : a.bottom) != null ? m : []).filter((h) => !(s != null && s.has(h)))
1575
+ top: [...((s = u == null ? void 0 : u.top) != null ? s : []).filter((h) => !(a != null && a.has(h))), ...Array.from(a)],
1576
+ bottom: ((m = u == null ? void 0 : u.bottom) != null ? m : []).filter((h) => !(a != null && a.has(h)))
1571
1577
  };
1572
1578
  }
1573
1579
  return {
1574
- top: ((f = a == null ? void 0 : a.top) != null ? f : []).filter((h) => !(s != null && s.has(h))),
1575
- bottom: ((p = a == null ? void 0 : a.bottom) != null ? p : []).filter((h) => !(s != null && s.has(h)))
1580
+ top: ((f = u == null ? void 0 : u.top) != null ? f : []).filter((h) => !(a != null && a.has(h))),
1581
+ bottom: ((p = u == null ? void 0 : u.bottom) != null ? p : []).filter((h) => !(a != null && a.has(h)))
1576
1582
  };
1577
1583
  });
1578
1584
  }, e.getCanPin = () => {
@@ -1586,7 +1592,7 @@ const dn = {
1586
1592
  const t = [e.id], {
1587
1593
  top: n,
1588
1594
  bottom: r
1589
- } = 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));
1595
+ } = o.getState().rowPinning, l = t.some((a) => n == null ? void 0 : n.includes(a)), i = t.some((a) => r == null ? void 0 : r.includes(a));
1590
1596
  return l ? "top" : i ? "bottom" : !1;
1591
1597
  }, e.getPinnedIndex = () => {
1592
1598
  var t, n;
@@ -1594,9 +1600,9 @@ const dn = {
1594
1600
  if (!r) return -1;
1595
1601
  const l = (t = r === "top" ? o.getTopRows() : o.getBottomRows()) == null ? void 0 : t.map((i) => {
1596
1602
  let {
1597
- id: s
1603
+ id: a
1598
1604
  } = i;
1599
- return s;
1605
+ return a;
1600
1606
  });
1601
1607
  return (n = l == null ? void 0 : l.indexOf(e.id)) != null ? n : -1;
1602
1608
  };
@@ -1604,7 +1610,7 @@ const dn = {
1604
1610
  createTable: (e) => {
1605
1611
  e.setRowPinning = (o) => e.options.onRowPinningChange == null ? void 0 : e.options.onRowPinningChange(o), e.resetRowPinning = (o) => {
1606
1612
  var t, n;
1607
- return e.setRowPinning(o ? ve() : (t = (n = e.initialState) == null ? void 0 : n.rowPinning) != null ? t : ve());
1613
+ return e.setRowPinning(o ? we() : (t = (n = e.initialState) == null ? void 0 : n.rowPinning) != null ? t : we());
1608
1614
  }, e.getIsSomeRowsPinned = (o) => {
1609
1615
  var t;
1610
1616
  const n = e.getState().rowPinning;
@@ -1619,20 +1625,20 @@ const dn = {
1619
1625
  //get all rows that are pinned even if they would not be otherwise visible
1620
1626
  //account for expanded parent rows, but not pagination or filtering
1621
1627
  (t ?? []).map((i) => {
1622
- const s = e.getRow(i, !0);
1623
- return s.getIsAllParentsExpanded() ? s : null;
1628
+ const a = e.getRow(i, !0);
1629
+ return a.getIsAllParentsExpanded() ? a : null;
1624
1630
  })
1625
1631
  ) : (
1626
1632
  //else get only visible rows that are pinned
1627
- (t ?? []).map((i) => o.find((s) => s.id === i))
1633
+ (t ?? []).map((i) => o.find((a) => a.id === i))
1628
1634
  )).filter(Boolean).map((i) => ({
1629
1635
  ...i,
1630
1636
  position: n
1631
1637
  }));
1632
- }, e.getTopRows = C(() => [e.getRowModel().rows, e.getState().rowPinning.top], (o, t) => e._getPinnedRows(o, t, "top"), S(e.options, "debugRows", "getTopRows")), e.getBottomRows = C(() => [e.getRowModel().rows, e.getState().rowPinning.bottom], (o, t) => e._getPinnedRows(o, t, "bottom"), S(e.options, "debugRows", "getBottomRows")), e.getCenterRows = C(() => [e.getRowModel().rows, e.getState().rowPinning.top, e.getState().rowPinning.bottom], (o, t, n) => {
1638
+ }, e.getTopRows = S(() => [e.getRowModel().rows, e.getState().rowPinning.top], (o, t) => e._getPinnedRows(o, t, "top"), R(e.options, "debugRows", "getTopRows")), e.getBottomRows = S(() => [e.getRowModel().rows, e.getState().rowPinning.bottom], (o, t) => e._getPinnedRows(o, t, "bottom"), R(e.options, "debugRows", "getBottomRows")), e.getCenterRows = S(() => [e.getRowModel().rows, e.getState().rowPinning.top, e.getState().rowPinning.bottom], (o, t, n) => {
1633
1639
  const r = /* @__PURE__ */ new Set([...t ?? [], ...n ?? []]);
1634
1640
  return o.filter((l) => !r.has(l.id));
1635
- }, S(e.options, "debugRows", "getCenterRows"));
1641
+ }, R(e.options, "debugRows", "getCenterRows"));
1636
1642
  }
1637
1643
  }, hn = {
1638
1644
  getInitialState: (e) => ({
@@ -1671,19 +1677,19 @@ const dn = {
1671
1677
  return e.getRowModel().rows.forEach((l) => {
1672
1678
  _e(r, l.id, n, !0, e);
1673
1679
  }), r;
1674
- }), e.getPreSelectedRowModel = () => e.getCoreRowModel(), e.getSelectedRowModel = C(() => [e.getState().rowSelection, e.getCoreRowModel()], (o, t) => Object.keys(o).length ? we(e, t) : {
1680
+ }), e.getPreSelectedRowModel = () => e.getCoreRowModel(), e.getSelectedRowModel = S(() => [e.getState().rowSelection, e.getCoreRowModel()], (o, t) => Object.keys(o).length ? ve(e, t) : {
1675
1681
  rows: [],
1676
1682
  flatRows: [],
1677
1683
  rowsById: {}
1678
- }, S(e.options, "debugTable", "getSelectedRowModel")), e.getFilteredSelectedRowModel = C(() => [e.getState().rowSelection, e.getFilteredRowModel()], (o, t) => Object.keys(o).length ? we(e, t) : {
1684
+ }, R(e.options, "debugTable", "getSelectedRowModel")), e.getFilteredSelectedRowModel = S(() => [e.getState().rowSelection, e.getFilteredRowModel()], (o, t) => Object.keys(o).length ? ve(e, t) : {
1679
1685
  rows: [],
1680
1686
  flatRows: [],
1681
1687
  rowsById: {}
1682
- }, S(e.options, "debugTable", "getFilteredSelectedRowModel")), e.getGroupedSelectedRowModel = C(() => [e.getState().rowSelection, e.getSortedRowModel()], (o, t) => Object.keys(o).length ? we(e, t) : {
1688
+ }, R(e.options, "debugTable", "getFilteredSelectedRowModel")), e.getGroupedSelectedRowModel = S(() => [e.getState().rowSelection, e.getSortedRowModel()], (o, t) => Object.keys(o).length ? ve(e, t) : {
1683
1689
  rows: [],
1684
1690
  flatRows: [],
1685
1691
  rowsById: {}
1686
- }, S(e.options, "debugTable", "getGroupedSelectedRowModel")), e.getIsAllRowsSelected = () => {
1692
+ }, R(e.options, "debugTable", "getGroupedSelectedRowModel")), e.getIsAllRowsSelected = () => {
1687
1693
  const o = e.getFilteredRowModel().flatRows, {
1688
1694
  rowSelection: t
1689
1695
  } = e.getState();
@@ -1715,10 +1721,10 @@ const dn = {
1715
1721
  var i;
1716
1722
  if (t = typeof t < "u" ? t : !r, e.getCanSelect() && r === t)
1717
1723
  return l;
1718
- const s = {
1724
+ const a = {
1719
1725
  ...l
1720
1726
  };
1721
- return _e(s, e.id, t, (i = n == null ? void 0 : n.selectChildren) != null ? i : !0, o), s;
1727
+ return _e(a, e.id, t, (i = n == null ? void 0 : n.selectChildren) != null ? i : !0, o), a;
1722
1728
  });
1723
1729
  }, e.getIsSelected = () => {
1724
1730
  const {
@@ -1755,18 +1761,18 @@ const dn = {
1755
1761
  }, _e = (e, o, t, n, r) => {
1756
1762
  var l;
1757
1763
  const i = r.getRow(o, !0);
1758
- 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) => _e(e, s.id, t, n, r));
1764
+ t ? (i.getCanMultiSelect() || Object.keys(e).forEach((a) => delete e[a]), i.getCanSelect() && (e[o] = !0)) : delete e[o], n && (l = i.subRows) != null && l.length && i.getCanSelectSubRows() && i.subRows.forEach((a) => _e(e, a.id, t, n, r));
1759
1765
  };
1760
- function we(e, o) {
1761
- const t = e.getState().rowSelection, n = [], r = {}, l = function(i, s) {
1762
- return i.map((a) => {
1766
+ function ve(e, o) {
1767
+ const t = e.getState().rowSelection, n = [], r = {}, l = function(i, a) {
1768
+ return i.map((u) => {
1763
1769
  var f;
1764
- const p = Ee(a, t);
1765
- if (p && (n.push(a), r[a.id] = a), (f = a.subRows) != null && f.length && (a = {
1766
- ...a,
1767
- subRows: l(a.subRows)
1770
+ const p = Ee(u, t);
1771
+ if (p && (n.push(u), r[u.id] = u), (f = u.subRows) != null && f.length && (u = {
1772
+ ...u,
1773
+ subRows: l(u.subRows)
1768
1774
  }), p)
1769
- return a;
1775
+ return u;
1770
1776
  }).filter(Boolean);
1771
1777
  };
1772
1778
  return {
@@ -1785,12 +1791,12 @@ function Fe(e, o, t) {
1785
1791
  let r = !0, l = !1;
1786
1792
  return e.subRows.forEach((i) => {
1787
1793
  if (!(l && !r) && (i.getCanSelect() && (Ee(i, o) ? l = !0 : r = !1), i.subRows && i.subRows.length)) {
1788
- const s = Fe(i, o);
1789
- s === "all" ? l = !0 : (s === "some" && (l = !0), r = !1);
1794
+ const a = Fe(i, o);
1795
+ a === "all" ? l = !0 : (a === "some" && (l = !0), r = !1);
1790
1796
  }
1791
1797
  }), r ? "all" : l ? "some" : !1;
1792
1798
  }
1793
- const $e = /([0-9]+)/gm, vn = (e, o, t) => ot(U(e.getValue(t)).toLowerCase(), U(o.getValue(t)).toLowerCase()), wn = (e, o, t) => ot(U(e.getValue(t)), U(o.getValue(t))), Cn = (e, o, t) => De(U(e.getValue(t)).toLowerCase(), U(o.getValue(t)).toLowerCase()), Sn = (e, o, t) => De(U(e.getValue(t)), U(o.getValue(t))), Rn = (e, o, t) => {
1799
+ const $e = /([0-9]+)/gm, wn = (e, o, t) => ot(U(e.getValue(t)).toLowerCase(), U(o.getValue(t)).toLowerCase()), vn = (e, o, t) => ot(U(e.getValue(t)), U(o.getValue(t))), Cn = (e, o, t) => De(U(e.getValue(t)).toLowerCase(), U(o.getValue(t)).toLowerCase()), Sn = (e, o, t) => De(U(e.getValue(t)), U(o.getValue(t))), Rn = (e, o, t) => {
1794
1800
  const n = e.getValue(t), r = o.getValue(t);
1795
1801
  return n > r ? 1 : n < r ? -1 : 0;
1796
1802
  }, yn = (e, o, t) => De(e.getValue(t), o.getValue(t));
@@ -1803,26 +1809,26 @@ function U(e) {
1803
1809
  function ot(e, o) {
1804
1810
  const t = e.split($e).filter(Boolean), n = o.split($e).filter(Boolean);
1805
1811
  for (; t.length && n.length; ) {
1806
- const r = t.shift(), l = n.shift(), i = parseInt(r, 10), s = parseInt(l, 10), a = [i, s].sort();
1807
- if (isNaN(a[0])) {
1812
+ const r = t.shift(), l = n.shift(), i = parseInt(r, 10), a = parseInt(l, 10), u = [i, a].sort();
1813
+ if (isNaN(u[0])) {
1808
1814
  if (r > l)
1809
1815
  return 1;
1810
1816
  if (l > r)
1811
1817
  return -1;
1812
1818
  continue;
1813
1819
  }
1814
- if (isNaN(a[1]))
1820
+ if (isNaN(u[1]))
1815
1821
  return isNaN(i) ? -1 : 1;
1816
- if (i > s)
1822
+ if (i > a)
1817
1823
  return 1;
1818
- if (s > i)
1824
+ if (a > i)
1819
1825
  return -1;
1820
1826
  }
1821
1827
  return t.length - n.length;
1822
1828
  }
1823
1829
  const te = {
1824
- alphanumeric: vn,
1825
- alphanumericCaseSensitive: wn,
1830
+ alphanumeric: wn,
1831
+ alphanumericCaseSensitive: vn,
1826
1832
  text: Cn,
1827
1833
  textCaseSensitive: Sn,
1828
1834
  datetime: Rn,
@@ -1863,18 +1869,18 @@ const te = {
1863
1869
  }, e.toggleSorting = (t, n) => {
1864
1870
  const r = e.getNextSortingOrder(), l = typeof t < "u" && t !== null;
1865
1871
  o.setSorting((i) => {
1866
- const s = i == null ? void 0 : i.find((u) => u.id === e.id), a = i == null ? void 0 : i.findIndex((u) => u.id === e.id);
1872
+ const a = i == null ? void 0 : i.find((s) => s.id === e.id), u = i == null ? void 0 : i.findIndex((s) => s.id === e.id);
1867
1873
  let f = [], p, c = l ? t : r === "desc";
1868
- if (i != null && i.length && e.getCanMultiSort() && n ? s ? p = "toggle" : p = "add" : i != null && i.length && a !== i.length - 1 ? p = "replace" : s ? p = "toggle" : p = "replace", p === "toggle" && (l || r || (p = "remove")), p === "add") {
1874
+ if (i != null && i.length && e.getCanMultiSort() && n ? a ? p = "toggle" : p = "add" : i != null && i.length && u !== i.length - 1 ? p = "replace" : a ? p = "toggle" : p = "replace", p === "toggle" && (l || r || (p = "remove")), p === "add") {
1869
1875
  var d;
1870
1876
  f = [...i, {
1871
1877
  id: e.id,
1872
1878
  desc: c
1873
1879
  }], f.splice(0, f.length - ((d = o.options.maxMultiSortColCount) != null ? d : Number.MAX_SAFE_INTEGER));
1874
- } else p === "toggle" ? f = i.map((u) => u.id === e.id ? {
1875
- ...u,
1880
+ } else p === "toggle" ? f = i.map((s) => s.id === e.id ? {
1881
+ ...s,
1876
1882
  desc: c
1877
- } : u) : p === "remove" ? f = i.filter((u) => u.id !== e.id) : f = [{
1883
+ } : s) : p === "remove" ? f = i.filter((s) => s.id !== e.id) : f = [{
1878
1884
  id: e.id,
1879
1885
  desc: c
1880
1886
  }];
@@ -1943,17 +1949,17 @@ function Fn(e) {
1943
1949
  let r = {
1944
1950
  _features: n
1945
1951
  };
1946
- const l = r._features.reduce((d, u) => Object.assign(d, u.getDefaultOptions == null ? void 0 : u.getDefaultOptions(r)), {}), i = (d) => r.options.mergeOptions ? r.options.mergeOptions(l, d) : {
1952
+ const l = r._features.reduce((d, s) => Object.assign(d, s.getDefaultOptions == null ? void 0 : s.getDefaultOptions(r)), {}), i = (d) => r.options.mergeOptions ? r.options.mergeOptions(l, d) : {
1947
1953
  ...l,
1948
1954
  ...d
1949
1955
  };
1950
- let a = {
1956
+ let u = {
1951
1957
  ...{},
1952
1958
  ...(t = e.initialState) != null ? t : {}
1953
1959
  };
1954
1960
  r._features.forEach((d) => {
1955
- var u;
1956
- a = (u = d.getInitialState == null ? void 0 : d.getInitialState(a)) != null ? u : a;
1961
+ var s;
1962
+ u = (s = d.getInitialState == null ? void 0 : d.getInitialState(u)) != null ? s : u;
1957
1963
  });
1958
1964
  const f = [];
1959
1965
  let p = !1;
@@ -1963,45 +1969,45 @@ function Fn(e) {
1963
1969
  ...l,
1964
1970
  ...e
1965
1971
  },
1966
- initialState: a,
1972
+ initialState: u,
1967
1973
  _queue: (d) => {
1968
1974
  f.push(d), p || (p = !0, Promise.resolve().then(() => {
1969
1975
  for (; f.length; )
1970
1976
  f.shift()();
1971
1977
  p = !1;
1972
- }).catch((u) => setTimeout(() => {
1973
- throw u;
1978
+ }).catch((s) => setTimeout(() => {
1979
+ throw s;
1974
1980
  })));
1975
1981
  },
1976
1982
  reset: () => {
1977
1983
  r.setState(r.initialState);
1978
1984
  },
1979
1985
  setOptions: (d) => {
1980
- const u = q(d, r.options);
1981
- r.options = i(u);
1986
+ const s = q(d, r.options);
1987
+ r.options = i(s);
1982
1988
  },
1983
1989
  getState: () => r.options.state,
1984
1990
  setState: (d) => {
1985
1991
  r.options.onStateChange == null || r.options.onStateChange(d);
1986
1992
  },
1987
- _getRowId: (d, u, m) => {
1993
+ _getRowId: (d, s, m) => {
1988
1994
  var h;
1989
- return (h = r.options.getRowId == null ? void 0 : r.options.getRowId(d, u, m)) != null ? h : `${m ? [m.id, u].join(".") : u}`;
1995
+ return (h = r.options.getRowId == null ? void 0 : r.options.getRowId(d, s, m)) != null ? h : `${m ? [m.id, s].join(".") : s}`;
1990
1996
  },
1991
1997
  getCoreRowModel: () => (r._getCoreRowModel || (r._getCoreRowModel = r.options.getCoreRowModel(r)), r._getCoreRowModel()),
1992
1998
  // The final calls start at the bottom of the model,
1993
1999
  // expanded rows, which then work their way up
1994
2000
  getRowModel: () => r.getPaginationRowModel(),
1995
2001
  //in next version, we should just pass in the row model as the optional 2nd arg
1996
- getRow: (d, u) => {
1997
- let m = (u ? r.getPrePaginationRowModel() : r.getRowModel()).rowsById[d];
2002
+ getRow: (d, s) => {
2003
+ let m = (s ? r.getPrePaginationRowModel() : r.getRowModel()).rowsById[d];
1998
2004
  if (!m && (m = r.getCoreRowModel().rowsById[d], !m))
1999
2005
  throw process.env.NODE_ENV !== "production" ? new Error(`getRow could not find row with ID: ${d}`) : new Error();
2000
2006
  return m;
2001
2007
  },
2002
- _getDefaultColumnDef: C(() => [r.options.defaultColumn], (d) => {
2003
- var u;
2004
- return d = (u = d) != null ? u : {}, {
2008
+ _getDefaultColumnDef: S(() => [r.options.defaultColumn], (d) => {
2009
+ var s;
2010
+ return d = (s = d) != null ? s : {}, {
2005
2011
  header: (m) => {
2006
2012
  const h = m.header.column.columnDef;
2007
2013
  return h.accessorKey ? h.accessorKey : h.accessorFn ? h.id : null;
@@ -2014,55 +2020,55 @@ function Fn(e) {
2014
2020
  ...r._features.reduce((m, h) => Object.assign(m, h.getDefaultColumnDef == null ? void 0 : h.getDefaultColumnDef()), {}),
2015
2021
  ...d
2016
2022
  };
2017
- }, S(e, "debugColumns", "_getDefaultColumnDef")),
2023
+ }, R(e, "debugColumns", "_getDefaultColumnDef")),
2018
2024
  _getColumnDefs: () => r.options.columns,
2019
- getAllColumns: C(() => [r._getColumnDefs()], (d) => {
2020
- const u = function(m, h, w) {
2021
- return w === void 0 && (w = 0), m.map((R) => {
2022
- const _ = Tt(r, R, w, h), $ = R;
2023
- return _.columns = $.columns ? u($.columns, _, w + 1) : [], _;
2025
+ getAllColumns: S(() => [r._getColumnDefs()], (d) => {
2026
+ const s = function(m, h, w) {
2027
+ return w === void 0 && (w = 0), m.map((C) => {
2028
+ const x = Tt(r, C, w, h), F = C;
2029
+ return x.columns = F.columns ? s(F.columns, x, w + 1) : [], x;
2024
2030
  });
2025
2031
  };
2026
- return u(d);
2027
- }, S(e, "debugColumns", "getAllColumns")),
2028
- getAllFlatColumns: C(() => [r.getAllColumns()], (d) => d.flatMap((u) => u.getFlatColumns()), S(e, "debugColumns", "getAllFlatColumns")),
2029
- _getAllFlatColumnsById: C(() => [r.getAllFlatColumns()], (d) => d.reduce((u, m) => (u[m.id] = m, u), {}), S(e, "debugColumns", "getAllFlatColumnsById")),
2030
- getAllLeafColumns: C(() => [r.getAllColumns(), r._getOrderColumnsFn()], (d, u) => {
2032
+ return s(d);
2033
+ }, R(e, "debugColumns", "getAllColumns")),
2034
+ getAllFlatColumns: S(() => [r.getAllColumns()], (d) => d.flatMap((s) => s.getFlatColumns()), R(e, "debugColumns", "getAllFlatColumns")),
2035
+ _getAllFlatColumnsById: S(() => [r.getAllFlatColumns()], (d) => d.reduce((s, m) => (s[m.id] = m, s), {}), R(e, "debugColumns", "getAllFlatColumnsById")),
2036
+ getAllLeafColumns: S(() => [r.getAllColumns(), r._getOrderColumnsFn()], (d, s) => {
2031
2037
  let m = d.flatMap((h) => h.getLeafColumns());
2032
- return u(m);
2033
- }, S(e, "debugColumns", "getAllLeafColumns")),
2038
+ return s(m);
2039
+ }, R(e, "debugColumns", "getAllLeafColumns")),
2034
2040
  getColumn: (d) => {
2035
- const u = r._getAllFlatColumnsById()[d];
2036
- return process.env.NODE_ENV !== "production" && !u && console.error(`[Table] Column with id '${d}' does not exist.`), u;
2041
+ const s = r._getAllFlatColumnsById()[d];
2042
+ return process.env.NODE_ENV !== "production" && !s && console.error(`[Table] Column with id '${d}' does not exist.`), s;
2037
2043
  }
2038
2044
  };
2039
2045
  Object.assign(r, c);
2040
2046
  for (let d = 0; d < r._features.length; d++) {
2041
- const u = r._features[d];
2042
- u == null || u.createTable == null || u.createTable(r);
2047
+ const s = r._features[d];
2048
+ s == null || s.createTable == null || s.createTable(r);
2043
2049
  }
2044
2050
  return r;
2045
2051
  }
2046
2052
  function $n() {
2047
- return (e) => C(() => [e.options.data], (o) => {
2053
+ return (e) => S(() => [e.options.data], (o) => {
2048
2054
  const t = {
2049
2055
  rows: [],
2050
2056
  flatRows: [],
2051
2057
  rowsById: {}
2052
2058
  }, n = function(r, l, i) {
2053
2059
  l === void 0 && (l = 0);
2054
- const s = [];
2060
+ const a = [];
2055
2061
  for (let f = 0; f < r.length; f++) {
2056
2062
  const p = Ne(e, e._getRowId(r[f], f, i), r[f], f, l, void 0, i == null ? void 0 : i.id);
2057
- if (t.flatRows.push(p), t.rowsById[p.id] = p, s.push(p), e.options.getSubRows) {
2058
- var a;
2059
- p.originalSubRows = e.options.getSubRows(r[f], f), (a = p.originalSubRows) != null && a.length && (p.subRows = n(p.originalSubRows, l + 1, p));
2063
+ if (t.flatRows.push(p), t.rowsById[p.id] = p, a.push(p), e.options.getSubRows) {
2064
+ var u;
2065
+ p.originalSubRows = e.options.getSubRows(r[f], f), (u = p.originalSubRows) != null && u.length && (p.subRows = n(p.originalSubRows, l + 1, p));
2060
2066
  }
2061
2067
  }
2062
- return s;
2068
+ return a;
2063
2069
  };
2064
2070
  return t.rows = n(o), t;
2065
- }, S(e.options, "debugTable", "getRowModel", () => e._autoResetPageIndex()));
2071
+ }, R(e.options, "debugTable", "getRowModel", () => e._autoResetPageIndex()));
2066
2072
  }
2067
2073
  function Mn(e) {
2068
2074
  const o = [], t = (n) => {
@@ -2080,59 +2086,59 @@ function In(e, o, t) {
2080
2086
  }
2081
2087
  function Vn(e, o, t) {
2082
2088
  var n;
2083
- const r = [], l = {}, i = (n = t.options.maxLeafRowFilterDepth) != null ? n : 100, s = function(a, f) {
2089
+ const r = [], l = {}, i = (n = t.options.maxLeafRowFilterDepth) != null ? n : 100, a = function(u, f) {
2084
2090
  f === void 0 && (f = 0);
2085
2091
  const p = [];
2086
- for (let d = 0; d < a.length; d++) {
2092
+ for (let d = 0; d < u.length; d++) {
2087
2093
  var c;
2088
- let u = a[d];
2089
- const m = Ne(t, u.id, u.original, u.index, u.depth, void 0, u.parentId);
2090
- if (m.columnFilters = u.columnFilters, (c = u.subRows) != null && c.length && f < i) {
2091
- if (m.subRows = s(u.subRows, f + 1), u = m, o(u) && !m.subRows.length) {
2092
- p.push(u), l[u.id] = u, r.push(u);
2094
+ let s = u[d];
2095
+ const m = Ne(t, s.id, s.original, s.index, s.depth, void 0, s.parentId);
2096
+ if (m.columnFilters = s.columnFilters, (c = s.subRows) != null && c.length && f < i) {
2097
+ if (m.subRows = a(s.subRows, f + 1), s = m, o(s) && !m.subRows.length) {
2098
+ p.push(s), l[s.id] = s, r.push(s);
2093
2099
  continue;
2094
2100
  }
2095
- if (o(u) || m.subRows.length) {
2096
- p.push(u), l[u.id] = u, r.push(u);
2101
+ if (o(s) || m.subRows.length) {
2102
+ p.push(s), l[s.id] = s, r.push(s);
2097
2103
  continue;
2098
2104
  }
2099
2105
  } else
2100
- u = m, o(u) && (p.push(u), l[u.id] = u, r.push(u));
2106
+ s = m, o(s) && (p.push(s), l[s.id] = s, r.push(s));
2101
2107
  }
2102
2108
  return p;
2103
2109
  };
2104
2110
  return {
2105
- rows: s(e),
2111
+ rows: a(e),
2106
2112
  flatRows: r,
2107
2113
  rowsById: l
2108
2114
  };
2109
2115
  }
2110
2116
  function Nn(e, o, t) {
2111
2117
  var n;
2112
- const r = [], l = {}, i = (n = t.options.maxLeafRowFilterDepth) != null ? n : 100, s = function(a, f) {
2118
+ const r = [], l = {}, i = (n = t.options.maxLeafRowFilterDepth) != null ? n : 100, a = function(u, f) {
2113
2119
  f === void 0 && (f = 0);
2114
2120
  const p = [];
2115
- for (let d = 0; d < a.length; d++) {
2116
- let u = a[d];
2117
- if (o(u)) {
2121
+ for (let d = 0; d < u.length; d++) {
2122
+ let s = u[d];
2123
+ if (o(s)) {
2118
2124
  var c;
2119
- if ((c = u.subRows) != null && c.length && f < i) {
2120
- const h = Ne(t, u.id, u.original, u.index, u.depth, void 0, u.parentId);
2121
- h.subRows = s(u.subRows, f + 1), u = h;
2125
+ if ((c = s.subRows) != null && c.length && f < i) {
2126
+ const h = Ne(t, s.id, s.original, s.index, s.depth, void 0, s.parentId);
2127
+ h.subRows = a(s.subRows, f + 1), s = h;
2122
2128
  }
2123
- p.push(u), r.push(u), l[u.id] = u;
2129
+ p.push(s), r.push(s), l[s.id] = s;
2124
2130
  }
2125
2131
  }
2126
2132
  return p;
2127
2133
  };
2128
2134
  return {
2129
- rows: s(e),
2135
+ rows: a(e),
2130
2136
  flatRows: r,
2131
2137
  rowsById: l
2132
2138
  };
2133
2139
  }
2134
2140
  function Pn() {
2135
- return (e) => C(() => [e.getPreFilteredRowModel(), e.getState().columnFilters, e.getState().globalFilter], (o, t, n) => {
2141
+ return (e) => S(() => [e.getPreFilteredRowModel(), e.getState().columnFilters, e.getState().globalFilter], (o, t, n) => {
2136
2142
  if (!o.rows.length || !(t != null && t.length) && !n) {
2137
2143
  for (let d = 0; d < o.flatRows.length; d++)
2138
2144
  o.flatRows[d].columnFilters = {}, o.flatRows[d].columnFiltersMeta = {};
@@ -2140,7 +2146,7 @@ function Pn() {
2140
2146
  }
2141
2147
  const r = [], l = [];
2142
2148
  (t ?? []).forEach((d) => {
2143
- var u;
2149
+ var s;
2144
2150
  const m = e.getColumn(d.id);
2145
2151
  if (!m)
2146
2152
  return;
@@ -2152,54 +2158,54 @@ function Pn() {
2152
2158
  r.push({
2153
2159
  id: d.id,
2154
2160
  filterFn: h,
2155
- resolvedValue: (u = h.resolveFilterValue == null ? void 0 : h.resolveFilterValue(d.value)) != null ? u : d.value
2161
+ resolvedValue: (s = h.resolveFilterValue == null ? void 0 : h.resolveFilterValue(d.value)) != null ? s : d.value
2156
2162
  });
2157
2163
  });
2158
- const i = (t ?? []).map((d) => d.id), s = e.getGlobalFilterFn(), a = e.getAllLeafColumns().filter((d) => d.getCanGlobalFilter());
2159
- n && s && a.length && (i.push("__global__"), a.forEach((d) => {
2160
- var u;
2164
+ const i = (t ?? []).map((d) => d.id), a = e.getGlobalFilterFn(), u = e.getAllLeafColumns().filter((d) => d.getCanGlobalFilter());
2165
+ n && a && u.length && (i.push("__global__"), u.forEach((d) => {
2166
+ var s;
2161
2167
  l.push({
2162
2168
  id: d.id,
2163
- filterFn: s,
2164
- resolvedValue: (u = s.resolveFilterValue == null ? void 0 : s.resolveFilterValue(n)) != null ? u : n
2169
+ filterFn: a,
2170
+ resolvedValue: (s = a.resolveFilterValue == null ? void 0 : a.resolveFilterValue(n)) != null ? s : n
2165
2171
  });
2166
2172
  }));
2167
2173
  let f, p;
2168
2174
  for (let d = 0; d < o.flatRows.length; d++) {
2169
- const u = o.flatRows[d];
2170
- if (u.columnFilters = {}, r.length)
2175
+ const s = o.flatRows[d];
2176
+ if (s.columnFilters = {}, r.length)
2171
2177
  for (let m = 0; m < r.length; m++) {
2172
2178
  f = r[m];
2173
2179
  const h = f.id;
2174
- u.columnFilters[h] = f.filterFn(u, h, f.resolvedValue, (w) => {
2175
- u.columnFiltersMeta[h] = w;
2180
+ s.columnFilters[h] = f.filterFn(s, h, f.resolvedValue, (w) => {
2181
+ s.columnFiltersMeta[h] = w;
2176
2182
  });
2177
2183
  }
2178
2184
  if (l.length) {
2179
2185
  for (let m = 0; m < l.length; m++) {
2180
2186
  p = l[m];
2181
2187
  const h = p.id;
2182
- if (p.filterFn(u, h, p.resolvedValue, (w) => {
2183
- u.columnFiltersMeta[h] = w;
2188
+ if (p.filterFn(s, h, p.resolvedValue, (w) => {
2189
+ s.columnFiltersMeta[h] = w;
2184
2190
  })) {
2185
- u.columnFilters.__global__ = !0;
2191
+ s.columnFilters.__global__ = !0;
2186
2192
  break;
2187
2193
  }
2188
2194
  }
2189
- u.columnFilters.__global__ !== !0 && (u.columnFilters.__global__ = !1);
2195
+ s.columnFilters.__global__ !== !0 && (s.columnFilters.__global__ = !1);
2190
2196
  }
2191
2197
  }
2192
2198
  const c = (d) => {
2193
- for (let u = 0; u < i.length; u++)
2194
- if (d.columnFilters[i[u]] === !1)
2199
+ for (let s = 0; s < i.length; s++)
2200
+ if (d.columnFilters[i[s]] === !1)
2195
2201
  return !1;
2196
2202
  return !0;
2197
2203
  };
2198
2204
  return In(o.rows, c, e);
2199
- }, S(e.options, "debugTable", "getFilteredRowModel", () => e._autoResetPageIndex()));
2205
+ }, R(e.options, "debugTable", "getFilteredRowModel", () => e._autoResetPageIndex()));
2200
2206
  }
2201
2207
  function En(e) {
2202
- return (o) => C(() => [o.getState().pagination, o.getPrePaginationRowModel(), o.options.paginateExpandedRows ? void 0 : o.getState().expanded], (t, n) => {
2208
+ return (o) => S(() => [o.getState().pagination, o.getPrePaginationRowModel(), o.options.paginateExpandedRows ? void 0 : o.getState().expanded], (t, n) => {
2203
2209
  if (!n.rows.length)
2204
2210
  return n;
2205
2211
  const {
@@ -2208,75 +2214,75 @@ function En(e) {
2208
2214
  } = t;
2209
2215
  let {
2210
2216
  rows: i,
2211
- flatRows: s,
2212
- rowsById: a
2217
+ flatRows: a,
2218
+ rowsById: u
2213
2219
  } = n;
2214
2220
  const f = r * l, p = f + r;
2215
2221
  i = i.slice(f, p);
2216
2222
  let c;
2217
2223
  o.options.paginateExpandedRows ? c = {
2218
2224
  rows: i,
2219
- flatRows: s,
2220
- rowsById: a
2225
+ flatRows: a,
2226
+ rowsById: u
2221
2227
  } : c = Mn({
2222
2228
  rows: i,
2223
- flatRows: s,
2224
- rowsById: a
2229
+ flatRows: a,
2230
+ rowsById: u
2225
2231
  }), c.flatRows = [];
2226
- const d = (u) => {
2227
- c.flatRows.push(u), u.subRows.length && u.subRows.forEach(d);
2232
+ const d = (s) => {
2233
+ c.flatRows.push(s), s.subRows.length && s.subRows.forEach(d);
2228
2234
  };
2229
2235
  return c.rows.forEach(d), c;
2230
- }, S(o.options, "debugTable", "getPaginationRowModel"));
2236
+ }, R(o.options, "debugTable", "getPaginationRowModel"));
2231
2237
  }
2232
2238
  function Dn() {
2233
- return (e) => C(() => [e.getState().sorting, e.getPreSortedRowModel()], (o, t) => {
2239
+ return (e) => S(() => [e.getState().sorting, e.getPreSortedRowModel()], (o, t) => {
2234
2240
  if (!t.rows.length || !(o != null && o.length))
2235
2241
  return t;
2236
- const n = e.getState().sorting, r = [], l = n.filter((a) => {
2242
+ const n = e.getState().sorting, r = [], l = n.filter((u) => {
2237
2243
  var f;
2238
- return (f = e.getColumn(a.id)) == null ? void 0 : f.getCanSort();
2244
+ return (f = e.getColumn(u.id)) == null ? void 0 : f.getCanSort();
2239
2245
  }), i = {};
2240
- l.forEach((a) => {
2241
- const f = e.getColumn(a.id);
2242
- f && (i[a.id] = {
2246
+ l.forEach((u) => {
2247
+ const f = e.getColumn(u.id);
2248
+ f && (i[u.id] = {
2243
2249
  sortUndefined: f.columnDef.sortUndefined,
2244
2250
  invertSorting: f.columnDef.invertSorting,
2245
2251
  sortingFn: f.getSortingFn()
2246
2252
  });
2247
2253
  });
2248
- const s = (a) => {
2249
- const f = a.map((p) => ({
2254
+ const a = (u) => {
2255
+ const f = u.map((p) => ({
2250
2256
  ...p
2251
2257
  }));
2252
2258
  return f.sort((p, c) => {
2253
- for (let u = 0; u < l.length; u += 1) {
2259
+ for (let s = 0; s < l.length; s += 1) {
2254
2260
  var d;
2255
- const m = l[u], h = i[m.id], w = h.sortUndefined, R = (d = m == null ? void 0 : m.desc) != null ? d : !1;
2256
- let _ = 0;
2261
+ const m = l[s], h = i[m.id], w = h.sortUndefined, C = (d = m == null ? void 0 : m.desc) != null ? d : !1;
2262
+ let x = 0;
2257
2263
  if (w) {
2258
- const $ = p.getValue(m.id), E = c.getValue(m.id), I = $ === void 0, D = E === void 0;
2264
+ const F = p.getValue(m.id), E = c.getValue(m.id), I = F === void 0, D = E === void 0;
2259
2265
  if (I || D) {
2260
2266
  if (w === "first") return I ? -1 : 1;
2261
2267
  if (w === "last") return I ? 1 : -1;
2262
- _ = I && D ? 0 : I ? w : -w;
2268
+ x = I && D ? 0 : I ? w : -w;
2263
2269
  }
2264
2270
  }
2265
- if (_ === 0 && (_ = h.sortingFn(p, c, m.id)), _ !== 0)
2266
- return R && (_ *= -1), h.invertSorting && (_ *= -1), _;
2271
+ if (x === 0 && (x = h.sortingFn(p, c, m.id)), x !== 0)
2272
+ return C && (x *= -1), h.invertSorting && (x *= -1), x;
2267
2273
  }
2268
2274
  return p.index - c.index;
2269
2275
  }), f.forEach((p) => {
2270
2276
  var c;
2271
- r.push(p), (c = p.subRows) != null && c.length && (p.subRows = s(p.subRows));
2277
+ r.push(p), (c = p.subRows) != null && c.length && (p.subRows = a(p.subRows));
2272
2278
  }), f;
2273
2279
  };
2274
2280
  return {
2275
- rows: s(t.rows),
2281
+ rows: a(t.rows),
2276
2282
  flatRows: r,
2277
2283
  rowsById: t.rowsById
2278
2284
  };
2279
- }, S(e.options, "debugTable", "getSortedRowModel", () => e._autoResetPageIndex()));
2285
+ }, R(e.options, "debugTable", "getSortedRowModel", () => e._autoResetPageIndex()));
2280
2286
  }
2281
2287
  /**
2282
2288
  * react-table
@@ -2292,7 +2298,7 @@ function je(e, o) {
2292
2298
  return e ? kn(e) ? /* @__PURE__ */ Se.createElement(e, o) : e : null;
2293
2299
  }
2294
2300
  function kn(e) {
2295
- return Ln(e) || typeof e == "function" || Hn(e);
2301
+ return Ln(e) || typeof e == "function" || zn(e);
2296
2302
  }
2297
2303
  function Ln(e) {
2298
2304
  return typeof e == "function" && (() => {
@@ -2300,10 +2306,10 @@ function Ln(e) {
2300
2306
  return o.prototype && o.prototype.isReactComponent;
2301
2307
  })();
2302
2308
  }
2303
- function Hn(e) {
2309
+ function zn(e) {
2304
2310
  return typeof e == "object" && typeof e.$$typeof == "symbol" && ["react.memo", "react.forward_ref"].includes(e.$$typeof.description);
2305
2311
  }
2306
- function zn(e) {
2312
+ function Hn(e) {
2307
2313
  const o = {
2308
2314
  state: {},
2309
2315
  // Dummy state
@@ -2339,36 +2345,36 @@ const Ue = ({
2339
2345
  const {
2340
2346
  rows: l,
2341
2347
  schema: i,
2342
- mappings: s,
2343
- errorsByRow: a,
2348
+ mappings: a,
2349
+ errorsByRow: u,
2344
2350
  editingCell: f,
2345
2351
  startEditing: p,
2346
2352
  stopEditing: c,
2347
2353
  updateCell: d,
2348
- deleteRow: u
2349
- } = J(), [m, h] = Y([]), [w, R] = Y(""), [_, $] = Y(""), E = ze(() => s.filter((y) => y.targetKey !== null).map((y) => {
2350
- const x = i == null ? void 0 : i.columns.find((V) => V.key === y.targetKey);
2354
+ deleteRow: s
2355
+ } = J(), [m, h] = Y([]), [w, C] = Y(""), [x, F] = Y(""), E = He(() => a.filter((y) => y.targetKey !== null).map((y) => {
2356
+ const _ = i == null ? void 0 : i.columns.find((V) => V.key === y.targetKey);
2351
2357
  return {
2352
2358
  sourceColumn: y.sourceColumn,
2353
2359
  targetKey: y.targetKey,
2354
- label: (x == null ? void 0 : x.label) || y.targetKey,
2355
- type: (x == null ? void 0 : x.type) || "string"
2360
+ label: (_ == null ? void 0 : _.label) || y.targetKey,
2361
+ type: (_ == null ? void 0 : _.type) || "string"
2356
2362
  };
2357
- }), [s, i]), I = Me(
2358
- (y, x) => {
2359
- const V = a.get(y);
2360
- return V == null ? void 0 : V.find((W) => W.columnKey === x);
2363
+ }), [a, i]), I = Me(
2364
+ (y, _) => {
2365
+ const V = u.get(y);
2366
+ return V == null ? void 0 : V.find((W) => W.columnKey === _);
2361
2367
  },
2362
- [a]
2363
- ), D = (y, x, V) => {
2364
- $(V), p(y, x);
2368
+ [u]
2369
+ ), D = (y, _, V) => {
2370
+ F(V), p(y, _);
2365
2371
  }, K = () => {
2366
- f && (d(f.rowIndex, f.columnKey, _), n == null || n(f.rowIndex, f.columnKey, _)), c();
2372
+ f && (d(f.rowIndex, f.columnKey, x), n == null || n(f.rowIndex, f.columnKey, x)), c();
2367
2373
  }, N = () => {
2368
- $(""), c();
2369
- }, z = (y) => {
2370
- u(y), r == null || r(y);
2371
- }, T = Gt(), O = ze(
2374
+ F(""), c();
2375
+ }, H = (y) => {
2376
+ s(y), r == null || r(y);
2377
+ }, T = Gt(), O = He(
2372
2378
  () => [
2373
2379
  T.accessor("rowIndex", {
2374
2380
  header: "#",
@@ -2376,18 +2382,18 @@ const Ue = ({
2376
2382
  cell: (y) => /* @__PURE__ */ g("span", { className: "ff-font-mono ff-text-xs", style: { color: "var(--ff-text-muted)" }, children: y.getValue() + 1 })
2377
2383
  }),
2378
2384
  ...E.map(
2379
- (y) => T.accessor((x) => x.data[y.targetKey] || x.data[y.sourceColumn], {
2385
+ (y) => T.accessor((_) => _.data[y.targetKey] || _.data[y.sourceColumn], {
2380
2386
  id: y.targetKey,
2381
2387
  header: y.label,
2382
- cell: (x) => {
2383
- const V = x.row.original.rowIndex, W = String(x.getValue() ?? ""), k = I(V, y.targetKey);
2388
+ cell: (_) => {
2389
+ const V = _.row.original.rowIndex, W = String(_.getValue() ?? ""), k = I(V, y.targetKey);
2384
2390
  return (f == null ? void 0 : f.rowIndex) === V && (f == null ? void 0 : f.columnKey) === y.targetKey ? /* @__PURE__ */ v("div", { className: "ff-flex ff-items-center ff-gap-2 ff-min-w-[280px]", children: [
2385
2391
  /* @__PURE__ */ g(
2386
2392
  "input",
2387
2393
  {
2388
2394
  type: "text",
2389
- value: _,
2390
- onChange: (X) => $(X.target.value),
2395
+ value: x,
2396
+ onChange: (X) => F(X.target.value),
2391
2397
  onKeyDown: (X) => {
2392
2398
  X.key === "Enter" && K(), X.key === "Escape" && N();
2393
2399
  },
@@ -2449,22 +2455,22 @@ const Ue = ({
2449
2455
  header: "",
2450
2456
  size: 50,
2451
2457
  cell: (y) => {
2452
- const x = y.row.original.rowIndex;
2458
+ const _ = y.row.original.rowIndex;
2453
2459
  return /* @__PURE__ */ g(
2454
2460
  "button",
2455
2461
  {
2456
- onClick: () => z(x),
2462
+ onClick: () => H(_),
2457
2463
  className: "ff-delete-btn",
2458
2464
  title: "Delete row",
2459
- children: /* @__PURE__ */ g(Ht, { className: "ff-w-4 ff-h-4" })
2465
+ children: /* @__PURE__ */ g(zt, { className: "ff-w-4 ff-h-4" })
2460
2466
  }
2461
2467
  );
2462
2468
  }
2463
2469
  })
2464
2470
  ] : []
2465
2471
  ],
2466
- [E, f, _, e, o, I, T]
2467
- ), H = zn({
2472
+ [E, f, x, e, o, I, T]
2473
+ ), z = Hn({
2468
2474
  data: l,
2469
2475
  columns: O,
2470
2476
  state: {
@@ -2472,7 +2478,7 @@ const Ue = ({
2472
2478
  globalFilter: w
2473
2479
  },
2474
2480
  onSortingChange: h,
2475
- onGlobalFilterChange: R,
2481
+ onGlobalFilterChange: C,
2476
2482
  getCoreRowModel: $n(),
2477
2483
  getPaginationRowModel: En(),
2478
2484
  getSortedRowModel: Dn(),
@@ -2490,38 +2496,38 @@ const Ue = ({
2490
2496
  {
2491
2497
  type: "text",
2492
2498
  value: w,
2493
- onChange: (y) => R(y.target.value),
2499
+ onChange: (y) => C(y.target.value),
2494
2500
  placeholder: "Search all columns...",
2495
2501
  className: "ff-input ff-max-w-xs"
2496
2502
  }
2497
2503
  ),
2498
2504
  /* @__PURE__ */ v("div", { className: "ff-text-sm", style: { color: "var(--ff-text-muted)" }, children: [
2499
- H.getFilteredRowModel().rows.length,
2505
+ z.getFilteredRowModel().rows.length,
2500
2506
  " rows"
2501
2507
  ] })
2502
2508
  ] }),
2503
2509
  /* @__PURE__ */ g("div", { className: "ff-table-container ff-max-h-[500px]", children: /* @__PURE__ */ v("table", { className: "ff-table", children: [
2504
- /* @__PURE__ */ g("thead", { children: H.getHeaderGroups().map((y) => /* @__PURE__ */ g("tr", { children: y.headers.map((x) => /* @__PURE__ */ g(
2510
+ /* @__PURE__ */ g("thead", { children: z.getHeaderGroups().map((y) => /* @__PURE__ */ g("tr", { children: y.headers.map((_) => /* @__PURE__ */ g(
2505
2511
  "th",
2506
2512
  {
2507
- style: { width: x.getSize() },
2508
- onClick: x.column.getToggleSortingHandler(),
2513
+ style: { width: _.getSize() },
2514
+ onClick: _.column.getToggleSortingHandler(),
2509
2515
  className: j(
2510
- x.column.getCanSort() && "ff-cursor-pointer ff-select-none"
2516
+ _.column.getCanSort() && "ff-cursor-pointer ff-select-none"
2511
2517
  ),
2512
2518
  children: /* @__PURE__ */ v("div", { className: "ff-flex ff-items-center ff-gap-1", children: [
2513
- je(x.column.columnDef.header, x.getContext()),
2514
- x.column.getIsSorted() && /* @__PURE__ */ g("span", { children: x.column.getIsSorted() === "asc" ? "↑" : "↓" })
2519
+ je(_.column.columnDef.header, _.getContext()),
2520
+ _.column.getIsSorted() && /* @__PURE__ */ g("span", { children: _.column.getIsSorted() === "asc" ? "↑" : "↓" })
2515
2521
  ] })
2516
2522
  },
2517
- x.id
2523
+ _.id
2518
2524
  )) }, y.id)) }),
2519
- /* @__PURE__ */ g("tbody", { children: H.getRowModel().rows.map((y) => {
2520
- const x = a.has(y.original.rowIndex);
2525
+ /* @__PURE__ */ g("tbody", { children: z.getRowModel().rows.map((y) => {
2526
+ const _ = u.has(y.original.rowIndex);
2521
2527
  return /* @__PURE__ */ g(
2522
2528
  "tr",
2523
2529
  {
2524
- className: j(x && "ff-row-error"),
2530
+ className: j(_ && "ff-row-error"),
2525
2531
  children: y.getVisibleCells().map((V) => /* @__PURE__ */ g("td", { children: je(V.column.columnDef.cell, V.getContext()) }, V.id))
2526
2532
  },
2527
2533
  y.id
@@ -2531,16 +2537,16 @@ const Ue = ({
2531
2537
  /* @__PURE__ */ v("div", { className: "ff-flex ff-items-center ff-justify-between ff-px-2", children: [
2532
2538
  /* @__PURE__ */ v("div", { className: "ff-text-sm", style: { color: "var(--ff-text-muted)" }, children: [
2533
2539
  "Page ",
2534
- H.getState().pagination.pageIndex + 1,
2540
+ z.getState().pagination.pageIndex + 1,
2535
2541
  " of ",
2536
- H.getPageCount()
2542
+ z.getPageCount()
2537
2543
  ] }),
2538
2544
  /* @__PURE__ */ v("div", { className: "ff-flex ff-items-center ff-gap-2", children: [
2539
2545
  /* @__PURE__ */ v(
2540
2546
  "button",
2541
2547
  {
2542
- onClick: () => H.previousPage(),
2543
- disabled: !H.getCanPreviousPage(),
2548
+ onClick: () => z.previousPage(),
2549
+ disabled: !z.getCanPreviousPage(),
2544
2550
  className: "ff-btn ff-btn-secondary ff-btn-sm",
2545
2551
  children: [
2546
2552
  /* @__PURE__ */ g(St, { className: "ff-w-4 ff-h-4" }),
@@ -2551,8 +2557,8 @@ const Ue = ({
2551
2557
  /* @__PURE__ */ v(
2552
2558
  "button",
2553
2559
  {
2554
- onClick: () => H.nextPage(),
2555
- disabled: !H.getCanNextPage(),
2560
+ onClick: () => z.nextPage(),
2561
+ disabled: !z.getCanNextPage(),
2556
2562
  className: "ff-btn ff-btn-secondary ff-btn-sm",
2557
2563
  children: [
2558
2564
  "Next",
@@ -2569,7 +2575,7 @@ const Ue = ({
2569
2575
  const { validationResults: o } = J();
2570
2576
  if (!o)
2571
2577
  return null;
2572
- const { isValid: t, totalRows: n, validRows: r, errorCount: l, warningCount: i, infoCount: s, summary: a } = o, f = Math.round(r / n * 100);
2578
+ const { isValid: t, totalRows: n, validRows: r, errorCount: l, warningCount: i, infoCount: a, summary: u } = o, f = Math.round(r / n * 100);
2573
2579
  return /* @__PURE__ */ v("div", { className: "ff-space-y-4", children: [
2574
2580
  /* @__PURE__ */ v(
2575
2581
  "div",
@@ -2620,9 +2626,9 @@ const Ue = ({
2620
2626
  /* @__PURE__ */ g("p", { className: "ff-text-sm", style: { color: "var(--ff-warning)" }, children: "Warnings" })
2621
2627
  ] })
2622
2628
  ] }),
2623
- e && a.byColumn && Object.keys(a.byColumn).length > 0 && /* @__PURE__ */ v("div", { className: "ff-border ff-rounded-xl ff-overflow-hidden", style: { backgroundColor: "var(--ff-bg-primary)", borderColor: "var(--ff-border-light)" }, children: [
2629
+ e && u.byColumn && Object.keys(u.byColumn).length > 0 && /* @__PURE__ */ v("div", { className: "ff-border ff-rounded-xl ff-overflow-hidden", style: { backgroundColor: "var(--ff-bg-primary)", borderColor: "var(--ff-border-light)" }, children: [
2624
2630
  /* @__PURE__ */ g("div", { className: "ff-px-4 ff-py-3", style: { backgroundColor: "var(--ff-bg-secondary)" }, children: /* @__PURE__ */ g("h4", { className: "ff-font-medium ff-text-sm", style: { color: "var(--ff-text-secondary)" }, children: "Issues by Column" }) }),
2625
- /* @__PURE__ */ g("div", { children: Object.entries(a.byColumn).filter(([, p]) => p.errorCount > 0 || p.warningCount > 0).map(([p, c], d, u) => /* @__PURE__ */ v(
2631
+ /* @__PURE__ */ g("div", { children: Object.entries(u.byColumn).filter(([, p]) => p.errorCount > 0 || p.warningCount > 0).map(([p, c], d, s) => /* @__PURE__ */ v(
2626
2632
  "div",
2627
2633
  {
2628
2634
  className: "ff-flex ff-items-center ff-justify-between ff-px-4 ff-py-3",
@@ -2653,12 +2659,12 @@ const Ue = ({
2653
2659
  p
2654
2660
  )) })
2655
2661
  ] }),
2656
- e && a.duplicates && a.duplicates.length > 0 && /* @__PURE__ */ g("div", { className: "ff-border ff-rounded-lg ff-p-4", style: { backgroundColor: "var(--ff-warning-light)", borderColor: "var(--ff-warning)" }, children: /* @__PURE__ */ v("div", { className: "ff-flex ff-items-start ff-gap-3", children: [
2662
+ e && u.duplicates && u.duplicates.length > 0 && /* @__PURE__ */ g("div", { className: "ff-border ff-rounded-lg ff-p-4", style: { backgroundColor: "var(--ff-warning-light)", borderColor: "var(--ff-warning)" }, children: /* @__PURE__ */ v("div", { className: "ff-flex ff-items-start ff-gap-3", children: [
2657
2663
  /* @__PURE__ */ g(Re, { className: "ff-w-5 ff-h-5 ff-flex-shrink-0 ff-mt-0.5", style: { color: "var(--ff-warning)" } }),
2658
2664
  /* @__PURE__ */ v("div", { children: [
2659
2665
  /* @__PURE__ */ g("h4", { className: "ff-font-medium", style: { color: "var(--ff-warning-dark)" }, children: "Duplicate Values Found" }),
2660
2666
  /* @__PURE__ */ v("ul", { className: "ff-mt-2 ff-space-y-1 ff-text-sm", style: { color: "var(--ff-warning-dark)" }, children: [
2661
- a.duplicates.slice(0, 5).map((p, c) => /* @__PURE__ */ v("li", { children: [
2667
+ u.duplicates.slice(0, 5).map((p, c) => /* @__PURE__ */ v("li", { children: [
2662
2668
  /* @__PURE__ */ g("span", { className: "ff-font-mono", children: p.columnKey }),
2663
2669
  ': "',
2664
2670
  String(p.value),
@@ -2671,9 +2677,9 @@ const Ue = ({
2671
2677
  p.rowIndices.length > 3 ? "..." : "",
2672
2678
  ")"
2673
2679
  ] }, c)),
2674
- a.duplicates.length > 5 && /* @__PURE__ */ v("li", { style: { color: "var(--ff-warning)" }, children: [
2680
+ u.duplicates.length > 5 && /* @__PURE__ */ v("li", { style: { color: "var(--ff-warning)" }, children: [
2675
2681
  "... and ",
2676
- a.duplicates.length - 5,
2682
+ u.duplicates.length - 5,
2677
2683
  " more duplicate groups"
2678
2684
  ] })
2679
2685
  ] })
@@ -2694,75 +2700,75 @@ const Ue = ({
2694
2700
  useShadowDom: r = !1,
2695
2701
  onComplete: l,
2696
2702
  onCancel: i,
2697
- onError: s
2703
+ onError: a
2698
2704
  }) => {
2699
2705
  const {
2700
- step: a,
2706
+ step: u,
2701
2707
  sessionId: f,
2702
2708
  file: p,
2703
2709
  mappings: c,
2704
2710
  validationResults: d,
2705
- isLoading: u,
2711
+ isLoading: s,
2706
2712
  error: m,
2707
2713
  setSchema: h,
2708
2714
  setSessionId: w,
2709
- setParsedData: R,
2710
- setMappings: _,
2711
- setUnmapped: $,
2715
+ setParsedData: C,
2716
+ setMappings: x,
2717
+ setUnmapped: F,
2712
2718
  setValidationResults: E,
2713
2719
  setStep: I,
2714
2720
  nextStep: D,
2715
2721
  previousStep: K,
2716
2722
  setLoading: N,
2717
- setError: z,
2723
+ setError: H,
2718
2724
  reset: T
2719
- } = J(), [O, H] = Y(null), [y, x] = Y(null);
2725
+ } = J(), [O, z] = Y(null), [y, _] = Y(null);
2720
2726
  Ae(() => {
2721
- if (x(null), e)
2727
+ if (_(null), e)
2722
2728
  if (ct(e)) {
2723
- const F = pt(e);
2724
- F ? H(F) : (x(`Failed to load template "${e}"`), s == null || s(new Error(`Failed to load template "${e}"`)));
2729
+ const $ = pt(e);
2730
+ $ ? z($) : (_(`Failed to load template "${e}"`), a == null || a(new Error(`Failed to load template "${e}"`)));
2725
2731
  } else {
2726
- const F = `Template "${e}" not found. Available templates: ${Oe.join(", ")}`;
2727
- x(F), s == null || s(new Error(F));
2732
+ const $ = `Template "${e}" not found. Available templates: ${Oe.join(", ")}`;
2733
+ _($), a == null || a(new Error($));
2728
2734
  }
2729
2735
  else if (o)
2730
- H(o);
2736
+ z(o);
2731
2737
  else {
2732
- const F = `No template or schema provided. Please specify a template (${Oe.join(", ")}) or provide a custom schema.`;
2733
- x(F), s == null || s(new Error(F));
2738
+ const $ = `No template or schema provided. Please specify a template (${Oe.join(", ")}) or provide a custom schema.`;
2739
+ _($), a == null || a(new Error($));
2734
2740
  }
2735
- }, [e, o, s]), Ae(() => {
2741
+ }, [e, o, a]), Ae(() => {
2736
2742
  O && (h(O), V(O));
2737
2743
  }, [O]);
2738
- const V = async (F) => {
2744
+ const V = async ($) => {
2739
2745
  try {
2740
2746
  N(!0);
2741
- const b = await ee().createImportSession(F);
2747
+ const b = await ee().createImportSession($);
2742
2748
  w(b.sessionId);
2743
2749
  } catch (M) {
2744
2750
  const b = M;
2745
- z(b.message), s == null || s(b);
2751
+ H(b.message), a == null || a(b);
2746
2752
  } finally {
2747
2753
  N(!1);
2748
2754
  }
2749
- }, W = Me(async (F) => {
2755
+ }, W = Me(async ($) => {
2750
2756
  if (f)
2751
2757
  try {
2752
- N(!0), z(null);
2753
- const b = await ee().uploadFile(f, F), He = (Q, at) => ({
2758
+ N(!0), H(null);
2759
+ const b = await ee().uploadFile(f, $), ze = (Q, at) => ({
2754
2760
  rowIndex: Q.rowIndex ?? at,
2755
2761
  data: Q.data ?? Q,
2756
2762
  rawData: Q.rawData ?? Object.values(Q.data ?? Q)
2757
2763
  });
2758
- R({
2764
+ C({
2759
2765
  headers: b.data.headers,
2760
- rows: b.data.sampleRows.map(He),
2766
+ rows: b.data.sampleRows.map(ze),
2761
2767
  totalRows: b.data.totalRows,
2762
- sampleRows: b.data.sampleRows.map(He)
2768
+ sampleRows: b.data.sampleRows.map(ze)
2763
2769
  }), D(), await k();
2764
2770
  } catch (M) {
2765
- z(`Failed to process the uploaded file: ${M.message}`);
2771
+ H(`Failed to process the uploaded file: ${M.message}`);
2766
2772
  } finally {
2767
2773
  N(!1);
2768
2774
  }
@@ -2771,45 +2777,45 @@ const Ue = ({
2771
2777
  try {
2772
2778
  N(!0);
2773
2779
  const M = await ee().matchColumns(f);
2774
- _(M.mappings), $(M.unmappedSource, M.unmappedTarget);
2775
- } catch (F) {
2776
- z(`Column matching failed: ${F.message}`);
2780
+ x(M.mappings), F(M.unmappedSource, M.unmappedTarget);
2781
+ } catch ($) {
2782
+ H(`Column matching failed: ${$.message}`);
2777
2783
  } finally {
2778
2784
  N(!1);
2779
2785
  }
2780
2786
  }, ke = async () => {
2781
2787
  if (f)
2782
2788
  try {
2783
- N(!0), z(null);
2789
+ N(!0), H(null);
2784
2790
  const M = await ee().validateImport(f);
2785
2791
  E(M.validation), D();
2786
- } catch (F) {
2787
- z(`Validation failed: ${F.message}`);
2792
+ } catch ($) {
2793
+ H(`Validation failed: ${$.message}`);
2788
2794
  } finally {
2789
2795
  N(!1);
2790
2796
  }
2791
2797
  }, [X, ue] = Y(null), rt = async () => {
2792
2798
  if (f)
2793
2799
  try {
2794
- N(!0), z(null), ue(null);
2800
+ N(!0), H(null), ue(null);
2795
2801
  const M = await ee().completeImport(f, {
2796
2802
  skipInvalidRows: !0,
2797
2803
  acknowledgeWarnings: !0
2798
2804
  });
2799
2805
  I("complete"), l == null || l(M);
2800
- } catch (F) {
2801
- ue(F.message), I("complete");
2806
+ } catch ($) {
2807
+ ue($.message), I("complete");
2802
2808
  } finally {
2803
2809
  N(!1);
2804
2810
  }
2805
2811
  }, fe = () => {
2806
2812
  T(), i == null || i();
2807
- }, lt = () => An.findIndex((F) => F.key === a), it = () => {
2808
- switch (a) {
2813
+ }, lt = () => An.findIndex(($) => $.key === u), it = () => {
2814
+ switch (u) {
2809
2815
  case "upload":
2810
2816
  return p !== null;
2811
2817
  case "mapping":
2812
- return c.length > 0 && c.some((F) => F.targetKey !== null);
2818
+ return c.length > 0 && c.some(($) => $.targetKey !== null);
2813
2819
  case "validation":
2814
2820
  return d !== null;
2815
2821
  case "review":
@@ -2818,7 +2824,7 @@ const Ue = ({
2818
2824
  return !1;
2819
2825
  }
2820
2826
  }, st = async () => {
2821
- switch (a) {
2827
+ switch (u) {
2822
2828
  case "mapping":
2823
2829
  await ke();
2824
2830
  break;
@@ -2845,8 +2851,8 @@ const Ue = ({
2845
2851
  /* @__PURE__ */ g("p", { style: { color: "var(--ff-text-muted)" }, children: "Loading template..." })
2846
2852
  ] }) }) });
2847
2853
  const Z = () => {
2848
- const F = a === "review" ? "validation" : a;
2849
- return Ce.indexOf(F);
2854
+ const $ = u === "review" ? "validation" : u;
2855
+ return Ce.indexOf($);
2850
2856
  }, Le = /* @__PURE__ */ g(oe, { children: /* @__PURE__ */ v("div", { className: t === "embed" ? "ff-container ff-embed" : "ff-container ff-modal", children: [
2851
2857
  /* @__PURE__ */ v("div", { className: "ff-modal-header", children: [
2852
2858
  /* @__PURE__ */ v("div", { className: "ff-modal-header-left", children: [
@@ -2854,7 +2860,7 @@ const Ue = ({
2854
2860
  /* @__PURE__ */ g("div", { className: "ff-modal-icon", children: /* @__PURE__ */ g($t, {}) }),
2855
2861
  /* @__PURE__ */ g("h2", { className: "ff-modal-title", children: "Import Data" })
2856
2862
  ] }),
2857
- /* @__PURE__ */ g("div", { className: "ff-steps ff-ml-4", children: Ce.map((F, M) => /* @__PURE__ */ v(ut.Fragment, { children: [
2863
+ /* @__PURE__ */ g("div", { className: "ff-steps ff-ml-4", children: Ce.map(($, M) => /* @__PURE__ */ v(ut.Fragment, { children: [
2858
2864
  /* @__PURE__ */ g(
2859
2865
  "div",
2860
2866
  {
@@ -2871,7 +2877,7 @@ const Ue = ({
2871
2877
  "ff-step-connector",
2872
2878
  Z() > M && "ff-step-connector-complete"
2873
2879
  ) })
2874
- ] }, F)) })
2880
+ ] }, $)) })
2875
2881
  ] }),
2876
2882
  /* @__PURE__ */ g(
2877
2883
  "button",
@@ -2884,17 +2890,17 @@ const Ue = ({
2884
2890
  ] }),
2885
2891
  /* @__PURE__ */ v("div", { className: "ff-modal-body", children: [
2886
2892
  m && /* @__PURE__ */ g("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 }),
2887
- a === "upload" && /* @__PURE__ */ g("div", { className: "ff-py-4", children: /* @__PURE__ */ g("div", { className: "ff-max-w-xl ff-mx-auto", children: /* @__PURE__ */ g(zt, { onFileSelect: W }) }) }),
2888
- a === "mapping" && /* @__PURE__ */ g(At, {}),
2889
- a === "validation" && /* @__PURE__ */ v("div", { className: "ff-space-y-6", children: [
2893
+ u === "upload" && /* @__PURE__ */ g("div", { className: "ff-py-4", children: /* @__PURE__ */ g("div", { className: "ff-max-w-xl ff-mx-auto", children: /* @__PURE__ */ g(Ht, { onFileSelect: W }) }) }),
2894
+ u === "mapping" && /* @__PURE__ */ g(At, {}),
2895
+ u === "validation" && /* @__PURE__ */ v("div", { className: "ff-space-y-6", children: [
2890
2896
  /* @__PURE__ */ g(Ke, {}),
2891
2897
  /* @__PURE__ */ g(Ue, { editable: !0 })
2892
2898
  ] }),
2893
- a === "review" && /* @__PURE__ */ v("div", { className: "ff-space-y-6", children: [
2899
+ u === "review" && /* @__PURE__ */ v("div", { className: "ff-space-y-6", children: [
2894
2900
  /* @__PURE__ */ g(Ke, { showDetails: !1 }),
2895
2901
  /* @__PURE__ */ g(Ue, { editable: !1, pageSize: 10 })
2896
2902
  ] }),
2897
- a === "complete" && /* @__PURE__ */ g("div", { className: "ff-flex ff-flex-col ff-items-center ff-justify-center ff-py-12", children: X ? /* @__PURE__ */ v(oe, { children: [
2903
+ u === "complete" && /* @__PURE__ */ g("div", { className: "ff-flex ff-flex-col ff-items-center ff-justify-center ff-py-12", children: X ? /* @__PURE__ */ v(oe, { children: [
2898
2904
  /* @__PURE__ */ g("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__ */ g(se, { className: "ff-w-10 ff-h-10", style: { color: "var(--ff-error)" } }) }),
2899
2905
  /* @__PURE__ */ g("h3", { className: "ff-text-xl ff-font-semibold ff-mb-2", style: { color: "var(--ff-text-primary)" }, children: "Import Failed" }),
2900
2906
  /* @__PURE__ */ g("p", { className: "ff-text-center ff-max-w-md ff-mb-4", style: { color: "var(--ff-text-muted)" }, children: X }),
@@ -2917,12 +2923,12 @@ const Ue = ({
2917
2923
  /* @__PURE__ */ g("p", { style: { color: "var(--ff-text-muted)" }, children: "Your data has been successfully imported." })
2918
2924
  ] }) })
2919
2925
  ] }),
2920
- a !== "complete" && /* @__PURE__ */ v("div", { className: "ff-modal-footer", children: [
2926
+ u !== "complete" && /* @__PURE__ */ v("div", { className: "ff-modal-footer", children: [
2921
2927
  /* @__PURE__ */ g(
2922
2928
  "button",
2923
2929
  {
2924
2930
  onClick: K,
2925
- disabled: lt() === 0 || u,
2931
+ disabled: lt() === 0 || s,
2926
2932
  className: "ff-btn ff-btn-secondary",
2927
2933
  children: "Back"
2928
2934
  }
@@ -2931,12 +2937,12 @@ const Ue = ({
2931
2937
  "button",
2932
2938
  {
2933
2939
  onClick: st,
2934
- disabled: !it() || u,
2940
+ disabled: !it() || s,
2935
2941
  className: "ff-btn ff-btn-primary",
2936
- children: u ? /* @__PURE__ */ v(oe, { children: [
2942
+ children: s ? /* @__PURE__ */ v(oe, { children: [
2937
2943
  /* @__PURE__ */ g(be, { className: "ff-w-4 ff-h-4 ff-animate-spin" }),
2938
2944
  "Processing..."
2939
- ] }) : a === "review" ? "Complete Import" : "Continue"
2945
+ ] }) : u === "review" ? "Complete Import" : "Continue"
2940
2946
  }
2941
2947
  )
2942
2948
  ] })
@@ -2946,9 +2952,9 @@ const Ue = ({
2946
2952
  export {
2947
2953
  At as C,
2948
2954
  Ue as D,
2949
- zt as F,
2955
+ Ht as F,
2950
2956
  Tn as I,
2951
2957
  Ke as V,
2952
2958
  J as u
2953
2959
  };
2954
- //# sourceMappingURL=ImportWizard-D4GlHhyY.mjs.map
2960
+ //# sourceMappingURL=ImportWizard-wQRSiaEP.mjs.map