@superdangerous/app-framework 4.16.35 → 4.16.37

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.
@@ -0,0 +1,457 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import React__default, { ReactNode } from 'react';
3
+
4
+ interface UsePaginationOptions<T> {
5
+ data: T[];
6
+ pageSize?: number;
7
+ storageKey?: string;
8
+ }
9
+ interface UsePaginationResult<T> {
10
+ paginatedData: T[];
11
+ page: number;
12
+ pageSize: number;
13
+ totalPages: number;
14
+ totalItems: number;
15
+ setPage: (page: number) => void;
16
+ setPageSize: (size: number) => void;
17
+ nextPage: () => void;
18
+ prevPage: () => void;
19
+ firstPage: () => void;
20
+ lastPage: () => void;
21
+ startIndex: number;
22
+ endIndex: number;
23
+ canGoNext: boolean;
24
+ canGoPrev: boolean;
25
+ pageSizeOptions: number[];
26
+ }
27
+ declare function usePagination<T>({ data, pageSize: initialPageSize, storageKey, }: UsePaginationOptions<T>): UsePaginationResult<T>;
28
+
29
+ interface ColumnConfig$1 {
30
+ id: string;
31
+ label: string;
32
+ defaultVisible?: boolean;
33
+ locked?: boolean;
34
+ }
35
+ interface ColumnVisibilityState {
36
+ [key: string]: boolean;
37
+ }
38
+ interface UseColumnVisibilityOptions {
39
+ columns: ColumnConfig$1[];
40
+ storageKey: string;
41
+ }
42
+ interface UseColumnVisibilityReturn {
43
+ visibleColumns: ColumnVisibilityState;
44
+ isColumnVisible: (columnId: string) => boolean;
45
+ toggleColumn: (columnId: string) => void;
46
+ showAllColumns: () => void;
47
+ hideAllColumns: () => void;
48
+ columns: ColumnConfig$1[];
49
+ }
50
+ declare function useColumnVisibility({ columns, storageKey, }: UseColumnVisibilityOptions): UseColumnVisibilityReturn;
51
+
52
+ interface ColumnConfig {
53
+ key: string;
54
+ minWidth?: number;
55
+ maxWidth?: number;
56
+ defaultWidth?: number;
57
+ }
58
+ interface UseResizableColumnsOptions {
59
+ tableId: string;
60
+ columns: ColumnConfig[];
61
+ storageKey?: string;
62
+ }
63
+ interface ResizableColumnResult {
64
+ widths: Record<string, number>;
65
+ isResizing: boolean;
66
+ totalWidth: number;
67
+ getResizeHandleProps: (columnKey: string) => {
68
+ onPointerDown: (e: React.PointerEvent) => void;
69
+ onMouseDown: (e: React.MouseEvent) => void;
70
+ draggable: boolean;
71
+ onDragStart: (e: React.DragEvent) => void;
72
+ className: string;
73
+ 'data-resizing': boolean;
74
+ };
75
+ getColumnStyle: (columnKey: string) => React.CSSProperties;
76
+ getTableStyle: () => React.CSSProperties;
77
+ resetToDefaults: () => void;
78
+ }
79
+ declare function useResizableColumns({ tableId, columns, storageKey, }: UseResizableColumnsOptions): ResizableColumnResult;
80
+
81
+ interface ColumnOrderConfig {
82
+ id: string;
83
+ label: string;
84
+ locked?: boolean;
85
+ }
86
+ interface UseColumnOrderOptions {
87
+ storageKey: string;
88
+ defaultOrder: string[];
89
+ }
90
+ interface UseColumnOrderReturn {
91
+ columnOrder: string[];
92
+ moveColumn: (fromIndex: number, toIndex: number) => void;
93
+ moveColumnById: (columnId: string, direction: 'left' | 'right') => void;
94
+ resetOrder: () => void;
95
+ getOrderedColumns: <T extends {
96
+ id: string;
97
+ }>(columns: T[]) => T[];
98
+ }
99
+ /**
100
+ * Hook for managing column order with localStorage persistence
101
+ */
102
+ declare function useColumnOrder({ storageKey, defaultOrder, }: UseColumnOrderOptions): UseColumnOrderReturn;
103
+ /**
104
+ * Drag and drop helpers for column reordering
105
+ */
106
+ interface DragState {
107
+ isDragging: boolean;
108
+ draggedId: string | null;
109
+ dropIndex: number | null;
110
+ }
111
+ declare function useColumnDragDrop(columnOrder: string[], moveColumn: (from: number, to: number) => void, lockedColumns?: string[]): {
112
+ dragState: DragState;
113
+ getDragHandleProps: (columnId: string) => {
114
+ draggable: boolean;
115
+ onDragStart: (e: React.DragEvent) => void;
116
+ onDragOver: (e: React.DragEvent) => void;
117
+ onDrop: (e: React.DragEvent) => void;
118
+ onDragEnd: () => void;
119
+ };
120
+ showDropIndicator: (columnId: string) => boolean;
121
+ };
122
+
123
+ /**
124
+ * Column width configuration
125
+ */
126
+ interface ColumnWidth {
127
+ default: number;
128
+ min: number;
129
+ max?: number;
130
+ }
131
+ /**
132
+ * Column visibility configuration
133
+ */
134
+ interface ColumnVisibility$1 {
135
+ default: boolean;
136
+ locked?: boolean;
137
+ }
138
+ /**
139
+ * Props passed to header cell render function
140
+ */
141
+ interface HeaderCellProps {
142
+ columnId: string;
143
+ isSorted: boolean;
144
+ sortDirection?: 'asc' | 'desc';
145
+ }
146
+ /**
147
+ * Props passed to cell render function
148
+ */
149
+ interface CellProps {
150
+ columnId: string;
151
+ isDragging: boolean;
152
+ }
153
+ /**
154
+ * Column definition for DataTable
155
+ */
156
+ interface ColumnDef<T> {
157
+ /** Unique column identifier */
158
+ id: string;
159
+ /** Header content - string or render function */
160
+ header: string | ((props: HeaderCellProps) => ReactNode);
161
+ /** Cell content render function */
162
+ cell: (item: T, props: CellProps) => ReactNode;
163
+ /** Key to use for sorting (if sortable) */
164
+ sortKey?: string;
165
+ /** Width configuration */
166
+ width?: ColumnWidth;
167
+ /** Visibility configuration */
168
+ visibility?: ColumnVisibility$1;
169
+ /** Additional CSS class for cells */
170
+ className?: string;
171
+ /** Whether this column should use column style from resize hook */
172
+ resizable?: boolean;
173
+ }
174
+ /**
175
+ * External pagination state (from usePagination hook)
176
+ */
177
+ interface ExternalPaginationState<T> {
178
+ paginatedData: T[];
179
+ page: number;
180
+ pageSize: number;
181
+ totalPages: number;
182
+ totalItems: number;
183
+ startIndex: number;
184
+ endIndex: number;
185
+ canGoNext: boolean;
186
+ canGoPrev: boolean;
187
+ pageSizeOptions: number[];
188
+ setPage: (page: number) => void;
189
+ setPageSize: (size: number) => void;
190
+ nextPage: () => void;
191
+ prevPage: () => void;
192
+ }
193
+ /**
194
+ * DataTable props
195
+ */
196
+ interface DataTableProps<T> {
197
+ /** Data array to display */
198
+ data: T[];
199
+ /** Column definitions */
200
+ columns: ColumnDef<T>[];
201
+ /** Storage key for persisting table state (column widths, order, visibility) */
202
+ storageKey: string;
203
+ /** Function to get unique ID from item */
204
+ getRowId: (item: T) => string;
205
+ /** Enable row selection with checkboxes */
206
+ selectable?: boolean;
207
+ /** Set of selected row IDs */
208
+ selectedIds?: Set<string>;
209
+ /** Callback when selection changes */
210
+ onSelectionChange?: (ids: Set<string>) => void;
211
+ /** Callback when row is clicked */
212
+ onRowClick?: (item: T) => void;
213
+ /** Callback when row is right-clicked (for context menu) */
214
+ onRowContextMenu?: (item: T, position: {
215
+ x: number;
216
+ y: number;
217
+ }) => void;
218
+ /** Current sort field */
219
+ sortField?: string;
220
+ /** Current sort order */
221
+ sortOrder?: 'asc' | 'desc';
222
+ /** Callback when sort changes */
223
+ onSort?: (field: string) => void;
224
+ /** Render function for actions column (always last, sticky) */
225
+ actionsColumn?: (item: T) => ReactNode;
226
+ /** Width for actions column */
227
+ actionsColumnWidth?: number;
228
+ /** Page size for pagination (used when no external pagination provided) */
229
+ pageSize?: number;
230
+ /** External pagination state from usePagination hook (overrides internal pagination) */
231
+ pagination?: ExternalPaginationState<T>;
232
+ /** Hide the built-in pagination controls (use when pagination is shown elsewhere) */
233
+ hidePagination?: boolean;
234
+ /** Additional CSS class for table container */
235
+ className?: string;
236
+ /** Function to compute row CSS class */
237
+ rowClassName?: (item: T) => string;
238
+ /** Enable header right-click for column visibility menu */
239
+ enableHeaderContextMenu?: boolean;
240
+ /** Columns that cannot be reordered */
241
+ lockedColumns?: string[];
242
+ /** Default column order (if not persisted) */
243
+ defaultColumnOrder?: string[];
244
+ /** Show loading indicator */
245
+ loading?: boolean;
246
+ /** Content to show when no data */
247
+ emptyState?: ReactNode;
248
+ }
249
+ /**
250
+ * Column config for visibility hook (for compatibility)
251
+ */
252
+ interface ColumnConfigCompat {
253
+ id: string;
254
+ label: string;
255
+ defaultVisible?: boolean;
256
+ locked?: boolean;
257
+ }
258
+ /**
259
+ * Column config for resize hook (for compatibility)
260
+ */
261
+ interface ColumnSizeConfig {
262
+ key: string;
263
+ defaultWidth: number;
264
+ minWidth: number;
265
+ maxWidth?: number;
266
+ }
267
+
268
+ /**
269
+ * DataTable - Generic data table with full feature set
270
+ *
271
+ * Features:
272
+ * - Column resizing (drag handles)
273
+ * - Column reordering (drag-drop)
274
+ * - Column visibility toggle
275
+ * - Row selection with checkboxes
276
+ * - Sorting
277
+ * - Pagination
278
+ * - Sticky actions column
279
+ * - Context menu support
280
+ * - Header context menu for column visibility
281
+ */
282
+ declare function DataTable<T>({ data, columns, storageKey, getRowId, selectable, selectedIds, onSelectionChange, onRowClick, onRowContextMenu, sortField, sortOrder, onSort, actionsColumn, actionsColumnWidth, pageSize, pagination: externalPagination, hidePagination, className, rowClassName, enableHeaderContextMenu, lockedColumns, defaultColumnOrder, loading, emptyState, }: DataTableProps<T>): react_jsx_runtime.JSX.Element;
283
+
284
+ /**
285
+ * PaginationControls - Compact inline pagination for table headers
286
+ *
287
+ * A condensed version of pagination controls designed to sit alongside
288
+ * search/filter controls in a table header bar.
289
+ */
290
+ interface PaginationControlsProps {
291
+ page: number;
292
+ pageSize: number;
293
+ totalPages: number;
294
+ totalItems: number;
295
+ startIndex: number;
296
+ endIndex: number;
297
+ canGoNext: boolean;
298
+ canGoPrev: boolean;
299
+ pageSizeOptions: number[];
300
+ setPage: (page: number) => void;
301
+ setPageSize: (size: number) => void;
302
+ nextPage: () => void;
303
+ prevPage: () => void;
304
+ className?: string;
305
+ }
306
+ declare function PaginationControls({ page, pageSize, totalPages, totalItems, startIndex, endIndex, canGoNext, canGoPrev, pageSizeOptions, setPage: _setPage, setPageSize, nextPage, prevPage, className, }: PaginationControlsProps): react_jsx_runtime.JSX.Element | null;
307
+
308
+ interface FilterOption$1 {
309
+ id: string;
310
+ label: string;
311
+ render: () => React__default.ReactNode;
312
+ }
313
+ interface DataTablePageProps {
314
+ /** Page title */
315
+ title: string;
316
+ /** Page description */
317
+ description?: string;
318
+ /** Search term */
319
+ search?: string;
320
+ /** Search change handler */
321
+ onSearchChange?: (value: string) => void;
322
+ /** Search placeholder text */
323
+ searchPlaceholder?: string;
324
+ /** Filter options for popover */
325
+ filters?: FilterOption$1[];
326
+ /** Number of active filters */
327
+ activeFilterCount?: number;
328
+ /** Clear all filters handler */
329
+ onClearFilters?: () => void;
330
+ /** Pagination props from usePagination hook */
331
+ pagination?: PaginationControlsProps;
332
+ /** Extra content to render next to the title (e.g. HelpTooltip) */
333
+ titleExtra?: React__default.ReactNode;
334
+ /** Action buttons to show in the header */
335
+ actions?: React__default.ReactNode;
336
+ /** Content before the table (e.g., BatchActionsBar) */
337
+ beforeTable?: React__default.ReactNode;
338
+ /** The DataTable component */
339
+ children: React__default.ReactNode;
340
+ /** Additional class for the container */
341
+ className?: string;
342
+ /** Whether to show a loading state */
343
+ loading?: boolean;
344
+ /** Loading component to show */
345
+ loadingComponent?: React__default.ReactNode;
346
+ }
347
+ declare function DataTablePage({ title, description, titleExtra, search, onSearchChange, searchPlaceholder, filters, activeFilterCount, onClearFilters, pagination, actions, beforeTable, children, className, loading, loadingComponent, }: DataTablePageProps): react_jsx_runtime.JSX.Element;
348
+
349
+ interface PaginationProps {
350
+ page: number;
351
+ pageSize: number;
352
+ totalPages: number;
353
+ totalItems: number;
354
+ startIndex: number;
355
+ endIndex: number;
356
+ canGoNext: boolean;
357
+ canGoPrev: boolean;
358
+ pageSizeOptions: number[];
359
+ onPageChange: (page: number) => void;
360
+ onPageSizeChange: (size: number) => void;
361
+ onNextPage: () => void;
362
+ onPrevPage: () => void;
363
+ onFirstPage: () => void;
364
+ onLastPage: () => void;
365
+ className?: string;
366
+ }
367
+ declare function Pagination({ page, pageSize, totalPages, totalItems, startIndex, endIndex, canGoNext, canGoPrev, pageSizeOptions, onPageChange, onPageSizeChange, onNextPage, onPrevPage, onFirstPage, onLastPage, className, }: PaginationProps): react_jsx_runtime.JSX.Element | null;
368
+
369
+ interface BatchActionsBarProps {
370
+ /** Number of selected items */
371
+ selectedCount: number;
372
+ /** Callback to clear selection */
373
+ onClear: () => void;
374
+ /** Action buttons to display on the right side */
375
+ children: ReactNode;
376
+ /** Label for the selected items (default: "item"/"items") */
377
+ itemLabel?: string;
378
+ /** Additional CSS classes */
379
+ className?: string;
380
+ }
381
+ /**
382
+ * A horizontal bar that appears when items are selected,
383
+ * showing the count and providing batch action buttons.
384
+ */
385
+ declare function BatchActionsBar({ selectedCount, onClear, children, itemLabel, className, }: BatchActionsBarProps): react_jsx_runtime.JSX.Element | null;
386
+
387
+ interface ColumnVisibilityProps {
388
+ columns: ColumnConfig$1[];
389
+ isColumnVisible: (columnId: string) => boolean;
390
+ toggleColumn: (columnId: string) => void;
391
+ showAllColumns: () => void;
392
+ hideAllColumns: () => void;
393
+ }
394
+ declare function ColumnVisibility({ columns, isColumnVisible, toggleColumn, showAllColumns, hideAllColumns, }: ColumnVisibilityProps): react_jsx_runtime.JSX.Element;
395
+
396
+ interface FilterOption {
397
+ id: string;
398
+ label: string;
399
+ render: () => React__default.ReactNode;
400
+ /** Filter type - 'multi' filters get more horizontal space */
401
+ type?: 'single' | 'multi';
402
+ }
403
+ interface TableFiltersProps {
404
+ search?: string;
405
+ onSearchChange?: (value: string) => void;
406
+ searchPlaceholder?: string;
407
+ filters?: FilterOption[];
408
+ activeFilterCount?: number;
409
+ onClearFilters?: () => void;
410
+ className?: string;
411
+ children?: React__default.ReactNode;
412
+ }
413
+ /**
414
+ * TableFilters - Compact filter controls for data tables
415
+ *
416
+ * Features:
417
+ * - Search input
418
+ * - Popover filter menu with badge showing active count
419
+ * - Clear all filters button
420
+ * - Custom filter components via render prop
421
+ * - Children slot for additional action buttons
422
+ */
423
+ declare function TableFilters({ search, onSearchChange, searchPlaceholder, filters, activeFilterCount, onClearFilters, className, children, }: TableFiltersProps): react_jsx_runtime.JSX.Element;
424
+
425
+ interface MultiSelectOption<T extends string = string> {
426
+ /** Unique value for this option */
427
+ value: T;
428
+ /** Display label */
429
+ label: string;
430
+ /** Optional custom render for the label (e.g., with icon/flag) */
431
+ render?: () => React__default.ReactNode;
432
+ }
433
+ interface MultiSelectFilterProps<T extends string = string> {
434
+ /** Available options to select from */
435
+ options: MultiSelectOption<T>[];
436
+ /** Currently selected values */
437
+ selected: Set<T>;
438
+ /** Called when selection changes */
439
+ onChange: (selected: Set<T>) => void;
440
+ /** Maximum height before scrolling (default: 200px) */
441
+ maxHeight?: number;
442
+ /** Number of columns for grid layout (default: 2) */
443
+ columns?: 1 | 2 | 3;
444
+ /** Show select all / clear buttons */
445
+ showBulkActions?: boolean;
446
+ /** Optional className for the container */
447
+ className?: string;
448
+ }
449
+ /**
450
+ * MultiSelectFilter - A checkbox-based multi-select filter component
451
+ *
452
+ * Designed to work with the TableFilters popover for filtering data tables.
453
+ * Supports custom rendering per option (for flags, badges, icons, etc.)
454
+ */
455
+ declare function MultiSelectFilter<T extends string = string>({ options, selected, onChange, maxHeight, columns, showBulkActions, className, }: MultiSelectFilterProps<T>): react_jsx_runtime.JSX.Element;
456
+
457
+ export { BatchActionsBar, type BatchActionsBarProps, type CellProps, type ColumnConfig$1 as ColumnConfig, type ColumnConfigCompat, type ColumnDef, type ColumnOrderConfig, type ColumnSizeConfig, ColumnVisibility, type ColumnVisibility$1 as ColumnVisibilityConfig, type ColumnVisibilityState, type ColumnWidth, DataTable, DataTablePage, type DataTablePageProps, type DataTableProps, type DragState, type ExternalPaginationState, type FilterOption$1 as FilterOption, type HeaderCellProps, MultiSelectFilter, type MultiSelectFilterProps, type MultiSelectOption, Pagination, PaginationControls, type PaginationControlsProps, type ResizableColumnResult, type FilterOption as TableFilterOption, TableFilters, type TableFiltersProps, useColumnDragDrop, useColumnOrder, useColumnVisibility, usePagination, useResizableColumns };
@@ -0,0 +1,2 @@
1
+ 'use strict';var G=require('react'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),jsxRuntime=require('react/jsx-runtime'),ee=require('@radix-ui/react-tooltip'),lucideReact=require('lucide-react'),reactSlot=require('@radix-ui/react-slot'),classVarianceAuthority=require('class-variance-authority'),x=require('@radix-ui/react-select'),_=require('@radix-ui/react-popover'),P=require('@radix-ui/react-dropdown-menu'),Pe=require('@radix-ui/react-checkbox');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var G__namespace=/*#__PURE__*/_interopNamespace(G);var ee__namespace=/*#__PURE__*/_interopNamespace(ee);var x__namespace=/*#__PURE__*/_interopNamespace(x);var ___namespace=/*#__PURE__*/_interopNamespace(_);var P__namespace=/*#__PURE__*/_interopNamespace(P);var Pe__namespace=/*#__PURE__*/_interopNamespace(Pe);var Ft=25,Gt=[10,25,50,100];function Ne({data:e,pageSize:t=Ft,storageKey:o}){let[r,m]=G.useState(()=>{if(o)try{let b=localStorage.getItem(`pagination-${o}`);if(b)return {page:1,pageSize:JSON.parse(b).pageSize||t}}catch{}return {page:1,pageSize:t}}),{page:c,pageSize:f}=r,u=G.useMemo(()=>Math.max(1,Math.ceil(e.length/f)),[e.length,f]);G.useEffect(()=>{c>u&&m(b=>({...b,page:Math.max(1,u)}));},[u,c]),G.useEffect(()=>{if(o)try{localStorage.setItem(`pagination-${o}`,JSON.stringify({pageSize:f}));}catch{}},[f,o]);let g=(c-1)*f,a=Math.min(g+f,e.length),l=G.useMemo(()=>e.slice(g,a),[e,g,a]),s=G.useCallback(b=>{m(T=>({...T,page:Math.max(1,Math.min(b,u))}));},[u]),p=G.useCallback(b=>{m({page:1,pageSize:b});},[]),d=G.useCallback(()=>{s(c+1);},[c,s]),v=G.useCallback(()=>{s(c-1);},[c,s]),k=G.useCallback(()=>{s(1);},[s]),B=G.useCallback(()=>{s(u);},[u,s]);return {paginatedData:l,page:c,pageSize:f,totalPages:u,totalItems:e.length,setPage:s,setPageSize:p,nextPage:d,prevPage:v,firstPage:k,lastPage:B,startIndex:g+1,endIndex:a,canGoNext:c<u,canGoPrev:c>1,pageSizeOptions:Gt}}function Re({columns:e,storageKey:t}){let o=`column-visibility-${t}`,[r,m]=G.useState(()=>{let a={};if(e.forEach(l=>{a[l.id]=l.defaultVisible!==false;}),typeof window>"u")return a;try{let l=localStorage.getItem(o);if(l){let s=JSON.parse(l),p={};return e.forEach(d=>{d.locked?p[d.id]=!0:s[d.id]!==void 0?p[d.id]=s[d.id]:p[d.id]=d.defaultVisible!==!1;}),p}}catch(l){console.error("Error loading column visibility state:",l);}return a});G.useEffect(()=>{if(!(typeof window>"u"))try{localStorage.setItem(o,JSON.stringify(r));}catch(a){console.error("Error saving column visibility state:",a);}},[r,o]);let c=G.useCallback(a=>e.find(s=>s.id===a)?.locked?true:r[a]!==false,[r,e]),f=G.useCallback(a=>{e.find(s=>s.id===a)?.locked||m(s=>({...s,[a]:!s[a]}));},[e]),u=G.useCallback(()=>{let a={};e.forEach(l=>{a[l.id]=true;}),m(a);},[e]),g=G.useCallback(()=>{let a={};e.forEach(l=>{a[l.id]=l.locked===true;}),m(a);},[e]);return {visibleColumns:r,isColumnVisible:c,toggleColumn:f,showAllColumns:u,hideAllColumns:g,columns:e}}var it=50,De=150,$t=3;function Me({tableId:e,columns:t,storageKey:o}){let r=o||`table-columns-${e}`,m=G.useCallback(()=>t.reduce((y,h)=>(y[h.key]=h.defaultWidth||De,y),{}),[t]),[c,f]=G.useState(()=>{try{let y=localStorage.getItem(r);if(y){let h=JSON.parse(y);return {widths:{...m(),...h},isResizing:!1,resizingColumn:null}}}catch{}return {widths:m(),isResizing:false,resizingColumn:null}}),u=G.useRef(0),g=G.useRef(0),a=G.useRef(null),l=G.useRef(false),s=G.useRef(t);G.useEffect(()=>{s.current=t;},[t]);let p=G.useCallback(y=>s.current.find(h=>h.key===y),[]);G.useEffect(()=>{try{localStorage.setItem(r,JSON.stringify(c.widths));}catch{}},[c.widths,r]);let d=G.useRef(null);d.current||(d.current={onPointerMove:y=>{if(!a.current)return;let h=y.clientX-u.current;if(!l.current){if(Math.abs(h)<$t)return;l.current=true,f(re=>({...re,isResizing:true,resizingColumn:a.current})),document.body.style.cursor="col-resize",document.body.style.userSelect="none";}let oe=p(a.current),de=oe?.minWidth||it,we=oe?.maxWidth,me=Math.max(de,g.current+h);we&&(me=Math.min(we,me)),f(re=>({...re,widths:{...re.widths,[a.current]:me}}));},onPointerUp:()=>{a.current=null,l.current=false,f(y=>({...y,isResizing:false,resizingColumn:null})),document.removeEventListener("pointermove",d.current.onPointerMove),document.removeEventListener("pointerup",d.current.onPointerUp),document.removeEventListener("pointercancel",d.current.onPointerUp),document.body.style.cursor="",document.body.style.userSelect="";}}),G.useEffect(()=>()=>{d.current&&(document.removeEventListener("pointermove",d.current.onPointerMove),document.removeEventListener("pointerup",d.current.onPointerUp),document.removeEventListener("pointercancel",d.current.onPointerUp)),document.body.style.cursor="",document.body.style.userSelect="";},[]);let v=G.useRef(c.widths);G.useEffect(()=>{v.current=c.widths;},[c.widths]);let k=G.useCallback((y,h)=>{u.current=h,g.current=v.current[y]||De,a.current=y,l.current=false,document.addEventListener("pointermove",d.current.onPointerMove),document.addEventListener("pointerup",d.current.onPointerUp),document.addEventListener("pointercancel",d.current.onPointerUp);},[]),B=G.useCallback(y=>({onPointerDown:h=>{h.preventDefault(),h.stopPropagation(),k(y,h.clientX);},onMouseDown:h=>{h.preventDefault(),h.stopPropagation();},draggable:false,onDragStart:h=>{h.preventDefault(),h.stopPropagation();},className:"resize-handle","data-resizing":c.resizingColumn===y}),[k,c.resizingColumn]),b=G.useCallback(y=>{let h=c.widths[y]||De,de=p(y)?.minWidth||it;return {width:h,minWidth:de,position:"relative"}},[c.widths,p]),T=t.reduce((y,h)=>y+(c.widths[h.key]||h.defaultWidth||De),0),W=G.useCallback(()=>({minWidth:T}),[T]),$=G.useCallback(()=>{f(y=>({...y,widths:m()}));},[m]);return {widths:c.widths,isResizing:c.isResizing,totalWidth:T,getResizeHandleProps:B,getColumnStyle:b,getTableStyle:W,resetToDefaults:$}}function ke({storageKey:e,defaultOrder:t}){let[o,r]=G.useState(()=>{try{let g=localStorage.getItem(e);if(g){let a=JSON.parse(g),l=new Set(a),s=new Set(t),p=a.filter(v=>s.has(v)),d=t.filter(v=>!l.has(v));if(d.length>0){let v=[...p];for(let k of d){let B=t.indexOf(k),b=v.length;for(let T=0;T<v.length;T++)if(t.indexOf(v[T])>B){b=T;break}v.splice(b,0,k);}return v}return p.length>0?p:t}}catch(g){console.warn("Failed to load column order from localStorage:",g);}return t});G.useEffect(()=>{try{localStorage.setItem(e,JSON.stringify(o));}catch(g){console.warn("Failed to save column order to localStorage:",g);}},[e,o]);let m=G.useCallback((g,a)=>{g!==a&&r(l=>{let s=[...l],[p]=s.splice(g,1);return p!==void 0&&s.splice(a,0,p),s});},[]),c=G.useCallback((g,a)=>{r(l=>{let s=l.indexOf(g);if(s===-1)return l;let p=a==="left"?Math.max(0,s-1):Math.min(l.length-1,s+1);if(s===p)return l;let d=[...l],[v]=d.splice(s,1);return v!==void 0&&d.splice(p,0,v),d});},[]),f=G.useCallback(()=>{r(t);},[t]),u=G.useCallback(g=>{let a=new Map(g.map(l=>[l.id,l]));return o.map(l=>a.get(l)).filter(l=>l!==void 0)},[o]);return {columnOrder:o,moveColumn:m,moveColumnById:c,resetOrder:f,getOrderedColumns:u}}function Ie(e,t,o=[]){let[r,m]=G.useState({isDragging:false,draggedId:null,dropIndex:null}),c=G.useCallback(s=>{o.includes(s)||m({isDragging:true,draggedId:s,dropIndex:null});},[o]),f=G.useCallback((s,p)=>{if(o.includes(s))return;let d=e.indexOf(s);if(d===-1)return;let v=p.currentTarget.getBoundingClientRect(),k=v.left+v.width/2,B=p.clientX<k?d:d+1;m(b=>({...b,dropIndex:B}));},[o,e]),u=G.useCallback(()=>{if(!r.draggedId||r.dropIndex===null){m({isDragging:false,draggedId:null,dropIndex:null});return}let s=e.indexOf(r.draggedId),p=r.dropIndex;s<p&&(p=p-1),s!==-1&&p!==-1&&s!==p&&t(s,p),m({isDragging:false,draggedId:null,dropIndex:null});},[r.draggedId,r.dropIndex,e,t]),g=G.useCallback(()=>{m({isDragging:false,draggedId:null,dropIndex:null});},[]),a=G.useCallback(s=>({draggable:!o.includes(s),onDragStart:p=>{if(o.includes(s)){p.preventDefault();return}p.dataTransfer.effectAllowed="move",c(s);},onDragOver:p=>{p.preventDefault(),p.dataTransfer.dropEffect="move",f(s,p);},onDrop:p=>{p.preventDefault(),u();},onDragEnd:g}),[o,c,f,u,g]),l=G.useCallback(s=>!r.isDragging||r.dropIndex===null?false:e.indexOf(s)===r.dropIndex,[r.isDragging,r.dropIndex,e]);return {dragState:r,getDragHandleProps:a,showDropIndicator:l}}function i(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var Fe=G__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx("div",{className:"relative w-full overflow-auto",children:jsxRuntime.jsx("table",{ref:o,className:i("w-full caption-bottom text-sm",e),...t})}));Fe.displayName="Table";var Ge=G__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx("thead",{ref:o,className:i("[&_tr]:border-b",e),...t}));Ge.displayName="TableHeader";var _e=G__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx("tbody",{ref:o,className:i("[&_tr:last-child]:border-0",e),...t}));_e.displayName="TableBody";var jt=G__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx("tfoot",{ref:o,className:i("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));jt.displayName="TableFooter";var ce=G__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx("tr",{ref:o,className:i("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));ce.displayName="TableRow";var pe=G__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx("th",{ref:o,className:i("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));pe.displayName="TableHead";var ae=G__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx("td",{ref:o,className:i("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));ae.displayName="TableCell";var Qt=G__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx("caption",{ref:o,className:i("mt-4 text-sm text-muted-foreground",e),...t}));Qt.displayName="TableCaption";var lt=ee__namespace.Provider;var Kt=G__namespace.forwardRef(({className:e,sideOffset:t=4,...o},r)=>jsxRuntime.jsx(ee__namespace.Content,{ref:r,sideOffset:t,className:i("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o}));Kt.displayName=ee__namespace.Content.displayName;var ro=classVarianceAuthority.cva("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),S=G__namespace.forwardRef(({className:e,variant:t,size:o,asChild:r=false,...m},c)=>jsxRuntime.jsx(r?reactSlot.Slot:"button",{className:i(ro({variant:t,size:o,className:e})),ref:c,...m}));S.displayName="Button";var ze=x__namespace.Root;var Ee=x__namespace.Value,ue=G__namespace.forwardRef(({className:e,children:t,...o},r)=>jsxRuntime.jsxs(x__namespace.Trigger,{ref:r,className:i("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...o,children:[t,jsxRuntime.jsx(x__namespace.Icon,{asChild:true,children:jsxRuntime.jsx(lucideReact.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));ue.displayName=x__namespace.Trigger.displayName;var ct=G__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx(x__namespace.ScrollUpButton,{ref:o,className:i("flex cursor-default items-center justify-center py-1",e),...t,children:jsxRuntime.jsx(lucideReact.ChevronUp,{className:"h-4 w-4"})}));ct.displayName=x__namespace.ScrollUpButton.displayName;var pt=G__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx(x__namespace.ScrollDownButton,{ref:o,className:i("flex cursor-default items-center justify-center py-1",e),...t,children:jsxRuntime.jsx(lucideReact.ChevronDown,{className:"h-4 w-4"})}));pt.displayName=x__namespace.ScrollDownButton.displayName;var fe=G__namespace.forwardRef(({className:e,children:t,position:o="popper",...r},m)=>jsxRuntime.jsx(x__namespace.Portal,{children:jsxRuntime.jsxs(x__namespace.Content,{ref:m,className:i("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",o==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:o,...r,children:[jsxRuntime.jsx(ct,{}),jsxRuntime.jsx(x__namespace.Viewport,{className:i("p-1",o==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),jsxRuntime.jsx(pt,{})]})}));fe.displayName=x__namespace.Content.displayName;var so=G__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx(x__namespace.Label,{ref:o,className:i("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));so.displayName=x__namespace.Label.displayName;var ge=G__namespace.forwardRef(({className:e,children:t,...o},r)=>jsxRuntime.jsxs(x__namespace.Item,{ref:r,className:i("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...o,children:[jsxRuntime.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:jsxRuntime.jsx(x__namespace.ItemIndicator,{children:jsxRuntime.jsx(lucideReact.Check,{className:"h-4 w-4"})})}),jsxRuntime.jsx(x__namespace.ItemText,{children:t})]}));ge.displayName=x__namespace.Item.displayName;var lo=G__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx(x__namespace.Separator,{ref:o,className:i("-mx-1 my-1 h-px bg-muted",e),...t}));lo.displayName=x__namespace.Separator.displayName;function Le({page:e,pageSize:t,totalPages:o,totalItems:r,startIndex:m,endIndex:c,canGoNext:f,canGoPrev:u,pageSizeOptions:g,onPageChange:a,onPageSizeChange:l,onNextPage:s,onPrevPage:p,onFirstPage:d,onLastPage:v,className:k}){let B=()=>{let b=[],W=Math.floor(2.5),$=Math.max(1,e-W),y=Math.min(o,e+W);e<=W&&(y=Math.min(o,5)),e>o-W&&($=Math.max(1,o-5+1)),$>1&&(b.push(1),$>2&&b.push("ellipsis"));for(let h=$;h<=y;h++)h!==1&&h!==o&&b.push(h);return y<o&&(y<o-1&&b.push("ellipsis"),b.push(o)),b};return r===0?null:jsxRuntime.jsxs("div",{className:i("flex flex-col sm:flex-row items-center justify-between gap-4 px-2 py-3",k),children:[jsxRuntime.jsxs("div",{className:"text-sm text-muted-foreground",children:["Showing ",m," to ",c," of ",r," items"]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:"text-sm text-muted-foreground",children:"Per page:"}),jsxRuntime.jsxs(ze,{value:String(t),onValueChange:b=>l(Number(b)),children:[jsxRuntime.jsx(ue,{className:"w-20 h-8",children:jsxRuntime.jsx(Ee,{})}),jsxRuntime.jsx(fe,{children:g.map(b=>jsxRuntime.jsx(ge,{value:String(b),children:b},b))})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx(S,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:d,disabled:!u,title:"First page",children:jsxRuntime.jsx(lucideReact.ChevronsLeft,{className:"h-4 w-4"})}),jsxRuntime.jsx(S,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:p,disabled:!u,title:"Previous page",children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:"h-4 w-4"})}),jsxRuntime.jsx("div",{className:"flex items-center gap-1",children:B().map((b,T)=>b==="ellipsis"?jsxRuntime.jsx("span",{className:"px-2 text-muted-foreground",children:"..."},`ellipsis-${T}`):jsxRuntime.jsx(S,{variant:e===b?"default":"outline",size:"icon",className:"h-8 w-8",onClick:()=>a(b),children:b},b))}),jsxRuntime.jsx(S,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:s,disabled:!f,title:"Next page",children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:"h-4 w-4"})}),jsxRuntime.jsx(S,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:v,disabled:!f,title:"Last page",children:jsxRuntime.jsx(lucideReact.ChevronsRight,{className:"h-4 w-4"})})]})]})]})}function ut({data:e,columns:t,storageKey:o,getRowId:r,selectable:m=false,selectedIds:c,onSelectionChange:f,onRowClick:u,onRowContextMenu:g,sortField:a,sortOrder:l,onSort:s,actionsColumn:p,actionsColumnWidth:d=80,pageSize:v=25,pagination:k,hidePagination:B=false,className:b,rowClassName:T,enableHeaderContextMenu:W=true,lockedColumns:$=[],defaultColumnOrder:y,loading:h=false,emptyState:oe}){let de=G.useMemo(()=>{let n=[];return m&&n.push({key:"select",defaultWidth:40,minWidth:40}),t.forEach(N=>{n.push({key:N.id,defaultWidth:N.width?.default??150,minWidth:N.width?.min??80,maxWidth:N.width?.max});}),p&&n.push({key:"actions",defaultWidth:d,minWidth:60}),n},[t,m,p,d]),we=G.useMemo(()=>t.map(n=>({id:n.id,label:typeof n.header=="string"?n.header:n.id,defaultVisible:n.visibility?.default??true,locked:n.visibility?.locked})),[t]),me=G.useMemo(()=>{if(y)return y;let n=[];return m&&n.push("select"),t.forEach(N=>n.push(N.id)),p&&n.push("actions"),n},[y,t,m,p]),{getResizeHandleProps:re,getColumnStyle:Qe,getTableStyle:Dt}=Me({tableId:o,columns:de}),j=Re({columns:we,storageKey:o}),{columnOrder:Ce,moveColumn:Mt}=ke({storageKey:`${o}-order`,defaultOrder:me}),{dragState:Ae,getDragHandleProps:kt,showDropIndicator:It}=Ie(Ce,Mt,[...$,"select","actions"]),zt=Ne({data:e,pageSize:v,storageKey:o}),w=k||zt,[ne,Ke]=G.useState(null),Et=G.useCallback(n=>{W&&(n.preventDefault(),Ke({x:n.clientX,y:n.clientY}));},[W]);G.useEffect(()=>{if(!ne)return;let n=()=>Ke(null);return window.addEventListener("click",n),()=>{window.removeEventListener("click",n);}},[ne]);let et=G.useMemo(()=>!m||!c||w.paginatedData.length===0?false:w.paginatedData.every(n=>c.has(r(n))),[m,c,w.paginatedData,r]),Lt=G.useMemo(()=>{if(!m||!c)return false;let n=w.paginatedData.filter(N=>c.has(r(N)));return n.length>0&&n.length<w.paginatedData.length},[m,c,w.paginatedData,r]),Bt=G.useCallback(n=>{if(!f||!c)return;let N=new Set(c);N.has(n)?N.delete(n):N.add(n),f(N);},[c,f]),Ht=G.useCallback(()=>{if(!f)return;let n=new Set(w.paginatedData.map(r));f(n);},[w.paginatedData,r,f]),Ot=G.useCallback(()=>{f&&f(new Set);},[f]),tt=G.useCallback(n=>a!==n?jsxRuntime.jsx(lucideReact.ArrowUpDown,{className:"h-3.5 w-3.5 text-muted-foreground"}):l==="asc"?jsxRuntime.jsx(lucideReact.ChevronUp,{className:"h-3.5 w-3.5"}):jsxRuntime.jsx(lucideReact.ChevronDown,{className:"h-3.5 w-3.5"}),[a,l]),ot=G.useCallback(n=>t.find(N=>N.id===n),[t]),Vt=G.useCallback(n=>{let N={columnId:n.id,isSorted:a===n.sortKey,sortDirection:a===n.sortKey?l:void 0};return typeof n.header=="function"?n.header(N):n.sortKey&&s?jsxRuntime.jsxs("button",{onClick:()=>s(n.sortKey),className:i("flex items-center gap-1 hover:text-foreground transition-colors",a===n.sortKey&&"text-foreground font-medium"),children:[n.header,tt(n.sortKey)]}):n.header},[a,l,s,tt]);return jsxRuntime.jsx(lt,{children:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"overflow-auto border rounded-lg h-full",children:jsxRuntime.jsxs(Fe,{style:Dt(),className:i("resizable-table sticky-actions-table",b),children:[jsxRuntime.jsx(Ge,{className:"sticky top-0 z-20 bg-muted",children:jsxRuntime.jsxs(ce,{onContextMenu:Et,className:"border-t-0",children:[Ce.map(n=>{if(n==="select"&&m)return jsxRuntime.jsx(pe,{className:"sticky-select-header w-10 sticky left-0 z-20 bg-muted relative after:absolute after:right-0 after:top-0 after:bottom-0 after:w-px after:bg-border",children:jsxRuntime.jsx("input",{type:"checkbox",checked:et,ref:I=>{I&&(I.indeterminate=Lt);},onChange:I=>I.target.checked?Ht():Ot(),className:"h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary cursor-pointer",title:et?"Deselect all":"Select all visible"})},"select");let N=ot(n);return !N||!j.isColumnVisible(n)?null:jsxRuntime.jsxs(pe,{style:Qe(n),...kt(n),className:i("cursor-grab relative",Ae.draggedId===n&&"column-dragging opacity-50",It(n)&&"drop-indicator"),children:[Vt(N),jsxRuntime.jsx("div",{...re(n)})]},n)}),p&&jsxRuntime.jsx(pe,{className:"sticky right-0 z-20 bg-muted text-center relative before:absolute before:left-0 before:top-0 before:bottom-0 before:w-px before:bg-border",style:{width:d,minWidth:d,maxWidth:d},children:"Actions"},"actions")]})}),jsxRuntime.jsx(_e,{children:h?jsxRuntime.jsx(ce,{children:jsxRuntime.jsx(ae,{colSpan:Ce.length+(p?1:0),className:"!p-0 h-32",children:jsxRuntime.jsx("div",{className:"sticky left-0 w-screen max-w-full h-full bg-background flex justify-center items-center",children:jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[jsxRuntime.jsx(lucideReact.Loader2,{className:"h-5 w-5 animate-spin"}),"Loading..."]})})})}):w.paginatedData.length===0?null:w.paginatedData.map(n=>{let N=r(n),I=c?.has(N)??false;return jsxRuntime.jsxs(ce,{className:i("group cursor-pointer bg-background hover:bg-muted transition-none",I&&"bg-primary/5",T?.(n)),onClick:()=>u?.(n),onContextMenu:z=>{g&&(z.preventDefault(),g(n,{x:z.clientX,y:z.clientY}));},children:[Ce.map(z=>{if(z==="select"&&m)return jsxRuntime.jsx(ae,{className:i("sticky-select-cell w-10 sticky left-0 z-10 relative after:absolute after:right-0 after:top-0 after:bottom-0 after:w-px after:bg-border","bg-background group-hover:bg-muted",I&&"bg-primary/5 group-hover:bg-primary/10"),onClick:At=>At.stopPropagation(),children:jsxRuntime.jsx("input",{type:"checkbox",checked:I,onChange:()=>Bt(N),className:"h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary cursor-pointer"})},"select");let Ue=ot(z);if(!Ue||!j.isColumnVisible(z))return null;let Wt={columnId:z,isDragging:Ae.draggedId===z};return jsxRuntime.jsx(ae,{style:Qe(z),className:i(Ue.className,Ae.draggedId===z&&"column-dragging"),children:Ue.cell(n,Wt)},z)}),p&&jsxRuntime.jsx(ae,{className:i("sticky right-0 z-10 text-center relative before:absolute before:left-0 before:top-0 before:bottom-0 before:w-px before:bg-border","bg-background group-hover:bg-muted",I&&"bg-primary/5 group-hover:bg-primary/10"),style:{width:d,minWidth:d,maxWidth:d},onClick:z=>z.stopPropagation(),children:p(n)},"actions")]},N)})})]})}),!h&&w.paginatedData.length===0&&jsxRuntime.jsx("div",{className:"empty-state-container flex-1 flex items-center justify-center bg-background",children:oe||jsxRuntime.jsx("span",{className:"block text-center text-muted-foreground py-8",children:"No data"})}),!B&&!h&&w.totalPages>1&&jsxRuntime.jsx(Le,{page:w.page,pageSize:w.pageSize,totalItems:w.totalItems,totalPages:w.totalPages,startIndex:w.startIndex,endIndex:w.endIndex,canGoPrev:w.canGoPrev,canGoNext:w.canGoNext,onPageChange:w.setPage,onPageSizeChange:w.setPageSize,onNextPage:w.nextPage,onPrevPage:w.prevPage,onFirstPage:"firstPage"in w?w.firstPage:()=>w.setPage(1),onLastPage:"lastPage"in w?w.lastPage:()=>w.setPage(w.totalPages),pageSizeOptions:w.pageSizeOptions}),ne&&jsxRuntime.jsxs("div",{className:"fixed z-50 min-w-[200px] overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95",style:{top:ne.y,left:ne.x,maxHeight:`calc(100vh - ${ne.y}px - 20px)`},onClick:n=>n.stopPropagation(),children:[jsxRuntime.jsx("div",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:"Toggle columns"}),jsxRuntime.jsx("div",{className:"h-px bg-border my-1"}),j.columns.map(n=>{let N=j.isColumnVisible(n.id),I=n.locked===true;return jsxRuntime.jsxs("button",{onClick:()=>!I&&j.toggleColumn(n.id),disabled:I,className:i("flex items-center gap-2 w-full px-2 py-1.5 text-sm rounded-sm hover:bg-accent",I&&"opacity-50 cursor-not-allowed"),children:[jsxRuntime.jsx("div",{className:"w-4 h-4 flex items-center justify-center",children:N&&jsxRuntime.jsx(lucideReact.Check,{className:"h-3.5 w-3.5 text-primary"})}),jsxRuntime.jsx("span",{className:"flex-1 text-left",children:n.label}),I&&jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground",children:"Required"})]},n.id)}),jsxRuntime.jsx("div",{className:"h-px bg-border my-1"}),jsxRuntime.jsxs("button",{onClick:()=>j.showAllColumns(),className:"flex items-center gap-2 w-full px-2 py-1.5 text-sm rounded-sm hover:bg-accent",children:[jsxRuntime.jsx(lucideReact.Eye,{className:"h-4 w-4"}),"Show All"]}),jsxRuntime.jsxs("button",{onClick:()=>j.hideAllColumns(),className:"flex items-center gap-2 w-full px-2 py-1.5 text-sm rounded-sm hover:bg-accent",children:[jsxRuntime.jsx(lucideReact.EyeOff,{className:"h-4 w-4"}),"Hide Optional"]})]})]})})}var ve=G__namespace.forwardRef(({className:e,type:t,...o},r)=>jsxRuntime.jsx("input",{type:t,className:i("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...o}));ve.displayName="Input";var Be=___namespace.Root,He=___namespace.Trigger,he=G__namespace.forwardRef(({className:e,align:t="center",sideOffset:o=4,...r},m)=>jsxRuntime.jsx(___namespace.Portal,{children:jsxRuntime.jsx(___namespace.Content,{ref:m,align:t,sideOffset:o,className:i("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));he.displayName=___namespace.Content.displayName;function Oe({page:e,pageSize:t,totalPages:o,totalItems:r,startIndex:m,endIndex:c,canGoNext:f,canGoPrev:u,pageSizeOptions:g,setPage:a,setPageSize:l,nextPage:s,prevPage:p,className:d}){return r===0?null:jsxRuntime.jsxs("div",{className:i("flex items-center gap-3 text-sm",d),children:[jsxRuntime.jsxs("div",{className:"hidden md:flex items-center gap-1.5",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground hidden lg:inline",children:"Rows:"}),jsxRuntime.jsxs(ze,{value:String(t),onValueChange:v=>l(Number(v)),children:[jsxRuntime.jsx(ue,{className:"w-16 h-8 text-xs",children:jsxRuntime.jsx(Ee,{})}),jsxRuntime.jsx(fe,{children:g.map(v=>jsxRuntime.jsx(ge,{value:String(v),children:v},v))})]})]}),o>1&&jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx(S,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:p,disabled:!u,title:"Previous page",children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:"h-4 w-4"})}),jsxRuntime.jsxs("span",{className:"hidden sm:inline px-2 text-muted-foreground tabular-nums min-w-[60px] text-center",children:[e," / ",o]}),jsxRuntime.jsx(S,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:s,disabled:!f,title:"Next page",children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:"h-4 w-4"})})]}),jsxRuntime.jsxs("span",{className:"text-muted-foreground whitespace-nowrap hidden lg:inline",children:["Showing ",m,"\u2013",c," of ",r]})]})}function ht({title:e,description:t,titleExtra:o,search:r,onSearchChange:m,searchPlaceholder:c="Search...",filters:f,activeFilterCount:u=0,onClearFilters:g,pagination:a,actions:l,beforeTable:s,children:p,className:d,loading:v,loadingComponent:k}){let B=a&&a.totalItems>0;return jsxRuntime.jsxs("div",{className:i("flex flex-col h-full",d),children:[jsxRuntime.jsxs("div",{className:"data-table-page-header flex-shrink-0 space-y-4 pb-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"group flex items-center gap-2",children:[jsxRuntime.jsx("h1",{className:"text-3xl font-bold",children:e}),o]}),t&&jsxRuntime.jsx("p",{className:"text-muted-foreground",children:t})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[m!==void 0&&jsxRuntime.jsxs("div",{className:"relative w-full sm:w-auto sm:min-w-[200px] sm:max-w-xs",children:[jsxRuntime.jsx(lucideReact.Search,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground pointer-events-none z-10"}),jsxRuntime.jsx(ve,{placeholder:c,value:r||"",onChange:b=>m(b.target.value),className:"pl-9 h-9"}),r&&jsxRuntime.jsx("button",{type:"button",onClick:()=>m(""),className:"absolute right-2 top-1/2 transform -translate-y-1/2 p-1 rounded-sm hover:bg-muted",children:jsxRuntime.jsx(lucideReact.X,{className:"h-3 w-3 text-muted-foreground"})})]}),f&&f.length>0&&jsxRuntime.jsxs(Be,{children:[jsxRuntime.jsx(He,{asChild:true,children:jsxRuntime.jsxs(S,{variant:"outline",size:"sm",className:"gap-2 h-9",children:[jsxRuntime.jsx(lucideReact.Filter,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{className:"hidden sm:inline",children:"Filters"}),u>0&&jsxRuntime.jsx("span",{className:"rounded-full bg-primary text-primary-foreground px-2 py-0.5 text-xs font-medium",children:u})]})}),jsxRuntime.jsx(he,{className:"w-80 overflow-y-auto",align:"start",collisionPadding:16,style:{maxHeight:"var(--radix-popover-content-available-height)"},children:jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("h4",{className:"font-medium text-sm",children:"Filters"}),u>0&&g&&jsxRuntime.jsx(S,{variant:"ghost",size:"sm",onClick:g,className:"h-auto p-0 text-xs text-destructive hover:text-destructive",children:"Clear all"})]}),jsxRuntime.jsx("div",{className:"space-y-3",children:f.map(b=>jsxRuntime.jsxs("div",{className:"space-y-1.5",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:b.label}),b.render()]},b.id))})]})})]}),u>0&&g&&jsxRuntime.jsxs(S,{variant:"ghost",size:"sm",onClick:g,className:"h-9 gap-1.5 text-muted-foreground hover:text-foreground",title:"Clear filters",children:[jsxRuntime.jsx(lucideReact.X,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{className:"hidden sm:inline",children:"Clear"})]}),B&&jsxRuntime.jsx(Oe,{...a}),jsxRuntime.jsx("div",{className:"flex-1"}),l&&jsxRuntime.jsx("div",{className:"flex items-center gap-2 flex-shrink-0",children:l})]})]}),s&&jsxRuntime.jsx("div",{className:"px-6 pb-2",children:s}),jsxRuntime.jsx("div",{className:"relative flex-1 min-h-0",children:jsxRuntime.jsx("div",{className:"data-table-scroll-container h-full",children:v?k||jsxRuntime.jsx("div",{className:"flex items-center justify-center h-full",children:jsxRuntime.jsx("div",{className:"text-muted-foreground",children:"Loading..."})}):p})})]})}function xt({children:e,className:t,...o}){return jsxRuntime.jsx("div",{className:i("bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700",t),...o,children:e})}function Pt({selectedCount:e,onClear:t,children:o,itemLabel:r,className:m}){if(e===0)return null;let c=r??(e===1?"item":"items");return jsxRuntime.jsx(xt,{className:i("p-3 bg-primary/5 border-primary/20",m),children:jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsxs("span",{className:"font-medium text-sm",role:"status","aria-live":"polite",children:[e," ",c," selected"]}),jsxRuntime.jsxs(S,{variant:"ghost",size:"sm",onClick:t,"aria-label":"Clear selection",children:[jsxRuntime.jsx(lucideReact.X,{className:"h-4 w-4 mr-1","aria-hidden":"true"}),"Clear"]})]}),jsxRuntime.jsx("div",{className:"flex items-center gap-2",role:"group","aria-label":"Batch actions",children:o})]})})}var yt=P__namespace.Root,wt=P__namespace.Trigger;var Lo=G__namespace.forwardRef(({className:e,inset:t,children:o,...r},m)=>jsxRuntime.jsxs(P__namespace.SubTrigger,{ref:m,className:i("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...r,children:[o,jsxRuntime.jsx(lucideReact.ChevronRight,{className:"ml-auto h-4 w-4"})]}));Lo.displayName=P__namespace.SubTrigger.displayName;var Bo=G__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx(P__namespace.SubContent,{ref:o,className:i("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));Bo.displayName=P__namespace.SubContent.displayName;var $e=G__namespace.forwardRef(({className:e,sideOffset:t=4,...o},r)=>jsxRuntime.jsx(P__namespace.Portal,{children:jsxRuntime.jsx(P__namespace.Content,{ref:r,sideOffset:t,className:i("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})}));$e.displayName=P__namespace.Content.displayName;var xe=G__namespace.forwardRef(({className:e,inset:t,...o},r)=>jsxRuntime.jsx(P__namespace.Item,{ref:r,className:i("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...o}));xe.displayName=P__namespace.Item.displayName;var Ho=G__namespace.forwardRef(({className:e,children:t,checked:o,...r},m)=>jsxRuntime.jsxs(P__namespace.CheckboxItem,{ref:m,className:i("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:o,...r,children:[jsxRuntime.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:jsxRuntime.jsx(P__namespace.ItemIndicator,{children:jsxRuntime.jsx(lucideReact.Check,{className:"h-4 w-4"})})}),t]}));Ho.displayName=P__namespace.CheckboxItem.displayName;var Oo=G__namespace.forwardRef(({className:e,children:t,...o},r)=>jsxRuntime.jsxs(P__namespace.RadioItem,{ref:r,className:i("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...o,children:[jsxRuntime.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:jsxRuntime.jsx(P__namespace.ItemIndicator,{children:jsxRuntime.jsx(lucideReact.Circle,{className:"h-2 w-2 fill-current"})})}),t]}));Oo.displayName=P__namespace.RadioItem.displayName;var qe=G__namespace.forwardRef(({className:e,inset:t,...o},r)=>jsxRuntime.jsx(P__namespace.Label,{ref:r,className:i("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...o}));qe.displayName=P__namespace.Label.displayName;var We=G__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx(P__namespace.Separator,{ref:o,className:i("-mx-1 my-1 h-px bg-muted",e),...t}));We.displayName=P__namespace.Separator.displayName;function Ct({columns:e,isColumnVisible:t,toggleColumn:o,showAllColumns:r,hideAllColumns:m}){let c=e.filter(u=>t(u.id)).length,f=e.filter(u=>!u.locked);return jsxRuntime.jsxs(yt,{children:[jsxRuntime.jsx(wt,{asChild:true,children:jsxRuntime.jsxs(S,{variant:"outline",size:"sm",className:"gap-2",children:[jsxRuntime.jsx(lucideReact.Columns3,{className:"h-4 w-4"}),"Columns",jsxRuntime.jsxs("span",{className:"text-muted-foreground text-xs",children:["(",c,"/",e.length,")"]})]})}),jsxRuntime.jsxs($e,{align:"end",className:"w-48",children:[jsxRuntime.jsx(qe,{className:"font-normal text-xs text-muted-foreground",children:"Toggle columns"}),jsxRuntime.jsx(We,{}),e.map(u=>{let g=t(u.id),a=u.locked===true;return jsxRuntime.jsxs(xe,{onClick:l=>{l.preventDefault(),a||o(u.id);},className:i("gap-2 cursor-pointer",a&&"opacity-50 cursor-not-allowed"),disabled:a,children:[jsxRuntime.jsx("div",{className:"w-4 h-4 flex items-center justify-center",children:g?jsxRuntime.jsx(lucideReact.Check,{className:"h-3.5 w-3.5 text-primary"}):jsxRuntime.jsx("div",{className:"h-3.5 w-3.5"})}),jsxRuntime.jsx("span",{className:"flex-1",children:u.label}),a&&jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground",children:"Required"})]},u.id)}),f.length>1&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(We,{}),jsxRuntime.jsxs(xe,{onClick:u=>{u.preventDefault(),r();},className:"gap-2 cursor-pointer",children:[jsxRuntime.jsx(lucideReact.Eye,{className:"h-4 w-4"}),"Show All"]}),jsxRuntime.jsxs(xe,{onClick:u=>{u.preventDefault(),m();},className:"gap-2 cursor-pointer",children:[jsxRuntime.jsx(lucideReact.EyeOff,{className:"h-4 w-4"}),"Hide Optional"]})]})]})]})}function St({search:e,onSearchChange:t,searchPlaceholder:o="Search...",filters:r,activeFilterCount:m=0,onClearFilters:c,className:f,children:u}){let a=r?.some(l=>l.type==="multi")?"w-[420px]":"w-80";return jsxRuntime.jsxs("div",{className:i("flex items-center gap-3 flex-wrap",f),children:[t!==void 0&&jsxRuntime.jsxs("div",{className:"relative flex-1 min-w-[200px] max-w-xs",children:[jsxRuntime.jsx(lucideReact.Search,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground pointer-events-none z-10"}),jsxRuntime.jsx(ve,{placeholder:o,value:e||"",onChange:l=>t(l.target.value),className:"pl-9 h-9"}),e&&jsxRuntime.jsx("button",{type:"button",onClick:()=>t(""),className:"absolute right-2 top-1/2 transform -translate-y-1/2 p-1 rounded-sm hover:bg-muted",children:jsxRuntime.jsx(lucideReact.X,{className:"h-3 w-3 text-muted-foreground"})})]}),r&&r.length>0&&jsxRuntime.jsxs(Be,{children:[jsxRuntime.jsx(He,{asChild:true,children:jsxRuntime.jsxs(S,{variant:"outline",size:"sm",className:"gap-2 h-9",children:[jsxRuntime.jsx(lucideReact.Filter,{className:"h-4 w-4"}),"Filters",m>0&&jsxRuntime.jsx("span",{className:"ml-1 rounded-full bg-primary text-primary-foreground px-2 py-0.5 text-xs font-medium",children:m})]})}),jsxRuntime.jsx(he,{className:i(a,"overflow-y-auto"),align:"start",collisionPadding:16,style:{maxHeight:"var(--radix-popover-content-available-height)"},children:jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("h4",{className:"font-medium text-sm",children:"Filters"}),m>0&&c&&jsxRuntime.jsx(S,{variant:"ghost",size:"sm",onClick:c,className:"h-auto p-0 text-xs text-destructive hover:text-destructive",children:"Clear all"})]}),jsxRuntime.jsx("div",{className:"space-y-4",children:r.map(l=>jsxRuntime.jsxs("div",{className:"space-y-1.5",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:l.label}),l.render()]},l.id))})]})})]}),m>0&&c&&jsxRuntime.jsxs(S,{variant:"ghost",size:"sm",onClick:c,className:"h-9 gap-1.5 text-muted-foreground hover:text-foreground",children:[jsxRuntime.jsx(lucideReact.X,{className:"h-4 w-4"}),"Clear"]}),jsxRuntime.jsx("div",{className:"flex-1"}),u]})}var je=G__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx(Pe__namespace.Root,{ref:o,className:i("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:jsxRuntime.jsx(Pe__namespace.Indicator,{className:i("flex items-center justify-center text-current"),children:jsxRuntime.jsx(lucideReact.Check,{className:"h-4 w-4"})})}));je.displayName=Pe__namespace.Root.displayName;function Tt({options:e,selected:t,onChange:o,maxHeight:r=200,columns:m=2,showBulkActions:c=true,className:f}){let u=d=>{let v=new Set(t);v.has(d)?v.delete(d):v.add(d),o(v);},g=()=>{o(new Set(e.map(d=>d.value)));},a=()=>{o(new Set);},l={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3"},s=e.length>0&&t.size===e.length,p=t.size===0;return jsxRuntime.jsxs("div",{className:i("space-y-2",f),children:[c&&e.length>3&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[jsxRuntime.jsx(S,{type:"button",variant:"ghost",size:"sm",onClick:g,disabled:s,className:"h-6 px-2 text-xs text-muted-foreground hover:text-foreground",children:"Select all"}),jsxRuntime.jsx("span",{className:"text-muted-foreground",children:"\xB7"}),jsxRuntime.jsx(S,{type:"button",variant:"ghost",size:"sm",onClick:a,disabled:p,className:"h-6 px-2 text-xs text-muted-foreground hover:text-foreground",children:"Clear"}),t.size>0&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:"\xB7"}),jsxRuntime.jsxs("span",{className:"text-muted-foreground",children:[t.size," selected"]})]})]}),jsxRuntime.jsx("div",{className:i("overflow-y-auto",e.length>6&&"pr-1"),style:{maxHeight:`${r}px`},children:jsxRuntime.jsx("div",{className:i("grid gap-1",l[m]),children:e.map(d=>jsxRuntime.jsxs("label",{className:i("flex items-center gap-2 px-2 py-1.5 rounded-md cursor-pointer","hover:bg-muted/50 transition-colors",t.has(d.value)&&"bg-muted/30"),children:[jsxRuntime.jsx(je,{checked:t.has(d.value),onCheckedChange:()=>u(d.value),className:"h-3.5 w-3.5"}),d.render?jsxRuntime.jsx("span",{className:"flex items-center gap-1.5 text-sm truncate",children:d.render()}):jsxRuntime.jsx("span",{className:"text-sm truncate",children:d.label})]},d.value))})}),e.length===0&&jsxRuntime.jsx("div",{className:"text-sm text-muted-foreground text-center py-2",children:"No options available"})]})}exports.BatchActionsBar=Pt;exports.ColumnVisibility=Ct;exports.DataTable=ut;exports.DataTablePage=ht;exports.MultiSelectFilter=Tt;exports.Pagination=Le;exports.PaginationControls=Oe;exports.TableFilters=St;exports.useColumnDragDrop=Ie;exports.useColumnOrder=ke;exports.useColumnVisibility=Re;exports.usePagination=Ne;exports.useResizableColumns=Me;//# sourceMappingURL=data-table.js.map
2
+ //# sourceMappingURL=data-table.js.map