@akshar-technosoft/ui 1.3.1 → 1.3.2

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 (338) hide show
  1. package/README.md +0 -0
  2. package/dist/components/core/error.cjs +3 -0
  3. package/dist/components/core/error.cjs.map +1 -0
  4. package/dist/components/core/error.d.cts +5 -0
  5. package/dist/components/core/error.d.ts +5 -0
  6. package/dist/components/core/error.js +3 -0
  7. package/dist/components/core/error.js.map +1 -0
  8. package/dist/components/core/event-success.cjs +3 -0
  9. package/dist/components/core/event-success.cjs.map +1 -0
  10. package/dist/components/core/event-success.d.cts +5 -0
  11. package/dist/components/core/event-success.d.ts +5 -0
  12. package/dist/components/core/event-success.js +3 -0
  13. package/dist/components/core/event-success.js.map +1 -0
  14. package/dist/components/core/index.cjs +3 -0
  15. package/dist/components/core/index.cjs.map +1 -0
  16. package/dist/components/core/index.d.cts +7 -0
  17. package/dist/components/core/index.d.ts +7 -0
  18. package/dist/components/core/index.js +3 -0
  19. package/dist/components/core/index.js.map +1 -0
  20. package/dist/components/core/loader.cjs +3 -0
  21. package/dist/components/core/loader.cjs.map +1 -0
  22. package/dist/components/core/loader.d.cts +5 -0
  23. package/dist/components/core/loader.d.ts +5 -0
  24. package/dist/components/core/loader.js +3 -0
  25. package/dist/components/core/loader.js.map +1 -0
  26. package/dist/components/core/notfound.cjs +3 -0
  27. package/dist/components/core/notfound.cjs.map +1 -0
  28. package/dist/components/core/notfound.d.cts +5 -0
  29. package/dist/components/core/notfound.d.ts +5 -0
  30. package/dist/components/core/notfound.js +3 -0
  31. package/dist/components/core/notfound.js.map +1 -0
  32. package/dist/components/core/offline-content.cjs +3 -0
  33. package/dist/components/core/offline-content.cjs.map +1 -0
  34. package/dist/components/core/offline-content.d.cts +5 -0
  35. package/dist/components/core/offline-content.d.ts +5 -0
  36. package/dist/components/core/offline-content.js +3 -0
  37. package/dist/components/core/offline-content.js.map +1 -0
  38. package/dist/components/core/unauthorized.cjs +3 -0
  39. package/dist/components/core/unauthorized.cjs.map +1 -0
  40. package/dist/components/core/unauthorized.d.cts +5 -0
  41. package/dist/components/core/unauthorized.d.ts +5 -0
  42. package/dist/components/core/unauthorized.js +3 -0
  43. package/dist/components/core/unauthorized.js.map +1 -0
  44. package/dist/components/data/data-table/data-table-action-bar.cjs +3 -0
  45. package/dist/components/data/data-table/data-table-action-bar.cjs.map +1 -0
  46. package/dist/components/data/data-table/data-table-action-bar.d.cts +26 -0
  47. package/dist/components/data/data-table/data-table-action-bar.d.ts +26 -0
  48. package/dist/components/data/data-table/data-table-action-bar.js +3 -0
  49. package/dist/components/data/data-table/data-table-action-bar.js.map +1 -0
  50. package/dist/components/data/data-table/data-table-aggregation.cjs +3 -0
  51. package/dist/components/data/data-table/data-table-aggregation.cjs.map +1 -0
  52. package/dist/components/data/data-table/data-table-aggregation.d.cts +25 -0
  53. package/dist/components/data/data-table/data-table-aggregation.d.ts +25 -0
  54. package/dist/components/data/data-table/data-table-aggregation.js +3 -0
  55. package/dist/components/data/data-table/data-table-aggregation.js.map +1 -0
  56. package/dist/components/data/data-table/data-table-columns.cjs +3 -0
  57. package/dist/components/data/data-table/data-table-columns.cjs.map +1 -0
  58. package/dist/components/data/data-table/data-table-columns.d.cts +20 -0
  59. package/dist/components/data/data-table/data-table-columns.d.ts +20 -0
  60. package/dist/components/data/data-table/data-table-columns.js +3 -0
  61. package/dist/components/data/data-table/data-table-columns.js.map +1 -0
  62. package/dist/components/data/data-table/data-table-export.cjs +3 -0
  63. package/dist/components/data/data-table/data-table-export.cjs.map +1 -0
  64. package/dist/components/data/data-table/data-table-export.d.cts +38 -0
  65. package/dist/components/data/data-table/data-table-export.d.ts +38 -0
  66. package/dist/components/data/data-table/data-table-export.js +3 -0
  67. package/dist/components/data/data-table/data-table-export.js.map +1 -0
  68. package/dist/components/data/data-table/data-table-filtering.cjs +3 -0
  69. package/dist/components/data/data-table/data-table-filtering.cjs.map +1 -0
  70. package/dist/components/data/data-table/data-table-filtering.d.cts +17 -0
  71. package/dist/components/data/data-table/data-table-filtering.d.ts +17 -0
  72. package/dist/components/data/data-table/data-table-filtering.js +3 -0
  73. package/dist/components/data/data-table/data-table-filtering.js.map +1 -0
  74. package/dist/components/data/data-table/data-table-footer.cjs +3 -0
  75. package/dist/components/data/data-table/data-table-footer.cjs.map +1 -0
  76. package/dist/components/data/data-table/data-table-footer.d.cts +21 -0
  77. package/dist/components/data/data-table/data-table-footer.d.ts +21 -0
  78. package/dist/components/data/data-table/data-table-footer.js +3 -0
  79. package/dist/components/data/data-table/data-table-footer.js.map +1 -0
  80. package/dist/components/data/data-table/data-table-header.cjs +3 -0
  81. package/dist/components/data/data-table/data-table-header.cjs.map +1 -0
  82. package/dist/components/data/data-table/data-table-header.d.cts +23 -0
  83. package/dist/components/data/data-table/data-table-header.d.ts +23 -0
  84. package/dist/components/data/data-table/data-table-header.js +3 -0
  85. package/dist/components/data/data-table/data-table-header.js.map +1 -0
  86. package/dist/components/data/data-table/data-table-pagination.cjs +3 -0
  87. package/dist/components/data/data-table/data-table-pagination.cjs.map +1 -0
  88. package/dist/components/data/data-table/data-table-pagination.d.cts +14 -0
  89. package/dist/components/data/data-table/data-table-pagination.d.ts +14 -0
  90. package/dist/components/data/data-table/data-table-pagination.js +3 -0
  91. package/dist/components/data/data-table/data-table-pagination.js.map +1 -0
  92. package/dist/components/data/data-table/data-table-persist.cjs +3 -0
  93. package/dist/components/data/data-table/data-table-persist.cjs.map +1 -0
  94. package/dist/components/data/data-table/data-table-persist.d.cts +103 -0
  95. package/dist/components/data/data-table/data-table-persist.d.ts +103 -0
  96. package/dist/components/data/data-table/data-table-persist.js +3 -0
  97. package/dist/components/data/data-table/data-table-persist.js.map +1 -0
  98. package/dist/components/data/data-table/data-table-pinning.cjs +3 -0
  99. package/dist/components/data/data-table/data-table-pinning.cjs.map +1 -0
  100. package/dist/components/data/data-table/data-table-pinning.d.cts +39 -0
  101. package/dist/components/data/data-table/data-table-pinning.d.ts +39 -0
  102. package/dist/components/data/data-table/data-table-pinning.js +3 -0
  103. package/dist/components/data/data-table/data-table-pinning.js.map +1 -0
  104. package/dist/components/data/data-table/data-table-toolbar-menus.cjs +3 -0
  105. package/dist/components/data/data-table/data-table-toolbar-menus.cjs.map +1 -0
  106. package/dist/components/data/data-table/data-table-toolbar-menus.d.cts +21 -0
  107. package/dist/components/data/data-table/data-table-toolbar-menus.d.ts +21 -0
  108. package/dist/components/data/data-table/data-table-toolbar-menus.js +3 -0
  109. package/dist/components/data/data-table/data-table-toolbar-menus.js.map +1 -0
  110. package/dist/components/data/data-table/data-table-toolbar.cjs +3 -0
  111. package/dist/components/data/data-table/data-table-toolbar.cjs.map +1 -0
  112. package/dist/components/data/data-table/data-table-toolbar.d.cts +36 -0
  113. package/dist/components/data/data-table/data-table-toolbar.d.ts +36 -0
  114. package/dist/components/data/data-table/data-table-toolbar.js +3 -0
  115. package/dist/components/data/data-table/data-table-toolbar.js.map +1 -0
  116. package/dist/components/data/data-table/data-table-types.cjs +3 -0
  117. package/dist/components/data/data-table/data-table-types.cjs.map +1 -0
  118. package/dist/components/data/data-table/data-table-types.d.cts +536 -0
  119. package/dist/components/data/data-table/data-table-types.d.ts +536 -0
  120. package/dist/components/data/data-table/data-table-types.js +2 -0
  121. package/dist/components/data/data-table/data-table-types.js.map +1 -0
  122. package/dist/components/data/data-table/data-table.cjs +3 -0
  123. package/dist/components/data/data-table/data-table.cjs.map +1 -0
  124. package/dist/components/data/data-table/data-table.d.cts +10 -0
  125. package/dist/components/data/data-table/data-table.d.ts +10 -0
  126. package/dist/components/data/data-table/data-table.js +3 -0
  127. package/dist/components/data/data-table/data-table.js.map +1 -0
  128. package/dist/components/data/data-table/index.cjs +3 -0
  129. package/dist/components/data/data-table/index.cjs.map +1 -0
  130. package/dist/components/data/data-table/index.d.cts +16 -0
  131. package/dist/components/data/data-table/index.d.ts +16 -0
  132. package/dist/components/data/data-table/index.js +3 -0
  133. package/dist/components/data/data-table/index.js.map +1 -0
  134. package/dist/components/data/data-table/use-table-filter-param.cjs +3 -0
  135. package/dist/components/data/data-table/use-table-filter-param.cjs.map +1 -0
  136. package/dist/components/data/data-table/use-table-filter-param.d.cts +37 -0
  137. package/dist/components/data/data-table/use-table-filter-param.d.ts +37 -0
  138. package/dist/components/data/data-table/use-table-filter-param.js +3 -0
  139. package/dist/components/data/data-table/use-table-filter-param.js.map +1 -0
  140. package/dist/components/data/data-table/use-table-persist.cjs +3 -0
  141. package/dist/components/data/data-table/use-table-persist.cjs.map +1 -0
  142. package/dist/components/data/data-table/use-table-persist.d.cts +36 -0
  143. package/dist/components/data/data-table/use-table-persist.d.ts +36 -0
  144. package/dist/components/data/data-table/use-table-persist.js +3 -0
  145. package/dist/components/data/data-table/use-table-persist.js.map +1 -0
  146. package/dist/components/data/data-template/data-template-action-bar.cjs +3 -0
  147. package/dist/components/data/data-template/data-template-action-bar.cjs.map +1 -0
  148. package/dist/components/data/data-template/data-template-action-bar.d.cts +14 -0
  149. package/dist/components/data/data-template/data-template-action-bar.d.ts +14 -0
  150. package/dist/components/data/data-template/data-template-action-bar.js +3 -0
  151. package/dist/components/data/data-template/data-template-action-bar.js.map +1 -0
  152. package/dist/components/data/data-template/data-template-pagination.cjs +3 -0
  153. package/dist/components/data/data-template/data-template-pagination.cjs.map +1 -0
  154. package/dist/components/data/data-template/data-template-pagination.d.cts +17 -0
  155. package/dist/components/data/data-template/data-template-pagination.d.ts +17 -0
  156. package/dist/components/data/data-template/data-template-pagination.js +3 -0
  157. package/dist/components/data/data-template/data-template-pagination.js.map +1 -0
  158. package/dist/components/data/data-template/data-template-toolbar.cjs +3 -0
  159. package/dist/components/data/data-template/data-template-toolbar.cjs.map +1 -0
  160. package/dist/components/data/data-template/data-template-toolbar.d.cts +27 -0
  161. package/dist/components/data/data-template/data-template-toolbar.d.ts +27 -0
  162. package/dist/components/data/data-template/data-template-toolbar.js +3 -0
  163. package/dist/components/data/data-template/data-template-toolbar.js.map +1 -0
  164. package/dist/components/data/data-template/data-template-types.cjs +3 -0
  165. package/dist/components/data/data-template/data-template-types.cjs.map +1 -0
  166. package/dist/components/data/data-template/data-template-types.d.cts +105 -0
  167. package/dist/components/data/data-template/data-template-types.d.ts +105 -0
  168. package/dist/components/data/data-template/data-template-types.js +2 -0
  169. package/dist/components/data/data-template/data-template-types.js.map +1 -0
  170. package/dist/components/data/data-template/data-template.cjs +3 -0
  171. package/dist/components/data/data-template/data-template.cjs.map +1 -0
  172. package/dist/components/data/data-template/data-template.d.cts +8 -0
  173. package/dist/components/data/data-template/data-template.d.ts +8 -0
  174. package/dist/components/data/data-template/data-template.js +3 -0
  175. package/dist/components/data/data-template/data-template.js.map +1 -0
  176. package/dist/components/data/data-template/index.cjs +3 -0
  177. package/dist/components/data/data-template/index.cjs.map +1 -0
  178. package/dist/components/data/data-template/index.d.cts +8 -0
  179. package/dist/components/data/data-template/index.d.ts +8 -0
  180. package/dist/components/data/data-template/index.js +3 -0
  181. package/dist/components/data/data-template/index.js.map +1 -0
  182. package/dist/components/date-helper.cjs +0 -0
  183. package/dist/components/date-helper.cjs.map +0 -0
  184. package/dist/components/date-helper.d.cts +0 -0
  185. package/dist/components/date-helper.d.ts +0 -0
  186. package/dist/components/date-helper.js +0 -0
  187. package/dist/components/date-helper.js.map +0 -0
  188. package/dist/components/general.cjs +0 -0
  189. package/dist/components/general.cjs.map +0 -0
  190. package/dist/components/general.d.cts +0 -0
  191. package/dist/components/general.d.ts +0 -0
  192. package/dist/components/general.js +0 -0
  193. package/dist/components/general.js.map +0 -0
  194. package/dist/components/helper/date-filter.cjs +3 -0
  195. package/dist/components/helper/date-filter.cjs.map +1 -0
  196. package/dist/components/helper/date-filter.d.cts +19 -0
  197. package/dist/components/helper/date-filter.d.ts +19 -0
  198. package/dist/components/helper/date-filter.js +3 -0
  199. package/dist/components/helper/date-filter.js.map +1 -0
  200. package/dist/components/layouts/app-container.cjs +3 -0
  201. package/dist/components/layouts/app-container.cjs.map +1 -0
  202. package/dist/components/layouts/app-container.d.cts +11 -0
  203. package/dist/components/layouts/app-container.d.ts +11 -0
  204. package/dist/components/layouts/app-container.js +3 -0
  205. package/dist/components/layouts/app-container.js.map +1 -0
  206. package/dist/components/layouts/app-content.cjs +3 -0
  207. package/dist/components/layouts/app-content.cjs.map +1 -0
  208. package/dist/components/layouts/app-content.d.cts +53 -0
  209. package/dist/components/layouts/app-content.d.ts +53 -0
  210. package/dist/components/layouts/app-content.js +3 -0
  211. package/dist/components/layouts/app-content.js.map +1 -0
  212. package/dist/components/layouts/app-footer.cjs +3 -0
  213. package/dist/components/layouts/app-footer.cjs.map +1 -0
  214. package/dist/components/layouts/app-footer.d.cts +17 -0
  215. package/dist/components/layouts/app-footer.d.ts +17 -0
  216. package/dist/components/layouts/app-footer.js +3 -0
  217. package/dist/components/layouts/app-footer.js.map +1 -0
  218. package/dist/components/layouts/app-header.cjs +3 -0
  219. package/dist/components/layouts/app-header.cjs.map +1 -0
  220. package/dist/components/layouts/app-header.d.cts +32 -0
  221. package/dist/components/layouts/app-header.d.ts +32 -0
  222. package/dist/components/layouts/app-header.js +3 -0
  223. package/dist/components/layouts/app-header.js.map +1 -0
  224. package/dist/components/layouts/index.cjs +3 -0
  225. package/dist/components/layouts/index.cjs.map +1 -0
  226. package/dist/components/layouts/index.d.cts +7 -0
  227. package/dist/components/layouts/index.d.ts +7 -0
  228. package/dist/components/layouts/index.js +3 -0
  229. package/dist/components/layouts/index.js.map +1 -0
  230. package/dist/components/ui/badge.cjs +3 -0
  231. package/dist/components/ui/badge.cjs.map +1 -0
  232. package/dist/components/ui/badge.d.cts +13 -0
  233. package/dist/components/ui/badge.d.ts +13 -0
  234. package/dist/components/ui/badge.js +3 -0
  235. package/dist/components/ui/badge.js.map +1 -0
  236. package/dist/components/ui/button.cjs +3 -0
  237. package/dist/components/ui/button.cjs.map +1 -0
  238. package/dist/components/ui/button.d.cts +14 -0
  239. package/dist/components/ui/button.d.ts +14 -0
  240. package/dist/components/ui/button.js +3 -0
  241. package/dist/components/ui/button.js.map +1 -0
  242. package/dist/components/ui/calendar.cjs +3 -0
  243. package/dist/components/ui/calendar.cjs.map +1 -0
  244. package/dist/components/ui/calendar.d.cts +13 -0
  245. package/dist/components/ui/calendar.d.ts +13 -0
  246. package/dist/components/ui/calendar.js +3 -0
  247. package/dist/components/ui/calendar.js.map +1 -0
  248. package/dist/components/ui/card.cjs +3 -0
  249. package/dist/components/ui/card.cjs.map +1 -0
  250. package/dist/components/ui/card.d.cts +12 -0
  251. package/dist/components/ui/card.d.ts +12 -0
  252. package/dist/components/ui/card.js +3 -0
  253. package/dist/components/ui/card.js.map +1 -0
  254. package/dist/components/ui/checkbox.cjs +3 -0
  255. package/dist/components/ui/checkbox.cjs.map +1 -0
  256. package/dist/components/ui/checkbox.d.cts +7 -0
  257. package/dist/components/ui/checkbox.d.ts +7 -0
  258. package/dist/components/ui/checkbox.js +3 -0
  259. package/dist/components/ui/checkbox.js.map +1 -0
  260. package/dist/components/ui/command.cjs +3 -0
  261. package/dist/components/ui/command.cjs.map +1 -0
  262. package/dist/components/ui/command.d.cts +20 -0
  263. package/dist/components/ui/command.d.ts +20 -0
  264. package/dist/components/ui/command.js +3 -0
  265. package/dist/components/ui/command.js.map +1 -0
  266. package/dist/components/ui/dialog.cjs +3 -0
  267. package/dist/components/ui/dialog.cjs.map +1 -0
  268. package/dist/components/ui/dialog.d.cts +16 -0
  269. package/dist/components/ui/dialog.d.ts +16 -0
  270. package/dist/components/ui/dialog.js +3 -0
  271. package/dist/components/ui/dialog.js.map +1 -0
  272. package/dist/components/ui/dropdown-menu.cjs +3 -0
  273. package/dist/components/ui/dropdown-menu.cjs.map +1 -0
  274. package/dist/components/ui/dropdown-menu.d.cts +28 -0
  275. package/dist/components/ui/dropdown-menu.d.ts +28 -0
  276. package/dist/components/ui/dropdown-menu.js +3 -0
  277. package/dist/components/ui/dropdown-menu.js.map +1 -0
  278. package/dist/components/ui/input.cjs +3 -0
  279. package/dist/components/ui/input.cjs.map +1 -0
  280. package/dist/components/ui/input.d.cts +6 -0
  281. package/dist/components/ui/input.d.ts +6 -0
  282. package/dist/components/ui/input.js +3 -0
  283. package/dist/components/ui/input.js.map +1 -0
  284. package/dist/components/ui/popover.cjs +3 -0
  285. package/dist/components/ui/popover.cjs.map +1 -0
  286. package/dist/components/ui/popover.d.cts +10 -0
  287. package/dist/components/ui/popover.d.ts +10 -0
  288. package/dist/components/ui/popover.js +3 -0
  289. package/dist/components/ui/popover.js.map +1 -0
  290. package/dist/components/ui/select.cjs +3 -0
  291. package/dist/components/ui/select.cjs.map +1 -0
  292. package/dist/components/ui/select.d.cts +18 -0
  293. package/dist/components/ui/select.d.ts +18 -0
  294. package/dist/components/ui/select.js +3 -0
  295. package/dist/components/ui/select.js.map +1 -0
  296. package/dist/components/ui/separator.cjs +3 -0
  297. package/dist/components/ui/separator.cjs.map +1 -0
  298. package/dist/components/ui/separator.d.cts +7 -0
  299. package/dist/components/ui/separator.d.ts +7 -0
  300. package/dist/components/ui/separator.js +3 -0
  301. package/dist/components/ui/separator.js.map +1 -0
  302. package/dist/components/ui/sheet.cjs +3 -0
  303. package/dist/components/ui/sheet.cjs.map +1 -0
  304. package/dist/components/ui/sheet.d.cts +18 -0
  305. package/dist/components/ui/sheet.d.ts +18 -0
  306. package/dist/components/ui/sheet.js +3 -0
  307. package/dist/components/ui/sheet.js.map +1 -0
  308. package/dist/components/ui/table.cjs +3 -0
  309. package/dist/components/ui/table.cjs.map +1 -0
  310. package/dist/components/ui/table.d.cts +13 -0
  311. package/dist/components/ui/table.d.ts +13 -0
  312. package/dist/components/ui/table.js +3 -0
  313. package/dist/components/ui/table.js.map +1 -0
  314. package/dist/components/ui/toggle.cjs +3 -0
  315. package/dist/components/ui/toggle.cjs.map +1 -0
  316. package/dist/components/ui/toggle.d.cts +16 -0
  317. package/dist/components/ui/toggle.d.ts +16 -0
  318. package/dist/components/ui/toggle.js +3 -0
  319. package/dist/components/ui/toggle.js.map +1 -0
  320. package/dist/components/ui/tooltip.cjs +3 -0
  321. package/dist/components/ui/tooltip.cjs.map +1 -0
  322. package/dist/components/ui/tooltip.d.cts +10 -0
  323. package/dist/components/ui/tooltip.d.ts +10 -0
  324. package/dist/components/ui/tooltip.js +3 -0
  325. package/dist/components/ui/tooltip.js.map +1 -0
  326. package/dist/index.cjs +1 -1
  327. package/dist/index.cjs.map +1 -1
  328. package/dist/index.d.cts +28 -920
  329. package/dist/index.d.ts +28 -920
  330. package/dist/index.js +1 -1
  331. package/dist/index.js.map +1 -1
  332. package/dist/lib/utils.cjs +0 -0
  333. package/dist/lib/utils.cjs.map +0 -0
  334. package/dist/lib/utils.d.cts +0 -0
  335. package/dist/lib/utils.d.ts +0 -0
  336. package/dist/lib/utils.js +0 -0
  337. package/dist/lib/utils.js.map +0 -0
  338. package/package.json +92 -92
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
1
  "use client"
