better-table 1.2.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/README.md +90 -120
  2. package/dist/better-table.cjs.js +1 -1
  3. package/dist/better-table.cjs.js.map +1 -1
  4. package/dist/better-table.css +1 -1
  5. package/dist/better-table.es.js +1643 -1331
  6. package/dist/better-table.es.js.map +1 -1
  7. package/dist/components/BetterTable/__tests__/helpers/test-data.d.ts +96 -96
  8. package/dist/components/BetterTable/components/TableExpandedRow.d.ts +8 -0
  9. package/dist/components/BetterTable/components/TableRow.d.ts +2 -1
  10. package/dist/components/BetterTable/components/TableVirtualBody.d.ts +10 -0
  11. package/dist/components/BetterTable/components/index.d.ts +2 -0
  12. package/dist/components/BetterTable/constants.d.ts +20 -0
  13. package/dist/components/BetterTable/context/TableContext.d.ts +15 -80
  14. package/dist/components/BetterTable/context/TableDataContext.d.ts +18 -0
  15. package/dist/components/BetterTable/context/TableFilterContext.d.ts +17 -0
  16. package/dist/components/BetterTable/context/TablePaginationContext.d.ts +19 -0
  17. package/dist/components/BetterTable/context/TableSelectionContext.d.ts +15 -0
  18. package/dist/components/BetterTable/context/TableSortContext.d.ts +10 -0
  19. package/dist/components/BetterTable/context/TableUIContext.d.ts +33 -0
  20. package/dist/components/BetterTable/context/index.d.ts +14 -2
  21. package/dist/components/BetterTable/hooks/index.d.ts +4 -0
  22. package/dist/components/BetterTable/hooks/useColumnResize.d.ts +23 -0
  23. package/dist/components/BetterTable/hooks/useExpandableRows.d.ts +19 -0
  24. package/dist/components/BetterTable/hooks/useFocusTrap.d.ts +6 -0
  25. package/dist/components/BetterTable/hooks/useTableFilter.d.ts +3 -1
  26. package/dist/components/BetterTable/hooks/useTablePagination.d.ts +3 -1
  27. package/dist/components/BetterTable/hooks/useTableSearch.d.ts +3 -1
  28. package/dist/components/BetterTable/hooks/useTableSort.d.ts +3 -1
  29. package/dist/components/BetterTable/hooks/useVirtualization.d.ts +25 -0
  30. package/dist/components/BetterTable/index.d.ts +2 -2
  31. package/dist/components/BetterTable/types.d.ts +58 -0
  32. package/dist/index.d.ts +4 -4
  33. package/package.json +19 -14
package/README.md CHANGED
@@ -4,27 +4,34 @@ A modern, flexible, and fully typed data table component for React.
4
4
 
5
5
  ## ✨ Features
6
6
 
7
- - 🔍 **Search & Filter** — Global search with debounce + Floating Filters (inline in header) / Filter Panel / Both
7
+ - 🔍 **Search & Filter** — Global search with debounce + floating filters / filter panel / both
8
8
  - 📊 **Sorting** — Single & multi-sort with 3-state cycle (asc → desc → unsorted)
9
9
  - 👁️ **Column Visibility** — Interactive toggle to show/hide columns at runtime
10
+ - 🔄 **Column Resizing** — Drag-to-resize with min/max width constraints
11
+ - 📂 **Expandable Rows** — Detail rows with controlled/uncontrolled + accordion mode
12
+ - ⚡ **Virtualization** — Built-in row virtualization for large datasets (zero deps)
13
+ - 🌐 **Server-Side Mode** — Delegate sorting, filtering, pagination to your API
14
+ - 📌 **Sticky Headers** — Headers stay visible when scrolling
10
15
  - ✅ **Selection** — Single or multiple row selection with global actions
11
- - 📱 **Responsive** — Card layout for mobile, collapsible toolbar
12
16
  - 🎬 **Row Actions** — Callbacks, modals, links + overflow menu
17
+ - 📱 **Responsive** — Card layout for mobile, collapsible toolbar
13
18
  - 📄 **Pagination** — Configurable page sizes, quick jumper
14
- - 🌐 **i18n** — Preset locales (EN/ES/PT) + custom overrides
19
+ - 🌍 **i18n** — Preset locales (EN/ES/PT) + custom overrides
15
20
  - 🎨 **Customizable** — CSS variables, custom renderers, class overrides
21
+ - ♿ **Accessible** — ARIA labels, `aria-live` announcements, focus trap in modals
16
22
  - 💪 **TypeScript** — Full type safety with generics
17
23
 
18
24
  ## 📚 Documentation
19
25
 
20
- | Document | Description |
21
- | ------------------------------------------------ | -------------------------------------------- |
22
- | [Architecture](./docs/architecture.md) | Design patterns and technical decisions |
23
- | [Components](./docs/components.md) | Detailed API reference for all components |
26
+ | Document | Description |
27
+ | --- | --- |
28
+ | [Architecture](./docs/architecture.md) | Design patterns and technical decisions |
29
+ | [Components](./docs/components.md) | Detailed API reference for all components |
24
30
  | [Interaction Flows](./docs/interaction-flows.md) | Sequence diagrams and component interactions |
25
- | [Known Issues](./docs/known-issues.md) | Known bugs, limitations and workarounds |
26
- | [Development](./docs/development.md) | Contributing guide and local setup |
27
- | [Roadmap](./docs/ROADMAP.md) | Future improvements and features |
31
+ | [Known Issues](./docs/known-issues.md) | Known bugs, limitations and workarounds |
32
+ | [Development](./docs/development.md) | Contributing guide and local setup |
33
+ | [Roadmap](./docs/ROADMAP.md) | Future improvements and features |
34
+ | [Changelog](./CHANGELOG.md) | Version history |
28
35
 
29
36
  ## 🚀 Quick Start
30
37
 
@@ -45,138 +52,97 @@ const MyTable = () => {
45
52
  ];
46
53
 
47
54
  const columns = [
48
- { id: "name", accessor: "name", header: "Name" },
55
+ { id: "name", accessor: "name", header: "Name", sortable: true },
49
56
  { id: "email", accessor: "email", header: "Email" },
50
57
  { id: "active", accessor: "active", header: "Status", type: "boolean" },
51
58
  ];
52
59
 
53
- return <BetterTable data={data} columns={columns} />;
60
+ return <BetterTable data={data} columns={columns} rowKey="id" />;
54
61
  };
55
62
  ```
56
63
 
57
- ### Multi-Sort & Column Visibility
64
+ ### Column Resizing
58
65
 
59
66
  ```tsx
60
67
  <BetterTable
61
68
  data={users}
62
- columns={columns}
69
+ columns={[
70
+ { id: "name", accessor: "name", header: "Name", resizable: true, minWidth: 100 },
71
+ { id: "email", accessor: "email", header: "Email", resizable: true },
72
+ ]}
63
73
  rowKey="id"
64
- multiSort // Each column cycles: unsorted → asc → desc → unsorted
65
- columnVisibility // Show/hide columns dropdown in toolbar
66
- onMultiSortChange={(sorts) => console.log(sorts)}
67
- onColumnVisibilityChange={(hidden) => console.log(hidden)}
74
+ resizable
68
75
  />
69
76
  ```
70
77
 
71
- ### With Search, Pagination & Actions
78
+ ### Expandable Rows
72
79
 
73
80
  ```tsx
74
81
  <BetterTable
75
82
  data={users}
76
83
  columns={columns}
77
84
  rowKey="id"
78
- searchable
79
- searchDebounceMs={300}
80
- selectable
81
- pagination={{ pageSize: 10, showSizeChanger: true }}
82
- rowActions={[
83
- {
84
- id: "edit",
85
- label: "Edit",
86
- icon: "✏️",
87
- mode: "callback",
88
- onClick: (row) => handleEdit(row),
89
- },
90
- {
91
- id: "delete",
92
- label: "Delete",
93
- mode: "callback",
94
- variant: "danger",
95
- onClick: (row) => handleDelete(row),
96
- },
97
- ]}
98
- globalActions={[
99
- {
100
- id: "export",
101
- label: "Export",
102
- onClick: (selected, all) => exportData(all),
103
- },
104
- ]}
105
- maxVisibleActions={3}
106
- onSelectionChange={(selected) => console.log("Selected:", selected)}
85
+ expandable={{
86
+ render: (row) => <div>Details for {row.name}</div>,
87
+ accordion: true,
88
+ }}
107
89
  />
108
90
  ```
109
91
 
110
- ### Filter Mode
92
+ ### Server-Side Data
111
93
 
112
94
  ```tsx
113
- {
114
- /* Default: floating filters inline in header row */
115
- }
116
- <BetterTable data={data} columns={columns} />;
117
-
118
- {
119
- /* Panel: collapsible filter panel (toggle button in toolbar) */
120
- }
121
- <BetterTable data={data} columns={columns} filterMode="panel" />;
122
-
123
- {
124
- /* Both: floating filters + panel toggle */
125
- }
126
- <BetterTable data={data} columns={columns} filterMode="both" />;
95
+ <BetterTable
96
+ data={serverData}
97
+ columns={columns}
98
+ rowKey="id"
99
+ manualPagination
100
+ manualSorting
101
+ pagination={{ pageSize: 10, totalItems: total }}
102
+ onPageChange={(page, size) => fetchData({ page, size })}
103
+ onSortChange={(sort) => fetchData({ sort })}
104
+ />
127
105
  ```
128
106
 
129
- ### Custom Cell Rendering
107
+ ### Virtualization
130
108
 
131
109
  ```tsx
132
- const columns = [
133
- { id: "name", accessor: "name", header: "Name" },
134
- {
135
- id: "status",
136
- accessor: "active",
137
- header: "Status",
138
- cell: (value) => (
139
- <span className={value ? "badge-success" : "badge-danger"}>
140
- {value ? "✅ Active" : "❌ Inactive"}
141
- </span>
142
- ),
143
- },
144
- {
145
- id: "profile",
146
- accessor: "user.profile.avatar", // Dot notation for nested data
147
- header: "Avatar",
148
- cell: (value) => <img src={value} alt="avatar" />,
149
- },
150
- ];
110
+ // Auto-enables when pagination={false} and dataset > 500 rows
111
+ <BetterTable
112
+ data={largeDataset}
113
+ columns={columns}
114
+ rowKey="id"
115
+ pagination={false}
116
+ stickyHeader
117
+ />
151
118
  ```
152
119
 
153
- ### Internationalization (i18n)
154
-
155
- BetterTable defaults to English. Choose a preset locale or provide custom overrides:
120
+ ### Multi-Sort & Column Visibility
156
121
 
157
122
  ```tsx
158
- // Spanish preset
159
- <BetterTable data={data} columns={columns} locale="es" />
160
-
161
- // Portuguese preset
162
- <BetterTable data={data} columns={columns} locale="pt" />
163
-
164
- // Custom overrides (merged over English defaults)
165
123
  <BetterTable
166
- data={data}
124
+ data={users}
167
125
  columns={columns}
168
- locale={{ noData: "Nothing to show", search: "Find" }}
126
+ rowKey="id"
127
+ multiSort
128
+ columnVisibility
169
129
  />
170
130
  ```
171
131
 
172
- Available presets: `en` (default), `es`, `pt`. You can also import them directly:
132
+ ### Filter Modes
173
133
 
174
134
  ```tsx
175
- import { locales, defaultLocale } from "better-table";
176
- // locales.en, locales.es, locales.pt
135
+ <BetterTable data={data} columns={columns} filterMode="floating" /> {/* default */}
136
+ <BetterTable data={data} columns={columns} filterMode="panel" />
137
+ <BetterTable data={data} columns={columns} filterMode="both" />
177
138
  ```
178
139
 
179
- ````
140
+ ### Internationalization (i18n)
141
+
142
+ ```tsx
143
+ <BetterTable data={data} columns={columns} locale="es" />
144
+ <BetterTable data={data} columns={columns} locale={{ noData: "Nothing to show" }} />
145
+ ```
180
146
 
181
147
  ## 🎨 Customization
182
148
 
@@ -188,9 +154,8 @@ import { locales, defaultLocale } from "better-table";
188
154
  --bt-border-color: #e5e7eb;
189
155
  --bt-hover-bg: #f3f4f6;
190
156
  --bt-selected-bg: #dbeafe;
191
- --bt-font-size-medium: 14px;
192
157
  }
193
- ````
158
+ ```
194
159
 
195
160
  ### Custom Class Names
196
161
 
@@ -213,25 +178,30 @@ See [Components Documentation](./docs/components.md) for complete API reference.
213
178
 
214
179
  ### Main Props
215
180
 
216
- | Prop | Type | Default | Description |
217
- | ------------------- | --------------------------------- | ------------ | ---------------------------------- |
218
- | `data` | `T[]` | - | Array of data to display |
219
- | `columns` | `Column<T>[]` | - | Column configuration |
220
- | `rowKey` | `keyof T \| Function` | `'id'` | Unique key for rows |
221
- | `searchable` | `boolean` | `false` | Enable search toolbar |
222
- | `searchDebounceMs` | `number` | `300` | Search debounce delay (ms) |
223
- | `searchColumns` | `string[]` | all | Columns to search (by accessor) |
224
- | `selectable` | `boolean` | auto | Enable row selection |
225
- | `pagination` | `PaginationConfig \| false` | `false` | Pagination settings |
226
- | `rowActions` | `RowAction<T>[]` | `[]` | Per-row actions |
227
- | `globalActions` | `GlobalAction<T>[]` | `[]` | Global toolbar actions |
228
- | `maxVisibleActions` | `number` | `3` | Inline actions before overflow (⋯) |
229
- | `locale` | `LocaleKey \| TableLocale` | `'en'` | Locale preset or custom strings |
230
- | `loading` | `boolean` | `false` | Loading state |
231
- | `multiSort` | `boolean` | `false` | Enable multi-column sorting |
232
- | `columnVisibility` | `boolean` | `false` | Show column visibility toggle |
233
- | `filterMode` | `'floating' \| 'panel' \| 'both'` | `'floating'` | Filter display mode |
181
+ | Prop | Type | Default | Description |
182
+ | --- | --- | --- | --- |
183
+ | `data` | `T[]` | - | Array of data to display |
184
+ | `columns` | `Column<T>[]` | - | Column configuration |
185
+ | `rowKey` | `keyof T \| Function` | `'id'` | Unique key for rows |
186
+ | `searchable` | `boolean` | `false` | Enable search toolbar |
187
+ | `searchDebounceMs` | `number` | `300` | Search debounce delay (ms) |
188
+ | `filterMode` | `'floating' \| 'panel' \| 'both'` | `'floating'` | Filter display mode |
189
+ | `multiSort` | `boolean` | `false` | Enable multi-column sorting |
190
+ | `columnVisibility` | `boolean` | `false` | Show column visibility toggle |
191
+ | `resizable` | `boolean` | `false` | Enable column resizing |
192
+ | `expandable` | `ExpandableConfig<T>` | - | Expandable row config |
193
+ | `virtualize` | `boolean` | auto | Enable row virtualization |
194
+ | `stickyHeader` | `boolean` | `false` | Sticky table header |
195
+ | `manualSorting` | `boolean` | `false` | Skip client-side sorting |
196
+ | `manualFiltering` | `boolean` | `false` | Skip client-side filtering |
197
+ | `manualPagination` | `boolean` | `false` | Skip client-side pagination |
198
+ | `pagination` | `PaginationConfig \| false` | `{ pageSize: 10 }` | Pagination settings |
199
+ | `selectionMode` | `'single' \| 'multiple'` | - | Selection mode |
200
+ | `rowActions` | `RowAction<T>[]` | `[]` | Per-row actions |
201
+ | `globalActions` | `GlobalAction<T>[]` | `[]` | Global toolbar actions |
202
+ | `locale` | `LocaleKey \| TableLocale` | `'en'` | Locale preset or custom strings |
203
+ | `loading` | `boolean` | `false` | Loading state |
234
204
 
235
205
  ## 📄 License
236
206
 
