@oneclick.dev/cms-core-modules 0.0.106 → 0.0.108

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 (576) hide show
  1. package/dist/Acquisition-DypEyPSO.js +1 -0
  2. package/dist/Acquisition-TCNX-th6.mjs +308 -0
  3. package/dist/AgendaOpeningHoursCard-BIhm0vpV.js +1 -0
  4. package/dist/AgendaOpeningHoursCard-BKUdJxRI.mjs +133 -0
  5. package/dist/AppointmentDetailsCard-C5rQ5jsW.js +1 -0
  6. package/dist/AppointmentDetailsCard-NRHeNP2L.mjs +111 -0
  7. package/dist/AppointmentEditor-BcF8CiD-.mjs +150 -0
  8. package/dist/AppointmentEditor-BlhFtoCm.js +1 -0
  9. package/dist/AppointmentListTable-B-ReBVtV.js +1 -0
  10. package/dist/AppointmentListTable-DHmy-iid.mjs +129 -0
  11. package/dist/Audience-CfWHjjg8.mjs +394 -0
  12. package/dist/Audience-Cj4TyauW.js +1 -0
  13. package/dist/Components-BehelN4r.js +1 -0
  14. package/dist/Components-CR6zukUU.mjs +468 -0
  15. package/dist/Content-C5Iye3t0.mjs +257 -0
  16. package/dist/Content-eOfBx52Y.js +1 -0
  17. package/dist/ContentEditor-BgL4qEeg.mjs +26835 -0
  18. package/dist/ContentEditor-Tlu3w0Hu.js +462 -0
  19. package/dist/CountryBreakdownCard-CWVyB8be.mjs +151 -0
  20. package/dist/CountryBreakdownCard-Db-pMiNe.js +1 -0
  21. package/dist/Create-B1it8S4m.js +1 -0
  22. package/dist/Create-DbYi0FAI.mjs +907 -0
  23. package/dist/DateFormatter-DLrDYkby.mjs +630 -0
  24. package/dist/DateFormatter-Dni0Oq8r.js +1 -0
  25. package/dist/Detail-D-eahJGO.mjs +21 -0
  26. package/dist/Detail-D0kdPPIm.mjs +2757 -0
  27. package/dist/Detail-DAafePYi.mjs +485 -0
  28. package/dist/Detail-DYpv4fYg.js +1 -0
  29. package/dist/Detail-Dc_ui4LM.js +1 -0
  30. package/dist/Detail-DccUekl_.js +1 -0
  31. package/dist/Detail-Dhz0V0Vf.js +1 -0
  32. package/dist/Detail-DjnGY0F8.mjs +282 -0
  33. package/dist/Detail-DplAitHg.mjs +447 -0
  34. package/dist/Detail-SugyeSxb.js +1 -0
  35. package/dist/DeviceBreakdownCard-CzxZT6To.js +1 -0
  36. package/dist/DeviceBreakdownCard-eEwPjzKl.mjs +115 -0
  37. package/dist/EditLayout-Bnz9q_jd.js +1 -0
  38. package/dist/EditLayout-J_DGXb8v.mjs +99 -0
  39. package/dist/Entries-CgpWg6fE.js +1 -0
  40. package/dist/Entries-CkGTXcAq.mjs +575 -0
  41. package/dist/Find-Bz0TNJzk.mjs +164 -0
  42. package/dist/Find-D-ItTXaZ.js +1 -0
  43. package/dist/GlobalStyling-CSQPF7o_.mjs +1162 -0
  44. package/dist/GlobalStyling-DabldMZh.js +15 -0
  45. package/dist/NewReservationDialog-BhIiY2B9.js +1 -0
  46. package/dist/NewReservationDialog-CN49aGcM.mjs +1002 -0
  47. package/dist/OrderDetailDialog-BJ01DZFe.js +1 -0
  48. package/dist/OrderDetailDialog-CoVQ_rzs.mjs +215 -0
  49. package/dist/Overview-9FMgn5hT.mjs +492 -0
  50. package/dist/Overview-BOOwMQ-c.mjs +636 -0
  51. package/dist/Overview-Biz3h60w.js +1 -0
  52. package/dist/Overview-C2K2ofdS.js +1 -0
  53. package/dist/Overview-CFHOXP9N.mjs +123 -0
  54. package/dist/Overview-CTJe7J5_.js +1 -0
  55. package/dist/Overview-Cvj2i9eW.js +1 -0
  56. package/dist/Overview-D2I1F8Dm.mjs +21 -0
  57. package/dist/Overview-DFOc9emt.mjs +345 -0
  58. package/dist/Overview-Dmhfb94Y.js +1 -0
  59. package/dist/Overview-PPzv7weG.mjs +450 -0
  60. package/dist/Overview-qFKcXHVF.js +1 -0
  61. package/dist/Overview-xkmYYTae.mjs +133 -0
  62. package/dist/Overview-yPsLvR2c.js +1 -0
  63. package/dist/PeakHoursCard-CtgEP-ez.mjs +157 -0
  64. package/dist/PeakHoursCard-DPeoMyhu.js +1 -0
  65. package/dist/ProductDetailsCard-B0WhmzO-.mjs +98 -0
  66. package/dist/ProductDetailsCard-C1ROuH6l.js +1 -0
  67. package/dist/RealtimeCard-DQno-Okz.js +1 -0
  68. package/dist/RealtimeCard-dR-g1iDo.mjs +92 -0
  69. package/dist/ReservationDetailDialog-Cdo6h0RD.mjs +2163 -0
  70. package/dist/ReservationDetailDialog-DZTFD2xI.js +349 -0
  71. package/dist/SearchTermsCard-BXJSXz_k.js +1 -0
  72. package/dist/SearchTermsCard-DsaxLKwP.mjs +146 -0
  73. package/dist/SendPush-Bssi-OZD.mjs +150 -0
  74. package/dist/SendPush-BuaYboRH.js +1 -0
  75. package/dist/SeoHealth-CP-kL0us.js +1 -0
  76. package/dist/SeoHealth-Cxp_Gb3Y.mjs +459 -0
  77. package/dist/TableView-7iwBkQ_k.mjs +4757 -0
  78. package/dist/TableView-BB_oIYYZ.js +4 -0
  79. package/dist/TemplateList-CNcM_Kgq.mjs +56 -0
  80. package/dist/TemplateList-VuPcBUJO.js +1 -0
  81. package/dist/TopPagesCard-CvDECn3_.mjs +117 -0
  82. package/dist/TopPagesCard-DNdATXJE.js +1 -0
  83. package/dist/TrafficSourcesCard-BLpBr7u0.mjs +151 -0
  84. package/dist/TrafficSourcesCard-_3gRUCw3.js +1 -0
  85. package/dist/View-DSnUHI7h.mjs +30 -0
  86. package/dist/View-Dbcfpdqh.js +1 -0
  87. package/dist/VisitorStatsCard-CFEnXSjF.mjs +185 -0
  88. package/dist/VisitorStatsCard-C_jhQxDW.js +1 -0
  89. package/dist/_plugin-vue_export-helper-5u7tqpWC.js +1 -0
  90. package/dist/_plugin-vue_export-helper-BJQSo0im.mjs +8 -0
  91. package/dist/agenda-CzMRcQTA.mjs +989 -0
  92. package/dist/agenda-D4zWRYSQ.js +1 -0
  93. package/dist/appointments-9syR5TZE.js +1 -0
  94. package/dist/appointments-BBmOJMhM.mjs +23 -0
  95. package/dist/array-BH1uH7XT.js +1 -0
  96. package/dist/array-DnDL9cFz.mjs +98 -0
  97. package/dist/availability-CAXB7Yd6.js +1 -0
  98. package/dist/availability-Dp7eF-ZK.mjs +215 -0
  99. package/dist/booking-data-Bysf6e5x.mjs +724 -0
  100. package/dist/booking-data-C6SGjC2X.js +1 -0
  101. package/dist/chunk-DQi1bQcV.js +1 -0
  102. package/dist/cms-core-modules.css +2 -1
  103. package/dist/contentManager-D7JxXCwE.js +1 -0
  104. package/dist/contentManager-tfy0x1LD.mjs +22 -0
  105. package/dist/context-AQKfnJ4t.mjs +3809 -0
  106. package/dist/context-ubyMq9Xe.js +54 -0
  107. package/dist/core-Dhgr4ctC.mjs +202 -0
  108. package/dist/core-_HKfBlaZ.js +1 -0
  109. package/dist/countries-MXLT3mVe.mjs +4 -0
  110. package/dist/countries-OCd5qPxG.js +1 -0
  111. package/dist/create-BfNc2C7N.js +1 -0
  112. package/dist/create-C7JlIlIh.mjs +95 -0
  113. package/dist/custom-BwN9-6Mb.js +1 -0
  114. package/dist/custom-INNwaWla.mjs +13 -0
  115. package/dist/dist-BCVg7FKM.js +1 -0
  116. package/dist/dist-DIhK9VWh.mjs +3045 -0
  117. package/dist/edit-BiI2VG60.js +35 -0
  118. package/dist/edit-DD3iFBEh.mjs +1097 -0
  119. package/dist/exceptions-DICMaDcH.mjs +462 -0
  120. package/dist/exceptions-DpWqMNuG.js +1 -0
  121. package/dist/google-Bcc4XZnV.mjs +4 -0
  122. package/dist/google-DTSRmJ51.js +1 -0
  123. package/dist/googleAnalytics-BSaqRR_L.js +1 -0
  124. package/dist/googleAnalytics-Cg-iWblZ.mjs +47 -0
  125. package/dist/index.cjs.js +1 -1
  126. package/dist/index.mjs +1095 -806
  127. package/dist/interpolation-B8OzkMyi.mjs +131 -0
  128. package/dist/interpolation-DpAqtGOW.js +1 -0
  129. package/dist/lib-4wSi00Vr.js +1 -0
  130. package/dist/lib-BZgXUui5.mjs +198 -0
  131. package/dist/line-DJdnFNI7.js +75 -0
  132. package/dist/line-tYLnEDGV.mjs +1500 -0
  133. package/dist/mailTemplates-BNk8fhVS.mjs +23 -0
  134. package/dist/mailTemplates-DswHzyQe.js +1 -0
  135. package/dist/orders-CIc0JlKX.mjs +512 -0
  136. package/dist/orders-DwPSi_pD.js +1 -0
  137. package/dist/payment-BsNWFaDm.js +1 -0
  138. package/dist/payment-Ced5_dpa.mjs +718 -0
  139. package/dist/productCollections-Cuvw_8zC.js +1 -0
  140. package/dist/productCollections-D0AxRlzr.mjs +23 -0
  141. package/dist/products-DUD-ZMkR.mjs +22 -0
  142. package/dist/products-DvX9B-Ul.js +1 -0
  143. package/dist/promoCodes-BCWqN6w4.mjs +23 -0
  144. package/dist/promoCodes-CEZ4LYot.js +1 -0
  145. package/dist/push-notifications-BGp4XWo9.js +1 -0
  146. package/dist/push-notifications-C7W7KuzR.mjs +23 -0
  147. package/dist/regular-BCFrS6lK.mjs +908 -0
  148. package/dist/regular-DBqPgT8C.js +1 -0
  149. package/dist/resources-DwsMmWgm.mjs +669 -0
  150. package/dist/resources-Dz81GkHe.js +1 -0
  151. package/dist/server-handlers.cjs.js +1 -1
  152. package/dist/server-handlers.mjs +1049 -996
  153. package/dist/shippingOptions-C3NEJff1.mjs +23 -0
  154. package/dist/shippingOptions-Cy040ZW1.js +1 -0
  155. package/dist/single-container-BJmmqq65.mjs +468 -0
  156. package/dist/single-container-Xoo0Xzxv.js +58 -0
  157. package/dist/src/appointments/index.d.ts +9 -12
  158. package/dist/src/appointments/metadata.d.ts +1 -1
  159. package/dist/src/appointments/routes.d.ts +3 -6
  160. package/dist/src/contentManager/components/content-editor/tiptap-extensions/LockBlocks.d.ts +15 -0
  161. package/dist/src/contentManager/components/content-editor/tiptap-extensions/TrailingNodeInContainers.d.ts +4 -1
  162. package/dist/src/contentManager/components/content-editor/tiptap-menus/element-editor-views/index.d.ts +12 -132
  163. package/dist/src/contentManager/index.d.ts +5 -14
  164. package/dist/src/contentManager/metadata.d.ts +1 -1
  165. package/dist/src/contentManager/routes.d.ts +3 -12
  166. package/dist/src/custom/index.d.ts +2 -2
  167. package/dist/src/custom/routes.d.ts +1 -1
  168. package/dist/src/googleAnalytics/index.d.ts +10 -10
  169. package/dist/src/googleAnalytics/routes.d.ts +1 -1
  170. package/dist/src/mailTemplates/index.d.ts +3 -3
  171. package/dist/src/mailTemplates/metadata.d.ts +1 -1
  172. package/dist/src/mailTemplates/routes.d.ts +1 -1
  173. package/dist/src/productCollections/index.d.ts +3 -3
  174. package/dist/src/productCollections/metadata.d.ts +1 -1
  175. package/dist/src/productCollections/routes.d.ts +1 -1
  176. package/dist/src/products/index.d.ts +4 -4
  177. package/dist/src/products/metadata.d.ts +1 -1
  178. package/dist/src/products/routes.d.ts +1 -1
  179. package/dist/src/promoCodes/index.d.ts +3 -3
  180. package/dist/src/promoCodes/metadata.d.ts +1 -1
  181. package/dist/src/promoCodes/routes.d.ts +1 -1
  182. package/dist/src/push-notifications/index.d.ts +3 -3
  183. package/dist/src/push-notifications/metadata.d.ts +1 -1
  184. package/dist/src/push-notifications/routes.d.ts +1 -1
  185. package/dist/src/shippingOptions/index.d.ts +3 -3
  186. package/dist/src/shippingOptions/metadata.d.ts +1 -1
  187. package/dist/src/shippingOptions/routes.d.ts +1 -1
  188. package/dist/src/table/flow-builder-extensions/row-item.d.ts +3 -17
  189. package/dist/src/table/index.d.ts +2 -2
  190. package/dist/src/table/routes.d.ts +1 -1
  191. package/dist/src/types/index.d.ts +6 -0
  192. package/dist/src/vue-shim.d.ts +7 -0
  193. package/dist/table-DWw0fs3S.js +1 -0
  194. package/dist/table-LXt5DQOL.mjs +23 -0
  195. package/dist/utils-CVIHqQsU.js +3 -0
  196. package/dist/utils-h3owcMtS.mjs +37 -0
  197. package/dist/vee-validate-zod-BmXMJo8W.js +1 -0
  198. package/dist/vee-validate-zod-D9dZzbWZ.mjs +4985 -0
  199. package/dist/xy-container-CuQSwrtB.mjs +3180 -0
  200. package/dist/xy-container-_6YpscZh.js +158 -0
  201. package/package.json +55 -55
  202. package/dist/Acquisition-B2pM5vSp.mjs +0 -400
  203. package/dist/Acquisition-Dt2rREU8.js +0 -1
  204. package/dist/AgendaOpeningHoursCard-B7ROIPWw.js +0 -1
  205. package/dist/AgendaOpeningHoursCard-Cp4wxUeK.mjs +0 -172
  206. package/dist/AppointmentDetailsCard-33WpATpV.mjs +0 -161
  207. package/dist/AppointmentDetailsCard-DpLM5IrB.js +0 -1
  208. package/dist/AppointmentEditor-BeOtYV6u.mjs +0 -196
  209. package/dist/AppointmentEditor-CaTfbkIf.js +0 -1
  210. package/dist/AppointmentListTable-DZJNmTMb.mjs +0 -177
  211. package/dist/AppointmentListTable-Dieu9US_.js +0 -1
  212. package/dist/Audience-Bs7b0TNm.js +0 -1
  213. package/dist/Audience-VLnUsQvW.mjs +0 -489
  214. package/dist/Components-C83O-xlF.mjs +0 -623
  215. package/dist/Components-DXbx0RLV.js +0 -1
  216. package/dist/Content-BHr_rPVY.js +0 -1
  217. package/dist/Content-CYOZKvWK.mjs +0 -358
  218. package/dist/ContentEditor-BNLEv-qJ.mjs +0 -30697
  219. package/dist/ContentEditor-BUvvqfG1.js +0 -462
  220. package/dist/CountryBreakdownCard-D7BK3nRD.js +0 -1
  221. package/dist/CountryBreakdownCard-DVxNz2DJ.mjs +0 -196
  222. package/dist/Create-89z41K73.js +0 -1
  223. package/dist/Create-Cn_Eufga.mjs +0 -1251
  224. package/dist/DateFormatter-Bw-87W31.mjs +0 -734
  225. package/dist/DateFormatter-CYAD4GBN.js +0 -1
  226. package/dist/Detail-Byk781b4.mjs +0 -26
  227. package/dist/Detail-C1Blq61w.mjs +0 -585
  228. package/dist/Detail-C857g62L.js +0 -1
  229. package/dist/Detail-C8wQiDcv.js +0 -1
  230. package/dist/Detail-CPqug27l.js +0 -1
  231. package/dist/Detail-CjuhjPby.js +0 -1
  232. package/dist/Detail-CtItxMX4.mjs +0 -649
  233. package/dist/Detail-CujdFApD.mjs +0 -379
  234. package/dist/Detail-Dnpnmy4-.mjs +0 -3477
  235. package/dist/Detail-mvSGbnFU.js +0 -1
  236. package/dist/DeviceBreakdownCard-DRhQ9ufG.js +0 -1
  237. package/dist/DeviceBreakdownCard-W1frLe0L.mjs +0 -159
  238. package/dist/EditLayout.vue_vue_type_script_setup_true_lang-DWMqQvHl.mjs +0 -76
  239. package/dist/EditLayout.vue_vue_type_script_setup_true_lang-kpjbVSXg.js +0 -1
  240. package/dist/Entries-BdhUyJR5.mjs +0 -728
  241. package/dist/Entries-CEXM_SkO.js +0 -1
  242. package/dist/Find-B24ZEhYM.mjs +0 -229
  243. package/dist/Find-D4Qa45qC.js +0 -1
  244. package/dist/GlobalStyling-C9VthHWK.mjs +0 -1588
  245. package/dist/GlobalStyling-CnSlXkZc.js +0 -25
  246. package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-Ceoje52V.js +0 -1
  247. package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-DMGcRmm-.mjs +0 -1255
  248. package/dist/OrderDetailDialog.vue_vue_type_script_setup_true_lang-COrK1j0S.js +0 -1
  249. package/dist/OrderDetailDialog.vue_vue_type_script_setup_true_lang-Vb3q8EVv.mjs +0 -330
  250. package/dist/Overview-3HWhsqaz.mjs +0 -860
  251. package/dist/Overview-BCpJNiEB.mjs +0 -190
  252. package/dist/Overview-BDlBCUI_.js +0 -1
  253. package/dist/Overview-BbvfH1u-.js +0 -1
  254. package/dist/Overview-Bn1Xx3_j.js +0 -1
  255. package/dist/Overview-CIa1E-HH.mjs +0 -178
  256. package/dist/Overview-DAxCu9XC.js +0 -1
  257. package/dist/Overview-DC9io1bk.js +0 -1
  258. package/dist/Overview-Di84CsR5.mjs +0 -476
  259. package/dist/Overview-Su8ZUbMs.mjs +0 -26
  260. package/dist/Overview-T-lsy3UZ.js +0 -1
  261. package/dist/Overview-UoZHUMUz.js +0 -1
  262. package/dist/Overview-ejh4vUMT.mjs +0 -567
  263. package/dist/Overview-lWAyyenp.mjs +0 -632
  264. package/dist/PeakHoursCard-9-EZFZLR.mjs +0 -182
  265. package/dist/PeakHoursCard-BR5zmta4.js +0 -1
  266. package/dist/ProductDetailsCard-6nHikw4V.mjs +0 -121
  267. package/dist/ProductDetailsCard-Bn7qrgmc.js +0 -1
  268. package/dist/RealtimeCard--APfRNc8.js +0 -1
  269. package/dist/RealtimeCard-fvQlJcM7.mjs +0 -126
  270. package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-CuwREvXD.js +0 -349
  271. package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-GYNZ_yhD.mjs +0 -3077
  272. package/dist/SearchTermsCard-BsB-63aH.js +0 -1
  273. package/dist/SearchTermsCard-BzVrHKqQ.mjs +0 -201
  274. package/dist/SendPush-COns44j7.js +0 -1
  275. package/dist/SendPush-CPIOjVX4.mjs +0 -184
  276. package/dist/SeoHealth-DsbVdd2l.mjs +0 -615
  277. package/dist/SeoHealth-az1YuNF2.js +0 -1
  278. package/dist/TableView-Bm6HaRHm.mjs +0 -6143
  279. package/dist/TableView-DQW0A1oG.js +0 -4
  280. package/dist/TemplateList.vue_vue_type_script_setup_true_lang-B_AtWnHa.js +0 -1
  281. package/dist/TemplateList.vue_vue_type_script_setup_true_lang-Cmovy7kk.mjs +0 -40
  282. package/dist/TopPagesCard-BDeA997A.js +0 -1
  283. package/dist/TopPagesCard-CTozhOr_.mjs +0 -159
  284. package/dist/TrafficSourcesCard-BxtCKsqx.mjs +0 -197
  285. package/dist/TrafficSourcesCard-C3ziDTUL.js +0 -1
  286. package/dist/View-CsudjxCE.mjs +0 -30
  287. package/dist/View-Dw_wA6kK.js +0 -1
  288. package/dist/VisitorStatsCard-BmByE_Hi.js +0 -1
  289. package/dist/VisitorStatsCard-CXizEbVK.mjs +0 -174
  290. package/dist/_plugin-vue_export-helper-BHFhmbuH.js +0 -1
  291. package/dist/_plugin-vue_export-helper-CHgC5LLL.mjs +0 -9
  292. package/dist/agenda-IOqtALWf.js +0 -1
  293. package/dist/agenda-neyeLWv-.mjs +0 -1165
  294. package/dist/array-CbATeQbk.js +0 -1
  295. package/dist/array-CvmZXzxF.mjs +0 -108
  296. package/dist/availability-CMrRa5y2.mjs +0 -269
  297. package/dist/availability-Cf2YfMwM.js +0 -1
  298. package/dist/booking-data-DgJd0BcM.mjs +0 -889
  299. package/dist/booking-data-Di5GmH_8.js +0 -1
  300. package/dist/countries-BTPvmrsb.mjs +0 -4
  301. package/dist/countries-CgZ081No.js +0 -1
  302. package/dist/exceptions-CI0B4xVj.js +0 -1
  303. package/dist/exceptions-vo8SA5SE.mjs +0 -646
  304. package/dist/google-CvtuJwgk.mjs +0 -4
  305. package/dist/google-D4N3gb01.js +0 -1
  306. package/dist/index-4tjmIans.js +0 -1
  307. package/dist/index-9HVlmvK3.js +0 -1
  308. package/dist/index-A2kp8Isi.js +0 -75
  309. package/dist/index-B5aBwdxY.js +0 -54
  310. package/dist/index-BRdCrvcz.mjs +0 -1443
  311. package/dist/index-BWDwEd8D.mjs +0 -24
  312. package/dist/index-BfBBm9uY.mjs +0 -24
  313. package/dist/index-BiT55eU0.js +0 -58
  314. package/dist/index-Bkq58CeQ.mjs +0 -22
  315. package/dist/index-Bvxc5xv_.mjs +0 -3843
  316. package/dist/index-CJQQBRLY.js +0 -1
  317. package/dist/index-CQkOH2_3.mjs +0 -24
  318. package/dist/index-CSxYBeVA.js +0 -1
  319. package/dist/index-CU-tbS5W.mjs +0 -24
  320. package/dist/index-CZn2nDLv.mjs +0 -34
  321. package/dist/index-CkiNvRzs.js +0 -1
  322. package/dist/index-Co4ON2Di.js +0 -1
  323. package/dist/index-Cpnn_Pxd.mjs +0 -24
  324. package/dist/index-CrgzoTyR.mjs +0 -110
  325. package/dist/index-CsVeM3PA.mjs +0 -24
  326. package/dist/index-CwqrAU-H.js +0 -1
  327. package/dist/index-CxETuRsG.js +0 -1
  328. package/dist/index-Cz-baGax.js +0 -1
  329. package/dist/index-DFQGVHTs.js +0 -1
  330. package/dist/index-DPd3waTN.js +0 -1
  331. package/dist/index-DRqJOqUR.mjs +0 -3484
  332. package/dist/index-DjWuIBxh.js +0 -1
  333. package/dist/index-Dnn2SCSl.js +0 -1
  334. package/dist/index-Dpl9sU6a.mjs +0 -12
  335. package/dist/index-DrXxXB2F.mjs +0 -138
  336. package/dist/index-G7cIlnGN.js +0 -158
  337. package/dist/index-MYWjg0zi.mjs +0 -176
  338. package/dist/index-R2oUDsjx.js +0 -1
  339. package/dist/index-RLz1QPrf.mjs +0 -203
  340. package/dist/index-UtjLbLw-.js +0 -1
  341. package/dist/index-X6LV64jK.mjs +0 -442
  342. package/dist/index-cOnxXTbF.mjs +0 -24
  343. package/dist/index-hlylYYgy.mjs +0 -24
  344. package/dist/index-ijdf0d9-.js +0 -1
  345. package/dist/index-uOkqO74I.mjs +0 -2940
  346. package/dist/index-unsDfNYv.mjs +0 -1187
  347. package/dist/index-vHmvbEwa.js +0 -35
  348. package/dist/interpolation-CHn59tIC.js +0 -1
  349. package/dist/interpolation-w7IRDJwK.mjs +0 -180
  350. package/dist/orders-C65SlpJy.mjs +0 -618
  351. package/dist/orders-XVzWAgG1.js +0 -1
  352. package/dist/payment-C3ohkehF.mjs +0 -1080
  353. package/dist/payment-Dfr-Ro-a.js +0 -1
  354. package/dist/regular-1LXNPviB.js +0 -1
  355. package/dist/regular-_05oq5Tx.mjs +0 -1101
  356. package/dist/resources-CxeFd57z.js +0 -1
  357. package/dist/resources-WI_4SO6T.mjs +0 -811
  358. package/dist/src/appointments/chat-components/AgendaOpeningHoursCard.vue.d.ts +0 -15
  359. package/dist/src/appointments/chat-components/AppointmentDetailsCard.vue.d.ts +0 -14
  360. package/dist/src/appointments/chat-components/AppointmentEditor.vue.d.ts +0 -14
  361. package/dist/src/appointments/chat-components/AppointmentListTable.vue.d.ts +0 -14
  362. package/dist/src/appointments/components/create/StepNavigation.vue.d.ts +0 -32
  363. package/dist/src/appointments/components/create/regular/Step1.vue.d.ts +0 -2
  364. package/dist/src/appointments/components/create/regular/Step2.vue.d.ts +0 -2
  365. package/dist/src/appointments/components/create/regular/Step3.vue.d.ts +0 -2
  366. package/dist/src/appointments/components/create/regular/Step4.vue.d.ts +0 -2
  367. package/dist/src/appointments/components/edit/CustomerInformationFieldEditorDialog.vue.d.ts +0 -24
  368. package/dist/src/appointments/components/edit/EditLayout.vue.d.ts +0 -17
  369. package/dist/src/appointments/components/edit/Event24hSidebar.vue.d.ts +0 -2
  370. package/dist/src/appointments/components/edit/EventDialog/ApproveReservationDialog.vue.d.ts +0 -8
  371. package/dist/src/appointments/components/edit/EventDialog/BookingsList.vue.d.ts +0 -136
  372. package/dist/src/appointments/components/edit/EventDialog/CancelReservationDialog.vue.d.ts +0 -8
  373. package/dist/src/appointments/components/edit/EventDialog/EventDialog.vue.d.ts +0 -11
  374. package/dist/src/appointments/components/edit/EventDialog/OrderDetailDialog.vue.d.ts +0 -55
  375. package/dist/src/appointments/components/edit/EventDialog/RejectReservationDialog.vue.d.ts +0 -8
  376. package/dist/src/appointments/components/edit/EventDialog/ReservationDetailDialog.vue.d.ts +0 -87
  377. package/dist/src/appointments/components/edit/EventDialog/TimelineChart.vue.d.ts +0 -24
  378. package/dist/src/appointments/components/edit/EventDialog/TransferReservationDialog.vue.d.ts +0 -4
  379. package/dist/src/appointments/components/edit/EventTimeIndicator.vue.d.ts +0 -12
  380. package/dist/src/appointments/components/edit/EventTimeline.vue.d.ts +0 -48
  381. package/dist/src/appointments/components/edit/EventView.vue.d.ts +0 -9
  382. package/dist/src/appointments/components/edit/ExceptionDialog.vue.d.ts +0 -29
  383. package/dist/src/appointments/components/edit/MetadataSchemaEditorDialog.vue.d.ts +0 -12
  384. package/dist/src/appointments/components/edit/NewReservationDialog/CustomerInformation.vue.d.ts +0 -10
  385. package/dist/src/appointments/components/edit/NewReservationDialog/NewReservationDialog.vue.d.ts +0 -26
  386. package/dist/src/appointments/components/edit/NewReservationDialog/QuickReservationAdder.vue.d.ts +0 -26
  387. package/dist/src/appointments/components/edit/NewReservationDialog/ReservationLines.vue.d.ts +0 -31
  388. package/dist/src/appointments/components/edit/OrderMetadataDisplay.vue.d.ts +0 -21
  389. package/dist/src/appointments/components/edit/PaymentAddons/Addon.vue.d.ts +0 -22
  390. package/dist/src/appointments/components/edit/PaymentAddons/AddonList.vue.d.ts +0 -5
  391. package/dist/src/appointments/components/edit/PaymentAddons/index.vue.d.ts +0 -15
  392. package/dist/src/appointments/components/edit/ResourceEditorDialog.vue.d.ts +0 -13
  393. package/dist/src/appointments/components/edit/dashboard/Timeline.vue.d.ts +0 -36
  394. package/dist/src/appointments/components/edit/dashboard/timeline/ResourceSelector.vue.d.ts +0 -50
  395. package/dist/src/appointments/index.vue.d.ts +0 -22
  396. package/dist/src/appointments/pages/Overview.vue.d.ts +0 -4
  397. package/dist/src/appointments/pages/create/index.vue.d.ts +0 -2
  398. package/dist/src/appointments/pages/create/regular.vue.d.ts +0 -6
  399. package/dist/src/appointments/pages/edit/agenda.vue.d.ts +0 -4
  400. package/dist/src/appointments/pages/edit/availability.vue.d.ts +0 -2
  401. package/dist/src/appointments/pages/edit/booking-data.vue.d.ts +0 -65
  402. package/dist/src/appointments/pages/edit/index.vue.d.ts +0 -2
  403. package/dist/src/appointments/pages/edit/payment.vue.d.ts +0 -2
  404. package/dist/src/appointments/pages/edit/resources.vue.d.ts +0 -28
  405. package/dist/src/contentManager/components/components/ComponentDialog.vue.d.ts +0 -12
  406. package/dist/src/contentManager/components/components/ComponentGridItem.vue.d.ts +0 -16
  407. package/dist/src/contentManager/components/content-editor/ApiDocs.vue.d.ts +0 -2
  408. package/dist/src/contentManager/components/content-editor/ContentLayout.vue.d.ts +0 -49
  409. package/dist/src/contentManager/components/content-editor/ContentSettings.vue.d.ts +0 -24
  410. package/dist/src/contentManager/components/content-editor/ContentStructuredContentSections.vue.d.ts +0 -4
  411. package/dist/src/contentManager/components/content-editor/Header.vue.d.ts +0 -64
  412. package/dist/src/contentManager/components/content-editor/LivePreviewWrapper.vue.d.ts +0 -53
  413. package/dist/src/contentManager/components/content-editor/Locales.vue.d.ts +0 -44
  414. package/dist/src/contentManager/components/content-editor/NewSectionDialog.vue.d.ts +0 -21
  415. package/dist/src/contentManager/components/content-editor/PageSettings.vue.d.ts +0 -2
  416. package/dist/src/contentManager/components/content-editor/SEO.vue.d.ts +0 -14
  417. package/dist/src/contentManager/components/content-editor/SidebarSectionWrapper.vue.d.ts +0 -39
  418. package/dist/src/contentManager/components/content-editor/Status.vue.d.ts +0 -2
  419. package/dist/src/contentManager/components/content-editor/Versions.vue.d.ts +0 -63
  420. package/dist/src/contentManager/components/content-editor/tiptap-extensions/Button.vue.d.ts +0 -94
  421. package/dist/src/contentManager/components/content-editor/tiptap-extensions/Card.vue.d.ts +0 -92
  422. package/dist/src/contentManager/components/content-editor/tiptap-extensions/Column.vue.d.ts +0 -92
  423. package/dist/src/contentManager/components/content-editor/tiptap-extensions/Container.vue.d.ts +0 -92
  424. package/dist/src/contentManager/components/content-editor/tiptap-extensions/Divider.vue.d.ts +0 -92
  425. package/dist/src/contentManager/components/content-editor/tiptap-extensions/EmptySpace.vue.d.ts +0 -94
  426. package/dist/src/contentManager/components/content-editor/tiptap-extensions/Heading.vue.d.ts +0 -92
  427. package/dist/src/contentManager/components/content-editor/tiptap-extensions/Image.vue.d.ts +0 -92
  428. package/dist/src/contentManager/components/content-editor/tiptap-extensions/Map.vue.d.ts +0 -92
  429. package/dist/src/contentManager/components/content-editor/tiptap-extensions/Paragraph.vue.d.ts +0 -92
  430. package/dist/src/contentManager/components/content-editor/tiptap-extensions/Row.vue.d.ts +0 -115
  431. package/dist/src/contentManager/components/content-editor/tiptap-extensions/Stack.vue.d.ts +0 -115
  432. package/dist/src/contentManager/components/content-editor/tiptap-extensions/Video.vue.d.ts +0 -92
  433. package/dist/src/contentManager/components/content-editor/tiptap-extensions/extension-details/DetailsNodeView.vue.d.ts +0 -92
  434. package/dist/src/contentManager/components/content-editor/tiptap-extensions/helpers/NodeLabel.vue.d.ts +0 -108
  435. package/dist/src/contentManager/components/content-editor/tiptap-extensions/helpers/ResizeHandlers.vue.d.ts +0 -20
  436. package/dist/src/contentManager/components/content-editor/tiptap-extensions/helpers/TopMarginDragger.vue.d.ts +0 -104
  437. package/dist/src/contentManager/components/content-editor/tiptap-menus/BubbleMenuClassBuilder.vue.d.ts +0 -19
  438. package/dist/src/contentManager/components/content-editor/tiptap-menus/BubbleMenuLinkBuilder.vue.d.ts +0 -19
  439. package/dist/src/contentManager/components/content-editor/tiptap-menus/BubbleMenuToggleButton.vue.d.ts +0 -29
  440. package/dist/src/contentManager/components/content-editor/tiptap-menus/DefaultBubbleMenu.vue.d.ts +0 -13
  441. package/dist/src/contentManager/components/content-editor/tiptap-menus/ElementEditorMenu.vue.d.ts +0 -19
  442. package/dist/src/contentManager/components/content-editor/tiptap-menus/EmojiMenu.vue.d.ts +0 -8
  443. package/dist/src/contentManager/components/content-editor/tiptap-menus/NewNodeView.vue.d.ts +0 -47
  444. package/dist/src/contentManager/components/content-editor/tiptap-menus/SlashMenu.vue.d.ts +0 -6
  445. package/dist/src/contentManager/components/content-editor/tiptap-menus/SlashMenuButton.vue.d.ts +0 -17
  446. package/dist/src/contentManager/components/content-editor/tiptap-menus/element-editor-views/ButtonMenu.vue.d.ts +0 -13
  447. package/dist/src/contentManager/components/content-editor/tiptap-menus/element-editor-views/CardMenu.vue.d.ts +0 -13
  448. package/dist/src/contentManager/components/content-editor/tiptap-menus/element-editor-views/ColumnMenu.vue.d.ts +0 -13
  449. package/dist/src/contentManager/components/content-editor/tiptap-menus/element-editor-views/DividerMenu.vue.d.ts +0 -13
  450. package/dist/src/contentManager/components/content-editor/tiptap-menus/element-editor-views/EmptySpaceMenu.vue.d.ts +0 -13
  451. package/dist/src/contentManager/components/content-editor/tiptap-menus/element-editor-views/HeadingMenu.vue.d.ts +0 -13
  452. package/dist/src/contentManager/components/content-editor/tiptap-menus/element-editor-views/ImageMenu.vue.d.ts +0 -13
  453. package/dist/src/contentManager/components/content-editor/tiptap-menus/element-editor-views/MapMenu.vue.d.ts +0 -13
  454. package/dist/src/contentManager/components/content-editor/tiptap-menus/element-editor-views/RowMenu.vue.d.ts +0 -13
  455. package/dist/src/contentManager/components/content-editor/tiptap-menus/element-editor-views/StackMenu.vue.d.ts +0 -13
  456. package/dist/src/contentManager/components/content-editor/tiptap-menus/element-editor-views/TextMenu.vue.d.ts +0 -13
  457. package/dist/src/contentManager/components/content-editor/tiptap-menus/element-editor-views/VideoMenu.vue.d.ts +0 -13
  458. package/dist/src/contentManager/components/overview/CollectionDialog.vue.d.ts +0 -30
  459. package/dist/src/contentManager/components/overview/CollectionsGridView.vue.d.ts +0 -18
  460. package/dist/src/contentManager/components/overview/ContentEntryContextMenu.vue.d.ts +0 -27
  461. package/dist/src/contentManager/components/overview/FilterPopover.vue.d.ts +0 -2
  462. package/dist/src/contentManager/components/overview/ListView.vue.d.ts +0 -12
  463. package/dist/src/contentManager/components/styling/ButtonStyleDialog.vue.d.ts +0 -24
  464. package/dist/src/contentManager/components/styling/CardStyleDialog.vue.d.ts +0 -24
  465. package/dist/src/contentManager/components/styling/SectionStyleDialog.vue.d.ts +0 -24
  466. package/dist/src/contentManager/index.vue.d.ts +0 -22
  467. package/dist/src/contentManager/pages/Components.vue.d.ts +0 -27
  468. package/dist/src/contentManager/pages/ContentEditor.vue.d.ts +0 -14
  469. package/dist/src/contentManager/pages/Entries.vue.d.ts +0 -16
  470. package/dist/src/contentManager/pages/GlobalStyling.vue.d.ts +0 -117
  471. package/dist/src/contentManager/pages/Overview.vue.d.ts +0 -57
  472. package/dist/src/custom/index.vue.d.ts +0 -2
  473. package/dist/src/custom/pages/View.vue.d.ts +0 -2
  474. package/dist/src/googleAnalytics/chat-components/CountryBreakdownCard.vue.d.ts +0 -14
  475. package/dist/src/googleAnalytics/chat-components/DeviceBreakdownCard.vue.d.ts +0 -14
  476. package/dist/src/googleAnalytics/chat-components/PeakHoursCard.vue.d.ts +0 -14
  477. package/dist/src/googleAnalytics/chat-components/RealtimeCard.vue.d.ts +0 -14
  478. package/dist/src/googleAnalytics/chat-components/SearchTermsCard.vue.d.ts +0 -14
  479. package/dist/src/googleAnalytics/chat-components/TopPagesCard.vue.d.ts +0 -14
  480. package/dist/src/googleAnalytics/chat-components/TrafficSourcesCard.vue.d.ts +0 -14
  481. package/dist/src/googleAnalytics/chat-components/VisitorStatsCard.vue.d.ts +0 -14
  482. package/dist/src/googleAnalytics/components/seo-health/SeoClicksChart.vue.d.ts +0 -5
  483. package/dist/src/googleAnalytics/components/seo-health/SeoImpressionsChart.vue.d.ts +0 -5
  484. package/dist/src/googleAnalytics/components/seo-health/SeoKeywordsTab.vue.d.ts +0 -5
  485. package/dist/src/googleAnalytics/components/seo-health/SeoKpiCards.vue.d.ts +0 -10
  486. package/dist/src/googleAnalytics/components/seo-health/SeoMappingTab.vue.d.ts +0 -5
  487. package/dist/src/googleAnalytics/components/seo-health/SeoPagesTab.vue.d.ts +0 -5
  488. package/dist/src/googleAnalytics/components/seo-health/SeoRankingDistribution.vue.d.ts +0 -5
  489. package/dist/src/googleAnalytics/index.vue.d.ts +0 -2
  490. package/dist/src/googleAnalytics/pages/Acquisition.vue.d.ts +0 -2
  491. package/dist/src/googleAnalytics/pages/Audience.vue.d.ts +0 -2
  492. package/dist/src/googleAnalytics/pages/Content.vue.d.ts +0 -2
  493. package/dist/src/googleAnalytics/pages/Overview.vue.d.ts +0 -2
  494. package/dist/src/googleAnalytics/pages/SeoHealth.vue.d.ts +0 -2
  495. package/dist/src/mailTemplates/components/TemplateList.vue.d.ts +0 -2
  496. package/dist/src/mailTemplates/index.vue.d.ts +0 -22
  497. package/dist/src/mailTemplates/pages/Detail.vue.d.ts +0 -14
  498. package/dist/src/mailTemplates/pages/Overview.vue.d.ts +0 -14
  499. package/dist/src/productCollections/components/detail/Main.vue.d.ts +0 -2
  500. package/dist/src/productCollections/components/detail/SEO.vue.d.ts +0 -2
  501. package/dist/src/productCollections/components/detail/Status.vue.d.ts +0 -2
  502. package/dist/src/productCollections/components/overview/ListView.vue.d.ts +0 -12
  503. package/dist/src/productCollections/index.vue.d.ts +0 -22
  504. package/dist/src/productCollections/pages/Detail.vue.d.ts +0 -14
  505. package/dist/src/productCollections/pages/Overview.vue.d.ts +0 -16
  506. package/dist/src/products/chat-components/ProductDetailsCard.vue.d.ts +0 -14
  507. package/dist/src/products/components/detail/Collections.vue.d.ts +0 -14
  508. package/dist/src/products/components/detail/Inventory.vue.d.ts +0 -2
  509. package/dist/src/products/components/detail/Main.vue.d.ts +0 -2
  510. package/dist/src/products/components/detail/NewSection.vue.d.ts +0 -2
  511. package/dist/src/products/components/detail/Price.vue.d.ts +0 -2
  512. package/dist/src/products/components/detail/SEO.vue.d.ts +0 -2
  513. package/dist/src/products/components/detail/Shipping.vue.d.ts +0 -2
  514. package/dist/src/products/components/detail/Status.vue.d.ts +0 -2
  515. package/dist/src/products/components/detail/price/UnitPriceDialog.vue.d.ts +0 -17
  516. package/dist/src/products/components/detail/variants/Option.vue.d.ts +0 -33
  517. package/dist/src/products/components/detail/variants/VariantList.vue.d.ts +0 -38
  518. package/dist/src/products/components/overview/FilterPopover.vue.d.ts +0 -2
  519. package/dist/src/products/components/overview/GridView.vue.d.ts +0 -12
  520. package/dist/src/products/components/overview/ListView.vue.d.ts +0 -12
  521. package/dist/src/products/components/overview/ProductContextMenu.vue.d.ts +0 -27
  522. package/dist/src/products/index.vue.d.ts +0 -22
  523. package/dist/src/products/pages/Detail.vue.d.ts +0 -14
  524. package/dist/src/products/pages/Overview.vue.d.ts +0 -16
  525. package/dist/src/promoCodes/components/create/DateRange.vue.d.ts +0 -2
  526. package/dist/src/promoCodes/components/create/MultiCodes.vue.d.ts +0 -2
  527. package/dist/src/promoCodes/components/create/Note.vue.d.ts +0 -2
  528. package/dist/src/promoCodes/components/create/SingleCode.vue.d.ts +0 -2
  529. package/dist/src/promoCodes/components/create/TypeAndValue/TypeDetailDialog.vue.d.ts +0 -6
  530. package/dist/src/promoCodes/components/create/TypeAndValue/TypeManageDialog.vue.d.ts +0 -18
  531. package/dist/src/promoCodes/components/create/TypeAndValue/index.vue.d.ts +0 -2
  532. package/dist/src/promoCodes/index.vue.d.ts +0 -22
  533. package/dist/src/promoCodes/pages/Create.vue.d.ts +0 -16
  534. package/dist/src/promoCodes/pages/Detail.vue.d.ts +0 -14
  535. package/dist/src/promoCodes/pages/Find.vue.d.ts +0 -16
  536. package/dist/src/push-notifications/components/PreviewAndroid.vue.d.ts +0 -28
  537. package/dist/src/push-notifications/components/PreviewIPhone.vue.d.ts +0 -28
  538. package/dist/src/push-notifications/components/PushPreview.vue.d.ts +0 -28
  539. package/dist/src/push-notifications/index.vue.d.ts +0 -22
  540. package/dist/src/push-notifications/pages/SendPush.vue.d.ts +0 -14
  541. package/dist/src/shared/BrandLogo.vue.d.ts +0 -12
  542. package/dist/src/shared/DrawerToggle.vue.d.ts +0 -60
  543. package/dist/src/shared/VerticalToggle.vue.d.ts +0 -60
  544. package/dist/src/shippingOptions/components/detail/Condition.vue.d.ts +0 -2
  545. package/dist/src/shippingOptions/components/detail/Countries.vue.d.ts +0 -2
  546. package/dist/src/shippingOptions/components/detail/Example.vue.d.ts +0 -2
  547. package/dist/src/shippingOptions/components/detail/Main.vue.d.ts +0 -2
  548. package/dist/src/shippingOptions/components/overview/ListView.vue.d.ts +0 -12
  549. package/dist/src/shippingOptions/index.vue.d.ts +0 -22
  550. package/dist/src/shippingOptions/pages/Detail.vue.d.ts +0 -14
  551. package/dist/src/shippingOptions/pages/Overview.vue.d.ts +0 -16
  552. package/dist/src/table/components/DataTable.vue.d.ts +0 -18
  553. package/dist/src/table/components/DataTableAction.vue.d.ts +0 -14
  554. package/dist/src/table/components/DataTableMobileRowActionDrawer.vue.d.ts +0 -4
  555. package/dist/src/table/components/DataTablePagination.vue.d.ts +0 -6
  556. package/dist/src/table/components/actions/ActionDialog.vue.d.ts +0 -19
  557. package/dist/src/table/components/actions/CtaActionDialog.vue.d.ts +0 -4
  558. package/dist/src/table/components/columns/ColumnDropdown.vue.d.ts +0 -2
  559. package/dist/src/table/components/columns/ColumnEditorDialog.vue.d.ts +0 -34
  560. package/dist/src/table/components/columns/DialogTableColumnItem.vue.d.ts +0 -12
  561. package/dist/src/table/components/date-range-filter/DateRangeFilter.vue.d.ts +0 -2
  562. package/dist/src/table/components/date-range-filter/DateRangeSettingsDialog.vue.d.ts +0 -27
  563. package/dist/src/table/components/filters/FilterDialog.vue.d.ts +0 -12
  564. package/dist/src/table/components/filters/Filters.vue.d.ts +0 -27
  565. package/dist/src/table/components/search/Search.vue.d.ts +0 -2
  566. package/dist/src/table/components/sort/SortMode.vue.d.ts +0 -2
  567. package/dist/src/table/components/sort/SortModeSettingsDialog.vue.d.ts +0 -18
  568. package/dist/src/table/components/stats/StatDialog.vue.d.ts +0 -12
  569. package/dist/src/table/components/stats/Stats.vue.d.ts +0 -27
  570. package/dist/src/table/flow-builder-extensions/TableRowEditor.vue.d.ts +0 -16
  571. package/dist/src/table/index.vue.d.ts +0 -22
  572. package/dist/src/table/pages/TableView.vue.d.ts +0 -54
  573. package/dist/utils-CanmrIWO.mjs +0 -47
  574. package/dist/utils-Yd6F5mea.js +0 -3
  575. package/dist/vee-validate-zod-ByykgYKJ.js +0 -1
  576. package/dist/vee-validate-zod-CcOwoF6y.mjs +0 -4402
