@tanstack/svelte-table 8.7.4 → 8.7.6

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.
@@ -55,7 +55,7 @@
55
55
  subArr.forEach(item => {
56
56
  flat.push(item);
57
57
  const children = getChildren(item);
58
- if (children?.length) {
58
+ if (children != null && children.length) {
59
59
  recurse(children);
60
60
  }
61
61
  });
@@ -78,9 +78,9 @@
78
78
  let resultTime;
79
79
  if (opts.key && opts.debug) resultTime = Date.now();
80
80
  result = fn(...newDeps);
81
- opts?.onChange?.(result);
81
+ opts == null ? void 0 : opts.onChange == null ? void 0 : opts.onChange(result);
82
82
  if (opts.key && opts.debug) {
83
- if (opts?.debug()) {
83
+ if (opts != null && opts.debug()) {
84
84
  const depEndTime = Math.round((Date.now() - depTime) * 100) / 100;
85
85
  const resultEndTime = Math.round((Date.now() - resultTime) * 100) / 100;
86
86
  const resultFpsPercentage = resultEndTime / 16;
@@ -94,7 +94,7 @@
94
94
  console.info(`%c⏱ ${pad(resultEndTime, 5)} /${pad(depEndTime, 5)} ms`, `
95
95
  font-size: .6rem;
96
96
  font-weight: bold;
97
- color: hsl(${Math.max(0, Math.min(120 - 120 * resultFpsPercentage, 120))}deg 100% 31%);`, opts?.key);
97
+ color: hsl(${Math.max(0, Math.min(120 - 120 * resultFpsPercentage, 120))}deg 100% 31%);`, opts == null ? void 0 : opts.key);
98
98
  }
99
99
  }
100
100
  return result;
@@ -143,7 +143,8 @@
143
143
  columnDef: resolvedColumnDef,
144
144
  columns: [],
145
145
  getFlatColumns: memo(() => [true], () => {
146
- return [column, ...column.columns?.flatMap(d => d.getFlatColumns())];
146
+ var _column$columns;
147
+ return [column, ...((_column$columns = column.columns) == null ? void 0 : _column$columns.flatMap(d => d.getFlatColumns()))];
147
148
  }, {
148
149
  key: "development" === 'production' ,
149
150
  debug: () => {
@@ -152,7 +153,8 @@
152
153
  }
153
154
  }),
154
155
  getLeafColumns: memo(() => [table._getOrderColumnsFn()], orderColumns => {
155
- if (column.columns?.length) {
156
+ var _column$columns2;
157
+ if ((_column$columns2 = column.columns) != null && _column$columns2.length) {
156
158
  let leafColumns = column.columns.flatMap(column => column.getLeafColumns());
157
159
  return orderColumns(leafColumns);
158
160
  }
@@ -166,7 +168,7 @@
166
168
  })
167
169
  };
168
170
  column = table._features.reduce((obj, feature) => {
169
- return Object.assign(obj, feature.createColumn?.(column, table));
171
+ return Object.assign(obj, feature.createColumn == null ? void 0 : feature.createColumn(column, table));
170
172
  }, column);
171
173
 
172
174
  // Yes, we have to convert table to uknown, because we know more than the compiler here.
@@ -207,7 +209,7 @@
207
209
  })
208
210
  };
209
211
  table._features.forEach(feature => {
210
- Object.assign(header, feature.createHeader?.(header, table));
212
+ Object.assign(header, feature.createHeader == null ? void 0 : feature.createHeader(header, table));
211
213
  });
212
214
  return header;
213
215
  }
@@ -218,9 +220,9 @@
218
220
 
219
221
  getHeaderGroups: memo(() => [table.getAllColumns(), table.getVisibleLeafColumns(), table.getState().columnPinning.left, table.getState().columnPinning.right], (allColumns, leafColumns, left, right) => {
220
222
  var _left$map$filter, _right$map$filter;
221
- const leftColumns = (_left$map$filter = left?.map(columnId => leafColumns.find(d => d.id === columnId)).filter(Boolean)) != null ? _left$map$filter : [];
222
- const rightColumns = (_right$map$filter = right?.map(columnId => leafColumns.find(d => d.id === columnId)).filter(Boolean)) != null ? _right$map$filter : [];
223
- const centerColumns = leafColumns.filter(column => !left?.includes(column.id) && !right?.includes(column.id));
223
+ const leftColumns = (_left$map$filter = left == null ? void 0 : left.map(columnId => leafColumns.find(d => d.id === columnId)).filter(Boolean)) != null ? _left$map$filter : [];
224
+ const rightColumns = (_right$map$filter = right == null ? void 0 : right.map(columnId => leafColumns.find(d => d.id === columnId)).filter(Boolean)) != null ? _right$map$filter : [];
225
+ const centerColumns = leafColumns.filter(column => !(left != null && left.includes(column.id)) && !(right != null && right.includes(column.id)));
224
226
  const headerGroups = buildHeaderGroups(allColumns, [...leftColumns, ...centerColumns, ...rightColumns], table);
225
227
  return headerGroups;
226
228
  }, {
@@ -231,7 +233,7 @@
231
233
  }
232
234
  }),
233
235
  getCenterHeaderGroups: memo(() => [table.getAllColumns(), table.getVisibleLeafColumns(), table.getState().columnPinning.left, table.getState().columnPinning.right], (allColumns, leafColumns, left, right) => {
234
- leafColumns = leafColumns.filter(column => !left?.includes(column.id) && !right?.includes(column.id));
236
+ leafColumns = leafColumns.filter(column => !(left != null && left.includes(column.id)) && !(right != null && right.includes(column.id)));
235
237
  return buildHeaderGroups(allColumns, leafColumns, table, 'center');
236
238
  }, {
237
239
  key: 'getCenterHeaderGroups',
@@ -242,7 +244,7 @@
242
244
  }),
243
245
  getLeftHeaderGroups: memo(() => [table.getAllColumns(), table.getVisibleLeafColumns(), table.getState().columnPinning.left], (allColumns, leafColumns, left) => {
244
246
  var _left$map$filter2;
245
- const orderedLeafColumns = (_left$map$filter2 = left?.map(columnId => leafColumns.find(d => d.id === columnId)).filter(Boolean)) != null ? _left$map$filter2 : [];
247
+ const orderedLeafColumns = (_left$map$filter2 = left == null ? void 0 : left.map(columnId => leafColumns.find(d => d.id === columnId)).filter(Boolean)) != null ? _left$map$filter2 : [];
246
248
  return buildHeaderGroups(allColumns, orderedLeafColumns, table, 'left');
247
249
  }, {
248
250
  key: 'getLeftHeaderGroups',
@@ -253,7 +255,7 @@
253
255
  }),
254
256
  getRightHeaderGroups: memo(() => [table.getAllColumns(), table.getVisibleLeafColumns(), table.getState().columnPinning.right], (allColumns, leafColumns, right) => {
255
257
  var _right$map$filter2;
256
- const orderedLeafColumns = (_right$map$filter2 = right?.map(columnId => leafColumns.find(d => d.id === columnId)).filter(Boolean)) != null ? _right$map$filter2 : [];
258
+ const orderedLeafColumns = (_right$map$filter2 = right == null ? void 0 : right.map(columnId => leafColumns.find(d => d.id === columnId)).filter(Boolean)) != null ? _right$map$filter2 : [];
257
259
  return buildHeaderGroups(allColumns, orderedLeafColumns, table, 'right');
258
260
  }, {
259
261
  key: 'getRightHeaderGroups',
@@ -349,7 +351,10 @@
349
351
  // Leaf Headers
350
352
 
351
353
  getCenterLeafHeaders: memo(() => [table.getCenterFlatHeaders()], flatHeaders => {
352
- return flatHeaders.filter(header => !header.subHeaders?.length);
354
+ return flatHeaders.filter(header => {
355
+ var _header$subHeaders;
356
+ return !((_header$subHeaders = header.subHeaders) != null && _header$subHeaders.length);
357
+ });
353
358
  }, {
354
359
  key: 'getCenterLeafHeaders',
355
360
  debug: () => {
@@ -358,7 +363,10 @@
358
363
  }
359
364
  }),
360
365
  getLeftLeafHeaders: memo(() => [table.getLeftFlatHeaders()], flatHeaders => {
361
- return flatHeaders.filter(header => !header.subHeaders?.length);
366
+ return flatHeaders.filter(header => {
367
+ var _header$subHeaders2;
368
+ return !((_header$subHeaders2 = header.subHeaders) != null && _header$subHeaders2.length);
369
+ });
362
370
  }, {
363
371
  key: 'getLeftLeafHeaders',
364
372
  debug: () => {
@@ -367,7 +375,10 @@
367
375
  }
368
376
  }),
369
377
  getRightLeafHeaders: memo(() => [table.getRightFlatHeaders()], flatHeaders => {
370
- return flatHeaders.filter(header => !header.subHeaders?.length);
378
+ return flatHeaders.filter(header => {
379
+ var _header$subHeaders3;
380
+ return !((_header$subHeaders3 = header.subHeaders) != null && _header$subHeaders3.length);
381
+ });
371
382
  }, {
372
383
  key: 'getRightLeafHeaders',
373
384
  debug: () => {
@@ -376,8 +387,8 @@
376
387
  }
377
388
  }),
378
389
  getLeafHeaders: memo(() => [table.getLeftHeaderGroups(), table.getCenterHeaderGroups(), table.getRightHeaderGroups()], (left, center, right) => {
379
- var _left$0$headers, _center$0$headers, _right$0$headers;
380
- return [...((_left$0$headers = left[0]?.headers) != null ? _left$0$headers : []), ...((_center$0$headers = center[0]?.headers) != null ? _center$0$headers : []), ...((_right$0$headers = right[0]?.headers) != null ? _right$0$headers : [])].map(header => {
390
+ var _left$0$headers, _left$, _center$0$headers, _center$, _right$0$headers, _right$;
391
+ return [...((_left$0$headers = (_left$ = left[0]) == null ? void 0 : _left$.headers) != null ? _left$0$headers : []), ...((_center$0$headers = (_center$ = center[0]) == null ? void 0 : _center$.headers) != null ? _center$0$headers : []), ...((_right$0$headers = (_right$ = right[0]) == null ? void 0 : _right$.headers) != null ? _right$0$headers : [])].map(header => {
381
392
  return header.getLeafHeaders();
382
393
  }).flat();
383
394
  }, {
@@ -391,7 +402,7 @@
391
402
  }
392
403
  };
393
404
  function buildHeaderGroups(allColumns, columnsToGroup, table, headerFamily) {
394
- var _headerGroups$0$heade;
405
+ var _headerGroups$0$heade, _headerGroups$;
395
406
  // Find the max depth of the columns:
396
407
  // build the leaf column row
397
408
  // build each buffer row going up
@@ -405,7 +416,8 @@
405
416
  }
406
417
  maxDepth = Math.max(maxDepth, depth);
407
418
  columns.filter(column => column.getIsVisible()).forEach(column => {
408
- if (column.columns?.length) {
419
+ var _column$columns;
420
+ if ((_column$columns = column.columns) != null && _column$columns.length) {
409
421
  findMaxDepth(column.columns, depth + 1);
410
422
  }
411
423
  }, 0);
@@ -439,13 +451,13 @@
439
451
  column = headerToGroup.column;
440
452
  isPlaceholder = true;
441
453
  }
442
- if (latestPendingParentHeader && latestPendingParentHeader?.column === column) {
454
+ if (latestPendingParentHeader && (latestPendingParentHeader == null ? void 0 : latestPendingParentHeader.column) === column) {
443
455
  // This column is repeated. Add it as a sub header to the next batch
444
456
  latestPendingParentHeader.subHeaders.push(headerToGroup);
445
457
  } else {
446
458
  // This is a new header. Let's create it
447
459
  const header = createHeader(table, column, {
448
- id: [headerFamily, depth, column.id, headerToGroup?.id].filter(Boolean).join('_'),
460
+ id: [headerFamily, depth, column.id, headerToGroup == null ? void 0 : headerToGroup.id].filter(Boolean).join('_'),
449
461
  isPlaceholder,
450
462
  placeholderId: isPlaceholder ? `${pendingParentHeaders.filter(d => d.column === column).length}` : undefined,
451
463
  depth,
@@ -506,7 +518,7 @@
506
518
  };
507
519
  });
508
520
  };
509
- recurseHeadersForSpans((_headerGroups$0$heade = headerGroups[0]?.headers) != null ? _headerGroups$0$heade : []);
521
+ recurseHeadersForSpans((_headerGroups$0$heade = (_headerGroups$ = headerGroups[0]) == null ? void 0 : _headerGroups$.headers) != null ? _headerGroups$0$heade : []);
510
522
  return headerGroups;
511
523
  }
512
524
 
@@ -606,7 +618,7 @@
606
618
  if (!canResize) {
607
619
  return;
608
620
  }
609
- e.persist?.();
621
+ e.persist == null ? void 0 : e.persist();
610
622
  if (isTouchStartEvent(e)) {
611
623
  // lets not respond to multiple touches (e.g. 2 or 3 fingers)
612
624
  if (e.touches && e.touches.length > 1) {
@@ -623,8 +635,8 @@
623
635
  }
624
636
  table.setColumnSizingInfo(old => {
625
637
  var _old$startOffset, _old$startSize;
626
- const deltaOffset = clientXPos - ((_old$startOffset = old?.startOffset) != null ? _old$startOffset : 0);
627
- const deltaPercentage = Math.max(deltaOffset / ((_old$startSize = old?.startSize) != null ? _old$startSize : 0), -0.999999);
638
+ const deltaOffset = clientXPos - ((_old$startOffset = old == null ? void 0 : old.startOffset) != null ? _old$startOffset : 0);
639
+ const deltaPercentage = Math.max(deltaOffset / ((_old$startSize = old == null ? void 0 : old.startSize) != null ? _old$startSize : 0), -0.999999);
628
640
  old.columnSizingStart.forEach(_ref3 => {
629
641
  let [columnId, headerSize] = _ref3;
630
642
  newColumnSizing[columnId] = Math.round(Math.max(headerSize + headerSize * deltaPercentage, 0) * 100) / 100;
@@ -673,13 +685,14 @@
673
685
  return false;
674
686
  },
675
687
  upHandler: e => {
688
+ var _e$touches$;
676
689
  document.removeEventListener('touchmove', touchEvents.moveHandler);
677
690
  document.removeEventListener('touchend', touchEvents.upHandler);
678
691
  if (e.cancelable) {
679
692
  e.preventDefault();
680
693
  e.stopPropagation();
681
694
  }
682
- onEnd(e.touches[0]?.clientX);
695
+ onEnd((_e$touches$ = e.touches[0]) == null ? void 0 : _e$touches$.clientX);
683
696
  }
684
697
  };
685
698
  const passiveIfSupported = passiveEventSupported() ? {
@@ -707,8 +720,8 @@
707
720
  },
708
721
  createTable: table => {
709
722
  return {
710
- setColumnSizing: updater => table.options.onColumnSizingChange?.(updater),
711
- setColumnSizingInfo: updater => table.options.onColumnSizingInfoChange?.(updater),
723
+ setColumnSizing: updater => table.options.onColumnSizingChange == null ? void 0 : table.options.onColumnSizingChange(updater),
724
+ setColumnSizingInfo: updater => table.options.onColumnSizingInfoChange == null ? void 0 : table.options.onColumnSizingInfoChange(updater),
712
725
  resetColumnSizing: defaultState => {
713
726
  var _table$initialState$c;
714
727
  table.setColumnSizing(defaultState ? {} : (_table$initialState$c = table.initialState.columnSizing) != null ? _table$initialState$c : {});
@@ -718,26 +731,26 @@
718
731
  table.setColumnSizingInfo(defaultState ? getDefaultColumnSizingInfoState() : (_table$initialState$c2 = table.initialState.columnSizingInfo) != null ? _table$initialState$c2 : getDefaultColumnSizingInfoState());
719
732
  },
720
733
  getTotalSize: () => {
721
- var _table$getHeaderGroup;
722
- return (_table$getHeaderGroup = table.getHeaderGroups()[0]?.headers.reduce((sum, header) => {
734
+ var _table$getHeaderGroup, _table$getHeaderGroup2;
735
+ return (_table$getHeaderGroup = (_table$getHeaderGroup2 = table.getHeaderGroups()[0]) == null ? void 0 : _table$getHeaderGroup2.headers.reduce((sum, header) => {
723
736
  return sum + header.getSize();
724
737
  }, 0)) != null ? _table$getHeaderGroup : 0;
725
738
  },
726
739
  getLeftTotalSize: () => {
727
- var _table$getLeftHeaderG;
728
- return (_table$getLeftHeaderG = table.getLeftHeaderGroups()[0]?.headers.reduce((sum, header) => {
740
+ var _table$getLeftHeaderG, _table$getLeftHeaderG2;
741
+ return (_table$getLeftHeaderG = (_table$getLeftHeaderG2 = table.getLeftHeaderGroups()[0]) == null ? void 0 : _table$getLeftHeaderG2.headers.reduce((sum, header) => {
729
742
  return sum + header.getSize();
730
743
  }, 0)) != null ? _table$getLeftHeaderG : 0;
731
744
  },
732
745
  getCenterTotalSize: () => {
733
- var _table$getCenterHeade;
734
- return (_table$getCenterHeade = table.getCenterHeaderGroups()[0]?.headers.reduce((sum, header) => {
746
+ var _table$getCenterHeade, _table$getCenterHeade2;
747
+ return (_table$getCenterHeade = (_table$getCenterHeade2 = table.getCenterHeaderGroups()[0]) == null ? void 0 : _table$getCenterHeade2.headers.reduce((sum, header) => {
735
748
  return sum + header.getSize();
736
749
  }, 0)) != null ? _table$getCenterHeade : 0;
737
750
  },
738
751
  getRightTotalSize: () => {
739
- var _table$getRightHeader;
740
- return (_table$getRightHeader = table.getRightHeaderGroups()[0]?.headers.reduce((sum, header) => {
752
+ var _table$getRightHeader, _table$getRightHeader2;
753
+ return (_table$getRightHeader = (_table$getRightHeader2 = table.getRightHeaderGroups()[0]) == null ? void 0 : _table$getRightHeader2.headers.reduce((sum, header) => {
741
754
  return sum + header.getSize();
742
755
  }, 0)) != null ? _table$getRightHeader : 0;
743
756
  }
@@ -804,7 +817,7 @@
804
817
  });
805
818
  }
806
819
  },
807
- setExpanded: updater => table.options.onExpandedChange?.(updater),
820
+ setExpanded: updater => table.options.onExpandedChange == null ? void 0 : table.options.onExpandedChange(updater),
808
821
  toggleAllRowsExpanded: expanded => {
809
822
  if (expanded != null ? expanded : !table.getIsAllRowsExpanded()) {
810
823
  table.setExpanded(true);
@@ -813,15 +826,15 @@
813
826
  }
814
827
  },
815
828
  resetExpanded: defaultState => {
816
- var _table$initialState$e;
817
- table.setExpanded(defaultState ? {} : (_table$initialState$e = table.initialState?.expanded) != null ? _table$initialState$e : {});
829
+ var _table$initialState$e, _table$initialState;
830
+ table.setExpanded(defaultState ? {} : (_table$initialState$e = (_table$initialState = table.initialState) == null ? void 0 : _table$initialState.expanded) != null ? _table$initialState$e : {});
818
831
  },
819
832
  getCanSomeRowsExpand: () => {
820
833
  return table.getRowModel().flatRows.some(row => row.getCanExpand());
821
834
  },
822
835
  getToggleAllRowsExpandedHandler: () => {
823
836
  return e => {
824
- e.persist?.();
837
+ e.persist == null ? void 0 : e.persist();
825
838
  table.toggleAllRowsExpanded();
826
839
  };
827
840
  },
@@ -874,7 +887,7 @@
874
887
  toggleExpanded: expanded => {
875
888
  table.setExpanded(old => {
876
889
  var _expanded;
877
- const exists = old === true ? true : !!old?.[row.id];
890
+ const exists = old === true ? true : !!(old != null && old[row.id]);
878
891
  let oldExpanded = {};
879
892
  if (old === true) {
880
893
  Object.keys(table.getRowModel().rowsById).forEach(rowId => {
@@ -903,11 +916,11 @@
903
916
  getIsExpanded: () => {
904
917
  var _table$options$getIsR;
905
918
  const expanded = table.getState().expanded;
906
- return !!((_table$options$getIsR = table.options.getIsRowExpanded?.(row)) != null ? _table$options$getIsR : expanded === true || expanded?.[row.id]);
919
+ return !!((_table$options$getIsR = table.options.getIsRowExpanded == null ? void 0 : table.options.getIsRowExpanded(row)) != null ? _table$options$getIsR : expanded === true || (expanded == null ? void 0 : expanded[row.id]));
907
920
  },
908
921
  getCanExpand: () => {
909
- var _table$options$getRow, _table$options$enable;
910
- return (_table$options$getRow = table.options.getRowCanExpand?.(row)) != null ? _table$options$getRow : ((_table$options$enable = table.options.enableExpanding) != null ? _table$options$enable : true) && !!row.subRows?.length;
922
+ var _table$options$getRow, _table$options$enable, _row$subRows;
923
+ return (_table$options$getRow = table.options.getRowCanExpand == null ? void 0 : table.options.getRowCanExpand(row)) != null ? _table$options$getRow : ((_table$options$enable = table.options.enableExpanding) != null ? _table$options$enable : true) && !!((_row$subRows = row.subRows) != null && _row$subRows.length);
911
924
  },
912
925
  getToggleExpandedHandler: () => {
913
926
  const canExpand = row.getCanExpand();
@@ -921,30 +934,40 @@
921
934
  };
922
935
 
923
936
  const includesString = (row, columnId, filterValue) => {
937
+ var _row$getValue;
924
938
  const search = filterValue.toLowerCase();
925
- return Boolean(row.getValue(columnId)?.toLowerCase().includes(search));
939
+ return Boolean((_row$getValue = row.getValue(columnId)) == null ? void 0 : _row$getValue.toLowerCase().includes(search));
926
940
  };
927
941
  includesString.autoRemove = val => testFalsey(val);
928
942
  const includesStringSensitive = (row, columnId, filterValue) => {
929
- return Boolean(row.getValue(columnId)?.includes(filterValue));
943
+ var _row$getValue2;
944
+ return Boolean((_row$getValue2 = row.getValue(columnId)) == null ? void 0 : _row$getValue2.includes(filterValue));
930
945
  };
931
946
  includesStringSensitive.autoRemove = val => testFalsey(val);
932
947
  const equalsString = (row, columnId, filterValue) => {
933
- return row.getValue(columnId)?.toLowerCase() === filterValue.toLowerCase();
948
+ var _row$getValue3;
949
+ return ((_row$getValue3 = row.getValue(columnId)) == null ? void 0 : _row$getValue3.toLowerCase()) === filterValue.toLowerCase();
934
950
  };
935
951
  equalsString.autoRemove = val => testFalsey(val);
936
952
  const arrIncludes = (row, columnId, filterValue) => {
937
- return row.getValue(columnId)?.includes(filterValue);
953
+ var _row$getValue4;
954
+ return (_row$getValue4 = row.getValue(columnId)) == null ? void 0 : _row$getValue4.includes(filterValue);
938
955
  };
939
- arrIncludes.autoRemove = val => testFalsey(val) || !val?.length;
956
+ arrIncludes.autoRemove = val => testFalsey(val) || !(val != null && val.length);
940
957
  const arrIncludesAll = (row, columnId, filterValue) => {
941
- return !filterValue.some(val => !row.getValue(columnId)?.includes(val));
958
+ return !filterValue.some(val => {
959
+ var _row$getValue5;
960
+ return !((_row$getValue5 = row.getValue(columnId)) != null && _row$getValue5.includes(val));
961
+ });
942
962
  };
943
- arrIncludesAll.autoRemove = val => testFalsey(val) || !val?.length;
963
+ arrIncludesAll.autoRemove = val => testFalsey(val) || !(val != null && val.length);
944
964
  const arrIncludesSome = (row, columnId, filterValue) => {
945
- return filterValue.some(val => row.getValue(columnId)?.includes(val));
965
+ return filterValue.some(val => {
966
+ var _row$getValue6;
967
+ return (_row$getValue6 = row.getValue(columnId)) == null ? void 0 : _row$getValue6.includes(val);
968
+ });
946
969
  };
947
- arrIncludesSome.autoRemove = val => testFalsey(val) || !val?.length;
970
+ arrIncludesSome.autoRemove = val => testFalsey(val) || !(val != null && val.length);
948
971
  const equals = (row, columnId, filterValue) => {
949
972
  return row.getValue(columnId) === filterValue;
950
973
  };
@@ -1017,7 +1040,8 @@
1017
1040
  maxLeafRowFilterDepth: 100,
1018
1041
  globalFilterFn: 'auto',
1019
1042
  getColumnCanGlobalFilter: column => {
1020
- const value = table.getCoreRowModel().flatRows[0]?._getAllCellsByColumnId()[column.id]?.getValue();
1043
+ var _table$getCoreRowMode, _table$getCoreRowMode2;
1044
+ const value = (_table$getCoreRowMode = table.getCoreRowModel().flatRows[0]) == null ? void 0 : (_table$getCoreRowMode2 = _table$getCoreRowMode._getAllCellsByColumnId()[column.id]) == null ? void 0 : _table$getCoreRowMode2.getValue();
1021
1045
  return typeof value === 'string' || typeof value === 'number';
1022
1046
  }
1023
1047
  };
@@ -1026,7 +1050,7 @@
1026
1050
  return {
1027
1051
  getAutoFilterFn: () => {
1028
1052
  const firstRow = table.getCoreRowModel().flatRows[0];
1029
- const value = firstRow?.getValue(column.id);
1053
+ const value = firstRow == null ? void 0 : firstRow.getValue(column.id);
1030
1054
  if (typeof value === 'string') {
1031
1055
  return filterFns.includesString;
1032
1056
  }
@@ -1045,10 +1069,10 @@
1045
1069
  return filterFns.weakEquals;
1046
1070
  },
1047
1071
  getFilterFn: () => {
1048
- var _table$options$filter;
1072
+ var _table$options$filter, _table$options$filter2;
1049
1073
  return isFunction(column.columnDef.filterFn) ? column.columnDef.filterFn : column.columnDef.filterFn === 'auto' ? column.getAutoFilterFn()
1050
1074
  // @ts-ignore
1051
- : (_table$options$filter = table.options.filterFns?.[column.columnDef.filterFn]) != null ? _table$options$filter : filterFns[column.columnDef.filterFn];
1075
+ : (_table$options$filter = (_table$options$filter2 = table.options.filterFns) == null ? void 0 : _table$options$filter2[column.columnDef.filterFn]) != null ? _table$options$filter : filterFns[column.columnDef.filterFn];
1052
1076
  },
1053
1077
  getCanFilter: () => {
1054
1078
  var _column$columnDef$ena, _table$options$enable, _table$options$enable2;
@@ -1056,24 +1080,27 @@
1056
1080
  },
1057
1081
  getCanGlobalFilter: () => {
1058
1082
  var _column$columnDef$ena2, _table$options$enable3, _table$options$enable4, _table$options$getCol;
1059
- return ((_column$columnDef$ena2 = column.columnDef.enableGlobalFilter) != null ? _column$columnDef$ena2 : true) && ((_table$options$enable3 = table.options.enableGlobalFilter) != null ? _table$options$enable3 : true) && ((_table$options$enable4 = table.options.enableFilters) != null ? _table$options$enable4 : true) && ((_table$options$getCol = table.options.getColumnCanGlobalFilter?.(column)) != null ? _table$options$getCol : true) && !!column.accessorFn;
1083
+ return ((_column$columnDef$ena2 = column.columnDef.enableGlobalFilter) != null ? _column$columnDef$ena2 : true) && ((_table$options$enable3 = table.options.enableGlobalFilter) != null ? _table$options$enable3 : true) && ((_table$options$enable4 = table.options.enableFilters) != null ? _table$options$enable4 : true) && ((_table$options$getCol = table.options.getColumnCanGlobalFilter == null ? void 0 : table.options.getColumnCanGlobalFilter(column)) != null ? _table$options$getCol : true) && !!column.accessorFn;
1060
1084
  },
1061
1085
  getIsFiltered: () => column.getFilterIndex() > -1,
1062
- getFilterValue: () => table.getState().columnFilters?.find(d => d.id === column.id)?.value,
1086
+ getFilterValue: () => {
1087
+ var _table$getState$colum, _table$getState$colum2;
1088
+ return (_table$getState$colum = table.getState().columnFilters) == null ? void 0 : (_table$getState$colum2 = _table$getState$colum.find(d => d.id === column.id)) == null ? void 0 : _table$getState$colum2.value;
1089
+ },
1063
1090
  getFilterIndex: () => {
1064
- var _table$getState$colum;
1065
- return (_table$getState$colum = table.getState().columnFilters?.findIndex(d => d.id === column.id)) != null ? _table$getState$colum : -1;
1091
+ var _table$getState$colum3, _table$getState$colum4;
1092
+ return (_table$getState$colum3 = (_table$getState$colum4 = table.getState().columnFilters) == null ? void 0 : _table$getState$colum4.findIndex(d => d.id === column.id)) != null ? _table$getState$colum3 : -1;
1066
1093
  },
1067
1094
  setFilterValue: value => {
1068
1095
  table.setColumnFilters(old => {
1069
1096
  const filterFn = column.getFilterFn();
1070
- const previousfilter = old?.find(d => d.id === column.id);
1097
+ const previousfilter = old == null ? void 0 : old.find(d => d.id === column.id);
1071
1098
  const newFilter = functionalUpdate(value, previousfilter ? previousfilter.value : undefined);
1072
1099
 
1073
1100
  //
1074
1101
  if (shouldAutoRemoveFilter(filterFn, newFilter, column)) {
1075
1102
  var _old$filter;
1076
- return (_old$filter = old?.filter(d => d.id !== column.id)) != null ? _old$filter : [];
1103
+ return (_old$filter = old == null ? void 0 : old.filter(d => d.id !== column.id)) != null ? _old$filter : [];
1077
1104
  }
1078
1105
  const newFilterObj = {
1079
1106
  id: column.id,
@@ -1081,14 +1108,14 @@
1081
1108
  };
1082
1109
  if (previousfilter) {
1083
1110
  var _old$map;
1084
- return (_old$map = old?.map(d => {
1111
+ return (_old$map = old == null ? void 0 : old.map(d => {
1085
1112
  if (d.id === column.id) {
1086
1113
  return newFilterObj;
1087
1114
  }
1088
1115
  return d;
1089
1116
  })) != null ? _old$map : [];
1090
1117
  }
1091
- if (old?.length) {
1118
+ if (old != null && old.length) {
1092
1119
  return [...old, newFilterObj];
1093
1120
  }
1094
1121
  return [newFilterObj];
@@ -1132,18 +1159,19 @@
1132
1159
  return filterFns.includesString;
1133
1160
  },
1134
1161
  getGlobalFilterFn: () => {
1135
- var _table$options$filter2;
1162
+ var _table$options$filter3, _table$options$filter4;
1136
1163
  const {
1137
1164
  globalFilterFn: globalFilterFn
1138
1165
  } = table.options;
1139
1166
  return isFunction(globalFilterFn) ? globalFilterFn : globalFilterFn === 'auto' ? table.getGlobalAutoFilterFn()
1140
1167
  // @ts-ignore
1141
- : (_table$options$filter2 = table.options.filterFns?.[globalFilterFn]) != null ? _table$options$filter2 : filterFns[globalFilterFn];
1168
+ : (_table$options$filter3 = (_table$options$filter4 = table.options.filterFns) == null ? void 0 : _table$options$filter4[globalFilterFn]) != null ? _table$options$filter3 : filterFns[globalFilterFn];
1142
1169
  },
1143
1170
  setColumnFilters: updater => {
1144
1171
  const leafColumns = table.getAllLeafColumns();
1145
1172
  const updateFn = old => {
1146
- return functionalUpdate(updater, old)?.filter(filter => {
1173
+ var _functionalUpdate;
1174
+ return (_functionalUpdate = functionalUpdate(updater, old)) == null ? void 0 : _functionalUpdate.filter(filter => {
1147
1175
  const column = leafColumns.find(d => d.id === filter.id);
1148
1176
  if (column) {
1149
1177
  const filterFn = column.getFilterFn();
@@ -1154,17 +1182,17 @@
1154
1182
  return true;
1155
1183
  });
1156
1184
  };
1157
- table.options.onColumnFiltersChange?.(updateFn);
1185
+ table.options.onColumnFiltersChange == null ? void 0 : table.options.onColumnFiltersChange(updateFn);
1158
1186
  },
1159
1187
  setGlobalFilter: updater => {
1160
- table.options.onGlobalFilterChange?.(updater);
1188
+ table.options.onGlobalFilterChange == null ? void 0 : table.options.onGlobalFilterChange(updater);
1161
1189
  },
1162
1190
  resetGlobalFilter: defaultState => {
1163
1191
  table.setGlobalFilter(defaultState ? undefined : table.initialState.globalFilter);
1164
1192
  },
1165
1193
  resetColumnFilters: defaultState => {
1166
- var _table$initialState$c;
1167
- table.setColumnFilters(defaultState ? [] : (_table$initialState$c = table.initialState?.columnFilters) != null ? _table$initialState$c : []);
1194
+ var _table$initialState$c, _table$initialState;
1195
+ table.setColumnFilters(defaultState ? [] : (_table$initialState$c = (_table$initialState = table.initialState) == null ? void 0 : _table$initialState.columnFilters) != null ? _table$initialState$c : []);
1168
1196
  },
1169
1197
  getPreFilteredRowModel: () => table.getCoreRowModel(),
1170
1198
  getFilteredRowModel: () => {
@@ -1302,8 +1330,8 @@
1302
1330
  getDefaultColumnDef: () => {
1303
1331
  return {
1304
1332
  aggregatedCell: props => {
1305
- var _toString;
1306
- return (_toString = props.getValue()?.toString?.()) != null ? _toString : null;
1333
+ var _toString, _props$getValue;
1334
+ return (_toString = (_props$getValue = props.getValue()) == null ? void 0 : _props$getValue.toString == null ? void 0 : _props$getValue.toString()) != null ? _toString : null;
1307
1335
  },
1308
1336
  aggregationFn: 'auto'
1309
1337
  };
@@ -1325,7 +1353,7 @@
1325
1353
  toggleGrouping: () => {
1326
1354
  table.setGrouping(old => {
1327
1355
  // Find any existing grouping for this column
1328
- if (old?.includes(column.id)) {
1356
+ if (old != null && old.includes(column.id)) {
1329
1357
  return old.filter(d => d !== column.id);
1330
1358
  }
1331
1359
  return [...(old != null ? old : []), column.id];
@@ -1336,9 +1364,13 @@
1336
1364
  return (_ref = (_ref2 = (_ref3 = (_column$columnDef$ena = column.columnDef.enableGrouping) != null ? _column$columnDef$ena : true) != null ? _ref3 : table.options.enableGrouping) != null ? _ref2 : true) != null ? _ref : !!column.accessorFn;
1337
1365
  },
1338
1366
  getIsGrouped: () => {
1339
- return table.getState().grouping?.includes(column.id);
1367
+ var _table$getState$group;
1368
+ return (_table$getState$group = table.getState().grouping) == null ? void 0 : _table$getState$group.includes(column.id);
1369
+ },
1370
+ getGroupedIndex: () => {
1371
+ var _table$getState$group2;
1372
+ return (_table$getState$group2 = table.getState().grouping) == null ? void 0 : _table$getState$group2.indexOf(column.id);
1340
1373
  },
1341
- getGroupedIndex: () => table.getState().grouping?.indexOf(column.id),
1342
1374
  getToggleGroupingHandler: () => {
1343
1375
  const canGroup = column.getCanGroup();
1344
1376
  return () => {
@@ -1348,7 +1380,7 @@
1348
1380
  },
1349
1381
  getAutoAggregationFn: () => {
1350
1382
  const firstRow = table.getCoreRowModel().flatRows[0];
1351
- const value = firstRow?.getValue(column.id);
1383
+ const value = firstRow == null ? void 0 : firstRow.getValue(column.id);
1352
1384
  if (typeof value === 'number') {
1353
1385
  return aggregationFns.sum;
1354
1386
  }
@@ -1357,20 +1389,20 @@
1357
1389
  }
1358
1390
  },
1359
1391
  getAggregationFn: () => {
1360
- var _table$options$aggreg;
1392
+ var _table$options$aggreg, _table$options$aggreg2;
1361
1393
  if (!column) {
1362
1394
  throw new Error();
1363
1395
  }
1364
- return isFunction(column.columnDef.aggregationFn) ? column.columnDef.aggregationFn : column.columnDef.aggregationFn === 'auto' ? column.getAutoAggregationFn() : (_table$options$aggreg = table.options.aggregationFns?.[column.columnDef.aggregationFn]) != null ? _table$options$aggreg : aggregationFns[column.columnDef.aggregationFn];
1396
+ return isFunction(column.columnDef.aggregationFn) ? column.columnDef.aggregationFn : column.columnDef.aggregationFn === 'auto' ? column.getAutoAggregationFn() : (_table$options$aggreg = (_table$options$aggreg2 = table.options.aggregationFns) == null ? void 0 : _table$options$aggreg2[column.columnDef.aggregationFn]) != null ? _table$options$aggreg : aggregationFns[column.columnDef.aggregationFn];
1365
1397
  }
1366
1398
  };
1367
1399
  },
1368
1400
  createTable: table => {
1369
1401
  return {
1370
- setGrouping: updater => table.options.onGroupingChange?.(updater),
1402
+ setGrouping: updater => table.options.onGroupingChange == null ? void 0 : table.options.onGroupingChange(updater),
1371
1403
  resetGrouping: defaultState => {
1372
- var _table$initialState$g;
1373
- table.setGrouping(defaultState ? [] : (_table$initialState$g = table.initialState?.grouping) != null ? _table$initialState$g : []);
1404
+ var _table$initialState$g, _table$initialState;
1405
+ table.setGrouping(defaultState ? [] : (_table$initialState$g = (_table$initialState = table.initialState) == null ? void 0 : _table$initialState.grouping) != null ? _table$initialState$g : []);
1374
1406
  },
1375
1407
  getPreGroupedRowModel: () => table.getFilteredRowModel(),
1376
1408
  getGroupedRowModel: () => {
@@ -1394,12 +1426,15 @@
1394
1426
  return {
1395
1427
  getIsGrouped: () => column.getIsGrouped() && column.id === row.groupingColumnId,
1396
1428
  getIsPlaceholder: () => !cell.getIsGrouped() && column.getIsGrouped(),
1397
- getIsAggregated: () => !cell.getIsGrouped() && !cell.getIsPlaceholder() && !!row.subRows?.length
1429
+ getIsAggregated: () => {
1430
+ var _row$subRows;
1431
+ return !cell.getIsGrouped() && !cell.getIsPlaceholder() && !!((_row$subRows = row.subRows) != null && _row$subRows.length);
1432
+ }
1398
1433
  };
1399
1434
  }
1400
1435
  };
1401
1436
  function orderColumns(leafColumns, grouping, groupedColumnMode) {
1402
- if (!grouping?.length || !groupedColumnMode) {
1437
+ if (!(grouping != null && grouping.length) || !groupedColumnMode) {
1403
1438
  return leafColumns;
1404
1439
  }
1405
1440
  const nonGroupingColumns = leafColumns.filter(col => !grouping.includes(col.id));
@@ -1426,7 +1461,7 @@
1426
1461
  },
1427
1462
  createTable: table => {
1428
1463
  return {
1429
- setColumnOrder: updater => table.options.onColumnOrderChange?.(updater),
1464
+ setColumnOrder: updater => table.options.onColumnOrderChange == null ? void 0 : table.options.onColumnOrderChange(updater),
1430
1465
  resetColumnOrder: defaultState => {
1431
1466
  var _table$initialState$c;
1432
1467
  table.setColumnOrder(defaultState ? [] : (_table$initialState$c = table.initialState.columnOrder) != null ? _table$initialState$c : []);
@@ -1437,7 +1472,7 @@
1437
1472
  let orderedColumns = [];
1438
1473
 
1439
1474
  // If there is no order, return the normal columns
1440
- if (!columnOrder?.length) {
1475
+ if (!(columnOrder != null && columnOrder.length)) {
1441
1476
  orderedColumns = columns;
1442
1477
  } else {
1443
1478
  const columnOrderCopy = [...columnOrder];
@@ -1482,7 +1517,7 @@
1482
1517
  ...state,
1483
1518
  pagination: {
1484
1519
  ...getDefaultPaginationState(),
1485
- ...state?.pagination
1520
+ ...(state == null ? void 0 : state.pagination)
1486
1521
  }
1487
1522
  };
1488
1523
  },
@@ -1517,7 +1552,7 @@
1517
1552
  let newState = functionalUpdate(updater, old);
1518
1553
  return newState;
1519
1554
  };
1520
- return table.options.onPaginationChange?.(safeUpdater);
1555
+ return table.options.onPaginationChange == null ? void 0 : table.options.onPaginationChange(safeUpdater);
1521
1556
  },
1522
1557
  resetPagination: defaultState => {
1523
1558
  var _table$initialState$p;
@@ -1535,12 +1570,12 @@
1535
1570
  });
1536
1571
  },
1537
1572
  resetPageIndex: defaultState => {
1538
- var _table$initialState$p2;
1539
- table.setPageIndex(defaultState ? defaultPageIndex : (_table$initialState$p2 = table.initialState?.pagination?.pageIndex) != null ? _table$initialState$p2 : defaultPageIndex);
1573
+ var _table$initialState$p2, _table$initialState, _table$initialState$p3;
1574
+ table.setPageIndex(defaultState ? defaultPageIndex : (_table$initialState$p2 = (_table$initialState = table.initialState) == null ? void 0 : (_table$initialState$p3 = _table$initialState.pagination) == null ? void 0 : _table$initialState$p3.pageIndex) != null ? _table$initialState$p2 : defaultPageIndex);
1540
1575
  },
1541
1576
  resetPageSize: defaultState => {
1542
- var _table$initialState$p3;
1543
- table.setPageSize(defaultState ? defaultPageSize : (_table$initialState$p3 = table.initialState?.pagination?.pageSize) != null ? _table$initialState$p3 : defaultPageSize);
1577
+ var _table$initialState$p4, _table$initialState2, _table$initialState2$;
1578
+ table.setPageSize(defaultState ? defaultPageSize : (_table$initialState$p4 = (_table$initialState2 = table.initialState) == null ? void 0 : (_table$initialState2$ = _table$initialState2.pagination) == null ? void 0 : _table$initialState2$.pageSize) != null ? _table$initialState$p4 : defaultPageSize);
1544
1579
  },
1545
1580
  setPageSize: updater => {
1546
1581
  table.setPagination(old => {
@@ -1645,20 +1680,20 @@
1645
1680
  if (position === 'right') {
1646
1681
  var _old$left, _old$right;
1647
1682
  return {
1648
- left: ((_old$left = old?.left) != null ? _old$left : []).filter(d => !columnIds?.includes(d)),
1649
- right: [...((_old$right = old?.right) != null ? _old$right : []).filter(d => !columnIds?.includes(d)), ...columnIds]
1683
+ left: ((_old$left = old == null ? void 0 : old.left) != null ? _old$left : []).filter(d => !(columnIds != null && columnIds.includes(d))),
1684
+ right: [...((_old$right = old == null ? void 0 : old.right) != null ? _old$right : []).filter(d => !(columnIds != null && columnIds.includes(d))), ...columnIds]
1650
1685
  };
1651
1686
  }
1652
1687
  if (position === 'left') {
1653
1688
  var _old$left2, _old$right2;
1654
1689
  return {
1655
- left: [...((_old$left2 = old?.left) != null ? _old$left2 : []).filter(d => !columnIds?.includes(d)), ...columnIds],
1656
- right: ((_old$right2 = old?.right) != null ? _old$right2 : []).filter(d => !columnIds?.includes(d))
1690
+ left: [...((_old$left2 = old == null ? void 0 : old.left) != null ? _old$left2 : []).filter(d => !(columnIds != null && columnIds.includes(d))), ...columnIds],
1691
+ right: ((_old$right2 = old == null ? void 0 : old.right) != null ? _old$right2 : []).filter(d => !(columnIds != null && columnIds.includes(d)))
1657
1692
  };
1658
1693
  }
1659
1694
  return {
1660
- left: ((_old$left3 = old?.left) != null ? _old$left3 : []).filter(d => !columnIds?.includes(d)),
1661
- right: ((_old$right3 = old?.right) != null ? _old$right3 : []).filter(d => !columnIds?.includes(d))
1695
+ left: ((_old$left3 = old == null ? void 0 : old.left) != null ? _old$left3 : []).filter(d => !(columnIds != null && columnIds.includes(d))),
1696
+ right: ((_old$right3 = old == null ? void 0 : old.right) != null ? _old$right3 : []).filter(d => !(columnIds != null && columnIds.includes(d)))
1662
1697
  };
1663
1698
  });
1664
1699
  },
@@ -1675,14 +1710,14 @@
1675
1710
  left,
1676
1711
  right
1677
1712
  } = table.getState().columnPinning;
1678
- const isLeft = leafColumnIds.some(d => left?.includes(d));
1679
- const isRight = leafColumnIds.some(d => right?.includes(d));
1713
+ const isLeft = leafColumnIds.some(d => left == null ? void 0 : left.includes(d));
1714
+ const isRight = leafColumnIds.some(d => right == null ? void 0 : right.includes(d));
1680
1715
  return isLeft ? 'left' : isRight ? 'right' : false;
1681
1716
  },
1682
1717
  getPinnedIndex: () => {
1683
- var _table$getState$colum;
1718
+ var _table$getState$colum, _table$getState$colum2, _table$getState$colum3;
1684
1719
  const position = column.getIsPinned();
1685
- return position ? (_table$getState$colum = table.getState().columnPinning?.[position]?.indexOf(column.id)) != null ? _table$getState$colum : -1 : 0;
1720
+ return position ? (_table$getState$colum = (_table$getState$colum2 = table.getState().columnPinning) == null ? void 0 : (_table$getState$colum3 = _table$getState$colum2[position]) == null ? void 0 : _table$getState$colum3.indexOf(column.id)) != null ? _table$getState$colum : -1 : 0;
1686
1721
  }
1687
1722
  };
1688
1723
  },
@@ -1728,17 +1763,19 @@
1728
1763
  },
1729
1764
  createTable: table => {
1730
1765
  return {
1731
- setColumnPinning: updater => table.options.onColumnPinningChange?.(updater),
1766
+ setColumnPinning: updater => table.options.onColumnPinningChange == null ? void 0 : table.options.onColumnPinningChange(updater),
1732
1767
  resetColumnPinning: defaultState => {
1733
- var _table$initialState$c;
1734
- return table.setColumnPinning(defaultState ? getDefaultPinningState() : (_table$initialState$c = table.initialState?.columnPinning) != null ? _table$initialState$c : getDefaultPinningState());
1768
+ var _table$initialState$c, _table$initialState;
1769
+ return table.setColumnPinning(defaultState ? getDefaultPinningState() : (_table$initialState$c = (_table$initialState = table.initialState) == null ? void 0 : _table$initialState.columnPinning) != null ? _table$initialState$c : getDefaultPinningState());
1735
1770
  },
1736
1771
  getIsSomeColumnsPinned: position => {
1772
+ var _pinningState$positio;
1737
1773
  const pinningState = table.getState().columnPinning;
1738
1774
  if (!position) {
1739
- return Boolean(pinningState.left?.length || pinningState.right?.length);
1775
+ var _pinningState$left, _pinningState$right;
1776
+ return Boolean(((_pinningState$left = pinningState.left) == null ? void 0 : _pinningState$left.length) || ((_pinningState$right = pinningState.right) == null ? void 0 : _pinningState$right.length));
1740
1777
  }
1741
- return Boolean(pinningState[position]?.length);
1778
+ return Boolean((_pinningState$positio = pinningState[position]) == null ? void 0 : _pinningState$positio.length);
1742
1779
  },
1743
1780
  getLeftLeafColumns: memo(() => [table.getAllLeafColumns(), table.getState().columnPinning.left], (allColumns, left) => {
1744
1781
  return (left != null ? left : []).map(columnId => allColumns.find(column => column.id === columnId)).filter(Boolean);
@@ -1795,7 +1832,7 @@
1795
1832
 
1796
1833
  createTable: table => {
1797
1834
  return {
1798
- setRowSelection: updater => table.options.onRowSelectionChange?.(updater),
1835
+ setRowSelection: updater => table.options.onRowSelectionChange == null ? void 0 : table.options.onRowSelectionChange(updater),
1799
1836
  resetRowSelection: defaultState => {
1800
1837
  var _table$initialState$r;
1801
1838
  return table.setRowSelection(defaultState ? {} : (_table$initialState$r = table.initialState.rowSelection) != null ? _table$initialState$r : {});
@@ -2061,14 +2098,16 @@
2061
2098
  getToggleSelectedHandler: () => {
2062
2099
  const canSelect = row.getCanSelect();
2063
2100
  return e => {
2101
+ var _target;
2064
2102
  if (!canSelect) return;
2065
- row.toggleSelected(e.target?.checked);
2103
+ row.toggleSelected((_target = e.target) == null ? void 0 : _target.checked);
2066
2104
  };
2067
2105
  }
2068
2106
  };
2069
2107
  }
2070
2108
  };
2071
2109
  const mutateRowIsSelected = (selectedRowIds, id, value, table) => {
2110
+ var _row$subRows;
2072
2111
  const row = table.getRow(id);
2073
2112
 
2074
2113
  // const isGrouped = row.getIsGrouped()
@@ -2089,7 +2128,7 @@
2089
2128
  }
2090
2129
  // }
2091
2130
 
2092
- if (row.subRows?.length && row.getCanSelectSubRows()) {
2131
+ if ((_row$subRows = row.subRows) != null && _row$subRows.length && row.getCanSelectSubRows()) {
2093
2132
  row.subRows.forEach(row => mutateRowIsSelected(selectedRowIds, row.id, value, table));
2094
2133
  }
2095
2134
  };
@@ -2101,12 +2140,13 @@
2101
2140
  // Filters top level and nested rows
2102
2141
  const recurseRows = function (rows, depth) {
2103
2142
  return rows.map(row => {
2143
+ var _row$subRows2;
2104
2144
  const isSelected = isRowSelected(row, rowSelection);
2105
2145
  if (isSelected) {
2106
2146
  newSelectedFlatRows.push(row);
2107
2147
  newSelectedRowsById[row.id] = row;
2108
2148
  }
2109
- if (row.subRows?.length) {
2149
+ if ((_row$subRows2 = row.subRows) != null && _row$subRows2.length) {
2110
2150
  row = {
2111
2151
  ...row,
2112
2152
  subRows: recurseRows(row.subRows)
@@ -2280,7 +2320,7 @@
2280
2320
  const firstRows = table.getFilteredRowModel().flatRows.slice(10);
2281
2321
  let isString = false;
2282
2322
  for (const row of firstRows) {
2283
- const value = row?.getValue(column.id);
2323
+ const value = row == null ? void 0 : row.getValue(column.id);
2284
2324
  if (Object.prototype.toString.call(value) === '[object Date]') {
2285
2325
  return sortingFns.datetime;
2286
2326
  }
@@ -2298,18 +2338,18 @@
2298
2338
  },
2299
2339
  getAutoSortDir: () => {
2300
2340
  const firstRow = table.getFilteredRowModel().flatRows[0];
2301
- const value = firstRow?.getValue(column.id);
2341
+ const value = firstRow == null ? void 0 : firstRow.getValue(column.id);
2302
2342
  if (typeof value === 'string') {
2303
2343
  return 'asc';
2304
2344
  }
2305
2345
  return 'desc';
2306
2346
  },
2307
2347
  getSortingFn: () => {
2308
- var _table$options$sortin;
2348
+ var _table$options$sortin, _table$options$sortin2;
2309
2349
  if (!column) {
2310
2350
  throw new Error();
2311
2351
  }
2312
- return isFunction(column.columnDef.sortingFn) ? column.columnDef.sortingFn : column.columnDef.sortingFn === 'auto' ? column.getAutoSortingFn() : (_table$options$sortin = table.options.sortingFns?.[column.columnDef.sortingFn]) != null ? _table$options$sortin : sortingFns[column.columnDef.sortingFn];
2352
+ return isFunction(column.columnDef.sortingFn) ? column.columnDef.sortingFn : column.columnDef.sortingFn === 'auto' ? column.getAutoSortingFn() : (_table$options$sortin = (_table$options$sortin2 = table.options.sortingFns) == null ? void 0 : _table$options$sortin2[column.columnDef.sortingFn]) != null ? _table$options$sortin : sortingFns[column.columnDef.sortingFn];
2313
2353
  },
2314
2354
  toggleSorting: (desc, multi) => {
2315
2355
  // if (column.columns.length) {
@@ -2326,8 +2366,8 @@
2326
2366
  const hasManualValue = typeof desc !== 'undefined' && desc !== null;
2327
2367
  table.setSorting(old => {
2328
2368
  // Find any existing sorting for this column
2329
- const existingSorting = old?.find(d => d.id === column.id);
2330
- const existingIndex = old?.findIndex(d => d.id === column.id);
2369
+ const existingSorting = old == null ? void 0 : old.find(d => d.id === column.id);
2370
+ const existingIndex = old == null ? void 0 : old.findIndex(d => d.id === column.id);
2331
2371
  let newSorting = [];
2332
2372
 
2333
2373
  // What should we do with this sort action?
@@ -2335,7 +2375,7 @@
2335
2375
  let nextDesc = hasManualValue ? desc : nextSortingOrder === 'desc';
2336
2376
 
2337
2377
  // Multi-mode
2338
- if (old?.length && column.getCanMultiSort() && multi) {
2378
+ if (old != null && old.length && column.getCanMultiSort() && multi) {
2339
2379
  if (existingSorting) {
2340
2380
  sortAction = 'toggle';
2341
2381
  } else {
@@ -2343,7 +2383,7 @@
2343
2383
  }
2344
2384
  } else {
2345
2385
  // Normal mode
2346
- if (old?.length && existingIndex !== old.length - 1) {
2386
+ if (old != null && old.length && existingIndex !== old.length - 1) {
2347
2387
  sortAction = 'replace';
2348
2388
  } else if (existingSorting) {
2349
2389
  sortAction = 'toggle';
@@ -2421,33 +2461,34 @@
2421
2461
  return (_ref2 = (_column$columnDef$ena2 = column.columnDef.enableMultiSort) != null ? _column$columnDef$ena2 : table.options.enableMultiSort) != null ? _ref2 : !!column.accessorFn;
2422
2462
  },
2423
2463
  getIsSorted: () => {
2424
- const columnSort = table.getState().sorting?.find(d => d.id === column.id);
2464
+ var _table$getState$sorti;
2465
+ const columnSort = (_table$getState$sorti = table.getState().sorting) == null ? void 0 : _table$getState$sorti.find(d => d.id === column.id);
2425
2466
  return !columnSort ? false : columnSort.desc ? 'desc' : 'asc';
2426
2467
  },
2427
2468
  getSortIndex: () => {
2428
- var _table$getState$sorti;
2429
- return (_table$getState$sorti = table.getState().sorting?.findIndex(d => d.id === column.id)) != null ? _table$getState$sorti : -1;
2469
+ var _table$getState$sorti2, _table$getState$sorti3;
2470
+ return (_table$getState$sorti2 = (_table$getState$sorti3 = table.getState().sorting) == null ? void 0 : _table$getState$sorti3.findIndex(d => d.id === column.id)) != null ? _table$getState$sorti2 : -1;
2430
2471
  },
2431
2472
  clearSorting: () => {
2432
2473
  //clear sorting for just 1 column
2433
- table.setSorting(old => old?.length ? old.filter(d => d.id !== column.id) : []);
2474
+ table.setSorting(old => old != null && old.length ? old.filter(d => d.id !== column.id) : []);
2434
2475
  },
2435
2476
  getToggleSortingHandler: () => {
2436
2477
  const canSort = column.getCanSort();
2437
2478
  return e => {
2438
2479
  if (!canSort) return;
2439
- e.persist?.();
2440
- column.toggleSorting?.(undefined, column.getCanMultiSort() ? table.options.isMultiSortEvent?.(e) : false);
2480
+ e.persist == null ? void 0 : e.persist();
2481
+ column.toggleSorting == null ? void 0 : column.toggleSorting(undefined, column.getCanMultiSort() ? table.options.isMultiSortEvent == null ? void 0 : table.options.isMultiSortEvent(e) : false);
2441
2482
  };
2442
2483
  }
2443
2484
  };
2444
2485
  },
2445
2486
  createTable: table => {
2446
2487
  return {
2447
- setSorting: updater => table.options.onSortingChange?.(updater),
2488
+ setSorting: updater => table.options.onSortingChange == null ? void 0 : table.options.onSortingChange(updater),
2448
2489
  resetSorting: defaultState => {
2449
- var _table$initialState$s;
2450
- table.setSorting(defaultState ? [] : (_table$initialState$s = table.initialState?.sorting) != null ? _table$initialState$s : []);
2490
+ var _table$initialState$s, _table$initialState;
2491
+ table.setSorting(defaultState ? [] : (_table$initialState$s = (_table$initialState = table.initialState) == null ? void 0 : _table$initialState.sorting) != null ? _table$initialState$s : []);
2451
2492
  },
2452
2493
  getPreSortedRowModel: () => table.getGroupedRowModel(),
2453
2494
  getSortedRowModel: () => {
@@ -2488,8 +2529,8 @@
2488
2529
  }
2489
2530
  },
2490
2531
  getIsVisible: () => {
2491
- var _table$getState$colum;
2492
- return (_table$getState$colum = table.getState().columnVisibility?.[column.id]) != null ? _table$getState$colum : true;
2532
+ var _table$getState$colum, _table$getState$colum2;
2533
+ return (_table$getState$colum = (_table$getState$colum2 = table.getState().columnVisibility) == null ? void 0 : _table$getState$colum2[column.id]) != null ? _table$getState$colum : true;
2493
2534
  },
2494
2535
  getCanHide: () => {
2495
2536
  var _column$columnDef$ena, _table$options$enable;
@@ -2497,7 +2538,7 @@
2497
2538
  },
2498
2539
  getToggleVisibilityHandler: () => {
2499
2540
  return e => {
2500
- column.toggleVisibility?.(e.target.checked);
2541
+ column.toggleVisibility == null ? void 0 : column.toggleVisibility(e.target.checked);
2501
2542
  };
2502
2543
  }
2503
2544
  };
@@ -2525,7 +2566,7 @@
2525
2566
  createTable: table => {
2526
2567
  const makeVisibleColumnsMethod = (key, getColumns) => {
2527
2568
  return memo(() => [getColumns(), getColumns().filter(d => d.getIsVisible()).map(d => d.id).join('_')], columns => {
2528
- return columns.filter(d => d.getIsVisible?.());
2569
+ return columns.filter(d => d.getIsVisible == null ? void 0 : d.getIsVisible());
2529
2570
  }, {
2530
2571
  key,
2531
2572
  debug: () => {
@@ -2540,7 +2581,7 @@
2540
2581
  getLeftVisibleLeafColumns: makeVisibleColumnsMethod('getLeftVisibleLeafColumns', () => table.getLeftLeafColumns()),
2541
2582
  getRightVisibleLeafColumns: makeVisibleColumnsMethod('getRightVisibleLeafColumns', () => table.getRightLeafColumns()),
2542
2583
  getCenterVisibleLeafColumns: makeVisibleColumnsMethod('getCenterVisibleLeafColumns', () => table.getCenterLeafColumns()),
2543
- setColumnVisibility: updater => table.options.onColumnVisibilityChange?.(updater),
2584
+ setColumnVisibility: updater => table.options.onColumnVisibilityChange == null ? void 0 : table.options.onColumnVisibilityChange(updater),
2544
2585
  resetColumnVisibility: defaultState => {
2545
2586
  var _table$initialState$c;
2546
2587
  table.setColumnVisibility(defaultState ? {} : (_table$initialState$c = table.initialState.columnVisibility) != null ? _table$initialState$c : {});
@@ -2550,14 +2591,15 @@
2550
2591
  value = (_value = value) != null ? _value : !table.getIsAllColumnsVisible();
2551
2592
  table.setColumnVisibility(table.getAllLeafColumns().reduce((obj, column) => ({
2552
2593
  ...obj,
2553
- [column.id]: !value ? !column.getCanHide?.() : value
2594
+ [column.id]: !value ? !(column.getCanHide != null && column.getCanHide()) : value
2554
2595
  }), {}));
2555
2596
  },
2556
- getIsAllColumnsVisible: () => !table.getAllLeafColumns().some(column => !column.getIsVisible?.()),
2557
- getIsSomeColumnsVisible: () => table.getAllLeafColumns().some(column => column.getIsVisible?.()),
2597
+ getIsAllColumnsVisible: () => !table.getAllLeafColumns().some(column => !(column.getIsVisible != null && column.getIsVisible())),
2598
+ getIsSomeColumnsVisible: () => table.getAllLeafColumns().some(column => column.getIsVisible == null ? void 0 : column.getIsVisible()),
2558
2599
  getToggleAllColumnsVisibilityHandler: () => {
2559
2600
  return e => {
2560
- table.toggleAllColumnsVisible(e.target?.checked);
2601
+ var _target;
2602
+ table.toggleAllColumnsVisible((_target = e.target) == null ? void 0 : _target.checked);
2561
2603
  };
2562
2604
  }
2563
2605
  };
@@ -2577,7 +2619,7 @@
2577
2619
  _features: features
2578
2620
  };
2579
2621
  const defaultOptions = table._features.reduce((obj, feature) => {
2580
- return Object.assign(obj, feature.getDefaultOptions?.(table));
2622
+ return Object.assign(obj, feature.getDefaultOptions == null ? void 0 : feature.getDefaultOptions(table));
2581
2623
  }, {});
2582
2624
  const mergeOptions = options => {
2583
2625
  if (table.options.mergeOptions) {
@@ -2595,7 +2637,7 @@
2595
2637
  };
2596
2638
  table._features.forEach(feature => {
2597
2639
  var _feature$getInitialSt;
2598
- initialState = (_feature$getInitialSt = feature.getInitialState?.(initialState)) != null ? _feature$getInitialSt : initialState;
2640
+ initialState = (_feature$getInitialSt = feature.getInitialState == null ? void 0 : feature.getInitialState(initialState)) != null ? _feature$getInitialSt : initialState;
2599
2641
  });
2600
2642
  const queued = [];
2601
2643
  let queuedTimeout = false;
@@ -2634,11 +2676,11 @@
2634
2676
  return table.options.state;
2635
2677
  },
2636
2678
  setState: updater => {
2637
- table.options.onStateChange?.(updater);
2679
+ table.options.onStateChange == null ? void 0 : table.options.onStateChange(updater);
2638
2680
  },
2639
2681
  _getRowId: (row, index, parent) => {
2640
2682
  var _table$options$getRow;
2641
- return (_table$options$getRow = table.options.getRowId?.(row, index, parent)) != null ? _table$options$getRow : `${parent ? [parent.id, index].join('.') : index}`;
2683
+ return (_table$options$getRow = table.options.getRowId == null ? void 0 : table.options.getRowId(row, index, parent)) != null ? _table$options$getRow : `${parent ? [parent.id, index].join('.') : index}`;
2642
2684
  },
2643
2685
  getCoreRowModel: () => {
2644
2686
  if (!table._getCoreRowModel) {
@@ -2677,11 +2719,11 @@
2677
2719
  },
2678
2720
  // footer: props => props.header.column.id,
2679
2721
  cell: props => {
2680
- var _props$renderValue$to;
2681
- return (_props$renderValue$to = props.renderValue()?.toString?.()) != null ? _props$renderValue$to : null;
2722
+ var _props$renderValue$to, _props$renderValue;
2723
+ return (_props$renderValue$to = (_props$renderValue = props.renderValue()) == null ? void 0 : _props$renderValue.toString == null ? void 0 : _props$renderValue.toString()) != null ? _props$renderValue$to : null;
2682
2724
  },
2683
2725
  ...table._features.reduce((obj, feature) => {
2684
- return Object.assign(obj, feature.getDefaultColumnDef?.());
2726
+ return Object.assign(obj, feature.getDefaultColumnDef == null ? void 0 : feature.getDefaultColumnDef());
2685
2727
  }, {}),
2686
2728
  ...defaultColumn
2687
2729
  };
@@ -2759,7 +2801,7 @@
2759
2801
  };
2760
2802
  Object.assign(table, coreInstance);
2761
2803
  table._features.forEach(feature => {
2762
- return Object.assign(table, feature.createTable?.(table));
2804
+ return Object.assign(table, feature.createTable == null ? void 0 : feature.createTable(table));
2763
2805
  });
2764
2806
  return table;
2765
2807
  }
@@ -2788,7 +2830,7 @@
2788
2830
  })
2789
2831
  };
2790
2832
  table._features.forEach(feature => {
2791
- Object.assign(cell, feature.createCell?.(cell, column, row, table));
2833
+ Object.assign(cell, feature.createCell == null ? void 0 : feature.createCell(cell, column, row, table));
2792
2834
  }, {});
2793
2835
  return cell;
2794
2836
  }
@@ -2859,7 +2901,7 @@
2859
2901
  };
2860
2902
  for (let i = 0; i < table._features.length; i++) {
2861
2903
  const feature = table._features[i];
2862
- Object.assign(row, feature?.createRow?.(row, table));
2904
+ Object.assign(row, feature == null ? void 0 : feature.createRow == null ? void 0 : feature.createRow(row, table));
2863
2905
  }
2864
2906
  return row;
2865
2907
  };
@@ -2953,10 +2995,11 @@
2953
2995
 
2954
2996
  // Get the original subrows
2955
2997
  if (table.options.getSubRows) {
2998
+ var _row$originalSubRows;
2956
2999
  row.originalSubRows = table.options.getSubRows(originalRows[i], i);
2957
3000
 
2958
3001
  // Then recursively access them
2959
- if (row.originalSubRows?.length) {
3002
+ if ((_row$originalSubRows = row.originalSubRows) != null && _row$originalSubRows.length) {
2960
3003
  row.subRows = accessRows(row.originalSubRows, depth + 1, row);
2961
3004
  }
2962
3005
  }
@@ -2996,10 +3039,11 @@
2996
3039
 
2997
3040
  // Filter from children up first
2998
3041
  for (let i = 0; i < rowsToFilter.length; i++) {
3042
+ var _row$subRows;
2999
3043
  let row = rowsToFilter[i];
3000
3044
  const newRow = createRow(table, row.id, row.original, row.index, row.depth);
3001
3045
  newRow.columnFilters = row.columnFilters;
3002
- if (row.subRows?.length && depth < maxDepth) {
3046
+ if ((_row$subRows = row.subRows) != null && _row$subRows.length && depth < maxDepth) {
3003
3047
  newRow.subRows = recurseFilterRows(row.subRows, depth + 1);
3004
3048
  row = newRow;
3005
3049
  if (filterRow(row) && !newRow.subRows.length) {
@@ -3051,7 +3095,8 @@
3051
3095
  let row = rowsToFilter[i];
3052
3096
  const pass = filterRow(row);
3053
3097
  if (pass) {
3054
- if (row.subRows?.length && depth < maxDepth) {
3098
+ var _row$subRows2;
3099
+ if ((_row$subRows2 = row.subRows) != null && _row$subRows2.length && depth < maxDepth) {
3055
3100
  const newRow = createRow(table, row.id, row.original, row.index, row.depth);
3056
3101
  newRow.subRows = recurseFilterRows(row.subRows, depth + 1);
3057
3102
  row = newRow;
@@ -3072,7 +3117,7 @@
3072
3117
 
3073
3118
  function getFilteredRowModel() {
3074
3119
  return table => memo(() => [table.getPreFilteredRowModel(), table.getState().columnFilters, table.getState().globalFilter], (rowModel, columnFilters, globalFilter) => {
3075
- if (!rowModel.rows.length || !columnFilters?.length && !globalFilter) {
3120
+ if (!rowModel.rows.length || !(columnFilters != null && columnFilters.length) && !globalFilter) {
3076
3121
  for (let i = 0; i < rowModel.flatRows.length; i++) {
3077
3122
  rowModel.flatRows[i].columnFilters = {};
3078
3123
  rowModel.flatRows[i].columnFiltersMeta = {};
@@ -3099,7 +3144,7 @@
3099
3144
  resolvedColumnFilters.push({
3100
3145
  id: d.id,
3101
3146
  filterFn,
3102
- resolvedValue: (_filterFn$resolveFilt = filterFn.resolveFilterValue?.(d.value)) != null ? _filterFn$resolveFilt : d.value
3147
+ resolvedValue: (_filterFn$resolveFilt = filterFn.resolveFilterValue == null ? void 0 : filterFn.resolveFilterValue(d.value)) != null ? _filterFn$resolveFilt : d.value
3103
3148
  });
3104
3149
  });
3105
3150
  const filterableIds = columnFilters.map(d => d.id);
@@ -3112,7 +3157,7 @@
3112
3157
  resolvedGlobalFilters.push({
3113
3158
  id: column.id,
3114
3159
  filterFn: globalFilterFn,
3115
- resolvedValue: (_globalFilterFn$resol = globalFilterFn.resolveFilterValue?.(globalFilter)) != null ? _globalFilterFn$resol : globalFilter
3160
+ resolvedValue: (_globalFilterFn$resol = globalFilterFn.resolveFilterValue == null ? void 0 : globalFilterFn.resolveFilterValue(globalFilter)) != null ? _globalFilterFn$resol : globalFilter
3116
3161
  });
3117
3162
  });
3118
3163
  }
@@ -3177,7 +3222,7 @@
3177
3222
 
3178
3223
  function getFacetedRowModel() {
3179
3224
  return (table, columnId) => memo(() => [table.getPreFilteredRowModel(), table.getState().columnFilters, table.getState().globalFilter, table.getFilteredRowModel()], (preRowModel, columnFilters, globalFilter) => {
3180
- if (!preRowModel.rows.length || !columnFilters?.length && !globalFilter) {
3225
+ if (!preRowModel.rows.length || !(columnFilters != null && columnFilters.length) && !globalFilter) {
3181
3226
  return preRowModel;
3182
3227
  }
3183
3228
  const filterableIds = [...columnFilters.map(d => d.id).filter(d => d !== columnId), globalFilter ? '__global__' : undefined].filter(Boolean);
@@ -3229,7 +3274,8 @@
3229
3274
 
3230
3275
  function getFacetedMinMaxValues() {
3231
3276
  return (table, columnId) => memo(() => [table.getColumn(columnId).getFacetedRowModel()], facetedRowModel => {
3232
- const firstValue = facetedRowModel.flatRows[0]?.getUniqueValues(columnId);
3277
+ var _facetedRowModel$flat;
3278
+ const firstValue = (_facetedRowModel$flat = facetedRowModel.flatRows[0]) == null ? void 0 : _facetedRowModel$flat.getUniqueValues(columnId);
3233
3279
  if (typeof firstValue === 'undefined') {
3234
3280
  return undefined;
3235
3281
  }
@@ -3258,7 +3304,7 @@
3258
3304
 
3259
3305
  function getSortedRowModel() {
3260
3306
  return table => memo(() => [table.getState().sorting, table.getPreSortedRowModel()], (sorting, rowModel) => {
3261
- if (!rowModel.rows.length || !sorting?.length) {
3307
+ if (!rowModel.rows.length || !(sorting != null && sorting.length)) {
3262
3308
  return rowModel;
3263
3309
  }
3264
3310
  const sortingState = table.getState().sorting;
@@ -3284,7 +3330,7 @@
3284
3330
  var _sortEntry$desc;
3285
3331
  const sortEntry = availableSorting[i];
3286
3332
  const columnInfo = columnInfoById[sortEntry.id];
3287
- const isDesc = (_sortEntry$desc = sortEntry?.desc) != null ? _sortEntry$desc : false;
3333
+ const isDesc = (_sortEntry$desc = sortEntry == null ? void 0 : sortEntry.desc) != null ? _sortEntry$desc : false;
3288
3334
  if (columnInfo.sortUndefined) {
3289
3335
  const aValue = rowA.getValue(sortEntry.id);
3290
3336
  const bValue = rowB.getValue(sortEntry.id);
@@ -3312,8 +3358,9 @@
3312
3358
 
3313
3359
  // If there are sub-rows, sort them
3314
3360
  sortedData.forEach(row => {
3361
+ var _row$subRows;
3315
3362
  sortedFlatRows.push(row);
3316
- if (row.subRows?.length) {
3363
+ if ((_row$subRows = row.subRows) != null && _row$subRows.length) {
3317
3364
  row.subRows = sortData(row.subRows);
3318
3365
  }
3319
3366
  });
@@ -3499,8 +3546,9 @@
3499
3546
  function expandRows(rowModel) {
3500
3547
  const expandedRows = [];
3501
3548
  const handleRow = row => {
3549
+ var _row$subRows;
3502
3550
  expandedRows.push(row);
3503
- if (row.subRows?.length && row.getIsExpanded()) {
3551
+ if ((_row$subRows = row.subRows) != null && _row$subRows.length && row.getIsExpanded()) {
3504
3552
  row.subRows.forEach(handleRow);
3505
3553
  }
3506
3554
  };
@@ -3660,8 +3708,9 @@
3660
3708
  return typeof component === 'object' && typeof component.$$render === 'function' && typeof component.render === 'function';
3661
3709
  }
3662
3710
  function isSvelteClientComponent(component) {
3711
+ var _component$name, _component$name2;
3663
3712
  let isHMR = ('__SVELTE_HMR' in window);
3664
- return component.prototype instanceof internal.SvelteComponent || isHMR && component.name?.startsWith('Proxy<') && component.name?.endsWith('>');
3713
+ return component.prototype instanceof internal.SvelteComponent || isHMR && ((_component$name = component.name) == null ? void 0 : _component$name.startsWith('Proxy<')) && ((_component$name2 = component.name) == null ? void 0 : _component$name2.endsWith('>'));
3665
3714
  }
3666
3715
  function isSvelteComponent(component) {
3667
3716
  if (typeof document === 'undefined') {
@@ -3727,7 +3776,7 @@
3727
3776
  } else {
3728
3777
  stateStore.set(updater);
3729
3778
  }
3730
- resolvedOptions.onStateChange?.(updater);
3779
+ resolvedOptions.onStateChange == null ? void 0 : resolvedOptions.onStateChange(updater);
3731
3780
  }
3732
3781
  };
3733
3782
  });