237
- MIT
207
+ Apache-2.0
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react"),e=require("react/jsx-runtime"),wt=require("react-dom");require("./styles.cjs");const Z={search:"Search",searchPlaceholder:"Search...",noData:"No data",loading:"Loading...",page:"Page",of:"of",items:"items",selected:"selected",rowsPerPage:"Rows per page",actions:"Actions",sortAsc:"Sort ascending",sortDesc:"Sort descending",filterBy:"Filter by",clearFilters:"Clear filters",dateFrom:"From",dateTo:"To",selectAll:"Select all",deselectAll:"Deselect all",moreActions:"More actions",clearSearch:"Clear search",closeModal:"Close",previousPage:"Previous page",nextPage:"Next page",jumpToPage:"Go to page",details:"Details",columns:"Columns",showAllColumns:"Show all",hideColumn:"Hide column",sortPriority:"Sort priority",clearSort:"Clear sort"},Xe={en:Z,es:{search:"Buscar",searchPlaceholder:"Buscar...",noData:"No hay datos",loading:"Cargando...",page:"Página",of:"de",items:"elementos",selected:"seleccionados",rowsPerPage:"Filas por página",actions:"Acciones",sortAsc:"Ordenar ascendente",sortDesc:"Ordenar descendente",filterBy:"Filtrar por",clearFilters:"Limpiar filtros",dateFrom:"Desde",dateTo:"Hasta",selectAll:"Seleccionar todo",deselectAll:"Deseleccionar todo",moreActions:"Más acciones",clearSearch:"Limpiar búsqueda",closeModal:"Cerrar",previousPage:"Página anterior",nextPage:"Página siguiente",jumpToPage:"Ir a página",details:"Detalles",columns:"Columnas",showAllColumns:"Mostrar todas",hideColumn:"Ocultar columna",sortPriority:"Prioridad de orden",clearSort:"Quitar orden"},pt:{search:"Pesquisar",searchPlaceholder:"Pesquisar...",noData:"Sem dados",loading:"Carregando...",page:"Página",of:"de",items:"itens",selected:"selecionados",rowsPerPage:"Linhas por página",actions:"Ações",sortAsc:"Ordenar ascendente",sortDesc:"Ordenar descendente",filterBy:"Filtrar por",clearFilters:"Limpar filtros",dateFrom:"De",dateTo:"Até",selectAll:"Selecionar tudo",deselectAll:"Desselecionar tudo",moreActions:"Mais ações",clearSearch:"Limpar pesquisa",closeModal:"Fechar",previousPage:"Página anterior",nextPage:"Próxima página",jumpToPage:"Ir para página",details:"Detalhes",columns:"Colunas",showAllColumns:"Mostrar todas",hideColumn:"Ocultar coluna",sortPriority:"Prioridade de ordem",clearSort:"Remover ordem"}},Ye=o.createContext(null);function A(){const t=o.useContext(Ye);if(!t)throw new Error("useTableContext must be used within a TableProvider");return t}function et({value:t,children:s}){return e.jsx(Ye.Provider,{value:t,children:s})}function tt(t){var s,l,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(s=0;s<i;s++)t[s]&&(l=tt(t[s]))&&(n&&(n+=" "),n+=l)}else for(l in t)t[l]&&(n&&(n+=" "),n+=l);return n}function N(){for(var t,s,l=0,n="",i=arguments.length;l<i;l++)(t=arguments[l])&&(s=tt(t))&&(n&&(n+=" "),n+=s);return n}function Nt(){return e.jsxs("svg",{className:"bt-sort-icon",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[e.jsx("path",{d:"M7 2.5L10 5.5H4L7 2.5Z",fill:"currentColor",opacity:"0.4"}),e.jsx("path",{d:"M7 11.5L4 8.5H10L7 11.5Z",fill:"currentColor",opacity:"0.4"})]})}function St(){return e.jsxs("svg",{className:"bt-sort-icon",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[e.jsx("path",{d:"M7 2.5L10 5.5H4L7 2.5Z",fill:"currentColor"}),e.jsx("path",{d:"M7 11.5L4 8.5H10L7 11.5Z",fill:"currentColor",opacity:"0.2"})]})}function Pt(){return e.jsxs("svg",{className:"bt-sort-icon",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[e.jsx("path",{d:"M7 2.5L10 5.5H4L7 2.5Z",fill:"currentColor",opacity:"0.2"}),e.jsx("path",{d:"M7 11.5L4 8.5H10L7 11.5Z",fill:"currentColor"})]})}function Tt({column:t}){const{sortState:s,handleSort:l,locale:n,multiSortState:i,isMultiSort:c}=A(),r=s.columnId===t.id,b=c?i.findIndex(C=>C.columnId===t.id):-1,d=b>=0,a=d?i[b].direction:null,u=c&&i.length>1&&d,h=c?d:r,f=c?a:r?s.direction:null,g=o.useCallback(()=>{t.sortable!==!1&&l(t.id)},[t.id,t.sortable,l]),x=o.useCallback(C=>{C.key==="Enter"&&t.sortable!==!1&&l(t.id)},[t.id,t.sortable,l]),y=()=>{if(t.sortable===!1||t.type==="custom")return null;const C=h?f==="asc"?St:Pt:Nt;return e.jsxs("button",{className:N("bt-sort-btn",h&&"bt-active"),onClick:g,"aria-label":f==="asc"?n.sortDesc:n.sortAsc,type:"button",children:[e.jsx(C,{}),u&&e.jsx("span",{className:"bt-sort-priority","aria-label":`${n.sortPriority} ${b+1}`,children:b+1})]})};return t.headerCell?e.jsx("th",{className:N("bt-th",t.align&&`bt-align-${t.align}`),style:{width:t.width},children:t.headerCell(t)}):e.jsx("th",{className:N("bt-th",t.align&&`bt-align-${t.align}`,h&&"bt-sorted"),style:{width:t.width},role:"columnheader","aria-sort":h?f==="asc"?"ascending":"descending":void 0,tabIndex:t.sortable!==!1?0:void 0,onKeyDown:t.sortable!==!1?x:void 0,children:e.jsx("div",{className:"bt-th-content",children:e.jsxs("div",{className:"bt-th-header",children:[e.jsx("span",{className:"bt-th-title",children:t.header}),y()]})})})}const Dt=o.memo(Tt),Ze=()=>e.jsx("svg",{className:"bt-ff-icon",width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:e.jsx("path",{d:"M1.5 2h13L9.5 8.5V14l-3-1.5V8.5z"})});function At(){const{visibleColumns:t,filters:s,setFilter:l,selectable:n,selectionMode:i,rowActions:c,locale:r,stickyHeader:b}=A(),d=c&&c.length>0;return t.some(u=>u.filterable!==!1&&u.type!=="custom")?e.jsxs("tr",{className:N("bt-tr","bt-floating-filter-row",b&&"bt-sticky-filter"),children:[n&&i==="multiple"&&e.jsx("th",{className:"bt-th bt-floating-filter-cell bt-checkbox-cell"}),n&&i==="single"&&e.jsx("th",{className:"bt-th bt-floating-filter-cell bt-checkbox-cell"}),t.map(u=>e.jsx("th",{className:N("bt-th","bt-floating-filter-cell",u.align&&`bt-align-${u.align}`),style:{width:u.width},children:u.filterable!==!1&&u.type!=="custom"?e.jsx(Mt,{column:u,value:s[u.id],setFilter:l,locale:r}):null},u.id)),d&&e.jsx("th",{className:"bt-th bt-floating-filter-cell bt-actions-cell"})]}):null}function Lt({column:t,value:s,setFilter:l,locale:n}){const i=o.useCallback(d=>{const a=d.target.value;t.type==="boolean"?a===""?l(t.id,null):l(t.id,a==="true"):l(t.id,a||null)},[t.id,t.type,l]),c=o.useCallback((d,a)=>{const h={...s??{},[d]:a||void 0};l(t.id,h)},[t.id,s,l]),r=`bt-ff-${t.id}`,b=o.useMemo(()=>{if(s==null)return!1;if(typeof s=="object"){const d=s;return!!(d.from||d.to)}return s!==""},[s]);if(t.type==="boolean")return e.jsxs("div",{className:N("bt-ff-wrapper",b&&"bt-ff-active"),children:[e.jsx(Ze,{}),e.jsxs("select",{id:r,name:r,className:"bt-floating-filter-select",value:s==null?"":String(s),onChange:i,"aria-label":`${n.filterBy} ${t.header}`,children:[e.jsx("option",{value:"",children:"—"}),e.jsx("option",{value:"true",children:"✅"}),e.jsx("option",{value:"false",children:"❌"})]})]});if(t.type==="date"){const d=s??{};return e.jsxs("div",{className:N("bt-floating-filter-dates",b&&"bt-ff-active"),children:[e.jsx("input",{id:`${r}-from`,name:`${r}-from`,type:"date",className:"bt-floating-filter-input",value:d.from??"",onChange:a=>c("from",a.target.value),"aria-label":`${n.dateFrom} ${t.header}`,title:n.dateFrom}),e.jsx("span",{className:"bt-ff-date-sep",children:"–"}),e.jsx("input",{id:`${r}-to`,name:`${r}-to`,type:"date",className:"bt-floating-filter-input",value:d.to??"",onChange:a=>c("to",a.target.value),"aria-label":`${n.dateTo} ${t.header}`,title:n.dateTo})]})}return e.jsxs("div",{className:N("bt-ff-wrapper",b&&"bt-ff-active"),children:[e.jsx(Ze,{}),e.jsx("input",{id:r,name:r,type:t.type==="number"?"number":"text",className:"bt-floating-filter-input",placeholder:"...",value:s!=null?String(s):"",onChange:i,"aria-label":`${n.filterBy} ${t.header}`})]})}const Mt=o.memo(Lt),It=o.memo(At);function $t(){const{visibleColumns:t,selectable:s,selectionMode:l,rowActions:n,isAllSelected:i,isPartiallySelected:c,selectAll:r,deselectAll:b,locale:d,stickyHeader:a,filterMode:u}=A(),h=n&&n.length>0,f=u==="floating"||u==="both",g=()=>{i?b():r()};return e.jsxs("thead",{className:N("bt-thead",a&&"bt-sticky"),children:[e.jsxs("tr",{className:"bt-tr",children:[s&&e.jsx("th",{className:"bt-th bt-checkbox-cell",children:l==="multiple"&&e.jsx("input",{id:"bt-select-all",name:"bt-select-all",type:"checkbox",className:"bt-checkbox",checked:i,ref:x=>{x&&(x.indeterminate=c)},onChange:g,"aria-label":i?d.deselectAll:d.selectAll})}),t.map(x=>e.jsx(Dt,{column:x},x.id)),h&&e.jsx("th",{className:"bt-th bt-actions-cell",children:d.actions})]}),f&&e.jsx(It,{})]})}const Ft=$t;function M(t,s){if(!t||!s)return;const l=s.split(".");let n=t;for(const i of l){if(n==null)return;if(typeof n=="object")n=n[i];else return}return n}function st(t,s,l){if(t==null)return l==="asc"?1:-1;if(s==null)return l==="asc"?-1:1;if(typeof t=="string"&&typeof s=="string"){const r=t.localeCompare(s,void 0,{sensitivity:"base",numeric:!0});return l==="asc"?r:-r}if(typeof t=="number"&&typeof s=="number")return l==="asc"?t-s:s-t;if(typeof t=="boolean"&&typeof s=="boolean"){const r=t===s?0:t?-1:1;return l==="asc"?r:-r}if(t instanceof Date&&s instanceof Date){const r=t.getTime()-s.getTime();return l==="asc"?r:-r}const n=String(t),i=String(s),c=n.localeCompare(i);return l==="asc"?c:-c}function nt(t,s,l){return[...t].sort((n,i)=>{const c=M(n,s),r=M(i,s);return st(c,r,l)})}function Rt(t,s){const l=s.filter(n=>n.columnId!==null);return l.length===0?t:[...t].sort((n,i)=>{for(const c of l){const r=M(n,c.columnId),b=M(i,c.columnId),d=st(r,b,c.direction);if(d!==0)return d}return 0})}function z(t){if(t instanceof Date)return t;if(typeof t=="string"||typeof t=="number"){const s=new Date(t);return isNaN(s.getTime())?null:s}return null}function lt(t,s,l){const n=Object.entries(s).filter(([,i])=>i!=null&&i!=="");return n.length===0?t:t.filter(i=>n.every(([c,r])=>{const b=l.find(u=>u.id===c);if(!b)return!0;const d=M(i,String(b.accessor));if(d==null)return!1;switch(b.type??"string"){case"boolean":return d===r;case"number":return String(d)===String(r);case"date":{const u=z(d);if(!u)return!1;if(r&&typeof r=="object"&&("from"in r||"to"in r)){const f=r;if(f.from){const g=z(f.from);if(g&&u<g)return!1}if(f.to){const g=z(f.to);if(g){const x=new Date(g);if(x.setHours(23,59,59,999),u>x)return!1}}return!0}const h=z(r);return h?u.toDateString()===h.toDateString():String(d).includes(String(r))}default:return String(d).toLowerCase().includes(String(r).toLowerCase())}}))}function at(t,s,l,n){if(!s.trim())return t;const i=s.toLowerCase().trim(),c=n?l.filter(r=>n.includes(r.id)||n.includes(String(r.accessor))):l.filter(r=>r.type!=="custom");return t.filter(r=>c.some(b=>{const d=M(r,String(b.accessor));return d==null?!1:String(d).toLowerCase().includes(i)}))}function Et({row:t,column:s,rowIndex:l}){const n=M(t,String(s.accessor)),c=(()=>{if(s.cell)return s.cell(n,t,l);if(n==null)return e.jsx("span",{className:"bt-cell-empty",children:"—"});switch(s.type){case"boolean":return n?"✅":"❌";case"date":if(n instanceof Date)return n.toLocaleDateString();const r=new Date(String(n));return isNaN(r.getTime())?String(n):r.toLocaleDateString();case"number":return typeof n=="number"?n.toLocaleString():n;default:return String(n)}})();return e.jsx("td",{className:N("bt-td",s.align&&`bt-align-${s.align}`),style:{width:s.width},children:c})}const Ot=o.memo(Et),Bt="📦";function zt({actions:t,row:s,rowIndex:l,onActionClick:n,direction:i="down"}){const{locale:c}=A(),[r,b]=o.useState(!1),[d,a]=o.useState({top:0,left:0,openUp:!1}),u=o.useRef(null),h=o.useRef(null),f=o.useCallback(j=>{j.stopPropagation(),b(m=>{if(!m&&u.current){const v=u.current.getBoundingClientRect(),S=window.innerHeight-v.bottom,T=i==="up"||S<200;a({top:T?v.top:v.bottom,left:v.right,openUp:T})}return!m})},[i]);o.useEffect(()=>{if(!r)return;const j=m=>{const v=m.target;u.current&&!u.current.contains(v)&&h.current&&!h.current.contains(v)&&b(!1)};return document.addEventListener("mousedown",j),()=>document.removeEventListener("mousedown",j)},[r]),o.useEffect(()=>{if(!r)return;const j=m=>{m.key==="Escape"&&b(!1)};return document.addEventListener("keydown",j),()=>document.removeEventListener("keydown",j)},[r]),o.useEffect(()=>{if(!r)return;const j=()=>b(!1);return window.addEventListener("scroll",j,!0),()=>window.removeEventListener("scroll",j,!0)},[r]);const g=t.filter(j=>j.variant!=="danger"),x=t.filter(j=>j.variant==="danger"),y=[...g,...x],C=g.length>0&&x.length>0,P=g.length,k=d.openUp?{position:"fixed",bottom:window.innerHeight-d.top,right:window.innerWidth-d.left}:{position:"fixed",top:d.top,right:window.innerWidth-d.left};return e.jsxs("div",{className:"bt-overflow-container",children:[e.jsx("button",{ref:u,className:"bt-action-btn bt-overflow-trigger",onClick:f,"aria-label":c.moreActions,"aria-expanded":r,"aria-haspopup":"menu",title:c.moreActions,type:"button",children:e.jsx("span",{className:"bt-overflow-icon",children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[e.jsx("circle",{cx:"3",cy:"8",r:"1.5"}),e.jsx("circle",{cx:"8",cy:"8",r:"1.5"}),e.jsx("circle",{cx:"13",cy:"8",r:"1.5"})]})})}),r&&wt.createPortal(e.jsx("div",{ref:h,className:N("bt-overflow-menu",d.openUp&&"bt-overflow-menu-up"),style:k,role:"menu",children:y.map((j,m)=>{if(j.visible&&!j.visible(s))return null;const v=j.disabled?j.disabled(s):!1,S=j.icon??Bt,T=C&&m===P;return e.jsxs(o.Fragment,{children:[T&&e.jsx("div",{className:"bt-overflow-separator",role:"separator"}),j.mode==="link"&&j.href?e.jsxs("a",{href:typeof j.href=="function"?j.href(s):j.href,target:"_blank",rel:"noopener noreferrer",className:N("bt-overflow-item",j.variant==="danger"&&"bt-overflow-item-danger"),role:"menuitem",onClick:p=>{p.stopPropagation(),b(!1)},children:[e.jsx("span",{className:"bt-overflow-item-icon",children:S}),e.jsx("span",{className:"bt-overflow-item-label",children:j.label})]}):e.jsxs("button",{className:N("bt-overflow-item",j.variant==="danger"&&"bt-overflow-item-danger"),role:"menuitem",disabled:v,onClick:p=>{p.stopPropagation(),n(j),b(!1)},type:"button",children:[e.jsx("span",{className:"bt-overflow-item-icon",children:S}),e.jsx("span",{className:"bt-overflow-item-label",children:j.label})]})]},j.id)})}),document.body)]})}const it=o.memo(zt),Vt="📦";function Ht({row:t,rowIndex:s}){const{rowActions:l,openModal:n,closeModal:i,maxVisibleActions:c}=A(),r=o.useCallback(a=>{if(a.mode==="callback"&&a.onClick)a.onClick(t,s);else if(a.mode==="modal"&&a.modalContent){const u=a.modalContent;n(e.jsx(u,{data:t,onClose:i}))}else if(a.mode==="link"&&a.href){const u=typeof a.href=="function"?a.href(t):a.href;window.open(u,"_blank")}},[t,s,n,i]),{inlineActions:b,overflowActions:d}=o.useMemo(()=>{if(!l)return{inlineActions:[],overflowActions:[]};const a=l.filter(h=>!h.visible||h.visible(t));if(a.length<=c)return{inlineActions:a,overflowActions:[]};const u=c-1;return{inlineActions:a.slice(0,u),overflowActions:a.slice(u)}},[l,c,t]);return!l||l.length===0?null:e.jsx("td",{className:"bt-td bt-actions-cell",children:e.jsxs("div",{className:"bt-actions-wrapper",children:[b.map(a=>{const u=a.disabled?a.disabled(t):!1,h=a.icon??Vt;if(a.mode==="link"&&a.href){const f=typeof a.href=="function"?a.href(t):a.href;return e.jsx("a",{href:f,target:"_blank",rel:"noopener noreferrer",className:N("bt-action-btn bt-action-icon-only",a.variant&&`bt-variant-${a.variant}`),"aria-label":a.label,title:a.label,children:e.jsx("span",{className:"bt-action-icon",children:h})},a.id)}return e.jsx("button",{className:N("bt-action-btn bt-action-icon-only",a.variant&&`bt-variant-${a.variant}`),onClick:()=>r(a),disabled:u,"aria-label":a.label,title:a.label,type:"button",children:e.jsx("span",{className:"bt-action-icon",children:h})},a.id)}),d.length>0&&e.jsx(it,{actions:d,row:t,rowIndex:s,onActionClick:r,direction:"down"})]})})}const Wt=o.memo(Ht);function qt({row:t,rowIndex:s}){const{visibleColumns:l,selectable:n,rowActions:i,isSelected:c,toggleRow:r,striped:b,hoverable:d,onRowClick:a,onRowDoubleClick:u}=A(),h=i&&i.length>0,f=n&&c(t,s),g=!!a,x=o.useCallback(()=>{a?.(t,s)},[t,s,a]),y=o.useCallback(()=>{u?.(t,s)},[t,s,u]),C=o.useCallback(()=>{r(t,s)},[t,s,r]),P=o.useCallback(k=>{k.key==="Enter"&&a&&x()},[x,a]);return e.jsxs("tr",{className:N("bt-tr",b&&"bt-striped",d&&"bt-hoverable",f&&"bt-selected",g&&"bt-clickable"),onClick:g?x:void 0,onDoubleClick:u?y:void 0,onKeyDown:g?P:void 0,tabIndex:g?0:void 0,role:g?"button":void 0,"aria-selected":n?f:void 0,children:[n&&e.jsx("td",{className:"bt-td bt-checkbox-cell",children:e.jsx("input",{id:`bt-row-select-${s}`,name:`bt-row-select-${s}`,type:"checkbox",className:"bt-checkbox",checked:f,onChange:C,onClick:k=>k.stopPropagation(),"aria-label":`Select row ${s+1}`})}),l.map(k=>e.jsx(Ot,{row:t,column:k,rowIndex:s},k.id)),h&&e.jsx(Wt,{row:t,rowIndex:s})]})}const Kt=o.memo(qt);function _t(){const{processedData:t,rowKey:s}=A(),l=(n,i)=>{if(typeof s=="function")return s(n,i);const c=n[s];return String(c!==void 0?c:i)};return e.jsx("tbody",{className:"bt-tbody",children:t.map((n,i)=>e.jsx(Kt,{row:n,rowIndex:i},l(n,i)))})}const Ut=_t,Zt="📦";function Qt({row:t,rowIndex:s}){const{visibleColumns:l,selectable:n,rowActions:i,maxVisibleActions:c,isSelected:r,toggleRow:b,hoverable:d,onRowClick:a,openModal:u,closeModal:h}=A(),f=i&&i.length>0,g=n&&r(t,s),x=l[0],y=l.slice(1),{inlineActions:C,overflowActions:P}=o.useMemo(()=>{if(!i)return{inlineActions:[],overflowActions:[]};const p=i.filter(L=>!L.visible||L.visible(t));if(p.length<=c)return{inlineActions:p,overflowActions:[]};const w=c-1;return{inlineActions:p.slice(0,w),overflowActions:p.slice(w)}},[i,c,t]),k=o.useCallback(()=>{b(t,s)},[t,s,b]),j=o.useCallback(()=>{a?.(t,s)},[t,s,a]),m=o.useCallback(p=>{p.key==="Enter"&&a&&j()},[j,a]),v=o.useCallback(p=>{if(p.mode==="callback"&&p.onClick)p.onClick(t,s);else if(p.mode==="modal"&&p.modalContent){const w=p.modalContent;u(e.jsx(w,{data:t,onClose:h}))}else if(p.mode==="link"&&p.href){const w=typeof p.href=="function"?p.href(t):p.href;window.open(w,"_blank")}},[t,s,u,h]),S=(p,w)=>{if(p.cell)return p.cell(w,t,s);if(w==null)return e.jsx("span",{className:"bt-card-value-empty",children:"—"});switch(p.type){case"boolean":return w?"✅":"❌";case"date":if(w instanceof Date)return w.toLocaleDateString();const L=new Date(String(w));return isNaN(L.getTime())?String(w):L.toLocaleDateString();case"number":return typeof w=="number"?w.toLocaleString():String(w);default:return String(w)}},T=x?M(t,String(x.accessor)):"";return e.jsxs("div",{className:N("bt-card",d&&"bt-hoverable",g&&"bt-selected",a&&"bt-clickable"),onClick:a?j:void 0,onKeyDown:a?m:void 0,tabIndex:a?0:void 0,role:a?"button":void 0,"aria-selected":n?g:void 0,children:[e.jsxs("div",{className:"bt-card-header",children:[n&&e.jsx("input",{id:`bt-card-select-${s}`,name:`bt-card-select-${s}`,type:"checkbox",className:"bt-checkbox",checked:g,onChange:k,onClick:p=>p.stopPropagation(),"aria-label":`Select row ${s+1}`}),e.jsx("span",{className:"bt-card-title",children:x?S(x,T):`Item ${s+1}`})]}),y.map(p=>{const w=M(t,String(p.accessor)),L=S(p,w);return e.jsxs("div",{className:"bt-card-row",children:[e.jsx("span",{className:"bt-card-label",children:p.header}),e.jsx("span",{className:"bt-card-value",children:L})]},p.id)}),f&&e.jsxs("div",{className:"bt-card-actions",children:[C.map(p=>{const w=p.disabled?p.disabled(t):!1,L=p.icon??Zt;if(p.mode==="link"&&p.href){const F=typeof p.href=="function"?p.href(t):p.href;return e.jsx("a",{href:F,target:"_blank",rel:"noopener noreferrer",className:N("bt-action-btn bt-action-icon-only",p.variant&&`bt-variant-${p.variant}`),"aria-label":p.label,title:p.label,onClick:R=>R.stopPropagation(),children:e.jsx("span",{className:"bt-action-icon",children:L})},p.id)}return e.jsx("button",{className:N("bt-action-btn bt-action-icon-only",p.variant&&`bt-variant-${p.variant}`),onClick:F=>{F.stopPropagation(),v(p)},disabled:w,"aria-label":p.label,title:p.label,type:"button",children:e.jsx("span",{className:"bt-action-icon",children:L})},p.id)}),P.length>0&&e.jsx(it,{actions:P,row:t,rowIndex:s,onActionClick:v,direction:"up"})]})]})}const Gt=o.memo(Qt);function Jt(){const{processedData:t,rowKey:s}=A(),l=(n,i)=>{if(typeof s=="function")return s(n,i);const c=n[s];return String(c!==void 0?c:i)};return e.jsx("div",{className:"bt-cards",children:t.map((n,i)=>e.jsx(Gt,{row:n,rowIndex:i},l(n,i)))})}const Xt=Jt;function Qe(){return e.jsx("svg",{className:"bt-fp-icon",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:e.jsx("path",{d:"M1.5 2H10.5L7 5.87V9.5L5 8.5V5.87L1.5 2Z",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"})})}function Yt({open:t}){const{columns:s,filters:l,setFilter:n,clearFilter:i,clearFilters:c,locale:r}=A(),b=s.filter(a=>a.filterable!==!1&&a.type!=="custom"&&!a.hidden);if(!t||b.length===0)return null;const d=Object.keys(l).length;return e.jsxs("div",{className:"bt-filter-panel",role:"region","aria-label":r.filterBy,children:[e.jsx("div",{className:"bt-filter-panel-grid",children:b.map(a=>e.jsx(ts,{column:a,value:l[a.id],setFilter:n,clearFilter:i,locale:r},a.id))}),d>0&&e.jsx("div",{className:"bt-filter-panel-footer",children:e.jsx("button",{className:"bt-filter-panel-clear",onClick:c,type:"button",children:r.clearFilters})})]})}function es({column:t,value:s,setFilter:l,locale:n}){const i=o.useCallback(u=>{const h=u.target.value;t.type==="boolean"?h===""?l(t.id,null):l(t.id,h==="true"):l(t.id,h||null)},[t.id,t.type,l]),c=o.useCallback((u,h)=>{const g={...s??{},[u]:h||void 0};l(t.id,g)},[t.id,s,l]),r=s!=null&&s!=="",b=r&&typeof s=="object"&&("from"in s||"to"in s)&&!!(s.from||s.to),d=t.type==="date"?b:r,a=()=>{const u=`bt-filter-${t.id}`;if(t.type==="boolean")return e.jsxs("div",{className:N("bt-fp-wrapper",d&&"bt-fp-active"),children:[e.jsx(Qe,{}),e.jsxs("select",{id:u,name:u,className:"bt-filter-select",value:s==null?"":String(s),onChange:i,"aria-label":`${n.filterBy} ${t.header}`,children:[e.jsx("option",{value:"",children:"—"}),e.jsx("option",{value:"true",children:"✅"}),e.jsx("option",{value:"false",children:"❌"})]})]});if(t.type==="date"){const h=s??{};return e.jsxs("div",{className:N("bt-fp-wrapper bt-filter-field-dates",d&&"bt-fp-active"),children:[e.jsx("input",{id:`${u}-from`,name:`${u}-from`,type:"date",className:"bt-filter-input",value:h.from??"",onChange:f=>c("from",f.target.value),"aria-label":`${n.dateFrom} ${t.header}`,placeholder:n.dateFrom}),e.jsx("span",{className:"bt-filter-field-separator",children:"–"}),e.jsx("input",{id:`${u}-to`,name:`${u}-to`,type:"date",className:"bt-filter-input",value:h.to??"",onChange:f=>c("to",f.target.value),"aria-label":`${n.dateTo} ${t.header}`,placeholder:n.dateTo})]})}return e.jsxs("div",{className:N("bt-fp-wrapper",d&&"bt-fp-active"),children:[e.jsx(Qe,{}),e.jsx("input",{id:u,name:u,type:t.type==="number"?"number":"text",className:"bt-filter-input",placeholder:"...",value:s!=null?String(s):"",onChange:i,"aria-label":`${n.filterBy} ${t.header}`})]})};return e.jsxs("div",{className:N("bt-filter-field",d&&"bt-filter-field-active"),children:[e.jsx("label",{className:"bt-filter-field-label",htmlFor:`bt-filter-${t.id}`,children:t.header}),a()]})}const ts=o.memo(es),ss=o.memo(Yt);function ns(){return e.jsxs("svg",{className:"bt-columns-svg",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[e.jsx("rect",{x:"1.5",y:"2",width:"4",height:"10",rx:"1",stroke:"currentColor",strokeWidth:"1.3"}),e.jsx("rect",{x:"8.5",y:"2",width:"4",height:"10",rx:"1",stroke:"currentColor",strokeWidth:"1.3"})]})}function ls(){return e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:e.jsx("path",{d:"M2.5 6L5 8.5L9.5 3.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function as(){const{columns:t,hiddenColumnIds:s,toggleColumn:l,showAllColumns:n,isColumnVisible:i,locale:c,columnVisibilityEnabled:r}=A(),[b,d]=o.useState(!1),a=o.useRef(null),u=o.useRef(null),h=s.size;o.useEffect(()=>{if(!b)return;const x=C=>{a.current&&!a.current.contains(C.target)&&d(!1)},y=C=>{C.key==="Escape"&&(d(!1),u.current?.focus())};return document.addEventListener("mousedown",x),document.addEventListener("keydown",y),()=>{document.removeEventListener("mousedown",x),document.removeEventListener("keydown",y)}},[b]);const f=o.useCallback(()=>{d(x=>!x)},[]);if(!r)return null;const g=t.filter(x=>x.type!=="custom");return e.jsxs("div",{className:"bt-column-visibility",ref:a,children:[e.jsxs("button",{ref:u,className:N("bt-column-visibility-btn",b&&"bt-column-visibility-btn-active"),onClick:f,"aria-expanded":b,"aria-haspopup":"true","aria-label":c.columns,title:c.columns,type:"button",children:[e.jsx(ns,{}),e.jsx("span",{className:"bt-column-visibility-label",children:c.columns}),h>0&&e.jsx("span",{className:"bt-column-visibility-badge",children:h})]}),b&&e.jsxs("div",{className:"bt-column-visibility-dropdown",role:"menu",children:[e.jsxs("div",{className:"bt-column-visibility-header",children:[e.jsx("span",{className:"bt-column-visibility-title",children:c.columns}),h>0&&e.jsx("button",{className:"bt-column-visibility-show-all",onClick:n,type:"button",children:c.showAllColumns})]}),e.jsx("div",{className:"bt-column-visibility-list",children:g.map(x=>{const y=i(x.id);return e.jsxs("button",{className:N("bt-column-visibility-item",!y&&"bt-column-visibility-item-hidden"),onClick:()=>l(x.id),role:"menuitemcheckbox","aria-checked":y,type:"button",children:[e.jsx("span",{className:N("bt-column-visibility-check",y&&"bt-column-visibility-check-active"),children:y&&e.jsx(ls,{})}),e.jsx("span",{className:"bt-column-visibility-item-label",children:x.header})]},x.id)})})]})]})}const is=as;function rs(){return e.jsx("svg",{className:"bt-pagination-svg",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:e.jsx("path",{d:"M9 3L5 7L9 11",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function os(){return e.jsx("svg",{className:"bt-pagination-svg",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:e.jsx("path",{d:"M5 3L9 7L5 11",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function cs(){const{page:t,pageSize:s,totalPages:l,totalItems:n,goToPage:i,nextPage:c,prevPage:r,changePageSize:b,hasNextPage:d,hasPrevPage:a,startIndex:u,endIndex:h,paginationEnabled:f,pageSizeOptions:g,showSizeChanger:x,locale:y,classNames:C}=A(),P=o.useCallback(m=>{b(Number(m.target.value))},[b]),k=o.useCallback(m=>{if(m.key==="Enter"){const v=parseInt(m.target.value,10);!isNaN(v)&&v>=1&&v<=l&&i(v)}},[i,l]),j=o.useMemo(()=>{const m=[];if(l<=5)for(let S=1;S<=l;S++)m.push(S);else{m.push(1),t>3&&m.push("ellipsis");const S=Math.max(2,t-1),T=Math.min(l-1,t+1);for(let p=S;p<=T;p++)m.push(p);t<l-2&&m.push("ellipsis"),l>1&&m.push(l)}return m},[t,l]);return f?e.jsxs("div",{className:`bt-pagination ${C.pagination||""}`,children:[e.jsx("div",{className:"bt-pagination-info",children:n>0?`${u}-${h} ${y.of} ${n} ${y.items}`:`0 ${y.items}`}),e.jsxs("div",{className:"bt-pagination-controls",children:[x&&e.jsxs("div",{className:"bt-page-size",children:[e.jsxs("label",{className:"bt-page-size-label",htmlFor:"bt-page-size",children:[y.rowsPerPage,":"]}),e.jsx("select",{id:"bt-page-size",name:"bt-page-size",className:"bt-page-size-select",value:s,onChange:P,"aria-label":y.rowsPerPage,children:g.map(m=>e.jsx("option",{value:m,children:m},m))})]}),e.jsx("button",{className:"bt-pagination-btn",onClick:r,disabled:!a,"aria-label":y.previousPage,type:"button",children:e.jsx(rs,{})}),e.jsx("div",{className:"bt-pagination-pages",children:j.map((m,v)=>m==="ellipsis"?e.jsx("span",{className:"bt-pagination-ellipsis",children:"..."},`ellipsis-${v}`):e.jsx("button",{className:`bt-pagination-btn ${t===m?"bt-active":""}`,onClick:()=>i(m),"aria-label":`${y.page} ${m}`,"aria-current":t===m?"page":void 0,type:"button",children:m},m))}),e.jsx("button",{className:"bt-pagination-btn",onClick:c,disabled:!d,"aria-label":y.nextPage,type:"button",children:e.jsx(os,{})}),e.jsxs("div",{className:"bt-quick-jumper",children:[e.jsxs("label",{className:"bt-quick-jumper-label",htmlFor:"bt-quick-jumper",children:[y.page,":"]}),e.jsxs("div",{className:"bt-qj-wrapper",children:[e.jsx("input",{id:"bt-quick-jumper",name:"bt-quick-jumper",type:"number",className:"bt-quick-jumper-input",min:1,max:l,defaultValue:t,onKeyDown:k,"aria-label":y.jumpToPage},t),e.jsx("span",{className:"bt-qj-hint","aria-hidden":"true",children:"↵"})]})]})]})]}):null}function rt(t){const[s,l]=o.useState(()=>typeof window>"u"?!1:window.matchMedia(t).matches);return o.useEffect(()=>{if(typeof window>"u")return;const n=window.matchMedia(t);l(n.matches);const i=c=>l(c.matches);return n.addEventListener("change",i),()=>n.removeEventListener("change",i)},[t]),s}function Ge(){return e.jsxs("svg",{className:"bt-search-svg",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[e.jsx("circle",{cx:"6",cy:"6",r:"4.5",stroke:"currentColor",strokeWidth:"1.5"}),e.jsx("path",{d:"M9.5 9.5L13 13",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}function Je(){return e.jsx("svg",{className:"bt-clear-svg",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:e.jsx("path",{d:"M3 3L9 9M9 3L3 9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}function ds(){return e.jsx("svg",{className:"bt-check-svg",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:e.jsx("path",{d:"M2.5 6L5 8.5L9.5 3.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function bs(){return e.jsx("svg",{className:"bt-filter-toggle-svg",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:e.jsx("path",{d:"M1 2.5H11L7.5 6.5V10L4.5 9V6.5L1 2.5Z",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"})})}function us(){const{searchable:t,searchValue:s,handleSearch:l,clearSearch:n,globalActions:i,selectedRows:c,selectedCount:r,deselectAll:b,data:d,locale:a,classNames:u,selectable:h,filters:f,filterPanelOpen:g,toggleFilterPanel:x,hasFilterableColumns:y,filterMode:C,columnVisibilityEnabled:P}=A(),k=rt("(max-width: 640px)"),[j,m]=o.useState(!1),v=o.useRef(null),S=Object.keys(f).length,T=o.useCallback(D=>{l(D.target.value)},[l]),p=o.useCallback(()=>{m(D=>(D?s&&n():setTimeout(()=>v.current?.focus(),50),!D))},[s,n]);o.useEffect(()=>{s&&!j&&m(!0)},[s,j]);const w=y&&(C==="panel"||C==="both");if(!(t||w||P||i&&i.length>0||h&&r>0))return null;const F=k&&t&&!j,R=t&&(!k||j);return e.jsxs("div",{className:N("bt-toolbar",u.toolbar),children:[e.jsxs("div",{className:"bt-toolbar-left",children:[F&&e.jsx("button",{className:"bt-search-toggle",onClick:p,"aria-label":a.search,title:a.search,type:"button",children:e.jsx(Ge,{})}),R&&e.jsxs("div",{className:N("bt-search",k&&"bt-search-mobile"),children:[e.jsx("span",{className:"bt-search-icon",children:e.jsx(Ge,{})}),e.jsx("input",{id:"bt-search",name:"bt-search",ref:v,type:"text",className:"bt-search-input",placeholder:a.searchPlaceholder,value:s,onChange:T,"aria-label":a.search}),(s||k)&&e.jsx("button",{className:"bt-search-clear",onClick:k?p:n,"aria-label":a.clearSearch,type:"button",children:e.jsx(Je,{})})]}),w&&e.jsxs("button",{className:N("bt-filter-toggle",g&&"bt-filter-toggle-active"),onClick:x,"aria-expanded":g,"aria-label":a.filterBy,title:a.filterBy,type:"button",children:[e.jsx("span",{className:"bt-filter-toggle-icon",children:e.jsx(bs,{})}),!k&&e.jsx("span",{children:a.filterBy}),S>0&&e.jsx("span",{className:"bt-filter-toggle-badge",children:S})]}),e.jsx(is,{}),h&&r>0&&e.jsxs("div",{className:"bt-selection-info",children:[e.jsx(ds,{}),e.jsxs("span",{className:"bt-selection-count",children:[r," ",k?"sel.":a.selected]}),e.jsx("button",{className:"bt-selection-clear",onClick:b,type:"button",children:k?e.jsx(Je,{}):a.deselectAll})]})]}),i&&i.length>0&&e.jsx("div",{className:"bt-toolbar-right",children:e.jsx("div",{className:"bt-global-actions",children:i.map(D=>{const O=D.requiresSelection&&c.length===0;return e.jsxs("button",{className:N("bt-global-btn",D.variant&&`bt-variant-${D.variant}`,k&&"bt-global-btn-mobile"),onClick:()=>D.onClick(c,d),disabled:O,title:D.label,"aria-label":D.label,type:"button",children:[D.icon&&e.jsx("span",{className:"bt-global-icon",children:D.icon}),!k&&e.jsx("span",{children:D.label})]},D.id)})})})]})}const hs=us;function fs(){return e.jsxs("svg",{className:"bt-empty-svg",width:"64",height:"64",viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[e.jsx("rect",{x:"12",y:"18",width:"40",height:"32",rx:"3",stroke:"currentColor",strokeWidth:"2",opacity:"0.3"}),e.jsx("path",{d:"M12 28H52",stroke:"currentColor",strokeWidth:"2",opacity:"0.2"}),e.jsx("path",{d:"M24 38H40",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",opacity:"0.4"}),e.jsx("path",{d:"M28 44H36",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",opacity:"0.25"}),e.jsx("circle",{cx:"32",cy:"12",r:"4",stroke:"currentColor",strokeWidth:"2",opacity:"0.2"})]})}function ms(){const{locale:t,emptyComponent:s,visibleColumns:l,selectable:n,rowActions:i}=A(),c=i&&i.length>0,r=l.length+(n?1:0)+(c?1:0);return s?e.jsx("tbody",{className:"bt-tbody",children:e.jsx("tr",{className:"bt-tr",children:e.jsx("td",{className:"bt-td",colSpan:r,children:s})})}):e.jsx("tbody",{className:"bt-tbody",children:e.jsx("tr",{className:"bt-tr",children:e.jsx("td",{className:"bt-td",colSpan:r,children:e.jsxs("div",{className:"bt-empty",children:[e.jsx("div",{className:"bt-empty-icon",children:e.jsx(fs,{})}),e.jsx("div",{className:"bt-empty-text",children:t.noData})]})})})})}function ps({show:t}){const{loadingComponent:s,locale:l}=A();return t?e.jsx("div",{className:"bt-loading-overlay",role:"status","aria-live":"polite",children:s||e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"bt-loading-spinner","aria-hidden":"true"}),e.jsx("span",{className:"bt-loading-text",children:l.loading})]})}):null}function gs(){return e.jsx("svg",{className:"bt-modal-close-svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:e.jsx("path",{d:"M4 4L12 12M12 4L4 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}function xs(){const{isModalOpen:t,modalContent:s,closeModal:l,locale:n}=A(),i=o.useCallback(r=>{r.target===r.currentTarget&&l()},[l]),c=o.useCallback(r=>{r.key==="Escape"&&l()},[l]);return o.useEffect(()=>(t&&(document.addEventListener("keydown",c),document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",c),document.body.style.overflow=""}),[t,c]),!t||!s?null:e.jsx("div",{className:"bt-modal-backdrop",onClick:i,role:"dialog","aria-modal":"true",children:e.jsxs("div",{className:"bt-modal bt-modal-md",children:[e.jsxs("div",{className:"bt-modal-header",children:[e.jsx("h2",{className:"bt-modal-title",children:n.details}),e.jsx("button",{className:"bt-modal-close",onClick:l,"aria-label":n.closeModal,type:"button",children:e.jsx(gs,{})})]}),e.jsx("div",{className:"bt-modal-body",children:s})]})})}function ot({data:t,initialSort:s,controlledSort:l,onSortChange:n,multiSort:i=!1,controlledMultiSort:c,onMultiSortChange:r}){const[b,d]=o.useState(s??{columnId:null,direction:"asc"}),[a,u]=o.useState([]),h=l??b,f=c??a,g=o.useCallback(C=>{if(i){const P=f.findIndex(v=>v.columnId===C);let k;P>=0?f[P].direction==="asc"?(k=[...f],k[P]={columnId:C,direction:"desc"}):k=f.filter((S,T)=>T!==P):k=[...f,{columnId:C,direction:"asc"}],c||u(k),r?.(k);const j=k[0],m=j?{columnId:j.columnId,direction:j.direction}:{columnId:null,direction:"asc"};l||d(m),n?.(m)}else{let P;h.columnId!==C?P={columnId:C,direction:"asc"}:h.direction==="asc"?P={columnId:C,direction:"desc"}:P={columnId:null,direction:"asc"},l||d(P),n?.(P)}},[h,f,l,c,n,r,i]),x=o.useCallback(()=>{const C={columnId:null,direction:"asc"};l||d(C),n?.(C),i&&(c||u([]),r?.([]))},[l,c,n,r,i]);return{sortedData:o.useMemo(()=>i&&f.length>0?Rt(t,f):h.columnId?nt(t,h.columnId,h.direction):t,[t,h,f,i]),sortState:h,handleSort:g,clearSort:x,multiSortState:f,isMultiSort:i}}function ct({data:t,columns:s,initialFilters:l,controlledFilters:n,onFilterChange:i}){const[c,r]=o.useState(l??{}),b=n??c,d=o.useCallback((f,g)=>{const x={...b};if(g!==null&&typeof g=="object"&&"from"in g){const y=g;!y.from&&!y.to?delete x[f]:x[f]=g}else g==null||g===""?delete x[f]:x[f]=g;n||r(x),i?.(x)},[b,n,i]),a=o.useCallback(f=>{const g={...b};delete g[f],n||r(g),i?.(g)},[b,n,i]),u=o.useCallback(()=>{n||r({}),i?.({})},[n,i]);return{filteredData:o.useMemo(()=>lt(t,b,s),[t,b,s]),filters:b,setFilter:d,clearFilters:u,clearFilter:a}}function dt({data:t,config:s,onPageChange:l}){const n=s!==!1,i=s&&typeof s=="object"?s.page??1:1,c=s&&typeof s=="object"?s.pageSize??10:10,r=s&&typeof s=="object"?s.totalItems:void 0,[b,d]=o.useState(i),[a,u]=o.useState(c),h=r??t.length,f=Math.max(1,Math.ceil(h/a)),g=o.useCallback(m=>{const v=Math.max(1,Math.min(m,f));d(v),l?.(v,a)},[f,a,l]),x=o.useCallback(()=>{b<f&&g(b+1)},[b,f,g]),y=o.useCallback(()=>{b>1&&g(b-1)},[b,g]),C=o.useCallback(m=>{u(m),d(1),l?.(1,m)},[l]),P=o.useMemo(()=>{if(!n||r!==void 0)return t;const m=(b-1)*a;return t.slice(m,m+a)},[t,b,a,n,r]),k=(b-1)*a+1,j=Math.min(b*a,h);return{paginatedData:P,page:b,pageSize:a,totalPages:f,totalItems:h,goToPage:g,nextPage:x,prevPage:y,changePageSize:C,hasNextPage:b<f,hasPrevPage:b>1,startIndex:k,endIndex:j}}function bt({data:t,rowKey:s,mode:l="multiple",initialSelection:n,controlledSelection:i,onSelectionChange:c}){const[r,b]=o.useState(n??[]),d=i??r,a=o.useCallback((m,v)=>typeof s=="function"?s(m,v):String(m[s]),[s]),u=o.useMemo(()=>new Set(d.map((m,v)=>a(m,v))),[d,a]),h=o.useCallback((m,v)=>{const S=a(m,v);return u.has(S)},[a,u]),f=o.useCallback(m=>{i||b(m),c?.(m)},[i,c]),g=o.useCallback((m,v)=>{const S=a(m,v);let T;l==="single"?T=u.has(S)?[]:[m]:u.has(S)?T=d.filter((p,w)=>a(p,w)!==S):T=[...d,m],f(T)},[l,u,d,a,f]),x=o.useCallback((m,v)=>{if(!h(m,v)){const S=l==="single"?[m]:[...d,m];f(S)}},[h,l,d,f]),y=o.useCallback((m,v)=>{const S=a(m,v),T=d.filter((p,w)=>a(p,w)!==S);f(T)},[d,a,f]),C=o.useCallback(()=>{l==="multiple"&&f([...t])},[t,l,f]),P=o.useCallback(()=>{f([])},[f]),k=t.length>0&&d.length===t.length,j=d.length>0&&d.length<t.length;return{selectedRows:d,isSelected:h,toggleRow:g,selectRow:x,deselectRow:y,selectAll:C,deselectAll:P,isAllSelected:k,isPartiallySelected:j,selectedCount:d.length}}function ut({data:t,columns:s,searchColumns:l,initialValue:n,controlledValue:i,onSearchChange:c,debounceMs:r=0}){const[b,d]=o.useState(n??""),[a,u]=o.useState(n??""),h=o.useRef(null),f=i??b;o.useEffect(()=>{if(r<=0){u(f);return}return h.current=setTimeout(()=>{u(f)},r),()=>{h.current&&clearTimeout(h.current)}},[f,r]);const g=o.useCallback(C=>{i===void 0&&d(C),c?.(C)},[i,c]),x=o.useCallback(()=>{i===void 0&&d(""),h.current&&clearTimeout(h.current),u(""),c?.("")},[i,c]);return{searchedData:o.useMemo(()=>at(t,a,s,l),[t,a,s,l]),searchValue:f,handleSearch:g,clearSearch:x}}function ht({columns:t,controlledHiddenColumns:s,onColumnVisibilityChange:l}){const[n,i]=o.useState(()=>t.filter(h=>h.hidden).map(h=>h.id)),c=s??n,r=o.useMemo(()=>new Set(c),[c]),b=o.useCallback(h=>{const f=r.has(h)?c.filter(g=>g!==h):[...c,h];s||i(f),l?.(f)},[c,r,s,l]),d=o.useCallback(()=>{s||i([]),l?.([])},[s,l]),a=o.useCallback(h=>!r.has(h),[r]);return{visibleColumns:o.useMemo(()=>t.filter(h=>!r.has(h.id)),[t,r]),hiddenColumnIds:r,toggleColumn:b,showAllColumns:d,isColumnVisible:a,hiddenColumns:c}}function js(t){const{data:s,columns:l,rowKey:n="id",rowActions:i,globalActions:c,maxVisibleActions:r=3,pagination:b={pageSize:10},onPageChange:d,sort:a,onSortChange:u,multiSort:h=!1,multiSortState:f,onMultiSortChange:g,filters:x,onFilterChange:y,filterMode:C="floating",searchable:P=!1,searchValue:k,onSearchChange:j,searchColumns:m,searchDebounceMs:v=300,selectable:S,selectedRows:T,onSelectionChange:p,selectionMode:w="multiple",columnVisibility:L=!1,hiddenColumns:F,onColumnVisibilityChange:R,loading:D=!1,loadingComponent:O,emptyComponent:Q,classNames:B={},styles:G={},locale:E,stickyHeader:J=!1,maxHeight:ft,bordered:V=!1,striped:H=!1,hoverable:W=!0,size:q="medium",onRowClick:X,onRowDoubleClick:Y,ariaLabel:mt,ariaDescribedBy:pt}=t,ee=o.useMemo(()=>S!==void 0?S:c?.some(kt=>kt.requiresSelection)||p!==void 0,[S,c,p]),te=o.useMemo(()=>({...typeof E=="string"?Xe[E]:Z,...typeof E=="object"?E:{}}),[E]),[se,ne]=o.useState(!1),[le,ae]=o.useState(null),[K,gt]=o.useState(!1),ie=o.useCallback(()=>{gt(I=>!I)},[]),re=o.useMemo(()=>l.some(I=>I.filterable!==!1&&I.type!=="custom"&&!I.hidden),[l]),oe=o.useCallback(I=>{ae(I),ne(!0)},[]),ce=o.useCallback(()=>{ne(!1),ae(null)},[]),$=o.useMemo(()=>b===!1?!1:{pageSize:10,pageSizeOptions:[10,20,50,100],showSizeChanger:!1,...b},[b]),{searchedData:xt,searchValue:de,handleSearch:be,clearSearch:ue}=ut({data:s,columns:l,searchColumns:m,controlledValue:k,onSearchChange:j,debounceMs:v}),{filteredData:jt,filters:he,setFilter:fe,clearFilter:me,clearFilters:pe}=ct({data:xt,columns:l,controlledFilters:x,onFilterChange:y}),{sortedData:ge,sortState:xe,handleSort:je,clearSort:ve,multiSortState:Ce,isMultiSort:ye}=ot({data:jt,controlledSort:a,onSortChange:u,multiSort:h,controlledMultiSort:f,onMultiSortChange:g}),{visibleColumns:ke,hiddenColumnIds:we,toggleColumn:Ne,showAllColumns:Se,isColumnVisible:Pe}=ht({columns:l,controlledHiddenColumns:F,onColumnVisibilityChange:R}),{selectedRows:Te,isSelected:De,toggleRow:Ae,selectAll:Le,deselectAll:Me,isAllSelected:Ie,isPartiallySelected:$e,selectedCount:Fe}=bt({data:ge,rowKey:n,mode:w,controlledSelection:T,onSelectionChange:p}),{paginatedData:_,page:Re,pageSize:Ee,totalPages:Oe,totalItems:Be,goToPage:ze,nextPage:Ve,prevPage:He,changePageSize:We,hasNextPage:qe,hasPrevPage:Ke,startIndex:_e,endIndex:Ue}=dt({data:ge,config:$,onPageChange:d}),vt=o.useMemo(()=>({data:s,processedData:_,columns:l,visibleColumns:ke,rowKey:n,rowActions:i,globalActions:c,maxVisibleActions:r,sortState:xe,handleSort:je,multiSortState:Ce,isMultiSort:ye,clearSort:ve,columnVisibilityEnabled:L,hiddenColumnIds:we,toggleColumn:Ne,showAllColumns:Se,isColumnVisible:Pe,filters:he,setFilter:fe,clearFilter:me,clearFilters:pe,searchValue:de,handleSearch:be,clearSearch:ue,searchable:P,selectedRows:Te,isSelected:De,toggleRow:Ae,selectAll:Le,deselectAll:Me,isAllSelected:Ie,isPartiallySelected:$e,selectable:ee,selectionMode:w,selectedCount:Fe,page:Re,pageSize:Ee,totalPages:Oe,totalItems:Be,goToPage:ze,nextPage:Ve,prevPage:He,changePageSize:We,hasNextPage:qe,hasPrevPage:Ke,startIndex:_e,endIndex:Ue,paginationEnabled:b!==!1,pageSizeOptions:$&&typeof $=="object"?$.pageSizeOptions??[10,20,50,100]:[10,20,50,100],showSizeChanger:$&&typeof $=="object"?$.showSizeChanger??!1:!1,loading:D,loadingComponent:O,emptyComponent:Q,locale:te,classNames:B,size:q,bordered:V,striped:H,hoverable:W,stickyHeader:J,onRowClick:X,onRowDoubleClick:Y,openModal:oe,closeModal:ce,modalContent:le,isModalOpen:se,filterPanelOpen:K,toggleFilterPanel:ie,hasFilterableColumns:re,filterMode:C}),[s,_,l,ke,n,i,c,r,xe,je,Ce,ye,ve,L,we,Ne,Se,Pe,he,fe,me,pe,de,be,ue,P,Te,De,Ae,Le,Me,Ie,$e,ee,w,Fe,Re,Ee,Oe,Be,ze,Ve,He,We,qe,Ke,_e,Ue,b,$,D,O,Q,te,B,q,V,H,W,J,X,Y,oe,ce,le,se,K,ie,re,C]),U=_.length>0,Ct=rt("(max-width: 640px)");return e.jsx(et,{value:vt,children:e.jsxs("div",{className:N("bt-container",`bt-size-${q}`,H&&"bt-striped",V&&"bt-bordered",W&&"bt-hoverable",D&&"bt-container-loading",B.container),style:G.container,children:[e.jsx(hs,{}),(C==="panel"||C==="both")&&e.jsx(ss,{open:K}),e.jsxs("div",{className:"bt-table-wrapper",style:{maxHeight:ft},children:[Ct?U&&e.jsx(Xt,{}):e.jsxs("table",{className:N("bt-table",B.table),style:G.table,role:"grid","aria-label":mt,"aria-describedby":pt,"aria-busy":D,children:[e.jsx(Ft,{}),U?e.jsx(Ut,{}):e.jsx(ms,{})]}),e.jsx(ps,{show:D&&U})]}),b!==!1&&e.jsx(cs,{}),e.jsx(xs,{})]})})}const vs=js;exports.BetterTable=vs;exports.TableProvider=et;exports.defaultLocale=Z;exports.filterData=lt;exports.getValueFromPath=M;exports.locales=Xe;exports.searchData=at;exports.sortData=nt;exports.useColumnVisibility=ht;exports.useTableContext=A;exports.useTableFilter=ct;exports.useTablePagination=dt;exports.useTableSearch=ut;exports.useTableSelection=bt;exports.useTableSort=ot;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react"),t=require("react/jsx-runtime"),ps=require("react-dom");require("./styles.cjs");const vt=l.createContext(null);function E(){const e=l.useContext(vt);if(!e)throw new Error("useTableData must be used within a TableProvider");return e}const ms=vt.Provider,jt=l.createContext(null);function Ct(){const e=l.useContext(jt);if(!e)throw new Error("useTableSortContext must be used within a TableProvider");return e}const gs=jt.Provider,yt=l.createContext(null);function Q(){const e=l.useContext(yt);if(!e)throw new Error("useTableFilterContext must be used within a TableProvider");return e}const xs=yt.Provider,wt=l.createContext(null);function z(){const e=l.useContext(wt);if(!e)throw new Error("useTableSelectionContext must be used within a TableProvider");return e}const vs=wt.Provider,kt=l.createContext(null);function St(){const e=l.useContext(kt);if(!e)throw new Error("useTablePaginationContext must be used within a TableProvider");return e}const js=kt.Provider,Nt=l.createContext(null);function L(){const e=l.useContext(Nt);if(!e)throw new Error("useTableUI must be used within a TableProvider");return e}const Cs=Nt.Provider;function Tt({data:e,sort:s,filter:n,selection:a,pagination:o,ui:r,children:i}){return t.jsx(ms,{value:e,children:t.jsx(gs,{value:s,children:t.jsx(xs,{value:n,children:t.jsx(vs,{value:a,children:t.jsx(js,{value:o,children:t.jsx(Cs,{value:r,children:i})})})})})})}function Pt(e){var s,n,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(s=0;s<o;s++)e[s]&&(n=Pt(e[s]))&&(a&&(a+=" "),a+=n)}else for(n in e)e[n]&&(a&&(a+=" "),a+=n);return a}function T(){for(var e,s,n=0,a="",o=arguments.length;n<o;n++)(e=arguments[n])&&(s=Pt(e))&&(a&&(a+=" "),a+=s);return a}function ys(){return t.jsxs("svg",{className:"bt-sort-icon",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[t.jsx("path",{d:"M7 2.5L10 5.5H4L7 2.5Z",fill:"currentColor",opacity:"0.4"}),t.jsx("path",{d:"M7 11.5L4 8.5H10L7 11.5Z",fill:"currentColor",opacity:"0.4"})]})}function ws(){return t.jsxs("svg",{className:"bt-sort-icon",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[t.jsx("path",{d:"M7 2.5L10 5.5H4L7 2.5Z",fill:"currentColor"}),t.jsx("path",{d:"M7 11.5L4 8.5H10L7 11.5Z",fill:"currentColor",opacity:"0.2"})]})}function ks(){return t.jsxs("svg",{className:"bt-sort-icon",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[t.jsx("path",{d:"M7 2.5L10 5.5H4L7 2.5Z",fill:"currentColor",opacity:"0.2"}),t.jsx("path",{d:"M7 11.5L4 8.5H10L7 11.5Z",fill:"currentColor"})]})}function Ss({column:e}){const{sortState:s,handleSort:n,multiSortState:a,isMultiSort:o}=Ct(),{locale:r,resizable:i,startResize:u,getColumnWidth:d}=L(),c=e.resizable!==void 0?e.resizable:i,b=l.useCallback(C=>{C.preventDefault(),C.stopPropagation(),u(e.id,C.clientX)},[e.id,u]),h=s.columnId===e.id,f=o?a.findIndex(C=>C.columnId===e.id):-1,p=f>=0,v=p?a[f].direction:null,g=o&&a.length>1&&p,N=o?p:h,k=o?v:h?s.direction:null,y=l.useCallback(()=>{e.sortable!==!1&&n(e.id)},[e.id,e.sortable,n]),j=l.useCallback(C=>{C.key==="Enter"&&e.sortable!==!1&&n(e.id)},[e.id,e.sortable,n]),x=()=>{if(e.sortable===!1||e.type==="custom")return null;const C=N?k==="asc"?ws:ks:ys;return t.jsxs("button",{className:T("bt-sort-btn",N&&"bt-active"),onClick:y,"aria-label":k==="asc"?r.sortDesc:r.sortAsc,type:"button",children:[t.jsx(C,{}),g&&t.jsx("span",{className:"bt-sort-priority","aria-label":`${r.sortPriority} ${f+1}`,children:f+1})]})};if(e.headerCell){const C=d(e.id);return t.jsxs("th",{className:T("bt-th",e.align&&`bt-align-${e.align}`,c&&"bt-th-resizable"),style:{width:C??e.width},"data-column-id":e.id,children:[e.headerCell(e),c&&t.jsx("div",{className:"bt-resize-handle",onMouseDown:b,role:"separator","aria-orientation":"vertical","aria-label":`Resize ${e.header}`})]})}return t.jsxs("th",{className:T("bt-th",e.align&&`bt-align-${e.align}`,N&&"bt-sorted",c&&"bt-th-resizable"),style:{width:d(e.id)??e.width},"data-column-id":e.id,role:"columnheader","aria-sort":N?k==="asc"?"ascending":"descending":void 0,tabIndex:e.sortable!==!1?0:void 0,onKeyDown:e.sortable!==!1?j:void 0,children:[t.jsx("div",{className:"bt-th-content",children:t.jsxs("div",{className:"bt-th-header",children:[t.jsx("span",{className:"bt-th-title",children:e.header}),x()]})}),c&&t.jsx("div",{className:"bt-resize-handle",onMouseDown:b,role:"separator","aria-orientation":"vertical","aria-label":`Resize ${e.header}`})]})}const Ns=l.memo(Ss),pt=()=>t.jsx("svg",{className:"bt-ff-icon",width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:t.jsx("path",{d:"M1.5 2h13L9.5 8.5V14l-3-1.5V8.5z"})});function Ts(){const{visibleColumns:e,rowActions:s,expandableEnabled:n}=E(),{filters:a,setFilter:o}=Q(),{selectable:r,selectionMode:i}=z(),{locale:u,stickyHeader:d}=L(),c=s&&s.length>0;return e.some(h=>h.filterable!==!1&&h.type!=="custom")?t.jsxs("tr",{className:T("bt-tr","bt-floating-filter-row",d&&"bt-sticky-filter"),children:[n&&t.jsx("th",{className:"bt-th bt-floating-filter-cell bt-expand-cell"}),r&&i==="multiple"&&t.jsx("th",{className:"bt-th bt-floating-filter-cell bt-checkbox-cell"}),r&&i==="single"&&t.jsx("th",{className:"bt-th bt-floating-filter-cell bt-checkbox-cell"}),e.map(h=>t.jsx("th",{className:T("bt-th","bt-floating-filter-cell",h.align&&`bt-align-${h.align}`),style:{width:h.width},children:h.filterable!==!1&&h.type!=="custom"?t.jsx(Ds,{column:h,value:a[h.id],setFilter:o,locale:u}):null},h.id)),c&&t.jsx("th",{className:"bt-th bt-floating-filter-cell bt-actions-cell"})]}):null}function Ps({column:e,value:s,setFilter:n,locale:a}){const o=l.useCallback(d=>{const c=d.target.value;e.type==="boolean"?c===""?n(e.id,null):n(e.id,c==="true"):n(e.id,c||null)},[e.id,e.type,n]),r=l.useCallback((d,c)=>{const h={...s??{},[d]:c||void 0};n(e.id,h)},[e.id,s,n]),i=`bt-ff-${e.id}`,u=l.useMemo(()=>{if(s==null)return!1;if(typeof s=="object"){const d=s;return!!(d.from||d.to)}return s!==""},[s]);if(e.type==="boolean")return t.jsxs("div",{className:T("bt-ff-wrapper",u&&"bt-ff-active"),children:[t.jsx(pt,{}),t.jsxs("select",{id:i,name:i,className:"bt-floating-filter-select",value:s==null?"":String(s),onChange:o,"aria-label":`${a.filterBy} ${e.header}`,children:[t.jsx("option",{value:"",children:"—"}),t.jsx("option",{value:"true",children:"✅"}),t.jsx("option",{value:"false",children:"❌"})]})]});if(e.type==="date"){const d=s??{};return t.jsxs("div",{className:T("bt-floating-filter-dates",u&&"bt-ff-active"),children:[t.jsx("input",{id:`${i}-from`,name:`${i}-from`,type:"date",className:"bt-floating-filter-input",value:d.from??"",onChange:c=>r("from",c.target.value),"aria-label":`${a.dateFrom} ${e.header}`,title:a.dateFrom}),t.jsx("span",{className:"bt-ff-date-sep",children:"–"}),t.jsx("input",{id:`${i}-to`,name:`${i}-to`,type:"date",className:"bt-floating-filter-input",value:d.to??"",onChange:c=>r("to",c.target.value),"aria-label":`${a.dateTo} ${e.header}`,title:a.dateTo})]})}return t.jsxs("div",{className:T("bt-ff-wrapper",u&&"bt-ff-active"),children:[t.jsx(pt,{}),t.jsx("input",{id:i,name:i,type:e.type==="number"?"number":"text",className:"bt-floating-filter-input",placeholder:"...",value:s!=null?String(s):"",onChange:o,"aria-label":`${a.filterBy} ${e.header}`})]})}const Ds=l.memo(Ps),Ms=l.memo(Ts);function Ls(){const{visibleColumns:e,rowActions:s,expandableEnabled:n}=E(),{selectable:a,selectionMode:o,isAllSelected:r,isPartiallySelected:i,selectAll:u,deselectAll:d}=z(),{locale:c,stickyHeader:b}=L(),{filterMode:h}=Q(),f=s&&s.length>0,p=h==="floating"||h==="both",v=()=>{r?d():u()};return t.jsxs("thead",{className:T("bt-thead",b&&"bt-sticky"),children:[t.jsxs("tr",{className:"bt-tr",children:[n&&t.jsx("th",{className:"bt-th bt-expand-cell","aria-label":"Expand"}),a&&t.jsx("th",{className:"bt-th bt-checkbox-cell",children:o==="multiple"&&t.jsx("input",{id:"bt-select-all",name:"bt-select-all",type:"checkbox",className:"bt-checkbox",checked:r,ref:g=>{g&&(g.indeterminate=i)},onChange:v,"aria-label":r?c.deselectAll:c.selectAll})}),e.map(g=>t.jsx(Ns,{column:g},g.id)),f&&t.jsx("th",{className:"bt-th bt-actions-cell",children:c.actions})]}),p&&t.jsx(Ms,{})]})}const As=Ls;function I(e,s){if(!e||!s)return;const n=s.split(".");let a=e;for(const o of n){if(a==null)return;if(typeof a=="object")a=a[o];else return}return a}function Dt(e,s,n){if(e==null)return n==="asc"?1:-1;if(s==null)return n==="asc"?-1:1;if(typeof e=="string"&&typeof s=="string"){const i=e.localeCompare(s,void 0,{sensitivity:"base",numeric:!0});return n==="asc"?i:-i}if(typeof e=="number"&&typeof s=="number")return n==="asc"?e-s:s-e;if(typeof e=="boolean"&&typeof s=="boolean"){const i=e===s?0:e?-1:1;return n==="asc"?i:-i}if(e instanceof Date&&s instanceof Date){const i=e.getTime()-s.getTime();return n==="asc"?i:-i}const a=String(e),o=String(s),r=a.localeCompare(o);return n==="asc"?r:-r}function Mt(e,s,n){return[...e].sort((a,o)=>{const r=I(a,s),i=I(o,s);return Dt(r,i,n)})}function Es(e,s){const n=s.filter(a=>a.columnId!==null);return n.length===0?e:[...e].sort((a,o)=>{for(const r of n){const i=I(a,r.columnId),u=I(o,r.columnId),d=Dt(i,u,r.direction);if(d!==0)return d}return 0})}function te(e){if(e instanceof Date)return e;if(typeof e=="string"||typeof e=="number"){const s=new Date(e);return isNaN(s.getTime())?null:s}return null}function Lt(e,s,n){const a=Object.entries(s).filter(([,o])=>o!=null&&o!=="");return a.length===0?e:e.filter(o=>a.every(([r,i])=>{const u=n.find(b=>b.id===r);if(!u)return!0;const d=I(o,String(u.accessor));if(d==null)return!1;switch(u.type??"string"){case"boolean":return d===i;case"number":return String(d)===String(i);case"date":{const b=te(d);if(!b)return!1;if(i&&typeof i=="object"&&("from"in i||"to"in i)){const f=i;if(f.from){const p=te(f.from);if(p&&b<p)return!1}if(f.to){const p=te(f.to);if(p){const v=new Date(p);if(v.setHours(23,59,59,999),b>v)return!1}}return!0}const h=te(i);return h?b.toDateString()===h.toDateString():String(d).includes(String(i))}default:return String(d).toLowerCase().includes(String(i).toLowerCase())}}))}function At(e,s,n,a){if(!s.trim())return e;const o=s.toLowerCase().trim(),r=a?n.filter(i=>a.includes(i.id)||a.includes(String(i.accessor))):n.filter(i=>i.type!=="custom");return e.filter(i=>r.some(u=>{const d=I(i,String(u.accessor));return d==null?!1:String(d).toLowerCase().includes(o)}))}function Is({row:e,column:s,rowIndex:n}){const{resizable:a,getColumnWidth:o}=L(),r=I(e,String(s.accessor)),u=(()=>{if(s.cell)return s.cell(r,e,n);if(r==null)return t.jsx("span",{className:"bt-cell-empty",children:"—"});switch(s.type){case"boolean":return r?"✅":"❌";case"date":if(r instanceof Date)return r.toLocaleDateString();const c=new Date(String(r));return isNaN(c.getTime())?String(r):c.toLocaleDateString();case"number":return typeof r=="number"?r.toLocaleString():r;default:return String(r)}})(),d=a?o(s.id)??s.width:s.width;return t.jsx("td",{className:T("bt-td",s.align&&`bt-align-${s.align}`),style:{width:d},children:u})}const Rs=l.memo(Is),Fs="📦";function $s({actions:e,row:s,rowIndex:n,onActionClick:a,direction:o="down"}){const{locale:r}=L(),[i,u]=l.useState(!1),[d,c]=l.useState({top:0,left:0,openUp:!1}),b=l.useRef(null),h=l.useRef(null),f=l.useCallback(j=>{j.stopPropagation(),u(x=>{if(!x&&b.current){const C=b.current.getBoundingClientRect(),S=window.innerHeight-C.bottom,P=o==="up"||S<200;c({top:P?C.top:C.bottom,left:C.right,openUp:P})}return!x})},[o]);l.useEffect(()=>{if(!i)return;const j=x=>{const C=x.target;b.current&&!b.current.contains(C)&&h.current&&!h.current.contains(C)&&u(!1)};return document.addEventListener("mousedown",j),()=>document.removeEventListener("mousedown",j)},[i]),l.useEffect(()=>{if(!i)return;const j=x=>{x.key==="Escape"&&u(!1)};return document.addEventListener("keydown",j),()=>document.removeEventListener("keydown",j)},[i]),l.useEffect(()=>{if(!i)return;const j=()=>u(!1);return window.addEventListener("scroll",j,!0),()=>window.removeEventListener("scroll",j,!0)},[i]);const p=e.filter(j=>j.variant!=="danger"),v=e.filter(j=>j.variant==="danger"),g=[...p,...v],N=p.length>0&&v.length>0,k=p.length,y=d.openUp?{position:"fixed",bottom:window.innerHeight-d.top,right:window.innerWidth-d.left}:{position:"fixed",top:d.top,right:window.innerWidth-d.left};return t.jsxs("div",{className:"bt-overflow-container",children:[t.jsx("button",{ref:b,className:"bt-action-btn bt-overflow-trigger",onClick:f,"aria-label":r.moreActions,"aria-expanded":i,"aria-haspopup":"menu",title:r.moreActions,type:"button",children:t.jsx("span",{className:"bt-overflow-icon",children:t.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[t.jsx("circle",{cx:"3",cy:"8",r:"1.5"}),t.jsx("circle",{cx:"8",cy:"8",r:"1.5"}),t.jsx("circle",{cx:"13",cy:"8",r:"1.5"})]})})}),i&&ps.createPortal(t.jsx("div",{ref:h,className:T("bt-overflow-menu",d.openUp&&"bt-overflow-menu-up"),style:y,role:"menu",children:g.map((j,x)=>{if(j.visible&&!j.visible(s))return null;const C=j.disabled?j.disabled(s):!1,S=j.icon??Fs,P=N&&x===k;return t.jsxs(l.Fragment,{children:[P&&t.jsx("div",{className:"bt-overflow-separator",role:"separator"}),j.mode==="link"&&j.href?t.jsxs("a",{href:typeof j.href=="function"?j.href(s):j.href,target:"_blank",rel:"noopener noreferrer",className:T("bt-overflow-item",j.variant==="danger"&&"bt-overflow-item-danger"),role:"menuitem",onClick:m=>{m.stopPropagation(),u(!1)},children:[t.jsx("span",{className:"bt-overflow-item-icon",children:S}),t.jsx("span",{className:"bt-overflow-item-label",children:j.label})]}):t.jsxs("button",{className:T("bt-overflow-item",j.variant==="danger"&&"bt-overflow-item-danger"),role:"menuitem",disabled:C,onClick:m=>{m.stopPropagation(),a(j),u(!1)},type:"button",children:[t.jsx("span",{className:"bt-overflow-item-icon",children:S}),t.jsx("span",{className:"bt-overflow-item-label",children:j.label})]})]},j.id)})}),document.body)]})}const Et=l.memo($s),zs="📦";function Os({row:e,rowIndex:s}){const{rowActions:n,maxVisibleActions:a}=E(),{openModal:o,closeModal:r}=L(),i=l.useCallback(c=>{if(c.mode==="callback"&&c.onClick)c.onClick(e,s);else if(c.mode==="modal"&&c.modalContent){const b=c.modalContent;o(t.jsx(b,{data:e,onClose:r}))}else if(c.mode==="link"&&c.href){const b=typeof c.href=="function"?c.href(e):c.href;window.open(b,"_blank")}},[e,s,o,r]),{inlineActions:u,overflowActions:d}=l.useMemo(()=>{if(!n)return{inlineActions:[],overflowActions:[]};const c=n.filter(h=>!h.visible||h.visible(e));if(c.length<=a)return{inlineActions:c,overflowActions:[]};const b=a-1;return{inlineActions:c.slice(0,b),overflowActions:c.slice(b)}},[n,a,e]);return!n||n.length===0?null:t.jsx("td",{className:"bt-td bt-actions-cell",children:t.jsxs("div",{className:"bt-actions-wrapper",children:[u.map(c=>{const b=c.disabled?c.disabled(e):!1,h=c.icon??zs;if(c.mode==="link"&&c.href){const f=typeof c.href=="function"?c.href(e):c.href;return t.jsx("a",{href:f,target:"_blank",rel:"noopener noreferrer",className:T("bt-action-btn bt-action-icon-only",c.variant&&`bt-variant-${c.variant}`),"aria-label":c.label,title:c.label,children:t.jsx("span",{className:"bt-action-icon",children:h})},c.id)}return t.jsx("button",{className:T("bt-action-btn bt-action-icon-only",c.variant&&`bt-variant-${c.variant}`),onClick:()=>i(c),disabled:b,"aria-label":c.label,title:c.label,type:"button",children:t.jsx("span",{className:"bt-action-icon",children:h})},c.id)}),d.length>0&&t.jsx(Et,{actions:d,row:e,rowIndex:s,onActionClick:i,direction:"down"})]})})}const Bs=l.memo(Os);function Ws({row:e,rowIndex:s,rowKey:n}){const{visibleColumns:a,rowActions:o,expandableEnabled:r,isExpanded:i,toggleExpand:u}=E(),{selectable:d,isSelected:c,toggleRow:b}=z(),{striped:h,hoverable:f,onRowClick:p,onRowDoubleClick:v,locale:g}=L(),N=o&&o.length>0,k=d&&c(e,s),y=!!p,j=r&&i(n),x=l.useCallback(()=>{p?.(e,s)},[e,s,p]),C=l.useCallback(()=>{v?.(e,s)},[e,s,v]),S=l.useCallback(()=>{b(e,s)},[e,s,b]),P=l.useCallback(()=>{u(n)},[n,u]),m=l.useCallback(w=>{w.key==="Enter"&&p&&x()},[x,p]);return t.jsxs("tr",{className:T("bt-tr",h&&"bt-striped",f&&"bt-hoverable",k&&"bt-selected",y&&"bt-clickable",j&&"bt-expanded"),onClick:y?x:void 0,onDoubleClick:v?C:void 0,onKeyDown:y?m:void 0,tabIndex:y?0:void 0,role:y?"button":void 0,"aria-selected":d?k:void 0,"aria-expanded":r?j:void 0,children:[r&&t.jsx("td",{className:"bt-td bt-expand-cell",children:t.jsx("button",{type:"button",className:T("bt-expand-button",j&&"bt-expand-button-expanded"),onClick:w=>{w.stopPropagation(),P()},"aria-label":j?g.collapseRow:g.expandRow,"aria-expanded":j,children:t.jsx("svg",{className:"bt-expand-icon",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M6 4l4 4-4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})}),d&&t.jsx("td",{className:"bt-td bt-checkbox-cell",children:t.jsx("input",{id:`bt-row-select-${s}`,name:`bt-row-select-${s}`,type:"checkbox",className:"bt-checkbox",checked:k,onChange:S,onClick:w=>w.stopPropagation(),"aria-label":`Select row ${s+1}`})}),a.map(w=>t.jsx(Rs,{row:e,column:w,rowIndex:s},w.id)),N&&t.jsx(Bs,{row:e,rowIndex:s})]})}const It=l.memo(Ws);function Hs({row:e,rowIndex:s}){const{visibleColumns:n,rowActions:a,expandableRender:o}=E(),{selectable:r}=z();if(!o)return null;const i=a&&a.length>0,u=1+(r?1:0)+n.length+(i?1:0);return t.jsx("tr",{className:"bt-tr bt-expanded-row",role:"row",children:t.jsx("td",{className:"bt-td bt-expanded-content",colSpan:u,children:o(e,s)})})}const Vs=Hs;function Us(){const{processedData:e,rowKey:s,expandableEnabled:n,isExpanded:a}=E(),o=(r,i)=>{if(typeof s=="function")return s(r,i);const u=r[s];return String(u!==void 0?u:i)};return t.jsx("tbody",{className:"bt-tbody",children:e.map((r,i)=>{const u=o(r,i),d=n&&a(u);return t.jsxs(l.Fragment,{children:[t.jsx(It,{row:r,rowIndex:i,rowKey:u}),d&&t.jsx(Vs,{row:r,rowIndex:i})]},u)})})}const _s=Us,qs="📦";function Ks({row:e,rowIndex:s}){const{visibleColumns:n,rowActions:a,maxVisibleActions:o}=E(),{selectable:r,isSelected:i,toggleRow:u}=z(),{hoverable:d,onRowClick:c,openModal:b,closeModal:h}=L(),f=a&&a.length>0,p=r&&i(e,s),v=n[0],g=n.slice(1),{inlineActions:N,overflowActions:k}=l.useMemo(()=>{if(!a)return{inlineActions:[],overflowActions:[]};const m=a.filter(A=>!A.visible||A.visible(e));if(m.length<=o)return{inlineActions:m,overflowActions:[]};const w=o-1;return{inlineActions:m.slice(0,w),overflowActions:m.slice(w)}},[a,o,e]),y=l.useCallback(()=>{u(e,s)},[e,s,u]),j=l.useCallback(()=>{c?.(e,s)},[e,s,c]),x=l.useCallback(m=>{m.key==="Enter"&&c&&j()},[j,c]),C=l.useCallback(m=>{if(m.mode==="callback"&&m.onClick)m.onClick(e,s);else if(m.mode==="modal"&&m.modalContent){const w=m.modalContent;b(t.jsx(w,{data:e,onClose:h}))}else if(m.mode==="link"&&m.href){const w=typeof m.href=="function"?m.href(e):m.href;window.open(w,"_blank")}},[e,s,b,h]),S=(m,w)=>{if(m.cell)return m.cell(w,e,s);if(w==null)return t.jsx("span",{className:"bt-card-value-empty",children:"—"});switch(m.type){case"boolean":return w?"✅":"❌";case"date":if(w instanceof Date)return w.toLocaleDateString();const A=new Date(String(w));return isNaN(A.getTime())?String(w):A.toLocaleDateString();case"number":return typeof w=="number"?w.toLocaleString():String(w);default:return String(w)}},P=v?I(e,String(v.accessor)):"";return t.jsxs("div",{className:T("bt-card",d&&"bt-hoverable",p&&"bt-selected",c&&"bt-clickable"),onClick:c?j:void 0,onKeyDown:c?x:void 0,tabIndex:c?0:void 0,role:c?"button":void 0,"aria-selected":r?p:void 0,children:[t.jsxs("div",{className:"bt-card-header",children:[r&&t.jsx("input",{id:`bt-card-select-${s}`,name:`bt-card-select-${s}`,type:"checkbox",className:"bt-checkbox",checked:p,onChange:y,onClick:m=>m.stopPropagation(),"aria-label":`Select row ${s+1}`}),t.jsx("span",{className:"bt-card-title",children:v?S(v,P):`Item ${s+1}`})]}),g.map(m=>{const w=I(e,String(m.accessor)),A=S(m,w);return t.jsxs("div",{className:"bt-card-row",children:[t.jsx("span",{className:"bt-card-label",children:m.header}),t.jsx("span",{className:"bt-card-value",children:A})]},m.id)}),f&&t.jsxs("div",{className:"bt-card-actions",children:[N.map(m=>{const w=m.disabled?m.disabled(e):!1,A=m.icon??qs;if(m.mode==="link"&&m.href){const R=typeof m.href=="function"?m.href(e):m.href;return t.jsx("a",{href:R,target:"_blank",rel:"noopener noreferrer",className:T("bt-action-btn bt-action-icon-only",m.variant&&`bt-variant-${m.variant}`),"aria-label":m.label,title:m.label,onClick:O=>O.stopPropagation(),children:t.jsx("span",{className:"bt-action-icon",children:A})},m.id)}return t.jsx("button",{className:T("bt-action-btn bt-action-icon-only",m.variant&&`bt-variant-${m.variant}`),onClick:R=>{R.stopPropagation(),C(m)},disabled:w,"aria-label":m.label,title:m.label,type:"button",children:t.jsx("span",{className:"bt-action-icon",children:A})},m.id)}),k.length>0&&t.jsx(Et,{actions:k,row:e,rowIndex:s,onActionClick:C,direction:"up"})]})]})}const Zs=l.memo(Ks);function Qs(){const{processedData:e,rowKey:s}=E(),n=(a,o)=>{if(typeof s=="function")return s(a,o);const r=a[s];return String(r!==void 0?r:o)};return t.jsx("div",{className:"bt-cards",children:e.map((a,o)=>t.jsx(Zs,{row:a,rowIndex:o},n(a,o)))})}const Xs=Qs;function mt(){return t.jsx("svg",{className:"bt-fp-icon",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:t.jsx("path",{d:"M1.5 2H10.5L7 5.87V9.5L5 8.5V5.87L1.5 2Z",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"})})}function Gs({open:e}){const{columns:s,locale:n}=L(),{filters:a,setFilter:o,clearFilter:r,clearFilters:i}=Q(),u=s.filter(c=>c.filterable!==!1&&c.type!=="custom"&&!c.hidden);if(!e||u.length===0)return null;const d=Object.keys(a).length;return t.jsxs("div",{className:"bt-filter-panel",role:"region","aria-label":n.filterBy,children:[t.jsx("div",{className:"bt-filter-panel-grid",children:u.map(c=>t.jsx(Ys,{column:c,value:a[c.id],setFilter:o,clearFilter:r,locale:n},c.id))}),d>0&&t.jsx("div",{className:"bt-filter-panel-footer",children:t.jsx("button",{className:"bt-filter-panel-clear",onClick:i,type:"button",children:n.clearFilters})})]})}function Js({column:e,value:s,setFilter:n,locale:a}){const o=l.useCallback(b=>{const h=b.target.value;e.type==="boolean"?h===""?n(e.id,null):n(e.id,h==="true"):n(e.id,h||null)},[e.id,e.type,n]),r=l.useCallback((b,h)=>{const p={...s??{},[b]:h||void 0};n(e.id,p)},[e.id,s,n]),i=s!=null&&s!=="",u=i&&typeof s=="object"&&("from"in s||"to"in s)&&!!(s.from||s.to),d=e.type==="date"?u:i,c=()=>{const b=`bt-filter-${e.id}`;if(e.type==="boolean")return t.jsxs("div",{className:T("bt-fp-wrapper",d&&"bt-fp-active"),children:[t.jsx(mt,{}),t.jsxs("select",{id:b,name:b,className:"bt-filter-select",value:s==null?"":String(s),onChange:o,"aria-label":`${a.filterBy} ${e.header}`,children:[t.jsx("option",{value:"",children:"—"}),t.jsx("option",{value:"true",children:"✅"}),t.jsx("option",{value:"false",children:"❌"})]})]});if(e.type==="date"){const h=s??{};return t.jsxs("div",{className:T("bt-fp-wrapper bt-filter-field-dates",d&&"bt-fp-active"),children:[t.jsx("input",{id:`${b}-from`,name:`${b}-from`,type:"date",className:"bt-filter-input",value:h.from??"",onChange:f=>r("from",f.target.value),"aria-label":`${a.dateFrom} ${e.header}`,placeholder:a.dateFrom}),t.jsx("span",{className:"bt-filter-field-separator",children:"–"}),t.jsx("input",{id:`${b}-to`,name:`${b}-to`,type:"date",className:"bt-filter-input",value:h.to??"",onChange:f=>r("to",f.target.value),"aria-label":`${a.dateTo} ${e.header}`,placeholder:a.dateTo})]})}return t.jsxs("div",{className:T("bt-fp-wrapper",d&&"bt-fp-active"),children:[t.jsx(mt,{}),t.jsx("input",{id:b,name:b,type:e.type==="number"?"number":"text",className:"bt-filter-input",placeholder:"...",value:s!=null?String(s):"",onChange:o,"aria-label":`${a.filterBy} ${e.header}`})]})};return t.jsxs("div",{className:T("bt-filter-field",d&&"bt-filter-field-active"),children:[t.jsx("label",{className:"bt-filter-field-label",htmlFor:`bt-filter-${e.id}`,children:e.header}),c()]})}const Ys=l.memo(Js),en=l.memo(Gs);function tn(){return t.jsxs("svg",{className:"bt-columns-svg",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[t.jsx("rect",{x:"1.5",y:"2",width:"4",height:"10",rx:"1",stroke:"currentColor",strokeWidth:"1.3"}),t.jsx("rect",{x:"8.5",y:"2",width:"4",height:"10",rx:"1",stroke:"currentColor",strokeWidth:"1.3"})]})}function sn(){return t.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:t.jsx("path",{d:"M2.5 6L5 8.5L9.5 3.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function nn(){const{columns:e,hiddenColumnIds:s,toggleColumn:n,showAllColumns:a,isColumnVisible:o,locale:r,columnVisibilityEnabled:i}=L(),[u,d]=l.useState(!1),c=l.useRef(null),b=l.useRef(null),h=s.size;l.useEffect(()=>{if(!u)return;const v=N=>{c.current&&!c.current.contains(N.target)&&d(!1)},g=N=>{N.key==="Escape"&&(d(!1),b.current?.focus())};return document.addEventListener("mousedown",v),document.addEventListener("keydown",g),()=>{document.removeEventListener("mousedown",v),document.removeEventListener("keydown",g)}},[u]);const f=l.useCallback(()=>{d(v=>!v)},[]);if(!i)return null;const p=e.filter(v=>v.type!=="custom");return t.jsxs("div",{className:"bt-column-visibility",ref:c,children:[t.jsxs("button",{ref:b,className:T("bt-column-visibility-btn",u&&"bt-column-visibility-btn-active"),onClick:f,"aria-expanded":u,"aria-haspopup":"true","aria-label":r.columns,title:r.columns,type:"button",children:[t.jsx(tn,{}),t.jsx("span",{className:"bt-column-visibility-label",children:r.columns}),h>0&&t.jsx("span",{className:"bt-column-visibility-badge",children:h})]}),u&&t.jsxs("div",{className:"bt-column-visibility-dropdown",role:"menu",children:[t.jsxs("div",{className:"bt-column-visibility-header",children:[t.jsx("span",{className:"bt-column-visibility-title",children:r.columns}),h>0&&t.jsx("button",{className:"bt-column-visibility-show-all",onClick:a,type:"button",children:r.showAllColumns})]}),t.jsx("div",{className:"bt-column-visibility-list",children:p.map(v=>{const g=o(v.id);return t.jsxs("button",{className:T("bt-column-visibility-item",!g&&"bt-column-visibility-item-hidden"),onClick:()=>n(v.id),role:"menuitemcheckbox","aria-checked":g,type:"button",children:[t.jsx("span",{className:T("bt-column-visibility-check",g&&"bt-column-visibility-check-active"),children:g&&t.jsx(sn,{})}),t.jsx("span",{className:"bt-column-visibility-item-label",children:v.header})]},v.id)})})]})]})}const an=nn;function ln(){return t.jsx("svg",{className:"bt-pagination-svg",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:t.jsx("path",{d:"M9 3L5 7L9 11",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function rn(){return t.jsx("svg",{className:"bt-pagination-svg",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:t.jsx("path",{d:"M5 3L9 7L5 11",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function on(){const{page:e,pageSize:s,totalPages:n,totalItems:a,goToPage:o,nextPage:r,prevPage:i,changePageSize:u,hasNextPage:d,hasPrevPage:c,startIndex:b,endIndex:h,paginationEnabled:f,pageSizeOptions:p,showSizeChanger:v}=St(),{locale:g,classNames:N}=L(),k=l.useCallback(x=>{u(Number(x.target.value))},[u]),y=l.useCallback(x=>{if(x.key==="Enter"){const C=parseInt(x.target.value,10);!isNaN(C)&&C>=1&&C<=n&&o(C)}},[o,n]),j=l.useMemo(()=>{const x=[];if(n<=5)for(let S=1;S<=n;S++)x.push(S);else{x.push(1),e>3&&x.push("ellipsis");const S=Math.max(2,e-1),P=Math.min(n-1,e+1);for(let m=S;m<=P;m++)x.push(m);e<n-2&&x.push("ellipsis"),n>1&&x.push(n)}return x},[e,n]);return f?t.jsxs("div",{className:`bt-pagination ${N.pagination||""}`,children:[t.jsx("div",{className:"bt-pagination-info",children:a>0?`${b}-${h} ${g.of} ${a} ${g.items}`:`0 ${g.items}`}),t.jsxs("div",{className:"bt-pagination-controls",children:[v&&t.jsxs("div",{className:"bt-page-size",children:[t.jsxs("label",{className:"bt-page-size-label",htmlFor:"bt-page-size",children:[g.rowsPerPage,":"]}),t.jsx("select",{id:"bt-page-size",name:"bt-page-size",className:"bt-page-size-select",value:s,onChange:k,"aria-label":g.rowsPerPage,children:p.map(x=>t.jsx("option",{value:x,children:x},x))})]}),t.jsx("button",{className:"bt-pagination-btn",onClick:i,disabled:!c,"aria-label":g.previousPage,type:"button",children:t.jsx(ln,{})}),t.jsx("div",{className:"bt-pagination-pages",children:j.map((x,C)=>x==="ellipsis"?t.jsx("span",{className:"bt-pagination-ellipsis",children:"..."},`ellipsis-${C}`):t.jsx("button",{className:`bt-pagination-btn ${e===x?"bt-active":""}`,onClick:()=>o(x),"aria-label":`${g.page} ${x}`,"aria-current":e===x?"page":void 0,type:"button",children:x},x))}),t.jsx("button",{className:"bt-pagination-btn",onClick:r,disabled:!d,"aria-label":g.nextPage,type:"button",children:t.jsx(rn,{})}),t.jsxs("div",{className:"bt-quick-jumper",children:[t.jsxs("label",{className:"bt-quick-jumper-label",htmlFor:"bt-quick-jumper",children:[g.page,":"]}),t.jsxs("div",{className:"bt-qj-wrapper",children:[t.jsx("input",{id:"bt-quick-jumper",name:"bt-quick-jumper",type:"number",className:"bt-quick-jumper-input",min:1,max:n,defaultValue:e,onKeyDown:y,"aria-label":g.jumpToPage},e),t.jsx("span",{className:"bt-qj-hint","aria-hidden":"true",children:"↵"})]})]})]})]}):null}function Rt(e){const[s,n]=l.useState(()=>typeof window>"u"?!1:window.matchMedia(e).matches);return l.useEffect(()=>{if(typeof window>"u")return;const a=window.matchMedia(e);n(a.matches);const o=r=>n(r.matches);return a.addEventListener("change",o),()=>a.removeEventListener("change",o)},[e]),s}function gt(){return t.jsxs("svg",{className:"bt-search-svg",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[t.jsx("circle",{cx:"6",cy:"6",r:"4.5",stroke:"currentColor",strokeWidth:"1.5"}),t.jsx("path",{d:"M9.5 9.5L13 13",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}function xt(){return t.jsx("svg",{className:"bt-clear-svg",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:t.jsx("path",{d:"M3 3L9 9M9 3L3 9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}function cn(){return t.jsx("svg",{className:"bt-check-svg",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:t.jsx("path",{d:"M2.5 6L5 8.5L9.5 3.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function dn(){return t.jsx("svg",{className:"bt-filter-toggle-svg",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:t.jsx("path",{d:"M1 2.5H11L7.5 6.5V10L4.5 9V6.5L1 2.5Z",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"})})}function un(){const{searchable:e,searchValue:s,handleSearch:n,clearSearch:a,filters:o,filterPanelOpen:r,toggleFilterPanel:i,hasFilterableColumns:u,filterMode:d}=Q(),{selectable:c,selectedRows:b,selectedCount:h,deselectAll:f}=z(),{data:p,globalActions:v}=E(),{locale:g,classNames:N,columnVisibilityEnabled:k}=L(),y=Rt("(max-width: 640px)"),[j,x]=l.useState(!1),C=l.useRef(null),S=Object.keys(o).length,P=l.useCallback(M=>{n(M.target.value)},[n]),m=l.useCallback(()=>{x(M=>(M?s&&a():setTimeout(()=>C.current?.focus(),50),!M))},[s,a]);l.useEffect(()=>{s&&!j&&x(!0)},[s,j]);const w=u&&(d==="panel"||d==="both");if(!(e||w||k||v&&v.length>0||c&&h>0))return null;const R=y&&e&&!j,O=e&&(!y||j);return t.jsxs("div",{className:T("bt-toolbar",N.toolbar),children:[t.jsxs("div",{className:"bt-toolbar-left",children:[R&&t.jsx("button",{className:"bt-search-toggle",onClick:m,"aria-label":g.search,title:g.search,type:"button",children:t.jsx(gt,{})}),O&&t.jsxs("div",{className:T("bt-search",y&&"bt-search-mobile"),children:[t.jsx("span",{className:"bt-search-icon",children:t.jsx(gt,{})}),t.jsx("input",{id:"bt-search",name:"bt-search",ref:C,type:"text",className:"bt-search-input",placeholder:g.searchPlaceholder,value:s,onChange:P,"aria-label":g.search}),(s||y)&&t.jsx("button",{className:"bt-search-clear",onClick:y?m:a,"aria-label":g.clearSearch,type:"button",children:t.jsx(xt,{})})]}),w&&t.jsxs("button",{className:T("bt-filter-toggle",r&&"bt-filter-toggle-active"),onClick:i,"aria-expanded":r,"aria-label":g.filterBy,title:g.filterBy,type:"button",children:[t.jsx("span",{className:"bt-filter-toggle-icon",children:t.jsx(dn,{})}),!y&&t.jsx("span",{children:g.filterBy}),S>0&&t.jsx("span",{className:"bt-filter-toggle-badge",children:S})]}),t.jsx(an,{}),c&&h>0&&t.jsxs("div",{className:"bt-selection-info",children:[t.jsx(cn,{}),t.jsxs("span",{className:"bt-selection-count",children:[h," ",y?"sel.":g.selected]}),t.jsx("button",{className:"bt-selection-clear",onClick:f,type:"button",children:y?t.jsx(xt,{}):g.deselectAll})]})]}),v&&v.length>0&&t.jsx("div",{className:"bt-toolbar-right",children:t.jsx("div",{className:"bt-global-actions",children:v.map(M=>{const se=M.requiresSelection&&b.length===0;return t.jsxs("button",{className:T("bt-global-btn",M.variant&&`bt-variant-${M.variant}`,y&&"bt-global-btn-mobile"),onClick:()=>M.onClick(b,p),disabled:se,title:M.label,"aria-label":M.label,type:"button",children:[M.icon&&t.jsx("span",{className:"bt-global-icon",children:M.icon}),!y&&t.jsx("span",{children:M.label})]},M.id)})})})]})}const bn=un;function hn(){return t.jsxs("svg",{className:"bt-empty-svg",width:"64",height:"64",viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[t.jsx("rect",{x:"12",y:"18",width:"40",height:"32",rx:"3",stroke:"currentColor",strokeWidth:"2",opacity:"0.3"}),t.jsx("path",{d:"M12 28H52",stroke:"currentColor",strokeWidth:"2",opacity:"0.2"}),t.jsx("path",{d:"M24 38H40",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",opacity:"0.4"}),t.jsx("path",{d:"M28 44H36",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",opacity:"0.25"}),t.jsx("circle",{cx:"32",cy:"12",r:"4",stroke:"currentColor",strokeWidth:"2",opacity:"0.2"})]})}function fn(){const{locale:e,emptyComponent:s}=L(),{visibleColumns:n,rowActions:a}=E(),{selectable:o}=z(),r=a&&a.length>0,i=n.length+(o?1:0)+(r?1:0);return s?t.jsx("tbody",{className:"bt-tbody",children:t.jsx("tr",{className:"bt-tr",children:t.jsx("td",{className:"bt-td",colSpan:i,children:s})})}):t.jsx("tbody",{className:"bt-tbody",children:t.jsx("tr",{className:"bt-tr",children:t.jsx("td",{className:"bt-td",colSpan:i,children:t.jsxs("div",{className:"bt-empty",children:[t.jsx("div",{className:"bt-empty-icon",children:t.jsx(hn,{})}),t.jsx("div",{className:"bt-empty-text",children:e.noData})]})})})})}function pn({show:e}){const{loadingComponent:s,locale:n}=L();return e?t.jsx("div",{className:"bt-loading-overlay",role:"status","aria-live":"polite",children:s||t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"bt-loading-spinner","aria-hidden":"true"}),t.jsx("span",{className:"bt-loading-text",children:n.loading})]})}):null}const mn=['a[href]:not([disabled]):not([tabindex="-1"])','button:not([disabled]):not([tabindex="-1"])','input:not([disabled]):not([tabindex="-1"])','select:not([disabled]):not([tabindex="-1"])','textarea:not([disabled]):not([tabindex="-1"])','[tabindex]:not([tabindex="-1"]):not([disabled])'].join(", ");function gn(e,s){const n=l.useRef(null),a=l.useCallback(()=>e.current?Array.from(e.current.querySelectorAll(mn)):[],[e]);l.useEffect(()=>{if(!s)return;n.current=document.activeElement;const r=setTimeout(()=>{const i=a();i.length>0&&i[0].focus()},0);return()=>{clearTimeout(r),n.current&&typeof n.current.focus=="function"&&n.current.focus()}},[s,a]),l.useEffect(()=>{if(!s)return;const o=r=>{if(r.key!=="Tab")return;const i=a();if(i.length===0)return;const u=i[0],d=i[i.length-1];r.shiftKey?document.activeElement===u&&(r.preventDefault(),d.focus()):document.activeElement===d&&(r.preventDefault(),u.focus())};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[s,a])}function xn(){return t.jsx("svg",{className:"bt-modal-close-svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:t.jsx("path",{d:"M4 4L12 12M12 4L4 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}function vn(){const{isModalOpen:e,modalContent:s,closeModal:n,locale:a}=L(),o=l.useRef(null);gn(o,e);const r=l.useCallback(u=>{u.target===u.currentTarget&&n()},[n]),i=l.useCallback(u=>{u.key==="Escape"&&n()},[n]);return l.useEffect(()=>(e&&(document.addEventListener("keydown",i),document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",i),document.body.style.overflow=""}),[e,i]),!e||!s?null:t.jsx("div",{className:"bt-modal-backdrop",onClick:r,role:"dialog","aria-modal":"true",children:t.jsxs("div",{className:"bt-modal bt-modal-md",ref:o,children:[t.jsxs("div",{className:"bt-modal-header",children:[t.jsx("h2",{className:"bt-modal-title",children:a.details}),t.jsx("button",{className:"bt-modal-close",onClick:n,"aria-label":a.closeModal,type:"button",children:t.jsx(xn,{})})]}),t.jsx("div",{className:"bt-modal-body",children:s})]})})}function jn({startIndex:e,endIndex:s,totalHeight:n,offsetTop:a}){const{processedData:o,rowKey:r}=E(),i=(c,b)=>{if(typeof r=="function")return r(c,b);const h=c[r];return String(h!==void 0?h:b)},u=o.slice(e,s),d=n-a-u.length*(n/o.length);return t.jsxs("tbody",{className:"bt-tbody",children:[a>0&&t.jsx("tr",{"aria-hidden":"true",children:t.jsx("td",{style:{height:a,padding:0,border:"none"}})}),u.map((c,b)=>{const h=e+b;return t.jsx(It,{row:c,rowIndex:h,rowKey:i(c,h)},i(c,h))}),d>0&&t.jsx("tr",{"aria-hidden":"true",children:t.jsx("td",{style:{height:d,padding:0,border:"none"}})})]})}const Cn=jn,he={search:"Search",searchPlaceholder:"Search...",noData:"No data",loading:"Loading...",page:"Page",of:"of",items:"items",selected:"selected",rowsPerPage:"Rows per page",actions:"Actions",sortAsc:"Sort ascending",sortDesc:"Sort descending",filterBy:"Filter by",clearFilters:"Clear filters",dateFrom:"From",dateTo:"To",selectAll:"Select all",deselectAll:"Deselect all",moreActions:"More actions",clearSearch:"Clear search",closeModal:"Close",previousPage:"Previous page",nextPage:"Next page",jumpToPage:"Go to page",details:"Details",columns:"Columns",showAllColumns:"Show all",hideColumn:"Hide column",sortPriority:"Sort priority",clearSort:"Clear sort",resultsFound:"{count} results found",noResultsFound:"No results found",rowsSelected:"{count} rows selected",expandRow:"Expand row",collapseRow:"Collapse row"},Ft={en:he,es:{search:"Buscar",searchPlaceholder:"Buscar...",noData:"No hay datos",loading:"Cargando...",page:"Página",of:"de",items:"elementos",selected:"seleccionados",rowsPerPage:"Filas por página",actions:"Acciones",sortAsc:"Ordenar ascendente",sortDesc:"Ordenar descendente",filterBy:"Filtrar por",clearFilters:"Limpiar filtros",dateFrom:"Desde",dateTo:"Hasta",selectAll:"Seleccionar todo",deselectAll:"Deseleccionar todo",moreActions:"Más acciones",clearSearch:"Limpiar búsqueda",closeModal:"Cerrar",previousPage:"Página anterior",nextPage:"Página siguiente",jumpToPage:"Ir a página",details:"Detalles",columns:"Columnas",showAllColumns:"Mostrar todas",hideColumn:"Ocultar columna",sortPriority:"Prioridad de orden",clearSort:"Quitar orden",resultsFound:"{count} resultados encontrados",noResultsFound:"No se encontraron resultados",rowsSelected:"{count} filas seleccionadas",expandRow:"Expandir fila",collapseRow:"Colapsar fila"},pt:{search:"Pesquisar",searchPlaceholder:"Pesquisar...",noData:"Sem dados",loading:"Carregando...",page:"Página",of:"de",items:"itens",selected:"selecionados",rowsPerPage:"Linhas por página",actions:"Ações",sortAsc:"Ordenar ascendente",sortDesc:"Ordenar descendente",filterBy:"Filtrar por",clearFilters:"Limpar filtros",dateFrom:"De",dateTo:"Até",selectAll:"Selecionar tudo",deselectAll:"Desselecionar tudo",moreActions:"Mais ações",clearSearch:"Limpar pesquisa",closeModal:"Fechar",previousPage:"Página anterior",nextPage:"Próxima página",jumpToPage:"Ir para página",details:"Detalhes",columns:"Colunas",showAllColumns:"Mostrar todas",hideColumn:"Ocultar coluna",sortPriority:"Prioridade de ordem",clearSort:"Remover ordem",resultsFound:"{count} resultados encontrados",noResultsFound:"Nenhum resultado encontrado",rowsSelected:"{count} linhas selecionadas",expandRow:"Expandir linha",collapseRow:"Recolher linha"}};function $t({data:e,initialSort:s,controlledSort:n,onSortChange:a,multiSort:o=!1,controlledMultiSort:r,onMultiSortChange:i,manual:u=!1}){const[d,c]=l.useState(s??{columnId:null,direction:"asc"}),[b,h]=l.useState([]),f=n??d,p=r??b,v=l.useCallback(k=>{if(o){const y=p.findIndex(S=>S.columnId===k);let j;y>=0?p[y].direction==="asc"?(j=[...p],j[y]={columnId:k,direction:"desc"}):j=p.filter((P,m)=>m!==y):j=[...p,{columnId:k,direction:"asc"}],r||h(j),i?.(j);const x=j[0],C=x?{columnId:x.columnId,direction:x.direction}:{columnId:null,direction:"asc"};n||c(C),a?.(C)}else{let y;f.columnId!==k?y={columnId:k,direction:"asc"}:f.direction==="asc"?y={columnId:k,direction:"desc"}:y={columnId:null,direction:"asc"},n||c(y),a?.(y)}},[f,p,n,r,a,i,o]),g=l.useCallback(()=>{const k={columnId:null,direction:"asc"};n||c(k),a?.(k),o&&(r||h([]),i?.([]))},[n,r,a,i,o]);return{sortedData:l.useMemo(()=>u?e:o&&p.length>0?Es(e,p):f.columnId?Mt(e,f.columnId,f.direction):e,[e,f,p,o,u]),sortState:f,handleSort:v,clearSort:g,multiSortState:p,isMultiSort:o}}function zt({data:e,columns:s,initialFilters:n,controlledFilters:a,onFilterChange:o,manual:r=!1}){const[i,u]=l.useState(n??{}),d=a??i,c=l.useCallback((p,v)=>{const g={...d};if(v!==null&&typeof v=="object"&&"from"in v){const N=v;!N.from&&!N.to?delete g[p]:g[p]=v}else v==null||v===""?delete g[p]:g[p]=v;a||u(g),o?.(g)},[d,a,o]),b=l.useCallback(p=>{const v={...d};delete v[p],a||u(v),o?.(v)},[d,a,o]),h=l.useCallback(()=>{a||u({}),o?.({})},[a,o]);return{filteredData:l.useMemo(()=>r?e:Lt(e,d,s),[e,d,s,r]),filters:d,setFilter:c,clearFilters:h,clearFilter:b}}function Ot({data:e,config:s,onPageChange:n,manual:a=!1}){const o=s!==!1,r=s&&typeof s=="object"?s.page??1:1,i=s&&typeof s=="object"?s.pageSize??10:10,u=s&&typeof s=="object"?s.totalItems:void 0,[d,c]=l.useState(r),[b,h]=l.useState(i),f=u??e.length,p=Math.max(1,Math.ceil(f/b)),v=l.useCallback(C=>{const S=Math.max(1,Math.min(C,p));c(S),n?.(S,b)},[p,b,n]),g=l.useCallback(()=>{d<p&&v(d+1)},[d,p,v]),N=l.useCallback(()=>{d>1&&v(d-1)},[d,v]),k=l.useCallback(C=>{h(C),c(1),n?.(1,C)},[n]),y=l.useMemo(()=>{if(!o||a||u!==void 0)return e;const C=(d-1)*b;return e.slice(C,C+b)},[e,d,b,o,a,u]),j=(d-1)*b+1,x=Math.min(d*b,f);return{paginatedData:y,page:d,pageSize:b,totalPages:p,totalItems:f,goToPage:v,nextPage:g,prevPage:N,changePageSize:k,hasNextPage:d<p,hasPrevPage:d>1,startIndex:j,endIndex:x}}function Bt({data:e,rowKey:s,mode:n="multiple",initialSelection:a,controlledSelection:o,onSelectionChange:r}){const[i,u]=l.useState(a??[]),d=o??i,c=l.useCallback((x,C)=>typeof s=="function"?s(x,C):String(x[s]),[s]),b=l.useMemo(()=>new Set(d.map((x,C)=>c(x,C))),[d,c]),h=l.useCallback((x,C)=>{const S=c(x,C);return b.has(S)},[c,b]),f=l.useCallback(x=>{o||u(x),r?.(x)},[o,r]),p=l.useCallback((x,C)=>{const S=c(x,C);let P;n==="single"?P=b.has(S)?[]:[x]:b.has(S)?P=d.filter((m,w)=>c(m,w)!==S):P=[...d,x],f(P)},[n,b,d,c,f]),v=l.useCallback((x,C)=>{if(!h(x,C)){const S=n==="single"?[x]:[...d,x];f(S)}},[h,n,d,f]),g=l.useCallback((x,C)=>{const S=c(x,C),P=d.filter((m,w)=>c(m,w)!==S);f(P)},[d,c,f]),N=l.useCallback(()=>{n==="multiple"&&f([...e])},[e,n,f]),k=l.useCallback(()=>{f([])},[f]),y=e.length>0&&d.length===e.length,j=d.length>0&&d.length<e.length;return{selectedRows:d,isSelected:h,toggleRow:p,selectRow:v,deselectRow:g,selectAll:N,deselectAll:k,isAllSelected:y,isPartiallySelected:j,selectedCount:d.length}}function Wt({data:e,columns:s,searchColumns:n,initialValue:a,controlledValue:o,onSearchChange:r,debounceMs:i=0,manual:u=!1}){const[d,c]=l.useState(a??""),[b,h]=l.useState(a??""),f=l.useRef(null),p=o??d;l.useEffect(()=>{if(i<=0){h(p);return}return f.current=setTimeout(()=>{h(p)},i),()=>{f.current&&clearTimeout(f.current)}},[p,i]);const v=l.useCallback(k=>{o===void 0&&c(k),r?.(k)},[o,r]),g=l.useCallback(()=>{o===void 0&&c(""),f.current&&clearTimeout(f.current),h(""),r?.("")},[o,r]);return{searchedData:l.useMemo(()=>u?e:At(e,b,s,n),[e,b,s,n,u]),searchValue:p,handleSearch:v,clearSearch:g}}function Ht({columns:e,controlledHiddenColumns:s,onColumnVisibilityChange:n}){const[a,o]=l.useState(()=>e.filter(h=>h.hidden).map(h=>h.id)),r=s??a,i=l.useMemo(()=>new Set(r),[r]),u=l.useCallback(h=>{const f=i.has(h)?r.filter(p=>p!==h):[...r,h];s||o(f),n?.(f)},[r,i,s,n]),d=l.useCallback(()=>{s||o([]),n?.([])},[s,n]),c=l.useCallback(h=>!i.has(h),[i]);return{visibleColumns:l.useMemo(()=>e.filter(h=>!i.has(h.id)),[e,i]),hiddenColumnIds:i,toggleColumn:u,showAllColumns:d,isColumnVisible:c,hiddenColumns:r}}const yn=50;function wn({columns:e,enabled:s,minWidth:n=yn,maxWidth:a,onColumnResize:o,tableRef:r}){const[i,u]=l.useState({}),[d,c]=l.useState(!1),b=l.useRef(null),h=l.useCallback(g=>{if(!r.current)return 150;const N=r.current.querySelector(`th[data-column-id="${g}"]`);return N?N.getBoundingClientRect().width:150},[r]),f=l.useCallback((g,N)=>{if(!s)return;const k=i[g]??h(g);b.current={columnId:g,startX:N,startWidth:k},c(!0)},[s,i,h]);l.useEffect(()=>{if(!d)return;const g=k=>{if(!b.current)return;k.preventDefault();const{columnId:y,startX:j,startWidth:x}=b.current,C=k.clientX-j;let S=Math.max(x+C,n);a!==void 0&&(S=Math.min(S,a));const P=e.find(m=>m.id===y);if(P){const m=P.minWidth??n,w=P.maxWidth??a;S=Math.max(S,m),w!==void 0&&(S=Math.min(S,w))}u(m=>({...m,[y]:S}))},N=()=>{if(b.current){const{columnId:k}=b.current,y=i[k];y!==void 0&&o&&o(k,y)}b.current=null,c(!1)};return document.addEventListener("mousemove",g),document.addEventListener("mouseup",N),document.body.style.userSelect="none",document.body.style.cursor="col-resize",()=>{document.removeEventListener("mousemove",g),document.removeEventListener("mouseup",N),document.body.style.userSelect="",document.body.style.cursor=""}},[d,i,e,n,a,o]);const p=l.useCallback(g=>i[g],[i]),v=l.useCallback(()=>{u({})},[]);return{columnWidths:i,isResizing:d,startResize:f,getColumnWidth:p,resetColumnWidths:v}}function kn({containerRef:e,itemCount:s,rowHeight:n,buffer:a,enabled:o}){const[r,i]=l.useState(0),[u,d]=l.useState(0);l.useEffect(()=>{if(!o)return;const b=e.current;if(!b)return;const h=()=>{i(b.scrollTop)};d(b.clientHeight),i(b.scrollTop),b.addEventListener("scroll",h,{passive:!0});const f=new ResizeObserver(p=>{for(const v of p)d(v.contentRect.height)});return f.observe(b),()=>{b.removeEventListener("scroll",h),f.disconnect()}},[e,o]);const c=l.useCallback(()=>{e.current&&(e.current.scrollTop=0,i(0))},[e]);return l.useEffect(()=>{o&&c()},[s,o,c]),l.useMemo(()=>{if(!o||s===0)return{totalHeight:0,startIndex:0,endIndex:s,offsetTop:0};const b=s*n,h=Math.floor(r/n),f=Math.ceil(u/n),p=Math.max(0,h-a),v=Math.min(s,h+f+a),g=p*n;return{totalHeight:b,startIndex:p,endIndex:v,offsetTop:g}},[o,s,n,r,u,a])}function Sn({controlledExpandedRows:e,onExpandChange:s,accordion:n=!1}){const[a,o]=l.useState([]),r=e!==void 0,i=r?e:a,u=l.useMemo(()=>new Set(i),[i]),d=l.useCallback(f=>{r||o(f),s?.(f)},[r,s]),c=l.useCallback(f=>u.has(f),[u]),b=l.useCallback(f=>{u.has(f)?d(i.filter(p=>p!==f)):d(n?[f]:[...i,f])},[u,i,n,d]),h=l.useCallback(()=>{d([])},[d]);return{expandedRowKeys:u,isExpanded:c,toggleExpand:b,collapseAll:h}}const Nn=500,Tn=48,Pn=5;function Dn(e){const{data:s,columns:n,rowKey:a="id",rowActions:o,globalActions:r,maxVisibleActions:i=3,pagination:u={pageSize:10},onPageChange:d,sort:c,onSortChange:b,multiSort:h=!1,multiSortState:f,onMultiSortChange:p,filters:v,onFilterChange:g,filterMode:N="floating",searchable:k=!1,searchValue:y,onSearchChange:j,searchColumns:x,searchDebounceMs:C=300,manualSorting:S=!1,manualFiltering:P=!1,manualPagination:m=!1,selectable:w,selectedRows:A,onSelectionChange:R,selectionMode:O="multiple",columnVisibility:M=!1,hiddenColumns:se,onColumnVisibilityChange:Vt,loading:H=!1,loadingComponent:fe,emptyComponent:pe,classNames:X={},styles:me={},locale:V,stickyHeader:ge=!1,maxHeight:xe,bordered:ne=!1,striped:ae=!1,hoverable:le=!0,size:ie="medium",onRowClick:ve,onRowDoubleClick:je,resizable:U=!1,onColumnResize:Ut,minColumnWidth:_t,maxColumnWidth:qt,expandable:_,expandedRows:Kt,onExpandChange:Zt,ariaLabel:Qt,ariaDescribedBy:Xt,virtualize:re,rowHeight:Gt=Tn,virtualBuffer:Jt=Pn}=e,q=l.useMemo(()=>w!==void 0?w:r?.some(be=>be.requiresSelection)||R!==void 0,[w,r,R]),B=l.useMemo(()=>({...typeof V=="string"?Ft[V]:he,...typeof V=="object"?V:{}}),[V]),[Ce,ye]=l.useState(!1),[we,ke]=l.useState(null),[oe,Yt]=l.useState(!1),Se=l.useCallback(()=>{Yt(D=>!D)},[]),Ne=l.useMemo(()=>n.some(D=>D.filterable!==!1&&D.type!=="custom"&&!D.hidden),[n]),Te=l.useCallback(D=>{ke(D),ye(!0)},[]),Pe=l.useCallback(()=>{ye(!1),ke(null)},[]),F=l.useMemo(()=>u===!1?!1:{pageSize:10,pageSizeOptions:[10,20,50,100],showSizeChanger:!1,...u},[u]),{searchedData:es,searchValue:G,handleSearch:De,clearSearch:Me}=Wt({data:s,columns:n,searchColumns:x,controlledValue:y,onSearchChange:j,debounceMs:C,manual:P}),{filteredData:ts,filters:J,setFilter:Le,clearFilter:Ae,clearFilters:Ee}=zt({data:es,columns:n,controlledFilters:v,onFilterChange:g,manual:P}),{sortedData:$,sortState:Ie,handleSort:Re,clearSort:Fe,multiSortState:$e,isMultiSort:ze}=$t({data:ts,controlledSort:c,onSortChange:b,multiSort:h,controlledMultiSort:f,onMultiSortChange:p,manual:S}),{visibleColumns:Y,hiddenColumnIds:Oe,toggleColumn:Be,showAllColumns:We,isColumnVisible:He}=Ht({columns:n,controlledHiddenColumns:se,onColumnVisibilityChange:Vt}),{selectedRows:Ve,isSelected:Ue,toggleRow:_e,selectAll:qe,deselectAll:Ke,isAllSelected:Ze,isPartiallySelected:Qe,selectedCount:K}=Bt({data:$,rowKey:a,mode:O,controlledSelection:A,onSelectionChange:R}),{paginatedData:ss,page:Xe,pageSize:Ge,totalPages:Je,totalItems:Ye,goToPage:et,nextPage:tt,prevPage:st,changePageSize:nt,hasNextPage:at,hasPrevPage:lt,startIndex:it,endIndex:rt}=Ot({data:$,config:F,onPageChange:d,manual:m}),ce=u===!1,ee=l.useMemo(()=>re!==void 0?re:ce&&$.length>Nn,[re,ce,$.length]),ot=l.useRef(null),ct=l.useRef(null),{columnWidths:dt,isResizing:ut,startResize:bt,getColumnWidth:de}=wn({columns:Y,enabled:U,minWidth:_t,maxWidth:qt,onColumnResize:Ut,tableRef:ct}),{isExpanded:ht,toggleExpand:ft}=Sn({controlledExpandedRows:Kt,onExpandChange:Zt,accordion:_?.accordion}),Z=ce?$:ss,{totalHeight:ns,startIndex:as,endIndex:ls,offsetTop:is}=kn({containerRef:ot,itemCount:Z.length,rowHeight:Gt,buffer:Jt,enabled:ee}),rs=l.useMemo(()=>({data:s,processedData:Z,columns:n,visibleColumns:Y,rowKey:a,rowActions:o,globalActions:r,maxVisibleActions:i,expandableRender:_?.render,isExpanded:ht,toggleExpand:ft,expandableEnabled:_!==void 0}),[s,Z,n,Y,a,o,r,i,_,ht,ft]),os=l.useMemo(()=>({sortState:Ie,handleSort:Re,multiSortState:$e,isMultiSort:ze,clearSort:Fe}),[Ie,Re,$e,ze,Fe]),cs=l.useMemo(()=>({filters:J,setFilter:Le,clearFilter:Ae,clearFilters:Ee,searchValue:G,handleSearch:De,clearSearch:Me,searchable:k,filterPanelOpen:oe,toggleFilterPanel:Se,hasFilterableColumns:Ne,filterMode:N}),[J,Le,Ae,Ee,G,De,Me,k,oe,Se,Ne,N]),ds=l.useMemo(()=>({selectedRows:Ve,isSelected:Ue,toggleRow:_e,selectAll:qe,deselectAll:Ke,isAllSelected:Ze,isPartiallySelected:Qe,selectedCount:K,selectable:q,selectionMode:O}),[Ve,Ue,_e,qe,Ke,Ze,Qe,K,q,O]),us=l.useMemo(()=>({page:Xe,pageSize:Ge,totalPages:Je,totalItems:Ye,goToPage:et,nextPage:tt,prevPage:st,changePageSize:nt,hasNextPage:at,hasPrevPage:lt,startIndex:it,endIndex:rt,paginationEnabled:u!==!1,pageSizeOptions:F&&typeof F=="object"?F.pageSizeOptions??[10,20,50,100]:[10,20,50,100],showSizeChanger:F&&typeof F=="object"?F.showSizeChanger??!1:!1}),[Xe,Ge,Je,Ye,et,tt,st,nt,at,lt,it,rt,u,F]),bs=l.useMemo(()=>({locale:B,classNames:X,size:ie,bordered:ne,striped:ae,hoverable:le,stickyHeader:ge,loading:H,loadingComponent:fe,emptyComponent:pe,onRowClick:ve,onRowDoubleClick:je,openModal:Te,closeModal:Pe,modalContent:we,isModalOpen:Ce,columnVisibilityEnabled:M,hiddenColumnIds:Oe,toggleColumn:Be,showAllColumns:We,isColumnVisible:He,columns:n,resizable:U,columnWidths:dt,isResizing:ut,startResize:bt,getColumnWidth:de}),[B,X,ie,ne,ae,le,ge,H,fe,pe,ve,je,Te,Pe,we,Ce,M,Oe,Be,We,He,n,U,dt,ut,bt,de]),ue=Z.length>0,hs=Rt("(max-width: 640px)"),fs=l.useMemo(()=>{const D=[],W=G.length>0,be=Object.keys(J).length>0;return(W||be)&&($.length===0?D.push(B.noResultsFound):D.push(B.resultsFound.replace("{count}",String($.length)))),q&&K>0&&D.push(B.rowsSelected.replace("{count}",String(K))),D.join(". ")},[$.length,G,J,q,K,B]);return t.jsx(Tt,{data:rs,sort:os,filter:cs,selection:ds,pagination:us,ui:bs,children:t.jsxs("div",{className:T("bt-container",`bt-size-${ie}`,ae&&"bt-striped",ne&&"bt-bordered",le&&"bt-hoverable",H&&"bt-container-loading",X.container),style:me.container,children:[t.jsx(bn,{}),(N==="panel"||N==="both")&&t.jsx(en,{open:oe}),t.jsxs("div",{ref:ot,className:"bt-table-wrapper",style:{maxHeight:xe,...ee&&!xe?{maxHeight:"80vh",overflow:"auto"}:{}},children:[hs?ue&&t.jsx(Xs,{}):t.jsxs("table",{ref:ct,className:T("bt-table",U&&"bt-table-resizable",X.table),style:me.table,role:"grid","aria-label":Qt,"aria-describedby":Xt,"aria-busy":H,"aria-rowcount":ee?Z.length:void 0,children:[U&&t.jsxs("colgroup",{children:[_&&t.jsx("col",{style:{width:40}}),q&&t.jsx("col",{style:{width:40}}),Y.map(D=>{const W=de(D.id);return t.jsx("col",{style:W!==void 0?{width:W}:D.width!==void 0?{width:D.width}:void 0},D.id)}),o&&o.length>0&&t.jsx("col",{})]}),t.jsx(As,{}),ue?ee?t.jsx(Cn,{startIndex:as,endIndex:ls,totalHeight:ns,offsetTop:is}):t.jsx(_s,{}):t.jsx(fn,{})]}),t.jsx(pn,{show:H&&ue})]}),u!==!1&&t.jsx(on,{}),t.jsx(vn,{}),t.jsx("div",{"aria-live":"polite","aria-atomic":"true",className:"bt-sr-only",children:fs})]})})}const Mn=Dn;exports.BetterTable=Mn;exports.TableProvider=Tt;exports.defaultLocale=he;exports.filterData=Lt;exports.getValueFromPath=I;exports.locales=Ft;exports.searchData=At;exports.sortData=Mt;exports.useColumnVisibility=Ht;exports.useTableData=E;exports.useTableFilter=zt;exports.useTableFilterContext=Q;exports.useTablePagination=Ot;exports.useTablePaginationContext=St;exports.useTableSearch=Wt;exports.useTableSelection=Bt;exports.useTableSelectionContext=z;exports.useTableSort=$t;exports.useTableSortContext=Ct;exports.useTableUI=L;
2
2
  //# sourceMappingURL=better-table.cjs.js.map