@@ -0,0 +1,4757 @@
1
+ import { a as e, n as t, t as n } from "./DateFormatter-DLrDYkby.mjs";
2
+ import { t as r } from "./_plugin-vue_export-helper-BJQSo0im.mjs";
3
+ import { i, n as a, r as o, t as s } from "./utils-h3owcMtS.mjs";
4
+ import { n as c } from "./core-Dhgr4ctC.mjs";
5
+ import { t as l } from "./interpolation-B8OzkMyi.mjs";
6
+ import { useFirebaseIntegration as u, useFlowBuilder as d, useModuleBreadcrumbs as f, useModulePermissions as p, useModuleRoute as m, useModuleStorage as h, useProjectSettings as g } from "@oneclick.dev/cms-kit";
7
+ import { Fragment as _, computed as v, createBlock as y, createCommentVNode as b, createElementBlock as x, createElementVNode as S, createTextVNode as C, createVNode as w, defineComponent as T, h as E, inject as D, isRef as O, markRaw as k, nextTick as A, normalizeClass as j, onBeforeUnmount as M, onMounted as N, openBlock as P, provide as F, reactive as I, ref as L, renderList as R, resolveComponent as z, resolveDynamicComponent as B, shallowRef as ee, toDisplayString as V, unref as H, useTemplateRef as te, watch as U, watchEffect as W, withCtx as G, withModifiers as K } from "vue";
8
+ import { ArrowUpDown as ne, CalendarIcon as re, Check as ie, ChevronDown as ae, ChevronLeft as oe, ChevronRight as se, ChevronUp as ce, ChevronsLeft as le, ChevronsRight as ue, Info as de, MousePointerClick as fe, Plus as q, Table2 as pe, Trash2 as me, X as he, icons as ge } from "@lucide/vue";
9
+ import { animations as _e } from "@formkit/drag-and-drop";
10
+ import ve from "@oneclick.dev/cms-kit/components";
11
+ import { Handle as ye, NodeContextMenu as be, NodeToolbarWrapper as xe, Position as Se, nodeProps as Ce } from "@oneclick.dev/cms-kit/flow-builder";
12
+ //#region ../node_modules/.pnpm/@tanstack+table-core@8.21.3/node_modules/@tanstack/table-core/build/lib/index.mjs
13
+ function we(e, t) {
14
+ return typeof e == "function" ? e(t) : e;
15
+ }
16
+ function J(e, t) {
17
+ return (n) => {
18
+ t.setState((t) => ({
19
+ ...t,
20
+ [e]: we(n, t[e])
21
+ }));
22
+ };
23
+ }
24
+ function Te(e) {
25
+ return e instanceof Function;
26
+ }
27
+ function Ee(e) {
28
+ return Array.isArray(e) && e.every((e) => typeof e == "number");
29
+ }
30
+ function De(e, t) {
31
+ let n = [], r = (e) => {
32
+ e.forEach((e) => {
33
+ n.push(e);
34
+ let i = t(e);
35
+ i != null && i.length && r(i);
36
+ });
37
+ };
38
+ return r(e), n;
39
+ }
40
+ function Y(e, t, n) {
41
+ let r = [], i;
42
+ return (a) => {
43
+ let o;
44
+ n.key && n.debug && (o = Date.now());
45
+ let s = e(a);
46
+ if (!(s.length !== r.length || s.some((e, t) => r[t] !== e))) return i;
47
+ r = s;
48
+ let c;
49
+ if (n.key && n.debug && (c = Date.now()), i = t(...s), n == null || n.onChange == null || n.onChange(i), n.key && n.debug && n != null && n.debug()) {
50
+ let e = Math.round((Date.now() - o) * 100) / 100, t = Math.round((Date.now() - c) * 100) / 100, r = t / 16, i = (e, t) => {
51
+ for (e = String(e); e.length < t;) e = " " + e;
52
+ return e;
53
+ };
54
+ console.info(`%c⏱ ${i(t, 5)} /${i(e, 5)} ms`, `
55
+ font-size: .6rem;
56
+ font-weight: bold;
57
+ color: hsl(${Math.max(0, Math.min(120 - 120 * r, 120))}deg 100% 31%);`, n?.key);
58
+ }
59
+ return i;
60
+ };
61
+ }
62
+ function X(e, t, n, r) {
63
+ return {
64
+ debug: () => e?.debugAll ?? e[t],
65
+ key: process.env.NODE_ENV === "development" && n,
66
+ onChange: r
67
+ };
68
+ }
69
+ function Oe(e, t, n, r) {
70
+ let i = {
71
+ id: `${t.id}_${n.id}`,
72
+ row: t,
73
+ column: n,
74
+ getValue: () => t.getValue(r),
75
+ renderValue: () => i.getValue() ?? e.options.renderFallbackValue,
76
+ getContext: Y(() => [
77
+ e,
78
+ n,
79
+ t,
80
+ i
81
+ ], (e, t, n, r) => ({
82
+ table: e,
83
+ column: t,
84
+ row: n,
85
+ cell: r,
86
+ getValue: r.getValue,
87
+ renderValue: r.renderValue
88
+ }), X(e.options, "debugCells", "cell.getContext"))
89
+ };
90
+ return e._features.forEach((r) => {
91
+ r.createCell == null || r.createCell(i, n, t, e);
92
+ }, {}), i;
93
+ }
94
+ function ke(e, t, n, r) {
95
+ let i = {
96
+ ...e._getDefaultColumnDef(),
97
+ ...t
98
+ }, a = i.accessorKey, o = i.id ?? (a ? typeof String.prototype.replaceAll == "function" ? a.replaceAll(".", "_") : a.replace(/\./g, "_") : void 0) ?? (typeof i.header == "string" ? i.header : void 0), s;
99
+ if (i.accessorFn ? s = i.accessorFn : a && (s = a.includes(".") ? (e) => {
100
+ let t = e;
101
+ for (let e of a.split(".")) t = t?.[e], process.env.NODE_ENV !== "production" && t === void 0 && console.warn(`"${e}" in deeply nested key "${a}" returned undefined.`);
102
+ return t;
103
+ } : (e) => e[i.accessorKey]), !o) throw process.env.NODE_ENV === "production" ? Error() : Error(i.accessorFn ? "Columns require an id when using an accessorFn" : "Columns require an id when using a non-string header");
104
+ let c = {
105
+ id: `${String(o)}`,
106
+ accessorFn: s,
107
+ parent: r,
108
+ depth: n,
109
+ columnDef: i,
110
+ columns: [],
111
+ getFlatColumns: Y(() => [!0], () => [c, ...c.columns?.flatMap((e) => e.getFlatColumns())], X(e.options, "debugColumns", "column.getFlatColumns")),
112
+ getLeafColumns: Y(() => [e._getOrderColumnsFn()], (e) => {
113
+ var t;
114
+ return (t = c.columns) != null && t.length ? e(c.columns.flatMap((e) => e.getLeafColumns())) : [c];
115
+ }, X(e.options, "debugColumns", "column.getLeafColumns"))
116
+ };
117
+ for (let t of e._features) t.createColumn == null || t.createColumn(c, e);
118
+ return c;
119
+ }
120
+ var Z = "debugHeaders";
121
+ function Ae(e, t, n) {
122
+ let r = {
123
+ id: n.id ?? t.id,
124
+ column: t,
125
+ index: n.index,
126
+ isPlaceholder: !!n.isPlaceholder,
127
+ placeholderId: n.placeholderId,
128
+ depth: n.depth,
129
+ subHeaders: [],
130
+ colSpan: 0,
131
+ rowSpan: 0,
132
+ headerGroup: null,
133
+ getLeafHeaders: () => {
134
+ let e = [], t = (n) => {
135
+ n.subHeaders && n.subHeaders.length && n.subHeaders.map(t), e.push(n);
136
+ };
137
+ return t(r), e;
138
+ },
139
+ getContext: () => ({
140
+ table: e,
141
+ header: r,
142
+ column: t
143
+ })
144
+ };
145
+ return e._features.forEach((t) => {
146
+ t.createHeader == null || t.createHeader(r, e);
147
+ }), r;
148
+ }
149
+ var je = { createTable: (e) => {
150
+ e.getHeaderGroups = Y(() => [
151
+ e.getAllColumns(),
152
+ e.getVisibleLeafColumns(),
153
+ e.getState().columnPinning.left,
154
+ e.getState().columnPinning.right
155
+ ], (t, n, r, i) => {
156
+ let a = r?.map((e) => n.find((t) => t.id === e)).filter(Boolean) ?? [], o = i?.map((e) => n.find((t) => t.id === e)).filter(Boolean) ?? [], s = n.filter((e) => !(r != null && r.includes(e.id)) && !(i != null && i.includes(e.id)));
157
+ return Me(t, [
158
+ ...a,
159
+ ...s,
160
+ ...o
161
+ ], e);
162
+ }, X(e.options, Z, "getHeaderGroups")), e.getCenterHeaderGroups = Y(() => [
163
+ e.getAllColumns(),
164
+ e.getVisibleLeafColumns(),
165
+ e.getState().columnPinning.left,
166
+ e.getState().columnPinning.right
167
+ ], (t, n, r, i) => (n = n.filter((e) => !(r != null && r.includes(e.id)) && !(i != null && i.includes(e.id))), Me(t, n, e, "center")), X(e.options, Z, "getCenterHeaderGroups")), e.getLeftHeaderGroups = Y(() => [
168
+ e.getAllColumns(),
169
+ e.getVisibleLeafColumns(),
170
+ e.getState().columnPinning.left
171
+ ], (t, n, r) => Me(t, r?.map((e) => n.find((t) => t.id === e)).filter(Boolean) ?? [], e, "left"), X(e.options, Z, "getLeftHeaderGroups")), e.getRightHeaderGroups = Y(() => [
172
+ e.getAllColumns(),
173
+ e.getVisibleLeafColumns(),
174
+ e.getState().columnPinning.right
175
+ ], (t, n, r) => Me(t, r?.map((e) => n.find((t) => t.id === e)).filter(Boolean) ?? [], e, "right"), X(e.options, Z, "getRightHeaderGroups")), e.getFooterGroups = Y(() => [e.getHeaderGroups()], (e) => [...e].reverse(), X(e.options, Z, "getFooterGroups")), e.getLeftFooterGroups = Y(() => [e.getLeftHeaderGroups()], (e) => [...e].reverse(), X(e.options, Z, "getLeftFooterGroups")), e.getCenterFooterGroups = Y(() => [e.getCenterHeaderGroups()], (e) => [...e].reverse(), X(e.options, Z, "getCenterFooterGroups")), e.getRightFooterGroups = Y(() => [e.getRightHeaderGroups()], (e) => [...e].reverse(), X(e.options, Z, "getRightFooterGroups")), e.getFlatHeaders = Y(() => [e.getHeaderGroups()], (e) => e.map((e) => e.headers).flat(), X(e.options, Z, "getFlatHeaders")), e.getLeftFlatHeaders = Y(() => [e.getLeftHeaderGroups()], (e) => e.map((e) => e.headers).flat(), X(e.options, Z, "getLeftFlatHeaders")), e.getCenterFlatHeaders = Y(() => [e.getCenterHeaderGroups()], (e) => e.map((e) => e.headers).flat(), X(e.options, Z, "getCenterFlatHeaders")), e.getRightFlatHeaders = Y(() => [e.getRightHeaderGroups()], (e) => e.map((e) => e.headers).flat(), X(e.options, Z, "getRightFlatHeaders")), e.getCenterLeafHeaders = Y(() => [e.getCenterFlatHeaders()], (e) => e.filter((e) => {
176
+ var t;
177
+ return !((t = e.subHeaders) != null && t.length);
178
+ }), X(e.options, Z, "getCenterLeafHeaders")), e.getLeftLeafHeaders = Y(() => [e.getLeftFlatHeaders()], (e) => e.filter((e) => {
179
+ var t;
180
+ return !((t = e.subHeaders) != null && t.length);
181
+ }), X(e.options, Z, "getLeftLeafHeaders")), e.getRightLeafHeaders = Y(() => [e.getRightFlatHeaders()], (e) => e.filter((e) => {
182
+ var t;
183
+ return !((t = e.subHeaders) != null && t.length);
184
+ }), X(e.options, Z, "getRightLeafHeaders")), e.getLeafHeaders = Y(() => [
185
+ e.getLeftHeaderGroups(),
186
+ e.getCenterHeaderGroups(),
187
+ e.getRightHeaderGroups()
188
+ ], (e, t, n) => [
189
+ ...e[0]?.headers ?? [],
190
+ ...t[0]?.headers ?? [],
191
+ ...n[0]?.headers ?? []
192
+ ].map((e) => e.getLeafHeaders()).flat(), X(e.options, Z, "getLeafHeaders"));
193
+ } };
194
+ function Me(e, t, n, r) {
195
+ let i = 0, a = function(e, t) {
196
+ t === void 0 && (t = 1), i = Math.max(i, t), e.filter((e) => e.getIsVisible()).forEach((e) => {
197
+ var n;
198
+ (n = e.columns) != null && n.length && a(e.columns, t + 1);
199
+ }, 0);
200
+ };
201
+ a(e);
202
+ let o = [], s = (e, t) => {
203
+ let i = {
204
+ depth: t,
205
+ id: [r, `${t}`].filter(Boolean).join("_"),
206
+ headers: []
207
+ }, a = [];
208
+ e.forEach((e) => {
209
+ let o = [...a].reverse()[0], s = e.column.depth === i.depth, c, l = !1;
210
+ if (s && e.column.parent ? c = e.column.parent : (c = e.column, l = !0), o && o?.column === c) o.subHeaders.push(e);
211
+ else {
212
+ let i = Ae(n, c, {
213
+ id: [
214
+ r,
215
+ t,
216
+ c.id,
217
+ e?.id
218
+ ].filter(Boolean).join("_"),
219
+ isPlaceholder: l,
220
+ placeholderId: l ? `${a.filter((e) => e.column === c).length}` : void 0,
221
+ depth: t,
222
+ index: a.length
223
+ });
224
+ i.subHeaders.push(e), a.push(i);
225
+ }
226
+ i.headers.push(e), e.headerGroup = i;
227
+ }), o.push(i), t > 0 && s(a, t - 1);
228
+ };
229
+ s(t.map((e, t) => Ae(n, e, {
230
+ depth: i,
231
+ index: t
232
+ })), i - 1), o.reverse();
233
+ let c = (e) => e.filter((e) => e.column.getIsVisible()).map((e) => {
234
+ let t = 0, n = 0, r = [0];
235
+ e.subHeaders && e.subHeaders.length ? (r = [], c(e.subHeaders).forEach((e) => {
236
+ let { colSpan: n, rowSpan: i } = e;
237
+ t += n, r.push(i);
238
+ })) : t = 1;
239
+ let i = Math.min(...r);
240
+ return n += i, e.colSpan = t, e.rowSpan = n, {
241
+ colSpan: t,
242
+ rowSpan: n
243
+ };
244
+ });
245
+ return c(o[0]?.headers ?? []), o;
246
+ }
247
+ var Ne = (e, t, n, r, i, a, o) => {
248
+ let s = {
249
+ id: t,
250
+ index: r,
251
+ original: n,
252
+ depth: i,
253
+ parentId: o,
254
+ _valuesCache: {},
255
+ _uniqueValuesCache: {},
256
+ getValue: (t) => {
257
+ if (s._valuesCache.hasOwnProperty(t)) return s._valuesCache[t];
258
+ let n = e.getColumn(t);
259
+ if (n != null && n.accessorFn) return s._valuesCache[t] = n.accessorFn(s.original, r), s._valuesCache[t];
260
+ },
261
+ getUniqueValues: (t) => {
262
+ if (s._uniqueValuesCache.hasOwnProperty(t)) return s._uniqueValuesCache[t];
263
+ let n = e.getColumn(t);
264
+ if (n != null && n.accessorFn) return n.columnDef.getUniqueValues ? (s._uniqueValuesCache[t] = n.columnDef.getUniqueValues(s.original, r), s._uniqueValuesCache[t]) : (s._uniqueValuesCache[t] = [s.getValue(t)], s._uniqueValuesCache[t]);
265
+ },
266
+ renderValue: (t) => s.getValue(t) ?? e.options.renderFallbackValue,
267
+ subRows: a ?? [],
268
+ getLeafRows: () => De(s.subRows, (e) => e.subRows),
269
+ getParentRow: () => s.parentId ? e.getRow(s.parentId, !0) : void 0,
270
+ getParentRows: () => {
271
+ let e = [], t = s;
272
+ for (;;) {
273
+ let n = t.getParentRow();
274
+ if (!n) break;
275
+ e.push(n), t = n;
276
+ }
277
+ return e.reverse();
278
+ },
279
+ getAllCells: Y(() => [e.getAllLeafColumns()], (t) => t.map((t) => Oe(e, s, t, t.id)), X(e.options, "debugRows", "getAllCells")),
280
+ _getAllCellsByColumnId: Y(() => [s.getAllCells()], (e) => e.reduce((e, t) => (e[t.column.id] = t, e), {}), X(e.options, "debugRows", "getAllCellsByColumnId"))
281
+ };
282
+ for (let t = 0; t < e._features.length; t++) {
283
+ let n = e._features[t];
284
+ n == null || n.createRow == null || n.createRow(s, e);
285
+ }
286
+ return s;
287
+ }, Pe = { createColumn: (e, t) => {
288
+ e._getFacetedRowModel = t.options.getFacetedRowModel && t.options.getFacetedRowModel(t, e.id), e.getFacetedRowModel = () => e._getFacetedRowModel ? e._getFacetedRowModel() : t.getPreFilteredRowModel(), e._getFacetedUniqueValues = t.options.getFacetedUniqueValues && t.options.getFacetedUniqueValues(t, e.id), e.getFacetedUniqueValues = () => e._getFacetedUniqueValues ? e._getFacetedUniqueValues() : /* @__PURE__ */ new Map(), e._getFacetedMinMaxValues = t.options.getFacetedMinMaxValues && t.options.getFacetedMinMaxValues(t, e.id), e.getFacetedMinMaxValues = () => {
289
+ if (e._getFacetedMinMaxValues) return e._getFacetedMinMaxValues();
290
+ };
291
+ } }, Fe = (e, t, n) => {
292
+ var r, i;
293
+ let a = n == null || (r = n.toString()) == null ? void 0 : r.toLowerCase();
294
+ return !!(!((i = e.getValue(t)) == null || (i = i.toString()) == null || (i = i.toLowerCase()) == null) && i.includes(a));
295
+ };
296
+ Fe.autoRemove = (e) => Q(e);
297
+ var Ie = (e, t, n) => {
298
+ var r;
299
+ return !!(!((r = e.getValue(t)) == null || (r = r.toString()) == null) && r.includes(n));
300
+ };
301
+ Ie.autoRemove = (e) => Q(e);
302
+ var Le = (e, t, n) => {
303
+ var r;
304
+ return ((r = e.getValue(t)) == null || (r = r.toString()) == null ? void 0 : r.toLowerCase()) === n?.toLowerCase();
305
+ };
306
+ Le.autoRemove = (e) => Q(e);
307
+ var Re = (e, t, n) => e.getValue(t)?.includes(n);
308
+ Re.autoRemove = (e) => Q(e);
309
+ var ze = (e, t, n) => !n.some((n) => {
310
+ var r;
311
+ return !((r = e.getValue(t)) != null && r.includes(n));
312
+ });
313
+ ze.autoRemove = (e) => Q(e) || !(e != null && e.length);
314
+ var Be = (e, t, n) => n.some((n) => e.getValue(t)?.includes(n));
315
+ Be.autoRemove = (e) => Q(e) || !(e != null && e.length);
316
+ var Ve = (e, t, n) => e.getValue(t) === n;
317
+ Ve.autoRemove = (e) => Q(e);
318
+ var He = (e, t, n) => e.getValue(t) == n;
319
+ He.autoRemove = (e) => Q(e);
320
+ var Ue = (e, t, n) => {
321
+ let [r, i] = n, a = e.getValue(t);
322
+ return a >= r && a <= i;
323
+ };
324
+ Ue.resolveFilterValue = (e) => {
325
+ let [t, n] = e, r = typeof t == "number" ? t : parseFloat(t), i = typeof n == "number" ? n : parseFloat(n), a = t === null || Number.isNaN(r) ? -Infinity : r, o = n === null || Number.isNaN(i) ? Infinity : i;
326
+ if (a > o) {
327
+ let e = a;
328
+ a = o, o = e;
329
+ }
330
+ return [a, o];
331
+ }, Ue.autoRemove = (e) => Q(e) || Q(e[0]) && Q(e[1]);
332
+ var We = {
333
+ includesString: Fe,
334
+ includesStringSensitive: Ie,
335
+ equalsString: Le,
336
+ arrIncludes: Re,
337
+ arrIncludesAll: ze,
338
+ arrIncludesSome: Be,
339
+ equals: Ve,
340
+ weakEquals: He,
341
+ inNumberRange: Ue
342
+ };
343
+ function Q(e) {
344
+ return e == null || e === "";
345
+ }
346
+ var Ge = {
347
+ getDefaultColumnDef: () => ({ filterFn: "auto" }),
348
+ getInitialState: (e) => ({
349
+ columnFilters: [],
350
+ ...e
351
+ }),
352
+ getDefaultOptions: (e) => ({
353
+ onColumnFiltersChange: J("columnFilters", e),
354
+ filterFromLeafRows: !1,
355
+ maxLeafRowFilterDepth: 100
356
+ }),
357
+ createColumn: (e, t) => {
358
+ e.getAutoFilterFn = () => {
359
+ let n = t.getCoreRowModel().flatRows[0]?.getValue(e.id);
360
+ return typeof n == "string" ? We.includesString : typeof n == "number" ? We.inNumberRange : typeof n == "boolean" || typeof n == "object" && n ? We.equals : Array.isArray(n) ? We.arrIncludes : We.weakEquals;
361
+ }, e.getFilterFn = () => Te(e.columnDef.filterFn) ? e.columnDef.filterFn : e.columnDef.filterFn === "auto" ? e.getAutoFilterFn() : t.options.filterFns?.[e.columnDef.filterFn] ?? We[e.columnDef.filterFn], e.getCanFilter = () => (e.columnDef.enableColumnFilter ?? !0) && (t.options.enableColumnFilters ?? !0) && (t.options.enableFilters ?? !0) && !!e.accessorFn, e.getIsFiltered = () => e.getFilterIndex() > -1, e.getFilterValue = () => {
362
+ var n;
363
+ return (n = t.getState().columnFilters) == null || (n = n.find((t) => t.id === e.id)) == null ? void 0 : n.value;
364
+ }, e.getFilterIndex = () => t.getState().columnFilters?.findIndex((t) => t.id === e.id) ?? -1, e.setFilterValue = (n) => {
365
+ t.setColumnFilters((t) => {
366
+ let r = e.getFilterFn(), i = t?.find((t) => t.id === e.id), a = we(n, i ? i.value : void 0);
367
+ if (Ke(r, a, e)) return t?.filter((t) => t.id !== e.id) ?? [];
368
+ let o = {
369
+ id: e.id,
370
+ value: a
371
+ };
372
+ return i ? t?.map((t) => t.id === e.id ? o : t) ?? [] : t != null && t.length ? [...t, o] : [o];
373
+ });
374
+ };
375
+ },
376
+ createRow: (e, t) => {
377
+ e.columnFilters = {}, e.columnFiltersMeta = {};
378
+ },
379
+ createTable: (e) => {
380
+ e.setColumnFilters = (t) => {
381
+ let n = e.getAllLeafColumns();
382
+ e.options.onColumnFiltersChange == null || e.options.onColumnFiltersChange((e) => we(t, e)?.filter((e) => {
383
+ let t = n.find((t) => t.id === e.id);
384
+ return !(t && Ke(t.getFilterFn(), e.value, t));
385
+ }));
386
+ }, e.resetColumnFilters = (t) => {
387
+ e.setColumnFilters(t ? [] : e.initialState?.columnFilters ?? []);
388
+ }, e.getPreFilteredRowModel = () => e.getCoreRowModel(), e.getFilteredRowModel = () => (!e._getFilteredRowModel && e.options.getFilteredRowModel && (e._getFilteredRowModel = e.options.getFilteredRowModel(e)), e.options.manualFiltering || !e._getFilteredRowModel ? e.getPreFilteredRowModel() : e._getFilteredRowModel());
389
+ }
390
+ };
391
+ function Ke(e, t, n) {
392
+ return (e && e.autoRemove ? e.autoRemove(t, n) : !1) || t === void 0 || typeof t == "string" && !t;
393
+ }
394
+ var qe = {
395
+ sum: (e, t, n) => n.reduce((t, n) => {
396
+ let r = n.getValue(e);
397
+ return t + (typeof r == "number" ? r : 0);
398
+ }, 0),
399
+ min: (e, t, n) => {
400
+ let r;
401
+ return n.forEach((t) => {
402
+ let n = t.getValue(e);
403
+ n != null && (r > n || r === void 0 && n >= n) && (r = n);
404
+ }), r;
405
+ },
406
+ max: (e, t, n) => {
407
+ let r;
408
+ return n.forEach((t) => {
409
+ let n = t.getValue(e);
410
+ n != null && (r < n || r === void 0 && n >= n) && (r = n);
411
+ }), r;
412
+ },
413
+ extent: (e, t, n) => {
414
+ let r, i;
415
+ return n.forEach((t) => {
416
+ let n = t.getValue(e);
417
+ n != null && (r === void 0 ? n >= n && (r = i = n) : (r > n && (r = n), i < n && (i = n)));
418
+ }), [r, i];
419
+ },
420
+ mean: (e, t) => {
421
+ let n = 0, r = 0;
422
+ if (t.forEach((t) => {
423
+ let i = t.getValue(e);
424
+ i != null && (i = +i) >= i && (++n, r += i);
425
+ }), n) return r / n;
426
+ },
427
+ median: (e, t) => {
428
+ if (!t.length) return;
429
+ let n = t.map((t) => t.getValue(e));
430
+ if (!Ee(n)) return;
431
+ if (n.length === 1) return n[0];
432
+ let r = Math.floor(n.length / 2), i = n.sort((e, t) => e - t);
433
+ return n.length % 2 == 0 ? (i[r - 1] + i[r]) / 2 : i[r];
434
+ },
435
+ unique: (e, t) => Array.from(new Set(t.map((t) => t.getValue(e))).values()),
436
+ uniqueCount: (e, t) => new Set(t.map((t) => t.getValue(e))).size,
437
+ count: (e, t) => t.length
438
+ }, Je = {
439
+ getDefaultColumnDef: () => ({
440
+ aggregatedCell: (e) => {
441
+ var t;
442
+ return ((t = e.getValue()) == null || t.toString == null ? void 0 : t.toString()) ?? null;
443
+ },
444
+ aggregationFn: "auto"
445
+ }),
446
+ getInitialState: (e) => ({
447
+ grouping: [],
448
+ ...e
449
+ }),
450
+ getDefaultOptions: (e) => ({
451
+ onGroupingChange: J("grouping", e),
452
+ groupedColumnMode: "reorder"
453
+ }),
454
+ createColumn: (e, t) => {
455
+ e.toggleGrouping = () => {
456
+ t.setGrouping((t) => t != null && t.includes(e.id) ? t.filter((t) => t !== e.id) : [...t ?? [], e.id]);
457
+ }, e.getCanGroup = () => (e.columnDef.enableGrouping ?? !0) && (t.options.enableGrouping ?? !0) && (!!e.accessorFn || !!e.columnDef.getGroupingValue), e.getIsGrouped = () => t.getState().grouping?.includes(e.id), e.getGroupedIndex = () => t.getState().grouping?.indexOf(e.id), e.getToggleGroupingHandler = () => {
458
+ let t = e.getCanGroup();
459
+ return () => {
460
+ t && e.toggleGrouping();
461
+ };
462
+ }, e.getAutoAggregationFn = () => {
463
+ let n = t.getCoreRowModel().flatRows[0]?.getValue(e.id);
464
+ if (typeof n == "number") return qe.sum;
465
+ if (Object.prototype.toString.call(n) === "[object Date]") return qe.extent;
466
+ }, e.getAggregationFn = () => {
467
+ if (!e) throw Error();
468
+ return Te(e.columnDef.aggregationFn) ? e.columnDef.aggregationFn : e.columnDef.aggregationFn === "auto" ? e.getAutoAggregationFn() : t.options.aggregationFns?.[e.columnDef.aggregationFn] ?? qe[e.columnDef.aggregationFn];
469
+ };
470
+ },
471
+ createTable: (e) => {
472
+ e.setGrouping = (t) => e.options.onGroupingChange == null ? void 0 : e.options.onGroupingChange(t), e.resetGrouping = (t) => {
473
+ e.setGrouping(t ? [] : e.initialState?.grouping ?? []);
474
+ }, e.getPreGroupedRowModel = () => e.getFilteredRowModel(), e.getGroupedRowModel = () => (!e._getGroupedRowModel && e.options.getGroupedRowModel && (e._getGroupedRowModel = e.options.getGroupedRowModel(e)), e.options.manualGrouping || !e._getGroupedRowModel ? e.getPreGroupedRowModel() : e._getGroupedRowModel());
475
+ },
476
+ createRow: (e, t) => {
477
+ e.getIsGrouped = () => !!e.groupingColumnId, e.getGroupingValue = (n) => {
478
+ if (e._groupingValuesCache.hasOwnProperty(n)) return e._groupingValuesCache[n];
479
+ let r = t.getColumn(n);
480
+ return r != null && r.columnDef.getGroupingValue ? (e._groupingValuesCache[n] = r.columnDef.getGroupingValue(e.original), e._groupingValuesCache[n]) : e.getValue(n);
481
+ }, e._groupingValuesCache = {};
482
+ },
483
+ createCell: (e, t, n, r) => {
484
+ e.getIsGrouped = () => t.getIsGrouped() && t.id === n.groupingColumnId, e.getIsPlaceholder = () => !e.getIsGrouped() && t.getIsGrouped(), e.getIsAggregated = () => {
485
+ var t;
486
+ return !e.getIsGrouped() && !e.getIsPlaceholder() && !!((t = n.subRows) != null && t.length);
487
+ };
488
+ }
489
+ };
490
+ function Ye(e, t, n) {
491
+ if (!(t != null && t.length) || !n) return e;
492
+ let r = e.filter((e) => !t.includes(e.id));
493
+ return n === "remove" ? r : [...t.map((t) => e.find((e) => e.id === t)).filter(Boolean), ...r];
494
+ }
495
+ var Xe = {
496
+ getInitialState: (e) => ({
497
+ columnOrder: [],
498
+ ...e
499
+ }),
500
+ getDefaultOptions: (e) => ({ onColumnOrderChange: J("columnOrder", e) }),
501
+ createColumn: (e, t) => {
502
+ e.getIndex = Y((e) => [st(t, e)], (t) => t.findIndex((t) => t.id === e.id), X(t.options, "debugColumns", "getIndex")), e.getIsFirstColumn = (n) => st(t, n)[0]?.id === e.id, e.getIsLastColumn = (n) => {
503
+ let r = st(t, n);
504
+ return r[r.length - 1]?.id === e.id;
505
+ };
506
+ },
507
+ createTable: (e) => {
508
+ e.setColumnOrder = (t) => e.options.onColumnOrderChange == null ? void 0 : e.options.onColumnOrderChange(t), e.resetColumnOrder = (t) => {
509
+ e.setColumnOrder(t ? [] : e.initialState.columnOrder ?? []);
510
+ }, e._getOrderColumnsFn = Y(() => [
511
+ e.getState().columnOrder,
512
+ e.getState().grouping,
513
+ e.options.groupedColumnMode
514
+ ], (e, t, n) => (r) => {
515
+ let i = [];
516
+ if (!(e != null && e.length)) i = r;
517
+ else {
518
+ let t = [...e], n = [...r];
519
+ for (; n.length && t.length;) {
520
+ let e = t.shift(), r = n.findIndex((t) => t.id === e);
521
+ r > -1 && i.push(n.splice(r, 1)[0]);
522
+ }
523
+ i = [...i, ...n];
524
+ }
525
+ return Ye(i, t, n);
526
+ }, X(e.options, "debugTable", "_getOrderColumnsFn"));
527
+ }
528
+ }, Ze = () => ({
529
+ left: [],
530
+ right: []
531
+ }), Qe = {
532
+ getInitialState: (e) => ({
533
+ columnPinning: Ze(),
534
+ ...e
535
+ }),
536
+ getDefaultOptions: (e) => ({ onColumnPinningChange: J("columnPinning", e) }),
537
+ createColumn: (e, t) => {
538
+ e.pin = (n) => {
539
+ let r = e.getLeafColumns().map((e) => e.id).filter(Boolean);
540
+ t.setColumnPinning((e) => n === "right" ? {
541
+ left: (e?.left ?? []).filter((e) => !(r != null && r.includes(e))),
542
+ right: [...(e?.right ?? []).filter((e) => !(r != null && r.includes(e))), ...r]
543
+ } : n === "left" ? {
544
+ left: [...(e?.left ?? []).filter((e) => !(r != null && r.includes(e))), ...r],
545
+ right: (e?.right ?? []).filter((e) => !(r != null && r.includes(e)))
546
+ } : {
547
+ left: (e?.left ?? []).filter((e) => !(r != null && r.includes(e))),
548
+ right: (e?.right ?? []).filter((e) => !(r != null && r.includes(e)))
549
+ });
550
+ }, e.getCanPin = () => e.getLeafColumns().some((e) => (e.columnDef.enablePinning ?? !0) && (t.options.enableColumnPinning ?? t.options.enablePinning ?? !0)), e.getIsPinned = () => {
551
+ let n = e.getLeafColumns().map((e) => e.id), { left: r, right: i } = t.getState().columnPinning, a = n.some((e) => r?.includes(e)), o = n.some((e) => i?.includes(e));
552
+ return a ? "left" : o ? "right" : !1;
553
+ }, e.getPinnedIndex = () => {
554
+ var n;
555
+ let r = e.getIsPinned();
556
+ return r ? ((n = t.getState().columnPinning) == null || (n = n[r]) == null ? void 0 : n.indexOf(e.id)) ?? -1 : 0;
557
+ };
558
+ },
559
+ createRow: (e, t) => {
560
+ e.getCenterVisibleCells = Y(() => [
561
+ e._getAllVisibleCells(),
562
+ t.getState().columnPinning.left,
563
+ t.getState().columnPinning.right
564
+ ], (e, t, n) => {
565
+ let r = [...t ?? [], ...n ?? []];
566
+ return e.filter((e) => !r.includes(e.column.id));
567
+ }, X(t.options, "debugRows", "getCenterVisibleCells")), e.getLeftVisibleCells = Y(() => [e._getAllVisibleCells(), t.getState().columnPinning.left], (e, t) => (t ?? []).map((t) => e.find((e) => e.column.id === t)).filter(Boolean).map((e) => ({
568
+ ...e,
569
+ position: "left"
570
+ })), X(t.options, "debugRows", "getLeftVisibleCells")), e.getRightVisibleCells = Y(() => [e._getAllVisibleCells(), t.getState().columnPinning.right], (e, t) => (t ?? []).map((t) => e.find((e) => e.column.id === t)).filter(Boolean).map((e) => ({
571
+ ...e,
572
+ position: "right"
573
+ })), X(t.options, "debugRows", "getRightVisibleCells"));
574
+ },
575
+ createTable: (e) => {
576
+ e.setColumnPinning = (t) => e.options.onColumnPinningChange == null ? void 0 : e.options.onColumnPinningChange(t), e.resetColumnPinning = (t) => e.setColumnPinning(t ? Ze() : e.initialState?.columnPinning ?? Ze()), e.getIsSomeColumnsPinned = (t) => {
577
+ let n = e.getState().columnPinning;
578
+ return t ? !!n[t]?.length : !!(n.left?.length || n.right?.length);
579
+ }, e.getLeftLeafColumns = Y(() => [e.getAllLeafColumns(), e.getState().columnPinning.left], (e, t) => (t ?? []).map((t) => e.find((e) => e.id === t)).filter(Boolean), X(e.options, "debugColumns", "getLeftLeafColumns")), e.getRightLeafColumns = Y(() => [e.getAllLeafColumns(), e.getState().columnPinning.right], (e, t) => (t ?? []).map((t) => e.find((e) => e.id === t)).filter(Boolean), X(e.options, "debugColumns", "getRightLeafColumns")), e.getCenterLeafColumns = Y(() => [
580
+ e.getAllLeafColumns(),
581
+ e.getState().columnPinning.left,
582
+ e.getState().columnPinning.right
583
+ ], (e, t, n) => {
584
+ let r = [...t ?? [], ...n ?? []];
585
+ return e.filter((e) => !r.includes(e.id));
586
+ }, X(e.options, "debugColumns", "getCenterLeafColumns"));
587
+ }
588
+ };
589
+ function $e(e) {
590
+ return e || (typeof document < "u" ? document : null);
591
+ }
592
+ var et = {
593
+ size: 150,
594
+ minSize: 20,
595
+ maxSize: 2 ** 53 - 1
596
+ }, tt = () => ({
597
+ startOffset: null,
598
+ startSize: null,
599
+ deltaOffset: null,
600
+ deltaPercentage: null,
601
+ isResizingColumn: !1,
602
+ columnSizingStart: []
603
+ }), nt = {
604
+ getDefaultColumnDef: () => et,
605
+ getInitialState: (e) => ({
606
+ columnSizing: {},
607
+ columnSizingInfo: tt(),
608
+ ...e
609
+ }),
610
+ getDefaultOptions: (e) => ({
611
+ columnResizeMode: "onEnd",
612
+ columnResizeDirection: "ltr",
613
+ onColumnSizingChange: J("columnSizing", e),
614
+ onColumnSizingInfoChange: J("columnSizingInfo", e)
615
+ }),
616
+ createColumn: (e, t) => {
617
+ e.getSize = () => {
618
+ let n = t.getState().columnSizing[e.id];
619
+ return Math.min(Math.max(e.columnDef.minSize ?? et.minSize, n ?? e.columnDef.size ?? et.size), e.columnDef.maxSize ?? et.maxSize);
620
+ }, e.getStart = Y((e) => [
621
+ e,
622
+ st(t, e),
623
+ t.getState().columnSizing
624
+ ], (t, n) => n.slice(0, e.getIndex(t)).reduce((e, t) => e + t.getSize(), 0), X(t.options, "debugColumns", "getStart")), e.getAfter = Y((e) => [
625
+ e,
626
+ st(t, e),
627
+ t.getState().columnSizing
628
+ ], (t, n) => n.slice(e.getIndex(t) + 1).reduce((e, t) => e + t.getSize(), 0), X(t.options, "debugColumns", "getAfter")), e.resetSize = () => {
629
+ t.setColumnSizing((t) => {
630
+ let { [e.id]: n, ...r } = t;
631
+ return r;
632
+ });
633
+ }, e.getCanResize = () => (e.columnDef.enableResizing ?? !0) && (t.options.enableColumnResizing ?? !0), e.getIsResizing = () => t.getState().columnSizingInfo.isResizingColumn === e.id;
634
+ },
635
+ createHeader: (e, t) => {
636
+ e.getSize = () => {
637
+ let t = 0, n = (e) => {
638
+ e.subHeaders.length ? e.subHeaders.forEach(n) : t += e.column.getSize() ?? 0;
639
+ };
640
+ return n(e), t;
641
+ }, e.getStart = () => {
642
+ if (e.index > 0) {
643
+ let t = e.headerGroup.headers[e.index - 1];
644
+ return t.getStart() + t.getSize();
645
+ }
646
+ return 0;
647
+ }, e.getResizeHandler = (n) => {
648
+ let r = t.getColumn(e.column.id), i = r?.getCanResize();
649
+ return (a) => {
650
+ if (!r || !i || (a.persist == null || a.persist(), at(a) && a.touches && a.touches.length > 1)) return;
651
+ let o = e.getSize(), s = e ? e.getLeafHeaders().map((e) => [e.column.id, e.column.getSize()]) : [[r.id, r.getSize()]], c = at(a) ? Math.round(a.touches[0].clientX) : a.clientX, l = {}, u = (e, n) => {
652
+ typeof n == "number" && (t.setColumnSizingInfo((e) => {
653
+ let r = t.options.columnResizeDirection === "rtl" ? -1 : 1, i = (n - (e?.startOffset ?? 0)) * r, a = Math.max(i / (e?.startSize ?? 0), -.999999);
654
+ return e.columnSizingStart.forEach((e) => {
655
+ let [t, n] = e;
656
+ l[t] = Math.round(Math.max(n + n * a, 0) * 100) / 100;
657
+ }), {
658
+ ...e,
659
+ deltaOffset: i,
660
+ deltaPercentage: a
661
+ };
662
+ }), (t.options.columnResizeMode === "onChange" || e === "end") && t.setColumnSizing((e) => ({
663
+ ...e,
664
+ ...l
665
+ })));
666
+ }, d = (e) => u("move", e), f = (e) => {
667
+ u("end", e), t.setColumnSizingInfo((e) => ({
668
+ ...e,
669
+ isResizingColumn: !1,
670
+ startOffset: null,
671
+ startSize: null,
672
+ deltaOffset: null,
673
+ deltaPercentage: null,
674
+ columnSizingStart: []
675
+ }));
676
+ }, p = $e(n), m = {
677
+ moveHandler: (e) => d(e.clientX),
678
+ upHandler: (e) => {
679
+ p?.removeEventListener("mousemove", m.moveHandler), p?.removeEventListener("mouseup", m.upHandler), f(e.clientX);
680
+ }
681
+ }, h = {
682
+ moveHandler: (e) => (e.cancelable && (e.preventDefault(), e.stopPropagation()), d(e.touches[0].clientX), !1),
683
+ upHandler: (e) => {
684
+ p?.removeEventListener("touchmove", h.moveHandler), p?.removeEventListener("touchend", h.upHandler), e.cancelable && (e.preventDefault(), e.stopPropagation()), f(e.touches[0]?.clientX);
685
+ }
686
+ }, g = it() ? { passive: !1 } : !1;
687
+ at(a) ? (p?.addEventListener("touchmove", h.moveHandler, g), p?.addEventListener("touchend", h.upHandler, g)) : (p?.addEventListener("mousemove", m.moveHandler, g), p?.addEventListener("mouseup", m.upHandler, g)), t.setColumnSizingInfo((e) => ({
688
+ ...e,
689
+ startOffset: c,
690
+ startSize: o,
691
+ deltaOffset: 0,
692
+ deltaPercentage: 0,
693
+ columnSizingStart: s,
694
+ isResizingColumn: r.id
695
+ }));
696
+ };
697
+ };
698
+ },
699
+ createTable: (e) => {
700
+ e.setColumnSizing = (t) => e.options.onColumnSizingChange == null ? void 0 : e.options.onColumnSizingChange(t), e.setColumnSizingInfo = (t) => e.options.onColumnSizingInfoChange == null ? void 0 : e.options.onColumnSizingInfoChange(t), e.resetColumnSizing = (t) => {
701
+ e.setColumnSizing(t ? {} : e.initialState.columnSizing ?? {});
702
+ }, e.resetHeaderSizeInfo = (t) => {
703
+ e.setColumnSizingInfo(t ? tt() : e.initialState.columnSizingInfo ?? tt());
704
+ }, e.getTotalSize = () => e.getHeaderGroups()[0]?.headers.reduce((e, t) => e + t.getSize(), 0) ?? 0, e.getLeftTotalSize = () => e.getLeftHeaderGroups()[0]?.headers.reduce((e, t) => e + t.getSize(), 0) ?? 0, e.getCenterTotalSize = () => e.getCenterHeaderGroups()[0]?.headers.reduce((e, t) => e + t.getSize(), 0) ?? 0, e.getRightTotalSize = () => e.getRightHeaderGroups()[0]?.headers.reduce((e, t) => e + t.getSize(), 0) ?? 0;
705
+ }
706
+ }, rt = null;
707
+ function it() {
708
+ if (typeof rt == "boolean") return rt;
709
+ let e = !1;
710
+ try {
711
+ let t = { get passive() {
712
+ return e = !0, !1;
713
+ } }, n = () => {};
714
+ window.addEventListener("test", n, t), window.removeEventListener("test", n);
715
+ } catch {
716
+ e = !1;
717
+ }
718
+ return rt = e, rt;
719
+ }
720
+ function at(e) {
721
+ return e.type === "touchstart";
722
+ }
723
+ var ot = {
724
+ getInitialState: (e) => ({
725
+ columnVisibility: {},
726
+ ...e
727
+ }),
728
+ getDefaultOptions: (e) => ({ onColumnVisibilityChange: J("columnVisibility", e) }),
729
+ createColumn: (e, t) => {
730
+ e.toggleVisibility = (n) => {
731
+ e.getCanHide() && t.setColumnVisibility((t) => ({
732
+ ...t,
733
+ [e.id]: n ?? !e.getIsVisible()
734
+ }));
735
+ }, e.getIsVisible = () => {
736
+ let n = e.columns;
737
+ return (n.length ? n.some((e) => e.getIsVisible()) : t.getState().columnVisibility?.[e.id]) ?? !0;
738
+ }, e.getCanHide = () => (e.columnDef.enableHiding ?? !0) && (t.options.enableHiding ?? !0), e.getToggleVisibilityHandler = () => (t) => {
739
+ e.toggleVisibility == null || e.toggleVisibility(t.target.checked);
740
+ };
741
+ },
742
+ createRow: (e, t) => {
743
+ e._getAllVisibleCells = Y(() => [e.getAllCells(), t.getState().columnVisibility], (e) => e.filter((e) => e.column.getIsVisible()), X(t.options, "debugRows", "_getAllVisibleCells")), e.getVisibleCells = Y(() => [
744
+ e.getLeftVisibleCells(),
745
+ e.getCenterVisibleCells(),
746
+ e.getRightVisibleCells()
747
+ ], (e, t, n) => [
748
+ ...e,
749
+ ...t,
750
+ ...n
751
+ ], X(t.options, "debugRows", "getVisibleCells"));
752
+ },
753
+ createTable: (e) => {
754
+ let t = (t, n) => Y(() => [n(), n().filter((e) => e.getIsVisible()).map((e) => e.id).join("_")], (e) => e.filter((e) => e.getIsVisible == null ? void 0 : e.getIsVisible()), X(e.options, "debugColumns", t));
755
+ e.getVisibleFlatColumns = t("getVisibleFlatColumns", () => e.getAllFlatColumns()), e.getVisibleLeafColumns = t("getVisibleLeafColumns", () => e.getAllLeafColumns()), e.getLeftVisibleLeafColumns = t("getLeftVisibleLeafColumns", () => e.getLeftLeafColumns()), e.getRightVisibleLeafColumns = t("getRightVisibleLeafColumns", () => e.getRightLeafColumns()), e.getCenterVisibleLeafColumns = t("getCenterVisibleLeafColumns", () => e.getCenterLeafColumns()), e.setColumnVisibility = (t) => e.options.onColumnVisibilityChange == null ? void 0 : e.options.onColumnVisibilityChange(t), e.resetColumnVisibility = (t) => {
756
+ e.setColumnVisibility(t ? {} : e.initialState.columnVisibility ?? {});
757
+ }, e.toggleAllColumnsVisible = (t) => {
758
+ t ??= !e.getIsAllColumnsVisible(), e.setColumnVisibility(e.getAllLeafColumns().reduce((e, n) => ({
759
+ ...e,
760
+ [n.id]: t || !(n.getCanHide != null && n.getCanHide())
761
+ }), {}));
762
+ }, e.getIsAllColumnsVisible = () => !e.getAllLeafColumns().some((e) => !(e.getIsVisible != null && e.getIsVisible())), e.getIsSomeColumnsVisible = () => e.getAllLeafColumns().some((e) => e.getIsVisible == null ? void 0 : e.getIsVisible()), e.getToggleAllColumnsVisibilityHandler = () => (t) => {
763
+ e.toggleAllColumnsVisible(t.target?.checked);
764
+ };
765
+ }
766
+ };
767
+ function st(e, t) {
768
+ return t ? t === "center" ? e.getCenterVisibleLeafColumns() : t === "left" ? e.getLeftVisibleLeafColumns() : e.getRightVisibleLeafColumns() : e.getVisibleLeafColumns();
769
+ }
770
+ var ct = { createTable: (e) => {
771
+ e._getGlobalFacetedRowModel = e.options.getFacetedRowModel && e.options.getFacetedRowModel(e, "__global__"), e.getGlobalFacetedRowModel = () => e.options.manualFiltering || !e._getGlobalFacetedRowModel ? e.getPreFilteredRowModel() : e._getGlobalFacetedRowModel(), e._getGlobalFacetedUniqueValues = e.options.getFacetedUniqueValues && e.options.getFacetedUniqueValues(e, "__global__"), e.getGlobalFacetedUniqueValues = () => e._getGlobalFacetedUniqueValues ? e._getGlobalFacetedUniqueValues() : /* @__PURE__ */ new Map(), e._getGlobalFacetedMinMaxValues = e.options.getFacetedMinMaxValues && e.options.getFacetedMinMaxValues(e, "__global__"), e.getGlobalFacetedMinMaxValues = () => {
772
+ if (e._getGlobalFacetedMinMaxValues) return e._getGlobalFacetedMinMaxValues();
773
+ };
774
+ } }, lt = {
775
+ getInitialState: (e) => ({
776
+ globalFilter: void 0,
777
+ ...e
778
+ }),
779
+ getDefaultOptions: (e) => ({
780
+ onGlobalFilterChange: J("globalFilter", e),
781
+ globalFilterFn: "auto",
782
+ getColumnCanGlobalFilter: (t) => {
783
+ var n;
784
+ let r = (n = e.getCoreRowModel().flatRows[0]) == null || (n = n._getAllCellsByColumnId()[t.id]) == null ? void 0 : n.getValue();
785
+ return typeof r == "string" || typeof r == "number";
786
+ }
787
+ }),
788
+ createColumn: (e, t) => {
789
+ e.getCanGlobalFilter = () => (e.columnDef.enableGlobalFilter ?? !0) && (t.options.enableGlobalFilter ?? !0) && (t.options.enableFilters ?? !0) && ((t.options.getColumnCanGlobalFilter == null ? void 0 : t.options.getColumnCanGlobalFilter(e)) ?? !0) && !!e.accessorFn;
790
+ },
791
+ createTable: (e) => {
792
+ e.getGlobalAutoFilterFn = () => We.includesString, e.getGlobalFilterFn = () => {
793
+ let { globalFilterFn: t } = e.options;
794
+ return Te(t) ? t : t === "auto" ? e.getGlobalAutoFilterFn() : e.options.filterFns?.[t] ?? We[t];
795
+ }, e.setGlobalFilter = (t) => {
796
+ e.options.onGlobalFilterChange == null || e.options.onGlobalFilterChange(t);
797
+ }, e.resetGlobalFilter = (t) => {
798
+ e.setGlobalFilter(t ? void 0 : e.initialState.globalFilter);
799
+ };
800
+ }
801
+ }, ut = {
802
+ getInitialState: (e) => ({
803
+ expanded: {},
804
+ ...e
805
+ }),
806
+ getDefaultOptions: (e) => ({
807
+ onExpandedChange: J("expanded", e),
808
+ paginateExpandedRows: !0
809
+ }),
810
+ createTable: (e) => {
811
+ let t = !1, n = !1;
812
+ e._autoResetExpanded = () => {
813
+ if (!t) {
814
+ e._queue(() => {
815
+ t = !0;
816
+ });
817
+ return;
818
+ }
819
+ if (e.options.autoResetAll ?? e.options.autoResetExpanded ?? !e.options.manualExpanding) {
820
+ if (n) return;
821
+ n = !0, e._queue(() => {
822
+ e.resetExpanded(), n = !1;
823
+ });
824
+ }
825
+ }, e.setExpanded = (t) => e.options.onExpandedChange == null ? void 0 : e.options.onExpandedChange(t), e.toggleAllRowsExpanded = (t) => {
826
+ t ?? !e.getIsAllRowsExpanded() ? e.setExpanded(!0) : e.setExpanded({});
827
+ }, e.resetExpanded = (t) => {
828
+ e.setExpanded(t ? {} : e.initialState?.expanded ?? {});
829
+ }, e.getCanSomeRowsExpand = () => e.getPrePaginationRowModel().flatRows.some((e) => e.getCanExpand()), e.getToggleAllRowsExpandedHandler = () => (t) => {
830
+ t.persist == null || t.persist(), e.toggleAllRowsExpanded();
831
+ }, e.getIsSomeRowsExpanded = () => {
832
+ let t = e.getState().expanded;
833
+ return t === !0 || Object.values(t).some(Boolean);
834
+ }, e.getIsAllRowsExpanded = () => {
835
+ let t = e.getState().expanded;
836
+ return typeof t == "boolean" ? t === !0 : !(!Object.keys(t).length || e.getRowModel().flatRows.some((e) => !e.getIsExpanded()));
837
+ }, e.getExpandedDepth = () => {
838
+ let t = 0;
839
+ return (e.getState().expanded === !0 ? Object.keys(e.getRowModel().rowsById) : Object.keys(e.getState().expanded)).forEach((e) => {
840
+ let n = e.split(".");
841
+ t = Math.max(t, n.length);
842
+ }), t;
843
+ }, e.getPreExpandedRowModel = () => e.getSortedRowModel(), e.getExpandedRowModel = () => (!e._getExpandedRowModel && e.options.getExpandedRowModel && (e._getExpandedRowModel = e.options.getExpandedRowModel(e)), e.options.manualExpanding || !e._getExpandedRowModel ? e.getPreExpandedRowModel() : e._getExpandedRowModel());
844
+ },
845
+ createRow: (e, t) => {
846
+ e.toggleExpanded = (n) => {
847
+ t.setExpanded((r) => {
848
+ let i = r === !0 ? !0 : !!(r != null && r[e.id]), a = {};
849
+ if (r === !0 ? Object.keys(t.getRowModel().rowsById).forEach((e) => {
850
+ a[e] = !0;
851
+ }) : a = r, n ??= !i, !i && n) return {
852
+ ...a,
853
+ [e.id]: !0
854
+ };
855
+ if (i && !n) {
856
+ let { [e.id]: t, ...n } = a;
857
+ return n;
858
+ }
859
+ return r;
860
+ });
861
+ }, e.getIsExpanded = () => {
862
+ let n = t.getState().expanded;
863
+ return !!((t.options.getIsRowExpanded == null ? void 0 : t.options.getIsRowExpanded(e)) ?? (n === !0 || n?.[e.id]));
864
+ }, e.getCanExpand = () => {
865
+ var n;
866
+ return (t.options.getRowCanExpand == null ? void 0 : t.options.getRowCanExpand(e)) ?? ((t.options.enableExpanding ?? !0) && !!((n = e.subRows) != null && n.length));
867
+ }, e.getIsAllParentsExpanded = () => {
868
+ let n = !0, r = e;
869
+ for (; n && r.parentId;) r = t.getRow(r.parentId, !0), n = r.getIsExpanded();
870
+ return n;
871
+ }, e.getToggleExpandedHandler = () => {
872
+ let t = e.getCanExpand();
873
+ return () => {
874
+ t && e.toggleExpanded();
875
+ };
876
+ };
877
+ }
878
+ }, dt = 0, ft = 10, pt = () => ({
879
+ pageIndex: dt,
880
+ pageSize: ft
881
+ }), mt = {
882
+ getInitialState: (e) => ({
883
+ ...e,
884
+ pagination: {
885
+ ...pt(),
886
+ ...e?.pagination
887
+ }
888
+ }),
889
+ getDefaultOptions: (e) => ({ onPaginationChange: J("pagination", e) }),
890
+ createTable: (e) => {
891
+ let t = !1, n = !1;
892
+ e._autoResetPageIndex = () => {
893
+ if (!t) {
894
+ e._queue(() => {
895
+ t = !0;
896
+ });
897
+ return;
898
+ }
899
+ if (e.options.autoResetAll ?? e.options.autoResetPageIndex ?? !e.options.manualPagination) {
900
+ if (n) return;
901
+ n = !0, e._queue(() => {
902
+ e.resetPageIndex(), n = !1;
903
+ });
904
+ }
905
+ }, e.setPagination = (t) => e.options.onPaginationChange == null ? void 0 : e.options.onPaginationChange((e) => we(t, e)), e.resetPagination = (t) => {
906
+ e.setPagination(t ? pt() : e.initialState.pagination ?? pt());
907
+ }, e.setPageIndex = (t) => {
908
+ e.setPagination((n) => {
909
+ let r = we(t, n.pageIndex), i = e.options.pageCount === void 0 || e.options.pageCount === -1 ? 2 ** 53 - 1 : e.options.pageCount - 1;
910
+ return r = Math.max(0, Math.min(r, i)), {
911
+ ...n,
912
+ pageIndex: r
913
+ };
914
+ });
915
+ }, e.resetPageIndex = (t) => {
916
+ var n;
917
+ e.setPageIndex(t ? dt : ((n = e.initialState) == null || (n = n.pagination) == null ? void 0 : n.pageIndex) ?? dt);
918
+ }, e.resetPageSize = (t) => {
919
+ var n;
920
+ e.setPageSize(t ? ft : ((n = e.initialState) == null || (n = n.pagination) == null ? void 0 : n.pageSize) ?? ft);
921
+ }, e.setPageSize = (t) => {
922
+ e.setPagination((e) => {
923
+ let n = Math.max(1, we(t, e.pageSize)), r = e.pageSize * e.pageIndex, i = Math.floor(r / n);
924
+ return {
925
+ ...e,
926
+ pageIndex: i,
927
+ pageSize: n
928
+ };
929
+ });
930
+ }, e.setPageCount = (t) => e.setPagination((n) => {
931
+ let r = we(t, e.options.pageCount ?? -1);
932
+ return typeof r == "number" && (r = Math.max(-1, r)), {
933
+ ...n,
934
+ pageCount: r
935
+ };
936
+ }), e.getPageOptions = Y(() => [e.getPageCount()], (e) => {
937
+ let t = [];
938
+ return e && e > 0 && (t = [...Array(e)].fill(null).map((e, t) => t)), t;
939
+ }, X(e.options, "debugTable", "getPageOptions")), e.getCanPreviousPage = () => e.getState().pagination.pageIndex > 0, e.getCanNextPage = () => {
940
+ let { pageIndex: t } = e.getState().pagination, n = e.getPageCount();
941
+ return n === -1 ? !0 : n === 0 ? !1 : t < n - 1;
942
+ }, e.previousPage = () => e.setPageIndex((e) => e - 1), e.nextPage = () => e.setPageIndex((e) => e + 1), e.firstPage = () => e.setPageIndex(0), e.lastPage = () => e.setPageIndex(e.getPageCount() - 1), e.getPrePaginationRowModel = () => e.getExpandedRowModel(), e.getPaginationRowModel = () => (!e._getPaginationRowModel && e.options.getPaginationRowModel && (e._getPaginationRowModel = e.options.getPaginationRowModel(e)), e.options.manualPagination || !e._getPaginationRowModel ? e.getPrePaginationRowModel() : e._getPaginationRowModel()), e.getPageCount = () => e.options.pageCount ?? Math.ceil(e.getRowCount() / e.getState().pagination.pageSize), e.getRowCount = () => e.options.rowCount ?? e.getPrePaginationRowModel().rows.length;
943
+ }
944
+ }, ht = () => ({
945
+ top: [],
946
+ bottom: []
947
+ }), gt = {
948
+ getInitialState: (e) => ({
949
+ rowPinning: ht(),
950
+ ...e
951
+ }),
952
+ getDefaultOptions: (e) => ({ onRowPinningChange: J("rowPinning", e) }),
953
+ createRow: (e, t) => {
954
+ e.pin = (n, r, i) => {
955
+ let a = r ? e.getLeafRows().map((e) => {
956
+ let { id: t } = e;
957
+ return t;
958
+ }) : [], o = i ? e.getParentRows().map((e) => {
959
+ let { id: t } = e;
960
+ return t;
961
+ }) : [], s = new Set([
962
+ ...o,
963
+ e.id,
964
+ ...a
965
+ ]);
966
+ t.setRowPinning((e) => n === "bottom" ? {
967
+ top: (e?.top ?? []).filter((e) => !(s != null && s.has(e))),
968
+ bottom: [...(e?.bottom ?? []).filter((e) => !(s != null && s.has(e))), ...Array.from(s)]
969
+ } : n === "top" ? {
970
+ top: [...(e?.top ?? []).filter((e) => !(s != null && s.has(e))), ...Array.from(s)],
971
+ bottom: (e?.bottom ?? []).filter((e) => !(s != null && s.has(e)))
972
+ } : {
973
+ top: (e?.top ?? []).filter((e) => !(s != null && s.has(e))),
974
+ bottom: (e?.bottom ?? []).filter((e) => !(s != null && s.has(e)))
975
+ });
976
+ }, e.getCanPin = () => {
977
+ let { enableRowPinning: n, enablePinning: r } = t.options;
978
+ return typeof n == "function" ? n(e) : n ?? r ?? !0;
979
+ }, e.getIsPinned = () => {
980
+ let n = [e.id], { top: r, bottom: i } = t.getState().rowPinning, a = n.some((e) => r?.includes(e)), o = n.some((e) => i?.includes(e));
981
+ return a ? "top" : o ? "bottom" : !1;
982
+ }, e.getPinnedIndex = () => {
983
+ let n = e.getIsPinned();
984
+ return n ? ((n === "top" ? t.getTopRows() : t.getBottomRows())?.map((e) => {
985
+ let { id: t } = e;
986
+ return t;
987
+ }))?.indexOf(e.id) ?? -1 : -1;
988
+ };
989
+ },
990
+ createTable: (e) => {
991
+ e.setRowPinning = (t) => e.options.onRowPinningChange == null ? void 0 : e.options.onRowPinningChange(t), e.resetRowPinning = (t) => e.setRowPinning(t ? ht() : e.initialState?.rowPinning ?? ht()), e.getIsSomeRowsPinned = (t) => {
992
+ let n = e.getState().rowPinning;
993
+ return t ? !!n[t]?.length : !!(n.top?.length || n.bottom?.length);
994
+ }, e._getPinnedRows = (t, n, r) => (e.options.keepPinnedRows ?? !0 ? (n ?? []).map((t) => {
995
+ let n = e.getRow(t, !0);
996
+ return n.getIsAllParentsExpanded() ? n : null;
997
+ }) : (n ?? []).map((e) => t.find((t) => t.id === e))).filter(Boolean).map((e) => ({
998
+ ...e,
999
+ position: r
1000
+ })), e.getTopRows = Y(() => [e.getRowModel().rows, e.getState().rowPinning.top], (t, n) => e._getPinnedRows(t, n, "top"), X(e.options, "debugRows", "getTopRows")), e.getBottomRows = Y(() => [e.getRowModel().rows, e.getState().rowPinning.bottom], (t, n) => e._getPinnedRows(t, n, "bottom"), X(e.options, "debugRows", "getBottomRows")), e.getCenterRows = Y(() => [
1001
+ e.getRowModel().rows,
1002
+ e.getState().rowPinning.top,
1003
+ e.getState().rowPinning.bottom
1004
+ ], (e, t, n) => {
1005
+ let r = new Set([...t ?? [], ...n ?? []]);
1006
+ return e.filter((e) => !r.has(e.id));
1007
+ }, X(e.options, "debugRows", "getCenterRows"));
1008
+ }
1009
+ }, _t = {
1010
+ getInitialState: (e) => ({
1011
+ rowSelection: {},
1012
+ ...e
1013
+ }),
1014
+ getDefaultOptions: (e) => ({
1015
+ onRowSelectionChange: J("rowSelection", e),
1016
+ enableRowSelection: !0,
1017
+ enableMultiRowSelection: !0,
1018
+ enableSubRowSelection: !0
1019
+ }),
1020
+ createTable: (e) => {
1021
+ e.setRowSelection = (t) => e.options.onRowSelectionChange == null ? void 0 : e.options.onRowSelectionChange(t), e.resetRowSelection = (t) => e.setRowSelection(t ? {} : e.initialState.rowSelection ?? {}), e.toggleAllRowsSelected = (t) => {
1022
+ e.setRowSelection((n) => {
1023
+ t = t === void 0 ? !e.getIsAllRowsSelected() : t;
1024
+ let r = { ...n }, i = e.getPreGroupedRowModel().flatRows;
1025
+ return t ? i.forEach((e) => {
1026
+ e.getCanSelect() && (r[e.id] = !0);
1027
+ }) : i.forEach((e) => {
1028
+ delete r[e.id];
1029
+ }), r;
1030
+ });
1031
+ }, e.toggleAllPageRowsSelected = (t) => e.setRowSelection((n) => {
1032
+ let r = t === void 0 ? !e.getIsAllPageRowsSelected() : t, i = { ...n };
1033
+ return e.getRowModel().rows.forEach((t) => {
1034
+ vt(i, t.id, r, !0, e);
1035
+ }), i;
1036
+ }), e.getPreSelectedRowModel = () => e.getCoreRowModel(), e.getSelectedRowModel = Y(() => [e.getState().rowSelection, e.getCoreRowModel()], (t, n) => Object.keys(t).length ? yt(e, n) : {
1037
+ rows: [],
1038
+ flatRows: [],
1039
+ rowsById: {}
1040
+ }, X(e.options, "debugTable", "getSelectedRowModel")), e.getFilteredSelectedRowModel = Y(() => [e.getState().rowSelection, e.getFilteredRowModel()], (t, n) => Object.keys(t).length ? yt(e, n) : {
1041
+ rows: [],
1042
+ flatRows: [],
1043
+ rowsById: {}
1044
+ }, X(e.options, "debugTable", "getFilteredSelectedRowModel")), e.getGroupedSelectedRowModel = Y(() => [e.getState().rowSelection, e.getSortedRowModel()], (t, n) => Object.keys(t).length ? yt(e, n) : {
1045
+ rows: [],
1046
+ flatRows: [],
1047
+ rowsById: {}
1048
+ }, X(e.options, "debugTable", "getGroupedSelectedRowModel")), e.getIsAllRowsSelected = () => {
1049
+ let t = e.getFilteredRowModel().flatRows, { rowSelection: n } = e.getState(), r = !!(t.length && Object.keys(n).length);
1050
+ return r && t.some((e) => e.getCanSelect() && !n[e.id]) && (r = !1), r;
1051
+ }, e.getIsAllPageRowsSelected = () => {
1052
+ let t = e.getPaginationRowModel().flatRows.filter((e) => e.getCanSelect()), { rowSelection: n } = e.getState(), r = !!t.length;
1053
+ return r && t.some((e) => !n[e.id]) && (r = !1), r;
1054
+ }, e.getIsSomeRowsSelected = () => {
1055
+ let t = Object.keys(e.getState().rowSelection ?? {}).length;
1056
+ return t > 0 && t < e.getFilteredRowModel().flatRows.length;
1057
+ }, e.getIsSomePageRowsSelected = () => {
1058
+ let t = e.getPaginationRowModel().flatRows;
1059
+ return e.getIsAllPageRowsSelected() ? !1 : t.filter((e) => e.getCanSelect()).some((e) => e.getIsSelected() || e.getIsSomeSelected());
1060
+ }, e.getToggleAllRowsSelectedHandler = () => (t) => {
1061
+ e.toggleAllRowsSelected(t.target.checked);
1062
+ }, e.getToggleAllPageRowsSelectedHandler = () => (t) => {
1063
+ e.toggleAllPageRowsSelected(t.target.checked);
1064
+ };
1065
+ },
1066
+ createRow: (e, t) => {
1067
+ e.toggleSelected = (n, r) => {
1068
+ let i = e.getIsSelected();
1069
+ t.setRowSelection((a) => {
1070
+ if (n = n === void 0 ? !i : n, e.getCanSelect() && i === n) return a;
1071
+ let o = { ...a };
1072
+ return vt(o, e.id, n, r?.selectChildren ?? !0, t), o;
1073
+ });
1074
+ }, e.getIsSelected = () => {
1075
+ let { rowSelection: n } = t.getState();
1076
+ return bt(e, n);
1077
+ }, e.getIsSomeSelected = () => {
1078
+ let { rowSelection: n } = t.getState();
1079
+ return xt(e, n) === "some";
1080
+ }, e.getIsAllSubRowsSelected = () => {
1081
+ let { rowSelection: n } = t.getState();
1082
+ return xt(e, n) === "all";
1083
+ }, e.getCanSelect = () => typeof t.options.enableRowSelection == "function" ? t.options.enableRowSelection(e) : t.options.enableRowSelection ?? !0, e.getCanSelectSubRows = () => typeof t.options.enableSubRowSelection == "function" ? t.options.enableSubRowSelection(e) : t.options.enableSubRowSelection ?? !0, e.getCanMultiSelect = () => typeof t.options.enableMultiRowSelection == "function" ? t.options.enableMultiRowSelection(e) : t.options.enableMultiRowSelection ?? !0, e.getToggleSelectedHandler = () => {
1084
+ let t = e.getCanSelect();
1085
+ return (n) => {
1086
+ t && e.toggleSelected(n.target?.checked);
1087
+ };
1088
+ };
1089
+ }
1090
+ }, vt = (e, t, n, r, i) => {
1091
+ var a;
1092
+ let o = i.getRow(t, !0);
1093
+ n ? (o.getCanMultiSelect() || Object.keys(e).forEach((t) => delete e[t]), o.getCanSelect() && (e[t] = !0)) : delete e[t], r && (a = o.subRows) != null && a.length && o.getCanSelectSubRows() && o.subRows.forEach((t) => vt(e, t.id, n, r, i));
1094
+ };
1095
+ function yt(e, t) {
1096
+ let n = e.getState().rowSelection, r = [], i = {}, a = function(e, t) {
1097
+ return e.map((e) => {
1098
+ var t;
1099
+ let o = bt(e, n);
1100
+ if (o && (r.push(e), i[e.id] = e), (t = e.subRows) != null && t.length && (e = {
1101
+ ...e,
1102
+ subRows: a(e.subRows)
1103
+ }), o) return e;
1104
+ }).filter(Boolean);
1105
+ };
1106
+ return {
1107
+ rows: a(t.rows),
1108
+ flatRows: r,
1109
+ rowsById: i
1110
+ };
1111
+ }
1112
+ function bt(e, t) {
1113
+ return t[e.id] ?? !1;
1114
+ }
1115
+ function xt(e, t, n) {
1116
+ var r;
1117
+ if (!((r = e.subRows) != null && r.length)) return !1;
1118
+ let i = !0, a = !1;
1119
+ return e.subRows.forEach((e) => {
1120
+ if (!(a && !i) && (e.getCanSelect() && (bt(e, t) ? a = !0 : i = !1), e.subRows && e.subRows.length)) {
1121
+ let n = xt(e, t);
1122
+ n === "all" ? a = !0 : (n === "some" && (a = !0), i = !1);
1123
+ }
1124
+ }), i ? "all" : a ? "some" : !1;
1125
+ }
1126
+ var St = /([0-9]+)/gm, Ct = (e, t, n) => jt(At(e.getValue(n)).toLowerCase(), At(t.getValue(n)).toLowerCase()), wt = (e, t, n) => jt(At(e.getValue(n)), At(t.getValue(n))), Tt = (e, t, n) => kt(At(e.getValue(n)).toLowerCase(), At(t.getValue(n)).toLowerCase()), Et = (e, t, n) => kt(At(e.getValue(n)), At(t.getValue(n))), Dt = (e, t, n) => {
1127
+ let r = e.getValue(n), i = t.getValue(n);
1128
+ return r > i ? 1 : r < i ? -1 : 0;
1129
+ }, Ot = (e, t, n) => kt(e.getValue(n), t.getValue(n));
1130
+ function kt(e, t) {
1131
+ return e === t ? 0 : e > t ? 1 : -1;
1132
+ }
1133
+ function At(e) {
1134
+ return typeof e == "number" ? isNaN(e) || e === Infinity || e === -Infinity ? "" : String(e) : typeof e == "string" ? e : "";
1135
+ }
1136
+ function jt(e, t) {
1137
+ let n = e.split(St).filter(Boolean), r = t.split(St).filter(Boolean);
1138
+ for (; n.length && r.length;) {
1139
+ let e = n.shift(), t = r.shift(), i = parseInt(e, 10), a = parseInt(t, 10), o = [i, a].sort();
1140
+ if (isNaN(o[0])) {
1141
+ if (e > t) return 1;
1142
+ if (t > e) return -1;
1143
+ continue;
1144
+ }
1145
+ if (isNaN(o[1])) return isNaN(i) ? -1 : 1;
1146
+ if (i > a) return 1;
1147
+ if (a > i) return -1;
1148
+ }
1149
+ return n.length - r.length;
1150
+ }
1151
+ var Mt = {
1152
+ alphanumeric: Ct,
1153
+ alphanumericCaseSensitive: wt,
1154
+ text: Tt,
1155
+ textCaseSensitive: Et,
1156
+ datetime: Dt,
1157
+ basic: Ot
1158
+ }, Nt = [
1159
+ je,
1160
+ ot,
1161
+ Xe,
1162
+ Qe,
1163
+ Pe,
1164
+ Ge,
1165
+ ct,
1166
+ lt,
1167
+ {
1168
+ getInitialState: (e) => ({
1169
+ sorting: [],
1170
+ ...e
1171
+ }),
1172
+ getDefaultColumnDef: () => ({
1173
+ sortingFn: "auto",
1174
+ sortUndefined: 1
1175
+ }),
1176
+ getDefaultOptions: (e) => ({
1177
+ onSortingChange: J("sorting", e),
1178
+ isMultiSortEvent: (e) => e.shiftKey
1179
+ }),
1180
+ createColumn: (e, t) => {
1181
+ e.getAutoSortingFn = () => {
1182
+ let n = t.getFilteredRowModel().flatRows.slice(10), r = !1;
1183
+ for (let t of n) {
1184
+ let n = t?.getValue(e.id);
1185
+ if (Object.prototype.toString.call(n) === "[object Date]") return Mt.datetime;
1186
+ if (typeof n == "string" && (r = !0, n.split(St).length > 1)) return Mt.alphanumeric;
1187
+ }
1188
+ return r ? Mt.text : Mt.basic;
1189
+ }, e.getAutoSortDir = () => typeof t.getFilteredRowModel().flatRows[0]?.getValue(e.id) == "string" ? "asc" : "desc", e.getSortingFn = () => {
1190
+ if (!e) throw Error();
1191
+ return Te(e.columnDef.sortingFn) ? e.columnDef.sortingFn : e.columnDef.sortingFn === "auto" ? e.getAutoSortingFn() : t.options.sortingFns?.[e.columnDef.sortingFn] ?? Mt[e.columnDef.sortingFn];
1192
+ }, e.toggleSorting = (n, r) => {
1193
+ let i = e.getNextSortingOrder(), a = n != null;
1194
+ t.setSorting((o) => {
1195
+ let s = o?.find((t) => t.id === e.id), c = o?.findIndex((t) => t.id === e.id), l = [], u, d = a ? n : i === "desc";
1196
+ return u = o != null && o.length && e.getCanMultiSort() && r ? s ? "toggle" : "add" : o != null && o.length && c !== o.length - 1 ? "replace" : s ? "toggle" : "replace", u === "toggle" && (a || i || (u = "remove")), u === "add" ? (l = [...o, {
1197
+ id: e.id,
1198
+ desc: d
1199
+ }], l.splice(0, l.length - (t.options.maxMultiSortColCount ?? 2 ** 53 - 1))) : l = u === "toggle" ? o.map((t) => t.id === e.id ? {
1200
+ ...t,
1201
+ desc: d
1202
+ } : t) : u === "remove" ? o.filter((t) => t.id !== e.id) : [{
1203
+ id: e.id,
1204
+ desc: d
1205
+ }], l;
1206
+ });
1207
+ }, e.getFirstSortDir = () => e.columnDef.sortDescFirst ?? t.options.sortDescFirst ?? e.getAutoSortDir() === "desc" ? "desc" : "asc", e.getNextSortingOrder = (n) => {
1208
+ let r = e.getFirstSortDir(), i = e.getIsSorted();
1209
+ return i ? i !== r && (t.options.enableSortingRemoval ?? !0) && (!n || (t.options.enableMultiRemove ?? !0)) ? !1 : i === "desc" ? "asc" : "desc" : r;
1210
+ }, e.getCanSort = () => (e.columnDef.enableSorting ?? !0) && (t.options.enableSorting ?? !0) && !!e.accessorFn, e.getCanMultiSort = () => e.columnDef.enableMultiSort ?? t.options.enableMultiSort ?? !!e.accessorFn, e.getIsSorted = () => {
1211
+ let n = t.getState().sorting?.find((t) => t.id === e.id);
1212
+ return n ? n.desc ? "desc" : "asc" : !1;
1213
+ }, e.getSortIndex = () => t.getState().sorting?.findIndex((t) => t.id === e.id) ?? -1, e.clearSorting = () => {
1214
+ t.setSorting((t) => t != null && t.length ? t.filter((t) => t.id !== e.id) : []);
1215
+ }, e.getToggleSortingHandler = () => {
1216
+ let n = e.getCanSort();
1217
+ return (r) => {
1218
+ n && (r.persist == null || r.persist(), e.toggleSorting == null || e.toggleSorting(void 0, e.getCanMultiSort() ? t.options.isMultiSortEvent == null ? void 0 : t.options.isMultiSortEvent(r) : !1));
1219
+ };
1220
+ };
1221
+ },
1222
+ createTable: (e) => {
1223
+ e.setSorting = (t) => e.options.onSortingChange == null ? void 0 : e.options.onSortingChange(t), e.resetSorting = (t) => {
1224
+ e.setSorting(t ? [] : e.initialState?.sorting ?? []);
1225
+ }, e.getPreSortedRowModel = () => e.getGroupedRowModel(), e.getSortedRowModel = () => (!e._getSortedRowModel && e.options.getSortedRowModel && (e._getSortedRowModel = e.options.getSortedRowModel(e)), e.options.manualSorting || !e._getSortedRowModel ? e.getPreSortedRowModel() : e._getSortedRowModel());
1226
+ }
1227
+ },
1228
+ Je,
1229
+ ut,
1230
+ mt,
1231
+ gt,
1232
+ _t,
1233
+ nt
1234
+ ];
1235
+ function Pt(e) {
1236
+ process.env.NODE_ENV !== "production" && (e.debugAll || e.debugTable) && console.info("Creating Table Instance...");
1237
+ let t = [...Nt, ...e._features ?? []], n = { _features: t }, r = n._features.reduce((e, t) => Object.assign(e, t.getDefaultOptions == null ? void 0 : t.getDefaultOptions(n)), {}), i = (e) => n.options.mergeOptions ? n.options.mergeOptions(r, e) : {
1238
+ ...r,
1239
+ ...e
1240
+ }, a = { ...e.initialState ?? {} };
1241
+ n._features.forEach((e) => {
1242
+ a = (e.getInitialState == null ? void 0 : e.getInitialState(a)) ?? a;
1243
+ });
1244
+ let o = [], s = !1, c = {
1245
+ _features: t,
1246
+ options: {
1247
+ ...r,
1248
+ ...e
1249
+ },
1250
+ initialState: a,
1251
+ _queue: (e) => {
1252
+ o.push(e), s || (s = !0, Promise.resolve().then(() => {
1253
+ for (; o.length;) o.shift()();
1254
+ s = !1;
1255
+ }).catch((e) => setTimeout(() => {
1256
+ throw e;
1257
+ })));
1258
+ },
1259
+ reset: () => {
1260
+ n.setState(n.initialState);
1261
+ },
1262
+ setOptions: (e) => {
1263
+ n.options = i(we(e, n.options));
1264
+ },
1265
+ getState: () => n.options.state,
1266
+ setState: (e) => {
1267
+ n.options.onStateChange == null || n.options.onStateChange(e);
1268
+ },
1269
+ _getRowId: (e, t, r) => (n.options.getRowId == null ? void 0 : n.options.getRowId(e, t, r)) ?? `${r ? [r.id, t].join(".") : t}`,
1270
+ getCoreRowModel: () => (n._getCoreRowModel ||= n.options.getCoreRowModel(n), n._getCoreRowModel()),
1271
+ getRowModel: () => n.getPaginationRowModel(),
1272
+ getRow: (e, t) => {
1273
+ let r = (t ? n.getPrePaginationRowModel() : n.getRowModel()).rowsById[e];
1274
+ if (!r && (r = n.getCoreRowModel().rowsById[e], !r)) throw process.env.NODE_ENV === "production" ? Error() : Error(`getRow could not find row with ID: ${e}`);
1275
+ return r;
1276
+ },
1277
+ _getDefaultColumnDef: Y(() => [n.options.defaultColumn], (e) => (e ??= {}, {
1278
+ header: (e) => {
1279
+ let t = e.header.column.columnDef;
1280
+ return t.accessorKey ? t.accessorKey : t.accessorFn ? t.id : null;
1281
+ },
1282
+ cell: (e) => {
1283
+ var t;
1284
+ return ((t = e.renderValue()) == null || t.toString == null ? void 0 : t.toString()) ?? null;
1285
+ },
1286
+ ...n._features.reduce((e, t) => Object.assign(e, t.getDefaultColumnDef == null ? void 0 : t.getDefaultColumnDef()), {}),
1287
+ ...e
1288
+ }), X(e, "debugColumns", "_getDefaultColumnDef")),
1289
+ _getColumnDefs: () => n.options.columns,
1290
+ getAllColumns: Y(() => [n._getColumnDefs()], (e) => {
1291
+ let t = function(e, r, i) {
1292
+ return i === void 0 && (i = 0), e.map((e) => {
1293
+ let a = ke(n, e, i, r), o = e;
1294
+ return a.columns = o.columns ? t(o.columns, a, i + 1) : [], a;
1295
+ });
1296
+ };
1297
+ return t(e);
1298
+ }, X(e, "debugColumns", "getAllColumns")),
1299
+ getAllFlatColumns: Y(() => [n.getAllColumns()], (e) => e.flatMap((e) => e.getFlatColumns()), X(e, "debugColumns", "getAllFlatColumns")),
1300
+ _getAllFlatColumnsById: Y(() => [n.getAllFlatColumns()], (e) => e.reduce((e, t) => (e[t.id] = t, e), {}), X(e, "debugColumns", "getAllFlatColumnsById")),
1301
+ getAllLeafColumns: Y(() => [n.getAllColumns(), n._getOrderColumnsFn()], (e, t) => t(e.flatMap((e) => e.getLeafColumns())), X(e, "debugColumns", "getAllLeafColumns")),
1302
+ getColumn: (e) => {
1303
+ let t = n._getAllFlatColumnsById()[e];
1304
+ return process.env.NODE_ENV !== "production" && !t && console.error(`[Table] Column with id '${e}' does not exist.`), t;
1305
+ }
1306
+ };
1307
+ Object.assign(n, c);
1308
+ for (let e = 0; e < n._features.length; e++) {
1309
+ let t = n._features[e];
1310
+ t == null || t.createTable == null || t.createTable(n);
1311
+ }
1312
+ return n;
1313
+ }
1314
+ function Ft() {
1315
+ return (e) => Y(() => [e.options.data], (t) => {
1316
+ let n = {
1317
+ rows: [],
1318
+ flatRows: [],
1319
+ rowsById: {}
1320
+ }, r = function(t, i, a) {
1321
+ i === void 0 && (i = 0);
1322
+ let o = [];
1323
+ for (let c = 0; c < t.length; c++) {
1324
+ let l = Ne(e, e._getRowId(t[c], c, a), t[c], c, i, void 0, a?.id);
1325
+ if (n.flatRows.push(l), n.rowsById[l.id] = l, o.push(l), e.options.getSubRows) {
1326
+ var s;
1327
+ l.originalSubRows = e.options.getSubRows(t[c], c), (s = l.originalSubRows) != null && s.length && (l.subRows = r(l.originalSubRows, i + 1, l));
1328
+ }
1329
+ }
1330
+ return o;
1331
+ };
1332
+ return n.rows = r(t), n;
1333
+ }, X(e.options, "debugTable", "getRowModel", () => e._autoResetPageIndex()));
1334
+ }
1335
+ function It() {
1336
+ return (e) => Y(() => [
1337
+ e.getState().expanded,
1338
+ e.getPreExpandedRowModel(),
1339
+ e.options.paginateExpandedRows
1340
+ ], (e, t, n) => !t.rows.length || e !== !0 && !Object.keys(e ?? {}).length || !n ? t : Lt(t), X(e.options, "debugTable", "getExpandedRowModel"));
1341
+ }
1342
+ function Lt(e) {
1343
+ let t = [], n = (e) => {
1344
+ var r;
1345
+ t.push(e), (r = e.subRows) != null && r.length && e.getIsExpanded() && e.subRows.forEach(n);
1346
+ };
1347
+ return e.rows.forEach(n), {
1348
+ rows: t,
1349
+ flatRows: e.flatRows,
1350
+ rowsById: e.rowsById
1351
+ };
1352
+ }
1353
+ function Rt(e, t, n) {
1354
+ return n.options.filterFromLeafRows ? zt(e, t, n) : Bt(e, t, n);
1355
+ }
1356
+ function zt(e, t, n) {
1357
+ let r = [], i = {}, a = n.options.maxLeafRowFilterDepth ?? 100, o = function(e, s) {
1358
+ s === void 0 && (s = 0);
1359
+ let c = [];
1360
+ for (let u = 0; u < e.length; u++) {
1361
+ var l;
1362
+ let d = e[u], f = Ne(n, d.id, d.original, d.index, d.depth, void 0, d.parentId);
1363
+ if (f.columnFilters = d.columnFilters, (l = d.subRows) != null && l.length && s < a) {
1364
+ if (f.subRows = o(d.subRows, s + 1), d = f, t(d) && !f.subRows.length) {
1365
+ c.push(d), i[d.id] = d, r.push(d);
1366
+ continue;
1367
+ }
1368
+ if (t(d) || f.subRows.length) {
1369
+ c.push(d), i[d.id] = d, r.push(d);
1370
+ continue;
1371
+ }
1372
+ } else d = f, t(d) && (c.push(d), i[d.id] = d, r.push(d));
1373
+ }
1374
+ return c;
1375
+ };
1376
+ return {
1377
+ rows: o(e),
1378
+ flatRows: r,
1379
+ rowsById: i
1380
+ };
1381
+ }
1382
+ function Bt(e, t, n) {
1383
+ let r = [], i = {}, a = n.options.maxLeafRowFilterDepth ?? 100, o = function(e, s) {
1384
+ s === void 0 && (s = 0);
1385
+ let c = [];
1386
+ for (let u = 0; u < e.length; u++) {
1387
+ let d = e[u];
1388
+ if (t(d)) {
1389
+ var l;
1390
+ if ((l = d.subRows) != null && l.length && s < a) {
1391
+ let e = Ne(n, d.id, d.original, d.index, d.depth, void 0, d.parentId);
1392
+ e.subRows = o(d.subRows, s + 1), d = e;
1393
+ }
1394
+ c.push(d), r.push(d), i[d.id] = d;
1395
+ }
1396
+ }
1397
+ return c;
1398
+ };
1399
+ return {
1400
+ rows: o(e),
1401
+ flatRows: r,
1402
+ rowsById: i
1403
+ };
1404
+ }
1405
+ function Vt() {
1406
+ return (e) => Y(() => [
1407
+ e.getPreFilteredRowModel(),
1408
+ e.getState().columnFilters,
1409
+ e.getState().globalFilter
1410
+ ], (t, n, r) => {
1411
+ if (!t.rows.length || !(n != null && n.length) && !r) {
1412
+ for (let e = 0; e < t.flatRows.length; e++) t.flatRows[e].columnFilters = {}, t.flatRows[e].columnFiltersMeta = {};
1413
+ return t;
1414
+ }
1415
+ let i = [], a = [];
1416
+ (n ?? []).forEach((t) => {
1417
+ let n = e.getColumn(t.id);
1418
+ if (!n) return;
1419
+ let r = n.getFilterFn();
1420
+ if (!r) {
1421
+ process.env.NODE_ENV !== "production" && console.warn(`Could not find a valid 'column.filterFn' for column with the ID: ${n.id}.`);
1422
+ return;
1423
+ }
1424
+ i.push({
1425
+ id: t.id,
1426
+ filterFn: r,
1427
+ resolvedValue: (r.resolveFilterValue == null ? void 0 : r.resolveFilterValue(t.value)) ?? t.value
1428
+ });
1429
+ });
1430
+ let o = (n ?? []).map((e) => e.id), s = e.getGlobalFilterFn(), c = e.getAllLeafColumns().filter((e) => e.getCanGlobalFilter());
1431
+ r && s && c.length && (o.push("__global__"), c.forEach((e) => {
1432
+ a.push({
1433
+ id: e.id,
1434
+ filterFn: s,
1435
+ resolvedValue: (s.resolveFilterValue == null ? void 0 : s.resolveFilterValue(r)) ?? r
1436
+ });
1437
+ }));
1438
+ let l, u;
1439
+ for (let e = 0; e < t.flatRows.length; e++) {
1440
+ let n = t.flatRows[e];
1441
+ if (n.columnFilters = {}, i.length) for (let e = 0; e < i.length; e++) {
1442
+ l = i[e];
1443
+ let t = l.id;
1444
+ n.columnFilters[t] = l.filterFn(n, t, l.resolvedValue, (e) => {
1445
+ n.columnFiltersMeta[t] = e;
1446
+ });
1447
+ }
1448
+ if (a.length) {
1449
+ for (let e = 0; e < a.length; e++) {
1450
+ u = a[e];
1451
+ let t = u.id;
1452
+ if (u.filterFn(n, t, u.resolvedValue, (e) => {
1453
+ n.columnFiltersMeta[t] = e;
1454
+ })) {
1455
+ n.columnFilters.__global__ = !0;
1456
+ break;
1457
+ }
1458
+ }
1459
+ n.columnFilters.__global__ !== !0 && (n.columnFilters.__global__ = !1);
1460
+ }
1461
+ }
1462
+ return Rt(t.rows, (e) => {
1463
+ for (let t = 0; t < o.length; t++) if (e.columnFilters[o[t]] === !1) return !1;
1464
+ return !0;
1465
+ }, e);
1466
+ }, X(e.options, "debugTable", "getFilteredRowModel", () => e._autoResetPageIndex()));
1467
+ }
1468
+ function Ht(e) {
1469
+ return (e) => Y(() => [
1470
+ e.getState().pagination,
1471
+ e.getPrePaginationRowModel(),
1472
+ e.options.paginateExpandedRows ? void 0 : e.getState().expanded
1473
+ ], (t, n) => {
1474
+ if (!n.rows.length) return n;
1475
+ let { pageSize: r, pageIndex: i } = t, { rows: a, flatRows: o, rowsById: s } = n, c = r * i, l = c + r;
1476
+ a = a.slice(c, l);
1477
+ let u;
1478
+ u = e.options.paginateExpandedRows ? {
1479
+ rows: a,
1480
+ flatRows: o,
1481
+ rowsById: s
1482
+ } : Lt({
1483
+ rows: a,
1484
+ flatRows: o,
1485
+ rowsById: s
1486
+ }), u.flatRows = [];
1487
+ let d = (e) => {
1488
+ u.flatRows.push(e), e.subRows.length && e.subRows.forEach(d);
1489
+ };
1490
+ return u.rows.forEach(d), u;
1491
+ }, X(e.options, "debugTable", "getPaginationRowModel"));
1492
+ }
1493
+ function Ut() {
1494
+ return (e) => Y(() => [e.getState().sorting, e.getPreSortedRowModel()], (t, n) => {
1495
+ if (!n.rows.length || !(t != null && t.length)) return n;
1496
+ let r = e.getState().sorting, i = [], a = r.filter((t) => e.getColumn(t.id)?.getCanSort()), o = {};
1497
+ a.forEach((t) => {
1498
+ let n = e.getColumn(t.id);
1499
+ n && (o[t.id] = {
1500
+ sortUndefined: n.columnDef.sortUndefined,
1501
+ invertSorting: n.columnDef.invertSorting,
1502
+ sortingFn: n.getSortingFn()
1503
+ });
1504
+ });
1505
+ let s = (e) => {
1506
+ let t = e.map((e) => ({ ...e }));
1507
+ return t.sort((e, t) => {
1508
+ for (let n = 0; n < a.length; n += 1) {
1509
+ let r = a[n], i = o[r.id], s = i.sortUndefined, c = r?.desc ?? !1, l = 0;
1510
+ if (s) {
1511
+ let n = e.getValue(r.id), i = t.getValue(r.id), a = n === void 0, o = i === void 0;
1512
+ if (a || o) {
1513
+ if (s === "first") return a ? -1 : 1;
1514
+ if (s === "last") return a ? 1 : -1;
1515
+ l = a && o ? 0 : a ? s : -s;
1516
+ }
1517
+ }
1518
+ if (l === 0 && (l = i.sortingFn(e, t, r.id)), l !== 0) return c && (l *= -1), i.invertSorting && (l *= -1), l;
1519
+ }
1520
+ return e.index - t.index;
1521
+ }), t.forEach((e) => {
1522
+ var t;
1523
+ i.push(e), (t = e.subRows) != null && t.length && (e.subRows = s(e.subRows));
1524
+ }), t;
1525
+ };
1526
+ return {
1527
+ rows: s(n.rows),
1528
+ flatRows: i,
1529
+ rowsById: n.rowsById
1530
+ };
1531
+ }, X(e.options, "debugTable", "getSortedRowModel", () => e._autoResetPageIndex()));
1532
+ }
1533
+ //#endregion
1534
+ //#region ../node_modules/.pnpm/@tanstack+vue-table@8.21.3_vue@3.5.34_typescript@6.0.3_/node_modules/@tanstack/vue-table/build/lib/index.mjs
1535
+ function Wt() {
1536
+ return !0;
1537
+ }
1538
+ var Gt = Symbol("merge-proxy"), Kt = {
1539
+ get(e, t, n) {
1540
+ return t === Gt ? n : e.get(t);
1541
+ },
1542
+ has(e, t) {
1543
+ return e.has(t);
1544
+ },
1545
+ set: Wt,
1546
+ deleteProperty: Wt,
1547
+ getOwnPropertyDescriptor(e, t) {
1548
+ return {
1549
+ configurable: !0,
1550
+ enumerable: !0,
1551
+ get() {
1552
+ return e.get(t);
1553
+ },
1554
+ set: Wt,
1555
+ deleteProperty: Wt
1556
+ };
1557
+ },
1558
+ ownKeys(e) {
1559
+ return e.keys();
1560
+ }
1561
+ };
1562
+ function qt(e) {
1563
+ return "value" in e ? e.value : e;
1564
+ }
1565
+ function Jt() {
1566
+ var e = [...arguments];
1567
+ return new Proxy({
1568
+ get(t) {
1569
+ for (let n = e.length - 1; n >= 0; n--) {
1570
+ let r = qt(e[n])[t];
1571
+ if (r !== void 0) return r;
1572
+ }
1573
+ },
1574
+ has(t) {
1575
+ for (let n = e.length - 1; n >= 0; n--) if (t in qt(e[n])) return !0;
1576
+ return !1;
1577
+ },
1578
+ keys() {
1579
+ let t = [];
1580
+ for (let n = 0; n < e.length; n++) t.push(...Object.keys(qt(e[n])));
1581
+ return [...Array.from(new Set(t))];
1582
+ }
1583
+ }, Kt);
1584
+ }
1585
+ var Yt = T({
1586
+ props: ["render", "props"],
1587
+ setup: (e) => () => typeof e.render == "function" || typeof e.render == "object" ? E(e.render, e.props) : e.render
1588
+ });
1589
+ function Xt(e) {
1590
+ return Jt(e, { data: H(e.data) });
1591
+ }
1592
+ function Zt(e) {
1593
+ let t = O(e.data), n = Pt(Jt({
1594
+ state: {},
1595
+ onStateChange: () => {},
1596
+ renderFallbackValue: null,
1597
+ mergeOptions(e, n) {
1598
+ return t ? {
1599
+ ...e,
1600
+ ...n
1601
+ } : Jt(e, n);
1602
+ }
1603
+ }, t ? Xt(e) : e));
1604
+ if (t) {
1605
+ let t = ee(e.data);
1606
+ U(t, () => {
1607
+ n.setState((e) => ({
1608
+ ...e,
1609
+ data: t.value
1610
+ }));
1611
+ }, { immediate: !0 });
1612
+ }
1613
+ let r = L(n.initialState);
1614
+ return W(() => {
1615
+ n.setOptions((n) => {
1616
+ let i = new Proxy({}, { get: (e, t) => r.value[t] });
1617
+ return Jt(n, t ? Xt(e) : e, {
1618
+ state: Jt(i, e.state ?? {}),
1619
+ onStateChange: (t) => {
1620
+ t instanceof Function ? r.value = t(r.value) : r.value = t, e.onStateChange == null || e.onStateChange(t);
1621
+ }
1622
+ });
1623
+ });
1624
+ }), n;
1625
+ }
1626
+ //#endregion
1627
+ //#region src/table/components/DataTablePagination.vue?vue&type=script&setup=true&lang.ts
1628
+ var Qt = {
1629
+ key: 0,
1630
+ class: "flex flex-wrap items-center justify-between w-full gap-4 pl-2"
1631
+ }, $t = { class: "flex-1 text-sm text-muted-foreground whitespace-nowrap" }, en = { class: "flex items-center space-x-4 @2xl:space-x-8" }, tn = { class: "items-center space-x-2 hidden @xl:flex" }, nn = { class: "flex w-[100px] items-center justify-start text-sm font-medium" }, rn = { class: "flex items-center gap-x-2" }, an = { class: "w-full items-center space-x-2 flex @xl:hidden pl-2" }, on = /* @__PURE__ */ T({
1632
+ __name: "DataTablePagination",
1633
+ props: { table: {} },
1634
+ setup(e) {
1635
+ let t = D("sortMode");
1636
+ return (n, r) => {
1637
+ let i = z("SelectValue"), a = z("SelectTrigger"), o = z("SelectItem"), s = z("SelectContent"), c = z("Select"), l = z("Button");
1638
+ return P(), x(_, null, [H(t) ? b("", !0) : (P(), x("div", Qt, [S("div", $t, V(e.table.getFilteredSelectedRowModel().rows.length) + " of " + V(e.table.getFilteredRowModel().rows.length) + " row(s) selected. ", 1), S("div", en, [
1639
+ S("div", tn, [r[4] ||= S("p", { class: "text-sm font-medium" }, " Rows per page ", -1), w(c, {
1640
+ "model-value": `${e.table.getState().pagination.pageSize}`,
1641
+ "onUpdate:modelValue": e.table.setPageSize
1642
+ }, {
1643
+ default: G(() => [w(a, { class: "h-8 w-[70px]" }, {
1644
+ default: G(() => [w(i, { placeholder: `${e.table.getState().pagination.pageSize}` }, null, 8, ["placeholder"])]),
1645
+ _: 1
1646
+ }), w(s, { side: "top" }, {
1647
+ default: G(() => [(P(), x(_, null, R([
1648
+ 10,
1649
+ 20,
1650
+ 30,
1651
+ 40,
1652
+ 50
1653
+ ], (e) => w(o, {
1654
+ key: e,
1655
+ value: `${e}`
1656
+ }, {
1657
+ default: G(() => [C(V(e), 1)]),
1658
+ _: 2
1659
+ }, 1032, ["value"])), 64))]),
1660
+ _: 1
1661
+ })]),
1662
+ _: 1
1663
+ }, 8, ["model-value", "onUpdate:modelValue"])]),
1664
+ S("div", nn, " Page " + V(e.table.getState().pagination.pageIndex + 1) + " of " + V(e.table.getPageCount()), 1),
1665
+ S("div", rn, [
1666
+ w(l, {
1667
+ variant: "outline",
1668
+ class: "hidden size-8 p-0 lg:flex",
1669
+ disabled: !e.table.getCanPreviousPage(),
1670
+ onClick: r[0] ||= (t) => e.table.setPageIndex(0)
1671
+ }, {
1672
+ default: G(() => [r[5] ||= S("span", { class: "sr-only" }, "Go to first page", -1), w(H(le), { class: "size-4" })]),
1673
+ _: 1
1674
+ }, 8, ["disabled"]),
1675
+ w(l, {
1676
+ variant: "outline",
1677
+ class: "size-8 p-0",
1678
+ disabled: !e.table.getCanPreviousPage(),
1679
+ onClick: r[1] ||= (t) => e.table.previousPage()
1680
+ }, {
1681
+ default: G(() => [r[6] ||= S("span", { class: "sr-only" }, "Go to previous page", -1), w(H(oe), { class: "size-4" })]),
1682
+ _: 1
1683
+ }, 8, ["disabled"]),
1684
+ w(l, {
1685
+ variant: "outline",
1686
+ class: "size-8 p-0",
1687
+ disabled: !e.table.getCanNextPage(),
1688
+ onClick: r[2] ||= (t) => e.table.nextPage()
1689
+ }, {
1690
+ default: G(() => [r[7] ||= S("span", { class: "sr-only" }, "Go to next page", -1), w(H(se), { class: "size-4" })]),
1691
+ _: 1
1692
+ }, 8, ["disabled"]),
1693
+ w(l, {
1694
+ variant: "outline",
1695
+ class: "hidden size-8 p-0 lg:flex",
1696
+ disabled: !e.table.getCanNextPage(),
1697
+ onClick: r[3] ||= (t) => e.table.setPageIndex(e.table.getPageCount() - 1)
1698
+ }, {
1699
+ default: G(() => [r[8] ||= S("span", { class: "sr-only" }, "Go to last page", -1), w(H(ue), { class: "size-4" })]),
1700
+ _: 1
1701
+ }, 8, ["disabled"])
1702
+ ])
1703
+ ])])), S("div", an, [r[9] ||= S("p", { class: "text-sm font-medium" }, " Rows per page ", -1), w(c, {
1704
+ "model-value": `${e.table.getState().pagination.pageSize}`,
1705
+ "onUpdate:modelValue": e.table.setPageSize
1706
+ }, {
1707
+ default: G(() => [w(a, { class: "h-8 w-[70px]" }, {
1708
+ default: G(() => [w(i, { placeholder: `${e.table.getState().pagination.pageSize}` }, null, 8, ["placeholder"])]),
1709
+ _: 1
1710
+ }), w(s, { side: "top" }, {
1711
+ default: G(() => [(P(), x(_, null, R([
1712
+ 10,
1713
+ 20,
1714
+ 30,
1715
+ 40,
1716
+ 50
1717
+ ], (e) => w(o, {
1718
+ key: e,
1719
+ value: `${e}`
1720
+ }, {
1721
+ default: G(() => [C(V(e), 1)]),
1722
+ _: 2
1723
+ }, 1032, ["value"])), 64))]),
1724
+ _: 1
1725
+ })]),
1726
+ _: 1
1727
+ }, 8, ["model-value", "onUpdate:modelValue"])])], 64);
1728
+ };
1729
+ }
1730
+ }), sn = { class: "w-full" }, cn = { class: "grid gap-2 mb-4" }, ln = {
1731
+ key: 0,
1732
+ class: "mt-4"
1733
+ }, un = { class: "my-4" }, dn = { class: "flex items-center justify-between gap-2" }, fn = /* @__PURE__ */ T({
1734
+ __name: "TableRowEditor",
1735
+ props: { modelValue: {
1736
+ type: Object,
1737
+ required: !0
1738
+ } },
1739
+ emits: ["update:modelValue"],
1740
+ setup(e, { emit: t }) {
1741
+ let n = e, r = D("allAvailableVariables", []), i = t, a = v({
1742
+ get: () => n.modelValue,
1743
+ set: (e) => {
1744
+ i("update:modelValue", e);
1745
+ }
1746
+ });
1747
+ return (e, t) => {
1748
+ let n = z("SelectValue"), i = z("SelectTrigger"), o = z("SelectItem"), s = z("SelectGroup"), c = z("SelectContent"), l = z("Select"), u = z("CodeEditor"), d = z("Switch");
1749
+ return P(), x("div", sn, [
1750
+ t[11] ||= S("p", { class: "text-sm text-muted-foreground mb-4" }, " Performs visual row actions. Actual data changes must be handled in your connected flows. ", -1),
1751
+ S("div", cn, [t[7] ||= S("p", { class: "text-sm font-semibold" }, "Method", -1), w(l, {
1752
+ modelValue: a.value.data.method,
1753
+ "onUpdate:modelValue": t[0] ||= (e) => a.value.data.method = e
1754
+ }, {
1755
+ default: G(() => [w(i, { class: "w-full" }, {
1756
+ default: G(() => [w(n, { placeholder: "Select a method" })]),
1757
+ _: 1
1758
+ }), w(c, null, {
1759
+ default: G(() => [w(s, null, {
1760
+ default: G(() => [
1761
+ w(o, { value: "CREATE" }, {
1762
+ default: G(() => [...t[4] ||= [C("Create new row", -1)]]),
1763
+ _: 1
1764
+ }),
1765
+ w(o, { value: "UPDATE" }, {
1766
+ default: G(() => [...t[5] ||= [C("Update row", -1)]]),
1767
+ _: 1
1768
+ }),
1769
+ w(o, { value: "REMOVE" }, {
1770
+ default: G(() => [...t[6] ||= [C("Remove row", -1)]]),
1771
+ _: 1
1772
+ })
1773
+ ]),
1774
+ _: 1
1775
+ })]),
1776
+ _: 1
1777
+ })]),
1778
+ _: 1
1779
+ }, 8, ["modelValue"])]),
1780
+ a.value.data.method === "CREATE" ? (P(), x("div", ln, [w(u, {
1781
+ modelValue: a.value.data.returnValueFn,
1782
+ "onUpdate:modelValue": t[1] ||= (e) => a.value.data.returnValueFn = e,
1783
+ variables: H(r),
1784
+ placeholder: "return ...",
1785
+ class: "mb-1"
1786
+ }, null, 8, ["modelValue", "variables"]), t[8] ||= S("p", { class: "text-xs text-stone-500" }, [
1787
+ C("Just make sure you "),
1788
+ S("b", null, "return"),
1789
+ C(" a value")
1790
+ ], -1)])) : a.value.data.method === "UPDATE" ? (P(), x(_, { key: 1 }, [S("div", un, [w(u, {
1791
+ modelValue: a.value.data.returnValueFn,
1792
+ "onUpdate:modelValue": t[2] ||= (e) => a.value.data.returnValueFn = e,
1793
+ variables: H(r),
1794
+ placeholder: "return ...",
1795
+ class: "mb-1"
1796
+ }, null, 8, ["modelValue", "variables"]), t[9] ||= S("p", { class: "text-xs text-stone-500" }, [
1797
+ C("Just make sure you "),
1798
+ S("b", null, "return"),
1799
+ C(" a value")
1800
+ ], -1)]), S("div", dn, [t[10] ||= S("label", {
1801
+ class: "text-sm font-semibold select-none",
1802
+ for: "return-data"
1803
+ }, "Merge data", -1), w(d, {
1804
+ modelValue: a.value.data.mergeData,
1805
+ "onUpdate:modelValue": t[3] ||= (e) => a.value.data.mergeData = e,
1806
+ id: "return-data"
1807
+ }, null, 8, ["modelValue"])])], 64)) : b("", !0)
1808
+ ]);
1809
+ };
1810
+ }
1811
+ }), pn = { class: "flex items-center gap-2" }, mn = { key: 0 }, hn = { key: 1 }, gn = { key: 2 }, _n = {
1812
+ key: 3,
1813
+ class: "opacity-50"
1814
+ }, vn = {
1815
+ __name: "TableRowNode",
1816
+ props: Ce,
1817
+ setup(e) {
1818
+ return (e, t) => (P(), y(H(xe), {
1819
+ nodeId: e.id,
1820
+ toolbarVisible: e.data.toolbarVisible,
1821
+ toolbarPosition: e.data.toolbarPosition
1822
+ }, {
1823
+ default: G(() => [
1824
+ w(H(ye), {
1825
+ type: "target",
1826
+ position: H(Se).Left
1827
+ }, null, 8, ["position"]),
1828
+ S("div", pn, [S("div", { class: j(["size-8 text-white rounded-xl flex items-center justify-center", `${e.data.method ? "bg-blue-500" : "bg-gray-600 opacity-50"}`]) }, [w(H(pe), { class: "size-5" })], 2), S("div", null, [e.data.method === "CREATE" ? (P(), x("span", mn, "Table: Create row")) : e.data.method === "UPDATE" ? (P(), x("span", hn, "Table: Update row")) : e.data.method === "REMOVE" ? (P(), x("span", gn, "Table: Remove row")) : (P(), x("span", _n, "Select a table method"))])]),
1829
+ w(H(be), { nodeId: e.id }, null, 8, ["nodeId"]),
1830
+ w(H(ye), {
1831
+ type: "source",
1832
+ id: "success",
1833
+ position: H(Se).Right
1834
+ }, null, 8, ["position"])
1835
+ ]),
1836
+ _: 1
1837
+ }, 8, [
1838
+ "nodeId",
1839
+ "toolbarVisible",
1840
+ "toolbarPosition"
1841
+ ]));
1842
+ }
1843
+ };
1844
+ //#endregion
1845
+ //#region src/table/flow-builder-extensions/row-item.ts
1846
+ function yn(e = {}) {
1847
+ let { tableRowActions: t } = e;
1848
+ return {
1849
+ type: {
1850
+ label: "Table row action",
1851
+ value: "table-row-action",
1852
+ icon: k(pe),
1853
+ buttonClass: "bg-gray-800 text-white"
1854
+ },
1855
+ editor: k(fn),
1856
+ node: k(vn),
1857
+ async processFunction(e, { node: n }) {
1858
+ if (!t) {
1859
+ console.warn("[table-row-action] No tableRowActions provided, ignoring action.");
1860
+ return;
1861
+ }
1862
+ let r = bn(n.data.returnValueFn, e);
1863
+ switch (n.data.method) {
1864
+ case "CREATE": return t.create(r), { finishedTableAction: !0 };
1865
+ case "UPDATE": return t.update(e.tableActiveRowIndex, r, n.data.mergeData || !1), { finishedTableAction: !0 };
1866
+ case "REMOVE": return t.remove(e.tableActiveRowIndex), { finishedTableAction: !0 };
1867
+ default: return;
1868
+ }
1869
+ }
1870
+ };
1871
+ }
1872
+ var bn = (e, t = {}) => Function(...Object.keys(t), "'use strict';" + e)(...Object.values(t)), xn = /* @__PURE__ */ T({
1873
+ __name: "DataTableAction",
1874
+ props: {
1875
+ action: {},
1876
+ row: {}
1877
+ },
1878
+ setup(e) {
1879
+ let t = e, n = D("data"), r = D("isPerformingDataTableAction", L(!1)), { runFlow: i } = d(), a = v(() => t.action.visible ? [!0, "true"].includes(l(t.action.visible, [{
1880
+ name: "item",
1881
+ value: { data: { ...t.row.original } },
1882
+ type: "object"
1883
+ }, ...Object.entries(t.row.original).map(([e, t]) => ({
1884
+ name: e,
1885
+ value: t,
1886
+ type: typeof t
1887
+ }))])) : !0), o = async () => {
1888
+ r.value = !0, await i(t.action.flow, [{
1889
+ name: "item",
1890
+ value: { data: { ...t.row.original } },
1891
+ type: "object"
1892
+ }, {
1893
+ name: "tableActiveRowIndex",
1894
+ type: "number",
1895
+ value: t.row.index
1896
+ }], [], [yn({ tableRowActions: {
1897
+ create: (e) => {
1898
+ n.value.push(e);
1899
+ },
1900
+ update: (e, t, r) => {
1901
+ r ? n.value[e] = {
1902
+ ...n.value[e],
1903
+ ...t
1904
+ } : n.value[e] = t;
1905
+ },
1906
+ remove: (e) => {
1907
+ n.value.splice(e, 1);
1908
+ }
1909
+ } })]), r.value = !1;
1910
+ };
1911
+ return (t, n) => {
1912
+ let i = z("Button"), s = z("TooltipTrigger"), c = z("TooltipContent"), l = z("Tooltip");
1913
+ return a.value ? (P(), y(l, { key: 0 }, {
1914
+ default: G(() => [w(s, { "as-child": "" }, {
1915
+ default: G(() => [w(i, {
1916
+ variant: "ghost",
1917
+ size: "icon",
1918
+ onClick: n[0] ||= K((e) => o(), ["stop"]),
1919
+ class: j(["size-5", { "opacity-50": H(r) }]),
1920
+ "data-title": e.action.label,
1921
+ disabled: H(r)
1922
+ }, {
1923
+ default: G(() => [(P(), y(B(H(ge)[e.action.icon])))]),
1924
+ _: 1
1925
+ }, 8, [
1926
+ "data-title",
1927
+ "disabled",
1928
+ "class"
1929
+ ])]),
1930
+ _: 1
1931
+ }), w(c, null, {
1932
+ default: G(() => [S("p", null, V(e.action.label), 1)]),
1933
+ _: 1
1934
+ })]),
1935
+ _: 1
1936
+ })) : b("", !0);
1937
+ };
1938
+ }
1939
+ }), Sn = { class: "mx-auto w-full max-w-sm mt-8 px-4 overflow-y-auto" }, Cn = {
1940
+ key: 0,
1941
+ class: "flex flex-col gap-1.5 mb-6 px-1"
1942
+ }, wn = { class: "text-muted-foreground text-sm shrink-0" }, Tn = ["src", "alt"], En = { class: "text-muted-foreground text-sm shrink-0" }, Dn = ["href"], On = { class: "text-muted-foreground text-sm shrink-0" }, kn = ["href"], An = { class: "text-muted-foreground text-sm shrink-0" }, jn = ["href"], Mn = { class: "text-muted-foreground text-sm shrink-0" }, Nn = { class: "text-sm" }, Pn = { class: "w-full flex flex-col gap-2 mb-4" }, Fn = ["innerHTML"], In = /* @__PURE__ */ T({
1943
+ __name: "DataTableMobileRowActionDrawer",
1944
+ setup(e, { expose: t }) {
1945
+ let { formatCurrency: n } = g(), r = D("columns", L([])), i = L(!1), a = L([]), s = L(null), c = v(() => r.value?.filter((e) => e.visible) || []), l = (e, t) => {
1946
+ if (e) return t.includes(".") ? t.split(".").reduce((e, t) => e?.[t], e) : e[t];
1947
+ }, u = (e, t) => {
1948
+ if (e == null) return "";
1949
+ if (t.type === "number") return isNaN(e) ? e : parseFloat(e)?.toFixed(2)?.replace(".00", "");
1950
+ if (t.type === "datetime") return new Date(e)?.toLocaleString() ?? "";
1951
+ if (t.type === "currency") return n(e);
1952
+ if (t.type === "boolean") return e ? "Yes" : "No";
1953
+ if (t.type === "array") return Array.isArray(e) ? e.join(", ") : "";
1954
+ if (t.type === "html") {
1955
+ let t = document.createElement("div");
1956
+ t.innerHTML = e || "";
1957
+ let n = t.innerText || t.textContent || "";
1958
+ return n.length > 100 ? n.substring(0, 100) + "..." : n;
1959
+ }
1960
+ return String(e);
1961
+ };
1962
+ U(i, (e) => {
1963
+ e || (a.value = [], s.value = null);
1964
+ });
1965
+ let d = (e, t, n = !1) => {
1966
+ if (!o() && !n) return;
1967
+ a.value = [], s.value = t || null;
1968
+ let r = [];
1969
+ i.value = !0, e.target.closest("[data-slot=\"table-row\"]")?.querySelectorAll(".data-table-row-actions button").forEach((e) => {
1970
+ r.push({
1971
+ label: e.getAttribute("data-title") || "",
1972
+ icon: e.querySelector("svg")?.outerHTML || "",
1973
+ onClick: () => e.click()
1974
+ });
1975
+ }), a.value = r;
1976
+ }, f = (e) => {
1977
+ e.onClick(), i.value = !1;
1978
+ };
1979
+ return t({ onRowClick: d }), (e, t) => {
1980
+ let n = z("Button"), r = z("DrawerClose"), o = z("DrawerContent"), d = z("Drawer");
1981
+ return P(), y(d, {
1982
+ open: i.value,
1983
+ "onUpdate:open": t[0] ||= (e) => i.value = e
1984
+ }, {
1985
+ default: G(() => [w(o, null, {
1986
+ default: G(() => [S("div", Sn, [
1987
+ s.value && c.value.length > 0 ? (P(), x("div", Cn, [(P(!0), x(_, null, R(c.value, (e) => (P(), x("div", {
1988
+ key: e.id,
1989
+ class: "flex items-start gap-2 min-w-0"
1990
+ }, [e.type === "image" ? (P(), x(_, { key: 0 }, [S("span", wn, V(e.label) + ":", 1), l(s.value, e.property) ? (P(), x("img", {
1991
+ key: 0,
1992
+ src: l(s.value, e.property),
1993
+ alt: e.label,
1994
+ class: "size-16 object-cover rounded"
1995
+ }, null, 8, Tn)) : b("", !0)], 64)) : e.type === "URL" ? (P(), x(_, { key: 1 }, [S("span", En, V(e.label) + ":", 1), S("a", {
1996
+ href: l(s.value, e.property),
1997
+ target: "_blank",
1998
+ class: "text-primary text-sm break-all"
1999
+ }, V(l(s.value, e.property)), 9, Dn)], 64)) : e.type === "email" ? (P(), x(_, { key: 2 }, [S("span", On, V(e.label) + ":", 1), S("a", {
2000
+ href: `mailto:${l(s.value, e.property)}`,
2001
+ class: "text-primary text-sm break-all"
2002
+ }, V(l(s.value, e.property)), 9, kn)], 64)) : e.type === "phone" ? (P(), x(_, { key: 3 }, [S("span", An, V(e.label) + ":", 1), S("a", {
2003
+ href: `tel:${l(s.value, e.property)}`,
2004
+ class: "text-primary text-sm"
2005
+ }, V(l(s.value, e.property)), 9, jn)], 64)) : (P(), x(_, { key: 4 }, [S("span", Mn, V(e.label) + ":", 1), S("span", Nn, V(u(l(s.value, e.property), e)), 1)], 64))]))), 128))])) : b("", !0),
2006
+ S("div", Pn, [(P(!0), x(_, null, R(a.value, (e) => (P(), y(n, {
2007
+ variant: "outline",
2008
+ class: "w-full h-11 border-none bg-foreground! text-background! rounded-lg",
2009
+ key: e,
2010
+ onClick: (t) => f(e)
2011
+ }, {
2012
+ default: G(() => [S("div", { innerHTML: e.icon }, null, 8, Fn), C(" " + V(e.label), 1)]),
2013
+ _: 2
2014
+ }, 1032, ["onClick"]))), 128))]),
2015
+ w(r, { "as-child": "" }, {
2016
+ default: G(() => [w(n, {
2017
+ variant: "outline",
2018
+ class: "w-full mb-8 h-11 shadow-none! border-none! active:bg-black/5 dark:active:bg-white/5! rounded-lg"
2019
+ }, {
2020
+ default: G(() => [...t[1] ||= [C(" Cancel ", -1)]]),
2021
+ _: 1
2022
+ })]),
2023
+ _: 1
2024
+ })
2025
+ ])]),
2026
+ _: 1
2027
+ })]),
2028
+ _: 1
2029
+ }, 8, ["open"]);
2030
+ };
2031
+ }
2032
+ }), Ln = ["onClick"], Rn = { class: "flex flex-col gap-0.5 flex-1 min-w-0" }, zn = { class: "text-muted-foreground text-sm shrink-0" }, Bn = ["src", "alt"], Vn = { class: "text-muted-foreground text-sm shrink-0" }, Hn = ["href"], Un = { class: "text-muted-foreground text-sm shrink-0" }, Wn = ["href"], Gn = { class: "text-muted-foreground text-sm shrink-0" }, Kn = ["href"], qn = { class: "text-muted-foreground text-sm shrink-0" }, Jn = { class: "text-sm truncate" }, Yn = {
2033
+ key: 0,
2034
+ class: "data-table-row-actions hidden"
2035
+ }, Xn = {
2036
+ key: 1,
2037
+ class: "px-4 py-6 text-center text-muted-foreground"
2038
+ }, Zn = {
2039
+ key: 0,
2040
+ class: "flex items-center justify-center font-medium border-x border-primary bg-primary/10 -my-[7px] h-[34px] cursor-grab"
2041
+ }, Qn = /* @__PURE__ */ T({
2042
+ __name: "DataTable",
2043
+ setup(e, { expose: t }) {
2044
+ let { Button: n, Checkbox: r } = ve, { $dragAndDrop: a } = useNuxtApp(), { formatCurrency: o } = g(), s = D("integrationId", L("")), c = D("resourcePath", L("")), l = D("table"), d = D("data"), f = D("columns"), p = D("sortMode", L(!1)), m = D("sortModeProperty", L("")), h = D("filters", L([])), T = D("itemActions", L([])), O = D("isPerformingDataTableAction", L(!1)), k = te("mobileActionDrawer"), A = (e, t) => t.includes(".") ? t.split(".").reduce((e, t) => e?.[t], e) : e[t], M = v(() => f.value?.filter((e) => e.visible && e.showInCompactMode) || []), N = (e, t) => {
2045
+ if (e == null) return "";
2046
+ if (t.type === "number") return isNaN(e) ? e : parseFloat(e)?.toFixed(2)?.replace(".00", "");
2047
+ if (t.type === "datetime") return new Date(e)?.toLocaleString() ?? "";
2048
+ if (t.type === "currency") return o(e);
2049
+ if (t.type === "boolean") return e ? "Yes" : "No";
2050
+ if (t.type === "array") return Array.isArray(e) ? e.join(", ") : "";
2051
+ if (t.type === "html") {
2052
+ let t = document.createElement("div");
2053
+ t.innerHTML = e || "";
2054
+ let n = t.innerText || t.textContent || "";
2055
+ return n.length > 100 ? n.substring(0, 100) + "..." : n;
2056
+ }
2057
+ return String(e);
2058
+ }, F = (e, t) => {
2059
+ k.value?.onRowClick(e, t, !0);
2060
+ }, B = (e) => e == null ? "" : Array.isArray(e) ? e.map(B).filter(Boolean).join(" ") : typeof e == "boolean" ? e ? "true yes" : "false no" : e instanceof Date ? e.toISOString().toLowerCase() : typeof e == "object" ? "" : String(e).toLowerCase(), ee = v(() => (f.value ?? []).filter((e) => e.visible && e.property).map((e) => e.property)), W = (e) => ee.value.map((t) => B(A(e, t))).filter(Boolean).join(" "), re = v(() => {
2061
+ let e = [];
2062
+ return p.value ? e.push({
2063
+ id: "drag-handle",
2064
+ enableSorting: !1,
2065
+ enableHiding: !1,
2066
+ header: "",
2067
+ cell: () => E("div", { class: "row-drag-handle cursor-grab text-gray-400" }, [E("svg", {
2068
+ xmlns: "http://www.w3.org/2000/svg",
2069
+ class: "size-4",
2070
+ fill: "none",
2071
+ viewBox: "0 0 24 24",
2072
+ stroke: "currentColor"
2073
+ }, [E("path", {
2074
+ "stroke-linecap": "round",
2075
+ "stroke-linejoin": "round",
2076
+ "stroke-width": "2",
2077
+ d: "M4 10h16M4 14h16"
2078
+ })])])
2079
+ }) : e.push({
2080
+ id: "select",
2081
+ header: ({ table: e }) => E(r, {
2082
+ modelValue: e.getIsAllPageRowsSelected() || e.getIsSomePageRowsSelected() && "indeterminate",
2083
+ "onUpdate:modelValue": (t) => e.toggleAllPageRowsSelected(!!t),
2084
+ ariaLabel: "Select all",
2085
+ class: "border-ring",
2086
+ onClick: (e) => e.stopPropagation(),
2087
+ onPointerdown: (e) => e.stopPropagation(),
2088
+ onKeydown: (e) => {
2089
+ (e.key === " " || e.key === "Enter") && e.stopPropagation();
2090
+ }
2091
+ }),
2092
+ cell: ({ row: e }) => E(r, {
2093
+ class: "border-ring",
2094
+ modelValue: e.getIsSelected(),
2095
+ "onUpdate:modelValue": (t) => e.toggleSelected(!!t),
2096
+ ariaLabel: "Select row",
2097
+ onClick: (e) => e.stopPropagation(),
2098
+ onPointerdown: (e) => e.stopPropagation(),
2099
+ onKeydown: (e) => {
2100
+ (e.key === " " || e.key === "Enter") && e.stopPropagation();
2101
+ }
2102
+ }),
2103
+ enableSorting: !1,
2104
+ enableHiding: !1
2105
+ }), f.value?.forEach((t) => {
2106
+ let i = !!h.value.find((e) => e.property === t.property);
2107
+ t.visible && (t.type === "text" ? e.push({
2108
+ id: t.property,
2109
+ accessorFn: (e) => t.property.includes(".") ? t.property.split(".").reduce((e, t) => e?.[t], e) : e[t.property],
2110
+ header: ({ column: e }) => E(n, {
2111
+ variant: "ghost",
2112
+ disabled: p.value,
2113
+ onClick: () => e.toggleSorting(e.getIsSorted() === "asc")
2114
+ }, () => [t.label, E(ne, { class: "ml-2 size-4" })]),
2115
+ cell: ({ row: e }) => E("div", { class: "max-w-xs line-clamp-3 whitespace-normal break-words select-text" }, e.getValue(t.property)),
2116
+ ...i ? {
2117
+ enableColumnFilter: !0,
2118
+ filterFn: (e, t, n) => {
2119
+ if (!Array.isArray(n) || n.length === 0) return !0;
2120
+ let r = e.getValue(t);
2121
+ return n.includes(r);
2122
+ }
2123
+ } : {}
2124
+ }) : t.type === "number" ? e.push({
2125
+ id: t.property,
2126
+ accessorFn: (e) => t.property.includes(".") ? t.property.split(".").reduce((e, t) => e?.[t], e) : e[t.property],
2127
+ header: ({ column: e }) => E(n, {
2128
+ variant: "ghost",
2129
+ disabled: p.value,
2130
+ onClick: () => e.toggleSorting(e.getIsSorted() === "asc")
2131
+ }, () => [t.label, E(ne, { class: "ml-2 size-4" })]),
2132
+ cell: ({ row: e }) => E("div", { class: "" }, isNaN(e.getValue(t.property)) ? e.getValue(t.property) : parseFloat(e.getValue(t.property))?.toFixed(2)?.replace(".00", ""))
2133
+ }) : t.type === "date" ? e.push({
2134
+ id: t.property,
2135
+ accessorFn: (e) => t.property.includes(".") ? t.property.split(".").reduce((e, t) => e?.[t], e) : e[t.property],
2136
+ header: t.label,
2137
+ cell: ({ row: e }) => E("div", { class: "" }, e.getValue(t.property))
2138
+ }) : t.type === "datetime" ? e.push({
2139
+ id: t.property,
2140
+ accessorFn: (e) => t.property.includes(".") ? t.property.split(".").reduce((e, t) => e?.[t], e) : e[t.property],
2141
+ header: t.label,
2142
+ cell: ({ row: e }) => E("div", { class: "" }, new Date(e.getValue(t.property))?.toLocaleString() ?? "")
2143
+ }) : t.type === "boolean" ? e.push({
2144
+ id: t.property,
2145
+ accessorFn: (e) => t.property.includes(".") ? t.property.split(".").reduce((e, t) => e?.[t], e) : e[t.property],
2146
+ header: t.label,
2147
+ cell: ({ row: e }) => E(r, {
2148
+ modelValue: e.getValue(t.property),
2149
+ disabled: !0,
2150
+ class: "border-ring disabled:cursor-default disabled:opacity-100"
2151
+ })
2152
+ }) : t.type === "URL" ? e.push({
2153
+ id: t.property,
2154
+ accessorFn: (e) => t.property.includes(".") ? t.property.split(".").reduce((e, t) => e?.[t], e) : e[t.property],
2155
+ header: t.label,
2156
+ cell: ({ row: e }) => E("a", {
2157
+ href: e.getValue(t.property),
2158
+ target: "_blank",
2159
+ class: "text-primary",
2160
+ onClick: (e) => e.stopPropagation(),
2161
+ onPointerdown: (e) => e.stopPropagation(),
2162
+ onKeydown: (e) => {
2163
+ (e.key === "Enter" || e.key === " ") && e.stopPropagation();
2164
+ }
2165
+ }, e.getValue(t.property))
2166
+ }) : t.type === "email" ? e.push({
2167
+ id: t.property,
2168
+ accessorFn: (e) => t.property.includes(".") ? t.property.split(".").reduce((e, t) => e?.[t], e) : e[t.property],
2169
+ header: t.label,
2170
+ cell: ({ row: e }) => E("a", {
2171
+ href: `mailto:${e.getValue(t.property)}`,
2172
+ class: "text-primary",
2173
+ onClick: (e) => e.stopPropagation(),
2174
+ onPointerdown: (e) => e.stopPropagation(),
2175
+ onKeydown: (e) => {
2176
+ (e.key === "Enter" || e.key === " ") && e.stopPropagation();
2177
+ }
2178
+ }, e.getValue(t.property))
2179
+ }) : t.type === "phone" ? e.push({
2180
+ id: t.property,
2181
+ accessorFn: (e) => t.property.includes(".") ? t.property.split(".").reduce((e, t) => e?.[t], e) : e[t.property],
2182
+ header: t.label,
2183
+ cell: ({ row: e }) => E("a", {
2184
+ href: `tel:${e.getValue(t.property)}`,
2185
+ class: "text-primary",
2186
+ onClick: (e) => e.stopPropagation(),
2187
+ onPointerdown: (e) => e.stopPropagation(),
2188
+ onKeydown: (e) => {
2189
+ (e.key === "Enter" || e.key === " ") && e.stopPropagation();
2190
+ }
2191
+ }, e.getValue(t.property))
2192
+ }) : t.type === "currency" ? e.push({
2193
+ id: t.property,
2194
+ accessorFn: (e) => t.property.includes(".") ? t.property.split(".").reduce((e, t) => e?.[t], e) : e[t.property],
2195
+ header: t.label,
2196
+ cell: ({ row: e }) => E("div", { class: "" }, o(e.getValue(t.property)))
2197
+ }) : t.type === "image" ? e.push({
2198
+ id: t.property,
2199
+ accessorFn: (e) => t.property.includes(".") ? t.property.split(".").reduce((e, t) => e?.[t], e) : e[t.property],
2200
+ header: t.label,
2201
+ cell: ({ row: e }) => e.getValue(t.property) ? E("img", {
2202
+ src: e.getValue(t.property),
2203
+ alt: t.label,
2204
+ class: "size-16 object-cover"
2205
+ }) : ""
2206
+ }) : t.type === "array" ? e.push({
2207
+ id: t.property,
2208
+ accessorFn: (e) => t.property.includes(".") ? t.property.split(".").reduce((e, t) => e?.[t], e) : e[t.property],
2209
+ header: t.label,
2210
+ cell: ({ row: e }) => {
2211
+ let n = e.getValue(t.property);
2212
+ return Array.isArray(n) ? E("div", {}, n.map((e, t) => E("div", { key: t }, e.toString()))) : E("div", {}, "");
2213
+ }
2214
+ }) : t.type === "html" && e.push({
2215
+ id: t.property,
2216
+ accessorFn: (e) => t.property.includes(".") ? t.property.split(".").reduce((e, t) => e?.[t], e) : e[t.property],
2217
+ header: t.label,
2218
+ cell: ({ row: e }) => {
2219
+ let n = document.createElement("div");
2220
+ n.innerHTML = e.getValue(t.property) || "";
2221
+ let r = n.innerText || n.textContent || "";
2222
+ return E("div", {
2223
+ class: "",
2224
+ innerHTML: r.length > 100 ? r.substring(0, 100) + "..." : r
2225
+ });
2226
+ }
2227
+ }));
2228
+ }), T.value.length > 0 && e.push({
2229
+ id: "actions",
2230
+ enableHiding: !1,
2231
+ cell: ({ row: e }) => E("div", { class: "data-table-row-actions flex items-center justify-center gap-2" }, T.value.map((t) => E(xn, {
2232
+ action: t,
2233
+ row: e
2234
+ })))
2235
+ }), e;
2236
+ }), ie = L(""), ae = L([]), oe = L([]), ce = L({}), le = L({}), ue = L({}), fe = L(/* @__PURE__ */ new Map()), q = L({
2237
+ pageIndex: 0,
2238
+ pageSize: 10
2239
+ });
2240
+ U([d, ee], () => {
2241
+ let e = /* @__PURE__ */ new Map();
2242
+ for (let t of d?.value ?? []) t && typeof t == "object" && e.set(t, W(t));
2243
+ fe.value = e;
2244
+ }, {
2245
+ immediate: !0,
2246
+ deep: !0
2247
+ });
2248
+ let pe = Zt(I({
2249
+ get data() {
2250
+ return d?.value ?? [];
2251
+ },
2252
+ get columns() {
2253
+ return re.value;
2254
+ },
2255
+ enableGlobalFilter: !0,
2256
+ autoResetPageIndex: !1,
2257
+ getGlobalFilter() {
2258
+ return ie.value;
2259
+ },
2260
+ onGlobalFilterChange(e) {
2261
+ i(e, ie);
2262
+ },
2263
+ globalFilterFn: (e, t, n) => {
2264
+ let r = B(n).trim();
2265
+ return r ? (fe.value.get(e.original) ?? W(e.original)).includes(r) : !0;
2266
+ },
2267
+ getCoreRowModel: Ft(),
2268
+ getPaginationRowModel: Ht(),
2269
+ getSortedRowModel: Ut(),
2270
+ getFilteredRowModel: Vt(),
2271
+ getExpandedRowModel: It(),
2272
+ onSortingChange: (e) => i(e, ae),
2273
+ onColumnFiltersChange: (e) => i(e, oe),
2274
+ onColumnVisibilityChange: (e) => i(e, ce),
2275
+ onRowSelectionChange: (e) => i(e, le),
2276
+ onExpandedChange: (e) => i(e, ue),
2277
+ onPaginationChange: (e) => i(e, q),
2278
+ state: {
2279
+ get sorting() {
2280
+ return ae.value;
2281
+ },
2282
+ get columnFilters() {
2283
+ return oe.value;
2284
+ },
2285
+ get columnVisibility() {
2286
+ return ce.value;
2287
+ },
2288
+ get rowSelection() {
2289
+ return le.value;
2290
+ },
2291
+ get expanded() {
2292
+ return ue.value;
2293
+ },
2294
+ get pagination() {
2295
+ return q.value;
2296
+ },
2297
+ get globalFilter() {
2298
+ return ie.value;
2299
+ }
2300
+ }
2301
+ }));
2302
+ l && (l.value = pe), U(p, (e) => {
2303
+ e ? be() : q.value = {
2304
+ pageIndex: ye.value,
2305
+ pageSize: ge.value
2306
+ };
2307
+ });
2308
+ let [me, he] = a([], { plugins: [_e()] }), ge = L(10), ye = L(0), be = () => {
2309
+ ge.value = q.value.pageSize, ye.value = q.value.pageIndex, q.value = {
2310
+ pageIndex: 0,
2311
+ pageSize: 1e4
2312
+ }, he.value = (d?.value ?? []).slice().sort((e, t) => (e[m.value] ?? 0) - (t[m.value] ?? 0)).map((e, t) => ({
2313
+ id: e.id,
2314
+ index: t,
2315
+ original: {
2316
+ ...e,
2317
+ [m.value]: t
2318
+ },
2319
+ getVisibleCells: () => l?.value?.getRowModel().rows?.find((t) => t.original.id === e.id)?.getVisibleCells()
2320
+ }));
2321
+ };
2322
+ return t({ saveSortMode: async () => {
2323
+ let { update: e } = u(s.value);
2324
+ d.value.forEach((t) => {
2325
+ t[m.value] !== he.value.findIndex((e) => e.id === t.id) && (t[m.value] = he.value.findIndex((e) => e.id === t.id), e(c.value, t.id, { [m.value]: t[m.value] }));
2326
+ });
2327
+ } }), (e, t) => {
2328
+ let n = z("TooltipTrigger"), r = z("TooltipContent"), i = z("Tooltip"), a = z("TableHead"), o = z("TableRow"), s = z("TableHeader"), c = z("TableCell"), u = z("TableBody"), d = z("Table");
2329
+ return P(), x(_, null, [
2330
+ M.value.length > 0 ? (P(), x("div", {
2331
+ key: 0,
2332
+ class: j(["@md:hidden -mx-[17px] w-[calc(100%+34px)] bg-background dark:bg-input/30 border-y divide-y", { "cursor-wait": H(O) }])
2333
+ }, [H(l).getRowModel().rows?.length ? (P(!0), x(_, { key: 0 }, R(H(l).getRowModel().rows, (e) => (P(), x("div", {
2334
+ key: e.id,
2335
+ "data-slot": "table-row",
2336
+ class: "flex items-center px-4 py-2.5 active:bg-muted/50 transition-colors",
2337
+ onClick: (t) => F(t, e.original)
2338
+ }, [
2339
+ S("div", Rn, [(P(!0), x(_, null, R(M.value, (n) => (P(), x("div", {
2340
+ key: n.id,
2341
+ class: "flex items-center gap-2 min-w-0"
2342
+ }, [n.type === "image" ? (P(), x(_, { key: 0 }, [S("span", zn, V(n.label) + ":", 1), A(e.original, n.property) ? (P(), x("img", {
2343
+ key: 0,
2344
+ src: A(e.original, n.property),
2345
+ alt: n.label,
2346
+ class: "size-10 object-cover rounded"
2347
+ }, null, 8, Bn)) : b("", !0)], 64)) : n.type === "URL" ? (P(), x(_, { key: 1 }, [S("span", Vn, V(n.label) + ":", 1), S("a", {
2348
+ href: A(e.original, n.property),
2349
+ target: "_blank",
2350
+ class: "text-primary text-sm truncate",
2351
+ onClick: t[0] ||= K(() => {}, ["stop"])
2352
+ }, V(A(e.original, n.property)), 9, Hn)], 64)) : n.type === "email" ? (P(), x(_, { key: 2 }, [S("span", Un, V(n.label) + ":", 1), S("a", {
2353
+ href: `mailto:${A(e.original, n.property)}`,
2354
+ class: "text-primary text-sm truncate",
2355
+ onClick: t[1] ||= K(() => {}, ["stop"])
2356
+ }, V(A(e.original, n.property)), 9, Wn)], 64)) : n.type === "phone" ? (P(), x(_, { key: 3 }, [S("span", Gn, V(n.label) + ":", 1), S("a", {
2357
+ href: `tel:${A(e.original, n.property)}`,
2358
+ class: "text-primary text-sm truncate",
2359
+ onClick: t[2] ||= K(() => {}, ["stop"])
2360
+ }, V(A(e.original, n.property)), 9, Kn)], 64)) : (P(), x(_, { key: 4 }, [S("span", qn, V(n.label) + ":", 1), S("span", Jn, V(N(A(e.original, n.property), n)), 1)], 64))]))), 128))]),
2361
+ w(H(se), { class: "size-4 text-muted-foreground/50 shrink-0 ml-2" }),
2362
+ H(T).length > 0 ? (P(), x("div", Yn, [(P(!0), x(_, null, R(H(T), (t) => (P(), y(xn, {
2363
+ key: t.id,
2364
+ action: t,
2365
+ row: e
2366
+ }, null, 8, ["action", "row"]))), 128))])) : b("", !0)
2367
+ ], 8, Ln))), 128)) : (P(), x("div", Xn, " No results. "))], 2)) : b("", !0),
2368
+ S("div", { class: j(["border bg-background dark:bg-input/30 shadow-xs shadow-xs -mx-[17px] w-[calc(100%+34px)] @md:mx-0 @md:w-full @md:rounded-md", [{ "cursor-wait": H(O) }, M.value.length > 0 ? "hidden @md:block" : ""]]) }, [w(d, null, {
2369
+ default: G(() => [w(s, null, {
2370
+ default: G(() => [(P(!0), x(_, null, R(H(l).getHeaderGroups(), (e) => (P(), y(o, { key: e.id }, {
2371
+ default: G(() => [(P(!0), x(_, null, R(e.headers, (e) => (P(), y(a, { key: e.id }, {
2372
+ default: G(() => [e.isPlaceholder ? b("", !0) : (P(), y(H(Yt), {
2373
+ key: 0,
2374
+ render: e.column.columnDef.header,
2375
+ props: e.getContext()
2376
+ }, null, 8, ["render", "props"])), H(f)?.find((t) => t.property === e.column.columnDef.id)?.showInfoButton ? (P(), y(i, { key: 1 }, {
2377
+ default: G(() => [w(n, { "as-child": "" }, {
2378
+ default: G(() => [w(H(de), { class: "size-4 inline mx-2 -mt-0.5" })]),
2379
+ _: 1
2380
+ }), w(r, null, {
2381
+ default: G(() => [C(V(H(f)?.find((t) => t.property === e.column.columnDef.id)?.infoTooltipText), 1)]),
2382
+ _: 2
2383
+ }, 1024)]),
2384
+ _: 2
2385
+ }, 1024)) : b("", !0)]),
2386
+ _: 2
2387
+ }, 1024))), 128))]),
2388
+ _: 2
2389
+ }, 1024))), 128))]),
2390
+ _: 1
2391
+ }), w(u, {
2392
+ ref_key: "dragContainer",
2393
+ ref: me
2394
+ }, {
2395
+ default: G(() => [H(l).getRowModel().rows?.length ? (P(!0), x(_, { key: 0 }, R(H(p) ? H(he) : H(l).getRowModel().rows, (e, t) => (P(), x(_, { key: e.id }, [w(o, {
2396
+ "data-state": !H(p) && e.getIsSelected() && "selected",
2397
+ class: "group/row",
2398
+ onClick: (t) => H(k).onRowClick(t, e.original)
2399
+ }, {
2400
+ default: G(() => [(P(!0), x(_, null, R(e.getVisibleCells(), (e) => (P(), y(c, { key: e.id }, {
2401
+ default: G(() => [H(p) && e.column.id === H(m) ? (P(), x("span", Zn, V(t), 1)) : (P(), x("div", {
2402
+ key: 1,
2403
+ class: j(H(p) ? "opacity-50 group-hover/row:opacity-100" : "")
2404
+ }, [w(H(Yt), {
2405
+ render: e.column.columnDef.cell,
2406
+ props: e.getContext()
2407
+ }, null, 8, ["render", "props"])], 2))]),
2408
+ _: 2
2409
+ }, 1024))), 128))]),
2410
+ _: 2
2411
+ }, 1032, ["data-state", "onClick"]), !H(p) && e.getIsExpanded() ? (P(), y(o, { key: 0 }, {
2412
+ default: G(() => [w(c, { colspan: e.getAllCells().length }, {
2413
+ default: G(() => [C(V(JSON.stringify(e.original)), 1)]),
2414
+ _: 2
2415
+ }, 1032, ["colspan"])]),
2416
+ _: 2
2417
+ }, 1024)) : b("", !0)], 64))), 128)) : (P(), y(o, { key: 1 }, {
2418
+ default: G(() => [w(c, {
2419
+ colspan: 999,
2420
+ class: "h-24 text-center"
2421
+ }, {
2422
+ default: G(() => [...t[3] ||= [C(" No results. ", -1)]]),
2423
+ _: 1
2424
+ })]),
2425
+ _: 1
2426
+ }))]),
2427
+ _: 1
2428
+ }, 512)]),
2429
+ _: 1
2430
+ })], 2),
2431
+ w(on, { table: H(l) }, null, 8, ["table"]),
2432
+ w(In, {
2433
+ ref_key: "mobileActionDrawer",
2434
+ ref: k
2435
+ }, null, 512)
2436
+ ], 64);
2437
+ };
2438
+ }
2439
+ }), $n = { class: "grid grid-cols-3 gap-2 mb-2 py-2" }, er = { class: "flex flex-col items-start gap-1.5" }, tr = { class: "flex flex-col items-start gap-1.5" }, nr = { class: "flex flex-col gap-1.5" }, rr = {
2440
+ key: 0,
2441
+ class: "flex flex-col gap-2 mb-4"
2442
+ }, ir = { class: "flex flex-col gap-1.5" }, ar = { class: "flex flex-col items-start gap-1.5 col-span-4" }, or = { class: "flex flex-col items-start gap-1.5 col-span-4" }, sr = /* @__PURE__ */ T({
2443
+ __name: "StatDialog",
2444
+ emits: [
2445
+ "statAdded",
2446
+ "statEdited",
2447
+ "statRemoved"
2448
+ ],
2449
+ setup(e, { expose: t, emit: n }) {
2450
+ let r = n, i = D("columns"), a = L(!1), o = L("add"), c = L(null), l = I({
2451
+ label: "",
2452
+ method: "",
2453
+ field: "",
2454
+ conditions: []
2455
+ }), u = (e) => {
2456
+ o.value = e ? "edit" : "add", c.value = e ?? null, l.label = e?.label ?? "", l.method = e?.method ?? "", l.field = e?.field ?? "", l.conditions = e?.conditions ?? [], a.value = !0;
2457
+ }, d = () => {
2458
+ let e = crypto.randomUUID();
2459
+ l.conditions.push({
2460
+ id: e,
2461
+ field: "",
2462
+ condition: "==",
2463
+ value: ""
2464
+ });
2465
+ }, f = (e) => {
2466
+ l.conditions = l.conditions.filter((t) => t.id !== e);
2467
+ }, p = () => {
2468
+ o.value === "add" ? r("statAdded", l) : r("statEdited", {
2469
+ ...l,
2470
+ id: c.value.id
2471
+ }), a.value = !1;
2472
+ }, m = () => {
2473
+ r("statRemoved", c.value), a.value = !1;
2474
+ };
2475
+ return t({ openDialog: u }), (e, t) => {
2476
+ let n = z("DialogTitle"), r = z("DialogDescription"), c = z("DialogHeader"), u = z("Label"), h = z("Input"), g = z("SelectValue"), v = z("SelectTrigger"), T = z("SelectItem"), E = z("SelectContent"), D = z("Select"), O = z("ComboboxTrigger"), k = z("ComboboxInput"), A = z("ComboboxAnchor"), M = z("ComboboxItem"), N = z("ComboboxGroup"), F = z("ComboboxList"), I = z("Combobox"), L = z("Button"), B = z("DialogFooter"), ee = z("DialogScrollContent"), te = z("Dialog");
2477
+ return P(), y(te, {
2478
+ open: a.value,
2479
+ "onUpdate:open": t[4] ||= (e) => a.value = e
2480
+ }, {
2481
+ default: G(() => [w(ee, { class: "sm:max-w-2xl" }, {
2482
+ default: G(() => [
2483
+ w(c, null, {
2484
+ default: G(() => [w(n, null, {
2485
+ default: G(() => [C(V(o.value === "add" ? "Add Stat" : "Edit Stat"), 1)]),
2486
+ _: 1
2487
+ }), w(r, null, {
2488
+ default: G(() => [C(V(o.value === "add" ? "Add a new stat for this table." : "Edit the selected stat."), 1)]),
2489
+ _: 1
2490
+ })]),
2491
+ _: 1
2492
+ }),
2493
+ S("div", $n, [
2494
+ S("div", er, [w(u, {
2495
+ for: "stat_dialog_label",
2496
+ class: "text-xs text-muted-foreground"
2497
+ }, {
2498
+ default: G(() => [...t[5] ||= [C("Label", -1)]]),
2499
+ _: 1
2500
+ }), w(h, {
2501
+ id: "stat_dialog_label",
2502
+ modelValue: l.label,
2503
+ "onUpdate:modelValue": t[0] ||= (e) => l.label = e
2504
+ }, null, 8, ["modelValue"])]),
2505
+ S("div", tr, [w(u, { class: "text-xs text-muted-foreground" }, {
2506
+ default: G(() => [...t[6] ||= [C("Method", -1)]]),
2507
+ _: 1
2508
+ }), w(D, {
2509
+ modelValue: l.method,
2510
+ "onUpdate:modelValue": t[1] ||= (e) => l.method = e
2511
+ }, {
2512
+ default: G(() => [w(v, { class: "w-full" }, {
2513
+ default: G(() => [w(g, { placeholder: "Select a method" })]),
2514
+ _: 1
2515
+ }), w(E, null, {
2516
+ default: G(() => [
2517
+ w(T, { value: "count" }, {
2518
+ default: G(() => [...t[7] ||= [C("Row count", -1)]]),
2519
+ _: 1
2520
+ }),
2521
+ w(T, { value: "sum" }, {
2522
+ default: G(() => [...t[8] ||= [C("Sum", -1)]]),
2523
+ _: 1
2524
+ }),
2525
+ w(T, { value: "average" }, {
2526
+ default: G(() => [...t[9] ||= [C("Average", -1)]]),
2527
+ _: 1
2528
+ }),
2529
+ w(T, { value: "min" }, {
2530
+ default: G(() => [...t[10] ||= [C("Min (lowest value)", -1)]]),
2531
+ _: 1
2532
+ }),
2533
+ w(T, { value: "max" }, {
2534
+ default: G(() => [...t[11] ||= [C("Max (highest value)", -1)]]),
2535
+ _: 1
2536
+ })
2537
+ ]),
2538
+ _: 1
2539
+ })]),
2540
+ _: 1
2541
+ }, 8, ["modelValue"])]),
2542
+ l.method === "count" ? b("", !0) : (P(), y(I, {
2543
+ key: 0,
2544
+ by: "label",
2545
+ class: "w-full",
2546
+ resetSearchTermOnBlur: !1,
2547
+ resetSearchTermOnSelect: !0,
2548
+ modelValue: l.field,
2549
+ "onUpdate:modelValue": t[3] ||= (e) => l.field = e
2550
+ }, {
2551
+ default: G(() => [w(A, { class: "w-full" }, {
2552
+ default: G(() => [S("div", nr, [w(O, null, {
2553
+ default: G(() => [w(u, { class: "text-xs text-muted-foreground" }, {
2554
+ default: G(() => [...t[12] ||= [C("Field", -1)]]),
2555
+ _: 1
2556
+ })]),
2557
+ _: 1
2558
+ }), w(k, {
2559
+ modelValue: l.field,
2560
+ "onUpdate:modelValue": t[2] ||= (e) => l.field = e,
2561
+ hideIcon: "",
2562
+ class: "w-full"
2563
+ }, null, 8, ["modelValue"])])]),
2564
+ _: 1
2565
+ }), w(F, { class: "w-full" }, {
2566
+ default: G(() => [w(N, null, {
2567
+ default: G(() => [(P(!0), x(_, null, R(H(i), (e) => (P(), y(M, {
2568
+ key: e.property,
2569
+ value: e.property,
2570
+ onSelect: () => {
2571
+ l.field = e.property;
2572
+ }
2573
+ }, {
2574
+ default: G(() => [C(V(e.property) + " ", 1), l.field === e.property ? (P(), y(H(ie), {
2575
+ key: 0,
2576
+ class: j(H(s)("ml-auto size-4"))
2577
+ }, null, 8, ["class"])) : b("", !0)]),
2578
+ _: 2
2579
+ }, 1032, ["value", "onSelect"]))), 128))]),
2580
+ _: 1
2581
+ })]),
2582
+ _: 1
2583
+ })]),
2584
+ _: 1
2585
+ }, 8, ["modelValue"]))
2586
+ ]),
2587
+ S("div", null, [
2588
+ w(u, { class: "mb-1" }, {
2589
+ default: G(() => [...t[13] ||= [C("Conditions", -1)]]),
2590
+ _: 1
2591
+ }),
2592
+ t[25] ||= S("p", { class: "text-xs text-muted-foreground mb-2" }, " Only rows that match the conditions will be included in the calculation of the stat. ", -1),
2593
+ l.conditions?.length > 0 ? (P(), x("div", rr, [(P(!0), x(_, null, R(l.conditions, (e) => (P(), x("div", {
2594
+ key: e.id,
2595
+ class: "grid grid-cols-13 gap-2"
2596
+ }, [
2597
+ w(I, {
2598
+ by: "label",
2599
+ class: "col-span-4",
2600
+ resetSearchTermOnBlur: !1,
2601
+ resetSearchTermOnSelect: !0,
2602
+ modelValue: e.field,
2603
+ "onUpdate:modelValue": (t) => e.field = t
2604
+ }, {
2605
+ default: G(() => [w(A, { class: "w-full" }, {
2606
+ default: G(() => [S("div", ir, [w(O, null, {
2607
+ default: G(() => [w(u, { class: "text-xs text-muted-foreground" }, {
2608
+ default: G(() => [...t[14] ||= [C("Field", -1)]]),
2609
+ _: 1
2610
+ })]),
2611
+ _: 1
2612
+ }), w(k, {
2613
+ modelValue: e.field,
2614
+ "onUpdate:modelValue": (t) => e.field = t,
2615
+ hideIcon: "",
2616
+ class: "w-full"
2617
+ }, null, 8, ["modelValue", "onUpdate:modelValue"])])]),
2618
+ _: 2
2619
+ }, 1024), w(F, { class: "w-full" }, {
2620
+ default: G(() => [w(N, null, {
2621
+ default: G(() => [(P(!0), x(_, null, R(H(i), (t) => (P(), y(M, {
2622
+ key: t.property,
2623
+ value: t.property,
2624
+ onSelect: () => {
2625
+ e.field = t.property;
2626
+ }
2627
+ }, {
2628
+ default: G(() => [C(V(t.property) + " ", 1), e.field === t.property ? (P(), y(H(ie), {
2629
+ key: 0,
2630
+ class: j(H(s)("ml-auto size-4"))
2631
+ }, null, 8, ["class"])) : b("", !0)]),
2632
+ _: 2
2633
+ }, 1032, ["value", "onSelect"]))), 128))]),
2634
+ _: 2
2635
+ }, 1024)]),
2636
+ _: 2
2637
+ }, 1024)]),
2638
+ _: 2
2639
+ }, 1032, ["modelValue", "onUpdate:modelValue"]),
2640
+ S("div", ar, [w(u, { class: "text-xs text-muted-foreground" }, {
2641
+ default: G(() => [...t[15] ||= [C("Condition", -1)]]),
2642
+ _: 1
2643
+ }), w(D, {
2644
+ modelValue: e.condition,
2645
+ "onUpdate:modelValue": (t) => e.condition = t
2646
+ }, {
2647
+ default: G(() => [w(v, { class: "w-full" }, {
2648
+ default: G(() => [w(g, { placeholder: "Select a condition" })]),
2649
+ _: 1
2650
+ }), w(E, null, {
2651
+ default: G(() => [
2652
+ w(T, { value: "==" }, {
2653
+ default: G(() => [...t[16] ||= [C("(==) Is equal to", -1)]]),
2654
+ _: 1
2655
+ }),
2656
+ w(T, { value: "!=" }, {
2657
+ default: G(() => [...t[17] ||= [C("(!=) Is not equal to", -1)]]),
2658
+ _: 1
2659
+ }),
2660
+ w(T, { value: ">" }, {
2661
+ default: G(() => [...t[18] ||= [C("(>) Is greater than", -1)]]),
2662
+ _: 1
2663
+ }),
2664
+ w(T, { value: "<" }, {
2665
+ default: G(() => [...t[19] ||= [C("(<) Is less than", -1)]]),
2666
+ _: 1
2667
+ }),
2668
+ w(T, { value: ">=" }, {
2669
+ default: G(() => [...t[20] ||= [C("(>=) Is greater than or equal to", -1)]]),
2670
+ _: 1
2671
+ }),
2672
+ w(T, { value: "<=" }, {
2673
+ default: G(() => [...t[21] ||= [C("(<=) Is less than or equal to", -1)]]),
2674
+ _: 1
2675
+ }),
2676
+ w(T, { value: "in" }, {
2677
+ default: G(() => [...t[22] ||= [C("(in) Equal to any of the following", -1)]]),
2678
+ _: 1
2679
+ })
2680
+ ]),
2681
+ _: 1
2682
+ })]),
2683
+ _: 1
2684
+ }, 8, ["modelValue", "onUpdate:modelValue"])]),
2685
+ S("div", or, [w(u, {
2686
+ class: "text-xs text-muted-foreground",
2687
+ for: e.id + "_value"
2688
+ }, {
2689
+ default: G(() => [...t[23] ||= [C("Value", -1)]]),
2690
+ _: 1
2691
+ }, 8, ["for"]), w(h, {
2692
+ modelValue: e.value,
2693
+ "onUpdate:modelValue": (t) => e.value = t,
2694
+ class: "w-full",
2695
+ id: e.id + "_value"
2696
+ }, null, 8, [
2697
+ "modelValue",
2698
+ "onUpdate:modelValue",
2699
+ "id"
2700
+ ])]),
2701
+ w(L, {
2702
+ variant: "ghost",
2703
+ size: "icon",
2704
+ class: "rounded-xl self-end col-span-1",
2705
+ onClick: (t) => f(e.id)
2706
+ }, {
2707
+ default: G(() => [w(H(me), { class: "size-4" })]),
2708
+ _: 1
2709
+ }, 8, ["onClick"])
2710
+ ]))), 128))])) : b("", !0),
2711
+ w(L, {
2712
+ variant: "outline",
2713
+ onClick: d
2714
+ }, {
2715
+ default: G(() => [w(H(q), { class: "size-4" }), t[24] ||= C(" Add Condition ", -1)]),
2716
+ _: 1
2717
+ })
2718
+ ]),
2719
+ w(B, null, {
2720
+ default: G(() => [o.value === "edit" ? (P(), y(L, {
2721
+ key: 0,
2722
+ variant: "destructive",
2723
+ onClick: m
2724
+ }, {
2725
+ default: G(() => [...t[26] ||= [C(" Remove Stat ", -1)]]),
2726
+ _: 1
2727
+ })) : b("", !0), w(L, { onClick: p }, {
2728
+ default: G(() => [C(V(o.value === "add" ? "Add Stat" : "Save changes"), 1)]),
2729
+ _: 1
2730
+ })]),
2731
+ _: 1
2732
+ })
2733
+ ]),
2734
+ _: 1
2735
+ })]),
2736
+ _: 1
2737
+ }, 8, ["open"]);
2738
+ };
2739
+ }
2740
+ }), cr = { class: "flex flex-wrap gap-2 mb-4" }, lr = ["onClick"], ur = { class: "text-2xl font-bold" }, dr = { class: "text-xs text-muted-foreground truncate w-full text-center" }, fr = /* @__PURE__ */ T({
2741
+ __name: "Stats",
2742
+ setup(e) {
2743
+ let t = D("data"), { isAdmin: n } = p(), { getModuleData: r, setModuleData: i } = h(), a = L(), o = L([]), s = (e) => {
2744
+ let t = crypto.randomUUID();
2745
+ (!o.value || o?.value?.length === 0) && (o.value = []), o.value.push({
2746
+ ...e,
2747
+ id: t
2748
+ }), i("stats", o.value);
2749
+ }, c = (e) => {
2750
+ o.value = o.value.map((t) => t.id === e.id ? e : t), i("stats", o.value);
2751
+ }, l = (e) => {
2752
+ o.value = o.value.filter((t) => t.id !== e), i("stats", o.value);
2753
+ }, u = (e) => {
2754
+ switch (e.method) {
2755
+ case "count": return f(e.conditions);
2756
+ case "sum": return m(e.field, e.conditions);
2757
+ case "average": return g(e.field, e.conditions);
2758
+ case "min": return v(e.field, e.conditions);
2759
+ case "max": return y(e.field, e.conditions);
2760
+ default: return "";
2761
+ }
2762
+ }, d = (e) => {
2763
+ if (e) {
2764
+ let t = parseFloat(e).toFixed(2).split(".");
2765
+ return t[0] = t[0].replace(/\B(?=(\d{3})+(?!\d))/g, " "), !t[1] || t[1] == "00" ? t[0] : t.join(".");
2766
+ }
2767
+ return "...";
2768
+ }, f = (e) => T(e)?.length, m = (e, t) => {
2769
+ let n = 0;
2770
+ return T(t).forEach((t) => {
2771
+ n += parseFloat(C(t, e)) ? parseFloat(String(C(t, e)).replace(",", ".")) : +(C(t, e) === !0);
2772
+ }), n.toFixed(2).slice(-2) == "00" ? n.toFixed(0) : n.toFixed(2);
2773
+ }, g = (e, t) => {
2774
+ let n = 0, r = 0;
2775
+ if (T(t).forEach((t) => {
2776
+ parseFloat(C(t, e)) && (n += parseFloat(String(C(t, e)).replace(",", ".")), r += 1);
2777
+ }), r > 0) {
2778
+ let e = n / r;
2779
+ return e.toFixed(2).slice(-2) == "00" ? e.toFixed(0) : e.toFixed(2);
2780
+ }
2781
+ return "...";
2782
+ }, v = (e, t) => {
2783
+ let n = T(t)[0][e];
2784
+ return T(t).forEach((t) => {
2785
+ C(t, e) < n && (n = C(t, e));
2786
+ }), n;
2787
+ }, y = (e, t) => {
2788
+ let n = T(t)[0][e];
2789
+ return T(t).forEach((t) => {
2790
+ parseFloat(C(t, e)) && C(t, e) > n && (n = C(t, e));
2791
+ }), parseFloat(String(n).replace(",", ".")).toFixed(2);
2792
+ }, C = (e, t) => {
2793
+ if (!e || !t) return;
2794
+ let [n, ...r] = t.split(".");
2795
+ return r?.length ? C(e[n], r.join(".")) : e[t] ?? "";
2796
+ }, T = (e) => {
2797
+ let n = [...t.value];
2798
+ if (Array.isArray(e)) for (let t = 0; t < e?.length; t++) e[t].condition == "==" ? n = n.filter((n) => e[t].value?.split(",").indexOf(n[e[t].field]) != -1) : e[t].condition == "!=" ? n = n.filter((n) => e[t].value?.split(",").indexOf(n[e[t].field]) == -1) : e[t].condition == ">" ? n = n.filter((n) => n[e[t].field] > e[t].value) : e[t].condition == ">=" ? n = n.filter((n) => n[e[t].field] >= e[t].value) : e[t].condition == "<" ? n = n.filter((n) => n[e[t].field] < e[t].value) : e[t].condition == "<=" ? n = n.filter((n) => n[e[t].field] <= e[t].value) : e[t].condition == "in" && (n = n.filter((n) => e[t].value?.indexOf(String(n[e[t].field])) != -1));
2799
+ return n;
2800
+ };
2801
+ return N(async () => {
2802
+ o.value = await r("stats") || [];
2803
+ }), (e, r) => (P(), x(_, null, [S("div", cr, [(P(!0), x(_, null, R(o.value, (e) => (P(), x("div", {
2804
+ key: e.label,
2805
+ class: j(["flex flex-col items-center justify-center size-24 p-4 border rounded-md", H(n)() ? "hover:bg-muted cursor-pointer" : ""]),
2806
+ onClick: (t) => H(n)() ? a.value.openDialog(e) : null
2807
+ }, [S("span", ur, V(H(t)?.length > 0 ? d(u(e)) : "..."), 1), S("span", dr, V(e.label), 1)], 10, lr))), 128)), H(n)() ? (P(), x("div", {
2808
+ key: 0,
2809
+ class: "flex flex-col items-center justify-center size-24 p-4 border rounded-md hover:bg-muted cursor-pointer",
2810
+ onClick: r[0] ||= (e) => a.value.openDialog()
2811
+ }, [w(H(q), { class: "size-8 text-primary" })])) : b("", !0)]), w(sr, {
2812
+ ref_key: "statDialog",
2813
+ ref: a,
2814
+ onStatAdded: r[1] ||= (e) => s(e),
2815
+ onStatEdited: r[2] ||= (e) => c(e),
2816
+ onStatRemoved: r[3] ||= (e) => l(e)
2817
+ }, null, 512)], 64));
2818
+ }
2819
+ }), pr = { class: "grid gap-4 p-4 bg-muted/20 rounded-lg" }, mr = { class: "grid grid-cols-5 items-center gap-4" }, hr = { class: "grid grid-cols-5 items-center gap-4" }, gr = { class: "grid grid-cols-5 items-center gap-4" }, _r = { class: "grid grid-cols-5 items-center gap-4" }, vr = { class: "grid grid-cols-5 items-center gap-4" }, yr = { class: "grid grid-cols-5 items-center gap-4" }, br = {
2820
+ key: 0,
2821
+ class: "grid grid-cols-5 items-center gap-4"
2822
+ }, xr = { class: "grid grid-cols-5 items-center gap-4" }, Sr = /* @__PURE__ */ T({
2823
+ __name: "DialogTableColumnItem",
2824
+ props: { column: {
2825
+ type: Object,
2826
+ required: !0
2827
+ } },
2828
+ setup(e) {
2829
+ return (t, n) => {
2830
+ let r = z("AccordionTrigger"), i = z("Label"), a = z("Input"), o = z("Checkbox"), s = z("SelectValue"), c = z("SelectTrigger"), l = z("SelectLabel"), u = z("SelectItem"), d = z("SelectGroup"), f = z("SelectContent"), p = z("Select"), m = z("Button"), h = z("AccordionContent"), g = z("AccordionItem");
2831
+ return P(), y(g, { value: e.column.id }, {
2832
+ default: G(() => [w(r, { class: j({ "line-through hover:line-through text-red-400": e.column._remove }) }, {
2833
+ default: G(() => [C(V(e.column.label), 1)]),
2834
+ _: 1
2835
+ }, 8, ["class"]), w(h, null, {
2836
+ default: G(() => [S("div", pr, [S("div", { class: j(["grid gap-4", { "opacity-40 pointer-events-none": e.column._remove }]) }, [
2837
+ S("div", mr, [w(i, {
2838
+ for: "property",
2839
+ class: "text-right col-span-2"
2840
+ }, {
2841
+ default: G(() => [...n[9] ||= [C(" Property ", -1)]]),
2842
+ _: 1
2843
+ }), w(a, {
2844
+ id: "property",
2845
+ class: "col-span-3",
2846
+ modelValue: e.column.property,
2847
+ "onUpdate:modelValue": n[0] ||= (t) => e.column.property = t,
2848
+ tabindex: e.column._remove ? -1 : 0
2849
+ }, null, 8, ["modelValue", "tabindex"])]),
2850
+ S("div", hr, [w(i, {
2851
+ for: "label",
2852
+ class: "text-right col-span-2"
2853
+ }, {
2854
+ default: G(() => [...n[10] ||= [C(" Label ", -1)]]),
2855
+ _: 1
2856
+ }), w(a, {
2857
+ id: "label",
2858
+ class: "col-span-3",
2859
+ modelValue: e.column.label,
2860
+ "onUpdate:modelValue": n[1] ||= (t) => e.column.label = t,
2861
+ tabindex: e.column._remove ? -1 : 0
2862
+ }, null, 8, ["modelValue", "tabindex"])]),
2863
+ S("div", gr, [w(i, {
2864
+ for: "visible",
2865
+ class: "text-right col-span-2"
2866
+ }, {
2867
+ default: G(() => [...n[11] ||= [C(" Visible ", -1)]]),
2868
+ _: 1
2869
+ }), w(o, {
2870
+ id: "visible",
2871
+ class: "col-span-3 border-ring",
2872
+ modelValue: e.column.visible,
2873
+ "onUpdate:modelValue": n[2] ||= (t) => e.column.visible = t,
2874
+ tabindex: e.column._remove ? -1 : 0
2875
+ }, null, 8, ["modelValue", "tabindex"])]),
2876
+ S("div", _r, [w(i, {
2877
+ for: "type",
2878
+ class: "text-right col-span-2"
2879
+ }, {
2880
+ default: G(() => [...n[12] ||= [C(" Type ", -1)]]),
2881
+ _: 1
2882
+ }), w(p, {
2883
+ modelValue: e.column.type,
2884
+ "onUpdate:modelValue": n[3] ||= (t) => e.column.type = t
2885
+ }, {
2886
+ default: G(() => [w(c, {
2887
+ class: "w-[180px]",
2888
+ tabindex: e.column._remove ? -1 : 0
2889
+ }, {
2890
+ default: G(() => [w(s, { placeholder: "Select a type" })]),
2891
+ _: 1
2892
+ }, 8, ["tabindex"]), w(f, null, {
2893
+ default: G(() => [w(d, null, {
2894
+ default: G(() => [
2895
+ w(l, null, {
2896
+ default: G(() => [...n[13] ||= [C("Types", -1)]]),
2897
+ _: 1
2898
+ }),
2899
+ w(u, { value: "text" }, {
2900
+ default: G(() => [...n[14] ||= [C(" Text ", -1)]]),
2901
+ _: 1
2902
+ }),
2903
+ w(u, { value: "number" }, {
2904
+ default: G(() => [...n[15] ||= [C(" Number ", -1)]]),
2905
+ _: 1
2906
+ }),
2907
+ w(u, { value: "date" }, {
2908
+ default: G(() => [...n[16] ||= [C(" Date ", -1)]]),
2909
+ _: 1
2910
+ }),
2911
+ w(u, { value: "datetime" }, {
2912
+ default: G(() => [...n[17] ||= [C(" Datetime ", -1)]]),
2913
+ _: 1
2914
+ }),
2915
+ w(u, { value: "boolean" }, {
2916
+ default: G(() => [...n[18] ||= [C(" Boolean ", -1)]]),
2917
+ _: 1
2918
+ }),
2919
+ w(u, { value: "URL" }, {
2920
+ default: G(() => [...n[19] ||= [C(" URL ", -1)]]),
2921
+ _: 1
2922
+ }),
2923
+ w(u, { value: "email" }, {
2924
+ default: G(() => [...n[20] ||= [C(" Email ", -1)]]),
2925
+ _: 1
2926
+ }),
2927
+ w(u, { value: "phone" }, {
2928
+ default: G(() => [...n[21] ||= [C(" Phone ", -1)]]),
2929
+ _: 1
2930
+ }),
2931
+ w(u, { value: "currency" }, {
2932
+ default: G(() => [...n[22] ||= [C(" Currency ", -1)]]),
2933
+ _: 1
2934
+ }),
2935
+ w(u, { value: "image" }, {
2936
+ default: G(() => [...n[23] ||= [C(" Image ", -1)]]),
2937
+ _: 1
2938
+ }),
2939
+ w(u, { value: "array" }, {
2940
+ default: G(() => [...n[24] ||= [C(" Array ", -1)]]),
2941
+ _: 1
2942
+ }),
2943
+ w(u, { value: "html" }, {
2944
+ default: G(() => [...n[25] ||= [C(" HTML (innerText) ", -1)]]),
2945
+ _: 1
2946
+ })
2947
+ ]),
2948
+ _: 1
2949
+ })]),
2950
+ _: 1
2951
+ })]),
2952
+ _: 1
2953
+ }, 8, ["modelValue"])]),
2954
+ S("div", vr, [w(i, {
2955
+ for: "showInCompactMode",
2956
+ class: "text-right col-span-2"
2957
+ }, {
2958
+ default: G(() => [...n[26] ||= [C(" Show in compact mode ", -1)]]),
2959
+ _: 1
2960
+ }), w(o, {
2961
+ id: "showInCompactMode",
2962
+ class: "col-span-3 border-ring",
2963
+ modelValue: e.column.showInCompactMode,
2964
+ "onUpdate:modelValue": n[4] ||= (t) => e.column.showInCompactMode = t,
2965
+ tabindex: e.column._remove ? -1 : 0
2966
+ }, null, 8, ["modelValue", "tabindex"])]),
2967
+ S("div", yr, [w(i, {
2968
+ for: "showInfoButton",
2969
+ class: "text-right col-span-2"
2970
+ }, {
2971
+ default: G(() => [...n[27] ||= [C(" Show info button ", -1)]]),
2972
+ _: 1
2973
+ }), w(o, {
2974
+ id: "showInfoButton",
2975
+ class: "col-span-3 border-ring",
2976
+ modelValue: e.column.showInfoButton,
2977
+ "onUpdate:modelValue": n[5] ||= (t) => e.column.showInfoButton = t,
2978
+ tabindex: e.column._remove ? -1 : 0
2979
+ }, null, 8, ["modelValue", "tabindex"])]),
2980
+ e.column.showInfoButton ? (P(), x("div", br, [w(i, {
2981
+ for: "infoTooltipText",
2982
+ class: "text-right col-span-2"
2983
+ }, {
2984
+ default: G(() => [...n[28] ||= [C(" Info tooltip text ", -1)]]),
2985
+ _: 1
2986
+ }), w(a, {
2987
+ id: "infoTooltipText",
2988
+ class: "col-span-3",
2989
+ modelValue: e.column.infoTooltipText,
2990
+ "onUpdate:modelValue": n[6] ||= (t) => e.column.infoTooltipText = t,
2991
+ tabindex: e.column._remove ? -1 : 0
2992
+ }, null, 8, ["modelValue", "tabindex"])])) : b("", !0)
2993
+ ], 2), S("div", xr, [w(i, { class: "text-right col-span-2" }, {
2994
+ default: G(() => [...n[29] ||= [C(" Delete column? ", -1)]]),
2995
+ _: 1
2996
+ }), e.column._remove ? (P(), y(m, {
2997
+ key: 1,
2998
+ class: "col-span-3",
2999
+ variant: "outline",
3000
+ onClick: n[8] ||= (t) => e.column._remove = !1
3001
+ }, {
3002
+ default: G(() => [...n[31] ||= [C("Undo delete", -1)]]),
3003
+ _: 1
3004
+ })) : (P(), y(m, {
3005
+ key: 0,
3006
+ class: "col-span-3",
3007
+ variant: "destructive",
3008
+ onClick: n[7] ||= (t) => e.column._remove = !0
3009
+ }, {
3010
+ default: G(() => [...n[30] ||= [C("Delete column", -1)]]),
3011
+ _: 1
3012
+ }))])])]),
3013
+ _: 1
3014
+ })]),
3015
+ _: 1
3016
+ }, 8, ["value"]);
3017
+ };
3018
+ }
3019
+ }), Cr = { class: "flex flex-col items-start gap-4 py-4" }, wr = {
3020
+ key: 0,
3021
+ class: "flex flex-col gap-2 w-full"
3022
+ }, Tr = { class: "flex flex-wrap gap-2" }, Er = ["onClick"], Dr = { class: "text-muted-foreground" }, Or = { class: "grid gap-4" }, kr = { class: "grid grid-cols-5 items-center gap-4" }, Ar = { class: "grid grid-cols-5 items-center gap-4" }, jr = { class: "grid grid-cols-5 items-center gap-4" }, Mr = { class: "grid grid-cols-5 items-center gap-4" }, Nr = { class: "grid grid-cols-5 items-center gap-4" }, Pr = { class: "grid grid-cols-5 items-center gap-4" }, Fr = {
3023
+ key: 0,
3024
+ class: "grid grid-cols-5 items-center gap-4"
3025
+ }, Ir = { class: "flex justify-end gap-2" }, Lr = { class: "absolute left-0 top-0 bottom-0 flex flex-col justify-center gap-1 z-10 opacity-0 group-hover:opacity-100 transition-opacity" }, Rr = /* @__PURE__ */ T({
3026
+ __name: "ColumnEditorDialog",
3027
+ props: {
3028
+ open: {
3029
+ type: Boolean,
3030
+ default: null
3031
+ },
3032
+ onSelect: {
3033
+ type: Function,
3034
+ required: !0
3035
+ },
3036
+ onOpenChange: {
3037
+ type: Function,
3038
+ required: !0
3039
+ }
3040
+ },
3041
+ emits: ["update:open"],
3042
+ setup(e, { emit: t }) {
3043
+ let { setModuleData: n } = h(), r = e, i = t, a = D("columns"), o = D("data"), s = L([]), c = {
3044
+ email: "email",
3045
+ phone: "phone",
3046
+ tel: "phone",
3047
+ mobile: "phone",
3048
+ image: "image",
3049
+ photo: "image",
3050
+ avatar: "image",
3051
+ thumbnail: "image",
3052
+ logo: "image",
3053
+ picture: "image",
3054
+ url: "URL",
3055
+ link: "URL",
3056
+ website: "URL",
3057
+ href: "URL",
3058
+ price: "currency",
3059
+ amount: "currency",
3060
+ cost: "currency",
3061
+ total: "currency",
3062
+ revenue: "currency",
3063
+ salary: "currency",
3064
+ fee: "currency"
3065
+ }, l = (e) => {
3066
+ let t = e.filter((e) => e != null && e !== "");
3067
+ if (!t.length) return "text";
3068
+ if (t.every((e) => typeof e == "boolean")) return "boolean";
3069
+ if (t.every((e) => Array.isArray(e))) return "array";
3070
+ if (t.every((e) => typeof e == "number")) return "number";
3071
+ let n = t.filter((e) => typeof e == "string");
3072
+ if (!n.length) return "text";
3073
+ let r = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, i = /^\+?[\d\s\-().]{7,}$/, a = /^https?:\/\//, o = /\.(png|jpe?g|gif|webp|svg|avif)(\?.*)?$/i, s = /^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2})?/;
3074
+ return n.every((e) => r.test(e)) ? "email" : n.every((e) => o.test(e)) ? "image" : n.every((e) => a.test(e)) ? "URL" : n.every((e) => s.test(e)) ? n.some((e) => e.includes("T")) ? "datetime" : "date" : n.every((e) => !isNaN(Number(e)) && e.trim() !== "") ? "number" : n.every((e) => i.test(e)) ? "phone" : "text";
3075
+ }, u = (e, t) => {
3076
+ let n = e.toLowerCase();
3077
+ for (let [e, t] of Object.entries(c)) if (n === e || n.endsWith(e) || n.startsWith(e)) return t;
3078
+ return n.includes("date") || n === "createdat" || n === "updatedat" || n === "timestamp" ? "datetime" : l(t);
3079
+ }, d = (e) => e.replace(/([A-Z])/g, " $1").replace(/[_-]/g, " ").replace(/\s+/g, " ").trim().replace(/\b\w/g, (e) => e.toUpperCase()), f = v(() => {
3080
+ let e = o?.value ?? [];
3081
+ if (!e.length) return [];
3082
+ let t = new Set(s.value.map((e) => e.property)), n = /* @__PURE__ */ new Set();
3083
+ for (let t of e) t && typeof t == "object" && Object.keys(t).forEach((e) => n.add(e));
3084
+ return Array.from(n).filter((e) => !t.has(e)).map((t) => {
3085
+ let n = e.map((e) => e?.[t]);
3086
+ return {
3087
+ property: t,
3088
+ label: d(t),
3089
+ type: u(t, n),
3090
+ visible: !0,
3091
+ showInCompactMode: !1,
3092
+ showInfoButton: !1,
3093
+ infoTooltipText: ""
3094
+ };
3095
+ });
3096
+ }), p = v({
3097
+ get() {
3098
+ return r.open;
3099
+ },
3100
+ set(e) {
3101
+ i("update:open", e);
3102
+ }
3103
+ });
3104
+ U(p, async (e, t) => {
3105
+ e && !t && (s.value = a.value ? JSON.parse(JSON.stringify(a.value)) : []);
3106
+ });
3107
+ let m = I({
3108
+ property: "",
3109
+ label: "",
3110
+ visible: !0,
3111
+ type: "text",
3112
+ showInCompactMode: !1,
3113
+ showInfoButton: !1,
3114
+ infoTooltipText: ""
3115
+ }), g = L(!1), T = () => {
3116
+ g.value = !1, m.property = "", m.label = "", m.visible = !0, m.type = "text", m.showInCompactMode = !1, m.showInfoButton = !1, m.infoTooltipText = "";
3117
+ }, E = (e) => {
3118
+ s.value ||= [], s.value.push({
3119
+ ...e,
3120
+ id: crypto.randomUUID()
3121
+ });
3122
+ }, O = () => {
3123
+ s.value ||= [];
3124
+ let e = crypto.randomUUID();
3125
+ s.value.push({
3126
+ ...m,
3127
+ id: e
3128
+ }), T();
3129
+ }, k = (e) => {
3130
+ if (e > 0) {
3131
+ let t = s.value[e];
3132
+ s.value[e] = s.value[e - 1], s.value[e - 1] = t;
3133
+ }
3134
+ }, A = (e) => {
3135
+ if (e < s.value.length - 1) {
3136
+ let t = s.value[e];
3137
+ s.value[e] = s.value[e + 1], s.value[e + 1] = t;
3138
+ }
3139
+ }, j = () => {
3140
+ s.value = s.value.filter((e) => !e._remove), n("columns", s.value), a.value = s.value, T(), p.value = !1;
3141
+ };
3142
+ return (t, n) => {
3143
+ let r = z("DropdownMenuItem"), i = z("DialogTrigger"), a = z("DialogTitle"), o = z("DialogDescription"), c = z("DialogHeader"), l = z("Button"), u = z("PopoverTrigger"), d = z("Label"), h = z("Input"), v = z("Checkbox"), D = z("SelectValue"), M = z("SelectTrigger"), N = z("SelectLabel"), F = z("SelectItem"), I = z("SelectGroup"), L = z("SelectContent"), B = z("Select"), ee = z("PopoverContent"), te = z("Popover"), U = z("Accordion"), W = z("DialogFooter"), K = z("DialogScrollContent"), ne = z("Dialog");
3144
+ return P(), y(ne, {
3145
+ open: p.value,
3146
+ "onUpdate:open": [n[9] ||= (e) => p.value = e, e.onOpenChange]
3147
+ }, {
3148
+ default: G(() => [w(i, { asChild: "" }, {
3149
+ default: G(() => [w(r, { onSelect: n[0] ||= (t) => {
3150
+ t.preventDefault(), e.onSelect && e.onSelect(), p.value = !0;
3151
+ } }, {
3152
+ default: G(() => [...n[10] ||= [S("span", { class: "text-primary" }, "Edit columns", -1)]]),
3153
+ _: 1
3154
+ })]),
3155
+ _: 1
3156
+ }), w(K, { class: "sm:max-w-2xl" }, {
3157
+ default: G(() => [
3158
+ w(c, null, {
3159
+ default: G(() => [w(a, null, {
3160
+ default: G(() => [...n[11] ||= [C("Edit columns", -1)]]),
3161
+ _: 1
3162
+ }), w(o, null, {
3163
+ default: G(() => [...n[12] ||= [C(" Define all columns for this table. ", -1)]]),
3164
+ _: 1
3165
+ })]),
3166
+ _: 1
3167
+ }),
3168
+ S("div", Cr, [f.value.length ? (P(), x("div", wr, [n[13] ||= S("p", { class: "text-xs text-muted-foreground" }, "Suggested columns from your data", -1), S("div", Tr, [(P(!0), x(_, null, R(f.value, (e) => (P(), x("button", {
3169
+ key: e.property,
3170
+ type: "button",
3171
+ class: "inline-flex items-center gap-1.5 rounded-full border px-3 py-1 text-xs font-medium transition-colors hover:bg-accent hover:text-accent-foreground cursor-pointer",
3172
+ onClick: (t) => E(e)
3173
+ }, [C(V(e.label) + " ", 1), S("span", Dr, V(e.type), 1)], 8, Er))), 128))])])) : b("", !0), w(te, {
3174
+ open: g.value,
3175
+ "onUpdate:open": n[8] ||= (e) => g.value = e
3176
+ }, {
3177
+ default: G(() => [w(u, { "as-child": "" }, {
3178
+ default: G(() => [w(l, { variant: "outline" }, {
3179
+ default: G(() => [w(H(q), { class: "mr-2 size-4" }), n[14] ||= C(" Add column ", -1)]),
3180
+ _: 1
3181
+ })]),
3182
+ _: 1
3183
+ }), w(ee, { class: "w-96" }, {
3184
+ default: G(() => [S("div", Or, [
3185
+ S("div", kr, [w(d, {
3186
+ for: "property",
3187
+ class: "text-right col-span-2"
3188
+ }, {
3189
+ default: G(() => [...n[15] ||= [C(" Property ", -1)]]),
3190
+ _: 1
3191
+ }), w(h, {
3192
+ id: "property",
3193
+ class: "col-span-3",
3194
+ modelValue: m.property,
3195
+ "onUpdate:modelValue": n[1] ||= (e) => m.property = e
3196
+ }, null, 8, ["modelValue"])]),
3197
+ S("div", Ar, [w(d, {
3198
+ for: "label",
3199
+ class: "text-right col-span-2"
3200
+ }, {
3201
+ default: G(() => [...n[16] ||= [C(" Label ", -1)]]),
3202
+ _: 1
3203
+ }), w(h, {
3204
+ id: "label",
3205
+ class: "col-span-3",
3206
+ modelValue: m.label,
3207
+ "onUpdate:modelValue": n[2] ||= (e) => m.label = e
3208
+ }, null, 8, ["modelValue"])]),
3209
+ S("div", jr, [w(d, {
3210
+ for: "visible",
3211
+ class: "text-right col-span-2"
3212
+ }, {
3213
+ default: G(() => [...n[17] ||= [C(" Visible ", -1)]]),
3214
+ _: 1
3215
+ }), w(v, {
3216
+ id: "visible",
3217
+ class: "col-span-3 border-ring",
3218
+ modelValue: m.visible,
3219
+ "onUpdate:modelValue": n[3] ||= (e) => m.visible = e
3220
+ }, null, 8, ["modelValue"])]),
3221
+ S("div", Mr, [w(d, {
3222
+ for: "type",
3223
+ class: "text-right col-span-2"
3224
+ }, {
3225
+ default: G(() => [...n[18] ||= [C(" Type ", -1)]]),
3226
+ _: 1
3227
+ }), w(B, {
3228
+ modelValue: m.type,
3229
+ "onUpdate:modelValue": n[4] ||= (e) => m.type = e
3230
+ }, {
3231
+ default: G(() => [w(M, { class: "w-[180px]" }, {
3232
+ default: G(() => [w(D, { placeholder: "Select a type" })]),
3233
+ _: 1
3234
+ }), w(L, null, {
3235
+ default: G(() => [w(I, null, {
3236
+ default: G(() => [
3237
+ w(N, null, {
3238
+ default: G(() => [...n[19] ||= [C("Types", -1)]]),
3239
+ _: 1
3240
+ }),
3241
+ w(F, { value: "text" }, {
3242
+ default: G(() => [...n[20] ||= [C(" Text ", -1)]]),
3243
+ _: 1
3244
+ }),
3245
+ w(F, { value: "number" }, {
3246
+ default: G(() => [...n[21] ||= [C(" Number ", -1)]]),
3247
+ _: 1
3248
+ }),
3249
+ w(F, { value: "date" }, {
3250
+ default: G(() => [...n[22] ||= [C(" Date ", -1)]]),
3251
+ _: 1
3252
+ }),
3253
+ w(F, { value: "datetime" }, {
3254
+ default: G(() => [...n[23] ||= [C(" Datetime ", -1)]]),
3255
+ _: 1
3256
+ }),
3257
+ w(F, { value: "boolean" }, {
3258
+ default: G(() => [...n[24] ||= [C(" Boolean ", -1)]]),
3259
+ _: 1
3260
+ }),
3261
+ w(F, { value: "URL" }, {
3262
+ default: G(() => [...n[25] ||= [C(" URL ", -1)]]),
3263
+ _: 1
3264
+ }),
3265
+ w(F, { value: "email" }, {
3266
+ default: G(() => [...n[26] ||= [C(" Email ", -1)]]),
3267
+ _: 1
3268
+ }),
3269
+ w(F, { value: "phone" }, {
3270
+ default: G(() => [...n[27] ||= [C(" Phone ", -1)]]),
3271
+ _: 1
3272
+ }),
3273
+ w(F, { value: "currency" }, {
3274
+ default: G(() => [...n[28] ||= [C(" Currency ", -1)]]),
3275
+ _: 1
3276
+ }),
3277
+ w(F, { value: "image" }, {
3278
+ default: G(() => [...n[29] ||= [C(" Image ", -1)]]),
3279
+ _: 1
3280
+ }),
3281
+ w(F, { value: "array" }, {
3282
+ default: G(() => [...n[30] ||= [C(" Array ", -1)]]),
3283
+ _: 1
3284
+ }),
3285
+ w(F, { value: "html" }, {
3286
+ default: G(() => [...n[31] ||= [C(" HTML (innerText) ", -1)]]),
3287
+ _: 1
3288
+ })
3289
+ ]),
3290
+ _: 1
3291
+ })]),
3292
+ _: 1
3293
+ })]),
3294
+ _: 1
3295
+ }, 8, ["modelValue"])]),
3296
+ S("div", Nr, [w(d, {
3297
+ for: "showInCompactMode",
3298
+ class: "text-right col-span-2"
3299
+ }, {
3300
+ default: G(() => [...n[32] ||= [C(" Show in compact mode ", -1)]]),
3301
+ _: 1
3302
+ }), w(v, {
3303
+ id: "showInCompactMode",
3304
+ class: "col-span-3 border-ring",
3305
+ modelValue: m.showInCompactMode,
3306
+ "onUpdate:modelValue": n[5] ||= (e) => m.showInCompactMode = e
3307
+ }, null, 8, ["modelValue"])]),
3308
+ S("div", Pr, [w(d, {
3309
+ for: "showInfoButton",
3310
+ class: "text-right col-span-2"
3311
+ }, {
3312
+ default: G(() => [...n[33] ||= [C(" Show info button ", -1)]]),
3313
+ _: 1
3314
+ }), w(v, {
3315
+ id: "showInfoButton",
3316
+ class: "col-span-3 border-ring",
3317
+ modelValue: m.showInfoButton,
3318
+ "onUpdate:modelValue": n[6] ||= (e) => m.showInfoButton = e
3319
+ }, null, 8, ["modelValue"])]),
3320
+ m.showInfoButton ? (P(), x("div", Fr, [w(d, {
3321
+ for: "infoTooltipText",
3322
+ class: "text-right col-span-2"
3323
+ }, {
3324
+ default: G(() => [...n[34] ||= [C(" Info tooltip text ", -1)]]),
3325
+ _: 1
3326
+ }), w(h, {
3327
+ id: "infoTooltipText",
3328
+ class: "col-span-3",
3329
+ modelValue: m.infoTooltipText,
3330
+ "onUpdate:modelValue": n[7] ||= (e) => m.infoTooltipText = e
3331
+ }, null, 8, ["modelValue"])])) : b("", !0),
3332
+ S("div", Ir, [w(l, {
3333
+ variant: "outline",
3334
+ onClick: T
3335
+ }, {
3336
+ default: G(() => [...n[35] ||= [C(" Cancel ", -1)]]),
3337
+ _: 1
3338
+ }), w(l, {
3339
+ onClick: O,
3340
+ disabled: !m.property
3341
+ }, {
3342
+ default: G(() => [...n[36] ||= [C(" Add column ", -1)]]),
3343
+ _: 1
3344
+ }, 8, ["disabled"])])
3345
+ ])]),
3346
+ _: 1
3347
+ })]),
3348
+ _: 1
3349
+ }, 8, ["open"])]),
3350
+ w(U, {
3351
+ type: "single",
3352
+ collapsible: "",
3353
+ class: "w-full"
3354
+ }, {
3355
+ default: G(() => [(P(!0), x(_, null, R(s.value, (e, t) => (P(), x("div", {
3356
+ key: e.id,
3357
+ class: "relative group"
3358
+ }, [S("div", Lr, [w(l, {
3359
+ variant: "ghost",
3360
+ size: "icon",
3361
+ class: "h-6 w-6",
3362
+ onClick: (e) => k(t),
3363
+ disabled: t === 0
3364
+ }, {
3365
+ default: G(() => [w(H(ce), { class: "h-4 w-4" })]),
3366
+ _: 1
3367
+ }, 8, ["onClick", "disabled"]), w(l, {
3368
+ variant: "ghost",
3369
+ size: "icon",
3370
+ class: "h-6 w-6",
3371
+ onClick: (e) => A(t),
3372
+ disabled: t === s.value.length - 1
3373
+ }, {
3374
+ default: G(() => [w(H(ae), { class: "h-4 w-4" })]),
3375
+ _: 1
3376
+ }, 8, ["onClick", "disabled"])]), w(Sr, {
3377
+ column: e,
3378
+ class: "pl-10"
3379
+ }, null, 8, ["column"])]))), 128))]),
3380
+ _: 1
3381
+ }),
3382
+ w(W, null, {
3383
+ default: G(() => [w(l, { onClick: j }, {
3384
+ default: G(() => [...n[37] ||= [C(" Save changes ", -1)]]),
3385
+ _: 1
3386
+ })]),
3387
+ _: 1
3388
+ })
3389
+ ]),
3390
+ _: 1
3391
+ })]),
3392
+ _: 1
3393
+ }, 8, ["open", "onUpdate:open"]);
3394
+ };
3395
+ }
3396
+ }), zr = /* @__PURE__ */ T({
3397
+ __name: "ColumnDropdown",
3398
+ setup(e) {
3399
+ let { isAdmin: t } = p(), n = D("columns"), r = L(null), i = L(null), a = L(!1), o = L(!1), s = () => {
3400
+ i.value = r.value;
3401
+ }, c = (e) => {
3402
+ o.value = e, e || (a.value = !1);
3403
+ }, l = (e) => {
3404
+ a.value = e;
3405
+ };
3406
+ return (e, r) => {
3407
+ let i = z("Button"), u = z("DropdownMenuTrigger"), d = z("DropdownMenuSeparator"), f = z("DropdownMenuCheckboxItem"), p = z("DropdownMenuContent"), m = z("DropdownMenu");
3408
+ return P(), y(m, {
3409
+ open: a.value,
3410
+ "onUpdate:open": l
3411
+ }, {
3412
+ default: G(() => [w(u, { "as-child": "" }, {
3413
+ default: G(() => [w(i, {
3414
+ variant: "outline",
3415
+ class: "ml-auto"
3416
+ }, {
3417
+ default: G(() => [r[3] ||= C(" Columns ", -1), w(H(ae), { class: "ml-2 size-4" })]),
3418
+ _: 1
3419
+ })]),
3420
+ _: 1
3421
+ }), w(p, {
3422
+ align: "end",
3423
+ onCloseAutoFocus: r[2] ||= (e) => {
3424
+ e.preventDefault();
3425
+ }
3426
+ }, {
3427
+ default: G(() => [H(t)() ? (P(), x(_, { key: 0 }, [w(Rr, {
3428
+ open: o.value,
3429
+ "onUpdate:open": r[0] ||= (e) => o.value = e,
3430
+ onSelect: s,
3431
+ onOpenChange: c
3432
+ }, null, 8, ["open"]), H(n)?.length > 0 ? (P(), y(d, { key: 0 })) : b("", !0)], 64)) : b("", !0), (P(!0), x(_, null, R(H(n), (e) => (P(), y(f, {
3433
+ key: e.id,
3434
+ class: "capitalize",
3435
+ "model-value": e.visible,
3436
+ "onUpdate:modelValue": (t) => {
3437
+ e.visible = t;
3438
+ },
3439
+ onSelect: r[1] ||= (e) => {
3440
+ e.preventDefault();
3441
+ }
3442
+ }, {
3443
+ default: G(() => [C(V(e.label), 1)]),
3444
+ _: 2
3445
+ }, 1032, ["model-value", "onUpdate:modelValue"]))), 128))]),
3446
+ _: 1
3447
+ })]),
3448
+ _: 1
3449
+ }, 8, ["open"]);
3450
+ };
3451
+ }
3452
+ }), Br = /* @__PURE__ */ T({
3453
+ __name: "Search",
3454
+ setup(e) {
3455
+ let t = D("table"), n = D("sortMode"), r = L(""), i;
3456
+ return U(() => t?.value?.getState().globalFilter ?? "", (e) => {
3457
+ let t = typeof e == "string" ? e : "";
3458
+ t !== r.value && (r.value = t);
3459
+ }, { immediate: !0 }), U(r, (e) => {
3460
+ i && clearTimeout(i), i = setTimeout(() => {
3461
+ t?.value?.setGlobalFilter(e);
3462
+ }, 80);
3463
+ }), M(() => {
3464
+ i && clearTimeout(i);
3465
+ }), (e, t) => {
3466
+ let i = z("Input");
3467
+ return P(), x("div", { class: j(["flex flex-col items-start gap-1", H(n) ? "opacity-50 pointer-events-none" : ""]) }, [w(i, {
3468
+ class: "min-w-48 max-w-48",
3469
+ placeholder: "Search...",
3470
+ "model-value": r.value,
3471
+ "onUpdate:modelValue": t[0] ||= (e) => r.value = typeof e == "string" ? e : "",
3472
+ disabled: H(n)
3473
+ }, null, 8, ["model-value", "disabled"])], 2);
3474
+ };
3475
+ }
3476
+ }), Vr = { class: "flex flex-col items-start gap-4 py-4" }, Hr = { class: "flex flex-col gap-1.5" }, Ur = { class: "flex items-center gap-2 w-full justify-between" }, Wr = { class: "flex items-center gap-2 ml-auto" }, Gr = /* @__PURE__ */ T({
3477
+ __name: "SortModeSettingsDialog",
3478
+ props: { savedField: {
3479
+ type: String,
3480
+ default: ""
3481
+ } },
3482
+ emits: ["saved"],
3483
+ setup(e, { emit: t }) {
3484
+ let { isAdmin: n } = p(), r = t, i = e, a = (e) => {
3485
+ c.value = e;
3486
+ }, o = D("columns"), c = L(!1), l = L("");
3487
+ U(c, (e) => {
3488
+ e && (l.value = i.savedField ?? "");
3489
+ });
3490
+ let u = () => {
3491
+ r("saved", { field: "" }), d();
3492
+ }, d = () => {
3493
+ c.value = !1;
3494
+ }, f = () => {
3495
+ r("saved", { field: l.value }), d();
3496
+ };
3497
+ return (e, t) => {
3498
+ let r = z("DialogTrigger"), p = z("DialogTitle"), m = z("DialogDescription"), h = z("DialogHeader"), g = z("Label"), v = z("ComboboxTrigger"), T = z("ComboboxInput"), E = z("ComboboxAnchor"), D = z("ComboboxItem"), O = z("ComboboxGroup"), k = z("ComboboxList"), A = z("Combobox"), M = z("Button"), N = z("DialogFooter"), F = z("DialogScrollContent"), I = z("Dialog");
3499
+ return P(), y(I, {
3500
+ open: c.value,
3501
+ "onUpdate:open": [t[3] ||= (e) => c.value = e, a]
3502
+ }, {
3503
+ default: G(() => [w(r, { asChild: "" }, {
3504
+ default: G(() => [H(n)() ? (P(), x("button", {
3505
+ key: 0,
3506
+ class: "text-xs text-primary hover:underline",
3507
+ onClick: t[0] ||= (e) => c.value = !0
3508
+ }, "Settings")) : b("", !0)]),
3509
+ _: 1
3510
+ }), w(F, { class: "sm:max-w-lg" }, {
3511
+ default: G(() => [
3512
+ w(h, null, {
3513
+ default: G(() => [w(p, null, {
3514
+ default: G(() => [...t[4] ||= [C("Sort mode settings", -1)]]),
3515
+ _: 1
3516
+ }), w(m, null, {
3517
+ default: G(() => [...t[5] ||= [C(" Select the property (of type number) to sort by. ", -1)]]),
3518
+ _: 1
3519
+ })]),
3520
+ _: 1
3521
+ }),
3522
+ S("div", Vr, [w(A, {
3523
+ by: "label",
3524
+ class: "w-full",
3525
+ resetSearchTermOnBlur: !1,
3526
+ resetSearchTermOnSelect: !0,
3527
+ modelValue: l.value,
3528
+ "onUpdate:modelValue": t[2] ||= (e) => l.value = e
3529
+ }, {
3530
+ default: G(() => [w(E, { class: "w-full" }, {
3531
+ default: G(() => [S("div", Hr, [w(v, null, {
3532
+ default: G(() => [w(g, { class: "text-xs text-muted-foreground" }, {
3533
+ default: G(() => [...t[6] ||= [C("Field", -1)]]),
3534
+ _: 1
3535
+ })]),
3536
+ _: 1
3537
+ }), w(T, {
3538
+ modelValue: l.value,
3539
+ "onUpdate:modelValue": t[1] ||= (e) => l.value = e,
3540
+ hideIcon: "",
3541
+ class: "w-full"
3542
+ }, null, 8, ["modelValue"])])]),
3543
+ _: 1
3544
+ }), w(k, { class: "w-full" }, {
3545
+ default: G(() => [w(O, null, {
3546
+ default: G(() => [(P(!0), x(_, null, R(H(o), (e) => (P(), y(D, {
3547
+ key: e.property,
3548
+ value: e.property,
3549
+ onSelect: (t) => l.value = e.property
3550
+ }, {
3551
+ default: G(() => [C(V(e.property) + " ", 1), l.value === e.property ? (P(), y(H(ie), {
3552
+ key: 0,
3553
+ class: j(H(s)("ml-auto size-4"))
3554
+ }, null, 8, ["class"])) : b("", !0)]),
3555
+ _: 2
3556
+ }, 1032, ["value", "onSelect"]))), 128))]),
3557
+ _: 1
3558
+ })]),
3559
+ _: 1
3560
+ })]),
3561
+ _: 1
3562
+ }, 8, ["modelValue"])]),
3563
+ w(N, null, {
3564
+ default: G(() => [S("div", Ur, [i.savedField ? (P(), y(M, {
3565
+ key: 0,
3566
+ variant: "outline",
3567
+ onClick: u
3568
+ }, {
3569
+ default: G(() => [...t[7] ||= [C(" Disable sort-mode ", -1)]]),
3570
+ _: 1
3571
+ })) : b("", !0), S("div", Wr, [w(M, {
3572
+ variant: "outline",
3573
+ onClick: d
3574
+ }, {
3575
+ default: G(() => [...t[8] ||= [C(" Cancel ", -1)]]),
3576
+ _: 1
3577
+ }), w(M, { onClick: f }, {
3578
+ default: G(() => [...t[9] ||= [C(" Save changes ", -1)]]),
3579
+ _: 1
3580
+ })])])]),
3581
+ _: 1
3582
+ })
3583
+ ]),
3584
+ _: 1
3585
+ })]),
3586
+ _: 1
3587
+ }, 8, ["open"]);
3588
+ };
3589
+ }
3590
+ }), Kr = { class: "flex flex-col items-start gap-1" }, qr = {
3591
+ key: 1,
3592
+ class: "flex items-center gap-2"
3593
+ }, Jr = /* @__PURE__ */ T({
3594
+ __name: "SortMode",
3595
+ setup(e) {
3596
+ let { getModuleData: t, setModuleData: n } = h(), { isAdmin: r } = p(), i = D("table"), a = D("data"), o = D("sortMode", L(!1)), s = D("sortModeProperty", L("")), c = D("saveSortMode", () => {}), l = (e) => {
3597
+ s.value = e.field, n("sortMode", e);
3598
+ };
3599
+ N(async () => {
3600
+ s.value = (await t("sortMode"))?.field ?? "";
3601
+ });
3602
+ let u = L(0), d = () => {
3603
+ o.value = !0, u.value = i?.value?.getState().pagination.pageSize, i?.value?.setPageSize(a.value.length);
3604
+ }, f = () => {
3605
+ o.value = !1, i?.value?.setPageSize(u.value);
3606
+ }, m = () => {
3607
+ c();
3608
+ };
3609
+ return (e, t) => {
3610
+ let n = z("Button");
3611
+ return P(), x("div", Kr, [
3612
+ (H(s) || H(r)()) && !H(o) ? (P(), y(n, {
3613
+ key: 0,
3614
+ variant: "outline",
3615
+ disabled: !H(s),
3616
+ onClick: d
3617
+ }, {
3618
+ default: G(() => [w(H(ne), { class: "size-4" }), C(" " + V(H(o) ? "Save order" : "Reorder rows"), 1)]),
3619
+ _: 1
3620
+ }, 8, ["disabled"])) : b("", !0),
3621
+ H(o) ? (P(), x("div", qr, [w(n, {
3622
+ variant: "outline",
3623
+ size: "icon",
3624
+ onClick: f
3625
+ }, {
3626
+ default: G(() => [w(H(he), { class: "size-4" })]),
3627
+ _: 1
3628
+ }), w(n, { onClick: m }, {
3629
+ default: G(() => [...t[0] ||= [C(" Save order ", -1)]]),
3630
+ _: 1
3631
+ })])) : b("", !0),
3632
+ w(Gr, {
3633
+ onSaved: l,
3634
+ "saved-field": H(s)
3635
+ }, null, 8, ["saved-field"])
3636
+ ]);
3637
+ };
3638
+ }
3639
+ });
3640
+ //#endregion
3641
+ //#region src/lib/dateRangePresets.ts
3642
+ function $(e) {
3643
+ return (/* @__PURE__ */ new Date(e.getTime() - e.getTimezoneOffset() * 6e4)).toISOString().slice(0, 10);
3644
+ }
3645
+ function Yr() {
3646
+ let e = /* @__PURE__ */ new Date(), t = $(e);
3647
+ return {
3648
+ today: [t],
3649
+ yesterday: [$(new Date(e.getFullYear(), e.getMonth(), e.getDate() - 1))],
3650
+ last7days: [$(new Date(e.getFullYear(), e.getMonth(), e.getDate() - 6)), t],
3651
+ lastMonth: [$(new Date(e.getFullYear(), e.getMonth() - 1, e.getDate())), t],
3652
+ last6months: [$(new Date(e.getFullYear(), e.getMonth() - 6, e.getDate())), t],
3653
+ lastYear: [$(new Date(e.getFullYear() - 1, e.getMonth(), e.getDate())), t],
3654
+ tomorrow: [$(new Date(e.getFullYear(), e.getMonth(), e.getDate() + 1))],
3655
+ next7days: [t, $(new Date(e.getFullYear(), e.getMonth(), e.getDate() + 6))],
3656
+ nextMonth: [t, $(new Date(e.getFullYear(), e.getMonth() + 1, e.getDate()))],
3657
+ next6months: [t, $(new Date(e.getFullYear(), e.getMonth() + 6, e.getDate()))],
3658
+ nextYear: [t, $(new Date(e.getFullYear() + 1, e.getMonth(), e.getDate()))]
3659
+ };
3660
+ }
3661
+ //#endregion
3662
+ //#region src/table/components/date-range-filter/DateRangeSettingsDialog.vue?vue&type=script&setup=true&lang.ts
3663
+ var Xr = ["disabled"], Zr = { class: "flex flex-col items-start gap-4 py-4" }, Qr = { class: "flex flex-col gap-1.5" }, $r = { class: "flex flex-col gap-1.5" }, ei = { class: "flex items-center gap-2 w-full justify-between" }, ti = { class: "flex items-center gap-2 ml-auto" }, ni = /* @__PURE__ */ T({
3664
+ __name: "DateRangeSettingsDialog",
3665
+ props: {
3666
+ savedField: {
3667
+ type: String,
3668
+ default: ""
3669
+ },
3670
+ savedDefaultDate: {
3671
+ type: String,
3672
+ default: "today"
3673
+ }
3674
+ },
3675
+ emits: ["saved"],
3676
+ setup(e, { emit: t }) {
3677
+ let { isAdmin: n } = p(), r = t, i = e, a = (e) => {
3678
+ l.value = e;
3679
+ }, o = D("sortMode"), c = D("columns"), l = L(!1), u = L(""), d = L("");
3680
+ U(l, (e) => {
3681
+ e && (u.value = i.savedField ?? "", d.value = i.savedDefaultDate ?? "today");
3682
+ });
3683
+ let f = () => {
3684
+ r("saved", {
3685
+ field: "",
3686
+ defaultDate: "today"
3687
+ }), m();
3688
+ }, m = () => {
3689
+ l.value = !1;
3690
+ }, h = () => {
3691
+ r("saved", {
3692
+ field: u.value,
3693
+ defaultDate: d.value
3694
+ }), m();
3695
+ };
3696
+ return (e, t) => {
3697
+ let r = z("DialogTrigger"), p = z("DialogTitle"), g = z("DialogDescription"), v = z("DialogHeader"), T = z("Label"), E = z("ComboboxTrigger"), D = z("ComboboxInput"), O = z("ComboboxAnchor"), k = z("ComboboxItem"), A = z("ComboboxGroup"), M = z("ComboboxList"), N = z("Combobox"), F = z("SelectValue"), I = z("SelectTrigger"), L = z("SelectItem"), B = z("SelectLabel"), ee = z("SelectGroup"), te = z("SelectContent"), U = z("Select"), W = z("Button"), K = z("DialogFooter"), ne = z("DialogScrollContent"), re = z("Dialog");
3698
+ return P(), y(re, {
3699
+ open: l.value,
3700
+ "onUpdate:open": [t[4] ||= (e) => l.value = e, a]
3701
+ }, {
3702
+ default: G(() => [w(r, { asChild: "" }, {
3703
+ default: G(() => [H(n)() ? (P(), x("button", {
3704
+ key: 0,
3705
+ class: "text-xs text-primary hover:underline",
3706
+ disabled: H(o),
3707
+ onClick: t[0] ||= (e) => l.value = !0
3708
+ }, "Settings", 8, Xr)) : b("", !0)]),
3709
+ _: 1
3710
+ }), w(ne, { class: "sm:max-w-lg" }, {
3711
+ default: G(() => [
3712
+ w(v, null, {
3713
+ default: G(() => [w(p, null, {
3714
+ default: G(() => [...t[5] ||= [C("Date range filter settings", -1)]]),
3715
+ _: 1
3716
+ }), w(g, null, {
3717
+ default: G(() => [...t[6] ||= [C(" Select the property (of type date) to filter by. ", -1)]]),
3718
+ _: 1
3719
+ })]),
3720
+ _: 1
3721
+ }),
3722
+ S("div", Zr, [w(N, {
3723
+ by: "label",
3724
+ class: "w-full",
3725
+ resetSearchTermOnBlur: !1,
3726
+ resetSearchTermOnSelect: !0,
3727
+ modelValue: u.value,
3728
+ "onUpdate:modelValue": t[2] ||= (e) => u.value = e
3729
+ }, {
3730
+ default: G(() => [w(O, { class: "w-full" }, {
3731
+ default: G(() => [S("div", Qr, [w(E, null, {
3732
+ default: G(() => [w(T, { class: "text-xs text-muted-foreground" }, {
3733
+ default: G(() => [...t[7] ||= [C("Field", -1)]]),
3734
+ _: 1
3735
+ })]),
3736
+ _: 1
3737
+ }), w(D, {
3738
+ modelValue: u.value,
3739
+ "onUpdate:modelValue": t[1] ||= (e) => u.value = e,
3740
+ hideIcon: "",
3741
+ class: "w-full"
3742
+ }, null, 8, ["modelValue"])])]),
3743
+ _: 1
3744
+ }), w(M, { class: "w-full" }, {
3745
+ default: G(() => [w(A, null, {
3746
+ default: G(() => [(P(!0), x(_, null, R(H(c), (e) => (P(), y(k, {
3747
+ key: e.property,
3748
+ value: e.property,
3749
+ onSelect: (t) => u.value = e.property
3750
+ }, {
3751
+ default: G(() => [C(V(e.property) + " ", 1), u.value === e.property ? (P(), y(H(ie), {
3752
+ key: 0,
3753
+ class: j(H(s)("ml-auto size-4"))
3754
+ }, null, 8, ["class"])) : b("", !0)]),
3755
+ _: 2
3756
+ }, 1032, ["value", "onSelect"]))), 128))]),
3757
+ _: 1
3758
+ })]),
3759
+ _: 1
3760
+ })]),
3761
+ _: 1
3762
+ }, 8, ["modelValue"]), S("div", $r, [w(T, { class: "text-xs text-muted-foreground" }, {
3763
+ default: G(() => [...t[8] ||= [C("Default date", -1)]]),
3764
+ _: 1
3765
+ }), w(U, {
3766
+ modelValue: d.value,
3767
+ "onUpdate:modelValue": t[3] ||= (e) => d.value = e
3768
+ }, {
3769
+ default: G(() => [w(I, { class: "w-[180px]" }, {
3770
+ default: G(() => [w(F, { placeholder: "Select a fruit" })]),
3771
+ _: 1
3772
+ }), w(te, null, {
3773
+ default: G(() => [w(ee, null, {
3774
+ default: G(() => [
3775
+ w(L, { value: "today" }, {
3776
+ default: G(() => [...t[9] ||= [C(" Today ", -1)]]),
3777
+ _: 1
3778
+ }),
3779
+ w(B, null, {
3780
+ default: G(() => [...t[10] ||= [C("Past", -1)]]),
3781
+ _: 1
3782
+ }),
3783
+ w(L, { value: "yesterday" }, {
3784
+ default: G(() => [...t[11] ||= [C(" 1 day ago ", -1)]]),
3785
+ _: 1
3786
+ }),
3787
+ w(L, { value: "last7days" }, {
3788
+ default: G(() => [...t[12] ||= [C(" Last 7 days ", -1)]]),
3789
+ _: 1
3790
+ }),
3791
+ w(L, { value: "lastMonth" }, {
3792
+ default: G(() => [...t[13] ||= [C(" Last 30 days ", -1)]]),
3793
+ _: 1
3794
+ }),
3795
+ w(L, { value: "last6months" }, {
3796
+ default: G(() => [...t[14] ||= [C(" Last 6 months ", -1)]]),
3797
+ _: 1
3798
+ }),
3799
+ w(L, { value: "lastYear" }, {
3800
+ default: G(() => [...t[15] ||= [C(" Last 12 months ", -1)]]),
3801
+ _: 1
3802
+ }),
3803
+ w(B, null, {
3804
+ default: G(() => [...t[16] ||= [C("Future", -1)]]),
3805
+ _: 1
3806
+ }),
3807
+ w(L, { value: "tomorrow" }, {
3808
+ default: G(() => [...t[17] ||= [C(" In 1 day ", -1)]]),
3809
+ _: 1
3810
+ }),
3811
+ w(L, { value: "next7days" }, {
3812
+ default: G(() => [...t[18] ||= [C(" Next 7 days ", -1)]]),
3813
+ _: 1
3814
+ }),
3815
+ w(L, { value: "nextMonth" }, {
3816
+ default: G(() => [...t[19] ||= [C(" Next 30 days ", -1)]]),
3817
+ _: 1
3818
+ }),
3819
+ w(L, { value: "next6months" }, {
3820
+ default: G(() => [...t[20] ||= [C(" Next 6 months ", -1)]]),
3821
+ _: 1
3822
+ }),
3823
+ w(L, { value: "nextYear" }, {
3824
+ default: G(() => [...t[21] ||= [C(" Next 12 months ", -1)]]),
3825
+ _: 1
3826
+ })
3827
+ ]),
3828
+ _: 1
3829
+ })]),
3830
+ _: 1
3831
+ })]),
3832
+ _: 1
3833
+ }, 8, ["modelValue"])])]),
3834
+ w(K, null, {
3835
+ default: G(() => [S("div", ei, [i.savedField ? (P(), y(W, {
3836
+ key: 0,
3837
+ variant: "outline",
3838
+ onClick: f
3839
+ }, {
3840
+ default: G(() => [...t[22] ||= [C(" Disable date range filter ", -1)]]),
3841
+ _: 1
3842
+ })) : b("", !0), S("div", ti, [w(W, {
3843
+ variant: "outline",
3844
+ onClick: m
3845
+ }, {
3846
+ default: G(() => [...t[23] ||= [C(" Cancel ", -1)]]),
3847
+ _: 1
3848
+ }), w(W, { onClick: h }, {
3849
+ default: G(() => [...t[24] ||= [C(" Save changes ", -1)]]),
3850
+ _: 1
3851
+ })])])]),
3852
+ _: 1
3853
+ })
3854
+ ]),
3855
+ _: 1
3856
+ })]),
3857
+ _: 1
3858
+ }, 8, ["open"]);
3859
+ };
3860
+ }
3861
+ }), ri = { class: "flex justify-between w-full p-3 pt-0" }, ii = { class: "flex gap-2" }, ai = { class: "w-full mx-auto" }, oi = { class: "flex justify-center mb-1 w-full px-4" }, si = /* @__PURE__ */ r(/* @__PURE__ */ T({
3862
+ __name: "DateRangeFilter",
3863
+ setup(r) {
3864
+ let { getModuleData: i, setModuleData: a } = h(), { isAdmin: o } = p(), l = D("sortMode"), u = D("dateRangeFilter"), d = D("getTableData"), f = new n("en-US", { dateStyle: "medium" }), m = L({
3865
+ start: new t(2022, 1, 20),
3866
+ end: new t(2022, 1, 20).subtract({ days: 20 })
3867
+ }), g = L(!1), _ = L(""), T = L("today"), { width: E } = c(), O = v(() => E.value < 640), k = L(!1), A = L({
3868
+ start: void 0,
3869
+ end: void 0
3870
+ }), M = (e) => {
3871
+ _.value = e.field, T.value = e.defaultDate, a("dateRangeFilter", e);
3872
+ }, F = (e) => {
3873
+ let n = Yr()?.[e], r = n[0].split("-")?.map((e) => parseInt(e)), i = n[1] ? n[1].split("-")?.map((e) => parseInt(e)) : [];
3874
+ m.value = {
3875
+ start: new t(r[0], r[1], r[2]),
3876
+ end: i.length > 0 ? new t(i[0], i[1], i[2]) : new t(r[0], r[1], r[2])
3877
+ };
3878
+ }, I = (e) => {
3879
+ R(e), ne();
3880
+ }, R = (e) => {
3881
+ let n = Yr()?.[e], r = n[0].split("-")?.map((e) => parseInt(e)), i = n[1] ? n[1].split("-")?.map((e) => parseInt(e)) : [];
3882
+ A.value = {
3883
+ start: new t(r[0], r[1], r[2]),
3884
+ end: i.length > 0 ? new t(i[0], i[1], i[2]) : new t(r[0], r[1], r[2])
3885
+ };
3886
+ }, B = (e) => {
3887
+ let t = e.target.value;
3888
+ t !== "-1" && (R(t), e.target.value = "-1");
3889
+ }, ee = () => {
3890
+ m.value = {
3891
+ start: A.value.start,
3892
+ end: A.value.end ?? A.value.start
3893
+ }, k.value = !1;
3894
+ let t = m.value.end.toDate(e());
3895
+ t.setHours(23, 59, 59, 999), u.value = [m.value.start.toDate(e()), t], d();
3896
+ }, te = () => {
3897
+ A.value = {
3898
+ start: m.value.start,
3899
+ end: m.value.end
3900
+ }, k.value = !0;
3901
+ }, U = () => {
3902
+ A.value = {
3903
+ start: m.value.start,
3904
+ end: m.value.end
3905
+ }, g.value = !0;
3906
+ }, W = v(() => {
3907
+ if (!A.value.start) return "Pick a date";
3908
+ let t = f.format(A.value.start.toDate(e()));
3909
+ return !A.value.end || A.value.start.toString() === A.value.end.toString() ? t : `${t} - ${f.format(A.value.end.toDate(e()))}`;
3910
+ }), K = v(() => {
3911
+ if (!m.value.start) return "";
3912
+ let t = f.format(m.value.start.toDate(e()));
3913
+ return !m.value.end || m.value.start.toString() === m.value.end.toString() ? t : `${t} - ${f.format(m.value.end.toDate(e()))}`;
3914
+ }), ne = () => {
3915
+ g.value = !1, m.value = {
3916
+ start: A.value.start,
3917
+ end: A.value.end ?? A.value.start
3918
+ };
3919
+ let t = m.value.end.toDate(e());
3920
+ t.setHours(23, 59, 59, 999), u.value = [m.value.start.toDate(e()), t], d();
3921
+ };
3922
+ return N(async () => {
3923
+ let e = await i("dateRangeFilter");
3924
+ _.value = e?.field ?? "", T.value = e?.defaultDate ?? "today", F(T.value), A.value = {
3925
+ start: m.value.start,
3926
+ end: m.value.end
3927
+ }, ne();
3928
+ }), (e, t) => {
3929
+ let n = z("Button"), r = z("PopoverTrigger"), i = z("RangeCalendar"), a = z("DropdownMenuTrigger"), c = z("DropdownMenuItem"), u = z("DropdownMenuSeparator"), d = z("DropdownMenuLabel"), f = z("DropdownMenuGroup"), p = z("DropdownMenuContent"), h = z("DropdownMenu"), v = z("PopoverContent"), E = z("Popover"), D = z("DrawerTrigger"), N = z("DrawerTitle"), F = z("DrawerHeader"), L = z("DrawerClose"), R = z("DrawerFooter"), ie = z("DrawerContent"), ae = z("Drawer");
3930
+ return _.value || H(o)() ? (P(), x("div", {
3931
+ key: 0,
3932
+ class: j(["flex flex-col items-start gap-1", H(l) ? "opacity-50 pointer-events-none" : ""])
3933
+ }, [O.value ? (P(), y(ae, {
3934
+ key: 1,
3935
+ open: k.value,
3936
+ "onUpdate:open": t[17] ||= (e) => k.value = e
3937
+ }, {
3938
+ default: G(() => [w(D, { "as-child": "" }, {
3939
+ default: G(() => [w(n, {
3940
+ variant: "outline",
3941
+ class: j(H(s)("w-[280px] justify-start text-left font-normal", !m.value && "text-muted-foreground")),
3942
+ disabled: H(l) || !_.value,
3943
+ onClick: te
3944
+ }, {
3945
+ default: G(() => [w(H(re), { class: "size-4" }), C(" " + V(K.value || "Pick a date"), 1)]),
3946
+ _: 1
3947
+ }, 8, ["class", "disabled"])]),
3948
+ _: 1
3949
+ }), w(ie, null, {
3950
+ default: G(() => [S("div", ai, [
3951
+ w(F, null, {
3952
+ default: G(() => [w(N, { class: "text-center" }, {
3953
+ default: G(() => [C(V(W.value), 1)]),
3954
+ _: 1
3955
+ })]),
3956
+ _: 1
3957
+ }),
3958
+ S("div", oi, [S("select", {
3959
+ class: "border px-2 py-1.5 rounded-md text-sm",
3960
+ onChange: B
3961
+ }, [...t[34] ||= [
3962
+ S("option", { value: "-1" }, "Select Preset", -1),
3963
+ S("optgroup", { label: "Past" }, [
3964
+ S("option", { value: "today" }, "Today"),
3965
+ S("option", { value: "yesterday" }, "Yesterday"),
3966
+ S("option", { value: "last7days" }, "7 days"),
3967
+ S("option", { value: "lastMonth" }, "30 days"),
3968
+ S("option", { value: "last6months" }, "6 months"),
3969
+ S("option", { value: "lastYear" }, "1 year")
3970
+ ], -1),
3971
+ S("optgroup", { label: "Future" }, [
3972
+ S("option", { value: "tomorrow" }, "Tomorrow"),
3973
+ S("option", { value: "next7days" }, "7 days"),
3974
+ S("option", { value: "nextMonth" }, "30 days"),
3975
+ S("option", { value: "next6months" }, "6 months"),
3976
+ S("option", { value: "nextYear" }, "1 year")
3977
+ ], -1)
3978
+ ]], 32)]),
3979
+ w(i, {
3980
+ modelValue: A.value,
3981
+ "onUpdate:modelValue": t[15] ||= (e) => A.value = e,
3982
+ "initial-focus": "",
3983
+ "number-of-months": 1,
3984
+ class: "mobile-date-range-calendar",
3985
+ "onUpdate:startValue": t[16] ||= (e) => A.value.start = e
3986
+ }, null, 8, ["modelValue"]),
3987
+ w(R, null, {
3988
+ default: G(() => [w(n, { onClick: ee }, {
3989
+ default: G(() => [...t[35] ||= [C("Apply", -1)]]),
3990
+ _: 1
3991
+ }), w(L, null, {
3992
+ default: G(() => [w(n, {
3993
+ variant: "outline",
3994
+ class: "w-full"
3995
+ }, {
3996
+ default: G(() => [...t[36] ||= [C("Cancel", -1)]]),
3997
+ _: 1
3998
+ })]),
3999
+ _: 1
4000
+ })]),
4001
+ _: 1
4002
+ })
4003
+ ])]),
4004
+ _: 1
4005
+ })]),
4006
+ _: 1
4007
+ }, 8, ["open"])) : (P(), y(E, {
4008
+ key: 0,
4009
+ open: g.value,
4010
+ "onUpdate:open": t[14] ||= (e) => {
4011
+ e ? U() : g.value = !1;
4012
+ }
4013
+ }, {
4014
+ default: G(() => [w(r, { "as-child": "" }, {
4015
+ default: G(() => [w(n, {
4016
+ variant: "outline",
4017
+ class: j(H(s)("w-[280px] justify-start text-left font-normal", !m.value && "text-muted-foreground")),
4018
+ disabled: H(l) || !_.value
4019
+ }, {
4020
+ default: G(() => [w(H(re), { class: "size-4" }), C(" " + V(K.value || "Pick a date"), 1)]),
4021
+ _: 1
4022
+ }, 8, ["class", "disabled"])]),
4023
+ _: 1
4024
+ }), w(v, { class: "w-auto p-0" }, {
4025
+ default: G(() => [w(i, {
4026
+ modelValue: A.value,
4027
+ "onUpdate:modelValue": t[0] ||= (e) => A.value = e,
4028
+ "initial-focus": "",
4029
+ "number-of-months": 2,
4030
+ "onUpdate:startValue": t[1] ||= (e) => A.value.start = e
4031
+ }, null, 8, ["modelValue"]), S("div", ri, [w(h, null, {
4032
+ default: G(() => [w(a, { "as-child": "" }, {
4033
+ default: G(() => [w(n, { variant: "outline" }, {
4034
+ default: G(() => [...t[18] ||= [C(" Presets ", -1)]]),
4035
+ _: 1
4036
+ })]),
4037
+ _: 1
4038
+ }), w(p, { class: "w-56" }, {
4039
+ default: G(() => [w(f, null, {
4040
+ default: G(() => [
4041
+ w(c, { onClick: t[2] ||= (e) => I("today") }, {
4042
+ default: G(() => [...t[19] ||= [C(" Today ", -1)]]),
4043
+ _: 1
4044
+ }),
4045
+ w(u),
4046
+ w(d, null, {
4047
+ default: G(() => [...t[20] ||= [C("Past", -1)]]),
4048
+ _: 1
4049
+ }),
4050
+ w(c, { onClick: t[3] ||= (e) => I("yesterday") }, {
4051
+ default: G(() => [...t[21] ||= [C(" 1 day ago ", -1)]]),
4052
+ _: 1
4053
+ }),
4054
+ w(c, { onClick: t[4] ||= (e) => I("last7days") }, {
4055
+ default: G(() => [...t[22] ||= [C(" Last 7 days ", -1)]]),
4056
+ _: 1
4057
+ }),
4058
+ w(c, { onClick: t[5] ||= (e) => I("lastMonth") }, {
4059
+ default: G(() => [...t[23] ||= [C(" Last 30 days ", -1)]]),
4060
+ _: 1
4061
+ }),
4062
+ w(c, { onClick: t[6] ||= (e) => I("last6months") }, {
4063
+ default: G(() => [...t[24] ||= [C(" Last 6 months ", -1)]]),
4064
+ _: 1
4065
+ }),
4066
+ w(c, { onClick: t[7] ||= (e) => I("lastYear") }, {
4067
+ default: G(() => [...t[25] ||= [C(" Last 12 months ", -1)]]),
4068
+ _: 1
4069
+ }),
4070
+ w(u),
4071
+ w(d, null, {
4072
+ default: G(() => [...t[26] ||= [C("Future", -1)]]),
4073
+ _: 1
4074
+ }),
4075
+ w(c, { onClick: t[8] ||= (e) => I("tomorrow") }, {
4076
+ default: G(() => [...t[27] ||= [C(" In 1 day ", -1)]]),
4077
+ _: 1
4078
+ }),
4079
+ w(c, { onClick: t[9] ||= (e) => I("next7days") }, {
4080
+ default: G(() => [...t[28] ||= [C(" Next 7 days ", -1)]]),
4081
+ _: 1
4082
+ }),
4083
+ w(c, { onClick: t[10] ||= (e) => I("nextMonth") }, {
4084
+ default: G(() => [...t[29] ||= [C(" Next 30 days ", -1)]]),
4085
+ _: 1
4086
+ }),
4087
+ w(c, { onClick: t[11] ||= (e) => I("next6months") }, {
4088
+ default: G(() => [...t[30] ||= [C(" Next 6 months ", -1)]]),
4089
+ _: 1
4090
+ }),
4091
+ w(c, { onClick: t[12] ||= (e) => I("nextYear") }, {
4092
+ default: G(() => [...t[31] ||= [C(" Next 12 months ", -1)]]),
4093
+ _: 1
4094
+ })
4095
+ ]),
4096
+ _: 1
4097
+ })]),
4098
+ _: 1
4099
+ })]),
4100
+ _: 1
4101
+ }), S("div", ii, [w(n, {
4102
+ variant: "outline",
4103
+ onClick: t[13] ||= (e) => g.value = !1
4104
+ }, {
4105
+ default: G(() => [...t[32] ||= [C("Cancel", -1)]]),
4106
+ _: 1
4107
+ }), w(n, { onClick: ne }, {
4108
+ default: G(() => [...t[33] ||= [C("Apply", -1)]]),
4109
+ _: 1
4110
+ })])])]),
4111
+ _: 1
4112
+ })]),
4113
+ _: 1
4114
+ }, 8, ["open"])), w(ni, {
4115
+ onSaved: M,
4116
+ "saved-field": _.value,
4117
+ "saved-default-date": T.value
4118
+ }, null, 8, ["saved-field", "saved-default-date"])], 2)) : b("", !0);
4119
+ };
4120
+ }
4121
+ }), [["__scopeId", "data-v-fd470602"]]), ci = { class: "grid grid-cols-3 gap-2 mb-2 py-2" }, li = { class: "flex flex-col items-start gap-1.5" }, ui = { class: "flex flex-col items-start gap-1.5" }, di = { class: "grid gap-4" }, fi = { class: "grid grid-cols-4 items-center gap-4" }, pi = { class: "grid grid-cols-4 items-center gap-4" }, mi = { class: "grid grid-cols-4 items-center gap-4" }, hi = { class: "flex justify-end gap-2" }, gi = /* @__PURE__ */ T({
4122
+ __name: "FilterDialog",
4123
+ emits: [
4124
+ "filterAdded",
4125
+ "filterEdited",
4126
+ "filterRemoved"
4127
+ ],
4128
+ setup(e, { expose: t, emit: n }) {
4129
+ let r = n;
4130
+ D("columns");
4131
+ let i = L(!1), a = L("add"), o = L(null), s = L(!1), c = I({
4132
+ label: "",
4133
+ property: "",
4134
+ options: []
4135
+ }), l = I({
4136
+ value: "",
4137
+ label: "",
4138
+ checked: !1
4139
+ }), u = (e) => {
4140
+ a.value = e ? "edit" : "add", o.value = e ?? null, c.label = e?.label ?? "", c.property = e?.property ?? "", c.options = e?.options ?? [], i.value = !0;
4141
+ }, d = () => {
4142
+ let e = crypto.randomUUID();
4143
+ c.options.push({
4144
+ id: e,
4145
+ value: l.value,
4146
+ label: l.label,
4147
+ checked: l.checked
4148
+ }), l.value = "", l.label = "", l.checked = !1;
4149
+ }, f = (e) => {
4150
+ c.options = c.options.filter((t) => t.id !== e);
4151
+ }, p = () => {
4152
+ a.value === "add" ? r("filterAdded", c) : r("filterEdited", {
4153
+ ...c,
4154
+ id: o.value.id
4155
+ }), i.value = !1;
4156
+ }, m = () => {
4157
+ s.value = !1;
4158
+ }, h = () => {
4159
+ r("filterRemoved", o.value.id), i.value = !1;
4160
+ };
4161
+ return t({ openDialog: u }), (e, t) => {
4162
+ let n = z("DialogTitle"), r = z("DialogDescription"), o = z("DialogHeader"), u = z("Label"), g = z("Input"), v = z("Button"), T = z("PopoverTrigger"), E = z("Checkbox"), D = z("PopoverContent"), O = z("Popover"), k = z("DialogFooter"), A = z("DialogScrollContent"), j = z("Dialog");
4163
+ return P(), y(j, {
4164
+ open: i.value,
4165
+ "onUpdate:open": t[6] ||= (e) => i.value = e
4166
+ }, {
4167
+ default: G(() => [w(A, { class: "sm:max-w-2xl" }, {
4168
+ default: G(() => [
4169
+ w(o, null, {
4170
+ default: G(() => [w(n, null, {
4171
+ default: G(() => [C(V(a.value === "add" ? "Add Filter" : "Edit Filter"), 1)]),
4172
+ _: 1
4173
+ }), w(r, null, {
4174
+ default: G(() => [C(V(a.value === "add" ? "Add a new filter for this table." : "Edit the selected filter."), 1)]),
4175
+ _: 1
4176
+ })]),
4177
+ _: 1
4178
+ }),
4179
+ S("div", ci, [S("div", li, [w(u, {
4180
+ for: "filter_dialog_label",
4181
+ class: "text-xs text-muted-foreground"
4182
+ }, {
4183
+ default: G(() => [...t[7] ||= [C("Label", -1)]]),
4184
+ _: 1
4185
+ }), w(g, {
4186
+ id: "filter_dialog_label",
4187
+ modelValue: c.label,
4188
+ "onUpdate:modelValue": t[0] ||= (e) => c.label = e
4189
+ }, null, 8, ["modelValue"])]), S("div", ui, [w(u, {
4190
+ for: "filter_dialog_property",
4191
+ class: "text-xs text-muted-foreground"
4192
+ }, {
4193
+ default: G(() => [...t[8] ||= [C("Property", -1)]]),
4194
+ _: 1
4195
+ }), w(g, {
4196
+ id: "filter_dialog_property",
4197
+ modelValue: c.property,
4198
+ "onUpdate:modelValue": t[1] ||= (e) => c.property = e
4199
+ }, null, 8, ["modelValue"])])]),
4200
+ S("div", null, [
4201
+ w(u, { class: "mb-1" }, {
4202
+ default: G(() => [...t[9] ||= [C("Options", -1)]]),
4203
+ _: 1
4204
+ }),
4205
+ t[16] ||= S("p", { class: "text-xs text-muted-foreground mb-2" }, " Define all options for this filter. ", -1),
4206
+ w(O, {
4207
+ open: s.value,
4208
+ "onUpdate:open": t[5] ||= (e) => s.value = e
4209
+ }, {
4210
+ default: G(() => [w(T, { "as-child": "" }, {
4211
+ default: G(() => [w(v, { variant: "outline" }, {
4212
+ default: G(() => [w(H(q), { class: "mr-2 size-4" }), t[10] ||= C(" Add option ", -1)]),
4213
+ _: 1
4214
+ })]),
4215
+ _: 1
4216
+ }), w(D, { class: "w-80" }, {
4217
+ default: G(() => [S("div", di, [
4218
+ S("div", fi, [w(u, {
4219
+ for: "value",
4220
+ class: "text-right"
4221
+ }, {
4222
+ default: G(() => [...t[11] ||= [C(" Value ", -1)]]),
4223
+ _: 1
4224
+ }), w(g, {
4225
+ id: "value",
4226
+ class: "col-span-3",
4227
+ modelValue: l.value,
4228
+ "onUpdate:modelValue": t[2] ||= (e) => l.value = e
4229
+ }, null, 8, ["modelValue"])]),
4230
+ S("div", pi, [w(u, {
4231
+ for: "label",
4232
+ class: "text-right"
4233
+ }, {
4234
+ default: G(() => [...t[12] ||= [C(" Label ", -1)]]),
4235
+ _: 1
4236
+ }), w(g, {
4237
+ id: "label",
4238
+ class: "col-span-3",
4239
+ modelValue: l.label,
4240
+ "onUpdate:modelValue": t[3] ||= (e) => l.label = e
4241
+ }, null, 8, ["modelValue"])]),
4242
+ S("div", mi, [w(u, {
4243
+ for: "checked",
4244
+ class: "text-right"
4245
+ }, {
4246
+ default: G(() => [...t[13] ||= [C(" Checked by default ", -1)]]),
4247
+ _: 1
4248
+ }), w(E, {
4249
+ id: "checked",
4250
+ class: "col-span-3 border-ring",
4251
+ modelValue: l.checked,
4252
+ "onUpdate:modelValue": t[4] ||= (e) => l.checked = e
4253
+ }, null, 8, ["modelValue"])]),
4254
+ S("div", hi, [w(v, {
4255
+ variant: "outline",
4256
+ onClick: m
4257
+ }, {
4258
+ default: G(() => [...t[14] ||= [C(" Cancel ", -1)]]),
4259
+ _: 1
4260
+ }), w(v, { onClick: d }, {
4261
+ default: G(() => [...t[15] ||= [C(" Add option ", -1)]]),
4262
+ _: 1
4263
+ })])
4264
+ ])]),
4265
+ _: 1
4266
+ })]),
4267
+ _: 1
4268
+ }, 8, ["open"])
4269
+ ]),
4270
+ S("div", null, [(P(!0), x(_, null, R(c.options, (e) => (P(), x("div", {
4271
+ key: e.id,
4272
+ class: "grid grid-cols-4 items-center gap-4"
4273
+ }, [
4274
+ w(u, {
4275
+ for: "value",
4276
+ class: "text-right"
4277
+ }, {
4278
+ default: G(() => [...t[17] ||= [C(" Value ", -1)]]),
4279
+ _: 1
4280
+ }),
4281
+ w(g, {
4282
+ id: "value",
4283
+ class: "col-span-3",
4284
+ modelValue: e.value,
4285
+ "onUpdate:modelValue": (t) => e.value = t
4286
+ }, null, 8, ["modelValue", "onUpdate:modelValue"]),
4287
+ w(v, {
4288
+ variant: "destructive",
4289
+ onClick: (t) => f(e.id)
4290
+ }, {
4291
+ default: G(() => [...t[18] ||= [C(" Remove ", -1)]]),
4292
+ _: 1
4293
+ }, 8, ["onClick"])
4294
+ ]))), 128))]),
4295
+ w(k, null, {
4296
+ default: G(() => [a.value === "edit" ? (P(), y(v, {
4297
+ key: 0,
4298
+ variant: "destructive",
4299
+ onClick: h
4300
+ }, {
4301
+ default: G(() => [...t[19] ||= [C(" Remove Filter ", -1)]]),
4302
+ _: 1
4303
+ })) : b("", !0), w(v, { onClick: p }, {
4304
+ default: G(() => [C(V(a.value === "add" ? "Add Filter" : "Save changes"), 1)]),
4305
+ _: 1
4306
+ })]),
4307
+ _: 1
4308
+ })
4309
+ ]),
4310
+ _: 1
4311
+ })]),
4312
+ _: 1
4313
+ }, 8, ["open"]);
4314
+ };
4315
+ }
4316
+ }), _i = { class: "flex flex-wrap gap-2 mb-4" }, vi = { class: "truncate w-full text-left font-medium" }, yi = ["onClick"], bi = /* @__PURE__ */ T({
4317
+ __name: "Filters",
4318
+ setup(e) {
4319
+ let t = D("table"), n = D("data"), r = D("filters", L([])), { getModuleData: i, setModuleData: a } = h(), { isAdmin: o } = p(), s = L(), c = L(!1), l = () => {
4320
+ c.value || !t.value || !r.value?.length || !n.value?.length || r.value.every((e) => t.value.getColumn(e.property)) && (c.value = !0, r.value.forEach((e) => {
4321
+ let n = e.options?.filter((e) => e.checked).map((e) => e.value);
4322
+ t.value.getColumn(e.property)?.setFilterValue(n?.length ? n : void 0);
4323
+ }));
4324
+ }, u = (e) => {
4325
+ let t = crypto.randomUUID();
4326
+ (!r.value || r?.value?.length === 0) && (r.value = []), r.value.push({
4327
+ ...e,
4328
+ id: t
4329
+ }), a("filters", r.value);
4330
+ }, d = (e) => {
4331
+ r.value = r.value.map((t) => t.id === e.id ? e : t), a("filters", r.value);
4332
+ }, f = (e) => {
4333
+ r.value = r.value.filter((t) => t.id !== e), a("filters", r.value);
4334
+ };
4335
+ return U(() => n.value?.length, (e) => {
4336
+ e && e > 0 && A(() => l());
4337
+ }), U(() => t.value, () => {
4338
+ A(() => l());
4339
+ }), N(async () => {
4340
+ r.value = await i("filters") || [], A(() => l());
4341
+ }), (e, n) => {
4342
+ let i = z("Button"), a = z("DropdownMenuTrigger"), c = z("DropdownMenuCheckboxItem"), l = z("DropdownMenuContent"), p = z("DropdownMenu");
4343
+ return P(), x(_, null, [S("div", _i, [(P(!0), x(_, null, R(H(r), (e) => (P(), x("div", {
4344
+ key: e.id,
4345
+ class: "flex flex-col items-start gap-1"
4346
+ }, [w(p, null, {
4347
+ default: G(() => [w(a, { "as-child": "" }, {
4348
+ default: G(() => [w(i, {
4349
+ variant: "outline",
4350
+ class: "w-[180px] flex items-center justify-between"
4351
+ }, {
4352
+ default: G(() => [S("span", vi, V(e.label ? e.label : "Filter by " + e.property), 1), w(H(ae), { class: "size-4" })]),
4353
+ _: 2
4354
+ }, 1024)]),
4355
+ _: 2
4356
+ }, 1024), w(l, {
4357
+ align: "start",
4358
+ onCloseAutoFocus: n[1] ||= (e) => {
4359
+ e.preventDefault();
4360
+ }
4361
+ }, {
4362
+ default: G(() => [(P(!0), x(_, null, R(e.options, (r) => (P(), y(c, {
4363
+ key: r.id,
4364
+ "model-value": r.checked,
4365
+ "onUpdate:modelValue": (n) => {
4366
+ r.checked = n;
4367
+ let i = e.options?.filter((e) => e.checked).map((e) => e.value);
4368
+ H(t)?.getColumn(e.property)?.setFilterValue(i?.length ? i : void 0);
4369
+ },
4370
+ onSelect: n[0] ||= (e) => {
4371
+ e.preventDefault();
4372
+ }
4373
+ }, {
4374
+ default: G(() => [C(V(r.label), 1)]),
4375
+ _: 2
4376
+ }, 1032, ["model-value", "onUpdate:modelValue"]))), 128))]),
4377
+ _: 2
4378
+ }, 1024)]),
4379
+ _: 2
4380
+ }, 1024), H(o)() ? (P(), x("button", {
4381
+ key: 0,
4382
+ class: "text-xs text-primary hover:underline",
4383
+ onClick: (t) => s.value.openDialog(e)
4384
+ }, "Settings", 8, yi)) : b("", !0)]))), 128)), H(o)() ? (P(), y(i, {
4385
+ key: 0,
4386
+ variant: "outline",
4387
+ class: "border-dashed",
4388
+ onClick: n[2] ||= (e) => s.value.openDialog()
4389
+ }, {
4390
+ default: G(() => [w(H(q), { class: "size-4" }), n[6] ||= C(" Add filter ", -1)]),
4391
+ _: 1
4392
+ })) : b("", !0)]), w(gi, {
4393
+ ref_key: "filterDialog",
4394
+ ref: s,
4395
+ onFilterAdded: n[3] ||= (e) => u(e),
4396
+ onFilterEdited: n[4] ||= (e) => d(e),
4397
+ onFilterRemoved: n[5] ||= (e) => f(e)
4398
+ }, null, 512)], 64);
4399
+ };
4400
+ }
4401
+ }), xi = { class: "grid grid-cols-2 gap-2 mb-2 py-2" }, Si = { class: "flex flex-col items-start gap-1.5" }, Ci = { class: "flex flex-col items-start gap-1.5" }, wi = { class: "flex flex-col items-start gap-1.5 col-span-2" }, Ti = /* @__PURE__ */ T({
4402
+ __name: "ActionDialog",
4403
+ emits: [
4404
+ "actionAdded",
4405
+ "actionEdited",
4406
+ "actionRemoved"
4407
+ ],
4408
+ setup(e, { expose: t, emit: n }) {
4409
+ let r = n, i = L(!1), a = L("add"), o = L(null), s = I({
4410
+ label: "",
4411
+ icon: "",
4412
+ visible: "true",
4413
+ flow: {}
4414
+ }), c = (e) => {
4415
+ a.value = e ? "edit" : "add", o.value = e ?? null, s.label = e?.label ?? "", s.icon = e?.icon ?? "", s.visible = e?.visible ?? "true", s.flow = e?.flow ?? {}, i.value = !0;
4416
+ }, l = () => {
4417
+ a.value === "add" ? r("actionAdded", s) : r("actionEdited", {
4418
+ ...s,
4419
+ id: o.value.id
4420
+ }), i.value = !1;
4421
+ }, u = () => {
4422
+ r("actionRemoved", o.value.id), i.value = !1;
4423
+ };
4424
+ return t({ openDialog: c }), (e, t) => {
4425
+ let n = z("DialogTitle"), r = z("DialogDescription"), o = z("DialogHeader"), c = z("Label"), d = z("Input"), f = z("LucideIconPicker"), p = z("Sandbox"), m = z("FlowBuilderSelect"), h = z("Button"), g = z("DialogFooter"), _ = z("DialogScrollContent"), v = z("Dialog");
4426
+ return P(), y(v, {
4427
+ open: i.value,
4428
+ "onUpdate:open": t[4] ||= (e) => i.value = e
4429
+ }, {
4430
+ default: G(() => [w(_, { class: "sm:max-w-2xl" }, {
4431
+ default: G(() => [
4432
+ w(o, null, {
4433
+ default: G(() => [w(n, null, {
4434
+ default: G(() => [C(V(a.value === "add" ? "Add Action" : "Edit Action"), 1)]),
4435
+ _: 1
4436
+ }), w(r, null, {
4437
+ default: G(() => [C(V(a.value === "add" ? "Add a new row item action." : "Edit the selected row item action."), 1)]),
4438
+ _: 1
4439
+ })]),
4440
+ _: 1
4441
+ }),
4442
+ S("div", xi, [
4443
+ S("div", Si, [w(c, {
4444
+ for: "action_dialog_label",
4445
+ class: "text-xs text-muted-foreground"
4446
+ }, {
4447
+ default: G(() => [...t[5] ||= [C("Label", -1)]]),
4448
+ _: 1
4449
+ }), w(d, {
4450
+ id: "action_dialog_label",
4451
+ modelValue: s.label,
4452
+ "onUpdate:modelValue": t[0] ||= (e) => s.label = e
4453
+ }, null, 8, ["modelValue"])]),
4454
+ S("div", Ci, [w(c, {
4455
+ for: "action_dialog_icon",
4456
+ class: "text-xs text-muted-foreground"
4457
+ }, {
4458
+ default: G(() => [...t[6] ||= [C("Icon", -1)]]),
4459
+ _: 1
4460
+ }), w(f, {
4461
+ modelValue: s.icon,
4462
+ "onUpdate:modelValue": t[1] ||= (e) => s.icon = e
4463
+ }, null, 8, ["modelValue"])]),
4464
+ S("div", wi, [w(c, { class: "text-xs text-muted-foreground" }, {
4465
+ default: G(() => [...t[7] ||= [C("Visible", -1)]]),
4466
+ _: 1
4467
+ }), w(p, {
4468
+ modelValue: s.visible,
4469
+ "onUpdate:modelValue": t[2] ||= (e) => s.visible = e,
4470
+ variables: [],
4471
+ placeholder: "true",
4472
+ class: "w-full max-h-[200px]"
4473
+ }, null, 8, ["modelValue"])])
4474
+ ]),
4475
+ w(m, {
4476
+ modelValue: s.flow,
4477
+ "onUpdate:modelValue": t[3] ||= (e) => s.flow = e,
4478
+ variables: [{
4479
+ name: "item",
4480
+ type: "object",
4481
+ value: { data: {} },
4482
+ info: "The row item, access it with item.data"
4483
+ }],
4484
+ "flow-builder-extensions": [H(yn)()]
4485
+ }, null, 8, ["modelValue", "flow-builder-extensions"]),
4486
+ w(g, null, {
4487
+ default: G(() => [a.value === "edit" ? (P(), y(h, {
4488
+ key: 0,
4489
+ variant: "destructive",
4490
+ onClick: u
4491
+ }, {
4492
+ default: G(() => [...t[8] ||= [C(" Remove Action ", -1)]]),
4493
+ _: 1
4494
+ })) : b("", !0), w(h, { onClick: l }, {
4495
+ default: G(() => [C(V(a.value === "add" ? "Add Action" : "Save changes"), 1)]),
4496
+ _: 1
4497
+ })]),
4498
+ _: 1
4499
+ })
4500
+ ]),
4501
+ _: 1
4502
+ })]),
4503
+ _: 1
4504
+ }, 8, ["open"]);
4505
+ };
4506
+ }
4507
+ }), Ei = { class: "grid gap-4 py-4" }, Di = /* @__PURE__ */ T({
4508
+ __name: "Actions",
4509
+ setup(e) {
4510
+ let { setModuleData: t } = h(), { isAdmin: n } = p(), r = L(), i = D("itemActions", L([])), a = (e) => {
4511
+ let n = crypto.randomUUID();
4512
+ (!i.value || i?.value?.length === 0) && (i.value = []), i.value.push({
4513
+ ...e,
4514
+ id: n
4515
+ }), t("itemActions", i.value);
4516
+ }, o = (e) => {
4517
+ i.value = i.value.map((t) => t.id === e.id ? e : t), t("itemActions", i.value);
4518
+ }, s = (e) => {
4519
+ i.value = i.value.filter((t) => t.id !== e), t("itemActions", i.value);
4520
+ };
4521
+ return (e, t) => {
4522
+ let c = z("Button"), l = z("DialogTrigger"), u = z("DialogTitle"), d = z("DialogDescription"), f = z("DialogHeader"), p = z("DialogContent"), m = z("Dialog");
4523
+ return P(), x(_, null, [H(n)() ? (P(), y(m, { key: 0 }, {
4524
+ default: G(() => [w(l, { "as-child": "" }, {
4525
+ default: G(() => [w(c, {
4526
+ variant: "outline",
4527
+ class: "text-primary hover:text-primary"
4528
+ }, {
4529
+ default: G(() => [w(H(fe), { class: "size-4" }), t[4] ||= C(" Edit item actions ", -1)]),
4530
+ _: 1
4531
+ })]),
4532
+ _: 1
4533
+ }), w(p, { class: "sm:max-w-[425px]" }, {
4534
+ default: G(() => [
4535
+ w(f, null, {
4536
+ default: G(() => [w(u, null, {
4537
+ default: G(() => [...t[5] ||= [C("Edit item actions", -1)]]),
4538
+ _: 1
4539
+ }), w(d, null, {
4540
+ default: G(() => [...t[6] ||= [C(" Edit the item actions for this table. ", -1)]]),
4541
+ _: 1
4542
+ })]),
4543
+ _: 1
4544
+ }),
4545
+ w(c, { onClick: t[0] ||= (e) => r.value.openDialog() }, {
4546
+ default: G(() => [w(H(q), { class: "size-4" }), t[7] ||= C(" Add action ", -1)]),
4547
+ _: 1
4548
+ }),
4549
+ S("div", Ei, [(P(!0), x(_, null, R(H(i), (e) => (P(), y(c, {
4550
+ key: e.id,
4551
+ onClick: (t) => r.value.openDialog(e),
4552
+ variant: "outline"
4553
+ }, {
4554
+ default: G(() => [(P(), y(B(H(ge)[e.icon]))), C(" " + V(e.label), 1)]),
4555
+ _: 2
4556
+ }, 1032, ["onClick"]))), 128))])
4557
+ ]),
4558
+ _: 1
4559
+ })]),
4560
+ _: 1
4561
+ })) : b("", !0), w(Ti, {
4562
+ ref_key: "actionDialog",
4563
+ ref: r,
4564
+ onActionAdded: t[1] ||= (e) => a(e),
4565
+ onActionEdited: t[2] ||= (e) => o(e),
4566
+ onActionRemoved: t[3] ||= (e) => s(e)
4567
+ }, null, 512)], 64);
4568
+ };
4569
+ }
4570
+ }), Oi = { class: "grid grid-cols-2 gap-2 mb-2 py-2" }, ki = { class: "flex flex-col items-start gap-1.5" }, Ai = { class: "flex flex-col items-start gap-1.5" }, ji = /* @__PURE__ */ T({
4571
+ __name: "CtaActionDialog",
4572
+ setup(e, { expose: t }) {
4573
+ let { setModuleData: n } = h(), r = D("ctaButtonSettings", L({})), i = L(!1), a = L("add"), o = L(null), s = I({
4574
+ label: "",
4575
+ icon: "",
4576
+ flow: {}
4577
+ }), c = () => {
4578
+ let e = r?.value?.enabled ? r?.value : null;
4579
+ a.value = e ? "edit" : "add", o.value = e ?? null, s.label = e?.label ?? "", s.icon = e?.icon ?? "", s.flow = e?.flow ?? {}, i.value = !0;
4580
+ }, l = () => {
4581
+ r.value = {
4582
+ label: s.label,
4583
+ icon: s.icon,
4584
+ flow: s.flow,
4585
+ enabled: !0
4586
+ }, n("ctaButtonSettings", r.value), i.value = !1;
4587
+ }, u = () => {
4588
+ r.value = {
4589
+ label: "",
4590
+ icon: "",
4591
+ flow: {},
4592
+ enabled: !1
4593
+ }, n("ctaButtonSettings", r.value), i.value = !1;
4594
+ };
4595
+ return t({ openDialog: c }), (e, t) => {
4596
+ let n = z("DialogTitle"), r = z("DialogDescription"), o = z("DialogHeader"), c = z("Label"), d = z("Input"), f = z("LucideIconPicker"), p = z("FlowBuilderSelect"), m = z("Button"), h = z("DialogFooter"), g = z("DialogScrollContent"), _ = z("Dialog");
4597
+ return P(), y(_, {
4598
+ open: i.value,
4599
+ "onUpdate:open": t[3] ||= (e) => i.value = e
4600
+ }, {
4601
+ default: G(() => [w(g, { class: "sm:max-w-2xl" }, {
4602
+ default: G(() => [
4603
+ w(o, null, {
4604
+ default: G(() => [w(n, null, {
4605
+ default: G(() => [C(V(a.value === "add" ? "Add Primary Button" : "Edit Primary Button"), 1)]),
4606
+ _: 1
4607
+ }), w(r, null, {
4608
+ default: G(() => [...t[4] ||= [C(" Configure the main action button for this table module, like “+ New Item”. ", -1)]]),
4609
+ _: 1
4610
+ })]),
4611
+ _: 1
4612
+ }),
4613
+ S("div", Oi, [S("div", ki, [w(c, {
4614
+ for: "action_dialog_label",
4615
+ class: "text-xs text-muted-foreground"
4616
+ }, {
4617
+ default: G(() => [...t[5] ||= [C("Label", -1)]]),
4618
+ _: 1
4619
+ }), w(d, {
4620
+ id: "action_dialog_label",
4621
+ modelValue: s.label,
4622
+ "onUpdate:modelValue": t[0] ||= (e) => s.label = e
4623
+ }, null, 8, ["modelValue"])]), S("div", Ai, [w(c, {
4624
+ for: "action_dialog_icon",
4625
+ class: "text-xs text-muted-foreground"
4626
+ }, {
4627
+ default: G(() => [...t[6] ||= [C("Icon", -1)]]),
4628
+ _: 1
4629
+ }), w(f, {
4630
+ modelValue: s.icon,
4631
+ "onUpdate:modelValue": t[1] ||= (e) => s.icon = e
4632
+ }, null, 8, ["modelValue"])])]),
4633
+ w(p, {
4634
+ modelValue: s.flow,
4635
+ "onUpdate:modelValue": t[2] ||= (e) => s.flow = e,
4636
+ allAvailableVariables: [],
4637
+ "flow-builder-extensions": [H(yn)()]
4638
+ }, null, 8, ["modelValue", "flow-builder-extensions"]),
4639
+ w(h, null, {
4640
+ default: G(() => [a.value === "edit" ? (P(), y(m, {
4641
+ key: 0,
4642
+ variant: "destructive",
4643
+ onClick: u
4644
+ }, {
4645
+ default: G(() => [...t[7] ||= [C(" Remove Button ", -1)]]),
4646
+ _: 1
4647
+ })) : b("", !0), w(m, { onClick: l }, {
4648
+ default: G(() => [C(V(a.value === "add" ? "Add Button" : "Save Changes"), 1)]),
4649
+ _: 1
4650
+ })]),
4651
+ _: 1
4652
+ })
4653
+ ]),
4654
+ _: 1
4655
+ })]),
4656
+ _: 1
4657
+ }, 8, ["open"]);
4658
+ };
4659
+ }
4660
+ }), Mi = { class: "@container relative" }, Ni = {
4661
+ ref: "container",
4662
+ class: "flex flex-col items-start gap-4 w-full mt-12 mb-8"
4663
+ }, Pi = { class: "w-full flex flex-wrap gap-2 items-start" }, Fi = { class: "w-full flex gap-2 items-start justify-between" }, Ii = { class: "flex gap-2" }, Li = {
4664
+ key: 1,
4665
+ class: "flex flex-col items-start gap-1"
4666
+ }, Ri = /* @__PURE__ */ T({
4667
+ __name: "TableView",
4668
+ props: { config: {
4669
+ type: Object,
4670
+ required: !0
4671
+ } },
4672
+ setup(e) {
4673
+ let t = e, n = m(), { isAdmin: r } = p(), { getModuleData: i } = h(), { runFlow: o } = d();
4674
+ f(() => []);
4675
+ let s = L(), c = L(), l = L([]), u = L([]), g = L(), T = L(!1), E = L(""), D = L(), O = L([]), k = L([]), A = L(!1), j = L(null), M = L(null), I = v(() => t.config?.getItems?.integration), R = async () => {
4676
+ M.value = await i("dateRangeFilter");
4677
+ }, ee = async () => M.value === null ? await i("dateRangeFilter") : M.value, te = async () => {
4678
+ let e = await ee(), t;
4679
+ return e && (t = {
4680
+ name: "dateRangeFilter",
4681
+ type: "dateRangeFilter",
4682
+ value: {
4683
+ from: D.value?.[0],
4684
+ to: D.value?.[1]
4685
+ }
4686
+ }), [...Object.entries(n.query).map(([e, t]) => ({
4687
+ name: K(e),
4688
+ type: "routeQueryParam",
4689
+ value: t ?? null
4690
+ })) || [], t].filter(Boolean);
4691
+ }, U = async () => {
4692
+ let e = t.config?.getItems ? JSON.parse(JSON.stringify(t.config?.getItems)) : null;
4693
+ e && (l.value = await o(e, await te()) || []);
4694
+ }, W = async () => {
4695
+ u.value = await i("columns"), k.value = await i("itemActions") || [], j.value = await i("ctaButtonSettings") || {};
4696
+ };
4697
+ function K(e) {
4698
+ return e.replace(/-([a-z])/g, (e, t) => t.toUpperCase());
4699
+ }
4700
+ let ne = () => {
4701
+ c.value.saveSortMode(), T.value = !1;
4702
+ }, re = async () => {
4703
+ let e = (/* @__PURE__ */ new Date()).getTime(), t = await te();
4704
+ console.log("got context in ", (/* @__PURE__ */ new Date()).getTime() - e, "ms"), await o(j.value.flow, t, [], [yn({ tableRowActions: { create: (e) => {
4705
+ l.value.push(e);
4706
+ } } })]);
4707
+ }, ie = () => {
4708
+ a(l.value, "data.csv");
4709
+ };
4710
+ return N(() => {
4711
+ W(), R();
4712
+ }), F("data", l), F("columns", u), F("table", g), F("sortMode", T), F("sortModeProperty", E), F("dateRangeFilter", D), F("filters", O), F("itemActions", k), F("isPerformingDataTableAction", A), F("ctaButtonSettings", j), F("integrationId", I), F("getTableData", U), F("saveSortMode", ne), (e, t) => {
4713
+ let n = z("Button");
4714
+ return P(), x(_, null, [S("div", Mi, [S("div", Ni, [
4715
+ w(fr),
4716
+ S("div", Pi, [
4717
+ w(Br),
4718
+ w(si),
4719
+ w(Jr),
4720
+ w(zr)
4721
+ ]),
4722
+ S("div", Fi, [w(bi), S("div", Ii, [H(r)() ? (P(), y(Di, { key: 0 })) : b("", !0), j.value?.enabled ? (P(), x("div", Li, [w(n, {
4723
+ onClick: re,
4724
+ disabled: A.value
4725
+ }, {
4726
+ default: G(() => [(P(), y(B(H(ge)[j.value?.icon]), { class: "size-4" })), C(" " + V(j.value?.label), 1)]),
4727
+ _: 1
4728
+ }, 8, ["disabled"]), H(r)() ? (P(), x("button", {
4729
+ key: 0,
4730
+ class: "text-xs text-primary hover:underline",
4731
+ onClick: t[0] ||= (e) => s.value.openDialog()
4732
+ }, "Settings")) : b("", !0)])) : j.value && H(r)() ? (P(), y(n, {
4733
+ key: 2,
4734
+ variant: "outline",
4735
+ class: "border-primary dark:border-primary border-dashed text-primary dark:text-primary",
4736
+ onClick: t[1] ||= (e) => s.value.openDialog()
4737
+ }, {
4738
+ default: G(() => [w(H(q), { class: "size-4" }), t[2] ||= C(" Set primary button ", -1)]),
4739
+ _: 1
4740
+ })) : b("", !0)])]),
4741
+ w(Qn, {
4742
+ ref_key: "tableRef",
4743
+ ref: c
4744
+ }, null, 512),
4745
+ w(n, { onClick: ie }, {
4746
+ default: G(() => [...t[3] ||= [C(" Download data ", -1)]]),
4747
+ _: 1
4748
+ })
4749
+ ], 512)]), w(ji, {
4750
+ ref_key: "ctaActionDialog",
4751
+ ref: s
4752
+ }, null, 512)], 64);
4753
+ };
4754
+ }
4755
+ });
4756
+ //#endregion
4757
+ export { Ri as default };