2
- import{flexRender as _a,getCoreRowModel as Oa,getFilteredRowModel as Va,getPaginationRowModel as Ha,getSortedRowModel as ja,useReactTable as $a}from"@tanstack/react-table";import{Loader2 as Zn}from"lucide-react";import{Slot as jr}from"radix-ui";import{cva as $r}from"class-variance-authority";import{clsx as Vr}from"clsx";import{twMerge as Hr}from"tailwind-merge";function r(...e){return Hr(Vr(e))}import{jsx as Ur}from"react/jsx-runtime";var to=$r("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-[color,box-shadow] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 dark:focus-visible:border-ring",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function y({className:e,variant:t,size:o,asChild:n=!1,...s}){let l=n?jr.Slot:"button";return Ur(l,{"data-slot":"button",className:r(to({variant:t,size:o,className:e})),...s})}import{jsx as rt}from"react/jsx-runtime";function No({className:e,...t}){return rt("div",{"data-slot":"table-container",className:"relative w-full h-full max-h-full overflow-auto",children:rt("table",{"data-slot":"table",className:r("w-full caption-bottom text-sm",e),...t})})}function tn({className:e,...t}){return rt("thead",{"data-slot":"table-header",className:r("[&_tr]:border-b",e),...t})}function on({className:e,...t}){return rt("tbody",{"data-slot":"table-body",className:r("[&_tr:last-child]:border-0",e),...t})}function oo({className:e,...t}){return rt("tfoot",{"data-slot":"table-footer",className:r("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",e),...t})}function Fe({className:e,...t}){return rt("tr",{"data-slot":"table-row",className:r("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t})}function nn({className:e,...t}){return rt("th",{"data-slot":"table-head",className:r("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap",e),...t})}function je({className:e,...t}){return rt("td",{"data-slot":"table-cell",className:r("p-2 align-middle whitespace-nowrap",e),...t})}import{jsx as rn}from"react/jsx-runtime";function Xe({className:e,...t}){return rn("div",{"data-slot":"card",className:r("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function Ye({className:e,...t}){return rn("div",{"data-slot":"card-content",className:r("px-6",e),...t})}import{Tooltip as Rt}from"radix-ui";import{jsx as Mt,jsxs as Wr}from"react/jsx-runtime";function yt({delayDuration:e=0,...t}){return Mt(Rt.Provider,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function at({...e}){return Mt(yt,{children:Mt(Rt.Root,{"data-slot":"tooltip",...e})})}function it({...e}){return Mt(Rt.Trigger,{"data-slot":"tooltip-trigger",...e})}function st({className:e,sideOffset:t=0,children:o,...n}){return Mt(Rt.Portal,{children:Wr(Rt.Content,{"data-slot":"tooltip-content",sideOffset:t,className:r("bg-primary text-primary-foreground 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 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...n,children:[o,Mt(Rt.Arrow,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}import{Search as ma,RefreshCw as pa,Download as ga,Settings2 as fa,Filter as Tn,FilterX as ba,ArrowUpDown as ha,PinOff as xa,ChevronDown as va,Calculator as ya,Check as wa,X as Ca}from"lucide-react";import{jsx as Kr}from"react/jsx-runtime";function zt({className:e,type:t,...o}){return Kr("input",{type:t,"data-slot":"input",className:r("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...o})}import{DropdownMenu as xe}from"radix-ui";import{CheckIcon as qr,ChevronRightIcon as Jr,CircleIcon as ds}from"lucide-react";import{jsx as be,jsxs as dn}from"react/jsx-runtime";function Ae({...e}){return be(xe.Root,{"data-slot":"dropdown-menu",...e})}function Ie({...e}){return be(xe.Trigger,{"data-slot":"dropdown-menu-trigger",...e})}function Be({className:e,sideOffset:t=4,...o}){return be(xe.Portal,{children:be(xe.Content,{"data-slot":"dropdown-menu-content",sideOffset:t,className:r("bg-popover text-popover-foreground 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 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) rounded-md border p-1 shadow-md",e),...o})})}function To({...e}){return be(xe.Group,{"data-slot":"dropdown-menu-group",...e})}function Y({className:e,inset:t,variant:o="default",...n}){return be(xe.Item,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":o,className:r("cursor-pointer focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...n})}function no({className:e,children:t,checked:o,...n}){return dn(xe.CheckboxItem,{"data-slot":"dropdown-menu-checkbox-item",className:r("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),checked:o,...n,children:[be("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:be(xe.ItemIndicator,{children:be(qr,{className:"size-4"})})}),t]})}function ue({className:e,inset:t,...o}){return be(xe.Label,{"data-slot":"dropdown-menu-label","data-inset":t,className:r("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...o})}function he({className:e,...t}){return be(xe.Separator,{"data-slot":"dropdown-menu-separator",className:r("bg-border -mx-1 my-1 h-px",e),...t})}function an({...e}){return be(xe.Sub,{"data-slot":"dropdown-menu-sub",...e})}function sn({className:e,inset:t,children:o,...n}){return dn(xe.SubTrigger,{"data-slot":"dropdown-menu-sub-trigger","data-inset":t,className:r("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",e),...n,children:[o,be(Jr,{className:"ml-auto size-4"})]})}function ln({className:e,...t}){return be(xe.SubContent,{"data-slot":"dropdown-menu-sub-content",className:r("bg-popover text-popover-foreground 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 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",e),...t})}var Xr=new Set(["select","serialNumber"]);function ro(e){let t=e.getVisibleLeafColumns().filter(n=>Xr.has(n.id)?!1:!!n.columnDef.exportValue||!!n.accessorFn),o=e.getPrePaginationRowModel().rows;return{columns:t.map(n=>{let s=n.columnDef;return{id:n.id,header:s.exportHeader??(typeof s.header=="string"?s.header:n.id)}}),rows:o.map(n=>t.map(s=>{let l=s.columnDef;return l.exportValue?l.exportValue(n.original):n.getValue(s.id)})),originals:o.map(n=>n.original)}}import{useEffect as Na,useRef as Sn,useState as Pn}from"react";import{useEffect as oa,useState as fn}from"react";import{Calendar as na}from"lucide-react";import{format as ra}from"date-fns";import{Popover as ao}from"radix-ui";import{jsx as io}from"react/jsx-runtime";function cn({...e}){return io(ao.Root,{"data-slot":"popover",...e})}function un({...e}){return io(ao.Trigger,{"data-slot":"popover-trigger",...e})}function mn({className:e,align:t="center",sideOffset:o=4,...n}){return io(ao.Portal,{children:io(ao.Content,{"data-slot":"popover-content",align:t,sideOffset:o,className:r("bg-popover text-popover-foreground 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 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...n})})}import*as so from"react";import{ChevronDownIcon as Yr,ChevronLeftIcon as Qr,ChevronRightIcon as Zr}from"lucide-react";import{DayPicker as ea,getDefaultClassNames as pn}from"react-day-picker";import{jsx as lt}from"react/jsx-runtime";function gn({className:e,classNames:t,showOutsideDays:o=!0,captionLayout:n="label",buttonVariant:s="ghost",formatters:l,components:c,...a}){let i=pn();return lt(ea,{showOutsideDays:o,className:r("bg-background group/calendar p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,e),captionLayout:n,formatters:{formatMonthDropdown:m=>m.toLocaleString("default",{month:"short"}),...l},classNames:{root:r("w-fit",i.root),months:r("flex gap-4 flex-col md:flex-row relative",i.months),month:r("flex flex-col w-full gap-4",i.month),nav:r("flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between",i.nav),button_previous:r(to({variant:s}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",i.button_previous),button_next:r(to({variant:s}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",i.button_next),month_caption:r("flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)",i.month_caption),dropdowns:r("w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5",i.dropdowns),dropdown_root:r("relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md",i.dropdown_root),dropdown:r("absolute bg-popover inset-0 opacity-0",i.dropdown),caption_label:r("select-none font-medium",n==="label"?"text-sm":"rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-muted-foreground [&>svg]:size-3.5",i.caption_label),table:"w-full border-collapse",weekdays:r("flex",i.weekdays),weekday:r("text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none",i.weekday),week:r("flex w-full mt-2",i.week),week_number_header:r("select-none w-(--cell-size)",i.week_number_header),week_number:r("text-[0.8rem] select-none text-muted-foreground",i.week_number),day:r("relative w-full h-full p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none",i.day),range_start:r("rounded-l-md bg-accent",i.range_start),range_middle:r("rounded-none",i.range_middle),range_end:r("rounded-r-md bg-accent",i.range_end),today:r("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",i.today),outside:r("text-muted-foreground aria-selected:text-muted-foreground",i.outside),disabled:r("text-muted-foreground opacity-50",i.disabled),hidden:r("invisible",i.hidden),...t},components:{Root:({className:m,rootRef:g,...p})=>lt("div",{"data-slot":"calendar",ref:g,className:r(m),...p}),Chevron:({className:m,orientation:g,...p})=>g==="left"?lt(Qr,{className:r("size-4",m),...p}):g==="right"?lt(Zr,{className:r("size-4",m),...p}):lt(Yr,{className:r("size-4",m),...p}),DayButton:ta,WeekNumber:({children:m,...g})=>lt("td",{...g,children:lt("div",{className:"flex size-(--cell-size) items-center justify-center text-center",children:m})}),...c},...a})}function ta({className:e,day:t,modifiers:o,...n}){let s=pn(),l=so.useRef(null);return so.useEffect(()=>{o.focused&&l.current?.focus()},[o.focused]),lt(y,{ref:l,variant:"ghost",size:"icon","data-day":t.date.toLocaleDateString(),"data-selected-single":o.selected&&!o.range_start&&!o.range_end&&!o.range_middle,"data-range-start":o.range_start,"data-range-end":o.range_end,"data-range-middle":o.range_middle,className:r("data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70",s.day,e),...n})}import{jsx as wt,jsxs as $t}from"react/jsx-runtime";function bn({value:e,onChange:t,placeholder:o,mode:n,externalSearch:s,onExternalChange:l,dateFormat:c,triggerClassName:a}){let i=c?c.replace(/Y/g,"y").replace(/D/g,"d"):null,[m,g]=fn(!1),[p,b]=fn(e);oa(()=>{b(e)},[e]);let d=x=>{if(x==null)return null;if(x instanceof Date)return isNaN(x.getTime())?null:x;let M=new Date(x);return isNaN(M.getTime())?null:M},D=(x,M)=>{let _=d(x);return _?ra(_,M):null},v=x=>{s?l?.(x):t?.(x)},F=()=>{v(p),g(!1)},L=()=>{b(e),g(!1)},O=()=>{let x=n==="single"?null:{from:null,to:null};b(x),v(x),g(!1)},W=()=>{let x=e;if(!x)return o;if(n==="single")return D(x,i||"PPP")??o;if(x.from&&x.to){let M=D(x.from,i||"MMM dd"),_=D(x.to,i||"MMM dd, yyyy");return M&&_?`${M} - ${_}`:o}if(x.from){let M=D(x.from,i||"MMM dd, yyyy");return M?`From ${M}`:o}if(x.to){let M=D(x.to,i||"MMM dd, yyyy");return M?`To ${M}`:o}return o},N=x=>{b(n==="single"?x:x||{from:null,to:null})};return $t(cn,{open:m,onOpenChange:g,children:[wt(un,{className:"h-8",asChild:!0,children:$t(y,{variant:"outline",className:r("w-full justify-start text-left font-normal h-8 rounded-lg",W()===o&&"text-muted-foreground",a),children:[wt(na,{className:"mr-2 h-4 w-4 shrink-0"}),W()]})}),$t(mn,{className:"w-auto p-0",align:"start",children:[wt("div",{className:"p-3",children:wt(gn,{mode:n,selected:p,onSelect:N,numberOfMonths:n==="range"?2:1,className:"rounded-md border",...n==="range"&&{required:!0}})}),$t("div",{className:"flex items-center justify-between p-3 border-t",children:[wt(y,{variant:"ghost",size:"sm",onClick:O,children:"Clear"}),$t("div",{className:"flex gap-2",children:[wt(y,{variant:"outline",size:"sm",onClick:L,children:"Cancel"}),wt(y,{size:"sm",onClick:F,disabled:n==="range"&&(!p?.from||!p?.to),children:"Apply"})]})]})]})]})}import{Calculator as ia,ChevronDown as vn,Columns3 as sa}from"lucide-react";import{Checkbox as hn}from"radix-ui";import{CheckIcon as aa}from"lucide-react";import{jsx as So}from"react/jsx-runtime";function Ct({className:e,...t}){return So(hn.Root,{"data-slot":"checkbox",className:r("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:So(hn.Indicator,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:So(aa,{className:"size-3.5"})})})}import{jsx as V,jsxs as me}from"react/jsx-runtime";var xn=[{value:"sum",label:"Sum",description:"Total of all values"},{value:"average",label:"Average",description:"Mean value"},{value:"min",label:"Minimum",description:"Smallest value"},{value:"max",label:"Maximum",description:"Largest value"},{value:"count",label:"Count",description:"Number of rows"},{value:"unique",label:"Unique",description:"Count of distinct values"},{value:"median",label:"Median",description:"Middle value"}],Po=(e,t)=>(t&&e.startsWith(`${t}.`)?e.replace(`${t}.`,""):e).split("_").map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" ");function Do(e,t){t&&Object.keys(e).forEach(o=>{let n=e[o];n&&t(o,{...n,enabled:!1,functions:[]})})}var yn=e=>e.getAllLeafColumns().filter(t=>t.getCanHide?.()!==!1);function wn({table:e,aggregations:t,onAggregationChange:o}){let n=yn(e).filter(a=>a.id==="select"||a.id==="serialNumber"?!1:a.columnDef.meta?.aggregatable?!0:e.getRowModel().rows.slice(0,5).some(i=>{let m=i.getValue(a.id);return typeof m=="number"||typeof m=="string"&&!isNaN(parseFloat(String(m)))||typeof m=="object"&&m!==null&&"props"in m}));if(n.length===0||!o)return null;let s=Object.values(t).some(a=>a?.enabled),l=a=>{let i=t[a];o(a,{enabled:!i?.enabled,functions:i?.functions||["sum","average"]})},c=(a,i)=>{let m=t[a]?.functions||[],g=m.includes(i)?m.filter(p=>p!==i):[...m,i];o(a,{enabled:g.length>0,functions:g})};return me(Ae,{children:[V(Ie,{asChild:!0,children:me(y,{variant:"outline",size:"sm",className:"gap-1 rounded-lg",children:[V(ia,{className:"size-4"}),V("span",{children:"Aggregations"}),V(vn,{className:"opacity-50 size-4"})]})}),me(Be,{align:"end",className:"w-64 rounded-lg max-h-[500px] overflow-y-auto",children:[me(ue,{className:"flex items-center justify-between px-4 py-2",children:[V("span",{className:"text-sm font-medium",children:"Column Aggregations"}),s&&V(y,{variant:"ghost",size:"sm",className:"h-6 px-2 text-xs",onClick:()=>Do(t,o),children:"Clear All"})]}),V(he,{}),n.map(a=>{let i=t[a.id],m=i?.enabled;return me(an,{children:[V(sn,{className:"text-sm",children:me("div",{className:"flex items-center w-full gap-2",children:[V(Ct,{checked:m,onCheckedChange:()=>l(a.id),className:"data-[state=checked]:bg-primary"}),V("span",{className:r("flex-1",m&&"font-medium text-primary"),children:Po(a.id)}),m&&me("div",{className:"flex items-center gap-1",children:[i?.functions?.slice(0,2).map(g=>V("div",{className:"w-2 h-2 rounded-full bg-primary",title:xn.find(p=>p.value===g)?.label},g)),i?.functions&&i.functions.length>2&&me("div",{className:"text-xs text-muted-foreground",children:["+",i.functions.length-2]})]})]})}),me(ln,{className:"w-48 rounded-lg",children:[V(ue,{className:"px-3 py-2 text-xs font-medium text-muted-foreground",children:"Select Functions"}),xn.map(g=>V(no,{checked:i?.functions?.includes(g.value)||!1,onCheckedChange:()=>c(a.id,g.value),className:"py-2 text-sm",children:me("div",{className:"flex flex-col",children:[V("span",{children:g.label}),V("span",{className:"text-xs text-muted-foreground",children:g.description})]})},g.value))]})]},a.id)})]})]})}function Cn({table:e}){let t=yn(e),o=e.getAllColumns().filter(l=>!e.getAllLeafColumns().includes(l)&&l.columns?.length&&l.columns.some(c=>c.getCanHide?.()!==!1)),n=new Set(o.flatMap(l=>l.columns?.filter(c=>c.getCanHide?.()!==!1).map(c=>c.id)||[])),s=t.filter(l=>!n.has(l.id));return me(Ae,{children:[V(Ie,{asChild:!0,children:me(y,{variant:"outline",size:"sm",className:"gap-1 rounded-lg",children:[V(sa,{className:"size-4"}),V("span",{children:"Columns"}),V(vn,{className:"opacity-50 size-4"})]})}),me(Be,{align:"end",className:"w-[220px] rounded-lg max-h-[400px] overflow-y-auto",children:[V(ue,{className:"px-4 py-2 text-sm font-medium",children:"Toggle Columns"}),V(he,{}),s.length>0&&me(To,{children:[V(ue,{className:"px-4 py-1.5 text-sm font-medium text-muted-foreground",children:"General"}),s.map(l=>V(no,{className:"text-sm",checked:l.getIsVisible(),onCheckedChange:c=>l.toggleVisibility(!!c),children:Po(l.id)},l.id))]}),o.map(l=>me(To,{children:[V(he,{}),V(ue,{className:"px-4 py-1.5 text-sm font-medium text-muted-foreground",children:l.id}),l.columns?.filter(c=>c.getCanHide?.()!==!1).map(c=>V(no,{className:"text-sm",checked:c.getIsVisible(),onCheckedChange:a=>c.toggleVisibility(!!a),children:Po(c.id,l.id)},c.id))]},l.id))]})]})}import{Select as Ne}from"radix-ui";import{CheckIcon as la,ChevronDownIcon as Nn,ChevronUpIcon as da}from"lucide-react";import{jsx as se,jsxs as ko}from"react/jsx-runtime";function dt({...e}){return se(Ne.Root,{"data-slot":"select",...e})}function ct({...e}){return se(Ne.Value,{"data-slot":"select-value",...e})}function ut({className:e,size:t="default",children:o,...n}){return ko(Ne.Trigger,{"data-slot":"select-trigger","data-size":t,className:r("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...n,children:[o,se(Ne.Icon,{asChild:!0,children:se(Nn,{className:"size-4 opacity-50"})})]})}function mt({className:e,children:t,position:o="popper",...n}){return se(Ne.Portal,{children:ko(Ne.Content,{"data-slot":"select-content",className:r("bg-popover text-popover-foreground 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 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",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,...n,children:[se(ca,{}),se(Ne.Viewport,{className:r("p-1",o==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),se(ua,{})]})})}function $e({className:e,children:t,...o}){return ko(Ne.Item,{"data-slot":"select-item",className:r("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...o,children:[se("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:se(Ne.ItemIndicator,{children:se(la,{className:"size-4"})})}),se(Ne.ItemText,{children:t})]})}function ca({className:e,...t}){return se(Ne.ScrollUpButton,{"data-slot":"select-scroll-up-button",className:r("flex cursor-default items-center justify-center py-1",e),...t,children:se(da,{className:"size-4"})})}function ua({className:e,...t}){return se(Ne.ScrollDownButton,{"data-slot":"select-scroll-down-button",className:r("flex cursor-default items-center justify-center py-1",e),...t,children:se(Nn,{className:"size-4"})})}import{Fragment as Ta,jsx as R,jsxs as J}from"react/jsx-runtime";var le=e=>e.id??e.key;function Ro({table:e,filters:t=[],globalFilter:o,onGlobalFilterChange:n,enableGlobalFilter:s=!0,onExport:l,onRefresh:c,loading:a=!1,enableColumnVisibility:i=!0,onClearSorting:m,onClearFilters:g,enableColumnPinning:p=!1,enableSorting:b=!0,onExternalSearch:d,initialExternalValues:D,aggregations:v={},onAggregationChange:F,groupedFilterLabel:L="Global",showFilterChips:O=!0,initialGroupedField:W,onGroupedFieldChange:N}){let[x,M]=Pn(D??{}),[_,K]=Pn(W??"all"),Q=Sn(D??{}),f=Sn(void 0);Na(()=>()=>clearTimeout(f.current),[]);let C=(u,$,re=!1)=>{let Z={...Q.current,[u]:$};Q.current=Z,M(Z),clearTimeout(f.current),re?f.current=setTimeout(()=>d?.(Z),500):d?.(Z)},z=()=>{clearTimeout(f.current),Q.current={},M({}),K("all"),N?.("all"),g(),d?.({})},P=u=>t.find(re=>le(re)===u)?.externalSearch?x[u]??"":e.getColumn(u)?.getFilterValue(),h=(u,$)=>{let re=t.find(Z=>le(Z)===u);re?.externalSearch?C(u,$,re.type==="text"):e.getColumn(u)?.setFilterValue($)},k=u=>{K(u),N?.(u),u!=="all"&&n("")},ne=Object.values(v).some(u=>u?.enabled),I=u=>!!u.externalSearch||!!e.getColumn(le(u)),q=u=>{let $=P(le(u));return $==null||$===""?!1:typeof $=="object"?!!($.from||$.to):!0},fe=u=>u.type==="date"||u.type==="daterange",_e=u=>{h(le(u),fe(u)?null:"")},Oe=u=>{let $=P(le(u));return u.type==="select"?u.options?.find(re=>re.value===$)?.label??String($):fe(u)?"set":String($)},Pe=(u,$)=>{let re=$?.embedded;if(u.type==="select"){let Z=le(u),ht=P(Z);return J(dt,{value:ht?String(ht):"",onValueChange:He=>h(Z,He==="__all__"?"":He),children:[R(ut,{size:"sm",className:r("w-full",re?"border border-transparent rounded-l-none rounded-r-lg shadow-none relative focus-visible:z-10 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]":"rounded-lg"),children:J("span",{className:"flex items-center gap-2 truncate",children:[u.icon&&R(u.icon,{className:"size-4 shrink-0 text-muted-foreground"}),R(ct,{placeholder:u.placeholder})]})}),J(mt,{className:"rounded-lg",children:[R($e,{value:"__all__",children:"All"}),u.options?.map(He=>R($e,{value:He.value,children:He.label},He.value))]})]})}return u.type==="date"||u.type==="daterange"?R(bn,{value:P(le(u)),onChange:Z=>h(le(u),Z),placeholder:u.placeholder,mode:u.type==="daterange"?"range":"single",dateFormat:u.dateFormat,externalSearch:u.externalSearch,onExternalChange:Z=>C(le(u),Z),triggerClassName:re?"border border-transparent rounded-l-none rounded-r-lg shadow-none relative focus-visible:z-10 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]":void 0}):J("div",{className:"relative w-full",children:[u.icon&&R(u.icon,{className:"absolute -translate-y-1/2 size-4 left-3 top-1/2 text-muted-foreground"}),R(zt,{placeholder:u.placeholder,value:P(le(u))??"",onChange:Z=>{h(le(u),Z.target.value)},className:r("h-8",u.icon&&"pl-9",re?"border border-transparent rounded-l-none rounded-r-lg shadow-none relative focus-visible:z-10 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]":"rounded-lg"),type:u.type==="number"?"number":"text"})]})},ce=t.filter(u=>(u.placement??"bar")==="bar"),De=t.filter(u=>u.placement==="menu"),we=s&&De.length>0,tt=De.filter(q),ke=e.getState().columnFilters.length>0||!!o||t.some(q),{left:Et=[],right:Ve=[]}=e.getState().columnPinning,ot=Et.some(u=>u!=="serialNumber"&&u!=="select")||Ve.length>0,j=[{value:"all",label:"All Fields"},...De.map(u=>({value:le(u),label:u.placeholder}))];return J("div",{className:"flex flex-wrap items-center gap-3",children:[ce.length>0&&R(Tn,{className:"size-4 text-muted-foreground shrink-0"}),ce.map(u=>I(u)?R("div",{className:r("relative min-w-[150px]",u.width),children:Pe(u)},le(u)):null),O&&tt.map(u=>J("span",{className:"inline-flex items-center gap-1 h-8 px-2 rounded-lg border bg-muted/50 text-sm",children:[J("span",{className:"text-muted-foreground",children:[u.placeholder,":"]}),R("span",{className:"font-medium truncate max-w-[120px]",children:Oe(u)}),R("button",{type:"button",onClick:()=>_e(u),className:"ml-1 p-0.5 rounded hover:bg-accent","aria-label":`Clear ${u.placeholder}`,children:R(Ca,{className:"size-3.5"})})]},`chip-${le(u)}`)),ke&&J(y,{variant:"ghost",size:"sm",onClick:z,className:"h-8 px-2 rounded-lg text-muted-foreground hover:text-foreground",children:[R(ba,{className:"size-4"}),"Clear Filters"]}),J("div",{className:"flex flex-wrap items-center gap-2 ml-auto",children:[s&&J("div",{className:r("flex items-center",we&&"bg-background border rounded-lg"),children:[we&&J(Ae,{children:[R(Ie,{asChild:!0,children:J(y,{variant:"ghost",size:"sm",className:"gap-1 border border-transparent border-r-border rounded-l-lg rounded-r-none hover:bg-transparent shrink-0 relative focus-visible:z-10 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",children:[R("span",{className:"text-sm font-medium max-w-28 truncate",children:_==="all"?L:j.find(u=>u.value===_)?.label}),R(va,{className:"opacity-50 size-4"})]})}),R(Be,{align:"start",className:"w-48 rounded-lg",children:j.map(u=>J(Y,{onClick:()=>k(u.value),className:"flex items-center justify-between",children:[R("span",{children:u.label}),_===u.value&&R(wa,{className:"size-4 text-primary"})]},u.value))})]}),(()=>{let u=we&&_!=="all"?De.find($=>le($)===_):void 0;return u?R("div",{className:"w-48",children:Pe(u,{embedded:!0})}):J("div",{className:"relative",children:[R(ma,{className:"absolute -translate-y-1/2 size-4 left-3 top-1/2 text-muted-foreground"}),R(zt,{placeholder:we?"Search all fields...":"Global search...",value:o??"",onChange:$=>n($.target.value),className:r("pl-9 h-8 w-48",we&&"border border-transparent rounded-l-none rounded-r-lg shadow-none relative focus-visible:z-10 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]")})]})})()]}),R(wn,{table:e,aggregations:v,onAggregationChange:F}),i&&R(Cn,{table:e}),J(Ae,{children:[R(Ie,{asChild:!0,children:R(y,{variant:"outline",size:"sm",className:"rounded-lg",children:R(fa,{className:"size-4"})})}),J(Be,{align:"end",className:"w-[200px] rounded-lg",children:[R(ue,{children:"Table Settings"}),R(he,{}),l&&J(Y,{onClick:()=>{let u=ro(e);l(u.originals,u)},children:[R(ga,{className:"size-4"}),"Export"]}),b&&J(Y,{onClick:m,disabled:e.getState().sorting.length===0,children:[R(ha,{className:"size-4"}),"Clear All Sorting"]}),J(Y,{onClick:z,disabled:!ke,children:[R(Tn,{className:"size-4"}),"Clear All Filters"]}),Object.keys(v).length>0&&J(Y,{onClick:()=>Do(v,F),disabled:!ne,children:[R(ya,{className:"size-4"}),"Clear Aggregations"]}),p&&J(Ta,{children:[R(he,{}),R(ue,{children:"Column Pinning"}),J(Y,{onClick:()=>e.setColumnPinning({left:[],right:[]}),disabled:!ot,children:[R(xa,{className:"size-4"}),"Reset All Pinning"]})]})]})]}),c&&R(y,{variant:"outline",size:"sm",onClick:c,disabled:a,className:"rounded-lg",children:R(pa,{className:r("h-4 w-4",a&&"animate-spin")})})]})]})}import{ChevronLeft as Sa,ChevronRight as Pa}from"lucide-react";import{Fragment as ka,jsx as Te,jsxs as pt}from"react/jsx-runtime";function Da(e,t,o=1){let n=e+1,s=o*2+5;if(t<=s)return Array.from({length:t},(p,b)=>b+1);let l=Math.max(n-o,1),c=Math.min(n+o,t),a=l>2,i=c<t-1,m=3+o*2,g=[];if(!a&&i){for(let p=1;p<=m;p++)g.push(p);g.push("ellipsis",t)}else if(a&&!i){g.push(1,"ellipsis");for(let p=t-m+1;p<=t;p++)g.push(p)}else{g.push(1,"ellipsis");for(let p=l;p<=c;p++)g.push(p);g.push("ellipsis",t)}return g}function Mo({table:e,config:t}){if(!t)return null;let o=e.getPageCount(),n=e.getState().pagination.pageIndex,s=e.getState().pagination.pageSize,l=e.getFilteredRowModel().rows.length,c="size-8 p-0 rounded-lg";return pt("div",{className:"flex flex-wrap items-center justify-between gap-3 rounded-xl",children:[t.showInfo!==!1&&pt("span",{className:"hidden text-sm text-muted-foreground sm:inline",children:["Showing ",l===0?0:n*s+1," to"," ",Math.min((n+1)*s,l)," of ",l," entries"]}),pt("div",{className:"flex items-center gap-3",children:[(()=>{let a=t.pageSizeOptions??[10,25,50,100,-1];if(a.length===0)return null;let i=a.includes(-1),m=l>0&&s>=l,g=i&&m?"-1":`${s}`;return pt("div",{className:"flex items-center gap-2",children:[Te("span",{className:"hidden text-sm font-medium md:inline",children:"Rows"}),pt(dt,{value:g,onValueChange:p=>e.setPageSize(p==="-1"?Math.max(l,1):Number(p)),children:[Te(ut,{className:"h-8 w-auto min-w-[4rem] gap-1 rounded-lg",children:Te(ct,{})}),Te(mt,{side:"top",className:"rounded-lg",children:a.map(p=>Te($e,{value:`${p}`,children:p===-1?"All":p},p))})]})]})})(),o>1&&pt("div",{className:"flex items-center gap-1",children:[Te(y,{variant:"outline",size:"sm",onClick:()=>e.previousPage(),disabled:!e.getCanPreviousPage(),"aria-label":"Previous page",className:c,children:Te(Sa,{className:"size-4"})}),t.showPageNumbers&&pt(ka,{children:[pt("span",{className:"px-2 text-sm text-muted-foreground tabular-nums sm:hidden",children:[n+1," / ",o]}),Te("div",{className:"hidden items-center gap-1 sm:flex",children:Da(n,o).map((a,i)=>a==="ellipsis"?Te("span",{className:"flex size-8 items-center justify-center text-sm text-muted-foreground",children:"\u2026"},`e${i}`):Te(y,{variant:a-1===n?"default":"outline",size:"sm",className:r(c,"tabular-nums"),onClick:()=>e.setPageIndex(a-1),"aria-label":`Page ${a}`,"aria-current":a-1===n?"page":void 0,children:a},a))})]}),Te(y,{variant:"outline",size:"sm",onClick:()=>e.nextPage(),disabled:!e.getCanNextPage(),"aria-label":"Next page",className:c,children:Te(Pa,{className:"size-4"})})]})]})]})}import{useCallback as _o,useEffect as ve,useMemo as mo,useRef as Ue,useState as Se}from"react";function Nt(e,t){if(!t)return{};let o=e.getIsPinned();if(!o)return{};let n=e.getSize();return{position:"sticky",left:o==="left"?e.getStart("left"):void 0,right:o==="right"?e.getAfter("right"):void 0,width:n,minWidth:n,maxWidth:n,boxShadow:o==="right"&&e.getIsFirstColumn("right")?"inset 1px 0 0 0 var(--border)":void 0}}var Ge=(e,t)=>t||e!==150?e:"auto";function Dn(e){let t=[],o=[],n=new Set,s=c=>{c.forEach((a,i)=>{let m=a.id??a.accessorKey,g=m!=null?String(m):"";if(g&&(a.defaultPin==="left"||a.defaultPin==="right")&&!n.has(g)){n.add(g);let p=Number.isFinite(a.pinIndex)?a.pinIndex:i;(a.defaultPin==="left"?t:o).push({id:g,order:p})}a.columns&&s(a.columns)})};s(e);let l=c=>c.sort((a,i)=>a.order-i.order).map(a=>a.id);return{left:l(t),right:l(o)}}function kn(e,t){return{left:[...t,...(e.left??[]).filter(o=>!t.includes(o))],right:(e.right??[]).filter(o=>!t.includes(o))}}function Rn(e,t,o,n){if(o===!1)e.setColumnSizing(a=>{let i={...a};return delete i[t],i});else{let a=n.container?.querySelector(`[data-col-id="${t}"]`),i=a?Math.round(a.getBoundingClientRect().width):0;i>0&&e.setColumnSizing(m=>({...m,[t]:i}))}let{alwaysPinnedLeft:s}=n,l=e.getState().columnPinning,c={left:(l.left??[]).filter(a=>s.includes(a)),right:[...l.right??[]]};o==="right"?c.right.includes(t)||c.right.push(t):o==="left"?(c.right=c.right.filter(a=>a!==t),!c.left.includes(t)&&!s.includes(t)&&c.left.push(t)):(c.left=c.left.filter(a=>a!==t),c.right=c.right.filter(a=>a!==t)),e.setColumnPinning(c)}var Mn={sum:e=>e.reduce((t,o)=>t+o,0),average:e=>e.length>0?e.reduce((t,o)=>t+o,0)/e.length:0,min:e=>e.length>0?Math.min(...e):0,max:e=>e.length>0?Math.max(...e):0,count:e=>e.length,unique:e=>new Set(e).size,median:e=>{if(e.length===0)return 0;let t=[...e].sort((n,s)=>n-s),o=Math.floor(t.length/2);return t.length%2===0?(t[o-1]+t[o])/2:t[o]}};function zn(e,t){if(!t||Object.keys(t).length===0)return{};let o={},n=e.getFilteredRowModel().rows;return Object.entries(t).forEach(([s,l])=>{if(!l?.enabled)return;let c=n.map(i=>{if(l.accessor)return l.accessor(i.original);let m=i.getValue(s);return typeof m=="number"?m:parseFloat(String(m))}).filter(i=>i!==null&&!isNaN(i)),a={};l.functions?.forEach(i=>{Mn[i]&&(a[i]=Mn[i](c))}),Object.keys(a).length>0&&(o[s]=a)}),o}function Fn(e,t){return typeof t=="number"?e==="count"||e==="unique"?t.toLocaleString():t.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2}):t}function Ra(e,t){return t.split(".").reduce((o,n)=>o&&o[n],e)}function An(e,t=new Set){for(let o of e){let n=o.id??o.accessorKey;n&&t.add(String(n)),o.columns&&An(o.columns,t)}return t}function lo(e,t){let o=An(e),n=[];for(let s of t){if(s.externalSearch)continue;let l=typeof s.filterFn=="function",c=l?s.id:s.key;if(!c||o.has(String(c)))continue;let a=s.key;n.push({id:String(c),accessorFn:a?i=>Ra(i,a):()=>null,...l&&{filterFn:(i,m,g)=>s.filterFn(i.original,g)},enableHiding:!1,enableSorting:!1,enablePinning:!1,enableGlobalFilter:!1,meta:{filterOnly:!0}})}return n}import{jsx as Ft}from"react/jsx-runtime";function In({initialColumns:e,filters:t,showSerialNumbers:o,enableRowSelection:n,selectionMode:s,showCheckbox:l,enableHeaderCheckbox:c,isRowSelectable:a}){let i=p=>p.map(b=>{if(b.id==="select"||b.id==="serialNumber")return b;let d={...b,enablePinning:!0};return b.enableColumnVisibility!==void 0&&b.enableHiding===void 0&&(d.enableHiding=b.enableColumnVisibility),b.columns&&(d.columns=i(b.columns)),d}),m=i([...e]),g={id:"select",header:({table:p})=>{if(s==="single")return null;let b=p.getRowModel().rows.filter(v=>a?.(v.original)??!0),d=b.length>0&&b.every(v=>v.getIsSelected()),D=b.some(v=>v.getIsSelected());return Ft("div",{className:"flex justify-center items-center",children:Ft(Ct,{checked:d||D&&"indeterminate",onCheckedChange:v=>{b.forEach(F=>F.toggleSelected(!!v))},disabled:!c||b.length===0,"aria-label":"Select all selectable rows"})})},cell:({row:p})=>{let b=a?.(p.original)??!0;return Ft("div",{className:r("flex justify-center items-center",!b&&"opacity-50"),children:s==="multiple"?Ft(Ct,{checked:p.getIsSelected(),onCheckedChange:d=>b&&p.toggleSelected(!!d),"aria-label":"Select row",disabled:!b}):l?Ft("input",{type:"radio",checked:p.getIsSelected(),onChange:()=>b&&p.toggleSelected(!0),disabled:!b,className:"border-primary rounded-full focus:ring-primary w-4 h-4 text-primary"}):null})},enableSorting:!1,enableHiding:!1,enablePinning:!1,enableHeaderMenu:!1,headerAlign:"center",size:s==="multiple"?40:30};return n&&m.unshift(g),o&&m.unshift({id:"serialNumber",header:"No.",cell:({row:p})=>Ft("div",{className:"font-medium text-muted-foreground text-center",children:p.index+1}),enableSorting:!0,enableHiding:!1,enablePinning:!0,size:60,headerAlign:"center"}),[...m,...lo(e,t)]}import{useEffect as Ma,useMemo as za,useRef as Wt}from"react";import{useSearchParams as Fa}from"react-router";var Bn="atsui:tbl:v1:",Ao=new Map,Gn=new Map;function Io(e){try{let t=localStorage.getItem(Bn+e);return t?JSON.parse(t):void 0}catch{return}}function Ln(e,t){try{localStorage.setItem(Bn+e,JSON.stringify(t))}catch{}}function En(e){return e?typeof e=="string"?{key:e}:e:null}function co(e,t){return Ao.get(e)??(t?Io(e):void 0)??{}}function Tt(e,t,o){let n={...co(e,t),...o};Ao.set(e,n),t&&Ln(e,n)}var Fo=new Map;function _n(e,t){let o=Fo.get(e);return o||(o=new Set,Fo.set(e,o)),o.add(t),()=>{o.delete(t)}}function Ut(e,t){return{...t?Io("g:"+e)??{}:{},...Gn.get(e)??{}}}function uo(e,t,o,n){let s=Ut(e,t),l=n==null||n==="";if(l?s[o]===void 0:s[o]===n)return;let c={...s};l?delete c[o]:c[o]=n,Gn.set(e,c),t&&Ln("g:"+e,c),Fo.get(e)?.forEach(a=>a())}function On(e,t){if(Tt(e.key,e.local,{filters:{},globalFilter:"",external:{},groupedField:"all"}),e.group)for(let o of t)uo(e.group,e.local,o,void 0)}function Vn(e){return(Ao.get(e)??Io(e))?.external??{}}var zo=new Set;function Hn(e){return zo.has(e)&&console.warn(`[DataTable] persist key "${e}" is used by two mounted tables \u2014 they will overwrite each other's saved state. Give each table a unique key.`),zo.add(e),()=>{zo.delete(e)}}var At="q",Kt="page",qt="pageSize",Bo=e=>{if(e==null||e instanceof Date)return e;let t=new Date(e);return isNaN(t.getTime())?e:t},Jt=e=>{if(e&&typeof e=="object"&&("from"in e||"to"in e)){let t=Bo(e.from),o=Bo(e.to);return t===e.from&&o===e.to?e:{from:t,to:o}}return Bo(e)},Go=e=>{let t=e instanceof Date?e:new Date(e);return isNaN(t.getTime())?"":t.toISOString().slice(0,10)},Aa=e=>{if(e==null)return;let t=typeof e=="object"&&("from"in e||"to"in e),o=Go(t?e.from:e),n=t?Go(e.to):"";if(!(!o&&!n))return t?`${o},${n}`:o},jn=e=>{if(!e.includes(","))return Jt(e);let[t,o]=e.split(",");return Jt({from:t||void 0,to:o||void 0})},$n=e=>{if(e===null)return;let t=Number(e);return Number.isInteger(t)&&t>0?t:void 0};function Un(e,t,o){let n=En(e),[s,l]=Fa(),c=t.map(f=>({id:String(f.id??f.key),shared:f.shared,persist:f.persist!==!1,external:!!f.externalSearch,isDate:f.type==="date"||f.type==="daterange"})),a=Wt(c);a.current=c;let i=za(()=>{if(!n)return{columnFilters:[],globalFilter:"",pagination:{pageIndex:0,pageSize:o},external:{},groupedField:"all"};let f=co(n.key,n.local),C=n.group?Ut(n.group,n.local):{},z=I=>{let q=s.get(I.id);if(q!==null)return I.isDate?jn(q):q;if(I.shared&&n.group){let _e=C[I.shared];return I.isDate?Jt(_e):_e}let fe=f.filters?.[I.id]??f.external?.[I.id];return I.isDate?Jt(fe):fe},P=[],h={};for(let I of c){if(!I.persist)continue;let q=z(I);q==null||q===""||(I.external?h[I.id]=q:P.push({id:I.id,value:q}))}let k=$n(s.get(Kt)),ne=$n(s.get(qt));return{columnFilters:P,globalFilter:s.get(At)??f.globalFilter??"",pagination:{pageIndex:n.pagination===!1?0:k!==void 0?k-1:f.pagination?.pageIndex??0,pageSize:n.pagination===!1?o:ne??f.pagination?.pageSize??o},external:h,groupedField:f.groupedField??"all"}},[]),m=Wt(i.pagination.pageIndex),g=Wt(i.pagination.pageIndex===0);Ma(()=>{if(n)return!n.group&&a.current.some(f=>f.shared)&&console.warn(`[DataTable] persist key "${n.key}": filters use \`shared\` but the table has no \`persist.group\` \u2014 shared is inert. Add a group to enable it.`),Hn(n.key)},[]);let p=Wt({}),b=Wt(!1),d=f=>{if(Object.keys(f).length===0||(Object.assign(p.current,f),b.current))return;b.current=!0;let C=window.location.pathname;queueMicrotask(()=>{b.current=!1;let z=p.current;p.current={},window.location.pathname===C&&D(z)})},D=f=>{let C=new URLSearchParams(window.location.search),z=!1;for(let[P,h]of Object.entries(f)){let k=C.get(P);h===void 0?k!==null&&(C.delete(P),z=!0):k!==h&&(C.set(P,h),z=!0)}z&&l(C,{replace:!0})},v=(f,C)=>f.isDate?Aa(C):C==null||C===""?void 0:String(C),F=f=>{if(!n)return;let C={};for(let h of f)C[h.id]=h.value;let z={},P={};for(let h of a.current)!h.persist||h.external||(h.shared&&n.group?uo(n.group,n.local,h.shared,C[h.id]):C[h.id]!==void 0&&(z[h.id]=C[h.id]),P[h.id]=v(h,C[h.id]));Tt(n.key,n.local,{filters:z}),d(P)},L=f=>{n&&(Tt(n.key,n.local,{globalFilter:f}),d({[At]:f||void 0}))},O=f=>{if(!n)return;let C={},z={};for(let P of a.current)!P.persist||!P.external||(P.shared&&n.group?uo(n.group,n.local,P.shared,f[P.id]):f[P.id]!==void 0&&(C[P.id]=f[P.id]),z[P.id]=v(P,f[P.id]));Tt(n.key,n.local,{external:C}),d(z)},W=f=>{!n||n.pagination===!1||g.current&&(Tt(n.key,n.local,{pagination:{pageIndex:f.pageIndex,pageSize:f.pageSize}}),d({[Kt]:f.pageIndex>0?String(f.pageIndex+1):void 0,[qt]:f.pageSize!==o?String(f.pageSize):void 0}))},N=(f,C)=>{if(!n||g.current||f.getCoreRowModel().rows.length===0)return;let z=Math.min(m.current,Math.max(f.getPageCount()-1,0));g.current=!0,z>0&&C({pageIndex:z,pageSize:f.getState().pagination.pageSize})},x=()=>!!n&&n.pagination!==!1&&!g.current,M=f=>{n&&Tt(n.key,n.local,{groupedField:f})},_=f=>{if(!n?.group)return;let C=n.group,z=a.current.filter(P=>P.shared&&P.persist&&!P.external);if(z.length!==0)return _n(C,()=>{let P=Ut(C,n.local);for(let h of z){let k=f.getColumn(h.id);if(!k)continue;let ne=P[h.shared],I=ne===void 0?void 0:h.isDate?Jt(ne):ne,q=k.getFilterValue();Object.is(q??void 0,I??void 0)||k.setFilterValue(I)}})},K=f=>{if(!n)return;let C={},z=co(n.key,n.local),P=n.group?Ut(n.group,n.local):{};for(let h of a.current){if(!h.persist||h.id in p.current)continue;let k=s.get(h.id);if(h.external){if(k===null){let q=v(h,h.shared&&n.group?P[h.shared]:z.external?.[h.id]);q!==void 0&&(C[h.id]=q)}continue}let ne=f.getColumn(h.id);if(!ne)continue;let I=v(h,ne.getFilterValue())??null;if(k!==I){if(k===null){I!==null&&(C[h.id]=I);continue}ne.setFilterValue(k===""?void 0:h.isDate?jn(k):k)}}if(!(At in p.current)){let h=s.get(At),k=f.getState().globalFilter??"";h===null?k!==""&&(C[At]=k):h!==k&&f.setGlobalFilter(h)}if(n.pagination!==!1&&g.current){let h=z.pagination;h&&!(Kt in p.current)&&s.get(Kt)===null&&h.pageIndex>0&&(C[Kt]=String(h.pageIndex+1)),h&&!(qt in p.current)&&s.get(qt)===null&&h.pageSize!==o&&(C[qt]=String(h.pageSize))}d(C)},Q=()=>{if(!n)return;On(n,a.current.filter(C=>C.shared).map(C=>C.shared));let f={[At]:void 0};for(let C of a.current)C.persist&&(f[C.id]=void 0);d(f)};return{enabled:!!n,initial:i,searchParamsKey:s.toString(),persistFilters:F,persistGlobalFilter:L,persistExternal:O,persistPagination:W,persistGroupedField:M,restorePageIndex:N,syncSharedSlots:_,applyURLToTable:K,clearAll:Q,pendingPageRestore:x}}import{flexRender as Wn}from"@tanstack/react-table";import{ChevronUp as Kn,ChevronDown as qn,ChevronsUpDown as Jn,EyeOff as Ia,MoreHorizontal as Ba,MoveLeftIcon as Ga,MoveRightIcon as La,PinOffIcon as Ea,Calculator as Xn}from"lucide-react";import{Fragment as Lo,jsx as H,jsxs as de}from"react/jsx-runtime";function Yn({table:e,aggregations:t,enableColumnPinning:o,enableColumnResizing:n,enableColumnVisibility:s,enableRowSelection:l,fixedCheckboxColumn:c,bordered:a,compact:i,onPinColumn:m}){let g=e.getVisibleLeafColumns().filter(b=>!b.getIsPinned()),p=g[g.length-1]?.id;return H(Lo,{children:e.getHeaderGroups().map(b=>H(Fe,{className:"hover:bg-transparent",children:b.headers.map((d,D)=>{let v=d.depth===0&&d.colSpan>1,F=o&&(d.column.getIsPinned()==="left"||d.column.id==="serialNumber"||d.column.id==="select"&&l),L=o&&d.column.getIsPinned()==="right",O=d.column.getCanSort(),W=o&&d.column.columnDef.enablePinning!==!1,N=d.column.id==="serialNumber",x=d.column.id==="select",M=N||x&&c,_=d.column.columnDef.headerAlign||"left",K=t&&t[d.column.id]?.enabled,Q=s&&!M&&d.column.getCanHide(),C=d.column.columnDef.enableHeaderMenu!==!1&&(O||W&&!M||Q),z=d.column.getIsSorted(),P=d.column.columnDef.reserveMenuSpace===!0,h={left:"justify-start",center:"justify-center",right:"justify-end"}[_];return de(nn,{colSpan:d.colSpan,"data-col-id":v?void 0:d.column.id,className:r("group bg-sidebar px-0 font-semibold text-foreground",!i&&"py-2",a&&D<b.headers.length-1&&d.column.id!==p&&"border-r","relative",F&&"sticky left-0 z-25 bg-sidebar/95",L&&"sticky right-0 z-25 bg-sidebar/95",(N||x)&&"sticky left-0 z-25 bg-sidebar/95",v?"text-center":"text-left"),style:{width:Ge(d.getSize(),F||L),minWidth:Ge(d.getSize(),F||L),...Nt(d.column,o)},children:[v?de("div",{className:"flex justify-center items-center",children:[Wn(d.column.columnDef.header,d.getContext()),K&&H(Xn,{className:"ml-1 w-3 h-3 text-primary"})]}):de("div",{className:r("relative flex items-center px-2 w-full",h,O&&"cursor-pointer select-none"),onClick:O?k=>{k.target.closest("button, a, input, select, [role=button], [role=checkbox]")||d.column.getToggleSortingHandler()?.(k)}:void 0,children:[de("div",{className:r("flex items-center gap-1 min-w-0 max-w-full",z&&(_==="right"?"pl-6":"pr-6"),P&&(_==="right"?C?"pl-12":"pl-6":C?"pr-12":"pr-6")),children:[K&&H(Xn,{className:"mr-1 w-3 h-3 text-primary shrink-0"}),d.isPlaceholder?null:H("span",{className:"truncate",children:Wn(d.column.columnDef.header,d.getContext())})]}),(C||O)&&de("div",{className:r("absolute inset-y-0 flex items-center pointer-events-none",_==="right"?"left-0 pr-8 pl-1 flex-row-reverse":"right-0 pl-8 pr-1"),children:[H("div",{className:r("absolute inset-0 from-sidebar from-45% to-transparent",_==="right"?"bg-gradient-to-r":"bg-gradient-to-l","transition-opacity duration-200 ease-out","opacity-0 group-hover:opacity-100 group-has-[[data-state=open]]:opacity-100")}),O&&H("span",{className:"relative shrink-0",children:z?z==="asc"?H(Kn,{className:"w-4 h-4"}):H(qn,{className:"w-4 h-4"}):H(Jn,{className:"w-3.5 h-3.5 opacity-0 group-hover:opacity-40 transition-opacity"})}),C&&de(Ae,{children:[H(Ie,{asChild:!0,children:H(y,{variant:"ghost",size:"icon",tabIndex:-1,"aria-label":"Column options",onClick:k=>k.stopPropagation(),className:r("relative size-6 rounded-sm pointer-events-auto overflow-hidden","bg-sidebar hover:bg-border dark:bg-sidebar dark:hover:bg-accent","w-0 opacity-0 group-hover:w-5 group-hover:opacity-100",_==="right"?"mr-0":"ml-0",O&&(_==="right"?"group-hover:mr-0.5":"group-hover:ml-0.5"),"data-[state=open]:w-5 data-[state=open]:opacity-100",O&&(_==="right"?"data-[state=open]:mr-0.5":"data-[state=open]:ml-0.5"),"transition-all duration-200 ease-out"),children:H(Ba,{className:"w-4 h-4"})})}),de(Be,{align:"end",className:"w-48",onClick:k=>k.stopPropagation(),children:[O&&de(Lo,{children:[H(ue,{children:"Sorting"}),de(Y,{onClick:()=>d.column.toggleSorting(!1),disabled:z==="asc",children:[H(Kn,{className:"mr-2 w-4 h-4"}),"Sort Ascending"]}),de(Y,{onClick:()=>d.column.toggleSorting(!0),disabled:z==="desc",children:[H(qn,{className:"mr-2 w-4 h-4"}),"Sort Descending"]}),de(Y,{onClick:()=>d.column.clearSorting(),disabled:!z,children:[H(Jn,{className:"mr-2 w-4 h-4"}),"Clear Sort"]}),(W&&!M||Q)&&H(he,{})]}),W&&!M&&de(Lo,{children:[H(ue,{children:"Pin Column"}),de(Y,{onClick:()=>m(d.column.id,"left"),disabled:d.column.getIsPinned()==="left",children:[H(Ga,{}),"Pin Left"]}),de(Y,{onClick:()=>m(d.column.id,"right"),disabled:d.column.getIsPinned()==="right",children:[H(La,{}),"Pin Right"]}),de(Y,{onClick:()=>m(d.column.id,!1),disabled:!d.column.getIsPinned(),children:[H(Ea,{}),"Unpin"]}),Q&&H(he,{})]}),Q&&de(Y,{onClick:()=>d.column.toggleVisibility(!1),children:[H(Ia,{className:"mr-2 w-4 h-4"}),"Hide Column"]})]})]})]})]}),H("div",{className:r("absolute bottom-0 inset-x-0 pointer-events-none",K?"h-0.5 bg-primary/40":"h-px bg-border")}),n&&d.column.getCanResize()&&!v&&d.colSpan===1&&H("div",{className:"top-0 right-0 absolute hover:bg-primary opacity-0 hover:opacity-100 bg-border w-1 h-full transition-opacity cursor-col-resize select-none touch-none",onMouseDown:d.getResizeHandler(),onTouchStart:d.getResizeHandler(),onClick:k=>k.stopPropagation()})]},d.id)})},b.id))})}import{jsx as Qe,jsxs as Eo}from"react/jsx-runtime";function Qn({table:e,columnAggregations:t,aggregations:o,enableColumnPinning:n,enableRowSelection:s,showSerialNumbers:l,compact:c}){let a=Object.keys(t).length>0,i=e.getHeaderGroups()[0]?.headers.some(d=>d.column.columnDef.customFooter),m=l&&e.getFilteredRowModel().rows.length>0&&(a||i),g=e.getHeaderGroups()[0]?.headers.length??0,p=e.getVisibleLeafColumns().filter(d=>!d.getIsPinned()),b=p[p.length-1]?.id;return!a&&!i&&!m?null:Qe(oo,{className:"bottom-0 z-20 sticky bg-sidebar border-t-0 shadow-[0_1px_0_0_var(--border)]",children:Qe(Fe,{className:"bg-sidebar hover:bg-transparent",children:e.getHeaderGroups()[0]?.headers.map((d,D)=>{let v=d.column.id,F=t[v],L=n&&(d.column.getIsPinned()==="left"||d.column.id==="serialNumber"||d.column.id==="select"&&s),O=n&&d.column.getIsPinned()==="right",W=d.column.id==="serialNumber",N=d.column.id==="select",M=d.column.columnDef.customFooter;return F||M||W&&m?Eo(je,{className:r("relative px-2 py-2 font-semibold text-sm",D<g-1&&"border-r",c&&"py-1",L&&"sticky left-0 z-30 bg-sidebar",O&&"sticky right-0 z-30 bg-sidebar",(W||N)&&"sticky left-0 z-30 bg-sidebar",M?.className),style:{width:Ge(d.getSize(),L||O),minWidth:Ge(d.getSize(),L||O),...Nt(d.column,n)},children:[Qe("div",{className:"absolute top-0 inset-x-0 h-px bg-border pointer-events-none"}),(()=>{if(M?.content){let K=typeof M.content=="function"?M.content(e):M.content;return Qe("div",{className:r("w-full h-full",M.align==="center"&&"text-center",M.align==="right"&&"text-right",M.align==="left"&&"text-left"),children:K})}return F?Qe("div",{className:"flex flex-col gap-0.5 text-xs",children:Object.entries(F).map(([K,Q])=>Eo("div",{className:"flex justify-between items-center text-muted-foreground",children:[Qe("span",{className:"text-xs capitalize",children:K}),Qe("span",{className:"font-medium text-foreground",children:o?.[v]?.format?.(Q,K)??Fn(K,Q)})]},K))}):W&&m?Eo("div",{className:"text-muted-foreground text-xs text-center",children:["Total ",e.getFilteredRowModel().rows.length]}):null})()]},`agg-${d.id}`):Qe(je,{className:r("relative px-0 py-0",D<g-1&&d.column.id!==b&&"border-r",c&&"py-0",L&&"sticky left-0 z-30 bg-sidebar",O&&"sticky right-0 z-30 bg-sidebar",(W||N)&&"sticky left-0 z-30 bg-sidebar"),style:{width:Ge(d.getSize(),L||O),minWidth:Ge(d.getSize(),L||O),...Nt(d.column,n)},children:Qe("div",{className:"absolute top-0 inset-x-0 h-px bg-border pointer-events-none"})},`agg-${d.id}`)})})})}import{jsx as S,jsxs as St}from"react/jsx-runtime";function er({data:e,columns:t,filters:o=[],pagination:n,settings:s={},header:l,footer:c,className:a="",maxHeight:i="100%",loading:m=!1,error:g,emptyMessage:p="No data available",onRowSelectionChange:b,onExport:d,onRefresh:D,onTableReady:v,children:F,isRowSelectable:L,getRowId:O,defaultSelectedRows:W,onExternalSearch:N,aggregations:x={},onAggregationChange:M,rowClassName:_,persist:K}){let Q=!!n,f=Un(K,o,n?.pageSize||10),C=Ue(f.initial.external),[z,P]=Se([]),[h,k]=Se(f.initial.columnFilters),[ne,I]=Se(f.initial.pagination),[q,fe]=Se(()=>Object.fromEntries(lo(t,o).map(w=>[w.id,!1]))),[_e,Oe]=Se({}),[Pe,ce]=Se(f.initial.globalFilter),[De,we]=Se([]),[tt,ke]=Se(()=>{if(s.enableColumnPinning===!1)return{};let w=[...s.showSerialNumbers!==!1?["serialNumber"]:[],...s.enableRowSelection!==!1?["select"]:[]],U=Dn(t);return{left:[...w,...U.left.filter(Je=>!w.includes(Je))],right:U.right}}),Et=Ue(null),Ve=Ue(null),ot=Ue(null),j=Ue(null),[u,$]=Se(0),[re,Z]=Se(0),[ht,He]=Se(0),nt=Ue(null),[_t,Zt]=Se(!1),{enableSorting:qe=!0,enableFiltering:Ot=!0,enableGlobalFilter:Vt=!0,enableColumnVisibility:Dt=!0,enableRowSelection:T=!0,showToolbar:B=!1,enableHeaderCheckbox:G=!0,toolbarPosition:oe="default",showSerialNumbers:ae=!0,fixedCheckboxColumn:Re=!0,striped:xt=!0,hoverable:vt=!0,compact:eo=!0,bordered:ho=!0,fullHeight:Wo=!1,enableColumnResizing:Ko=!1,enableColumnPinning:Me=!0,showHeader:kr=!0,selectionMode:kt="multiple",showCheckbox:qo=!0,groupedFilterLabel:Rr="Global",showFilterChips:Mr=!0}=s;ve(()=>{o.length>0&&!B&&console.warn("[DataTable] `filters` are provided but settings.showToolbar is off \u2014 filters live in the toolbar, so none will render."),o.some(w=>w.placement==="menu")&&!Vt&&console.warn("[DataTable] placement:'menu' filters are reached through the global search's field picker \u2014 with enableGlobalFilter off they are unreachable (only their chips would show).")},[]),ve(()=>{let w=()=>{nt.current&&Zt(nt.current.scrollTop>0)},U=nt.current;if(U)return U.addEventListener("scroll",w),()=>U.removeEventListener("scroll",w)},[]),ve(()=>{let w=()=>{Ve.current&&$(Ve.current.offsetHeight+16),ot.current&&Z(ot.current.offsetHeight+16),j.current&&He(j.current.offsetHeight+16)};w();let U=new ResizeObserver(()=>{setTimeout(w,50)});return Ve.current&&U.observe(Ve.current),ot.current&&U.observe(ot.current),j.current&&U.observe(j.current),()=>{U.disconnect()}},[B,l,oe]),ve(()=>{f.persistFilters(h)},[h]),ve(()=>{f.persistGlobalFilter(Pe)},[Pe]),ve(()=>{f.persistPagination(ne)},[ne]);let Jo=w=>{C.current=w,f.persistExternal(w),N?.(w)},xo=mo(()=>In({initialColumns:t,filters:o,showSerialNumbers:ae,enableRowSelection:T,selectionMode:kt,showCheckbox:qo,enableHeaderCheckbox:G,isRowSelectable:L}),[t,o,ae,T,L,kt,qo,G]),E=$a({data:e,columns:xo,getRowId:O,onSortingChange:qe?P:void 0,onColumnFiltersChange:Ot?k:void 0,onGlobalFilterChange:Vt?ce:void 0,getCoreRowModel:Oa(),getPaginationRowModel:Q?Ha():void 0,getSortedRowModel:qe?ja():void 0,getFilteredRowModel:Ot?Va():void 0,onColumnVisibilityChange:Dt?fe:void 0,onRowSelectionChange:T?Oe:void 0,onColumnOrderChange:we,onColumnPinningChange:Me?w=>ke(U=>kn(typeof w=="function"?w(U):w,[...ae?["serialNumber"]:[],...T?["select"]:[]])):void 0,state:{sorting:qe?z:void 0,columnFilters:Ot?h:void 0,columnVisibility:Dt?q:void 0,rowSelection:T?_e:{},globalFilter:Pe,pagination:Q?ne:void 0,columnOrder:De,columnPinning:Me?tt:{}},onPaginationChange:Q?I:void 0,initialState:{columnPinning:Me?{left:[...ae?["serialNumber"]:[],...T?["select"]:[]],right:[]}:void 0},enableRowSelection:T?w=>L?.(w.original)??!0:!1,enableSorting:qe,enableColumnResizing:Ko,enableColumnPinning:Me,columnResizeMode:"onChange",autoResetPageIndex:!f.pendingPageRestore()}),vo=mo(()=>zn(E,x),[E,x,e,h,Pe]),zr=mo(()=>Object.keys(vo).length>0||xo.some(w=>w.customFooter),[vo,xo]),Xo=Ue({onRowSelectionChange:b,isRowSelectable:L});Xo.current={onRowSelectionChange:b,isRowSelectable:L};let Yo=Ue(!1);ve(()=>{if(Yo.current||!W||!T)return;let w=E.getCoreRowModel().rows;if(w.length===0)return;let U={};for(let Je of w)Je.getCanSelect()&&W(Je.original)&&(U[Je.id]=!0);Yo.current=!0,Object.keys(U).length>0&&Oe(U)},[W,T,E,e]),ve(()=>{let{onRowSelectionChange:w,isRowSelectable:U}=Xo.current;if(T&&w){let Je=E.getFilteredSelectedRowModel().rows.filter(jt=>U?.(jt.original)??!0).map(jt=>jt.original);w(Je)}},[_e,T,E]);let Fr=_o(w=>{kt==="single"?(E.resetRowSelection(),w.toggleSelected(!0)):w.toggleSelected()},[kt,E]),Qo=Ue(v);Qo.current=v,ve(()=>{Qo.current?.(E)},[E]);let Zo=Ue(!1);ve(()=>{Zo.current||(Zo.current=!0,Object.keys(f.initial.external).length>0&&Jo(f.initial.external))},[]),ve(()=>f.syncSharedSlots(E),[E]),ve(()=>f.applyURLToTable(E),[E,f.searchParamsKey]),ve(()=>{Q&&f.restorePageIndex(E,I)},[e]);let Ar=_o(()=>{P([])},[]),Ir=_o(()=>{k([]),ce(""),f.clearAll()},[]),Br=(w,U)=>{Me&&Rn(E,w,U,{container:nt.current,alwaysPinnedLeft:[...ae?["serialNumber"]:[],...T&&Re?["select"]:[]]})},Gr=w=>w&&typeof w=="object"&&"content"in w,ze=mo(()=>l?Gr(l)?{content:l.content,align:l.align||"left",className:l.className||"",showOnEmpty:l.showOnEmpty!==void 0?l.showOnEmpty:!0}:{content:l,align:"left",className:"",showOnEmpty:!0}:null,[l]);if(g)return S(Xe,{className:"shadow-sm rounded-xl w-full",children:S(Ye,{className:"flex justify-center items-center",children:St("div",{className:"text-center",children:[S("div",{className:"mb-3 text-red-500 text-2xl",children:"\u26A0\uFE0F"}),S("p",{className:"mb-4 text-muted-foreground text-sm",children:g}),D&&St(y,{variant:"outline",size:"sm",onClick:D,className:"rounded-lg",children:[S(Zn,{className:"mr-2 w-4 h-4"}),"Try Again"]})]})})});let yo=()=>B?S(Ro,{table:E,filters:o,globalFilter:Pe,onGlobalFilterChange:w=>ce(w),enableGlobalFilter:Vt,onExport:d,onRefresh:D,loading:m,enableColumnVisibility:Dt,enableColumnPinning:Me,enableSorting:qe,showFilterChips:Mr,onClearSorting:Ar,onClearFilters:Ir,onExternalSearch:Jo,initialExternalValues:C.current,aggregations:x,onAggregationChange:M,groupedFilterLabel:Rr,initialGroupedField:f.initial.groupedField,onGroupedFieldChange:f.persistGroupedField}):null,Lr=()=>{let w=0;return oe==="above-header"&&(w+=u),ze&&(w+=ht),oe==="below-header"&&(w+=re),w},en=E.getVisibleLeafColumns().filter(w=>!w.getIsPinned()),Er=en[en.length-1]?.id,Ht=Math.max(E.getVisibleLeafColumns().length,1);return S(yt,{children:St("div",{className:r("flex flex-col space-y-2 w-full h-full p-1",a),children:[B&&oe==="default"&&S("div",{ref:Et,className:"z-40 relative",children:yo()}),S(Xe,{className:r("shadow-sm overflow-hidden py-0",Wo&&"flex-1 min-h-0"),children:S(Ye,{className:"h-full p-0",children:St("div",{className:"relative flex flex-col justify-between h-full",children:[m&&S("div",{className:"z-50 absolute inset-0 flex justify-center items-center bg-background/80 rounded-xl",children:St("div",{className:"flex items-center gap-3 bg-background/90 shadow-sm px-4 py-3 rounded-lg",children:[S(Zn,{className:"size-5 text-primary animate-spin"}),S("span",{className:"font-medium text-muted-foreground text-sm",children:"Loading..."})]})}),S("div",{ref:nt,className:r("relative overflow-auto rounded-t-xl",Wo?"flex-1 min-h-0":E.getRowModel().rows?.length===0&&"h-full"),style:{maxHeight:i},children:St(No,{className:r("w-full border-separate border-spacing-0 relative",E.getState().columnSizingInfo.isResizingColumn&&"select-none",E.getRowModel().rows?.length===0&&"h-full"),children:[B&&oe==="above-header"&&S("thead",{className:"top-0 z-40 sticky bg-sidebar border-b",children:S(Fe,{className:"hover:bg-transparent",children:S(je,{colSpan:Ht,className:"p-2 bg-sidebar border-b shadow-sm",children:S("div",{ref:Ve,children:yo()})})})}),ze&&(ze.showOnEmpty||E.getRowModel().rows?.length>0)&&S("thead",{className:r("sticky bg-sidebar border-b",_t&&"shadow-sm"),style:{top:oe==="above-header"?`${u}px`:"0px",zIndex:35},children:S(Fe,{className:"hover:bg-transparent",children:S(je,{colSpan:Ht,className:r("bg-sidebar border-b p-2 font-semibold text-foreground",eo?"py-2":"py-4",ze.className),children:S("div",{ref:j,className:r("flex items-center w-full",ze.align==="center"&&"justify-center",ze.align==="right"&&"justify-end",ze.align==="left"&&"justify-start"),children:typeof ze.content=="string"?S("span",{className:"font-bold text-foreground text-lg tracking-tight",children:ze.content}):ze.content})})})}),B&&oe==="below-header"&&S("thead",{className:r("sticky bg-sidebar border-b",_t&&"shadow-sm"),style:{top:ze?`${ht}px`:"0px",zIndex:35},children:S(Fe,{className:"hover:bg-transparent",children:S(je,{colSpan:Ht,className:"bg-sidebar border-b p-2",children:S("div",{ref:ot,children:yo()})})})}),kr&&S(tn,{className:r("sticky bg-sidebar [&_tr]:border-b-0",_t&&"shadow-sm"),style:{top:`${Lr()}px`,zIndex:30},children:S(Yn,{table:E,aggregations:x,enableColumnPinning:Me,enableColumnResizing:Ko,enableColumnVisibility:Dt,enableRowSelection:T,fixedCheckboxColumn:Re,bordered:ho,compact:eo,onPinColumn:Br})}),S(on,{children:E.getRowModel().rows?.length?E.getRowModel().rows.map((w,U)=>{let Je=U===E.getRowModel().rows.length-1,jt=_?_(w):"";return S(Fe,{"data-index":U,"data-state":w.getIsSelected()&&"selected",className:r(vt&&"hover:bg-muted/50",xt&&U%2===0&&"bg-muted/20",w.getIsSelected()&&"bg-muted",kt==="single"&&"cursor-pointer",jt),onClick:()=>{kt==="single"&&Fr(w)},children:w.getVisibleCells().map((Ce,_r)=>{let wo=Me&&(Ce.column.getIsPinned()==="left"||Ce.column.id==="serialNumber"||Ce.column.id==="select"&&T),Co=Me&&Ce.column.getIsPinned()==="right",Or=Ce.column.id==="serialNumber";return S(je,{className:r(eo?"py-2":"py-4",ho&&_r<w.getVisibleCells().length-1&&Ce.column.id!==Er&&"border-r",(!Je||!zr)&&"border-b",wo&&"sticky left-0 z-20 bg-sidebar/95",Or&&"sticky left-0 z-20 bg-card/95",Co&&"sticky right-0 z-20 bg-sidebar/95","p-1"),style:{width:Ge(Ce.column.getSize(),wo||Co),minWidth:Ge(Ce.column.getSize(),wo||Co),...Nt(Ce.column,Me)},children:_a(Ce.column.columnDef.cell,Ce.getContext())},Ce.id)})},w.id)}):S(Fe,{children:S(je,{colSpan:Ht,className:"border-0 h-32 text-center",children:St("div",{className:"flex flex-col items-center gap-3",children:[S("div",{className:"text-muted-foreground text-6xl",children:"\u{1F4CB}"}),S("p",{className:"font-medium text-muted-foreground",children:p})]})})})}),S(Qn,{table:E,columnAggregations:vo,aggregations:x,enableColumnPinning:Me,enableRowSelection:T,showSerialNumbers:ae,bordered:ho,compact:eo})]})}),c&&S("div",{className:"bottom-0 z-10 sticky bg-sidebar w-full",style:{width:"100%",minWidth:"fit-content"},children:S(No,{children:S(oo,{children:S(Fe,{className:"bg-sidebar",children:S(je,{colSpan:Ht,className:"p-2",children:c})})})})})]})})}),S(Mo,{table:E,config:n}),F&&F(E)]})})}import{Separator as Ua}from"radix-ui";import{jsx as Wa}from"react/jsx-runtime";function po({className:e,orientation:t="horizontal",decorative:o=!0,...n}){return Wa(Ua.Root,{"data-slot":"separator-root",decorative:o,orientation:t,className:r("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...n})}import{Loader as Ka,X as qa}from"lucide-react";import{AnimatePresence as Ja,motion as Xa}from"framer-motion";import*as gt from"react";import*as tr from"react-dom";import{jsx as pe,jsxs as Xt}from"react/jsx-runtime";function or({table:e,visible:t,container:o,children:n,className:s,...l}){let[c,a]=gt.useState(!1);gt.useLayoutEffect(()=>{a(!0)},[]),gt.useEffect(()=>{function g(p){p.key==="Escape"&&e&&e.toggleAllRowsSelected(!1)}return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[e]);let i=o??(c?globalThis.document?.body:null);if(!i||!e)return null;let m=t??e.getFilteredSelectedRowModel().rows.length>0;return tr.createPortal(pe(Ja,{children:m&&pe(Xa.div,{role:"toolbar","aria-orientation":"horizontal",initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:20},transition:{duration:.3,ease:"easeInOut"},className:r("fixed inset-x-0 bottom-6 z-50 mx-auto flex w-fit flex-wrap items-center justify-center gap-2 rounded-xl border bg-primary/10 backdrop-blur-sm p-3 text-foreground ring-5 ring-primary/5",s),...l,children:pe(yt,{children:n})})}),i)}function nr({size:e="sm",tooltip:t,isPending:o,disabled:n,className:s,children:l,...c}){let a=pe(y,{variant:"secondary",size:e,className:r("gap-1.5 rounded-lg border border-secondary bg-secondary/50 hover:bg-secondary/70 transition-all duration-200",e==="icon"?"size-8":"h-8 px-3",s),disabled:n||o,...c,children:o?pe(Ka,{className:"animate-spin"}):l});return t?Xt(at,{children:[pe(it,{asChild:!0,children:a}),pe(st,{sideOffset:8,className:"rounded-lg border font-semibold text-foreground bg-secondary [&>span]:hidden",children:pe("p",{children:t})})]}):a}function rr({table:e}){let t=gt.useCallback(()=>{e&&e.toggleAllRowsSelected(!1)},[e]);return e?Xt("div",{className:"flex h-8 items-center rounded-lg border bg-muted/50 pr-1 pl-3",children:[Xt("span",{className:"whitespace-nowrap text-sm font-medium",children:[e.getFilteredSelectedRowModel().rows.length," selected"]}),pe(po,{orientation:"vertical",className:"mr-2 ml-3 data-[orientation=vertical]:h-4"}),Xt(at,{children:[pe(it,{asChild:!0,children:pe(y,{variant:"ghost",size:"icon",className:"size-6 rounded-md",onClick:t,children:pe(qa,{className:"size-3.5"})})}),Xt(st,{sideOffset:10,className:"flex items-center gap-2 rounded-lg border px-3 py-2 font-semibold text-foregroun bg-secondary [&>span]:hidden",children:[pe("p",{children:"Clear selection"}),pe("kbd",{className:"select-none rounded border bg-primary/50 px-2 py-1 font-mono font-normal text-[0.7rem] text-foreground shadow-sm",children:pe("abbr",{title:"Escape",className:"no-underline",children:"Esc"})})]})]})]}):null}import{useSearchParams as Ya}from"react-router";function ar(e,t){let[o,n]=Ya();return[o.get(t)||void 0,c=>{let a=new URLSearchParams(window.location.search);a.set(t,c??""),n(a,{replace:!0})}]}import{useState as ft,useEffect as sr,useMemo as Vo,useCallback as It,useRef as di}from"react";import{Loader2 as lr}from"lucide-react";import{Search as Qa,Download as Za,RefreshCw as ei,Filter as ti,ChevronDown as oi,Settings2 as ni}from"lucide-react";import{Fragment as ri,jsx as A,jsxs as ie}from"react/jsx-runtime";function Oo({fields:e,filters:t,globalFilter:o,onGlobalFilterChange:n,fieldFilters:s,onFieldFilterChange:l,sortField:c,sortDirection:a,onSortChange:i,selectedCount:m,totalCount:g,visibleCount:p,onExport:b,onRefresh:d,loading:D,onClearFilters:v,onClearSorting:F}){let L=e.filter(N=>N.sortable),O=Object.values(s).some(N=>N!=null&&N!=="")||o!=="",W=c!=="";return A("div",{className:"rounded-xl p-0.5",children:A("div",{className:"px-2",children:A("div",{className:"flex flex-col gap-6",children:ie("div",{className:"flex items-center justify-between",children:[A("div",{className:"flex items-center gap-3",children:t.length>0&&ie("div",{className:"flex items-center gap-3 flex-wrap",children:[A("div",{className:"flex items-center gap-2 text-sm font-medium text-muted-foreground",children:A(ti,{className:"h-4 w-4"})}),t.map(N=>A("div",{className:"relative min-w-[150px]",children:N.type==="select"?ie(dt,{value:s[N.key]||"all",onValueChange:x=>l(N.key,x),children:[N.icon&&A(N.icon,{className:"size-4 absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),A(ut,{className:r("h-9 rounded-lg w-full",N.icon&&"pl-9"),children:A(ct,{placeholder:N.placeholder||"Select..."})}),ie(mt,{className:"rounded-lg",children:[A($e,{value:"all",children:"All"}),N.options?.map(x=>A($e,{value:x.value,children:x.label},x.value))]})]}):ie("div",{className:"relative",children:[N.icon&&A(N.icon,{className:"size-4 absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),A(zt,{type:N.type,placeholder:N.placeholder,value:s[N.key]||"",onChange:x=>l(N.key,x.target.value),className:r("h-9 rounded-lg",N.icon&&"pl-9")})]})},String(N.key)))]})}),ie("div",{className:"flex items-center gap-2",children:[ie("div",{className:"relative",children:[A(Qa,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),A(zt,{placeholder:"Global search...",value:o,onChange:N=>n(N.target.value),className:"pl-9 h-9 rounded-lg max-w-max"})]}),L.length>0&&ie(Ae,{children:[A(Ie,{asChild:!0,children:ie(y,{variant:"outline",size:"sm",className:"rounded-lg gap-1",children:[A("span",{children:"Sort"}),A(oi,{className:"h-4 w-4 opacity-50"})]})}),ie(Be,{align:"end",className:"w-[200px] rounded-lg",children:[A(ue,{children:"Sort By"}),A(he,{}),L.map(N=>ie("div",{children:[ie(Y,{onClick:()=>i(N.key,"asc"),children:[N.label," (A-Z)"]}),ie(Y,{onClick:()=>i(N.key,"desc"),children:[N.label," (Z-A)"]})]},String(N.key))),W&&ie(ri,{children:[A(he,{}),A(Y,{onClick:F,children:"Clear All Sorting"})]})]})]}),ie(Ae,{children:[A(Ie,{asChild:!0,children:A(y,{variant:"outline",size:"sm",className:"rounded-lg",children:A(ni,{className:"h-4 w-4"})})}),ie(Be,{align:"end",className:"w-[200px] rounded-lg",children:[A(ue,{children:"Table Settings"}),A(he,{}),A(Y,{onClick:F,children:"Clear All Sorting"}),A(Y,{onClick:v,children:"Clear All Filters"})]})]}),b&&ie(y,{variant:"outline",size:"sm",onClick:b,className:"rounded-lg",children:[A(Za,{className:"mr-2 h-4 w-4"}),"Export"]}),d&&A(y,{variant:"outline",size:"sm",onClick:d,disabled:D,className:"rounded-lg",children:A(ei,{className:r("h-4 w-4",D&&"animate-spin")})})]})]})})})})}import{ChevronLeft as ai,ChevronRight as ii,ChevronsLeft as si,ChevronsRight as li}from"lucide-react";import{jsx as ee,jsxs as Le}from"react/jsx-runtime";function ir({currentPage:e,totalPages:t,pageSize:o,totalItems:n,onPageChange:s,onPageSizeChange:l,config:c}){if(!c)return null;let a=c.pageSizeOptions||[10,20,50,100],i=(e-1)*o+1,m=Math.min(e*o,n),g=e>1,p=e<t,b=()=>{let D=[],v=[];for(let F=Math.max(2,e-2);F<=Math.min(t-1,e+2);F++)D.push(F);return e-2>2?v.push(1,"..."):v.push(1),v.push(...D),e+2<t-1?v.push("...",t):t>1&&v.push(t),v};return ee("div",{className:"rounded-xl",children:Le("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4",children:[ee("div",{className:"flex items-center gap-6 text-sm text-muted-foreground",children:c.showInfo!==!1&&Le("span",{children:["Showing ",i," to ",m," of ",n," entries"]})}),Le("div",{className:"flex flex-col sm:flex-row items-center gap-4",children:[a&&Le("div",{className:"flex items-center gap-2",children:[ee("span",{className:"text-sm font-medium whitespace-nowrap",children:"Page size:"}),Le(dt,{value:`${o}`,onValueChange:d=>l(Number(d)),children:[ee(ut,{className:"h-9 w-[70px] rounded-lg",children:ee(ct,{})}),ee(mt,{side:"top",className:"rounded-lg",children:a.map(d=>ee($e,{value:`${d}`,children:d},d))})]})]}),Le("div",{className:"flex items-center gap-2",children:[Le(y,{variant:"outline",size:"sm",onClick:()=>s(1),disabled:!g,className:"hidden sm:flex rounded-lg",children:[ee(si,{className:"h-4 w-4"}),ee("span",{className:"sr-only",children:"Go to first page"})]}),Le(y,{variant:"outline",size:"sm",onClick:()=>s(e-1),disabled:!g,className:"rounded-lg",children:[ee(ai,{className:"h-4 w-4 sm:mr-2"}),ee("span",{className:"hidden sm:inline",children:"Previous"}),ee("span",{className:"sr-only sm:hidden",children:"Go to previous page"})]}),c.showPageNumbers&&t>1&&ee("div",{className:"hidden sm:flex items-center gap-1",children:b().map((d,D)=>{if(d==="...")return ee("span",{className:"px-2 py-1 text-sm text-muted-foreground",children:"..."},`dots-${D}`);let v=d;return ee(y,{variant:v===e?"default":"outline",size:"sm",className:"w-9 h-9 p-0 rounded-lg",onClick:()=>s(v),children:v},v)})}),Le("div",{className:"sm:hidden flex items-center gap-2 px-3 py-1 text-sm font-medium bg-muted rounded-lg",children:[e," of ",t]}),Le(y,{variant:"outline",size:"sm",onClick:()=>s(e+1),disabled:!p,className:"rounded-lg",children:[ee("span",{className:"hidden sm:inline",children:"Next"}),ee(ii,{className:"h-4 w-4 sm:ml-2"}),ee("span",{className:"sr-only sm:hidden",children:"Go to next page"})]}),Le(y,{variant:"outline",size:"sm",onClick:()=>s(t),disabled:!p,className:"hidden sm:flex rounded-lg",children:[ee(li,{className:"h-4 w-4"}),ee("span",{className:"sr-only",children:"Go to last page"})]})]})]})]})})}import{jsx as X,jsxs as Pt}from"react/jsx-runtime";function dr({data:e,template:t,fields:o=[],filters:n=[],pagination:s,settings:l={},header:c,footer:a,className:i="",loading:m=!1,error:g,emptyMessage:p="No items found",emptyIcon:b,onSelectionChange:d,onExport:D,onRefresh:v,onTemplateReady:F,children:L}){let{enableSorting:O=!0,enableFiltering:W=!0,enableGlobalSearch:N=!0,enableSelection:x=!1,enableExport:M=!1,showToolbar:_=!0,selectionMode:K="multiple",gridCols:Q={default:3,sm:1,md:2,lg:3,xl:4,"2xl":6},gap:f=4,aspectRatio:C="auto",minCardWidth:z=350,maxCardWidth:P=350}=l,h=!!s,[k,ne]=ft(""),[I,q]=ft({}),[fe,_e]=ft(""),[Oe,Pe]=ft("asc"),[ce,De]=ft(new Set),[we,tt]=ft(1),[ke,Et]=ft(s?.pageSize||12),[Ve,ot]=ft(Q.default),j=Vo(()=>{let T=[...e];if(N&&k){let B=o.filter(G=>G.searchable!==!1);T=T.filter(G=>B.some(oe=>G[oe.key]?.toString().toLowerCase().includes(k.toLowerCase())))}if(W&&Object.keys(I).forEach(B=>{let G=I[B];if(G!=null&&G!==""){let oe=o.find(ae=>ae.key===B);oe&&(T=T.filter(ae=>{let Re=ae[B];return oe.type==="boolean"?Re===(G==="true"):oe.type==="number"?Re===Number(G):Re?.toString().toLowerCase().includes(String(G).toLowerCase())}))}}),O&&fe){let B=o.find(G=>G.key===fe);B&&T.sort((G,oe)=>{let ae=G[fe],Re=oe[fe];if(B.type==="number")return Oe==="asc"?Number(ae)-Number(Re):Number(Re)-Number(ae);if(B.type==="date"){let xt=new Date(ae),vt=new Date(Re);return Oe==="asc"?xt.getTime()-vt.getTime():vt.getTime()-xt.getTime()}else{let xt=String(ae).toLowerCase(),vt=String(Re).toLowerCase();return Oe==="asc"?xt.localeCompare(vt):vt.localeCompare(xt)}})}return T},[e,k,I,fe,Oe,o,N,W,O]),u=Vo(()=>{if(!h)return j;let T=(we-1)*ke,B=T+ke;return j.slice(T,B)},[j,we,ke,h]),$=Math.ceil(j.length/ke),re=It(T=>{x&&De(B=>{let G=new Set(B);return K==="single"?(G.clear(),G.add(T)):G.has(T)?G.delete(T):G.add(T),G})},[x,K]),Z=It(()=>{!x||K==="single"||(ce.size===j.length?De(new Set):De(new Set(j.map((T,B)=>B))))},[x,K,ce.size,j.length]),ht=It((T,B)=>{q(G=>({...G,[T]:B})),tt(1)},[]),He=It((T,B)=>{_e(T),Pe(B)},[]),nt=It(()=>{ne(""),q({}),tt(1)},[]),_t=It(()=>{_e(""),Pe("asc")},[]),Zt=Vo(()=>({getSelectedItems:()=>Array.from(ce).map(T=>j[T]),clearSelection:()=>De(new Set),selectAll:Z,getFilteredData:()=>j,getTotalCount:()=>e.length,getVisibleCount:()=>j.length,refresh:()=>v?.(),exportData:()=>D?.(j)}),[ce,j,e.length,Z,v,D]),qe=di(null);qe.current=Zt,sr(()=>{F&&qe.current&&F(qe.current)},[]),sr(()=>{if(x&&d){let T=Array.from(ce).map(B=>j[B]);d(T)}},[ce]);let Ot=r("w-full","overflow-hidden",i),Vt=r("grid",`gap-${f}`,"w-full","mx-auto","items-start"),Dt={gridTemplateColumns:Ve===0?"repeat(auto-fill, 1fr)":`repeat(auto-fill, minmax(clamp(${z}px, calc(100%/${Ve} - ${f*4}px), ${P}px), 1fr))`,justifyItems:"center",alignItems:"stretch",gridAutoRows:"1fr",gridAutoFlow:"dense"};return g?X(Xe,{className:"w-full",children:X(Ye,{className:"flex items-center justify-center py-12",children:Pt("div",{className:"text-center",children:[X("div",{className:"text-red-500 mb-3 text-2xl",children:"\u26A0\uFE0F"}),X("p",{className:"text-sm text-muted-foreground mb-4",children:g}),v&&Pt(y,{variant:"outline",size:"sm",onClick:v,children:[X(lr,{className:"mr-2 h-4 w-4"}),"Try Again"]})]})})}):Pt("div",{className:r("w-full flex gap-2 flex-col h-full",Ot),children:[c&&X(Xe,{className:"shadow-sm border-0 py-0 text-xl font-bold",children:X(Ye,{className:"p-2",children:c})}),_&&X(Oo,{fields:o,filters:n,globalFilter:k,onGlobalFilterChange:ne,fieldFilters:I,onFieldFilterChange:ht,sortField:fe,sortDirection:Oe,onSortChange:He,selectedCount:ce.size,totalCount:e.length,visibleCount:j.length,onExport:M?()=>D?.(j):void 0,onRefresh:v,loading:m,onClearFilters:nt,onClearSorting:_t}),X(Xe,{className:"border-0 overflow-auto shadow-none py-0 p-2 flex-1",children:X(Ye,{className:"px-0",children:Pt("div",{className:"relative",children:[m&&X("div",{className:"absolute inset-0 bg-background/80 backdrop-blur-sm z-50 flex items-center justify-center rounded-lg",children:Pt("div",{className:"flex items-center gap-3 bg-background/90 px-4 py-3 rounded-lg shadow-sm",children:[X(lr,{className:"size-5 animate-spin text-primary"}),X("span",{className:"text-sm font-medium text-muted-foreground",children:"Loading..."})]})}),u.length>0?X("div",{className:r(Vt),style:Dt,children:u.map((T,B)=>{let G=h?(we-1)*ke+B:B,oe=ce.has(G);return Pt("div",{className:r("relative h-full w-full flex flex-col","transition-all duration-200 overflow-hidden","rounded-2xl","border border-border/20 hover:border-border/50",C==="square"?"aspect-square":"",C==="video"?"aspect-video":"",x?"cursor-pointer":"",oe?"ring-2 ring-primary":""),onClick:()=>x&&re(G),children:[x&&K==="multiple"&&X("div",{className:"absolute top-2 right-2 z-10",children:X(Ct,{checked:oe,onCheckedChange:()=>re(G),className:"bg-background/80 backdrop-blur-sm",onClick:ae=>ae.stopPropagation()})}),t(T,B,oe,()=>re(G))]},G)})}):Pt("div",{className:"flex flex-col gap-4 items-center justify-center py-12 text-center",children:[X("div",{className:"text-6xl",children:b||"\u{1F4CB}"}),X("p",{className:"text-lg font-medium text-muted-foreground mb-2",children:p}),(k||Object.values(I).some(T=>T))&&X(y,{variant:"outline",onClick:nt,children:"Clear Filters"})]})]})})}),h&&X("div",{className:"pb-1",children:X(ir,{currentPage:we,totalPages:$,pageSize:ke,totalItems:j.length,onPageChange:tt,onPageSizeChange:T=>{Et(T),tt(1)},config:s})}),a&&X("div",{className:"p-2 m-0.5",children:a}),L&&L(Zt)]})}import{Loader as ci,X as ui}from"lucide-react";import{AnimatePresence as mi,motion as pi}from"framer-motion";import*as bt from"react";import*as cr from"react-dom";import{jsx as ge,jsxs as Yt}from"react/jsx-runtime";function ur({controller:e,visible:t,container:o,children:n,className:s,...l}){let[c,a]=bt.useState(!1);bt.useLayoutEffect(()=>{a(!0)},[]),bt.useEffect(()=>{function p(b){b.key==="Escape"&&e&&e.clearSelection()}return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[e]);let i=o??(c?globalThis.document?.body:null);if(!i||!e)return null;let m=e.getSelectedItems(),g=t??m.length>0;return cr.createPortal(ge(mi,{children:g&&ge(pi.div,{role:"toolbar","aria-orientation":"horizontal",initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:20},transition:{duration:.3,ease:"easeInOut"},className:r("fixed inset-x-0 bottom-6 z-50 mx-auto flex w-fit flex-wrap items-center justify-center gap-2 rounded-xl border bg-primary/10 backdrop-blur-sm p-3 text-foreground ring-8 ring-primary/5",s),...l,children:ge(yt,{children:n})})}),i)}function mr({size:e="sm",variant:t="secondary",tooltip:o,isPending:n,disabled:s,className:l,children:c,onClick:a,...i}){let m=ge(y,{variant:t,size:e,className:r("gap-1.5 rounded-lg border border-secondary bg-secondary/50 hover:bg-secondary/70 transition-all duration-200",e==="icon"?"size-8":"h-8 px-3",l),disabled:s||n,onClick:a,...i,children:n?ge(ci,{className:"animate-spin"}):c});return o?Yt(at,{children:[ge(it,{asChild:!0,children:m}),ge(st,{sideOffset:8,className:"rounded-lg border font-semibold text-foreground bg-secondary [&>span]:hidden",children:ge("p",{children:o})})]}):m}function pr({controller:e}){let t=bt.useCallback(()=>{e&&e.clearSelection()},[e]);if(!e)return null;let o=e.getSelectedItems();return Yt("div",{className:"flex h-8 items-center rounded-lg border bg-muted/50 pr-1 pl-3",children:[Yt("span",{className:"whitespace-nowrap text-sm font-medium",children:[o.length," selected"]}),ge(po,{orientation:"vertical",className:"mr-2 ml-3 data-[orientation=vertical]:h-4"}),Yt(at,{children:[ge(it,{asChild:!0,children:ge(y,{variant:"ghost",size:"icon",className:"size-6 rounded-md",onClick:t,children:ge(ui,{className:"size-3.5"})})}),Yt(st,{sideOffset:10,className:"flex items-center gap-2 rounded-lg border px-3 py-2 font-semibold text-foreground bg-secondary [&>span]:hidden",children:[ge("p",{children:"Clear selection"}),ge("kbd",{className:"select-none rounded border bg-primary/50 px-2 py-1 font-mono font-normal text-[0.7rem] text-foreground shadow-sm",children:ge("abbr",{title:"Escape",className:"no-underline",children:"Esc"})})]})]})]})}import{jsx as fi}from"react/jsx-runtime";var gi=({children:e,className:t})=>fi("div",{className:r("flex flex-col h-full gap-2",t),children:e});import{ArrowLeftIcon as gr}from"lucide-react";import{NavLink as bi}from"react-router";import{jsx as We,jsxs as Qt}from"react/jsx-runtime";var hi=({className:e,title:t,description:o,backAction:n,metadata:s,children:l,childrenClassName:c})=>{let a=()=>{if(!n)return null;let m={variant:"secondary",size:"icon",className:"hover:bg-primary/20 inline-flex"};return n.href?We(bi,{to:n.href,children:We(y,{...m,children:We(gr,{className:"size-6"})})}):We(y,{...m,onClick:n.onClick,children:We(gr,{className:"size-6"})})},i=()=>!s||s.length===0?null:We("div",{className:"flex gap-4",children:s.map((m,g)=>m.value&&Qt("div",{className:"text-sm",children:[Qt("span",{className:"text-muted-foreground",children:[m.label," "]}),We("span",{children:m.value})]},g))});return Qt("div",{className:r("flex items-center w-full gap-4 p-2",e),children:[Qt("div",{className:"flex gap-2 items-center h-full shrink-0",children:[a(),Qt("div",{className:"flex flex-col gap-2 w-max",children:[We("h1",{className:"text-2xl font-bold tracking-tight",children:t}),o&&We("p",{className:"text-muted-foreground",children:o}),i()]})]}),l!=null&&We("div",{className:r("flex flex-1 items-center justify-end gap-4 h-full",c),children:l})]})};import fo from"react";import{jsx as Ke,jsxs as go}from"react/jsx-runtime";var fr="(min-width: 1024px)",xi=()=>{let[e,t]=fo.useState(()=>typeof window>"u"||window.matchMedia(fr).matches);return fo.useEffect(()=>{let o=window.matchMedia(fr),n=()=>t(o.matches);return o.addEventListener("change",n),()=>o.removeEventListener("change",n)},[]),e},br=e=>null,hr=e=>null,xr=e=>null,vi=({children:e,className:t,contentClassName:o})=>{let n=xi(),s,l,c,a,i,m=fo.Children.toArray(e).filter(b=>{if(fo.isValidElement(b)){if(b.type===br){let d=b.props;return s=d.children,l=d.className,!1}if(b.type===hr){let d=b.props;return c=d.children,a=d.className,!1}if(b.type===xr)return i=b.props,!1}return!0}),g=Ke("div",{className:r("flex-1 overflow-auto h-full no-scrollbar p-2",o),children:m}),p=b=>{let{side:d="right"}=b,D=(b.overlay??!0)||!n,v=r("w-1/3 max-w-full",b.className),F=r("h-full bg-background",d==="right"?"border-l":"border-r"),L=Ke("div",{className:r("h-full p-2",o),children:m});return D?go("div",{tabIndex:-1,className:"flex relative flex-1 overflow-hidden",children:[Ke("div",{className:"h-full overflow-auto w-full transition-all duration-500 relative z-10",children:L}),go("div",{tabIndex:-1,inert:!b.open,className:r("absolute inset-0 z-20",!b.open&&"pointer-events-none"),children:[Ke("div",{className:r("absolute inset-0 bg-black/50 transition-opacity duration-500",b.open?"opacity-100":"opacity-0 pointer-events-none"),onClick:()=>b.onOpenChange(!1)}),Ke("div",{tabIndex:-1,className:r("absolute inset-y-0 z-50 h-full overflow-y-auto backdrop-blur-2xl","transition-all duration-500 ease-in-out",d==="right"?"right-0":"left-0",b.open?"translate-x-0 opacity-100":r(d==="right"?"translate-x-full":"-translate-x-full","opacity-0 pointer-events-none"),F,v),children:b.children})]})]}):go("div",{className:"flex relative flex-1 overflow-hidden",children:[d==="left"&&Ke("div",{className:r("shrink-0 overflow-y-auto transition-all duration-500 ease-in-out",F,b.open?v:"w-0 border-0"),children:b.children}),Ke("div",{className:r("h-full flex-1 min-w-0 overflow-auto transition-all duration-500",b.open&&"overflow-y-auto overflow-x-hidden"),children:L}),d==="right"&&Ke("div",{className:r("shrink-0 overflow-y-auto transition-all duration-500 ease-in-out",F,b.open?v:"w-0 border-0"),children:b.children})]})};return go("div",{className:r("flex flex-auto flex-col min-h-0 overflow-hidden rounded-2xl relative bg-background p-2",t),children:[s&&Ke("div",{className:r("border-b p-2",l),children:s}),i?p(i):g,c&&Ke("div",{className:r("border-t p-2",a),children:c})]})};import{jsx as wi}from"react/jsx-runtime";var yi=({className:e,children:t})=>t==null?null:wi("div",{className:r("flex items-center w-full gap-4 p-2 [&>*:last-child]:ml-auto",e),children:t});import{useState as vr}from"react";import{Copy as Ci,Check as Ni,Loader2Icon as Ti}from"lucide-react";import{jsx as Ze,jsxs as yr}from"react/jsx-runtime";var Ho=class{static currencyFormatter=new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR",maximumFractionDigits:2});static compactFormatter=new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR",notation:"compact",maximumFractionDigits:1});static MONTH_NAMES_SHORT=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];static async copyToClipboard(t){if(t)try{await navigator.clipboard.writeText(t)}catch(o){throw console.error("Failed to copy text:",o),o}}static CopyToClipboard=({text:t,children:o,className:n,size:s="icon",variant:l="ghost"})=>{let[c,a]=vr(!1),[i,m]=vr(!1),g=async()=>{if(!(!t||i)){m(!0);try{await this.copyToClipboard(t),a(!0),setTimeout(()=>a(!1),2e3)}catch(p){console.error("Failed to copy text:",p)}finally{m(!1)}}};return yr(at,{children:[Ze(it,{asChild:!0,children:Ze(y,{variant:l,size:s,className:r(s==="icon"&&"size-6",n),onClick:g,disabled:i||!t,children:i?Ze(Ti,{className:"animate-spin"}):c?Ze(Ni,{className:"h-3 w-3"}):o||Ze(Ci,{className:"h-3 w-3"})})}),Ze(st,{children:c?"Copied!":i?"Copying...":"Copy to clipboard"})]})};static formatINR(t,o={}){let{prefix:n="",suffix:s="",withSymbol:l=!0,compact:c=!1}=o;if(typeof t!="number"||isNaN(t))return`${n}${l?"\u20B9 ":""}0.00${s}`;let a=t<0,i=Math.abs(t),g=(c&&i>=1e5?this.compactFormatter:this.currencyFormatter).format(i).replace("\u20B9","");return`${n}${a?"- ":""}${l?"\u20B9 ":""}${g}${s}`}static formatDate(t,o={}){let{format:n="dd-mm-yyyy",separator:s="-"}=o,l=new Date(t);if(isNaN(l.getTime()))return"";let c=String(l.getDate()).padStart(2,"0"),a=String(l.getMonth()+1).padStart(2,"0"),i=this.MONTH_NAMES_SHORT[l.getMonth()],m=l.getFullYear();switch(n){case"dd-mmm-yyyy":return`${c}${s}${i}${s}${m}`;case"iso":return l.toISOString().split("T")[0];case"long":return l.toLocaleDateString("en-IN",{year:"numeric",month:"long",day:"numeric"});case"short":return l.toLocaleDateString("en-IN");default:return`${c}${s}${a}${s}${m}`}}static toProperCase(t){return t?t.toLowerCase().split(" ").map(o=>o.charAt(0).toUpperCase()+o.slice(1)).join(" "):""}static toProperCaseAdvanced(t){return t?t.toLowerCase().split(/(\s+|['-])/).map((o,n,s)=>["-","'"," "].includes(o)||n>0&&["-","'"].includes(s[n-1])?o:o.charAt(0).toUpperCase()+o.slice(1)).join(""):""}static StatusBadge=({status:t,className:o,showDot:n=!0,capitalize:s=!0,size:l="md",variant:c="outline",customColors:a,icon:i,trueMessage:m="active",falseMessage:g="inactive"})=>{let p=typeof t=="boolean"?t?m:g:typeof t=="number"?t>0?m:g:t.toLowerCase(),b={active:{label:"active",solid:{bg:"bg-emerald-500",text:"text-white",border:"border-emerald-600",dot:"bg-white"},outline:{bg:"bg-emerald-50",text:"text-emerald-700",border:"border-emerald-100",dot:"bg-emerald-500"},subtle:{bg:"bg-emerald-50",text:"text-emerald-700",border:"border-transparent",dot:"bg-emerald-500"}},pending:{label:"pending",solid:{bg:"bg-amber-500",text:"text-white",border:"border-amber-600",dot:"bg-white"},outline:{bg:"bg-amber-50",text:"text-amber-700",border:"border-amber-100",dot:"bg-amber-500"},subtle:{bg:"bg-amber-50",text:"text-amber-700",border:"border-transparent",dot:"bg-amber-500"}},inactive:{label:"inactive",solid:{bg:"bg-rose-500",text:"text-white",border:"border-rose-600",dot:"bg-white"},outline:{bg:"bg-rose-50",text:"text-rose-700",border:"border-rose-100",dot:"bg-rose-500"},subtle:{bg:"bg-rose-50",text:"text-rose-700",border:"border-transparent",dot:"bg-rose-500"}},draft:{label:"draft",solid:{bg:"bg-gray-500",text:"text-white",border:"border-gray-600",dot:"bg-white"},outline:{bg:"bg-gray-50",text:"text-gray-700",border:"border-gray-100",dot:"bg-gray-500"},subtle:{bg:"bg-gray-50",text:"text-gray-700",border:"border-transparent",dot:"bg-gray-500"}},completed:{label:"completed",solid:{bg:"bg-indigo-500",text:"text-white",border:"border-indigo-600",dot:"bg-white"},outline:{bg:"bg-indigo-50",text:"text-indigo-700",border:"border-indigo-100",dot:"bg-indigo-500"},subtle:{bg:"bg-indigo-50",text:"text-indigo-700",border:"border-transparent",dot:"bg-indigo-500"}}},d=b[p.toLowerCase()]||b.inactive,D=a||d[c],v={sm:"text-xs px-2 py-0.5",md:"text-xs px-2.5 py-0.5",lg:"text-sm px-3 py-1"},F=s?p.charAt(0).toUpperCase()+p.slice(1):p;return Ze("div",{className:"flex justify-center",children:yr("span",{className:r("inline-flex items-center gap-1.5 rounded-full border font-medium",D.bg,D.text,D.border,v[l],o),children:[n&&(i?Ze("span",{className:"flex items-center",children:i}):Ze("span",{className:r("size-2 rounded-full",D.dot),"aria-hidden":"true"})),F]})})}};import{AlertTriangleIcon as Si}from"lucide-react";import{useRouteError as Pi,isRouteErrorResponse as Di,useNavigate as ki}from"react-router";import{Fragment as jo,jsx as Ee,jsxs as Bt}from"react/jsx-runtime";var wr=()=>{let e=Pi(),t=ki();return Ee("div",{className:"rounded-2xl flex justify-center items-center h-full bg-sidebar px-4",children:Bt("div",{className:"flex flex-col items-center space-y-4 text-center",children:[Ee(Si,{className:"h-16 w-16 text-destructive"}),Di(e)?Bt(jo,{children:[Bt("h2",{className:"text-3xl font-semibold text-destructive",children:["Error ",e.status,": ",e.statusText]}),typeof e.data=="string"?Ee("pre",{className:"text-lg text-muted-foreground whitespace-pre-wrap max-w-4xl text-left",children:e.data}):e.data?.message&&Ee("pre",{className:"text-lg text-muted-foreground whitespace-pre-wrap max-w-4xl text-left",children:e.data.message})]}):e instanceof Error?Bt(jo,{children:[Ee("h2",{className:"text-3xl font-semibold text-destructive",children:"Unexpected Error"}),Ee("pre",{className:"text-lg text-muted-foreground whitespace-pre-wrap max-w-4xl text-left",children:e.message}),e.stack&&Bt("details",{className:"mt-2 text-sm text-muted-foreground max-w-4xl text-left",children:[Ee("summary",{className:"cursor-pointer underline",children:"Stack Trace"}),Ee("pre",{className:"whitespace-pre-wrap",children:e.stack})]})]}):Bt(jo,{children:[Ee("h2",{className:"text-3xl font-semibold text-destructive",children:"Unknown Error"}),Ee("pre",{className:"text-lg text-muted-foreground whitespace-pre-wrap max-w-4xl text-left",children:typeof e=="string"?e:JSON.stringify(e,null,2)})]}),Ee(y,{variant:"outline",onClick:()=>t(-1),children:"Go Back"})]})})};import{motion as et}from"framer-motion";import{jsx as te,jsxs as ye}from"react/jsx-runtime";function Ri({size:e=100,strokeWidth:t=2,color:o="currentColor",className:n=""}){return ye(et.svg,{width:e,height:e,viewBox:"0 0 100 100",initial:"hidden",animate:"visible",className:n,children:[te("title",{children:"Animated Checkmark"}),te(et.circle,{cx:"50",cy:"50",r:"40",stroke:o,custom:0,style:{strokeWidth:t,strokeLinecap:"round",fill:"transparent"}}),te(et.path,{d:"M30 50L45 65L70 35",stroke:o,custom:1,style:{strokeWidth:t,strokeLinecap:"round",strokeLinejoin:"round",fill:"transparent"}})]})}function Cr(){return te(Xe,{className:"w-full max-w-sm mx-auto p-6 min-h-[300px] flex flex-col justify-center bg-background",children:ye(Ye,{className:"space-y-4 flex flex-col items-center justify-center",children:[te(et.div,{className:"flex justify-center",initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{duration:.4,ease:[.4,0,.2,1],scale:{type:"spring",damping:15,stiffness:200}},children:ye("div",{className:"relative",children:[te(et.div,{className:"absolute inset-0 bg-primary/5 rounded-full",initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{delay:.2,duration:.8,ease:"circOut"}}),te(Ri,{size:80,strokeWidth:4,color:"rgb(16 185 129)",className:"relative z-10 dark:drop-shadow-[0_0_10px_rgba(0,0,0,0.1)]"})]})}),ye(et.div,{className:"space-y-2 text-center w-full",initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.2,duration:.6,ease:[.4,0,.2,1]},children:[te(et.h2,{className:"text-lg text-zinc-100 dark:text-zinc-900 tracking-tighter font-semibold uppercase",initial:{opacity:0,y:5},animate:{opacity:1,y:0},transition:{delay:1,duration:.4},children:"Transfer Successful"}),te("div",{className:"flex items-center gap-4",children:te(et.div,{className:"flex-1 bg-zinc-800/50 dark:bg-zinc-50/50 rounded-xl p-3 border border-zinc-700/50 dark:border-zinc-200/50 backdrop-blur-md",initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},transition:{delay:1.2,duration:.4,ease:[.4,0,.2,1]},children:ye("div",{className:"flex flex-col items-start gap-2",children:[ye("div",{className:"space-y-1.5",children:[ye("span",{className:"text-xs font-medium text-secondary-foreground flex items-center gap-1.5",children:[ye("svg",{className:"w-3 h-3",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[te("title",{children:"From"}),te("path",{d:"M12 19V5M5 12l7-7 7 7"})]}),"From"]}),ye("div",{className:"flex items-center gap-2.5 group transition-all",children:[te("span",{className:"inline-flex items-center justify-center w-7 h-7 rounded-lg bg-zinc-900 dark:bg-white shadow-lg border border-zinc-700 dark:border-zinc-300 text-sm font-medium text-zinc-100 dark:text-zinc-900 group-hover:scale-105 transition-transform",children:"$"}),te("span",{className:"font-medium text-zinc-100 dark:text-zinc-900 tracking-tight",children:"500.00 USD"})]})]}),te("div",{className:"w-full h-px bg-gradient-to-r from-transparent via-zinc-700 dark:via-zinc-300 to-transparent"}),ye("div",{className:"space-y-1.5",children:[ye("span",{className:"text-xs font-medium text-secondary-foreground flex items-center gap-1.5",children:[ye("svg",{className:"w-3 h-3",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[te("title",{children:"To"}),te("path",{d:"M12 5v14M5 12l7 7 7-7"})]}),"To"]}),ye("div",{className:"flex items-center gap-2.5 group transition-all",children:[te("span",{className:"inline-flex items-center justify-center w-7 h-7 rounded-lg bg-zinc-900 dark:bg-white shadow-lg border border-zinc-700 dark:border-zinc-300 text-sm font-medium text-zinc-100 dark:text-zinc-900 group-hover:scale-105 transition-transform",children:"\u20AC"}),te("span",{className:"font-medium text-zinc-100 dark:text-zinc-900 tracking-tight",children:"460.00 EUR"})]})]})]})})}),te(et.div,{className:"w-full text-xs text-secondary-foreground mt-2 text-center",initial:{opacity:0},animate:{opacity:1},transition:{delay:1.4,duration:.4},children:"Exchange Rate: 1 USD = 0.92 EUR"})]})]})})}import{jsx as bo,jsxs as Mi}from"react/jsx-runtime";var Nr=()=>bo("div",{className:"rounded-2xl flex justify-center items-center h-full bg-transparent",children:Mi("div",{className:"flex flex-col items-center space-y-4",children:[bo("div",{className:"animate-spin rounded-full border-t-4 border-ring h-16 w-16 mb-4"}),bo("h2",{className:"text-xl font-semibold text-muted-foreground",children:"Loading, please wait..."}),bo("p",{className:"text-sm text-muted-foreground",children:"Your content is on its way."})]})});import{useLocation as zi}from"react-router";import{GhostIcon as Fi}from"lucide-react";import{NavLink as Ai,useNavigate as Ii}from"react-router";import{jsx as Gt,jsxs as $o}from"react/jsx-runtime";var Tr=()=>{let e=zi(),t=Ii(),o=()=>{window.history.length>2?t(-1):t("/")};return $o("div",{className:"rounded-2xl flex flex-col items-center justify-center h-full p-6 text-center bg-sidebar text-muted-foreground select-none",children:[Gt(Fi,{className:"h-15 w-15 text-destructive mb-4"}),Gt("h1",{className:"text-2xl font-bold text-destructive mb-2",children:"Page Not Found"}),$o("p",{className:"text-xl mb-4",children:["The page ",Gt("code",{className:"px-1 py-0.5 rounded bg-muted text-foreground",children:e.pathname})," doesn't exist or has been moved."]}),$o("div",{className:"flex space-x-4",children:[Gt(y,{variant:"outline",onClick:o,children:"Go Back"}),Gt(y,{variant:"ghost",children:Gt(Ai,{to:"/",children:"Return Home"})})]})]})};import{WifiOffIcon as Bi}from"lucide-react";import{jsx as Uo,jsxs as Gi}from"react/jsx-runtime";var Sr=()=>Gi("div",{className:"rounded-2xl flex flex-col items-center justify-center h-screen p-6 text-center text-muted-foreground bg-background select-none",children:[Uo(Bi,{className:"h-15 w-15 text-destructive mb-4"}),Uo("h1",{className:"text-3xl font-bold text-destructive mb-2",children:"You're offline"}),Uo("p",{className:"text-xl max-w-md",children:"We couldn't connect to the server."})]});import{ShieldOffIcon as Li}from"lucide-react";import{NavLink as Ei,useNavigate as _i}from"react-router";import{jsx as Lt,jsxs as Pr}from"react/jsx-runtime";var Dr=()=>{let e=_i();return Pr("div",{className:"rounded-2xl flex flex-col items-center justify-center h-full p-6 text-center bg-sidebar text-muted-foreground select-none",children:[Lt(Li,{className:"h-15 w-15 text-destructive mb-4"}),Lt("h1",{className:"text-2xl font-bold text-destructive mb-2",children:"Access Denied"}),Lt("p",{className:"text-xl mb-4",children:"You don't have permission to view this page. Please sign in with an authorized account or contact your administrator."}),Pr("div",{className:"flex space-x-4",children:[Lt(y,{variant:"outline",onClick:()=>{window.history.length>2?e(-1):e("/")},children:"Go Back"}),Lt(y,{variant:"ghost",children:Lt(Ei,{to:"/",children:"Go to Home"})})]})]})};export{gi as AppContainer,vi as AppContent,hr as AppContentFooter,br as AppContentHeader,yi as AppFooter,hi as AppHeader,xr as AppSheet,Cr as CurrencyTransfer,er as DataTable,or as DataTableActionBar,nr as DataTableActionBarAction,rr as DataTableActionBarSelection,dr as DataTemplate,ur as DataTemplateActionBar,mr as DataTemplateActionBarAction,pr as DataTemplateActionBarSelection,wr as ErrorComponent,Ho as GeneralHelper,Nr as Loader,Tr as NotFound,Sr as OfflineUI,Dr as Unauthorized,ro as getTableExportView,Vn as readPersistedExternal,ar as useTableFilterParam};
2
+ import{flexRender as _a,getCoreRowModel as Oa,getFilteredRowModel as Va,getPaginationRowModel as Ha,getSortedRowModel as ja,useReactTable as $a}from"@tanstack/react-table";import{Loader2 as Zn}from"lucide-react";import{Slot as jr}from"radix-ui";import{cva as $r}from"class-variance-authority";import{clsx as Vr}from"clsx";import{twMerge as Hr}from"tailwind-merge";function r(...e){return Hr(Vr(e))}import{jsx as Ur}from"react/jsx-runtime";var to=$r("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-[color,box-shadow] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 dark:focus-visible:border-ring",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function y({className:e,variant:t,size:o,asChild:n=!1,...s}){let d=n?jr.Slot:"button";return Ur(d,{"data-slot":"button",className:r(to({variant:t,size:o,className:e})),...s})}import{jsx as rt}from"react/jsx-runtime";function No({className:e,...t}){return rt("div",{"data-slot":"table-container",className:"relative w-full h-full max-h-full overflow-auto",children:rt("table",{"data-slot":"table",className:r("w-full caption-bottom text-sm",e),...t})})}function tn({className:e,...t}){return rt("thead",{"data-slot":"table-header",className:r("[&_tr]:border-b",e),...t})}function on({className:e,...t}){return rt("tbody",{"data-slot":"table-body",className:r("[&_tr:last-child]:border-0",e),...t})}function oo({className:e,...t}){return rt("tfoot",{"data-slot":"table-footer",className:r("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",e),...t})}function Fe({className:e,...t}){return rt("tr",{"data-slot":"table-row",className:r("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t})}function nn({className:e,...t}){return rt("th",{"data-slot":"table-head",className:r("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap",e),...t})}function je({className:e,...t}){return rt("td",{"data-slot":"table-cell",className:r("p-2 align-middle whitespace-nowrap",e),...t})}import{jsx as rn}from"react/jsx-runtime";function Xe({className:e,...t}){return rn("div",{"data-slot":"card",className:r("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function Ye({className:e,...t}){return rn("div",{"data-slot":"card-content",className:r("px-6",e),...t})}import{Tooltip as Rt}from"radix-ui";import{jsx as Mt,jsxs as Wr}from"react/jsx-runtime";function yt({delayDuration:e=0,...t}){return Mt(Rt.Provider,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function at({...e}){return Mt(yt,{children:Mt(Rt.Root,{"data-slot":"tooltip",...e})})}function it({...e}){return Mt(Rt.Trigger,{"data-slot":"tooltip-trigger",...e})}function st({className:e,sideOffset:t=0,children:o,...n}){return Mt(Rt.Portal,{children:Wr(Rt.Content,{"data-slot":"tooltip-content",sideOffset:t,className:r("bg-primary text-primary-foreground 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 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...n,children:[o,Mt(Rt.Arrow,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}import{ArrowUpDown as ma,Calculator as pa,Check as ga,ChevronDown as fa,Download as ba,Filter as Tn,FilterX as ha,PinOff as xa,RefreshCw as va,Search as ya,Settings2 as wa,X as Ca}from"lucide-react";import{useEffect as Na,useRef as Sn,useState as Pn}from"react";import{useEffect as Qr,useState as un}from"react";import{Calendar as Zr}from"lucide-react";import{format as ea}from"date-fns";import{Popover as no}from"radix-ui";import{jsx as ro}from"react/jsx-runtime";function an({...e}){return ro(no.Root,{"data-slot":"popover",...e})}function sn({...e}){return ro(no.Trigger,{"data-slot":"popover-trigger",...e})}function ln({className:e,align:t="center",sideOffset:o=4,...n}){return ro(no.Portal,{children:ro(no.Content,{"data-slot":"popover-content",align:t,sideOffset:o,className:r("bg-popover text-popover-foreground 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 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...n})})}import*as ao from"react";import{ChevronDownIcon as Kr,ChevronLeftIcon as qr,ChevronRightIcon as Jr}from"lucide-react";import{DayPicker as Xr,getDefaultClassNames as dn}from"react-day-picker";import{jsx as lt}from"react/jsx-runtime";function cn({className:e,classNames:t,showOutsideDays:o=!0,captionLayout:n="label",buttonVariant:s="ghost",formatters:d,components:c,...a}){let i=dn();return lt(Xr,{showOutsideDays:o,className:r("bg-background group/calendar p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,e),captionLayout:n,formatters:{formatMonthDropdown:m=>m.toLocaleString("default",{month:"short"}),...d},classNames:{root:r("w-fit",i.root),months:r("flex gap-4 flex-col md:flex-row relative",i.months),month:r("flex flex-col w-full gap-4",i.month),nav:r("flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between",i.nav),button_previous:r(to({variant:s}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",i.button_previous),button_next:r(to({variant:s}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",i.button_next),month_caption:r("flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)",i.month_caption),dropdowns:r("w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5",i.dropdowns),dropdown_root:r("relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md",i.dropdown_root),dropdown:r("absolute bg-popover inset-0 opacity-0",i.dropdown),caption_label:r("select-none font-medium",n==="label"?"text-sm":"rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-muted-foreground [&>svg]:size-3.5",i.caption_label),table:"w-full border-collapse",weekdays:r("flex",i.weekdays),weekday:r("text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none",i.weekday),week:r("flex w-full mt-2",i.week),week_number_header:r("select-none w-(--cell-size)",i.week_number_header),week_number:r("text-[0.8rem] select-none text-muted-foreground",i.week_number),day:r("relative w-full h-full p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none",i.day),range_start:r("rounded-l-md bg-accent",i.range_start),range_middle:r("rounded-none",i.range_middle),range_end:r("rounded-r-md bg-accent",i.range_end),today:r("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",i.today),outside:r("text-muted-foreground aria-selected:text-muted-foreground",i.outside),disabled:r("text-muted-foreground opacity-50",i.disabled),hidden:r("invisible",i.hidden),...t},components:{Root:({className:m,rootRef:f,...p})=>lt("div",{"data-slot":"calendar",ref:f,className:r(m),...p}),Chevron:({className:m,orientation:f,...p})=>f==="left"?lt(qr,{className:r("size-4",m),...p}):f==="right"?lt(Jr,{className:r("size-4",m),...p}):lt(Kr,{className:r("size-4",m),...p}),DayButton:Yr,WeekNumber:({children:m,...f})=>lt("td",{...f,children:lt("div",{className:"flex size-(--cell-size) items-center justify-center text-center",children:m})}),...c},...a})}function Yr({className:e,day:t,modifiers:o,...n}){let s=dn(),d=ao.useRef(null);return ao.useEffect(()=>{o.focused&&d.current?.focus()},[o.focused]),lt(y,{ref:d,variant:"ghost",size:"icon","data-day":t.date.toLocaleDateString(),"data-selected-single":o.selected&&!o.range_start&&!o.range_end&&!o.range_middle,"data-range-start":o.range_start,"data-range-end":o.range_end,"data-range-middle":o.range_middle,className:r("data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70",s.day,e),...n})}import{jsx as wt,jsxs as $t}from"react/jsx-runtime";function mn({value:e,onChange:t,placeholder:o,mode:n,externalSearch:s,onExternalChange:d,dateFormat:c,triggerClassName:a}){let i=c?c.replace(/Y/g,"y").replace(/D/g,"d"):null,[m,f]=un(!1),[p,g]=un(e);Qr(()=>{g(e)},[e]);let l=v=>{if(v==null)return null;if(v instanceof Date)return isNaN(v.getTime())?null:v;let z=new Date(v);return isNaN(z.getTime())?null:z},S=(v,z)=>{let O=l(v);return O?ea(O,z):null},x=v=>{s?d?.(v):t?.(v)},M=()=>{x(p),f(!1)},A=()=>{g(e),f(!1)},_=()=>{let v=n==="single"?null:{from:null,to:null};g(v),x(v),f(!1)},W=()=>{let v=e;if(!v)return o;if(n==="single")return S(v,i||"PPP")??o;if(v.from&&v.to){let z=S(v.from,i||"MMM dd"),O=S(v.to,i||"MMM dd, yyyy");return z&&O?`${z} - ${O}`:o}if(v.from){let z=S(v.from,i||"MMM dd, yyyy");return z?`From ${z}`:o}if(v.to){let z=S(v.to,i||"MMM dd, yyyy");return z?`To ${z}`:o}return o},N=v=>{g(n==="single"?v:v||{from:null,to:null})};return $t(an,{open:m,onOpenChange:f,children:[wt(sn,{className:"h-8",asChild:!0,children:$t(y,{variant:"outline",className:r("w-full justify-start text-left font-normal h-8 rounded-lg",W()===o&&"text-muted-foreground",a),children:[wt(Zr,{className:"mr-2 h-4 w-4 shrink-0"}),W()]})}),$t(ln,{className:"w-auto p-0",align:"start",children:[wt("div",{className:"p-3",children:wt(cn,{mode:n,selected:p,onSelect:N,numberOfMonths:n==="range"?2:1,className:"rounded-md border",...n==="range"&&{required:!0}})}),$t("div",{className:"flex items-center justify-between p-3 border-t",children:[wt(y,{variant:"ghost",size:"sm",onClick:_,children:"Clear"}),$t("div",{className:"flex gap-2",children:[wt(y,{variant:"outline",size:"sm",onClick:A,children:"Cancel"}),wt(y,{size:"sm",onClick:M,disabled:n==="range"&&(!p?.from||!p?.to),children:"Apply"})]})]})]})]})}import{DropdownMenu as xe}from"radix-ui";import{CheckIcon as ta,ChevronRightIcon as oa,CircleIcon as ks}from"lucide-react";import{jsx as be,jsxs as bn}from"react/jsx-runtime";function Ae({...e}){return be(xe.Root,{"data-slot":"dropdown-menu",...e})}function Ie({...e}){return be(xe.Trigger,{"data-slot":"dropdown-menu-trigger",...e})}function Be({className:e,sideOffset:t=4,...o}){return be(xe.Portal,{children:be(xe.Content,{"data-slot":"dropdown-menu-content",sideOffset:t,className:r("bg-popover text-popover-foreground 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 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) rounded-md border p-1 shadow-md",e),...o})})}function To({...e}){return be(xe.Group,{"data-slot":"dropdown-menu-group",...e})}function Y({className:e,inset:t,variant:o="default",...n}){return be(xe.Item,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":o,className:r("cursor-pointer focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...n})}function io({className:e,children:t,checked:o,...n}){return bn(xe.CheckboxItem,{"data-slot":"dropdown-menu-checkbox-item",className:r("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),checked:o,...n,children:[be("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:be(xe.ItemIndicator,{children:be(ta,{className:"size-4"})})}),t]})}function ue({className:e,inset:t,...o}){return be(xe.Label,{"data-slot":"dropdown-menu-label","data-inset":t,className:r("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...o})}function he({className:e,...t}){return be(xe.Separator,{"data-slot":"dropdown-menu-separator",className:r("bg-border -mx-1 my-1 h-px",e),...t})}function pn({...e}){return be(xe.Sub,{"data-slot":"dropdown-menu-sub",...e})}function gn({className:e,inset:t,children:o,...n}){return bn(xe.SubTrigger,{"data-slot":"dropdown-menu-sub-trigger","data-inset":t,className:r("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",e),...n,children:[o,be(oa,{className:"ml-auto size-4"})]})}function fn({className:e,...t}){return be(xe.SubContent,{"data-slot":"dropdown-menu-sub-content",className:r("bg-popover text-popover-foreground 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 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",e),...t})}import{jsx as na}from"react/jsx-runtime";function zt({className:e,type:t,...o}){return na("input",{type:t,"data-slot":"input",className:r("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...o})}import{Select as Ne}from"radix-ui";import{CheckIcon as ra,ChevronDownIcon as hn,ChevronUpIcon as aa}from"lucide-react";import{jsx as se,jsxs as So}from"react/jsx-runtime";function dt({...e}){return se(Ne.Root,{"data-slot":"select",...e})}function ct({...e}){return se(Ne.Value,{"data-slot":"select-value",...e})}function ut({className:e,size:t="default",children:o,...n}){return So(Ne.Trigger,{"data-slot":"select-trigger","data-size":t,className:r("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...n,children:[o,se(Ne.Icon,{asChild:!0,children:se(hn,{className:"size-4 opacity-50"})})]})}function mt({className:e,children:t,position:o="popper",...n}){return se(Ne.Portal,{children:So(Ne.Content,{"data-slot":"select-content",className:r("bg-popover text-popover-foreground 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 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",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,...n,children:[se(ia,{}),se(Ne.Viewport,{className:r("p-1",o==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),se(sa,{})]})})}function $e({className:e,children:t,...o}){return So(Ne.Item,{"data-slot":"select-item",className:r("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...o,children:[se("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:se(Ne.ItemIndicator,{children:se(ra,{className:"size-4"})})}),se(Ne.ItemText,{children:t})]})}function ia({className:e,...t}){return se(Ne.ScrollUpButton,{"data-slot":"select-scroll-up-button",className:r("flex cursor-default items-center justify-center py-1",e),...t,children:se(aa,{className:"size-4"})})}function sa({className:e,...t}){return se(Ne.ScrollDownButton,{"data-slot":"select-scroll-down-button",className:r("flex cursor-default items-center justify-center py-1",e),...t,children:se(hn,{className:"size-4"})})}var la=new Set(["select","serialNumber"]);function so(e){let t=e.getVisibleLeafColumns().filter(n=>la.has(n.id)?!1:!!n.columnDef.exportValue||!!n.accessorFn),o=e.getPrePaginationRowModel().rows;return{columns:t.map(n=>{let s=n.columnDef;return{id:n.id,header:s.exportHeader??(typeof s.header=="string"?s.header:n.id)}}),rows:o.map(n=>t.map(s=>{let d=s.columnDef;return d.exportValue?d.exportValue(n.original):n.getValue(s.id)})),originals:o.map(n=>n.original)}}import{Calculator as ca,ChevronDown as yn,Columns3 as ua}from"lucide-react";import{Checkbox as xn}from"radix-ui";import{CheckIcon as da}from"lucide-react";import{jsx as Po}from"react/jsx-runtime";function Ct({className:e,...t}){return Po(xn.Root,{"data-slot":"checkbox",className:r("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:Po(xn.Indicator,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:Po(da,{className:"size-3.5"})})})}import{jsx as V,jsxs as me}from"react/jsx-runtime";var vn=[{value:"sum",label:"Sum",description:"Total of all values"},{value:"average",label:"Average",description:"Mean value"},{value:"min",label:"Minimum",description:"Smallest value"},{value:"max",label:"Maximum",description:"Largest value"},{value:"count",label:"Count",description:"Number of rows"},{value:"unique",label:"Unique",description:"Count of distinct values"},{value:"median",label:"Median",description:"Middle value"}],Do=(e,t)=>(t&&e.startsWith(`${t}.`)?e.replace(`${t}.`,""):e).split("_").map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" ");function ko(e,t){t&&Object.keys(e).forEach(o=>{let n=e[o];n&&t(o,{...n,enabled:!1,functions:[]})})}var wn=e=>e.getAllLeafColumns().filter(t=>t.getCanHide?.()!==!1);function Cn({table:e,aggregations:t,onAggregationChange:o}){let n=wn(e).filter(a=>a.id==="select"||a.id==="serialNumber"?!1:a.columnDef.meta?.aggregatable?!0:e.getRowModel().rows.slice(0,5).some(i=>{let m=i.getValue(a.id);return typeof m=="number"||typeof m=="string"&&!isNaN(parseFloat(String(m)))||typeof m=="object"&&m!==null&&"props"in m}));if(n.length===0||!o)return null;let s=Object.values(t).some(a=>a?.enabled),d=a=>{let i=t[a];o(a,{enabled:!i?.enabled,functions:i?.functions||["sum","average"]})},c=(a,i)=>{let m=t[a]?.functions||[],f=m.includes(i)?m.filter(p=>p!==i):[...m,i];o(a,{enabled:f.length>0,functions:f})};return me(Ae,{children:[V(Ie,{asChild:!0,children:me(y,{variant:"outline",size:"sm",className:"gap-1 rounded-lg",children:[V(ca,{className:"size-4"}),V("span",{children:"Aggregations"}),V(yn,{className:"opacity-50 size-4"})]})}),me(Be,{align:"end",className:"w-64 rounded-lg max-h-[500px] overflow-y-auto",children:[me(ue,{className:"flex items-center justify-between px-4 py-2",children:[V("span",{className:"text-sm font-medium",children:"Column Aggregations"}),s&&V(y,{variant:"ghost",size:"sm",className:"h-6 px-2 text-xs",onClick:()=>ko(t,o),children:"Clear All"})]}),V(he,{}),n.map(a=>{let i=t[a.id],m=i?.enabled;return me(pn,{children:[V(gn,{className:"text-sm",children:me("div",{className:"flex items-center w-full gap-2",children:[V(Ct,{checked:m,onCheckedChange:()=>d(a.id),className:"data-[state=checked]:bg-primary"}),V("span",{className:r("flex-1",m&&"font-medium text-primary"),children:Do(a.id)}),m&&me("div",{className:"flex items-center gap-1",children:[i?.functions?.slice(0,2).map(f=>V("div",{className:"w-2 h-2 rounded-full bg-primary",title:vn.find(p=>p.value===f)?.label},f)),i?.functions&&i.functions.length>2&&me("div",{className:"text-xs text-muted-foreground",children:["+",i.functions.length-2]})]})]})}),me(fn,{className:"w-48 rounded-lg",children:[V(ue,{className:"px-3 py-2 text-xs font-medium text-muted-foreground",children:"Select Functions"}),vn.map(f=>V(io,{checked:i?.functions?.includes(f.value)||!1,onCheckedChange:()=>c(a.id,f.value),className:"py-2 text-sm",children:me("div",{className:"flex flex-col",children:[V("span",{children:f.label}),V("span",{className:"text-xs text-muted-foreground",children:f.description})]})},f.value))]})]},a.id)})]})]})}function Nn({table:e}){let t=wn(e),o=e.getAllColumns().filter(d=>!e.getAllLeafColumns().includes(d)&&d.columns?.length&&d.columns.some(c=>c.getCanHide?.()!==!1)),n=new Set(o.flatMap(d=>d.columns?.filter(c=>c.getCanHide?.()!==!1).map(c=>c.id)||[])),s=t.filter(d=>!n.has(d.id));return me(Ae,{children:[V(Ie,{asChild:!0,children:me(y,{variant:"outline",size:"sm",className:"gap-1 rounded-lg",children:[V(ua,{className:"size-4"}),V("span",{children:"Columns"}),V(yn,{className:"opacity-50 size-4"})]})}),me(Be,{align:"end",className:"w-[220px] rounded-lg max-h-[400px] overflow-y-auto",children:[V(ue,{className:"px-4 py-2 text-sm font-medium",children:"Toggle Columns"}),V(he,{}),s.length>0&&me(To,{children:[V(ue,{className:"px-4 py-1.5 text-sm font-medium text-muted-foreground",children:"General"}),s.map(d=>V(io,{className:"text-sm",checked:d.getIsVisible(),onCheckedChange:c=>d.toggleVisibility(!!c),children:Do(d.id)},d.id))]}),o.map(d=>me(To,{children:[V(he,{}),V(ue,{className:"px-4 py-1.5 text-sm font-medium text-muted-foreground",children:d.id}),d.columns?.filter(c=>c.getCanHide?.()!==!1).map(c=>V(io,{className:"text-sm",checked:c.getIsVisible(),onCheckedChange:a=>c.toggleVisibility(!!a),children:Do(c.id,d.id)},c.id))]},d.id))]})]})}import{Fragment as Ta,jsx as R,jsxs as J}from"react/jsx-runtime";var le=e=>e.id??e.key;function Ro({table:e,filters:t=[],globalFilter:o,onGlobalFilterChange:n,enableGlobalFilter:s=!0,onExport:d,onRefresh:c,loading:a=!1,enableColumnVisibility:i=!0,onClearSorting:m,onClearFilters:f,enableColumnPinning:p=!1,enableSorting:g=!0,onExternalSearch:l,initialExternalValues:S,aggregations:x={},onAggregationChange:M,groupedFilterLabel:A="Global",showFilterChips:_=!0,initialGroupedField:W,onGroupedFieldChange:N}){let[v,z]=Pn(S??{}),[O,K]=Pn(W??"all"),Q=Sn(S??{}),b=Sn(void 0);Na(()=>()=>clearTimeout(b.current),[]);let C=(u,$,re=!1)=>{let Z={...Q.current,[u]:$};Q.current=Z,z(Z),clearTimeout(b.current),re?b.current=setTimeout(()=>l?.(Z),500):l?.(Z)},F=()=>{clearTimeout(b.current),Q.current={},z({}),K("all"),N?.("all"),f(),l?.({})},D=u=>t.find(re=>le(re)===u)?.externalSearch?v[u]??"":e.getColumn(u)?.getFilterValue(),h=(u,$)=>{let re=t.find(Z=>le(Z)===u);re?.externalSearch?C(u,$,re.type==="text"):e.getColumn(u)?.setFilterValue($)},k=u=>{K(u),N?.(u),u!=="all"&&n("")},ne=Object.values(x).some(u=>u?.enabled),B=u=>!!u.externalSearch||!!e.getColumn(le(u)),q=u=>{let $=D(le(u));return $==null||$===""?!1:typeof $=="object"?!!($.from||$.to):!0},fe=u=>u.type==="date"||u.type==="daterange",_e=u=>{h(le(u),fe(u)?null:"")},Oe=u=>{let $=D(le(u));return u.type==="select"?u.options?.find(re=>re.value===$)?.label??String($):fe(u)?"set":String($)},Pe=(u,$)=>{let re=$?.embedded;if(u.type==="select"){let Z=le(u),ht=D(Z);return J(dt,{value:ht?String(ht):"",onValueChange:He=>h(Z,He==="__all__"?"":He),children:[R(ut,{size:"sm",className:r("w-full",re?"border border-transparent rounded-l-none rounded-r-lg shadow-none relative focus-visible:z-10 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]":"rounded-lg"),children:J("span",{className:"flex items-center gap-2 truncate",children:[u.icon&&R(u.icon,{className:"size-4 shrink-0 text-muted-foreground"}),R(ct,{placeholder:u.placeholder})]})}),J(mt,{className:"rounded-lg",children:[R($e,{value:"__all__",children:"All"}),u.options?.map(He=>R($e,{value:He.value,children:He.label},He.value))]})]})}return u.type==="date"||u.type==="daterange"?R(mn,{value:D(le(u)),onChange:Z=>h(le(u),Z),placeholder:u.placeholder,mode:u.type==="daterange"?"range":"single",dateFormat:u.dateFormat,externalSearch:u.externalSearch,onExternalChange:Z=>C(le(u),Z),triggerClassName:re?"border border-transparent rounded-l-none rounded-r-lg shadow-none relative focus-visible:z-10 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]":void 0}):J("div",{className:"relative w-full",children:[u.icon&&R(u.icon,{className:"absolute -translate-y-1/2 size-4 left-3 top-1/2 text-muted-foreground"}),R(zt,{placeholder:u.placeholder,value:D(le(u))??"",onChange:Z=>{h(le(u),Z.target.value)},className:r("h-8",u.icon&&"pl-9",re?"border border-transparent rounded-l-none rounded-r-lg shadow-none relative focus-visible:z-10 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]":"rounded-lg"),type:u.type==="number"?"number":"text"})]})},ce=t.filter(u=>(u.placement??"bar")==="bar"),De=t.filter(u=>u.placement==="menu"),we=s&&De.length>0,tt=De.filter(q),ke=e.getState().columnFilters.length>0||!!o||t.some(q),{left:Et=[],right:Ve=[]}=e.getState().columnPinning,ot=Et.some(u=>u!=="serialNumber"&&u!=="select")||Ve.length>0,j=[{value:"all",label:"All Fields"},...De.map(u=>({value:le(u),label:u.placeholder}))];return J("div",{className:"flex flex-wrap items-center gap-3",children:[ce.length>0&&R(Tn,{className:"size-4 text-muted-foreground shrink-0"}),ce.map(u=>B(u)?R("div",{className:r("relative min-w-[150px]",u.width),children:Pe(u)},le(u)):null),_&&tt.map(u=>J("span",{className:"inline-flex items-center gap-1 h-8 px-2 rounded-lg border bg-muted/50 text-sm",children:[J("span",{className:"text-muted-foreground",children:[u.placeholder,":"]}),R("span",{className:"font-medium truncate max-w-[120px]",children:Oe(u)}),R("button",{type:"button",onClick:()=>_e(u),className:"ml-1 p-0.5 rounded hover:bg-accent","aria-label":`Clear ${u.placeholder}`,children:R(Ca,{className:"size-3.5"})})]},`chip-${le(u)}`)),ke&&J(y,{variant:"ghost",size:"sm",onClick:F,className:"h-8 px-2 rounded-lg text-muted-foreground hover:text-foreground",children:[R(ha,{className:"size-4"}),"Clear Filters"]}),J("div",{className:"flex flex-wrap items-center gap-2 ml-auto",children:[s&&J("div",{className:r("flex items-center",we&&"bg-background border rounded-lg"),children:[we&&J(Ae,{children:[R(Ie,{asChild:!0,children:J(y,{variant:"ghost",size:"sm",className:"gap-1 border border-transparent border-r-border rounded-l-lg rounded-r-none hover:bg-transparent shrink-0 relative focus-visible:z-10 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",children:[R("span",{className:"text-sm font-medium max-w-28 truncate",children:O==="all"?A:j.find(u=>u.value===O)?.label}),R(fa,{className:"opacity-50 size-4"})]})}),R(Be,{align:"start",className:"w-48 rounded-lg",children:j.map(u=>J(Y,{onClick:()=>k(u.value),className:"flex items-center justify-between",children:[R("span",{children:u.label}),O===u.value&&R(ga,{className:"size-4 text-primary"})]},u.value))})]}),(()=>{let u=we&&O!=="all"?De.find($=>le($)===O):void 0;return u?R("div",{className:"w-48",children:Pe(u,{embedded:!0})}):J("div",{className:"relative",children:[R(ya,{className:"absolute -translate-y-1/2 size-4 left-3 top-1/2 text-muted-foreground"}),R(zt,{placeholder:we?"Search all fields...":"Global search...",value:o??"",onChange:$=>n($.target.value),className:r("pl-9 h-8 w-48",we&&"border border-transparent rounded-l-none rounded-r-lg shadow-none relative focus-visible:z-10 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]")})]})})()]}),R(Cn,{table:e,aggregations:x,onAggregationChange:M}),i&&R(Nn,{table:e}),J(Ae,{children:[R(Ie,{asChild:!0,children:R(y,{variant:"outline",size:"sm",className:"rounded-lg",children:R(wa,{className:"size-4"})})}),J(Be,{align:"end",className:"w-[200px] rounded-lg",children:[R(ue,{children:"Table Settings"}),R(he,{}),d&&J(Y,{onClick:()=>{let u=so(e);d(u.originals,u)},children:[R(ba,{className:"size-4"}),"Export"]}),g&&J(Y,{onClick:m,disabled:e.getState().sorting.length===0,children:[R(ma,{className:"size-4"}),"Clear All Sorting"]}),J(Y,{onClick:F,disabled:!ke,children:[R(Tn,{className:"size-4"}),"Clear All Filters"]}),Object.keys(x).length>0&&J(Y,{onClick:()=>ko(x,M),disabled:!ne,children:[R(pa,{className:"size-4"}),"Clear Aggregations"]}),p&&J(Ta,{children:[R(he,{}),R(ue,{children:"Column Pinning"}),J(Y,{onClick:()=>e.setColumnPinning({left:[],right:[]}),disabled:!ot,children:[R(xa,{className:"size-4"}),"Reset All Pinning"]})]})]})]}),c&&R(y,{variant:"outline",size:"sm",onClick:c,disabled:a,className:"rounded-lg",children:R(va,{className:r("h-4 w-4",a&&"animate-spin")})})]})]})}import{ChevronLeft as Sa,ChevronRight as Pa}from"lucide-react";import{Fragment as ka,jsx as Te,jsxs as pt}from"react/jsx-runtime";function Da(e,t,o=1){let n=e+1,s=o*2+5;if(t<=s)return Array.from({length:t},(p,g)=>g+1);let d=Math.max(n-o,1),c=Math.min(n+o,t),a=d>2,i=c<t-1,m=3+o*2,f=[];if(!a&&i){for(let p=1;p<=m;p++)f.push(p);f.push("ellipsis",t)}else if(a&&!i){f.push(1,"ellipsis");for(let p=t-m+1;p<=t;p++)f.push(p)}else{f.push(1,"ellipsis");for(let p=d;p<=c;p++)f.push(p);f.push("ellipsis",t)}return f}function Mo({table:e,config:t}){if(!t)return null;let o=e.getPageCount(),n=e.getState().pagination.pageIndex,s=e.getState().pagination.pageSize,d=e.getFilteredRowModel().rows.length,c="size-8 p-0 rounded-lg";return pt("div",{className:"flex flex-wrap items-center justify-between gap-3 rounded-xl",children:[t.showInfo!==!1&&pt("span",{className:"hidden text-sm text-muted-foreground sm:inline",children:["Showing ",d===0?0:n*s+1," to"," ",Math.min((n+1)*s,d)," of ",d," entries"]}),pt("div",{className:"flex items-center gap-3",children:[(()=>{let a=t.pageSizeOptions??[10,25,50,100,-1];if(a.length===0)return null;let i=a.includes(-1),m=d>0&&s>=d,f=i&&m?"-1":`${s}`;return pt("div",{className:"flex items-center gap-2",children:[Te("span",{className:"hidden text-sm font-medium md:inline",children:"Rows"}),pt(dt,{value:f,onValueChange:p=>e.setPageSize(p==="-1"?Math.max(d,1):Number(p)),children:[Te(ut,{className:"h-8 w-auto min-w-[4rem] gap-1 rounded-lg",children:Te(ct,{})}),Te(mt,{side:"top",className:"rounded-lg",children:a.map(p=>Te($e,{value:`${p}`,children:p===-1?"All":p},p))})]})]})})(),o>1&&pt("div",{className:"flex items-center gap-1",children:[Te(y,{variant:"outline",size:"sm",onClick:()=>e.previousPage(),disabled:!e.getCanPreviousPage(),"aria-label":"Previous page",className:c,children:Te(Sa,{className:"size-4"})}),t.showPageNumbers&&pt(ka,{children:[pt("span",{className:"px-2 text-sm text-muted-foreground tabular-nums sm:hidden",children:[n+1," / ",o]}),Te("div",{className:"hidden items-center gap-1 sm:flex",children:Da(n,o).map((a,i)=>a==="ellipsis"?Te("span",{className:"flex size-8 items-center justify-center text-sm text-muted-foreground",children:"\u2026"},`e${i}`):Te(y,{variant:a-1===n?"default":"outline",size:"sm",className:r(c,"tabular-nums"),onClick:()=>e.setPageIndex(a-1),"aria-label":`Page ${a}`,"aria-current":a-1===n?"page":void 0,children:a},a))})]}),Te(y,{variant:"outline",size:"sm",onClick:()=>e.nextPage(),disabled:!e.getCanNextPage(),"aria-label":"Next page",className:c,children:Te(Pa,{className:"size-4"})})]})]})]})}import{useCallback as _o,useEffect as ve,useMemo as mo,useRef as Ue,useState as Se}from"react";function Nt(e,t){if(!t)return{};let o=e.getIsPinned();if(!o)return{};let n=e.getSize();return{position:"sticky",left:o==="left"?e.getStart("left"):void 0,right:o==="right"?e.getAfter("right"):void 0,width:n,minWidth:n,maxWidth:n,boxShadow:o==="right"&&e.getIsFirstColumn("right")?"inset 1px 0 0 0 var(--border)":void 0}}var Ge=(e,t)=>t||e!==150?e:"auto";function Dn(e){let t=[],o=[],n=new Set,s=c=>{c.forEach((a,i)=>{let m=a.id??a.accessorKey,f=m!=null?String(m):"";if(f&&(a.defaultPin==="left"||a.defaultPin==="right")&&!n.has(f)){n.add(f);let p=Number.isFinite(a.pinIndex)?a.pinIndex:i;(a.defaultPin==="left"?t:o).push({id:f,order:p})}a.columns&&s(a.columns)})};s(e);let d=c=>c.sort((a,i)=>a.order-i.order).map(a=>a.id);return{left:d(t),right:d(o)}}function kn(e,t){return{left:[...t,...(e.left??[]).filter(o=>!t.includes(o))],right:(e.right??[]).filter(o=>!t.includes(o))}}function Rn(e,t,o,n){if(o===!1)e.setColumnSizing(a=>{let i={...a};return delete i[t],i});else{let a=n.container?.querySelector(`[data-col-id="${t}"]`),i=a?Math.round(a.getBoundingClientRect().width):0;i>0&&e.setColumnSizing(m=>({...m,[t]:i}))}let{alwaysPinnedLeft:s}=n,d=e.getState().columnPinning,c={left:(d.left??[]).filter(a=>s.includes(a)),right:[...d.right??[]]};o==="right"?c.right.includes(t)||c.right.push(t):o==="left"?(c.right=c.right.filter(a=>a!==t),!c.left.includes(t)&&!s.includes(t)&&c.left.push(t)):(c.left=c.left.filter(a=>a!==t),c.right=c.right.filter(a=>a!==t)),e.setColumnPinning(c)}var Mn={sum:e=>e.reduce((t,o)=>t+o,0),average:e=>e.length>0?e.reduce((t,o)=>t+o,0)/e.length:0,min:e=>e.length>0?Math.min(...e):0,max:e=>e.length>0?Math.max(...e):0,count:e=>e.length,unique:e=>new Set(e).size,median:e=>{if(e.length===0)return 0;let t=[...e].sort((n,s)=>n-s),o=Math.floor(t.length/2);return t.length%2===0?(t[o-1]+t[o])/2:t[o]}};function zn(e,t){if(!t||Object.keys(t).length===0)return{};let o={},n=e.getFilteredRowModel().rows;return Object.entries(t).forEach(([s,d])=>{if(!d?.enabled)return;let c=n.map(i=>{if(d.accessor)return d.accessor(i.original);let m=i.getValue(s);return typeof m=="number"?m:parseFloat(String(m))}).filter(i=>i!==null&&!isNaN(i)),a={};d.functions?.forEach(i=>{Mn[i]&&(a[i]=Mn[i](c))}),Object.keys(a).length>0&&(o[s]=a)}),o}function Fn(e,t){return typeof t=="number"?e==="count"||e==="unique"?t.toLocaleString():t.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2}):t}function Ra(e,t){return t.split(".").reduce((o,n)=>o&&o[n],e)}function An(e,t=new Set){for(let o of e){let n=o.id??o.accessorKey;n&&t.add(String(n)),o.columns&&An(o.columns,t)}return t}function lo(e,t){let o=An(e),n=[];for(let s of t){if(s.externalSearch)continue;let d=typeof s.filterFn=="function",c=d?s.id:s.key;if(!c||o.has(String(c)))continue;let a=s.key;n.push({id:String(c),accessorFn:a?i=>Ra(i,a):()=>null,...d&&{filterFn:(i,m,f)=>s.filterFn(i.original,f)},enableHiding:!1,enableSorting:!1,enablePinning:!1,enableGlobalFilter:!1,meta:{filterOnly:!0}})}return n}import{jsx as Ft}from"react/jsx-runtime";function In({initialColumns:e,filters:t,showSerialNumbers:o,enableRowSelection:n,selectionMode:s,showCheckbox:d,enableHeaderCheckbox:c,isRowSelectable:a}){let i=p=>p.map(g=>{if(g.id==="select"||g.id==="serialNumber")return g;let l={...g,enablePinning:!0};return g.enableColumnVisibility!==void 0&&g.enableHiding===void 0&&(l.enableHiding=g.enableColumnVisibility),g.columns&&(l.columns=i(g.columns)),l}),m=i([...e]),f={id:"select",header:({table:p})=>{if(s==="single")return null;let g=p.getRowModel().rows.filter(x=>a?.(x.original)??!0),l=g.length>0&&g.every(x=>x.getIsSelected()),S=g.some(x=>x.getIsSelected());return Ft("div",{className:"flex justify-center items-center",children:Ft(Ct,{checked:l||S&&"indeterminate",onCheckedChange:x=>{g.forEach(M=>M.toggleSelected(!!x))},disabled:!c||g.length===0,"aria-label":"Select all selectable rows"})})},cell:({row:p})=>{let g=a?.(p.original)??!0;return Ft("div",{className:r("flex justify-center items-center",!g&&"opacity-50"),children:s==="multiple"?Ft(Ct,{checked:p.getIsSelected(),onCheckedChange:l=>g&&p.toggleSelected(!!l),"aria-label":"Select row",disabled:!g}):d?Ft("input",{type:"radio",checked:p.getIsSelected(),onChange:()=>g&&p.toggleSelected(!0),disabled:!g,className:"border-primary rounded-full focus:ring-primary w-4 h-4 text-primary"}):null})},enableSorting:!1,enableHiding:!1,enablePinning:!1,enableHeaderMenu:!1,headerAlign:"center",size:s==="multiple"?40:30};return n&&m.unshift(f),o&&m.unshift({id:"serialNumber",header:"No.",cell:({row:p,table:g})=>{let S=g.getRowModel().rows.findIndex(_=>_.id===p.id),{pageIndex:x,pageSize:M}=g.getState().pagination,A=x*M+S+1;return Ft("div",{className:"font-medium text-muted-foreground text-center",children:A})},enableSorting:!0,enableHiding:!1,enablePinning:!0,size:60,headerAlign:"center"}),[...m,...lo(e,t)]}import{useEffect as Ma,useMemo as za,useRef as Wt}from"react";import{useSearchParams as Fa}from"react-router";var Bn="atsui:tbl:v1:",Ao=new Map,Gn=new Map;function Io(e){try{let t=localStorage.getItem(Bn+e);return t?JSON.parse(t):void 0}catch{return}}function Ln(e,t){try{localStorage.setItem(Bn+e,JSON.stringify(t))}catch{}}function En(e){return e?typeof e=="string"?{key:e}:e:null}function co(e,t){return Ao.get(e)??(t?Io(e):void 0)??{}}function Tt(e,t,o){let n={...co(e,t),...o};Ao.set(e,n),t&&Ln(e,n)}var Fo=new Map;function _n(e,t){let o=Fo.get(e);return o||(o=new Set,Fo.set(e,o)),o.add(t),()=>{o.delete(t)}}function Ut(e,t){return{...t?Io("g:"+e)??{}:{},...Gn.get(e)??{}}}function uo(e,t,o,n){let s=Ut(e,t),d=n==null||n==="";if(d?s[o]===void 0:s[o]===n)return;let c={...s};d?delete c[o]:c[o]=n,Gn.set(e,c),t&&Ln("g:"+e,c),Fo.get(e)?.forEach(a=>a())}function On(e,t){if(Tt(e.key,e.local,{filters:{},globalFilter:"",external:{},groupedField:"all"}),e.group)for(let o of t)uo(e.group,e.local,o,void 0)}function Vn(e){return(Ao.get(e)??Io(e))?.external??{}}var zo=new Set;function Hn(e){return zo.has(e)&&console.warn(`[DataTable] persist key "${e}" is used by two mounted tables \u2014 they will overwrite each other's saved state. Give each table a unique key.`),zo.add(e),()=>{zo.delete(e)}}var At="q",Kt="page",qt="pageSize",Bo=e=>{if(e==null||e instanceof Date)return e;let t=new Date(e);return isNaN(t.getTime())?e:t},Jt=e=>{if(e&&typeof e=="object"&&("from"in e||"to"in e)){let t=Bo(e.from),o=Bo(e.to);return t===e.from&&o===e.to?e:{from:t,to:o}}return Bo(e)},Go=e=>{let t=e instanceof Date?e:new Date(e);return isNaN(t.getTime())?"":t.toISOString().slice(0,10)},Aa=e=>{if(e==null)return;let t=typeof e=="object"&&("from"in e||"to"in e),o=Go(t?e.from:e),n=t?Go(e.to):"";if(!(!o&&!n))return t?`${o},${n}`:o},jn=e=>{if(!e.includes(","))return Jt(e);let[t,o]=e.split(",");return Jt({from:t||void 0,to:o||void 0})},$n=e=>{if(e===null)return;let t=Number(e);return Number.isInteger(t)&&t>0?t:void 0};function Un(e,t,o){let n=En(e),[s,d]=Fa(),c=t.map(b=>({id:String(b.id??b.key),shared:b.shared,persist:b.persist!==!1,external:!!b.externalSearch,isDate:b.type==="date"||b.type==="daterange"})),a=Wt(c);a.current=c;let i=za(()=>{if(!n)return{columnFilters:[],globalFilter:"",pagination:{pageIndex:0,pageSize:o},external:{},groupedField:"all"};let b=co(n.key,n.local),C=n.group?Ut(n.group,n.local):{},F=B=>{let q=s.get(B.id);if(q!==null)return B.isDate?jn(q):q;if(B.shared&&n.group){let _e=C[B.shared];return B.isDate?Jt(_e):_e}let fe=b.filters?.[B.id]??b.external?.[B.id];return B.isDate?Jt(fe):fe},D=[],h={};for(let B of c){if(!B.persist)continue;let q=F(B);q==null||q===""||(B.external?h[B.id]=q:D.push({id:B.id,value:q}))}let k=$n(s.get(Kt)),ne=$n(s.get(qt));return{columnFilters:D,globalFilter:s.get(At)??b.globalFilter??"",pagination:{pageIndex:n.pagination===!1?0:k!==void 0?k-1:b.pagination?.pageIndex??0,pageSize:n.pagination===!1?o:ne??b.pagination?.pageSize??o},external:h,groupedField:b.groupedField??"all"}},[]),m=Wt(i.pagination.pageIndex),f=Wt(i.pagination.pageIndex===0);Ma(()=>{if(n)return!n.group&&a.current.some(b=>b.shared)&&console.warn(`[DataTable] persist key "${n.key}": filters use \`shared\` but the table has no \`persist.group\` \u2014 shared is inert. Add a group to enable it.`),Hn(n.key)},[]);let p=Wt({}),g=Wt(!1),l=b=>{if(Object.keys(b).length===0||(Object.assign(p.current,b),g.current))return;g.current=!0;let C=window.location.pathname;queueMicrotask(()=>{g.current=!1;let F=p.current;p.current={},window.location.pathname===C&&S(F)})},S=b=>{let C=new URLSearchParams(window.location.search),F=!1;for(let[D,h]of Object.entries(b)){let k=C.get(D);h===void 0?k!==null&&(C.delete(D),F=!0):k!==h&&(C.set(D,h),F=!0)}F&&d(C,{replace:!0})},x=(b,C)=>b.isDate?Aa(C):C==null||C===""?void 0:String(C),M=b=>{if(!n)return;let C={};for(let h of b)C[h.id]=h.value;let F={},D={};for(let h of a.current)!h.persist||h.external||(h.shared&&n.group?uo(n.group,n.local,h.shared,C[h.id]):C[h.id]!==void 0&&(F[h.id]=C[h.id]),D[h.id]=x(h,C[h.id]));Tt(n.key,n.local,{filters:F}),l(D)},A=b=>{n&&(Tt(n.key,n.local,{globalFilter:b}),l({[At]:b||void 0}))},_=b=>{if(!n)return;let C={},F={};for(let D of a.current)!D.persist||!D.external||(D.shared&&n.group?uo(n.group,n.local,D.shared,b[D.id]):b[D.id]!==void 0&&(C[D.id]=b[D.id]),F[D.id]=x(D,b[D.id]));Tt(n.key,n.local,{external:C}),l(F)},W=b=>{!n||n.pagination===!1||f.current&&(Tt(n.key,n.local,{pagination:{pageIndex:b.pageIndex,pageSize:b.pageSize}}),l({[Kt]:b.pageIndex>0?String(b.pageIndex+1):void 0,[qt]:b.pageSize!==o?String(b.pageSize):void 0}))},N=(b,C)=>{if(!n||f.current||b.getCoreRowModel().rows.length===0)return;let F=Math.min(m.current,Math.max(b.getPageCount()-1,0));f.current=!0,F>0&&C({pageIndex:F,pageSize:b.getState().pagination.pageSize})},v=()=>!!n&&n.pagination!==!1&&!f.current,z=b=>{n&&Tt(n.key,n.local,{groupedField:b})},O=b=>{if(!n?.group)return;let C=n.group,F=a.current.filter(D=>D.shared&&D.persist&&!D.external);if(F.length!==0)return _n(C,()=>{let D=Ut(C,n.local);for(let h of F){let k=b.getColumn(h.id);if(!k)continue;let ne=D[h.shared],B=ne===void 0?void 0:h.isDate?Jt(ne):ne,q=k.getFilterValue();Object.is(q??void 0,B??void 0)||k.setFilterValue(B)}})},K=b=>{if(!n)return;let C={},F=co(n.key,n.local),D=n.group?Ut(n.group,n.local):{};for(let h of a.current){if(!h.persist||h.id in p.current)continue;let k=s.get(h.id);if(h.external){if(k===null){let q=x(h,h.shared&&n.group?D[h.shared]:F.external?.[h.id]);q!==void 0&&(C[h.id]=q)}continue}let ne=b.getColumn(h.id);if(!ne)continue;let B=x(h,ne.getFilterValue())??null;if(k!==B){if(k===null){B!==null&&(C[h.id]=B);continue}ne.setFilterValue(k===""?void 0:h.isDate?jn(k):k)}}if(!(At in p.current)){let h=s.get(At),k=b.getState().globalFilter??"";h===null?k!==""&&(C[At]=k):h!==k&&b.setGlobalFilter(h)}if(n.pagination!==!1&&f.current){let h=F.pagination;h&&!(Kt in p.current)&&s.get(Kt)===null&&h.pageIndex>0&&(C[Kt]=String(h.pageIndex+1)),h&&!(qt in p.current)&&s.get(qt)===null&&h.pageSize!==o&&(C[qt]=String(h.pageSize))}l(C)},Q=()=>{if(!n)return;On(n,a.current.filter(C=>C.shared).map(C=>C.shared));let b={[At]:void 0};for(let C of a.current)C.persist&&(b[C.id]=void 0);l(b)};return{enabled:!!n,initial:i,searchParamsKey:s.toString(),persistFilters:M,persistGlobalFilter:A,persistExternal:_,persistPagination:W,persistGroupedField:z,restorePageIndex:N,syncSharedSlots:O,applyURLToTable:K,clearAll:Q,pendingPageRestore:v}}import{flexRender as Wn}from"@tanstack/react-table";import{ChevronUp as Kn,ChevronDown as qn,ChevronsUpDown as Jn,EyeOff as Ia,MoreHorizontal as Ba,MoveLeftIcon as Ga,MoveRightIcon as La,PinOffIcon as Ea,Calculator as Xn}from"lucide-react";import{Fragment as Lo,jsx as H,jsxs as de}from"react/jsx-runtime";function Yn({table:e,aggregations:t,enableColumnPinning:o,enableColumnResizing:n,enableColumnVisibility:s,enableRowSelection:d,fixedCheckboxColumn:c,bordered:a,compact:i,onPinColumn:m}){let f=e.getVisibleLeafColumns().filter(g=>!g.getIsPinned()),p=f[f.length-1]?.id;return H(Lo,{children:e.getHeaderGroups().map(g=>H(Fe,{className:"hover:bg-transparent",children:g.headers.map((l,S)=>{let x=l.depth===0&&l.colSpan>1,M=o&&(l.column.getIsPinned()==="left"||l.column.id==="serialNumber"||l.column.id==="select"&&d),A=o&&l.column.getIsPinned()==="right",_=l.column.getCanSort(),W=o&&l.column.columnDef.enablePinning!==!1,N=l.column.id==="serialNumber",v=l.column.id==="select",z=N||v&&c,O=l.column.columnDef.headerAlign||"left",K=t&&t[l.column.id]?.enabled,Q=s&&!z&&l.column.getCanHide(),C=l.column.columnDef.enableHeaderMenu!==!1&&(_||W&&!z||Q),F=l.column.getIsSorted(),D=l.column.columnDef.reserveMenuSpace===!0,h={left:"justify-start",center:"justify-center",right:"justify-end"}[O];return de(nn,{colSpan:l.colSpan,"data-col-id":x?void 0:l.column.id,className:r("group bg-sidebar px-0 font-semibold text-foreground",!i&&"py-2",a&&S<g.headers.length-1&&l.column.id!==p&&"border-r","relative",M&&"sticky left-0 z-25 bg-sidebar/95",A&&"sticky right-0 z-25 bg-sidebar/95",(N||v)&&"sticky left-0 z-25 bg-sidebar/95",x?"text-center":"text-left"),style:{width:Ge(l.getSize(),M||A),minWidth:Ge(l.getSize(),M||A),...Nt(l.column,o)},children:[x?de("div",{className:"flex justify-center items-center",children:[Wn(l.column.columnDef.header,l.getContext()),K&&H(Xn,{className:"ml-1 w-3 h-3 text-primary"})]}):de("div",{className:r("relative flex items-center px-2 w-full",h,_&&"cursor-pointer select-none"),onClick:_?k=>{k.target.closest("button, a, input, select, [role=button], [role=checkbox]")||l.column.getToggleSortingHandler()?.(k)}:void 0,children:[de("div",{className:r("flex items-center gap-1 min-w-0 max-w-full",F&&(O==="right"?"pl-6":"pr-6"),D&&(O==="right"?C?"pl-12":"pl-6":C?"pr-12":"pr-6")),children:[K&&H(Xn,{className:"mr-1 w-3 h-3 text-primary shrink-0"}),l.isPlaceholder?null:H("span",{className:"truncate",children:Wn(l.column.columnDef.header,l.getContext())})]}),(C||_)&&de("div",{className:r("absolute inset-y-0 flex items-center pointer-events-none",O==="right"?"left-0 pr-8 pl-1 flex-row-reverse":"right-0 pl-8 pr-1"),children:[H("div",{className:r("absolute inset-0 from-sidebar from-45% to-transparent",O==="right"?"bg-gradient-to-r":"bg-gradient-to-l","transition-opacity duration-200 ease-out","opacity-0 group-hover:opacity-100 group-has-[[data-state=open]]:opacity-100")}),_&&H("span",{className:"relative shrink-0",children:F?F==="asc"?H(Kn,{className:"w-4 h-4"}):H(qn,{className:"w-4 h-4"}):H(Jn,{className:"w-3.5 h-3.5 opacity-0 group-hover:opacity-40 transition-opacity"})}),C&&de(Ae,{children:[H(Ie,{asChild:!0,children:H(y,{variant:"ghost",size:"icon",tabIndex:-1,"aria-label":"Column options",onClick:k=>k.stopPropagation(),className:r("relative size-6 rounded-sm pointer-events-auto overflow-hidden","bg-sidebar hover:bg-border dark:bg-sidebar dark:hover:bg-accent","w-0 opacity-0 group-hover:w-5 group-hover:opacity-100",O==="right"?"mr-0":"ml-0",_&&(O==="right"?"group-hover:mr-0.5":"group-hover:ml-0.5"),"data-[state=open]:w-5 data-[state=open]:opacity-100",_&&(O==="right"?"data-[state=open]:mr-0.5":"data-[state=open]:ml-0.5"),"transition-all duration-200 ease-out"),children:H(Ba,{className:"w-4 h-4"})})}),de(Be,{align:"end",className:"w-48",onClick:k=>k.stopPropagation(),children:[_&&de(Lo,{children:[H(ue,{children:"Sorting"}),de(Y,{onClick:()=>l.column.toggleSorting(!1),disabled:F==="asc",children:[H(Kn,{className:"mr-2 w-4 h-4"}),"Sort Ascending"]}),de(Y,{onClick:()=>l.column.toggleSorting(!0),disabled:F==="desc",children:[H(qn,{className:"mr-2 w-4 h-4"}),"Sort Descending"]}),de(Y,{onClick:()=>l.column.clearSorting(),disabled:!F,children:[H(Jn,{className:"mr-2 w-4 h-4"}),"Clear Sort"]}),(W&&!z||Q)&&H(he,{})]}),W&&!z&&de(Lo,{children:[H(ue,{children:"Pin Column"}),de(Y,{onClick:()=>m(l.column.id,"left"),disabled:l.column.getIsPinned()==="left",children:[H(Ga,{}),"Pin Left"]}),de(Y,{onClick:()=>m(l.column.id,"right"),disabled:l.column.getIsPinned()==="right",children:[H(La,{}),"Pin Right"]}),de(Y,{onClick:()=>m(l.column.id,!1),disabled:!l.column.getIsPinned(),children:[H(Ea,{}),"Unpin"]}),Q&&H(he,{})]}),Q&&de(Y,{onClick:()=>l.column.toggleVisibility(!1),children:[H(Ia,{className:"mr-2 w-4 h-4"}),"Hide Column"]})]})]})]})]}),H("div",{className:r("absolute bottom-0 inset-x-0 pointer-events-none",K?"h-0.5 bg-primary/40":"h-px bg-border")}),n&&l.column.getCanResize()&&!x&&l.colSpan===1&&H("div",{className:"top-0 right-0 absolute hover:bg-primary opacity-0 hover:opacity-100 bg-border w-1 h-full transition-opacity cursor-col-resize select-none touch-none",onMouseDown:l.getResizeHandler(),onTouchStart:l.getResizeHandler(),onClick:k=>k.stopPropagation()})]},l.id)})},g.id))})}import{jsx as Qe,jsxs as Eo}from"react/jsx-runtime";function Qn({table:e,columnAggregations:t,aggregations:o,enableColumnPinning:n,enableRowSelection:s,showSerialNumbers:d,compact:c}){let a=Object.keys(t).length>0,i=e.getHeaderGroups()[0]?.headers.some(l=>l.column.columnDef.customFooter),m=d&&e.getFilteredRowModel().rows.length>0&&(a||i),f=e.getHeaderGroups()[0]?.headers.length??0,p=e.getVisibleLeafColumns().filter(l=>!l.getIsPinned()),g=p[p.length-1]?.id;return!a&&!i&&!m?null:Qe(oo,{className:"bottom-0 z-20 sticky bg-sidebar border-t-0 shadow-[0_1px_0_0_var(--border)]",children:Qe(Fe,{className:"bg-sidebar hover:bg-transparent",children:e.getHeaderGroups()[0]?.headers.map((l,S)=>{let x=l.column.id,M=t[x],A=n&&(l.column.getIsPinned()==="left"||l.column.id==="serialNumber"||l.column.id==="select"&&s),_=n&&l.column.getIsPinned()==="right",W=l.column.id==="serialNumber",N=l.column.id==="select",z=l.column.columnDef.customFooter;return M||z||W&&m?Eo(je,{className:r("relative px-2 py-2 font-semibold text-sm",S<f-1&&"border-r",c&&"py-1",A&&"sticky left-0 z-30 bg-sidebar",_&&"sticky right-0 z-30 bg-sidebar",(W||N)&&"sticky left-0 z-30 bg-sidebar",z?.className),style:{width:Ge(l.getSize(),A||_),minWidth:Ge(l.getSize(),A||_),...Nt(l.column,n)},children:[Qe("div",{className:"absolute top-0 inset-x-0 h-px bg-border pointer-events-none"}),(()=>{if(z?.content){let K=typeof z.content=="function"?z.content(e):z.content;return Qe("div",{className:r("w-full h-full",z.align==="center"&&"text-center",z.align==="right"&&"text-right",z.align==="left"&&"text-left"),children:K})}return M?Qe("div",{className:"flex flex-col gap-0.5 text-xs",children:Object.entries(M).map(([K,Q])=>Eo("div",{className:"flex justify-between items-center text-muted-foreground",children:[Qe("span",{className:"text-xs capitalize",children:K}),Qe("span",{className:"font-medium text-foreground",children:o?.[x]?.format?.(Q,K)??Fn(K,Q)})]},K))}):W&&m?Eo("div",{className:"text-muted-foreground text-xs text-center",children:["Total ",e.getFilteredRowModel().rows.length]}):null})()]},`agg-${l.id}`):Qe(je,{className:r("relative px-0 py-0",S<f-1&&l.column.id!==g&&"border-r",c&&"py-0",A&&"sticky left-0 z-30 bg-sidebar",_&&"sticky right-0 z-30 bg-sidebar",(W||N)&&"sticky left-0 z-30 bg-sidebar"),style:{width:Ge(l.getSize(),A||_),minWidth:Ge(l.getSize(),A||_),...Nt(l.column,n)},children:Qe("div",{className:"absolute top-0 inset-x-0 h-px bg-border pointer-events-none"})},`agg-${l.id}`)})})})}import{jsx as P,jsxs as St}from"react/jsx-runtime";function er({data:e,columns:t,filters:o=[],pagination:n,settings:s={},header:d,footer:c,className:a="",maxHeight:i="100%",loading:m=!1,error:f,emptyMessage:p="No data available",onRowSelectionChange:g,onExport:l,onRefresh:S,onTableReady:x,children:M,isRowSelectable:A,getRowId:_,defaultSelectedRows:W,onExternalSearch:N,aggregations:v={},onAggregationChange:z,rowClassName:O,persist:K}){let Q=!!n,b=Un(K,o,n?.pageSize||10),C=Ue(b.initial.external),[F,D]=Se([]),[h,k]=Se(b.initial.columnFilters),[ne,B]=Se(b.initial.pagination),[q,fe]=Se(()=>Object.fromEntries(lo(t,o).map(w=>[w.id,!1]))),[_e,Oe]=Se({}),[Pe,ce]=Se(b.initial.globalFilter),[De,we]=Se([]),[tt,ke]=Se(()=>{if(s.enableColumnPinning===!1)return{};let w=[...s.showSerialNumbers!==!1?["serialNumber"]:[],...s.enableRowSelection!==!1?["select"]:[]],U=Dn(t);return{left:[...w,...U.left.filter(Je=>!w.includes(Je))],right:U.right}}),Et=Ue(null),Ve=Ue(null),ot=Ue(null),j=Ue(null),[u,$]=Se(0),[re,Z]=Se(0),[ht,He]=Se(0),nt=Ue(null),[_t,Zt]=Se(!1),{enableSorting:qe=!0,enableFiltering:Ot=!0,enableGlobalFilter:Vt=!0,enableColumnVisibility:Dt=!0,enableRowSelection:T=!0,showToolbar:G=!1,enableHeaderCheckbox:L=!0,toolbarPosition:oe="default",showSerialNumbers:ae=!0,fixedCheckboxColumn:Re=!0,striped:xt=!0,hoverable:vt=!0,compact:eo=!0,bordered:ho=!0,fullHeight:Wo=!1,enableColumnResizing:Ko=!1,enableColumnPinning:Me=!0,showHeader:kr=!0,selectionMode:kt="multiple",showCheckbox:qo=!0,groupedFilterLabel:Rr="Global",showFilterChips:Mr=!0}=s;ve(()=>{o.length>0&&!G&&console.warn("[DataTable] `filters` are provided but settings.showToolbar is off \u2014 filters live in the toolbar, so none will render."),o.some(w=>w.placement==="menu")&&!Vt&&console.warn("[DataTable] placement:'menu' filters are reached through the global search's field picker \u2014 with enableGlobalFilter off they are unreachable (only their chips would show).")},[]),ve(()=>{let w=()=>{nt.current&&Zt(nt.current.scrollTop>0)},U=nt.current;if(U)return U.addEventListener("scroll",w),()=>U.removeEventListener("scroll",w)},[]),ve(()=>{let w=()=>{Ve.current&&$(Ve.current.offsetHeight+16),ot.current&&Z(ot.current.offsetHeight+16),j.current&&He(j.current.offsetHeight+16)};w();let U=new ResizeObserver(()=>{setTimeout(w,50)});return Ve.current&&U.observe(Ve.current),ot.current&&U.observe(ot.current),j.current&&U.observe(j.current),()=>{U.disconnect()}},[G,d,oe]),ve(()=>{b.persistFilters(h)},[h]),ve(()=>{b.persistGlobalFilter(Pe)},[Pe]),ve(()=>{b.persistPagination(ne)},[ne]);let Jo=w=>{C.current=w,b.persistExternal(w),N?.(w)},xo=mo(()=>In({initialColumns:t,filters:o,showSerialNumbers:ae,enableRowSelection:T,selectionMode:kt,showCheckbox:qo,enableHeaderCheckbox:L,isRowSelectable:A}),[t,o,ae,T,A,kt,qo,L]),E=$a({data:e,columns:xo,getRowId:_,onSortingChange:qe?D:void 0,onColumnFiltersChange:Ot?k:void 0,onGlobalFilterChange:Vt?ce:void 0,getCoreRowModel:Oa(),getPaginationRowModel:Q?Ha():void 0,getSortedRowModel:qe?ja():void 0,getFilteredRowModel:Ot?Va():void 0,onColumnVisibilityChange:Dt?fe:void 0,onRowSelectionChange:T?Oe:void 0,onColumnOrderChange:we,onColumnPinningChange:Me?w=>ke(U=>kn(typeof w=="function"?w(U):w,[...ae?["serialNumber"]:[],...T?["select"]:[]])):void 0,state:{sorting:qe?F:void 0,columnFilters:Ot?h:void 0,columnVisibility:Dt?q:void 0,rowSelection:T?_e:{},globalFilter:Pe,pagination:Q?ne:void 0,columnOrder:De,columnPinning:Me?tt:{}},onPaginationChange:Q?B:void 0,initialState:{columnPinning:Me?{left:[...ae?["serialNumber"]:[],...T?["select"]:[]],right:[]}:void 0},enableRowSelection:T?w=>A?.(w.original)??!0:!1,enableSorting:qe,enableColumnResizing:Ko,enableColumnPinning:Me,columnResizeMode:"onChange",autoResetPageIndex:!b.pendingPageRestore()}),vo=mo(()=>zn(E,v),[E,v,e,h,Pe]),zr=mo(()=>Object.keys(vo).length>0||xo.some(w=>w.customFooter),[vo,xo]),Xo=Ue({onRowSelectionChange:g,isRowSelectable:A});Xo.current={onRowSelectionChange:g,isRowSelectable:A};let Yo=Ue(!1);ve(()=>{if(Yo.current||!W||!T)return;let w=E.getCoreRowModel().rows;if(w.length===0)return;let U={};for(let Je of w)Je.getCanSelect()&&W(Je.original)&&(U[Je.id]=!0);Yo.current=!0,Object.keys(U).length>0&&Oe(U)},[W,T,E,e]),ve(()=>{let{onRowSelectionChange:w,isRowSelectable:U}=Xo.current;if(T&&w){let Je=E.getFilteredSelectedRowModel().rows.filter(jt=>U?.(jt.original)??!0).map(jt=>jt.original);w(Je)}},[_e,T,E]);let Fr=_o(w=>{kt==="single"?(E.resetRowSelection(),w.toggleSelected(!0)):w.toggleSelected()},[kt,E]),Qo=Ue(x);Qo.current=x,ve(()=>{Qo.current?.(E)},[E]);let Zo=Ue(!1);ve(()=>{Zo.current||(Zo.current=!0,Object.keys(b.initial.external).length>0&&Jo(b.initial.external))},[]),ve(()=>b.syncSharedSlots(E),[E]),ve(()=>b.applyURLToTable(E),[E,b.searchParamsKey]),ve(()=>{Q&&b.restorePageIndex(E,B)},[e]);let Ar=_o(()=>{D([])},[]),Ir=_o(()=>{k([]),ce(""),b.clearAll()},[]),Br=(w,U)=>{Me&&Rn(E,w,U,{container:nt.current,alwaysPinnedLeft:[...ae?["serialNumber"]:[],...T&&Re?["select"]:[]]})},Gr=w=>w&&typeof w=="object"&&"content"in w,ze=mo(()=>d?Gr(d)?{content:d.content,align:d.align||"left",className:d.className||"",showOnEmpty:d.showOnEmpty!==void 0?d.showOnEmpty:!0}:{content:d,align:"left",className:"",showOnEmpty:!0}:null,[d]);if(f)return P(Xe,{className:"shadow-sm rounded-xl w-full",children:P(Ye,{className:"flex justify-center items-center",children:St("div",{className:"text-center",children:[P("div",{className:"mb-3 text-red-500 text-2xl",children:"\u26A0\uFE0F"}),P("p",{className:"mb-4 text-muted-foreground text-sm",children:f}),S&&St(y,{variant:"outline",size:"sm",onClick:S,className:"rounded-lg",children:[P(Zn,{className:"mr-2 w-4 h-4"}),"Try Again"]})]})})});let yo=()=>G?P(Ro,{table:E,filters:o,globalFilter:Pe,onGlobalFilterChange:w=>ce(w),enableGlobalFilter:Vt,onExport:l,onRefresh:S,loading:m,enableColumnVisibility:Dt,enableColumnPinning:Me,enableSorting:qe,showFilterChips:Mr,onClearSorting:Ar,onClearFilters:Ir,onExternalSearch:Jo,initialExternalValues:C.current,aggregations:v,onAggregationChange:z,groupedFilterLabel:Rr,initialGroupedField:b.initial.groupedField,onGroupedFieldChange:b.persistGroupedField}):null,Lr=()=>{let w=0;return oe==="above-header"&&(w+=u),ze&&(w+=ht),oe==="below-header"&&(w+=re),w},en=E.getVisibleLeafColumns().filter(w=>!w.getIsPinned()),Er=en[en.length-1]?.id,Ht=Math.max(E.getVisibleLeafColumns().length,1);return P(yt,{children:St("div",{className:r("flex flex-col space-y-2 w-full h-full p-1",a),children:[G&&oe==="default"&&P("div",{ref:Et,className:"z-40 relative",children:yo()}),P(Xe,{className:r("shadow-sm overflow-hidden py-0",Wo&&"flex-1 min-h-0"),children:P(Ye,{className:"h-full p-0",children:St("div",{className:"relative flex flex-col justify-between h-full",children:[m&&P("div",{className:"z-50 absolute inset-0 flex justify-center items-center bg-background/80 rounded-xl",children:St("div",{className:"flex items-center gap-3 bg-background/90 shadow-sm px-4 py-3 rounded-lg",children:[P(Zn,{className:"size-5 text-primary animate-spin"}),P("span",{className:"font-medium text-muted-foreground text-sm",children:"Loading..."})]})}),P("div",{ref:nt,className:r("relative overflow-auto rounded-t-xl",Wo?"flex-1 min-h-0":E.getRowModel().rows?.length===0&&"h-full"),style:{maxHeight:i},children:St(No,{className:r("w-full border-separate border-spacing-0 relative",E.getState().columnSizingInfo.isResizingColumn&&"select-none",E.getRowModel().rows?.length===0&&"h-full"),children:[G&&oe==="above-header"&&P("thead",{className:"top-0 z-40 sticky bg-sidebar border-b",children:P(Fe,{className:"hover:bg-transparent",children:P(je,{colSpan:Ht,className:"p-2 bg-sidebar border-b shadow-sm",children:P("div",{ref:Ve,children:yo()})})})}),ze&&(ze.showOnEmpty||E.getRowModel().rows?.length>0)&&P("thead",{className:r("sticky bg-sidebar border-b",_t&&"shadow-sm"),style:{top:oe==="above-header"?`${u}px`:"0px",zIndex:35},children:P(Fe,{className:"hover:bg-transparent",children:P(je,{colSpan:Ht,className:r("bg-sidebar border-b p-2 font-semibold text-foreground",eo?"py-2":"py-4",ze.className),children:P("div",{ref:j,className:r("flex items-center w-full",ze.align==="center"&&"justify-center",ze.align==="right"&&"justify-end",ze.align==="left"&&"justify-start"),children:typeof ze.content=="string"?P("span",{className:"font-bold text-foreground text-lg tracking-tight",children:ze.content}):ze.content})})})}),G&&oe==="below-header"&&P("thead",{className:r("sticky bg-sidebar border-b",_t&&"shadow-sm"),style:{top:ze?`${ht}px`:"0px",zIndex:35},children:P(Fe,{className:"hover:bg-transparent",children:P(je,{colSpan:Ht,className:"bg-sidebar border-b p-2",children:P("div",{ref:ot,children:yo()})})})}),kr&&P(tn,{className:r("sticky bg-sidebar [&_tr]:border-b-0",_t&&"shadow-sm"),style:{top:`${Lr()}px`,zIndex:30},children:P(Yn,{table:E,aggregations:v,enableColumnPinning:Me,enableColumnResizing:Ko,enableColumnVisibility:Dt,enableRowSelection:T,fixedCheckboxColumn:Re,bordered:ho,compact:eo,onPinColumn:Br})}),P(on,{children:E.getRowModel().rows?.length?E.getRowModel().rows.map((w,U)=>{let Je=U===E.getRowModel().rows.length-1,jt=O?O(w):"";return P(Fe,{"data-index":U,"data-state":w.getIsSelected()&&"selected",className:r(vt&&"hover:bg-muted/50",xt&&U%2===0&&"bg-muted/20",w.getIsSelected()&&"bg-muted",kt==="single"&&"cursor-pointer",jt),onClick:()=>{kt==="single"&&Fr(w)},children:w.getVisibleCells().map((Ce,_r)=>{let wo=Me&&(Ce.column.getIsPinned()==="left"||Ce.column.id==="serialNumber"||Ce.column.id==="select"&&T),Co=Me&&Ce.column.getIsPinned()==="right",Or=Ce.column.id==="serialNumber";return P(je,{className:r(eo?"py-2":"py-4",ho&&_r<w.getVisibleCells().length-1&&Ce.column.id!==Er&&"border-r",(!Je||!zr)&&"border-b",wo&&"sticky left-0 z-20 bg-sidebar/95",Or&&"sticky left-0 z-20 bg-card/95",Co&&"sticky right-0 z-20 bg-sidebar/95","p-1"),style:{width:Ge(Ce.column.getSize(),wo||Co),minWidth:Ge(Ce.column.getSize(),wo||Co),...Nt(Ce.column,Me)},children:_a(Ce.column.columnDef.cell,Ce.getContext())},Ce.id)})},w.id)}):P(Fe,{children:P(je,{colSpan:Ht,className:"border-0 h-32 text-center",children:St("div",{className:"flex flex-col items-center gap-3",children:[P("div",{className:"text-muted-foreground text-6xl",children:"\u{1F4CB}"}),P("p",{className:"font-medium text-muted-foreground",children:p})]})})})}),P(Qn,{table:E,columnAggregations:vo,aggregations:v,enableColumnPinning:Me,enableRowSelection:T,showSerialNumbers:ae,bordered:ho,compact:eo})]})}),c&&P("div",{className:"bottom-0 z-10 sticky bg-sidebar w-full",style:{width:"100%",minWidth:"fit-content"},children:P(No,{children:P(oo,{children:P(Fe,{className:"bg-sidebar",children:P(je,{colSpan:Ht,className:"p-2",children:c})})})})})]})})}),P(Mo,{table:E,config:n}),M&&M(E)]})})}import{Separator as Ua}from"radix-ui";import{jsx as Wa}from"react/jsx-runtime";function po({className:e,orientation:t="horizontal",decorative:o=!0,...n}){return Wa(Ua.Root,{"data-slot":"separator-root",decorative:o,orientation:t,className:r("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...n})}import{Loader as Ka,X as qa}from"lucide-react";import{AnimatePresence as Ja,motion as Xa}from"framer-motion";import*as gt from"react";import*as tr from"react-dom";import{jsx as pe,jsxs as Xt}from"react/jsx-runtime";function or({table:e,visible:t,container:o,children:n,className:s,...d}){let[c,a]=gt.useState(!1);gt.useLayoutEffect(()=>{a(!0)},[]),gt.useEffect(()=>{function f(p){p.key==="Escape"&&e&&e.toggleAllRowsSelected(!1)}return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[e]);let i=o??(c?globalThis.document?.body:null);if(!i||!e)return null;let m=t??e.getFilteredSelectedRowModel().rows.length>0;return tr.createPortal(pe(Ja,{children:m&&pe(Xa.div,{role:"toolbar","aria-orientation":"horizontal",initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:20},transition:{duration:.3,ease:"easeInOut"},className:r("fixed inset-x-0 bottom-6 z-50 mx-auto flex w-fit flex-wrap items-center justify-center gap-2 rounded-xl border bg-primary/10 backdrop-blur-sm p-3 text-foreground ring-5 ring-primary/5",s),...d,children:pe(yt,{children:n})})}),i)}function nr({size:e="sm",tooltip:t,isPending:o,disabled:n,className:s,children:d,...c}){let a=pe(y,{variant:"secondary",size:e,className:r("gap-1.5 rounded-lg border border-secondary bg-secondary/50 hover:bg-secondary/70 transition-all duration-200",e==="icon"?"size-8":"h-8 px-3",s),disabled:n||o,...c,children:o?pe(Ka,{className:"animate-spin"}):d});return t?Xt(at,{children:[pe(it,{asChild:!0,children:a}),pe(st,{sideOffset:8,className:"rounded-lg border font-semibold text-foreground bg-secondary [&>span]:hidden",children:pe("p",{children:t})})]}):a}function rr({table:e}){let t=gt.useCallback(()=>{e&&e.toggleAllRowsSelected(!1)},[e]);return e?Xt("div",{className:"flex h-8 items-center rounded-lg border bg-muted/50 pr-1 pl-3",children:[Xt("span",{className:"whitespace-nowrap text-sm font-medium",children:[e.getFilteredSelectedRowModel().rows.length," selected"]}),pe(po,{orientation:"vertical",className:"mr-2 ml-3 data-[orientation=vertical]:h-4"}),Xt(at,{children:[pe(it,{asChild:!0,children:pe(y,{variant:"ghost",size:"icon",className:"size-6 rounded-md",onClick:t,children:pe(qa,{className:"size-3.5"})})}),Xt(st,{sideOffset:10,className:"flex items-center gap-2 rounded-lg border px-3 py-2 font-semibold text-foregroun bg-secondary [&>span]:hidden",children:[pe("p",{children:"Clear selection"}),pe("kbd",{className:"select-none rounded border bg-primary/50 px-2 py-1 font-mono font-normal text-[0.7rem] text-foreground shadow-sm",children:pe("abbr",{title:"Escape",className:"no-underline",children:"Esc"})})]})]})]}):null}import{useSearchParams as Ya}from"react-router";function ar(e,t){let[o,n]=Ya();return[o.get(t)||void 0,c=>{let a=new URLSearchParams(window.location.search);a.set(t,c??""),n(a,{replace:!0})}]}import{useState as ft,useEffect as sr,useMemo as Vo,useCallback as It,useRef as di}from"react";import{Loader2 as lr}from"lucide-react";import{Search as Qa,Download as Za,RefreshCw as ei,Filter as ti,ChevronDown as oi,Settings2 as ni}from"lucide-react";import{Fragment as ri,jsx as I,jsxs as ie}from"react/jsx-runtime";function Oo({fields:e,filters:t,globalFilter:o,onGlobalFilterChange:n,fieldFilters:s,onFieldFilterChange:d,sortField:c,sortDirection:a,onSortChange:i,selectedCount:m,totalCount:f,visibleCount:p,onExport:g,onRefresh:l,loading:S,onClearFilters:x,onClearSorting:M}){let A=e.filter(N=>N.sortable),_=Object.values(s).some(N=>N!=null&&N!=="")||o!=="",W=c!=="";return I("div",{className:"rounded-xl p-0.5",children:I("div",{className:"px-2",children:I("div",{className:"flex flex-col gap-6",children:ie("div",{className:"flex items-center justify-between",children:[I("div",{className:"flex items-center gap-3",children:t.length>0&&ie("div",{className:"flex items-center gap-3 flex-wrap",children:[I("div",{className:"flex items-center gap-2 text-sm font-medium text-muted-foreground",children:I(ti,{className:"h-4 w-4"})}),t.map(N=>I("div",{className:"relative min-w-[150px]",children:N.type==="select"?ie(dt,{value:s[N.key]||"all",onValueChange:v=>d(N.key,v),children:[N.icon&&I(N.icon,{className:"size-4 absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),I(ut,{className:r("h-9 rounded-lg w-full",N.icon&&"pl-9"),children:I(ct,{placeholder:N.placeholder||"Select..."})}),ie(mt,{className:"rounded-lg",children:[I($e,{value:"all",children:"All"}),N.options?.map(v=>I($e,{value:v.value,children:v.label},v.value))]})]}):ie("div",{className:"relative",children:[N.icon&&I(N.icon,{className:"size-4 absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),I(zt,{type:N.type,placeholder:N.placeholder,value:s[N.key]||"",onChange:v=>d(N.key,v.target.value),className:r("h-9 rounded-lg",N.icon&&"pl-9")})]})},String(N.key)))]})}),ie("div",{className:"flex items-center gap-2",children:[ie("div",{className:"relative",children:[I(Qa,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),I(zt,{placeholder:"Global search...",value:o,onChange:N=>n(N.target.value),className:"pl-9 h-9 rounded-lg max-w-max"})]}),A.length>0&&ie(Ae,{children:[I(Ie,{asChild:!0,children:ie(y,{variant:"outline",size:"sm",className:"rounded-lg gap-1",children:[I("span",{children:"Sort"}),I(oi,{className:"h-4 w-4 opacity-50"})]})}),ie(Be,{align:"end",className:"w-[200px] rounded-lg",children:[I(ue,{children:"Sort By"}),I(he,{}),A.map(N=>ie("div",{children:[ie(Y,{onClick:()=>i(N.key,"asc"),children:[N.label," (A-Z)"]}),ie(Y,{onClick:()=>i(N.key,"desc"),children:[N.label," (Z-A)"]})]},String(N.key))),W&&ie(ri,{children:[I(he,{}),I(Y,{onClick:M,children:"Clear All Sorting"})]})]})]}),ie(Ae,{children:[I(Ie,{asChild:!0,children:I(y,{variant:"outline",size:"sm",className:"rounded-lg",children:I(ni,{className:"h-4 w-4"})})}),ie(Be,{align:"end",className:"w-[200px] rounded-lg",children:[I(ue,{children:"Table Settings"}),I(he,{}),I(Y,{onClick:M,children:"Clear All Sorting"}),I(Y,{onClick:x,children:"Clear All Filters"})]})]}),g&&ie(y,{variant:"outline",size:"sm",onClick:g,className:"rounded-lg",children:[I(Za,{className:"mr-2 h-4 w-4"}),"Export"]}),l&&I(y,{variant:"outline",size:"sm",onClick:l,disabled:S,className:"rounded-lg",children:I(ei,{className:r("h-4 w-4",S&&"animate-spin")})})]})]})})})})}import{ChevronLeft as ai,ChevronRight as ii,ChevronsLeft as si,ChevronsRight as li}from"lucide-react";import{jsx as ee,jsxs as Le}from"react/jsx-runtime";function ir({currentPage:e,totalPages:t,pageSize:o,totalItems:n,onPageChange:s,onPageSizeChange:d,config:c}){if(!c)return null;let a=c.pageSizeOptions||[10,20,50,100],i=(e-1)*o+1,m=Math.min(e*o,n),f=e>1,p=e<t,g=()=>{let S=[],x=[];for(let M=Math.max(2,e-2);M<=Math.min(t-1,e+2);M++)S.push(M);return e-2>2?x.push(1,"..."):x.push(1),x.push(...S),e+2<t-1?x.push("...",t):t>1&&x.push(t),x};return ee("div",{className:"rounded-xl",children:Le("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4",children:[ee("div",{className:"flex items-center gap-6 text-sm text-muted-foreground",children:c.showInfo!==!1&&Le("span",{children:["Showing ",i," to ",m," of ",n," entries"]})}),Le("div",{className:"flex flex-col sm:flex-row items-center gap-4",children:[a&&Le("div",{className:"flex items-center gap-2",children:[ee("span",{className:"text-sm font-medium whitespace-nowrap",children:"Page size:"}),Le(dt,{value:`${o}`,onValueChange:l=>d(Number(l)),children:[ee(ut,{className:"h-9 w-[70px] rounded-lg",children:ee(ct,{})}),ee(mt,{side:"top",className:"rounded-lg",children:a.map(l=>ee($e,{value:`${l}`,children:l},l))})]})]}),Le("div",{className:"flex items-center gap-2",children:[Le(y,{variant:"outline",size:"sm",onClick:()=>s(1),disabled:!f,className:"hidden sm:flex rounded-lg",children:[ee(si,{className:"h-4 w-4"}),ee("span",{className:"sr-only",children:"Go to first page"})]}),Le(y,{variant:"outline",size:"sm",onClick:()=>s(e-1),disabled:!f,className:"rounded-lg",children:[ee(ai,{className:"h-4 w-4 sm:mr-2"}),ee("span",{className:"hidden sm:inline",children:"Previous"}),ee("span",{className:"sr-only sm:hidden",children:"Go to previous page"})]}),c.showPageNumbers&&t>1&&ee("div",{className:"hidden sm:flex items-center gap-1",children:g().map((l,S)=>{if(l==="...")return ee("span",{className:"px-2 py-1 text-sm text-muted-foreground",children:"..."},`dots-${S}`);let x=l;return ee(y,{variant:x===e?"default":"outline",size:"sm",className:"w-9 h-9 p-0 rounded-lg",onClick:()=>s(x),children:x},x)})}),Le("div",{className:"sm:hidden flex items-center gap-2 px-3 py-1 text-sm font-medium bg-muted rounded-lg",children:[e," of ",t]}),Le(y,{variant:"outline",size:"sm",onClick:()=>s(e+1),disabled:!p,className:"rounded-lg",children:[ee("span",{className:"hidden sm:inline",children:"Next"}),ee(ii,{className:"h-4 w-4 sm:ml-2"}),ee("span",{className:"sr-only sm:hidden",children:"Go to next page"})]}),Le(y,{variant:"outline",size:"sm",onClick:()=>s(t),disabled:!p,className:"hidden sm:flex rounded-lg",children:[ee(li,{className:"h-4 w-4"}),ee("span",{className:"sr-only",children:"Go to last page"})]})]})]})]})})}import{jsx as X,jsxs as Pt}from"react/jsx-runtime";function dr({data:e,template:t,fields:o=[],filters:n=[],pagination:s,settings:d={},header:c,footer:a,className:i="",loading:m=!1,error:f,emptyMessage:p="No items found",emptyIcon:g,onSelectionChange:l,onExport:S,onRefresh:x,onTemplateReady:M,children:A}){let{enableSorting:_=!0,enableFiltering:W=!0,enableGlobalSearch:N=!0,enableSelection:v=!1,enableExport:z=!1,showToolbar:O=!0,selectionMode:K="multiple",gridCols:Q={default:3,sm:1,md:2,lg:3,xl:4,"2xl":6},gap:b=4,aspectRatio:C="auto",minCardWidth:F=350,maxCardWidth:D=350}=d,h=!!s,[k,ne]=ft(""),[B,q]=ft({}),[fe,_e]=ft(""),[Oe,Pe]=ft("asc"),[ce,De]=ft(new Set),[we,tt]=ft(1),[ke,Et]=ft(s?.pageSize||12),[Ve,ot]=ft(Q.default),j=Vo(()=>{let T=[...e];if(N&&k){let G=o.filter(L=>L.searchable!==!1);T=T.filter(L=>G.some(oe=>L[oe.key]?.toString().toLowerCase().includes(k.toLowerCase())))}if(W&&Object.keys(B).forEach(G=>{let L=B[G];if(L!=null&&L!==""){let oe=o.find(ae=>ae.key===G);oe&&(T=T.filter(ae=>{let Re=ae[G];return oe.type==="boolean"?Re===(L==="true"):oe.type==="number"?Re===Number(L):Re?.toString().toLowerCase().includes(String(L).toLowerCase())}))}}),_&&fe){let G=o.find(L=>L.key===fe);G&&T.sort((L,oe)=>{let ae=L[fe],Re=oe[fe];if(G.type==="number")return Oe==="asc"?Number(ae)-Number(Re):Number(Re)-Number(ae);if(G.type==="date"){let xt=new Date(ae),vt=new Date(Re);return Oe==="asc"?xt.getTime()-vt.getTime():vt.getTime()-xt.getTime()}else{let xt=String(ae).toLowerCase(),vt=String(Re).toLowerCase();return Oe==="asc"?xt.localeCompare(vt):vt.localeCompare(xt)}})}return T},[e,k,B,fe,Oe,o,N,W,_]),u=Vo(()=>{if(!h)return j;let T=(we-1)*ke,G=T+ke;return j.slice(T,G)},[j,we,ke,h]),$=Math.ceil(j.length/ke),re=It(T=>{v&&De(G=>{let L=new Set(G);return K==="single"?(L.clear(),L.add(T)):L.has(T)?L.delete(T):L.add(T),L})},[v,K]),Z=It(()=>{!v||K==="single"||(ce.size===j.length?De(new Set):De(new Set(j.map((T,G)=>G))))},[v,K,ce.size,j.length]),ht=It((T,G)=>{q(L=>({...L,[T]:G})),tt(1)},[]),He=It((T,G)=>{_e(T),Pe(G)},[]),nt=It(()=>{ne(""),q({}),tt(1)},[]),_t=It(()=>{_e(""),Pe("asc")},[]),Zt=Vo(()=>({getSelectedItems:()=>Array.from(ce).map(T=>j[T]),clearSelection:()=>De(new Set),selectAll:Z,getFilteredData:()=>j,getTotalCount:()=>e.length,getVisibleCount:()=>j.length,refresh:()=>x?.(),exportData:()=>S?.(j)}),[ce,j,e.length,Z,x,S]),qe=di(null);qe.current=Zt,sr(()=>{M&&qe.current&&M(qe.current)},[]),sr(()=>{if(v&&l){let T=Array.from(ce).map(G=>j[G]);l(T)}},[ce]);let Ot=r("w-full","overflow-hidden",i),Vt=r("grid",`gap-${b}`,"w-full","mx-auto","items-start"),Dt={gridTemplateColumns:Ve===0?"repeat(auto-fill, 1fr)":`repeat(auto-fill, minmax(clamp(${F}px, calc(100%/${Ve} - ${b*4}px), ${D}px), 1fr))`,justifyItems:"center",alignItems:"stretch",gridAutoRows:"1fr",gridAutoFlow:"dense"};return f?X(Xe,{className:"w-full",children:X(Ye,{className:"flex items-center justify-center py-12",children:Pt("div",{className:"text-center",children:[X("div",{className:"text-red-500 mb-3 text-2xl",children:"\u26A0\uFE0F"}),X("p",{className:"text-sm text-muted-foreground mb-4",children:f}),x&&Pt(y,{variant:"outline",size:"sm",onClick:x,children:[X(lr,{className:"mr-2 h-4 w-4"}),"Try Again"]})]})})}):Pt("div",{className:r("w-full flex gap-2 flex-col h-full",Ot),children:[c&&X(Xe,{className:"shadow-sm border-0 py-0 text-xl font-bold",children:X(Ye,{className:"p-2",children:c})}),O&&X(Oo,{fields:o,filters:n,globalFilter:k,onGlobalFilterChange:ne,fieldFilters:B,onFieldFilterChange:ht,sortField:fe,sortDirection:Oe,onSortChange:He,selectedCount:ce.size,totalCount:e.length,visibleCount:j.length,onExport:z?()=>S?.(j):void 0,onRefresh:x,loading:m,onClearFilters:nt,onClearSorting:_t}),X(Xe,{className:"border-0 overflow-auto shadow-none py-0 p-2 flex-1",children:X(Ye,{className:"px-0",children:Pt("div",{className:"relative",children:[m&&X("div",{className:"absolute inset-0 bg-background/80 backdrop-blur-sm z-50 flex items-center justify-center rounded-lg",children:Pt("div",{className:"flex items-center gap-3 bg-background/90 px-4 py-3 rounded-lg shadow-sm",children:[X(lr,{className:"size-5 animate-spin text-primary"}),X("span",{className:"text-sm font-medium text-muted-foreground",children:"Loading..."})]})}),u.length>0?X("div",{className:r(Vt),style:Dt,children:u.map((T,G)=>{let L=h?(we-1)*ke+G:G,oe=ce.has(L);return Pt("div",{className:r("relative h-full w-full flex flex-col","transition-all duration-200 overflow-hidden","rounded-2xl","border border-border/20 hover:border-border/50",C==="square"?"aspect-square":"",C==="video"?"aspect-video":"",v?"cursor-pointer":"",oe?"ring-2 ring-primary":""),onClick:()=>v&&re(L),children:[v&&K==="multiple"&&X("div",{className:"absolute top-2 right-2 z-10",children:X(Ct,{checked:oe,onCheckedChange:()=>re(L),className:"bg-background/80 backdrop-blur-sm",onClick:ae=>ae.stopPropagation()})}),t(T,G,oe,()=>re(L))]},L)})}):Pt("div",{className:"flex flex-col gap-4 items-center justify-center py-12 text-center",children:[X("div",{className:"text-6xl",children:g||"\u{1F4CB}"}),X("p",{className:"text-lg font-medium text-muted-foreground mb-2",children:p}),(k||Object.values(B).some(T=>T))&&X(y,{variant:"outline",onClick:nt,children:"Clear Filters"})]})]})})}),h&&X("div",{className:"pb-1",children:X(ir,{currentPage:we,totalPages:$,pageSize:ke,totalItems:j.length,onPageChange:tt,onPageSizeChange:T=>{Et(T),tt(1)},config:s})}),a&&X("div",{className:"p-2 m-0.5",children:a}),A&&A(Zt)]})}import{Loader as ci,X as ui}from"lucide-react";import{AnimatePresence as mi,motion as pi}from"framer-motion";import*as bt from"react";import*as cr from"react-dom";import{jsx as ge,jsxs as Yt}from"react/jsx-runtime";function ur({controller:e,visible:t,container:o,children:n,className:s,...d}){let[c,a]=bt.useState(!1);bt.useLayoutEffect(()=>{a(!0)},[]),bt.useEffect(()=>{function p(g){g.key==="Escape"&&e&&e.clearSelection()}return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[e]);let i=o??(c?globalThis.document?.body:null);if(!i||!e)return null;let m=e.getSelectedItems(),f=t??m.length>0;return cr.createPortal(ge(mi,{children:f&&ge(pi.div,{role:"toolbar","aria-orientation":"horizontal",initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:20},transition:{duration:.3,ease:"easeInOut"},className:r("fixed inset-x-0 bottom-6 z-50 mx-auto flex w-fit flex-wrap items-center justify-center gap-2 rounded-xl border bg-primary/10 backdrop-blur-sm p-3 text-foreground ring-8 ring-primary/5",s),...d,children:ge(yt,{children:n})})}),i)}function mr({size:e="sm",variant:t="secondary",tooltip:o,isPending:n,disabled:s,className:d,children:c,onClick:a,...i}){let m=ge(y,{variant:t,size:e,className:r("gap-1.5 rounded-lg border border-secondary bg-secondary/50 hover:bg-secondary/70 transition-all duration-200",e==="icon"?"size-8":"h-8 px-3",d),disabled:s||n,onClick:a,...i,children:n?ge(ci,{className:"animate-spin"}):c});return o?Yt(at,{children:[ge(it,{asChild:!0,children:m}),ge(st,{sideOffset:8,className:"rounded-lg border font-semibold text-foreground bg-secondary [&>span]:hidden",children:ge("p",{children:o})})]}):m}function pr({controller:e}){let t=bt.useCallback(()=>{e&&e.clearSelection()},[e]);if(!e)return null;let o=e.getSelectedItems();return Yt("div",{className:"flex h-8 items-center rounded-lg border bg-muted/50 pr-1 pl-3",children:[Yt("span",{className:"whitespace-nowrap text-sm font-medium",children:[o.length," selected"]}),ge(po,{orientation:"vertical",className:"mr-2 ml-3 data-[orientation=vertical]:h-4"}),Yt(at,{children:[ge(it,{asChild:!0,children:ge(y,{variant:"ghost",size:"icon",className:"size-6 rounded-md",onClick:t,children:ge(ui,{className:"size-3.5"})})}),Yt(st,{sideOffset:10,className:"flex items-center gap-2 rounded-lg border px-3 py-2 font-semibold text-foreground bg-secondary [&>span]:hidden",children:[ge("p",{children:"Clear selection"}),ge("kbd",{className:"select-none rounded border bg-primary/50 px-2 py-1 font-mono font-normal text-[0.7rem] text-foreground shadow-sm",children:ge("abbr",{title:"Escape",className:"no-underline",children:"Esc"})})]})]})]})}import{jsx as fi}from"react/jsx-runtime";var gi=({children:e,className:t})=>fi("div",{className:r("flex flex-col h-full gap-2",t),children:e});import{ArrowLeftIcon as gr}from"lucide-react";import{NavLink as bi}from"react-router";import{jsx as We,jsxs as Qt}from"react/jsx-runtime";var hi=({className:e,title:t,description:o,backAction:n,metadata:s,children:d,childrenClassName:c})=>{let a=()=>{if(!n)return null;let m={variant:"secondary",size:"icon",className:"hover:bg-primary/20 inline-flex"};return n.href?We(bi,{to:n.href,children:We(y,{...m,children:We(gr,{className:"size-6"})})}):We(y,{...m,onClick:n.onClick,children:We(gr,{className:"size-6"})})},i=()=>!s||s.length===0?null:We("div",{className:"flex gap-4",children:s.map((m,f)=>m.value&&Qt("div",{className:"text-sm",children:[Qt("span",{className:"text-muted-foreground",children:[m.label," "]}),We("span",{children:m.value})]},f))});return Qt("div",{className:r("flex items-center w-full gap-4 p-2",e),children:[Qt("div",{className:"flex gap-2 items-center h-full shrink-0",children:[a(),Qt("div",{className:"flex flex-col gap-2 w-max",children:[We("h1",{className:"text-2xl font-bold tracking-tight",children:t}),o&&We("p",{className:"text-muted-foreground",children:o}),i()]})]}),d!=null&&We("div",{className:r("flex flex-1 items-center justify-end gap-4 h-full",c),children:d})]})};import fo from"react";import{jsx as Ke,jsxs as go}from"react/jsx-runtime";var fr="(min-width: 1024px)",xi=()=>{let[e,t]=fo.useState(()=>typeof window>"u"||window.matchMedia(fr).matches);return fo.useEffect(()=>{let o=window.matchMedia(fr),n=()=>t(o.matches);return o.addEventListener("change",n),()=>o.removeEventListener("change",n)},[]),e},br=e=>null,hr=e=>null,xr=e=>null,vi=({children:e,className:t,contentClassName:o})=>{let n=xi(),s,d,c,a,i,m=fo.Children.toArray(e).filter(g=>{if(fo.isValidElement(g)){if(g.type===br){let l=g.props;return s=l.children,d=l.className,!1}if(g.type===hr){let l=g.props;return c=l.children,a=l.className,!1}if(g.type===xr)return i=g.props,!1}return!0}),f=Ke("div",{className:r("flex-1 overflow-auto h-full no-scrollbar p-2",o),children:m}),p=g=>{let{side:l="right"}=g,S=(g.overlay??!0)||!n,x=r("w-1/3 max-w-full",g.className),M=r("h-full bg-background",l==="right"?"border-l":"border-r"),A=Ke("div",{className:r("h-full p-2",o),children:m});return S?go("div",{tabIndex:-1,className:"flex relative flex-1 overflow-hidden",children:[Ke("div",{className:"h-full overflow-auto w-full transition-all duration-500 relative z-10",children:A}),go("div",{tabIndex:-1,inert:!g.open,className:r("absolute inset-0 z-20",!g.open&&"pointer-events-none"),children:[Ke("div",{className:r("absolute inset-0 bg-black/50 transition-opacity duration-500",g.open?"opacity-100":"opacity-0 pointer-events-none"),onClick:()=>g.onOpenChange(!1)}),Ke("div",{tabIndex:-1,className:r("absolute inset-y-0 z-50 h-full overflow-y-auto backdrop-blur-2xl","transition-all duration-500 ease-in-out",l==="right"?"right-0":"left-0",g.open?"translate-x-0 opacity-100":r(l==="right"?"translate-x-full":"-translate-x-full","opacity-0 pointer-events-none"),M,x),children:g.children})]})]}):go("div",{className:"flex relative flex-1 overflow-hidden",children:[l==="left"&&Ke("div",{className:r("shrink-0 overflow-y-auto transition-all duration-500 ease-in-out",M,g.open?x:"w-0 border-0"),children:g.children}),Ke("div",{className:r("h-full flex-1 min-w-0 overflow-auto transition-all duration-500",g.open&&"overflow-y-auto overflow-x-hidden"),children:A}),l==="right"&&Ke("div",{className:r("shrink-0 overflow-y-auto transition-all duration-500 ease-in-out",M,g.open?x:"w-0 border-0"),children:g.children})]})};return go("div",{className:r("flex flex-auto flex-col min-h-0 overflow-hidden rounded-2xl relative bg-background p-2",t),children:[s&&Ke("div",{className:r("border-b p-2",d),children:s}),i?p(i):f,c&&Ke("div",{className:r("border-t p-2",a),children:c})]})};import{jsx as wi}from"react/jsx-runtime";var yi=({className:e,children:t})=>t==null?null:wi("div",{className:r("flex items-center w-full gap-4 p-2 [&>*:last-child]:ml-auto",e),children:t});import{useState as vr}from"react";import{Copy as Ci,Check as Ni,Loader2Icon as Ti}from"lucide-react";import{jsx as Ze,jsxs as yr}from"react/jsx-runtime";var Ho=class{static currencyFormatter=new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR",maximumFractionDigits:2});static compactFormatter=new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR",notation:"compact",maximumFractionDigits:1});static MONTH_NAMES_SHORT=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];static async copyToClipboard(t){if(t)try{await navigator.clipboard.writeText(t)}catch(o){throw console.error("Failed to copy text:",o),o}}static CopyToClipboard=({text:t,children:o,className:n,size:s="icon",variant:d="ghost"})=>{let[c,a]=vr(!1),[i,m]=vr(!1),f=async()=>{if(!(!t||i)){m(!0);try{await this.copyToClipboard(t),a(!0),setTimeout(()=>a(!1),2e3)}catch(p){console.error("Failed to copy text:",p)}finally{m(!1)}}};return yr(at,{children:[Ze(it,{asChild:!0,children:Ze(y,{variant:d,size:s,className:r(s==="icon"&&"size-6",n),onClick:f,disabled:i||!t,children:i?Ze(Ti,{className:"animate-spin"}):c?Ze(Ni,{className:"h-3 w-3"}):o||Ze(Ci,{className:"h-3 w-3"})})}),Ze(st,{children:c?"Copied!":i?"Copying...":"Copy to clipboard"})]})};static formatINR(t,o={}){let{prefix:n="",suffix:s="",withSymbol:d=!0,compact:c=!1}=o;if(typeof t!="number"||isNaN(t))return`${n}${d?"\u20B9 ":""}0.00${s}`;let a=t<0,i=Math.abs(t),f=(c&&i>=1e5?this.compactFormatter:this.currencyFormatter).format(i).replace("\u20B9","");return`${n}${a?"- ":""}${d?"\u20B9 ":""}${f}${s}`}static formatDate(t,o={}){let{format:n="dd-mm-yyyy",separator:s="-"}=o,d=new Date(t);if(isNaN(d.getTime()))return"";let c=String(d.getDate()).padStart(2,"0"),a=String(d.getMonth()+1).padStart(2,"0"),i=this.MONTH_NAMES_SHORT[d.getMonth()],m=d.getFullYear();switch(n){case"dd-mmm-yyyy":return`${c}${s}${i}${s}${m}`;case"iso":return d.toISOString().split("T")[0];case"long":return d.toLocaleDateString("en-IN",{year:"numeric",month:"long",day:"numeric"});case"short":return d.toLocaleDateString("en-IN");default:return`${c}${s}${a}${s}${m}`}}static toProperCase(t){return t?t.toLowerCase().split(" ").map(o=>o.charAt(0).toUpperCase()+o.slice(1)).join(" "):""}static toProperCaseAdvanced(t){return t?t.toLowerCase().split(/(\s+|['-])/).map((o,n,s)=>["-","'"," "].includes(o)||n>0&&["-","'"].includes(s[n-1])?o:o.charAt(0).toUpperCase()+o.slice(1)).join(""):""}static StatusBadge=({status:t,className:o,showDot:n=!0,capitalize:s=!0,size:d="md",variant:c="outline",customColors:a,icon:i,trueMessage:m="active",falseMessage:f="inactive"})=>{let p=typeof t=="boolean"?t?m:f:typeof t=="number"?t>0?m:f:t.toLowerCase(),g={active:{label:"active",solid:{bg:"bg-emerald-500",text:"text-white",border:"border-emerald-600",dot:"bg-white"},outline:{bg:"bg-emerald-50",text:"text-emerald-700",border:"border-emerald-100",dot:"bg-emerald-500"},subtle:{bg:"bg-emerald-50",text:"text-emerald-700",border:"border-transparent",dot:"bg-emerald-500"}},pending:{label:"pending",solid:{bg:"bg-amber-500",text:"text-white",border:"border-amber-600",dot:"bg-white"},outline:{bg:"bg-amber-50",text:"text-amber-700",border:"border-amber-100",dot:"bg-amber-500"},subtle:{bg:"bg-amber-50",text:"text-amber-700",border:"border-transparent",dot:"bg-amber-500"}},inactive:{label:"inactive",solid:{bg:"bg-rose-500",text:"text-white",border:"border-rose-600",dot:"bg-white"},outline:{bg:"bg-rose-50",text:"text-rose-700",border:"border-rose-100",dot:"bg-rose-500"},subtle:{bg:"bg-rose-50",text:"text-rose-700",border:"border-transparent",dot:"bg-rose-500"}},draft:{label:"draft",solid:{bg:"bg-gray-500",text:"text-white",border:"border-gray-600",dot:"bg-white"},outline:{bg:"bg-gray-50",text:"text-gray-700",border:"border-gray-100",dot:"bg-gray-500"},subtle:{bg:"bg-gray-50",text:"text-gray-700",border:"border-transparent",dot:"bg-gray-500"}},completed:{label:"completed",solid:{bg:"bg-indigo-500",text:"text-white",border:"border-indigo-600",dot:"bg-white"},outline:{bg:"bg-indigo-50",text:"text-indigo-700",border:"border-indigo-100",dot:"bg-indigo-500"},subtle:{bg:"bg-indigo-50",text:"text-indigo-700",border:"border-transparent",dot:"bg-indigo-500"}}},l=g[p.toLowerCase()]||g.inactive,S=a||l[c],x={sm:"text-xs px-2 py-0.5",md:"text-xs px-2.5 py-0.5",lg:"text-sm px-3 py-1"},M=s?p.charAt(0).toUpperCase()+p.slice(1):p;return Ze("div",{className:"flex justify-center",children:yr("span",{className:r("inline-flex items-center gap-1.5 rounded-full border font-medium",S.bg,S.text,S.border,x[d],o),children:[n&&(i?Ze("span",{className:"flex items-center",children:i}):Ze("span",{className:r("size-2 rounded-full",S.dot),"aria-hidden":"true"})),M]})})}};import{AlertTriangleIcon as Si}from"lucide-react";import{useRouteError as Pi,isRouteErrorResponse as Di,useNavigate as ki}from"react-router";import{Fragment as jo,jsx as Ee,jsxs as Bt}from"react/jsx-runtime";var wr=()=>{let e=Pi(),t=ki();return Ee("div",{className:"rounded-2xl flex justify-center items-center h-full bg-sidebar px-4",children:Bt("div",{className:"flex flex-col items-center space-y-4 text-center",children:[Ee(Si,{className:"h-16 w-16 text-destructive"}),Di(e)?Bt(jo,{children:[Bt("h2",{className:"text-3xl font-semibold text-destructive",children:["Error ",e.status,": ",e.statusText]}),typeof e.data=="string"?Ee("pre",{className:"text-lg text-muted-foreground whitespace-pre-wrap max-w-4xl text-left",children:e.data}):e.data?.message&&Ee("pre",{className:"text-lg text-muted-foreground whitespace-pre-wrap max-w-4xl text-left",children:e.data.message})]}):e instanceof Error?Bt(jo,{children:[Ee("h2",{className:"text-3xl font-semibold text-destructive",children:"Unexpected Error"}),Ee("pre",{className:"text-lg text-muted-foreground whitespace-pre-wrap max-w-4xl text-left",children:e.message}),e.stack&&Bt("details",{className:"mt-2 text-sm text-muted-foreground max-w-4xl text-left",children:[Ee("summary",{className:"cursor-pointer underline",children:"Stack Trace"}),Ee("pre",{className:"whitespace-pre-wrap",children:e.stack})]})]}):Bt(jo,{children:[Ee("h2",{className:"text-3xl font-semibold text-destructive",children:"Unknown Error"}),Ee("pre",{className:"text-lg text-muted-foreground whitespace-pre-wrap max-w-4xl text-left",children:typeof e=="string"?e:JSON.stringify(e,null,2)})]}),Ee(y,{variant:"outline",onClick:()=>t(-1),children:"Go Back"})]})})};import{motion as et}from"framer-motion";import{jsx as te,jsxs as ye}from"react/jsx-runtime";function Ri({size:e=100,strokeWidth:t=2,color:o="currentColor",className:n=""}){return ye(et.svg,{width:e,height:e,viewBox:"0 0 100 100",initial:"hidden",animate:"visible",className:n,children:[te("title",{children:"Animated Checkmark"}),te(et.circle,{cx:"50",cy:"50",r:"40",stroke:o,custom:0,style:{strokeWidth:t,strokeLinecap:"round",fill:"transparent"}}),te(et.path,{d:"M30 50L45 65L70 35",stroke:o,custom:1,style:{strokeWidth:t,strokeLinecap:"round",strokeLinejoin:"round",fill:"transparent"}})]})}function Cr(){return te(Xe,{className:"w-full max-w-sm mx-auto p-6 min-h-[300px] flex flex-col justify-center bg-background",children:ye(Ye,{className:"space-y-4 flex flex-col items-center justify-center",children:[te(et.div,{className:"flex justify-center",initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{duration:.4,ease:[.4,0,.2,1],scale:{type:"spring",damping:15,stiffness:200}},children:ye("div",{className:"relative",children:[te(et.div,{className:"absolute inset-0 bg-primary/5 rounded-full",initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{delay:.2,duration:.8,ease:"circOut"}}),te(Ri,{size:80,strokeWidth:4,color:"rgb(16 185 129)",className:"relative z-10 dark:drop-shadow-[0_0_10px_rgba(0,0,0,0.1)]"})]})}),ye(et.div,{className:"space-y-2 text-center w-full",initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.2,duration:.6,ease:[.4,0,.2,1]},children:[te(et.h2,{className:"text-lg text-zinc-100 dark:text-zinc-900 tracking-tighter font-semibold uppercase",initial:{opacity:0,y:5},animate:{opacity:1,y:0},transition:{delay:1,duration:.4},children:"Transfer Successful"}),te("div",{className:"flex items-center gap-4",children:te(et.div,{className:"flex-1 bg-zinc-800/50 dark:bg-zinc-50/50 rounded-xl p-3 border border-zinc-700/50 dark:border-zinc-200/50 backdrop-blur-md",initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},transition:{delay:1.2,duration:.4,ease:[.4,0,.2,1]},children:ye("div",{className:"flex flex-col items-start gap-2",children:[ye("div",{className:"space-y-1.5",children:[ye("span",{className:"text-xs font-medium text-secondary-foreground flex items-center gap-1.5",children:[ye("svg",{className:"w-3 h-3",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[te("title",{children:"From"}),te("path",{d:"M12 19V5M5 12l7-7 7 7"})]}),"From"]}),ye("div",{className:"flex items-center gap-2.5 group transition-all",children:[te("span",{className:"inline-flex items-center justify-center w-7 h-7 rounded-lg bg-zinc-900 dark:bg-white shadow-lg border border-zinc-700 dark:border-zinc-300 text-sm font-medium text-zinc-100 dark:text-zinc-900 group-hover:scale-105 transition-transform",children:"$"}),te("span",{className:"font-medium text-zinc-100 dark:text-zinc-900 tracking-tight",children:"500.00 USD"})]})]}),te("div",{className:"w-full h-px bg-gradient-to-r from-transparent via-zinc-700 dark:via-zinc-300 to-transparent"}),ye("div",{className:"space-y-1.5",children:[ye("span",{className:"text-xs font-medium text-secondary-foreground flex items-center gap-1.5",children:[ye("svg",{className:"w-3 h-3",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[te("title",{children:"To"}),te("path",{d:"M12 5v14M5 12l7 7 7-7"})]}),"To"]}),ye("div",{className:"flex items-center gap-2.5 group transition-all",children:[te("span",{className:"inline-flex items-center justify-center w-7 h-7 rounded-lg bg-zinc-900 dark:bg-white shadow-lg border border-zinc-700 dark:border-zinc-300 text-sm font-medium text-zinc-100 dark:text-zinc-900 group-hover:scale-105 transition-transform",children:"\u20AC"}),te("span",{className:"font-medium text-zinc-100 dark:text-zinc-900 tracking-tight",children:"460.00 EUR"})]})]})]})})}),te(et.div,{className:"w-full text-xs text-secondary-foreground mt-2 text-center",initial:{opacity:0},animate:{opacity:1},transition:{delay:1.4,duration:.4},children:"Exchange Rate: 1 USD = 0.92 EUR"})]})]})})}import{jsx as bo,jsxs as Mi}from"react/jsx-runtime";var Nr=()=>bo("div",{className:"rounded-2xl flex justify-center items-center h-full bg-transparent",children:Mi("div",{className:"flex flex-col items-center space-y-4",children:[bo("div",{className:"animate-spin rounded-full border-t-4 border-ring h-16 w-16 mb-4"}),bo("h2",{className:"text-xl font-semibold text-muted-foreground",children:"Loading, please wait..."}),bo("p",{className:"text-sm text-muted-foreground",children:"Your content is on its way."})]})});import{useLocation as zi}from"react-router";import{GhostIcon as Fi}from"lucide-react";import{NavLink as Ai,useNavigate as Ii}from"react-router";import{jsx as Gt,jsxs as $o}from"react/jsx-runtime";var Tr=()=>{let e=zi(),t=Ii(),o=()=>{window.history.length>2?t(-1):t("/")};return $o("div",{className:"rounded-2xl flex flex-col items-center justify-center h-full p-6 text-center bg-sidebar text-muted-foreground select-none",children:[Gt(Fi,{className:"h-15 w-15 text-destructive mb-4"}),Gt("h1",{className:"text-2xl font-bold text-destructive mb-2",children:"Page Not Found"}),$o("p",{className:"text-xl mb-4",children:["The page ",Gt("code",{className:"px-1 py-0.5 rounded bg-muted text-foreground",children:e.pathname})," doesn't exist or has been moved."]}),$o("div",{className:"flex space-x-4",children:[Gt(y,{variant:"outline",onClick:o,children:"Go Back"}),Gt(y,{variant:"ghost",children:Gt(Ai,{to:"/",children:"Return Home"})})]})]})};import{WifiOffIcon as Bi}from"lucide-react";import{jsx as Uo,jsxs as Gi}from"react/jsx-runtime";var Sr=()=>Gi("div",{className:"rounded-2xl flex flex-col items-center justify-center h-screen p-6 text-center text-muted-foreground bg-background select-none",children:[Uo(Bi,{className:"h-15 w-15 text-destructive mb-4"}),Uo("h1",{className:"text-3xl font-bold text-destructive mb-2",children:"You're offline"}),Uo("p",{className:"text-xl max-w-md",children:"We couldn't connect to the server."})]});import{ShieldOffIcon as Li}from"lucide-react";import{NavLink as Ei,useNavigate as _i}from"react-router";import{jsx as Lt,jsxs as Pr}from"react/jsx-runtime";var Dr=()=>{let e=_i();return Pr("div",{className:"rounded-2xl flex flex-col items-center justify-center h-full p-6 text-center bg-sidebar text-muted-foreground select-none",children:[Lt(Li,{className:"h-15 w-15 text-destructive mb-4"}),Lt("h1",{className:"text-2xl font-bold text-destructive mb-2",children:"Access Denied"}),Lt("p",{className:"text-xl mb-4",children:"You don't have permission to view this page. Please sign in with an authorized account or contact your administrator."}),Pr("div",{className:"flex space-x-4",children:[Lt(y,{variant:"outline",onClick:()=>{window.history.length>2?e(-1):e("/")},children:"Go Back"}),Lt(y,{variant:"ghost",children:Lt(Ei,{to:"/",children:"Go to Home"})})]})]})};export{gi as AppContainer,vi as AppContent,hr as AppContentFooter,br as AppContentHeader,yi as AppFooter,hi as AppHeader,xr as AppSheet,Cr as CurrencyTransfer,er as DataTable,or as DataTableActionBar,nr as DataTableActionBarAction,rr as DataTableActionBarSelection,dr as DataTemplate,ur as DataTemplateActionBar,mr as DataTemplateActionBarAction,pr as DataTemplateActionBarSelection,wr as ErrorComponent,Ho as GeneralHelper,Nr as Loader,Tr as NotFound,Sr as OfflineUI,Dr as Unauthorized,so as getTableExportView,Vn as readPersistedExternal,ar as useTableFilterParam};
3
3
  //# sourceMappingURL=index.js.map