{"version":3,"file":"@tanstack-BaFfas4X.js","sources":["../../node_modules/@tanstack/table-core/build/lib/index.mjs","../../node_modules/@tanstack/vue-table/build/lib/index.mjs"],"sourcesContent":["/**\n * table-core\n *\n * Copyright (c) TanStack\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE.md file in the root directory of this source tree.\n *\n * @license MIT\n */\n// type Person = {\n// firstName: string\n// lastName: string\n// age: number\n// visits: number\n// status: string\n// progress: number\n// createdAt: Date\n// nested: {\n// foo: [\n// {\n// bar: 'bar'\n// }\n// ]\n// bar: { subBar: boolean }[]\n// baz: {\n// foo: 'foo'\n// bar: {\n// baz: 'baz'\n// }\n// }\n// }\n// }\n\n// const test: DeepKeys = 'nested.foo.0.bar'\n// const test2: DeepKeys = 'nested.bar'\n\n// const helper = createColumnHelper()\n\n// helper.accessor('nested.foo', {\n// cell: info => info.getValue(),\n// })\n\n// helper.accessor('nested.foo.0.bar', {\n// cell: info => info.getValue(),\n// })\n\n// helper.accessor('nested.bar', {\n// cell: info => info.getValue(),\n// })\n\nfunction createColumnHelper() {\n return {\n accessor: (accessor, column) => {\n return typeof accessor === 'function' ? {\n ...column,\n accessorFn: accessor\n } : {\n ...column,\n accessorKey: accessor\n };\n },\n display: column => column,\n group: column => column\n };\n}\n\n// Is this type a tuple?\n\n// If this type is a tuple, what indices are allowed?\n\n///\n\nfunction functionalUpdate(updater, input) {\n return typeof updater === 'function' ? updater(input) : updater;\n}\nfunction noop() {\n //\n}\nfunction makeStateUpdater(key, instance) {\n return updater => {\n instance.setState(old => {\n return {\n ...old,\n [key]: functionalUpdate(updater, old[key])\n };\n });\n };\n}\nfunction isFunction(d) {\n return d instanceof Function;\n}\nfunction isNumberArray(d) {\n return Array.isArray(d) && d.every(val => typeof val === 'number');\n}\nfunction flattenBy(arr, getChildren) {\n const flat = [];\n const recurse = subArr => {\n subArr.forEach(item => {\n flat.push(item);\n const children = getChildren(item);\n if (children != null && children.length) {\n recurse(children);\n }\n });\n };\n recurse(arr);\n return flat;\n}\nfunction memo(getDeps, fn, opts) {\n let deps = [];\n let result;\n return depArgs => {\n let depTime;\n if (opts.key && opts.debug) depTime = Date.now();\n const newDeps = getDeps(depArgs);\n const depsChanged = newDeps.length !== deps.length || newDeps.some((dep, index) => deps[index] !== dep);\n if (!depsChanged) {\n return result;\n }\n deps = newDeps;\n let resultTime;\n if (opts.key && opts.debug) resultTime = Date.now();\n result = fn(...newDeps);\n opts == null || opts.onChange == null || opts.onChange(result);\n if (opts.key && opts.debug) {\n if (opts != null && opts.debug()) {\n const depEndTime = Math.round((Date.now() - depTime) * 100) / 100;\n const resultEndTime = Math.round((Date.now() - resultTime) * 100) / 100;\n const resultFpsPercentage = resultEndTime / 16;\n const pad = (str, num) => {\n str = String(str);\n while (str.length < num) {\n str = ' ' + str;\n }\n return str;\n };\n console.info(`%c⏱ ${pad(resultEndTime, 5)} /${pad(depEndTime, 5)} ms`, `\n font-size: .6rem;\n font-weight: bold;\n color: hsl(${Math.max(0, Math.min(120 - 120 * resultFpsPercentage, 120))}deg 100% 31%);`, opts == null ? void 0 : opts.key);\n }\n }\n return result;\n };\n}\nfunction getMemoOptions(tableOptions, debugLevel, key, onChange) {\n return {\n debug: () => {\n var _tableOptions$debugAl;\n return (_tableOptions$debugAl = tableOptions == null ? void 0 : tableOptions.debugAll) != null ? _tableOptions$debugAl : tableOptions[debugLevel];\n },\n key: process.env.NODE_ENV === 'development' && key,\n onChange\n };\n}\n\nfunction createCell(table, row, column, columnId) {\n const getRenderValue = () => {\n var _cell$getValue;\n return (_cell$getValue = cell.getValue()) != null ? _cell$getValue : table.options.renderFallbackValue;\n };\n const cell = {\n id: `${row.id}_${column.id}`,\n row,\n column,\n getValue: () => row.getValue(columnId),\n renderValue: getRenderValue,\n getContext: memo(() => [table, column, row, cell], (table, column, row, cell) => ({\n table,\n column,\n row,\n cell: cell,\n getValue: cell.getValue,\n renderValue: cell.renderValue\n }), getMemoOptions(table.options, 'debugCells', 'cell.getContext'))\n };\n table._features.forEach(feature => {\n feature.createCell == null || feature.createCell(cell, column, row, table);\n }, {});\n return cell;\n}\n\nfunction createColumn(table, columnDef, depth, parent) {\n var _ref, _resolvedColumnDef$id;\n const defaultColumn = table._getDefaultColumnDef();\n const resolvedColumnDef = {\n ...defaultColumn,\n ...columnDef\n };\n const accessorKey = resolvedColumnDef.accessorKey;\n let id = (_ref = (_resolvedColumnDef$id = resolvedColumnDef.id) != null ? _resolvedColumnDef$id : accessorKey ? typeof String.prototype.replaceAll === 'function' ? accessorKey.replaceAll('.', '_') : accessorKey.replace(/\\./g, '_') : undefined) != null ? _ref : typeof resolvedColumnDef.header === 'string' ? resolvedColumnDef.header : undefined;\n let accessorFn;\n if (resolvedColumnDef.accessorFn) {\n accessorFn = resolvedColumnDef.accessorFn;\n } else if (accessorKey) {\n // Support deep accessor keys\n if (accessorKey.includes('.')) {\n accessorFn = originalRow => {\n let result = originalRow;\n for (const key of accessorKey.split('.')) {\n var _result;\n result = (_result = result) == null ? void 0 : _result[key];\n if (process.env.NODE_ENV !== 'production' && result === undefined) {\n console.warn(`\"${key}\" in deeply nested key \"${accessorKey}\" returned undefined.`);\n }\n }\n return result;\n };\n } else {\n accessorFn = originalRow => originalRow[resolvedColumnDef.accessorKey];\n }\n }\n if (!id) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(resolvedColumnDef.accessorFn ? `Columns require an id when using an accessorFn` : `Columns require an id when using a non-string header`);\n }\n throw new Error();\n }\n let column = {\n id: `${String(id)}`,\n accessorFn,\n parent: parent,\n depth,\n columnDef: resolvedColumnDef,\n columns: [],\n getFlatColumns: memo(() => [true], () => {\n var _column$columns;\n return [column, ...((_column$columns = column.columns) == null ? void 0 : _column$columns.flatMap(d => d.getFlatColumns()))];\n }, getMemoOptions(table.options, 'debugColumns', 'column.getFlatColumns')),\n getLeafColumns: memo(() => [table._getOrderColumnsFn()], orderColumns => {\n var _column$columns2;\n if ((_column$columns2 = column.columns) != null && _column$columns2.length) {\n let leafColumns = column.columns.flatMap(column => column.getLeafColumns());\n return orderColumns(leafColumns);\n }\n return [column];\n }, getMemoOptions(table.options, 'debugColumns', 'column.getLeafColumns'))\n };\n for (const feature of table._features) {\n feature.createColumn == null || feature.createColumn(column, table);\n }\n\n // Yes, we have to convert table to unknown, because we know more than the compiler here.\n return column;\n}\n\nconst debug = 'debugHeaders';\n//\n\nfunction createHeader(table, column, options) {\n var _options$id;\n const id = (_options$id = options.id) != null ? _options$id : column.id;\n let header = {\n id,\n column,\n index: options.index,\n isPlaceholder: !!options.isPlaceholder,\n placeholderId: options.placeholderId,\n depth: options.depth,\n subHeaders: [],\n colSpan: 0,\n rowSpan: 0,\n headerGroup: null,\n getLeafHeaders: () => {\n const leafHeaders = [];\n const recurseHeader = h => {\n if (h.subHeaders && h.subHeaders.length) {\n h.subHeaders.map(recurseHeader);\n }\n leafHeaders.push(h);\n };\n recurseHeader(header);\n return leafHeaders;\n },\n getContext: () => ({\n table,\n header: header,\n column\n })\n };\n table._features.forEach(feature => {\n feature.createHeader == null || feature.createHeader(header, table);\n });\n return header;\n}\nconst Headers = {\n createTable: table => {\n // Header Groups\n\n table.getHeaderGroups = memo(() => [table.getAllColumns(), table.getVisibleLeafColumns(), table.getState().columnPinning.left, table.getState().columnPinning.right], (allColumns, leafColumns, left, right) => {\n var _left$map$filter, _right$map$filter;\n const leftColumns = (_left$map$filter = left == null ? void 0 : left.map(columnId => leafColumns.find(d => d.id === columnId)).filter(Boolean)) != null ? _left$map$filter : [];\n const rightColumns = (_right$map$filter = right == null ? void 0 : right.map(columnId => leafColumns.find(d => d.id === columnId)).filter(Boolean)) != null ? _right$map$filter : [];\n const centerColumns = leafColumns.filter(column => !(left != null && left.includes(column.id)) && !(right != null && right.includes(column.id)));\n const headerGroups = buildHeaderGroups(allColumns, [...leftColumns, ...centerColumns, ...rightColumns], table);\n return headerGroups;\n }, getMemoOptions(table.options, debug, 'getHeaderGroups'));\n table.getCenterHeaderGroups = memo(() => [table.getAllColumns(), table.getVisibleLeafColumns(), table.getState().columnPinning.left, table.getState().columnPinning.right], (allColumns, leafColumns, left, right) => {\n leafColumns = leafColumns.filter(column => !(left != null && left.includes(column.id)) && !(right != null && right.includes(column.id)));\n return buildHeaderGroups(allColumns, leafColumns, table, 'center');\n }, getMemoOptions(table.options, debug, 'getCenterHeaderGroups'));\n table.getLeftHeaderGroups = memo(() => [table.getAllColumns(), table.getVisibleLeafColumns(), table.getState().columnPinning.left], (allColumns, leafColumns, left) => {\n var _left$map$filter2;\n const orderedLeafColumns = (_left$map$filter2 = left == null ? void 0 : left.map(columnId => leafColumns.find(d => d.id === columnId)).filter(Boolean)) != null ? _left$map$filter2 : [];\n return buildHeaderGroups(allColumns, orderedLeafColumns, table, 'left');\n }, getMemoOptions(table.options, debug, 'getLeftHeaderGroups'));\n table.getRightHeaderGroups = memo(() => [table.getAllColumns(), table.getVisibleLeafColumns(), table.getState().columnPinning.right], (allColumns, leafColumns, right) => {\n var _right$map$filter2;\n const orderedLeafColumns = (_right$map$filter2 = right == null ? void 0 : right.map(columnId => leafColumns.find(d => d.id === columnId)).filter(Boolean)) != null ? _right$map$filter2 : [];\n return buildHeaderGroups(allColumns, orderedLeafColumns, table, 'right');\n }, getMemoOptions(table.options, debug, 'getRightHeaderGroups'));\n\n // Footer Groups\n\n table.getFooterGroups = memo(() => [table.getHeaderGroups()], headerGroups => {\n return [...headerGroups].reverse();\n }, getMemoOptions(table.options, debug, 'getFooterGroups'));\n table.getLeftFooterGroups = memo(() => [table.getLeftHeaderGroups()], headerGroups => {\n return [...headerGroups].reverse();\n }, getMemoOptions(table.options, debug, 'getLeftFooterGroups'));\n table.getCenterFooterGroups = memo(() => [table.getCenterHeaderGroups()], headerGroups => {\n return [...headerGroups].reverse();\n }, getMemoOptions(table.options, debug, 'getCenterFooterGroups'));\n table.getRightFooterGroups = memo(() => [table.getRightHeaderGroups()], headerGroups => {\n return [...headerGroups].reverse();\n }, getMemoOptions(table.options, debug, 'getRightFooterGroups'));\n\n // Flat Headers\n\n table.getFlatHeaders = memo(() => [table.getHeaderGroups()], headerGroups => {\n return headerGroups.map(headerGroup => {\n return headerGroup.headers;\n }).flat();\n }, getMemoOptions(table.options, debug, 'getFlatHeaders'));\n table.getLeftFlatHeaders = memo(() => [table.getLeftHeaderGroups()], left => {\n return left.map(headerGroup => {\n return headerGroup.headers;\n }).flat();\n }, getMemoOptions(table.options, debug, 'getLeftFlatHeaders'));\n table.getCenterFlatHeaders = memo(() => [table.getCenterHeaderGroups()], left => {\n return left.map(headerGroup => {\n return headerGroup.headers;\n }).flat();\n }, getMemoOptions(table.options, debug, 'getCenterFlatHeaders'));\n table.getRightFlatHeaders = memo(() => [table.getRightHeaderGroups()], left => {\n return left.map(headerGroup => {\n return headerGroup.headers;\n }).flat();\n }, getMemoOptions(table.options, debug, 'getRightFlatHeaders'));\n\n // Leaf Headers\n\n table.getCenterLeafHeaders = memo(() => [table.getCenterFlatHeaders()], flatHeaders => {\n return flatHeaders.filter(header => {\n var _header$subHeaders;\n return !((_header$subHeaders = header.subHeaders) != null && _header$subHeaders.length);\n });\n }, getMemoOptions(table.options, debug, 'getCenterLeafHeaders'));\n table.getLeftLeafHeaders = memo(() => [table.getLeftFlatHeaders()], flatHeaders => {\n return flatHeaders.filter(header => {\n var _header$subHeaders2;\n return !((_header$subHeaders2 = header.subHeaders) != null && _header$subHeaders2.length);\n });\n }, getMemoOptions(table.options, debug, 'getLeftLeafHeaders'));\n table.getRightLeafHeaders = memo(() => [table.getRightFlatHeaders()], flatHeaders => {\n return flatHeaders.filter(header => {\n var _header$subHeaders3;\n return !((_header$subHeaders3 = header.subHeaders) != null && _header$subHeaders3.length);\n });\n }, getMemoOptions(table.options, debug, 'getRightLeafHeaders'));\n table.getLeafHeaders = memo(() => [table.getLeftHeaderGroups(), table.getCenterHeaderGroups(), table.getRightHeaderGroups()], (left, center, right) => {\n var _left$0$headers, _left$, _center$0$headers, _center$, _right$0$headers, _right$;\n 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 => {\n return header.getLeafHeaders();\n }).flat();\n }, getMemoOptions(table.options, debug, 'getLeafHeaders'));\n }\n};\nfunction buildHeaderGroups(allColumns, columnsToGroup, table, headerFamily) {\n var _headerGroups$0$heade, _headerGroups$;\n // Find the max depth of the columns:\n // build the leaf column row\n // build each buffer row going up\n // placeholder for non-existent level\n // real column for existing level\n\n let maxDepth = 0;\n const findMaxDepth = function (columns, depth) {\n if (depth === void 0) {\n depth = 1;\n }\n maxDepth = Math.max(maxDepth, depth);\n columns.filter(column => column.getIsVisible()).forEach(column => {\n var _column$columns;\n if ((_column$columns = column.columns) != null && _column$columns.length) {\n findMaxDepth(column.columns, depth + 1);\n }\n }, 0);\n };\n findMaxDepth(allColumns);\n let headerGroups = [];\n const createHeaderGroup = (headersToGroup, depth) => {\n // The header group we are creating\n const headerGroup = {\n depth,\n id: [headerFamily, `${depth}`].filter(Boolean).join('_'),\n headers: []\n };\n\n // The parent columns we're going to scan next\n const pendingParentHeaders = [];\n\n // Scan each column for parents\n headersToGroup.forEach(headerToGroup => {\n // What is the latest (last) parent column?\n\n const latestPendingParentHeader = [...pendingParentHeaders].reverse()[0];\n const isLeafHeader = headerToGroup.column.depth === headerGroup.depth;\n let column;\n let isPlaceholder = false;\n if (isLeafHeader && headerToGroup.column.parent) {\n // The parent header is new\n column = headerToGroup.column.parent;\n } else {\n // The parent header is repeated\n column = headerToGroup.column;\n isPlaceholder = true;\n }\n if (latestPendingParentHeader && (latestPendingParentHeader == null ? void 0 : latestPendingParentHeader.column) === column) {\n // This column is repeated. Add it as a sub header to the next batch\n latestPendingParentHeader.subHeaders.push(headerToGroup);\n } else {\n // This is a new header. Let's create it\n const header = createHeader(table, column, {\n id: [headerFamily, depth, column.id, headerToGroup == null ? void 0 : headerToGroup.id].filter(Boolean).join('_'),\n isPlaceholder,\n placeholderId: isPlaceholder ? `${pendingParentHeaders.filter(d => d.column === column).length}` : undefined,\n depth,\n index: pendingParentHeaders.length\n });\n\n // Add the headerToGroup as a subHeader of the new header\n header.subHeaders.push(headerToGroup);\n // Add the new header to the pendingParentHeaders to get grouped\n // in the next batch\n pendingParentHeaders.push(header);\n }\n headerGroup.headers.push(headerToGroup);\n headerToGroup.headerGroup = headerGroup;\n });\n headerGroups.push(headerGroup);\n if (depth > 0) {\n createHeaderGroup(pendingParentHeaders, depth - 1);\n }\n };\n const bottomHeaders = columnsToGroup.map((column, index) => createHeader(table, column, {\n depth: maxDepth,\n index\n }));\n createHeaderGroup(bottomHeaders, maxDepth - 1);\n headerGroups.reverse();\n\n // headerGroups = headerGroups.filter(headerGroup => {\n // return !headerGroup.headers.every(header => header.isPlaceholder)\n // })\n\n const recurseHeadersForSpans = headers => {\n const filteredHeaders = headers.filter(header => header.column.getIsVisible());\n return filteredHeaders.map(header => {\n let colSpan = 0;\n let rowSpan = 0;\n let childRowSpans = [0];\n if (header.subHeaders && header.subHeaders.length) {\n childRowSpans = [];\n recurseHeadersForSpans(header.subHeaders).forEach(_ref => {\n let {\n colSpan: childColSpan,\n rowSpan: childRowSpan\n } = _ref;\n colSpan += childColSpan;\n childRowSpans.push(childRowSpan);\n });\n } else {\n colSpan = 1;\n }\n const minChildRowSpan = Math.min(...childRowSpans);\n rowSpan = rowSpan + minChildRowSpan;\n header.colSpan = colSpan;\n header.rowSpan = rowSpan;\n return {\n colSpan,\n rowSpan\n };\n });\n };\n recurseHeadersForSpans((_headerGroups$0$heade = (_headerGroups$ = headerGroups[0]) == null ? void 0 : _headerGroups$.headers) != null ? _headerGroups$0$heade : []);\n return headerGroups;\n}\n\nconst createRow = (table, id, original, rowIndex, depth, subRows, parentId) => {\n let row = {\n id,\n index: rowIndex,\n original,\n depth,\n parentId,\n _valuesCache: {},\n _uniqueValuesCache: {},\n getValue: columnId => {\n if (row._valuesCache.hasOwnProperty(columnId)) {\n return row._valuesCache[columnId];\n }\n const column = table.getColumn(columnId);\n if (!(column != null && column.accessorFn)) {\n return undefined;\n }\n row._valuesCache[columnId] = column.accessorFn(row.original, rowIndex);\n return row._valuesCache[columnId];\n },\n getUniqueValues: columnId => {\n if (row._uniqueValuesCache.hasOwnProperty(columnId)) {\n return row._uniqueValuesCache[columnId];\n }\n const column = table.getColumn(columnId);\n if (!(column != null && column.accessorFn)) {\n return undefined;\n }\n if (!column.columnDef.getUniqueValues) {\n row._uniqueValuesCache[columnId] = [row.getValue(columnId)];\n return row._uniqueValuesCache[columnId];\n }\n row._uniqueValuesCache[columnId] = column.columnDef.getUniqueValues(row.original, rowIndex);\n return row._uniqueValuesCache[columnId];\n },\n renderValue: columnId => {\n var _row$getValue;\n return (_row$getValue = row.getValue(columnId)) != null ? _row$getValue : table.options.renderFallbackValue;\n },\n subRows: subRows != null ? subRows : [],\n getLeafRows: () => flattenBy(row.subRows, d => d.subRows),\n getParentRow: () => row.parentId ? table.getRow(row.parentId, true) : undefined,\n getParentRows: () => {\n let parentRows = [];\n let currentRow = row;\n while (true) {\n const parentRow = currentRow.getParentRow();\n if (!parentRow) break;\n parentRows.push(parentRow);\n currentRow = parentRow;\n }\n return parentRows.reverse();\n },\n getAllCells: memo(() => [table.getAllLeafColumns()], leafColumns => {\n return leafColumns.map(column => {\n return createCell(table, row, column, column.id);\n });\n }, getMemoOptions(table.options, 'debugRows', 'getAllCells')),\n _getAllCellsByColumnId: memo(() => [row.getAllCells()], allCells => {\n return allCells.reduce((acc, cell) => {\n acc[cell.column.id] = cell;\n return acc;\n }, {});\n }, getMemoOptions(table.options, 'debugRows', 'getAllCellsByColumnId'))\n };\n for (let i = 0; i < table._features.length; i++) {\n const feature = table._features[i];\n feature == null || feature.createRow == null || feature.createRow(row, table);\n }\n return row;\n};\n\n//\n\nconst ColumnFaceting = {\n createColumn: (column, table) => {\n column._getFacetedRowModel = table.options.getFacetedRowModel && table.options.getFacetedRowModel(table, column.id);\n column.getFacetedRowModel = () => {\n if (!column._getFacetedRowModel) {\n return table.getPreFilteredRowModel();\n }\n return column._getFacetedRowModel();\n };\n column._getFacetedUniqueValues = table.options.getFacetedUniqueValues && table.options.getFacetedUniqueValues(table, column.id);\n column.getFacetedUniqueValues = () => {\n if (!column._getFacetedUniqueValues) {\n return new Map();\n }\n return column._getFacetedUniqueValues();\n };\n column._getFacetedMinMaxValues = table.options.getFacetedMinMaxValues && table.options.getFacetedMinMaxValues(table, column.id);\n column.getFacetedMinMaxValues = () => {\n if (!column._getFacetedMinMaxValues) {\n return undefined;\n }\n return column._getFacetedMinMaxValues();\n };\n }\n};\n\nconst includesString = (row, columnId, filterValue) => {\n var _filterValue$toString, _row$getValue;\n const search = filterValue == null || (_filterValue$toString = filterValue.toString()) == null ? void 0 : _filterValue$toString.toLowerCase();\n return Boolean((_row$getValue = row.getValue(columnId)) == null || (_row$getValue = _row$getValue.toString()) == null || (_row$getValue = _row$getValue.toLowerCase()) == null ? void 0 : _row$getValue.includes(search));\n};\nincludesString.autoRemove = val => testFalsey(val);\nconst includesStringSensitive = (row, columnId, filterValue) => {\n var _row$getValue2;\n return Boolean((_row$getValue2 = row.getValue(columnId)) == null || (_row$getValue2 = _row$getValue2.toString()) == null ? void 0 : _row$getValue2.includes(filterValue));\n};\nincludesStringSensitive.autoRemove = val => testFalsey(val);\nconst equalsString = (row, columnId, filterValue) => {\n var _row$getValue3;\n return ((_row$getValue3 = row.getValue(columnId)) == null || (_row$getValue3 = _row$getValue3.toString()) == null ? void 0 : _row$getValue3.toLowerCase()) === (filterValue == null ? void 0 : filterValue.toLowerCase());\n};\nequalsString.autoRemove = val => testFalsey(val);\nconst arrIncludes = (row, columnId, filterValue) => {\n var _row$getValue4;\n return (_row$getValue4 = row.getValue(columnId)) == null ? void 0 : _row$getValue4.includes(filterValue);\n};\narrIncludes.autoRemove = val => testFalsey(val);\nconst arrIncludesAll = (row, columnId, filterValue) => {\n return !filterValue.some(val => {\n var _row$getValue5;\n return !((_row$getValue5 = row.getValue(columnId)) != null && _row$getValue5.includes(val));\n });\n};\narrIncludesAll.autoRemove = val => testFalsey(val) || !(val != null && val.length);\nconst arrIncludesSome = (row, columnId, filterValue) => {\n return filterValue.some(val => {\n var _row$getValue6;\n return (_row$getValue6 = row.getValue(columnId)) == null ? void 0 : _row$getValue6.includes(val);\n });\n};\narrIncludesSome.autoRemove = val => testFalsey(val) || !(val != null && val.length);\nconst equals = (row, columnId, filterValue) => {\n return row.getValue(columnId) === filterValue;\n};\nequals.autoRemove = val => testFalsey(val);\nconst weakEquals = (row, columnId, filterValue) => {\n return row.getValue(columnId) == filterValue;\n};\nweakEquals.autoRemove = val => testFalsey(val);\nconst inNumberRange = (row, columnId, filterValue) => {\n let [min, max] = filterValue;\n const rowValue = row.getValue(columnId);\n return rowValue >= min && rowValue <= max;\n};\ninNumberRange.resolveFilterValue = val => {\n let [unsafeMin, unsafeMax] = val;\n let parsedMin = typeof unsafeMin !== 'number' ? parseFloat(unsafeMin) : unsafeMin;\n let parsedMax = typeof unsafeMax !== 'number' ? parseFloat(unsafeMax) : unsafeMax;\n let min = unsafeMin === null || Number.isNaN(parsedMin) ? -Infinity : parsedMin;\n let max = unsafeMax === null || Number.isNaN(parsedMax) ? Infinity : parsedMax;\n if (min > max) {\n const temp = min;\n min = max;\n max = temp;\n }\n return [min, max];\n};\ninNumberRange.autoRemove = val => testFalsey(val) || testFalsey(val[0]) && testFalsey(val[1]);\n\n// Export\n\nconst filterFns = {\n includesString,\n includesStringSensitive,\n equalsString,\n arrIncludes,\n arrIncludesAll,\n arrIncludesSome,\n equals,\n weakEquals,\n inNumberRange\n};\n// Utils\n\nfunction testFalsey(val) {\n return val === undefined || val === null || val === '';\n}\n\n//\n\nconst ColumnFiltering = {\n getDefaultColumnDef: () => {\n return {\n filterFn: 'auto'\n };\n },\n getInitialState: state => {\n return {\n columnFilters: [],\n ...state\n };\n },\n getDefaultOptions: table => {\n return {\n onColumnFiltersChange: makeStateUpdater('columnFilters', table),\n filterFromLeafRows: false,\n maxLeafRowFilterDepth: 100\n };\n },\n createColumn: (column, table) => {\n column.getAutoFilterFn = () => {\n const firstRow = table.getCoreRowModel().flatRows[0];\n const value = firstRow == null ? void 0 : firstRow.getValue(column.id);\n if (typeof value === 'string') {\n return filterFns.includesString;\n }\n if (typeof value === 'number') {\n return filterFns.inNumberRange;\n }\n if (typeof value === 'boolean') {\n return filterFns.equals;\n }\n if (value !== null && typeof value === 'object') {\n return filterFns.equals;\n }\n if (Array.isArray(value)) {\n return filterFns.arrIncludes;\n }\n return filterFns.weakEquals;\n };\n column.getFilterFn = () => {\n var _table$options$filter, _table$options$filter2;\n return isFunction(column.columnDef.filterFn) ? column.columnDef.filterFn : column.columnDef.filterFn === 'auto' ? column.getAutoFilterFn() : // @ts-ignore\n (_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];\n };\n column.getCanFilter = () => {\n var _column$columnDef$ena, _table$options$enable, _table$options$enable2;\n return ((_column$columnDef$ena = column.columnDef.enableColumnFilter) != null ? _column$columnDef$ena : true) && ((_table$options$enable = table.options.enableColumnFilters) != null ? _table$options$enable : true) && ((_table$options$enable2 = table.options.enableFilters) != null ? _table$options$enable2 : true) && !!column.accessorFn;\n };\n column.getIsFiltered = () => column.getFilterIndex() > -1;\n column.getFilterValue = () => {\n var _table$getState$colum;\n return (_table$getState$colum = table.getState().columnFilters) == null || (_table$getState$colum = _table$getState$colum.find(d => d.id === column.id)) == null ? void 0 : _table$getState$colum.value;\n };\n column.getFilterIndex = () => {\n var _table$getState$colum2, _table$getState$colum3;\n return (_table$getState$colum2 = (_table$getState$colum3 = table.getState().columnFilters) == null ? void 0 : _table$getState$colum3.findIndex(d => d.id === column.id)) != null ? _table$getState$colum2 : -1;\n };\n column.setFilterValue = value => {\n table.setColumnFilters(old => {\n const filterFn = column.getFilterFn();\n const previousFilter = old == null ? void 0 : old.find(d => d.id === column.id);\n const newFilter = functionalUpdate(value, previousFilter ? previousFilter.value : undefined);\n\n //\n if (shouldAutoRemoveFilter(filterFn, newFilter, column)) {\n var _old$filter;\n return (_old$filter = old == null ? void 0 : old.filter(d => d.id !== column.id)) != null ? _old$filter : [];\n }\n const newFilterObj = {\n id: column.id,\n value: newFilter\n };\n if (previousFilter) {\n var _old$map;\n return (_old$map = old == null ? void 0 : old.map(d => {\n if (d.id === column.id) {\n return newFilterObj;\n }\n return d;\n })) != null ? _old$map : [];\n }\n if (old != null && old.length) {\n return [...old, newFilterObj];\n }\n return [newFilterObj];\n });\n };\n },\n createRow: (row, _table) => {\n row.columnFilters = {};\n row.columnFiltersMeta = {};\n },\n createTable: table => {\n table.setColumnFilters = updater => {\n const leafColumns = table.getAllLeafColumns();\n const updateFn = old => {\n var _functionalUpdate;\n return (_functionalUpdate = functionalUpdate(updater, old)) == null ? void 0 : _functionalUpdate.filter(filter => {\n const column = leafColumns.find(d => d.id === filter.id);\n if (column) {\n const filterFn = column.getFilterFn();\n if (shouldAutoRemoveFilter(filterFn, filter.value, column)) {\n return false;\n }\n }\n return true;\n });\n };\n table.options.onColumnFiltersChange == null || table.options.onColumnFiltersChange(updateFn);\n };\n table.resetColumnFilters = defaultState => {\n var _table$initialState$c, _table$initialState;\n table.setColumnFilters(defaultState ? [] : (_table$initialState$c = (_table$initialState = table.initialState) == null ? void 0 : _table$initialState.columnFilters) != null ? _table$initialState$c : []);\n };\n table.getPreFilteredRowModel = () => table.getCoreRowModel();\n table.getFilteredRowModel = () => {\n if (!table._getFilteredRowModel && table.options.getFilteredRowModel) {\n table._getFilteredRowModel = table.options.getFilteredRowModel(table);\n }\n if (table.options.manualFiltering || !table._getFilteredRowModel) {\n return table.getPreFilteredRowModel();\n }\n return table._getFilteredRowModel();\n };\n }\n};\nfunction shouldAutoRemoveFilter(filterFn, value, column) {\n return (filterFn && filterFn.autoRemove ? filterFn.autoRemove(value, column) : false) || typeof value === 'undefined' || typeof value === 'string' && !value;\n}\n\nconst sum = (columnId, _leafRows, childRows) => {\n // It's faster to just add the aggregations together instead of\n // process leaf nodes individually\n return childRows.reduce((sum, next) => {\n const nextValue = next.getValue(columnId);\n return sum + (typeof nextValue === 'number' ? nextValue : 0);\n }, 0);\n};\nconst min = (columnId, _leafRows, childRows) => {\n let min;\n childRows.forEach(row => {\n const value = row.getValue(columnId);\n if (value != null && (min > value || min === undefined && value >= value)) {\n min = value;\n }\n });\n return min;\n};\nconst max = (columnId, _leafRows, childRows) => {\n let max;\n childRows.forEach(row => {\n const value = row.getValue(columnId);\n if (value != null && (max < value || max === undefined && value >= value)) {\n max = value;\n }\n });\n return max;\n};\nconst extent = (columnId, _leafRows, childRows) => {\n let min;\n let max;\n childRows.forEach(row => {\n const value = row.getValue(columnId);\n if (value != null) {\n if (min === undefined) {\n if (value >= value) min = max = value;\n } else {\n if (min > value) min = value;\n if (max < value) max = value;\n }\n }\n });\n return [min, max];\n};\nconst mean = (columnId, leafRows) => {\n let count = 0;\n let sum = 0;\n leafRows.forEach(row => {\n let value = row.getValue(columnId);\n if (value != null && (value = +value) >= value) {\n ++count, sum += value;\n }\n });\n if (count) return sum / count;\n return;\n};\nconst median = (columnId, leafRows) => {\n if (!leafRows.length) {\n return;\n }\n const values = leafRows.map(row => row.getValue(columnId));\n if (!isNumberArray(values)) {\n return;\n }\n if (values.length === 1) {\n return values[0];\n }\n const mid = Math.floor(values.length / 2);\n const nums = values.sort((a, b) => a - b);\n return values.length % 2 !== 0 ? nums[mid] : (nums[mid - 1] + nums[mid]) / 2;\n};\nconst unique = (columnId, leafRows) => {\n return Array.from(new Set(leafRows.map(d => d.getValue(columnId))).values());\n};\nconst uniqueCount = (columnId, leafRows) => {\n return new Set(leafRows.map(d => d.getValue(columnId))).size;\n};\nconst count = (_columnId, leafRows) => {\n return leafRows.length;\n};\nconst aggregationFns = {\n sum,\n min,\n max,\n extent,\n mean,\n median,\n unique,\n uniqueCount,\n count\n};\n\n//\n\nconst ColumnGrouping = {\n getDefaultColumnDef: () => {\n return {\n aggregatedCell: props => {\n var _toString, _props$getValue;\n return (_toString = (_props$getValue = props.getValue()) == null || _props$getValue.toString == null ? void 0 : _props$getValue.toString()) != null ? _toString : null;\n },\n aggregationFn: 'auto'\n };\n },\n getInitialState: state => {\n return {\n grouping: [],\n ...state\n };\n },\n getDefaultOptions: table => {\n return {\n onGroupingChange: makeStateUpdater('grouping', table),\n groupedColumnMode: 'reorder'\n };\n },\n createColumn: (column, table) => {\n column.toggleGrouping = () => {\n table.setGrouping(old => {\n // Find any existing grouping for this column\n if (old != null && old.includes(column.id)) {\n return old.filter(d => d !== column.id);\n }\n return [...(old != null ? old : []), column.id];\n });\n };\n column.getCanGroup = () => {\n var _column$columnDef$ena, _table$options$enable;\n return ((_column$columnDef$ena = column.columnDef.enableGrouping) != null ? _column$columnDef$ena : true) && ((_table$options$enable = table.options.enableGrouping) != null ? _table$options$enable : true) && (!!column.accessorFn || !!column.columnDef.getGroupingValue);\n };\n column.getIsGrouped = () => {\n var _table$getState$group;\n return (_table$getState$group = table.getState().grouping) == null ? void 0 : _table$getState$group.includes(column.id);\n };\n column.getGroupedIndex = () => {\n var _table$getState$group2;\n return (_table$getState$group2 = table.getState().grouping) == null ? void 0 : _table$getState$group2.indexOf(column.id);\n };\n column.getToggleGroupingHandler = () => {\n const canGroup = column.getCanGroup();\n return () => {\n if (!canGroup) return;\n column.toggleGrouping();\n };\n };\n column.getAutoAggregationFn = () => {\n const firstRow = table.getCoreRowModel().flatRows[0];\n const value = firstRow == null ? void 0 : firstRow.getValue(column.id);\n if (typeof value === 'number') {\n return aggregationFns.sum;\n }\n if (Object.prototype.toString.call(value) === '[object Date]') {\n return aggregationFns.extent;\n }\n };\n column.getAggregationFn = () => {\n var _table$options$aggreg, _table$options$aggreg2;\n if (!column) {\n throw new Error();\n }\n 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];\n };\n },\n createTable: table => {\n table.setGrouping = updater => table.options.onGroupingChange == null ? void 0 : table.options.onGroupingChange(updater);\n table.resetGrouping = defaultState => {\n var _table$initialState$g, _table$initialState;\n table.setGrouping(defaultState ? [] : (_table$initialState$g = (_table$initialState = table.initialState) == null ? void 0 : _table$initialState.grouping) != null ? _table$initialState$g : []);\n };\n table.getPreGroupedRowModel = () => table.getFilteredRowModel();\n table.getGroupedRowModel = () => {\n if (!table._getGroupedRowModel && table.options.getGroupedRowModel) {\n table._getGroupedRowModel = table.options.getGroupedRowModel(table);\n }\n if (table.options.manualGrouping || !table._getGroupedRowModel) {\n return table.getPreGroupedRowModel();\n }\n return table._getGroupedRowModel();\n };\n },\n createRow: (row, table) => {\n row.getIsGrouped = () => !!row.groupingColumnId;\n row.getGroupingValue = columnId => {\n if (row._groupingValuesCache.hasOwnProperty(columnId)) {\n return row._groupingValuesCache[columnId];\n }\n const column = table.getColumn(columnId);\n if (!(column != null && column.columnDef.getGroupingValue)) {\n return row.getValue(columnId);\n }\n row._groupingValuesCache[columnId] = column.columnDef.getGroupingValue(row.original);\n return row._groupingValuesCache[columnId];\n };\n row._groupingValuesCache = {};\n },\n createCell: (cell, column, row, table) => {\n cell.getIsGrouped = () => column.getIsGrouped() && column.id === row.groupingColumnId;\n cell.getIsPlaceholder = () => !cell.getIsGrouped() && column.getIsGrouped();\n cell.getIsAggregated = () => {\n var _row$subRows;\n return !cell.getIsGrouped() && !cell.getIsPlaceholder() && !!((_row$subRows = row.subRows) != null && _row$subRows.length);\n };\n }\n};\nfunction orderColumns(leafColumns, grouping, groupedColumnMode) {\n if (!(grouping != null && grouping.length) || !groupedColumnMode) {\n return leafColumns;\n }\n const nonGroupingColumns = leafColumns.filter(col => !grouping.includes(col.id));\n if (groupedColumnMode === 'remove') {\n return nonGroupingColumns;\n }\n const groupingColumns = grouping.map(g => leafColumns.find(col => col.id === g)).filter(Boolean);\n return [...groupingColumns, ...nonGroupingColumns];\n}\n\n//\n\nconst ColumnOrdering = {\n getInitialState: state => {\n return {\n columnOrder: [],\n ...state\n };\n },\n getDefaultOptions: table => {\n return {\n onColumnOrderChange: makeStateUpdater('columnOrder', table)\n };\n },\n createColumn: (column, table) => {\n column.getIndex = memo(position => [_getVisibleLeafColumns(table, position)], columns => columns.findIndex(d => d.id === column.id), getMemoOptions(table.options, 'debugColumns', 'getIndex'));\n column.getIsFirstColumn = position => {\n var _columns$;\n const columns = _getVisibleLeafColumns(table, position);\n return ((_columns$ = columns[0]) == null ? void 0 : _columns$.id) === column.id;\n };\n column.getIsLastColumn = position => {\n var _columns;\n const columns = _getVisibleLeafColumns(table, position);\n return ((_columns = columns[columns.length - 1]) == null ? void 0 : _columns.id) === column.id;\n };\n },\n createTable: table => {\n table.setColumnOrder = updater => table.options.onColumnOrderChange == null ? void 0 : table.options.onColumnOrderChange(updater);\n table.resetColumnOrder = defaultState => {\n var _table$initialState$c;\n table.setColumnOrder(defaultState ? [] : (_table$initialState$c = table.initialState.columnOrder) != null ? _table$initialState$c : []);\n };\n table._getOrderColumnsFn = memo(() => [table.getState().columnOrder, table.getState().grouping, table.options.groupedColumnMode], (columnOrder, grouping, groupedColumnMode) => columns => {\n // Sort grouped columns to the start of the column list\n // before the headers are built\n let orderedColumns = [];\n\n // If there is no order, return the normal columns\n if (!(columnOrder != null && columnOrder.length)) {\n orderedColumns = columns;\n } else {\n const columnOrderCopy = [...columnOrder];\n\n // If there is an order, make a copy of the columns\n const columnsCopy = [...columns];\n\n // And make a new ordered array of the columns\n\n // Loop over the columns and place them in order into the new array\n while (columnsCopy.length && columnOrderCopy.length) {\n const targetColumnId = columnOrderCopy.shift();\n const foundIndex = columnsCopy.findIndex(d => d.id === targetColumnId);\n if (foundIndex > -1) {\n orderedColumns.push(columnsCopy.splice(foundIndex, 1)[0]);\n }\n }\n\n // If there are any columns left, add them to the end\n orderedColumns = [...orderedColumns, ...columnsCopy];\n }\n return orderColumns(orderedColumns, grouping, groupedColumnMode);\n }, getMemoOptions(table.options, 'debugTable', '_getOrderColumnsFn'));\n }\n};\n\n//\n\nconst getDefaultColumnPinningState = () => ({\n left: [],\n right: []\n});\nconst ColumnPinning = {\n getInitialState: state => {\n return {\n columnPinning: getDefaultColumnPinningState(),\n ...state\n };\n },\n getDefaultOptions: table => {\n return {\n onColumnPinningChange: makeStateUpdater('columnPinning', table)\n };\n },\n createColumn: (column, table) => {\n column.pin = position => {\n const columnIds = column.getLeafColumns().map(d => d.id).filter(Boolean);\n table.setColumnPinning(old => {\n var _old$left3, _old$right3;\n if (position === 'right') {\n var _old$left, _old$right;\n return {\n left: ((_old$left = old == null ? void 0 : old.left) != null ? _old$left : []).filter(d => !(columnIds != null && columnIds.includes(d))),\n right: [...((_old$right = old == null ? void 0 : old.right) != null ? _old$right : []).filter(d => !(columnIds != null && columnIds.includes(d))), ...columnIds]\n };\n }\n if (position === 'left') {\n var _old$left2, _old$right2;\n return {\n left: [...((_old$left2 = old == null ? void 0 : old.left) != null ? _old$left2 : []).filter(d => !(columnIds != null && columnIds.includes(d))), ...columnIds],\n right: ((_old$right2 = old == null ? void 0 : old.right) != null ? _old$right2 : []).filter(d => !(columnIds != null && columnIds.includes(d)))\n };\n }\n return {\n left: ((_old$left3 = old == null ? void 0 : old.left) != null ? _old$left3 : []).filter(d => !(columnIds != null && columnIds.includes(d))),\n right: ((_old$right3 = old == null ? void 0 : old.right) != null ? _old$right3 : []).filter(d => !(columnIds != null && columnIds.includes(d)))\n };\n });\n };\n column.getCanPin = () => {\n const leafColumns = column.getLeafColumns();\n return leafColumns.some(d => {\n var _d$columnDef$enablePi, _ref, _table$options$enable;\n return ((_d$columnDef$enablePi = d.columnDef.enablePinning) != null ? _d$columnDef$enablePi : true) && ((_ref = (_table$options$enable = table.options.enableColumnPinning) != null ? _table$options$enable : table.options.enablePinning) != null ? _ref : true);\n });\n };\n column.getIsPinned = () => {\n const leafColumnIds = column.getLeafColumns().map(d => d.id);\n const {\n left,\n right\n } = table.getState().columnPinning;\n const isLeft = leafColumnIds.some(d => left == null ? void 0 : left.includes(d));\n const isRight = leafColumnIds.some(d => right == null ? void 0 : right.includes(d));\n return isLeft ? 'left' : isRight ? 'right' : false;\n };\n column.getPinnedIndex = () => {\n var _table$getState$colum, _table$getState$colum2;\n const position = column.getIsPinned();\n return position ? (_table$getState$colum = (_table$getState$colum2 = table.getState().columnPinning) == null || (_table$getState$colum2 = _table$getState$colum2[position]) == null ? void 0 : _table$getState$colum2.indexOf(column.id)) != null ? _table$getState$colum : -1 : 0;\n };\n },\n createRow: (row, table) => {\n row.getCenterVisibleCells = memo(() => [row._getAllVisibleCells(), table.getState().columnPinning.left, table.getState().columnPinning.right], (allCells, left, right) => {\n const leftAndRight = [...(left != null ? left : []), ...(right != null ? right : [])];\n return allCells.filter(d => !leftAndRight.includes(d.column.id));\n }, getMemoOptions(table.options, 'debugRows', 'getCenterVisibleCells'));\n row.getLeftVisibleCells = memo(() => [row._getAllVisibleCells(), table.getState().columnPinning.left], (allCells, left) => {\n const cells = (left != null ? left : []).map(columnId => allCells.find(cell => cell.column.id === columnId)).filter(Boolean).map(d => ({\n ...d,\n position: 'left'\n }));\n return cells;\n }, getMemoOptions(table.options, 'debugRows', 'getLeftVisibleCells'));\n row.getRightVisibleCells = memo(() => [row._getAllVisibleCells(), table.getState().columnPinning.right], (allCells, right) => {\n const cells = (right != null ? right : []).map(columnId => allCells.find(cell => cell.column.id === columnId)).filter(Boolean).map(d => ({\n ...d,\n position: 'right'\n }));\n return cells;\n }, getMemoOptions(table.options, 'debugRows', 'getRightVisibleCells'));\n },\n createTable: table => {\n table.setColumnPinning = updater => table.options.onColumnPinningChange == null ? void 0 : table.options.onColumnPinningChange(updater);\n table.resetColumnPinning = defaultState => {\n var _table$initialState$c, _table$initialState;\n return table.setColumnPinning(defaultState ? getDefaultColumnPinningState() : (_table$initialState$c = (_table$initialState = table.initialState) == null ? void 0 : _table$initialState.columnPinning) != null ? _table$initialState$c : getDefaultColumnPinningState());\n };\n table.getIsSomeColumnsPinned = position => {\n var _pinningState$positio;\n const pinningState = table.getState().columnPinning;\n if (!position) {\n var _pinningState$left, _pinningState$right;\n return Boolean(((_pinningState$left = pinningState.left) == null ? void 0 : _pinningState$left.length) || ((_pinningState$right = pinningState.right) == null ? void 0 : _pinningState$right.length));\n }\n return Boolean((_pinningState$positio = pinningState[position]) == null ? void 0 : _pinningState$positio.length);\n };\n table.getLeftLeafColumns = memo(() => [table.getAllLeafColumns(), table.getState().columnPinning.left], (allColumns, left) => {\n return (left != null ? left : []).map(columnId => allColumns.find(column => column.id === columnId)).filter(Boolean);\n }, getMemoOptions(table.options, 'debugColumns', 'getLeftLeafColumns'));\n table.getRightLeafColumns = memo(() => [table.getAllLeafColumns(), table.getState().columnPinning.right], (allColumns, right) => {\n return (right != null ? right : []).map(columnId => allColumns.find(column => column.id === columnId)).filter(Boolean);\n }, getMemoOptions(table.options, 'debugColumns', 'getRightLeafColumns'));\n table.getCenterLeafColumns = memo(() => [table.getAllLeafColumns(), table.getState().columnPinning.left, table.getState().columnPinning.right], (allColumns, left, right) => {\n const leftAndRight = [...(left != null ? left : []), ...(right != null ? right : [])];\n return allColumns.filter(d => !leftAndRight.includes(d.id));\n }, getMemoOptions(table.options, 'debugColumns', 'getCenterLeafColumns'));\n }\n};\n\n//\n\n//\n\nconst defaultColumnSizing = {\n size: 150,\n minSize: 20,\n maxSize: Number.MAX_SAFE_INTEGER\n};\nconst getDefaultColumnSizingInfoState = () => ({\n startOffset: null,\n startSize: null,\n deltaOffset: null,\n deltaPercentage: null,\n isResizingColumn: false,\n columnSizingStart: []\n});\nconst ColumnSizing = {\n getDefaultColumnDef: () => {\n return defaultColumnSizing;\n },\n getInitialState: state => {\n return {\n columnSizing: {},\n columnSizingInfo: getDefaultColumnSizingInfoState(),\n ...state\n };\n },\n getDefaultOptions: table => {\n return {\n columnResizeMode: 'onEnd',\n columnResizeDirection: 'ltr',\n onColumnSizingChange: makeStateUpdater('columnSizing', table),\n onColumnSizingInfoChange: makeStateUpdater('columnSizingInfo', table)\n };\n },\n createColumn: (column, table) => {\n column.getSize = () => {\n var _column$columnDef$min, _ref, _column$columnDef$max;\n const columnSize = table.getState().columnSizing[column.id];\n return Math.min(Math.max((_column$columnDef$min = column.columnDef.minSize) != null ? _column$columnDef$min : defaultColumnSizing.minSize, (_ref = columnSize != null ? columnSize : column.columnDef.size) != null ? _ref : defaultColumnSizing.size), (_column$columnDef$max = column.columnDef.maxSize) != null ? _column$columnDef$max : defaultColumnSizing.maxSize);\n };\n column.getStart = memo(position => [position, _getVisibleLeafColumns(table, position), table.getState().columnSizing], (position, columns) => columns.slice(0, column.getIndex(position)).reduce((sum, column) => sum + column.getSize(), 0), getMemoOptions(table.options, 'debugColumns', 'getStart'));\n column.getAfter = memo(position => [position, _getVisibleLeafColumns(table, position), table.getState().columnSizing], (position, columns) => columns.slice(column.getIndex(position) + 1).reduce((sum, column) => sum + column.getSize(), 0), getMemoOptions(table.options, 'debugColumns', 'getAfter'));\n column.resetSize = () => {\n table.setColumnSizing(_ref2 => {\n let {\n [column.id]: _,\n ...rest\n } = _ref2;\n return rest;\n });\n };\n column.getCanResize = () => {\n var _column$columnDef$ena, _table$options$enable;\n return ((_column$columnDef$ena = column.columnDef.enableResizing) != null ? _column$columnDef$ena : true) && ((_table$options$enable = table.options.enableColumnResizing) != null ? _table$options$enable : true);\n };\n column.getIsResizing = () => {\n return table.getState().columnSizingInfo.isResizingColumn === column.id;\n };\n },\n createHeader: (header, table) => {\n header.getSize = () => {\n let sum = 0;\n const recurse = header => {\n if (header.subHeaders.length) {\n header.subHeaders.forEach(recurse);\n } else {\n var _header$column$getSiz;\n sum += (_header$column$getSiz = header.column.getSize()) != null ? _header$column$getSiz : 0;\n }\n };\n recurse(header);\n return sum;\n };\n header.getStart = () => {\n if (header.index > 0) {\n const prevSiblingHeader = header.headerGroup.headers[header.index - 1];\n return prevSiblingHeader.getStart() + prevSiblingHeader.getSize();\n }\n return 0;\n };\n header.getResizeHandler = _contextDocument => {\n const column = table.getColumn(header.column.id);\n const canResize = column == null ? void 0 : column.getCanResize();\n return e => {\n if (!column || !canResize) {\n return;\n }\n e.persist == null || e.persist();\n if (isTouchStartEvent(e)) {\n // lets not respond to multiple touches (e.g. 2 or 3 fingers)\n if (e.touches && e.touches.length > 1) {\n return;\n }\n }\n const startSize = header.getSize();\n const columnSizingStart = header ? header.getLeafHeaders().map(d => [d.column.id, d.column.getSize()]) : [[column.id, column.getSize()]];\n const clientX = isTouchStartEvent(e) ? Math.round(e.touches[0].clientX) : e.clientX;\n const newColumnSizing = {};\n const updateOffset = (eventType, clientXPos) => {\n if (typeof clientXPos !== 'number') {\n return;\n }\n table.setColumnSizingInfo(old => {\n var _old$startOffset, _old$startSize;\n const deltaDirection = table.options.columnResizeDirection === 'rtl' ? -1 : 1;\n const deltaOffset = (clientXPos - ((_old$startOffset = old == null ? void 0 : old.startOffset) != null ? _old$startOffset : 0)) * deltaDirection;\n const deltaPercentage = Math.max(deltaOffset / ((_old$startSize = old == null ? void 0 : old.startSize) != null ? _old$startSize : 0), -0.999999);\n old.columnSizingStart.forEach(_ref3 => {\n let [columnId, headerSize] = _ref3;\n newColumnSizing[columnId] = Math.round(Math.max(headerSize + headerSize * deltaPercentage, 0) * 100) / 100;\n });\n return {\n ...old,\n deltaOffset,\n deltaPercentage\n };\n });\n if (table.options.columnResizeMode === 'onChange' || eventType === 'end') {\n table.setColumnSizing(old => ({\n ...old,\n ...newColumnSizing\n }));\n }\n };\n const onMove = clientXPos => updateOffset('move', clientXPos);\n const onEnd = clientXPos => {\n updateOffset('end', clientXPos);\n table.setColumnSizingInfo(old => ({\n ...old,\n isResizingColumn: false,\n startOffset: null,\n startSize: null,\n deltaOffset: null,\n deltaPercentage: null,\n columnSizingStart: []\n }));\n };\n const contextDocument = _contextDocument || typeof document !== 'undefined' ? document : null;\n const mouseEvents = {\n moveHandler: e => onMove(e.clientX),\n upHandler: e => {\n contextDocument == null || contextDocument.removeEventListener('mousemove', mouseEvents.moveHandler);\n contextDocument == null || contextDocument.removeEventListener('mouseup', mouseEvents.upHandler);\n onEnd(e.clientX);\n }\n };\n const touchEvents = {\n moveHandler: e => {\n if (e.cancelable) {\n e.preventDefault();\n e.stopPropagation();\n }\n onMove(e.touches[0].clientX);\n return false;\n },\n upHandler: e => {\n var _e$touches$;\n contextDocument == null || contextDocument.removeEventListener('touchmove', touchEvents.moveHandler);\n contextDocument == null || contextDocument.removeEventListener('touchend', touchEvents.upHandler);\n if (e.cancelable) {\n e.preventDefault();\n e.stopPropagation();\n }\n onEnd((_e$touches$ = e.touches[0]) == null ? void 0 : _e$touches$.clientX);\n }\n };\n const passiveIfSupported = passiveEventSupported() ? {\n passive: false\n } : false;\n if (isTouchStartEvent(e)) {\n contextDocument == null || contextDocument.addEventListener('touchmove', touchEvents.moveHandler, passiveIfSupported);\n contextDocument == null || contextDocument.addEventListener('touchend', touchEvents.upHandler, passiveIfSupported);\n } else {\n contextDocument == null || contextDocument.addEventListener('mousemove', mouseEvents.moveHandler, passiveIfSupported);\n contextDocument == null || contextDocument.addEventListener('mouseup', mouseEvents.upHandler, passiveIfSupported);\n }\n table.setColumnSizingInfo(old => ({\n ...old,\n startOffset: clientX,\n startSize,\n deltaOffset: 0,\n deltaPercentage: 0,\n columnSizingStart,\n isResizingColumn: column.id\n }));\n };\n };\n },\n createTable: table => {\n table.setColumnSizing = updater => table.options.onColumnSizingChange == null ? void 0 : table.options.onColumnSizingChange(updater);\n table.setColumnSizingInfo = updater => table.options.onColumnSizingInfoChange == null ? void 0 : table.options.onColumnSizingInfoChange(updater);\n table.resetColumnSizing = defaultState => {\n var _table$initialState$c;\n table.setColumnSizing(defaultState ? {} : (_table$initialState$c = table.initialState.columnSizing) != null ? _table$initialState$c : {});\n };\n table.resetHeaderSizeInfo = defaultState => {\n var _table$initialState$c2;\n table.setColumnSizingInfo(defaultState ? getDefaultColumnSizingInfoState() : (_table$initialState$c2 = table.initialState.columnSizingInfo) != null ? _table$initialState$c2 : getDefaultColumnSizingInfoState());\n };\n table.getTotalSize = () => {\n var _table$getHeaderGroup, _table$getHeaderGroup2;\n return (_table$getHeaderGroup = (_table$getHeaderGroup2 = table.getHeaderGroups()[0]) == null ? void 0 : _table$getHeaderGroup2.headers.reduce((sum, header) => {\n return sum + header.getSize();\n }, 0)) != null ? _table$getHeaderGroup : 0;\n };\n table.getLeftTotalSize = () => {\n var _table$getLeftHeaderG, _table$getLeftHeaderG2;\n return (_table$getLeftHeaderG = (_table$getLeftHeaderG2 = table.getLeftHeaderGroups()[0]) == null ? void 0 : _table$getLeftHeaderG2.headers.reduce((sum, header) => {\n return sum + header.getSize();\n }, 0)) != null ? _table$getLeftHeaderG : 0;\n };\n table.getCenterTotalSize = () => {\n var _table$getCenterHeade, _table$getCenterHeade2;\n return (_table$getCenterHeade = (_table$getCenterHeade2 = table.getCenterHeaderGroups()[0]) == null ? void 0 : _table$getCenterHeade2.headers.reduce((sum, header) => {\n return sum + header.getSize();\n }, 0)) != null ? _table$getCenterHeade : 0;\n };\n table.getRightTotalSize = () => {\n var _table$getRightHeader, _table$getRightHeader2;\n return (_table$getRightHeader = (_table$getRightHeader2 = table.getRightHeaderGroups()[0]) == null ? void 0 : _table$getRightHeader2.headers.reduce((sum, header) => {\n return sum + header.getSize();\n }, 0)) != null ? _table$getRightHeader : 0;\n };\n }\n};\nlet passiveSupported = null;\nfunction passiveEventSupported() {\n if (typeof passiveSupported === 'boolean') return passiveSupported;\n let supported = false;\n try {\n const options = {\n get passive() {\n supported = true;\n return false;\n }\n };\n const noop = () => {};\n window.addEventListener('test', noop, options);\n window.removeEventListener('test', noop);\n } catch (err) {\n supported = false;\n }\n passiveSupported = supported;\n return passiveSupported;\n}\nfunction isTouchStartEvent(e) {\n return e.type === 'touchstart';\n}\n\n//\n\nconst ColumnVisibility = {\n getInitialState: state => {\n return {\n columnVisibility: {},\n ...state\n };\n },\n getDefaultOptions: table => {\n return {\n onColumnVisibilityChange: makeStateUpdater('columnVisibility', table)\n };\n },\n createColumn: (column, table) => {\n column.toggleVisibility = value => {\n if (column.getCanHide()) {\n table.setColumnVisibility(old => ({\n ...old,\n [column.id]: value != null ? value : !column.getIsVisible()\n }));\n }\n };\n column.getIsVisible = () => {\n var _ref, _table$getState$colum;\n const childColumns = column.columns;\n return (_ref = childColumns.length ? childColumns.some(c => c.getIsVisible()) : (_table$getState$colum = table.getState().columnVisibility) == null ? void 0 : _table$getState$colum[column.id]) != null ? _ref : true;\n };\n column.getCanHide = () => {\n var _column$columnDef$ena, _table$options$enable;\n return ((_column$columnDef$ena = column.columnDef.enableHiding) != null ? _column$columnDef$ena : true) && ((_table$options$enable = table.options.enableHiding) != null ? _table$options$enable : true);\n };\n column.getToggleVisibilityHandler = () => {\n return e => {\n column.toggleVisibility == null || column.toggleVisibility(e.target.checked);\n };\n };\n },\n createRow: (row, table) => {\n row._getAllVisibleCells = memo(() => [row.getAllCells(), table.getState().columnVisibility], cells => {\n return cells.filter(cell => cell.column.getIsVisible());\n }, getMemoOptions(table.options, 'debugRows', '_getAllVisibleCells'));\n row.getVisibleCells = memo(() => [row.getLeftVisibleCells(), row.getCenterVisibleCells(), row.getRightVisibleCells()], (left, center, right) => [...left, ...center, ...right], getMemoOptions(table.options, 'debugRows', 'getVisibleCells'));\n },\n createTable: table => {\n const makeVisibleColumnsMethod = (key, getColumns) => {\n return memo(() => [getColumns(), getColumns().filter(d => d.getIsVisible()).map(d => d.id).join('_')], columns => {\n return columns.filter(d => d.getIsVisible == null ? void 0 : d.getIsVisible());\n }, getMemoOptions(table.options, 'debugColumns', key));\n };\n table.getVisibleFlatColumns = makeVisibleColumnsMethod('getVisibleFlatColumns', () => table.getAllFlatColumns());\n table.getVisibleLeafColumns = makeVisibleColumnsMethod('getVisibleLeafColumns', () => table.getAllLeafColumns());\n table.getLeftVisibleLeafColumns = makeVisibleColumnsMethod('getLeftVisibleLeafColumns', () => table.getLeftLeafColumns());\n table.getRightVisibleLeafColumns = makeVisibleColumnsMethod('getRightVisibleLeafColumns', () => table.getRightLeafColumns());\n table.getCenterVisibleLeafColumns = makeVisibleColumnsMethod('getCenterVisibleLeafColumns', () => table.getCenterLeafColumns());\n table.setColumnVisibility = updater => table.options.onColumnVisibilityChange == null ? void 0 : table.options.onColumnVisibilityChange(updater);\n table.resetColumnVisibility = defaultState => {\n var _table$initialState$c;\n table.setColumnVisibility(defaultState ? {} : (_table$initialState$c = table.initialState.columnVisibility) != null ? _table$initialState$c : {});\n };\n table.toggleAllColumnsVisible = value => {\n var _value;\n value = (_value = value) != null ? _value : !table.getIsAllColumnsVisible();\n table.setColumnVisibility(table.getAllLeafColumns().reduce((obj, column) => ({\n ...obj,\n [column.id]: !value ? !(column.getCanHide != null && column.getCanHide()) : value\n }), {}));\n };\n table.getIsAllColumnsVisible = () => !table.getAllLeafColumns().some(column => !(column.getIsVisible != null && column.getIsVisible()));\n table.getIsSomeColumnsVisible = () => table.getAllLeafColumns().some(column => column.getIsVisible == null ? void 0 : column.getIsVisible());\n table.getToggleAllColumnsVisibilityHandler = () => {\n return e => {\n var _target;\n table.toggleAllColumnsVisible((_target = e.target) == null ? void 0 : _target.checked);\n };\n };\n }\n};\nfunction _getVisibleLeafColumns(table, position) {\n return !position ? table.getVisibleLeafColumns() : position === 'center' ? table.getCenterVisibleLeafColumns() : position === 'left' ? table.getLeftVisibleLeafColumns() : table.getRightVisibleLeafColumns();\n}\n\n//\n\nconst GlobalFaceting = {\n createTable: table => {\n table._getGlobalFacetedRowModel = table.options.getFacetedRowModel && table.options.getFacetedRowModel(table, '__global__');\n table.getGlobalFacetedRowModel = () => {\n if (table.options.manualFiltering || !table._getGlobalFacetedRowModel) {\n return table.getPreFilteredRowModel();\n }\n return table._getGlobalFacetedRowModel();\n };\n table._getGlobalFacetedUniqueValues = table.options.getFacetedUniqueValues && table.options.getFacetedUniqueValues(table, '__global__');\n table.getGlobalFacetedUniqueValues = () => {\n if (!table._getGlobalFacetedUniqueValues) {\n return new Map();\n }\n return table._getGlobalFacetedUniqueValues();\n };\n table._getGlobalFacetedMinMaxValues = table.options.getFacetedMinMaxValues && table.options.getFacetedMinMaxValues(table, '__global__');\n table.getGlobalFacetedMinMaxValues = () => {\n if (!table._getGlobalFacetedMinMaxValues) {\n return;\n }\n return table._getGlobalFacetedMinMaxValues();\n };\n }\n};\n\n//\n\nconst GlobalFiltering = {\n getInitialState: state => {\n return {\n globalFilter: undefined,\n ...state\n };\n },\n getDefaultOptions: table => {\n return {\n onGlobalFilterChange: makeStateUpdater('globalFilter', table),\n globalFilterFn: 'auto',\n getColumnCanGlobalFilter: column => {\n var _table$getCoreRowMode;\n const value = (_table$getCoreRowMode = table.getCoreRowModel().flatRows[0]) == null || (_table$getCoreRowMode = _table$getCoreRowMode._getAllCellsByColumnId()[column.id]) == null ? void 0 : _table$getCoreRowMode.getValue();\n return typeof value === 'string' || typeof value === 'number';\n }\n };\n },\n createColumn: (column, table) => {\n column.getCanGlobalFilter = () => {\n var _column$columnDef$ena, _table$options$enable, _table$options$enable2, _table$options$getCol;\n return ((_column$columnDef$ena = column.columnDef.enableGlobalFilter) != null ? _column$columnDef$ena : true) && ((_table$options$enable = table.options.enableGlobalFilter) != null ? _table$options$enable : true) && ((_table$options$enable2 = table.options.enableFilters) != null ? _table$options$enable2 : true) && ((_table$options$getCol = table.options.getColumnCanGlobalFilter == null ? void 0 : table.options.getColumnCanGlobalFilter(column)) != null ? _table$options$getCol : true) && !!column.accessorFn;\n };\n },\n createTable: table => {\n table.getGlobalAutoFilterFn = () => {\n return filterFns.includesString;\n };\n table.getGlobalFilterFn = () => {\n var _table$options$filter, _table$options$filter2;\n const {\n globalFilterFn: globalFilterFn\n } = table.options;\n return isFunction(globalFilterFn) ? globalFilterFn : globalFilterFn === 'auto' ? table.getGlobalAutoFilterFn() : (_table$options$filter = (_table$options$filter2 = table.options.filterFns) == null ? void 0 : _table$options$filter2[globalFilterFn]) != null ? _table$options$filter : filterFns[globalFilterFn];\n };\n table.setGlobalFilter = updater => {\n table.options.onGlobalFilterChange == null || table.options.onGlobalFilterChange(updater);\n };\n table.resetGlobalFilter = defaultState => {\n table.setGlobalFilter(defaultState ? undefined : table.initialState.globalFilter);\n };\n }\n};\n\n//\n\nconst RowExpanding = {\n getInitialState: state => {\n return {\n expanded: {},\n ...state\n };\n },\n getDefaultOptions: table => {\n return {\n onExpandedChange: makeStateUpdater('expanded', table),\n paginateExpandedRows: true\n };\n },\n createTable: table => {\n let registered = false;\n let queued = false;\n table._autoResetExpanded = () => {\n var _ref, _table$options$autoRe;\n if (!registered) {\n table._queue(() => {\n registered = true;\n });\n return;\n }\n if ((_ref = (_table$options$autoRe = table.options.autoResetAll) != null ? _table$options$autoRe : table.options.autoResetExpanded) != null ? _ref : !table.options.manualExpanding) {\n if (queued) return;\n queued = true;\n table._queue(() => {\n table.resetExpanded();\n queued = false;\n });\n }\n };\n table.setExpanded = updater => table.options.onExpandedChange == null ? void 0 : table.options.onExpandedChange(updater);\n table.toggleAllRowsExpanded = expanded => {\n if (expanded != null ? expanded : !table.getIsAllRowsExpanded()) {\n table.setExpanded(true);\n } else {\n table.setExpanded({});\n }\n };\n table.resetExpanded = defaultState => {\n var _table$initialState$e, _table$initialState;\n table.setExpanded(defaultState ? {} : (_table$initialState$e = (_table$initialState = table.initialState) == null ? void 0 : _table$initialState.expanded) != null ? _table$initialState$e : {});\n };\n table.getCanSomeRowsExpand = () => {\n return table.getPrePaginationRowModel().flatRows.some(row => row.getCanExpand());\n };\n table.getToggleAllRowsExpandedHandler = () => {\n return e => {\n e.persist == null || e.persist();\n table.toggleAllRowsExpanded();\n };\n };\n table.getIsSomeRowsExpanded = () => {\n const expanded = table.getState().expanded;\n return expanded === true || Object.values(expanded).some(Boolean);\n };\n table.getIsAllRowsExpanded = () => {\n const expanded = table.getState().expanded;\n\n // If expanded is true, save some cycles and return true\n if (typeof expanded === 'boolean') {\n return expanded === true;\n }\n if (!Object.keys(expanded).length) {\n return false;\n }\n\n // If any row is not expanded, return false\n if (table.getRowModel().flatRows.some(row => !row.getIsExpanded())) {\n return false;\n }\n\n // They must all be expanded :shrug:\n return true;\n };\n table.getExpandedDepth = () => {\n let maxDepth = 0;\n const rowIds = table.getState().expanded === true ? Object.keys(table.getRowModel().rowsById) : Object.keys(table.getState().expanded);\n rowIds.forEach(id => {\n const splitId = id.split('.');\n maxDepth = Math.max(maxDepth, splitId.length);\n });\n return maxDepth;\n };\n table.getPreExpandedRowModel = () => table.getSortedRowModel();\n table.getExpandedRowModel = () => {\n if (!table._getExpandedRowModel && table.options.getExpandedRowModel) {\n table._getExpandedRowModel = table.options.getExpandedRowModel(table);\n }\n if (table.options.manualExpanding || !table._getExpandedRowModel) {\n return table.getPreExpandedRowModel();\n }\n return table._getExpandedRowModel();\n };\n },\n createRow: (row, table) => {\n row.toggleExpanded = expanded => {\n table.setExpanded(old => {\n var _expanded;\n const exists = old === true ? true : !!(old != null && old[row.id]);\n let oldExpanded = {};\n if (old === true) {\n Object.keys(table.getRowModel().rowsById).forEach(rowId => {\n oldExpanded[rowId] = true;\n });\n } else {\n oldExpanded = old;\n }\n expanded = (_expanded = expanded) != null ? _expanded : !exists;\n if (!exists && expanded) {\n return {\n ...oldExpanded,\n [row.id]: true\n };\n }\n if (exists && !expanded) {\n const {\n [row.id]: _,\n ...rest\n } = oldExpanded;\n return rest;\n }\n return old;\n });\n };\n row.getIsExpanded = () => {\n var _table$options$getIsR;\n const expanded = table.getState().expanded;\n 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]));\n };\n row.getCanExpand = () => {\n var _table$options$getRow, _table$options$enable, _row$subRows;\n 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);\n };\n row.getIsAllParentsExpanded = () => {\n let isFullyExpanded = true;\n let currentRow = row;\n while (isFullyExpanded && currentRow.parentId) {\n currentRow = table.getRow(currentRow.parentId, true);\n isFullyExpanded = currentRow.getIsExpanded();\n }\n return isFullyExpanded;\n };\n row.getToggleExpandedHandler = () => {\n const canExpand = row.getCanExpand();\n return () => {\n if (!canExpand) return;\n row.toggleExpanded();\n };\n };\n }\n};\n\n//\n\nconst defaultPageIndex = 0;\nconst defaultPageSize = 10;\nconst getDefaultPaginationState = () => ({\n pageIndex: defaultPageIndex,\n pageSize: defaultPageSize\n});\nconst RowPagination = {\n getInitialState: state => {\n return {\n ...state,\n pagination: {\n ...getDefaultPaginationState(),\n ...(state == null ? void 0 : state.pagination)\n }\n };\n },\n getDefaultOptions: table => {\n return {\n onPaginationChange: makeStateUpdater('pagination', table)\n };\n },\n createTable: table => {\n let registered = false;\n let queued = false;\n table._autoResetPageIndex = () => {\n var _ref, _table$options$autoRe;\n if (!registered) {\n table._queue(() => {\n registered = true;\n });\n return;\n }\n if ((_ref = (_table$options$autoRe = table.options.autoResetAll) != null ? _table$options$autoRe : table.options.autoResetPageIndex) != null ? _ref : !table.options.manualPagination) {\n if (queued) return;\n queued = true;\n table._queue(() => {\n table.resetPageIndex();\n queued = false;\n });\n }\n };\n table.setPagination = updater => {\n const safeUpdater = old => {\n let newState = functionalUpdate(updater, old);\n return newState;\n };\n return table.options.onPaginationChange == null ? void 0 : table.options.onPaginationChange(safeUpdater);\n };\n table.resetPagination = defaultState => {\n var _table$initialState$p;\n table.setPagination(defaultState ? getDefaultPaginationState() : (_table$initialState$p = table.initialState.pagination) != null ? _table$initialState$p : getDefaultPaginationState());\n };\n table.setPageIndex = updater => {\n table.setPagination(old => {\n let pageIndex = functionalUpdate(updater, old.pageIndex);\n const maxPageIndex = typeof table.options.pageCount === 'undefined' || table.options.pageCount === -1 ? Number.MAX_SAFE_INTEGER : table.options.pageCount - 1;\n pageIndex = Math.max(0, Math.min(pageIndex, maxPageIndex));\n return {\n ...old,\n pageIndex\n };\n });\n };\n table.resetPageIndex = defaultState => {\n var _table$initialState$p2, _table$initialState;\n table.setPageIndex(defaultState ? defaultPageIndex : (_table$initialState$p2 = (_table$initialState = table.initialState) == null || (_table$initialState = _table$initialState.pagination) == null ? void 0 : _table$initialState.pageIndex) != null ? _table$initialState$p2 : defaultPageIndex);\n };\n table.resetPageSize = defaultState => {\n var _table$initialState$p3, _table$initialState2;\n table.setPageSize(defaultState ? defaultPageSize : (_table$initialState$p3 = (_table$initialState2 = table.initialState) == null || (_table$initialState2 = _table$initialState2.pagination) == null ? void 0 : _table$initialState2.pageSize) != null ? _table$initialState$p3 : defaultPageSize);\n };\n table.setPageSize = updater => {\n table.setPagination(old => {\n const pageSize = Math.max(1, functionalUpdate(updater, old.pageSize));\n const topRowIndex = old.pageSize * old.pageIndex;\n const pageIndex = Math.floor(topRowIndex / pageSize);\n return {\n ...old,\n pageIndex,\n pageSize\n };\n });\n };\n //deprecated\n table.setPageCount = updater => table.setPagination(old => {\n var _table$options$pageCo;\n let newPageCount = functionalUpdate(updater, (_table$options$pageCo = table.options.pageCount) != null ? _table$options$pageCo : -1);\n if (typeof newPageCount === 'number') {\n newPageCount = Math.max(-1, newPageCount);\n }\n return {\n ...old,\n pageCount: newPageCount\n };\n });\n table.getPageOptions = memo(() => [table.getPageCount()], pageCount => {\n let pageOptions = [];\n if (pageCount && pageCount > 0) {\n pageOptions = [...new Array(pageCount)].fill(null).map((_, i) => i);\n }\n return pageOptions;\n }, getMemoOptions(table.options, 'debugTable', 'getPageOptions'));\n table.getCanPreviousPage = () => table.getState().pagination.pageIndex > 0;\n table.getCanNextPage = () => {\n const {\n pageIndex\n } = table.getState().pagination;\n const pageCount = table.getPageCount();\n if (pageCount === -1) {\n return true;\n }\n if (pageCount === 0) {\n return false;\n }\n return pageIndex < pageCount - 1;\n };\n table.previousPage = () => {\n return table.setPageIndex(old => old - 1);\n };\n table.nextPage = () => {\n return table.setPageIndex(old => {\n return old + 1;\n });\n };\n table.firstPage = () => {\n return table.setPageIndex(0);\n };\n table.lastPage = () => {\n return table.setPageIndex(table.getPageCount() - 1);\n };\n table.getPrePaginationRowModel = () => table.getExpandedRowModel();\n table.getPaginationRowModel = () => {\n if (!table._getPaginationRowModel && table.options.getPaginationRowModel) {\n table._getPaginationRowModel = table.options.getPaginationRowModel(table);\n }\n if (table.options.manualPagination || !table._getPaginationRowModel) {\n return table.getPrePaginationRowModel();\n }\n return table._getPaginationRowModel();\n };\n table.getPageCount = () => {\n var _table$options$pageCo2;\n return (_table$options$pageCo2 = table.options.pageCount) != null ? _table$options$pageCo2 : Math.ceil(table.getRowCount() / table.getState().pagination.pageSize);\n };\n table.getRowCount = () => {\n var _table$options$rowCou;\n return (_table$options$rowCou = table.options.rowCount) != null ? _table$options$rowCou : table.getPrePaginationRowModel().rows.length;\n };\n }\n};\n\n//\n\nconst getDefaultRowPinningState = () => ({\n top: [],\n bottom: []\n});\nconst RowPinning = {\n getInitialState: state => {\n return {\n rowPinning: getDefaultRowPinningState(),\n ...state\n };\n },\n getDefaultOptions: table => {\n return {\n onRowPinningChange: makeStateUpdater('rowPinning', table)\n };\n },\n createRow: (row, table) => {\n row.pin = (position, includeLeafRows, includeParentRows) => {\n const leafRowIds = includeLeafRows ? row.getLeafRows().map(_ref => {\n let {\n id\n } = _ref;\n return id;\n }) : [];\n const parentRowIds = includeParentRows ? row.getParentRows().map(_ref2 => {\n let {\n id\n } = _ref2;\n return id;\n }) : [];\n const rowIds = new Set([...parentRowIds, row.id, ...leafRowIds]);\n table.setRowPinning(old => {\n var _old$top3, _old$bottom3;\n if (position === 'bottom') {\n var _old$top, _old$bottom;\n return {\n top: ((_old$top = old == null ? void 0 : old.top) != null ? _old$top : []).filter(d => !(rowIds != null && rowIds.has(d))),\n bottom: [...((_old$bottom = old == null ? void 0 : old.bottom) != null ? _old$bottom : []).filter(d => !(rowIds != null && rowIds.has(d))), ...Array.from(rowIds)]\n };\n }\n if (position === 'top') {\n var _old$top2, _old$bottom2;\n return {\n top: [...((_old$top2 = old == null ? void 0 : old.top) != null ? _old$top2 : []).filter(d => !(rowIds != null && rowIds.has(d))), ...Array.from(rowIds)],\n bottom: ((_old$bottom2 = old == null ? void 0 : old.bottom) != null ? _old$bottom2 : []).filter(d => !(rowIds != null && rowIds.has(d)))\n };\n }\n return {\n top: ((_old$top3 = old == null ? void 0 : old.top) != null ? _old$top3 : []).filter(d => !(rowIds != null && rowIds.has(d))),\n bottom: ((_old$bottom3 = old == null ? void 0 : old.bottom) != null ? _old$bottom3 : []).filter(d => !(rowIds != null && rowIds.has(d)))\n };\n });\n };\n row.getCanPin = () => {\n var _ref3;\n const {\n enableRowPinning,\n enablePinning\n } = table.options;\n if (typeof enableRowPinning === 'function') {\n return enableRowPinning(row);\n }\n return (_ref3 = enableRowPinning != null ? enableRowPinning : enablePinning) != null ? _ref3 : true;\n };\n row.getIsPinned = () => {\n const rowIds = [row.id];\n const {\n top,\n bottom\n } = table.getState().rowPinning;\n const isTop = rowIds.some(d => top == null ? void 0 : top.includes(d));\n const isBottom = rowIds.some(d => bottom == null ? void 0 : bottom.includes(d));\n return isTop ? 'top' : isBottom ? 'bottom' : false;\n };\n row.getPinnedIndex = () => {\n var _ref4, _visiblePinnedRowIds$;\n const position = row.getIsPinned();\n if (!position) return -1;\n const visiblePinnedRowIds = (_ref4 = position === 'top' ? table.getTopRows() : table.getBottomRows()) == null ? void 0 : _ref4.map(_ref5 => {\n let {\n id\n } = _ref5;\n return id;\n });\n return (_visiblePinnedRowIds$ = visiblePinnedRowIds == null ? void 0 : visiblePinnedRowIds.indexOf(row.id)) != null ? _visiblePinnedRowIds$ : -1;\n };\n },\n createTable: table => {\n table.setRowPinning = updater => table.options.onRowPinningChange == null ? void 0 : table.options.onRowPinningChange(updater);\n table.resetRowPinning = defaultState => {\n var _table$initialState$r, _table$initialState;\n return table.setRowPinning(defaultState ? getDefaultRowPinningState() : (_table$initialState$r = (_table$initialState = table.initialState) == null ? void 0 : _table$initialState.rowPinning) != null ? _table$initialState$r : getDefaultRowPinningState());\n };\n table.getIsSomeRowsPinned = position => {\n var _pinningState$positio;\n const pinningState = table.getState().rowPinning;\n if (!position) {\n var _pinningState$top, _pinningState$bottom;\n return Boolean(((_pinningState$top = pinningState.top) == null ? void 0 : _pinningState$top.length) || ((_pinningState$bottom = pinningState.bottom) == null ? void 0 : _pinningState$bottom.length));\n }\n return Boolean((_pinningState$positio = pinningState[position]) == null ? void 0 : _pinningState$positio.length);\n };\n table._getPinnedRows = (visibleRows, pinnedRowIds, position) => {\n var _table$options$keepPi;\n const rows = ((_table$options$keepPi = table.options.keepPinnedRows) != null ? _table$options$keepPi : true) ?\n //get all rows that are pinned even if they would not be otherwise visible\n //account for expanded parent rows, but not pagination or filtering\n (pinnedRowIds != null ? pinnedRowIds : []).map(rowId => {\n const row = table.getRow(rowId, true);\n return row.getIsAllParentsExpanded() ? row : null;\n }) :\n //else get only visible rows that are pinned\n (pinnedRowIds != null ? pinnedRowIds : []).map(rowId => visibleRows.find(row => row.id === rowId));\n return rows.filter(Boolean).map(d => ({\n ...d,\n position\n }));\n };\n table.getTopRows = memo(() => [table.getRowModel().rows, table.getState().rowPinning.top], (allRows, topPinnedRowIds) => table._getPinnedRows(allRows, topPinnedRowIds, 'top'), getMemoOptions(table.options, 'debugRows', 'getTopRows'));\n table.getBottomRows = memo(() => [table.getRowModel().rows, table.getState().rowPinning.bottom], (allRows, bottomPinnedRowIds) => table._getPinnedRows(allRows, bottomPinnedRowIds, 'bottom'), getMemoOptions(table.options, 'debugRows', 'getBottomRows'));\n table.getCenterRows = memo(() => [table.getRowModel().rows, table.getState().rowPinning.top, table.getState().rowPinning.bottom], (allRows, top, bottom) => {\n const topAndBottom = new Set([...(top != null ? top : []), ...(bottom != null ? bottom : [])]);\n return allRows.filter(d => !topAndBottom.has(d.id));\n }, getMemoOptions(table.options, 'debugRows', 'getCenterRows'));\n }\n};\n\n//\n\nconst RowSelection = {\n getInitialState: state => {\n return {\n rowSelection: {},\n ...state\n };\n },\n getDefaultOptions: table => {\n return {\n onRowSelectionChange: makeStateUpdater('rowSelection', table),\n enableRowSelection: true,\n enableMultiRowSelection: true,\n enableSubRowSelection: true\n // enableGroupingRowSelection: false,\n // isAdditiveSelectEvent: (e: unknown) => !!e.metaKey,\n // isInclusiveSelectEvent: (e: unknown) => !!e.shiftKey,\n };\n },\n createTable: table => {\n table.setRowSelection = updater => table.options.onRowSelectionChange == null ? void 0 : table.options.onRowSelectionChange(updater);\n table.resetRowSelection = defaultState => {\n var _table$initialState$r;\n return table.setRowSelection(defaultState ? {} : (_table$initialState$r = table.initialState.rowSelection) != null ? _table$initialState$r : {});\n };\n table.toggleAllRowsSelected = value => {\n table.setRowSelection(old => {\n value = typeof value !== 'undefined' ? value : !table.getIsAllRowsSelected();\n const rowSelection = {\n ...old\n };\n const preGroupedFlatRows = table.getPreGroupedRowModel().flatRows;\n\n // We don't use `mutateRowIsSelected` here for performance reasons.\n // All of the rows are flat already, so it wouldn't be worth it\n if (value) {\n preGroupedFlatRows.forEach(row => {\n if (!row.getCanSelect()) {\n return;\n }\n rowSelection[row.id] = true;\n });\n } else {\n preGroupedFlatRows.forEach(row => {\n delete rowSelection[row.id];\n });\n }\n return rowSelection;\n });\n };\n table.toggleAllPageRowsSelected = value => table.setRowSelection(old => {\n const resolvedValue = typeof value !== 'undefined' ? value : !table.getIsAllPageRowsSelected();\n const rowSelection = {\n ...old\n };\n table.getRowModel().rows.forEach(row => {\n mutateRowIsSelected(rowSelection, row.id, resolvedValue, true, table);\n });\n return rowSelection;\n });\n\n // addRowSelectionRange: rowId => {\n // const {\n // rows,\n // rowsById,\n // options: { selectGroupingRows, selectSubRows },\n // } = table\n\n // const findSelectedRow = (rows: Row[]) => {\n // let found\n // rows.find(d => {\n // if (d.getIsSelected()) {\n // found = d\n // return true\n // }\n // const subFound = findSelectedRow(d.subRows || [])\n // if (subFound) {\n // found = subFound\n // return true\n // }\n // return false\n // })\n // return found\n // }\n\n // const firstRow = findSelectedRow(rows) || rows[0]\n // const lastRow = rowsById[rowId]\n\n // let include = false\n // const selectedRowIds = {}\n\n // const addRow = (row: Row) => {\n // mutateRowIsSelected(selectedRowIds, row.id, true, {\n // rowsById,\n // selectGroupingRows: selectGroupingRows!,\n // selectSubRows: selectSubRows!,\n // })\n // }\n\n // table.rows.forEach(row => {\n // const isFirstRow = row.id === firstRow.id\n // const isLastRow = row.id === lastRow.id\n\n // if (isFirstRow || isLastRow) {\n // if (!include) {\n // include = true\n // } else if (include) {\n // addRow(row)\n // include = false\n // }\n // }\n\n // if (include) {\n // addRow(row)\n // }\n // })\n\n // table.setRowSelection(selectedRowIds)\n // },\n table.getPreSelectedRowModel = () => table.getCoreRowModel();\n table.getSelectedRowModel = memo(() => [table.getState().rowSelection, table.getCoreRowModel()], (rowSelection, rowModel) => {\n if (!Object.keys(rowSelection).length) {\n return {\n rows: [],\n flatRows: [],\n rowsById: {}\n };\n }\n return selectRowsFn(table, rowModel);\n }, getMemoOptions(table.options, 'debugTable', 'getSelectedRowModel'));\n table.getFilteredSelectedRowModel = memo(() => [table.getState().rowSelection, table.getFilteredRowModel()], (rowSelection, rowModel) => {\n if (!Object.keys(rowSelection).length) {\n return {\n rows: [],\n flatRows: [],\n rowsById: {}\n };\n }\n return selectRowsFn(table, rowModel);\n }, getMemoOptions(table.options, 'debugTable', 'getFilteredSelectedRowModel'));\n table.getGroupedSelectedRowModel = memo(() => [table.getState().rowSelection, table.getSortedRowModel()], (rowSelection, rowModel) => {\n if (!Object.keys(rowSelection).length) {\n return {\n rows: [],\n flatRows: [],\n rowsById: {}\n };\n }\n return selectRowsFn(table, rowModel);\n }, getMemoOptions(table.options, 'debugTable', 'getGroupedSelectedRowModel'));\n\n ///\n\n // getGroupingRowCanSelect: rowId => {\n // const row = table.getRow(rowId)\n\n // if (!row) {\n // throw new Error()\n // }\n\n // if (typeof table.options.enableGroupingRowSelection === 'function') {\n // return table.options.enableGroupingRowSelection(row)\n // }\n\n // return table.options.enableGroupingRowSelection ?? false\n // },\n\n table.getIsAllRowsSelected = () => {\n const preGroupedFlatRows = table.getFilteredRowModel().flatRows;\n const {\n rowSelection\n } = table.getState();\n let isAllRowsSelected = Boolean(preGroupedFlatRows.length && Object.keys(rowSelection).length);\n if (isAllRowsSelected) {\n if (preGroupedFlatRows.some(row => row.getCanSelect() && !rowSelection[row.id])) {\n isAllRowsSelected = false;\n }\n }\n return isAllRowsSelected;\n };\n table.getIsAllPageRowsSelected = () => {\n const paginationFlatRows = table.getPaginationRowModel().flatRows.filter(row => row.getCanSelect());\n const {\n rowSelection\n } = table.getState();\n let isAllPageRowsSelected = !!paginationFlatRows.length;\n if (isAllPageRowsSelected && paginationFlatRows.some(row => !rowSelection[row.id])) {\n isAllPageRowsSelected = false;\n }\n return isAllPageRowsSelected;\n };\n table.getIsSomeRowsSelected = () => {\n var _table$getState$rowSe;\n const totalSelected = Object.keys((_table$getState$rowSe = table.getState().rowSelection) != null ? _table$getState$rowSe : {}).length;\n return totalSelected > 0 && totalSelected < table.getFilteredRowModel().flatRows.length;\n };\n table.getIsSomePageRowsSelected = () => {\n const paginationFlatRows = table.getPaginationRowModel().flatRows;\n return table.getIsAllPageRowsSelected() ? false : paginationFlatRows.filter(row => row.getCanSelect()).some(d => d.getIsSelected() || d.getIsSomeSelected());\n };\n table.getToggleAllRowsSelectedHandler = () => {\n return e => {\n table.toggleAllRowsSelected(e.target.checked);\n };\n };\n table.getToggleAllPageRowsSelectedHandler = () => {\n return e => {\n table.toggleAllPageRowsSelected(e.target.checked);\n };\n };\n },\n createRow: (row, table) => {\n row.toggleSelected = (value, opts) => {\n const isSelected = row.getIsSelected();\n table.setRowSelection(old => {\n var _opts$selectChildren;\n value = typeof value !== 'undefined' ? value : !isSelected;\n if (row.getCanSelect() && isSelected === value) {\n return old;\n }\n const selectedRowIds = {\n ...old\n };\n mutateRowIsSelected(selectedRowIds, row.id, value, (_opts$selectChildren = opts == null ? void 0 : opts.selectChildren) != null ? _opts$selectChildren : true, table);\n return selectedRowIds;\n });\n };\n row.getIsSelected = () => {\n const {\n rowSelection\n } = table.getState();\n return isRowSelected(row, rowSelection);\n };\n row.getIsSomeSelected = () => {\n const {\n rowSelection\n } = table.getState();\n return isSubRowSelected(row, rowSelection) === 'some';\n };\n row.getIsAllSubRowsSelected = () => {\n const {\n rowSelection\n } = table.getState();\n return isSubRowSelected(row, rowSelection) === 'all';\n };\n row.getCanSelect = () => {\n var _table$options$enable;\n if (typeof table.options.enableRowSelection === 'function') {\n return table.options.enableRowSelection(row);\n }\n return (_table$options$enable = table.options.enableRowSelection) != null ? _table$options$enable : true;\n };\n row.getCanSelectSubRows = () => {\n var _table$options$enable2;\n if (typeof table.options.enableSubRowSelection === 'function') {\n return table.options.enableSubRowSelection(row);\n }\n return (_table$options$enable2 = table.options.enableSubRowSelection) != null ? _table$options$enable2 : true;\n };\n row.getCanMultiSelect = () => {\n var _table$options$enable3;\n if (typeof table.options.enableMultiRowSelection === 'function') {\n return table.options.enableMultiRowSelection(row);\n }\n return (_table$options$enable3 = table.options.enableMultiRowSelection) != null ? _table$options$enable3 : true;\n };\n row.getToggleSelectedHandler = () => {\n const canSelect = row.getCanSelect();\n return e => {\n var _target;\n if (!canSelect) return;\n row.toggleSelected((_target = e.target) == null ? void 0 : _target.checked);\n };\n };\n }\n};\nconst mutateRowIsSelected = (selectedRowIds, id, value, includeChildren, table) => {\n var _row$subRows;\n const row = table.getRow(id, true);\n\n // const isGrouped = row.getIsGrouped()\n\n // if ( // TODO: enforce grouping row selection rules\n // !isGrouped ||\n // (isGrouped && table.options.enableGroupingRowSelection)\n // ) {\n if (value) {\n if (!row.getCanMultiSelect()) {\n Object.keys(selectedRowIds).forEach(key => delete selectedRowIds[key]);\n }\n if (row.getCanSelect()) {\n selectedRowIds[id] = true;\n }\n } else {\n delete selectedRowIds[id];\n }\n // }\n\n if (includeChildren && (_row$subRows = row.subRows) != null && _row$subRows.length && row.getCanSelectSubRows()) {\n row.subRows.forEach(row => mutateRowIsSelected(selectedRowIds, row.id, value, includeChildren, table));\n }\n};\nfunction selectRowsFn(table, rowModel) {\n const rowSelection = table.getState().rowSelection;\n const newSelectedFlatRows = [];\n const newSelectedRowsById = {};\n\n // Filters top level and nested rows\n const recurseRows = function (rows, depth) {\n return rows.map(row => {\n var _row$subRows2;\n const isSelected = isRowSelected(row, rowSelection);\n if (isSelected) {\n newSelectedFlatRows.push(row);\n newSelectedRowsById[row.id] = row;\n }\n if ((_row$subRows2 = row.subRows) != null && _row$subRows2.length) {\n row = {\n ...row,\n subRows: recurseRows(row.subRows)\n };\n }\n if (isSelected) {\n return row;\n }\n }).filter(Boolean);\n };\n return {\n rows: recurseRows(rowModel.rows),\n flatRows: newSelectedFlatRows,\n rowsById: newSelectedRowsById\n };\n}\nfunction isRowSelected(row, selection) {\n var _selection$row$id;\n return (_selection$row$id = selection[row.id]) != null ? _selection$row$id : false;\n}\nfunction isSubRowSelected(row, selection, table) {\n var _row$subRows3;\n if (!((_row$subRows3 = row.subRows) != null && _row$subRows3.length)) return false;\n let allChildrenSelected = true;\n let someSelected = false;\n row.subRows.forEach(subRow => {\n // Bail out early if we know both of these\n if (someSelected && !allChildrenSelected) {\n return;\n }\n if (subRow.getCanSelect()) {\n if (isRowSelected(subRow, selection)) {\n someSelected = true;\n } else {\n allChildrenSelected = false;\n }\n }\n\n // Check row selection of nested subrows\n if (subRow.subRows && subRow.subRows.length) {\n const subRowChildrenSelected = isSubRowSelected(subRow, selection);\n if (subRowChildrenSelected === 'all') {\n someSelected = true;\n } else if (subRowChildrenSelected === 'some') {\n someSelected = true;\n allChildrenSelected = false;\n } else {\n allChildrenSelected = false;\n }\n }\n });\n return allChildrenSelected ? 'all' : someSelected ? 'some' : false;\n}\n\nconst reSplitAlphaNumeric = /([0-9]+)/gm;\nconst alphanumeric = (rowA, rowB, columnId) => {\n return compareAlphanumeric(toString(rowA.getValue(columnId)).toLowerCase(), toString(rowB.getValue(columnId)).toLowerCase());\n};\nconst alphanumericCaseSensitive = (rowA, rowB, columnId) => {\n return compareAlphanumeric(toString(rowA.getValue(columnId)), toString(rowB.getValue(columnId)));\n};\n\n// The text filter is more basic (less numeric support)\n// but is much faster\nconst text = (rowA, rowB, columnId) => {\n return compareBasic(toString(rowA.getValue(columnId)).toLowerCase(), toString(rowB.getValue(columnId)).toLowerCase());\n};\n\n// The text filter is more basic (less numeric support)\n// but is much faster\nconst textCaseSensitive = (rowA, rowB, columnId) => {\n return compareBasic(toString(rowA.getValue(columnId)), toString(rowB.getValue(columnId)));\n};\nconst datetime = (rowA, rowB, columnId) => {\n const a = rowA.getValue(columnId);\n const b = rowB.getValue(columnId);\n\n // Can handle nullish values\n // Use > and < because == (and ===) doesn't work with\n // Date objects (would require calling getTime()).\n return a > b ? 1 : a < b ? -1 : 0;\n};\nconst basic = (rowA, rowB, columnId) => {\n return compareBasic(rowA.getValue(columnId), rowB.getValue(columnId));\n};\n\n// Utils\n\nfunction compareBasic(a, b) {\n return a === b ? 0 : a > b ? 1 : -1;\n}\nfunction toString(a) {\n if (typeof a === 'number') {\n if (isNaN(a) || a === Infinity || a === -Infinity) {\n return '';\n }\n return String(a);\n }\n if (typeof a === 'string') {\n return a;\n }\n return '';\n}\n\n// Mixed sorting is slow, but very inclusive of many edge cases.\n// It handles numbers, mixed alphanumeric combinations, and even\n// null, undefined, and Infinity\nfunction compareAlphanumeric(aStr, bStr) {\n // Split on number groups, but keep the delimiter\n // Then remove falsey split values\n const a = aStr.split(reSplitAlphaNumeric).filter(Boolean);\n const b = bStr.split(reSplitAlphaNumeric).filter(Boolean);\n\n // While\n while (a.length && b.length) {\n const aa = a.shift();\n const bb = b.shift();\n const an = parseInt(aa, 10);\n const bn = parseInt(bb, 10);\n const combo = [an, bn].sort();\n\n // Both are string\n if (isNaN(combo[0])) {\n if (aa > bb) {\n return 1;\n }\n if (bb > aa) {\n return -1;\n }\n continue;\n }\n\n // One is a string, one is a number\n if (isNaN(combo[1])) {\n return isNaN(an) ? -1 : 1;\n }\n\n // Both are numbers\n if (an > bn) {\n return 1;\n }\n if (bn > an) {\n return -1;\n }\n }\n return a.length - b.length;\n}\n\n// Exports\n\nconst sortingFns = {\n alphanumeric,\n alphanumericCaseSensitive,\n text,\n textCaseSensitive,\n datetime,\n basic\n};\n\n//\n\nconst RowSorting = {\n getInitialState: state => {\n return {\n sorting: [],\n ...state\n };\n },\n getDefaultColumnDef: () => {\n return {\n sortingFn: 'auto',\n sortUndefined: 1\n };\n },\n getDefaultOptions: table => {\n return {\n onSortingChange: makeStateUpdater('sorting', table),\n isMultiSortEvent: e => {\n return e.shiftKey;\n }\n };\n },\n createColumn: (column, table) => {\n column.getAutoSortingFn = () => {\n const firstRows = table.getFilteredRowModel().flatRows.slice(10);\n let isString = false;\n for (const row of firstRows) {\n const value = row == null ? void 0 : row.getValue(column.id);\n if (Object.prototype.toString.call(value) === '[object Date]') {\n return sortingFns.datetime;\n }\n if (typeof value === 'string') {\n isString = true;\n if (value.split(reSplitAlphaNumeric).length > 1) {\n return sortingFns.alphanumeric;\n }\n }\n }\n if (isString) {\n return sortingFns.text;\n }\n return sortingFns.basic;\n };\n column.getAutoSortDir = () => {\n const firstRow = table.getFilteredRowModel().flatRows[0];\n const value = firstRow == null ? void 0 : firstRow.getValue(column.id);\n if (typeof value === 'string') {\n return 'asc';\n }\n return 'desc';\n };\n column.getSortingFn = () => {\n var _table$options$sortin, _table$options$sortin2;\n if (!column) {\n throw new Error();\n }\n 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];\n };\n column.toggleSorting = (desc, multi) => {\n // if (column.columns.length) {\n // column.columns.forEach((c, i) => {\n // if (c.id) {\n // table.toggleColumnSorting(c.id, undefined, multi || !!i)\n // }\n // })\n // return\n // }\n\n // this needs to be outside of table.setSorting to be in sync with rerender\n const nextSortingOrder = column.getNextSortingOrder();\n const hasManualValue = typeof desc !== 'undefined' && desc !== null;\n table.setSorting(old => {\n // Find any existing sorting for this column\n const existingSorting = old == null ? void 0 : old.find(d => d.id === column.id);\n const existingIndex = old == null ? void 0 : old.findIndex(d => d.id === column.id);\n let newSorting = [];\n\n // What should we do with this sort action?\n let sortAction;\n let nextDesc = hasManualValue ? desc : nextSortingOrder === 'desc';\n\n // Multi-mode\n if (old != null && old.length && column.getCanMultiSort() && multi) {\n if (existingSorting) {\n sortAction = 'toggle';\n } else {\n sortAction = 'add';\n }\n } else {\n // Normal mode\n if (old != null && old.length && existingIndex !== old.length - 1) {\n sortAction = 'replace';\n } else if (existingSorting) {\n sortAction = 'toggle';\n } else {\n sortAction = 'replace';\n }\n }\n\n // Handle toggle states that will remove the sorting\n if (sortAction === 'toggle') {\n // If we are \"actually\" toggling (not a manual set value), should we remove the sorting?\n if (!hasManualValue) {\n // Is our intention to remove?\n if (!nextSortingOrder) {\n sortAction = 'remove';\n }\n }\n }\n if (sortAction === 'add') {\n var _table$options$maxMul;\n newSorting = [...old, {\n id: column.id,\n desc: nextDesc\n }];\n // Take latest n columns\n newSorting.splice(0, newSorting.length - ((_table$options$maxMul = table.options.maxMultiSortColCount) != null ? _table$options$maxMul : Number.MAX_SAFE_INTEGER));\n } else if (sortAction === 'toggle') {\n // This flips (or sets) the\n newSorting = old.map(d => {\n if (d.id === column.id) {\n return {\n ...d,\n desc: nextDesc\n };\n }\n return d;\n });\n } else if (sortAction === 'remove') {\n newSorting = old.filter(d => d.id !== column.id);\n } else {\n newSorting = [{\n id: column.id,\n desc: nextDesc\n }];\n }\n return newSorting;\n });\n };\n column.getFirstSortDir = () => {\n var _ref, _column$columnDef$sor;\n const sortDescFirst = (_ref = (_column$columnDef$sor = column.columnDef.sortDescFirst) != null ? _column$columnDef$sor : table.options.sortDescFirst) != null ? _ref : column.getAutoSortDir() === 'desc';\n return sortDescFirst ? 'desc' : 'asc';\n };\n column.getNextSortingOrder = multi => {\n var _table$options$enable, _table$options$enable2;\n const firstSortDirection = column.getFirstSortDir();\n const isSorted = column.getIsSorted();\n if (!isSorted) {\n return firstSortDirection;\n }\n if (isSorted !== firstSortDirection && ((_table$options$enable = table.options.enableSortingRemoval) != null ? _table$options$enable : true) && (\n // If enableSortRemove, enable in general\n multi ? (_table$options$enable2 = table.options.enableMultiRemove) != null ? _table$options$enable2 : true : true) // If multi, don't allow if enableMultiRemove))\n ) {\n return false;\n }\n return isSorted === 'desc' ? 'asc' : 'desc';\n };\n column.getCanSort = () => {\n var _column$columnDef$ena, _table$options$enable3;\n return ((_column$columnDef$ena = column.columnDef.enableSorting) != null ? _column$columnDef$ena : true) && ((_table$options$enable3 = table.options.enableSorting) != null ? _table$options$enable3 : true) && !!column.accessorFn;\n };\n column.getCanMultiSort = () => {\n var _ref2, _column$columnDef$ena2;\n return (_ref2 = (_column$columnDef$ena2 = column.columnDef.enableMultiSort) != null ? _column$columnDef$ena2 : table.options.enableMultiSort) != null ? _ref2 : !!column.accessorFn;\n };\n column.getIsSorted = () => {\n var _table$getState$sorti;\n const columnSort = (_table$getState$sorti = table.getState().sorting) == null ? void 0 : _table$getState$sorti.find(d => d.id === column.id);\n return !columnSort ? false : columnSort.desc ? 'desc' : 'asc';\n };\n column.getSortIndex = () => {\n var _table$getState$sorti2, _table$getState$sorti3;\n 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;\n };\n column.clearSorting = () => {\n //clear sorting for just 1 column\n table.setSorting(old => old != null && old.length ? old.filter(d => d.id !== column.id) : []);\n };\n column.getToggleSortingHandler = () => {\n const canSort = column.getCanSort();\n return e => {\n if (!canSort) return;\n e.persist == null || e.persist();\n column.toggleSorting == null || column.toggleSorting(undefined, column.getCanMultiSort() ? table.options.isMultiSortEvent == null ? void 0 : table.options.isMultiSortEvent(e) : false);\n };\n };\n },\n createTable: table => {\n table.setSorting = updater => table.options.onSortingChange == null ? void 0 : table.options.onSortingChange(updater);\n table.resetSorting = defaultState => {\n var _table$initialState$s, _table$initialState;\n table.setSorting(defaultState ? [] : (_table$initialState$s = (_table$initialState = table.initialState) == null ? void 0 : _table$initialState.sorting) != null ? _table$initialState$s : []);\n };\n table.getPreSortedRowModel = () => table.getGroupedRowModel();\n table.getSortedRowModel = () => {\n if (!table._getSortedRowModel && table.options.getSortedRowModel) {\n table._getSortedRowModel = table.options.getSortedRowModel(table);\n }\n if (table.options.manualSorting || !table._getSortedRowModel) {\n return table.getPreSortedRowModel();\n }\n return table._getSortedRowModel();\n };\n }\n};\n\nconst builtInFeatures = [Headers, ColumnVisibility, ColumnOrdering, ColumnPinning, ColumnFaceting, ColumnFiltering, GlobalFaceting,\n//depends on ColumnFaceting\nGlobalFiltering,\n//depends on ColumnFiltering\nRowSorting, ColumnGrouping,\n//depends on RowSorting\nRowExpanding, RowPagination, RowPinning, RowSelection, ColumnSizing];\n\n//\n\nfunction createTable(options) {\n var _options$_features, _options$initialState;\n if (process.env.NODE_ENV !== 'production' && (options.debugAll || options.debugTable)) {\n console.info('Creating Table Instance...');\n }\n const _features = [...builtInFeatures, ...((_options$_features = options._features) != null ? _options$_features : [])];\n let table = {\n _features\n };\n const defaultOptions = table._features.reduce((obj, feature) => {\n return Object.assign(obj, feature.getDefaultOptions == null ? void 0 : feature.getDefaultOptions(table));\n }, {});\n const mergeOptions = options => {\n if (table.options.mergeOptions) {\n return table.options.mergeOptions(defaultOptions, options);\n }\n return {\n ...defaultOptions,\n ...options\n };\n };\n const coreInitialState = {};\n let initialState = {\n ...coreInitialState,\n ...((_options$initialState = options.initialState) != null ? _options$initialState : {})\n };\n table._features.forEach(feature => {\n var _feature$getInitialSt;\n initialState = (_feature$getInitialSt = feature.getInitialState == null ? void 0 : feature.getInitialState(initialState)) != null ? _feature$getInitialSt : initialState;\n });\n const queued = [];\n let queuedTimeout = false;\n const coreInstance = {\n _features,\n options: {\n ...defaultOptions,\n ...options\n },\n initialState,\n _queue: cb => {\n queued.push(cb);\n if (!queuedTimeout) {\n queuedTimeout = true;\n\n // Schedule a microtask to run the queued callbacks after\n // the current call stack (render, etc) has finished.\n Promise.resolve().then(() => {\n while (queued.length) {\n queued.shift()();\n }\n queuedTimeout = false;\n }).catch(error => setTimeout(() => {\n throw error;\n }));\n }\n },\n reset: () => {\n table.setState(table.initialState);\n },\n setOptions: updater => {\n const newOptions = functionalUpdate(updater, table.options);\n table.options = mergeOptions(newOptions);\n },\n getState: () => {\n return table.options.state;\n },\n setState: updater => {\n table.options.onStateChange == null || table.options.onStateChange(updater);\n },\n _getRowId: (row, index, parent) => {\n var _table$options$getRow;\n 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}`;\n },\n getCoreRowModel: () => {\n if (!table._getCoreRowModel) {\n table._getCoreRowModel = table.options.getCoreRowModel(table);\n }\n return table._getCoreRowModel();\n },\n // The final calls start at the bottom of the model,\n // expanded rows, which then work their way up\n\n getRowModel: () => {\n return table.getPaginationRowModel();\n },\n //in next version, we should just pass in the row model as the optional 2nd arg\n getRow: (id, searchAll) => {\n let row = (searchAll ? table.getPrePaginationRowModel() : table.getRowModel()).rowsById[id];\n if (!row) {\n row = table.getCoreRowModel().rowsById[id];\n if (!row) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(`getRow could not find row with ID: ${id}`);\n }\n throw new Error();\n }\n }\n return row;\n },\n _getDefaultColumnDef: memo(() => [table.options.defaultColumn], defaultColumn => {\n var _defaultColumn;\n defaultColumn = (_defaultColumn = defaultColumn) != null ? _defaultColumn : {};\n return {\n header: props => {\n const resolvedColumnDef = props.header.column.columnDef;\n if (resolvedColumnDef.accessorKey) {\n return resolvedColumnDef.accessorKey;\n }\n if (resolvedColumnDef.accessorFn) {\n return resolvedColumnDef.id;\n }\n return null;\n },\n // footer: props => props.header.column.id,\n cell: props => {\n var _props$renderValue$to, _props$renderValue;\n return (_props$renderValue$to = (_props$renderValue = props.renderValue()) == null || _props$renderValue.toString == null ? void 0 : _props$renderValue.toString()) != null ? _props$renderValue$to : null;\n },\n ...table._features.reduce((obj, feature) => {\n return Object.assign(obj, feature.getDefaultColumnDef == null ? void 0 : feature.getDefaultColumnDef());\n }, {}),\n ...defaultColumn\n };\n }, getMemoOptions(options, 'debugColumns', '_getDefaultColumnDef')),\n _getColumnDefs: () => table.options.columns,\n getAllColumns: memo(() => [table._getColumnDefs()], columnDefs => {\n const recurseColumns = function (columnDefs, parent, depth) {\n if (depth === void 0) {\n depth = 0;\n }\n return columnDefs.map(columnDef => {\n const column = createColumn(table, columnDef, depth, parent);\n const groupingColumnDef = columnDef;\n column.columns = groupingColumnDef.columns ? recurseColumns(groupingColumnDef.columns, column, depth + 1) : [];\n return column;\n });\n };\n return recurseColumns(columnDefs);\n }, getMemoOptions(options, 'debugColumns', 'getAllColumns')),\n getAllFlatColumns: memo(() => [table.getAllColumns()], allColumns => {\n return allColumns.flatMap(column => {\n return column.getFlatColumns();\n });\n }, getMemoOptions(options, 'debugColumns', 'getAllFlatColumns')),\n _getAllFlatColumnsById: memo(() => [table.getAllFlatColumns()], flatColumns => {\n return flatColumns.reduce((acc, column) => {\n acc[column.id] = column;\n return acc;\n }, {});\n }, getMemoOptions(options, 'debugColumns', 'getAllFlatColumnsById')),\n getAllLeafColumns: memo(() => [table.getAllColumns(), table._getOrderColumnsFn()], (allColumns, orderColumns) => {\n let leafColumns = allColumns.flatMap(column => column.getLeafColumns());\n return orderColumns(leafColumns);\n }, getMemoOptions(options, 'debugColumns', 'getAllLeafColumns')),\n getColumn: columnId => {\n const column = table._getAllFlatColumnsById()[columnId];\n if (process.env.NODE_ENV !== 'production' && !column) {\n console.error(`[Table] Column with id '${columnId}' does not exist.`);\n }\n return column;\n }\n };\n Object.assign(table, coreInstance);\n for (let index = 0; index < table._features.length; index++) {\n const feature = table._features[index];\n feature == null || feature.createTable == null || feature.createTable(table);\n }\n return table;\n}\n\nfunction getCoreRowModel() {\n return table => memo(() => [table.options.data], data => {\n const rowModel = {\n rows: [],\n flatRows: [],\n rowsById: {}\n };\n const accessRows = function (originalRows, depth, parentRow) {\n if (depth === void 0) {\n depth = 0;\n }\n const rows = [];\n for (let i = 0; i < originalRows.length; i++) {\n // This could be an expensive check at scale, so we should move it somewhere else, but where?\n // if (!id) {\n // if (process.env.NODE_ENV !== 'production') {\n // throw new Error(`getRowId expected an ID, but got ${id}`)\n // }\n // }\n\n // Make the row\n const row = createRow(table, table._getRowId(originalRows[i], i, parentRow), originalRows[i], i, depth, undefined, parentRow == null ? void 0 : parentRow.id);\n\n // Keep track of every row in a flat array\n rowModel.flatRows.push(row);\n // Also keep track of every row by its ID\n rowModel.rowsById[row.id] = row;\n // Push table row into parent\n rows.push(row);\n\n // Get the original subrows\n if (table.options.getSubRows) {\n var _row$originalSubRows;\n row.originalSubRows = table.options.getSubRows(originalRows[i], i);\n\n // Then recursively access them\n if ((_row$originalSubRows = row.originalSubRows) != null && _row$originalSubRows.length) {\n row.subRows = accessRows(row.originalSubRows, depth + 1, row);\n }\n }\n }\n return rows;\n };\n rowModel.rows = accessRows(data);\n return rowModel;\n }, getMemoOptions(table.options, 'debugTable', 'getRowModel', () => table._autoResetPageIndex()));\n}\n\nfunction getExpandedRowModel() {\n return table => memo(() => [table.getState().expanded, table.getPreExpandedRowModel(), table.options.paginateExpandedRows], (expanded, rowModel, paginateExpandedRows) => {\n if (!rowModel.rows.length || expanded !== true && !Object.keys(expanded != null ? expanded : {}).length) {\n return rowModel;\n }\n if (!paginateExpandedRows) {\n // Only expand rows at this point if they are being paginated\n return rowModel;\n }\n return expandRows(rowModel);\n }, getMemoOptions(table.options, 'debugTable', 'getExpandedRowModel'));\n}\nfunction expandRows(rowModel) {\n const expandedRows = [];\n const handleRow = row => {\n var _row$subRows;\n expandedRows.push(row);\n if ((_row$subRows = row.subRows) != null && _row$subRows.length && row.getIsExpanded()) {\n row.subRows.forEach(handleRow);\n }\n };\n rowModel.rows.forEach(handleRow);\n return {\n rows: expandedRows,\n flatRows: rowModel.flatRows,\n rowsById: rowModel.rowsById\n };\n}\n\nfunction getFacetedMinMaxValues() {\n return (table, columnId) => memo(() => {\n var _table$getColumn;\n return [(_table$getColumn = table.getColumn(columnId)) == null ? void 0 : _table$getColumn.getFacetedRowModel()];\n }, facetedRowModel => {\n if (!facetedRowModel) return undefined;\n const uniqueValues = facetedRowModel.flatRows.flatMap(flatRow => {\n var _flatRow$getUniqueVal;\n return (_flatRow$getUniqueVal = flatRow.getUniqueValues(columnId)) != null ? _flatRow$getUniqueVal : [];\n }).map(Number).filter(value => !Number.isNaN(value));\n if (!uniqueValues.length) return;\n let facetedMinValue = uniqueValues[0];\n let facetedMaxValue = uniqueValues[uniqueValues.length - 1];\n for (const value of uniqueValues) {\n if (value < facetedMinValue) facetedMinValue = value;else if (value > facetedMaxValue) facetedMaxValue = value;\n }\n return [facetedMinValue, facetedMaxValue];\n }, getMemoOptions(table.options, 'debugTable', 'getFacetedMinMaxValues'));\n}\n\nfunction filterRows(rows, filterRowImpl, table) {\n if (table.options.filterFromLeafRows) {\n return filterRowModelFromLeafs(rows, filterRowImpl, table);\n }\n return filterRowModelFromRoot(rows, filterRowImpl, table);\n}\nfunction filterRowModelFromLeafs(rowsToFilter, filterRow, table) {\n var _table$options$maxLea;\n const newFilteredFlatRows = [];\n const newFilteredRowsById = {};\n const maxDepth = (_table$options$maxLea = table.options.maxLeafRowFilterDepth) != null ? _table$options$maxLea : 100;\n const recurseFilterRows = function (rowsToFilter, depth) {\n if (depth === void 0) {\n depth = 0;\n }\n const rows = [];\n\n // Filter from children up first\n for (let i = 0; i < rowsToFilter.length; i++) {\n var _row$subRows;\n let row = rowsToFilter[i];\n const newRow = createRow(table, row.id, row.original, row.index, row.depth, undefined, row.parentId);\n newRow.columnFilters = row.columnFilters;\n if ((_row$subRows = row.subRows) != null && _row$subRows.length && depth < maxDepth) {\n newRow.subRows = recurseFilterRows(row.subRows, depth + 1);\n row = newRow;\n if (filterRow(row) && !newRow.subRows.length) {\n rows.push(row);\n newFilteredRowsById[row.id] = row;\n newFilteredFlatRows.push(row);\n continue;\n }\n if (filterRow(row) || newRow.subRows.length) {\n rows.push(row);\n newFilteredRowsById[row.id] = row;\n newFilteredFlatRows.push(row);\n continue;\n }\n } else {\n row = newRow;\n if (filterRow(row)) {\n rows.push(row);\n newFilteredRowsById[row.id] = row;\n newFilteredFlatRows.push(row);\n }\n }\n }\n return rows;\n };\n return {\n rows: recurseFilterRows(rowsToFilter),\n flatRows: newFilteredFlatRows,\n rowsById: newFilteredRowsById\n };\n}\nfunction filterRowModelFromRoot(rowsToFilter, filterRow, table) {\n var _table$options$maxLea2;\n const newFilteredFlatRows = [];\n const newFilteredRowsById = {};\n const maxDepth = (_table$options$maxLea2 = table.options.maxLeafRowFilterDepth) != null ? _table$options$maxLea2 : 100;\n\n // Filters top level and nested rows\n const recurseFilterRows = function (rowsToFilter, depth) {\n if (depth === void 0) {\n depth = 0;\n }\n // Filter from parents downward first\n\n const rows = [];\n\n // Apply the filter to any subRows\n for (let i = 0; i < rowsToFilter.length; i++) {\n let row = rowsToFilter[i];\n const pass = filterRow(row);\n if (pass) {\n var _row$subRows2;\n if ((_row$subRows2 = row.subRows) != null && _row$subRows2.length && depth < maxDepth) {\n const newRow = createRow(table, row.id, row.original, row.index, row.depth, undefined, row.parentId);\n newRow.subRows = recurseFilterRows(row.subRows, depth + 1);\n row = newRow;\n }\n rows.push(row);\n newFilteredFlatRows.push(row);\n newFilteredRowsById[row.id] = row;\n }\n }\n return rows;\n };\n return {\n rows: recurseFilterRows(rowsToFilter),\n flatRows: newFilteredFlatRows,\n rowsById: newFilteredRowsById\n };\n}\n\nfunction getFacetedRowModel() {\n return (table, columnId) => memo(() => [table.getPreFilteredRowModel(), table.getState().columnFilters, table.getState().globalFilter, table.getFilteredRowModel()], (preRowModel, columnFilters, globalFilter) => {\n if (!preRowModel.rows.length || !(columnFilters != null && columnFilters.length) && !globalFilter) {\n return preRowModel;\n }\n const filterableIds = [...columnFilters.map(d => d.id).filter(d => d !== columnId), globalFilter ? '__global__' : undefined].filter(Boolean);\n const filterRowsImpl = row => {\n // Horizontally filter rows through each column\n for (let i = 0; i < filterableIds.length; i++) {\n if (row.columnFilters[filterableIds[i]] === false) {\n return false;\n }\n }\n return true;\n };\n return filterRows(preRowModel.rows, filterRowsImpl, table);\n }, getMemoOptions(table.options, 'debugTable', 'getFacetedRowModel'));\n}\n\nfunction getFacetedUniqueValues() {\n return (table, columnId) => memo(() => {\n var _table$getColumn;\n return [(_table$getColumn = table.getColumn(columnId)) == null ? void 0 : _table$getColumn.getFacetedRowModel()];\n }, facetedRowModel => {\n if (!facetedRowModel) return new Map();\n let facetedUniqueValues = new Map();\n for (let i = 0; i < facetedRowModel.flatRows.length; i++) {\n const values = facetedRowModel.flatRows[i].getUniqueValues(columnId);\n for (let j = 0; j < values.length; j++) {\n const value = values[j];\n if (facetedUniqueValues.has(value)) {\n var _facetedUniqueValues$;\n facetedUniqueValues.set(value, ((_facetedUniqueValues$ = facetedUniqueValues.get(value)) != null ? _facetedUniqueValues$ : 0) + 1);\n } else {\n facetedUniqueValues.set(value, 1);\n }\n }\n }\n return facetedUniqueValues;\n }, getMemoOptions(table.options, 'debugTable', `getFacetedUniqueValues_${columnId}`));\n}\n\nfunction getFilteredRowModel() {\n return table => memo(() => [table.getPreFilteredRowModel(), table.getState().columnFilters, table.getState().globalFilter], (rowModel, columnFilters, globalFilter) => {\n if (!rowModel.rows.length || !(columnFilters != null && columnFilters.length) && !globalFilter) {\n for (let i = 0; i < rowModel.flatRows.length; i++) {\n rowModel.flatRows[i].columnFilters = {};\n rowModel.flatRows[i].columnFiltersMeta = {};\n }\n return rowModel;\n }\n const resolvedColumnFilters = [];\n const resolvedGlobalFilters = [];\n (columnFilters != null ? columnFilters : []).forEach(d => {\n var _filterFn$resolveFilt;\n const column = table.getColumn(d.id);\n if (!column) {\n return;\n }\n const filterFn = column.getFilterFn();\n if (!filterFn) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(`Could not find a valid 'column.filterFn' for column with the ID: ${column.id}.`);\n }\n return;\n }\n resolvedColumnFilters.push({\n id: d.id,\n filterFn,\n resolvedValue: (_filterFn$resolveFilt = filterFn.resolveFilterValue == null ? void 0 : filterFn.resolveFilterValue(d.value)) != null ? _filterFn$resolveFilt : d.value\n });\n });\n const filterableIds = (columnFilters != null ? columnFilters : []).map(d => d.id);\n const globalFilterFn = table.getGlobalFilterFn();\n const globallyFilterableColumns = table.getAllLeafColumns().filter(column => column.getCanGlobalFilter());\n if (globalFilter && globalFilterFn && globallyFilterableColumns.length) {\n filterableIds.push('__global__');\n globallyFilterableColumns.forEach(column => {\n var _globalFilterFn$resol;\n resolvedGlobalFilters.push({\n id: column.id,\n filterFn: globalFilterFn,\n resolvedValue: (_globalFilterFn$resol = globalFilterFn.resolveFilterValue == null ? void 0 : globalFilterFn.resolveFilterValue(globalFilter)) != null ? _globalFilterFn$resol : globalFilter\n });\n });\n }\n let currentColumnFilter;\n let currentGlobalFilter;\n\n // Flag the prefiltered row model with each filter state\n for (let j = 0; j < rowModel.flatRows.length; j++) {\n const row = rowModel.flatRows[j];\n row.columnFilters = {};\n if (resolvedColumnFilters.length) {\n for (let i = 0; i < resolvedColumnFilters.length; i++) {\n currentColumnFilter = resolvedColumnFilters[i];\n const id = currentColumnFilter.id;\n\n // Tag the row with the column filter state\n row.columnFilters[id] = currentColumnFilter.filterFn(row, id, currentColumnFilter.resolvedValue, filterMeta => {\n row.columnFiltersMeta[id] = filterMeta;\n });\n }\n }\n if (resolvedGlobalFilters.length) {\n for (let i = 0; i < resolvedGlobalFilters.length; i++) {\n currentGlobalFilter = resolvedGlobalFilters[i];\n const id = currentGlobalFilter.id;\n // Tag the row with the first truthy global filter state\n if (currentGlobalFilter.filterFn(row, id, currentGlobalFilter.resolvedValue, filterMeta => {\n row.columnFiltersMeta[id] = filterMeta;\n })) {\n row.columnFilters.__global__ = true;\n break;\n }\n }\n if (row.columnFilters.__global__ !== true) {\n row.columnFilters.__global__ = false;\n }\n }\n }\n const filterRowsImpl = row => {\n // Horizontally filter rows through each column\n for (let i = 0; i < filterableIds.length; i++) {\n if (row.columnFilters[filterableIds[i]] === false) {\n return false;\n }\n }\n return true;\n };\n\n // Filter final rows using all of the active filters\n return filterRows(rowModel.rows, filterRowsImpl, table);\n }, getMemoOptions(table.options, 'debugTable', 'getFilteredRowModel', () => table._autoResetPageIndex()));\n}\n\nfunction getGroupedRowModel() {\n return table => memo(() => [table.getState().grouping, table.getPreGroupedRowModel()], (grouping, rowModel) => {\n if (!rowModel.rows.length || !grouping.length) {\n rowModel.rows.forEach(row => {\n row.depth = 0;\n row.parentId = undefined;\n });\n return rowModel;\n }\n\n // Filter the grouping list down to columns that exist\n const existingGrouping = grouping.filter(columnId => table.getColumn(columnId));\n const groupedFlatRows = [];\n const groupedRowsById = {};\n // const onlyGroupedFlatRows: Row[] = [];\n // const onlyGroupedRowsById: Record = {};\n // const nonGroupedFlatRows: Row[] = [];\n // const nonGroupedRowsById: Record = {};\n\n // Recursively group the data\n const groupUpRecursively = function (rows, depth, parentId) {\n if (depth === void 0) {\n depth = 0;\n }\n // Grouping depth has been been met\n // Stop grouping and simply rewrite thd depth and row relationships\n if (depth >= existingGrouping.length) {\n return rows.map(row => {\n row.depth = depth;\n groupedFlatRows.push(row);\n groupedRowsById[row.id] = row;\n if (row.subRows) {\n row.subRows = groupUpRecursively(row.subRows, depth + 1, row.id);\n }\n return row;\n });\n }\n const columnId = existingGrouping[depth];\n\n // Group the rows together for this level\n const rowGroupsMap = groupBy(rows, columnId);\n\n // Perform aggregations for each group\n const aggregatedGroupedRows = Array.from(rowGroupsMap.entries()).map((_ref, index) => {\n let [groupingValue, groupedRows] = _ref;\n let id = `${columnId}:${groupingValue}`;\n id = parentId ? `${parentId}>${id}` : id;\n\n // First, Recurse to group sub rows before aggregation\n const subRows = groupUpRecursively(groupedRows, depth + 1, id);\n subRows.forEach(subRow => {\n subRow.parentId = id;\n });\n\n // Flatten the leaf rows of the rows in this group\n const leafRows = depth ? flattenBy(groupedRows, row => row.subRows) : groupedRows;\n const row = createRow(table, id, leafRows[0].original, index, depth, undefined, parentId);\n Object.assign(row, {\n groupingColumnId: columnId,\n groupingValue,\n subRows,\n leafRows,\n getValue: columnId => {\n // Don't aggregate columns that are in the grouping\n if (existingGrouping.includes(columnId)) {\n if (row._valuesCache.hasOwnProperty(columnId)) {\n return row._valuesCache[columnId];\n }\n if (groupedRows[0]) {\n var _groupedRows$0$getVal;\n row._valuesCache[columnId] = (_groupedRows$0$getVal = groupedRows[0].getValue(columnId)) != null ? _groupedRows$0$getVal : undefined;\n }\n return row._valuesCache[columnId];\n }\n if (row._groupingValuesCache.hasOwnProperty(columnId)) {\n return row._groupingValuesCache[columnId];\n }\n\n // Aggregate the values\n const column = table.getColumn(columnId);\n const aggregateFn = column == null ? void 0 : column.getAggregationFn();\n if (aggregateFn) {\n row._groupingValuesCache[columnId] = aggregateFn(columnId, leafRows, groupedRows);\n return row._groupingValuesCache[columnId];\n }\n }\n });\n subRows.forEach(subRow => {\n groupedFlatRows.push(subRow);\n groupedRowsById[subRow.id] = subRow;\n // if (subRow.getIsGrouped?.()) {\n // onlyGroupedFlatRows.push(subRow);\n // onlyGroupedRowsById[subRow.id] = subRow;\n // } else {\n // nonGroupedFlatRows.push(subRow);\n // nonGroupedRowsById[subRow.id] = subRow;\n // }\n });\n return row;\n });\n return aggregatedGroupedRows;\n };\n const groupedRows = groupUpRecursively(rowModel.rows, 0);\n groupedRows.forEach(subRow => {\n groupedFlatRows.push(subRow);\n groupedRowsById[subRow.id] = subRow;\n // if (subRow.getIsGrouped?.()) {\n // onlyGroupedFlatRows.push(subRow);\n // onlyGroupedRowsById[subRow.id] = subRow;\n // } else {\n // nonGroupedFlatRows.push(subRow);\n // nonGroupedRowsById[subRow.id] = subRow;\n // }\n });\n return {\n rows: groupedRows,\n flatRows: groupedFlatRows,\n rowsById: groupedRowsById\n };\n }, getMemoOptions(table.options, 'debugTable', 'getGroupedRowModel', () => {\n table._queue(() => {\n table._autoResetExpanded();\n table._autoResetPageIndex();\n });\n }));\n}\nfunction groupBy(rows, columnId) {\n const groupMap = new Map();\n return rows.reduce((map, row) => {\n const resKey = `${row.getGroupingValue(columnId)}`;\n const previous = map.get(resKey);\n if (!previous) {\n map.set(resKey, [row]);\n } else {\n previous.push(row);\n }\n return map;\n }, groupMap);\n}\n\nfunction getPaginationRowModel(opts) {\n return table => memo(() => [table.getState().pagination, table.getPrePaginationRowModel(), table.options.paginateExpandedRows ? undefined : table.getState().expanded], (pagination, rowModel) => {\n if (!rowModel.rows.length) {\n return rowModel;\n }\n const {\n pageSize,\n pageIndex\n } = pagination;\n let {\n rows,\n flatRows,\n rowsById\n } = rowModel;\n const pageStart = pageSize * pageIndex;\n const pageEnd = pageStart + pageSize;\n rows = rows.slice(pageStart, pageEnd);\n let paginatedRowModel;\n if (!table.options.paginateExpandedRows) {\n paginatedRowModel = expandRows({\n rows,\n flatRows,\n rowsById\n });\n } else {\n paginatedRowModel = {\n rows,\n flatRows,\n rowsById\n };\n }\n paginatedRowModel.flatRows = [];\n const handleRow = row => {\n paginatedRowModel.flatRows.push(row);\n if (row.subRows.length) {\n row.subRows.forEach(handleRow);\n }\n };\n paginatedRowModel.rows.forEach(handleRow);\n return paginatedRowModel;\n }, getMemoOptions(table.options, 'debugTable', 'getPaginationRowModel'));\n}\n\nfunction getSortedRowModel() {\n return table => memo(() => [table.getState().sorting, table.getPreSortedRowModel()], (sorting, rowModel) => {\n if (!rowModel.rows.length || !(sorting != null && sorting.length)) {\n return rowModel;\n }\n const sortingState = table.getState().sorting;\n const sortedFlatRows = [];\n\n // Filter out sortings that correspond to non existing columns\n const availableSorting = sortingState.filter(sort => {\n var _table$getColumn;\n return (_table$getColumn = table.getColumn(sort.id)) == null ? void 0 : _table$getColumn.getCanSort();\n });\n const columnInfoById = {};\n availableSorting.forEach(sortEntry => {\n const column = table.getColumn(sortEntry.id);\n if (!column) return;\n columnInfoById[sortEntry.id] = {\n sortUndefined: column.columnDef.sortUndefined,\n invertSorting: column.columnDef.invertSorting,\n sortingFn: column.getSortingFn()\n };\n });\n const sortData = rows => {\n // This will also perform a stable sorting using the row index\n // if needed.\n const sortedData = rows.map(row => ({\n ...row\n }));\n sortedData.sort((rowA, rowB) => {\n for (let i = 0; i < availableSorting.length; i += 1) {\n var _sortEntry$desc;\n const sortEntry = availableSorting[i];\n const columnInfo = columnInfoById[sortEntry.id];\n const sortUndefined = columnInfo.sortUndefined;\n const isDesc = (_sortEntry$desc = sortEntry == null ? void 0 : sortEntry.desc) != null ? _sortEntry$desc : false;\n let sortInt = 0;\n\n // All sorting ints should always return in ascending order\n if (sortUndefined) {\n const aValue = rowA.getValue(sortEntry.id);\n const bValue = rowB.getValue(sortEntry.id);\n const aUndefined = aValue === undefined;\n const bUndefined = bValue === undefined;\n if (aUndefined || bUndefined) {\n if (sortUndefined === 'first') return aUndefined ? -1 : 1;\n if (sortUndefined === 'last') return aUndefined ? 1 : -1;\n sortInt = aUndefined && bUndefined ? 0 : aUndefined ? sortUndefined : -sortUndefined;\n }\n }\n if (sortInt === 0) {\n sortInt = columnInfo.sortingFn(rowA, rowB, sortEntry.id);\n }\n\n // If sorting is non-zero, take care of desc and inversion\n if (sortInt !== 0) {\n if (isDesc) {\n sortInt *= -1;\n }\n if (columnInfo.invertSorting) {\n sortInt *= -1;\n }\n return sortInt;\n }\n }\n return rowA.index - rowB.index;\n });\n\n // If there are sub-rows, sort them\n sortedData.forEach(row => {\n var _row$subRows;\n sortedFlatRows.push(row);\n if ((_row$subRows = row.subRows) != null && _row$subRows.length) {\n row.subRows = sortData(row.subRows);\n }\n });\n return sortedData;\n };\n return {\n rows: sortData(rowModel.rows),\n flatRows: sortedFlatRows,\n rowsById: rowModel.rowsById\n };\n }, getMemoOptions(table.options, 'debugTable', 'getSortedRowModel', () => table._autoResetPageIndex()));\n}\n\nexport { ColumnFaceting, ColumnFiltering, ColumnGrouping, ColumnOrdering, ColumnPinning, ColumnSizing, ColumnVisibility, GlobalFaceting, GlobalFiltering, Headers, RowExpanding, RowPagination, RowPinning, RowSelection, RowSorting, _getVisibleLeafColumns, aggregationFns, buildHeaderGroups, createCell, createColumn, createColumnHelper, createRow, createTable, defaultColumnSizing, expandRows, filterFns, flattenBy, functionalUpdate, getCoreRowModel, getExpandedRowModel, getFacetedMinMaxValues, getFacetedRowModel, getFacetedUniqueValues, getFilteredRowModel, getGroupedRowModel, getMemoOptions, getPaginationRowModel, getSortedRowModel, isFunction, isNumberArray, isRowSelected, isSubRowSelected, makeStateUpdater, memo, noop, orderColumns, passiveEventSupported, reSplitAlphaNumeric, selectRowsFn, shouldAutoRemoveFilter, sortingFns };\n//# sourceMappingURL=index.mjs.map\n","/**\n * vue-table\n *\n * Copyright (c) TanStack\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE.md file in the root directory of this source tree.\n *\n * @license MIT\n */\nimport { createTable } from '@tanstack/table-core';\nexport * from '@tanstack/table-core';\nimport { defineComponent, h, isRef, shallowRef, watch, ref, watchEffect, unref } from 'vue';\n\nfunction trueFn() {\n return true;\n}\nconst $PROXY = Symbol('merge-proxy');\n\n// https://github.com/solidjs/solid/blob/c20ca4fd8c36bc0522fedb2c7f38a110b7ee2663/packages/solid/src/render/component.ts#L51-L118\nconst propTraps = {\n get(_, property, receiver) {\n if (property === $PROXY) return receiver;\n return _.get(property);\n },\n has(_, property) {\n return _.has(property);\n },\n set: trueFn,\n deleteProperty: trueFn,\n getOwnPropertyDescriptor(_, property) {\n return {\n configurable: true,\n enumerable: true,\n get() {\n return _.get(property);\n },\n set: trueFn,\n deleteProperty: trueFn\n };\n },\n ownKeys(_) {\n return _.keys();\n }\n};\nfunction resolveSource(s) {\n return 'value' in s ? s.value : s;\n}\nfunction mergeProxy() {\n for (var _len = arguments.length, sources = new Array(_len), _key = 0; _key < _len; _key++) {\n sources[_key] = arguments[_key];\n }\n return new Proxy({\n get(property) {\n for (let i = sources.length - 1; i >= 0; i--) {\n const v = resolveSource(sources[i])[property];\n if (v !== undefined) return v;\n }\n },\n has(property) {\n for (let i = sources.length - 1; i >= 0; i--) {\n if (property in resolveSource(sources[i])) return true;\n }\n return false;\n },\n keys() {\n const keys = [];\n for (let i = 0; i < sources.length; i++) keys.push(...Object.keys(resolveSource(sources[i])));\n return [...Array.from(new Set(keys))];\n }\n }, propTraps);\n}\n\nconst FlexRender = defineComponent({\n props: ['render', 'props'],\n setup: props => {\n return () => {\n if (typeof props.render === 'function' || typeof props.render === 'object') {\n return h(props.render, props.props);\n }\n return props.render;\n };\n }\n});\nfunction getOptionsWithReactiveData(options) {\n return mergeProxy(options, {\n data: unref(options.data)\n });\n}\nfunction useVueTable(initialOptions) {\n const IS_REACTIVE = isRef(initialOptions.data);\n const resolvedOptions = mergeProxy({\n state: {},\n // Dummy state\n onStateChange: () => {},\n // noop\n renderFallbackValue: null,\n mergeOptions(defaultOptions, options) {\n return IS_REACTIVE ? {\n ...defaultOptions,\n ...options\n } : mergeProxy(defaultOptions, options);\n }\n }, IS_REACTIVE ? getOptionsWithReactiveData(initialOptions) : initialOptions);\n const table = createTable(resolvedOptions);\n\n // Add reactivity support\n if (IS_REACTIVE) {\n const dataRef = shallowRef(initialOptions.data);\n watch(dataRef, () => {\n table.setState(prev => ({\n ...prev,\n data: dataRef.value\n }));\n }, {\n immediate: true\n });\n }\n\n // can't use `reactive` because update needs to be immutable\n const state = ref(table.initialState);\n watchEffect(() => {\n table.setOptions(prev => {\n var _initialOptions$state;\n const stateProxy = new Proxy({}, {\n get: (_, prop) => state.value[prop]\n });\n return mergeProxy(prev, IS_REACTIVE ? getOptionsWithReactiveData(initialOptions) : initialOptions, {\n // merge the initialState and `options.state`\n // create a new proxy on each `setOptions` call\n // and get the value from state on each property access\n state: mergeProxy(stateProxy, (_initialOptions$state = initialOptions.state) != null ? _initialOptions$state : {}),\n // Similarly, we'll maintain both our internal state and any user-provided\n // state.\n onStateChange: updater => {\n if (updater instanceof Function) {\n state.value = updater(state.value);\n } else {\n state.value = updater;\n }\n initialOptions.onStateChange == null || initialOptions.onStateChange(updater);\n }\n });\n });\n });\n return table;\n}\n\nexport { FlexRender, useVueTable };\n//# sourceMappingURL=index.mjs.map\n"],"names":["functionalUpdate","updater","input","makeStateUpdater","key","instance","old","isFunction","d","isNumberArray","val","flattenBy","arr","getChildren","flat","recurse","subArr","item","children","memo","getDeps","fn","opts","deps","result","depArgs","depTime","newDeps","dep","index","resultTime","depEndTime","resultEndTime","resultFpsPercentage","pad","str","num","getMemoOptions","tableOptions","debugLevel","onChange","_tableOptions$debugAl","createCell","table","row","column","columnId","getRenderValue","_cell$getValue","cell","feature","createColumn","columnDef","depth","parent","_ref","_resolvedColumnDef$id","resolvedColumnDef","accessorKey","id","accessorFn","originalRow","_result","_column$columns","orderColumns","_column$columns2","leafColumns","debug","createHeader","options","_options$id","header","leafHeaders","recurseHeader","h","Headers","allColumns","left","right","_left$map$filter","_right$map$filter","leftColumns","rightColumns","centerColumns","buildHeaderGroups","_left$map$filter2","orderedLeafColumns","_right$map$filter2","headerGroups","headerGroup","flatHeaders","_header$subHeaders","_header$subHeaders2","_header$subHeaders3","center","_left$0$headers","_left$","_center$0$headers","_center$","_right$0$headers","_right$","columnsToGroup","headerFamily","_headerGroups$0$heade","_headerGroups$","maxDepth","findMaxDepth","columns","createHeaderGroup","headersToGroup","pendingParentHeaders","headerToGroup","latestPendingParentHeader","isLeafHeader","isPlaceholder","bottomHeaders","recurseHeadersForSpans","headers","colSpan","rowSpan","childRowSpans","childColSpan","childRowSpan","minChildRowSpan","createRow","original","rowIndex","subRows","parentId","_row$getValue","parentRows","currentRow","parentRow","allCells","acc","i","ColumnFaceting","includesString","filterValue","_filterValue$toString","search","testFalsey","includesStringSensitive","_row$getValue2","equalsString","_row$getValue3","arrIncludes","_row$getValue4","arrIncludesAll","_row$getValue5","arrIncludesSome","_row$getValue6","equals","weakEquals","inNumberRange","min","max","rowValue","unsafeMin","unsafeMax","parsedMin","parsedMax","temp","filterFns","ColumnFiltering","state","firstRow","value","_table$options$filter","_table$options$filter2","_column$columnDef$ena","_table$options$enable","_table$options$enable2","_table$getState$colum","_table$getState$colum2","_table$getState$colum3","filterFn","previousFilter","newFilter","shouldAutoRemoveFilter","_old$filter","newFilterObj","_old$map","_table","updateFn","_functionalUpdate","filter","defaultState","_table$initialState$c","_table$initialState","sum","_leafRows","childRows","next","nextValue","extent","mean","leafRows","count","median","values","mid","nums","a","b","unique","uniqueCount","_columnId","aggregationFns","ColumnGrouping","props","_toString","_props$getValue","_table$getState$group","_table$getState$group2","canGroup","_table$options$aggreg","_table$options$aggreg2","_table$initialState$g","_row$subRows","grouping","groupedColumnMode","nonGroupingColumns","col","g","ColumnOrdering","position","_getVisibleLeafColumns","_columns$","_columns","columnOrder","orderedColumns","columnOrderCopy","columnsCopy","targetColumnId","foundIndex","getDefaultColumnPinningState","ColumnPinning","columnIds","_old$left3","_old$right3","_old$left","_old$right","_old$left2","_old$right2","_d$columnDef$enablePi","leafColumnIds","isLeft","isRight","leftAndRight","_pinningState$positio","pinningState","_pinningState$left","_pinningState$right","defaultColumnSizing","getDefaultColumnSizingInfoState","ColumnSizing","_column$columnDef$min","_column$columnDef$max","columnSize","_ref2","_","rest","_header$column$getSiz","prevSiblingHeader","_contextDocument","canResize","e","isTouchStartEvent","startSize","columnSizingStart","clientX","newColumnSizing","updateOffset","eventType","clientXPos","_old$startOffset","_old$startSize","deltaDirection","deltaOffset","deltaPercentage","_ref3","headerSize","onMove","onEnd","contextDocument","mouseEvents","touchEvents","_e$touches$","passiveIfSupported","passiveEventSupported","_table$initialState$c2","_table$getHeaderGroup","_table$getHeaderGroup2","_table$getLeftHeaderG","_table$getLeftHeaderG2","_table$getCenterHeade","_table$getCenterHeade2","_table$getRightHeader","_table$getRightHeader2","passiveSupported","supported","noop","ColumnVisibility","childColumns","c","cells","makeVisibleColumnsMethod","getColumns","_value","obj","_target","GlobalFaceting","GlobalFiltering","_table$getCoreRowMode","_table$options$getCol","globalFilterFn","RowExpanding","registered","queued","_table$options$autoRe","expanded","_table$initialState$e","splitId","_expanded","exists","oldExpanded","rowId","_table$options$getIsR","_table$options$getRow","isFullyExpanded","canExpand","defaultPageIndex","defaultPageSize","getDefaultPaginationState","RowPagination","safeUpdater","_table$initialState$p","pageIndex","maxPageIndex","_table$initialState$p2","_table$initialState$p3","_table$initialState2","pageSize","topRowIndex","_table$options$pageCo","newPageCount","pageCount","pageOptions","_table$options$pageCo2","_table$options$rowCou","getDefaultRowPinningState","RowPinning","includeLeafRows","includeParentRows","leafRowIds","parentRowIds","rowIds","_old$top3","_old$bottom3","_old$top","_old$bottom","_old$top2","_old$bottom2","enableRowPinning","enablePinning","top","bottom","isTop","isBottom","_ref4","_visiblePinnedRowIds$","visiblePinnedRowIds","_ref5","_table$initialState$r","_pinningState$top","_pinningState$bottom","visibleRows","pinnedRowIds","_table$options$keepPi","allRows","topPinnedRowIds","bottomPinnedRowIds","topAndBottom","RowSelection","rowSelection","preGroupedFlatRows","resolvedValue","mutateRowIsSelected","rowModel","selectRowsFn","isAllRowsSelected","paginationFlatRows","isAllPageRowsSelected","_table$getState$rowSe","totalSelected","isSelected","_opts$selectChildren","selectedRowIds","isRowSelected","isSubRowSelected","_table$options$enable3","canSelect","includeChildren","newSelectedFlatRows","newSelectedRowsById","recurseRows","rows","_row$subRows2","selection","_selection$row$id","_row$subRows3","allChildrenSelected","someSelected","subRow","subRowChildrenSelected","reSplitAlphaNumeric","alphanumeric","rowA","rowB","compareAlphanumeric","toString","alphanumericCaseSensitive","text","compareBasic","textCaseSensitive","datetime","basic","aStr","bStr","aa","bb","an","bn","combo","sortingFns","RowSorting","firstRows","isString","_table$options$sortin","_table$options$sortin2","desc","multi","nextSortingOrder","hasManualValue","existingSorting","existingIndex","newSorting","sortAction","nextDesc","_table$options$maxMul","_column$columnDef$sor","firstSortDirection","isSorted","_column$columnDef$ena2","_table$getState$sorti","columnSort","_table$getState$sorti2","_table$getState$sorti3","canSort","_table$initialState$s","builtInFeatures","createTable","_options$_features","_options$initialState","_features","defaultOptions","mergeOptions","initialState","_feature$getInitialSt","queuedTimeout","coreInstance","cb","error","newOptions","searchAll","defaultColumn","_defaultColumn","_props$renderValue$to","_props$renderValue","columnDefs","recurseColumns","groupingColumnDef","flatColumns","getCoreRowModel","data","accessRows","originalRows","_row$originalSubRows","getSortedRowModel","sorting","sortingState","sortedFlatRows","availableSorting","sort","_table$getColumn","columnInfoById","sortEntry","sortData","sortedData","_sortEntry$desc","columnInfo","sortUndefined","isDesc","sortInt","aValue","bValue","aUndefined","bUndefined","trueFn","$PROXY","propTraps","property","receiver","resolveSource","s","mergeProxy","_len","sources","_key","v","keys","FlexRender","defineComponent","getOptionsWithReactiveData","unref","useVueTable","initialOptions","IS_REACTIVE","isRef","resolvedOptions","dataRef","shallowRef","watch","prev","ref","watchEffect","_initialOptions$state","stateProxy","prop"],"mappings":"yaAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KAyEA,SAASA,EAAiBC,EAASC,EAAO,CACxC,OAAO,OAAOD,GAAY,WAAaA,EAAQC,CAAK,EAAID,CAC1D,CAIA,SAASE,EAAiBC,EAAKC,EAAU,CACvC,OAAkBJ,GAAA,CAChBI,EAAS,SAAgBC,IAChB,CACL,GAAGA,EACH,CAACF,CAAG,EAAGJ,EAAiBC,EAASK,EAAIF,CAAG,CAAC,CAC3C,EACD,CACH,CACF,CACA,SAASG,EAAWC,EAAG,CACrB,OAAOA,aAAa,QACtB,CACA,SAASC,GAAcD,EAAG,CACjB,OAAA,MAAM,QAAQA,CAAC,GAAKA,EAAE,MAAME,GAA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